impact-nova 2.5.12 → 2.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +116 -0
  5. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
  6. package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
  8. package/dist/components/data/data-table/data-table-column-apply.js +84 -73
  9. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
  10. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
  11. package/dist/components/data/data-table/data-table-column-list.js +94 -64
  12. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
  13. package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
  14. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
  15. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
  16. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
  17. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
  18. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
  19. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
  20. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
  21. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
  22. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
  23. package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
  24. package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
  25. package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
  26. package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
  27. package/dist/components/data/nested-list/components/SortableItem.js +62 -60
  28. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
  29. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
  30. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
  31. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
  32. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
  33. package/dist/components/data/nested-list/nested-list-constants.js +10 -4
  34. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
  35. package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
  36. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
  37. package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
  38. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
  39. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
  40. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
  41. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
  42. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
  43. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
  44. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
  45. package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
  46. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
  47. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
  48. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
  49. package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
  50. package/dist/components/data/nested-list/nested-list.js +322 -336
  51. package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
  52. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
  53. package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
  54. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  55. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
  56. package/dist/components/data-display/calendar/calendar-day-picker-components.js +164 -234
  57. package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
  58. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
  59. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
  60. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  61. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +49 -50
  62. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
  63. package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
  64. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +1 -3
  65. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +5 -7
  66. package/dist/components/data-display/calendar/calendar-period-cell.js +46 -45
  67. package/dist/components/data-display/calendar/calendar-quarter-panes.js +31 -33
  68. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -10
  69. package/dist/components/data-display/calendar/calendar-selection-appearance.js +39 -53
  70. package/dist/components/data-display/calendar/calendar-selection.d.ts +0 -25
  71. package/dist/components/data-display/calendar/calendar-selection.js +23 -52
  72. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
  73. package/dist/components/data-display/calendar/calendar-week-number-cell.js +45 -59
  74. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +3 -13
  75. package/dist/components/data-display/calendar/calendar-week-utils.js +50 -59
  76. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -3
  77. package/dist/components/data-display/calendar/calendar-year-panes.js +49 -53
  78. package/dist/components/data-display/calendar/calendar.js +143 -146
  79. package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
  80. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
  81. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
  82. package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
  83. package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
  84. package/dist/components/forms/date-picker/date-picker.js +58 -60
  85. package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
  86. package/dist/components/forms/date-picker/date-range-picker.js +64 -66
  87. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
  88. package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
  89. package/dist/components/forms/date-picker/month-picker.js +59 -61
  90. package/dist/components/forms/date-picker/month-range-picker.js +61 -63
  91. package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
  92. package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
  93. package/dist/components/forms/date-picker/multi-quarter-picker.js +47 -51
  94. package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
  95. package/dist/components/forms/date-picker/multi-year-picker.js +49 -53
  96. package/dist/components/forms/date-picker/quarter-picker.js +47 -51
  97. package/dist/components/forms/date-picker/quarter-range-picker.js +46 -50
  98. package/dist/components/forms/date-picker/week-picker.js +66 -68
  99. package/dist/components/forms/date-picker/week-range-picker.js +80 -82
  100. package/dist/components/forms/date-picker/year-picker.js +48 -52
  101. package/dist/components/forms/date-picker/year-range-picker.js +48 -52
  102. package/dist/form-react/Fields/DateInputField.js +50 -51
  103. package/dist/form-react/Fields/DateRangeField.js +13 -14
  104. package/dist/form-react/Fields/MonthRangeField.js +28 -29
  105. package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
  106. package/dist/form-react/Fields/MultiWeekPickerField.js +27 -35
  107. package/dist/form-react/Fields/WeekRangePicker.js +32 -33
  108. package/dist/form-react/types/fields.types.d.ts +0 -14
  109. package/dist/impact-nova-components.css +6 -13
  110. package/dist/impact-nova.css +1 -1
  111. package/dist/lib/fiscal-calendar/week-selection.js +2 -2
  112. package/dist/lib/hash/fnv1a128.d.ts +16 -0
  113. package/dist/lib/hash/fnv1a128.js +21 -0
  114. package/dist/llms/rules/ag-grid.js +1 -1
  115. package/dist/llms/rules/installation.js +1 -1
  116. package/dist/llms/rules/requirements.js +1 -1
  117. package/package.json +1 -1
  118. package/dist/components/data-display/calendar/calendar-available-view.d.ts +0 -27
  119. package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
  120. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +0 -9
  121. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +0 -45
  122. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +0 -5
  123. package/dist/components/data-display/calendar/calendar-injected-week-row.js +0 -92
  124. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +0 -16
  125. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +0 -51
  126. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +0 -23
  127. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +0 -17
