@agile-team/mach-table 0.34.1 → 0.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/mach-table.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @agile-team/mach-table
|
|
6
6
|
|
|
7
|
-
MachTable 0.34.
|
|
7
|
+
MachTable 0.34.2 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、区段隔离状态持久化和可诊断扩展系统。本版完善内置空态的表格插画、亮暗配色与两级文案;可选 `/business` 的字典列策略、本地语义合计及字典缓存隔离继续兼容;普通根入口 API 和既有默认行为保持兼容。
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
pnpm add @agile-team/mach-table
|
|
@@ -142,3 +142,5 @@ const statusColumn = {
|
|
|
142
142
|
`ColDef.valueParser` 统一编辑、粘贴和导入的规范值;`valueSerializer` 按 clipboard/csv/xlsx 定义输出,沿用已有 `columnTypes` 优先级。排序/过滤读取规范值,可信事务与撤销不重复解析。`api.io.importMatrix()` / `exportMatrix()` 直传类型,完整导入预览从当前包的 `/import` 导入 `createImportPlan()`,不加载到默认入口。
|
|
143
143
|
|
|
144
144
|
`sum` / `avg` / `min` / `max` 只聚合有限数,空数值集合返回 null,sum/avg 溢出返回 null;`count` 计全部记录,空集合为 0。自定义聚合保留原始输入。分组 ID 区分数字/文本/空值,旧展开路径仅在唯一时迁移,歧义报告错误。超大远程滚动使用有界物理坐标,API、滚轮和交互共用逻辑偏移;应用默认配置的 `dataProcessor` 使用每表工厂。完整边界与升级说明见[升级指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/upgrading.md)。
|
|
145
|
+
|
|
146
|
+
冻结区由正文视口统一管理滚动,原生焦点恢复和 `scrollIntoView` 不会单独改变其滚动位置。业务定位继续使用 `api.view.scrollToRow()`,无需页面补丁。
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var nr=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var po=Object.prototype.hasOwnProperty;var fo=(n,e)=>{for(var t in e)nr(n,t,{get:e[t],enumerable:!0})},mo=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ho(e))!po.call(n,i)&&i!==t&&nr(n,i,{get:()=>e[i],enumerable:!(r=uo(e,i))||r.enumerable});return n};var go=n=>mo(nr({},"__esModule",{value:!0}),n);var qa={};fo(qa,{BUILTIN_AGG_FUNCS:()=>xe,DEFAULT_LOCALE:()=>x,EVENT_TYPES:()=>ge,LOCALE_EN:()=>_i,actionsColumn:()=>jn,advancedFilterCondition:()=>si,advancedFilterGroup:()=>ai,applyGridViewState:()=>Xr,buildColDefsFromSchema:()=>Kn,captureGridViewState:()=>Yr,clearGridState:()=>Sn,createActionButtonsRenderer:()=>we,createAggResolver:()=>Xe,createBusinessColumnTypes:()=>io,createCachedDictionary:()=>jr,createColumnHelper:()=>Xn,createDictionaryRenderer:()=>no,createEnterprisePreset:()=>Zn,createGrid:()=>Bn,createGridViewManager:()=>lo,createLocalGridStateStore:()=>Pr,createLocalGridViewStore:()=>Jr,createMachTableCommands:()=>Wn,createMachTablePreset:()=>Ur,createProgressBarRenderer:()=>Hr,createRemoteExportRequest:()=>zn,createRowActionsRenderer:()=>Xt,createStatusTagRenderer:()=>Or,defineColumns:()=>Jn,defineGridOptions:()=>eo,defineMachTableConfig:()=>to,defineMachTablePreset:()=>Qn,describeFilter:()=>Gt,downloadFile:()=>Lt,dragColumn:()=>qn,escapeHtml:()=>ae,formatText:()=>K,formatTwo:()=>me,getByPath:()=>_,indexColumn:()=>Un,isColDefGroup:()=>he,isSafePath:()=>ze,linkRenderer:()=>Vr,loadGridState:()=>qt,matchLocaleKey:()=>bt,normalizeAdvancedFilterModel:()=>B,normalizeColumnFilter:()=>_e,normalizeFilterModel:()=>Y,normalizeGridState:()=>$,normalizeGridViewState:()=>rr,normalizeSavedGridView:()=>Ce,parseCsv:()=>at,parseDelimited:()=>lt,parseTsv:()=>st,resolveGridFeatures:()=>Qt,resolveSaveConflict:()=>sn,resolveTagVariant:()=>Fr,rowActionsColumn:()=>Yn,sanitizeFormulaCell:()=>ie,saveGridState:()=>Ut,selectionColumn:()=>$n,setByPath:()=>de,toTsv:()=>ot,validateGridOptions:()=>Jt,version:()=>Ua});module.exports=go(qa);var Ve="0.34.1";function f(n,e,t){let r=document.createElement(n);if(e&&(r.className=e),t)for(let i of Object.keys(t))r.setAttribute(i,t[i]);return r}function P(n,e){if(n.classList.add("mach-portal"),!e)return;let t=window.getComputedStyle(e);for(let r=0;r<t.length;r++){let i=t.item(r);if(!i.startsWith("--mach-"))continue;let o=t.getPropertyValue(i).trim();o&&n.style.setProperty(i,o)}n.style.colorScheme=t.colorScheme}function E(n,e,t){return n<e?e:n>t?t:n}function j(n,e,t=4){let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.bottom+t,s=o+i.height>window.innerHeight-8?r.top-i.height-t:o;n.style.left=`${E(r.left,8,Math.max(8,window.innerWidth-i.width-8))}px`,n.style.top=`${E(s,8,Math.max(8,window.innerHeight-i.height-8))}px`}var Zr=0;function Qr(n="rg"){return Zr++,`${n}-${Zr}`}var ei='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3.5h12L9.5 8v4.5L6.5 14V8L2 3.5z"/></svg>',ti='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 3l4 5H4l4-5z"/></svg>',ri='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 13l4-5H4l4 5z"/></svg>',ii='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round"><path d="M2 4h3m3 0h6M2 8h7m3 0h2M2 12h1m3 0h8"/><circle cx="6.5" cy="4" r="1.35"/><circle cx="10.5" cy="8" r="1.35"/><circle cx="4.5" cy="12" r="1.35"/></svg>';var Be=class{constructor(e){this.ld=e;this.It=new Map}on(e,t){let r=this.It.get(e);return r||(r=new Set,this.It.set(e,r)),r.add(t),()=>{r.delete(t)}}once(e,t){let r=this.on(e,i=>{r(),t(i)});return r}Af(e,t){let r=this.It.get(e);r&&(r.delete(t),r.size===0&&this.It.delete(e))}emit(e,t){let r=this.It.get(e);if(r)for(let i of[...r])try{i(t)}catch(o){console.error(`[mach-table] error in "${e}" listener`,o),this.ld?.(o,e)}}clear(){this.It.clear()}};var vo=new Set(["__proto__","prototype","constructor"]),Te=new Map;function or(n){if(typeof n!="string"||n.length===0)return null;let e=Te.get(n);if(e!==void 0)return e;let t=n.split("."),r=t.every(i=>i.length>0&&!vo.has(i))?t:null;return n.length<=1024&&(Te.size>=256&&Te.delete(Te.keys().next().value),Te.set(n,r)),r}function ze(n){return or(n)!==null}function _(n,e){if(n==null)return;let t=or(e);if(!t)return;let r=n;for(let i of t){if(r==null)return;r=r[i]}return r}function de(n,e,t){if(n==null)return!1;let r=or(e);if(!r)return!1;let i=n;for(let o=0;o<r.length-1;o++){if(typeof i!="object"&&typeof i!="function"||i===null)return!1;i[r[o]]==null&&(i[r[o]]={}),i=i[r[o]]}return typeof i!="object"&&typeof i!="function"||i===null?!1:(i[r[r.length-1]]=t,!0)}var ce={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange","blank","notBlank"],date:["equals","notEquals","lessThan","greaterThan","inRange","blank","notBlank"]};var bo=16,wo=512,Co=20,To=2e3,Do=2e3,Eo={text:new Set(ce.text),number:new Set(ce.number),date:new Set(ce.date)};function xo(n){return n==null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}function Ro(n,e,t){if(n==null||typeof n!="object")return null;let r=n;return typeof r.match!="string"||!t.has(r.match)?null:{match:r.match,...So(r,e)}}function So(n,e){let t=e==="number"?ni(n.value):typeof n.value=="string"?n.value:void 0,r=e==="number"?ni(n.value2):typeof n.value2=="string"?n.value2:void 0;return{...t!==void 0?{value:t}:{},...r!==void 0?{value2:r}:{}}}function ni(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Mo(n,e){let t=[],r=Eo[e];for(let i of n.slice(0,Co)){let o=Ro(i,e,r);o&&t.push(o)}return t}function _e(n){if(n==null||typeof n!="object")return null;let e=n;return e.type==="set"?Array.isArray(e.values)?{type:"set",values:e.values.filter(xo).slice(0,To)}:null:e.type!=="text"&&e.type!=="number"&&e.type!=="date"||!Array.isArray(e.conditions)?null:{type:e.type,...e.operator==="or"||e.operator==="and"?{operator:e.operator}:{},conditions:Mo(e.conditions,e.type)}}function Io(n,e){if(typeof n.colId!="string"||!n.colId.trim())return null;let t=n.colId.trim();if(e.validColumnIds?.has(t)===!1)return null;let r=_e(n.filter);return r?{kind:"condition",colId:t,filter:r}:null}function Ao(n,e,t){if(!Array.isArray(n.children))return null;let r=[];for(let i of n.children){let o=oi(i,e+1,t);o&&r.push(o)}return r.length===0?null:{kind:"group",operator:n.operator==="or"?"or":"and",children:r,...n.not===!0?{not:!0}:{}}}function Lo(n,e,t){return e<=bo&&t.nodes<wo&&n!=null&&typeof n=="object"}function oi(n,e,t){if(!Lo(n,e,t)||t.ancestors.has(n))return null;t.ancestors.add(n),t.nodes++;let r=n,i=r.kind==="condition"?Io(r,t):r.kind==="group"?Ao(r,e,t):null;return t.ancestors.delete(n),i}function B(n,e){if(n==null||typeof n!="object")return null;let t=n;if(t.version!==1||t.root==null)return null;let r=oi(t.root,0,{ancestors:new WeakSet,nodes:0,validColumnIds:e});return r?{version:1,root:r}:null}function si(n,e){return{kind:"condition",colId:n,filter:e}}function Y(n,e){if(n==null||typeof n!="object"||Array.isArray(n))return{};let t={};for(let[r,i]of Object.entries(n).slice(0,Do)){let o=r.trim();if(!o||e?.has(o)===!1)continue;let s=_e(i);s&&(t[o]=s)}return t}function ai(n,e,t={}){return{kind:"group",operator:n,children:e,...t.not?{not:!0}:{}}}function F(n,e,t=!1){if(!(typeof n!="number"||!Number.isFinite(n)||n<e))return t?Math.floor(n):n}function Ke(n){return!n||typeof n.key!="string"||!n.key.trim()?null:{key:n.key.trim(),debounceMs:F(n.debounceMs,0,!0)??160,...n.sections?{sections:[...new Set(n.sections)]}:{},...n.store?{store:n.store}:{}}}function A(n,e,t,r=!1){let i=!1;for(let o of t)(r?Object.prototype.hasOwnProperty.call(n,o):n[o]!=null)&&(e[o]=n[o],i=!0);return i}var sr={align:"center",sortable:!0,resizable:!0,movable:!0,filter:!1,minWidth:80},De={compact:{rowHeight:30,headerHeight:34,fontSize:12,cellPadding:6},normal:{rowHeight:36,headerHeight:40,fontSize:13,cellPadding:9},large:{rowHeight:44,headerHeight:48,fontSize:14,cellPadding:12}},Ee={multiSort:!0,stripedRows:!1,showCellBorders:!1,quickFilterText:null,suppressCellFocus:!1,suppressRowHoverHighlight:!1,suppressNoRowsOverlay:!1,suppressHeaderFocus:!1,loading:!1,error:null,className:"",singleClickEdit:!1,manualSorting:!1,manualFiltering:!1,showSummary:!1,indexOffset:0,applyRowDrag:!0,masterDetail:!1,detailToggleColumn:!0,treeData:!1,childrenKey:"children",autoCheckedChildren:!0,defaultExpandAll:!1,columnMenu:!1,suppressWarnings:!1,enableRangeSelection:!1,suppressClipboard:!1,contextMenu:!1,flashCells:!0,fillHandle:!0,ariaLabel:"MachTable data grid",ariaLabelledBy:"",ariaDescribedBy:"",overlayNoRowsTemplate:"",overlayLoadingTemplate:"",overlayErrorTemplate:"",allowUnsafeOverlayHtml:!1},ko=Object.keys(Ee);function Po(n){let e={};for(let t of ko)e[t]=n[t]??Ee[t];return e}function I(n,e,t,r=!1){return F(n,t,r)??e}function Go(n){return n&&Object.prototype.hasOwnProperty.call(De,n)?n:"normal"}function No(n){return n.theme==="light"||n.theme==="dark"||n.theme==="auto"?n.theme:"light"}function Fo(n,e){let t=typeof n.pagination=="object"&&Array.isArray(n.pagination.pageSizeOptions)?n.pagination.pageSizeOptions:void 0,r=t?[...new Set(t.map(i=>I(i,0,1,!0)).filter(Boolean))]:[10,20,50,100];return r.includes(e)||r.push(e),r.sort((i,o)=>i-o)}function ar(n,e){let t=typeof n=="function"?n(e):_(e,n);return t==null?"":String(t)}function Oo(n){let e=n.rowKey,t=e?({data:r})=>ar(e,r):void 0;return{...t?{resolveRowId:t}:{},...e?{rowKey:e}:{}}}function Ho(n,e){let t=De[e];return{columnDefs:Array.isArray(n.columnDefs)?n.columnDefs:[],rowData:Array.isArray(n.rowData)?n.rowData:[],defaultColDef:{...sr,...n.defaultColDef??{}},columnTypes:n.columnTypes??{},...Oo(n),rowHeight:I(n.rowHeight,t.rowHeight,1),headerHeight:I(n.headerHeight,t.headerHeight,1),rowBuffer:I(n.rowBuffer,8,0,!0),columnLayout:n.columnLayout==="fit"?"fit":"normal",enableColumnResize:n.enableColumnResize===!0,domLayout:n.domLayout==="autoHeight"?"autoHeight":"normal",rowSelection:n.rowSelection==="single"||n.rowSelection==="multiple"?n.rowSelection:"none",size:e,pinnedTopRowData:Array.isArray(n.pinnedTopRowData)?n.pinnedTopRowData:[],pinnedBottomRowData:Array.isArray(n.pinnedBottomRowData)?n.pinnedBottomRowData:[]}}function Vo(n){return{rowStyleRules:Array.isArray(n.rowStyleRules)?n.rowStyleRules:[],theme:No(n)}}function Bo(n){return{editType:n.editType==="fullRow"?"fullRow":"cell",editableIndicator:n.editableIndicator==="always"||n.editableIndicator==="none"?n.editableIndicator:"hover",rowDragPolicy:n.rowDragPolicy,undoStackSize:I(n.undoStackSize,100,0,!0),asyncTransactionWaitMillis:I(n.asyncTransactionWaitMillis,16,0,!0)}}function zo(n){return{detailRowHeight:I(n.detailRowHeight,240,1)}}function _o(n){let e=typeof n.pagination=="object"?n.pagination:void 0,t=I(e?.pageSize,20,1,!0);return{paginationEnabled:n.pagination!==!1&&n.datasource==null,paginationMode:e?.mode==="server"?"server":"client",paginationPage:I(e?.page,1,1,!0),paginationTotal:I(e?.total,0,0,!0),paginationPageSize:t,paginationPageSizeOptions:Fo(n,t),paginationShowTotal:e?e.showTotal!==!1:!0,paginationShowSizeSelector:e?e.showPageSizeSelector!==!1:!0}}function lr(n){return{watermarkEnabled:n.watermark!=null&&n.watermark!==!1,watermarkConfig:n.watermark==null||n.watermark===!1?null:n.watermark===!0?{text:"MachTable"}:n.watermark}}function Ko(n){return{advancedFilterModel:B(n.advancedFilterModel),persistence:Ke(n.persistence),locale:n.locale??{},tooltipShowDelay:I(n.tooltipShowDelay,600,0),statusBarEnabled:n.statusBar===!0||typeof n.statusBar=="object"&&n.statusBar!=null,statusBarPanels:typeof n.statusBar=="object"&&n.statusBar?.panels?n.statusBar.panels:["rowCount","selectedRowCount","rangeAggregate"]}}function Wo(n){return{datasourceMode:n.datasourceMode==="block"?"block":"sequential",blockSize:I(n.blockSize,100,1,!0),infiniteBufferRows:I(n.infiniteBufferRows,40,0,!0),maxBlocksInCache:I(n.maxBlocksInCache,12,1,!0),datasourceMaxConcurrentRequests:I(n.datasourceMaxConcurrentRequests,4,1,!0),blockPrefetch:I(n.blockPrefetch,1,0,!0),datasourceRowCount:n.datasourceRowCount==null?null:I(n.datasourceRowCount,0,0,!0),dataProcessorMinRows:I(n.dataProcessorMinRows,5e3,1,!0),datasourceRetryCount:I(n.datasourceRetryCount,2,0,!0),datasourceRetryDelay:I(n.datasourceRetryDelay,300,0,!0),datasourceRetryJitter:Math.min(1,I(n.datasourceRetryJitter,.15,0))}}var $o=["detailRowRenderer","isRowExpandable","aggFuncs","components","actionPolicy","summaryMethod","datasource","getRowHeight","tooltipComponent","getContextMenuItems","initialState","rowEditValidator","isTreeRowExpandable","loadTreeChildren","dataProcessor"];function Uo(n,e){for(let t of $o)n[t]&&Reflect.set(e,t,n[t])}function qo(n,e){for(let t of Object.keys(n))t.startsWith("on")&&typeof n[t]=="function"&&Reflect.set(e,t,n[t])}function li(n){let e=Go(n.size),t={...Po(n),...Ho(n,e),...Vo(n),...Bo(n),...zo(n),..._o(n),...lr(n),...Ko(n),...Wo(n),features:Array.isArray(n.features)?n.features:[]};return Uo(n,t),qo(n,t),t}function di(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.length>0):typeof n=="string"&&n.length>0?[n]:[]}function ue(n,e){return di(n.type).includes(e)}function ci(n,e,t={}){let r={};for(let i of di(n.type)){let o=t[i];o&&Object.assign(r,o)}return{...e,...r,...n}}var U=class{constructor(e,t){this.manualWidth=null;this.contentWidth=null;this.flex=null;this.currentWidth=0;this.parentGroup=null;this.level=0;this.isDetailToggle=!1;this.id=e,this.colDef=t,this.hide=t.hide??!1;let r=t.pinned;this.pinned=r===!0?"left":r===!1||r==null?null:r,this.resetWidth()}get sortable(){return this.colDef.sortable!==!1}get resizable(){return this.colDef.resizable!==!1}get movable(){return this.colDef.movable!==!1}get filterable(){return this.colDef.filter!=null&&this.colDef.filter!==!1}get filterType(){let e=this.colDef.filter;return e===!0?"text":e??"text"}get hasCheckbox(){return this.colDef.checkboxSelection===!0}resetWidth(){this.manualWidth=null,this.contentWidth=null,this.flex=typeof this.colDef.flex=="number"&&Number.isFinite(this.colDef.flex)&&this.colDef.flex>0?this.colDef.flex:null}};var ee=class n{constructor(e,t){this.parent=null;this.children=[];this.groupId=e,this.def=t}get headerName(){return this.def.headerName??this.def.groupId??""}getLeafColumns(e=[]){for(let t of this.children)t instanceof n?t.getLeafColumns(e):e.push(t);return e}};function he(n){return Array.isArray(n.children)}function We(n,e){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:e}function ui(n){let e=We(n.minWidth,80);return{min:e,max:Math.max(e,We(n.maxWidth,Number.MAX_SAFE_INTEGER))}}function V(n,e){let{min:t,max:r}=ui(e),i=We(n,We(e.width,150));return Math.max(t,Math.min(r,i))}function hi(n,e){let t=n.map(s=>V(s.width??150,s)),r=[],i=0;n.forEach((s,a)=>{let l=s.flex??0;l>0&&(r.push(a),i+=l)});let o=0;for(let s of t)o+=s;if(i>0&&e>o){let s=e-o;for(let a=0;a<4&&s>.5&&r.length>0;a++){let l=[],d=0;for(let p of r){let m=n[p].flex??0;l.push(p),d+=m}let c=[];for(let p=0;p<l.length;p++){let m=l[p],v=n[m].flex??0,w=s*v/d,C=t[m];t[m]=V(C+w,n[m]),c.push(t[m]-C)}let u=0;for(let p of c)u+=p;s-=u;let h=l.filter((p,m)=>c[m]>.001);if(h.length===l.length)break;r.length=0;for(let p of h)r.push(p)}}return t}function jo(n,e,t){let r=new Set(n.map((o,s)=>s)),i=t;for(let o=0;o<n.length+1&&r.size>0;o++){let s=0;for(let l of r)s+=Math.max(1,e[l]);if(s<=0)break;let a=!1;for(let l of[...r]){let d=i*(Math.max(1,e[l])/s),c=V(d,n[l]),{min:u,max:h}=ui(n[l]);(d<u||d>h)&&(e[l]=c,i-=c,r.delete(l),a=!0)}if(!a){for(let l of r)e[l]=V(i*(Math.max(1,e[l])/s),n[l]);break}i=Math.max(0,i)}}function Yo(n,e,t){let r=t-e.reduce((i,o)=>i+o,0);if(!(Math.abs(r)<=.01))for(let i=e.length-1;i>=0;i--){let o=V(e[i]+r,n[i]);if(Math.abs(o-e[i])>.01){e[i]=o;return}}}function $e(n,e){let t=n.map(r=>V(r.width??150,r));return!Number.isFinite(e)||e<=0||n.length===0||(jo(n,t,e),Yo(n,t,e)),t}var dr="__rg_detail_toggle__";function pe(n){return typeof n=="number"&&Number.isFinite(n)&&n>0}var Ue=class{constructor(e){this.e=e;this.columns=[];this.Ss=new Map;this.ye=[];this.left=[];this.center=[];this.right=[];this.sortModel=[];this.defs=[];this.At=1;this.vn=new Map;this.dd=0}ar(e){this.defs=e?[...e]:[];let t=new Map(this.columns.map(s=>[s.id,s])),r=this.e.r.defaultColDef,i=new Set(this.e.r.masterDetail&&this.e.r.detailToggleColumn?[dr]:[]),o=(s,a,l)=>s.map((d,c)=>{if(he(d)){let C=d.groupId??d.headerName??`group_${c}_${l}`,R=new ee(C,d);return R.parent=a,R.children=o(d.children,R,l+1),R}let u=d,h=u.colId??u.field??`col_${c}`,p=h,m=2;for(;i.has(p);)p=`${h}_${m++}`;i.add(p);let v=new U(p,ci(u,r,this.e.r.columnTypes));v.parentGroup=a,v.level=l;let w=t.get(p);return w&&(v.manualWidth=w.manualWidth,v.contentWidth=w.contentWidth,v.flex=w.flex,v.hide=w.hide,v.pinned=w.pinned),v});if(this.ye=o(this.defs,null,0),this.e.r.masterDetail&&this.e.r.detailToggleColumn){let s=new U(dr,{colId:dr,headerName:"",width:38,pinned:"left",sortable:!1,resizable:!1,movable:!1,filter:!1});s.isDetailToggle=!0,this.ye.unshift(s)}if(this.columns=this.Yr(this.ye),this.Ss=new Map(this.columns.map(s=>[s.id,s])),this.At=this.columns.reduce((s,a)=>Math.max(s,a.level+1),1),this.sortModel=this.sortModel.filter(s=>this.columns.some(a=>a.id===s.colId)),this.sortModel.length===0){let s=[];for(let a of this.columns)a.colDef.initialSort&&s.push({colId:a.id,direction:a.colDef.initialSort});this.sortModel=s}this.Lt()}Yr(e,t=[]){for(let r of e)r instanceof ee?this.Yr(r.children,t):t.push(r);return t}Lt(){let e=this.columns.filter(t=>!t.hide);this.left=e.filter(t=>t.pinned==="left"),this.right=e.filter(t=>t.pinned==="right"),this.center=e.filter(t=>t.pinned===null),this.vn.clear(),this.c().forEach((t,r)=>this.vn.set(t.id,r))}Me(e){return this.vn.get(e)??-1}X(){return this.columns}Xr(){return this.defs}cd(){return this.ye}ud(){return this.At}L(e){return this.Ss.get(e)}C(e){return e==="left"?this.left:e==="right"?this.right:this.center}c(){return[...this.left,...this.center,...this.right]}ze(){return this.c().filter(e=>e.colDef.rowGroup===!0)}hd(){return this.c().filter(e=>e.colDef.aggFunc!=null&&e.colDef.rowGroup!==!0)}bn(){return this.center.some(e=>e.colDef.colSpan!=null)}Ms(){let e=this.c();return this.center.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e[0]}lr(e){return e.pinned==="left"?"left":e.pinned==="right"?"right":"center"}Is(e){this.dd=e;let t=0;for(let c of[...this.left,...this.right])c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),t+=c.currentWidth;let r=Math.max(0,e-t),i=[],o=[];for(let c of this.center)(c.colDef.suppressSizeToFit||c.manualWidth!=null?o:i).push(c);let s=0;for(let c of o)c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),s+=c.currentWidth;let a=i.map(c=>this.ct(c)),l=Math.max(0,r-s),d=this.e.r.columnLayout==="fit"?$e(a,l):hi(a,l);i.forEach((c,u)=>{c.currentWidth=d[u]})}ct(e){let t=e.colDef;return{width:e.manualWidth??e.contentWidth??t.width,minWidth:t.minWidth,maxWidth:t.maxWidth,flex:e.manualWidth==null?e.flex??void 0:void 0}}Ie(e,t){return pe(t)?(e.manualWidth=V(t,this.ct(e)),e.flex=null,!0):!1}As(e,t){return pe(t)?(e.resetWidth(),e.contentWidth=V(t,this.ct(e)),!0):!1}wn(e,t){let r=this.L(e);!r||r.hide===!t||(r.hide=!t,this.Lt())}ut(e,t){let r=this.L(e);if(!r)return!1;let i=this.lr(r),o=u=>r.parentGroup?!0:this.lr(u)===i,s=r.parentGroup?r.parentGroup.children:this.ye,a=s.filter(u=>u instanceof U&&!u.hide&&o(u)),l=a.indexOf(r);if(l<0)return!1;a.splice(l,1);let d=Math.max(0,Math.min(t,a.length));a.splice(d,0,r);let c=[];return s.forEach((u,h)=>{u instanceof U&&!u.hide&&o(u)&&c.push(h)}),c.length!==a.length?!1:(c.forEach((u,h)=>{s[u]=a[h]}),this.columns=this.Yr(this.ye),this.Lt(),!0)}Cn(e,t){let r=this.L(e);!r||!r.movable||(r.pinned=t,this.Lt())}Jr(){return this.columns.map(e=>({colId:e.id,hide:e.hide,width:e.manualWidth??e.currentWidth,flex:e.flex,widthMode:e.manualWidth==null?"auto":"manual",contentWidth:e.contentWidth??void 0,pinned:e.pinned}))}Ls(e){let t=new Map(e.map(r=>[r.colId,r]));for(let r of this.columns){let i=t.get(r.id);i&&this.pd(r,i)}this.fd(e),this.Lt()}pd(e,t){typeof t.hide=="boolean"&&(e.hide=t.hide),t.widthMode==="auto"?(e.resetWidth(),pe(t.flex)&&(e.flex=t.flex)):pe(t.flex)?(e.flex=t.flex,e.manualWidth=null):pe(t.width)&&(e.manualWidth=V(t.width,this.ct(e)),e.flex=null),pe(t.contentWidth)&&(e.contentWidth=V(t.contentWidth,this.ct(e))),e.movable&&(t.pinned==="left"||t.pinned==="right"||t.pinned===null)&&(e.pinned=t.pinned)}fd(e){let t=new Map;e.forEach((i,o)=>t.set(i.colId,o));let r=i=>i.pinned==="left"?"left":i.pinned==="right"?"right":"center";for(let i of["left","center","right"]){let o=this.ye.filter(d=>d instanceof U&&!d.hide&&d.parentGroup===null&&r(d)===i);if(o.length<2)continue;let s=o.filter(d=>d.movable),a=s.slice().sort((d,c)=>(t.get(d.id)??Number.MAX_SAFE_INTEGER)-(t.get(c.id)??Number.MAX_SAFE_INTEGER));if(a.every((d,c)=>d===s[c]))continue;let l=[];this.ye.forEach((d,c)=>{d instanceof U&&!d.hide&&d.parentGroup===null&&r(d)===i&&d.movable&&l.push(c)}),l.forEach((d,c)=>{this.ye[d]=a[c]})}this.columns=this.Yr(this.ye)}Tn(){for(let e of this.columns){e.resetWidth(),e.hide=e.colDef.hide??!1;let t=e.colDef.pinned;e.pinned=t===!0?"left":t===!1||t==null?null:t}this.Lt()}U(){return this.sortModel.map(e=>({...e}))}dr(e){if(!e||e.length===0){this.sortModel=[];return}this.sortModel=e.filter(t=>this.columns.some(r=>r.id===t.colId)&&(t.direction==="asc"||t.direction==="desc")).map(t=>({colId:t.colId,direction:t.direction}))}Zr(e,t){let r=[...this.sortModel],i=r.findIndex(l=>l.colId===e.id),o=i>=0?r[i].direction:null,s=o===null?"asc":o==="asc"?"desc":null;t&&this.e.r.multiSort?s===null?i>=0&&r.splice(i,1):i>=0?r[i]={colId:e.id,direction:s}:r.push({colId:e.id,direction:s}):(r.length=0,s&&r.push({colId:e.id,direction:s})),this.sortModel=r}};function te(n,e){if(n instanceof Error)return n;let t=new Error(typeof n=="string"?n:e);return t.name="AbortError",t}var Xo=()=>te(void 0,"[MachTable] Operation cancelled.");function qe(n,e,t=Xo){return e?new Promise((r,i)=>{let o=()=>{e.removeEventListener("abort",o),i(t())};if(n.then(r,i).finally(()=>e.removeEventListener("abort",o)),e.aborted){o();return}e.addEventListener("abort",o,{once:!0})}):n}function fi(n){return n==null?"":String(n).toLowerCase()}function Jo(n,e,t){let r=fi(n),i=o=>{let s=(o.value??"").toLowerCase();switch(o.match){case"contains":return r.includes(s);case"notContains":return!r.includes(s);case"equals":return r===s;case"notEquals":return r!==s;case"startsWith":return r.startsWith(s);case"endsWith":return r.endsWith(s);case"blank":return r==="";case"notBlank":return r!=="";default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Zo(n,e,t){switch(t.match){case"equals":return n===e;case"notEquals":return n!==e;case"lessThan":return n<e;case"lessThanOrEqual":return n<=e;case"greaterThan":return n>e;case"greaterThanOrEqual":return n>=e;case"inRange":return n>=e&&n<=(t.value2??e);default:return!0}}function Qo(n,e){let t=n==null||n==="";if(e.match==="blank")return t;if(e.match==="notBlank")return!t;if(t)return!1;let r=typeof n=="number"?n:Number(n);if(Number.isNaN(r))return!1;let i=e.value;return i==null||Number.isNaN(i)?!1:Zo(r,i,e)}function es(n,e,t){let r=i=>Qo(n,i);return e.length===0||(t==="or"?e.some(r):e.every(r))}function cr(n){if(n==null||n==="")return null;if(n instanceof Date)return isNaN(n.getTime())?null:n.getTime();if(typeof n=="number")return n;let e=Date.parse(String(n));return isNaN(e)?null:e}function ts(n,e,t){let r=cr(n),i=o=>{let s=r==null;if(o.match==="blank")return s;if(o.match==="notBlank")return!s;if(s)return!1;let a=r,l=o.value!=null?cr(o.value):null;if(l==null)return!1;switch(o.match){case"equals":return a===l;case"notEquals":return a!==l;case"lessThan":return a<l;case"greaterThan":return a>l;case"inRange":{let d=o.value2!=null?cr(o.value2):null;return d!=null?a>=l&&a<=d:a>=l}default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function rs(n,e){return e.length===0?!0:e.some(t=>t==null&&n==null||t===n)}function mi(n,e){let t=e.type!=="set"&&e.operator==="or"?"or":"and";switch(e.type){case"text":return Jo(n,e.conditions,t);case"number":return es(n,e.conditions,t);case"date":return ts(n,e.conditions,t);case"set":return rs(n,e.values);default:return!0}}function gi(n,e,t){if(n.kind==="condition"){let i=e.get(n.colId);return i?o=>mi(t(o,i),n.filter):()=>!0}let r=n.children.map(i=>gi(i,e,t));return i=>{let o=n.operator==="or"?r.some(s=>s(i)):r.every(s=>s(i));return n.not?!o:o}}function ur(n,e,t,r,i){let o=new Map(n.map(d=>[d.id,d])),s=Object.entries(e).flatMap(([d,c])=>{let u=o.get(d);return u?[{column:u,filter:c}]:[]}),a=t?gi(t.root,o,i):()=>!0,l=r?.trim().toLowerCase().split(/\s+/).filter(Boolean)??[];return d=>!s.every(({column:c,filter:u})=>mi(i(d,c),u))||!a(d)?!1:l.every(c=>n.some(u=>fi(i(d,u)).includes(c)))}var yi=typeof Intl<"u"?new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}):null;function is(n,e){let t=n==null||n==="",r=e==null||e==="";return!t&&!r?null:t&&r?0:t?1:-1}function ns(n,e){let t=Number.isNaN(n),r=Number.isNaN(e);return t||r?t===r?0:t?1:-1:n-e}function os(n,e){return n===e?0:n?1:-1}function je(n,e){let t=is(n,e);if(t!==null)return t;if(typeof n=="number"&&typeof e=="number")return ns(n,e);if(n instanceof Date&&e instanceof Date)return n.getTime()-e.getTime();if(typeof n=="boolean"&&typeof e=="boolean")return os(n,e);let r=String(n),i=String(e);return yi?yi.compare(r,i):r.localeCompare(i)}function hr(n,e,t,r){let i=new Map(t.map(a=>[a.id,a])),o=e.flatMap(a=>{let l=i.get(a.colId);return l?[{column:l,compare:l.colDef.comparator??je,direction:a.direction}]:[]}),s=n.map(a=>({node:a,values:o.map(({column:l})=>r(a,l))}));return s.sort((a,l)=>{for(let d=0;d<o.length;d++){let c=o[d],u=c.compare(a.values[d],l.values[d],a.node,l.node);if(u!==0)return c.direction==="asc"?u:-u}return 0}),s.map(({node:a})=>a)}function vi(){return{count:0,numeric:0,sum:0,min:1/0,max:-1/0}}function bi(n,e){n.count++,!(typeof e!="number"||!Number.isFinite(e))&&(n.numeric++,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e))}function wi(n,e){return e==="count"?n?.count??0:n?.numeric?e==="min"?n.min:e==="max"?n.max:Number.isFinite(n.sum)?e==="avg"?n.sum/n.numeric:n.sum:null:null}function Ye(n,e){let t=vi();for(let r of n)bi(t,r);return wi(t,e)}var xe={sum:n=>Ye(n,"sum"),avg:n=>Ye(n,"avg"),count:n=>n.length,min:n=>Ye(n,"min"),max:n=>Ye(n,"max"),first:n=>n.length>0?n[0]:null,last:n=>n.length>0?n[n.length-1]:null};function Ci(n,e,t){if(e===xe.count)return n.length;let r=["sum","avg","min","max"].find(o=>e===xe[o]);if(!r)return e(n.map(t));let i=vi();for(let o of n)bi(i,t(o));return wi(i,r)}function Xe(n){let e={...xe,...n??{}};return t=>e[t]}var Je="group:";function Ti(n){return n==null?"null":n instanceof Date?JSON.stringify(["date",String(n.getTime())]):JSON.stringify([typeof n,pr(n)])}function pr(n){return n==null?"(\u7A7A)":String(n)}function Di(n){return Je+JSON.stringify(n)}function ss(n,e,t){let r=new Map;for(let i of n){let o=t(i,e),s=Ti(o),a=r.get(s);a||(a={key:s,label:pr(o),rows:[]},r.set(s,a)),a.rows.push(i)}return[...r.values()].sort((i,o)=>i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})||i.key.localeCompare(o.key))}function Ei(n,e,t,r,i){let o=[],s=(a,l,d)=>{if(l===e.length)return{display:a,leaves:a};let c=[],u=[];for(let h of ss(a,e[l],t)){let p=[...d,[e[l].id,h.key]],m=Di(p);o.push(m);let v=s(h.rows,l+1,p);if(c.push({id:m,data:null,rowIndex:-1,selected:!1,isGroup:!0,groupLevel:l,groupKey:h.label,leafNodes:v.leaves,aggValues:r(v.leaves)}),i.has(m))for(let w of v.display)c.push(w);if(l>0)for(let w of v.leaves)u.push(w)}return{display:c,leaves:u}};return{rows:s(n,0,[]).display,ids:o}}function xi(n,e,t,r){let i=new Set([...n].filter(l=>l.startsWith("/g0:")));if(!i.size)return{expanded:n,ambiguous:[]};let o=new Map;for(let l of e){let d=[],c="";for(let u=0;u<t.length;u++){let h=r(l,t[u]);if(d.push([t[u].id,Ti(h)]),c+=`/g${u}:${pr(h)}`,!i.has(c))continue;let p=Di(d);o.set(c,o.has(c)&&o.get(c)!==p?null:p)}}let s=new Set([...n].filter(l=>!i.has(l))),a=[];for(let l of i){let d=o.get(l);d?s.add(d):d===null?a.push(l):s.add(l)}return{expanded:s,ambiguous:a}}function as(n,e){let t=n?[n.root]:[];for(;t.length;){let r=t.pop();if(r.kind==="condition")e.add(r.colId);else for(let i of r.children)t.push(i)}}function Ri(n){let e=new Set(Object.keys(n.filterModel));as(n.advancedFilter,e);let t=new Set(n.sortModel.map(a=>a.colId));for(let a of t)e.add(a);let r=n.columns.some(a=>a.colDef.rowGroup===!0),i=!!n.quickFilter?.trim(),o=n.columns.filter(a=>e.has(a.id)||i||a.colDef.rowGroup===!0||r&&a.colDef.aggFunc!=null),s=new Set;for(let a of o){let l=a.colDef;if(r&&l.rowGroup!==!0&&l.aggFunc!=null&&n.customAggregates?.[l.aggFunc]||l.valueGetter||t.has(a.id)&&l.comparator||!l.field)return null;s.add(l.field)}return[...s]}function Si(n){return n!=null&&(typeof n=="object"||typeof n=="function")}function Mi(n,e){let t=new WeakMap;for(let r of n){if(r.data==null)continue;let i=e.map(o=>_(r.data,o));i.some(Si)||t.set(r,i)}return t}function Ii(n,e,t,r){return t.length?!r||n===e||n==null||e==null?!0:t.some((i,o)=>{let s=_(e,i);return Si(s)||!Object.is(r[o],s)}):!1}function re(n){return te(n.reason,"Block request aborted")}function Ze(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):1}var Qe=class{constructor(e,t,r=4){this.maxBlocks=e;this.En=t;this.maxConcurrentRequests=r;this.J=new Map;this.q=new Map;this.ks=0;this.generation=0;this.hitCount=0;this.missCount=0;this.evictionCount=0;this.Qr=0;this.ei=new Set;this.maxBlocks=Ze(e),this.maxConcurrentRequests=Ze(r)}configure(e,t=this.maxConcurrentRequests){this.maxBlocks=Ze(e),this.maxConcurrentRequests=Ze(t),this.Dn(),this.ti()}md(e){this.ei=e,this.Dn()}peek(e){let t=this.J.get(e);if(t)return t.touchedAt=++this.ks,t}has(e){return this.J.has(e)}invalidate(e){let t=this.q.get(e);t&&(this.q.delete(e),t.controller.abort(),t.state==="queued"&&t.reject(re(t.controller.signal)));let r=this.J.get(e);r&&(this.J.delete(e),this.En?.(e,r))}load(e,t,r,i=0){if(r?.aborted)return Promise.reject(re(r));let o=this.peek(e);if(o)return this.hitCount++,Promise.resolve(o);let s=this.q.get(e);if(s)return this.hitCount++,s.priority=Math.max(s.priority,i),this.ti(),this.Ps(e,s,r);this.missCount++;let a=new AbortController,l,d,c=new Promise((p,m)=>{l=p,d=m}),u={controller:a,promise:c,consumers:0,loader:t,priority:i,state:"queued",resolve:l,reject:d};this.q.set(e,u);let h=this.Ps(e,u,r);return this.ti(),h}gd(){this.generation++,this.ei.clear();for(let e of this.q.values())e.controller.abort(),e.state==="queued"&&e.reject(re(e.controller.signal));this.q.clear();for(let[e,t]of this.J)this.En?.(e,t);this.J.clear()}snapshot(){let e=0,t=0;for(let r of this.J.values())e+=r.rows.length;for(let r of this.q.values())r.state==="active"&&t++;return{cachedBlockCount:this.J.size,loadingBlockCount:this.q.size,activeRequestCount:t,queuedRequestCount:Math.max(0,this.q.size-t),cachedRowCount:e,hitCount:this.hitCount,missCount:this.missCount,evictionCount:this.evictionCount}}ti(){for(;this.Qr<this.maxConcurrentRequests;){let e,t;for(let[r,i]of this.q)i.state!=="queued"||i.controller.signal.aborted||(!t||i.priority>t.priority)&&(e=r,t=i);if(e==null||!t)return;this.yd(e,t)}}yd(e,t){t.state="active",this.Qr++;let r=this.generation;this.vd(t).then(i=>{r===this.generation&&!t.controller.signal.aborted&&(this.J.set(e,{rows:i.rows,...i.lastRow==null?{}:{lastRow:i.lastRow},touchedAt:++this.ks}),this.Dn()),t.resolve(i)},t.reject).finally(()=>{this.Qr=Math.max(0,this.Qr-1),this.q.get(e)===t&&this.q.delete(e),this.ti()})}vd(e){let{signal:t}=e.controller;return qe(Promise.resolve().then(()=>{if(t.aborted)throw re(t);return e.loader(t)}),t,()=>re(t))}Ps(e,t,r){return t.consumers++,new Promise((i,o)=>{let s=!1,a=d=>{s||(s=!0,r?.removeEventListener("abort",l),t.consumers=Math.max(0,t.consumers-1),d())},l=()=>a(()=>{t.consumers===0&&this.q.get(e)===t&&(this.q.delete(e),t.controller.abort(r?.reason),t.state==="queued"&&t.reject(re(t.controller.signal))),o(re(r))});r?.addEventListener("abort",l,{once:!0}),t.promise.then(d=>a(()=>i(d)),d=>a(()=>o(d instanceof Error?d:new Error(String(d??"Block request failed")))))})}Dn(){let e=Math.max(this.maxBlocks,this.ei.size+1);for(;this.J.size>e;){let t=-1,r=Number.POSITIVE_INFINITY;for(let[o,s]of this.J)this.ei.has(o)||s.touchedAt<r&&(t=o,r=s.touchedAt);if(t<0)return;let i=this.J.get(t);this.J.delete(t),this.evictionCount++,i&&this.En?.(t,i)}}};function Re(n,e){if(n==null||typeof n!="object")return;let t=n[e];return Array.isArray(t)?t:void 0}var et=class{constructor(e){this.e=e;this.all=[];this.H=[];this.Z=new Map;this.displayed=[];this.h=new Map;this.filterModel={};this.advancedFilterModel=null;this.quickFilter=null;this.k=new Set;this.K=new Set;this.kt=[];this.cr=new Map;this.Gs=[];this.P=null;this.Pt=!1;this.Ns=!1;this._e=0;this.ri=null;this.ii=null;this.ni=new WeakMap;this.ur=new WeakMap;this.Ke=new Map;this.hr=new Map;this.pr=0;this.oi=0;this.We=null;this.$e=new Map;this.ht=new Map;this.si=new Set;this.pt=new Map;this.Ue=new Qe(12,e=>this.Fs(e));this.fr=0;this.ai=null;this.xn=!1;this.Os=0;this.te=[];this.page=1;this.pageSize=20;this.advancedFilterModel=B(e.r.advancedFilterModel)}resolveRowId(e,t,r){let i=this.e.r.resolveRowId;if(!i)return r;try{let o=i({data:e,index:t,api:this.e.api});if(typeof o=="string"&&o.length>0)return o;this.e.reportError(new Error("rowKey must resolve to a non-empty identifier"),"rowKey",{index:t})}catch(o){this.e.reportError(o,"rowKey",{index:t})}return r}get N(){return this.e.r.treeData}get p(){return this.e.r.datasource!=null}get ue(){return this.p&&this.e.r.datasourceMode==="block"}Gt(){if(this.p){if(this.ue)return this.Nt();let e=Math.max(0,this.displayed.length-this.all.length);return(this.P??this.all.length)+e}return this.displayed.length}Rn(){return this.pr}mr(){return this.oi}bd(){return this.Ns}li(e){return!this.p||e?.aborted?Promise.resolve():(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.P=null,this.Pt=!1,this.all=[],this.H=[],this.h.clear(),this.k.clear(),this.e.O.clear(),this.b(),this.e.u({data:!0}),this.ue?(this.Ue.configure(this.e.r.maxBlocksInCache,this.e.r.datasourceMaxConcurrentRequests),this.ci(0,e)):this.Hs(0,void 0,e))}ft(e){this.Ns=e,this.e.o.ft(e,this.e.g("loading"))}Hs(e,t,r){if(!this.p||this.Pt||this.P!=null&&e>=this.P)return Promise.resolve();let i=this.e.r.blockSize,o=t??e+i;if(o<=e)return Promise.resolve();let s=++this._e,a=new AbortController,l=()=>a.abort(r?.reason);return r?.addEventListener("abort",l,{once:!0}),this.ri=a,this.Pt=!0,this.ft(!0),new Promise(d=>{let c=!1;this.ii=d;let u=h=>{c||(c=!0,r?.removeEventListener("abort",l),s===this._e&&(this.Pt=!1,this.ri=null,this.ii=null,this.ft(!1),h!=null&&h?.name!=="AbortError"&&this.e.reportError(h,"datasource.getRows",{startRow:e,endRow:o})),d())};this.Vs(e,o,a.signal,(h,p)=>{if(s!==this._e||this.e.s()||a.signal.aborted){u();return}typeof p=="number"&&p>=0?this.P=p:h.length<o-e&&(this.P=e+h.length);let m=this.all.length===0;this.wd(h),u(),this.b(),this.e.u({data:!0}),m&&this.e.he(),this.e.B.ui()},h=>u(a.signal.aborted||this.e.s()?void 0:h??new Error("Datasource request failed")))})}di(){this._e++,this.ri?.abort(),this.ri=null,this.Pt=!1,this.ft(!1),this.ii?.(),this.ii=null,this.Ue.gd(),this.$e.clear(),this.ht.clear(),this.si.clear();for(let[e,t]of this.pt)this.h.get(e)===t&&this.h.delete(e);this.pt.clear()}wd(e){for(let t of e){if(t==null)continue;let r=this.all.length,i=this.resolveRowId(t,r,`inf-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"datasource.getRows",{rowId:i});continue}let o={id:i,data:t,rowIndex:-1,selected:this.e.m.Sn(i)};this.all.push(o),this.h.set(i,o),this.H.push(o)}}ci(e,t,r=0){if(!this.ue||e<0)return Promise.resolve();if(t?.aborted)return Promise.reject(this.Bs(t.reason));let i=this.e.r.blockSize,o=this._e,s=e*i;if(s>=this.Nt())return Promise.resolve();let a=this.P==null?s+i:Math.min(this.P,s+i),l=this.Ue.load(e,d=>this.Cd(s,a,d),t,r);return this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0),l.then(d=>{o!==this._e||t?.aborted||this.e.s()||!this.ue||!this.Ue.has(e)||this.si.has(e)||(this.Td(e,d),this.b(),this.e.u({data:!0}),this.e.B.ui(),o===this._e&&!this.e.s()&&this.zs(this.e.a.Mn().lastExcl-1))}).catch(d=>{throw d?.name!=="AbortError"&&this.e.reportError(d,"datasource.getRows",{startRow:s,endRow:a}),d}).finally(()=>{o===this._e&&this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0)})}Cd(e,t,r){return new Promise((i,o)=>{this.Vs(e,t,r,(s,a)=>i({rows:s,...typeof a=="number"&&a>=0?{lastRow:a}:{}}),s=>o(s instanceof Error?s:new Error(typeof s=="string"?s:"Datasource request failed")))})}Vs(e,t,r,i,o){let s=this.e.r.datasource,a=0,l=null,d=!1,c=p=>{d||(d=!0,l!=null&&clearTimeout(l),r.removeEventListener("abort",u),p())},u=()=>c(()=>o(this.Bs(r.reason)));r.addEventListener("abort",u,{once:!0});let h=()=>{if(d)return;if(r.aborted||this.e.s()){u();return}a++;let p=!1,m=v=>{if(!(p||d)){if(p=!0,r.aborted||this.e.s()){u();return}a<=this.e.r.datasourceRetryCount?l=setTimeout(h,this.retryDelay(a)):c(()=>o(v))}};try{let v=s.getRows({startRow:e,endRow:t,sortModel:this.e.n.U(),filterModel:this.j(),advancedFilterModel:this.be(),quickFilterText:this.quickFilter,signal:r,onSuccess:(w,C)=>{p||d||(p=!0,c(()=>i(w??[],C)))},fail:m});v&&typeof v.catch=="function"&&v.catch(m)}catch(v){m(v)}};h()}Td(e,t){let r=this.e.r.blockSize,i=e*r;this.Fs(e),typeof t.lastRow=="number"&&t.lastRow>=0?this.P=t.lastRow:t.rows.length<r&&(this.P=i+t.rows.length),t.rows.forEach((o,s)=>{if(o==null)return;let a=i+s;if(this.P!=null&&a>=this.P)return;let l=this.resolveRowId(o,a,`block-${a}`),d=this.pt.get(l),c=this.h.get(l);if(c&&c!==d&&c.rowIndex!==a){this.e.reportError(new Error(`Duplicate row id: ${l}`),"datasource.getRows",{rowId:l});return}let u=d??{id:l,data:o,rowIndex:a,selected:this.e.m.Sn(l)};u.rowIndex=a,u.selected=this.e.m.Sn(l),this.pt.delete(l),this.$e.set(a,u),this.ht.delete(a),this.h.set(l,u),this.ur.set(u,a+1)}),this._s(),this.si.add(e)}Fs(e){this.si.delete(e);let t=this.e.r.blockSize,r=e*t,i;for(let o=r;o<r+t;o++){let s=this.$e.get(o);s&&(i??(i=new Set(this.e.V.getDirtyRowIds())),this.$e.delete(o),i.has(s.id)?this.pt.set(s.id,s):this.h.get(s.id)===s&&this.h.delete(s.id))}this._s()}_s(){this.all=[...this.$e.entries()].sort(([e],[t])=>e-t).map(([,e])=>e),this.H=this.all}Nt(){if(this.P!=null)return this.P;if(this.e.r.datasourceRowCount!=null)return this.e.r.datasourceRowCount;if(this.$e.size===0)return this.e.r.blockSize;let e=0;for(let t of this.$e.keys())e=Math.max(e,t+1);return e+this.e.r.blockSize}Dd(e){let t=this.ht.get(e);if(!t&&(t={id:`__mach_loading_${e}`,data:null,rowIndex:e,selected:!1,loading:!0},this.ht.set(e,t),this.ht.size>2e3)){let r=this.ht.keys().next().value;r!=null&&this.ht.delete(r)}return t}Bs(e){return te(e,"Operation aborted")}retryDelay(e){let t=Math.min(this.e.r.datasourceRetryDelay*2**Math.max(0,e-1),3e4),r=this.e.r.datasourceRetryJitter;return Math.max(0,Math.round(t*(1+(Math.random()*2-1)*r)))}Ed(e){if(this.ue){this.zs(e);return}if(!this.p||this.Pt)return;let t=this.all.length;if(this.P!=null&&t>=this.P)return;let r=this.e.r.infiniteBufferRows;if(e+r<t&&e<t)return;let i=this.e.r.blockSize,o=this.P==null?t+i:Math.min(this.P,t+i);this.Hs(t,o)}zs(e){if(e<0)return;this.Ks();let t=this.e.r.blockSize,r=Math.floor(e/t),i=Math.floor(this.e.a.Mn().first/t),o=this.e.r.blockPrefetch,s=r<this.Os?-1:1;this.Os=r;for(let a=i;a<r;a++)this.ci(a,void 0,o+2).catch(()=>{});for(let a=0;a<=o;a++){let l=a===0?[r]:[r+s*a,r-s*a];for(let d of l)d<0||d*t>=this.Nt()||this.ci(d,void 0,o-a+1).catch(()=>{})}}Ae(){return this.li().catch(()=>{})}xd(){return this.di(),this.p?this.li().catch(()=>{}):(this.P=null,this.qe(this.e.r.rowData),this.e.u({data:!0}),Promise.resolve())}destroy(){this.We=null,this.di(),this.Ws(),this.In(),this.all=this.H=this.displayed=this.te=[],this.h.clear(),this.Z.clear(),this.cr.clear(),this.Gs=[],this.k.clear(),this.K.clear(),this.kt=[]}An(e,t,r){if(!this.ue)return Promise.resolve();this.Ks();let i=this.e.r.blockSize,o=Math.max(0,Math.trunc(e)),s=Math.min(this.Nt(),Math.max(o,Math.trunc(t))),a=Math.floor(o/i),l=Math.max(a,Math.floor(Math.max(o,s-1)/i)),d=[];for(let c=a;c<=l;c++)d.push(this.ci(c,r,100));return Promise.all(d).then(()=>{})}Ln(){this.ue&&(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.e.O.clear(),this.all=[],this.H=[],this.h.clear(),this.b(),this.e.u({data:!0}))}kn(){return this.Ue.snapshot()}Ks(){let e=new Set(this.e.V.getDirtyRowIds());for(let[l,d]of this.pt)e.has(l)||(this.pt.delete(l),this.h.get(l)===d&&this.h.delete(l));let t=this.e.r.blockSize,r=new Set,{first:i,lastExcl:o}=this.e.a.Mn();for(let l=i;l<o;l+=t)r.add(Math.floor(l/t));o>i&&r.add(Math.floor((o-1)/t));let s=this.e.a.T;s&&r.add(Math.floor(s.rowIndex/t));let a=this.e.l.Rd();a!=null&&r.add(Math.floor(a/t)),this.Ue.md(r)}qe(e){this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.Ws(),this.e.V.clear();let t=this.e.r.resolveRowId,r=this.e.r.childrenKey,i=[],o=[],s=new Map,a=new Map,l=0,d=(c,u,h)=>{let p=l++,m=this.resolveRowId(c,p,`auto-${p}`);if(s.has(m))return this.e.reportError(new Error(`Duplicate row id: ${m}`),"rowData",{rowId:m,index:p}),null;let v=this.N?Re(c,r):void 0,w={id:m,data:c,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(v)};if(this.ni.set(w,u),i.push(w),s.set(m,w),h!=null){let C=a.get(h)??[];C.push(m),a.set(h,C)}else o.push(w);if(this.N&&Array.isArray(v))for(let C of v)C!=null&&d(C,u+1,m);return w};(e??[]).forEach(c=>{c!=null&&d(c,0,null)}),this.all=i,this.H=o,this.Z=a,this.h=s,this.e.O.clear();for(let c of[...this.k])s.has(c)||this.k.delete(c);if(this.e.r.defaultExpandAll)for(let c of i)this.$s(c.id)>0&&this.k.add(c.id);this.e.m.Us(t!=null),this.b()}gr(e){return this.Z.get(e)??[]}$s(e){return this.Z.get(e)?.length??0}Pn(e){return this.$s(e)>0}isTreeRowLoading(e){return this.h.get(e)?.treeLoading===!0}Ws(){for(let e of this.Ke.values())e.abort();this.Ke.clear(),this.hr.clear()}loadTreeChildren(e,t=!1){let r=this.h.get(e),i=this.e.r.loadTreeChildren;if(!this.N||!r?.data||!i)return Promise.resolve([]);if(!t&&r.treeChildrenLoaded)return Promise.resolve(this.gr(e).flatMap(l=>{let d=this.h.get(l)?.data;return d==null?[]:[d]}));let o=this.hr.get(e);if(o&&!t)return o;this.Ke.get(e)?.abort();let s=new AbortController;this.Ke.set(e,s),r.treeLoading=!0,r.treeLoadError=void 0,this.e.u({data:!0});let a=Promise.resolve().then(()=>i({data:r.data,node:r,api:this.e.api,signal:s.signal})).then(l=>{if(s.signal.aborted||this.e.s())return[];if(!Array.isArray(l))throw new TypeError("[MachTable] loadTreeChildren must resolve to an array.");return this.Sd(r,l),r.treeChildrenLoaded=!0,r.treeLoadError=void 0,this.e.emit("treeChildrenLoaded",{rowId:e,rowNode:r,children:l}),l}).catch(l=>{if(s.signal.aborted||l?.name==="AbortError")return[];throw r.treeLoadError=l,r.treeChildrenLoaded=!1,this.e.reportError(l,"treeData.loadChildren",{rowId:e}),this.e.emit("treeChildrenLoadFailed",{rowId:e,rowNode:r,error:l}),l}).finally(()=>{this.Ke.get(e)===s&&(this.Ke.delete(e),this.hr.delete(e),r.treeLoading=!1,this.e.u({data:!0}))});return this.hr.set(e,a),a}Sd(e,t){let r=new Set,i=[...this.gr(e.id)];for(;i.length>0;){let s=i.pop();r.has(s)||(r.add(s),i.push(...this.gr(s)))}this.Md(t,r);for(let s of r)this.Ke.get(s)?.abort(),this.Ke.delete(s),this.hr.delete(s),this.Z.delete(s),this.h.delete(s),this.k.delete(s);this.Z.delete(e.id);let o=this.Gn(e)+1;for(let s of t)s!=null&&this.Nn(e,s,o);this.qs(),this.e.m.Us(this.e.r.resolveRowId!=null),this.b(),this.e.u({data:!0})}Md(e,t){let r=this.e.r.resolveRowId,i=r?new Set([...this.h.keys()].filter(l=>!t.has(l))):null,o=new WeakSet,s=[...e],a=0;for(;s.length>0;){let l=s.pop();if(l==null)continue;if(typeof l=="object"){if(o.has(l))throw new TypeError("[MachTable] Lazy tree children contain a cyclic object graph.");o.add(l)}if(r&&i){let c=r({data:l,index:a++,api:this.e.api});if(typeof c!="string"||c.length===0)throw new TypeError("[MachTable] rowKey must resolve to a non-empty identifier for lazy tree children.");if(i.has(c))throw new Error(`Duplicate row id: ${c}`);i.add(c)}let d=Re(l,this.e.r.childrenKey);d&&s.push(...d)}}yr(e,t=!0){let r=this.e.r.resolveRowId,i=[],o=[],s=[];if(e.remove?.length){let l=new Set,d=new Set,c=h=>{if(r){let m=[this.resolveRowId(h,-1,`__missing_remove_${this.e.Ft()}`)];for(;m.length>0;){let v=m.pop();if(!l.has(v)){l.add(v);for(let w of this.Z.get(v)??[])m.push(w)}}}else{let p=[h];for(;p.length>0;){let m=p.pop();d.add(m);let v=this.N?Re(m,this.e.r.childrenKey):void 0;if(v)for(let w of v)p.push(w)}}};e.remove.forEach(c),this.all=this.all.filter(h=>{let p=l.has(h.id)||h.data!=null&&d.has(h.data);return p&&(s.push(h.id),this.h.delete(h.id),this.Z.delete(h.id)),!p});let u=new Set(this.all);this.H=this.H.filter(h=>u.has(h))}if(e.update?.length)for(let l of e.update){let d;r?d=this.h.get(this.resolveRowId(l,-1,`__missing_update_${this.e.Ft()}`)):d=this.all.find(c=>c.data===l),d&&(o.push({node:d,before:d.data,after:l}),d.data=l,s.push(d.id),this.e.a.hi(d),i.push(d))}if(e.add?.length){let l=e.addIndex!=null?Math.max(0,Math.min(e.addIndex,this.H.length)):this.H.length,d=[];e.add.forEach((c,u)=>{let h=this.resolveRowId(c,l+u,`add-${this.e.Ft()}`);if(this.h.has(h)){this.e.reportError(new Error(`Duplicate row id: ${h}`),"transaction.add",{rowId:h});return}let p={id:h,data:c,rowIndex:-1,selected:!1};this.h.set(h,p),this.ni.set(p,0);let m=this.N?Re(c,this.e.r.childrenKey):void 0;if(m)for(let v of m)v!=null&&this.Nn(p,v,1);d.push(p)}),this.H=this.H.slice(0,l).concat(d,this.H.slice(l)),this.qs()}let a={pipelineChanged:this.Id(e,o),updatedRowIds:i.map(l=>l.id)};return this.Ad(a,t),this.e.V.Ld(s),a}Ad(e,t){e.pipelineChanged&&(this.We=null),t&&(e.pipelineChanged?this.b():e.updatedRowIds.length&&this.js())}kd(e){if(e.length===0)return{pipelineChanged:!1,updatedRowIds:[]};let t=!1,r=new Set;for(let i of e){let o=this.yr(i,!1);t||(t=o.pipelineChanged);for(let s of o.updatedRowIds)r.add(s)}return t?this.b():r.size>0&&this.js(),{pipelineChanged:t,updatedRowIds:[...r]}}Id(e,t){if(e.add?.length||e.remove?.length)return!0;if(!t.length)return!1;let r=this.Ys();if(r===null)return!0;if(!r.length)return!1;let i=this.We;return!i||r.length!==i.fields.length||r.some((o,s)=>o!==i.fields[s])?!0:t.some(({node:o,before:s,after:a})=>Ii(s,a,r,i.values.get(o)))}Ys(){if(this.N||this.e.r.masterDetail||this.e.r.getRowHeight||this.Xs())return null;let e=this.e.n.c();if(e.some(r=>r.colDef.autoHeight===!0||r.colDef.autoRowSpan===!0||r.colDef.rowSpan!=null))return null;let t=!this.e.r.manualFiltering;return Ri({columns:e,customAggregates:this.e.r.aggFuncs,sortModel:this.e.r.manualSorting?[]:this.e.n.U(),filterModel:t?this.filterModel:{},advancedFilter:t?this.advancedFilterModel:null,quickFilter:t?this.quickFilter:null})}Pd(){let e=this.Ys();this.We=e?.length?{fields:e,values:Mi(this.all,e)}:null}js(){this.e.emit("modelUpdated",{rowCount:this.te.length})}Nn(e,t,r){let i=this.resolveRowId(t,-1,`add-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"transaction.add",{rowId:i});return}let o=Re(t,this.e.r.childrenKey),s={id:i,data:t,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(o)};this.h.set(i,s),this.ni.set(s,r);let a=this.Z.get(e.id)??[];if(a.push(s.id),this.Z.set(e.id,a),!!o)for(let l of o)l!=null&&this.Nn(s,l,r+1)}qs(){this.all=[];let e=t=>{this.all.push(t),this.h.has(t.id)||this.h.set(t.id,t);for(let r of this.Z.get(t.id)??[]){let i=this.h.get(r);i&&e(i)}};for(let t of this.H)e(t)}vr(e){let t=JSON.stringify(this.filterModel),r=new Set(this.e.n.X().map(o=>o.id));this.filterModel=Y(e,r);let i=JSON.stringify(this.filterModel)!==t;return i&&(this.We=null),i}j(){return{...this.filterModel}}Ot(e){let t=new Set(this.e.n.X().map(s=>s.id)),r=B(e,t),i=JSON.stringify(this.advancedFilterModel);this.advancedFilterModel=r,this.e.r.advancedFilterModel=r;let o=JSON.stringify(r)!==i;return o&&(this.We=null),o}be(){return B(this.advancedFilterModel)}Ht(e){let t=e!=null&&e.trim()!==""?e:null;return t===this.quickFilter?!1:(this.quickFilter=t,this.We=null,!0)}br(){return this.quickFilter}Fn(){return Object.keys(this.filterModel).length>0||this.advancedFilterModel!=null||this.quickFilter!=null}b(){this.We=null;let e=this.e.re.start(),t=this.e.n.c(),r=(a,l)=>this.e.d(a,l);if(this.p){this.Gd(e);return}if(this.Nd(e))return;let i,o=[];if(this.N)i=this.Fd(t,r);else{i=this.all,this.Fn()&&!this.e.r.manualFiltering&&(i=i.filter(ur(t,this.filterModel,this.advancedFilterModel,this.quickFilter,r)));let l=this.e.n.U();if(l.length>0&&!this.e.r.manualSorting)try{i=hr(i,l,t,r)}catch(c){this.e.reportError(c,"comparator",{sortModel:l})}let d=this.e.n.ze();if(d.length>0){let c=this.Od(i,d);i=c.rows,o=c.ambiguousExpansions}else if(this.e.r.masterDetail){let c=[];for(let u of i)c.push(u),this.k.has(u.id)&&this.isRowExpandable(u)&&c.push({id:`__detail__${u.id}`,data:u.data,rowIndex:-1,selected:!1,isDetail:!0,masterId:u.id});i=c}}for(let a of this.all)a.rowIndex=-1;let s=0;i.forEach((a,l)=>{a.rowIndex=l,!a.isDetail&&!a.isGroup&&(s++,this.ur.set(a,s))}),this.te=i,this.Vt(),this.Pd(),this.Js(r),this.e.emit("modelUpdated",{rowCount:i.length}),this.e.re.On(e),this.Hd(o)}Gd(e){this.all.forEach((t,r)=>{this.ue||(t.rowIndex=r),this.ur.set(t,this.ue?t.rowIndex+1:r+1)}),this.displayed=this.all,this.te=this.all,this.cr.clear(),this.pr++,this.e.emit("modelUpdated",{rowCount:this.all.length}),this.e.re.On(e)}Nd(e){let t=this.xn;return this.xn=!1,!t&&this.Xs()?(this.Vd(e),!0):(this.In(),!1)}Xs(){if(!this.e.r.dataProcessor||this.all.length<this.e.r.dataProcessorMinRows||this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return!1;let e=!this.e.r.manualFiltering&&this.Fn(),t=!this.e.r.manualSorting&&this.e.n.U().length>0;return e||t}Vd(e){this.In();let t=this.e.r.dataProcessor;if(!t)return;let r=++this.fr,i=new AbortController;this.ai=i;let o=this.e.n.c(),s=this.all.flatMap(d=>d.data==null?[]:[{id:d.id,data:d.data}]),a=!this.e.r.manualFiltering,l=!this.e.r.manualSorting;Promise.resolve().then(()=>t.process({rows:s,columns:o.map(d=>({colId:d.id,...d.colDef.field?{field:d.colDef.field}:{}})),sortModel:l?this.e.n.U():[],filterModel:a?this.j():{},advancedFilterModel:a?this.be():null,quickFilterText:a?this.quickFilter:null,signal:i.signal})).then(d=>{if(r!==this.fr||i.signal.aborted||this.e.s())return;let c=new Set,u=[];for(let p of d.rowIds){if(c.has(p))continue;c.add(p);let m=this.h.get(p);m&&!m.isDetail&&!m.isGroup&&u.push(m)}for(let p of this.all)p.rowIndex=-1;u.forEach((p,m)=>{p.rowIndex=m,this.ur.set(p,m+1)}),this.te=u,this.Vt();let h=(p,m)=>this.e.d(p,m);this.Js(h),this.e.emit("modelUpdated",{rowCount:u.length}),this.e.re.On(e),this.e.u({data:!0})}).catch(d=>{r!==this.fr||i.signal.aborted||this.e.s()||(this.e.reportError(d,"dataProcessor.process"),this.xn=!0,this.b(),this.e.u({data:!0}))}).finally(()=>{r===this.fr&&(this.ai=null)})}In(){this.fr++,this.ai?.abort(),this.ai=null}get we(){return this.e.r.paginationEnabled&&!this.p}Vt(){if(!this.we){this.displayed=this.te,this.pr++;return}let e=this.wr(),t=this.getPageCount();if(this.page>t&&(this.page=t),this.page<1&&(this.page=1),this.e.r.paginationPage=this.page,this.e.r.paginationMode==="server"){this.te.forEach((o,s)=>{o.rowIndex=s}),this.displayed=this.te,this.pr++;return}let r=(this.page-1)*e,i=this.te.slice(r,r+e);i.forEach((o,s)=>{o.rowIndex=s}),this.displayed=i,this.pr++}wr(){return this.pageSize=this.e.r.paginationPageSize,Math.max(1,this.pageSize)}Cr(){return this.we?this.page:1}getTotalRowCount(){return this.p?this.Gt():this.we&&this.e.r.paginationMode==="server"?this.e.r.paginationTotal:this.te.length}getPageCount(){return this.we?Math.max(1,Math.ceil(this.getTotalRowCount()/this.wr())):1}Zs(){return this.te}setPage(e,t=!1){if(!this.we)return;let r=this.getPageCount(),i=Math.max(1,Math.min(Math.round(e)||1,r));i!==this.page&&(this.page=i,this.e.r.paginationPage=i,this.Vt(),this.e.u({data:!0}),this.e.a.Bt(0,"top"),t||this.pi())}setPageSize(e){if(!this.we)return;let t=Math.max(1,Math.round(e)||this.wr()),r=(this.page-1)*this.wr();this.e.r.paginationPageSize=t,this.pageSize=t,this.page=Math.floor(r/t)+1,this.e.r.paginationPage=this.page,this.Vt(),this.e.u({data:!0}),this.pi()}Qs(e,t){this.pageSize=Math.max(1,Math.round(t)||1),this.e.r.paginationPageSize=this.pageSize,this.page=Math.max(1,Math.round(e)||1),this.e.r.paginationPage=this.page}fi(e){this.e.r.paginationEnabled!==e&&(this.e.r.paginationEnabled=e&&!this.p,this.e.r.paginationEnabled&&(this.page=1),this.Vt(),this.e.u({data:!0}),this.pi())}Bd(){this.we&&(this.page=this.e.r.paginationMode==="server"?this.e.r.paginationPage:1,this.Vt(),this.e.u({data:!0}),this.pi())}pi(){this.e.emit("paginationChanged",{page:this.Cr(),pageSize:this.wr(),pageCount:this.getPageCount(),total:this.getTotalRowCount()})}Fd(e,t){let r=this.e.r.manualSorting?[]:this.e.n.U(),i=new Map,o=this.Fn()&&!this.e.r.manualFiltering,s=ur(e,this.filterModel,this.advancedFilterModel,this.quickFilter,t),a=c=>{let u=i.get(c.id);if(u!==void 0)return u;let h=!0;if(o){h=s(c);for(let p of this.Z.get(c.id)??[]){let m=this.h.get(p);m&&a(m)&&(h=!0)}}return i.set(c.id,h),h},l=[],d=c=>{let u=c;r.length>0&&(u=hr(c,r,e,t));for(let h of u)if(a(h)&&(l.push(h),this.k.has(h.id))){let p=(this.Z.get(h.id)??[]).map(m=>this.h.get(m)).filter(m=>m!=null);d(p)}};return d(this.H),l}zd(){let e=this.Gs,t=0;for(let r of this.displayed)!r.isDetail&&!r.isGroup&&(e[t++]=r);return e.length=t,e}_d(e,t,r,i){let o=t.colDef.rowSpan;if(!o)return 1;try{let s=o({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:r,rowIndex:e.rowIndex});return Math.max(1,Math.min(Math.round(s)||1,i))}catch(s){return this.e.reportError(s,"rowSpan",{colId:t.id,rowId:e.id}),1}}Kd(e,t,r,i,o){if(!r.colDef.autoRowSpan||i==null||i==="")return 1;let s=1;for(;t+s<e.length&&je(i,o(e[t+s],r))===0;)s++;return s}Wd(e,t,r){let i=new Int32Array(e.length),o=0;for(;o<e.length;){let s=e[o],a=r(s,t),l=t.colDef.rowSpan?this._d(s,t,a,e.length-o):this.Kd(e,o,t,a,r);i[o]=l;for(let d=1;d<l;d++)i[o+d]=-1;o+=l}return i}Js(e){if(this.cr.clear(),this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return;let t=this.e.n.c().filter(i=>i.colDef.rowSpan!=null||i.colDef.autoRowSpan===!0);if(t.length===0)return;let r=this.zd();if(r.length!==0)for(let i of t)this.cr.set(i.id,this.Wd(r,i,e))}$d(e){return this.cr.get(e)}ea(e){return this.ur.get(e)??0}Gn(e){return this.ni.get(e)??0}Od(e,t){let r=Xe(this.e.r.aggFuncs),i=this.e.n.hd();this.kt=[];let o=l=>{let d={};for(let c of i){let u=r(c.colDef.aggFunc);if(u)try{d[c.id]=Ci(l,u,h=>this.e.d(h,c))}catch(h){this.e.reportError(h,"aggFunc",{colId:c.id,aggFunc:c.colDef.aggFunc}),d[c.id]=null}}return d},s=xi(this.K,this.all,t,(l,d)=>this.e.d(l,d));this.K=s.expanded;let a=Ei(e,t,(l,d)=>this.e.d(l,d),o,this.K);return this.kt=a.ids,{rows:a.rows,ambiguousExpansions:s.ambiguous}}Hd(e){for(let t of e){if(this.e.s())return;this.e.reportError(new Error(`Ambiguous legacy group expansion: ${t}`),"gridState.groupExpansion",{groupId:t})}}isRowExpandable(e){if(this.N){if(this.Pn(e.id)||e.treeLoading)return!0;if(e.treeChildrenLoaded||!e.data||!this.e.r.loadTreeChildren)return!1;let r=this.e.r.isTreeRowExpandable;if(!r)return!1;try{return r({data:e.data,node:e,api:this.e.api})}catch(i){return this.e.reportError(i,"isTreeRowExpandable",{rowId:e.id}),!1}}if(!this.e.r.masterDetail)return!1;let t=this.e.r.isRowExpandable;if(t)try{return t({data:e.data,node:e,api:this.e.api})}catch(r){return this.e.reportError(r,"isRowExpandable",{rowId:e.id}),!1}return!0}isRowExpanded(e){return this.k.has(e)}Ud(){return[...this.k]}qd(){return[...this.K]}jd(e,t){this.k=new Set(e.filter(r=>this.h.has(r))),this.K=new Set(t)}Hn(e){return this.Vn(e,!0)}Bn(e){return this.Vn(e,!1)}mi(e){return this.Vn(e,!this.k.has(e))}Vn(e,t){let r=this.h.get(e);return!r||t&&!this.isRowExpandable(r)?!1:(t===this.k.has(e)||(t?this.k.add(e):this.k.delete(e),this.b(),this.e.u({data:!0}),this.e.emit("detailToggled",{rowId:e,rowNode:r,expanded:t}),t&&this.N&&!this.Pn(e)&&!r.treeLoading&&this.loadTreeChildren(e).catch(()=>{})),t)}zn(){let e=!1;for(let t of this.all)!this.k.has(t.id)&&this.isRowExpandable(t)&&(this.k.add(t.id),e=!0);e&&(this.b(),this.e.u({data:!0}))}_n(){this.k.size!==0&&(this.k.clear(),this.b(),this.e.u({data:!0}))}Kn(e){return this.setGroupExpanded(e,!this.K.has(e))}isGroupExpanded(e){return this.K.has(e)}Wn(){if(this.kt.length===0)return;let e=!1;for(let t of this.kt)this.K.has(t)||(this.K.add(t),e=!0);e&&(this.b(),this.e.u({data:!0}))}$n(){this.K.size!==0&&(this.K.clear(),this.b(),this.e.u({data:!0}))}setGroupExpanded(e,t){return!this.kt.includes(e)||t===this.K.has(e)||(t?this.K.add(e):this.K.delete(e),this.b(),this.e.u({data:!0})),t}ta(){return!this.N&&!this.p&&!this.e.r.dataProcessor&&this.e.r.paginationMode!=="server"&&this.e.n.U().length===0&&this.e.n.ze().length===0}ra(e,t){if(!this.ta()||!Number.isInteger(e)||!Number.isInteger(t))return!1;let r=this.f(e),i=this.f(t);if(!r||!i||r.isDetail||i.isDetail||r.isGroup||i.isGroup)return!1;let o=this.all.indexOf(r),s=this.all.indexOf(i);return o<0||s<0||o===s?!1:(this.all.splice(o,1),this.all.splice(s,0,r),this.b(),this.e.u({data:!0}),!0)}pe(){return this.all}Yd(){return this.H}je(){return this.displayed}I(){return this.ue?this.Nt():this.displayed.length}f(e){return this.ue?e<0||e>=this.Nt()?void 0:this.$e.get(e)??this.Dd(e):this.displayed[e]}z(e){return this.h.get(e)}Un(e){this.all.forEach(e)}qn(e){let t=0;for(let r of this.te)r.isDetail||r.isGroup||e(r,t++)}};var tt=class{constructor(e){this.e=e;this.R=new Set;this.Le=null;this.Tr=new Set}Sn(e){return this.R.has(e)}Xd(e){return this.Tr.has(e)}ke(e){if(e.loading)return!1;let t=this.Jd(e),r=t?.colDef.selectable;if(!t||!r)return!0;try{return r({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:this.e.d(e,t),rowIndex:e.rowIndex})}catch(i){return this.e.reportError(i,"selectable",{rowId:e.id,colId:t?.id}),!1}}Jd(e){if(!(e.isGroup||e.isDetail))return this.e.n.c().find(t=>t.hasCheckbox&&t.colDef.selectable!=null)}Pe(){return this.e.i.pe().filter(e=>this.R.has(e.id))}gi(){return this.Pe().filter(e=>e.data!=null).map(e=>e.data)}yi(){return[...this.R]}Zd(e){let t=new Set(e),r=this.e.i.pe().filter(i=>t.has(i.id)&&!i.isDetail&&!i.isGroup).map(i=>({node:i,selected:!0}));this.fe(r,!0)}Us(e){if(!e)this.R.clear(),this.Le=null;else{let t=new Set(this.e.i.pe().map(r=>r.id));for(let r of[...this.R])t.has(r)||this.R.delete(r);this.Le!=null&&!t.has(this.Le)&&(this.Le=null)}for(let t of this.e.i.pe())t.selected=this.R.has(t.id);this.ia()}na(e){let t=e.leafNodes??[];if(t.length===0)return{all:!1,some:!1};let r=0,i=0;for(let o of t)this.ke(o)&&(r++,this.R.has(o.id)&&i++);return r===0?{all:!1,some:!1}:{all:i===r,some:i>0}}Qd(e,t){let r=(e.leafNodes??[]).filter(i=>this.ke(i));r.length!==0&&this.fe(r.map(i=>({node:i,selected:t})))}oa(e,t,r=!1){this.fe([{node:e,selected:t,clearOthers:r}])}jn(e,t=!0,r=!0){let i=this.e.i.z(e);i&&this.oa(i,t,r)}ec(e,t){let r=t==="single";this.fe([{node:e,selected:r?!0:!e.selected,clearOthers:r}]),this.Le=e.id}tc(e,t,r){return!r||!t.ctrlKey&&!t.metaKey?!1:(this.fe([{node:e,selected:!e.selected}]),this.Le=e.id,!0)}rc(e,t,r){if(!r||!t.shiftKey||this.Le==null)return!1;let i=this.e.i.z(this.Le);if(!i||i.rowIndex<0||e.rowIndex<0)return!1;let o=Math.min(i.rowIndex,e.rowIndex),s=Math.max(i.rowIndex,e.rowIndex),a=[];for(let l=o;l<=s;l++){let d=this.e.i.f(l);d&&!d.isDetail&&!d.isGroup&&this.ke(d)&&a.push({node:d,selected:!0})}return this.fe(a),!0}sa(e,t,r){let i=this.e.r.rowSelection;if(i==="none"||!this.ke(e))return;if(r){this.ec(e,i);return}let o=i==="multiple";this.tc(e,t,o)||this.rc(e,t,o)||(this.fe([{node:e,selected:!0,clearOthers:!0}]),this.Le=e.id)}selectAll(e=!0){let t=this.e.r.rowSelection;if(t==="none")return;let i=(e?this.e.i.je():this.e.i.pe()).filter(o=>!o.isDetail&&!o.isGroup&&this.ke(o));if(i.length!==0){if(t==="single"){this.fe([{node:i[0],selected:!0,clearOthers:!0}]);return}this.fe(i.map(o=>({node:o,selected:!0})))}}deselectAll(){this.fe([],!0)}ic(){let t=this.e.i.je().filter(r=>!r.isDetail&&!r.isGroup).filter(r=>this.ke(r));if(t.length===0)return!1;if(this.e.i.p){let r=this.e.i.Gt();if(t.length<r)return!1}return t.every(r=>this.R.has(r.id))}nc(){let t=this.e.i.je().filter(i=>!i.isDetail&&!i.isGroup).filter(i=>this.ke(i)),r=t.reduce((i,o)=>i+(this.R.has(o.id)?1:0),0);if(r===0)return!1;if(this.e.i.p){let i=this.e.i.Gt();if(t.length<i)return!0}return r>0&&r<t.length}oc(e,t=!1){this.fe(e,t)}sc(e,t,r){!t&&!e.some(i=>i.clearOthers)||(this.R=t?new Set:new Set(e.filter(i=>i.selected).flatMap(i=>r?this.aa(i.node):[i.node.id])))}ac(e,t){for(let r of e){if(!this.ke(r.node))continue;let i=t?this.aa(r.node):[r.node.id];for(let o of i)r.selected?this.R.add(o):this.R.delete(o)}}lc(e){let t=new Set;for(let r of new Set([...e,...this.R]))e.has(r)!==this.R.has(r)&&t.add(r);return t}dc(e,t,r){let i=[],o=new Set([...e,...r,...this.Tr]);for(let s of this.e.i.pe()){let a=this.R.has(s.id);s.selected=a,(o.has(s.id)||t.get(s.id)!==a)&&s.rowIndex>=0&&i.push(s.rowIndex)}return i}fe(e,t=!1){let r=new Set(this.R),i=this.e.i.N&&this.e.r.autoCheckedChildren;this.sc(e,t,i),this.ac(e,i);let o=this.lc(r),s=new Map;for(let d of this.e.i.pe())s.set(d.id,d.selected);let a=new Set(this.Tr);this.ia();let l=this.dc(o,s,a);o.size>0&&(this.e.a.Ye(l),this.e.B.ui(),this.e.emit("selectionChanged",{selectedNodes:this.Pe(),selectedRows:this.gi()}))}aa(e){let t=[e.id],r=i=>{for(let o of this.e.i.gr(i))t.push(o),r(o)};return r(e.id),t}ia(){if(this.Tr.clear(),!this.e.i.N)return;let e=t=>{let r=this.e.i.gr(t);if(r.length===0)return{all:this.R.has(t),some:this.R.has(t)};let i=!0,o=!1;for(let s of r){let a=e(s);a.all?o=!0:(a.some&&(o=!0),i=!1)}return o&&!i&&this.Tr.add(t),i?this.R.add(t):this.R.delete(t),{all:i,some:o}};for(let t of this.e.i.Yd())e(t.id);for(let t of this.e.i.pe())t.selected=this.R.has(t.id)}};var rt=class{constructor(e){this.e=e;this.active=null;this.Q=0;this.Xe=0;this.Ce=null;this.mt=null;this.Je=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),!this.Q&&(this.Q=requestAnimationFrame(()=>{this.Q=0,this.hc()})))};this.Te=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),this.pc(t))};this.yt=e=>{this.Xn(e)&&this.gt()};this.la=()=>{this.gt()}}cc(e,t){if(!this.e.r.enableColumnResize||!t.resizable||e.isPrimary===!1)return;this.gt();let r=e.currentTarget,i=t.currentWidth;this.Xe=i,this.active={column:t,didResize:!1,handle:r,pointerId:e.pointerId,startFlex:t.flex,startManualWidth:t.manualWidth,startWidth:i,startX:e.clientX},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te,!0),window.addEventListener("pointercancel",this.yt,!0),r.addEventListener("lostpointercapture",this.la);try{r.setPointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.add("mach-root--resizing"),r.classList.add("mach-header-resize--active"),this.uc(this.active)}gt(e=!0){let t=this.active;t&&(this.active=null,this.Yn(),this.da(t),e&&(t.column.manualWidth=t.startManualWidth,t.column.flex=t.startFlex,this.e.Ze()),this.e.o.root.classList.remove("mach-root--resizing"),this.ca(t))}pc(e){this.active=null,this.Yn(),e.didResize&&(Math.abs(this.Xe-e.startWidth)<.5?(e.column.manualWidth=e.startManualWidth,e.column.flex=e.startFlex):this.e.n.Ie(e.column,this.Xe),this.e.Ze()),this.da(e);try{e.handle.releasePointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.remove("mach-root--resizing"),this.ca(e),e.didResize&&this.e.zt([e.column])}hc(){let e=this.active;!e||!this.e.n.Ie(e.column,this.Xe)||(this.e.Ze(),this.Dr(e),this.e.ha(e.column,!1))}uc(e){this.Ce=document.createElement("div"),this.Ce.className="mach-column-resize-guide",this.Ce.setAttribute("aria-hidden","true"),this.mt=document.createElement("span"),this.mt.className="mach-column-resize-label",this.Ce.appendChild(this.mt),this.e.o.root.appendChild(this.Ce),this.Dr(e)}Dr(e){if(!this.Ce||!this.mt)return;let t=this.e.o.root,r=t.getBoundingClientRect(),i=e.handle.parentElement.getBoundingClientRect(),o=Math.max(0,Math.min(t.clientWidth,i.right-r.left-t.clientLeft)),s=Math.max(32,Math.min(t.clientWidth-32,o));this.Ce.style.left=`${o}px`,this.Ce.style.top=`${Math.max(0,i.top-r.top-t.clientTop)}px`,this.mt.style.left=`${s-o}px`,this.mt.textContent=`${Math.round(e.column.currentWidth)} px`}ca(e){e.handle.classList.remove("mach-header-resize--active"),this.Ce?.remove(),this.Ce=null,this.mt=null}ua(e,t){let r=Number.isFinite(t)?t:e.startX;return e.startWidth+r-e.startX}Xn(e){let t=this.active;return t&&e.pointerId===t.pointerId?t:null}Yn(){this.Q&&cancelAnimationFrame(this.Q),this.Q=0}da(e){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te,!0),window.removeEventListener("pointercancel",this.yt,!0),e.handle.removeEventListener("lostpointercapture",this.la)}destroy(){this.gt(!1),this.Yn(),this.e.o.root?.classList.remove("mach-root--resizing")}};var Ai=6,it=class{constructor(e){this.e=e;this.pending=null;this._t=null;this.Jn=!1;this.ie=0;this.vi=null;this.Je=e=>{if(this._t){this.gc(e);return}let t=this.pending;t&&(Math.abs(e.clientX-t.startX)<Ai&&Math.abs(e.clientY-t.startY)<Ai||this.yc(e))};this.Te=e=>{this.pending=null,e.type!=="pointercancel"&&this._t&&this.eo(e.clientX,e.clientY),this.Zn();let t=this.pa();t&&e.type!=="pointercancel"&&t.targetIndex>=0&&this.e.ut(t.column.id,t.targetIndex)}}fc(e,t){e.button===0&&t.movable&&(this.pending={column:t,startX:e.clientX,startY:e.clientY},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te),window.addEventListener("pointercancel",this.Te))}mc(){let e=this.Jn;return this.Jn=!1,e}yc(e){let t=this.pending;if(!t)return;let r=this.vc(t.column);if(!r||!r.parentElement){this.Zn();return}this.Jn=!0;let i=f("div","mach-drop-indicator"),o=f("div","mach-column-drag-ghost");o.textContent=t.column.colDef.headerName??t.column.colDef.field??t.column.id,o.ariaHidden="true",P(o,this.e.o.root),document.body.appendChild(o),r.parentElement.appendChild(i),r.classList.add("mach-header-cell--dragging"),this.e.o.root.classList.add("mach-root--dragging");let s=this.e.a.Qn(t.column),a=this.e.o.Kt[s],l=this.e.n.C(s),d=new Float64Array(l.length+1),c=new Float64Array(l.length);for(let h=0;h<l.length;h++){let p=l[h].currentWidth;c[h]=d[h]+p/2,d[h+1]=d[h]+p}let u=o.getBoundingClientRect();this._t={column:t.column,cellEl:r,ghost:o,indicator:i,targetIndex:-1,pane:s,containerLeft:a.getBoundingClientRect().left,startScrollLeft:this.e.o.S.center.scrollLeft,fromIndex:l.indexOf(t.column),midpoints:c,offsets:d,ghostWidth:u.width,ghostHeight:u.height},this.eo(e.clientX,e.clientY)}vc(e){let t=this.e.a.Qn(e);return this.e.o.Kt[t].querySelector(`.mach-header-cell[data-col-id="${ls(e.id)}"]`)}gc(e){this.vi={clientX:e.clientX,clientY:e.clientY},!this.ie&&(this.ie=requestAnimationFrame(()=>{this.ie=0;let t=this.vi;this.vi=null,t&&this.eo(t.clientX,t.clientY)}))}eo(e,t){let r=this._t;if(!r)return;let i=E(e+12,8,window.innerWidth-r.ghostWidth-8),o=E(t+12,8,window.innerHeight-r.ghostHeight-8);r.ghost.style.transform=`translate3d(${i}px, ${o}px, 0)`;let s=r.pane==="center"?this.e.o.S.center.scrollLeft-r.startScrollLeft:0,a=e-(r.containerLeft-s),l=r.midpoints.length;for(let d=0;d<r.midpoints.length;d++)if(a<r.midpoints[d]){l=d;break}r.targetIndex=l>r.fromIndex?l-1:l,r.indicator.style.transform=`translate3d(${r.offsets[l]}px, 0, 0)`}pa(){let e=this._t;return e?(this._t=null,e.cellEl.classList.remove("mach-header-cell--dragging"),e.ghost.remove(),e.indicator.remove(),this.e.o.root.classList.remove("mach-root--dragging"),e):null}Zn(){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te),window.removeEventListener("pointercancel",this.Te),this.ie&&cancelAnimationFrame(this.ie),this.ie=0,this.vi=null}destroy(){this.Zn(),this.pa(),this.pending=null}};function ls(n){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(n):n.replace(/[^a-zA-Z0-9_-]/g,"\\$&")}var fr=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;function nt(n,e=!0){if(n==="")return null;if(!e||typeof n!="string"||!fr.test(n)||/^[+-]?0\d/.test(n))return n;let t=Number(n);return Number.isFinite(t)&&(!Number.isInteger(t)||Number.isSafeInteger(t))?t:n}function ds(n,e){let t=n==null?"":String(n);return t.includes(e)||t.includes('"')||t.includes(`
|
|
1
|
+
"use strict";var nr=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var po=Object.prototype.hasOwnProperty;var fo=(n,e)=>{for(var t in e)nr(n,t,{get:e[t],enumerable:!0})},mo=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ho(e))!po.call(n,i)&&i!==t&&nr(n,i,{get:()=>e[i],enumerable:!(r=uo(e,i))||r.enumerable});return n};var go=n=>mo(nr({},"__esModule",{value:!0}),n);var qa={};fo(qa,{BUILTIN_AGG_FUNCS:()=>xe,DEFAULT_LOCALE:()=>x,EVENT_TYPES:()=>ge,LOCALE_EN:()=>_i,actionsColumn:()=>jn,advancedFilterCondition:()=>si,advancedFilterGroup:()=>ai,applyGridViewState:()=>Xr,buildColDefsFromSchema:()=>Kn,captureGridViewState:()=>Yr,clearGridState:()=>Sn,createActionButtonsRenderer:()=>we,createAggResolver:()=>Xe,createBusinessColumnTypes:()=>io,createCachedDictionary:()=>jr,createColumnHelper:()=>Xn,createDictionaryRenderer:()=>no,createEnterprisePreset:()=>Zn,createGrid:()=>Bn,createGridViewManager:()=>lo,createLocalGridStateStore:()=>Pr,createLocalGridViewStore:()=>Jr,createMachTableCommands:()=>Wn,createMachTablePreset:()=>Ur,createProgressBarRenderer:()=>Hr,createRemoteExportRequest:()=>zn,createRowActionsRenderer:()=>Xt,createStatusTagRenderer:()=>Or,defineColumns:()=>Jn,defineGridOptions:()=>eo,defineMachTableConfig:()=>to,defineMachTablePreset:()=>Qn,describeFilter:()=>Gt,downloadFile:()=>Lt,dragColumn:()=>qn,escapeHtml:()=>ae,formatText:()=>K,formatTwo:()=>me,getByPath:()=>_,indexColumn:()=>Un,isColDefGroup:()=>he,isSafePath:()=>ze,linkRenderer:()=>Vr,loadGridState:()=>qt,matchLocaleKey:()=>bt,normalizeAdvancedFilterModel:()=>B,normalizeColumnFilter:()=>_e,normalizeFilterModel:()=>Y,normalizeGridState:()=>$,normalizeGridViewState:()=>rr,normalizeSavedGridView:()=>Ce,parseCsv:()=>at,parseDelimited:()=>lt,parseTsv:()=>st,resolveGridFeatures:()=>Qt,resolveSaveConflict:()=>sn,resolveTagVariant:()=>Fr,rowActionsColumn:()=>Yn,sanitizeFormulaCell:()=>ie,saveGridState:()=>Ut,selectionColumn:()=>$n,setByPath:()=>de,toTsv:()=>ot,validateGridOptions:()=>Jt,version:()=>Ua});module.exports=go(qa);var Ve="0.34.2";function f(n,e,t){let r=document.createElement(n);if(e&&(r.className=e),t)for(let i of Object.keys(t))r.setAttribute(i,t[i]);return r}function P(n,e){if(n.classList.add("mach-portal"),!e)return;let t=window.getComputedStyle(e);for(let r=0;r<t.length;r++){let i=t.item(r);if(!i.startsWith("--mach-"))continue;let o=t.getPropertyValue(i).trim();o&&n.style.setProperty(i,o)}n.style.colorScheme=t.colorScheme}function E(n,e,t){return n<e?e:n>t?t:n}function j(n,e,t=4){let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.bottom+t,s=o+i.height>window.innerHeight-8?r.top-i.height-t:o;n.style.left=`${E(r.left,8,Math.max(8,window.innerWidth-i.width-8))}px`,n.style.top=`${E(s,8,Math.max(8,window.innerHeight-i.height-8))}px`}var Zr=0;function Qr(n="rg"){return Zr++,`${n}-${Zr}`}var ei='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3.5h12L9.5 8v4.5L6.5 14V8L2 3.5z"/></svg>',ti='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 3l4 5H4l4-5z"/></svg>',ri='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 13l4-5H4l4 5z"/></svg>',ii='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round"><path d="M2 4h3m3 0h6M2 8h7m3 0h2M2 12h1m3 0h8"/><circle cx="6.5" cy="4" r="1.35"/><circle cx="10.5" cy="8" r="1.35"/><circle cx="4.5" cy="12" r="1.35"/></svg>';var Be=class{constructor(e){this.ld=e;this.It=new Map}on(e,t){let r=this.It.get(e);return r||(r=new Set,this.It.set(e,r)),r.add(t),()=>{r.delete(t)}}once(e,t){let r=this.on(e,i=>{r(),t(i)});return r}Af(e,t){let r=this.It.get(e);r&&(r.delete(t),r.size===0&&this.It.delete(e))}emit(e,t){let r=this.It.get(e);if(r)for(let i of[...r])try{i(t)}catch(o){console.error(`[mach-table] error in "${e}" listener`,o),this.ld?.(o,e)}}clear(){this.It.clear()}};var vo=new Set(["__proto__","prototype","constructor"]),Te=new Map;function or(n){if(typeof n!="string"||n.length===0)return null;let e=Te.get(n);if(e!==void 0)return e;let t=n.split("."),r=t.every(i=>i.length>0&&!vo.has(i))?t:null;return n.length<=1024&&(Te.size>=256&&Te.delete(Te.keys().next().value),Te.set(n,r)),r}function ze(n){return or(n)!==null}function _(n,e){if(n==null)return;let t=or(e);if(!t)return;let r=n;for(let i of t){if(r==null)return;r=r[i]}return r}function de(n,e,t){if(n==null)return!1;let r=or(e);if(!r)return!1;let i=n;for(let o=0;o<r.length-1;o++){if(typeof i!="object"&&typeof i!="function"||i===null)return!1;i[r[o]]==null&&(i[r[o]]={}),i=i[r[o]]}return typeof i!="object"&&typeof i!="function"||i===null?!1:(i[r[r.length-1]]=t,!0)}var ce={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange","blank","notBlank"],date:["equals","notEquals","lessThan","greaterThan","inRange","blank","notBlank"]};var bo=16,wo=512,Co=20,To=2e3,Do=2e3,Eo={text:new Set(ce.text),number:new Set(ce.number),date:new Set(ce.date)};function xo(n){return n==null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}function Ro(n,e,t){if(n==null||typeof n!="object")return null;let r=n;return typeof r.match!="string"||!t.has(r.match)?null:{match:r.match,...So(r,e)}}function So(n,e){let t=e==="number"?ni(n.value):typeof n.value=="string"?n.value:void 0,r=e==="number"?ni(n.value2):typeof n.value2=="string"?n.value2:void 0;return{...t!==void 0?{value:t}:{},...r!==void 0?{value2:r}:{}}}function ni(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Mo(n,e){let t=[],r=Eo[e];for(let i of n.slice(0,Co)){let o=Ro(i,e,r);o&&t.push(o)}return t}function _e(n){if(n==null||typeof n!="object")return null;let e=n;return e.type==="set"?Array.isArray(e.values)?{type:"set",values:e.values.filter(xo).slice(0,To)}:null:e.type!=="text"&&e.type!=="number"&&e.type!=="date"||!Array.isArray(e.conditions)?null:{type:e.type,...e.operator==="or"||e.operator==="and"?{operator:e.operator}:{},conditions:Mo(e.conditions,e.type)}}function Io(n,e){if(typeof n.colId!="string"||!n.colId.trim())return null;let t=n.colId.trim();if(e.validColumnIds?.has(t)===!1)return null;let r=_e(n.filter);return r?{kind:"condition",colId:t,filter:r}:null}function Ao(n,e,t){if(!Array.isArray(n.children))return null;let r=[];for(let i of n.children){let o=oi(i,e+1,t);o&&r.push(o)}return r.length===0?null:{kind:"group",operator:n.operator==="or"?"or":"and",children:r,...n.not===!0?{not:!0}:{}}}function Lo(n,e,t){return e<=bo&&t.nodes<wo&&n!=null&&typeof n=="object"}function oi(n,e,t){if(!Lo(n,e,t)||t.ancestors.has(n))return null;t.ancestors.add(n),t.nodes++;let r=n,i=r.kind==="condition"?Io(r,t):r.kind==="group"?Ao(r,e,t):null;return t.ancestors.delete(n),i}function B(n,e){if(n==null||typeof n!="object")return null;let t=n;if(t.version!==1||t.root==null)return null;let r=oi(t.root,0,{ancestors:new WeakSet,nodes:0,validColumnIds:e});return r?{version:1,root:r}:null}function si(n,e){return{kind:"condition",colId:n,filter:e}}function Y(n,e){if(n==null||typeof n!="object"||Array.isArray(n))return{};let t={};for(let[r,i]of Object.entries(n).slice(0,Do)){let o=r.trim();if(!o||e?.has(o)===!1)continue;let s=_e(i);s&&(t[o]=s)}return t}function ai(n,e,t={}){return{kind:"group",operator:n,children:e,...t.not?{not:!0}:{}}}function F(n,e,t=!1){if(!(typeof n!="number"||!Number.isFinite(n)||n<e))return t?Math.floor(n):n}function Ke(n){return!n||typeof n.key!="string"||!n.key.trim()?null:{key:n.key.trim(),debounceMs:F(n.debounceMs,0,!0)??160,...n.sections?{sections:[...new Set(n.sections)]}:{},...n.store?{store:n.store}:{}}}function A(n,e,t,r=!1){let i=!1;for(let o of t)(r?Object.prototype.hasOwnProperty.call(n,o):n[o]!=null)&&(e[o]=n[o],i=!0);return i}var sr={align:"center",sortable:!0,resizable:!0,movable:!0,filter:!1,minWidth:80},De={compact:{rowHeight:30,headerHeight:34,fontSize:12,cellPadding:6},normal:{rowHeight:36,headerHeight:40,fontSize:13,cellPadding:9},large:{rowHeight:44,headerHeight:48,fontSize:14,cellPadding:12}},Ee={multiSort:!0,stripedRows:!1,showCellBorders:!1,quickFilterText:null,suppressCellFocus:!1,suppressRowHoverHighlight:!1,suppressNoRowsOverlay:!1,suppressHeaderFocus:!1,loading:!1,error:null,className:"",singleClickEdit:!1,manualSorting:!1,manualFiltering:!1,showSummary:!1,indexOffset:0,applyRowDrag:!0,masterDetail:!1,detailToggleColumn:!0,treeData:!1,childrenKey:"children",autoCheckedChildren:!0,defaultExpandAll:!1,columnMenu:!1,suppressWarnings:!1,enableRangeSelection:!1,suppressClipboard:!1,contextMenu:!1,flashCells:!0,fillHandle:!0,ariaLabel:"MachTable data grid",ariaLabelledBy:"",ariaDescribedBy:"",overlayNoRowsTemplate:"",overlayLoadingTemplate:"",overlayErrorTemplate:"",allowUnsafeOverlayHtml:!1},ko=Object.keys(Ee);function Po(n){let e={};for(let t of ko)e[t]=n[t]??Ee[t];return e}function I(n,e,t,r=!1){return F(n,t,r)??e}function Go(n){return n&&Object.prototype.hasOwnProperty.call(De,n)?n:"normal"}function No(n){return n.theme==="light"||n.theme==="dark"||n.theme==="auto"?n.theme:"light"}function Fo(n,e){let t=typeof n.pagination=="object"&&Array.isArray(n.pagination.pageSizeOptions)?n.pagination.pageSizeOptions:void 0,r=t?[...new Set(t.map(i=>I(i,0,1,!0)).filter(Boolean))]:[10,20,50,100];return r.includes(e)||r.push(e),r.sort((i,o)=>i-o)}function ar(n,e){let t=typeof n=="function"?n(e):_(e,n);return t==null?"":String(t)}function Oo(n){let e=n.rowKey,t=e?({data:r})=>ar(e,r):void 0;return{...t?{resolveRowId:t}:{},...e?{rowKey:e}:{}}}function Ho(n,e){let t=De[e];return{columnDefs:Array.isArray(n.columnDefs)?n.columnDefs:[],rowData:Array.isArray(n.rowData)?n.rowData:[],defaultColDef:{...sr,...n.defaultColDef??{}},columnTypes:n.columnTypes??{},...Oo(n),rowHeight:I(n.rowHeight,t.rowHeight,1),headerHeight:I(n.headerHeight,t.headerHeight,1),rowBuffer:I(n.rowBuffer,8,0,!0),columnLayout:n.columnLayout==="fit"?"fit":"normal",enableColumnResize:n.enableColumnResize===!0,domLayout:n.domLayout==="autoHeight"?"autoHeight":"normal",rowSelection:n.rowSelection==="single"||n.rowSelection==="multiple"?n.rowSelection:"none",size:e,pinnedTopRowData:Array.isArray(n.pinnedTopRowData)?n.pinnedTopRowData:[],pinnedBottomRowData:Array.isArray(n.pinnedBottomRowData)?n.pinnedBottomRowData:[]}}function Vo(n){return{rowStyleRules:Array.isArray(n.rowStyleRules)?n.rowStyleRules:[],theme:No(n)}}function Bo(n){return{editType:n.editType==="fullRow"?"fullRow":"cell",editableIndicator:n.editableIndicator==="always"||n.editableIndicator==="none"?n.editableIndicator:"hover",rowDragPolicy:n.rowDragPolicy,undoStackSize:I(n.undoStackSize,100,0,!0),asyncTransactionWaitMillis:I(n.asyncTransactionWaitMillis,16,0,!0)}}function zo(n){return{detailRowHeight:I(n.detailRowHeight,240,1)}}function _o(n){let e=typeof n.pagination=="object"?n.pagination:void 0,t=I(e?.pageSize,20,1,!0);return{paginationEnabled:n.pagination!==!1&&n.datasource==null,paginationMode:e?.mode==="server"?"server":"client",paginationPage:I(e?.page,1,1,!0),paginationTotal:I(e?.total,0,0,!0),paginationPageSize:t,paginationPageSizeOptions:Fo(n,t),paginationShowTotal:e?e.showTotal!==!1:!0,paginationShowSizeSelector:e?e.showPageSizeSelector!==!1:!0}}function lr(n){return{watermarkEnabled:n.watermark!=null&&n.watermark!==!1,watermarkConfig:n.watermark==null||n.watermark===!1?null:n.watermark===!0?{text:"MachTable"}:n.watermark}}function Ko(n){return{advancedFilterModel:B(n.advancedFilterModel),persistence:Ke(n.persistence),locale:n.locale??{},tooltipShowDelay:I(n.tooltipShowDelay,600,0),statusBarEnabled:n.statusBar===!0||typeof n.statusBar=="object"&&n.statusBar!=null,statusBarPanels:typeof n.statusBar=="object"&&n.statusBar?.panels?n.statusBar.panels:["rowCount","selectedRowCount","rangeAggregate"]}}function Wo(n){return{datasourceMode:n.datasourceMode==="block"?"block":"sequential",blockSize:I(n.blockSize,100,1,!0),infiniteBufferRows:I(n.infiniteBufferRows,40,0,!0),maxBlocksInCache:I(n.maxBlocksInCache,12,1,!0),datasourceMaxConcurrentRequests:I(n.datasourceMaxConcurrentRequests,4,1,!0),blockPrefetch:I(n.blockPrefetch,1,0,!0),datasourceRowCount:n.datasourceRowCount==null?null:I(n.datasourceRowCount,0,0,!0),dataProcessorMinRows:I(n.dataProcessorMinRows,5e3,1,!0),datasourceRetryCount:I(n.datasourceRetryCount,2,0,!0),datasourceRetryDelay:I(n.datasourceRetryDelay,300,0,!0),datasourceRetryJitter:Math.min(1,I(n.datasourceRetryJitter,.15,0))}}var $o=["detailRowRenderer","isRowExpandable","aggFuncs","components","actionPolicy","summaryMethod","datasource","getRowHeight","tooltipComponent","getContextMenuItems","initialState","rowEditValidator","isTreeRowExpandable","loadTreeChildren","dataProcessor"];function Uo(n,e){for(let t of $o)n[t]&&Reflect.set(e,t,n[t])}function qo(n,e){for(let t of Object.keys(n))t.startsWith("on")&&typeof n[t]=="function"&&Reflect.set(e,t,n[t])}function li(n){let e=Go(n.size),t={...Po(n),...Ho(n,e),...Vo(n),...Bo(n),...zo(n),..._o(n),...lr(n),...Ko(n),...Wo(n),features:Array.isArray(n.features)?n.features:[]};return Uo(n,t),qo(n,t),t}function di(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.length>0):typeof n=="string"&&n.length>0?[n]:[]}function ue(n,e){return di(n.type).includes(e)}function ci(n,e,t={}){let r={};for(let i of di(n.type)){let o=t[i];o&&Object.assign(r,o)}return{...e,...r,...n}}var U=class{constructor(e,t){this.manualWidth=null;this.contentWidth=null;this.flex=null;this.currentWidth=0;this.parentGroup=null;this.level=0;this.isDetailToggle=!1;this.id=e,this.colDef=t,this.hide=t.hide??!1;let r=t.pinned;this.pinned=r===!0?"left":r===!1||r==null?null:r,this.resetWidth()}get sortable(){return this.colDef.sortable!==!1}get resizable(){return this.colDef.resizable!==!1}get movable(){return this.colDef.movable!==!1}get filterable(){return this.colDef.filter!=null&&this.colDef.filter!==!1}get filterType(){let e=this.colDef.filter;return e===!0?"text":e??"text"}get hasCheckbox(){return this.colDef.checkboxSelection===!0}resetWidth(){this.manualWidth=null,this.contentWidth=null,this.flex=typeof this.colDef.flex=="number"&&Number.isFinite(this.colDef.flex)&&this.colDef.flex>0?this.colDef.flex:null}};var ee=class n{constructor(e,t){this.parent=null;this.children=[];this.groupId=e,this.def=t}get headerName(){return this.def.headerName??this.def.groupId??""}getLeafColumns(e=[]){for(let t of this.children)t instanceof n?t.getLeafColumns(e):e.push(t);return e}};function he(n){return Array.isArray(n.children)}function We(n,e){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:e}function ui(n){let e=We(n.minWidth,80);return{min:e,max:Math.max(e,We(n.maxWidth,Number.MAX_SAFE_INTEGER))}}function V(n,e){let{min:t,max:r}=ui(e),i=We(n,We(e.width,150));return Math.max(t,Math.min(r,i))}function hi(n,e){let t=n.map(s=>V(s.width??150,s)),r=[],i=0;n.forEach((s,a)=>{let l=s.flex??0;l>0&&(r.push(a),i+=l)});let o=0;for(let s of t)o+=s;if(i>0&&e>o){let s=e-o;for(let a=0;a<4&&s>.5&&r.length>0;a++){let l=[],d=0;for(let p of r){let m=n[p].flex??0;l.push(p),d+=m}let c=[];for(let p=0;p<l.length;p++){let m=l[p],v=n[m].flex??0,w=s*v/d,C=t[m];t[m]=V(C+w,n[m]),c.push(t[m]-C)}let u=0;for(let p of c)u+=p;s-=u;let h=l.filter((p,m)=>c[m]>.001);if(h.length===l.length)break;r.length=0;for(let p of h)r.push(p)}}return t}function jo(n,e,t){let r=new Set(n.map((o,s)=>s)),i=t;for(let o=0;o<n.length+1&&r.size>0;o++){let s=0;for(let l of r)s+=Math.max(1,e[l]);if(s<=0)break;let a=!1;for(let l of[...r]){let d=i*(Math.max(1,e[l])/s),c=V(d,n[l]),{min:u,max:h}=ui(n[l]);(d<u||d>h)&&(e[l]=c,i-=c,r.delete(l),a=!0)}if(!a){for(let l of r)e[l]=V(i*(Math.max(1,e[l])/s),n[l]);break}i=Math.max(0,i)}}function Yo(n,e,t){let r=t-e.reduce((i,o)=>i+o,0);if(!(Math.abs(r)<=.01))for(let i=e.length-1;i>=0;i--){let o=V(e[i]+r,n[i]);if(Math.abs(o-e[i])>.01){e[i]=o;return}}}function $e(n,e){let t=n.map(r=>V(r.width??150,r));return!Number.isFinite(e)||e<=0||n.length===0||(jo(n,t,e),Yo(n,t,e)),t}var dr="__rg_detail_toggle__";function pe(n){return typeof n=="number"&&Number.isFinite(n)&&n>0}var Ue=class{constructor(e){this.e=e;this.columns=[];this.Ss=new Map;this.ye=[];this.left=[];this.center=[];this.right=[];this.sortModel=[];this.defs=[];this.At=1;this.vn=new Map;this.dd=0}ar(e){this.defs=e?[...e]:[];let t=new Map(this.columns.map(s=>[s.id,s])),r=this.e.r.defaultColDef,i=new Set(this.e.r.masterDetail&&this.e.r.detailToggleColumn?[dr]:[]),o=(s,a,l)=>s.map((d,c)=>{if(he(d)){let C=d.groupId??d.headerName??`group_${c}_${l}`,R=new ee(C,d);return R.parent=a,R.children=o(d.children,R,l+1),R}let u=d,h=u.colId??u.field??`col_${c}`,p=h,m=2;for(;i.has(p);)p=`${h}_${m++}`;i.add(p);let v=new U(p,ci(u,r,this.e.r.columnTypes));v.parentGroup=a,v.level=l;let w=t.get(p);return w&&(v.manualWidth=w.manualWidth,v.contentWidth=w.contentWidth,v.flex=w.flex,v.hide=w.hide,v.pinned=w.pinned),v});if(this.ye=o(this.defs,null,0),this.e.r.masterDetail&&this.e.r.detailToggleColumn){let s=new U(dr,{colId:dr,headerName:"",width:38,pinned:"left",sortable:!1,resizable:!1,movable:!1,filter:!1});s.isDetailToggle=!0,this.ye.unshift(s)}if(this.columns=this.Yr(this.ye),this.Ss=new Map(this.columns.map(s=>[s.id,s])),this.At=this.columns.reduce((s,a)=>Math.max(s,a.level+1),1),this.sortModel=this.sortModel.filter(s=>this.columns.some(a=>a.id===s.colId)),this.sortModel.length===0){let s=[];for(let a of this.columns)a.colDef.initialSort&&s.push({colId:a.id,direction:a.colDef.initialSort});this.sortModel=s}this.Lt()}Yr(e,t=[]){for(let r of e)r instanceof ee?this.Yr(r.children,t):t.push(r);return t}Lt(){let e=this.columns.filter(t=>!t.hide);this.left=e.filter(t=>t.pinned==="left"),this.right=e.filter(t=>t.pinned==="right"),this.center=e.filter(t=>t.pinned===null),this.vn.clear(),this.c().forEach((t,r)=>this.vn.set(t.id,r))}Me(e){return this.vn.get(e)??-1}X(){return this.columns}Xr(){return this.defs}cd(){return this.ye}ud(){return this.At}L(e){return this.Ss.get(e)}C(e){return e==="left"?this.left:e==="right"?this.right:this.center}c(){return[...this.left,...this.center,...this.right]}ze(){return this.c().filter(e=>e.colDef.rowGroup===!0)}hd(){return this.c().filter(e=>e.colDef.aggFunc!=null&&e.colDef.rowGroup!==!0)}bn(){return this.center.some(e=>e.colDef.colSpan!=null)}Ms(){let e=this.c();return this.center.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e[0]}lr(e){return e.pinned==="left"?"left":e.pinned==="right"?"right":"center"}Is(e){this.dd=e;let t=0;for(let c of[...this.left,...this.right])c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),t+=c.currentWidth;let r=Math.max(0,e-t),i=[],o=[];for(let c of this.center)(c.colDef.suppressSizeToFit||c.manualWidth!=null?o:i).push(c);let s=0;for(let c of o)c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),s+=c.currentWidth;let a=i.map(c=>this.ct(c)),l=Math.max(0,r-s),d=this.e.r.columnLayout==="fit"?$e(a,l):hi(a,l);i.forEach((c,u)=>{c.currentWidth=d[u]})}ct(e){let t=e.colDef;return{width:e.manualWidth??e.contentWidth??t.width,minWidth:t.minWidth,maxWidth:t.maxWidth,flex:e.manualWidth==null?e.flex??void 0:void 0}}Ie(e,t){return pe(t)?(e.manualWidth=V(t,this.ct(e)),e.flex=null,!0):!1}As(e,t){return pe(t)?(e.resetWidth(),e.contentWidth=V(t,this.ct(e)),!0):!1}wn(e,t){let r=this.L(e);!r||r.hide===!t||(r.hide=!t,this.Lt())}ut(e,t){let r=this.L(e);if(!r)return!1;let i=this.lr(r),o=u=>r.parentGroup?!0:this.lr(u)===i,s=r.parentGroup?r.parentGroup.children:this.ye,a=s.filter(u=>u instanceof U&&!u.hide&&o(u)),l=a.indexOf(r);if(l<0)return!1;a.splice(l,1);let d=Math.max(0,Math.min(t,a.length));a.splice(d,0,r);let c=[];return s.forEach((u,h)=>{u instanceof U&&!u.hide&&o(u)&&c.push(h)}),c.length!==a.length?!1:(c.forEach((u,h)=>{s[u]=a[h]}),this.columns=this.Yr(this.ye),this.Lt(),!0)}Cn(e,t){let r=this.L(e);!r||!r.movable||(r.pinned=t,this.Lt())}Jr(){return this.columns.map(e=>({colId:e.id,hide:e.hide,width:e.manualWidth??e.currentWidth,flex:e.flex,widthMode:e.manualWidth==null?"auto":"manual",contentWidth:e.contentWidth??void 0,pinned:e.pinned}))}Ls(e){let t=new Map(e.map(r=>[r.colId,r]));for(let r of this.columns){let i=t.get(r.id);i&&this.pd(r,i)}this.fd(e),this.Lt()}pd(e,t){typeof t.hide=="boolean"&&(e.hide=t.hide),t.widthMode==="auto"?(e.resetWidth(),pe(t.flex)&&(e.flex=t.flex)):pe(t.flex)?(e.flex=t.flex,e.manualWidth=null):pe(t.width)&&(e.manualWidth=V(t.width,this.ct(e)),e.flex=null),pe(t.contentWidth)&&(e.contentWidth=V(t.contentWidth,this.ct(e))),e.movable&&(t.pinned==="left"||t.pinned==="right"||t.pinned===null)&&(e.pinned=t.pinned)}fd(e){let t=new Map;e.forEach((i,o)=>t.set(i.colId,o));let r=i=>i.pinned==="left"?"left":i.pinned==="right"?"right":"center";for(let i of["left","center","right"]){let o=this.ye.filter(d=>d instanceof U&&!d.hide&&d.parentGroup===null&&r(d)===i);if(o.length<2)continue;let s=o.filter(d=>d.movable),a=s.slice().sort((d,c)=>(t.get(d.id)??Number.MAX_SAFE_INTEGER)-(t.get(c.id)??Number.MAX_SAFE_INTEGER));if(a.every((d,c)=>d===s[c]))continue;let l=[];this.ye.forEach((d,c)=>{d instanceof U&&!d.hide&&d.parentGroup===null&&r(d)===i&&d.movable&&l.push(c)}),l.forEach((d,c)=>{this.ye[d]=a[c]})}this.columns=this.Yr(this.ye)}Tn(){for(let e of this.columns){e.resetWidth(),e.hide=e.colDef.hide??!1;let t=e.colDef.pinned;e.pinned=t===!0?"left":t===!1||t==null?null:t}this.Lt()}U(){return this.sortModel.map(e=>({...e}))}dr(e){if(!e||e.length===0){this.sortModel=[];return}this.sortModel=e.filter(t=>this.columns.some(r=>r.id===t.colId)&&(t.direction==="asc"||t.direction==="desc")).map(t=>({colId:t.colId,direction:t.direction}))}Zr(e,t){let r=[...this.sortModel],i=r.findIndex(l=>l.colId===e.id),o=i>=0?r[i].direction:null,s=o===null?"asc":o==="asc"?"desc":null;t&&this.e.r.multiSort?s===null?i>=0&&r.splice(i,1):i>=0?r[i]={colId:e.id,direction:s}:r.push({colId:e.id,direction:s}):(r.length=0,s&&r.push({colId:e.id,direction:s})),this.sortModel=r}};function te(n,e){if(n instanceof Error)return n;let t=new Error(typeof n=="string"?n:e);return t.name="AbortError",t}var Xo=()=>te(void 0,"[MachTable] Operation cancelled.");function qe(n,e,t=Xo){return e?new Promise((r,i)=>{let o=()=>{e.removeEventListener("abort",o),i(t())};if(n.then(r,i).finally(()=>e.removeEventListener("abort",o)),e.aborted){o();return}e.addEventListener("abort",o,{once:!0})}):n}function fi(n){return n==null?"":String(n).toLowerCase()}function Jo(n,e,t){let r=fi(n),i=o=>{let s=(o.value??"").toLowerCase();switch(o.match){case"contains":return r.includes(s);case"notContains":return!r.includes(s);case"equals":return r===s;case"notEquals":return r!==s;case"startsWith":return r.startsWith(s);case"endsWith":return r.endsWith(s);case"blank":return r==="";case"notBlank":return r!=="";default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Zo(n,e,t){switch(t.match){case"equals":return n===e;case"notEquals":return n!==e;case"lessThan":return n<e;case"lessThanOrEqual":return n<=e;case"greaterThan":return n>e;case"greaterThanOrEqual":return n>=e;case"inRange":return n>=e&&n<=(t.value2??e);default:return!0}}function Qo(n,e){let t=n==null||n==="";if(e.match==="blank")return t;if(e.match==="notBlank")return!t;if(t)return!1;let r=typeof n=="number"?n:Number(n);if(Number.isNaN(r))return!1;let i=e.value;return i==null||Number.isNaN(i)?!1:Zo(r,i,e)}function es(n,e,t){let r=i=>Qo(n,i);return e.length===0||(t==="or"?e.some(r):e.every(r))}function cr(n){if(n==null||n==="")return null;if(n instanceof Date)return isNaN(n.getTime())?null:n.getTime();if(typeof n=="number")return n;let e=Date.parse(String(n));return isNaN(e)?null:e}function ts(n,e,t){let r=cr(n),i=o=>{let s=r==null;if(o.match==="blank")return s;if(o.match==="notBlank")return!s;if(s)return!1;let a=r,l=o.value!=null?cr(o.value):null;if(l==null)return!1;switch(o.match){case"equals":return a===l;case"notEquals":return a!==l;case"lessThan":return a<l;case"greaterThan":return a>l;case"inRange":{let d=o.value2!=null?cr(o.value2):null;return d!=null?a>=l&&a<=d:a>=l}default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function rs(n,e){return e.length===0?!0:e.some(t=>t==null&&n==null||t===n)}function mi(n,e){let t=e.type!=="set"&&e.operator==="or"?"or":"and";switch(e.type){case"text":return Jo(n,e.conditions,t);case"number":return es(n,e.conditions,t);case"date":return ts(n,e.conditions,t);case"set":return rs(n,e.values);default:return!0}}function gi(n,e,t){if(n.kind==="condition"){let i=e.get(n.colId);return i?o=>mi(t(o,i),n.filter):()=>!0}let r=n.children.map(i=>gi(i,e,t));return i=>{let o=n.operator==="or"?r.some(s=>s(i)):r.every(s=>s(i));return n.not?!o:o}}function ur(n,e,t,r,i){let o=new Map(n.map(d=>[d.id,d])),s=Object.entries(e).flatMap(([d,c])=>{let u=o.get(d);return u?[{column:u,filter:c}]:[]}),a=t?gi(t.root,o,i):()=>!0,l=r?.trim().toLowerCase().split(/\s+/).filter(Boolean)??[];return d=>!s.every(({column:c,filter:u})=>mi(i(d,c),u))||!a(d)?!1:l.every(c=>n.some(u=>fi(i(d,u)).includes(c)))}var yi=typeof Intl<"u"?new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}):null;function is(n,e){let t=n==null||n==="",r=e==null||e==="";return!t&&!r?null:t&&r?0:t?1:-1}function ns(n,e){let t=Number.isNaN(n),r=Number.isNaN(e);return t||r?t===r?0:t?1:-1:n-e}function os(n,e){return n===e?0:n?1:-1}function je(n,e){let t=is(n,e);if(t!==null)return t;if(typeof n=="number"&&typeof e=="number")return ns(n,e);if(n instanceof Date&&e instanceof Date)return n.getTime()-e.getTime();if(typeof n=="boolean"&&typeof e=="boolean")return os(n,e);let r=String(n),i=String(e);return yi?yi.compare(r,i):r.localeCompare(i)}function hr(n,e,t,r){let i=new Map(t.map(a=>[a.id,a])),o=e.flatMap(a=>{let l=i.get(a.colId);return l?[{column:l,compare:l.colDef.comparator??je,direction:a.direction}]:[]}),s=n.map(a=>({node:a,values:o.map(({column:l})=>r(a,l))}));return s.sort((a,l)=>{for(let d=0;d<o.length;d++){let c=o[d],u=c.compare(a.values[d],l.values[d],a.node,l.node);if(u!==0)return c.direction==="asc"?u:-u}return 0}),s.map(({node:a})=>a)}function vi(){return{count:0,numeric:0,sum:0,min:1/0,max:-1/0}}function bi(n,e){n.count++,!(typeof e!="number"||!Number.isFinite(e))&&(n.numeric++,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e))}function wi(n,e){return e==="count"?n?.count??0:n?.numeric?e==="min"?n.min:e==="max"?n.max:Number.isFinite(n.sum)?e==="avg"?n.sum/n.numeric:n.sum:null:null}function Ye(n,e){let t=vi();for(let r of n)bi(t,r);return wi(t,e)}var xe={sum:n=>Ye(n,"sum"),avg:n=>Ye(n,"avg"),count:n=>n.length,min:n=>Ye(n,"min"),max:n=>Ye(n,"max"),first:n=>n.length>0?n[0]:null,last:n=>n.length>0?n[n.length-1]:null};function Ci(n,e,t){if(e===xe.count)return n.length;let r=["sum","avg","min","max"].find(o=>e===xe[o]);if(!r)return e(n.map(t));let i=vi();for(let o of n)bi(i,t(o));return wi(i,r)}function Xe(n){let e={...xe,...n??{}};return t=>e[t]}var Je="group:";function Ti(n){return n==null?"null":n instanceof Date?JSON.stringify(["date",String(n.getTime())]):JSON.stringify([typeof n,pr(n)])}function pr(n){return n==null?"(\u7A7A)":String(n)}function Di(n){return Je+JSON.stringify(n)}function ss(n,e,t){let r=new Map;for(let i of n){let o=t(i,e),s=Ti(o),a=r.get(s);a||(a={key:s,label:pr(o),rows:[]},r.set(s,a)),a.rows.push(i)}return[...r.values()].sort((i,o)=>i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})||i.key.localeCompare(o.key))}function Ei(n,e,t,r,i){let o=[],s=(a,l,d)=>{if(l===e.length)return{display:a,leaves:a};let c=[],u=[];for(let h of ss(a,e[l],t)){let p=[...d,[e[l].id,h.key]],m=Di(p);o.push(m);let v=s(h.rows,l+1,p);if(c.push({id:m,data:null,rowIndex:-1,selected:!1,isGroup:!0,groupLevel:l,groupKey:h.label,leafNodes:v.leaves,aggValues:r(v.leaves)}),i.has(m))for(let w of v.display)c.push(w);if(l>0)for(let w of v.leaves)u.push(w)}return{display:c,leaves:u}};return{rows:s(n,0,[]).display,ids:o}}function xi(n,e,t,r){let i=new Set([...n].filter(l=>l.startsWith("/g0:")));if(!i.size)return{expanded:n,ambiguous:[]};let o=new Map;for(let l of e){let d=[],c="";for(let u=0;u<t.length;u++){let h=r(l,t[u]);if(d.push([t[u].id,Ti(h)]),c+=`/g${u}:${pr(h)}`,!i.has(c))continue;let p=Di(d);o.set(c,o.has(c)&&o.get(c)!==p?null:p)}}let s=new Set([...n].filter(l=>!i.has(l))),a=[];for(let l of i){let d=o.get(l);d?s.add(d):d===null?a.push(l):s.add(l)}return{expanded:s,ambiguous:a}}function as(n,e){let t=n?[n.root]:[];for(;t.length;){let r=t.pop();if(r.kind==="condition")e.add(r.colId);else for(let i of r.children)t.push(i)}}function Ri(n){let e=new Set(Object.keys(n.filterModel));as(n.advancedFilter,e);let t=new Set(n.sortModel.map(a=>a.colId));for(let a of t)e.add(a);let r=n.columns.some(a=>a.colDef.rowGroup===!0),i=!!n.quickFilter?.trim(),o=n.columns.filter(a=>e.has(a.id)||i||a.colDef.rowGroup===!0||r&&a.colDef.aggFunc!=null),s=new Set;for(let a of o){let l=a.colDef;if(r&&l.rowGroup!==!0&&l.aggFunc!=null&&n.customAggregates?.[l.aggFunc]||l.valueGetter||t.has(a.id)&&l.comparator||!l.field)return null;s.add(l.field)}return[...s]}function Si(n){return n!=null&&(typeof n=="object"||typeof n=="function")}function Mi(n,e){let t=new WeakMap;for(let r of n){if(r.data==null)continue;let i=e.map(o=>_(r.data,o));i.some(Si)||t.set(r,i)}return t}function Ii(n,e,t,r){return t.length?!r||n===e||n==null||e==null?!0:t.some((i,o)=>{let s=_(e,i);return Si(s)||!Object.is(r[o],s)}):!1}function re(n){return te(n.reason,"Block request aborted")}function Ze(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):1}var Qe=class{constructor(e,t,r=4){this.maxBlocks=e;this.En=t;this.maxConcurrentRequests=r;this.J=new Map;this.q=new Map;this.ks=0;this.generation=0;this.hitCount=0;this.missCount=0;this.evictionCount=0;this.Qr=0;this.ei=new Set;this.maxBlocks=Ze(e),this.maxConcurrentRequests=Ze(r)}configure(e,t=this.maxConcurrentRequests){this.maxBlocks=Ze(e),this.maxConcurrentRequests=Ze(t),this.Dn(),this.ti()}md(e){this.ei=e,this.Dn()}peek(e){let t=this.J.get(e);if(t)return t.touchedAt=++this.ks,t}has(e){return this.J.has(e)}invalidate(e){let t=this.q.get(e);t&&(this.q.delete(e),t.controller.abort(),t.state==="queued"&&t.reject(re(t.controller.signal)));let r=this.J.get(e);r&&(this.J.delete(e),this.En?.(e,r))}load(e,t,r,i=0){if(r?.aborted)return Promise.reject(re(r));let o=this.peek(e);if(o)return this.hitCount++,Promise.resolve(o);let s=this.q.get(e);if(s)return this.hitCount++,s.priority=Math.max(s.priority,i),this.ti(),this.Ps(e,s,r);this.missCount++;let a=new AbortController,l,d,c=new Promise((p,m)=>{l=p,d=m}),u={controller:a,promise:c,consumers:0,loader:t,priority:i,state:"queued",resolve:l,reject:d};this.q.set(e,u);let h=this.Ps(e,u,r);return this.ti(),h}gd(){this.generation++,this.ei.clear();for(let e of this.q.values())e.controller.abort(),e.state==="queued"&&e.reject(re(e.controller.signal));this.q.clear();for(let[e,t]of this.J)this.En?.(e,t);this.J.clear()}snapshot(){let e=0,t=0;for(let r of this.J.values())e+=r.rows.length;for(let r of this.q.values())r.state==="active"&&t++;return{cachedBlockCount:this.J.size,loadingBlockCount:this.q.size,activeRequestCount:t,queuedRequestCount:Math.max(0,this.q.size-t),cachedRowCount:e,hitCount:this.hitCount,missCount:this.missCount,evictionCount:this.evictionCount}}ti(){for(;this.Qr<this.maxConcurrentRequests;){let e,t;for(let[r,i]of this.q)i.state!=="queued"||i.controller.signal.aborted||(!t||i.priority>t.priority)&&(e=r,t=i);if(e==null||!t)return;this.yd(e,t)}}yd(e,t){t.state="active",this.Qr++;let r=this.generation;this.vd(t).then(i=>{r===this.generation&&!t.controller.signal.aborted&&(this.J.set(e,{rows:i.rows,...i.lastRow==null?{}:{lastRow:i.lastRow},touchedAt:++this.ks}),this.Dn()),t.resolve(i)},t.reject).finally(()=>{this.Qr=Math.max(0,this.Qr-1),this.q.get(e)===t&&this.q.delete(e),this.ti()})}vd(e){let{signal:t}=e.controller;return qe(Promise.resolve().then(()=>{if(t.aborted)throw re(t);return e.loader(t)}),t,()=>re(t))}Ps(e,t,r){return t.consumers++,new Promise((i,o)=>{let s=!1,a=d=>{s||(s=!0,r?.removeEventListener("abort",l),t.consumers=Math.max(0,t.consumers-1),d())},l=()=>a(()=>{t.consumers===0&&this.q.get(e)===t&&(this.q.delete(e),t.controller.abort(r?.reason),t.state==="queued"&&t.reject(re(t.controller.signal))),o(re(r))});r?.addEventListener("abort",l,{once:!0}),t.promise.then(d=>a(()=>i(d)),d=>a(()=>o(d instanceof Error?d:new Error(String(d??"Block request failed")))))})}Dn(){let e=Math.max(this.maxBlocks,this.ei.size+1);for(;this.J.size>e;){let t=-1,r=Number.POSITIVE_INFINITY;for(let[o,s]of this.J)this.ei.has(o)||s.touchedAt<r&&(t=o,r=s.touchedAt);if(t<0)return;let i=this.J.get(t);this.J.delete(t),this.evictionCount++,i&&this.En?.(t,i)}}};function Re(n,e){if(n==null||typeof n!="object")return;let t=n[e];return Array.isArray(t)?t:void 0}var et=class{constructor(e){this.e=e;this.all=[];this.H=[];this.Z=new Map;this.displayed=[];this.h=new Map;this.filterModel={};this.advancedFilterModel=null;this.quickFilter=null;this.k=new Set;this.K=new Set;this.kt=[];this.cr=new Map;this.Gs=[];this.P=null;this.Pt=!1;this.Ns=!1;this._e=0;this.ri=null;this.ii=null;this.ni=new WeakMap;this.ur=new WeakMap;this.Ke=new Map;this.hr=new Map;this.pr=0;this.oi=0;this.We=null;this.$e=new Map;this.ht=new Map;this.si=new Set;this.pt=new Map;this.Ue=new Qe(12,e=>this.Fs(e));this.fr=0;this.ai=null;this.xn=!1;this.Os=0;this.te=[];this.page=1;this.pageSize=20;this.advancedFilterModel=B(e.r.advancedFilterModel)}resolveRowId(e,t,r){let i=this.e.r.resolveRowId;if(!i)return r;try{let o=i({data:e,index:t,api:this.e.api});if(typeof o=="string"&&o.length>0)return o;this.e.reportError(new Error("rowKey must resolve to a non-empty identifier"),"rowKey",{index:t})}catch(o){this.e.reportError(o,"rowKey",{index:t})}return r}get N(){return this.e.r.treeData}get p(){return this.e.r.datasource!=null}get ue(){return this.p&&this.e.r.datasourceMode==="block"}Gt(){if(this.p){if(this.ue)return this.Nt();let e=Math.max(0,this.displayed.length-this.all.length);return(this.P??this.all.length)+e}return this.displayed.length}Rn(){return this.pr}mr(){return this.oi}bd(){return this.Ns}li(e){return!this.p||e?.aborted?Promise.resolve():(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.P=null,this.Pt=!1,this.all=[],this.H=[],this.h.clear(),this.k.clear(),this.e.O.clear(),this.b(),this.e.u({data:!0}),this.ue?(this.Ue.configure(this.e.r.maxBlocksInCache,this.e.r.datasourceMaxConcurrentRequests),this.ci(0,e)):this.Hs(0,void 0,e))}ft(e){this.Ns=e,this.e.o.ft(e,this.e.g("loading"))}Hs(e,t,r){if(!this.p||this.Pt||this.P!=null&&e>=this.P)return Promise.resolve();let i=this.e.r.blockSize,o=t??e+i;if(o<=e)return Promise.resolve();let s=++this._e,a=new AbortController,l=()=>a.abort(r?.reason);return r?.addEventListener("abort",l,{once:!0}),this.ri=a,this.Pt=!0,this.ft(!0),new Promise(d=>{let c=!1;this.ii=d;let u=h=>{c||(c=!0,r?.removeEventListener("abort",l),s===this._e&&(this.Pt=!1,this.ri=null,this.ii=null,this.ft(!1),h!=null&&h?.name!=="AbortError"&&this.e.reportError(h,"datasource.getRows",{startRow:e,endRow:o})),d())};this.Vs(e,o,a.signal,(h,p)=>{if(s!==this._e||this.e.s()||a.signal.aborted){u();return}typeof p=="number"&&p>=0?this.P=p:h.length<o-e&&(this.P=e+h.length);let m=this.all.length===0;this.wd(h),u(),this.b(),this.e.u({data:!0}),m&&this.e.he(),this.e.B.ui()},h=>u(a.signal.aborted||this.e.s()?void 0:h??new Error("Datasource request failed")))})}di(){this._e++,this.ri?.abort(),this.ri=null,this.Pt=!1,this.ft(!1),this.ii?.(),this.ii=null,this.Ue.gd(),this.$e.clear(),this.ht.clear(),this.si.clear();for(let[e,t]of this.pt)this.h.get(e)===t&&this.h.delete(e);this.pt.clear()}wd(e){for(let t of e){if(t==null)continue;let r=this.all.length,i=this.resolveRowId(t,r,`inf-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"datasource.getRows",{rowId:i});continue}let o={id:i,data:t,rowIndex:-1,selected:this.e.m.Sn(i)};this.all.push(o),this.h.set(i,o),this.H.push(o)}}ci(e,t,r=0){if(!this.ue||e<0)return Promise.resolve();if(t?.aborted)return Promise.reject(this.Bs(t.reason));let i=this.e.r.blockSize,o=this._e,s=e*i;if(s>=this.Nt())return Promise.resolve();let a=this.P==null?s+i:Math.min(this.P,s+i),l=this.Ue.load(e,d=>this.Cd(s,a,d),t,r);return this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0),l.then(d=>{o!==this._e||t?.aborted||this.e.s()||!this.ue||!this.Ue.has(e)||this.si.has(e)||(this.Td(e,d),this.b(),this.e.u({data:!0}),this.e.B.ui(),o===this._e&&!this.e.s()&&this.zs(this.e.a.Mn().lastExcl-1))}).catch(d=>{throw d?.name!=="AbortError"&&this.e.reportError(d,"datasource.getRows",{startRow:s,endRow:a}),d}).finally(()=>{o===this._e&&this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0)})}Cd(e,t,r){return new Promise((i,o)=>{this.Vs(e,t,r,(s,a)=>i({rows:s,...typeof a=="number"&&a>=0?{lastRow:a}:{}}),s=>o(s instanceof Error?s:new Error(typeof s=="string"?s:"Datasource request failed")))})}Vs(e,t,r,i,o){let s=this.e.r.datasource,a=0,l=null,d=!1,c=p=>{d||(d=!0,l!=null&&clearTimeout(l),r.removeEventListener("abort",u),p())},u=()=>c(()=>o(this.Bs(r.reason)));r.addEventListener("abort",u,{once:!0});let h=()=>{if(d)return;if(r.aborted||this.e.s()){u();return}a++;let p=!1,m=v=>{if(!(p||d)){if(p=!0,r.aborted||this.e.s()){u();return}a<=this.e.r.datasourceRetryCount?l=setTimeout(h,this.retryDelay(a)):c(()=>o(v))}};try{let v=s.getRows({startRow:e,endRow:t,sortModel:this.e.n.U(),filterModel:this.j(),advancedFilterModel:this.be(),quickFilterText:this.quickFilter,signal:r,onSuccess:(w,C)=>{p||d||(p=!0,c(()=>i(w??[],C)))},fail:m});v&&typeof v.catch=="function"&&v.catch(m)}catch(v){m(v)}};h()}Td(e,t){let r=this.e.r.blockSize,i=e*r;this.Fs(e),typeof t.lastRow=="number"&&t.lastRow>=0?this.P=t.lastRow:t.rows.length<r&&(this.P=i+t.rows.length),t.rows.forEach((o,s)=>{if(o==null)return;let a=i+s;if(this.P!=null&&a>=this.P)return;let l=this.resolveRowId(o,a,`block-${a}`),d=this.pt.get(l),c=this.h.get(l);if(c&&c!==d&&c.rowIndex!==a){this.e.reportError(new Error(`Duplicate row id: ${l}`),"datasource.getRows",{rowId:l});return}let u=d??{id:l,data:o,rowIndex:a,selected:this.e.m.Sn(l)};u.rowIndex=a,u.selected=this.e.m.Sn(l),this.pt.delete(l),this.$e.set(a,u),this.ht.delete(a),this.h.set(l,u),this.ur.set(u,a+1)}),this._s(),this.si.add(e)}Fs(e){this.si.delete(e);let t=this.e.r.blockSize,r=e*t,i;for(let o=r;o<r+t;o++){let s=this.$e.get(o);s&&(i??(i=new Set(this.e.V.getDirtyRowIds())),this.$e.delete(o),i.has(s.id)?this.pt.set(s.id,s):this.h.get(s.id)===s&&this.h.delete(s.id))}this._s()}_s(){this.all=[...this.$e.entries()].sort(([e],[t])=>e-t).map(([,e])=>e),this.H=this.all}Nt(){if(this.P!=null)return this.P;if(this.e.r.datasourceRowCount!=null)return this.e.r.datasourceRowCount;if(this.$e.size===0)return this.e.r.blockSize;let e=0;for(let t of this.$e.keys())e=Math.max(e,t+1);return e+this.e.r.blockSize}Dd(e){let t=this.ht.get(e);if(!t&&(t={id:`__mach_loading_${e}`,data:null,rowIndex:e,selected:!1,loading:!0},this.ht.set(e,t),this.ht.size>2e3)){let r=this.ht.keys().next().value;r!=null&&this.ht.delete(r)}return t}Bs(e){return te(e,"Operation aborted")}retryDelay(e){let t=Math.min(this.e.r.datasourceRetryDelay*2**Math.max(0,e-1),3e4),r=this.e.r.datasourceRetryJitter;return Math.max(0,Math.round(t*(1+(Math.random()*2-1)*r)))}Ed(e){if(this.ue){this.zs(e);return}if(!this.p||this.Pt)return;let t=this.all.length;if(this.P!=null&&t>=this.P)return;let r=this.e.r.infiniteBufferRows;if(e+r<t&&e<t)return;let i=this.e.r.blockSize,o=this.P==null?t+i:Math.min(this.P,t+i);this.Hs(t,o)}zs(e){if(e<0)return;this.Ks();let t=this.e.r.blockSize,r=Math.floor(e/t),i=Math.floor(this.e.a.Mn().first/t),o=this.e.r.blockPrefetch,s=r<this.Os?-1:1;this.Os=r;for(let a=i;a<r;a++)this.ci(a,void 0,o+2).catch(()=>{});for(let a=0;a<=o;a++){let l=a===0?[r]:[r+s*a,r-s*a];for(let d of l)d<0||d*t>=this.Nt()||this.ci(d,void 0,o-a+1).catch(()=>{})}}Ae(){return this.li().catch(()=>{})}xd(){return this.di(),this.p?this.li().catch(()=>{}):(this.P=null,this.qe(this.e.r.rowData),this.e.u({data:!0}),Promise.resolve())}destroy(){this.We=null,this.di(),this.Ws(),this.In(),this.all=this.H=this.displayed=this.te=[],this.h.clear(),this.Z.clear(),this.cr.clear(),this.Gs=[],this.k.clear(),this.K.clear(),this.kt=[]}An(e,t,r){if(!this.ue)return Promise.resolve();this.Ks();let i=this.e.r.blockSize,o=Math.max(0,Math.trunc(e)),s=Math.min(this.Nt(),Math.max(o,Math.trunc(t))),a=Math.floor(o/i),l=Math.max(a,Math.floor(Math.max(o,s-1)/i)),d=[];for(let c=a;c<=l;c++)d.push(this.ci(c,r,100));return Promise.all(d).then(()=>{})}Ln(){this.ue&&(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.e.O.clear(),this.all=[],this.H=[],this.h.clear(),this.b(),this.e.u({data:!0}))}kn(){return this.Ue.snapshot()}Ks(){let e=new Set(this.e.V.getDirtyRowIds());for(let[l,d]of this.pt)e.has(l)||(this.pt.delete(l),this.h.get(l)===d&&this.h.delete(l));let t=this.e.r.blockSize,r=new Set,{first:i,lastExcl:o}=this.e.a.Mn();for(let l=i;l<o;l+=t)r.add(Math.floor(l/t));o>i&&r.add(Math.floor((o-1)/t));let s=this.e.a.T;s&&r.add(Math.floor(s.rowIndex/t));let a=this.e.l.Rd();a!=null&&r.add(Math.floor(a/t)),this.Ue.md(r)}qe(e){this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.Ws(),this.e.V.clear();let t=this.e.r.resolveRowId,r=this.e.r.childrenKey,i=[],o=[],s=new Map,a=new Map,l=0,d=(c,u,h)=>{let p=l++,m=this.resolveRowId(c,p,`auto-${p}`);if(s.has(m))return this.e.reportError(new Error(`Duplicate row id: ${m}`),"rowData",{rowId:m,index:p}),null;let v=this.N?Re(c,r):void 0,w={id:m,data:c,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(v)};if(this.ni.set(w,u),i.push(w),s.set(m,w),h!=null){let C=a.get(h)??[];C.push(m),a.set(h,C)}else o.push(w);if(this.N&&Array.isArray(v))for(let C of v)C!=null&&d(C,u+1,m);return w};(e??[]).forEach(c=>{c!=null&&d(c,0,null)}),this.all=i,this.H=o,this.Z=a,this.h=s,this.e.O.clear();for(let c of[...this.k])s.has(c)||this.k.delete(c);if(this.e.r.defaultExpandAll)for(let c of i)this.$s(c.id)>0&&this.k.add(c.id);this.e.m.Us(t!=null),this.b()}gr(e){return this.Z.get(e)??[]}$s(e){return this.Z.get(e)?.length??0}Pn(e){return this.$s(e)>0}isTreeRowLoading(e){return this.h.get(e)?.treeLoading===!0}Ws(){for(let e of this.Ke.values())e.abort();this.Ke.clear(),this.hr.clear()}loadTreeChildren(e,t=!1){let r=this.h.get(e),i=this.e.r.loadTreeChildren;if(!this.N||!r?.data||!i)return Promise.resolve([]);if(!t&&r.treeChildrenLoaded)return Promise.resolve(this.gr(e).flatMap(l=>{let d=this.h.get(l)?.data;return d==null?[]:[d]}));let o=this.hr.get(e);if(o&&!t)return o;this.Ke.get(e)?.abort();let s=new AbortController;this.Ke.set(e,s),r.treeLoading=!0,r.treeLoadError=void 0,this.e.u({data:!0});let a=Promise.resolve().then(()=>i({data:r.data,node:r,api:this.e.api,signal:s.signal})).then(l=>{if(s.signal.aborted||this.e.s())return[];if(!Array.isArray(l))throw new TypeError("[MachTable] loadTreeChildren must resolve to an array.");return this.Sd(r,l),r.treeChildrenLoaded=!0,r.treeLoadError=void 0,this.e.emit("treeChildrenLoaded",{rowId:e,rowNode:r,children:l}),l}).catch(l=>{if(s.signal.aborted||l?.name==="AbortError")return[];throw r.treeLoadError=l,r.treeChildrenLoaded=!1,this.e.reportError(l,"treeData.loadChildren",{rowId:e}),this.e.emit("treeChildrenLoadFailed",{rowId:e,rowNode:r,error:l}),l}).finally(()=>{this.Ke.get(e)===s&&(this.Ke.delete(e),this.hr.delete(e),r.treeLoading=!1,this.e.u({data:!0}))});return this.hr.set(e,a),a}Sd(e,t){let r=new Set,i=[...this.gr(e.id)];for(;i.length>0;){let s=i.pop();r.has(s)||(r.add(s),i.push(...this.gr(s)))}this.Md(t,r);for(let s of r)this.Ke.get(s)?.abort(),this.Ke.delete(s),this.hr.delete(s),this.Z.delete(s),this.h.delete(s),this.k.delete(s);this.Z.delete(e.id);let o=this.Gn(e)+1;for(let s of t)s!=null&&this.Nn(e,s,o);this.qs(),this.e.m.Us(this.e.r.resolveRowId!=null),this.b(),this.e.u({data:!0})}Md(e,t){let r=this.e.r.resolveRowId,i=r?new Set([...this.h.keys()].filter(l=>!t.has(l))):null,o=new WeakSet,s=[...e],a=0;for(;s.length>0;){let l=s.pop();if(l==null)continue;if(typeof l=="object"){if(o.has(l))throw new TypeError("[MachTable] Lazy tree children contain a cyclic object graph.");o.add(l)}if(r&&i){let c=r({data:l,index:a++,api:this.e.api});if(typeof c!="string"||c.length===0)throw new TypeError("[MachTable] rowKey must resolve to a non-empty identifier for lazy tree children.");if(i.has(c))throw new Error(`Duplicate row id: ${c}`);i.add(c)}let d=Re(l,this.e.r.childrenKey);d&&s.push(...d)}}yr(e,t=!0){let r=this.e.r.resolveRowId,i=[],o=[],s=[];if(e.remove?.length){let l=new Set,d=new Set,c=h=>{if(r){let m=[this.resolveRowId(h,-1,`__missing_remove_${this.e.Ft()}`)];for(;m.length>0;){let v=m.pop();if(!l.has(v)){l.add(v);for(let w of this.Z.get(v)??[])m.push(w)}}}else{let p=[h];for(;p.length>0;){let m=p.pop();d.add(m);let v=this.N?Re(m,this.e.r.childrenKey):void 0;if(v)for(let w of v)p.push(w)}}};e.remove.forEach(c),this.all=this.all.filter(h=>{let p=l.has(h.id)||h.data!=null&&d.has(h.data);return p&&(s.push(h.id),this.h.delete(h.id),this.Z.delete(h.id)),!p});let u=new Set(this.all);this.H=this.H.filter(h=>u.has(h))}if(e.update?.length)for(let l of e.update){let d;r?d=this.h.get(this.resolveRowId(l,-1,`__missing_update_${this.e.Ft()}`)):d=this.all.find(c=>c.data===l),d&&(o.push({node:d,before:d.data,after:l}),d.data=l,s.push(d.id),this.e.a.hi(d),i.push(d))}if(e.add?.length){let l=e.addIndex!=null?Math.max(0,Math.min(e.addIndex,this.H.length)):this.H.length,d=[];e.add.forEach((c,u)=>{let h=this.resolveRowId(c,l+u,`add-${this.e.Ft()}`);if(this.h.has(h)){this.e.reportError(new Error(`Duplicate row id: ${h}`),"transaction.add",{rowId:h});return}let p={id:h,data:c,rowIndex:-1,selected:!1};this.h.set(h,p),this.ni.set(p,0);let m=this.N?Re(c,this.e.r.childrenKey):void 0;if(m)for(let v of m)v!=null&&this.Nn(p,v,1);d.push(p)}),this.H=this.H.slice(0,l).concat(d,this.H.slice(l)),this.qs()}let a={pipelineChanged:this.Id(e,o),updatedRowIds:i.map(l=>l.id)};return this.Ad(a,t),this.e.V.Ld(s),a}Ad(e,t){e.pipelineChanged&&(this.We=null),t&&(e.pipelineChanged?this.b():e.updatedRowIds.length&&this.js())}kd(e){if(e.length===0)return{pipelineChanged:!1,updatedRowIds:[]};let t=!1,r=new Set;for(let i of e){let o=this.yr(i,!1);t||(t=o.pipelineChanged);for(let s of o.updatedRowIds)r.add(s)}return t?this.b():r.size>0&&this.js(),{pipelineChanged:t,updatedRowIds:[...r]}}Id(e,t){if(e.add?.length||e.remove?.length)return!0;if(!t.length)return!1;let r=this.Ys();if(r===null)return!0;if(!r.length)return!1;let i=this.We;return!i||r.length!==i.fields.length||r.some((o,s)=>o!==i.fields[s])?!0:t.some(({node:o,before:s,after:a})=>Ii(s,a,r,i.values.get(o)))}Ys(){if(this.N||this.e.r.masterDetail||this.e.r.getRowHeight||this.Xs())return null;let e=this.e.n.c();if(e.some(r=>r.colDef.autoHeight===!0||r.colDef.autoRowSpan===!0||r.colDef.rowSpan!=null))return null;let t=!this.e.r.manualFiltering;return Ri({columns:e,customAggregates:this.e.r.aggFuncs,sortModel:this.e.r.manualSorting?[]:this.e.n.U(),filterModel:t?this.filterModel:{},advancedFilter:t?this.advancedFilterModel:null,quickFilter:t?this.quickFilter:null})}Pd(){let e=this.Ys();this.We=e?.length?{fields:e,values:Mi(this.all,e)}:null}js(){this.e.emit("modelUpdated",{rowCount:this.te.length})}Nn(e,t,r){let i=this.resolveRowId(t,-1,`add-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"transaction.add",{rowId:i});return}let o=Re(t,this.e.r.childrenKey),s={id:i,data:t,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(o)};this.h.set(i,s),this.ni.set(s,r);let a=this.Z.get(e.id)??[];if(a.push(s.id),this.Z.set(e.id,a),!!o)for(let l of o)l!=null&&this.Nn(s,l,r+1)}qs(){this.all=[];let e=t=>{this.all.push(t),this.h.has(t.id)||this.h.set(t.id,t);for(let r of this.Z.get(t.id)??[]){let i=this.h.get(r);i&&e(i)}};for(let t of this.H)e(t)}vr(e){let t=JSON.stringify(this.filterModel),r=new Set(this.e.n.X().map(o=>o.id));this.filterModel=Y(e,r);let i=JSON.stringify(this.filterModel)!==t;return i&&(this.We=null),i}j(){return{...this.filterModel}}Ot(e){let t=new Set(this.e.n.X().map(s=>s.id)),r=B(e,t),i=JSON.stringify(this.advancedFilterModel);this.advancedFilterModel=r,this.e.r.advancedFilterModel=r;let o=JSON.stringify(r)!==i;return o&&(this.We=null),o}be(){return B(this.advancedFilterModel)}Ht(e){let t=e!=null&&e.trim()!==""?e:null;return t===this.quickFilter?!1:(this.quickFilter=t,this.We=null,!0)}br(){return this.quickFilter}Fn(){return Object.keys(this.filterModel).length>0||this.advancedFilterModel!=null||this.quickFilter!=null}b(){this.We=null;let e=this.e.re.start(),t=this.e.n.c(),r=(a,l)=>this.e.d(a,l);if(this.p){this.Gd(e);return}if(this.Nd(e))return;let i,o=[];if(this.N)i=this.Fd(t,r);else{i=this.all,this.Fn()&&!this.e.r.manualFiltering&&(i=i.filter(ur(t,this.filterModel,this.advancedFilterModel,this.quickFilter,r)));let l=this.e.n.U();if(l.length>0&&!this.e.r.manualSorting)try{i=hr(i,l,t,r)}catch(c){this.e.reportError(c,"comparator",{sortModel:l})}let d=this.e.n.ze();if(d.length>0){let c=this.Od(i,d);i=c.rows,o=c.ambiguousExpansions}else if(this.e.r.masterDetail){let c=[];for(let u of i)c.push(u),this.k.has(u.id)&&this.isRowExpandable(u)&&c.push({id:`__detail__${u.id}`,data:u.data,rowIndex:-1,selected:!1,isDetail:!0,masterId:u.id});i=c}}for(let a of this.all)a.rowIndex=-1;let s=0;i.forEach((a,l)=>{a.rowIndex=l,!a.isDetail&&!a.isGroup&&(s++,this.ur.set(a,s))}),this.te=i,this.Vt(),this.Pd(),this.Js(r),this.e.emit("modelUpdated",{rowCount:i.length}),this.e.re.On(e),this.Hd(o)}Gd(e){this.all.forEach((t,r)=>{this.ue||(t.rowIndex=r),this.ur.set(t,this.ue?t.rowIndex+1:r+1)}),this.displayed=this.all,this.te=this.all,this.cr.clear(),this.pr++,this.e.emit("modelUpdated",{rowCount:this.all.length}),this.e.re.On(e)}Nd(e){let t=this.xn;return this.xn=!1,!t&&this.Xs()?(this.Vd(e),!0):(this.In(),!1)}Xs(){if(!this.e.r.dataProcessor||this.all.length<this.e.r.dataProcessorMinRows||this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return!1;let e=!this.e.r.manualFiltering&&this.Fn(),t=!this.e.r.manualSorting&&this.e.n.U().length>0;return e||t}Vd(e){this.In();let t=this.e.r.dataProcessor;if(!t)return;let r=++this.fr,i=new AbortController;this.ai=i;let o=this.e.n.c(),s=this.all.flatMap(d=>d.data==null?[]:[{id:d.id,data:d.data}]),a=!this.e.r.manualFiltering,l=!this.e.r.manualSorting;Promise.resolve().then(()=>t.process({rows:s,columns:o.map(d=>({colId:d.id,...d.colDef.field?{field:d.colDef.field}:{}})),sortModel:l?this.e.n.U():[],filterModel:a?this.j():{},advancedFilterModel:a?this.be():null,quickFilterText:a?this.quickFilter:null,signal:i.signal})).then(d=>{if(r!==this.fr||i.signal.aborted||this.e.s())return;let c=new Set,u=[];for(let p of d.rowIds){if(c.has(p))continue;c.add(p);let m=this.h.get(p);m&&!m.isDetail&&!m.isGroup&&u.push(m)}for(let p of this.all)p.rowIndex=-1;u.forEach((p,m)=>{p.rowIndex=m,this.ur.set(p,m+1)}),this.te=u,this.Vt();let h=(p,m)=>this.e.d(p,m);this.Js(h),this.e.emit("modelUpdated",{rowCount:u.length}),this.e.re.On(e),this.e.u({data:!0})}).catch(d=>{r!==this.fr||i.signal.aborted||this.e.s()||(this.e.reportError(d,"dataProcessor.process"),this.xn=!0,this.b(),this.e.u({data:!0}))}).finally(()=>{r===this.fr&&(this.ai=null)})}In(){this.fr++,this.ai?.abort(),this.ai=null}get we(){return this.e.r.paginationEnabled&&!this.p}Vt(){if(!this.we){this.displayed=this.te,this.pr++;return}let e=this.wr(),t=this.getPageCount();if(this.page>t&&(this.page=t),this.page<1&&(this.page=1),this.e.r.paginationPage=this.page,this.e.r.paginationMode==="server"){this.te.forEach((o,s)=>{o.rowIndex=s}),this.displayed=this.te,this.pr++;return}let r=(this.page-1)*e,i=this.te.slice(r,r+e);i.forEach((o,s)=>{o.rowIndex=s}),this.displayed=i,this.pr++}wr(){return this.pageSize=this.e.r.paginationPageSize,Math.max(1,this.pageSize)}Cr(){return this.we?this.page:1}getTotalRowCount(){return this.p?this.Gt():this.we&&this.e.r.paginationMode==="server"?this.e.r.paginationTotal:this.te.length}getPageCount(){return this.we?Math.max(1,Math.ceil(this.getTotalRowCount()/this.wr())):1}Zs(){return this.te}setPage(e,t=!1){if(!this.we)return;let r=this.getPageCount(),i=Math.max(1,Math.min(Math.round(e)||1,r));i!==this.page&&(this.page=i,this.e.r.paginationPage=i,this.Vt(),this.e.u({data:!0}),this.e.a.Bt(0,"top"),t||this.pi())}setPageSize(e){if(!this.we)return;let t=Math.max(1,Math.round(e)||this.wr()),r=(this.page-1)*this.wr();this.e.r.paginationPageSize=t,this.pageSize=t,this.page=Math.floor(r/t)+1,this.e.r.paginationPage=this.page,this.Vt(),this.e.u({data:!0}),this.pi()}Qs(e,t){this.pageSize=Math.max(1,Math.round(t)||1),this.e.r.paginationPageSize=this.pageSize,this.page=Math.max(1,Math.round(e)||1),this.e.r.paginationPage=this.page}fi(e){this.e.r.paginationEnabled!==e&&(this.e.r.paginationEnabled=e&&!this.p,this.e.r.paginationEnabled&&(this.page=1),this.Vt(),this.e.u({data:!0}),this.pi())}Bd(){this.we&&(this.page=this.e.r.paginationMode==="server"?this.e.r.paginationPage:1,this.Vt(),this.e.u({data:!0}),this.pi())}pi(){this.e.emit("paginationChanged",{page:this.Cr(),pageSize:this.wr(),pageCount:this.getPageCount(),total:this.getTotalRowCount()})}Fd(e,t){let r=this.e.r.manualSorting?[]:this.e.n.U(),i=new Map,o=this.Fn()&&!this.e.r.manualFiltering,s=ur(e,this.filterModel,this.advancedFilterModel,this.quickFilter,t),a=c=>{let u=i.get(c.id);if(u!==void 0)return u;let h=!0;if(o){h=s(c);for(let p of this.Z.get(c.id)??[]){let m=this.h.get(p);m&&a(m)&&(h=!0)}}return i.set(c.id,h),h},l=[],d=c=>{let u=c;r.length>0&&(u=hr(c,r,e,t));for(let h of u)if(a(h)&&(l.push(h),this.k.has(h.id))){let p=(this.Z.get(h.id)??[]).map(m=>this.h.get(m)).filter(m=>m!=null);d(p)}};return d(this.H),l}zd(){let e=this.Gs,t=0;for(let r of this.displayed)!r.isDetail&&!r.isGroup&&(e[t++]=r);return e.length=t,e}_d(e,t,r,i){let o=t.colDef.rowSpan;if(!o)return 1;try{let s=o({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:r,rowIndex:e.rowIndex});return Math.max(1,Math.min(Math.round(s)||1,i))}catch(s){return this.e.reportError(s,"rowSpan",{colId:t.id,rowId:e.id}),1}}Kd(e,t,r,i,o){if(!r.colDef.autoRowSpan||i==null||i==="")return 1;let s=1;for(;t+s<e.length&&je(i,o(e[t+s],r))===0;)s++;return s}Wd(e,t,r){let i=new Int32Array(e.length),o=0;for(;o<e.length;){let s=e[o],a=r(s,t),l=t.colDef.rowSpan?this._d(s,t,a,e.length-o):this.Kd(e,o,t,a,r);i[o]=l;for(let d=1;d<l;d++)i[o+d]=-1;o+=l}return i}Js(e){if(this.cr.clear(),this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return;let t=this.e.n.c().filter(i=>i.colDef.rowSpan!=null||i.colDef.autoRowSpan===!0);if(t.length===0)return;let r=this.zd();if(r.length!==0)for(let i of t)this.cr.set(i.id,this.Wd(r,i,e))}$d(e){return this.cr.get(e)}ea(e){return this.ur.get(e)??0}Gn(e){return this.ni.get(e)??0}Od(e,t){let r=Xe(this.e.r.aggFuncs),i=this.e.n.hd();this.kt=[];let o=l=>{let d={};for(let c of i){let u=r(c.colDef.aggFunc);if(u)try{d[c.id]=Ci(l,u,h=>this.e.d(h,c))}catch(h){this.e.reportError(h,"aggFunc",{colId:c.id,aggFunc:c.colDef.aggFunc}),d[c.id]=null}}return d},s=xi(this.K,this.all,t,(l,d)=>this.e.d(l,d));this.K=s.expanded;let a=Ei(e,t,(l,d)=>this.e.d(l,d),o,this.K);return this.kt=a.ids,{rows:a.rows,ambiguousExpansions:s.ambiguous}}Hd(e){for(let t of e){if(this.e.s())return;this.e.reportError(new Error(`Ambiguous legacy group expansion: ${t}`),"gridState.groupExpansion",{groupId:t})}}isRowExpandable(e){if(this.N){if(this.Pn(e.id)||e.treeLoading)return!0;if(e.treeChildrenLoaded||!e.data||!this.e.r.loadTreeChildren)return!1;let r=this.e.r.isTreeRowExpandable;if(!r)return!1;try{return r({data:e.data,node:e,api:this.e.api})}catch(i){return this.e.reportError(i,"isTreeRowExpandable",{rowId:e.id}),!1}}if(!this.e.r.masterDetail)return!1;let t=this.e.r.isRowExpandable;if(t)try{return t({data:e.data,node:e,api:this.e.api})}catch(r){return this.e.reportError(r,"isRowExpandable",{rowId:e.id}),!1}return!0}isRowExpanded(e){return this.k.has(e)}Ud(){return[...this.k]}qd(){return[...this.K]}jd(e,t){this.k=new Set(e.filter(r=>this.h.has(r))),this.K=new Set(t)}Hn(e){return this.Vn(e,!0)}Bn(e){return this.Vn(e,!1)}mi(e){return this.Vn(e,!this.k.has(e))}Vn(e,t){let r=this.h.get(e);return!r||t&&!this.isRowExpandable(r)?!1:(t===this.k.has(e)||(t?this.k.add(e):this.k.delete(e),this.b(),this.e.u({data:!0}),this.e.emit("detailToggled",{rowId:e,rowNode:r,expanded:t}),t&&this.N&&!this.Pn(e)&&!r.treeLoading&&this.loadTreeChildren(e).catch(()=>{})),t)}zn(){let e=!1;for(let t of this.all)!this.k.has(t.id)&&this.isRowExpandable(t)&&(this.k.add(t.id),e=!0);e&&(this.b(),this.e.u({data:!0}))}_n(){this.k.size!==0&&(this.k.clear(),this.b(),this.e.u({data:!0}))}Kn(e){return this.setGroupExpanded(e,!this.K.has(e))}isGroupExpanded(e){return this.K.has(e)}Wn(){if(this.kt.length===0)return;let e=!1;for(let t of this.kt)this.K.has(t)||(this.K.add(t),e=!0);e&&(this.b(),this.e.u({data:!0}))}$n(){this.K.size!==0&&(this.K.clear(),this.b(),this.e.u({data:!0}))}setGroupExpanded(e,t){return!this.kt.includes(e)||t===this.K.has(e)||(t?this.K.add(e):this.K.delete(e),this.b(),this.e.u({data:!0})),t}ta(){return!this.N&&!this.p&&!this.e.r.dataProcessor&&this.e.r.paginationMode!=="server"&&this.e.n.U().length===0&&this.e.n.ze().length===0}ra(e,t){if(!this.ta()||!Number.isInteger(e)||!Number.isInteger(t))return!1;let r=this.f(e),i=this.f(t);if(!r||!i||r.isDetail||i.isDetail||r.isGroup||i.isGroup)return!1;let o=this.all.indexOf(r),s=this.all.indexOf(i);return o<0||s<0||o===s?!1:(this.all.splice(o,1),this.all.splice(s,0,r),this.b(),this.e.u({data:!0}),!0)}pe(){return this.all}Yd(){return this.H}je(){return this.displayed}I(){return this.ue?this.Nt():this.displayed.length}f(e){return this.ue?e<0||e>=this.Nt()?void 0:this.$e.get(e)??this.Dd(e):this.displayed[e]}z(e){return this.h.get(e)}Un(e){this.all.forEach(e)}qn(e){let t=0;for(let r of this.te)r.isDetail||r.isGroup||e(r,t++)}};var tt=class{constructor(e){this.e=e;this.R=new Set;this.Le=null;this.Tr=new Set}Sn(e){return this.R.has(e)}Xd(e){return this.Tr.has(e)}ke(e){if(e.loading)return!1;let t=this.Jd(e),r=t?.colDef.selectable;if(!t||!r)return!0;try{return r({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:this.e.d(e,t),rowIndex:e.rowIndex})}catch(i){return this.e.reportError(i,"selectable",{rowId:e.id,colId:t?.id}),!1}}Jd(e){if(!(e.isGroup||e.isDetail))return this.e.n.c().find(t=>t.hasCheckbox&&t.colDef.selectable!=null)}Pe(){return this.e.i.pe().filter(e=>this.R.has(e.id))}gi(){return this.Pe().filter(e=>e.data!=null).map(e=>e.data)}yi(){return[...this.R]}Zd(e){let t=new Set(e),r=this.e.i.pe().filter(i=>t.has(i.id)&&!i.isDetail&&!i.isGroup).map(i=>({node:i,selected:!0}));this.fe(r,!0)}Us(e){if(!e)this.R.clear(),this.Le=null;else{let t=new Set(this.e.i.pe().map(r=>r.id));for(let r of[...this.R])t.has(r)||this.R.delete(r);this.Le!=null&&!t.has(this.Le)&&(this.Le=null)}for(let t of this.e.i.pe())t.selected=this.R.has(t.id);this.ia()}na(e){let t=e.leafNodes??[];if(t.length===0)return{all:!1,some:!1};let r=0,i=0;for(let o of t)this.ke(o)&&(r++,this.R.has(o.id)&&i++);return r===0?{all:!1,some:!1}:{all:i===r,some:i>0}}Qd(e,t){let r=(e.leafNodes??[]).filter(i=>this.ke(i));r.length!==0&&this.fe(r.map(i=>({node:i,selected:t})))}oa(e,t,r=!1){this.fe([{node:e,selected:t,clearOthers:r}])}jn(e,t=!0,r=!0){let i=this.e.i.z(e);i&&this.oa(i,t,r)}ec(e,t){let r=t==="single";this.fe([{node:e,selected:r?!0:!e.selected,clearOthers:r}]),this.Le=e.id}tc(e,t,r){return!r||!t.ctrlKey&&!t.metaKey?!1:(this.fe([{node:e,selected:!e.selected}]),this.Le=e.id,!0)}rc(e,t,r){if(!r||!t.shiftKey||this.Le==null)return!1;let i=this.e.i.z(this.Le);if(!i||i.rowIndex<0||e.rowIndex<0)return!1;let o=Math.min(i.rowIndex,e.rowIndex),s=Math.max(i.rowIndex,e.rowIndex),a=[];for(let l=o;l<=s;l++){let d=this.e.i.f(l);d&&!d.isDetail&&!d.isGroup&&this.ke(d)&&a.push({node:d,selected:!0})}return this.fe(a),!0}sa(e,t,r){let i=this.e.r.rowSelection;if(i==="none"||!this.ke(e))return;if(r){this.ec(e,i);return}let o=i==="multiple";this.tc(e,t,o)||this.rc(e,t,o)||(this.fe([{node:e,selected:!0,clearOthers:!0}]),this.Le=e.id)}selectAll(e=!0){let t=this.e.r.rowSelection;if(t==="none")return;let i=(e?this.e.i.je():this.e.i.pe()).filter(o=>!o.isDetail&&!o.isGroup&&this.ke(o));if(i.length!==0){if(t==="single"){this.fe([{node:i[0],selected:!0,clearOthers:!0}]);return}this.fe(i.map(o=>({node:o,selected:!0})))}}deselectAll(){this.fe([],!0)}ic(){let t=this.e.i.je().filter(r=>!r.isDetail&&!r.isGroup).filter(r=>this.ke(r));if(t.length===0)return!1;if(this.e.i.p){let r=this.e.i.Gt();if(t.length<r)return!1}return t.every(r=>this.R.has(r.id))}nc(){let t=this.e.i.je().filter(i=>!i.isDetail&&!i.isGroup).filter(i=>this.ke(i)),r=t.reduce((i,o)=>i+(this.R.has(o.id)?1:0),0);if(r===0)return!1;if(this.e.i.p){let i=this.e.i.Gt();if(t.length<i)return!0}return r>0&&r<t.length}oc(e,t=!1){this.fe(e,t)}sc(e,t,r){!t&&!e.some(i=>i.clearOthers)||(this.R=t?new Set:new Set(e.filter(i=>i.selected).flatMap(i=>r?this.aa(i.node):[i.node.id])))}ac(e,t){for(let r of e){if(!this.ke(r.node))continue;let i=t?this.aa(r.node):[r.node.id];for(let o of i)r.selected?this.R.add(o):this.R.delete(o)}}lc(e){let t=new Set;for(let r of new Set([...e,...this.R]))e.has(r)!==this.R.has(r)&&t.add(r);return t}dc(e,t,r){let i=[],o=new Set([...e,...r,...this.Tr]);for(let s of this.e.i.pe()){let a=this.R.has(s.id);s.selected=a,(o.has(s.id)||t.get(s.id)!==a)&&s.rowIndex>=0&&i.push(s.rowIndex)}return i}fe(e,t=!1){let r=new Set(this.R),i=this.e.i.N&&this.e.r.autoCheckedChildren;this.sc(e,t,i),this.ac(e,i);let o=this.lc(r),s=new Map;for(let d of this.e.i.pe())s.set(d.id,d.selected);let a=new Set(this.Tr);this.ia();let l=this.dc(o,s,a);o.size>0&&(this.e.a.Ye(l),this.e.B.ui(),this.e.emit("selectionChanged",{selectedNodes:this.Pe(),selectedRows:this.gi()}))}aa(e){let t=[e.id],r=i=>{for(let o of this.e.i.gr(i))t.push(o),r(o)};return r(e.id),t}ia(){if(this.Tr.clear(),!this.e.i.N)return;let e=t=>{let r=this.e.i.gr(t);if(r.length===0)return{all:this.R.has(t),some:this.R.has(t)};let i=!0,o=!1;for(let s of r){let a=e(s);a.all?o=!0:(a.some&&(o=!0),i=!1)}return o&&!i&&this.Tr.add(t),i?this.R.add(t):this.R.delete(t),{all:i,some:o}};for(let t of this.e.i.Yd())e(t.id);for(let t of this.e.i.pe())t.selected=this.R.has(t.id)}};var rt=class{constructor(e){this.e=e;this.active=null;this.Q=0;this.Xe=0;this.Ce=null;this.mt=null;this.Je=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),!this.Q&&(this.Q=requestAnimationFrame(()=>{this.Q=0,this.hc()})))};this.Te=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),this.pc(t))};this.yt=e=>{this.Xn(e)&&this.gt()};this.la=()=>{this.gt()}}cc(e,t){if(!this.e.r.enableColumnResize||!t.resizable||e.isPrimary===!1)return;this.gt();let r=e.currentTarget,i=t.currentWidth;this.Xe=i,this.active={column:t,didResize:!1,handle:r,pointerId:e.pointerId,startFlex:t.flex,startManualWidth:t.manualWidth,startWidth:i,startX:e.clientX},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te,!0),window.addEventListener("pointercancel",this.yt,!0),r.addEventListener("lostpointercapture",this.la);try{r.setPointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.add("mach-root--resizing"),r.classList.add("mach-header-resize--active"),this.uc(this.active)}gt(e=!0){let t=this.active;t&&(this.active=null,this.Yn(),this.da(t),e&&(t.column.manualWidth=t.startManualWidth,t.column.flex=t.startFlex,this.e.Ze()),this.e.o.root.classList.remove("mach-root--resizing"),this.ca(t))}pc(e){this.active=null,this.Yn(),e.didResize&&(Math.abs(this.Xe-e.startWidth)<.5?(e.column.manualWidth=e.startManualWidth,e.column.flex=e.startFlex):this.e.n.Ie(e.column,this.Xe),this.e.Ze()),this.da(e);try{e.handle.releasePointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.remove("mach-root--resizing"),this.ca(e),e.didResize&&this.e.zt([e.column])}hc(){let e=this.active;!e||!this.e.n.Ie(e.column,this.Xe)||(this.e.Ze(),this.Dr(e),this.e.ha(e.column,!1))}uc(e){this.Ce=document.createElement("div"),this.Ce.className="mach-column-resize-guide",this.Ce.setAttribute("aria-hidden","true"),this.mt=document.createElement("span"),this.mt.className="mach-column-resize-label",this.Ce.appendChild(this.mt),this.e.o.root.appendChild(this.Ce),this.Dr(e)}Dr(e){if(!this.Ce||!this.mt)return;let t=this.e.o.root,r=t.getBoundingClientRect(),i=e.handle.parentElement.getBoundingClientRect(),o=Math.max(0,Math.min(t.clientWidth,i.right-r.left-t.clientLeft)),s=Math.max(32,Math.min(t.clientWidth-32,o));this.Ce.style.left=`${o}px`,this.Ce.style.top=`${Math.max(0,i.top-r.top-t.clientTop)}px`,this.mt.style.left=`${s-o}px`,this.mt.textContent=`${Math.round(e.column.currentWidth)} px`}ca(e){e.handle.classList.remove("mach-header-resize--active"),this.Ce?.remove(),this.Ce=null,this.mt=null}ua(e,t){let r=Number.isFinite(t)?t:e.startX;return e.startWidth+r-e.startX}Xn(e){let t=this.active;return t&&e.pointerId===t.pointerId?t:null}Yn(){this.Q&&cancelAnimationFrame(this.Q),this.Q=0}da(e){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te,!0),window.removeEventListener("pointercancel",this.yt,!0),e.handle.removeEventListener("lostpointercapture",this.la)}destroy(){this.gt(!1),this.Yn(),this.e.o.root?.classList.remove("mach-root--resizing")}};var Ai=6,it=class{constructor(e){this.e=e;this.pending=null;this._t=null;this.Jn=!1;this.ie=0;this.vi=null;this.Je=e=>{if(this._t){this.gc(e);return}let t=this.pending;t&&(Math.abs(e.clientX-t.startX)<Ai&&Math.abs(e.clientY-t.startY)<Ai||this.yc(e))};this.Te=e=>{this.pending=null,e.type!=="pointercancel"&&this._t&&this.eo(e.clientX,e.clientY),this.Zn();let t=this.pa();t&&e.type!=="pointercancel"&&t.targetIndex>=0&&this.e.ut(t.column.id,t.targetIndex)}}fc(e,t){e.button===0&&t.movable&&(this.pending={column:t,startX:e.clientX,startY:e.clientY},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te),window.addEventListener("pointercancel",this.Te))}mc(){let e=this.Jn;return this.Jn=!1,e}yc(e){let t=this.pending;if(!t)return;let r=this.vc(t.column);if(!r||!r.parentElement){this.Zn();return}this.Jn=!0;let i=f("div","mach-drop-indicator"),o=f("div","mach-column-drag-ghost");o.textContent=t.column.colDef.headerName??t.column.colDef.field??t.column.id,o.ariaHidden="true",P(o,this.e.o.root),document.body.appendChild(o),r.parentElement.appendChild(i),r.classList.add("mach-header-cell--dragging"),this.e.o.root.classList.add("mach-root--dragging");let s=this.e.a.Qn(t.column),a=this.e.o.Kt[s],l=this.e.n.C(s),d=new Float64Array(l.length+1),c=new Float64Array(l.length);for(let h=0;h<l.length;h++){let p=l[h].currentWidth;c[h]=d[h]+p/2,d[h+1]=d[h]+p}let u=o.getBoundingClientRect();this._t={column:t.column,cellEl:r,ghost:o,indicator:i,targetIndex:-1,pane:s,containerLeft:a.getBoundingClientRect().left,startScrollLeft:this.e.o.S.center.scrollLeft,fromIndex:l.indexOf(t.column),midpoints:c,offsets:d,ghostWidth:u.width,ghostHeight:u.height},this.eo(e.clientX,e.clientY)}vc(e){let t=this.e.a.Qn(e);return this.e.o.Kt[t].querySelector(`.mach-header-cell[data-col-id="${ls(e.id)}"]`)}gc(e){this.vi={clientX:e.clientX,clientY:e.clientY},!this.ie&&(this.ie=requestAnimationFrame(()=>{this.ie=0;let t=this.vi;this.vi=null,t&&this.eo(t.clientX,t.clientY)}))}eo(e,t){let r=this._t;if(!r)return;let i=E(e+12,8,window.innerWidth-r.ghostWidth-8),o=E(t+12,8,window.innerHeight-r.ghostHeight-8);r.ghost.style.transform=`translate3d(${i}px, ${o}px, 0)`;let s=r.pane==="center"?this.e.o.S.center.scrollLeft-r.startScrollLeft:0,a=e-(r.containerLeft-s),l=r.midpoints.length;for(let d=0;d<r.midpoints.length;d++)if(a<r.midpoints[d]){l=d;break}r.targetIndex=l>r.fromIndex?l-1:l,r.indicator.style.transform=`translate3d(${r.offsets[l]}px, 0, 0)`}pa(){let e=this._t;return e?(this._t=null,e.cellEl.classList.remove("mach-header-cell--dragging"),e.ghost.remove(),e.indicator.remove(),this.e.o.root.classList.remove("mach-root--dragging"),e):null}Zn(){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te),window.removeEventListener("pointercancel",this.Te),this.ie&&cancelAnimationFrame(this.ie),this.ie=0,this.vi=null}destroy(){this.Zn(),this.pa(),this.pending=null}};function ls(n){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(n):n.replace(/[^a-zA-Z0-9_-]/g,"\\$&")}var fr=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;function nt(n,e=!0){if(n==="")return null;if(!e||typeof n!="string"||!fr.test(n)||/^[+-]?0\d/.test(n))return n;let t=Number(n);return Number.isFinite(t)&&(!Number.isInteger(t)||Number.isSafeInteger(t))?t:n}function ds(n,e){let t=n==null?"":String(n);return t.includes(e)||t.includes('"')||t.includes(`
|
|
2
2
|
`)||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}function ie(n){return typeof n!="string"||n===""||fr.test(n)?n:/^[\s\u0000-\u001f]*[=+\-@]/.test(n)?"'"+n:n}function Li(n,e={}){let t=e.columnSeparator??",",r=e.protectFormulas??!0,i=n.map(o=>o.map(s=>ds(r?ie(s):s,t)).join(t)).join(`\r
|
|
3
3
|
`);return e.prependBOM?"\uFEFF"+i:i}function mr(n){return n==null?"":String(n)}function cs(n,e){let t=e?ie(n):n,r=mr(t);return/["\t\n\r]/.test(r)?'"'+r.replace(/"/g,'""')+'"':r}function ot(n,e=!0){return n.map(t=>t.map(r=>cs(r,e)).join(" ")).join(`
|
|
4
4
|
`)}function st(n){return lt(n," ")}function at(n,e=","){return lt(n,e)}function lt(n,e){let t=[],r=[],i="",o=!1,s=0;for(;s<n.length;){let a=n[s];if(o){if(a==='"'){if(n[s+1]==='"'){i+='"',s+=2;continue}o=!1,s++;continue}i+=a,s++;continue}if(a==='"'&&i===""){o=!0,s++;continue}if(a===e){r.push(i),i="",s++;continue}if(a===`
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var He="0.34.1";function f(n,e,t){let r=document.createElement(n);if(e&&(r.className=e),t)for(let i of Object.keys(t))r.setAttribute(i,t[i]);return r}function P(n,e){if(n.classList.add("mach-portal"),!e)return;let t=window.getComputedStyle(e);for(let r=0;r<t.length;r++){let i=t.item(r);if(!i.startsWith("--mach-"))continue;let o=t.getPropertyValue(i).trim();o&&n.style.setProperty(i,o)}n.style.colorScheme=t.colorScheme}function E(n,e,t){return n<e?e:n>t?t:n}function j(n,e,t=4){let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.bottom+t,s=o+i.height>window.innerHeight-8?r.top-i.height-t:o;n.style.left=`${E(r.left,8,Math.max(8,window.innerWidth-i.width-8))}px`,n.style.top=`${E(s,8,Math.max(8,window.innerHeight-i.height-8))}px`}var zr=0;function _r(n="rg"){return zr++,`${n}-${zr}`}var Kr='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3.5h12L9.5 8v4.5L6.5 14V8L2 3.5z"/></svg>',Wr='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 3l4 5H4l4-5z"/></svg>',$r='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 13l4-5H4l4 5z"/></svg>',Ur='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round"><path d="M2 4h3m3 0h6M2 8h7m3 0h2M2 12h1m3 0h8"/><circle cx="6.5" cy="4" r="1.35"/><circle cx="10.5" cy="8" r="1.35"/><circle cx="4.5" cy="12" r="1.35"/></svg>';var Ve=class{constructor(e){this.ld=e;this.It=new Map}on(e,t){let r=this.It.get(e);return r||(r=new Set,this.It.set(e,r)),r.add(t),()=>{r.delete(t)}}once(e,t){let r=this.on(e,i=>{r(),t(i)});return r}Af(e,t){let r=this.It.get(e);r&&(r.delete(t),r.size===0&&this.It.delete(e))}emit(e,t){let r=this.It.get(e);if(r)for(let i of[...r])try{i(t)}catch(o){console.error(`[mach-table] error in "${e}" listener`,o),this.ld?.(o,e)}}clear(){this.It.clear()}};var zn=new Set(["__proto__","prototype","constructor"]),ge=new Map;function _t(n){if(typeof n!="string"||n.length===0)return null;let e=ge.get(n);if(e!==void 0)return e;let t=n.split("."),r=t.every(i=>i.length>0&&!zn.has(i))?t:null;return n.length<=1024&&(ge.size>=256&&ge.delete(ge.keys().next().value),ge.set(n,r)),r}function Kt(n){return _t(n)!==null}function K(n,e){if(n==null)return;let t=_t(e);if(!t)return;let r=n;for(let i of t){if(r==null)return;r=r[i]}return r}function ye(n,e,t){if(n==null)return!1;let r=_t(e);if(!r)return!1;let i=n;for(let o=0;o<r.length-1;o++){if(typeof i!="object"&&typeof i!="function"||i===null)return!1;i[r[o]]==null&&(i[r[o]]={}),i=i[r[o]]}return typeof i!="object"&&typeof i!="function"||i===null?!1:(i[r[r.length-1]]=t,!0)}var ae={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange","blank","notBlank"],date:["equals","notEquals","lessThan","greaterThan","inRange","blank","notBlank"]};var _n=16,Kn=512,Wn=20,$n=2e3,Un=2e3,qn={text:new Set(ae.text),number:new Set(ae.number),date:new Set(ae.date)};function jn(n){return n==null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}function Yn(n,e,t){if(n==null||typeof n!="object")return null;let r=n;return typeof r.match!="string"||!t.has(r.match)?null:{match:r.match,...Xn(r,e)}}function Xn(n,e){let t=e==="number"?qr(n.value):typeof n.value=="string"?n.value:void 0,r=e==="number"?qr(n.value2):typeof n.value2=="string"?n.value2:void 0;return{...t!==void 0?{value:t}:{},...r!==void 0?{value2:r}:{}}}function qr(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Jn(n,e){let t=[],r=qn[e];for(let i of n.slice(0,Wn)){let o=Yn(i,e,r);o&&t.push(o)}return t}function Wt(n){if(n==null||typeof n!="object")return null;let e=n;return e.type==="set"?Array.isArray(e.values)?{type:"set",values:e.values.filter(jn).slice(0,$n)}:null:e.type!=="text"&&e.type!=="number"&&e.type!=="date"||!Array.isArray(e.conditions)?null:{type:e.type,...e.operator==="or"||e.operator==="and"?{operator:e.operator}:{},conditions:Jn(e.conditions,e.type)}}function Zn(n,e){if(typeof n.colId!="string"||!n.colId.trim())return null;let t=n.colId.trim();if(e.validColumnIds?.has(t)===!1)return null;let r=Wt(n.filter);return r?{kind:"condition",colId:t,filter:r}:null}function Qn(n,e,t){if(!Array.isArray(n.children))return null;let r=[];for(let i of n.children){let o=jr(i,e+1,t);o&&r.push(o)}return r.length===0?null:{kind:"group",operator:n.operator==="or"?"or":"and",children:r,...n.not===!0?{not:!0}:{}}}function eo(n,e,t){return e<=_n&&t.nodes<Kn&&n!=null&&typeof n=="object"}function jr(n,e,t){if(!eo(n,e,t)||t.ancestors.has(n))return null;t.ancestors.add(n),t.nodes++;let r=n,i=r.kind==="condition"?Zn(r,t):r.kind==="group"?Qn(r,e,t):null;return t.ancestors.delete(n),i}function z(n,e){if(n==null||typeof n!="object")return null;let t=n;if(t.version!==1||t.root==null)return null;let r=jr(t.root,0,{ancestors:new WeakSet,nodes:0,validColumnIds:e});return r?{version:1,root:r}:null}function to(n,e){return{kind:"condition",colId:n,filter:e}}function Q(n,e){if(n==null||typeof n!="object"||Array.isArray(n))return{};let t={};for(let[r,i]of Object.entries(n).slice(0,Un)){let o=r.trim();if(!o||e?.has(o)===!1)continue;let s=Wt(i);s&&(t[o]=s)}return t}function ro(n,e,t={}){return{kind:"group",operator:n,children:e,...t.not?{not:!0}:{}}}function F(n,e,t=!1){if(!(typeof n!="number"||!Number.isFinite(n)||n<e))return t?Math.floor(n):n}function Be(n){return!n||typeof n.key!="string"||!n.key.trim()?null:{key:n.key.trim(),debounceMs:F(n.debounceMs,0,!0)??160,...n.sections?{sections:[...new Set(n.sections)]}:{},...n.store?{store:n.store}:{}}}function A(n,e,t,r=!1){let i=!1;for(let o of t)(r?Object.prototype.hasOwnProperty.call(n,o):n[o]!=null)&&(e[o]=n[o],i=!0);return i}var $t={align:"center",sortable:!0,resizable:!0,movable:!0,filter:!1,minWidth:80},ve={compact:{rowHeight:30,headerHeight:34,fontSize:12,cellPadding:6},normal:{rowHeight:36,headerHeight:40,fontSize:13,cellPadding:9},large:{rowHeight:44,headerHeight:48,fontSize:14,cellPadding:12}},be={multiSort:!0,stripedRows:!1,showCellBorders:!1,quickFilterText:null,suppressCellFocus:!1,suppressRowHoverHighlight:!1,suppressNoRowsOverlay:!1,suppressHeaderFocus:!1,loading:!1,error:null,className:"",singleClickEdit:!1,manualSorting:!1,manualFiltering:!1,showSummary:!1,indexOffset:0,applyRowDrag:!0,masterDetail:!1,detailToggleColumn:!0,treeData:!1,childrenKey:"children",autoCheckedChildren:!0,defaultExpandAll:!1,columnMenu:!1,suppressWarnings:!1,enableRangeSelection:!1,suppressClipboard:!1,contextMenu:!1,flashCells:!0,fillHandle:!0,ariaLabel:"MachTable data grid",ariaLabelledBy:"",ariaDescribedBy:"",overlayNoRowsTemplate:"",overlayLoadingTemplate:"",overlayErrorTemplate:"",allowUnsafeOverlayHtml:!1},io=Object.keys(be);function no(n){let e={};for(let t of io)e[t]=n[t]??be[t];return e}function I(n,e,t,r=!1){return F(n,t,r)??e}function oo(n){return n&&Object.prototype.hasOwnProperty.call(ve,n)?n:"normal"}function so(n){return n.theme==="light"||n.theme==="dark"||n.theme==="auto"?n.theme:"light"}function ao(n,e){let t=typeof n.pagination=="object"&&Array.isArray(n.pagination.pageSizeOptions)?n.pagination.pageSizeOptions:void 0,r=t?[...new Set(t.map(i=>I(i,0,1,!0)).filter(Boolean))]:[10,20,50,100];return r.includes(e)||r.push(e),r.sort((i,o)=>i-o)}function Ut(n,e){let t=typeof n=="function"?n(e):K(e,n);return t==null?"":String(t)}function lo(n){let e=n.rowKey,t=e?({data:r})=>Ut(e,r):void 0;return{...t?{resolveRowId:t}:{},...e?{rowKey:e}:{}}}function co(n,e){let t=ve[e];return{columnDefs:Array.isArray(n.columnDefs)?n.columnDefs:[],rowData:Array.isArray(n.rowData)?n.rowData:[],defaultColDef:{...$t,...n.defaultColDef??{}},columnTypes:n.columnTypes??{},...lo(n),rowHeight:I(n.rowHeight,t.rowHeight,1),headerHeight:I(n.headerHeight,t.headerHeight,1),rowBuffer:I(n.rowBuffer,8,0,!0),columnLayout:n.columnLayout==="fit"?"fit":"normal",enableColumnResize:n.enableColumnResize===!0,domLayout:n.domLayout==="autoHeight"?"autoHeight":"normal",rowSelection:n.rowSelection==="single"||n.rowSelection==="multiple"?n.rowSelection:"none",size:e,pinnedTopRowData:Array.isArray(n.pinnedTopRowData)?n.pinnedTopRowData:[],pinnedBottomRowData:Array.isArray(n.pinnedBottomRowData)?n.pinnedBottomRowData:[]}}function uo(n){return{rowStyleRules:Array.isArray(n.rowStyleRules)?n.rowStyleRules:[],theme:so(n)}}function ho(n){return{editType:n.editType==="fullRow"?"fullRow":"cell",editableIndicator:n.editableIndicator==="always"||n.editableIndicator==="none"?n.editableIndicator:"hover",rowDragPolicy:n.rowDragPolicy,undoStackSize:I(n.undoStackSize,100,0,!0),asyncTransactionWaitMillis:I(n.asyncTransactionWaitMillis,16,0,!0)}}function po(n){return{detailRowHeight:I(n.detailRowHeight,240,1)}}function fo(n){let e=typeof n.pagination=="object"?n.pagination:void 0,t=I(e?.pageSize,20,1,!0);return{paginationEnabled:n.pagination!==!1&&n.datasource==null,paginationMode:e?.mode==="server"?"server":"client",paginationPage:I(e?.page,1,1,!0),paginationTotal:I(e?.total,0,0,!0),paginationPageSize:t,paginationPageSizeOptions:ao(n,t),paginationShowTotal:e?e.showTotal!==!1:!0,paginationShowSizeSelector:e?e.showPageSizeSelector!==!1:!0}}function qt(n){return{watermarkEnabled:n.watermark!=null&&n.watermark!==!1,watermarkConfig:n.watermark==null||n.watermark===!1?null:n.watermark===!0?{text:"MachTable"}:n.watermark}}function mo(n){return{advancedFilterModel:z(n.advancedFilterModel),persistence:Be(n.persistence),locale:n.locale??{},tooltipShowDelay:I(n.tooltipShowDelay,600,0),statusBarEnabled:n.statusBar===!0||typeof n.statusBar=="object"&&n.statusBar!=null,statusBarPanels:typeof n.statusBar=="object"&&n.statusBar?.panels?n.statusBar.panels:["rowCount","selectedRowCount","rangeAggregate"]}}function go(n){return{datasourceMode:n.datasourceMode==="block"?"block":"sequential",blockSize:I(n.blockSize,100,1,!0),infiniteBufferRows:I(n.infiniteBufferRows,40,0,!0),maxBlocksInCache:I(n.maxBlocksInCache,12,1,!0),datasourceMaxConcurrentRequests:I(n.datasourceMaxConcurrentRequests,4,1,!0),blockPrefetch:I(n.blockPrefetch,1,0,!0),datasourceRowCount:n.datasourceRowCount==null?null:I(n.datasourceRowCount,0,0,!0),dataProcessorMinRows:I(n.dataProcessorMinRows,5e3,1,!0),datasourceRetryCount:I(n.datasourceRetryCount,2,0,!0),datasourceRetryDelay:I(n.datasourceRetryDelay,300,0,!0),datasourceRetryJitter:Math.min(1,I(n.datasourceRetryJitter,.15,0))}}var yo=["detailRowRenderer","isRowExpandable","aggFuncs","components","actionPolicy","summaryMethod","datasource","getRowHeight","tooltipComponent","getContextMenuItems","initialState","rowEditValidator","isTreeRowExpandable","loadTreeChildren","dataProcessor"];function vo(n,e){for(let t of yo)n[t]&&Reflect.set(e,t,n[t])}function bo(n,e){for(let t of Object.keys(n))t.startsWith("on")&&typeof n[t]=="function"&&Reflect.set(e,t,n[t])}function Yr(n){let e=oo(n.size),t={...no(n),...co(n,e),...uo(n),...ho(n),...po(n),...fo(n),...qt(n),...mo(n),...go(n),features:Array.isArray(n.features)?n.features:[]};return vo(n,t),bo(n,t),t}function Xr(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.length>0):typeof n=="string"&&n.length>0?[n]:[]}function le(n,e){return Xr(n.type).includes(e)}function Jr(n,e,t={}){let r={};for(let i of Xr(n.type)){let o=t[i];o&&Object.assign(r,o)}return{...e,...r,...n}}var $=class{constructor(e,t){this.manualWidth=null;this.contentWidth=null;this.flex=null;this.currentWidth=0;this.parentGroup=null;this.level=0;this.isDetailToggle=!1;this.id=e,this.colDef=t,this.hide=t.hide??!1;let r=t.pinned;this.pinned=r===!0?"left":r===!1||r==null?null:r,this.resetWidth()}get sortable(){return this.colDef.sortable!==!1}get resizable(){return this.colDef.resizable!==!1}get movable(){return this.colDef.movable!==!1}get filterable(){return this.colDef.filter!=null&&this.colDef.filter!==!1}get filterType(){let e=this.colDef.filter;return e===!0?"text":e??"text"}get hasCheckbox(){return this.colDef.checkboxSelection===!0}resetWidth(){this.manualWidth=null,this.contentWidth=null,this.flex=typeof this.colDef.flex=="number"&&Number.isFinite(this.colDef.flex)&&this.colDef.flex>0?this.colDef.flex:null}};var ee=class n{constructor(e,t){this.parent=null;this.children=[];this.groupId=e,this.def=t}get headerName(){return this.def.headerName??this.def.groupId??""}getLeafColumns(e=[]){for(let t of this.children)t instanceof n?t.getLeafColumns(e):e.push(t);return e}};function we(n){return Array.isArray(n.children)}function ze(n,e){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:e}function Zr(n){let e=ze(n.minWidth,80);return{min:e,max:Math.max(e,ze(n.maxWidth,Number.MAX_SAFE_INTEGER))}}function V(n,e){let{min:t,max:r}=Zr(e),i=ze(n,ze(e.width,150));return Math.max(t,Math.min(r,i))}function Qr(n,e){let t=n.map(s=>V(s.width??150,s)),r=[],i=0;n.forEach((s,a)=>{let l=s.flex??0;l>0&&(r.push(a),i+=l)});let o=0;for(let s of t)o+=s;if(i>0&&e>o){let s=e-o;for(let a=0;a<4&&s>.5&&r.length>0;a++){let l=[],d=0;for(let p of r){let m=n[p].flex??0;l.push(p),d+=m}let c=[];for(let p=0;p<l.length;p++){let m=l[p],v=n[m].flex??0,w=s*v/d,C=t[m];t[m]=V(C+w,n[m]),c.push(t[m]-C)}let u=0;for(let p of c)u+=p;s-=u;let h=l.filter((p,m)=>c[m]>.001);if(h.length===l.length)break;r.length=0;for(let p of h)r.push(p)}}return t}function wo(n,e,t){let r=new Set(n.map((o,s)=>s)),i=t;for(let o=0;o<n.length+1&&r.size>0;o++){let s=0;for(let l of r)s+=Math.max(1,e[l]);if(s<=0)break;let a=!1;for(let l of[...r]){let d=i*(Math.max(1,e[l])/s),c=V(d,n[l]),{min:u,max:h}=Zr(n[l]);(d<u||d>h)&&(e[l]=c,i-=c,r.delete(l),a=!0)}if(!a){for(let l of r)e[l]=V(i*(Math.max(1,e[l])/s),n[l]);break}i=Math.max(0,i)}}function Co(n,e,t){let r=t-e.reduce((i,o)=>i+o,0);if(!(Math.abs(r)<=.01))for(let i=e.length-1;i>=0;i--){let o=V(e[i]+r,n[i]);if(Math.abs(o-e[i])>.01){e[i]=o;return}}}function _e(n,e){let t=n.map(r=>V(r.width??150,r));return!Number.isFinite(e)||e<=0||n.length===0||(wo(n,t,e),Co(n,t,e)),t}var jt="__rg_detail_toggle__";function de(n){return typeof n=="number"&&Number.isFinite(n)&&n>0}var Ke=class{constructor(e){this.e=e;this.columns=[];this.Ss=new Map;this.ye=[];this.left=[];this.center=[];this.right=[];this.sortModel=[];this.defs=[];this.At=1;this.vn=new Map;this.dd=0}ar(e){this.defs=e?[...e]:[];let t=new Map(this.columns.map(s=>[s.id,s])),r=this.e.r.defaultColDef,i=new Set(this.e.r.masterDetail&&this.e.r.detailToggleColumn?[jt]:[]),o=(s,a,l)=>s.map((d,c)=>{if(we(d)){let C=d.groupId??d.headerName??`group_${c}_${l}`,R=new ee(C,d);return R.parent=a,R.children=o(d.children,R,l+1),R}let u=d,h=u.colId??u.field??`col_${c}`,p=h,m=2;for(;i.has(p);)p=`${h}_${m++}`;i.add(p);let v=new $(p,Jr(u,r,this.e.r.columnTypes));v.parentGroup=a,v.level=l;let w=t.get(p);return w&&(v.manualWidth=w.manualWidth,v.contentWidth=w.contentWidth,v.flex=w.flex,v.hide=w.hide,v.pinned=w.pinned),v});if(this.ye=o(this.defs,null,0),this.e.r.masterDetail&&this.e.r.detailToggleColumn){let s=new $(jt,{colId:jt,headerName:"",width:38,pinned:"left",sortable:!1,resizable:!1,movable:!1,filter:!1});s.isDetailToggle=!0,this.ye.unshift(s)}if(this.columns=this.Yr(this.ye),this.Ss=new Map(this.columns.map(s=>[s.id,s])),this.At=this.columns.reduce((s,a)=>Math.max(s,a.level+1),1),this.sortModel=this.sortModel.filter(s=>this.columns.some(a=>a.id===s.colId)),this.sortModel.length===0){let s=[];for(let a of this.columns)a.colDef.initialSort&&s.push({colId:a.id,direction:a.colDef.initialSort});this.sortModel=s}this.Lt()}Yr(e,t=[]){for(let r of e)r instanceof ee?this.Yr(r.children,t):t.push(r);return t}Lt(){let e=this.columns.filter(t=>!t.hide);this.left=e.filter(t=>t.pinned==="left"),this.right=e.filter(t=>t.pinned==="right"),this.center=e.filter(t=>t.pinned===null),this.vn.clear(),this.c().forEach((t,r)=>this.vn.set(t.id,r))}Me(e){return this.vn.get(e)??-1}X(){return this.columns}Xr(){return this.defs}cd(){return this.ye}ud(){return this.At}L(e){return this.Ss.get(e)}C(e){return e==="left"?this.left:e==="right"?this.right:this.center}c(){return[...this.left,...this.center,...this.right]}ze(){return this.c().filter(e=>e.colDef.rowGroup===!0)}hd(){return this.c().filter(e=>e.colDef.aggFunc!=null&&e.colDef.rowGroup!==!0)}bn(){return this.center.some(e=>e.colDef.colSpan!=null)}Ms(){let e=this.c();return this.center.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e[0]}lr(e){return e.pinned==="left"?"left":e.pinned==="right"?"right":"center"}Is(e){this.dd=e;let t=0;for(let c of[...this.left,...this.right])c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),t+=c.currentWidth;let r=Math.max(0,e-t),i=[],o=[];for(let c of this.center)(c.colDef.suppressSizeToFit||c.manualWidth!=null?o:i).push(c);let s=0;for(let c of o)c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),s+=c.currentWidth;let a=i.map(c=>this.ct(c)),l=Math.max(0,r-s),d=this.e.r.columnLayout==="fit"?_e(a,l):Qr(a,l);i.forEach((c,u)=>{c.currentWidth=d[u]})}ct(e){let t=e.colDef;return{width:e.manualWidth??e.contentWidth??t.width,minWidth:t.minWidth,maxWidth:t.maxWidth,flex:e.manualWidth==null?e.flex??void 0:void 0}}Ie(e,t){return de(t)?(e.manualWidth=V(t,this.ct(e)),e.flex=null,!0):!1}As(e,t){return de(t)?(e.resetWidth(),e.contentWidth=V(t,this.ct(e)),!0):!1}wn(e,t){let r=this.L(e);!r||r.hide===!t||(r.hide=!t,this.Lt())}ut(e,t){let r=this.L(e);if(!r)return!1;let i=this.lr(r),o=u=>r.parentGroup?!0:this.lr(u)===i,s=r.parentGroup?r.parentGroup.children:this.ye,a=s.filter(u=>u instanceof $&&!u.hide&&o(u)),l=a.indexOf(r);if(l<0)return!1;a.splice(l,1);let d=Math.max(0,Math.min(t,a.length));a.splice(d,0,r);let c=[];return s.forEach((u,h)=>{u instanceof $&&!u.hide&&o(u)&&c.push(h)}),c.length!==a.length?!1:(c.forEach((u,h)=>{s[u]=a[h]}),this.columns=this.Yr(this.ye),this.Lt(),!0)}Cn(e,t){let r=this.L(e);!r||!r.movable||(r.pinned=t,this.Lt())}Jr(){return this.columns.map(e=>({colId:e.id,hide:e.hide,width:e.manualWidth??e.currentWidth,flex:e.flex,widthMode:e.manualWidth==null?"auto":"manual",contentWidth:e.contentWidth??void 0,pinned:e.pinned}))}Ls(e){let t=new Map(e.map(r=>[r.colId,r]));for(let r of this.columns){let i=t.get(r.id);i&&this.pd(r,i)}this.fd(e),this.Lt()}pd(e,t){typeof t.hide=="boolean"&&(e.hide=t.hide),t.widthMode==="auto"?(e.resetWidth(),de(t.flex)&&(e.flex=t.flex)):de(t.flex)?(e.flex=t.flex,e.manualWidth=null):de(t.width)&&(e.manualWidth=V(t.width,this.ct(e)),e.flex=null),de(t.contentWidth)&&(e.contentWidth=V(t.contentWidth,this.ct(e))),e.movable&&(t.pinned==="left"||t.pinned==="right"||t.pinned===null)&&(e.pinned=t.pinned)}fd(e){let t=new Map;e.forEach((i,o)=>t.set(i.colId,o));let r=i=>i.pinned==="left"?"left":i.pinned==="right"?"right":"center";for(let i of["left","center","right"]){let o=this.ye.filter(d=>d instanceof $&&!d.hide&&d.parentGroup===null&&r(d)===i);if(o.length<2)continue;let s=o.filter(d=>d.movable),a=s.slice().sort((d,c)=>(t.get(d.id)??Number.MAX_SAFE_INTEGER)-(t.get(c.id)??Number.MAX_SAFE_INTEGER));if(a.every((d,c)=>d===s[c]))continue;let l=[];this.ye.forEach((d,c)=>{d instanceof $&&!d.hide&&d.parentGroup===null&&r(d)===i&&d.movable&&l.push(c)}),l.forEach((d,c)=>{this.ye[d]=a[c]})}this.columns=this.Yr(this.ye)}Tn(){for(let e of this.columns){e.resetWidth(),e.hide=e.colDef.hide??!1;let t=e.colDef.pinned;e.pinned=t===!0?"left":t===!1||t==null?null:t}this.Lt()}U(){return this.sortModel.map(e=>({...e}))}dr(e){if(!e||e.length===0){this.sortModel=[];return}this.sortModel=e.filter(t=>this.columns.some(r=>r.id===t.colId)&&(t.direction==="asc"||t.direction==="desc")).map(t=>({colId:t.colId,direction:t.direction}))}Zr(e,t){let r=[...this.sortModel],i=r.findIndex(l=>l.colId===e.id),o=i>=0?r[i].direction:null,s=o===null?"asc":o==="asc"?"desc":null;t&&this.e.r.multiSort?s===null?i>=0&&r.splice(i,1):i>=0?r[i]={colId:e.id,direction:s}:r.push({colId:e.id,direction:s}):(r.length=0,s&&r.push({colId:e.id,direction:s})),this.sortModel=r}};function te(n,e){if(n instanceof Error)return n;let t=new Error(typeof n=="string"?n:e);return t.name="AbortError",t}var To=()=>te(void 0,"[MachTable] Operation cancelled.");function We(n,e,t=To){return e?new Promise((r,i)=>{let o=()=>{e.removeEventListener("abort",o),i(t())};if(n.then(r,i).finally(()=>e.removeEventListener("abort",o)),e.aborted){o();return}e.addEventListener("abort",o,{once:!0})}):n}function ti(n){return n==null?"":String(n).toLowerCase()}function Do(n,e,t){let r=ti(n),i=o=>{let s=(o.value??"").toLowerCase();switch(o.match){case"contains":return r.includes(s);case"notContains":return!r.includes(s);case"equals":return r===s;case"notEquals":return r!==s;case"startsWith":return r.startsWith(s);case"endsWith":return r.endsWith(s);case"blank":return r==="";case"notBlank":return r!=="";default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Eo(n,e,t){switch(t.match){case"equals":return n===e;case"notEquals":return n!==e;case"lessThan":return n<e;case"lessThanOrEqual":return n<=e;case"greaterThan":return n>e;case"greaterThanOrEqual":return n>=e;case"inRange":return n>=e&&n<=(t.value2??e);default:return!0}}function xo(n,e){let t=n==null||n==="";if(e.match==="blank")return t;if(e.match==="notBlank")return!t;if(t)return!1;let r=typeof n=="number"?n:Number(n);if(Number.isNaN(r))return!1;let i=e.value;return i==null||Number.isNaN(i)?!1:Eo(r,i,e)}function Ro(n,e,t){let r=i=>xo(n,i);return e.length===0||(t==="or"?e.some(r):e.every(r))}function Yt(n){if(n==null||n==="")return null;if(n instanceof Date)return isNaN(n.getTime())?null:n.getTime();if(typeof n=="number")return n;let e=Date.parse(String(n));return isNaN(e)?null:e}function So(n,e,t){let r=Yt(n),i=o=>{let s=r==null;if(o.match==="blank")return s;if(o.match==="notBlank")return!s;if(s)return!1;let a=r,l=o.value!=null?Yt(o.value):null;if(l==null)return!1;switch(o.match){case"equals":return a===l;case"notEquals":return a!==l;case"lessThan":return a<l;case"greaterThan":return a>l;case"inRange":{let d=o.value2!=null?Yt(o.value2):null;return d!=null?a>=l&&a<=d:a>=l}default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Mo(n,e){return e.length===0?!0:e.some(t=>t==null&&n==null||t===n)}function ri(n,e){let t=e.type!=="set"&&e.operator==="or"?"or":"and";switch(e.type){case"text":return Do(n,e.conditions,t);case"number":return Ro(n,e.conditions,t);case"date":return So(n,e.conditions,t);case"set":return Mo(n,e.values);default:return!0}}function ii(n,e,t){if(n.kind==="condition"){let i=e.get(n.colId);return i?o=>ri(t(o,i),n.filter):()=>!0}let r=n.children.map(i=>ii(i,e,t));return i=>{let o=n.operator==="or"?r.some(s=>s(i)):r.every(s=>s(i));return n.not?!o:o}}function Xt(n,e,t,r,i){let o=new Map(n.map(d=>[d.id,d])),s=Object.entries(e).flatMap(([d,c])=>{let u=o.get(d);return u?[{column:u,filter:c}]:[]}),a=t?ii(t.root,o,i):()=>!0,l=r?.trim().toLowerCase().split(/\s+/).filter(Boolean)??[];return d=>!s.every(({column:c,filter:u})=>ri(i(d,c),u))||!a(d)?!1:l.every(c=>n.some(u=>ti(i(d,u)).includes(c)))}var ni=typeof Intl<"u"?new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}):null;function Io(n,e){let t=n==null||n==="",r=e==null||e==="";return!t&&!r?null:t&&r?0:t?1:-1}function Ao(n,e){let t=Number.isNaN(n),r=Number.isNaN(e);return t||r?t===r?0:t?1:-1:n-e}function Lo(n,e){return n===e?0:n?1:-1}function $e(n,e){let t=Io(n,e);if(t!==null)return t;if(typeof n=="number"&&typeof e=="number")return Ao(n,e);if(n instanceof Date&&e instanceof Date)return n.getTime()-e.getTime();if(typeof n=="boolean"&&typeof e=="boolean")return Lo(n,e);let r=String(n),i=String(e);return ni?ni.compare(r,i):r.localeCompare(i)}function Jt(n,e,t,r){let i=new Map(t.map(a=>[a.id,a])),o=e.flatMap(a=>{let l=i.get(a.colId);return l?[{column:l,compare:l.colDef.comparator??$e,direction:a.direction}]:[]}),s=n.map(a=>({node:a,values:o.map(({column:l})=>r(a,l))}));return s.sort((a,l)=>{for(let d=0;d<o.length;d++){let c=o[d],u=c.compare(a.values[d],l.values[d],a.node,l.node);if(u!==0)return c.direction==="asc"?u:-u}return 0}),s.map(({node:a})=>a)}function oi(){return{count:0,numeric:0,sum:0,min:1/0,max:-1/0}}function si(n,e){n.count++,!(typeof e!="number"||!Number.isFinite(e))&&(n.numeric++,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e))}function ai(n,e){return e==="count"?n?.count??0:n?.numeric?e==="min"?n.min:e==="max"?n.max:Number.isFinite(n.sum)?e==="avg"?n.sum/n.numeric:n.sum:null:null}function Ue(n,e){let t=oi();for(let r of n)si(t,r);return ai(t,e)}var qe={sum:n=>Ue(n,"sum"),avg:n=>Ue(n,"avg"),count:n=>n.length,min:n=>Ue(n,"min"),max:n=>Ue(n,"max"),first:n=>n.length>0?n[0]:null,last:n=>n.length>0?n[n.length-1]:null};function li(n,e,t){if(e===qe.count)return n.length;let r=["sum","avg","min","max"].find(o=>e===qe[o]);if(!r)return e(n.map(t));let i=oi();for(let o of n)si(i,t(o));return ai(i,r)}function Zt(n){let e={...qe,...n??{}};return t=>e[t]}var je="group:";function di(n){return n==null?"null":n instanceof Date?JSON.stringify(["date",String(n.getTime())]):JSON.stringify([typeof n,Qt(n)])}function Qt(n){return n==null?"(\u7A7A)":String(n)}function ci(n){return je+JSON.stringify(n)}function ko(n,e,t){let r=new Map;for(let i of n){let o=t(i,e),s=di(o),a=r.get(s);a||(a={key:s,label:Qt(o),rows:[]},r.set(s,a)),a.rows.push(i)}return[...r.values()].sort((i,o)=>i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})||i.key.localeCompare(o.key))}function ui(n,e,t,r,i){let o=[],s=(a,l,d)=>{if(l===e.length)return{display:a,leaves:a};let c=[],u=[];for(let h of ko(a,e[l],t)){let p=[...d,[e[l].id,h.key]],m=ci(p);o.push(m);let v=s(h.rows,l+1,p);if(c.push({id:m,data:null,rowIndex:-1,selected:!1,isGroup:!0,groupLevel:l,groupKey:h.label,leafNodes:v.leaves,aggValues:r(v.leaves)}),i.has(m))for(let w of v.display)c.push(w);if(l>0)for(let w of v.leaves)u.push(w)}return{display:c,leaves:u}};return{rows:s(n,0,[]).display,ids:o}}function hi(n,e,t,r){let i=new Set([...n].filter(l=>l.startsWith("/g0:")));if(!i.size)return{expanded:n,ambiguous:[]};let o=new Map;for(let l of e){let d=[],c="";for(let u=0;u<t.length;u++){let h=r(l,t[u]);if(d.push([t[u].id,di(h)]),c+=`/g${u}:${Qt(h)}`,!i.has(c))continue;let p=ci(d);o.set(c,o.has(c)&&o.get(c)!==p?null:p)}}let s=new Set([...n].filter(l=>!i.has(l))),a=[];for(let l of i){let d=o.get(l);d?s.add(d):d===null?a.push(l):s.add(l)}return{expanded:s,ambiguous:a}}function Po(n,e){let t=n?[n.root]:[];for(;t.length;){let r=t.pop();if(r.kind==="condition")e.add(r.colId);else for(let i of r.children)t.push(i)}}function pi(n){let e=new Set(Object.keys(n.filterModel));Po(n.advancedFilter,e);let t=new Set(n.sortModel.map(a=>a.colId));for(let a of t)e.add(a);let r=n.columns.some(a=>a.colDef.rowGroup===!0),i=!!n.quickFilter?.trim(),o=n.columns.filter(a=>e.has(a.id)||i||a.colDef.rowGroup===!0||r&&a.colDef.aggFunc!=null),s=new Set;for(let a of o){let l=a.colDef;if(r&&l.rowGroup!==!0&&l.aggFunc!=null&&n.customAggregates?.[l.aggFunc]||l.valueGetter||t.has(a.id)&&l.comparator||!l.field)return null;s.add(l.field)}return[...s]}function fi(n){return n!=null&&(typeof n=="object"||typeof n=="function")}function mi(n,e){let t=new WeakMap;for(let r of n){if(r.data==null)continue;let i=e.map(o=>K(r.data,o));i.some(fi)||t.set(r,i)}return t}function gi(n,e,t,r){return t.length?!r||n===e||n==null||e==null?!0:t.some((i,o)=>{let s=K(e,i);return fi(s)||!Object.is(r[o],s)}):!1}function re(n){return te(n.reason,"Block request aborted")}function Ye(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):1}var Xe=class{constructor(e,t,r=4){this.maxBlocks=e;this.En=t;this.maxConcurrentRequests=r;this.J=new Map;this.q=new Map;this.ks=0;this.generation=0;this.hitCount=0;this.missCount=0;this.evictionCount=0;this.Qr=0;this.ei=new Set;this.maxBlocks=Ye(e),this.maxConcurrentRequests=Ye(r)}configure(e,t=this.maxConcurrentRequests){this.maxBlocks=Ye(e),this.maxConcurrentRequests=Ye(t),this.Dn(),this.ti()}md(e){this.ei=e,this.Dn()}peek(e){let t=this.J.get(e);if(t)return t.touchedAt=++this.ks,t}has(e){return this.J.has(e)}invalidate(e){let t=this.q.get(e);t&&(this.q.delete(e),t.controller.abort(),t.state==="queued"&&t.reject(re(t.controller.signal)));let r=this.J.get(e);r&&(this.J.delete(e),this.En?.(e,r))}load(e,t,r,i=0){if(r?.aborted)return Promise.reject(re(r));let o=this.peek(e);if(o)return this.hitCount++,Promise.resolve(o);let s=this.q.get(e);if(s)return this.hitCount++,s.priority=Math.max(s.priority,i),this.ti(),this.Ps(e,s,r);this.missCount++;let a=new AbortController,l,d,c=new Promise((p,m)=>{l=p,d=m}),u={controller:a,promise:c,consumers:0,loader:t,priority:i,state:"queued",resolve:l,reject:d};this.q.set(e,u);let h=this.Ps(e,u,r);return this.ti(),h}gd(){this.generation++,this.ei.clear();for(let e of this.q.values())e.controller.abort(),e.state==="queued"&&e.reject(re(e.controller.signal));this.q.clear();for(let[e,t]of this.J)this.En?.(e,t);this.J.clear()}snapshot(){let e=0,t=0;for(let r of this.J.values())e+=r.rows.length;for(let r of this.q.values())r.state==="active"&&t++;return{cachedBlockCount:this.J.size,loadingBlockCount:this.q.size,activeRequestCount:t,queuedRequestCount:Math.max(0,this.q.size-t),cachedRowCount:e,hitCount:this.hitCount,missCount:this.missCount,evictionCount:this.evictionCount}}ti(){for(;this.Qr<this.maxConcurrentRequests;){let e,t;for(let[r,i]of this.q)i.state!=="queued"||i.controller.signal.aborted||(!t||i.priority>t.priority)&&(e=r,t=i);if(e==null||!t)return;this.yd(e,t)}}yd(e,t){t.state="active",this.Qr++;let r=this.generation;this.vd(t).then(i=>{r===this.generation&&!t.controller.signal.aborted&&(this.J.set(e,{rows:i.rows,...i.lastRow==null?{}:{lastRow:i.lastRow},touchedAt:++this.ks}),this.Dn()),t.resolve(i)},t.reject).finally(()=>{this.Qr=Math.max(0,this.Qr-1),this.q.get(e)===t&&this.q.delete(e),this.ti()})}vd(e){let{signal:t}=e.controller;return We(Promise.resolve().then(()=>{if(t.aborted)throw re(t);return e.loader(t)}),t,()=>re(t))}Ps(e,t,r){return t.consumers++,new Promise((i,o)=>{let s=!1,a=d=>{s||(s=!0,r?.removeEventListener("abort",l),t.consumers=Math.max(0,t.consumers-1),d())},l=()=>a(()=>{t.consumers===0&&this.q.get(e)===t&&(this.q.delete(e),t.controller.abort(r?.reason),t.state==="queued"&&t.reject(re(t.controller.signal))),o(re(r))});r?.addEventListener("abort",l,{once:!0}),t.promise.then(d=>a(()=>i(d)),d=>a(()=>o(d instanceof Error?d:new Error(String(d??"Block request failed")))))})}Dn(){let e=Math.max(this.maxBlocks,this.ei.size+1);for(;this.J.size>e;){let t=-1,r=Number.POSITIVE_INFINITY;for(let[o,s]of this.J)this.ei.has(o)||s.touchedAt<r&&(t=o,r=s.touchedAt);if(t<0)return;let i=this.J.get(t);this.J.delete(t),this.evictionCount++,i&&this.En?.(t,i)}}};function Ce(n,e){if(n==null||typeof n!="object")return;let t=n[e];return Array.isArray(t)?t:void 0}var Je=class{constructor(e){this.e=e;this.all=[];this.H=[];this.Z=new Map;this.displayed=[];this.h=new Map;this.filterModel={};this.advancedFilterModel=null;this.quickFilter=null;this.k=new Set;this.K=new Set;this.kt=[];this.cr=new Map;this.Gs=[];this.P=null;this.Pt=!1;this.Ns=!1;this._e=0;this.ri=null;this.ii=null;this.ni=new WeakMap;this.ur=new WeakMap;this.Ke=new Map;this.hr=new Map;this.pr=0;this.oi=0;this.We=null;this.$e=new Map;this.ht=new Map;this.si=new Set;this.pt=new Map;this.Ue=new Xe(12,e=>this.Fs(e));this.fr=0;this.ai=null;this.xn=!1;this.Os=0;this.te=[];this.page=1;this.pageSize=20;this.advancedFilterModel=z(e.r.advancedFilterModel)}resolveRowId(e,t,r){let i=this.e.r.resolveRowId;if(!i)return r;try{let o=i({data:e,index:t,api:this.e.api});if(typeof o=="string"&&o.length>0)return o;this.e.reportError(new Error("rowKey must resolve to a non-empty identifier"),"rowKey",{index:t})}catch(o){this.e.reportError(o,"rowKey",{index:t})}return r}get N(){return this.e.r.treeData}get p(){return this.e.r.datasource!=null}get ue(){return this.p&&this.e.r.datasourceMode==="block"}Gt(){if(this.p){if(this.ue)return this.Nt();let e=Math.max(0,this.displayed.length-this.all.length);return(this.P??this.all.length)+e}return this.displayed.length}Rn(){return this.pr}mr(){return this.oi}bd(){return this.Ns}li(e){return!this.p||e?.aborted?Promise.resolve():(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.P=null,this.Pt=!1,this.all=[],this.H=[],this.h.clear(),this.k.clear(),this.e.O.clear(),this.b(),this.e.u({data:!0}),this.ue?(this.Ue.configure(this.e.r.maxBlocksInCache,this.e.r.datasourceMaxConcurrentRequests),this.ci(0,e)):this.Hs(0,void 0,e))}ft(e){this.Ns=e,this.e.o.ft(e,this.e.g("loading"))}Hs(e,t,r){if(!this.p||this.Pt||this.P!=null&&e>=this.P)return Promise.resolve();let i=this.e.r.blockSize,o=t??e+i;if(o<=e)return Promise.resolve();let s=++this._e,a=new AbortController,l=()=>a.abort(r?.reason);return r?.addEventListener("abort",l,{once:!0}),this.ri=a,this.Pt=!0,this.ft(!0),new Promise(d=>{let c=!1;this.ii=d;let u=h=>{c||(c=!0,r?.removeEventListener("abort",l),s===this._e&&(this.Pt=!1,this.ri=null,this.ii=null,this.ft(!1),h!=null&&h?.name!=="AbortError"&&this.e.reportError(h,"datasource.getRows",{startRow:e,endRow:o})),d())};this.Vs(e,o,a.signal,(h,p)=>{if(s!==this._e||this.e.s()||a.signal.aborted){u();return}typeof p=="number"&&p>=0?this.P=p:h.length<o-e&&(this.P=e+h.length);let m=this.all.length===0;this.wd(h),u(),this.b(),this.e.u({data:!0}),m&&this.e.he(),this.e.B.ui()},h=>u(a.signal.aborted||this.e.s()?void 0:h??new Error("Datasource request failed")))})}di(){this._e++,this.ri?.abort(),this.ri=null,this.Pt=!1,this.ft(!1),this.ii?.(),this.ii=null,this.Ue.gd(),this.$e.clear(),this.ht.clear(),this.si.clear();for(let[e,t]of this.pt)this.h.get(e)===t&&this.h.delete(e);this.pt.clear()}wd(e){for(let t of e){if(t==null)continue;let r=this.all.length,i=this.resolveRowId(t,r,`inf-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"datasource.getRows",{rowId:i});continue}let o={id:i,data:t,rowIndex:-1,selected:this.e.m.Sn(i)};this.all.push(o),this.h.set(i,o),this.H.push(o)}}ci(e,t,r=0){if(!this.ue||e<0)return Promise.resolve();if(t?.aborted)return Promise.reject(this.Bs(t.reason));let i=this.e.r.blockSize,o=this._e,s=e*i;if(s>=this.Nt())return Promise.resolve();let a=this.P==null?s+i:Math.min(this.P,s+i),l=this.Ue.load(e,d=>this.Cd(s,a,d),t,r);return this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0),l.then(d=>{o!==this._e||t?.aborted||this.e.s()||!this.ue||!this.Ue.has(e)||this.si.has(e)||(this.Td(e,d),this.b(),this.e.u({data:!0}),this.e.B.ui(),o===this._e&&!this.e.s()&&this.zs(this.e.a.Mn().lastExcl-1))}).catch(d=>{throw d?.name!=="AbortError"&&this.e.reportError(d,"datasource.getRows",{startRow:s,endRow:a}),d}).finally(()=>{o===this._e&&this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0)})}Cd(e,t,r){return new Promise((i,o)=>{this.Vs(e,t,r,(s,a)=>i({rows:s,...typeof a=="number"&&a>=0?{lastRow:a}:{}}),s=>o(s instanceof Error?s:new Error(typeof s=="string"?s:"Datasource request failed")))})}Vs(e,t,r,i,o){let s=this.e.r.datasource,a=0,l=null,d=!1,c=p=>{d||(d=!0,l!=null&&clearTimeout(l),r.removeEventListener("abort",u),p())},u=()=>c(()=>o(this.Bs(r.reason)));r.addEventListener("abort",u,{once:!0});let h=()=>{if(d)return;if(r.aborted||this.e.s()){u();return}a++;let p=!1,m=v=>{if(!(p||d)){if(p=!0,r.aborted||this.e.s()){u();return}a<=this.e.r.datasourceRetryCount?l=setTimeout(h,this.retryDelay(a)):c(()=>o(v))}};try{let v=s.getRows({startRow:e,endRow:t,sortModel:this.e.n.U(),filterModel:this.j(),advancedFilterModel:this.be(),quickFilterText:this.quickFilter,signal:r,onSuccess:(w,C)=>{p||d||(p=!0,c(()=>i(w??[],C)))},fail:m});v&&typeof v.catch=="function"&&v.catch(m)}catch(v){m(v)}};h()}Td(e,t){let r=this.e.r.blockSize,i=e*r;this.Fs(e),typeof t.lastRow=="number"&&t.lastRow>=0?this.P=t.lastRow:t.rows.length<r&&(this.P=i+t.rows.length),t.rows.forEach((o,s)=>{if(o==null)return;let a=i+s;if(this.P!=null&&a>=this.P)return;let l=this.resolveRowId(o,a,`block-${a}`),d=this.pt.get(l),c=this.h.get(l);if(c&&c!==d&&c.rowIndex!==a){this.e.reportError(new Error(`Duplicate row id: ${l}`),"datasource.getRows",{rowId:l});return}let u=d??{id:l,data:o,rowIndex:a,selected:this.e.m.Sn(l)};u.rowIndex=a,u.selected=this.e.m.Sn(l),this.pt.delete(l),this.$e.set(a,u),this.ht.delete(a),this.h.set(l,u),this.ur.set(u,a+1)}),this._s(),this.si.add(e)}Fs(e){this.si.delete(e);let t=this.e.r.blockSize,r=e*t,i;for(let o=r;o<r+t;o++){let s=this.$e.get(o);s&&(i??(i=new Set(this.e.V.getDirtyRowIds())),this.$e.delete(o),i.has(s.id)?this.pt.set(s.id,s):this.h.get(s.id)===s&&this.h.delete(s.id))}this._s()}_s(){this.all=[...this.$e.entries()].sort(([e],[t])=>e-t).map(([,e])=>e),this.H=this.all}Nt(){if(this.P!=null)return this.P;if(this.e.r.datasourceRowCount!=null)return this.e.r.datasourceRowCount;if(this.$e.size===0)return this.e.r.blockSize;let e=0;for(let t of this.$e.keys())e=Math.max(e,t+1);return e+this.e.r.blockSize}Dd(e){let t=this.ht.get(e);if(!t&&(t={id:`__mach_loading_${e}`,data:null,rowIndex:e,selected:!1,loading:!0},this.ht.set(e,t),this.ht.size>2e3)){let r=this.ht.keys().next().value;r!=null&&this.ht.delete(r)}return t}Bs(e){return te(e,"Operation aborted")}retryDelay(e){let t=Math.min(this.e.r.datasourceRetryDelay*2**Math.max(0,e-1),3e4),r=this.e.r.datasourceRetryJitter;return Math.max(0,Math.round(t*(1+(Math.random()*2-1)*r)))}Ed(e){if(this.ue){this.zs(e);return}if(!this.p||this.Pt)return;let t=this.all.length;if(this.P!=null&&t>=this.P)return;let r=this.e.r.infiniteBufferRows;if(e+r<t&&e<t)return;let i=this.e.r.blockSize,o=this.P==null?t+i:Math.min(this.P,t+i);this.Hs(t,o)}zs(e){if(e<0)return;this.Ks();let t=this.e.r.blockSize,r=Math.floor(e/t),i=Math.floor(this.e.a.Mn().first/t),o=this.e.r.blockPrefetch,s=r<this.Os?-1:1;this.Os=r;for(let a=i;a<r;a++)this.ci(a,void 0,o+2).catch(()=>{});for(let a=0;a<=o;a++){let l=a===0?[r]:[r+s*a,r-s*a];for(let d of l)d<0||d*t>=this.Nt()||this.ci(d,void 0,o-a+1).catch(()=>{})}}Ae(){return this.li().catch(()=>{})}xd(){return this.di(),this.p?this.li().catch(()=>{}):(this.P=null,this.qe(this.e.r.rowData),this.e.u({data:!0}),Promise.resolve())}destroy(){this.We=null,this.di(),this.Ws(),this.In(),this.all=this.H=this.displayed=this.te=[],this.h.clear(),this.Z.clear(),this.cr.clear(),this.Gs=[],this.k.clear(),this.K.clear(),this.kt=[]}An(e,t,r){if(!this.ue)return Promise.resolve();this.Ks();let i=this.e.r.blockSize,o=Math.max(0,Math.trunc(e)),s=Math.min(this.Nt(),Math.max(o,Math.trunc(t))),a=Math.floor(o/i),l=Math.max(a,Math.floor(Math.max(o,s-1)/i)),d=[];for(let c=a;c<=l;c++)d.push(this.ci(c,r,100));return Promise.all(d).then(()=>{})}Ln(){this.ue&&(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.e.O.clear(),this.all=[],this.H=[],this.h.clear(),this.b(),this.e.u({data:!0}))}kn(){return this.Ue.snapshot()}Ks(){let e=new Set(this.e.V.getDirtyRowIds());for(let[l,d]of this.pt)e.has(l)||(this.pt.delete(l),this.h.get(l)===d&&this.h.delete(l));let t=this.e.r.blockSize,r=new Set,{first:i,lastExcl:o}=this.e.a.Mn();for(let l=i;l<o;l+=t)r.add(Math.floor(l/t));o>i&&r.add(Math.floor((o-1)/t));let s=this.e.a.T;s&&r.add(Math.floor(s.rowIndex/t));let a=this.e.l.Rd();a!=null&&r.add(Math.floor(a/t)),this.Ue.md(r)}qe(e){this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.Ws(),this.e.V.clear();let t=this.e.r.resolveRowId,r=this.e.r.childrenKey,i=[],o=[],s=new Map,a=new Map,l=0,d=(c,u,h)=>{let p=l++,m=this.resolveRowId(c,p,`auto-${p}`);if(s.has(m))return this.e.reportError(new Error(`Duplicate row id: ${m}`),"rowData",{rowId:m,index:p}),null;let v=this.N?Ce(c,r):void 0,w={id:m,data:c,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(v)};if(this.ni.set(w,u),i.push(w),s.set(m,w),h!=null){let C=a.get(h)??[];C.push(m),a.set(h,C)}else o.push(w);if(this.N&&Array.isArray(v))for(let C of v)C!=null&&d(C,u+1,m);return w};(e??[]).forEach(c=>{c!=null&&d(c,0,null)}),this.all=i,this.H=o,this.Z=a,this.h=s,this.e.O.clear();for(let c of[...this.k])s.has(c)||this.k.delete(c);if(this.e.r.defaultExpandAll)for(let c of i)this.$s(c.id)>0&&this.k.add(c.id);this.e.m.Us(t!=null),this.b()}gr(e){return this.Z.get(e)??[]}$s(e){return this.Z.get(e)?.length??0}Pn(e){return this.$s(e)>0}isTreeRowLoading(e){return this.h.get(e)?.treeLoading===!0}Ws(){for(let e of this.Ke.values())e.abort();this.Ke.clear(),this.hr.clear()}loadTreeChildren(e,t=!1){let r=this.h.get(e),i=this.e.r.loadTreeChildren;if(!this.N||!r?.data||!i)return Promise.resolve([]);if(!t&&r.treeChildrenLoaded)return Promise.resolve(this.gr(e).flatMap(l=>{let d=this.h.get(l)?.data;return d==null?[]:[d]}));let o=this.hr.get(e);if(o&&!t)return o;this.Ke.get(e)?.abort();let s=new AbortController;this.Ke.set(e,s),r.treeLoading=!0,r.treeLoadError=void 0,this.e.u({data:!0});let a=Promise.resolve().then(()=>i({data:r.data,node:r,api:this.e.api,signal:s.signal})).then(l=>{if(s.signal.aborted||this.e.s())return[];if(!Array.isArray(l))throw new TypeError("[MachTable] loadTreeChildren must resolve to an array.");return this.Sd(r,l),r.treeChildrenLoaded=!0,r.treeLoadError=void 0,this.e.emit("treeChildrenLoaded",{rowId:e,rowNode:r,children:l}),l}).catch(l=>{if(s.signal.aborted||l?.name==="AbortError")return[];throw r.treeLoadError=l,r.treeChildrenLoaded=!1,this.e.reportError(l,"treeData.loadChildren",{rowId:e}),this.e.emit("treeChildrenLoadFailed",{rowId:e,rowNode:r,error:l}),l}).finally(()=>{this.Ke.get(e)===s&&(this.Ke.delete(e),this.hr.delete(e),r.treeLoading=!1,this.e.u({data:!0}))});return this.hr.set(e,a),a}Sd(e,t){let r=new Set,i=[...this.gr(e.id)];for(;i.length>0;){let s=i.pop();r.has(s)||(r.add(s),i.push(...this.gr(s)))}this.Md(t,r);for(let s of r)this.Ke.get(s)?.abort(),this.Ke.delete(s),this.hr.delete(s),this.Z.delete(s),this.h.delete(s),this.k.delete(s);this.Z.delete(e.id);let o=this.Gn(e)+1;for(let s of t)s!=null&&this.Nn(e,s,o);this.qs(),this.e.m.Us(this.e.r.resolveRowId!=null),this.b(),this.e.u({data:!0})}Md(e,t){let r=this.e.r.resolveRowId,i=r?new Set([...this.h.keys()].filter(l=>!t.has(l))):null,o=new WeakSet,s=[...e],a=0;for(;s.length>0;){let l=s.pop();if(l==null)continue;if(typeof l=="object"){if(o.has(l))throw new TypeError("[MachTable] Lazy tree children contain a cyclic object graph.");o.add(l)}if(r&&i){let c=r({data:l,index:a++,api:this.e.api});if(typeof c!="string"||c.length===0)throw new TypeError("[MachTable] rowKey must resolve to a non-empty identifier for lazy tree children.");if(i.has(c))throw new Error(`Duplicate row id: ${c}`);i.add(c)}let d=Ce(l,this.e.r.childrenKey);d&&s.push(...d)}}yr(e,t=!0){let r=this.e.r.resolveRowId,i=[],o=[],s=[];if(e.remove?.length){let l=new Set,d=new Set,c=h=>{if(r){let m=[this.resolveRowId(h,-1,`__missing_remove_${this.e.Ft()}`)];for(;m.length>0;){let v=m.pop();if(!l.has(v)){l.add(v);for(let w of this.Z.get(v)??[])m.push(w)}}}else{let p=[h];for(;p.length>0;){let m=p.pop();d.add(m);let v=this.N?Ce(m,this.e.r.childrenKey):void 0;if(v)for(let w of v)p.push(w)}}};e.remove.forEach(c),this.all=this.all.filter(h=>{let p=l.has(h.id)||h.data!=null&&d.has(h.data);return p&&(s.push(h.id),this.h.delete(h.id),this.Z.delete(h.id)),!p});let u=new Set(this.all);this.H=this.H.filter(h=>u.has(h))}if(e.update?.length)for(let l of e.update){let d;r?d=this.h.get(this.resolveRowId(l,-1,`__missing_update_${this.e.Ft()}`)):d=this.all.find(c=>c.data===l),d&&(o.push({node:d,before:d.data,after:l}),d.data=l,s.push(d.id),this.e.a.hi(d),i.push(d))}if(e.add?.length){let l=e.addIndex!=null?Math.max(0,Math.min(e.addIndex,this.H.length)):this.H.length,d=[];e.add.forEach((c,u)=>{let h=this.resolveRowId(c,l+u,`add-${this.e.Ft()}`);if(this.h.has(h)){this.e.reportError(new Error(`Duplicate row id: ${h}`),"transaction.add",{rowId:h});return}let p={id:h,data:c,rowIndex:-1,selected:!1};this.h.set(h,p),this.ni.set(p,0);let m=this.N?Ce(c,this.e.r.childrenKey):void 0;if(m)for(let v of m)v!=null&&this.Nn(p,v,1);d.push(p)}),this.H=this.H.slice(0,l).concat(d,this.H.slice(l)),this.qs()}let a={pipelineChanged:this.Id(e,o),updatedRowIds:i.map(l=>l.id)};return this.Ad(a,t),this.e.V.Ld(s),a}Ad(e,t){e.pipelineChanged&&(this.We=null),t&&(e.pipelineChanged?this.b():e.updatedRowIds.length&&this.js())}kd(e){if(e.length===0)return{pipelineChanged:!1,updatedRowIds:[]};let t=!1,r=new Set;for(let i of e){let o=this.yr(i,!1);t||(t=o.pipelineChanged);for(let s of o.updatedRowIds)r.add(s)}return t?this.b():r.size>0&&this.js(),{pipelineChanged:t,updatedRowIds:[...r]}}Id(e,t){if(e.add?.length||e.remove?.length)return!0;if(!t.length)return!1;let r=this.Ys();if(r===null)return!0;if(!r.length)return!1;let i=this.We;return!i||r.length!==i.fields.length||r.some((o,s)=>o!==i.fields[s])?!0:t.some(({node:o,before:s,after:a})=>gi(s,a,r,i.values.get(o)))}Ys(){if(this.N||this.e.r.masterDetail||this.e.r.getRowHeight||this.Xs())return null;let e=this.e.n.c();if(e.some(r=>r.colDef.autoHeight===!0||r.colDef.autoRowSpan===!0||r.colDef.rowSpan!=null))return null;let t=!this.e.r.manualFiltering;return pi({columns:e,customAggregates:this.e.r.aggFuncs,sortModel:this.e.r.manualSorting?[]:this.e.n.U(),filterModel:t?this.filterModel:{},advancedFilter:t?this.advancedFilterModel:null,quickFilter:t?this.quickFilter:null})}Pd(){let e=this.Ys();this.We=e?.length?{fields:e,values:mi(this.all,e)}:null}js(){this.e.emit("modelUpdated",{rowCount:this.te.length})}Nn(e,t,r){let i=this.resolveRowId(t,-1,`add-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"transaction.add",{rowId:i});return}let o=Ce(t,this.e.r.childrenKey),s={id:i,data:t,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(o)};this.h.set(i,s),this.ni.set(s,r);let a=this.Z.get(e.id)??[];if(a.push(s.id),this.Z.set(e.id,a),!!o)for(let l of o)l!=null&&this.Nn(s,l,r+1)}qs(){this.all=[];let e=t=>{this.all.push(t),this.h.has(t.id)||this.h.set(t.id,t);for(let r of this.Z.get(t.id)??[]){let i=this.h.get(r);i&&e(i)}};for(let t of this.H)e(t)}vr(e){let t=JSON.stringify(this.filterModel),r=new Set(this.e.n.X().map(o=>o.id));this.filterModel=Q(e,r);let i=JSON.stringify(this.filterModel)!==t;return i&&(this.We=null),i}j(){return{...this.filterModel}}Ot(e){let t=new Set(this.e.n.X().map(s=>s.id)),r=z(e,t),i=JSON.stringify(this.advancedFilterModel);this.advancedFilterModel=r,this.e.r.advancedFilterModel=r;let o=JSON.stringify(r)!==i;return o&&(this.We=null),o}be(){return z(this.advancedFilterModel)}Ht(e){let t=e!=null&&e.trim()!==""?e:null;return t===this.quickFilter?!1:(this.quickFilter=t,this.We=null,!0)}br(){return this.quickFilter}Fn(){return Object.keys(this.filterModel).length>0||this.advancedFilterModel!=null||this.quickFilter!=null}b(){this.We=null;let e=this.e.re.start(),t=this.e.n.c(),r=(a,l)=>this.e.d(a,l);if(this.p){this.Gd(e);return}if(this.Nd(e))return;let i,o=[];if(this.N)i=this.Fd(t,r);else{i=this.all,this.Fn()&&!this.e.r.manualFiltering&&(i=i.filter(Xt(t,this.filterModel,this.advancedFilterModel,this.quickFilter,r)));let l=this.e.n.U();if(l.length>0&&!this.e.r.manualSorting)try{i=Jt(i,l,t,r)}catch(c){this.e.reportError(c,"comparator",{sortModel:l})}let d=this.e.n.ze();if(d.length>0){let c=this.Od(i,d);i=c.rows,o=c.ambiguousExpansions}else if(this.e.r.masterDetail){let c=[];for(let u of i)c.push(u),this.k.has(u.id)&&this.isRowExpandable(u)&&c.push({id:`__detail__${u.id}`,data:u.data,rowIndex:-1,selected:!1,isDetail:!0,masterId:u.id});i=c}}for(let a of this.all)a.rowIndex=-1;let s=0;i.forEach((a,l)=>{a.rowIndex=l,!a.isDetail&&!a.isGroup&&(s++,this.ur.set(a,s))}),this.te=i,this.Vt(),this.Pd(),this.Js(r),this.e.emit("modelUpdated",{rowCount:i.length}),this.e.re.On(e),this.Hd(o)}Gd(e){this.all.forEach((t,r)=>{this.ue||(t.rowIndex=r),this.ur.set(t,this.ue?t.rowIndex+1:r+1)}),this.displayed=this.all,this.te=this.all,this.cr.clear(),this.pr++,this.e.emit("modelUpdated",{rowCount:this.all.length}),this.e.re.On(e)}Nd(e){let t=this.xn;return this.xn=!1,!t&&this.Xs()?(this.Vd(e),!0):(this.In(),!1)}Xs(){if(!this.e.r.dataProcessor||this.all.length<this.e.r.dataProcessorMinRows||this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return!1;let e=!this.e.r.manualFiltering&&this.Fn(),t=!this.e.r.manualSorting&&this.e.n.U().length>0;return e||t}Vd(e){this.In();let t=this.e.r.dataProcessor;if(!t)return;let r=++this.fr,i=new AbortController;this.ai=i;let o=this.e.n.c(),s=this.all.flatMap(d=>d.data==null?[]:[{id:d.id,data:d.data}]),a=!this.e.r.manualFiltering,l=!this.e.r.manualSorting;Promise.resolve().then(()=>t.process({rows:s,columns:o.map(d=>({colId:d.id,...d.colDef.field?{field:d.colDef.field}:{}})),sortModel:l?this.e.n.U():[],filterModel:a?this.j():{},advancedFilterModel:a?this.be():null,quickFilterText:a?this.quickFilter:null,signal:i.signal})).then(d=>{if(r!==this.fr||i.signal.aborted||this.e.s())return;let c=new Set,u=[];for(let p of d.rowIds){if(c.has(p))continue;c.add(p);let m=this.h.get(p);m&&!m.isDetail&&!m.isGroup&&u.push(m)}for(let p of this.all)p.rowIndex=-1;u.forEach((p,m)=>{p.rowIndex=m,this.ur.set(p,m+1)}),this.te=u,this.Vt();let h=(p,m)=>this.e.d(p,m);this.Js(h),this.e.emit("modelUpdated",{rowCount:u.length}),this.e.re.On(e),this.e.u({data:!0})}).catch(d=>{r!==this.fr||i.signal.aborted||this.e.s()||(this.e.reportError(d,"dataProcessor.process"),this.xn=!0,this.b(),this.e.u({data:!0}))}).finally(()=>{r===this.fr&&(this.ai=null)})}In(){this.fr++,this.ai?.abort(),this.ai=null}get we(){return this.e.r.paginationEnabled&&!this.p}Vt(){if(!this.we){this.displayed=this.te,this.pr++;return}let e=this.wr(),t=this.getPageCount();if(this.page>t&&(this.page=t),this.page<1&&(this.page=1),this.e.r.paginationPage=this.page,this.e.r.paginationMode==="server"){this.te.forEach((o,s)=>{o.rowIndex=s}),this.displayed=this.te,this.pr++;return}let r=(this.page-1)*e,i=this.te.slice(r,r+e);i.forEach((o,s)=>{o.rowIndex=s}),this.displayed=i,this.pr++}wr(){return this.pageSize=this.e.r.paginationPageSize,Math.max(1,this.pageSize)}Cr(){return this.we?this.page:1}getTotalRowCount(){return this.p?this.Gt():this.we&&this.e.r.paginationMode==="server"?this.e.r.paginationTotal:this.te.length}getPageCount(){return this.we?Math.max(1,Math.ceil(this.getTotalRowCount()/this.wr())):1}Zs(){return this.te}setPage(e,t=!1){if(!this.we)return;let r=this.getPageCount(),i=Math.max(1,Math.min(Math.round(e)||1,r));i!==this.page&&(this.page=i,this.e.r.paginationPage=i,this.Vt(),this.e.u({data:!0}),this.e.a.Bt(0,"top"),t||this.pi())}setPageSize(e){if(!this.we)return;let t=Math.max(1,Math.round(e)||this.wr()),r=(this.page-1)*this.wr();this.e.r.paginationPageSize=t,this.pageSize=t,this.page=Math.floor(r/t)+1,this.e.r.paginationPage=this.page,this.Vt(),this.e.u({data:!0}),this.pi()}Qs(e,t){this.pageSize=Math.max(1,Math.round(t)||1),this.e.r.paginationPageSize=this.pageSize,this.page=Math.max(1,Math.round(e)||1),this.e.r.paginationPage=this.page}fi(e){this.e.r.paginationEnabled!==e&&(this.e.r.paginationEnabled=e&&!this.p,this.e.r.paginationEnabled&&(this.page=1),this.Vt(),this.e.u({data:!0}),this.pi())}Bd(){this.we&&(this.page=this.e.r.paginationMode==="server"?this.e.r.paginationPage:1,this.Vt(),this.e.u({data:!0}),this.pi())}pi(){this.e.emit("paginationChanged",{page:this.Cr(),pageSize:this.wr(),pageCount:this.getPageCount(),total:this.getTotalRowCount()})}Fd(e,t){let r=this.e.r.manualSorting?[]:this.e.n.U(),i=new Map,o=this.Fn()&&!this.e.r.manualFiltering,s=Xt(e,this.filterModel,this.advancedFilterModel,this.quickFilter,t),a=c=>{let u=i.get(c.id);if(u!==void 0)return u;let h=!0;if(o){h=s(c);for(let p of this.Z.get(c.id)??[]){let m=this.h.get(p);m&&a(m)&&(h=!0)}}return i.set(c.id,h),h},l=[],d=c=>{let u=c;r.length>0&&(u=Jt(c,r,e,t));for(let h of u)if(a(h)&&(l.push(h),this.k.has(h.id))){let p=(this.Z.get(h.id)??[]).map(m=>this.h.get(m)).filter(m=>m!=null);d(p)}};return d(this.H),l}zd(){let e=this.Gs,t=0;for(let r of this.displayed)!r.isDetail&&!r.isGroup&&(e[t++]=r);return e.length=t,e}_d(e,t,r,i){let o=t.colDef.rowSpan;if(!o)return 1;try{let s=o({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:r,rowIndex:e.rowIndex});return Math.max(1,Math.min(Math.round(s)||1,i))}catch(s){return this.e.reportError(s,"rowSpan",{colId:t.id,rowId:e.id}),1}}Kd(e,t,r,i,o){if(!r.colDef.autoRowSpan||i==null||i==="")return 1;let s=1;for(;t+s<e.length&&$e(i,o(e[t+s],r))===0;)s++;return s}Wd(e,t,r){let i=new Int32Array(e.length),o=0;for(;o<e.length;){let s=e[o],a=r(s,t),l=t.colDef.rowSpan?this._d(s,t,a,e.length-o):this.Kd(e,o,t,a,r);i[o]=l;for(let d=1;d<l;d++)i[o+d]=-1;o+=l}return i}Js(e){if(this.cr.clear(),this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return;let t=this.e.n.c().filter(i=>i.colDef.rowSpan!=null||i.colDef.autoRowSpan===!0);if(t.length===0)return;let r=this.zd();if(r.length!==0)for(let i of t)this.cr.set(i.id,this.Wd(r,i,e))}$d(e){return this.cr.get(e)}ea(e){return this.ur.get(e)??0}Gn(e){return this.ni.get(e)??0}Od(e,t){let r=Zt(this.e.r.aggFuncs),i=this.e.n.hd();this.kt=[];let o=l=>{let d={};for(let c of i){let u=r(c.colDef.aggFunc);if(u)try{d[c.id]=li(l,u,h=>this.e.d(h,c))}catch(h){this.e.reportError(h,"aggFunc",{colId:c.id,aggFunc:c.colDef.aggFunc}),d[c.id]=null}}return d},s=hi(this.K,this.all,t,(l,d)=>this.e.d(l,d));this.K=s.expanded;let a=ui(e,t,(l,d)=>this.e.d(l,d),o,this.K);return this.kt=a.ids,{rows:a.rows,ambiguousExpansions:s.ambiguous}}Hd(e){for(let t of e){if(this.e.s())return;this.e.reportError(new Error(`Ambiguous legacy group expansion: ${t}`),"gridState.groupExpansion",{groupId:t})}}isRowExpandable(e){if(this.N){if(this.Pn(e.id)||e.treeLoading)return!0;if(e.treeChildrenLoaded||!e.data||!this.e.r.loadTreeChildren)return!1;let r=this.e.r.isTreeRowExpandable;if(!r)return!1;try{return r({data:e.data,node:e,api:this.e.api})}catch(i){return this.e.reportError(i,"isTreeRowExpandable",{rowId:e.id}),!1}}if(!this.e.r.masterDetail)return!1;let t=this.e.r.isRowExpandable;if(t)try{return t({data:e.data,node:e,api:this.e.api})}catch(r){return this.e.reportError(r,"isRowExpandable",{rowId:e.id}),!1}return!0}isRowExpanded(e){return this.k.has(e)}Ud(){return[...this.k]}qd(){return[...this.K]}jd(e,t){this.k=new Set(e.filter(r=>this.h.has(r))),this.K=new Set(t)}Hn(e){return this.Vn(e,!0)}Bn(e){return this.Vn(e,!1)}mi(e){return this.Vn(e,!this.k.has(e))}Vn(e,t){let r=this.h.get(e);return!r||t&&!this.isRowExpandable(r)?!1:(t===this.k.has(e)||(t?this.k.add(e):this.k.delete(e),this.b(),this.e.u({data:!0}),this.e.emit("detailToggled",{rowId:e,rowNode:r,expanded:t}),t&&this.N&&!this.Pn(e)&&!r.treeLoading&&this.loadTreeChildren(e).catch(()=>{})),t)}zn(){let e=!1;for(let t of this.all)!this.k.has(t.id)&&this.isRowExpandable(t)&&(this.k.add(t.id),e=!0);e&&(this.b(),this.e.u({data:!0}))}_n(){this.k.size!==0&&(this.k.clear(),this.b(),this.e.u({data:!0}))}Kn(e){return this.setGroupExpanded(e,!this.K.has(e))}isGroupExpanded(e){return this.K.has(e)}Wn(){if(this.kt.length===0)return;let e=!1;for(let t of this.kt)this.K.has(t)||(this.K.add(t),e=!0);e&&(this.b(),this.e.u({data:!0}))}$n(){this.K.size!==0&&(this.K.clear(),this.b(),this.e.u({data:!0}))}setGroupExpanded(e,t){return!this.kt.includes(e)||t===this.K.has(e)||(t?this.K.add(e):this.K.delete(e),this.b(),this.e.u({data:!0})),t}ta(){return!this.N&&!this.p&&!this.e.r.dataProcessor&&this.e.r.paginationMode!=="server"&&this.e.n.U().length===0&&this.e.n.ze().length===0}ra(e,t){if(!this.ta()||!Number.isInteger(e)||!Number.isInteger(t))return!1;let r=this.f(e),i=this.f(t);if(!r||!i||r.isDetail||i.isDetail||r.isGroup||i.isGroup)return!1;let o=this.all.indexOf(r),s=this.all.indexOf(i);return o<0||s<0||o===s?!1:(this.all.splice(o,1),this.all.splice(s,0,r),this.b(),this.e.u({data:!0}),!0)}pe(){return this.all}Yd(){return this.H}je(){return this.displayed}I(){return this.ue?this.Nt():this.displayed.length}f(e){return this.ue?e<0||e>=this.Nt()?void 0:this.$e.get(e)??this.Dd(e):this.displayed[e]}z(e){return this.h.get(e)}Un(e){this.all.forEach(e)}qn(e){let t=0;for(let r of this.te)r.isDetail||r.isGroup||e(r,t++)}};var Ze=class{constructor(e){this.e=e;this.R=new Set;this.Le=null;this.Tr=new Set}Sn(e){return this.R.has(e)}Xd(e){return this.Tr.has(e)}ke(e){if(e.loading)return!1;let t=this.Jd(e),r=t?.colDef.selectable;if(!t||!r)return!0;try{return r({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:this.e.d(e,t),rowIndex:e.rowIndex})}catch(i){return this.e.reportError(i,"selectable",{rowId:e.id,colId:t?.id}),!1}}Jd(e){if(!(e.isGroup||e.isDetail))return this.e.n.c().find(t=>t.hasCheckbox&&t.colDef.selectable!=null)}Pe(){return this.e.i.pe().filter(e=>this.R.has(e.id))}gi(){return this.Pe().filter(e=>e.data!=null).map(e=>e.data)}yi(){return[...this.R]}Zd(e){let t=new Set(e),r=this.e.i.pe().filter(i=>t.has(i.id)&&!i.isDetail&&!i.isGroup).map(i=>({node:i,selected:!0}));this.fe(r,!0)}Us(e){if(!e)this.R.clear(),this.Le=null;else{let t=new Set(this.e.i.pe().map(r=>r.id));for(let r of[...this.R])t.has(r)||this.R.delete(r);this.Le!=null&&!t.has(this.Le)&&(this.Le=null)}for(let t of this.e.i.pe())t.selected=this.R.has(t.id);this.ia()}na(e){let t=e.leafNodes??[];if(t.length===0)return{all:!1,some:!1};let r=0,i=0;for(let o of t)this.ke(o)&&(r++,this.R.has(o.id)&&i++);return r===0?{all:!1,some:!1}:{all:i===r,some:i>0}}Qd(e,t){let r=(e.leafNodes??[]).filter(i=>this.ke(i));r.length!==0&&this.fe(r.map(i=>({node:i,selected:t})))}oa(e,t,r=!1){this.fe([{node:e,selected:t,clearOthers:r}])}jn(e,t=!0,r=!0){let i=this.e.i.z(e);i&&this.oa(i,t,r)}ec(e,t){let r=t==="single";this.fe([{node:e,selected:r?!0:!e.selected,clearOthers:r}]),this.Le=e.id}tc(e,t,r){return!r||!t.ctrlKey&&!t.metaKey?!1:(this.fe([{node:e,selected:!e.selected}]),this.Le=e.id,!0)}rc(e,t,r){if(!r||!t.shiftKey||this.Le==null)return!1;let i=this.e.i.z(this.Le);if(!i||i.rowIndex<0||e.rowIndex<0)return!1;let o=Math.min(i.rowIndex,e.rowIndex),s=Math.max(i.rowIndex,e.rowIndex),a=[];for(let l=o;l<=s;l++){let d=this.e.i.f(l);d&&!d.isDetail&&!d.isGroup&&this.ke(d)&&a.push({node:d,selected:!0})}return this.fe(a),!0}sa(e,t,r){let i=this.e.r.rowSelection;if(i==="none"||!this.ke(e))return;if(r){this.ec(e,i);return}let o=i==="multiple";this.tc(e,t,o)||this.rc(e,t,o)||(this.fe([{node:e,selected:!0,clearOthers:!0}]),this.Le=e.id)}selectAll(e=!0){let t=this.e.r.rowSelection;if(t==="none")return;let i=(e?this.e.i.je():this.e.i.pe()).filter(o=>!o.isDetail&&!o.isGroup&&this.ke(o));if(i.length!==0){if(t==="single"){this.fe([{node:i[0],selected:!0,clearOthers:!0}]);return}this.fe(i.map(o=>({node:o,selected:!0})))}}deselectAll(){this.fe([],!0)}ic(){let t=this.e.i.je().filter(r=>!r.isDetail&&!r.isGroup).filter(r=>this.ke(r));if(t.length===0)return!1;if(this.e.i.p){let r=this.e.i.Gt();if(t.length<r)return!1}return t.every(r=>this.R.has(r.id))}nc(){let t=this.e.i.je().filter(i=>!i.isDetail&&!i.isGroup).filter(i=>this.ke(i)),r=t.reduce((i,o)=>i+(this.R.has(o.id)?1:0),0);if(r===0)return!1;if(this.e.i.p){let i=this.e.i.Gt();if(t.length<i)return!0}return r>0&&r<t.length}oc(e,t=!1){this.fe(e,t)}sc(e,t,r){!t&&!e.some(i=>i.clearOthers)||(this.R=t?new Set:new Set(e.filter(i=>i.selected).flatMap(i=>r?this.aa(i.node):[i.node.id])))}ac(e,t){for(let r of e){if(!this.ke(r.node))continue;let i=t?this.aa(r.node):[r.node.id];for(let o of i)r.selected?this.R.add(o):this.R.delete(o)}}lc(e){let t=new Set;for(let r of new Set([...e,...this.R]))e.has(r)!==this.R.has(r)&&t.add(r);return t}dc(e,t,r){let i=[],o=new Set([...e,...r,...this.Tr]);for(let s of this.e.i.pe()){let a=this.R.has(s.id);s.selected=a,(o.has(s.id)||t.get(s.id)!==a)&&s.rowIndex>=0&&i.push(s.rowIndex)}return i}fe(e,t=!1){let r=new Set(this.R),i=this.e.i.N&&this.e.r.autoCheckedChildren;this.sc(e,t,i),this.ac(e,i);let o=this.lc(r),s=new Map;for(let d of this.e.i.pe())s.set(d.id,d.selected);let a=new Set(this.Tr);this.ia();let l=this.dc(o,s,a);o.size>0&&(this.e.a.Ye(l),this.e.B.ui(),this.e.emit("selectionChanged",{selectedNodes:this.Pe(),selectedRows:this.gi()}))}aa(e){let t=[e.id],r=i=>{for(let o of this.e.i.gr(i))t.push(o),r(o)};return r(e.id),t}ia(){if(this.Tr.clear(),!this.e.i.N)return;let e=t=>{let r=this.e.i.gr(t);if(r.length===0)return{all:this.R.has(t),some:this.R.has(t)};let i=!0,o=!1;for(let s of r){let a=e(s);a.all?o=!0:(a.some&&(o=!0),i=!1)}return o&&!i&&this.Tr.add(t),i?this.R.add(t):this.R.delete(t),{all:i,some:o}};for(let t of this.e.i.Yd())e(t.id);for(let t of this.e.i.pe())t.selected=this.R.has(t.id)}};var Qe=class{constructor(e){this.e=e;this.active=null;this.Q=0;this.Xe=0;this.Ce=null;this.mt=null;this.Je=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),!this.Q&&(this.Q=requestAnimationFrame(()=>{this.Q=0,this.hc()})))};this.Te=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),this.pc(t))};this.yt=e=>{this.Xn(e)&&this.gt()};this.la=()=>{this.gt()}}cc(e,t){if(!this.e.r.enableColumnResize||!t.resizable||e.isPrimary===!1)return;this.gt();let r=e.currentTarget,i=t.currentWidth;this.Xe=i,this.active={column:t,didResize:!1,handle:r,pointerId:e.pointerId,startFlex:t.flex,startManualWidth:t.manualWidth,startWidth:i,startX:e.clientX},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te,!0),window.addEventListener("pointercancel",this.yt,!0),r.addEventListener("lostpointercapture",this.la);try{r.setPointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.add("mach-root--resizing"),r.classList.add("mach-header-resize--active"),this.uc(this.active)}gt(e=!0){let t=this.active;t&&(this.active=null,this.Yn(),this.da(t),e&&(t.column.manualWidth=t.startManualWidth,t.column.flex=t.startFlex,this.e.Ze()),this.e.o.root.classList.remove("mach-root--resizing"),this.ca(t))}pc(e){this.active=null,this.Yn(),e.didResize&&(Math.abs(this.Xe-e.startWidth)<.5?(e.column.manualWidth=e.startManualWidth,e.column.flex=e.startFlex):this.e.n.Ie(e.column,this.Xe),this.e.Ze()),this.da(e);try{e.handle.releasePointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.remove("mach-root--resizing"),this.ca(e),e.didResize&&this.e.zt([e.column])}hc(){let e=this.active;!e||!this.e.n.Ie(e.column,this.Xe)||(this.e.Ze(),this.Dr(e),this.e.ha(e.column,!1))}uc(e){this.Ce=document.createElement("div"),this.Ce.className="mach-column-resize-guide",this.Ce.setAttribute("aria-hidden","true"),this.mt=document.createElement("span"),this.mt.className="mach-column-resize-label",this.Ce.appendChild(this.mt),this.e.o.root.appendChild(this.Ce),this.Dr(e)}Dr(e){if(!this.Ce||!this.mt)return;let t=this.e.o.root,r=t.getBoundingClientRect(),i=e.handle.parentElement.getBoundingClientRect(),o=Math.max(0,Math.min(t.clientWidth,i.right-r.left-t.clientLeft)),s=Math.max(32,Math.min(t.clientWidth-32,o));this.Ce.style.left=`${o}px`,this.Ce.style.top=`${Math.max(0,i.top-r.top-t.clientTop)}px`,this.mt.style.left=`${s-o}px`,this.mt.textContent=`${Math.round(e.column.currentWidth)} px`}ca(e){e.handle.classList.remove("mach-header-resize--active"),this.Ce?.remove(),this.Ce=null,this.mt=null}ua(e,t){let r=Number.isFinite(t)?t:e.startX;return e.startWidth+r-e.startX}Xn(e){let t=this.active;return t&&e.pointerId===t.pointerId?t:null}Yn(){this.Q&&cancelAnimationFrame(this.Q),this.Q=0}da(e){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te,!0),window.removeEventListener("pointercancel",this.yt,!0),e.handle.removeEventListener("lostpointercapture",this.la)}destroy(){this.gt(!1),this.Yn(),this.e.o.root?.classList.remove("mach-root--resizing")}};var yi=6,et=class{constructor(e){this.e=e;this.pending=null;this._t=null;this.Jn=!1;this.ie=0;this.vi=null;this.Je=e=>{if(this._t){this.gc(e);return}let t=this.pending;t&&(Math.abs(e.clientX-t.startX)<yi&&Math.abs(e.clientY-t.startY)<yi||this.yc(e))};this.Te=e=>{this.pending=null,e.type!=="pointercancel"&&this._t&&this.eo(e.clientX,e.clientY),this.Zn();let t=this.pa();t&&e.type!=="pointercancel"&&t.targetIndex>=0&&this.e.ut(t.column.id,t.targetIndex)}}fc(e,t){e.button===0&&t.movable&&(this.pending={column:t,startX:e.clientX,startY:e.clientY},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te),window.addEventListener("pointercancel",this.Te))}mc(){let e=this.Jn;return this.Jn=!1,e}yc(e){let t=this.pending;if(!t)return;let r=this.vc(t.column);if(!r||!r.parentElement){this.Zn();return}this.Jn=!0;let i=f("div","mach-drop-indicator"),o=f("div","mach-column-drag-ghost");o.textContent=t.column.colDef.headerName??t.column.colDef.field??t.column.id,o.ariaHidden="true",P(o,this.e.o.root),document.body.appendChild(o),r.parentElement.appendChild(i),r.classList.add("mach-header-cell--dragging"),this.e.o.root.classList.add("mach-root--dragging");let s=this.e.a.Qn(t.column),a=this.e.o.Kt[s],l=this.e.n.C(s),d=new Float64Array(l.length+1),c=new Float64Array(l.length);for(let h=0;h<l.length;h++){let p=l[h].currentWidth;c[h]=d[h]+p/2,d[h+1]=d[h]+p}let u=o.getBoundingClientRect();this._t={column:t.column,cellEl:r,ghost:o,indicator:i,targetIndex:-1,pane:s,containerLeft:a.getBoundingClientRect().left,startScrollLeft:this.e.o.S.center.scrollLeft,fromIndex:l.indexOf(t.column),midpoints:c,offsets:d,ghostWidth:u.width,ghostHeight:u.height},this.eo(e.clientX,e.clientY)}vc(e){let t=this.e.a.Qn(e);return this.e.o.Kt[t].querySelector(`.mach-header-cell[data-col-id="${Go(e.id)}"]`)}gc(e){this.vi={clientX:e.clientX,clientY:e.clientY},!this.ie&&(this.ie=requestAnimationFrame(()=>{this.ie=0;let t=this.vi;this.vi=null,t&&this.eo(t.clientX,t.clientY)}))}eo(e,t){let r=this._t;if(!r)return;let i=E(e+12,8,window.innerWidth-r.ghostWidth-8),o=E(t+12,8,window.innerHeight-r.ghostHeight-8);r.ghost.style.transform=`translate3d(${i}px, ${o}px, 0)`;let s=r.pane==="center"?this.e.o.S.center.scrollLeft-r.startScrollLeft:0,a=e-(r.containerLeft-s),l=r.midpoints.length;for(let d=0;d<r.midpoints.length;d++)if(a<r.midpoints[d]){l=d;break}r.targetIndex=l>r.fromIndex?l-1:l,r.indicator.style.transform=`translate3d(${r.offsets[l]}px, 0, 0)`}pa(){let e=this._t;return e?(this._t=null,e.cellEl.classList.remove("mach-header-cell--dragging"),e.ghost.remove(),e.indicator.remove(),this.e.o.root.classList.remove("mach-root--dragging"),e):null}Zn(){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te),window.removeEventListener("pointercancel",this.Te),this.ie&&cancelAnimationFrame(this.ie),this.ie=0,this.vi=null}destroy(){this.Zn(),this.pa(),this.pending=null}};function Go(n){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(n):n.replace(/[^a-zA-Z0-9_-]/g,"\\$&")}var er=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;function tt(n,e=!0){if(n==="")return null;if(!e||typeof n!="string"||!er.test(n)||/^[+-]?0\d/.test(n))return n;let t=Number(n);return Number.isFinite(t)&&(!Number.isInteger(t)||Number.isSafeInteger(t))?t:n}function No(n,e){let t=n==null?"":String(n);return t.includes(e)||t.includes('"')||t.includes(`
|
|
1
|
+
var He="0.34.2";function f(n,e,t){let r=document.createElement(n);if(e&&(r.className=e),t)for(let i of Object.keys(t))r.setAttribute(i,t[i]);return r}function P(n,e){if(n.classList.add("mach-portal"),!e)return;let t=window.getComputedStyle(e);for(let r=0;r<t.length;r++){let i=t.item(r);if(!i.startsWith("--mach-"))continue;let o=t.getPropertyValue(i).trim();o&&n.style.setProperty(i,o)}n.style.colorScheme=t.colorScheme}function E(n,e,t){return n<e?e:n>t?t:n}function j(n,e,t=4){let r=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.bottom+t,s=o+i.height>window.innerHeight-8?r.top-i.height-t:o;n.style.left=`${E(r.left,8,Math.max(8,window.innerWidth-i.width-8))}px`,n.style.top=`${E(s,8,Math.max(8,window.innerHeight-i.height-8))}px`}var zr=0;function _r(n="rg"){return zr++,`${n}-${zr}`}var Kr='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3.5h12L9.5 8v4.5L6.5 14V8L2 3.5z"/></svg>',Wr='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 3l4 5H4l4-5z"/></svg>',$r='<svg viewBox="0 0 16 16" width="10" height="10" fill="currentColor"><path d="M8 13l4-5H4l4 5z"/></svg>',Ur='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round"><path d="M2 4h3m3 0h6M2 8h7m3 0h2M2 12h1m3 0h8"/><circle cx="6.5" cy="4" r="1.35"/><circle cx="10.5" cy="8" r="1.35"/><circle cx="4.5" cy="12" r="1.35"/></svg>';var Ve=class{constructor(e){this.ld=e;this.It=new Map}on(e,t){let r=this.It.get(e);return r||(r=new Set,this.It.set(e,r)),r.add(t),()=>{r.delete(t)}}once(e,t){let r=this.on(e,i=>{r(),t(i)});return r}Af(e,t){let r=this.It.get(e);r&&(r.delete(t),r.size===0&&this.It.delete(e))}emit(e,t){let r=this.It.get(e);if(r)for(let i of[...r])try{i(t)}catch(o){console.error(`[mach-table] error in "${e}" listener`,o),this.ld?.(o,e)}}clear(){this.It.clear()}};var zn=new Set(["__proto__","prototype","constructor"]),ge=new Map;function _t(n){if(typeof n!="string"||n.length===0)return null;let e=ge.get(n);if(e!==void 0)return e;let t=n.split("."),r=t.every(i=>i.length>0&&!zn.has(i))?t:null;return n.length<=1024&&(ge.size>=256&&ge.delete(ge.keys().next().value),ge.set(n,r)),r}function Kt(n){return _t(n)!==null}function K(n,e){if(n==null)return;let t=_t(e);if(!t)return;let r=n;for(let i of t){if(r==null)return;r=r[i]}return r}function ye(n,e,t){if(n==null)return!1;let r=_t(e);if(!r)return!1;let i=n;for(let o=0;o<r.length-1;o++){if(typeof i!="object"&&typeof i!="function"||i===null)return!1;i[r[o]]==null&&(i[r[o]]={}),i=i[r[o]]}return typeof i!="object"&&typeof i!="function"||i===null?!1:(i[r[r.length-1]]=t,!0)}var ae={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","inRange","blank","notBlank"],date:["equals","notEquals","lessThan","greaterThan","inRange","blank","notBlank"]};var _n=16,Kn=512,Wn=20,$n=2e3,Un=2e3,qn={text:new Set(ae.text),number:new Set(ae.number),date:new Set(ae.date)};function jn(n){return n==null||typeof n=="string"||typeof n=="number"&&Number.isFinite(n)}function Yn(n,e,t){if(n==null||typeof n!="object")return null;let r=n;return typeof r.match!="string"||!t.has(r.match)?null:{match:r.match,...Xn(r,e)}}function Xn(n,e){let t=e==="number"?qr(n.value):typeof n.value=="string"?n.value:void 0,r=e==="number"?qr(n.value2):typeof n.value2=="string"?n.value2:void 0;return{...t!==void 0?{value:t}:{},...r!==void 0?{value2:r}:{}}}function qr(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Jn(n,e){let t=[],r=qn[e];for(let i of n.slice(0,Wn)){let o=Yn(i,e,r);o&&t.push(o)}return t}function Wt(n){if(n==null||typeof n!="object")return null;let e=n;return e.type==="set"?Array.isArray(e.values)?{type:"set",values:e.values.filter(jn).slice(0,$n)}:null:e.type!=="text"&&e.type!=="number"&&e.type!=="date"||!Array.isArray(e.conditions)?null:{type:e.type,...e.operator==="or"||e.operator==="and"?{operator:e.operator}:{},conditions:Jn(e.conditions,e.type)}}function Zn(n,e){if(typeof n.colId!="string"||!n.colId.trim())return null;let t=n.colId.trim();if(e.validColumnIds?.has(t)===!1)return null;let r=Wt(n.filter);return r?{kind:"condition",colId:t,filter:r}:null}function Qn(n,e,t){if(!Array.isArray(n.children))return null;let r=[];for(let i of n.children){let o=jr(i,e+1,t);o&&r.push(o)}return r.length===0?null:{kind:"group",operator:n.operator==="or"?"or":"and",children:r,...n.not===!0?{not:!0}:{}}}function eo(n,e,t){return e<=_n&&t.nodes<Kn&&n!=null&&typeof n=="object"}function jr(n,e,t){if(!eo(n,e,t)||t.ancestors.has(n))return null;t.ancestors.add(n),t.nodes++;let r=n,i=r.kind==="condition"?Zn(r,t):r.kind==="group"?Qn(r,e,t):null;return t.ancestors.delete(n),i}function z(n,e){if(n==null||typeof n!="object")return null;let t=n;if(t.version!==1||t.root==null)return null;let r=jr(t.root,0,{ancestors:new WeakSet,nodes:0,validColumnIds:e});return r?{version:1,root:r}:null}function to(n,e){return{kind:"condition",colId:n,filter:e}}function Q(n,e){if(n==null||typeof n!="object"||Array.isArray(n))return{};let t={};for(let[r,i]of Object.entries(n).slice(0,Un)){let o=r.trim();if(!o||e?.has(o)===!1)continue;let s=Wt(i);s&&(t[o]=s)}return t}function ro(n,e,t={}){return{kind:"group",operator:n,children:e,...t.not?{not:!0}:{}}}function F(n,e,t=!1){if(!(typeof n!="number"||!Number.isFinite(n)||n<e))return t?Math.floor(n):n}function Be(n){return!n||typeof n.key!="string"||!n.key.trim()?null:{key:n.key.trim(),debounceMs:F(n.debounceMs,0,!0)??160,...n.sections?{sections:[...new Set(n.sections)]}:{},...n.store?{store:n.store}:{}}}function A(n,e,t,r=!1){let i=!1;for(let o of t)(r?Object.prototype.hasOwnProperty.call(n,o):n[o]!=null)&&(e[o]=n[o],i=!0);return i}var $t={align:"center",sortable:!0,resizable:!0,movable:!0,filter:!1,minWidth:80},ve={compact:{rowHeight:30,headerHeight:34,fontSize:12,cellPadding:6},normal:{rowHeight:36,headerHeight:40,fontSize:13,cellPadding:9},large:{rowHeight:44,headerHeight:48,fontSize:14,cellPadding:12}},be={multiSort:!0,stripedRows:!1,showCellBorders:!1,quickFilterText:null,suppressCellFocus:!1,suppressRowHoverHighlight:!1,suppressNoRowsOverlay:!1,suppressHeaderFocus:!1,loading:!1,error:null,className:"",singleClickEdit:!1,manualSorting:!1,manualFiltering:!1,showSummary:!1,indexOffset:0,applyRowDrag:!0,masterDetail:!1,detailToggleColumn:!0,treeData:!1,childrenKey:"children",autoCheckedChildren:!0,defaultExpandAll:!1,columnMenu:!1,suppressWarnings:!1,enableRangeSelection:!1,suppressClipboard:!1,contextMenu:!1,flashCells:!0,fillHandle:!0,ariaLabel:"MachTable data grid",ariaLabelledBy:"",ariaDescribedBy:"",overlayNoRowsTemplate:"",overlayLoadingTemplate:"",overlayErrorTemplate:"",allowUnsafeOverlayHtml:!1},io=Object.keys(be);function no(n){let e={};for(let t of io)e[t]=n[t]??be[t];return e}function I(n,e,t,r=!1){return F(n,t,r)??e}function oo(n){return n&&Object.prototype.hasOwnProperty.call(ve,n)?n:"normal"}function so(n){return n.theme==="light"||n.theme==="dark"||n.theme==="auto"?n.theme:"light"}function ao(n,e){let t=typeof n.pagination=="object"&&Array.isArray(n.pagination.pageSizeOptions)?n.pagination.pageSizeOptions:void 0,r=t?[...new Set(t.map(i=>I(i,0,1,!0)).filter(Boolean))]:[10,20,50,100];return r.includes(e)||r.push(e),r.sort((i,o)=>i-o)}function Ut(n,e){let t=typeof n=="function"?n(e):K(e,n);return t==null?"":String(t)}function lo(n){let e=n.rowKey,t=e?({data:r})=>Ut(e,r):void 0;return{...t?{resolveRowId:t}:{},...e?{rowKey:e}:{}}}function co(n,e){let t=ve[e];return{columnDefs:Array.isArray(n.columnDefs)?n.columnDefs:[],rowData:Array.isArray(n.rowData)?n.rowData:[],defaultColDef:{...$t,...n.defaultColDef??{}},columnTypes:n.columnTypes??{},...lo(n),rowHeight:I(n.rowHeight,t.rowHeight,1),headerHeight:I(n.headerHeight,t.headerHeight,1),rowBuffer:I(n.rowBuffer,8,0,!0),columnLayout:n.columnLayout==="fit"?"fit":"normal",enableColumnResize:n.enableColumnResize===!0,domLayout:n.domLayout==="autoHeight"?"autoHeight":"normal",rowSelection:n.rowSelection==="single"||n.rowSelection==="multiple"?n.rowSelection:"none",size:e,pinnedTopRowData:Array.isArray(n.pinnedTopRowData)?n.pinnedTopRowData:[],pinnedBottomRowData:Array.isArray(n.pinnedBottomRowData)?n.pinnedBottomRowData:[]}}function uo(n){return{rowStyleRules:Array.isArray(n.rowStyleRules)?n.rowStyleRules:[],theme:so(n)}}function ho(n){return{editType:n.editType==="fullRow"?"fullRow":"cell",editableIndicator:n.editableIndicator==="always"||n.editableIndicator==="none"?n.editableIndicator:"hover",rowDragPolicy:n.rowDragPolicy,undoStackSize:I(n.undoStackSize,100,0,!0),asyncTransactionWaitMillis:I(n.asyncTransactionWaitMillis,16,0,!0)}}function po(n){return{detailRowHeight:I(n.detailRowHeight,240,1)}}function fo(n){let e=typeof n.pagination=="object"?n.pagination:void 0,t=I(e?.pageSize,20,1,!0);return{paginationEnabled:n.pagination!==!1&&n.datasource==null,paginationMode:e?.mode==="server"?"server":"client",paginationPage:I(e?.page,1,1,!0),paginationTotal:I(e?.total,0,0,!0),paginationPageSize:t,paginationPageSizeOptions:ao(n,t),paginationShowTotal:e?e.showTotal!==!1:!0,paginationShowSizeSelector:e?e.showPageSizeSelector!==!1:!0}}function qt(n){return{watermarkEnabled:n.watermark!=null&&n.watermark!==!1,watermarkConfig:n.watermark==null||n.watermark===!1?null:n.watermark===!0?{text:"MachTable"}:n.watermark}}function mo(n){return{advancedFilterModel:z(n.advancedFilterModel),persistence:Be(n.persistence),locale:n.locale??{},tooltipShowDelay:I(n.tooltipShowDelay,600,0),statusBarEnabled:n.statusBar===!0||typeof n.statusBar=="object"&&n.statusBar!=null,statusBarPanels:typeof n.statusBar=="object"&&n.statusBar?.panels?n.statusBar.panels:["rowCount","selectedRowCount","rangeAggregate"]}}function go(n){return{datasourceMode:n.datasourceMode==="block"?"block":"sequential",blockSize:I(n.blockSize,100,1,!0),infiniteBufferRows:I(n.infiniteBufferRows,40,0,!0),maxBlocksInCache:I(n.maxBlocksInCache,12,1,!0),datasourceMaxConcurrentRequests:I(n.datasourceMaxConcurrentRequests,4,1,!0),blockPrefetch:I(n.blockPrefetch,1,0,!0),datasourceRowCount:n.datasourceRowCount==null?null:I(n.datasourceRowCount,0,0,!0),dataProcessorMinRows:I(n.dataProcessorMinRows,5e3,1,!0),datasourceRetryCount:I(n.datasourceRetryCount,2,0,!0),datasourceRetryDelay:I(n.datasourceRetryDelay,300,0,!0),datasourceRetryJitter:Math.min(1,I(n.datasourceRetryJitter,.15,0))}}var yo=["detailRowRenderer","isRowExpandable","aggFuncs","components","actionPolicy","summaryMethod","datasource","getRowHeight","tooltipComponent","getContextMenuItems","initialState","rowEditValidator","isTreeRowExpandable","loadTreeChildren","dataProcessor"];function vo(n,e){for(let t of yo)n[t]&&Reflect.set(e,t,n[t])}function bo(n,e){for(let t of Object.keys(n))t.startsWith("on")&&typeof n[t]=="function"&&Reflect.set(e,t,n[t])}function Yr(n){let e=oo(n.size),t={...no(n),...co(n,e),...uo(n),...ho(n),...po(n),...fo(n),...qt(n),...mo(n),...go(n),features:Array.isArray(n.features)?n.features:[]};return vo(n,t),bo(n,t),t}function Xr(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.length>0):typeof n=="string"&&n.length>0?[n]:[]}function le(n,e){return Xr(n.type).includes(e)}function Jr(n,e,t={}){let r={};for(let i of Xr(n.type)){let o=t[i];o&&Object.assign(r,o)}return{...e,...r,...n}}var $=class{constructor(e,t){this.manualWidth=null;this.contentWidth=null;this.flex=null;this.currentWidth=0;this.parentGroup=null;this.level=0;this.isDetailToggle=!1;this.id=e,this.colDef=t,this.hide=t.hide??!1;let r=t.pinned;this.pinned=r===!0?"left":r===!1||r==null?null:r,this.resetWidth()}get sortable(){return this.colDef.sortable!==!1}get resizable(){return this.colDef.resizable!==!1}get movable(){return this.colDef.movable!==!1}get filterable(){return this.colDef.filter!=null&&this.colDef.filter!==!1}get filterType(){let e=this.colDef.filter;return e===!0?"text":e??"text"}get hasCheckbox(){return this.colDef.checkboxSelection===!0}resetWidth(){this.manualWidth=null,this.contentWidth=null,this.flex=typeof this.colDef.flex=="number"&&Number.isFinite(this.colDef.flex)&&this.colDef.flex>0?this.colDef.flex:null}};var ee=class n{constructor(e,t){this.parent=null;this.children=[];this.groupId=e,this.def=t}get headerName(){return this.def.headerName??this.def.groupId??""}getLeafColumns(e=[]){for(let t of this.children)t instanceof n?t.getLeafColumns(e):e.push(t);return e}};function we(n){return Array.isArray(n.children)}function ze(n,e){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:e}function Zr(n){let e=ze(n.minWidth,80);return{min:e,max:Math.max(e,ze(n.maxWidth,Number.MAX_SAFE_INTEGER))}}function V(n,e){let{min:t,max:r}=Zr(e),i=ze(n,ze(e.width,150));return Math.max(t,Math.min(r,i))}function Qr(n,e){let t=n.map(s=>V(s.width??150,s)),r=[],i=0;n.forEach((s,a)=>{let l=s.flex??0;l>0&&(r.push(a),i+=l)});let o=0;for(let s of t)o+=s;if(i>0&&e>o){let s=e-o;for(let a=0;a<4&&s>.5&&r.length>0;a++){let l=[],d=0;for(let p of r){let m=n[p].flex??0;l.push(p),d+=m}let c=[];for(let p=0;p<l.length;p++){let m=l[p],v=n[m].flex??0,w=s*v/d,C=t[m];t[m]=V(C+w,n[m]),c.push(t[m]-C)}let u=0;for(let p of c)u+=p;s-=u;let h=l.filter((p,m)=>c[m]>.001);if(h.length===l.length)break;r.length=0;for(let p of h)r.push(p)}}return t}function wo(n,e,t){let r=new Set(n.map((o,s)=>s)),i=t;for(let o=0;o<n.length+1&&r.size>0;o++){let s=0;for(let l of r)s+=Math.max(1,e[l]);if(s<=0)break;let a=!1;for(let l of[...r]){let d=i*(Math.max(1,e[l])/s),c=V(d,n[l]),{min:u,max:h}=Zr(n[l]);(d<u||d>h)&&(e[l]=c,i-=c,r.delete(l),a=!0)}if(!a){for(let l of r)e[l]=V(i*(Math.max(1,e[l])/s),n[l]);break}i=Math.max(0,i)}}function Co(n,e,t){let r=t-e.reduce((i,o)=>i+o,0);if(!(Math.abs(r)<=.01))for(let i=e.length-1;i>=0;i--){let o=V(e[i]+r,n[i]);if(Math.abs(o-e[i])>.01){e[i]=o;return}}}function _e(n,e){let t=n.map(r=>V(r.width??150,r));return!Number.isFinite(e)||e<=0||n.length===0||(wo(n,t,e),Co(n,t,e)),t}var jt="__rg_detail_toggle__";function de(n){return typeof n=="number"&&Number.isFinite(n)&&n>0}var Ke=class{constructor(e){this.e=e;this.columns=[];this.Ss=new Map;this.ye=[];this.left=[];this.center=[];this.right=[];this.sortModel=[];this.defs=[];this.At=1;this.vn=new Map;this.dd=0}ar(e){this.defs=e?[...e]:[];let t=new Map(this.columns.map(s=>[s.id,s])),r=this.e.r.defaultColDef,i=new Set(this.e.r.masterDetail&&this.e.r.detailToggleColumn?[jt]:[]),o=(s,a,l)=>s.map((d,c)=>{if(we(d)){let C=d.groupId??d.headerName??`group_${c}_${l}`,R=new ee(C,d);return R.parent=a,R.children=o(d.children,R,l+1),R}let u=d,h=u.colId??u.field??`col_${c}`,p=h,m=2;for(;i.has(p);)p=`${h}_${m++}`;i.add(p);let v=new $(p,Jr(u,r,this.e.r.columnTypes));v.parentGroup=a,v.level=l;let w=t.get(p);return w&&(v.manualWidth=w.manualWidth,v.contentWidth=w.contentWidth,v.flex=w.flex,v.hide=w.hide,v.pinned=w.pinned),v});if(this.ye=o(this.defs,null,0),this.e.r.masterDetail&&this.e.r.detailToggleColumn){let s=new $(jt,{colId:jt,headerName:"",width:38,pinned:"left",sortable:!1,resizable:!1,movable:!1,filter:!1});s.isDetailToggle=!0,this.ye.unshift(s)}if(this.columns=this.Yr(this.ye),this.Ss=new Map(this.columns.map(s=>[s.id,s])),this.At=this.columns.reduce((s,a)=>Math.max(s,a.level+1),1),this.sortModel=this.sortModel.filter(s=>this.columns.some(a=>a.id===s.colId)),this.sortModel.length===0){let s=[];for(let a of this.columns)a.colDef.initialSort&&s.push({colId:a.id,direction:a.colDef.initialSort});this.sortModel=s}this.Lt()}Yr(e,t=[]){for(let r of e)r instanceof ee?this.Yr(r.children,t):t.push(r);return t}Lt(){let e=this.columns.filter(t=>!t.hide);this.left=e.filter(t=>t.pinned==="left"),this.right=e.filter(t=>t.pinned==="right"),this.center=e.filter(t=>t.pinned===null),this.vn.clear(),this.c().forEach((t,r)=>this.vn.set(t.id,r))}Me(e){return this.vn.get(e)??-1}X(){return this.columns}Xr(){return this.defs}cd(){return this.ye}ud(){return this.At}L(e){return this.Ss.get(e)}C(e){return e==="left"?this.left:e==="right"?this.right:this.center}c(){return[...this.left,...this.center,...this.right]}ze(){return this.c().filter(e=>e.colDef.rowGroup===!0)}hd(){return this.c().filter(e=>e.colDef.aggFunc!=null&&e.colDef.rowGroup!==!0)}bn(){return this.center.some(e=>e.colDef.colSpan!=null)}Ms(){let e=this.c();return this.center.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e.find(t=>!t.hasCheckbox&&!t.isDetailToggle)??e[0]}lr(e){return e.pinned==="left"?"left":e.pinned==="right"?"right":"center"}Is(e){this.dd=e;let t=0;for(let c of[...this.left,...this.right])c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),t+=c.currentWidth;let r=Math.max(0,e-t),i=[],o=[];for(let c of this.center)(c.colDef.suppressSizeToFit||c.manualWidth!=null?o:i).push(c);let s=0;for(let c of o)c.currentWidth=V(c.manualWidth??c.contentWidth??c.colDef.width??150,this.ct(c)),s+=c.currentWidth;let a=i.map(c=>this.ct(c)),l=Math.max(0,r-s),d=this.e.r.columnLayout==="fit"?_e(a,l):Qr(a,l);i.forEach((c,u)=>{c.currentWidth=d[u]})}ct(e){let t=e.colDef;return{width:e.manualWidth??e.contentWidth??t.width,minWidth:t.minWidth,maxWidth:t.maxWidth,flex:e.manualWidth==null?e.flex??void 0:void 0}}Ie(e,t){return de(t)?(e.manualWidth=V(t,this.ct(e)),e.flex=null,!0):!1}As(e,t){return de(t)?(e.resetWidth(),e.contentWidth=V(t,this.ct(e)),!0):!1}wn(e,t){let r=this.L(e);!r||r.hide===!t||(r.hide=!t,this.Lt())}ut(e,t){let r=this.L(e);if(!r)return!1;let i=this.lr(r),o=u=>r.parentGroup?!0:this.lr(u)===i,s=r.parentGroup?r.parentGroup.children:this.ye,a=s.filter(u=>u instanceof $&&!u.hide&&o(u)),l=a.indexOf(r);if(l<0)return!1;a.splice(l,1);let d=Math.max(0,Math.min(t,a.length));a.splice(d,0,r);let c=[];return s.forEach((u,h)=>{u instanceof $&&!u.hide&&o(u)&&c.push(h)}),c.length!==a.length?!1:(c.forEach((u,h)=>{s[u]=a[h]}),this.columns=this.Yr(this.ye),this.Lt(),!0)}Cn(e,t){let r=this.L(e);!r||!r.movable||(r.pinned=t,this.Lt())}Jr(){return this.columns.map(e=>({colId:e.id,hide:e.hide,width:e.manualWidth??e.currentWidth,flex:e.flex,widthMode:e.manualWidth==null?"auto":"manual",contentWidth:e.contentWidth??void 0,pinned:e.pinned}))}Ls(e){let t=new Map(e.map(r=>[r.colId,r]));for(let r of this.columns){let i=t.get(r.id);i&&this.pd(r,i)}this.fd(e),this.Lt()}pd(e,t){typeof t.hide=="boolean"&&(e.hide=t.hide),t.widthMode==="auto"?(e.resetWidth(),de(t.flex)&&(e.flex=t.flex)):de(t.flex)?(e.flex=t.flex,e.manualWidth=null):de(t.width)&&(e.manualWidth=V(t.width,this.ct(e)),e.flex=null),de(t.contentWidth)&&(e.contentWidth=V(t.contentWidth,this.ct(e))),e.movable&&(t.pinned==="left"||t.pinned==="right"||t.pinned===null)&&(e.pinned=t.pinned)}fd(e){let t=new Map;e.forEach((i,o)=>t.set(i.colId,o));let r=i=>i.pinned==="left"?"left":i.pinned==="right"?"right":"center";for(let i of["left","center","right"]){let o=this.ye.filter(d=>d instanceof $&&!d.hide&&d.parentGroup===null&&r(d)===i);if(o.length<2)continue;let s=o.filter(d=>d.movable),a=s.slice().sort((d,c)=>(t.get(d.id)??Number.MAX_SAFE_INTEGER)-(t.get(c.id)??Number.MAX_SAFE_INTEGER));if(a.every((d,c)=>d===s[c]))continue;let l=[];this.ye.forEach((d,c)=>{d instanceof $&&!d.hide&&d.parentGroup===null&&r(d)===i&&d.movable&&l.push(c)}),l.forEach((d,c)=>{this.ye[d]=a[c]})}this.columns=this.Yr(this.ye)}Tn(){for(let e of this.columns){e.resetWidth(),e.hide=e.colDef.hide??!1;let t=e.colDef.pinned;e.pinned=t===!0?"left":t===!1||t==null?null:t}this.Lt()}U(){return this.sortModel.map(e=>({...e}))}dr(e){if(!e||e.length===0){this.sortModel=[];return}this.sortModel=e.filter(t=>this.columns.some(r=>r.id===t.colId)&&(t.direction==="asc"||t.direction==="desc")).map(t=>({colId:t.colId,direction:t.direction}))}Zr(e,t){let r=[...this.sortModel],i=r.findIndex(l=>l.colId===e.id),o=i>=0?r[i].direction:null,s=o===null?"asc":o==="asc"?"desc":null;t&&this.e.r.multiSort?s===null?i>=0&&r.splice(i,1):i>=0?r[i]={colId:e.id,direction:s}:r.push({colId:e.id,direction:s}):(r.length=0,s&&r.push({colId:e.id,direction:s})),this.sortModel=r}};function te(n,e){if(n instanceof Error)return n;let t=new Error(typeof n=="string"?n:e);return t.name="AbortError",t}var To=()=>te(void 0,"[MachTable] Operation cancelled.");function We(n,e,t=To){return e?new Promise((r,i)=>{let o=()=>{e.removeEventListener("abort",o),i(t())};if(n.then(r,i).finally(()=>e.removeEventListener("abort",o)),e.aborted){o();return}e.addEventListener("abort",o,{once:!0})}):n}function ti(n){return n==null?"":String(n).toLowerCase()}function Do(n,e,t){let r=ti(n),i=o=>{let s=(o.value??"").toLowerCase();switch(o.match){case"contains":return r.includes(s);case"notContains":return!r.includes(s);case"equals":return r===s;case"notEquals":return r!==s;case"startsWith":return r.startsWith(s);case"endsWith":return r.endsWith(s);case"blank":return r==="";case"notBlank":return r!=="";default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Eo(n,e,t){switch(t.match){case"equals":return n===e;case"notEquals":return n!==e;case"lessThan":return n<e;case"lessThanOrEqual":return n<=e;case"greaterThan":return n>e;case"greaterThanOrEqual":return n>=e;case"inRange":return n>=e&&n<=(t.value2??e);default:return!0}}function xo(n,e){let t=n==null||n==="";if(e.match==="blank")return t;if(e.match==="notBlank")return!t;if(t)return!1;let r=typeof n=="number"?n:Number(n);if(Number.isNaN(r))return!1;let i=e.value;return i==null||Number.isNaN(i)?!1:Eo(r,i,e)}function Ro(n,e,t){let r=i=>xo(n,i);return e.length===0||(t==="or"?e.some(r):e.every(r))}function Yt(n){if(n==null||n==="")return null;if(n instanceof Date)return isNaN(n.getTime())?null:n.getTime();if(typeof n=="number")return n;let e=Date.parse(String(n));return isNaN(e)?null:e}function So(n,e,t){let r=Yt(n),i=o=>{let s=r==null;if(o.match==="blank")return s;if(o.match==="notBlank")return!s;if(s)return!1;let a=r,l=o.value!=null?Yt(o.value):null;if(l==null)return!1;switch(o.match){case"equals":return a===l;case"notEquals":return a!==l;case"lessThan":return a<l;case"greaterThan":return a>l;case"inRange":{let d=o.value2!=null?Yt(o.value2):null;return d!=null?a>=l&&a<=d:a>=l}default:return!0}};return e.length===0||(t==="or"?e.some(i):e.every(i))}function Mo(n,e){return e.length===0?!0:e.some(t=>t==null&&n==null||t===n)}function ri(n,e){let t=e.type!=="set"&&e.operator==="or"?"or":"and";switch(e.type){case"text":return Do(n,e.conditions,t);case"number":return Ro(n,e.conditions,t);case"date":return So(n,e.conditions,t);case"set":return Mo(n,e.values);default:return!0}}function ii(n,e,t){if(n.kind==="condition"){let i=e.get(n.colId);return i?o=>ri(t(o,i),n.filter):()=>!0}let r=n.children.map(i=>ii(i,e,t));return i=>{let o=n.operator==="or"?r.some(s=>s(i)):r.every(s=>s(i));return n.not?!o:o}}function Xt(n,e,t,r,i){let o=new Map(n.map(d=>[d.id,d])),s=Object.entries(e).flatMap(([d,c])=>{let u=o.get(d);return u?[{column:u,filter:c}]:[]}),a=t?ii(t.root,o,i):()=>!0,l=r?.trim().toLowerCase().split(/\s+/).filter(Boolean)??[];return d=>!s.every(({column:c,filter:u})=>ri(i(d,c),u))||!a(d)?!1:l.every(c=>n.some(u=>ti(i(d,u)).includes(c)))}var ni=typeof Intl<"u"?new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}):null;function Io(n,e){let t=n==null||n==="",r=e==null||e==="";return!t&&!r?null:t&&r?0:t?1:-1}function Ao(n,e){let t=Number.isNaN(n),r=Number.isNaN(e);return t||r?t===r?0:t?1:-1:n-e}function Lo(n,e){return n===e?0:n?1:-1}function $e(n,e){let t=Io(n,e);if(t!==null)return t;if(typeof n=="number"&&typeof e=="number")return Ao(n,e);if(n instanceof Date&&e instanceof Date)return n.getTime()-e.getTime();if(typeof n=="boolean"&&typeof e=="boolean")return Lo(n,e);let r=String(n),i=String(e);return ni?ni.compare(r,i):r.localeCompare(i)}function Jt(n,e,t,r){let i=new Map(t.map(a=>[a.id,a])),o=e.flatMap(a=>{let l=i.get(a.colId);return l?[{column:l,compare:l.colDef.comparator??$e,direction:a.direction}]:[]}),s=n.map(a=>({node:a,values:o.map(({column:l})=>r(a,l))}));return s.sort((a,l)=>{for(let d=0;d<o.length;d++){let c=o[d],u=c.compare(a.values[d],l.values[d],a.node,l.node);if(u!==0)return c.direction==="asc"?u:-u}return 0}),s.map(({node:a})=>a)}function oi(){return{count:0,numeric:0,sum:0,min:1/0,max:-1/0}}function si(n,e){n.count++,!(typeof e!="number"||!Number.isFinite(e))&&(n.numeric++,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e))}function ai(n,e){return e==="count"?n?.count??0:n?.numeric?e==="min"?n.min:e==="max"?n.max:Number.isFinite(n.sum)?e==="avg"?n.sum/n.numeric:n.sum:null:null}function Ue(n,e){let t=oi();for(let r of n)si(t,r);return ai(t,e)}var qe={sum:n=>Ue(n,"sum"),avg:n=>Ue(n,"avg"),count:n=>n.length,min:n=>Ue(n,"min"),max:n=>Ue(n,"max"),first:n=>n.length>0?n[0]:null,last:n=>n.length>0?n[n.length-1]:null};function li(n,e,t){if(e===qe.count)return n.length;let r=["sum","avg","min","max"].find(o=>e===qe[o]);if(!r)return e(n.map(t));let i=oi();for(let o of n)si(i,t(o));return ai(i,r)}function Zt(n){let e={...qe,...n??{}};return t=>e[t]}var je="group:";function di(n){return n==null?"null":n instanceof Date?JSON.stringify(["date",String(n.getTime())]):JSON.stringify([typeof n,Qt(n)])}function Qt(n){return n==null?"(\u7A7A)":String(n)}function ci(n){return je+JSON.stringify(n)}function ko(n,e,t){let r=new Map;for(let i of n){let o=t(i,e),s=di(o),a=r.get(s);a||(a={key:s,label:Qt(o),rows:[]},r.set(s,a)),a.rows.push(i)}return[...r.values()].sort((i,o)=>i.label.localeCompare(o.label,void 0,{numeric:!0,sensitivity:"base"})||i.key.localeCompare(o.key))}function ui(n,e,t,r,i){let o=[],s=(a,l,d)=>{if(l===e.length)return{display:a,leaves:a};let c=[],u=[];for(let h of ko(a,e[l],t)){let p=[...d,[e[l].id,h.key]],m=ci(p);o.push(m);let v=s(h.rows,l+1,p);if(c.push({id:m,data:null,rowIndex:-1,selected:!1,isGroup:!0,groupLevel:l,groupKey:h.label,leafNodes:v.leaves,aggValues:r(v.leaves)}),i.has(m))for(let w of v.display)c.push(w);if(l>0)for(let w of v.leaves)u.push(w)}return{display:c,leaves:u}};return{rows:s(n,0,[]).display,ids:o}}function hi(n,e,t,r){let i=new Set([...n].filter(l=>l.startsWith("/g0:")));if(!i.size)return{expanded:n,ambiguous:[]};let o=new Map;for(let l of e){let d=[],c="";for(let u=0;u<t.length;u++){let h=r(l,t[u]);if(d.push([t[u].id,di(h)]),c+=`/g${u}:${Qt(h)}`,!i.has(c))continue;let p=ci(d);o.set(c,o.has(c)&&o.get(c)!==p?null:p)}}let s=new Set([...n].filter(l=>!i.has(l))),a=[];for(let l of i){let d=o.get(l);d?s.add(d):d===null?a.push(l):s.add(l)}return{expanded:s,ambiguous:a}}function Po(n,e){let t=n?[n.root]:[];for(;t.length;){let r=t.pop();if(r.kind==="condition")e.add(r.colId);else for(let i of r.children)t.push(i)}}function pi(n){let e=new Set(Object.keys(n.filterModel));Po(n.advancedFilter,e);let t=new Set(n.sortModel.map(a=>a.colId));for(let a of t)e.add(a);let r=n.columns.some(a=>a.colDef.rowGroup===!0),i=!!n.quickFilter?.trim(),o=n.columns.filter(a=>e.has(a.id)||i||a.colDef.rowGroup===!0||r&&a.colDef.aggFunc!=null),s=new Set;for(let a of o){let l=a.colDef;if(r&&l.rowGroup!==!0&&l.aggFunc!=null&&n.customAggregates?.[l.aggFunc]||l.valueGetter||t.has(a.id)&&l.comparator||!l.field)return null;s.add(l.field)}return[...s]}function fi(n){return n!=null&&(typeof n=="object"||typeof n=="function")}function mi(n,e){let t=new WeakMap;for(let r of n){if(r.data==null)continue;let i=e.map(o=>K(r.data,o));i.some(fi)||t.set(r,i)}return t}function gi(n,e,t,r){return t.length?!r||n===e||n==null||e==null?!0:t.some((i,o)=>{let s=K(e,i);return fi(s)||!Object.is(r[o],s)}):!1}function re(n){return te(n.reason,"Block request aborted")}function Ye(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):1}var Xe=class{constructor(e,t,r=4){this.maxBlocks=e;this.En=t;this.maxConcurrentRequests=r;this.J=new Map;this.q=new Map;this.ks=0;this.generation=0;this.hitCount=0;this.missCount=0;this.evictionCount=0;this.Qr=0;this.ei=new Set;this.maxBlocks=Ye(e),this.maxConcurrentRequests=Ye(r)}configure(e,t=this.maxConcurrentRequests){this.maxBlocks=Ye(e),this.maxConcurrentRequests=Ye(t),this.Dn(),this.ti()}md(e){this.ei=e,this.Dn()}peek(e){let t=this.J.get(e);if(t)return t.touchedAt=++this.ks,t}has(e){return this.J.has(e)}invalidate(e){let t=this.q.get(e);t&&(this.q.delete(e),t.controller.abort(),t.state==="queued"&&t.reject(re(t.controller.signal)));let r=this.J.get(e);r&&(this.J.delete(e),this.En?.(e,r))}load(e,t,r,i=0){if(r?.aborted)return Promise.reject(re(r));let o=this.peek(e);if(o)return this.hitCount++,Promise.resolve(o);let s=this.q.get(e);if(s)return this.hitCount++,s.priority=Math.max(s.priority,i),this.ti(),this.Ps(e,s,r);this.missCount++;let a=new AbortController,l,d,c=new Promise((p,m)=>{l=p,d=m}),u={controller:a,promise:c,consumers:0,loader:t,priority:i,state:"queued",resolve:l,reject:d};this.q.set(e,u);let h=this.Ps(e,u,r);return this.ti(),h}gd(){this.generation++,this.ei.clear();for(let e of this.q.values())e.controller.abort(),e.state==="queued"&&e.reject(re(e.controller.signal));this.q.clear();for(let[e,t]of this.J)this.En?.(e,t);this.J.clear()}snapshot(){let e=0,t=0;for(let r of this.J.values())e+=r.rows.length;for(let r of this.q.values())r.state==="active"&&t++;return{cachedBlockCount:this.J.size,loadingBlockCount:this.q.size,activeRequestCount:t,queuedRequestCount:Math.max(0,this.q.size-t),cachedRowCount:e,hitCount:this.hitCount,missCount:this.missCount,evictionCount:this.evictionCount}}ti(){for(;this.Qr<this.maxConcurrentRequests;){let e,t;for(let[r,i]of this.q)i.state!=="queued"||i.controller.signal.aborted||(!t||i.priority>t.priority)&&(e=r,t=i);if(e==null||!t)return;this.yd(e,t)}}yd(e,t){t.state="active",this.Qr++;let r=this.generation;this.vd(t).then(i=>{r===this.generation&&!t.controller.signal.aborted&&(this.J.set(e,{rows:i.rows,...i.lastRow==null?{}:{lastRow:i.lastRow},touchedAt:++this.ks}),this.Dn()),t.resolve(i)},t.reject).finally(()=>{this.Qr=Math.max(0,this.Qr-1),this.q.get(e)===t&&this.q.delete(e),this.ti()})}vd(e){let{signal:t}=e.controller;return We(Promise.resolve().then(()=>{if(t.aborted)throw re(t);return e.loader(t)}),t,()=>re(t))}Ps(e,t,r){return t.consumers++,new Promise((i,o)=>{let s=!1,a=d=>{s||(s=!0,r?.removeEventListener("abort",l),t.consumers=Math.max(0,t.consumers-1),d())},l=()=>a(()=>{t.consumers===0&&this.q.get(e)===t&&(this.q.delete(e),t.controller.abort(r?.reason),t.state==="queued"&&t.reject(re(t.controller.signal))),o(re(r))});r?.addEventListener("abort",l,{once:!0}),t.promise.then(d=>a(()=>i(d)),d=>a(()=>o(d instanceof Error?d:new Error(String(d??"Block request failed")))))})}Dn(){let e=Math.max(this.maxBlocks,this.ei.size+1);for(;this.J.size>e;){let t=-1,r=Number.POSITIVE_INFINITY;for(let[o,s]of this.J)this.ei.has(o)||s.touchedAt<r&&(t=o,r=s.touchedAt);if(t<0)return;let i=this.J.get(t);this.J.delete(t),this.evictionCount++,i&&this.En?.(t,i)}}};function Ce(n,e){if(n==null||typeof n!="object")return;let t=n[e];return Array.isArray(t)?t:void 0}var Je=class{constructor(e){this.e=e;this.all=[];this.H=[];this.Z=new Map;this.displayed=[];this.h=new Map;this.filterModel={};this.advancedFilterModel=null;this.quickFilter=null;this.k=new Set;this.K=new Set;this.kt=[];this.cr=new Map;this.Gs=[];this.P=null;this.Pt=!1;this.Ns=!1;this._e=0;this.ri=null;this.ii=null;this.ni=new WeakMap;this.ur=new WeakMap;this.Ke=new Map;this.hr=new Map;this.pr=0;this.oi=0;this.We=null;this.$e=new Map;this.ht=new Map;this.si=new Set;this.pt=new Map;this.Ue=new Xe(12,e=>this.Fs(e));this.fr=0;this.ai=null;this.xn=!1;this.Os=0;this.te=[];this.page=1;this.pageSize=20;this.advancedFilterModel=z(e.r.advancedFilterModel)}resolveRowId(e,t,r){let i=this.e.r.resolveRowId;if(!i)return r;try{let o=i({data:e,index:t,api:this.e.api});if(typeof o=="string"&&o.length>0)return o;this.e.reportError(new Error("rowKey must resolve to a non-empty identifier"),"rowKey",{index:t})}catch(o){this.e.reportError(o,"rowKey",{index:t})}return r}get N(){return this.e.r.treeData}get p(){return this.e.r.datasource!=null}get ue(){return this.p&&this.e.r.datasourceMode==="block"}Gt(){if(this.p){if(this.ue)return this.Nt();let e=Math.max(0,this.displayed.length-this.all.length);return(this.P??this.all.length)+e}return this.displayed.length}Rn(){return this.pr}mr(){return this.oi}bd(){return this.Ns}li(e){return!this.p||e?.aborted?Promise.resolve():(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.P=null,this.Pt=!1,this.all=[],this.H=[],this.h.clear(),this.k.clear(),this.e.O.clear(),this.b(),this.e.u({data:!0}),this.ue?(this.Ue.configure(this.e.r.maxBlocksInCache,this.e.r.datasourceMaxConcurrentRequests),this.ci(0,e)):this.Hs(0,void 0,e))}ft(e){this.Ns=e,this.e.o.ft(e,this.e.g("loading"))}Hs(e,t,r){if(!this.p||this.Pt||this.P!=null&&e>=this.P)return Promise.resolve();let i=this.e.r.blockSize,o=t??e+i;if(o<=e)return Promise.resolve();let s=++this._e,a=new AbortController,l=()=>a.abort(r?.reason);return r?.addEventListener("abort",l,{once:!0}),this.ri=a,this.Pt=!0,this.ft(!0),new Promise(d=>{let c=!1;this.ii=d;let u=h=>{c||(c=!0,r?.removeEventListener("abort",l),s===this._e&&(this.Pt=!1,this.ri=null,this.ii=null,this.ft(!1),h!=null&&h?.name!=="AbortError"&&this.e.reportError(h,"datasource.getRows",{startRow:e,endRow:o})),d())};this.Vs(e,o,a.signal,(h,p)=>{if(s!==this._e||this.e.s()||a.signal.aborted){u();return}typeof p=="number"&&p>=0?this.P=p:h.length<o-e&&(this.P=e+h.length);let m=this.all.length===0;this.wd(h),u(),this.b(),this.e.u({data:!0}),m&&this.e.he(),this.e.B.ui()},h=>u(a.signal.aborted||this.e.s()?void 0:h??new Error("Datasource request failed")))})}di(){this._e++,this.ri?.abort(),this.ri=null,this.Pt=!1,this.ft(!1),this.ii?.(),this.ii=null,this.Ue.gd(),this.$e.clear(),this.ht.clear(),this.si.clear();for(let[e,t]of this.pt)this.h.get(e)===t&&this.h.delete(e);this.pt.clear()}wd(e){for(let t of e){if(t==null)continue;let r=this.all.length,i=this.resolveRowId(t,r,`inf-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"datasource.getRows",{rowId:i});continue}let o={id:i,data:t,rowIndex:-1,selected:this.e.m.Sn(i)};this.all.push(o),this.h.set(i,o),this.H.push(o)}}ci(e,t,r=0){if(!this.ue||e<0)return Promise.resolve();if(t?.aborted)return Promise.reject(this.Bs(t.reason));let i=this.e.r.blockSize,o=this._e,s=e*i;if(s>=this.Nt())return Promise.resolve();let a=this.P==null?s+i:Math.min(this.P,s+i),l=this.Ue.load(e,d=>this.Cd(s,a,d),t,r);return this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0),l.then(d=>{o!==this._e||t?.aborted||this.e.s()||!this.ue||!this.Ue.has(e)||this.si.has(e)||(this.Td(e,d),this.b(),this.e.u({data:!0}),this.e.B.ui(),o===this._e&&!this.e.s()&&this.zs(this.e.a.Mn().lastExcl-1))}).catch(d=>{throw d?.name!=="AbortError"&&this.e.reportError(d,"datasource.getRows",{startRow:s,endRow:a}),d}).finally(()=>{o===this._e&&this.ft(this.all.length===0&&this.Ue.snapshot().loadingBlockCount>0)})}Cd(e,t,r){return new Promise((i,o)=>{this.Vs(e,t,r,(s,a)=>i({rows:s,...typeof a=="number"&&a>=0?{lastRow:a}:{}}),s=>o(s instanceof Error?s:new Error(typeof s=="string"?s:"Datasource request failed")))})}Vs(e,t,r,i,o){let s=this.e.r.datasource,a=0,l=null,d=!1,c=p=>{d||(d=!0,l!=null&&clearTimeout(l),r.removeEventListener("abort",u),p())},u=()=>c(()=>o(this.Bs(r.reason)));r.addEventListener("abort",u,{once:!0});let h=()=>{if(d)return;if(r.aborted||this.e.s()){u();return}a++;let p=!1,m=v=>{if(!(p||d)){if(p=!0,r.aborted||this.e.s()){u();return}a<=this.e.r.datasourceRetryCount?l=setTimeout(h,this.retryDelay(a)):c(()=>o(v))}};try{let v=s.getRows({startRow:e,endRow:t,sortModel:this.e.n.U(),filterModel:this.j(),advancedFilterModel:this.be(),quickFilterText:this.quickFilter,signal:r,onSuccess:(w,C)=>{p||d||(p=!0,c(()=>i(w??[],C)))},fail:m});v&&typeof v.catch=="function"&&v.catch(m)}catch(v){m(v)}};h()}Td(e,t){let r=this.e.r.blockSize,i=e*r;this.Fs(e),typeof t.lastRow=="number"&&t.lastRow>=0?this.P=t.lastRow:t.rows.length<r&&(this.P=i+t.rows.length),t.rows.forEach((o,s)=>{if(o==null)return;let a=i+s;if(this.P!=null&&a>=this.P)return;let l=this.resolveRowId(o,a,`block-${a}`),d=this.pt.get(l),c=this.h.get(l);if(c&&c!==d&&c.rowIndex!==a){this.e.reportError(new Error(`Duplicate row id: ${l}`),"datasource.getRows",{rowId:l});return}let u=d??{id:l,data:o,rowIndex:a,selected:this.e.m.Sn(l)};u.rowIndex=a,u.selected=this.e.m.Sn(l),this.pt.delete(l),this.$e.set(a,u),this.ht.delete(a),this.h.set(l,u),this.ur.set(u,a+1)}),this._s(),this.si.add(e)}Fs(e){this.si.delete(e);let t=this.e.r.blockSize,r=e*t,i;for(let o=r;o<r+t;o++){let s=this.$e.get(o);s&&(i??(i=new Set(this.e.V.getDirtyRowIds())),this.$e.delete(o),i.has(s.id)?this.pt.set(s.id,s):this.h.get(s.id)===s&&this.h.delete(s.id))}this._s()}_s(){this.all=[...this.$e.entries()].sort(([e],[t])=>e-t).map(([,e])=>e),this.H=this.all}Nt(){if(this.P!=null)return this.P;if(this.e.r.datasourceRowCount!=null)return this.e.r.datasourceRowCount;if(this.$e.size===0)return this.e.r.blockSize;let e=0;for(let t of this.$e.keys())e=Math.max(e,t+1);return e+this.e.r.blockSize}Dd(e){let t=this.ht.get(e);if(!t&&(t={id:`__mach_loading_${e}`,data:null,rowIndex:e,selected:!1,loading:!0},this.ht.set(e,t),this.ht.size>2e3)){let r=this.ht.keys().next().value;r!=null&&this.ht.delete(r)}return t}Bs(e){return te(e,"Operation aborted")}retryDelay(e){let t=Math.min(this.e.r.datasourceRetryDelay*2**Math.max(0,e-1),3e4),r=this.e.r.datasourceRetryJitter;return Math.max(0,Math.round(t*(1+(Math.random()*2-1)*r)))}Ed(e){if(this.ue){this.zs(e);return}if(!this.p||this.Pt)return;let t=this.all.length;if(this.P!=null&&t>=this.P)return;let r=this.e.r.infiniteBufferRows;if(e+r<t&&e<t)return;let i=this.e.r.blockSize,o=this.P==null?t+i:Math.min(this.P,t+i);this.Hs(t,o)}zs(e){if(e<0)return;this.Ks();let t=this.e.r.blockSize,r=Math.floor(e/t),i=Math.floor(this.e.a.Mn().first/t),o=this.e.r.blockPrefetch,s=r<this.Os?-1:1;this.Os=r;for(let a=i;a<r;a++)this.ci(a,void 0,o+2).catch(()=>{});for(let a=0;a<=o;a++){let l=a===0?[r]:[r+s*a,r-s*a];for(let d of l)d<0||d*t>=this.Nt()||this.ci(d,void 0,o-a+1).catch(()=>{})}}Ae(){return this.li().catch(()=>{})}xd(){return this.di(),this.p?this.li().catch(()=>{}):(this.P=null,this.qe(this.e.r.rowData),this.e.u({data:!0}),Promise.resolve())}destroy(){this.We=null,this.di(),this.Ws(),this.In(),this.all=this.H=this.displayed=this.te=[],this.h.clear(),this.Z.clear(),this.cr.clear(),this.Gs=[],this.k.clear(),this.K.clear(),this.kt=[]}An(e,t,r){if(!this.ue)return Promise.resolve();this.Ks();let i=this.e.r.blockSize,o=Math.max(0,Math.trunc(e)),s=Math.min(this.Nt(),Math.max(o,Math.trunc(t))),a=Math.floor(o/i),l=Math.max(a,Math.floor(Math.max(o,s-1)/i)),d=[];for(let c=a;c<=l;c++)d.push(this.ci(c,r,100));return Promise.all(d).then(()=>{})}Ln(){this.ue&&(this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.e.V.clear(),this.di(),this.e.O.clear(),this.all=[],this.H=[],this.h.clear(),this.b(),this.e.u({data:!0}))}kn(){return this.Ue.snapshot()}Ks(){let e=new Set(this.e.V.getDirtyRowIds());for(let[l,d]of this.pt)e.has(l)||(this.pt.delete(l),this.h.get(l)===d&&this.h.delete(l));let t=this.e.r.blockSize,r=new Set,{first:i,lastExcl:o}=this.e.a.Mn();for(let l=i;l<o;l+=t)r.add(Math.floor(l/t));o>i&&r.add(Math.floor((o-1)/t));let s=this.e.a.T;s&&r.add(Math.floor(s.rowIndex/t));let a=this.e.l.Rd();a!=null&&r.add(Math.floor(a/t)),this.Ue.md(r)}qe(e){this.oi++,this.e.ve(),this.e.api.editing.stop({cancel:!0}),this.Ws(),this.e.V.clear();let t=this.e.r.resolveRowId,r=this.e.r.childrenKey,i=[],o=[],s=new Map,a=new Map,l=0,d=(c,u,h)=>{let p=l++,m=this.resolveRowId(c,p,`auto-${p}`);if(s.has(m))return this.e.reportError(new Error(`Duplicate row id: ${m}`),"rowData",{rowId:m,index:p}),null;let v=this.N?Ce(c,r):void 0,w={id:m,data:c,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(v)};if(this.ni.set(w,u),i.push(w),s.set(m,w),h!=null){let C=a.get(h)??[];C.push(m),a.set(h,C)}else o.push(w);if(this.N&&Array.isArray(v))for(let C of v)C!=null&&d(C,u+1,m);return w};(e??[]).forEach(c=>{c!=null&&d(c,0,null)}),this.all=i,this.H=o,this.Z=a,this.h=s,this.e.O.clear();for(let c of[...this.k])s.has(c)||this.k.delete(c);if(this.e.r.defaultExpandAll)for(let c of i)this.$s(c.id)>0&&this.k.add(c.id);this.e.m.Us(t!=null),this.b()}gr(e){return this.Z.get(e)??[]}$s(e){return this.Z.get(e)?.length??0}Pn(e){return this.$s(e)>0}isTreeRowLoading(e){return this.h.get(e)?.treeLoading===!0}Ws(){for(let e of this.Ke.values())e.abort();this.Ke.clear(),this.hr.clear()}loadTreeChildren(e,t=!1){let r=this.h.get(e),i=this.e.r.loadTreeChildren;if(!this.N||!r?.data||!i)return Promise.resolve([]);if(!t&&r.treeChildrenLoaded)return Promise.resolve(this.gr(e).flatMap(l=>{let d=this.h.get(l)?.data;return d==null?[]:[d]}));let o=this.hr.get(e);if(o&&!t)return o;this.Ke.get(e)?.abort();let s=new AbortController;this.Ke.set(e,s),r.treeLoading=!0,r.treeLoadError=void 0,this.e.u({data:!0});let a=Promise.resolve().then(()=>i({data:r.data,node:r,api:this.e.api,signal:s.signal})).then(l=>{if(s.signal.aborted||this.e.s())return[];if(!Array.isArray(l))throw new TypeError("[MachTable] loadTreeChildren must resolve to an array.");return this.Sd(r,l),r.treeChildrenLoaded=!0,r.treeLoadError=void 0,this.e.emit("treeChildrenLoaded",{rowId:e,rowNode:r,children:l}),l}).catch(l=>{if(s.signal.aborted||l?.name==="AbortError")return[];throw r.treeLoadError=l,r.treeChildrenLoaded=!1,this.e.reportError(l,"treeData.loadChildren",{rowId:e}),this.e.emit("treeChildrenLoadFailed",{rowId:e,rowNode:r,error:l}),l}).finally(()=>{this.Ke.get(e)===s&&(this.Ke.delete(e),this.hr.delete(e),r.treeLoading=!1,this.e.u({data:!0}))});return this.hr.set(e,a),a}Sd(e,t){let r=new Set,i=[...this.gr(e.id)];for(;i.length>0;){let s=i.pop();r.has(s)||(r.add(s),i.push(...this.gr(s)))}this.Md(t,r);for(let s of r)this.Ke.get(s)?.abort(),this.Ke.delete(s),this.hr.delete(s),this.Z.delete(s),this.h.delete(s),this.k.delete(s);this.Z.delete(e.id);let o=this.Gn(e)+1;for(let s of t)s!=null&&this.Nn(e,s,o);this.qs(),this.e.m.Us(this.e.r.resolveRowId!=null),this.b(),this.e.u({data:!0})}Md(e,t){let r=this.e.r.resolveRowId,i=r?new Set([...this.h.keys()].filter(l=>!t.has(l))):null,o=new WeakSet,s=[...e],a=0;for(;s.length>0;){let l=s.pop();if(l==null)continue;if(typeof l=="object"){if(o.has(l))throw new TypeError("[MachTable] Lazy tree children contain a cyclic object graph.");o.add(l)}if(r&&i){let c=r({data:l,index:a++,api:this.e.api});if(typeof c!="string"||c.length===0)throw new TypeError("[MachTable] rowKey must resolve to a non-empty identifier for lazy tree children.");if(i.has(c))throw new Error(`Duplicate row id: ${c}`);i.add(c)}let d=Ce(l,this.e.r.childrenKey);d&&s.push(...d)}}yr(e,t=!0){let r=this.e.r.resolveRowId,i=[],o=[],s=[];if(e.remove?.length){let l=new Set,d=new Set,c=h=>{if(r){let m=[this.resolveRowId(h,-1,`__missing_remove_${this.e.Ft()}`)];for(;m.length>0;){let v=m.pop();if(!l.has(v)){l.add(v);for(let w of this.Z.get(v)??[])m.push(w)}}}else{let p=[h];for(;p.length>0;){let m=p.pop();d.add(m);let v=this.N?Ce(m,this.e.r.childrenKey):void 0;if(v)for(let w of v)p.push(w)}}};e.remove.forEach(c),this.all=this.all.filter(h=>{let p=l.has(h.id)||h.data!=null&&d.has(h.data);return p&&(s.push(h.id),this.h.delete(h.id),this.Z.delete(h.id)),!p});let u=new Set(this.all);this.H=this.H.filter(h=>u.has(h))}if(e.update?.length)for(let l of e.update){let d;r?d=this.h.get(this.resolveRowId(l,-1,`__missing_update_${this.e.Ft()}`)):d=this.all.find(c=>c.data===l),d&&(o.push({node:d,before:d.data,after:l}),d.data=l,s.push(d.id),this.e.a.hi(d),i.push(d))}if(e.add?.length){let l=e.addIndex!=null?Math.max(0,Math.min(e.addIndex,this.H.length)):this.H.length,d=[];e.add.forEach((c,u)=>{let h=this.resolveRowId(c,l+u,`add-${this.e.Ft()}`);if(this.h.has(h)){this.e.reportError(new Error(`Duplicate row id: ${h}`),"transaction.add",{rowId:h});return}let p={id:h,data:c,rowIndex:-1,selected:!1};this.h.set(h,p),this.ni.set(p,0);let m=this.N?Ce(c,this.e.r.childrenKey):void 0;if(m)for(let v of m)v!=null&&this.Nn(p,v,1);d.push(p)}),this.H=this.H.slice(0,l).concat(d,this.H.slice(l)),this.qs()}let a={pipelineChanged:this.Id(e,o),updatedRowIds:i.map(l=>l.id)};return this.Ad(a,t),this.e.V.Ld(s),a}Ad(e,t){e.pipelineChanged&&(this.We=null),t&&(e.pipelineChanged?this.b():e.updatedRowIds.length&&this.js())}kd(e){if(e.length===0)return{pipelineChanged:!1,updatedRowIds:[]};let t=!1,r=new Set;for(let i of e){let o=this.yr(i,!1);t||(t=o.pipelineChanged);for(let s of o.updatedRowIds)r.add(s)}return t?this.b():r.size>0&&this.js(),{pipelineChanged:t,updatedRowIds:[...r]}}Id(e,t){if(e.add?.length||e.remove?.length)return!0;if(!t.length)return!1;let r=this.Ys();if(r===null)return!0;if(!r.length)return!1;let i=this.We;return!i||r.length!==i.fields.length||r.some((o,s)=>o!==i.fields[s])?!0:t.some(({node:o,before:s,after:a})=>gi(s,a,r,i.values.get(o)))}Ys(){if(this.N||this.e.r.masterDetail||this.e.r.getRowHeight||this.Xs())return null;let e=this.e.n.c();if(e.some(r=>r.colDef.autoHeight===!0||r.colDef.autoRowSpan===!0||r.colDef.rowSpan!=null))return null;let t=!this.e.r.manualFiltering;return pi({columns:e,customAggregates:this.e.r.aggFuncs,sortModel:this.e.r.manualSorting?[]:this.e.n.U(),filterModel:t?this.filterModel:{},advancedFilter:t?this.advancedFilterModel:null,quickFilter:t?this.quickFilter:null})}Pd(){let e=this.Ys();this.We=e?.length?{fields:e,values:mi(this.all,e)}:null}js(){this.e.emit("modelUpdated",{rowCount:this.te.length})}Nn(e,t,r){let i=this.resolveRowId(t,-1,`add-${this.e.Ft()}`);if(this.h.has(i)){this.e.reportError(new Error(`Duplicate row id: ${i}`),"transaction.add",{rowId:i});return}let o=Ce(t,this.e.r.childrenKey),s={id:i,data:t,rowIndex:-1,selected:!1,treeChildrenLoaded:Array.isArray(o)};this.h.set(i,s),this.ni.set(s,r);let a=this.Z.get(e.id)??[];if(a.push(s.id),this.Z.set(e.id,a),!!o)for(let l of o)l!=null&&this.Nn(s,l,r+1)}qs(){this.all=[];let e=t=>{this.all.push(t),this.h.has(t.id)||this.h.set(t.id,t);for(let r of this.Z.get(t.id)??[]){let i=this.h.get(r);i&&e(i)}};for(let t of this.H)e(t)}vr(e){let t=JSON.stringify(this.filterModel),r=new Set(this.e.n.X().map(o=>o.id));this.filterModel=Q(e,r);let i=JSON.stringify(this.filterModel)!==t;return i&&(this.We=null),i}j(){return{...this.filterModel}}Ot(e){let t=new Set(this.e.n.X().map(s=>s.id)),r=z(e,t),i=JSON.stringify(this.advancedFilterModel);this.advancedFilterModel=r,this.e.r.advancedFilterModel=r;let o=JSON.stringify(r)!==i;return o&&(this.We=null),o}be(){return z(this.advancedFilterModel)}Ht(e){let t=e!=null&&e.trim()!==""?e:null;return t===this.quickFilter?!1:(this.quickFilter=t,this.We=null,!0)}br(){return this.quickFilter}Fn(){return Object.keys(this.filterModel).length>0||this.advancedFilterModel!=null||this.quickFilter!=null}b(){this.We=null;let e=this.e.re.start(),t=this.e.n.c(),r=(a,l)=>this.e.d(a,l);if(this.p){this.Gd(e);return}if(this.Nd(e))return;let i,o=[];if(this.N)i=this.Fd(t,r);else{i=this.all,this.Fn()&&!this.e.r.manualFiltering&&(i=i.filter(Xt(t,this.filterModel,this.advancedFilterModel,this.quickFilter,r)));let l=this.e.n.U();if(l.length>0&&!this.e.r.manualSorting)try{i=Jt(i,l,t,r)}catch(c){this.e.reportError(c,"comparator",{sortModel:l})}let d=this.e.n.ze();if(d.length>0){let c=this.Od(i,d);i=c.rows,o=c.ambiguousExpansions}else if(this.e.r.masterDetail){let c=[];for(let u of i)c.push(u),this.k.has(u.id)&&this.isRowExpandable(u)&&c.push({id:`__detail__${u.id}`,data:u.data,rowIndex:-1,selected:!1,isDetail:!0,masterId:u.id});i=c}}for(let a of this.all)a.rowIndex=-1;let s=0;i.forEach((a,l)=>{a.rowIndex=l,!a.isDetail&&!a.isGroup&&(s++,this.ur.set(a,s))}),this.te=i,this.Vt(),this.Pd(),this.Js(r),this.e.emit("modelUpdated",{rowCount:i.length}),this.e.re.On(e),this.Hd(o)}Gd(e){this.all.forEach((t,r)=>{this.ue||(t.rowIndex=r),this.ur.set(t,this.ue?t.rowIndex+1:r+1)}),this.displayed=this.all,this.te=this.all,this.cr.clear(),this.pr++,this.e.emit("modelUpdated",{rowCount:this.all.length}),this.e.re.On(e)}Nd(e){let t=this.xn;return this.xn=!1,!t&&this.Xs()?(this.Vd(e),!0):(this.In(),!1)}Xs(){if(!this.e.r.dataProcessor||this.all.length<this.e.r.dataProcessorMinRows||this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return!1;let e=!this.e.r.manualFiltering&&this.Fn(),t=!this.e.r.manualSorting&&this.e.n.U().length>0;return e||t}Vd(e){this.In();let t=this.e.r.dataProcessor;if(!t)return;let r=++this.fr,i=new AbortController;this.ai=i;let o=this.e.n.c(),s=this.all.flatMap(d=>d.data==null?[]:[{id:d.id,data:d.data}]),a=!this.e.r.manualFiltering,l=!this.e.r.manualSorting;Promise.resolve().then(()=>t.process({rows:s,columns:o.map(d=>({colId:d.id,...d.colDef.field?{field:d.colDef.field}:{}})),sortModel:l?this.e.n.U():[],filterModel:a?this.j():{},advancedFilterModel:a?this.be():null,quickFilterText:a?this.quickFilter:null,signal:i.signal})).then(d=>{if(r!==this.fr||i.signal.aborted||this.e.s())return;let c=new Set,u=[];for(let p of d.rowIds){if(c.has(p))continue;c.add(p);let m=this.h.get(p);m&&!m.isDetail&&!m.isGroup&&u.push(m)}for(let p of this.all)p.rowIndex=-1;u.forEach((p,m)=>{p.rowIndex=m,this.ur.set(p,m+1)}),this.te=u,this.Vt();let h=(p,m)=>this.e.d(p,m);this.Js(h),this.e.emit("modelUpdated",{rowCount:u.length}),this.e.re.On(e),this.e.u({data:!0})}).catch(d=>{r!==this.fr||i.signal.aborted||this.e.s()||(this.e.reportError(d,"dataProcessor.process"),this.xn=!0,this.b(),this.e.u({data:!0}))}).finally(()=>{r===this.fr&&(this.ai=null)})}In(){this.fr++,this.ai?.abort(),this.ai=null}get we(){return this.e.r.paginationEnabled&&!this.p}Vt(){if(!this.we){this.displayed=this.te,this.pr++;return}let e=this.wr(),t=this.getPageCount();if(this.page>t&&(this.page=t),this.page<1&&(this.page=1),this.e.r.paginationPage=this.page,this.e.r.paginationMode==="server"){this.te.forEach((o,s)=>{o.rowIndex=s}),this.displayed=this.te,this.pr++;return}let r=(this.page-1)*e,i=this.te.slice(r,r+e);i.forEach((o,s)=>{o.rowIndex=s}),this.displayed=i,this.pr++}wr(){return this.pageSize=this.e.r.paginationPageSize,Math.max(1,this.pageSize)}Cr(){return this.we?this.page:1}getTotalRowCount(){return this.p?this.Gt():this.we&&this.e.r.paginationMode==="server"?this.e.r.paginationTotal:this.te.length}getPageCount(){return this.we?Math.max(1,Math.ceil(this.getTotalRowCount()/this.wr())):1}Zs(){return this.te}setPage(e,t=!1){if(!this.we)return;let r=this.getPageCount(),i=Math.max(1,Math.min(Math.round(e)||1,r));i!==this.page&&(this.page=i,this.e.r.paginationPage=i,this.Vt(),this.e.u({data:!0}),this.e.a.Bt(0,"top"),t||this.pi())}setPageSize(e){if(!this.we)return;let t=Math.max(1,Math.round(e)||this.wr()),r=(this.page-1)*this.wr();this.e.r.paginationPageSize=t,this.pageSize=t,this.page=Math.floor(r/t)+1,this.e.r.paginationPage=this.page,this.Vt(),this.e.u({data:!0}),this.pi()}Qs(e,t){this.pageSize=Math.max(1,Math.round(t)||1),this.e.r.paginationPageSize=this.pageSize,this.page=Math.max(1,Math.round(e)||1),this.e.r.paginationPage=this.page}fi(e){this.e.r.paginationEnabled!==e&&(this.e.r.paginationEnabled=e&&!this.p,this.e.r.paginationEnabled&&(this.page=1),this.Vt(),this.e.u({data:!0}),this.pi())}Bd(){this.we&&(this.page=this.e.r.paginationMode==="server"?this.e.r.paginationPage:1,this.Vt(),this.e.u({data:!0}),this.pi())}pi(){this.e.emit("paginationChanged",{page:this.Cr(),pageSize:this.wr(),pageCount:this.getPageCount(),total:this.getTotalRowCount()})}Fd(e,t){let r=this.e.r.manualSorting?[]:this.e.n.U(),i=new Map,o=this.Fn()&&!this.e.r.manualFiltering,s=Xt(e,this.filterModel,this.advancedFilterModel,this.quickFilter,t),a=c=>{let u=i.get(c.id);if(u!==void 0)return u;let h=!0;if(o){h=s(c);for(let p of this.Z.get(c.id)??[]){let m=this.h.get(p);m&&a(m)&&(h=!0)}}return i.set(c.id,h),h},l=[],d=c=>{let u=c;r.length>0&&(u=Jt(c,r,e,t));for(let h of u)if(a(h)&&(l.push(h),this.k.has(h.id))){let p=(this.Z.get(h.id)??[]).map(m=>this.h.get(m)).filter(m=>m!=null);d(p)}};return d(this.H),l}zd(){let e=this.Gs,t=0;for(let r of this.displayed)!r.isDetail&&!r.isGroup&&(e[t++]=r);return e.length=t,e}_d(e,t,r,i){let o=t.colDef.rowSpan;if(!o)return 1;try{let s=o({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:r,rowIndex:e.rowIndex});return Math.max(1,Math.min(Math.round(s)||1,i))}catch(s){return this.e.reportError(s,"rowSpan",{colId:t.id,rowId:e.id}),1}}Kd(e,t,r,i,o){if(!r.colDef.autoRowSpan||i==null||i==="")return 1;let s=1;for(;t+s<e.length&&$e(i,o(e[t+s],r))===0;)s++;return s}Wd(e,t,r){let i=new Int32Array(e.length),o=0;for(;o<e.length;){let s=e[o],a=r(s,t),l=t.colDef.rowSpan?this._d(s,t,a,e.length-o):this.Kd(e,o,t,a,r);i[o]=l;for(let d=1;d<l;d++)i[o+d]=-1;o+=l}return i}Js(e){if(this.cr.clear(),this.N||this.e.r.masterDetail||this.e.n.ze().length>0)return;let t=this.e.n.c().filter(i=>i.colDef.rowSpan!=null||i.colDef.autoRowSpan===!0);if(t.length===0)return;let r=this.zd();if(r.length!==0)for(let i of t)this.cr.set(i.id,this.Wd(r,i,e))}$d(e){return this.cr.get(e)}ea(e){return this.ur.get(e)??0}Gn(e){return this.ni.get(e)??0}Od(e,t){let r=Zt(this.e.r.aggFuncs),i=this.e.n.hd();this.kt=[];let o=l=>{let d={};for(let c of i){let u=r(c.colDef.aggFunc);if(u)try{d[c.id]=li(l,u,h=>this.e.d(h,c))}catch(h){this.e.reportError(h,"aggFunc",{colId:c.id,aggFunc:c.colDef.aggFunc}),d[c.id]=null}}return d},s=hi(this.K,this.all,t,(l,d)=>this.e.d(l,d));this.K=s.expanded;let a=ui(e,t,(l,d)=>this.e.d(l,d),o,this.K);return this.kt=a.ids,{rows:a.rows,ambiguousExpansions:s.ambiguous}}Hd(e){for(let t of e){if(this.e.s())return;this.e.reportError(new Error(`Ambiguous legacy group expansion: ${t}`),"gridState.groupExpansion",{groupId:t})}}isRowExpandable(e){if(this.N){if(this.Pn(e.id)||e.treeLoading)return!0;if(e.treeChildrenLoaded||!e.data||!this.e.r.loadTreeChildren)return!1;let r=this.e.r.isTreeRowExpandable;if(!r)return!1;try{return r({data:e.data,node:e,api:this.e.api})}catch(i){return this.e.reportError(i,"isTreeRowExpandable",{rowId:e.id}),!1}}if(!this.e.r.masterDetail)return!1;let t=this.e.r.isRowExpandable;if(t)try{return t({data:e.data,node:e,api:this.e.api})}catch(r){return this.e.reportError(r,"isRowExpandable",{rowId:e.id}),!1}return!0}isRowExpanded(e){return this.k.has(e)}Ud(){return[...this.k]}qd(){return[...this.K]}jd(e,t){this.k=new Set(e.filter(r=>this.h.has(r))),this.K=new Set(t)}Hn(e){return this.Vn(e,!0)}Bn(e){return this.Vn(e,!1)}mi(e){return this.Vn(e,!this.k.has(e))}Vn(e,t){let r=this.h.get(e);return!r||t&&!this.isRowExpandable(r)?!1:(t===this.k.has(e)||(t?this.k.add(e):this.k.delete(e),this.b(),this.e.u({data:!0}),this.e.emit("detailToggled",{rowId:e,rowNode:r,expanded:t}),t&&this.N&&!this.Pn(e)&&!r.treeLoading&&this.loadTreeChildren(e).catch(()=>{})),t)}zn(){let e=!1;for(let t of this.all)!this.k.has(t.id)&&this.isRowExpandable(t)&&(this.k.add(t.id),e=!0);e&&(this.b(),this.e.u({data:!0}))}_n(){this.k.size!==0&&(this.k.clear(),this.b(),this.e.u({data:!0}))}Kn(e){return this.setGroupExpanded(e,!this.K.has(e))}isGroupExpanded(e){return this.K.has(e)}Wn(){if(this.kt.length===0)return;let e=!1;for(let t of this.kt)this.K.has(t)||(this.K.add(t),e=!0);e&&(this.b(),this.e.u({data:!0}))}$n(){this.K.size!==0&&(this.K.clear(),this.b(),this.e.u({data:!0}))}setGroupExpanded(e,t){return!this.kt.includes(e)||t===this.K.has(e)||(t?this.K.add(e):this.K.delete(e),this.b(),this.e.u({data:!0})),t}ta(){return!this.N&&!this.p&&!this.e.r.dataProcessor&&this.e.r.paginationMode!=="server"&&this.e.n.U().length===0&&this.e.n.ze().length===0}ra(e,t){if(!this.ta()||!Number.isInteger(e)||!Number.isInteger(t))return!1;let r=this.f(e),i=this.f(t);if(!r||!i||r.isDetail||i.isDetail||r.isGroup||i.isGroup)return!1;let o=this.all.indexOf(r),s=this.all.indexOf(i);return o<0||s<0||o===s?!1:(this.all.splice(o,1),this.all.splice(s,0,r),this.b(),this.e.u({data:!0}),!0)}pe(){return this.all}Yd(){return this.H}je(){return this.displayed}I(){return this.ue?this.Nt():this.displayed.length}f(e){return this.ue?e<0||e>=this.Nt()?void 0:this.$e.get(e)??this.Dd(e):this.displayed[e]}z(e){return this.h.get(e)}Un(e){this.all.forEach(e)}qn(e){let t=0;for(let r of this.te)r.isDetail||r.isGroup||e(r,t++)}};var Ze=class{constructor(e){this.e=e;this.R=new Set;this.Le=null;this.Tr=new Set}Sn(e){return this.R.has(e)}Xd(e){return this.Tr.has(e)}ke(e){if(e.loading)return!1;let t=this.Jd(e),r=t?.colDef.selectable;if(!t||!r)return!0;try{return r({api:this.e.api,colDef:t.colDef,column:t,node:e,data:e.data,value:this.e.d(e,t),rowIndex:e.rowIndex})}catch(i){return this.e.reportError(i,"selectable",{rowId:e.id,colId:t?.id}),!1}}Jd(e){if(!(e.isGroup||e.isDetail))return this.e.n.c().find(t=>t.hasCheckbox&&t.colDef.selectable!=null)}Pe(){return this.e.i.pe().filter(e=>this.R.has(e.id))}gi(){return this.Pe().filter(e=>e.data!=null).map(e=>e.data)}yi(){return[...this.R]}Zd(e){let t=new Set(e),r=this.e.i.pe().filter(i=>t.has(i.id)&&!i.isDetail&&!i.isGroup).map(i=>({node:i,selected:!0}));this.fe(r,!0)}Us(e){if(!e)this.R.clear(),this.Le=null;else{let t=new Set(this.e.i.pe().map(r=>r.id));for(let r of[...this.R])t.has(r)||this.R.delete(r);this.Le!=null&&!t.has(this.Le)&&(this.Le=null)}for(let t of this.e.i.pe())t.selected=this.R.has(t.id);this.ia()}na(e){let t=e.leafNodes??[];if(t.length===0)return{all:!1,some:!1};let r=0,i=0;for(let o of t)this.ke(o)&&(r++,this.R.has(o.id)&&i++);return r===0?{all:!1,some:!1}:{all:i===r,some:i>0}}Qd(e,t){let r=(e.leafNodes??[]).filter(i=>this.ke(i));r.length!==0&&this.fe(r.map(i=>({node:i,selected:t})))}oa(e,t,r=!1){this.fe([{node:e,selected:t,clearOthers:r}])}jn(e,t=!0,r=!0){let i=this.e.i.z(e);i&&this.oa(i,t,r)}ec(e,t){let r=t==="single";this.fe([{node:e,selected:r?!0:!e.selected,clearOthers:r}]),this.Le=e.id}tc(e,t,r){return!r||!t.ctrlKey&&!t.metaKey?!1:(this.fe([{node:e,selected:!e.selected}]),this.Le=e.id,!0)}rc(e,t,r){if(!r||!t.shiftKey||this.Le==null)return!1;let i=this.e.i.z(this.Le);if(!i||i.rowIndex<0||e.rowIndex<0)return!1;let o=Math.min(i.rowIndex,e.rowIndex),s=Math.max(i.rowIndex,e.rowIndex),a=[];for(let l=o;l<=s;l++){let d=this.e.i.f(l);d&&!d.isDetail&&!d.isGroup&&this.ke(d)&&a.push({node:d,selected:!0})}return this.fe(a),!0}sa(e,t,r){let i=this.e.r.rowSelection;if(i==="none"||!this.ke(e))return;if(r){this.ec(e,i);return}let o=i==="multiple";this.tc(e,t,o)||this.rc(e,t,o)||(this.fe([{node:e,selected:!0,clearOthers:!0}]),this.Le=e.id)}selectAll(e=!0){let t=this.e.r.rowSelection;if(t==="none")return;let i=(e?this.e.i.je():this.e.i.pe()).filter(o=>!o.isDetail&&!o.isGroup&&this.ke(o));if(i.length!==0){if(t==="single"){this.fe([{node:i[0],selected:!0,clearOthers:!0}]);return}this.fe(i.map(o=>({node:o,selected:!0})))}}deselectAll(){this.fe([],!0)}ic(){let t=this.e.i.je().filter(r=>!r.isDetail&&!r.isGroup).filter(r=>this.ke(r));if(t.length===0)return!1;if(this.e.i.p){let r=this.e.i.Gt();if(t.length<r)return!1}return t.every(r=>this.R.has(r.id))}nc(){let t=this.e.i.je().filter(i=>!i.isDetail&&!i.isGroup).filter(i=>this.ke(i)),r=t.reduce((i,o)=>i+(this.R.has(o.id)?1:0),0);if(r===0)return!1;if(this.e.i.p){let i=this.e.i.Gt();if(t.length<i)return!0}return r>0&&r<t.length}oc(e,t=!1){this.fe(e,t)}sc(e,t,r){!t&&!e.some(i=>i.clearOthers)||(this.R=t?new Set:new Set(e.filter(i=>i.selected).flatMap(i=>r?this.aa(i.node):[i.node.id])))}ac(e,t){for(let r of e){if(!this.ke(r.node))continue;let i=t?this.aa(r.node):[r.node.id];for(let o of i)r.selected?this.R.add(o):this.R.delete(o)}}lc(e){let t=new Set;for(let r of new Set([...e,...this.R]))e.has(r)!==this.R.has(r)&&t.add(r);return t}dc(e,t,r){let i=[],o=new Set([...e,...r,...this.Tr]);for(let s of this.e.i.pe()){let a=this.R.has(s.id);s.selected=a,(o.has(s.id)||t.get(s.id)!==a)&&s.rowIndex>=0&&i.push(s.rowIndex)}return i}fe(e,t=!1){let r=new Set(this.R),i=this.e.i.N&&this.e.r.autoCheckedChildren;this.sc(e,t,i),this.ac(e,i);let o=this.lc(r),s=new Map;for(let d of this.e.i.pe())s.set(d.id,d.selected);let a=new Set(this.Tr);this.ia();let l=this.dc(o,s,a);o.size>0&&(this.e.a.Ye(l),this.e.B.ui(),this.e.emit("selectionChanged",{selectedNodes:this.Pe(),selectedRows:this.gi()}))}aa(e){let t=[e.id],r=i=>{for(let o of this.e.i.gr(i))t.push(o),r(o)};return r(e.id),t}ia(){if(this.Tr.clear(),!this.e.i.N)return;let e=t=>{let r=this.e.i.gr(t);if(r.length===0)return{all:this.R.has(t),some:this.R.has(t)};let i=!0,o=!1;for(let s of r){let a=e(s);a.all?o=!0:(a.some&&(o=!0),i=!1)}return o&&!i&&this.Tr.add(t),i?this.R.add(t):this.R.delete(t),{all:i,some:o}};for(let t of this.e.i.Yd())e(t.id);for(let t of this.e.i.pe())t.selected=this.R.has(t.id)}};var Qe=class{constructor(e){this.e=e;this.active=null;this.Q=0;this.Xe=0;this.Ce=null;this.mt=null;this.Je=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),!this.Q&&(this.Q=requestAnimationFrame(()=>{this.Q=0,this.hc()})))};this.Te=e=>{let t=this.Xn(e);t&&(this.Xe=this.ua(t,e.clientX),t.didResize||(t.didResize=Math.abs(this.Xe-t.startWidth)>=.5),this.pc(t))};this.yt=e=>{this.Xn(e)&&this.gt()};this.la=()=>{this.gt()}}cc(e,t){if(!this.e.r.enableColumnResize||!t.resizable||e.isPrimary===!1)return;this.gt();let r=e.currentTarget,i=t.currentWidth;this.Xe=i,this.active={column:t,didResize:!1,handle:r,pointerId:e.pointerId,startFlex:t.flex,startManualWidth:t.manualWidth,startWidth:i,startX:e.clientX},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te,!0),window.addEventListener("pointercancel",this.yt,!0),r.addEventListener("lostpointercapture",this.la);try{r.setPointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.add("mach-root--resizing"),r.classList.add("mach-header-resize--active"),this.uc(this.active)}gt(e=!0){let t=this.active;t&&(this.active=null,this.Yn(),this.da(t),e&&(t.column.manualWidth=t.startManualWidth,t.column.flex=t.startFlex,this.e.Ze()),this.e.o.root.classList.remove("mach-root--resizing"),this.ca(t))}pc(e){this.active=null,this.Yn(),e.didResize&&(Math.abs(this.Xe-e.startWidth)<.5?(e.column.manualWidth=e.startManualWidth,e.column.flex=e.startFlex):this.e.n.Ie(e.column,this.Xe),this.e.Ze()),this.da(e);try{e.handle.releasePointerCapture?.(e.pointerId)}catch{}this.e.o.root.classList.remove("mach-root--resizing"),this.ca(e),e.didResize&&this.e.zt([e.column])}hc(){let e=this.active;!e||!this.e.n.Ie(e.column,this.Xe)||(this.e.Ze(),this.Dr(e),this.e.ha(e.column,!1))}uc(e){this.Ce=document.createElement("div"),this.Ce.className="mach-column-resize-guide",this.Ce.setAttribute("aria-hidden","true"),this.mt=document.createElement("span"),this.mt.className="mach-column-resize-label",this.Ce.appendChild(this.mt),this.e.o.root.appendChild(this.Ce),this.Dr(e)}Dr(e){if(!this.Ce||!this.mt)return;let t=this.e.o.root,r=t.getBoundingClientRect(),i=e.handle.parentElement.getBoundingClientRect(),o=Math.max(0,Math.min(t.clientWidth,i.right-r.left-t.clientLeft)),s=Math.max(32,Math.min(t.clientWidth-32,o));this.Ce.style.left=`${o}px`,this.Ce.style.top=`${Math.max(0,i.top-r.top-t.clientTop)}px`,this.mt.style.left=`${s-o}px`,this.mt.textContent=`${Math.round(e.column.currentWidth)} px`}ca(e){e.handle.classList.remove("mach-header-resize--active"),this.Ce?.remove(),this.Ce=null,this.mt=null}ua(e,t){let r=Number.isFinite(t)?t:e.startX;return e.startWidth+r-e.startX}Xn(e){let t=this.active;return t&&e.pointerId===t.pointerId?t:null}Yn(){this.Q&&cancelAnimationFrame(this.Q),this.Q=0}da(e){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te,!0),window.removeEventListener("pointercancel",this.yt,!0),e.handle.removeEventListener("lostpointercapture",this.la)}destroy(){this.gt(!1),this.Yn(),this.e.o.root?.classList.remove("mach-root--resizing")}};var yi=6,et=class{constructor(e){this.e=e;this.pending=null;this._t=null;this.Jn=!1;this.ie=0;this.vi=null;this.Je=e=>{if(this._t){this.gc(e);return}let t=this.pending;t&&(Math.abs(e.clientX-t.startX)<yi&&Math.abs(e.clientY-t.startY)<yi||this.yc(e))};this.Te=e=>{this.pending=null,e.type!=="pointercancel"&&this._t&&this.eo(e.clientX,e.clientY),this.Zn();let t=this.pa();t&&e.type!=="pointercancel"&&t.targetIndex>=0&&this.e.ut(t.column.id,t.targetIndex)}}fc(e,t){e.button===0&&t.movable&&(this.pending={column:t,startX:e.clientX,startY:e.clientY},window.addEventListener("pointermove",this.Je),window.addEventListener("pointerup",this.Te),window.addEventListener("pointercancel",this.Te))}mc(){let e=this.Jn;return this.Jn=!1,e}yc(e){let t=this.pending;if(!t)return;let r=this.vc(t.column);if(!r||!r.parentElement){this.Zn();return}this.Jn=!0;let i=f("div","mach-drop-indicator"),o=f("div","mach-column-drag-ghost");o.textContent=t.column.colDef.headerName??t.column.colDef.field??t.column.id,o.ariaHidden="true",P(o,this.e.o.root),document.body.appendChild(o),r.parentElement.appendChild(i),r.classList.add("mach-header-cell--dragging"),this.e.o.root.classList.add("mach-root--dragging");let s=this.e.a.Qn(t.column),a=this.e.o.Kt[s],l=this.e.n.C(s),d=new Float64Array(l.length+1),c=new Float64Array(l.length);for(let h=0;h<l.length;h++){let p=l[h].currentWidth;c[h]=d[h]+p/2,d[h+1]=d[h]+p}let u=o.getBoundingClientRect();this._t={column:t.column,cellEl:r,ghost:o,indicator:i,targetIndex:-1,pane:s,containerLeft:a.getBoundingClientRect().left,startScrollLeft:this.e.o.S.center.scrollLeft,fromIndex:l.indexOf(t.column),midpoints:c,offsets:d,ghostWidth:u.width,ghostHeight:u.height},this.eo(e.clientX,e.clientY)}vc(e){let t=this.e.a.Qn(e);return this.e.o.Kt[t].querySelector(`.mach-header-cell[data-col-id="${Go(e.id)}"]`)}gc(e){this.vi={clientX:e.clientX,clientY:e.clientY},!this.ie&&(this.ie=requestAnimationFrame(()=>{this.ie=0;let t=this.vi;this.vi=null,t&&this.eo(t.clientX,t.clientY)}))}eo(e,t){let r=this._t;if(!r)return;let i=E(e+12,8,window.innerWidth-r.ghostWidth-8),o=E(t+12,8,window.innerHeight-r.ghostHeight-8);r.ghost.style.transform=`translate3d(${i}px, ${o}px, 0)`;let s=r.pane==="center"?this.e.o.S.center.scrollLeft-r.startScrollLeft:0,a=e-(r.containerLeft-s),l=r.midpoints.length;for(let d=0;d<r.midpoints.length;d++)if(a<r.midpoints[d]){l=d;break}r.targetIndex=l>r.fromIndex?l-1:l,r.indicator.style.transform=`translate3d(${r.offsets[l]}px, 0, 0)`}pa(){let e=this._t;return e?(this._t=null,e.cellEl.classList.remove("mach-header-cell--dragging"),e.ghost.remove(),e.indicator.remove(),this.e.o.root.classList.remove("mach-root--dragging"),e):null}Zn(){window.removeEventListener("pointermove",this.Je),window.removeEventListener("pointerup",this.Te),window.removeEventListener("pointercancel",this.Te),this.ie&&cancelAnimationFrame(this.ie),this.ie=0,this.vi=null}destroy(){this.Zn(),this.pa(),this.pending=null}};function Go(n){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(n):n.replace(/[^a-zA-Z0-9_-]/g,"\\$&")}var er=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;function tt(n,e=!0){if(n==="")return null;if(!e||typeof n!="string"||!er.test(n)||/^[+-]?0\d/.test(n))return n;let t=Number(n);return Number.isFinite(t)&&(!Number.isInteger(t)||Number.isSafeInteger(t))?t:n}function No(n,e){let t=n==null?"":String(n);return t.includes(e)||t.includes('"')||t.includes(`
|
|
2
2
|
`)||t.includes("\r")?'"'+t.replace(/"/g,'""')+'"':t}function ce(n){return typeof n!="string"||n===""||er.test(n)?n:/^[\s\u0000-\u001f]*[=+\-@]/.test(n)?"'"+n:n}function vi(n,e={}){let t=e.columnSeparator??",",r=e.protectFormulas??!0,i=n.map(o=>o.map(s=>No(r?ce(s):s,t)).join(t)).join(`\r
|
|
3
3
|
`);return e.prependBOM?"\uFEFF"+i:i}function tr(n){return n==null?"":String(n)}function Fo(n,e){let t=e?ce(n):n,r=tr(t);return/["\t\n\r]/.test(r)?'"'+r.replace(/"/g,'""')+'"':r}function rr(n,e=!0){return n.map(t=>t.map(r=>Fo(r,e)).join(" ")).join(`
|
|
4
4
|
`)}function ir(n){return or(n," ")}function nr(n,e=","){return or(n,e)}function or(n,e){let t=[],r=[],i="",o=!1,s=0;for(;s<n.length;){let a=n[s];if(o){if(a==='"'){if(n[s+1]==='"'){i+='"',s+=2;continue}o=!1,s++;continue}i+=a,s++;continue}if(a==='"'&&i===""){o=!0,s++;continue}if(a===e){r.push(i),i="",s++;continue}if(a===`
|
package/dist/mach-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mach-root{--mach-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;--mach-font-size: 13px;--mach-font-size-sm: 12px;--mach-header-font-weight: 650;--mach-cell-padding: 9px;--mach-row-h: 36px;--mach-header-h: 40px;--mach-primary: #2563eb;--mach-primary-weak: #dbeafe;--mach-success: #16a34a;--mach-warning: #d97706;--mach-danger: #dc2626;--mach-info: #0284c7;--mach-border-color: #e6eaf0;--mach-row-border-color: #eef1f6;--mach-cell-border-color: transparent;--mach-border-width: 1px;--mach-header-border-width: 1px;--mach-header-accent-color: #d9e1eb;--mach-header-bg: #f4f7fb;--mach-header-group-bg: #edf2f8;--mach-header-fg: #344054;--mach-body-bg: #ffffff;--mach-body-fg: #26303f;--mach-row-hover-bg: #f6f8fa;--mach-row-selected-bg: #eff6ff;--mach-zebra-bg: #fafbfd;--mach-cell-focus-color: #2563eb;--mach-focus-width: 1.5px;--mach-scrollbar-thumb: #c9d2dd;--mach-radius-sm: 4px;--mach-radius: 6px;--mach-radius-lg: 8px;--mach-shadow-sm: 0 1px 4px rgba(15, 23, 42, .08);--mach-shadow: 0 6px 20px rgba(15, 23, 42, .12);--mach-transition: .15s ease;--mach-z-overlay: 10;--mach-z-loading: 15;--mach-z-popup: 1000;--mach-z-menu: 1001;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:120px;overflow:hidden;font-family:var(--mach-font-family);font-size:var(--mach-font-size);color:var(--mach-body-fg);background:var(--mach-body-bg);outline:none;box-sizing:border-box;border:1px solid var(--mach-border-color);color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-variant-numeric:tabular-nums;contain:layout style}.mach-root.mach-dom-layout--auto-height{height:auto;min-height:0}.mach-root.mach-dom-layout--auto-height .mach-body{flex:none}.mach-root.mach-dom-layout--auto-height .mach-body-viewport--scroll{overflow-y:hidden}.mach-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:6px 8px;font:13px/1.4 var(--mach-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);color:var(--mach-body-fg, #26303f);background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-bottom:0;border-radius:var(--mach-radius-lg, 8px) var(--mach-radius-lg, 8px) 0 0}.mach-toolbar__main,.mach-toolbar__aside{display:flex;align-items:center;gap:6px;min-width:0}.mach-toolbar__search{display:flex;align-items:center;gap:6px;width:min(240px,32vw);height:32px;padding:0 9px;color:#64748b;background:var(--mach-header-bg, #fafbfd);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease)}.mach-toolbar__search:focus-within{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-toolbar__search input{min-width:0;width:100%;color:inherit;background:transparent;border:0;outline:0}.mach-toolbar__button,.mach-toolbar__select-host,.mach-toolbar__selection{height:32px;padding:0 10px;color:inherit;background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;cursor:pointer;transition:color var(--mach-transition, .15s ease),border-color var(--mach-transition, .15s ease),background var(--mach-transition, .15s ease)}.mach-toolbar__button{min-width:32px;padding:0 8px;font-size:16px}.mach-toolbar__button:hover:not(:disabled),.mach-toolbar__select-host:hover{color:var(--mach-primary, #2563eb);border-color:var(--mach-primary, #2563eb)}.mach-toolbar__button:disabled{cursor:not-allowed;opacity:.45}.mach-toolbar__selection{color:var(--mach-primary, #2563eb);background:var(--mach-primary-weak, #dbeafe);border-color:transparent;font-size:12px}.mach-toolbar__select-host{width:82px;padding:0}.mach-toolbar__select-control,.mach-toolbar__select-control .mach-select-trigger{width:100%;height:100%}.mach-toolbar__select-control .mach-select-trigger{border:0;border-radius:5px;background:transparent;box-shadow:none}@media(max-width:640px){.mach-toolbar{align-items:stretch;flex-direction:column}.mach-toolbar__main,.mach-toolbar__aside{flex-wrap:wrap}.mach-toolbar__search{flex:1;width:auto}}.mach-size--compact{--mach-font-size: 12px;--mach-cell-padding: 6px}.mach-size--normal{--mach-font-size: 13px;--mach-cell-padding: 9px}.mach-size--large{--mach-font-size: 14px;--mach-cell-padding: 12px}.mach-root.mach-cell-borders{--mach-cell-border-color: var(--mach-border-color)}.mach-root.mach-theme-dark,.mach-root.mach-theme-dark.mach-size--compact,.mach-root.mach-theme-dark.mach-size--normal,.mach-root.mach-theme-dark.mach-size--large{--mach-border-color: #26324a;--mach-row-border-color: #1c2740;--mach-header-accent-color: #33415e;--mach-header-bg: #101a2e;--mach-header-group-bg: #16213a;--mach-header-fg: #c3cee0;--mach-body-bg: #0d1526;--mach-body-fg: #dbe4f0;--mach-row-hover-bg: #142138;--mach-row-selected-bg: #14304f;--mach-zebra-bg: #0f1a2e;--mach-cell-focus-color: #60a5fa;--mach-primary: #60a5fa;--mach-primary-weak: #1e3a5f;--mach-scrollbar-thumb: #33415e;--mach-success: #4ade80;--mach-warning: #fbbf24;--mach-danger: #f87171;--mach-info: #38bdf8;--mach-shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);--mach-shadow: 0 6px 20px rgba(0, 0, 0, .5);color-scheme:dark}.mach-root *,.mach-root *:before,.mach-root *:after{box-sizing:border-box}.mach-portal,.mach-portal *,.mach-portal *:before,.mach-portal *:after{box-sizing:border-box}.mach-root:focus-visible{outline:2px solid var(--mach-primary);outline-offset:-2px}.mach-header{display:flex;flex-shrink:0;width:100%;height:var(--mach-header-h);background:var(--mach-header-bg);border-bottom:var(--mach-header-border-width) solid var(--mach-header-accent-color);box-shadow:0 1px 2px color-mix(in srgb,var(--mach-header-fg) 8%,transparent);overflow:hidden;position:relative;z-index:3;user-select:none}.mach-body{display:flex;flex:1;min-height:0;width:100%;position:relative;overflow:hidden}.mach-pane{position:relative;overflow:hidden;flex-shrink:0}.mach-pane--center{flex:1 1 auto;min-width:0}.mach-pane--hidden{display:none}.mach-header-viewport{width:100%;height:100%;overflow:hidden}.mach-header-rows{position:relative;height:100%;width:100%}.mach-header-row{position:absolute;left:0}.mach-header-row .mach-header-cell{position:absolute;top:0}.mach-header-cell--group{justify-content:center;border-bottom:var(--mach-border-width) solid var(--mach-border-color);font-weight:var(--mach-header-font-weight);background:var(--mach-header-group-bg)}.mach-header-label--custom{display:inline-flex;align-items:center;min-width:0;overflow:hidden}.mach-header-cell{display:flex;align-items:center;gap:4px;padding:0 var(--mach-cell-padding);border-right:var(--mach-border-width) solid transparent;color:var(--mach-header-fg);font-weight:var(--mach-header-font-weight);font-size:var(--mach-font-size);letter-spacing:.15px;cursor:default;overflow:hidden;white-space:nowrap;background:var(--mach-header-bg);transition:color var(--mach-transition),background-color var(--mach-transition)}.mach-header-cell--leaf:hover{background:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-header-bg))}.mach-header-cell.mach-header-cell--sorted{color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 5%,var(--mach-header-bg))}.mach-root.mach-cell-borders .mach-header-cell{border-right-color:var(--mach-border-color)}.mach-header-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.mach-header-cell--selection{justify-content:center;gap:0;padding:0}.mach-header-cell--selection .mach-header-label:empty{display:none}.mach-sort-indicator{display:inline-flex;align-items:center;gap:3px;color:var(--mach-primary);flex-shrink:0}.mach-sort-indicator svg{width:10px;height:10px}.mach-sort-indicator:empty{display:none}.mach-sort-badge{font-size:9px;line-height:1;padding:1.5px 4px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-weight:600}.mach-filter-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-filter-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-cell:hover .mach-filter-btn,.mach-header-cell:hover .mach-menu-btn{opacity:.62}.mach-filter-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-filter-btn--active{opacity:1;color:var(--mach-primary)}.mach-filter-tag{display:inline-flex;align-items:center;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px;height:16px;line-height:16px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-size:10px;font-weight:500;flex-shrink:0}.mach-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;font-size:12px;line-height:1;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-menu-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-menu-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-resize{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:2;touch-action:none}.mach-header-resize:hover:after,.mach-header-resize--active:after{content:"";position:absolute;inset:0 3px;background:var(--mach-primary);opacity:.45;border-radius:1px}.mach-column-resize-guide{position:absolute;bottom:0;width:2px;pointer-events:none;background:var(--mach-primary);box-shadow:0 0 0 1px var(--mach-primary-weak);z-index:8}.mach-column-resize-label{position:absolute;top:6px;min-width:52px;padding:3px 7px;border-radius:var(--mach-radius-sm);color:#fff;background:var(--mach-primary);font:600 11px/1.5 var(--mach-font-family);text-align:center;white-space:nowrap;transform:translate(-50%);box-shadow:var(--mach-shadow-sm)}.mach-header-cell--dragging{opacity:.22}.mach-column-drag-ghost{position:fixed;top:0;left:0;z-index:calc(var(--mach-z-menu) + 1);display:flex;align-items:center;height:var(--mach-header-h);max-width:calc(100vw - 16px);padding:0 var(--mach-cell-padding);overflow:hidden;color:var(--mach-body-fg);font:var(--mach-header-font-weight) var(--mach-font-size)/1.3 var(--mach-font-family);text-overflow:ellipsis;white-space:nowrap;pointer-events:none;background:var(--mach-body-bg);border:1px solid var(--mach-primary);border-radius:var(--mach-radius);box-shadow:var(--mach-shadow);opacity:.96;will-change:transform}.mach-drop-indicator{position:absolute;top:3px;left:0;width:2px;height:calc(100% - 6px);border-radius:2px;background:var(--mach-primary);z-index:4;pointer-events:none;will-change:transform}.mach-root--dragging{cursor:grabbing}.mach-root--dragging .mach-header-cell,.mach-root--resizing .mach-header-cell{cursor:default}.mach-root--resizing{cursor:col-resize}.mach-body-viewport{position:relative;width:100%;height:100%;overflow:hidden}.mach-body-viewport--scroll{overflow:auto;overscroll-behavior:contain;overflow-anchor:none}.mach-body-viewport--scroll{scrollbar-width:thin;scrollbar-color:var(--mach-scrollbar-thumb) transparent}.mach-body-viewport--scroll::-webkit-scrollbar{width:10px;height:10px}.mach-body-viewport--scroll::-webkit-scrollbar-track{background:transparent}.mach-body-viewport--scroll::-webkit-scrollbar-thumb{background:var(--mach-scrollbar-thumb);border-radius:999px;border:3px solid transparent;background-clip:padding-box;transition:background-color var(--mach-transition)}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--mach-scrollbar-thumb) 60%,var(--mach-primary));background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:active{background:var(--mach-primary);background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-corner{background:transparent}.mach-row-container{position:relative;width:100%}.mach-row{position:absolute;top:0;left:0;display:flex;width:100%;background:var(--mach-body-bg);border-bottom:var(--mach-border-width) solid var(--mach-row-border-color);contain:layout style}.mach-row,.mach-row .mach-cell{transition:background-color var(--mach-transition)}.mach-root.mach-striped .mach-row--odd,.mach-root.mach-striped .mach-row--odd .mach-cell{background:var(--mach-zebra-bg)}.mach-cell{position:absolute;top:0;display:flex;align-items:center;height:100%;padding:0 var(--mach-cell-padding);border-right:1px solid var(--mach-cell-border-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;line-height:calc(var(--mach-row-h) - 2px)}.mach-cell--loading{pointer-events:none}.mach-cell-loading-bar{display:block;height:8px;max-width:132px;border-radius:999px;background:linear-gradient(90deg,var(--mach-row-hover-bg),var(--mach-border-color),var(--mach-row-hover-bg));background-size:200% 100%;animation:mach-cell-loading 1.25s ease-in-out infinite}@keyframes mach-cell-loading{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.mach-cell-loading-bar{animation:none}}.mach-cell--num{justify-content:flex-end}.mach-cell--selection{justify-content:center;padding:0}.mach-cell--editing{padding:0 3px}.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color);border-radius:var(--mach-radius-sm);z-index:1}.mach-cell--selection.mach-cell--focus{box-shadow:none;border-radius:0;z-index:auto}.mach-row--hover,.mach-row--hover .mach-cell{background:var(--mach-row-hover-bg)}.mach-row--selected,.mach-row--selected .mach-cell{background:var(--mach-row-selected-bg)}.mach-row--selected.mach-row--hover,.mach-row--selected.mach-row--hover .mach-cell{background:var(--mach-row-selected-bg);filter:brightness(.985)}input.mach-row-checkbox,input.mach-select-all{width:13px;height:13px;margin:0;accent-color:var(--mach-primary);cursor:pointer;flex-shrink:0}.mach-detail-row{background:var(--mach-zebra-bg);z-index:0}.mach-detail{height:100%;overflow:auto;padding:10px 12px}.mach-cell--detail-toggle{justify-content:center;padding:0;cursor:pointer}.mach-detail-toggle{display:inline-flex;align-items:center;justify-content:center;width:100%;font-size:10px;color:var(--mach-header-fg);transition:transform .15s ease}.mach-detail-toggle--open{transform:rotate(90deg)}.mach-detail-toggle--loading{animation:mach-tree-spin .8s linear infinite;color:var(--mach-primary)}.mach-detail-toggle--error{color:#dc2626}@keyframes mach-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mach-detail-toggle--loading{animation:none}}.mach-cell--group{cursor:pointer;background:var(--mach-header-bg)}.mach-row .mach-cell--group,.mach-row:has(.mach-cell--group){background:var(--mach-header-bg)}.mach-group-label{display:inline-flex;align-items:center;gap:5px;min-width:0;overflow:hidden}.mach-group-text{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-group-count{color:var(--mach-header-fg);font-size:10px;flex-shrink:0;opacity:.8}.mach-tree-cell{display:inline-flex;align-items:center;gap:4px;min-width:0;width:100%}.mach-tree-indent{flex-shrink:0}.mach-tree-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;cursor:pointer}.mach-tree-toggle:hover,.mach-tree-toggle:focus-visible{color:var(--mach-primary);background:var(--mach-primary-weak)}.mach-tree-toggle:focus-visible{outline:1px solid var(--mach-primary);outline-offset:-1px}.mach-tree-toggle>.mach-detail-toggle{width:10px;line-height:1;color:inherit;pointer-events:none}.mach-tree-toggle>.mach-detail-toggle--loading{color:var(--mach-primary)}.mach-tree-toggle>.mach-detail-toggle--error{color:var(--mach-danger)}.mach-tree-toggle-spacer{flex:0 0 20px;width:20px}.mach-tree-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-cell--drag{justify-content:center;padding:0;cursor:grab}.mach-row-drag-handle{display:grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;opacity:.55;cursor:grab;user-select:none;touch-action:none;transition:color var(--mach-transition),background var(--mach-transition),opacity var(--mach-transition)}.mach-row-drag-handle:before{content:"";width:10px;height:14px;background:radial-gradient(circle,currentColor 1.3px,transparent 1.5px) 0 0 / 5px 5px}.mach-row-drag-handle:hover:not(:disabled),.mach-row-drag-handle:focus-visible{opacity:1;color:var(--mach-primary);background:var(--mach-primary-weak);border-color:color-mix(in srgb,var(--mach-primary) 28%,transparent);outline:none}.mach-row-drag-handle:disabled{opacity:.2;cursor:not-allowed}.mach-row-drop-indicator{position:absolute;top:0;left:0;width:100%;height:2px;background:var(--mach-primary);box-shadow:0 0 0 1px color-mix(in srgb,var(--mach-body-bg) 65%,transparent);z-index:5;pointer-events:none;will-change:transform}.mach-row-drop-indicator:before{content:"";position:absolute;left:1px;top:-2px;width:6px;height:6px;border-radius:50%;background:var(--mach-primary)}.mach-pane--center .mach-row-drop-indicator:before,.mach-pane--right .mach-row-drop-indicator:before{display:none}.mach-row-drag-preview{position:absolute;top:0;left:0;z-index:var(--mach-z-overlay);max-width:min(216px,calc(100% - 16px));padding:9px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid color-mix(in srgb,var(--mach-primary) 35%,var(--mach-border-color));border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);box-shadow:var(--mach-shadow);font-weight:600;pointer-events:none}.mach-root--row-dragging,.mach-root--row-dragging .mach-cell,.mach-root--row-dragging .mach-row-drag-handle{cursor:grabbing;user-select:none}.mach-root .mach-row--drag-source{opacity:.45}.mach-cell--index{color:var(--mach-header-fg);font-size:calc(var(--mach-font-size) - 1px)}.mach-editor-input.mach-editor-invalid,.mach-editor-invalid .mach-editor-input,.mach-editor-invalid .mach-select-trigger,.mach-editor-invalid input,.mach-editor-invalid select:not([hidden]){border-color:#ef4444!important;box-shadow:0 0 0 1px #ef444459}.mach-editor-validating{cursor:progress;opacity:.72}.mach-footer{display:flex;flex-shrink:0;width:100%;overflow:hidden;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);font-weight:600;color:var(--mach-header-fg);position:relative;z-index:3}.mach-footer-row{position:relative;overflow:hidden;flex-shrink:0}.mach-footer-row--center{flex:1 1 auto;min-width:0}.mach-footer-cell{position:absolute;top:0;display:flex;align-items:center;padding:0 var(--mach-cell-padding);border-right:1px solid transparent;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:100%;font-variant-numeric:tabular-nums}.mach-root.mach-cell-borders .mach-footer-cell{border-right-color:var(--mach-border-color)}.mach-cell--range{background:color-mix(in srgb,var(--mach-primary) 7%,transparent)!important}.mach-cell--range:after{content:"";position:absolute;inset:0;z-index:2;border:0 solid var(--mach-primary);pointer-events:none}.mach-cell--range.mach-cell--range-top:after{border-top-width:1.5px}.mach-cell--range.mach-cell--range-bottom:after{border-bottom-width:1.5px}.mach-cell--range.mach-cell--range-left:after{border-left-width:1.5px}.mach-cell--range.mach-cell--range-right:after{border-right-width:1.5px}.mach-cell--range.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color)}.mach-cell--range.mach-cell--focus:after{display:none}.mach-context-menu{position:fixed;z-index:var(--mach-z-menu);display:flex;flex-direction:column;min-width:140px;padding:5px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow);font-family:var(--mach-font-family);font-size:var(--mach-font-size)}.mach-context-menu-item{text-align:left;padding:6px 10px;border:none;border-radius:var(--mach-radius);background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}.mach-context-menu-item:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-fill-handle{position:absolute;width:8px;height:8px;border-radius:2px;background:var(--mach-primary);border:1.5px solid var(--mach-body-bg);cursor:crosshair;z-index:6;box-shadow:0 0 0 1px #2563eb59}.mach-root--filling,.mach-root--filling *{user-select:none!important;cursor:crosshair!important}.mach-infinite-loading{position:absolute;left:50%;bottom:14px;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:5px 14px;border-radius:999px;background:var(--mach-body-bg);border:1px solid var(--mach-border-color);box-shadow:var(--mach-shadow-sm);color:var(--mach-header-fg);font-size:12px;z-index:var(--mach-z-loading)}.mach-infinite-loading .mach-spinner{width:14px;height:14px;border-width:2px}.mach-statusbar{display:flex;align-items:center;gap:18px;flex-shrink:0;height:28px;padding:0 12px;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);color:var(--mach-header-fg);font-size:11px;overflow:hidden;white-space:nowrap;font-variant-numeric:tabular-nums}.mach-statusbar-item--rangeAggregate{margin-left:auto}.mach-pinned-rows{display:flex;width:100%;overflow:hidden;background:var(--mach-header-bg);flex-shrink:0;border-bottom:1px solid var(--mach-border-color)}.mach-pinned-rows--bottom{border-bottom:none;border-top:1px solid var(--mach-border-color)}.mach-pinned-viewport{flex:1 1 auto;min-width:0;overflow:hidden}.mach-pinned-seg{position:relative;overflow:hidden;flex-shrink:0}.mach-pinned-seg--center{position:relative}.mach-pinned-row{position:relative;width:100%;border-bottom:1px solid var(--mach-row-border-color)}.mach-pinned-row .mach-cell{position:absolute;top:0;background:var(--mach-header-bg);font-weight:600;color:var(--mach-header-fg)}.mach-pinned-row:last-child{border-bottom:none}.mach-cell--wrap{white-space:normal;word-break:break-word;line-height:1.45;align-items:flex-start;padding-top:5px;padding-bottom:5px}.mach-editor-input,.mach-editor-select-control .mach-select-trigger{width:100%;height:calc(var(--mach-row-h) - 8px);padding:0 6px;border:1px solid var(--mach-primary);border-radius:var(--mach-radius-sm);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none}.mach-select-control{position:relative;display:inline-flex;min-width:0;font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px)}.mach-select-native[hidden]{display:none!important}.mach-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;height:34px;padding:0 10px;border:1px solid var(--mach-border-color, #e6eaf0);border-radius:var(--mach-radius, 6px);outline:none;color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);font:inherit;line-height:1;text-align:left;cursor:pointer;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-trigger:hover{border-color:color-mix(in srgb,var(--mach-primary, #2563eb) 44%,var(--mach-border-color, #e6eaf0));background:color-mix(in srgb,var(--mach-primary, #2563eb) 3%,var(--mach-body-bg, #fff))}.mach-select-trigger:focus-visible,.mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-select-caret{width:8px;height:8px;flex:0 0 auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform var(--mach-transition, .15s ease)}.mach-select-trigger[aria-expanded=true] .mach-select-caret{transform:translateY(2px) rotate(225deg)}.mach-select-listbox{position:fixed;z-index:var(--mach-z-menu, 1200);display:none;flex-direction:column;gap:2px;min-width:112px;max-width:min(320px,calc(100vw - 16px));max-height:min(244px,calc(100vh - 16px));padding:5px;overflow:auto;overscroll-behavior:contain;border:1px solid color-mix(in srgb,var(--mach-border-color, #e6eaf0) 88%,var(--mach-primary, #2563eb));border-radius:calc(var(--mach-radius-lg, 8px) + 1px);color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg, #1f2937) 18%,transparent),var(--mach-shadow-sm, 0 1px 3px rgba(15, 23, 42, .12));font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px);isolation:isolate}.mach-select-listbox--open{display:flex;animation:mach-select-listbox-in .12s ease-out}.mach-select-option{position:relative;display:flex;align-items:center;flex:0 0 auto;width:100%;min-height:32px;padding:0 30px 0 10px;border:0;border-radius:var(--mach-radius, 6px);outline:none;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer;transition:color var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-option:hover,.mach-select-option:focus-visible,.mach-select-option--active{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 9%,var(--mach-body-bg, #fff))}.mach-select-option[aria-selected=true]{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 13%,var(--mach-body-bg, #fff));font-weight:600}.mach-select-option[aria-selected=true]:after{content:"\2713";position:absolute;right:10px;font-size:12px;font-weight:700}.mach-select-option:disabled{opacity:.42;cursor:not-allowed}@keyframes mach-select-listbox-in{0%{transform:translateY(-3px) scale(.99)}to{transform:translateY(0) scale(1)}}.mach-select-listbox--above{transform-origin:bottom}.mach-filter-select-control{width:100%}.mach-filter-select-trigger{width:100%;background:color-mix(in srgb,var(--mach-header-bg) 62%,var(--mach-body-bg))}.mach-filter-listbox{width:auto}.mach-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--mach-body-bg);z-index:var(--mach-z-overlay)}.mach-overlay-text{color:var(--mach-header-fg);font-size:var(--mach-font-size)}.mach-overlay-content{max-width:min(100%,320px)}.mach-loading{display:grid;justify-items:center;gap:14px;min-width:172px;padding:20px 24px}.mach-loading__visual{position:relative;display:grid;gap:8px;width:132px;padding:14px 16px;overflow:hidden;background:color-mix(in srgb,var(--mach-header-bg) 82%,var(--mach-body-bg));border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow-sm)}.mach-loading__visual:before{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--mach-primary) 11%,transparent) 50%,transparent 80%);animation:mach-loading-sweep 1.35s ease-in-out infinite}.mach-loading__row{height:7px;border-radius:999px;background:color-mix(in srgb,var(--mach-primary) 13%,var(--mach-border-color))}.mach-loading__row:nth-child(2){width:82%}.mach-loading__row:nth-child(3){width:92%}.mach-loading__row:nth-child(4){width:66%}.mach-loading__status{display:inline-flex;align-items:center;gap:8px;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm)}.mach-loading__spinner{width:14px;height:14px}.mach-loading__label{line-height:1}.mach-spinner{width:22px;height:22px;border:2px solid var(--mach-border-color);border-top-color:var(--mach-primary);border-radius:50%;animation:mach-spin .8s linear infinite}@keyframes mach-spin{to{transform:rotate(360deg)}}@keyframes mach-loading-sweep{to{transform:translate(100%)}}.mach-filter-panel{position:fixed;z-index:var(--mach-z-popup);display:flex;flex-direction:column;gap:10px;width:224px;max-width:calc(100vw - 16px);padding:12px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid color-mix(in srgb,var(--mach-border-color) 88%,var(--mach-primary));border-radius:calc(var(--mach-radius-lg) + 2px);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg) 16%,transparent),var(--mach-shadow-sm);font-family:var(--mach-font-family);font-size:var(--mach-font-size);animation:mach-filter-panel-in .14s ease-out}.mach-filter-body{display:flex;flex-direction:column;gap:8px}.mach-filter-input{width:100%;height:34px;padding:0 10px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none;transition:border-color var(--mach-transition),box-shadow var(--mach-transition)}.mach-filter-input:focus{border-color:var(--mach-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary) 12%,transparent)}@keyframes mach-filter-panel-in{0%{opacity:0;transform:translateY(-3px) scale(.99)}}.mach-filter-set-list{max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-filter-set-item{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:var(--mach-radius-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-filter-set-item:hover{background:var(--mach-row-hover-bg)}.mach-filter-set-item input{accent-color:var(--mach-primary);margin:0;width:13px;height:13px}.mach-filter-footer{display:flex;justify-content:flex-end;gap:6px}.mach-filter-footer button{padding:4px 12px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:var(--mach-font-size);cursor:pointer}.mach-filter-footer button:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-filter-btn-apply{background:var(--mach-primary)!important;border-color:var(--mach-primary)!important;color:#fff!important}.mach-filter-btn-apply:hover{opacity:.9;color:#fff!important}.mach-column-panel{min-width:220px;max-height:70vh;overflow:auto}.mach-column-panel[role=dialog]{width:min(440px,calc(100vw - 16px))}.mach-column-workbench-search{box-sizing:border-box;width:100%;height:30px;padding:0 9px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);font:inherit;outline:none}.mach-column-workbench-search:focus{border-color:var(--mach-primary);box-shadow:0 0 0 2px var(--mach-primary-weak)}.mach-column-panel-title{font-weight:600;color:var(--mach-header-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-column-panel-subtitle{font-size:11px;color:var(--mach-header-fg);margin-top:2px}.mach-column-panel-actions{display:flex;gap:6px;flex-wrap:wrap}.mach-column-panel-btn{flex:1;min-width:60px;padding:4px 8px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.mach-column-panel-btn:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-column-panel-divider{height:1px;background:var(--mach-border-color);margin:4px 0}.mach-column-panel-list{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-column-workbench-item{display:grid;grid-template-columns:minmax(120px,1fr) 108px 26px 26px;align-items:center;gap:4px;min-height:32px;padding:2px 3px;border-radius:var(--mach-radius)}.mach-column-workbench-item:hover{background:var(--mach-row-hover-bg)}.mach-column-workbench-label{display:flex;min-width:0;align-items:center;gap:7px;cursor:pointer}.mach-column-workbench-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-column-workbench-pin-control,.mach-column-workbench-move{height:26px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:inherit;font:inherit}.mach-column-workbench-pin-control{width:108px;border:0}.mach-column-workbench-pin-control .mach-select-trigger{width:100%;height:26px;padding:0 7px;border-radius:var(--mach-radius);font-size:12px;box-shadow:none}.mach-column-workbench-move{padding:0;cursor:pointer}.mach-column-workbench-move:disabled{cursor:not-allowed;opacity:.35}.mach-tag{display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:20px;line-height:18px;border-radius:999px;font-size:var(--mach-font-size-sm);font-weight:500;white-space:nowrap}.mach-tag:before{content:"";width:5px;height:5px;border-radius:999px;background:currentColor}.mach-tag--success{color:var(--mach-success);background:color-mix(in srgb,var(--mach-success) 10%,transparent)}.mach-tag--warning{color:var(--mach-warning);background:color-mix(in srgb,var(--mach-warning) 12%,transparent)}.mach-tag--danger{color:var(--mach-danger);background:color-mix(in srgb,var(--mach-danger) 10%,transparent)}.mach-tag--info{color:var(--mach-info);background:color-mix(in srgb,var(--mach-info) 10%,transparent)}.mach-tag--neutral{color:var(--mach-header-fg);background:color-mix(in srgb,var(--mach-header-fg) 10%,transparent)}.mach-progress{display:flex;align-items:center;gap:6px;width:100%}.mach-progress__track{flex:1;min-width:0;height:6px;border-radius:999px;background:color-mix(in srgb,var(--mach-header-fg) 14%,transparent);overflow:hidden}.mach-progress__bar{height:100%;border-radius:999px;background:var(--mach-primary);transition:width var(--mach-transition)}.mach-progress__label{flex-shrink:0;font-size:var(--mach-font-size-sm);color:var(--mach-header-fg);font-variant-numeric:tabular-nums}.mach-link{color:var(--mach-primary);cursor:pointer}.mach-link:hover{text-decoration:underline}.mach-actions{display:inline-flex;align-items:center;gap:2px}.mach-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.mach-action-btn{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm);line-height:1;cursor:pointer;white-space:nowrap;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-action-btn:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-action-btn--danger:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);color:var(--mach-danger);transform:scale(1.06)}.mach-action-btn--success:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);color:var(--mach-success);transform:scale(1.06)}.mach-action-btn--primary{color:var(--mach-primary)}.mach-action-btn--warning{color:var(--mach-warning)}.mach-action-btn--success,.mach-edit-control--confirm{color:var(--mach-success)}.mach-action-btn--danger{color:var(--mach-danger)}.mach-action-btn:focus-visible,.mach-edit-control:focus-visible,.mach-cell-edit-trigger:focus-visible,.mach-action-drawer__close:focus-visible{outline:2px solid color-mix(in srgb,var(--mach-primary) 65%,transparent);outline-offset:1px}.mach-action-btn:disabled{cursor:not-allowed;opacity:.4}.mach-action-btn--loading svg{animation:mach-spin .8s linear infinite}.mach-dictionary-value--loading{color:var(--mach-header-fg);opacity:.72}.mach-dictionary-value--error{text-decoration:underline dotted;text-underline-offset:3px}.mach-action-btn--icon{padding:0;width:24px}.mach-context-menu-item--danger{color:var(--mach-danger)}.mach-context-menu-item,.mach-action-drawer__item{display:flex;align-items:center;gap:9px}.mach-context-menu-item--primary,.mach-action-drawer__item--primary{color:var(--mach-primary)}.mach-context-menu-item--warning,.mach-action-drawer__item--warning{color:var(--mach-warning)}.mach-context-menu-item--success,.mach-action-drawer__item--success{color:var(--mach-success)}.mach-context-menu-item--danger,.mach-action-drawer__item--danger{color:var(--mach-danger)}.mach-action-drawer-backdrop{position:fixed;inset:0;z-index:calc(var(--mach-z-menu) + 2);background:#0f172a33;backdrop-filter:blur(1px)}.mach-action-drawer{position:absolute;top:0;right:0;display:flex;flex-direction:column;width:min(340px,calc(100vw - 24px));height:100%;background:var(--mach-body-bg);color:var(--mach-body-fg);border-left:1px solid var(--mach-border-color);box-shadow:-16px 0 40px #0f172a24;font-family:var(--mach-font-family);animation:mach-drawer-in .18s ease-out}.mach-action-drawer__header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 16px 0 20px;border-bottom:1px solid var(--mach-border-color)}.mach-action-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:var(--mach-radius);background:transparent;color:var(--mach-header-fg);cursor:pointer}.mach-action-drawer__close:hover{color:var(--mach-primary);background:var(--mach-row-hover-bg)}.mach-action-drawer__body{display:flex;flex-direction:column;gap:4px;padding:12px;overflow:auto}.mach-action-drawer__item{width:100%;min-height:40px;padding:0 12px;border:0;border-radius:var(--mach-radius);background:transparent;font:inherit;text-align:left;cursor:pointer}.mach-action-drawer__item:hover:not(:disabled){background:var(--mach-row-hover-bg)}.mach-action-drawer__item:disabled{opacity:.4;cursor:not-allowed}@keyframes mach-drawer-in{0%{transform:translate(18px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:640px){.mach-action-drawer{top:auto;bottom:0;width:100%;height:auto;max-height:min(70vh,520px);border-top:1px solid var(--mach-border-color);border-left:0;border-radius:var(--mach-radius-lg) var(--mach-radius-lg) 0 0;animation-name:mach-drawer-up}}@keyframes mach-drawer-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.mach-cell:has(.mach-cell-edit-trigger){padding-right:29px}.mach-cell-edit-trigger{position:absolute;right:5px;top:50%;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;transform:translateY(-50%);border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;opacity:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-cell-edit-trigger svg{width:13px;height:13px}.mach-cell:hover .mach-cell-edit-trigger--hover,.mach-cell:focus-within .mach-cell-edit-trigger--hover,.mach-cell-edit-trigger--always{opacity:.72}.mach-cell-edit-trigger:hover{opacity:1;color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 9%,transparent)}.mach-cell--editing{overflow:visible;z-index:4}.mach-cell-editor-shell,.mach-row-editor-shell{display:flex;align-items:center;width:100%;min-width:0;gap:5px}.mach-cell-editor-shell>.mach-editor-input,.mach-cell-editor-shell>.mach-editor-select-control,.mach-cell-editor-shell>:not(.mach-cell-editor-controls),.mach-row-editor-shell>*{flex:1 1 auto;min-width:0}.mach-cell-editor-controls{display:inline-flex;flex:0 0 auto;align-items:center;gap:2px;padding:2px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);box-shadow:var(--mach-shadow-sm)}.mach-edit-control{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-edit-control svg{width:14px;height:14px}.mach-edit-control--confirm{color:var(--mach-success)}.mach-edit-control--confirm:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);transform:scale(1.06)}.mach-edit-control--cancel{color:var(--mach-danger)}.mach-edit-control--cancel:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);transform:scale(1.06)}.mach-edit-control:disabled{opacity:.35;cursor:wait}.mach-row--editing,.mach-row--editing .mach-cell{background:color-mix(in srgb,var(--mach-primary) 3%,var(--mach-body-bg))}.mach-cell--row-editing .mach-editor-input,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger{border-color:color-mix(in srgb,var(--mach-primary) 45%,var(--mach-border-color));box-shadow:0 1px 2px #0f172a0a}.mach-cell--row-editing .mach-editor-input:focus,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger:focus-visible,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary) 12%,transparent)}.mach-tooltip{position:fixed;z-index:var(--mach-z-menu);max-width:320px;padding:6px 10px;border-radius:var(--mach-radius);background:var(--mach-body-fg);color:var(--mach-body-bg);font-size:var(--mach-font-size-sm);line-height:1.5;box-shadow:var(--mach-shadow);pointer-events:none;word-break:break-word}.mach-cell--flash{animation:mach-flash .8s ease-out}@keyframes mach-flash{0%{background-color:color-mix(in srgb,var(--mach-primary) 35%,transparent)}to{background-color:transparent}}.mach-context-menu-separator{height:1px;margin:4px 6px;background:var(--mach-border-color)}.mach-context-menu-item:disabled{opacity:.45;cursor:not-allowed}.mach-pagination{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-shrink:0;height:40px;padding:0 12px;background:var(--mach-body-bg);border-top:var(--mach-border-width) solid var(--mach-border-color);color:var(--mach-body-fg);font-size:var(--mach-font-size-sm);user-select:none}.mach-pagination-total{color:var(--mach-header-fg);margin-right:8px;font-variant-numeric:tabular-nums}.mach-pagination-page{min-width:72px;text-align:center;color:var(--mach-body-fg);font-variant-numeric:tabular-nums}.mach-pagination-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:var(--mach-border-width) solid var(--mach-border-color);border-radius:var(--mach-radius-sm);background:var(--mach-body-bg);color:var(--mach-header-fg);font-size:13px;line-height:1;cursor:pointer;transition:border-color var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-pagination-btn:hover:not(:disabled){border-color:var(--mach-primary);color:var(--mach-primary)}.mach-pagination-btn:disabled{opacity:.35;cursor:not-allowed}.mach-pagination-size-control{height:24px;margin-left:6px;width:92px;font-size:var(--mach-font-size-sm)}.mach-pagination-size-control .mach-select-trigger{width:100%;height:24px;padding:0 6px;border-width:var(--mach-border-width);border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);box-shadow:none}.mach-watermark{position:absolute;inset:0;z-index:6;pointer-events:none;background-repeat:repeat}.mach-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:32px 16px;min-height:160px;text-align:center;color:var(--mach-body-fg);font-size:12px;line-height:20px;overflow-wrap:anywhere}.mach-empty__icon{fill:var(--mach-body-bg);margin-bottom:6px;width:96px;height:84px;stroke:#8b98ff;stroke-linecap:round}.mach-empty__title{font-size:14px;line-height:22px;font-weight:500}.mach-empty__hint{opacity:.45}@media(prefers-reduced-motion:reduce){.mach-spinner,.mach-loading__visual:before{animation-duration:2.4s}}.mach-cell--center{justify-content:center}.mach-cell--right{justify-content:flex-end}.mach-header-cell--center .mach-header-label{text-align:center}.mach-header-cell--right .mach-header-label{text-align:right}@media(prefers-reduced-motion:reduce){.mach-root *,.mach-root *:before,.mach-root *:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.mach-action-drawer{animation:none!important}}.mach-root{--mach-row-warning-bg: color-mix(in srgb, var(--mach-warning) 11%, var(--mach-body-bg));--mach-row-danger-bg: color-mix(in srgb, var(--mach-danger) 9%, var(--mach-body-bg));--mach-row-success-bg: color-mix(in srgb, var(--mach-success) 10%, var(--mach-body-bg));--mach-row-info-bg: color-mix(in srgb, var(--mach-info) 10%, var(--mach-body-bg))}.mach-row--styled[data-row-tone=warning]{--mach-row-rule-bg: var(--mach-row-warning-bg)}.mach-row--styled[data-row-tone=danger]{--mach-row-rule-bg: var(--mach-row-danger-bg)}.mach-row--styled[data-row-tone=success]{--mach-row-rule-bg: var(--mach-row-success-bg)}.mach-row--styled[data-row-tone=info]{--mach-row-rule-bg: var(--mach-row-info-bg)}.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled,.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled .mach-cell{background-color:var(--mach-row-rule-bg, var(--mach-body-bg));color:var(--mach-row-rule-fg, var(--mach-body-fg))}.mach-root .mach-row--styled.mach-row--hover,.mach-root .mach-row--styled.mach-row--hover .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-row-rule-bg, var(--mach-body-bg)))}.mach-root .mach-row--styled.mach-row--selected,.mach-root .mach-row--styled.mach-row--selected .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 12%,var(--mach-row-rule-bg, var(--mach-body-bg)))}
|
|
1
|
+
.mach-root{--mach-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;--mach-font-size: 13px;--mach-font-size-sm: 12px;--mach-header-font-weight: 650;--mach-cell-padding: 9px;--mach-row-h: 36px;--mach-header-h: 40px;--mach-primary: #2563eb;--mach-primary-weak: #dbeafe;--mach-success: #16a34a;--mach-warning: #d97706;--mach-danger: #dc2626;--mach-info: #0284c7;--mach-border-color: #e6eaf0;--mach-row-border-color: #eef1f6;--mach-cell-border-color: transparent;--mach-border-width: 1px;--mach-header-border-width: 1px;--mach-header-accent-color: #d9e1eb;--mach-header-bg: #f4f7fb;--mach-header-group-bg: #edf2f8;--mach-header-fg: #344054;--mach-body-bg: #ffffff;--mach-body-fg: #26303f;--mach-row-hover-bg: #f6f8fa;--mach-row-selected-bg: #eff6ff;--mach-zebra-bg: #fafbfd;--mach-cell-focus-color: #2563eb;--mach-focus-width: 1.5px;--mach-scrollbar-thumb: #c9d2dd;--mach-radius-sm: 4px;--mach-radius: 6px;--mach-radius-lg: 8px;--mach-shadow-sm: 0 1px 4px rgba(15, 23, 42, .08);--mach-shadow: 0 6px 20px rgba(15, 23, 42, .12);--mach-transition: .15s ease;--mach-z-overlay: 10;--mach-z-loading: 15;--mach-z-popup: 1000;--mach-z-menu: 1001;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:120px;overflow:hidden;font-family:var(--mach-font-family);font-size:var(--mach-font-size);color:var(--mach-body-fg);background:var(--mach-body-bg);outline:none;box-sizing:border-box;border:1px solid var(--mach-border-color);color-scheme:light;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-variant-numeric:tabular-nums;contain:layout style}.mach-root.mach-dom-layout--auto-height{height:auto;min-height:0}.mach-root.mach-dom-layout--auto-height .mach-body{flex:none}.mach-root.mach-dom-layout--auto-height .mach-body-viewport--scroll{overflow-y:hidden}.mach-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:6px 8px;font:13px/1.4 var(--mach-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);color:var(--mach-body-fg, #26303f);background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-bottom:0;border-radius:var(--mach-radius-lg, 8px) var(--mach-radius-lg, 8px) 0 0}.mach-toolbar__main,.mach-toolbar__aside{display:flex;align-items:center;gap:6px;min-width:0}.mach-toolbar__search{display:flex;align-items:center;gap:6px;width:min(240px,32vw);height:32px;padding:0 9px;color:#64748b;background:var(--mach-header-bg, #fafbfd);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease)}.mach-toolbar__search:focus-within{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-toolbar__search input{min-width:0;width:100%;color:inherit;background:transparent;border:0;outline:0}.mach-toolbar__button,.mach-toolbar__select-host,.mach-toolbar__selection{height:32px;padding:0 10px;color:inherit;background:var(--mach-body-bg, #fff);border:1px solid var(--mach-border-color, #e6eaf0);border-radius:6px;cursor:pointer;transition:color var(--mach-transition, .15s ease),border-color var(--mach-transition, .15s ease),background var(--mach-transition, .15s ease)}.mach-toolbar__button{min-width:32px;padding:0 8px;font-size:16px}.mach-toolbar__button:hover:not(:disabled),.mach-toolbar__select-host:hover{color:var(--mach-primary, #2563eb);border-color:var(--mach-primary, #2563eb)}.mach-toolbar__button:disabled{cursor:not-allowed;opacity:.45}.mach-toolbar__selection{color:var(--mach-primary, #2563eb);background:var(--mach-primary-weak, #dbeafe);border-color:transparent;font-size:12px}.mach-toolbar__select-host{width:82px;padding:0}.mach-toolbar__select-control,.mach-toolbar__select-control .mach-select-trigger{width:100%;height:100%}.mach-toolbar__select-control .mach-select-trigger{border:0;border-radius:5px;background:transparent;box-shadow:none}@media(max-width:640px){.mach-toolbar{align-items:stretch;flex-direction:column}.mach-toolbar__main,.mach-toolbar__aside{flex-wrap:wrap}.mach-toolbar__search{flex:1;width:auto}}.mach-size--compact{--mach-font-size: 12px;--mach-cell-padding: 6px}.mach-size--normal{--mach-font-size: 13px;--mach-cell-padding: 9px}.mach-size--large{--mach-font-size: 14px;--mach-cell-padding: 12px}.mach-root.mach-cell-borders{--mach-cell-border-color: var(--mach-border-color)}.mach-root.mach-theme-dark,.mach-root.mach-theme-dark.mach-size--compact,.mach-root.mach-theme-dark.mach-size--normal,.mach-root.mach-theme-dark.mach-size--large{--mach-border-color: #26324a;--mach-row-border-color: #1c2740;--mach-header-accent-color: #33415e;--mach-header-bg: #101a2e;--mach-header-group-bg: #16213a;--mach-header-fg: #c3cee0;--mach-body-bg: #0d1526;--mach-body-fg: #dbe4f0;--mach-row-hover-bg: #142138;--mach-row-selected-bg: #14304f;--mach-zebra-bg: #0f1a2e;--mach-cell-focus-color: #60a5fa;--mach-primary: #60a5fa;--mach-primary-weak: #1e3a5f;--mach-scrollbar-thumb: #33415e;--mach-success: #4ade80;--mach-warning: #fbbf24;--mach-danger: #f87171;--mach-info: #38bdf8;--mach-shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);--mach-shadow: 0 6px 20px rgba(0, 0, 0, .5);color-scheme:dark}.mach-root *,.mach-root *:before,.mach-root *:after{box-sizing:border-box}.mach-portal,.mach-portal *,.mach-portal *:before,.mach-portal *:after{box-sizing:border-box}.mach-root:focus-visible{outline:2px solid var(--mach-primary);outline-offset:-2px}.mach-header{display:flex;flex-shrink:0;width:100%;height:var(--mach-header-h);background:var(--mach-header-bg);border-bottom:var(--mach-header-border-width) solid var(--mach-header-accent-color);box-shadow:0 1px 2px color-mix(in srgb,var(--mach-header-fg) 8%,transparent);overflow:hidden;position:relative;z-index:3;user-select:none}.mach-body{display:flex;flex:1;min-height:0;width:100%;position:relative;overflow:hidden}.mach-pane{position:relative;overflow:hidden;flex-shrink:0}.mach-pane--center{flex:1 1 auto;min-width:0}.mach-pane--hidden{display:none}.mach-header-viewport{width:100%;height:100%;overflow:hidden}.mach-header-rows{position:relative;height:100%;width:100%}.mach-header-row{position:absolute;left:0}.mach-header-row .mach-header-cell{position:absolute;top:0}.mach-header-cell--group{justify-content:center;border-bottom:var(--mach-border-width) solid var(--mach-border-color);font-weight:var(--mach-header-font-weight);background:var(--mach-header-group-bg)}.mach-header-label--custom{display:inline-flex;align-items:center;min-width:0;overflow:hidden}.mach-header-cell{display:flex;align-items:center;gap:4px;padding:0 var(--mach-cell-padding);border-right:var(--mach-border-width) solid transparent;color:var(--mach-header-fg);font-weight:var(--mach-header-font-weight);font-size:var(--mach-font-size);letter-spacing:.15px;cursor:default;overflow:hidden;white-space:nowrap;background:var(--mach-header-bg);transition:color var(--mach-transition),background-color var(--mach-transition)}.mach-header-cell--leaf:hover{background:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-header-bg))}.mach-header-cell.mach-header-cell--sorted{color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 5%,var(--mach-header-bg))}.mach-root.mach-cell-borders .mach-header-cell{border-right-color:var(--mach-border-color)}.mach-header-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.mach-header-cell--selection{justify-content:center;gap:0;padding:0}.mach-header-cell--selection .mach-header-label:empty{display:none}.mach-sort-indicator{display:inline-flex;align-items:center;gap:3px;color:var(--mach-primary);flex-shrink:0}.mach-sort-indicator svg{width:10px;height:10px}.mach-sort-indicator:empty{display:none}.mach-sort-badge{font-size:9px;line-height:1;padding:1.5px 4px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-weight:600}.mach-filter-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-filter-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-cell:hover .mach-filter-btn,.mach-header-cell:hover .mach-menu-btn{opacity:.62}.mach-filter-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-filter-btn--active{opacity:1;color:var(--mach-primary)}.mach-filter-tag{display:inline-flex;align-items:center;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px;height:16px;line-height:16px;border-radius:999px;background:var(--mach-primary-weak);color:var(--mach-primary);font-size:10px;font-weight:500;flex-shrink:0}.mach-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:inherit;opacity:.36;cursor:pointer;flex-shrink:0;font-size:12px;line-height:1;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-menu-btn:hover{opacity:1;background:var(--mach-row-hover-bg)}.mach-menu-btn svg{width:12px;height:12px;pointer-events:none}.mach-header-resize{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:2;touch-action:none}.mach-header-resize:hover:after,.mach-header-resize--active:after{content:"";position:absolute;inset:0 3px;background:var(--mach-primary);opacity:.45;border-radius:1px}.mach-column-resize-guide{position:absolute;bottom:0;width:2px;pointer-events:none;background:var(--mach-primary);box-shadow:0 0 0 1px var(--mach-primary-weak);z-index:8}.mach-column-resize-label{position:absolute;top:6px;min-width:52px;padding:3px 7px;border-radius:var(--mach-radius-sm);color:#fff;background:var(--mach-primary);font:600 11px/1.5 var(--mach-font-family);text-align:center;white-space:nowrap;transform:translate(-50%);box-shadow:var(--mach-shadow-sm)}.mach-header-cell--dragging{opacity:.22}.mach-column-drag-ghost{position:fixed;top:0;left:0;z-index:calc(var(--mach-z-menu) + 1);display:flex;align-items:center;height:var(--mach-header-h);max-width:calc(100vw - 16px);padding:0 var(--mach-cell-padding);overflow:hidden;color:var(--mach-body-fg);font:var(--mach-header-font-weight) var(--mach-font-size)/1.3 var(--mach-font-family);text-overflow:ellipsis;white-space:nowrap;pointer-events:none;background:var(--mach-body-bg);border:1px solid var(--mach-primary);border-radius:var(--mach-radius);box-shadow:var(--mach-shadow);opacity:.96;will-change:transform}.mach-drop-indicator{position:absolute;top:3px;left:0;width:2px;height:calc(100% - 6px);border-radius:2px;background:var(--mach-primary);z-index:4;pointer-events:none;will-change:transform}.mach-root--dragging{cursor:grabbing}.mach-root--dragging .mach-header-cell,.mach-root--resizing .mach-header-cell{cursor:default}.mach-root--resizing{cursor:col-resize}.mach-body-viewport{position:relative;width:100%;height:100%;overflow:hidden;overflow:clip}.mach-body-viewport--scroll{overflow:auto;overscroll-behavior:contain;overflow-anchor:none}.mach-body-viewport--scroll{scrollbar-width:thin;scrollbar-color:var(--mach-scrollbar-thumb) transparent}.mach-body-viewport--scroll::-webkit-scrollbar{width:10px;height:10px}.mach-body-viewport--scroll::-webkit-scrollbar-track{background:transparent}.mach-body-viewport--scroll::-webkit-scrollbar-thumb{background:var(--mach-scrollbar-thumb);border-radius:999px;border:3px solid transparent;background-clip:padding-box;transition:background-color var(--mach-transition)}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--mach-scrollbar-thumb) 60%,var(--mach-primary));background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-thumb:active{background:var(--mach-primary);background-clip:padding-box}.mach-body-viewport--scroll::-webkit-scrollbar-corner{background:transparent}.mach-row-container{position:relative;width:100%}.mach-row{position:absolute;top:0;left:0;display:flex;width:100%;background:var(--mach-body-bg);border-bottom:var(--mach-border-width) solid var(--mach-row-border-color);contain:layout style}.mach-row,.mach-row .mach-cell{transition:background-color var(--mach-transition)}.mach-root.mach-striped .mach-row--odd,.mach-root.mach-striped .mach-row--odd .mach-cell{background:var(--mach-zebra-bg)}.mach-cell{position:absolute;top:0;display:flex;align-items:center;height:100%;padding:0 var(--mach-cell-padding);border-right:1px solid var(--mach-cell-border-color);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;line-height:calc(var(--mach-row-h) - 2px)}.mach-cell--loading{pointer-events:none}.mach-cell-loading-bar{display:block;height:8px;max-width:132px;border-radius:999px;background:linear-gradient(90deg,var(--mach-row-hover-bg),var(--mach-border-color),var(--mach-row-hover-bg));background-size:200% 100%;animation:mach-cell-loading 1.25s ease-in-out infinite}@keyframes mach-cell-loading{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.mach-cell-loading-bar{animation:none}}.mach-cell--num{justify-content:flex-end}.mach-cell--selection{justify-content:center;padding:0}.mach-cell--editing{padding:0 3px}.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color);border-radius:var(--mach-radius-sm);z-index:1}.mach-cell--selection.mach-cell--focus{box-shadow:none;border-radius:0;z-index:auto}.mach-row--hover,.mach-row--hover .mach-cell{background:var(--mach-row-hover-bg)}.mach-row--selected,.mach-row--selected .mach-cell{background:var(--mach-row-selected-bg)}.mach-row--selected.mach-row--hover,.mach-row--selected.mach-row--hover .mach-cell{background:var(--mach-row-selected-bg);filter:brightness(.985)}input.mach-row-checkbox,input.mach-select-all{width:13px;height:13px;margin:0;accent-color:var(--mach-primary);cursor:pointer;flex-shrink:0}.mach-detail-row{background:var(--mach-zebra-bg);z-index:0}.mach-detail{height:100%;overflow:auto;padding:10px 12px}.mach-cell--detail-toggle{justify-content:center;padding:0;cursor:pointer}.mach-detail-toggle{display:inline-flex;align-items:center;justify-content:center;width:100%;font-size:10px;color:var(--mach-header-fg);transition:transform .15s ease}.mach-detail-toggle--open{transform:rotate(90deg)}.mach-detail-toggle--loading{animation:mach-tree-spin .8s linear infinite;color:var(--mach-primary)}.mach-detail-toggle--error{color:#dc2626}@keyframes mach-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.mach-detail-toggle--loading{animation:none}}.mach-cell--group{cursor:pointer;background:var(--mach-header-bg)}.mach-row .mach-cell--group,.mach-row:has(.mach-cell--group){background:var(--mach-header-bg)}.mach-group-label{display:inline-flex;align-items:center;gap:5px;min-width:0;overflow:hidden}.mach-group-text{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-group-count{color:var(--mach-header-fg);font-size:10px;flex-shrink:0;opacity:.8}.mach-tree-cell{display:inline-flex;align-items:center;gap:4px;min-width:0;width:100%}.mach-tree-indent{flex-shrink:0}.mach-tree-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;cursor:pointer}.mach-tree-toggle:hover,.mach-tree-toggle:focus-visible{color:var(--mach-primary);background:var(--mach-primary-weak)}.mach-tree-toggle:focus-visible{outline:1px solid var(--mach-primary);outline-offset:-1px}.mach-tree-toggle>.mach-detail-toggle{width:10px;line-height:1;color:inherit;pointer-events:none}.mach-tree-toggle>.mach-detail-toggle--loading{color:var(--mach-primary)}.mach-tree-toggle>.mach-detail-toggle--error{color:var(--mach-danger)}.mach-tree-toggle-spacer{flex:0 0 20px;width:20px}.mach-tree-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-cell--drag{justify-content:center;padding:0;cursor:grab}.mach-row-drag-handle{display:grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);background:transparent;opacity:.55;cursor:grab;user-select:none;touch-action:none;transition:color var(--mach-transition),background var(--mach-transition),opacity var(--mach-transition)}.mach-row-drag-handle:before{content:"";width:10px;height:14px;background:radial-gradient(circle,currentColor 1.3px,transparent 1.5px) 0 0 / 5px 5px}.mach-row-drag-handle:hover:not(:disabled),.mach-row-drag-handle:focus-visible{opacity:1;color:var(--mach-primary);background:var(--mach-primary-weak);border-color:color-mix(in srgb,var(--mach-primary) 28%,transparent);outline:none}.mach-row-drag-handle:disabled{opacity:.2;cursor:not-allowed}.mach-row-drop-indicator{position:absolute;top:0;left:0;width:100%;height:2px;background:var(--mach-primary);box-shadow:0 0 0 1px color-mix(in srgb,var(--mach-body-bg) 65%,transparent);z-index:5;pointer-events:none;will-change:transform}.mach-row-drop-indicator:before{content:"";position:absolute;left:1px;top:-2px;width:6px;height:6px;border-radius:50%;background:var(--mach-primary)}.mach-pane--center .mach-row-drop-indicator:before,.mach-pane--right .mach-row-drop-indicator:before{display:none}.mach-row-drag-preview{position:absolute;top:0;left:0;z-index:var(--mach-z-overlay);max-width:min(216px,calc(100% - 16px));padding:9px 14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid color-mix(in srgb,var(--mach-primary) 35%,var(--mach-border-color));border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);box-shadow:var(--mach-shadow);font-weight:600;pointer-events:none}.mach-root--row-dragging,.mach-root--row-dragging .mach-cell,.mach-root--row-dragging .mach-row-drag-handle{cursor:grabbing;user-select:none}.mach-root .mach-row--drag-source{opacity:.45}.mach-cell--index{color:var(--mach-header-fg);font-size:calc(var(--mach-font-size) - 1px)}.mach-editor-input.mach-editor-invalid,.mach-editor-invalid .mach-editor-input,.mach-editor-invalid .mach-select-trigger,.mach-editor-invalid input,.mach-editor-invalid select:not([hidden]){border-color:#ef4444!important;box-shadow:0 0 0 1px #ef444459}.mach-editor-validating{cursor:progress;opacity:.72}.mach-footer{display:flex;flex-shrink:0;width:100%;overflow:hidden;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);font-weight:600;color:var(--mach-header-fg);position:relative;z-index:3}.mach-footer-row{position:relative;overflow:hidden;flex-shrink:0}.mach-footer-row--center{flex:1 1 auto;min-width:0}.mach-footer-cell{position:absolute;top:0;display:flex;align-items:center;padding:0 var(--mach-cell-padding);border-right:1px solid transparent;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:100%;font-variant-numeric:tabular-nums}.mach-root.mach-cell-borders .mach-footer-cell{border-right-color:var(--mach-border-color)}.mach-cell--range{background:color-mix(in srgb,var(--mach-primary) 7%,transparent)!important}.mach-cell--range:after{content:"";position:absolute;inset:0;z-index:2;border:0 solid var(--mach-primary);pointer-events:none}.mach-cell--range.mach-cell--range-top:after{border-top-width:1.5px}.mach-cell--range.mach-cell--range-bottom:after{border-bottom-width:1.5px}.mach-cell--range.mach-cell--range-left:after{border-left-width:1.5px}.mach-cell--range.mach-cell--range-right:after{border-right-width:1.5px}.mach-cell--range.mach-cell--focus{box-shadow:inset 0 0 0 var(--mach-focus-width) var(--mach-cell-focus-color)}.mach-cell--range.mach-cell--focus:after{display:none}.mach-context-menu{position:fixed;z-index:var(--mach-z-menu);display:flex;flex-direction:column;min-width:140px;padding:5px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow);font-family:var(--mach-font-family);font-size:var(--mach-font-size)}.mach-context-menu-item{text-align:left;padding:6px 10px;border:none;border-radius:var(--mach-radius);background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap}.mach-context-menu-item:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-fill-handle{position:absolute;width:8px;height:8px;border-radius:2px;background:var(--mach-primary);border:1.5px solid var(--mach-body-bg);cursor:crosshair;z-index:6;box-shadow:0 0 0 1px #2563eb59}.mach-root--filling,.mach-root--filling *{user-select:none!important;cursor:crosshair!important}.mach-infinite-loading{position:absolute;left:50%;bottom:14px;transform:translate(-50%);display:flex;align-items:center;gap:8px;padding:5px 14px;border-radius:999px;background:var(--mach-body-bg);border:1px solid var(--mach-border-color);box-shadow:var(--mach-shadow-sm);color:var(--mach-header-fg);font-size:12px;z-index:var(--mach-z-loading)}.mach-infinite-loading .mach-spinner{width:14px;height:14px;border-width:2px}.mach-statusbar{display:flex;align-items:center;gap:18px;flex-shrink:0;height:28px;padding:0 12px;background:var(--mach-header-bg);border-top:1px solid var(--mach-border-color);color:var(--mach-header-fg);font-size:11px;overflow:hidden;white-space:nowrap;font-variant-numeric:tabular-nums}.mach-statusbar-item--rangeAggregate{margin-left:auto}.mach-pinned-rows{display:flex;width:100%;overflow:hidden;background:var(--mach-header-bg);flex-shrink:0;border-bottom:1px solid var(--mach-border-color)}.mach-pinned-rows--bottom{border-bottom:none;border-top:1px solid var(--mach-border-color)}.mach-pinned-viewport{flex:1 1 auto;min-width:0;overflow:hidden}.mach-pinned-seg{position:relative;overflow:hidden;flex-shrink:0}.mach-pinned-seg--center{position:relative}.mach-pinned-row{position:relative;width:100%;border-bottom:1px solid var(--mach-row-border-color)}.mach-pinned-row .mach-cell{position:absolute;top:0;background:var(--mach-header-bg);font-weight:600;color:var(--mach-header-fg)}.mach-pinned-row:last-child{border-bottom:none}.mach-cell--wrap{white-space:normal;word-break:break-word;line-height:1.45;align-items:flex-start;padding-top:5px;padding-bottom:5px}.mach-editor-input,.mach-editor-select-control .mach-select-trigger{width:100%;height:calc(var(--mach-row-h) - 8px);padding:0 6px;border:1px solid var(--mach-primary);border-radius:var(--mach-radius-sm);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none}.mach-select-control{position:relative;display:inline-flex;min-width:0;font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px)}.mach-select-native[hidden]{display:none!important}.mach-select-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;height:34px;padding:0 10px;border:1px solid var(--mach-border-color, #e6eaf0);border-radius:var(--mach-radius, 6px);outline:none;color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);font:inherit;line-height:1;text-align:left;cursor:pointer;transition:border-color var(--mach-transition, .15s ease),box-shadow var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-trigger:hover{border-color:color-mix(in srgb,var(--mach-primary, #2563eb) 44%,var(--mach-border-color, #e6eaf0));background:color-mix(in srgb,var(--mach-primary, #2563eb) 3%,var(--mach-body-bg, #fff))}.mach-select-trigger:focus-visible,.mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary, #2563eb);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary, #2563eb) 12%,transparent)}.mach-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-select-caret{width:8px;height:8px;flex:0 0 auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform var(--mach-transition, .15s ease)}.mach-select-trigger[aria-expanded=true] .mach-select-caret{transform:translateY(2px) rotate(225deg)}.mach-select-listbox{position:fixed;z-index:var(--mach-z-menu, 1200);display:none;flex-direction:column;gap:2px;min-width:112px;max-width:min(320px,calc(100vw - 16px));max-height:min(244px,calc(100vh - 16px));padding:5px;overflow:auto;overscroll-behavior:contain;border:1px solid color-mix(in srgb,var(--mach-border-color, #e6eaf0) 88%,var(--mach-primary, #2563eb));border-radius:calc(var(--mach-radius-lg, 8px) + 1px);color:var(--mach-body-fg, #1f2937);background:var(--mach-body-bg, #fff);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg, #1f2937) 18%,transparent),var(--mach-shadow-sm, 0 1px 3px rgba(15, 23, 42, .12));font-family:var(--mach-font-family, inherit);font-size:var(--mach-font-size, 14px);isolation:isolate}.mach-select-listbox--open{display:flex;animation:mach-select-listbox-in .12s ease-out}.mach-select-option{position:relative;display:flex;align-items:center;flex:0 0 auto;width:100%;min-height:32px;padding:0 30px 0 10px;border:0;border-radius:var(--mach-radius, 6px);outline:none;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer;transition:color var(--mach-transition, .15s ease),background-color var(--mach-transition, .15s ease)}.mach-select-option:hover,.mach-select-option:focus-visible,.mach-select-option--active{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 9%,var(--mach-body-bg, #fff))}.mach-select-option[aria-selected=true]{color:var(--mach-primary, #2563eb);background:color-mix(in srgb,var(--mach-primary, #2563eb) 13%,var(--mach-body-bg, #fff));font-weight:600}.mach-select-option[aria-selected=true]:after{content:"\2713";position:absolute;right:10px;font-size:12px;font-weight:700}.mach-select-option:disabled{opacity:.42;cursor:not-allowed}@keyframes mach-select-listbox-in{0%{transform:translateY(-3px) scale(.99)}to{transform:translateY(0) scale(1)}}.mach-select-listbox--above{transform-origin:bottom}.mach-filter-select-control{width:100%}.mach-filter-select-trigger{width:100%;background:color-mix(in srgb,var(--mach-header-bg) 62%,var(--mach-body-bg))}.mach-filter-listbox{width:auto}.mach-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:var(--mach-body-bg);z-index:var(--mach-z-overlay)}.mach-overlay-text{color:var(--mach-header-fg);font-size:var(--mach-font-size)}.mach-overlay-content{max-width:min(100%,320px)}.mach-loading{display:grid;justify-items:center;gap:14px;min-width:172px;padding:20px 24px}.mach-loading__visual{position:relative;display:grid;gap:8px;width:132px;padding:14px 16px;overflow:hidden;background:color-mix(in srgb,var(--mach-header-bg) 82%,var(--mach-body-bg));border:1px solid var(--mach-border-color);border-radius:var(--mach-radius-lg);box-shadow:var(--mach-shadow-sm)}.mach-loading__visual:before{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--mach-primary) 11%,transparent) 50%,transparent 80%);animation:mach-loading-sweep 1.35s ease-in-out infinite}.mach-loading__row{height:7px;border-radius:999px;background:color-mix(in srgb,var(--mach-primary) 13%,var(--mach-border-color))}.mach-loading__row:nth-child(2){width:82%}.mach-loading__row:nth-child(3){width:92%}.mach-loading__row:nth-child(4){width:66%}.mach-loading__status{display:inline-flex;align-items:center;gap:8px;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm)}.mach-loading__spinner{width:14px;height:14px}.mach-loading__label{line-height:1}.mach-spinner{width:22px;height:22px;border:2px solid var(--mach-border-color);border-top-color:var(--mach-primary);border-radius:50%;animation:mach-spin .8s linear infinite}@keyframes mach-spin{to{transform:rotate(360deg)}}@keyframes mach-loading-sweep{to{transform:translate(100%)}}.mach-filter-panel{position:fixed;z-index:var(--mach-z-popup);display:flex;flex-direction:column;gap:10px;width:224px;max-width:calc(100vw - 16px);padding:12px;background:var(--mach-body-bg);color:var(--mach-body-fg);border:1px solid color-mix(in srgb,var(--mach-border-color) 88%,var(--mach-primary));border-radius:calc(var(--mach-radius-lg) + 2px);box-shadow:0 14px 36px color-mix(in srgb,var(--mach-body-fg) 16%,transparent),var(--mach-shadow-sm);font-family:var(--mach-font-family);font-size:var(--mach-font-size);animation:mach-filter-panel-in .14s ease-out}.mach-filter-body{display:flex;flex-direction:column;gap:8px}.mach-filter-input{width:100%;height:34px;padding:0 10px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);font-family:inherit;font-size:var(--mach-font-size);color:inherit;background:var(--mach-body-bg);outline:none;transition:border-color var(--mach-transition),box-shadow var(--mach-transition)}.mach-filter-input:focus{border-color:var(--mach-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--mach-primary) 12%,transparent)}@keyframes mach-filter-panel-in{0%{opacity:0;transform:translateY(-3px) scale(.99)}}.mach-filter-set-list{max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-filter-set-item{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:var(--mach-radius-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-filter-set-item:hover{background:var(--mach-row-hover-bg)}.mach-filter-set-item input{accent-color:var(--mach-primary);margin:0;width:13px;height:13px}.mach-filter-footer{display:flex;justify-content:flex-end;gap:6px}.mach-filter-footer button{padding:4px 12px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:var(--mach-font-size);cursor:pointer}.mach-filter-footer button:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-filter-btn-apply{background:var(--mach-primary)!important;border-color:var(--mach-primary)!important;color:#fff!important}.mach-filter-btn-apply:hover{opacity:.9;color:#fff!important}.mach-column-panel{min-width:220px;max-height:70vh;overflow:auto}.mach-column-panel[role=dialog]{width:min(440px,calc(100vw - 16px))}.mach-column-workbench-search{box-sizing:border-box;width:100%;height:30px;padding:0 9px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:var(--mach-body-fg);font:inherit;outline:none}.mach-column-workbench-search:focus{border-color:var(--mach-primary);box-shadow:0 0 0 2px var(--mach-primary-weak)}.mach-column-panel-title{font-weight:600;color:var(--mach-header-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mach-column-panel-subtitle{font-size:11px;color:var(--mach-header-fg);margin-top:2px}.mach-column-panel-actions{display:flex;gap:6px;flex-wrap:wrap}.mach-column-panel-btn{flex:1;min-width:60px;padding:4px 8px;border-radius:var(--mach-radius);border:1px solid var(--mach-border-color);background:var(--mach-body-bg);color:inherit;font-family:inherit;font-size:12px;cursor:pointer;white-space:nowrap}.mach-column-panel-btn:hover{border-color:var(--mach-primary);color:var(--mach-primary)}.mach-column-panel-divider{height:1px;background:var(--mach-border-color);margin:4px 0}.mach-column-panel-list{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:1px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);padding:4px}.mach-column-workbench-item{display:grid;grid-template-columns:minmax(120px,1fr) 108px 26px 26px;align-items:center;gap:4px;min-height:32px;padding:2px 3px;border-radius:var(--mach-radius)}.mach-column-workbench-item:hover{background:var(--mach-row-hover-bg)}.mach-column-workbench-label{display:flex;min-width:0;align-items:center;gap:7px;cursor:pointer}.mach-column-workbench-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mach-column-workbench-pin-control,.mach-column-workbench-move{height:26px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);color:inherit;font:inherit}.mach-column-workbench-pin-control{width:108px;border:0}.mach-column-workbench-pin-control .mach-select-trigger{width:100%;height:26px;padding:0 7px;border-radius:var(--mach-radius);font-size:12px;box-shadow:none}.mach-column-workbench-move{padding:0;cursor:pointer}.mach-column-workbench-move:disabled{cursor:not-allowed;opacity:.35}.mach-tag{display:inline-flex;align-items:center;gap:4px;padding:0 8px;height:20px;line-height:18px;border-radius:999px;font-size:var(--mach-font-size-sm);font-weight:500;white-space:nowrap}.mach-tag:before{content:"";width:5px;height:5px;border-radius:999px;background:currentColor}.mach-tag--success{color:var(--mach-success);background:color-mix(in srgb,var(--mach-success) 10%,transparent)}.mach-tag--warning{color:var(--mach-warning);background:color-mix(in srgb,var(--mach-warning) 12%,transparent)}.mach-tag--danger{color:var(--mach-danger);background:color-mix(in srgb,var(--mach-danger) 10%,transparent)}.mach-tag--info{color:var(--mach-info);background:color-mix(in srgb,var(--mach-info) 10%,transparent)}.mach-tag--neutral{color:var(--mach-header-fg);background:color-mix(in srgb,var(--mach-header-fg) 10%,transparent)}.mach-progress{display:flex;align-items:center;gap:6px;width:100%}.mach-progress__track{flex:1;min-width:0;height:6px;border-radius:999px;background:color-mix(in srgb,var(--mach-header-fg) 14%,transparent);overflow:hidden}.mach-progress__bar{height:100%;border-radius:999px;background:var(--mach-primary);transition:width var(--mach-transition)}.mach-progress__label{flex-shrink:0;font-size:var(--mach-font-size-sm);color:var(--mach-header-fg);font-variant-numeric:tabular-nums}.mach-link{color:var(--mach-primary);cursor:pointer}.mach-link:hover{text-decoration:underline}.mach-actions{display:inline-flex;align-items:center;gap:2px}.mach-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.mach-action-btn{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;border:none;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);font-size:var(--mach-font-size-sm);line-height:1;cursor:pointer;white-space:nowrap;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-action-btn:hover{background:var(--mach-row-hover-bg);color:var(--mach-primary)}.mach-action-btn--danger:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);color:var(--mach-danger);transform:scale(1.06)}.mach-action-btn--success:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);color:var(--mach-success);transform:scale(1.06)}.mach-action-btn--primary{color:var(--mach-primary)}.mach-action-btn--warning{color:var(--mach-warning)}.mach-action-btn--success,.mach-edit-control--confirm{color:var(--mach-success)}.mach-action-btn--danger{color:var(--mach-danger)}.mach-action-btn:focus-visible,.mach-edit-control:focus-visible,.mach-cell-edit-trigger:focus-visible,.mach-action-drawer__close:focus-visible{outline:2px solid color-mix(in srgb,var(--mach-primary) 65%,transparent);outline-offset:1px}.mach-action-btn:disabled{cursor:not-allowed;opacity:.4}.mach-action-btn--loading svg{animation:mach-spin .8s linear infinite}.mach-dictionary-value--loading{color:var(--mach-header-fg);opacity:.72}.mach-dictionary-value--error{text-decoration:underline dotted;text-underline-offset:3px}.mach-action-btn--icon{padding:0;width:24px}.mach-context-menu-item--danger{color:var(--mach-danger)}.mach-context-menu-item,.mach-action-drawer__item{display:flex;align-items:center;gap:9px}.mach-context-menu-item--primary,.mach-action-drawer__item--primary{color:var(--mach-primary)}.mach-context-menu-item--warning,.mach-action-drawer__item--warning{color:var(--mach-warning)}.mach-context-menu-item--success,.mach-action-drawer__item--success{color:var(--mach-success)}.mach-context-menu-item--danger,.mach-action-drawer__item--danger{color:var(--mach-danger)}.mach-action-drawer-backdrop{position:fixed;inset:0;z-index:calc(var(--mach-z-menu) + 2);background:#0f172a33;backdrop-filter:blur(1px)}.mach-action-drawer{position:absolute;top:0;right:0;display:flex;flex-direction:column;width:min(340px,calc(100vw - 24px));height:100%;background:var(--mach-body-bg);color:var(--mach-body-fg);border-left:1px solid var(--mach-border-color);box-shadow:-16px 0 40px #0f172a24;font-family:var(--mach-font-family);animation:mach-drawer-in .18s ease-out}.mach-action-drawer__header{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:0 16px 0 20px;border-bottom:1px solid var(--mach-border-color)}.mach-action-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:var(--mach-radius);background:transparent;color:var(--mach-header-fg);cursor:pointer}.mach-action-drawer__close:hover{color:var(--mach-primary);background:var(--mach-row-hover-bg)}.mach-action-drawer__body{display:flex;flex-direction:column;gap:4px;padding:12px;overflow:auto}.mach-action-drawer__item{width:100%;min-height:40px;padding:0 12px;border:0;border-radius:var(--mach-radius);background:transparent;font:inherit;text-align:left;cursor:pointer}.mach-action-drawer__item:hover:not(:disabled){background:var(--mach-row-hover-bg)}.mach-action-drawer__item:disabled{opacity:.4;cursor:not-allowed}@keyframes mach-drawer-in{0%{transform:translate(18px);opacity:0}to{transform:translate(0);opacity:1}}@media(max-width:640px){.mach-action-drawer{top:auto;bottom:0;width:100%;height:auto;max-height:min(70vh,520px);border-top:1px solid var(--mach-border-color);border-left:0;border-radius:var(--mach-radius-lg) var(--mach-radius-lg) 0 0;animation-name:mach-drawer-up}}@keyframes mach-drawer-up{0%{transform:translateY(18px);opacity:0}to{transform:translateY(0);opacity:1}}.mach-cell:has(.mach-cell-edit-trigger){padding-right:29px}.mach-cell-edit-trigger{position:absolute;right:5px;top:50%;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;transform:translateY(-50%);border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;opacity:0;transition:opacity var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-cell-edit-trigger svg{width:13px;height:13px}.mach-cell:hover .mach-cell-edit-trigger--hover,.mach-cell:focus-within .mach-cell-edit-trigger--hover,.mach-cell-edit-trigger--always{opacity:.72}.mach-cell-edit-trigger:hover{opacity:1;color:var(--mach-primary);background:color-mix(in srgb,var(--mach-primary) 9%,transparent)}.mach-cell--editing{overflow:visible;z-index:4}.mach-cell-editor-shell,.mach-row-editor-shell{display:flex;align-items:center;width:100%;min-width:0;gap:5px}.mach-cell-editor-shell>.mach-editor-input,.mach-cell-editor-shell>.mach-editor-select-control,.mach-cell-editor-shell>:not(.mach-cell-editor-controls),.mach-row-editor-shell>*{flex:1 1 auto;min-width:0}.mach-cell-editor-controls{display:inline-flex;flex:0 0 auto;align-items:center;gap:2px;padding:2px;border:1px solid var(--mach-border-color);border-radius:var(--mach-radius);background:var(--mach-body-bg);box-shadow:var(--mach-shadow-sm)}.mach-edit-control{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:var(--mach-radius-sm);background:transparent;color:var(--mach-header-fg);cursor:pointer;transition:color var(--mach-transition),background-color var(--mach-transition),transform var(--mach-transition)}.mach-edit-control svg{width:14px;height:14px}.mach-edit-control--confirm{color:var(--mach-success)}.mach-edit-control--confirm:hover{background:color-mix(in srgb,var(--mach-success) 12%,transparent);transform:scale(1.06)}.mach-edit-control--cancel{color:var(--mach-danger)}.mach-edit-control--cancel:hover{background:color-mix(in srgb,var(--mach-danger) 10%,transparent);transform:scale(1.06)}.mach-edit-control:disabled{opacity:.35;cursor:wait}.mach-row--editing,.mach-row--editing .mach-cell{background:color-mix(in srgb,var(--mach-primary) 3%,var(--mach-body-bg))}.mach-cell--row-editing .mach-editor-input,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger{border-color:color-mix(in srgb,var(--mach-primary) 45%,var(--mach-border-color));box-shadow:0 1px 2px #0f172a0a}.mach-cell--row-editing .mach-editor-input:focus,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger:focus-visible,.mach-cell--row-editing .mach-editor-select-control .mach-select-trigger[aria-expanded=true]{border-color:var(--mach-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--mach-primary) 12%,transparent)}.mach-tooltip{position:fixed;z-index:var(--mach-z-menu);max-width:320px;padding:6px 10px;border-radius:var(--mach-radius);background:var(--mach-body-fg);color:var(--mach-body-bg);font-size:var(--mach-font-size-sm);line-height:1.5;box-shadow:var(--mach-shadow);pointer-events:none;word-break:break-word}.mach-cell--flash{animation:mach-flash .8s ease-out}@keyframes mach-flash{0%{background-color:color-mix(in srgb,var(--mach-primary) 35%,transparent)}to{background-color:transparent}}.mach-context-menu-separator{height:1px;margin:4px 6px;background:var(--mach-border-color)}.mach-context-menu-item:disabled{opacity:.45;cursor:not-allowed}.mach-pagination{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-shrink:0;height:40px;padding:0 12px;background:var(--mach-body-bg);border-top:var(--mach-border-width) solid var(--mach-border-color);color:var(--mach-body-fg);font-size:var(--mach-font-size-sm);user-select:none}.mach-pagination-total{color:var(--mach-header-fg);margin-right:8px;font-variant-numeric:tabular-nums}.mach-pagination-page{min-width:72px;text-align:center;color:var(--mach-body-fg);font-variant-numeric:tabular-nums}.mach-pagination-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:var(--mach-border-width) solid var(--mach-border-color);border-radius:var(--mach-radius-sm);background:var(--mach-body-bg);color:var(--mach-header-fg);font-size:13px;line-height:1;cursor:pointer;transition:border-color var(--mach-transition),color var(--mach-transition),background-color var(--mach-transition)}.mach-pagination-btn:hover:not(:disabled){border-color:var(--mach-primary);color:var(--mach-primary)}.mach-pagination-btn:disabled{opacity:.35;cursor:not-allowed}.mach-pagination-size-control{height:24px;margin-left:6px;width:92px;font-size:var(--mach-font-size-sm)}.mach-pagination-size-control .mach-select-trigger{width:100%;height:24px;padding:0 6px;border-width:var(--mach-border-width);border-radius:var(--mach-radius-sm);color:var(--mach-header-fg);box-shadow:none}.mach-watermark{position:absolute;inset:0;z-index:6;pointer-events:none;background-repeat:repeat}.mach-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:32px 16px;min-height:160px;text-align:center;color:var(--mach-body-fg);font-size:12px;line-height:20px;overflow-wrap:anywhere}.mach-empty__icon{fill:var(--mach-body-bg);margin-bottom:6px;width:96px;height:84px;stroke:#8b98ff;stroke-linecap:round}.mach-empty__title{font-size:14px;line-height:22px;font-weight:500}.mach-empty__hint{opacity:.45}@media(prefers-reduced-motion:reduce){.mach-spinner,.mach-loading__visual:before{animation-duration:2.4s}}.mach-cell--center{justify-content:center}.mach-cell--right{justify-content:flex-end}.mach-header-cell--center .mach-header-label{text-align:center}.mach-header-cell--right .mach-header-label{text-align:right}@media(prefers-reduced-motion:reduce){.mach-root *,.mach-root *:before,.mach-root *:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}.mach-action-drawer{animation:none!important}}.mach-root{--mach-row-warning-bg: color-mix(in srgb, var(--mach-warning) 11%, var(--mach-body-bg));--mach-row-danger-bg: color-mix(in srgb, var(--mach-danger) 9%, var(--mach-body-bg));--mach-row-success-bg: color-mix(in srgb, var(--mach-success) 10%, var(--mach-body-bg));--mach-row-info-bg: color-mix(in srgb, var(--mach-info) 10%, var(--mach-body-bg))}.mach-row--styled[data-row-tone=warning]{--mach-row-rule-bg: var(--mach-row-warning-bg)}.mach-row--styled[data-row-tone=danger]{--mach-row-rule-bg: var(--mach-row-danger-bg)}.mach-row--styled[data-row-tone=success]{--mach-row-rule-bg: var(--mach-row-success-bg)}.mach-row--styled[data-row-tone=info]{--mach-row-rule-bg: var(--mach-row-info-bg)}.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled,.mach-root :is(.mach-row,.mach-pinned-row).mach-row--styled .mach-cell{background-color:var(--mach-row-rule-bg, var(--mach-body-bg));color:var(--mach-row-rule-fg, var(--mach-body-fg))}.mach-root .mach-row--styled.mach-row--hover,.mach-root .mach-row--styled.mach-row--hover .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 4%,var(--mach-row-rule-bg, var(--mach-body-bg)))}.mach-root .mach-row--styled.mach-row--selected,.mach-root .mach-row--styled.mach-row--selected .mach-cell{background-color:color-mix(in srgb,var(--mach-primary) 12%,var(--mach-row-rule-bg, var(--mach-body-bg)))}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agile-team/mach-table",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"description": "Enterprise-grade, framework-agnostic TypeScript data grid with virtualization, editing, grouping and extensibility",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-grid",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"test": "vitest run",
|
|
169
169
|
"test:coverage": "vitest run --coverage"
|
|
170
170
|
},
|
|
171
|
-
"readme": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/ChenyCHENYU/MachTable/main/assets/mach-table-logo.svg\" alt=\"MachTable\" width=\"760\" />\n</p>\n\n# @agile-team/mach-table\n\nMachTable 0.34.
|
|
171
|
+
"readme": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/ChenyCHENYU/MachTable/main/assets/mach-table-logo.svg\" alt=\"MachTable\" width=\"760\" />\n</p>\n\n# @agile-team/mach-table\n\nMachTable 0.34.2 的框架无关 TypeScript Core:零运行时依赖,提供行列双虚拟化、领域化 API、单元格/整行编辑、树与分组、随机访问远程数据、区段隔离状态持久化和可诊断扩展系统。本版完善内置空态的表格插画、亮暗配色与两级文案;可选 `/business` 的字典列策略、本地语义合计及字典缓存隔离继续兼容;普通根入口 API 和既有默认行为保持兼容。\n\n```bash\npnpm add @agile-team/mach-table\n```\n\n```ts\nimport { createGrid, indexColumn } from \"@agile-team/mach-table\";\nimport \"@agile-team/mach-table/styles/mach-table.css\";\n\nconst api = createGrid(document.querySelector(\"#grid\")!, {\n columnDefs: [\n indexColumn({ headerName: \"序号\" }),\n { field: \"id\", headerName: \"ID\", width: 120 },\n { field: \"name\", headerName: \"名称\", flex: 1, editable: true }\n ],\n rowData: [{ id: \"1\", name: \"MachTable\" }],\n rowKey: \"id\",\n enableColumnResize: true,\n persistence: { key: \"tenant:user:customers\", sections: [\"columns\"] }\n});\n\napi.batch((grid) => {\n grid.rows.transact({ update: [{ id: \"1\", name: \"Updated\" }] });\n grid.columns.setVisible(\"internalNote\", false);\n grid.view.refreshCells({ rowIds: [\"1\"] });\n});\n\nconst saved = await api.editing.save(orderApi.saveChanges);\nconsole.table(saved.conflicts);\nconsole.info(api.diagnostics.get());\n\n// 原生宿主卸载时必须销毁;Vue/React 适配器会自动处理。\napi.destroy();\n```\n\n`persistence.sections` 同时约束进入 store 的数据与恢复范围;异步 store 写入有序,晚到加载不会覆盖加载期间的用户操作。\n\n单元格编辑通过内置对勾/取消控件显式结束,普通鼠标和焦点变化不会误提交;Enter、Escape、Tab 仍提供完整键盘路径。筛选、列设置、上下文菜单和操作菜单会继承所属表格实例的主题变量,不受宿主页面全局样式影响。\n\n编辑、粘贴、清空和填充共用已有列校验与整行校验,批量输入按行提交并合并撤销记录,异步校验不会写回已替换的数据。随机块缓存淘汰后,未保存行仍可通过编辑 API 保存或回滚;完整替换数据与重新查询会清理旧作用域的状态。\n\n`loading: true` 默认展示轻量表格骨架与本地化状态文案,空数据默认展示内置插画;需要品牌化时再通过 `overlayLoadingTemplate`、`overlayNoRowsTemplate` 覆盖,基础页面无需重复实现 loading/empty DOM。\n\n内置空态使用适配亮暗主题的淡蓝表格卡片与放大镜插画;`locale.emptyRows` 和 `locale.emptyRowsHint` 分别配置标题、说明,均按纯文本呈现。静态 SVG 不依赖远端资源或共享 id,多表并排不会互相影响。\n\n公共命令按 `rows`、`columns`、`selection`、`editing`、`filtering`、`sorting`、`pagination`、`hierarchy`、`view`、`state`、`io`、`diagnostics` 划分。完整签名见 [GridApi](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/api/grid-api.md)。\n\n大型本地数据 Worker 使用独立入口:\n\n```ts\nimport { createWorkerDataProcessor } from \"@agile-team/mach-table/worker\";\n```\n\nVue/React 项目请只安装对应适配包,它会自动安装并重导出 Core:\n\n- [@agile-team/mach-table-vue](https://www.npmjs.com/package/@agile-team/mach-table-vue)\n- [@agile-team/mach-table-react](https://www.npmjs.com/package/@agile-team/mach-table-react)\n\n## 行拖拽与条件整行颜色\n\n```ts\nimport { dragColumn, type GridOptions } from \"@agile-team/mach-table\";\n\ninterface Plan { id: string; name: string; status: string }\nconst options: GridOptions<Plan> = {\n rowKey: \"id\",\n columnDefs: [dragColumn(), { field: \"name\" }, { field: \"status\" }],\n rowStyleRules: [\n { when: ({ data }) => data.status === \"pending\", tone: \"warning\" },\n { when: ({ data }) => data.status === \"failed\", tone: \"danger\" },\n { when: ({ data }) => data.status === \"done\", tone: \"success\" }\n ]\n};\n```\n\n状态码由应用定义,包内不识别业务状态。颜色规则取第一条命中结果,未命中时沿用默认样式;支持自定义背景/文字颜色、固定列、明暗主题、选择和虚拟行复用。拖拽提供主题手柄、落点线、位置浮层、边缘滚动、Esc 取消和 Alt + ↑/↓ 移动。扁平外部数据设置 `applyRowDrag: false`,由 `onRowDragEnd` 处理持久化;自动模式先完成移动再发出事件,使用 `targetIndex` 读取最终下标。树、分组及排序等自动模式限制见[完整配方](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/row-presentation.md)。\n\n文档:[快速开始](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/getting-started.md) · [企业接入](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/enterprise-integration.md) · [API](https://github.com/ChenyCHENYU/MachTable/tree/main/docs/api)\n\n## 按需高级入口(0.34)\n\n仍从本包导入,无需另装高级功能包。普通根入口不加载这些实现或附加 CSS。\n\n| 子路径 | 功能 |\n| --- | --- |\n| `/workbench` | 高级过滤草稿与应用、修改差异/部分保存/冲突审阅、手动诊断 |\n| `/preferences` | 复合身份隔离、CAS、有序写入、历史版本及列 ID/类型迁移报告 |\n| `/ordering` | 多行/树移动、防环与业务约束、失败回滚、持久化撤销/重做 |\n| `/server-side` | 服务端分组/聚合、route 分页、缓存/刷新/事务及层级选择 |\n| `/multi-range` | Ctrl/Cmd 追加范围、格式化复制、校验清空及撤销 |\n| `/import` | 有界数据预览、共享同步/异步校验、结构化错误与过期保护 |\n| `/business` | 显式字典显示/解析/输出策略、范围与币种/单位分组的本地语义合计 |\n| `/analysis` | Pivot、安全公式、柱/折线图和数据表回退 |\n\n```ts\nimport { mountAdvancedFilterBuilder } from \"@agile-team/mach-table/workbench\";\nimport \"@agile-team/mach-table/styles/workbench.css\";\n\nconst filters = mountAdvancedFilterBuilder(host, { api });\n// 宿主卸载时调用;表格销毁也会释放工作台。\nfilters.destroy();\n```\n\n服务端分组控件使用 `/styles/server-side.css`,分析与多范围使用 `/styles/workbench.css`。排序、偏好和纯分析计算无需附加 CSS。服务端 Store 按 route 分页,不提供全树任意显示 offset;分析只处理当前已加载数据并显示范围。排序 undo/redo 的 transport 必须一次 CAS 保存 `context.operations` 的完整批次或 `context.plan.after`,只保存首参数无法完整恢复非连续/跨父级位置。\n\n完整示例与限制:[工作台](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/workbench.md) · [排序](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/row-presentation.md) · [企业偏好](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/enterprise-preferences.md) · [服务端 Store](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/server-side-store.md) · [多范围](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/multi-range.md) · [分析](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/analysis.md)。\n\nSource-available © ChenyCHENYU (Agile Team). 任何使用均须事先取得书面授权。详见 [LICENSE](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSE) 与[授权流程](https://github.com/ChenyCHENYU/MachTable/blob/main/LICENSING.md)。\n\n## 0.34 字典列策略与语义合计\n\n```ts\nimport { createDictionaryColumn, summarizeRows } from \"@agile-team/mach-table/business\";\n\nconst options = [{ value: \"ready\", label: \"已就绪\" }];\nconst labels = new Map(options.map(entry => [entry.value, entry.label]));\nconst statusColumn = {\n field: \"status\",\n ...createDictionaryColumn({ get: key => labels.get(key) }, {\n options,\n display: \"label\",\n output: { clipboard: \"label\", csv: \"code-label\" }\n })\n};\n```\n\n`/business` 无 UI、请求或缓存,连接已有 Provider;异步标签先预热,动态选项用新数组替换快照。原始数字/文本编码保留类型,重复标签拒绝歧义;未配置的输出通道保留原码,旧 renderer 的导出行为不变。\n\n`summarizeRows(rows, { scope, metrics, groupBy?, numeric? })` 只计算传入记录,支持 sum/count/ratio/none;ratio 先分别汇总分子分母。业务按币种、单位分组,scope 仅声明 page/selected/query,不自动获取全量。默认有限 number 仍遵循浮点语义,精确金额使用已有同步 numeric 策略;结果接入原 summaryMethod 或固定行。详见[业务列与字典](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/recipes/business-columns.md)。\n\n根入口的 `createCachedDictionary()` 现在复用同 key 在途请求,失效隔离旧响应并结束旧等待,缺失项受同一 TTL/LRU 约束。失败可重试,销毁拒绝未完成请求,错误观察回调不会阻塞清理。具体升级边界见[升级指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/upgrading.md)。\n\n## 列值与运行边界(自 0.33)\n\n`ColDef.valueParser` 统一编辑、粘贴和导入的规范值;`valueSerializer` 按 clipboard/csv/xlsx 定义输出,沿用已有 `columnTypes` 优先级。排序/过滤读取规范值,可信事务与撤销不重复解析。`api.io.importMatrix()` / `exportMatrix()` 直传类型,完整导入预览从当前包的 `/import` 导入 `createImportPlan()`,不加载到默认入口。\n\n`sum` / `avg` / `min` / `max` 只聚合有限数,空数值集合返回 null,sum/avg 溢出返回 null;`count` 计全部记录,空集合为 0。自定义聚合保留原始输入。分组 ID 区分数字/文本/空值,旧展开路径仅在唯一时迁移,歧义报告错误。超大远程滚动使用有界物理坐标,API、滚轮和交互共用逻辑偏移;应用默认配置的 `dataProcessor` 使用每表工厂。完整边界与升级说明见[升级指南](https://github.com/ChenyCHENYU/MachTable/blob/main/docs/guide/upgrading.md)。\n\n冻结区由正文视口统一管理滚动,原生焦点恢复和 `scrollIntoView` 不会单独改变其滚动位置。业务定位继续使用 `api.view.scrollToRow()`,无需页面补丁。\n"
|
|
172
172
|
}
|