{"version":3,"file":"adapter.cjs","names":["VISUALLY_HIDDEN","position","width","height","margin","padding","overflow","clip","whiteSpace","border","LiveRegion","t0","$","_c","children","part","t1","useEffect","useId","useRef","useState","filterCommands","nextActive","key","at","count","undefined","focusablesIn","root","querySelectorAll","CommandPaletteChrome","props","commands","open","onClose","slots","query","setQuery","active","setActive","surface","onDown","event","node","current","contains","target","document","addEventListener","removeEventListener","input","opener","listId","back","HTMLElement","focus","matches","clamped","Math","min","max","length","activeId","run","command","disabled","onSelect","onKeyDown","preventDefault","focusable","indexOf","activeElement","atEdge","shiftKey","to","labels","commandPalette","className","value","onChange","next","ref","element","arrived","role","commandSearch","placeholder","map","index","id","onClick","onMouseEnter","commandEmpty","Fragment","useRef","ContextMenuChrome","props","$","_c","at","items","onClose","slots","anchorRef","length","t0","x","y","position","left","top","width","height","pointerEvents","T0","Surface","t1","labels","contextMenu","t2","container","t3","className","t4","Item","Separator","t5","item","key","separatorBefore","onSelect","map","t6","ROW_ID_ATTRIBUTE","partAncestor","from","part","closest","resolveContextTarget","rowFor","header","columnKey","dataset","undefined","target","kind","element","row","rowId","getAttribute","value","cell","bulkActionErrorMessage","useBulkActionRunner","useBulkBarState","t0","$","_c","selection","total","confirm","labels","selectedIds","selectedCount","clear","t1","outcome","status","t2","cancel","cancelLabel","onComplete","pending","error","run","t3","errorMessage","t4","ids","expandable","headerState","visibleIds","length","t5","allMatching","undefined","scope","t6","selectAllMatching","text","allMatchingSelected","action","clearAll","onClick","pageSelected","banner","t7","useCallback","useMemo","useState","tableCommands","useShortcuts","OPEN_PALETTE_COMMAND","useCommandPalette","options","$","_c","commandPalette","enabled","undefined","open","setOpen","config","t0","Symbol","for","close","t1","show","t2","command","onCommand","t3","shortcuts","t4","commands","t5","hasFilters","labels","onClearFilters","onExport","onPrint","t6","t7","columnFor","columns","key","find","column","headerItems","columnKey","options","actions","labels","items","onSort","sortable","sorted","sortBy","push","label","sortAscending","disabled","sortDir","onSelect","sortDescending","onFilter","filter","filterColumn","separatorBefore","length","onTogglePin","lockPin","isPinned","unpin","pinStart","onHide","lockVisibility","hideColumn","dataItems","target","onCopy","copyCells","onCut","cutCells","contextMenuItems","built","kind","extra","map","item","index","useCallback","useRef","useState","LONG_PRESS_MS","LONG_PRESS_SLOP","cornerOf","element","box","getBoundingClientRect","x","left","width","y","bottom","useContextMenu","enabled","$","_c","open","setOpen","opener","press","t0","Symbol","for","current","clearTimeout","timer","cancelPress","t1","HTMLElement","focus","close","t2","target","onContextMenu","event","preventDefault","currentTarget","at","clientX","clientY","onKeyDown","event_0","wanted","key","shiftKey","onPointerDown","event_1","pointerType","element_0","setTimeout","onPointerMove","event_2","held","moved","Math","abs","onPointerUp","onPointerCancel","triggerProps","t3","useCallback","useMemo","contextMenuItems","resolveContextTarget","useContextMenu","useTableContextMenu","options","$","_c","enabled","contextMenu","undefined","menu","rowFor","t0","event","run","from","target","Element","found","triggerProps","element","forEvent","t1","kind","row","rowId","press","t2","onContextMenu","event_0","prevent","preventDefault","props","clientX","clientY","currentTarget","onKeyDown","event_1","opens","key","shiftKey","prevent_0","props_0","element_0","onPointerDown","event_2","props_1","element_1","pointerType","onPointerMove","event_3","onPointerUp","onPointerCancel","regionProps","t3","bb0","open","t4","Symbol","for","extra","items","actions","columns","isPinned","labels","sortBy","sortDir","at","t5","close","ColumnGroupToggleChrome","t0","$","_c","cell","labels","onToggle","className","slots","id","collapsible","t1","Symbol","for","Button","toggleLabel","t2","collapsed","t3","t4","action","expandColumnGroup","collapseColumnGroup","label","GripIcon","$","_c","t0","Symbol","for","EyeIcon","off","t1","undefined","t2","t3","t4","t5","PinIcon","edgePinStyle","pinnedCellStyle","cellSpanMark","pinnedDataCellStyle","pin","z","leads","bg","style","background","undefined","pinnedEdgeCellStyle","side","active","shift","insetInlineStart","SHARED_DESKTOP_ROW_KEYS","shallowEqualByKeys","keys","prev","next","every","key","mergedCellStyle","colSpan","rowSpan","appearance","fill","textAlign","verticalAlign","logicalAlign","align","sortArrow","sort","isSelectedCell","props","isMatchedCell","isCurrentMatchCell","cellHighlightStyle","base","selected","groupRowParts","kind","row","cell","card","label","groupIndentStyle","level","paddingInlineStart","resolveMobileLabel","column","mobileLabel","header","LiveRegion","ExportAnnouncer","t0","$","_c","announcement","t1","exportButtonLabel","labels","format","exportCsv","named","exportFile","toUpperCase","useCallback","useRef","useState","devWarn","exportButtonLabel","useExportHandler","handler","labels","t0","t1","$","_c","format","undefined","pageOnly","exportStatus","setExportStatus","run","setRun","inFlight","t2","current","_temp","result","t3","error","Promise","then","error_0","String","onExportCsv","t4","t5","announcementFor","t6","exportThisPage","t7","exportBusy","exportAnnouncement","exportLabel","n","status","text","outcomeText","exportDone","exportFailed","useCallback","useEffect","useMemo","useRef","useState","CHECKLIST_ITEM_HEIGHT","CHECKLIST_LIST_HEIGHT","CHECKLIST_ITEM_WIDTH","CHECKLIST_OPTION_GAP","OVERSCAN_ROWS","ROW_HEIGHT","columnsAcross","width","each","Math","max","floor","checklistWindow","count","scrollTop","columns","rowCount","ceil","visibleRows","startRow","min","endRow","start","end","padTop","padBottom","useChecklistWindow","enabled","$","_c","t0","Symbol","for","viewport","setViewport","element","t1","node","current","next","clientWidth","read","t2","node_0","ref","t3","t4","node_1","observer","ResizeObserver","observe","disconnect","t5","window","t6","onScroll","resolveLabels","CHECKLIST_LIST_HEIGHT","useChecklistFilter","CHECKLIST_ITEM_WIDTH","CHECKLIST_OPTION_GAP","useChecklistWindow","filterLabel","LIST","maxHeight","overflow","display","flexWrap","alignItems","gap","WINDOWED_LIST","undefined","height","alignContent","OPTION","flex","maxWidth","WINDOWED_OPTION","minWidth","SPACER","flexBasis","ChecklistChrome","def","source","labels","labelOverrides","classNames","slots","state","window","visible","length","virtualize","available","Search","Button","Checkbox","mounted","slice","start","end","filterChecklist","filterField","flexDirection","checklistSearch","query","filterChecklistSearch","filterInput","setQuery","filterChecklistActions","selectAll","selectAllVisible","checklistClear","clear","ref","filterChecklistList","filterCheckboxGroup","onScroll","padTop","map","item","value","label","groupCount","count","selected","includes","filterCheckbox","filterChecklistCount","on","toggle","padBottom","checklistNoValues","useState","resolveLabels","isFilterGroup","defaultFilterRegistry","filterLabel","filterOpLabel","filterTypeDefaultOp","filterTypeOps","filterWidgetKind","addFilterTreeCondition","addFilterTreeGroup","emptyFilterTree","removeFilterTreeNode","replaceFilterTreeNode","setFilterTreeCombinator","DATE_OP_LABEL_KEYS","isBetweenFilterOp","isListFilterOp","isValuelessFilterOp","NUMBER_OP_LABEL_KEYS","TEXT_OP_LABEL_KEYS","joinRelativeToken","RELATIVE_PRESET_LABEL_KEYS","RELATIVE_PRESETS","splitRelativeToken","TREE_ROW","display","flexWrap","alignItems","gap","minWidth","TREE_STACK","flexDirection","TREE_GROUP_ROOT","position","margin","padding","border","minInlineSize","TREE_GROUP_NESTED","marginBlockStart","marginInlineStart","marginInlineEnd","paddingBlock","paddingInlineStart","borderInlineStart","backgroundColor","TREE_LEGEND_HIDDEN","width","height","overflow","clip","whiteSpace","opsFor","def","registry","opLabelKey","widget","op","undefined","newCondition","key","inputTypeFor","asText","value","String","pairOf","Array","isArray","a","b","ConditionValue","t0","$","_c","condition","labels","classNames","slots","onChange","choice","Select","t1","boolTrue","label","t2","boolFalse","t3","t4","next","t5","filterField","filterSelect","token","preset","n","counted","Select_0","Input","opRelative","t6","map","item","t7","next_0","t8","t9","filterInput","next_1","Number","t10","type","Input_0","next_2","from","next_3","to","join","text","Input_1","next_4","split","ConditionRow","path","defs","onReplace","onRemove","Button","Symbol","for","bb0","find","ops","filterTreeCondition","t11","t12","_temp","t13","item_1","length","operator","filterOperator","key_0","op_0","filterTreeRemove","filterRemoveCondition","item_0","GroupActions","onAddCondition","onAddGroup","filterAddCondition","filterAddGroup","filterTreeActions","GroupView","group","onCombinator","filterTreeGroup","combinator","filterCombinatorOr","filterCombinatorAnd","filterTree","filterRemoveGroup","conditions","t14","node","index","childPath","t15","t16","t17","FilterTreeChrome","source","labelOverrides","defaultExpanded","tree","commit","setFilterTree","first","Boolean","expanded","setExpanded","Disclosure","path_0","path_1","path_2","path_3","filterTreeSummary","focusEditorOnMount","FindBarChrome","t0","$","_c","find","labels","className","slots","open","t1","findMatchCount","defaultCount","t2","index","t3","matches","length","count","t4","event","key","setOpen","preventDefault","shiftKey","previous","next","onKeyDown","Search","Button","t5","Symbol","for","display","alignItems","gap","padding","t6","findInTable","t7","findPlaceholder","t8","query","setQuery","t9","t10","findPrevious","t11","t12","t13","findNext","t14","t15","t16","findClose","t17","t18","t19","current","total","useState","useMediaQuery","HOVER_QUERY","ColumnSelectCheckboxChrome","t0","$","_c","label","checked","onToggle","className","slots","Checkbox","canHover","near","setNear","shown","t1","undefined","t2","t3","display","alignItems","opacity","transition","t4","t5","t6","t7","Symbol","for","t8","t9","_temp","_temp2","event_0","event","stopPropagation","columnSelectLabel","column","name","header","key","sameGridCell","FillHandleChrome","t0","$","_c","focus","windowIndex","col","firstRowIndex","t1","className","slots","undefined","corner","fillHandleCell","row","Handle","t2","fillHandleLabel","t3","getFillHandleProps","t4","LiveRegion","GridFocusAnnouncer","t0","$","_c","focus","enabled","t1","announcement","figure","key","label","value","format","text","SelectionStatsChrome","t0","$","_c","stats","labels","locale","className","slots","cells","t1","Intl","NumberFormat","maximumFractionDigits","t2","t3","selectionCount","t4","t5","selectionSum","t6","sum","t7","selectionAverage","t8","average","t9","selectionMin","t10","min","t11","selectionMax","t12","max","t13","filter","_temp","parts","Stats","t14","part","computePagination","SelectionStatsChrome","itemsFor","props","labels","items","notice","notices","push","key","kind","text","message","appearance","enabled","total","shown","fromIndex","toIndex","page","limit","Math","max","showing","from","to","String","selected","selectedCount","StatusBarChrome","$","_c","Bar","slots","t0","locale","stats","t1","showBar","length","t2","t3","className","GroupMoreButtonChrome","t0","$","_c","scope","remaining","groupKey","labels","onShowMore","slots","Button","t1","moreGroups","moreRowsInGroup","t2","t3","GroupToggleSpacer","$","_c","t0","Symbol","for","display","width","flexShrink","useEffect","usePrefersReducedMotion","useMountStagger","ref","deps","options","$","_c","reduced","enabled","step","t0","duration","t1","undefined","t2","map","String","join","depsKey","t3","root","current","items","querySelectorAll","forEach","el","index","animate","opacity","transform","delay","easing","fill","t4","FiltersIcon","$","_c","t0","Symbol","for","SearchIcon","ExpandChevron","open","dir","transform","t1","transition","t2","t3","fromInteractiveChild","target","Element","closest","moveRowFocus","current","delta","parent","parentElement","stops","children","filter","el","HTMLElement","dataset","next","indexOf","tabIndex","focus","rowClickProps","row","onRowClick","index","undefined","onClick","event","onKeyDown","currentTarget","key","preventDefault","style","cursor","useMemo","useRef","buildBodyCells","extraCoveredTableSlots","inflateBodyCellRowSpans","incrementalViewOf","bodyRowEntries","resolveVirtualRows","virtualColumnSpan","pinnedIdSet","getRowId","pinnedTop","pinnedBottom","pinnedIds","Set","row","add","extraCoveredSlotMap","extraRows","visualIds","cellsByRow","leadingCells","extraCoveredSlots","Map","extra","beforeRowId","undefined","has","set","tableRenderModel","props","selection","labels","table","windowed","columnWindow","enabled","columns","showActions","rowActions","length","editing","rowEditing","showReorder","rowReorder","expandable","Boolean","renderRowDetail","expansion","hasSelection","pinnedTopRows","pinnedBottomRows","rawEntries","rows","rowEntries","entries","size","filter","entry","key","fullColumns","windowKeys","map","column","cellOptions","getCellSpan","pinOffset","merge","cells","scrollRows","tree","visualRows","groupedRows","grouping","kind","firstRowIndex","index","spannedCells","clear","columnSpan","columnSpacers","start","paddingStart","end","paddingEnd","useSummaryCells","summaryRow","fromView","aggregates","builderRef","current","memo","useCallback","useRef","columnHeaderController","columnsHaveFooter","resolveColumnHeader","columnResizeHandleProps","fittedTableStyle","pinnedColumnWidth","tableMinWidth","htmlGroupedHeaderPlan","edgePinStyle","PIN_Z","pinnedCellStyle","rowEditingSignature","rowIsDirty","filterDefForColumn","columnSelectLabel","bodyCellsHaveRowSpan","cellsForRow","rowSpanSignature","extraHostFillStyle","insertExtraRows","insertExtrasBeforeRows","isExtraEntry","pinnedRowCellStyle","pinnedRowPart","pinnedRowSticky","useOffsetHeight","rowClickProps","rowPinSignature","REORDER_COLUMN_WIDTH","rowReorderDropStyle","rowReorderSignature","resolveRowStyle","rowStyleSignature","tableRenderModel","useSummaryCells","bodyRowEntries","useHorizontalOverflow","DESKTOP_SELECTION_WIDTH","DESKTOP_ACTIONS_WIDTH","DESKTOP_EXPANSION_WIDTH","DESKTOP_RESIZE_HANDLE_STYLE","position","insetInlineEnd","top","height","width","cursor","touchAction","userSelect","desktopChromeMetrics","options","expansion","widths","selection","actions","includeExpansionInLeads","expansionLead","expandable","reorderLead","showReorder","selectionWidth","hasSelection","actionsLead","showActions","start","leads","end","extraMinWidth","selectionLead","desktopHasPinned","columns","pinOffset","stickActions","reorderPinnedLead","some","column","key","desktopScrollBoxStyle","maxHeight","scrollX","overflowX","overflowY","undefined","desktopPinSignature","map","pin","side","String","inset","join","desktopRowMeasureRef","pinned","measureRowPair","index","measureElement","row","desktopBodyPinStyle","rowPinSide","rowPinOffset","body","rowPin","desktopHeadCellStyle","headerPinned","columnWidths","stickyStyle","setWidth","merged","desktopEdgeHeadStyle","active","edge","WIRING_EQUAL_KEYS","desktopRowWiringEqual","prev","next","every","createDesktopRow","RowBase","extraEqual","isGroupEntry","entry","kind","extraSlot","slot","columnSpan","extraFill","extraKind","colSpan","render","fillStyle","buildDesktopRowWiring","ctx","args","cellsByRow","rowStyle","rowHeight","pinRowSticky","rowReorder","table","gridFocus","onRowClick","handleRowClick","windowStart","editing","prefetch","handlePrefetch","labels","expansionState","rows","reorderPinned","rowPinning","rowActions","rowActionsLayout","cellSpanAppearance","renderRowActions","confirm","columnSpacers","tree","pinSignature","hasStartPin","hasEndPin","rowClassName","getRowId","onToggleSelect","onToggleExpand","renderDetail","id","sourceIndex","treeEntry","measure","bodyCells","visualStyle","focusIndex","pinPart","pinSticky","edgeRowPin","measureRef","reorderAttrs","rowAttrs","rowDomProps","getRowProps","getRowPropsAt","dropProps","isSelected","style","onMouseEnter","spanSignature","selected","expanded","isExpanded","rowCount","length","reorderSignature","treeColumnKey","columnKey","onToggleTree","toggle","actionsPinned","rowClass","rowVisualStyle","clickable","Boolean","hasPrefetch","editingSignature","onPrefetch","bodyPinStyle","appendPinnedDesktopSlots","bodySlots","pinnedRows","extraRows","wiring","push","found","findIndex","item","Math","max","appendGroupedDesktopSlots","grouping","entries","appendScrollDesktopSlots","resolvedSource","collectDesktopBodySlots","pinnedTopRows","paddingTop","paddingBottom","pinnedBottomRows","useDesktopTableAssembly","props","collapsibleColumnGroups","collapsedColumnGroups","columnGroups","renderRowDetail","summaryRow","rowEntries","stickyHeader","stickyTop","virtualScrollRef","resizeLabel","columnWindow","fitColumns","getCellSpan","headerFilters","filterDefs","model","theadRef","headerHeight","headerRowRef","live","current","onToggleGroup","groupKey","collapsed","ref","overflowRef","overflowing","metrics","hasPinned","inScrollBox","headerStickTop","zIndex","header","stickyAttr","headStyle","edgeHeadStyle","edgeBodyStyle","headerPlan","headerBand","summary","showColumnFooter","minWidth","extra","mergedTableStyle","resolvedTableStyle","Object","keys","bindScrollBox","node","wiringCtx","leaf","headerIndex","rowSpan","localStyle","headerProps","getHeaderCellProps","chainDir","source","sortLevels","find","level","dir","effectiveDir","sortBy","sortDir","sortButtonProps","getSortButtonProps","sortIndex","headerController","toggleSort","onClick","headerCaption","headerDef","columnName","verticalAlign","columnHeaderProps","getColumnHeaderProps","sortable","sortActive","caption","pinSide","resizeHandleProps","showColumnCheckbox","columnCheckbox","columnCheckboxChecked","isColumnSelected","onToggleColumn","toggleColumn","columnSelectAriaLabel","selectColumn","leading","expand","reorder","spacerStart","trailing","spacerEnd","headerRowProps","getHeaderRowProps","signature","scroll","boxStyle","tableStyle","tableProps","getTableProps","gridProps","getGridProps","callbacks","resizeHandleStyle","useCallback","useRef","nextIndex","key","at","count","undefined","SidePanelChrome","props","$","_c","panels","openPanel","onOpenPanel","onClose","slots","tabsRef","prefix","idPrefix","t0","t1","panel","findIndex","selectedIndex","Math","max","selected","event","stopPropagation","to","length","panel_0","preventDefault","id","CSS","escape","current","querySelector","focus","onKeyDown","labels","t2","side","t3","Symbol","for","display","alignItems","gap","t4","sidePanel","Tab","flex","map","panel_1","index","role","type","tabIndex","onClick","t5","closePanel","t6","Close","t7","t8","t9","t10","t11","label","t12","event_0","t13","content","t14","className","Frame","SidePanelLayout","body","flexDirection","minWidth","useCallback","useLayoutEffect","useRef","useState","resolveStickyToolbar","stickyHeader","stickyToolbar","inScrollBox","Boolean","useStickyToolbarLayout","enabled","t0","$","_c","stickyTop","undefined","nodeRef","height","setHeight","t1","node","current","next","Math","ceil","getBoundingClientRect","prev","read","t2","node_0","toolbarRef","t3","t4","node_1","ResizeObserver","ro","observe","disconnect","t5","position","top","zIndex","background","toolbarStyle","t6","t7","headerOffset","resolveLabels","assignField","availableFields","measureLabel","moveField","removeField","setMeasureAgg","AGGREGATIONS","zoneLabel","zone","labels","pivotRows","pivotColumns","pivotMeasures","PivotPanelChrome","t0","$","_c","fields","config","onChange","labelsProp","slots","className","t1","Surface","Zone","Field","Add","Agg","unused","nameOf","key","find","field","label","entriesFor","measures","map","measure","index","String","key_0","zone_0","entries","entry","index_0","pivotMoveUp","pivotMoveDown","pivotRemove","undefined","length","pivotAggregation","aggNameAt","next","pivotAdd","key_1","agg","LiveRegion","RowReorderHandleChrome","t0","$","_c","reorder","labels","rowId","localIndex","row","windowStart","rowCount","className","slots","t1","isLifted","lifted","Handle","t2","reorderRow","t3","dragProps","t4","event","handleKeyDown","t5","RowReorderButtonsChrome","upClassName","downClassName","Button","moveBy","moveRowUp","t6","moveRowDown","t7","RowReorderAnnouncer","props","announcement","TreeToggleChrome","t0","$","_c","entry","labels","onToggle","toggleClassName","spacerClassName","slots","hasChildren","t1","Symbol","for","display","width","flexShrink","t2","Button","expanded","collapseRow","expandRow","loading","t3","key","t4","treeIndentStyle","TreeToggleChrome","WRAPPER","display","alignItems","gap","TreeCellChrome","t0","$","_c","entry","columnKey","treeColumnKey","labels","onToggle","className","toggleClassName","spacerClassName","children","slots","t1","level","t2","t3","_temp","t4","t5","useState","resolveLabels","ROW","display","flexWrap","alignItems","gap","minWidth","CAPTION","flex","CONTROLS","CONTROL","ROW_LAYOUT","row","caption","controls","control","glyph","paths","filled","map","d","PENCIL","ARROW_UP","ARROW_DOWN","STAR","TRASH","SavedViewsPanelChrome","t0","$","_c","views","onApply","onRename","onMove","onSetDefault","onRemove","labels","labelsProp","footer","slots","className","Surface","Row","Input","Empty","editing","setEditing","draft","setDraft","focusOnArrival","_temp","allowed","_temp2","t1","commit","controlsFor","view_0","index","key","label","renameView","icon","onPress","view","name","undefined","moveViewUp","moveViewDown","length","setDefaultView","isDefault","pressed","deleteView","danger","t2","savedViews","t3","t4","t5","view_1","index_0","readOnly","defaultViewBadge","readOnlyViewBadge","viewName","applyView","t6","run","element","focus","useCallback","useEffect","useMemo","useRef","useState","DEFAULT_COLUMN_WIDTH","useColumnWindow","options","columns","enabled","widths","pinnedKeys","getScrollElement","overscan","viewport","setViewport","start","width","scrollElement","current","read","element","next","Math","abs","scrollLeft","clientWidth","undefined","addEventListener","passive","observer","ResizeObserver","observe","removeEventListener","disconnect","paddingStart","paddingEnd","widthOf","column","key","pinned","filter","has","scrollable","offset","first","length","last","offsets","index","entries","push","end","min","max","from","to","windowed","slice","useCallback","useEffect","useMemo","useRef","useState","autoSizeColumns","autoSizeAllColumns","ACTIONS_COLUMN_KEY","REORDER_COLUMN_KEY","flattenColumnTree","asGesture","useTableEditHistory","makeExportCsvHandler","resolveExportCsv","useExportHandler","resolveFilterMode","toolbarShowsFilters","useFindFocus","useFindInTable","cellFillHandler","cellPasteHandler","selectionStats","useGridFocus","useFullscreen","coveredAddressSet","isDeclarativeFilters","useTableData","useResolvedAdapter","useRowPinningUrlState","printToolbar","undoRedoToolbar","useChromeBodyData","useChromeScrollReset","useFilterTriggerToggle","useTableChrome","viewControlsToolbar","useColumnWindow","useDataTableShell","props","renderAutoForm","urlAdapter","urlSync","undefined","dataColumns","columns","leaves","source","runtime","locale","data","total","loading","error","mode","onQueryChange","urlKey","filters","filterTypes","defaults","paginationMode","supports","facetKeys","facets","history","onCellEdit","recordingCellEdit","autoForm","defs","length","registry","filtersNode","pinProps","useShellRowPins","chromeProps","filterDefs","filterLabels","chrome","table","confirm","getRowId","labels","filtersOpen","setFiltersOpen","windowStart","Math","max","page","limit","find","enabled","findInTable","rows","columnLayout","visibleColumns","firstRowIndex","coveredCells","getCellSpan","pinOffset","isCoveredCell","cell","has","row","col","gridFocus","cellNavigation","headerCheckbox","columnSelectionCheckbox","rowCount","dir","onCut","onCellCut","onPaste","record","onFill","onUndo","undo","onRedo","redo","onFind","openBar","matchKeys","currentMatch","current","focusCell","selectRange","stats","range","filtersTrigger","exportHandler","exportCsv","selectedIds","selection","allColumns","grouping","tree","groupTotal","summaryRow","writer","extension","featureNotices","some","notice","kind","rootRef","fullscreen","setAttribute","map","column","key","setWidth","autoSizeColumn","virtualization","groupingEntries","treeEntries","loadMoreRef","canLoadMore","virtualScrollRef","bodyScrollRef","pinnedTopRows","pinnedBottomRows","scrollBoxElement","node","hasRowActions","rowActions","hasRowReorder","rowReorder","actionsPinned","state","pinned","reorderPinned","columnWindow","virtualizeColumns","widths","pinnedKeys","Set","Object","keys","filter","getScrollElement","entries","tableProps","editingRows","rowActionsLayout","renderRowActions","rowPinning","cellSpanAppearance","extraRows","rowEntries","paddingTop","paddingBottom","measureElement","measureRowPair","fitColumns","stickyHeader","stickyTop","headerFilters","filtersMode","closeHeaderFilterOnSelect","filterRegistry","maxHeight","resizableColumns","columnWidths","resizeLabel","resizeColumn","onRowClick","prefetch","rowClassName","collapsibleColumnGroups","collapsedColumnGroups","collapsedGroups","columnGroups","onToggleColumnGroup","toggleColumnGroup","rowStyle","rowHeight","renderRowDetail","detail","render","renderCard","expansion","editing","toolbarProps","searchable","searchPlaceholder","sortByOptions","toolbar","toolbarSlots","undoRedoButtons","printButton","onPrint","hasFilters","Boolean","setFilterTree","activeFilterCount","onClearFilters","clearFilters","showRowsPerPage","onAddRow","rowMutations","canAdd","addRow","addRowLabel","editHistory","$","_c","requested","pinnedRowIds","onPinnedRowIdsChange","t0","t1","pinUrl","t2","Symbol","for","t3","next","t4"],"sources":["../src/a11y/LiveRegion.tsx","../src/actions/CommandPaletteChrome.tsx","../src/actions/ContextMenuChrome.tsx","../src/actions/contextMenuRegion.ts","../src/actions/useBulkBarState.ts","../src/actions/useCommandPalette.ts","../src/actions/contextMenuModel.ts","../src/actions/useContextMenu.ts","../src/actions/useTableContextMenu.ts","../src/columns/ColumnGroupToggle.tsx","../src/columns/icons.tsx","../src/display.ts","../src/export/ExportAnnouncer.tsx","../src/export/exportLabel.ts","../src/export/useExportHandler.ts","../src/filters/checklistWindow.ts","../src/filters/ChecklistChrome.tsx","../src/filters/FilterTreeChrome.tsx","../src/find/FindBar.tsx","../src/focus/ColumnSelectCheckbox.tsx","../src/focus/FillHandle.tsx","../src/focus/GridFocusAnnouncer.tsx","../src/focus/SelectionStatsBar.tsx","../src/focus/StatusBarChrome.tsx","../src/grouping/GroupMoreButton.tsx","../src/grouping/GroupToggleSpacer.tsx","../src/hooks/useMountStagger.ts","../src/icons.tsx","../src/rows/rowClickProps.ts","../src/tableRenderProps.ts","../src/layout/desktopTableAssembly.ts","../src/layout/SidePanelChrome.tsx","../src/layout/useStickyToolbarLayout.ts","../src/pivot/PivotPanelChrome.tsx","../src/rows/RowReorderHandle.tsx","../src/tree/TreeToggle.tsx","../src/tree/TreeCell.tsx","../src/url/SavedViewsPanelChrome.tsx","../src/virtual/useColumnWindow.ts","../src/useDataTableShell.tsx"],"sourcesContent":["/**\n * A polite live region — the one way this library says something out loud.\n *\n * The details are easy to get subtly wrong and invisible when they are:\n * `aria-live=\"polite\"` so it waits for a gap rather than interrupting,\n * `aria-atomic` so the whole phrase is read rather than the diff, and visually\n * hidden by clip rather than `display: none` — a hidden element is not\n * announced at all, which is the classic way this ships broken.\n *\n * The region must also be in the DOM **before** it has anything to say. A\n * region that appears at the same moment as its text is frequently missed\n * entirely, so callers render it empty from the first paint rather than\n * conditionally when a message exists.\n */\nimport type { ReactElement } from \"react\";\n\n/** Props for {@link LiveRegion}. */\nexport interface LiveRegionProps {\n  /** What to announce. Empty until there is something. */\n  children: string;\n  /** `data-adapttable-part`, so a test or a style can find this one. */\n  part: string;\n}\n\n/**\n * Clipped rather than hidden: a screen reader ignores `display: none` and\n * `visibility: hidden`, so the region has to remain in the layout while taking\n * no visible space.\n */\nconst VISUALLY_HIDDEN = {\n  position: \"absolute\",\n  width: \"1px\",\n  height: \"1px\",\n  margin: \"-1px\",\n  padding: 0,\n  overflow: \"hidden\",\n  clip: \"rect(0, 0, 0, 0)\",\n  whiteSpace: \"nowrap\",\n  border: 0,\n} as const;\n\n/**\n * Announce a message politely, showing nothing.\n *\n * @param props - See {@link LiveRegionProps}.\n */\nexport function LiveRegion({\n  children,\n  part,\n}: Readonly<LiveRegionProps>): ReactElement {\n  return (\n    <div\n      role=\"status\"\n      aria-live=\"polite\"\n      aria-atomic=\"true\"\n      data-adapttable-part={part}\n      style={VISUALLY_HIDDEN}\n    >\n      {children}\n    </div>\n  );\n}\n","/**\n * The command palette: every table action, findable by typing.\n *\n * A context menu answers \"what can I do to this?\"; a palette answers \"how\n * do I do that?\" — and the second question is the one people ask when they\n * cannot find a control. So it lists the same commands, and the list is\n * literally the same objects: no palette-shaped command type exists.\n *\n * Unlike the context menu, focus IS core's problem here. A palette is a\n * modal dialog, and the kits' menu primitives do not model one — their\n * dialogs do, but a dialog is not a listbox and would give the kit's\n * dismissal behaviour without the type-to-filter behaviour that makes a\n * palette a palette. So the pattern is built here, once, correctly:\n *\n * - focus moves to the input on open and back to the opener on close, so\n *   the keyboard user who summoned it is returned to where they were\n * - Tab is trapped inside, because a modal that lets focus wander behind it\n *   is a modal only visually\n * - the arrows move a highlighted option while focus stays in the input,\n *   the combobox pattern — a palette where typing loses the highlight, or\n *   where arrowing loses the caret, is unusable at speed\n * - Enter runs the highlighted command, Escape closes\n *\n * What the kit owns is every visible piece: the dialog surface, the input,\n * the rows.\n */\nimport {\n  type KeyboardEvent,\n  type ReactNode,\n  useEffect,\n  useId,\n  useRef,\n  useState,\n} from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport { type Command, filterCommands } from \"./commandRegistry\";\n\n/** Props an adapter's palette surface receives. */\nexport interface CommandPaletteSurfaceProps {\n  /** Accessible name for the dialog. */\n  readonly label: string;\n  /** Close it — bind to the kit's own dismiss channel. */\n  readonly onClose: () => void;\n  readonly children: ReactNode;\n  readonly className?: string;\n}\n\n/** Props an adapter's search input receives. */\nexport interface CommandPaletteInputProps {\n  /** Spread onto the input: value, handlers, and the combobox wiring. */\n  readonly inputProps: {\n    readonly value: string;\n    readonly onChange: (next: string) => void;\n    readonly onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n    readonly ref: (element: HTMLInputElement | null) => void;\n    readonly role: \"combobox\";\n    readonly \"aria-expanded\": true;\n    readonly \"aria-controls\": string;\n    readonly \"aria-activedescendant\": string | undefined;\n    readonly \"aria-label\": string;\n    readonly placeholder: string;\n    readonly \"data-adapttable-part\": \"command-input\";\n  };\n}\n\n/** Props an adapter's command row receives. */\nexport interface CommandPaletteItemProps {\n  readonly command: Command;\n  readonly active: boolean;\n  /** Spread onto the row: the option role, its id, and selection. */\n  readonly itemProps: {\n    readonly id: string;\n    readonly role: \"option\";\n    readonly \"aria-selected\": boolean;\n    readonly \"aria-disabled\": boolean | undefined;\n    readonly \"data-adapttable-part\": \"command-item\";\n    readonly onClick: () => void;\n    readonly onMouseEnter: () => void;\n  };\n}\n\n/** Adapter-owned rendering for {@link CommandPaletteChrome}. */\nexport interface CommandPaletteSlots {\n  /** The modal surface. */\n  readonly Surface: (props: CommandPaletteSurfaceProps) => ReactNode;\n  /** The search box. */\n  readonly Input: (props: CommandPaletteInputProps) => ReactNode;\n  /** One command. */\n  readonly Item: (props: CommandPaletteItemProps) => ReactNode;\n  /** Shown when nothing matches. */\n  readonly Empty: (props: { readonly message: string }) => ReactNode;\n}\n\n/** What the palette needs to render. */\nexport interface CommandPaletteChromeProps {\n  /** Every command available right now. */\n  commands: readonly Command[];\n  /** Whether it is showing. */\n  open: boolean;\n  /** Close it. */\n  onClose: () => void;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** A kit's own class for the surface. */\n  className?: string;\n  /** Adapter-owned visible components. */\n  slots: CommandPaletteSlots;\n}\n\n/** Move the highlight, wrapping at both ends. */\nfunction nextActive(\n  key: string,\n  at: number,\n  count: number\n): number | undefined {\n  if (count === 0) return undefined;\n  if (key === \"ArrowDown\") return (at + 1) % count;\n  if (key === \"ArrowUp\") return (at - 1 + count) % count;\n  if (key === \"Home\") return 0;\n  if (key === \"End\") return count - 1;\n  return undefined;\n}\n\n/** Every element inside that can hold focus, for the Tab trap. */\nfunction focusablesIn(root: HTMLElement | null): HTMLElement[] {\n  return [\n    ...(root?.querySelectorAll<HTMLElement>(\n      'a[href],button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex=\"-1\"])'\n    ) ?? []),\n  ];\n}\n\n/**\n * Renders the command palette, or nothing when it is closed.\n *\n * @param props - The commands, whether it is open, and the kit's slots.\n * @returns The palette.\n */\nexport function CommandPaletteChrome(\n  props: Readonly<CommandPaletteChromeProps>\n) {\n  const { commands, open, onClose, slots } = props;\n  const [query, setQuery] = useState(\"\");\n  const [active, setActive] = useState(0);\n  const surface = useRef<HTMLDivElement | null>(null);\n\n  // Clicking away closes it — decided here, beside Escape, rather than by\n  // each kit hanging a handler on its scrim. A scrim that listens has to\n  // carry an ARIA role to justify the handler, and `presentation` is ignored\n  // on an element wrapping a dialog, so the markup ends up claiming\n  // something ARIA will not honour. A document listener needs no such claim.\n  useEffect(() => {\n    if (!open) return undefined;\n    const onDown = (event: PointerEvent) => {\n      const node = surface.current;\n      if (node && !node.contains(event.target as Node)) onClose();\n    };\n    document.addEventListener(\"pointerdown\", onDown);\n    return () => {\n      document.removeEventListener(\"pointerdown\", onDown);\n    };\n  }, [open, onClose]);\n  const input = useRef<HTMLInputElement | null>(null);\n  const opener = useRef<Element | null>(null);\n  const listId = useId();\n\n  useEffect(() => {\n    if (!open) return;\n    setQuery(\"\");\n    setActive(0);\n    return () => {\n      const back = opener.current;\n      opener.current = null;\n      if (back instanceof HTMLElement) back.focus();\n    };\n  }, [open]);\n\n  const matches = filterCommands(commands, query);\n  const clamped = Math.min(active, Math.max(0, matches.length - 1));\n  const activeId = matches[clamped]\n    ? `${listId}-${matches[clamped].key}`\n    : undefined;\n\n  const run = (command: Command | undefined) => {\n    if (!command || command.disabled === true) return;\n    // Close first, exactly as the context menu does: a command that opens\n    // a dialog must not do it under a palette that is still mounted.\n    onClose();\n    command.onSelect();\n  };\n\n  const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n    if (event.key === \"Escape\") {\n      event.preventDefault();\n      onClose();\n      return;\n    }\n    if (event.key === \"Enter\") {\n      event.preventDefault();\n      run(matches[clamped]);\n      return;\n    }\n    if (event.key === \"Tab\") {\n      // The trap. A modal that lets Tab reach the page behind it is a\n      // modal to the eye and not to the keyboard.\n      const focusable = focusablesIn(surface.current);\n      if (focusable.length === 0) return;\n      const at = focusable.indexOf(document.activeElement as HTMLElement);\n      const atEdge = event.shiftKey ? at === 0 : at === focusable.length - 1;\n      if (!atEdge) return;\n      event.preventDefault();\n      (event.shiftKey ? focusable.at(-1) : focusable[0])?.focus();\n      return;\n    }\n    const to = nextActive(event.key, clamped, matches.length);\n    if (to === undefined) return;\n    event.preventDefault();\n    setActive(to);\n  };\n\n  if (!open) return null;\n  const labels = props.labels;\n  return (\n    <slots.Surface\n      label={labels?.commandPalette ?? \"Command palette\"}\n      onClose={onClose}\n      className={props.className}\n    >\n      {/* A layout wrapper for the focus trap's bounds — the kit's\n          surface around it is the element worth a part name. */}\n      <div ref={surface}>\n        <slots.Input\n          inputProps={{\n            value: query,\n            onChange: (next) => {\n              setQuery(next);\n              setActive(0);\n            },\n            onKeyDown,\n            // Focus is taken when the element ARRIVES, not when the\n            // palette opens. Several kits render their dialog through a\n            // portal that mounts a tick later, so an effect on `open`\n            // reaches for an input that does not exist yet and focus is\n            // left on the body.\n            ref: (element) => {\n              const arrived = element !== null && input.current !== element;\n              input.current = element;\n              if (!arrived) return;\n              // The opener is captured HERE, immediately before focus\n              // moves — not in an effect. The ref runs during commit and\n              // the effect after it, so an effect would record the input\n              // this line is about to focus and close would restore focus\n              // to a node that no longer exists.\n              opener.current ??= document.activeElement;\n              element.focus();\n            },\n            role: \"combobox\",\n            \"aria-expanded\": true,\n            \"aria-controls\": listId,\n            \"aria-activedescendant\": activeId,\n            \"aria-label\": labels?.commandSearch ?? \"Search commands\",\n            placeholder: labels?.commandSearch ?? \"Search commands\",\n            \"data-adapttable-part\": \"command-input\",\n          }}\n        />\n        <div\n          id={listId}\n          role=\"listbox\"\n          aria-label={labels?.commandPalette ?? \"Command palette\"}\n          data-adapttable-part=\"command-list\"\n        >\n          {matches.map((command, index) => (\n            <slots.Item\n              key={command.key}\n              command={command}\n              active={index === clamped}\n              itemProps={{\n                id: `${listId}-${command.key}`,\n                role: \"option\",\n                \"aria-selected\": index === clamped,\n                \"aria-disabled\": command.disabled,\n                \"data-adapttable-part\": \"command-item\",\n                onClick: () => {\n                  run(command);\n                },\n                onMouseEnter: () => {\n                  setActive(index);\n                },\n              }}\n            />\n          ))}\n        </div>\n        {matches.length === 0 && (\n          <slots.Empty\n            message={labels?.commandEmpty ?? \"No matching command\"}\n          />\n        )}\n      </div>\n    </slots.Surface>\n  );\n}\n","/**\n * The context menu itself: the entries, in order, inside the kit's own menu.\n *\n * What this deliberately does NOT do is manage focus. Every kit here ships a\n * menu primitive that already does — MUI's `Menu`, Mantine's, antd's\n * `Dropdown`, Radix's and Base UI's menus, and a native `<dialog>`-less\n * fallback in unstyled — and each of them handles the roving tab stop, the\n * typeahead, the portal, the z-index and the outside click the way its own\n * users expect. A second implementation layered on top would fight all of\n * them, which is the same trap the filters popover documents.\n *\n * So the division is: core decides WHAT is in the menu and in what order,\n * names the parts, and settles the one ordering question a kit would get\n * wrong — a menu closes before its entry runs, never after. The kit decides\n * how a menu looks and behaves, because that is what its users installed it\n * for.\n *\n * Closing before running matters more than it looks. An entry that opens a\n * dialog, moves focus, or re-renders the row underneath it will do so while\n * the menu is still mounted otherwise, and the menu's own focus restoration\n * then fights whatever the action just did.\n */\nimport { Fragment, type ReactNode, type RefObject, useRef } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport type { ContextMenuItem } from \"./contextMenuModel\";\nimport type { ContextMenuPoint } from \"./useContextMenu\";\n\n/** Props an adapter's menu surface receives. */\nexport interface ContextMenuSurfaceProps {\n  /** Where the menu was opened, in viewport coordinates. */\n  readonly at: ContextMenuPoint;\n  /**\n   * A zero-size element sitting at exactly that point.\n   *\n   * Every kit's menu anchors to an ELEMENT, not to coordinates — that is\n   * how it decides which way to flip near an edge and where to portal to.\n   * A right-click has coordinates and no element, so core puts one there.\n   * Anchor the kit's menu to this and its positioning, flipping and\n   * collision handling all work the way that kit's users expect.\n   */\n  readonly anchorRef: RefObject<HTMLElement | null>;\n  /** The accessible name for the menu. */\n  readonly label: string;\n  /** Close it — bind to the kit's own dismiss channel. */\n  readonly onClose: () => void;\n  /** Where the kit must portal while fullscreen; `undefined` otherwise. */\n  readonly container?: HTMLElement;\n  /** The entries, already rendered through the Item and Separator slots. */\n  readonly children: ReactNode;\n  readonly className?: string;\n}\n\n/** Props an adapter's menu entry receives. */\nexport interface ContextMenuItemProps {\n  readonly item: ContextMenuItem;\n  /**\n   * Bind this rather than `item.onSelect`: it closes the menu first, which\n   * an entry that opens a dialog or moves focus depends on.\n   */\n  readonly onSelect: () => void;\n}\n\n/** Adapter-owned rendering for {@link ContextMenuChrome}. */\nexport interface ContextMenuSlots {\n  /** The kit's menu, positioned at the point it was opened from. */\n  readonly Surface: (props: ContextMenuSurfaceProps) => ReactNode;\n  /** One entry. */\n  readonly Item: (props: ContextMenuItemProps) => ReactNode;\n  /** The divider between groups of entries. */\n  readonly Separator: () => ReactNode;\n}\n\n/** What the context menu needs to render. */\nexport interface ContextMenuChromeProps {\n  /** The entries. Nothing renders when this is empty. */\n  items: readonly ContextMenuItem[];\n  /** Where it was opened, or `null` when it is closed. */\n  at: ContextMenuPoint | null;\n  /** Close it, putting focus back where it came from. */\n  onClose: () => void;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** A kit's own class for the menu. */\n  className?: string;\n  /**\n   * Where to portal while the table is fullscreen.\n   *\n   * The Fullscreen API hides everything outside the promoted element, so a\n   * menu portalled to `document.body` is mounted, focused and invisible.\n   * `shell.fullscreen.container` is that element while it is on.\n   */\n  container?: HTMLElement;\n  /** Adapter-owned visible components. */\n  slots: ContextMenuSlots;\n}\n\n/**\n * Renders the open context menu, or nothing.\n *\n * @param props - The entries, where they were opened, and the kit's slots.\n * @returns The menu.\n */\nexport function ContextMenuChrome(props: Readonly<ContextMenuChromeProps>) {\n  const { at, items, onClose, slots } = props;\n  const anchorRef = useRef<HTMLElement | null>(null);\n  if (!at || items.length === 0) return null;\n  return (\n    <>\n      {/* The anchor. Fixed rather than absolute because the coordinates\n          came from a pointer event and are viewport-relative; zero-size and\n          `pointer-events: none` so it can never take a click of its own. */}\n      <span\n        ref={anchorRef}\n        aria-hidden=\"true\"\n        data-adapttable-part=\"context-menu-anchor\"\n        style={{\n          position: \"fixed\",\n          left: at.x,\n          top: at.y,\n          width: 0,\n          height: 0,\n          pointerEvents: \"none\",\n        }}\n      />\n      <slots.Surface\n        at={at}\n        anchorRef={anchorRef}\n        label={props.labels?.contextMenu ?? \"Table actions\"}\n        onClose={onClose}\n        container={props.container}\n        className={props.className}\n      >\n        {items.map((item) => (\n          // A Fragment, not an element: anything between `role=\"menu\"` and\n          // its items breaks the menu's own keyboard navigation, and every\n          // kit's menu relies on that structure being exactly what it looks\n          // like. The part name goes on the kit's entry, not on a wrapper.\n          <Fragment key={item.key}>\n            {item.separatorBefore === true && <slots.Separator />}\n            <slots.Item\n              item={item}\n              onSelect={() => {\n                // Close first. An entry that opens a dialog or moves focus\n                // would otherwise do it under a menu that is still mounted,\n                // and the menu's own focus restoration undoes the action's.\n                onClose();\n                item.onSelect();\n              }}\n            />\n          </Fragment>\n        ))}\n      </slots.Surface>\n    </>\n  );\n}\n","/**\n * Finding out what a right-click landed on.\n *\n * A table has three things worth a context menu — a header, a row, a cell —\n * and they are three different render paths in every adapter. Binding\n * handlers to all three, in eight kits, is twenty-four places for one of\n * them to be forgotten, and a forgotten one is invisible: the menu simply\n * never opens there, and no test that does not already know to look will\n * say so.\n *\n * So the handlers bind once, to the element that contains all three, and\n * the target is read back out of the DOM. That is what\n * `data-adapttable-part` is for — it is public contract, the same names in\n * every kit — and it means a kit wires a context menu by binding one object\n * and tagging its rows with the id they already have.\n *\n * The element the event started from is kept as well as the target, because\n * closing the menu has to put focus back, and the container is not where\n * focus was.\n */\nimport type { ContextMenuTarget } from \"./contextMenuModel\";\n\n/** The attribute a row carries so its menu knows which row it is. */\nexport const ROW_ID_ATTRIBUTE = \"data-row-id\";\n\n/** What {@link resolveContextTarget} found. */\nexport interface ResolvedContextTarget<TRow> {\n  target: ContextMenuTarget<TRow>;\n  /** The element the menu was opened from, for focus on the way back. */\n  element: HTMLElement;\n}\n\n/** The nearest ancestor carrying a part name, or null. */\nfunction partAncestor(from: Element, part: string): HTMLElement | null {\n  return from.closest<HTMLElement>(`[data-adapttable-part=\"${part}\"]`);\n}\n\n/**\n * Work out which header, row or cell an event happened in.\n *\n * @param from - The element the event started at.\n * @param rowFor - Turns a row id back into the row, since the DOM only\n *   carries the id. Returning `undefined` means the row is no longer\n *   rendered, and there is nothing to open a menu for.\n * @returns The target and the element to restore focus to, or `null` when\n *   the event happened somewhere with no menu of its own.\n */\nexport function resolveContextTarget<TRow>(\n  from: Element,\n  rowFor: (rowId: string) => TRow | undefined\n): ResolvedContextTarget<TRow> | null {\n  const header = partAncestor(from, \"header-cell\");\n  if (header) {\n    const columnKey = header.dataset.columnKey;\n    if (columnKey === undefined) return null;\n    return { target: { kind: \"header\", columnKey }, element: header };\n  }\n  const row = partAncestor(from, \"row\");\n  if (!row) return null;\n  const rowId = row.getAttribute(ROW_ID_ATTRIBUTE);\n  if (rowId === null) return null;\n  const value = rowFor(rowId);\n  if (value === undefined) return null;\n  const cell = partAncestor(from, \"cell\");\n  const columnKey = cell?.dataset.columnKey;\n  // A click on the row but outside any cell — the gap between them, a\n  // pinned spacer — is a row menu, not a cell menu with no column.\n  if (cell && columnKey !== undefined) {\n    return {\n      target: { kind: \"cell\", row: value, rowId, columnKey },\n      element: cell,\n    };\n  }\n  return { target: { kind: \"row\", row: value, rowId }, element: row };\n}\n","import type { SelectionState } from \"../selection/useSelection\";\nimport type { BulkAction, BulkActionContext, TableLabels } from \"../types\";\nimport { type ConfirmHandler } from \"./confirm\";\nimport {\n  bulkActionErrorMessage,\n  type BulkActionOutcome,\n  useBulkActionRunner,\n} from \"./useBulkActionRunner\";\n\n/** Options for {@link useBulkBarState}. */\nexport interface UseBulkBarStateOptions {\n  /** Current selection state. */\n  selection: SelectionState;\n  /** Total rows in the filtered set (drives the \"select all matching\" banner). */\n  total: number;\n  /** Confirmation handler for actions that declare a `confirm` block. */\n  confirm: ConfirmHandler;\n  /** Resolved labels. */\n  labels: Required<TableLabels>;\n}\n\n/** The derived bulk-bar state every adapter renders from. */\nexport interface BulkBarState {\n  /** Number of rows currently selected. */\n  selectedCount: number;\n  /** Selected ids as a fresh array (safe to pass to `run`). */\n  ids: string[];\n  /** Key of the action currently running, or `null`. */\n  pending: string | null;\n  /**\n   * Message of the last failed run, or `null`. The selection is KEPT on\n   * failure (so the user can retry); adapters render this in the bar,\n   * ideally in a live region.\n   */\n  errorMessage: string | null;\n  /** Run a bulk action against `ids` (and `scope` when \"all matching\" is on). */\n  run: (action: BulkAction, ids: string[], context?: BulkActionContext) => void;\n  /** Clear the selection. */\n  clear: () => void;\n  /** Whether the \"select all N matching\" banner should show. */\n  expandable: boolean;\n  /** Bulk-action scope: the whole matching set when active, else `undefined`. */\n  scope: BulkActionContext | undefined;\n  /** The banner's text, action label, and click handler for the current state. */\n  banner: { text: string; action: string; onClick: () => void };\n}\n\n/**\n * Derive the kit-independent state a bulk-action toolbar renders from:\n * the selected ids, the in-flight action, the run/clear handlers, and the\n * two-state \"select all matching\" banner. Extracting this keeps the logic in\n * one place so adapter `BulkBar` components only differ in their kit JSX.\n *\n * Call unconditionally (it uses a hook); do the `selectedCount === 0` early\n * return in the adapter AFTER calling this.\n */\nexport function useBulkBarState({\n  selection,\n  total,\n  confirm,\n  labels,\n}: Readonly<UseBulkBarStateOptions>): BulkBarState {\n  const { selectedIds, selectedCount, clear } = selection;\n  const { pending, error, run } = useBulkActionRunner({\n    confirm,\n    cancelLabel: labels.cancel,\n    // Clear only on success — a failed run keeps the selection for retry.\n    onComplete: (outcome: BulkActionOutcome) => {\n      if (outcome.status === \"success\") clear();\n    },\n  });\n  const errorMessage = bulkActionErrorMessage(error);\n  const ids = [...selectedIds];\n  // A full page is selected but more rows match elsewhere → show the\n  // two-state \"select all N matching\" banner instead of the plain count.\n  const expandable =\n    selection.headerState === \"all\" && total > selection.visibleIds.length;\n  // When \"all matching\" is active, bulk actions act on the WHOLE filtered\n  // set: the context tells the handler (and the confirm count) so.\n  const scope = selection.allMatching\n    ? { allMatching: true, total }\n    : undefined;\n  const banner = selection.allMatching\n    ? {\n        text: labels.allMatchingSelected(total),\n        action: labels.clearAll,\n        onClick: clear,\n      }\n    : {\n        text: labels.pageSelected(selection.visibleIds.length),\n        action: labels.selectAllMatching(total),\n        onClick: selection.selectAllMatching,\n      };\n  return {\n    selectedCount,\n    ids,\n    pending,\n    errorMessage,\n    run,\n    clear,\n    expandable,\n    scope,\n    banner,\n  };\n}\n","/**\n * The palette, armed: open state, the shortcut that opens it, and the\n * commands it lists.\n *\n * Same reasoning as the context menu's composition — an adapter that\n * assembles three hooks itself is an adapter that can wire two of them and\n * ship. Here the omission would be quieter still: a palette whose shortcut\n * was never bound simply never appears, and nothing on screen is missing.\n */\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport {\n  type Command,\n  type TableCommandOptions,\n  tableCommands,\n} from \"./commandRegistry\";\nimport { type Shortcut, useShortcuts } from \"./useShortcuts\";\n\n/** The command key the default shortcut runs. */\nexport const OPEN_PALETTE_COMMAND = \"command-palette\";\n\n/** How a host arms the palette. */\nexport interface CommandPaletteOptions {\n  /**\n   * Extra commands, appended after the built-in ones. They are the same\n   * objects the context menus take, so an action can be written once and\n   * offered in both.\n   */\n  commands?: readonly Command[];\n  /**\n   * The shortcuts. Defaults to Cmd/Ctrl+K opening the palette; pass your\n   * own to remap, or `[]` to bind nothing.\n   */\n  shortcuts?: readonly Shortcut[];\n}\n\n/** What {@link useCommandPalette} needs. */\nexport interface UseCommandPaletteOptions extends TableCommandOptions {\n  /** The prop as the host wrote it: `true`, an options object, or absent. */\n  commandPalette?: boolean | CommandPaletteOptions;\n  labels: TableLabels;\n}\n\n/** What an adapter binds and renders. */\nexport interface TableCommandPalette {\n  /** Whether it is showing. */\n  open: boolean;\n  /** Close it. */\n  close: () => void;\n  /** Open it — for a toolbar button or a host control. */\n  show: () => void;\n  /** Everything it lists. */\n  commands: readonly Command[];\n}\n\n/**\n * Arm a table's command palette.\n *\n * @param options - The prop, the labels, and the handlers behind the\n *   built-in commands.\n * @returns The open state and the commands.\n */\nexport function useCommandPalette(\n  options: UseCommandPaletteOptions\n): TableCommandPalette {\n  const { commandPalette } = options;\n  const enabled = commandPalette !== undefined && commandPalette !== false;\n  const [open, setOpen] = useState(false);\n  const config =\n    typeof commandPalette === \"object\" ? commandPalette : undefined;\n\n  const close = useCallback(() => {\n    setOpen(false);\n  }, []);\n  const show = useCallback(() => {\n    setOpen(true);\n  }, []);\n\n  const onCommand = useCallback((command: string) => {\n    if (command === OPEN_PALETTE_COMMAND) setOpen(true);\n  }, []);\n\n  useShortcuts({\n    enabled,\n    shortcuts: config?.shortcuts,\n    onCommand,\n  });\n\n  const commands = useMemo(\n    () =>\n      !enabled\n        ? []\n        : [\n            ...tableCommands({\n              labels: options.labels,\n              onPrint: options.onPrint,\n              onExport: options.onExport,\n              onClearFilters: options.onClearFilters,\n              hasFilters: options.hasFilters,\n            }),\n            ...(config?.commands ?? []),\n          ],\n    [\n      enabled,\n      config?.commands,\n      options.labels,\n      options.onPrint,\n      options.onExport,\n      options.onClearFilters,\n      options.hasFilters,\n    ]\n  );\n\n  return { open: enabled && open, close, show, commands };\n}\n","/**\n * What a context menu offers, and for what.\n *\n * A right-click means something different depending on where it lands. On a\n * header it means \"do something to this column\" — sort it, pin it, hide it.\n * On a cell it means \"do something with this data\" — copy it, cut it. The\n * menu is the same widget either way, so the difference lives here, in a\n * model that turns a target into a list of entries.\n *\n * The entries are data, not components. That is what lets the same list\n * drive a right-click menu, a keyboard menu opened with Shift+F10, and — in\n * #335 — a command palette, without any of them owning the actions.\n *\n * Nothing here reaches for the clipboard or changes a column itself. Every\n * entry carries an `onSelect` the caller wired, because the table asks and\n * the host does; that rule does not stop being true because the request\n * arrived from a menu.\n */\nimport type { ColumnDef, TableLabels } from \"../types\";\n\n/** Where the menu was opened. */\nexport type ContextMenuTarget<TRow> =\n  | { kind: \"header\"; columnKey: string }\n  | { kind: \"row\"; row: TRow; rowId: string }\n  | { kind: \"cell\"; row: TRow; rowId: string; columnKey: string };\n\n/** One entry in a context menu. */\nexport interface ContextMenuItem {\n  /** Stable identity, and the React key. */\n  key: string;\n  /** The caption, already localized. */\n  label: string;\n  /** Greyed and unselectable, but still announced — the menu keeps its shape. */\n  disabled?: boolean;\n  /** Destructive, so a kit can colour it as such. */\n  danger?: boolean;\n  /** Draw a divider above this entry. */\n  separatorBefore?: boolean;\n  /** What selecting it does. The menu closes first, then this runs. */\n  onSelect: () => void;\n}\n\n/** The handlers a built-in entry needs, each optional. */\nexport interface ContextMenuActions<TRow> {\n  /** Copy the selection, or this cell when nothing is selected. */\n  onCopy?: (target: ContextMenuTarget<TRow>) => void;\n  /** Cut — present only when the host wired `onCellCut`. */\n  onCut?: (target: ContextMenuTarget<TRow>) => void;\n  /** Sort by a column. */\n  onSort?: (columnKey: string, direction: \"asc\" | \"desc\") => void;\n  /** Toggle a column's pin. */\n  onTogglePin?: (columnKey: string) => void;\n  /** Hide a column. */\n  onHide?: (columnKey: string) => void;\n  /** Open the filter UI on a column. */\n  onFilter?: (columnKey: string) => void;\n}\n\n/** What {@link contextMenuItems} needs to decide the entries. */\nexport interface ContextMenuModelOptions<TRow> {\n  target: ContextMenuTarget<TRow>;\n  columns: readonly ColumnDef<TRow>[];\n  labels: TableLabels;\n  actions: ContextMenuActions<TRow>;\n  /** Which column is sorted, so the current direction can be marked. */\n  sortBy?: string;\n  /** Whether the sorted column is ascending. */\n  sortDir?: \"asc\" | \"desc\";\n  /** Whether the column is currently pinned, for the pin entry's wording. */\n  isPinned?: (columnKey: string) => boolean;\n  /**\n   * Extra entries from the host. They are appended, with a divider, so a\n   * custom action can never be mistaken for a built-in one — and cannot\n   * silently take the place of a built-in that moved.\n   */\n  extra?: (target: ContextMenuTarget<TRow>) => readonly ContextMenuItem[];\n}\n\nfunction columnFor<TRow>(\n  columns: readonly ColumnDef<TRow>[],\n  key: string\n): ColumnDef<TRow> | undefined {\n  return columns.find((column) => column.key === key);\n}\n\n/** The entries a header's menu offers for its column. */\nfunction headerItems<TRow>(\n  columnKey: string,\n  options: ContextMenuModelOptions<TRow>\n): ContextMenuItem[] {\n  const { actions, labels } = options;\n  const column = columnFor(options.columns, columnKey);\n  if (!column) return [];\n  const items: ContextMenuItem[] = [];\n  if (actions.onSort && column.sortable) {\n    const sorted = options.sortBy === columnKey;\n    items.push(\n      {\n        key: \"sort-asc\",\n        label: labels.sortAscending ?? \"Sort ascending\",\n        disabled: sorted && options.sortDir === \"asc\",\n        onSelect: () => {\n          actions.onSort?.(columnKey, \"asc\");\n        },\n      },\n      {\n        key: \"sort-desc\",\n        label: labels.sortDescending ?? \"Sort descending\",\n        disabled: sorted && options.sortDir === \"desc\",\n        onSelect: () => {\n          actions.onSort?.(columnKey, \"desc\");\n        },\n      }\n    );\n  }\n  if (actions.onFilter && column.filter) {\n    items.push({\n      key: \"filter\",\n      label: labels.filterColumn ?? \"Filter column\",\n      separatorBefore: items.length > 0,\n      onSelect: () => {\n        actions.onFilter?.(columnKey);\n      },\n    });\n  }\n  if (actions.onTogglePin && column.lockPin !== true) {\n    items.push({\n      key: \"pin\",\n      label: options.isPinned?.(columnKey)\n        ? (labels.unpin ?? \"Unpin\")\n        : (labels.pinStart ?? \"Pin to start\"),\n      separatorBefore: items.length > 0,\n      onSelect: () => {\n        actions.onTogglePin?.(columnKey);\n      },\n    });\n  }\n  if (actions.onHide && column.lockVisibility !== true) {\n    items.push({\n      key: \"hide\",\n      label: labels.hideColumn ?? \"Hide column\",\n      onSelect: () => {\n        actions.onHide?.(columnKey);\n      },\n    });\n  }\n  return items;\n}\n\n/** The entries a row's or a cell's menu offers for the data under it. */\nfunction dataItems<TRow>(\n  target: ContextMenuTarget<TRow>,\n  options: ContextMenuModelOptions<TRow>\n): ContextMenuItem[] {\n  const { actions, labels } = options;\n  const items: ContextMenuItem[] = [];\n  if (actions.onCopy) {\n    items.push({\n      key: \"copy\",\n      label: labels.copyCells ?? \"Copy\",\n      onSelect: () => {\n        actions.onCopy?.(target);\n      },\n    });\n  }\n  if (actions.onCut) {\n    items.push({\n      key: \"cut\",\n      label: labels.cutCells ?? \"Cut\",\n      onSelect: () => {\n        actions.onCut?.(target);\n      },\n    });\n  }\n  return items;\n}\n\n/**\n * The entries for one target.\n *\n * An empty list means there is no menu to open — which is the answer when\n * every action a target could offer is either unwired or locked, and the\n * reason a caller should check before showing anything.\n *\n * @param options - The target, the columns, the labels and the handlers.\n * @returns The entries, in display order.\n */\nexport function contextMenuItems<TRow>(\n  options: ContextMenuModelOptions<TRow>\n): ContextMenuItem[] {\n  const { target } = options;\n  const built =\n    target.kind === \"header\"\n      ? headerItems(target.columnKey, options)\n      : dataItems(target, options);\n  const extra = options.extra?.(target) ?? [];\n  if (extra.length === 0) return built;\n  return [\n    ...built,\n    ...extra.map((item, index) => ({\n      ...item,\n      separatorBefore: index === 0 ? built.length > 0 : item.separatorBefore,\n    })),\n  ];\n}\n","/**\n * Opening a context menu, by every route a user has.\n *\n * A right-click-only menu is a menu half the people who need it cannot\n * reach. Keyboard users open one with Shift+F10 or the dedicated menu key —\n * the same two keys that open one everywhere else in their operating\n * system, which is exactly why they are the two that must work. Touch users\n * have neither, and press and hold instead.\n *\n * All three arrive here and produce the same thing: a target, and a point\n * to put the menu at. The keyboard routes have no pointer position, so they\n * take the corner of the element that had focus, which is where the user is\n * already looking.\n *\n * The element that opened the menu is remembered, because closing has to\n * put focus back on it. A menu that drops focus to the document leaves a\n * keyboard user at the top of the page, having lost the row they were on.\n */\nimport { useCallback, useRef, useState } from \"react\";\n\nimport type { ContextMenuTarget } from \"./contextMenuModel\";\n\n/** Where on screen the menu should appear. */\nexport interface ContextMenuPoint {\n  x: number;\n  y: number;\n}\n\n/** The open menu, or `null` when there is none. */\nexport interface ContextMenuState<TRow> {\n  target: ContextMenuTarget<TRow>;\n  at: ContextMenuPoint;\n}\n\n/** How long a press has to last to count as a long press, in milliseconds. */\nconst LONG_PRESS_MS = 500;\n\n/** How far a finger may travel before a press stops being one, in pixels. */\nconst LONG_PRESS_SLOP = 10;\n\n/** What {@link useContextMenu} returns. */\nexport interface ContextMenuController<TRow> {\n  /** The open menu, or `null`. */\n  open: ContextMenuState<TRow> | null;\n  /** Close it and put focus back where it came from. */\n  close: () => void;\n  /**\n   * Handlers to spread onto a header, row or cell. Every route a user has\n   * to a context menu is in here, so an adapter binds one object rather\n   * than remembering which three events matter.\n   */\n  triggerProps: (target: ContextMenuTarget<TRow>) => {\n    onContextMenu: (event: {\n      preventDefault: () => void;\n      clientX: number;\n      clientY: number;\n      currentTarget: EventTarget & Element;\n    }) => void;\n    onKeyDown: (event: {\n      key: string;\n      shiftKey: boolean;\n      preventDefault: () => void;\n      currentTarget: EventTarget & Element;\n    }) => void;\n    onPointerDown: (event: {\n      pointerType: string;\n      clientX: number;\n      clientY: number;\n      currentTarget: EventTarget & Element;\n    }) => void;\n    onPointerMove: (event: { clientX: number; clientY: number }) => void;\n    onPointerUp: () => void;\n    onPointerCancel: () => void;\n  };\n}\n\n/** The corner of an element, for a menu opened without a pointer. */\nfunction cornerOf(element: Element): ContextMenuPoint {\n  const box = element.getBoundingClientRect();\n  return { x: box.left + box.width / 2, y: box.bottom };\n}\n\n/**\n * Wire up a context menu's open state.\n *\n * @param enabled - Whether the menu is armed at all. Off, every handler is\n *   inert and no timer is ever started.\n * @returns The open state and the handlers to bind.\n */\nexport function useContextMenu<TRow>(\n  enabled: boolean\n): ContextMenuController<TRow> {\n  const [open, setOpen] = useState<ContextMenuState<TRow> | null>(null);\n  const opener = useRef<Element | null>(null);\n  const press = useRef<{\n    timer: ReturnType<typeof setTimeout>;\n    at: ContextMenuPoint;\n  } | null>(null);\n\n  const cancelPress = useCallback(() => {\n    if (!press.current) return;\n    clearTimeout(press.current.timer);\n    press.current = null;\n  }, []);\n\n  const close = useCallback(() => {\n    setOpen(null);\n    // Focus goes back to the element the menu was opened from. Without\n    // this a keyboard user lands at the top of the document, having lost\n    // the row they were working on.\n    const element = opener.current;\n    opener.current = null;\n    if (element instanceof HTMLElement) element.focus();\n  }, []);\n\n  const triggerProps = useCallback(\n    (target: ContextMenuTarget<TRow>) => ({\n      onContextMenu: (event: {\n        preventDefault: () => void;\n        clientX: number;\n        clientY: number;\n        currentTarget: EventTarget & Element;\n      }) => {\n        if (!enabled) return;\n        event.preventDefault();\n        opener.current = event.currentTarget;\n        setOpen({ target, at: { x: event.clientX, y: event.clientY } });\n      },\n      onKeyDown: (event: {\n        key: string;\n        shiftKey: boolean;\n        preventDefault: () => void;\n        currentTarget: EventTarget & Element;\n      }) => {\n        if (!enabled) return;\n        // The two keys an operating system already uses for this. Anything\n        // else here would be a shortcut people have to be taught.\n        const wanted =\n          event.key === \"ContextMenu\" ||\n          (event.shiftKey && event.key === \"F10\");\n        if (!wanted) return;\n        event.preventDefault();\n        opener.current = event.currentTarget;\n        setOpen({ target, at: cornerOf(event.currentTarget) });\n      },\n      onPointerDown: (event: {\n        pointerType: string;\n        clientX: number;\n        clientY: number;\n        currentTarget: EventTarget & Element;\n      }) => {\n        // Only touch: a held mouse button is a drag, and a held pen is\n        // usually a barrel-button gesture the browser handles itself.\n        if (!enabled || event.pointerType !== \"touch\") return;\n        const element = event.currentTarget;\n        const at = { x: event.clientX, y: event.clientY };\n        cancelPress();\n        press.current = {\n          at,\n          timer: setTimeout(() => {\n            press.current = null;\n            opener.current = element;\n            setOpen({ target, at });\n          }, LONG_PRESS_MS),\n        };\n      },\n      onPointerMove: (event: { clientX: number; clientY: number }) => {\n        const held = press.current;\n        if (!held) return;\n        // A finger that travels is scrolling, not pressing.\n        const moved =\n          Math.abs(event.clientX - held.at.x) > LONG_PRESS_SLOP ||\n          Math.abs(event.clientY - held.at.y) > LONG_PRESS_SLOP;\n        if (moved) cancelPress();\n      },\n      onPointerUp: cancelPress,\n      onPointerCancel: cancelPress,\n    }),\n    [cancelPress, enabled]\n  );\n\n  return { open, close, triggerProps };\n}\n","/**\n * One hook that turns the `contextMenu` prop into something an adapter can\n * bind.\n *\n * The pieces already exist separately — the routes in, the target read back\n * out of the DOM, the entries a target deserves — and each is separately\n * testable, which is why they are separate. But an adapter should not have\n * to assemble them: eight kits assembling the same four calls is eight\n * chances to bind the pointer handlers and forget the keyboard ones, which\n * is the failure this whole feature exists to avoid.\n *\n * So this composes them into two things. `regionProps` goes on whatever\n * element contains the headers, rows and cells. `menu` is everything the\n * chrome needs. There is no third thing to remember.\n */\nimport { useCallback, useMemo } from \"react\";\n\nimport type { ColumnDef, TableLabels } from \"../types\";\nimport {\n  type ContextMenuActions,\n  type ContextMenuItem,\n  contextMenuItems,\n  type ContextMenuTarget,\n} from \"./contextMenuModel\";\nimport { resolveContextTarget } from \"./contextMenuRegion\";\nimport { type ContextMenuPoint, useContextMenu } from \"./useContextMenu\";\n\n/** How a host arms the context menu. */\nexport interface ContextMenuOptions<TRow> {\n  /**\n   * Extra entries, appended behind a divider so a custom action is never\n   * mistaken for a built-in one.\n   */\n  items?: (target: ContextMenuTarget<TRow>) => readonly ContextMenuItem[];\n}\n\n/** What {@link useTableContextMenu} needs. */\nexport interface TableContextMenuOptions<TRow> {\n  /** The prop as the host wrote it: `true`, an options object, or absent. */\n  contextMenu?: boolean | ContextMenuOptions<TRow>;\n  columns: readonly ColumnDef<TRow>[];\n  labels: TableLabels;\n  /** The row behind an id, since the DOM only carries the id. */\n  rowFor: (rowId: string) => TRow | undefined;\n  /** The handlers the built-in entries call. */\n  actions: ContextMenuActions<TRow>;\n  sortBy?: string;\n  sortDir?: \"asc\" | \"desc\";\n  isPinned?: (columnKey: string) => boolean;\n}\n\n/** What an adapter binds and renders. */\nexport interface TableContextMenu {\n  /** Spread onto the element containing the headers, rows and cells. */\n  regionProps: Record<string, unknown>;\n  /** The entries for whatever is open; empty when nothing is. */\n  items: readonly ContextMenuItem[];\n  /** Where it was opened, or `null` when it is closed. */\n  at: ContextMenuPoint | null;\n  /** Close it, putting focus back where it came from. */\n  close: () => void;\n}\n\n/**\n * Arm a table's context menu.\n *\n * @param options - The prop, the columns, and the handlers behind the\n *   built-in entries.\n * @returns The props to bind and the state to render.\n */\nexport function useTableContextMenu<TRow>(\n  options: TableContextMenuOptions<TRow>\n): TableContextMenu {\n  const enabled =\n    options.contextMenu !== undefined && options.contextMenu !== false;\n  const menu = useContextMenu<TRow>(enabled);\n  const { rowFor } = options;\n\n  // The region's handlers are the trigger's, with the target resolved from\n  // whatever the event started at rather than fixed at bind time.\n  const forEvent = useCallback(\n    <E extends { target: EventTarget | null }>(\n      event: E,\n      run: (\n        props: ReturnType<typeof menu.triggerProps>,\n        element: Element\n      ) => void\n    ) => {\n      const from = event.target;\n      if (!(from instanceof Element)) return;\n      const found = resolveContextTarget<TRow>(from, rowFor);\n      if (!found) return;\n      run(menu.triggerProps(found.target), found.element);\n    },\n    [menu, rowFor]\n  );\n\n  // The press handlers are target-free, so they are taken once rather than\n  // rebuilt per event: only the opening routes need to know what was hit.\n  const press = useMemo(\n    () => menu.triggerProps({ kind: \"row\", row: undefined as TRow, rowId: \"\" }),\n    [menu]\n  );\n\n  const regionProps = useMemo(\n    () =>\n      enabled\n        ? {\n            onContextMenu: (event: React.MouseEvent<HTMLElement>) => {\n              const prevent = () => {\n                event.preventDefault();\n              };\n              forEvent(event, (props, element) => {\n                // Built field by field, never spread: a React synthetic\n                // event keeps `clientX` and the rest on its prototype, so\n                // `{...event}` yields an object with none of them and a\n                // menu that silently never opens.\n                props.onContextMenu({\n                  preventDefault: prevent,\n                  clientX: event.clientX,\n                  clientY: event.clientY,\n                  currentTarget: element,\n                });\n              });\n            },\n            onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => {\n              // The key is checked BEFORE the target is resolved. This fires\n              // on every keystroke in the table, typing in a cell editor\n              // included, and resolving a target first would put a DOM walk\n              // behind each one — the same mistake the pointer handlers made.\n              const opens =\n                event.key === \"ContextMenu\" ||\n                (event.shiftKey && event.key === \"F10\");\n              if (!opens) return;\n              const prevent = () => {\n                event.preventDefault();\n              };\n              forEvent(event, (props, element) => {\n                props.onKeyDown({\n                  key: event.key,\n                  shiftKey: event.shiftKey,\n                  preventDefault: prevent,\n                  currentTarget: element,\n                });\n              });\n            },\n            onPointerDown: (event: React.PointerEvent<HTMLElement>) => {\n              forEvent(event, (props, element) => {\n                props.onPointerDown({\n                  pointerType: event.pointerType,\n                  clientX: event.clientX,\n                  clientY: event.clientY,\n                  currentTarget: element,\n                });\n              });\n            },\n            // These three need no target, so they must not resolve one.\n            // `onPointerMove` fires on every mouse movement across the whole\n            // table, and a `closest()` walk per movement made a browser test\n            // suite six times slower before this was noticed.\n            onPointerMove: (event: React.PointerEvent<HTMLElement>) => {\n              press.onPointerMove({\n                clientX: event.clientX,\n                clientY: event.clientY,\n              });\n            },\n            onPointerUp: press.onPointerUp,\n            onPointerCancel: press.onPointerCancel,\n          }\n        : {},\n    [enabled, forEvent, press]\n  );\n\n  const items = useMemo(() => {\n    if (!menu.open) return [];\n    const extra =\n      typeof options.contextMenu === \"object\"\n        ? options.contextMenu.items\n        : undefined;\n    return contextMenuItems<TRow>({\n      target: menu.open.target,\n      columns: options.columns,\n      labels: options.labels,\n      actions: options.actions,\n      sortBy: options.sortBy,\n      sortDir: options.sortDir,\n      isPinned: options.isPinned,\n      extra,\n    });\n  }, [menu.open, options]);\n\n  return { regionProps, items, at: menu.open?.at ?? null, close: menu.close };\n}\n","import type { ReactElement, ReactNode } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport type { HeaderGroupCell } from \"./headerGroups\";\n\n/** Props for an adapter {@link ColumnGroupToggle} — no slots on the public API. */\nexport interface ColumnGroupToggleProps {\n  cell: HeaderGroupCell;\n  labels: Required<TableLabels>;\n  onToggle: (id: string) => void;\n  className?: string;\n}\n\n/** Kit button the column-group chrome calls. */\nexport interface ColumnGroupToggleButtonProps {\n  readonly label: string;\n  readonly expanded: boolean;\n  readonly className?: string;\n  readonly onClick: () => void;\n}\n\n/** Adapter-supplied controls for {@link ColumnGroupToggleChrome}. */\nexport interface ColumnGroupToggleSlots {\n  readonly Button: (props: ColumnGroupToggleButtonProps) => ReactNode;\n}\n\n/** Props for {@link ColumnGroupToggleChrome}. */\nexport interface ColumnGroupToggleChromeProps extends ColumnGroupToggleProps {\n  readonly slots: ColumnGroupToggleSlots;\n}\n\n/** Collapse/expand control for one column-group header cell. */\nexport function ColumnGroupToggleChrome({\n  cell,\n  labels,\n  onToggle,\n  className,\n  slots,\n}: Readonly<ColumnGroupToggleChromeProps>): ReactElement {\n  const id = cell.id;\n  if (!cell.collapsible || id === null) return <></>;\n  const Button = slots.Button;\n  return (\n    <Button\n      label={toggleLabel(cell, labels)}\n      expanded={!cell.collapsed}\n      className={className}\n      onClick={() => onToggle(id)}\n    />\n  );\n}\n\nfunction toggleLabel(\n  cell: HeaderGroupCell,\n  labels: Required<TableLabels>\n): string {\n  const action = cell.collapsed\n    ? labels.expandColumnGroup\n    : labels.collapseColumnGroup;\n  return cell.label ? `${action}: ${cell.label}` : action;\n}\n","import type { ReactElement } from \"react\";\n\n/**\n * Shared column-menu glyphs (currentColor, no icon-lib dependency) so every\n * adapter's column popover looks identical: a drag grip, an eye visibility\n * toggle, and a pin.\n */\n\n/** Six-dot drag grip. */\nexport function GripIcon(): ReactElement {\n  return (\n    <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n      <g fill=\"currentColor\">\n        <circle cx=\"9\" cy=\"6\" r=\"1.6\" />\n        <circle cx=\"15\" cy=\"6\" r=\"1.6\" />\n        <circle cx=\"9\" cy=\"12\" r=\"1.6\" />\n        <circle cx=\"15\" cy=\"12\" r=\"1.6\" />\n        <circle cx=\"9\" cy=\"18\" r=\"1.6\" />\n        <circle cx=\"15\" cy=\"18\" r=\"1.6\" />\n      </g>\n    </svg>\n  );\n}\n\n/** Eye (visible) / eye with slash (hidden) toggle glyph. */\nexport function EyeIcon({\n  off = false,\n}: Readonly<{ off?: boolean }>): ReactElement {\n  return (\n    <svg\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"1.8\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n    >\n      <path d=\"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z\" />\n      <circle cx=\"12\" cy=\"12\" r=\"3\" />\n      {off && <path d=\"M3 3l18 18\" />}\n    </svg>\n  );\n}\n\n/** Pin glyph. */\nexport function PinIcon(): ReactElement {\n  return (\n    <svg\n      width=\"15\"\n      height=\"15\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"1.8\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n    >\n      <path d=\"M9 4h6l-1 6 3 3v2H7v-2l3-3-1-6Z\" />\n      <path d=\"M12 15v5\" />\n    </svg>\n  );\n}\n","import type { CSSProperties } from \"react\";\n\nimport {\n  edgePinStyle,\n  type PinLeads,\n  pinnedCellStyle,\n  type PinOffset,\n  type PinSide,\n} from \"./columns/useColumnLayout\";\nimport { type CellSpanAppearance, cellSpanMark } from \"./rows/cellSpan\";\nimport type { ColumnDef } from \"./types\";\n\n/**\n * Kit-independent display helpers shared by every adapter's table chrome —\n * logical alignment, the sort-indicator glyph, sticky pinned-cell styles, and\n * the row-memo guard. Centralising them keeps the adapters' render files from\n * duplicating the same pure logic.\n */\n\n/**\n * Pinned data-cell sticky style with an opaque `background` so scrolled columns\n * don't bleed through the pinned ones. Adapters pass their kit's surface\n * background token as `bg`; a raw `style` object keeps the pixel insets the\n * core layout computes from being mangled by a kit's prop-to-spacing scale.\n */\nexport function pinnedDataCellStyle(\n  pin: PinOffset | undefined,\n  z: number,\n  leads: PinLeads,\n  bg: string\n): CSSProperties | undefined {\n  const style = pinnedCellStyle(pin, z, leads);\n  return style ? { ...style, background: bg } : undefined;\n}\n\n/**\n * Sticky style for a non-data edge cell (expand chevron, selection, actions):\n * flush to its side when a data column on that side is pinned. `shift` insets a\n * left-edge cell past the leading expansion column so the chevron and the\n * selection checkbox pin side by side.\n */\nexport function pinnedEdgeCellStyle(\n  side: PinSide,\n  active: boolean,\n  z: number,\n  bg: string,\n  shift = 0\n): CSSProperties | undefined {\n  const pin = edgePinStyle(side, active, z);\n  if (!pin) return undefined;\n  const style: CSSProperties = { ...pin, background: bg };\n  if (shift > 0) style.insetInlineStart = shift;\n  return style;\n}\n\n/**\n * The row-prop keys (other than the kit's own accent token) that change a\n * desktop row's visuals — the memo guard re-renders a row only when one of\n * these differs. Each adapter appends its theming key (`accentColor`)\n * to this shared base.\n */\nexport const SHARED_DESKTOP_ROW_KEYS = [\n  \"row\",\n  \"id\",\n  \"index\",\n  \"selected\",\n  \"expanded\",\n  \"size\",\n  \"dir\",\n  \"columns\",\n  \"columnWidths\",\n  \"pinSignature\",\n  \"className\",\n  \"labels\",\n  \"hasSelection\",\n  \"expandable\",\n  \"showActions\",\n  \"showReorder\",\n  \"reorderSignature\",\n  \"rowPinSignature\",\n  \"spanSignature\",\n  \"hasRowClick\",\n  \"columnSpan\",\n  // Cell focus and the selected range live here too, or a row never learns that\n  // one of its cells became focused or selected. Omitting it is why the range\n  // was invisible after 2.2.0: the live region announced the new cell (it sits\n  // outside the memo) while every row kept its previous render, so no cell ever\n  // showed `data-cell-selected`. The state object is memoized as a whole, so\n  // this compares one reference and changes only when focus or the range does.\n  \"gridFocus\",\n  // A tree row's own place in the hierarchy — depth, whether it is open, and\n  // whether its children are loading. Without it a folder's children appear\n  // while its chevron stays shut, because the row that owns the chevron never\n  // re-renders.\n  \"treeEntry\",\n  // Which column carries the chevron, so moving the tree column moves it.\n  \"treeColumnKey\",\n  \"rowActionsLayout\",\n  \"renderRowActions\",\n  \"cellSpanAppearance\",\n] as const;\n\n/** Shallow-equal two objects across a fixed key set (the row-memo guard). */\nexport function shallowEqualByKeys<T>(\n  keys: readonly (keyof T)[],\n  prev: Readonly<T>,\n  next: Readonly<T>\n): boolean {\n  return keys.every((key) => prev[key] === next[key]);\n}\n\n/**\n * Spreadsheet merge paint: centered content and one fill across the span.\n * `\"plain\"` (or a 1×1 cell) returns nothing. Adapters pass this as the base\n * to {@link cellHighlightStyle} so a selection or find hit still wins the\n * background. Override the fill with `--adapttable-cell-span-fill`.\n *\n * @param colSpan - Horizontal span on the origin cell.\n * @param rowSpan - Vertical span on the origin cell.\n * @param appearance - `\"merged\"` (default) or `\"plain\"`.\n * @param fill - `\"off\"` keeps centering without a wash (unstyled selection\n *   classes need the background free).\n */\nexport function mergedCellStyle(\n  colSpan: number,\n  rowSpan: number,\n  appearance?: CellSpanAppearance,\n  fill: \"on\" | \"off\" = \"on\"\n): CSSProperties | undefined {\n  if (appearance === \"plain\") return undefined;\n  if (cellSpanMark(colSpan, rowSpan) === undefined) return undefined;\n  const style: CSSProperties = {\n    textAlign: \"center\",\n    verticalAlign: \"middle\",\n  };\n  if (fill === \"on\") {\n    style.background =\n      \"var(--adapttable-cell-span-fill, color-mix(in srgb, currentColor 12%, transparent))\";\n  }\n  return style;\n}\n\n/**\n * Map a column's logical alignment onto the `\"start\" | \"center\" | \"end\"`\n * value every kit's cell/justify prop accepts. `undefined` defaults to start.\n */\nexport function logicalAlign(\n  align: ColumnDef<unknown>[\"align\"]\n): \"start\" | \"center\" | \"end\" {\n  if (align === \"center\") return \"center\";\n  if (align === \"end\") return \"end\";\n  return \"start\";\n}\n\n/**\n * Header sort indicator text derived from a cell's computed sort state\n * (`aria-sort` value): `↑` ascending, `↓` descending, `↕` unsorted. Kits that\n * render the bare arrows as emoji (e.g. Radix Themes' font) append a\n * text-presentation selector on top of this base string.\n */\nexport function sortArrow(sort: unknown): string {\n  if (sort === \"ascending\") return \" ↑\";\n  if (sort === \"descending\") return \" ↓\";\n  return \" ↕\";\n}\n\n/**\n * Is this cell inside the selected range?\n *\n * Core marks a selected cell with `data-cell-selected` through\n * `gridFocus.getCellProps`, but it cannot colour it: a selection has to look\n * like the kit it lives in, and a hard-coded blue would be wrong in seven of\n * eight. So core answers the question and each adapter answers it with its own\n * theme token — the same division as {@link pinnedDataCellStyle}, which takes\n * the kit's surface colour as an argument.\n *\n * Without this the range was invisible: the attribute reached the DOM in 2.2.0\n * and no adapter styled it, so a user extending a selection saw nothing move.\n *\n * @param props - The props from `getCellProps` / `getCellPropsAt`, or nothing.\n * @returns Whether the cell should render as selected.\n */\nexport function isSelectedCell(\n  props: Readonly<Record<string, unknown>> | undefined\n): boolean {\n  return props?.[\"data-cell-selected\"] !== undefined;\n}\n\n/**\n * Is this cell one the find bar matched?\n *\n * @param props - The props from `getCellProps` / `getCellPropsAt`, or nothing.\n * @returns Whether the cell contains a match.\n */\nexport function isMatchedCell(\n  props: Readonly<Record<string, unknown>> | undefined\n): boolean {\n  return props?.[\"data-cell-match\"] !== undefined;\n}\n\n/**\n * Is this the match the find walk is currently on?\n *\n * @param props - The props from `getCellProps` / `getCellPropsAt`, or nothing.\n * @returns Whether the cell is the current match.\n */\nexport function isCurrentMatchCell(\n  props: Readonly<Record<string, unknown>> | undefined\n): boolean {\n  return props?.[\"data-cell-match-current\"] !== undefined;\n}\n\n/**\n * A cell's background, given everything that might want to colour it.\n *\n * A find highlight is the one cell colour that is NOT a kit's to choose. It is\n * a browser convention — the same amber every browser paints Ctrl+F hits in —\n * and a table that answered it in eight different accent colours would be\n * harder to read, not more native. So the kit supplies its selection fill and\n * core supplies the match fill, both overridable through\n * `--adapttable-find-match` / `--adapttable-find-match-current`.\n *\n * The current match wins over other matches, which win over the selection —\n * the find walk moves the selection with it, so without that order the cell\n * you were sent to would be the one cell not marked as a hit.\n *\n * @param props - The props from `getCellProps` / `getCellPropsAt`, or nothing.\n * @param base - The kit's own cell style (pinning, alignment).\n * @param selected - The kit's fill for a selected cell.\n * @returns The merged style, or `base` when nothing highlights this cell.\n */\nexport function cellHighlightStyle(\n  props: Readonly<Record<string, unknown>> | undefined,\n  base: CSSProperties | undefined,\n  selected: CSSProperties\n): CSSProperties | undefined {\n  if (isCurrentMatchCell(props)) {\n    return {\n      ...base,\n      background:\n        \"var(--adapttable-find-match-current, rgba(255, 150, 50, 0.75))\",\n    };\n  }\n  if (isMatchedCell(props)) {\n    return {\n      ...base,\n      background: \"var(--adapttable-find-match, rgba(255, 213, 0, 0.45))\",\n    };\n  }\n  return isSelectedCell(props) ? { ...base, ...selected } : base;\n}\n\n/** The three rows a grouped body renders, all through one component. */\nexport type GroupRowKind = \"group\" | \"groupFooter\" | \"groupMore\";\n\n/**\n * The `data-adapttable-part` names for one of those rows.\n *\n * One place decides them, because a header, its footer and its \"show more\" row\n * are the same component in every kit — and three nested ternaries per kit is\n * how those names drift apart.\n *\n * @param kind - Which of the three the entry is.\n * @returns The part names for its row, cell, card and label.\n */\nexport function groupRowParts(kind: GroupRowKind): {\n  row: string;\n  cell: string;\n  card: string;\n  label: string;\n} {\n  if (kind === \"groupMore\") {\n    return {\n      row: \"group-more-row\",\n      cell: \"group-more-cell\",\n      card: \"group-more-card\",\n      label: \"group-more-label\",\n    };\n  }\n  if (kind === \"groupFooter\") {\n    return {\n      row: \"group-footer-row\",\n      cell: \"group-footer-cell\",\n      card: \"group-footer-card\",\n      label: \"group-label\",\n    };\n  }\n  return {\n    row: \"group-row\",\n    cell: \"group-cell\",\n    card: \"group-card\",\n    label: \"group-label\",\n  };\n}\n\n/**\n * How far a nested group header sits in from the one above it.\n *\n * Logical padding, so a nested group indents from the right in Arabic and\n * Hebrew without a second rule. One value in core rather than eight in the\n * adapters: nesting that steps by 1.5rem in one kit and 8px in another reads\n * as a bug in whichever the user sees second.\n *\n * @param level - The header's depth, from zero.\n * @returns The style for the header's label cell.\n */\nexport function groupIndentStyle(level: number): CSSProperties {\n  return level > 0 ? { paddingInlineStart: `${level * 1.5}rem` } : {};\n}\n\n/**\n * The caption a mobile card shows beside a cell's value.\n *\n * A card is a list of label/value pairs, not a grid with a header row, so each\n * value has to carry its own caption. `mobileLabel` sets it; an **empty string**\n * deliberately removes it, which is how a card shows a bare value (an avatar, a\n * title line) with no caption above it. Without one, a string `header` is the\n * caption and the column's key is the last resort.\n *\n * Every adapter's card layout resolves this the same way, and it lives here\n * because seven of them once each had their own copy under two different names.\n *\n * @typeParam TRow - The row type.\n * @param column - The column being rendered in a card.\n * @returns The caption, or `undefined` when the card should show none.\n */\nexport function resolveMobileLabel<TRow>(\n  column: ColumnDef<TRow>\n): string | undefined {\n  if (column.mobileLabel !== undefined) return column.mobileLabel || undefined;\n  return typeof column.header === \"string\" ? column.header : column.key;\n}\n","/**\n * The live region that says an export finished — or did not.\n *\n * A download is silent. The file lands in the browser's downloads with no\n * focus change and no visible confirmation inside the page, so a screen-reader\n * user who presses Export hears nothing at all and cannot tell success from\n * failure. That is the whole reason this exists, and why it is an announcement\n * rather than a toast: the toast would need dismissing, styling in eight kits,\n * and a decision about where it goes.\n */\nimport type { ReactElement } from \"react\";\n\nimport { LiveRegion } from \"../a11y/LiveRegion\";\n\n/** Props for {@link ExportAnnouncer}. */\nexport interface ExportAnnouncerProps {\n  /** `exportAnnouncement` from `useExportHandler`. Empty until an export ends. */\n  announcement: string;\n}\n\n/**\n * Renders the export's outcome announcement. Always mounted beside the button,\n * because a region that appears together with its message is missed.\n *\n * @param props - See {@link ExportAnnouncerProps}.\n */\nexport function ExportAnnouncer({\n  announcement,\n}: Readonly<ExportAnnouncerProps>): ReactElement {\n  return <LiveRegion part=\"export-announcer\">{announcement}</LiveRegion>;\n}\n","/**\n * What the export button says.\n *\n * The button downloads whatever format its writer produces, so a fixed \"Export\n * CSV\" is wrong the moment a spreadsheet writer is passed — it names a file the\n * user is not getting. CSV keeps its own label, because seventeen translations\n * of it already exist and a host may have overridden the string; every other\n * format asks {@link TableLabels.exportFile} for a caption instead.\n */\nimport type { TableLabels } from \"../types\";\n\n/**\n * The caption for an export button producing `format`.\n *\n * @param labels - Resolved table labels.\n * @param format - The writer's extension, e.g. `\"csv\"` or `\"xlsx\"`.\n * @returns The button's text.\n */\nexport function exportButtonLabel(\n  labels: TableLabels | undefined,\n  format: string\n): string {\n  if (format === \"csv\") return labels?.exportCsv ?? \"Export CSV\";\n  const named = labels?.exportFile?.(format);\n  return named ?? `Export ${format.toUpperCase()}`;\n}\n","/**\n * The Export button's click handler, what it is doing, and what it just did.\n *\n * The built-in browser export is synchronous: it builds a string and hands it\n * to the browser, and the button is never busy for long. A host-handled export\n * (`exportCsv.request`) is not — it may be a round trip or a queued job — so a\n * second click could start the same export again.\n *\n * This wraps either kind. The returned handler refuses a click while a promise\n * is still settling, `busy` is what adapters render as their kit's loading\n * affordance, and the announcement is what a screen reader hears when the\n * export finishes or fails — which is otherwise nothing at all: a download is\n * silent, and a failed one is silent in exactly the same way. Every adapter\n * goes through this, so none of it can differ between kits.\n */\nimport { useCallback, useRef, useState } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport { devWarn } from \"../utils/devWarn\";\nimport { exportButtonLabel } from \"./exportLabel\";\n\n/** Where an export is in its life. */\nexport type ExportStatus = \"idle\" | \"busy\" | \"done\" | \"failed\";\n\n/** What {@link useExportHandler} returns. */\nexport interface ExportHandlerState {\n  /** Bind to the Export button, or `undefined` when export is off. */\n  onExportCsv: (() => void) | undefined;\n  /** True while a host-handled export is still running. */\n  exportBusy: boolean;\n  /**\n   * Idle, busy, done or failed — for a kit that shows more than a spinner, and\n   * for tests that assert the outcome rather than the visuals.\n   */\n  exportStatus: ExportStatus;\n  /**\n   * Live-region text for the last outcome, empty until there is one. Adapters\n   * render it in a polite region beside the button.\n   */\n  exportAnnouncement: string;\n  /**\n   * The button's caption, naming the format it actually produces — \"Export CSV\"\n   * by default, \"Export XLSX\" with the spreadsheet writer, and localized either\n   * way. A button that names a file the user is not getting is a lie no adapter\n   * should have to correct.\n   */\n  exportLabel: string;\n}\n\n/**\n * Make an export handler single-flight, and report what it is doing.\n *\n * @param handler - The handler from `makeExportCsvHandler`, or `undefined`\n *   when the `exportCsv` prop is off.\n * @param labels - Resolved table labels, for the caption and the announcements.\n * @param format - The writer's extension. Defaults to `\"csv\"`, the built-in.\n * @param pageOnly - The handler writes the current page even though the\n *   host asked for `\"all\"`. The button says so instead of \"Export CSV\".\n */\nexport function useExportHandler(\n  handler: (() => void | Promise<void>) | undefined,\n  labels?: TableLabels,\n  format = \"csv\",\n  pageOnly = false\n): ExportHandlerState {\n  const [exportStatus, setExportStatus] = useState<ExportStatus>(\"idle\");\n  // Which run the current status belongs to. Exporting the same table twice\n  // produces the same phrase, and a live region whose text has not changed is\n  // announced once — so the run number rides along and breaks the tie.\n  const [run, setRun] = useState(0);\n  // A ref as well as state: the state renders the button, the ref is what the\n  // click reads, so a second click cannot slip through before React re-renders.\n  const inFlight = useRef(false);\n\n  const onExportCsv = useCallback(() => {\n    if (!handler || inFlight.current) return;\n    setExportStatus(\"busy\");\n    setRun((n) => n + 1);\n    let result: void | Promise<void>;\n    try {\n      result = handler();\n    } catch (error) {\n      // The host's error, and still the host's to handle — but the user is\n      // told, rather than left looking at a button that did nothing.\n      setExportStatus(\"failed\");\n      throw error;\n    }\n    if (!(result instanceof Promise)) {\n      // The browser already has the file: synchronous work is finished the\n      // moment it returns.\n      setExportStatus(\"done\");\n      return;\n    }\n    inFlight.current = true;\n    // Both outcomes release the button — a rejected export must not leave it\n    // disabled for the rest of the session.\n    //\n    // The rejection is handled here rather than left to float, because an\n    // unhandled rejection would surface in the host's error reporting as\n    // something the table did. It is still the host's error, so development\n    // says so out loud instead of swallowing it.\n    void result.then(\n      () => {\n        inFlight.current = false;\n        setExportStatus(\"done\");\n      },\n      (error: unknown) => {\n        inFlight.current = false;\n        setExportStatus(\"failed\");\n        devWarn(\n          `exportCsv.request rejected, so no export happened. Handle the failure ` +\n            `inside your request function — this warning is all the table can do ` +\n            `with it. Reason: ${String(error)}`\n        );\n      }\n    );\n  }, [handler]);\n\n  // The button stays rendered while busy — disabled, not gone.\n  return {\n    onExportCsv: handler ? onExportCsv : undefined,\n    exportBusy: exportStatus === \"busy\",\n    exportStatus,\n    exportAnnouncement: announcementFor(exportStatus, run, labels),\n    exportLabel: pageOnly\n      ? (labels?.exportThisPage ?? \"Export this page\")\n      : exportButtonLabel(labels, format),\n  };\n}\n\n/**\n * The phrase for an outcome; busy and idle say nothing.\n *\n * Every other run carries a trailing invisible separator (U+2063). It is not\n * drawn and not spoken, and it is what makes two identical outcomes in a row\n * read as two changes rather than one — the alternative is a second export\n * that announces nothing.\n */\nfunction announcementFor(\n  status: ExportStatus,\n  run: number,\n  labels?: TableLabels\n): string {\n  const text = outcomeText(status, labels);\n  if (text === \"\") return \"\";\n  return run % 2 === 0 ? text : `${text}\\u2063`;\n}\n\n/** The label for a finished export; nothing while it is idle or running. */\nfunction outcomeText(status: ExportStatus, labels?: TableLabels): string {\n  if (status === \"done\") return labels?.exportDone ?? \"Export complete\";\n  if (status === \"failed\") return labels?.exportFailed ?? \"Export failed\";\n  return \"\";\n}\n","/**\n * The window behind a long checklist.\n *\n * A column with two hundred distinct values renders two hundred kit\n * checkboxes into a 240px popover, and every keystroke in the search box\n * re-renders all of them. Windowing keeps that to what a reader can see plus\n * a margin, and holds the rest open with two spacers so the scrollbar still\n * describes the whole list.\n *\n * The list wraps — several options to a row — so the window is computed in\n * ROWS of options, not options. That needs to know how many fit across, which\n * is why the virtualized layout gives every option the same width: with a\n * uniform cell the count is arithmetic on the measured container instead of a\n * per-item measurement pass. Before anything is measured the answer is one per\n * row, which over-renders slightly and is never wrong.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { CHECKLIST_ITEM_HEIGHT, CHECKLIST_LIST_HEIGHT } from \"./checklist\";\n\n/** Width of one option cell while the list is windowed, in px. */\nexport const CHECKLIST_ITEM_WIDTH = 200;\n\n/** Space between option cells, in px — both axes. */\nexport const CHECKLIST_OPTION_GAP = 8;\n\n/** Rows rendered either side of the visible span. */\nconst OVERSCAN_ROWS = 2;\n\n/** Height one row of options occupies, gap included. */\nconst ROW_HEIGHT = CHECKLIST_ITEM_HEIGHT + CHECKLIST_OPTION_GAP;\n\n/** The slice to render and the space the rest of the list occupies. */\nexport interface ChecklistWindow {\n  /** Index of the first option to render. */\n  start: number;\n  /** Index one past the last option to render. */\n  end: number;\n  /** Height of the spacer before the window, in px. */\n  padTop: number;\n  /** Height of the spacer after it, in px. */\n  padBottom: number;\n}\n\n/** How many uniform option cells fit across a container of this width. */\nexport function columnsAcross(width: number): number {\n  if (width <= 0) return 1;\n  const each = CHECKLIST_ITEM_WIDTH + CHECKLIST_OPTION_GAP;\n  return Math.max(1, Math.floor((width + CHECKLIST_OPTION_GAP) / each));\n}\n\n/** The window over `count` options at a scroll position, given the row width. */\nexport function checklistWindow(\n  count: number,\n  scrollTop: number,\n  width: number\n): ChecklistWindow {\n  const columns = columnsAcross(width);\n  const rowCount = Math.ceil(count / columns);\n  const visibleRows = Math.ceil(CHECKLIST_LIST_HEIGHT / ROW_HEIGHT);\n  const startRow = Math.max(\n    0,\n    Math.min(\n      Math.floor(scrollTop / ROW_HEIGHT) - OVERSCAN_ROWS,\n      Math.max(0, rowCount - visibleRows)\n    )\n  );\n  const endRow = Math.min(rowCount, startRow + visibleRows + OVERSCAN_ROWS * 2);\n  return {\n    start: startRow * columns,\n    end: Math.min(count, endRow * columns),\n    padTop: startRow * ROW_HEIGHT,\n    padBottom: Math.max(0, (rowCount - endRow) * ROW_HEIGHT),\n  };\n}\n\n/** What {@link useChecklistWindow} hands the layout. */\nexport interface ChecklistWindowState extends ChecklistWindow {\n  /** Attach to the scrolling list element. */\n  ref: (element: HTMLDivElement | null) => void;\n  /** Attach to the same element's `onScroll`. */\n  onScroll: () => void;\n}\n\n/**\n * Track a checklist list's scroll position and width, and derive its window.\n *\n * @param count - How many options the list holds.\n * @param enabled - False below the virtualization threshold: the whole list\n *   renders, and no listener is attached.\n * @returns The slice to render plus the handlers that keep it current.\n */\nexport function useChecklistWindow(\n  count: number,\n  enabled: boolean\n): ChecklistWindowState {\n  const [viewport, setViewport] = useState({ scrollTop: 0, width: 0 });\n  const element = useRef<HTMLDivElement | null>(null);\n\n  const read = useCallback(() => {\n    const node = element.current;\n    if (!node) return;\n    const next = { scrollTop: node.scrollTop, width: node.clientWidth };\n    // Same numbers, same object: a fresh one per scroll event would re-render\n    // every checkbox at 60fps for nothing.\n    setViewport((current) =>\n      current.scrollTop === next.scrollTop && current.width === next.width\n        ? current\n        : next\n    );\n  }, []);\n\n  const ref = useCallback(\n    (node: HTMLDivElement | null) => {\n      element.current = node;\n      read();\n    },\n    [read]\n  );\n\n  useEffect(() => {\n    const node = element.current;\n    if (!enabled || !node) return undefined;\n    const observer =\n      typeof ResizeObserver === \"undefined\"\n        ? null\n        : new ResizeObserver(() => {\n            read();\n          });\n    observer?.observe(node);\n    return () => {\n      observer?.disconnect();\n    };\n  }, [enabled, read]);\n\n  const window = useMemo(\n    () =>\n      enabled\n        ? checklistWindow(count, viewport.scrollTop, viewport.width)\n        : { start: 0, end: count, padTop: 0, padBottom: 0 },\n    [enabled, count, viewport]\n  );\n\n  return { ...window, ref, onScroll: read };\n}\n","/**\n * Compact checklist layout. Structure only — adapters pass the search\n * field, action buttons and checkboxes the end user clicks. Options wrap\n * like the multi-select form; they never stack one value per row.\n *\n * Past {@link CHECKLIST_VIRTUALIZE_AT} options the list windows: a column\n * with hundreds of distinct values would otherwise mount hundreds of kit\n * checkboxes behind a 240px viewport. Windowing is structure, so it lives\n * here rather than in any adapter — the slots still render whatever their\n * kit renders, there are just fewer of them at a time.\n */\nimport { type CSSProperties, type ReactNode } from \"react\";\n\nimport { resolveLabels } from \"../labels\";\nimport type { TableSource } from \"../source/TableSource\";\nimport type { TableLabels } from \"../types\";\nimport { CHECKLIST_LIST_HEIGHT, useChecklistFilter } from \"./checklist\";\nimport {\n  CHECKLIST_ITEM_WIDTH,\n  CHECKLIST_OPTION_GAP,\n  useChecklistWindow,\n} from \"./checklistWindow\";\nimport { type FilterDef, filterLabel } from \"./filterDefs\";\n\n/** Class hooks the unstyled adapter maps onto `DataTableClassNames`. */\nexport interface ChecklistClassNames {\n  filterChecklist?: string;\n  filterChecklistSearch?: string;\n  filterChecklistActions?: string;\n  filterChecklistList?: string;\n  filterChecklistCount?: string;\n  filterField?: string;\n  filterLabel?: string;\n  filterInput?: string;\n  filterCheckboxGroup?: string;\n  filterCheckbox?: string;\n}\n\n/** Props for an adapter {@link ChecklistFilter} — no slots on the public API. */\nexport interface ChecklistFilterProps<TRow> {\n  readonly def: FilterDef<TRow>;\n  readonly source: Pick<\n    TableSource<TRow>,\n    \"allFilteredRows\" | \"extra\" | \"setExtra\" | \"facets\"\n  >;\n  readonly labels?: TableLabels;\n  readonly classNames?: ChecklistClassNames;\n}\n\n/** Kit search field the checklist layout calls. */\nexport interface ChecklistSearchProps {\n  readonly label: string;\n  readonly value: string;\n  readonly className?: string;\n  readonly onChange: (value: string) => void;\n}\n\n/** Kit button the checklist layout calls. */\nexport interface ChecklistButtonProps {\n  readonly label: string;\n  readonly onClick: () => void;\n}\n\n/** Kit checkbox row the checklist layout calls. */\nexport interface ChecklistCheckboxProps {\n  readonly label: string;\n  readonly count: string;\n  readonly checked: boolean;\n  readonly className?: string;\n  readonly countClassName?: string;\n  readonly onChange: (checked: boolean) => void;\n}\n\n/** Adapter-supplied controls for {@link ChecklistChrome}. */\nexport interface ChecklistSlots {\n  readonly Search: (props: ChecklistSearchProps) => ReactNode;\n  readonly Button: (props: ChecklistButtonProps) => ReactNode;\n  readonly Checkbox: (props: ChecklistCheckboxProps) => ReactNode;\n}\n\n/** Props for {@link ChecklistChrome}. */\nexport interface ChecklistChromeProps<TRow> extends ChecklistFilterProps<TRow> {\n  readonly slots: ChecklistSlots;\n}\n\nconst LIST: CSSProperties = {\n  maxHeight: CHECKLIST_LIST_HEIGHT,\n  overflow: \"auto\",\n  display: \"flex\",\n  flexWrap: \"wrap\",\n  alignItems: \"center\",\n  gap: CHECKLIST_OPTION_GAP,\n};\n\n/**\n * The windowed list is a fixed viewport with rows that start at the top: the\n * spacers stand in for what is not mounted, so the box can never grow to fit\n * its content or the scrollbar would describe the window instead of the list.\n */\nconst WINDOWED_LIST: CSSProperties = {\n  ...LIST,\n  maxHeight: undefined,\n  height: CHECKLIST_LIST_HEIGHT,\n  alignItems: \"flex-start\",\n  alignContent: \"flex-start\",\n};\n\nconst OPTION: CSSProperties = {\n  flex: \"0 0 auto\",\n  display: \"inline-flex\",\n  alignItems: \"center\",\n  maxWidth: \"100%\",\n};\n\n/**\n * Uniform cells while windowed. Options-per-row has to be arithmetic for the\n * window to know which row it is on, and a natural-width chip cloud has no\n * such number.\n */\nconst WINDOWED_OPTION: CSSProperties = {\n  ...OPTION,\n  flex: `0 0 ${CHECKLIST_ITEM_WIDTH}px`,\n  minWidth: 0,\n};\n\n/** Forces a row break so the spacer holds open whole rows, not a gap in one. */\nconst SPACER: CSSProperties = { flexBasis: \"100%\", height: 0 };\n\n/**\n * Distinct-values checklist layout. Returns `null` when the source has no\n * `allFilteredRows` and no facets — a server page must declare facets\n * before this widget can count a set it does not hold.\n */\nexport function ChecklistChrome<TRow>({\n  def,\n  source,\n  labels: labelOverrides,\n  classNames = {},\n  slots,\n}: Readonly<ChecklistChromeProps<TRow>>) {\n  const labels = resolveLabels(labelOverrides);\n  const state = useChecklistFilter(def, source);\n  const window = useChecklistWindow(state.visible.length, state.virtualize);\n  if (!state.available) return null;\n  const Search = slots.Search;\n  const Button = slots.Button;\n  const Checkbox = slots.Checkbox;\n  const mounted = state.visible.slice(window.start, window.end);\n\n  return (\n    <div\n      data-adapttable-part=\"filter-checklist\"\n      className={classNames.filterChecklist ?? classNames.filterField}\n      style={{ display: \"flex\", flexDirection: \"column\", gap: 8, minWidth: 0 }}\n    >\n      <div\n        data-adapttable-part=\"filter-label\"\n        className={classNames.filterLabel}\n      >\n        {filterLabel(def)}\n      </div>\n      <Search\n        label={labels.checklistSearch}\n        value={state.query}\n        className={classNames.filterChecklistSearch ?? classNames.filterInput}\n        onChange={state.setQuery}\n      />\n      <div\n        data-adapttable-part=\"filter-checklist-actions\"\n        className={classNames.filterChecklistActions}\n        style={{ display: \"flex\", flexWrap: \"wrap\", gap: 8 }}\n      >\n        <Button label={labels.selectAll} onClick={state.selectAllVisible} />\n        <Button label={labels.checklistClear} onClick={state.clear} />\n      </div>\n      <div\n        ref={window.ref}\n        data-adapttable-part=\"filter-checklist-list\"\n        data-virtualized={state.virtualize ? \"true\" : \"false\"}\n        className={\n          classNames.filterChecklistList ?? classNames.filterCheckboxGroup\n        }\n        style={state.virtualize ? WINDOWED_LIST : LIST}\n        onScroll={state.virtualize ? window.onScroll : undefined}\n      >\n        {window.padTop > 0 ? (\n          <div style={{ ...SPACER, height: window.padTop }} />\n        ) : null}\n        {mounted.map((item) => (\n          <div\n            key={item.value}\n            style={state.virtualize ? WINDOWED_OPTION : OPTION}\n          >\n            <Checkbox\n              label={item.label}\n              count={labels.groupCount(item.count)}\n              checked={state.selected.includes(item.value)}\n              className={classNames.filterCheckbox}\n              countClassName={classNames.filterChecklistCount}\n              onChange={(on) => state.toggle(item.value, on)}\n            />\n          </div>\n        ))}\n        {window.padBottom > 0 ? (\n          <div style={{ ...SPACER, height: window.padBottom }} />\n        ) : null}\n        {state.visible.length === 0 ? (\n          <span>{labels.checklistNoValues}</span>\n        ) : null}\n      </div>\n    </div>\n  );\n}\n","/**\n * AND/OR filter-tree layout. Structure only — adapters pass the Select,\n * Input and Button the end user clicks. Core does not draw form controls.\n */\nimport { type CSSProperties, type ReactNode, useState } from \"react\";\n\nimport { resolveLabels } from \"../labels\";\nimport type { QueryCondition, QueryFilterGroup } from \"../source/queryContract\";\nimport { isFilterGroup } from \"../source/queryContract\";\nimport type { TableSource } from \"../source/TableSource\";\nimport type { TableLabels } from \"../types\";\nimport { defaultFilterRegistry } from \"./filterBuiltins\";\nimport { type FilterDef, filterLabel } from \"./filterDefs\";\nimport { filterOpLabel } from \"./filterForm\";\nimport {\n  filterTypeDefaultOp,\n  filterTypeOps,\n  type FilterTypeRegistry,\n  filterWidgetKind,\n} from \"./filterRegistry\";\nimport {\n  addFilterTreeCondition,\n  addFilterTreeGroup,\n  emptyFilterTree,\n  removeFilterTreeNode,\n  replaceFilterTreeNode,\n  setFilterTreeCombinator,\n} from \"./filterTreeMutations\";\nimport {\n  DATE_OP_LABEL_KEYS,\n  isBetweenFilterOp,\n  isListFilterOp,\n  isValuelessFilterOp,\n  NUMBER_OP_LABEL_KEYS,\n  TEXT_OP_LABEL_KEYS,\n} from \"./operators\";\nimport {\n  joinRelativeToken,\n  RELATIVE_PRESET_LABEL_KEYS,\n  RELATIVE_PRESETS,\n  type RelativePreset,\n  splitRelativeToken,\n} from \"./relativeDates\";\n\n/** Class hooks the unstyled adapter maps onto `DataTableClassNames`. */\nexport interface FilterTreeClassNames {\n  filterTree?: string;\n  filterTreeGroup?: string;\n  filterTreeCondition?: string;\n  filterTreeActions?: string;\n  filterTreeRemove?: string;\n  filterTreeSummary?: string;\n  filtersForm?: string;\n  filterField?: string;\n  filterLabel?: string;\n  filterInput?: string;\n  filterSelect?: string;\n  filterOperator?: string;\n}\n\n/** Props for an adapter {@link FilterTreeBuilder} — no slots on the public API. */\nexport interface FilterTreeBuilderProps<TRow> {\n  readonly defs: readonly FilterDef<TRow>[];\n  readonly source: Pick<TableSource<TRow>, \"filterTree\" | \"setFilterTree\">;\n  readonly labels?: TableLabels;\n  readonly classNames?: FilterTreeClassNames;\n  readonly registry?: FilterTypeRegistry;\n  /** Open Advanced on first paint. Default: open only when a tree already exists. */\n  readonly defaultExpanded?: boolean;\n}\n\n/** One option in a tree Select. */\nexport interface FilterTreeOption {\n  readonly value: string;\n  readonly label: string;\n}\n\n/** Kit Select the tree layout calls. */\nexport interface FilterTreeSelectProps {\n  readonly label: string;\n  readonly value: string;\n  readonly part: string;\n  readonly options: readonly FilterTreeOption[];\n  readonly className?: string;\n  readonly fieldClassName?: string;\n  readonly labelClassName?: string;\n  readonly onChange: (value: string) => void;\n}\n\n/** Kit text/number/date field the tree layout calls. */\nexport interface FilterTreeInputProps {\n  readonly label: string;\n  readonly value: string;\n  readonly type: \"text\" | \"number\" | \"date\";\n  readonly className?: string;\n  readonly fieldClassName?: string;\n  readonly labelClassName?: string;\n  readonly onChange: (value: string) => void;\n}\n\n/** Kit button the tree layout calls. */\nexport interface FilterTreeButtonProps {\n  readonly label: string;\n  readonly part?: string;\n  readonly className?: string;\n  readonly onClick: () => void;\n}\n\n/** Kit disclosure that owns the Advanced section's visible chrome. */\nexport interface FilterTreeDisclosureProps {\n  readonly label: string;\n  readonly expanded: boolean;\n  readonly className?: string;\n  readonly summaryClassName?: string;\n  readonly children: ReactNode;\n  readonly onExpandedChange: (expanded: boolean) => void;\n}\n\n/** Adapter-supplied controls for {@link FilterTreeChrome}. */\nexport interface FilterTreeSlots {\n  readonly Select: (props: FilterTreeSelectProps) => ReactNode;\n  readonly Input: (props: FilterTreeInputProps) => ReactNode;\n  readonly Button: (props: FilterTreeButtonProps) => ReactNode;\n  readonly Disclosure: (props: FilterTreeDisclosureProps) => ReactNode;\n}\n\n/** One compact condition — field, operator, value, remove on a wrapping row. */\nconst TREE_ROW: CSSProperties = {\n  display: \"flex\",\n  flexWrap: \"wrap\",\n  alignItems: \"flex-end\",\n  gap: 8,\n  minWidth: 0,\n};\n\n/** Nested groups and the Advanced shell stack rows, they do not list fields. */\nconst TREE_STACK: CSSProperties = {\n  display: \"flex\",\n  flexDirection: \"column\",\n  gap: 8,\n  minWidth: 0,\n};\n\nconst TREE_GROUP_ROOT: CSSProperties = {\n  ...TREE_STACK,\n  position: \"relative\",\n  margin: 0,\n  padding: 0,\n  border: \"none\",\n  minInlineSize: 0,\n};\n\n/** Nested groups sit on a rail so AND/OR depth is visible. */\nconst TREE_GROUP_NESTED: CSSProperties = {\n  ...TREE_STACK,\n  position: \"relative\",\n  marginBlockStart: 4,\n  marginInlineStart: 16,\n  marginInlineEnd: 0,\n  paddingBlock: 8,\n  paddingInlineStart: 12,\n  border: \"none\",\n  borderInlineStart:\n    \"2px solid color-mix(in srgb, currentColor 22%, transparent)\",\n  backgroundColor: \"color-mix(in srgb, currentColor 5%, transparent)\",\n  minInlineSize: 0,\n};\n\nconst TREE_LEGEND_HIDDEN: CSSProperties = {\n  position: \"absolute\",\n  width: \"1px\",\n  height: \"1px\",\n  margin: \"-1px\",\n  padding: 0,\n  overflow: \"hidden\",\n  clip: \"rect(0, 0, 0, 0)\",\n  whiteSpace: \"nowrap\",\n  border: 0,\n};\n\n/** Props for {@link FilterTreeChrome}. */\nexport interface FilterTreeChromeProps<\n  TRow,\n> extends FilterTreeBuilderProps<TRow> {\n  readonly slots: FilterTreeSlots;\n}\n\nfunction opsFor<TRow>(\n  def: FilterDef<TRow>,\n  registry: FilterTypeRegistry\n): readonly string[] {\n  return filterTypeOps(def, registry);\n}\n\nfunction opLabelKey(\n  widget: string | undefined,\n  op: string\n): keyof TableLabels | undefined {\n  if (widget === \"text\" && op in TEXT_OP_LABEL_KEYS) {\n    return TEXT_OP_LABEL_KEYS[op as keyof typeof TEXT_OP_LABEL_KEYS];\n  }\n  if (widget === \"numberRange\" && op in NUMBER_OP_LABEL_KEYS) {\n    return NUMBER_OP_LABEL_KEYS[op as keyof typeof NUMBER_OP_LABEL_KEYS];\n  }\n  if (widget === \"dateRange\" && op in DATE_OP_LABEL_KEYS) {\n    return DATE_OP_LABEL_KEYS[op as keyof typeof DATE_OP_LABEL_KEYS];\n  }\n  return undefined;\n}\n\nfunction newCondition<TRow>(\n  def: FilterDef<TRow>,\n  registry: FilterTypeRegistry\n): QueryCondition {\n  return { key: def.key, op: filterTypeDefaultOp(def, registry) };\n}\n\nfunction inputTypeFor(\n  widget: string | undefined,\n  op: string\n): \"text\" | \"number\" | \"date\" {\n  if (op === \"relative\" || isListFilterOp(op)) return \"text\";\n  if (widget === \"numberRange\") return \"number\";\n  if (widget === \"dateRange\") return \"date\";\n  return \"text\";\n}\n\nfunction asText(value: unknown): string {\n  if (value == null) return \"\";\n  if (typeof value === \"string\") return value;\n  if (typeof value === \"number\" || typeof value === \"boolean\") {\n    return String(value);\n  }\n  return \"\";\n}\n\nfunction pairOf(value: unknown): { a: string; b: string } {\n  if (Array.isArray(value)) {\n    return { a: asText(value[0]), b: asText(value[1]) };\n  }\n  return { a: asText(value), b: \"\" };\n}\n\nfunction ConditionValue<TRow>({\n  def,\n  condition,\n  labels,\n  classNames,\n  registry,\n  slots,\n  onChange,\n}: Readonly<{\n  def: FilterDef<TRow>;\n  condition: QueryCondition;\n  labels: Required<TableLabels>;\n  classNames: FilterTreeClassNames;\n  registry: FilterTypeRegistry;\n  slots: FilterTreeSlots;\n  onChange: (value: unknown) => void;\n}>) {\n  if (isValuelessFilterOp(condition.op)) return null;\n  if (filterWidgetKind(def, registry) === \"boolean\") {\n    const choice =\n      condition.value === false || condition.value === \"false\"\n        ? \"false\"\n        : \"true\";\n    const Select = slots.Select;\n    return (\n      <Select\n        label={labels.value}\n        value={choice}\n        part=\"filter-select\"\n        className={classNames.filterSelect}\n        fieldClassName={classNames.filterField}\n        labelClassName={classNames.filterLabel}\n        options={[\n          { value: \"true\", label: labels.boolTrue },\n          { value: \"false\", label: labels.boolFalse },\n        ]}\n        onChange={(next) => onChange(next === \"true\")}\n      />\n    );\n  }\n  if (condition.op === \"relative\") {\n    const token =\n      typeof condition.value === \"string\" ? condition.value : \"today\";\n    const { preset, n } = splitRelativeToken(token);\n    const counted = preset === \"last\" || preset === \"next\";\n    const Select = slots.Select;\n    const Input = slots.Input;\n    return (\n      <>\n        <Select\n          label={labels.opRelative}\n          value={preset}\n          part=\"filter-select\"\n          className={classNames.filterSelect}\n          fieldClassName={classNames.filterField}\n          labelClassName={classNames.filterLabel}\n          options={RELATIVE_PRESETS.map((item) => ({\n            value: item,\n            label: labels[RELATIVE_PRESET_LABEL_KEYS[item]],\n          }))}\n          onChange={(next) =>\n            onChange(joinRelativeToken(next as RelativePreset, n))\n          }\n        />\n        {counted ? (\n          <Input\n            label=\"N\"\n            type=\"number\"\n            value={String(n)}\n            className={classNames.filterInput}\n            fieldClassName={classNames.filterField}\n            labelClassName={classNames.filterLabel}\n            onChange={(next) =>\n              onChange(joinRelativeToken(preset, Number(next) || 1))\n            }\n          />\n        ) : null}\n      </>\n    );\n  }\n  const type = inputTypeFor(filterWidgetKind(def, registry), condition.op);\n  if (isBetweenFilterOp(condition.op)) {\n    const { a, b } = pairOf(condition.value);\n    const Input = slots.Input;\n    return (\n      <>\n        <Input\n          label={labels.from}\n          type={type}\n          value={a}\n          className={classNames.filterInput}\n          fieldClassName={classNames.filterField}\n          labelClassName={classNames.filterLabel}\n          onChange={(next) => onChange([next, b])}\n        />\n        <Input\n          label={labels.to}\n          type={type}\n          value={b}\n          className={classNames.filterInput}\n          fieldClassName={classNames.filterField}\n          labelClassName={classNames.filterLabel}\n          onChange={(next) => onChange([a, next])}\n        />\n      </>\n    );\n  }\n  const text = Array.isArray(condition.value)\n    ? condition.value.map(asText).join(\",\")\n    : asText(condition.value);\n  const Input = slots.Input;\n  return (\n    <Input\n      label={labels.value}\n      type={type}\n      value={text}\n      className={classNames.filterInput}\n      fieldClassName={classNames.filterField}\n      labelClassName={classNames.filterLabel}\n      onChange={(next) =>\n        onChange(isListFilterOp(condition.op) ? next.split(\",\") : next)\n      }\n    />\n  );\n}\n\nfunction ConditionRow<TRow>({\n  condition,\n  path,\n  defs,\n  labels,\n  classNames,\n  registry,\n  slots,\n  onReplace,\n  onRemove,\n}: Readonly<{\n  condition: QueryCondition;\n  path: readonly number[];\n  defs: readonly FilterDef<TRow>[];\n  labels: Required<TableLabels>;\n  classNames: FilterTreeClassNames;\n  registry: FilterTypeRegistry;\n  slots: FilterTreeSlots;\n  onReplace: (path: readonly number[], next: QueryCondition) => void;\n  onRemove: (path: readonly number[]) => void;\n}>) {\n  const def = defs.find((item) => item.key === condition.key) ?? defs[0];\n  if (!def) return null;\n  const ops = opsFor(def, registry);\n  const Select = slots.Select;\n  const Button = slots.Button;\n  return (\n    <div\n      data-adapttable-part=\"filter-tree-condition\"\n      className={classNames.filterTreeCondition}\n      style={TREE_ROW}\n    >\n      <Select\n        label={labels.filterField}\n        value={def.key}\n        part=\"filter-select\"\n        className={classNames.filterSelect}\n        fieldClassName={classNames.filterField}\n        labelClassName={classNames.filterLabel}\n        options={defs.map((item) => ({\n          value: item.key,\n          label: filterLabel(item),\n        }))}\n        onChange={(key) => {\n          const next = defs.find((item) => item.key === key);\n          if (next) onReplace(path, newCondition(next, registry));\n        }}\n      />\n      {ops.length > 1 ? (\n        <Select\n          label={labels.operator}\n          value={condition.op}\n          part=\"filter-operator\"\n          className={classNames.filterOperator}\n          fieldClassName={classNames.filterField}\n          labelClassName={classNames.filterLabel}\n          options={ops.map((op) => {\n            const key = opLabelKey(filterWidgetKind(def, registry), op);\n            return {\n              value: op,\n              label: key ? filterOpLabel(labels, key) : op,\n            };\n          })}\n          onChange={(op) =>\n            onReplace(path, { ...condition, op, value: undefined })\n          }\n        />\n      ) : null}\n      <ConditionValue\n        def={def}\n        condition={condition}\n        labels={labels}\n        classNames={classNames}\n        registry={registry}\n        slots={slots}\n        onChange={(value) => onReplace(path, { ...condition, value })}\n      />\n      <Button\n        label={labels.filterRemoveCondition}\n        part=\"filter-tree-remove\"\n        className={classNames.filterTreeRemove}\n        onClick={() => onRemove(path)}\n      />\n    </div>\n  );\n}\n\nfunction GroupActions({\n  labels,\n  classNames,\n  slots,\n  onAddCondition,\n  onAddGroup,\n}: Readonly<{\n  labels: Required<TableLabels>;\n  classNames: FilterTreeClassNames;\n  slots: FilterTreeSlots;\n  onAddCondition: () => void;\n  onAddGroup: () => void;\n}>) {\n  const Button = slots.Button;\n  return (\n    <div\n      data-adapttable-part=\"filter-tree-actions\"\n      className={classNames.filterTreeActions}\n      style={TREE_ROW}\n    >\n      <Button label={labels.filterAddCondition} onClick={onAddCondition} />\n      <Button label={labels.filterAddGroup} onClick={onAddGroup} />\n    </div>\n  );\n}\n\nfunction GroupView<TRow>({\n  group,\n  path,\n  defs,\n  labels,\n  classNames,\n  registry,\n  slots,\n  onCombinator,\n  onAddCondition,\n  onAddGroup,\n  onReplace,\n  onRemove,\n}: Readonly<{\n  group: QueryFilterGroup;\n  path: readonly number[];\n  defs: readonly FilterDef<TRow>[];\n  labels: Required<TableLabels>;\n  classNames: FilterTreeClassNames;\n  registry: FilterTypeRegistry;\n  slots: FilterTreeSlots;\n  onCombinator: (path: readonly number[], next: \"and\" | \"or\") => void;\n  onAddCondition: (path: readonly number[]) => void;\n  onAddGroup: (path: readonly number[]) => void;\n  onReplace: (path: readonly number[], next: QueryCondition) => void;\n  onRemove: (path: readonly number[]) => void;\n}>) {\n  const Select = slots.Select;\n  const Button = slots.Button;\n  return (\n    <fieldset\n      data-adapttable-part=\"filter-tree-group\"\n      data-depth={path.length}\n      className={classNames.filterTreeGroup}\n      style={path.length > 0 ? TREE_GROUP_NESTED : TREE_GROUP_ROOT}\n    >\n      <legend style={TREE_LEGEND_HIDDEN}>\n        {group.combinator === \"or\"\n          ? labels.filterCombinatorOr\n          : labels.filterCombinatorAnd}\n      </legend>\n      <div style={TREE_ROW}>\n        <Select\n          label={labels.filterTree}\n          value={group.combinator}\n          part=\"filter-operator\"\n          className={classNames.filterOperator}\n          fieldClassName={classNames.filterField}\n          labelClassName={classNames.filterLabel}\n          options={[\n            { value: \"and\", label: labels.filterCombinatorAnd },\n            { value: \"or\", label: labels.filterCombinatorOr },\n          ]}\n          onChange={(next) => onCombinator(path, next === \"or\" ? \"or\" : \"and\")}\n        />\n        {path.length > 0 ? (\n          <Button\n            label={labels.filterRemoveGroup}\n            part=\"filter-tree-remove\"\n            className={classNames.filterTreeRemove}\n            onClick={() => onRemove(path)}\n          />\n        ) : null}\n      </div>\n      {group.conditions.map((node, index) => {\n        const childPath = [...path, index];\n        if (isFilterGroup(node)) {\n          return (\n            <GroupView\n              key={childPath.join(\".\")}\n              group={node}\n              path={childPath}\n              defs={defs}\n              labels={labels}\n              classNames={classNames}\n              registry={registry}\n              slots={slots}\n              onCombinator={onCombinator}\n              onAddCondition={onAddCondition}\n              onAddGroup={onAddGroup}\n              onReplace={onReplace}\n              onRemove={onRemove}\n            />\n          );\n        }\n        return (\n          <ConditionRow\n            key={childPath.join(\".\")}\n            condition={node}\n            path={childPath}\n            defs={defs}\n            labels={labels}\n            classNames={classNames}\n            registry={registry}\n            slots={slots}\n            onReplace={onReplace}\n            onRemove={onRemove}\n          />\n        );\n      })}\n      <GroupActions\n        labels={labels}\n        classNames={classNames}\n        slots={slots}\n        onAddCondition={() => onAddCondition(path)}\n        onAddGroup={() => onAddGroup(path)}\n      />\n    </fieldset>\n  );\n}\n\n/**\n * Recursive AND/OR layout over {@link QueryFilterGroup}. Writes the\n * versioned `ft` param through `source.setFilterTree`. Adapters supply\n * the kit controls via {@link FilterTreeSlots}.\n */\nexport function FilterTreeChrome<TRow>({\n  defs,\n  source,\n  labels: labelOverrides,\n  classNames = {},\n  registry = defaultFilterRegistry,\n  slots,\n  defaultExpanded,\n}: Readonly<FilterTreeChromeProps<TRow>>) {\n  const labels = resolveLabels(labelOverrides);\n  const tree = source.filterTree;\n  const commit = source.setFilterTree;\n  const first = defs[0];\n  const [expanded, setExpanded] = useState(\n    () => defaultExpanded === true || Boolean(tree)\n  );\n  if (!commit || !first || defs.length === 0) return null;\n  const Disclosure = slots.Disclosure;\n\n  const onAddCondition = (path: readonly number[]) => {\n    commit(addFilterTreeCondition(tree, path, newCondition(first, registry)));\n  };\n  const onAddGroup = (path: readonly number[]) => {\n    commit(addFilterTreeGroup(tree ?? emptyFilterTree(), path));\n  };\n\n  return (\n    <Disclosure\n      label={labels.filterTree}\n      expanded={expanded}\n      className={classNames.filterTree}\n      summaryClassName={classNames.filterTreeSummary}\n      onExpandedChange={setExpanded}\n    >\n      {tree ? (\n        <GroupView\n          group={tree}\n          path={[]}\n          defs={defs}\n          labels={labels}\n          classNames={classNames}\n          registry={registry}\n          slots={slots}\n          onCombinator={(path, next) =>\n            commit(setFilterTreeCombinator(tree, path, next))\n          }\n          onAddCondition={onAddCondition}\n          onAddGroup={onAddGroup}\n          onReplace={(path, next) =>\n            commit(replaceFilterTreeNode(tree, path, next))\n          }\n          onRemove={(path) => commit(removeFilterTreeNode(tree, path))}\n        />\n      ) : (\n        <GroupActions\n          labels={labels}\n          classNames={classNames}\n          slots={slots}\n          onAddCondition={() => onAddCondition([])}\n          onAddGroup={() => onAddGroup([])}\n        />\n      )}\n    </Disclosure>\n  );\n}\n","/**\n * Find-bar layout. Structure only — adapters pass the search field and\n * the previous / next / close buttons the end user clicks.\n */\nimport type { KeyboardEvent, ReactElement, ReactNode } from \"react\";\n\nimport { focusEditorOnMount } from \"../editing/editableCellController\";\nimport type { TableLabels } from \"../types\";\nimport type { FindInTableState } from \"./useFindInTable\";\n\n/** Props for an adapter {@link FindBar} — no slots on the public API. */\nexport interface FindBarProps {\n  /** The find state, straight from `shell.find`. */\n  find: FindInTableState;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** A kit's own class for the bar. */\n  className?: string;\n}\n\n/** Kit search field the find bar calls. */\nexport interface FindSearchProps {\n  readonly label: string;\n  readonly placeholder: string;\n  readonly value: string;\n  readonly focusRef: (node: { focus: () => void } | null) => void;\n  readonly onChange: (value: string) => void;\n  readonly onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n}\n\n/** One find-bar glyph. */\nexport type FindButtonKind = \"previous\" | \"next\" | \"close\";\n\n/** Kit button the find bar calls. */\nexport interface FindButtonProps {\n  readonly label: string;\n  readonly part: string;\n  readonly kind: FindButtonKind;\n  readonly disabled?: boolean;\n  readonly onClick: () => void;\n}\n\n/** Adapter-supplied controls for {@link FindBarChrome}. */\nexport interface FindBarSlots {\n  readonly Search: (props: FindSearchProps) => ReactNode;\n  readonly Button: (props: FindButtonProps) => ReactNode;\n}\n\n/** Props for {@link FindBarChrome}. */\nexport interface FindBarChromeProps extends FindBarProps {\n  readonly slots: FindBarSlots;\n}\n\n/**\n * Renders the find bar, or nothing when it is closed — so an adapter renders\n * it unconditionally and the opt-in promise still holds.\n *\n * Enter walks forward, Shift+Enter walks back and Escape closes, which is what\n * every find bar does and therefore what nobody should have to learn.\n */\nexport function FindBarChrome({\n  find,\n  labels,\n  className,\n  slots,\n}: Readonly<FindBarChromeProps>): ReactElement | null {\n  if (!find.open) return null;\n  const count = (labels?.findMatchCount ?? defaultCount)(\n    find.index + 1,\n    find.matches.length\n  );\n  const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n    if (event.key === \"Escape\") {\n      find.setOpen(false);\n      return;\n    }\n    if (event.key !== \"Enter\") return;\n    event.preventDefault();\n    if (event.shiftKey) find.previous();\n    else find.next();\n  };\n\n  const Search = slots.Search;\n  const Button = slots.Button;\n  return (\n    <div\n      data-adapttable-part=\"find-bar\"\n      className={className}\n      style={{\n        display: \"flex\",\n        alignItems: \"center\",\n        gap: \"0.5em\",\n        padding: \"0.25em 0\",\n      }}\n    >\n      <Search\n        label={labels?.findInTable ?? \"Find in table\"}\n        placeholder={labels?.findPlaceholder ?? \"Find in table\"}\n        value={find.query}\n        focusRef={focusEditorOnMount}\n        onChange={find.setQuery}\n        onKeyDown={onKeyDown}\n      />\n      <output data-adapttable-part=\"find-count\">{count}</output>\n      <Button\n        label={labels?.findPrevious ?? \"Previous match\"}\n        part=\"find-previous\"\n        kind=\"previous\"\n        disabled={find.matches.length === 0}\n        onClick={find.previous}\n      />\n      <Button\n        label={labels?.findNext ?? \"Next match\"}\n        part=\"find-next\"\n        kind=\"next\"\n        disabled={find.matches.length === 0}\n        onClick={find.next}\n      />\n      <Button\n        label={labels?.findClose ?? \"Close find\"}\n        part=\"find-close\"\n        kind=\"close\"\n        onClick={() => {\n          find.setOpen(false);\n        }}\n      />\n    </div>\n  );\n}\n\n/** \"3 of 17\", or \"No matches\" — replaceable through `labels.findMatchCount`. */\nfunction defaultCount(current: number, total: number): string {\n  return total === 0 ? \"No matches\" : `${current} of ${total}`;\n}\n","import type { ReactNode } from \"react\";\nimport { useState } from \"react\";\n\nimport { useMediaQuery } from \"../hooks/useMediaQuery\";\n\n/**\n * A pointer that can hover — a mouse or a trackpad.\n *\n * Matched rather than assumed, because it is the whole reason this control\n * exists: where hovering is possible the checkbox stays out of the way until\n * it is wanted, and where it is not, there is no hover to wait for and no\n * Ctrl key to hold either, so the checkbox is simply there.\n */\nconst HOVER_QUERY = \"(hover: hover) and (pointer: fine)\";\n\n/** The kit checkbox {@link ColumnSelectCheckboxChrome} calls. */\nexport interface ColumnSelectCheckboxProps {\n  /** Accessible name, already localized and already naming the column. */\n  readonly label: string;\n  /** Whether this column is the selection. */\n  readonly checked: boolean;\n  /** Select this column, or clear the selection when it already is. */\n  readonly onToggle: () => void;\n}\n\n/** Adapter-supplied control for {@link ColumnSelectCheckboxChrome}. */\nexport interface ColumnSelectSlots {\n  readonly Checkbox: (props: ColumnSelectCheckboxProps) => ReactNode;\n}\n\n/** Props for {@link ColumnSelectCheckboxChrome}. */\nexport interface ColumnSelectCheckboxChromeProps {\n  /** Accessible name for the control, already localized. */\n  readonly label: string;\n  /** Whether this column is the selection. */\n  readonly checked: boolean;\n  /** Select this column, or clear the selection when it already is. */\n  readonly onToggle: () => void;\n  /** `classNames.columnSelect`, for the kits that carry per-part classes. */\n  readonly className?: string;\n  /** The kit's checkbox. */\n  readonly slots: ColumnSelectSlots;\n}\n\n/**\n * The header checkbox that selects a whole column.\n *\n * Ctrl/Cmd+click on a header is the gesture, and it is unchanged. This is the\n * same state reached two other ways: by a finger, which has no modifier key to\n * hold, and by a screen reader, which has no way to discover a gesture nothing\n * announces.\n *\n * Core owns the structure, the part name, the accessible name and the two\n * things that stop the control from fighting the header it sits in:\n *\n * - **Clicks do not reach the header.** A sortable header sorts on click and a\n *   plain header selects on click; either would fire underneath the checkbox\n *   and undo what ticking it just did.\n * - **Keys do not reach the grid.** Space on a checkbox toggles it. Space on a\n *   cell belongs to the grid, and the two are the same keystroke.\n *\n * On a hovering pointer the box holds its space and fades in on hover or focus,\n * so a table of twelve columns is not a row of twelve checkboxes; the layout\n * never moves, and a selected column shows its state whether or not the pointer\n * is near. Where there is no hover, it is always visible.\n */\nexport function ColumnSelectCheckboxChrome({\n  label,\n  checked,\n  onToggle,\n  className,\n  slots,\n}: Readonly<ColumnSelectCheckboxChromeProps>) {\n  const Checkbox = slots.Checkbox;\n  const canHover = useMediaQuery(HOVER_QUERY);\n  const [near, setNear] = useState(false);\n  // Opacity, not mounting: an element that appears on hover has to be hovered\n  // to appear. It keeps its box, so there is something to aim at, and the\n  // header's width does not change when the pointer arrives.\n  const shown = !canHover || near || checked;\n  return (\n    <span\n      // The span positions and reveals; the checkbox inside carries every bit\n      // of the semantics. `none` — ARIA's current spelling of the\n      // presentational role — is what lets it hold the two containment\n      // handlers below without pretending to be a control itself.\n      role=\"none\"\n      data-adapttable-part=\"column-select\"\n      data-shown={shown ? \"\" : undefined}\n      className={className}\n      style={{\n        display: \"inline-flex\",\n        alignItems: \"center\",\n        opacity: shown ? 1 : 0,\n        transition: \"opacity 120ms ease\",\n      }}\n      onPointerEnter={() => setNear(true)}\n      onPointerLeave={() => setNear(false)}\n      onFocus={() => setNear(true)}\n      onBlur={() => setNear(false)}\n      onClick={(event) => {\n        event.stopPropagation();\n      }}\n      onKeyDown={(event) => {\n        event.stopPropagation();\n      }}\n    >\n      <Checkbox label={label} checked={checked} onToggle={onToggle} />\n    </span>\n  );\n}\n\n/**\n * The checkbox's accessible name: what it does, and which column.\n *\n * \"Select column\" twelve times over names nothing — a screen reader user\n * hearing it has no idea which column is about to be selected.\n */\nexport function columnSelectLabel(\n  label: string | undefined,\n  column: { header?: ReactNode; key: string }\n): string {\n  const name = typeof column.header === \"string\" ? column.header : column.key;\n  return `${label ?? \"Select column\"}: ${name}`;\n}\n","/**\n * Headless fill-handle gate. Core decides whether the current cell is the\n * selection corner and supplies the drag props; the adapter renders the\n * visible handle with its own component and styling.\n */\nimport type { ReactNode } from \"react\";\n\nimport { sameGridCell } from \"./gridFocus\";\nimport type { GridFocusState } from \"./useGridFocus\";\n\n/** Props passed to an adapter's visible fill-handle component. */\nexport interface FillHandleSlotProps {\n  /** Localized accessible title for the pointer affordance. */\n  readonly label: string;\n  /** Event handlers and drag metadata from the grid-focus engine. */\n  readonly handleProps: Readonly<Record<string, unknown>>;\n  /** Adapter-defined class supplied by its table component. */\n  readonly className?: string;\n}\n\n/** Adapter-owned rendering for {@link FillHandleChrome}. */\nexport interface FillHandleSlots {\n  readonly Handle: (props: FillHandleSlotProps) => ReactNode;\n}\n\n/** Props for {@link FillHandleChrome}. */\nexport interface FillHandleChromeProps {\n  /** The grid focus state, straight from `table.gridFocus`. */\n  readonly focus: GridFocusState | undefined;\n  /** The cell's index in the RENDERED window — what an adapter already has. */\n  readonly windowIndex: number;\n  /** The cell's column index. */\n  readonly col: number;\n  /** Where the rendered window starts in the dataset. Zero unless paged. */\n  readonly firstRowIndex?: number;\n  /** A kit's own class for the visible affordance. */\n  readonly className?: string;\n  /** Adapter-owned visible component. */\n  readonly slots: FillHandleSlots;\n}\n\n/**\n * Renders the fill handle when this cell is the selection's corner, and\n * nothing at all otherwise — so an adapter renders it unconditionally in every\n * cell and the opt-in promise still holds.\n */\nexport function FillHandleChrome({\n  focus,\n  windowIndex,\n  col,\n  firstRowIndex = 0,\n  className,\n  slots,\n}: Readonly<FillHandleChromeProps>): ReactNode {\n  const corner = focus?.fillHandleCell;\n  if (!corner || !focus) return null;\n  if (!sameGridCell(corner, { row: firstRowIndex + windowIndex, col })) {\n    return null;\n  }\n  const Handle = slots.Handle;\n  return (\n    <Handle\n      label={focus.fillHandleLabel}\n      handleProps={focus.getFillHandleProps()}\n      className={className}\n    />\n  );\n}\n","/**\n * The live region that says where keyboard focus went.\n *\n * A cell gaining DOM focus is announced by the screen reader on its own, but\n * only as the cell's contents — not which column it belongs to, and not where\n * it sits in a dataset the user cannot see the end of. \"1,240\" is useless;\n * \"Budget, 1,240, row 40,002 of 100,000\" is navigation.\n *\n * It lives in core rather than in eight adapters because the region's own\n * details are easy to get wrong — see {@link LiveRegion}, which owns them.\n */\nimport type { ReactElement } from \"react\";\n\nimport { LiveRegion } from \"../a11y/LiveRegion\";\nimport type { GridFocusState } from \"./useGridFocus\";\n\n/** Props for {@link GridFocusAnnouncer}. */\nexport interface GridFocusAnnouncerProps {\n  /** The grid focus state, straight from `table.gridFocus`. */\n  focus: GridFocusState;\n}\n\n/**\n * Renders the grid's focus announcements, or nothing at all when cell\n * navigation is off — so an adapter spreads it unconditionally and the opt-in\n * promise still holds. When on, the region is present from the first render and\n * empty until focus moves, which is the order screen readers need.\n */\nexport function GridFocusAnnouncer({\n  focus,\n}: Readonly<GridFocusAnnouncerProps>): ReactElement | null {\n  if (!focus.enabled) return null;\n  return <LiveRegion part=\"grid-announcer\">{focus.announcement}</LiveRegion>;\n}\n","/** Headless selection-stat formatting; adapters own the visible status bar. */\nimport type { ReactNode } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport type { SelectionStats } from \"./selectionStats\";\n\n/** Props for {@link SelectionStatsChrome}. */\nexport interface SelectionStatsChromeProps {\n  /** The statistics, straight from `shell.selectionStats`. */\n  stats: SelectionStats | null;\n  /** Labels for each figure; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** Locale tag for number formatting. The host's default when omitted. */\n  locale?: string;\n  /** A kit's own class for the strip. */\n  className?: string;\n  /** Adapter-owned visible component. */\n  slots: SelectionStatsSlots;\n}\n\n/** One formatted statistic in display order. */\nexport interface SelectionStatPart {\n  readonly key: \"count\" | \"sum\" | \"average\" | \"min\" | \"max\";\n  readonly text: string;\n}\n\n/** Props passed to an adapter's selection-status component. */\nexport interface SelectionStatsSlotProps {\n  readonly parts: readonly SelectionStatPart[];\n  readonly className?: string;\n}\n\n/** Adapter-owned rendering for {@link SelectionStatsChrome}. */\nexport interface SelectionStatsSlots {\n  readonly Stats: (props: SelectionStatsSlotProps) => ReactNode;\n}\n\n/** One figure, or nothing when the selection has no numbers to describe. */\nfunction figure(\n  key: SelectionStatPart[\"key\"],\n  label: string,\n  value: number | null,\n  format: (value: number) => string\n): SelectionStatPart | null {\n  return value === null ? null : { key, text: `${label} ${format(value)}` };\n}\n\n/**\n * Renders the selection statistics, or nothing at all when there is no\n * multi-cell selection — so an adapter renders it unconditionally and the\n * opt-in promise still holds.\n *\n * The strip is a status region: a screen reader reads the new figures after\n * the range announcement rather than interrupting it, which is the order the\n * two belong in.\n */\nexport function SelectionStatsChrome({\n  stats,\n  labels,\n  locale,\n  className,\n  slots,\n}: Readonly<SelectionStatsChromeProps>): ReactNode {\n  if (!stats || stats.cells < 2) return null;\n  const format = (value: number) =>\n    new Intl.NumberFormat(locale, { maximumFractionDigits: 3 }).format(value);\n  const parts = [\n    {\n      key: \"count\" as const,\n      text: `${labels?.selectionCount ?? \"Count\"} ${format(stats.cells)}`,\n    },\n    figure(\"sum\", labels?.selectionSum ?? \"Sum\", stats.sum, format),\n    figure(\"average\", labels?.selectionAverage ?? \"Avg\", stats.average, format),\n    figure(\"min\", labels?.selectionMin ?? \"Min\", stats.min, format),\n    figure(\"max\", labels?.selectionMax ?? \"Max\", stats.max, format),\n  ].filter((part): part is SelectionStatPart => part !== null);\n\n  const Stats = slots.Stats;\n  return <Stats parts={parts} className={className} />;\n}\n","/**\n * The status bar: what the table is showing, and what is selected.\n *\n * A spreadsheet puts this at the bottom of the window and a user checks it\n * without thinking — how many rows are here, how many did I select, what do\n * they add up to. The table already knows all three; until now nothing put\n * them in one place, and a host that wanted the strip had to assemble it\n * from the source, the selection and `selectionStats` by hand.\n *\n * The arithmetic is not repeated here. Row counts come from the source's\n * own paging figures, the selected count from the selection, and the\n * sums from {@link SelectionStatsChrome}, which stays the one place that\n * knows what \"average of a column of nulls\" means. This composes them and\n * owns the structure: order, part names, and the live region that tells a\n * screen-reader user the selection changed.\n *\n * Everything visible is a slot. The strip is a row of text in every kit and\n * a row of text is still that kit's text — its muted colour, its numeric\n * font, its spacing — so core supplies no markup for it.\n */\nimport type { ReactNode } from \"react\";\n\nimport { computePagination } from \"../pagination/paginationMath\";\nimport type { FeatureNotice, FeatureNoticeKind } from \"../state/featureNotices\";\n\nexport type { FeatureNotice, FeatureNoticeKind } from \"../state/featureNotices\";\nimport type { TableLabels } from \"../types\";\nimport type { SelectionStats } from \"./selectionStats\";\nimport {\n  SelectionStatsChrome,\n  type SelectionStatsSlots,\n} from \"./SelectionStatsBar\";\n\n/** One piece of the status bar, in display order. */\nexport interface StatusBarItem {\n  /** What this figure is, for a kit that styles them differently. */\n  readonly key: \"rows\" | \"selected\" | FeatureNoticeKind;\n  /** The text to show, already localized and formatted. */\n  readonly text: string;\n  /**\n   * How the matching feature looks at the table: off, disabled, or\n   * one page. Present on notices; omitted on the row/selected counts.\n   */\n  readonly appearance?: FeatureNotice[\"appearance\"];\n}\n\n/** Props an adapter's status-bar component receives. */\nexport interface StatusBarSlotProps {\n  /** The figures, in the order they should read. */\n  readonly items: readonly StatusBarItem[];\n  /** The selection statistics, when there are any; render after the items. */\n  readonly stats: ReactNode;\n  readonly className?: string;\n}\n\n/** Adapter-owned rendering for {@link StatusBarChrome}. */\nexport interface StatusBarSlots {\n  /** The strip itself. */\n  readonly Bar: (props: StatusBarSlotProps) => ReactNode;\n  /** The selection-stats strip, the same slots that component takes. */\n  readonly stats: SelectionStatsSlots;\n}\n\n/** What the status bar needs to describe the table. */\nexport interface StatusBarChromeProps {\n  /**\n   * Whether the host asked for the strip.\n   *\n   * Off, this still renders the selection statistics on their own — the\n   * bar HOSTS those figures, so an adapter that chose between the two\n   * itself would carry the same \"or they print twice\" rule seven times\n   * over. One element, one place that knows.\n   */\n  enabled: boolean;\n  /** How many rows are rendered right now. */\n  shown: number;\n  /** The page being shown, for the row range. Defaults to the first. */\n  page?: number;\n  /** The page size, for the row range. Defaults to {@link shown}. */\n  limit?: number;\n  /** How many rows the whole filtered set holds, when the source knows. */\n  total?: number;\n  /** How many rows are selected. */\n  selected: number;\n  /** The multi-cell selection's figures, straight from `shell.selectionStats`. */\n  stats: SelectionStats | null;\n  /** Labels for each figure; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** Locale tag for number formatting. The host's default when omitted. */\n  locale?: string;\n  /** A kit's own class for the strip. */\n  className?: string;\n  /**\n   * Opted-in features that cannot run. Always shown — the person at the\n   * table must see them even when the host did not ask for `statusBar`.\n   * Row/selected counts still require `enabled`.\n   */\n  notices?: readonly FeatureNotice[];\n  /** Adapter-owned visible components. */\n  slots: StatusBarSlots;\n}\n\n/**\n * The figures, in reading order.\n *\n * The row range comes from the same arithmetic the pagination footer\n * uses, so the two never disagree — a status bar reading \"1–10\" under a\n * footer reading \"51–60\" is worse than no status bar at all.\n *\n * A count of zero selected rows is left out rather than shown as \"0\n * selected\": the strip is a status line, and a line that reports the\n * absence of a thing on every render is noise the eye learns to skip.\n */\nfunction itemsFor(\n  props: Pick<\n    StatusBarChromeProps,\n    | \"enabled\"\n    | \"shown\"\n    | \"page\"\n    | \"limit\"\n    | \"total\"\n    | \"selected\"\n    | \"labels\"\n    | \"notices\"\n  >\n): StatusBarItem[] {\n  const labels = props.labels;\n  const items: StatusBarItem[] = [];\n  for (const notice of props.notices ?? []) {\n    items.push({\n      key: notice.kind,\n      text: notice.message,\n      appearance: notice.appearance,\n    });\n  }\n  if (!props.enabled) return items;\n  const total = props.total ?? props.shown;\n  const { fromIndex, toIndex } = computePagination({\n    page: props.page ?? 1,\n    limit: props.limit ?? Math.max(props.shown, 1),\n    total,\n  });\n  const showing = labels?.showing;\n  items.push({\n    key: \"rows\",\n    text: showing\n      ? showing({ from: fromIndex, to: toIndex, total })\n      : `Showing ${String(fromIndex)}\\u2013${String(toIndex)} of ${String(total)}`,\n  });\n  if (props.selected > 0) {\n    const selectedCount = labels?.selectedCount;\n    items.push({\n      key: \"selected\",\n      text: selectedCount\n        ? selectedCount(props.selected)\n        : `${String(props.selected)} selected`,\n    });\n  }\n  return items;\n}\n\n/**\n * Renders the status bar.\n *\n * @param props - The counts, the selection figures, and the kit's slots.\n * @returns The strip.\n */\nexport function StatusBarChrome(props: Readonly<StatusBarChromeProps>) {\n  const { Bar } = props.slots;\n  const stats = (\n    <SelectionStatsChrome\n      stats={props.stats}\n      labels={props.labels}\n      locale={props.locale}\n      slots={props.slots.stats}\n    />\n  );\n  const items = itemsFor(props);\n  const showBar = props.enabled || items.length > 0;\n  if (!showBar) return stats;\n  return (\n    <Bar\n      items={items}\n      className={props.className}\n      stats={props.enabled ? stats : null}\n    />\n  );\n}\n","/**\n * The offer that reveals the next page of groups, or of a group's rows.\n *\n * Wording and the part name stay here so they cannot drift. Adapters pass\n * the button the end user clicks.\n */\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport type { TableLabels } from \"../types\";\n\n/** Props for an adapter {@link GroupMoreButton} — no slots on the public API. */\nexport interface GroupMoreButtonProps {\n  /** Whether this offers more groups or more rows inside one. */\n  scope: \"groups\" | \"rows\";\n  /** How many are still hidden. */\n  remaining: number;\n  /** The group whose rows are being revealed, for a `\"rows\"` offer. */\n  groupKey?: string;\n  /** Labels; falls back to the built-in English. */\n  labels: Required<TableLabels>;\n  /** Reveal the next page. */\n  onShowMore: (entry: { scope: \"groups\" | \"rows\"; groupKey?: string }) => void;\n}\n\n/** Kit button the group-more chrome calls. */\nexport interface GroupMoreButtonSlotProps {\n  readonly label: string;\n  readonly onClick: () => void;\n}\n\n/** Adapter-supplied controls for {@link GroupMoreButtonChrome}. */\nexport interface GroupMoreButtonSlots {\n  readonly Button: (props: GroupMoreButtonSlotProps) => ReactNode;\n}\n\n/** Props for {@link GroupMoreButtonChrome}. */\nexport interface GroupMoreButtonChromeProps extends GroupMoreButtonProps {\n  readonly slots: GroupMoreButtonSlots;\n}\n\n/** Renders the offer through the adapter's button. */\nexport function GroupMoreButtonChrome({\n  scope,\n  remaining,\n  groupKey,\n  labels,\n  onShowMore,\n  slots,\n}: Readonly<GroupMoreButtonChromeProps>): ReactElement {\n  const Button = slots.Button;\n  return (\n    <Button\n      label={\n        scope === \"groups\"\n          ? labels.moreGroups(remaining)\n          : labels.moreRowsInGroup(remaining)\n      }\n      onClick={() => {\n        onShowMore({ scope, groupKey });\n      }}\n    />\n  );\n}\n","/**\n * The chevron's footprint, on a row that has no chevron.\n *\n * A group footer and a \"show more\" row have nothing to collapse, so neither\n * renders a toggle — and without this they would start where the toggle would\n * have been, one control's width to the left of the header they belong to. On\n * a nested group that reads as the wrong indent level, which is exactly the\n * information the indent exists to carry.\n */\nimport type { ReactElement } from \"react\";\n\n/** Renders an inert element the size of a group's toggle button. */\nexport function GroupToggleSpacer(): ReactElement {\n  return (\n    <span\n      aria-hidden=\"true\"\n      data-adapttable-part=\"group-toggle-spacer\"\n      style={{ display: \"inline-block\", width: \"1.5em\", flexShrink: 0 }}\n    />\n  );\n}\n","import { type DependencyList, type RefObject, useEffect } from \"react\";\n\nimport { usePrefersReducedMotion } from \"./usePrefersReducedMotion\";\n\n/** Tuning for the mount stagger. */\nexport interface MountStaggerOptions {\n  /** Master switch. When `false`, the hook is a no-op. */\n  enabled: boolean;\n  /** Per-item delay in ms. Defaults to 40. */\n  step?: number;\n  /** Tween duration in ms. Defaults to 320. */\n  duration?: number;\n}\n\n/**\n * Dependency-free entrance stagger using the Web Animations API. Animates\n * descendants marked with `data-stagger` once on mount (and whenever\n * `deps` change), honoring `prefers-reduced-motion`. Works without GSAP;\n * GSAP fans can swap in their own hook of the same shape.\n *\n * Kit-agnostic: every adapter emits `[data-stagger]` on its row/card\n * elements and calls this from its `<DataTable>` when `animate` is on.\n *\n * @param ref - Ref to the container whose `[data-stagger]` items animate.\n * @param deps - Re-run the stagger when these change (e.g. the row set).\n * @param options - See {@link MountStaggerOptions}.\n */\nexport function useMountStagger(\n  ref: RefObject<HTMLElement | null>,\n  deps: DependencyList,\n  options: MountStaggerOptions\n): void {\n  const reduced = usePrefersReducedMotion();\n  const { enabled, step = 40, duration = 320 } = options;\n  // Collapse the caller's deps to a primitive key so the effect's dependency\n  // array stays a literal (no spread) and `exhaustive-deps` can verify it.\n  // Pass primitive deps (e.g. a row count), not large objects.\n  const depsKey = deps.map(String).join(\"|\");\n\n  useEffect(() => {\n    if (!enabled || reduced) return;\n    const root = ref.current;\n    if (!root) return;\n    const items = root.querySelectorAll<HTMLElement>(\"[data-stagger]\");\n    items.forEach((el, index) => {\n      if (typeof el.animate !== \"function\") return;\n      el.animate(\n        [\n          { opacity: 0, transform: \"translateY(8px)\" },\n          { opacity: 1, transform: \"translateY(0)\" },\n        ],\n        {\n          duration,\n          delay: index * step,\n          easing: \"cubic-bezier(0.16, 1, 0.3, 1)\",\n          fill: \"both\",\n        }\n      );\n    });\n  }, [enabled, reduced, step, duration, ref, depsKey]);\n}\n","import type { ReactElement } from \"react\";\n\n/**\n * Shared chrome glyphs (currentColor, no icon-lib dependency) used by the\n * toolbar across adapters — a funnel for the Filters button and a magnifier\n * for the search field. Centralising them keeps every adapter's toolbar\n * identical and avoids cross-adapter duplication of the SVG markup.\n */\n\n/** Three-line funnel glyph for the Filters button. */\nexport function FiltersIcon(): ReactElement {\n  return (\n    <svg\n      width={16}\n      height={16}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={2}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n    >\n      <path d=\"M4 6h16M7 12h10M10 18h4\" />\n    </svg>\n  );\n}\n\n/** Magnifier glyph for the search field. */\nexport function SearchIcon(): ReactElement {\n  return (\n    <svg\n      width={14}\n      height={14}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={2}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n    >\n      <circle cx={11} cy={11} r={7} />\n      <path d=\"M21 21l-4.35-4.35\" />\n    </svg>\n  );\n}\n\n/**\n * Inline expand chevron: points into the row (flipped for RTL) and rotates to\n * point down while the detail panel is open. Shared by every adapter's\n * desktop row + mobile card so the expand affordance is identical.\n */\nexport function ExpandChevron({\n  open,\n  dir,\n}: Readonly<{ open: boolean; dir?: \"rtl\" | \"ltr\" }>): ReactElement {\n  let transform: string | undefined;\n  if (open) transform = \"rotate(90deg)\";\n  else if (dir === \"rtl\") transform = \"rotate(180deg)\";\n  return (\n    <svg\n      width=\"1em\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      style={{ transform, transition: \"transform 0.2s ease\" }}\n    >\n      <path\n        d=\"m9 6 6 6-6 6\"\n        stroke=\"currentColor\"\n        strokeWidth=\"2\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n","import type { KeyboardEvent, MouseEvent } from \"react\";\n\n/** Handlers + affordance for an activatable (clickable) row. */\nexport interface RowClickProps {\n  onClick: (event: MouseEvent<HTMLElement>) => void;\n  onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n  /**\n   * Roving tab stop: the first row is the list's single Tab entry point;\n   * the rest are reached with ArrowUp/ArrowDown (which move the stop\n   * along). Without a known index every row stays tabbable.\n   */\n  tabIndex: 0 | -1;\n  /** Marks the element as an arrow-key navigation stop among its siblings. */\n  \"data-adapttable-row\": \"\";\n  style: { cursor: \"pointer\" };\n}\n\n/**\n * True when the event started on an interactive child (button, link, input,\n * checkbox, …) whose own behaviour must win over the row activation — a\n * click on the row-actions button or the selection checkbox is never a\n * navigation.\n */\nfunction fromInteractiveChild(target: EventTarget | null): boolean {\n  return (\n    target instanceof Element &&\n    target.closest(\n      \"button,a,input,select,textarea,label,[role='button'],[role='checkbox']\"\n    ) !== null\n  );\n}\n\n/**\n * Move focus to the previous/next sibling row (any element carrying the\n * `data-adapttable-row` stop marker under the same parent — `<tr>`s in a\n * tbody and mobile cards in a list alike). No wrap-around: the edges are a\n * natural stop, matching native listbox behaviour.\n */\nfunction moveRowFocus(current: HTMLElement, delta: -1 | 1): void {\n  const parent = current.parentElement;\n  if (!parent) return;\n  const stops = [...parent.children].filter(\n    (el): el is HTMLElement =>\n      el instanceof HTMLElement && \"adapttableRow\" in el.dataset\n  );\n  const next = stops[stops.indexOf(current) + delta];\n  if (!next) return;\n  // Rove the tab stop with the focus, so Tab leaves the list from the\n  // current row and re-enters where the user left off.\n  current.tabIndex = -1;\n  next.tabIndex = 0;\n  next.focus();\n}\n\n/**\n * Build the row-activation props for `onRowClick`: a guarded click handler\n * (interactive children keep their own behaviour), Enter/Space activation\n * when the row itself has focus, ArrowUp/ArrowDown roving focus (and tab\n * stop) across the sibling rows, and the pointer cursor. Returns\n * `undefined` when no handler is configured, so adapters can spread the\n * result unconditionally.\n *\n * @typeParam TRow - The row type.\n * @param row - The row this element renders.\n * @param onRowClick - The caller's activation handler, if any.\n * @param index - The row's index in the rendered list. When given, only\n *   row 0 is a Tab stop (roving tabindex); omit it and every row stays\n *   tabbable.\n */\nexport function rowClickProps<TRow>(\n  row: TRow,\n  onRowClick: ((row: TRow) => void) | undefined,\n  index?: number\n): RowClickProps | undefined {\n  if (!onRowClick) return undefined;\n  return {\n    tabIndex: index === undefined || index === 0 ? 0 : -1,\n    \"data-adapttable-row\": \"\",\n    onClick: (event) => {\n      if (!fromInteractiveChild(event.target)) onRowClick(row);\n    },\n    onKeyDown: (event) => {\n      if (event.target !== event.currentTarget) return;\n      if (event.key === \"Enter\" || event.key === \" \") {\n        event.preventDefault();\n        onRowClick(row);\n        return;\n      }\n      if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n        event.preventDefault();\n        moveRowFocus(event.currentTarget, event.key === \"ArrowDown\" ? 1 : -1);\n      }\n    },\n    style: { cursor: \"pointer\" },\n  };\n}\n","/**\n * The render-time contract shared by every adapter's table/card renderer.\n *\n * Each adapter renders its own markup (MUI `<Table>`, Chakra `<Table>`, plain\n * `<table>`, …) but consumes the same headless inputs: the resolved table\n * model, the visible rows, row-action wiring, virtualization padding, and the\n * column sticky/resize layout. Extracting it here keeps those adapters from\n * re-declaring the identical prop list (and keeps them in lockstep).\n *\n * Adapters extend this with their own kit-specific extras (size tokens,\n * colour scheme, className slots).\n *\n * @typeParam TRow - The row type.\n */\nimport { type ReactNode, useMemo, useRef } from \"react\";\n\nimport type { ConfirmHandler } from \"./actions/confirm\";\nimport type { ColumnGroupRecord } from \"./columns/columnTree\";\nimport type { PinOffset } from \"./columns/useColumnLayout\";\nimport type { EditableCellEditing } from \"./editing/editableCellController\";\nimport type { FilterDef } from \"./filters/filterDefs\";\nimport type { FilterTypeRegistry } from \"./filters/filterRegistry\";\nimport type { GridFocusState } from \"./focus/useGridFocus\";\nimport type { GroupByInput } from \"./grouping/groupKeys\";\nimport type { GroupedFlatEntry } from \"./grouping/groupRows\";\nimport type { GroupCollapseState } from \"./grouping/useGroupCollapse\";\nimport {\n  type BodyCell,\n  buildBodyCells,\n  type CellSpanAppearance,\n  type GetCellSpan,\n} from \"./rows/cellSpan\";\nimport {\n  extraCoveredTableSlots,\n  type ExtraRow,\n  inflateBodyCellRowSpans,\n} from \"./rows/extraRows\";\nimport { incrementalViewOf } from \"./rows/incremental\";\nimport type { MobileCardRenderer } from \"./rows/mobileCard\";\nimport type { RowActionsLayout, RowActionsRenderer } from \"./rows/rowActions\";\nimport type { RowPinningState } from \"./rows/rowPinning\";\nimport type { RowReorderState } from \"./rows/rowReorder\";\nimport type { RowHeight, RowStyle } from \"./rows/rowStyle\";\nimport type { RowExpansionState } from \"./rows/useRowExpansion\";\nimport type { SelectionState } from \"./selection/useSelection\";\nimport { bodyRowEntries, type TreeEntry } from \"./tree/treeRows\";\nimport type { TreeExpansionState } from \"./tree/useTreeExpansion\";\nimport type { ColumnDef, RowAction, TableLabels } from \"./types\";\nimport type { UseDataTableResult } from \"./useDataTable/useDataTable\";\nimport type { RowPairMeasurer } from \"./virtual/measureRowPair\";\nimport type { ColumnWindow } from \"./virtual/useColumnWindow\";\nimport {\n  resolveVirtualRows,\n  virtualColumnSpan,\n  type VirtualTableRow,\n} from \"./virtual/useTableVirtualization\";\n\nexport interface SharedTableRenderProps<TRow> {\n  /** The resolved table model from `useDataTable`. */\n  table: UseDataTableResult<TRow>;\n  /** The rows to render for the current page/window. */\n  rows: readonly TRow[];\n  /**\n   * Cell-navigation getters, from the shell. Inert unless `cellNavigation` is\n   * set, so a renderer spreads them unconditionally.\n   */\n  gridFocus?: GridFocusState;\n  /** Per-row actions rendered in a trailing actions column. */\n  rowActions?: RowAction<TRow>[];\n  /** How those actions render. Omit / `\"buttons\"` is the horizontal strip. */\n  rowActionsLayout?: RowActionsLayout;\n  /**\n   * Replace the trailing actions cell. Wins over\n   * {@link SharedTableRenderProps.rowActionsLayout}.\n   */\n  renderRowActions?: RowActionsRenderer<TRow>;\n  /** Confirmation handler used before destructive row actions run. */\n  confirm: ConfirmHandler;\n  /** Stable row identity used for keys and selection. */\n  getRowId: (row: TRow) => string;\n  /** Hover-prefetch callback fired on desktop row mouse-enter. */\n  prefetch?: (row: TRow) => void;\n  /** Row activation handler — see `BaseDataTableProps.onRowClick`. */\n  onRowClick?: (row: TRow) => void;\n  /** Conditional per-row class — see `BaseDataTableProps.rowClassName`. */\n  rowClassName?: (row: TRow, index: number) => string | undefined;\n  /** When true, group headers render a collapse toggle. */\n  collapsibleColumnGroups?: boolean;\n  /** Collapsed column-group ids from the layout. */\n  collapsedColumnGroups?: readonly string[];\n  /** Tree groups for the declared columns — collapse options, header align. */\n  columnGroups?: ReadonlyMap<string, ColumnGroupRecord<TRow>>;\n  /** Toggle one column group. No-op unless collapse is armed. */\n  onToggleColumnGroup?: (id: string) => void;\n  /** Conditional per-row style — see `BaseDataTableProps.rowStyle`. */\n  rowStyle?: RowStyle<TRow>;\n  /** Per-row height — see `BaseDataTableProps.rowHeight`. */\n  rowHeight?: RowHeight<TRow>;\n  /** Detail-panel renderer — see `BaseDataTableProps.renderRowDetail`. */\n  renderRowDetail?: (row: TRow) => ReactNode;\n  /** Custom mobile-card body — see `BaseDataTableProps.renderCard`. */\n  renderCard?: MobileCardRenderer<TRow>;\n  /** Footer summary builder — see `BaseDataTableProps.summaryRow`. */\n  summaryRow?: (rows: readonly TRow[]) => Partial<Record<string, ReactNode>>;\n  /**\n   * Row-reorder bundle — present iff the host passed `onRowReorder` and\n   * grouping/tree are off. Omit it and no handle renders.\n   */\n  rowReorder?: RowReorderState<TRow>;\n  /**\n   * Dataset offset of the first rendered row (page start). Zero when the\n   * source is not paged. Added to each row's local index so the host hears\n   * dataset-relative `from` / `to`.\n   */\n  windowStart?: number;\n  /** Whether the injected reorder column is start-pinned. */\n  reorderPinned?: boolean;\n  /**\n   * Top-pinned rows, already removed from {@link SharedTableRenderProps.rows}\n   * / the virtual window. Render in a sticky section above the scroll body.\n   */\n  pinnedTopRows?: readonly TRow[];\n  /**\n   * Bottom-pinned rows, already removed from the scroll body. Render in a\n   * sticky section below it.\n   */\n  pinnedBottomRows?: readonly TRow[];\n  /** Headless pin state — actions live on `rowActions`; this is the lists. */\n  rowPinning?: RowPinningState<TRow>;\n  /**\n   * Per-cell span. When set (or a column declares `colSpan`/`rowSpan`),\n   * {@link TableRenderModel.cellsByRow} omits covered cells.\n   */\n  getCellSpan?: GetCellSpan<TRow>;\n  /**\n   * How a spanned cell is painted. Omit / `\"merged\"` is the spreadsheet look.\n   * `\"plain\"` is geometry only.\n   */\n  cellSpanAppearance?: CellSpanAppearance;\n  /** Host-injected separator / full-width slots. */\n  extraRows?: readonly ExtraRow[];\n  /** Expansion state, present when `renderRowDetail` is set. */\n  expansion?: RowExpansionState;\n  /**\n   * Inline cell-editing bundle — present iff the host passed `onCellEdit`.\n   * Omit it and every cell stays plain display (package DNA: opt-in).\n   */\n  editing?: EditableCellEditing<TRow>;\n  /**\n   * Tree bundle — present iff the host declared a hierarchy. Adapters render\n   * `tree.entries` in place of plain rows and put a {@link TreeToggle} plus\n   * `treeIndentStyle` in the `tree.columnKey` cell.\n   */\n  tree?: {\n    entries: readonly TreeEntry<TRow>[];\n    expansion: TreeExpansionState;\n    columnKey?: string;\n    /** Nodes fetching their children right now (`onLoadChildren`). */\n    loadingIds?: ReadonlySet<string>;\n    /** Nodes whose last fetch rejected — closed, and clickable again. */\n    failedIds?: ReadonlySet<string>;\n  };\n  /**\n   * Row-grouping bundle — present iff chrome armed grouping. Adapters that\n   * do not yet render group headers may ignore it; leaf `rows` stay valid.\n   */\n  grouping?: {\n    /** The grouping keys in order — one for a flat group, more for nested. */\n    groupBy: readonly string[];\n    collapsed: GroupCollapseState;\n    entries: readonly GroupedFlatEntry<TRow>[];\n    setGroupBy: (key: GroupByInput) => void;\n    /** Open every group. */\n    expandAll: () => void;\n    /** Close every group, at every level. */\n    collapseAll: () => void;\n    /** Show the tree down to `depth` and no further. */\n    collapseToDepth: (depth: number) => void;\n    /** Reveal the next page of groups, or of one group's rows. */\n    showMore: (entry: { scope: \"groups\" | \"rows\"; groupKey?: string }) => void;\n  };\n  /** Virtual row window (with absolute indices) when virtualization is on. */\n  rowEntries?: readonly VirtualTableRow<TRow>[];\n  /** Spacer height above the virtual window. */\n  paddingTop?: number;\n  /** Spacer height below the virtual window. */\n  paddingBottom?: number;\n  /** Ref callback that lets the virtualizer measure a row element. */\n  measureElement?: (element: Element | null) => void;\n  /**\n   * Measure a row together with its open detail panel — used instead of\n   * `measureElement` when the table can expand rows, since the two are\n   * separate elements and the pair is what the window has to size.\n   */\n  measureRowPair?: RowPairMeasurer;\n  /**\n   * The windowed columns, when the table windows its horizontal axis. The\n   * render model swaps them in, so adapters map over `model.columns` exactly\n   * as before and render the two spacer cells `columnSpacers` describes.\n   */\n  columnWindow?: ColumnWindow<TRow>;\n  /**\n   * Whether the table fits its container rather than overflowing it. Adapters\n   * spread `fittedTableStyle(fitColumns)` onto their `<table>`: percentage\n   * widths only mean anything under a fixed table layout.\n   */\n  fitColumns?: boolean;\n  /**\n   * Compact per-column filter row under the header. Desktop only.\n   * Driven by {@link filterDefs} and the source extra bag.\n   */\n  headerFilters?: boolean;\n  /**\n   * Close a header-filter overlay after a finished single-control write.\n   * Default off — see {@link BaseDataTableProps.closeHeaderFilterOnSelect}.\n   */\n  closeHeaderFilterOnSelect?: boolean;\n  /** Declarative filter defs the header row matches to columns. */\n  filterDefs?: readonly FilterDef<TRow>[];\n  /** Type registry the header row and custom widgets read. */\n  filterRegistry?: FilterTypeRegistry;\n  /** Whether the header sticks to the top of the scroll box. */\n  stickyHeader?: boolean;\n  /** Offset (px) applied to the sticky header top. */\n  stickyTop?: number;\n  /** Resolve a pinned column's side + inset (px), or `undefined` if unpinned. */\n  pinOffset?: (key: string) => PinOffset | undefined;\n  /** Optional max height (px) that turns the table into a scroll box. */\n  maxHeight?: number;\n  /**\n   * Attach to the `maxHeight` scroll box so an element-mode virtual window\n   * tracks the box's scrolling (from `useChromeBodyData`).\n   */\n  virtualScrollRef?: (node: HTMLElement | null) => void;\n  /** Commit a new width (px) for a resizable column. */\n  setWidth?: (key: string, width: number) => void;\n  /** Current per-column widths (px), keyed by column key. */\n  columnWidths?: Readonly<Record<string, number>>;\n  /** Accessible label for a column-resize handle. */\n  resizeLabel?: string;\n}\n\n/** The shared prelude every table/card renderer derives before rendering. */\nexport interface TableRenderModel<TRow> {\n  columns: readonly ColumnDef<TRow>[];\n  selection: SelectionState | null;\n  labels: Required<TableLabels>;\n  /** Whether a trailing actions column/section renders. */\n  showActions: boolean;\n  /** Whether the leading reorder column renders. */\n  showReorder: boolean;\n  /**\n   * Leading control cells before data: expansion + reorder + selection.\n   * Group headers and summaries use this so their colSpans stay aligned.\n   */\n  leadingCells: number;\n  /** Materialised row entries (virtual window or the full set). */\n  entries: readonly VirtualTableRow<TRow>[];\n  /** Spacer/detail colSpan: expansion + reorder + selection + data + actions. */\n  columnSpan: number;\n  /**\n   * Widths of the spacer cells holding open the columns outside the window,\n   * or `undefined` when every column is rendered. A row renders one before its\n   * cells and one after them.\n   */\n  columnSpacers?: { start: number; end: number };\n  /**\n   * Per-row body cells. Kits map this instead of `columns` so a span is\n   * one `<td>` and covered neighbours are already gone.\n   */\n  cellsByRow: ReadonlyMap<string, readonly BodyCell<TRow>[]>;\n  /**\n   * Table-slot indexes a continuing row span already owns on extras in\n   * front of this person (`beforeRowId`). Extra rows omit a `<td>` there.\n   */\n  extraCoveredSlots: ReadonlyMap<string, ReadonlySet<number>>;\n}\n\nfunction pinnedIdSet<TRow>(\n  getRowId: (row: TRow) => string,\n  pinnedTop: readonly TRow[] | undefined,\n  pinnedBottom: readonly TRow[] | undefined\n): Set<string> {\n  const pinnedIds = new Set<string>();\n  for (const row of pinnedTop ?? []) pinnedIds.add(getRowId(row));\n  for (const row of pinnedBottom ?? []) pinnedIds.add(getRowId(row));\n  return pinnedIds;\n}\n\nfunction extraCoveredSlotMap<TRow>(\n  extraRows: readonly ExtraRow[] | undefined,\n  visualIds: readonly string[],\n  cellsByRow: ReadonlyMap<string, readonly BodyCell<TRow>[]>,\n  leadingCells: number\n): Map<string, ReadonlySet<number>> {\n  const extraCoveredSlots = new Map<string, ReadonlySet<number>>();\n  for (const extra of extraRows ?? []) {\n    if (extra.beforeRowId === undefined) continue;\n    if (extraCoveredSlots.has(extra.beforeRowId)) continue;\n    extraCoveredSlots.set(\n      extra.beforeRowId,\n      extraCoveredTableSlots(extra.beforeRowId, {\n        visualIds,\n        cellsByRow,\n        extraRows,\n        leadingCells,\n      })\n    );\n  }\n  return extraCoveredSlots;\n}\n\n/**\n * Derive the shared render prelude from {@link SharedTableRenderProps} —\n * extracted so each adapter's renderer doesn't repeat the identical block\n * (and trip the duplication gate).\n *\n * @typeParam TRow - The row type.\n */\nexport function tableRenderModel<TRow>(\n  props: Pick<\n    SharedTableRenderProps<TRow>,\n    | \"table\"\n    | \"rows\"\n    | \"rowActions\"\n    | \"getRowId\"\n    | \"rowEntries\"\n    | \"renderRowDetail\"\n    | \"expansion\"\n    | \"columnWindow\"\n    | \"editing\"\n    | \"rowReorder\"\n    | \"pinnedTopRows\"\n    | \"pinnedBottomRows\"\n    | \"getCellSpan\"\n    | \"pinOffset\"\n    | \"tree\"\n    | \"grouping\"\n    | \"extraRows\"\n  >\n): TableRenderModel<TRow> {\n  const { selection, labels } = props.table;\n  // Windowed columns replace the full set for every renderer at once, so no\n  // adapter has to know whether the horizontal axis is windowed.\n  const windowed = props.columnWindow?.enabled === true;\n  const columns = windowed\n    ? (props.columnWindow?.columns ?? props.table.columns)\n    : props.table.columns;\n  // The trailing control column exists for row actions AND for row-mode's own\n  // edit / save / cancel — both live there, and a row edit with nowhere to be\n  // saved from would be a mode nobody can leave.\n  const showActions =\n    (props.rowActions?.length ?? 0) > 0 ||\n    props.editing?.rowEditing !== undefined;\n  const showReorder = props.rowReorder !== undefined;\n  const expandable = Boolean(props.renderRowDetail && props.expansion);\n  const hasSelection = Boolean(selection);\n  const leadingCells =\n    (expandable ? 1 : 0) + (showReorder ? 1 : 0) + (hasSelection ? 1 : 0);\n  const pinnedIds = pinnedIdSet(\n    props.getRowId,\n    props.pinnedTopRows,\n    props.pinnedBottomRows\n  );\n  const rawEntries = resolveVirtualRows(\n    props.rows,\n    props.getRowId,\n    props.rowEntries\n  );\n  const entries =\n    pinnedIds.size === 0\n      ? rawEntries\n      : rawEntries.filter((entry) => !pinnedIds.has(entry.key));\n  const fullColumns = props.table.columns;\n  const windowKeys = windowed\n    ? new Set(columns.map((column) => column.key))\n    : undefined;\n  const cellOptions = {\n    columns: fullColumns,\n    getRowId: props.getRowId,\n    getCellSpan: props.getCellSpan,\n    pinOffset: props.pinOffset,\n    windowKeys,\n  };\n  const cellsByRow = new Map<string, readonly BodyCell<TRow>[]>();\n  const merge = (map: ReadonlyMap<string, readonly BodyCell<TRow>[]>) => {\n    for (const [key, cells] of map) cellsByRow.set(key, cells);\n  };\n  const scrollRows = bodyRowEntries(entries, props.tree);\n  const visualRows = [\n    ...(props.pinnedTopRows ?? []),\n    ...scrollRows.map((entry) => entry.row),\n    ...(props.pinnedBottomRows ?? []),\n  ];\n  const visualIds = visualRows.map((row) => props.getRowId(row));\n  merge(\n    buildBodyCells({\n      ...cellOptions,\n      rows: visualRows,\n    })\n  );\n  // A grouped body renders `grouping.entries`, not the row list above — its\n  // leaves reach the screen through a different array and would otherwise have\n  // no cells built for them at all, so every grouped row would render empty.\n  const groupedRows = (props.grouping?.entries ?? []).filter(\n    (entry): entry is Extract<GroupedFlatEntry<TRow>, { kind: \"row\" }> =>\n      entry.kind === \"row\"\n  );\n  if (groupedRows.length > 0) {\n    merge(\n      buildBodyCells({\n        ...cellOptions,\n        rows: groupedRows.map((entry) => entry.row),\n        firstRowIndex: groupedRows[0]?.index ?? 0,\n      })\n    );\n  }\n  const spannedCells = inflateBodyCellRowSpans(\n    cellsByRow,\n    visualIds,\n    props.extraRows\n  );\n  if (spannedCells !== cellsByRow) {\n    cellsByRow.clear();\n    merge(spannedCells);\n  }\n  const extraCoveredSlots = extraCoveredSlotMap(\n    props.extraRows,\n    visualIds,\n    cellsByRow,\n    leadingCells\n  );\n  return {\n    columns,\n    selection,\n    labels,\n    showActions,\n    showReorder,\n    leadingCells,\n    entries,\n    columnSpan:\n      virtualColumnSpan(\n        columns.length,\n        hasSelection,\n        showActions,\n        expandable,\n        showReorder\n      ) + (windowed ? 2 : 0),\n    columnSpacers: windowed\n      ? {\n          start: props.columnWindow?.paddingStart ?? 0,\n          end: props.columnWindow?.paddingEnd ?? 0,\n        }\n      : undefined,\n    cellsByRow,\n    extraCoveredSlots,\n  };\n}\n\n/**\n * Memoised `summaryRow` aggregation: re-executes ONLY when the rendered\n * rows change, never on unrelated table re-renders (a search keystroke,\n * a checkbox toggle). The builder is read through a ref because callers\n * routinely pass it inline — a fresh identity every render — and the\n * aggregate walks the full filtered set, which is exactly the work this\n * exists to avoid repeating.\n *\n * @typeParam TRow - The row type.\n * @param summaryRow - The caller's summary builder, or `undefined` when off.\n * @param rows - The rows the summary describes.\n * @returns The aggregate cells, or `undefined` when no builder is set.\n */\nexport function useSummaryCells<TRow>(\n  summaryRow:\n    | ((rows: readonly TRow[]) => Partial<Record<string, ReactNode>>)\n    | undefined,\n  rows: readonly TRow[]\n): Partial<Record<string, ReactNode>> | undefined {\n  const fromView = incrementalViewOf(rows)?.aggregates;\n  const builderRef = useRef(summaryRow);\n  builderRef.current = summaryRow;\n  const enabled = summaryRow !== undefined && fromView === undefined;\n  return useMemo(\n    () => (enabled ? builderRef.current?.(rows) : fromView),\n    [enabled, rows, fromView]\n  );\n}\n","/** Shared desktop-table assembly — wiring, not pixels. */\nimport {\n  type CSSProperties,\n  memo,\n  type ReactElement,\n  type ReactNode,\n  type RefCallback,\n  useCallback,\n  useRef,\n} from \"react\";\n\nimport type { ConfirmHandler } from \"../actions/confirm\";\nimport {\n  columnHeaderController,\n  columnsHaveFooter,\n  resolveColumnHeader,\n} from \"../columns/columnHeader\";\nimport type { ColumnResizeHandleProps } from \"../columns/columnResize\";\nimport { columnResizeHandleProps } from \"../columns/columnResize\";\nimport { fittedTableStyle } from \"../columns/columnSizing\";\nimport { pinnedColumnWidth, tableMinWidth } from \"../columns/columnWidths\";\nimport type { HtmlGroupedHeaderCell } from \"../columns/headerGroups\";\nimport { htmlGroupedHeaderPlan } from \"../columns/headerGroups\";\nimport {\n  edgePinStyle,\n  PIN_Z,\n  type PinLeads,\n  pinnedCellStyle,\n  type PinOffset,\n} from \"../columns/useColumnLayout\";\nimport type { EditableCellEditing } from \"../editing/editableCellController\";\nimport {\n  rowEditingSignature,\n  rowIsDirty,\n} from \"../editing/editableCellController\";\nimport type { FilterDef } from \"../filters/filterDefs\";\nimport { filterDefForColumn } from \"../filters/FilterHeaderRow\";\nimport { columnSelectLabel } from \"../focus/ColumnSelectCheckbox\";\nimport type { GridFocusState } from \"../focus/useGridFocus\";\nimport type { GroupedFlatEntry } from \"../grouping/groupRows\";\nimport type { BodyCell } from \"../rows/cellSpan\";\nimport {\n  bodyCellsHaveRowSpan,\n  cellsForRow,\n  rowSpanSignature,\n} from \"../rows/cellSpan\";\nimport {\n  extraHostFillStyle,\n  insertExtraRows,\n  insertExtrasBeforeRows,\n  isExtraEntry,\n} from \"../rows/extraRows\";\nimport {\n  pinnedRowCellStyle,\n  pinnedRowPart,\n  pinnedRowSticky,\n  useOffsetHeight,\n} from \"../rows/pinnedRowChrome\";\nimport { rowClickProps } from \"../rows/rowClickProps\";\nimport type { RowPinSide } from \"../rows/rowPinning\";\nimport { rowPinSignature } from \"../rows/rowPinning\";\nimport {\n  REORDER_COLUMN_WIDTH,\n  rowReorderDropStyle,\n  rowReorderSignature,\n} from \"../rows/rowReorder\";\nimport { resolveRowStyle, rowStyleSignature } from \"../rows/rowStyle\";\nimport {\n  type SharedTableRenderProps,\n  type TableRenderModel,\n  tableRenderModel,\n  useSummaryCells,\n} from \"../tableRenderProps\";\nimport type { TreeEntry } from \"../tree/treeRows\";\nimport { bodyRowEntries } from \"../tree/treeRows\";\nimport type { ColumnDef, TableLabels } from \"../types\";\nimport type {\n  CellElementProps,\n  SortButtonElementProps,\n  UseDataTableResult,\n} from \"../useDataTable/useDataTable\";\nimport type { RowPairMeasurer } from \"../virtual/measureRowPair\";\nimport { useHorizontalOverflow } from \"./useHorizontalOverflow\";\n\n/** Width (px) reserved for the leading selection column. */\nexport const DESKTOP_SELECTION_WIDTH = 48;\n\n/** Width (px) reserved for the trailing actions column. */\nexport const DESKTOP_ACTIONS_WIDTH = 120;\n\n/** Width (px) reserved for the leading expand-chevron column. */\nexport const DESKTOP_EXPANSION_WIDTH = 32;\n\n/** Inline style for an absolutely-positioned column-resize handle. */\nexport const DESKTOP_RESIZE_HANDLE_STYLE: CSSProperties = {\n  position: \"absolute\",\n  insetInlineEnd: 0,\n  top: 0,\n  height: \"100%\",\n  width: 8,\n  cursor: \"col-resize\",\n  touchAction: \"none\",\n  userSelect: \"none\",\n};\n\n/** Per-kit chrome column widths. */\nexport interface DesktopChromeWidths {\n  /** Leading expand-chevron column. Default {@link DESKTOP_EXPANSION_WIDTH}. */\n  expansion?: number;\n  /** Leading selection column. Default {@link DESKTOP_SELECTION_WIDTH}. */\n  selection?: number;\n  /** Trailing actions column. Default {@link DESKTOP_ACTIONS_WIDTH}. */\n  actions?: number;\n  /**\n   * Whether the expand column contributes to start-pin leads.\n   * Most kits yes; unstyled keeps the chevron out of the pin math.\n   */\n  includeExpansionInLeads?: boolean;\n}\n\n/** Options for {@link useDesktopTableAssembly}. */\nexport interface DesktopAssemblyOptions {\n  /** Chrome column widths. */\n  widths?: DesktopChromeWidths;\n}\n\n/** Group-shaped body entries adapters hand to their group header. */\nexport type DesktopGroupEntry<TRow> = Extract<\n  GroupedFlatEntry<TRow>,\n  { kind: \"group\" | \"groupFooter\" | \"groupMore\" }\n>;\n\n/** One host-injected extra in the assembled body. */\nexport interface DesktopExtraSlot {\n  kind: \"extra\";\n  key: string;\n  extraKind: \"separator\" | \"fullWidth\";\n  colSpan: number;\n  render?: () => ReactNode;\n  fillStyle?: CSSProperties;\n}\n\n/** Virtual-window spacer. */\nexport interface DesktopVirtualPadSlot {\n  kind: \"virtualPad\";\n  key: \"pad-top\" | \"pad-bottom\";\n  height: number;\n  colSpan: number;\n}\n\n/** Group header / footer / more row. */\nexport interface DesktopGroupSlot<TRow> {\n  kind: \"group\";\n  key: string;\n  entry: DesktopGroupEntry<TRow>;\n}\n\n/** A data row, with wiring already assembled. */\nexport interface DesktopRowSlot<TRow> {\n  kind: \"row\";\n  key: string;\n  wiring: DesktopRowWiring<TRow>;\n}\n\n/** One visual slot in the assembled tbody, in reading order. */\nexport type DesktopBodySlot<TRow> =\n  | DesktopExtraSlot\n  | DesktopVirtualPadSlot\n  | DesktopGroupSlot<TRow>\n  | DesktopRowSlot<TRow>;\n\n/**\n * Shared visual + behaviour inputs for one memoized desktop row.\n * Adapters extend this with kit extras and paint with their own tags.\n */\nexport interface DesktopRowWiring<TRow> {\n  gridFocus?: GridFocusState;\n  row: TRow;\n  index: number;\n  id: string;\n  table: UseDataTableResult<TRow>;\n  columns: readonly ColumnDef<TRow>[];\n  bodyCells: readonly BodyCell<TRow>[];\n  spanSignature: string;\n  labels: Required<TableLabels>;\n  selected: boolean | undefined;\n  expanded: boolean | undefined;\n  showActions: boolean;\n  showReorder: boolean;\n  rowReorder: SharedTableRenderProps<TRow>[\"rowReorder\"];\n  windowStart: number;\n  rowCount: number;\n  reorderPinned: boolean;\n  reorderSignature: string | null;\n  rowPinSide?: RowPinSide;\n  pinRowSticky: boolean;\n  rowPinOffset: number;\n  rowPinSignature: string | null;\n  sourceIndex: number;\n  rowActions: SharedTableRenderProps<TRow>[\"rowActions\"];\n  rowActionsLayout: SharedTableRenderProps<TRow>[\"rowActionsLayout\"];\n  cellSpanAppearance: SharedTableRenderProps<TRow>[\"cellSpanAppearance\"];\n  renderRowActions: SharedTableRenderProps<TRow>[\"renderRowActions\"];\n  confirm: ConfirmHandler;\n  columnSpan: number;\n  columnSpacers?: { start: number; end: number };\n  treeEntry?: TreeEntry<TRow>;\n  treeColumnKey?: string;\n  onToggleTree?: (id: string) => void;\n  columnWidths?: Readonly<Record<string, number>>;\n  pinOffset?: (key: string) => PinOffset | undefined;\n  pinSignature: string;\n  hasStartPin: boolean;\n  hasEndPin: boolean;\n  actionsPinned: boolean;\n  rowClass: string | undefined;\n  rowVisualStyle: CSSProperties | undefined;\n  rowStyleSignature: string;\n  clickable: boolean;\n  hasPrefetch: boolean;\n  editing: EditableCellEditing<TRow> | undefined;\n  rows: readonly TRow[];\n  getRowId: (row: TRow) => string;\n  editingSignature: string | null;\n  onRowClick: (row: TRow) => void;\n  onPrefetch: (row: TRow) => void;\n  onToggleSelect: (id: string) => void;\n  onToggleExpand: (id: string) => void;\n  renderDetail: (row: TRow) => ReactNode;\n  measureElement?: (element: Element | null) => void;\n  measureRowPair?: RowPairMeasurer;\n  leads: PinLeads;\n  focusIndex: number;\n  pinPart: ReturnType<typeof pinnedRowPart>;\n  pinSticky: ReturnType<typeof pinnedRowSticky>;\n  edgeRowPin: ReturnType<typeof pinnedRowCellStyle>;\n  measureRef: ((element: Element | null) => void) | undefined;\n  /** getRowProps plus grid / click / reorder — spread onto the kit row. */\n  rowDomProps: Record<string, unknown>;\n  bodyPinStyle: (key: string) => CSSProperties | undefined;\n}\n\n/** Assembled sort / resize / filter state for one leaf header cell. */\nexport interface DesktopHeaderLeaf<TRow> {\n  column: ColumnDef<TRow>;\n  headerIndex: number;\n  rowSpan: number;\n  headerProps: CellElementProps;\n  columnHeaderProps: Record<string, unknown>;\n  style: CSSProperties;\n  sortDir: \"asc\" | \"desc\" | undefined;\n  sortActive: boolean;\n  sortButtonProps: SortButtonElementProps;\n  sortIndex: number | undefined;\n  caption: ReactNode;\n  headerDef: FilterDef<TRow> | undefined;\n  pinSide: PinOffset[\"side\"] | undefined;\n  resizeHandleProps: ColumnResizeHandleProps | undefined;\n  columnName: string;\n  showColumnCheckbox: boolean;\n  columnCheckboxChecked: boolean;\n  onToggleColumn: (() => void) | undefined;\n  columnSelectAriaLabel: string;\n}\n\n/** Pin / scroll / header geometry shared by every HTML-table adapter. */\nexport interface DesktopTablePin {\n  hasPinned: boolean;\n  hasStartPin: boolean;\n  hasEndPin: boolean;\n  stickActions: boolean;\n  signature: string;\n  leads: PinLeads;\n  extraMinWidth: number;\n  expansionLead: number;\n  reorderLead: number;\n  selectionLead: number;\n  pinRowSticky: boolean;\n  rowPinOffset: number;\n  stickyStyle: CSSProperties | undefined;\n  stickyAttr: true | undefined;\n  inScrollBox: boolean;\n  headerStickTop: number;\n  headStyle: (column: {\n    key: string;\n    width?: number | string;\n  }) => CSSProperties | undefined;\n  edgeHeadStyle: (\n    side: \"start\" | \"end\",\n    active: boolean\n  ) => CSSProperties | undefined;\n  edgeBodyStyle: (\n    side: \"start\" | \"end\",\n    active: boolean\n  ) => CSSProperties | undefined;\n}\n\n/** Result of {@link useDesktopTableAssembly}. */\nexport interface DesktopTableAssembly<TRow> {\n  /** Prelude from {@link tableRenderModel} — called, not replaced. */\n  model: TableRenderModel<TRow>;\n  summary: Partial<Record<string, ReactNode>> | undefined;\n  showColumnFooter: boolean;\n  headerPlan: readonly (readonly HtmlGroupedHeaderCell[])[] | undefined;\n  headerBand: number;\n  header: {\n    leading: {\n      expand: boolean;\n      reorder: boolean;\n      selection: boolean;\n      spacerStart: boolean;\n    };\n    trailing: {\n      spacerEnd: boolean;\n      actions: boolean;\n    };\n    leaf: (\n      column: ColumnDef<TRow>,\n      headerIndex: number,\n      rowSpan?: number\n    ) => DesktopHeaderLeaf<TRow>;\n    theadRef: RefCallback<HTMLElement>;\n    headerRowRef: RefCallback<HTMLElement>;\n    headerRowProps: Record<string, unknown>;\n  };\n  pin: DesktopTablePin;\n  scroll: {\n    overflowing: boolean;\n    boxStyle: CSSProperties | undefined;\n    bindScrollBox: RefCallback<HTMLDivElement>;\n  };\n  tableStyle: CSSProperties | undefined;\n  tableProps: ReturnType<UseDataTableResult<TRow>[\"getTableProps\"]>;\n  gridProps: Record<string, unknown> | undefined;\n  callbacks: {\n    onToggleSelect: (id: string) => void;\n    onToggleExpand: (id: string) => void;\n    onToggleGroup: (groupKey: string) => void;\n    handleRowClick: (row: TRow) => void;\n    handlePrefetch: (row: TRow) => void;\n    renderDetail: (row: TRow) => ReactNode;\n  };\n  bodySlots: readonly DesktopBodySlot<TRow>[];\n  widths: Required<\n    Pick<DesktopChromeWidths, \"expansion\" | \"selection\" | \"actions\">\n  > & {\n    reorder: number;\n    includeExpansionInLeads: boolean;\n  };\n  resizeHandleStyle: CSSProperties;\n}\n\n/** Props {@link useDesktopTableAssembly} reads. */\nexport type DesktopAssemblyProps<TRow> = SharedTableRenderProps<TRow> & {\n  /** Whether the injected actions column is user-pinned. */\n  actionsPinned?: boolean;\n};\n\n/**\n * Chrome column widths and pin leads.\n *\n * @param options - Which injected columns render, and their widths.\n */\nexport function desktopChromeMetrics(options: {\n  expandable: boolean;\n  showReorder: boolean;\n  hasSelection: boolean;\n  showActions: boolean;\n  widths?: DesktopChromeWidths;\n}): {\n  leads: PinLeads;\n  extraMinWidth: number;\n  expansionLead: number;\n  reorderLead: number;\n  selectionLead: number;\n  expansion: number;\n  selection: number;\n  actions: number;\n  includeExpansionInLeads: boolean;\n} {\n  const expansion = options.widths?.expansion ?? DESKTOP_EXPANSION_WIDTH;\n  const selection = options.widths?.selection ?? DESKTOP_SELECTION_WIDTH;\n  const actions = options.widths?.actions ?? DESKTOP_ACTIONS_WIDTH;\n  const includeExpansionInLeads =\n    options.widths?.includeExpansionInLeads ?? true;\n  const expansionLead =\n    options.expandable && includeExpansionInLeads ? expansion : 0;\n  const reorderLead = options.showReorder ? REORDER_COLUMN_WIDTH : 0;\n  const selectionWidth = options.hasSelection ? selection : 0;\n  const actionsLead = options.showActions ? actions : 0;\n  const start = expansionLead + reorderLead + selectionWidth;\n  return {\n    leads: { start, end: actionsLead },\n    extraMinWidth: start + actionsLead,\n    expansionLead,\n    reorderLead,\n    selectionLead: expansionLead + reorderLead,\n    expansion,\n    selection,\n    actions,\n    includeExpansionInLeads,\n  };\n}\n\n/**\n * Whether any column or injected chrome is pinned.\n *\n * @param columns - Visible columns.\n * @param pinOffset - Pin lookup.\n * @param stickActions - Actions column is user-pinned.\n * @param reorderPinnedLead - Reorder column is start-pinned.\n */\nexport function desktopHasPinned(\n  columns: readonly { key: string }[],\n  pinOffset: ((key: string) => unknown) | undefined,\n  stickActions: boolean,\n  reorderPinnedLead: boolean\n): boolean {\n  return (\n    columns.some((column) => pinOffset?.(column.key) != null) ||\n    stickActions ||\n    reorderPinnedLead\n  );\n}\n\n/**\n * Scroll-box style: a maxHeight box scrolls on both axes; otherwise the\n * wrapper scrolls sideways only when something needs it.\n *\n * @param maxHeight - Bounding height, if any.\n * @param scrollX - Whether horizontal overflow is needed.\n */\nexport function desktopScrollBoxStyle(\n  maxHeight: number | undefined,\n  scrollX: boolean\n): CSSProperties | undefined {\n  if (maxHeight != null) {\n    return { maxHeight, overflowX: \"auto\", overflowY: \"auto\" };\n  }\n  return scrollX ? { overflowX: \"auto\" } : undefined;\n}\n\n/**\n * Value-comparable digest of every column pin side + inset.\n *\n * @param columns - Visible columns.\n * @param pinOffset - Pin lookup.\n */\nexport function desktopPinSignature(\n  columns: readonly { key: string }[],\n  pinOffset: ((key: string) => PinOffset | undefined) | undefined\n): string {\n  return columns\n    .map((column) => {\n      const pin = pinOffset?.(column.key);\n      return pin ? `${column.key}:${pin.side}:${String(pin.inset)}` : \"\";\n    })\n    .join(\"|\");\n}\n\n/**\n * Ref that measures a scroll-body row (never a pinned one).\n *\n * @param pinned - Pin side, if any.\n * @param measureRowPair - Pair measurer when details can open.\n * @param index - Row index in the window.\n * @param measureElement - Single-element measurer.\n */\nexport function desktopRowMeasureRef(\n  pinned: RowPinSide | undefined,\n  measureRowPair: RowPairMeasurer | undefined,\n  index: number,\n  measureElement: ((element: Element | null) => void) | undefined\n): ((element: Element | null) => void) | undefined {\n  if (pinned) return undefined;\n  if (measureRowPair) return measureRowPair.row(index);\n  return measureElement;\n}\n\n/**\n * Body-cell pin style: column sticky + row-pin sticky, geometry only.\n *\n * @param key - Column key.\n * @param pinOffset - Pin lookup.\n * @param leads - Injected-column insets.\n * @param rowPinSide - Row pin side, if any.\n * @param rowPinOffset - Sticky header offset for a pinned row.\n */\nexport function desktopBodyPinStyle(\n  key: string,\n  pinOffset: ((key: string) => PinOffset | undefined) | undefined,\n  leads: PinLeads,\n  rowPinSide: RowPinSide | undefined,\n  rowPinOffset: number\n): CSSProperties | undefined {\n  const column = pinnedCellStyle(pinOffset?.(key), PIN_Z.body, leads);\n  const rowPin = pinnedRowCellStyle(\n    rowPinSide,\n    rowPinOffset,\n    column !== undefined\n  );\n  if (!column && !rowPin.position) return undefined;\n  return { ...column, ...rowPin };\n}\n\n/**\n * Header-cell sticky / pin / width style.\n *\n * @param column - The column.\n * @param options - Pin, widths, resize, sticky.\n */\nexport function desktopHeadCellStyle(\n  column: { key: string; width?: number | string },\n  options: {\n    pinOffset?: (key: string) => PinOffset | undefined;\n    leads: PinLeads;\n    columnWidths?: Readonly<Record<string, number>>;\n    setWidth?: (key: string, width: number) => void;\n    stickyStyle?: CSSProperties;\n  }\n): CSSProperties | undefined {\n  const pin = pinnedCellStyle(\n    options.pinOffset?.(column.key),\n    PIN_Z.headerPinned,\n    options.leads\n  );\n  const width = pin\n    ? pinnedColumnWidth(column, options.columnWidths)\n    : options.columnWidths?.[column.key];\n  if (!options.stickyStyle && !pin && width == null && !options.setWidth) {\n    return undefined;\n  }\n  const merged: CSSProperties = {\n    ...options.stickyStyle,\n    ...pin,\n    ...(width != null && { width }),\n  };\n  if (options.setWidth && !merged.position) merged.position = \"relative\";\n  return merged;\n}\n\n/**\n * Sticky + edge-pin style for an injected header cell.\n *\n * @param side - Start or end.\n * @param active - Whether a data column on that side is pinned.\n * @param stickyStyle - Sticky-header style, if any.\n */\nexport function desktopEdgeHeadStyle(\n  side: \"start\" | \"end\",\n  active: boolean,\n  stickyStyle: CSSProperties | undefined\n): CSSProperties | undefined {\n  const edge = edgePinStyle(side, active, PIN_Z.headerPinned);\n  if (!stickyStyle && !edge) return undefined;\n  return { ...stickyStyle, ...edge };\n}\n\nconst WIRING_EQUAL_KEYS = [\n  \"row\",\n  \"index\",\n  \"id\",\n  \"selected\",\n  \"expanded\",\n  \"treeEntry\",\n  \"columns\",\n  \"spanSignature\",\n  \"labels\",\n  \"showActions\",\n  \"showReorder\",\n  \"reorderSignature\",\n  \"rowPinSignature\",\n  \"rowPinSide\",\n  \"pinRowSticky\",\n  \"rowPinOffset\",\n  \"sourceIndex\",\n  \"reorderPinned\",\n  \"rowActions\",\n  \"rowActionsLayout\",\n  \"cellSpanAppearance\",\n  \"renderRowActions\",\n  \"columnSpan\",\n  \"columnWidths\",\n  \"pinSignature\",\n  \"hasStartPin\",\n  \"hasEndPin\",\n  \"actionsPinned\",\n  \"rowClass\",\n  \"rowStyleSignature\",\n  \"clickable\",\n  \"hasPrefetch\",\n  \"editingSignature\",\n  \"gridFocus\",\n  \"treeColumnKey\",\n] as const satisfies readonly (keyof DesktopRowWiring<unknown>)[];\n\n/**\n * Re-render a row only when a visual input changes.\n *\n * @typeParam TRow - The row type.\n * @param prev - Previous wiring.\n * @param next - Next wiring.\n */\nexport function desktopRowWiringEqual<TRow>(\n  prev: Readonly<DesktopRowWiring<TRow>>,\n  next: Readonly<DesktopRowWiring<TRow>>\n): boolean {\n  return WIRING_EQUAL_KEYS.every((key) => prev[key] === next[key]);\n}\n\n/**\n * One memoized row component per DesktopTable instantiation.\n *\n * @typeParam TRow - The row type.\n * @typeParam TProps - Wiring plus kit extras.\n * @param RowBase - Kit row painter.\n * @param extraEqual - Kit-extra comparator (classNames, size, dir).\n */\nexport function createDesktopRow<TRow, TProps extends DesktopRowWiring<TRow>>(\n  RowBase: (props: Readonly<TProps>) => ReactElement,\n  extraEqual?: (prev: Readonly<TProps>, next: Readonly<TProps>) => boolean\n) {\n  return memo(RowBase, (prev, next) => {\n    if (!desktopRowWiringEqual(prev, next)) return false;\n    return extraEqual?.(prev, next) ?? true;\n  });\n}\n\nfunction isGroupEntry<TRow>(\n  entry: GroupedFlatEntry<TRow>\n): entry is DesktopGroupEntry<TRow> {\n  return (\n    entry.kind === \"group\" ||\n    entry.kind === \"groupFooter\" ||\n    entry.kind === \"groupMore\"\n  );\n}\n\nfunction extraSlot(\n  slot: {\n    kind: \"separator\" | \"fullWidth\";\n    key: string;\n    render?: () => ReactNode;\n  },\n  columnSpan: number,\n  extraFill: (key: string) => CSSProperties | undefined\n): DesktopExtraSlot {\n  return {\n    kind: \"extra\",\n    key: slot.key,\n    extraKind: slot.kind,\n    colSpan: columnSpan,\n    render: slot.kind === \"fullWidth\" ? slot.render : undefined,\n    fillStyle: extraFill(slot.key),\n  };\n}\n\ninterface DesktopRowWiringContext<TRow> {\n  cellsByRow: ReadonlyMap<string, readonly BodyCell<TRow>[]>;\n  rowStyle: SharedTableRenderProps<TRow>[\"rowStyle\"];\n  rowHeight: SharedTableRenderProps<TRow>[\"rowHeight\"];\n  leads: PinLeads;\n  pinRowSticky: boolean;\n  rowPinOffset: number;\n  measureRowPair: SharedTableRenderProps<TRow>[\"measureRowPair\"];\n  measureElement: SharedTableRenderProps<TRow>[\"measureElement\"];\n  rowReorder: SharedTableRenderProps<TRow>[\"rowReorder\"];\n  table: UseDataTableResult<TRow>;\n  gridFocus: SharedTableRenderProps<TRow>[\"gridFocus\"];\n  onRowClick: SharedTableRenderProps<TRow>[\"onRowClick\"];\n  handleRowClick: (row: TRow) => void;\n  windowStart: number;\n  selection: TableRenderModel<TRow>[\"selection\"];\n  editing: SharedTableRenderProps<TRow>[\"editing\"];\n  prefetch: SharedTableRenderProps<TRow>[\"prefetch\"];\n  handlePrefetch: (row: TRow) => void;\n  columns: readonly ColumnDef<TRow>[];\n  labels: Required<TableLabels>;\n  expansionState: SharedTableRenderProps<TRow>[\"expansion\"];\n  showActions: boolean;\n  showReorder: boolean;\n  rows: readonly TRow[];\n  reorderPinned: boolean;\n  rowPinning: SharedTableRenderProps<TRow>[\"rowPinning\"];\n  rowActions: SharedTableRenderProps<TRow>[\"rowActions\"];\n  rowActionsLayout: SharedTableRenderProps<TRow>[\"rowActionsLayout\"];\n  cellSpanAppearance: SharedTableRenderProps<TRow>[\"cellSpanAppearance\"];\n  renderRowActions: SharedTableRenderProps<TRow>[\"renderRowActions\"];\n  confirm: ConfirmHandler;\n  columnSpan: number;\n  columnSpacers: TableRenderModel<TRow>[\"columnSpacers\"];\n  tree: SharedTableRenderProps<TRow>[\"tree\"];\n  columnWidths: SharedTableRenderProps<TRow>[\"columnWidths\"];\n  pinOffset: SharedTableRenderProps<TRow>[\"pinOffset\"];\n  pinSignature: string;\n  hasStartPin: boolean;\n  hasEndPin: boolean;\n  stickActions: boolean;\n  rowClassName: SharedTableRenderProps<TRow>[\"rowClassName\"];\n  getRowId: (row: TRow) => string;\n  onToggleSelect: (id: string) => void;\n  onToggleExpand: (id: string) => void;\n  renderDetail: (row: TRow) => ReactNode;\n}\n\ninterface DesktopRowWiringArgs<TRow> {\n  row: TRow;\n  index: number;\n  id: string;\n  sourceIndex: number;\n  rowPinSide: RowPinSide | undefined;\n  treeEntry: TreeEntry<TRow> | undefined;\n  measure: boolean;\n}\n\ninterface DesktopBodySlotsContext<TRow> {\n  pinnedTopRows: readonly TRow[];\n  pinnedBottomRows: readonly TRow[];\n  extraRows: SharedTableRenderProps<TRow>[\"extraRows\"];\n  extraFill: (key: string) => CSSProperties | undefined;\n  paddingTop: number;\n  paddingBottom: number;\n  grouping: SharedTableRenderProps<TRow>[\"grouping\"];\n  entries: TableRenderModel<TRow>[\"entries\"];\n  wiring: DesktopRowWiringContext<TRow>;\n}\n\nfunction buildDesktopRowWiring<TRow>(\n  ctx: DesktopRowWiringContext<TRow>,\n  args: DesktopRowWiringArgs<TRow>\n): DesktopRowWiring<TRow> {\n  const {\n    cellsByRow,\n    rowStyle,\n    rowHeight,\n    leads,\n    pinRowSticky,\n    rowPinOffset,\n    measureRowPair,\n    measureElement,\n    rowReorder,\n    table,\n    gridFocus,\n    onRowClick,\n    handleRowClick,\n    windowStart,\n    selection,\n    editing,\n    prefetch,\n    handlePrefetch,\n    columns,\n    labels,\n    expansionState,\n    showActions,\n    showReorder,\n    rows,\n    reorderPinned,\n    rowPinning,\n    rowActions,\n    rowActionsLayout,\n    cellSpanAppearance,\n    renderRowActions,\n    confirm,\n    columnSpan,\n    columnSpacers,\n    tree,\n    columnWidths,\n    pinOffset,\n    pinSignature,\n    hasStartPin,\n    hasEndPin,\n    stickActions,\n    rowClassName,\n    getRowId,\n    onToggleSelect,\n    onToggleExpand,\n    renderDetail,\n  } = ctx;\n  const { row, index, id, sourceIndex, rowPinSide, treeEntry, measure } = args;\n  const bodyCells = cellsForRow(cellsByRow, id);\n  const visualStyle = resolveRowStyle(rowStyle, rowHeight, row, sourceIndex);\n  const focusIndex = sourceIndex;\n  const pinPart = pinnedRowPart(rowPinSide);\n  const pinSticky = pinnedRowSticky(rowPinSide, pinRowSticky, rowPinOffset);\n  const edgeRowPin = pinnedRowCellStyle(rowPinSide, rowPinOffset, true);\n  const measureRef = measure\n    ? desktopRowMeasureRef(rowPinSide, measureRowPair, index, measureElement)\n    : undefined;\n  const reorderAttrs = rowReorder?.rowAttrs?.(id, index);\n  const rowDomProps = {\n    ...table.getRowProps(row, focusIndex),\n    ...gridFocus?.getRowPropsAt(focusIndex),\n    ...rowClickProps(row, onRowClick ? handleRowClick : undefined, focusIndex),\n    ...rowReorder?.dropProps?.(index, row, windowStart),\n    ...reorderAttrs,\n    \"data-row-pin\": rowPinSide,\n    \"data-adapttable-part\": pinPart ?? \"row\",\n    \"data-stagger\": \"\",\n    \"data-selected\": selection?.isSelected(id) ? \"\" : undefined,\n    \"data-dirty\": rowIsDirty(editing, id) ? \"\" : undefined,\n    \"data-clickable\": onRowClick ? \"\" : undefined,\n    style: {\n      ...visualStyle,\n      ...pinSticky,\n      ...rowReorderDropStyle(reorderAttrs),\n    },\n    onMouseEnter: prefetch ? () => handlePrefetch(row) : undefined,\n  };\n  return {\n    gridFocus,\n    row,\n    index,\n    id,\n    table,\n    columns,\n    bodyCells,\n    spanSignature: rowSpanSignature(bodyCells),\n    labels,\n    selected: selection ? selection.isSelected(id) : undefined,\n    expanded: expansionState ? expansionState.isExpanded(id) : undefined,\n    showActions,\n    showReorder,\n    rowReorder,\n    windowStart,\n    rowCount: rows.length,\n    reorderPinned,\n    reorderSignature: rowReorderSignature(rowReorder, id, index),\n    rowPinSide,\n    pinRowSticky,\n    rowPinOffset,\n    rowPinSignature: rowPinSignature(rowPinning, id),\n    sourceIndex,\n    rowActions,\n    rowActionsLayout,\n    cellSpanAppearance,\n    renderRowActions,\n    confirm,\n    columnSpan,\n    columnSpacers,\n    treeEntry,\n    treeColumnKey: tree?.columnKey,\n    onToggleTree: tree?.expansion.toggle,\n    columnWidths,\n    pinOffset,\n    pinSignature,\n    hasStartPin,\n    hasEndPin,\n    actionsPinned: stickActions,\n    rowClass: rowClassName?.(row, sourceIndex),\n    rowVisualStyle: visualStyle,\n    rowStyleSignature: rowStyleSignature(visualStyle),\n    clickable: Boolean(onRowClick),\n    hasPrefetch: Boolean(prefetch),\n    editing,\n    rows,\n    getRowId,\n    editingSignature: rowEditingSignature(editing, id),\n    onRowClick: handleRowClick,\n    onPrefetch: handlePrefetch,\n    onToggleSelect,\n    onToggleExpand,\n    renderDetail,\n    measureElement: measure ? measureElement : undefined,\n    measureRowPair: measure ? measureRowPair : undefined,\n    leads,\n    focusIndex,\n    pinPart,\n    pinSticky,\n    edgeRowPin,\n    measureRef,\n    rowDomProps,\n    bodyPinStyle: (key: string) =>\n      desktopBodyPinStyle(key, pinOffset, leads, rowPinSide, rowPinOffset),\n  };\n}\n\nfunction appendPinnedDesktopSlots<TRow>(\n  bodySlots: DesktopBodySlot<TRow>[],\n  ctx: DesktopBodySlotsContext<TRow>,\n  pinnedRows: readonly TRow[],\n  side: RowPinSide\n): void {\n  const { extraRows, extraFill, wiring } = ctx;\n  const { getRowId, columnSpan, rows } = wiring;\n  for (const slot of insertExtrasBeforeRows(pinnedRows, extraRows, getRowId)) {\n    if (isExtraEntry(slot)) {\n      bodySlots.push(extraSlot(slot, columnSpan, extraFill));\n    } else {\n      const id = getRowId(slot.row);\n      const found = rows.findIndex((item) => getRowId(item) === id);\n      const sourceIndex = Math.max(0, found);\n      bodySlots.push({\n        kind: \"row\",\n        key: slot.key,\n        wiring: buildDesktopRowWiring(wiring, {\n          row: slot.row,\n          index: sourceIndex,\n          id,\n          sourceIndex,\n          rowPinSide: side,\n          treeEntry: undefined,\n          measure: false,\n        }),\n      });\n    }\n  }\n}\n\nfunction appendGroupedDesktopSlots<TRow>(\n  bodySlots: DesktopBodySlot<TRow>[],\n  ctx: DesktopBodySlotsContext<TRow>\n): void {\n  const grouping = ctx.grouping;\n  if (!grouping) return;\n  const { extraFill, wiring } = ctx;\n  const { getRowId, columnSpan } = wiring;\n  for (const entry of grouping.entries) {\n    if (entry.kind === \"separator\" || entry.kind === \"fullWidth\") {\n      bodySlots.push(extraSlot(entry, columnSpan, extraFill));\n      continue;\n    }\n    if (isGroupEntry(entry)) {\n      bodySlots.push({ kind: \"group\", key: entry.key, entry });\n      continue;\n    }\n    const id = getRowId(entry.row);\n    bodySlots.push({\n      kind: \"row\",\n      key: entry.key,\n      wiring: buildDesktopRowWiring(wiring, {\n        row: entry.row,\n        index: entry.index,\n        id,\n        sourceIndex: entry.index,\n        rowPinSide: undefined,\n        treeEntry: undefined,\n        measure: true,\n      }),\n    });\n  }\n}\n\nfunction appendScrollDesktopSlots<TRow>(\n  bodySlots: DesktopBodySlot<TRow>[],\n  ctx: DesktopBodySlotsContext<TRow>\n): void {\n  const { extraRows, extraFill, entries, wiring } = ctx;\n  const { getRowId, columnSpan, tree } = wiring;\n  for (const slot of insertExtraRows(\n    bodyRowEntries(entries, tree),\n    extraRows,\n    (entry) => entry.key\n  )) {\n    if (isExtraEntry(slot)) {\n      bodySlots.push(extraSlot(slot, columnSpan, extraFill));\n      continue;\n    }\n    const { row, index, key, treeEntry, sourceIndex } = slot;\n    const id = getRowId(row);\n    const resolvedSource = sourceIndex ?? index;\n    bodySlots.push({\n      kind: \"row\",\n      key,\n      wiring: buildDesktopRowWiring(wiring, {\n        row,\n        index,\n        id,\n        sourceIndex: resolvedSource,\n        rowPinSide: undefined,\n        treeEntry,\n        measure: true,\n      }),\n    });\n  }\n}\n\nfunction collectDesktopBodySlots<TRow>(\n  ctx: DesktopBodySlotsContext<TRow>\n): DesktopBodySlot<TRow>[] {\n  const bodySlots: DesktopBodySlot<TRow>[] = [];\n  appendPinnedDesktopSlots(bodySlots, ctx, ctx.pinnedTopRows, \"top\");\n  if (ctx.paddingTop > 0) {\n    bodySlots.push({\n      kind: \"virtualPad\",\n      key: \"pad-top\",\n      height: ctx.paddingTop,\n      colSpan: ctx.wiring.columnSpan,\n    });\n  }\n  if (ctx.grouping) {\n    appendGroupedDesktopSlots(bodySlots, ctx);\n  } else {\n    appendScrollDesktopSlots(bodySlots, ctx);\n  }\n  if (ctx.paddingBottom > 0) {\n    bodySlots.push({\n      kind: \"virtualPad\",\n      key: \"pad-bottom\",\n      height: ctx.paddingBottom,\n      colSpan: ctx.wiring.columnSpan,\n    });\n  }\n  appendPinnedDesktopSlots(bodySlots, ctx, ctx.pinnedBottomRows, \"bottom\");\n  return bodySlots;\n}\n\n/**\n * Shared desktop-table assembly. Calls {@link tableRenderModel} and\n * {@link UseDataTableResult.getRowProps}; does not replace them.\n *\n * @typeParam TRow - The row type.\n * @param props - The shared render contract plus actionsPinned.\n * @param options - Kit chrome widths.\n */\nexport function useDesktopTableAssembly<TRow>(\n  props: DesktopAssemblyProps<TRow>,\n  options: DesktopAssemblyOptions = {}\n): DesktopTableAssembly<TRow> {\n  const {\n    gridFocus,\n    table,\n    rows,\n    rowActions,\n    confirm,\n    getRowId,\n    prefetch,\n    onRowClick,\n    rowClassName,\n    collapsibleColumnGroups,\n    collapsedColumnGroups,\n    columnGroups,\n    rowStyle,\n    rowHeight,\n    renderRowDetail,\n    summaryRow,\n    expansion,\n    editing,\n    grouping,\n    rowEntries,\n    paddingTop = 0,\n    paddingBottom = 0,\n    measureElement,\n    measureRowPair,\n    stickyHeader = false,\n    stickyTop = 0,\n    pinOffset,\n    maxHeight,\n    virtualScrollRef,\n    setWidth,\n    columnWidths,\n    resizeLabel = \"Resize column\",\n    actionsPinned = false,\n    reorderPinned = false,\n    rowReorder,\n    windowStart = 0,\n    pinnedTopRows = [],\n    pinnedBottomRows = [],\n    rowPinning,\n    columnWindow,\n    fitColumns,\n    tree,\n    getCellSpan,\n    extraRows,\n    headerFilters,\n    filterDefs,\n    rowActionsLayout,\n    cellSpanAppearance,\n    renderRowActions,\n  } = props;\n\n  const model = tableRenderModel({\n    table,\n    rows,\n    columnWindow,\n    rowActions,\n    getRowId,\n    rowEntries,\n    renderRowDetail,\n    expansion,\n    editing,\n    rowReorder,\n    pinnedTopRows,\n    pinnedBottomRows,\n    getCellSpan,\n    pinOffset,\n    tree,\n    grouping,\n    extraRows,\n  });\n  const {\n    columns,\n    selection,\n    labels,\n    showActions,\n    showReorder,\n    entries,\n    columnSpan,\n    columnSpacers,\n    cellsByRow,\n  } = model;\n\n  const pinRowSticky = !bodyCellsHaveRowSpan(cellsByRow);\n  const extraFill = (key: string) =>\n    extraHostFillStyle(key, extraRows, rows, getRowId, rowStyle);\n  const [theadRef, headerHeight] = useOffsetHeight();\n  const [headerRowRef] = useOffsetHeight();\n  const stickActions = showActions && actionsPinned;\n  const expansionState = renderRowDetail ? expansion : undefined;\n  const expandable = expansionState !== undefined;\n\n  const live = useRef({\n    selection,\n    expansion: expansionState,\n    grouping,\n    onRowClick,\n    prefetch,\n    renderRowDetail,\n  });\n  live.current = {\n    selection,\n    expansion: expansionState,\n    grouping,\n    onRowClick,\n    prefetch,\n    renderRowDetail,\n  };\n  const onToggleSelect = useCallback(\n    (id: string) => live.current.selection?.toggle(id),\n    []\n  );\n  const onToggleExpand = useCallback(\n    (id: string) => live.current.expansion?.toggle(id),\n    []\n  );\n  const onToggleGroup = useCallback(\n    (groupKey: string) => live.current.grouping?.collapsed.toggle(groupKey),\n    []\n  );\n  const handleRowClick = useCallback(\n    (row: TRow) => live.current.onRowClick?.(row),\n    []\n  );\n  const handlePrefetch = useCallback(\n    (row: TRow) => live.current.prefetch?.(row),\n    []\n  );\n  const renderDetail = useCallback(\n    (row: TRow) => live.current.renderRowDetail?.(row),\n    []\n  );\n\n  const { ref: overflowRef, overflowing } =\n    useHorizontalOverflow<HTMLDivElement>();\n\n  const metrics = desktopChromeMetrics({\n    expandable,\n    showReorder,\n    hasSelection: Boolean(selection),\n    showActions,\n    widths: options.widths,\n  });\n  const hasPinned = desktopHasPinned(\n    columns,\n    pinOffset,\n    stickActions,\n    showReorder && reorderPinned\n  );\n  const inScrollBox = maxHeight != null || hasPinned || overflowing;\n  const headerStickTop = inScrollBox ? 0 : stickyTop;\n  const rowPinOffset = stickyHeader ? headerStickTop + headerHeight : 0;\n  const stickyStyle: CSSProperties | undefined = stickyHeader\n    ? {\n        position: \"sticky\",\n        top: inScrollBox ? 0 : stickyTop,\n        zIndex: PIN_Z.header,\n      }\n    : undefined;\n  const stickyAttr = stickyHeader || undefined;\n  const hasStartPin = columns.some(\n    (column) => pinOffset?.(column.key)?.side === \"start\"\n  );\n  const hasEndPin = columns.some(\n    (column) => pinOffset?.(column.key)?.side === \"end\"\n  );\n  const pinSignature = desktopPinSignature(columns, pinOffset);\n  const headStyle = (column: { key: string; width?: number | string }) =>\n    desktopHeadCellStyle(column, {\n      pinOffset,\n      leads: metrics.leads,\n      columnWidths,\n      setWidth,\n      stickyStyle,\n    });\n  const edgeHeadStyle = (side: \"start\" | \"end\", active: boolean) =>\n    desktopEdgeHeadStyle(side, active, stickyStyle);\n  const edgeBodyStyle = (side: \"start\" | \"end\", active: boolean) =>\n    edgePinStyle(side, active, PIN_Z.body);\n\n  const headerPlan = htmlGroupedHeaderPlan(\n    columns,\n    collapsedColumnGroups,\n    collapsibleColumnGroups,\n    columnGroups\n  );\n  const headerBand = headerPlan?.length ?? 1;\n  const summary = useSummaryCells(summaryRow, rows);\n  const showColumnFooter = summary !== undefined || columnsHaveFooter(columns);\n\n  const minWidth = tableMinWidth(columns, {\n    widths: columnWidths,\n    extra: metrics.extraMinWidth,\n  });\n  const mergedTableStyle: CSSProperties = {\n    ...(minWidth > 0 ? { minWidth } : {}),\n    ...fittedTableStyle(fitColumns),\n  };\n  const resolvedTableStyle =\n    Object.keys(mergedTableStyle).length > 0 ? mergedTableStyle : undefined;\n\n  const bindScrollBox = useCallback<RefCallback<HTMLDivElement>>(\n    (node) => {\n      overflowRef(node);\n      virtualScrollRef?.(node);\n    },\n    [overflowRef, virtualScrollRef]\n  );\n\n  const wiringCtx: DesktopRowWiringContext<TRow> = {\n    cellsByRow,\n    rowStyle,\n    rowHeight,\n    leads: metrics.leads,\n    pinRowSticky,\n    rowPinOffset,\n    measureRowPair,\n    measureElement,\n    rowReorder,\n    table,\n    gridFocus,\n    onRowClick,\n    handleRowClick,\n    windowStart,\n    selection,\n    editing,\n    prefetch,\n    handlePrefetch,\n    columns,\n    labels,\n    expansionState,\n    showActions,\n    showReorder,\n    rows,\n    reorderPinned,\n    rowPinning,\n    rowActions,\n    rowActionsLayout,\n    cellSpanAppearance,\n    renderRowActions,\n    confirm,\n    columnSpan,\n    columnSpacers,\n    tree,\n    columnWidths,\n    pinOffset,\n    pinSignature,\n    hasStartPin,\n    hasEndPin,\n    stickActions,\n    rowClassName,\n    getRowId,\n    onToggleSelect,\n    onToggleExpand,\n    renderDetail,\n  };\n\n  const bodySlots = collectDesktopBodySlots({\n    pinnedTopRows,\n    pinnedBottomRows,\n    extraRows,\n    extraFill,\n    paddingTop,\n    paddingBottom,\n    grouping,\n    entries,\n    wiring: wiringCtx,\n  });\n\n  const leaf = (\n    column: ColumnDef<TRow>,\n    headerIndex: number,\n    rowSpan = 1\n  ): DesktopHeaderLeaf<TRow> => {\n    const localStyle = headStyle(column);\n    const headerProps = table.getHeaderCellProps(\n      column,\n      localStyle && { style: localStyle }\n    );\n    const chainDir = table.source.sortLevels.find(\n      (level) => level.key === column.key\n    )?.dir;\n    const effectiveDir =\n      chainDir ?? (table.sortBy === column.key ? table.sortDir : undefined);\n    const sortButtonProps = table.getSortButtonProps(column);\n    const sortIndex = sortButtonProps[\"data-sort-index\"];\n    const headerController = columnHeaderController(column, {\n      sortDir: effectiveDir,\n      sortIndex: typeof sortIndex === \"number\" ? sortIndex : undefined,\n      toggleSort: sortButtonProps.onClick,\n    });\n    const headerCaption = resolveColumnHeader(column, headerController);\n    const headerDef =\n      headerFilters === true\n        ? filterDefForColumn(filterDefs ?? [], column.key)\n        : undefined;\n    const columnName =\n      typeof column.header === \"string\" ? column.header : column.key;\n    const style = {\n      ...headerProps.style,\n      ...(rowSpan > 1 ? { verticalAlign: \"middle\" as const } : {}),\n    };\n    return {\n      column,\n      headerIndex,\n      rowSpan,\n      headerProps,\n      columnHeaderProps:\n        gridFocus?.getColumnHeaderProps(headerIndex, {\n          sortable: column.sortable,\n        }) ?? {},\n      style,\n      sortDir: effectiveDir,\n      sortActive: effectiveDir !== undefined,\n      sortButtonProps,\n      sortIndex: typeof sortIndex === \"number\" ? sortIndex : undefined,\n      caption: headerCaption,\n      headerDef,\n      pinSide: pinOffset?.(column.key)?.side,\n      resizeHandleProps: setWidth\n        ? columnResizeHandleProps(\n            column.key,\n            setWidth,\n            `${resizeLabel}: ${columnName}`\n          )\n        : undefined,\n      columnName,\n      showColumnCheckbox: gridFocus?.columnCheckbox === true,\n      columnCheckboxChecked: gridFocus?.isColumnSelected(headerIndex) ?? false,\n      onToggleColumn: gridFocus\n        ? () => gridFocus.toggleColumn(headerIndex)\n        : undefined,\n      columnSelectAriaLabel: columnSelectLabel(labels.selectColumn, column),\n    };\n  };\n\n  return {\n    model,\n    summary,\n    showColumnFooter,\n    headerPlan: headerPlan ?? undefined,\n    headerBand,\n    header: {\n      leading: {\n        expand: expandable,\n        reorder: showReorder,\n        selection: Boolean(selection),\n        spacerStart: columnSpacers !== undefined,\n      },\n      trailing: {\n        spacerEnd: columnSpacers !== undefined,\n        actions: showActions,\n      },\n      leaf,\n      theadRef,\n      headerRowRef,\n      headerRowProps: table.getHeaderRowProps(),\n    },\n    pin: {\n      hasPinned,\n      hasStartPin,\n      hasEndPin,\n      stickActions,\n      signature: pinSignature,\n      leads: metrics.leads,\n      extraMinWidth: metrics.extraMinWidth,\n      expansionLead: metrics.expansionLead,\n      reorderLead: metrics.reorderLead,\n      selectionLead: metrics.selectionLead,\n      pinRowSticky,\n      rowPinOffset,\n      stickyStyle,\n      stickyAttr,\n      inScrollBox,\n      headerStickTop,\n      headStyle,\n      edgeHeadStyle,\n      edgeBodyStyle,\n    },\n    scroll: {\n      overflowing,\n      boxStyle: desktopScrollBoxStyle(maxHeight, hasPinned || overflowing),\n      bindScrollBox,\n    },\n    tableStyle: resolvedTableStyle,\n    tableProps: table.getTableProps(),\n    gridProps: gridFocus?.getGridProps(),\n    callbacks: {\n      onToggleSelect,\n      onToggleExpand,\n      onToggleGroup,\n      handleRowClick,\n      handlePrefetch,\n      renderDetail,\n    },\n    bodySlots,\n    widths: {\n      expansion: metrics.expansion,\n      selection: metrics.selection,\n      actions: metrics.actions,\n      reorder: REORDER_COLUMN_WIDTH,\n      includeExpansionInLeads: metrics.includeExpansionInLeads,\n    },\n    resizeHandleStyle: DESKTOP_RESIZE_HANDLE_STYLE,\n  };\n}\n","/**\n * The side panel: table settings docked beside the table instead of\n * floating over it.\n *\n * A popover is right for a control you touch once and dismiss. It is wrong\n * for the work of setting a table up — choosing columns, building a filter,\n * arranging a pivot — because that is iterative: change one thing, look at\n * the rows, change another. A popover closes when you look away, and the\n * rows are behind it while it is open. A docked panel stays put and shares\n * the width, which is why every serious grid grows one.\n *\n * What core owns here is the part a kit would get subtly wrong: the tabs\n * are a real `tablist` with roving focus, arrow keys wrap and move the\n * selection with them, Escape closes from anywhere inside, and the panel\n * body is a `tabpanel` labelled by its tab. Which panel is showing is\n * state, and state belongs here rather than in seven copies. Putting focus\n * back after a close belongs to whatever opened the panel, which is the\n * only thing that knows where focus was.\n *\n * What the kit owns is everything visible: the panel's frame, the tab\n * buttons, the close control. There is no fallback for those — a docked\n * panel drawn in raw HTML inside an MUI table is exactly the mismatch the\n * slots law exists to prevent.\n *\n * The panels themselves are content the caller supplies. That is what lets\n * the same chrome hold a filter form, a column list, or a pivot builder\n * without knowing what any of them are.\n */\nimport { type KeyboardEvent, type ReactNode, useCallback, useRef } from \"react\";\n\nimport type { TableLabels } from \"../types\";\n\n/** One panel in the side panel's strip. */\nexport interface SidePanelEntry {\n  /** Stable identity, used for the open-panel state and the URL. */\n  key: string;\n  /** The tab's caption, already localized. */\n  label: string;\n  /** What the panel shows when it is the selected one. */\n  content: ReactNode;\n}\n\n/** Props an adapter's panel frame receives. */\nexport interface SidePanelFrameProps {\n  /** The tab strip and the panel body, in order. */\n  readonly children: ReactNode;\n  /** Which edge the panel is docked to, already resolved for direction. */\n  readonly side: \"start\" | \"end\";\n  readonly className?: string;\n}\n\n/** Props an adapter's tab button receives. */\nexport interface SidePanelTabProps {\n  readonly panel: SidePanelEntry;\n  readonly selected: boolean;\n  /** Spread onto the button: role, tabindex, aria wiring, id and keys. */\n  readonly buttonProps: {\n    readonly id: string;\n    readonly role: \"tab\";\n    readonly type: \"button\";\n    readonly tabIndex: number;\n    readonly \"aria-selected\": boolean;\n    readonly \"aria-controls\": string;\n    readonly \"data-adapttable-part\": \"side-panel-tab\";\n    readonly onClick: () => void;\n    readonly onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n  };\n}\n\n/** Props an adapter's close control receives. */\nexport interface SidePanelCloseProps {\n  readonly label: string;\n  readonly onClose: () => void;\n}\n\n/** Adapter-owned rendering for {@link SidePanelChrome}. */\nexport interface SidePanelSlots {\n  /** The docked frame around everything. */\n  readonly Frame: (props: SidePanelFrameProps) => ReactNode;\n  /** One tab in the strip. Omitted when there is only one panel. */\n  readonly Tab: (props: SidePanelTabProps) => ReactNode;\n  /** The control that closes the panel. */\n  readonly Close: (props: SidePanelCloseProps) => ReactNode;\n}\n\n/** What the side panel needs to render. */\nexport interface SidePanelChromeProps {\n  /** The panels, in tab order. Rendering nothing when empty. */\n  panels: readonly SidePanelEntry[];\n  /** Which panel is showing. */\n  openPanel: string;\n  /** Show a different panel. */\n  onOpenPanel: (key: string) => void;\n  /** Close the panel entirely. */\n  onClose: () => void;\n  /** Which edge to dock to. Defaults to `\"end\"`. */\n  side?: \"start\" | \"end\";\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** A unique id root, so two tables on a page do not collide. */\n  idPrefix?: string;\n  /** A kit's own class for the frame. */\n  className?: string;\n  /** Adapter-owned visible components. */\n  slots: SidePanelSlots;\n}\n\n/**\n * Move the roving tab stop.\n *\n * Arrow keys wrap, Home and End jump to the ends — the pattern a `tablist`\n * is expected to follow, and the reason the tabs are not seven buttons.\n */\nfunction nextIndex(key: string, at: number, count: number): number | undefined {\n  if (key === \"ArrowRight\" || key === \"ArrowDown\") return (at + 1) % count;\n  if (key === \"ArrowLeft\" || key === \"ArrowUp\") return (at - 1 + count) % count;\n  if (key === \"Home\") return 0;\n  if (key === \"End\") return count - 1;\n  return undefined;\n}\n\n/**\n * Renders the side panel, or nothing when there are no panels to show.\n *\n * @param props - The panels, which one is open, and the kit's slots.\n * @returns The docked panel.\n */\nexport function SidePanelChrome(props: Readonly<SidePanelChromeProps>) {\n  const { panels, openPanel, onOpenPanel, onClose, slots } = props;\n  const tabsRef = useRef<HTMLDivElement | null>(null);\n  const prefix = props.idPrefix ?? \"adapttable-side-panel\";\n  const selectedIndex = Math.max(\n    0,\n    panels.findIndex((panel) => panel.key === openPanel)\n  );\n  const selected = panels[selectedIndex];\n\n  // The keys are handled on the tabs rather than on the strip around them:\n  // the tab is what has focus, and a `tablist` that listens for keys is a\n  // container the user can never be inside of.\n  const onKeyDown = useCallback(\n    (event: KeyboardEvent<HTMLElement>) => {\n      if (event.key === \"Escape\") {\n        event.stopPropagation();\n        onClose();\n        return;\n      }\n      const to = nextIndex(event.key, selectedIndex, panels.length);\n      if (to === undefined) return;\n      const panel = panels[to];\n      if (!panel) return;\n      event.preventDefault();\n      onOpenPanel(panel.key);\n      // Focus follows selection in an automatic tablist, and the newly\n      // selected tab is the only one still in the tab order.\n      const id = CSS.escape(`${prefix}-tab-${panel.key}`);\n      tabsRef.current?.querySelector<HTMLElement>(`#${id}`)?.focus();\n    },\n    [onClose, onOpenPanel, panels, prefix, selectedIndex]\n  );\n\n  if (panels.length === 0 || !selected) return null;\n\n  const labels = props.labels;\n  return (\n    <slots.Frame side={props.side ?? \"end\"} className={props.className}>\n      <div\n        data-adapttable-part=\"side-panel-header\"\n        style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}\n      >\n        {panels.length > 1 && (\n          <div\n            ref={tabsRef}\n            role=\"tablist\"\n            aria-label={labels?.sidePanel ?? \"Table settings\"}\n            data-adapttable-part=\"side-panel-tabs\"\n            style={{ display: \"flex\", flex: 1, gap: 4 }}\n          >\n            {panels.map((panel, index) => (\n              <slots.Tab\n                key={panel.key}\n                panel={panel}\n                selected={index === selectedIndex}\n                buttonProps={{\n                  id: `${prefix}-tab-${panel.key}`,\n                  role: \"tab\",\n                  type: \"button\",\n                  tabIndex: index === selectedIndex ? 0 : -1,\n                  \"aria-selected\": index === selectedIndex,\n                  \"aria-controls\": `${prefix}-body`,\n                  \"data-adapttable-part\": \"side-panel-tab\",\n                  onClick: () => {\n                    onOpenPanel(panel.key);\n                  },\n                  onKeyDown,\n                }}\n              />\n            ))}\n          </div>\n        )}\n        <slots.Close\n          label={labels?.closePanel ?? \"Close panel\"}\n          onClose={onClose}\n        />\n      </div>\n      <div\n        id={`${prefix}-body`}\n        role={panels.length > 1 ? \"tabpanel\" : undefined}\n        aria-labelledby={\n          panels.length > 1 ? `${prefix}-tab-${selected.key}` : undefined\n        }\n        data-adapttable-part=\"side-panel-body\"\n        // A single-panel side panel has no tab to be labelled by, so it\n        // names itself — otherwise the region is anonymous to a screen\n        // reader the moment a host asks for only one panel.\n        aria-label={panels.length > 1 ? undefined : selected.label}\n        onKeyDown={(event) => {\n          if (event.key !== \"Escape\") return;\n          event.stopPropagation();\n          onClose();\n        }}\n      >\n        {selected.content}\n      </div>\n    </slots.Frame>\n  );\n}\n\n/** What {@link SidePanelLayout} arranges. */\nexport interface SidePanelLayoutProps {\n  /** The table itself — everything the panel sits beside. */\n  body: ReactNode;\n  /** The rendered side panel, or nothing when none is open. */\n  panel?: ReactNode;\n  /** Which edge the panel is docked to. Defaults to `\"end\"`. */\n  side?: \"start\" | \"end\";\n}\n\n/**\n * Put the table and its panel side by side.\n *\n * This is structure, not appearance — a flex row and a `min-width: 0` so the\n * table can still scroll horizontally inside it — which is why it lives in\n * core rather than in eight copies. Without a panel it renders the body\n * alone and adds no element at all, so a table that never asks for one has\n * exactly the DOM it always had.\n *\n * It exists as a component rather than as a ternary in each adapter for a\n * reason worth stating: the same \"if the host asked for it, wrap; otherwise\n * do not\" shape written eight times is eight chances to differ, and one\n * kit's copy already tripped a complexity limit when the status bar took\n * that form.\n *\n * @param props - The body, the panel, and which side it docks to.\n * @returns The arranged region.\n */\nexport function SidePanelLayout(props: Readonly<SidePanelLayoutProps>) {\n  if (!props.panel) return <>{props.body}</>;\n  return (\n    <div\n      data-adapttable-part=\"table-region\"\n      style={{\n        display: \"flex\",\n        gap: 12,\n        alignItems: \"flex-start\",\n        flexDirection: props.side === \"start\" ? \"row-reverse\" : \"row\",\n      }}\n    >\n      {/* `min-width: 0` is what lets the table keep its own horizontal\n          scrollbar instead of forcing the row wider than its container. */}\n      <div\n        data-adapttable-part=\"table-region-main\"\n        style={{ flex: 1, minWidth: 0 }}\n      >\n        {props.body}\n      </div>\n      {props.panel}\n    </div>\n  );\n}\n","import type { CSSProperties, RefCallback } from \"react\";\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\n\n/**\n * Whether the toolbar should pin with the sticky header.\n *\n * Inside a table that already scrolls in a box (`maxHeight`, or antd's\n * native virtual scroller) the toolbar sits *outside* that box — it stays\n * on screen without `position: sticky`. Pinning it to the page anyway\n * detaches search from the card while the rows still scroll inside, which\n * is the ugly double-scroller.\n */\nexport function resolveStickyToolbar(\n  stickyHeader?: boolean,\n  stickyToolbar?: boolean,\n  inScrollBox = false\n): boolean {\n  if (inScrollBox) return false;\n  return stickyToolbar ?? Boolean(stickyHeader);\n}\n\n/**\n * Measure the toolbar and return the styles that park it at `stickyTop`,\n * plus the header inset that keeps thead from sliding under it.\n */\nexport function useStickyToolbarLayout(\n  enabled: boolean,\n  stickyTop = 0\n): {\n  toolbarRef: RefCallback<HTMLElement | null>;\n  toolbarStyle: CSSProperties | undefined;\n  headerOffset: number;\n} {\n  const nodeRef = useRef<HTMLElement | null>(null);\n  const [height, setHeight] = useState(0);\n\n  const read = useCallback(() => {\n    const node = nodeRef.current;\n    if (!enabled || !node) {\n      setHeight(0);\n      return;\n    }\n    const next = Math.ceil(node.getBoundingClientRect().height);\n    setHeight((prev) => (prev === next ? prev : next));\n  }, [enabled]);\n\n  const toolbarRef = useCallback(\n    (node: HTMLElement | null) => {\n      nodeRef.current = node;\n      read();\n    },\n    [read]\n  );\n\n  useLayoutEffect(() => {\n    if (!enabled) {\n      setHeight(0);\n      return;\n    }\n    read();\n    const node = nodeRef.current;\n    if (!node || typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(read);\n    ro.observe(node);\n    return () => {\n      ro.disconnect();\n    };\n  }, [enabled, read]);\n\n  const toolbarStyle: CSSProperties | undefined = enabled\n    ? {\n        position: \"sticky\",\n        top: stickyTop,\n        zIndex: 3,\n        background: \"var(--adapttable-surface, Canvas)\",\n      }\n    : undefined;\n\n  return {\n    toolbarRef,\n    toolbarStyle,\n    headerOffset: enabled ? stickyTop + height : stickyTop,\n  };\n}\n","/**\n * The pivot configuration panel: three lists, and a way to move fields\n * between them.\n *\n * Every pivot UI in every spreadsheet is drag-and-drop, and every one of them\n * is unusable without a mouse. Dragging is a fine way to express \"put Team\n * above Region\" and a terrible way to be the *only* way — so the panel is\n * built keyboard-first: each field carries buttons that move it, and the\n * result is a control anyone can drive with Tab and Enter. A kit that wants\n * dragging can add it on top; nothing here forbids it, and nothing here\n * depends on it.\n *\n * Structure, part names, ordering and labels live here. Every visible control\n * — the buttons, the selects, the surfaces they sit on — is a required slot\n * the adapter fills with its own kit's component, so a Mantine panel is built\n * from Mantine buttons and an antd panel from antd buttons.\n */\nimport type { ReactNode } from \"react\";\n\nimport type { AggregateName } from \"../aggregate/aggregate\";\nimport { resolveLabels } from \"../labels\";\nimport type { TableLabels } from \"../types\";\nimport {\n  assignField,\n  availableFields,\n  measureLabel,\n  moveField,\n  type PivotField,\n  type PivotZone,\n  removeField,\n  setMeasureAgg,\n} from \"./pivotConfigModel\";\nimport type { PivotConfig } from \"./pivotModel\";\n\n/** The aggregations the panel offers. */\nconst AGGREGATIONS: readonly AggregateName[] = [\n  \"sum\",\n  \"avg\",\n  \"count\",\n  \"min\",\n  \"max\",\n];\n\n/** Props an adapter's panel surface receives. */\nexport interface PivotPanelSurfaceProps {\n  readonly children: ReactNode;\n  readonly className?: string;\n  /** Spread onto the surface — the public part name. */\n  readonly \"data-adapttable-part\": \"pivot-panel\";\n}\n\n/** Props an adapter's zone receives — one titled list. */\nexport interface PivotZoneProps {\n  /** Which zone this is, for styling and testing. */\n  readonly zone: PivotZone;\n  /** The zone's caption, already localized. */\n  readonly label: string;\n  /** Its entries, and the control that adds to it. */\n  readonly children: ReactNode;\n  /** Spread onto the zone — the public part name. */\n  readonly \"data-adapttable-part\": \"pivot-zone\";\n}\n\n/** Props an adapter's field row receives. */\nexport interface PivotFieldProps {\n  /** What to call the field. */\n  readonly label: string;\n  /** Move it one step towards the outside. `undefined` when it is first. */\n  readonly onMoveUp?: () => void;\n  /** Move it one step towards the inside. `undefined` when it is last. */\n  readonly onMoveDown?: () => void;\n  /** Take it off this zone. */\n  readonly onRemove: () => void;\n  /** Accessible names for the three controls. */\n  readonly moveUpLabel: string;\n  readonly moveDownLabel: string;\n  readonly removeLabel: string;\n  /** The aggregation chooser, for a measure. Absent on a dimension. */\n  readonly aggregation?: ReactNode;\n  /** Spread onto the field row — the public part name. */\n  readonly \"data-adapttable-part\": \"pivot-field\";\n}\n\n/** Props an adapter's \"add a field\" control receives. */\nexport interface PivotAddProps {\n  /** Accessible name. */\n  readonly label: string;\n  /** The fields that can still be added. Empty means nothing is left. */\n  readonly options: readonly PivotField[];\n  /** Add one. */\n  readonly onAdd: (key: string) => void;\n}\n\n/** Props an adapter's aggregation chooser receives. */\nexport interface PivotAggProps {\n  /** Accessible name. */\n  readonly label: string;\n  /** The current aggregation. */\n  readonly value: AggregateName;\n  /** What it can be. */\n  readonly options: readonly AggregateName[];\n  /** Change it. */\n  readonly onChange: (next: AggregateName) => void;\n}\n\n/** The kit-native pieces the panel is built from. */\nexport interface PivotPanelSlots {\n  /** The panel body. */\n  readonly Surface: (props: PivotPanelSurfaceProps) => ReactNode;\n  /** One titled zone. */\n  readonly Zone: (props: PivotZoneProps) => ReactNode;\n  /** One field in a zone. */\n  readonly Field: (props: PivotFieldProps) => ReactNode;\n  /** The control that adds a field to a zone. */\n  readonly Add: (props: PivotAddProps) => ReactNode;\n  /** The aggregation chooser on a measure. */\n  readonly Agg: (props: PivotAggProps) => ReactNode;\n}\n\n/** What the panel needs to render. */\nexport interface PivotPanelChromeProps {\n  /** Every field the user can pivot on. */\n  fields: readonly PivotField[];\n  /** The configuration being edited. */\n  config: PivotConfig;\n  /** Report a change. The panel never holds the configuration itself. */\n  onChange: (next: PivotConfig) => void;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** The kit's controls. */\n  slots: PivotPanelSlots;\n  className?: string;\n}\n\n/** The caption for one zone. */\nfunction zoneLabel(zone: PivotZone, labels: Required<TableLabels>): string {\n  if (zone === \"rows\") return labels.pivotRows;\n  if (zone === \"columns\") return labels.pivotColumns;\n  return labels.pivotMeasures;\n}\n\n/**\n * The pivot configuration panel.\n *\n * @param props - Fields, the configuration, a change handler and the slots.\n * @returns The panel, built from the adapter's own controls.\n */\nexport function PivotPanelChrome({\n  fields,\n  config,\n  onChange,\n  labels: labelsProp,\n  slots,\n  className,\n}: Readonly<PivotPanelChromeProps>) {\n  const labels = resolveLabels(labelsProp);\n  const { Surface, Zone, Field, Add, Agg } = slots;\n  const unused = availableFields(fields, config);\n  const nameOf = (key: string) =>\n    fields.find((field) => field.key === key)?.label ?? key;\n\n  const entriesFor = (zone: PivotZone): { key: string; label: string }[] =>\n    zone === \"measures\"\n      ? config.measures.map((measure, index) => ({\n          key: `${measure.key}-${String(index)}`,\n          label: measureLabel(measure, fields),\n        }))\n      : config[zone].map((key) => ({ key, label: nameOf(key) }));\n\n  return (\n    <Surface className={className} data-adapttable-part=\"pivot-panel\">\n      {([\"rows\", \"columns\", \"measures\"] as const).map((zone) => {\n        const entries = entriesFor(zone);\n        return (\n          <Zone\n            key={zone}\n            zone={zone}\n            label={zoneLabel(zone, labels)}\n            data-adapttable-part=\"pivot-zone\"\n          >\n            {entries.map((entry, index) => (\n              <Field\n                key={entry.key}\n                label={entry.label}\n                data-adapttable-part=\"pivot-field\"\n                moveUpLabel={labels.pivotMoveUp}\n                moveDownLabel={labels.pivotMoveDown}\n                removeLabel={labels.pivotRemove}\n                onMoveUp={\n                  index > 0\n                    ? () => {\n                        onChange(moveField(config, zone, index, -1));\n                      }\n                    : undefined\n                }\n                onMoveDown={\n                  index < entries.length - 1\n                    ? () => {\n                        onChange(moveField(config, zone, index, 1));\n                      }\n                    : undefined\n                }\n                onRemove={() => {\n                  onChange(removeField(config, zone, index));\n                }}\n                aggregation={\n                  zone === \"measures\" ? (\n                    <Agg\n                      label={labels.pivotAggregation}\n                      value={aggNameAt(config, index)}\n                      options={AGGREGATIONS}\n                      onChange={(next) => {\n                        onChange(setMeasureAgg(config, index, next));\n                      }}\n                    />\n                  ) : undefined\n                }\n              />\n            ))}\n            <Add\n              label={labels.pivotAdd}\n              // Measures may repeat a column; dimensions may not, so the\n              // list of what can still be added differs per zone.\n              options={zone === \"measures\" ? fields : unused}\n              onAdd={(key) => {\n                onChange(assignField(config, key, zone));\n              }}\n            />\n          </Zone>\n        );\n      })}\n    </Surface>\n  );\n}\n\n/** The aggregation shown for a measure, or `sum` for a custom one. */\nfunction aggNameAt(config: PivotConfig, index: number): AggregateName {\n  const agg = config.measures[index]?.agg;\n  return typeof agg === \"string\" ? agg : \"sum\";\n}\n","/**\n * Row-reorder layout. The live region stays here. Adapters pass the grip\n * and the mobile up/down buttons the end user clicks.\n */\nimport type { KeyboardEvent, ReactElement, ReactNode } from \"react\";\n\nimport { LiveRegion } from \"../a11y/LiveRegion\";\nimport type { RowReorderLabels, RowReorderState } from \"./rowReorder\";\n\n/** Props for an adapter {@link RowReorderHandle} — no slots on the public API. */\nexport interface RowReorderHandleProps<TRow> {\n  reorder: RowReorderState<TRow>;\n  labels: RowReorderLabels;\n  rowId: string;\n  localIndex: number;\n  row: TRow;\n  windowStart: number;\n  rowCount: number;\n  className?: string;\n}\n\n/** Kit grip the reorder chrome calls. */\nexport interface RowReorderHandleSlotProps {\n  readonly label: string;\n  readonly pressed: boolean;\n  readonly dragging: boolean;\n  readonly className?: string;\n  readonly dragProps: ReturnType<RowReorderState<unknown>[\"dragProps\"]>;\n  readonly onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n}\n\n/** Adapter-supplied controls for {@link RowReorderHandleChrome}. */\nexport interface RowReorderHandleSlots {\n  readonly Handle: (props: RowReorderHandleSlotProps) => ReactNode;\n}\n\n/** Props for {@link RowReorderHandleChrome}. */\nexport interface RowReorderHandleChromeProps<\n  TRow,\n> extends RowReorderHandleProps<TRow> {\n  readonly slots: RowReorderHandleSlots;\n}\n\n/**\n * Desktop grip: pointer drag plus Space-lift keyboard. Kits wrap this in\n * their own `<td>` / `<th>` so the cell looks like the rest of the row.\n */\nexport function RowReorderHandleChrome<TRow>({\n  reorder,\n  labels,\n  rowId,\n  localIndex,\n  row,\n  windowStart,\n  rowCount,\n  className,\n  slots,\n}: Readonly<RowReorderHandleChromeProps<TRow>>): ReactElement {\n  const lifted = reorder.isLifted(rowId);\n  const Handle = slots.Handle;\n  return (\n    <Handle\n      label={labels.reorderRow}\n      pressed={lifted}\n      dragging={lifted}\n      className={className}\n      dragProps={reorder.dragProps(rowId, localIndex)}\n      onKeyDown={(event) => {\n        reorder.handleKeyDown(\n          event,\n          rowId,\n          localIndex,\n          row,\n          windowStart,\n          rowCount\n        );\n      }}\n    />\n  );\n}\n\n/** Props for an adapter {@link RowReorderButtons} — no slots on the public API. */\nexport interface RowReorderButtonsProps<TRow> {\n  reorder: RowReorderState<TRow>;\n  labels: RowReorderLabels;\n  localIndex: number;\n  row: TRow;\n  windowStart: number;\n  rowCount: number;\n  className?: string;\n  upClassName?: string;\n  downClassName?: string;\n}\n\n/** Kit button the mobile reorder chrome calls. */\nexport interface RowReorderMoveButtonProps {\n  readonly label: string;\n  readonly part: string;\n  readonly disabled: boolean;\n  readonly className?: string;\n  readonly onClick: () => void;\n}\n\n/** Adapter-supplied controls for {@link RowReorderButtonsChrome}. */\nexport interface RowReorderButtonsSlots {\n  readonly Button: (props: RowReorderMoveButtonProps) => ReactNode;\n}\n\n/** Props for {@link RowReorderButtonsChrome}. */\nexport interface RowReorderButtonsChromeProps<\n  TRow,\n> extends RowReorderButtonsProps<TRow> {\n  readonly slots: RowReorderButtonsSlots;\n}\n\n/**\n * Mobile up/down — a drag handle on a card is unusable. Each press swaps\n * with the neighbour; the ends disable rather than wrapping.\n */\nexport function RowReorderButtonsChrome<TRow>({\n  reorder,\n  labels,\n  localIndex,\n  row,\n  windowStart,\n  rowCount,\n  className,\n  upClassName,\n  downClassName,\n  slots,\n}: Readonly<RowReorderButtonsChromeProps<TRow>>): ReactElement {\n  const Button = slots.Button;\n  return (\n    <span data-adapttable-part=\"row-reorder-buttons\" className={className}>\n      <Button\n        label={labels.moveRowUp}\n        part=\"row-reorder-up\"\n        disabled={localIndex <= 0}\n        className={upClassName}\n        onClick={() => {\n          reorder.moveBy(localIndex, -1, row, windowStart, rowCount);\n        }}\n      />\n      <Button\n        label={labels.moveRowDown}\n        part=\"row-reorder-down\"\n        disabled={localIndex >= rowCount - 1}\n        className={downClassName}\n        onClick={() => {\n          reorder.moveBy(localIndex, 1, row, windowStart, rowCount);\n        }}\n      />\n    </span>\n  );\n}\n\n/** The live region for row reorder. Kits mount this only when reorder is armed. */\nexport function RowReorderAnnouncer(\n  props: Readonly<{ announcement: string }>\n): ReactElement {\n  return (\n    <LiveRegion part=\"row-reorder-announcer\">{props.announcement}</LiveRegion>\n  );\n}\n","/**\n * Tree-toggle layout. The leaf spacer stays here (display only). Adapters\n * pass the chevron button the end user clicks.\n */\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport type { TreeEntry } from \"./treeRows\";\n\n/** Props for an adapter {@link TreeToggle} — no slots on the public API. */\nexport interface TreeToggleProps<TRow> {\n  /** The row's place in the tree. */\n  entry: TreeEntry<TRow>;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** Open or close this node. */\n  onToggle: (id: string) => void;\n  /** Class for the chevron — the unstyled kit's `treeToggle` hook. */\n  toggleClassName?: string;\n  /** Class for a leaf's placeholder — the unstyled kit's `treeSpacer` hook. */\n  spacerClassName?: string;\n}\n\n/** Kit chevron the tree layout calls. */\nexport interface TreeToggleButtonProps {\n  readonly label: string;\n  readonly expanded: boolean;\n  readonly loading: boolean;\n  readonly className?: string;\n  readonly onClick: () => void;\n}\n\n/** Adapter-supplied controls for {@link TreeToggleChrome}. */\nexport interface TreeToggleSlots {\n  readonly Button: (props: TreeToggleButtonProps) => ReactNode;\n}\n\n/** Props for {@link TreeToggleChrome}. */\nexport interface TreeToggleChromeProps<TRow> extends TreeToggleProps<TRow> {\n  readonly slots: TreeToggleSlots;\n}\n\n/**\n * Renders the chevron for a row with children, or an equal-width spacer for a\n * leaf so the column stays aligned.\n */\nexport function TreeToggleChrome<TRow>({\n  entry,\n  labels,\n  onToggle,\n  toggleClassName,\n  spacerClassName,\n  slots,\n}: Readonly<TreeToggleChromeProps<TRow>>): ReactElement {\n  if (!entry.hasChildren) {\n    return (\n      <span\n        aria-hidden=\"true\"\n        data-adapttable-part=\"tree-spacer\"\n        className={spacerClassName}\n        style={{ display: \"inline-block\", width: \"1.5em\", flexShrink: 0 }}\n      />\n    );\n  }\n  const Button = slots.Button;\n  return (\n    <Button\n      label={\n        entry.expanded\n          ? (labels?.collapseRow ?? \"Collapse row\")\n          : (labels?.expandRow ?? \"Expand row\")\n      }\n      expanded={entry.expanded}\n      loading={entry.loading === true}\n      className={toggleClassName}\n      onClick={() => {\n        onToggle(entry.key);\n      }}\n    />\n  );\n}\n","/**\n * The tree column's cell: the chevron, the indent, and the cell's own content\n * on one line.\n *\n * The indent belongs to the whole cell, not to the chevron. Indenting only the\n * disclosure control leaves every name at the same margin, so a hierarchy reads\n * as a flat list with chevrons scattered through it — this wraps the content so\n * the name moves with its depth.\n *\n * Any column that is not the tree column renders its children untouched, which\n * is what lets an adapter wrap its existing cell in one place rather than\n * duplicating it behind a condition.\n */\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport type { TableLabels } from \"../types\";\nimport type { TreeEntry } from \"./treeRows\";\nimport { treeIndentStyle } from \"./treeRows\";\nimport { TreeToggleChrome, type TreeToggleSlots } from \"./TreeToggle\";\n\n/** Props for an adapter {@link TreeCell} — no slots on the public API. */\nexport interface TreeCellProps<TRow> {\n  /** The row's place in the tree; absent on a flat table. */\n  entry: TreeEntry<TRow> | undefined;\n  /** This cell's column. */\n  columnKey: string;\n  /** The column that carries the chevron. */\n  treeColumnKey: string | undefined;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** Open or close this node. */\n  onToggle?: (id: string) => void;\n  /** Class for the wrapper — the unstyled kit's `treeCell` hook. */\n  className?: string;\n  /** Class for the chevron. */\n  toggleClassName?: string;\n  /** Class for a leaf's placeholder. */\n  spacerClassName?: string;\n  /** The cell's own content. */\n  children: ReactNode;\n}\n\n/** Props for {@link TreeCellChrome}. */\nexport interface TreeCellChromeProps<TRow> extends TreeCellProps<TRow> {\n  readonly slots: TreeToggleSlots;\n}\n\nconst WRAPPER = {\n  display: \"inline-flex\",\n  alignItems: \"center\",\n  gap: 4,\n} as const;\n\n/**\n * Wrap a cell in its tree chrome when it is the tree column, and pass it\n * through unchanged when it is not.\n */\nexport function TreeCellChrome<TRow>({\n  entry,\n  columnKey,\n  treeColumnKey,\n  labels,\n  onToggle,\n  className,\n  toggleClassName,\n  spacerClassName,\n  children,\n  slots,\n}: Readonly<TreeCellChromeProps<TRow>>): ReactElement {\n  if (!entry || columnKey !== treeColumnKey) return <>{children}</>;\n  return (\n    <span\n      data-adapttable-part=\"tree-cell\"\n      className={className}\n      style={{ ...WRAPPER, ...treeIndentStyle(entry.level) }}\n    >\n      <TreeToggleChrome\n        entry={entry}\n        labels={labels}\n        onToggle={onToggle ?? (() => undefined)}\n        toggleClassName={toggleClassName}\n        spacerClassName={spacerClassName}\n        slots={slots}\n      />\n      {children}\n    </span>\n  );\n}\n","/**\n * Managing saved views: the list, and what you can do to each one.\n *\n * The saved-views *menu* answers \"switch to a view\". This answers \"keep the\n * list in order\" — rename, reorder, delete, and choose the one the table\n * opens with. They are different jobs and putting both in a dropdown makes\n * the common one harder, so this is a panel rather than a deeper menu.\n *\n * The panel is a card with a title, and each view is one row inside it. The\n * row has a single primary action: **applying the view is clicking its name**,\n * which is the thing a reader wants nine times out of ten and the widest\n * target on the row. Everything else — rename, move, default, delete — is an\n * icon in a compact cluster at the end of the line, each with its own\n * localized accessible name.\n *\n * That shape is a decision the chrome owns rather than each kit. Six equally\n * weighted text buttons per row read as six equal choices, and a list of views\n * where \"Delete view\" is as loud as the view's own name is a list that is\n * harder to use the more it holds.\n *\n * Reordering is buttons, not drag, for the same reason the pivot panel's is:\n * a list you can only reorder by dragging is a list some people cannot\n * reorder. Renaming is an inline text input rather than a modal prompt — the\n * name is right there, and a dialog to change one word is a dialog too many.\n *\n * Structure, ordering, part names, labels, glyphs and the row's layout live\n * here. Every visible control is a required slot the adapter fills with its\n * own kit's component.\n */\nimport { type CSSProperties, type ReactNode, useState } from \"react\";\n\nimport { resolveLabels } from \"../labels\";\nimport type { TableLabels } from \"../types\";\nimport type { SavedView } from \"./useSavedViews\";\n\n/**\n * The row's own shape: the name, growing to fill the line, and the control\n * cluster hugging its end.\n *\n * A panel is mounted in a sidebar as often as in a page, and a row laid out by\n * each adapter drifted exactly as far as each kit's default: six controls in a\n * no-wrap flex row truncated their captions to \"Set a\", and six controls in\n * normal flow ran into the next view's name. Both are the same missing\n * decision, so the decision lives here and every kit spreads it.\n */\nconst ROW: CSSProperties = {\n  display: \"flex\",\n  flexWrap: \"wrap\",\n  alignItems: \"center\",\n  gap: 6,\n  minWidth: 0,\n};\n\n/**\n * The name and its badges, together and never touching.\n *\n * `nowrap` inside: a badge that drops to its own line reads as a second row,\n * and the name beside it stops looking like the control it is. The row around\n * this one wraps instead, so a panel too narrow for both moves the whole\n * control cluster down rather than breaking the caption in half.\n */\nconst CAPTION: CSSProperties = {\n  display: \"flex\",\n  flexWrap: \"nowrap\",\n  alignItems: \"center\",\n  gap: 6,\n  // Takes the line, and gives the cluster its own row rather than squeezing it\n  // once the panel is narrower than this.\n  flex: \"1 1 9rem\",\n  minWidth: 0,\n};\n\n/** The icon cluster, kept together at the end of the line. */\nconst CONTROLS: CSSProperties = {\n  display: \"flex\",\n  alignItems: \"center\",\n  gap: 2,\n  flex: \"0 0 auto\",\n  minWidth: 0,\n};\n\n/** One control — an icon square, never stretched. */\nconst CONTROL: CSSProperties = { flex: \"0 0 auto\" };\n\n/** Held once so a row's props keep their identity between renders. */\nconst ROW_LAYOUT = {\n  row: ROW,\n  caption: CAPTION,\n  controls: CONTROLS,\n  control: CONTROL,\n} as const;\n\n/**\n * The cluster's glyphs.\n *\n * Drawn here rather than per kit for the same reason the column menu's eye,\n * grip and pin are: five icons redrawn eight times is five icons that drift\n * eight ways, and none of them carries meaning a kit could express better. The\n * kit still owns the button around them — its size, its shape, its focus ring\n * and its danger colour.\n */\nconst glyph = (paths: readonly string[], filled = false): ReactNode => (\n  <svg\n    width={14}\n    height={14}\n    viewBox=\"0 0 24 24\"\n    fill={filled ? \"currentColor\" : \"none\"}\n    stroke=\"currentColor\"\n    strokeWidth={1.9}\n    strokeLinecap=\"round\"\n    strokeLinejoin=\"round\"\n    aria-hidden=\"true\"\n    focusable=\"false\"\n  >\n    {paths.map((d) => (\n      <path key={d} d={d} />\n    ))}\n  </svg>\n);\n\nconst PENCIL = [\"M4 20h4l10-10-4-4L4 16v4z\", \"M14 6l4 4\"];\nconst ARROW_UP = [\"M12 19V5\", \"M6 11l6-6 6 6\"];\nconst ARROW_DOWN = [\"M12 5v14\", \"M6 13l6 6 6-6\"];\nconst STAR = [\n  \"M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.8-5.2 2.8 1-5.8-4.3-4.1 5.9-.9L12 3.5z\",\n];\nconst TRASH = [\n  \"M4 7h16\",\n  \"M9 7V4h6v3\",\n  \"M6 7l1 13h10l1-13\",\n  \"M10 11v6\",\n  \"M14 11v6\",\n];\n\n/** Which control a cluster entry is. Stable across kits, and across renders. */\nexport type SavedViewControlKey =\n  | \"rename\"\n  | \"moveUp\"\n  | \"moveDown\"\n  | \"default\"\n  | \"remove\";\n\n/**\n * One control in a row's cluster.\n *\n * The adapter maps over these rather than hand-writing five buttons, so a kit\n * cannot render four of them, order them differently, or miss the disabled\n * state on the one control this reader may not use.\n */\nexport interface SavedViewRowControl {\n  /** Which control this is — the React key, and what a test asks for. */\n  readonly key: SavedViewControlKey;\n  /** The accessible name, already localized. These controls are icon-only. */\n  readonly label: string;\n  /** The glyph to draw inside the kit's own icon button. */\n  readonly icon: ReactNode;\n  /**\n   * Run it, or `undefined` when this reader may not — a view someone else\n   * owns, or a move off the end of the list. The adapter renders the control\n   * disabled rather than dropping it: a button that vanishes on the last row\n   * makes every row jump as the list is reordered.\n   */\n  readonly onPress?: () => void;\n  /** Whether the toggle is currently on. Only the default control sets it. */\n  readonly pressed?: boolean;\n  /** Destructive, so the kit can reach for its own danger colour. */\n  readonly danger?: boolean;\n}\n\n/** Props an adapter's panel surface receives. */\nexport interface SavedViewsPanelSurfaceProps {\n  /** The card's heading, already localized. */\n  readonly title: string;\n  readonly children: ReactNode;\n  /**\n   * Anything the host wants inside the card, under the list — a note about\n   * where the views came from, a link to the docs. Outside the card it reads\n   * as a caption belonging to whatever follows it.\n   */\n  readonly footer?: ReactNode;\n  readonly className?: string;\n  /** Spread onto the surface — the public part name. */\n  readonly \"data-adapttable-part\": \"saved-views-panel\";\n}\n\n/** Props an adapter's row receives — one saved view and its controls. */\nexport interface SavedViewsPanelRowProps {\n  /** The view's name, or the rename input while it is being edited. */\n  readonly name: ReactNode;\n  /** That name as plain text — the apply control's accessible name. */\n  readonly viewName: string;\n  /** Whether the name slot currently holds the rename input. */\n  readonly isEditing: boolean;\n  /** Whether this is the view the table opens with. */\n  readonly isDefault: boolean;\n  /**\n   * Whether this reader may change it. A team view someone else owns is\n   * read-only, and the row must SHOW that: every control arrives without a\n   * handler, so a kit that renders them disabled says \"not yours\" rather than\n   * leaving a button that silently does nothing.\n   */\n  readonly readOnly: boolean;\n  /** The badge caption for the default view. */\n  readonly defaultLabel: string;\n  /** The badge caption for a view this reader cannot change. */\n  readonly readOnlyLabel: string;\n  /** Apply it — what clicking the name does. */\n  readonly onApply: () => void;\n  /** What applying is called, for the name control's tooltip. */\n  readonly applyLabel: string;\n  /** The cluster, in order: rename, up, down, default, delete. */\n  readonly controls: readonly SavedViewRowControl[];\n  /**\n   * The row's layout, owned by the chrome so a panel reads the same in every\n   * kit: `row` on the row itself, `caption` on the group holding the name and\n   * its badges, `controls` on the cluster, and `control` on each button. The\n   * kit supplies the components; these supply the shape.\n   */\n  readonly layout: {\n    readonly row: CSSProperties;\n    readonly caption: CSSProperties;\n    readonly controls: CSSProperties;\n    readonly control: CSSProperties;\n  };\n  /** Spread onto the row — the public part name. */\n  readonly \"data-adapttable-part\": \"saved-view-row\";\n}\n\n/** Props an adapter's rename input receives. */\nexport interface SavedViewsPanelInputProps {\n  /** Accessible name. */\n  readonly label: string;\n  /**\n   * Attach to the underlying input element. The panel takes focus through\n   * this rather than through `autoFocus`: the browser attribute fires once at\n   * mount whether or not the element was the point of the interaction, which\n   * is why it reads as an accessibility problem. Here the focus follows a\n   * deliberate click on Rename.\n   *\n   * Kits whose input component hands back something other than the DOM node —\n   * antd's `InputRef`, for one — unwrap it before calling this.\n   */\n  readonly ref: (element: HTMLInputElement | null) => void;\n  readonly value: string;\n  readonly onChange: (next: string) => void;\n  /** Enter commits, Escape abandons — bind both. */\n  readonly onCommit: () => void;\n  readonly onCancel: () => void;\n}\n\n/** Props an adapter's empty state receives. */\nexport interface SavedViewsPanelEmptyProps {\n  readonly message: string;\n}\n\n/** The kit-native pieces the panel is built from. */\nexport interface SavedViewsPanelSlots {\n  /** The titled card. */\n  readonly Surface: (props: SavedViewsPanelSurfaceProps) => ReactNode;\n  /** One view. */\n  readonly Row: (props: SavedViewsPanelRowProps) => ReactNode;\n  /** The inline rename box. */\n  readonly Input: (props: SavedViewsPanelInputProps) => ReactNode;\n  /** Shown when nothing has been saved yet. */\n  readonly Empty: (props: SavedViewsPanelEmptyProps) => ReactNode;\n}\n\n/** What the panel needs to render. */\nexport interface SavedViewsPanelChromeProps {\n  /** The saved views, in list order. */\n  views: readonly SavedView[];\n  /** Apply one. */\n  onApply: (name: string) => void;\n  /** Rename one. */\n  onRename: (from: string, to: string) => void;\n  /** Move one a step. */\n  onMove: (name: string, delta: -1 | 1) => void;\n  /** Make one the default, or clear it. */\n  onSetDefault: (name: string) => void;\n  /** Delete one. */\n  onRemove: (name: string) => void;\n  /** Labels; falls back to the built-in English. */\n  labels?: TableLabels;\n  /** Anything of yours that belongs inside the card, under the list. */\n  footer?: ReactNode;\n  /** The kit's controls. */\n  slots: SavedViewsPanelSlots;\n  className?: string;\n}\n\n/**\n * The saved-views management panel.\n *\n * @param props - The views, the operations, and the adapter's slots.\n * @returns The panel, built from the adapter's own controls.\n */\nexport function SavedViewsPanelChrome({\n  views,\n  onApply,\n  onRename,\n  onMove,\n  onSetDefault,\n  onRemove,\n  labels: labelsProp,\n  footer,\n  slots,\n  className,\n}: Readonly<SavedViewsPanelChromeProps>) {\n  const labels = resolveLabels(labelsProp);\n  const { Surface, Row, Input, Empty } = slots;\n  // Which view is being renamed, and the draft. Held here rather than by the\n  // host: a half-typed name is the panel's business, not the table's.\n  const [editing, setEditing] = useState<string | null>(null);\n  const [draft, setDraft] = useState(\"\");\n\n  // Focus when the element arrives rather than in an effect: kits portal or\n  // mount their inputs a tick later, and an effect would run too early.\n  const focusOnArrival = (element: HTMLInputElement | null) => {\n    element?.focus();\n  };\n\n  /** A handler, or `undefined` when this reader may not make that change. */\n  const allowed = (view: SavedView, run: () => void) =>\n    view.readOnly === true ? undefined : run;\n\n  const commit = () => {\n    if (editing !== null) onRename(editing, draft);\n    setEditing(null);\n  };\n\n  /** The cluster for one view, in the order every kit renders it. */\n  const controlsFor = (\n    view: SavedView,\n    index: number\n  ): readonly SavedViewRowControl[] => [\n    {\n      key: \"rename\",\n      label: labels.renameView,\n      icon: glyph(PENCIL),\n      onPress:\n        editing === view.name\n          ? undefined\n          : allowed(view, () => {\n              setEditing(view.name);\n              setDraft(view.name);\n            }),\n    },\n    {\n      key: \"moveUp\",\n      label: labels.moveViewUp,\n      icon: glyph(ARROW_UP),\n      onPress:\n        index > 0\n          ? allowed(view, () => {\n              onMove(view.name, -1);\n            })\n          : undefined,\n    },\n    {\n      key: \"moveDown\",\n      label: labels.moveViewDown,\n      icon: glyph(ARROW_DOWN),\n      onPress:\n        index < views.length - 1\n          ? allowed(view, () => {\n              onMove(view.name, 1);\n            })\n          : undefined,\n    },\n    {\n      key: \"default\",\n      label: labels.setDefaultView,\n      icon: glyph(STAR, view.isDefault === true),\n      pressed: view.isDefault === true,\n      onPress: allowed(view, () => {\n        onSetDefault(view.name);\n      }),\n    },\n    {\n      key: \"remove\",\n      label: labels.deleteView,\n      icon: glyph(TRASH),\n      danger: true,\n      onPress: allowed(view, () => {\n        onRemove(view.name);\n      }),\n    },\n  ];\n\n  return (\n    <Surface\n      className={className}\n      title={labels.savedViews}\n      footer={footer}\n      data-adapttable-part=\"saved-views-panel\"\n    >\n      {views.length === 0 && <Empty message={labels.savedViews} />}\n      {views.map((view, index) => (\n        <Row\n          key={view.name}\n          data-adapttable-part=\"saved-view-row\"\n          layout={ROW_LAYOUT}\n          viewName={view.name}\n          isEditing={editing === view.name}\n          isDefault={view.isDefault === true}\n          readOnly={view.readOnly === true}\n          defaultLabel={labels.defaultViewBadge}\n          readOnlyLabel={labels.readOnlyViewBadge}\n          name={\n            editing === view.name ? (\n              <Input\n                label={labels.viewName}\n                ref={focusOnArrival}\n                value={draft}\n                onChange={setDraft}\n                onCommit={commit}\n                onCancel={() => {\n                  setEditing(null);\n                }}\n              />\n            ) : (\n              view.name\n            )\n          }\n          onApply={() => {\n            onApply(view.name);\n          }}\n          applyLabel={labels.applyView}\n          controls={controlsFor(view, index)}\n        />\n      ))}\n    </Surface>\n  );\n}\n","/**\n * Windowed columns, for tables that are wide rather than long.\n *\n * Row windowing solves the common case; a table with five hundred columns has\n * the same problem sideways, and no amount of row windowing helps it — 23 rows\n * of 478 columns is still eleven thousand cells. This windows the horizontal\n * axis on the same principle: render what a reader can see, plus a margin, and\n * hold the rest open with two spacer cells.\n *\n * Two rules make it safe to compose with everything else:\n *\n * **Pinned columns are always rendered.** A pinned column is on screen by\n * definition, whatever the scroll position, so it can never be windowed out —\n * the window is computed over the scrollable columns only.\n *\n * **The spacers are logical.** A cell whose width holds open the columns to\n * the reader's LEFT is the one before the window in reading order, which in\n * Arabic is the one on the right. Sizing them as leading/trailing rather than\n * left/right is what makes a wide RTL table scroll correctly.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport type { ColumnDef } from \"../types\";\n\n/** How wide a column is assumed to be when nothing has measured it. */\nconst DEFAULT_COLUMN_WIDTH = 160;\n\n/** What {@link useColumnWindow} needs. */\nexport interface UseColumnWindowOptions<TRow> {\n  /** The columns as rendered, in order. */\n  columns: readonly ColumnDef<TRow>[];\n  /** Off unless the host asked for it and the table is wide enough to need it. */\n  enabled: boolean;\n  /** Measured or declared widths, by column key. */\n  widths?: Readonly<Record<string, number>>;\n  /** Keys that are pinned, and so always rendered. */\n  pinnedKeys?: ReadonlySet<string>;\n  /** The horizontal scroll container. */\n  getScrollElement?: () => HTMLElement | null;\n  /** Columns to render either side of the visible span. Defaults to 3. */\n  overscan?: number;\n}\n\n/** The windowed columns and the space the rest occupies. */\nexport interface ColumnWindow<TRow> {\n  /** Whether the returned columns are a window rather than everything. */\n  enabled: boolean;\n  /** The columns to render, pinned ones included. */\n  columns: readonly ColumnDef<TRow>[];\n  /** Width of the spacer before the window, in pixels. */\n  paddingStart: number;\n  /** Width of the spacer after it. */\n  paddingEnd: number;\n}\n\n/**\n * Window a table's columns to what is scrolled into view.\n *\n * @typeParam TRow - The row type.\n * @param options - See {@link UseColumnWindowOptions}.\n * @returns The window; every column and no spacers when disabled.\n */\nexport function useColumnWindow<TRow>(\n  options: UseColumnWindowOptions<TRow>\n): ColumnWindow<TRow> {\n  const {\n    columns,\n    enabled,\n    widths,\n    pinnedKeys,\n    getScrollElement,\n    overscan = 3,\n  } = options;\n  const [viewport, setViewport] = useState({ start: 0, width: 0 });\n  // The accessor arrives fresh from the caller every render; reading it\n  // through a ref keeps the scroll listener from being torn down and\n  // reattached on every keystroke elsewhere in the table.\n  const scrollElement = useRef(getScrollElement);\n  scrollElement.current = getScrollElement;\n\n  const read = useCallback(() => {\n    const element = scrollElement.current?.();\n    if (!element) return;\n    // `scrollLeft` is negative in RTL in every engine that follows the spec,\n    // so its magnitude is the distance scrolled either way.\n    const next = {\n      start: Math.abs(element.scrollLeft),\n      width: element.clientWidth,\n    };\n    // Same numbers, same object: a fresh one every scroll event would\n    // re-render the whole table at 60fps for nothing.\n    setViewport((current) =>\n      current.start === next.start && current.width === next.width\n        ? current\n        : next\n    );\n  }, []);\n\n  useEffect(() => {\n    if (!enabled) return undefined;\n    const element = scrollElement.current?.();\n    if (!element) return undefined;\n    read();\n    element.addEventListener(\"scroll\", read, { passive: true });\n    const observer =\n      typeof ResizeObserver === \"undefined\"\n        ? null\n        : new ResizeObserver(() => {\n            read();\n          });\n    observer?.observe(element);\n    return () => {\n      element.removeEventListener(\"scroll\", read);\n      observer?.disconnect();\n    };\n  }, [enabled, read]);\n\n  return useMemo(() => {\n    if (!enabled || viewport.width === 0) {\n      return {\n        enabled: false,\n        columns,\n        paddingStart: 0,\n        paddingEnd: 0,\n      };\n    }\n    const widthOf = (column: ColumnDef<TRow>) =>\n      widths?.[column.key] ?? DEFAULT_COLUMN_WIDTH;\n    const pinned = columns.filter((column) => pinnedKeys?.has(column.key));\n    const scrollable = columns.filter((column) => !pinnedKeys?.has(column.key));\n\n    // Walk the scrollable columns, accumulating offsets, and keep the span the\n    // viewport crosses plus the overscan either side.\n    let offset = 0;\n    let first = scrollable.length;\n    let last = -1;\n    const offsets: number[] = [];\n    for (const [index, column] of scrollable.entries()) {\n      const width = widthOf(column);\n      offsets.push(offset);\n      const end = offset + width;\n      if (end > viewport.start && offset < viewport.start + viewport.width) {\n        first = Math.min(first, index);\n        last = Math.max(last, index);\n      }\n      offset = end;\n    }\n    if (last === -1) {\n      // Scrolled past everything (or nothing measurable yet): show the head of\n      // the table rather than an empty row.\n      first = 0;\n      last = Math.min(scrollable.length - 1, overscan * 2);\n    }\n    const from = Math.max(0, first - overscan);\n    const to = Math.min(scrollable.length - 1, last + overscan);\n    const windowed = scrollable.slice(from, to + 1);\n    const paddingStart = offsets[from] ?? 0;\n    const paddingEnd = Math.max(\n      0,\n      offset - ((offsets[to] ?? 0) + widthOf(scrollable[to] ?? columns[0]!))\n    );\n\n    return {\n      enabled: true,\n      // Pinned columns keep their declared order relative to the window: they\n      // are rendered first, which is where their sticky offsets put them.\n      columns: [...pinned, ...windowed],\n      paddingStart,\n      paddingEnd,\n    };\n  }, [enabled, columns, widths, pinnedKeys, viewport, overscan]);\n}\n","import type { ReactNode } from \"react\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { autoSizeColumns as autoSizeAllColumns } from \"./columns/autoSizeColumns\";\nimport {\n  ACTIONS_COLUMN_KEY,\n  REORDER_COLUMN_KEY,\n} from \"./columns/columnMenuModel\";\nimport { flattenColumnTree } from \"./columns/columnTree\";\nimport { asGesture, useTableEditHistory } from \"./editing/editHistory\";\nimport { makeExportCsvHandler, resolveExportCsv } from \"./export/tableCsv\";\nimport { useExportHandler } from \"./export/useExportHandler\";\nimport type { FacetMap } from \"./filters/facets\";\nimport { resolveFilterMode, toolbarShowsFilters } from \"./filters/filterChrome\";\nimport type { FilterDef } from \"./filters/filterDefs\";\nimport type { FilterTypeRegistry } from \"./filters/filterRegistry\";\nimport { useFindFocus, useFindInTable } from \"./find/useFindInTable\";\nimport { cellFillHandler, cellPasteHandler } from \"./focus/pasteRange\";\nimport { selectionStats } from \"./focus/selectionStats\";\nimport { useGridFocus } from \"./focus/useGridFocus\";\nimport { useFullscreen } from \"./layout/useFullscreen\";\nimport type { BaseDataTableProps } from \"./props\";\nimport { coveredAddressSet } from \"./rows/cellSpan\";\nimport type { RowPinState } from \"./rows/rowPinning\";\nimport type { QuerySupport } from \"./source/queryContract\";\nimport type { TableSource } from \"./source/TableSource\";\nimport {\n  type DataModeProps,\n  isDeclarativeFilters,\n  useTableData,\n} from \"./source/useTableData\";\nimport { type UrlStateAdapter, useResolvedAdapter } from \"./url/adapter\";\nimport { useRowPinningUrlState } from \"./url/useRowPinningUrlState\";\nimport {\n  printToolbar,\n  undoRedoToolbar,\n  useChromeBodyData,\n  useChromeScrollReset,\n  useFilterTriggerToggle,\n  useTableChrome,\n  viewControlsToolbar,\n} from \"./useTableChrome\";\nimport { useColumnWindow } from \"./virtual/useColumnWindow\";\n\n/**\n * The kit-agnostic prop surface every batteries-included `<DataTable>` shares:\n * the base display props plus the three data tiers (`source` / `data` +\n * `onQueryChange`) and the URL-sync controls. Adapters extend this with\n * kit-specific extras (slots, classNames, colour, table size) and pass the\n * whole thing straight through to {@link useDataTableShell}.\n *\n * @typeParam TRow - The row type.\n */\nexport type DataTableShellProps<TRow> = Omit<\n  BaseDataTableProps<TRow>,\n  \"source\"\n> & {\n  /** Full-control tier: a prebuilt source. */\n  source?: TableSource<TRow>;\n  /** Frontend tier: the raw rows. */\n  data?: readonly TRow[];\n  /** Server tier: total row count across all pages. */\n  total?: number;\n  /** Server tier: a request is in flight. */\n  loading?: boolean;\n  /** Forwarded error to display in the table's error state. */\n  error?: Error | null;\n  /** URL-state backend (defaults to the History API). */\n  urlAdapter?: UrlStateAdapter;\n  /** Sync table state to the URL (default `true`). */\n  urlSync?: boolean;\n  /** Namespace for this table's URL params. */\n  urlKey?: string;\n  /**\n   * Server tier: what this endpoint can answer. `supports.facets`\n   * unlocks `query.facets` for checklist counts.\n   */\n  supports?: QuerySupport;\n  /**\n   * Server tier: keys to send as `query.facets`. Defaults to every\n   * `checklist` definition.\n   */\n  facetKeys?: readonly string[];\n  /** Server tier: distinct-value counts from the last fetch. */\n  facets?: FacetMap;\n} & DataModeProps<TRow>;\n\n/**\n * The whole shared orchestration behind a batteries-included `<DataTable>`:\n * resolve the data tier, build the declarative-filter runtime, wire the table\n * chrome (selection, columns, pagination, scroll reset, body virtualization),\n * and assemble the kit-agnostic prop bundles a table renderer and a toolbar\n * need. The Chakra and Radix adapters are byte-identical here, so this lives\n * once in core; each adapter supplies only its kit's filter form (via\n * `renderAutoForm`) and renders its own controls over the returned state.\n *\n * @typeParam TRow - The row type.\n * @param props - The adapter's data-table props.\n * @param renderAutoForm - Builds the kit's auto-filter form for declarative\n *   filters (called only when there are declarative defs).\n * @returns The resolved source, chrome, filter node, refs, and the\n *   `tableProps` / `toolbarProps` bundles (sans kit-specific extras).\n */\n\nexport function useDataTableShell<TRow>(\n  props: DataTableShellProps<TRow>,\n  renderAutoForm: (\n    defs: readonly FilterDef<TRow>[],\n    source: TableSource<TRow>,\n    registry: FilterTypeRegistry\n  ) => ReactNode\n) {\n  // ONE resolved URL backend for everything in this table: the tier hooks\n  // AND chrome that reads URL state (saved views) share this instance, so\n  // with `urlSync={false}` they share the same in-memory backend instead of\n  // the views hook silently falling back to the real address bar.\n  const urlAdapter = useResolvedAdapter(\n    props.urlSync === false ? undefined : props.urlAdapter,\n    props.urlSync !== false\n  );\n  const dataColumns = useMemo(\n    () => flattenColumnTree(props.columns).leaves,\n    [props.columns]\n  );\n  // Resolve the data tier (source > onQueryChange server > frontend) and the\n  // declarative-filter runtime (defs, chip labels, URL keys, predicate).\n  const { source, runtime } = useTableData<TRow>({\n    locale: props.locale,\n    source: props.source,\n    data: props.data,\n    total: props.total,\n    loading: props.loading,\n    error: props.error,\n    mode: props.mode,\n    onQueryChange: props.onQueryChange,\n    urlAdapter,\n    // No `urlSync` here on purpose: the decision is already baked into WHICH\n    // adapter was resolved above (memory when off, the real one when on), and\n    // the tier hooks would otherwise apply it a second time — routing the\n    // active tier to a private store that saved views cannot see.\n    urlKey: props.urlKey,\n    columns: dataColumns,\n    filters: props.filters,\n    filterTypes: props.filterTypes,\n    defaults: props.defaults,\n    paginationMode: props.paginationMode,\n    supports: props.supports,\n    facetKeys: props.facetKeys,\n    facets: props.facets,\n  });\n  const { history, onCellEdit: recordingCellEdit } = useTableEditHistory<TRow>({\n    ...props,\n    columns: dataColumns,\n  });\n\n  // Declarative `filters` array → the auto-built form; JSX passes through.\n  const autoForm =\n    runtime.defs.length > 0\n      ? renderAutoForm(runtime.defs, source, runtime.registry)\n      : undefined;\n  const filtersNode =\n    isDeclarativeFilters(props.filters) || props.filters === undefined\n      ? autoForm\n      : props.filters;\n  const pinProps = useShellRowPins(props, urlAdapter);\n  const chromeProps = {\n    ...props,\n    onCellEdit: recordingCellEdit,\n    source,\n    filters: filtersNode,\n    filterDefs: runtime.defs,\n    filterLabels: { ...runtime.filterLabels, ...props.filterLabels },\n    ...pinProps,\n  };\n  const chrome = useTableChrome<TRow>(chromeProps);\n  const { table, confirm, getRowId } = chrome;\n  const { labels } = table;\n  const [filtersOpen, setFiltersOpen] = useState(false);\n  // Cell navigation is wired HERE rather than in `useDataTable`, so a headless\n  // consumer of the main entry never pays for a grid it did not ask for — the\n  // bundle budget catches that regression, which is how this landed here.\n  //\n  // The row count is the DATASET total and `windowStart` is where the rendered\n  // slice begins, so Ctrl+End reaches the real last row and the ARIA counts stay\n  // truthful under virtualization. Derived here so no adapter has to know: an\n  // off-by-a-page error is invisible on screen and only wrong to a screen reader.\n  const windowStart =\n    chrome.source.paginationMode === \"paged\"\n      ? Math.max(0, (chrome.source.page - 1) * chrome.source.limit)\n      : 0;\n  // Find state first: the grid marks the cells it matched, and the effect\n  // below walks focus to whichever match the user is on.\n  const find = useFindInTable<TRow>({\n    enabled: props.findInTable === true,\n    rows: chrome.source.rows,\n    columns: chrome.columnLayout.visibleColumns,\n    firstRowIndex: windowStart,\n  });\n  const coveredCells = useMemo(\n    () =>\n      coveredAddressSet({\n        rows: chrome.source.rows,\n        columns: chrome.columnLayout.visibleColumns,\n        getCellSpan: props.getCellSpan,\n        firstRowIndex: windowStart,\n        pinOffset: chrome.columnLayout.pinOffset,\n      }),\n    [\n      chrome.source.rows,\n      chrome.columnLayout.visibleColumns,\n      chrome.columnLayout.pinOffset,\n      props.getCellSpan,\n      windowStart,\n    ]\n  );\n  const isCoveredCell = useCallback(\n    (cell: { row: number; col: number }) =>\n      coveredCells.has(`${cell.row}:${cell.col}`),\n    [coveredCells]\n  );\n  const gridFocus = useGridFocus<TRow>({\n    enabled: props.cellNavigation === true,\n    headerCheckbox: props.columnSelectionCheckbox === true,\n    rowCount: Math.max(\n      chrome.source.total,\n      windowStart + chrome.source.rows.length\n    ),\n    columns: chrome.columnLayout.visibleColumns,\n    rows: chrome.source.rows,\n    firstRowIndex: windowStart,\n    dir: props.dir,\n    labels,\n    onCut: props.onCellCut,\n    // With no `onCellPaste`, the ordinary edit channel takes each cell: a table\n    // that can be edited can be pasted into with nothing extra wired. A batch\n    // is ONE undo entry, so it records itself rather than per cell.\n    onPaste: asGesture(cellPasteHandler(props), history.record),\n    onFill: asGesture(cellFillHandler(props), history.record),\n    onUndo: history.undo,\n    onRedo: history.redo,\n    onFind: find.openBar,\n    matchKeys: find.matchKeys,\n    currentMatch: find.current,\n    isCoveredCell,\n  });\n  useFindFocus(find.current, gridFocus.focusCell, gridFocus.selectRange);\n  // Computed here rather than in eight adapters: the rectangle, the rows and\n  // the window offset all live on this side, and an adapter that derived any\n  // of them itself would be the one place the figures could go wrong.\n  const stats = selectionStats({\n    enabled: props.selectionStats === true,\n    range: gridFocus.range,\n    rows: chrome.source.rows,\n    columns: chrome.columnLayout.visibleColumns,\n    firstRowIndex: windowStart,\n  });\n  const filtersTrigger = useFilterTriggerToggle(filtersOpen, setFiltersOpen);\n  // Layout-visible columns WITHOUT device filtering: the same button must\n  // produce the same file on phone and desktop. The selection, the full column\n  // set and the highlighted range come along so `scope: \"selected\"`,\n  // `columns: \"all\"` and `scope: \"range\"` work without the host wiring anything\n  // up — the columns here are the same list cell navigation addresses, which is\n  // what makes a range's column indices mean the same thing on both sides.\n  const exportHandler = useExportHandler(\n    makeExportCsvHandler(\n      props.exportCsv,\n      chrome.source,\n      chrome.columnLayout.visibleColumns,\n      {\n        selectedIds: table.selection?.selectedIds,\n        getRowId,\n        allColumns: chrome.allColumns,\n        range: gridFocus.range,\n        firstRowIndex: windowStart,\n        getCellSpan: props.getCellSpan,\n        grouping: chrome.grouping,\n        tree: chrome.tree,\n        groupTotal: labels.groupTotal,\n        summaryRow: props.summaryRow,\n      }\n    ),\n    labels,\n    // The button names the format it produces, so a spreadsheet writer relabels\n    // it without the host retyping a translated string.\n    resolveExportCsv(props.exportCsv)?.writer?.extension,\n    chrome.featureNotices.some((notice) => notice.kind === \"export-all-page\")\n  );\n  // The chrome owns it: progressive column hiding measures this element.\n  const rootRef = chrome.rootRef;\n  // Fullscreen also decides where every overlay portals: promoted, the rest\n  // of the document is hidden, so a menu on `document.body` is invisible.\n  const fullscreen = useFullscreen(rootRef.current);\n  useChromeScrollReset(rootRef, chrome, chromeProps);\n  // Name the root the way the scroll box is named: the column menu sizes\n  // columns by measuring cells, and it has to know which table is its own.\n  useEffect(() => {\n    rootRef.current?.setAttribute(\"data-adapttable-part\", \"root\");\n  });\n\n  /**\n   * Size every rendered column to its content — the column menu's action.\n   * Measures the DOM, because a cell's width is what the browser laid out\n   * rather than anything the data knows.\n   */\n  const autoSizeColumns = useCallback(\n    () =>\n      autoSizeAllColumns(\n        rootRef.current,\n        chrome.columnLayout.visibleColumns.map((column) => column.key),\n        chrome.columnLayout.setWidth\n      ),\n    [chrome.columnLayout, rootRef]\n  );\n  const autoSizeColumn = useCallback(\n    (key: string) =>\n      autoSizeAllColumns(rootRef.current, [key], chrome.columnLayout.setWidth),\n    [chrome.columnLayout, rootRef]\n  );\n  const {\n    virtualization,\n    groupingEntries,\n    treeEntries,\n    loadMoreRef,\n    canLoadMore,\n    virtualScrollRef: bodyScrollRef,\n    pinnedTopRows,\n    pinnedBottomRows,\n  } = useChromeBodyData(chrome, chromeProps);\n  // One scroll box, two windows: the rows track its vertical scrolling and the\n  // columns its horizontal, so the adapters attach a single ref.\n  const scrollBoxElement = useRef<HTMLElement | null>(null);\n  const virtualScrollRef = useCallback(\n    (node: HTMLElement | null) => {\n      scrollBoxElement.current = node;\n      // Name the element every kit scrolls, whatever it called it: both\n      // windows read it, and CSS and tests need to be able to find it.\n      node?.setAttribute(\"data-adapttable-part\", \"scroll-box\");\n      bodyScrollRef(node);\n    },\n    [bodyScrollRef]\n  );\n\n  // The injected actions column is first-class in column management: the layout\n  // state treats its reserved key like any column key, so the Columns menu can\n  // hide it (strip rowActions before the renderers) or end-pin it (the\n  // renderers stick the actions cells, with zero data columns pinned).\n  const { hasRowActions, rowActions, hasRowReorder, rowReorder } = chrome;\n  const actionsPinned =\n    chrome.columnLayout.state.pinned[ACTIONS_COLUMN_KEY] === \"end\";\n  const reorderPinned =\n    chrome.columnLayout.state.pinned[REORDER_COLUMN_KEY] === \"start\";\n\n  // The horizontal window reads the same scroll box the vertical one does.\n  const columnWindow = useColumnWindow<TRow>({\n    columns: chrome.columnLayout.visibleColumns,\n    enabled: props.virtualizeColumns === true,\n    widths: chrome.columnLayout.state.widths,\n    pinnedKeys: new Set(\n      Object.keys(chrome.columnLayout.state.pinned).filter(\n        (key) => chrome.columnLayout.state.pinned[key] !== undefined\n      )\n    ),\n    getScrollElement: () => scrollBoxElement.current,\n  });\n\n  const grouping =\n    chrome.grouping && groupingEntries\n      ? { ...chrome.grouping, entries: groupingEntries }\n      : chrome.grouping;\n  // Same shape for the hierarchy: what the body renders is the window, not the\n  // whole walked tree.\n  const tree =\n    chrome.tree && treeEntries\n      ? { ...chrome.tree, entries: treeEntries }\n      : chrome.tree;\n\n  // The kit-agnostic slice of a table renderer's props — the adapter spreads\n  // this and adds its kit's row `size` and accent colour.\n  const tableProps = {\n    table,\n    gridFocus,\n    rows: chrome.editingRows,\n    rowActions,\n    rowActionsLayout: props.rowActionsLayout,\n    renderRowActions: props.renderRowActions,\n    actionsPinned,\n    rowReorder,\n    reorderPinned,\n    pinnedTopRows,\n    pinnedBottomRows,\n    rowPinning: chrome.rowPinning,\n    getCellSpan: props.getCellSpan,\n    cellSpanAppearance: props.cellSpanAppearance,\n    extraRows: props.extraRows,\n    windowStart,\n    confirm,\n    getRowId,\n    rowEntries: virtualization.enabled ? virtualization.rows : undefined,\n    paddingTop: virtualization.paddingTop,\n    paddingBottom: virtualization.paddingBottom,\n    measureElement: virtualization.measureElement,\n    measureRowPair: virtualization.measureRowPair,\n    columnWindow,\n    fitColumns: props.fitColumns,\n    tree,\n    stickyHeader: props.stickyHeader,\n    stickyTop: props.stickyTop,\n    headerFilters:\n      resolveFilterMode(props.filtersMode, props.headerFilters) === \"header\",\n    closeHeaderFilterOnSelect: props.closeHeaderFilterOnSelect === true,\n    filterDefs: runtime.defs,\n    filterRegistry: runtime.registry,\n    pinOffset: chrome.columnLayout.pinOffset,\n    maxHeight: props.maxHeight,\n    virtualScrollRef,\n    setWidth: props.resizableColumns ? chrome.columnLayout.setWidth : undefined,\n    columnWidths: chrome.columnLayout.state.widths,\n    resizeLabel: table.labels.resizeColumn,\n    onRowClick: props.onRowClick,\n    prefetch: props.prefetch,\n    rowClassName: props.rowClassName,\n    collapsibleColumnGroups: props.collapsibleColumnGroups === true,\n    collapsedColumnGroups: chrome.columnLayout.state.collapsedGroups,\n    columnGroups: chrome.columnGroups,\n    onToggleColumnGroup: chrome.columnLayout.toggleColumnGroup,\n    rowStyle: props.rowStyle,\n    rowHeight: props.rowHeight,\n    renderRowDetail: chrome.detail?.render,\n    renderCard: props.renderCard,\n    summaryRow: props.summaryRow,\n    expansion: chrome.detail?.expansion,\n    editing: chrome.editing,\n    grouping,\n    dir: props.dir,\n  };\n\n  // The kit-agnostic slice of the toolbar's props — the adapter spreads this\n  // and adds its filters-mode wiring, saved-views / column menus, and colour.\n  const toolbarProps = {\n    table,\n    searchable: props.searchable !== false,\n    searchPlaceholder: props.searchPlaceholder,\n    sortByOptions: props.sortByOptions,\n    toolbar: props.toolbar,\n    toolbarSlots: props.toolbarSlots,\n    ...undoRedoToolbar(props.undoRedoButtons, history, labels),\n    ...printToolbar(props.printButton, props.onPrint, labels),\n    ...viewControlsToolbar(props, fullscreen),\n    hasFilters: toolbarShowsFilters(\n      resolveFilterMode(props.filtersMode, props.headerFilters),\n      Boolean(filtersNode),\n      Boolean(table.source.setFilterTree)\n    ),\n    activeFilterCount: chrome.activeFilterCount,\n    filters: filtersNode,\n    onClearFilters: chrome.clearFilters,\n    // Hidden in the grouped full-set view, where page size has no effect.\n    showRowsPerPage: canLoadMore && !chrome.grouping,\n    onAddRow: chrome.rowMutations.canAdd\n      ? chrome.rowMutations.addRow\n      : undefined,\n    addRowLabel: labels.addRow,\n    ...exportHandler,\n    dir: props.dir,\n  };\n\n  return {\n    /** Cell-navigation state; inert unless `cellNavigation` is set. */\n    gridFocus,\n    /** What the selection adds up to; `null` unless `selectionStats` is set. */\n    selectionStats: stats,\n    /** Undo/redo controls; inert unless `editHistory` is set. */\n    editHistory: history,\n    /** Find-bar state; inert unless `findInTable` is set. */\n    find,\n    // The chrome's VIEW facade — with grouping armed it presents the full\n    // rendered set, so adapter footers and export buttons stay truthful.\n    source: chrome.source,\n    runtime,\n    /** The table's resolved URL backend — pass to saved-views UIs. */\n    urlAdapter,\n    chrome,\n    table,\n    labels,\n    filtersNode,\n    filtersOpen,\n    setFiltersOpen,\n    filtersTrigger,\n    rootRef,\n    /** Fullscreen state, and the portal container overlays need with it. */\n    fullscreen,\n    /** Size every rendered column to its content. */\n    autoSizeColumns,\n    autoSizeColumn,\n    loadMoreRef,\n    canLoadMore,\n    hasRowActions,\n    hasRowReorder,\n    tableProps,\n    toolbarProps,\n  };\n}\n\n/**\n * Uncontrolled pins write the URL; a host that passes `pinnedRowIds` owns\n * the lists and the URL hook stays a no-op.\n */\nfunction useShellRowPins<TRow>(\n  props: Pick<\n    DataTableShellProps<TRow>,\n    \"pinnedRowIds\" | \"onPinnedRowIdsChange\" | \"urlSync\" | \"urlKey\"\n  >,\n  urlAdapter: UrlStateAdapter\n): {\n  pinnedRowIds: RowPinState | undefined;\n  onPinnedRowIdsChange: ((next: RowPinState) => void) | undefined;\n} {\n  const requested =\n    props.pinnedRowIds !== undefined ||\n    props.onPinnedRowIdsChange !== undefined;\n  const pinUrl = useRowPinningUrlState({\n    urlAdapter,\n    urlSync:\n      props.urlSync !== false && requested && props.pinnedRowIds === undefined,\n    urlKey: props.urlKey,\n  });\n  if (!requested) {\n    return { pinnedRowIds: undefined, onPinnedRowIdsChange: undefined };\n  }\n  return {\n    pinnedRowIds: props.pinnedRowIds ?? pinUrl.pinnedRowIds,\n    onPinnedRowIdsChange: (next: RowPinState) => {\n      if (props.pinnedRowIds === undefined) {\n        pinUrl.onPinnedRowIdsChange(next);\n      }\n      props.onPinnedRowIdsChange?.(next);\n    },\n  };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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