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