react-virtuoso 4.14.1 → 4.16.1

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