@ehfuse/mui-virtual-data-table 1.5.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -152,6 +152,7 @@ function App() {
152
152
  rowKeyFromId={boolean} // Use getRowId as the React key of rows (rows with inline editors)
153
153
  onEndReached={() => void} // Fired every time the end is reached (no minimum / no same-length latch)
154
154
  colorMode={"light" | "dark"} // notion colors independent of the MUI palette mode
155
+ mobile={boolean | { query?, renderRow? }} // 1.6.0 card list on narrow screens (see "Mobile list")
155
156
 
156
157
  // Optional - 1.4.0 header context menu (right-click on th never shows the browser menu)
157
158
  onSortClear={() => void} // adds "정렬 풀기" to the header menu (and re-picking the active direction clears)
@@ -235,6 +236,29 @@ Pinned rows example (1.3.0):
235
236
  notion defaults (1.2.0): rowHeight 48, header text 13px, selected row (`selectedRowId`) = `#dbeafe` + 3px `#3b82f6` left bar (dark values included),
236
237
  string `emptyMessage` = one light grey line under the header, footer cells use the body padding.
237
238
 
239
+ ### Mobile list (1.6.0)
240
+
241
+ `mobile` turns the table into a card list on narrow screens (default query `(max-width:599.95px)`): no header row, one card per row,
242
+ virtualization / `onLoadMore` / `onRowClick` / `selectedRowId` work the same. Header menu, footer and pinned rows are not drawn there.
243
+
244
+ ```tsx
245
+ <VirtualDataTable
246
+ mobile // or { query: "(max-width:899.95px)", renderRow: (item, index) => <MyCard/> }
247
+ columns={[
248
+ { id: "thumb", text: "", mobile: "thumb", render: (r) => <img src={r.image} width={56} /> },
249
+ { id: "title", text: "작품", mobile: "title" },
250
+ { id: "status", text: "상태", mobile: "badge", render: (r) => <Chip label={r.status} /> },
251
+ { id: "artist", text: "작가", mobile: "sub" },
252
+ { id: "price", text: "판매가" }, // no hint → meta line "판매가 1,000,000원"
253
+ { id: "memo", text: "메모", mobile: false }, // hidden on mobile
254
+ ]}
255
+ ...
256
+ />
257
+ ```
258
+
259
+ Slots: `title` (bold first line — default: the first column), `thumb` (left), `badge` (right of the title), `sub` (line under the title),
260
+ `meta` ("header value" pairs that wrap — default for the other columns), `false` (hidden). `mobileLabel` overrides the meta label (`false` = value only).
261
+
238
262
  ## License
239
263
 
240
264
  MIT © KIM YOUNG JIN (ehfuse@gmail.com)
package/dist/index.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  export { VirtualDataTable } from "./VirtualDataTable";
9
9
  export { HeaderMenu, HeaderMenuItem, HeaderMenuDivider, HeaderMenuIcon, HeaderFilterIcon, headerMenuAnchor, HEADER_MENU_ICON_PATHS, HEADER_MENU_ITEM_SX, HEADER_MENU_FONT_SIZE, HEADER_MENU_ICON_SIZE, HEADER_MENU_ITEM_HEIGHT, } from "./HeaderMenu";
10
10
  export type { HeaderMenuProps, HeaderMenuItemProps, HeaderMenuOption, HeaderMenuSortConfig, HeaderMenuFilterConfig, HeaderMenuSortDirection, } from "./HeaderMenu";
11
- export type { DataColumn, SortDirection, SortableFilter, VirtualDataTableProps, } from "./types";
11
+ export type { DataColumn, SortDirection, SortableFilter, VirtualDataTableProps, VDTMobileConfig, VDTMobileSlot, } from "./types";
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import{forwardRef as Ye,useCallback as N,useMemo as de,useRef as v,useEffect as q,memo as _n,useState as Le}from"react";import{Box as D,Table as Fn,TableBody as Xt,TableCell as ce,TableContainer as Vn,TableHead as Wn,TableFooter as $n,TableRow as De,TableSortLabel as bt,Paper as Xn,Typography as Yn,useTheme as jn}from"@mui/material";import{TableVirtuoso as Kn}from"react-virtuoso";import{jsx as ct}from"react/jsx-runtime";import{useRef as _t,useState as Sn,useEffect as Tn}from"react";import{Box as Rn,CircularProgress as Hn}from"@mui/material";var ke=function(){return ke=Object.assign||function(u){for(var i,x=1,f=arguments.length;x<f;x++){i=arguments[x];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(u[s]=i[s])}return u},ke.apply(this,arguments)};function Ft(o){var u=o.visible,i=o.onComplete,x=o.fadeoutDuration,f=x===void 0?200:x,s=o.exitDelay,I=s===void 0?0:s,K=o.size,te=K===void 0?40:K,Z=o.className,J=o.style,H=o.sx,P=o.indicator,E=o.background,L=E===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:E,y=_t(void 0),T=_t(null),ne=Sn(u),W=ne[0],w=ne[1],be=L.show,c=be===void 0?!0:be,S=L.color,R=S===void 0?"255, 255, 255":S,U=L.opacity,re=U===void 0?.9:U;if(Tn(function(){var Pe=y.current;if(Pe===!0&&u===!1&&T.current){var je=T.current;je.style.opacity="0",setTimeout(function(){w(!1),i?.()},f+I)}else u===!0&&(w(!0),T.current&&(T.current.style.opacity="1"));y.current=u},[u,i,f,I]),!W)return null;var Q=function(){return typeof P=="string"?ct("img",{src:P,alt:"Loading",style:{width:te,height:te}}):P||ct(Hn,{size:te})},B=function(){return c?R.startsWith("rgba")?{backgroundColor:R}:/^\d+,\s*\d+,\s*\d+$/.test(R)?{backgroundColor:"rgba(".concat(R,", ").concat(re,")")}:re!==1?{backgroundColor:R,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:R,opacity:re,zIndex:-1}}:{backgroundColor:R}:{backgroundColor:"transparent"}};return ct(Rn,{ref:T,className:Z,style:ke({},J),sx:ke(ke({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:u?1:0,transition:"opacity ".concat(f,"ms ease-out")},B()),H),children:Q()})}import{Fragment as En,jsx as Vt,jsxs as Ln}from"react/jsx-runtime";var kn=`
1
+ import{forwardRef as je,useCallback as A,useMemo as ne,useRef as S,useEffect as Z,memo as Yn,useState as Ie}from"react";import{Box as y,Table as Un,TableBody as qt,TableCell as re,TableContainer as jn,TableHead as Kn,TableFooter as qn,TableRow as Be,TableSortLabel as xt,Paper as Gn,Typography as Zn,useTheme as Qn,useMediaQuery as Jn}from"@mui/material";import{TableVirtuoso as er}from"react-virtuoso";import{jsx as pt}from"react/jsx-runtime";import{useRef as Xt,useState as Ln,useEffect as Dn}from"react";import{Box as In,CircularProgress as Bn}from"@mui/material";var Le=function(){return Le=Object.assign||function(u){for(var i,C=1,g=arguments.length;C<g;C++){i=arguments[C];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(u[d]=i[d])}return u},Le.apply(this,arguments)};function Yt(a){var u=a.visible,i=a.onComplete,C=a.fadeoutDuration,g=C===void 0?200:C,d=a.exitDelay,N=d===void 0?0:d,K=a.size,oe=K===void 0?40:K,Q=a.className,J=a.style,L=a.sx,O=a.indicator,B=a.background,P=B===void 0?{show:!0,color:"255, 255, 255",opacity:.9}:B,M=Xt(void 0),k=Xt(null),ae=Ln(u),V=ae[0],T=ae[1],me=P.show,c=me===void 0?!0:me,R=P.color,E=R===void 0?"255, 255, 255":R,q=P.opacity,ie=q===void 0?.9:q;if(Dn(function(){var Ae=M.current;if(Ae===!0&&u===!1&&k.current){var Ke=k.current;Ke.style.opacity="0",setTimeout(function(){T(!1),i?.()},g+N)}else u===!0&&(T(!0),k.current&&(k.current.style.opacity="1"));M.current=u},[u,i,g,N]),!V)return null;var ee=function(){return typeof O=="string"?pt("img",{src:O,alt:"Loading",style:{width:oe,height:oe}}):O||pt(Bn,{size:oe})},z=function(){return c?E.startsWith("rgba")?{backgroundColor:E}:/^\d+,\s*\d+,\s*\d+$/.test(E)?{backgroundColor:"rgba(".concat(E,", ").concat(ie,")")}:ie!==1?{backgroundColor:E,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:E,opacity:ie,zIndex:-1}}:{backgroundColor:E}:{backgroundColor:"transparent"}};return pt(In,{ref:k,className:Q,style:Le({},J),sx:Le(Le({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,opacity:u?1:0,transition:"opacity ".concat(g,"ms ease-out")},z()),L),children:ee()})}import{Fragment as An,jsx as Ut,jsxs as Nn}from"react/jsx-runtime";var Pn=`
2
2
  .vdt-css-spinner{box-sizing:border-box;border-radius:50%;border:4px solid rgba(28,64,125,0.14);border-top-color:#1c407d;animation:vdt-css-spinner-spin .75s linear infinite}
3
3
  @keyframes vdt-css-spinner-spin{to{transform:rotate(360deg)}}
4
- `;function Wt({size:o=54}){return Ln(En,{children:[Vt("style",{children:kn}),Vt("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:o,height:o}})]})}import We,{useMemo as Dn,useState as In}from"react";import{Box as Ee,Divider as Pn,InputBase as An,Menu as Nn,MenuItem as Bn,SvgIcon as On}from"@mui/material";import{jsx as p,jsxs as Xe}from"react/jsx-runtime";var ut=14,pt=18,ft=34,j={asc:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",desc:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",checked:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",unchecked:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",radioOn:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",radioOff:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",filter:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z",search:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"};function ge({d:o,size:u=pt,color:i}){return p(On,{sx:{fontSize:u,flexShrink:0,color:i},children:p("path",{d:o})})}function ht({size:o=14,active:u,color:i}){let x={stroke:"currentColor",strokeWidth:1.8,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"};return Xe(Ee,{component:"svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,sx:{width:o,height:o,flexShrink:0,color:u?"primary.main":i??"currentColor",verticalAlign:"middle"},children:[p("path",{d:"M2 17.5H7",...x}),p("path",{d:"M22 6.5H17",...x}),p("path",{d:"M13 17.5H22",...x}),p("path",{d:"M11 6.5H2",...x}),p("path",{d:"M10 20.3999C8.34315 20.3999 7 19.0568 7 17.3999C7 15.743 8.34315 14.3999 10 14.3999C11.6569 14.3999 13 15.743 13 17.3999C13 19.0568 11.6569 20.3999 10 20.3999Z",...x}),p("path",{d:"M14 9.3999C15.6569 9.3999 17 8.05676 17 6.3999C17 4.74305 15.6569 3.3999 14 3.3999C12.3431 3.3999 11 4.74305 11 6.3999C11 8.05676 12.3431 9.3999 14 9.3999Z",...x})]})}var $t={gap:1,fontSize:ut,lineHeight:"20px",minHeight:ft,py:"7px",px:1.5};function G({icon:o,iconSpace:u,selected:i,disabled:x,muted:f,onClick:s,sx:I,children:K}){return Xe(Bn,{selected:i,disabled:x,onClick:s,sx:[$t,f?{color:"text.secondary"}:{},...Array.isArray(I)?I:I?[I]:[]],children:[o??(u?p(Ee,{component:"span",sx:{width:pt,flexShrink:0}}):null),K]})}function $e(){return p(Pn,{sx:{my:"4px !important"}})}function zn(o,u){let i=o.getBoundingClientRect();return{left:u??i.left,top:i.bottom}}function gt({open:o,anchorPosition:u,anchorEl:i,onClose:x,sort:f,filter:s,header:I,children:K,minWidth:te=180,maxHeight:Z=420}){let[J,H]=In(""),P=s?.multiple!==!1,E=s?.value??[],L=Dn(()=>{if(!s)return[];let c=s.options;return s.emptyLabel&&!c.some(S=>S.value==="")?[...c,{value:"",label:s.emptyLabel}]:c},[s]),y=!!s&&(s?.searchable??L.length>10),T=J.trim().toLowerCase(),ne=T?L.filter(c=>c.label.toLowerCase().includes(T)):L,W=()=>{H(""),x()},w=[];if(I&&w.push(...We.Children.toArray(I).map((c,S)=>We.isValidElement(c)?We.cloneElement(c,{key:`h${S}`}):c)),f){let c=S=>{W(),f.onChange(f.active===S&&f.clearable!==!1?null:S)};w.push(p(G,{selected:f.active==="asc",onClick:()=>c("asc"),icon:p(ge,{d:j.asc,color:"text.secondary"}),children:"\uC624\uB984\uCC28\uC21C \uC815\uB82C"},"sort-asc"),p(G,{selected:f.active==="desc",onClick:()=>c("desc"),icon:p(ge,{d:j.desc,color:"text.secondary"}),children:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C"},"sort-desc")),f.active&&f.clearable!==!1&&w.push(p(G,{muted:!0,iconSpace:!0,onClick:()=>{W(),f.onChange(null)},children:"\uC815\uB82C \uD480\uAE30"},"sort-clear"))}return f&&s&&w.push(p($e,{},"div-sort")),s&&(y&&w.push(Xe(Ee,{onKeyDown:c=>c.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1,px:1.5,pb:.5,minHeight:ft},children:[p(ge,{d:j.search,color:"text.secondary"}),p(An,{autoFocus:!0,value:J,onChange:c=>H(c.target.value),placeholder:s.searchPlaceholder??"\uCC3E\uAE30",sx:{flex:1,fontSize:ut}})]},"search")),!P&&s.allLabel&&w.push(p(G,{selected:E.length===0,onClick:()=>{W(),s.onChange([])},icon:p(ge,{d:E.length===0?j.radioOn:j.radioOff,color:E.length===0?"primary.main":"text.disabled"}),children:s.allLabel},"f-all")),L.length===0&&w.push(p(G,{disabled:!0,iconSpace:!0,children:s.emptyText??"\uACE0\uB97C \uAC12\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},"f-none")),ne.forEach(c=>{let S=E.includes(c.value),R=()=>{if(P){s.onChange(S?E.filter(re=>re!==c.value):[...E,c.value]);return}W(),s.onChange(S?[]:[c.value])},U=P?S?j.checked:j.unchecked:S?j.radioOn:j.radioOff;w.push(Xe(G,{selected:!P&&S,onClick:R,icon:p(ge,{d:U,color:S?"primary.main":"text.disabled"}),children:[c.icon,p(Ee,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.render??c.label}),typeof c.count=="number"?p(Ee,{component:"span",sx:{color:"text.secondary",ml:1,fontVariantNumeric:"tabular-nums"},children:c.count}):null]},`f:${c.value||"(empty)"}`))}),y&&T&&ne.length===0&&w.push(p(G,{disabled:!0,iconSpace:!0,children:"\uCC3E\uB294 \uAC12\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},"f-nohit")),E.length>0&&w.push(p($e,{},"div-filter"),p(G,{muted:!0,iconSpace:!0,onClick:()=>{W(),s.onChange([])},children:s.clearLabel??"\uAC70\uB974\uAE30 \uD480\uAE30"},"f-clear"))),K&&(w.length>0&&w.push(p($e,{},"div-children")),w.push(...We.Children.toArray(K))),p(Nn,{open:o&&(!!u||!!i),...!u&&!!i?{anchorEl:i}:{anchorReference:"anchorPosition",anchorPosition:u??void 0},onClose:W,transitionDuration:0,disableAutoFocusItem:y,onContextMenu:c=>c.preventDefault(),onClick:c=>c.stopPropagation(),slotProps:{paper:{sx:{maxHeight:Z,minWidth:te}},list:{sx:{py:.5}}},children:w})}import Un from"@ehfuse/overlay-scrollbar";import{Fragment as Ie,jsx as a,jsxs as V}from"react/jsx-runtime";var Gn={alignment:"default",margin:0,radius:0},mt=5,qn={bg:"#ffffff",border:"#e6e6e3",borderStrong:"#dedddb",headerColor:"#787774",hoverBg:"#f8f8f7",emptyColor:"#9b9a97",selectedBg:"#dbeafe",selectedBar:"#3b82f6"},Yt="12px",Zn={bg:"#1e1e1e",border:"#2c333c",borderStrong:"#3b434e",headerColor:"#a3adbb",hoverBg:"#272d36",emptyColor:"#7d8590",selectedBg:"rgba(59, 130, 246, 0.22)",selectedBar:"#60a5fa"};function xt(o){return!!(o.filterOptions&&o.onFilterChange)}function Jn({data:o,loading:u=!1,columns:i,onRowClick:x,getRowId:f,selectedRowId:s,selectedRowSx:I,rowHeight:K,columnHeight:te,striped:Z,rowDivider:J=!0,onSort:H,onSortClear:P,onHeaderContextMenu:E,onLoadMore:L,sortBy:y,sortDirection:T,showPaper:ne=!0,paddingX:W,paddingTop:w=0,paddingBottom:be=0,rowHoverColor:c,rowHoverOpacity:S,viewportBuffer:R,overscan:U,scrollbars:re,emptyMessage:Q="NO DATA",autoHeight:B=!1,LoadingComponent:Pe,showFooter:je,footerHeight:me,footerSx:xe,variant:jt="default",framed:ue=!0,headerTopBorder:Kt=!1,rowHeightMode:Ut="fixed",tableLayout:Ae="fixed",renderFullWidthRow:Ke,fullWidthRowSx:ye,onRowContextMenu:yt,pinnedRows:Ce,pinnedRowsMaxHeight:Ue,pinnedRowsSx:Me,resetScrollOnDataChange:Ct=!0,rowKeyFromId:Gt=!1,onEndReached:Mt,colorMode:qt}){let b=jt==="notion",Ge=jn(),m=(qt??Ge.palette.mode)==="dark"?Zn:qn,vt=(Ce?.length??0)>0,oe=te??(b?40:56),$=K??(b?48:50),Ne=ue?W??(b?"12px":"1rem"):0,qe=Ut==="auto",Ze=c??(b?m.hoverBg:void 0),wt=S??(b?1:void 0),Zt=Math.max($*12,480),Jt=Math.max($*12,480),Qt=typeof R=="number"?R:R?.top??Zt,en=typeof R=="number"?R:R?.bottom??Jt,tn=Math.max($*8,420),nn=Math.max($*10,520),rn=typeof U=="number"?U:{main:U?.main??tn,reverse:U?.reverse??nn},ve=$+(J?1:0),on=de(()=>b?{backgroundColor:m.selectedBg,"& > td:first-of-type":{boxShadow:`inset 3px 0 0 ${m.selectedBar}`},"& > td[data-vdt-pinned]":{backgroundColor:m.selectedBg}}:void 0,[b,m]),X=I??on,Be=!X||typeof X!="function",an=de(()=>!Be||s===null||s===void 0||!X?null:{[`& tbody tr[data-row-id="${String(s).replace(/["\\]/g,"\\$&")}"]`]:X},[Be,s,X]),er=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[C]=Le(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),g=v({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),Je=N(t=>{if(!C)return;let e=g.current;if(!(e.wheelEvents>0||e.rangeChangedCalls>0||e.rowContentCalls>0||e.cellRenderCalls>0))return;let d=e.rowContentCalls>0?e.rowContentMs/e.rowContentCalls:0,h=e.cellRenderCalls>0?e.cellRenderMs/e.cellRenderCalls:0;console.log("[VDT perf]",{reason:t,wheel:{events:e.wheelEvents,inputPx:Math.round(e.wheelInputPx),handlerMs:Number(e.wheelHandlerMs.toFixed(2)),rafFlushes:e.wheelRafFlushes,rafMs:Number(e.wheelRafMs.toFixed(2))},rangeChanged:{calls:e.rangeChangedCalls,totalMs:Number(e.rangeChangedMs.toFixed(2))},rowContent:{calls:e.rowContentCalls,totalMs:Number(e.rowContentMs.toFixed(2)),avgMs:Number(d.toFixed(3)),maxMs:Number(e.rowContentMaxMs.toFixed(3))},cellRender:{calls:e.cellRenderCalls,totalMs:Number(e.cellRenderMs.toFixed(2)),avgMs:Number(h.toFixed(3)),maxMs:Number(e.cellRenderMaxMs.toFixed(3))}}),g.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[C]);q(()=>{if(!C||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let t=window.setInterval(()=>{Je("interval")},1500);return()=>{window.clearInterval(t),Je("cleanup")}},[Je,C]);let St=de(()=>Ye((t,e)=>{let r=v(null),d=v(0),h=v(null);return q(()=>{let n=r.current;if(!n)return;let l=k=>{let z=C?performance.now():0;if(k.shiftKey||Math.abs(k.deltaX)>Math.abs(k.deltaY))return;let A=k.target?.closest?.("[data-vdt-inner-scroll]");if(A&&n.contains(A)&&(k.deltaY<0?A.scrollTop>0:A.scrollTop+A.clientHeight<A.scrollHeight-1))return;k.preventDefault();let ee=k.deltaY;k.deltaMode===1?ee*=40:k.deltaMode===2&&(ee*=n.clientHeight),C&&(g.current.wheelEvents+=1,g.current.wheelInputPx+=ee),d.current+=ee,h.current===null&&(h.current=requestAnimationFrame(()=>{let fe=C?performance.now():0,M=Math.max(n.clientHeight*.4,160),_=Math.max(-M,Math.min(M,d.current));d.current=0,h.current=null,_!==0&&(n.scrollTop+=_),C&&(g.current.wheelRafFlushes+=1,g.current.wheelRafMs+=performance.now()-fe)}),C&&(g.current.wheelHandlerMs+=performance.now()-z))};return n.addEventListener("wheel",l,{passive:!1}),()=>{n.removeEventListener("wheel",l),h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),d.current=0}},[]),a(Un,{detectInnerScroll:!0,track:Gn,...re,children:a(Vn,{component:D,...t,ref:n=>{r.current=n,typeof e=="function"?e(n):e&&(e.current=n)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:b?0:Ne,paddingTop:w,paddingBottom:be}}})})}),[]),Qe=de(()=>{if(Z===!0)return"#f5f5f5";if(typeof Z=="string")return Z},[Z]),[ln,Tt]=Le(u),[sn,dn]=Le(0);q(()=>{u&&Tt(!0)},[u]);let Rt=N(()=>{Tt(!1)},[]),cn=ln,tr=u&&o.length>0,et=v(!1),tt=v(-1),nt=v(null),rt=v(null),[un,pn]=Le(!1),Oe=N(()=>{let t=rt.current;t&&pn(t.scrollHeight>t.clientHeight+1)},[]);q(()=>{let t=rt.current;if(!t||typeof ResizeObserver>"u")return;let e=new ResizeObserver(()=>Oe());return e.observe(t),()=>e.disconnect()},[Oe,B]);let ot=v(x);ot.current=x;let we=v(f);we.current=f;let at=v(yt);at.current=yt;let Ht=v(Mt);Ht.current=Mt;let kt=v(null),ze=de(()=>{let t=new Map,e=0;return i.forEach(r=>{r.pinned==="left"&&(t.set(String(r.id),e),e+=typeof r.width=="number"?r.width:0)}),t},[i]),it=de(()=>{if(i.some(t=>typeof t.minWidth=="number"))return i.reduce((t,e)=>t+(typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:0),0)},[i]),pe=N((t,e)=>{let r=ze.get(String(t.id));return r===void 0?{}:{position:"sticky",left:r,zIndex:e?3:1}},[ze]),_e=!!x,Se=v(!1),ae=v({x:0,y:0});q(()=>{let t=e=>{let r=e.clientX-ae.current.x,d=e.clientY-ae.current.y;Math.sqrt(r*r+d*d)>mt&&(Se.current=!0)};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}},[]),q(()=>{let t=document.querySelector('[data-testid="virtuoso-scroller"]');t&&t.querySelectorAll(".MuiTableSortLabel-root").forEach(r=>{let d=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});r.dispatchEvent(d)})},[y]);let Fe=N(t=>{if(!H)return;H(t,y===t&&T==="asc"?"desc":"asc")},[H,y,T]),[Te,Et]=Le(null),Lt=v(E);Lt.current=E;let Dt=v(H);Dt.current=H;let Re=N((t,e)=>{if(!t){e.preventDefault();return}t.headerProps?.onContextMenu?.(e);let r=e.defaultPrevented;if(r||(r=Lt.current?.(t,e)===!0||e.defaultPrevented),e.preventDefault(),r||t.headerMenu===!1||!!!((t.sortMenu??t.sortable)&&Dt.current)&&!xt(t))return;let h=e.currentTarget.getBoundingClientRect();Et({colId:String(t.id),x:e.clientX,y:h.bottom})},[]),ie=N(t=>{if(!xt(t))return t.text;let e=!!(t.filterValues&&t.filterValues.length>0);return V(D,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",color:e?"primary.main":void 0,fontWeight:e?600:void 0,verticalAlign:"middle"},children:[a(D,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.text}),a(ht,{active:e})]})},[]),fn=N(t=>{let e=C?performance.now():0;if(Ht.current?.(),!L){C&&(g.current.rangeChangedCalls+=1,g.current.rangeChangedMs+=performance.now()-e);return}if(u&&o.length===0){C&&(g.current.rangeChangedCalls+=1,g.current.rangeChangedMs+=performance.now()-e);return}let r=o.length>=30,d=t>=o.length-1,h=tt.current===o.length;if(d&&r&&!et.current&&!h){et.current=!0,tt.current=o.length;let n=o.length;L(n,50)}C&&(g.current.rangeChangedCalls+=1,g.current.rangeChangedMs+=performance.now()-e)},[o.length,u,L,C]);q(()=>{u||(et.current=!1)},[u]),q(()=>{o.length===0&&dn(t=>t+1)},[o.length]);let It=v(Ct);It.current=Ct;let lt=v(o.length),st=v(void 0);q(()=>{let t=lt.current,e=o.length,r=e>0?we.current?we.current(o[0],0):o[0]:void 0,d=st.current;if(e>t&&t>0){lt.current=e,st.current=r;return}let h=e<t||t>0&&r!==d;h&&(tt.current=-1),nt.current&&e>0&&h&&It.current&&nt.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),lt.current=e,st.current=r},[o]);let Pt=N(()=>{let t={},e=[];if(i.forEach(n=>{n.group?(t[n.group]||(t[n.group]=[]),t[n.group].push(n)):e.push(n)}),!(Object.keys(t).length>0))return a(De,{children:i.map(n=>a(ce,{align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>Re(n,l),style:{width:n.width,minWidth:n.width??n.minWidth,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...pe(n,!0),...n.headerProps?.style},children:n.sortable?a("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:V(D,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Fe(String(n.id)),children:[ie(n),a(bt,{active:y===n.id,direction:y===n.id?T:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:y===n.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):ie(n)},String(n.id)))});let d=[...e.map(n=>a(ce,{rowSpan:2,align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>Re(n,l),style:{width:n.width,minWidth:n.width,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...pe(n,!0),...n.headerProps?.style},children:n.sortable&&H?a("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:V(D,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Fe(String(n.id)),children:[ie(n),a(bt,{active:y===n.id,direction:y===n.id?T:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:y===n.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):ie(n)},String(n.id))),...Object.entries(t).map(([n,l])=>a(ce,{align:"center",colSpan:l.length,onContextMenu:k=>Re(null,k),style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:n},n))],h=[...Object.values(t).flat().map(n=>a(ce,{align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>Re(n,l),style:{width:n.width,minWidth:n.width,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...pe(n,!0),...n.headerProps?.style},children:n.sortable&&H?a("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:V(D,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Fe(String(n.id)),children:[ie(n),a(bt,{active:y===n.id,direction:y===n.id?T:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:y===n.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):ie(n)},String(n.id)))];return V(Ie,{children:[a(De,{children:d}),a(De,{children:h})]})},[i,y,T,Fe,H,oe,pe,Re,ie]),Ve=N((t,e)=>{let r=C?performance.now():0;if(!e){if(C){g.current.rowContentCalls+=1;let l=performance.now()-r;g.current.rowContentMs+=l,g.current.rowContentMaxMs=Math.max(g.current.rowContentMaxMs,l)}return null}let d=Ke?Ke(e,t):null;if(d!=null)return a(ce,{colSpan:i.length,"data-vdt-pad":"",sx:[{padding:b?"0 14px":"8px 16px"},...Array.isArray(ye)?ye:ye?[ye]:[]],children:d});let h=0,n=i.map((l,k)=>{if(h>0)return h-=1,null;let z=l.colSpan?Math.max(1,Math.min(l.colSpan(e,t),i.length-k)):1;h=z-1;let A=C?performance.now():0,ee=l.render?l.render(e,t):String(e[l.id]||"");if(C){let F=performance.now()-A;g.current.cellRenderCalls+=1,g.current.cellRenderMs+=F,g.current.cellRenderMaxMs=Math.max(g.current.cellRenderMaxMs,F)}let fe=ze.has(String(l.id)),M=l.cellPadding!==void 0,_=l.rowSpan?l.rowSpan(e,t):1;if(_<=0)return null;let le=l.onCellClick;return a(ce,{align:l.align||"left",rowSpan:_>1?_:void 0,colSpan:z>1?z:void 0,"data-vdt-pad":M?"":void 0,"data-vdt-pinned":fe?"":void 0,"data-vdt-cell-click":le?"":void 0,onClick:le?F=>{let he=F.clientX-ae.current.x,se=F.clientY-ae.current.y;F.stopPropagation(),!(Math.sqrt(he*he+se*se)>mt)&&le(e,t,F)}:void 0,style:{...z>1?{}:{width:l.width,minWidth:l.width??l.minWidth},...l.primary?{fontSize:15}:{},...l.style,...l.cellStyle?l.cellStyle(e,t):{},padding:M?l.cellPadding:"8px 16px",...pe(l,!1)},children:ee},String(l.id))});if(C){g.current.rowContentCalls+=1;let l=performance.now()-r;g.current.rowContentMs+=l,g.current.rowContentMaxMs=Math.max(g.current.rowContentMaxMs,l)}return a(Ie,{children:n})},[i,C,Ke,ye,b,ze,pe]),At=N(()=>{let t=Pt();if(!Ce||Ce.length===0)return t;let e=kt.current;return V(Ie,{children:[t,a("tr",{"data-vdt-pinned-area":"",children:a("td",{colSpan:i.length,style:{padding:0,border:0},children:a(D,{"data-vdt-inner-scroll":"",sx:[{maxHeight:Ue,overflowY:Ue?"auto":"visible",overflowX:"hidden",scrollbarWidth:"thin",borderBottom:`1px solid ${b?m.borderStrong:"rgba(224, 224, 224, 1)"}`,"& tbody tr:last-of-type > td":{borderBottom:"none"}},...Array.isArray(Me)?Me:Me?[Me]:[]],children:V("table",{style:{width:"100%",tableLayout:Ae,borderCollapse:"separate",borderSpacing:0},children:[a("colgroup",{children:i.map(r=>a("col",{style:{width:r.width,minWidth:r.width??r.minWidth}},String(r.id)))}),a(Xt,{children:Ce.map((r,d)=>e?a(e,{item:r,"data-index":d,"data-vdt-pinned-row":"",children:Ve(d,r)},f?String(f(r,d)):`p${d}`):null)})]})})})})]})},[Pt,Ce,Ue,Me,i,Ve,Ae,f,b,m]),Y=je??i.some(t=>typeof t.footer=="function"),Nt=N(()=>{if(!Y)return null;let t=[];for(let e=0;e<i.length;e+=1){let r=i[e],d=r.footerColSpan&&r.footerColSpan>1?Math.min(r.footerColSpan,i.length-e):1;t.push(a(ce,{align:r.align||"left",colSpan:d>1?d:void 0,style:{...d>1?{}:{width:r.width,minWidth:r.width},...r.style,fontWeight:"bold",padding:b?"0 14px":"16px"},children:r.footer?r.footer(o):null},String(r.id))),e+=d-1}return a(De,{children:t})},[Y,i,o,b]),dt=de(()=>({Scroller:St,Table:t=>a(Fn,{...t,sx:{borderCollapse:"separate",tableLayout:Ae,...it?{minWidth:it}:{},marginRight:ue?"16px":0,...Y?{height:"100%"}:{}}}),TableHead:Ye((t,e)=>a(Wn,{...t,ref:e,sx:{userSelect:"none","& > tr":{height:oe,"& > th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:t=>{let{item:e,selected:r,"aria-selected":d,className:h,...n}=t,l=n["data-index"]??0,k=l%2===1,z=e&&we.current?we.current(e,l):l,A=!Be&&s!==null&&s!==void 0&&z===s,ee=A&&X?typeof X=="function"?X(e,l):X:void 0,fe=String(h??"").split(/\s+/).filter(M=>M!=="Mui-selected"&&M!=="Mui-focusVisible").join(" ");return a(De,{...n,"data-row-id":z!=null?String(z):void 0,className:fe||void 0,selected:A,onMouseDown:M=>{Se.current=!1,ae.current={x:M.clientX,y:M.clientY}},onContextMenu:M=>{e&&at.current&&at.current(e,l,M)},onClick:M=>{let _=M.clientX-ae.current.x,le=M.clientY-ae.current.y;if(Math.sqrt(_*_+le*le)>mt||Se.current){M.preventDefault(),M.stopPropagation(),Se.current=!1;return}e&&ot.current&&ot.current(e,l),Se.current=!1},sx:[{userSelect:"none",...qe?{"& > td":{height:ve}}:{height:ve,maxHeight:ve},boxSizing:"border-box",backgroundColor:k&&Qe?Qe:"transparent","& td:not([data-vdt-pad])":{padding:"8px 16px"},"& td":{boxSizing:"border-box",borderBottom:J?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":_e&&!A?{backgroundColor:M=>{let _=M.palette.mode==="dark",F=Ze??"#000000",he=wt??.06;if(!Ze)return _?`rgba(255, 255, 255, ${he})`:`rgba(0, 0, 0, ${he})`;let se=F.replace("#","").trim();if(se.length!==6)return F;let Mn=parseInt(se.substring(0,2),16),vn=parseInt(se.substring(2,4),16),wn=parseInt(se.substring(4,6),16);return`rgba(${Mn}, ${vn}, ${wn}, ${he})`}}:void 0,cursor:_e?"pointer":void 0},ee]})},TableBody:Ye((t,e)=>{let{children:r,...d}=t;return V(Xt,{...d,ref:e,sx:Y?{height:"100%"}:void 0,children:[r,Y&&a("tr",{"aria-hidden":!0,style:{height:"100%"},children:a("td",{colSpan:i.length,style:{padding:0,border:0}})})]})}),TableFoot:Ye((t,e)=>a($n,{...t,ref:e,sx:[{"& tr":{height:me??$,maxHeight:me??$,boxSizing:"border-box"},"& td":{height:me??$,boxSizing:"border-box",backgroundColor:r=>r.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:`inset 0 1px 0 0 ${b?m.borderStrong:"#000000"}`}},...Array.isArray(xe)?xe:xe?[xe]:[]]}))}),[_e,Be?null:s,X,$,Qe,J,oe,Ze,wt,St,me,xe,Y,b,m,i,Ae,ue,qe,it]);kt.current=dt.TableRow;let hn=dt,He=dt,gn=He.Table,bn=He.TableHead,mn=He.TableBody,xn=He.TableRow,yn=He.TableFoot,O=Te?i.find(t=>String(t.id)===Te.colId):void 0,Cn=()=>Et(null),Bt=null;if(Te&&O){let t=String(O.id),e=!!((O.sortMenu??O.sortable)&&H),r=xt(O),d=y===t?T:void 0;Bt=a(gt,{open:!0,anchorPosition:{left:Te.x,top:Te.y},onClose:Cn,sort:e?{active:d??null,clearable:!!P,onChange:h=>{h?H?.(t,h):P?.()}}:void 0,filter:r?{options:O.filterOptions??[],value:O.filterValues??[],onChange:h=>O.onFilterChange?.(h),multiple:O.filterMultiple!==!1,emptyLabel:O.filterEmptyLabel,searchable:O.filterSearchable}:void 0})}let Ot=V(D,{sx:{position:"relative",height:B?"auto":"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:t=>b?`${m.bg} !important`:t.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...an??{},"& tbody td[data-vdt-pinned]":{backgroundColor:b?m.bg:Ge.palette.background.paper},"& tbody td[data-vdt-cell-click]":{cursor:"pointer"},"& tbody td[data-vdt-cell-click]:hover":{backgroundColor:b?m.hoverBg:Ge.palette.mode==="dark"?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"},...b&&_e?{"& tbody tr:hover td[data-vdt-pinned]":{backgroundColor:m.hoverBg}}:{},...b?{...ue?{border:`1px solid ${m.borderStrong}`,borderRadius:"4px"}:{"& table":{backgroundColor:m.bg}},overflow:"hidden","& thead tr th > *":{verticalAlign:"middle"},"& thead > tr > th":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},"& thead > tr > th > *":{maxWidth:"100%"},"& thead .vdt-sort-box":{paddingRight:"20px"},"& thead .vdt-sort-box > .MuiTableSortLabel-root":{left:"auto !important",right:0,marginLeft:"0 !important"},"& thead tr th":{height:oe,boxSizing:"border-box",padding:"0 14px !important",fontSize:13,fontWeight:"500 !important",color:m.headerColor,backgroundColor:`${m.bg} !important`,borderTop:!ue&&Kt?`1px solid ${m.borderStrong}`:"none",borderBottom:`1px solid ${m.borderStrong}`,borderRight:`1px solid ${m.border}`,"&:last-of-type":{borderRight:"none"}},"& tbody tr td:not([data-vdt-pad])":{padding:"0 14px !important"},"& tbody tr td":{fontSize:14,borderBottom:`1px solid ${m.border}`},...o.length>0&&(B||un||Y)?{[`& tbody tr[data-index="${o.length-1}"]:not([data-vdt-pinned-row]) td`]:{borderBottom:"none"}}:{}}:{}},children:[B?a(D,{sx:{overflowX:"auto",width:"100%"},children:V(gn,{children:[a(bn,{children:At()}),a(mn,{children:o.map((t,e)=>a(xn,{item:t,"data-index":e,children:Ve(e,t)},f?String(f(t,e)):e))}),Y?a(yn,{children:Nt()}):null]})}):a(Kn,{ref:nt,data:o,totalCount:L?o.length+1:o.length,defaultItemHeight:ve,fixedItemHeight:qe?void 0:ve,fixedHeaderContent:At,fixedFooterContent:Y?Nt:void 0,itemContent:Ve,...Gt&&f?{computeItemKey:(t,e)=>e?f(e,t):`vdt-${t}`}:{},endReached:fn,scrollerRef:t=>{rt.current=t instanceof HTMLElement?t:null,Oe()},totalListHeightChanged:Oe,style:{height:"100%"},increaseViewportBy:{top:Qt,bottom:en},overscan:rn,followOutput:!1,components:hn},sn),o.length===0&&!u&&!vt&&b&&typeof Q=="string"&&a(D,{sx:{position:B?"static":"absolute",top:oe,left:0,right:0,py:6,textAlign:"center",fontSize:14,color:m.emptyColor,pointerEvents:"none"},children:Q}),o.length===0&&!u&&!vt&&!(b&&typeof Q=="string")&&a(D,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,pointerEvents:"none","& > *":{pointerEvents:"auto"}},children:typeof Q=="string"?V(Ie,{children:[a(D,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),a(Yn,{variant:"body1",sx:{color:"text.secondary"},children:Q})]}):Q}),Bt,cn&&a(Ie,{children:Pe?a(Pe,{visible:u,onComplete:Rt}):a(Ft,{visible:u,onComplete:Rt,size:40,indicator:a(Wt,{}),sx:{top:`${i.some(t=>t.group)?oe*2:oe}px`,bottom:`${Y?me??$:0}px`},background:{show:o.length===0,opacity:.8}})})]}),zt=b&&ue?{paddingRight:Ne,paddingTop:Yt,paddingBottom:Yt}:{};return ne?a(Xn,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:Ne,...zt,boxSizing:"border-box",height:B?"auto":"100%",minHeight:0,flex:B?"none":1,display:"flex",flexDirection:"column"},children:Ot}):a(D,{className:"grow",style:{padding:0,paddingLeft:Ne,...zt,boxSizing:"border-box",height:B?"auto":"100%",minHeight:0,flex:B?"none":1,display:"flex",flexDirection:"column"},children:Ot})}var Qn=_n(Jn);export{ut as HEADER_MENU_FONT_SIZE,j as HEADER_MENU_ICON_PATHS,pt as HEADER_MENU_ICON_SIZE,ft as HEADER_MENU_ITEM_HEIGHT,$t as HEADER_MENU_ITEM_SX,ht as HeaderFilterIcon,gt as HeaderMenu,$e as HeaderMenuDivider,ge as HeaderMenuIcon,G as HeaderMenuItem,Qn as VirtualDataTable,zn as headerMenuAnchor};
4
+ `;function jt({size:a=54}){return Nn(An,{children:[Ut("style",{children:Pn}),Ut("span",{className:"vdt-css-spinner",role:"progressbar","aria-label":"loading",style:{display:"inline-block",width:a,height:a}})]})}import Xe,{useMemo as On,useState as zn}from"react";import{Box as De,Divider as _n,InputBase as Wn,Menu as Fn,MenuItem as Vn,SvgIcon as $n}from"@mui/material";import{jsx as h,jsxs as Ue}from"react/jsx-runtime";var ft=14,ht=18,gt=34,j={asc:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",desc:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",checked:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",unchecked:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",radioOn:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",radioOff:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",filter:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z",search:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"};function be({d:a,size:u=ht,color:i}){return h($n,{sx:{fontSize:u,flexShrink:0,color:i},children:h("path",{d:a})})}function bt({size:a=14,active:u,color:i}){let C={stroke:"currentColor",strokeWidth:1.8,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"};return Ue(De,{component:"svg",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,sx:{width:a,height:a,flexShrink:0,color:u?"primary.main":i??"currentColor",verticalAlign:"middle"},children:[h("path",{d:"M2 17.5H7",...C}),h("path",{d:"M22 6.5H17",...C}),h("path",{d:"M13 17.5H22",...C}),h("path",{d:"M11 6.5H2",...C}),h("path",{d:"M10 20.3999C8.34315 20.3999 7 19.0568 7 17.3999C7 15.743 8.34315 14.3999 10 14.3999C11.6569 14.3999 13 15.743 13 17.3999C13 19.0568 11.6569 20.3999 10 20.3999Z",...C}),h("path",{d:"M14 9.3999C15.6569 9.3999 17 8.05676 17 6.3999C17 4.74305 15.6569 3.3999 14 3.3999C12.3431 3.3999 11 4.74305 11 6.3999C11 8.05676 12.3431 9.3999 14 9.3999Z",...C})]})}var Kt={gap:1,fontSize:ft,lineHeight:"20px",minHeight:gt,py:"7px",px:1.5};function G({icon:a,iconSpace:u,selected:i,disabled:C,muted:g,onClick:d,sx:N,children:K}){return Ue(Vn,{selected:i,disabled:C,onClick:d,sx:[Kt,g?{color:"text.secondary"}:{},...Array.isArray(N)?N:N?[N]:[]],children:[a??(u?h(De,{component:"span",sx:{width:ht,flexShrink:0}}):null),K]})}function Ye(){return h(_n,{sx:{my:"4px !important"}})}function Xn(a,u){let i=a.getBoundingClientRect();return{left:u??i.left,top:i.bottom}}function mt({open:a,anchorPosition:u,anchorEl:i,onClose:C,sort:g,filter:d,header:N,children:K,minWidth:oe=180,maxHeight:Q=420}){let[J,L]=zn(""),O=d?.multiple!==!1,B=d?.value??[],P=On(()=>{if(!d)return[];let c=d.options;return d.emptyLabel&&!c.some(R=>R.value==="")?[...c,{value:"",label:d.emptyLabel}]:c},[d]),M=!!d&&(d?.searchable??P.length>10),k=J.trim().toLowerCase(),ae=k?P.filter(c=>c.label.toLowerCase().includes(k)):P,V=()=>{L(""),C()},T=[];if(N&&T.push(...Xe.Children.toArray(N).map((c,R)=>Xe.isValidElement(c)?Xe.cloneElement(c,{key:`h${R}`}):c)),g){let c=R=>{V(),g.onChange(g.active===R&&g.clearable!==!1?null:R)};T.push(h(G,{selected:g.active==="asc",onClick:()=>c("asc"),icon:h(be,{d:j.asc,color:"text.secondary"}),children:"\uC624\uB984\uCC28\uC21C \uC815\uB82C"},"sort-asc"),h(G,{selected:g.active==="desc",onClick:()=>c("desc"),icon:h(be,{d:j.desc,color:"text.secondary"}),children:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C"},"sort-desc")),g.active&&g.clearable!==!1&&T.push(h(G,{muted:!0,iconSpace:!0,onClick:()=>{V(),g.onChange(null)},children:"\uC815\uB82C \uD480\uAE30"},"sort-clear"))}return g&&d&&T.push(h(Ye,{},"div-sort")),d&&(M&&T.push(Ue(De,{onKeyDown:c=>c.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1,px:1.5,pb:.5,minHeight:gt},children:[h(be,{d:j.search,color:"text.secondary"}),h(Wn,{autoFocus:!0,value:J,onChange:c=>L(c.target.value),placeholder:d.searchPlaceholder??"\uCC3E\uAE30",sx:{flex:1,fontSize:ft}})]},"search")),!O&&d.allLabel&&T.push(h(G,{selected:B.length===0,onClick:()=>{V(),d.onChange([])},icon:h(be,{d:B.length===0?j.radioOn:j.radioOff,color:B.length===0?"primary.main":"text.disabled"}),children:d.allLabel},"f-all")),P.length===0&&T.push(h(G,{disabled:!0,iconSpace:!0,children:d.emptyText??"\uACE0\uB97C \uAC12\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},"f-none")),ae.forEach(c=>{let R=B.includes(c.value),E=()=>{if(O){d.onChange(R?B.filter(ie=>ie!==c.value):[...B,c.value]);return}V(),d.onChange(R?[]:[c.value])},q=O?R?j.checked:j.unchecked:R?j.radioOn:j.radioOff;T.push(Ue(G,{selected:!O&&R,onClick:E,icon:h(be,{d:q,color:R?"primary.main":"text.disabled"}),children:[c.icon,h(De,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.render??c.label}),typeof c.count=="number"?h(De,{component:"span",sx:{color:"text.secondary",ml:1,fontVariantNumeric:"tabular-nums"},children:c.count}):null]},`f:${c.value||"(empty)"}`))}),M&&k&&ae.length===0&&T.push(h(G,{disabled:!0,iconSpace:!0,children:"\uCC3E\uB294 \uAC12\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},"f-nohit")),B.length>0&&T.push(h(Ye,{},"div-filter"),h(G,{muted:!0,iconSpace:!0,onClick:()=>{V(),d.onChange([])},children:d.clearLabel??"\uAC70\uB974\uAE30 \uD480\uAE30"},"f-clear"))),K&&(T.length>0&&T.push(h(Ye,{},"div-children")),T.push(...Xe.Children.toArray(K))),h(Fn,{open:a&&(!!u||!!i),...!u&&!!i?{anchorEl:i}:{anchorReference:"anchorPosition",anchorPosition:u??void 0},onClose:V,transitionDuration:0,disableAutoFocusItem:M,onContextMenu:c=>c.preventDefault(),onClick:c=>c.stopPropagation(),slotProps:{paper:{sx:{maxHeight:Q,minWidth:oe}},list:{sx:{py:.5}}},children:T})}import tr from"@ehfuse/overlay-scrollbar";import{Fragment as Pe,jsx as o,jsxs as I}from"react/jsx-runtime";var nr={alignment:"default",margin:0,radius:0},yt=5,rr={bg:"#ffffff",border:"#e6e6e3",borderStrong:"#dedddb",headerColor:"#787774",hoverBg:"#f8f8f7",emptyColor:"#9b9a97",selectedBg:"#dbeafe",selectedBar:"#3b82f6"},Gt="12px",or={bg:"#1e1e1e",border:"#2c333c",borderStrong:"#3b434e",headerColor:"#a3adbb",hoverBg:"#272d36",emptyColor:"#7d8590",selectedBg:"rgba(59, 130, 246, 0.22)",selectedBar:"#60a5fa"},ar="(max-width:599.95px)";function Ct(a){return!!(a.filterOptions&&a.onFilterChange)}function ir({data:a,loading:u=!1,columns:i,onRowClick:C,getRowId:g,selectedRowId:d,selectedRowSx:N,rowHeight:K,columnHeight:oe,striped:Q,rowDivider:J=!0,onSort:L,onSortClear:O,onHeaderContextMenu:B,onLoadMore:P,sortBy:M,sortDirection:k,showPaper:ae=!0,paddingX:V,paddingTop:T=0,paddingBottom:me=0,rowHoverColor:c,rowHoverOpacity:R,viewportBuffer:E,overscan:q,scrollbars:ie,emptyMessage:ee="NO DATA",autoHeight:z=!1,LoadingComponent:Ae,showFooter:Ke,footerHeight:xe,footerSx:ye,variant:Zt="default",framed:pe=!0,headerTopBorder:Qt=!1,rowHeightMode:Jt="fixed",tableLayout:Ne="fixed",renderFullWidthRow:qe,fullWidthRowSx:Ce,onRowContextMenu:Mt,pinnedRows:Me,pinnedRowsMaxHeight:Ge,pinnedRowsSx:ve,resetScrollOnDataChange:vt=!0,rowKeyFromId:en=!1,onEndReached:wt,colorMode:tn,mobile:St}){let x=Zt==="notion",Ze=Qn(),b=(tn??Ze.palette.mode)==="dark"?or:rr,Tt=(Me?.length??0)>0,le=oe??(x?40:56),$=K??(x?48:50),Oe=pe?V??(x?"12px":"1rem"):0,we=St===!0?{}:St||null,nn=Jn(we?.query??ar,{noSsr:!0}),X=!!we&&nn,Qe=Jt==="auto"||X,Je=c??(x?b.hoverBg:void 0),Rt=R??(x?1:void 0),rn=Math.max($*12,480),on=Math.max($*12,480),an=typeof E=="number"?E:E?.top??rn,ln=typeof E=="number"?E:E?.bottom??on,sn=Math.max($*8,420),dn=Math.max($*10,520),cn=typeof q=="number"?q:{main:q?.main??sn,reverse:q?.reverse??dn},Se=$+(J?1:0),un=ne(()=>x?{backgroundColor:b.selectedBg,"& > td:first-of-type":{boxShadow:`inset 3px 0 0 ${b.selectedBar}`},"& > td[data-vdt-pinned]":{backgroundColor:b.selectedBg}}:void 0,[x,b]),Y=N??un,ze=!Y||typeof Y!="function",pn=ne(()=>!ze||d===null||d===void 0||!Y?null:{[`& tbody tr[data-row-id="${String(d).replace(/["\\]/g,"\\$&")}"]`]:Y},[ze,d,Y]),sr=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),[v]=Ie(()=>typeof window>"u"?!1:window.localStorage.getItem("vdt-perf-debug")==="1"),m=S({wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}),et=A(t=>{if(!v)return;let e=m.current;if(!(e.wheelEvents>0||e.rangeChangedCalls>0||e.rowContentCalls>0||e.cellRenderCalls>0))return;let s=e.rowContentCalls>0?e.rowContentMs/e.rowContentCalls:0,f=e.cellRenderCalls>0?e.cellRenderMs/e.cellRenderCalls:0;console.log("[VDT perf]",{reason:t,wheel:{events:e.wheelEvents,inputPx:Math.round(e.wheelInputPx),handlerMs:Number(e.wheelHandlerMs.toFixed(2)),rafFlushes:e.wheelRafFlushes,rafMs:Number(e.wheelRafMs.toFixed(2))},rangeChanged:{calls:e.rangeChangedCalls,totalMs:Number(e.rangeChangedMs.toFixed(2))},rowContent:{calls:e.rowContentCalls,totalMs:Number(e.rowContentMs.toFixed(2)),avgMs:Number(s.toFixed(3)),maxMs:Number(e.rowContentMaxMs.toFixed(3))},cellRender:{calls:e.cellRenderCalls,totalMs:Number(e.cellRenderMs.toFixed(2)),avgMs:Number(f.toFixed(3)),maxMs:Number(e.cellRenderMaxMs.toFixed(3))}}),m.current={wheelEvents:0,wheelInputPx:0,wheelHandlerMs:0,wheelRafFlushes:0,wheelRafMs:0,rangeChangedCalls:0,rangeChangedMs:0,rowContentCalls:0,rowContentMs:0,rowContentMaxMs:0,cellRenderCalls:0,cellRenderMs:0,cellRenderMaxMs:0}},[v]);Z(()=>{if(!v||typeof window>"u")return;console.log("[VDT perf] enabled (localStorage vdt-perf-debug=1)");let t=window.setInterval(()=>{et("interval")},1500);return()=>{window.clearInterval(t),et("cleanup")}},[et,v]);let Ht=ne(()=>je((t,e)=>{let r=S(null),s=S(0),f=S(null);return Z(()=>{let n=r.current;if(!n)return;let l=H=>{let p=v?performance.now():0;if(H.shiftKey||Math.abs(H.deltaX)>Math.abs(H.deltaY))return;let D=H.target?.closest?.("[data-vdt-inner-scroll]");if(D&&n.contains(D)&&(H.deltaY<0?D.scrollTop>0:D.scrollTop+D.clientHeight<D.scrollHeight-1))return;H.preventDefault();let te=H.deltaY;H.deltaMode===1?te*=40:H.deltaMode===2&&(te*=n.clientHeight),v&&(m.current.wheelEvents+=1,m.current.wheelInputPx+=te),s.current+=te,f.current===null&&(f.current=requestAnimationFrame(()=>{let he=v?performance.now():0,w=Math.max(n.clientHeight*.4,160),W=Math.max(-w,Math.min(w,s.current));s.current=0,f.current=null,W!==0&&(n.scrollTop+=W),v&&(m.current.wheelRafFlushes+=1,m.current.wheelRafMs+=performance.now()-he)}),v&&(m.current.wheelHandlerMs+=performance.now()-p))};return n.addEventListener("wheel",l,{passive:!1}),()=>{n.removeEventListener("wheel",l),f.current!==null&&(cancelAnimationFrame(f.current),f.current=null),s.current=0}},[]),o(tr,{detectInnerScroll:!0,track:nr,...ie,children:o(jn,{component:y,...t,ref:n=>{r.current=n,typeof e=="function"?e(n):e&&(e.current=n)},sx:{userSelect:"auto",WebkitUserSelect:"auto",position:"relative",width:"100%",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none",msOverflowStyle:"none",transform:"translateZ(0)",backfaceVisibility:"hidden",willChange:"scroll-position","&::-webkit-scrollbar":{display:"none"},"& .MuiTable-root":{paddingRight:x?0:Oe,paddingTop:T,paddingBottom:me}}})})}),[]),tt=ne(()=>{if(Q===!0)return"#f5f5f5";if(typeof Q=="string")return Q},[Q]),[fn,kt]=Ie(u),[hn,gn]=Ie(0);Z(()=>{u&&kt(!0)},[u]);let Et=A(()=>{kt(!1)},[]),bn=fn,dr=u&&a.length>0,nt=S(!1),rt=S(-1),ot=S(null),at=S(null),[mn,xn]=Ie(!1),_e=A(()=>{let t=at.current;t&&xn(t.scrollHeight>t.clientHeight+1)},[]);Z(()=>{let t=at.current;if(!t||typeof ResizeObserver>"u")return;let e=new ResizeObserver(()=>_e());return e.observe(t),()=>e.disconnect()},[_e,z]);let it=S(C);it.current=C;let Te=S(g);Te.current=g;let lt=S(Mt);lt.current=Mt;let Lt=S(wt);Lt.current=wt;let Dt=S(null),We=ne(()=>{let t=new Map,e=0;return i.forEach(r=>{r.pinned==="left"&&(t.set(String(r.id),e),e+=typeof r.width=="number"?r.width:0)}),t},[i]),st=ne(()=>{if(i.some(t=>typeof t.minWidth=="number"))return i.reduce((t,e)=>t+(typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:0),0)},[i]),fe=A((t,e)=>{let r=We.get(String(t.id));return r===void 0?{}:{position:"sticky",left:r,zIndex:e?3:1}},[We]),Fe=!!C,Re=S(!1),se=S({x:0,y:0});Z(()=>{let t=e=>{let r=e.clientX-se.current.x,s=e.clientY-se.current.y;Math.sqrt(r*r+s*s)>yt&&(Re.current=!0)};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}},[]),Z(()=>{let t=document.querySelector('[data-testid="virtuoso-scroller"]');t&&t.querySelectorAll(".MuiTableSortLabel-root").forEach(r=>{let s=new MouseEvent("mouseleave",{bubbles:!0,cancelable:!0});r.dispatchEvent(s)})},[M]);let Ve=A(t=>{if(!L)return;L(t,M===t&&k==="asc"?"desc":"asc")},[L,M,k]),[He,It]=Ie(null),Bt=S(B);Bt.current=B;let Pt=S(L);Pt.current=L;let ke=A((t,e)=>{if(!t){e.preventDefault();return}t.headerProps?.onContextMenu?.(e);let r=e.defaultPrevented;if(r||(r=Bt.current?.(t,e)===!0||e.defaultPrevented),e.preventDefault(),r||t.headerMenu===!1||!!!((t.sortMenu??t.sortable)&&Pt.current)&&!Ct(t))return;let f=e.currentTarget.getBoundingClientRect();It({colId:String(t.id),x:e.clientX,y:f.bottom})},[]),de=A(t=>{if(!Ct(t))return t.text;let e=!!(t.filterValues&&t.filterValues.length>0);return I(y,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",color:e?"primary.main":void 0,fontWeight:e?600:void 0,verticalAlign:"middle"},children:[o(y,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.text}),o(bt,{active:e})]})},[]),yn=A(t=>{let e=v?performance.now():0;if(Lt.current?.(),!P){v&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e);return}if(u&&a.length===0){v&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e);return}let r=a.length>=30,s=t>=a.length-1,f=rt.current===a.length;if(s&&r&&!nt.current&&!f){nt.current=!0,rt.current=a.length;let n=a.length;P(n,50)}v&&(m.current.rangeChangedCalls+=1,m.current.rangeChangedMs+=performance.now()-e)},[a.length,u,P,v]);Z(()=>{u||(nt.current=!1)},[u]),Z(()=>{a.length===0&&gn(t=>t+1)},[a.length]);let At=S(vt);At.current=vt;let dt=S(a.length),ct=S(void 0);Z(()=>{let t=dt.current,e=a.length,r=e>0?Te.current?Te.current(a[0],0):a[0]:void 0,s=ct.current;if(e>t&&t>0){dt.current=e,ct.current=r;return}let f=e<t||t>0&&r!==s;f&&(rt.current=-1),ot.current&&e>0&&f&&At.current&&ot.current.scrollToIndex({index:0,align:"start",behavior:"auto"}),dt.current=e,ct.current=r},[a]);let Nt=A(()=>{let t={},e=[];if(i.forEach(n=>{n.group?(t[n.group]||(t[n.group]=[]),t[n.group].push(n)):e.push(n)}),!(Object.keys(t).length>0))return o(Be,{children:i.map(n=>o(re,{align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>ke(n,l),style:{width:n.width,minWidth:n.width??n.minWidth,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...fe(n,!0),...n.headerProps?.style},children:n.sortable?o("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:I(y,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Ve(String(n.id)),children:[de(n),o(xt,{active:M===n.id,direction:M===n.id?k:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:M===n.id?1:0,transition:"opacity 0.2s ease","& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):de(n)},String(n.id)))});let s=[...e.map(n=>o(re,{rowSpan:2,align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>ke(n,l),style:{width:n.width,minWidth:n.width,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...fe(n,!0),...n.headerProps?.style},children:n.sortable&&L?o("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:I(y,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Ve(String(n.id)),children:[de(n),o(xt,{active:M===n.id,direction:M===n.id?k:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:M===n.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(180deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(0deg)"}}})]})}):de(n)},String(n.id))),...Object.entries(t).map(([n,l])=>o(re,{align:"center",colSpan:l.length,onContextMenu:H=>ke(null,H),style:{fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px"},children:n},n))],f=[...Object.values(t).flat().map(n=>o(re,{align:n.align||"left",title:typeof n.text=="string"?n.text:void 0,...n.headerProps,onContextMenu:l=>ke(n,l),style:{width:n.width,minWidth:n.width,...n.style,fontWeight:"bold",position:"sticky",top:0,zIndex:2,padding:"16px",...fe(n,!0),...n.headerProps?.style},children:n.sortable&&L?o("div",{style:{display:"flex",alignItems:"center",justifyContent:n.align==="center"?"center":n.align==="right"?"flex-end":"flex-start",position:"relative",width:"100%"},children:I(y,{className:"vdt-sort-box",sx:{position:"relative",cursor:"default","&:hover .MuiTableSortLabel-root":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}}},onClick:()=>Ve(String(n.id)),children:[de(n),o(xt,{active:M===n.id,direction:M===n.id?k:"desc",sx:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"4px",minWidth:"auto",width:"16px",height:"16px",cursor:"default",opacity:M===n.id?1:0,transition:"opacity 0.2s ease","&:hover":{opacity:"1 !important","& .MuiSvgIcon-root":{color:"#000",opacity:"1 !important"}},"& .MuiTableSortLabel-icon":{position:"relative",marginLeft:0,marginRight:0,opacity:1,transition:"color 0.2s ease"},"& .MuiTableSortLabel-iconDirectionAsc":{transform:"rotate(0deg)"},"& .MuiTableSortLabel-iconDirectionDesc":{transform:"rotate(180deg)"}}})]})}):de(n)},String(n.id)))];return I(Pe,{children:[o(Be,{children:s}),o(Be,{children:f})]})},[i,M,k,Ve,L,le,fe,ke,de]),Ot=ne(()=>{let t=i.filter(r=>r.mobile!==!1),e=t.find(r=>r.mobile==="title")??t.find(r=>!r.mobile);return{title:e,thumb:t.filter(r=>r.mobile==="thumb"),badge:t.filter(r=>r.mobile==="badge"),sub:t.filter(r=>r.mobile==="sub"),meta:t.filter(r=>r!==e&&(!r.mobile||r.mobile==="meta"))}},[i]),zt=A((t,e)=>{if(we?.renderRow)return we.renderRow(t,e);let r=p=>p.render?p.render(t,e):String(t[p.id]??""),{title:s,thumb:f,badge:n,sub:l,meta:H}=Ot;return I(y,{sx:{display:"flex",gap:"12px",alignItems:"flex-start",py:"12px",px:"14px",minWidth:0},children:[f.map(p=>o(y,{sx:{flexShrink:0},children:r(p)},String(p.id))),I(y,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[(s||n.length>0)&&I(y,{sx:{display:"flex",alignItems:"flex-start",gap:"8px",minWidth:0},children:[o(y,{sx:{flex:1,minWidth:0,fontSize:15,fontWeight:500,overflowWrap:"anywhere"},children:s?r(s):null}),n.map(p=>o(y,{sx:{flexShrink:0},children:r(p)},String(p.id)))]}),l.map(p=>o(y,{sx:{fontSize:13,color:b.headerColor,minWidth:0},children:r(p)},String(p.id))),H.length>0&&o(y,{sx:{display:"flex",flexWrap:"wrap",gap:"2px 12px",fontSize:13,minWidth:0},children:H.map(p=>{let D=p.mobileLabel===!1?null:p.mobileLabel??(typeof p.text=="string"?p.text:null);return I(y,{sx:{display:"inline-flex",alignItems:"center",gap:"4px",minWidth:0,maxWidth:"100%"},children:[D?o(y,{component:"span",sx:{color:b.headerColor,flexShrink:0},children:D}):null,o(y,{component:"span",sx:{minWidth:0,"& > *":{width:"auto !important",textAlign:"left !important"}},children:r(p)})]},String(p.id))})})]})]})},[we,Ot,b]),$e=A((t,e)=>{let r=v?performance.now():0;if(!e){if(v){m.current.rowContentCalls+=1;let l=performance.now()-r;m.current.rowContentMs+=l,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,l)}return null}if(X)return o(re,{colSpan:i.length,"data-vdt-pad":"",sx:{padding:0},children:zt(e,t)});let s=qe?qe(e,t):null;if(s!=null)return o(re,{colSpan:i.length,"data-vdt-pad":"",sx:[{padding:x?"0 14px":"8px 16px"},...Array.isArray(Ce)?Ce:Ce?[Ce]:[]],children:s});let f=0,n=i.map((l,H)=>{if(f>0)return f-=1,null;let p=l.colSpan?Math.max(1,Math.min(l.colSpan(e,t),i.length-H)):1;f=p-1;let D=v?performance.now():0,te=l.render?l.render(e,t):String(e[l.id]||"");if(v){let F=performance.now()-D;m.current.cellRenderCalls+=1,m.current.cellRenderMs+=F,m.current.cellRenderMaxMs=Math.max(m.current.cellRenderMaxMs,F)}let he=We.has(String(l.id)),w=l.cellPadding!==void 0,W=l.rowSpan?l.rowSpan(e,t):1;if(W<=0)return null;let ce=l.onCellClick;return o(re,{align:l.align||"left",rowSpan:W>1?W:void 0,colSpan:p>1?p:void 0,"data-vdt-pad":w?"":void 0,"data-vdt-pinned":he?"":void 0,"data-vdt-cell-click":ce?"":void 0,onClick:ce?F=>{let ge=F.clientX-se.current.x,ue=F.clientY-se.current.y;F.stopPropagation(),!(Math.sqrt(ge*ge+ue*ue)>yt)&&ce(e,t,F)}:void 0,style:{...p>1?{}:{width:l.width,minWidth:l.width??l.minWidth},...l.primary?{fontSize:15}:{},...l.style,...l.cellStyle?l.cellStyle(e,t):{},padding:w?l.cellPadding:"8px 16px",...fe(l,!1)},children:te},String(l.id))});if(v){m.current.rowContentCalls+=1;let l=performance.now()-r;m.current.rowContentMs+=l,m.current.rowContentMaxMs=Math.max(m.current.rowContentMaxMs,l)}return o(Pe,{children:n})},[i,v,qe,Ce,x,We,fe,X,zt]),_t=A(()=>{let t=Nt();if(!Me||Me.length===0)return t;let e=Dt.current;return I(Pe,{children:[t,o("tr",{"data-vdt-pinned-area":"",children:o("td",{colSpan:i.length,style:{padding:0,border:0},children:o(y,{"data-vdt-inner-scroll":"",sx:[{maxHeight:Ge,overflowY:Ge?"auto":"visible",overflowX:"hidden",scrollbarWidth:"thin",borderBottom:`1px solid ${x?b.borderStrong:"rgba(224, 224, 224, 1)"}`,"& tbody tr:last-of-type > td":{borderBottom:"none"}},...Array.isArray(ve)?ve:ve?[ve]:[]],children:I("table",{style:{width:"100%",tableLayout:Ne,borderCollapse:"separate",borderSpacing:0},children:[o("colgroup",{children:i.map(r=>o("col",{style:{width:r.width,minWidth:r.width??r.minWidth}},String(r.id)))}),o(qt,{children:Me.map((r,s)=>e?o(e,{item:r,"data-index":s,"data-vdt-pinned-row":"",children:$e(s,r)},g?String(g(r,s)):`p${s}`):null)})]})})})})]})},[Nt,Me,Ge,ve,i,$e,Ne,g,x,b]),U=Ke??i.some(t=>typeof t.footer=="function"),Wt=A(()=>{if(!U)return null;let t=[];for(let e=0;e<i.length;e+=1){let r=i[e],s=r.footerColSpan&&r.footerColSpan>1?Math.min(r.footerColSpan,i.length-e):1;t.push(o(re,{align:r.align||"left",colSpan:s>1?s:void 0,style:{...s>1?{}:{width:r.width,minWidth:r.width},...r.style,fontWeight:"bold",padding:x?"0 14px":"16px"},children:r.footer?r.footer(a):null},String(r.id))),e+=s-1}return o(Be,{children:t})},[U,i,a,x]),ut=ne(()=>({Scroller:Ht,Table:t=>o(Un,{...t,sx:{borderCollapse:"separate",tableLayout:Ne,...st&&!X?{minWidth:st}:{},marginRight:pe?"16px":0,...U?{height:"100%"}:{}}}),TableHead:je((t,e)=>o(Kn,{...t,ref:e,sx:{userSelect:"none","& > tr":{height:le,"& > th":{padding:"16px",position:"sticky",top:0,zIndex:2,fontWeight:"bold"}}}})),TableRow:t=>{let{item:e,selected:r,"aria-selected":s,className:f,...n}=t,l=n["data-index"]??0,H=l%2===1,p=e&&Te.current?Te.current(e,l):l,D=!ze&&d!==null&&d!==void 0&&p===d,te=D&&Y?typeof Y=="function"?Y(e,l):Y:void 0,he=String(f??"").split(/\s+/).filter(w=>w!=="Mui-selected"&&w!=="Mui-focusVisible").join(" ");return o(Be,{...n,"data-row-id":p!=null?String(p):void 0,className:he||void 0,selected:D,onMouseDown:w=>{Re.current=!1,se.current={x:w.clientX,y:w.clientY}},onContextMenu:w=>{e&&lt.current&&lt.current(e,l,w)},onClick:w=>{let W=w.clientX-se.current.x,ce=w.clientY-se.current.y;if(Math.sqrt(W*W+ce*ce)>yt||Re.current){w.preventDefault(),w.stopPropagation(),Re.current=!1;return}e&&it.current&&it.current(e,l),Re.current=!1},sx:[{userSelect:"none",...Qe?{"& > td":{height:Se}}:{height:Se,maxHeight:Se},boxSizing:"border-box",backgroundColor:H&&tt?tt:"transparent","& td:not([data-vdt-pad])":{padding:"8px 16px"},"& td":{boxSizing:"border-box",borderBottom:J?"1px solid rgba(224, 224, 224, 1)":"none"},"& th":{padding:"8px 16px",borderBottom:"none"},"&:hover":Fe&&!D?{backgroundColor:w=>{let W=w.palette.mode==="dark",F=Je??"#000000",ge=Rt??.06;if(!Je)return W?`rgba(255, 255, 255, ${ge})`:`rgba(0, 0, 0, ${ge})`;let ue=F.replace("#","").trim();if(ue.length!==6)return F;let Hn=parseInt(ue.substring(0,2),16),kn=parseInt(ue.substring(2,4),16),En=parseInt(ue.substring(4,6),16);return`rgba(${Hn}, ${kn}, ${En}, ${ge})`}}:void 0,cursor:Fe?"pointer":void 0},te]})},TableBody:je((t,e)=>{let{children:r,...s}=t;return I(qt,{...s,ref:e,sx:U?{height:"100%"}:void 0,children:[r,U&&o("tr",{"aria-hidden":!0,style:{height:"100%"},children:o("td",{colSpan:i.length,style:{padding:0,border:0}})})]})}),TableFoot:je((t,e)=>o(qn,{...t,ref:e,sx:[{"& tr":{height:xe??$,maxHeight:xe??$,boxSizing:"border-box"},"& td":{height:xe??$,boxSizing:"border-box",backgroundColor:r=>r.palette.mode==="dark"?"#1e1e1e":"#ffffff",padding:"0 16px",color:"inherit",fontSize:"0.875rem",border:"none",boxShadow:`inset 0 1px 0 0 ${x?b.borderStrong:"#000000"}`}},...Array.isArray(ye)?ye:ye?[ye]:[]]}))}),[Fe,ze?null:d,Y,$,tt,J,le,Je,Rt,Ht,xe,ye,U,x,b,i,Ne,pe,Qe,st,X]);Dt.current=ut.TableRow;let Cn=ut,Ee=ut,Mn=Ee.Table,vn=Ee.TableHead,wn=Ee.TableBody,Sn=Ee.TableRow,Tn=Ee.TableFoot,_=He?i.find(t=>String(t.id)===He.colId):void 0,Rn=()=>It(null),Ft=null;if(He&&_){let t=String(_.id),e=!!((_.sortMenu??_.sortable)&&L),r=Ct(_),s=M===t?k:void 0;Ft=o(mt,{open:!0,anchorPosition:{left:He.x,top:He.y},onClose:Rn,sort:e?{active:s??null,clearable:!!O,onChange:f=>{f?L?.(t,f):O?.()}}:void 0,filter:r?{options:_.filterOptions??[],value:_.filterValues??[],onChange:f=>_.onFilterChange?.(f),multiple:_.filterMultiple!==!1,emptyLabel:_.filterEmptyLabel,searchable:_.filterSearchable}:void 0})}let Vt=I(y,{sx:{position:"relative",height:z?"auto":"100%",width:"100%","& .MuiTableHead-root":{backgroundColor:t=>x?`${b.bg} !important`:t.palette.mode==="dark"?"#1e1e1e !important":"#ffffff !important"},...pn??{},"& tbody td[data-vdt-pinned]":{backgroundColor:x?b.bg:Ze.palette.background.paper},"& tbody td[data-vdt-cell-click]":{cursor:"pointer"},"& tbody td[data-vdt-cell-click]:hover":{backgroundColor:x?b.hoverBg:Ze.palette.mode==="dark"?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.04)"},...x&&Fe?{"& tbody tr:hover td[data-vdt-pinned]":{backgroundColor:b.hoverBg}}:{},...x?{...pe?{border:`1px solid ${b.borderStrong}`,borderRadius:"4px"}:{"& table":{backgroundColor:b.bg}},overflow:"hidden","& thead tr th > *":{verticalAlign:"middle"},"& thead > tr > th":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},"& thead > tr > th > *":{maxWidth:"100%"},"& thead .vdt-sort-box":{paddingRight:"20px"},"& thead .vdt-sort-box > .MuiTableSortLabel-root":{left:"auto !important",right:0,marginLeft:"0 !important"},"& thead tr th":{height:le,boxSizing:"border-box",padding:"0 14px !important",fontSize:13,fontWeight:"500 !important",color:b.headerColor,backgroundColor:`${b.bg} !important`,borderTop:!pe&&Qt?`1px solid ${b.borderStrong}`:"none",borderBottom:`1px solid ${b.borderStrong}`,borderRight:`1px solid ${b.border}`,"&:last-of-type":{borderRight:"none"}},"& tbody tr td:not([data-vdt-pad])":{padding:"0 14px !important"},"& tbody tr td":{fontSize:14,borderBottom:`1px solid ${b.border}`},...a.length>0&&(z||mn||U)?{[`& tbody tr[data-index="${a.length-1}"]:not([data-vdt-pinned-row]) td`]:{borderBottom:"none"}}:{}}:{}},children:[z?o(y,{sx:{overflowX:"auto",width:"100%"},children:I(Mn,{children:[X?null:o(vn,{children:_t()}),o(wn,{children:a.map((t,e)=>o(Sn,{item:t,"data-index":e,children:$e(e,t)},g?String(g(t,e)):e))}),U&&!X?o(Tn,{children:Wt()}):null]})}):o(er,{ref:ot,data:a,totalCount:P?a.length+1:a.length,defaultItemHeight:Se,fixedItemHeight:Qe?void 0:Se,fixedHeaderContent:X?void 0:_t,fixedFooterContent:U&&!X?Wt:void 0,itemContent:$e,...en&&g?{computeItemKey:(t,e)=>e?g(e,t):`vdt-${t}`}:{},endReached:yn,scrollerRef:t=>{at.current=t instanceof HTMLElement?t:null,_e()},totalListHeightChanged:_e,style:{height:"100%"},increaseViewportBy:{top:an,bottom:ln},overscan:cn,followOutput:!1,components:Cn},hn),a.length===0&&!u&&!Tt&&x&&typeof ee=="string"&&o(y,{sx:{position:z?"static":"absolute",top:X?0:le,left:0,right:0,py:6,textAlign:"center",fontSize:14,color:b.emptyColor,pointerEvents:"none"},children:ee}),a.length===0&&!u&&!Tt&&!(x&&typeof ee=="string")&&o(y,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,pointerEvents:"none","& > *":{pointerEvents:"auto"}},children:typeof ee=="string"?I(Pe,{children:[o(y,{sx:{width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",backgroundColor:"#f5f5f5",color:"#999"},children:"\u{1F4C4}"}),o(Zn,{variant:"body1",sx:{color:"text.secondary"},children:ee})]}):ee}),Ft,bn&&o(Pe,{children:Ae?o(Ae,{visible:u,onComplete:Et}):o(Yt,{visible:u,onComplete:Et,size:40,indicator:o(jt,{}),sx:{top:`${i.some(t=>t.group)?le*2:le}px`,bottom:`${U?xe??$:0}px`},background:{show:a.length===0,opacity:.8}})})]}),$t=x&&pe?{paddingRight:Oe,paddingTop:Gt,paddingBottom:Gt}:{};return ae?o(Gn,{className:"grow",elevation:1,sx:{padding:0,paddingLeft:Oe,...$t,boxSizing:"border-box",height:z?"auto":"100%",minHeight:0,flex:z?"none":1,display:"flex",flexDirection:"column"},children:Vt}):o(y,{className:"grow",style:{padding:0,paddingLeft:Oe,...$t,boxSizing:"border-box",height:z?"auto":"100%",minHeight:0,flex:z?"none":1,display:"flex",flexDirection:"column"},children:Vt})}var lr=Yn(ir);export{ft as HEADER_MENU_FONT_SIZE,j as HEADER_MENU_ICON_PATHS,ht as HEADER_MENU_ICON_SIZE,gt as HEADER_MENU_ITEM_HEIGHT,Kt as HEADER_MENU_ITEM_SX,bt as HeaderFilterIcon,mt as HeaderMenu,Ye as HeaderMenuDivider,be as HeaderMenuIcon,G as HeaderMenuItem,lr as VirtualDataTable,Xn as headerMenuAnchor};
5
5
  /**
6
6
  * Virtual Data Table - A high-performance virtual data table component for React
7
7
  *