virtua 0.50.3 → 0.50.5

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/lib/index.cjs CHANGED
@@ -4,832 +4,835 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- var e = Object.create, t = Object.defineProperty, o = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, n = Object.getPrototypeOf, l = Object.prototype.hasOwnProperty;
7
+ var e = Object.create, t = Object.defineProperty, o = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.getPrototypeOf, i = Object.prototype.hasOwnProperty;
8
8
 
9
9
  let s = require("react");
10
10
 
11
- var i, c;
11
+ var l, c;
12
12
 
13
- c = null != (i = s) ? e(n(i)) : {}, s = ((e, n, s, i) => {
14
- if (n && "object" == typeof n || "function" == typeof n) for (var c, f = r(n), u = 0, a = f.length; u < a; u++) c = f[u],
15
- l.call(e, c) || void 0 === c || t(e, c, {
16
- get: (e => n[e]).bind(null, c),
17
- enumerable: !(i = o(n, c)) || i.enumerable
13
+ c = null != (l = s) ? e(r(l)) : {}, s = ((e, r, s, l) => {
14
+ if (r && "object" == typeof r || "function" == typeof r) for (var c, f = n(r), u = 0, a = f.length; u < a; u++) c = f[u],
15
+ i.call(e, c) || void 0 === c || t(e, c, {
16
+ get: (e => r[e]).bind(null, c),
17
+ enumerable: !(l = o(r, c)) || l.enumerable
18
18
  });
19
19
  return e;
20
20
  })(t(c, "default", {
21
- value: i,
21
+ value: l,
22
22
  enumerable: !0
23
- }), i);
23
+ }), l);
24
24
 
25
25
  let f = require("react/jsx-runtime"), u = require("react-dom");
26
26
 
27
- var {min: a, max: d, abs: h, floor: g} = Math, v = (e, t, o) => a(o, d(t, e)), p = e => [ ...e ].sort((e, t) => e - t), S = setTimeout, w = "function" == typeof queueMicrotask ? queueMicrotask : e => {
27
+ var {min: a, max: d, abs: h, floor: g} = Math, v = (e, t, o) => a(o, d(t, e)), S = e => [ ...e ].sort((e, t) => e - t), p = setTimeout, $ = "function" == typeof queueMicrotask ? queueMicrotask : e => {
28
28
  Promise.resolve().then(e);
29
29
  }, m = () => {
30
30
  let e;
31
31
  return [ new Promise(t => {
32
32
  e = t;
33
33
  }), e ];
34
- }, _ = e => {
34
+ }, w = e => {
35
35
  let t;
36
36
  return () => (e && (t = e(), e = void 0), t);
37
- }, b = (e, t, o) => {
38
- const r = o ? "unshift" : "push";
39
- for (let o = 0; o < t; o++) e[r](-1);
40
- return e;
41
- }, $ = (e, t) => {
42
- const o = e.t[t];
43
- return -1 === o ? e.o : o;
44
- }, z = (e, t, o) => {
45
- const r = -1 === e.t[t];
46
- return e.t[t] = o, e.l = a(t, e.l), r;
47
- }, y = (e, t) => {
48
- if (!e.i) return 0;
49
- if (e.l >= t) return e.u[t];
50
- e.l < 0 && (e.u[0] = 0, e.l = 0);
51
- let o = e.l, r = e.u[o];
52
- for (;o < t; ) r += $(e, o), e.u[++o] = r;
53
- return e.l = t, r;
54
- }, x = (e, t, o = 0, r = e.i - 1) => {
55
- let n = o;
56
- for (;o <= r; ) {
57
- const l = g((o + r) / 2);
58
- y(e, l) <= t ? (n = l, o = l + 1) : r = l - 1;
59
- }
60
- return v(n, 0, e.i - 1);
61
- }, I = (e, t, o) => {
62
- const r = t - e.i;
63
- return e.l = o ? -1 : a(t - 1, e.l), e.i = t, r > 0 ? (b(e.u, r), b(e.t, r, o),
64
- e.o * r) : (e.u.splice(r), (o ? e.t.splice(0, -r) : e.t.splice(r)).reduce((t, o) => t - (-1 === o ? e.o : o), 0));
65
- }, k = "undefined" != typeof window, O = e => e.documentElement, C = e => e.ownerDocument, R = e => e.defaultView, M = /*#__PURE__*/ _(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), T = /*#__PURE__*/ _(() => "scrollBehavior" in O(document).style), j = e => d(e.h(), e.v()), E = (e, t = 40, o = 0, r, n = !1) => {
66
- let l = !!o, s = 1, i = 0, c = 0, f = 0, u = 0, g = 0, v = 0, S = 0, w = 0, m = null, _ = [ 0, l ? d(o - 1, 0) : -1 ], k = 0, O = !1;
67
- const C = ((e, t, o) => ({
68
- o: t,
69
- t: o ? b(o.slice(0, a(e, o.length)), d(0, e - o.length)) : b([], e),
70
- i: e,
71
- l: -1,
72
- u: b([], e + 1)
73
- }))(e, r && r[1] || t, r && r[0]), R = /* @__PURE__ */ new Set, T = () => f - c, j = () => T() + g + u, E = (e, t) => ((e, t, o, r) => {
74
- if (r = a(r, e.i - 1), y(e, r) <= t) {
75
- const n = x(e, o, r);
76
- return [ x(e, t, r, n), n ];
77
- }
78
- {
79
- const n = x(e, t, void 0, r);
80
- return [ n, x(e, o, n) ];
81
- }
82
- })(C, e, t, _[0]), H = () => y(C, C.i), W = (e, t) => {
83
- const o = y(C, e) - g;
84
- return t ? H() - o - B(e) : o;
85
- }, B = e => $(C, e), q = (e, t = -1) => C.t[e] === t, J = e => {
86
- e && (M() && 0 !== S || m && 1 === w ? g += e : u += e);
37
+ }, z = "undefined" != typeof window, _ = e => e.documentElement, b = e => e.ownerDocument, y = e => e.defaultView, I = /*#__PURE__*/ w(() => !!/iP(hone|od|ad)/.test(navigator.userAgent) || "MacIntel" === navigator.platform && navigator.maxTouchPoints > 0), x = /*#__PURE__*/ w(() => "scrollBehavior" in _(document).style), k = e => d(e.t(), e.o()), O = ({i: e, l: t, u: o, h: n, v: r, S: i, t: s, p: l, $: c, m: f}, u = 0) => {
38
+ let g = !!f, v = !!u, S = 1, p = 0, $ = 0, m = 0, w = 0, z = 0, _ = 0, b = 0, y = 0, x = null, k = [ 0, v ? d(u - 1, 0) : -1 ], O = 0, R = !1;
39
+ const C = /* @__PURE__ */ new Set, M = () => m - $, T = () => M() + z + w, E = (e, t) => {
40
+ const r = o(e) - z;
41
+ return t ? s() - r - n(e) : r;
42
+ }, j = e => {
43
+ e && (I() && 0 !== b || x && 1 === y ? z += e : w += e);
87
44
  };
88
45
  return {
89
- p: () => {
90
- R.clear();
91
- },
92
- S: () => s,
93
- m: () => (e => [ e.t.slice(), e.o ])(C),
94
- _: (e = 200) => {
95
- if (!O || l) return _;
96
- let t, o;
97
- if (v) [t, o] = _; else {
98
- let r = d(0, j()), l = r + i;
99
- n || (e = d(0, e), 1 !== S && (r -= e), 2 !== S && (l += e)), [t, o] = _ = E(d(0, r), d(0, l)),
100
- m && (t = a(t, m[0]), o = d(o, m[1]));
46
+ _: () => {
47
+ C.clear();
48
+ },
49
+ I: () => S,
50
+ i: (t = 200) => {
51
+ if (!R || v) return k;
52
+ let o, n;
53
+ if (_) [o, n] = k; else {
54
+ let r = d(0, T()), i = r + p;
55
+ g || (t = d(0, t), 1 !== b && (r -= t), 2 !== b && (i += t)), [o, n] = k = e(d(0, r), d(0, i)),
56
+ x && (o = a(o, x[0]), n = d(n, x[1]));
101
57
  }
102
- return [ d(t, 0), a(o, C.i - 1) ];
103
- },
104
- $: e => x(C, e - c),
105
- I: q,
106
- k: W,
107
- O: B,
108
- C: () => C.i,
109
- R: () => f,
110
- M: () => 0 !== S,
111
- v: () => i,
112
- T: () => c,
113
- h: H,
114
- j: () => (v = u, u = 0, [ v, 2 === w ]),
115
- H: (e, t) => {
58
+ return [ d(o, 0), a(n, l() - 1) ];
59
+ },
60
+ k: e => t(e - $),
61
+ O: i,
62
+ u: E,
63
+ h: n,
64
+ R: l,
65
+ C: () => m,
66
+ M: () => 0 !== b,
67
+ o: () => p,
68
+ T: () => $,
69
+ t: s,
70
+ j: () => (_ = w, w = 0, [ _, 2 === y ]),
71
+ L: (e, t) => {
116
72
  const o = [ e, t ];
117
- return R.add(o), () => {
118
- R.delete(o);
73
+ return C.add(o), () => {
74
+ C.delete(o);
119
75
  };
120
76
  },
121
- W: (e, t) => {
122
- let o, r, a = 0;
123
- switch (e) {
77
+ q: (o, l) => {
78
+ let u, a, d = 0;
79
+ switch (o) {
124
80
  case 1:
125
81
  {
126
- if (t === f && 0 === w) break;
127
- const e = v;
128
- v = 0;
129
- const o = t - f, n = h(o);
130
- e && n < h(e) + 1 || 0 !== w || (S = o < 0 ? 2 : 1), l && (l = !1), f = t, a = 4;
131
- const s = T();
132
- s >= -i && s <= H() && (a += 1, r = n > i);
82
+ if (l === m && 0 === y) break;
83
+ const e = _;
84
+ _ = 0;
85
+ const t = l - m, o = h(t);
86
+ e && o < h(e) + 1 || 0 !== y || (b = t < 0 ? 2 : 1), v && (v = !1), m = l, d = 4;
87
+ const n = M();
88
+ n >= -p && n <= s() && (d += 1, a = o > p);
133
89
  break;
134
90
  }
135
91
 
136
92
  case 2:
137
- a = 8, 0 !== S && (o = !0, a += 1), S = 0, w = 0, m = null;
93
+ d = 8, 0 !== b && (u = !0, d += 1), b = 0, y = 0, x = null;
138
94
  break;
139
95
 
140
96
  case 3:
141
97
  {
142
- const e = t.filter(([e, t]) => !q(e, t));
98
+ const e = l.filter(([e, t]) => !i(e, t));
143
99
  if (!e.length) break;
144
- J(e.reduce((e, [t, o]) => {
100
+ j(e.reduce((e, [t, o]) => {
145
101
  let r;
146
- if (2 === w) r = !0; else if (m && 1 === w) r = t < m[0]; else {
147
- const e = T(), o = W(t), n = B(t);
148
- r = 1 !== S && 0 === w ? o + n <= e : o < e && o + n < e + i;
102
+ if (2 === y) r = !0; else if (x && 1 === y) r = t < x[0]; else {
103
+ const e = M(), o = E(t), i = n(t);
104
+ r = 1 !== b && 0 === y ? o + i <= e : o < e && o + i < e + p;
149
105
  }
150
- return r && (e += o - B(t)), e;
106
+ return r && (e += o - n(t)), e;
151
107
  }, 0));
152
108
  for (const [t, o] of e) {
153
- const e = B(t), r = z(C, t, o);
154
- n && (k += r ? o : o - e);
109
+ const e = n(t), i = r(t, o);
110
+ g && (O += i ? o : o - e);
155
111
  }
156
- n && i && k > i && (J(((e, t) => {
157
- let o = 0;
158
- const r = [];
159
- e.t.forEach((e, n) => {
160
- -1 !== e && (r.push(e), n < t && o++);
161
- }), e.l = -1;
162
- const n = p(r), l = n.length, s = l / 2 | 0, i = l % 2 == 0 ? (n[s - 1] + n[s]) / 2 : n[s], c = e.o;
163
- return ((e.o = i) - c) * d(t - o, 0);
164
- })(C, x(C, j()))), n = !1), a = 3, r = !0;
112
+ g && p && O > p && (j(f(t(T()))), g = !1), d = 3, a = !0;
165
113
  break;
166
114
  }
167
115
 
168
116
  case 4:
169
- i !== t && (i || (O = r = !0), i = t, a = 3);
117
+ p !== l && (p || (R = a = !0), p = l, d = 3);
170
118
  break;
171
119
 
172
120
  case 5:
173
- t[1] ? (J(I(C, t[0], !0)), w = 2, a = 1) : (I(C, t[0]), a = 1);
121
+ l[1] ? (j(c(l[0], !0)), y = 2, d = 1) : (c(l[0]), d = 1);
174
122
  break;
175
123
 
176
124
  case 6:
177
- c = t;
125
+ $ = l;
178
126
  break;
179
127
 
180
128
  case 7:
181
- w = 1;
129
+ y = 1;
182
130
  break;
183
131
 
184
132
  case 8:
185
- m = E(t, t + i), a = 1;
133
+ x = e(l, l + p), d = 1;
186
134
  }
187
- a && (s = 1 + (2147483647 & s), o && g && (u += g, g = 0), R.forEach(([e, t]) => {
188
- a & e && t(r);
135
+ d && (S = 1 + (2147483647 & S), u && z && (w += z, z = 0), C.forEach(([e, t]) => {
136
+ d & e && t(a);
189
137
  }));
190
138
  }
191
139
  };
192
- }, H = e => {
140
+ }, R = (e, t, o, n = 0, r = t - 1) => {
141
+ let i = n;
142
+ for (;n <= r; ) {
143
+ const t = g((n + r) / 2);
144
+ e(t) <= o ? (i = t, n = t + 1) : r = t - 1;
145
+ }
146
+ return v(i, 0, t - 1);
147
+ }, C = (e, t, o) => {
148
+ const n = o ? "unshift" : "push";
149
+ for (let o = 0; o < t; o++) e[n](-1);
150
+ return e;
151
+ }, M = (e, t, o) => {
152
+ let n = o && o[1] || t || 40, r = -1, i = 0;
153
+ const s = o && o[0], l = s ? C(s.slice(0, a(e, s.length)), d(0, e - s.length)) : C([], e), c = C([], e + 1), f = e => {
154
+ const t = l[e];
155
+ return -1 === t ? n : t;
156
+ }, u = t => {
157
+ if (!e) return 0;
158
+ if (r >= t) return c[t];
159
+ r < 0 && (c[0] = 0, r = 0);
160
+ let o = r, n = c[o];
161
+ for (;o < t; ) n += f(o), c[++o] = n;
162
+ return r = t, n;
163
+ };
164
+ return {
165
+ i: (t, o) => {
166
+ let n, r;
167
+ return i = a(i, e - 1), u(i) <= t ? (r = R(u, e, o, i), n = R(u, e, t, i, r)) : (n = R(u, e, t, void 0, i),
168
+ r = R(u, e, o, n)), i = n, [ n, r ];
169
+ },
170
+ l: t => R(u, e, t),
171
+ u,
172
+ h: f,
173
+ v: (e, t) => {
174
+ const o = -1 === l[e];
175
+ return l[e] = t, r = a(e, r), o;
176
+ },
177
+ S: (e, t = -1) => l[e] === t,
178
+ t: () => u(e),
179
+ p: () => e,
180
+ $: (t, o) => {
181
+ const i = t - e;
182
+ return r = o ? -1 : a(t - 1, r), e = t, i > 0 ? (C(c, i), C(l, i, o), n * i) : (c.splice(i),
183
+ (o ? l.splice(0, -i) : l.splice(i)).reduce((e, t) => e - (-1 === t ? n : t), 0));
184
+ },
185
+ m: t ? void 0 : e => {
186
+ let t = 0;
187
+ const o = [];
188
+ l.forEach((n, r) => {
189
+ -1 !== n && (n && o.push(n), r < e && t++);
190
+ }), r = -1;
191
+ const i = S(o), s = i.length, c = s / 2 | 0, f = s % 2 == 0 ? (i[c - 1] + i[c]) / 2 : i[c], u = n;
192
+ return ((n = f) - u) * d(e - t, 0);
193
+ },
194
+ H: () => [ l.slice(), n ]
195
+ };
196
+ }, T = e => {
193
197
  let t;
194
198
  return {
195
- B(o) {
196
- (t || (t = new (R(C(o)).ResizeObserver)(e))).observe(o);
199
+ W(o) {
200
+ (t || (t = new (y(b(o)).ResizeObserver)(e))).observe(o);
197
201
  },
198
- q(e) {
202
+ B(e) {
199
203
  t.unobserve(e);
200
204
  },
201
- J() {
205
+ X() {
202
206
  t && t.disconnect();
203
207
  }
204
208
  };
205
- }, W = (e, t) => t ? -e : e, B = (e, t, o, r, n, l) => {
209
+ }, E = (e, t) => t ? -e : e, j = (e, t, o, n, r, i) => {
206
210
  const s = Date.now;
207
- let i = 0, c = !1, f = !1, u = !1, a = !1;
211
+ let l = 0, c = !1, f = !1, u = !1, a = !1;
208
212
  const d = (() => {
209
213
  let t;
210
214
  const o = () => {
211
215
  null != t && clearTimeout(t);
212
- }, r = () => {
213
- o(), t = S(() => {
216
+ }, n = () => {
217
+ o(), t = p(() => {
214
218
  t = null, (() => {
215
219
  if (c || f) return c = !1, void d();
216
- u = !1, e.W(2);
220
+ u = !1, e.q(2);
217
221
  })();
218
222
  }, 150);
219
223
  };
220
- return r.L = o, r;
224
+ return n.Y = o, n;
221
225
  })(), h = () => {
222
- i = s(), u && (a = !0), l && e.W(6, l()), e.W(1, r()), d();
226
+ l = s(), u && (a = !0), i && e.q(6, i()), e.q(1, n()), d();
223
227
  }, g = t => {
224
228
  if (c || !e.M() || t.ctrlKey) return;
225
- const r = s() - i;
226
- 150 > r && 50 < r && (o ? t.deltaX : t.deltaY) && (c = !0);
229
+ const n = s() - l;
230
+ 150 > n && 50 < n && (o ? t.deltaX : t.deltaY) && (c = !0);
227
231
  }, v = () => {
228
232
  f = !0, u = a = !1;
229
- }, p = () => {
230
- f = !1, M() && (u = !0);
233
+ }, S = () => {
234
+ f = !1, I() && (u = !0);
231
235
  };
232
236
  return t.addEventListener("scroll", h), t.addEventListener("wheel", g, {
233
237
  passive: !0
234
238
  }), t.addEventListener("touchstart", v, {
235
239
  passive: !0
236
- }), t.addEventListener("touchend", p, {
240
+ }), t.addEventListener("touchend", S, {
237
241
  passive: !0
238
242
  }), {
239
- J: () => {
243
+ X: () => {
240
244
  t.removeEventListener("scroll", h), t.removeEventListener("wheel", g), t.removeEventListener("touchstart", v),
241
- t.removeEventListener("touchend", p), d.L();
245
+ t.removeEventListener("touchend", S), d.Y();
242
246
  },
243
- X: () => {
247
+ A: () => {
244
248
  const [t, o] = e.j();
245
- t && (n(t, o, a), a = !1, o && e.v() > e.h() && e.W(1, r()));
249
+ t && (r(t, o, a), a = !1, o && e.o() > e.t() && e.q(1, n()));
246
250
  }
247
251
  };
248
- }, q = (e, t, o) => {
249
- let r;
250
- return [ async (n, l) => {
252
+ }, L = (e, t, o) => {
253
+ let n;
254
+ return [ async (r, i) => {
251
255
  if (!await t()) return;
252
- r && r();
256
+ n && n();
253
257
  const s = () => {
254
258
  const [t, o] = m();
255
- return r = () => {
259
+ return n = () => {
256
260
  o(!1);
257
- }, e.v() && S(r, 150), [ t, e.H(2, () => {
261
+ }, e.o() && p(n, 150), [ t, e.L(2, () => {
258
262
  o(!0);
259
263
  }) ];
260
264
  };
261
- if (l && T()) e.W(8, n()), w(async () => {
265
+ if (i && x()) e.q(8, r()), $(async () => {
262
266
  for (;;) {
263
267
  let t = !0;
264
- for (let [o, r] = e._(); o <= r; o++) if (e.I(o)) {
268
+ for (let [o, n] = e.i(); o <= n; o++) if (e.O(o)) {
265
269
  t = !1;
266
270
  break;
267
271
  }
268
272
  if (t) break;
269
- const [o, r] = s();
273
+ const [o, n] = s();
270
274
  try {
271
275
  if (!await o) return;
272
276
  } finally {
273
- r();
277
+ n();
274
278
  }
275
279
  }
276
- e.W(7), o(n(), l);
280
+ e.q(7), o(r(), i);
277
281
  }); else for (;;) {
278
- const [t, r] = s();
282
+ const [t, n] = s();
279
283
  try {
280
- if (e.W(7), o(n()), !await t) return;
284
+ if (e.q(7), o(r()), !await t) return;
281
285
  } finally {
282
- r();
286
+ n();
283
287
  }
284
288
  }
285
289
  }, () => {
286
- r && r();
290
+ n && n();
287
291
  } ];
288
- }, J = (e, t) => {
289
- let o, r, n = m(), l = !1;
290
- const s = t ? "scrollLeft" : "scrollTop", i = t ? "overflowX" : "overflowY", [c, f] = q(e, () => n[0], (e, r) => {
291
- e = W(e, l), r ? o.scrollTo({
292
+ }, q = (e, t) => {
293
+ let o, n, r = m(), i = !1;
294
+ const s = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", [c, f] = L(e, () => r[0], (e, n) => {
295
+ e = E(e, i), n ? o.scrollTo({
292
296
  [t ? "left" : "top"]: e,
293
297
  behavior: "smooth"
294
298
  }) : o[s] = e;
295
- }), u = t ? "width" : "height", a = /* @__PURE__ */ new WeakMap, d = H(t => {
296
- const r = [];
297
- for (const {target: n, contentRect: l} of t) if (n.offsetParent) if (n === o) e.W(4, l[u]); else {
298
- const e = a.get(n);
299
- null != e && r.push([ e, l[u] ]);
299
+ }), u = t ? "width" : "height", a = /* @__PURE__ */ new WeakMap, d = T(t => {
300
+ const n = [];
301
+ for (const {target: r, contentRect: i} of t) if (r.offsetParent) if (r === o) e.q(4, i[u]); else {
302
+ const e = a.get(r);
303
+ null != e && n.push([ e, i[u] ]);
300
304
  }
301
- r.length && e.W(3, r);
305
+ n.length && e.q(3, n);
302
306
  });
303
307
  return {
304
- Y(c, u = c.parentElement) {
305
- d.B(o = u), t && (l = "rtl" === getComputedStyle(u).direction), r = B(e, u, t, () => W(u[s], l), (t, o, r) => {
306
- if (r) {
307
- const e = u.style, t = e[i];
308
- e[i] = "hidden", S(() => {
309
- e[i] = t;
308
+ D(c, u = c.parentElement) {
309
+ d.W(o = u), t && (i = "rtl" === getComputedStyle(u).direction), n = j(e, u, t, () => E(u[s], i), (t, o, n) => {
310
+ if (n) {
311
+ const e = u.style, t = e[l];
312
+ e[l] = "hidden", p(() => {
313
+ e[l] = t;
310
314
  });
311
315
  }
312
- u[s] = W(e.R() + t, l), o && f();
313
- }), n[1](!0);
316
+ u[s] = E(e.C() + t, i), o && f();
317
+ }), r[1](!0);
314
318
  },
315
- p() {
316
- d.J(), r && r.J(), n[1](!1), n = m();
319
+ _() {
320
+ d.X(), n && n.X(), r[1](!1), r = m();
317
321
  },
318
- A: (e, t) => (a.set(e, t), d.B(e), () => {
319
- a.delete(e), d.q(e);
322
+ N: (e, t) => (a.set(e, t), d.W(e), () => {
323
+ a.delete(e), d.B(e);
320
324
  }),
321
- N: () => l,
322
- P: c,
325
+ P: () => i,
326
+ J: c,
323
327
  V() {
324
- r && r.X();
328
+ n && n.A();
325
329
  },
326
- D: e.T,
327
- U: () => 0
330
+ U: e.T,
331
+ F: () => 0
328
332
  };
329
- }, L = (e, t) => {
330
- let o, r, n, l = m(), s = !1;
331
- const i = t ? "left" : "top", [c] = q(e, () => l[0], (e, t) => {
332
- e = W(e, s);
333
- const r = R(C(o));
334
- t ? r.scroll({
335
- [i]: e,
333
+ }, H = (e, t) => {
334
+ let o, n, r, i = m(), s = !1;
335
+ const l = t ? "left" : "top", [c] = L(e, () => i[0], (e, t) => {
336
+ e = E(e, s);
337
+ const n = y(b(o));
338
+ t ? n.scroll({
339
+ [l]: e,
336
340
  behavior: "smooth"
337
- }) : r.scroll({
338
- [i]: e
341
+ }) : n.scroll({
342
+ [l]: e
339
343
  });
340
- }), f = t ? "width" : "height", u = /* @__PURE__ */ new WeakMap, a = H(t => {
344
+ }), f = t ? "width" : "height", u = /* @__PURE__ */ new WeakMap, a = T(t => {
341
345
  const o = [];
342
- for (const {target: e, contentRect: r} of t) {
346
+ for (const {target: e, contentRect: n} of t) {
343
347
  if (!e.offsetParent) continue;
344
348
  const t = u.get(e);
345
- null != t && o.push([ t, r[f] ]);
349
+ null != t && o.push([ t, n[f] ]);
346
350
  }
347
- o.length && e.W(3, o);
348
- }), d = (e, t, o, r, n = 0) => {
349
- const l = r ? "offsetLeft" : "offsetTop", i = n + (r && s ? o.innerWidth - e[l] - e.offsetWidth : e[l]), c = e.offsetParent;
350
- return e !== t && c ? d(c, t, o, r, i) : i;
351
+ o.length && e.q(3, o);
352
+ }), d = (e, t, o, n, r = 0) => {
353
+ const i = n ? "offsetLeft" : "offsetTop", l = r + (n && s ? o.innerWidth - e[i] - e.offsetWidth : e[i]), c = e.offsetParent;
354
+ return e !== t && c ? d(c, t, o, n, l) : l;
351
355
  };
352
356
  return {
353
- Y(c) {
357
+ D(c) {
354
358
  o = c;
355
- const f = t ? "scrollX" : "scrollY", u = C(c), a = R(u), h = () => {
356
- e.W(4, a[t ? "innerWidth" : "innerHeight"]);
359
+ const f = t ? "scrollX" : "scrollY", u = b(c), a = y(u), h = () => {
360
+ e.q(4, a[t ? "innerWidth" : "innerHeight"]);
357
361
  };
358
- a.addEventListener("resize", h), w(h), n = () => {
362
+ a.addEventListener("resize", h), $(h), r = () => {
359
363
  a.removeEventListener("resize", h);
360
- }, t && (s = "rtl" === getComputedStyle(O(u)).direction), r = B(e, a, t, () => W(a[f], s), (t, o) => {
364
+ }, t && (s = "rtl" === getComputedStyle(_(u)).direction), n = j(e, a, t, () => E(a[f], s), (t, o) => {
361
365
  o ? a.scroll({
362
- [i]: W(e.R() + t, s)
366
+ [l]: E(e.C() + t, s)
363
367
  }) : a.scrollBy({
364
- [i]: W(t, s)
368
+ [l]: E(t, s)
365
369
  });
366
- }, () => d(c, u.body, a, t)), l[1](!0);
370
+ }, () => d(c, u.body, a, t)), i[1](!0);
367
371
  },
368
- p() {
369
- n && n(), a.J(), r && r.J(), o = void 0, l[1](!1), l = m();
372
+ _() {
373
+ r && r(), a.X(), n && n.X(), o = void 0, i[1](!1), i = m();
370
374
  },
371
- A: (e, t) => (u.set(e, t), a.B(e), () => {
372
- u.delete(e), a.q(e);
375
+ N: (e, t) => (u.set(e, t), a.W(e), () => {
376
+ u.delete(e), a.B(e);
373
377
  }),
374
- N: () => s,
375
- P: c,
378
+ P: () => s,
379
+ J: c,
376
380
  V() {
377
- r && r.X();
378
- },
379
- D() {
380
- const e = C(o);
381
- return d(o, e.body, R(e), t);
381
+ n && n.A();
382
382
  },
383
383
  U() {
384
- const r = O(C(o));
385
- return e.v() - (t ? r.clientWidth : r.clientHeight);
384
+ const e = b(o);
385
+ return d(o, e.body, y(e), t);
386
+ },
387
+ F() {
388
+ const n = _(b(o));
389
+ return e.o() - (t ? n.clientWidth : n.clientHeight);
386
390
  }
387
391
  };
388
- }, X = (e, t) => {
389
- let o, r, n, l = m(), s = !1;
390
- const [i, c] = q(t, () => l[0], (e, t) => {
391
- const r = {
392
- left: W(e, s)
392
+ }, W = (e, t) => {
393
+ let o, n, r, i = m(), s = !1;
394
+ const [l, c] = L(t, () => i[0], (e, t) => {
395
+ const n = {
396
+ left: E(e, s)
393
397
  };
394
- t && (r.behavior = "smooth"), o.scrollTo(r);
395
- }), [f, u] = q(e, () => l[0], (e, t) => {
396
- const r = {
398
+ t && (n.behavior = "smooth"), o.scrollTo(n);
399
+ }), [f, u] = L(e, () => i[0], (e, t) => {
400
+ const n = {
397
401
  top: e
398
402
  };
399
- t && (r.behavior = "smooth"), o.scrollTo(r);
400
- }), a = /* @__PURE__ */ new WeakMap, h = /* @__PURE__ */ new Set, g = /* @__PURE__ */ new Set, v = /* @__PURE__ */ new Map, p = (e, t) => `${e}-${t}`, w = H(r => {
401
- const n = /* @__PURE__ */ new Set, l = /* @__PURE__ */ new Set;
402
- for (const {target: s, contentRect: {width: i, height: c}} of r) if (s.offsetParent) if (s === o) e.W(4, c),
403
- t.W(4, i); else {
403
+ t && (n.behavior = "smooth"), o.scrollTo(n);
404
+ }), a = /* @__PURE__ */ new WeakMap, h = /* @__PURE__ */ new Set, g = /* @__PURE__ */ new Set, v = /* @__PURE__ */ new Map, S = (e, t) => `${e}-${t}`, $ = T(n => {
405
+ const r = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set;
406
+ for (const {target: s, contentRect: {width: l, height: c}} of n) if (s.offsetParent) if (s === o) e.q(4, c),
407
+ t.q(4, l); else {
404
408
  const e = a.get(s);
405
409
  if (e) {
406
- const [t, o] = e, r = p(t, o), s = v.get(r);
410
+ const [t, o] = e, n = S(t, o), s = v.get(n);
407
411
  let f, u;
408
- s ? (s[0] !== c && (f = !0), s[1] !== i && (u = !0)) : f = u = !0, f && n.add(t),
409
- u && l.add(o), (f || u) && v.set(r, [ c, i ]);
412
+ s ? (s[0] !== c && (f = !0), s[1] !== l && (u = !0)) : f = u = !0, f && r.add(t),
413
+ u && i.add(o), (f || u) && v.set(n, [ c, l ]);
410
414
  }
411
415
  }
412
- if (n.size) {
416
+ if (r.size) {
413
417
  const t = [];
414
- n.forEach(e => {
418
+ r.forEach(e => {
415
419
  let o = 0;
416
420
  g.forEach(t => {
417
- const r = v.get(p(e, t));
418
- r && (o = d(o, r[0]));
421
+ const n = v.get(S(e, t));
422
+ n && (o = d(o, n[0]));
419
423
  }), o && t.push([ e, o ]);
420
- }), e.W(3, t);
424
+ }), e.q(3, t);
421
425
  }
422
- if (l.size) {
426
+ if (i.size) {
423
427
  const e = [];
424
- l.forEach(t => {
428
+ i.forEach(t => {
425
429
  let o = 0;
426
430
  h.forEach(e => {
427
- const r = v.get(p(e, t));
428
- r && (o = d(o, r[1]));
431
+ const n = v.get(S(e, t));
432
+ n && (o = d(o, n[1]));
429
433
  }), o && e.push([ t, o ]);
430
- }), t.W(3, e);
434
+ }), t.q(3, e);
431
435
  }
432
- }), _ = (e, t, r) => {
433
- const n = o, l = t ? "scrollLeft" : "scrollTop", i = t ? "overflowX" : "overflowY", c = t && s;
434
- return B(e, n, t, () => W(n[l], c), (t, o, s) => {
436
+ }), w = (e, t, n) => {
437
+ const r = o, i = t ? "scrollLeft" : "scrollTop", l = t ? "overflowX" : "overflowY", c = t && s;
438
+ return j(e, r, t, () => E(r[i], c), (t, o, s) => {
435
439
  if (s) {
436
- const e = n.style, t = e[i];
437
- e[i] = "hidden", S(() => {
438
- e[i] = t;
440
+ const e = r.style, t = e[l];
441
+ e[l] = "hidden", p(() => {
442
+ e[l] = t;
439
443
  });
440
444
  }
441
- n[l] = W(e.R() + t, c), o && r();
445
+ r[i] = E(e.C() + t, c), o && n();
442
446
  });
443
447
  };
444
448
  return {
445
- Y(i, f = i.parentElement) {
446
- w.B(o = f), s = "rtl" === getComputedStyle(f).direction, r = _(e, !1, u), n = _(t, !0, c),
447
- l[1](!0);
449
+ D(l, f = l.parentElement) {
450
+ $.W(o = f), s = "rtl" === getComputedStyle(f).direction, n = w(e, !1, u), r = w(t, !0, c),
451
+ i[1](!0);
448
452
  },
449
- p() {
450
- w.J(), r && r.J(), n && n.J(), l[1](!1), l = m();
453
+ _() {
454
+ $.X(), n && n.X(), r && r.X(), i[1](!1), i = m();
451
455
  },
452
- A: (e, t, o) => (a.set(e, [ t, o ]), h.add(t), g.add(o), w.B(e), () => {
453
- a.delete(e), w.q(e);
456
+ N: (e, t, o) => (a.set(e, [ t, o ]), h.add(t), g.add(o), $.W(e), () => {
457
+ a.delete(e), $.B(e);
454
458
  }),
455
- F(o) {
456
- for (const [e] of o) for (let o = 0; o < t.C(); o++) v.delete(p(e, o));
457
- e.W(3, o);
458
- },
459
459
  G(o) {
460
- for (const [t] of o) for (let o = 0; o < e.C(); o++) v.delete(p(o, t));
461
- t.W(3, o);
460
+ for (const [e] of o) for (let o = 0; o < t.R(); o++) v.delete(S(e, o));
461
+ e.q(3, o);
462
462
  },
463
- N: () => s,
464
- K: i,
465
- Z: f,
466
- V() {
467
- r && r.X(), n && n.X();
463
+ K(o) {
464
+ for (const [t] of o) for (let o = 0; o < e.R(); o++) v.delete(S(o, t));
465
+ t.q(3, o);
468
466
  },
469
- D: o => (o ? t : e).T()
467
+ P: () => s,
468
+ Z: l,
469
+ ee: f,
470
+ V() {
471
+ n && n.A(), r && r.A();
472
+ }
470
473
  };
471
- }, Y = (e, t) => {
472
- e.P(() => t);
473
- }, A = (e, t, o, {align: r, smooth: n, offset: l = 0} = {}) => {
474
- if (o = v(o, 0, t.C() - 1), "nearest" === r) {
475
- const e = t.k(o), n = t.R();
476
- if (e < n) r = "start"; else {
477
- if (!(e + t.O(o) > n + t.v())) return;
478
- r = "end";
474
+ }, B = (e, t) => {
475
+ e.J(() => t);
476
+ }, X = (e, t, o, {align: n, smooth: r, offset: i = 0} = {}) => {
477
+ if (o = v(o, 0, t.R() - 1), "nearest" === n) {
478
+ const e = t.u(o), r = t.C();
479
+ if (e < r) n = "start"; else {
480
+ if (!(e + t.h(o) > r + t.o())) return;
481
+ n = "end";
479
482
  }
480
483
  }
481
- e.P(() => l + e.D() + t.k(o) + ("end" === r ? t.O(o) - (t.v() - e.U()) : "center" === r ? (t.O(o) - (t.v() - e.U())) / 2 : 0), n);
482
- }, N = k ? s.useLayoutEffect : s.useEffect, P = "current", V = (e, t) => {
483
- if (Array.isArray(e)) for (const o of e) V(o, t); else null == e || "boolean" == typeof e || t.push(e);
484
- }, D = (e, t) => {
484
+ e.J(() => i + e.U() + t.u(o) + ("end" === n ? t.h(o) - (t.o() - e.F()) : "center" === n ? (t.h(o) - (t.o() - e.F())) / 2 : 0), r);
485
+ }, Y = z ? s.useLayoutEffect : s.useEffect, A = "current", D = (e, t) => {
486
+ if (Array.isArray(e)) for (const o of e) D(o, t); else null == e || "boolean" == typeof e || t.push(e);
487
+ }, N = (e, t) => {
485
488
  const o = e.key;
486
489
  return null != o ? o : "_" + t;
487
- }, U = e => {
490
+ }, P = e => {
488
491
  const t = (0, s.useRef)(null);
489
492
  return t.current || (t.current = e());
490
- }, F = e => {
493
+ }, J = e => {
491
494
  const t = (0, s.useRef)(e);
492
- return N(() => {
493
- t[P] = e;
495
+ return Y(() => {
496
+ t[A] = e;
494
497
  }, [ e ]), t;
495
- }, G = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({ee: e, te: t, oe: o, re: r, ne: n, le: l, se: i, ie: c}) => {
498
+ }, V = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({te: e, oe: t, ne: o, re: n, ie: r, se: i, le: l, ce: c}) => {
496
499
  const u = (0, s.useRef)(null);
497
- N(() => t(u[P], o), [ o ]);
500
+ Y(() => t(u[A], o), [ o ]);
498
501
  const a = (0, s.useMemo)(() => {
499
502
  const e = {
500
503
  contain: "layout style",
501
- position: n && c ? void 0 : "absolute",
502
- [i ? "height" : "width"]: "100%",
503
- [i ? "top" : "left"]: 0,
504
- [i ? "left" : "top"]: r,
505
- visibility: !n || c ? void 0 : "hidden"
504
+ position: r && c ? void 0 : "absolute",
505
+ [l ? "height" : "width"]: "100%",
506
+ [l ? "top" : "left"]: 0,
507
+ [l ? "left" : "top"]: n,
508
+ visibility: !r || c ? void 0 : "hidden"
506
509
  };
507
- return i && (e.display = "inline-flex"), e;
508
- }, [ r, n, c, i ]);
509
- return "string" == typeof l ? /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(l, {
510
+ return l && (e.display = "inline-flex"), e;
511
+ }, [ n, r, c, l ]);
512
+ return "string" == typeof i ? /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(i, {
510
513
  ref: u,
511
514
  style: a,
512
515
  children: e
513
- }) : /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(l, {
516
+ }) : /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(i, {
514
517
  ref: u,
515
518
  style: a,
516
519
  index: o,
517
520
  children: e
518
521
  });
519
- }), K = (e, t) => (0, s.useMemo)(() => {
522
+ }), U = (e, t) => (0, s.useMemo)(() => {
520
523
  if ("function" == typeof e) return [ o => e(t[o], o), t.length ];
521
524
  const o = (e => {
522
525
  const t = [];
523
- return V(e, t), t;
526
+ return D(e, t), t;
524
527
  })(e);
525
528
  return [ e => o[e], o.length ];
526
- }, [ e, t ]), Q = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: r, shift: n, horizontal: l, keepMounted: i, cache: c, startMargin: a = 0, ssrCount: d, as: h = "div", item: g = "div", scrollRef: v, onScroll: S, onScrollEnd: m}, _) => {
527
- const [b, $] = K(e, t), z = (0, s.useRef)(null), y = (0, s.useRef)(!!d), x = F(S), I = F(m), [k, O, C] = U(() => {
528
- const e = !!l, t = E($, r, d, c, !r);
529
- return [ t, J(t, e), e ];
529
+ }, [ e, t ]), F = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: i, keepMounted: l, cache: c, startMargin: a = 0, ssrCount: d, as: h = "div", item: g = "div", scrollRef: v, onScroll: p, onScrollEnd: m}, w) => {
530
+ const [z, _] = U(e, t), b = (0, s.useRef)(null), y = (0, s.useRef)(!!d), I = J(p), x = J(m), [R, C, T, E] = P(() => {
531
+ const e = !!i, t = M(_, n, c), o = O(t, d);
532
+ return [ o, t, q(o, e), e ];
530
533
  });
531
- $ !== k.C() && k.W(5, [ $, n ]), a !== k.T() && k.W(6, a);
532
- const [R, M] = (0, s.useReducer)(k.S, void 0, k.S), T = k.M(), H = k.h(), W = O.N(), B = [], q = e => {
533
- const t = b(e);
534
+ _ !== R.R() && R.q(5, [ _, r ]), a !== R.T() && R.q(6, a);
535
+ const [j, L] = (0, s.useReducer)(R.I, void 0, R.I), H = R.M(), W = R.t(), D = T.P(), F = [], G = e => {
536
+ const t = z(e);
534
537
  /* @__PURE__ */ /* @__PURE__ */
535
- return (0, f.jsx)(G, {
536
- te: O.A,
537
- oe: e,
538
- re: k.k(e, W),
539
- ne: k.I(e),
540
- le: g,
541
- ee: t,
542
- se: C,
543
- ie: y[P]
544
- }, D(t, e));
538
+ return (0, f.jsx)(V, {
539
+ oe: T.N,
540
+ ne: e,
541
+ re: R.u(e, D),
542
+ ie: R.O(e),
543
+ se: g,
544
+ te: t,
545
+ le: E,
546
+ ce: y[A]
547
+ }, N(t, e));
545
548
  };
546
- if (N(() => {
547
- y[P] = !1, k.H(1, e => {
548
- e ? (0, u.flushSync)(M) : M();
549
- }), k.H(4, () => {
550
- x.current && x.current(k.R());
551
- }), k.H(8, () => {
552
- I.current && I.current();
549
+ if (Y(() => {
550
+ y[A] = !1, R.L(1, e => {
551
+ e ? (0, u.flushSync)(L) : L();
552
+ }), R.L(4, () => {
553
+ I.current && I.current(R.C());
554
+ }), R.L(8, () => {
555
+ x.current && x.current();
553
556
  });
554
- const e = z[P];
555
- return v ? w(() => {
556
- v.current && O.Y(e, v[P]);
557
- }) : O.Y(e), () => {
558
- k.p(), O.p();
557
+ const e = b[A];
558
+ return v ? $(() => {
559
+ v.current && T.D(e, v[A]);
560
+ }) : T.D(e), () => {
561
+ R._(), T._();
559
562
  };
560
- }, []), N(() => {
561
- O.V();
562
- }, [ R ]), (0, s.useImperativeHandle)(_, () => ({
563
+ }, []), Y(() => {
564
+ T.V();
565
+ }, [ j ]), (0, s.useImperativeHandle)(w, () => ({
563
566
  get cache() {
564
- return k.m();
567
+ return C.H();
565
568
  },
566
569
  get scrollOffset() {
567
- return k.R();
570
+ return R.C();
568
571
  },
569
572
  get scrollSize() {
570
- return j(k);
573
+ return k(R);
571
574
  },
572
575
  get viewportSize() {
573
- return k.v();
576
+ return R.o();
574
577
  },
575
- findItemIndex: k.$,
576
- getItemOffset: k.k,
577
- getItemSize: k.O,
578
- scrollToIndex: (e, t) => A(O, k, e, t),
579
- scrollTo: e => Y(O, e),
578
+ findItemIndex: R.k,
579
+ getItemOffset: R.u,
580
+ getItemSize: R.h,
581
+ scrollToIndex: (e, t) => X(T, R, e, t),
582
+ scrollTo: e => B(T, e),
580
583
  scrollBy: e => ((e, t, o) => {
581
- Y(e, o + t.R());
582
- })(O, k, e)
583
- }), []), i) {
584
- const e = new Set(i);
585
- for (let [t, r] = k._(o); t <= r; t++) e.add(t);
586
- p([ ...e ]).forEach(e => {
587
- B.push(q(e));
584
+ B(e, o + t.C());
585
+ })(T, R, e)
586
+ }), []), l) {
587
+ const e = new Set(l);
588
+ for (let [t, n] = R.i(o); t <= n; t++) e.add(t);
589
+ S([ ...e ]).forEach(e => {
590
+ F.push(G(e));
588
591
  });
589
- } else for (let [e, t] = k._(o); e <= t; e++) B.push(q(e));
592
+ } else for (let [e, t] = R.i(o); e <= t; e++) F.push(G(e));
590
593
  /* @__PURE__ */ /* @__PURE__ */
591
594
  return (0, f.jsx)(h, {
592
- ref: z,
595
+ ref: b,
593
596
  style: {
594
597
  contain: "size style",
595
598
  overflowAnchor: "none",
596
599
  flex: "none",
597
600
  position: "relative",
598
- width: C ? H : "100%",
599
- height: C ? "100%" : H,
600
- pointerEvents: T ? "none" : void 0
601
+ width: E ? W : "100%",
602
+ height: E ? "100%" : W,
603
+ pointerEvents: H ? "none" : void 0
601
604
  },
602
- children: B
605
+ children: F
603
606
  });
604
- }), Z = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: r, shift: n, horizontal: l, keepMounted: s, cache: i, ssrCount: c, item: u, onScroll: a, onScrollEnd: d, style: h, ...g}, v) => /* @__PURE__ */ /* @__PURE__ */ (0,
607
+ }), G = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: i, keepMounted: s, cache: l, ssrCount: c, item: u, onScroll: a, onScrollEnd: d, style: h, ...g}, v) => /* @__PURE__ */ /* @__PURE__ */ (0,
605
608
  f.jsx)("div", {
606
609
  ...g,
607
610
  style: {
608
- display: l ? "inline-block" : "block",
609
- [l ? "overflowX" : "overflowY"]: "auto",
611
+ display: i ? "inline-block" : "block",
612
+ [i ? "overflowX" : "overflowY"]: "auto",
610
613
  contain: "strict",
611
614
  width: "100%",
612
615
  height: "100%",
613
616
  ...h
614
617
  },
615
- children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(Q, {
618
+ children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(F, {
616
619
  ref: v,
617
620
  data: t,
618
621
  bufferSize: o,
619
- itemSize: r,
620
- shift: n,
621
- horizontal: l,
622
+ itemSize: n,
623
+ shift: r,
624
+ horizontal: i,
622
625
  keepMounted: s,
623
- cache: i,
626
+ cache: l,
624
627
  ssrCount: c,
625
628
  item: u,
626
629
  onScroll: a,
627
630
  onScrollEnd: d,
628
631
  children: e
629
632
  })
630
- })), ee = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: r, shift: n, horizontal: l, cache: i, ssrCount: c, as: a = "div", item: d = "div", onScroll: h, onScrollEnd: g}, v) => {
631
- const [p, S] = K(e, t), w = (0, s.useRef)(null), m = F(h), _ = F(g), b = (0, s.useRef)(!!c), [$, z, y] = U(() => {
632
- const e = !!l, t = E(S, r, c, i, !r);
633
- return [ t, L(t, e), e ];
633
+ })), K = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: i, cache: l, ssrCount: c, as: a = "div", item: d = "div", onScroll: h, onScrollEnd: g}, v) => {
634
+ const [S, p] = U(e, t), $ = (0, s.useRef)(null), m = J(h), w = J(g), z = (0, s.useRef)(!!c), [_, b, y, I] = P(() => {
635
+ const e = !!i, t = M(p, n, l), o = O(t, c);
636
+ return [ o, t, H(o, e), e ];
634
637
  });
635
- S !== $.C() && $.W(5, [ S, n ]);
636
- const [x, I] = (0, s.useReducer)($.S, void 0, $.S), k = $.M(), O = $.h(), C = z.N(), R = [];
637
- N(() => (b[P] = !1, $.H(1, e => {
638
- e ? (0, u.flushSync)(I) : I();
639
- }), $.H(4, () => {
638
+ p !== _.R() && _.q(5, [ p, r ]);
639
+ const [x, k] = (0, s.useReducer)(_.I, void 0, _.I), R = _.M(), C = _.t(), T = y.P(), E = [];
640
+ Y(() => (z[A] = !1, _.L(1, e => {
641
+ e ? (0, u.flushSync)(k) : k();
642
+ }), _.L(4, () => {
640
643
  m.current && m.current();
641
- }), $.H(8, () => {
642
- _.current && _.current();
643
- }), z.Y(w[P]), () => {
644
- $.p(), z.p();
645
- }), []), N(() => {
646
- z.V();
644
+ }), _.L(8, () => {
645
+ w.current && w.current();
646
+ }), y.D($[A]), () => {
647
+ _._(), y._();
648
+ }), []), Y(() => {
649
+ y.V();
647
650
  }, [ x ]), (0, s.useImperativeHandle)(v, () => ({
648
651
  get cache() {
649
- return $.m();
652
+ return b.H();
650
653
  },
651
654
  get scrollOffset() {
652
- return $.R();
655
+ return _.C();
653
656
  },
654
657
  get viewportSize() {
655
- return $.v();
658
+ return _.o();
656
659
  },
657
- findItemIndex: $.$,
658
- getItemOffset: $.k,
659
- getItemSize: $.O,
660
- scrollToIndex: (e, t) => A(z, $, e, t)
660
+ findItemIndex: _.k,
661
+ getItemOffset: _.u,
662
+ getItemSize: _.h,
663
+ scrollToIndex: (e, t) => X(y, _, e, t)
661
664
  }), []);
662
- for (let [e, t] = $._(o); e <= t; e++) {
663
- const t = p(e);
664
- R.push(/* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(G, {
665
- te: z.A,
666
- oe: e,
667
- re: $.k(e, C),
668
- ne: $.I(e),
669
- le: d,
670
- ee: t,
671
- se: y,
672
- ie: b[P]
673
- }, D(t, e)));
665
+ for (let [e, t] = _.i(o); e <= t; e++) {
666
+ const t = S(e);
667
+ E.push(/* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(V, {
668
+ oe: y.N,
669
+ ne: e,
670
+ re: _.u(e, T),
671
+ ie: _.O(e),
672
+ se: d,
673
+ te: t,
674
+ le: I,
675
+ ce: z[A]
676
+ }, N(t, e)));
674
677
  }
675
678
  /* @__PURE__ */ /* @__PURE__ */
676
679
  return (0, f.jsx)(a, {
677
- ref: w,
680
+ ref: $,
678
681
  style: {
679
682
  contain: "size style",
680
683
  overflowAnchor: "none",
681
684
  flex: "none",
682
685
  position: "relative",
683
- width: y ? O : "100%",
684
- height: y ? "100%" : O,
685
- pointerEvents: k ? "none" : void 0
686
+ width: I ? C : "100%",
687
+ height: I ? "100%" : C,
688
+ pointerEvents: R ? "none" : void 0
686
689
  },
687
- children: R
690
+ children: E
688
691
  });
689
- }), te = (e, t) => `${e}-${t}`, oe = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({ee: e, te: t, ce: o, fe: r, ue: n, ae: l, de: i, he: c, ne: u, ge: a}) => {
692
+ }), Q = (e, t) => `${e}-${t}`, Z = /*#__PURE__*/ /*#__PURE__*/ (0, s.memo)(({te: e, oe: t, fe: o, ue: n, ae: r, de: i, he: l, ge: c, ie: u, ve: a}) => {
690
693
  const d = (0, s.useRef)(null);
691
- return N(() => t(d[P], o, r), [ r, o ]), /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(a, {
694
+ return Y(() => t(d[A], o, n), [ n, o ]), /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)(a, {
692
695
  ref: d,
693
696
  style: (0, s.useMemo)(() => ({
694
697
  contain: "layout style",
695
698
  display: "grid",
696
699
  position: "absolute",
697
- top: n,
698
- left: l,
700
+ top: r,
701
+ left: i,
699
702
  visibility: u ? "hidden" : void 0,
700
- minHeight: i,
703
+ minHeight: l,
701
704
  minWidth: c
702
- }), [ n, l, c, i, u ]),
705
+ }), [ r, i, c, l, u ]),
703
706
  children: e
704
707
  });
705
- }), re = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, row: t, col: o, cellHeight: r = 40, cellWidth: n = 100, bufferSize: l, ssrRowCount: i, ssrColCount: c, item: a = "div", domRef: d, onScroll: h, onScrollEnd: g, style: p, ...S}, w) => {
706
- const [m, _, b] = U(() => {
707
- const e = E(t, r, i), l = E(o, n, c);
708
- return [ e, l, X(e, l) ];
708
+ }), ee = /*#__PURE__*/ /*#__PURE__*/ (0, s.forwardRef)(({children: e, row: t, col: o, cellHeight: n = 40, cellWidth: r = 100, bufferSize: i, ssrRowCount: l, ssrColCount: c, item: a = "div", domRef: d, onScroll: h, onScrollEnd: g, style: S, ...p}, $) => {
709
+ const [m, w, z] = P(() => {
710
+ const e = O(M(t, n), l), i = O(M(o, r), c);
711
+ return [ e, i, W(e, i) ];
709
712
  });
710
- t !== m.C() && m.W(5, [ t ]), o !== _.C() && _.W(5, [ o ]);
711
- const [$, z] = (0, s.useReducer)(m.S, void 0, m.S), [y, x] = (0, s.useReducer)(_.S, void 0, _.S), I = m.M(), k = _.M(), O = j(m), C = j(_), R = (0,
712
- s.useRef)(null), M = F(h), T = F(g);
713
- N(() => {
714
- m.H(1, e => {
715
- e ? (0, u.flushSync)(z) : z();
716
- }), _.H(1, e => {
717
- e ? (0, u.flushSync)(x) : x();
718
- }), m.H(4, () => {
719
- M.current && M.current(m.R());
720
- }), m.H(8, () => {
721
- T.current && T.current();
713
+ t !== m.R() && m.q(5, [ t ]), o !== w.R() && w.q(5, [ o ]);
714
+ const [_, b] = (0, s.useReducer)(m.I, void 0, m.I), [y, I] = (0, s.useReducer)(w.I, void 0, w.I), x = m.M(), R = w.M(), C = k(m), T = k(w), E = (0,
715
+ s.useRef)(null), j = J(h), L = J(g);
716
+ Y(() => {
717
+ m.L(1, e => {
718
+ e ? (0, u.flushSync)(b) : b();
719
+ }), w.L(1, e => {
720
+ e ? (0, u.flushSync)(I) : I();
721
+ }), m.L(4, () => {
722
+ j.current && j.current(m.C());
723
+ }), m.L(8, () => {
724
+ L.current && L.current();
722
725
  });
723
- const e = R[P];
724
- return b.Y(e), () => {
725
- m.p(), _.p(), b.p();
726
+ const e = E[A];
727
+ return z.D(e), () => {
728
+ m._(), w._(), z._();
726
729
  };
727
- }, []), N(() => {
728
- b.V();
729
- }, [ $, y ]), (0, s.useImperativeHandle)(w, () => ({
730
+ }, []), Y(() => {
731
+ z.V();
732
+ }, [ _, y ]), (0, s.useImperativeHandle)($, () => ({
730
733
  get scrollTop() {
731
- return m.R();
734
+ return m.C();
732
735
  },
733
736
  get scrollLeft() {
734
- return _.R();
737
+ return w.C();
735
738
  },
736
739
  get scrollHeight() {
737
- return j(m);
740
+ return k(m);
738
741
  },
739
742
  get scrollWidth() {
740
- return j(_);
743
+ return k(w);
741
744
  },
742
745
  get viewportHeight() {
743
- return m.v();
746
+ return m.o();
744
747
  },
745
748
  get viewportWidth() {
746
- return _.v();
747
- },
748
- findRowIndex: m.$,
749
- findColIndex: _.$,
750
- getRowOffset: m.k,
751
- getColOffset: _.k,
752
- getRowSize: m.O,
753
- getColSize: _.O,
749
+ return w.o();
750
+ },
751
+ findRowIndex: m.k,
752
+ findColIndex: w.k,
753
+ getRowOffset: m.u,
754
+ getColOffset: w.u,
755
+ getRowSize: m.h,
756
+ getColSize: w.h,
754
757
  resizeCols(e) {
755
- b.G(e);
758
+ z.K(e);
756
759
  },
757
760
  resizeRows(e) {
758
- b.F(e);
761
+ z.G(e);
759
762
  },
760
- scrollToIndex: (e, t) => ((e, t, o, r, n) => {
761
- if (null != r) {
762
- const o = v(r, 0, t.C() - 1);
763
- e.Z(() => e.D(!1) + t.k(o));
764
- }
763
+ scrollToIndex: (e, t) => ((e, t, o, n, r) => {
765
764
  if (null != n) {
766
- const t = v(n, 0, o.C() - 1);
767
- e.K(() => e.D(!0) + o.k(t));
765
+ const o = v(n, 0, t.R() - 1);
766
+ e.ee(() => t.u(o));
768
767
  }
769
- })(b, m, _, e, t),
770
- scrollTo: (e, t) => ((e, t, o) => {
771
- null != t && e.Z(() => t), null != o && e.K(() => o);
772
- })(b, e, t),
773
- scrollBy: (e, t) => ((e, t, o, r, n) => {
774
768
  if (null != r) {
775
- const o = r + t.R();
776
- e.Z(() => o);
769
+ const t = v(r, 0, o.R() - 1);
770
+ e.Z(() => o.u(t));
777
771
  }
772
+ })(z, m, w, e, t),
773
+ scrollTo: (e, t) => ((e, t, o) => {
774
+ null != t && e.ee(() => t), null != o && e.Z(() => o);
775
+ })(z, e, t),
776
+ scrollBy: (e, t) => ((e, t, o, n, r) => {
778
777
  if (null != n) {
779
- const t = n + o.R();
780
- e.K(() => t);
778
+ const o = n + t.C();
779
+ e.ee(() => o);
780
+ }
781
+ if (null != r) {
782
+ const t = r + o.C();
783
+ e.Z(() => t);
781
784
  }
782
- })(b, m, _, e, t)
785
+ })(z, m, w, e, t)
783
786
  }), []);
784
- const H = (0, s.useMemo)(() => {
787
+ const q = (0, s.useMemo)(() => {
785
788
  const t = /* @__PURE__ */ new Map;
786
- return (o, r) => {
787
- let n = t.get(te(o, r));
788
- return n || t.set(te(o, r), n = e({
789
+ return (o, n) => {
790
+ let r = t.get(Q(o, n));
791
+ return r || t.set(Q(o, n), r = e({
789
792
  rowIndex: o,
790
- colIndex: r
791
- })), n;
793
+ colIndex: n
794
+ })), r;
792
795
  };
793
- }, [ e ]), W = b.N(), [B, q] = m._(l), [J, L] = _._(l), Y = [];
794
- for (let e = B; e <= q; e++) for (let t = J; t <= L; t++) Y.push(/* @__PURE__ */ /* @__PURE__ */ (0,
795
- f.jsx)(oe, {
796
- te: b.A,
797
- ce: e,
798
- fe: t,
799
- ue: m.k(e),
800
- ae: _.k(t, W),
801
- de: m.O(e),
802
- he: _.O(t),
803
- ne: m.I(e) || _.I(t),
804
- ge: a,
805
- ee: H(e, t)
806
- }, te(e, t)));
796
+ }, [ e ]), H = z.P(), [B, X] = m.i(i), [D, N] = w.i(i), V = [];
797
+ for (let e = B; e <= X; e++) for (let t = D; t <= N; t++) V.push(/* @__PURE__ */ /* @__PURE__ */ (0,
798
+ f.jsx)(Z, {
799
+ oe: z.N,
800
+ fe: e,
801
+ ue: t,
802
+ ae: m.u(e),
803
+ de: w.u(t, H),
804
+ he: m.h(e),
805
+ ge: w.h(t),
806
+ ie: m.O(e) || w.O(t),
807
+ ve: a,
808
+ te: q(e, t)
809
+ }, Q(e, t)));
807
810
  /* @__PURE__ */ /* @__PURE__ */
808
811
  return (0, f.jsx)("div", {
809
812
  ref: d,
810
- ...S,
813
+ ...p,
811
814
  style: {
812
815
  overflow: "auto",
813
816
  contain: "strict",
814
817
  width: "100%",
815
818
  height: "100%",
816
- ...p
819
+ ...S
817
820
  },
818
821
  children: /* @__PURE__ */ /* @__PURE__ */ (0, f.jsx)("div", {
819
- ref: R,
822
+ ref: E,
820
823
  style: {
821
824
  contain: "size style",
822
825
  overflowAnchor: "none",
823
826
  flex: "none",
824
827
  position: "relative",
825
- width: C,
826
- height: O,
827
- pointerEvents: I || k ? "none" : void 0
828
+ width: T,
829
+ height: C,
830
+ pointerEvents: x || R ? "none" : void 0
828
831
  },
829
- children: Y
832
+ children: V
830
833
  })
831
834
  });
832
835
  });
833
836
 
834
- exports.VList = Z, exports.Virtualizer = Q, exports.WindowVirtualizer = ee, exports.experimental_VGrid = re;
837
+ exports.VList = G, exports.Virtualizer = F, exports.WindowVirtualizer = K, exports.experimental_VGrid = ee;
835
838
  //# sourceMappingURL=index.cjs.map