react-virtuoso 4.18.16 → 4.18.18

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 (3) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +1537 -1474
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as G, jsxs as $t } from "react/jsx-runtime";
2
- import E, { createElement as Dt } from "react";
3
- import go from "react-dom";
4
- const we = 0, Wt = 1, Xt = 2, Pn = 4;
1
+ import { jsx as M, jsxs as Kt } from "react/jsx-runtime";
2
+ import E, { createElement as Ut } from "react";
3
+ import Io from "react-dom";
4
+ const ye = 0, Gt = 1, Qt = 2, Pn = 4;
5
5
  function mn(t) {
6
6
  return () => t;
7
7
  }
8
- function Io(t) {
8
+ function So(t) {
9
9
  t();
10
10
  }
11
11
  function re(t, e) {
@@ -14,45 +14,45 @@ function re(t, e) {
14
14
  function pn(t, e) {
15
15
  return () => t(e);
16
16
  }
17
- function So(t, e) {
17
+ function xo(t, e) {
18
18
  return (n) => t(e, n);
19
19
  }
20
20
  function Ne(t) {
21
21
  return t !== void 0;
22
22
  }
23
- function xo(...t) {
23
+ function vo(...t) {
24
24
  return () => {
25
- t.map(Io);
25
+ t.map(So);
26
26
  };
27
27
  }
28
- function Jt() {
28
+ function te() {
29
29
  }
30
- function ye(t, e) {
30
+ function be(t, e) {
31
31
  return e(t), t;
32
32
  }
33
- function vo(t, e) {
33
+ function To(t, e) {
34
34
  return e(t);
35
35
  }
36
36
  function st(...t) {
37
37
  return t;
38
38
  }
39
39
  function X(t, e) {
40
- return t(Wt, e);
40
+ return t(Gt, e);
41
41
  }
42
- function M(t, e) {
43
- t(we, e);
42
+ function _(t, e) {
43
+ t(ye, e);
44
44
  }
45
45
  function De(t) {
46
- t(Xt);
46
+ t(Qt);
47
47
  }
48
- function lt(t) {
48
+ function tt(t) {
49
49
  return t(Pn);
50
50
  }
51
- function L(t, e) {
52
- return X(t, So(e, we));
51
+ function z(t, e) {
52
+ return X(t, xo(e, ye));
53
53
  }
54
- function bt(t, e) {
55
- const n = t(Wt, (o) => {
54
+ function Et(t, e) {
55
+ const n = t(Gt, (o) => {
56
56
  n(), e(o);
57
57
  });
58
58
  return n;
@@ -65,16 +65,16 @@ function hn(t) {
65
65
  }, t);
66
66
  };
67
67
  }
68
- function Wn(t, e) {
68
+ function Gn(t, e) {
69
69
  return t === e;
70
70
  }
71
- function ot(t = Wn) {
71
+ function ot(t = Gn) {
72
72
  let e;
73
73
  return (n) => (o) => {
74
74
  t(e, o) || (e = o, n(o));
75
75
  };
76
76
  }
77
- function W(t) {
77
+ function V(t) {
78
78
  return (e) => (n) => {
79
79
  t(n) && e(n);
80
80
  };
@@ -82,34 +82,34 @@ function W(t) {
82
82
  function k(t) {
83
83
  return (e) => re(e, t);
84
84
  }
85
- function kt(t) {
85
+ function Ct(t) {
86
86
  return (e) => () => {
87
87
  e(t);
88
88
  };
89
89
  }
90
90
  function S(t, ...e) {
91
- const n = To(...e);
91
+ const n = Co(...e);
92
92
  return ((o, r) => {
93
93
  switch (o) {
94
- case Xt:
94
+ case Qt:
95
95
  De(t);
96
96
  return;
97
- case Wt:
97
+ case Gt:
98
98
  return X(t, n(r));
99
99
  }
100
100
  });
101
101
  }
102
- function Bt(t, e) {
102
+ function Ht(t, e) {
103
103
  return (n) => (o) => {
104
104
  n(e = t(e, o));
105
105
  };
106
106
  }
107
- function Ut(t) {
107
+ function jt(t) {
108
108
  return (e) => (n) => {
109
109
  t > 0 ? t-- : e(n);
110
110
  };
111
111
  }
112
- function zt(t) {
112
+ function Wt(t) {
113
113
  let e = null, n;
114
114
  return (o) => (r) => {
115
115
  e = r, !n && (n = setTimeout(() => {
@@ -117,15 +117,15 @@ function zt(t) {
117
117
  }, t));
118
118
  };
119
119
  }
120
- function D(...t) {
120
+ function $(...t) {
121
121
  const e = Array.from({ length: t.length });
122
122
  let n = 0, o = null;
123
123
  const r = 2 ** t.length - 1;
124
124
  return t.forEach((s, i) => {
125
125
  const l = 2 ** i;
126
- X(s, (c) => {
126
+ X(s, (u) => {
127
127
  const d = n;
128
- n |= l, e[i] = c, d !== r && n === r && o && (o(), o = null);
128
+ n |= l, e[i] = u, d !== r && n === r && o && (o(), o = null);
129
129
  });
130
130
  }), (s) => (i) => {
131
131
  const l = () => {
@@ -134,31 +134,31 @@ function D(...t) {
134
134
  n === r ? l() : o = l;
135
135
  };
136
136
  }
137
- function To(...t) {
138
- return (e) => t.reduceRight(vo, e);
137
+ function Co(...t) {
138
+ return (e) => t.reduceRight(To, e);
139
139
  }
140
- function Co(t) {
140
+ function wo(t) {
141
141
  let e, n;
142
142
  const o = () => e?.();
143
143
  return function(r, s) {
144
144
  switch (r) {
145
- case Wt:
146
- return s ? n === s ? void 0 : (o(), n = s, e = X(t, s), e) : (o(), Jt);
147
- case Xt:
145
+ case Gt:
146
+ return s ? n === s ? void 0 : (o(), n = s, e = X(t, s), e) : (o(), te);
147
+ case Qt:
148
148
  o(), n = null;
149
149
  return;
150
150
  }
151
151
  };
152
152
  }
153
- function w(t) {
153
+ function y(t) {
154
154
  let e = t;
155
- const n = K();
155
+ const n = U();
156
156
  return ((o, r) => {
157
157
  switch (o) {
158
- case we:
158
+ case ye:
159
159
  e = r;
160
160
  break;
161
- case Wt: {
161
+ case Gt: {
162
162
  r(e);
163
163
  break;
164
164
  }
@@ -169,21 +169,21 @@ function w(t) {
169
169
  });
170
170
  }
171
171
  function gt(t, e) {
172
- return ye(w(e), (n) => L(t, n));
172
+ return be(y(e), (n) => z(t, n));
173
173
  }
174
- function K() {
174
+ function U() {
175
175
  const t = [];
176
176
  return ((e, n) => {
177
177
  switch (e) {
178
- case we:
178
+ case ye:
179
179
  t.slice().forEach((o) => {
180
180
  o(n);
181
181
  });
182
182
  return;
183
- case Xt:
183
+ case Qt:
184
184
  t.splice(0);
185
185
  return;
186
- case Wt:
186
+ case Gt:
187
187
  return t.push(n), () => {
188
188
  const o = t.indexOf(n);
189
189
  o > -1 && t.splice(o, 1);
@@ -191,63 +191,63 @@ function K() {
191
191
  }
192
192
  });
193
193
  }
194
- function Ct(t) {
195
- return ye(K(), (e) => L(t, e));
194
+ function yt(t) {
195
+ return be(U(), (e) => z(t, e));
196
196
  }
197
- const wo = { singleton: !0 };
198
- function Z(t, e = [], n = wo) {
197
+ const yo = { singleton: !0 };
198
+ function Y(t, e = [], n = yo) {
199
199
  const { singleton: o } = n;
200
200
  return {
201
201
  constructor: t,
202
202
  dependencies: e,
203
- id: yo(),
203
+ id: bo(),
204
204
  singleton: o
205
205
  };
206
206
  }
207
- const yo = () => /* @__PURE__ */ Symbol("id");
208
- function bo(t) {
207
+ const bo = () => /* @__PURE__ */ Symbol("id");
208
+ function Ro(t) {
209
209
  const e = /* @__PURE__ */ new Map(), n = ({ constructor: o, dependencies: r, id: s, singleton: i }) => {
210
210
  if (i && e.has(s))
211
211
  return e.get(s);
212
- const l = o(r.map((c) => n(c)));
212
+ const l = o(r.map((u) => n(u)));
213
213
  return i && e.set(s, l), l;
214
214
  };
215
215
  return n(t);
216
216
  }
217
- function at(...t) {
218
- const e = K(), n = Array.from({ length: t.length });
217
+ function mt(...t) {
218
+ const e = U(), n = Array.from({ length: t.length });
219
219
  let o = 0;
220
220
  const r = 2 ** t.length - 1;
221
221
  return t.forEach((s, i) => {
222
222
  const l = 2 ** i;
223
- X(s, (c) => {
224
- n[i] = c, o |= l, o === r && M(e, n);
223
+ X(s, (u) => {
224
+ n[i] = u, o |= l, o === r && _(e, n);
225
225
  });
226
226
  }), function(s, i) {
227
227
  switch (s) {
228
- case Xt: {
228
+ case Qt: {
229
229
  De(e);
230
230
  return;
231
231
  }
232
- case Wt:
232
+ case Gt:
233
233
  return o === r && i(n), X(e, i);
234
234
  }
235
235
  };
236
236
  }
237
- function P(t, e = Wn) {
237
+ function P(t, e = Gn) {
238
238
  return S(t, ot(e));
239
239
  }
240
- function Ve(...t) {
240
+ function Te(...t) {
241
241
  return function(e, n) {
242
242
  switch (e) {
243
- case Xt:
243
+ case Qt:
244
244
  return;
245
- case Wt:
246
- return xo(...t.map((o) => X(o, n)));
245
+ case Gt:
246
+ return vo(...t.map((o) => X(o, n)));
247
247
  }
248
248
  };
249
249
  }
250
- const mt = {
250
+ const ht = {
251
251
  /** Detailed debugging information including item measurements */
252
252
  DEBUG: 0,
253
253
  /** General informational messages */
@@ -256,18 +256,18 @@ const mt = {
256
256
  WARN: 2,
257
257
  /** Error messages for failures (default level) */
258
258
  ERROR: 3
259
- }, Ro = {
260
- [mt.DEBUG]: "debug",
261
- [mt.ERROR]: "error",
262
- [mt.INFO]: "log",
263
- [mt.WARN]: "warn"
264
- }, Ho = () => typeof globalThis > "u" ? window : globalThis, Gt = Z(
259
+ }, Ho = {
260
+ [ht.DEBUG]: "debug",
261
+ [ht.ERROR]: "error",
262
+ [ht.INFO]: "log",
263
+ [ht.WARN]: "warn"
264
+ }, Eo = () => typeof globalThis > "u" ? window : globalThis, Mt = Y(
265
265
  () => {
266
- const t = w(mt.ERROR);
266
+ const t = y(ht.ERROR);
267
267
  return {
268
- log: w((n, o, r = mt.INFO) => {
269
- const s = Ho().VIRTUOSO_LOG_LEVEL ?? lt(t);
270
- r >= s && console[Ro[r]](
268
+ log: y((n, o, r = ht.INFO) => {
269
+ const s = Eo().VIRTUOSO_LOG_LEVEL ?? tt(t);
270
+ r >= s && console[Ho[r]](
271
271
  "%creact-virtuoso: %c%s %o",
272
272
  "color: #0253b3; font-weight: bold",
273
273
  "color: initial",
@@ -281,20 +281,20 @@ const mt = {
281
281
  [],
282
282
  { singleton: !0 }
283
283
  );
284
- function Eo(t) {
284
+ function ko(t) {
285
285
  return "self" in t ? t.document.documentElement : t;
286
286
  }
287
- function Gn(t) {
288
- const e = Eo(t);
287
+ function Mn(t) {
288
+ const e = ko(t);
289
289
  return e.ownerDocument.defaultView.getComputedStyle(e).direction === "rtl";
290
290
  }
291
- function _t(t, e) {
292
- return Gn(t) ? -e : e;
291
+ function Nt(t, e) {
292
+ return Mn(t) ? -e : e;
293
293
  }
294
294
  function gn(t, e) {
295
- return Gn(t) ? -e : e;
295
+ return Mn(t) ? -e : e;
296
296
  }
297
- function Ot(t, e, n) {
297
+ function Lt(t, e, n) {
298
298
  return $e(t, e, n).callbackRef;
299
299
  }
300
300
  function $e(t, e, n) {
@@ -303,8 +303,8 @@ function $e(t, e, n) {
303
303
  };
304
304
  const s = E.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
305
305
  const l = () => {
306
- const c = i[0].target;
307
- c.offsetParent !== null && t(c);
306
+ const u = i[0].target;
307
+ u.offsetParent !== null && t(u);
308
308
  };
309
309
  n ? l() : requestAnimationFrame(l);
310
310
  }) : null, [t, n]);
@@ -312,30 +312,30 @@ function $e(t, e, n) {
312
312
  i && e ? (s?.observe(i), o.current = i) : (o.current && s?.unobserve(o.current), o.current = null);
313
313
  }, { callbackRef: r, ref: o };
314
314
  }
315
- function An(t, e, n, o, r, s, i, l, c) {
315
+ function An(t, e, n, o, r, s, i, l, u) {
316
316
  const d = E.useCallback(
317
317
  (f) => {
318
- const v = ko(f.children, e, l ? "offsetWidth" : "offsetHeight", r);
319
- let m = f.parentElement;
320
- for (; m.dataset.virtuosoScroller === void 0; )
321
- m = m.parentElement;
322
- const h = m.lastElementChild?.dataset.viewportType === "window";
323
- let y;
324
- h && (y = m.ownerDocument.defaultView);
325
- const R = i ? l ? i.scrollWidth : i.scrollHeight : h ? l ? y.document.documentElement.scrollWidth : y.document.documentElement.scrollHeight : l ? m.scrollWidth : m.scrollHeight, I = i ? l ? i.offsetWidth : i.offsetHeight : h ? l ? y.innerWidth : y.innerHeight : l ? m.offsetWidth : m.offsetHeight, g = i ? l ? _t(i, i.scrollLeft) : i.scrollTop : h ? l ? _t(y, y.scrollX || y.document.documentElement.scrollLeft) : y.scrollY || y.document.documentElement.scrollTop : l ? _t(m, m.scrollLeft) : m.scrollTop;
318
+ const x = Bo(f.children, e, l ? "offsetWidth" : "offsetHeight", r);
319
+ let h = f.parentElement;
320
+ for (; h.dataset.virtuosoScroller === void 0; )
321
+ h = h.parentElement;
322
+ const m = h.lastElementChild?.dataset.viewportType === "window";
323
+ let v;
324
+ m && (v = h.ownerDocument.defaultView);
325
+ const R = i ? l ? i.scrollWidth : i.scrollHeight : m ? l ? v.document.documentElement.scrollWidth : v.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, g = i ? l ? i.offsetWidth : i.offsetHeight : m ? l ? v.innerWidth : v.innerHeight : l ? h.offsetWidth : h.offsetHeight, T = i ? l ? Nt(i, i.scrollLeft) : i.scrollTop : m ? l ? Nt(v, v.scrollX || v.document.documentElement.scrollLeft) : v.scrollY || v.document.documentElement.scrollTop : l ? Nt(h, h.scrollLeft) : h.scrollTop;
326
326
  o({
327
327
  scrollHeight: R,
328
- scrollTop: Math.max(g, 0),
329
- viewportHeight: I
328
+ scrollTop: Math.max(T, 0),
329
+ viewportHeight: g
330
330
  }), s?.(
331
331
  l ? In("column-gap", getComputedStyle(f).columnGap, r) : In("row-gap", getComputedStyle(f).rowGap, r)
332
- ), v !== null && t(v);
332
+ ), x !== null && t(x);
333
333
  },
334
334
  [t, e, r, s, i, o, l]
335
335
  );
336
- return $e(d, n, c);
336
+ return $e(d, n, u);
337
337
  }
338
- function ko(t, e, n, o) {
338
+ function Bo(t, e, n, o) {
339
339
  const r = t.length;
340
340
  if (r === 0)
341
341
  return null;
@@ -344,36 +344,36 @@ function ko(t, e, n, o) {
344
344
  const l = t.item(i);
345
345
  if (l.dataset.index === void 0)
346
346
  continue;
347
- const c = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), f = e(l, n);
348
- if (f === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), f === d)
347
+ const u = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), f = e(l, n);
348
+ if (f === 0 && o("Zero-sized element, this should not happen", { child: l }, ht.ERROR), f === d)
349
349
  continue;
350
- const v = s[s.length - 1];
351
- s.length === 0 || v.size !== f || v.endIndex !== c - 1 ? s.push({ endIndex: c, size: f, startIndex: c }) : s[s.length - 1].endIndex++;
350
+ const x = s[s.length - 1];
351
+ s.length === 0 || x.size !== f || x.endIndex !== u - 1 ? s.push({ endIndex: u, size: f, startIndex: u }) : s[s.length - 1].endIndex++;
352
352
  }
353
353
  return s;
354
354
  }
355
355
  function In(t, e, n) {
356
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
356
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ht.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
357
357
  }
358
- const be = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
358
+ const Re = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
359
359
  function Ue(t, e, n) {
360
360
  const o = E.useRef(null), r = E.useCallback(
361
- (c) => {
362
- if (!c?.offsetParent)
361
+ (u) => {
362
+ if (!u?.offsetParent)
363
363
  return;
364
- const d = c.getBoundingClientRect(), f = d.width;
365
- let v, m;
364
+ const d = u.getBoundingClientRect(), f = d.width;
365
+ let x, h;
366
366
  if (e) {
367
- const h = e.getBoundingClientRect(), y = d.top - h.top;
368
- m = h.height - Math.max(0, y), v = y + e.scrollTop;
367
+ const m = e.getBoundingClientRect(), v = d.top - m.top;
368
+ h = m.height - Math.max(0, v), x = v + e.scrollTop;
369
369
  } else {
370
- const h = i.current.ownerDocument.defaultView;
371
- m = h.innerHeight - Math.max(0, d.top), v = d.top + h.scrollY;
370
+ const m = i.current.ownerDocument.defaultView;
371
+ h = m.innerHeight - Math.max(0, d.top), x = d.top + m.scrollY;
372
372
  }
373
373
  o.current = {
374
374
  listHeight: d.height,
375
- offsetTop: v,
376
- visibleHeight: m,
375
+ offsetTop: x,
376
+ visibleHeight: h,
377
377
  visibleWidth: f
378
378
  }, t(o.current);
379
379
  },
@@ -392,44 +392,44 @@ function Ue(t, e, n) {
392
392
  e.removeEventListener("scroll", l), d.unobserve(e);
393
393
  };
394
394
  }
395
- const c = i.current?.ownerDocument.defaultView;
396
- return c?.addEventListener("scroll", l), c?.addEventListener("resize", l), () => {
397
- c?.removeEventListener("scroll", l), c?.removeEventListener("resize", l);
395
+ const u = i.current?.ownerDocument.defaultView;
396
+ return u?.addEventListener("scroll", l), u?.addEventListener("resize", l), () => {
397
+ u?.removeEventListener("scroll", l), u?.removeEventListener("resize", l);
398
398
  };
399
399
  }, [l, e, i]), s;
400
400
  }
401
- const St = Z(
401
+ const St = Y(
402
402
  () => {
403
- const t = K(), e = K(), n = w(0), o = K(), r = K(), s = w(0), i = K(), l = K(), c = w(0), d = w(0), f = w(0), v = w(0), m = K(), h = K(), y = w(!1), R = w(!1), I = w(!1);
404
- return L(
403
+ const t = U(), e = U(), n = y(0), o = U(), r = U(), s = y(0), i = U(), l = U(), u = y(0), d = y(0), f = y(0), x = y(0), h = U(), m = U(), v = y(!1), R = y(!1), g = y(!1);
404
+ return z(
405
405
  S(
406
406
  t,
407
- k(({ scrollTop: g }) => g)
407
+ k(({ scrollTop: T }) => T)
408
408
  ),
409
409
  e
410
- ), L(
410
+ ), z(
411
411
  S(
412
412
  t,
413
- k(({ scrollHeight: g }) => g)
413
+ k(({ scrollHeight: T }) => T)
414
414
  ),
415
415
  l
416
- ), L(e, s), {
416
+ ), z(e, s), {
417
417
  deviation: n,
418
418
  deviationCommitted: o,
419
419
  fixedFooterHeight: f,
420
420
  fixedHeaderHeight: d,
421
- footerHeight: v,
422
- headerHeight: c,
421
+ footerHeight: x,
422
+ headerHeight: u,
423
423
  horizontalDirection: R,
424
- scrollBy: h,
424
+ scrollBy: m,
425
425
  // input
426
426
  scrollContainerState: t,
427
427
  scrollHeight: l,
428
- scrollingInProgress: y,
428
+ scrollingInProgress: v,
429
429
  // signals
430
- scrollTo: m,
430
+ scrollTo: h,
431
431
  scrollTop: e,
432
- skipAnimationFrameInResizeObserver: I,
432
+ skipAnimationFrameInResizeObserver: g,
433
433
  smoothScrollTargetReached: r,
434
434
  // state
435
435
  statefulScrollTop: s,
@@ -439,107 +439,107 @@ const St = Z(
439
439
  [],
440
440
  { singleton: !0 }
441
441
  ), se = { lvl: 0 };
442
- function Mn(t, e) {
442
+ function _n(t, e) {
443
443
  const n = t.length;
444
444
  if (n === 0)
445
445
  return [];
446
446
  let { index: o, value: r } = e(t[0]);
447
447
  const s = [];
448
448
  for (let i = 1; i < n; i++) {
449
- const { index: l, value: c } = e(t[i]);
450
- s.push({ end: l - 1, start: o, value: r }), o = l, r = c;
449
+ const { index: l, value: u } = e(t[i]);
450
+ s.push({ end: l - 1, start: o, value: r }), o = l, r = u;
451
451
  }
452
452
  return s.push({ end: 1 / 0, start: o, value: r }), s;
453
453
  }
454
- function tt(t) {
454
+ function J(t) {
455
455
  return t === se;
456
456
  }
457
457
  function ie(t, e) {
458
- if (!tt(t))
458
+ if (!J(t))
459
459
  return e === t.k ? t.v : e < t.k ? ie(t.l, e) : ie(t.r, e);
460
460
  }
461
- function Rt(t, e, n = "k") {
462
- if (tt(t))
461
+ function kt(t, e, n = "k") {
462
+ if (J(t))
463
463
  return [-1 / 0, void 0];
464
464
  if (Number(t[n]) === e)
465
465
  return [t.k, t.v];
466
466
  if (Number(t[n]) < e) {
467
- const o = Rt(t.r, e, n);
467
+ const o = kt(t.r, e, n);
468
468
  return o[0] === -1 / 0 ? [t.k, t.v] : o;
469
469
  }
470
- return Rt(t.l, e, n);
470
+ return kt(t.l, e, n);
471
471
  }
472
- function vt(t, e, n) {
473
- return tt(t) ? Dn(e, n, 1) : e === t.k ? ft(t, { k: e, v: n }) : e < t.k ? Sn(ft(t, { l: vt(t.l, e, n) })) : Sn(ft(t, { r: vt(t.r, e, n) }));
472
+ function xt(t, e, n) {
473
+ return J(t) ? $n(e, n, 1) : e === t.k ? pt(t, { k: e, v: n }) : e < t.k ? Sn(pt(t, { l: xt(t.l, e, n) })) : Sn(pt(t, { r: xt(t.r, e, n) }));
474
474
  }
475
- function Yt() {
475
+ function Dt() {
476
476
  return se;
477
477
  }
478
- function Zt(t, e, n) {
479
- if (tt(t))
478
+ function Xt(t, e, n) {
479
+ if (J(t))
480
480
  return [];
481
- const o = Rt(t, e)[0];
482
- return Bo(We(t, o, n));
481
+ const o = kt(t, e)[0];
482
+ return Oo(Pe(t, o, n));
483
483
  }
484
- function Pe(t, e) {
485
- if (tt(t))
484
+ function We(t, e) {
485
+ if (J(t))
486
486
  return se;
487
487
  const { k: n, l: o, r } = t;
488
488
  if (e === n) {
489
- if (tt(o))
489
+ if (J(o))
490
490
  return r;
491
- if (tt(r))
491
+ if (J(r))
492
492
  return o;
493
- const [s, i] = Nn(o);
494
- return xe(ft(t, { k: s, l: _n(o), v: i }));
493
+ const [s, i] = Dn(o);
494
+ return xe(pt(t, { k: s, l: Nn(o), v: i }));
495
495
  }
496
- return e < n ? xe(ft(t, { l: Pe(o, e) })) : xe(ft(t, { r: Pe(r, e) }));
496
+ return e < n ? xe(pt(t, { l: We(o, e) })) : xe(pt(t, { r: We(r, e) }));
497
497
  }
498
- function Nt(t) {
499
- return tt(t) ? [] : [...Nt(t.l), { k: t.k, v: t.v }, ...Nt(t.r)];
498
+ function $t(t) {
499
+ return J(t) ? [] : [...$t(t.l), { k: t.k, v: t.v }, ...$t(t.r)];
500
500
  }
501
- function We(t, e, n) {
502
- if (tt(t))
501
+ function Pe(t, e, n) {
502
+ if (J(t))
503
503
  return [];
504
504
  const { k: o, l: r, r: s, v: i } = t;
505
505
  let l = [];
506
- return o > e && (l = l.concat(We(r, e, n))), o >= e && o <= n && l.push({ k: o, v: i }), o <= n && (l = l.concat(We(s, e, n))), l;
506
+ return o > e && (l = l.concat(Pe(r, e, n))), o >= e && o <= n && l.push({ k: o, v: i }), o <= n && (l = l.concat(Pe(s, e, n))), l;
507
507
  }
508
508
  function xe(t) {
509
509
  const { l: e, lvl: n, r: o } = t;
510
510
  if (o.lvl >= n - 1 && e.lvl >= n - 1)
511
511
  return t;
512
512
  if (n > o.lvl + 1) {
513
- if (Be(e))
514
- return $n(ft(t, { lvl: n - 1 }));
515
- if (!tt(e) && !tt(e.r))
516
- return ft(e.r, {
517
- l: ft(e, { r: e.r.l }),
513
+ if (Oe(e))
514
+ return Un(pt(t, { lvl: n - 1 }));
515
+ if (!J(e) && !J(e.r))
516
+ return pt(e.r, {
517
+ l: pt(e, { r: e.r.l }),
518
518
  lvl: n,
519
- r: ft(t, {
519
+ r: pt(t, {
520
520
  l: e.r.r,
521
521
  lvl: n - 1
522
522
  })
523
523
  });
524
524
  throw new Error("Unexpected empty nodes");
525
525
  }
526
- if (Be(t))
527
- return Ge(ft(t, { lvl: n - 1 }));
528
- if (!tt(o) && !tt(o.l)) {
529
- const r = o.l, s = Be(r) ? o.lvl - 1 : o.lvl;
530
- return ft(r, {
531
- l: ft(t, {
526
+ if (Oe(t))
527
+ return Ge(pt(t, { lvl: n - 1 }));
528
+ if (!J(o) && !J(o.l)) {
529
+ const r = o.l, s = Oe(r) ? o.lvl - 1 : o.lvl;
530
+ return pt(r, {
531
+ l: pt(t, {
532
532
  lvl: n - 1,
533
533
  r: r.l
534
534
  }),
535
535
  lvl: r.lvl + 1,
536
- r: Ge(ft(o, { l: r.r, lvl: s }))
536
+ r: Ge(pt(o, { l: r.r, lvl: s }))
537
537
  });
538
538
  }
539
539
  throw new Error("Unexpected empty nodes");
540
540
  }
541
- function ft(t, e) {
542
- return Dn(
541
+ function pt(t, e) {
542
+ return $n(
543
543
  e.k === void 0 ? t.k : e.k,
544
544
  e.v === void 0 ? t.v : e.v,
545
545
  e.lvl === void 0 ? t.lvl : e.lvl,
@@ -547,47 +547,47 @@ function ft(t, e) {
547
547
  e.r === void 0 ? t.r : e.r
548
548
  );
549
549
  }
550
- function _n(t) {
551
- return tt(t.r) ? t.l : xe(ft(t, { r: _n(t.r) }));
550
+ function Nn(t) {
551
+ return J(t.r) ? t.l : xe(pt(t, { r: Nn(t.r) }));
552
552
  }
553
- function Be(t) {
554
- return tt(t) || t.lvl > t.r.lvl;
553
+ function Oe(t) {
554
+ return J(t) || t.lvl > t.r.lvl;
555
555
  }
556
- function Nn(t) {
557
- return tt(t.r) ? [t.k, t.v] : Nn(t.r);
556
+ function Dn(t) {
557
+ return J(t.r) ? [t.k, t.v] : Dn(t.r);
558
558
  }
559
- function Dn(t, e, n, o = se, r = se) {
559
+ function $n(t, e, n, o = se, r = se) {
560
560
  return { k: t, l: o, lvl: n, r, v: e };
561
561
  }
562
562
  function Sn(t) {
563
- return Ge($n(t));
563
+ return Ge(Un(t));
564
564
  }
565
- function $n(t) {
565
+ function Un(t) {
566
566
  const { l: e } = t;
567
- return !tt(e) && e.lvl === t.lvl ? ft(e, { r: ft(t, { l: e.r }) }) : t;
567
+ return !J(e) && e.lvl === t.lvl ? pt(e, { r: pt(t, { l: e.r }) }) : t;
568
568
  }
569
569
  function Ge(t) {
570
570
  const { lvl: e, r: n } = t;
571
- return !tt(n) && !tt(n.r) && n.lvl === e && n.r.lvl === e ? ft(n, { l: ft(t, { r: n.l }), lvl: e + 1 }) : t;
571
+ return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? pt(n, { l: pt(t, { r: n.l }), lvl: e + 1 }) : t;
572
572
  }
573
- function Bo(t) {
574
- return Mn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
573
+ function Oo(t) {
574
+ return _n(t, ({ k: e, v: n }) => ({ index: e, value: n }));
575
575
  }
576
- function Un(t, e) {
576
+ function Kn(t, e) {
577
577
  return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
578
578
  }
579
- function le(t, e) {
579
+ function Jt(t, e) {
580
580
  return !!(t && t[0] === e[0] && t[1] === e[1]);
581
581
  }
582
- const Ke = Z(
583
- () => ({ recalcInProgress: w(!1) }),
582
+ const Ke = Y(
583
+ () => ({ recalcInProgress: y(!1) }),
584
584
  [],
585
585
  { singleton: !0 }
586
586
  );
587
- function Kn(t, e, n) {
588
- return t[Te(t, e, n)];
587
+ function jn(t, e, n) {
588
+ return t[Ce(t, e, n)];
589
589
  }
590
- function Te(t, e, n, o = 0) {
590
+ function Ce(t, e, n, o = 0) {
591
591
  let r = t.length - 1;
592
592
  for (; o <= r; ) {
593
593
  const s = Math.floor((o + r) / 2), i = t[s], l = n(i, e);
@@ -605,45 +605,45 @@ function Te(t, e, n, o = 0) {
605
605
  }
606
606
  throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`);
607
607
  }
608
- function Oo(t, e, n, o) {
609
- const r = Te(t, e, o), s = Te(t, n, o, r);
608
+ function Lo(t, e, n, o) {
609
+ const r = Ce(t, e, o), s = Ce(t, n, o, r);
610
610
  return t.slice(r, s + 1);
611
611
  }
612
- function Ht(t, e) {
612
+ function Bt(t, e) {
613
613
  return Math.round(t.getBoundingClientRect()[e]);
614
614
  }
615
- function Re(t) {
616
- return !tt(t.groupOffsetTree);
615
+ function He(t) {
616
+ return !J(t.groupOffsetTree);
617
617
  }
618
618
  function je({ index: t }, e) {
619
619
  return e === t ? 0 : e < t ? -1 : 1;
620
620
  }
621
- function Lo() {
621
+ function xn() {
622
622
  return {
623
623
  groupIndices: [],
624
- groupOffsetTree: Yt(),
624
+ groupOffsetTree: Dt(),
625
625
  lastIndex: 0,
626
626
  lastOffset: 0,
627
627
  lastSize: 0,
628
628
  offsetTree: [],
629
- sizeTree: Yt()
629
+ sizeTree: Dt()
630
630
  };
631
631
  }
632
632
  function zo(t, e) {
633
- let n = tt(t) ? 0 : 1 / 0;
633
+ let n = J(t) ? 0 : 1 / 0;
634
634
  for (const o of e) {
635
635
  const { endIndex: r, size: s, startIndex: i } = o;
636
- if (n = Math.min(n, i), tt(t)) {
637
- t = vt(t, 0, s);
636
+ if (n = Math.min(n, i), J(t)) {
637
+ t = xt(t, 0, s);
638
638
  continue;
639
639
  }
640
- const l = Zt(t, i - 1, r + 1);
641
- if (l.some(Mo(o)))
640
+ const l = Xt(t, i - 1, r + 1);
641
+ if (l.some(Ao(o)))
642
642
  continue;
643
- let c = !1, d = !1;
644
- for (const { end: f, start: v, value: m } of l)
645
- c ? (r >= v || s === m) && (t = Pe(t, v)) : (d = m !== s, c = !0), f > r && r >= v && m !== s && (t = vt(t, r + 1, m));
646
- d && (t = vt(t, i, s));
643
+ let u = !1, d = !1;
644
+ for (const { end: f, start: x, value: h } of l)
645
+ u ? (r >= x || s === h) && (t = We(t, x)) : (d = h !== s, u = !0), f > r && r >= x && h !== s && (t = xt(t, r + 1, h));
646
+ d && (t = xt(t, i, s));
647
647
  }
648
648
  return [t, n];
649
649
  }
@@ -653,80 +653,80 @@ function Fo(t) {
653
653
  function Vo({ offset: t }, e) {
654
654
  return e === t ? 0 : e < t ? -1 : 1;
655
655
  }
656
- function ce(t, e, n) {
656
+ function le(t, e, n) {
657
657
  if (e.length === 0)
658
658
  return 0;
659
- const { index: o, offset: r, size: s } = Kn(e, t, je), i = t - o, l = s * i + (i - 1) * n + r;
659
+ const { index: o, offset: r, size: s } = jn(e, t, je), i = t - o, l = s * i + (i - 1) * n + r;
660
660
  return l > 0 ? l + n : l;
661
661
  }
662
- function jn(t, e) {
663
- if (!Re(e))
662
+ function qn(t, e) {
663
+ if (!He(e))
664
664
  return t;
665
665
  let n = 0;
666
666
  for (; e.groupIndices[n] <= t + n; )
667
667
  n++;
668
668
  return t + n;
669
669
  }
670
- function qn(t, e, n) {
670
+ function Yn(t, e, n) {
671
671
  if (Fo(t))
672
672
  return e.groupIndices[t.groupIndex] + 1;
673
673
  const o = t.index === "LAST" ? n : t.index;
674
- let r = jn(o, e);
674
+ let r = qn(o, e);
675
675
  return r = Math.max(0, Math.min(n, r)), r;
676
676
  }
677
- function Po(t, e, n, o = 0) {
678
- return o > 0 && (e = Math.max(e, Kn(t, o, je).offset)), Mn(Oo(t, e, n, Vo), Ao);
677
+ function Wo(t, e, n, o = 0) {
678
+ return o > 0 && (e = Math.max(e, jn(t, o, je).offset)), _n(Lo(t, e, n, Vo), Mo);
679
679
  }
680
- function Wo(t, [e, n, o, r]) {
681
- e.length > 0 && o("received item sizes", e, mt.DEBUG);
680
+ function Po(t, [e, n, o, r]) {
681
+ e.length > 0 && o("received item sizes", e, ht.DEBUG);
682
682
  const s = t.sizeTree;
683
683
  let i = s, l = 0;
684
- if (n.length > 0 && tt(s) && e.length === 2) {
685
- const m = e[0].size, h = e[1].size;
686
- i = n.reduce((y, R) => vt(vt(y, R, m), R + 1, h), i);
684
+ if (n.length > 0 && J(s) && e.length === 2) {
685
+ const h = e[0].size, m = e[1].size;
686
+ i = n.reduce((v, R) => xt(xt(v, R, h), R + 1, m), i);
687
687
  } else
688
688
  [i, l] = zo(i, e);
689
689
  if (i === s)
690
690
  return t;
691
- const { lastIndex: c, lastOffset: d, lastSize: f, offsetTree: v } = Ae(t.offsetTree, l, i, r);
691
+ const { lastIndex: u, lastOffset: d, lastSize: f, offsetTree: x } = Me(t.offsetTree, l, i, r);
692
692
  return {
693
693
  groupIndices: n,
694
- groupOffsetTree: n.reduce((m, h) => vt(m, h, ce(h, v, r)), Yt()),
695
- lastIndex: c,
694
+ groupOffsetTree: n.reduce((h, m) => xt(h, m, le(m, x, r)), Dt()),
695
+ lastIndex: u,
696
696
  lastOffset: d,
697
697
  lastSize: f,
698
- offsetTree: v,
698
+ offsetTree: x,
699
699
  sizeTree: i
700
700
  };
701
701
  }
702
702
  function Go(t) {
703
- return Nt(t).map(({ k: e, v: n }, o, r) => {
703
+ return $t(t).map(({ k: e, v: n }, o, r) => {
704
704
  const s = r[o + 1];
705
705
  return { endIndex: s === void 0 ? 1 / 0 : s.k - 1, size: n, startIndex: e };
706
706
  });
707
707
  }
708
- function xn(t, e) {
708
+ function vn(t, e) {
709
709
  let n = 0, o = 0;
710
710
  for (; n < t; )
711
711
  n += e[o + 1] - e[o] - 1, o++;
712
712
  return o - (n === t ? 0 : 1);
713
713
  }
714
- function Ae(t, e, n, o) {
715
- let r = t, s = 0, i = 0, l = 0, c = 0;
714
+ function Me(t, e, n, o) {
715
+ let r = t, s = 0, i = 0, l = 0, u = 0;
716
716
  if (e === 0)
717
717
  r = [];
718
718
  else {
719
- c = Te(r, e - 1, je), l = r[c].offset;
720
- const f = Rt(n, e - 1);
721
- s = f[0], i = f[1], r.length && r[c].size === Rt(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
719
+ u = Ce(r, e - 1, je), l = r[u].offset;
720
+ const f = kt(n, e - 1);
721
+ s = f[0], i = f[1], r.length && r[u].size === kt(n, e)[1] && (u -= 1), r = r.slice(0, u + 1);
722
722
  }
723
- for (const { start: d, value: f } of Zt(n, e, 1 / 0)) {
724
- const v = d - s, m = v * i + l + v * o;
723
+ for (const { start: d, value: f } of Xt(n, e, 1 / 0)) {
724
+ const x = d - s, h = x * i + l + x * o;
725
725
  r.push({
726
726
  index: d,
727
- offset: m,
727
+ offset: h,
728
728
  size: f
729
- }), s = d, l = m, i = f;
729
+ }), s = d, l = h, i = f;
730
730
  }
731
731
  return {
732
732
  lastIndex: s,
@@ -735,224 +735,239 @@ function Ae(t, e, n, o) {
735
735
  offsetTree: r
736
736
  };
737
737
  }
738
- function Ao(t) {
738
+ function Mo(t) {
739
739
  return { index: t.index, value: t };
740
740
  }
741
- function Mo(t) {
741
+ function Ao(t) {
742
742
  const { endIndex: e, size: n, startIndex: o } = t;
743
743
  return (r) => r.start === o && (r.end === e || r.end === 1 / 0) && r.value === n;
744
744
  }
745
745
  const _o = {
746
746
  offsetHeight: "height",
747
747
  offsetWidth: "width"
748
- }, Lt = Z(
748
+ }, zt = Y(
749
749
  ([{ log: t }, { recalcInProgress: e }]) => {
750
- const n = K(), o = K(), r = gt(o, 0), s = K(), i = K(), l = w(0), c = w([]), d = w(void 0), f = w(void 0), v = w(void 0), m = w(void 0), h = w((u, p) => Ht(u, _o[p])), y = w(void 0), R = w(0), I = Lo(), g = gt(
751
- S(n, D(c, t, R), Bt(Wo, I), ot()),
752
- I
753
- ), a = gt(
750
+ const n = U(), o = U(), r = gt(o, 0), s = U(), i = U(), l = y(0), u = y([]), d = y(void 0), f = y(void 0), x = y(void 0), h = y(void 0), m = y((c, p) => Bt(c, _o[p])), v = y(void 0), R = y(0), g = xn(), T = U(), a = gt(
754
751
  S(
755
- c,
752
+ Te(n, T),
753
+ $(u, t, R),
754
+ Ht((c, [p, ...b]) => {
755
+ if (p === null) {
756
+ const [O] = b;
757
+ return {
758
+ ...xn(),
759
+ groupIndices: O,
760
+ groupOffsetTree: O.reduce((L, F, G) => xt(L, F, G), Dt())
761
+ };
762
+ }
763
+ return Po(c, [p, ...b]);
764
+ }, g),
765
+ ot()
766
+ ),
767
+ g
768
+ ), C = gt(
769
+ S(
770
+ u,
756
771
  ot(),
757
- Bt((u, p) => ({ current: p, prev: u.current }), {
772
+ Ht((c, p) => ({ current: p, prev: c.current }), {
758
773
  current: [],
759
774
  prev: []
760
775
  }),
761
- k(({ prev: u }) => u)
776
+ k(({ prev: c }) => c)
762
777
  ),
763
778
  []
764
779
  );
765
- L(
780
+ z(
766
781
  S(
767
- c,
768
- W((u) => u.length > 0),
769
- D(g, R),
770
- k(([u, p, b]) => {
771
- const z = u.reduce((F, O, V) => vt(F, O, ce(O, p.offsetTree, b) || V), Yt());
782
+ u,
783
+ V((c) => c.length > 0),
784
+ $(a, R),
785
+ k(([c, p, b]) => {
786
+ const O = c.reduce((L, F, G) => xt(L, F, le(F, p.offsetTree, b) || G), Dt());
772
787
  return {
773
788
  ...p,
774
- groupIndices: u,
775
- groupOffsetTree: z
789
+ groupIndices: c,
790
+ groupOffsetTree: O
776
791
  };
777
792
  })
778
793
  ),
779
- g
780
- ), L(
794
+ a
795
+ ), z(
781
796
  S(
782
797
  o,
783
- D(g),
784
- W(([u, { lastIndex: p }]) => u < p),
785
- k(([u, { lastIndex: p, lastSize: b }]) => [
798
+ $(a),
799
+ V(([c, { lastIndex: p }]) => c < p),
800
+ k(([c, { lastIndex: p, lastSize: b }]) => [
786
801
  {
787
802
  endIndex: p,
788
803
  size: b,
789
- startIndex: u
804
+ startIndex: c
790
805
  }
791
806
  ])
792
807
  ),
793
808
  n
794
- ), L(d, f);
795
- const T = gt(
809
+ ), z(d, f);
810
+ const I = gt(
796
811
  S(
797
812
  d,
798
- k((u) => u === void 0)
813
+ k((c) => c === void 0)
799
814
  ),
800
815
  !0
801
816
  );
802
- L(
817
+ z(
803
818
  S(
804
819
  f,
805
- W((u) => u !== void 0 && tt(lt(g).sizeTree)),
806
- k((u) => {
807
- const p = lt(v), b = lt(c).length > 0;
820
+ V((c) => c !== void 0 && J(tt(a).sizeTree)),
821
+ k((c) => {
822
+ const p = tt(x), b = tt(u).length > 0;
808
823
  return p !== void 0 && p !== 0 ? b ? [
809
824
  { endIndex: 0, size: p, startIndex: 0 },
810
- { endIndex: 1, size: u, startIndex: 1 }
811
- ] : [] : [{ endIndex: 0, size: u, startIndex: 0 }];
825
+ { endIndex: 1, size: c, startIndex: 1 }
826
+ ] : [] : [{ endIndex: 0, size: c, startIndex: 0 }];
812
827
  })
813
828
  ),
814
829
  n
815
- ), L(
830
+ ), z(
816
831
  S(
817
- m,
818
- W((u) => u !== void 0 && u.length > 0 && tt(lt(g).sizeTree)),
819
- k((u) => {
832
+ h,
833
+ V((c) => c !== void 0 && c.length > 0 && J(tt(a).sizeTree)),
834
+ k((c) => {
820
835
  const p = [];
821
- let b = u[0], z = 0;
822
- for (let F = 1; F < u.length; F++) {
823
- const O = u[F];
824
- O !== b && (p.push({
825
- endIndex: F - 1,
836
+ let b = c[0], O = 0;
837
+ for (let L = 1; L < c.length; L++) {
838
+ const F = c[L];
839
+ F !== b && (p.push({
840
+ endIndex: L - 1,
826
841
  size: b,
827
- startIndex: z
828
- }), b = O, z = F);
842
+ startIndex: O
843
+ }), b = F, O = L);
829
844
  }
830
845
  return p.push({
831
- endIndex: u.length - 1,
846
+ endIndex: c.length - 1,
832
847
  size: b,
833
- startIndex: z
848
+ startIndex: O
834
849
  }), p;
835
850
  })
836
851
  ),
837
852
  n
838
- ), L(
853
+ ), z(
839
854
  S(
840
- c,
841
- D(v, f),
842
- W(([, u, p]) => u !== void 0 && p !== void 0),
843
- k(([u, p, b]) => {
844
- const z = [];
845
- for (let F = 0; F < u.length; F++) {
846
- const O = u[F], V = u[F + 1];
847
- z.push({
848
- startIndex: O,
849
- endIndex: O,
855
+ u,
856
+ $(x, f),
857
+ V(([, c, p]) => c !== void 0 && p !== void 0),
858
+ k(([c, p, b]) => {
859
+ const O = [];
860
+ for (let L = 0; L < c.length; L++) {
861
+ const F = c[L], G = c[L + 1];
862
+ O.push({
863
+ startIndex: F,
864
+ endIndex: F,
850
865
  size: p
851
- }), V !== void 0 && z.push({
852
- startIndex: O + 1,
853
- endIndex: V - 1,
866
+ }), G !== void 0 && O.push({
867
+ startIndex: F + 1,
868
+ endIndex: G - 1,
854
869
  size: b
855
870
  });
856
871
  }
857
- return z;
872
+ return O;
858
873
  })
859
874
  ),
860
875
  n
861
876
  );
862
- const x = Ct(
877
+ const w = yt(
863
878
  S(
864
879
  n,
865
- D(g),
866
- Bt(
867
- ({ sizes: u }, [p, b]) => ({
868
- changed: b !== u,
880
+ $(a),
881
+ Ht(
882
+ ({ sizes: c }, [p, b]) => ({
883
+ changed: b !== c,
869
884
  sizes: b
870
885
  }),
871
- { changed: !1, sizes: I }
886
+ { changed: !1, sizes: g }
872
887
  ),
873
- k((u) => u.changed)
888
+ k((c) => c.changed)
874
889
  )
875
890
  );
876
891
  X(
877
892
  S(
878
893
  l,
879
- Bt(
880
- (u, p) => ({ diff: u.prev - p, prev: p }),
894
+ Ht(
895
+ (c, p) => ({ diff: c.prev - p, prev: p }),
881
896
  { diff: 0, prev: 0 }
882
897
  ),
883
- k((u) => u.diff)
898
+ k((c) => c.diff)
884
899
  ),
885
- (u) => {
886
- const { groupIndices: p } = lt(g);
887
- if (u > 0)
888
- M(e, !0), M(s, u + xn(u, p));
889
- else if (u < 0) {
890
- const b = lt(a);
891
- b.length > 0 && (u -= xn(-u, b)), M(i, u);
900
+ (c) => {
901
+ const { groupIndices: p } = tt(a);
902
+ if (c > 0)
903
+ _(e, !0), _(s, c + vn(c, p));
904
+ else if (c < 0) {
905
+ const b = tt(C);
906
+ b.length > 0 && (c -= vn(-c, b)), _(i, c);
892
907
  }
893
908
  }
894
- ), X(S(l, D(t)), ([u, p]) => {
895
- u < 0 && p(
909
+ ), X(S(l, $(t)), ([c, p]) => {
910
+ c < 0 && p(
896
911
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
897
912
  { firstItemIndex: l },
898
- mt.ERROR
913
+ ht.ERROR
899
914
  );
900
915
  });
901
- const C = Ct(s);
902
- L(
916
+ const B = yt(s);
917
+ z(
903
918
  S(
904
919
  s,
905
- D(g),
906
- k(([u, p]) => {
907
- const b = p.groupIndices.length > 0, z = [], F = p.lastSize;
920
+ $(a),
921
+ k(([c, p]) => {
922
+ const b = p.groupIndices.length > 0, O = [], L = p.lastSize;
908
923
  if (b) {
909
- const O = ie(p.sizeTree, 0);
910
- let V = 0, U = 0;
911
- for (; V < u; ) {
912
- const j = p.groupIndices[U], J = p.groupIndices.length === U + 1 ? 1 / 0 : p.groupIndices[U + 1] - j - 1;
913
- z.push({
914
- endIndex: j,
915
- size: O,
916
- startIndex: j
917
- }), z.push({
918
- endIndex: j + 1 + J - 1,
924
+ const F = ie(p.sizeTree, 0);
925
+ let G = 0, Z = 0;
926
+ for (; G < c; ) {
927
+ const K = p.groupIndices[Z], ct = p.groupIndices.length === Z + 1 ? 1 / 0 : p.groupIndices[Z + 1] - K - 1;
928
+ O.push({
929
+ endIndex: K,
919
930
  size: F,
920
- startIndex: j + 1
921
- }), U++, V += J + 1;
931
+ startIndex: K
932
+ }), O.push({
933
+ endIndex: K + 1 + ct - 1,
934
+ size: L,
935
+ startIndex: K + 1
936
+ }), Z++, G += ct + 1;
922
937
  }
923
- const q = Nt(p.sizeTree);
924
- return V !== u && q.shift(), q.reduce(
925
- (j, { k: J, v: dt }) => {
926
- let pt = j.ranges;
927
- return j.prevSize !== 0 && (pt = [
928
- ...j.ranges,
938
+ const W = $t(p.sizeTree);
939
+ return G !== c && W.shift(), W.reduce(
940
+ (K, { k: ct, v: ut }) => {
941
+ let It = K.ranges;
942
+ return K.prevSize !== 0 && (It = [
943
+ ...K.ranges,
929
944
  {
930
- endIndex: J + u - 1,
931
- size: j.prevSize,
932
- startIndex: j.prevIndex
945
+ endIndex: ct + c - 1,
946
+ size: K.prevSize,
947
+ startIndex: K.prevIndex
933
948
  }
934
949
  ]), {
935
- prevIndex: J + u,
936
- prevSize: dt,
937
- ranges: pt
950
+ prevIndex: ct + c,
951
+ prevSize: ut,
952
+ ranges: It
938
953
  };
939
954
  },
940
955
  {
941
- prevIndex: u,
956
+ prevIndex: c,
942
957
  prevSize: 0,
943
- ranges: z
958
+ ranges: O
944
959
  }
945
960
  ).ranges;
946
961
  }
947
- return Nt(p.sizeTree).reduce(
948
- (O, { k: V, v: U }) => ({
949
- prevIndex: V + u,
950
- prevSize: U,
951
- ranges: [...O.ranges, { endIndex: V + u - 1, size: O.prevSize, startIndex: O.prevIndex }]
962
+ return $t(p.sizeTree).reduce(
963
+ (F, { k: G, v: Z }) => ({
964
+ prevIndex: G + c,
965
+ prevSize: Z,
966
+ ranges: [...F.ranges, { endIndex: G + c - 1, size: F.prevSize, startIndex: F.prevIndex }]
952
967
  }),
953
968
  {
954
969
  prevIndex: 0,
955
- prevSize: F,
970
+ prevSize: L,
956
971
  ranges: []
957
972
  }
958
973
  ).ranges;
@@ -960,78 +975,79 @@ const _o = {
960
975
  ),
961
976
  n
962
977
  );
963
- const B = Ct(
978
+ const N = yt(
964
979
  S(
965
980
  i,
966
- D(g, R),
967
- k(([u, { offsetTree: p }, b]) => {
968
- const z = -u;
969
- return ce(z, p, b);
981
+ $(a, R),
982
+ k(([c, { offsetTree: p }, b]) => {
983
+ const O = -c;
984
+ return le(O, p, b);
970
985
  })
971
986
  )
972
987
  );
973
- return L(
988
+ return z(
974
989
  S(
975
990
  i,
976
- D(g, R),
977
- k(([u, p, b]) => {
991
+ $(a, R),
992
+ k(([c, p, b]) => {
978
993
  if (p.groupIndices.length > 0) {
979
- if (tt(p.sizeTree))
994
+ if (J(p.sizeTree))
980
995
  return p;
981
- let O = Yt();
982
- const V = lt(a);
983
- let U = 0, q = 0, $ = 0;
984
- for (; U < -u; ) {
985
- $ = V[q];
986
- const J = V[q + 1] - $ - 1;
987
- q++, U += J + 1;
996
+ let F = Dt();
997
+ const G = tt(C);
998
+ let Z = 0, W = 0, ft = 0;
999
+ for (; Z < -c; ) {
1000
+ ft = G[W];
1001
+ const ct = G[W + 1] - ft - 1;
1002
+ W++, Z += ct + 1;
988
1003
  }
989
- if (O = Nt(p.sizeTree).reduce((J, { k: dt, v: pt }) => vt(J, Math.max(0, dt + u), pt), O), U !== -u) {
990
- const J = ie(p.sizeTree, $);
991
- O = vt(O, 0, J);
992
- const dt = Rt(p.sizeTree, -u + 1)[1];
993
- O = vt(O, 1, dt);
1004
+ if (F = $t(p.sizeTree).reduce((ct, { k: ut, v: It }) => xt(ct, Math.max(0, ut + c), It), F), Z !== -c) {
1005
+ const ct = ie(p.sizeTree, ft);
1006
+ F = xt(F, 0, ct);
1007
+ const ut = kt(p.sizeTree, -c + 1)[1];
1008
+ F = xt(F, 1, ut);
994
1009
  }
995
1010
  return {
996
1011
  ...p,
997
- sizeTree: O,
998
- ...Ae(p.offsetTree, 0, O, b)
1012
+ sizeTree: F,
1013
+ ...Me(p.offsetTree, 0, F, b)
999
1014
  };
1000
1015
  }
1001
- const F = Nt(p.sizeTree).reduce((O, { k: V, v: U }) => vt(O, Math.max(0, V + u), U), Yt());
1016
+ const L = $t(p.sizeTree).reduce((F, { k: G, v: Z }) => xt(F, Math.max(0, G + c), Z), Dt());
1002
1017
  return {
1003
1018
  ...p,
1004
- sizeTree: F,
1005
- ...Ae(p.offsetTree, 0, F, b)
1019
+ sizeTree: L,
1020
+ ...Me(p.offsetTree, 0, L, b)
1006
1021
  };
1007
1022
  })
1008
1023
  ),
1009
- g
1024
+ a
1010
1025
  ), {
1011
- beforeUnshiftWith: C,
1026
+ beforeUnshiftWith: B,
1012
1027
  // input
1013
- data: y,
1028
+ data: v,
1014
1029
  defaultItemSize: f,
1015
1030
  firstItemIndex: l,
1016
1031
  fixedItemSize: d,
1017
- fixedGroupSize: v,
1032
+ fixedGroupSize: x,
1018
1033
  gap: R,
1019
- groupIndices: c,
1020
- heightEstimates: m,
1021
- itemSize: h,
1022
- listRefresh: x,
1034
+ groupIndices: u,
1035
+ heightEstimates: h,
1036
+ itemSize: m,
1037
+ listRefresh: w,
1038
+ resetSizes: T,
1023
1039
  shiftWith: i,
1024
- shiftWithOffset: B,
1040
+ shiftWithOffset: N,
1025
1041
  sizeRanges: n,
1026
1042
  // output
1027
- sizes: g,
1043
+ sizes: a,
1028
1044
  statefulTotalCount: r,
1029
1045
  totalCount: o,
1030
- trackItemSizes: T,
1046
+ trackItemSizes: I,
1031
1047
  unshiftWith: s
1032
1048
  };
1033
1049
  },
1034
- st(Gt, Ke),
1050
+ st(Mt, Ke),
1035
1051
  { singleton: !0 }
1036
1052
  );
1037
1053
  function No(t) {
@@ -1043,54 +1059,77 @@ function No(t) {
1043
1059
  }
1044
1060
  );
1045
1061
  }
1046
- const Yn = Z(
1047
- ([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
1048
- const s = K(), i = K(), l = Ct(S(s, k(No)));
1049
- return L(
1062
+ const Zn = Y(
1063
+ ([{ groupIndices: t, resetSizes: e, sizeRanges: n, sizes: o, statefulTotalCount: r, totalCount: s, trackItemSizes: i }, { headerHeight: l, scrollTop: u }]) => {
1064
+ const d = U(), f = U(), x = yt(S(d, k(No))), h = gt(
1050
1065
  S(
1051
- l,
1052
- k((c) => c.totalCount)
1066
+ n,
1067
+ $(r, t),
1068
+ V(([, m, v]) => m > v.length),
1069
+ Ct(!0)
1053
1070
  ),
1054
- n
1055
- ), L(
1071
+ !1
1072
+ );
1073
+ return z(
1056
1074
  S(
1057
- l,
1058
- k((c) => c.groupIndices)
1075
+ x,
1076
+ Ht(([, m], v) => [m, v], [
1077
+ { groupIndices: [], totalCount: 0 },
1078
+ { groupIndices: [], totalCount: 0 }
1079
+ ]),
1080
+ $(o, i, h),
1081
+ V(([[m, v], { sizeTree: R }, g, T]) => {
1082
+ const a = m.groupIndices.length > 0 && m.totalCount === m.groupIndices.length, C = v.totalCount > v.groupIndices.length;
1083
+ return g && !T && a && C && !J(R);
1084
+ }),
1085
+ Ct(null)
1086
+ ),
1087
+ e
1088
+ ), z(
1089
+ S(
1090
+ x,
1091
+ k((m) => m.totalCount)
1092
+ ),
1093
+ s
1094
+ ), z(
1095
+ S(
1096
+ x,
1097
+ k((m) => m.groupIndices)
1059
1098
  ),
1060
1099
  t
1061
- ), L(
1100
+ ), z(
1062
1101
  S(
1063
- at(r, e, o),
1064
- W(([c, d]) => Re(d)),
1065
- k(([c, d, f]) => Rt(d.groupOffsetTree, Math.max(c - f, 0), "v")[0]),
1102
+ mt(u, o, l),
1103
+ V(([m, v]) => He(v)),
1104
+ k(([m, v, R]) => kt(v.groupOffsetTree, Math.max(m - R, 0), "v")[0]),
1066
1105
  ot(),
1067
- k((c) => [c])
1106
+ k((m) => [m])
1068
1107
  ),
1069
- i
1070
- ), { groupCounts: s, topItemsIndexes: i };
1108
+ f
1109
+ ), { groupCounts: d, topItemsIndexes: f };
1071
1110
  },
1072
- st(Lt, St)
1073
- ), At = Z(
1111
+ st(zt, St)
1112
+ ), At = Y(
1074
1113
  ([{ log: t }]) => {
1075
- const e = w(!1), n = Ct(
1114
+ const e = y(!1), n = yt(
1076
1115
  S(
1077
1116
  e,
1078
- W((o) => o),
1117
+ V((o) => o),
1079
1118
  ot()
1080
1119
  )
1081
1120
  );
1082
1121
  return X(e, (o) => {
1083
- o && lt(t)("props updated", {}, mt.DEBUG);
1122
+ o && tt(t)("props updated", {}, ht.DEBUG);
1084
1123
  }), { didMount: n, propsReady: e };
1085
1124
  },
1086
- st(Gt),
1125
+ st(Mt),
1087
1126
  { singleton: !0 }
1088
1127
  ), Do = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
1089
- function Zn(t) {
1128
+ function Xn(t) {
1090
1129
  const e = typeof t == "number" ? { index: t } : { ...t };
1091
1130
  return e.align || (e.align = "start"), (!e.behavior || !Do) && (e.behavior = "auto"), e.offset === void 0 && (e.offset = 0), e;
1092
1131
  }
1093
- const fe = Z(
1132
+ const de = Y(
1094
1133
  ([
1095
1134
  { gap: t, listRefresh: e, sizes: n, totalCount: o },
1096
1135
  {
@@ -1098,59 +1137,59 @@ const fe = Z(
1098
1137
  fixedHeaderHeight: s,
1099
1138
  footerHeight: i,
1100
1139
  headerHeight: l,
1101
- scrollingInProgress: c,
1140
+ scrollingInProgress: u,
1102
1141
  scrollTo: d,
1103
1142
  smoothScrollTargetReached: f,
1104
- viewportHeight: v
1143
+ viewportHeight: x
1105
1144
  },
1106
- { log: m }
1145
+ { log: h }
1107
1146
  ]) => {
1108
- const h = K(), y = K(), R = w(0);
1109
- let I = null, g = null, a = null;
1110
- function T() {
1111
- I !== null && (I(), I = null), a !== null && (a(), a = null), g && (clearTimeout(g), g = null), M(c, !1);
1147
+ const m = U(), v = U(), R = y(0);
1148
+ let g = null, T = null, a = null;
1149
+ function C() {
1150
+ g !== null && (g(), g = null), a !== null && (a(), a = null), T && (clearTimeout(T), T = null), _(u, !1);
1112
1151
  }
1113
- return L(
1152
+ return z(
1114
1153
  S(
1115
- h,
1116
- D(n, v, o, R, l, i, m),
1117
- D(t, s, r),
1154
+ m,
1155
+ $(n, x, o, R, l, i, h),
1156
+ $(t, s, r),
1118
1157
  k(
1119
1158
  ([
1120
- [x, C, B, u, p, b, z, F],
1121
- O,
1122
- V,
1123
- U
1159
+ [I, w, B, N, c, p, b, O],
1160
+ L,
1161
+ F,
1162
+ G
1124
1163
  ]) => {
1125
- const q = Zn(x), { align: $, behavior: j, offset: J } = q, dt = u - 1, pt = qn(q, C, dt);
1126
- let It = ce(pt, C.offsetTree, O) + b;
1127
- $ === "end" ? (It += V + Rt(C.sizeTree, pt)[1] - B + U, pt === dt && (It += z)) : $ === "center" ? It += (V + Rt(C.sizeTree, pt)[1] - B + U) / 2 : It -= p, J !== void 0 && J !== 0 && (It += J);
1128
- const Ft = (ht) => {
1129
- T(), ht ? (F("retrying to scroll to", { location: x }, mt.DEBUG), M(h, x)) : (M(y, !0), F("list did not change, scroll successful", {}, mt.DEBUG));
1164
+ const Z = Xn(I), { align: W, behavior: ft, offset: K } = Z, ct = N - 1, ut = Yn(Z, w, ct);
1165
+ let It = le(ut, w.offsetTree, L) + p;
1166
+ W === "end" ? (It += F + kt(w.sizeTree, ut)[1] - B + G, ut === ct && (It += b)) : W === "center" ? It += (F + kt(w.sizeTree, ut)[1] - B + G) / 2 : It -= c, K !== void 0 && K !== 0 && (It += K);
1167
+ const Ft = (vt) => {
1168
+ C(), vt ? (O("retrying to scroll to", { location: I }, ht.DEBUG), _(m, I)) : (_(v, !0), O("list did not change, scroll successful", {}, ht.DEBUG));
1130
1169
  };
1131
- if (T(), j === "smooth") {
1132
- let ht = !1;
1133
- a = X(e, (jt) => {
1134
- ht = ht || jt;
1135
- }), I = bt(f, () => {
1136
- Ft(ht);
1170
+ if (C(), ft === "smooth") {
1171
+ let vt = !1;
1172
+ a = X(e, (Ot) => {
1173
+ vt = vt || Ot;
1174
+ }), g = Et(f, () => {
1175
+ Ft(vt);
1137
1176
  });
1138
1177
  } else
1139
- I = bt(S(e, $o(150)), Ft);
1140
- return g = setTimeout(() => {
1141
- T();
1142
- }, 1200), M(c, !0), F("scrolling from index to", { behavior: j, index: pt, top: It }, mt.DEBUG), { behavior: j, top: It };
1178
+ g = Et(S(e, $o(150)), Ft);
1179
+ return T = setTimeout(() => {
1180
+ C();
1181
+ }, 1200), _(u, !0), O("scrolling from index to", { behavior: ft, index: ut, top: It }, ht.DEBUG), { behavior: ft, top: It };
1143
1182
  }
1144
1183
  )
1145
1184
  ),
1146
1185
  d
1147
1186
  ), {
1148
- scrollTargetReached: y,
1149
- scrollToIndex: h,
1187
+ scrollTargetReached: v,
1188
+ scrollToIndex: m,
1150
1189
  topListHeight: R
1151
1190
  };
1152
1191
  },
1153
- st(Lt, St, Gt),
1192
+ st(zt, St, Mt),
1154
1193
  { singleton: !0 }
1155
1194
  );
1156
1195
  function $o(t) {
@@ -1174,61 +1213,61 @@ function Ye(t, e) {
1174
1213
  const n = e - 1, o = typeof t == "number" ? t : t.index === "LAST" ? n : t.index;
1175
1214
  return Math.max(0, Math.min(o, n));
1176
1215
  }
1177
- function Me(t) {
1216
+ function Ae(t) {
1178
1217
  return t === void 0 ? !0 : typeof t == "number" ? t === 0 : t.index === 0 && (t.align === void 0 || t.align === "start") && (t.offset === void 0 || t.offset === 0);
1179
1218
  }
1180
- const me = Z(
1219
+ const fe = Y(
1181
1220
  ([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
1182
- const l = w(!0), c = w(0), d = w(!0);
1183
- return L(
1221
+ const l = y(!0), u = y(0), d = y(!0);
1222
+ return z(
1184
1223
  S(
1185
1224
  i,
1186
- D(c),
1187
- W(([f, v]) => !Me(v)),
1188
- kt(!1)
1225
+ $(u),
1226
+ V(([f, x]) => !Ae(x)),
1227
+ Ct(!1)
1189
1228
  ),
1190
1229
  l
1191
- ), L(
1230
+ ), z(
1192
1231
  S(
1193
1232
  i,
1194
- D(c),
1195
- W(([f, v]) => !Me(v)),
1196
- kt(!1)
1233
+ $(u),
1234
+ V(([f, x]) => !Ae(x)),
1235
+ Ct(!1)
1197
1236
  ),
1198
1237
  d
1199
1238
  ), X(
1200
1239
  S(
1201
- at(e, i),
1202
- D(l, n, t, d),
1203
- W(([[, f], v, { sizeTree: m }, h, y]) => f && (!tt(m) || Ne(h)) && !v && !y),
1204
- D(c)
1240
+ mt(e, i),
1241
+ $(l, n, t, d),
1242
+ V(([[, f], x, { sizeTree: h }, m, v]) => f && (!J(h) || Ne(m)) && !x && !v),
1243
+ $(u)
1205
1244
  ),
1206
1245
  ([, f]) => {
1207
1246
  if (f === void 0) {
1208
- M(l, !0), M(d, !0);
1247
+ _(l, !0), _(d, !0);
1209
1248
  return;
1210
1249
  }
1211
- bt(r, () => {
1212
- M(d, !0);
1250
+ Et(r, () => {
1251
+ _(d, !0);
1213
1252
  }), qe(4, () => {
1214
- bt(o, () => {
1215
- M(l, !0);
1216
- }), M(s, f);
1253
+ Et(o, () => {
1254
+ _(l, !0);
1255
+ }), _(s, f);
1217
1256
  });
1218
1257
  }
1219
1258
  ), {
1220
1259
  initialItemFinalLocationReached: d,
1221
- initialTopMostItemIndex: c,
1260
+ initialTopMostItemIndex: u,
1222
1261
  scrolledToInitialItem: l
1223
1262
  };
1224
1263
  },
1225
- st(Lt, St, fe, At),
1264
+ st(zt, St, de, At),
1226
1265
  { singleton: !0 }
1227
1266
  );
1228
- function Xn(t, e) {
1267
+ function Jn(t, e) {
1229
1268
  return Math.abs(t - e) < 1.01;
1230
1269
  }
1231
- const ue = "up", ne = "down", Uo = "none", Ko = {
1270
+ const ce = "up", ne = "down", Uo = "none", Ko = {
1232
1271
  atBottom: !1,
1233
1272
  notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
1234
1273
  state: {
@@ -1237,154 +1276,154 @@ const ue = "up", ne = "down", Uo = "none", Ko = {
1237
1276
  scrollTop: 0,
1238
1277
  viewportHeight: 0
1239
1278
  }
1240
- }, jo = 0, pe = Z(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1241
- const i = w(!1), l = w(!0), c = K(), d = K(), f = w(4), v = w(jo), m = gt(
1279
+ }, jo = 0, me = Y(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
1280
+ const i = y(!1), l = y(!0), u = U(), d = U(), f = y(4), x = y(jo), h = gt(
1242
1281
  S(
1243
- Ve(S(P(r), Ut(1), kt(!0)), S(P(r), Ut(1), kt(!1), hn(100))),
1282
+ Te(S(P(r), jt(1), Ct(!0)), S(P(r), jt(1), Ct(!1), hn(100))),
1244
1283
  ot()
1245
1284
  ),
1246
1285
  !1
1247
- ), h = gt(
1248
- S(Ve(S(n, kt(!0)), S(n, kt(!1), hn(200))), ot()),
1286
+ ), m = gt(
1287
+ S(Te(S(n, Ct(!0)), S(n, Ct(!1), hn(200))), ot()),
1249
1288
  !1
1250
1289
  );
1251
- L(
1290
+ z(
1252
1291
  S(
1253
- at(P(r), P(v)),
1254
- k(([a, T]) => a <= T),
1292
+ mt(P(r), P(x)),
1293
+ k(([a, C]) => a <= C),
1255
1294
  ot()
1256
1295
  ),
1257
1296
  l
1258
- ), L(S(l, zt(50)), d);
1259
- const y = Ct(
1297
+ ), z(S(l, Wt(50)), d);
1298
+ const v = yt(
1260
1299
  S(
1261
- at(o, P(s), P(e), P(t), P(f)),
1262
- Bt((a, [{ scrollHeight: T, scrollTop: x }, C, B, u, p]) => {
1263
- const b = x + C - T > -p, z = {
1264
- scrollHeight: T,
1265
- scrollTop: x,
1266
- viewportHeight: C
1300
+ mt(o, P(s), P(e), P(t), P(f)),
1301
+ Ht((a, [{ scrollHeight: C, scrollTop: I }, w, B, N, c]) => {
1302
+ const p = I + w - C > -c, b = {
1303
+ scrollHeight: C,
1304
+ scrollTop: I,
1305
+ viewportHeight: w
1267
1306
  };
1268
- if (b) {
1269
- let O, V;
1270
- return x > a.state.scrollTop ? (O = "SCROLLED_DOWN", V = a.state.scrollTop - x) : (O = "SIZE_DECREASED", V = a.state.scrollTop - x || a.scrollTopDelta), {
1307
+ if (p) {
1308
+ let L, F;
1309
+ return I > a.state.scrollTop ? (L = "SCROLLED_DOWN", F = a.state.scrollTop - I) : (L = "SIZE_DECREASED", F = a.state.scrollTop - I || a.scrollTopDelta), {
1271
1310
  atBottom: !0,
1272
- atBottomBecause: O,
1273
- scrollTopDelta: V,
1274
- state: z
1311
+ atBottomBecause: L,
1312
+ scrollTopDelta: F,
1313
+ state: b
1275
1314
  };
1276
1315
  }
1277
- let F;
1278
- return z.scrollHeight > a.state.scrollHeight ? F = "SIZE_INCREASED" : C < a.state.viewportHeight ? F = "VIEWPORT_HEIGHT_DECREASING" : x < a.state.scrollTop ? F = "SCROLLING_UPWARDS" : F = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1316
+ let O;
1317
+ return b.scrollHeight > a.state.scrollHeight ? O = "SIZE_INCREASED" : w < a.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : I < a.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
1279
1318
  atBottom: !1,
1280
- notAtBottomBecause: F,
1281
- state: z
1319
+ notAtBottomBecause: O,
1320
+ state: b
1282
1321
  };
1283
1322
  }, Ko),
1284
- ot((a, T) => a !== void 0 && a.atBottom === T.atBottom)
1323
+ ot((a, C) => a !== void 0 && a.atBottom === C.atBottom)
1285
1324
  )
1286
1325
  ), R = gt(
1287
1326
  S(
1288
1327
  o,
1289
- Bt(
1290
- (a, { scrollHeight: T, scrollTop: x, viewportHeight: C }) => {
1291
- if (!Xn(a.scrollHeight, T)) {
1292
- const B = T - (x + C) < 1;
1293
- return a.scrollTop !== x && B ? {
1328
+ Ht(
1329
+ (a, { scrollHeight: C, scrollTop: I, viewportHeight: w }) => {
1330
+ if (!Jn(a.scrollHeight, C)) {
1331
+ const B = C - (I + w) < 1;
1332
+ return a.scrollTop !== I && B ? {
1294
1333
  changed: !0,
1295
- jump: a.scrollTop - x,
1296
- scrollHeight: T,
1297
- scrollTop: x
1334
+ jump: a.scrollTop - I,
1335
+ scrollHeight: C,
1336
+ scrollTop: I
1298
1337
  } : {
1299
1338
  changed: !0,
1300
1339
  jump: 0,
1301
- scrollHeight: T,
1302
- scrollTop: x
1340
+ scrollHeight: C,
1341
+ scrollTop: I
1303
1342
  };
1304
1343
  }
1305
1344
  return {
1306
1345
  changed: !1,
1307
1346
  jump: 0,
1308
- scrollHeight: T,
1309
- scrollTop: x
1347
+ scrollHeight: C,
1348
+ scrollTop: I
1310
1349
  };
1311
1350
  },
1312
1351
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
1313
1352
  ),
1314
- W((a) => a.changed),
1353
+ V((a) => a.changed),
1315
1354
  k((a) => a.jump)
1316
1355
  ),
1317
1356
  0
1318
1357
  );
1319
- L(
1358
+ z(
1320
1359
  S(
1321
- y,
1360
+ v,
1322
1361
  k((a) => a.atBottom)
1323
1362
  ),
1324
1363
  i
1325
- ), L(S(i, zt(50)), c);
1326
- const I = w(ne);
1327
- L(
1364
+ ), z(S(i, Wt(50)), u);
1365
+ const g = y(ne);
1366
+ z(
1328
1367
  S(
1329
1368
  o,
1330
1369
  k(({ scrollTop: a }) => a),
1331
1370
  ot(),
1332
- Bt(
1333
- (a, T) => lt(h) ? { direction: a.direction, prevScrollTop: T } : { direction: T < a.prevScrollTop ? ue : ne, prevScrollTop: T },
1371
+ Ht(
1372
+ (a, C) => tt(m) ? { direction: a.direction, prevScrollTop: C } : { direction: C < a.prevScrollTop ? ce : ne, prevScrollTop: C },
1334
1373
  { direction: ne, prevScrollTop: 0 }
1335
1374
  ),
1336
1375
  k((a) => a.direction)
1337
1376
  ),
1338
- I
1339
- ), L(S(o, zt(50), kt(Uo)), I);
1340
- const g = w(0);
1341
- return L(
1377
+ g
1378
+ ), z(S(o, Wt(50), Ct(Uo)), g);
1379
+ const T = y(0);
1380
+ return z(
1342
1381
  S(
1343
- m,
1344
- W((a) => !a),
1345
- kt(0)
1382
+ h,
1383
+ V((a) => !a),
1384
+ Ct(0)
1346
1385
  ),
1347
- g
1348
- ), L(
1386
+ T
1387
+ ), z(
1349
1388
  S(
1350
1389
  r,
1351
- zt(100),
1352
- D(m),
1353
- W(([a, T]) => T),
1354
- Bt(([a, T], [x]) => [T, x], [0, 0]),
1355
- k(([a, T]) => T - a)
1390
+ Wt(100),
1391
+ $(h),
1392
+ V(([a, C]) => C),
1393
+ Ht(([a, C], [I]) => [C, I], [0, 0]),
1394
+ k(([a, C]) => C - a)
1356
1395
  ),
1357
- g
1396
+ T
1358
1397
  ), {
1359
- atBottomState: y,
1360
- atBottomStateChange: c,
1398
+ atBottomState: v,
1399
+ atBottomStateChange: u,
1361
1400
  atBottomThreshold: f,
1362
1401
  atTopStateChange: d,
1363
- atTopThreshold: v,
1402
+ atTopThreshold: x,
1364
1403
  isAtBottom: i,
1365
1404
  isAtTop: l,
1366
- isScrolling: m,
1405
+ isScrolling: h,
1367
1406
  lastJumpDueToItemResize: R,
1368
- scrollDirection: I,
1369
- scrollVelocity: g
1407
+ scrollDirection: g,
1408
+ scrollVelocity: T
1370
1409
  };
1371
- }, st(St)), ae = "top", de = "bottom", vn = "none";
1372
- function Tn(t, e, n) {
1373
- return typeof t == "number" ? n === ue && e === ae || n === ne && e === de ? t : 0 : n === ue ? e === ae ? t.main : t.reverse : e === de ? t.main : t.reverse;
1410
+ }, st(St)), ue = "top", ae = "bottom", Tn = "none";
1411
+ function Cn(t, e, n) {
1412
+ return typeof t == "number" ? n === ce && e === ue || n === ne && e === ae ? t : 0 : n === ce ? e === ue ? t.main : t.reverse : e === ae ? t.main : t.reverse;
1374
1413
  }
1375
- function Cn(t, e) {
1414
+ function wn(t, e) {
1376
1415
  return typeof t == "number" ? t : t[e] ?? 0;
1377
1416
  }
1378
- const Ze = Z(
1417
+ const Ze = Y(
1379
1418
  ([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
1380
- const s = K(), i = w(0), l = w(0), c = w(0), d = gt(
1419
+ const s = U(), i = y(0), l = y(0), u = y(0), d = gt(
1381
1420
  S(
1382
- at(
1421
+ mt(
1383
1422
  P(o),
1384
1423
  P(r),
1385
1424
  P(n),
1386
- P(s, le),
1387
- P(c),
1425
+ P(s, Jt),
1426
+ P(u),
1388
1427
  P(i),
1389
1428
  P(e),
1390
1429
  P(t),
@@ -1393,26 +1432,26 @@ const Ze = Z(
1393
1432
  k(
1394
1433
  ([
1395
1434
  f,
1396
- v,
1397
- m,
1398
- [h, y],
1435
+ x,
1436
+ h,
1437
+ [m, v],
1399
1438
  R,
1400
- I,
1401
1439
  g,
1440
+ T,
1402
1441
  a,
1403
- T
1442
+ C
1404
1443
  ]) => {
1405
- const x = f - a, C = I + g, B = Math.max(m - x, 0);
1406
- let u = vn;
1407
- const p = Cn(T, ae), b = Cn(T, de);
1408
- return h -= a, h += m + g, y += m + g, y -= a, h > f + C - p && (u = ue), y < f - B + v + b && (u = ne), u !== vn ? [
1409
- Math.max(x - m - Tn(R, ae, u) - p, 0),
1410
- x - B - g + v + Tn(R, de, u) + b
1444
+ const I = f - a, w = g + T, B = Math.max(h - I, 0);
1445
+ let N = Tn;
1446
+ const c = wn(C, ue), p = wn(C, ae);
1447
+ return m -= a, m += h + T, v += h + T, v -= a, m > f + w - c && (N = ce), v < f - B + x + p && (N = ne), N !== Tn ? [
1448
+ Math.max(I - h - Cn(R, ue, N) - c, 0),
1449
+ I - B - T + x + Cn(R, ae, N) + p
1411
1450
  ] : null;
1412
1451
  }
1413
1452
  ),
1414
- W((f) => f !== null),
1415
- ot(le)
1453
+ V((f) => f !== null),
1454
+ ot(Jt)
1416
1455
  ),
1417
1456
  [0, 0]
1418
1457
  );
@@ -1420,7 +1459,7 @@ const Ze = Z(
1420
1459
  increaseViewportBy: l,
1421
1460
  // input
1422
1461
  listBoundary: s,
1423
- overscan: c,
1462
+ overscan: u,
1424
1463
  topListHeight: i,
1425
1464
  // output
1426
1465
  visibleRange: d
@@ -1429,17 +1468,20 @@ const Ze = Z(
1429
1468
  st(St),
1430
1469
  { singleton: !0 }
1431
1470
  );
1432
- function qo(t, e, n) {
1433
- if (Re(e)) {
1434
- const o = jn(t, e);
1471
+ function qo(t, e, n, o) {
1472
+ if (He(e)) {
1473
+ const r = o - e.groupIndices.length;
1474
+ if (r <= 0)
1475
+ return [{ index: e.groupIndices[0], offset: 0, size: 0 }];
1476
+ const s = qn(Math.min(t, r - 1), e);
1435
1477
  return [
1436
- { index: Rt(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
1437
- { data: n?.[0], index: o, offset: 0, size: 0 }
1478
+ { index: kt(e.groupOffsetTree, s)[0], offset: 0, size: 0 },
1479
+ { data: n?.[0], index: s, offset: 0, size: 0 }
1438
1480
  ];
1439
1481
  }
1440
1482
  return [{ data: n?.[0], index: t, offset: 0, size: 0 }];
1441
1483
  }
1442
- const Oe = {
1484
+ const Le = {
1443
1485
  bottom: 0,
1444
1486
  firstItemIndex: 0,
1445
1487
  items: [],
@@ -1451,58 +1493,58 @@ const Oe = {
1451
1493
  totalCount: 0
1452
1494
  };
1453
1495
  function ve(t, e, n, o, r, s) {
1454
- const { lastIndex: i, lastOffset: l, lastSize: c } = r;
1496
+ const { lastIndex: i, lastOffset: l, lastSize: u } = r;
1455
1497
  let d = 0, f = 0;
1456
1498
  if (t.length > 0) {
1457
1499
  d = t[0].offset;
1458
1500
  const R = t[t.length - 1];
1459
1501
  f = R.offset + R.size;
1460
1502
  }
1461
- const v = n - i, m = l + v * c + (v - 1) * o, h = d, y = m - f;
1503
+ const x = n - i, h = l + x * u + (x - 1) * o, m = d, v = h - f;
1462
1504
  return {
1463
1505
  bottom: f,
1464
1506
  firstItemIndex: s,
1465
- items: wn(t, r, s),
1466
- offsetBottom: y,
1507
+ items: yn(t, r, s),
1508
+ offsetBottom: v,
1467
1509
  offsetTop: d,
1468
- top: h,
1469
- topItems: wn(e, r, s),
1470
- topListHeight: e.reduce((R, I) => I.size + R, 0),
1510
+ top: m,
1511
+ topItems: yn(e, r, s),
1512
+ topListHeight: e.reduce((R, g) => g.size + R, 0),
1471
1513
  totalCount: n
1472
1514
  };
1473
1515
  }
1474
- function Jn(t, e, n, o, r, s) {
1516
+ function Qn(t, e, n, o, r, s) {
1475
1517
  let i = 0;
1476
1518
  if (n.groupIndices.length > 0)
1477
- for (const h of n.groupIndices) {
1478
- if (h - i >= t)
1519
+ for (const m of n.groupIndices) {
1520
+ if (m - i >= t)
1479
1521
  break;
1480
1522
  i++;
1481
1523
  }
1482
- const l = t + i, c = s !== void 0, d = s?.length ?? 0, f = Ye(e, c ? d : l), v = c ? Math.max(0, Math.min(l, d - f)) : l, m = Array.from({ length: v }).map((h, y) => ({
1483
- data: s?.[y + f],
1484
- index: y + f,
1524
+ const l = t + i, u = s !== void 0, d = s?.length ?? 0, f = Ye(e, u ? d : l), x = u ? Math.max(0, Math.min(l, d - f)) : l, h = Array.from({ length: x }).map((m, v) => ({
1525
+ data: s?.[v + f],
1526
+ index: v + f,
1485
1527
  offset: 0,
1486
1528
  size: 0
1487
1529
  }));
1488
- return ve(m, [], v, r, n, o);
1530
+ return ve(h, [], x, r, n, o);
1489
1531
  }
1490
- function wn(t, e, n) {
1532
+ function yn(t, e, n) {
1491
1533
  if (t.length === 0)
1492
1534
  return [];
1493
- if (!Re(e))
1535
+ if (!He(e))
1494
1536
  return t.map((d) => ({ ...d, index: d.index + n, originalIndex: d.index }));
1495
- const o = t[0].index, r = t[t.length - 1].index, s = [], i = Zt(e.groupOffsetTree, o, r);
1496
- let l, c = 0;
1537
+ const o = t[0].index, r = t[t.length - 1].index, s = [], i = Xt(e.groupOffsetTree, o, r);
1538
+ let l, u = 0;
1497
1539
  for (const d of t) {
1498
- (!l || l.end < d.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
1540
+ (!l || l.end < d.index) && (l = i.shift(), u = e.groupIndices.indexOf(l.start));
1499
1541
  let f;
1500
1542
  d.index === l.start ? f = {
1501
- index: c,
1543
+ index: u,
1502
1544
  type: "group"
1503
1545
  } : f = {
1504
- groupIndex: c,
1505
- index: d.index - (c + 1) + n
1546
+ groupIndex: u,
1547
+ index: d.index - (u + 1) + n
1506
1548
  }, s.push({
1507
1549
  ...f,
1508
1550
  data: d.data,
@@ -1513,28 +1555,35 @@ function wn(t, e, n) {
1513
1555
  }
1514
1556
  return s;
1515
1557
  }
1516
- function yn(t, e) {
1558
+ function bn(t, e) {
1517
1559
  return t === void 0 ? 0 : typeof t == "number" ? t : t[e] ?? 0;
1518
1560
  }
1519
- const Kt = Z(
1561
+ const qt = Y(
1520
1562
  ([
1521
1563
  { data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
1522
1564
  s,
1523
- { listBoundary: i, topListHeight: l, visibleRange: c },
1565
+ { listBoundary: i, topListHeight: l, visibleRange: u },
1524
1566
  { initialTopMostItemIndex: d, scrolledToInitialItem: f },
1525
- { topListHeight: v },
1526
- m,
1527
- { didMount: h },
1528
- { recalcInProgress: y }
1567
+ { topListHeight: x },
1568
+ h,
1569
+ { didMount: m },
1570
+ { recalcInProgress: v }
1529
1571
  ]) => {
1530
- const R = w([]), I = w(0), g = K(), a = w(0);
1531
- L(s.topItemsIndexes, R);
1532
- const T = gt(
1533
- S(
1534
- at(
1535
- h,
1536
- y,
1537
- P(c, le),
1572
+ const R = y([]), g = y(0), T = gt(
1573
+ S(
1574
+ o,
1575
+ V(({ sizeTree: c }) => !J(c)),
1576
+ Ct(!0)
1577
+ ),
1578
+ !1
1579
+ ), a = U(), C = y(0);
1580
+ z(s.topItemsIndexes, R);
1581
+ const I = gt(
1582
+ S(
1583
+ mt(
1584
+ m,
1585
+ v,
1586
+ P(u, Jt),
1538
1587
  P(r),
1539
1588
  P(o),
1540
1589
  P(d),
@@ -1542,406 +1591,412 @@ const Kt = Z(
1542
1591
  P(R),
1543
1592
  P(e),
1544
1593
  P(n),
1545
- P(a),
1594
+ P(C),
1546
1595
  t,
1547
- P(I)
1596
+ P(g)
1548
1597
  ),
1549
- W(([u, p, , b, , , , , , , , z]) => {
1550
- const F = z !== void 0 && z.length !== b;
1551
- return u && !p && !F;
1598
+ V(([c, p, , b, , , , , , , , O]) => {
1599
+ const L = O !== void 0 && O.length !== b;
1600
+ return c && !p && !L;
1552
1601
  }),
1553
1602
  k(
1554
1603
  ([
1555
1604
  ,
1556
1605
  ,
1557
- [u, p],
1606
+ [c, p],
1558
1607
  b,
1559
- z,
1560
- F,
1561
1608
  O,
1562
- V,
1563
- U,
1564
- q,
1565
- $,
1566
- j,
1567
- J
1609
+ L,
1610
+ F,
1611
+ G,
1612
+ Z,
1613
+ W,
1614
+ ft,
1615
+ K,
1616
+ ct
1568
1617
  ]) => {
1569
- const dt = z, { offsetTree: pt, sizeTree: It } = dt;
1618
+ const ut = O, { offsetTree: It, sizeTree: Ft } = ut;
1570
1619
  if (b === 0)
1571
- return { ...Oe, totalCount: b };
1572
- if (u === 0 && p === 0)
1573
- return J === 0 ? { ...Oe, totalCount: b } : Jn(J, F, z, U, q, j);
1574
- if (tt(It))
1575
- return J > 0 ? null : ve(
1576
- qo(Ye(F, b), dt, j),
1620
+ return { ...Le, totalCount: b };
1621
+ if (c === 0 && p === 0)
1622
+ return ct === 0 ? { ...Le, totalCount: b } : Qn(ct, L, O, Z, W, K);
1623
+ if (J(Ft))
1624
+ return ct > 0 && !tt(T) ? null : ve(
1625
+ qo(Ye(L, b), ut, K, b),
1577
1626
  [],
1578
1627
  b,
1579
- q,
1580
- dt,
1581
- U
1628
+ W,
1629
+ ut,
1630
+ Z
1582
1631
  );
1583
- const Ft = [];
1584
- if (V.length > 0) {
1585
- const N = V[0], Y = V[V.length - 1];
1586
- let it = 0;
1587
- for (const et of Zt(It, N, Y)) {
1588
- const Q = et.value, ct = Math.max(et.start, N), xt = Math.min(et.end, Y);
1589
- for (let ut = ct; ut <= xt; ut++)
1590
- Ft.push({ data: j?.[ut], index: ut, offset: it, size: Q }), it += Q;
1632
+ const vt = [];
1633
+ if (G.length > 0) {
1634
+ const q = G[0], Q = G[G.length - 1];
1635
+ let at = 0;
1636
+ for (const it of Xt(Ft, q, Q)) {
1637
+ const et = it.value, dt = Math.max(it.start, q), Tt = Math.min(it.end, Q);
1638
+ for (let lt = dt; lt <= Tt; lt++)
1639
+ vt.push({ data: K?.[lt], index: lt, offset: at, size: et }), at += et;
1591
1640
  }
1592
1641
  }
1593
- if (!O)
1594
- return ve([], Ft, b, q, dt, U);
1595
- const ht = V.length > 0 ? V[V.length - 1] + 1 : 0, jt = Po(pt, u, p, ht);
1596
- if (jt.length === 0)
1642
+ if (!F)
1643
+ return ve([], vt, b, W, ut, Z);
1644
+ const Ot = G.length > 0 ? G[G.length - 1] + 1 : 0, pe = Wo(It, c, p, Ot);
1645
+ if (pe.length === 0)
1597
1646
  return null;
1598
- const Qt = b - 1, Et = ye([], (N) => {
1599
- for (const Y of jt) {
1600
- const it = Y.value;
1601
- let et = it.offset, Q = Y.start;
1602
- const ct = it.size;
1603
- if (it.offset < u) {
1604
- Q += Math.floor((u - it.offset + q) / (ct + q));
1605
- const ut = Q - Y.start;
1606
- et += ut * ct + ut * q;
1647
+ const Yt = b - 1, Vt = be([], (q) => {
1648
+ for (const Q of pe) {
1649
+ const at = Q.value;
1650
+ let it = at.offset, et = Q.start;
1651
+ const dt = at.size;
1652
+ if (at.offset < c) {
1653
+ et += Math.floor((c - at.offset + W) / (dt + W));
1654
+ const lt = et - Q.start;
1655
+ it += lt * dt + lt * W;
1607
1656
  }
1608
- Q < ht && (et += (ht - Q) * ct, Q = ht);
1609
- const xt = Math.min(Y.end, Qt);
1610
- for (let ut = Q; ut <= xt && !(et >= p); ut++)
1611
- N.push({ data: j?.[ut], index: ut, offset: et, size: ct }), et += ct + q;
1657
+ et < Ot && (it += (Ot - et) * dt, et = Ot);
1658
+ const Tt = Math.min(Q.end, Yt);
1659
+ for (let lt = et; lt <= Tt && !(it >= p); lt++)
1660
+ q.push({ data: K?.[lt], index: lt, offset: it, size: dt }), it += dt + W;
1612
1661
  }
1613
- }), te = yn($, ae), H = yn($, de);
1614
- if (Et.length > 0 && (te > 0 || H > 0)) {
1615
- const N = Et[0], Y = Et[Et.length - 1];
1616
- if (te > 0 && N.index > ht) {
1617
- const it = Math.min(te, N.index - ht), et = [];
1618
- let Q = N.offset;
1619
- for (let ct = N.index - 1; ct >= N.index - it; ct--) {
1620
- const ut = Zt(It, ct, ct)[0]?.value ?? N.size;
1621
- Q -= ut + q, et.unshift({ data: j?.[ct], index: ct, offset: Q, size: ut });
1662
+ }), H = bn(ft, ue), j = bn(ft, ae);
1663
+ if (Vt.length > 0 && (H > 0 || j > 0)) {
1664
+ const q = Vt[0], Q = Vt[Vt.length - 1];
1665
+ if (H > 0 && q.index > Ot) {
1666
+ const at = Math.min(H, q.index - Ot), it = [];
1667
+ let et = q.offset;
1668
+ for (let dt = q.index - 1; dt >= q.index - at; dt--) {
1669
+ const lt = Xt(Ft, dt, dt)[0]?.value ?? q.size;
1670
+ et -= lt + W, it.unshift({ data: K?.[dt], index: dt, offset: et, size: lt });
1622
1671
  }
1623
- Et.unshift(...et);
1672
+ Vt.unshift(...it);
1624
1673
  }
1625
- if (H > 0 && Y.index < Qt) {
1626
- const it = Math.min(H, Qt - Y.index);
1627
- let et = Y.offset + Y.size + q;
1628
- for (let Q = Y.index + 1; Q <= Y.index + it; Q++) {
1629
- const xt = Zt(It, Q, Q)[0]?.value ?? Y.size;
1630
- Et.push({ data: j?.[Q], index: Q, offset: et, size: xt }), et += xt + q;
1674
+ if (j > 0 && Q.index < Yt) {
1675
+ const at = Math.min(j, Yt - Q.index);
1676
+ let it = Q.offset + Q.size + W;
1677
+ for (let et = Q.index + 1; et <= Q.index + at; et++) {
1678
+ const Tt = Xt(Ft, et, et)[0]?.value ?? Q.size;
1679
+ Vt.push({ data: K?.[et], index: et, offset: it, size: Tt }), it += Tt + W;
1631
1680
  }
1632
1681
  }
1633
1682
  }
1634
- return ve(Et, Ft, b, q, dt, U);
1683
+ return ve(Vt, vt, b, W, ut, Z);
1635
1684
  }
1636
1685
  ),
1637
1686
  //@ts-expect-error filter needs to be fixed
1638
- W((u) => u !== null),
1687
+ V((c) => c !== null),
1639
1688
  ot()
1640
1689
  ),
1641
- Oe
1690
+ Le
1642
1691
  );
1643
- L(
1692
+ z(
1644
1693
  S(
1645
1694
  t,
1646
- W(Ne),
1647
- k((u) => u?.length)
1695
+ V(Ne),
1696
+ k((c) => c?.length)
1648
1697
  ),
1649
1698
  r
1650
- ), L(
1699
+ ), z(
1651
1700
  S(
1652
- T,
1653
- k((u) => u.topListHeight)
1701
+ I,
1702
+ k((c) => c.topListHeight)
1654
1703
  ),
1655
- v
1656
- ), L(v, l), L(
1704
+ x
1705
+ ), z(x, l), z(
1657
1706
  S(
1658
- T,
1659
- k((u) => [u.top, u.bottom])
1707
+ I,
1708
+ k((c) => [c.top, c.bottom])
1660
1709
  ),
1661
1710
  i
1662
- ), L(
1711
+ ), z(
1663
1712
  S(
1664
- T,
1665
- k((u) => u.items)
1713
+ I,
1714
+ k((c) => c.items)
1666
1715
  ),
1667
- g
1716
+ a
1668
1717
  );
1669
- const x = Ct(
1670
- S(
1671
- T,
1672
- W(({ items: u }) => u.length > 0),
1673
- D(r, t),
1674
- W(([{ items: u }, p]) => u[u.length - 1].originalIndex === p - 1),
1675
- k(([, u, p]) => [u - 1, p]),
1676
- ot(le),
1677
- k(([u]) => u)
1718
+ const w = yt(
1719
+ S(
1720
+ I,
1721
+ V(({ items: c }) => c.length > 0),
1722
+ $(r, t),
1723
+ V(([{ items: c }, p]) => c[c.length - 1].originalIndex === p - 1),
1724
+ k(([{ items: c }, p, b]) => {
1725
+ const O = c[c.length - 1], L = O.type === "group" ? O.index + 1 : (O.groupIndex ?? -1) + 1;
1726
+ return [p - 1 - L, b];
1727
+ }),
1728
+ ot(Jt),
1729
+ // when every group is empty, only headers render and there is no item index to report.
1730
+ // Filter after the distinct check, so that the same index fires again once an item returns.
1731
+ V(([c]) => c >= 0),
1732
+ k(([c]) => c)
1678
1733
  )
1679
- ), C = Ct(
1734
+ ), B = yt(
1680
1735
  S(
1681
- T,
1682
- zt(200),
1683
- W(({ items: u, topItems: p }) => u.length > 0 && u[0].originalIndex === p.length),
1684
- k(({ items: u }) => u[0].index),
1736
+ I,
1737
+ Wt(200),
1738
+ V(({ items: c, topItems: p }) => c.length > 0 && c[0].originalIndex === p.length),
1739
+ k(({ items: c }) => c[0].index),
1685
1740
  ot()
1686
1741
  )
1687
- ), B = Ct(
1742
+ ), N = yt(
1688
1743
  S(
1689
- T,
1690
- W(({ items: u }) => u.length > 0),
1744
+ I,
1745
+ V(({ items: c }) => c.length > 0),
1691
1746
  // oxlint-disable-next-line array-callback-return -- callback always returns after trimming group sentinels
1692
- k(({ items: u }) => {
1693
- let p = 0, b = u.length - 1;
1694
- for (; u[p].type === "group" && p < b; )
1747
+ k(({ items: c }) => {
1748
+ let p = 0, b = c.length - 1;
1749
+ for (; c[p].type === "group" && p < b; )
1695
1750
  p++;
1696
- for (; u[b].type === "group" && b > p; )
1751
+ for (; c[b].type === "group" && b > p; )
1697
1752
  b--;
1698
1753
  return {
1699
- endIndex: u[b].index,
1700
- startIndex: u[p].index
1754
+ endIndex: c[b].index,
1755
+ startIndex: c[p].index
1701
1756
  };
1702
1757
  }),
1703
- ot(Un)
1758
+ ot(Kn)
1704
1759
  )
1705
1760
  );
1706
1761
  return {
1707
- endReached: x,
1708
- initialItemCount: I,
1709
- itemsRendered: g,
1710
- listState: T,
1711
- minOverscanItemCount: a,
1712
- rangeChanged: B,
1713
- startReached: C,
1762
+ endReached: w,
1763
+ initialItemCount: g,
1764
+ itemsRendered: a,
1765
+ listState: I,
1766
+ minOverscanItemCount: C,
1767
+ rangeChanged: N,
1768
+ startReached: B,
1714
1769
  topItemsIndexes: R,
1715
- ...m
1770
+ ...h
1716
1771
  };
1717
1772
  },
1718
1773
  st(
1719
- Lt,
1720
- Yn,
1774
+ zt,
1775
+ Zn,
1721
1776
  Ze,
1722
- me,
1723
1777
  fe,
1724
- pe,
1778
+ de,
1779
+ me,
1725
1780
  At,
1726
1781
  Ke
1727
1782
  ),
1728
1783
  { singleton: !0 }
1729
- ), Qn = Z(
1784
+ ), to = Y(
1730
1785
  ([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
1731
- const s = K(), i = gt(
1786
+ const s = U(), i = gt(
1732
1787
  S(
1733
- at(n, t, o, e, r),
1734
- k(([l, c, d, f, v]) => l + c + d + f + v.offsetBottom + v.bottom)
1788
+ mt(n, t, o, e, r),
1789
+ k(([l, u, d, f, x]) => l + u + d + f + x.offsetBottom + x.bottom)
1735
1790
  ),
1736
1791
  0
1737
1792
  );
1738
- return L(P(i), s), { totalListHeight: i, totalListHeightChanged: s };
1793
+ return z(P(i), s), { totalListHeight: i, totalListHeightChanged: s };
1739
1794
  },
1740
- st(St, Kt),
1795
+ st(St, qt),
1741
1796
  { singleton: !0 }
1742
- ), Yo = Z(
1797
+ ), Yo = Y(
1743
1798
  ([{ viewportHeight: t }, { totalListHeight: e }]) => {
1744
- const n = w(!1), o = gt(
1799
+ const n = y(!1), o = gt(
1745
1800
  S(
1746
- at(n, t, e),
1747
- W(([r]) => r),
1801
+ mt(n, t, e),
1802
+ V(([r]) => r),
1748
1803
  k(([, r, s]) => Math.max(0, r - s)),
1749
- zt(0),
1804
+ Wt(0),
1750
1805
  ot()
1751
1806
  ),
1752
1807
  0
1753
1808
  );
1754
1809
  return { alignToBottom: n, paddingTopAddition: o };
1755
1810
  },
1756
- st(St, Qn),
1811
+ st(St, to),
1757
1812
  { singleton: !0 }
1758
- ), to = Z(() => ({
1759
- context: w(null)
1813
+ ), eo = Y(() => ({
1814
+ context: y(null)
1760
1815
  })), Zo = ({
1761
1816
  itemBottom: t,
1762
1817
  itemTop: e,
1763
1818
  locationParams: { align: n, behavior: o, ...r },
1764
1819
  viewportBottom: s,
1765
1820
  viewportTop: i
1766
- }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, eo = Z(
1821
+ }) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, no = Y(
1767
1822
  ([
1768
1823
  { gap: t, sizes: e, totalCount: n },
1769
- { fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
1824
+ { fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: u },
1770
1825
  { scrollToIndex: d }
1771
1826
  ]) => {
1772
- const f = K();
1773
- return L(
1827
+ const f = U();
1828
+ return z(
1774
1829
  S(
1775
1830
  f,
1776
- D(e, c, n, s, r, o, l),
1777
- D(t),
1778
- k(([[v, m, h, y, R, I, g, a], T]) => {
1779
- const { calculateViewLocation: x = Zo, done: C, ...B } = v, u = qn(v, m, y - 1), p = ce(u, m.offsetTree, T) + R + I, b = p + Rt(m.sizeTree, u)[1], z = a + I, F = a + h - g, O = x({
1780
- itemBottom: b,
1781
- itemTop: p,
1831
+ $(e, u, n, s, r, o, l),
1832
+ $(t),
1833
+ k(([[x, h, m, v, R, g, T, a], C]) => {
1834
+ const { calculateViewLocation: I = Zo, done: w, ...B } = x, N = Yn(x, h, v - 1), c = le(N, h.offsetTree, C) + R + g, p = c + kt(h.sizeTree, N)[1], b = a + g, O = a + m - T, L = I({
1835
+ itemBottom: p,
1836
+ itemTop: c,
1782
1837
  locationParams: B,
1783
- viewportBottom: F,
1784
- viewportTop: z
1838
+ viewportBottom: O,
1839
+ viewportTop: b
1785
1840
  });
1786
- return O === null ? C?.() : C && bt(
1841
+ return L === null ? w?.() : w && Et(
1787
1842
  S(
1788
1843
  i,
1789
- W((V) => !V),
1844
+ V((F) => !F),
1790
1845
  // skips the initial publish of false, and the cleanup call.
1791
1846
  // but if scrollingInProgress is true, we skip the initial publish.
1792
- Ut(lt(i) ? 1 : 2)
1847
+ jt(tt(i) ? 1 : 2)
1793
1848
  ),
1794
- C
1795
- ), O;
1849
+ w
1850
+ ), L;
1796
1851
  }),
1797
- W((v) => v !== null)
1852
+ V((x) => x !== null)
1798
1853
  ),
1799
1854
  d
1800
1855
  ), {
1801
1856
  scrollIntoView: f
1802
1857
  };
1803
1858
  },
1804
- st(Lt, St, fe, Kt, Gt),
1859
+ st(zt, St, de, qt, Mt),
1805
1860
  { singleton: !0 }
1806
1861
  );
1807
- function bn(t) {
1862
+ function Rn(t) {
1808
1863
  return t === !1 ? !1 : t === "smooth" ? "smooth" : "auto";
1809
1864
  }
1810
- const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
1865
+ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
1811
1866
  ([
1812
1867
  { listRefresh: t, totalCount: e, fixedItemSize: n, data: o },
1813
1868
  { atBottomState: r, isAtBottom: s },
1814
1869
  { scrollToIndex: i },
1815
1870
  { scrolledToInitialItem: l },
1816
- { didMount: c, propsReady: d },
1871
+ { didMount: u, propsReady: d },
1817
1872
  { log: f },
1818
- { scrollingInProgress: v },
1819
- { context: m },
1820
- { scrollIntoView: h }
1873
+ { scrollingInProgress: x },
1874
+ { context: h },
1875
+ { scrollIntoView: m }
1821
1876
  ]) => {
1822
- const y = w(!1), R = K();
1823
- let I = null;
1824
- function g(C) {
1825
- M(i, {
1877
+ const v = y(!1), R = U();
1878
+ let g = null;
1879
+ function T(w) {
1880
+ _(i, {
1826
1881
  align: "end",
1827
- behavior: C,
1882
+ behavior: w,
1828
1883
  index: "LAST"
1829
1884
  });
1830
1885
  }
1831
1886
  X(
1832
1887
  S(
1833
- at(S(P(e), Ut(1)), c),
1834
- D(P(y), s, l, v),
1835
- k(([[C, B], u, p, b, z]) => {
1836
- let F = B && b, O = "auto";
1837
- return F && (O = Xo(u, p || z), F = F && O !== !1), { followOutputBehavior: O, shouldFollow: F, totalCount: C };
1888
+ mt(S(P(e), jt(1)), u),
1889
+ $(P(v), s, l, x),
1890
+ k(([[w, B], N, c, p, b]) => {
1891
+ let O = B && p, L = "auto";
1892
+ return O && (L = Xo(N, c || b), O = O && L !== !1), { followOutputBehavior: L, shouldFollow: O, totalCount: w };
1838
1893
  }),
1839
- W(({ shouldFollow: C }) => C)
1894
+ V(({ shouldFollow: w }) => w)
1840
1895
  ),
1841
- ({ followOutputBehavior: C, totalCount: B }) => {
1842
- I !== null && (I(), I = null), lt(n) === void 0 ? I = bt(t, () => {
1843
- lt(f)("following output to ", { totalCount: B }, mt.DEBUG), g(C), I = null;
1896
+ ({ followOutputBehavior: w, totalCount: B }) => {
1897
+ g !== null && (g(), g = null), tt(n) === void 0 ? g = Et(t, () => {
1898
+ tt(f)("following output to ", { totalCount: B }, ht.DEBUG), T(w), g = null;
1844
1899
  }) : requestAnimationFrame(() => {
1845
- lt(f)("following output to ", { totalCount: B }, mt.DEBUG), g(C);
1900
+ tt(f)("following output to ", { totalCount: B }, ht.DEBUG), T(w);
1846
1901
  });
1847
1902
  }
1848
1903
  );
1849
- function a(C) {
1850
- const B = bt(r, (u) => {
1851
- C && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && I === null && (lt(f)("scrolling to bottom due to increased size", {}, mt.DEBUG), g("auto"));
1904
+ function a(w) {
1905
+ const B = Et(r, (N) => {
1906
+ w && !N.atBottom && N.notAtBottomBecause === "SIZE_INCREASED" && g === null && (tt(f)("scrolling to bottom due to increased size", {}, ht.DEBUG), T("auto"));
1852
1907
  });
1853
1908
  setTimeout(B, 100);
1854
1909
  }
1855
1910
  X(
1856
1911
  S(
1857
- at(P(y), e, d),
1858
- W(([C, , B]) => C !== !1 && B),
1859
- Bt(
1860
- ({ value: C }, [, B]) => ({ refreshed: C === B, value: B }),
1912
+ mt(P(v), e, d),
1913
+ V(([w, , B]) => w !== !1 && B),
1914
+ Ht(
1915
+ ({ value: w }, [, B]) => ({ refreshed: w === B, value: B }),
1861
1916
  { refreshed: !1, value: 0 }
1862
1917
  ),
1863
- W(({ refreshed: C }) => C),
1864
- D(y, e)
1918
+ V(({ refreshed: w }) => w),
1919
+ $(v, e)
1865
1920
  ),
1866
- ([, C]) => {
1867
- lt(l) && a(C !== !1);
1921
+ ([, w]) => {
1922
+ tt(l) && a(w !== !1);
1868
1923
  }
1869
1924
  ), X(R, () => {
1870
- a(lt(y) !== !1);
1871
- }), X(at(P(y), r), ([C, B]) => {
1872
- C !== !1 && !B.atBottom && B.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
1925
+ a(tt(v) !== !1);
1926
+ }), X(mt(P(v), r), ([w, B]) => {
1927
+ w !== !1 && !B.atBottom && B.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && T("auto");
1873
1928
  });
1874
- const T = w(null), x = K();
1875
- return L(
1876
- Ve(
1929
+ const C = y(null), I = U();
1930
+ return z(
1931
+ Te(
1877
1932
  S(
1878
1933
  P(o),
1879
- k((C) => C?.length ?? 0)
1934
+ k((w) => w?.length ?? 0)
1880
1935
  ),
1881
1936
  S(P(e))
1882
1937
  ),
1883
- x
1938
+ I
1884
1939
  ), X(
1885
1940
  S(
1886
- at(S(x, Ut(1)), c),
1887
- D(P(T), l, v, m),
1888
- k(([[C, B], u, p, b, z]) => B && p && u?.({ context: z, totalCount: C, scrollingInProgress: b })),
1889
- W((C) => !!C),
1890
- zt(0)
1941
+ mt(S(I, jt(1)), u),
1942
+ $(P(C), l, x, h),
1943
+ k(([[w, B], N, c, p, b]) => B && c && N?.({ context: b, totalCount: w, scrollingInProgress: p })),
1944
+ V((w) => !!w),
1945
+ Wt(0)
1891
1946
  ),
1892
- (C) => {
1893
- I !== null && (I(), I = null), lt(n) === void 0 ? I = bt(t, () => {
1894
- lt(f)("scrolling into view", {}), M(h, C), I = null;
1947
+ (w) => {
1948
+ g !== null && (g(), g = null), tt(n) === void 0 ? g = Et(t, () => {
1949
+ tt(f)("scrolling into view", {}), _(m, w), g = null;
1895
1950
  }) : requestAnimationFrame(() => {
1896
- lt(f)("scrolling into view", {}), M(h, C);
1951
+ tt(f)("scrolling into view", {}), _(m, w);
1897
1952
  });
1898
1953
  }
1899
- ), { autoscrollToBottom: R, followOutput: y, scrollIntoViewOnChange: T };
1954
+ ), { autoscrollToBottom: R, followOutput: v, scrollIntoViewOnChange: C };
1900
1955
  },
1901
1956
  st(
1902
- Lt,
1903
- pe,
1904
- fe,
1957
+ zt,
1905
1958
  me,
1959
+ de,
1960
+ fe,
1906
1961
  At,
1907
- Gt,
1962
+ Mt,
1908
1963
  St,
1909
- to,
1910
- eo
1964
+ eo,
1965
+ no
1911
1966
  )
1912
- ), Qo = Z(
1913
- ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (L(
1967
+ ), Qo = Y(
1968
+ ([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (z(
1914
1969
  S(
1915
1970
  l,
1916
- D(s),
1917
- W(([, c]) => c !== 0),
1918
- D(r, o, e, n, t),
1919
- k(([[, c], d, f, v, m, h]) => Jn(c, d, f, v, m, h))
1971
+ $(s),
1972
+ V(([, u]) => u !== 0),
1973
+ $(r, o, e, n, t),
1974
+ k(([[, u], d, f, x, h, m]) => Qn(u, d, f, x, h, m))
1920
1975
  ),
1921
1976
  i
1922
1977
  ), {}),
1923
- st(Lt, me, Kt, At),
1978
+ st(zt, fe, qt, At),
1924
1979
  { singleton: !0 }
1925
- ), tr = Z(
1980
+ ), tr = Y(
1926
1981
  ([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
1927
- const o = w(0);
1982
+ const o = y(0);
1928
1983
  return X(
1929
1984
  S(
1930
1985
  t,
1931
- D(o),
1932
- W(([, r]) => r !== 0),
1986
+ $(o),
1987
+ V(([, r]) => r !== 0),
1933
1988
  k(([, r]) => ({ top: r }))
1934
1989
  ),
1935
1990
  (r) => {
1936
- bt(
1991
+ Et(
1937
1992
  S(
1938
1993
  n,
1939
- Ut(1),
1940
- W((s) => s.items.length > 1)
1994
+ jt(1),
1995
+ V((s) => s.items.length > 1)
1941
1996
  ),
1942
1997
  () => {
1943
1998
  requestAnimationFrame(() => {
1944
- M(e, r);
1999
+ _(e, r);
1945
2000
  });
1946
2001
  }
1947
2002
  );
@@ -1950,22 +2005,22 @@ const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
1950
2005
  initialScrollTop: o
1951
2006
  };
1952
2007
  },
1953
- st(At, St, Kt),
2008
+ st(At, St, qt),
1954
2009
  { singleton: !0 }
1955
- ), no = Z(
2010
+ ), oo = Y(
1956
2011
  ([{ scrollVelocity: t }]) => {
1957
- const e = w(!1), n = K(), o = w(!1);
1958
- return L(
2012
+ const e = y(!1), n = U(), o = y(!1);
2013
+ return z(
1959
2014
  S(
1960
2015
  t,
1961
- D(o, e, n),
1962
- W(([r, s]) => s !== !1 && s !== void 0),
2016
+ $(o, e, n),
2017
+ V(([r, s]) => s !== !1 && s !== void 0),
1963
2018
  k(([r, s, i, l]) => {
1964
- const { enter: c, exit: d } = s;
2019
+ const { enter: u, exit: d } = s;
1965
2020
  if (i) {
1966
2021
  if (d(r, l))
1967
2022
  return !1;
1968
- } else if (c(r, l))
2023
+ } else if (u(r, l))
1969
2024
  return !0;
1970
2025
  return i;
1971
2026
  }),
@@ -1973,33 +2028,33 @@ const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
1973
2028
  ),
1974
2029
  e
1975
2030
  ), X(
1976
- S(at(e, t, n), D(o)),
2031
+ S(mt(e, t, n), $(o)),
1977
2032
  ([[r, s, i], l]) => {
1978
2033
  r && l !== !1 && l !== void 0 && l.change && l.change(s, i);
1979
2034
  }
1980
2035
  ), { isSeeking: e, scrollSeekConfiguration: o, scrollSeekRangeChanged: n, scrollVelocity: t };
1981
2036
  },
1982
- st(pe),
2037
+ st(me),
1983
2038
  { singleton: !0 }
1984
- ), Xe = Z(([{ scrollContainerState: t, scrollTo: e }]) => {
1985
- const n = K(), o = K(), r = K(), s = w(!1), i = w(void 0);
1986
- return L(
2039
+ ), Xe = Y(([{ scrollContainerState: t, scrollTo: e }]) => {
2040
+ const n = U(), o = U(), r = U(), s = y(!1), i = y(void 0);
2041
+ return z(
1987
2042
  S(
1988
- at(n, o),
1989
- k(([{ scrollTop: l, viewportHeight: c }, { offsetTop: d, listHeight: f }]) => ({
2043
+ mt(n, o),
2044
+ k(([{ scrollTop: l, viewportHeight: u }, { offsetTop: d, listHeight: f }]) => ({
1990
2045
  scrollHeight: f,
1991
2046
  scrollTop: Math.max(0, l - d),
1992
- viewportHeight: c
2047
+ viewportHeight: u
1993
2048
  }))
1994
2049
  ),
1995
2050
  t
1996
- ), L(
2051
+ ), z(
1997
2052
  S(
1998
2053
  e,
1999
- D(o),
2000
- k(([l, { offsetTop: c }]) => ({
2054
+ $(o),
2055
+ k(([l, { offsetTop: u }]) => ({
2001
2056
  ...l,
2002
- top: l.top + c
2057
+ top: l.top + u
2003
2058
  }))
2004
2059
  ),
2005
2060
  r
@@ -2013,31 +2068,31 @@ const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
2013
2068
  windowScrollTo: r,
2014
2069
  windowViewportRect: o
2015
2070
  };
2016
- }, st(St)), er = Z(
2071
+ }, st(St)), er = Y(
2017
2072
  ([
2018
2073
  { sizeRanges: t, sizes: e },
2019
2074
  { headerHeight: n, scrollTop: o },
2020
2075
  { initialTopMostItemIndex: r },
2021
2076
  { didMount: s },
2022
- { useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
2077
+ { useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: u }
2023
2078
  ]) => {
2024
- const d = K(), f = w(void 0), v = w(null), m = w(null);
2025
- return L(l, v), L(c, m), X(
2079
+ const d = U(), f = y(void 0), x = y(null), h = y(null);
2080
+ return z(l, x), z(u, h), X(
2026
2081
  S(
2027
2082
  d,
2028
- D(e, o, i, v, m, n)
2083
+ $(e, o, i, x, h, n)
2029
2084
  ),
2030
- ([h, y, R, I, g, a, T]) => {
2031
- const x = Go(y.sizeTree);
2032
- I && g !== null && a !== null && (R = g.scrollTop - a.offsetTop), R -= T, h({ ranges: x, scrollTop: R });
2085
+ ([m, v, R, g, T, a, C]) => {
2086
+ const I = Go(v.sizeTree);
2087
+ g && T !== null && a !== null && (R = T.scrollTop - a.offsetTop), R -= C, m({ ranges: I, scrollTop: R });
2033
2088
  }
2034
- ), L(S(f, W(Ne), k(nr)), r), L(
2089
+ ), z(S(f, V(Ne), k(nr)), r), z(
2035
2090
  S(
2036
2091
  s,
2037
- D(f),
2038
- W(([, h]) => h !== void 0),
2092
+ $(f),
2093
+ V(([, m]) => m !== void 0),
2039
2094
  ot(),
2040
- k(([, h]) => h.ranges)
2095
+ k(([, m]) => m.ranges)
2041
2096
  ),
2042
2097
  t
2043
2098
  ), {
@@ -2045,112 +2100,112 @@ const Xo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Jo = Z(
2045
2100
  restoreStateFrom: f
2046
2101
  };
2047
2102
  },
2048
- st(Lt, St, me, At, Xe)
2103
+ st(zt, St, fe, At, Xe)
2049
2104
  );
2050
2105
  function nr(t) {
2051
2106
  return { align: "start", index: 0, offset: t.scrollTop };
2052
2107
  }
2053
- const or = Z(([{ topItemsIndexes: t }]) => {
2054
- const e = w(0);
2055
- return L(
2108
+ const or = Y(([{ topItemsIndexes: t }]) => {
2109
+ const e = y(0);
2110
+ return z(
2056
2111
  S(
2057
2112
  e,
2058
- W((n) => n >= 0),
2113
+ V((n) => n >= 0),
2059
2114
  k((n) => Array.from({ length: n }).map((o, r) => r))
2060
2115
  ),
2061
2116
  t
2062
2117
  ), { topItemCount: e };
2063
- }, st(Kt));
2064
- function oo(t) {
2118
+ }, st(qt));
2119
+ function ro(t) {
2065
2120
  let e = !1, n;
2066
2121
  return (() => (e || (e = !0, n = t()), n));
2067
2122
  }
2068
- const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = Z(
2123
+ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), sr = Y(
2069
2124
  ([
2070
2125
  { deviation: t, deviationCommitted: e, scrollBy: n, scrollingInProgress: o, scrollTop: r },
2071
- { isAtBottom: s, isScrolling: i, lastJumpDueToItemResize: l, scrollDirection: c },
2126
+ { isAtBottom: s, isScrolling: i, lastJumpDueToItemResize: l, scrollDirection: u },
2072
2127
  { listState: d },
2073
- { beforeUnshiftWith: f, gap: v, shiftWithOffset: m, sizes: h },
2074
- { log: y },
2128
+ { beforeUnshiftWith: f, gap: x, shiftWithOffset: h, sizes: m },
2129
+ { log: v },
2075
2130
  { recalcInProgress: R }
2076
2131
  ]) => {
2077
- const I = Ct(
2132
+ const g = yt(
2078
2133
  S(
2079
2134
  d,
2080
- D(l),
2081
- Bt(
2082
- ([, x, C, B], [{ bottom: u, items: p, offsetBottom: b, totalCount: z }, F]) => {
2083
- const O = u + b;
2084
- let V = 0;
2085
- return C === z && x.length > 0 && p.length > 0 && (p[0].originalIndex === 0 && x[0].originalIndex === 0 || (V = O - B, V !== 0 && (V += F))), [V, p, z, O];
2135
+ $(l),
2136
+ Ht(
2137
+ ([, I, w, B], [{ bottom: N, items: c, offsetBottom: p, totalCount: b }, O]) => {
2138
+ const L = N + p;
2139
+ let F = 0;
2140
+ return w === b && I.length > 0 && c.length > 0 && (c[0].originalIndex === 0 && I[0].originalIndex === 0 || (F = L - B, F !== 0 && (F += O))), [F, c, b, L];
2086
2141
  },
2087
2142
  [0, [], 0, 0]
2088
2143
  ),
2089
- W(([x]) => x !== 0),
2090
- D(r, c, o, s, y, R),
2091
- W(([, x, C, B, , , u]) => !u && !B && x !== 0 && C === ue),
2092
- k(([[x], , , , , C]) => (C("Upward scrolling compensation", { amount: x }, mt.DEBUG), x))
2144
+ V(([I]) => I !== 0),
2145
+ $(r, u, o, s, v, R),
2146
+ V(([, I, w, B, , , N]) => !N && !B && I !== 0 && w === ce),
2147
+ k(([[I], , , , , w]) => (w("Upward scrolling compensation", { amount: I }, ht.DEBUG), I))
2093
2148
  )
2094
2149
  );
2095
- function g(x) {
2096
- x > 0 ? (M(n, { behavior: "auto", top: -x }), M(t, 0)) : (M(t, 0), M(n, { behavior: "auto", top: -x }));
2150
+ function T(I) {
2151
+ I > 0 ? (_(n, { behavior: "auto", top: -I }), _(t, 0)) : (_(t, 0), _(n, { behavior: "auto", top: -I }));
2097
2152
  }
2098
- X(S(I, D(t, i)), ([x, C, B]) => {
2099
- B && rr() ? M(t, C - x) : g(-x);
2153
+ X(S(g, $(t, i)), ([I, w, B]) => {
2154
+ B && rr() ? _(t, w - I) : T(-I);
2100
2155
  }), X(
2101
2156
  S(
2102
- at(gt(i, !1), t, R),
2103
- W(([x, C, B]) => !x && !B && C !== 0),
2104
- k(([x, C]) => C),
2105
- zt(1)
2157
+ mt(gt(i, !1), t, R),
2158
+ V(([I, w, B]) => !I && !B && w !== 0),
2159
+ k(([I, w]) => w),
2160
+ Wt(1)
2106
2161
  ),
2107
- g
2108
- ), L(
2162
+ T
2163
+ ), z(
2109
2164
  S(
2110
- m,
2111
- k((x) => ({ top: -x }))
2165
+ h,
2166
+ k((I) => ({ top: -I }))
2112
2167
  ),
2113
2168
  n
2114
2169
  );
2115
2170
  let a = null;
2116
- function T() {
2171
+ function C() {
2117
2172
  if (a === null)
2118
2173
  return;
2119
- const { offset: x } = a;
2120
- a = null, M(n, { top: x }), requestAnimationFrame(() => {
2121
- M(t, 0), M(R, !1);
2174
+ const { offset: I } = a;
2175
+ a = null, _(n, { top: I }), requestAnimationFrame(() => {
2176
+ _(t, 0), _(R, !1);
2122
2177
  });
2123
2178
  }
2124
- return X(e, (x) => {
2125
- a === null || !a.acknowledgeable || x === a.offset && T();
2179
+ return X(e, (I) => {
2180
+ a === null || !a.acknowledgeable || I === a.offset && C();
2126
2181
  }), X(
2127
2182
  S(
2128
2183
  f,
2129
- D(h, v),
2130
- k(([x, { groupIndices: C, lastSize: B, sizeTree: u }, p]) => {
2131
- function b(U) {
2132
- return U * (B + p);
2184
+ $(m, x),
2185
+ k(([I, { groupIndices: w, lastSize: B, sizeTree: N }, c]) => {
2186
+ function p(G) {
2187
+ return G * (B + c);
2133
2188
  }
2134
- if (C.length === 0)
2135
- return b(x);
2136
- let z = 0;
2137
- const F = ie(u, 0);
2138
- let O = 0, V = 0;
2139
- for (; O < x; ) {
2140
- O++, z += F;
2141
- let U = C.length === V + 1 ? 1 / 0 : C[V + 1] - C[V] - 1;
2142
- O + U > x && (z -= F, U = x - O + 1), O += U, z += b(U), V++;
2189
+ if (w.length === 0)
2190
+ return p(I);
2191
+ let b = 0;
2192
+ const O = ie(N, 0);
2193
+ let L = 0, F = 0;
2194
+ for (; L < I; ) {
2195
+ L++, b += O;
2196
+ let G = w.length === F + 1 ? 1 / 0 : w[F + 1] - w[F] - 1;
2197
+ L + G > I && (b -= O, G = I - L + 1), L += G, b += p(G), F++;
2143
2198
  }
2144
- return z;
2199
+ return b;
2145
2200
  })
2146
2201
  ),
2147
- (x) => {
2148
- a = { acknowledgeable: lt(t) !== x, offset: x }, M(t, x), requestAnimationFrame(T);
2202
+ (I) => {
2203
+ a = { acknowledgeable: tt(t) !== I, offset: I }, _(t, I), requestAnimationFrame(C);
2149
2204
  }
2150
2205
  ), { deviation: t };
2151
2206
  },
2152
- st(St, pe, Kt, Lt, Gt, Ke)
2153
- ), ir = Z(
2207
+ st(St, me, qt, zt, Mt, Ke)
2208
+ ), ir = Y(
2154
2209
  ([
2155
2210
  t,
2156
2211
  e,
@@ -2160,7 +2215,7 @@ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2160
2215
  s,
2161
2216
  i,
2162
2217
  l,
2163
- c,
2218
+ u,
2164
2219
  d,
2165
2220
  f
2166
2221
  ]) => ({
@@ -2172,7 +2227,7 @@ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2172
2227
  ...s,
2173
2228
  ...i,
2174
2229
  ...l,
2175
- ...c,
2230
+ ...u,
2176
2231
  ...d,
2177
2232
  ...f
2178
2233
  }),
@@ -2180,16 +2235,16 @@ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2180
2235
  Ze,
2181
2236
  Qo,
2182
2237
  At,
2183
- no,
2184
- Qn,
2238
+ oo,
2239
+ to,
2185
2240
  tr,
2186
2241
  Yo,
2187
2242
  Xe,
2188
- eo,
2189
- Gt,
2190
- to
2243
+ no,
2244
+ Mt,
2245
+ eo
2191
2246
  )
2192
- ), ro = Z(
2247
+ ), so = Y(
2193
2248
  ([
2194
2249
  {
2195
2250
  data: t,
@@ -2200,33 +2255,33 @@ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2200
2255
  gap: s,
2201
2256
  groupIndices: i,
2202
2257
  heightEstimates: l,
2203
- itemSize: c,
2258
+ itemSize: u,
2204
2259
  sizeRanges: d,
2205
2260
  sizes: f,
2206
- statefulTotalCount: v,
2207
- totalCount: m,
2208
- trackItemSizes: h
2261
+ statefulTotalCount: x,
2262
+ totalCount: h,
2263
+ trackItemSizes: m
2209
2264
  },
2210
- { initialItemFinalLocationReached: y, initialTopMostItemIndex: R, scrolledToInitialItem: I },
2211
- g,
2212
- a,
2265
+ { initialItemFinalLocationReached: v, initialTopMostItemIndex: R, scrolledToInitialItem: g },
2213
2266
  T,
2214
- x,
2215
- { scrollToIndex: C },
2267
+ a,
2268
+ C,
2269
+ I,
2270
+ { scrollToIndex: w },
2216
2271
  B,
2217
- { topItemCount: u },
2218
- { groupCounts: p },
2219
- b
2272
+ { topItemCount: N },
2273
+ { groupCounts: c },
2274
+ p
2220
2275
  ]) => {
2221
- const { listState: z, minOverscanItemCount: F, topItemsIndexes: O, rangeChanged: V, ...U } = x;
2222
- return L(V, b.scrollSeekRangeChanged), L(
2276
+ const { listState: b, minOverscanItemCount: O, topItemsIndexes: L, rangeChanged: F, ...G } = I;
2277
+ return z(F, p.scrollSeekRangeChanged), z(
2223
2278
  S(
2224
- at(b.windowViewportRect, g.headerHeight, g.fixedHeaderHeight),
2279
+ mt(p.windowViewportRect, T.headerHeight, T.fixedHeaderHeight),
2225
2280
  // Keep a measurement range active when a window-scrolling list starts below the viewport.
2226
2281
  // One content pixel beyond the headers is enough to render the probe item and estimate the full list height.
2227
- k(([q, $, j]) => Math.max($ + j + 1, q.visibleHeight))
2282
+ k(([Z, W, ft]) => Math.max(W + ft + 1, Z.visibleHeight))
2228
2283
  ),
2229
- g.viewportHeight
2284
+ T.viewportHeight
2230
2285
  ), {
2231
2286
  data: t,
2232
2287
  defaultItemHeight: e,
@@ -2234,46 +2289,46 @@ const rr = oo(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
2234
2289
  fixedItemHeight: o,
2235
2290
  fixedGroupHeight: r,
2236
2291
  gap: s,
2237
- groupCounts: p,
2292
+ groupCounts: c,
2238
2293
  heightEstimates: l,
2239
- initialItemFinalLocationReached: y,
2294
+ initialItemFinalLocationReached: v,
2240
2295
  initialTopMostItemIndex: R,
2241
- scrolledToInitialItem: I,
2296
+ scrolledToInitialItem: g,
2242
2297
  sizeRanges: d,
2243
- topItemCount: u,
2244
- topItemsIndexes: O,
2298
+ topItemCount: N,
2299
+ topItemsIndexes: L,
2245
2300
  // input
2246
- totalCount: m,
2247
- ...T,
2301
+ totalCount: h,
2302
+ ...C,
2248
2303
  groupIndices: i,
2249
- itemSize: c,
2250
- listState: z,
2251
- minOverscanItemCount: F,
2252
- scrollToIndex: C,
2304
+ itemSize: u,
2305
+ listState: b,
2306
+ minOverscanItemCount: O,
2307
+ scrollToIndex: w,
2253
2308
  // output
2254
- statefulTotalCount: v,
2255
- trackItemSizes: h,
2309
+ statefulTotalCount: x,
2310
+ trackItemSizes: m,
2256
2311
  // exported from stateFlagsSystem
2257
- rangeChanged: V,
2258
- ...U,
2312
+ rangeChanged: F,
2313
+ ...G,
2259
2314
  // the bag of IO from featureGroup1System
2260
- ...b,
2261
- ...g,
2315
+ ...p,
2316
+ ...T,
2262
2317
  sizes: f,
2263
2318
  ...a
2264
2319
  };
2265
2320
  },
2266
2321
  st(
2267
- Lt,
2268
- me,
2322
+ zt,
2323
+ fe,
2269
2324
  St,
2270
2325
  er,
2271
2326
  Jo,
2272
- Kt,
2273
- fe,
2327
+ qt,
2328
+ de,
2274
2329
  sr,
2275
2330
  or,
2276
- Yn,
2331
+ Zn,
2277
2332
  ir
2278
2333
  )
2279
2334
  );
@@ -2290,152 +2345,152 @@ function lr(t, e) {
2290
2345
  const Ie = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
2291
2346
  function Je(t, e, n) {
2292
2347
  const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = E.createContext({});
2293
- function c(g, a) {
2294
- g.propsReady !== void 0 && M(g.propsReady, !1);
2295
- for (const T of o) {
2296
- const x = g[e.required[T]];
2297
- M(x, a[T]);
2348
+ function u(T, a) {
2349
+ T.propsReady !== void 0 && _(T.propsReady, !1);
2350
+ for (const C of o) {
2351
+ const I = T[e.required[C]];
2352
+ _(I, a[C]);
2298
2353
  }
2299
- for (const T of r)
2300
- if (T in a) {
2301
- const x = g[e.optional[T]];
2302
- M(x, a[T]);
2354
+ for (const C of r)
2355
+ if (C in a) {
2356
+ const I = T[e.optional[C]];
2357
+ _(I, a[C]);
2303
2358
  }
2304
- g.propsReady !== void 0 && M(g.propsReady, !0);
2359
+ T.propsReady !== void 0 && _(T.propsReady, !0);
2305
2360
  }
2306
- function d(g) {
2307
- return s.reduce((a, T) => (a[T] = (x) => {
2308
- const C = g[e.methods[T]];
2309
- M(C, x);
2361
+ function d(T) {
2362
+ return s.reduce((a, C) => (a[C] = (I) => {
2363
+ const w = T[e.methods[C]];
2364
+ _(w, I);
2310
2365
  }, a), {});
2311
2366
  }
2312
- function f(g) {
2313
- return i.reduce((a, T) => (a[T] = Co(g[e.events[T]]), a), {});
2367
+ function f(T) {
2368
+ return i.reduce((a, C) => (a[C] = wo(T[e.events[C]]), a), {});
2314
2369
  }
2315
- const v = E.forwardRef(function(a, T) {
2316
- const { children: x, ...C } = a, [B] = E.useState(() => ye(bo(t), (b) => {
2317
- c(b, C);
2318
- })), [u] = E.useState(pn(f, B));
2370
+ const x = E.forwardRef(function(a, C) {
2371
+ const { children: I, ...w } = a, [B] = E.useState(() => be(Ro(t), (p) => {
2372
+ u(p, w);
2373
+ })), [N] = E.useState(pn(f, B));
2319
2374
  Ie(() => {
2320
- for (const b of i)
2321
- b in C && X(u[b], C[b]);
2375
+ for (const p of i)
2376
+ p in w && X(N[p], w[p]);
2322
2377
  return () => {
2323
- Object.values(u).map(De);
2378
+ Object.values(N).map(De);
2324
2379
  };
2325
- }, [C, u, B]), Ie(() => {
2326
- c(B, C);
2327
- }), E.useImperativeHandle(T, mn(d(B)));
2328
- const p = n;
2329
- return /* @__PURE__ */ G(l.Provider, { value: B, children: n === void 0 ? x : /* @__PURE__ */ G(p, { ...lr([...o, ...r, ...i], C), children: x }) });
2330
- }), m = (g) => {
2380
+ }, [w, N, B]), Ie(() => {
2381
+ u(B, w);
2382
+ }), E.useImperativeHandle(C, mn(d(B)));
2383
+ const c = n;
2384
+ return /* @__PURE__ */ M(l.Provider, { value: B, children: n === void 0 ? I : /* @__PURE__ */ M(c, { ...lr([...o, ...r, ...i], w), children: I }) });
2385
+ }), h = (T) => {
2331
2386
  const a = E.useContext(l);
2332
2387
  return E.useCallback(
2333
- (T) => {
2334
- M(a[g], T);
2388
+ (C) => {
2389
+ _(a[T], C);
2335
2390
  },
2336
- [a, g]
2391
+ [a, T]
2337
2392
  );
2338
- }, h = (g) => {
2339
- const T = E.useContext(l)[g], x = E.useCallback(
2340
- (C) => X(T, C),
2341
- [T]
2393
+ }, m = (T) => {
2394
+ const C = E.useContext(l)[T], I = E.useCallback(
2395
+ (w) => X(C, w),
2396
+ [C]
2342
2397
  );
2343
2398
  return E.useSyncExternalStore(
2344
- x,
2345
- () => lt(T),
2346
- () => lt(T)
2399
+ I,
2400
+ () => tt(C),
2401
+ () => tt(C)
2347
2402
  );
2348
- }, y = (g) => {
2349
- const T = E.useContext(l)[g], [x, C] = E.useState(pn(lt, T));
2403
+ }, v = (T) => {
2404
+ const C = E.useContext(l)[T], [I, w] = E.useState(pn(tt, C));
2350
2405
  return Ie(
2351
- () => X(T, (B) => {
2352
- B !== x && C(mn(B));
2406
+ () => X(C, (B) => {
2407
+ B !== I && w(mn(B));
2353
2408
  }),
2354
- [T, x]
2355
- ), x;
2356
- }, R = parseInt(E.version, 10) >= 18 ? h : y;
2409
+ [C, I]
2410
+ ), I;
2411
+ }, R = parseInt(E.version, 10) >= 18 ? m : v;
2357
2412
  return {
2358
- Component: v,
2359
- useEmitter: (g, a) => {
2360
- const x = E.useContext(l)[g];
2361
- Ie(() => X(x, a), [a, x]);
2413
+ Component: x,
2414
+ useEmitter: (T, a) => {
2415
+ const I = E.useContext(l)[T];
2416
+ Ie(() => X(I, a), [a, I]);
2362
2417
  },
2363
2418
  useEmitterValue: R,
2364
- usePublisher: m
2419
+ usePublisher: h
2365
2420
  };
2366
2421
  }
2367
- const He = E.createContext(void 0), so = E.createContext(void 0), Le = "-webkit-sticky", Rn = "sticky", Qe = oo(() => {
2422
+ const Ee = E.createContext(void 0), io = E.createContext(void 0), ze = "-webkit-sticky", Hn = "sticky", Qe = ro(() => {
2368
2423
  if (typeof document > "u")
2369
- return Rn;
2424
+ return Hn;
2370
2425
  const t = document.createElement("div");
2371
- return t.style.position = Le, t.style.position === Le ? Le : Rn;
2426
+ return t.style.position = ze, t.style.position === ze ? ze : Hn;
2372
2427
  });
2373
- function ze(t) {
2428
+ function Fe(t) {
2374
2429
  return "self" in t;
2375
2430
  }
2376
2431
  function cr(t) {
2377
2432
  return "body" in t;
2378
2433
  }
2379
- function io(t, e, n, o = Jt, r, s) {
2380
- const i = E.useRef(null), l = E.useRef(null), c = E.useRef(null), d = E.useCallback(
2381
- (m) => {
2382
- let h, y, R;
2383
- const I = m.target;
2384
- if (cr(I) || ze(I)) {
2385
- const a = ze(I) ? I : I.defaultView;
2386
- R = s === !0 ? _t(a, a.scrollX) : a.scrollY, h = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, y = s === !0 ? a.innerWidth : a.innerHeight;
2434
+ function lo(t, e, n, o = te, r, s) {
2435
+ const i = E.useRef(null), l = E.useRef(null), u = E.useRef(null), d = E.useCallback(
2436
+ (h) => {
2437
+ let m, v, R;
2438
+ const g = h.target;
2439
+ if (cr(g) || Fe(g)) {
2440
+ const a = Fe(g) ? g : g.defaultView;
2441
+ R = s === !0 ? Nt(a, a.scrollX) : a.scrollY, m = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, v = s === !0 ? a.innerWidth : a.innerHeight;
2387
2442
  } else
2388
- R = s === !0 ? _t(I, I.scrollLeft) : I.scrollTop, h = s === !0 ? I.scrollWidth : I.scrollHeight, y = s === !0 ? I.offsetWidth : I.offsetHeight;
2389
- const g = () => {
2443
+ R = s === !0 ? Nt(g, g.scrollLeft) : g.scrollTop, m = s === !0 ? g.scrollWidth : g.scrollHeight, v = s === !0 ? g.offsetWidth : g.offsetHeight;
2444
+ const T = () => {
2390
2445
  t({
2391
- scrollHeight: h,
2446
+ scrollHeight: m,
2392
2447
  scrollTop: Math.max(R, 0),
2393
- viewportHeight: y
2448
+ viewportHeight: v
2394
2449
  });
2395
2450
  };
2396
- m.suppressFlushSync === !0 ? g() : go.flushSync(g), l.current !== null && (R === l.current || R <= 0 || R === h - y) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
2451
+ h.suppressFlushSync === !0 ? T() : Io.flushSync(T), l.current !== null && (R === l.current || R <= 0 || R === m - v) && (l.current = null, e(!0), u.current && (clearTimeout(u.current), u.current = null));
2397
2452
  },
2398
2453
  [t, e, s]
2399
2454
  );
2400
2455
  E.useEffect(() => {
2401
- const m = r ?? i.current;
2402
- return o(r ?? i.current), d({ suppressFlushSync: !0, target: m }), m.addEventListener("scroll", d, { passive: !0 }), () => {
2403
- o(null), m.removeEventListener("scroll", d);
2456
+ const h = r ?? i.current;
2457
+ return o(r ?? i.current), d({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", d, { passive: !0 }), () => {
2458
+ o(null), h.removeEventListener("scroll", d);
2404
2459
  };
2405
2460
  }, [i, d, n, o, r]);
2406
- function f(m) {
2407
- const h = i.current;
2408
- if (!h || (s === !0 ? "offsetWidth" in h && h.offsetWidth === 0 : "offsetHeight" in h && h.offsetHeight === 0))
2461
+ function f(h) {
2462
+ const m = i.current;
2463
+ if (!m || (s === !0 ? "offsetWidth" in m && m.offsetWidth === 0 : "offsetHeight" in m && m.offsetHeight === 0))
2409
2464
  return;
2410
- const y = m.behavior === "smooth";
2411
- let R, I, g;
2412
- ze(h) ? (I = Math.max(
2413
- Ht(h.document.documentElement, s === !0 ? "width" : "height"),
2414
- s === !0 ? h.document.documentElement.scrollWidth : h.document.documentElement.scrollHeight
2415
- ), R = s === !0 ? h.innerWidth : h.innerHeight, g = s === !0 ? _t(h, h.scrollX) : h.scrollY) : (I = h[s === !0 ? "scrollWidth" : "scrollHeight"], R = Ht(h, s === !0 ? "width" : "height"), g = s === !0 ? _t(h, h.scrollLeft) : h.scrollTop);
2416
- const a = I - R;
2417
- if (m.top === void 0) {
2418
- h.scrollTo(m);
2465
+ const v = h.behavior === "smooth";
2466
+ let R, g, T;
2467
+ Fe(m) ? (g = Math.max(
2468
+ Bt(m.document.documentElement, s === !0 ? "width" : "height"),
2469
+ s === !0 ? m.document.documentElement.scrollWidth : m.document.documentElement.scrollHeight
2470
+ ), R = s === !0 ? m.innerWidth : m.innerHeight, T = s === !0 ? Nt(m, m.scrollX) : m.scrollY) : (g = m[s === !0 ? "scrollWidth" : "scrollHeight"], R = Bt(m, s === !0 ? "width" : "height"), T = s === !0 ? Nt(m, m.scrollLeft) : m.scrollTop);
2471
+ const a = g - R;
2472
+ if (h.top === void 0) {
2473
+ m.scrollTo(h);
2419
2474
  return;
2420
2475
  }
2421
- const T = Math.ceil(Math.max(Math.min(a, m.top), 0));
2422
- if (m.top = T, Xn(R, I) || T === g) {
2423
- t({ scrollHeight: I, scrollTop: g, viewportHeight: R }), y && e(!0);
2476
+ const C = Math.ceil(Math.max(Math.min(a, h.top), 0));
2477
+ if (h.top = C, Jn(R, g) || C === T) {
2478
+ t({ scrollHeight: g, scrollTop: T, viewportHeight: R }), v && e(!0);
2424
2479
  return;
2425
2480
  }
2426
- y ? (l.current = T, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
2427
- c.current = null, l.current = null, e(!0);
2428
- }, 1e3)) : l.current = null, s === !0 && (m = {
2429
- ...m.behavior === void 0 ? {} : { behavior: m.behavior },
2430
- left: gn(h, T)
2431
- }), h.scrollTo(m);
2481
+ v ? (l.current = C, u.current && clearTimeout(u.current), u.current = setTimeout(() => {
2482
+ u.current = null, l.current = null, e(!0);
2483
+ }, 1e3)) : l.current = null, s === !0 && (h = {
2484
+ ...h.behavior === void 0 ? {} : { behavior: h.behavior },
2485
+ left: gn(m, C)
2486
+ }), m.scrollTo(h);
2432
2487
  }
2433
2488
  return { scrollByCallback: E.useCallback(
2434
- (m) => {
2435
- s === !0 && (m = {
2436
- ...m.behavior === void 0 ? {} : { behavior: m.behavior },
2437
- ...m.top === void 0 ? {} : { left: gn(i.current, m.top) }
2438
- }), i.current.scrollBy(m);
2489
+ (h) => {
2490
+ s === !0 && (h = {
2491
+ ...h.behavior === void 0 ? {} : { behavior: h.behavior },
2492
+ ...h.top === void 0 ? {} : { left: gn(i.current, h.top) }
2493
+ }), i.current.scrollBy(h);
2439
2494
  },
2440
2495
  [s]
2441
2496
  ), scrollerRef: i, scrollToCallback: f };
@@ -2443,14 +2498,14 @@ function io(t, e, n, o = Jt, r, s) {
2443
2498
  function tn(t) {
2444
2499
  return t;
2445
2500
  }
2446
- const ur = /* @__PURE__ */ Z(() => {
2447
- const t = w((l) => `Item ${l}`), e = w((l) => `Group ${l}`), n = w({}), o = w(tn), r = w("div"), s = w(Jt), i = (l, c = null) => gt(
2501
+ const ur = /* @__PURE__ */ Y(() => {
2502
+ const t = y((l) => `Item ${l}`), e = y((l) => `Group ${l}`), n = y({}), o = y(tn), r = y("div"), s = y(te), i = (l, u = null) => gt(
2448
2503
  S(
2449
2504
  n,
2450
2505
  k((d) => d[l]),
2451
2506
  ot()
2452
2507
  ),
2453
- c
2508
+ u
2454
2509
  );
2455
2510
  return {
2456
2511
  components: n,
@@ -2469,87 +2524,87 @@ const ur = /* @__PURE__ */ Z(() => {
2469
2524
  ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
2470
2525
  TopItemListComponent: i("TopItemList")
2471
2526
  };
2472
- }), ar = /* @__PURE__ */ Z(
2527
+ }), ar = /* @__PURE__ */ Y(
2473
2528
  ([t, e]) => ({ ...t, ...e }),
2474
- st(ro, ur)
2475
- ), dr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Qe(), zIndex: 1 }, lo = { overflowAnchor: "none" }, mr = { ...lo, display: "inline-block", height: "100%" }, Hn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2476
- const n = A("listState"), o = Tt("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, d = A("itemContent"), f = A("context"), v = A("groupContent"), m = A("trackItemSizes"), h = A("itemSize"), y = A("log"), R = Tt("gap"), I = A("horizontalDirection"), { callbackRef: g } = An(
2529
+ st(so, ur)
2530
+ ), dr = ({ height: t }) => /* @__PURE__ */ M("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Qe(), zIndex: 1 }, co = { overflowAnchor: "none" }, mr = { ...co, display: "inline-block", height: "100%" }, En = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2531
+ const n = A("listState"), o = wt("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = wt("windowScrollContainerState"), l = wt("scrollContainerState"), u = s || r ? i : l, d = A("itemContent"), f = A("context"), x = A("groupContent"), h = A("trackItemSizes"), m = A("itemSize"), v = A("log"), R = wt("gap"), g = A("horizontalDirection"), { callbackRef: T } = An(
2477
2532
  o,
2478
- h,
2479
2533
  m,
2480
- e ? Jt : c,
2481
- y,
2534
+ h,
2535
+ e ? te : u,
2536
+ v,
2482
2537
  R,
2483
2538
  s,
2484
- I,
2539
+ g,
2485
2540
  A("skipAnimationFrameInResizeObserver")
2486
- ), [a, T] = E.useState(0);
2487
- rn("deviation", ($) => {
2488
- a !== $ && T($);
2541
+ ), [a, C] = E.useState(0);
2542
+ rn("deviation", (W) => {
2543
+ a !== W && C(W);
2489
2544
  });
2490
- const x = Tt("deviationCommitted");
2491
- be(() => {
2492
- x(a);
2493
- }, [a, x]);
2494
- const C = A("EmptyPlaceholder"), B = A("ScrollSeekPlaceholder") ?? dr, u = A("ListComponent"), p = A("ItemComponent"), b = A("GroupComponent"), z = A("computeItemKey"), F = A("isSeeking"), O = A("groupIndices").length > 0, V = A("alignToBottom"), U = A("initialItemFinalLocationReached"), q = e ? {} : {
2545
+ const I = wt("deviationCommitted");
2546
+ Re(() => {
2547
+ I(a);
2548
+ }, [a, I]);
2549
+ const w = A("EmptyPlaceholder"), B = A("ScrollSeekPlaceholder") ?? dr, N = A("ListComponent"), c = A("ItemComponent"), p = A("GroupComponent"), b = A("computeItemKey"), O = A("isSeeking"), L = A("groupIndices").length > 0, F = A("alignToBottom"), G = A("initialItemFinalLocationReached"), Z = e ? {} : {
2495
2550
  boxSizing: "border-box",
2496
- ...I ? {
2551
+ ...g ? {
2497
2552
  display: "inline-block",
2498
2553
  height: "100%",
2499
- marginInlineStart: a === 0 ? V ? "auto" : 0 : a,
2554
+ marginInlineStart: a === 0 ? F ? "auto" : 0 : a,
2500
2555
  paddingInlineEnd: n.offsetBottom,
2501
2556
  paddingInlineStart: n.offsetTop,
2502
2557
  whiteSpace: "nowrap"
2503
2558
  } : {
2504
- marginTop: a === 0 ? V ? "auto" : 0 : a,
2559
+ marginTop: a === 0 ? F ? "auto" : 0 : a,
2505
2560
  paddingBottom: n.offsetBottom,
2506
2561
  paddingTop: n.offsetTop
2507
2562
  },
2508
- ...U ? {} : { visibility: "hidden" }
2563
+ ...G ? {} : { visibility: "hidden" }
2509
2564
  };
2510
- return !e && n.totalCount === 0 && C !== null && C !== void 0 ? /* @__PURE__ */ G(C, { ...rt(C, f) }) : /* @__PURE__ */ G(
2511
- u,
2565
+ return !e && n.totalCount === 0 && w !== null && w !== void 0 ? /* @__PURE__ */ M(w, { ...rt(w, f) }) : /* @__PURE__ */ M(
2566
+ N,
2512
2567
  {
2513
- ...rt(u, f),
2568
+ ...rt(N, f),
2514
2569
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
2515
- ref: g,
2516
- style: q,
2517
- children: (e ? n.topItems : n.items).map(($) => {
2518
- const j = $.originalIndex, J = z(j + n.firstItemIndex, $.data, f);
2519
- return F ? /* @__PURE__ */ Dt(
2570
+ ref: T,
2571
+ style: Z,
2572
+ children: (e ? n.topItems : n.items).map((W) => {
2573
+ const ft = W.originalIndex, K = b(ft + n.firstItemIndex, W.data, f);
2574
+ return O ? /* @__PURE__ */ Ut(
2520
2575
  B,
2521
2576
  {
2522
2577
  ...rt(B, f),
2523
- height: $.size,
2524
- index: $.index,
2525
- key: J,
2526
- type: $.type || "item",
2527
- ...$.type === "group" ? {} : { groupIndex: $.groupIndex }
2578
+ height: W.size,
2579
+ index: W.index,
2580
+ key: K,
2581
+ type: W.type || "item",
2582
+ ...W.type === "group" ? {} : { groupIndex: W.groupIndex }
2528
2583
  }
2529
- ) : $.type === "group" ? /* @__PURE__ */ Dt(
2530
- b,
2584
+ ) : W.type === "group" ? /* @__PURE__ */ Ut(
2585
+ p,
2531
2586
  {
2532
- ...rt(b, f),
2533
- "data-index": j,
2534
- "data-item-index": $.index,
2535
- "data-known-size": $.size,
2536
- key: J,
2587
+ ...rt(p, f),
2588
+ "data-index": ft,
2589
+ "data-item-index": W.index,
2590
+ "data-known-size": W.size,
2591
+ key: K,
2537
2592
  style: fr
2538
2593
  },
2539
- v($.index, f)
2540
- ) : /* @__PURE__ */ Dt(
2541
- p,
2594
+ x(W.index, f)
2595
+ ) : /* @__PURE__ */ Ut(
2596
+ c,
2542
2597
  {
2543
- ...rt(p, f),
2544
- ...co(p, $.data),
2545
- "data-index": j,
2546
- "data-item-group-index": $.groupIndex,
2547
- "data-item-index": $.index,
2548
- "data-known-size": $.size,
2549
- key: J,
2550
- style: I ? mr : lo
2598
+ ...rt(c, f),
2599
+ ...uo(c, W.data),
2600
+ "data-index": ft,
2601
+ "data-item-group-index": W.groupIndex,
2602
+ "data-item-index": W.index,
2603
+ "data-known-size": W.size,
2604
+ key: K,
2605
+ style: g ? mr : co
2551
2606
  },
2552
- O ? d($.index, $.groupIndex, $.data, f) : d($.index, $.data, f)
2607
+ L ? d(W.index, W.groupIndex, W.data, f) : d(W.index, W.data, f)
2553
2608
  );
2554
2609
  })
2555
2610
  }
@@ -2564,14 +2619,14 @@ const ur = /* @__PURE__ */ Z(() => {
2564
2619
  outline: "none",
2565
2620
  overflowX: "auto",
2566
2621
  position: "relative"
2567
- }, Ee = (t) => ({
2622
+ }, ke = (t) => ({
2568
2623
  height: "100%",
2569
2624
  position: "absolute",
2570
2625
  top: 0,
2571
2626
  width: "100%",
2572
2627
  ...t ? { display: "flex", flexDirection: "column" } : void 0
2573
2628
  }), en = (t, e, n = 0) => ({
2574
- ...Ee(t),
2629
+ ...ke(t),
2575
2630
  position: e ? "relative" : "absolute",
2576
2631
  top: e ? -n : 0
2577
2632
  }), gr = {
@@ -2584,53 +2639,53 @@ function rt(t, e) {
2584
2639
  if (typeof t != "string")
2585
2640
  return { context: e };
2586
2641
  }
2587
- function co(t, e) {
2642
+ function uo(t, e) {
2588
2643
  return { item: typeof t == "string" ? void 0 : e };
2589
2644
  }
2590
2645
  const Ir = /* @__PURE__ */ E.memo(function() {
2591
- const e = A("HeaderComponent"), n = Tt("headerHeight"), o = A("HeaderFooterTag"), r = Ot(
2646
+ const e = A("HeaderComponent"), n = wt("headerHeight"), o = A("HeaderFooterTag"), r = Lt(
2592
2647
  E.useMemo(
2593
2648
  () => (i) => {
2594
- n(Ht(i, "height"));
2649
+ n(Bt(i, "height"));
2595
2650
  },
2596
2651
  [n]
2597
2652
  ),
2598
2653
  !0,
2599
2654
  A("skipAnimationFrameInResizeObserver")
2600
2655
  ), s = A("context");
2601
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
2656
+ return e != null ? /* @__PURE__ */ M(o, { ref: r, children: /* @__PURE__ */ M(e, { ...rt(e, s) }) }) : null;
2602
2657
  }), Sr = /* @__PURE__ */ E.memo(function() {
2603
- const e = A("FooterComponent"), n = Tt("footerHeight"), o = A("HeaderFooterTag"), r = Ot(
2658
+ const e = A("FooterComponent"), n = wt("footerHeight"), o = A("HeaderFooterTag"), r = Lt(
2604
2659
  E.useMemo(
2605
2660
  () => (i) => {
2606
- n(Ht(i, "height"));
2661
+ n(Bt(i, "height"));
2607
2662
  },
2608
2663
  [n]
2609
2664
  ),
2610
2665
  !0,
2611
2666
  A("skipAnimationFrameInResizeObserver")
2612
2667
  ), s = A("context");
2613
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
2668
+ return e != null ? /* @__PURE__ */ M(o, { ref: r, children: /* @__PURE__ */ M(e, { ...rt(e, s) }) }) : null;
2614
2669
  });
2615
2670
  function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2616
- return E.memo(function({ children: s, style: i, context: l, ...c }) {
2617
- const d = n("scrollContainerState"), f = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), m = e("scrollerRef"), h = e("horizontalDirection") || !1, { scrollByCallback: y, scrollerRef: R, scrollToCallback: I } = io(
2671
+ return E.memo(function({ children: s, style: i, context: l, ...u }) {
2672
+ const d = n("scrollContainerState"), f = e("ScrollerComponent"), x = n("smoothScrollTargetReached"), h = e("scrollerRef"), m = e("horizontalDirection") || !1, { scrollByCallback: v, scrollerRef: R, scrollToCallback: g } = lo(
2618
2673
  d,
2619
- v,
2674
+ x,
2620
2675
  f,
2621
- m,
2676
+ h,
2622
2677
  void 0,
2623
- h
2678
+ m
2624
2679
  );
2625
- return t("scrollTo", I), t("scrollBy", y), /* @__PURE__ */ G(
2680
+ return t("scrollTo", g), t("scrollBy", v), /* @__PURE__ */ M(
2626
2681
  f,
2627
2682
  {
2628
2683
  "data-testid": "virtuoso-scroller",
2629
2684
  "data-virtuoso-scroller": !0,
2630
2685
  ref: R,
2631
- style: { ...h ? hr : pr, ...i },
2686
+ style: { ...m ? hr : pr, ...i },
2632
2687
  tabIndex: 0,
2633
- ...c,
2688
+ ...u,
2634
2689
  ...rt(f, l),
2635
2690
  children: s
2636
2691
  }
@@ -2638,23 +2693,23 @@ function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2638
2693
  });
2639
2694
  }
2640
2695
  function on({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2641
- return E.memo(function({ children: s, style: i, context: l, ...c }) {
2642
- const d = n("windowScrollContainerState"), f = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), m = e("totalListHeight"), h = e("deviation"), y = e("customScrollParent"), R = E.useRef(null), I = e("scrollerRef"), { scrollByCallback: g, scrollerRef: a, scrollToCallback: T } = io(
2696
+ return E.memo(function({ children: s, style: i, context: l, ...u }) {
2697
+ const d = n("windowScrollContainerState"), f = e("ScrollerComponent"), x = n("smoothScrollTargetReached"), h = e("totalListHeight"), m = e("deviation"), v = e("customScrollParent"), R = E.useRef(null), g = e("scrollerRef"), { scrollByCallback: T, scrollerRef: a, scrollToCallback: C } = lo(
2643
2698
  d,
2644
- v,
2699
+ x,
2645
2700
  f,
2646
- I,
2647
- y
2701
+ g,
2702
+ v
2648
2703
  );
2649
- return be(() => (a.current = y ?? R.current?.ownerDocument.defaultView, () => {
2704
+ return Re(() => (a.current = v ?? R.current?.ownerDocument.defaultView, () => {
2650
2705
  a.current = null;
2651
- }), [a, y]), t("windowScrollTo", T), t("scrollBy", g), /* @__PURE__ */ G(
2706
+ }), [a, v]), t("windowScrollTo", C), t("scrollBy", T), /* @__PURE__ */ M(
2652
2707
  f,
2653
2708
  {
2654
2709
  ref: R,
2655
2710
  "data-virtuoso-scroller": !0,
2656
- style: { position: "relative", ...i, ...m === 0 ? void 0 : { height: m + h } },
2657
- ...c,
2711
+ style: { position: "relative", ...i, ...h === 0 ? void 0 : { height: h + m } },
2712
+ ...u,
2658
2713
  ...rt(f, l),
2659
2714
  children: s
2660
2715
  }
@@ -2662,40 +2717,40 @@ function on({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
2662
2717
  });
2663
2718
  }
2664
2719
  const xr = ({ children: t }) => {
2665
- const e = E.useContext(He), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = A("alignToBottom"), s = A("horizontalDirection"), i = E.useMemo(
2666
- () => re(n, (c) => Ht(c, s ? "width" : "height")),
2720
+ const e = E.useContext(Ee), n = wt("viewportHeight"), o = wt("fixedItemHeight"), r = A("alignToBottom"), s = A("horizontalDirection"), i = E.useMemo(
2721
+ () => re(n, (u) => Bt(u, s ? "width" : "height")),
2667
2722
  [n, s]
2668
- ), l = Ot(i, !0, A("skipAnimationFrameInResizeObserver"));
2723
+ ), l = Lt(i, !0, A("skipAnimationFrameInResizeObserver"));
2669
2724
  return E.useEffect(() => {
2670
2725
  e && (n(e.viewportHeight), o(e.itemHeight));
2671
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: l, style: Ee(r), children: t });
2726
+ }, [e, n, o]), /* @__PURE__ */ M("div", { "data-viewport-type": "element", ref: l, style: ke(r), children: t });
2672
2727
  }, vr = ({ children: t }) => {
2673
- const e = E.useContext(He), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = A("customScrollParent"), s = A("useWindowScroll"), i = A("topListHeight"), l = Ue(
2728
+ const e = E.useContext(Ee), n = wt("windowViewportRect"), o = wt("fixedItemHeight"), r = A("customScrollParent"), s = A("useWindowScroll"), i = A("topListHeight"), l = Ue(
2674
2729
  n,
2675
2730
  r,
2676
2731
  A("skipAnimationFrameInResizeObserver")
2677
- ), c = A("alignToBottom");
2732
+ ), u = A("alignToBottom");
2678
2733
  return E.useEffect(() => {
2679
2734
  e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
2680
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: l, style: en(c, s, i), children: t });
2735
+ }, [e, n, o]), /* @__PURE__ */ M("div", { "data-viewport-type": "window", ref: l, style: en(u, s, i), children: t });
2681
2736
  }, Tr = ({ children: t }) => {
2682
2737
  const e = A("TopItemListComponent") ?? "div", n = A("headerHeight"), o = { ...gr, marginTop: `${n}px` }, r = A("context");
2683
- return /* @__PURE__ */ G(e, { style: o, ...rt(e, r), children: t });
2738
+ return /* @__PURE__ */ M(e, { style: o, ...rt(e, r), children: t });
2684
2739
  }, Cr = /* @__PURE__ */ E.memo(function(e) {
2685
2740
  const n = A("useWindowScroll"), o = A("topItemsIndexes").length > 0, r = A("customScrollParent"), s = A("context");
2686
- return /* @__PURE__ */ $t(r || n ? yr : wr, { ...e, context: s, children: [
2687
- o && /* @__PURE__ */ G(Tr, { children: /* @__PURE__ */ G(Hn, { showTopList: !0 }) }),
2688
- /* @__PURE__ */ $t(r || n ? vr : xr, { children: [
2689
- /* @__PURE__ */ G(Ir, {}),
2690
- /* @__PURE__ */ G(Hn, {}),
2691
- /* @__PURE__ */ G(Sr, {})
2741
+ return /* @__PURE__ */ Kt(r || n ? yr : wr, { ...e, context: s, children: [
2742
+ o && /* @__PURE__ */ M(Tr, { children: /* @__PURE__ */ M(En, { showTopList: !0 }) }),
2743
+ /* @__PURE__ */ Kt(r || n ? vr : xr, { children: [
2744
+ /* @__PURE__ */ M(Ir, {}),
2745
+ /* @__PURE__ */ M(En, {}),
2746
+ /* @__PURE__ */ M(Sr, {})
2692
2747
  ] })
2693
2748
  ] });
2694
2749
  }), {
2695
- Component: uo,
2750
+ Component: ao,
2696
2751
  useEmitter: rn,
2697
2752
  useEmitterValue: A,
2698
- usePublisher: Tt
2753
+ usePublisher: wt
2699
2754
  } = /* @__PURE__ */ Je(
2700
2755
  ar,
2701
2756
  {
@@ -2758,17 +2813,17 @@ const xr = ({ children: t }) => {
2758
2813
  }
2759
2814
  },
2760
2815
  Cr
2761
- ), wr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: A, usePublisher: Tt }), yr = /* @__PURE__ */ on({ useEmitter: rn, useEmitterValue: A, usePublisher: Tt }), es = uo, ns = uo, br = /* @__PURE__ */ Z(() => {
2762
- const t = w((d) => /* @__PURE__ */ $t("td", { children: [
2816
+ ), wr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: A, usePublisher: wt }), yr = /* @__PURE__ */ on({ useEmitter: rn, useEmitterValue: A, usePublisher: wt }), es = ao, ns = ao, br = /* @__PURE__ */ Y(() => {
2817
+ const t = y((d) => /* @__PURE__ */ Kt("td", { children: [
2763
2818
  "Item $",
2764
2819
  d
2765
- ] })), e = w(null), n = w((d) => /* @__PURE__ */ $t("td", { colSpan: 1e3, children: [
2820
+ ] })), e = y(null), n = y((d) => /* @__PURE__ */ Kt("td", { colSpan: 1e3, children: [
2766
2821
  "Group ",
2767
2822
  d
2768
- ] })), o = w(null), r = w(null), s = w({}), i = w(tn), l = w(Jt), c = (d, f = null) => gt(
2823
+ ] })), o = y(null), r = y(null), s = y({}), i = y(tn), l = y(te), u = (d, f = null) => gt(
2769
2824
  S(
2770
2825
  s,
2771
- k((v) => v[d]),
2826
+ k((x) => x[d]),
2772
2827
  ot()
2773
2828
  ),
2774
2829
  f
@@ -2777,152 +2832,152 @@ const xr = ({ children: t }) => {
2777
2832
  components: s,
2778
2833
  computeItemKey: i,
2779
2834
  context: e,
2780
- EmptyPlaceholder: c("EmptyPlaceholder"),
2781
- FillerRow: c("FillerRow"),
2835
+ EmptyPlaceholder: u("EmptyPlaceholder"),
2836
+ FillerRow: u("FillerRow"),
2782
2837
  fixedFooterContent: r,
2783
2838
  fixedHeaderContent: o,
2784
2839
  itemContent: t,
2785
2840
  groupContent: n,
2786
- ScrollerComponent: c("Scroller", "div"),
2841
+ ScrollerComponent: u("Scroller", "div"),
2787
2842
  scrollerRef: l,
2788
- ScrollSeekPlaceholder: c("ScrollSeekPlaceholder"),
2789
- TableBodyComponent: c("TableBody", "tbody"),
2790
- TableComponent: c("Table", "table"),
2791
- TableFooterComponent: c("TableFoot", "tfoot"),
2792
- TableHeadComponent: c("TableHead", "thead"),
2793
- TableRowComponent: c("TableRow", "tr"),
2794
- GroupComponent: c("Group", "tr")
2843
+ ScrollSeekPlaceholder: u("ScrollSeekPlaceholder"),
2844
+ TableBodyComponent: u("TableBody", "tbody"),
2845
+ TableComponent: u("Table", "table"),
2846
+ TableFooterComponent: u("TableFoot", "tfoot"),
2847
+ TableHeadComponent: u("TableHead", "thead"),
2848
+ TableRowComponent: u("TableRow", "tr"),
2849
+ GroupComponent: u("Group", "tr")
2795
2850
  };
2796
- }), Rr = /* @__PURE__ */ Z(
2851
+ }), Rr = /* @__PURE__ */ Y(
2797
2852
  ([t, e]) => ({ ...t, ...e }),
2798
- st(ro, br)
2799
- ), Hr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), kr = { overflowAnchor: "none" }, En = { position: Qe(), zIndex: 2, overflowAnchor: "none" }, kn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2800
- const n = _("listState"), o = _("computeItemKey"), r = _("firstItemIndex"), s = _("context"), i = _("isSeeking"), l = _("fixedHeaderHeight"), c = _("groupIndices").length > 0, d = _("itemContent"), f = _("groupContent"), v = _("ScrollSeekPlaceholder") ?? Hr, m = _("GroupComponent"), h = _("TableRowComponent"), y = (e ? n.topItems : []).reduce((I, g, a) => (a === 0 ? I.push(g.size) : I.push(I[a - 1] + g.size), I), []);
2801
- return (e ? n.topItems : n.items).map((I) => {
2802
- const g = I.originalIndex, a = o(g + r, I.data, s), T = e ? g === 0 ? 0 : y[g - 1] : 0;
2803
- return i ? /* @__PURE__ */ Dt(
2804
- v,
2853
+ st(so, br)
2854
+ ), Hr = ({ height: t }) => /* @__PURE__ */ M("tr", { children: /* @__PURE__ */ M("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ M("tr", { children: /* @__PURE__ */ M("td", { style: { border: 0, height: t, padding: 0 } }) }), kr = { overflowAnchor: "none" }, kn = { position: Qe(), zIndex: 2, overflowAnchor: "none" }, Bn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
2855
+ const n = D("listState"), o = D("computeItemKey"), r = D("firstItemIndex"), s = D("context"), i = D("isSeeking"), l = D("fixedHeaderHeight"), u = D("groupIndices").length > 0, d = D("itemContent"), f = D("groupContent"), x = D("ScrollSeekPlaceholder") ?? Hr, h = D("GroupComponent"), m = D("TableRowComponent"), v = (e ? n.topItems : []).reduce((g, T, a) => (a === 0 ? g.push(T.size) : g.push(g[a - 1] + T.size), g), []);
2856
+ return (e ? n.topItems : n.items).map((g) => {
2857
+ const T = g.originalIndex, a = o(T + r, g.data, s), C = e ? T === 0 ? 0 : v[T - 1] : 0;
2858
+ return i ? /* @__PURE__ */ Ut(
2859
+ x,
2805
2860
  {
2806
- ...rt(v, s),
2807
- height: I.size,
2808
- index: I.index,
2861
+ ...rt(x, s),
2862
+ height: g.size,
2863
+ index: g.index,
2809
2864
  key: a,
2810
- type: I.type || "item"
2865
+ type: g.type || "item"
2811
2866
  }
2812
- ) : I.type === "group" ? /* @__PURE__ */ Dt(
2813
- m,
2867
+ ) : g.type === "group" ? /* @__PURE__ */ Ut(
2868
+ h,
2814
2869
  {
2815
- ...rt(m, s),
2816
- "data-index": g,
2817
- "data-item-index": I.index,
2818
- "data-known-size": I.size,
2870
+ ...rt(h, s),
2871
+ "data-index": T,
2872
+ "data-item-index": g.index,
2873
+ "data-known-size": g.size,
2819
2874
  key: a,
2820
2875
  style: {
2821
- ...En,
2876
+ ...kn,
2822
2877
  top: l
2823
2878
  }
2824
2879
  },
2825
- f(I.index, s)
2826
- ) : /* @__PURE__ */ Dt(
2827
- h,
2880
+ f(g.index, s)
2881
+ ) : /* @__PURE__ */ Ut(
2882
+ m,
2828
2883
  {
2829
- ...rt(h, s),
2830
- ...co(h, I.data),
2831
- "data-index": g,
2832
- "data-item-index": I.index,
2833
- "data-known-size": I.size,
2834
- "data-item-group-index": I.groupIndex,
2884
+ ...rt(m, s),
2885
+ ...uo(m, g.data),
2886
+ "data-index": T,
2887
+ "data-item-index": g.index,
2888
+ "data-known-size": g.size,
2889
+ "data-item-group-index": g.groupIndex,
2835
2890
  key: a,
2836
- style: e ? { ...En, top: l + T } : kr
2891
+ style: e ? { ...kn, top: l + C } : kr
2837
2892
  },
2838
- c ? d(I.index, I.groupIndex, I.data, s) : d(I.index, I.data, s)
2893
+ u ? d(g.index, g.groupIndex, g.data, s) : d(g.index, g.data, s)
2839
2894
  );
2840
2895
  });
2841
2896
  }), Br = /* @__PURE__ */ E.memo(function() {
2842
- const e = _("listState"), n = _("topItemsIndexes").length > 0, o = wt("sizeRanges"), r = _("useWindowScroll"), s = _("customScrollParent"), i = wt("windowScrollContainerState"), l = wt("scrollContainerState"), c = s || r ? i : l, d = _("trackItemSizes"), f = _("itemSize"), v = _("log"), { callbackRef: m, ref: h } = An(
2897
+ const e = D("listState"), n = D("topItemsIndexes").length > 0, o = bt("sizeRanges"), r = D("useWindowScroll"), s = D("customScrollParent"), i = bt("windowScrollContainerState"), l = bt("scrollContainerState"), u = s || r ? i : l, d = D("trackItemSizes"), f = D("itemSize"), x = D("log"), { callbackRef: h, ref: m } = An(
2843
2898
  o,
2844
2899
  f,
2845
2900
  d,
2846
- c,
2847
- v,
2901
+ u,
2902
+ x,
2848
2903
  void 0,
2849
2904
  s,
2850
2905
  !1,
2851
- _("skipAnimationFrameInResizeObserver")
2852
- ), [y, R] = E.useState(0);
2853
- sn("deviation", (O) => {
2854
- y !== O && (h.current.style.marginTop = `${O}px`, R(O));
2906
+ D("skipAnimationFrameInResizeObserver")
2907
+ ), [v, R] = E.useState(0);
2908
+ sn("deviation", (L) => {
2909
+ v !== L && (m.current.style.marginTop = `${L}px`, R(L));
2855
2910
  });
2856
- const I = wt("deviationCommitted");
2857
- be(() => {
2858
- I(y);
2859
- }, [y, I]);
2860
- const g = _("EmptyPlaceholder"), a = _("FillerRow") ?? Er, T = _("TableBodyComponent"), x = _("paddingTopAddition"), C = _("statefulTotalCount"), B = _("context");
2861
- if (C === 0 && g !== null && g !== void 0)
2862
- return /* @__PURE__ */ G(g, { ...rt(g, B) });
2863
- const u = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), p = e.offsetTop + x + y - u, b = e.offsetBottom, z = p > 0 ? /* @__PURE__ */ G(a, { context: B, height: p }, "padding-top") : null, F = b > 0 ? /* @__PURE__ */ G(a, { context: B, height: b }, "padding-bottom") : null;
2864
- return /* @__PURE__ */ $t(T, { "data-testid": "virtuoso-item-list", ref: m, ...rt(T, B), children: [
2865
- z,
2866
- n && /* @__PURE__ */ G(kn, { showTopList: !0 }),
2867
- /* @__PURE__ */ G(kn, {}),
2868
- F
2911
+ const g = bt("deviationCommitted");
2912
+ Re(() => {
2913
+ g(v);
2914
+ }, [v, g]);
2915
+ const T = D("EmptyPlaceholder"), a = D("FillerRow") ?? Er, C = D("TableBodyComponent"), I = D("paddingTopAddition"), w = D("statefulTotalCount"), B = D("context");
2916
+ if (w === 0 && T !== null && T !== void 0)
2917
+ return /* @__PURE__ */ M(T, { ...rt(T, B) });
2918
+ const N = (n ? e.topItems : []).reduce((L, F) => L + F.size, 0), c = e.offsetTop + I + v - N, p = e.offsetBottom, b = c > 0 ? /* @__PURE__ */ M(a, { context: B, height: c }, "padding-top") : null, O = p > 0 ? /* @__PURE__ */ M(a, { context: B, height: p }, "padding-bottom") : null;
2919
+ return /* @__PURE__ */ Kt(C, { "data-testid": "virtuoso-item-list", ref: h, ...rt(C, B), children: [
2920
+ b,
2921
+ n && /* @__PURE__ */ M(Bn, { showTopList: !0 }),
2922
+ /* @__PURE__ */ M(Bn, {}),
2923
+ O
2869
2924
  ] });
2870
2925
  }), Or = ({ children: t }) => {
2871
- const e = E.useContext(He), n = wt("viewportHeight"), o = wt("fixedItemHeight"), r = Ot(
2872
- E.useMemo(() => re(n, (s) => Ht(s, "height")), [n]),
2926
+ const e = E.useContext(Ee), n = bt("viewportHeight"), o = bt("fixedItemHeight"), r = Lt(
2927
+ E.useMemo(() => re(n, (s) => Bt(s, "height")), [n]),
2873
2928
  !0,
2874
- _("skipAnimationFrameInResizeObserver")
2929
+ D("skipAnimationFrameInResizeObserver")
2875
2930
  );
2876
2931
  return E.useEffect(() => {
2877
2932
  e && (n(e.viewportHeight), o(e.itemHeight));
2878
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: r, style: Ee(!1), children: t });
2933
+ }, [e, n, o]), /* @__PURE__ */ M("div", { "data-viewport-type": "element", ref: r, style: ke(!1), children: t });
2879
2934
  }, Lr = ({ children: t }) => {
2880
- const e = E.useContext(He), n = wt("windowViewportRect"), o = wt("fixedItemHeight"), r = _("customScrollParent"), s = _("useWindowScroll"), i = Ue(
2935
+ const e = E.useContext(Ee), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r = D("customScrollParent"), s = D("useWindowScroll"), i = Ue(
2881
2936
  n,
2882
2937
  r,
2883
- _("skipAnimationFrameInResizeObserver")
2938
+ D("skipAnimationFrameInResizeObserver")
2884
2939
  );
2885
2940
  return E.useEffect(() => {
2886
2941
  e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
2887
- }, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: i, style: en(!1, s), children: t });
2942
+ }, [e, n, o]), /* @__PURE__ */ M("div", { "data-viewport-type": "window", ref: i, style: en(!1, s), children: t });
2888
2943
  }, zr = /* @__PURE__ */ E.memo(function(e) {
2889
- const n = _("useWindowScroll"), o = _("customScrollParent"), r = wt("fixedHeaderHeight"), s = wt("fixedFooterHeight"), i = _("fixedHeaderContent"), l = _("fixedFooterContent"), c = _("context"), d = Ot(
2890
- E.useMemo(() => re(r, (a) => Ht(a, "height")), [r]),
2944
+ const n = D("useWindowScroll"), o = D("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = D("fixedHeaderContent"), l = D("fixedFooterContent"), u = D("context"), d = Lt(
2945
+ E.useMemo(() => re(r, (a) => Bt(a, "height")), [r]),
2891
2946
  !0,
2892
- _("skipAnimationFrameInResizeObserver")
2893
- ), f = Ot(
2894
- E.useMemo(() => re(s, (a) => Ht(a, "height")), [s]),
2947
+ D("skipAnimationFrameInResizeObserver")
2948
+ ), f = Lt(
2949
+ E.useMemo(() => re(s, (a) => Bt(a, "height")), [s]),
2895
2950
  !0,
2896
- _("skipAnimationFrameInResizeObserver")
2897
- ), v = o || n ? Vr : Fr, m = o || n ? Lr : Or, h = _("TableComponent"), y = _("TableHeadComponent"), R = _("TableFooterComponent"), I = i ? /* @__PURE__ */ G(
2898
- y,
2951
+ D("skipAnimationFrameInResizeObserver")
2952
+ ), x = o || n ? Vr : Fr, h = o || n ? Lr : Or, m = D("TableComponent"), v = D("TableHeadComponent"), R = D("TableFooterComponent"), g = i ? /* @__PURE__ */ M(
2953
+ v,
2899
2954
  {
2900
2955
  ref: d,
2901
2956
  style: { position: "sticky", top: 0, zIndex: 2 },
2902
- ...rt(y, c),
2957
+ ...rt(v, u),
2903
2958
  children: i()
2904
2959
  },
2905
2960
  "TableHead"
2906
- ) : null, g = l ? /* @__PURE__ */ G(
2961
+ ) : null, T = l ? /* @__PURE__ */ M(
2907
2962
  R,
2908
2963
  {
2909
2964
  ref: f,
2910
2965
  style: { bottom: 0, position: "sticky", zIndex: 1 },
2911
- ...rt(R, c),
2966
+ ...rt(R, u),
2912
2967
  children: l()
2913
2968
  },
2914
2969
  "TableFoot"
2915
2970
  ) : null;
2916
- return /* @__PURE__ */ G(v, { ...e, ...rt(v, c), children: /* @__PURE__ */ G(m, { children: /* @__PURE__ */ $t(h, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...rt(h, c), children: [
2917
- I,
2918
- /* @__PURE__ */ G(Br, {}, "TableBody"),
2919
- g
2971
+ return /* @__PURE__ */ M(x, { ...e, ...rt(x, u), children: /* @__PURE__ */ M(h, { children: /* @__PURE__ */ Kt(m, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...rt(m, u), children: [
2972
+ g,
2973
+ /* @__PURE__ */ M(Br, {}, "TableBody"),
2974
+ T
2920
2975
  ] }) }) });
2921
2976
  }), {
2922
- Component: ao,
2977
+ Component: fo,
2923
2978
  useEmitter: sn,
2924
- useEmitterValue: _,
2925
- usePublisher: wt
2979
+ useEmitterValue: D,
2980
+ usePublisher: bt
2926
2981
  } = /* @__PURE__ */ Je(
2927
2982
  Rr,
2928
2983
  {
@@ -2982,7 +3037,7 @@ const xr = ({ children: t }) => {
2982
3037
  }
2983
3038
  },
2984
3039
  zr
2985
- ), Fr = /* @__PURE__ */ nn({ useEmitter: sn, useEmitterValue: _, usePublisher: wt }), Vr = /* @__PURE__ */ on({ useEmitter: sn, useEmitterValue: _, usePublisher: wt }), os = ao, rs = ao, Bn = {
3040
+ ), Fr = /* @__PURE__ */ nn({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), Vr = /* @__PURE__ */ on({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), os = fo, rs = fo, On = {
2986
3041
  bottom: 0,
2987
3042
  itemHeight: 0,
2988
3043
  items: [],
@@ -2990,7 +3045,7 @@ const xr = ({ children: t }) => {
2990
3045
  offsetBottom: 0,
2991
3046
  offsetTop: 0,
2992
3047
  top: 0
2993
- }, Pr = {
3048
+ }, Wr = {
2994
3049
  bottom: 0,
2995
3050
  itemHeight: 0,
2996
3051
  items: [{ index: 0 }],
@@ -2998,13 +3053,13 @@ const xr = ({ children: t }) => {
2998
3053
  offsetBottom: 0,
2999
3054
  offsetTop: 0,
3000
3055
  top: 0
3001
- }, { ceil: On, floor: Ce, max: oe, min: Fe, round: Ln } = Math;
3002
- function zn(t, e, n) {
3056
+ }, { ceil: Ln, floor: we, max: oe, min: Ve, round: zn } = Math;
3057
+ function Fn(t, e, n) {
3003
3058
  return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
3004
3059
  }
3005
- function Wr(t) {
3060
+ function Pr(t) {
3006
3061
  return {
3007
- ...Pr,
3062
+ ...Wr,
3008
3063
  items: t
3009
3064
  };
3010
3065
  }
@@ -3014,261 +3069,269 @@ function Se(t, e) {
3014
3069
  function Gr(t, e) {
3015
3070
  return t !== void 0 && t.column === e.column && t.row === e.row;
3016
3071
  }
3017
- const Ar = /* @__PURE__ */ Z(
3072
+ const Mr = /* @__PURE__ */ Y(
3018
3073
  ([
3019
3074
  { increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
3020
- { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: d, smoothScrollTargetReached: f, viewportHeight: v },
3021
- m,
3075
+ { footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: u, scrollTop: d, smoothScrollTargetReached: f, viewportHeight: x },
3022
3076
  h,
3023
- { didMount: y, propsReady: R },
3024
- { customScrollParent: I, useWindowScroll: g, windowScrollContainerState: a, windowScrollTo: T, windowViewportRect: x },
3025
- C
3077
+ m,
3078
+ { didMount: v, propsReady: R },
3079
+ { customScrollParent: g, useWindowScroll: T, windowScrollContainerState: a, windowScrollTo: C, windowViewportRect: I },
3080
+ w
3026
3081
  ]) => {
3027
- const B = w(0), u = w(0), p = w(Bn), b = w({ height: 0, width: 0 }), z = w({ height: 0, width: 0 }), F = K(), O = K(), V = w(0), U = w(null), q = w({ column: 0, row: 0 }), $ = K(), j = K(), J = w(!1), dt = w(0), pt = w(!0), It = w(!1), Ft = w(!1);
3082
+ const B = y(0), N = y(0), c = y(On), p = y({ height: 0, width: 0 }), b = y({ height: 0, width: 0 }), O = U(), L = U(), F = y(0), G = y(null), Z = y({ column: 0, row: 0 }), W = U(), ft = U(), K = y(!1), ct = y(0), ut = y(!0), It = y(!1), Ft = y(!1);
3028
3083
  X(
3029
3084
  S(
3030
- y,
3031
- D(dt),
3032
- W(([H, N]) => !Me(N))
3085
+ v,
3086
+ $(ct),
3087
+ V(([H, j]) => !Ae(j))
3033
3088
  ),
3034
3089
  () => {
3035
- M(pt, !1);
3090
+ _(ut, !1);
3036
3091
  }
3037
3092
  ), X(
3038
3093
  S(
3039
- at(y, pt, z, b, dt, It),
3040
- W(([H, N, Y, it, , et]) => H && !N && Y.height !== 0 && it.height !== 0 && !et)
3094
+ mt(v, ut, b, p, ct, It),
3095
+ V(([H, j, q, Q, , at]) => H && !j && q.height !== 0 && Q.height !== 0 && !at)
3041
3096
  ),
3042
3097
  ([, , , , H]) => {
3043
3098
  if (H === void 0) {
3044
- M(pt, !0);
3099
+ _(ut, !0);
3045
3100
  return;
3046
3101
  }
3047
- M(It, !0), qe(1, () => {
3048
- M(F, H);
3049
- }), bt(S(d), () => {
3050
- M(e, [0, 0]), M(pt, !0);
3102
+ _(It, !0), qe(1, () => {
3103
+ _(O, H);
3104
+ }), Et(S(d), () => {
3105
+ _(e, [0, 0]), _(ut, !0);
3051
3106
  });
3052
3107
  }
3053
- ), L(
3108
+ ), z(
3054
3109
  S(
3055
- j,
3056
- W((H) => H != null && H.scrollTop > 0),
3057
- kt(0)
3110
+ ft,
3111
+ V((H) => H != null && H.scrollTop > 0),
3112
+ Ct(0)
3058
3113
  ),
3059
- u
3114
+ N
3060
3115
  ), X(
3061
3116
  S(
3062
- y,
3063
- D(j),
3064
- W(([, H]) => H != null)
3117
+ v,
3118
+ $(ft),
3119
+ V(([, H]) => H != null)
3065
3120
  ),
3066
3121
  ([, H]) => {
3067
- H && (M(b, H.viewport), M(z, H.item), M(q, H.gap), H.scrollTop > 0 && (M(J, !0), bt(S(d, Ut(1)), (N) => {
3068
- M(J, !1);
3069
- }), M(c, { top: H.scrollTop })));
3122
+ H && (_(p, H.viewport), _(b, H.item), _(Z, H.gap), H.scrollTop > 0 && (_(K, !0), Et(S(d, jt(1)), (j) => {
3123
+ _(K, !1);
3124
+ }), _(u, { top: H.scrollTop })));
3070
3125
  }
3071
- ), L(
3126
+ ), z(
3072
3127
  S(
3073
- b,
3128
+ p,
3074
3129
  k(({ height: H }) => H)
3075
3130
  ),
3076
- v
3077
- ), L(
3131
+ x
3132
+ ), z(
3078
3133
  S(
3079
- at(
3134
+ mt(
3135
+ P(p, Se),
3080
3136
  P(b, Se),
3081
- P(z, Se),
3082
- P(q, (H, N) => H !== void 0 && H.column === N.column && H.row === N.row),
3137
+ P(Z, (H, j) => H !== void 0 && H.column === j.column && H.row === j.row),
3083
3138
  P(d)
3084
3139
  ),
3085
- k(([H, N, Y, it]) => ({
3086
- gap: Y,
3087
- item: N,
3088
- scrollTop: it,
3140
+ k(([H, j, q, Q]) => ({
3141
+ gap: q,
3142
+ item: j,
3143
+ scrollTop: Q,
3089
3144
  viewport: H
3090
3145
  }))
3091
3146
  ),
3092
- $
3093
- ), L(
3147
+ W
3148
+ ), z(
3094
3149
  S(
3095
- at(
3150
+ mt(
3096
3151
  P(B),
3097
3152
  o,
3098
- P(q, Gr),
3099
- P(z, Se),
3153
+ P(Z, Gr),
3100
3154
  P(b, Se),
3101
- P(U),
3102
- P(u),
3103
- P(J),
3104
- P(pt),
3105
- P(dt)
3155
+ P(p, Se),
3156
+ P(G),
3157
+ P(N),
3158
+ P(K),
3159
+ P(ut),
3160
+ P(ct)
3106
3161
  ),
3107
- W(([, , , , , , , H]) => !H),
3162
+ V(([, , , , , , , H]) => !H),
3108
3163
  k(
3109
3164
  ([
3110
3165
  H,
3111
- [N, Y],
3166
+ [j, q],
3167
+ Q,
3168
+ at,
3112
3169
  it,
3113
3170
  et,
3114
- Q,
3115
- ct,
3116
- xt,
3171
+ dt,
3117
3172
  ,
3118
- ut,
3119
- Vt
3173
+ Tt,
3174
+ lt
3120
3175
  ]) => {
3121
- const { column: Pt, row: ee } = it, { height: he, width: ke } = et, { width: ln } = Q;
3122
- if (xt === 0 && (H === 0 || ln === 0))
3123
- return Bn;
3124
- if (ke === 0) {
3125
- const fn = Ye(Vt, H), ho = fn + Math.max(xt - 1, 0);
3126
- return Wr(zn(fn, ho, ct));
3176
+ const { column: Pt, row: ee } = Q, { height: he, width: Be } = at, { width: ln } = it;
3177
+ if (dt === 0 && (H === 0 || ln === 0))
3178
+ return On;
3179
+ if (Be === 0) {
3180
+ const fn = Ye(lt, H), go = fn + Math.max(dt - 1, 0);
3181
+ return Pr(Fn(fn, go, et));
3127
3182
  }
3128
- const ge = fo(ln, ke, Pt);
3129
- let qt, Mt;
3130
- ut ? N === 0 && Y === 0 && xt > 0 ? (qt = 0, Mt = xt - 1) : (qt = ge * Ce((N + ee) / (he + ee)), Mt = ge * On((Y + ee) / (he + ee)) - 1, Mt = Fe(H - 1, oe(Mt, ge - 1)), qt = Fe(Mt, oe(0, qt))) : (qt = 0, Mt = -1);
3131
- const cn = zn(qt, Mt, ct), { bottom: un, top: an } = Fn(Q, it, et, cn), dn = On(H / ge), po = dn * he + (dn - 1) * ee - un;
3132
- return { bottom: un, itemHeight: he, items: cn, itemWidth: ke, offsetBottom: po, offsetTop: an, top: an };
3183
+ const ge = mo(ln, Be, Pt);
3184
+ let Zt, _t;
3185
+ Tt ? j === 0 && q === 0 && dt > 0 ? (Zt = 0, _t = dt - 1) : (Zt = ge * we((j + ee) / (he + ee)), _t = ge * Ln((q + ee) / (he + ee)) - 1, _t = Ve(H - 1, oe(_t, ge - 1)), Zt = Ve(_t, oe(0, Zt))) : (Zt = 0, _t = -1);
3186
+ const cn = Fn(Zt, _t, et), { bottom: un, top: an } = Vn(it, Q, at, cn), dn = Ln(H / ge), ho = dn * he + (dn - 1) * ee - un;
3187
+ return { bottom: un, itemHeight: he, items: cn, itemWidth: Be, offsetBottom: ho, offsetTop: an, top: an };
3133
3188
  }
3134
3189
  )
3135
3190
  ),
3136
- p
3137
- ), L(
3191
+ c
3192
+ ), z(
3138
3193
  S(
3139
- U,
3140
- W((H) => H !== null),
3194
+ G,
3195
+ V((H) => H !== null),
3141
3196
  k((H) => H.length)
3142
3197
  ),
3143
3198
  B
3144
- ), L(
3199
+ ), z(
3145
3200
  S(
3146
- at(b, z, p, q),
3147
- W(([H, N, { items: Y }]) => Y.length > 0 && N.height !== 0 && H.height !== 0),
3148
- k(([H, N, { items: Y }, it]) => {
3149
- const { bottom: et, top: Q } = Fn(H, it, N, Y);
3150
- return [Q, et];
3201
+ mt(p, b, c, Z),
3202
+ V(([H, j, { items: q }]) => q.length > 0 && j.height !== 0 && H.height !== 0),
3203
+ k(([H, j, { items: q }, Q]) => {
3204
+ const { bottom: at, top: it } = Vn(H, Q, j, q);
3205
+ return [it, at];
3151
3206
  }),
3152
- ot(le)
3207
+ ot(Jt)
3153
3208
  ),
3154
3209
  e
3155
3210
  );
3156
- const ht = w(!1);
3157
- L(
3211
+ const vt = y(!1);
3212
+ z(
3158
3213
  S(
3159
3214
  d,
3160
- D(ht),
3161
- k(([H, N]) => N || H !== 0)
3215
+ $(vt),
3216
+ k(([H, j]) => j || H !== 0)
3162
3217
  ),
3163
- ht
3218
+ vt
3164
3219
  );
3165
- const jt = Ct(
3166
- S(
3167
- at(p, B),
3168
- W(([{ items: H }]) => H.length > 0),
3169
- D(ht),
3170
- W(([[H, N], Y]) => {
3171
- const et = H.items[H.items.length - 1].index === N - 1;
3172
- return (Y || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === N) && et;
3220
+ const Ot = yt(
3221
+ S(
3222
+ mt(c, B),
3223
+ // A data publish rebuilds gridState before it updates totalCount. Skipping that intermediate step
3224
+ // avoids reporting the previous end index against the new data.
3225
+ V(([{ items: H }, j]) => {
3226
+ const q = tt(G);
3227
+ return H.length > 0 && (q === null || q.length === j);
3173
3228
  }),
3174
- k(([[, H]]) => H - 1),
3175
- ot()
3229
+ $(vt),
3230
+ V(([[H, j], q]) => {
3231
+ const at = H.items[H.items.length - 1].index === j - 1;
3232
+ return (q || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === j) && at;
3233
+ }),
3234
+ // Keying on the data array lets replaced data with a previously reported length fire again, matching
3235
+ // the list. withLatestFrom(data) subscribes after gridState and would still hold the previous array.
3236
+ k(([[, H]]) => [H - 1, tt(G)]),
3237
+ ot(Jt),
3238
+ k(([H]) => H)
3176
3239
  )
3177
- ), Qt = Ct(
3240
+ ), pe = yt(
3178
3241
  S(
3179
- P(p),
3180
- W(({ items: H }) => H.length > 0 && H[0].index === 0),
3181
- kt(0),
3242
+ P(c),
3243
+ V(({ items: H }) => H.length > 0 && H[0].index === 0),
3244
+ Ct(0),
3182
3245
  ot()
3183
3246
  )
3184
- ), Et = Ct(
3247
+ ), Yt = yt(
3185
3248
  S(
3186
- P(p),
3187
- D(J),
3188
- W(([{ items: H }, N]) => H.length > 0 && !N),
3249
+ P(c),
3250
+ $(K),
3251
+ V(([{ items: H }, j]) => H.length > 0 && !j),
3189
3252
  k(([{ items: H }]) => ({
3190
3253
  endIndex: H[H.length - 1].index,
3191
3254
  startIndex: H[0].index
3192
3255
  })),
3193
- ot(Un),
3194
- zt(0)
3256
+ ot(Kn),
3257
+ Wt(0)
3195
3258
  )
3196
3259
  );
3197
- L(Et, h.scrollSeekRangeChanged), L(
3198
- S(
3199
- F,
3200
- D(b, z, B, q),
3201
- k(([H, N, Y, it, et]) => {
3202
- const Q = Zn(H), { align: ct, behavior: xt, offset: ut } = Q;
3203
- let Vt = Q.index;
3204
- Vt === "LAST" && (Vt = it - 1), Vt = oe(0, Vt, Fe(it - 1, Vt));
3205
- let Pt = _e(N, et, Y, Vt);
3206
- return ct === "end" ? Pt = Ln(Pt - N.height + Y.height) : ct === "center" && (Pt = Ln(Pt - N.height / 2 + Y.height / 2)), ut !== void 0 && ut !== 0 && (Pt += ut), { behavior: xt, top: Pt };
3260
+ z(Yt, m.scrollSeekRangeChanged), z(
3261
+ S(
3262
+ O,
3263
+ $(p, b, B, Z),
3264
+ k(([H, j, q, Q, at]) => {
3265
+ const it = Xn(H), { align: et, behavior: dt, offset: Tt } = it;
3266
+ let lt = it.index;
3267
+ lt === "LAST" && (lt = Q - 1), lt = oe(0, lt, Ve(Q - 1, lt));
3268
+ let Pt = _e(j, at, q, lt);
3269
+ return et === "end" ? Pt = zn(Pt - j.height + q.height) : et === "center" && (Pt = zn(Pt - j.height / 2 + q.height / 2)), Tt !== void 0 && Tt !== 0 && (Pt += Tt), { behavior: dt, top: Pt };
3207
3270
  })
3208
3271
  ),
3209
- c
3272
+ u
3210
3273
  );
3211
- const te = gt(
3274
+ const Vt = gt(
3212
3275
  S(
3213
- p,
3276
+ c,
3214
3277
  k((H) => H.offsetBottom + H.bottom)
3215
3278
  ),
3216
3279
  0
3217
3280
  );
3218
- return L(
3281
+ return z(
3219
3282
  S(
3220
- x,
3283
+ I,
3221
3284
  k((H) => ({ height: H.visibleHeight, width: H.visibleWidth }))
3222
3285
  ),
3223
- b
3286
+ p
3224
3287
  ), {
3225
- customScrollParent: I,
3288
+ customScrollParent: g,
3226
3289
  // input
3227
- data: U,
3228
- deviation: V,
3290
+ data: G,
3291
+ deviation: F,
3229
3292
  footerHeight: r,
3230
- gap: q,
3293
+ gap: Z,
3231
3294
  headerHeight: s,
3232
3295
  increaseViewportBy: t,
3233
- initialItemCount: u,
3234
- itemDimensions: z,
3296
+ initialItemCount: N,
3297
+ itemDimensions: b,
3235
3298
  overscan: n,
3236
- restoreStateFrom: j,
3299
+ restoreStateFrom: ft,
3237
3300
  scrollBy: i,
3238
3301
  scrollContainerState: l,
3239
- scrollHeight: O,
3240
- scrollTo: c,
3241
- scrollToIndex: F,
3302
+ scrollHeight: L,
3303
+ scrollTo: u,
3304
+ scrollToIndex: O,
3242
3305
  scrollTop: d,
3243
3306
  smoothScrollTargetReached: f,
3244
3307
  totalCount: B,
3245
- useWindowScroll: g,
3246
- viewportDimensions: b,
3308
+ useWindowScroll: T,
3309
+ viewportDimensions: p,
3247
3310
  windowScrollContainerState: a,
3248
- windowScrollTo: T,
3249
- windowViewportRect: x,
3250
- ...h,
3311
+ windowScrollTo: C,
3312
+ windowViewportRect: I,
3313
+ ...m,
3251
3314
  // output
3252
- gridState: p,
3315
+ gridState: c,
3253
3316
  horizontalDirection: Ft,
3254
- initialTopMostItemIndex: dt,
3255
- totalListHeight: te,
3256
- ...m,
3257
- endReached: jt,
3317
+ initialTopMostItemIndex: ct,
3318
+ totalListHeight: Vt,
3319
+ ...h,
3320
+ endReached: Ot,
3258
3321
  propsReady: R,
3259
- rangeChanged: Et,
3260
- startReached: Qt,
3261
- stateChanged: $,
3262
- stateRestoreInProgress: J,
3263
- ...C
3322
+ rangeChanged: Yt,
3323
+ startReached: pe,
3324
+ stateChanged: W,
3325
+ stateRestoreInProgress: K,
3326
+ ...w
3264
3327
  };
3265
3328
  },
3266
- st(Ze, St, pe, no, At, Xe, Gt)
3329
+ st(Ze, St, me, oo, At, Xe, Mt)
3267
3330
  );
3268
- function fo(t, e, n) {
3269
- return oe(1, Ce((t + n) / (Ce(e) + n)));
3331
+ function mo(t, e, n) {
3332
+ return oe(1, we((t + n) / (we(e) + n)));
3270
3333
  }
3271
- function Fn(t, e, n, o) {
3334
+ function Vn(t, e, n, o) {
3272
3335
  const { height: r } = n;
3273
3336
  if (r === void 0 || o.length === 0)
3274
3337
  return { bottom: 0, top: 0 };
@@ -3276,120 +3339,120 @@ function Fn(t, e, n, o) {
3276
3339
  return { bottom: _e(t, e, n, o[o.length - 1].index) + r, top: s };
3277
3340
  }
3278
3341
  function _e(t, e, n, o) {
3279
- const r = fo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + oe(0, s - 1) * e.row;
3342
+ const r = mo(t.width, n.width, e.column), s = we(o / r), i = s * n.height + oe(0, s - 1) * e.row;
3280
3343
  return i > 0 ? i + e.row : i;
3281
3344
  }
3282
- const Mr = /* @__PURE__ */ Z(() => {
3283
- const t = w((v) => `Item ${v}`), e = w({}), n = w(null), o = w("virtuoso-grid-item"), r = w("virtuoso-grid-list"), s = w(tn), i = w("div"), l = w(Jt), c = (v, m = null) => gt(
3345
+ const Ar = /* @__PURE__ */ Y(() => {
3346
+ const t = y((x) => `Item ${x}`), e = y({}), n = y(null), o = y("virtuoso-grid-item"), r = y("virtuoso-grid-list"), s = y(tn), i = y("div"), l = y(te), u = (x, h = null) => gt(
3284
3347
  S(
3285
3348
  e,
3286
- k((h) => h[v]),
3349
+ k((m) => m[x]),
3287
3350
  ot()
3288
3351
  ),
3289
- m
3290
- ), d = w(!1), f = w(!1);
3291
- return L(P(f), d), {
3352
+ h
3353
+ ), d = y(!1), f = y(!1);
3354
+ return z(P(f), d), {
3292
3355
  components: e,
3293
3356
  computeItemKey: s,
3294
3357
  context: n,
3295
- FooterComponent: c("Footer"),
3296
- HeaderComponent: c("Header"),
3358
+ FooterComponent: u("Footer"),
3359
+ HeaderComponent: u("Header"),
3297
3360
  headerFooterTag: i,
3298
3361
  itemClassName: o,
3299
- ItemComponent: c("Item", "div"),
3362
+ ItemComponent: u("Item", "div"),
3300
3363
  itemContent: t,
3301
3364
  listClassName: r,
3302
- ListComponent: c("List", "div"),
3365
+ ListComponent: u("List", "div"),
3303
3366
  readyStateChanged: d,
3304
3367
  reportReadyState: f,
3305
- ScrollerComponent: c("Scroller", "div"),
3368
+ ScrollerComponent: u("Scroller", "div"),
3306
3369
  scrollerRef: l,
3307
- ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
3370
+ ScrollSeekPlaceholder: u("ScrollSeekPlaceholder", "div")
3308
3371
  };
3309
- }), _r = /* @__PURE__ */ Z(
3372
+ }), _r = /* @__PURE__ */ Y(
3310
3373
  ([t, e]) => ({ ...t, ...e }),
3311
- st(Ar, Mr)
3374
+ st(Mr, Ar)
3312
3375
  ), Nr = /* @__PURE__ */ E.memo(function() {
3313
- const e = nt("gridState"), n = nt("listClassName"), o = nt("itemClassName"), r = nt("itemContent"), s = nt("computeItemKey"), i = nt("isSeeking"), l = yt("scrollHeight"), c = nt("ItemComponent"), d = nt("ListComponent"), f = nt("ScrollSeekPlaceholder"), v = nt("context"), m = yt("itemDimensions"), h = yt("gap"), y = nt("log"), R = nt("stateRestoreInProgress"), I = yt("reportReadyState"), g = Ot(
3376
+ const e = nt("gridState"), n = nt("listClassName"), o = nt("itemClassName"), r = nt("itemContent"), s = nt("computeItemKey"), i = nt("isSeeking"), l = Rt("scrollHeight"), u = nt("ItemComponent"), d = nt("ListComponent"), f = nt("ScrollSeekPlaceholder"), x = nt("context"), h = Rt("itemDimensions"), m = Rt("gap"), v = nt("log"), R = nt("stateRestoreInProgress"), g = Rt("reportReadyState"), T = Lt(
3314
3377
  E.useMemo(
3315
3378
  () => (a) => {
3316
- const T = a.parentElement.parentElement.scrollHeight;
3317
- l(T);
3318
- const x = a.firstChild;
3319
- if (x !== null) {
3320
- const { height: C, width: B } = x.getBoundingClientRect();
3321
- m({ height: C, width: B });
3379
+ const C = a.parentElement.parentElement.scrollHeight;
3380
+ l(C);
3381
+ const I = a.firstChild;
3382
+ if (I !== null) {
3383
+ const { height: w, width: B } = I.getBoundingClientRect();
3384
+ h({ height: w, width: B });
3322
3385
  }
3323
- h({
3324
- column: Vn("column-gap", getComputedStyle(a).columnGap, y),
3325
- row: Vn("row-gap", getComputedStyle(a).rowGap, y)
3386
+ m({
3387
+ column: Wn("column-gap", getComputedStyle(a).columnGap, v),
3388
+ row: Wn("row-gap", getComputedStyle(a).rowGap, v)
3326
3389
  });
3327
3390
  },
3328
- [l, m, h, y]
3391
+ [l, h, m, v]
3329
3392
  ),
3330
3393
  !0,
3331
3394
  !1
3332
3395
  );
3333
- return be(() => {
3334
- e.itemHeight > 0 && e.itemWidth > 0 && I(!0);
3335
- }, [e]), R ? null : /* @__PURE__ */ G(
3396
+ return Re(() => {
3397
+ e.itemHeight > 0 && e.itemWidth > 0 && g(!0);
3398
+ }, [e]), R ? null : /* @__PURE__ */ M(
3336
3399
  d,
3337
3400
  {
3338
3401
  className: n,
3339
- ref: g,
3340
- ...rt(d, v),
3402
+ ref: T,
3403
+ ...rt(d, x),
3341
3404
  "data-testid": "virtuoso-item-list",
3342
3405
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
3343
3406
  children: e.items.map((a) => {
3344
- const T = s(a.index, a.data, v);
3345
- return i ? /* @__PURE__ */ G(
3407
+ const C = s(a.index, a.data, x);
3408
+ return i ? /* @__PURE__ */ M(
3346
3409
  f,
3347
3410
  {
3348
- ...rt(f, v),
3411
+ ...rt(f, x),
3349
3412
  height: e.itemHeight,
3350
3413
  index: a.index,
3351
3414
  width: e.itemWidth
3352
3415
  },
3353
- T
3354
- ) : /* @__PURE__ */ Dt(
3355
- c,
3416
+ C
3417
+ ) : /* @__PURE__ */ Ut(
3418
+ u,
3356
3419
  {
3357
- ...rt(c, v),
3420
+ ...rt(u, x),
3358
3421
  className: o,
3359
3422
  "data-index": a.index,
3360
- key: T
3423
+ key: C
3361
3424
  },
3362
- r(a.index, a.data, v)
3425
+ r(a.index, a.data, x)
3363
3426
  );
3364
3427
  })
3365
3428
  }
3366
3429
  );
3367
3430
  }), Dr = E.memo(function() {
3368
- const e = nt("HeaderComponent"), n = yt("headerHeight"), o = nt("headerFooterTag"), r = Ot(
3431
+ const e = nt("HeaderComponent"), n = Rt("headerHeight"), o = nt("headerFooterTag"), r = Lt(
3369
3432
  E.useMemo(
3370
3433
  () => (i) => {
3371
- n(Ht(i, "height"));
3434
+ n(Bt(i, "height"));
3372
3435
  },
3373
3436
  [n]
3374
3437
  ),
3375
3438
  !0,
3376
3439
  !1
3377
3440
  ), s = nt("context");
3378
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
3441
+ return e != null ? /* @__PURE__ */ M(o, { ref: r, children: /* @__PURE__ */ M(e, { ...rt(e, s) }) }) : null;
3379
3442
  }), $r = E.memo(function() {
3380
- const e = nt("FooterComponent"), n = yt("footerHeight"), o = nt("headerFooterTag"), r = Ot(
3443
+ const e = nt("FooterComponent"), n = Rt("footerHeight"), o = nt("headerFooterTag"), r = Lt(
3381
3444
  E.useMemo(
3382
3445
  () => (i) => {
3383
- n(Ht(i, "height"));
3446
+ n(Bt(i, "height"));
3384
3447
  },
3385
3448
  [n]
3386
3449
  ),
3387
3450
  !0,
3388
3451
  !1
3389
3452
  ), s = nt("context");
3390
- return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
3453
+ return e != null ? /* @__PURE__ */ M(o, { ref: r, children: /* @__PURE__ */ M(e, { ...rt(e, s) }) }) : null;
3391
3454
  }), Ur = ({ children: t }) => {
3392
- const e = E.useContext(so), n = yt("itemDimensions"), o = yt("viewportDimensions"), r = Ot(
3455
+ const e = E.useContext(io), n = Rt("itemDimensions"), o = Rt("viewportDimensions"), r = Lt(
3393
3456
  E.useMemo(
3394
3457
  () => (s) => {
3395
3458
  o(s.getBoundingClientRect());
@@ -3401,24 +3464,24 @@ const Mr = /* @__PURE__ */ Z(() => {
3401
3464
  );
3402
3465
  return E.useEffect(() => {
3403
3466
  e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
3404
- }, [e, o, n]), /* @__PURE__ */ G("div", { ref: r, style: Ee(!1), children: t });
3467
+ }, [e, o, n]), /* @__PURE__ */ M("div", { ref: r, style: ke(!1), children: t });
3405
3468
  }, Kr = ({ children: t }) => {
3406
- const e = E.useContext(so), n = yt("windowViewportRect"), o = yt("itemDimensions"), r = nt("customScrollParent"), s = nt("useWindowScroll"), i = Ue(n, r, !1);
3469
+ const e = E.useContext(io), n = Rt("windowViewportRect"), o = Rt("itemDimensions"), r = nt("customScrollParent"), s = nt("useWindowScroll"), i = Ue(n, r, !1);
3407
3470
  return E.useEffect(() => {
3408
3471
  e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
3409
- }, [e, n, o]), /* @__PURE__ */ G("div", { ref: i, style: en(!1, s), children: t });
3472
+ }, [e, n, o]), /* @__PURE__ */ M("div", { ref: i, style: en(!1, s), children: t });
3410
3473
  }, jr = /* @__PURE__ */ E.memo(function({ ...e }) {
3411
3474
  const n = nt("useWindowScroll"), o = nt("customScrollParent"), r = o || n ? Zr : Yr, s = o || n ? Kr : Ur, i = nt("context");
3412
- return /* @__PURE__ */ G(r, { ...e, ...rt(r, i), children: /* @__PURE__ */ $t(s, { children: [
3413
- /* @__PURE__ */ G(Dr, {}),
3414
- /* @__PURE__ */ G(Nr, {}),
3415
- /* @__PURE__ */ G($r, {})
3475
+ return /* @__PURE__ */ M(r, { ...e, ...rt(r, i), children: /* @__PURE__ */ Kt(s, { children: [
3476
+ /* @__PURE__ */ M(Dr, {}),
3477
+ /* @__PURE__ */ M(Nr, {}),
3478
+ /* @__PURE__ */ M($r, {})
3416
3479
  ] }) });
3417
3480
  }), {
3418
3481
  Component: qr,
3419
- useEmitter: mo,
3482
+ useEmitter: po,
3420
3483
  useEmitterValue: nt,
3421
- usePublisher: yt
3484
+ usePublisher: Rt
3422
3485
  } = /* @__PURE__ */ Je(
3423
3486
  _r,
3424
3487
  {
@@ -3460,18 +3523,18 @@ const Mr = /* @__PURE__ */ Z(() => {
3460
3523
  }
3461
3524
  },
3462
3525
  jr
3463
- ), Yr = /* @__PURE__ */ nn({ useEmitter: mo, useEmitterValue: nt, usePublisher: yt }), Zr = /* @__PURE__ */ on({ useEmitter: mo, useEmitterValue: nt, usePublisher: yt });
3464
- function Vn(t, e, n) {
3465
- return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3526
+ ), Yr = /* @__PURE__ */ nn({ useEmitter: po, useEmitterValue: nt, usePublisher: Rt }), Zr = /* @__PURE__ */ on({ useEmitter: po, useEmitterValue: nt, usePublisher: Rt });
3527
+ function Wn(t, e, n) {
3528
+ return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ht.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
3466
3529
  }
3467
3530
  const ss = qr;
3468
3531
  export {
3469
3532
  rs as GroupedTableVirtuoso,
3470
3533
  ns as GroupedVirtuoso,
3471
- mt as LogLevel,
3534
+ ht as LogLevel,
3472
3535
  os as TableVirtuoso,
3473
3536
  es as Virtuoso,
3474
3537
  ss as VirtuosoGrid,
3475
- so as VirtuosoGridMockContext,
3476
- He as VirtuosoMockContext
3538
+ io as VirtuosoGridMockContext,
3539
+ Ee as VirtuosoMockContext
3477
3540
  };