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