vue-virtual-flow 0.0.8 → 0.0.9

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.
@@ -1,28 +1,28 @@
1
- import { watch as ie, defineComponent as Oe, ref as U, computed as n, nextTick as K, onMounted as Ce, onUpdated as Je, onBeforeUnmount as Pe, openBlock as I, createElementBlock as $, normalizeStyle as N, createElementVNode as je, renderSlot as ce, createTextVNode as Ve, createCommentVNode as ze, Fragment as He, renderList as Ae, unref as u, normalizeClass as We, toDisplayString as Ge } from "vue";
1
+ import { watch as ie, defineComponent as Oe, ref as j, computed as n, nextTick as C, onMounted as Ae, onUpdated as Xe, onBeforeUnmount as Ce, openBlock as I, createElementBlock as $, normalizeStyle as N, createElementVNode as Ge, renderSlot as ce, createTextVNode as Ve, createCommentVNode as ze, Fragment as Re, renderList as De, unref as c, normalizeClass as Ye, toDisplayString as je } from "vue";
2
2
  function tt(l) {
3
3
  return typeof l == "string" || typeof l == "number" || typeof l == "symbol";
4
4
  }
5
- function Ze(l, C) {
6
- const x = l[C];
5
+ function Ze(l, P) {
6
+ const x = l[P];
7
7
  return tt(x) ? x : void 0;
8
8
  }
9
9
  function lt(l) {
10
10
  return Ze(l, "id") ?? Ze(l, "key");
11
11
  }
12
- function De(l) {
13
- function C(e, m) {
14
- const c = l.itemKey();
15
- if (typeof c == "function")
16
- return c(e, m);
12
+ function Pe(l) {
13
+ function P(e, p) {
14
+ const f = l.itemKey();
15
+ if (typeof f == "function")
16
+ return f(e, p);
17
17
  if (e !== null && typeof e == "object") {
18
- if (c !== void 0) {
19
- const o = Ze(e, c);
18
+ if (f !== void 0) {
19
+ const o = Ze(e, f);
20
20
  if (o !== void 0) return o;
21
21
  }
22
22
  const r = lt(e);
23
23
  if (r !== void 0) return r;
24
24
  }
25
- return m;
25
+ return p;
26
26
  }
27
27
  function x() {
28
28
  }
@@ -30,56 +30,56 @@ function De(l) {
30
30
  () => [l.itemKey(), l.items()],
31
31
  x,
32
32
  { immediate: !0 }
33
- ), { getItemKey: C };
33
+ ), { getItemKey: P };
34
34
  }
35
- function Ye(l) {
35
+ function Fe(l) {
36
36
  return l === "fill" ? "100%" : typeof l == "number" ? `${l}px` : l;
37
37
  }
38
38
  function Ue(l) {
39
- return (C, x) => {
39
+ return (P, x) => {
40
40
  typeof x == "string" && (x === "fill" || x.trim().endsWith("%"));
41
41
  };
42
42
  }
43
43
  function at(l) {
44
- const C = Float64Array.from(l), x = C.length, e = new Float64Array(x + 1);
45
- let m = 0;
44
+ const P = Float64Array.from(l), x = P.length, e = new Float64Array(x + 1);
45
+ let p = 0;
46
46
  for (let r = 1; r <= x; r += 1) {
47
- const o = C[r - 1];
48
- m += o, e[r] += o;
49
- const f = r + (r & -r);
50
- f <= x && (e[f] += e[r]);
47
+ const o = P[r - 1];
48
+ p += o, e[r] += o;
49
+ const m = r + (r & -r);
50
+ m <= x && (e[m] += e[r]);
51
51
  }
52
- let c = 1;
53
- for (; c * 2 <= x; ) c *= 2;
52
+ let f = 1;
53
+ for (; f * 2 <= x; ) f *= 2;
54
54
  return {
55
55
  length: x,
56
56
  get total() {
57
- return m;
57
+ return p;
58
58
  },
59
59
  getSize(r) {
60
- return C[r];
60
+ return P[r];
61
61
  },
62
62
  getOffset(r) {
63
63
  let o = 0;
64
- for (let f = r; f > 0; f -= f & -f)
65
- o += e[f];
64
+ for (let m = r; m > 0; m -= m & -m)
65
+ o += e[m];
66
66
  return o;
67
67
  },
68
68
  setSize(r, o) {
69
- const f = o - C[r];
70
- if (f !== 0) {
71
- C[r] = o, m += f;
72
- for (let O = r + 1; O <= x; O += O & -O)
73
- e[O] += f;
69
+ const m = o - P[r];
70
+ if (m !== 0) {
71
+ P[r] = o, p += m;
72
+ for (let A = r + 1; A <= x; A += A & -A)
73
+ e[A] += m;
74
74
  }
75
75
  },
76
76
  findIndex(r) {
77
77
  if (x === 0 || r <= 0) return 0;
78
- if (r >= m) return x - 1;
79
- let o = 0, f = 0;
80
- for (let O = c; O > 0; O = Math.floor(O / 2)) {
81
- const P = o + O;
82
- P <= x && f + e[P] <= r && (o = P, f += e[P]);
78
+ if (r >= p) return x - 1;
79
+ let o = 0, m = 0;
80
+ for (let A = f; A > 0; A = Math.floor(A / 2)) {
81
+ const O = o + A;
82
+ O <= x && m + e[O] <= r && (o = O, m += e[O]);
83
83
  }
84
84
  return Math.min(o, x - 1);
85
85
  }
@@ -109,310 +109,310 @@ const ot = ["aria-label"], nt = {
109
109
  loadOlderThreshold: { default: 120 }
110
110
  },
111
111
  emits: ["scroll", "loadOlder", "bottomChange"],
112
- setup(l, { expose: C, emit: x }) {
113
- const e = l, m = x, c = U(), r = U(0), o = U(0), f = U(0), O = U(0), P = U(!0), Q = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set();
114
- let L, p, z = -1, Y = !1, j = !1, A = !1, ne, W = 0, k = !1, te = 0, R, ae, G, se = 0;
115
- const ue = Ue(), { getItemKey: y } = De({
112
+ setup(l, { expose: P, emit: x }) {
113
+ const e = l, p = x, f = j(), r = j(0), o = j(0), m = j(0), A = j(0), O = j(!0), U = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set();
114
+ let D, w, k = -1, E = !1, F = !1, W = !1, ne, Z = 0, H = !1, ae = 0, R, J, Y, le = 0;
115
+ const se = Ue(), { getItemKey: me } = Pe({
116
116
  componentName: "ChatVirtualScroll",
117
117
  items: () => e.items,
118
118
  itemKey: () => e.itemKey
119
- }), w = n(
119
+ }), de = n(
120
120
  () => Number.isFinite(e.estimatedItemSize) ? Math.max(1, e.estimatedItemSize) : 48
121
- ), q = n(() => Math.max(0, Math.floor(e.overscan))), he = n(
121
+ ), ue = n(() => Math.max(0, Math.floor(e.overscan))), we = n(
122
122
  () => e.size !== void 0 && Number.isFinite(e.size) && e.size > 0 ? Math.max(1, Math.floor(e.size)) : void 0
123
- ), ee = n(() => f.value > 0 ? f.value : typeof e.height == "number" ? Math.max(0, e.height) : w.value), de = n(() => {
124
- const i = e.items.map((v, M) => y(v, M));
123
+ ), G = n(() => m.value > 0 ? m.value : typeof e.height == "number" ? Math.max(0, e.height) : de.value), u = n(() => {
124
+ const i = e.items.map((h, M) => me(h, M));
125
125
  return {
126
126
  keys: i,
127
- indexes: new Map(i.map((v, M) => [v, M])),
128
- sizes: at(i.map((v) => Q.get(v) ?? w.value))
127
+ indexes: new Map(i.map((h, M) => [h, M])),
128
+ sizes: at(i.map((h) => U.get(h) ?? de.value))
129
129
  };
130
- }), D = n(() => (O.value, { sizes: de.value.sizes, total: de.value.sizes.total }));
131
- function F(i = D.value.total) {
132
- return Math.max(0, i - ee.value);
130
+ }), d = n(() => (A.value, { sizes: u.value.sizes, total: u.value.sizes.total }));
131
+ function z(i = d.value.total) {
132
+ return Math.max(0, i - G.value);
133
133
  }
134
- function ve(i) {
135
- return D.value.sizes.findIndex(i);
134
+ function Q(i) {
135
+ return d.value.sizes.findIndex(i);
136
136
  }
137
- r.value = e.initialScroll === "bottom" ? F() : 0;
138
- const ge = n(() => {
137
+ r.value = e.initialScroll === "bottom" ? z() : 0;
138
+ const he = n(() => {
139
139
  if (e.items.length === 0) return { start: 0, end: 0 };
140
- const i = ve(r.value), v = ve(r.value + ee.value) + 1, M = Math.max(0, i - q.value), H = Math.min(
140
+ const i = Q(r.value), h = Q(r.value + G.value) + 1, M = Math.max(0, i - ue.value), K = Math.min(
141
141
  e.items.length,
142
- v + q.value
143
- ), ye = he.value;
144
- if (ye === void 0 || H - M <= ye) return { start: M, end: H };
145
- const we = Math.max(0, ye - (v - i)), Te = i - M, Se = H - v;
146
- let Le = Math.min(Te, Math.ceil(we / 2));
147
- const $e = Math.min(Se, we - Le);
148
- return Le = Math.min(Te, we - $e), { start: i - Le, end: v + $e };
149
- }), g = n(() => ge.value.start), E = n(() => ge.value.end), B = n(
150
- () => e.items.slice(g.value, E.value).map((i, v) => {
151
- const M = g.value + v;
142
+ h + ue.value
143
+ ), pe = we.value;
144
+ if (pe === void 0 || K - M <= pe) return { start: M, end: K };
145
+ const xe = Math.max(0, pe - (h - i)), Te = i - M, Se = K - h;
146
+ let Ee = Math.min(Te, Math.ceil(xe / 2));
147
+ const $e = Math.min(Se, xe - Ee);
148
+ return Ee = Math.min(Te, xe - $e), { start: i - Ee, end: h + $e };
149
+ }), y = n(() => he.value.start), L = n(() => he.value.end), B = n(
150
+ () => e.items.slice(y.value, L.value).map((i, h) => {
151
+ const M = y.value + h;
152
152
  return {
153
153
  item: i,
154
154
  index: M,
155
- key: y(i, M),
156
- bottom: Math.max(D.value.total, ee.value) - D.value.sizes.getOffset(M + 1) + o.value
155
+ key: me(i, M),
156
+ bottom: Math.max(d.value.total, G.value) - d.value.sizes.getOffset(M + 1) + o.value
157
157
  };
158
158
  })
159
- ), le = n(() => ({
160
- height: Ye(e.height)
159
+ ), te = n(() => ({
160
+ height: Fe(e.height)
161
161
  }));
162
- function oe(i = D.value.total) {
163
- var H;
164
- const v = F(i), M = Math.min(0, ((H = c.value) == null ? void 0 : H.scrollTop) ?? 0);
165
- return Math.max(0, Math.min(v, v + M + W));
162
+ function oe(i = d.value.total) {
163
+ var K;
164
+ const h = z(i), M = Math.min(0, ((K = f.value) == null ? void 0 : K.scrollTop) ?? 0);
165
+ return Math.max(0, Math.min(h, h + M + Z));
166
166
  }
167
167
  function re(i = !1) {
168
- if (k || (A || G) && !i || W === 0) return;
169
- k = !0;
170
- const v = se, M = ++te;
171
- o.value = 0, K(() => {
172
- if (M !== te) return;
173
- k = !1;
174
- const H = c.value;
175
- !H || v !== se || W === 0 || (W = 0, H.scrollTop = Math.min(0, r.value - F()), ae = H.scrollTop, r.value = oe(), b(), me());
168
+ if (H || (W || Y) && !i || Z === 0) return;
169
+ H = !0;
170
+ const h = le, M = ++ae;
171
+ o.value = 0, C(() => {
172
+ if (M !== ae) return;
173
+ H = !1;
174
+ const K = f.value;
175
+ !K || h !== le || Z === 0 || (Z = 0, K.scrollTop = Math.min(0, r.value - z()), J = K.scrollTop, r.value = oe(), b(), ve());
176
176
  });
177
177
  }
178
- function Me(i) {
179
- const v = c.value;
180
- if (v) {
181
- if (W += i, r.value = oe(), W === 0 || F() === 0) {
182
- W = 0, o.value = 0;
178
+ function ye(i) {
179
+ const h = f.value;
180
+ if (h) {
181
+ if (Z += i, r.value = oe(), Z === 0 || z() === 0) {
182
+ Z = 0, o.value = 0;
183
183
  return;
184
184
  }
185
- (A || G) && !k ? (o.value = W, v.scrollTop >= -1 && re(!0)) : re();
185
+ (W || Y) && !H ? (o.value = Z, h.scrollTop >= -1 && re(!0)) : re();
186
186
  }
187
187
  }
188
188
  function _() {
189
189
  clearTimeout(ne), ne = void 0;
190
190
  }
191
- function J() {
192
- if (j) return;
193
- _(), A = !1;
194
- const i = G;
195
- if (G = void 0, i) {
191
+ function ee() {
192
+ if (F) return;
193
+ _(), W = !1;
194
+ const i = Y;
195
+ if (Y = void 0, i) {
196
196
  i();
197
197
  return;
198
198
  }
199
199
  r.value = oe(), re();
200
200
  }
201
201
  function s() {
202
- _(), (A || G) && !j && (ne = setTimeout(J, 150));
202
+ _(), (W || Y) && !F && (ne = setTimeout(ee, 150));
203
203
  }
204
204
  function t() {
205
- R = void 0, G = void 0;
205
+ R = void 0, Y = void 0;
206
206
  }
207
207
  function a() {
208
- t(), _(), j = !0, A = !0, o.value = W;
208
+ t(), _(), F = !0, W = !0, o.value = Z;
209
209
  }
210
- function h(i) {
211
- j = i.touches.length > 0, s();
210
+ function g(i) {
211
+ F = i.touches.length > 0, s();
212
212
  }
213
213
  function b() {
214
- const i = c.value;
214
+ const i = f.value;
215
215
  if (!i) return;
216
216
  const M = Math.max(
217
217
  0,
218
- D.value.total - oe() - i.clientHeight
218
+ d.value.total - oe() - i.clientHeight
219
219
  ) <= Math.max(0, e.bottomThreshold);
220
- M !== P.value && (P.value = M, Y && m("bottomChange", M));
220
+ M !== O.value && (O.value = M, E && p("bottomChange", M));
221
221
  }
222
- function xe() {
222
+ function Me() {
223
223
  var i;
224
- f.value = ((i = c.value) == null ? void 0 : i.clientHeight) ?? 0, Y && (r.value = oe()), ue(c.value, e.height), K(() => {
225
- b(), me();
224
+ m.value = ((i = f.value) == null ? void 0 : i.clientHeight) ?? 0, E && (r.value = oe()), se(f.value, e.height), C(() => {
225
+ b(), ve();
226
226
  });
227
227
  }
228
- function pe() {
229
- var i, v;
230
- R && ae !== void 0 && Math.abs((((i = c.value) == null ? void 0 : i.scrollTop) ?? 0) - ae) > 1 && t(), r.value = oe(), W !== 0 && (((v = c.value) == null ? void 0 : v.scrollTop) ?? 0) >= -1 && re(!0), s(), b(), m("scroll", {
228
+ function ge() {
229
+ var i, h;
230
+ R && J !== void 0 && Math.abs((((i = f.value) == null ? void 0 : i.scrollTop) ?? 0) - J) > 1 && t(), r.value = oe(), Z !== 0 && (((h = f.value) == null ? void 0 : h.scrollTop) ?? 0) >= -1 && re(!0), s(), b(), p("scroll", {
231
231
  scrollTop: r.value,
232
- startIndex: g.value,
233
- endIndex: E.value
234
- }), me();
235
- }
236
- function me() {
237
- const i = c.value;
238
- !Y || !i || !e.hasOlder || e.loadingOlder || z === e.items.length || oe() <= Math.max(0, e.loadOlderThreshold) && (z = e.items.length, m("loadOlder"));
239
- }
240
- function Ee(i) {
241
- const v = i.borderBoxSize;
242
- if (v) {
243
- const M = Array.isArray(v) ? v[0] : v;
232
+ startIndex: y.value,
233
+ endIndex: L.value
234
+ }), ve();
235
+ }
236
+ function ve() {
237
+ const i = f.value;
238
+ !E || !i || !e.hasOlder || e.loadingOlder || k === e.items.length || oe() <= Math.max(0, e.loadOlderThreshold) && (k = e.items.length, p("loadOlder"));
239
+ }
240
+ function Le(i) {
241
+ const h = i.borderBoxSize;
242
+ if (h) {
243
+ const M = Array.isArray(h) ? h[0] : h;
244
244
  if (M != null && M.blockSize) return M.blockSize;
245
245
  }
246
246
  return i.contentRect.height;
247
247
  }
248
248
  function ke(i) {
249
- const v = D.value.total, M = oe(), H = !A && !G && P.value && e.stickToBottom && (Y || e.initialScroll === "bottom"), ye = ve(M + ee.value - 1), we = !H && M <= 0;
249
+ const h = d.value.total, M = oe(), K = !W && !Y && O.value && e.stickToBottom && (E || e.initialScroll === "bottom"), pe = Q(M + G.value - 1), xe = !K && M <= 0;
250
250
  let Te = 0, Se = !1;
251
- for (const { key: Qe, height: Fe } of i) {
252
- if (!Number.isFinite(Fe) || Fe <= 0) continue;
253
- const _e = de.value.indexes.get(Qe);
251
+ for (const { key: Je, height: We } of i) {
252
+ if (!Number.isFinite(We) || We <= 0) continue;
253
+ const _e = u.value.indexes.get(Je);
254
254
  if (_e === void 0) continue;
255
- const Xe = D.value.sizes.getSize(_e);
256
- Q.set(Qe, Fe), !(Math.abs(Xe - Fe) < 0.5) && (_e <= ye && (Te += Fe - Xe), D.value.sizes.setSize(_e, Fe), Se = !0);
255
+ const Qe = d.value.sizes.getSize(_e);
256
+ U.set(Je, We), !(Math.abs(Qe - We) < 0.5) && (_e <= pe && (Te += We - Qe), d.value.sizes.setSize(_e, We), Se = !0);
257
257
  }
258
258
  if (!Se) return;
259
- O.value += 1;
260
- const Le = F() - F(v), $e = R && de.value.indexes.get(R.key), Ne = $e !== void 0 && R ? Ie($e, R.align) : H ? F() : we ? 0 : M + Te;
261
- Me(Ne - M - Le), K(b);
259
+ A.value += 1;
260
+ const Ee = z() - z(h), $e = R && u.value.indexes.get(R.key), Ne = $e !== void 0 && R ? Ie($e, R.align) : K ? z() : xe ? 0 : M + Te;
261
+ ye(Ne - M - Ee), C(b);
262
262
  }
263
- function d(i) {
264
- const v = [];
263
+ function v(i) {
264
+ const h = [];
265
265
  for (const M of i) {
266
- const H = X.get(M.target);
267
- H !== void 0 && v.push({ key: H, height: Ee(M) });
266
+ const K = q.get(M.target);
267
+ K !== void 0 && h.push({ key: K, height: Le(M) });
268
268
  }
269
- ke(v);
269
+ ke(h);
270
270
  }
271
271
  function S() {
272
272
  const i = [];
273
- for (const v of V) {
274
- const M = X.get(v);
275
- M !== void 0 && v.isConnected && i.push({ key: M, height: v.getBoundingClientRect().height });
273
+ for (const h of V) {
274
+ const M = q.get(h);
275
+ M !== void 0 && h.isConnected && i.push({ key: M, height: h.getBoundingClientRect().height });
276
276
  }
277
277
  V.clear(), ke(i);
278
278
  }
279
- function T(i, v) {
280
- i instanceof HTMLElement && X.get(i) !== v && (X.set(i, v), Q.has(v) || V.add(i), p == null || p.observe(i));
279
+ function T(i, h) {
280
+ i instanceof HTMLElement && q.get(i) !== h && (q.set(i, h), U.has(h) || V.add(i), w == null || w.observe(i));
281
281
  }
282
282
  function fe() {
283
- for (const [i] of X)
284
- i.isConnected || (p == null || p.unobserve(i), X.delete(i), V.delete(i));
285
- }
286
- function Z(i, v, M = !1) {
287
- const H = c.value;
288
- if (!H) return;
289
- const ye = oe(), we = o.value !== 0, Te = ++se;
290
- te += 1, k = !1, R = void 0;
291
- const Se = v.behavior ?? "auto";
292
- G = Se === "smooth" ? () => be(i) : void 0, W = 0, o.value = 0, A = !1, _(), Se === "auto" && (r.value = i);
293
- const Le = () => {
294
- c.value !== H || Te !== se || (we && Se !== "auto" && (H.scrollTop = ye - F()), M && Se === "auto" ? H.scrollTop = i - F() : H.scrollTo({ ...v, top: i - F(), behavior: Se }), ae = H.scrollTop, Se === "auto" ? r.value = oe() : s(), K(b));
283
+ for (const [i] of q)
284
+ i.isConnected || (w == null || w.unobserve(i), q.delete(i), V.delete(i));
285
+ }
286
+ function X(i, h, M = !1) {
287
+ const K = f.value;
288
+ if (!K) return;
289
+ const pe = oe(), xe = o.value !== 0, Te = ++le;
290
+ ae += 1, H = !1, R = void 0;
291
+ const Se = h.behavior ?? "auto";
292
+ Y = Se === "smooth" ? () => be(i) : void 0, Z = 0, o.value = 0, W = !1, _(), Se === "auto" && (r.value = i);
293
+ const Ee = () => {
294
+ f.value !== K || Te !== le || (xe && Se !== "auto" && (K.scrollTop = pe - z()), M && Se === "auto" ? K.scrollTop = i - z() : K.scrollTo({ ...h, top: i - z(), behavior: Se }), J = K.scrollTop, Se === "auto" ? r.value = oe() : s(), C(b));
295
295
  };
296
- we ? K(Le) : Le();
296
+ xe ? C(Ee) : Ee();
297
297
  }
298
- function be(i, v = {}) {
299
- const M = c.value;
298
+ function be(i, h = {}) {
299
+ const M = f.value;
300
300
  if (!M) return;
301
- const H = Math.max(0, D.value.total - M.clientHeight), ye = Math.min(
301
+ const K = Math.max(0, d.value.total - M.clientHeight), pe = Math.min(
302
302
  Math.max(0, Number.isFinite(i) ? i : 0),
303
- H
303
+ K
304
304
  );
305
- Z(ye, v);
305
+ X(pe, h);
306
306
  }
307
- function Ie(i, v) {
308
- const M = D.value.sizes.getSize(i);
309
- let H = D.value.sizes.getOffset(i);
310
- return v === "center" ? H -= (ee.value - M) / 2 : v === "end" && (H -= ee.value - M), Math.max(0, Math.min(H, F()));
307
+ function Ie(i, h) {
308
+ const M = d.value.sizes.getSize(i);
309
+ let K = d.value.sizes.getOffset(i);
310
+ return h === "center" ? K -= (G.value - M) / 2 : h === "end" && (K -= G.value - M), Math.max(0, Math.min(K, z()));
311
311
  }
312
- function Be(i, v = {}) {
313
- if (!c.value || e.items.length === 0) return;
312
+ function Be(i, h = {}) {
313
+ if (!f.value || e.items.length === 0) return;
314
314
  const M = Math.min(
315
315
  e.items.length - 1,
316
316
  Math.max(0, Math.floor(Number.isFinite(i) ? i : 0))
317
- ), { align: H = "start", ...ye } = v;
318
- Z(Ie(M, H), ye);
319
- const we = de.value.keys[M];
320
- v.behavior === "smooth" ? G = () => {
321
- const Te = de.value.indexes.get(we);
322
- Te !== void 0 && Be(Te, { align: H });
323
- } : R = { key: we, align: H };
317
+ ), { align: K = "start", ...pe } = h;
318
+ X(Ie(M, K), pe);
319
+ const xe = u.value.keys[M];
320
+ h.behavior === "smooth" ? Y = () => {
321
+ const Te = u.value.indexes.get(xe);
322
+ Te !== void 0 && Be(Te, { align: K });
323
+ } : R = { key: xe, align: K };
324
324
  }
325
325
  function Ke(i = "auto") {
326
- Z(0, { behavior: i });
326
+ X(0, { behavior: i });
327
327
  }
328
- function Re(i = "auto") {
329
- const v = c.value;
330
- if (!v) return;
331
- const M = Math.max(0, D.value.total - v.clientHeight);
332
- Z(M, { behavior: i }, !0), i === "smooth" && (G = () => Re());
328
+ function He(i = "auto") {
329
+ const h = f.value;
330
+ if (!h) return;
331
+ const M = Math.max(0, d.value.total - h.clientHeight);
332
+ X(M, { behavior: i }, !0), i === "smooth" && (Y = () => He());
333
333
  }
334
334
  return ie(
335
- de,
336
- async (i, v) => {
337
- const M = v.sizes.total, H = oe(M), ye = !A && !G && P.value && e.stickToBottom, we = v.sizes.findIndex(H + ee.value - 1), Te = v.keys[we], Se = Te === void 0 ? void 0 : i.indexes.get(Te), Le = F() - F(M);
338
- for (const $e of Q.keys())
339
- i.indexes.has($e) || Q.delete($e);
335
+ u,
336
+ async (i, h) => {
337
+ const M = h.sizes.total, K = oe(M), pe = !W && !Y && O.value && e.stickToBottom, xe = h.sizes.findIndex(K + G.value - 1), Te = h.keys[xe], Se = Te === void 0 ? void 0 : i.indexes.get(Te), Ee = z() - z(M);
338
+ for (const $e of U.keys())
339
+ i.indexes.has($e) || U.delete($e);
340
340
  if (i.keys.length === 0 || Se === void 0) {
341
- W = 0, o.value = 0, r.value = ye ? F() : Math.min(H, F());
342
- const $e = r.value, Ne = se;
343
- await K(), Ne === se && de.value === i && Z($e, {}, !0);
341
+ Z = 0, o.value = 0, r.value = pe ? z() : Math.min(K, z());
342
+ const $e = r.value, Ne = le;
343
+ await C(), Ne === le && u.value === i && X($e, {}, !0);
344
344
  } else {
345
- const $e = i.sizes.getOffset(Se + 1) - v.sizes.getOffset(we + 1), Ne = ye ? F() : H + $e;
346
- Me(Ne - H - Le), await K();
345
+ const $e = i.sizes.getOffset(Se + 1) - h.sizes.getOffset(xe + 1), Ne = pe ? z() : K + $e;
346
+ ye(Ne - K - Ee), await C();
347
347
  }
348
- c.value && (r.value = oe(), b(), me());
348
+ f.value && (r.value = oe(), b(), ve());
349
349
  }
350
350
  ), ie(
351
351
  () => [e.hasOlder, e.loadingOlder],
352
352
  async ([i]) => {
353
- i || (z = -1), await K(), me();
353
+ i || (k = -1), await C(), ve();
354
354
  }
355
- ), Ce(() => {
356
- if (xe(), c.value && (c.value.scrollTop = e.initialScroll === "bottom" ? 0 : -F(), r.value = oe()), S(), typeof ResizeObserver < "u") {
357
- L = new ResizeObserver(xe), p = new ResizeObserver(d), c.value && L.observe(c.value);
358
- for (const [i] of X)
359
- p.observe(i);
355
+ ), Ae(() => {
356
+ if (Me(), f.value && (f.value.scrollTop = e.initialScroll === "bottom" ? 0 : -z(), r.value = oe()), S(), typeof ResizeObserver < "u") {
357
+ D = new ResizeObserver(Me), w = new ResizeObserver(v), f.value && D.observe(f.value);
358
+ for (const [i] of q)
359
+ w.observe(i);
360
360
  }
361
- K(() => {
362
- Y = !0, b(), me();
361
+ C(() => {
362
+ E = !0, b(), ve();
363
363
  });
364
- }), Je(() => {
364
+ }), Xe(() => {
365
365
  fe(), S();
366
- }), Pe(() => {
367
- Y = !1, _(), t(), W = 0, se += 1, te += 1, L && (L.disconnect(), L = void 0), p && (p.disconnect(), p = void 0), X.clear(), V.clear();
368
- }), C({
369
- isAtBottom: P,
366
+ }), Ce(() => {
367
+ E = !1, _(), t(), Z = 0, le += 1, ae += 1, D && (D.disconnect(), D = void 0), w && (w.disconnect(), w = void 0), q.clear(), V.clear();
368
+ }), P({
369
+ isAtBottom: O,
370
370
  scrollTo: be,
371
371
  scrollToIndex: Be,
372
372
  scrollToTop: Ke,
373
- scrollToBottom: Re
374
- }), (i, v) => (I(), $("div", {
373
+ scrollToBottom: He
374
+ }), (i, h) => (I(), $("div", {
375
375
  ref_key: "viewport",
376
- ref: c,
376
+ ref: f,
377
377
  class: "vue-chat-virtual-scroll",
378
- style: N(le.value),
378
+ style: N(te.value),
379
379
  role: "log",
380
380
  "aria-label": l.ariaLabel,
381
381
  "aria-live": "polite",
382
382
  tabindex: "0",
383
- onScrollPassive: pe,
384
- onScrollendPassive: J,
383
+ onScrollPassive: ge,
384
+ onScrollendPassive: ee,
385
385
  onPointerdownPassive: t,
386
386
  onWheelPassive: t,
387
387
  onKeydown: t,
388
388
  onTouchstartPassive: a,
389
- onTouchendPassive: h,
390
- onTouchcancelPassive: h
389
+ onTouchendPassive: g,
390
+ onTouchcancelPassive: g
391
391
  }, [
392
- je("div", {
392
+ Ge("div", {
393
393
  class: "vue-chat-virtual-scroll__spacer",
394
- style: N({ height: `${Math.max(ee.value, D.value.total + o.value)}px` })
394
+ style: N({ height: `${Math.max(G.value, d.value.total + o.value)}px` })
395
395
  }, [
396
396
  l.loadingOlder ? (I(), $("div", nt, [
397
- je("div", null, [
397
+ Ge("div", null, [
398
398
  ce(i.$slots, "loadingOlder", {}, () => [
399
- v[0] || (v[0] = Ve("Loading older messages…", -1))
399
+ h[0] || (h[0] = Ve("Loading older messages…", -1))
400
400
  ])
401
401
  ])
402
402
  ])) : ze("", !0),
403
- (I(!0), $(He, null, Ae(B.value, ({ item: M, index: H, key: ye, bottom: we }) => (I(), $("div", {
404
- key: ye,
403
+ (I(!0), $(Re, null, De(B.value, ({ item: M, index: K, key: pe, bottom: xe }) => (I(), $("div", {
404
+ key: pe,
405
405
  ref_for: !0,
406
- ref: (Te) => T(Te, ye),
406
+ ref: (Te) => T(Te, pe),
407
407
  class: "vue-chat-virtual-scroll__item",
408
- style: N({ transform: `translateY(${-we}px)` }),
408
+ style: N({ transform: `translateY(${-xe}px)` }),
409
409
  role: "article",
410
- "aria-posinset": H + 1,
410
+ "aria-posinset": K + 1,
411
411
  "aria-setsize": l.items.length
412
412
  }, [
413
413
  ce(i.$slots, "default", {
414
414
  item: M,
415
- index: H
415
+ index: K
416
416
  })
417
417
  ], 12, it))), 128)),
418
418
  l.items.length ? ze("", !0) : ce(i.$slots, "empty", {}, void 0, void 0, 1)
@@ -421,61 +421,61 @@ const ot = ["aria-label"], nt = {
421
421
  }
422
422
  });
423
423
  function qe(l) {
424
- const C = U(), x = U(0), e = U(!1), m = U(!1), c = n(() => Math.max(1, l.threshold())), r = n(
425
- () => l.refreshing() || m.value ? c.value : x.value
424
+ const P = j(), x = j(0), e = j(!1), p = j(!1), f = n(() => Math.max(1, l.threshold())), r = n(
425
+ () => l.refreshing() || p.value ? f.value : x.value
426
426
  ), o = n(
427
- () => Math.min(1, x.value / c.value)
428
- ), f = n(() => l.refreshing() || m.value ? "Refreshing…" : o.value >= 1 ? "Release to refresh" : "Pull to refresh");
429
- function O() {
430
- C.value = void 0, e.value = !1, x.value = 0;
427
+ () => Math.min(1, x.value / f.value)
428
+ ), m = n(() => l.refreshing() || p.value ? "Refreshing…" : o.value >= 1 ? "Release to refresh" : "Pull to refresh");
429
+ function A() {
430
+ P.value = void 0, e.value = !1, x.value = 0;
431
431
  }
432
- function P(V) {
433
- var z;
434
- const L = V.currentTarget, p = ((z = l.scrollTop) == null ? void 0 : z.call(l)) ?? L.scrollTop;
435
- !l.enabled() || l.refreshing() || p > 0 || V.touches.length !== 1 || (C.value = V.touches[0].clientY, e.value = !0);
432
+ function O(V) {
433
+ var k;
434
+ const D = V.currentTarget, w = ((k = l.scrollTop) == null ? void 0 : k.call(l)) ?? D.scrollTop;
435
+ !l.enabled() || l.refreshing() || w > 0 || V.touches.length !== 1 || (P.value = V.touches[0].clientY, e.value = !0);
436
436
  }
437
- function Q(V) {
438
- var Y;
439
- if (C.value === void 0 || !e.value) return;
440
- const L = V.currentTarget;
441
- if ((((Y = l.scrollTop) == null ? void 0 : Y.call(l)) ?? L.scrollTop) > 0 || V.touches.length !== 1) {
442
- O();
437
+ function U(V) {
438
+ var E;
439
+ if (P.value === void 0 || !e.value) return;
440
+ const D = V.currentTarget;
441
+ if ((((E = l.scrollTop) == null ? void 0 : E.call(l)) ?? D.scrollTop) > 0 || V.touches.length !== 1) {
442
+ A();
443
443
  return;
444
444
  }
445
- const z = V.touches[0].clientY - C.value;
446
- if (z <= 0) {
445
+ const k = V.touches[0].clientY - P.value;
446
+ if (k <= 0) {
447
447
  x.value = 0;
448
448
  return;
449
449
  }
450
- V.preventDefault(), x.value = Math.min(z * 0.5, c.value * 2);
450
+ V.preventDefault(), x.value = Math.min(k * 0.5, f.value * 2);
451
451
  }
452
- function X() {
453
- if (C.value === void 0) return;
454
- const V = x.value >= c.value && l.enabled() && !l.refreshing();
455
- if (C.value = void 0, e.value = !1, !V) {
452
+ function q() {
453
+ if (P.value === void 0) return;
454
+ const V = x.value >= f.value && l.enabled() && !l.refreshing();
455
+ if (P.value = void 0, e.value = !1, !V) {
456
456
  x.value = 0;
457
457
  return;
458
458
  }
459
- x.value = c.value, m.value = !0, l.onRefresh(), K(() => {
460
- l.refreshing() || (m.value = !1, x.value = 0);
459
+ x.value = f.value, p.value = !0, l.onRefresh(), C(() => {
460
+ l.refreshing() || (p.value = !1, x.value = 0);
461
461
  });
462
462
  }
463
463
  return ie(
464
464
  () => l.refreshing(),
465
- (V, L) => {
466
- V ? (m.value = !1, x.value = c.value) : L && (m.value = !1, x.value = 0);
465
+ (V, D) => {
466
+ V ? (p.value = !1, x.value = f.value) : D && (p.value = !1, x.value = 0);
467
467
  }
468
468
  ), {
469
469
  pulling: e,
470
470
  pullDistance: x,
471
471
  pullOffset: r,
472
472
  pullProgress: o,
473
- refreshMessage: f,
474
- refreshThreshold: c,
475
- handleTouchStart: P,
476
- handleTouchMove: Q,
477
- handleTouchEnd: X,
478
- handleTouchCancel: O
473
+ refreshMessage: m,
474
+ refreshThreshold: f,
475
+ handleTouchStart: O,
476
+ handleTouchMove: U,
477
+ handleTouchEnd: q,
478
+ handleTouchCancel: A
479
479
  };
480
480
  }
481
481
  const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PURE__ */ Oe({
@@ -497,39 +497,39 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
497
497
  pullRefreshThreshold: { default: 64 }
498
498
  },
499
499
  emits: ["scroll", "loadMore", "refresh"],
500
- setup(l, { expose: C, emit: x }) {
501
- const e = l, m = x, {
502
- pulling: c,
500
+ setup(l, { expose: P, emit: x }) {
501
+ const e = l, p = x, {
502
+ pulling: f,
503
503
  pullDistance: r,
504
504
  pullOffset: o,
505
- pullProgress: f,
506
- refreshMessage: O,
507
- refreshThreshold: P,
508
- handleTouchStart: Q,
509
- handleTouchMove: X,
505
+ pullProgress: m,
506
+ refreshMessage: A,
507
+ refreshThreshold: O,
508
+ handleTouchStart: U,
509
+ handleTouchMove: q,
510
510
  handleTouchEnd: V,
511
- handleTouchCancel: L
511
+ handleTouchCancel: D
512
512
  } = qe({
513
513
  enabled: () => e.pullToRefresh,
514
514
  refreshing: () => e.refreshing,
515
515
  threshold: () => e.pullRefreshThreshold,
516
- onRefresh: () => m("refresh")
517
- }), p = U(), z = U(0), Y = U(0), j = U(0), A = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Map();
518
- let W, k, te = -1;
519
- const R = Ue(), { getItemKey: ae } = De({
516
+ onRefresh: () => p("refresh")
517
+ }), w = j(), k = j(0), E = j(0), F = j(0), W = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Map();
518
+ let Z, H, ae = -1;
519
+ const R = Ue(), { getItemKey: J } = Pe({
520
520
  componentName: "DynamicVirtualScroll",
521
521
  items: () => e.items,
522
522
  itemKey: () => e.itemKey
523
- }), G = n(
523
+ }), Y = n(
524
524
  () => Math.max(1, e.estimatedItemSize)
525
- ), se = n(
526
- () => Math.max(1, e.loadingItemSize ?? G.value)
527
- ), ue = n(() => Math.max(0, Math.floor(e.overscan))), y = n(() => Y.value > 0 ? Y.value : typeof e.height == "number" ? Math.max(0, e.height) : G.value), w = n(() => {
528
- j.value;
525
+ ), le = n(
526
+ () => Math.max(1, e.loadingItemSize ?? Y.value)
527
+ ), se = n(() => Math.max(0, Math.floor(e.overscan))), me = n(() => E.value > 0 ? E.value : typeof e.height == "number" ? Math.max(0, e.height) : Y.value), de = n(() => {
528
+ F.value;
529
529
  const s = new Array(e.items.length + 1), t = new Array(e.items.length);
530
530
  s[0] = 0;
531
531
  for (let a = 0; a < e.items.length; a += 1) {
532
- const h = ae(e.items[a], a), b = A.get(h) ?? G.value;
532
+ const g = J(e.items[a], a), b = W.get(g) ?? Y.value;
533
533
  t[a] = b, s[a + 1] = s[a] + b;
534
534
  }
535
535
  return {
@@ -537,66 +537,66 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
537
537
  sizes: t,
538
538
  total: s[e.items.length] ?? 0
539
539
  };
540
- }), q = n(
541
- () => w.value.total + (e.loading ? se.value : 0)
542
- ), he = n(() => {
540
+ }), ue = n(
541
+ () => de.value.total + (e.loading ? le.value : 0)
542
+ ), we = n(() => {
543
543
  const s = /* @__PURE__ */ new Map();
544
544
  return e.items.forEach((t, a) => {
545
- s.set(ae(t, a), a);
545
+ s.set(J(t, a), a);
546
546
  }), s;
547
547
  });
548
- function ee(s) {
548
+ function G(s) {
549
549
  if (e.items.length === 0) return 0;
550
- const t = w.value.offsets;
551
- let a = 0, h = e.items.length;
552
- for (; a < h; ) {
553
- const b = Math.floor((a + h) / 2);
554
- t[b + 1] <= s ? a = b + 1 : h = b;
550
+ const t = de.value.offsets;
551
+ let a = 0, g = e.items.length;
552
+ for (; a < g; ) {
553
+ const b = Math.floor((a + g) / 2);
554
+ t[b + 1] <= s ? a = b + 1 : g = b;
555
555
  }
556
556
  return Math.min(a, e.items.length - 1);
557
557
  }
558
- const de = n(
558
+ const u = n(
559
559
  () => Math.max(
560
560
  0,
561
- ee(z.value) - ue.value
561
+ G(k.value) - se.value
562
562
  )
563
- ), D = n(() => {
563
+ ), d = n(() => {
564
564
  if (e.items.length === 0) return 0;
565
- const s = ee(z.value + y.value) + 1;
565
+ const s = G(k.value + me.value) + 1;
566
566
  return Math.min(
567
567
  e.items.length,
568
- s + ue.value
568
+ s + se.value
569
569
  );
570
- }), F = n(
571
- () => e.items.slice(de.value, D.value).map((s, t) => {
572
- const a = de.value + t;
570
+ }), z = n(
571
+ () => e.items.slice(u.value, d.value).map((s, t) => {
572
+ const a = u.value + t;
573
573
  return {
574
574
  item: s,
575
575
  index: a,
576
- key: ae(s, a),
577
- top: w.value.offsets[a]
576
+ key: J(s, a),
577
+ top: de.value.offsets[a]
578
578
  };
579
579
  })
580
- ), ve = n(() => ({
581
- height: Ye(e.height)
580
+ ), Q = n(() => ({
581
+ height: Fe(e.height)
582
582
  }));
583
- function ge() {
583
+ function he() {
584
584
  var s;
585
- Y.value = ((s = p.value) == null ? void 0 : s.clientHeight) ?? 0, R(p.value, e.height), K(E);
586
- }
587
- function g(s) {
588
- z.value = s.currentTarget.scrollTop, m("scroll", {
589
- scrollTop: z.value,
590
- startIndex: de.value,
591
- endIndex: D.value
592
- }), E();
593
- }
594
- function E() {
595
- const s = p.value;
596
- if (!s || !e.hasMore || e.loading || te === e.items.length)
585
+ E.value = ((s = w.value) == null ? void 0 : s.clientHeight) ?? 0, R(w.value, e.height), C(L);
586
+ }
587
+ function y(s) {
588
+ k.value = s.currentTarget.scrollTop, p("scroll", {
589
+ scrollTop: k.value,
590
+ startIndex: u.value,
591
+ endIndex: d.value
592
+ }), L();
593
+ }
594
+ function L() {
595
+ const s = w.value;
596
+ if (!s || !e.hasMore || e.loading || ae === e.items.length)
597
597
  return;
598
598
  const t = Math.max(0, e.loadMoreThreshold);
599
- q.value - s.scrollTop - s.clientHeight <= t && (te = e.items.length, m("loadMore"));
599
+ ue.value - s.scrollTop - s.clientHeight <= t && (ae = e.items.length, p("loadMore"));
600
600
  }
601
601
  function B(s) {
602
602
  const t = s.borderBoxSize;
@@ -606,164 +606,164 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
606
606
  }
607
607
  return s.contentRect.height;
608
608
  }
609
- function le(s) {
610
- const t = w.value;
611
- let a = 0, h = !1;
609
+ function te(s) {
610
+ const t = de.value;
611
+ let a = 0, g = !1;
612
612
  for (const b of s) {
613
- const xe = b.target, pe = ne.get(xe), me = B(b);
614
- if (pe === void 0 || me <= 0) continue;
615
- const Ee = A.get(pe) ?? G.value;
616
- if (Math.abs(Ee - me) < 0.5) continue;
617
- const ke = he.value.get(pe);
618
- ke !== void 0 && t.offsets[ke + 1] <= z.value && (a += me - Ee), A.set(pe, me), h = !0;
613
+ const Me = b.target, ge = ne.get(Me), ve = B(b);
614
+ if (ge === void 0 || ve <= 0) continue;
615
+ const Le = W.get(ge) ?? Y.value;
616
+ if (Math.abs(Le - ve) < 0.5) continue;
617
+ const ke = we.value.get(ge);
618
+ ke !== void 0 && t.offsets[ke + 1] <= k.value && (a += ve - Le), W.set(ge, ve), g = !0;
619
619
  }
620
- h && (j.value += 1, K(E), a !== 0 && K(() => {
621
- const b = p.value;
622
- b && (b.scrollTop += a, z.value = b.scrollTop);
620
+ g && (F.value += 1, C(L), a !== 0 && C(() => {
621
+ const b = w.value;
622
+ b && (b.scrollTop += a, k.value = b.scrollTop);
623
623
  }));
624
624
  }
625
625
  function oe(s, t) {
626
- s instanceof HTMLElement && (ne.set(s, t), k == null || k.observe(s));
626
+ s instanceof HTMLElement && (ne.set(s, t), H == null || H.observe(s));
627
627
  }
628
628
  function re() {
629
629
  for (const [s] of ne)
630
- s.isConnected || (k == null || k.unobserve(s), ne.delete(s));
630
+ s.isConnected || (H == null || H.unobserve(s), ne.delete(s));
631
631
  }
632
- function Me(s, t = {}) {
633
- const a = p.value;
632
+ function ye(s, t = {}) {
633
+ const a = w.value;
634
634
  if (!a) return;
635
- const h = Math.max(0, q.value - a.clientHeight), b = Math.min(
635
+ const g = Math.max(0, ue.value - a.clientHeight), b = Math.min(
636
636
  Math.max(0, Number.isFinite(s) ? s : 0),
637
- h
638
- ), xe = t.behavior ?? "auto";
639
- xe === "auto" && (z.value = b), a.scrollTo({ ...t, top: b, behavior: xe });
637
+ g
638
+ ), Me = t.behavior ?? "auto";
639
+ Me === "auto" && (k.value = b), a.scrollTo({ ...t, top: b, behavior: Me });
640
640
  }
641
641
  function _(s, t = {}) {
642
- const a = p.value;
642
+ const a = w.value;
643
643
  if (!a || e.items.length === 0) return;
644
- const h = Math.min(
644
+ const g = Math.min(
645
645
  e.items.length - 1,
646
646
  Math.max(0, Math.floor(s))
647
- ), { align: b = "start", ...xe } = t;
648
- let pe = w.value.offsets[h];
649
- const me = w.value.sizes[h];
650
- b === "center" ? pe -= (a.clientHeight - me) / 2 : b === "end" && (pe -= a.clientHeight - me);
651
- const Ee = Math.max(
647
+ ), { align: b = "start", ...Me } = t;
648
+ let ge = de.value.offsets[g];
649
+ const ve = de.value.sizes[g];
650
+ b === "center" ? ge -= (a.clientHeight - ve) / 2 : b === "end" && (ge -= a.clientHeight - ve);
651
+ const Le = Math.max(
652
652
  0,
653
- Math.min(pe, q.value - a.clientHeight)
654
- ), ke = xe.behavior ?? "auto";
655
- ke === "auto" && (z.value = Ee), a.scrollTo({
656
- ...xe,
657
- top: Ee,
653
+ Math.min(ge, ue.value - a.clientHeight)
654
+ ), ke = Me.behavior ?? "auto";
655
+ ke === "auto" && (k.value = Le), a.scrollTo({
656
+ ...Me,
657
+ top: Le,
658
658
  behavior: ke
659
659
  });
660
660
  }
661
- function J(s = "auto") {
661
+ function ee(s = "auto") {
662
662
  var t;
663
- (t = p.value) == null || t.scrollTo({ top: 0, behavior: s });
663
+ (t = w.value) == null || t.scrollTo({ top: 0, behavior: s });
664
664
  }
665
665
  return ie(
666
666
  () => e.itemKey,
667
667
  () => {
668
- A.clear(), j.value += 1;
668
+ W.clear(), F.value += 1;
669
669
  }
670
670
  ), ie(
671
671
  () => e.items.length,
672
672
  async () => {
673
673
  const s = new Set(
674
- e.items.map((h, b) => ae(h, b))
674
+ e.items.map((g, b) => J(g, b))
675
675
  );
676
- for (const h of A.keys())
677
- s.has(h) || A.delete(h);
678
- j.value += 1, await K();
679
- const t = p.value;
676
+ for (const g of W.keys())
677
+ s.has(g) || W.delete(g);
678
+ F.value += 1, await C();
679
+ const t = w.value;
680
680
  if (!t) return;
681
- const a = Math.max(0, q.value - t.clientHeight);
682
- t.scrollTop > a && (t.scrollTop = a, z.value = a), E();
681
+ const a = Math.max(0, ue.value - t.clientHeight);
682
+ t.scrollTop > a && (t.scrollTop = a, k.value = a), L();
683
683
  }
684
684
  ), ie(
685
685
  () => [e.hasMore, e.loading],
686
686
  async ([s]) => {
687
- s || (te = -1), await K(), E();
687
+ s || (ae = -1), await C(), L();
688
688
  }
689
- ), Ce(() => {
690
- if (ge(), typeof ResizeObserver < "u") {
691
- W = new ResizeObserver(ge), k = new ResizeObserver(le), p.value && W.observe(p.value);
689
+ ), Ae(() => {
690
+ if (he(), typeof ResizeObserver < "u") {
691
+ Z = new ResizeObserver(he), H = new ResizeObserver(te), w.value && Z.observe(w.value);
692
692
  for (const [s] of ne)
693
- k.observe(s);
693
+ H.observe(s);
694
694
  }
695
- K(E);
696
- }), Je(re), Pe(() => {
697
- W && (W.disconnect(), W = void 0), k && (k.disconnect(), k = void 0), ne.clear();
698
- }), C({
699
- scrollTo: Me,
695
+ C(L);
696
+ }), Xe(re), Ce(() => {
697
+ Z && (Z.disconnect(), Z = void 0), H && (H.disconnect(), H = void 0), ne.clear();
698
+ }), P({
699
+ scrollTo: ye,
700
700
  scrollToIndex: _,
701
- scrollToTop: J
701
+ scrollToTop: ee
702
702
  }), (s, t) => (I(), $("div", {
703
703
  ref_key: "viewport",
704
- ref: p,
705
- class: We(["vue-dynamic-virtual-scroll", { "vue-dynamic-virtual-scroll--pulling": u(c) }]),
706
- style: N(ve.value),
704
+ ref: w,
705
+ class: Ye(["vue-dynamic-virtual-scroll", { "vue-dynamic-virtual-scroll--pulling": c(f) }]),
706
+ style: N(Q.value),
707
707
  role: "list",
708
708
  "aria-label": l.ariaLabel,
709
709
  tabindex: "0",
710
- onScrollPassive: g,
710
+ onScrollPassive: y,
711
711
  onTouchstartPassive: t[0] || (t[0] = //@ts-ignore
712
- (...a) => u(Q) && u(Q)(...a)),
712
+ (...a) => c(U) && c(U)(...a)),
713
713
  onTouchmove: t[1] || (t[1] = //@ts-ignore
714
- (...a) => u(X) && u(X)(...a)),
714
+ (...a) => c(q) && c(q)(...a)),
715
715
  onTouchend: t[2] || (t[2] = //@ts-ignore
716
- (...a) => u(V) && u(V)(...a)),
716
+ (...a) => c(V) && c(V)(...a)),
717
717
  onTouchcancel: t[3] || (t[3] = //@ts-ignore
718
- (...a) => u(L) && u(L)(...a))
718
+ (...a) => c(D) && c(D)(...a))
719
719
  }, [
720
720
  l.pullToRefresh || l.refreshing ? (I(), $("div", {
721
721
  key: 0,
722
722
  class: "vue-dynamic-virtual-scroll__refresh",
723
723
  style: N({
724
- height: `${u(P)}px`,
725
- transform: `translateY(${u(o) - u(P)}px)`
724
+ height: `${c(O)}px`,
725
+ transform: `translateY(${c(o) - c(O)}px)`
726
726
  }),
727
727
  role: "status",
728
728
  "aria-live": "polite"
729
729
  }, [
730
730
  ce(s.$slots, "refresh", {
731
- pullDistance: u(r),
732
- progress: u(f),
731
+ pullDistance: c(r),
732
+ progress: c(m),
733
733
  refreshing: l.refreshing
734
734
  }, () => [
735
- Ve(Ge(u(O)), 1)
735
+ Ve(je(c(A)), 1)
736
736
  ])
737
737
  ], 4)) : ze("", !0),
738
738
  l.items.length || l.loading ? (I(), $("div", {
739
739
  key: 1,
740
740
  class: "vue-dynamic-virtual-scroll__spacer",
741
741
  style: N({
742
- height: `${q.value}px`,
743
- transform: `translateY(${u(o)}px)`
742
+ height: `${ue.value}px`,
743
+ transform: `translateY(${c(o)}px)`
744
744
  })
745
745
  }, [
746
- (I(!0), $(He, null, Ae(F.value, ({ item: a, index: h, key: b, top: xe }) => (I(), $("div", {
746
+ (I(!0), $(Re, null, De(z.value, ({ item: a, index: g, key: b, top: Me }) => (I(), $("div", {
747
747
  key: b,
748
748
  ref_for: !0,
749
- ref: (pe) => oe(pe, b),
749
+ ref: (ge) => oe(ge, b),
750
750
  class: "vue-dynamic-virtual-scroll__item",
751
- style: N({ transform: `translateY(${xe}px)` }),
751
+ style: N({ transform: `translateY(${Me}px)` }),
752
752
  role: "listitem",
753
- "aria-posinset": h + 1,
753
+ "aria-posinset": g + 1,
754
754
  "aria-setsize": l.items.length
755
755
  }, [
756
756
  ce(s.$slots, "default", {
757
757
  item: a,
758
- index: h
758
+ index: g
759
759
  })
760
760
  ], 12, ut))), 128)),
761
761
  l.loading ? (I(), $("div", {
762
762
  key: 0,
763
763
  class: "vue-dynamic-virtual-scroll__loading",
764
764
  style: N({
765
- height: `${se.value}px`,
766
- transform: `translateY(${w.value.total}px)`
765
+ height: `${le.value}px`,
766
+ transform: `translateY(${de.value.total}px)`
767
767
  }),
768
768
  role: "status",
769
769
  "aria-live": "polite"
@@ -775,16 +775,16 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
775
775
  ], 4)) : (I(), $("div", {
776
776
  key: 2,
777
777
  class: "vue-dynamic-virtual-scroll__empty",
778
- style: N({ transform: `translateY(${u(o)}px)` })
778
+ style: N({ transform: `translateY(${c(o)}px)` })
779
779
  }, [
780
780
  ce(s.$slots, "empty")
781
781
  ], 4))
782
782
  ], 46, rt));
783
783
  }
784
- }), ct = ["aria-label"], dt = ["aria-current", "aria-posinset", "aria-setsize"], vt = {
784
+ }), ct = ["aria-label"], dt = ["aria-current", "aria-posinset", "aria-setsize"], ft = {
785
785
  key: 1,
786
786
  class: "vue-short-media-feed__empty"
787
- }, ft = /* @__PURE__ */ Oe({
787
+ }, vt = 36, ht = 700, mt = /* @__PURE__ */ Oe({
788
788
  name: "ShortMediaFeed",
789
789
  __name: "ShortMediaFeed",
790
790
  props: {
@@ -799,87 +799,101 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
799
799
  loadMoreThreshold: { default: 2 }
800
800
  },
801
801
  emits: ["update:activeIndex", "change", "reachStart", "reachEnd", "loadMore"],
802
- setup(l, { expose: C, emit: x }) {
803
- const e = l, m = x, c = U(), r = U(0), o = U(W(e.activeIndex));
804
- let f, O = -1;
805
- const P = Ue(), { getItemKey: Q } = De({
802
+ setup(l, { expose: P, emit: x }) {
803
+ const e = l, p = x, f = j(), r = j(0), o = j(R(e.activeIndex));
804
+ let m, A = -1, O = 0, U = !1, q;
805
+ const V = Ue(), { getItemKey: D } = Pe({
806
806
  componentName: "ShortMediaFeed",
807
807
  items: () => e.items,
808
808
  itemKey: () => e.itemKey
809
- }), X = n(
809
+ }), w = n(
810
810
  () => Math.max(0, Math.floor(e.buffer))
811
- ), V = n(
811
+ ), k = n(
812
812
  () => Math.max(
813
813
  0,
814
814
  Math.floor(
815
815
  Number.isFinite(e.loadMoreThreshold) ? e.loadMoreThreshold : 0
816
816
  )
817
817
  )
818
- ), L = n(() => r.value > 0 ? r.value : typeof e.height == "number" ? Math.max(1, e.height) : 0), p = n(
819
- () => Math.max(0, o.value - X.value)
820
- ), z = n(
818
+ ), E = n(() => r.value > 0 ? r.value : typeof e.height == "number" ? Math.max(1, e.height) : 0), F = n(
819
+ () => Math.max(0, o.value - w.value)
820
+ ), W = n(
821
821
  () => Math.min(
822
822
  e.items.length,
823
- o.value + X.value + 1
823
+ o.value + w.value + 1
824
824
  )
825
- ), Y = n(
826
- () => e.items.slice(p.value, z.value).map((y, w) => ({
827
- item: y,
828
- index: p.value + w
825
+ ), ne = n(
826
+ () => e.items.slice(F.value, W.value).map((u, d) => ({
827
+ item: u,
828
+ index: F.value + d
829
829
  }))
830
- ), j = n(() => p.value * L.value), A = n(
831
- () => (e.items.length - z.value) * L.value
832
- ), ne = n(() => ({
833
- height: Ye(e.height)
830
+ ), Z = n(() => F.value * E.value), H = n(
831
+ () => (e.items.length - W.value) * E.value
832
+ ), ae = n(() => ({
833
+ height: Fe(e.height)
834
834
  }));
835
- function W(y) {
835
+ function R(u) {
836
836
  return e.items.length === 0 ? 0 : Math.min(
837
837
  e.items.length - 1,
838
- Math.max(0, Math.floor(Number.isFinite(y) ? y : 0))
838
+ Math.max(0, Math.floor(Number.isFinite(u) ? u : 0))
839
839
  );
840
840
  }
841
- function k() {
842
- if (!e.hasMore || e.loading || O === e.items.length)
841
+ function J() {
842
+ if (!e.hasMore || e.loading || A === e.items.length)
843
843
  return;
844
- (e.items.length === 0 ? 0 : e.items.length - 1 - o.value) <= V.value && (O = e.items.length, m("loadMore"));
844
+ (e.items.length === 0 ? 0 : e.items.length - 1 - o.value) <= k.value && (A = e.items.length, p("loadMore"));
845
845
  }
846
- function te(y) {
847
- const w = W(y);
848
- w === o.value || e.items.length === 0 || (o.value = w, m("update:activeIndex", w), m("change", {
849
- index: w,
850
- item: e.items[w]
851
- }), w === 0 && m("reachStart"), w === e.items.length - 1 && m("reachEnd"), k());
846
+ function Y(u) {
847
+ const d = R(u);
848
+ d === o.value || e.items.length === 0 || (o.value = d, p("update:activeIndex", d), p("change", {
849
+ index: d,
850
+ item: e.items[d]
851
+ }), d === 0 && p("reachStart"), d === e.items.length - 1 && p("reachEnd"), J());
852
852
  }
853
- function R(y, w = {}) {
854
- const q = c.value;
855
- q && (typeof q.scrollTo == "function" ? q.scrollTo({ ...w, top: y }) : q.scrollTop = y);
853
+ function le(u, d = {}) {
854
+ const z = f.value;
855
+ z && (typeof z.scrollTo == "function" ? z.scrollTo({ ...d, top: u }) : z.scrollTop = u);
856
856
  }
857
- function ae(y, w = {}) {
857
+ function se(u, d = {}) {
858
858
  if (e.items.length === 0) return;
859
- const q = W(y);
860
- te(q), R(q * L.value, w);
861
- }
862
- function G(y) {
863
- if (L.value <= 0) return;
864
- const w = y.currentTarget.scrollTop;
865
- te(Math.round(w / L.value));
866
- }
867
- function se(y) {
868
- let w;
869
- y.key === "ArrowDown" || y.key === "PageDown" ? w = o.value + 1 : y.key === "ArrowUp" || y.key === "PageUp" ? w = o.value - 1 : y.key === "Home" ? w = 0 : y.key === "End" && (w = e.items.length - 1), w !== void 0 && (y.preventDefault(), ae(w, { behavior: "smooth" }));
870
- }
871
- function ue() {
872
- var w;
873
- const y = ((w = c.value) == null ? void 0 : w.clientHeight) ?? 0;
874
- P(c.value, e.height), !(y <= 0 || y === r.value) && (r.value = y, K(() => {
875
- R(o.value * y);
859
+ const z = R(u);
860
+ Y(z), le(z * E.value, d);
861
+ }
862
+ function me(u) {
863
+ if (E.value <= 0) return;
864
+ const d = u.currentTarget.scrollTop;
865
+ Y(Math.round(d / E.value));
866
+ }
867
+ function de(u) {
868
+ let d;
869
+ u.key === "ArrowDown" || u.key === "PageDown" ? d = o.value + 1 : u.key === "ArrowUp" || u.key === "PageUp" ? d = o.value - 1 : u.key === "Home" ? d = 0 : u.key === "End" && (d = e.items.length - 1), d !== void 0 && (u.preventDefault(), se(d, { behavior: "smooth" }));
870
+ }
871
+ function ue(u) {
872
+ return u.deltaMode === WheelEvent.DOM_DELTA_LINE ? u.deltaY * 16 : u.deltaMode === WheelEvent.DOM_DELTA_PAGE ? u.deltaY * (E.value || 1) : u.deltaY;
873
+ }
874
+ function we(u) {
875
+ if (u.ctrlKey || Math.abs(u.deltaX) > Math.abs(u.deltaY) || e.items.length === 0 || E.value <= 0 || (u.preventDefault(), U)) return;
876
+ const d = ue(u);
877
+ if (d * O < 0 && (O = 0), O += d, Math.abs(O) < vt) return;
878
+ const z = O > 0 ? 1 : -1;
879
+ O = 0;
880
+ const Q = o.value + z;
881
+ Q < 0 || Q >= e.items.length || (U = !0, se(Q, { behavior: "smooth" }), q = setTimeout(() => {
882
+ U = !1;
883
+ }, ht));
884
+ }
885
+ function G() {
886
+ var d;
887
+ const u = ((d = f.value) == null ? void 0 : d.clientHeight) ?? 0;
888
+ V(f.value, e.height), !(u <= 0 || u === r.value) && (r.value = u, C(() => {
889
+ le(o.value * u);
876
890
  }));
877
891
  }
878
892
  return ie(
879
893
  () => e.activeIndex,
880
- async (y) => {
881
- const w = W(y);
882
- w !== o.value && (o.value = w, await K(), R(w * L.value), k());
894
+ async (u) => {
895
+ const d = R(u);
896
+ d !== o.value && (o.value = d, await C(), le(d * E.value), J());
883
897
  }
884
898
  ), ie(
885
899
  () => [
@@ -887,67 +901,68 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
887
901
  e.loading,
888
902
  e.loadMoreThreshold
889
903
  ],
890
- async ([y]) => {
891
- y || (O = -1), await K(), k();
904
+ async ([u]) => {
905
+ u || (A = -1), await C(), J();
892
906
  }
893
907
  ), ie(
894
908
  () => e.items.length,
895
909
  async () => {
896
- const y = W(o.value);
897
- e.items.length === 0 ? o.value !== 0 && (o.value = 0, m("update:activeIndex", 0)) : te(y), await K(), R(y * L.value), k();
910
+ const u = R(o.value);
911
+ e.items.length === 0 ? o.value !== 0 && (o.value = 0, p("update:activeIndex", 0)) : Y(u), await C(), le(u * E.value), J();
898
912
  }
899
- ), Ce(async () => {
900
- ue(), typeof ResizeObserver < "u" && c.value && (f = new ResizeObserver(ue), f.observe(c.value)), await K(), R(o.value * L.value), k();
901
- }), Pe(() => {
902
- f && (f.disconnect(), f = void 0);
903
- }), C({
904
- scrollToIndex: ae
905
- }), (y, w) => (I(), $("div", {
913
+ ), Ae(async () => {
914
+ G(), typeof ResizeObserver < "u" && f.value && (m = new ResizeObserver(G), m.observe(f.value)), await C(), le(o.value * E.value), J();
915
+ }), Ce(() => {
916
+ m && (m.disconnect(), m = void 0), q && (clearTimeout(q), q = void 0);
917
+ }), P({
918
+ scrollToIndex: se
919
+ }), (u, d) => (I(), $("div", {
906
920
  ref_key: "viewport",
907
- ref: c,
921
+ ref: f,
908
922
  class: "vue-short-media-feed",
909
- style: N(ne.value),
923
+ style: N(ae.value),
910
924
  role: "list",
911
925
  "aria-orientation": "vertical",
912
926
  "aria-label": l.ariaLabel,
913
927
  tabindex: "0",
914
- onScrollPassive: G,
915
- onKeydown: se
928
+ onScrollPassive: me,
929
+ onWheel: we,
930
+ onKeydown: de
916
931
  }, [
917
- l.items.length ? (I(), $(He, { key: 0 }, [
918
- j.value > 0 ? (I(), $("div", {
932
+ l.items.length ? (I(), $(Re, { key: 0 }, [
933
+ Z.value > 0 ? (I(), $("div", {
919
934
  key: 0,
920
935
  class: "vue-short-media-feed__spacer",
921
- style: N({ height: `${j.value}px` }),
936
+ style: N({ height: `${Z.value}px` }),
922
937
  "aria-hidden": "true"
923
938
  }, null, 4)) : ze("", !0),
924
- (I(!0), $(He, null, Ae(Y.value, ({ item: q, index: he }) => (I(), $("div", {
925
- key: u(Q)(q, he),
939
+ (I(!0), $(Re, null, De(ne.value, ({ item: z, index: Q }) => (I(), $("div", {
940
+ key: c(D)(z, Q),
926
941
  class: "vue-short-media-feed__item",
927
- style: N({ height: `${L.value}px` }),
942
+ style: N({ height: `${E.value}px` }),
928
943
  role: "listitem",
929
- "aria-current": he === o.value ? "true" : void 0,
930
- "aria-posinset": he + 1,
944
+ "aria-current": Q === o.value ? "true" : void 0,
945
+ "aria-posinset": Q + 1,
931
946
  "aria-setsize": l.items.length
932
947
  }, [
933
- ce(y.$slots, "default", {
934
- item: q,
935
- index: he,
936
- active: he === o.value
948
+ ce(u.$slots, "default", {
949
+ item: z,
950
+ index: Q,
951
+ active: Q === o.value
937
952
  })
938
953
  ], 12, dt))), 128)),
939
- A.value > 0 ? (I(), $("div", {
954
+ H.value > 0 ? (I(), $("div", {
940
955
  key: 1,
941
956
  class: "vue-short-media-feed__spacer",
942
- style: N({ height: `${A.value}px` }),
957
+ style: N({ height: `${H.value}px` }),
943
958
  "aria-hidden": "true"
944
959
  }, null, 4)) : ze("", !0)
945
- ], 64)) : (I(), $("div", vt, [
946
- ce(y.$slots, "empty")
960
+ ], 64)) : (I(), $("div", ft, [
961
+ ce(u.$slots, "empty")
947
962
  ]))
948
963
  ], 44, ct));
949
964
  }
950
- }), ht = ["aria-label"], mt = /* @__PURE__ */ Oe({
965
+ }), gt = ["aria-label"], pt = /* @__PURE__ */ Oe({
951
966
  __name: "SkeletonLoader",
952
967
  props: {
953
968
  width: { default: "100%" },
@@ -957,37 +972,37 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
957
972
  ariaLabel: { default: "Loading…" }
958
973
  },
959
974
  setup(l) {
960
- const C = l;
961
- function x(m) {
962
- return typeof m == "number" ? `${Math.max(0, m)}px` : m;
975
+ const P = l;
976
+ function x(p) {
977
+ return typeof p == "number" ? `${Math.max(0, p)}px` : p;
963
978
  }
964
979
  const e = n(() => ({
965
- width: x(C.width),
966
- height: x(C.height)
980
+ width: x(P.width),
981
+ height: x(P.height)
967
982
  }));
968
- return (m, c) => (I(), $("div", {
969
- class: We(["vue-skeleton-loader", [
983
+ return (p, f) => (I(), $("div", {
984
+ class: Ye(["vue-skeleton-loader", [
970
985
  `vue-skeleton-loader--${l.variant}`,
971
986
  { "vue-skeleton-loader--animated": l.animated }
972
987
  ]]),
973
988
  style: N(e.value),
974
989
  role: "status",
975
990
  "aria-label": l.ariaLabel
976
- }, null, 14, ht));
991
+ }, null, 14, gt));
977
992
  }
978
- }), gt = (l, C) => {
993
+ }), yt = (l, P) => {
979
994
  const x = l.__vccOpts || l;
980
- for (const [e, m] of C)
981
- x[e] = m;
995
+ for (const [e, p] of P)
996
+ x[e] = p;
982
997
  return x;
983
- }, pt = /* @__PURE__ */ gt(mt, [["__scopeId", "data-v-fc92f61f"]]), yt = ["aria-label"], Mt = {
998
+ }, Mt = /* @__PURE__ */ yt(pt, [["__scopeId", "data-v-fc92f61f"]]), xt = ["aria-label"], wt = {
984
999
  key: 0,
985
1000
  class: "vue-virtual-carousel__track",
986
1001
  role: "list"
987
- }, xt = ["aria-label", "aria-current"], wt = {
1002
+ }, Tt = ["aria-label", "aria-current"], bt = {
988
1003
  key: 1,
989
1004
  class: "vue-virtual-carousel__empty"
990
- }, Tt = /* @__PURE__ */ Oe({
1005
+ }, St = /* @__PURE__ */ Oe({
991
1006
  name: "VirtualCarousel",
992
1007
  __name: "VirtualCarousel",
993
1008
  props: {
@@ -1010,211 +1025,211 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1010
1025
  responsive: { default: void 0 }
1011
1026
  },
1012
1027
  emits: ["update:activeIndex", "change", "reachStart", "reachEnd", "loadMore"],
1013
- setup(l, { expose: C, emit: x }) {
1014
- const e = l, m = x, c = U(), r = U(0), o = U(0);
1015
- let f, O = -1, P, Q, X = !1;
1016
- const V = U(!1), { getItemKey: L } = De({
1028
+ setup(l, { expose: P, emit: x }) {
1029
+ const e = l, p = x, f = j(), r = j(0), o = j(0);
1030
+ let m, A = -1, O, U, q = !1;
1031
+ const V = j(!1), { getItemKey: D } = Pe({
1017
1032
  componentName: "VirtualCarousel",
1018
1033
  items: () => e.items,
1019
1034
  itemKey: () => e.itemKey
1020
- }), p = n(() => Math.max(0, r.value)), z = n(() => {
1035
+ }), w = n(() => Math.max(0, r.value)), k = n(() => {
1021
1036
  if (!e.responsive || e.responsive.length === 0)
1022
1037
  return {
1023
1038
  slidesPerView: e.slidesPerView,
1024
1039
  slidesToScroll: e.slidesToScroll,
1025
1040
  gap: e.gap
1026
1041
  };
1027
- const t = p.value, a = [...e.responsive].sort(
1028
- (h, b) => b.breakpoint - h.breakpoint
1042
+ const t = w.value, a = [...e.responsive].sort(
1043
+ (g, b) => b.breakpoint - g.breakpoint
1029
1044
  );
1030
- for (const h of a)
1031
- if (t >= h.breakpoint)
1045
+ for (const g of a)
1046
+ if (t >= g.breakpoint)
1032
1047
  return {
1033
- slidesPerView: h.slidesPerView ?? e.slidesPerView,
1034
- slidesToScroll: h.slidesToScroll ?? e.slidesToScroll,
1035
- gap: h.gap ?? e.gap
1048
+ slidesPerView: g.slidesPerView ?? e.slidesPerView,
1049
+ slidesToScroll: g.slidesToScroll ?? e.slidesToScroll,
1050
+ gap: g.gap ?? e.gap
1036
1051
  };
1037
1052
  return {
1038
1053
  slidesPerView: e.slidesPerView,
1039
1054
  slidesToScroll: e.slidesToScroll,
1040
1055
  gap: e.gap
1041
1056
  };
1042
- }), Y = n(
1057
+ }), E = n(
1043
1058
  () => Math.max(
1044
1059
  1,
1045
1060
  Math.floor(
1046
- Number.isFinite(z.value.slidesPerView) ? z.value.slidesPerView : 1
1061
+ Number.isFinite(k.value.slidesPerView) ? k.value.slidesPerView : 1
1047
1062
  )
1048
1063
  )
1049
- ), j = n(
1064
+ ), F = n(
1050
1065
  () => Math.max(
1051
1066
  1,
1052
1067
  Math.floor(
1053
- Number.isFinite(z.value.slidesToScroll) ? z.value.slidesToScroll : 1
1068
+ Number.isFinite(k.value.slidesToScroll) ? k.value.slidesToScroll : 1
1054
1069
  )
1055
1070
  )
1056
- ), A = n(
1057
- () => Math.max(0, Number.isFinite(z.value.gap) ? z.value.gap : 0)
1071
+ ), W = n(
1072
+ () => Math.max(0, Number.isFinite(k.value.gap) ? k.value.gap : 0)
1058
1073
  ), ne = n(
1059
1074
  () => Math.max(
1060
1075
  0,
1061
1076
  Math.floor(Number.isFinite(e.buffer) ? e.buffer : 0)
1062
1077
  )
1063
- ), W = n(
1078
+ ), Z = n(
1064
1079
  () => Math.max(
1065
1080
  0,
1066
1081
  Math.floor(
1067
1082
  Number.isFinite(e.loadMoreThreshold) ? e.loadMoreThreshold : 0
1068
1083
  )
1069
1084
  )
1070
- ), k = n(() => Number.isFinite(e.autoplayDelay) ? Math.max(1, e.autoplayDelay) : 3e3), te = n(() => {
1071
- if (p.value <= 0) return 0;
1072
- const t = (Y.value - 1) * A.value;
1085
+ ), H = n(() => Number.isFinite(e.autoplayDelay) ? Math.max(1, e.autoplayDelay) : 3e3), ae = n(() => {
1086
+ if (w.value <= 0) return 0;
1087
+ const t = (E.value - 1) * W.value;
1073
1088
  return Math.max(
1074
1089
  1,
1075
- (p.value - t) / Y.value
1090
+ (w.value - t) / E.value
1076
1091
  );
1077
- }), R = n(() => te.value + A.value), ae = n(
1092
+ }), R = n(() => ae.value + W.value), J = n(
1078
1093
  () => Math.max(
1079
1094
  0,
1080
- e.items.length - Y.value
1095
+ e.items.length - E.value
1081
1096
  )
1082
- ), G = n(
1097
+ ), Y = n(
1083
1098
  () => Math.max(0, o.value - ne.value)
1084
- ), se = n(
1099
+ ), le = n(
1085
1100
  () => Math.min(
1086
1101
  e.items.length,
1087
- o.value + Y.value + ne.value
1102
+ o.value + E.value + ne.value
1088
1103
  )
1089
- ), ue = n(
1090
- () => e.items.slice(G.value, se.value).map((t, a) => ({
1104
+ ), se = n(
1105
+ () => e.items.slice(Y.value, le.value).map((t, a) => ({
1091
1106
  item: t,
1092
- index: G.value + a
1107
+ index: Y.value + a
1093
1108
  }))
1094
- ), y = n(() => e.items.length === 0 ? 0 : e.items.length * te.value + (e.items.length - 1) * A.value), w = n(
1095
- () => G.value * R.value
1096
- ), q = n(
1109
+ ), me = n(() => e.items.length === 0 ? 0 : e.items.length * ae.value + (e.items.length - 1) * W.value), de = n(
1110
+ () => Y.value * R.value
1111
+ ), ue = n(
1097
1112
  () => Math.max(
1098
1113
  0,
1099
- y.value - se.value * R.value
1114
+ me.value - le.value * R.value
1100
1115
  )
1101
- ), he = n(() => ({
1102
- height: Ye(e.height)
1116
+ ), we = n(() => ({
1117
+ height: Fe(e.height)
1103
1118
  }));
1104
- function ee(t) {
1119
+ function G(t) {
1105
1120
  return Math.min(
1106
- ae.value,
1121
+ J.value,
1107
1122
  Math.max(0, Math.floor(Number.isFinite(t) ? t : 0))
1108
1123
  );
1109
1124
  }
1110
- o.value = ee(e.activeIndex);
1111
- function de(t) {
1125
+ o.value = G(e.activeIndex);
1126
+ function u(t) {
1112
1127
  return t >= o.value && t < Math.min(
1113
1128
  e.items.length,
1114
- o.value + Y.value
1129
+ o.value + E.value
1115
1130
  );
1116
1131
  }
1117
- function D() {
1118
- if (!e.hasMore || e.loading || O === e.items.length)
1132
+ function d() {
1133
+ if (!e.hasMore || e.loading || A === e.items.length)
1119
1134
  return;
1120
1135
  const t = e.items.length === 0 ? -1 : Math.min(
1121
1136
  e.items.length - 1,
1122
- o.value + Y.value - 1
1137
+ o.value + E.value - 1
1123
1138
  );
1124
- e.items.length - 1 - t <= W.value && (O = e.items.length, m("loadMore"));
1139
+ e.items.length - 1 - t <= Z.value && (A = e.items.length, p("loadMore"));
1125
1140
  }
1126
- function F(t) {
1127
- const a = ee(t);
1128
- a === o.value || e.items.length === 0 || (o.value = a, m("update:activeIndex", a), m("change", {
1141
+ function z(t) {
1142
+ const a = G(t);
1143
+ a === o.value || e.items.length === 0 || (o.value = a, p("update:activeIndex", a), p("change", {
1129
1144
  index: a,
1130
1145
  item: e.items[a]
1131
- }), a === 0 && m("reachStart"), a === ae.value && m("reachEnd"), D(), e.autoplay && !V.value && B());
1146
+ }), a === 0 && p("reachStart"), a === J.value && p("reachEnd"), d(), e.autoplay && !V.value && B());
1132
1147
  }
1133
- function ve(t, a = {}) {
1134
- const h = c.value;
1135
- h && (typeof h.scrollTo == "function" ? h.scrollTo({ ...a, left: t }) : h.scrollLeft = t);
1148
+ function Q(t, a = {}) {
1149
+ const g = f.value;
1150
+ g && (typeof g.scrollTo == "function" ? g.scrollTo({ ...a, left: t }) : g.scrollLeft = t);
1136
1151
  }
1137
- function ge(t, a = {}) {
1152
+ function he(t, a = {}) {
1138
1153
  if (e.items.length === 0 || R.value <= 0) return;
1139
- const h = ee(t);
1140
- Q = a.behavior === "smooth" ? h : void 0, F(h), ve(h * R.value, {
1154
+ const g = G(t);
1155
+ U = a.behavior === "smooth" ? g : void 0, z(g), Q(g * R.value, {
1141
1156
  ...a,
1142
1157
  behavior: a.behavior
1143
1158
  });
1144
1159
  }
1145
- function g(t = "smooth") {
1146
- ge(
1147
- o.value + j.value,
1160
+ function y(t = "smooth") {
1161
+ he(
1162
+ o.value + F.value,
1148
1163
  { behavior: t }
1149
1164
  );
1150
1165
  }
1151
- function E(t = "smooth") {
1152
- ge(
1153
- o.value - j.value,
1166
+ function L(t = "smooth") {
1167
+ he(
1168
+ o.value - F.value,
1154
1169
  { behavior: t }
1155
1170
  );
1156
1171
  }
1157
1172
  function B() {
1158
- le(), !(!e.autoplay || e.items.length === 0) && (P = setTimeout(() => {
1159
- o.value >= ae.value ? e.autoplayLoop ? ge(0, { behavior: "smooth" }) : le() : g("smooth");
1160
- }, k.value));
1173
+ te(), !(!e.autoplay || e.items.length === 0) && (O = setTimeout(() => {
1174
+ o.value >= J.value ? e.autoplayLoop ? he(0, { behavior: "smooth" }) : te() : y("smooth");
1175
+ }, H.value));
1161
1176
  }
1162
- function le() {
1163
- P !== void 0 && (clearTimeout(P), P = void 0);
1177
+ function te() {
1178
+ O !== void 0 && (clearTimeout(O), O = void 0);
1164
1179
  }
1165
1180
  function oe() {
1166
- V.value = !0, e.pauseOnHover && le();
1181
+ V.value = !0, e.pauseOnHover && te();
1167
1182
  }
1168
1183
  function re() {
1169
1184
  V.value = !1, e.autoplay && B();
1170
1185
  }
1171
- function Me() {
1172
- Q = void 0;
1186
+ function ye() {
1187
+ U = void 0;
1173
1188
  }
1174
1189
  function _(t) {
1175
- if (R.value <= 0 || X) return;
1190
+ if (R.value <= 0 || q) return;
1176
1191
  const a = t.currentTarget.scrollLeft;
1177
- if (Q !== void 0) {
1178
- const h = Q * R.value;
1179
- if (Math.abs(a - h) > 1) return;
1180
- Q = void 0;
1192
+ if (U !== void 0) {
1193
+ const g = U * R.value;
1194
+ if (Math.abs(a - g) > 1) return;
1195
+ U = void 0;
1181
1196
  }
1182
- F(Math.round(a / R.value));
1197
+ z(Math.round(a / R.value));
1183
1198
  }
1184
- function J(t) {
1185
- t.key === "ArrowRight" || t.key === "PageDown" ? (t.preventDefault(), g()) : t.key === "ArrowLeft" || t.key === "PageUp" ? (t.preventDefault(), E()) : t.key === "Home" ? (t.preventDefault(), ge(0, { behavior: "smooth" })) : t.key === "End" && (t.preventDefault(), ge(ae.value, { behavior: "auto" }));
1199
+ function ee(t) {
1200
+ t.key === "ArrowRight" || t.key === "PageDown" ? (t.preventDefault(), y()) : t.key === "ArrowLeft" || t.key === "PageUp" ? (t.preventDefault(), L()) : t.key === "Home" ? (t.preventDefault(), he(0, { behavior: "smooth" })) : t.key === "End" && (t.preventDefault(), he(J.value, { behavior: "auto" }));
1186
1201
  }
1187
1202
  function s() {
1188
1203
  var a;
1189
- const t = ((a = c.value) == null ? void 0 : a.clientWidth) ?? 0;
1190
- t <= 0 || t === r.value || (X = !0, r.value = t, K(() => {
1191
- const h = ee(o.value);
1192
- ve(h * R.value), X = !1;
1204
+ const t = ((a = f.value) == null ? void 0 : a.clientWidth) ?? 0;
1205
+ t <= 0 || t === r.value || (q = !0, r.value = t, C(() => {
1206
+ const g = G(o.value);
1207
+ Q(g * R.value), q = !1;
1193
1208
  }));
1194
1209
  }
1195
1210
  return ie(
1196
1211
  () => e.activeIndex,
1197
1212
  async (t) => {
1198
- const a = ee(t);
1199
- a !== o.value && (Me(), o.value = a, await K(), ve(a * R.value), D());
1213
+ const a = G(t);
1214
+ a !== o.value && (ye(), o.value = a, await C(), Q(a * R.value), d());
1200
1215
  }
1201
1216
  ), ie(
1202
1217
  () => [
1203
1218
  e.items.length,
1204
- z.value.slidesPerView,
1205
- z.value.gap,
1206
- z.value.slidesToScroll
1219
+ k.value.slidesPerView,
1220
+ k.value.gap,
1221
+ k.value.slidesToScroll
1207
1222
  ],
1208
1223
  async () => {
1209
- const t = ee(o.value);
1210
- e.items.length === 0 ? o.value !== 0 && (o.value = 0, m("update:activeIndex", 0)) : F(t), await K(), ve(t * R.value), D(), e.autoplay && e.items.length > 0 && !V.value && B();
1224
+ const t = G(o.value);
1225
+ e.items.length === 0 ? o.value !== 0 && (o.value = 0, p("update:activeIndex", 0)) : z(t), await C(), Q(t * R.value), d(), e.autoplay && e.items.length > 0 && !V.value && B();
1211
1226
  }
1212
1227
  ), ie(
1213
1228
  () => e.responsive,
1214
1229
  () => {
1215
- K(() => {
1216
- const t = ee(o.value);
1217
- ve(t * R.value);
1230
+ C(() => {
1231
+ const t = G(o.value);
1232
+ Q(t * R.value);
1218
1233
  });
1219
1234
  },
1220
1235
  { deep: !0 }
@@ -1225,12 +1240,12 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1225
1240
  e.loadMoreThreshold
1226
1241
  ],
1227
1242
  async ([t]) => {
1228
- t || (O = -1), await K(), D();
1243
+ t || (A = -1), await C(), d();
1229
1244
  }
1230
1245
  ), ie(
1231
1246
  () => e.autoplay,
1232
1247
  (t) => {
1233
- t && !V.value ? B() : le();
1248
+ t && !V.value ? B() : te();
1234
1249
  }
1235
1250
  ), ie(
1236
1251
  () => e.autoplayDelay,
@@ -1240,52 +1255,52 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1240
1255
  ), ie(
1241
1256
  () => e.autoplayLoop,
1242
1257
  (t) => {
1243
- !e.autoplay || V.value || (!t && o.value >= ae.value ? le() : B());
1258
+ !e.autoplay || V.value || (!t && o.value >= J.value ? te() : B());
1244
1259
  }
1245
1260
  ), ie(
1246
1261
  () => e.pauseOnHover,
1247
1262
  (t) => {
1248
- t && V.value ? le() : !t && e.autoplay && B();
1263
+ t && V.value ? te() : !t && e.autoplay && B();
1249
1264
  }
1250
- ), Ce(async () => {
1251
- s(), typeof ResizeObserver < "u" && c.value && (f = new ResizeObserver(s), f.observe(c.value)), await K(), ve(o.value * R.value), D(), e.autoplay && B();
1252
- }), Pe(() => {
1253
- f && (f.disconnect(), f = void 0), le();
1254
- }), C({
1255
- next: g,
1256
- previous: E,
1257
- scrollToIndex: ge,
1265
+ ), Ae(async () => {
1266
+ s(), typeof ResizeObserver < "u" && f.value && (m = new ResizeObserver(s), m.observe(f.value)), await C(), Q(o.value * R.value), d(), e.autoplay && B();
1267
+ }), Ce(() => {
1268
+ m && (m.disconnect(), m = void 0), te();
1269
+ }), P({
1270
+ next: y,
1271
+ previous: L,
1272
+ scrollToIndex: he,
1258
1273
  startAutoplay: B,
1259
- stopAutoplay: le
1274
+ stopAutoplay: te
1260
1275
  }), (t, a) => (I(), $("div", {
1261
1276
  ref_key: "viewport",
1262
- ref: c,
1277
+ ref: f,
1263
1278
  class: "vue-virtual-carousel",
1264
- style: N(he.value),
1279
+ style: N(we.value),
1265
1280
  role: "region",
1266
1281
  "aria-roledescription": "carousel",
1267
1282
  "aria-label": l.ariaLabel,
1268
1283
  tabindex: "0",
1269
1284
  onScrollPassive: _,
1270
- onPointerdown: Me,
1271
- onWheelPassive: Me,
1272
- onKeydown: J,
1285
+ onPointerdown: ye,
1286
+ onWheelPassive: ye,
1287
+ onKeydown: ee,
1273
1288
  onMouseenter: oe,
1274
1289
  onMouseleave: re
1275
1290
  }, [
1276
- l.items.length ? (I(), $("div", Mt, [
1277
- w.value > 0 ? (I(), $("div", {
1291
+ l.items.length ? (I(), $("div", wt, [
1292
+ de.value > 0 ? (I(), $("div", {
1278
1293
  key: 0,
1279
1294
  class: "vue-virtual-carousel__spacer",
1280
- style: N({ flexBasis: `${w.value}px` }),
1295
+ style: N({ flexBasis: `${de.value}px` }),
1281
1296
  "aria-hidden": "true"
1282
1297
  }, null, 4)) : ze("", !0),
1283
- (I(!0), $(He, null, Ae(ue.value, ({ item: h, index: b }) => (I(), $("div", {
1284
- key: u(L)(h, b),
1298
+ (I(!0), $(Re, null, De(se.value, ({ item: g, index: b }) => (I(), $("div", {
1299
+ key: c(D)(g, b),
1285
1300
  class: "vue-virtual-carousel__item",
1286
1301
  style: N({
1287
- flexBasis: `${te.value}px`,
1288
- marginRight: b < l.items.length - 1 ? `${A.value}px` : "0px"
1302
+ flexBasis: `${ae.value}px`,
1303
+ marginRight: b < l.items.length - 1 ? `${W.value}px` : "0px"
1289
1304
  }),
1290
1305
  role: "listitem",
1291
1306
  "aria-roledescription": "slide",
@@ -1293,24 +1308,24 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1293
1308
  "aria-current": b === o.value ? "true" : void 0
1294
1309
  }, [
1295
1310
  ce(t.$slots, "default", {
1296
- item: h,
1311
+ item: g,
1297
1312
  index: b,
1298
1313
  active: b === o.value,
1299
- visible: de(b)
1314
+ visible: u(b)
1300
1315
  })
1301
- ], 12, xt))), 128)),
1302
- q.value > 0 ? (I(), $("div", {
1316
+ ], 12, Tt))), 128)),
1317
+ ue.value > 0 ? (I(), $("div", {
1303
1318
  key: 1,
1304
1319
  class: "vue-virtual-carousel__spacer",
1305
- style: N({ flexBasis: `${q.value}px` }),
1320
+ style: N({ flexBasis: `${ue.value}px` }),
1306
1321
  "aria-hidden": "true"
1307
1322
  }, null, 4)) : ze("", !0)
1308
- ])) : (I(), $("div", wt, [
1323
+ ])) : (I(), $("div", bt, [
1309
1324
  ce(t.$slots, "empty")
1310
1325
  ]))
1311
- ], 44, yt));
1326
+ ], 44, xt));
1312
1327
  }
1313
- }), bt = ["aria-label"], St = ["aria-posinset", "aria-setsize"], zt = /* @__PURE__ */ Oe({
1328
+ }), zt = ["aria-label"], It = ["aria-posinset", "aria-setsize"], $t = /* @__PURE__ */ Oe({
1314
1329
  name: "VirtualScroll",
1315
1330
  __name: "VirtualScroll",
1316
1331
  props: {
@@ -1329,210 +1344,210 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1329
1344
  pullRefreshThreshold: { default: 64 }
1330
1345
  },
1331
1346
  emits: ["scroll", "loadMore", "refresh"],
1332
- setup(l, { expose: C, emit: x }) {
1333
- const e = l, m = x, {
1334
- pulling: c,
1347
+ setup(l, { expose: P, emit: x }) {
1348
+ const e = l, p = x, {
1349
+ pulling: f,
1335
1350
  pullDistance: r,
1336
1351
  pullOffset: o,
1337
- pullProgress: f,
1338
- refreshMessage: O,
1339
- refreshThreshold: P,
1340
- handleTouchStart: Q,
1341
- handleTouchMove: X,
1352
+ pullProgress: m,
1353
+ refreshMessage: A,
1354
+ refreshThreshold: O,
1355
+ handleTouchStart: U,
1356
+ handleTouchMove: q,
1342
1357
  handleTouchEnd: V,
1343
- handleTouchCancel: L
1358
+ handleTouchCancel: D
1344
1359
  } = qe({
1345
1360
  enabled: () => e.pullToRefresh,
1346
1361
  refreshing: () => e.refreshing,
1347
1362
  threshold: () => e.pullRefreshThreshold,
1348
- onRefresh: () => m("refresh")
1349
- }), p = U(), z = U(0), Y = U(0);
1350
- let j, A = -1;
1351
- const ne = Ue(), { getItemKey: W } = De({
1363
+ onRefresh: () => p("refresh")
1364
+ }), w = j(), k = j(0), E = j(0);
1365
+ let F, W = -1;
1366
+ const ne = Ue(), { getItemKey: Z } = Pe({
1352
1367
  componentName: "VirtualScroll",
1353
1368
  items: () => e.items,
1354
1369
  itemKey: () => e.itemKey
1355
- }), k = n(() => Math.max(1, e.itemSize)), te = n(() => Math.max(0, Math.floor(e.overscan))), R = n(
1356
- () => e.items.length * k.value
1357
- ), ae = n(
1358
- () => Math.max(1, e.loadingItemSize ?? k.value)
1359
- ), G = n(
1360
- () => R.value + (e.loading ? ae.value : 0)
1361
- ), se = n(() => Y.value > 0 ? Y.value : typeof e.height == "number" ? e.height : 0), ue = n(
1370
+ }), H = n(() => Math.max(1, e.itemSize)), ae = n(() => Math.max(0, Math.floor(e.overscan))), R = n(
1371
+ () => e.items.length * H.value
1372
+ ), J = n(
1373
+ () => Math.max(1, e.loadingItemSize ?? H.value)
1374
+ ), Y = n(
1375
+ () => R.value + (e.loading ? J.value : 0)
1376
+ ), le = n(() => E.value > 0 ? E.value : typeof e.height == "number" ? e.height : 0), se = n(
1362
1377
  () => Math.max(
1363
1378
  0,
1364
- Math.floor(z.value / k.value) - te.value
1379
+ Math.floor(k.value / H.value) - ae.value
1365
1380
  )
1366
- ), y = n(() => {
1367
- const g = Math.ceil(
1368
- (z.value + se.value) / k.value
1381
+ ), me = n(() => {
1382
+ const y = Math.ceil(
1383
+ (k.value + le.value) / H.value
1369
1384
  );
1370
1385
  return Math.min(
1371
1386
  e.items.length,
1372
- g + te.value
1387
+ y + ae.value
1373
1388
  );
1374
- }), w = n(
1375
- () => e.items.slice(ue.value, y.value).map((g, E) => ({
1376
- item: g,
1377
- index: ue.value + E
1389
+ }), de = n(
1390
+ () => e.items.slice(se.value, me.value).map((y, L) => ({
1391
+ item: y,
1392
+ index: se.value + L
1378
1393
  }))
1379
- ), q = n(() => ({
1380
- height: Ye(e.height)
1381
- })), he = n(() => ({
1382
- transform: `translateY(${ue.value * k.value}px)`
1394
+ ), ue = n(() => ({
1395
+ height: Fe(e.height)
1396
+ })), we = n(() => ({
1397
+ transform: `translateY(${se.value * H.value}px)`
1383
1398
  }));
1384
- function ee() {
1385
- var g;
1386
- Y.value = ((g = p.value) == null ? void 0 : g.clientHeight) ?? 0, ne(p.value, e.height), K(D);
1387
- }
1388
- function de(g) {
1389
- z.value = g.currentTarget.scrollTop, m("scroll", {
1390
- scrollTop: z.value,
1391
- startIndex: ue.value,
1392
- endIndex: y.value
1393
- }), D();
1394
- }
1395
- function D() {
1396
- const g = p.value;
1397
- if (!g || !e.hasMore || e.loading || A === e.items.length)
1399
+ function G() {
1400
+ var y;
1401
+ E.value = ((y = w.value) == null ? void 0 : y.clientHeight) ?? 0, ne(w.value, e.height), C(d);
1402
+ }
1403
+ function u(y) {
1404
+ k.value = y.currentTarget.scrollTop, p("scroll", {
1405
+ scrollTop: k.value,
1406
+ startIndex: se.value,
1407
+ endIndex: me.value
1408
+ }), d();
1409
+ }
1410
+ function d() {
1411
+ const y = w.value;
1412
+ if (!y || !e.hasMore || e.loading || W === e.items.length)
1398
1413
  return;
1399
- const E = Math.max(0, e.loadMoreThreshold);
1400
- G.value - g.scrollTop - g.clientHeight <= E && (A = e.items.length, m("loadMore"));
1414
+ const L = Math.max(0, e.loadMoreThreshold);
1415
+ Y.value - y.scrollTop - y.clientHeight <= L && (W = e.items.length, p("loadMore"));
1401
1416
  }
1402
- function F(g, E = {}) {
1403
- const B = p.value;
1417
+ function z(y, L = {}) {
1418
+ const B = w.value;
1404
1419
  if (!B) return;
1405
- const le = Math.max(0, G.value - B.clientHeight), oe = Math.min(
1406
- Math.max(0, Number.isFinite(g) ? g : 0),
1407
- le
1408
- ), re = E.behavior ?? "auto";
1409
- re === "auto" && (z.value = oe), B.scrollTo({ ...E, top: oe, behavior: re });
1410
- }
1411
- function ve(g, E = {}) {
1412
- const B = p.value;
1420
+ const te = Math.max(0, Y.value - B.clientHeight), oe = Math.min(
1421
+ Math.max(0, Number.isFinite(y) ? y : 0),
1422
+ te
1423
+ ), re = L.behavior ?? "auto";
1424
+ re === "auto" && (k.value = oe), B.scrollTo({ ...L, top: oe, behavior: re });
1425
+ }
1426
+ function Q(y, L = {}) {
1427
+ const B = w.value;
1413
1428
  if (!B || e.items.length === 0) return;
1414
- const le = Math.min(
1429
+ const te = Math.min(
1415
1430
  e.items.length - 1,
1416
- Math.max(0, Math.floor(g))
1417
- ), { align: oe = "start", ...re } = E;
1418
- let Me = le * k.value;
1419
- oe === "center" ? Me -= (B.clientHeight - k.value) / 2 : oe === "end" && (Me -= B.clientHeight - k.value), B.scrollTo({
1431
+ Math.max(0, Math.floor(y))
1432
+ ), { align: oe = "start", ...re } = L;
1433
+ let ye = te * H.value;
1434
+ oe === "center" ? ye -= (B.clientHeight - H.value) / 2 : oe === "end" && (ye -= B.clientHeight - H.value), B.scrollTo({
1420
1435
  ...re,
1421
- top: Math.max(0, Math.min(Me, G.value - B.clientHeight))
1436
+ top: Math.max(0, Math.min(ye, Y.value - B.clientHeight))
1422
1437
  });
1423
1438
  }
1424
- function ge(g = "auto") {
1425
- var E;
1426
- (E = p.value) == null || E.scrollTo({ top: 0, behavior: g });
1439
+ function he(y = "auto") {
1440
+ var L;
1441
+ (L = w.value) == null || L.scrollTo({ top: 0, behavior: y });
1427
1442
  }
1428
1443
  return ie(
1429
1444
  () => [e.items.length, e.itemSize],
1430
1445
  async () => {
1431
- await K();
1432
- const g = p.value;
1433
- if (!g) return;
1434
- const E = Math.max(0, G.value - g.clientHeight);
1435
- g.scrollTop > E && (g.scrollTop = E, z.value = E), D();
1446
+ await C();
1447
+ const y = w.value;
1448
+ if (!y) return;
1449
+ const L = Math.max(0, Y.value - y.clientHeight);
1450
+ y.scrollTop > L && (y.scrollTop = L, k.value = L), d();
1436
1451
  }
1437
1452
  ), ie(
1438
1453
  () => [e.hasMore, e.loading],
1439
- async ([g]) => {
1440
- g || (A = -1), await K(), D();
1454
+ async ([y]) => {
1455
+ y || (W = -1), await C(), d();
1441
1456
  }
1442
- ), Ce(() => {
1443
- ee(), typeof ResizeObserver < "u" && p.value && (j = new ResizeObserver(ee), j.observe(p.value)), K(D);
1444
- }), Pe(() => {
1445
- j && (j.disconnect(), j = void 0);
1446
- }), C({
1447
- scrollTo: F,
1448
- scrollToIndex: ve,
1449
- scrollToTop: ge
1450
- }), (g, E) => (I(), $("div", {
1457
+ ), Ae(() => {
1458
+ G(), typeof ResizeObserver < "u" && w.value && (F = new ResizeObserver(G), F.observe(w.value)), C(d);
1459
+ }), Ce(() => {
1460
+ F && (F.disconnect(), F = void 0);
1461
+ }), P({
1462
+ scrollTo: z,
1463
+ scrollToIndex: Q,
1464
+ scrollToTop: he
1465
+ }), (y, L) => (I(), $("div", {
1451
1466
  ref_key: "viewport",
1452
- ref: p,
1453
- class: We(["vue-virtual-scroll", { "vue-virtual-scroll--pulling": u(c) }]),
1454
- style: N(q.value),
1467
+ ref: w,
1468
+ class: Ye(["vue-virtual-scroll", { "vue-virtual-scroll--pulling": c(f) }]),
1469
+ style: N(ue.value),
1455
1470
  role: "list",
1456
1471
  "aria-label": l.ariaLabel,
1457
1472
  tabindex: "0",
1458
- onScrollPassive: de,
1459
- onTouchstartPassive: E[0] || (E[0] = //@ts-ignore
1460
- (...B) => u(Q) && u(Q)(...B)),
1461
- onTouchmove: E[1] || (E[1] = //@ts-ignore
1462
- (...B) => u(X) && u(X)(...B)),
1463
- onTouchend: E[2] || (E[2] = //@ts-ignore
1464
- (...B) => u(V) && u(V)(...B)),
1465
- onTouchcancel: E[3] || (E[3] = //@ts-ignore
1466
- (...B) => u(L) && u(L)(...B))
1473
+ onScrollPassive: u,
1474
+ onTouchstartPassive: L[0] || (L[0] = //@ts-ignore
1475
+ (...B) => c(U) && c(U)(...B)),
1476
+ onTouchmove: L[1] || (L[1] = //@ts-ignore
1477
+ (...B) => c(q) && c(q)(...B)),
1478
+ onTouchend: L[2] || (L[2] = //@ts-ignore
1479
+ (...B) => c(V) && c(V)(...B)),
1480
+ onTouchcancel: L[3] || (L[3] = //@ts-ignore
1481
+ (...B) => c(D) && c(D)(...B))
1467
1482
  }, [
1468
1483
  l.pullToRefresh || l.refreshing ? (I(), $("div", {
1469
1484
  key: 0,
1470
1485
  class: "vue-virtual-scroll__refresh",
1471
1486
  style: N({
1472
- height: `${u(P)}px`,
1473
- transform: `translateY(${u(o) - u(P)}px)`
1487
+ height: `${c(O)}px`,
1488
+ transform: `translateY(${c(o) - c(O)}px)`
1474
1489
  }),
1475
1490
  role: "status",
1476
1491
  "aria-live": "polite"
1477
1492
  }, [
1478
- ce(g.$slots, "refresh", {
1479
- pullDistance: u(r),
1480
- progress: u(f),
1493
+ ce(y.$slots, "refresh", {
1494
+ pullDistance: c(r),
1495
+ progress: c(m),
1481
1496
  refreshing: l.refreshing
1482
1497
  }, () => [
1483
- Ve(Ge(u(O)), 1)
1498
+ Ve(je(c(A)), 1)
1484
1499
  ])
1485
1500
  ], 4)) : ze("", !0),
1486
1501
  l.items.length || l.loading ? (I(), $("div", {
1487
1502
  key: 1,
1488
1503
  class: "vue-virtual-scroll__spacer",
1489
1504
  style: N({
1490
- height: `${G.value}px`,
1491
- transform: `translateY(${u(o)}px)`
1505
+ height: `${Y.value}px`,
1506
+ transform: `translateY(${c(o)}px)`
1492
1507
  })
1493
1508
  }, [
1494
- je("div", {
1509
+ Ge("div", {
1495
1510
  class: "vue-virtual-scroll__content",
1496
- style: N(he.value)
1511
+ style: N(we.value)
1497
1512
  }, [
1498
- (I(!0), $(He, null, Ae(w.value, ({ item: B, index: le }) => (I(), $("div", {
1499
- key: u(W)(B, le),
1513
+ (I(!0), $(Re, null, De(de.value, ({ item: B, index: te }) => (I(), $("div", {
1514
+ key: c(Z)(B, te),
1500
1515
  class: "vue-virtual-scroll__item",
1501
- style: N({ height: `${k.value}px` }),
1516
+ style: N({ height: `${H.value}px` }),
1502
1517
  role: "listitem",
1503
- "aria-posinset": le + 1,
1518
+ "aria-posinset": te + 1,
1504
1519
  "aria-setsize": l.items.length
1505
1520
  }, [
1506
- ce(g.$slots, "default", {
1521
+ ce(y.$slots, "default", {
1507
1522
  item: B,
1508
- index: le
1523
+ index: te
1509
1524
  })
1510
- ], 12, St))), 128))
1525
+ ], 12, It))), 128))
1511
1526
  ], 4),
1512
1527
  l.loading ? (I(), $("div", {
1513
1528
  key: 0,
1514
1529
  class: "vue-virtual-scroll__loading",
1515
1530
  style: N({
1516
- height: `${ae.value}px`,
1531
+ height: `${J.value}px`,
1517
1532
  transform: `translateY(${R.value}px)`
1518
1533
  }),
1519
1534
  role: "status",
1520
1535
  "aria-live": "polite"
1521
1536
  }, [
1522
- ce(g.$slots, "loading", {}, () => [
1523
- E[4] || (E[4] = Ve("Loading more…", -1))
1537
+ ce(y.$slots, "loading", {}, () => [
1538
+ L[4] || (L[4] = Ve("Loading more…", -1))
1524
1539
  ])
1525
1540
  ], 4)) : ze("", !0)
1526
1541
  ], 4)) : (I(), $("div", {
1527
1542
  key: 2,
1528
1543
  class: "vue-virtual-scroll__empty",
1529
- style: N({ transform: `translateY(${u(o)}px)` })
1544
+ style: N({ transform: `translateY(${c(o)}px)` })
1530
1545
  }, [
1531
- ce(g.$slots, "empty")
1546
+ ce(y.$slots, "empty")
1532
1547
  ], 4))
1533
- ], 46, bt));
1548
+ ], 46, zt));
1534
1549
  }
1535
- }), It = ["aria-label"], $t = ["aria-posinset", "aria-setsize"], kt = /* @__PURE__ */ Oe({
1550
+ }), kt = ["aria-label"], Et = ["aria-posinset", "aria-setsize"], Lt = /* @__PURE__ */ Oe({
1536
1551
  name: "WindowDynamicVirtualScroll",
1537
1552
  __name: "WindowDynamicVirtualScroll",
1538
1553
  props: {
@@ -1550,329 +1565,329 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1550
1565
  pullRefreshThreshold: { default: 64 }
1551
1566
  },
1552
1567
  emits: ["scroll", "loadMore", "refresh"],
1553
- setup(l, { expose: C, emit: x }) {
1554
- const e = l, m = x, c = U(), r = U(0), o = U(0), f = U(0), O = U(0), P = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map();
1555
- let V, L, p, z, Y = !1, j = !1, A = -1;
1556
- const { getItemKey: ne } = De({
1568
+ setup(l, { expose: P, emit: x }) {
1569
+ const e = l, p = x, f = j(), r = j(0), o = j(0), m = j(0), A = j(0), O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map();
1570
+ let V, D, w, k, E = !1, F = !1, W = -1;
1571
+ const { getItemKey: ne } = Pe({
1557
1572
  componentName: "WindowDynamicVirtualScroll",
1558
1573
  items: () => e.items,
1559
1574
  itemKey: () => e.itemKey
1560
1575
  });
1561
- function W(d) {
1576
+ function Z(v) {
1562
1577
  return typeof window.requestAnimationFrame == "function" ? {
1563
- id: window.requestAnimationFrame(d),
1578
+ id: window.requestAnimationFrame(v),
1564
1579
  type: "animation"
1565
1580
  } : {
1566
- id: window.setTimeout(d, 0),
1581
+ id: window.setTimeout(v, 0),
1567
1582
  type: "timeout"
1568
1583
  };
1569
1584
  }
1570
- function k(d) {
1571
- d && (d.type === "animation" ? window.cancelAnimationFrame(d.id) : window.clearTimeout(d.id));
1585
+ function H(v) {
1586
+ v && (v.type === "animation" ? window.cancelAnimationFrame(v.id) : window.clearTimeout(v.id));
1572
1587
  }
1573
1588
  const {
1574
- pulling: te,
1589
+ pulling: ae,
1575
1590
  pullDistance: R,
1576
- pullOffset: ae,
1577
- pullProgress: G,
1578
- refreshMessage: se,
1579
- refreshThreshold: ue,
1580
- handleTouchStart: y,
1581
- handleTouchMove: w,
1582
- handleTouchEnd: q,
1583
- handleTouchCancel: he
1591
+ pullOffset: J,
1592
+ pullProgress: Y,
1593
+ refreshMessage: le,
1594
+ refreshThreshold: se,
1595
+ handleTouchStart: me,
1596
+ handleTouchMove: de,
1597
+ handleTouchEnd: ue,
1598
+ handleTouchCancel: we
1584
1599
  } = qe({
1585
1600
  enabled: () => e.pullToRefresh,
1586
1601
  refreshing: () => e.refreshing,
1587
1602
  threshold: () => e.pullRefreshThreshold,
1588
- onRefresh: () => m("refresh"),
1603
+ onRefresh: () => p("refresh"),
1589
1604
  scrollTop: () => typeof window > "u" ? 0 : Math.max(0, window.scrollY)
1590
- }), ee = n(
1605
+ }), G = n(
1591
1606
  () => Math.max(1, e.estimatedItemSize)
1592
- ), de = n(
1593
- () => Math.max(1, e.loadingItemSize ?? ee.value)
1594
- ), D = n(() => Math.max(0, Math.floor(e.overscan))), F = n(() => {
1595
- O.value;
1596
- const d = new Array(e.items.length + 1), S = new Array(e.items.length);
1597
- d[0] = 0;
1607
+ ), u = n(
1608
+ () => Math.max(1, e.loadingItemSize ?? G.value)
1609
+ ), d = n(() => Math.max(0, Math.floor(e.overscan))), z = n(() => {
1610
+ A.value;
1611
+ const v = new Array(e.items.length + 1), S = new Array(e.items.length);
1612
+ v[0] = 0;
1598
1613
  for (let T = 0; T < e.items.length; T += 1) {
1599
- const fe = ne(e.items[T], T), Z = P.get(fe) ?? ee.value;
1600
- S[T] = Z, d[T + 1] = d[T] + Z;
1614
+ const fe = ne(e.items[T], T), X = O.get(fe) ?? G.value;
1615
+ S[T] = X, v[T + 1] = v[T] + X;
1601
1616
  }
1602
1617
  return {
1603
- offsets: d,
1618
+ offsets: v,
1604
1619
  sizes: S,
1605
- total: d[e.items.length] ?? 0
1620
+ total: v[e.items.length] ?? 0
1606
1621
  };
1607
- }), ve = n(
1608
- () => F.value.total + (e.loading ? de.value : 0)
1609
- ), ge = n(() => {
1610
- const d = /* @__PURE__ */ new Map();
1622
+ }), Q = n(
1623
+ () => z.value.total + (e.loading ? u.value : 0)
1624
+ ), he = n(() => {
1625
+ const v = /* @__PURE__ */ new Map();
1611
1626
  return e.items.forEach((S, T) => {
1612
- d.set(ne(S, T), T);
1613
- }), d;
1614
- }), g = n(
1615
- () => Math.max(0, r.value - f.value)
1627
+ v.set(ne(S, T), T);
1628
+ }), v;
1629
+ }), y = n(
1630
+ () => Math.max(0, r.value - m.value)
1616
1631
  );
1617
- function E(d) {
1632
+ function L(v) {
1618
1633
  if (e.items.length === 0) return 0;
1619
- const S = F.value.offsets;
1634
+ const S = z.value.offsets;
1620
1635
  let T = 0, fe = e.items.length;
1621
1636
  for (; T < fe; ) {
1622
- const Z = Math.floor((T + fe) / 2);
1623
- S[Z + 1] <= d ? T = Z + 1 : fe = Z;
1637
+ const X = Math.floor((T + fe) / 2);
1638
+ S[X + 1] <= v ? T = X + 1 : fe = X;
1624
1639
  }
1625
1640
  return Math.min(T, e.items.length - 1);
1626
1641
  }
1627
1642
  const B = n(
1628
1643
  () => Math.max(
1629
1644
  0,
1630
- E(g.value) - D.value
1645
+ L(y.value) - d.value
1631
1646
  )
1632
- ), le = n(() => {
1647
+ ), te = n(() => {
1633
1648
  if (e.items.length === 0) return 0;
1634
- const d = r.value + o.value - f.value, S = Math.max(
1635
- ee.value,
1636
- d
1637
- ), T = E(S) + 1;
1649
+ const v = r.value + o.value - m.value, S = Math.max(
1650
+ G.value,
1651
+ v
1652
+ ), T = L(S) + 1;
1638
1653
  return Math.min(
1639
1654
  e.items.length,
1640
- T + D.value
1655
+ T + d.value
1641
1656
  );
1642
1657
  }), oe = n(
1643
- () => e.items.slice(B.value, le.value).map((d, S) => {
1658
+ () => e.items.slice(B.value, te.value).map((v, S) => {
1644
1659
  const T = B.value + S;
1645
1660
  return {
1646
- item: d,
1661
+ item: v,
1647
1662
  index: T,
1648
- key: ne(d, T),
1649
- top: F.value.offsets[T]
1663
+ key: ne(v, T),
1664
+ top: z.value.offsets[T]
1650
1665
  };
1651
1666
  })
1652
1667
  );
1653
1668
  function re() {
1654
- typeof window > "u" || (r.value = Math.max(0, window.scrollY), o.value = window.innerHeight, c.value && (f.value = c.value.getBoundingClientRect().top + r.value));
1669
+ typeof window > "u" || (r.value = Math.max(0, window.scrollY), o.value = window.innerHeight, f.value && (m.value = f.value.getBoundingClientRect().top + r.value));
1655
1670
  }
1656
- function Me() {
1657
- m("scroll", {
1658
- scrollTop: g.value,
1671
+ function ye() {
1672
+ p("scroll", {
1673
+ scrollTop: y.value,
1659
1674
  startIndex: B.value,
1660
- endIndex: le.value
1675
+ endIndex: te.value
1661
1676
  });
1662
1677
  }
1663
- function _(d = !1) {
1664
- j && (Y || (Y = d), !p && (p = W(() => {
1665
- p = void 0, re(), Y && (Y = !1, Me()), t();
1678
+ function _(v = !1) {
1679
+ F && (E || (E = v), !w && (w = Z(() => {
1680
+ w = void 0, re(), E && (E = !1, ye()), t();
1666
1681
  })));
1667
1682
  }
1668
- function J() {
1683
+ function ee() {
1669
1684
  _(!0);
1670
1685
  }
1671
1686
  function s() {
1672
1687
  _();
1673
1688
  }
1674
1689
  function t() {
1675
- if (typeof window > "u" || !e.hasMore || e.loading || A === e.items.length)
1690
+ if (typeof window > "u" || !e.hasMore || e.loading || W === e.items.length)
1676
1691
  return;
1677
- const d = Math.max(0, e.loadMoreThreshold), S = f.value + ve.value, T = r.value + o.value;
1678
- S - T <= d && (A = e.items.length, m("loadMore"));
1692
+ const v = Math.max(0, e.loadMoreThreshold), S = m.value + Q.value, T = r.value + o.value;
1693
+ S - T <= v && (W = e.items.length, p("loadMore"));
1679
1694
  }
1680
- function a(d) {
1681
- const S = d.borderBoxSize;
1695
+ function a(v) {
1696
+ const S = v.borderBoxSize;
1682
1697
  if (S) {
1683
1698
  const T = Array.isArray(S) ? S[0] : S;
1684
1699
  if (T != null && T.blockSize) return T.blockSize;
1685
1700
  }
1686
- return d.contentRect.height;
1701
+ return v.contentRect.height;
1687
1702
  }
1688
- function h(d) {
1689
- const S = F.value;
1703
+ function g(v) {
1704
+ const S = z.value;
1690
1705
  let T = 0, fe = !1;
1691
- for (const Z of d) {
1692
- const be = Z.target, Ie = Q.get(be), Be = a(Z);
1706
+ for (const X of v) {
1707
+ const be = X.target, Ie = U.get(be), Be = a(X);
1693
1708
  if (Ie === void 0 || Be <= 0) continue;
1694
- const Ke = P.get(Ie) ?? ee.value;
1709
+ const Ke = O.get(Ie) ?? G.value;
1695
1710
  if (Math.abs(Ke - Be) < 0.5) continue;
1696
- const Re = ge.value.get(Ie);
1697
- Re !== void 0 && S.offsets[Re + 1] <= g.value && (T += Be - Ke), P.set(Ie, Be), fe = !0;
1711
+ const He = he.value.get(Ie);
1712
+ He !== void 0 && S.offsets[He + 1] <= y.value && (T += Be - Ke), O.set(Ie, Be), fe = !0;
1698
1713
  }
1699
- fe && (O.value += 1, K(() => {
1700
- if (j) {
1714
+ fe && (A.value += 1, C(() => {
1715
+ if (F) {
1701
1716
  if (T !== 0 && typeof window < "u") {
1702
- const Z = Math.max(
1717
+ const X = Math.max(
1703
1718
  0,
1704
1719
  r.value + T
1705
1720
  );
1706
- r.value = Z, window.scrollTo({ top: Z, behavior: "auto" });
1721
+ r.value = X, window.scrollTo({ top: X, behavior: "auto" });
1707
1722
  }
1708
1723
  re(), t();
1709
1724
  }
1710
1725
  }));
1711
1726
  }
1712
- function b(d) {
1713
- if (j) {
1714
- for (const S of d)
1715
- X.set(S.target, S);
1716
- z || (z = W(() => {
1717
- z = void 0;
1718
- const S = Array.from(X.values());
1719
- X.clear(), h(S);
1727
+ function b(v) {
1728
+ if (F) {
1729
+ for (const S of v)
1730
+ q.set(S.target, S);
1731
+ k || (k = Z(() => {
1732
+ k = void 0;
1733
+ const S = Array.from(q.values());
1734
+ q.clear(), g(S);
1720
1735
  }));
1721
1736
  }
1722
1737
  }
1723
- function xe(d, S) {
1724
- d instanceof HTMLElement && (Q.set(d, S), L == null || L.observe(d));
1738
+ function Me(v, S) {
1739
+ v instanceof HTMLElement && (U.set(v, S), D == null || D.observe(v));
1725
1740
  }
1726
- function pe() {
1727
- for (const [d] of Q)
1728
- d.isConnected || (L == null || L.unobserve(d), Q.delete(d));
1741
+ function ge() {
1742
+ for (const [v] of U)
1743
+ v.isConnected || (D == null || D.unobserve(v), U.delete(v));
1729
1744
  }
1730
- function me(d, S = {}) {
1745
+ function ve(v, S = {}) {
1731
1746
  if (typeof window > "u") return;
1732
1747
  re();
1733
- const T = Math.max(0, ve.value - o.value), fe = Math.min(
1734
- Math.max(0, Number.isFinite(d) ? d : 0),
1748
+ const T = Math.max(0, Q.value - o.value), fe = Math.min(
1749
+ Math.max(0, Number.isFinite(v) ? v : 0),
1735
1750
  T
1736
- ), Z = Math.max(0, f.value + fe), be = S.behavior ?? "auto";
1737
- be === "auto" && (r.value = Z), window.scrollTo({ ...S, top: Z, behavior: be });
1751
+ ), X = Math.max(0, m.value + fe), be = S.behavior ?? "auto";
1752
+ be === "auto" && (r.value = X), window.scrollTo({ ...S, top: X, behavior: be });
1738
1753
  }
1739
- function Ee(d, S = {}) {
1754
+ function Le(v, S = {}) {
1740
1755
  if (typeof window > "u" || e.items.length === 0) return;
1741
1756
  re();
1742
1757
  const T = Math.min(
1743
1758
  e.items.length - 1,
1744
- Math.max(0, Math.floor(d))
1745
- ), { align: fe = "start", ...Z } = S, be = F.value.sizes[T];
1746
- let Ie = f.value + F.value.offsets[T];
1759
+ Math.max(0, Math.floor(v))
1760
+ ), { align: fe = "start", ...X } = S, be = z.value.sizes[T];
1761
+ let Ie = m.value + z.value.offsets[T];
1747
1762
  fe === "center" ? Ie -= (o.value - be) / 2 : fe === "end" && (Ie -= o.value - be);
1748
1763
  const Be = Math.max(
1749
- f.value,
1750
- f.value + ve.value - o.value
1751
- ), Ke = Math.max(0, Math.min(Ie, Be)), Re = Z.behavior ?? "auto";
1752
- Re === "auto" && (r.value = Ke), window.scrollTo({
1753
- ...Z,
1764
+ m.value,
1765
+ m.value + Q.value - o.value
1766
+ ), Ke = Math.max(0, Math.min(Ie, Be)), He = X.behavior ?? "auto";
1767
+ He === "auto" && (r.value = Ke), window.scrollTo({
1768
+ ...X,
1754
1769
  top: Ke,
1755
- behavior: Re
1770
+ behavior: He
1756
1771
  });
1757
1772
  }
1758
- function ke(d = "auto") {
1759
- typeof window > "u" || (re(), window.scrollTo({ top: Math.max(0, f.value), behavior: d }));
1773
+ function ke(v = "auto") {
1774
+ typeof window > "u" || (re(), window.scrollTo({ top: Math.max(0, m.value), behavior: v }));
1760
1775
  }
1761
1776
  return ie(
1762
1777
  () => e.itemKey,
1763
1778
  () => {
1764
- P.clear(), O.value += 1, A = -1;
1779
+ O.clear(), A.value += 1, W = -1;
1765
1780
  }
1766
1781
  ), ie(
1767
- () => e.items.map((d, S) => ne(d, S)),
1768
- async (d, S) => {
1769
- const T = d.length !== S.length || d.some((Z, be) => Z !== S[be]), fe = new Set(d);
1770
- for (const Z of P.keys())
1771
- fe.has(Z) || P.delete(Z);
1772
- T && (A = -1), O.value += 1, await K(), j && (re(), t());
1782
+ () => e.items.map((v, S) => ne(v, S)),
1783
+ async (v, S) => {
1784
+ const T = v.length !== S.length || v.some((X, be) => X !== S[be]), fe = new Set(v);
1785
+ for (const X of O.keys())
1786
+ fe.has(X) || O.delete(X);
1787
+ T && (W = -1), A.value += 1, await C(), F && (re(), t());
1773
1788
  }
1774
1789
  ), ie(
1775
1790
  () => [e.hasMore, e.loading],
1776
- async ([d]) => {
1777
- d || (A = -1), await K(), j && (re(), t());
1791
+ async ([v]) => {
1792
+ v || (W = -1), await C(), F && (re(), t());
1778
1793
  }
1779
- ), Ce(() => {
1780
- if (j = !0, re(), window.addEventListener("scroll", J, { passive: !0 }), window.addEventListener("resize", s, { passive: !0 }), typeof ResizeObserver < "u") {
1794
+ ), Ae(() => {
1795
+ if (F = !0, re(), window.addEventListener("scroll", ee, { passive: !0 }), window.addEventListener("resize", s, { passive: !0 }), typeof ResizeObserver < "u") {
1781
1796
  V = new ResizeObserver(() => {
1782
1797
  _();
1783
- }), L = new ResizeObserver(b), c.value && V.observe(c.value);
1784
- for (const [d] of Q)
1785
- L.observe(d);
1798
+ }), D = new ResizeObserver(b), f.value && V.observe(f.value);
1799
+ for (const [v] of U)
1800
+ D.observe(v);
1786
1801
  }
1787
- K(() => {
1788
- j && t();
1802
+ C(() => {
1803
+ F && t();
1789
1804
  });
1790
- }), Je(pe), Pe(() => {
1791
- j = !1, window.removeEventListener("scroll", J), window.removeEventListener("resize", s), k(p), k(z), p = void 0, z = void 0, Y = !1, X.clear(), V && (V.disconnect(), V = void 0), L && (L.disconnect(), L = void 0), Q.clear();
1792
- }), C({
1793
- scrollTo: me,
1794
- scrollToIndex: Ee,
1805
+ }), Xe(ge), Ce(() => {
1806
+ F = !1, window.removeEventListener("scroll", ee), window.removeEventListener("resize", s), H(w), H(k), w = void 0, k = void 0, E = !1, q.clear(), V && (V.disconnect(), V = void 0), D && (D.disconnect(), D = void 0), U.clear();
1807
+ }), P({
1808
+ scrollTo: ve,
1809
+ scrollToIndex: Le,
1795
1810
  scrollToTop: ke
1796
- }), (d, S) => (I(), $("div", {
1811
+ }), (v, S) => (I(), $("div", {
1797
1812
  ref_key: "root",
1798
- ref: c,
1799
- class: We(["vue-window-dynamic-virtual-scroll", { "vue-window-dynamic-virtual-scroll--pulling": u(te) }]),
1813
+ ref: f,
1814
+ class: Ye(["vue-window-dynamic-virtual-scroll", { "vue-window-dynamic-virtual-scroll--pulling": c(ae) }]),
1800
1815
  role: "list",
1801
1816
  "aria-label": l.ariaLabel,
1802
1817
  onTouchstartPassive: S[0] || (S[0] = //@ts-ignore
1803
- (...T) => u(y) && u(y)(...T)),
1818
+ (...T) => c(me) && c(me)(...T)),
1804
1819
  onTouchmove: S[1] || (S[1] = //@ts-ignore
1805
- (...T) => u(w) && u(w)(...T)),
1820
+ (...T) => c(de) && c(de)(...T)),
1806
1821
  onTouchend: S[2] || (S[2] = //@ts-ignore
1807
- (...T) => u(q) && u(q)(...T)),
1822
+ (...T) => c(ue) && c(ue)(...T)),
1808
1823
  onTouchcancel: S[3] || (S[3] = //@ts-ignore
1809
- (...T) => u(he) && u(he)(...T))
1824
+ (...T) => c(we) && c(we)(...T))
1810
1825
  }, [
1811
1826
  l.pullToRefresh || l.refreshing ? (I(), $("div", {
1812
1827
  key: 0,
1813
1828
  class: "vue-window-dynamic-virtual-scroll__refresh",
1814
1829
  style: N({
1815
- height: `${u(ue)}px`,
1816
- transform: `translateY(${u(ae) - u(ue)}px)`
1830
+ height: `${c(se)}px`,
1831
+ transform: `translateY(${c(J) - c(se)}px)`
1817
1832
  }),
1818
1833
  role: "status",
1819
1834
  "aria-live": "polite"
1820
1835
  }, [
1821
- ce(d.$slots, "refresh", {
1822
- pullDistance: u(R),
1823
- progress: u(G),
1836
+ ce(v.$slots, "refresh", {
1837
+ pullDistance: c(R),
1838
+ progress: c(Y),
1824
1839
  refreshing: l.refreshing
1825
1840
  }, () => [
1826
- Ve(Ge(u(se)), 1)
1841
+ Ve(je(c(le)), 1)
1827
1842
  ])
1828
1843
  ], 4)) : ze("", !0),
1829
1844
  l.items.length || l.loading ? (I(), $("div", {
1830
1845
  key: 1,
1831
1846
  class: "vue-window-dynamic-virtual-scroll__spacer",
1832
1847
  style: N({
1833
- height: `${ve.value}px`,
1834
- transform: `translateY(${u(ae)}px)`
1848
+ height: `${Q.value}px`,
1849
+ transform: `translateY(${c(J)}px)`
1835
1850
  })
1836
1851
  }, [
1837
- (I(!0), $(He, null, Ae(oe.value, ({ item: T, index: fe, key: Z, top: be }) => (I(), $("div", {
1838
- key: Z,
1852
+ (I(!0), $(Re, null, De(oe.value, ({ item: T, index: fe, key: X, top: be }) => (I(), $("div", {
1853
+ key: X,
1839
1854
  ref_for: !0,
1840
- ref: (Ie) => xe(Ie, Z),
1855
+ ref: (Ie) => Me(Ie, X),
1841
1856
  class: "vue-window-dynamic-virtual-scroll__item",
1842
1857
  style: N({ transform: `translateY(${be}px)` }),
1843
1858
  role: "listitem",
1844
1859
  "aria-posinset": fe + 1,
1845
1860
  "aria-setsize": l.items.length
1846
1861
  }, [
1847
- ce(d.$slots, "default", {
1862
+ ce(v.$slots, "default", {
1848
1863
  item: T,
1849
1864
  index: fe
1850
1865
  })
1851
- ], 12, $t))), 128)),
1866
+ ], 12, Et))), 128)),
1852
1867
  l.loading ? (I(), $("div", {
1853
1868
  key: 0,
1854
1869
  class: "vue-window-dynamic-virtual-scroll__loading",
1855
1870
  style: N({
1856
- height: `${de.value}px`,
1857
- transform: `translateY(${F.value.total}px)`
1871
+ height: `${u.value}px`,
1872
+ transform: `translateY(${z.value.total}px)`
1858
1873
  }),
1859
1874
  role: "status",
1860
1875
  "aria-live": "polite"
1861
1876
  }, [
1862
- ce(d.$slots, "loading", {}, () => [
1877
+ ce(v.$slots, "loading", {}, () => [
1863
1878
  S[4] || (S[4] = Ve("Loading more…", -1))
1864
1879
  ])
1865
1880
  ], 4)) : ze("", !0)
1866
1881
  ], 4)) : (I(), $("div", {
1867
1882
  key: 2,
1868
1883
  class: "vue-window-dynamic-virtual-scroll__empty",
1869
- style: N({ transform: `translateY(${u(ae)}px)` })
1884
+ style: N({ transform: `translateY(${c(J)}px)` })
1870
1885
  }, [
1871
- ce(d.$slots, "empty")
1886
+ ce(v.$slots, "empty")
1872
1887
  ], 4))
1873
- ], 42, It));
1888
+ ], 42, kt));
1874
1889
  }
1875
- }), Lt = ["aria-label"], Et = ["aria-posinset", "aria-setsize"], Bt = /* @__PURE__ */ Oe({
1890
+ }), Bt = ["aria-label"], Vt = ["aria-posinset", "aria-setsize"], Ht = /* @__PURE__ */ Oe({
1876
1891
  name: "WindowGirdVirtualScroll",
1877
1892
  __name: "WindowGirdVirtualScroll",
1878
1893
  props: {
@@ -1892,131 +1907,131 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
1892
1907
  pullRefreshThreshold: { default: 64 }
1893
1908
  },
1894
1909
  emits: ["scroll", "loadMore", "refresh"],
1895
- setup(l, { expose: C, emit: x }) {
1896
- const e = l, m = x, c = U(), r = U(0), o = U(0), f = U(0);
1897
- let O, P = -1;
1898
- const { getItemKey: Q } = De({
1910
+ setup(l, { expose: P, emit: x }) {
1911
+ const e = l, p = x, f = j(), r = j(0), o = j(0), m = j(0);
1912
+ let A, O = -1;
1913
+ const { getItemKey: U } = Pe({
1899
1914
  componentName: "WindowGirdVirtualScroll",
1900
1915
  items: () => e.items,
1901
1916
  itemKey: () => e.itemKey
1902
1917
  }), {
1903
- pulling: X,
1918
+ pulling: q,
1904
1919
  pullDistance: V,
1905
- pullOffset: L,
1906
- pullProgress: p,
1907
- refreshMessage: z,
1908
- refreshThreshold: Y,
1909
- handleTouchStart: j,
1910
- handleTouchMove: A,
1920
+ pullOffset: D,
1921
+ pullProgress: w,
1922
+ refreshMessage: k,
1923
+ refreshThreshold: E,
1924
+ handleTouchStart: F,
1925
+ handleTouchMove: W,
1911
1926
  handleTouchEnd: ne,
1912
- handleTouchCancel: W
1927
+ handleTouchCancel: Z
1913
1928
  } = qe({
1914
1929
  enabled: () => e.pullToRefresh,
1915
1930
  refreshing: () => e.refreshing,
1916
1931
  threshold: () => e.pullRefreshThreshold,
1917
- onRefresh: () => m("refresh"),
1932
+ onRefresh: () => p("refresh"),
1918
1933
  scrollTop: () => typeof window > "u" ? 0 : Math.max(0, window.scrollY)
1919
- }), k = n(() => Math.max(1, e.itemSize)), te = n(
1934
+ }), H = n(() => Math.max(1, e.itemSize)), ae = n(
1920
1935
  () => Math.max(1, Math.floor(e.columns))
1921
- ), R = n(() => Math.max(0, e.gap)), ae = n(() => Math.max(0, Math.floor(e.overscan))), G = n(
1922
- () => Math.max(1, e.loadingItemSize ?? k.value)
1936
+ ), R = n(() => Math.max(0, e.gap)), J = n(() => Math.max(0, Math.floor(e.overscan))), Y = n(
1937
+ () => Math.max(1, e.loadingItemSize ?? H.value)
1938
+ ), le = n(
1939
+ () => H.value + R.value
1923
1940
  ), se = n(
1924
- () => k.value + R.value
1941
+ () => Math.ceil(e.items.length / ae.value)
1942
+ ), me = n(() => se.value === 0 ? 0 : se.value * H.value + (se.value - 1) * R.value), de = n(
1943
+ () => me.value + (e.items.length ? R.value : 0)
1925
1944
  ), ue = n(
1926
- () => Math.ceil(e.items.length / te.value)
1927
- ), y = n(() => ue.value === 0 ? 0 : ue.value * k.value + (ue.value - 1) * R.value), w = n(
1928
- () => y.value + (e.items.length ? R.value : 0)
1929
- ), q = n(
1930
- () => y.value + (e.loading ? G.value + (e.items.length ? R.value : 0) : 0)
1931
- ), he = n(
1932
- () => Math.max(0, r.value - f.value)
1933
- ), ee = n(
1945
+ () => me.value + (e.loading ? Y.value + (e.items.length ? R.value : 0) : 0)
1946
+ ), we = n(
1947
+ () => Math.max(0, r.value - m.value)
1948
+ ), G = n(
1934
1949
  () => Math.max(
1935
1950
  0,
1936
- Math.floor(he.value / se.value) - ae.value
1951
+ Math.floor(we.value / le.value) - J.value
1937
1952
  )
1938
- ), de = n(() => {
1939
- if (ue.value === 0) return 0;
1953
+ ), u = n(() => {
1954
+ if (se.value === 0) return 0;
1940
1955
  const _ = Math.max(
1941
- k.value,
1942
- r.value + o.value - f.value
1943
- ), J = Math.ceil(
1944
- (_ + R.value) / se.value
1956
+ H.value,
1957
+ r.value + o.value - m.value
1958
+ ), ee = Math.ceil(
1959
+ (_ + R.value) / le.value
1945
1960
  );
1946
1961
  return Math.min(
1947
- ue.value,
1948
- J + ae.value
1962
+ se.value,
1963
+ ee + J.value
1949
1964
  );
1950
- }), D = n(
1951
- () => Math.min(e.items.length, ee.value * te.value)
1952
- ), F = n(
1953
- () => Math.min(e.items.length, de.value * te.value)
1954
- ), ve = n(
1955
- () => e.items.slice(D.value, F.value).map((_, J) => {
1956
- const s = D.value + J;
1965
+ }), d = n(
1966
+ () => Math.min(e.items.length, G.value * ae.value)
1967
+ ), z = n(
1968
+ () => Math.min(e.items.length, u.value * ae.value)
1969
+ ), Q = n(
1970
+ () => e.items.slice(d.value, z.value).map((_, ee) => {
1971
+ const s = d.value + ee;
1957
1972
  return {
1958
1973
  item: _,
1959
1974
  index: s,
1960
- key: Q(_, s),
1961
- rowIndex: Math.floor(s / te.value),
1962
- columnIndex: s % te.value
1975
+ key: U(_, s),
1976
+ rowIndex: Math.floor(s / ae.value),
1977
+ columnIndex: s % ae.value
1963
1978
  };
1964
1979
  })
1965
- ), ge = n(() => ({
1966
- gridTemplateColumns: `repeat(${te.value}, minmax(0, 1fr))`,
1980
+ ), he = n(() => ({
1981
+ gridTemplateColumns: `repeat(${ae.value}, minmax(0, 1fr))`,
1967
1982
  columnGap: `${R.value}px`,
1968
1983
  rowGap: `${R.value}px`,
1969
- transform: `translateY(${ee.value * se.value}px)`
1984
+ transform: `translateY(${G.value * le.value}px)`
1970
1985
  }));
1971
- function g() {
1972
- typeof window > "u" || (r.value = Math.max(0, window.scrollY), o.value = window.innerHeight, c.value && (f.value = c.value.getBoundingClientRect().top + r.value));
1973
- }
1974
- function E() {
1975
- m("scroll", {
1976
- scrollTop: he.value,
1977
- startIndex: D.value,
1978
- endIndex: F.value
1986
+ function y() {
1987
+ typeof window > "u" || (r.value = Math.max(0, window.scrollY), o.value = window.innerHeight, f.value && (m.value = f.value.getBoundingClientRect().top + r.value));
1988
+ }
1989
+ function L() {
1990
+ p("scroll", {
1991
+ scrollTop: we.value,
1992
+ startIndex: d.value,
1993
+ endIndex: z.value
1979
1994
  });
1980
1995
  }
1981
1996
  function B() {
1982
- g(), E(), le();
1997
+ y(), L(), te();
1983
1998
  }
1984
- function le() {
1985
- if (typeof window > "u" || !e.hasMore || e.loading || P === e.items.length)
1999
+ function te() {
2000
+ if (typeof window > "u" || !e.hasMore || e.loading || O === e.items.length)
1986
2001
  return;
1987
- const _ = Math.max(0, e.loadMoreThreshold), J = f.value + q.value, s = r.value + o.value;
1988
- J - s <= _ && (P = e.items.length, m("loadMore"));
2002
+ const _ = Math.max(0, e.loadMoreThreshold), ee = m.value + ue.value, s = r.value + o.value;
2003
+ ee - s <= _ && (O = e.items.length, p("loadMore"));
1989
2004
  }
1990
- function oe(_, J = {}) {
2005
+ function oe(_, ee = {}) {
1991
2006
  if (typeof window > "u") return;
1992
- g();
1993
- const s = Math.max(0, q.value - o.value), t = Math.min(
2007
+ y();
2008
+ const s = Math.max(0, ue.value - o.value), t = Math.min(
1994
2009
  Math.max(0, Number.isFinite(_) ? _ : 0),
1995
2010
  s
1996
- ), a = Math.max(0, f.value + t), h = J.behavior ?? "auto";
1997
- h === "auto" && (r.value = a), window.scrollTo({ ...J, top: a, behavior: h });
2011
+ ), a = Math.max(0, m.value + t), g = ee.behavior ?? "auto";
2012
+ g === "auto" && (r.value = a), window.scrollTo({ ...ee, top: a, behavior: g });
1998
2013
  }
1999
- function re(_, J = {}) {
2014
+ function re(_, ee = {}) {
2000
2015
  if (typeof window > "u" || e.items.length === 0) return;
2001
- g();
2016
+ y();
2002
2017
  const s = Math.min(
2003
2018
  e.items.length - 1,
2004
2019
  Math.max(0, Math.floor(_))
2005
- ), t = Math.floor(s / te.value), { align: a = "start", ...h } = J;
2006
- let b = f.value + t * se.value;
2007
- a === "center" ? b -= (o.value - k.value) / 2 : a === "end" && (b -= o.value - k.value);
2008
- const xe = Math.max(
2009
- f.value,
2010
- f.value + q.value - o.value
2011
- ), pe = Math.max(0, Math.min(b, xe)), me = h.behavior ?? "auto";
2012
- me === "auto" && (r.value = pe), window.scrollTo({
2013
- ...h,
2014
- top: pe,
2015
- behavior: me
2020
+ ), t = Math.floor(s / ae.value), { align: a = "start", ...g } = ee;
2021
+ let b = m.value + t * le.value;
2022
+ a === "center" ? b -= (o.value - H.value) / 2 : a === "end" && (b -= o.value - H.value);
2023
+ const Me = Math.max(
2024
+ m.value,
2025
+ m.value + ue.value - o.value
2026
+ ), ge = Math.max(0, Math.min(b, Me)), ve = g.behavior ?? "auto";
2027
+ ve === "auto" && (r.value = ge), window.scrollTo({
2028
+ ...g,
2029
+ top: ge,
2030
+ behavior: ve
2016
2031
  });
2017
2032
  }
2018
- function Me(_ = "auto") {
2019
- typeof window > "u" || (g(), window.scrollTo({ top: Math.max(0, f.value), behavior: _ }));
2033
+ function ye(_ = "auto") {
2034
+ typeof window > "u" || (y(), window.scrollTo({ top: Math.max(0, m.value), behavior: _ }));
2020
2035
  }
2021
2036
  return ie(
2022
2037
  () => [
@@ -2026,72 +2041,72 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
2026
2041
  e.gap
2027
2042
  ],
2028
2043
  async () => {
2029
- await K(), g(), le();
2044
+ await C(), y(), te();
2030
2045
  }
2031
2046
  ), ie(
2032
2047
  () => [e.hasMore, e.loading],
2033
2048
  async ([_]) => {
2034
- _ || (P = -1), await K(), g(), le();
2049
+ _ || (O = -1), await C(), y(), te();
2035
2050
  }
2036
- ), Ce(() => {
2037
- g(), window.addEventListener("scroll", B, { passive: !0 }), window.addEventListener("resize", B, { passive: !0 }), typeof ResizeObserver < "u" && (O = new ResizeObserver(() => {
2038
- g(), le();
2039
- }), c.value && O.observe(c.value)), K(le);
2040
- }), Pe(() => {
2041
- window.removeEventListener("scroll", B), window.removeEventListener("resize", B), O && (O.disconnect(), O = void 0);
2042
- }), C({
2051
+ ), Ae(() => {
2052
+ y(), window.addEventListener("scroll", B, { passive: !0 }), window.addEventListener("resize", B, { passive: !0 }), typeof ResizeObserver < "u" && (A = new ResizeObserver(() => {
2053
+ y(), te();
2054
+ }), f.value && A.observe(f.value)), C(te);
2055
+ }), Ce(() => {
2056
+ window.removeEventListener("scroll", B), window.removeEventListener("resize", B), A && (A.disconnect(), A = void 0);
2057
+ }), P({
2043
2058
  scrollTo: oe,
2044
2059
  scrollToIndex: re,
2045
- scrollToTop: Me
2046
- }), (_, J) => (I(), $("div", {
2060
+ scrollToTop: ye
2061
+ }), (_, ee) => (I(), $("div", {
2047
2062
  ref_key: "root",
2048
- ref: c,
2049
- class: We(["vue-window-gird-virtual-scroll", { "vue-window-gird-virtual-scroll--pulling": u(X) }]),
2063
+ ref: f,
2064
+ class: Ye(["vue-window-gird-virtual-scroll", { "vue-window-gird-virtual-scroll--pulling": c(q) }]),
2050
2065
  role: "list",
2051
2066
  "aria-label": l.ariaLabel,
2052
- onTouchstartPassive: J[0] || (J[0] = //@ts-ignore
2053
- (...s) => u(j) && u(j)(...s)),
2054
- onTouchmove: J[1] || (J[1] = //@ts-ignore
2055
- (...s) => u(A) && u(A)(...s)),
2056
- onTouchend: J[2] || (J[2] = //@ts-ignore
2057
- (...s) => u(ne) && u(ne)(...s)),
2058
- onTouchcancel: J[3] || (J[3] = //@ts-ignore
2059
- (...s) => u(W) && u(W)(...s))
2067
+ onTouchstartPassive: ee[0] || (ee[0] = //@ts-ignore
2068
+ (...s) => c(F) && c(F)(...s)),
2069
+ onTouchmove: ee[1] || (ee[1] = //@ts-ignore
2070
+ (...s) => c(W) && c(W)(...s)),
2071
+ onTouchend: ee[2] || (ee[2] = //@ts-ignore
2072
+ (...s) => c(ne) && c(ne)(...s)),
2073
+ onTouchcancel: ee[3] || (ee[3] = //@ts-ignore
2074
+ (...s) => c(Z) && c(Z)(...s))
2060
2075
  }, [
2061
2076
  l.pullToRefresh || l.refreshing ? (I(), $("div", {
2062
2077
  key: 0,
2063
2078
  class: "vue-window-gird-virtual-scroll__refresh",
2064
2079
  style: N({
2065
- height: `${u(Y)}px`,
2066
- transform: `translateY(${u(L) - u(Y)}px)`
2080
+ height: `${c(E)}px`,
2081
+ transform: `translateY(${c(D) - c(E)}px)`
2067
2082
  }),
2068
2083
  role: "status",
2069
2084
  "aria-live": "polite"
2070
2085
  }, [
2071
2086
  ce(_.$slots, "refresh", {
2072
- pullDistance: u(V),
2073
- progress: u(p),
2087
+ pullDistance: c(V),
2088
+ progress: c(w),
2074
2089
  refreshing: l.refreshing
2075
2090
  }, () => [
2076
- Ve(Ge(u(z)), 1)
2091
+ Ve(je(c(k)), 1)
2077
2092
  ])
2078
2093
  ], 4)) : ze("", !0),
2079
2094
  l.items.length || l.loading ? (I(), $("div", {
2080
2095
  key: 1,
2081
2096
  class: "vue-window-gird-virtual-scroll__spacer",
2082
2097
  style: N({
2083
- height: `${q.value}px`,
2084
- transform: `translateY(${u(L)}px)`
2098
+ height: `${ue.value}px`,
2099
+ transform: `translateY(${c(D)}px)`
2085
2100
  })
2086
2101
  }, [
2087
- je("div", {
2102
+ Ge("div", {
2088
2103
  class: "vue-window-gird-virtual-scroll__content",
2089
- style: N(ge.value)
2104
+ style: N(he.value)
2090
2105
  }, [
2091
- (I(!0), $(He, null, Ae(ve.value, ({ item: s, index: t, key: a, rowIndex: h, columnIndex: b }) => (I(), $("div", {
2106
+ (I(!0), $(Re, null, De(Q.value, ({ item: s, index: t, key: a, rowIndex: g, columnIndex: b }) => (I(), $("div", {
2092
2107
  key: a,
2093
2108
  class: "vue-window-gird-virtual-scroll__item",
2094
- style: N({ height: `${k.value}px` }),
2109
+ style: N({ height: `${H.value}px` }),
2095
2110
  role: "listitem",
2096
2111
  "aria-posinset": t + 1,
2097
2112
  "aria-setsize": l.items.length
@@ -2099,55 +2114,55 @@ const rt = ["aria-label"], ut = ["aria-posinset", "aria-setsize"], et = /* @__PU
2099
2114
  ce(_.$slots, "default", {
2100
2115
  item: s,
2101
2116
  index: t,
2102
- rowIndex: h,
2117
+ rowIndex: g,
2103
2118
  columnIndex: b
2104
2119
  })
2105
- ], 12, Et))), 128))
2120
+ ], 12, Vt))), 128))
2106
2121
  ], 4),
2107
2122
  l.loading ? (I(), $("div", {
2108
2123
  key: 0,
2109
2124
  class: "vue-window-gird-virtual-scroll__loading",
2110
2125
  style: N({
2111
- height: `${G.value}px`,
2112
- transform: `translateY(${w.value}px)`
2126
+ height: `${Y.value}px`,
2127
+ transform: `translateY(${de.value}px)`
2113
2128
  }),
2114
2129
  role: "status",
2115
2130
  "aria-live": "polite"
2116
2131
  }, [
2117
2132
  ce(_.$slots, "loading", {}, () => [
2118
- J[4] || (J[4] = Ve("Loading more…", -1))
2133
+ ee[4] || (ee[4] = Ve("Loading more…", -1))
2119
2134
  ])
2120
2135
  ], 4)) : ze("", !0)
2121
2136
  ], 4)) : (I(), $("div", {
2122
2137
  key: 2,
2123
2138
  class: "vue-window-gird-virtual-scroll__empty",
2124
- style: N({ transform: `translateY(${u(L)}px)` })
2139
+ style: N({ transform: `translateY(${c(D)}px)` })
2125
2140
  }, [
2126
2141
  ce(_.$slots, "empty")
2127
2142
  ], 4))
2128
- ], 42, Lt));
2143
+ ], 42, Bt));
2129
2144
  }
2130
- }), Vt = et, Ht = {
2145
+ }), Rt = et, Kt = {
2131
2146
  install(l) {
2132
- l.component("ChatVirtualScroll", st), l.component("DynamicVirtualScroll", et), l.component("ShortMediaFeed", ft), l.component("SkeletonLoader", pt), l.component("VirtualCarousel", Tt), l.component("VirtualList", Vt), l.component("VirtualScroll", zt), l.component(
2147
+ l.component("ChatVirtualScroll", st), l.component("DynamicVirtualScroll", et), l.component("ShortMediaFeed", mt), l.component("SkeletonLoader", Mt), l.component("VirtualCarousel", St), l.component("VirtualList", Rt), l.component("VirtualScroll", $t), l.component(
2133
2148
  "WindowDynamicVirtualScroll",
2134
- kt
2149
+ Lt
2135
2150
  ), l.component(
2136
2151
  "WindowGirdVirtualScroll",
2137
- Bt
2152
+ Ht
2138
2153
  );
2139
2154
  }
2140
2155
  };
2141
2156
  export {
2142
2157
  st as ChatVirtualScroll,
2143
2158
  et as DynamicVirtualScroll,
2144
- ft as ShortMediaFeed,
2145
- pt as SkeletonLoader,
2146
- Tt as VirtualCarousel,
2147
- Vt as VirtualList,
2148
- zt as VirtualScroll,
2149
- Ht as VueVirtualScroll,
2150
- kt as WindowDynamicVirtualScroll,
2151
- Bt as WindowGirdVirtualScroll,
2152
- Ht as default
2159
+ mt as ShortMediaFeed,
2160
+ Mt as SkeletonLoader,
2161
+ St as VirtualCarousel,
2162
+ Rt as VirtualList,
2163
+ $t as VirtualScroll,
2164
+ Kt as VueVirtualScroll,
2165
+ Lt as WindowDynamicVirtualScroll,
2166
+ Ht as WindowGirdVirtualScroll,
2167
+ Kt as default
2153
2168
  };