@@ -0,0 +1,14 @@
1
+ import { NESTED_LIST_VIRTUAL_ROW_ESTIMATE_PX as t, NESTED_LIST_ROOT_SCROLLABLE_ID as _ } from "./nested-list-constants.js";
2
+ const E = 68, e = 37, n = 25;
3
+ function u(r) {
4
+ return r.category !== "structure" || r.data?.hasVirtualColumnChildren === !0 ? !1 : !r.children || r.children.length === 0;
5
+ }
6
+ function T(r) {
7
+ return r ? r.category === "structure" ? u(r) ? E : r.id === _ ? e : n : t : t;
8
+ }
9
+ export {
10
+ E as NESTED_LIST_EMPTY_SECTION_ROW_PX,
11
+ n as NESTED_LIST_FROZEN_HEADER_ROW_PX,
12
+ e as NESTED_LIST_SCROLLABLE_HEADER_ROW_PX,
13
+ T as estimateNestedListRowHeight
14
+ };
@@ -0,0 +1,36 @@
1
+ import { VirtualDropRowGeometry } from './nested-list-virtual-drop';
2
+ export interface NestedListScrollAnchorCapture {
3
+ anchorItemId: string;
4
+ anchorRowIndex: number;
5
+ anchorTopInViewport: number;
6
+ }
7
+ export declare function findNestedListRowIndexByItemId(options: {
8
+ rowCount: number;
9
+ getRowAtIndex: (index: number) => {
10
+ item: {
11
+ id: string;
12
+ };
13
+ } | undefined;
14
+ anchorItemId: string;
15
+ }): number;
16
+ export declare function resolveNestedListRowOffset(options: {
17
+ virtualizer: VirtualDropRowGeometry;
18
+ rowIndex: number;
19
+ estimateRowSize: (index: number) => number;
20
+ }): number;
21
+ export declare function captureNestedListScrollAnchor(options: {
22
+ scrollElement: HTMLElement;
23
+ anchorItemId: string;
24
+ anchorRowIndex: number;
25
+ rowOffset: number;
26
+ }): NestedListScrollAnchorCapture | null;
27
+ export declare function computeAnchoredScrollTop(options: {
28
+ newRowOffset: number;
29
+ anchorTopInViewport: number;
30
+ }): number;
31
+ export declare function restoreNestedListScrollAnchor(options: {
32
+ scrollElement: HTMLElement;
33
+ capture: NestedListScrollAnchorCapture;
34
+ virtualizer: VirtualDropRowGeometry;
35
+ estimateRowSize: (index: number) => number;
36
+ }): void;
@@ -0,0 +1,47 @@
1
+ function u(e) {
2
+ for (let r = 0; r < e.rowCount; r += 1)
3
+ if (e.getRowAtIndex(r)?.item.id === e.anchorItemId)
4
+ return r;
5
+ return -1;
6
+ }
7
+ function c(e) {
8
+ if (e.rowIndex <= 0)
9
+ return 0;
10
+ const r = e.virtualizer.measurementsCache[e.rowIndex]?.start;
11
+ if (r !== void 0)
12
+ return r;
13
+ let n = 0;
14
+ for (let t = 0; t < e.rowIndex; t += 1) {
15
+ const o = e.virtualizer.measurementsCache[t]?.size;
16
+ n += o && o > 0 ? o : e.estimateRowSize(t);
17
+ }
18
+ return n;
19
+ }
20
+ function l(e) {
21
+ return e.anchorRowIndex < 0 ? null : {
22
+ anchorItemId: e.anchorItemId,
23
+ anchorRowIndex: e.anchorRowIndex,
24
+ anchorTopInViewport: e.rowOffset - e.scrollElement.scrollTop
25
+ };
26
+ }
27
+ function a(e) {
28
+ return Math.max(0, e.newRowOffset - e.anchorTopInViewport);
29
+ }
30
+ function w(e) {
31
+ const r = c({
32
+ virtualizer: e.virtualizer,
33
+ rowIndex: e.capture.anchorRowIndex,
34
+ estimateRowSize: e.estimateRowSize
35
+ });
36
+ e.scrollElement.scrollTop = a({
37
+ newRowOffset: r,
38
+ anchorTopInViewport: e.capture.anchorTopInViewport
39
+ });
40
+ }
41
+ export {
42
+ l as captureNestedListScrollAnchor,
43
+ a as computeAnchoredScrollTop,
44
+ u as findNestedListRowIndexByItemId,
45
+ c as resolveNestedListRowOffset,
46
+ w as restoreNestedListScrollAnchor
47
+ };
@@ -0,0 +1,59 @@
1
+ import { NestedListItem } from './nested-list.types';
2
+ export type FlatNestedListRow = {
3
+ item: NestedListItem;
4
+ level: number;
5
+ indentLevel: number;
6
+ };
7
+ export type VirtualDropTarget = {
8
+ overId: string;
9
+ insertAfter: boolean;
10
+ flatIndex: number;
11
+ };
12
+ export declare function resolveSectionHeaderDropTarget(items: FlatNestedListRow[], sectionId: string): {
13
+ overId: string;
14
+ insertAfter: boolean;
15
+ } | null;
16
+ /**
17
+ * Maps group-header pointer targets to commit-safe drop targets.
18
+ * insertAfter on a group header (gap before first child) must target the first
19
+ * child leaf so cross-group moves pass column-picker validation.
20
+ */
21
+ export declare function resolveGroupHeaderDropTarget(items: FlatNestedListRow[], groupId: string, insertAfter: boolean, collapsedItems?: Record<string, boolean>): {
22
+ overId: string;
23
+ insertAfter: boolean;
24
+ };
25
+ export declare function resolveSectionDroppableFromDomHit(clientX: number, clientY: number, scrollElement: HTMLElement): string | null;
26
+ export interface VirtualDropRowGeometry {
27
+ measurementsCache: Array<{
28
+ start: number;
29
+ size: number;
30
+ }>;
31
+ getTotalSize: () => number;
32
+ }
33
+ export interface ResolveVirtualDropTargetOptions {
34
+ clientX: number;
35
+ clientY: number;
36
+ scrollElement: HTMLElement;
37
+ items: FlatNestedListRow[];
38
+ virtualizer: VirtualDropRowGeometry;
39
+ estimateRowSize: (index: number) => number;
40
+ offsetCacheHolder?: {
41
+ current: VirtualDropRowOffsetCache | null;
42
+ };
43
+ collapsedItems?: Record<string, boolean>;
44
+ }
45
+ export interface VirtualDropRowOffsetCache {
46
+ rowCount: number;
47
+ measurementFingerprint: number;
48
+ offsets: number[];
49
+ sizes: number[];
50
+ }
51
+ export declare function resolveVirtualDropTarget(options: ResolveVirtualDropTargetOptions): VirtualDropTarget | null;
52
+ export declare function insertGapIndexFromDropTarget(items: FlatNestedListRow[], target: Pick<VirtualDropTarget, 'overId' | 'insertAfter'>): number | null;
53
+ export declare function getInsertGapOffsetY(insertGapIndex: number, virtualizer: VirtualDropRowGeometry, estimateRowSize: (index: number) => number, rowCount: number): number;
54
+ export declare function isInsertGapVisibleOnMountedRows(insertGapIndex: number, mountedRowIndices: number[], rowCount: number): boolean;
55
+ export declare function clampPointerToScrollBounds(clientX: number, clientY: number, scrollRect: DOMRect): {
56
+ pointerX: number;
57
+ pointerY: number;
58
+ isInsideScrollContainer: boolean;
59
+ };
@@ -0,0 +1,341 @@
1
+ import { getSectionIdFromDroppable as w } from "./nested-list-drop-engine.js";
2
+ import { NESTED_LIST_SECTION_IDS as p } from "./nested-list-constants.js";
3
+ function z(t, e) {
4
+ for (let n = e + 1; n < t.length; n += 1) {
5
+ const r = t[n];
6
+ if (p.has(r.item.id))
7
+ return !1;
8
+ if (r.item.category !== "structure")
9
+ return !0;
10
+ }
11
+ return !1;
12
+ }
13
+ function A(t, e) {
14
+ const n = t.findIndex((o) => o.item.id === e);
15
+ if (n === -1)
16
+ return null;
17
+ if (!z(t, n))
18
+ return { overId: `droppable-${e}`, insertAfter: !1 };
19
+ for (let o = n + 1; o < t.length; o += 1) {
20
+ const i = t[o];
21
+ if (p.has(i.item.id))
22
+ break;
23
+ if (i.item.category !== "structure")
24
+ return { overId: i.item.id, insertAfter: !1 };
25
+ }
26
+ const r = t.slice(0, n).filter(
27
+ (o) => !p.has(o.item.id)
28
+ );
29
+ return r.length > 0 ? {
30
+ overId: r[r.length - 1].item.id,
31
+ insertAfter: !0
32
+ } : null;
33
+ }
34
+ function M(t, e) {
35
+ const n = t[e].level;
36
+ for (let r = e + 1; r < t.length; r += 1) {
37
+ const o = t[r];
38
+ if (o.level <= n)
39
+ return !1;
40
+ if (o.item.category !== "structure")
41
+ return !0;
42
+ }
43
+ return !1;
44
+ }
45
+ function R(t, e, n, r = {}) {
46
+ if (!n)
47
+ return { overId: e, insertAfter: n };
48
+ if (r[e] === !0)
49
+ return { overId: e, insertAfter: !0 };
50
+ const o = t.findIndex((s) => s.item.id === e);
51
+ if (o === -1 || !M(t, o))
52
+ return { overId: e, insertAfter: n };
53
+ const i = t[o].level;
54
+ for (let s = o + 1; s < t.length; s += 1) {
55
+ const l = t[s];
56
+ if (l.level <= i)
57
+ break;
58
+ if (l.item.category !== "structure")
59
+ return { overId: l.item.id, insertAfter: !1 };
60
+ }
61
+ return { overId: e, insertAfter: !0 };
62
+ }
63
+ function y(t, e, n) {
64
+ const r = document.elementFromPoint(t, e);
65
+ if (!r || !n.contains(r))
66
+ return null;
67
+ const o = r.closest("[data-section-droppable]");
68
+ if (!(o instanceof HTMLElement) || !n.contains(o))
69
+ return null;
70
+ const i = o.getAttribute("data-section-droppable");
71
+ return !i || !p.has(i) ? null : `droppable-${i}`;
72
+ }
73
+ function D(t, e, n, r) {
74
+ if (e <= 0)
75
+ return 0;
76
+ let o = 0, i = e - 1;
77
+ for (; o < i; ) {
78
+ const s = Math.floor((o + i) / 2), l = n(s), u = Math.max(r(s), 1), f = l + u;
79
+ if (t < l)
80
+ i = s - 1;
81
+ else if (t >= f)
82
+ o = s + 1;
83
+ else
84
+ return s;
85
+ }
86
+ return Math.max(0, Math.min(o, e - 1));
87
+ }
88
+ function E(t, e, n, r, o, i) {
89
+ const s = e.querySelector(`[data-index="${r}"]`);
90
+ if (s instanceof HTMLElement) {
91
+ const c = s.getBoundingClientRect(), d = c.top + c.height / 2;
92
+ return t >= d;
93
+ }
94
+ const l = e.querySelector(`[data-item-id="${n}"]`);
95
+ if (l instanceof HTMLElement) {
96
+ const c = l.getBoundingClientRect(), d = c.top + c.height / 2;
97
+ return t >= d;
98
+ }
99
+ const f = e.getBoundingClientRect().top + o(r) - e.scrollTop, h = i(r), a = f + h / 2;
100
+ return t >= a;
101
+ }
102
+ function O(t) {
103
+ let e = 0;
104
+ for (let n = 0; n < t.measurementsCache.length; n += 1)
105
+ e = e * 31 + t.measurementsCache[n].size | 0;
106
+ return e;
107
+ }
108
+ function H(t, e, n, r) {
109
+ const o = e.measurementsCache.some(
110
+ (u) => u.size > 0
111
+ ), i = O(e), s = r?.current;
112
+ if (s && s.rowCount === t && s.measurementFingerprint === i)
113
+ return {
114
+ offsets: s.offsets,
115
+ sizes: s.sizes
116
+ };
117
+ const l = o ? L(e, t, n) : C(t, n);
118
+ return r && (r.current = {
119
+ rowCount: t,
120
+ measurementFingerprint: i,
121
+ offsets: l.offsets,
122
+ sizes: l.sizes
123
+ }), l;
124
+ }
125
+ function C(t, e) {
126
+ const n = new Array(t), r = new Array(t);
127
+ let o = 0;
128
+ for (let i = 0; i < t; i += 1) {
129
+ const s = e(i);
130
+ n[i] = o, r[i] = s, o += s;
131
+ }
132
+ return { offsets: n, sizes: r };
133
+ }
134
+ function L(t, e, n) {
135
+ const r = t.measurementsCache, o = new Array(e), i = new Array(e);
136
+ let s = 0;
137
+ for (let l = 0; l < e; l += 1) {
138
+ const u = r[l]?.size, f = u && u > 0 ? u : n(l);
139
+ o[l] = s, i[l] = f, s += f;
140
+ }
141
+ return { offsets: o, sizes: i };
142
+ }
143
+ function B(t) {
144
+ for (let e = t.length - 1; e >= 0; e -= 1) {
145
+ const n = t[e];
146
+ if (!(!n || p.has(n.item.id)) && n.item.category !== "structure")
147
+ return e;
148
+ }
149
+ return Math.max(0, t.length - 1);
150
+ }
151
+ function V(t, e, n) {
152
+ const r = document.elementFromPoint(t, e);
153
+ if (!r || !n.contains(r) || r.closest('[data-slot="drag-drop-tail"]'))
154
+ return null;
155
+ const o = r.closest("[data-index]");
156
+ if (!(o instanceof HTMLElement) || !n.contains(o))
157
+ return null;
158
+ const i = Number(o.getAttribute("data-index"));
159
+ return Number.isFinite(i) ? i : null;
160
+ }
161
+ function P(t, e, n, r) {
162
+ const o = r.getTotalSize();
163
+ if (o > 0)
164
+ return o;
165
+ if (t <= 0)
166
+ return 0;
167
+ const i = t - 1;
168
+ return e(i) + n(i);
169
+ }
170
+ function N(t, e, n, r) {
171
+ if (document.elementFromPoint(t, e)?.closest('[data-slot="drag-drop-tail"]'))
172
+ return !0;
173
+ const i = n.getBoundingClientRect();
174
+ return e - i.top + n.scrollTop >= r;
175
+ }
176
+ function v(t) {
177
+ const {
178
+ clientY: e,
179
+ scrollElement: n,
180
+ items: r,
181
+ flatIndex: o,
182
+ getRowOffset: i,
183
+ getRowSize: s,
184
+ forceInsertAfter: l = !1,
185
+ collapsedItems: u = {}
186
+ } = t, f = Math.max(0, Math.min(o, r.length - 1)), h = r[f];
187
+ if (!h)
188
+ return null;
189
+ let a = h.item.id, c = l || E(
190
+ e,
191
+ n,
192
+ a,
193
+ f,
194
+ i,
195
+ s
196
+ ), d = f;
197
+ if (p.has(a)) {
198
+ const g = A(r, a);
199
+ if (!g)
200
+ return null;
201
+ a = g.overId, c = g.insertAfter;
202
+ const I = r.findIndex((x) => x.item.id === a);
203
+ d = I === -1 ? f : I;
204
+ } else if (h.item.category === "group") {
205
+ const g = R(
206
+ r,
207
+ a,
208
+ c,
209
+ u
210
+ );
211
+ a = g.overId, c = g.insertAfter;
212
+ const I = r.findIndex((x) => x.item.id === a);
213
+ d = I === -1 ? f : I;
214
+ }
215
+ return {
216
+ overId: a,
217
+ insertAfter: c,
218
+ flatIndex: d
219
+ };
220
+ }
221
+ function _(t) {
222
+ const {
223
+ clientX: e,
224
+ clientY: n,
225
+ scrollElement: r,
226
+ items: o,
227
+ virtualizer: i,
228
+ estimateRowSize: s,
229
+ offsetCacheHolder: l,
230
+ collapsedItems: u = {}
231
+ } = t;
232
+ if (o.length === 0)
233
+ return null;
234
+ const f = y(
235
+ e,
236
+ n,
237
+ r
238
+ );
239
+ if (f) {
240
+ const m = w(f), S = m ? o.findIndex((b) => b.item.id === m) : -1;
241
+ return {
242
+ overId: f,
243
+ insertAfter: !1,
244
+ flatIndex: S === -1 ? 0 : S
245
+ };
246
+ }
247
+ const { offsets: h, sizes: a } = H(
248
+ o.length,
249
+ i,
250
+ s,
251
+ l
252
+ ), c = (m) => h[m] ?? 0, d = (m) => a[m] ?? s(m), g = P(
253
+ o.length,
254
+ c,
255
+ d,
256
+ i
257
+ );
258
+ if (N(e, n, r, g)) {
259
+ const m = B(o);
260
+ return v({
261
+ clientY: n,
262
+ scrollElement: r,
263
+ items: o,
264
+ flatIndex: m,
265
+ getRowOffset: c,
266
+ getRowSize: d,
267
+ forceInsertAfter: !0,
268
+ collapsedItems: u
269
+ });
270
+ }
271
+ const I = V(e, n, r);
272
+ if (I !== null)
273
+ return v({
274
+ clientY: n,
275
+ scrollElement: r,
276
+ items: o,
277
+ flatIndex: I,
278
+ getRowOffset: c,
279
+ getRowSize: d,
280
+ collapsedItems: u
281
+ });
282
+ const x = r.getBoundingClientRect(), F = n - x.top + r.scrollTop, T = D(
283
+ F,
284
+ o.length,
285
+ c,
286
+ d
287
+ );
288
+ return v({
289
+ clientY: n,
290
+ scrollElement: r,
291
+ items: o,
292
+ flatIndex: T,
293
+ getRowOffset: c,
294
+ getRowSize: d,
295
+ collapsedItems: u
296
+ });
297
+ }
298
+ function k(t, e) {
299
+ const n = w(e.overId);
300
+ if (n) {
301
+ const o = t.findIndex((i) => i.item.id === n);
302
+ return o === -1 ? null : e.insertAfter ? o + 1 : o;
303
+ }
304
+ const r = t.findIndex((o) => o.item.id === e.overId);
305
+ return r === -1 ? null : e.insertAfter ? r + 1 : r;
306
+ }
307
+ function q(t, e, n, r) {
308
+ if (t <= 0)
309
+ return 0;
310
+ if (t >= r)
311
+ return e.getTotalSize();
312
+ const o = e.measurementsCache[t]?.start;
313
+ if (o !== void 0)
314
+ return o;
315
+ let i = 0;
316
+ for (let s = 0; s < t; s += 1) {
317
+ const l = e.measurementsCache[s]?.size;
318
+ i += l && l > 0 ? l : n(s);
319
+ }
320
+ return i;
321
+ }
322
+ function G(t, e, n) {
323
+ return t < n ? e.includes(t) : t === n ? e.includes(n - 1) : !1;
324
+ }
325
+ function Z(t, e, n) {
326
+ return t >= n.left && t <= n.right && e >= n.top && e <= n.bottom ? { pointerX: t, pointerY: e, isInsideScrollContainer: !0 } : {
327
+ pointerX: Math.min(Math.max(t, n.left + 12), n.right - 12),
328
+ pointerY: Math.min(Math.max(e, n.top + 12), n.bottom - 12),
329
+ isInsideScrollContainer: !1
330
+ };
331
+ }
332
+ export {
333
+ Z as clampPointerToScrollBounds,
334
+ q as getInsertGapOffsetY,
335
+ k as insertGapIndexFromDropTarget,
336
+ G as isInsertGapVisibleOnMountedRows,
337
+ R as resolveGroupHeaderDropTarget,
338
+ y as resolveSectionDroppableFromDomHit,
339
+ A as resolveSectionHeaderDropTarget,
340
+ _ as resolveVirtualDropTarget
341
+ };