orbcafe-ui 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +17 -17
- 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'),Kt=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'),Pp=require('@mui/material/Dialog'),Rp=require('@mui/material/DialogTitle'),Mp=require('@mui/material/DialogContent'),yh=require('@mui/material/DialogContentText'),Dp=require('@mui/material/DialogActions'),pi=require('@mui/material/Box'),Ch=require('@mui/icons-material/CheckCircle'),kh=require('@mui/icons-material/Warning'),Sh=require('@mui/icons-material/Error'),wh=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),Nh=require('@mui/icons-material/Clear'),Vh=require('@mui/icons-material/Close'),lu=require('@mui/icons-material/Search'),Xx=require('@mui/material/Paper'),Yx=require('@mui/material/Table'),Qx=require('@mui/material/TableBody'),ec=require('@mui/material/TableCell'),Fp=require('@mui/material/TableContainer'),mb=require('@mui/material/TableHead'),gb=require('@mui/material/TableRow'),Ap=require('@mui/material/TextField'),Ml=require('@mui/material/Button'),Bp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Jh=require('@mui/icons-material/ViewColumn'),kp=require('@mui/icons-material/Save'),tb=require('@mui/icons-material/Download'),ob=require('@mui/icons-material/AccountTree'),ab=require('@mui/icons-material/Functions'),rb=require('@mui/icons-material/Insights'),Pu=require('@mui/icons-material/Add'),ib=require('@mui/icons-material/Edit'),lb=require('@mui/icons-material/Delete'),sb=require('@mui/icons-material/KeyboardArrowLeft'),Df=require('@mui/icons-material/KeyboardArrowRight'),fb=require('@mui/material/Checkbox'),hb=require('@mui/material/TableSortLabel'),bb=require('@mui/material/IconButton'),yb=require('@mui/material/Tooltip'),xb=require('@mui/icons-material/UnfoldMore'),vb=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),Db=require('@mui/icons-material/KeyboardArrowDown'),Ub=require('@mui/icons-material/Check'),wu=require('@mui/icons-material/ClearAll'),Tu=require('@mui/icons-material/ArrowUpward'),Iu=require('@mui/icons-material/ArrowDownward'),Kb=require('@mui/icons-material/VisibilityOff'),jb=require('@mui/icons-material/DeleteOutline'),Ay=require('@mui/icons-material/MicNoneOutlined'),By=require('@mui/icons-material/SettingsOutlined'),Fy=require('@mui/icons-material/SendOutlined'),Rx=require('@mui/icons-material/Settings'),Mx=require('@mui/icons-material/KeyboardArrowUp'),Ax=require('@mui/icons-material/ArrowRightAlt'),ex=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'),mx=require('@mui/icons-material/CalendarMonth'),fx=require('@mui/icons-material/ArrowForward'),Ia=require('dayjs'),hx=require('dayjs/plugin/isBetween'),bx=require('dayjs/plugin/localizedFormat'),yx=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var Kx=require('@mui/icons-material/StarBorder'),qx=require('@mui/icons-material/ViewQuilt'),gv=require('@mui/icons-material/CloseOutlined'),g0=require('@mui/icons-material/ContentCopyOutlined'),f0=require('@mui/icons-material/CheckOutlined'),U0=require('@mui/icons-material/ExpandMore'),oC=require('@mui/icons-material/AddRounded'),mm=require('@mui/icons-material/Language'),aC=require('@mui/icons-material/DesktopWindows'),rC=require('@mui/icons-material/DarkMode'),nC=require('@mui/icons-material/LightMode'),lC=require('@mui/icons-material/Logout'),DC=require('@mui/icons-material/DragIndicator'),jC=require('@mui/icons-material/FilterList'),ZC=require('@mui/icons-material/TableRows'),LC=require('@mui/icons-material/LayersClear'),_k=require('@mui/icons-material/CameraAltRounded'),jk=require('@mui/icons-material/QrCodeScannerRounded'),Qk=require('@mui/icons-material/DragIndicatorRounded'),oS=require('@mui/icons-material/BackspaceRounded'),aS=require('@mui/icons-material/CloseRounded'),rS=require('@mui/icons-material/CheckRounded'),xS=require('@mui/icons-material/SearchRounded'),vS=require('@mui/icons-material/MenuOpenRounded'),CS=require('@mui/icons-material/MenuRounded'),kS=require('@mui/icons-material/ExpandMoreRounded'),SS=require('@mui/icons-material/ChevronRightRounded'),QS=require('next/dynamic'),framerMotion=require('framer-motion'),d1=require('react-markdown'),u1=require('remark-gfm'),p1=require('remark-math'),m1=require('rehype-katex'),g1=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),qg=require('mermaid'),T1=require('@mui/icons-material/MicRounded'),I1=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),A1=require('@mui/icons-material/SendRounded'),F1=require('@mui/icons-material/HardwareRounded'),iT=require('@mui/icons-material/LockOutlined'),Sf=require('@mui/icons-material/MailOutline'),wf=require('@mui/icons-material/PersonOutline'),lT=require('@mui/icons-material/VpnKeyOutlined'),ST=require('dayjs/plugin/isoWeek'),WT=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),$T=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),GT=require('@mui/icons-material/SplitscreenOutlined'),UT=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 Kt__namespace=/*#__PURE__*/_interopNamespace(Kt);var Pp__default=/*#__PURE__*/_interopDefault(Pp);var Rp__default=/*#__PURE__*/_interopDefault(Rp);var Mp__default=/*#__PURE__*/_interopDefault(Mp);var yh__default=/*#__PURE__*/_interopDefault(yh);var Dp__default=/*#__PURE__*/_interopDefault(Dp);var pi__default=/*#__PURE__*/_interopDefault(pi);var Ch__default=/*#__PURE__*/_interopDefault(Ch);var kh__default=/*#__PURE__*/_interopDefault(kh);var Sh__default=/*#__PURE__*/_interopDefault(Sh);var wh__default=/*#__PURE__*/_interopDefault(wh);var Nh__default=/*#__PURE__*/_interopDefault(Nh);var Vh__default=/*#__PURE__*/_interopDefault(Vh);var lu__default=/*#__PURE__*/_interopDefault(lu);var Xx__default=/*#__PURE__*/_interopDefault(Xx);var Yx__default=/*#__PURE__*/_interopDefault(Yx);var Qx__default=/*#__PURE__*/_interopDefault(Qx);var ec__default=/*#__PURE__*/_interopDefault(ec);var Fp__default=/*#__PURE__*/_interopDefault(Fp);var mb__default=/*#__PURE__*/_interopDefault(mb);var gb__default=/*#__PURE__*/_interopDefault(gb);var Ap__default=/*#__PURE__*/_interopDefault(Ap);var Ml__default=/*#__PURE__*/_interopDefault(Ml);var Bp__default=/*#__PURE__*/_interopDefault(Bp);var Jh__default=/*#__PURE__*/_interopDefault(Jh);var kp__default=/*#__PURE__*/_interopDefault(kp);var tb__default=/*#__PURE__*/_interopDefault(tb);var ob__default=/*#__PURE__*/_interopDefault(ob);var ab__default=/*#__PURE__*/_interopDefault(ab);var rb__default=/*#__PURE__*/_interopDefault(rb);var Pu__default=/*#__PURE__*/_interopDefault(Pu);var ib__default=/*#__PURE__*/_interopDefault(ib);var lb__default=/*#__PURE__*/_interopDefault(lb);var sb__default=/*#__PURE__*/_interopDefault(sb);var Df__default=/*#__PURE__*/_interopDefault(Df);var fb__default=/*#__PURE__*/_interopDefault(fb);var hb__default=/*#__PURE__*/_interopDefault(hb);var bb__default=/*#__PURE__*/_interopDefault(bb);var yb__default=/*#__PURE__*/_interopDefault(yb);var xb__default=/*#__PURE__*/_interopDefault(xb);var vb__default=/*#__PURE__*/_interopDefault(vb);var Db__default=/*#__PURE__*/_interopDefault(Db);var Ub__default=/*#__PURE__*/_interopDefault(Ub);var wu__default=/*#__PURE__*/_interopDefault(wu);var Tu__default=/*#__PURE__*/_interopDefault(Tu);var Iu__default=/*#__PURE__*/_interopDefault(Iu);var Kb__default=/*#__PURE__*/_interopDefault(Kb);var jb__default=/*#__PURE__*/_interopDefault(jb);var Ay__default=/*#__PURE__*/_interopDefault(Ay);var By__default=/*#__PURE__*/_interopDefault(By);var Fy__default=/*#__PURE__*/_interopDefault(Fy);var Rx__default=/*#__PURE__*/_interopDefault(Rx);var Mx__default=/*#__PURE__*/_interopDefault(Mx);var Ax__default=/*#__PURE__*/_interopDefault(Ax);var ex__default=/*#__PURE__*/_interopDefault(ex);var mx__default=/*#__PURE__*/_interopDefault(mx);var fx__default=/*#__PURE__*/_interopDefault(fx);var Ia__default=/*#__PURE__*/_interopDefault(Ia);var hx__default=/*#__PURE__*/_interopDefault(hx);var bx__default=/*#__PURE__*/_interopDefault(bx);var yx__default=/*#__PURE__*/_interopDefault(yx);var Kx__default=/*#__PURE__*/_interopDefault(Kx);var qx__default=/*#__PURE__*/_interopDefault(qx);var gv__default=/*#__PURE__*/_interopDefault(gv);var g0__default=/*#__PURE__*/_interopDefault(g0);var f0__default=/*#__PURE__*/_interopDefault(f0);var U0__default=/*#__PURE__*/_interopDefault(U0);var oC__default=/*#__PURE__*/_interopDefault(oC);var mm__default=/*#__PURE__*/_interopDefault(mm);var aC__default=/*#__PURE__*/_interopDefault(aC);var rC__default=/*#__PURE__*/_interopDefault(rC);var nC__default=/*#__PURE__*/_interopDefault(nC);var lC__default=/*#__PURE__*/_interopDefault(lC);var DC__default=/*#__PURE__*/_interopDefault(DC);var jC__default=/*#__PURE__*/_interopDefault(jC);var ZC__default=/*#__PURE__*/_interopDefault(ZC);var LC__default=/*#__PURE__*/_interopDefault(LC);var _k__default=/*#__PURE__*/_interopDefault(_k);var jk__default=/*#__PURE__*/_interopDefault(jk);var Qk__default=/*#__PURE__*/_interopDefault(Qk);var oS__default=/*#__PURE__*/_interopDefault(oS);var aS__default=/*#__PURE__*/_interopDefault(aS);var rS__default=/*#__PURE__*/_interopDefault(rS);var xS__default=/*#__PURE__*/_interopDefault(xS);var vS__default=/*#__PURE__*/_interopDefault(vS);var CS__default=/*#__PURE__*/_interopDefault(CS);var kS__default=/*#__PURE__*/_interopDefault(kS);var SS__default=/*#__PURE__*/_interopDefault(SS);var QS__default=/*#__PURE__*/_interopDefault(QS);var d1__default=/*#__PURE__*/_interopDefault(d1);var u1__default=/*#__PURE__*/_interopDefault(u1);var p1__default=/*#__PURE__*/_interopDefault(p1);var m1__default=/*#__PURE__*/_interopDefault(m1);var g1__default=/*#__PURE__*/_interopDefault(g1);var qg__default=/*#__PURE__*/_interopDefault(qg);var T1__default=/*#__PURE__*/_interopDefault(T1);var I1__default=/*#__PURE__*/_interopDefault(I1);var A1__default=/*#__PURE__*/_interopDefault(A1);var F1__default=/*#__PURE__*/_interopDefault(F1);var iT__default=/*#__PURE__*/_interopDefault(iT);var Sf__default=/*#__PURE__*/_interopDefault(Sf);var wf__default=/*#__PURE__*/_interopDefault(wf);var lT__default=/*#__PURE__*/_interopDefault(lT);var ST__default=/*#__PURE__*/_interopDefault(ST);var WT__default=/*#__PURE__*/_interopDefault(WT);var $T__default=/*#__PURE__*/_interopDefault($T);var GT__default=/*#__PURE__*/_interopDefault(GT);var UT__default=/*#__PURE__*/_interopDefault(UT);var $d=Object.defineProperty;var Of=(e,t,o)=>t in e?$d(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Hf=(e,t)=>()=>(e&&(t=e(e=0)),t);var Wf=(e,t)=>{for(var o in t)$d(e,o,{get:t[o],enumerable:true});};var Gd=(e,t,o)=>Of(e,t+"",o);var Ng={};Wf(Ng,{COrbCanvas:()=>ZS});function ZS({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=Kt.useRef(null),i=`
|
|
1
|
+
'use strict';var ogl=require('ogl'),Kt=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'),Hp=require('@mui/material/Dialog'),Wp=require('@mui/material/DialogTitle'),$p=require('@mui/material/DialogContent'),Oh=require('@mui/material/DialogContentText'),Gp=require('@mui/material/DialogActions'),Ci=require('@mui/material/Box'),Wh=require('@mui/icons-material/CheckCircle'),$h=require('@mui/icons-material/Warning'),Gh=require('@mui/icons-material/Error'),Uh=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),rb=require('@mui/icons-material/Clear'),ab=require('@mui/icons-material/Close'),xu=require('@mui/icons-material/Search'),h0=require('@mui/material/Paper'),b0=require('@mui/material/Table'),y0=require('@mui/material/TableBody'),dc=require('@mui/material/TableCell'),_p=require('@mui/material/TableContainer'),Eb=require('@mui/material/TableHead'),Fb=require('@mui/material/TableRow'),Up=require('@mui/material/TextField'),Ol=require('@mui/material/Button'),Kp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),xb=require('@mui/icons-material/ViewColumn'),Lp=require('@mui/icons-material/Save'),Cb=require('@mui/icons-material/Download'),kb=require('@mui/icons-material/AccountTree'),Sb=require('@mui/icons-material/Functions'),wb=require('@mui/icons-material/Insights'),Hu=require('@mui/icons-material/Add'),Ib=require('@mui/icons-material/Edit'),Pb=require('@mui/icons-material/Delete'),Rb=require('@mui/icons-material/KeyboardArrowLeft'),Xf=require('@mui/icons-material/KeyboardArrowRight'),Lb=require('@mui/material/Checkbox'),zb=require('@mui/material/TableSortLabel'),Nb=require('@mui/material/IconButton'),Ob=require('@mui/material/Tooltip'),Vb=require('@mui/icons-material/UnfoldMore'),Hb=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),Xb=require('@mui/icons-material/KeyboardArrowDown'),dy=require('@mui/icons-material/Check'),Nu=require('@mui/icons-material/ClearAll'),Ou=require('@mui/icons-material/ArrowUpward'),Vu=require('@mui/icons-material/ArrowDownward'),uy=require('@mui/icons-material/VisibilityOff'),gy=require('@mui/icons-material/DeleteOutline'),Yy=require('@mui/icons-material/MicNoneOutlined'),Qy=require('@mui/icons-material/SettingsOutlined'),Jy=require('@mui/icons-material/SendOutlined'),jx=require('@mui/icons-material/Settings'),Zx=require('@mui/icons-material/KeyboardArrowUp'),Yx=require('@mui/icons-material/ArrowRightAlt'),vx=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'),Ex=require('@mui/icons-material/CalendarMonth'),Lx=require('@mui/icons-material/ArrowForward'),Ar=require('dayjs'),zx=require('dayjs/plugin/isBetween'),Nx=require('dayjs/plugin/localizedFormat'),Ox=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var u0=require('@mui/icons-material/StarBorder'),p0=require('@mui/icons-material/ViewQuilt'),Fv=require('@mui/icons-material/CloseOutlined'),F0=require('@mui/icons-material/ContentCopyOutlined'),L0=require('@mui/icons-material/CheckOutlined'),dv=require('@mui/icons-material/ExpandMore'),CC=require('@mui/icons-material/AddRounded'),Im=require('@mui/icons-material/Language'),kC=require('@mui/icons-material/DesktopWindows'),SC=require('@mui/icons-material/DarkMode'),wC=require('@mui/icons-material/LightMode'),IC=require('@mui/icons-material/Logout'),ZC=require('@mui/icons-material/DragIndicator'),mk=require('@mui/icons-material/FilterList'),gk=require('@mui/icons-material/TableRows'),ek=require('@mui/icons-material/LayersClear'),pS=require('@mui/icons-material/CameraAltRounded'),mS=require('@mui/icons-material/QrCodeScannerRounded'),bS=require('@mui/icons-material/DragIndicatorRounded'),CS=require('@mui/icons-material/BackspaceRounded'),kS=require('@mui/icons-material/CloseRounded'),SS=require('@mui/icons-material/CheckRounded'),OS=require('@mui/icons-material/SearchRounded'),VS=require('@mui/icons-material/MenuOpenRounded'),HS=require('@mui/icons-material/MenuRounded'),WS=require('@mui/icons-material/ExpandMoreRounded'),$S=require('@mui/icons-material/ChevronRightRounded'),bw=require('next/dynamic'),framerMotion=require('framer-motion'),M1=require('react-markdown'),D1=require('remark-gfm'),A1=require('remark-math'),B1=require('rehype-katex'),E1=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),lf=require('mermaid'),U1=require('@mui/icons-material/MicRounded'),K1=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),X1=require('@mui/icons-material/SendRounded'),Q1=require('@mui/icons-material/HardwareRounded'),AT=require('@mui/icons-material/LockOutlined'),Gf=require('@mui/icons-material/MailOutline'),Uf=require('@mui/icons-material/PersonOutline'),BT=require('@mui/icons-material/VpnKeyOutlined'),ZT=require('dayjs/plugin/isoWeek'),mI=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),gI=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),fI=require('@mui/icons-material/SplitscreenOutlined'),hI=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 Kt__namespace=/*#__PURE__*/_interopNamespace(Kt);var Hp__default=/*#__PURE__*/_interopDefault(Hp);var Wp__default=/*#__PURE__*/_interopDefault(Wp);var $p__default=/*#__PURE__*/_interopDefault($p);var Oh__default=/*#__PURE__*/_interopDefault(Oh);var Gp__default=/*#__PURE__*/_interopDefault(Gp);var Ci__default=/*#__PURE__*/_interopDefault(Ci);var Wh__default=/*#__PURE__*/_interopDefault(Wh);var $h__default=/*#__PURE__*/_interopDefault($h);var Gh__default=/*#__PURE__*/_interopDefault(Gh);var Uh__default=/*#__PURE__*/_interopDefault(Uh);var rb__default=/*#__PURE__*/_interopDefault(rb);var ab__default=/*#__PURE__*/_interopDefault(ab);var xu__default=/*#__PURE__*/_interopDefault(xu);var h0__default=/*#__PURE__*/_interopDefault(h0);var b0__default=/*#__PURE__*/_interopDefault(b0);var y0__default=/*#__PURE__*/_interopDefault(y0);var dc__default=/*#__PURE__*/_interopDefault(dc);var _p__default=/*#__PURE__*/_interopDefault(_p);var Eb__default=/*#__PURE__*/_interopDefault(Eb);var Fb__default=/*#__PURE__*/_interopDefault(Fb);var Up__default=/*#__PURE__*/_interopDefault(Up);var Ol__default=/*#__PURE__*/_interopDefault(Ol);var Kp__default=/*#__PURE__*/_interopDefault(Kp);var xb__default=/*#__PURE__*/_interopDefault(xb);var Lp__default=/*#__PURE__*/_interopDefault(Lp);var Cb__default=/*#__PURE__*/_interopDefault(Cb);var kb__default=/*#__PURE__*/_interopDefault(kb);var Sb__default=/*#__PURE__*/_interopDefault(Sb);var wb__default=/*#__PURE__*/_interopDefault(wb);var Hu__default=/*#__PURE__*/_interopDefault(Hu);var Ib__default=/*#__PURE__*/_interopDefault(Ib);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Rb__default=/*#__PURE__*/_interopDefault(Rb);var Xf__default=/*#__PURE__*/_interopDefault(Xf);var Lb__default=/*#__PURE__*/_interopDefault(Lb);var zb__default=/*#__PURE__*/_interopDefault(zb);var Nb__default=/*#__PURE__*/_interopDefault(Nb);var Ob__default=/*#__PURE__*/_interopDefault(Ob);var Vb__default=/*#__PURE__*/_interopDefault(Vb);var Hb__default=/*#__PURE__*/_interopDefault(Hb);var Xb__default=/*#__PURE__*/_interopDefault(Xb);var dy__default=/*#__PURE__*/_interopDefault(dy);var Nu__default=/*#__PURE__*/_interopDefault(Nu);var Ou__default=/*#__PURE__*/_interopDefault(Ou);var Vu__default=/*#__PURE__*/_interopDefault(Vu);var uy__default=/*#__PURE__*/_interopDefault(uy);var gy__default=/*#__PURE__*/_interopDefault(gy);var Yy__default=/*#__PURE__*/_interopDefault(Yy);var Qy__default=/*#__PURE__*/_interopDefault(Qy);var Jy__default=/*#__PURE__*/_interopDefault(Jy);var jx__default=/*#__PURE__*/_interopDefault(jx);var Zx__default=/*#__PURE__*/_interopDefault(Zx);var Yx__default=/*#__PURE__*/_interopDefault(Yx);var vx__default=/*#__PURE__*/_interopDefault(vx);var Ex__default=/*#__PURE__*/_interopDefault(Ex);var Lx__default=/*#__PURE__*/_interopDefault(Lx);var Ar__default=/*#__PURE__*/_interopDefault(Ar);var zx__default=/*#__PURE__*/_interopDefault(zx);var Nx__default=/*#__PURE__*/_interopDefault(Nx);var Ox__default=/*#__PURE__*/_interopDefault(Ox);var u0__default=/*#__PURE__*/_interopDefault(u0);var p0__default=/*#__PURE__*/_interopDefault(p0);var Fv__default=/*#__PURE__*/_interopDefault(Fv);var F0__default=/*#__PURE__*/_interopDefault(F0);var L0__default=/*#__PURE__*/_interopDefault(L0);var dv__default=/*#__PURE__*/_interopDefault(dv);var CC__default=/*#__PURE__*/_interopDefault(CC);var Im__default=/*#__PURE__*/_interopDefault(Im);var kC__default=/*#__PURE__*/_interopDefault(kC);var SC__default=/*#__PURE__*/_interopDefault(SC);var wC__default=/*#__PURE__*/_interopDefault(wC);var IC__default=/*#__PURE__*/_interopDefault(IC);var ZC__default=/*#__PURE__*/_interopDefault(ZC);var mk__default=/*#__PURE__*/_interopDefault(mk);var gk__default=/*#__PURE__*/_interopDefault(gk);var ek__default=/*#__PURE__*/_interopDefault(ek);var pS__default=/*#__PURE__*/_interopDefault(pS);var mS__default=/*#__PURE__*/_interopDefault(mS);var bS__default=/*#__PURE__*/_interopDefault(bS);var CS__default=/*#__PURE__*/_interopDefault(CS);var kS__default=/*#__PURE__*/_interopDefault(kS);var SS__default=/*#__PURE__*/_interopDefault(SS);var OS__default=/*#__PURE__*/_interopDefault(OS);var VS__default=/*#__PURE__*/_interopDefault(VS);var HS__default=/*#__PURE__*/_interopDefault(HS);var WS__default=/*#__PURE__*/_interopDefault(WS);var $S__default=/*#__PURE__*/_interopDefault($S);var bw__default=/*#__PURE__*/_interopDefault(bw);var M1__default=/*#__PURE__*/_interopDefault(M1);var D1__default=/*#__PURE__*/_interopDefault(D1);var A1__default=/*#__PURE__*/_interopDefault(A1);var B1__default=/*#__PURE__*/_interopDefault(B1);var E1__default=/*#__PURE__*/_interopDefault(E1);var lf__default=/*#__PURE__*/_interopDefault(lf);var U1__default=/*#__PURE__*/_interopDefault(U1);var K1__default=/*#__PURE__*/_interopDefault(K1);var X1__default=/*#__PURE__*/_interopDefault(X1);var Q1__default=/*#__PURE__*/_interopDefault(Q1);var AT__default=/*#__PURE__*/_interopDefault(AT);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var Uf__default=/*#__PURE__*/_interopDefault(Uf);var BT__default=/*#__PURE__*/_interopDefault(BT);var ZT__default=/*#__PURE__*/_interopDefault(ZT);var mI__default=/*#__PURE__*/_interopDefault(mI);var gI__default=/*#__PURE__*/_interopDefault(gI);var fI__default=/*#__PURE__*/_interopDefault(fI);var hI__default=/*#__PURE__*/_interopDefault(hI);var eu=Object.defineProperty;var nh=(e,t,o)=>t in e?eu(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var ih=(e,t)=>()=>(e&&(t=e(e=0)),t);var lh=(e,t)=>{for(var o in t)eu(e,o,{get:t[o],enumerable:true});};var tu=(e,t,o)=>nh(e,t+"",o);var Yg={};lh(Yg,{COrbCanvas:()=>gw});function gw({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:r=false,backgroundColor:a="transparent"}){let n=Kt.useRef(null),i=`
|
|
2
2
|
precision highp float;
|
|
3
3
|
attribute vec2 position;
|
|
4
4
|
attribute vec2 uv;
|
|
@@ -180,22 +180,22 @@
|
|
|
180
180
|
vec4 col = mainImage(fragCoord);
|
|
181
181
|
gl_FragColor = vec4(col.rgb * col.a, col.a);
|
|
182
182
|
}
|
|
183
|
-
`;return Kt.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:zg(r)}}}),m=new ogl.Mesh(s,{geometry:g,program:f});function h(){if(!d)return;let R=window.devicePixelRatio||1,S=d.clientWidth,I=d.clientHeight;l.setSize(S*R,I*R),s.canvas.style.width=S+"px",s.canvas.style.height=I+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let C=0,u=0,v=0,p=.3,b=R=>{let S=d.getBoundingClientRect(),I=R.clientX-S.left,k=R.clientY-S.top,w=S.width,A=S.height,P=Math.min(w,A),M=w/2,B=A/2,j=(I-M)/P*2,O=(k-B)/P*2;Math.sqrt(j*j+O*O)<.8?C=1:C=0;},y=()=>{C=0;};d.addEventListener("mousemove",b),d.addEventListener("mouseleave",y);let T,F=R=>{T=requestAnimationFrame(F);let S=(R-u)*.001;u=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=zg(r);let I=a?1:C;f.uniforms.hover.value+=(I-f.uniforms.hover.value)*.1,o&&I>.5&&(v+=S*p),f.uniforms.rot.value=v,l.render({scene:m});};return T=requestAnimationFrame(F),()=>{cancelAnimationFrame(T),window.removeEventListener("resize",h),d.removeEventListener("mousemove",b),d.removeEventListener("mouseleave",y),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 XS(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 zg(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 XS(a,r,n)}return new ogl.Vec3(0,0,0)}var Vg=Hf(()=>{"use client";});function Xo(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Vs={primary:"#000000",primaryHover:"#333333"},Ki={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"},_n={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Ud=()=>"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 qf=classVarianceAuthority.cva(Ud(),{variants:{variant:{default:`${Ki.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:`${Ki.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:Ki.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":`bg-[${Vs.primary}] hover:bg-[${Vs.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:_n.none,sm:_n.sm,md:_n.md,full:_n.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Os=Kt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:Xo(qf({variant:t,size:o,className:e})),ref:n,...r}));Os.displayName="Button";var jf={"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.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","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}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","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","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","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"},Zf={"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.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","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}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","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","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","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"},Xf={"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.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","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}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","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","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","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"},Yf={"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.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","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","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","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","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","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"},Qf={"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.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","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","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","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","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","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"},Jf={"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.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","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","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","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","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","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"},jn={en:jf,zh:Zf,fr:Xf,de:Yf,ja:Qf,ko:Jf};var qd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,ah={locale:"en",t:(e,t)=>qd(jn.en[e]||e,t)},_d=Kt.createContext(ah),qi=({locale:e="en",messages:t,children:o})=>{let a=Kt.useMemo(()=>{let r=jn[e]||jn.en,n=t?.[e]||{},i={...jn.en,...r,...n};return {locale:e,t:(c,d)=>qd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(_d.Provider,{value:a,children:o})},re=()=>Kt.useContext(_d);function Ws({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=re(),d=i==="dark",l=navigation.usePathname(),[s,g]=Kt.useState(false),[f,m]=Kt.useState(new Set),h=r!==void 0&&n!==void 0,C=h?r:f;Kt.useEffect(()=>{g(true);},[]);let u=p=>{if(h)n(p);else {let b=new Set(f);b.has(p)?b.delete(p):b.add(p),m(b);}},v=p=>{p.children&&p.children.length>0&&u(p.id),t&&t(p);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:Xo("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:Xo("tree-menu",o),children:e.map(p=>{let b=C.has(p.id)||p.isExpanded,y=p.children&&p.children.length>0,T=p.appurl||p.href,F=s&&T?l===T:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[F&&jsxRuntime.jsx("div",{className:Xo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Os,{variant:"ghost",className:Xo("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(p),children:[y&&jsxRuntime.jsx("div",{className:Xo("flex-shrink-0 transition-transform duration-200",b&&"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"})}),!y&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),p.icon&&jsxRuntime.jsx("div",{className:Xo("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:p.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:Xo("text-sm truncate transition-colors duration-200",F?"font-semibold":"font-medium"),children:p.title||p.label}),p.description&&jsxRuntime.jsx("div",{className:Xo("text-xs truncate transition-colors duration-200",F?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:p.description,children:p.description})]})]}),y&&jsxRuntime.jsx("div",{className:Xo("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(Ws,{items:p.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},p.id)})})}var Gs=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",displayMode:i="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true})=>{let{t:l}=re(),s=n==="dark",g=i==="floating",f=Kt__namespace.default.useId().replace(/:/g,""),m=`orbcafe-nav-mode-arc-${f}`,h=`orbcafe-nav-mode-glow-${f}`,C=navigation.useRouter(),[u,v]=Kt.useState(""),[p,b]=Kt.useState(new Set);Kt.useEffect(()=>{e&&b(new Set);},[e]);let y=Kt.useCallback(I=>{let k=[],w=A=>{A.forEach(P=>{k.push(P.id),P.children&&w(P.children);});};return w(I),k},[]),T=Kt.useMemo(()=>{if(!u.trim())return r;let I=k=>k.reduce((w,A)=>{let P=A.title?.toLowerCase().includes(u.toLowerCase())||A.description?.toLowerCase().includes(u.toLowerCase()),M=A.children?I(A.children):[];return (P||M.length>0)&&w.push({...A,children:M.length>0?M:A.children}),w},[]);return I(r)},[u,r]),F=Kt.useMemo(()=>u.trim()?new Set(y(r)):p,[u,r,p,y]),R=Kt.useCallback(async I=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",I),I.id==="chat"||I.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{C.push("/chat?new=true");}catch(w){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",w),C.push("/chat");}return}let k=I.appurl||I.href;k&&(k.startsWith("http://")||k.startsWith("https://")?window.open(k,"_blank"):C.push(k));},[C]),S=Kt.useCallback(()=>{c?.(i==="fixed"?"floating":"fixed");},[i,c]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border ${g?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${s?g?"border-white/25":"bg-[#111111] border-white/10":g?"border-white/70":"bg-white/70 border-white/30"}`,style:{backdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:g?s?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:g?s?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, rgba(33,188,255,0.05))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, rgba(33,188,255,0.08))":void 0,boxShadow:g?s?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,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, background-color 220ms ease-out, backdrop-filter 220ms 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 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:l("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:l("navigation.searchPlaceholder"),value:u,onChange:I=>v(I.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 ${s?"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 ${s?"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:T.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":l(u?"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(Ws,{items:T,onItemClick:R,className:"space-y-1",expandedIds:F,colorMode:n,onToggleExpand:I=>{let k=new Set(p);T.some(A=>A.id===I)?k.has(I)?k.delete(I):(T.forEach(A=>{A.id!==I&&k.has(A.id)&&k.delete(A.id);}),k.add(I)):k.has(I)?k.delete(I):k.add(I),b(k);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(I=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let k=new Set([I.id]);b(k);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:l("navigation.expandView",{title:I.title||""}),children:I.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:I.title?.charAt(0)||"?"})})},I.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 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:l("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&e&&jsxRuntime.jsx("button",{type:"button",onClick:S,className:"absolute -bottom-5 left-1/2 z-30 flex h-11 -translate-x-1/2 items-end justify-center rounded-full bg-transparent px-2 pb-1 transition-opacity duration-200 hover:opacity-95 focus:outline-none focus:ring-2 focus:ring-cyan-400/70",style:{width:"62px",touchAction:"manipulation"},title:l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 118 34",preserveAspectRatio:"none",className:"h-[34px] w-full overflow-visible",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:m,x1:"0",x2:"1",y1:"0",y2:"0",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#21BCFF"}),jsxRuntime.jsx("stop",{offset:"52%",stopColor:"#7C3AED"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#F59E0B"})]}),jsxRuntime.jsxs("filter",{id:h,x:"-70%",y:"-180%",width:"240%",height:"460%",children:[jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"8.5",result:"coloredBlur"}),jsxRuntime.jsxs("feMerge",{children:[jsxRuntime.jsx("feMergeNode",{in:"coloredBlur"}),jsxRuntime.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"18",opacity:g?.28:.2,filter:`url(#${h})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"12",opacity:g?.4:.3,filter:`url(#${h})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"6",opacity:g?.34:.25,filter:`url(#${h})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"1",opacity:g?.28:.18})]})})]})};var Jd=(e={})=>{let{initialCollapsed:t=false,initialDisplayMode:o="fixed",content:a=[]}=e,[r,n]=Kt.useState(t),[i,c]=Kt.useState(o),[d,l]=Kt.useState(a),s=Kt.useCallback(()=>{n(m=>!m);},[]),g=Kt.useCallback(()=>{c(m=>m==="fixed"?"floating":"fixed");},[]),f=Kt.useMemo(()=>({collapsed:r,onToggle:s,menuData:d,displayMode:i,onDisplayModeChange:c}),[r,s,d,i,c]);return {collapsed:r,setCollapsed:n,toggleCollapsed:s,displayMode:i,setDisplayMode:c,toggleDisplayMode:g,menuData:d,setMenuData:l,navigationIslandProps:f}};var ia=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Ks=class{constructor(){Gd(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 Ks,KI={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 Th={success:{icon:jsxRuntime.jsx(Ch__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(kh__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Sh__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(wh__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Zn=({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}=re(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),m=()=>{r?r():a();},h=Th[l],C=l!=="default";return jsxRuntime.jsxs(Pp__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...C&&{borderTop:`6px solid ${h.iconColor}`}}},children:[C&&jsxRuntime.jsx(pi__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Rp__default.default,{sx:{textAlign:C?"center":"left",pt:C?1:2},children:t}),jsxRuntime.jsx(Mp__default.default,{sx:{textAlign:C?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(yh__default.default,{children:o}):o}),jsxRuntime.jsxs(Dp__default.default,{sx:{justifyContent:C?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(ia,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(ia,{onClick:m,variant:"contained",sx:{bgcolor:C?h.iconColor:void 0,"&:hover":{bgcolor:C?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},sP=()=>{let[e,t]=Kt__namespace.default.useState(null),[o,a]=Kt__namespace.default.useState(false);Kt__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(Zn,{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 Oh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],su=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],No=e=>String(e),cu=(e,t)=>e[t],du=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},Hh=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:du(e))},Wh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},uu=({value:e=null,items:t=[],columns:o,mode:a="single",dialogTitle:r="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:s="No matching values",loading:g=false,clearable:f=true,allowManualInput:m=true,validateManualInput:h=true,manualInputErrorText:C="Enter a valid value.",selectedItems:u=[],displayValue:v,getOptionValue:p=du,getOptionLabel:b=Hh,getOptionDescription:y=Wh,onChange:T,onSearch:F,disabled:R,InputProps:S,onFocus:I,onBlur:k,onKeyDown:w,error:A,helperText:P,...M})=>{let B=a==="multiple",[j,O]=Kt.useState(false),[K,ee]=Kt.useState(false),[le,G]=Kt.useState(""),[te,me]=Kt.useState(null),[we,Ce]=Kt.useState(false),[ae,oe]=Kt.useState(()=>su(e)),[ye,Ge]=Kt.useState(""),[de,Te]=Kt.useState(""),$e=Kt.useMemo(()=>o&&o.length>0?o:Oh,[o]),ct=te??t,fe=Kt.useMemo(()=>{let H=[...u,...t,...te??[]],xe=new Map;return H.forEach(Ke=>{xe.set(No(p(Ke)),Ke);}),xe},[p,t,te,u]),Le=Kt.useMemo(()=>su(e),[e]),_e=Kt.useMemo(()=>Le.map(String).join(", "),[Le]);Kt.useEffect(()=>{j||oe(Le);},[j,Le]),Kt.useEffect(()=>{!K&&!de&&Ge(_e);},[K,_e,de]);let dt=Kt.useMemo(()=>{let H=le.trim().toLowerCase();if(!H||F)return ct;let xe=$e.filter(Ke=>Ke.searchable!==false);return ct.filter(Ke=>[p(Ke),b(Ke),y(Ke),...xe.map(Ct=>cu(Ke,Ct.field))].some(Ct=>String(Ct??"").toLowerCase().includes(H)))},[ct,y,b,p,F,le,$e]),at=Kt.useMemo(()=>{if(v!==void 0)return v;if(Le.length===0)return "";let H=xe=>{let Ke=fe.get(No(xe));if(!Ke)return String(xe);let et=b(Ke);return et&&et!==String(xe)?`${xe} - ${et}`:String(xe)};return B?Le.length>2?`${Le.length} selected`:Le.map(H).join(", "):H(Le[0])},[v,b,B,fe,Le]),Z=Kt.useCallback(async()=>{if(F){Ce(true);try{let H=await F(le);Array.isArray(H)&&me(H);}finally{Ce(false);}}},[F,le]),Ne=()=>{R||(oe(Le),O(true));},_=()=>{O(false);},Q=()=>{T?.(B?[]:null,B?[]:null),oe([]),Ge(""),Te("");},Re=H=>{let xe=p(H);if(B){oe(Ke=>Ke.some(Ct=>No(Ct)===No(xe))?Ke.filter(Ct=>No(Ct)!==No(xe)):[...Ke,xe]);return}oe([xe]);},Be=()=>{let H=ae.map(xe=>fe.get(No(xe))).filter(xe=>!!xe);B?T?.(ae,H):T?.(ae[0]??null,H[0]??null),Te(""),O(false);},rt=H=>{if(H.key==="F4"){H.preventDefault(),Ne();return}if(H.key==="Enter"&&m&&!gt(ye,true)){H.preventDefault();return}w?.(H);},it=H=>h?H.every(xe=>fe.has(No(xe))):true,gt=(H,xe)=>{if(B){let et=H.split(/[,;\n]/).map(It=>It.trim()).filter(Boolean);if(et.length===0)return Te(""),T?.([],[]),true;if(!it(et))return xe&&Te(C),false;Te("");let Ct=et.map(It=>fe.get(No(It))).filter(It=>!!It);return T?.(et,Ct),true}let Ke=H.trim();return Ke?it([Ke])?(Te(""),T?.(Ke,fe.get(No(Ke))??null),true):(xe&&Te(C),false):(Te(""),T?.(null,null),true)},Et=H=>{if(!m)return;let xe=H.target.value;Ge(xe),Te(""),gt(xe,false);},U=g||we,ze=Le.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...M,disabled:R,value:m&&(K||!!de)?ye:at,error:!!de||A,helperText:de||P,onChange:Et,onFocus:H=>{ee(true),Ge(_e),I?.(H);},onBlur:H=>{m&>(ye,true),ee(false),k?.(H);},onKeyDown:rt,InputProps:{...S,readOnly:!m,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[U?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&ze&&!R?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Q,children:jsxRuntime.jsx(Nh__default.default,{fontSize:"small"})})}):null,jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":l,onClick:Ne,disabled:R,children:jsxRuntime.jsx(lu__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:j,onClose:_,fullWidth:true,maxWidth:"md",PaperProps:{sx:H=>({borderRadius:2,overflow:"hidden",border:`1px solid ${H.palette.divider}`,boxShadow:H.palette.mode==="dark"?`0 24px 80px ${styles.alpha(H.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(H.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:H=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${H.palette.divider}`,bgcolor:H.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:r}),B?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ae.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:_,size:"small",children:jsxRuntime.jsx(Vh__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:H=>({px:2.5,py:1.5,borderBottom:`1px solid ${H.palette.divider}`,bgcolor:H.palette.mode==="dark"?styles.alpha(H.palette.common.white,.025):styles.alpha(H.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:le,placeholder:n,onChange:H=>G(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),Z());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(lu__default.default,{fontSize:"small"})}),sx:H=>({borderRadius:1,bgcolor:H.palette.background.paper,"& fieldset":{borderColor:styles.alpha(H.palette.text.primary,H.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(H.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:H.palette.primary.main}})}}),F?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{Z();},disabled:U,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:U?jsxRuntime.jsx(material.CircularProgress,{size:18}):"Search"}):null]}),jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:420},children:jsxRuntime.jsxs(material.Table,{stickyHeader:true,size:"small",children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsxs(material.TableRow,{children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:H=>({bgcolor:H.palette.mode==="dark"?"#111111":H.palette.background.paper,borderBottom:`1px solid ${H.palette.divider}`})}),$e.map(H=>jsxRuntime.jsx(material.TableCell,{align:H.align,sx:xe=>({minWidth:H.minWidth,width:H.width,fontSize:"0.78rem",fontWeight:800,bgcolor:xe.palette.mode==="dark"?"#111111":xe.palette.background.paper,borderBottom:`1px solid ${xe.palette.divider}`}),children:H.label},String(H.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[dt.map(H=>{let xe=p(H),Ke=ae.some(et=>No(et)===No(xe));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:Ke,onClick:()=>Re(H),onDoubleClick:()=>{B||(oe([xe]),T?.(xe,H),O(false));},sx:et=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(et.palette.primary.main,et.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(et.palette.primary.main,et.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:Ke})}),$e.map(et=>{let Ct=cu(H,et.field);return jsxRuntime.jsx(material.TableCell,{align:et.align,sx:{fontSize:"0.82rem",py:1},children:et.render?et.render(Ct,H):String(Ct??"")},String(et.field))})]},No(xe))}),dt.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:$e.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:H=>({px:2.5,py:1.5,borderTop:`1px solid ${H.palette.divider}`,bgcolor:H.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(ze||ae.length>0)?jsxRuntime.jsx(material.Button,{onClick:Q,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:_,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Be,disabled:!B&&ae.length===0,children:i})]})]})]})};var pu=({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 ji=e=>{let{t}=re(),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,m=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(lu__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(sb__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:!m,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Df__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,C)=>jsxRuntime.jsx(Kt__namespace.default.Fragment,{children:h},`toolbar-custom-${C}`))}),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(ob__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(ab__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(Jh__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(tb__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(Pu__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(ib__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(lb__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(rb__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(kp__default.default,{})})}),e.layoutManager]})]})};var Zi=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [Zi.Translate.toString(e),Zi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:a}=e;return t+" "+o+"ms "+a}}});var Xi=e=>{let{t}=re(),{onSelectAllClick:o,order:a,orderBy:r,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:l,columns:s,visibleColumns:g,selectionMode:f,grouping:m=[],isAllExpanded:h=false,handleToggleAll:C,onColumnResize:u,columnWidths:v,enableColumnReorder:p=false}=e,[b,y]=Kt.useState(null),T=Kt.useRef(null),F=K=>ee=>{b||d(K);},R=(K,ee,le)=>{K.preventDefault(),K.stopPropagation(),y(ee),T.current={startX:K.clientX,startWidth:le,colId:ee},document.addEventListener("mousemove",S),document.addEventListener("mouseup",I),document.body.style.cursor="col-resize";},S=K=>{if(!T.current)return;let{startX:ee,startWidth:le,colId:G}=T.current,te=K.clientX-ee,me=Math.max(50,le+te);u&&u(G,me);},I=()=>{y(null),T.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I),document.body.style.cursor="";};Kt.useEffect(()=>()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I);},[]);let k=f==="multiple"||f==="single",w=m.length>0&&!!C,A=t(h?"table.group.collapseAll":"table.group.expandAll"),P=s.filter(K=>g.includes(K.id)),M=new Map(n.map((K,ee)=>[K.field,{...K,priority:ee+1}])),B=P.map(K=>{let ee=v?.[K.id]||K.minWidth||100,le=M.get(K.id);return jsxRuntime.jsx(wb,{headCell:K,width:typeof ee=="number"?ee:100,order:a,orderBy:r,multiSortInfo:le,onRequestSort:F(K.id),onContextMenu:l,onResizeMouseDown:G=>R(G,K.id,typeof ee=="number"?ee:100),enableColumnReorder:p},K.id)}),j=P.map(K=>K.id),O=jsxRuntime.jsxs(gb__default.default,{children:[k&&jsxRuntime.jsx(ec__default.default,{padding:"checkbox",sx:K=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsxRuntime.jsx(fb__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:f==="single"})}),w&&jsxRuntime.jsx(ec__default.default,{align:"center",padding:"checkbox",sx:K=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsxRuntime.jsx(yb__default.default,{title:A,children:jsxRuntime.jsx(bb__default.default,{size:"small",onClick:K=>{K.stopPropagation(),C?.(!h);},sx:{p:.2},children:h?jsxRuntime.jsx(vb__default.default,{fontSize:"small"}):jsxRuntime.jsx(xb__default.default,{fontSize:"small"})})})}),p?jsxRuntime.jsx(sortable.SortableContext,{items:j,strategy:sortable.horizontalListSortingStrategy,children:B}):B]});return jsxRuntime.jsx(mb__default.default,{children:O})},wb=({headCell:e,width:t,order:o,orderBy:a,multiSortInfo:r,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d})=>{let{setNodeRef:l,attributes:s,listeners:g,transform:f,transition:m,isDragging:h}=sortable.useSortable({id:e.id,disabled:!d}),C=d?{transform:Zi.Transform.toString(f),transition:m,opacity:h?.6:1}:{},u=r?.direction??(a===e.id?o:"asc"),v=!!r||a===e.id;return jsxRuntime.jsxs(ec__default.default,{ref:d?l:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:v?u:false,onContextMenu:i?p=>i(p,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...C},sx:p=>({position:"sticky",top:0,zIndex:4,backgroundColor:p.palette.mode==="dark"?"#000000":"#f5f5f5",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?h?"grabbing":"grab":void 0}),...d?s:{},...d?g:{},children:[jsxRuntime.jsx(hb__default.default,{active:v,direction:u,onClick:n,sx:p=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,opacity:v?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary}),children:jsxRuntime.jsxs(pi__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,r&&jsxRuntime.jsx(pi__default.default,{component:"span",sx:p=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:p.palette.primary.main}),children:r.priority})]})}),jsxRuntime.jsx(pi__default.default,{onMouseDown:c,onPointerDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:p=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var hu=e=>{let{t}=re(),{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:m}=e,h=p=>r.indexOf(p)!==-1,C=l==="multiple"||l==="single",u=s.length>0,v=a.length+(C?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((p,b)=>{if(p.type==="group"){let y=d.has(p.id),T=p.childIds||[],F=T.filter(k=>h(k)).length,R=T.length>0&&F===T.length,S=F>0&&F<T.length;return jsxRuntime.jsxs(material.TableRow,{sx:k=>({backgroundColor:k.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:k.palette.text.primary,borderBottomColor:k.palette.divider},"& .MuiIconButton-root":{color:k.palette.text.primary},"& .MuiCheckbox-root":{color:k.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:k.palette.primary.main}}),children:[C&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:S,onChange:k=>{if(k.stopPropagation(),!!e.onSelectionChange)if(R){let w=r.filter(A=>!T.includes(A));e.onSelectionChange(w);}else {let w=Array.from(new Set([...r,...T]));e.onSelectionChange(w);}},onClick:k=>k.stopPropagation(),sx:{p:.5}})}),u&&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&&p.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(p.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(p.id)?m?.(p.id):f?.(p.id);},sx:{p:.25},children:g?.(p.id)?jsxRuntime.jsx(vb__default.default,{fontSize:"small"}):jsxRuntime.jsx(xb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(p.id),sx:{p:.25},children:y?jsxRuntime.jsx(Db__default.default,{}):jsxRuntime.jsx(Df__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.length,sx:{py:1,pl:p.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[p.field,": ",p.value," (",p.count,")"]})})]},p.id)}else {let y=p.data||p,T=p.id||y.id||b,F=h(T),R=`enhanced-table-checkbox-${b}`,I=(p.level!==void 0?p.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:k=>n&&n(k,y),role:"checkbox","aria-checked":F,tabIndex:-1,selected:F,sx:{cursor:"pointer"},children:[C&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:I>0?I+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:F,inputProps:{"aria-labelledby":R}})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(k=>a.includes(k.id)).map((k,w)=>{let P=!C&&w===0&&I>0?{pl:I+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:P,children:k.render?k.render(y[k.id],y):(function(){let B=y[k.id];if(k.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},k.id)})]},T)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:v,align:"center",children:t("common.noData")})})]})};var bu=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 xu=e=>{let{t}=re();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var Qr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=re();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(wu__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)})]})},Jr=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=re();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))]})},Ji=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=re();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")})})]})},el=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=re();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(Ub__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},Ru=({contextMenu:e,handleClose:t,columns:o,visibleColumns:a,grouping:r,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:l,onSortAsc:s,onSortDesc:g,onClearSort:f,onHideColumn:m,onToggleGroup:h,onToggleSummary:C,onOpenSortDialog:u})=>{let{t:v}=re(),p=e?.columnId??"",b=o.find(w=>w.id===p),y=r.includes(p),T=n.includes(p),F=!!b?.numeric,R=c.find(w=>w.field===p),S=R?R.direction==="asc":d===p&&l==="asc",I=R?R.direction==="desc":d===p&&l==="desc",k=S||I;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,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:b?.label??p})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{s(p),t();},selected:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Tu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(p),t();},selected:I,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Iu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.sortDesc")})]}),k&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{f(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(wu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Pu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{h(p),t();},selected:y,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(ob__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v(y?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),F&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{C(p),t();},selected:T,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(ab__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v(T?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{m(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Kb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.hideColumn")})]})]})},Mu=({open:e,onClose:t,columns:o,initialRules:a,onApply:r,onClear:n})=>{let{t:i}=re(),[c,d]=Kt.useState([]);Kt.useEffect(()=>{e&&d(a.length>0?a.map(C=>({...C})):[]);},[e,a]);let l=Kt.useMemo(()=>new Set(c.map(C=>C.field)),[c]),s=Kt.useMemo(()=>o.filter(C=>!l.has(C.id)),[o,l]),g=()=>{let C=s[0];C&&d(u=>[...u,{field:C.id,direction:"asc"}]);},f=C=>{d(u=>u.filter((v,p)=>p!==C));},m=(C,u)=>{d(v=>v.map((p,b)=>b===C?{...p,...u}:p));},h=(C,u)=>{d(v=>{let p=C+u;if(p<0||p>=v.length)return v;let b=[...v],[y]=b.splice(C,1);return b.splice(p,0,y),b});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((C,u)=>{let v=new Set(c.filter((b,y)=>y!==u).map(b=>b.field)),p=o.filter(b=>!v.has(b.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:C.field,onChange:b=>m(u,{field:b.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:p.map(b=>jsxRuntime.jsx("option",{value:b.id,children:b.label},b.id))}),jsxRuntime.jsxs("select",{value:C.direction,onChange:b=>m(u,{direction:b.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>h(u,-1),disabled:u===0,children:jsxRuntime.jsx(Tu__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>h(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(Iu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>f(u),children:jsxRuntime.jsx(jb__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:g,disabled:s.length===0,startIcon:jsxRuntime.jsx(Pu__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{r(c),t();},children:i("common.ok")})]})]})};var ti=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Au=({kpis:e})=>{let{t}=re(),o=[{label:t("graph.kpi.totalRecords"),value:ti(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:ti(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:ti(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:ti(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:ti(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 tl=({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 ai=({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 Eu=({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,m)=>{let h=n+m*(r-n*2)/Math.max(e.length-1,1),C=a-n-(f.value-c)/l*(a-n*2);return {x:h,y:C,...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 Lu=({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,m=Math.max(f*.5,8),h=n+g*f+(f-m)/2,C=s.barValue/i*(a-n*2),u=a-n-C;return {x:h,y:u,barHeight:C,barWidth:m,item:s}}),l=e.map((s,g)=>{let f=(r-n*2)/e.length,m=n+g*f+f/2,h=a-n-s.lineValue/c*(a-n*2);return {x:m,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 ry=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Nu=({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:ry(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 ny=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],sl=({data:e,variant:t="donut",colors:o=ny,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 Ou=({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 Wu=({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,m=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=m),{...g,start:f,end:m,delta:m-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 m=(c-d*2)/a.length,h=Math.max(m*.55,8),C=d+f*m+(m-h)/2,u=s(Math.max(g.start,g.end)),v=s(Math.min(g.start,g.end)),p=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:C,y:u,width:h,height:Math.max(v-u,4),rx:6,fill:p}),jsxRuntime.jsx("text",{x:C+h/2,y:u-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 ii=({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}`},mM=(e,t=360)=>{let o=ii(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Uu=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?ii({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 ul=({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 ju=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||ul({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 Zu=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=re();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(tl,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(ai,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(tl,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(ai,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(tl,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(sl,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var ko=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var gc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var wy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Ty=["zh","en","de","fr","ja","ko"],Qu=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=wy,promptLangOptions:n=Ty,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=Kt.useState(o),[f,m]=Kt.useState(d||""),[h,C]=Kt.useState(l||""),[u,v]=Kt.useState(false);Kt.useEffect(()=>{e&&(g(o),m(d||""),C(l||""));},[e,o,d,l]);let p=(y,T)=>{g(F=>({...F,[y]:T}));},b=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(Vh__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(ko,{size:"small",value:s.baseUrl,onChange:y=>p("baseUrl",y.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",type:"password",value:s.apiKey,onChange:y=>p("apiKey",y.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",value:s.model,onChange:y=>p("model",y.target.value),fullWidth:true,select:true,label:"Model",children:r.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",value:s.promptLang,onChange:y=>p("promptLang",y.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(ko,{size:"small",value:f,onChange:y=>m(y.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(gc,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:y=>p("analysisPrompt",y.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(ko,{size:"small",value:h,onChange:y=>C(y.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(gc,{multiline:true,minRows:8,value:s.responsePrompt,onChange:y=>p("responsePrompt",y.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||u,children:"Save"})]})]})};var hl=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=re(),[d,l]=Kt.useState(i?.defaultPrompt||""),[s,g]=Kt.useState(false),[f,m]=Kt.useState(false),h=n?.enabled!==false&&!!n,C=i?.enabled!==false,u=n?.filters||{},v=!!(u.primaryDimension||u.secondaryDimension||u.status),p=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Kt.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let b=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},y=async()=>{let T=d.trim();if(!(!T||!i?.onSubmit))try{g(!0),await i.onSubmit(T,{filters:u,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&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.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:[C&&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(Ay__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:T=>l(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),y());},placeholder:p,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:y,disabled:s||!d.trim(),children:jsxRuntime.jsx(Fy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>m(true),children:jsxRuntime.jsx(By__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Vh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Au,{kpis:o.kpis}),jsxRuntime.jsx(Zu,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:u,onPrimaryDimensionClick:T=>n?.onPrimaryDimensionClick(T),onSecondaryDimensionClick:T=>n?.onSecondaryDimensionClick(T),onStatusClick:T=>n?.onStatusClick(T)}:void 0}),r,a]}),jsxRuntime.jsx(Qu,{open:f,onClose:()=>m(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 tr={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"]},Ly=5,Ju=e=>e.toLowerCase().replace(/[\s_-]/g,""),or=(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=>[Ju(i),i]));for(let i of o){let c=n.get(Ju(i));if(c)return c}return r[0]||a},Oo=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},ho=(e,t)=>e==null||e===""?t:String(e),zy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=ho(i[t],r);n.set(c,(n.get(c)||0)+Oo(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},Ny=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Oo(c[o]),l.billable+=Oo(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)},Vy=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=ho(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}))},ep=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=ho(r[t],"N/A");a.set(n,(a.get(n)||0)+Oo(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},Oy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Oo(c[o]),l.billable+=Oo(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)},Hy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=ho(i[t],r),d=ho(i[o],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Oo(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},Wy=(e,t,o)=>{let a=ep(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"}]},$y=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=`${ho(c[o],n)} / ${ho(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)},dn=({rows:e,config:t})=>{let{t:o}=re(),a=o("graph.unassigned"),r=Kt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:or(e,s?.primaryDimension,tr.primaryDimension,"Category"),secondaryDimension:or(e,s?.secondaryDimension,tr.secondaryDimension,"Owner"),status:or(e,s?.status,tr.status,"Status"),date:or(e,s?.date,tr.date,"Date"),description:or(e,s?.description,tr.description,"Description"),reportHours:or(e,s?.reportHours,tr.reportHours,"ReportHours"),billableHours:or(e,s?.billableHours,tr.billableHours,"BillableHours"),amount:or(e,s?.amount,tr.amount,"Amount")}},[e,t?.fieldMapping]),n=Kt.useMemo(()=>e.map((s,g)=>{let f=Oo(s[r.reportHours]),m=Oo(s[r.billableHours]),h=Oo(s[r.amount]),C=f>0?m/f*100:0;return {id:`graph-row-${g}`,Date:ho(s[r.date],""),Primary:ho(s[r.primaryDimension],a),Secondary:ho(s[r.secondaryDimension],a),Description:ho(s[r.description],""),ReportHours:f,BillableHours:m,Amount:h,Efficiency:C,Status:ho(s[r.status],a)}}),[e,r,a]),i=Kt.useMemo(()=>{let s=n.length,g=n.reduce((v,p)=>v+Oo(p.ReportHours),0),f=n.reduce((v,p)=>v+Oo(p.BillableHours),0),m=n.reduce((v,p)=>v+Oo(p.Amount),0),h=g>0?f/g*100:0,C=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(v=>C.includes(ho(v.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:m,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||Ly,d=Kt.useMemo(()=>({billableByPrimary:zy(n,"Primary","BillableHours",c,a),efficiencyBySecondary:Ny(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:Vy(n,"Status",a),lineByDate:ep(n,"Date","BillableHours"),comboByPrimary:Oy(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:Hy(n,"Primary","Secondary","BillableHours",a),waterfallBillable:Wy(n,"Date","BillableHours"),fishboneStatusCauses:$y(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),l=Kt.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 un=e=>String(e??"").trim(),yl=(e={})=>{let[t,o]=Kt.useState(e),a=Kt.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=Kt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=Kt.useCallback(()=>{o({});},[]),i=Kt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Kt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&un(s[l.primaryDimension])!==un(t.primaryDimension)||t.secondaryDimension&&un(s[l.secondaryDimension])!==un(t.secondaryDimension)||t.status&&un(s[l.status])!==un(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var vl=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=re(),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]=Kt.useState(false),[m,h]=Kt.useState(""),[C,u]=Kt.useState(false),[v,p]=Kt.useState(false),b=e.find(F=>F.id===t),y=()=>{h(b?.name||i("variant.newVariant")),u(b?.isDefault||false),p(b?.isPublic||false),f(true);},T=()=>{a({name:m,isDefault:C,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:b||null,onChange:(F,R)=>{R&&o(R);},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,R)=>{let{key:S,...I}=F;return jsxRuntime.jsx("li",{...I,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:R.name}),R.isDefault&&jsxRuntime.jsx(ex__default.default,{fontSize:"small",color:"action"})]})},S)}}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:y,size:"small",color:"primary",children:jsxRuntime.jsx(kp__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:m,onChange:F=>h(F.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:F=>u(F.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v,onChange:F=>p(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:T,variant:"contained",children:i("common.save")})]})]})]})};var sp=({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}=re(),[m,h]=Kt.useState([]),[C,u]=Kt.useState(""),v=`orbcafe.variants.${e}.${t}`,p=s!==void 0?s:C,b=A=>{s===void 0&&u(A),g&&g(A);},y=Kt.useCallback(()=>{try{let A=localStorage.getItem(v);if(!A)return [];let P=JSON.parse(A);return Array.isArray(P)?P:[]}catch{return []}},[v]),T=Kt.useCallback(A=>{try{localStorage.setItem(v,JSON.stringify(A));}catch{}},[v]),F=Kt.useCallback(A=>{h(A);let P=A.find(M=>M.isDefault);P&&!p&&(b(P.id),n(P));},[p,n,b]),R=Kt.useCallback(async()=>{if(!e)return [];try{let A=[];if(i)A=await i.getVariants(e,t);else if(c){let P=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!P.ok)throw new Error(f("variant.toast.fetchFailed"));A=await P.json();}else A=y();return F(A),A}catch(A){console.error("Error fetching variants",A);let P=y();return F(P),d&&d(f("variant.toast.fetchFailed")),P}},[e,t,i,c,y,F,d,f]);return Kt.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(vl,{variants:m,currentVariantId:p,onLoad:A=>{b(A.id),n(A);},onSave:async A=>{let P=Date.now().toString(),M;try{let B=A.scope||"Both",j=m.find(le=>le.name===A.name);P=j?j.id:Date.now().toString();let O=[];if(j&&(Array.isArray(j.filters)?O=[...j.filters]:j.filters&&(O=[{scope:"default",filters:j.filters}])),B==="Search"||B==="Both"){let le=(Array.isArray(o),o);if(le)if(Array.isArray(le)&&le.length>0&&le[0].scope)le.forEach(G=>{let te=O.findIndex(me=>me.scope===G.scope);te>=0?O[te]=G:O.push(G);});else {let G={scope:t,filters:le},te=O.findIndex(me=>me.scope===t);te>=0?O[te]=G:O.push(G);}}let K=j?.layout||{},ee=[];if(j&&Array.isArray(j.layoutRefs)&&(ee=[...j.layoutRefs]),B==="Layout"||B==="Both")if(r&&r.length>0)r.forEach(le=>{let G=ee.findIndex(te=>te.tableKey===le.tableKey);G>=0?ee[G]=le:ee.push(le);});else {let le={tableKey:t,layoutId:a||null},G=ee.findIndex(te=>te.tableKey===t);G>=0?ee[G]=le:ee.push(le);}if(M={appId:e,tableKey:t,...A,scope:B,id:P,createdAt:new Date().toISOString(),filters:O,layout:K,layoutRefs:ee},i)await i.saveVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let G=m.some(te=>te.id===P)?m.map(te=>te.id===P?M:te):[...m,M];h(G),T(G);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await R(),b(P),n(M);}catch(B){console.error("Error saving variant",B);let O=m.some(K=>K.id===P)?m.map(K=>K.id===P?M:K):[...m,M];h(O),T(O),b(P),n(M),d&&d(f("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(i)await i.deleteVariant(A);else if(c){if(!(await fetch(`${c}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let P=m.filter(M=>M.id!==A);h(P),T(P);}p===A&&b(""),(i||c)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(P){console.error("Error deleting variant",P);let M=m.filter(B=>B.id!==A);h(M),T(M),p===A&&b(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let P=m.find(B=>B.id===A);if(!P)return;let M={appId:e,tableKey:t,...P,isDefault:!0};if(i)await i.setDefaultVariant(A,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=m.map(j=>({...j,isDefault:j.id===A}));h(B),T(B);}(i||c)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(P){console.error("Error setting default variant",P);let M=m.map(B=>({...B,isDefault:B.id===A}));h(M),T(M),d&&d(f("variant.toast.defaultFailed"));}}})};Ia__default.default.extend(hx__default.default);Ia__default.default.extend(bx__default.default);Ia__default.default.extend(yx__default.default);var ci="YYYY-MM-DD",xx=[null,null],Sr="0.85rem",vx={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Cx=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%"}})),pp=({label:e,value:t=xx,onChange:o})=>{let{t:a,locale:r}=re(),n=vx[r]||"en",i=e||a("dateRange.label"),[c,d]=Kt.useState(null),[l,s]=Kt.useState(t),[g,f]=Kt.useState("start"),[m,h]=Kt.useState(null),[C,u]=Kt.useState((t[0]||Ia__default.default()).locale(n)),[v,p]=Kt.useState(""),[b,y]=Kt.useState(""),[T,F]=Kt.useState(false),[R,S]=Kt.useState(false),I=Kt__namespace.default.useRef(t);Kt.useEffect(()=>{let[G,te]=t,[me,we]=I.current,Ce=ye=>ye&&typeof ye.isSame=="function",ae=!(G===null&&me===null||Ce(G)&&Ce(me)&&G.isSame(me,"day")),oe=!(te===null&&we===null||Ce(te)&&Ce(we)&&te.isSame(we,"day"));(ae||oe)&&(s(t),t[0]&&Ce(t[0])&&u(t[0].locale(n))),I.current=t;},[t,n]),Kt.useEffect(()=>{p(l[0]?l[0].locale(n).format(ci):""),y(l[1]?l[1].locale(n).format(ci):""),F(false),S(false);},[l,n]);let k=(G,te)=>{let me=te.trim(),we=G==="start"?F:S;if(!me){let oe=G==="start"?[null,l[1]]:[l[0],null];we(false),s(oe);return}let Ce=Ia__default.default(me,ci,true).locale(n);if(!Ce.isValid()){we(true);return}we(false);let ae=[...l];if(G==="start")ae[0]=Ce,ae[1]&&Ce.isAfter(ae[1],"day")&&(ae[1]=null),f(ae[1]?"start":"end");else {let oe=ae[0];oe&&Ce.isBefore(oe,"day")?(ae=[Ce,null],f("end")):(ae[1]=Ce,f("start"));}s(ae),u(Ce);},w=G=>{d(G.currentTarget);},A=()=>{d(null),f("start"),h(null);},P=!!c,M=G=>{if(!G)return;let te=[...l];if(g==="start")te=[G,null],f("end");else {let me=te[0];me&&G.isBefore(me)?(te=[G,null],f("end")):(te=[me,G],f("start"));}s(te);},B=G=>{let te=Ia__default.default().locale(n),me=[null,null];switch(G){case "today":me=[te,te];break;case "week":me=[te.startOf("week"),te.endOf("week")];break;case "month":me=[te.startOf("month"),te.endOf("month")];break}s(me),f("start"),u(te);},j=()=>{s([null,null]),f("start"),u(Ia__default.default().locale(n));},O=()=>{o&&o(l),A();},K=()=>{s(t),f("start"),A();},ee=Kt.useCallback(G=>{let{day:te,...me}=G,[we,Ce]=l,ae=we?te.isSame(we,"day"):false,oe=Ce?te.isSame(Ce,"day"):false,ye=we&&Ce?te.isBetween(we,Ce,"day","()"):false,Ge=false;return g==="end"&&we&&!Ce&&m&&te.isAfter(we,"day")&&te.isBefore(m.add(1,"day"),"day")&&(Ge=true),jsxRuntime.jsx(Cx,{...me,day:te,disableMargin:true,isStart:ae,isEnd:oe,isInRange:ye||Ge,onMouseEnter:()=>h(te)})},[l,g,m]),le=G=>G?G.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${le(l[0])} - ${le(l[1])}`:"",onClick:w,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Sr}},InputProps:{readOnly:true,sx:{fontSize:Sr,"& .MuiOutlinedInput-input":{fontSize:Sr},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:G=>{G.stopPropagation(),j();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Nh__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:w,sx:{padding:"2px"},children:jsxRuntime.jsx(mx__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:P,anchorEl:c,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width: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:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:a("dateRange.startDate"),placeholder:ci,value:v,error:T,size:"small",onFocus:()=>f("start"),onChange:G=>{p(G.target.value),T&&F(false);},onBlur:()=>k("start",v),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),k("start",v));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Sr,py:.75},"& .MuiInputLabel-root":{fontSize:Sr}}}),jsxRuntime.jsx(fx__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:a("dateRange.endDate"),placeholder:ci,value:b,error:R,size:"small",onFocus:()=>{l[0]&&f("end");},onChange:G=>{y(G.target.value),R&&S(false);},onBlur:()=>k("end",b),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),k("end",b));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Sr,py:.75},"& .MuiInputLabel-root":{fontSize:Sr}}})]})}),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:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:C,onMonthChange:u,onYearChange:u,onChange:M,slots:{day:ee},views:["year","month","day"],openTo:"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:K,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:O,children:a("common.done")})]})]})]})};var Sl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Bx={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"},Fx=["equals","contains","notContains","wildcard"],fp=["=","!=",">","<",">=","<=","between"],Vt="0.85rem",Ex=({field:e,value:t,onChange:o})=>{let{t:a}=re(),[r,n]=Kt.useState(null),[i,c]=Kt.useState(null),[d,l]=Kt.useState(""),[s,g]=Kt.useState(""),[f,m]=Kt.useState(false),[h,C]=Kt.useState(""),[u,v]=Kt.useState("");Kt.useEffect(()=>{let w=setTimeout(()=>{v(h);},1e3);return ()=>clearTimeout(w)},[h]);let p=t?.operator||(e.type==="number"?"=":"equals"),b=t?.value,y=w=>{let A=Bx[w];return A?a(A):w},T=w=>{n(w.currentTarget);},F=w=>{o({...t,operator:w,value:b}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Vt}},InputProps:{sx:{fontSize:Vt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Vt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let A=(P=>{if(!P)return [null,null];if(Array.isArray(P)&&P.length===2){let M=P[0]?Ia__default.default.isDayjs(P[0])?P[0]:Ia__default.default(P[0]):null,B=P[1]?Ia__default.default.isDayjs(P[1])?P[1]:Ia__default.default(P[1]):null;return [M,B]}return Ia__default.default.isDayjs(P)||typeof P=="string"?[Ia__default.default.isDayjs(P)?P:Ia__default.default(P),null]:[null,null]})(b);return jsxRuntime.jsx(pp,{label:e.label,value:A,onChange:P=>o({value:P,operator:"between"})})}if(S==="number"&&p==="between"){let w=()=>{o({value:[d,s],operator:"between"}),c(null);},A=Array.isArray(b)?`${b[0]||""} - ${b[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:A,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T,sx:{width:24,height:24,fontSize:Vt},children:Sl.between})})}),readOnly:true},onClick:P=>c(P.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Vt,minHeight:"auto",py:.5}}},children:fp.map(P=>jsxRuntime.jsxs(material.MenuItem,{selected:P===p,onClick:()=>F(P),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Sl[P]}),jsxRuntime.jsx(material.ListItemText,{primary:y(P),primaryTypographyProps:{fontSize:Vt}})]},P))}),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:P=>l(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Vt}},InputProps:{sx:{fontSize:Vt}}}),jsxRuntime.jsx(Ax__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:s,onChange:P=>g(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Vt}},InputProps:{sx:{fontSize:Vt}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:w,children:a("common.ok")})]})})]})}if(e.isValueHelp||S==="value-help"){let w=e.valueHelp?.mode||"single";return jsxRuntime.jsx(uu,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:b??(w==="multiple"?[]:null),mode:w,onChange:A=>o({value:A,operator:w==="multiple"?"anyOf":"equals"})})}if(S==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:b||"",onChange:w=>o({...t,value:w.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.value,children:w.label},w.value))]});if(S==="multi-select"){let w=Array.isArray(b)?b:[],A=e.options?.filter(P=>P.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:w,onChange:P=>o({...t,value:P.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{C(""),v("");},renderValue:P=>{if(!Array.isArray(P)||P.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let M=j=>e.options?.find(O=>O.value===j)?.label||j,B=P.map(M);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.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(lu__default.default,{fontSize:"small"})}),sx:{fontSize:Vt}},value:h,onChange:P=>C(P.target.value),onKeyDown:P=>{P.key!=="Escape"&&P.stopPropagation();},onClick:P=>P.stopPropagation()})}),A.length>0?A.map(P=>jsxRuntime.jsxs(material.MenuItem,{value:P.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:w.indexOf(P.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:P.label,primaryTypographyProps:{fontSize:Vt}})]},P.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Vt}})})]})}let I=S==="number"?fp:Fx,k=f||b!==void 0&&b!==""&&b!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:b||"",type:S==="number"?"number":"text",onChange:w=>o({...t,value:w.target.value,operator:p}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...R.InputProps,startAdornment:k?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y(p),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T,onMouseDown:w=>w.preventDefault(),sx:{width:24,height:24,fontSize:Vt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Sl[p]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(lu__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Vt,minHeight:"auto",py:.5}}},children:I.map(w=>jsxRuntime.jsxs(material.MenuItem,{selected:w===p,onClick:()=>F(w),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Sl[w]}),jsxRuntime.jsx(material.ListItemText,{primary:y(w),primaryTypographyProps:{fontSize:Vt}})]},w))})]})},Aa=({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:m,currentLayoutId:h,layoutRefs:C,variantService:u,serviceUrl:v})=>{let{t:p}=re(),[b,y]=Kt.useState(true),[T,F]=Kt.useState(null),[R,S]=Kt.useState(e.filter(A=>!A.hidden).map(A=>A.id)),I=(A,P)=>{o({...t,[A]:P});},k=A=>{R.includes(A)?S(R.filter(P=>P!==A)):S([...R,A]);};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(sp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:m,currentLayoutId:h,layoutRefs:C,onLoad:A=>{if(!A.filters)return;let P=null;if(Array.isArray(A.filters)){let M=f||"default",B=A.filters.find(j=>j.scope===M);P=B?B.filters:null;}else P=A.filters;P&&(P.values||P.visibleFields?(P.visibleFields&&Array.isArray(P.visibleFields)&&S(P.visibleFields),P.values&&o(P.values)):o(P)),n&&n(A);},variantService:u,serviceUrl:v,currentVariantId:r}):jsxRuntime.jsx(vl,{variants:a,currentVariantId:r,onLoad:n,onSave:A=>{i&&i({...A,filters:{values:t,visibleFields:R}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:p("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:A=>F(A.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(Rx__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Vt,whiteSpace:"nowrap",minWidth:"fit-content"},children:p("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Vt},children:p(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:T,open:!!T,onClose:()=>F(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Vt,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:p("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Vt}})}),jsxRuntime.jsx(material.Divider,{}),e.map(A=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>k(A.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(A.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:A.label,primaryTypographyProps:{fontSize:Vt}})]},A.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(A=>R.includes(A.id)).map(A=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(Ex,{field:A,value:t[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:P=>I(A.id,P)})},A.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:()=>y(!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(Mx__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(Db__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Sp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=re(),[c,d]=Kt.useState(null),[l,s]=Kt.useState(false),[g,f]=Kt.useState(""),[m,h]=Kt.useState(""),[C,u]=Kt.useState({isDefault:false,isPublic:false}),v=e.find(R=>R.id===t),p=R=>{d(R.currentTarget);},b=()=>{d(null);},y=R=>{o(R),b();},T=()=>{f(""),h(""),u({isDefault:false,isPublic:false}),s(true),b();},F=()=>{g.trim()&&(a({name:g,description:m,...C}),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:T,color:"primary",size:"small",children:jsxRuntime.jsx(kp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:p,color:v?"primary":"default",children:jsxRuntime.jsx(qx__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:T,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(kp__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((R,S)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>y(R),selected:R.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:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:I=>{I.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(ex__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(Kx__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:I=>{I.stopPropagation(),r(R.id);},children:jsxRuntime.jsx(lb__default.default,{fontSize:"small"})})})]})]})},R.id||S))]}),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:R=>f(R.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(R=>R.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:m,onChange:R=>h(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C.isDefault,onChange:R=>u({...C,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C.isPublic,onChange:R=>u({...C,isPublic:R.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 fn=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=re(),[s,g]=Kt.useState([]),[f,m]=Kt.useState(""),h=`orbcafe.layouts.${e}.${t}`,C=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??{}}),u=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}),v=Kt.useCallback(()=>{try{let S=localStorage.getItem(h);if(!S)return [];let I=JSON.parse(S);return Array.isArray(I)?I:[]}catch{return []}},[h]),p=Kt.useCallback(S=>{try{localStorage.setItem(h,JSON.stringify(S));}catch{}},[h]);Kt.useEffect(()=>{n!==void 0&&m(n);},[n]),Kt.useEffect(()=>{if(r&&s.length>0){let S=s.find(I=>I.id===r);S&&(m(S.id),a(S));}},[r,s,a]);let b=Kt.useCallback(async()=>{if(e){if(!i){let S=v();g(S);let I=S.find(k=>k.isDefault);I&&!f&&!r&&(m(I.id),a(I));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 k=(await S.json()).map(C);g(k);let w=k.find(A=>A.isDefault);w&&!f&&!r&&(m(w.id),a(w));}catch(S){console.error("Error fetching layouts",S);let I=v();g(I);let k=I.find(w=>w.isDefault);k&&!f&&!r&&(m(k.id),a(k)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,v,l]);return Kt.useEffect(()=>{b();},[e,t]),jsxRuntime.jsx(Sp,{layouts:s,currentLayoutId:f,onLoad:S=>{m(S.id),a(S);},onSave:async S=>{let I=s.find(A=>A.name===S.name),k=I?I.id:Date.now().toString(),w={id:k,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let P=s.some(M=>M.id===k)?s.map(M=>M.id===k?w:M):[...s,w];g(P),p(P),m(k),a(w),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(w))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await b(),m(k),a(w);}catch(A){console.error("Error saving layout",A);let M=s.some(B=>B.id===k)?s.map(B=>B.id===k?w:B):[...s,w];g(M),p(M),m(k),a(w),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let I=s.filter(k=>k.id!==S);g(I),p(I),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===S&&m(""),d&&d(l("layout.toast.deleteSuccess")),await b();}catch(I){console.error("Error deleting layout",I);let k=s.filter(w=>w.id!==S);g(k),p(k),f===S&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let I=s.map(k=>({...k,isDefault:k.id===S}));g(I),p(I),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let I=s.find(w=>w.id===S);if(!I)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...I,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await b();}catch(I){console.error("Error setting default",I);let k=s.map(w=>({...w,isDefault:w.id===S}));g(k),p(k),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Tp=(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},Pl=(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 Ip(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function jx(e,t){return e==="desc"?(o,a)=>Ip(o,a,t):(o,a)=>-Ip(o,a,t)}function Zx(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 hn=e=>{let t=Kt.useCallback(z=>{let V=String(z?.label??z?.id??"").length*9+64,ce=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ce,V)},[]),o=Kt.useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=Kt.useState(""),[n,i]=Kt.useState(e.order||"asc"),[c,d]=Kt.useState(e.orderBy||""),[l,s]=Kt.useState([]),[g,f]=Kt.useState(e.page||0),[m,h]=Kt.useState(e.rowsPerPage||20),[C,u]=Kt.useState(e.selected||[]),[v,p]=Kt.useState(e.columns?e.columns.map(z=>z.id):[]),[b,y]=Kt.useState(e.columns?e.columns.map(z=>z.id):[]),[T,F]=Kt.useState(e.showSummary||false),[R,S]=Kt.useState(()=>o()),[I,k]=Kt.useState([]),[w,A]=Kt.useState(new Set),[P,M]=Kt.useState(()=>{let z={};return (e.columns||[]).forEach(N=>{z[N.id]=t(N);}),z}),[B,j]=Kt.useState(null),[O,K]=Kt.useState(null),[ee,le]=Kt.useState(null),[G,te]=Kt.useState(null),[me,we]=Kt.useState(false),[Ce,ae]=Kt.useState(""),[oe,ye]=Kt.useState("");Kt.useEffect(()=>{e.layout&&oo(e.layout);},[e.layout]),Kt.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),Kt.useEffect(()=>{e.selected!==void 0&&u(e.selected);},[e.selected]),Kt.useEffect(()=>{e.page!==void 0&&f(e.page);},[e.page]),Kt.useEffect(()=>{e.rowsPerPage!==void 0&&h(e.rowsPerPage);},[e.rowsPerPage]),Kt.useEffect(()=>{let z=o();S(N=>N.filter(ce=>z.includes(ce)));},[o]),Kt.useEffect(()=>{M(z=>{let N={...z};return (e.columns||[]).forEach(V=>{N[V.id]===void 0&&(N[V.id]=t(V));}),N});},[e.columns,t]),Kt.useEffect(()=>{y(z=>{let N=(e.columns||[]).map(Fe=>Fe.id),V=new Set(N),ce=z.filter(Fe=>V.has(Fe)),pe=new Set(ce),Pe=N.filter(Fe=>!pe.has(Fe)),ke=[...ce,...Pe];return ke.length===z.length&&ke.every((Fe,Ue)=>Fe===z[Ue])?z:ke});},[e.columns]);let Ge=Kt.useMemo(()=>{let z=e.columns||[];if(b.length===0)return z;let N=new Map(z.map(pe=>[pe.id,pe])),V=[],ce=new Set;return b.forEach(pe=>{let Pe=N.get(pe);Pe&&(V.push(Pe),ce.add(pe));}),z.forEach(pe=>{ce.has(pe.id)||V.push(pe);}),V},[e.columns,b]),de=Kt.useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(N=>Object.keys(N).some(V=>String(N[V]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),Te=Kt.useMemo(()=>{if(e.onSortChange)return de;if(l.length>0){let z=[...de];return z.sort((N,V)=>{for(let ce of l){let pe=N?.[ce.field],Pe=V?.[ce.field];if(!(pe==null&&Pe==null)){if(pe==null)return ce.direction==="asc"?-1:1;if(Pe==null)return ce.direction==="asc"?1:-1;if(pe<Pe)return ce.direction==="asc"?-1:1;if(pe>Pe)return ce.direction==="asc"?1:-1}}return 0}),z}return c?Zx(de,jx(n,c)):de},[de,n,c,l,e.onSortChange]),$e=Kt.useCallback(z=>{if(I.length===0)return z.map(Pe=>({type:"row",data:Pe,id:Pe[e.rowKey||"id"]}));let N=[...z].sort((Pe,ke)=>{for(let Fe of I){if(Pe[Fe]<ke[Fe])return -1;if(Pe[Fe]>ke[Fe])return 1}return 0}),V=(Pe,ke=0)=>{if(ke>=I.length)return Pe;let Fe=I[ke],Ue={},Rt=[];return Pe.forEach(yt=>{let Tt=yt[Fe],ht=`${Fe}:${Tt}`;Ue[ht]||(Ue[ht]={key:ht,field:Fe,value:Tt,children:[],count:0,level:ke},Rt.push(Ue[ht])),Ue[ht].children.push(yt),Ue[ht].count++;}),Rt.forEach(yt=>{yt.children&&(yt.children=V(yt.children,ke+1));}),Rt},ce=V(N),pe=(Pe,ke="")=>{let Fe=[];return Pe.forEach(Ue=>{if(Ue.children){let Rt=ke?`${ke}>${Ue.key}`:Ue.key,yt=w.has(Rt);Fe.push({type:"group",id:Rt,field:Ue.field,value:Ue.value,level:Ue.level,count:Ue.count,isExpanded:yt,childIds:(function Tt(ht){let Po=[];return ht.children.forEach(_t=>{_t.children?Po=Po.concat(Tt(_t)):Po.push(_t[e.rowKey||"id"]);}),Po})(Ue)}),yt&&(Fe=Fe.concat(pe(Ue.children,Rt)));}else Fe.push({type:"row",data:Ue,id:Ue[e.rowKey||"id"],level:I.length});}),Fe};return pe(ce)},[I,w,e.rowKey]),ct=Kt.useCallback(z=>{if(I.length===0)return [];let N=[...z].sort((pe,Pe)=>{for(let ke of I){if(pe[ke]<Pe[ke])return -1;if(pe[ke]>Pe[ke])return 1}return 0}),V=[],ce=(pe,Pe,ke)=>{if(Pe>=I.length)return;let Fe=I[Pe],Ue=new Map;pe.forEach(Rt=>{let yt=Rt[Fe],Tt=Ue.get(yt);Tt?Tt.push(Rt):Ue.set(yt,[Rt]);}),Ue.forEach((Rt,yt)=>{let Tt=`${Fe}:${yt}`,ht=ke?`${ke}>${Tt}`:Tt;V.push(ht),ce(Rt,Pe+1,ht);});};return ce(N,0,""),V},[I]),fe=Kt.useMemo(()=>$e(Te),[Te,$e]),Le=Kt.useMemo(()=>ct(Te),[Te,ct]),_e=Kt.useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),dt=Kt.useMemo(()=>_e?fe:m>0?fe.slice(g*m,g*m+m):fe,[fe,g,m,_e]),at=Kt.useMemo(()=>_e&&typeof e.count=="number"?e.count:fe.length,[fe.length,_e,e.count]),Z=z=>{A(N=>{let V=new Set(N);return V.has(z)?V.delete(z):V.add(z),V});},Ne=z=>{let N=Le.filter(V=>V===z||V.startsWith(`${z}>`));A(V=>{let ce=new Set(V);return N.forEach(pe=>ce.add(pe)),ce});},_=z=>{A(N=>{let V=new Set(N);return Array.from(V).forEach(ce=>{(ce===z||ce.startsWith(`${z}>`))&&V.delete(ce);}),V});},Q=z=>{if(!z){A(new Set);return}A(new Set(Le));},Re=z=>{let N=Le.filter(V=>V.startsWith(`${z}>`));return N.length===0?w.has(z):w.has(z)&&N.every(V=>w.has(V))},Be=z=>{l.length>0&&s([]);let N=c===z&&n==="asc",V=c===z&&n==="desc";if(e.onSortChange){N?e.onSortChange(z,"desc"):V?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}N?(i("desc"),d(z)):V?(i("asc"),d("")):(i("asc"),d(z));},rt=z=>{let N=z.filter(V=>V&&V.field);s(N),N.length>0&&d("");},it=()=>{s([]);},gt=(z,N)=>{M(V=>({...V,[z]:N}));},Et=z=>{if(z.target.checked){let N=de.map(V=>V[e.rowKey||"id"]);u(N),e.onSelectionChange&&e.onSelectionChange(N);return}u([]),e.onSelectionChange&&e.onSelectionChange([]);},U=(z,N)=>{let V=N[e.rowKey||"id"],ce=C.indexOf(V),pe=[];ce===-1?pe=pe.concat(C,V):ce===0?pe=pe.concat(C.slice(1)):ce===C.length-1?pe=pe.concat(C.slice(0,-1)):ce>0&&(pe=pe.concat(C.slice(0,ce),C.slice(ce+1))),u(pe),e.onSelectionChange&&e.onSelectionChange(pe);},ze=z=>{f(z),e.onPageChange&&e.onPageChange(z);},Ae=z=>{h(z),f(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},ft=z=>{let N=v.indexOf(z),V=[...v];N===-1?V.push(z):V.splice(N,1),p(V);},H=z=>{let N=I.indexOf(z),V=[...I];N===-1?V.push(z):V.splice(N,1),k(V);},xe=z=>{o().includes(z)&&S(V=>V.includes(z)?V.filter(ce=>ce!==z):[...V,z]);},Ke=(z,N)=>{!z||!N||z===N||y(V=>{let ce=V.indexOf(z),pe=V.indexOf(N);if(ce===-1||pe===-1)return V;let Pe=[...V];return Pe.splice(ce,1),Pe.splice(pe,0,z),Pe});},et=z=>{let N=z?.active?.id,V=z?.over?.id;typeof N=="string"&&typeof V=="string"&&Ke(N,V);},Ct=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:v,columnOrder:b,order:n,orderBy:c,sortBy:l,grouping:I,columnWidths:P,showSummary:T,summaryColumns:R});},It=z=>{let{layout:N,layoutId:V}=Pl(z,e.tableKey||"default");V?(ye(V),ae(V)):(ye(""),ae("")),N&&(N.visibleColumns&&p(N.visibleColumns),Array.isArray(N.columnOrder)&&y(N.columnOrder),N.order&&i(N.order),N.orderBy&&d(N.orderBy),Array.isArray(N.sortBy)&&s(N.sortBy),N.grouping&&k(N.grouping),N.columnWidths&&M(N.columnWidths),N.showSummary!==void 0&&F(!!N.showSummary),Array.isArray(N.summaryColumns)&&S(N.summaryColumns));},oo=z=>{let N=z?.layoutData||z?.layout||z||{};N.visibleColumns&&p(N.visibleColumns),Array.isArray(N.columnOrder)&&y(N.columnOrder),N.order&&i(N.order),N.orderBy!==void 0&&d(N.orderBy),Array.isArray(N.sortBy)&&s(N.sortBy),N.grouping&&k(N.grouping),N.columnWidths&&M(N.columnWidths),N.showSummary!==void 0&&F(!!N.showSummary),Array.isArray(N.summaryColumns)&&S(N.summaryColumns),A(new Set),f(0),z?.id&&ae(z.id),ye("");};Kt.useEffect(()=>{e.layout&&It({layout:e.layout});},[e.layout]);let xo=z=>{z.preventDefault(),te(G===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},bt=()=>{te(null);},ra=Kt.useMemo(()=>{if(!T)return {};let z={};e.columns.forEach(V=>{if(V.numeric&&R.includes(V.id)){let ce=de.reduce((pe,Pe)=>{let ke=parseFloat(Pe[V.id]);return pe+(isNaN(ke)?0:ke)},0);z[V.id]=ce.toFixed(2);}else z[V.id]="";});let N=e.columns.find(V=>v.includes(V.id));return N&&!N.numeric&&(z[N.id]="Total"),z},[de,e.columns,T,R,v]),Pt=()=>{if(!e.columns||!de)return;let z=e.columns.map(Pe=>Pe.label).join(","),N=de.map(Pe=>e.columns.map(ke=>{let Fe=Pe[ke.id];return `"${(Fe==null?"":String(Fe)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
184
|
-
`)
|
|
185
|
-
${N}`,ce=encodeURI(V),pe=document.createElement("a");pe.setAttribute("href",ce),pe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe);},na=()=>{we(true);},ao=()=>{we(false);};return {isMobile:false,columns:Ge,order:n,setOrder:i,orderBy:c,setOrderBy:d,sortBy:l,setSortBy:s,applyMultiSort:rt,clearMultiSort:it,columnOrder:b,setColumnOrder:y,filterText:a,setFilterText:r,visibleColumns:v,setVisibleColumns:p,showSummary:T,setShowSummary:F,summaryColumns:R,grouping:I,setGrouping:k,expandedGroups:w,setExpandedGroups:A,groupAnchorEl:O,setGroupAnchorEl:K,summaryAnchorEl:ee,setSummaryAnchorEl:le,columnWidths:P,setColumnWidths:M,anchorEl:B,setAnchorEl:j,contextMenu:G,setContextMenu:te,sensors:void 0,sortedAndFilteredRows:Te,visibleRows:dt,summaryRow:ra,page:g,setPage:ze,rowsPerPage:m,setRowsPerPage:Ae,totalDisplayCount:at,selected:C,setSelected:u,isAllExpanded:Le.length>0&&Le.every(z=>w.has(z)),handleColumnResize:gt,handleRequestSort:Be,handleSelectAllClick:Et,handleClick:U,toggleSummaryColumn:xe,handleDragEnd:et,handleColumnReorder:Ke,handleExport:Pt,handleContextMenu:xo,handleCloseContextMenu:bt,toggleColumnVisibility:ft,toggleGroupExpand:Z,toggleGroupField:H,handleToggleAll:Q,handleExpandGroupRecursively:Ne,handleCollapseGroupRecursively:_,isGroupFullyExpanded:Re,handleLayoutLoad:oo,handleVariantLoad:It,handleLayoutSave:Ct,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:v,order:n,orderBy:c,sortBy:l,columnOrder:b,grouping:I,columnWidths:P,showSummary:T,summaryColumns:R},currentLayoutId:Ce,layoutIdToLoad:oe,onPageChange:ze,onRowsPerPageChange:Ae,graphReportOpen:me,handleOpenGraphReport:na,handleCloseGraphReport:ao}};var oA=e=>jsxRuntime.jsx(Qx__default.default,{...e}),aA=e=>jsxRuntime.jsx(ec__default.default,{...e}),rA=e=>jsxRuntime.jsx(Fp__default.default,{...e}),nA=e=>jsxRuntime.jsx(mb__default.default,{...e}),iA=e=>jsxRuntime.jsx(gb__default.default,{...e}),rr=e=>{let{t}=re(),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:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:b,quickCreate:y,quickEdit:T,quickDelete:F,serviceUrl:R}=e,S=a||t("table.title.default"),{isMobile:I,columns:k,order:w,orderBy:A,filterText:P,setFilterText:M,visibleColumns:B,showSummary:j,setShowSummary:O,summaryColumns:K,grouping:ee,setGrouping:le,expandedGroups:G,groupAnchorEl:te,setGroupAnchorEl:me,summaryAnchorEl:we,setSummaryAnchorEl:Ce,columnWidths:ae,anchorEl:oe,setAnchorEl:ye,contextMenu:Ge,sensors:de,sortedAndFilteredRows:Te,summaryRow:$e,visibleRows:ct,isAllExpanded:fe,page:Le,setPage:_e,rowsPerPage:dt,setRowsPerPage:at,totalDisplayCount:Z,setSelected:Ne,handleColumnResize:_,handleRequestSort:Q,handleSelectAllClick:Re,handleClick:Be,toggleSummaryColumn:rt,handleDragEnd:it,handleExport:gt,handleContextMenu:Et,handleCloseContextMenu:U,toggleColumnVisibility:ze,toggleGroupExpand:Ae,toggleGroupField:ft,handleToggleAll:H,handleExpandGroupRecursively:xe,handleCollapseGroupRecursively:Ke,isGroupFullyExpanded:et,handleLayoutLoad:Ct,handleVariantLoad:It,handleLayoutSave:oo,effectiveAppId:xo,currentLayoutData:bt,currentLayoutId:ra,layoutIdToLoad:Pt,graphReportOpen:na,handleOpenGraphReport:ao,handleCloseGraphReport:z}=hn(e),N=b?.enabled??false,V=N&&(b?.interaction?.enabled??true),ce=yl(),pe=!!y?.enabled,Pe=!!T?.enabled,ke=!!F?.enabled,Fe=y?.fields,Ue=y?.excludeFields||[],Rt=y?.initialValues||{},[yt,Tt]=Kt__namespace.default.useState(false),[ht,Po]=Kt__namespace.default.useState(false),[_t,Nt]=Kt__namespace.default.useState({}),[vo,jt]=Kt__namespace.default.useState(false),[tt,_o]=Kt__namespace.default.useState(false),[Fo,jo]=Kt__namespace.default.useState({}),[D,q]=Kt__namespace.default.useState(false),[Y,ue]=Kt__namespace.default.useState(false),Ee=m||ht||tt||Y,We=Kt__namespace.default.useMemo(()=>{let W=[...k];if(Array.isArray(Fe)&&Fe.length>0){let se=new Set(Fe);W=W.filter(ie=>se.has(ie.id));}if(Ue.length>0){let se=new Set(Ue);W=W.filter(ie=>!se.has(ie.id));}return W.filter(se=>!!se?.id)},[k,Ue,Fe]),Qe=v||"id",he=Kt__namespace.default.useMemo(()=>{let W=new Set(i);return Te.filter(se=>W.has(se?.[Qe]))},[i,Te,Qe]),je=he.length===1?he[0]:null,nt=T?.fields,Mt=T?.excludeFields||[],lt=T?.editableFields||[],Jt=T?.nonEditableFields||[],ro=T?.primaryKeys?.length?T.primaryKeys:[Qe],Co=Kt__namespace.default.useMemo(()=>{let W=[...k];if(Array.isArray(nt)&&nt.length>0){let se=new Set(nt);W=W.filter(ie=>se.has(ie.id));}if(Mt.length>0){let se=new Set(Mt);W=W.filter(ie=>!se.has(ie.id));}return W.filter(se=>!!se?.id)},[k,Mt,nt]),$t=Kt__namespace.default.useMemo(()=>new Set(ro),[ro]),no=Kt__namespace.default.useMemo(()=>new Set(lt),[lt]),xt=Kt__namespace.default.useMemo(()=>new Set(Jt),[Jt]),Zt=Kt__namespace.default.useCallback(W=>no.size>0?no.has(W):!(xt.has(W)||$t.has(W)),[no,xt,$t]);Kt__namespace.default.useEffect(()=>{!na&&ce.hasActiveFilters&&ce.clearAll();},[na,ce.hasActiveFilters,ce.clearAll]);let ba=()=>{let W={};We.forEach(se=>{W[se.id]=Rt[se.id]??"";}),Nt(W),Tt(true);},Zo=()=>{ht||Tt(false);},qr=(W,se)=>{Nt(ie=>({...ie,[W]:se}));},_r=async()=>{if(!y?.onSubmit){Tt(false);return}try{Po(!0),await y.onSubmit(_t),Tt(!1);}finally{Po(false);}},jr=()=>{if(!je)return;let W={};Co.forEach(ie=>{W[ie.id]=je[ie.id]??"";});let se=T?.getInitialValues?{...W,...T.getInitialValues(je)}:W;jo(se),jt(true);},Eo=()=>{tt||jt(false);},Zr=(W,se)=>{jo(ie=>({...ie,[W]:se}));},Xr=async()=>{if(je){if(!T?.onSubmit){jt(false);return}try{_o(!0),await T.onSubmit(Fo,je),jt(!1);}finally{_o(false);}}},br=()=>{he.length!==0&&q(true);},Pa=()=>{Y||q(false);},_a=async()=>{if(he.length===0){q(false);return}if(!F?.onConfirm){q(false),Ne([]),c?.([]);return}try{ue(!0),await F.onConfirm(he),q(!1),Ne([]),c?.([]);}finally{ue(false);}},ja=Te,{fieldMapping:x}=dn({rows:ja,config:{...b,title:b?.title||`${S} ${t("graph.reportTitle")}`}}),E=Kt__namespace.default.useMemo(()=>V?ce.applyRows(ja,x):ja,[V,ce.applyRows,ja,x]),{model:L}=dn({rows:E,config:{...b,title:b?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:x}}),X=L.table.columns.map(W=>({id:W.id,label:W.label,align:W.align||"left",minWidth:120,numeric:W.align==="right"})),ve=xo?jsxRuntime.jsx(fn,{appId:xo,tableKey:p,currentLayoutData:bt,onLayoutLoad:Ct,targetLayoutId:Pt,activeLayoutId:ra,serviceUrl:R??u?.serviceUrl}):null,He=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Qr,{groupAnchorEl:te,setGroupAnchorEl:me,grouping:ee,setGrouping:le,columns:k,toggleGroupField:ft}),jsxRuntime.jsx(Jr,{anchorEl:oe,setAnchorEl:ye,columns:k,visibleColumns:B,toggleColumnVisibility:ze}),jsxRuntime.jsx(Ji,{anchorEl:we,setAnchorEl:Ce,showSummary:j,setShowSummary:O,columns:k,summaryColumns:K,toggleSummaryColumn:rt}),jsxRuntime.jsx(el,{contextMenu:Ge,handleCloseContextMenu:U,columns:k,visibleColumns:B,toggleColumnVisibility:ze})]});return I?jsxRuntime.jsxs(pi__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx(Aa,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bt}],variantService:u.variantService,serviceUrl:R??u.serviceUrl}),jsxRuntime.jsx(xu,{title:S,loading:m,showSummary:j,setShowSummary:O,setAnchorEl:ye,setSummaryAnchorEl:Ce,filterText:P,setFilterText:M,sortedAndFilteredRows:Te,selected:i,columns:k,visibleColumns:B,summaryRow:$e,handleClick:Be,selectionMode:n}),He]}):jsxRuntime.jsxs(pi__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:[u&&jsxRuntime.jsx(pi__default.default,{sx:{mb:2},children:jsxRuntime.jsx(Aa,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:W=>{It(W),u.onVariantLoad&&u.onVariantLoad(W);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:m,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bt}],currentLayoutId:ra,layoutRefs:[{tableKey:p,layoutId:ra}],variantService:u.variantService,serviceUrl:R??u.serviceUrl})}),jsxRuntime.jsxs(Xx__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ee?{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(ji,{filterText:P,setFilterText:M,onRowsPerPageChange:at,rowsPerPage:dt,rowsPerPageOptions:h,page:Le,count:Z,onPageChange:_e,actions:d,extraTools:l,grouping:ee,setGroupAnchorEl:me,showSummary:j,setShowSummary:O,setAnchorEl:ye,setSummaryAnchorEl:Ce,handleExport:gt,showCreateButton:pe,onOpenCreateDialog:ba,showEditButton:Pe,onOpenEditDialog:jr,editDisabled:he.length!==1,showDeleteButton:ke,onOpenDeleteConfirm:br,deleteDisabled:he.length===0,onLayoutSave:C||u?.variantService&&u?.appId?oo:void 0,loading:m,layoutManager:ve,onOpenGraphReport:N?ao:void 0}),jsxRuntime.jsx(Fp__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:de,collisionDetection:core.closestCenter,onDragEnd:it,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Yx__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(ae).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Xi,{columns:k,visibleColumns:B,order:w,orderBy:A,onRequestSort:Q,onContextMenu:Et,selectionMode:n,grouping:ee,isAllExpanded:fe,handleToggleAll:H,rowCount:Te.length,numSelected:i.length,onSelectAllClick:Re,columnWidths:ae,onColumnResize:_}),jsxRuntime.jsx(hu,{visibleRows:ct,columns:k,visibleColumns:B,selectionMode:n,selected:i,orderBy:A,loading:m,expandedGroups:G,toggleGroupExpand:Ae,handleExpandGroupRecursively:xe,handleCollapseGroupRecursively:Ke,isGroupFullyExpanded:et,handleClick:Be,onSelectionChange:c,grouping:ee,rowKeyProp:v,page:Le,rowsPerPage:dt}),j&&jsxRuntime.jsx(bu,{showSummary:j,columns:k,visibleColumns:B,summaryRow:$e,selectionMode:n?.toString(),grouping:ee,orderBy:A,zIndex:3})]})})})]}),pe&&jsxRuntime.jsxs(Pp__default.default,{open:yt,onClose:Zo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Rp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:y?.title||t("quickCreate.createWithTitle",{title:S})}),jsxRuntime.jsx(Mp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(pi__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[We.map(W=>{let se=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",ie=W.label||W.id;return jsxRuntime.jsx(Ap__default.default,{label:ie,value:_t[W.id]??"",onChange:kt=>qr(W.id,kt.target.value),type:se,size:"small",fullWidth:true,InputLabelProps:{shrink:se==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${W.id}`)}),y?.description&&jsxRuntime.jsx(Bp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:y.description})]})}),jsxRuntime.jsxs(Dp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Ml__default.default,{onClick:Zo,sx:{fontSize:"0.85rem"},disabled:ht,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Ml__default.default,{onClick:_r,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ht,children:y?.submitLabel||t("common.save")})]})]}),Pe&&jsxRuntime.jsxs(Pp__default.default,{open:vo,onClose:Eo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Rp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:T?.title||t("quickEdit.editWithTitle",{title:S})}),jsxRuntime.jsx(Mp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(pi__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Co.map(W=>{let se=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",ie=W.label||W.id,kt=Zt(W.id);return jsxRuntime.jsx(Ap__default.default,{label:ie,value:Fo[W.id]??"",onChange:$=>Zr(W.id,$.target.value),type:se,size:"small",fullWidth:true,disabled:!kt,InputLabelProps:{shrink:se==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${W.id}`)}),T?.description&&jsxRuntime.jsx(Bp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:T.description})]})}),jsxRuntime.jsxs(Dp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Ml__default.default,{onClick:Eo,sx:{fontSize:"0.85rem"},disabled:tt,children:T?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Ml__default.default,{onClick:Xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:tt||!je,children:T?.submitLabel||t("common.save")})]})]}),ke&&jsxRuntime.jsx(Zn,{open:D,type:"warning",title:F?.title||t("quickDelete.confirmTitle"),message:F?.message||(he.length>1?t("quickDelete.confirmMessageMultiple",{count:he.length}):t("quickDelete.confirmMessageSingle")),confirmText:F?.confirmText||t("common.delete"),cancelText:F?.cancelText||t("common.cancel"),onClose:Pa,onConfirm:_a}),He,N&&jsxRuntime.jsx(hl,{open:na,onClose:z,model:L,aiAssistant:b?.aiAssistant,interaction:V?{enabled:true,filters:ce.filters,fieldMapping:x,onPrimaryDimensionClick:W=>ce.setFilter("primaryDimension",W),onSecondaryDimensionClick:W=>ce.setFilter("secondaryDimension",W),onStatusClick:W=>ce.setFilter("status",W),onClearFilter:ce.clearFilter,onClearAll:ce.clearAll}:void 0,tableContent:jsxRuntime.jsx(rr,{appId:xo||"graph-report-internal",title:t("graph.dataBody"),columns:X,rows:L.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},lA=rr;var gA=({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(pu,{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(Aa,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(rr,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var vA=({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}=re(),[l,s]=Kt.useState(false),[g,f]=Kt.useState([]),[m,h]=Kt.useState({}),[C,u]=Kt.useState(e.variants||[]),[v,p]=Kt.useState(e.layout||null),[b,y]=Kt.useState(""),[T,F]=Kt.useState(0),[R,S]=Kt.useState(0),[I,k]=Kt.useState(o),[w,A]=Kt.useState([]),[P,M]=Kt.useState("asc"),[B,j]=Kt.useState("");Kt.useEffect(()=>{let ae={};e.filters.forEach(oe=>{oe.defaultValue!==void 0&&(ae[oe.id]=oe.defaultValue);}),h(ae);},[e.filters]);let O=Kt.useCallback(async(ae,oe,ye,Ge,de)=>{s(true);try{let Te={...ae,page:oe+1,limit:ye,sort:de,order:Ge},$e;t?$e=await t(Te):typeof e.api=="function"?$e=await e.api(Te):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Te),$e={rows:[],total:0}):(console.warn("No API configured for report"),$e={rows:[],total:0}),$e&&(f($e.rows||[]),F($e.total||0));}catch(Te){console.error("Failed to fetch report data",Te);}finally{s(false);}},[e.api,t]);Kt.useEffect(()=>{O(m,R,I,P,B);},[O,R,I,P,B]);let K=()=>{S(0),O(m,0,I,P,B);},ee=ae=>{S(0),k(ae);},le=(ae,oe)=>{M(oe),j(ae);},G=ae=>{h(ae);},te=ae=>{y(ae?.id||"");let oe=Tp(ae,r);if(oe){let Ge=oe.values??oe;h(Ge),O(Ge,0,I,P,B),S(0);}let{layout:ye}=Pl(ae,r);ye&&p(ye);},me=ae=>{let oe={...ae,id:Date.now().toString(),createdAt:new Date().toISOString()};u(ye=>[...ye,oe]);},we=ae=>{p(ae);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:m,onFilterChange:G,onSearch:K,onVariantLoad:te,onVariantSave:me,onVariantDelete:ae=>u(oe=>oe.filter(ye=>ye.id!==ae)),onVariantSetDefault:ae=>{u(oe=>oe.map(ye=>({...ye,isDefault:ye.id===ae})));},variants:C,currentVariantId:b,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:l,rowKey:"id",count:T,page:R,rowsPerPage:I,rowsPerPageOptions:a,onPageChange:S,onRowsPerPageChange:ee,selectionMode:"multiple",selected:w,onSelectionChange:A,onLayoutSave:we,layout:v,title:e.title,showSummary:true,order:P,orderBy:B,serviceUrl:i,onSortChange:le,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:g,loading:l,refresh:K}};var s0=e=>[...e].sort((t,o)=>o.value-t.value),SA=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=Kt.useMemo(()=>s0(e),[e]),c=Kt.useMemo(()=>[...t],[t]),d=Kt.useMemo(()=>[...o],[o]),l=Kt.useMemo(()=>[...a],[a]),s=Kt.useMemo(()=>{let f=r.reduce((m,h)=>m+h.value,0);return r.map(m=>({...m,percent:f>0?m.value/f*100:m.percent}))},[r]),g=Kt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var RA=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>Kt.useMemo(()=>!e||!t?"":ii({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),MA=({keyword:e,location:t})=>Kt.useMemo(()=>ul({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var mi=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=Kt.useState(false),d=Kt.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 Kt.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:Xg(a)}}}),m=new ogl.Mesh(s,{geometry:g,program:f});function b(){if(!d)return;let R=window.devicePixelRatio||1,T=d.clientWidth,I=d.clientHeight;l.setSize(T*R,I*R),s.canvas.style.width=T+"px",s.canvas.style.height=I+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",b),b();let y=0,u=0,C=0,p=.3,h=R=>{let T=d.getBoundingClientRect(),I=R.clientX-T.left,k=R.clientY-T.top,S=T.width,D=T.height,P=Math.min(S,D),M=S/2,A=D/2,j=(I-M)/P*2,z=(k-A)/P*2;Math.sqrt(j*j+z*z)<.8?y=1:y=0;},v=()=>{y=0;};d.addEventListener("mousemove",h),d.addEventListener("mouseleave",v);let w,E=R=>{w=requestAnimationFrame(E);let T=(R-u)*.001;u=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=Xg(a);let I=r?1:y;f.uniforms.hover.value+=(I-f.uniforms.hover.value)*.1,o&&I>.5&&(C+=T*p),f.uniforms.rot.value=C,l.render({scene:m});};return w=requestAnimationFrame(E),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",b),d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",v),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,r,a]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function fw(e,t,o){let r,a,n;if(t===0)r=a=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;r=i(d,c,e+1/3),a=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(r,a,n)}function Xg(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let r=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(r,a,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 r=parseInt(o[1])/360,a=parseInt(o[2])/100,n=parseInt(o[3])/100;return fw(r,a,n)}return new ogl.Vec3(0,0,0)}var Qg=ih(()=>{"use client";});function Xo(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var js={primary:"#000000",primaryHover:"#333333"},el={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"},ei={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},ou=()=>"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 ph=classVarianceAuthority.cva(ou(),{variants:{variant:{default:`${el.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:`${el.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:el.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-[${js.primary}] hover:bg-[${js.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:ei.none,sm:ei.sm,md:ei.md,full:ei.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Zs=Kt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...a},n)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{className:Xo(ph({variant:t,size:o,className:e})),ref:n,...a}));Zs.displayName="Button";var gh={"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.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","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}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","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","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","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"},fh={"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.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","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}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","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","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","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"},hh={"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.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","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}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","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","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","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"},bh={"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.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","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","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","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","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","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"},yh={"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.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","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","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","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","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","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"},xh={"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.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","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","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","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","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","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"},ti={en:gh,zh:fh,fr:hh,de:bh,ja:yh,ko:xh};var au=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,r)=>{let a=t[r];return a==null?"":String(a)}):e,Sh={locale:"en",t:(e,t)=>au(ti.en[e]||e,t)},nu=Kt.createContext(Sh),tl=({locale:e="en",messages:t,children:o})=>{let r=Kt.useMemo(()=>{let a=ti[e]||ti.en,n=t?.[e]||{},i={...ti.en,...a,...n};return {locale:e,t:(c,d)=>au(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(nu.Provider,{value:r,children:o})},oe=()=>Kt.useContext(nu);function Ys({items:e,onItemClick:t,className:o="",level:r=0,expandedIds:a,onToggleExpand:n,colorMode:i="light"}){let{t:c}=oe(),d=i==="dark",l=navigation.usePathname(),[s,g]=Kt.useState(false),[f,m]=Kt.useState(new Set),b=a!==void 0&&n!==void 0,y=b?a:f;Kt.useEffect(()=>{g(true);},[]);let u=p=>{if(b)n(p);else {let h=new Set(f);h.has(p)?h.delete(p):h.add(p),m(h);}},C=p=>{p.children&&p.children.length>0&&u(p.id),t&&t(p);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:Xo("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:Xo("tree-menu",o),children:e.map(p=>{let h=y.has(p.id)||p.isExpanded,v=p.children&&p.children.length>0,w=p.appurl||p.href,E=s&&w?l===w:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:Xo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Zs,{variant:"ghost",className:Xo("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${r*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(p),children:[v&&jsxRuntime.jsx("div",{className:Xo("flex-shrink-0 transition-transform duration-200",h&&"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"})}),!v&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),p.icon&&jsxRuntime.jsx("div",{className:Xo("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:p.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:Xo("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:p.title||p.label}),p.description&&jsxRuntime.jsx("div",{className:Xo("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:p.description,children:p.description})]})]}),v&&jsxRuntime.jsx("div",{className:Xo("grid transition-[grid-template-rows] duration-300 ease-in-out",h?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(Ys,{items:p.children,onItemClick:t,level:r+1,expandedIds:a,onToggleExpand:n,colorMode:i})})})]},p.id)})})}var Js=({collapsed:e,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",displayMode:i="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true})=>{let{t:l}=oe(),s=n==="dark",g=i==="floating",f=Kt__namespace.default.useId().replace(/:/g,""),m=`orbcafe-nav-mode-arc-${f}`,b=`orbcafe-nav-mode-glow-${f}`,y=navigation.useRouter(),[u,C]=Kt.useState(""),[p,h]=Kt.useState(new Set);Kt.useEffect(()=>{e&&h(new Set);},[e]);let v=Kt.useCallback(I=>{let k=[],S=D=>{D.forEach(P=>{k.push(P.id),P.children&&S(P.children);});};return S(I),k},[]),w=Kt.useMemo(()=>{if(!u.trim())return a;let I=k=>k.reduce((S,D)=>{let P=D.title?.toLowerCase().includes(u.toLowerCase())||D.description?.toLowerCase().includes(u.toLowerCase()),M=D.children?I(D.children):[];return (P||M.length>0)&&S.push({...D,children:M.length>0?M:D.children}),S},[]);return I(a)},[u,a]),E=Kt.useMemo(()=>u.trim()?new Set(v(a)):p,[u,a,p,v]),R=Kt.useCallback(async I=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",I),I.id==="chat"||I.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{y.push("/chat?new=true");}catch(S){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",S),y.push("/chat");}return}let k=I.appurl||I.href;k&&(k.startsWith("http://")||k.startsWith("https://")?window.open(k,"_blank"):y.push(k));},[y]),T=Kt.useCallback(()=>{c?.(i==="fixed"?"floating":"fixed");},[i,c]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border ${g?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${s?g?"border-white/25":"bg-[#111111] border-white/10":g?"border-white/70":"bg-white/70 border-white/30"}`,style:{backdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:g?s?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:g?s?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, rgba(33,188,255,0.05))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, rgba(33,188,255,0.08))":void 0,boxShadow:g?s?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,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, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:r?`${r}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 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:l("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:l("navigation.searchPlaceholder"),value:u,onChange:I=>C(I.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 ${s?"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 ${s?"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:w.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":l(u?"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(Ys,{items:w,onItemClick:R,className:"space-y-1",expandedIds:E,colorMode:n,onToggleExpand:I=>{let k=new Set(p);w.some(D=>D.id===I)?k.has(I)?k.delete(I):(w.forEach(D=>{D.id!==I&&k.has(D.id)&&k.delete(D.id);}),k.add(I)):k.has(I)?k.delete(I):k.add(I),h(k);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:a.map(I=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let k=new Set([I.id]);h(k);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:l("navigation.expandView",{title:I.title||""}),children:I.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:I.title?.charAt(0)||"?"})})},I.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 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:l("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&e&&jsxRuntime.jsx("button",{type:"button",onClick:T,className:"absolute -bottom-5 left-1/2 z-30 flex h-11 -translate-x-1/2 items-end justify-center rounded-full bg-transparent px-2 pb-1 transition-opacity duration-200 hover:opacity-95 focus:outline-none focus:ring-2 focus:ring-cyan-400/70",style:{width:"62px",touchAction:"manipulation"},title:l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 118 34",preserveAspectRatio:"none",className:"h-[34px] w-full overflow-visible",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:m,x1:"0",x2:"1",y1:"0",y2:"0",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#21BCFF"}),jsxRuntime.jsx("stop",{offset:"52%",stopColor:"#7C3AED"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#F59E0B"})]}),jsxRuntime.jsxs("filter",{id:b,x:"-70%",y:"-180%",width:"240%",height:"460%",children:[jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"8.5",result:"coloredBlur"}),jsxRuntime.jsxs("feMerge",{children:[jsxRuntime.jsx("feMergeNode",{in:"coloredBlur"}),jsxRuntime.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"18",opacity:g?.28:.2,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"12",opacity:g?.4:.3,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"6",opacity:g?.34:.25,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${m})`,strokeLinecap:"round",strokeWidth:"1",opacity:g?.28:.18})]})})]})};var uu=(e={})=>{let{initialCollapsed:t=false,initialDisplayMode:o="fixed",content:r=[]}=e,[a,n]=Kt.useState(t),[i,c]=Kt.useState(o),[d,l]=Kt.useState(r),s=Kt.useCallback(()=>{n(m=>!m);},[]),g=Kt.useCallback(()=>{c(m=>m==="fixed"?"floating":"fixed");},[]),f=Kt.useMemo(()=>({collapsed:a,onToggle:s,menuData:d,displayMode:i,onDisplayModeChange:c}),[a,s,d,i,c]);return {collapsed:a,setCollapsed:n,toggleCollapsed:s,displayMode:i,setDisplayMode:c,toggleDisplayMode:g,menuData:d,setMenuData:l,navigationIslandProps:f}};var lr=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var tc=class{constructor(){tu(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,r){this.listener&&this.listener({type:t,content:o,options:r});}hide(){this.listener&&this.listener(null);}},Er=new tc,bP={success:(e,t)=>Er.show("success",e,t),error:(e,t)=>Er.show("error",e,t),warning:(e,t)=>Er.show("warning",e,t),info:(e,t)=>Er.show("info",e,t),show:(e,t,o)=>Er.show(e,t,o),hide:()=>Er.hide()};var Kh={success:{icon:jsxRuntime.jsx(Wh__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx($h__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Gh__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Uh__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},oi=({open:e,title:t,message:o,onClose:r,onConfirm:a,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=oe(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),m=()=>{a?a():r();},b=Kh[l],y=l!=="default";return jsxRuntime.jsxs(Hp__default.default,{open:e,onClose:r,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...y&&{borderTop:`6px solid ${b.iconColor}`}}},children:[y&&jsxRuntime.jsx(Ci__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsxRuntime.jsx(Wp__default.default,{sx:{textAlign:y?"center":"left",pt:y?1:2},children:t}),jsxRuntime.jsx($p__default.default,{sx:{textAlign:y?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(Oh__default.default,{children:o}):o}),jsxRuntime.jsxs(Gp__default.default,{sx:{justifyContent:y?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(lr,{onClick:r,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(lr,{onClick:m,variant:"contained",sx:{bgcolor:y?b.iconColor:void 0,"&:hover":{bgcolor:y?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},FP=()=>{let[e,t]=Kt__namespace.default.useState(null),[o,r]=Kt__namespace.default.useState(false);Kt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),r(true)):(r(false),t(null));};return Er.register(i),()=>Er.unregister()},[]);let a=()=>{r(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),r(false),t(null);};return e?jsxRuntime.jsx(oi,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:a,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var nb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],vu=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],No=e=>String(e),Cu=(e,t)=>e[t],ku=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},ib=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:ku(e))},lb=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},Su=({value:e=null,items:t=[],columns:o,mode:r="single",dialogTitle:a="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:s="No matching values",loading:g=false,clearable:f=true,allowManualInput:m=true,validateManualInput:b=true,manualInputErrorText:y="Enter a valid value.",selectedItems:u=[],displayValue:C,getOptionValue:p=ku,getOptionLabel:h=ib,getOptionDescription:v=lb,onChange:w,onSearch:E,disabled:R,InputProps:T,onFocus:I,onBlur:k,onKeyDown:S,error:D,helperText:P,...M})=>{let A=r==="multiple",[j,z]=Kt.useState(false),[V,X]=Kt.useState(false),[Z,H]=Kt.useState(""),[ee,pe]=Kt.useState(null),[De,xe]=Kt.useState(false),[se,te]=Kt.useState(()=>vu(e)),[Ie,Ye]=Kt.useState(""),[Ue,be]=Kt.useState(""),Ke=Kt.useMemo(()=>o&&o.length>0?o:nb,[o]),lt=ee??t,Ee=Kt.useMemo(()=>{let W=[...u,...t,...ee??[]],ue=new Map;return W.forEach(_e=>{ue.set(No(p(_e)),_e);}),ue},[p,t,ee,u]),Oe=Kt.useMemo(()=>vu(e),[e]),qe=Kt.useMemo(()=>Oe.map(String).join(", "),[Oe]);Kt.useEffect(()=>{j||te(Oe);},[j,Oe]),Kt.useEffect(()=>{!V&&!Ue&&Ye(qe);},[V,qe,Ue]);let pt=Kt.useMemo(()=>{let W=Z.trim().toLowerCase();if(!W||E)return lt;let ue=Ke.filter(_e=>_e.searchable!==false);return lt.filter(_e=>[p(_e),h(_e),v(_e),...ue.map(mt=>Cu(_e,mt.field))].some(mt=>String(mt??"").toLowerCase().includes(W)))},[lt,v,h,p,E,Z,Ke]),$e=Kt.useMemo(()=>{if(C!==void 0)return C;if(Oe.length===0)return "";let W=ue=>{let _e=Ee.get(No(ue));if(!_e)return String(ue);let Qe=h(_e);return Qe&&Qe!==String(ue)?`${ue} - ${Qe}`:String(ue)};return A?Oe.length>2?`${Oe.length} selected`:Oe.map(W).join(", "):W(Oe[0])},[C,h,A,Ee,Oe]),q=Kt.useCallback(async()=>{if(E){xe(true);try{let W=await E(Z);Array.isArray(W)&&pe(W);}finally{xe(false);}}},[E,Z]),Le=()=>{R||(te(Oe),z(true));},ve=()=>{z(false);},Pe=()=>{w?.(A?[]:null,A?[]:null),te([]),Ye(""),be("");},at=W=>{let ue=p(W);if(A){te(_e=>_e.some(mt=>No(mt)===No(ue))?_e.filter(mt=>No(mt)!==No(ue)):[..._e,ue]);return}te([ue]);},We=()=>{let W=se.map(ue=>Ee.get(No(ue))).filter(ue=>!!ue);A?w?.(se,W):w?.(se[0]??null,W[0]??null),be(""),z(false);},re=W=>{if(W.key==="F4"){W.preventDefault(),Le();return}if(W.key==="Enter"&&m&&!je(Ie,true)){W.preventDefault();return}S?.(W);},ke=W=>b?W.every(ue=>Ee.has(No(ue))):true,je=(W,ue)=>{if(A){let Qe=W.split(/[,;\n]/).map(yt=>yt.trim()).filter(Boolean);if(Qe.length===0)return be(""),w?.([],[]),true;if(!ke(Qe))return ue&&be(y),false;be("");let mt=Qe.map(yt=>Ee.get(No(yt))).filter(yt=>!!yt);return w?.(Qe,mt),true}let _e=W.trim();return _e?ke([_e])?(be(""),w?.(_e,Ee.get(No(_e))??null),true):(ue&&be(y),false):(be(""),w?.(null,null),true)},St=W=>{if(!m)return;let ue=W.target.value;Ye(ue),be(""),je(ue,false);},K=g||De,Fe=Oe.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...M,disabled:R,value:m&&(V||!!Ue)?Ie:$e,error:!!Ue||D,helperText:Ue||P,onChange:St,onFocus:W=>{X(true),Ye(qe),I?.(W);},onBlur:W=>{m&&je(Ie,true),X(false),k?.(W);},onKeyDown:re,InputProps:{...T,readOnly:!m,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[K?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&Fe&&!R?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Pe,children:jsxRuntime.jsx(rb__default.default,{fontSize:"small"})})}):null,jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":l,onClick:Le,disabled:R,children:jsxRuntime.jsx(xu__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:j,onClose:ve,fullWidth:true,maxWidth:"md",PaperProps:{sx:W=>({borderRadius:2,overflow:"hidden",border:`1px solid ${W.palette.divider}`,boxShadow:W.palette.mode==="dark"?`0 24px 80px ${styles.alpha(W.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(W.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:W=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${W.palette.divider}`,bgcolor:W.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),A?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${se.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:ve,size:"small",children:jsxRuntime.jsx(ab__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:W=>({px:2.5,py:1.5,borderBottom:`1px solid ${W.palette.divider}`,bgcolor:W.palette.mode==="dark"?styles.alpha(W.palette.common.white,.025):styles.alpha(W.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:Z,placeholder:n,onChange:W=>H(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),q());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(xu__default.default,{fontSize:"small"})}),sx:W=>({borderRadius:1,bgcolor:W.palette.background.paper,"& fieldset":{borderColor:styles.alpha(W.palette.text.primary,W.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(W.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:W.palette.primary.main}})}}),E?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{q();},disabled:K,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:K?jsxRuntime.jsx(material.CircularProgress,{size:18}):"Search"}):null]}),jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:420},children:jsxRuntime.jsxs(material.Table,{stickyHeader:true,size:"small",children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsxs(material.TableRow,{children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:W=>({bgcolor:W.palette.mode==="dark"?"#111111":W.palette.background.paper,borderBottom:`1px solid ${W.palette.divider}`})}),Ke.map(W=>jsxRuntime.jsx(material.TableCell,{align:W.align,sx:ue=>({minWidth:W.minWidth,width:W.width,fontSize:"0.78rem",fontWeight:800,bgcolor:ue.palette.mode==="dark"?"#111111":ue.palette.background.paper,borderBottom:`1px solid ${ue.palette.divider}`}),children:W.label},String(W.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[pt.map(W=>{let ue=p(W),_e=se.some(Qe=>No(Qe)===No(ue));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:_e,onClick:()=>at(W),onDoubleClick:()=>{A||(te([ue]),w?.(ue,W),z(false));},sx:Qe=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Qe.palette.primary.main,Qe.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Qe.palette.primary.main,Qe.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:_e})}),Ke.map(Qe=>{let mt=Cu(W,Qe.field);return jsxRuntime.jsx(material.TableCell,{align:Qe.align,sx:{fontSize:"0.82rem",py:1},children:Qe.render?Qe.render(mt,W):String(mt??"")},String(Qe.field))})]},No(ue))}),pt.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:Ke.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:W=>({px:2.5,py:1.5,borderTop:`1px solid ${W.palette.divider}`,bgcolor:W.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(Fe||se.length>0)?jsxRuntime.jsx(material.Button,{onClick:Pe,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:ve,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:We,disabled:!A&&se.length===0,children:i})]})]})]})};var wu=({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 ka={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},vr={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},ai={width:30,height:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Cr={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Tu={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},Qo={...Cr,borderRadius:1};var rl=e=>{let{t}=oe(),o="0.85rem",r=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],a=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...r,...a],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,m=l<s-1&&i!==-1,b={fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}};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:y=>e.setFilterText(y.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(xu__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:y=>e.onRowsPerPageChange?.(Number(y.target.value)),sx:b,children:c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,sx:{fontSize:o},children:y===-1?t("common.all"):y},`rows-per-page-${y}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{...Qo,color:"text.primary"},children:jsxRuntime.jsx(Rb__default.default,{})}),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:!m,sx:{...Qo,color:"text.primary"},children:jsxRuntime.jsx(Xf__default.default,{})})]}),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((y,u)=>jsxRuntime.jsx(Kt__namespace.default.Fragment,{children:y},`toolbar-custom-${u}`))}),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:{...Qo,color:"text.primary"},onClick:y=>e.setGroupAnchorEl(y.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(kb__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{...Qo,color:e.showSummary?"primary.main":"text.primary"},onClick:y=>e.setSummaryAnchorEl(y.currentTarget),children:jsxRuntime.jsx(Sb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{...Qo,color:"text.primary"},onClick:y=>e.setAnchorEl(y.currentTarget),children:jsxRuntime.jsx(xb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{...Qo,color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Cb__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",sx:Qo,children:jsxRuntime.jsx(Hu__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,sx:Qo,children:jsxRuntime.jsx(Ib__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,sx:Qo,children:jsxRuntime.jsx(Pb__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{...Qo,color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(wb__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{...Qo,color:"text.primary"},onClick:y=>e.onLayoutSave(y),children:jsxRuntime.jsx(Lp__default.default,{})})}),e.layoutManager]})]})};var al=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [al.Translate.toString(e),al.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:r}=e;return t+" "+o+"ms "+r}}});var nl=e=>{let{t}=oe(),{onSelectAllClick:o,order:r,orderBy:a,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:l,columns:s,visibleColumns:g,selectionMode:f,grouping:m=[],isAllExpanded:b=false,handleToggleAll:y,onColumnResize:u,columnWidths:C,enableColumnReorder:p=false}=e,[h,v]=Kt.useState(null),w=Kt.useRef(null),E=V=>X=>{h||d(V);},R=(V,X,Z)=>{V.preventDefault(),V.stopPropagation(),v(X),w.current={startX:V.clientX,startWidth:Z,colId:X},document.addEventListener("mousemove",T),document.addEventListener("mouseup",I),document.body.style.cursor="col-resize";},T=V=>{if(!w.current)return;let{startX:X,startWidth:Z,colId:H}=w.current,ee=V.clientX-X,pe=Math.max(50,Z+ee);u&&u(H,pe);},I=()=>{v(null),w.current=null,document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",I),document.body.style.cursor="";};Kt.useEffect(()=>()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",I);},[]);let k=f==="multiple"||f==="single",S=m.length>0&&!!y,D=t(b?"table.group.collapseAll":"table.group.expandAll"),P=s.filter(V=>g.includes(V.id)),M=new Map(n.map((V,X)=>[V.field,{...V,priority:X+1}])),A=P.map(V=>{let X=C?.[V.id]||V.minWidth||100,Z=M.get(V.id);return jsxRuntime.jsx(Ub,{headCell:V,width:typeof X=="number"?X:100,order:r,orderBy:a,multiSortInfo:Z,onRequestSort:E(V.id),onContextMenu:l,onResizeMouseDown:H=>R(H,V.id,typeof X=="number"?X:100),enableColumnReorder:p},V.id)}),j=P.map(V=>V.id),z=jsxRuntime.jsxs(Fb__default.default,{children:[k&&jsxRuntime.jsx(dc__default.default,{padding:"checkbox",sx:V=>({...ka,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(Lb__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:f==="single",sx:ai})}),S&&jsxRuntime.jsx(dc__default.default,{align:"center",padding:"checkbox",sx:V=>({...vr,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(Ob__default.default,{title:D,children:jsxRuntime.jsx(Nb__default.default,{size:"small",onClick:V=>{V.stopPropagation(),y?.(!b);},sx:Cr,children:b?jsxRuntime.jsx(Hb__default.default,{}):jsxRuntime.jsx(Vb__default.default,{})})})}),p?jsxRuntime.jsx(sortable.SortableContext,{items:j,strategy:sortable.horizontalListSortingStrategy,children:A}):A]});return jsxRuntime.jsx(Eb__default.default,{children:z})},Ub=({headCell:e,width:t,order:o,orderBy:r,multiSortInfo:a,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d})=>{let{setNodeRef:l,attributes:s,listeners:g,transform:f,transition:m,isDragging:b}=sortable.useSortable({id:e.id,disabled:!d}),y=d?{transform:al.Transform.toString(f),transition:m,opacity:b?.6:1}:{},u=a?.direction??(r===e.id?o:"asc"),C=!!a||r===e.id;return jsxRuntime.jsxs(dc__default.default,{ref:d?l:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:C?u:false,onContextMenu:i?p=>i(p,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...y},sx:p=>({position:"sticky",top:0,zIndex:4,backgroundColor:p.palette.mode==="dark"?"#000000":"#f5f5f5",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?b?"grabbing":"grab":void 0}),...d?s:{},...d?g:{},children:[jsxRuntime.jsx(zb__default.default,{active:C,direction:u,onClick:n,sx:p=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,opacity:C?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary}),children:jsxRuntime.jsxs(Ci__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,a&&jsxRuntime.jsx(Ci__default.default,{component:"span",sx:p=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:p.palette.primary.main}),children:a.priority})]})}),jsxRuntime.jsx(Ci__default.default,{onMouseDown:c,onPointerDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:p=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var Mu=e=>{let{t}=oe(),{visibleRows:o,visibleColumns:r,selected:a=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:m}=e,b=p=>a.indexOf(p)!==-1,y=l==="multiple"||l==="single",u=s.length>0,C=r.length+(y?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((p,h)=>{if(p.type==="group"){let v=d.has(p.id),w=p.childIds||[],E=w.filter(k=>b(k)).length,R=w.length>0&&E===w.length,T=E>0&&E<w.length;return jsxRuntime.jsxs(material.TableRow,{sx:k=>({backgroundColor:k.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:k.palette.text.primary,borderBottomColor:k.palette.divider},"& .MuiIconButton-root":{color:k.palette.text.primary},"& .MuiCheckbox-root":{color:k.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:k.palette.primary.main}}),children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:ka,children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:T,onChange:k=>{if(k.stopPropagation(),!!e.onSelectionChange)if(R){let S=a.filter(D=>!w.includes(D));e.onSelectionChange(S);}else {let S=Array.from(new Set([...a,...w]));e.onSelectionChange(S);}},onClick:k=>k.stopPropagation(),sx:ai})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:vr,children:jsxRuntime.jsxs(material.Box,{sx:Tu,children:[s.length>1&&p.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(p.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(p.id)?m?.(p.id):f?.(p.id);},sx:Cr,children:g?.(p.id)?jsxRuntime.jsx(Hb__default.default,{}):jsxRuntime.jsx(Vb__default.default,{})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(p.id),sx:Cr,children:v?jsxRuntime.jsx(Xb__default.default,{}):jsxRuntime.jsx(Xf__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:r.length,sx:{py:1,pl:p.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[p.field,": ",p.value," (",p.count,")"]})})]},p.id)}else {let v=p.data||p,w=p.id||v.id||h,E=b(w),R=`enhanced-table-checkbox-${h}`,I=(p.level!==void 0?p.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:k=>n&&n(k,v),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:ka,children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":R},sx:ai})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:vr}),i.filter(k=>r.includes(k.id)).map((k,S)=>{let P=S===0&&I>0?{pl:I+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:P,children:k.render?k.render(v[k.id],v):(function(){let A=v[k.id];if(k.numeric){if(typeof A=="number")return A.toLocaleString();if(typeof A=="string"&&A.trim()!==""&&!isNaN(Number(A)))return Number(A).toLocaleString()}return A})()},k.id)})]},w)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Du=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:r,grouping:a=[]}=e;if(!e.showSummary)return null;let n=r==="multiple"||r==="single",i=a.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:{...ka,bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{...vr,bgcolor:"background.paper"}}),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 Bu=e=>{let{t}=oe();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var rn=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:r,columns:a,toggleGroupField:n})=>{let{t:i}=oe();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:()=>r([]),startIcon:jsxRuntime.jsx(Nu__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),a.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)})]})},an=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=oe();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:()=>a(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:r.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},sl=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:r,columns:a,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=oe();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=>r(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),a.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)),a.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},cl=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=oe();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:()=>a(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:r.includes(i.id)&&jsxRuntime.jsx(dy__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},Wu=({contextMenu:e,handleClose:t,columns:o,visibleColumns:r,grouping:a,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:l,onSortAsc:s,onSortDesc:g,onClearSort:f,onHideColumn:m,onToggleGroup:b,onToggleSummary:y,onOpenSortDialog:u})=>{let{t:C}=oe(),p=e?.columnId??"",h=o.find(S=>S.id===p),v=a.includes(p),w=n.includes(p),E=!!h?.numeric,R=c.find(S=>S.field===p),T=R?R.direction==="asc":d===p&&l==="asc",I=R?R.direction==="desc":d===p&&l==="desc",k=T||I;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,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:h?.label??p})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{s(p),t();},selected:T,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Ou__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(p),t();},selected:I,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Vu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.sortDesc")})]}),k&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{f(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Nu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Hu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{b(p),t();},selected:v,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(kb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C(v?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{y(p),t();},selected:w,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Sb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{m(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(uy__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.hideColumn")})]})]})},$u=({open:e,onClose:t,columns:o,initialRules:r,onApply:a,onClear:n})=>{let{t:i}=oe(),[c,d]=Kt.useState([]);Kt.useEffect(()=>{e&&d(r.length>0?r.map(y=>({...y})):[]);},[e,r]);let l=Kt.useMemo(()=>new Set(c.map(y=>y.field)),[c]),s=Kt.useMemo(()=>o.filter(y=>!l.has(y.id)),[o,l]),g=()=>{let y=s[0];y&&d(u=>[...u,{field:y.id,direction:"asc"}]);},f=y=>{d(u=>u.filter((C,p)=>p!==y));},m=(y,u)=>{d(C=>C.map((p,h)=>h===y?{...p,...u}:p));},b=(y,u)=>{d(C=>{let p=y+u;if(p<0||p>=C.length)return C;let h=[...C],[v]=h.splice(y,1);return h.splice(p,0,v),h});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((y,u)=>{let C=new Set(c.filter((h,v)=>v!==u).map(h=>h.field)),p=o.filter(h=>!C.has(h.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:y.field,onChange:h=>m(u,{field:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:p.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.label},h.id))}),jsxRuntime.jsxs("select",{value:y.direction,onChange:h=>m(u,{direction:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsxRuntime.jsx(Ou__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(Vu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>f(u),children:jsxRuntime.jsx(gy__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:g,disabled:s.length===0,startIcon:jsxRuntime.jsx(Hu__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{a(c),t();},children:i("common.ok")})]})]})};var di=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Uu=({kpis:e})=>{let{t}=oe(),o=[{label:t("graph.kpi.totalRecords"),value:di(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:di(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:di(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:di(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:di(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(r=>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:r.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:r.color},children:r.value})]},r.label))})};var dl=({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 pi=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:r=210,activeName:a,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:r},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===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.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:a&&c.name!==a?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===a?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var qu=({data:e,color:t="#42A5F5",valueSuffix:o="",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=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,m)=>{let b=n+m*(a-n*2)/Math.max(e.length-1,1),y=r-n-(f.value-c)/l*(r-n*2);return {x:b,y,...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 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-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 ju=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=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=(a-n*2)/e.length,m=Math.max(f*.5,8),b=n+g*f+(f-m)/2,y=s.barValue/i*(r-n*2),u=r-n-y;return {x:b,y:u,barHeight:y,barWidth:m,item:s}}),l=e.map((s,g)=>{let f=(a-n*2)/e.length,m=n+g*f+f/2,b=r-n-s.lineValue/c*(r-n*2);return {x:m,y:b,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-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 wy=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Xu=({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))),r=Math.max(...e.map(n=>n.value),1),a=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=a.get(`${n}__${i}`)||0,d=c/r;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:wy(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 Ty=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],bl=({data:e,variant:t="donut",colors:o=Ty,size:r=180,activeName:a,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:r,height:r,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(r*.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:a&&d.name!==a?.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 Qu=({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((a,n)=>n%2===0),r=t.filter((a,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(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.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(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))})]})};var ep=({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,r=e.map(g=>{let f=g.type==="total"?0:o,m=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=m),{...g,start:f,end:m,delta:m-f}}),a=r.flatMap(g=>[g.start,g.end]),n=Math.min(...a,0),i=Math.max(...a,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)"}),r.map((g,f)=>{let m=(c-d*2)/r.length,b=Math.max(m*.55,8),y=d+f*m+(m-b)/2,u=s(Math.max(g.start,g.end)),C=s(Math.min(g.start,g.end)),p=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:y,y:u,width:b,height:Math.max(C-u,4),rx:6,fill:p}),jsxRuntime.jsx("text",{x:y+b/2,y:u-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(${r.length}, minmax(0, 1fr))`,gap:1},children:r.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var fi=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>{let a=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${a}&zoom=${o}&maptype=${r}`},UM=(e,t=360)=>{let o=fi(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var rp=({apiKey:e,query:t,embedUrl:o,zoom:r=14,mapType:a="roadmap",height:n=320})=>{let i=o||(e&&t?fi({apiKey:e,query:t,zoom:r,mapType:a}):"");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 vl=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let r=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${r}&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 lp=({keyword:e,location:t,embedUrl:o,height:r=320})=>{let a=o||vl({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:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,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:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var sp=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:r})=>{let{t:a}=oe();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(dl,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(pi,{data:e,orientation:"horizontal",activeName:r?.filters?.primaryDimension,onItemClick:n=>r?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(dl,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(pi,{data:t,orientation:"vertical",valueSuffix:"%",activeName:r?.filters?.secondaryDimension,onItemClick:n=>r?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(dl,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:jsxRuntime.jsx(bl,{data:o,variant:"donut",activeName:r?.filters?.status,onItemClick:n=>r?.onStatusClick?.(n.name)})})]})};var ko=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var wc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Uy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Ky=["zh","en","de","fr","ja","ko"],up=({open:e,onClose:t,value:o,onSaveAll:r,modelOptions:a=Uy,promptLangOptions:n=Ky,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=Kt.useState(o),[f,m]=Kt.useState(d||""),[b,y]=Kt.useState(l||""),[u,C]=Kt.useState(false);Kt.useEffect(()=>{e&&(g(o),m(d||""),y(l||""));},[e,o,d,l]);let p=(v,w)=>{g(E=>({...E,[v]:w}));},h=async()=>{if(r)try{C(!0),await r({settings:s,analysisTemplateId:f||void 0,responseTemplateId:b||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(ab__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(ko,{size:"small",value:s.baseUrl,onChange:v=>p("baseUrl",v.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",type:"password",value:s.apiKey,onChange:v=>p("apiKey",v.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",value:s.model,onChange:v=>p("model",v.target.value),fullWidth:true,select:true,label:"Model",children:a.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v,children:v},v))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(ko,{size:"small",value:s.promptLang,onChange:v=>p("promptLang",v.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v,children:v},v))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(ko,{size:"small",value:f,onChange:v=>m(v.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.id,children:v.label},v.id))]}),jsxRuntime.jsx(wc,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:v=>p("analysisPrompt",v.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(ko,{size:"small",value:b,onChange:v=>y(v.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.id,children:v.label},v.id))]}),jsxRuntime.jsx(wc,{multiline:true,minRows:8,value:s.responsePrompt,onChange:v=>p("responsePrompt",v.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:h,disabled:!r||u,children:"Save"})]})]})};var Tl=({open:e,onClose:t,model:o,tableContent:r,extraCharts:a,interaction:n,aiAssistant:i})=>{let{t:c}=oe(),[d,l]=Kt.useState(i?.defaultPrompt||""),[s,g]=Kt.useState(false),[f,m]=Kt.useState(false),b=n?.enabled!==false&&!!n,y=i?.enabled!==false,u=n?.filters||{},C=!!(u.primaryDimension||u.secondaryDimension||u.status),p=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Kt.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let h=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},v=async()=>{let w=d.trim();if(!(!w||!i?.onSubmit))try{g(!0),await i.onSubmit(w,{filters:u,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})}),b&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&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:[y&&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(Yy__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:w=>l(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),v());},placeholder:p,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:v,disabled:s||!d.trim(),children:jsxRuntime.jsx(Jy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>m(true),children:jsxRuntime.jsx(Qy__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(ab__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Uu,{kpis:o.kpis}),jsxRuntime.jsx(sp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:w=>n?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>n?.onSecondaryDimensionClick(w),onStatusClick:w=>n?.onStatusClick(w)}:void 0}),a,r]}),jsxRuntime.jsx(up,{open:f,onClose:()=>m(false),value:h,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var ia={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"]},tx=5,pp=e=>e.toLowerCase().replace(/[\s_-]/g,""),la=(e,t,o,r)=>{if(t)return t;if(e.length===0)return r;let a=Object.keys(e[0]),n=new Map(a.map(i=>[pp(i),i]));for(let i of o){let c=n.get(pp(i));if(c)return c}return a[0]||r},Vo=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},ho=(e,t)=>e==null||e===""?t:String(e),ox=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=ho(i[t],a);n.set(c,(n.get(c)||0)+Vo(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,r)},rx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Vo(c[o]),l.billable+=Vo(c[r]),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,a)},ax=(e,t,o)=>{let r=e.length;if(r===0)return [];let a=new Map;return e.forEach(n=>{let i=ho(n[t],o);a.set(i,(a.get(i)||0)+1);}),Array.from(a.entries()).map(([n,i])=>({name:n,value:i,percent:i/r*100}))},mp=(e,t,o)=>{let r=new Map;return e.forEach(a=>{let n=ho(a[t],"N/A");r.set(n,(r.get(n)||0)+Vo(a[o]));}),Array.from(r.entries()).sort(([a],[n])=>a.localeCompare(n)).map(([a,n])=>({name:a,value:n}))},nx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Vo(c[o]),l.billable+=Vo(c[r]),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,a)},ix=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=ho(i[t],a),d=ho(i[o],a),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Vo(i[r]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},lx=(e,t,o)=>{let r=mp(e,t,o),a=r.map(i=>({name:i.name,value:i.value,type:"delta"})),n=r.reduce((i,c)=>i+c.value,0);return [...a,{name:"Total",value:n,type:"total"}]},sx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=ho(c[t],n),l=`${ho(c[o],n)} / ${ho(c[r],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,a).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},fn=({rows:e,config:t})=>{let{t:o}=oe(),r=o("graph.unassigned"),a=Kt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:la(e,s?.primaryDimension,ia.primaryDimension,"Category"),secondaryDimension:la(e,s?.secondaryDimension,ia.secondaryDimension,"Owner"),status:la(e,s?.status,ia.status,"Status"),date:la(e,s?.date,ia.date,"Date"),description:la(e,s?.description,ia.description,"Description"),reportHours:la(e,s?.reportHours,ia.reportHours,"ReportHours"),billableHours:la(e,s?.billableHours,ia.billableHours,"BillableHours"),amount:la(e,s?.amount,ia.amount,"Amount")}},[e,t?.fieldMapping]),n=Kt.useMemo(()=>e.map((s,g)=>{let f=Vo(s[a.reportHours]),m=Vo(s[a.billableHours]),b=Vo(s[a.amount]),y=f>0?m/f*100:0;return {id:`graph-row-${g}`,Date:ho(s[a.date],""),Primary:ho(s[a.primaryDimension],r),Secondary:ho(s[a.secondaryDimension],r),Description:ho(s[a.description],""),ReportHours:f,BillableHours:m,Amount:b,Efficiency:y,Status:ho(s[a.status],r)}}),[e,a,r]),i=Kt.useMemo(()=>{let s=n.length,g=n.reduce((C,p)=>C+Vo(p.ReportHours),0),f=n.reduce((C,p)=>C+Vo(p.BillableHours),0),m=n.reduce((C,p)=>C+Vo(p.Amount),0),b=g>0?f/g*100:0,y=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(C=>y.includes(ho(C.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:b,totalAmount:m,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||tx,d=Kt.useMemo(()=>({billableByPrimary:ox(n,"Primary","BillableHours",c,r),efficiencyBySecondary:rx(n,"Secondary","ReportHours","BillableHours",c,r),statusDistribution:ax(n,"Status",r),lineByDate:mp(n,"Date","BillableHours"),comboByPrimary:nx(n,"Primary","ReportHours","BillableHours",c,r),heatmapPrimarySecondary:ix(n,"Primary","Secondary","BillableHours",r),waterfallBillable:lx(n,"Date","BillableHours"),fishboneStatusCauses:sx(n,"Status","Primary","Secondary",3,r)}),[n,c,r]),l=Kt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.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:a.status}],rows:n}}),[d,t?.title,a,i,n,o]);return {fieldMapping:a,model:l}};var hn=e=>String(e??"").trim(),Pl=(e={})=>{let[t,o]=Kt.useState(e),r=Kt.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}});},[]),a=Kt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=Kt.useCallback(()=>{o({});},[]),i=Kt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Kt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&hn(s[l.primaryDimension])!==hn(t.primaryDimension)||t.secondaryDimension&&hn(s[l.secondaryDimension])!==hn(t.secondaryDimension)||t.status&&hn(s[l.status])!==hn(t.status))),[t]);return {filters:t,setFilter:r,clearFilter:a,clearAll:n,hasActiveFilters:i,applyRows:c}};var Ml=({variants:e,currentVariantId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=oe(),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]=Kt.useState(false),[m,b]=Kt.useState(""),[y,u]=Kt.useState(false),[C,p]=Kt.useState(false),h=e.find(E=>E.id===t),v=()=>{b(h?.name||i("variant.newVariant")),u(h?.isDefault||false),p(h?.isPublic||false),f(true);},w=()=>{r({name:m,isDefault:y,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: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:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:h||null,onChange:(E,R)=>{R&&o(R);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,R)=>{let{key:T,...I}=E;return jsxRuntime.jsx("li",{...I,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:R.name}),R.isDefault&&jsxRuntime.jsx(vx__default.default,{fontSize:"small",color:"action"})]})},T)}}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:v,size:"small",color:"primary",children:jsxRuntime.jsx(Lp__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:m,onChange:E=>b(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:E=>p(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:w,variant:"contained",children:i("common.save")})]})]})]})};var Cp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:r,layoutRefs:a,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=oe(),[m,b]=Kt.useState([]),[y,u]=Kt.useState(""),C=`orbcafe.variants.${e}.${t}`,p=s!==void 0?s:y,h=D=>{s===void 0&&u(D),g&&g(D);},v=Kt.useCallback(()=>{try{let D=localStorage.getItem(C);if(!D)return [];let P=JSON.parse(D);return Array.isArray(P)?P:[]}catch{return []}},[C]),w=Kt.useCallback(D=>{try{localStorage.setItem(C,JSON.stringify(D));}catch{}},[C]),E=Kt.useCallback(D=>{b(D);let P=D.find(M=>M.isDefault);P&&!p&&(h(P.id),n(P));},[p,n,h]),R=Kt.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=await i.getVariants(e,t);else if(c){let P=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!P.ok)throw new Error(f("variant.toast.fetchFailed"));D=await P.json();}else D=v();return E(D),D}catch(D){console.error("Error fetching variants",D);let P=v();return E(P),d&&d(f("variant.toast.fetchFailed")),P}},[e,t,i,c,v,E,d,f]);return Kt.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(Ml,{variants:m,currentVariantId:p,onLoad:D=>{h(D.id),n(D);},onSave:async D=>{let P=Date.now().toString(),M;try{let A=D.scope||"Both",j=m.find(Z=>Z.name===D.name);P=j?j.id:Date.now().toString();let z=[];if(j&&(Array.isArray(j.filters)?z=[...j.filters]:j.filters&&(z=[{scope:"default",filters:j.filters}])),A==="Search"||A==="Both"){let Z=(Array.isArray(o),o);if(Z)if(Array.isArray(Z)&&Z.length>0&&Z[0].scope)Z.forEach(H=>{let ee=z.findIndex(pe=>pe.scope===H.scope);ee>=0?z[ee]=H:z.push(H);});else {let H={scope:t,filters:Z},ee=z.findIndex(pe=>pe.scope===t);ee>=0?z[ee]=H:z.push(H);}}let V=j?.layout||{},X=[];if(j&&Array.isArray(j.layoutRefs)&&(X=[...j.layoutRefs]),A==="Layout"||A==="Both")if(a&&a.length>0)a.forEach(Z=>{let H=X.findIndex(ee=>ee.tableKey===Z.tableKey);H>=0?X[H]=Z:X.push(Z);});else {let Z={tableKey:t,layoutId:r||null},H=X.findIndex(ee=>ee.tableKey===t);H>=0?X[H]=Z:X.push(Z);}if(M={appId:e,tableKey:t,...D,scope:A,id:P,createdAt:new Date().toISOString(),filters:z,layout:V,layoutRefs:X},i)await i.saveVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let H=m.some(ee=>ee.id===P)?m.map(ee=>ee.id===P?M:ee):[...m,M];b(H),w(H);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await R(),h(P),n(M);}catch(A){console.error("Error saving variant",A);let z=m.some(V=>V.id===P)?m.map(V=>V.id===P?M:V):[...m,M];b(z),w(z),h(P),n(M),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 P=m.filter(M=>M.id!==D);b(P),w(P);}p===D&&h(""),(i||c)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(P){console.error("Error deleting variant",P);let M=m.filter(A=>A.id!==D);b(M),w(M),p===D&&h(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let P=m.find(A=>A.id===D);if(!P)return;let M={appId:e,tableKey:t,...P,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(M)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let A=m.map(j=>({...j,isDefault:j.id===D}));b(A),w(A);}(i||c)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(P){console.error("Error setting default variant",P);let M=m.map(A=>({...A,isDefault:A.id===D}));b(M),w(M),d&&d(f("variant.toast.defaultFailed"));}}})};Ar__default.default.extend(zx__default.default);Ar__default.default.extend(Nx__default.default);Ar__default.default.extend(Ox__default.default);var yi="YYYY-MM-DD",Vx=[null,null],Ra="0.85rem",Hx={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Wx=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:r,isHovered:a})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...a&&!t&&!o&&!r&&{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}},...r&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&r&&{borderRadius:"50%"}})),Tp=({label:e,value:t=Vx,onChange:o})=>{let{t:r,locale:a}=oe(),n=Hx[a]||"en",i=e||r("dateRange.label"),[c,d]=Kt.useState(null),[l,s]=Kt.useState(t),[g,f]=Kt.useState("start"),[m,b]=Kt.useState(null),[y,u]=Kt.useState((t[0]||Ar__default.default()).locale(n)),[C,p]=Kt.useState(""),[h,v]=Kt.useState(""),[w,E]=Kt.useState(false),[R,T]=Kt.useState(false),I=Kt__namespace.default.useRef(t);Kt.useEffect(()=>{let[H,ee]=t,[pe,De]=I.current,xe=Ie=>Ie&&typeof Ie.isSame=="function",se=!(H===null&&pe===null||xe(H)&&xe(pe)&&H.isSame(pe,"day")),te=!(ee===null&&De===null||xe(ee)&&xe(De)&&ee.isSame(De,"day"));(se||te)&&(s(t),t[0]&&xe(t[0])&&u(t[0].locale(n))),I.current=t;},[t,n]),Kt.useEffect(()=>{p(l[0]?l[0].locale(n).format(yi):""),v(l[1]?l[1].locale(n).format(yi):""),E(false),T(false);},[l,n]);let k=(H,ee)=>{let pe=ee.trim(),De=H==="start"?E:T;if(!pe){let te=H==="start"?[null,l[1]]:[l[0],null];De(false),s(te);return}let xe=Ar__default.default(pe,yi,true).locale(n);if(!xe.isValid()){De(true);return}De(false);let se=[...l];if(H==="start")se[0]=xe,se[1]&&xe.isAfter(se[1],"day")&&(se[1]=null),f(se[1]?"start":"end");else {let te=se[0];te&&xe.isBefore(te,"day")?(se=[xe,null],f("end")):(se[1]=xe,f("start"));}s(se),u(xe);},S=H=>{d(H.currentTarget);},D=()=>{d(null),f("start"),b(null);},P=!!c,M=H=>{if(!H)return;let ee=[...l];if(g==="start")ee=[H,null],f("end");else {let pe=ee[0];pe&&H.isBefore(pe)?(ee=[H,null],f("end")):(ee=[pe,H],f("start"));}s(ee);},A=H=>{let ee=Ar__default.default().locale(n),pe=[null,null];switch(H){case "today":pe=[ee,ee];break;case "week":pe=[ee.startOf("week"),ee.endOf("week")];break;case "month":pe=[ee.startOf("month"),ee.endOf("month")];break}s(pe),f("start"),u(ee);},j=()=>{s([null,null]),f("start"),u(Ar__default.default().locale(n));},z=()=>{o&&o(l),D();},V=()=>{s(t),f("start"),D();},X=Kt.useCallback(H=>{let{day:ee,...pe}=H,[De,xe]=l,se=De?ee.isSame(De,"day"):false,te=xe?ee.isSame(xe,"day"):false,Ie=De&&xe?ee.isBetween(De,xe,"day","()"):false,Ye=false;return g==="end"&&De&&!xe&&m&&ee.isAfter(De,"day")&&ee.isBefore(m.add(1,"day"),"day")&&(Ye=true),jsxRuntime.jsx(Wx,{...pe,day:ee,disableMargin:true,isStart:se,isEnd:te,isInRange:Ie||Ye,onMouseEnter:()=>b(ee)})},[l,g,m]),Z=H=>H?H.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${Z(l[0])} - ${Z(l[1])}`:"",onClick:S,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ra}},InputProps:{readOnly:true,sx:{fontSize:Ra,"& .MuiOutlinedInput-input":{fontSize:Ra},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:H=>{H.stopPropagation(),j();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(rb__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:S,sx:{padding:"2px"},children:jsxRuntime.jsx(Ex__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:P,anchorEl:c,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width: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:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:r("dateRange.startDate"),placeholder:yi,value:C,error:w,size:"small",onFocus:()=>f("start"),onChange:H=>{p(H.target.value),w&&E(false);},onBlur:()=>k("start",C),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),k("start",C));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ra,py:.75},"& .MuiInputLabel-root":{fontSize:Ra}}}),jsxRuntime.jsx(Lx__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:r("dateRange.endDate"),placeholder:yi,value:h,error:R,size:"small",onFocus:()=>{l[0]&&f("end");},onChange:H=>{v(H.target.value),R&&T(false);},onBlur:()=>k("end",h),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),k("end",h));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ra,py:.75},"& .MuiInputLabel-root":{fontSize:Ra}}})]})}),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:r("dateRange.today"),onClick:()=>A("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisWeek"),onClick:()=>A("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisMonth"),onClick:()=>A("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:y,onMonthChange:u,onYearChange:u,onChange:M,slots:{day:X},views:["year","month","day"],openTo:"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:V,color:"inherit",children:r("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:z,children:r("common.done")})]})]})]})};var Bl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Qx={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"},Jx=["equals","contains","notContains","wildcard"],Rp=["=","!=",">","<",">=","<=","between"],Ot="0.85rem",e0=({field:e,value:t,onChange:o})=>{let{t:r}=oe(),[a,n]=Kt.useState(null),[i,c]=Kt.useState(null),[d,l]=Kt.useState(""),[s,g]=Kt.useState(""),[f,m]=Kt.useState(false),[b,y]=Kt.useState(""),[u,C]=Kt.useState("");Kt.useEffect(()=>{let S=setTimeout(()=>{C(b);},1e3);return ()=>clearTimeout(S)},[b]);let p=t?.operator||(e.type==="number"?"=":"equals"),h=t?.value,v=S=>{let D=Qx[S];return D?r(D):S},w=S=>{n(S.currentTarget);},E=S=>{o({...t,operator:S,value:h}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Ot}},InputProps:{sx:{fontSize:Ot}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ot,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},T=e.type||"text";if(T==="date"){let D=(P=>{if(!P)return [null,null];if(Array.isArray(P)&&P.length===2){let M=P[0]?Ar__default.default.isDayjs(P[0])?P[0]:Ar__default.default(P[0]):null,A=P[1]?Ar__default.default.isDayjs(P[1])?P[1]:Ar__default.default(P[1]):null;return [M,A]}return Ar__default.default.isDayjs(P)||typeof P=="string"?[Ar__default.default.isDayjs(P)?P:Ar__default.default(P),null]:[null,null]})(h);return jsxRuntime.jsx(Tp,{label:e.label,value:D,onChange:P=>o({value:P,operator:"between"})})}if(T==="number"&&p==="between"){let S=()=>{o({value:[d,s],operator:"between"}),c(null);},D=Array.isArray(h)?`${h[0]||""} - ${h[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:D,placeholder:r("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:v("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:Ot},children:Bl.between})})}),readOnly:true},onClick:P=>c(P.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ot,minHeight:"auto",py:.5}}},children:Rp.map(P=>jsxRuntime.jsxs(material.MenuItem,{selected:P===p,onClick:()=>E(P),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Bl[P]}),jsxRuntime.jsx(material.ListItemText,{primary:v(P),primaryTypographyProps:{fontSize:Ot}})]},P))}),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:r("smartFilter.min"),type:"number",value:d,onChange:P=>l(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ot}},InputProps:{sx:{fontSize:Ot}}}),jsxRuntime.jsx(Yx__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.max"),type:"number",value:s,onChange:P=>g(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ot}},InputProps:{sx:{fontSize:Ot}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:S,children:r("common.ok")})]})})]})}if(e.isValueHelp||T==="value-help"){let S=e.valueHelp?.mode||"single";return jsxRuntime.jsx(Su,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:h??(S==="multiple"?[]:null),mode:S,onChange:D=>o({value:D,operator:S==="multiple"?"anyOf":"equals"})})}if(T==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:h||"",onChange:S=>o({...t,value:S.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:r("common.none")})}),e.options?.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.value,children:S.label},S.value))]});if(T==="multi-select"){let S=Array.isArray(h)?h:[],D=e.options?.filter(P=>P.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:S,onChange:P=>o({...t,value:P.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{y(""),C("");},renderValue:P=>{if(!Array.isArray(P)||P.length===0)return jsxRuntime.jsx("em",{children:r("common.none")});let M=j=>e.options?.find(z=>z.value===j)?.label||j,A=P.map(M);return A.length>2?`${A.slice(0,2).join(", ")} +${A.length-2}`:A.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:r("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(xu__default.default,{fontSize:"small"})}),sx:{fontSize:Ot}},value:b,onChange:P=>y(P.target.value),onKeyDown:P=>{P.key!=="Escape"&&P.stopPropagation();},onClick:P=>P.stopPropagation()})}),D.length>0?D.map(P=>jsxRuntime.jsxs(material.MenuItem,{value:P.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:S.indexOf(P.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:P.label,primaryTypographyProps:{fontSize:Ot}})]},P.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:r("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Ot}})})]})}let I=T==="number"?Rp:Jx,k=f||h!==void 0&&h!==""&&h!==null||!!a;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:h||"",type:T==="number"?"number":"text",onChange:S=>o({...t,value:S.target.value,operator:p}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...R.InputProps,startAdornment:k?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:v(p),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w,onMouseDown:S=>S.preventDefault(),sx:{width:24,height:24,fontSize:Ot,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Bl[p]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(xu__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ot,minHeight:"auto",py:.5}}},children:I.map(S=>jsxRuntime.jsxs(material.MenuItem,{selected:S===p,onClick:()=>E(S),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Bl[S]}),jsxRuntime.jsx(material.ListItemText,{primary:v(S),primaryTypographyProps:{fontSize:Ot}})]},S))})]})},zr=({fields:e,filters:t,onFilterChange:o,variants:r=[],currentVariantId:a,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:m,currentLayoutId:b,layoutRefs:y,variantService:u,serviceUrl:C})=>{let{t:p}=oe(),[h,v]=Kt.useState(true),[w,E]=Kt.useState(null),[R,T]=Kt.useState(e.filter(D=>!D.hidden).map(D=>D.id)),I=(D,P)=>{o({...t,[D]:P});},k=D=>{R.includes(D)?T(R.filter(P=>P!==D)):T([...R,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(Cp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:m,currentLayoutId:b,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let P=null;if(Array.isArray(D.filters)){let M=f||"default",A=D.filters.find(j=>j.scope===M);P=A?A.filters:null;}else P=D.filters;P&&(P.values||P.visibleFields?(P.visibleFields&&Array.isArray(P.visibleFields)&&T(P.visibleFields),P.values&&o(P.values)):o(P)),n&&n(D);},variantService:u,serviceUrl:C,currentVariantId:a}):jsxRuntime.jsx(Ml,{variants:r,currentVariantId:a,onLoad:n,onSave:D=>{i&&i({...D,filters:{values:t,visibleFields:R}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:p("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:D=>E(D.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(jx__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Ot,whiteSpace:"nowrap",minWidth:"fit-content"},children:p("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Ot},children:p(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:w,open:!!w,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Ot,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:p("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Ot}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>k(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:Ot}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:h,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=>R.includes(D.id)).map(D=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(e0,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:P=>I(D.id,P)})},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:()=>v(!h),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:h?jsxRuntime.jsx(Zx__default.default,{sx:{fontSize:20},color:"action"}):jsxRuntime.jsx(Xb__default.default,{sx:{fontSize:20},color:"action"})})})]})};var zp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=oe(),[c,d]=Kt.useState(null),[l,s]=Kt.useState(false),[g,f]=Kt.useState(""),[m,b]=Kt.useState(""),[y,u]=Kt.useState({isDefault:false,isPublic:false}),C=e.find(R=>R.id===t),p=R=>{d(R.currentTarget);},h=()=>{d(null);},v=R=>{o(R),h();},w=()=>{f(""),b(""),u({isDefault:false,isPublic:false}),s(true),h();},E=()=>{g.trim()&&(r({name:g,description:m,...y}),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:w,color:"primary",size:"small",children:jsxRuntime.jsx(Lp__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:p,color:C?"primary":"default",size:"small",children:jsxRuntime.jsx(p0__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:h,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:w,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Lp__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((R,T)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>v(R),selected:R.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:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:I=>{I.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(vx__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(u0__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:I=>{I.stopPropagation(),a(R.id);},children:jsxRuntime.jsx(Pb__default.default,{fontSize:"small"})})})]})]})},R.id||T))]}),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:R=>f(R.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(R=>R.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:m,onChange:R=>b(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isDefault,onChange:R=>u({...y,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isPublic,onChange:R=>u({...y,isPublic:R.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:E,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var vn=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:r,targetLayoutId:a,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=oe(),[s,g]=Kt.useState([]),[f,m]=Kt.useState(""),b=`orbcafe.layouts.${e}.${t}`,y=T=>({id:T.layoutId,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt??new Date().toISOString(),layoutData:T.layout??{}}),u=T=>({appId:e,tableKey:t,layoutId:T.id,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt,layout:T.layoutData}),C=Kt.useCallback(()=>{try{let T=localStorage.getItem(b);if(!T)return [];let I=JSON.parse(T);return Array.isArray(I)?I:[]}catch{return []}},[b]),p=Kt.useCallback(T=>{try{localStorage.setItem(b,JSON.stringify(T));}catch{}},[b]);Kt.useEffect(()=>{n!==void 0&&m(n);},[n]),Kt.useEffect(()=>{if(a&&s.length>0){let T=s.find(I=>I.id===a);T&&(m(T.id),r(T));}},[a,s,r]);let h=Kt.useCallback(async()=>{if(e){if(!i){let T=C();g(T);let I=T.find(k=>k.isDefault);I&&!f&&!a&&(m(I.id),r(I));return}try{let T=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error("LAYOUT_FETCH_FAILED");let k=(await T.json()).map(y);g(k);let S=k.find(D=>D.isDefault);S&&!f&&!a&&(m(S.id),r(S));}catch(T){console.error("Error fetching layouts",T);let I=C();g(I);let k=I.find(S=>S.isDefault);k&&!f&&!a&&(m(k.id),r(k)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,r,a,C,l]);return Kt.useEffect(()=>{h();},[e,t]),jsxRuntime.jsx(zp,{layouts:s,currentLayoutId:f,onLoad:T=>{m(T.id),r(T);},onSave:async T=>{let I=s.find(D=>D.name===T.name),k=I?I.id:Date.now().toString(),S={id:k,...T,createdAt:new Date().toISOString(),layoutData:o,isDefault:T.isDefault??false,isPublic:T.isPublic??false};if(!i){let P=s.some(M=>M.id===k)?s.map(M=>M.id===k?S:M):[...s,S];g(P),p(P),m(k),r(S),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(S))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await h(),m(k),r(S);}catch(D){console.error("Error saving layout",D);let M=s.some(A=>A.id===k)?s.map(A=>A.id===k?S:A):[...s,S];g(M),p(M),m(k),r(S),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async T=>{if(!i){let I=s.filter(k=>k.id!==T);g(I),p(I),f===T&&m(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(T)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===T&&m(""),d&&d(l("layout.toast.deleteSuccess")),await h();}catch(I){console.error("Error deleting layout",I);let k=s.filter(S=>S.id!==T);g(k),p(k),f===T&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async T=>{if(!i){let I=s.map(k=>({...k,isDefault:k.id===T}));g(I),p(I),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let I=s.find(S=>S.id===T);if(!I)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...I,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await h();}catch(I){console.error("Error setting default",I);let k=s.map(S=>({...S,isDefault:S.id===T}));g(k),p(k),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Op=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(a=>a.scope===t);if(o)return o.filters;let r=e.filters.find(a=>a.scope==="default");return r?r.filters:null}return typeof e.filters=="object"?e.filters:null},zl=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,r=null;if(Array.isArray(e.layoutRefs)){let a=e.layoutRefs.find(n=>n.tableKey===t);a&&(o=a.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(r=e.layout),{layoutId:o,layout:r}};function Vp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function g0(e,t){return e==="desc"?(o,r)=>Vp(o,r,t):(o,r)=>-Vp(o,r,t)}function f0(e,t){let o=e.map((r,a)=>[r,a]);return o.sort((r,a)=>{let n=t(r[0],a[0]);return n!==0?n:r[1]-a[1]}),o.map(r=>r[0])}var Cn=e=>{let t=Kt.useCallback(N=>{let $=String(N?.label??N?.id??"").length*9+64,le=typeof N?.minWidth=="number"?N.minWidth:0;return Math.max(100,le,$)},[]),o=Kt.useCallback(()=>(e.columns||[]).filter(N=>!!N?.numeric).map(N=>N.id),[e.columns]),[r,a]=Kt.useState(""),[n,i]=Kt.useState(e.order||"asc"),[c,d]=Kt.useState(e.orderBy||""),[l,s]=Kt.useState([]),[g,f]=Kt.useState(e.page||0),[m,b]=Kt.useState(e.rowsPerPage||20),[y,u]=Kt.useState(e.selected||[]),[C,p]=Kt.useState(e.columns?e.columns.map(N=>N.id):[]),[h,v]=Kt.useState(e.columns?e.columns.map(N=>N.id):[]),[w,E]=Kt.useState(e.showSummary||false),[R,T]=Kt.useState(()=>o()),[I,k]=Kt.useState([]),[S,D]=Kt.useState(new Set),[P,M]=Kt.useState(()=>{let N={};return (e.columns||[]).forEach(O=>{N[O.id]=t(O);}),N}),[A,j]=Kt.useState(null),[z,V]=Kt.useState(null),[X,Z]=Kt.useState(null),[H,ee]=Kt.useState(null),[pe,De]=Kt.useState(false),[xe,se]=Kt.useState(""),[te,Ie]=Kt.useState("");Kt.useEffect(()=>{e.layout&&oo(e.layout);},[e.layout]),Kt.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),Kt.useEffect(()=>{e.selected!==void 0&&u(e.selected);},[e.selected]),Kt.useEffect(()=>{e.page!==void 0&&f(e.page);},[e.page]),Kt.useEffect(()=>{e.rowsPerPage!==void 0&&b(e.rowsPerPage);},[e.rowsPerPage]),Kt.useEffect(()=>{let N=o();T(O=>O.filter(le=>N.includes(le)));},[o]),Kt.useEffect(()=>{M(N=>{let O={...N};return (e.columns||[]).forEach($=>{O[$.id]===void 0&&(O[$.id]=t($));}),O});},[e.columns,t]),Kt.useEffect(()=>{v(N=>{let O=(e.columns||[]).map(Ae=>Ae.id),$=new Set(O),le=N.filter(Ae=>$.has(Ae)),de=new Set(le),Te=O.filter(Ae=>!de.has(Ae)),Ce=[...le,...Te];return Ce.length===N.length&&Ce.every((Ae,Ge)=>Ae===N[Ge])?N:Ce});},[e.columns]);let Ye=Kt.useMemo(()=>{let N=e.columns||[];if(h.length===0)return N;let O=new Map(N.map(de=>[de.id,de])),$=[],le=new Set;return h.forEach(de=>{let Te=O.get(de);Te&&($.push(Te),le.add(de));}),N.forEach(de=>{le.has(de.id)||$.push(de);}),$},[e.columns,h]),Ue=Kt.useMemo(()=>{let N=e.rows||[];return r&&(N=N.filter(O=>Object.keys(O).some($=>String(O[$]).toLowerCase().includes(r.toLowerCase())))),N},[e.rows,r]),be=Kt.useMemo(()=>{if(e.onSortChange)return Ue;if(l.length>0){let N=[...Ue];return N.sort((O,$)=>{for(let le of l){let de=O?.[le.field],Te=$?.[le.field];if(!(de==null&&Te==null)){if(de==null)return le.direction==="asc"?-1:1;if(Te==null)return le.direction==="asc"?1:-1;if(de<Te)return le.direction==="asc"?-1:1;if(de>Te)return le.direction==="asc"?1:-1}}return 0}),N}return c?f0(Ue,g0(n,c)):Ue},[Ue,n,c,l,e.onSortChange]),Ke=Kt.useCallback(N=>{if(I.length===0)return N.map(Te=>({type:"row",data:Te,id:Te[e.rowKey||"id"]}));let O=[...N].sort((Te,Ce)=>{for(let Ae of I){if(Te[Ae]<Ce[Ae])return -1;if(Te[Ae]>Ce[Ae])return 1}return 0}),$=(Te,Ce=0)=>{if(Ce>=I.length)return Te;let Ae=I[Ce],Ge={},Mt=[];return Te.forEach(vt=>{let Pt=vt[Ae],bt=`${Ae}:${Pt}`;Ge[bt]||(Ge[bt]={key:bt,field:Ae,value:Pt,children:[],count:0,level:Ce},Mt.push(Ge[bt])),Ge[bt].children.push(vt),Ge[bt].count++;}),Mt.forEach(vt=>{vt.children&&(vt.children=$(vt.children,Ce+1));}),Mt},le=$(O),de=(Te,Ce="")=>{let Ae=[];return Te.forEach(Ge=>{if(Ge.children){let Mt=Ce?`${Ce}>${Ge.key}`:Ge.key,vt=S.has(Mt);Ae.push({type:"group",id:Mt,field:Ge.field,value:Ge.value,level:Ge.level,count:Ge.count,isExpanded:vt,childIds:(function Pt(bt){let Po=[];return bt.children.forEach(qt=>{qt.children?Po=Po.concat(Pt(qt)):Po.push(qt[e.rowKey||"id"]);}),Po})(Ge)}),vt&&(Ae=Ae.concat(de(Ge.children,Mt)));}else Ae.push({type:"row",data:Ge,id:Ge[e.rowKey||"id"],level:I.length});}),Ae};return de(le)},[I,S,e.rowKey]),lt=Kt.useCallback(N=>{if(I.length===0)return [];let O=[...N].sort((de,Te)=>{for(let Ce of I){if(de[Ce]<Te[Ce])return -1;if(de[Ce]>Te[Ce])return 1}return 0}),$=[],le=(de,Te,Ce)=>{if(Te>=I.length)return;let Ae=I[Te],Ge=new Map;de.forEach(Mt=>{let vt=Mt[Ae],Pt=Ge.get(vt);Pt?Pt.push(Mt):Ge.set(vt,[Mt]);}),Ge.forEach((Mt,vt)=>{let Pt=`${Ae}:${vt}`,bt=Ce?`${Ce}>${Pt}`:Pt;$.push(bt),le(Mt,Te+1,bt);});};return le(O,0,""),$},[I]),Ee=Kt.useMemo(()=>Ke(be),[be,Ke]),Oe=Kt.useMemo(()=>lt(be),[be,lt]),qe=Kt.useMemo(()=>{let N=(e.rows||[]).length;return typeof e.count=="number"&&e.count>N},[e.count,e.rows]),pt=Kt.useMemo(()=>qe?Ee:m>0?Ee.slice(g*m,g*m+m):Ee,[Ee,g,m,qe]),$e=Kt.useMemo(()=>qe&&typeof e.count=="number"?e.count:Ee.length,[Ee.length,qe,e.count]),q=N=>{D(O=>{let $=new Set(O);return $.has(N)?$.delete(N):$.add(N),$});},Le=N=>{let O=Oe.filter($=>$===N||$.startsWith(`${N}>`));D($=>{let le=new Set($);return O.forEach(de=>le.add(de)),le});},ve=N=>{D(O=>{let $=new Set(O);return Array.from($).forEach(le=>{(le===N||le.startsWith(`${N}>`))&&$.delete(le);}),$});},Pe=N=>{if(!N){D(new Set);return}D(new Set(Oe));},at=N=>{let O=Oe.filter($=>$.startsWith(`${N}>`));return O.length===0?S.has(N):S.has(N)&&O.every($=>S.has($))},We=N=>{l.length>0&&s([]);let O=c===N&&n==="asc",$=c===N&&n==="desc";if(e.onSortChange){O?e.onSortChange(N,"desc"):$?e.onSortChange("","asc"):e.onSortChange(N,"asc");return}O?(i("desc"),d(N)):$?(i("asc"),d("")):(i("asc"),d(N));},re=N=>{let O=N.filter($=>$&&$.field);s(O),O.length>0&&d("");},ke=()=>{s([]);},je=(N,O)=>{M($=>({...$,[N]:O}));},St=N=>{if(N.target.checked){let O=Ue.map($=>$[e.rowKey||"id"]);u(O),e.onSelectionChange&&e.onSelectionChange(O);return}u([]),e.onSelectionChange&&e.onSelectionChange([]);},K=(N,O)=>{let $=O[e.rowKey||"id"],le=y.indexOf($),de=[];le===-1?de=de.concat(y,$):le===0?de=de.concat(y.slice(1)):le===y.length-1?de=de.concat(y.slice(0,-1)):le>0&&(de=de.concat(y.slice(0,le),y.slice(le+1))),u(de),e.onSelectionChange&&e.onSelectionChange(de);},Fe=N=>{f(N),e.onPageChange&&e.onPageChange(N);},ye=N=>{b(N),f(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(N);},st=N=>{let O=C.indexOf(N),$=[...C];O===-1?$.push(N):$.splice(O,1),p($);},W=N=>{let O=I.indexOf(N),$=[...I];O===-1?$.push(N):$.splice(O,1),k($);},ue=N=>{o().includes(N)&&T($=>$.includes(N)?$.filter(le=>le!==N):[...$,N]);},_e=(N,O)=>{!N||!O||N===O||v($=>{let le=$.indexOf(N),de=$.indexOf(O);if(le===-1||de===-1)return $;let Te=[...$];return Te.splice(le,1),Te.splice(de,0,N),Te});},Qe=N=>{let O=N?.active?.id,$=N?.over?.id;typeof O=="string"&&typeof $=="string"&&_e(O,$);},mt=N=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:C,columnOrder:h,order:n,orderBy:c,sortBy:l,grouping:I,columnWidths:P,showSummary:w,summaryColumns:R});},yt=N=>{let{layout:O,layoutId:$}=zl(N,e.tableKey||"default");$?(Ie($),se($)):(Ie(""),se("")),O&&(O.visibleColumns&&p(O.visibleColumns),Array.isArray(O.columnOrder)&&v(O.columnOrder),O.order&&i(O.order),O.orderBy&&d(O.orderBy),Array.isArray(O.sortBy)&&s(O.sortBy),O.grouping&&k(O.grouping),O.columnWidths&&M(O.columnWidths),O.showSummary!==void 0&&E(!!O.showSummary),Array.isArray(O.summaryColumns)&&T(O.summaryColumns));},oo=N=>{let O=N?.layoutData||N?.layout||N||{};O.visibleColumns&&p(O.visibleColumns),Array.isArray(O.columnOrder)&&v(O.columnOrder),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),Array.isArray(O.sortBy)&&s(O.sortBy),O.grouping&&k(O.grouping),O.columnWidths&&M(O.columnWidths),O.showSummary!==void 0&&E(!!O.showSummary),Array.isArray(O.summaryColumns)&&T(O.summaryColumns),D(new Set),f(0),N?.id&&se(N.id),Ie("");};Kt.useEffect(()=>{e.layout&&yt({layout:e.layout});},[e.layout]);let xo=N=>{N.preventDefault(),ee(H===null?{mouseX:N.clientX+2,mouseY:N.clientY-6}:null);},xt=()=>{ee(null);},nr=Kt.useMemo(()=>{if(!w)return {};let N={};e.columns.forEach($=>{if($.numeric&&R.includes($.id)){let le=Ue.reduce((de,Te)=>{let Ce=parseFloat(Te[$.id]);return de+(isNaN(Ce)?0:Ce)},0);N[$.id]=le.toFixed(2);}else N[$.id]="";});let O=e.columns.find($=>C.includes($.id));return O&&!O.numeric&&(N[O.id]="Total"),N},[Ue,e.columns,w,R,C]),Rt=()=>{if(!e.columns||!Ue)return;let N=e.columns.map(Te=>Te.label).join(","),O=Ue.map(Te=>e.columns.map(Ce=>{let Ae=Te[Ce.id];return `"${(Ae==null?"":String(Ae)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
184
|
+
`),$=`data:text/csv;charset=utf-8,${N}
|
|
185
|
+
${O}`,le=encodeURI($),de=document.createElement("a");de.setAttribute("href",le),de.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(de),de.click(),document.body.removeChild(de);},ir=()=>{De(true);},ro=()=>{De(false);};return {isMobile:false,columns:Ye,order:n,setOrder:i,orderBy:c,setOrderBy:d,sortBy:l,setSortBy:s,applyMultiSort:re,clearMultiSort:ke,columnOrder:h,setColumnOrder:v,filterText:r,setFilterText:a,visibleColumns:C,setVisibleColumns:p,showSummary:w,setShowSummary:E,summaryColumns:R,grouping:I,setGrouping:k,expandedGroups:S,setExpandedGroups:D,groupAnchorEl:z,setGroupAnchorEl:V,summaryAnchorEl:X,setSummaryAnchorEl:Z,columnWidths:P,setColumnWidths:M,anchorEl:A,setAnchorEl:j,contextMenu:H,setContextMenu:ee,sensors:void 0,sortedAndFilteredRows:be,visibleRows:pt,summaryRow:nr,page:g,setPage:Fe,rowsPerPage:m,setRowsPerPage:ye,totalDisplayCount:$e,selected:y,setSelected:u,isAllExpanded:Oe.length>0&&Oe.every(N=>S.has(N)),handleColumnResize:je,handleRequestSort:We,handleSelectAllClick:St,handleClick:K,toggleSummaryColumn:ue,handleDragEnd:Qe,handleColumnReorder:_e,handleExport:Rt,handleContextMenu:xo,handleCloseContextMenu:xt,toggleColumnVisibility:st,toggleGroupExpand:q,toggleGroupField:W,handleToggleAll:Pe,handleExpandGroupRecursively:Le,handleCollapseGroupRecursively:ve,isGroupFullyExpanded:at,handleLayoutLoad:oo,handleVariantLoad:yt,handleLayoutSave:mt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:C,order:n,orderBy:c,sortBy:l,columnOrder:h,grouping:I,columnWidths:P,showSummary:w,summaryColumns:R},currentLayoutId:xe,layoutIdToLoad:te,onPageChange:Fe,onRowsPerPageChange:ye,graphReportOpen:pe,handleOpenGraphReport:ir,handleCloseGraphReport:ro}};var E2=e=>jsxRuntime.jsx(y0__default.default,{...e}),F2=e=>jsxRuntime.jsx(dc__default.default,{...e}),L2=e=>jsxRuntime.jsx(_p__default.default,{...e}),z2=e=>jsxRuntime.jsx(Eb__default.default,{...e}),N2=e=>jsxRuntime.jsx(Fb__default.default,{...e}),ca=e=>{let{t}=oe(),o="0.85rem",{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:C,tableKey:p="default",graphReport:h,quickCreate:v,quickEdit:w,quickDelete:E,serviceUrl:R}=e,T=r||t("table.title.default"),{isMobile:I,columns:k,order:S,orderBy:D,filterText:P,setFilterText:M,visibleColumns:A,showSummary:j,setShowSummary:z,summaryColumns:V,grouping:X,setGrouping:Z,expandedGroups:H,groupAnchorEl:ee,setGroupAnchorEl:pe,summaryAnchorEl:De,setSummaryAnchorEl:xe,columnWidths:se,anchorEl:te,setAnchorEl:Ie,contextMenu:Ye,sensors:Ue,sortedAndFilteredRows:be,summaryRow:Ke,visibleRows:lt,isAllExpanded:Ee,page:Oe,setPage:qe,rowsPerPage:pt,setRowsPerPage:$e,totalDisplayCount:q,setSelected:Le,handleColumnResize:ve,handleRequestSort:Pe,handleSelectAllClick:at,handleClick:We,toggleSummaryColumn:re,handleDragEnd:ke,handleExport:je,handleContextMenu:St,handleCloseContextMenu:K,toggleColumnVisibility:Fe,toggleGroupExpand:ye,toggleGroupField:st,handleToggleAll:W,handleExpandGroupRecursively:ue,handleCollapseGroupRecursively:_e,isGroupFullyExpanded:Qe,handleLayoutLoad:mt,handleVariantLoad:yt,handleLayoutSave:oo,effectiveAppId:xo,currentLayoutData:xt,currentLayoutId:nr,layoutIdToLoad:Rt,graphReportOpen:ir,handleOpenGraphReport:ro,handleCloseGraphReport:N}=Cn(e),O=h?.enabled??false,$=O&&(h?.interaction?.enabled??true),le=Pl(),de=!!v?.enabled,Te=!!w?.enabled,Ce=!!E?.enabled,Ae=v?.fields,Ge=v?.excludeFields||[],Mt=v?.initialValues||{},[vt,Pt]=Kt__namespace.default.useState(false),[bt,Po]=Kt__namespace.default.useState(false),[qt,Nt]=Kt__namespace.default.useState({}),[vo,jt]=Kt__namespace.default.useState(false),[nt,qo]=Kt__namespace.default.useState(false),[Eo,jo]=Kt__namespace.default.useState({}),[B,_]=Kt__namespace.default.useState(false),[Q,ce]=Kt__namespace.default.useState(false),Be=m||bt||nt||Q,He=Kt__namespace.default.useMemo(()=>{let G=[...k];if(Array.isArray(Ae)&&Ae.length>0){let ie=new Set(Ae);G=G.filter(ne=>ie.has(ne.id));}if(Ge.length>0){let ie=new Set(Ge);G=G.filter(ne=>!ie.has(ne.id));}return G.filter(ie=>!!ie?.id)},[k,Ge,Ae]),rt=C||"id",ge=Kt__namespace.default.useMemo(()=>{let G=new Set(i);return be.filter(ie=>G.has(ie?.[rt]))},[i,be,rt]),Je=ge.length===1?ge[0]:null,ct=w?.fields,Dt=w?.excludeFields||[],dt=w?.editableFields||[],Jt=w?.nonEditableFields||[],ao=w?.primaryKeys?.length?w.primaryKeys:[rt],Co=Kt__namespace.default.useMemo(()=>{let G=[...k];if(Array.isArray(ct)&&ct.length>0){let ie=new Set(ct);G=G.filter(ne=>ie.has(ne.id));}if(Dt.length>0){let ie=new Set(Dt);G=G.filter(ne=>!ie.has(ne.id));}return G.filter(ie=>!!ie?.id)},[k,Dt,ct]),$t=Kt__namespace.default.useMemo(()=>new Set(ao),[ao]),no=Kt__namespace.default.useMemo(()=>new Set(dt),[dt]),Ct=Kt__namespace.default.useMemo(()=>new Set(Jt),[Jt]),Zt=Kt__namespace.default.useCallback(G=>no.size>0?no.has(G):!(Ct.has(G)||$t.has(G)),[no,Ct,$t]);Kt__namespace.default.useEffect(()=>{!ir&&le.hasActiveFilters&&le.clearAll();},[ir,le.hasActiveFilters,le.clearAll]);let yr=()=>{let G={};He.forEach(ie=>{G[ie.id]=Mt[ie.id]??"";}),Nt(G),Pt(true);},Zo=()=>{bt||Pt(false);},Ya=(G,ie)=>{Nt(ne=>({...ne,[G]:ie}));},Qa=async()=>{if(!v?.onSubmit){Pt(false);return}try{Po(!0),await v.onSubmit(qt),Pt(!1);}finally{Po(false);}},Ja=()=>{if(!Je)return;let G={};Co.forEach(ne=>{G[ne.id]=Je[ne.id]??"";});let ie=w?.getInitialValues?{...G,...w.getInitialValues(Je)}:G;jo(ie),jt(true);},Fo=()=>{nt||jt(false);},en=(G,ie)=>{jo(ne=>({...ne,[G]:ie}));},tn=async()=>{if(Je){if(!w?.onSubmit){jt(false);return}try{qo(!0),await w.onSubmit(Eo,Je),jt(!1);}finally{qo(false);}}},Ca=()=>{ge.length!==0&&_(true);},Br=()=>{Q||_(false);},Qr=async()=>{if(ge.length===0){_(false);return}if(!E?.onConfirm){_(false),Le([]),c?.([]);return}try{ce(!0),await E.onConfirm(ge),_(!1),Le([]),c?.([]);}finally{ce(false);}},Jr=be,{fieldMapping:x}=fn({rows:Jr,config:{...h,title:h?.title||`${T} ${t("graph.reportTitle")}`}}),F=Kt__namespace.default.useMemo(()=>$?le.applyRows(Jr,x):Jr,[$,le.applyRows,Jr,x]),{model:L}=fn({rows:F,config:{...h,title:h?.title||`${T} ${t("graph.reportTitle")}`,fieldMapping:x}}),Y=L.table.columns.map(G=>({id:G.id,label:G.label,align:G.align||"left",minWidth:120,numeric:G.align==="right"})),he=xo?jsxRuntime.jsx(vn,{appId:xo,tableKey:p,currentLayoutData:xt,onLayoutLoad:mt,targetLayoutId:Rt,activeLayoutId:nr,serviceUrl:R??u?.serviceUrl}):null,Ve=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(rn,{groupAnchorEl:ee,setGroupAnchorEl:pe,grouping:X,setGrouping:Z,columns:k,toggleGroupField:st}),jsxRuntime.jsx(an,{anchorEl:te,setAnchorEl:Ie,columns:k,visibleColumns:A,toggleColumnVisibility:Fe}),jsxRuntime.jsx(sl,{anchorEl:De,setAnchorEl:xe,showSummary:j,setShowSummary:z,columns:k,summaryColumns:V,toggleSummaryColumn:re}),jsxRuntime.jsx(cl,{contextMenu:Ye,handleCloseContextMenu:K,columns:k,visibleColumns:A,toggleColumnVisibility:Fe})]});return I?jsxRuntime.jsxs(Ci__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx(zr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:xt}],variantService:u.variantService,serviceUrl:R??u.serviceUrl}),jsxRuntime.jsx(Bu,{title:T,loading:m,showSummary:j,setShowSummary:z,setAnchorEl:Ie,setSummaryAnchorEl:xe,filterText:P,setFilterText:M,sortedAndFilteredRows:be,selected:i,columns:k,visibleColumns:A,summaryRow:Ke,handleClick:We,selectionMode:n}),Ve]}):jsxRuntime.jsxs(Ci__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:[u&&jsxRuntime.jsx(Ci__default.default,{sx:{mb:2},children:jsxRuntime.jsx(zr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:G=>{yt(G),u.onVariantLoad&&u.onVariantLoad(G);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:m,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:xt}],currentLayoutId:nr,layoutRefs:[{tableKey:p,layoutId:nr}],variantService:u.variantService,serviceUrl:R??u.serviceUrl})}),jsxRuntime.jsxs(h0__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Be?{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:[a&&jsxRuntime.jsx(rl,{filterText:P,setFilterText:M,onRowsPerPageChange:$e,rowsPerPage:pt,rowsPerPageOptions:b,page:Oe,count:q,onPageChange:qe,actions:d,extraTools:l,grouping:X,setGroupAnchorEl:pe,showSummary:j,setShowSummary:z,setAnchorEl:Ie,setSummaryAnchorEl:xe,handleExport:je,showCreateButton:de,onOpenCreateDialog:yr,showEditButton:Te,onOpenEditDialog:Ja,editDisabled:ge.length!==1,showDeleteButton:Ce,onOpenDeleteConfirm:Ca,deleteDisabled:ge.length===0,onLayoutSave:y||u?.variantService&&u?.appId?oo:void 0,loading:m,layoutManager:he,onOpenGraphReport:O?ro:void 0}),jsxRuntime.jsx(_p__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:Ue,collisionDetection:core.closestCenter,onDragEnd:ke,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(b0__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(se).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(nl,{columns:k,visibleColumns:A,order:S,orderBy:D,onRequestSort:Pe,onContextMenu:St,selectionMode:n,grouping:X,isAllExpanded:Ee,handleToggleAll:W,rowCount:be.length,numSelected:i.length,onSelectAllClick:at,columnWidths:se,onColumnResize:ve}),jsxRuntime.jsx(Mu,{visibleRows:lt,columns:k,visibleColumns:A,selectionMode:n,selected:i,orderBy:D,loading:m,expandedGroups:H,toggleGroupExpand:ye,handleExpandGroupRecursively:ue,handleCollapseGroupRecursively:_e,isGroupFullyExpanded:Qe,handleClick:We,onSelectionChange:c,grouping:X,rowKeyProp:C,page:Oe,rowsPerPage:pt}),j&&jsxRuntime.jsx(Du,{showSummary:j,columns:k,visibleColumns:A,summaryRow:Ke,selectionMode:n?.toString(),grouping:X,orderBy:D,zIndex:3})]})})})]}),de&&jsxRuntime.jsxs(Hp__default.default,{open:vt,onClose:Zo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Wp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:v?.title||t("quickCreate.createWithTitle",{title:T})}),jsxRuntime.jsx($p__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Ci__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[He.map(G=>{let ie=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",ne=G.label||G.id;return jsxRuntime.jsx(Up__default.default,{label:ne,value:qt[G.id]??"",onChange:wt=>Ya(G.id,wt.target.value),type:ie,size:"small",fullWidth:true,InputLabelProps:{shrink:ie==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${G.id}`)}),v?.description&&jsxRuntime.jsx(Kp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:v.description})]})}),jsxRuntime.jsxs(Gp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Ol__default.default,{onClick:Zo,sx:{fontSize:"0.85rem"},disabled:bt,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Ol__default.default,{onClick:Qa,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:bt,children:v?.submitLabel||t("common.save")})]})]}),Te&&jsxRuntime.jsxs(Hp__default.default,{open:vo,onClose:Fo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Wp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||t("quickEdit.editWithTitle",{title:T})}),jsxRuntime.jsx($p__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Ci__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Co.map(G=>{let ie=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",ne=G.label||G.id,wt=Zt(G.id);return jsxRuntime.jsx(Up__default.default,{label:ne,value:Eo[G.id]??"",onChange:U=>en(G.id,U.target.value),type:ie,size:"small",fullWidth:true,disabled:!wt,InputLabelProps:{shrink:ie==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${G.id}`)}),w?.description&&jsxRuntime.jsx(Kp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:w.description})]})}),jsxRuntime.jsxs(Gp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Ol__default.default,{onClick:Fo,sx:{fontSize:"0.85rem"},disabled:nt,children:w?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Ol__default.default,{onClick:tn,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:nt||!Je,children:w?.submitLabel||t("common.save")})]})]}),Ce&&jsxRuntime.jsx(oi,{open:B,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(ge.length>1?t("quickDelete.confirmMessageMultiple",{count:ge.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:Br,onConfirm:Qr}),Ve,O&&jsxRuntime.jsx(Tl,{open:ir,onClose:N,model:L,aiAssistant:h?.aiAssistant,interaction:$?{enabled:true,filters:le.filters,fieldMapping:x,onPrimaryDimensionClick:G=>le.setFilter("primaryDimension",G),onSecondaryDimensionClick:G=>le.setFilter("secondaryDimension",G),onStatusClick:G=>le.setFilter("status",G),onClearFilter:le.clearFilter,onClearAll:le.clearAll}:void 0,tableContent:jsxRuntime.jsx(ca,{appId:xo||"graph-report-internal",title:t("graph.dataBody"),columns:Y,rows:L.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},O2=ca;var K2=({id:e,title:t,hideHeader:o=true,filterConfig:r,tableProps:a,children:n,spacing:i=1,mode:c="separated"})=>{let d=r?{...r,appId:r.appId||e}:void 0,l={...a,appId:a.appId||e};return jsxRuntime.jsxs(wu,{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(zr,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(ca,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var Y2=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:r=[20,50,100,-1],tableKey:a="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=oe(),[l,s]=Kt.useState(false),[g,f]=Kt.useState([]),[m,b]=Kt.useState({}),[y,u]=Kt.useState(e.variants||[]),[C,p]=Kt.useState(e.layout||null),[h,v]=Kt.useState(""),[w,E]=Kt.useState(0),[R,T]=Kt.useState(0),[I,k]=Kt.useState(o),[S,D]=Kt.useState([]),[P,M]=Kt.useState("asc"),[A,j]=Kt.useState("");Kt.useEffect(()=>{let se={};e.filters.forEach(te=>{te.defaultValue!==void 0&&(se[te.id]=te.defaultValue);}),b(se);},[e.filters]);let z=Kt.useCallback(async(se,te,Ie,Ye,Ue)=>{s(true);try{let be={...se,page:te+1,limit:Ie,sort:Ue,order:Ye},Ke;t?Ke=await t(be):typeof e.api=="function"?Ke=await e.api(be):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,be),Ke={rows:[],total:0}):(console.warn("No API configured for report"),Ke={rows:[],total:0}),Ke&&(f(Ke.rows||[]),E(Ke.total||0));}catch(be){console.error("Failed to fetch report data",be);}finally{s(false);}},[e.api,t]);Kt.useEffect(()=>{z(m,R,I,P,A);},[z,R,I,P,A]);let V=()=>{T(0),z(m,0,I,P,A);},X=se=>{T(0),k(se);},Z=(se,te)=>{M(te),j(se);},H=se=>{b(se);},ee=se=>{v(se?.id||"");let te=Op(se,a);if(te){let Ye=te.values??te;b(Ye),z(Ye,0,I,P,A),T(0);}let{layout:Ie}=zl(se,a);Ie&&p(Ie);},pe=se=>{let te={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};u(Ie=>[...Ie,te]);},De=se=>{p(se);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:a,fields:e.filters,filters:m,onFilterChange:H,onSearch:V,onVariantLoad:ee,onVariantSave:pe,onVariantDelete:se=>u(te=>te.filter(Ie=>Ie.id!==se)),onVariantSetDefault:se=>{u(te=>te.map(Ie=>({...Ie,isDefault:Ie.id===se})));},variants:y,currentVariantId:h,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:a,columns:e.columns,rows:g,loading:l,rowKey:"id",count:w,page:R,rowsPerPage:I,rowsPerPageOptions:r,onPageChange:T,onRowsPerPageChange:X,selectionMode:"multiple",selected:S,onSelectionChange:D,onLayoutSave:De,layout:C,title:e.title,showSummary:true,order:P,orderBy:A,serviceUrl:i,onSortChange:Z,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:g,loading:l,refresh:V}};var R0=e=>[...e].sort((t,o)=>o.value-t.value),eB=({bars:e=[],lines:t=[],combos:o=[],heatmap:r=[],pies:a=[],waterfalls:n=[]})=>{let i=Kt.useMemo(()=>R0(e),[e]),c=Kt.useMemo(()=>[...t],[t]),d=Kt.useMemo(()=>[...o],[o]),l=Kt.useMemo(()=>[...r],[r]),s=Kt.useMemo(()=>{let f=a.reduce((m,b)=>m+b.value,0);return a.map(m=>({...m,percent:f>0?m.value/f*100:m.percent}))},[a]),g=Kt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var nB=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>Kt.useMemo(()=>!e||!t?"":fi({apiKey:e,query:t,zoom:o,mapType:r}),[e,t,o,r]),iB=({keyword:e,location:t})=>Kt.useMemo(()=>vl({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var ki=({code:e,language:t="text",copyable:o=true,showLineNumbers:r=false,wrapLongLines:a=false,maxHeight:n})=>{let[i,c]=Kt.useState(false),d=Kt.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(L0__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(F0__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:r?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:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:e})})]})};var H0=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},W0=async e=>new Function("m","return import(m)")(e),Si=({expression:e,inline:t=false,allowKatex:o=false})=>{let r=Kt.useMemo(()=>H0(e),[e]),[a,n]=Kt.useState("");return Kt.useEffect(()=>{let i=true;return (async()=>{if(!o||!r){n("");return}try{let d=await W0("katex"),s=(d?.default||d)?.renderToString?.(r,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,r,t]),r?a?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):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:r}):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:r})}):null};var j0=async e=>new Function("m","return import(m)")(e),Wc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:r=true})=>{let[a,n]=Kt.useState(""),[i,c]=Kt.useState(""),[d,l]=Kt.useState(false),s=Kt.useMemo(()=>e.trim(),[e]);return Kt.useEffect(()=>{let g=true;return (async()=>{if(!r||!s){n(""),c("");return}l(true),c(""),n("");try{let m=await j0("mermaid"),b=m?.default||m;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),u=typeof y=="string"?y:y?.svg;g&&typeof u=="string"&&n(u);}catch(m){if(g){let b=m instanceof Error?m.message:"Failed to render Mermaid diagram";c(b);}}finally{g&&l(false);}})(),()=>{g=false;}},[r,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&&a&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(ki,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var $c=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),ov=e=>/^:?-{3,}:?$/.test(e.trim()),rv=e=>{let t=e.trim(),o=t.startsWith(":"),r=t.endsWith(":");return o&&r?"center":r?"right":"left"},Wl=e=>{let t=e.split(`
|
|
187
|
+
`).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=$c(t[0]),r=$c(t[1]);if(o.length===0||r.length!==o.length||!r.every(ov))return null;let a=r.map(rv),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=$c(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:a,rows:n}},Gc=({markdown:e,table:t,maxHeight:o=360})=>{let r=Kt.useMemo(()=>t||(e?Wl(e):null),[t,e]);return !r||r.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:r.headers.map((a,n)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:r.rows.map((a,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:a.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:r.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 Gl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:r=false})=>{let[a,n]=Kt.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:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(dv__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,r?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:a,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 Kc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Ul=e=>e.trim().startsWith("```"),om=e=>/^#{1,6}\s+/.test(e.trim()),_c=e=>/^[-*+]\s+/.test(e.trim()),qc=e=>/^\d+\.\s+/.test(e.trim()),rm=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),jc=e=>e.trim().startsWith(">"),am=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],r=e[t+1];return !o.includes("|")||!r.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r.trim())},nm=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Ii=(e,t,o)=>{let r=[],a=0,n=0;Kc.lastIndex=0;let i=Kc.exec(e);for(;i;){i.index>a&&r.push(e.slice(a,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))r.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))r.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))r.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?r.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):r.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?r.push(jsxRuntime.jsx(Si,{expression:c,inline:true,allowKatex:true},d)):r.push(c);a=i.index+c.length,n+=1,i=Kc.exec(e);}return a<e.length&&r.push(e.slice(a)),r.length>0?r:[e]},Pi=({markdown:e,content:t,className:o,enableMath:r=true,enableMermaid:a=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=Kt.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
|
|
188
188
|
`).split(`
|
|
189
|
-
`),f={enableMath:
|
|
190
|
-
`).trim()},`think-tag-${m}`));continue}m+=1;let
|
|
191
|
-
`).trim()},`think-fence-${m}`));continue}if(
|
|
192
|
-
`);if(
|
|
193
|
-
`).trim(),allowKatex:true},`math-${m}`));continue}if(
|
|
194
|
-
`),b=Bl(p);if(b){s.push(jsxRuntime.jsx(Fc,{table:b},`table-${m}`)),m=v;continue}}if(Vc(h)){let v=[];for(;m<g.length&&Vc(g[m]);)v.push(g[m].replace(/^\s*>\s?/,"")),m+=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((p,b)=>jsxRuntime.jsxs(Kt.Fragment,{children:[b>0&&jsxRuntime.jsx("br",{}),bi(p,f,`q-${m}-${b}`)]},`quote-line-${b}`))})},`quote-${m}`));continue}if(zc(h)){let v=[];for(;m<g.length&&zc(g[m]);)v.push(g[m].trim().replace(/^[-*+]\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:v.map((p,b)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:bi(p,f,`ul-${m}-${b}`)})},`ul-item-${b}`))},`ul-${m}`));continue}if(Nc(h)){let v=[];for(;m<g.length&&Nc(g[m]);)v.push(g[m].trim().replace(/^\d+\.\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:v.map((p,b)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:bi(p,f,`ol-${m}-${b}`)})},`ol-item-${b}`))},`ol-${m}`));continue}let u=[];for(;m<g.length;){let v=g[m],p=v.trim();if(!p||Ll(v)||Gp(v)||Up(v)||zc(v)||Nc(v)||Vc(v)||Kp(g,m)||n&&qp(v)||a&&p.startsWith("$$"))break;u.push(v),m+=1;}u.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((v,p)=>jsxRuntime.jsxs(Kt.Fragment,{children:[p>0&&jsxRuntime.jsx("br",{}),bi(v,f,`p-${m}-${p}`)]},`p-line-${p}`))},`p-${m}`)):m+=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 uB=(e,t)=>jsxRuntime.jsx(yi,{markdown:e,...t});var Zp=({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(lu__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(Vh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(Ay__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(Fy__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Xp=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);return n<0?e: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)]})},zl=({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:Xp(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?Xp(r,t):a.value})]},a.id)})})]})};var Gc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Vl=e=>e.trim().toLowerCase(),sv=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||Gc(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:Vl(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||Gc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Vl(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Gc(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:Vl(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Yp=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=re(),[n,i]=Kt.useState(""),[c,d]=Kt.useState(o||t[0]?.id),[l,s]=Kt.useState("idle"),[g,f]=Kt.useState([]),[m,h]=Kt.useState(""),[C,u]=Kt.useState(""),[v,p]=Kt.useState(false),b=Kt.useMemo(()=>sv(e,t),[e,t]);Kt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(I=>I.id===c)||d(o||t[0]?.id);},[t,c,o]);let y=Kt.useCallback(()=>{s("idle"),f([]),h(""),u("");},[]),T=Kt.useCallback(S=>{i(S),S.trim()||(s("idle"),f([]),h(""),u(""));},[]),F=Kt.useCallback(S=>{let I=Vl(S);return I?b.filter(k=>k.text.includes(I)).map(k=>k.hit):[]},[b]),R=Kt.useCallback(async()=>{let S=n.trim();if(!S)return;p(true);let I=F(S);if(f(I),I.length>0){s("search"),u(""),h(r("detail.searchAi.matches",{count:I.length})),p(false);return}if(a?.enabled!==false&&a?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let w=await a.onSubmit(S,{query:S,hits:I,activeTabId:c,sections:e,tabs:t});u(typeof w=="string"?w:"");}finally{p(false);}return}s("search"),u(""),h(r("detail.searchAi.noMatch")),p(false);},[n,F,r,a,c,e,t]);return {query:n,setQuery:T,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:m,aiResponse:C,searching:v,handleSubmit:R,clearResult:y}};var $B=({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}=re(),{query:f,setQuery:m,activeTabId:h,setActiveTabId:C,searchMode:u,hits:v,statusText:p,aiResponse:b,searching:y,handleSubmit:T,clearResult:F}=Yp({sections:o,tabs:a,defaultTabId:r,ai:i}),R=Kt.useMemo(()=>a.find(k=>k.id===h)||a[0],[a,h]),S=Kt.useCallback(k=>{let w=A=>{let P=document.getElementById(k);if(P){P.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>w(A+1),60);};requestAnimationFrame(()=>w(0));},[]),I=Kt.useCallback((k,w)=>{if(a.some(A=>A.id===k)){C(k),S(w?`detail-tab-${k}-section-${w}`:`detail-tab-${k}`);return}S(`detail-section-${k}`);},[a,C,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(Zp,{value:f,onChange:m,onSubmit:T,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),F();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:p,loading:y,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(gv__default.default,{fontSize:"small"})})}),c]})]}),p&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:p}),u==="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(k=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>I(k.sourceId,k.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:k.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:k.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:k.fieldValue||"-"})]})},`${k.source}|${k.sourceId}|${k.fieldId}`))})]}),u==="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: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(yi,{markdown:b})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(k=>jsxRuntime.jsx(material.Box,{id:`detail-section-${k.id}`,children:jsxRuntime.jsx(zl,{section:k,highlightQuery:f})},k.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(k,w)=>C(w),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(k=>jsxRuntime.jsx(material.Tab,{value:k.id,label:k.label,sx:{textTransform:"none"}},k.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id||""}`}),R?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(R?.sections||[]).map(k=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${k.id}`,children:jsxRuntime.jsx(zl,{section:k,highlightQuery:f})},k.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(zl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(rr,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var tm=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=re();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 xv={success:"success",warning:"warning",info:"info",error:"error"},vv={critical:"error",high:"warning",medium:"info",low:"success"},Cv=(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}},kv=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Kc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=re(),c=!!(r&&t),d=e.tone??(e.priority?vv[e.priority]:"default"),l=d==="default"?"primary":xv[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:Cv(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??kv(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 wv=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,rm=({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}})}},pa=(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}}},Wl=(e,t)=>{let o=pa(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=wv(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 qc="kanban-card|",_c="kanban-bucket|",sm=e=>`${qc}${e}`,Nv=e=>`${_c}${e}`,$l=e=>e?.startsWith(qc)?e.slice(qc.length):void 0,lm=e=>e?.startsWith(_c)?e.slice(_c.length):void 0,Vv=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:sm(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(Kc,{card:e,bucket:t,dragging:d,onClick:o})})},Ov=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:Nv(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(tm,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>sm(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(Vv,{card:c,bucket:e,onCardClick:r},c.id))})})})})},c5=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=Kt.useState(null),[l,s]=Kt.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=Kt.useMemo(()=>c?pa(e,c):void 0,[c,e]),m=Kt.useCallback(()=>{d(null),s(void 0);},[]),h=Kt.useCallback(p=>{if(!p)return;let b=$l(p);return b?pa(e,b)?.bucket.id:lm(p)},[e]),C=Kt.useCallback(p=>{d($l(String(p.active.id))??null);},[]),u=Kt.useCallback(p=>{s(h(p.over?String(p.over.id):void 0));},[h]),v=Kt.useCallback(p=>{let b=$l(String(p.active.id)),y=p.over?String(p.over.id):void 0;if(!b||!y){m();return}let T=pa(e,b);if(!T){m();return}let F=T.bucket.id,R=T.cardIndex,S=$l(y);if(S){let w=pa(e,S);if(!w){m();return}F=w.bucket.id,R=w.cardIndex;}else {let w=lm(y),A=e.buckets.find(P=>P.id===w);if(!w||!A){m();return}F=w,R=A.cards.length;}if(T.bucket.id===F&&T.cardIndex===R){m();return}let I=Wl(e,{cardId:b,fromBucketId:T.bucket.id,toBucketId:F,targetIndex:R}),k=pa(I,b);k&&!(k.bucket.id===T.bucket.id&&k.cardIndex===T.cardIndex)&&t?.({cardId:b,fromBucketId:T.bucket.id,toBucketId:k.bucket.id,targetIndex:k.cardIndex,card:k.card,model:I}),m();},[e,t,m]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:C,onDragOver:u,onDragEnd:v,onDragCancel:m,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(p=>jsxRuntime.jsx(Ov,{bucket:p,highlighted:p.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},p.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(Kc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var Gv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||rm({buckets:t??[],cards:o??[]}),g5=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=Kt.useState(()=>Gv(e)),n=Kt.useCallback(s=>{r(g=>typeof s=="function"?s(g):s);},[]),i=Kt.useCallback(s=>pa(a,s),[a]),c=Kt.useCallback((s,g,f)=>{let m=pa(a,s);if(!m)return;let h=Wl(a,{cardId:s,fromBucketId:m.bucket.id,toBucketId:g,targetIndex:f}),C=pa(h,s);if(!C||C.bucket.id===m.bucket.id&&C.cardIndex===m.cardIndex)return;r(h);let u={cardId:s,fromBucketId:m.bucket.id,toBucketId:C.bucket.id,targetIndex:C.cardIndex,card:C.card,model:h};return t?.(u),u},[a,t]),d=Kt.useCallback((s,g)=>{r(f=>({buckets:f.buckets.map(m=>({...m,cards:m.cards.map(h=>h.id!==s?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),l=Kt.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}};function xn({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=Kt.useState(false),d=Kt.useRef(null),l=Kt.useRef(null),s=Kt.useRef(null),g=Kt.useRef(null),f=Kt.useRef(null),m=Kt.useRef(0),h=Kt.useRef(false),C=Kt.useRef(false),u=Kt.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(b=>b.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),C.current=false,c(false);},[]),v=Kt.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),p=Kt.useCallback(async()=>{if(!(i||C.current)){C.current=true,h.current=false,m.current=Date.now();try{let b=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=b;let y=new WebSocket(a);d.current=y,y.onopen=()=>{c(!0),C.current=!1;},y.onmessage=I=>{try{let k=JSON.parse(I.data);if(k.type==="recognition")k.is_final?t(k.text):e?.(k.text);else if(k.type==="error"){let w=k.message||"Voice recognition error";o?.(w),v();}}catch{o?.("Failed to parse voice message");}},y.onerror=()=>{o?.("Voice service connection failed"),u();},y.onclose=()=>{u();};let T=window.AudioContext||window.webkitAudioContext;if(!T)throw new Error("AudioContext is not supported in this browser");let F=new T({sampleRate:16e3});s.current=F;let R=F.createMediaStreamSource(b);f.current=R;let S=F.createScriptProcessor(4096,1,1);g.current=S,S.onaudioprocess=I=>{if(d.current?.readyState!==WebSocket.OPEN)return;let k=I.inputBuffer.getChannelData(0),w=0;for(let M=0;M<k.length;M+=1)w+=k[M]*k[M];if(Math.sqrt(w/k.length)>n)m.current=Date.now();else if(Date.now()-m.current>r&&!h.current){v();return}let P=new Int16Array(k.length);for(let M=0;M<k.length;M+=1){let B=Math.max(-1,Math.min(1,k[M]));P[M]=B<0?B*32768:B*32767;}d.current.send(P.buffer);},R.connect(S),S.connect(F.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,r,v,a]);return Kt.useEffect(()=>u,[u]),{isRecording:i,startRecording:p,stopRecording:v}}var gm=64,sC="#E9EDF2",cC="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",dC=["en","zh","fr","de","ja","ko"],fm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},ql=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,onSearchAdd:s,user:g,onUserSetting:f,onUserLogout:m,userMenuItems:h,leftSlot:C,rightSlot:u})=>{let{t:v,locale:p}=re(),b=material.useTheme(),y=b.palette.mode==="dark",[T,F]=Kt.useState(""),[R,S]=Kt.useState(null),[I,k]=Kt.useState(null),w=Kt.useCallback((de=T)=>{let Te=de.trim();Te&&l?.(Te);},[l,T]),A=de=>{de.preventDefault(),w();},{isRecording:P,startRecording:M,stopRecording:B}=xn({onTextUpdate:F,onComplete:de=>{F(de),w(de);},onError:de=>{console.error("Header voice input error:",de);}}),j=Kt.useCallback(async()=>{if(P){B();return}await M();},[P,M,B]),O=o==="system"?jsxRuntime.jsx(aC__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(rC__default.default,{fontSize:"small"}):jsxRuntime.jsx(nC__default.default,{fontSize:"small"}),K=v(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),ee=r||p,le=i&&i.length>0?i:dC,G=n||fm[ee]||ee.toUpperCase(),te=!!R,me=d||v("header.searchPlaceholder"),we=T.trim().length>0,Ce=!!I,ae={width:28,height:28,p:0,color:y?"rgba(255,255,255,0.72)":"rgba(15,23,42,0.56)","&:hover":{bgcolor:y?"rgba(255,255,255,0.1)":"rgba(15,23,42,0.06)"},"&.Mui-disabled":{color:y?"rgba(255,255,255,0.28)":"rgba(15,23,42,0.24)"}},oe=[{key:"setting",label:v("header.menu.setting"),icon:jsxRuntime.jsx(Rx__default.default,{sx:{fontSize:18}}),onClick:f},{key:"logout",label:v("header.menu.logout"),icon:jsxRuntime.jsx(lC__default.default,{sx:{fontSize:18}}),onClick:m}],ye=h&&h.length>0?h:oe,Ge=de=>{k(null),de?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:de=>({top:0,zIndex:de.zIndex.drawer+10,height:gm,backgroundColor:de.palette.mode==="dark"?"#0D0D0D":sC,backgroundImage:de.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%)",cC,"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:de.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${gm}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[C,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:A,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:T,onChange:de=>F(de.target.value),placeholder:me,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",sx:{ml:.25,mr:.5},children:jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:s,"aria-label":v("header.searchAddFeature"),title:v("header.searchAddFeature"),sx:ae,children:jsxRuntime.jsx(oC__default.default,{sx:{fontSize:20}})})}),endAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"end",sx:{ml:.5,mr:.25},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.15,children:[jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:()=>{j();},"aria-label":v(P?"header.searchStopVoice":"header.searchStartVoice"),title:v(P?"header.searchStopVoice":"header.searchStartVoice"),sx:{...ae,color:P?b.palette.error.main:ae.color,bgcolor:P?y?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.1)":"transparent"},children:P?jsxRuntime.jsx(lucideReact.MicOff,{size:17,strokeWidth:2.35}):jsxRuntime.jsx(lucideReact.Mic,{size:17,strokeWidth:2.35})}),jsxRuntime.jsx(material.IconButton,{size:"small",type:"submit",disabled:!we,"aria-label":v("header.searchSend"),title:v("header.searchSend"),sx:{...ae,color:we?b.palette.primary.main:ae.color},children:jsxRuntime.jsx(lucideReact.SendHorizontal,{size:17,strokeWidth:2.35})})]})}),sx:{color:y?"common.white":"rgba(17,24,39,0.9)",bgcolor:y?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,pr:.5,"& .MuiInputBase-input":{py:1.1},"& .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:de=>S(de.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(mm__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:G})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:R,open:te,onClose:()=>S(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:le.map(de=>jsxRuntime.jsx(material.MenuItem,{selected:de===ee,onClick:()=>{c(de),S(null);},sx:{fontSize:"0.82rem"},children:fm[de]},de))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(mm__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:G})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:K,children:O}),g&&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:g.name}),g.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:g.subtitle,children:g.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:de=>k(de.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:g.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:g.avatarText||g.name.slice(0,1).toUpperCase()})})]}),u]})]}),g&&jsxRuntime.jsx(material.Menu,{anchorEl:I,open:Ce,onClose:()=>k(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:ye.map(de=>jsxRuntime.jsxs(material.MenuItem,{disabled:de.disabled,onClick:()=>Ge(de.onClick),children:[de.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:de.icon}),jsxRuntime.jsx(material.ListItemText,{primary:de.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},de.key))})]})};var hm=({menuData:e=[],initialNavigationCollapsed:t=false,initialNavigationMode:o="fixed"}={})=>{let{navigationIslandProps:a}=Jd({initialCollapsed:t,initialDisplayMode:o,content:e}),[r,n]=Kt.useState(900);Kt.useEffect(()=>{let c=()=>n(window.innerHeight);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);let i=Kt.useMemo(()=>Math.max(280,r-100),[r]);return {navigationIslandProps:a,navigationMaxHeight:i}};var ta=12,xm=56,vm=234,_l=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),bC=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,$5=({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:m,onSearchAdd:h,rightHeaderSlot:C,leftHeaderSlot:u,contentSx:v,navigationMode:p,defaultNavigationMode:b="fixed",onNavigationModeChange:y,showNavigationModeToggle:T=true})=>{let F="orbcafe:page-layout-mode",R="orbcafe:page-layout-navigation-mode",[S,I]=Kt.useState("system"),[k,w]=Kt.useState("light"),[A,P]=Kt.useState(false),[M,B]=Kt.useState(false),[j,O]=Kt.useState(b),[K,ee]=Kt.useState({x:ta,y:ta}),[le,G]=Kt.useState("left"),[te,me]=Kt.useState(false),we=Kt.useRef(null),Ce=Kt.useRef(null),ae=p!==void 0,oe=p??j,ye=oe==="floating",Ge=S==="system"?A?k:"light":S;Kt.useEffect(()=>{try{let Re=window.localStorage.getItem(F);(Re==="light"||Re==="dark"||Re==="system")&&I(Re);}catch{}P(true);let _=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{w(_.matches?"dark":"light");};return Q(),_.addEventListener("change",Q),()=>_.removeEventListener("change",Q)},[]),Kt.useEffect(()=>{if(A)try{window.localStorage.setItem(F,S);}catch{}},[A,S]),Kt.useEffect(()=>{if(ae){B(true);return}try{let _=window.localStorage.getItem(R);(_==="fixed"||_==="floating")&&O(_);}catch{}finally{B(true);}},[ae]),Kt.useEffect(()=>{if(M)try{window.localStorage.setItem(R,oe);}catch{}},[oe,M]),Kt.useEffect(()=>{Ge==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Ge]);let de=Kt.useMemo(()=>material.createTheme({palette:{mode:Ge}}),[Ge]),Te=Kt.useCallback(_=>{ae||O(_),y?.(_);},[ae,y]),{navigationIslandProps:$e,navigationMaxHeight:ct}=hm({menuData:t,initialNavigationCollapsed:false,initialNavigationMode:oe}),fe=$e.collapsed,Le=Kt.useCallback(_=>{let Q=we.current,Re=Q?.parentElement;if(!Q||!Re)return _;let Be=Re.getBoundingClientRect(),rt=Q.getBoundingClientRect(),it=ta,gt=ta,Et=Math.max(it,Be.width-rt.width-ta),U=Math.max(gt,Be.height-rt.height-ta);return {x:_l(_.x,it,Et),y:_l(_.y,gt,U)}},[]),_e=Kt.useCallback(_=>{let Q=we.current,Re=Q?.parentElement;if(!Q||!Re)return _;let Be=Re.getBoundingClientRect(),rt=Q.getBoundingClientRect(),it=ta,gt=ta,Et=Math.max(it,Be.width-rt.width-ta),U=Math.max(gt,Be.height-rt.height-ta),ze={x:_l(_.x,it,Et),y:_l(_.y,gt,U)},ft=[{distance:Math.abs(ze.x-it),position:{x:it,y:ze.y}},{distance:Math.abs(ze.x-Et),position:{x:Et,y:ze.y}},{distance:Math.abs(ze.y-gt),position:{x:ze.x,y:gt}},{distance:Math.abs(ze.y-U),position:{x:ze.x,y:U}}].reduce((H,xe)=>xe.distance<H.distance?xe:H).position;return G(ft.x>=(it+Et)/2?"right":"left"),ft},[]),dt=Kt.useMemo(()=>{if(!ye||te)return K.x;if(le==="right"){let Re=we.current?.parentElement?.getBoundingClientRect().width,Be=fe?xm:vm;return Re?Math.max(ta,Re-Be-ta):fe?K.x:K.x-(vm-xm)}return K.x},[le,K.x,te,ye,fe]),at=Kt.useCallback(_=>{if(!ye||!fe||bC(_.target))return;_.preventDefault(),_.currentTarget.setPointerCapture(_.pointerId);let Q=Le({x:dt,y:K.y});G("left"),ee(Q),Ce.current={pointerId:_.pointerId,startClientX:_.clientX,startClientY:_.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},me(true);},[Le,dt,K.y,ye,fe]),Z=Kt.useCallback(_=>{let Q=Ce.current;if(!Q||Q.pointerId!==_.pointerId)return;let Re=Le({x:Q.startX+_.clientX-Q.startClientX,y:Q.startY+_.clientY-Q.startClientY});Q.currentX=Re.x,Q.currentY=Re.y,ee(Re);},[Le]),Ne=Kt.useCallback(_=>{let Q=Ce.current;if(!(!Q||Q.pointerId!==_.pointerId)){try{_.currentTarget.releasePointerCapture(_.pointerId);}catch{}Ce.current=null,ee(_e({x:Q.currentX,y:Q.currentY})),me(false);}},[_e]);return Kt.useEffect(()=>{if(!ye)return;let _=()=>{ee(Be=>Le(Be));},Q=window.requestAnimationFrame(_),Re=window.setTimeout(_,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(Re);}},[Le,ye,fe,ct]),jsxRuntime.jsx(material.ThemeProvider,{theme:de,children:jsxRuntime.jsx(qi,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:_=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:_.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":_.palette.background.default}),children:[jsxRuntime.jsx(ql,{appTitle:e,logo:f,mode:S,onToggleMode:()=>I(_=>_==="system"?"dark":_==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,onSearch:m,onSearchAdd:h,leftSlot:u,rightSlot:C}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ye&&jsxRuntime.jsx(material.Box,{sx:{pt:1.5,pb:1.5,pl:1.5,pr:fe?.5:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Gs,{...$e,maxHeight:ct,colorMode:Ge,displayMode:oe,onDisplayModeChange:Te,showDisplayModeToggle:T&&fe})}),a&&ye&&jsxRuntime.jsx(material.Box,{ref:we,onPointerDown:at,onPointerMove:Z,onPointerUp:Ne,onPointerCancel:Ne,sx:_=>({position:"absolute",top:K.y,left:dt,zIndex:_.zIndex.drawer+5,display:"flex",alignItems:"flex-start",cursor:fe?te?"grabbing":"grab":"default",touchAction:fe?"none":"auto",userSelect:te?"none":void 0,transition:te?"none":"left 180ms ease-out, top 180ms ease-out"}),children:jsxRuntime.jsx(Gs,{...$e,maxHeight:ct,colorMode:Ge,displayMode:oe,onDisplayModeChange:Te,showDisplayModeToggle:T&&fe})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",pt:1.5,pb:1.5,pr:1.5,pl:a&&!ye&&fe?.5:1.5,...v},children:o})]})]})})})};var jl="(blank)",km="Result",Sm="Grand Total",wm={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Tm=["sum","count","avg","min","max"];var Im=["palette","rows","columns","filters","values"];var Pm=e=>Im.includes(e),Rm=e=>e==="rows"||e==="columns"||e==="filters",Zl=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Pm(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Pm(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Va=e=>e==null||e===""?jl:e instanceof Date?e.toISOString().slice(0,10):String(e),Er=e=>JSON.stringify(e),Mm=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},yC=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},wn=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>yC(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)},eo=(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},Oa=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Dm=(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 Oa(n,i)})},Xl=(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}),Xc=e=>!e?.aggregations||e.aggregations.length===0?Tm:e.aggregations,So=(e,t)=>{let o=Xc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Ti=(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 Fm=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=re(),[n,i]=Kt.useState(""),c=Kt.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 Qc=({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(DC__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})]})]})}),zm=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Qc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var Pn=({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}=re();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(LC__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 Vm={xs:1.2,md:1.6},Mn=({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:Vm,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(Mx__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:Vm,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ts=({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(DC__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(Vh__default.default,{sx:{fontSize:16}})})]})}),Ii=({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(ts,{label:t,caption:o,onRemove:a,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var rs={rows:jsxRuntime.jsx(ZC__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Jh__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(jC__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(ab__default.default,{fontSize:"small"})},Wm=({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:m})=>{let{t:h}=re(),C=[`${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(Mn,{title:h("pivot.config.title"),subtitle:C,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(Pn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(DC__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(u=>jsxRuntime.jsx(zm,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Pn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:rs.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(u=>jsxRuntime.jsx(Ii,{id:`item|filters|${u}`,label:a.get(u)?.label??u,caption:s(u),trailing:g(u),onRemove:()=>l("filters",u)},u))})})}),jsxRuntime.jsx(Pn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:rs.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(Ii,{id:`item|columns|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Pn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:rs.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(Ii,{id:`item|rows|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("rows",u)},u))})})}),jsxRuntime.jsx(Pn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:rs.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let v=a.get(u.fieldId)?.label??u.fieldId,p=`${m(u.aggregation)}(${v})`;return jsxRuntime.jsx(Ii,{id:`item|values|${u.tokenId}`,label:v,caption:p,trailing:f(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var $m=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Gm=({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(u=>u.primaryValue):e.map((u,v)=>v+1),s=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),m=i-d.left-d.right,h=c-d.top-d.bottom,C=e.map((u,v)=>{let p=o?u.primaryValue:v+1,b=o?u.secondaryValue??0:u.primaryValue,y=d.left+p/g*m,T=c-d.bottom-b/f*h;return {...u,x:y,y:T,rawX:p,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)}),C.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
|
|
195
|
-
`,o?`${t}: ${
|
|
196
|
-
${o}: ${(r
|
|
197
|
-
`,o,": ",
|
|
198
|
-
`,a,": ",(n??r)(p.item.secondaryValue??0)]})},`secondary-${p.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(p=>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:p.name,children:p.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(p.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(p.secondaryValue??0)})]},p.name))})]})};var qm=(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},_m=(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}}),jm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=Va(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:wn(i,o.fieldId,o.aggregation),secondaryValue:a?wn(i,a.fieldId,a.aggregation):void 0}))};var Zm=({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:m,onToggleCollapse:h,getAggregationLabel:C})=>{let{t:u}=re(),v=Kt.useMemo(()=>qm(o,a,t),[a,t,o]),p=Kt.useMemo(()=>_m(r,t,C),[t,C,r]),b=p.find(w=>w.fieldId===i)??p[0],y=p.find(w=>w.fieldId===c&&w.fieldId!==b?.fieldId)??null,T=v.find(w=>w.fieldId===n)??v[0],F=T&&b?u("pivot.chart.subtitleReady",{dimension:T.label,measure:y?`${b.label} / ${y.label}`:b.label}):u("pivot.chart.subtitle"),R=Kt.useMemo(()=>!T||!b?[]:jm({rows:e,dimensionFieldId:T.fieldId,primaryValue:b.item,secondaryValue:y?.item}),[b,e,y,T]),S=w=>b?Ti(w,b.item,t):w.toLocaleString(),I=w=>y?Ti(w,y.item,t):w.toLocaleString(),k=v.length>1||p.length>1;return jsxRuntime.jsxs(Mn,{title:u("pivot.chart.title"),subtitle:F,collapsed:l,onToggleCollapse:h,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[k&&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:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:T?.fieldId??"",onChange:w=>s(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.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:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:b?.fieldId??"",onChange:w=>g(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:p.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.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:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:y?.fieldId??"",onChange:w=>f(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),p.filter(w=>w.fieldId!==b?.fieldId).map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.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:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:w=>m(w.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:T?b?R.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Gm,{data:R,primaryLabel:b.label,secondaryLabel:y?.label,formatPrimaryValue:S,formatSecondaryValue:I}):jsxRuntime.jsx(Km,{data:R,chartType:d,primaryLabel:b.label,secondaryLabel:y?.label,formatPrimaryValue:S,formatSecondaryValue:I}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("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:u("pivot.chart.emptyNoDimension")})})})]})};var ls=({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(Db__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Df__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:Ti(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(ls,{node:s,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var cd=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},ds=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",dd=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",og=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},rg=(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,rg(r.children,t,o+1)),o),Ak=(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},DE=({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:m,initialPresetId:h,onPresetApplied:C})=>{let{t:u}=re(),v=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),p=Kt.useRef(0),b=Kt.useRef(false),y=e??u("pivot.title.default"),T=n??u("pivot.empty"),F=Kt.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),R=Kt.useCallback(x=>F[x]??wm[x],[F]),S=Kt.useMemo(()=>new Set(o.map(x=>x.id)),[o]),I=Kt.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[k,w]=Kt.useState(()=>eo(a?.rows,S)),[A,P]=Kt.useState(()=>eo(a?.columns,S)),[M,B]=Kt.useState(()=>eo(a?.filters,S)),[j,O]=Kt.useState(()=>{let x=a?.values??[],E=new Set,L=[];return x.forEach(X=>{if(!S.has(X.fieldId)||E.has(X.fieldId))return;E.add(X.fieldId),p.current+=1;let ve=I.get(X.fieldId);L.push({tokenId:`v${p.current}`,fieldId:X.fieldId,aggregation:So(X.aggregation,ve)});}),L}),[K,ee]=Kt.useState({}),[le,G]=Kt.useState(true),[te,me]=Kt.useState(false),[we,Ce]=Kt.useState(()=>cd(eo(a?.rows,S),eo(a?.columns,S),r?.dimensionFieldId)),[ae,oe]=Kt.useState(()=>{let x=(a?.values??[]).filter((E,L,X)=>S.has(E.fieldId)&&X.findIndex(ve=>ve.fieldId===E.fieldId)===L).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:So(E.aggregation,I.get(E.fieldId))}));return ds(x,r?.primaryValueFieldId)}),[ye,Ge]=Kt.useState(()=>{let x=(a?.values??[]).filter((L,X,ve)=>S.has(L.fieldId)&&ve.findIndex(He=>He.fieldId===L.fieldId)===X).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:So(L.aggregation,I.get(L.fieldId))})),E=ds(x,r?.primaryValueFieldId);return dd(x,E,r?.secondaryValueFieldId)}),[de,Te]=Kt.useState(r?.chartType??"bar-vertical"),[$e,ct]=Kt.useState(c),[fe,Le]=Kt.useState(d),[_e,dt]=Kt.useState(()=>f??[]),[at,Z]=Kt.useState(""),[Ne,_]=Kt.useState(false),[Q,Re]=Kt.useState(""),[Be,rt]=Kt.useState(null),[it,gt]=Kt.useState(new Set(["__grand_total__"])),[Et,U]=Kt.useState(new Set),ze=l?.rowFields??k,Ae=l?.columnFields??A,ft=l?.filterFields??M,H=l?.valueFields??j,xe=l?.filterSelections??K,Ke=l?.showGrandTotal??le,et=l?.isConfiguratorCollapsed??te,Ct=l?.chartDimensionFieldId??we,It=l?.chartPrimaryValueFieldId??ae,oo=l?.chartSecondaryValueFieldId??ye,xo=l?.chartType??de,bt=l?.isChartCollapsed??$e,ra=l?.isTableCollapsed??fe,Pt=g??_e,na=s||Pt.length>0||!!m,ao=Kt.useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}w(x);},[l]),z=Kt.useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}P(x);},[l]),N=Kt.useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}B(x);},[l]),V=Kt.useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}O(x);},[l]),ce=Kt.useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}ee(x);},[l]),pe=Kt.useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}G(x);},[l]),Pe=Kt.useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}me(x);},[l]),ke=Kt.useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}Ce(x);},[l]),Fe=Kt.useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}oe(x);},[l]),Ue=Kt.useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}Ge(x);},[l]),Rt=Kt.useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}Te(x);},[l]),yt=Kt.useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}ct(x);},[l]),Tt=Kt.useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}Le(x);},[l]),ht=Kt.useCallback(x=>{let E=typeof x=="function"?x(Pt):x;g||dt(E),m?.(E);},[m,Pt,g]),Po=Kt.useMemo(()=>new Set([...ze,...Ae,...ft]),[ze,Ae,ft]),_t=Kt.useMemo(()=>o.filter(x=>!Po.has(x.id)),[o,Po]),Nt=Kt.useMemo(()=>{let x=[...ze,...Ae,...ft],E=new Set,L=[];return x.forEach(X=>{E.has(X)||(E.add(X),L.push(X));}),L},[Ae,ft,ze]);Kt.useEffect(()=>{ao(x=>{let E=x.filter(L=>S.has(L));return Oa(x,E)?x:E}),z(x=>{let E=x.filter(L=>S.has(L));return Oa(x,E)?x:E}),N(x=>{let E=x.filter(L=>S.has(L));return Oa(x,E)?x:E}),V(x=>{let E=x.filter(L=>S.has(L.fieldId)).map(L=>({...L,aggregation:So(L.aggregation,I.get(L.fieldId))}));return Xl(x,E)?x:E});},[I,S]);let vo=Kt.useMemo(()=>{let x={};return Nt.forEach(E=>{let L=new Set;t.forEach(X=>{L.add(Va(X[E]));}),x[E]=Array.from(L).sort((X,ve)=>X.localeCompare(ve));}),x},[Nt,t]);Kt.useEffect(()=>{ce(x=>{let E={};return Nt.forEach(L=>{let X=vo[L]??[],He=(x[L]??[]).filter(se=>X.includes(se)),W=Object.prototype.hasOwnProperty.call(x,L);E[L]=W?He:X;}),Dm(x,E)?x:E});},[Nt,vo]),Kt.useEffect(()=>{ke(x=>cd(ze,Ae,x));},[Ae,ze,ke]),Kt.useEffect(()=>{Fe(x=>ds(H,x));},[Fe,H]),Kt.useEffect(()=>{Ue(x=>dd(H,It,x));},[It,Ue,H]);let jt=Kt.useMemo(()=>t.filter(x=>Nt.every(E=>{let L=xe[E]??[],X=vo[E]??[];if(L.length===X.length)return true;if(L.length===0)return false;let ve=Va(x[E]);return L.includes(ve)})),[Nt,vo,xe,t]),tt=Kt.useMemo(()=>{if(H.length===0)return null;let x=new Map;if(jt.forEach(W=>{let se=Ae.length>0?Ae.map(kt=>Va(W[kt])):[u("pivot.valueLabel")],ie=Er(se);x.set(ie,se);}),x.size===0){let W=Ae.length>0?Ae.map(()=>jl):[u("pivot.valueLabel")];x.set(Er(W),W);}let E=Array.from(x.entries()).sort((W,se)=>Mm(W[1],se[1])),L=E.flatMap(([W,se])=>H.map(ie=>{let kt=I.get(ie.fieldId),$=`${R(ie.aggregation)} ${kt?.label??ie.fieldId}`,ge=Ae.length===0||H.length>1?`${se.join(" / ")} \u2022 ${$}`:se.join(" / ");return {id:`${W}::${ie.tokenId}`,colKey:W,valueItem:ie,label:ge}})),X=[];Ae.length>0&&E.forEach(([W,se])=>{let ie=L.filter(ge=>ge.colKey===W),kt=X,$=[];se.forEach((ge,J)=>{$.push(`d${J}:${ge}`);let Me=`col::${Er($)}`,ut=kt.find(ya=>ya.key===Me);ut||(ut={key:Me,label:ge,children:[],leafColumnIds:[],path:se.slice(0,J+1),depth:J},kt.push(ut)),ie.forEach(ya=>{ut.leafColumnIds.includes(ya.id)||ut.leafColumnIds.push(ya.id);}),kt=ut.children;});});let ve=W=>{let se={};return L.forEach(ie=>{let kt=W.filter($=>{let ge=Ae.length>0?Ae.map(J=>Va($[J])):[u("pivot.valueLabel")];return Er(ge)===ie.colKey});se[ie.id]=wn(kt,ie.valueItem.fieldId,ie.valueItem.aggregation);}),se},He=[];if(ze.length===0)He.push({key:"root",value:u("pivot.resultLabel")||km,children:[],isLeaf:true,aggregatedValues:ve(jt),path:[],depth:0});else {let W=(se,ie,kt)=>{if(ie>=ze.length)return [];let $=ze[ie],ge=new Map;return se.forEach(J=>{let Me=Va(J[$]);ge.has(Me)||ge.set(Me,[]),ge.get(Me).push(J);}),Array.from(ge.keys()).sort().map(J=>{let Me=ge.get(J),ut=[...kt,J];return {key:Er(ut),value:J,fieldId:$,aggregatedValues:ve(Me),children:W(Me,ie+1,ut),isLeaf:ie===ze.length-1,path:ut,depth:ie}})};He.push(...W(jt,0,[]));}return {dataColumns:L,columnTree:X,rowTree:He}},[Ae,I,jt,R,ze,u,H]),_o=Kt.useCallback((x,E)=>(p.current+=1,{tokenId:`v${p.current}`,fieldId:x,aggregation:So(E,I.get(x))}),[I]),Fo=Kt.useCallback(x=>{if(x==="rows")return ao([]);if(x==="columns")return z([]);if(x==="filters")return N([]);V([]);},[]),jo=Kt.useCallback((x,E)=>{if(x==="rows")return ao(L=>L.filter(X=>X!==E));if(x==="columns")return z(L=>L.filter(X=>X!==E));if(x==="filters")return N(L=>L.filter(X=>X!==E));V(L=>L.filter(X=>X.tokenId!==E));},[]),D=Kt.useCallback((x,E)=>{V(L=>L.map(X=>X.tokenId===x?{...X,aggregation:So(E,I.get(X.fieldId))}:X));},[I]),q=Kt.useCallback(x=>{rt(String(x.active.id));},[]),Y=Kt.useCallback(x=>{if(rt(null),!x.over)return;let E=Zl(String(x.active.id)),L=Zl(String(x.over.id));if(!E||!L||E.kind!=="item"||!E.key)return;if(E.zone===L.zone&&L.kind==="item"){if(E.zone==="rows"){let J=ze.indexOf(E.key),Me=ze.indexOf(L.key??"");J!==-1&&Me!==-1&&J!==Me&&ao(ut=>sortable.arrayMove(ut,J,Me));return}if(E.zone==="columns"){let J=Ae.indexOf(E.key),Me=Ae.indexOf(L.key??"");J!==-1&&Me!==-1&&J!==Me&&z(ut=>sortable.arrayMove(ut,J,Me));return}if(E.zone==="filters"){let J=ft.indexOf(E.key),Me=ft.indexOf(L.key??"");J!==-1&&Me!==-1&&J!==Me&&N(ut=>sortable.arrayMove(ut,J,Me));return}if(E.zone==="values"){let J=H.findIndex(ut=>ut.tokenId===E.key),Me=H.findIndex(ut=>ut.tokenId===(L.key??""));J!==-1&&Me!==-1&&J!==Me&&V(ut=>sortable.arrayMove(ut,J,Me));}return}let X=L.zone,ve=[...ze],He=[...Ae],W=[...ft],se=[...H],ie="",kt=null;if(E.zone==="palette")ie=E.key;else if(E.zone==="values"){let J=se.find(Me=>Me.tokenId===E.key);if(!J)return;ie=J.fieldId,kt=J,se=se.filter(Me=>Me.tokenId!==E.key);}else E.zone==="rows"?(ie=E.key,ve=ve.filter(J=>J!==ie)):E.zone==="columns"?(ie=E.key,He=He.filter(J=>J!==ie)):E.zone==="filters"&&(ie=E.key,W=W.filter(J=>J!==ie));if(!ie)return;let $=()=>{ve=ve.filter(J=>J!==ie),He=He.filter(J=>J!==ie),W=W.filter(J=>J!==ie);},ge=J=>{if(L.kind!=="item"||!L.key)return J==="rows"?ve.length:J==="columns"?He.length:J==="filters"?W.length:J==="values"?se.length:0;if(J==="rows"){let Me=ve.indexOf(L.key);return Me>=0?Me:ve.length}if(J==="columns"){let Me=He.indexOf(L.key);return Me>=0?Me:He.length}if(J==="filters"){let Me=W.indexOf(L.key);return Me>=0?Me:W.length}if(J==="values"){let Me=se.findIndex(ut=>ut.tokenId===L.key);return Me>=0?Me:se.length}return 0};if(X==="palette"){ao(ve),z(He),N(W),V(se);return}if(X==="values"){let J=ge("values"),Me=kt??_o(ie);se.splice(J,0,Me),ao(ve),z(He),N(W),V(se);return}if(Rm(X)){$();let J=ge(X);X==="rows"?ve.splice(J,0,ie):X==="columns"?He.splice(J,0,ie):W.splice(J,0,ie),ao(ve),z(He),N(W),V(se);}},[Ae,_o,ft,ze,H]),ue=Kt.useCallback((x,E)=>{ce(L=>({...L,[x]:E}));},[]),Ee=Kt.useCallback(x=>{gt(E=>{let L=new Set(E);return L.has(x)?L.delete(x):L.add(x),L});},[]),We=Kt.useCallback(x=>{U(E=>{let L=new Set(E);return L.has(x)?L.delete(x):L.add(x),L});},[]),Qe=Kt.useCallback(x=>{let E=I.get(x.fieldId),L=Xc(E);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:X=>D(x.tokenId,X.target.value),onClick:X=>X.stopPropagation(),onMouseDown:X=>X.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(X=>jsxRuntime.jsx(material.MenuItem,{value:X,sx:{fontSize:"0.75rem"},children:R(X)},X))})})},[I,R,D]),he=Kt.useCallback(x=>{let E=vo[x]??[],L=xe[x]??E;return E.length===0?u("pivot.filter.noValues"):L.length===0?u("pivot.filter.noneSelected"):L.length===E.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:L.length,total:E.length})},[vo,xe,u]),je=Kt.useCallback(x=>{let E=vo[x]??[],L=xe[x]??E;return jsxRuntime.jsx(Fm,{options:E,selectedValues:L,onChange:X=>ue(x,X)})},[vo,xe,ue]),nt=Kt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Mt=Kt.useCallback(()=>{let x={};return new Set([...Nt,...Object.keys(xe)]).forEach(L=>{if(!S.has(L))return;let X=xe[L]??[];x[L]=[...X];}),{layout:{rows:[...ze],columns:[...Ae],filters:[...ft],values:H.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:Ke,chart:{dimensionFieldId:Ct,primaryValueFieldId:It,secondaryValueFieldId:oo,chartType:xo}}},[Nt,Ct,It,oo,xo,Ae,ft,xe,ze,Ke,S,H]),lt=Kt.useCallback(x=>{let E=eo(x.layout.rows,S),L=eo(x.layout.columns,S),X=eo(x.layout.filters,S),ve=new Set,He=(x.layout.values??[]).filter(ie=>!S.has(ie.fieldId)||ve.has(ie.fieldId)?false:(ve.add(ie.fieldId),true)).map(ie=>_o(ie.fieldId,ie.aggregation)),W={};Object.entries(x.filterSelections??{}).forEach(([ie,kt])=>{!S.has(ie)||!Array.isArray(kt)||(W[ie]=Array.from(new Set(kt.map($=>String($)))));}),ao(E),z(L),N(X),V(He),ce(W),typeof x.showGrandTotal=="boolean"&&pe(x.showGrandTotal),ke(cd(E,L,x.chart?.dimensionFieldId));let se=ds(He,x.chart?.primaryValueFieldId);Fe(se),Ue(dd(He,se,x.chart?.secondaryValueFieldId)),Rt(x.chart?.chartType??"bar-vertical"),Z(x.id),C?.(x);},[_o,C,ke,Fe,Ue,Rt,z,N,ce,ao,pe,V,S]),Jt=Kt.useCallback(x=>{if(!x){Z("");return}let E=Pt.find(L=>L.id===x);if(!E){Z("");return}lt(E);},[lt,Pt]),ro=Kt.useCallback(()=>{let x=u("pivot.preset.defaultName",{index:Pt.length+1});Re(x),_(true);},[Pt.length,u]),Co=Kt.useCallback(()=>{let x=Q.trim();if(!x)return;let E={id:nt(),name:x,...Mt()};ht(L=>[...L,E]),Z(E.id),_(false);},[Mt,nt,Q,ht]),$t=Kt.useCallback(()=>{at&&(ht(x=>x.filter(E=>E.id!==at)),Z(""));},[at,ht]);Kt.useEffect(()=>{if(!h||b.current)return;let x=Pt.find(E=>E.id===h);x&&(b.current=true,lt(x));},[lt,h,Pt]),Kt.useEffect(()=>{at&&(Pt.some(x=>x.id===at)||Z(""));},[at,Pt]);let no=Kt.useMemo(()=>{if(!Ke||!tt||!ze.length)return null;let x={};return tt.dataColumns.forEach(E=>{let L=jt.filter(X=>{let ve=Ae.length>0?Ae.map(He=>Va(X[He])):[u("pivot.valueLabel")];return Er(ve)===E.colKey});x[E.id]=wn(L,E.valueItem.fieldId,E.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||Sm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[Ke,tt,jt,Ae,ze.length,u]),xt=Kt.useMemo(()=>og(tt?.rowTree??[]),[tt]),Zt=Kt.useMemo(()=>og(tt?.columnTree??[]),[tt]);Kt.useEffect(()=>{gt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),xt.forEach(L=>{x.has(L)&&E.add(L);}),E});},[xt]),Kt.useEffect(()=>{U(x=>{let E=new Set;return Zt.forEach(L=>{x.has(L)&&E.add(L);}),E});},[Zt]);let ba=Kt.useCallback(()=>{gt(x=>{let E=new Set(x);return xt.forEach(L=>E.add(L)),E});},[xt]),Zo=Kt.useCallback(()=>{gt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),E});},[]),qr=Kt.useCallback(()=>{U(new Set(Zt));},[Zt]),_r=Kt.useCallback(()=>{U(new Set);},[]),jr=Kt.useMemo(()=>!tt||Ae.length===0?[]:Ak(tt.columnTree,Et),[Ae.length,Et,tt]),Eo=Kt.useMemo(()=>{if(!tt)return [];if(Ae.length===0)return tt.dataColumns.map(E=>({id:E.id,label:E.label,leafColumnIds:[E.id],valueItem:E.valueItem}));let x=new Map(tt.dataColumns.map(E=>[E.id,E]));return jr.flatMap(E=>{let L=new Map;return E.leafColumnIds.forEach(X=>{let ve=x.get(X);if(!ve)return;let He=ve.valueItem.tokenId,W=`${R(ve.valueItem.aggregation)} ${I.get(ve.valueItem.fieldId)?.label??ve.valueItem.fieldId}`,se=L.get(He);if(se){se.leafColumnIds.push(X);return}L.set(He,{id:`${E.key}::${He}`,label:H.length>1?W:E.label,leafColumnIds:[X],valueItem:ve.valueItem});}),Array.from(L.values())})},[Ae.length,I,R,tt,H.length,jr]),Zr=Kt.useMemo(()=>new Map(Eo.map(x=>[x.id,x])),[Eo]),Xr=Kt.useMemo(()=>Eo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[Eo]),br=Kt.useMemo(()=>{if(!tt||Ae.length===0)return [];let x=[],E=rg(tt.columnTree,Et),L=E+(H.length>1?1:0),X=(ve,He)=>{x[He]??(x[He]=[]),ve.forEach(W=>{let se=W.children.length>0&&Et.has(W.key),ie=Eo.filter($=>W.leafColumnIds.some(ge=>$.leafColumnIds.includes(ge))).length,kt=se||H.length>1?1:L-He;x[He].push({key:W.key,label:W.label,colSpan:ie,rowSpan:kt,expandable:W.children.length>0,expanded:se}),se&&X(W.children,He+1);});};return X(tt.columnTree,0),H.length>1&&(x[E]=Eo.map(ve=>({key:ve.id,label:ve.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[Ae.length,Et,tt,H.length,Eo]),Pa=Kt.useCallback((x,E)=>E.leafColumnIds.reduce((L,X)=>L+(x.aggregatedValues[X]??0),0),[]),_a=Kt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:ba,disabled:xt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Zo,disabled:xt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:qr,disabled:Zt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:_r,disabled:Ae.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[Ae.length,Zt.size,xt.size,_r,Zo,qr,ba,u]),ja=()=>{if(!Be)return null;let x=Zl(Be);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let ve=I.get(x.key);return ve?jsxRuntime.jsx(Qc,{label:ve.label,subtitle:ve.type}):null}if(x.zone==="values"){let ve=H.find(ie=>ie.tokenId===x.key);if(!ve)return null;let W=I.get(ve.fieldId)?.label??ve.fieldId,se=`${R(ve.aggregation)}(${W})`;return jsxRuntime.jsx(ts,{label:W,caption:se})}let L=I.get(x.key)?.label??x.key,X=he(x.key);return jsxRuntime.jsx(ts,{label:L,caption:X})};return jsxRuntime.jsxs(material.Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.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:y}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[na&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:at,displayEmpty:true,onChange:x=>Jt(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),Pt.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ro,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(kp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:$t,disabled:!at,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(jb__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:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:jt.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:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:Ke,onChange:x=>pe(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:v,collisionDetection:core.closestCenter,onDragStart:q,onDragEnd:Y,children:[jsxRuntime.jsx(Wm,{isConfiguratorCollapsed:et,onToggleCollapse:()=>Pe(x=>!x),availableFields:_t,fieldMap:I,filterFields:ft,columnFields:Ae,rowFields:ze,valueFields:H,clearZone:Fo,removeFieldFromZone:jo,getFilterSelectionSummary:he,renderDimensionFilterSelect:je,renderAggregationSelect:Qe,getAggregationLabel:R}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ja()})})]}),jsxRuntime.jsx(Zm,{rows:jt,fieldMap:I,rowFields:ze,columnFields:Ae,valueFields:H,chartDimensionFieldId:Ct,chartPrimaryValueFieldId:It,chartSecondaryValueFieldId:oo,chartType:xo,isCollapsed:bt,onChartDimensionFieldIdChange:x=>ke(x),onChartPrimaryValueFieldIdChange:x=>Fe(x),onChartSecondaryValueFieldIdChange:x=>Ue(x),onChartTypeChange:x=>Rt(x),onToggleCollapse:()=>yt(x=>!x),getAggregationLabel:R}),jsxRuntime.jsx(Mn,{title:u("pivot.table.sectionTitle"),subtitle:ze.length>0?ze.map(x=>I.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:ra,onToggleCollapse:()=>Tt(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:_a,children:tt===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:T})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(br.length>0?br:[[]]).map((x,E)=>jsxRuntime.jsxs(material.TableRow,{children:[E===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(br.length,1),sx:L=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:L.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${L.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ze.length>0?ze.map(L=>I.get(L)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:Eo.map(L=>({key:L.id,label:L.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(L=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:L.colSpan,rowSpan:L.rowSpan,sx:X=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:X.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${X.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[L.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>We(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsxRuntime.jsx(Db__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Df__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:L.label})]})},L.key))]},`pivot-header-row-${E}`))}),jsxRuntime.jsxs(material.TableBody,{children:[tt.rowTree.map(x=>jsxRuntime.jsx(ls,{node:x,dataColumns:Xr,fieldMap:I,level:0,expandedKeys:it,onToggle:Ee,getValue:(E,L)=>{let X=Zr.get(L);return X?Pa(E,X):0}},x.key)),no&&jsxRuntime.jsx(ls,{node:no,dataColumns:Xr,fieldMap:I,level:0,expandedKeys:it,onToggle:Ee,getValue:(x,E)=>{let L=Zr.get(E);return L?Pa(x,L):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Ne,onClose:()=>_(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:Q,onChange:x=>Re(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Co());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>_(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Co,disabled:!Q.trim(),children:u("common.save")})]})]})]})};var ng=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},pd=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",ig=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",LE=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Kt.useRef(0),l=Kt.useMemo(()=>new Set(e.map(Z=>Z.id)),[e]),s=Kt.useMemo(()=>new Map(e.map(Z=>[Z.id,Z])),[e]),[g,f]=Kt.useState(()=>eo(t?.rows,l)),[m,h]=Kt.useState(()=>eo(t?.columns,l)),[C,u]=Kt.useState(()=>eo(t?.filters,l)),[v,p]=Kt.useState(()=>{let Z=t?.values??[],Ne=new Set,_=[];return Z.forEach(Q=>{!l.has(Q.fieldId)||Ne.has(Q.fieldId)||(Ne.add(Q.fieldId),d.current+=1,_.push({tokenId:`v${d.current}`,fieldId:Q.fieldId,aggregation:So(Q.aggregation,s.get(Q.fieldId))}));}),_}),[b,y]=Kt.useState(o),[T,F]=Kt.useState(a),[R,S]=Kt.useState(r),[I,k]=Kt.useState(()=>ng(eo(t?.rows,l),eo(t?.columns,l),n?.dimensionFieldId)),[w,A]=Kt.useState(()=>{let Z=(()=>{let Ne=t?.values??[],_=new Set,Q=[];return Ne.forEach(Re=>{!l.has(Re.fieldId)||_.has(Re.fieldId)||(_.add(Re.fieldId),Q.push({tokenId:Re.fieldId,fieldId:Re.fieldId,aggregation:So(Re.aggregation,s.get(Re.fieldId))}));}),Q})();return pd(Z,n?.primaryValueFieldId)}),[P,M]=Kt.useState(()=>{let Z=(()=>{let _=t?.values??[],Q=new Set,Re=[];return _.forEach(Be=>{!l.has(Be.fieldId)||Q.has(Be.fieldId)||(Q.add(Be.fieldId),Re.push({tokenId:Be.fieldId,fieldId:Be.fieldId,aggregation:So(Be.aggregation,s.get(Be.fieldId))}));}),Re})(),Ne=pd(Z,n?.primaryValueFieldId);return ig(Z,Ne,n?.secondaryValueFieldId)}),[B,j]=Kt.useState(n?.chartType??"bar-vertical"),[O,K]=Kt.useState(i),[ee,le]=Kt.useState(c);Kt.useEffect(()=>{f(Z=>{let Ne=Z.filter(_=>l.has(_));return Oa(Z,Ne)?Z:Ne}),h(Z=>{let Ne=Z.filter(_=>l.has(_));return Oa(Z,Ne)?Z:Ne}),u(Z=>{let Ne=Z.filter(_=>l.has(_));return Oa(Z,Ne)?Z:Ne}),p(Z=>{let Ne=Z.filter(_=>l.has(_.fieldId)).map(_=>({..._,aggregation:So(_.aggregation,s.get(_.fieldId))}));return Xl(Z,Ne)?Z:Ne});},[s,l]),Kt.useEffect(()=>{k(Z=>ng(g,m,Z));},[m,g]),Kt.useEffect(()=>{A(Z=>pd(v,Z));},[v]),Kt.useEffect(()=>{M(Z=>ig(v,w,Z));},[w,v]);let G=Kt.useCallback(Z=>{f(eo(Z,l));},[l]),te=Kt.useCallback(Z=>{h(eo(Z,l));},[l]),me=Kt.useCallback(Z=>{u(eo(Z,l));},[l]),we=Kt.useCallback(Z=>{p(Ne=>{let _=Z??[],Q=new Set,Re=[];return _.forEach(Be=>{if(!l.has(Be.fieldId)||Q.has(Be.fieldId))return;Q.add(Be.fieldId);let rt=Ne.find(it=>it.fieldId===Be.fieldId);if(rt){Re.push({...rt,aggregation:So(Be.aggregation??rt.aggregation,s.get(Be.fieldId))});return}d.current+=1,Re.push({tokenId:`v${d.current}`,fieldId:Be.fieldId,aggregation:So(Be.aggregation,s.get(Be.fieldId))});}),Re});},[s,l]),Ce=Kt.useCallback(Z=>{G(Z.rows??[]),te(Z.columns??[]),me(Z.filters??[]),we(Z.values??[]);},[te,me,G,we]),ae=Kt.useCallback(Z=>{if(Z==="rows")return f([]);if(Z==="columns")return h([]);if(Z==="filters")return u([]);p([]);},[]),oe=Kt.useCallback((Z,Ne)=>{if(Z==="rows")return f(_=>_.filter(Q=>Q!==Ne));if(Z==="columns")return h(_=>_.filter(Q=>Q!==Ne));if(Z==="filters")return u(_=>_.filter(Q=>Q!==Ne));p(_=>_.filter(Q=>Q.tokenId!==Ne));},[]),ye=Kt.useCallback((Z,Ne)=>{p(_=>_.map(Q=>Q.tokenId===Z?{...Q,aggregation:So(Ne,s.get(Q.fieldId))}:Q));},[s]),Ge=Kt.useCallback((Z,Ne)=>{y(_=>({..._,[Z]:Ne}));},[]),de=Kt.useCallback(()=>{y({});},[]),Te=Kt.useCallback(()=>{F(Z=>!Z);},[]),$e=Kt.useCallback(()=>{S(Z=>!Z);},[]),ct=Kt.useCallback(Z=>{k(Z);},[]),fe=Kt.useCallback(Z=>{A(Z);},[]),Le=Kt.useCallback(Z=>{M(Z);},[]),_e=Kt.useCallback(()=>{K(Z=>!Z);},[]),dt=Kt.useCallback(()=>{le(Z=>!Z);},[]);return {model:Kt.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:m,setColumnFields:h,filterFields:C,setFilterFields:u,valueFields:v,setValueFields:p,filterSelections:b,setFilterSelections:y,showGrandTotal:T,setShowGrandTotal:F,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:S,chartDimensionFieldId:I,setChartDimensionFieldId:k,chartPrimaryValueFieldId:w,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:P,setChartSecondaryValueFieldId:M,chartType:B,setChartType:j,isChartCollapsed:O,setIsChartCollapsed:K,isTableCollapsed:ee,setIsTableCollapsed:le}),[I,w,P,B,m,C,b,O,R,ee,g,T,v]),actions:{setRows:G,setColumns:te,setFilters:me,setValues:we,setLayout:Ce,clearZone:ae,removeFieldFromZone:oe,setAggregationForValue:ye,setFilterSelection:Ge,resetFilterSelections:de,toggleGrandTotal:Te,toggleConfigurator:$e,setChartDimension:ct,setChartPrimaryValue:fe,setChartSecondaryValue:Le,setChartType:j,toggleChart:_e,toggleTable:dt}}};var HE=({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=Kt.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=Kt.useState(t??i==="landscape");Kt.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 Vk=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},GE=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=Kt.useState(a??n),d=Kt.useMemo(()=>e.find(m=>m[t]===i)||e[0],[t,e,i]),[l,s]=Kt.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:m=>{let h=m[t];c(h);let C=m[o];s(C==null?"0":String(C));},applyEditorValue:m=>{if(i===void 0)return;let h=Vk(l),C=e.map(u=>u[t]===i?{...u,[o]:h}:u);m(C);}}};var Zk=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],pg=(e,t,o,a)=>{t?.(e),a&&o?.();},ZE=({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=Zk,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:m,sx:h})=>{let C=Kt__namespace.default.useRef(null),u=Kt__namespace.default.useRef(null),v=Kt__namespace.default.useRef(null),p=Kt__namespace.default.useRef(null),[b,y]=Kt__namespace.default.useState("idle"),[T,F]=Kt__namespace.default.useState(""),[R,S]=Kt__namespace.default.useState(null),[I,k]=Kt__namespace.default.useState(null),w=Kt__namespace.default.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null),u.current&&(u.current.getTracks().forEach(M=>M.stop()),u.current=null),C.current&&(C.current.srcObject=null);},[]),A=Kt__namespace.default.useCallback(M=>{k(M),y("error"),m?.(M);},[m]);Kt__namespace.default.useEffect(()=>{if(!e){w(),y("idle"),k(null),F("");return}let M=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){y("unsupported"),k("Camera access is not supported in this browser.");return}y("starting"),k(null);try{let j=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(M){j.getTracks().forEach(O=>O.stop());return}if(u.current=j,C.current&&(C.current.srcObject=j,await C.current.play()),!window.BarcodeDetector){y("unsupported"),k("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}p.current=new window.BarcodeDetector({formats:r}),y("ready"),v.current=window.setInterval(async()=>{if(!(!C.current||!p.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await p.current.detect(C.current)).find(le=>le.rawValue);if(!K?.rawValue)return;let ee={rawValue:K.rawValue,format:K.format};S(ee),w(),pg(ee,f,t,c);}catch(O){A(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(j){A(j instanceof Error?j.message:"Unable to start camera.");}}})(),()=>{M=true,w();}},[c,n,r,t,f,e,A,d,w]);let P=()=>{let M=T.trim();if(!M)return;let B={rawValue:M,format:"manual"};S(B),pg(B,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:M=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:M.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:C,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(_k__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"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(jk__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),I?jsxRuntime.jsx(material.Alert,{severity:b==="unsupported"?"info":"warning",children:I}):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:T,onChange:M=>F(M.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:P,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 Jk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},tL=({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:m,dragHandleProps:h,onClick:C,onSwipe:u,sx:v})=>{let[p,b]=Kt.useState(0),[y,T]=Kt.useState(false),F=Kt.useRef(null),R=Kt.useRef(0),S=Kt.useRef(0),I=!!(f||m),k=132,w=()=>{b(0),T(false),F.current=null,R.current=0,S.current=0;},A=O=>{(O==="start"?f:m)?.onTrigger?.(),u?.(O),w();},P=O=>{!I||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(F.current=O.pointerId,R.current=O.clientX,S.current=O.clientX,T(true),O.currentTarget.setPointerCapture(O.pointerId));},M=O=>{if(!y||F.current!==O.pointerId)return;S.current=O.clientX;let K=S.current-R.current,ee=Math.max(-k,Math.min(k,K));b(ee);},B=O=>{if(!y||F.current!==O.pointerId)return;let K=S.current-R.current;if(K>=g&&f){A("start");return}if(K<=-g&&m){A("end");return}Math.abs(K)<12&&C?.(),w();},j=(O,K)=>{if(!O)return null;let ee=O.backgroundColor||Jk[O.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:k,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${ee}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...v},children:[j(f,"left"),j(m,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:P,onPointerMove:M,onPointerUp:B,onPointerCancel:w,sx:O=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:O.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(${p}px, 0, 0) scale(${s?.985:1})`,transition:y?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"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(Qk__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((O,K)=>jsxRuntime.jsx(material.Chip,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(O=>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:O.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,c,i]})})]})};var Li=({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}),dL=({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:m,sx:h})=>{let{t:C}=re(),[u,v]=Kt.useState(t),p=e??u,b=w=>{e===void 0&&v(w),g?.(w);},y=w=>{c&&p.length>=c||b(`${p}${w}`);},T=w=>{if(w==="00"){if(!p){b("0");return}y("00");return}y(w);},F=()=>{!n||p.includes(".")||b(p?`${p}.`:"0.");},R=()=>{if(i){if(p.startsWith("-")){b(p.slice(1));return}b(p?`-${p}`:"-");}},S=()=>{b(p.slice(0,-1));},I=()=>{b("");},k=()=>{f?.(p);};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]}),m?jsxRuntime.jsx(material.IconButton,{onClick:m,size:"small",children:jsxRuntime.jsx(aS__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:p?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:p?"text.primary":"text.disabled"},children:p||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(w=>jsxRuntime.jsx(Li,{label:w,onPress:()=>T(w)},w)),jsxRuntime.jsx(Li,{label:i?"+/-":"00",onPress:i?R:()=>T("00")}),jsxRuntime.jsx(Li,{label:"0",onPress:()=>T("0")}),jsxRuntime.jsx(Li,{label:n?".":s?String(s):"DEL",onPress:n?F: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(oS__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Li,{label:String(l||"CLR"),onPress:I,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:k,sx:w=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:w.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(rS__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var bg=({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(Aa,{...o})})};var uS=(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);}},vg=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=Kt.useState(false);Kt.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 m=f.id===t,h=f.color||(m?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"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:()=>uS(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:m?"#fff":"text.primary",background:m?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:m?"primary.main":"action.hover",color:m?"#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 wg=(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?wg(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,wS=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Tg=({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}=re(),f=styles.useTheme(),m=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),C=i==="auto"?m||h?"portrait":"landscape":i,u=n==="dark",v=navigation.useRouter(),p=navigation.usePathname(),[b,y]=Kt.useState(""),[T,F]=Kt.useState(new Set),R=Kt.useMemo(()=>wg(r,b),[r,b]),S=Kt.useMemo(()=>b.trim()?wS(R):T,[T,R,b]);Kt.useEffect(()=>{e&&F(new Set);},[e]);let I=M=>M.appurl||M.href||"",k=M=>{s?.(M);let B=I(M);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}v.push(B);}},w=M=>{let B=!!M.children?.length;if(e&&B){t?.();return}if(B){F(j=>{let O=new Set(j);return O.has(M.id)?O.delete(M.id):O.add(M.id),O});return}k(M);},A=M=>{let B=l||p,j=I(M);return !!(j&&B===j)},P=(M,B=0)=>{let j=!!M.children?.length,O=S.has(M.id),K=A(M);return jsxRuntime.jsx(material.Box,{sx:{pl:B===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>w(M),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:K?"primary.main":"action.hover",color:K?"#fff":"text.primary"},children:M.icon||(M.title||M.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:M.title||M.label}),M.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:M.description}):null]}),j?jsxRuntime.jsx(kS__default.default,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(SS__default.default,{color:"action"})]}),j?jsxRuntime.jsx(material.Collapse,{in:O,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:M.children?.map(ee=>P(ee,B+1))})}):null]})},M.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#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(CS__default.default,{})}),r.map(M=>jsxRuntime.jsx(material.IconButton,{onClick:()=>w(M),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(M)?"primary.main":"action.hover",color:A(M)?"#fff":"text.primary"},children:M.icon||(M.title||M.label||"?").slice(0,1).toUpperCase()},M.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#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:M=>y(M.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(xS__default.default,{fontSize:"small",color:"action"})}}),C==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(vS__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(M=>P(M)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Fg=(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)},DS=e=>Kt__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}),AS=(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)},BS=({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}`))})]})})},FS=e=>{let{t}=re(),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:m=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:b,quickCreate:y,quickEdit:T,quickDelete:F,serviceUrl:R,orientation:S="auto",cardTitleField:I,cardSubtitleFields:k,toolbarSlot:w,emptyState:A,rowHeight:P="comfortable",cardActionSlot:M,renderCardFooter:B,onRowClick:j}=e,O=a||t("table.title.default"),K=material.useMediaQuery("(orientation: portrait)"),ee=material.useMediaQuery(o.breakpoints.down("md")),le=S==="auto"?K||ee?"portrait":"landscape":S,{columns:G,filterText:te,setFilterText:me,visibleColumns:we,showSummary:Ce,setShowSummary:ae,summaryColumns:oe,grouping:ye,setGrouping:Ge,expandedGroups:de,groupAnchorEl:Te,setGroupAnchorEl:$e,summaryAnchorEl:ct,setSummaryAnchorEl:fe,anchorEl:Le,setAnchorEl:_e,contextMenu:dt,sortedAndFilteredRows:at,summaryRow:Z,visibleRows:Ne,page:_,setPage:Q,rowsPerPage:Re,setRowsPerPage:Be,totalDisplayCount:rt,setSelected:it,handleClick:gt,toggleSummaryColumn:Et,handleExport:U,handleCloseContextMenu:ze,toggleColumnVisibility:Ae,toggleGroupExpand:ft,toggleGroupField:H,handleExpandGroupRecursively:xe,handleCollapseGroupRecursively:Ke,handleLayoutLoad:et,handleVariantLoad:Ct,handleLayoutSave:It,effectiveAppId:oo,currentLayoutData:xo,currentLayoutId:bt,layoutIdToLoad:ra,graphReportOpen:Pt,handleOpenGraphReport:na,handleCloseGraphReport:ao}=hn(e),z=b?.enabled??false,N=z&&(b?.interaction?.enabled??true),V=yl(),ce=v||"id",pe=Kt__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]),Pe=Kt__namespace.default.useMemo(()=>({...pe,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)}),[pe,o]),ke=Kt__namespace.default.useMemo(()=>{let $=new Set(i);return at.filter(ge=>$.has(ge?.[ce]))},[ce,i,at]),Fe=ke.length===1?ke[0]:null,Ue=!!y?.enabled,Rt=!!T?.enabled,yt=!!F?.enabled,Tt=y?.fields,ht=y?.excludeFields||[],Po=y?.initialValues||{},_t=T?.fields,Nt=T?.excludeFields||[],vo=T?.editableFields||[],jt=T?.nonEditableFields||[],tt=T?.primaryKeys?.length?T.primaryKeys:[ce],[_o,Fo]=Kt__namespace.default.useState(false),[jo,D]=Kt__namespace.default.useState(false),[q,Y]=Kt__namespace.default.useState({}),[ue,Ee]=Kt__namespace.default.useState(false),[We,Qe]=Kt__namespace.default.useState(false),[he,je]=Kt__namespace.default.useState({}),[nt,Mt]=Kt__namespace.default.useState(false),[lt,Jt]=Kt__namespace.default.useState(false),ro=m||jo||We||lt,Co=Kt__namespace.default.useMemo(()=>{let $=[...G];if(Array.isArray(Tt)&&Tt.length>0){let ge=new Set(Tt);$=$.filter(J=>ge.has(J.id));}if(ht.length>0){let ge=new Set(ht);$=$.filter(J=>!ge.has(J.id));}return $.filter(ge=>!!ge?.id)},[G,ht,Tt]),$t=Kt__namespace.default.useMemo(()=>{let $=[...G];if(Array.isArray(_t)&&_t.length>0){let ge=new Set(_t);$=$.filter(J=>ge.has(J.id));}if(Nt.length>0){let ge=new Set(Nt);$=$.filter(J=>!ge.has(J.id));}return $.filter(ge=>!!ge?.id)},[G,Nt,_t]),no=Kt__namespace.default.useMemo(()=>new Set(tt),[tt]),xt=Kt__namespace.default.useMemo(()=>new Set(vo),[vo]),Zt=Kt__namespace.default.useMemo(()=>new Set(jt),[jt]),ba=Kt__namespace.default.useCallback($=>xt.size>0?xt.has($):!(Zt.has($)||no.has($)),[xt,Zt,no]);Kt__namespace.default.useEffect(()=>{!Pt&&V.hasActiveFilters&&V.clearAll();},[V,Pt]);let Zo=()=>{let $={};Co.forEach(ge=>{$[ge.id]=Po[ge.id]??"";}),Y($),Fo(true);},qr=($,ge)=>{Y(J=>({...J,[$]:ge}));},_r=async()=>{if(!y?.onSubmit){Fo(false);return}try{D(!0),await y.onSubmit(q),Fo(!1);}finally{D(false);}},jr=()=>{if(!Fe)return;let $={};$t.forEach(J=>{$[J.id]=Fe[J.id]??"";});let ge=T?.getInitialValues?{...$,...T.getInitialValues(Fe)}:$;je(ge),Ee(true);},Eo=($,ge)=>{je(J=>({...J,[$]:ge}));},Zr=async()=>{if(Fe){if(!T?.onSubmit){Ee(false);return}try{Qe(!0),await T.onSubmit(he,Fe),Ee(!1);}finally{Qe(false);}}},Xr=()=>{ke.length!==0&&Mt(true);},br=async()=>{if(ke.length===0){Mt(false);return}if(!F?.onConfirm){Mt(false),it([]),c?.([]);return}try{Jt(!0),await F.onConfirm(ke),Mt(!1),it([]),c?.([]);}finally{Jt(false);}},Pa=at,{fieldMapping:_a}=dn({rows:Pa,config:{...b,title:b?.title||`${O} ${t("graph.reportTitle")}`}}),ja=Kt__namespace.default.useMemo(()=>N?V.applyRows(Pa,_a):Pa,[_a,V,N,Pa]),{model:x}=dn({rows:ja,config:{...b,title:b?.title||`${O} ${t("graph.reportTitle")}`,fieldMapping:_a}}),E=x.table.columns.map($=>({id:$.id,label:$.label,align:$.align||"left",minWidth:120,numeric:$.align==="right"})),L=oo?jsxRuntime.jsx(fn,{appId:oo,tableKey:p,currentLayoutData:xo,onLayoutLoad:et,targetLayoutId:ra,activeLayoutId:bt,serviceUrl:R??u?.serviceUrl}):null,X=G.filter($=>we.includes($.id)),ve=X.find($=>$.id===I)||X[0],He=k?.map($=>X.find(ge=>ge.id===$)).filter(Boolean)||X.filter($=>$.id!==ve?.id).slice(0,le==="portrait"?2:3),W=X.filter($=>$.id!==ve?.id&&!He.some(ge=>ge.id===$.id)),se=[w,l].filter(Boolean),ie=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Qr,{groupAnchorEl:Te,setGroupAnchorEl:$e,grouping:ye,setGrouping:Ge,columns:G,toggleGroupField:H}),jsxRuntime.jsx(Jr,{anchorEl:Le,setAnchorEl:_e,columns:G,visibleColumns:we,toggleColumnVisibility:Ae}),jsxRuntime.jsx(Ji,{anchorEl:ct,setAnchorEl:fe,showSummary:Ce,setShowSummary:ae,columns:G,summaryColumns:oe,toggleSummaryColumn:Et}),jsxRuntime.jsx(el,{contextMenu:dt,handleCloseContextMenu:ze,columns:G,visibleColumns:we,toggleColumnVisibility:Ae})]}),kt=($,ge,J)=>{let Me=i.includes(ge),ut=le==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",ya=J%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),Vf=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{gt({},$),j?.($);},sx:{p:P==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?styles.alpha(o.palette.primary.main,.38):Vf,background:Me?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${ya}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:Me?`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:Me?o.palette.primary.main:J%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:Me,onClick:Lo=>Lo.stopPropagation(),onChange:()=>gt({},$),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ve?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Fg(ve,$)}):null,He.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:He.map(Lo=>jsxRuntime.jsx(material.Chip,{label:`${Lo.label}: ${AS(Lo,$)}`,size:"small",variant:"outlined",sx:pe},`${ge}-${Lo.id}`))}):null]}),M?jsxRuntime.jsx(material.Box,{onClick:Lo=>Lo.stopPropagation(),children:M($)}):null]}),W.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:ut,gap:1},children:W.map(Lo=>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:Lo.label}),DS(Fg(Lo,$))]},`${ge}-${Lo.id}-detail`))}):null,B?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:Lo=>Lo.stopPropagation(),children:B($)})]}):null]})},ge)};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:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(bg,{...u,onVariantLoad:$=>{Ct($),u.onVariantLoad?.($);},appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:xo}],currentLayoutId:bt,layoutRefs:[{tableKey:p,layoutId:bt}],variantService:u.variantService,serviceUrl:R??u.serviceUrl,touchMode:le==="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":ro?{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(ji,{filterText:te,setFilterText:me,onRowsPerPageChange:Be,rowsPerPage:Re,rowsPerPageOptions:h,page:_,count:rt,onPageChange:Q,actions:d,extraTools:se,grouping:ye,setGroupAnchorEl:$e,showSummary:Ce,setShowSummary:ae,setAnchorEl:_e,setSummaryAnchorEl:fe,handleExport:U,showCreateButton:Ue,onOpenCreateDialog:Zo,showEditButton:Rt,onOpenEditDialog:jr,editDisabled:ke.length!==1,showDeleteButton:yt,onOpenDeleteConfirm:Xr,deleteDisabled:ke.length===0,onLayoutSave:C||u?.variantService&&u?.appId?It:void 0,loading:m,layoutManager:L,onOpenGraphReport:z?na: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:[Ne.length===0&&!m?A||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,Ne.map(($,ge)=>{if($.type==="group"){let ut=de.has($.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:()=>ft($.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:[ut?jsxRuntime.jsx(kS__default.default,{}):jsxRuntime.jsx(SS__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[$.field,": ",$.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[$.count," records"]})]}),ye.length>1&&$.level<ye.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:ya=>{ya.stopPropagation(),xe($.id);},sx:Pe}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:ya=>{ya.stopPropagation(),Ke($.id);},sx:Pe})]}):null]})},$.id)}let J=$.data||$,Me=$.id||J[ce]||ge;return kt(J,Me,ge)}),Ce?jsxRuntime.jsx(BS,{summaryRow:Z,visibleColumns:we,columns:G}):null,m?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),Ue?jsxRuntime.jsxs(material.Dialog,{open:_o,onClose:()=>!jo&&Fo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:y?.title||t("quickCreate.createWithTitle",{title:O})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Co.map($=>{let ge=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:$.label||$.id,value:q[$.id]??"",onChange:J=>qr($.id,J.target.value),type:ge,fullWidth:true,InputLabelProps:{shrink:ge==="date"?true:void 0}},`quick-create-${$.id}`)}),y?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:y.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Fo(false),disabled:jo,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:_r,variant:"contained",disabled:jo,children:y?.submitLabel||t("common.save")})]})]}):null,Rt?jsxRuntime.jsxs(material.Dialog,{open:ue,onClose:()=>!We&&Ee(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:T?.title||t("quickEdit.editWithTitle",{title:O})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[$t.map($=>{let ge=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:$.label||$.id,value:he[$.id]??"",onChange:J=>Eo($.id,J.target.value),type:ge,disabled:!ba($.id),fullWidth:true,InputLabelProps:{shrink:ge==="date"?true:void 0}},`quick-edit-${$.id}`)}),T?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:T.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ee(false),disabled:We,children:T?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Zr,variant:"contained",disabled:We||!Fe,children:T?.submitLabel||t("common.save")})]})]}):null,yt?jsxRuntime.jsx(Zn,{open:nt,type:"warning",title:F?.title||t("quickDelete.confirmTitle"),message:F?.message||(ke.length>1?t("quickDelete.confirmMessageMultiple",{count:ke.length}):t("quickDelete.confirmMessageSingle")),confirmText:F?.confirmText||t("common.delete"),cancelText:F?.cancelText||t("common.cancel"),onClose:()=>!lt&&Mt(false),onConfirm:br}):null,ie,z?jsxRuntime.jsx(hl,{open:Pt,onClose:ao,model:x,aiAssistant:b?.aiAssistant,interaction:N?{enabled:true,filters:V.filters,fieldMapping:_a,onPrimaryDimensionClick:$=>V.setFilter("primaryDimension",$),onSecondaryDimensionClick:$=>V.setFilter("secondaryDimension",$),onStatusClick:$=>V.setFilter("status",$),onClearFilter:V.clearFilter,onClearAll:V.clearAll}:void 0,tableContent:jsxRuntime.jsx(FS,{appId:oo||"graph-report-internal",title:t("graph.dataBody"),columns:E,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var iz=({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:m,user:h,onSearch:C,onSearchAdd:u,defaultNavigationOpen:v,navOpen:p,onNavOpenChange:b,onWorkloadSelect:y,locale:T="en",localeLabel:F,localeOptions:R,onLocaleChange:S,onUserSetting:I,onUserLogout:k,userMenuItems:w,leftHeaderSlot:A,rightHeaderSlot:P})=>{let M="orbcafe:page-layout-mode",[B,j]=Kt.useState("system"),[O,K]=Kt.useState("light"),[ee,le]=Kt.useState(false),[G,te]=Kt.useState(false),me=B==="system"?G?O:"light":B;Kt.useEffect(()=>{le(true);},[]),Kt.useEffect(()=>{try{let at=window.localStorage.getItem(M);(at==="light"||at==="dark"||at==="system")&&j(at);}catch{}te(true);let _e=window.matchMedia("(prefers-color-scheme: dark)"),dt=()=>{K(_e.matches?"dark":"light");};return dt(),_e.addEventListener("change",dt),()=>_e.removeEventListener("change",dt)},[]),Kt.useEffect(()=>{if(G)try{window.localStorage.setItem(M,B);}catch{}},[G,B]),Kt.useEffect(()=>{me==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[me]);let we=Kt.useMemo(()=>styles.createTheme({palette:me==="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:me==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[me]),Ce=material.useMediaQuery("(orientation: portrait)"),ae=material.useMediaQuery(we.breakpoints.down("md")),oe=c==="auto"?!ee||Ce||ae?"portrait":"landscape":c,[ye,Ge]=Kt.useState({landscape:v??true,portrait:false}),de=ye[oe],Te=p??de,$e=_e=>{p===void 0&&Ge(dt=>({...dt,[oe]:_e})),b?.(_e);},ct=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!ee||n&&oe==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>$e(!Te),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(CS__default.default,{})}):null,A]}),fe=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,P]}),Le=jsxRuntime.jsx(Tg,{collapsed:oe==="landscape"?!Te:false,onToggle:()=>$e(!Te),menuData:o,orientation:oe,colorMode:me,maxHeight:oe==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:we,children:jsxRuntime.jsx(qi,{locale:T,children:jsxRuntime.jsxs(material.Box,{sx:[_e=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:_e.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":_e.palette.background.default}),...Array.isArray(m)?m:[m]],children:[jsxRuntime.jsx(ql,{appTitle:e,logo:d===void 0?null:d,mode:B,onToggleMode:()=>j(_e=>_e==="system"?"dark":_e==="dark"?"light":"system"),locale:T,localeLabel:F,localeOptions:R,onLocaleChange:S,user:h,onUserSetting:I,onUserLogout:k,userMenuItems:w,onSearch:C,onSearchAdd:u,leftSlot:ct,rightSlot:fe}),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:[ee&&n&&oe==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Le}):null,!ee||n&&oe==="portrait"?jsxRuntime.jsx(material.Drawer,{open:Te,onClose:()=>$e(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Le}):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(vg,{items:a,selectedId:r,orientation:oe,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:oe==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:we.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),oe==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var Og=QS__default.default(()=>Promise.resolve().then(()=>(Vg(),Ng)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Cd({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(Og,{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(Og,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var gz=Cd;var Wg=Kt.createContext(null);function iw(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 lw({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]=Kt.useState(false),[m,h]=Kt.useState(false),C=Kt.useRef(null),u=Kt.useRef(false),v=Kt.useRef(false),p=Kt.useCallback(()=>{v.current=false,f(false);},[]),{isRecording:b,startRecording:y,stopRecording:T}=xn({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:I=>{o?.(I);},onComplete:async I=>{try{I.trim()&&(h(!0),await t(I.trim()));}catch(k){let w=k instanceof Error?k.message:"Failed to process voice command";a?.(w);}finally{h(!1),p();}},onError:I=>{a?.(I),h(!1),u.current||p();}}),F=Kt.useCallback(async()=>{v.current=false,await y();},[y]),R=Kt.useCallback(()=>{T();},[T]);Kt.useEffect(()=>{if(n)return;let I=w=>{w.isComposing||(w.code==="Space"||w.key===" ")&&(u.current||w.repeat||i&&iw(document.activeElement)||(u.current=true,w.preventDefault(),C.current=setTimeout(()=>{v.current=true,f(true),y();},r)));},k=w=>{(w.code==="Space"||w.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),u.current=false,v.current&&(w.preventDefault(),f(false),T()));};return window.addEventListener("keydown",I),window.addEventListener("keyup",k),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",k),C.current&&(clearTimeout(C.current),C.current=null);}},[n,i,r,y,T]);let S=Kt.useMemo(()=>({isRecording:b,isHotkeyRecording:g,isSubmitting:m,startRecording:F,stopRecording:R}),[g,b,m,F,R]);return jsxRuntime.jsxs(Wg.Provider,{value:S,children:[c?jsxRuntime.jsx(Cd,{isRecording:g}):null,e]})}function sw(){let e=Kt.useContext(Wg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var vz=lw,Cz=sw;function Xe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var fw=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=Kt.useState(a),i=Kt.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})]})},$g=fw;var Sw=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=Kt.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: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})})]})},Ug=Sw;var Pw=({content:e,isLoading:t,className:o="",style:a})=>{let r=Kt.useRef(null),[n,i]=Kt.useState(false),[c,d]=Kt.useState(null),{theme:l}=nextThemes.useTheme();return Kt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{qg__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await qg__default.default.render(f,m);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})},jg=Pw;var Fw=({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]=Kt.useState(false),[f,m]=Kt.useState(false),h=async()=>{if(c){m(true);try{await c();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{m(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})})]})},ys=Fw;var Ow=({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"}}},m=()=>{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||m()}),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((C,u)=>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:C})]},u))})]}),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=Ow;var Gw=({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]=Kt.useState(false),[f,m]=Kt.useState(""),[h,C]=Kt.useState(false),u=Kt.useMemo(()=>f.trim()?o.filter(b=>b.toLowerCase().includes(f.toLowerCase())):o,[o,f]),v=Kt.useMemo(()=>s?u:u.slice(0,r),[u,s,r]),p=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}`,...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:()=>C(!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=>m(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:v.map((b,y)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>p(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"})]})},y))}),u.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 (${u.length})`}),u.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"})]})]})},vs=Gw;var Xw=({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="",...m})=>{let[h,C]=Kt.useState(false),[u,v]=Kt.useState(true),p=()=>{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"})}},y=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",T=p(),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}`,...m,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 ${T.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:F}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${T.badgeBg} ${T.badgeText}`,children:T.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"}),y(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:()=>C(!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(!u),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:[u?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"]}),u&&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"})})]})]})},Cs=Xw;var Qw=({data:e})=>{if(!e)return null;let t=Kt.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(rr,{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]})})},ks=Qw;var l1=({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(ai,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(Eu,{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(sl,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(Lu,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Nu,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(Ou,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(Wu,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(Uu,{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(ju,{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)})]})})]})]})},Ss=l1;var c1=({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)})})})]}),Ts=c1;var Is=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 f1=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Kt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(f,m,h,C,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:m,title:h,payload:C,rawData:u});},s=(f,m,h,C,u,v)=>{if(!(!u&&!c?.onCardEvent))return (...p)=>{let b=u?.(...p),y=v?v(...p):void 0;return l(f,m,h,y,C),b}},g=Kt.useMemo(()=>({div(f){let{"data-component":m,"data-think-content":h,...C}=f;return m==="thinkbox"&&h?jsxRuntime.jsx($g,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...C})},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:m}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:m}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:m,children:h,...C}){let u=/language-([\w-]+)/.exec(m||""),v=u?u[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",...C,children:h});let p=String(h).replace(/\n$/,"");if(n&&v==="mermaid")return jsxRuntime.jsx(jg,{content:p});if(v==="json"){let b=Is(p);if(b)switch(b.type){case "table":return jsxRuntime.jsx(ks,{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(Ss,{...b});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Ts,{...b});case "error-card":{let y=b;return jsxRuntime.jsx(ys,{...y,onClose:s("error-card","close",y.title,y,y.onClose),onRetry:s("error-card","retry",y.title,y,y.onRetry)})}case "warning-card":{let y=b,T=y.onConfirm?s("warning-card","confirm",y.title,y,y.onConfirm):y.actionText&&c?.onCardEvent?s("warning-card","confirm",y.title,y):void 0;return jsxRuntime.jsx(xs,{...y,onClose:s("warning-card","close",y.title,y,y.onClose),onConfirm:T})}case "suggestions-card":{let y=b;return jsxRuntime.jsx(vs,{...y,onClose:s("suggestions-card","close",y.title,y,y.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",y.title,y,y.onSuggestionClick,T=>({suggestion:T}))})}case "tool-result-card":{let y=b;return jsxRuntime.jsx(Cs,{...y,onClose:s("tool-result-card","close",y.title,y,y.onClose),onAction:s("tool-result-card","action",y.title,y,y.onAction)})}}}return r?jsxRuntime.jsx(Ug,{content:p,language:v,className:"not-prose"}):jsxRuntime.jsx("code",{className:m,...C,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(d1__default.default,{remarkPlugins:[u1__default.default,p1__default.default],rehypePlugins:[m1__default.default,g1__default.default],components:g,children:d})})},Ps=f1;var h1=({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 m=s?.(...f),h=g?g(...f):void 0;return a(i,c,d,h,l),m}},n=Is(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(ks,{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(Ss,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Ts,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(ys,{...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(vs,{...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(Cs,{...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(Ps,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},rf=h1;var Md=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"}}},y1=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=Kt__namespace.default.useMemo(()=>Md.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(rf,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(Ps,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},nf=y1;var x1=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=Kt.useState(t?0:e.length),[s,g]=Kt.useState(!t);Kt.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),Kt.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{l(v=>Math.min(v+n,e.length));},r);return ()=>{window.clearTimeout(u);}},[e.length,s,t,o,n,r,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},m=t?e.slice(0,d):e,h=t&&!s,C=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(nf,{content:m,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"}})]}),C&&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"})]})},df=x1;var uf=({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 Rs=({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(df,{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(uf,{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 mf=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=xn({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: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(I1__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(T1__default.default,{sx:{fontSize:24}})})};var qt={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")},E1={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},L1=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Xe(qt.buttonBase,qt.buttonSmall,qt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(oC__default.default,{sx:{fontSize:24}})}),z1=()=>jsxRuntime.jsxs("button",{className:Xe(qt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",qt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(F1__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),N1=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:Xe(qt.buttonBase,qt.buttonSmall,qt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Xe(qt.buttonBase,qt.buttonSmall,e?qt.sendButton:qt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(A1__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),gf=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=Kt.useState(""),[c,d]=Kt.useState([]),[l,s]=Kt.useState(false),[g,f]=Kt.useState(false),m=Kt.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),C=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},v=Kt.useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),p=Kt.useCallback(B=>{if(B.target.files&&B.target.files.length>0){let j=Array.from(B.target.files);d(O=>{let K=j.filter(le=>O.some(G=>G.name===le.name&&G.size===le.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(le=>le.name));let ee=j.filter(le=>!O.some(G=>G.name===le.name&&G.size===le.size));return [...O,...ee]}),m.current&&(m.current.value="");}},[]),b=Kt.useCallback(B=>{d(j=>j.filter((O,K)=>K!==B));},[]),y=Kt.useCallback(()=>{m.current?.click();},[]),T=Kt.useCallback(async()=>{if(!C)return;let B=n,j=[...c];i(""),d([]),m.current&&(m.current.value="");try{await e(B,j);}catch(O){console.error("Failed to send message:",O),i(B),d(j);}},[n,C,e,c]),F=Kt.useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!l&&(B.preventDefault(),T());},[T,l]),R=Kt.useCallback(()=>{s(true);},[]),S=Kt.useCallback(()=>{s(false);},[]),I=Kt.useCallback(B=>{i(B);},[]),k=Kt.useCallback(B=>{i(B);},[]),w=Kt.useCallback(()=>{},[]),A=Kt.useCallback(B=>{B.preventDefault(),f(true);},[]),P=Kt.useCallback(B=>{B.preventDefault(),f(false);},[]),M=Kt.useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let j=Array.from(B.dataTransfer.files);d(O=>[...O,...j]);}},[]);return jsxRuntime.jsx("div",{className:qt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:p}),jsxRuntime.jsxs("div",{className:Xe(qt.inputContainer,g&&qt.dragActive),style:{borderRadius:"32px"},onDragOver:A,onDragLeave:P,onDrop:M,children:[c.length>0&&jsxRuntime.jsx("div",{className:qt.filePreviewArea,children:c.map((B,j)=>jsxRuntime.jsxs("div",{className:qt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsxRuntime.jsx("button",{onClick:()=>b(j),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${B.name}-${j}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Xe(qt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Xe(qt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:v,onKeyDown:F,onCompositionStart:R,onCompositionEnd:S,style:E1,"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(L1,{enabled:u.enabled,onClick:y}),jsxRuntime.jsx(z1,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(mf,{onTextUpdate:I,onComplete:k,onCancel:w,disabled:o,className:qt.buttonSmall}),jsxRuntime.jsx(N1,{canSend:C,isResponding:o,onSend:T,onStop:t})]})]})]})]})]})})};var bf=({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=Kt.useRef(null),m=Kt.useRef(e.length);return Kt.useEffect(()=>{e.length>m.current&&f.current?.scrollIntoView({behavior:"smooth"}),m.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,C)=>{let u=h.type==="assistant"&&C===e.length-1,v=h.type==="assistant"?{isLatestAssistant:u,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(Rs,{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(gf,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var Ko={};var H1={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},qV=({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",Ko.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:Ko.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Ko.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.top)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.right)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.bottom)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.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:Ko.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:H1[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(bf,{...i,showInput:n})})]})]})};var K1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},e4=({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:m,onMessageStreamingComplete:h,cardHooks:C})=>{let[u,v]=Kt.useState(""),[p,b]=Kt.useState(false),y=Kt.useRef(null),T=K1[c];Kt.useEffect(()=>{y.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let F=Kt.useCallback(async()=>{let S=u.trim();!S||a||(v(""),await t(S));},[a,t,u]),R=Kt.useCallback(async S=>{S.key==="Enter"&&!p&&(S.preventDefault(),await F());},[F,p]);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",T==="top-left"&&"-left-2 -top-2",T==="top-right"&&"-right-2 -top-2",T==="bottom-left"&&"-bottom-2 -left-2",T==="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]",T==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",T==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",T==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",T==="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((S,I)=>{let k=S.type==="assistant"&&I===e.length-1,w=S.type==="assistant"?{isLatestAssistant:k,onRegenerate:o?()=>o(S.id):void 0}:void 0;return jsxRuntime.jsx(Rs,{message:S,assistantActions:w,onStreamingComplete:()=>h?.(S.id),streamIntervalMs:f,streamChunkSize:m,cardHooks:C},S.id)}),jsxRuntime.jsx("div",{ref:y})]}),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:u,onChange:S=>v(S.target.value),onCompositionStart:()=>b(true),onCompositionEnd:()=>b(false),onKeyDown:R,"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 q1=["#ff3860","#24e070","#3090ff"],_1=`
|
|
189
|
+
`),f={enableMath:r},m=0;for(;m<g.length;){let b=g[m],y=b.trim();if(!y){m+=1;continue}if(n&&nm(b)){if(y.startsWith("<think>")){let p=[],h=b;for(;;){let v=h.indexOf("<think>"),w=v>=0?h.slice(v+7):h,E=w.indexOf("</think>");if(E>=0){p.push(w.slice(0,E)),m+=1;break}if(p.push(w),m+=1,m>=g.length)break;h=g[m];}s.push(jsxRuntime.jsx(Gl,{content:p.join(`
|
|
190
|
+
`).trim()},`think-tag-${m}`));continue}m+=1;let C=[];for(;m<g.length&&g[m].trim()!==":::";)C.push(g[m]),m+=1;m<g.length&&g[m].trim()===":::"&&(m+=1),s.push(jsxRuntime.jsx(Gl,{content:C.join(`
|
|
191
|
+
`).trim()},`think-fence-${m}`));continue}if(Ul(b)){let C=y.slice(3).trim().toLowerCase(),p=[];for(m+=1;m<g.length&&!Ul(g[m]);)p.push(g[m]),m+=1;m<g.length&&Ul(g[m])&&(m+=1);let h=p.join(`
|
|
192
|
+
`);if(a&&C==="mermaid"){s.push(jsxRuntime.jsx(Wc,{code:h},`mermaid-${m}`));continue}if(r&&["math","latex","katex"].includes(C)){s.push(jsxRuntime.jsx(Si,{expression:h,allowKatex:true},`math-fence-${m}`));continue}s.push(jsxRuntime.jsx(ki,{code:h,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${m}`));continue}if(r&&y.startsWith("$$")){let C=[];if(y.endsWith("$$")&&y!=="$$")C.push(y.slice(2,-2)),m+=1;else {let h=b.slice(b.indexOf("$$")+2);for(h.trim()&&C.push(h),m+=1;m<g.length;){let v=g[m],w=v.indexOf("$$");if(w>=0){C.push(v.slice(0,w)),m+=1;break}C.push(v),m+=1;}}s.push(jsxRuntime.jsx(Si,{expression:C.join(`
|
|
193
|
+
`).trim(),allowKatex:true},`math-${m}`));continue}if(om(b)){let C=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),p=b.replace(/^#{1,6}\s+/,""),h=C===1?"h5":C===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:h,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Ii(p,f,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(rm(b)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(am(g,m)){let C=m+2;for(;C<g.length&&g[C].trim()&&g[C].includes("|");)C+=1;let p=g.slice(m,C).join(`
|
|
194
|
+
`),h=Wl(p);if(h){s.push(jsxRuntime.jsx(Gc,{table:h},`table-${m}`)),m=C;continue}}if(jc(b)){let C=[];for(;m<g.length&&jc(g[m]);)C.push(g[m].replace(/^\s*>\s?/,"")),m+=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:C.map((p,h)=>jsxRuntime.jsxs(Kt.Fragment,{children:[h>0&&jsxRuntime.jsx("br",{}),Ii(p,f,`q-${m}-${h}`)]},`quote-line-${h}`))})},`quote-${m}`));continue}if(_c(b)){let C=[];for(;m<g.length&&_c(g[m]);)C.push(g[m].trim().replace(/^[-*+]\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((p,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Ii(p,f,`ul-${m}-${h}`)})},`ul-item-${h}`))},`ul-${m}`));continue}if(qc(b)){let C=[];for(;m<g.length&&qc(g[m]);)C.push(g[m].trim().replace(/^\d+\.\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((p,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Ii(p,f,`ol-${m}-${h}`)})},`ol-item-${h}`))},`ol-${m}`));continue}let u=[];for(;m<g.length;){let C=g[m],p=C.trim();if(!p||Ul(C)||om(C)||rm(C)||_c(C)||qc(C)||jc(C)||am(g,m)||n&&nm(C)||r&&p.startsWith("$$"))break;u.push(C),m+=1;}u.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((C,p)=>jsxRuntime.jsxs(Kt.Fragment,{children:[p>0&&jsxRuntime.jsx("br",{}),Ii(C,f,`p-${m}-${p}`)]},`p-line-${p}`))},`p-${m}`)):m+=1;}return s},[d,r,a,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var $B=(e,t)=>jsxRuntime.jsx(Pi,{markdown:e,...t});var sm=({value:e,onChange:t,onSubmit:o,onVoiceInput:r,onClear:a,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(xu__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&&a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(ab__default.default,{sx:{fontSize:d?16:18}})}),r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(Yy__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(Jy__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var cm=(e,t)=>{let o=t.trim();if(!o)return e;let r=e.toLowerCase(),a=o.toLowerCase(),n=r.indexOf(a);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)]})},Kl=({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(r=>{let a=typeof r.value=="string"||typeof r.value=="number"?String(r.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:cm(r.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?cm(a,t):r.value})]},r.id)})})]})};var Jc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",ql=e=>e.trim().toLowerCase(),Rv=(e,t)=>{let o=[];return e.forEach(r=>{r.fields.forEach(a=>{let n=a.searchableText||Jc(a.value),i={source:"section",sourceId:r.id,sourceSectionId:r.id,sourceTitle:r.title,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ql(`${r.title} ${a.label} ${n}`)});});}),t.forEach(r=>{(r.fields||[]).forEach(a=>{let n=a.searchableText||Jc(a.value),i={source:"tab",sourceId:r.id,sourceTitle:r.label,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ql(`${r.label} ${a.label} ${n}`)});}),(r.sections||[]).forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||Jc(n.value),c={source:"tab",sourceId:r.id,sourceSectionId:a.id,sourceTitle:`${r.label} / ${a.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:ql(`${r.label} ${a.title} ${n.label} ${i}`)});});});}),o},dm=({sections:e,tabs:t=[],defaultTabId:o,ai:r})=>{let{t:a}=oe(),[n,i]=Kt.useState(""),[c,d]=Kt.useState(o||t[0]?.id),[l,s]=Kt.useState("idle"),[g,f]=Kt.useState([]),[m,b]=Kt.useState(""),[y,u]=Kt.useState(""),[C,p]=Kt.useState(false),h=Kt.useMemo(()=>Rv(e,t),[e,t]);Kt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(I=>I.id===c)||d(o||t[0]?.id);},[t,c,o]);let v=Kt.useCallback(()=>{s("idle"),f([]),b(""),u("");},[]),w=Kt.useCallback(T=>{i(T),T.trim()||(s("idle"),f([]),b(""),u(""));},[]),E=Kt.useCallback(T=>{let I=ql(T);return I?h.filter(k=>k.text.includes(I)).map(k=>k.hit):[]},[h]),R=Kt.useCallback(async()=>{let T=n.trim();if(!T)return;p(true);let I=E(T);if(f(I),I.length>0){s("search"),u(""),b(a("detail.searchAi.matches",{count:I.length})),p(false);return}if(r?.enabled!==false&&r?.onSubmit){s("ai"),b(a("detail.searchAi.autoAiFallback"));try{let S=await r.onSubmit(T,{query:T,hits:I,activeTabId:c,sections:e,tabs:t});u(typeof S=="string"?S:"");}finally{p(false);}return}s("search"),u(""),b(a("detail.searchAi.noMatch")),p(false);},[n,E,a,r,c,e,t]);return {query:n,setQuery:w,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:m,aiResponse:y,searching:C,handleSubmit:R,clearResult:v}};var x5=({title:e,subtitle:t,sections:o,tabs:r=[],defaultTabId:a,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=oe(),{query:f,setQuery:m,activeTabId:b,setActiveTabId:y,searchMode:u,hits:C,statusText:p,aiResponse:h,searching:v,handleSubmit:w,clearResult:E}=dm({sections:o,tabs:r,defaultTabId:a,ai:i}),R=Kt.useMemo(()=>r.find(k=>k.id===b)||r[0],[r,b]),T=Kt.useCallback(k=>{let S=D=>{let P=document.getElementById(k);if(P){P.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>S(D+1),60);};requestAnimationFrame(()=>S(0));},[]),I=Kt.useCallback((k,S)=>{if(r.some(D=>D.id===k)){y(k),T(S?`detail-tab-${k}-section-${S}`:`detail-tab-${k}`);return}T(`detail-section-${k}`);},[r,y,T]);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(sm,{value:f,onChange:m,onSubmit:w,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:p,loading:v,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(Fv__default.default,{fontSize:"small"})})}),c]})]}),p&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:p}),u==="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:g("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(k=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>I(k.sourceId,k.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:k.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:k.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:k.fieldValue||"-"})]})},`${k.source}|${k.sourceId}|${k.fieldId}`))})]}),u==="ai"&&h&&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(Pi,{markdown:h})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(k=>jsxRuntime.jsx(material.Box,{id:`detail-section-${k.id}`,children:jsxRuntime.jsx(Kl,{section:k,highlightQuery:f})},k.id))}),r.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(k,S)=>y(S),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:r.map(k=>jsxRuntime.jsx(material.Tab,{value:k.id,label:k.label,sx:{textTransform:"none"}},k.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id||""}`}),R?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(R?.sections||[]).map(k=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${k.id}`,children:jsxRuntime.jsx(Kl,{section:k,highlightQuery:f})},k.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(Kl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(ca,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var gm=({bucket:e,cardCount:t,highlighted:o=false,children:r,emptyLabel:a,maxHeight:n,sx:i})=>{let{t:c}=oe();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?r: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:a??e.emptyLabel??c("kanban.empty")})})})]})})};var Vv={success:"success",warning:"warning",info:"info",error:"error"},Hv={critical:"error",high:"warning",medium:"info",low:"success"},Wv=(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}},$v=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",td=({card:e,bucket:t,dragging:o=false,overlay:r=false,onClick:a,sx:n})=>{let{t:i}=oe(),c=!!(a&&t),d=e.tone??(e.priority?Hv[e.priority]:"default"),l=d==="default"?"primary":Vv[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&a?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&a?.(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:r?`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:r?"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:Wv(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??$v(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 Uv=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,bm=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((r,a)=>{let n=o.get(r.bucketId)??[];n.push({card:r,sourceIndex:a}),o.set(r.bucketId,n);}),{buckets:e.map(r=>{let a=[...o.get(r.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:r.id,position:i}));return {...r,cards:a}})}},mr=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let r=e.buckets[o],a=r.cards.findIndex(n=>n.id===t);if(a>=0)return {card:r.cards[a],bucket:r,bucketIndex:o,cardIndex:a}}},Xl=(e,t)=>{let o=mr(e,t.cardId);if(!o)return e;let r=e.buckets.findIndex(l=>l.id===t.toBucketId);if(r<0)return e;let a=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=a[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=a[r],d=Uv(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:a.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var od="kanban-card|",rd="kanban-bucket|",Cm=e=>`${od}${e}`,rC=e=>`${rd}${e}`,Yl=e=>e?.startsWith(od)?e.slice(od.length):void 0,vm=e=>e?.startsWith(rd)?e.slice(rd.length):void 0,aC=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:r,attributes:a,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:Cm(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:r,style:l,...a,...n,children:jsxRuntime.jsx(td,{card:e,bucket:t,dragging:d,onClick:o})})},nC=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:r,onCardClick:a})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:rC(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(gm,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:r,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>Cm(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(aC,{card:c,bucket:e,onCardClick:a},c.id))})})})})},H5=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:r=320,bucketMaxHeight:a,emptyBucketLabel:n,sx:i})=>{let[c,d]=Kt.useState(null),[l,s]=Kt.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=Kt.useMemo(()=>c?mr(e,c):void 0,[c,e]),m=Kt.useCallback(()=>{d(null),s(void 0);},[]),b=Kt.useCallback(p=>{if(!p)return;let h=Yl(p);return h?mr(e,h)?.bucket.id:vm(p)},[e]),y=Kt.useCallback(p=>{d(Yl(String(p.active.id))??null);},[]),u=Kt.useCallback(p=>{s(b(p.over?String(p.over.id):void 0));},[b]),C=Kt.useCallback(p=>{let h=Yl(String(p.active.id)),v=p.over?String(p.over.id):void 0;if(!h||!v){m();return}let w=mr(e,h);if(!w){m();return}let E=w.bucket.id,R=w.cardIndex,T=Yl(v);if(T){let S=mr(e,T);if(!S){m();return}E=S.bucket.id,R=S.cardIndex;}else {let S=vm(v),D=e.buckets.find(P=>P.id===S);if(!S||!D){m();return}E=S,R=D.cards.length;}if(w.bucket.id===E&&w.cardIndex===R){m();return}let I=Xl(e,{cardId:h,fromBucketId:w.bucket.id,toBucketId:E,targetIndex:R}),k=mr(I,h);k&&!(k.bucket.id===w.bucket.id&&k.cardIndex===w.cardIndex)&&t?.({cardId:h,fromBucketId:w.bucket.id,toBucketId:k.bucket.id,targetIndex:k.cardIndex,card:k.card,model:I}),m();},[e,t,m]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:y,onDragOver:u,onDragEnd:C,onDragCancel:m,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${r}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(p=>jsxRuntime.jsx(nC,{bucket:p,highlighted:p.id===l,bucketMaxHeight:a,emptyBucketLabel:n,onCardClick:o},p.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(r-24,260)},children:jsxRuntime.jsx(td,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var cC=({initialModel:e,initialBuckets:t,initialCards:o})=>e||bm({buckets:t??[],cards:o??[]}),K5=e=>{let{onCardMove:t,onCardClick:o}=e,[r,a]=Kt.useState(()=>cC(e)),n=Kt.useCallback(s=>{a(g=>typeof s=="function"?s(g):s);},[]),i=Kt.useCallback(s=>mr(r,s),[r]),c=Kt.useCallback((s,g,f)=>{let m=mr(r,s);if(!m)return;let b=Xl(r,{cardId:s,fromBucketId:m.bucket.id,toBucketId:g,targetIndex:f}),y=mr(b,s);if(!y||y.bucket.id===m.bucket.id&&y.cardIndex===m.cardIndex)return;a(b);let u={cardId:s,fromBucketId:m.bucket.id,toBucketId:y.bucket.id,targetIndex:y.cardIndex,card:y.card,model:b};return t?.(u),u},[r,t]),d=Kt.useCallback((s,g)=>{a(f=>({buckets:f.buckets.map(m=>({...m,cards:m.cards.map(b=>b.id!==s?b:typeof g=="function"?g(b):{...b,...g})}))}));},[]),l=Kt.useMemo(()=>({model:r,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[r,c,o]);return {model:r,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};function wn({onTextUpdate:e,onComplete:t,onError:o,wsUrl:r="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:n=.015}){let[i,c]=Kt.useState(false),d=Kt.useRef(null),l=Kt.useRef(null),s=Kt.useRef(null),g=Kt.useRef(null),f=Kt.useRef(null),m=Kt.useRef(0),b=Kt.useRef(false),y=Kt.useRef(false),u=Kt.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(h=>h.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),y.current=false,c(false);},[]),C=Kt.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),p=Kt.useCallback(async()=>{if(!(i||y.current)){y.current=true,b.current=false,m.current=Date.now();try{let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=h;let v=new WebSocket(r);d.current=v,v.onopen=()=>{c(!0),y.current=!1;},v.onmessage=I=>{try{let k=JSON.parse(I.data);if(k.type==="recognition")k.is_final?t(k.text):e?.(k.text);else if(k.type==="error"){let S=k.message||"Voice recognition error";o?.(S),C();}}catch{o?.("Failed to parse voice message");}},v.onerror=()=>{o?.("Voice service connection failed"),u();},v.onclose=()=>{u();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let E=new w({sampleRate:16e3});s.current=E;let R=E.createMediaStreamSource(h);f.current=R;let T=E.createScriptProcessor(4096,1,1);g.current=T,T.onaudioprocess=I=>{if(d.current?.readyState!==WebSocket.OPEN)return;let k=I.inputBuffer.getChannelData(0),S=0;for(let M=0;M<k.length;M+=1)S+=k[M]*k[M];if(Math.sqrt(S/k.length)>n)m.current=Date.now();else if(Date.now()-m.current>a&&!b.current){C();return}let P=new Int16Array(k.length);for(let M=0;M<k.length;M+=1){let A=Math.max(-1,Math.min(1,k[M]));P[M]=A<0?A*32768:A*32767;}d.current.send(P.buffer);},R.connect(T),T.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,a,C,r]);return Kt.useEffect(()=>u,[u]),{isRecording:i,startRecording:p,stopRecording:C}}var Pm=64,PC="#E9EDF2",RC="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",MC=["en","zh","fr","de","ja","ko"],Rm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},id=({searchPlaceholder:e,onSearch:t,onSearchAdd:o,maxWidth:r=540,sx:a})=>{let{t:n}=oe(),i=material.useTheme(),c=i.palette.mode==="dark",[d,l]=Kt.useState(""),s=Kt.useCallback((h=d)=>{let v=h.trim();v&&(l(""),t?.(v));},[t,d]),g=h=>{h.preventDefault(),s();},{isRecording:f,startRecording:m,stopRecording:b}=wn({onTextUpdate:l,onComplete:h=>{l(h),s(h);},onError:h=>{console.error("Header voice input error:",h);}}),y=Kt.useCallback(async()=>{if(f){b();return}await m();},[f,m,b]),u=e||n("header.searchPlaceholder"),C=d.trim().length>0,p={width:28,height:28,p:0,color:c?"rgba(255,255,255,0.72)":"rgba(15,23,42,0.56)","&:hover":{bgcolor:c?"rgba(255,255,255,0.1)":"rgba(15,23,42,0.06)"},"&.Mui-disabled":{color:c?"rgba(255,255,255,0.28)":"rgba(15,23,42,0.24)"}};return jsxRuntime.jsx(material.Box,{component:"form",onSubmit:g,sx:[{width:"100%",maxWidth:r},...Array.isArray(a)?a:a?[a]:[]],children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:d,onChange:h=>l(h.target.value),placeholder:u,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",sx:{ml:.25,mr:.5},children:jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:o,"aria-label":n("header.searchAddFeature"),title:n("header.searchAddFeature"),sx:p,children:jsxRuntime.jsx(CC__default.default,{sx:{fontSize:20}})})}),endAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"end",sx:{ml:.5,mr:.25},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.15,children:[jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:()=>{y();},"aria-label":n(f?"header.searchStopVoice":"header.searchStartVoice"),title:n(f?"header.searchStopVoice":"header.searchStartVoice"),sx:{...p,color:f?i.palette.error.main:p.color,bgcolor:f?c?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.1)":"transparent"},children:f?jsxRuntime.jsx(lucideReact.MicOff,{size:17,strokeWidth:2.35}):jsxRuntime.jsx(lucideReact.Mic,{size:17,strokeWidth:2.35})}),jsxRuntime.jsx(material.IconButton,{size:"small",type:"submit",disabled:!C,"aria-label":n("header.searchSend"),title:n("header.searchSend"),sx:{...p,color:C?i.palette.primary.main:p.color},children:jsxRuntime.jsx(lucideReact.SendHorizontal,{size:17,strokeWidth:2.35})})]})}),sx:{color:c?"common.white":"rgba(17,24,39,0.9)",bgcolor:c?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,pr:.5,"& .MuiInputBase-input":{py:1.1},"& .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:c?"white":"#111827"}}})})},ts=({appTitle:e,logo:t,mode:o="dark",onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,showSearch:l=false,onSearch:s,onSearchAdd:g,user:f,onUserSetting:m,onUserLogout:b,userMenuItems:y,leftSlot:u,rightSlot:C})=>{let{t:p,locale:h}=oe(),w=material.useTheme().palette.mode==="dark",[E,R]=Kt.useState(null),[T,I]=Kt.useState(null),k=o==="system"?jsxRuntime.jsx(kC__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(SC__default.default,{fontSize:"small"}):jsxRuntime.jsx(wC__default.default,{fontSize:"small"}),S=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),D=a||h,P=i&&i.length>0?i:MC,M=n||Rm[D]||D.toUpperCase(),A=!!E,j=!!T,z=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(jx__default.default,{sx:{fontSize:18}}),onClick:m},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(IC__default.default,{sx:{fontSize:18}}),onClick:b}],V=y&&y.length>0?y:z,X=Z=>{I(null),Z?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:Z=>({top:0,zIndex:Z.zIndex.drawer+10,height:Pm,backgroundColor:Z.palette.mode==="dark"?"#0D0D0D":PC,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%)",RC,"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:`${Pm}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[u,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:w?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:l&&jsxRuntime.jsx(id,{searchPlaceholder:d,onSearch:s,onSearchAdd:g})}),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=>R(Z.currentTarget),sx:{color:w?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(Im__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:M})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:A,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:P.map(Z=>jsxRuntime.jsx(material.MenuItem,{selected:Z===D,onClick:()=>{c(Z),R(null);},sx:{fontSize:"0.82rem"},children:Rm[Z]},Z))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Im__default.default,{sx:{color:w?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:w?"common.white":"#111827",fontWeight:500},children:M})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:w?"common.white":"#111827"},onClick:r,title:S,children:k}),f&&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:w?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:f.name}),f.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:w?"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:f.subtitle,children:f.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Z=>I(Z.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:f.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:f.avatarText||f.name.slice(0,1).toUpperCase()})})]}),C]})]}),f&&jsxRuntime.jsx(material.Menu,{anchorEl:T,open:j,onClose:()=>I(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:V.map(Z=>jsxRuntime.jsxs(material.MenuItem,{disabled:Z.disabled,onClick:()=>X(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 Dm=({menuData:e=[],initialNavigationCollapsed:t=false,initialNavigationMode:o="fixed"}={})=>{let{navigationIslandProps:r}=uu({initialCollapsed:t,initialDisplayMode:o,content:e}),[a,n]=Kt.useState(900);Kt.useEffect(()=>{let c=()=>n(window.innerHeight);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);let i=Kt.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:r,navigationMaxHeight:i}};var or=12,Em=56,Fm=234,os=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),zC=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,xE=({appTitle:e,menuData:t=[],children:o,showNavigation:r=true,locale:a="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,searchPlaceholder:m,searchPlacement:b="hidden",floatingSearchSx:y,onSearch:u,onSearchAdd:C,rightHeaderSlot:p,leftHeaderSlot:h,contentSx:v,navigationMode:w,defaultNavigationMode:E="fixed",onNavigationModeChange:R,showNavigationModeToggle:T=true})=>{let I="orbcafe:page-layout-mode",k="orbcafe:page-layout-navigation-mode",[S,D]=Kt.useState("system"),[P,M]=Kt.useState("light"),[A,j]=Kt.useState(false),[z,V]=Kt.useState(false),[X,Z]=Kt.useState(E),[H,ee]=Kt.useState({x:or,y:or}),[pe,De]=Kt.useState("left"),[xe,se]=Kt.useState(false),te=Kt.useRef(null),Ie=Kt.useRef(null),Ye=w!==void 0,Ue=w??X,be=Ue==="floating",Ke=b==="header",lt=S==="system"?A?P:"light":S;Kt.useEffect(()=>{try{let je=window.localStorage.getItem(I);(je==="light"||je==="dark"||je==="system")&&D(je);}catch{}j(true);let re=window.matchMedia("(prefers-color-scheme: dark)"),ke=()=>{M(re.matches?"dark":"light");};return ke(),re.addEventListener("change",ke),()=>re.removeEventListener("change",ke)},[]),Kt.useEffect(()=>{if(A)try{window.localStorage.setItem(I,S);}catch{}},[A,S]),Kt.useEffect(()=>{if(Ye){V(true);return}try{let re=window.localStorage.getItem(k);(re==="fixed"||re==="floating")&&Z(re);}catch{}finally{V(true);}},[Ye]),Kt.useEffect(()=>{if(z)try{window.localStorage.setItem(k,Ue);}catch{}},[Ue,z]),Kt.useEffect(()=>{lt==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[lt]);let Ee=Kt.useMemo(()=>material.createTheme({palette:{mode:lt}}),[lt]),Oe=Kt.useCallback(re=>{Ye||Z(re),R?.(re);},[Ye,R]),{navigationIslandProps:qe,navigationMaxHeight:pt}=Dm({menuData:t,initialNavigationCollapsed:false,initialNavigationMode:Ue}),$e=qe.collapsed,q=Kt.useCallback(re=>{let ke=te.current,je=ke?.parentElement;if(!ke||!je)return re;let St=je.getBoundingClientRect(),K=ke.getBoundingClientRect(),Fe=or,ye=or,st=Math.max(Fe,St.width-K.width-or),W=Math.max(ye,St.height-K.height-or);return {x:os(re.x,Fe,st),y:os(re.y,ye,W)}},[]),Le=Kt.useCallback(re=>{let ke=te.current,je=ke?.parentElement;if(!ke||!je)return re;let St=je.getBoundingClientRect(),K=ke.getBoundingClientRect(),Fe=or,ye=or,st=Math.max(Fe,St.width-K.width-or),W=Math.max(ye,St.height-K.height-or),ue={x:os(re.x,Fe,st),y:os(re.y,ye,W)},Qe=[{distance:Math.abs(ue.x-Fe),position:{x:Fe,y:ue.y}},{distance:Math.abs(ue.x-st),position:{x:st,y:ue.y}},{distance:Math.abs(ue.y-ye),position:{x:ue.x,y:ye}},{distance:Math.abs(ue.y-W),position:{x:ue.x,y:W}}].reduce((mt,yt)=>yt.distance<mt.distance?yt:mt).position;return De(Qe.x>=(Fe+st)/2?"right":"left"),Qe},[]),ve=Kt.useMemo(()=>{if(!be||xe)return H.x;if(pe==="right"){let je=te.current?.parentElement?.getBoundingClientRect().width,St=$e?Em:Fm;return je?Math.max(or,je-St-or):$e?H.x:H.x-(Fm-Em)}return H.x},[pe,H.x,xe,be,$e]),Pe=Kt.useCallback(re=>{if(!be||!$e||zC(re.target))return;re.preventDefault(),re.currentTarget.setPointerCapture(re.pointerId);let ke=q({x:ve,y:H.y});De("left"),ee(ke),Ie.current={pointerId:re.pointerId,startClientX:re.clientX,startClientY:re.clientY,startX:ke.x,startY:ke.y,currentX:ke.x,currentY:ke.y},se(true);},[q,ve,H.y,be,$e]),at=Kt.useCallback(re=>{let ke=Ie.current;if(!ke||ke.pointerId!==re.pointerId)return;let je=q({x:ke.startX+re.clientX-ke.startClientX,y:ke.startY+re.clientY-ke.startClientY});ke.currentX=je.x,ke.currentY=je.y,ee(je);},[q]),We=Kt.useCallback(re=>{let ke=Ie.current;if(!(!ke||ke.pointerId!==re.pointerId)){try{re.currentTarget.releasePointerCapture(re.pointerId);}catch{}Ie.current=null,ee(Le({x:ke.currentX,y:ke.currentY})),se(false);}},[Le]);return Kt.useEffect(()=>{if(!be)return;let re=()=>{ee(St=>q(St));},ke=window.requestAnimationFrame(re),je=window.setTimeout(re,430);return ()=>{window.cancelAnimationFrame(ke),window.clearTimeout(je);}},[q,be,$e,pt]),jsxRuntime.jsx(material.ThemeProvider,{theme:Ee,children:jsxRuntime.jsx(tl,{locale:a,children:jsxRuntime.jsxs(material.Box,{sx:re=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:re.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":re.palette.background.default}),children:[jsxRuntime.jsx(ts,{appTitle:e,logo:f,mode:S,onToggleMode:()=>D(re=>re==="system"?"dark":re==="dark"?"light":"system"),locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,searchPlaceholder:m,showSearch:Ke,onSearch:u,onSearchAdd:C,leftSlot:h,rightSlot:p}),b==="floating"&&jsxRuntime.jsx(material.Box,{sx:[re=>({position:"fixed",left:{xs:12,sm:"auto"},right:{xs:12,md:24},bottom:{xs:12,md:24},width:{xs:"auto",sm:540},maxWidth:"calc(100vw - 24px)",zIndex:re.zIndex.modal+30,pointerEvents:"auto",filter:re.palette.mode==="dark"?"drop-shadow(0 18px 42px rgba(0,0,0,0.58))":"drop-shadow(0 18px 36px rgba(15,23,42,0.18))"}),...Array.isArray(y)?y:y?[y]:[]],children:jsxRuntime.jsx(id,{searchPlaceholder:m,onSearch:u,onSearchAdd:C,maxWidth:"100%"})}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[r&&!be&&jsxRuntime.jsx(material.Box,{sx:{pt:1.5,pb:1.5,pl:1.5,pr:$e?.5:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Js,{...qe,maxHeight:pt,colorMode:lt,displayMode:Ue,onDisplayModeChange:Oe,showDisplayModeToggle:T&&$e})}),r&&be&&jsxRuntime.jsx(material.Box,{ref:te,onPointerDown:Pe,onPointerMove:at,onPointerUp:We,onPointerCancel:We,sx:re=>({position:"absolute",top:H.y,left:ve,zIndex:re.zIndex.drawer+5,display:"flex",alignItems:"flex-start",cursor:$e?xe?"grabbing":"grab":"default",touchAction:$e?"none":"auto",userSelect:xe?"none":void 0,transition:xe?"none":"left 180ms ease-out, top 180ms ease-out"}),children:jsxRuntime.jsx(Js,{...qe,maxHeight:pt,colorMode:lt,displayMode:Ue,onDisplayModeChange:Oe,showDisplayModeToggle:T&&$e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",pt:1.5,pb:1.5,pr:1.5,pl:r&&!be&&$e?.5:1.5,...v},children:o})]})]})})})};var rs="(blank)",zm="Result",Nm="Grand Total",Om={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Vm=["sum","count","avg","min","max"];var Hm=["palette","rows","columns","filters","values"];var Wm=e=>Hm.includes(e),$m=e=>e==="rows"||e==="columns"||e==="filters",as=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Wm(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Wm(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Gr=e=>e==null||e===""?rs:e instanceof Date?e.toISOString().slice(0,10):String(e),Va=e=>JSON.stringify(e),Gm=(e,t)=>{let o=e.join(""),r=t.join("");return o.localeCompare(r,void 0,{sensitivity:"base"})},NC=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},Dn=(e,t,o)=>{if(o==="count")return e.length;let r=e.map(a=>NC(a[t])).filter(a=>a!==null);return r.length===0?0:o==="sum"?r.reduce((a,n)=>a+n,0):o==="avg"?r.reduce((a,n)=>a+n,0)/r.length:o==="min"?Math.min(...r):Math.max(...r)},eo=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,r=[];return e.forEach(a=>{!t.has(a)||o.has(a)||(o.add(a),r.push(a));}),r},Ur=(e,t)=>e.length!==t.length?false:e.every((o,r)=>o===t[r]),Um=(e,t)=>{let o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?false:o.every(a=>{let n=e[a]??[],i=t[a]??[];return Ur(n,i)})},ns=(e,t)=>e.length!==t.length?false:e.every((o,r)=>{let a=t[r];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),ld=e=>!e?.aggregations||e.aggregations.length===0?Vm:e.aggregations,So=(e,t)=>{let o=ld(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Ei=(e,t,o)=>{let r=o.get(t.fieldId);return r?.formatValue?r.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var qm=({options:e,selectedValues:t,onChange:o,minWidth:r=96})=>{let{t:a}=oe(),[n,i]=Kt.useState(""),c=Kt.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:r},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?a("pivot.filter.na"):s.length===0?a("common.none"):s.length===e.length?a("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:`${a("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:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:a("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 cd=({label:e,subtitle:t,isDragging:o,dragRef:r,listeners:a,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:r,...a,...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(ZC__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})]})]})}),Xm=({id:e,label:t,subtitle:o})=>{let{setNodeRef:r,listeners:a,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(cd,{label:t,subtitle:o,isDragging:i,dragRef:r,listeners:a,attributes:n})};var En=({zone:e,title:t,hint:o,icon:r,children:a,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=oe();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:[r,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(ek__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:a})]})};var Qm={xs:1.2,md:1.6},Ln=({title:e,subtitle:t,collapsed:o,onToggleCollapse:r,expandAriaLabel:a,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:Qm,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?a:n,onClick:r,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(Zx__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:Qm,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ds=({label:e,caption:t,onRemove:o,trailing:r,isDragging:a,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:a?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(ZC__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})]}),r,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(ab__default.default,{sx:{fontSize:16}})})]})}),Fi=({id:e,label:t,caption:o,onRemove:r,trailing:a})=>{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(ds,{label:t,caption:o,onRemove:r,trailing:a,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var ms={rows:jsxRuntime.jsx(gk__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(xb__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(mk__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Sb__default.default,{fontSize:"small"})},tg=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:r,filterFields:a,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:m})=>{let{t:b}=oe(),y=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(Ln,{title:b("pivot.config.title"),subtitle:y,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(En,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(ZC__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:b("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(Xm,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(En,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:ms.filters,itemCount:a.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:a.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:a.map(u=>jsxRuntime.jsx(Fi,{id:`item|filters|${u}`,label:r.get(u)?.label??u,caption:s(u),trailing:g(u),onRemove:()=>l("filters",u)},u))})})}),jsxRuntime.jsx(En,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:ms.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(Fi,{id:`item|columns|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(En,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:ms.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(Fi,{id:`item|rows|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("rows",u)},u))})})}),jsxRuntime.jsx(En,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:ms.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let C=r.get(u.fieldId)?.label??u.fieldId,p=`${m(u.aggregation)}(${C})`;return jsxRuntime.jsx(Fi,{id:`item|values|${u.tokenId}`,label:C,caption:p,trailing:f(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var og=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),rg=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:r,formatSecondaryValue:a})=>{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(u=>u.primaryValue):e.map((u,C)=>C+1),s=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),m=i-d.left-d.right,b=c-d.top-d.bottom,y=e.map((u,C)=>{let p=o?u.primaryValue:C+1,h=o?u.secondaryValue??0:u.primaryValue,v=d.left+p/g*m,w=c-d.bottom-h/f*b;return {...u,x:v,y:w,rawX:p,rawY:h}});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)}),y.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
|
|
195
|
+
`,o?`${t}: ${r(u.primaryValue)}`:`${t}: ${r(u.primaryValue)}`,o?`
|
|
196
|
+
${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.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:og(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:og(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(u=>jsxRuntime.jsxs(material.Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(C.palette.divider,.7)}`,bgcolor:styles.alpha(C.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",r(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(a??r)(u.secondaryValue??0)]})]},u.name))})]})};var fd=e=>Math.max(...e,1),ng=({data:e,chartType:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,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 p=fd(e.flatMap(h=>[h.primaryValue,h.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(h=>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:h.name,children:h.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:`${h.primaryValue/p*100}%`,height:"100%",bgcolor:c}})}),r&&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:`${(h.secondaryValue??0)/p*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:a(h.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??a)(h.secondaryValue??0)})]})]},h.name))})}if(t==="bar-vertical"){let p=fd(e.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),h=r?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*h),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(v=>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:r?16:26,minHeight:8,height:`${Math.max(v.primaryValue/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${a(v.primaryValue)}`}),r&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((v.secondaryValue??0)/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${r}: ${(n??a)(v.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:v.name,children:v.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:a(v.primaryValue),children:a(v.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??a)(v.secondaryValue??0),children:(n??a)(v.secondaryValue??0)})]},v.name))})})}let l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=fd(e.flatMap(p=>[p.primaryValue,p.secondaryValue??0])),m=l-g.left-g.right,b=s-g.top-g.bottom,y=p=>e.map((h,v)=>{let w=g.left+v*m/Math.max(e.length-1,1),E=s-g.bottom-p(h)/f*b;return {x:w,y:E,item:h}}),u=y(p=>p.primaryValue),C=r?y(p=>p.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:u.map(p=>`${p.x},${p.y}`).join(" ")}),u.map(p=>jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[p.item.name,`
|
|
197
|
+
`,o,": ",a(p.item.primaryValue)]})},`primary-${p.item.name}`)),r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(p=>`${p.x},${p.y}`).join(" ")}),C.map(p=>jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[p.item.name,`
|
|
198
|
+
`,r,": ",(n??a)(p.item.secondaryValue??0)]})},`secondary-${p.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(p=>jsxRuntime.jsxs(material.Box,{sx:h=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(h.palette.divider,.7)}`,bgcolor:styles.alpha(h.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:a(p.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??a)(p.secondaryValue??0)})]},p.name))})]})};var ig=(e,t,o)=>{let r=new Set,a=[];return e.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),a},lg=(e,t,o)=>e.map(r=>{let a=t.get(r.fieldId),n=a?.label??r.fieldId;return {fieldId:r.fieldId,label:`${o(r.aggregation)} \xB7 ${n}`,item:r,field:a}}),sg=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:r})=>{if(!t)return [];let a=new Map;return e.forEach(n=>{let i=Gr(n[t]),c=a.get(i);if(c){c.push(n);return}a.set(i,[n]);}),Array.from(a.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:Dn(i,o.fieldId,o.aggregation),secondaryValue:r?Dn(i,r.fieldId,r.aggregation):void 0}))};var cg=({rows:e,fieldMap:t,rowFields:o,columnFields:r,valueFields:a,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:m,onToggleCollapse:b,getAggregationLabel:y})=>{let{t:u}=oe(),C=Kt.useMemo(()=>ig(o,r,t),[r,t,o]),p=Kt.useMemo(()=>lg(a,t,y),[t,y,a]),h=p.find(S=>S.fieldId===i)??p[0],v=p.find(S=>S.fieldId===c&&S.fieldId!==h?.fieldId)??null,w=C.find(S=>S.fieldId===n)??C[0],E=w&&h?u("pivot.chart.subtitleReady",{dimension:w.label,measure:v?`${h.label} / ${v.label}`:h.label}):u("pivot.chart.subtitle"),R=Kt.useMemo(()=>!w||!h?[]:sg({rows:e,dimensionFieldId:w.fieldId,primaryValue:h.item,secondaryValue:v?.item}),[h,e,v,w]),T=S=>h?Ei(S,h.item,t):S.toLocaleString(),I=S=>v?Ei(S,v.item,t):S.toLocaleString(),k=C.length>1||p.length>1;return jsxRuntime.jsxs(Ln,{title:u("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[k&&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:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:w?.fieldId??"",onChange:S=>s(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.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:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:h?.fieldId??"",onChange:S=>g(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:p.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.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:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:v?.fieldId??"",onChange:S=>f(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),p.filter(S=>S.fieldId!==h?.fieldId).map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.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:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:S=>m(S.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:w?h?R.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(rg,{data:R,primaryLabel:h.label,secondaryLabel:v?.label,formatPrimaryValue:T,formatSecondaryValue:I}):jsxRuntime.jsx(ng,{data:R,chartType:d,primaryLabel:h.label,secondaryLabel:v?.label,formatPrimaryValue:T,formatSecondaryValue:I}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("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:u("pivot.chart.emptyNoDimension")})})})]})};var hs=({node:e,dataColumns:t,fieldMap:o,level:r,expandedKeys:a,onToggle:n,getValue:i})=>{let c=a.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:r*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(Xb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Xf__default.default,{sx:{fontSize:16}})}),!d&&!l&&r>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:Ei(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(hs,{node:s,dataColumns:t,fieldMap:o,level:r+1,expandedKeys:a,onToggle:n,getValue:i},s.key))]})};var vd=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},xs=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Cd=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",hg=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children.length>0&&(t.add(a.key),o(a.children));});};return o(e),t},yg=(e,t,o=0)=>e.length===0?o:e.reduce((r,a)=>a.children.length===0||!t.has(a.key)?Math.max(r,o+1):Math.max(r,yg(a.children,t,o+1)),o),Xk=(e,t)=>{let o=[],r=a=>{a.forEach(n=>{if(n.children.length>0&&t.has(n.key)){r(n.children);return}o.push(n);});};return r(e),o},lL=({title:e,rows:t,fields:o,initialLayout:r,initialChart:a,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:m,initialPresetId:b,onPresetApplied:y})=>{let{t:u}=oe(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),p=Kt.useRef(0),h=Kt.useRef(false),v=e??u("pivot.title.default"),w=n??u("pivot.empty"),E=Kt.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),R=Kt.useCallback(x=>E[x]??Om[x],[E]),T=Kt.useMemo(()=>new Set(o.map(x=>x.id)),[o]),I=Kt.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[k,S]=Kt.useState(()=>eo(r?.rows,T)),[D,P]=Kt.useState(()=>eo(r?.columns,T)),[M,A]=Kt.useState(()=>eo(r?.filters,T)),[j,z]=Kt.useState(()=>{let x=r?.values??[],F=new Set,L=[];return x.forEach(Y=>{if(!T.has(Y.fieldId)||F.has(Y.fieldId))return;F.add(Y.fieldId),p.current+=1;let he=I.get(Y.fieldId);L.push({tokenId:`v${p.current}`,fieldId:Y.fieldId,aggregation:So(Y.aggregation,he)});}),L}),[V,X]=Kt.useState({}),[Z,H]=Kt.useState(true),[ee,pe]=Kt.useState(false),[De,xe]=Kt.useState(()=>vd(eo(r?.rows,T),eo(r?.columns,T),a?.dimensionFieldId)),[se,te]=Kt.useState(()=>{let x=(r?.values??[]).filter((F,L,Y)=>T.has(F.fieldId)&&Y.findIndex(he=>he.fieldId===F.fieldId)===L).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:So(F.aggregation,I.get(F.fieldId))}));return xs(x,a?.primaryValueFieldId)}),[Ie,Ye]=Kt.useState(()=>{let x=(r?.values??[]).filter((L,Y,he)=>T.has(L.fieldId)&&he.findIndex(Ve=>Ve.fieldId===L.fieldId)===Y).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:So(L.aggregation,I.get(L.fieldId))})),F=xs(x,a?.primaryValueFieldId);return Cd(x,F,a?.secondaryValueFieldId)}),[Ue,be]=Kt.useState(a?.chartType??"bar-vertical"),[Ke,lt]=Kt.useState(c),[Ee,Oe]=Kt.useState(d),[qe,pt]=Kt.useState(()=>f??[]),[$e,q]=Kt.useState(""),[Le,ve]=Kt.useState(false),[Pe,at]=Kt.useState(""),[We,re]=Kt.useState(null),[ke,je]=Kt.useState(new Set(["__grand_total__"])),[St,K]=Kt.useState(new Set),Fe=l?.rowFields??k,ye=l?.columnFields??D,st=l?.filterFields??M,W=l?.valueFields??j,ue=l?.filterSelections??V,_e=l?.showGrandTotal??Z,Qe=l?.isConfiguratorCollapsed??ee,mt=l?.chartDimensionFieldId??De,yt=l?.chartPrimaryValueFieldId??se,oo=l?.chartSecondaryValueFieldId??Ie,xo=l?.chartType??Ue,xt=l?.isChartCollapsed??Ke,nr=l?.isTableCollapsed??Ee,Rt=g??qe,ir=s||Rt.length>0||!!m,ro=Kt.useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}S(x);},[l]),N=Kt.useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}P(x);},[l]),O=Kt.useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}A(x);},[l]),$=Kt.useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}z(x);},[l]),le=Kt.useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}X(x);},[l]),de=Kt.useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}H(x);},[l]),Te=Kt.useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}pe(x);},[l]),Ce=Kt.useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}xe(x);},[l]),Ae=Kt.useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}te(x);},[l]),Ge=Kt.useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}Ye(x);},[l]),Mt=Kt.useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}be(x);},[l]),vt=Kt.useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}lt(x);},[l]),Pt=Kt.useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}Oe(x);},[l]),bt=Kt.useCallback(x=>{let F=typeof x=="function"?x(Rt):x;g||pt(F),m?.(F);},[m,Rt,g]),Po=Kt.useMemo(()=>new Set([...Fe,...ye,...st]),[Fe,ye,st]),qt=Kt.useMemo(()=>o.filter(x=>!Po.has(x.id)),[o,Po]),Nt=Kt.useMemo(()=>{let x=[...Fe,...ye,...st],F=new Set,L=[];return x.forEach(Y=>{F.has(Y)||(F.add(Y),L.push(Y));}),L},[ye,st,Fe]);Kt.useEffect(()=>{ro(x=>{let F=x.filter(L=>T.has(L));return Ur(x,F)?x:F}),N(x=>{let F=x.filter(L=>T.has(L));return Ur(x,F)?x:F}),O(x=>{let F=x.filter(L=>T.has(L));return Ur(x,F)?x:F}),$(x=>{let F=x.filter(L=>T.has(L.fieldId)).map(L=>({...L,aggregation:So(L.aggregation,I.get(L.fieldId))}));return ns(x,F)?x:F});},[I,T]);let vo=Kt.useMemo(()=>{let x={};return Nt.forEach(F=>{let L=new Set;t.forEach(Y=>{L.add(Gr(Y[F]));}),x[F]=Array.from(L).sort((Y,he)=>Y.localeCompare(he));}),x},[Nt,t]);Kt.useEffect(()=>{le(x=>{let F={};return Nt.forEach(L=>{let Y=vo[L]??[],Ve=(x[L]??[]).filter(ie=>Y.includes(ie)),G=Object.prototype.hasOwnProperty.call(x,L);F[L]=G?Ve:Y;}),Um(x,F)?x:F});},[Nt,vo]),Kt.useEffect(()=>{Ce(x=>vd(Fe,ye,x));},[ye,Fe,Ce]),Kt.useEffect(()=>{Ae(x=>xs(W,x));},[Ae,W]),Kt.useEffect(()=>{Ge(x=>Cd(W,yt,x));},[yt,Ge,W]);let jt=Kt.useMemo(()=>t.filter(x=>Nt.every(F=>{let L=ue[F]??[],Y=vo[F]??[];if(L.length===Y.length)return true;if(L.length===0)return false;let he=Gr(x[F]);return L.includes(he)})),[Nt,vo,ue,t]),nt=Kt.useMemo(()=>{if(W.length===0)return null;let x=new Map;if(jt.forEach(G=>{let ie=ye.length>0?ye.map(wt=>Gr(G[wt])):[u("pivot.valueLabel")],ne=Va(ie);x.set(ne,ie);}),x.size===0){let G=ye.length>0?ye.map(()=>rs):[u("pivot.valueLabel")];x.set(Va(G),G);}let F=Array.from(x.entries()).sort((G,ie)=>Gm(G[1],ie[1])),L=F.flatMap(([G,ie])=>W.map(ne=>{let wt=I.get(ne.fieldId),U=`${R(ne.aggregation)} ${wt?.label??ne.fieldId}`,me=ye.length===0||W.length>1?`${ie.join(" / ")} \u2022 ${U}`:ie.join(" / ");return {id:`${G}::${ne.tokenId}`,colKey:G,valueItem:ne,label:me}})),Y=[];ye.length>0&&F.forEach(([G,ie])=>{let ne=L.filter(me=>me.colKey===G),wt=Y,U=[];ie.forEach((me,J)=>{U.push(`d${J}:${me}`);let Re=`col::${Va(U)}`,gt=wt.find(xr=>xr.key===Re);gt||(gt={key:Re,label:me,children:[],leafColumnIds:[],path:ie.slice(0,J+1),depth:J},wt.push(gt)),ne.forEach(xr=>{gt.leafColumnIds.includes(xr.id)||gt.leafColumnIds.push(xr.id);}),wt=gt.children;});});let he=G=>{let ie={};return L.forEach(ne=>{let wt=G.filter(U=>{let me=ye.length>0?ye.map(J=>Gr(U[J])):[u("pivot.valueLabel")];return Va(me)===ne.colKey});ie[ne.id]=Dn(wt,ne.valueItem.fieldId,ne.valueItem.aggregation);}),ie},Ve=[];if(Fe.length===0)Ve.push({key:"root",value:u("pivot.resultLabel")||zm,children:[],isLeaf:true,aggregatedValues:he(jt),path:[],depth:0});else {let G=(ie,ne,wt)=>{if(ne>=Fe.length)return [];let U=Fe[ne],me=new Map;return ie.forEach(J=>{let Re=Gr(J[U]);me.has(Re)||me.set(Re,[]),me.get(Re).push(J);}),Array.from(me.keys()).sort().map(J=>{let Re=me.get(J),gt=[...wt,J];return {key:Va(gt),value:J,fieldId:U,aggregatedValues:he(Re),children:G(Re,ne+1,gt),isLeaf:ne===Fe.length-1,path:gt,depth:ne}})};Ve.push(...G(jt,0,[]));}return {dataColumns:L,columnTree:Y,rowTree:Ve}},[ye,I,jt,R,Fe,u,W]),qo=Kt.useCallback((x,F)=>(p.current+=1,{tokenId:`v${p.current}`,fieldId:x,aggregation:So(F,I.get(x))}),[I]),Eo=Kt.useCallback(x=>{if(x==="rows")return ro([]);if(x==="columns")return N([]);if(x==="filters")return O([]);$([]);},[]),jo=Kt.useCallback((x,F)=>{if(x==="rows")return ro(L=>L.filter(Y=>Y!==F));if(x==="columns")return N(L=>L.filter(Y=>Y!==F));if(x==="filters")return O(L=>L.filter(Y=>Y!==F));$(L=>L.filter(Y=>Y.tokenId!==F));},[]),B=Kt.useCallback((x,F)=>{$(L=>L.map(Y=>Y.tokenId===x?{...Y,aggregation:So(F,I.get(Y.fieldId))}:Y));},[I]),_=Kt.useCallback(x=>{re(String(x.active.id));},[]),Q=Kt.useCallback(x=>{if(re(null),!x.over)return;let F=as(String(x.active.id)),L=as(String(x.over.id));if(!F||!L||F.kind!=="item"||!F.key)return;if(F.zone===L.zone&&L.kind==="item"){if(F.zone==="rows"){let J=Fe.indexOf(F.key),Re=Fe.indexOf(L.key??"");J!==-1&&Re!==-1&&J!==Re&&ro(gt=>sortable.arrayMove(gt,J,Re));return}if(F.zone==="columns"){let J=ye.indexOf(F.key),Re=ye.indexOf(L.key??"");J!==-1&&Re!==-1&&J!==Re&&N(gt=>sortable.arrayMove(gt,J,Re));return}if(F.zone==="filters"){let J=st.indexOf(F.key),Re=st.indexOf(L.key??"");J!==-1&&Re!==-1&&J!==Re&&O(gt=>sortable.arrayMove(gt,J,Re));return}if(F.zone==="values"){let J=W.findIndex(gt=>gt.tokenId===F.key),Re=W.findIndex(gt=>gt.tokenId===(L.key??""));J!==-1&&Re!==-1&&J!==Re&&$(gt=>sortable.arrayMove(gt,J,Re));}return}let Y=L.zone,he=[...Fe],Ve=[...ye],G=[...st],ie=[...W],ne="",wt=null;if(F.zone==="palette")ne=F.key;else if(F.zone==="values"){let J=ie.find(Re=>Re.tokenId===F.key);if(!J)return;ne=J.fieldId,wt=J,ie=ie.filter(Re=>Re.tokenId!==F.key);}else F.zone==="rows"?(ne=F.key,he=he.filter(J=>J!==ne)):F.zone==="columns"?(ne=F.key,Ve=Ve.filter(J=>J!==ne)):F.zone==="filters"&&(ne=F.key,G=G.filter(J=>J!==ne));if(!ne)return;let U=()=>{he=he.filter(J=>J!==ne),Ve=Ve.filter(J=>J!==ne),G=G.filter(J=>J!==ne);},me=J=>{if(L.kind!=="item"||!L.key)return J==="rows"?he.length:J==="columns"?Ve.length:J==="filters"?G.length:J==="values"?ie.length:0;if(J==="rows"){let Re=he.indexOf(L.key);return Re>=0?Re:he.length}if(J==="columns"){let Re=Ve.indexOf(L.key);return Re>=0?Re:Ve.length}if(J==="filters"){let Re=G.indexOf(L.key);return Re>=0?Re:G.length}if(J==="values"){let Re=ie.findIndex(gt=>gt.tokenId===L.key);return Re>=0?Re:ie.length}return 0};if(Y==="palette"){ro(he),N(Ve),O(G),$(ie);return}if(Y==="values"){let J=me("values"),Re=wt??qo(ne);ie.splice(J,0,Re),ro(he),N(Ve),O(G),$(ie);return}if($m(Y)){U();let J=me(Y);Y==="rows"?he.splice(J,0,ne):Y==="columns"?Ve.splice(J,0,ne):G.splice(J,0,ne),ro(he),N(Ve),O(G),$(ie);}},[ye,qo,st,Fe,W]),ce=Kt.useCallback((x,F)=>{le(L=>({...L,[x]:F}));},[]),Be=Kt.useCallback(x=>{je(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),He=Kt.useCallback(x=>{K(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),rt=Kt.useCallback(x=>{let F=I.get(x.fieldId),L=ld(F);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:Y=>B(x.tokenId,Y.target.value),onClick:Y=>Y.stopPropagation(),onMouseDown:Y=>Y.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(Y=>jsxRuntime.jsx(material.MenuItem,{value:Y,sx:{fontSize:"0.75rem"},children:R(Y)},Y))})})},[I,R,B]),ge=Kt.useCallback(x=>{let F=vo[x]??[],L=ue[x]??F;return F.length===0?u("pivot.filter.noValues"):L.length===0?u("pivot.filter.noneSelected"):L.length===F.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:L.length,total:F.length})},[vo,ue,u]),Je=Kt.useCallback(x=>{let F=vo[x]??[],L=ue[x]??F;return jsxRuntime.jsx(qm,{options:F,selectedValues:L,onChange:Y=>ce(x,Y)})},[vo,ue,ce]),ct=Kt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Dt=Kt.useCallback(()=>{let x={};return new Set([...Nt,...Object.keys(ue)]).forEach(L=>{if(!T.has(L))return;let Y=ue[L]??[];x[L]=[...Y];}),{layout:{rows:[...Fe],columns:[...ye],filters:[...st],values:W.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:_e,chart:{dimensionFieldId:mt,primaryValueFieldId:yt,secondaryValueFieldId:oo,chartType:xo}}},[Nt,mt,yt,oo,xo,ye,st,ue,Fe,_e,T,W]),dt=Kt.useCallback(x=>{let F=eo(x.layout.rows,T),L=eo(x.layout.columns,T),Y=eo(x.layout.filters,T),he=new Set,Ve=(x.layout.values??[]).filter(ne=>!T.has(ne.fieldId)||he.has(ne.fieldId)?false:(he.add(ne.fieldId),true)).map(ne=>qo(ne.fieldId,ne.aggregation)),G={};Object.entries(x.filterSelections??{}).forEach(([ne,wt])=>{!T.has(ne)||!Array.isArray(wt)||(G[ne]=Array.from(new Set(wt.map(U=>String(U)))));}),ro(F),N(L),O(Y),$(Ve),le(G),typeof x.showGrandTotal=="boolean"&&de(x.showGrandTotal),Ce(vd(F,L,x.chart?.dimensionFieldId));let ie=xs(Ve,x.chart?.primaryValueFieldId);Ae(ie),Ge(Cd(Ve,ie,x.chart?.secondaryValueFieldId)),Mt(x.chart?.chartType??"bar-vertical"),q(x.id),y?.(x);},[qo,y,Ce,Ae,Ge,Mt,N,O,le,ro,de,$,T]),Jt=Kt.useCallback(x=>{if(!x){q("");return}let F=Rt.find(L=>L.id===x);if(!F){q("");return}dt(F);},[dt,Rt]),ao=Kt.useCallback(()=>{let x=u("pivot.preset.defaultName",{index:Rt.length+1});at(x),ve(true);},[Rt.length,u]),Co=Kt.useCallback(()=>{let x=Pe.trim();if(!x)return;let F={id:ct(),name:x,...Dt()};bt(L=>[...L,F]),q(F.id),ve(false);},[Dt,ct,Pe,bt]),$t=Kt.useCallback(()=>{$e&&(bt(x=>x.filter(F=>F.id!==$e)),q(""));},[$e,bt]);Kt.useEffect(()=>{if(!b||h.current)return;let x=Rt.find(F=>F.id===b);x&&(h.current=true,dt(x));},[dt,b,Rt]),Kt.useEffect(()=>{$e&&(Rt.some(x=>x.id===$e)||q(""));},[$e,Rt]);let no=Kt.useMemo(()=>{if(!_e||!nt||!Fe.length)return null;let x={};return nt.dataColumns.forEach(F=>{let L=jt.filter(Y=>{let he=ye.length>0?ye.map(Ve=>Gr(Y[Ve])):[u("pivot.valueLabel")];return Va(he)===F.colKey});x[F.id]=Dn(L,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||Nm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[_e,nt,jt,ye,Fe.length,u]),Ct=Kt.useMemo(()=>hg(nt?.rowTree??[]),[nt]),Zt=Kt.useMemo(()=>hg(nt?.columnTree??[]),[nt]);Kt.useEffect(()=>{je(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),Ct.forEach(L=>{x.has(L)&&F.add(L);}),F});},[Ct]),Kt.useEffect(()=>{K(x=>{let F=new Set;return Zt.forEach(L=>{x.has(L)&&F.add(L);}),F});},[Zt]);let yr=Kt.useCallback(()=>{je(x=>{let F=new Set(x);return Ct.forEach(L=>F.add(L)),F});},[Ct]),Zo=Kt.useCallback(()=>{je(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),Ya=Kt.useCallback(()=>{K(new Set(Zt));},[Zt]),Qa=Kt.useCallback(()=>{K(new Set);},[]),Ja=Kt.useMemo(()=>!nt||ye.length===0?[]:Xk(nt.columnTree,St),[ye.length,St,nt]),Fo=Kt.useMemo(()=>{if(!nt)return [];if(ye.length===0)return nt.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let x=new Map(nt.dataColumns.map(F=>[F.id,F]));return Ja.flatMap(F=>{let L=new Map;return F.leafColumnIds.forEach(Y=>{let he=x.get(Y);if(!he)return;let Ve=he.valueItem.tokenId,G=`${R(he.valueItem.aggregation)} ${I.get(he.valueItem.fieldId)?.label??he.valueItem.fieldId}`,ie=L.get(Ve);if(ie){ie.leafColumnIds.push(Y);return}L.set(Ve,{id:`${F.key}::${Ve}`,label:W.length>1?G:F.label,leafColumnIds:[Y],valueItem:he.valueItem});}),Array.from(L.values())})},[ye.length,I,R,nt,W.length,Ja]),en=Kt.useMemo(()=>new Map(Fo.map(x=>[x.id,x])),[Fo]),tn=Kt.useMemo(()=>Fo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[Fo]),Ca=Kt.useMemo(()=>{if(!nt||ye.length===0)return [];let x=[],F=yg(nt.columnTree,St),L=F+(W.length>1?1:0),Y=(he,Ve)=>{x[Ve]??(x[Ve]=[]),he.forEach(G=>{let ie=G.children.length>0&&St.has(G.key),ne=Fo.filter(U=>G.leafColumnIds.some(me=>U.leafColumnIds.includes(me))).length,wt=ie||W.length>1?1:L-Ve;x[Ve].push({key:G.key,label:G.label,colSpan:ne,rowSpan:wt,expandable:G.children.length>0,expanded:ie}),ie&&Y(G.children,Ve+1);});};return Y(nt.columnTree,0),W.length>1&&(x[F]=Fo.map(he=>({key:he.id,label:he.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[ye.length,St,nt,W.length,Fo]),Br=Kt.useCallback((x,F)=>F.leafColumnIds.reduce((L,Y)=>L+(x.aggregatedValues[Y]??0),0),[]),Qr=Kt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:yr,disabled:Ct.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Zo,disabled:Ct.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ya,disabled:Zt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Qa,disabled:ye.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[ye.length,Zt.size,Ct.size,Qa,Zo,Ya,yr,u]),Jr=()=>{if(!We)return null;let x=as(We);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let he=I.get(x.key);return he?jsxRuntime.jsx(cd,{label:he.label,subtitle:he.type}):null}if(x.zone==="values"){let he=W.find(ne=>ne.tokenId===x.key);if(!he)return null;let G=I.get(he.fieldId)?.label??he.fieldId,ie=`${R(he.aggregation)}(${G})`;return jsxRuntime.jsx(ds,{label:G,caption:ie})}let L=I.get(x.key)?.label??x.key,Y=ge(x.key);return jsxRuntime.jsx(ds,{label:L,caption:Y})};return jsxRuntime.jsxs(material.Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.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:v}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[ir&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:$e,displayEmpty:true,onChange:x=>Jt(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),Rt.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ao,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(Lp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:$t,disabled:!$e,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(gy__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:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:jt.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:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:_e,onChange:x=>de(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:_,onDragEnd:Q,children:[jsxRuntime.jsx(tg,{isConfiguratorCollapsed:Qe,onToggleCollapse:()=>Te(x=>!x),availableFields:qt,fieldMap:I,filterFields:st,columnFields:ye,rowFields:Fe,valueFields:W,clearZone:Eo,removeFieldFromZone:jo,getFilterSelectionSummary:ge,renderDimensionFilterSelect:Je,renderAggregationSelect:rt,getAggregationLabel:R}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Jr()})})]}),jsxRuntime.jsx(cg,{rows:jt,fieldMap:I,rowFields:Fe,columnFields:ye,valueFields:W,chartDimensionFieldId:mt,chartPrimaryValueFieldId:yt,chartSecondaryValueFieldId:oo,chartType:xo,isCollapsed:xt,onChartDimensionFieldIdChange:x=>Ce(x),onChartPrimaryValueFieldIdChange:x=>Ae(x),onChartSecondaryValueFieldIdChange:x=>Ge(x),onChartTypeChange:x=>Mt(x),onToggleCollapse:()=>vt(x=>!x),getAggregationLabel:R}),jsxRuntime.jsx(Ln,{title:u("pivot.table.sectionTitle"),subtitle:Fe.length>0?Fe.map(x=>I.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:nr,onToggleCollapse:()=>Pt(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Qr,children:nt===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:w})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Ca.length>0?Ca:[[]]).map((x,F)=>jsxRuntime.jsxs(material.TableRow,{children:[F===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Ca.length,1),sx:L=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:L.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${L.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Fe.length>0?Fe.map(L=>I.get(L)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:Fo.map(L=>({key:L.id,label:L.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(L=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:L.colSpan,rowSpan:L.rowSpan,sx:Y=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:Y.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${Y.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[L.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>He(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsxRuntime.jsx(Xb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Xf__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:L.label})]})},L.key))]},`pivot-header-row-${F}`))}),jsxRuntime.jsxs(material.TableBody,{children:[nt.rowTree.map(x=>jsxRuntime.jsx(hs,{node:x,dataColumns:tn,fieldMap:I,level:0,expandedKeys:ke,onToggle:Be,getValue:(F,L)=>{let Y=en.get(L);return Y?Br(F,Y):0}},x.key)),no&&jsxRuntime.jsx(hs,{node:no,dataColumns:tn,fieldMap:I,level:0,expandedKeys:ke,onToggle:Be,getValue:(x,F)=>{let L=en.get(F);return L?Br(x,L):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Le,onClose:()=>ve(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:Pe,onChange:x=>at(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Co());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>ve(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Co,disabled:!Pe.trim(),children:u("common.save")})]})]})]})};var xg=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},Sd=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",vg=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",pL=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:r=true,initialConfiguratorCollapsed:a=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Kt.useRef(0),l=Kt.useMemo(()=>new Set(e.map(q=>q.id)),[e]),s=Kt.useMemo(()=>new Map(e.map(q=>[q.id,q])),[e]),[g,f]=Kt.useState(()=>eo(t?.rows,l)),[m,b]=Kt.useState(()=>eo(t?.columns,l)),[y,u]=Kt.useState(()=>eo(t?.filters,l)),[C,p]=Kt.useState(()=>{let q=t?.values??[],Le=new Set,ve=[];return q.forEach(Pe=>{!l.has(Pe.fieldId)||Le.has(Pe.fieldId)||(Le.add(Pe.fieldId),d.current+=1,ve.push({tokenId:`v${d.current}`,fieldId:Pe.fieldId,aggregation:So(Pe.aggregation,s.get(Pe.fieldId))}));}),ve}),[h,v]=Kt.useState(o),[w,E]=Kt.useState(r),[R,T]=Kt.useState(a),[I,k]=Kt.useState(()=>xg(eo(t?.rows,l),eo(t?.columns,l),n?.dimensionFieldId)),[S,D]=Kt.useState(()=>{let q=(()=>{let Le=t?.values??[],ve=new Set,Pe=[];return Le.forEach(at=>{!l.has(at.fieldId)||ve.has(at.fieldId)||(ve.add(at.fieldId),Pe.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:So(at.aggregation,s.get(at.fieldId))}));}),Pe})();return Sd(q,n?.primaryValueFieldId)}),[P,M]=Kt.useState(()=>{let q=(()=>{let ve=t?.values??[],Pe=new Set,at=[];return ve.forEach(We=>{!l.has(We.fieldId)||Pe.has(We.fieldId)||(Pe.add(We.fieldId),at.push({tokenId:We.fieldId,fieldId:We.fieldId,aggregation:So(We.aggregation,s.get(We.fieldId))}));}),at})(),Le=Sd(q,n?.primaryValueFieldId);return vg(q,Le,n?.secondaryValueFieldId)}),[A,j]=Kt.useState(n?.chartType??"bar-vertical"),[z,V]=Kt.useState(i),[X,Z]=Kt.useState(c);Kt.useEffect(()=>{f(q=>{let Le=q.filter(ve=>l.has(ve));return Ur(q,Le)?q:Le}),b(q=>{let Le=q.filter(ve=>l.has(ve));return Ur(q,Le)?q:Le}),u(q=>{let Le=q.filter(ve=>l.has(ve));return Ur(q,Le)?q:Le}),p(q=>{let Le=q.filter(ve=>l.has(ve.fieldId)).map(ve=>({...ve,aggregation:So(ve.aggregation,s.get(ve.fieldId))}));return ns(q,Le)?q:Le});},[s,l]),Kt.useEffect(()=>{k(q=>xg(g,m,q));},[m,g]),Kt.useEffect(()=>{D(q=>Sd(C,q));},[C]),Kt.useEffect(()=>{M(q=>vg(C,S,q));},[S,C]);let H=Kt.useCallback(q=>{f(eo(q,l));},[l]),ee=Kt.useCallback(q=>{b(eo(q,l));},[l]),pe=Kt.useCallback(q=>{u(eo(q,l));},[l]),De=Kt.useCallback(q=>{p(Le=>{let ve=q??[],Pe=new Set,at=[];return ve.forEach(We=>{if(!l.has(We.fieldId)||Pe.has(We.fieldId))return;Pe.add(We.fieldId);let re=Le.find(ke=>ke.fieldId===We.fieldId);if(re){at.push({...re,aggregation:So(We.aggregation??re.aggregation,s.get(We.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:We.fieldId,aggregation:So(We.aggregation,s.get(We.fieldId))});}),at});},[s,l]),xe=Kt.useCallback(q=>{H(q.rows??[]),ee(q.columns??[]),pe(q.filters??[]),De(q.values??[]);},[ee,pe,H,De]),se=Kt.useCallback(q=>{if(q==="rows")return f([]);if(q==="columns")return b([]);if(q==="filters")return u([]);p([]);},[]),te=Kt.useCallback((q,Le)=>{if(q==="rows")return f(ve=>ve.filter(Pe=>Pe!==Le));if(q==="columns")return b(ve=>ve.filter(Pe=>Pe!==Le));if(q==="filters")return u(ve=>ve.filter(Pe=>Pe!==Le));p(ve=>ve.filter(Pe=>Pe.tokenId!==Le));},[]),Ie=Kt.useCallback((q,Le)=>{p(ve=>ve.map(Pe=>Pe.tokenId===q?{...Pe,aggregation:So(Le,s.get(Pe.fieldId))}:Pe));},[s]),Ye=Kt.useCallback((q,Le)=>{v(ve=>({...ve,[q]:Le}));},[]),Ue=Kt.useCallback(()=>{v({});},[]),be=Kt.useCallback(()=>{E(q=>!q);},[]),Ke=Kt.useCallback(()=>{T(q=>!q);},[]),lt=Kt.useCallback(q=>{k(q);},[]),Ee=Kt.useCallback(q=>{D(q);},[]),Oe=Kt.useCallback(q=>{M(q);},[]),qe=Kt.useCallback(()=>{V(q=>!q);},[]),pt=Kt.useCallback(()=>{Z(q=>!q);},[]);return {model:Kt.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:m,setColumnFields:b,filterFields:y,setFilterFields:u,valueFields:C,setValueFields:p,filterSelections:h,setFilterSelections:v,showGrandTotal:w,setShowGrandTotal:E,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:T,chartDimensionFieldId:I,setChartDimensionFieldId:k,chartPrimaryValueFieldId:S,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:P,setChartSecondaryValueFieldId:M,chartType:A,setChartType:j,isChartCollapsed:z,setIsChartCollapsed:V,isTableCollapsed:X,setIsTableCollapsed:Z}),[I,S,P,A,m,y,h,z,R,X,g,w,C]),actions:{setRows:H,setColumns:ee,setFilters:pe,setValues:De,setLayout:xe,clearZone:se,removeFieldFromZone:te,setAggregationForValue:Ie,setFilterSelection:Ye,resetFilterSelections:Ue,toggleGrandTotal:be,toggleConfigurator:Ke,setChartDimension:lt,setChartPrimaryValue:Ee,setChartSecondaryValue:Oe,setChartType:j,toggleChart:qe,toggleTable:pt}}};var bL=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let r=styles.useTheme(),a=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(r.breakpoints.down("md"),{noSsr:true}),i=Kt.useMemo(()=>e==="auto"?a||n?"portrait":"landscape":e,[n,a,e]),[c,d]=Kt.useState(t??i==="landscape");Kt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:a,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var rS=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},vL=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:r})=>{let n=e[0]?.[t],[i,c]=Kt.useState(r??n),d=Kt.useMemo(()=>e.find(m=>m[t]===i)||e[0],[t,e,i]),[l,s]=Kt.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:m=>{let b=m[t];c(b);let y=m[o];s(y==null?"0":String(y));},applyEditorValue:m=>{if(i===void 0)return;let b=rS(l),y=e.map(u=>u[t]===i?{...u,[o]:b}:u);m(y);}}};var gS=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Ig=(e,t,o,r)=>{t?.(e),r&&o?.();},IL=({open:e,onClose:t,title:o="Scan barcode",subtitle:r="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=gS,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:m,sx:b})=>{let y=Kt__namespace.default.useRef(null),u=Kt__namespace.default.useRef(null),C=Kt__namespace.default.useRef(null),p=Kt__namespace.default.useRef(null),[h,v]=Kt__namespace.default.useState("idle"),[w,E]=Kt__namespace.default.useState(""),[R,T]=Kt__namespace.default.useState(null),[I,k]=Kt__namespace.default.useState(null),S=Kt__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),u.current&&(u.current.getTracks().forEach(M=>M.stop()),u.current=null),y.current&&(y.current.srcObject=null);},[]),D=Kt__namespace.default.useCallback(M=>{k(M),v("error"),m?.(M);},[m]);Kt__namespace.default.useEffect(()=>{if(!e){S(),v("idle"),k(null),E("");return}let M=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){v("unsupported"),k("Camera access is not supported in this browser.");return}v("starting"),k(null);try{let j=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(M){j.getTracks().forEach(z=>z.stop());return}if(u.current=j,y.current&&(y.current.srcObject=j,await y.current.play()),!window.BarcodeDetector){v("unsupported"),k("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}p.current=new window.BarcodeDetector({formats:a}),v("ready"),C.current=window.setInterval(async()=>{if(!(!y.current||!p.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let V=(await p.current.detect(y.current)).find(Z=>Z.rawValue);if(!V?.rawValue)return;let X={rawValue:V.rawValue,format:V.format};T(X),S(),Ig(X,f,t,c);}catch(z){D(z instanceof Error?z.message:"Failed to detect barcode.");}},d);}catch(j){D(j instanceof Error?j.message:"Unable to start camera.");}}})(),()=>{M=true,S();}},[c,n,a,t,f,e,D,d,S]);let P=()=>{let M=w.trim();if(!M)return;let A={rawValue:M,format:"manual"};T(A),Ig(A,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:b,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:r}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:M=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:M.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:y,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(pS__default.default,{}),label:h==="ready"?"Camera ready":h==="starting"?"Starting camera":h==="unsupported"?"Preview only":h==="error"?"Scanner error":"Idle",size:"small",color:h==="error"?"error":"primary",variant:"filled"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(mS__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),I?jsxRuntime.jsx(material.Alert,{severity:h==="unsupported"?"info":"warning",children:I}):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:w,onChange:M=>E(M.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:P,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 yS={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},BL=({title:e,description:t,kicker:o,icon:r,badges:a=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:m,dragHandleProps:b,onClick:y,onSwipe:u,sx:C})=>{let[p,h]=Kt.useState(0),[v,w]=Kt.useState(false),E=Kt.useRef(null),R=Kt.useRef(0),T=Kt.useRef(0),I=!!(f||m),k=132,S=()=>{h(0),w(false),E.current=null,R.current=0,T.current=0;},D=z=>{(z==="start"?f:m)?.onTrigger?.(),u?.(z),S();},P=z=>{!I||z.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=z.pointerId,R.current=z.clientX,T.current=z.clientX,w(true),z.currentTarget.setPointerCapture(z.pointerId));},M=z=>{if(!v||E.current!==z.pointerId)return;T.current=z.clientX;let V=T.current-R.current,X=Math.max(-k,Math.min(k,V));h(X);},A=z=>{if(!v||E.current!==z.pointerId)return;let V=T.current-R.current;if(V>=g&&f){D("start");return}if(V<=-g&&m){D("end");return}Math.abs(V)<12&&y?.(),S();},j=(z,V)=>{if(!z)return null;let X=z.backgroundColor||yS[z.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[V]:0,width:k,px:2,display:"flex",alignItems:"center",justifyContent:V==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${X}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[z.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:z.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[j(f,"left"),j(m,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:P,onPointerMove:M,onPointerUp:A,onPointerCancel:S,sx:z=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:z.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(${p}px, 0, 0) scale(${s?.985:1})`,transition:v?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"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:[r?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:r}):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",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(bS__default.default,{})})}):null]}),a.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((z,V)=>jsxRuntime.jsx(material.Chip,{label:z,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},V))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(z=>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:z.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:z.value})]},z.id))}):null,c,i]})})]})};var Gi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:r=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?r.palette.primary.main:o==="danger"?r.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":r.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}),WL=({value:e,defaultValue:t="",title:o,subtitle:r,placeholder:a="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:m,sx:b})=>{let{t:y}=oe(),[u,C]=Kt.useState(t),p=e??u,h=S=>{e===void 0&&C(S),g?.(S);},v=S=>{c&&p.length>=c||h(`${p}${S}`);},w=S=>{if(S==="00"){if(!p){h("0");return}v("00");return}v(S);},E=()=>{!n||p.includes(".")||h(p?`${p}.`:"0.");},R=()=>{if(i){if(p.startsWith("-")){h(p.slice(1));return}h(p?`-${p}`:"-");}},T=()=>{h(p.slice(0,-1));},I=()=>{h("");},k=()=>{f?.(p);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},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,r?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:r}):null]}),m?jsxRuntime.jsx(material.IconButton,{onClick:m,size:"small",children:jsxRuntime.jsx(kS__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:p?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:p?"text.primary":"text.disabled"},children:p||a})}),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(S=>jsxRuntime.jsx(Gi,{label:S,onPress:()=>w(S)},S)),jsxRuntime.jsx(Gi,{label:i?"+/-":"00",onPress:i?R:()=>w("00")}),jsxRuntime.jsx(Gi,{label:"0",onPress:()=>w("0")}),jsxRuntime.jsx(Gi,{label:n?".":s?String(s):"DEL",onPress:n?E:T})]}),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:T,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(CS__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Gi,{label:String(l||"CLR"),onPress:I,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:k,sx:S=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:S.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(SS__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Ag=({touchMode:e="comfortable",sx:t,...o})=>{let r=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:r?56:50,borderRadius:3,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:r?1.6:1.25,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:r?48:44,px:r?2.25:1.75,borderRadius:3,fontSize:r?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:r?40:36,height:r?40:36},"& .MuiMenuItem-root":{minHeight:r?44:38,fontSize:r?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:r?1:.75},"& .MuiFormControlLabel-label":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:r?"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(zr,{...o})})};var DS=(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);}},Fg=({items:e,selectedId:t,orientation:o="auto",onItemSelect:r,sx:a})=>{let n=styles.useTheme(),[i,c]=Kt.useState(false);Kt.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,...a},children:e.map(f=>{let m=f.id===t,b=f.color||(m?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"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:()=>DS(g,f,r),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:m?"#fff":"text.primary",background:m?b:"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:m?"primary.main":"action.hover",color:m?"#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 Og=(e,t)=>t.trim()?e.reduce((o,r)=>{let a=r.title?.toLowerCase().includes(t.toLowerCase())||r.label?.toLowerCase().includes(t.toLowerCase())||r.description?.toLowerCase().includes(t.toLowerCase()),n=r.children?Og(r.children,t):[];return (a||n.length>0)&&o.push({...r,children:n.length>0?n:r.children}),o},[]):e,GS=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children?.length&&(t.add(a.id),o(a.children));});};return o(e),t},Vg=({collapsed:e=false,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=oe(),f=styles.useTheme(),m=material.useMediaQuery("(orientation: portrait)"),b=material.useMediaQuery(f.breakpoints.down("md")),y=i==="auto"?m||b?"portrait":"landscape":i,u=n==="dark",C=navigation.useRouter(),p=navigation.usePathname(),[h,v]=Kt.useState(""),[w,E]=Kt.useState(new Set),R=Kt.useMemo(()=>Og(a,h),[a,h]),T=Kt.useMemo(()=>h.trim()?GS(R):w,[w,R,h]);Kt.useEffect(()=>{e&&E(new Set);},[e]);let I=M=>M.appurl||M.href||"",k=M=>{s?.(M);let A=I(M);if(A){if(A.startsWith("http://")||A.startsWith("https://")){window.open(A,"_blank");return}C.push(A);}},S=M=>{let A=!!M.children?.length;if(e&&A){t?.();return}if(A){E(j=>{let z=new Set(j);return z.has(M.id)?z.delete(M.id):z.add(M.id),z});return}k(M);},D=M=>{let A=l||p,j=I(M);return !!(j&&A===j)},P=(M,A=0)=>{let j=!!M.children?.length,z=T.has(M.id),V=D(M);return jsxRuntime.jsx(material.Box,{sx:{pl:A===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:V?"primary.main":"divider",bgcolor:V?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>S(M),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:V?"primary.main":"action.hover",color:V?"#fff":"text.primary"},children:M.icon||(M.title||M.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:M.title||M.label}),M.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:M.description}):null]}),j?jsxRuntime.jsx(WS__default.default,{sx:{transform:z?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx($S__default.default,{color:"action"})]}),j?jsxRuntime.jsx(material.Collapse,{in:z,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:M.children?.map(X=>P(X,A+1))})}):null]})},M.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}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(HS__default.default,{})}),a.map(M=>jsxRuntime.jsx(material.IconButton,{onClick:()=>S(M),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(M)?"primary.main":"action.hover",color:D(M)?"#fff":"text.primary"},children:M.icon||(M.title||M.label||"?").slice(0,1).toUpperCase()},M.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}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:h,onChange:M=>v(M.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(OS__default.default,{fontSize:"small",color:"action"})}}),y==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(VS__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(M=>P(M)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var qg=(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)},ZS=e=>Kt__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}),XS=(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)},YS=({summaryRow:e,visibleColumns:t,columns:o})=>{let r=o.filter(a=>t.includes(a.id)&&e[a.id]!=="");return r.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:r.map(a=>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:a.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[a.id]})]},`summary-${a.id}`))})]})})},QS=e=>{let{t}=oe(),o=styles.useTheme(),{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:C,tableKey:p="default",graphReport:h,quickCreate:v,quickEdit:w,quickDelete:E,serviceUrl:R,orientation:T="auto",cardTitleField:I,cardSubtitleFields:k,toolbarSlot:S,emptyState:D,rowHeight:P="comfortable",cardActionSlot:M,renderCardFooter:A,onRowClick:j}=e,z=r||t("table.title.default"),V=material.useMediaQuery("(orientation: portrait)"),X=material.useMediaQuery(o.breakpoints.down("md")),Z=T==="auto"?V||X?"portrait":"landscape":T,{columns:H,filterText:ee,setFilterText:pe,visibleColumns:De,showSummary:xe,setShowSummary:se,summaryColumns:te,grouping:Ie,setGrouping:Ye,expandedGroups:Ue,groupAnchorEl:be,setGroupAnchorEl:Ke,summaryAnchorEl:lt,setSummaryAnchorEl:Ee,anchorEl:Oe,setAnchorEl:qe,contextMenu:pt,sortedAndFilteredRows:$e,summaryRow:q,visibleRows:Le,page:ve,setPage:Pe,rowsPerPage:at,setRowsPerPage:We,totalDisplayCount:re,setSelected:ke,handleClick:je,toggleSummaryColumn:St,handleExport:K,handleCloseContextMenu:Fe,toggleColumnVisibility:ye,toggleGroupExpand:st,toggleGroupField:W,handleExpandGroupRecursively:ue,handleCollapseGroupRecursively:_e,handleLayoutLoad:Qe,handleVariantLoad:mt,handleLayoutSave:yt,effectiveAppId:oo,currentLayoutData:xo,currentLayoutId:xt,layoutIdToLoad:nr,graphReportOpen:Rt,handleOpenGraphReport:ir,handleCloseGraphReport:ro}=Cn(e),N=h?.enabled??false,O=N&&(h?.interaction?.enabled??true),$=Pl(),le=C||"id",de=Kt__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]),Te=Kt__namespace.default.useMemo(()=>({...de,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)}),[de,o]),Ce=Kt__namespace.default.useMemo(()=>{let U=new Set(i);return $e.filter(me=>U.has(me?.[le]))},[le,i,$e]),Ae=Ce.length===1?Ce[0]:null,Ge=!!v?.enabled,Mt=!!w?.enabled,vt=!!E?.enabled,Pt=v?.fields,bt=v?.excludeFields||[],Po=v?.initialValues||{},qt=w?.fields,Nt=w?.excludeFields||[],vo=w?.editableFields||[],jt=w?.nonEditableFields||[],nt=w?.primaryKeys?.length?w.primaryKeys:[le],[qo,Eo]=Kt__namespace.default.useState(false),[jo,B]=Kt__namespace.default.useState(false),[_,Q]=Kt__namespace.default.useState({}),[ce,Be]=Kt__namespace.default.useState(false),[He,rt]=Kt__namespace.default.useState(false),[ge,Je]=Kt__namespace.default.useState({}),[ct,Dt]=Kt__namespace.default.useState(false),[dt,Jt]=Kt__namespace.default.useState(false),ao=m||jo||He||dt,Co=Kt__namespace.default.useMemo(()=>{let U=[...H];if(Array.isArray(Pt)&&Pt.length>0){let me=new Set(Pt);U=U.filter(J=>me.has(J.id));}if(bt.length>0){let me=new Set(bt);U=U.filter(J=>!me.has(J.id));}return U.filter(me=>!!me?.id)},[H,bt,Pt]),$t=Kt__namespace.default.useMemo(()=>{let U=[...H];if(Array.isArray(qt)&&qt.length>0){let me=new Set(qt);U=U.filter(J=>me.has(J.id));}if(Nt.length>0){let me=new Set(Nt);U=U.filter(J=>!me.has(J.id));}return U.filter(me=>!!me?.id)},[H,Nt,qt]),no=Kt__namespace.default.useMemo(()=>new Set(nt),[nt]),Ct=Kt__namespace.default.useMemo(()=>new Set(vo),[vo]),Zt=Kt__namespace.default.useMemo(()=>new Set(jt),[jt]),yr=Kt__namespace.default.useCallback(U=>Ct.size>0?Ct.has(U):!(Zt.has(U)||no.has(U)),[Ct,Zt,no]);Kt__namespace.default.useEffect(()=>{!Rt&&$.hasActiveFilters&&$.clearAll();},[$,Rt]);let Zo=()=>{let U={};Co.forEach(me=>{U[me.id]=Po[me.id]??"";}),Q(U),Eo(true);},Ya=(U,me)=>{Q(J=>({...J,[U]:me}));},Qa=async()=>{if(!v?.onSubmit){Eo(false);return}try{B(!0),await v.onSubmit(_),Eo(!1);}finally{B(false);}},Ja=()=>{if(!Ae)return;let U={};$t.forEach(J=>{U[J.id]=Ae[J.id]??"";});let me=w?.getInitialValues?{...U,...w.getInitialValues(Ae)}:U;Je(me),Be(true);},Fo=(U,me)=>{Je(J=>({...J,[U]:me}));},en=async()=>{if(Ae){if(!w?.onSubmit){Be(false);return}try{rt(!0),await w.onSubmit(ge,Ae),Be(!1);}finally{rt(false);}}},tn=()=>{Ce.length!==0&&Dt(true);},Ca=async()=>{if(Ce.length===0){Dt(false);return}if(!E?.onConfirm){Dt(false),ke([]),c?.([]);return}try{Jt(!0),await E.onConfirm(Ce),Dt(!1),ke([]),c?.([]);}finally{Jt(false);}},Br=$e,{fieldMapping:Qr}=fn({rows:Br,config:{...h,title:h?.title||`${z} ${t("graph.reportTitle")}`}}),Jr=Kt__namespace.default.useMemo(()=>O?$.applyRows(Br,Qr):Br,[Qr,$,O,Br]),{model:x}=fn({rows:Jr,config:{...h,title:h?.title||`${z} ${t("graph.reportTitle")}`,fieldMapping:Qr}}),F=x.table.columns.map(U=>({id:U.id,label:U.label,align:U.align||"left",minWidth:120,numeric:U.align==="right"})),L=oo?jsxRuntime.jsx(vn,{appId:oo,tableKey:p,currentLayoutData:xo,onLayoutLoad:Qe,targetLayoutId:nr,activeLayoutId:xt,serviceUrl:R??u?.serviceUrl}):null,Y=H.filter(U=>De.includes(U.id)),he=Y.find(U=>U.id===I)||Y[0],Ve=k?.map(U=>Y.find(me=>me.id===U)).filter(Boolean)||Y.filter(U=>U.id!==he?.id).slice(0,Z==="portrait"?2:3),G=Y.filter(U=>U.id!==he?.id&&!Ve.some(me=>me.id===U.id)),ie=[S,l].filter(Boolean),ne=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(rn,{groupAnchorEl:be,setGroupAnchorEl:Ke,grouping:Ie,setGrouping:Ye,columns:H,toggleGroupField:W}),jsxRuntime.jsx(an,{anchorEl:Oe,setAnchorEl:qe,columns:H,visibleColumns:De,toggleColumnVisibility:ye}),jsxRuntime.jsx(sl,{anchorEl:lt,setAnchorEl:Ee,showSummary:xe,setShowSummary:se,columns:H,summaryColumns:te,toggleSummaryColumn:St}),jsxRuntime.jsx(cl,{contextMenu:pt,handleCloseContextMenu:Fe,columns:H,visibleColumns:De,toggleColumnVisibility:ye})]}),wt=(U,me,J)=>{let Re=i.includes(me),gt=Z==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",xr=J%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),ah=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{je({},U),j?.(U);},sx:{p:P==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Re?styles.alpha(o.palette.primary.main,.38):ah,background:Re?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${xr}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:Re?`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:Re?o.palette.primary.main:J%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:Re,onClick:Lo=>Lo.stopPropagation(),onChange:()=>je({},U),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[he?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:qg(he,U)}):null,Ve.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Ve.map(Lo=>jsxRuntime.jsx(material.Chip,{label:`${Lo.label}: ${XS(Lo,U)}`,size:"small",variant:"outlined",sx:de},`${me}-${Lo.id}`))}):null]}),M?jsxRuntime.jsx(material.Box,{onClick:Lo=>Lo.stopPropagation(),children:M(U)}):null]}),G.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:gt,gap:1},children:G.map(Lo=>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:Lo.label}),ZS(qg(Lo,U))]},`${me}-${Lo.id}-detail`))}):null,A?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:Lo=>Lo.stopPropagation(),children:A(U)})]}):null]})},me)};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:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(Ag,{...u,onVariantLoad:U=>{mt(U),u.onVariantLoad?.(U);},appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:xo}],currentLayoutId:xt,layoutRefs:[{tableKey:p,layoutId:xt}],variantService:u.variantService,serviceUrl:R??u.serviceUrl,touchMode:Z==="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":ao?{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:[a?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(rl,{filterText:ee,setFilterText:pe,onRowsPerPageChange:We,rowsPerPage:at,rowsPerPageOptions:b,page:ve,count:re,onPageChange:Pe,actions:d,extraTools:ie,grouping:Ie,setGroupAnchorEl:Ke,showSummary:xe,setShowSummary:se,setAnchorEl:qe,setSummaryAnchorEl:Ee,handleExport:K,showCreateButton:Ge,onOpenCreateDialog:Zo,showEditButton:Mt,onOpenEditDialog:Ja,editDisabled:Ce.length!==1,showDeleteButton:vt,onOpenDeleteConfirm:tn,deleteDisabled:Ce.length===0,onLayoutSave:y||u?.variantService&&u?.appId?yt:void 0,loading:m,layoutManager:L,onOpenGraphReport:N?ir: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:[Le.length===0&&!m?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,Le.map((U,me)=>{if(U.type==="group"){let gt=Ue.has(U.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:()=>st(U.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:[gt?jsxRuntime.jsx(WS__default.default,{}):jsxRuntime.jsx($S__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[U.field,": ",U.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[U.count," records"]})]}),Ie.length>1&&U.level<Ie.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:xr=>{xr.stopPropagation(),ue(U.id);},sx:Te}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:xr=>{xr.stopPropagation(),_e(U.id);},sx:Te})]}):null]})},U.id)}let J=U.data||U,Re=U.id||J[le]||me;return wt(J,Re,me)}),xe?jsxRuntime.jsx(YS,{summaryRow:q,visibleColumns:De,columns:H}):null,m?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),Ge?jsxRuntime.jsxs(material.Dialog,{open:qo,onClose:()=>!jo&&Eo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:v?.title||t("quickCreate.createWithTitle",{title:z})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Co.map(U=>{let me=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:U.label||U.id,value:_[U.id]??"",onChange:J=>Ya(U.id,J.target.value),type:me,fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0}},`quick-create-${U.id}`)}),v?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:v.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Eo(false),disabled:jo,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Qa,variant:"contained",disabled:jo,children:v?.submitLabel||t("common.save")})]})]}):null,Mt?jsxRuntime.jsxs(material.Dialog,{open:ce,onClose:()=>!He&&Be(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:w?.title||t("quickEdit.editWithTitle",{title:z})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[$t.map(U=>{let me=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:U.label||U.id,value:ge[U.id]??"",onChange:J=>Fo(U.id,J.target.value),type:me,disabled:!yr(U.id),fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0}},`quick-edit-${U.id}`)}),w?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:w.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Be(false),disabled:He,children:w?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:en,variant:"contained",disabled:He||!Ae,children:w?.submitLabel||t("common.save")})]})]}):null,vt?jsxRuntime.jsx(oi,{open:ct,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(Ce.length>1?t("quickDelete.confirmMessageMultiple",{count:Ce.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!dt&&Dt(false),onConfirm:Ca}):null,ne,N?jsxRuntime.jsx(Tl,{open:Rt,onClose:ro,model:x,aiAssistant:h?.aiAssistant,interaction:O?{enabled:true,filters:$.filters,fieldMapping:Qr,onPrimaryDimensionClick:U=>$.setFilter("primaryDimension",U),onSecondaryDimensionClick:U=>$.setFilter("secondaryDimension",U),onStatusClick:U=>$.setFilter("status",U),onClearFilter:$.clearFilter,onClearAll:$.clearAll}:void 0,tableContent:jsxRuntime.jsx(QS,{appId:oo||"graph-report-internal",title:t("graph.dataBody"),columns:F,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var Nz=({appTitle:e,children:t,menuData:o=[],workloadItems:r=[],workloadSelectedId:a,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:m,user:b,onSearch:y,onSearchAdd:u,defaultNavigationOpen:C,navOpen:p,onNavOpenChange:h,onWorkloadSelect:v,locale:w="en",localeLabel:E,localeOptions:R,onLocaleChange:T,onUserSetting:I,onUserLogout:k,userMenuItems:S,leftHeaderSlot:D,rightHeaderSlot:P})=>{let M="orbcafe:page-layout-mode",[A,j]=Kt.useState("system"),[z,V]=Kt.useState("light"),[X,Z]=Kt.useState(false),[H,ee]=Kt.useState(false),pe=A==="system"?H?z:"light":A;Kt.useEffect(()=>{Z(true);},[]),Kt.useEffect(()=>{try{let $e=window.localStorage.getItem(M);($e==="light"||$e==="dark"||$e==="system")&&j($e);}catch{}ee(true);let qe=window.matchMedia("(prefers-color-scheme: dark)"),pt=()=>{V(qe.matches?"dark":"light");};return pt(),qe.addEventListener("change",pt),()=>qe.removeEventListener("change",pt)},[]),Kt.useEffect(()=>{if(H)try{window.localStorage.setItem(M,A);}catch{}},[H,A]),Kt.useEffect(()=>{pe==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[pe]);let De=Kt.useMemo(()=>styles.createTheme({palette:pe==="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:pe==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[pe]),xe=material.useMediaQuery("(orientation: portrait)"),se=material.useMediaQuery(De.breakpoints.down("md")),te=c==="auto"?!X||xe||se?"portrait":"landscape":c,[Ie,Ye]=Kt.useState({landscape:C??true,portrait:false}),Ue=Ie[te],be=p??Ue,Ke=qe=>{p===void 0&&Ye(pt=>({...pt,[te]:qe})),h?.(qe);},lt=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!X||n&&te==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Ke(!be),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(HS__default.default,{})}):null,D]}),Ee=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,P]}),Oe=jsxRuntime.jsx(Vg,{collapsed:te==="landscape"?!be:false,onToggle:()=>Ke(!be),menuData:o,orientation:te,colorMode:pe,maxHeight:te==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:De,children:jsxRuntime.jsx(tl,{locale:w,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(m)?m:[m]],children:[jsxRuntime.jsx(ts,{appTitle:e,logo:d===void 0?null:d,mode:A,onToggleMode:()=>j(qe=>qe==="system"?"dark":qe==="dark"?"light":"system"),locale:w,localeLabel:E,localeOptions:R,onLocaleChange:T,user:b,onUserSetting:I,onUserLogout:k,userMenuItems:S,onSearch:y,onSearchAdd:u,leftSlot:lt,rightSlot:Ee}),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&&te==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Oe}):null,!X||n&&te==="portrait"?jsxRuntime.jsx(material.Drawer,{open:be,onClose:()=>Ke(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Oe}):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&&r.length>0?jsxRuntime.jsx(Fg,{items:r,selectedId:a,orientation:te,onItemSelect:v}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:te==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:De.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),te==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var Jg=bw__default.default(()=>Promise.resolve().then(()=>(Qg(),Yg)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Bd({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(Jg,{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(Jg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var Kz=Bd;var tf=Kt.createContext(null);function Tw(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 Iw({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:r,longPressMs:a=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=Kt.useState(false),[m,b]=Kt.useState(false),y=Kt.useRef(null),u=Kt.useRef(false),C=Kt.useRef(false),p=Kt.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:h,startRecording:v,stopRecording:w}=wn({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:I=>{o?.(I);},onComplete:async I=>{try{I.trim()&&(b(!0),await t(I.trim()));}catch(k){let S=k instanceof Error?k.message:"Failed to process voice command";r?.(S);}finally{b(!1),p();}},onError:I=>{r?.(I),b(!1),u.current||p();}}),E=Kt.useCallback(async()=>{C.current=false,await v();},[v]),R=Kt.useCallback(()=>{w();},[w]);Kt.useEffect(()=>{if(n)return;let I=S=>{S.isComposing||(S.code==="Space"||S.key===" ")&&(u.current||S.repeat||i&&Tw(document.activeElement)||(u.current=true,S.preventDefault(),y.current=setTimeout(()=>{C.current=true,f(true),v();},a)));},k=S=>{(S.code==="Space"||S.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),u.current=false,C.current&&(S.preventDefault(),f(false),w()));};return window.addEventListener("keydown",I),window.addEventListener("keyup",k),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",k),y.current&&(clearTimeout(y.current),y.current=null);}},[n,i,a,v,w]);let T=Kt.useMemo(()=>({isRecording:h,isHotkeyRecording:g,isSubmitting:m,startRecording:E,stopRecording:R}),[g,h,m,E,R]);return jsxRuntime.jsxs(tf.Provider,{value:T,children:[c?jsxRuntime.jsx(Bd,{isRecording:g}):null,e]})}function Pw(){let e=Kt.useContext(tf);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var Yz=Iw,Qz=Pw;function Xe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Fw=({content:e,theme:t="light",size:o="base",defaultExpanded:r=false})=>{let[a,n]=Kt.useState(r),i=Kt.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(!a),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 ${a?"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"})})]}),a&&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})]})},of=Fw;var $w=({content:e,language:t="text",isStreaming:o=false,className:r=""})=>{let{theme:a}=nextThemes.useTheme(),[n,i]=Kt.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=a==="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",r),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:a==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},af=$w;var _w=({content:e,isLoading:t,className:o="",style:r})=>{let a=Kt.useRef(null),[n,i]=Kt.useState(false),[c,d]=Kt.useState(null),{theme:l}=nextThemes.useTheme();return Kt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!a.current)){i(true),d(null);try{lf__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await lf__default.default.render(f,m);a.current&&(a.current.innerHTML=b);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),a.current&&(a.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:r,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:r,ref:a})},cf=_w;var Qw=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:r,icon:a,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=Kt.useState(false),[f,m]=Kt.useState(false),b=async()=>{if(c){m(true);try{await c();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(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:a||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||r)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:b,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"]}),r&&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"})})]}),r&&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:r})})]})},Ps=Qw;var a1=({title:e="\u8B66\u544A",content:t,warningType:o,severity:r="warning",warnings:a=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...g})=>{let f=()=>{switch(r){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"}}},m=()=>{switch(r){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"})}},b=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 ${b.borderLeftColor} ${b.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||m()}),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}),a&&a.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:a.map((y,u)=>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:y})]},u))})]}),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"})})]})},Rs=a1;var s1=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:r,maxDisplay:a=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=Kt.useState(false),[f,m]=Kt.useState(""),[b,y]=Kt.useState(false),u=Kt.useMemo(()=>f.trim()?o.filter(h=>h.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=Kt.useMemo(()=>s?u:u.slice(0,a),[u,s,a]),p=h=>{r?.(h);};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:()=>y(!b),className:`p-1.5 rounded-md transition-colors ${b?"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:b?"\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"})})]})]}),b&&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:h=>m(h.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((h,v)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>p(h),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:h}),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"})]})},v))}),u.length>a&&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 (${u.length})`}),u.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"})]})]})},Ms=s1;var f1=({title:e,content:t,toolName:o,parameters:r,result:a,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...m})=>{let[b,y]=Kt.useState(false),[u,C]=Kt.useState(true),p=()=>{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"}}},h=()=>{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"})}},v=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",w=p(),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}`,...m,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 ${w.iconColor}`,children:c||h()}),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 ${w.badgeBg} ${w.badgeText}`,children:w.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"}),v(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}),r&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>y(!b),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:[b?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"]}),b&&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(r,null,2)})})]}),a&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>C(!u),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:[u?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"]}),u&&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 a=="string"?a:JSON.stringify(a,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"})})]})]})},Ds=f1;var b1=({data:e})=>{if(!e)return null;let t=Kt.useMemo(()=>{let o=[],r=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(r=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"&&(a=e.title||a,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?r=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(r=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:a,columns:r,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(ca,{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]})})},As=b1;var I1=({title:e,subtitle:t,data:o,type:r,config:a={}})=>{let n=()=>{switch(r){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&&r!=="google-map-card"&&r!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(r){case "bar-chart-card":return jsxRuntime.jsx(pi,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return jsxRuntime.jsx(qu,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.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(bl,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return jsxRuntime.jsx(ju,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Xu,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(Qu,{branches:o,effect:a.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(ep,{data:o,height:a.height});case "google-map-card":return jsxRuntime.jsx(rp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||e,height:a.height});case "amap-card":return jsxRuntime.jsx(lp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||e,height:a.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",r]})}}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)})]})})]})]})},Bs=I1;var R1=({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)})})})]}),Fs=R1;var Ls=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 F1=({content:e,theme:t,size:o="base",className:r,enableCodeHighlight:a=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Kt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(f,m,b,y,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:m,title:b,payload:y,rawData:u});},s=(f,m,b,y,u,C)=>{if(!(!u&&!c?.onCardEvent))return (...p)=>{let h=u?.(...p),v=C?C(...p):void 0;return l(f,m,b,v,y),h}},g=Kt.useMemo(()=>({div(f){let{"data-component":m,"data-think-content":b,...y}=f;return m==="thinkbox"&&b?jsxRuntime.jsx(of,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...y})},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:m}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:m}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:m,children:b,...y}){let u=/language-([\w-]+)/.exec(m||""),C=u?u[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",...y,children:b});let p=String(b).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(cf,{content:p});if(C==="json"){let h=Ls(p);if(h)switch(h.type){case "table":return jsxRuntime.jsx(As,{data:h.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(Bs,{...h});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Fs,{...h});case "error-card":{let v=h;return jsxRuntime.jsx(Ps,{...v,onClose:s("error-card","close",v.title,v,v.onClose),onRetry:s("error-card","retry",v.title,v,v.onRetry)})}case "warning-card":{let v=h,w=v.onConfirm?s("warning-card","confirm",v.title,v,v.onConfirm):v.actionText&&c?.onCardEvent?s("warning-card","confirm",v.title,v):void 0;return jsxRuntime.jsx(Rs,{...v,onClose:s("warning-card","close",v.title,v,v.onClose),onConfirm:w})}case "suggestions-card":{let v=h;return jsxRuntime.jsx(Ms,{...v,onClose:s("suggestions-card","close",v.title,v,v.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",v.title,v,v.onSuggestionClick,w=>({suggestion:w}))})}case "tool-result-card":{let v=h;return jsxRuntime.jsx(Ds,{...v,onClose:s("tool-result-card","close",v.title,v,v.onClose),onAction:s("tool-result-card","action",v.title,v,v.onAction)})}}}return a?jsxRuntime.jsx(af,{content:p,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:m,...y,children:b})}}),[t,o,n,a,c,i]);return jsxRuntime.jsx("div",{className:Xe("markdown-body prose dark:prose-invert max-w-none",r),children:jsxRuntime.jsx(M1__default.default,{remarkPlugins:[D1__default.default,A1__default.default],rehypePlugins:[B1__default.default,E1__default.default],components:g,children:d})})},zs=F1;var L1=({content:e,messageId:t,cardHooks:o})=>{let r=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},a=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let m=s?.(...f),b=g?g(...f):void 0;return r(i,c,d,b,l),m}},n=Ls(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(As,{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(Bs,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Fs,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Ps,{...i,onClose:a("error-card","close",i.title,i,i.onClose),onRetry:a("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?a("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?a("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(Rs,{...i,onClose:a("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Ms,{...i,onClose:a("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(Ds,{...i,onClose:a("tool-result-card","close",i.title,i,i.onClose),onAction:a("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(zs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},xf=L1;var Hd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let r=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return r||a||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"}}},N1=({content:e,className:t="",messageId:o,cardHooks:r})=>{let a=Kt__namespace.default.useMemo(()=>Hd.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:a.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(xf,{content:n.content,messageId:o,cardHooks:r},`block-${i}`):jsxRuntime.jsx(zs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r},`block-${i}`))})},vf=N1;var O1=({content:e,isStreaming:t=true,onComplete:o,className:r="",streamIntervalMs:a=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=Kt.useState(t?0:e.length),[s,g]=Kt.useState(!t);Kt.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),Kt.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{l(C=>Math.min(C+n,e.length));},a);return ()=>{window.clearTimeout(u);}},[e.length,s,t,o,n,a,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},m=t?e.slice(0,d):e,b=t&&!s,y=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${r}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(vf,{content:m,messageId:i,cardHooks:c}),b&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),y&&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"})]})},wf=O1;var Tf=({buttons:e,className:t})=>{let o=r=>{switch(r){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((r,a)=>jsxRuntime.jsx("button",{onClick:r.onClick,disabled:r.disabled,"aria-busy":r.loading||void 0,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",r.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",r.type==="refresh"&&r.loading&&"animate-spin"),title:r.type,type:"button",children:o(r.type)},`${r.type}-${a}`))})};var Ns=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:r,streamChunkSize:a,cardHooks:n})=>{if(e.type==="assistant"){let i=!!(o?.isResponding||e.isStreaming);return 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(wf,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:r,streamChunkSize:a,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(Tf,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:i||!o?.onRegenerate,loading:i},{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()})]})})}return 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 Pf=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:r,className:a})=>{let{isRecording:n,startRecording:i,stopRecording:c}=wn({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:r,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",r&&"opacity-50 cursor-not-allowed",a),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(K1__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(U1__default.default,{sx:{fontSize:24}})})};var _t={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")},J1={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},eT=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Xe(_t.buttonBase,_t.buttonSmall,_t.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(CC__default.default,{sx:{fontSize:24}})}),tT=()=>jsxRuntime.jsxs("button",{className:Xe(_t.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",_t.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(Q1__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),oT=({canSend:e,isResponding:t,onSend:o,onStop:r})=>t?jsxRuntime.jsx("button",{className:Xe(_t.buttonBase,_t.buttonSmall,_t.stopButton),onClick:r,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Xe(_t.buttonBase,_t.buttonSmall,e?_t.sendButton:_t.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(X1__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Rf=({onSend:e,onStop:t,isResponding:o=false,placeholder:r,getText:a})=>{let[n,i]=Kt.useState(""),[c,d]=Kt.useState([]),[l,s]=Kt.useState(false),[g,f]=Kt.useState(false),m=Kt.useRef(null),b=r||(a?a("00019","Type a message..."):"Type a message..."),y=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},C=Kt.useCallback(A=>{i(A.target.value),A.target.style.height="auto",A.target.style.height=`${Math.min(A.target.scrollHeight,200)}px`;},[]),p=Kt.useCallback(A=>{if(A.target.files&&A.target.files.length>0){let j=Array.from(A.target.files);d(z=>{let V=j.filter(Z=>z.some(H=>H.name===Z.name&&H.size===Z.size));V.length>0&&console.warn("Duplicate files ignored:",V.map(Z=>Z.name));let X=j.filter(Z=>!z.some(H=>H.name===Z.name&&H.size===Z.size));return [...z,...X]}),m.current&&(m.current.value="");}},[]),h=Kt.useCallback(A=>{d(j=>j.filter((z,V)=>V!==A));},[]),v=Kt.useCallback(()=>{m.current?.click();},[]),w=Kt.useCallback(async()=>{if(!y)return;let A=n,j=[...c];i(""),d([]),m.current&&(m.current.value="");try{await e(A,j);}catch(z){console.error("Failed to send message:",z),i(A),d(j);}},[n,y,e,c]),E=Kt.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&!l&&(A.preventDefault(),w());},[w,l]),R=Kt.useCallback(()=>{s(true);},[]),T=Kt.useCallback(()=>{s(false);},[]),I=Kt.useCallback(A=>{i(A);},[]),k=Kt.useCallback(A=>{i(A);},[]),S=Kt.useCallback(()=>{},[]),D=Kt.useCallback(A=>{A.preventDefault(),f(true);},[]),P=Kt.useCallback(A=>{A.preventDefault(),f(false);},[]),M=Kt.useCallback(A=>{if(A.preventDefault(),f(false),A.dataTransfer.files&&A.dataTransfer.files.length>0){let j=Array.from(A.dataTransfer.files);d(z=>[...z,...j]);}},[]);return jsxRuntime.jsx("div",{className:_t.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:p}),jsxRuntime.jsxs("div",{className:Xe(_t.inputContainer,g&&_t.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:P,onDrop:M,children:[c.length>0&&jsxRuntime.jsx("div",{className:_t.filePreviewArea,children:c.map((A,j)=>jsxRuntime.jsxs("div",{className:_t.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:A.name}),jsxRuntime.jsx("button",{onClick:()=>h(j),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${A.name}-${j}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Xe(_t.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Xe(_t.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:C,onKeyDown:E,onCompositionStart:R,onCompositionEnd:T,style:J1,"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(eT,{enabled:u.enabled,onClick:v}),jsxRuntime.jsx(tT,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Pf,{onTextUpdate:I,onComplete:k,onCancel:S,disabled:o,className:_t.buttonSmall}),jsxRuntime.jsx(oT,{canSend:y,isResponding:o,onSend:w,onStop:t})]})]})]})]})]})})};var Af=({messages:e,onSend:t,onStop:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=Kt.useRef(null),m=Kt.useRef(e.length);return Kt.useEffect(()=>{e.length>m.current&&f.current?.scrollIntoView({behavior:"smooth"}),m.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((b,y)=>{let u=b.type==="assistant"&&y===e.length-1,C=b.type==="assistant"?{isLatestAssistant:u,isResponding:a,onRegenerate:r?()=>r(b.id):void 0}:void 0;return jsxRuntime.jsx(Ns,{message:b,assistantActions:C,onStreamingComplete:()=>l?.(b.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},b.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(Rf,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:i})})]})};var Ko={};var nT={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},Bf=({title:e="AI Agent",description:t,headerActions:o,className:r,agentStatus:a,onHeaderPointerDown:n,showInput:i=false,...c})=>{let d=a??(c.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Xe("relative flex h-full w-full",Ko.agentPanel,r),"data-status":d,children:[jsxRuntime.jsx("div",{className:Ko.colorHalo,"data-status":d,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Ko.marqueeBorder,"data-status":d,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.top)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.right)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.bottom)}),jsxRuntime.jsx("span",{className:Xe(Ko.edge,Ko.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:Xe("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",n&&"cursor-grab active:cursor-grabbing"),onPointerDown:n,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:Ko.statusDot,"data-status":d}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:nT[d]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Af,{...c,showInput:i})})]})]})};var Lf=520,sT=88,cT=88,dT=24,Hs=640,zf=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),Gd=e=>typeof e=="number"?`${e}px`:e,uT=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,MV=({anchor:e,defaultAnchor:t="right",onAnchorChange:o,width:r=Lf,top:a=sT,bottom:n=cT,inset:i=dT,zIndex:c=1300,shellClassName:d,shellStyle:l,className:s,onHeaderPointerDown:g,...f})=>{let m=Kt.useRef(null),b=Kt.useRef(null),[y,u]=Kt.useState(t),[C,p]=Kt.useState(0),[h,v]=Kt.useState(typeof r=="number"?r:Lf),[w,E]=Kt.useState(0),[R,T]=Kt.useState(false),I=e??y;Kt.useEffect(()=>{let z=()=>p(window.innerWidth);return z(),window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),Kt.useLayoutEffect(()=>{let z=()=>{let X=m.current?.getBoundingClientRect();X?.width?v(X.width):typeof r=="number"&&v(r);};if(z(),!m.current||typeof ResizeObserver>"u")return;let V=new ResizeObserver(z);return V.observe(m.current),()=>V.disconnect()},[r]);let k=Kt.useCallback(z=>{if(!C)return i;let V=C<Hs?12:i,X=Math.max(V,C-h-V);return C<Hs||z==="left"?V:z==="center"?zf((C-h)/2,V,X):X},[i,h,C]),S=Kt.useCallback(z=>["left","center","right"].reduce((X,Z)=>{let H=Math.abs(z-k(X));return Math.abs(z-k(Z))<H?Z:X},"right"),[k]),D=Kt.useCallback(z=>{e===void 0&&u(z),o?.(z);},[e,o]);Kt.useEffect(()=>{R||E(k(I));},[k,R,I]);let P=Kt.useCallback(z=>{g?.(z),!(z.defaultPrevented||uT(z.target))&&(z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId),b.current={pointerId:z.pointerId,startClientX:z.clientX,startX:w,currentX:w,captureElement:z.currentTarget},T(true));},[g,w]),M=Kt.useCallback(z=>{let V=b.current;if(!V||V.pointerId!==z.pointerId)return;let X=C<Hs?12:i,Z=Math.max(X,C-h-X),H=zf(V.startX+z.clientX-V.startClientX,X,Z);V.currentX=H,E(H);},[i,h,C]),A=Kt.useCallback(z=>{let V=b.current;if(!V||V.pointerId!==z.pointerId)return;try{V.captureElement.releasePointerCapture(z.pointerId);}catch{}let X=S(V.currentX);b.current=null,T(false),D(X),E(k(X));},[k,D,S]),j=Kt.useMemo(()=>({position:"fixed",top:Gd(a),bottom:Gd(n),left:w,width:Gd(r),maxWidth:`calc(100vw - ${C<Hs?24:i*2}px)`,zIndex:c,pointerEvents:"auto",transition:R?"none":"left 180ms ease-out",touchAction:"none",...l}),[n,i,R,w,l,a,C,r,c]);return jsxRuntime.jsx("div",{ref:m,className:Xe("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":I,"data-dragging":R?"true":"false",style:j,onPointerMove:M,onPointerUp:A,onPointerCancel:A,children:jsxRuntime.jsx(Bf,{...f,className:s,onHeaderPointerDown:P})})};var hT={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},NV=({messages:e,onSend:t,onRegenerate:o,isResponding:r=false,className:a,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:m,onMessageStreamingComplete:b,cardHooks:y})=>{let[u,C]=Kt.useState(""),[p,h]=Kt.useState(false),v=Kt.useRef(null),w=hT[c];Kt.useEffect(()=>{v.current?.scrollIntoView({behavior:"smooth"});},[e,r]);let E=Kt.useCallback(async()=>{let T=u.trim();!T||r||(C(""),await t(T));},[r,t,u]),R=Kt.useCallback(async T=>{T.key==="Enter"&&!p&&(T.preventDefault(),await E());},[E,p]);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",a),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",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="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]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="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((T,I)=>{let k=T.type==="assistant"&&I===e.length-1,S=T.type==="assistant"?{isLatestAssistant:k,isResponding:r,onRegenerate:o?()=>o(T.id):void 0}:void 0;return jsxRuntime.jsx(Ns,{message:T,assistantActions:S,onStreamingComplete:()=>b?.(T.id),streamIntervalMs:f,streamChunkSize:m,cardHooks:y},T.id)}),jsxRuntime.jsx("div",{ref:v})]}),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:u,onChange:T=>C(T.target.value),onCompositionStart:()=>h(true),onCompositionEnd:()=>h(false),onKeyDown:R,"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 bT=["#ff3860","#24e070","#3090ff"],yT=`
|
|
199
199
|
.orbcafe-ai-browser-glow {
|
|
200
200
|
position: fixed;
|
|
201
201
|
inset: 0;
|
|
@@ -249,4 +249,4 @@ ${o}: ${(r??a)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Mat
|
|
|
249
249
|
0%, 100% { opacity: 0.68; }
|
|
250
250
|
50% { opacity: 0.98; }
|
|
251
251
|
}
|
|
252
|
-
`,a4=({active:e=false,colors:t=q1,zIndex:o=2147483e3})=>{let a={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:_1}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:a,"aria-hidden":"true"})]})};var l4=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=Kt.useState(e),[i,c]=Kt.useState(false),d=Kt.useCallback(async m=>{c(true);try{await m?.();}finally{c(false);}},[]),l=Kt.useCallback(m=>d(()=>t?.(m)),[t,d]),s=Kt.useCallback(m=>d(()=>o?.(m)),[o,d]),g=Kt.useCallback(m=>d(()=>a?.(m)),[a,d]),f=Kt.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 Bd=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Wi=Kt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Wi.displayName="CPaper";var sT={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."},P4=({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,m]=Kt.useState(t),h=e??f,C=Kt.useMemo(()=>({...sT,...d}),[d]),[u,v]=Kt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[p,b]=Kt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,T]=Kt.useState({email:""}),[F,R]=Kt.useState(""),S=M=>{g||m(M),R(""),o?.(M);},I=async M=>{M.preventDefault(),await a?.(u),R("Demo login accepted. No real authentication request was sent.");},k=async M=>{M.preventDefault(),await r?.(p),R("Demo registration saved locally for this screen.");},w=async M=>{M.preventDefault(),await n?.(y),R("Demo reset link request created. No email was sent.");},A=h==="login"?C.loginTitle:h==="register"?C.registerTitle:C.forgotTitle,P=h==="login"?C.loginSubtitle:h==="register"?C.registerSubtitle:C.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:C.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:C.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:C.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(Wi,{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:A}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:P})]}),F&&jsxRuntime.jsx(material.Alert,{severity:"success",children:F}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Email or user ID",value:u.username,onChange:M=>v(B=>({...B,username:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(wf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Password",type:"password",value:u.password,onChange:M=>v(B=>({...B,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(iT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(Bd,{label:"Remember me",checked:u.remember,onChange:M=>v(B=>({...B,remember:M.target.checked}))}),jsxRuntime.jsx(ia,{type:"button",variant:"text",size:"small",onClick:()=>S("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(ia,{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(ia,{type:"button",variant:"text",size:"small",onClick:()=>S("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:k,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Full name",value:p.name,onChange:M=>b(B=>({...B,name:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(wf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Work email",type:"email",value:p.email,onChange:M=>b(B=>({...B,email:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Sf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Password",type:"password",value:p.password,onChange:M=>b(B=>({...B,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(lT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Confirm password",type:"password",value:p.confirmPassword,onChange:M=>b(B=>({...B,confirmPassword:M.target.value}))}),jsxRuntime.jsx(Bd,{label:"I accept the demo workspace terms",checked:p.acceptedTerms,onChange:M=>b(B=>({...B,acceptedTerms:M.target.checked}))}),jsxRuntime.jsx(ia,{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(ia,{type:"button",variant:"text",size:"small",onClick:()=>S("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:w,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Work email",type:"email",value:y.email,onChange:M=>T({email:M.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Sf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ia,{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(ia,{type:"button",variant:"text",size:"small",onClick:()=>S("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 dT={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},uT=[{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"}],Tf=({tasks:e,appId:t,tableKey:o,defaultScale:a="week",defaultSelectedTaskId:r,initialFilters:n,filterFields:i,filterAppId:c,filterTableKey:d,serviceUrl:l,variantService:s,layout:g,columns:f,page:m,rowsPerPage:h,rowsPerPageOptions:C,count:u,onPageChange:v,onRowsPerPageChange:p,onFilterSearch:b,onFilterVariantLoad:y,enableRowReorder:T,onTaskReorder:F,onLayoutIdChange:R,onLayoutSave:S})=>{let I=t??c??"planning-gantt",k=o??d??"planning",[w,A]=Kt.useState(a),[P,M]=Kt.useState(r??e[0]?.id??""),[B,j]=Kt.useState(""),[O,K]=Kt.useState(null),[ee,le]=Kt.useState({...dT,...n}),G=Kt.useMemo(()=>{let oe=String(ee.keyword?.value??"").trim().toLowerCase(),ye=String(ee.status?.value??"").trim(),Ge=String(ee.owner?.value??"").trim().toLowerCase(),de=String(ee.workCenter?.value??"").trim().toLowerCase(),Te=ee.dateRange?.value,$e=Te?.[0]?Ia__default.default(Te[0]):null,ct=Te?.[1]?Ia__default.default(Te[1]):null;return e.filter(fe=>{if(oe&&![fe.id,fe.code,fe.title,fe.project,fe.workCenter,fe.owner?.name].join(" ").toLowerCase().includes(oe)||ye&&fe.status!==ye||Ge&&!String(fe.owner?.name??"").toLowerCase().includes(Ge)||de&&!String(fe.workCenter??"").toLowerCase().includes(de))return false;if($e||ct){let Le=Ia__default.default(fe.startDate),_e=Ia__default.default(fe.endDate),dt=$e?_e.isAfter($e)||_e.isSame($e,"day"):true,at=ct?Le.isBefore(ct)||Le.isSame(ct,"day"):true;if(!dt||!at)return false}return true})},[ee,e]);Kt.useEffect(()=>{G.length!==0&&(G.some(oe=>oe.id===P)||M(G[0].id));},[G,P]);let te=Kt.useCallback(oe=>{M(oe.id);},[]),me=Kt.useCallback(oe=>{j(oe),R?.(oe);},[R]),we=Kt.useCallback(oe=>{K(ye=>({key:(ye?.key??0)+1,variant:oe})),y?.(oe);},[y]),Ce=Kt.useMemo(()=>({appId:I,tableKey:k,fields:i??uT,filters:ee,onFilterChange:le,onVariantLoad:we,onSearch:b??(()=>{}),currentLayoutId:B,layoutRefs:[{tableKey:k,layoutId:B||null}],variantService:s,serviceUrl:l}),[B,i,ee,we,b,I,k,l,s]),ae=Kt.useMemo(()=>({appId:I,tableKey:k,serviceUrl:l,tasks:G,columns:f,scale:w,onScaleChange:A,page:m,rowsPerPage:h,rowsPerPageOptions:C,count:u,onPageChange:v,onRowsPerPageChange:p,selectedTaskId:P,onTaskSelect:te,enableRowReorder:T,onTaskReorder:F,layout:g,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:me,onLayoutSave:S}),[f,u,T,G,me,g,O?.key,O?.variant,v,p,S,F,te,m,I,k,h,C,w,l,P]);return {scale:w,setScale:A,selectedTaskId:P,setSelectedTaskId:M,filters:ee,setFilters:le,filteredTasks:G,smartFilterProps:Ce,planningGanttProps:ae}};var L4=e=>{let t=Tf(e),o=Kt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var If=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var hr=Kt.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});hr.displayName="CIconButton";var Rf=({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))})]});Ia__default.default.extend(ST__default.default);var Vd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Od=56,Ur=58,Ui=8,Hd=260,qT=320,zs="0.85rem",Kr="220ms cubic-bezier(0.2, 0, 0, 1)",Af={"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"}},_T=e=>e?Af[e]?.label??e:"Planned",jT=e=>e?Af[e]?.color??"default":"info",Bf=e=>Math.min(100,Math.max(0,e??0)),Ff=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Ff(o.children??[],t+1)]),ZT=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:_T(e.status),statusTone:e.status??"planned",progress:Bf(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),Ef=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Lf=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),XT=(e,t,o)=>{let a=[],r=Ef(e,o),n=Lf(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"),contextLabel:o==="hour"?r.format("MMM D"):o==="day"?r.format("MMM"):o==="week"?`W${r.isoWeek()}`:void 0,title:o==="hour"?r.format("MMM D, YYYY HH:mm"):o==="day"?r.format("MMM D, YYYY"):o==="week"?`${r.format("MMM D, YYYY")} - Week ${r.isoWeek()}`:void 0,start:r,end:i}),r=i;}return a},Wd=(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},zf=({appId:e="planning-gantt",tableKey:t="planning",serviceUrl:o,title:a="Project Plan",extraTools:r,bodyHeight:n=560,tasks:i,columns:c,scale:d="week",onScaleChange:l,page:s,rowsPerPage:g=20,rowsPerPageOptions:f=[20,50,100,-1],count:m,onPageChange:h,onRowsPerPageChange:C,timelineStart:u,timelineEnd:v,selectedTaskId:p,onTaskSelect:b,enableRowReorder:y=true,onTaskReorder:T,layout:F,layoutVariant:R,layoutVariantLoadKey:S,onLayoutIdChange:I,onLayoutSave:k,emptyLabel:w="No planning tasks available.",sx:A})=>{let P=material.useTheme(),{t:M}=re(),B=Kt.useRef(null),j=Kt.useRef(null),O=Kt.useRef(null),K=Kt.useRef(false),[ee,le]=Kt.useState(null),[G,te]=Kt.useState("content"),[me,we]=Kt.useState(null),[Ce,ae]=Kt.useState(0),[oe,ye]=Kt.useState({}),[Ge,de]=Kt.useState(Od),[Te,$e]=Kt.useState([]),ct=Kt.useRef(void 0),[fe,Le]=Kt.useState({activeId:null,overId:null}),[_e,dt]=Kt.useState(null),[at,Z]=Kt.useState(false),Ne=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),_=Kt.useRef(null),Q=Kt.useMemo(()=>Ff(i),[i]),Re=Kt.useMemo(()=>{if(Te.length===0)return Q;let D=new Map(Q.map(ue=>[ue.id,ue])),q=Te.map(ue=>D.get(ue)).filter(ue=>!!ue),Y=new Set(q.map(ue=>ue.id));return [...q,...Q.filter(ue=>!Y.has(ue.id))]},[Q,Te]),Be=Kt.useMemo(()=>new Map(Re.map(D=>[D.id,D])),[Re]),rt=Kt.useMemo(()=>Re.map(D=>ZT(D)),[Re]),it=Kt.useMemo(()=>new Map(rt.map(D=>[D.id,D])),[rt]),gt=Kt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(D,q)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:q.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:q.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(D,q)=>jsxRuntime.jsx(If,{label:q.status,color:jT(q.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:D=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[D,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:D,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Et=Kt.useMemo(()=>{if(!c||c.length===0)return gt;let D=new Map(gt.map(q=>[q.id,q]));return c.map(q=>{let Y=D.get(q.id),ue=q.width??Y?.minWidth??120,Ee={id:q.id,label:q.label,minWidth:ue};if(Y?.numeric&&(Ee.numeric=true),q.render){let We=q.render;return Ee.render=(Qe,he)=>{let je=Be.get(he.id);return We(je||he)},Ee}return Y?.render?(Ee.render=Y.render,Ee):(Ee.render=(We,Qe)=>{let he=Qe[q.id];if(he!=null&&String(he).length>0)return String(he);let nt=Be.get(Qe.id)?.[q.id];return nt!=null&&String(nt).length>0?String(nt):"-"},Ee)})},[c,gt,Be]),U=hn({appId:e,tableKey:t,title:a,columns:Et,rows:rt,rowKey:"id",page:s,rowsPerPage:g,rowsPerPageOptions:f,count:m??rt.length,onPageChange:h,onRowsPerPageChange:C,showSummary:false,layout:F,onLayoutSave:k}),ze=e?jsxRuntime.jsx(fn,{appId:e,tableKey:t,currentLayoutData:U.currentLayoutData,onLayoutLoad:U.handleLayoutLoad,targetLayoutId:U.layoutIdToLoad,activeLayoutId:U.currentLayoutId,serviceUrl:o}):null,Ae=U.visibleRows,ft=U.rowsPerPage===-1?1:Math.max(1,Math.ceil(U.totalDisplayCount/U.rowsPerPage)),H=Math.max(0,Math.min(U.page,ft-1)),xe=Math.min(H+1,ft),Ke=H>0,et=H<ft-1&&U.rowsPerPage!==-1;Kt.useEffect(()=>{let D=Q.map(q=>q.id);$e(q=>{let Y=new Set(D),ue=q.filter(he=>Y.has(he)),Ee=new Set(ue),We=D.filter(he=>!Ee.has(he)),Qe=[...ue,...We];return Qe.length===q.length&&Qe.every((he,je)=>he===q[je])?q:Qe});},[Q]),Kt.useEffect(()=>{S===void 0||!R||ct.current!==S&&(ct.current=S,U.handleVariantLoad(R));},[U,R,S]),Kt.useEffect(()=>{I?.(U.currentLayoutId);},[U.currentLayoutId,I]);let Ct=D=>D.type==="group"?`group-${D.id}`:`row-${(D.data||D)?.id}`,It=Kt.useMemo(()=>{let D=rt.map(je=>Ia__default.default(je.startDate)),q=rt.map(je=>Ia__default.default(je.endDate)),Y=u?Ia__default.default(u):D.reduce((je,nt)=>nt.isBefore(je)?nt:je,D[0]??Ia__default.default()),ue=v?Ia__default.default(v):q.reduce((je,nt)=>nt.isAfter(je)?nt:je,q[0]??Ia__default.default().add(30,"day")),Ee=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",We=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Qe=d==="hour"?12:1,he=d==="hour"?12:1;return {start:Ef(Y.subtract(Qe,Ee),d),end:Lf(ue.add(he,We),d)}},[rt,d,v,u]),oo=Vd.find(D=>D.value===d)??Vd[1],xo=Array.isArray(r)?r:r?[r]:[],bt=Kt.useMemo(()=>XT(It.start,It.end,d),[It.end,It.start,d]),ra=bt.length*oo.width,Pt=bt.length>0?100/bt.length:100,na=bt.length>0?`repeat(${bt.length}, minmax(${oo.width}px, 1fr))`:"1fr",ao=bt.length>0?`calc(100% / ${bt.length}) 100%`:"100% 100%",z=(U.columns||[]).filter(D=>U.visibleColumns.includes(D.id)).reduce((D,q)=>D+(U.columnWidths?.[q.id]||q.minWidth||100),0),N=G==="manual"&&ee!==null?ee:z,V=me==="table",ce=me==="timeline",pe=me==="timeline",Pe=me==="table",ke=!pe&&!Pe,Fe=()=>{let D=Ce||B.current?.clientWidth||0;return D>0?Math.max(Hd,D-Ui-qT):Math.max(Hd,z)},Ue=D=>Math.min(Math.max(D,Hd),Fe()),yt=(()=>{if(Ce<=0)return null;let D=ke?Ui:0;if(V)return {tableWidth:Ce,splitterWidth:D,timelineWidth:0};if(ce)return {tableWidth:0,splitterWidth:D,timelineWidth:Ce};if(G==="even"){let Y=Math.max(0,(Ce-D)/2);return {tableWidth:Y,splitterWidth:D,timelineWidth:Math.max(0,Ce-D-Y)}}let q=Ue(N);return {tableWidth:q,splitterWidth:D,timelineWidth:Math.max(0,Ce-D-q)}})(),Tt=yt?`${yt.tableWidth}px ${yt.splitterWidth}px ${yt.timelineWidth}px`:V?"minmax(0, 1fr) 0px 0px":ce?"0px 0px minmax(0, 1fr)":G==="even"?`minmax(0, 1fr) ${Ui}px minmax(0, 1fr)`:`${N}px ${Ui}px minmax(0, 1fr)`;Kt.useEffect(()=>{G==="manual"&&le(D=>D===null?null:Ue(D));},[G,z,Ce]);let ht=D=>{D.preventDefault(),D.currentTarget.setPointerCapture(D.pointerId),we(null),te("manual"),_.current={startX:D.clientX,startWidth:j.current?.getBoundingClientRect().width??N};let q=ue=>{let Ee=_.current;if(!Ee)return;let We=Ue(Ee.startWidth+ue.clientX-Ee.startX);le(We);},Y=()=>{_.current=null,window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",Y),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",q),window.addEventListener("pointerup",Y);},Po=()=>{we(null),te("even"),le(null);},_t=D=>!y||!D?false:it.get(D)?.reorderable!==false,Nt=(D,q)=>{if(!D||!q||D===q||!_t(D)||!_t(q))return false;if(U.grouping.length===0)return true;let Y=it.get(D),ue=it.get(q);return !Y||!ue?false:U.grouping.every(Ee=>Y[Ee]===ue[Ee])},vo=(D,q)=>{if(!Nt(D,q))return;let Y=Ae.filter(lt=>lt.type!=="group").map(lt=>String((lt.data||lt)?.id)),ue=Y.indexOf(D),Ee=Y.indexOf(q);if(ue<0||Ee<0)return;let We=[...Y];[We[ue],We[Ee]]=[We[Ee],We[ue]];let Qe=new Set(Y),he=Re.map(lt=>lt.id),je=[...We,...he.filter(lt=>!Qe.has(lt))],nt=Be.get(D),Mt=Be.get(q);if(U.setOrder("asc"),U.setOrderBy(""),$e(je),nt&&Mt){let{level:lt,...Jt}=nt,{level:ro,...Co}=Mt,$t=je.reduce((no,xt)=>{let Zt=Be.get(xt);if(Zt){let{level:ba,...Zo}=Zt;no.push(Zo);}return no},[]);T?.($t,{activeTask:Jt,targetTask:Co});}},jt=(D,q)=>{if(!_t(q.id)){D.preventDefault();return}D.stopPropagation(),D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",q.id),Le({activeId:q.id,overId:null}),b?.(Be.get(q.id)||q);},tt=(D,q)=>{if(!Nt(fe.activeId,q)){Le(Y=>Y.overId===null?Y:{...Y,overId:null});return}D.preventDefault(),D.stopPropagation(),D.dataTransfer.dropEffect="move",Le(Y=>Y.overId===q?Y:{...Y,overId:q});},_o=(D,q)=>{let Y=fe.activeId||D.dataTransfer.getData("text/plain");if(!Nt(Y,q)){Le({activeId:null,overId:null});return}D.preventDefault(),D.stopPropagation(),vo(Y,q),Le({activeId:null,overId:null});},Fo=()=>{Le({activeId:null,overId:null});},jo=D=>{if(K.current)return;let q=D==="table"?j.current:O.current,Y=D==="table"?O.current:j.current;!q||!Y||(K.current=true,Y.scrollTop=q.scrollTop,window.requestAnimationFrame(()=>{K.current=false;}));};return Kt.useLayoutEffect(()=>{let D=B.current;if(!D){ae(0);return}let q=0,Y=()=>{window.cancelAnimationFrame(q),q=window.requestAnimationFrame(()=>{let Ee=D.clientWidth;ae(We=>Math.abs(We-Ee)<.5?We:Ee);});};if(Y(),typeof ResizeObserver>"u")return window.addEventListener("resize",Y),()=>{window.cancelAnimationFrame(q),window.removeEventListener("resize",Y);};let ue=new ResizeObserver(Y);return ue.observe(D),window.addEventListener("resize",Y),()=>{window.cancelAnimationFrame(q),ue.disconnect(),window.removeEventListener("resize",Y);}},[rt.length]),Kt.useLayoutEffect(()=>{if(!p||Pe)return;let D=O.current,q=j.current;if(!D)return;let Y=`row-${p}`,ue=Array.from(D.querySelectorAll("[data-planning-timeline-row-key]")).find(Qe=>Qe.dataset.planningTimelineRowKey===Y),Ee=it.get(p);if(!ue||!Ee)return;let We=window.requestAnimationFrame(()=>{let Qe=D.getBoundingClientRect(),he=ue.getBoundingClientRect(),je=Math.max(1,D.clientHeight-Ge),nt=D.scrollTop+he.top-Qe.top-Ge-(je-he.height)/2;K.current=true,D.scrollTop=Math.max(0,nt),q&&!pe&&(q.scrollTop=D.scrollTop);let Mt=Math.max(1,D.scrollWidth),lt=bt.length>0?Mt/bt.length:oo.width,Jt=Wd(Ia__default.default(Ee.startDate),bt,lt),ro=Math.max(0,Jt-lt);D.scrollLeft=Math.min(ro,Math.max(0,Mt-D.clientWidth)),window.requestAnimationFrame(()=>{K.current=false;});});return ()=>window.cancelAnimationFrame(We)},[oo.width,Ge,p,pe,it,Pe,Ae,bt]),Kt.useLayoutEffect(()=>{let D=j.current;if(!D)return;let q=0,Y=0,ue=false,Ee=()=>{if(ue)return;let ro=D.querySelector("thead"),Co=Array.from(D.querySelectorAll("tbody tr[data-planning-row-key]"));if(Co.length===0)return;let $t=ro?.getBoundingClientRect().height||Od,no={};Co.forEach(xt=>{let Zt=xt.dataset.planningRowKey;Zt&&(no[Zt]=xt.getBoundingClientRect().height);}),de(xt=>Math.abs(xt-$t)<.01?xt:$t),ye(xt=>{let Zt=Object.keys(xt),ba=Object.keys(no);return Zt.length===ba.length&&ba.every(Zo=>Math.abs((xt[Zo]??0)-no[Zo])<.01)?xt:no});},We=()=>{window.cancelAnimationFrame(q),q=window.requestAnimationFrame(Ee);};if(Ee(),window.cancelAnimationFrame(Y),Y=window.requestAnimationFrame(()=>{Y=window.requestAnimationFrame(Ee);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ue||We();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",We),()=>{ue=true,window.cancelAnimationFrame(q),window.cancelAnimationFrame(Y),window.removeEventListener("resize",We);};let Qe=new ResizeObserver(We),he=D.querySelector("table"),je=D.querySelector("tbody"),nt=D.querySelector("thead");he&&Qe.observe(he),nt&&Qe.observe(nt);let Mt=new WeakSet,lt=()=>{D.querySelectorAll("tbody tr[data-planning-row-key]").forEach(ro=>{Mt.has(ro)||(Qe.observe(ro),Mt.add(ro));});};lt();let Jt=null;return je&&typeof MutationObserver<"u"&&(Jt=new MutationObserver(()=>{lt(),We();}),Jt.observe(je,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",We),()=>{ue=true,window.cancelAnimationFrame(q),window.cancelAnimationFrame(Y),Qe.disconnect(),Jt?.disconnect(),window.removeEventListener("resize",We);}},[Ae,U.visibleColumns,U.grouping,U.columnWidths]),jsxRuntime.jsxs(Wi,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.background.paper,...A},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 ${P.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.75,alignItems:"center",sx:{p:.5,borderRadius:2,backgroundColor:"action.hover",minHeight:38},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:zs,color:"text.secondary",whiteSpace:"nowrap"},children:M("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:U.rowsPerPage,disableUnderline:true,onChange:D=>U.setRowsPerPage(Number(D.target.value)),sx:{fontSize:zs,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:f.map(D=>jsxRuntime.jsx(material.MenuItem,{value:D,sx:{fontSize:zs},children:D===-1?M("common.all"):D},`planning-rows-per-page-${D}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>U.setPage(Math.max(H-1,0)),disabled:!Ke,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(sb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:zs,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:M("table.toolbar.pageOf",{current:xe,total:ft})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>U.setPage(Math.min(H+1,ft-1)),disabled:!et,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Df__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[xo.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:xo.map((D,q)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:D},`planning-extra-tool-${q}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(hr,{tooltip:"Column visibility",onClick:D=>U.setAnchorEl(D.currentTarget),color:"default",children:jsxRuntime.jsx(Jh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(hr,{tooltip:"Group by",onClick:D=>U.setGroupAnchorEl(D.currentTarget),color:"default",children:jsxRuntime.jsx(ob__default.default,{fontSize:"small"})}),jsxRuntime.jsx(hr,{tooltip:"Sort by...",onClick:()=>Z(true),color:U.sortBy.length>0||U.orderBy?"primary":"default",children:jsxRuntime.jsx(UT__default.default,{fontSize:"small"})})]}),ze&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:ze}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(hr,{tooltip:"Expand task table",onClick:()=>we("table"),color:me==="table"?"primary":"default",children:jsxRuntime.jsx($T__default.default,{fontSize:"small"})}),jsxRuntime.jsx(hr,{tooltip:"Split evenly",onClick:Po,color:me===null&&G==="even"?"primary":"default",children:jsxRuntime.jsx(GT__default.default,{fontSize:"small"})}),jsxRuntime.jsx(hr,{tooltip:"Expand timeline",onClick:()=>we("timeline"),color:me==="timeline"?"primary":"default",children:jsxRuntime.jsx(WT__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(Rf,{label:"",value:d,options:Vd.map(D=>({value:D.value,label:D.label})),onChange:D=>l?.(D.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),rt.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:w}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:B,sx:{height:"100%",display:"grid",gridTemplateColumns:Tt,minWidth:0,transition:`grid-template-columns ${Kr}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:j,onScroll:()=>jo("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:n,overflowX:"auto",overflowY:"auto",opacity:pe?0:1,transform:pe?"translateX(-10px)":"translateX(0)",pointerEvents:pe?"none":"auto",transition:`opacity ${Kr}, transform ${Kr}`},children:jsxRuntime.jsx(core.DndContext,{sensors:Ne,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:D=>{let q=D?.active?.id,Y=D?.over?.id;typeof q=="string"&&typeof Y=="string"&&U.handleColumnReorder(q,Y);},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:z,"& thead .MuiTableCell-root":{height:Od,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(Xi,{columns:U.columns,visibleColumns:U.visibleColumns,order:U.order,orderBy:U.orderBy,sortBy:U.sortBy,onRequestSort:U.handleRequestSort,onContextMenu:(D,q)=>{D.preventDefault(),D.stopPropagation(),dt({mouseX:D.clientX+2,mouseY:D.clientY-6,columnId:q});},grouping:U.grouping,isAllExpanded:U.isAllExpanded,handleToggleAll:U.handleToggleAll,columnWidths:U.columnWidths,onColumnResize:U.handleColumnResize,enableColumnReorder:true}),jsxRuntime.jsx(material.TableBody,{children:Ae.map(D=>{let q=Ct(D);if(D.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":q,sx:{height:Ur,backgroundColor:P.palette.action.hover},children:[U.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ur,py:0,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>U.toggleGroupExpand(D.id),children:D.isExpanded?jsxRuntime.jsx(Db__default.default,{fontSize:"small"}):jsxRuntime.jsx(Df__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:U.visibleColumns.length,sx:{height:Ur,py:0,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[D.field,": ",D.value," (",D.count,")"]})})]},D.id);let Y=D.data||D,ue=Y.id===p,Ee=_t(Y.id),We=fe.activeId===Y.id,Qe=fe.overId===Y.id&&Nt(fe.activeId,Y.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":q,draggable:Ee,hover:true,selected:ue,onDragStart:he=>jt(he,Y),onDragOver:he=>tt(he,Y.id),onDragEnter:he=>tt(he,Y.id),onDrop:he=>_o(he,Y.id),onDragEnd:Fo,onClick:()=>b?.(Be.get(Y.id)||Y),sx:{cursor:We?"grabbing":Ee?"grab":b?"pointer":"default",height:Ur,opacity:We?.56:1,"& .MuiTableCell-root":Qe?{borderTop:`2px solid ${P.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[U.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ur,py:0,borderBottom:`1px solid ${P.palette.divider}`}}),(U.columns||[]).filter(he=>U.visibleColumns.includes(he.id)).map(he=>jsxRuntime.jsx(material.TableCell,{sx:{width:U.columnWidths?.[he.id]||he.minWidth||100,height:Ur,py:0,overflow:"hidden",borderBottom:`1px solid ${P.palette.divider}`},children:he.render?he.render(Y[he.id],Y):String(Y[he.id]??"-")},`${Y.id}-${he.id}`))]},Y.id)})})]})})}),jsxRuntime.jsx(material.Box,{onPointerDown:ke?ht:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ke?Ui:0,cursor:ke?"col-resize":"default",opacity:ke?1:0,pointerEvents:ke?"auto":"none",borderLeft:ke?`1px solid ${P.palette.divider}`:"0 solid transparent",borderRight:ke?`1px solid ${P.palette.divider}`:"0 solid transparent",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${Kr}, opacity ${Kr}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:P.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:ke?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:Pe?0:1,transform:Pe?"translateX(10px)":"translateX(0)",pointerEvents:Pe?"none":"auto",transition:`opacity ${Kr}, transform ${Kr}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:O,onScroll:()=>jo("timeline"),sx:{width:"100%",height:n,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:"100%",minWidth:ra||"100%"},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:na,height:Ge,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:P.palette.background.paper},children:bt.map(D=>jsxRuntime.jsxs(material.Box,{title:D.title,sx:{px:.75,display:"flex",flexDirection:D.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:D.contextLabel?.15:0,borderRight:`1px solid ${P.palette.divider}`,color:D.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[D.contextLabel&&jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:D.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:D.label})]},D.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:Ae.map(D=>{let q=Ct(D),Y=oe[q]??Ur;if(D.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":q,sx:{position:"relative",height:Y,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.action.hover}},D.id);let ue=D.data||D,Ee=Ia__default.default(ue.startDate),We=Ia__default.default(ue.endDate),Qe=Wd(Ee,bt,Pt),he=Wd(We,bt,Pt),je=Math.max(0,he-Qe),nt=Bf(ue.progress),Mt=ue.id===p,lt=_t(ue.id),Jt=fe.activeId===ue.id,ro=fe.overId===ue.id&&Nt(fe.activeId,ue.id),Co=ue.color??(ue.statusTone==="blocked"?P.palette.error.main:P.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":q,draggable:lt,onDragStart:$t=>jt($t,ue),onDragOver:$t=>tt($t,ue.id),onDragEnter:$t=>tt($t,ue.id),onDrop:$t=>_o($t,ue.id),onDragEnd:Fo,onClick:()=>b?.(Be.get(ue.id)||ue),sx:{position:"relative",height:Y,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,opacity:Jt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:P.palette.primary.main,opacity:ro?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:P.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:ao,cursor:Jt?"grabbing":lt?"grab":b?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${ue.title}: ${Ee.format("MMM D HH:mm")} - ${We.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:`${Qe}%`,top:Math.max(8,(Y-24)/2),width:`max(18px, ${je}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:Mt?`2px solid ${P.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${nt}%`,backgroundColor:Co}}),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:ue.code})]})})},ue.id)})})]})})})]})}),jsxRuntime.jsx(Qr,{groupAnchorEl:U.groupAnchorEl,setGroupAnchorEl:U.setGroupAnchorEl,grouping:U.grouping,setGrouping:U.setGrouping,columns:U.columns,toggleGroupField:U.toggleGroupField}),jsxRuntime.jsx(Jr,{anchorEl:U.anchorEl,setAnchorEl:U.setAnchorEl,columns:U.columns,visibleColumns:U.visibleColumns,toggleColumnVisibility:U.toggleColumnVisibility}),jsxRuntime.jsx(Ru,{contextMenu:_e,handleClose:()=>dt(null),columns:U.columns,visibleColumns:U.visibleColumns,grouping:U.grouping,summaryColumns:U.summaryColumns,showSummary:U.showSummary,sortBy:U.sortBy,orderBy:U.orderBy,order:U.order,onSortAsc:D=>{U.applyMultiSort([{field:D,direction:"asc"}]);},onSortDesc:D=>{U.applyMultiSort([{field:D,direction:"desc"}]);},onClearSort:D=>{let q=U.sortBy.filter(Y=>Y.field!==D);q.length>0?U.applyMultiSort(q):(U.clearMultiSort(),U.orderBy===D&&U.setOrderBy(""));},onHideColumn:D=>{U.visibleColumns.includes(D)&&U.toggleColumnVisibility(D);},onToggleGroup:D=>U.toggleGroupField(D),onToggleSummary:D=>U.toggleSummaryColumn(D),onOpenSortDialog:()=>Z(true)}),jsxRuntime.jsx(Mu,{open:at,onClose:()=>Z(false),columns:U.columns,initialRules:U.sortBy.length>0?U.sortBy:U.orderBy?[{field:U.orderBy,direction:U.order}]:[],onApply:D=>U.applyMultiSort(D),onClear:()=>{U.clearMultiSort(),U.setOrderBy("");}})]})};var SO=({filterProps:e,ganttProps:t,spacing:o=2,sx:a,children:r})=>{let n=a?[{height:"100%",overflow:"hidden"},a]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(Aa,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(zf,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),r]})};var rI={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)"}}},RO=({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]=Kt.useState("to"),g=!i&&!d&&o!=="none";Kt.useEffect(()=>{if(!g){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=rI[o],m=Kt.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",...m,...c},children:e})},MO={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=a4;exports.AgentPanel=qV;exports.Button=Os;exports.CAINavProvider=lw;exports.CAmapChart=ju;exports.CAppHeader=ql;exports.CAppPageLayout=$5;exports.CAuthPage=P4;exports.CBarChart=ai;exports.CChartCard=tl;exports.CComboChart=Lu;exports.CCustomizeAgent=Qu;exports.CDetailInfoPage=$B;exports.CDetailSearchAiBar=Zp;exports.CDetailSectionCard=zl;exports.CFishboneChart=Ou;exports.CGoogleMapChart=Uu;exports.CGraphCharts=Zu;exports.CGraphKpiCards=Au;exports.CGraphReport=hl;exports.CHeatmapChart=Nu;exports.CKanbanBoard=c5;exports.CKanbanBucket=tm;exports.CKanbanCard=Kc;exports.CLayoutManagement=Sp;exports.CLayoutManager=fn;exports.CLineChart=Eu;exports.CMessageBox=Zn;exports.COrbCanvas=ZS;exports.CPageLayout=pu;exports.CPageTransition=RO;exports.CPieChart=sl;exports.CPivotTable=DE;exports.CPlanningGantt=zf;exports.CPlanningLayout=SO;exports.CSmartFilter=Aa;exports.CSmartTable=lA;exports.CStandardPage=gA;exports.CTable=rr;exports.CTableBody=oA;exports.CTableCell=aA;exports.CTableContainer=rA;exports.CTableHead=nA;exports.CTableRow=iA;exports.CValueHelp=uu;exports.CVariantManagement=vl;exports.CVariantManager=sp;exports.CVoiceWaveOverlay=Cd;exports.CWaterfallChart=Wu;exports.CodeBlock=mi;exports.CopilotChat=e4;exports.GlobalMessage=sP;exports.MarkdownRenderer=yi;exports.MathBlock=gi;exports.MermaidBlock=Ac;exports.NavigationIsland=Gs;exports.ORBCAFE_I18N_MESSAGES=jn;exports.OrbcafeI18nProvider=qi;exports.PAGE_TRANSITION_PRESETS=MO;exports.PAppPageLayout=iz;exports.PBarcodeScanner=ZE;exports.PNavIsland=Tg;exports.PNumericKeypad=dL;exports.PSmartFilter=bg;exports.PTable=FS;exports.PTouchCard=tL;exports.PWorkloadNav=vg;exports.PivotChartPanel=Zm;exports.StdChat=bf;exports.TableBlock=Fc;exports.ThinkBlock=El;exports.TreeMenu=Ws;exports.VoiceNavigatorProvider=vz;exports.VoiceWaveOverlay=gz;exports.buildAmapEmbedUrl=ul;exports.buildGoogleMapEmbedUrl=ii;exports.buildGoogleMapIframe=mM;exports.buttonVariants=qf;exports.createKanbanBoardModel=rm;exports.findKanbanCard=pa;exports.message=KI;exports.messageManager=Ra;exports.moveKanbanCard=Wl;exports.parseMarkdownTable=Bl;exports.renderMarkdown=uB;exports.resolveVariantFilters=Tp;exports.resolveVariantLayout=Pl;exports.useAINav=sw;exports.useAmapEmbedUrl=MA;exports.useAuthPage=l4;exports.useDetailInfo=Yp;exports.useGoogleMapEmbedUrl=RA;exports.useGraphChartData=SA;exports.useGraphInteraction=yl;exports.useGraphReport=dn;exports.useKanbanBoard=g5;exports.useNavigationIsland=Jd;exports.useOrbcafeI18n=re;exports.usePadLayout=HE;exports.usePadRecordEditor=GE;exports.usePageLayout=hm;exports.usePivotTable=LE;exports.usePlanningGantt=Tf;exports.usePlanningLayout=L4;exports.useStandardReport=vA;exports.useVoiceInput=xn;exports.useVoiceNavigator=Cz;
|
|
252
|
+
`,HV=({active:e=false,colors:t=bT,zIndex:o=2147483e3})=>{let r={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:yT}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:r,"aria-hidden":"true"})]})};var UV=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:r}={})=>{let[a,n]=Kt.useState(e),[i,c]=Kt.useState(false),d=Kt.useCallback(async m=>{c(true);try{await m?.();}finally{c(false);}},[]),l=Kt.useCallback(m=>d(()=>t?.(m)),[t,d]),s=Kt.useCallback(m=>d(()=>o?.(m)),[o,d]),g=Kt.useCallback(m=>d(()=>r?.(m)),[r,d]),f=Kt.useMemo(()=>({mode:a,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,a]);return {mode:a,loading:i,setMode:n,authPageProps:f}};var Ud=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Xi=Kt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Xi.displayName="CPaper";var ET={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."},d8=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:r,onRegister:a,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,m]=Kt.useState(t),b=e??f,y=Kt.useMemo(()=>({...ET,...d}),[d]),[u,C]=Kt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[p,h]=Kt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[v,w]=Kt.useState({email:""}),[E,R]=Kt.useState(""),T=M=>{g||m(M),R(""),o?.(M);},I=async M=>{M.preventDefault(),await r?.(u),R("Demo login accepted. No real authentication request was sent.");},k=async M=>{M.preventDefault(),await a?.(p),R("Demo registration saved locally for this screen.");},S=async M=>{M.preventDefault(),await n?.(v),R("Demo reset link request created. No email was sent.");},D=b==="login"?y.loginTitle:b==="register"?y.registerTitle:y.forgotTitle,P=b==="login"?y.loginSubtitle:b==="register"?y.registerSubtitle:y.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:y.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:y.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:y.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(Xi,{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:P})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),b==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Email or user ID",value:u.username,onChange:M=>C(A=>({...A,username:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Uf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Password",type:"password",value:u.password,onChange:M=>C(A=>({...A,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(AT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(Ud,{label:"Remember me",checked:u.remember,onChange:M=>C(A=>({...A,remember:M.target.checked}))}),jsxRuntime.jsx(lr,{type:"button",variant:"text",size:"small",onClick:()=>T("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(lr,{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(lr,{type:"button",variant:"text",size:"small",onClick:()=>T("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:k,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Full name",value:p.name,onChange:M=>h(A=>({...A,name:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Uf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Work email",type:"email",value:p.email,onChange:M=>h(A=>({...A,email:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Password",type:"password",value:p.password,onChange:M=>h(A=>({...A,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(BT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ko,{label:"Confirm password",type:"password",value:p.confirmPassword,onChange:M=>h(A=>({...A,confirmPassword:M.target.value}))}),jsxRuntime.jsx(Ud,{label:"I accept the demo workspace terms",checked:p.acceptedTerms,onChange:M=>h(A=>({...A,acceptedTerms:M.target.checked}))}),jsxRuntime.jsx(lr,{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(lr,{type:"button",variant:"text",size:"small",onClick:()=>T("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:S,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(ko,{label:"Work email",type:"email",value:v.email,onChange:M=>w({email:M.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(lr,{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(lr,{type:"button",variant:"text",size:"small",onClick:()=>T("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 LT={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},zT=[{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"}],Kf=({tasks:e,appId:t,tableKey:o,defaultScale:r="week",defaultSelectedTaskId:a,initialFilters:n,filterFields:i,filterAppId:c,filterTableKey:d,serviceUrl:l,variantService:s,layout:g,columns:f,page:m,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:C,onRowsPerPageChange:p,onFilterSearch:h,onFilterVariantLoad:v,enableRowReorder:w,onTaskReorder:E,onLayoutIdChange:R,onLayoutSave:T})=>{let I=t??c??"planning-gantt",k=o??d??"planning",[S,D]=Kt.useState(r),[P,M]=Kt.useState(a??e[0]?.id??""),[A,j]=Kt.useState(""),[z,V]=Kt.useState(null),[X,Z]=Kt.useState({...LT,...n}),H=Kt.useMemo(()=>{let te=String(X.keyword?.value??"").trim().toLowerCase(),Ie=String(X.status?.value??"").trim(),Ye=String(X.owner?.value??"").trim().toLowerCase(),Ue=String(X.workCenter?.value??"").trim().toLowerCase(),be=X.dateRange?.value,Ke=be?.[0]?Ar__default.default(be[0]):null,lt=be?.[1]?Ar__default.default(be[1]):null;return e.filter(Ee=>{if(te&&![Ee.id,Ee.code,Ee.title,Ee.project,Ee.workCenter,Ee.owner?.name].join(" ").toLowerCase().includes(te)||Ie&&Ee.status!==Ie||Ye&&!String(Ee.owner?.name??"").toLowerCase().includes(Ye)||Ue&&!String(Ee.workCenter??"").toLowerCase().includes(Ue))return false;if(Ke||lt){let Oe=Ar__default.default(Ee.startDate),qe=Ar__default.default(Ee.endDate),pt=Ke?qe.isAfter(Ke)||qe.isSame(Ke,"day"):true,$e=lt?Oe.isBefore(lt)||Oe.isSame(lt,"day"):true;if(!pt||!$e)return false}return true})},[X,e]);Kt.useEffect(()=>{H.length!==0&&(H.some(te=>te.id===P)||M(H[0].id));},[H,P]);let ee=Kt.useCallback(te=>{M(te.id);},[]),pe=Kt.useCallback(te=>{j(te),R?.(te);},[R]),De=Kt.useCallback(te=>{V(Ie=>({key:(Ie?.key??0)+1,variant:te})),v?.(te);},[v]),xe=Kt.useMemo(()=>({appId:I,tableKey:k,fields:i??zT,filters:X,onFilterChange:Z,onVariantLoad:De,onSearch:h??(()=>{}),currentLayoutId:A,layoutRefs:[{tableKey:k,layoutId:A||null}],variantService:s,serviceUrl:l}),[A,i,X,De,h,I,k,l,s]),se=Kt.useMemo(()=>({appId:I,tableKey:k,serviceUrl:l,tasks:H,columns:f,scale:S,onScaleChange:D,page:m,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:C,onRowsPerPageChange:p,selectedTaskId:P,onTaskSelect:ee,enableRowReorder:w,onTaskReorder:E,layout:g,layoutVariant:z?.variant,layoutVariantLoadKey:z?.key,onLayoutIdChange:pe,onLayoutSave:T}),[f,u,w,H,pe,g,z?.key,z?.variant,C,p,T,E,ee,m,I,k,b,y,S,l,P]);return {scale:S,setScale:D,selectedTaskId:P,setSelectedTaskId:M,filters:X,setFilters:Z,filteredTasks:H,smartFilterProps:xe,planningGanttProps:se}};var y8=e=>{let t=Kf(e),o=Kt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var _f=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var va=Kt.forwardRef(({tooltip:e,...t},o)=>{let r=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:r}):r});va.displayName="CIconButton";var jf=({label:e,options:t,minWidth:o=120,...r})=>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,...r,children:t.map(a=>jsxRuntime.jsx(material.MenuItem,{value:a.value,children:a.label},a.value))})]});Ar__default.default.extend(ZT__default.default);var Xd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Yd=56,Za=58,Ji=8,Qd=260,yI=320,_s="0.85rem",Xa="220ms cubic-bezier(0.2, 0, 0, 1)",Yf={"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"}},xI=e=>e?Yf[e]?.label??e:"Planned",vI=e=>e?Yf[e]?.color??"default":"info",Qf=e=>Math.min(100,Math.max(0,e??0)),Jf=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Jf(o.children??[],t+1)]),CI=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:xI(e.status),statusTone:e.status??"planned",progress:Qf(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),eh=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),th=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),kI=(e,t,o)=>{let r=[],a=eh(e,o),n=th(t,o);for(;a.isBefore(n)||a.isSame(n);){let i=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");r.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:i}),a=i;}return r},Jd=(e,t,o)=>{let r=0;for(let a of t){if(e.isBefore(a.start))return r;if(e.isBefore(a.end)){let n=Math.max(1,a.end.valueOf()-a.start.valueOf()),i=Math.max(0,e.valueOf()-a.start.valueOf());return r+i/n*o}r+=o;}return r},oh=({appId:e="planning-gantt",tableKey:t="planning",serviceUrl:o,title:r="Project Plan",extraTools:a,bodyHeight:n=560,tasks:i,columns:c,scale:d="week",onScaleChange:l,page:s,rowsPerPage:g=20,rowsPerPageOptions:f=[20,50,100,-1],count:m,onPageChange:b,onRowsPerPageChange:y,timelineStart:u,timelineEnd:C,selectedTaskId:p,onTaskSelect:h,enableRowReorder:v=true,onTaskReorder:w,layout:E,layoutVariant:R,layoutVariantLoadKey:T,onLayoutIdChange:I,onLayoutSave:k,emptyLabel:S="No planning tasks available.",sx:D})=>{let P=material.useTheme(),{t:M}=oe(),A=Kt.useRef(null),j=Kt.useRef(null),z=Kt.useRef(null),V=Kt.useRef(false),[X,Z]=Kt.useState(null),[H,ee]=Kt.useState("content"),[pe,De]=Kt.useState(null),[xe,se]=Kt.useState(0),[te,Ie]=Kt.useState({}),[Ye,Ue]=Kt.useState(Yd),[be,Ke]=Kt.useState([]),lt=Kt.useRef(void 0),[Ee,Oe]=Kt.useState({activeId:null,overId:null}),[qe,pt]=Kt.useState(null),[$e,q]=Kt.useState(false),Le=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ve=Kt.useRef(null),Pe=Kt.useMemo(()=>Jf(i),[i]),at=Kt.useMemo(()=>{if(be.length===0)return Pe;let B=new Map(Pe.map(ce=>[ce.id,ce])),_=be.map(ce=>B.get(ce)).filter(ce=>!!ce),Q=new Set(_.map(ce=>ce.id));return [..._,...Pe.filter(ce=>!Q.has(ce.id))]},[Pe,be]),We=Kt.useMemo(()=>new Map(at.map(B=>[B.id,B])),[at]),re=Kt.useMemo(()=>at.map(B=>CI(B)),[at]),ke=Kt.useMemo(()=>new Map(re.map(B=>[B.id,B])),[re]),je=Kt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,_)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:_.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:_.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(B,_)=>jsxRuntime.jsx(_f,{label:_.status,color:vI(_.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:B,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),St=Kt.useMemo(()=>{if(!c||c.length===0)return je;let B=new Map(je.map(_=>[_.id,_]));return c.map(_=>{let Q=B.get(_.id),ce=_.width??Q?.minWidth??120,Be={id:_.id,label:_.label,minWidth:ce};if(Q?.numeric&&(Be.numeric=true),_.render){let He=_.render;return Be.render=(rt,ge)=>{let Je=We.get(ge.id);return He(Je||ge)},Be}return Q?.render?(Be.render=Q.render,Be):(Be.render=(He,rt)=>{let ge=rt[_.id];if(ge!=null&&String(ge).length>0)return String(ge);let ct=We.get(rt.id)?.[_.id];return ct!=null&&String(ct).length>0?String(ct):"-"},Be)})},[c,je,We]),K=Cn({appId:e,tableKey:t,title:r,columns:St,rows:re,rowKey:"id",page:s,rowsPerPage:g,rowsPerPageOptions:f,count:m??re.length,onPageChange:b,onRowsPerPageChange:y,showSummary:false,layout:E,onLayoutSave:k}),Fe=e?jsxRuntime.jsx(vn,{appId:e,tableKey:t,currentLayoutData:K.currentLayoutData,onLayoutLoad:K.handleLayoutLoad,targetLayoutId:K.layoutIdToLoad,activeLayoutId:K.currentLayoutId,serviceUrl:o}):null,ye=K.visibleRows,st=K.rowsPerPage===-1?1:Math.max(1,Math.ceil(K.totalDisplayCount/K.rowsPerPage)),W=Math.max(0,Math.min(K.page,st-1)),ue=Math.min(W+1,st),_e=W>0,Qe=W<st-1&&K.rowsPerPage!==-1;Kt.useEffect(()=>{let B=Pe.map(_=>_.id);Ke(_=>{let Q=new Set(B),ce=_.filter(ge=>Q.has(ge)),Be=new Set(ce),He=B.filter(ge=>!Be.has(ge)),rt=[...ce,...He];return rt.length===_.length&&rt.every((ge,Je)=>ge===_[Je])?_:rt});},[Pe]),Kt.useEffect(()=>{T===void 0||!R||lt.current!==T&&(lt.current=T,K.handleVariantLoad(R));},[K,R,T]),Kt.useEffect(()=>{I?.(K.currentLayoutId);},[K.currentLayoutId,I]);let mt=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,yt=Kt.useMemo(()=>{let B=re.map(Je=>Ar__default.default(Je.startDate)),_=re.map(Je=>Ar__default.default(Je.endDate)),Q=u?Ar__default.default(u):B.reduce((Je,ct)=>ct.isBefore(Je)?ct:Je,B[0]??Ar__default.default()),ce=C?Ar__default.default(C):_.reduce((Je,ct)=>ct.isAfter(Je)?ct:Je,_[0]??Ar__default.default().add(30,"day")),Be=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",He=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",rt=d==="hour"?12:1,ge=d==="hour"?12:1;return {start:eh(Q.subtract(rt,Be),d),end:th(ce.add(ge,He),d)}},[re,d,C,u]),oo=Xd.find(B=>B.value===d)??Xd[1],xo=Array.isArray(a)?a:a?[a]:[],xt=Kt.useMemo(()=>kI(yt.start,yt.end,d),[yt.end,yt.start,d]),nr=xt.length*oo.width,Rt=xt.length>0?100/xt.length:100,ir=xt.length>0?`repeat(${xt.length}, minmax(${oo.width}px, 1fr))`:"1fr",ro=xt.length>0?`calc(100% / ${xt.length}) 100%`:"100% 100%",N=(K.columns||[]).filter(B=>K.visibleColumns.includes(B.id)).reduce((B,_)=>B+(K.columnWidths?.[_.id]||_.minWidth||100),0)+(K.grouping.length>0?72:0),O=H==="manual"&&X!==null?X:N,$=pe==="table",le=pe==="timeline",de=pe==="timeline",Te=pe==="table",Ce=!de&&!Te,Ae=()=>{let B=xe||A.current?.clientWidth||0;return B>0?Math.max(Qd,B-Ji-yI):Math.max(Qd,N)},Ge=B=>Math.min(Math.max(B,Qd),Ae()),vt=(()=>{if(xe<=0)return null;let B=Ce?Ji:0;if($)return {tableWidth:xe,splitterWidth:B,timelineWidth:0};if(le)return {tableWidth:0,splitterWidth:B,timelineWidth:xe};if(H==="even"){let Q=Math.max(0,(xe-B)/2);return {tableWidth:Q,splitterWidth:B,timelineWidth:Math.max(0,xe-B-Q)}}let _=Ge(O);return {tableWidth:_,splitterWidth:B,timelineWidth:Math.max(0,xe-B-_)}})(),Pt=vt?`${vt.tableWidth}px ${vt.splitterWidth}px ${vt.timelineWidth}px`:$?"minmax(0, 1fr) 0px 0px":le?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${Ji}px minmax(0, 1fr)`:`${O}px ${Ji}px minmax(0, 1fr)`;Kt.useEffect(()=>{H==="manual"&&Z(B=>B===null?null:Ge(B));},[H,N,xe]);let bt=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),De(null),ee("manual"),ve.current={startX:B.clientX,startWidth:j.current?.getBoundingClientRect().width??O};let _=ce=>{let Be=ve.current;if(!Be)return;let He=Ge(Be.startWidth+ce.clientX-Be.startX);Z(He);},Q=()=>{ve.current=null,window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",Q),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",_),window.addEventListener("pointerup",Q);},Po=()=>{De(null),ee("even"),Z(null);},qt=B=>!v||!B?false:ke.get(B)?.reorderable!==false,Nt=(B,_)=>{if(!B||!_||B===_||!qt(B)||!qt(_))return false;if(K.grouping.length===0)return true;let Q=ke.get(B),ce=ke.get(_);return !Q||!ce?false:K.grouping.every(Be=>Q[Be]===ce[Be])},vo=(B,_)=>{if(!Nt(B,_))return;let Q=ye.filter(dt=>dt.type!=="group").map(dt=>String((dt.data||dt)?.id)),ce=Q.indexOf(B),Be=Q.indexOf(_);if(ce<0||Be<0)return;let He=[...Q];[He[ce],He[Be]]=[He[Be],He[ce]];let rt=new Set(Q),ge=at.map(dt=>dt.id),Je=[...He,...ge.filter(dt=>!rt.has(dt))],ct=We.get(B),Dt=We.get(_);if(K.setOrder("asc"),K.setOrderBy(""),Ke(Je),ct&&Dt){let{level:dt,...Jt}=ct,{level:ao,...Co}=Dt,$t=Je.reduce((no,Ct)=>{let Zt=We.get(Ct);if(Zt){let{level:yr,...Zo}=Zt;no.push(Zo);}return no},[]);w?.($t,{activeTask:Jt,targetTask:Co});}},jt=(B,_)=>{if(!qt(_.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",_.id),Oe({activeId:_.id,overId:null}),h?.(We.get(_.id)||_);},nt=(B,_)=>{if(!Nt(Ee.activeId,_)){Oe(Q=>Q.overId===null?Q:{...Q,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",Oe(Q=>Q.overId===_?Q:{...Q,overId:_});},qo=(B,_)=>{let Q=Ee.activeId||B.dataTransfer.getData("text/plain");if(!Nt(Q,_)){Oe({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),vo(Q,_),Oe({activeId:null,overId:null});},Eo=()=>{Oe({activeId:null,overId:null});},jo=B=>{if(V.current)return;let _=B==="table"?j.current:z.current,Q=B==="table"?z.current:j.current;!_||!Q||(V.current=true,Q.scrollTop=_.scrollTop,window.requestAnimationFrame(()=>{V.current=false;}));};return Kt.useLayoutEffect(()=>{let B=A.current;if(!B){se(0);return}let _=0,Q=()=>{window.cancelAnimationFrame(_),_=window.requestAnimationFrame(()=>{let Be=B.clientWidth;se(He=>Math.abs(He-Be)<.5?He:Be);});};if(Q(),typeof ResizeObserver>"u")return window.addEventListener("resize",Q),()=>{window.cancelAnimationFrame(_),window.removeEventListener("resize",Q);};let ce=new ResizeObserver(Q);return ce.observe(B),window.addEventListener("resize",Q),()=>{window.cancelAnimationFrame(_),ce.disconnect(),window.removeEventListener("resize",Q);}},[re.length]),Kt.useLayoutEffect(()=>{if(!p||Te)return;let B=z.current,_=j.current;if(!B)return;let Q=`row-${p}`,ce=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(rt=>rt.dataset.planningTimelineRowKey===Q),Be=ke.get(p);if(!ce||!Be)return;let He=window.requestAnimationFrame(()=>{let rt=B.getBoundingClientRect(),ge=ce.getBoundingClientRect(),Je=Math.max(1,B.clientHeight-Ye),ct=B.scrollTop+ge.top-rt.top-Ye-(Je-ge.height)/2;V.current=true,B.scrollTop=Math.max(0,ct),_&&!de&&(_.scrollTop=B.scrollTop);let Dt=Math.max(1,B.scrollWidth),dt=xt.length>0?Dt/xt.length:oo.width,Jt=Jd(Ar__default.default(Be.startDate),xt,dt),ao=Math.max(0,Jt-dt);B.scrollLeft=Math.min(ao,Math.max(0,Dt-B.clientWidth)),window.requestAnimationFrame(()=>{V.current=false;});});return ()=>window.cancelAnimationFrame(He)},[oo.width,Ye,p,de,ke,Te,ye,xt]),Kt.useLayoutEffect(()=>{let B=j.current;if(!B)return;let _=0,Q=0,ce=false,Be=()=>{if(ce)return;let ao=B.querySelector("thead"),Co=Array.from(B.querySelectorAll("tbody tr[data-planning-row-key]"));if(Co.length===0)return;let $t=ao?.getBoundingClientRect().height||Yd,no={};Co.forEach(Ct=>{let Zt=Ct.dataset.planningRowKey;Zt&&(no[Zt]=Ct.getBoundingClientRect().height);}),Ue(Ct=>Math.abs(Ct-$t)<.01?Ct:$t),Ie(Ct=>{let Zt=Object.keys(Ct),yr=Object.keys(no);return Zt.length===yr.length&&yr.every(Zo=>Math.abs((Ct[Zo]??0)-no[Zo])<.01)?Ct:no});},He=()=>{window.cancelAnimationFrame(_),_=window.requestAnimationFrame(Be);};if(Be(),window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(()=>{Q=window.requestAnimationFrame(Be);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ce||He();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",He),()=>{ce=true,window.cancelAnimationFrame(_),window.cancelAnimationFrame(Q),window.removeEventListener("resize",He);};let rt=new ResizeObserver(He),ge=B.querySelector("table"),Je=B.querySelector("tbody"),ct=B.querySelector("thead");ge&&rt.observe(ge),ct&&rt.observe(ct);let Dt=new WeakSet,dt=()=>{B.querySelectorAll("tbody tr[data-planning-row-key]").forEach(ao=>{Dt.has(ao)||(rt.observe(ao),Dt.add(ao));});};dt();let Jt=null;return Je&&typeof MutationObserver<"u"&&(Jt=new MutationObserver(()=>{dt(),He();}),Jt.observe(Je,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",He),()=>{ce=true,window.cancelAnimationFrame(_),window.cancelAnimationFrame(Q),rt.disconnect(),Jt?.disconnect(),window.removeEventListener("resize",He);}},[ye,K.visibleColumns,K.grouping,K.columnWidths]),jsxRuntime.jsxs(Xi,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.background.paper,...D},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 ${P.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.75,alignItems:"center",sx:{p:.5,borderRadius:2,backgroundColor:"action.hover",minHeight:38},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:_s,color:"text.secondary",whiteSpace:"nowrap"},children:M("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:K.rowsPerPage,disableUnderline:true,onChange:B=>K.setRowsPerPage(Number(B.target.value)),sx:{fontSize:_s,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}},children:f.map(B=>jsxRuntime.jsx(material.MenuItem,{value:B,sx:{fontSize:_s},children:B===-1?M("common.all"):B},`planning-rows-per-page-${B}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>K.setPage(Math.max(W-1,0)),disabled:!_e,sx:{...Cr,color:"text.primary"},children:jsxRuntime.jsx(Rb__default.default,{})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:_s,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:M("table.toolbar.pageOf",{current:ue,total:st})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>K.setPage(Math.min(W+1,st-1)),disabled:!Qe,sx:{...Cr,color:"text.primary"},children:jsxRuntime.jsx(Xf__default.default,{})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[xo.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:xo.map((B,_)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:B},`planning-extra-tool-${_}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(va,{tooltip:"Column visibility",onClick:B=>K.setAnchorEl(B.currentTarget),color:"default",children:jsxRuntime.jsx(xb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(va,{tooltip:"Group by",onClick:B=>K.setGroupAnchorEl(B.currentTarget),color:"default",children:jsxRuntime.jsx(kb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(va,{tooltip:"Sort by...",onClick:()=>q(true),color:K.sortBy.length>0||K.orderBy?"primary":"default",children:jsxRuntime.jsx(hI__default.default,{fontSize:"small"})})]}),Fe&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:Fe}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(va,{tooltip:"Expand task table",onClick:()=>De("table"),color:pe==="table"?"primary":"default",children:jsxRuntime.jsx(gI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(va,{tooltip:"Split evenly",onClick:Po,color:pe===null&&H==="even"?"primary":"default",children:jsxRuntime.jsx(fI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(va,{tooltip:"Expand timeline",onClick:()=>De("timeline"),color:pe==="timeline"?"primary":"default",children:jsxRuntime.jsx(mI__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(jf,{label:"",value:d,options:Xd.map(B=>({value:B.value,label:B.label})),onChange:B=>l?.(B.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),re.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",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Pt,minWidth:0,transition:`grid-template-columns ${Xa}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:j,onScroll:()=>jo("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:n,overflowX:"auto",overflowY:"auto",opacity:de?0:1,transform:de?"translateX(-10px)":"translateX(0)",pointerEvents:de?"none":"auto",transition:`opacity ${Xa}, transform ${Xa}`},children:jsxRuntime.jsx(core.DndContext,{sensors:Le,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:B=>{let _=B?.active?.id,Q=B?.over?.id;typeof _=="string"&&typeof Q=="string"&&K.handleColumnReorder(_,Q);},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:N,"& thead .MuiTableCell-root":{height:Yd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(nl,{columns:K.columns,visibleColumns:K.visibleColumns,order:K.order,orderBy:K.orderBy,sortBy:K.sortBy,onRequestSort:K.handleRequestSort,onContextMenu:(B,_)=>{B.preventDefault(),B.stopPropagation(),pt({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:_});},grouping:K.grouping,isAllExpanded:K.isAllExpanded,handleToggleAll:K.handleToggleAll,columnWidths:K.columnWidths,onColumnResize:K.handleColumnResize,enableColumnReorder:true}),jsxRuntime.jsx(material.TableBody,{children:ye.map(B=>{let _=mt(B);if(B.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":_,sx:{height:Za,backgroundColor:P.palette.action.hover},children:[K.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...vr,height:Za,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>K.toggleGroupExpand(B.id),sx:Cr,children:B.isExpanded?jsxRuntime.jsx(Xb__default.default,{}):jsxRuntime.jsx(Xf__default.default,{})})}),jsxRuntime.jsx(material.TableCell,{colSpan:K.visibleColumns.length,sx:{height:Za,py:0,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[B.field,": ",B.value," (",B.count,")"]})})]},B.id);let Q=B.data||B,ce=Q.id===p,Be=qt(Q.id),He=Ee.activeId===Q.id,rt=Ee.overId===Q.id&&Nt(Ee.activeId,Q.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":_,draggable:Be,hover:true,selected:ce,onDragStart:ge=>jt(ge,Q),onDragOver:ge=>nt(ge,Q.id),onDragEnter:ge=>nt(ge,Q.id),onDrop:ge=>qo(ge,Q.id),onDragEnd:Eo,onClick:()=>h?.(We.get(Q.id)||Q),sx:{cursor:He?"grabbing":Be?"grab":h?"pointer":"default",height:Za,opacity:He?.56:1,"& .MuiTableCell-root":rt?{borderTop:`2px solid ${P.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[K.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...vr,height:Za,borderBottom:`1px solid ${P.palette.divider}`}}),(K.columns||[]).filter(ge=>K.visibleColumns.includes(ge.id)).map(ge=>jsxRuntime.jsx(material.TableCell,{sx:{width:K.columnWidths?.[ge.id]||ge.minWidth||100,height:Za,py:0,overflow:"hidden",borderBottom:`1px solid ${P.palette.divider}`},children:ge.render?ge.render(Q[ge.id],Q):String(Q[ge.id]??"-")},`${Q.id}-${ge.id}`))]},Q.id)})})]})})}),jsxRuntime.jsx(material.Box,{onPointerDown:Ce?bt:void 0,role:"separator","aria-orientation":"vertical",sx:{width:Ce?Ji:0,cursor:Ce?"col-resize":"default",opacity:Ce?1:0,pointerEvents:Ce?"auto":"none",borderLeft:Ce?`1px solid ${P.palette.divider}`:"0 solid transparent",borderRight:Ce?`1px solid ${P.palette.divider}`:"0 solid transparent",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${Xa}, opacity ${Xa}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:P.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:Ce?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:Te?0:1,transform:Te?"translateX(10px)":"translateX(0)",pointerEvents:Te?"none":"auto",transition:`opacity ${Xa}, transform ${Xa}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:z,onScroll:()=>jo("timeline"),sx:{width:"100%",height:n,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:"100%",minWidth:nr||"100%"},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:ir,height:Ye,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:P.palette.background.paper},children:xt.map(B=>jsxRuntime.jsxs(material.Box,{title:B.title,sx:{px:.75,display:"flex",flexDirection:B.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:B.contextLabel?.15:0,borderRight:`1px solid ${P.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.contextLabel&&jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:B.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:ye.map(B=>{let _=mt(B),Q=te[_]??Za;if(B.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":_,sx:{position:"relative",height:Q,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.action.hover}},B.id);let ce=B.data||B,Be=Ar__default.default(ce.startDate),He=Ar__default.default(ce.endDate),rt=Jd(Be,xt,Rt),ge=Jd(He,xt,Rt),Je=Math.max(0,ge-rt),ct=Qf(ce.progress),Dt=ce.id===p,dt=qt(ce.id),Jt=Ee.activeId===ce.id,ao=Ee.overId===ce.id&&Nt(Ee.activeId,ce.id),Co=ce.color??(ce.statusTone==="blocked"?P.palette.error.main:P.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":_,draggable:dt,onDragStart:$t=>jt($t,ce),onDragOver:$t=>nt($t,ce.id),onDragEnter:$t=>nt($t,ce.id),onDrop:$t=>qo($t,ce.id),onDragEnd:Eo,onClick:()=>h?.(We.get(ce.id)||ce),sx:{position:"relative",height:Q,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,opacity:Jt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:P.palette.primary.main,opacity:ao?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:P.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:ro,cursor:Jt?"grabbing":dt?"grab":h?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${ce.title}: ${Be.format("MMM D HH:mm")} - ${He.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:`${rt}%`,top:Math.max(8,(Q-24)/2),width:`max(18px, ${Je}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:Dt?`2px solid ${P.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${ct}%`,backgroundColor:Co}}),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:ce.code})]})})},ce.id)})})]})})})]})}),jsxRuntime.jsx(rn,{groupAnchorEl:K.groupAnchorEl,setGroupAnchorEl:K.setGroupAnchorEl,grouping:K.grouping,setGrouping:K.setGrouping,columns:K.columns,toggleGroupField:K.toggleGroupField}),jsxRuntime.jsx(an,{anchorEl:K.anchorEl,setAnchorEl:K.setAnchorEl,columns:K.columns,visibleColumns:K.visibleColumns,toggleColumnVisibility:K.toggleColumnVisibility}),jsxRuntime.jsx(Wu,{contextMenu:qe,handleClose:()=>pt(null),columns:K.columns,visibleColumns:K.visibleColumns,grouping:K.grouping,summaryColumns:K.summaryColumns,showSummary:K.showSummary,sortBy:K.sortBy,orderBy:K.orderBy,order:K.order,onSortAsc:B=>{K.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{K.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let _=K.sortBy.filter(Q=>Q.field!==B);_.length>0?K.applyMultiSort(_):(K.clearMultiSort(),K.orderBy===B&&K.setOrderBy(""));},onHideColumn:B=>{K.visibleColumns.includes(B)&&K.toggleColumnVisibility(B);},onToggleGroup:B=>K.toggleGroupField(B),onToggleSummary:B=>K.toggleSummaryColumn(B),onOpenSortDialog:()=>q(true)}),jsxRuntime.jsx($u,{open:$e,onClose:()=>q(false),columns:K.columns,initialRules:K.sortBy.length>0?K.sortBy:K.orderBy?[{field:K.orderBy,direction:K.order}]:[],onApply:B=>K.applyMultiSort(B),onClear:()=>{K.clearMultiSort(),K.setOrderBy("");}})]})};var l4=({filterProps:e,ganttProps:t,spacing:o=2,sx:r,children:a})=>{let n=r?[{height:"100%",overflow:"hidden"},r]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(zr,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(oh,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),a]})};var DI={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)"}}},p4=({children:e,transitionKey:t,variant:o="fade",durationMs:r=220,delayMs:a=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]=Kt.useState("to"),g=!i&&!d&&o!=="none";Kt.useEffect(()=>{if(!g){s("to");return}s("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(b)},[t,g]);let f=DI[o],m=Kt.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 ${r}ms ${n} ${a}ms, transform ${r}ms ${n} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...c},children:e})},m4={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=HV;exports.AgentPanel=Bf;exports.Button=Zs;exports.CAINavProvider=Iw;exports.CAmapChart=lp;exports.CAppHeader=ts;exports.CAppHeaderSearch=id;exports.CAppPageLayout=xE;exports.CAuthPage=d8;exports.CBarChart=pi;exports.CChartCard=dl;exports.CComboChart=ju;exports.CCustomizeAgent=up;exports.CDetailInfoPage=x5;exports.CDetailSearchAiBar=sm;exports.CDetailSectionCard=Kl;exports.CFishboneChart=Qu;exports.CGoogleMapChart=rp;exports.CGraphCharts=sp;exports.CGraphKpiCards=Uu;exports.CGraphReport=Tl;exports.CHeatmapChart=Xu;exports.CKanbanBoard=H5;exports.CKanbanBucket=gm;exports.CKanbanCard=td;exports.CLayoutManagement=zp;exports.CLayoutManager=vn;exports.CLineChart=qu;exports.CMessageBox=oi;exports.COrbCanvas=gw;exports.CPageLayout=wu;exports.CPageTransition=p4;exports.CPieChart=bl;exports.CPivotTable=lL;exports.CPlanningGantt=oh;exports.CPlanningLayout=l4;exports.CSmartFilter=zr;exports.CSmartTable=O2;exports.CStandardPage=K2;exports.CTable=ca;exports.CTableBody=E2;exports.CTableCell=F2;exports.CTableContainer=L2;exports.CTableHead=z2;exports.CTableRow=N2;exports.CValueHelp=Su;exports.CVariantManagement=Ml;exports.CVariantManager=Cp;exports.CVoiceWaveOverlay=Bd;exports.CWaterfallChart=ep;exports.CodeBlock=ki;exports.CopilotChat=NV;exports.FloatingAgentPanel=MV;exports.GlobalMessage=FP;exports.MarkdownRenderer=Pi;exports.MathBlock=Si;exports.MermaidBlock=Wc;exports.NavigationIsland=Js;exports.ORBCAFE_I18N_MESSAGES=ti;exports.OrbcafeI18nProvider=tl;exports.PAGE_TRANSITION_PRESETS=m4;exports.PAppPageLayout=Nz;exports.PBarcodeScanner=IL;exports.PNavIsland=Vg;exports.PNumericKeypad=WL;exports.PSmartFilter=Ag;exports.PTable=QS;exports.PTouchCard=BL;exports.PWorkloadNav=Fg;exports.PivotChartPanel=cg;exports.StdChat=Af;exports.TableBlock=Gc;exports.ThinkBlock=Gl;exports.TreeMenu=Ys;exports.VoiceNavigatorProvider=Yz;exports.VoiceWaveOverlay=Kz;exports.buildAmapEmbedUrl=vl;exports.buildGoogleMapEmbedUrl=fi;exports.buildGoogleMapIframe=UM;exports.buttonVariants=ph;exports.createKanbanBoardModel=bm;exports.findKanbanCard=mr;exports.message=bP;exports.messageManager=Er;exports.moveKanbanCard=Xl;exports.parseMarkdownTable=Wl;exports.renderMarkdown=$B;exports.resolveVariantFilters=Op;exports.resolveVariantLayout=zl;exports.useAINav=Pw;exports.useAmapEmbedUrl=iB;exports.useAuthPage=UV;exports.useDetailInfo=dm;exports.useGoogleMapEmbedUrl=nB;exports.useGraphChartData=eB;exports.useGraphInteraction=Pl;exports.useGraphReport=fn;exports.useKanbanBoard=K5;exports.useNavigationIsland=uu;exports.useOrbcafeI18n=oe;exports.usePadLayout=bL;exports.usePadRecordEditor=vL;exports.usePageLayout=Dm;exports.usePivotTable=pL;exports.usePlanningGantt=Kf;exports.usePlanningLayout=y8;exports.useStandardReport=Y2;exports.useVoiceInput=wn;exports.useVoiceNavigator=Qz;
|