@aiquants/virtualscroll 1.22.0 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as st, jsxs as ue, Fragment as je } from "react/jsx-runtime";
2
- import Je, { memo as Qe, forwardRef as Ye, useState as Zt, useRef as T, useCallback as S, useImperativeHandle as Be, useMemo as At, useLayoutEffect as be, useEffect as Y, useId as tr } from "react";
3
- import { twMerge as ce } from "tailwind-merge";
1
+ import { jsx as it, jsxs as de, Fragment as je } from "react/jsx-runtime";
2
+ import Je, { memo as Qe, forwardRef as Ye, useState as Zt, useRef as T, useCallback as v, useImperativeHandle as Be, useMemo as At, useLayoutEffect as xe, useEffect as Y, useId as tr } from "react";
3
+ import { twMerge as ue } from "tailwind-merge";
4
4
  class C {
5
5
  level;
6
6
  prefix;
@@ -155,8 +155,8 @@ const qe = {
155
155
  pointerId: null
156
156
  }, Le = 6, er = 8, rr = ({ dragState: n, normalizedDistance: t }) => {
157
157
  const e = 1 + t * 0.18, r = 0.16 + t * 0.24, i = 0.38 + t * 0.28, s = n.active ? "80ms ease-out" : "220ms ease";
158
- return /* @__PURE__ */ ue(je, { children: [
159
- /* @__PURE__ */ st(
158
+ return /* @__PURE__ */ de(je, { children: [
159
+ /* @__PURE__ */ it(
160
160
  "div",
161
161
  {
162
162
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -168,7 +168,7 @@ const qe = {
168
168
  }
169
169
  }
170
170
  ),
171
- /* @__PURE__ */ st(
171
+ /* @__PURE__ */ it(
172
172
  "div",
173
173
  {
174
174
  className: "aqvs-tap-scroll-circle-inner",
@@ -183,90 +183,90 @@ const qe = {
183
183
  ] });
184
184
  }, Ge = Qe(
185
185
  Ye(({ onDragChange: n, className: t, maxVisualDistance: e = 160, size: r = 40, style: i, opacity: s = 1, renderVisual: l }, c) => {
186
- const [d, x] = Zt(qe), I = T(null), M = T(null), E = T({ x: 0, y: 0 }), h = T(null), _ = T(0), z = S(
187
- (p) => {
188
- x(p), n(p);
186
+ const [f, x] = Zt(qe), I = T(null), P = T(null), E = T({ x: 0, y: 0 }), g = T(null), _ = T(0), z = v(
187
+ (h) => {
188
+ x(h), n(h);
189
189
  },
190
190
  [n]
191
- ), j = S(
192
- (p, $, St = !1) => {
193
- const { x: Rt, y: Z } = E.current, k = p - Rt, Ct = $ - Z, U = Math.abs(Ct), Et = U < Le ? 0 : Ct < 0 ? -1 : 1, y = _.current;
194
- let Yt = Et;
195
- const Ht = Le + er;
196
- Et === 0 ? y !== 0 && U < Ht ? Yt = y : (Yt = 0, St || (_.current = 0)) : Et !== y && y !== 0 && U < Ht ? Yt = y : _.current = Et, z({
197
- active: St || U >= Le,
191
+ ), j = v(
192
+ (h, $, Tt = !1) => {
193
+ const { x: wt, y: Z } = E.current, k = h - wt, Rt = $ - Z, U = Math.abs(Rt), Ct = U < Le ? 0 : Rt < 0 ? -1 : 1, w = _.current;
194
+ let Yt = Ct;
195
+ const Xt = Le + er;
196
+ Ct === 0 ? w !== 0 && U < Xt ? Yt = w : (Yt = 0, Tt || (_.current = 0)) : Ct !== w && w !== 0 && U < Xt ? Yt = w : _.current = Ct, z({
197
+ active: Tt || U >= Le,
198
198
  offsetX: k,
199
- offsetY: Ct,
199
+ offsetY: Rt,
200
200
  distance: U,
201
201
  direction: Yt,
202
202
  pointerId: I.current
203
203
  });
204
204
  },
205
205
  [z]
206
- ), ut = S((p) => {
207
- if (p === null)
206
+ ), ft = v((h) => {
207
+ if (h === null)
208
208
  return;
209
- const $ = h.current;
210
- $?.hasPointerCapture(p) && $.releasePointerCapture(p);
211
- }, []), Q = S(
212
- (p = !1) => {
213
- p && ut(I.current), I.current = null, M.current = null, _.current = 0, z(qe);
209
+ const $ = g.current;
210
+ $?.hasPointerCapture(h) && $.releasePointerCapture(h);
211
+ }, []), Q = v(
212
+ (h = !1) => {
213
+ h && ft(I.current), I.current = null, P.current = null, _.current = 0, z(qe);
214
214
  },
215
- [z, ut]
216
- ), tt = S(
217
- (p) => {
218
- if (I.current !== null && I.current !== p.pointerId) {
219
- M.current = { pointerId: p.pointerId, clientX: p.clientX, clientY: p.clientY }, p.preventDefault(), p.stopPropagation();
215
+ [z, ft]
216
+ ), tt = v(
217
+ (h) => {
218
+ if (I.current !== null && I.current !== h.pointerId) {
219
+ P.current = { pointerId: h.pointerId, clientX: h.clientX, clientY: h.clientY }, h.preventDefault(), h.stopPropagation();
220
220
  return;
221
221
  }
222
- p.preventDefault(), p.stopPropagation();
223
- const $ = h.current ?? p.currentTarget, { left: St, top: Rt, width: Z, height: k } = $.getBoundingClientRect();
224
- E.current = { x: St + Z / 2, y: Rt + k / 2 }, I.current = p.pointerId;
222
+ h.preventDefault(), h.stopPropagation();
223
+ const $ = g.current ?? h.currentTarget, { left: Tt, top: wt, width: Z, height: k } = $.getBoundingClientRect();
224
+ E.current = { x: Tt + Z / 2, y: wt + k / 2 }, I.current = h.pointerId;
225
225
  try {
226
- $.setPointerCapture(p.pointerId);
226
+ $.setPointerCapture(h.pointerId);
227
227
  } catch {
228
228
  }
229
- j(p.clientX, p.clientY, !0);
229
+ j(h.clientX, h.clientY, !0);
230
230
  },
231
231
  [j]
232
- ), mt = S(
233
- (p) => {
234
- if (I.current !== p.pointerId) {
235
- M.current !== null && M.current.pointerId === p.pointerId && (M.current = { pointerId: p.pointerId, clientX: p.clientX, clientY: p.clientY });
232
+ ), pt = v(
233
+ (h) => {
234
+ if (I.current !== h.pointerId) {
235
+ P.current !== null && P.current.pointerId === h.pointerId && (P.current = { pointerId: h.pointerId, clientX: h.clientX, clientY: h.clientY });
236
236
  return;
237
237
  }
238
- p.preventDefault(), j(p.clientX, p.clientY);
238
+ h.preventDefault(), j(h.clientX, h.clientY);
239
239
  },
240
240
  [j]
241
- ), Tt = S(
242
- (p) => {
243
- if (I.current !== p.pointerId) {
244
- M.current !== null && M.current.pointerId === p.pointerId && (M.current = null);
241
+ ), It = v(
242
+ (h) => {
243
+ if (I.current !== h.pointerId) {
244
+ P.current !== null && P.current.pointerId === h.pointerId && (P.current = null);
245
245
  return;
246
246
  }
247
- p.preventDefault(), p.stopPropagation();
248
- const $ = M.current;
249
- if (M.current = null, $ !== null) {
250
- ut(p.pointerId);
251
- const St = h.current;
252
- let Rt = !0;
253
- if (St !== null && typeof St.setPointerCapture == "function")
247
+ h.preventDefault(), h.stopPropagation();
248
+ const $ = P.current;
249
+ if (P.current = null, $ !== null) {
250
+ ft(h.pointerId);
251
+ const Tt = g.current;
252
+ let wt = !0;
253
+ if (Tt !== null && typeof Tt.setPointerCapture == "function")
254
254
  try {
255
- St.setPointerCapture($.pointerId);
255
+ Tt.setPointerCapture($.pointerId);
256
256
  } catch (Z) {
257
- (typeof Z == "object" && Z !== null && "name" in Z ? Z.name : void 0) === "NotFoundError" && (Rt = !1);
257
+ (typeof Z == "object" && Z !== null && "name" in Z ? Z.name : void 0) === "NotFoundError" && (wt = !1);
258
258
  }
259
- if (Rt) {
259
+ if (wt) {
260
260
  I.current = $.pointerId, j($.clientX, $.clientY, !0);
261
261
  return;
262
262
  }
263
263
  }
264
264
  Q(!0);
265
265
  },
266
- [Q, ut, j]
267
- ), D = S(
268
- (p) => {
269
- I.current === p.pointerId && Q(!1);
266
+ [Q, ft, j]
267
+ ), D = v(
268
+ (h) => {
269
+ h.target === h.currentTarget && I.current === h.pointerId && Q(!1);
270
270
  },
271
271
  [Q]
272
272
  );
@@ -276,14 +276,14 @@ const qe = {
276
276
  reset: () => {
277
277
  Q(!0);
278
278
  },
279
- getElement: () => h.current
279
+ getElement: () => g.current
280
280
  }),
281
281
  [Q]
282
282
  );
283
- const O = Math.min(Math.max(s, 0), 1), P = r / 64, B = Math.min(d.distance, e) / e, N = d.direction * B * 10 * P, q = l ?? rr, et = {
284
- dragState: d,
283
+ const O = Math.min(Math.max(s, 0), 1), M = r / 64, B = Math.min(f.distance, e) / e, N = f.direction * B * 10 * M, q = l ?? rr, et = {
284
+ dragState: f,
285
285
  normalizedDistance: B,
286
- sizeScale: P,
286
+ sizeScale: M,
287
287
  size: r,
288
288
  opacity: O
289
289
  }, G = {
@@ -292,18 +292,18 @@ const qe = {
292
292
  height: r,
293
293
  transform: `translateY(${N}px)`
294
294
  };
295
- return G.opacity = O, /* @__PURE__ */ st(
295
+ return G.opacity = O, /* @__PURE__ */ it(
296
296
  "div",
297
297
  {
298
- ref: h,
298
+ ref: g,
299
299
  "data-testid": "virtual-scroll-tap-circle",
300
- className: ce("aqvs-tap-scroll-circle", t),
300
+ className: ue("aqvs-tap-scroll-circle", t),
301
301
  style: G,
302
302
  tabIndex: -1,
303
303
  onPointerDown: tt,
304
- onPointerMove: mt,
305
- onPointerUp: Tt,
306
- onPointerCancel: Tt,
304
+ onPointerMove: pt,
305
+ onPointerUp: It,
306
+ onPointerCancel: It,
307
307
  onLostPointerCapture: D,
308
308
  role: "presentation",
309
309
  children: q(et)
@@ -312,7 +312,7 @@ const qe = {
312
312
  })
313
313
  );
314
314
  Ge.displayName = "TapScrollCircle";
315
- const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scroll-cancel", He = 20, nr = 250, ir = 60, sr = 20, or = 20, Ze = {
315
+ const xt = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scroll-cancel", He = 20, nr = 250, ir = 60, sr = 20, or = 20, Ze = {
316
316
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
317
317
  maxDistance: 240,
318
318
  /** 最小速度倍率 (ビューポート比)。 */
@@ -359,31 +359,31 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
359
359
  maxVisualDistance: n?.maxVisualDistance ?? Gt.maxVisualDistance,
360
360
  maxSpeedMultiplier: r,
361
361
  minSpeedMultiplier: Math.max(n?.minSpeedMultiplier ?? Gt.minSpeedMultiplier, 0),
362
- opacity: It(n?.opacity ?? Gt.opacity, 0, 1),
362
+ opacity: xt(n?.opacity ?? Gt.opacity, 0, 1),
363
363
  renderVisual: n?.renderVisual ?? Gt.renderVisual,
364
364
  maxSpeedCurve: n?.maxSpeedCurve ?? Gt.maxSpeedCurve
365
365
  };
366
366
  }, mr = ({ isDragging: n, isThumbHovered: t, enableThumbDrag: e }) => At(() => e ? n ? "dragging" : t ? "hover" : "idle" : "disabled", [e, n, t]), pr = ({ canUseArrowButtons: n, enableArrowButtons: t, resetTapScroll: e, scrollByStep: r }) => {
367
- const i = T(null), s = T(null), l = T(null), c = S(() => {
367
+ const i = T(null), s = T(null), l = T(null), c = v(() => {
368
368
  i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), l.current !== null && (window.removeEventListener("pointerup", l.current), window.removeEventListener("pointercancel", l.current), window.removeEventListener("blur", l.current), l.current = null);
369
- }, []), d = S(() => {
369
+ }, []), f = v(() => {
370
370
  c();
371
- }, [c]), x = S(
372
- (M) => (E) => {
371
+ }, [c]), x = v(
372
+ (P) => (E) => {
373
373
  if (!n)
374
374
  return;
375
- E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(M), s.current = window.setTimeout(() => {
375
+ E.cancelable && E.preventDefault(), E.stopPropagation(), e(), c(), r(P), s.current = window.setTimeout(() => {
376
376
  i.current = window.setInterval(() => {
377
- r(M);
377
+ r(P);
378
378
  }, ir);
379
379
  }, nr);
380
- const h = () => c();
381
- l.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
380
+ const g = () => c();
381
+ l.current = g, window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g), window.addEventListener("blur", g);
382
382
  },
383
383
  [n, c, e, r]
384
- ), I = S(
385
- (M) => (E) => {
386
- t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(M));
384
+ ), I = v(
385
+ (P) => (E) => {
386
+ t && (E.key === "Enter" || E.key === " " || E.key === "Spacebar") && (E.preventDefault(), r(P));
387
387
  },
388
388
  [t, r]
389
389
  );
@@ -391,26 +391,26 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
391
391
  n || c();
392
392
  }, [n, c]), Y(() => () => {
393
393
  c();
394
- }, [c]), { handleArrowPointerDown: x, handleArrowPointerUp: d, handleArrowKeyDown: I };
395
- }, hr = 700, ae = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, gr = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: l }) => {
396
- const c = Math.max(ae(n, 0), 0), d = ae(t, 0), x = d > 0 ? Math.min(c, d) / d : 1, I = Math.max(ae(e, 0), 0), M = Math.max(ae(r, 0), 0), E = Math.max(ae(i, 0), 0), h = Math.max(I * M, 40), _ = s ? h : 1200, z = Math.max(I * E, _), j = l ? Math.max(ae(l.exponentialScale, E), 0) : 0, ut = l ? Math.min(z, Math.max(I * j, h)) : z, Q = Math.max(ut, h);
394
+ }, [c]), { handleArrowPointerDown: x, handleArrowPointerUp: f, handleArrowKeyDown: I };
395
+ }, hr = 700, oe = (n, t) => typeof n == "number" && Number.isFinite(n) ? n : t, gr = ({ distance: n, maxDistance: t, viewportSize: e, minSpeedMultiplier: r, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: l }) => {
396
+ const c = Math.max(oe(n, 0), 0), f = oe(t, 0), x = f > 0 ? Math.min(c, f) / f : 1, I = Math.max(oe(e, 0), 0), P = Math.max(oe(r, 0), 0), E = Math.max(oe(i, 0), 0), g = Math.max(I * P, 40), _ = s ? g : 1200, z = Math.max(I * E, _), j = l ? Math.max(oe(l.exponentialScale, E), 0) : 0, ft = l ? Math.min(z, Math.max(I * j, g)) : z, Q = Math.max(ft, g);
397
397
  let tt = x ** 1.1;
398
398
  if (l) {
399
- const Tt = Math.min(Math.max(ae(l.exponentialSteepness, 0), 0), hr);
400
- if (Tt === 0)
399
+ const It = Math.min(Math.max(oe(l.exponentialSteepness, 0), 0), hr);
400
+ if (It === 0)
401
401
  tt = x;
402
402
  else {
403
- const D = Math.expm1(Tt) || 1;
404
- tt = Math.min(Math.max(Math.expm1(Tt * x) / D, 0), 1);
403
+ const D = Math.expm1(It) || 1;
404
+ tt = Math.min(Math.max(Math.expm1(It * x) / D, 0), 1);
405
405
  }
406
406
  }
407
- const mt = Math.min(Math.max(ae(l?.easedOffset, 0), 0), 1);
408
- return h + (Q - h) * (mt + (1 - mt) * tt);
407
+ const pt = Math.min(Math.max(oe(l?.easedOffset, 0), 0), 1);
408
+ return g + (Q - g) * (pt + (1 - pt) * tt);
409
409
  }, br = (n) => {
410
410
  if (!n || n <= 0)
411
411
  return _e;
412
412
  const t = Math.max(1, n), e = Math.log10(t), r = _e + e * lr;
413
- return It(r, _e, cr);
413
+ return xt(r, _e, cr);
414
414
  }, xr = ({
415
415
  contentSize: n,
416
416
  viewportSize: t,
@@ -420,117 +420,117 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
420
420
  enableTrackClick: s = !0,
421
421
  enableArrowButtons: l = !0,
422
422
  horizontal: c = !1,
423
- scrollBarWidth: d = 12,
423
+ scrollBarWidth: f = 12,
424
424
  className: x,
425
425
  ariaControls: I,
426
- tapScrollCircleOptions: M,
426
+ tapScrollCircleOptions: P,
427
427
  itemCount: E,
428
- renderThumbOverlay: h,
428
+ renderThumbOverlay: g,
429
429
  visibleStartIndex: _,
430
430
  visibleEndIndex: z
431
431
  }) => {
432
- const [j, ut] = Zt(!1), [Q, tt] = Zt(!1), [mt, Tt] = Zt(!1), D = T(null), O = T({
432
+ const [j, ft] = Zt(!1), [Q, tt] = Zt(!1), [pt, It] = Zt(!1), D = T(null), O = T({
433
433
  pointerId: null,
434
434
  startThumbPosition: 0,
435
435
  startClientX: 0,
436
436
  startClientY: 0,
437
437
  scale: 1,
438
438
  captureTarget: null
439
- }), P = T({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), B = T(e), N = T(r), q = T(Xe), et = T(null), G = T(null), p = T(null), $ = T(0), St = T(0), Rt = At(() => fr(M, E), [E, M]), Z = At(() => dr(c), [c]), {
439
+ }), M = T({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), B = T(e), N = T(r), q = T(Xe), et = T(null), G = T(null), h = T(null), $ = T(0), Tt = T(0), wt = At(() => fr(P, E), [E, P]), Z = At(() => dr(c), [c]), {
440
440
  enabled: k,
441
- size: Ct,
441
+ size: Rt,
442
442
  offsetX: U,
443
- offsetY: Et,
444
- className: y,
443
+ offsetY: Ct,
444
+ className: w,
445
445
  maxVisualDistance: Yt,
446
- maxSpeedMultiplier: Ht,
447
- minSpeedMultiplier: v,
448
- opacity: Xt,
446
+ maxSpeedMultiplier: Xt,
447
+ minSpeedMultiplier: S,
448
+ opacity: $t,
449
449
  renderVisual: Bt,
450
450
  maxSpeedCurve: Jt
451
- } = Rt, at = T({
451
+ } = wt, lt = T({
452
452
  viewportSize: t,
453
453
  maxScrollPosition: Math.max(n - t, 0),
454
454
  scrollBarVisible: n > t,
455
455
  effectiveTapMaxDistance: Math.max(Yt, 1),
456
- tapCircleMaxSpeedMultiplier: Ht,
457
- tapCircleMinSpeedMultiplier: v,
456
+ tapCircleMaxSpeedMultiplier: Xt,
457
+ tapCircleMinSpeedMultiplier: S,
458
458
  tapCircleMaxSpeedCurve: Jt,
459
- tapScrollCircleOptions: M,
459
+ tapScrollCircleOptions: P,
460
460
  effectiveTrackLength: 0,
461
461
  onScroll: r,
462
462
  scrollPosition: e
463
- }), { mainSizeKey: jt, crossSizeKey: f, positionKey: dt, selectDelta: lt, getPointerCoordinate: H, arrowLabels: it, arrowIcons: J, directionClass: yt, orientation: wt } = Z, Nt = Math.max(Yt, 1), rt = t / n, Dt = Math.max(t - d * 2, 0), Mt = rt * Dt, ft = Math.min(Math.max(He, Mt || 0), Dt || He), ot = n - t, Lt = Math.max(Dt - ft, 0), $t = ot <= 0 || Lt <= 0 ? 0 : It(e / ot * Lt, 0, Lt), Qt = $t + ft / 2, ct = n > t || j, g = ct && l;
464
- be(() => {
465
- at.current = {
463
+ }), { mainSizeKey: Wt, crossSizeKey: d, positionKey: mt, selectDelta: ct, getPointerCoordinate: H, arrowLabels: nt, arrowIcons: J, directionClass: Pt, orientation: Mt } = Z, Et = Math.max(Yt, 1), st = t / n, St = Math.max(t - f * 2, 0), yt = st * St, ut = Math.min(Math.max(He, yt || 0), St || He), ot = n - t, Dt = Math.max(St - ut, 0), qt = ot <= 0 || Dt <= 0 ? 0 : xt(e / ot * Dt, 0, Dt), le = qt + ut / 2, dt = n > t || j, Qt = dt && l;
464
+ xe(() => {
465
+ lt.current = {
466
466
  viewportSize: t,
467
467
  maxScrollPosition: ot,
468
- scrollBarVisible: ct,
469
- effectiveTapMaxDistance: Nt,
470
- tapCircleMaxSpeedMultiplier: Ht,
471
- tapCircleMinSpeedMultiplier: v,
468
+ scrollBarVisible: dt,
469
+ effectiveTapMaxDistance: Et,
470
+ tapCircleMaxSpeedMultiplier: Xt,
471
+ tapCircleMinSpeedMultiplier: S,
472
472
  tapCircleMaxSpeedCurve: Jt,
473
- tapScrollCircleOptions: M,
474
- effectiveTrackLength: Lt,
473
+ tapScrollCircleOptions: P,
474
+ effectiveTrackLength: Dt,
475
475
  onScroll: r,
476
476
  scrollPosition: e
477
477
  };
478
- }), be(() => {
478
+ }), xe(() => {
479
479
  B.current = e;
480
- }, [e]), be(() => {
480
+ }, [e]), xe(() => {
481
481
  N.current = r;
482
482
  }, [r]), Y(() => {
483
483
  i || tt(!1);
484
484
  }, [i]);
485
- const w = mr({ isDragging: j, isThumbHovered: Q, enableThumbDrag: i }), bt = S((a, b) => {
486
- const R = at.current, L = b ?? B.current;
485
+ const m = mr({ isDragging: j, isThumbHovered: Q, enableThumbDrag: i }), y = v((o, b) => {
486
+ const R = lt.current, L = b ?? B.current;
487
487
  if (N.current) {
488
- const m = N.current(a, L);
489
- if (typeof m == "number" && Number.isFinite(m))
490
- return B.current = m, m;
488
+ const p = N.current(o, L);
489
+ if (typeof p == "number" && Number.isFinite(p))
490
+ return B.current = p, p;
491
491
  }
492
- const X = typeof a == "function" ? a(L) : a, o = Math.max(R.maxScrollPosition, 0), u = R.scrollBarVisible ? It(X, 0, o) : 0;
492
+ const X = typeof o == "function" ? o(L) : o, a = Math.max(R.maxScrollPosition, 0), u = R.scrollBarVisible ? xt(X, 0, a) : 0;
493
493
  return B.current = u, u;
494
- }, []), qt = S(
495
- (a) => {
496
- const b = at.current, R = B.current;
494
+ }, []), Nt = v(
495
+ (o) => {
496
+ const b = lt.current, R = B.current;
497
497
  if (!b.scrollBarVisible || b.maxScrollPosition <= 0) {
498
- const A = bt(0, R), F = A - R;
498
+ const A = y(0, R), F = A - R;
499
499
  return { nextPosition: A, actualDelta: F, reachedBoundary: !0 };
500
500
  }
501
- if (a === 0)
501
+ if (o === 0)
502
502
  return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
503
- const X = bt((A) => It(A + a, 0, b.maxScrollPosition), R), o = X - R, u = a < 0 && R + a <= 0, m = a > 0 && R + a >= b.maxScrollPosition, V = a < 0 && (X <= 0 || u && o === 0) || a > 0 && (X >= b.maxScrollPosition || m && o === 0);
504
- return { nextPosition: X, actualDelta: o, reachedBoundary: V };
503
+ const X = y((A) => xt(A + o, 0, b.maxScrollPosition), R), a = X - R, u = o < 0 && R + o <= 0, p = o > 0 && R + o >= b.maxScrollPosition, V = o < 0 && (X <= 0 || u && a === 0) || o > 0 && (X >= b.maxScrollPosition || p && a === 0);
504
+ return { nextPosition: X, actualDelta: a, reachedBoundary: V };
505
505
  },
506
- [bt]
507
- ), xt = S(
508
- (a, b) => {
509
- a.current += b;
510
- const R = Math.max(at.current.maxScrollPosition, 0);
511
- R > 0 && (a.current = It(a.current, -R, R));
512
- const L = qt(a.current);
513
- return a.current -= L.actualDelta, L.reachedBoundary && (a.current = 0), L;
506
+ [y]
507
+ ), Lt = v(
508
+ (o, b) => {
509
+ o.current += b;
510
+ const R = Math.max(lt.current.maxScrollPosition, 0);
511
+ R > 0 && (o.current = xt(o.current, -R, R));
512
+ const L = Nt(o.current);
513
+ return o.current -= L.actualDelta, L.reachedBoundary && (o.current = 0), L;
514
514
  },
515
- [qt]
516
- ), _t = S(() => {
517
- G.current !== null && (window.cancelAnimationFrame(G.current), G.current = null), p.current = null, $.current = 0, St.current = 0;
518
- }, []), vt = S(() => {
519
- q.current = { ...Xe }, Tt(!1), et.current?.reset(), _t();
520
- }, [_t]), Ut = S(
521
- (a) => {
522
- const b = q.current, R = at.current;
515
+ [Nt]
516
+ ), at = v(() => {
517
+ G.current !== null && (window.cancelAnimationFrame(G.current), G.current = null), h.current = null, $.current = 0, Tt.current = 0;
518
+ }, []), _t = v(() => {
519
+ q.current = { ...Xe }, It(!1), et.current?.reset(), at();
520
+ }, [at]), Ht = v(
521
+ (o) => {
522
+ const b = q.current, R = lt.current;
523
523
  if (!b.active || b.direction === 0) {
524
- _t();
524
+ at();
525
525
  return;
526
526
  }
527
527
  if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
528
- _t();
528
+ at();
529
529
  return;
530
530
  }
531
- const L = p.current ?? a, X = Math.max((a - L) / 1e3, 0), o = Math.min(X, ur);
532
- if (p.current = a, o <= 0) {
533
- G.current = window.requestAnimationFrame(Ut);
531
+ const L = h.current ?? o, X = Math.max((o - L) / 1e3, 0), a = Math.min(X, ur);
532
+ if (h.current = o, a <= 0) {
533
+ G.current = window.requestAnimationFrame(Ht);
534
534
  return;
535
535
  }
536
536
  const u = gr({
@@ -542,246 +542,246 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
542
542
  hasCustomMaxSpeedMultiplier: typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
543
  curve: R.tapCircleMaxSpeedCurve
544
544
  });
545
- St.current !== b.direction && (St.current = b.direction, $.current = 0);
546
- const { reachedBoundary: m } = xt($, b.direction * u * o);
547
- if (m) {
548
- _t();
545
+ Tt.current !== b.direction && (Tt.current = b.direction, $.current = 0);
546
+ const { reachedBoundary: p } = Lt($, b.direction * u * a);
547
+ if (p) {
548
+ at();
549
549
  return;
550
550
  }
551
- G.current = window.requestAnimationFrame(Ut);
551
+ G.current = window.requestAnimationFrame(Ht);
552
552
  },
553
- [xt, _t]
554
- ), Ft = S(() => {
555
- G.current === null && (p.current = null, $.current = 0, G.current = window.requestAnimationFrame(Ut));
556
- }, [Ut]);
553
+ [Lt, at]
554
+ ), kt = v(() => {
555
+ G.current === null && (h.current = null, $.current = 0, G.current = window.requestAnimationFrame(Ht));
556
+ }, [Ht]);
557
557
  Y(() => {
558
- const a = q.current;
559
- !a.active || a.direction === 0 || Ft();
560
- }, [n, t, Ft]), Y(() => () => {
561
- _t();
562
- }, [_t]);
563
- const ie = S(
564
- (a) => {
565
- q.current = a, Tt(a.active), a.active && a.direction !== 0 ? Ft() : _t();
558
+ const o = q.current;
559
+ !o.active || o.direction === 0 || kt();
560
+ }, [n, t, kt]), Y(() => () => {
561
+ at();
562
+ }, [at]);
563
+ const jt = v(
564
+ (o) => {
565
+ q.current = o, It(o.active), o.active && o.direction !== 0 ? kt() : at();
566
566
  },
567
- [Ft, _t]
567
+ [kt, at]
568
568
  );
569
569
  Y(() => {
570
- k || vt();
571
- }, [vt, k]), Y(() => {
572
- const a = (b) => {
570
+ k || _t();
571
+ }, [_t, k]), Y(() => {
572
+ const o = (b) => {
573
573
  const L = b.detail?.paneId;
574
- L && I && L !== I || vt();
574
+ L && I && L !== I || _t();
575
575
  };
576
- return window.addEventListener(ze, a), () => {
577
- window.removeEventListener(ze, a);
576
+ return window.addEventListener(ze, o), () => {
577
+ window.removeEventListener(ze, o);
578
578
  };
579
- }, [I, vt]), Y(() => {
579
+ }, [I, _t]), Y(() => {
580
580
  if (!k)
581
581
  return;
582
- const a = (b) => {
582
+ const o = (b) => {
583
583
  if (!q.current.active || q.current.pointerId === b.pointerId)
584
584
  return;
585
585
  const R = b.target;
586
586
  if (!(R instanceof Node)) {
587
- vt();
587
+ _t();
588
588
  return;
589
589
  }
590
- et.current?.getElement()?.contains(R) || vt();
590
+ et.current?.getElement()?.contains(R) || _t();
591
591
  };
592
- return document.addEventListener("pointerdown", a, !0), () => {
593
- document.removeEventListener("pointerdown", a, !0);
592
+ return document.addEventListener("pointerdown", o, !0), () => {
593
+ document.removeEventListener("pointerdown", o, !0);
594
594
  };
595
- }, [vt, k]);
596
- const xe = (a) => {
597
- if (!ct || Lt <= 0 || ot <= 0)
595
+ }, [_t, k]);
596
+ const ce = (o) => {
597
+ if (!dt || Dt <= 0 || ot <= 0)
598
598
  return 0;
599
- const b = It(a, 0, Lt);
600
- return It(b / Lt * ot, 0, ot);
601
- }, de = S((a) => {
602
- const { scrollBarVisible: b, effectiveTrackLength: R, maxScrollPosition: L } = at.current;
603
- if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: a, trackLen: R, maxScroll: L })), R <= 0 || L <= 0)
599
+ const b = xt(o, 0, Dt);
600
+ return xt(b / Dt * ot, 0, ot);
601
+ }, fe = v((o) => {
602
+ const { scrollBarVisible: b, effectiveTrackLength: R, maxScrollPosition: L } = lt.current;
603
+ if (C.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: o, trackLen: R, maxScroll: L })), R <= 0 || L <= 0)
604
604
  return null;
605
- const X = It(a, 0, R);
606
- return It(X / R * L, 0, L);
607
- }, []), Ie = S(
608
- (a) => {
609
- const b = a.getBoundingClientRect(), R = c ? b.width : b.height, L = (V) => {
605
+ const X = xt(o, 0, R);
606
+ return xt(X / R * L, 0, L);
607
+ }, []), Ie = v(
608
+ (o) => {
609
+ const b = o.getBoundingClientRect(), R = c ? b.width : b.height, L = (V) => {
610
610
  const A = Number.parseFloat(V);
611
611
  return Number.isFinite(A) ? A : 0;
612
- }, X = window.getComputedStyle(a), o = L(c ? X.width : X.height), u = o > 0 ? o + L(c ? X.paddingLeft : X.paddingTop) + L(c ? X.paddingRight : X.paddingBottom) + L(c ? X.borderLeftWidth : X.borderTopWidth) + L(c ? X.borderRightWidth : X.borderBottomWidth) : 0, m = u > 0 ? u : c ? a.offsetWidth : a.offsetHeight;
613
- return m <= 0 || R <= 0 ? 1 : R / m;
612
+ }, X = window.getComputedStyle(o), a = L(c ? X.width : X.height), u = a > 0 ? a + L(c ? X.paddingLeft : X.paddingTop) + L(c ? X.paddingRight : X.paddingBottom) + L(c ? X.borderLeftWidth : X.borderTopWidth) + L(c ? X.borderRightWidth : X.borderBottomWidth) : 0, p = u > 0 ? u : c ? o.offsetWidth : o.offsetHeight;
613
+ return p <= 0 || R <= 0 ? 1 : R / p;
614
614
  },
615
615
  [c]
616
- ), nt = S(
617
- (a) => {
616
+ ), rt = v(
617
+ (o) => {
618
618
  const b = O.current;
619
- if (b.pointerId !== a.pointerId)
619
+ if (b.pointerId !== o.pointerId)
620
620
  return;
621
- const R = a.clientX - b.startClientX, L = a.clientY - b.startClientY, X = lt(R, L) / (b.scale || 1);
621
+ const R = o.clientX - b.startClientX, L = o.clientY - b.startClientY, X = ct(R, L) / (b.scale || 1);
622
622
  C.debug("[ScrollBar] handleThumbPointerMove", () => ({
623
623
  delta: X,
624
624
  startThumbPosition: b.startThumbPosition,
625
- clientY: a.clientY,
625
+ clientY: o.clientY,
626
626
  startClientY: b.startClientY,
627
- metrics: at.current
627
+ metrics: lt.current
628
628
  }));
629
- const o = de(b.startThumbPosition + X);
630
- o !== null && bt(o), a.cancelable && a.preventDefault();
629
+ const a = fe(b.startThumbPosition + X);
630
+ a !== null && y(a), o.cancelable && o.preventDefault();
631
631
  },
632
- [lt, de, bt]
633
- ), zt = S(
634
- (a) => {
632
+ [ct, fe, y]
633
+ ), zt = v(
634
+ (o) => {
635
635
  const b = O.current;
636
- if (b.pointerId !== a.pointerId)
636
+ if (b.pointerId !== o.pointerId)
637
637
  return;
638
- document.removeEventListener("pointermove", nt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
638
+ document.removeEventListener("pointermove", rt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
639
639
  const R = b.captureTarget;
640
- if (R?.hasPointerCapture?.(a.pointerId) && R.releasePointerCapture(a.pointerId), O.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ut(!1), D.current) {
640
+ if (R?.hasPointerCapture?.(o.pointerId) && R.releasePointerCapture(o.pointerId), O.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, ft(!1), D.current) {
641
641
  const L = D.current.getBoundingClientRect();
642
- a.clientX >= L.left && a.clientX <= L.right && a.clientY >= L.top && a.clientY <= L.bottom || tt(!1);
642
+ o.clientX >= L.left && o.clientX <= L.right && o.clientY >= L.top && o.clientY <= L.bottom || tt(!1);
643
643
  } else
644
644
  tt(!1);
645
645
  },
646
- [nt]
646
+ [rt]
647
647
  );
648
648
  Y(() => () => {
649
- document.removeEventListener("pointermove", nt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
650
- }, [nt, zt]);
651
- const Te = T(0), ve = T(0), Wt = S(
652
- (a) => {
653
- const b = Math.max(Math.round(at.current.viewportSize / or), sr);
654
- ve.current !== a && (ve.current = a, Te.current = 0), xt(Te, a * b);
649
+ document.removeEventListener("pointermove", rt), document.removeEventListener("pointerup", zt), document.removeEventListener("pointercancel", zt);
650
+ }, [rt, zt]);
651
+ const Te = T(0), Se = T(0), Kt = v(
652
+ (o) => {
653
+ const b = Math.max(Math.round(lt.current.viewportSize / or), sr);
654
+ Se.current !== o && (Se.current = o, Te.current = 0), Lt(Te, o * b);
655
655
  },
656
- [xt]
657
- ), { handleArrowPointerDown: ye, handleArrowPointerUp: fe, handleArrowKeyDown: Ae } = pr({
658
- canUseArrowButtons: g,
656
+ [Lt]
657
+ ), { handleArrowPointerDown: ye, handleArrowPointerUp: me, handleArrowKeyDown: Ae } = pr({
658
+ canUseArrowButtons: Qt,
659
659
  enableArrowButtons: l,
660
- resetTapScroll: vt,
661
- scrollByStep: Wt
662
- }), te = (a) => {
663
- if (!ct)
660
+ resetTapScroll: _t,
661
+ scrollByStep: Kt
662
+ }), te = (o) => {
663
+ if (!dt)
664
664
  return;
665
665
  if (!i) {
666
- a.preventDefault(), a.stopPropagation();
666
+ o.preventDefault(), o.stopPropagation();
667
667
  return;
668
668
  }
669
- if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
669
+ if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
670
670
  return;
671
- vt();
672
- const b = a.currentTarget, R = Ie(b);
671
+ _t();
672
+ const b = o.currentTarget, R = Ie(b);
673
673
  let L = null;
674
674
  if (b.setPointerCapture)
675
675
  try {
676
- b.setPointerCapture(a.pointerId), L = b;
676
+ b.setPointerCapture(o.pointerId), L = b;
677
677
  } catch {
678
678
  L = null;
679
679
  }
680
680
  O.current = {
681
- pointerId: a.pointerId,
682
- startThumbPosition: $t,
683
- startClientX: a.clientX,
684
- startClientY: a.clientY,
681
+ pointerId: o.pointerId,
682
+ startThumbPosition: qt,
683
+ startClientX: o.clientX,
684
+ startClientY: o.clientY,
685
685
  scale: R,
686
686
  captureTarget: L
687
- }, document.addEventListener("pointermove", nt), document.addEventListener("pointerup", zt), document.addEventListener("pointercancel", zt), ut(!0), tt(!0), a.preventDefault(), a.stopPropagation();
688
- }, se = (a) => {
689
- if (!ct)
687
+ }, document.addEventListener("pointermove", rt), document.addEventListener("pointerup", zt), document.addEventListener("pointercancel", zt), ft(!0), tt(!0), o.preventDefault(), o.stopPropagation();
688
+ }, ie = (o) => {
689
+ if (!dt)
690
690
  return;
691
691
  if (!s) {
692
- a.preventDefault(), a.stopPropagation();
692
+ o.preventDefault(), o.stopPropagation();
693
693
  return;
694
694
  }
695
- if (a.pointerType === "mouse" && a.button !== 0 || a.ctrlKey)
695
+ if (o.pointerType === "mouse" && o.button !== 0 || o.ctrlKey)
696
696
  return;
697
- const b = a.currentTarget, R = b.getBoundingClientRect(), L = H(a), X = Ie(b), o = (L - (c ? R.left : R.top)) / X;
698
- vt();
699
- const u = o - ft / 2, m = xe(u);
700
- if (bt(m), b.setPointerCapture)
697
+ const b = o.currentTarget, R = b.getBoundingClientRect(), L = H(o), X = Ie(b), a = (L - (c ? R.left : R.top)) / X;
698
+ _t();
699
+ const u = a - ut / 2, p = ce(u);
700
+ if (y(p), b.setPointerCapture)
701
701
  try {
702
- b.setPointerCapture(a.pointerId);
702
+ b.setPointerCapture(o.pointerId);
703
703
  } catch {
704
704
  }
705
- P.current = {
706
- pointerId: a.pointerId,
705
+ M.current = {
706
+ pointerId: o.pointerId,
707
707
  startThumbPosition: u,
708
- startClientX: a.clientX,
709
- startClientY: a.clientY,
708
+ startClientX: o.clientX,
709
+ startClientY: o.clientY,
710
710
  scale: X
711
- }, a.preventDefault(), a.stopPropagation();
712
- }, Kt = () => {
713
- P.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
- }, ee = (a) => {
715
- const b = P.current;
716
- if (b.pointerId !== a.pointerId)
711
+ }, o.preventDefault(), o.stopPropagation();
712
+ }, Ut = () => {
713
+ M.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
+ }, ee = (o) => {
715
+ const b = M.current;
716
+ if (b.pointerId !== o.pointerId)
717
717
  return;
718
- if (a.pointerType === "mouse" && a.buttons === 0) {
719
- Kt();
718
+ if (o.pointerType === "mouse" && o.buttons === 0) {
719
+ Ut();
720
720
  return;
721
721
  }
722
- const R = a.clientX - b.startClientX, L = a.clientY - b.startClientY, X = lt(R, L) / (b.scale || 1), o = xe(b.startThumbPosition + X);
723
- bt(o), a.cancelable && a.preventDefault();
724
- }, oe = (a) => {
725
- if (P.current.pointerId !== a.pointerId)
722
+ const R = o.clientX - b.startClientX, L = o.clientY - b.startClientY, X = ct(R, L) / (b.scale || 1), a = ce(b.startThumbPosition + X);
723
+ y(a), o.cancelable && o.preventDefault();
724
+ }, se = (o) => {
725
+ if (M.current.pointerId !== o.pointerId)
726
726
  return;
727
- const b = a.currentTarget;
728
- b.hasPointerCapture?.(a.pointerId) && b.releasePointerCapture(a.pointerId), Kt(), a.preventDefault(), a.stopPropagation();
729
- }, me = (a) => {
730
- if (P.current.pointerId !== a.pointerId)
727
+ const b = o.currentTarget;
728
+ b.hasPointerCapture?.(o.pointerId) && b.releasePointerCapture(o.pointerId), Ut(), o.preventDefault(), o.stopPropagation();
729
+ }, pe = (o) => {
730
+ if (M.current.pointerId !== o.pointerId)
731
731
  return;
732
- const b = a.currentTarget;
733
- b.hasPointerCapture?.(a.pointerId) && b.releasePointerCapture(a.pointerId), Kt();
734
- }, re = (a) => {
735
- P.current.pointerId === a.pointerId && Kt();
736
- }, we = At(() => It((mt ? 1 : 0.8) * Xt, 0, 1), [mt, Xt]), Re = At(() => {
737
- const b = `calc(50% - ${Ct / 2}px + ${Et}px)`;
732
+ const b = o.currentTarget;
733
+ b.hasPointerCapture?.(o.pointerId) && b.releasePointerCapture(o.pointerId), Ut();
734
+ }, re = (o) => {
735
+ o.target === o.currentTarget && M.current.pointerId === o.pointerId && Ut();
736
+ }, we = At(() => xt((pt ? 1 : 0.8) * $t, 0, 1), [pt, $t]), Re = At(() => {
737
+ const b = `calc(50% - ${Rt / 2}px + ${Ct}px)`;
738
738
  return {
739
739
  left: U,
740
740
  top: b
741
741
  };
742
- }, [U, Et, Ct]), Ce = (a, b, R, L) => /* @__PURE__ */ st(
742
+ }, [U, Ct, Rt]), Ce = (o, b, R, L) => /* @__PURE__ */ it(
743
743
  "button",
744
744
  {
745
745
  type: "button",
746
746
  tabIndex: 0,
747
747
  className: "aqvs-scrollbar-arrow-button",
748
748
  style: {
749
- [jt]: d,
750
- [f]: d
749
+ [Wt]: f,
750
+ [d]: f
751
751
  },
752
752
  "aria-label": b,
753
- onPointerDown: ye(a),
754
- onPointerUp: fe,
755
- onPointerLeave: fe,
756
- onPointerCancel: fe,
757
- onKeyDown: Ae(a),
753
+ onPointerDown: ye(o),
754
+ onPointerUp: me,
755
+ onPointerLeave: me,
756
+ onPointerCancel: me,
757
+ onKeyDown: Ae(o),
758
758
  "aria-disabled": !l,
759
- disabled: !g,
760
- children: /* @__PURE__ */ st("span", { "aria-hidden": "true", children: R })
759
+ disabled: !Qt,
760
+ children: /* @__PURE__ */ it("span", { "aria-hidden": "true", children: R })
761
761
  },
762
762
  L
763
- ), pe = h && ct ? {
764
- orientation: wt,
763
+ ), he = g && dt ? {
764
+ orientation: Mt,
765
765
  scrollPosition: e,
766
766
  maxScrollPosition: ot,
767
767
  contentSize: n,
768
768
  viewportSize: t,
769
- thumbSize: ft,
770
- thumbPosition: $t,
771
- thumbCenter: Qt,
772
- trackSize: Dt,
769
+ thumbSize: ut,
770
+ thumbPosition: qt,
771
+ thumbCenter: le,
772
+ trackSize: St,
773
773
  isDragging: j,
774
- isTapScrollActive: mt,
774
+ isTapScrollActive: pt,
775
775
  visibleStartIndex: _,
776
776
  visibleEndIndex: z
777
777
  } : null;
778
- return /* @__PURE__ */ ue(
778
+ return /* @__PURE__ */ de(
779
779
  "div",
780
780
  {
781
- className: ce("aqvs-scrollbar", yt, !ct && "pointer-events-none opacity-0", x),
781
+ className: ue("aqvs-scrollbar", Pt, !dt && "pointer-events-none opacity-0", x),
782
782
  style: {
783
- [jt]: t,
784
- [f]: d
783
+ [Wt]: t,
784
+ [d]: f
785
785
  },
786
786
  role: "scrollbar",
787
787
  tabIndex: -1,
@@ -791,43 +791,43 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
791
791
  "aria-valuemax": ot,
792
792
  "aria-orientation": c ? "horizontal" : "vertical",
793
793
  children: [
794
- !c && ct && k && /* @__PURE__ */ st(
794
+ !c && dt && k && /* @__PURE__ */ it(
795
795
  Ge,
796
796
  {
797
797
  ref: et,
798
- className: ce("aqvs-scrollbar-tap-circle-wrapper", y),
799
- size: Ct,
800
- maxVisualDistance: Nt,
798
+ className: ue("aqvs-scrollbar-tap-circle-wrapper", w),
799
+ size: Rt,
800
+ maxVisualDistance: Et,
801
801
  style: Re,
802
802
  opacity: we,
803
803
  renderVisual: Bt,
804
- onDragChange: ie
804
+ onDragChange: jt
805
805
  },
806
806
  "tap-circle"
807
807
  ),
808
- Ce(-1, it[0], J[0], "arrow-start"),
809
- /* @__PURE__ */ ue(
808
+ Ce(-1, nt[0], J[0], "arrow-start"),
809
+ /* @__PURE__ */ de(
810
810
  "div",
811
811
  {
812
812
  className: "aqvs-scrollbar-track",
813
813
  style: {
814
- borderRadius: d / 2
814
+ borderRadius: f / 2
815
815
  },
816
- onPointerDown: se,
816
+ onPointerDown: ie,
817
817
  onPointerMove: ee,
818
- onPointerUp: oe,
819
- onPointerCancel: me,
818
+ onPointerUp: se,
819
+ onPointerCancel: pe,
820
820
  onLostPointerCapture: re,
821
821
  "aria-disabled": !s,
822
822
  children: [
823
- pe && /* @__PURE__ */ st("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(pe) }, "overlay"),
824
- /* @__PURE__ */ st(
823
+ he && /* @__PURE__ */ it("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: g?.(he) }, "overlay"),
824
+ /* @__PURE__ */ it(
825
825
  "div",
826
826
  {
827
- className: ce("aqvs-scrollbar-thumb-wrapper", !(ct || j) && "pointer-events-none opacity-0"),
827
+ className: ue("aqvs-scrollbar-thumb-wrapper", !(dt || j) && "pointer-events-none opacity-0"),
828
828
  style: {
829
- [jt]: ft,
830
- [dt]: $t,
829
+ [Wt]: ut,
830
+ [mt]: qt,
831
831
  ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
832
832
  },
833
833
  onPointerDown: te,
@@ -838,15 +838,15 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
838
838
  "aria-valuemax": ot,
839
839
  "aria-disabled": !i,
840
840
  tabIndex: -1,
841
- children: /* @__PURE__ */ st(
841
+ children: /* @__PURE__ */ it(
842
842
  "div",
843
843
  {
844
844
  ref: D,
845
- className: ce("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
845
+ className: ue("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
846
846
  "data-testid": "aqvs-scrollbar-thumb",
847
- "data-thumb-state": w,
847
+ "data-thumb-state": m,
848
848
  style: {
849
- borderRadius: d - 1,
849
+ borderRadius: f - 1,
850
850
  cursor: i ? "pointer" : "default"
851
851
  },
852
852
  onMouseEnter: () => {
@@ -865,11 +865,11 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
865
865
  },
866
866
  "track"
867
867
  ),
868
- Ce(1, it[1], J[1], "arrow-end")
868
+ Ce(1, nt[1], J[1], "arrow-end")
869
869
  ]
870
870
  }
871
871
  );
872
- }, Ir = ["mouse", "pen", "touch"], ke = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Me = {
872
+ }, Ir = ["mouse", "pen", "touch"], ke = (n, t) => !(n === "mouse" || n === "pen" || n === "touch") || t.includes(n), Tr = (n) => n === "mouse" || n === "pen", Pe = {
873
873
  maxVelocity: 6,
874
874
  minVelocity: 0.02,
875
875
  deceleration: 25e-4,
@@ -878,7 +878,7 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
878
878
  }, Ee = (n, t, e) => {
879
879
  for (const [r, i, s] of t)
880
880
  e === "add" ? n.addEventListener(r, i, s) : n.removeEventListener(r, i, s);
881
- }, Tr = Ye(
881
+ }, Sr = Ye(
882
882
  ({
883
883
  children: n,
884
884
  contentSize: t,
@@ -888,46 +888,46 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
888
888
  enableTrackClick: s = !0,
889
889
  enableArrowButtons: l = !0,
890
890
  enablePointerDrag: c = !0,
891
- pointerDragInputs: d = Ir,
891
+ pointerDragInputs: f = Ir,
892
892
  onScroll: x,
893
893
  className: I,
894
- testId: M,
894
+ testId: P,
895
895
  style: E,
896
- background: h,
896
+ background: g,
897
897
  tapScrollCircleOptions: _,
898
898
  inertiaOptions: z,
899
899
  itemCount: j,
900
- renderThumbOverlay: ut,
900
+ renderThumbOverlay: ft,
901
901
  wheelSpeedMultiplier: Q = 1,
902
902
  onWheelHorizontal: tt,
903
- contentInsets: mt,
904
- visibleStartIndex: Tt,
903
+ contentInsets: pt,
904
+ visibleStartIndex: It,
905
905
  visibleEndIndex: D,
906
906
  renderOverlay: O,
907
- initialScrollPosition: P = 0
907
+ initialScrollPosition: M = 0
908
908
  }, B) => {
909
- const N = T(Number.isFinite(P) ? Math.max(0, P) : 0), q = T(null), et = T(null), G = T(tt);
909
+ const N = T(Number.isFinite(M) ? Math.max(0, M) : 0), q = T(null), et = T(null), G = T(tt);
910
910
  Y(() => {
911
911
  G.current = tt;
912
912
  }, [tt]);
913
- const p = T({
913
+ const h = T({
914
914
  frame: null,
915
915
  velocity: 0,
916
916
  lastTimestamp: null,
917
917
  generation: 0
918
918
  }), $ = At(
919
919
  () => ({
920
- maxVelocity: z?.maxVelocity ?? Me.maxVelocity,
921
- minVelocity: z?.minVelocity ?? Me.minVelocity,
922
- deceleration: z?.deceleration ?? Me.deceleration,
923
- velocitySampleWindow: z?.velocitySampleWindow ?? Me.velocitySampleWindow,
924
- startVelocityThreshold: z?.startVelocityThreshold ?? Me.startVelocityThreshold
920
+ maxVelocity: z?.maxVelocity ?? Pe.maxVelocity,
921
+ minVelocity: z?.minVelocity ?? Pe.minVelocity,
922
+ deceleration: z?.deceleration ?? Pe.deceleration,
923
+ velocitySampleWindow: z?.velocitySampleWindow ?? Pe.velocitySampleWindow,
924
+ startVelocityThreshold: z?.startVelocityThreshold ?? Pe.startVelocityThreshold
925
925
  }),
926
926
  [z]
927
- ), St = At(() => ({
928
- top: Math.max(0, mt?.top ?? 0),
929
- bottom: Math.max(0, mt?.bottom ?? 0)
930
- }), [mt]);
927
+ ), Tt = At(() => ({
928
+ top: Math.max(0, pt?.top ?? 0),
929
+ bottom: Math.max(0, pt?.bottom ?? 0)
930
+ }), [pt]);
931
931
  C.debug("[ScrollPane] ScrollPane rendered", () => ({
932
932
  contentSize: t,
933
933
  viewportSize: e,
@@ -937,129 +937,129 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
937
937
  tapScrollCircleOptions: _,
938
938
  inertiaOptions: z,
939
939
  enablePointerDrag: c,
940
- contentInsets: St
940
+ contentInsets: Tt
941
941
  }));
942
- const Rt = T({ contentSize: t, viewportSize: e });
943
- Rt.current = { contentSize: t, viewportSize: e };
944
- const Z = At(() => t > e, [t, e]), k = S(
945
- (f) => {
946
- const { contentSize: dt, viewportSize: lt } = Rt.current, H = dt > lt, it = N.current;
947
- if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: f, contentSize: dt, viewportSize: lt, currentIsScrollable: H, prevPosition: it })), !H)
948
- return N.current !== 0 && (N.current = 0, x?.(0, it)), N.current;
949
- const J = typeof f == "function" ? f(N.current) : f;
942
+ const wt = T({ contentSize: t, viewportSize: e });
943
+ wt.current = { contentSize: t, viewportSize: e };
944
+ const Z = At(() => t > e, [t, e]), k = v(
945
+ (d) => {
946
+ const { contentSize: mt, viewportSize: ct } = wt.current, H = mt > ct, nt = N.current;
947
+ if (C.debug("[ScrollPane] scrollTo called", () => ({ newPosition: d, contentSize: mt, viewportSize: ct, currentIsScrollable: H, prevPosition: nt })), !H)
948
+ return N.current !== 0 && (N.current = 0, x?.(0, nt)), N.current;
949
+ const J = typeof d == "function" ? d(N.current) : d;
950
950
  if (!Number.isFinite(J))
951
951
  return C.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: J }), N.current;
952
- const yt = Math.max(dt - lt, 0), wt = It(J, 0, yt);
953
- return N.current !== wt && (N.current = wt, x?.(wt, it)), N.current;
952
+ const Pt = Math.max(mt - ct, 0), Mt = xt(J, 0, Pt);
953
+ return N.current !== Mt && (N.current = Mt, x?.(Mt, nt)), N.current;
954
954
  },
955
955
  [x]
956
- ), Ct = T(k);
956
+ ), Rt = T(k);
957
957
  Y(() => {
958
- Ct.current = k;
958
+ Rt.current = k;
959
959
  }, [k]);
960
- const U = S(() => {
961
- const f = p.current;
962
- f.generation += 1, f.frame !== null && cancelAnimationFrame(f.frame), f.frame = null, f.velocity = 0, f.lastTimestamp = null;
963
- }, []), Et = T(U);
960
+ const U = v(() => {
961
+ const d = h.current;
962
+ d.generation += 1, d.frame !== null && cancelAnimationFrame(d.frame), d.frame = null, d.velocity = 0, d.lastTimestamp = null;
963
+ }, []), Ct = T(U);
964
964
  Y(() => {
965
- Et.current = U;
965
+ Ct.current = U;
966
966
  }, [U]), Y(() => () => {
967
- Et.current();
967
+ Ct.current();
968
968
  }, []);
969
- const y = S(
970
- (f) => {
969
+ const w = v(
970
+ (d) => {
971
971
  if (!Z)
972
972
  return;
973
- const { maxVelocity: dt, minVelocity: lt, deceleration: H, startVelocityThreshold: it } = $, J = It(f, -dt, dt);
974
- if (Math.abs(J) < it)
973
+ const { maxVelocity: mt, minVelocity: ct, deceleration: H, startVelocityThreshold: nt } = $, J = xt(d, -mt, mt);
974
+ if (Math.abs(J) < nt)
975
975
  return;
976
- U(), p.current.velocity = J, p.current.lastTimestamp = null;
977
- const yt = p.current.generation, wt = (Nt) => {
978
- const rt = p.current;
979
- if (rt.generation !== yt)
976
+ U(), h.current.velocity = J, h.current.lastTimestamp = null;
977
+ const Pt = h.current.generation, Mt = (Et) => {
978
+ const st = h.current;
979
+ if (st.generation !== Pt)
980
980
  return;
981
- if (rt.lastTimestamp === null) {
982
- rt.lastTimestamp = Nt, rt.frame = requestAnimationFrame(wt);
981
+ if (st.lastTimestamp === null) {
982
+ st.lastTimestamp = Et, st.frame = requestAnimationFrame(Mt);
983
983
  return;
984
984
  }
985
- const Dt = Nt - rt.lastTimestamp;
986
- if (rt.lastTimestamp = Nt, Dt <= 0) {
987
- rt.frame = requestAnimationFrame(wt);
985
+ const St = Et - st.lastTimestamp;
986
+ if (st.lastTimestamp = Et, St <= 0) {
987
+ st.frame = requestAnimationFrame(Mt);
988
988
  return;
989
989
  }
990
- const Mt = rt.velocity;
991
- let ft = Mt;
992
- const ot = H * Dt;
993
- Mt > 0 ? ft = Math.max(0, Mt - ot) : Mt < 0 && (ft = Math.min(0, Mt + ot));
994
- const $t = (Mt + ft) / 2 * Dt, Qt = N.current;
995
- if ($t !== 0 && Ct.current((xt) => xt + $t), p.current.generation !== yt)
990
+ const yt = st.velocity;
991
+ let ut = yt;
992
+ const ot = H * St;
993
+ yt > 0 ? ut = Math.max(0, yt - ot) : yt < 0 && (ut = Math.min(0, yt + ot));
994
+ const qt = (yt + ut) / 2 * St, le = N.current;
995
+ if (qt !== 0 && Rt.current((Lt) => Lt + qt), h.current.generation !== Pt)
996
996
  return;
997
- const ct = N.current, { contentSize: g, viewportSize: w } = Rt.current, bt = Math.max(g - w, 0);
998
- rt.velocity = ft;
999
- const qt = ct === Qt || ct <= 0 && ft <= 0 || ct >= bt && ft >= 0;
1000
- if (Math.abs(ft) < lt || qt) {
997
+ const dt = N.current, { contentSize: Qt, viewportSize: m } = wt.current, y = Math.max(Qt - m, 0);
998
+ st.velocity = ut;
999
+ const Nt = dt === le || dt <= 0 && ut <= 0 || dt >= y && ut >= 0;
1000
+ if (Math.abs(ut) < ct || Nt) {
1001
1001
  U();
1002
1002
  return;
1003
1003
  }
1004
- rt.frame = requestAnimationFrame(wt);
1004
+ st.frame = requestAnimationFrame(Mt);
1005
1005
  };
1006
- p.current.frame = requestAnimationFrame(wt);
1006
+ h.current.frame = requestAnimationFrame(Mt);
1007
1007
  },
1008
1008
  [Z, $, U]
1009
- ), Yt = T(y);
1009
+ ), Yt = T(w);
1010
1010
  Y(() => {
1011
- Yt.current = y;
1012
- }, [y]), be(() => {
1013
- Rt.current = { contentSize: t, viewportSize: e };
1014
- }, [t, e]), be(() => {
1015
- const f = et.current;
1016
- if (!f) return;
1017
- const dt = () => {
1018
- f.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: f.scrollTop })), f.scrollTop = 0), f.scrollLeft !== 0 && (f.scrollLeft = 0);
1011
+ Yt.current = w;
1012
+ }, [w]), xe(() => {
1013
+ wt.current = { contentSize: t, viewportSize: e };
1014
+ }, [t, e]), xe(() => {
1015
+ const d = et.current;
1016
+ if (!d) return;
1017
+ const mt = () => {
1018
+ d.scrollTop !== 0 && (C.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: d.scrollTop })), d.scrollTop = 0), d.scrollLeft !== 0 && (d.scrollLeft = 0);
1019
1019
  };
1020
- return f.addEventListener("scroll", dt), () => f.removeEventListener("scroll", dt);
1021
- }, []), be(() => {
1020
+ return d.addEventListener("scroll", mt), () => d.removeEventListener("scroll", mt);
1021
+ }, []), xe(() => {
1022
1022
  if (Z) {
1023
1023
  C.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: t, viewportSize: e, scrollPosition: N.current }));
1024
- const f = It(t - e, 0, t);
1025
- N.current > f && k(f);
1024
+ const d = xt(t - e, 0, t);
1025
+ N.current > d && k(d);
1026
1026
  } else
1027
1027
  k(0);
1028
1028
  }, [Z, k, t, e]), Y(() => {
1029
- const f = (H) => {
1029
+ const d = (H) => {
1030
1030
  if (H.ctrlKey)
1031
1031
  return;
1032
- const it = H.shiftKey && H.deltaX === 0, J = it ? H.deltaY : H.deltaX, yt = it ? 0 : H.deltaY;
1033
- if (J !== 0 && Math.abs(J) >= Math.abs(yt)) {
1032
+ const nt = H.shiftKey && H.deltaX === 0, J = nt ? H.deltaY : H.deltaX, Pt = nt ? 0 : H.deltaY;
1033
+ if (J !== 0 && Math.abs(J) >= Math.abs(Pt)) {
1034
1034
  if (G.current) {
1035
1035
  H.preventDefault(), U();
1036
- let rt = J;
1037
- H.deltaMode === 1 ? rt *= 16 : H.deltaMode === 2 && (rt *= e), G.current(rt);
1036
+ let st = J;
1037
+ H.deltaMode === 1 ? st *= 16 : H.deltaMode === 2 && (st *= e), G.current(st);
1038
1038
  }
1039
1039
  return;
1040
1040
  }
1041
1041
  if (!Z || H.deltaY === 0)
1042
1042
  return;
1043
1043
  H.preventDefault(), U();
1044
- let Nt = H.deltaY;
1045
- H.deltaMode === 1 ? Nt *= 16 : H.deltaMode === 2 && (Nt *= e), Q !== 1 && (Nt *= Q), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Nt, scrollPosition: N.current, wheelSpeedMultiplier: Q, deltaMode: H.deltaMode, scrollTop: et.current?.scrollTop })), k((rt) => rt + Nt);
1046
- }, dt = () => {
1044
+ let Et = H.deltaY;
1045
+ H.deltaMode === 1 ? Et *= 16 : H.deltaMode === 2 && (Et *= e), Q !== 1 && (Et *= Q), C.debug("[ScrollPane] wheel event", () => ({ deltaY: Et, scrollPosition: N.current, wheelSpeedMultiplier: Q, deltaMode: H.deltaMode, scrollTop: et.current?.scrollTop })), k((st) => st + Et);
1046
+ }, mt = () => {
1047
1047
  U();
1048
- }, lt = q.current;
1049
- return lt && (lt.addEventListener("wheel", f, { passive: !1 }), lt.addEventListener("pointerdown", dt, { capture: !0, passive: !0 })), () => {
1050
- lt && (lt.removeEventListener("wheel", f), lt.removeEventListener("pointerdown", dt, { capture: !0 }));
1048
+ }, ct = q.current;
1049
+ return ct && (ct.addEventListener("wheel", d, { passive: !1 }), ct.addEventListener("pointerdown", mt, { capture: !0, passive: !0 })), () => {
1050
+ ct && (ct.removeEventListener("wheel", d), ct.removeEventListener("pointerdown", mt, { capture: !0 }));
1051
1051
  };
1052
1052
  }, [Z, k, U, e, Q]), Be(
1053
1053
  B,
1054
1054
  () => ({
1055
- scrollTo: (f) => (U(), k(f)),
1055
+ scrollTo: (d) => (U(), k(d)),
1056
1056
  getScrollPosition: () => N.current,
1057
1057
  getContentSize: () => t,
1058
1058
  getViewportSize: () => e
1059
1059
  }),
1060
1060
  [k, t, e, U]
1061
1061
  );
1062
- const Ht = tr(), v = T({
1062
+ const Xt = tr(), S = T({
1063
1063
  pointerType: "",
1064
1064
  pointerId: null,
1065
1065
  startClientY: 0,
@@ -1068,171 +1068,185 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1068
1068
  shouldCancelNextClick: !1,
1069
1069
  clickResetTimer: null,
1070
1070
  velocitySamples: []
1071
- }), Xt = T(c), Bt = T(d);
1071
+ }), $t = T(c), Bt = T(f);
1072
1072
  Y(() => {
1073
- Xt.current = c;
1073
+ $t.current = c;
1074
1074
  }, [c]), Y(() => {
1075
- Bt.current = d;
1076
- }, [d]);
1075
+ Bt.current = f;
1076
+ }, [f]);
1077
1077
  const Jt = T(Z);
1078
1078
  Y(() => {
1079
1079
  Jt.current = Z;
1080
1080
  }, [Z]);
1081
- const at = T($);
1081
+ const lt = T($);
1082
1082
  Y(() => {
1083
- at.current = $;
1083
+ lt.current = $;
1084
1084
  }, [$]), Y(() => {
1085
- const f = v.current;
1086
- if (c && Z && (f.pointerId === null || ke(f.pointerType, d)) || f.pointerId === null)
1085
+ const d = S.current;
1086
+ if (c && Z && (d.pointerId === null || ke(d.pointerType, f)) || d.pointerId === null)
1087
1087
  return;
1088
- const dt = et.current;
1089
- f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1090
- const lt = f.isDragging && f.shouldCancelNextClick, H = f.pointerId;
1091
- f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.shouldCancelNextClick = lt, f.velocitySamples = [], dt?.hasPointerCapture(H) && dt.releasePointerCapture(H);
1092
- }, [c, d, Z]), Y(() => {
1093
- const f = et.current;
1094
- if (!f)
1088
+ const mt = et.current;
1089
+ d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
1090
+ const ct = d.isDragging && d.shouldCancelNextClick, H = d.pointerId;
1091
+ d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.shouldCancelNextClick = ct, d.velocitySamples = [], mt?.hasPointerCapture(H) && mt.releasePointerCapture(H);
1092
+ }, [c, f, Z]), Y(() => {
1093
+ const d = et.current;
1094
+ if (!d)
1095
1095
  return;
1096
- const dt = 6, lt = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), H = () => {
1097
- const g = v.current;
1098
- g.pointerId = null, g.pointerType = "", g.startClientY = 0, g.startScroll = 0, g.isDragging = !1, g.velocitySamples = [];
1099
- }, it = () => {
1100
- const g = v.current;
1101
- g.clickResetTimer !== null && (window.clearTimeout(g.clickResetTimer), g.clickResetTimer = null);
1102
- }, J = (g) => {
1103
- const w = v.current, bt = lt();
1104
- w.velocitySamples.push({ clientY: g, time: bt });
1105
- const qt = at.current.velocitySampleWindow;
1106
- w.velocitySamples = w.velocitySamples.filter((xt) => bt - xt.time <= qt);
1107
- }, yt = (g) => g instanceof HTMLElement && g.closest("[data-scrollpane-ignore-drag='true']") !== null, wt = (g) => {
1108
- const w = v.current;
1109
- w.shouldCancelNextClick && (g.preventDefault(), g.stopPropagation(), w.shouldCancelNextClick = !1);
1110
- }, Nt = (g) => {
1111
- const w = v.current;
1112
- if (!w.isDragging) {
1113
- if (w.isDragging = !0, w.shouldCancelNextClick = !0, !f.hasPointerCapture(g.pointerId))
1096
+ const mt = 6, ct = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), H = () => {
1097
+ const m = S.current;
1098
+ m.pointerId = null, m.pointerType = "", m.startClientY = 0, m.startScroll = 0, m.isDragging = !1, m.velocitySamples = [];
1099
+ }, nt = () => {
1100
+ const m = S.current;
1101
+ m.clickResetTimer !== null && (window.clearTimeout(m.clickResetTimer), m.clickResetTimer = null);
1102
+ }, J = (m) => {
1103
+ const y = S.current, Nt = ct();
1104
+ y.velocitySamples.push({ clientY: m, time: Nt });
1105
+ const Lt = lt.current.velocitySampleWindow;
1106
+ y.velocitySamples = y.velocitySamples.filter((at) => Nt - at.time <= Lt);
1107
+ }, Pt = (m) => m instanceof HTMLElement && m.closest("[data-scrollpane-ignore-drag='true']") !== null, Mt = (m) => {
1108
+ const y = S.current;
1109
+ y.shouldCancelNextClick && (m.preventDefault(), m.stopPropagation(), y.shouldCancelNextClick = !1);
1110
+ }, Et = (m) => {
1111
+ const y = S.current;
1112
+ if (!y.isDragging) {
1113
+ if (y.isDragging = !0, y.shouldCancelNextClick = !0, !d.hasPointerCapture(m.pointerId))
1114
1114
  try {
1115
- f.setPointerCapture(g.pointerId);
1115
+ d.setPointerCapture(m.pointerId);
1116
1116
  } catch {
1117
1117
  }
1118
- J(g.clientY);
1118
+ J(m.clientY);
1119
1119
  }
1120
- }, rt = (g) => {
1121
- const w = v.current;
1122
- f.hasPointerCapture(g) && f.releasePointerCapture(g), w.shouldCancelNextClick = !1, it(), H();
1123
- }, Dt = (g) => {
1124
- const w = v.current;
1125
- if (w.pointerId !== g.pointerId)
1120
+ }, st = (m) => m.isTrusted || m.target === d, St = (m) => {
1121
+ const y = S.current;
1122
+ d.hasPointerCapture(m) && d.releasePointerCapture(m), y.shouldCancelNextClick = !1, nt(), H();
1123
+ }, yt = (m) => {
1124
+ const y = S.current;
1125
+ if (y.pointerId !== m.pointerId)
1126
1126
  return;
1127
- if (g.buttons === 0) {
1128
- rt(g.pointerId);
1127
+ if (m.buttons === 0 && Tr(m.pointerType)) {
1128
+ St(m.pointerId);
1129
1129
  return;
1130
1130
  }
1131
- if (!(Xt.current && Jt.current) || !ke(g.pointerType, Bt.current) || !w.isDragging && (Math.abs(g.clientY - w.startClientY) < dt || (Nt(g), !w.isDragging)))
1131
+ if (!($t.current && Jt.current) || !ke(m.pointerType, Bt.current) || !y.isDragging && (Math.abs(m.clientY - y.startClientY) < mt || (Et(m), !y.isDragging)))
1132
1132
  return;
1133
- J(g.clientY);
1134
- const bt = g.clientY - w.startClientY, qt = w.startScroll - bt;
1135
- Ct.current(qt), g.cancelable && g.preventDefault();
1136
- }, Mt = () => {
1137
- const g = v.current;
1138
- return g.pointerId !== null || !g.shouldCancelNextClick ? !1 : (it(), g.clickResetTimer = window.setTimeout(() => {
1139
- const w = v.current;
1140
- w.shouldCancelNextClick = !1, w.clickResetTimer = null;
1133
+ J(m.clientY);
1134
+ const Nt = m.clientY - y.startClientY, Lt = y.startScroll - Nt;
1135
+ Rt.current(Lt), m.cancelable && m.preventDefault();
1136
+ }, ut = () => {
1137
+ const m = S.current;
1138
+ return m.pointerId !== null || !m.shouldCancelNextClick ? !1 : (nt(), m.clickResetTimer = window.setTimeout(() => {
1139
+ const y = S.current;
1140
+ y.shouldCancelNextClick = !1, y.clickResetTimer = null;
1141
1141
  }, 0), !0);
1142
- }, ft = (g) => {
1143
- const w = v.current;
1144
- if (w.pointerId !== g.pointerId) {
1145
- Mt();
1142
+ }, ot = (m) => {
1143
+ const y = S.current;
1144
+ if (y.pointerId !== m.pointerId) {
1145
+ ut();
1146
1146
  return;
1147
1147
  }
1148
- w.isDragging && w.shouldCancelNextClick && g.cancelable && (g.preventDefault(), g.stopPropagation()), w.isDragging && J(g.clientY);
1149
- let bt = 0;
1150
- if (w.isDragging && w.velocitySamples.length >= 2) {
1151
- const xt = w.velocitySamples, _t = at.current.velocitySampleWindow, vt = xt[xt.length - 1], Ut = xt.find((Ft) => vt.time - Ft.time <= _t) ?? xt[0];
1152
- if (vt && Ut && vt.time !== Ut.time) {
1153
- const Ft = vt.clientY - Ut.clientY, ie = vt.time - Ut.time;
1154
- bt = -(Ft / ie);
1148
+ y.isDragging && y.shouldCancelNextClick && m.cancelable && (m.preventDefault(), m.stopPropagation()), y.isDragging && J(m.clientY);
1149
+ let Nt = 0;
1150
+ if (y.isDragging && y.velocitySamples.length >= 2) {
1151
+ const at = y.velocitySamples, _t = lt.current.velocitySampleWindow, Ht = at[at.length - 1], kt = at.find((jt) => Ht.time - jt.time <= _t) ?? at[0];
1152
+ if (Ht && kt && Ht.time !== kt.time) {
1153
+ const jt = Ht.clientY - kt.clientY, ce = Ht.time - kt.time;
1154
+ Nt = -(jt / ce);
1155
1155
  }
1156
1156
  }
1157
- it(), w.shouldCancelNextClick && (w.clickResetTimer = window.setTimeout(() => {
1158
- const xt = v.current;
1159
- xt.shouldCancelNextClick = !1, xt.clickResetTimer = null;
1157
+ nt(), y.shouldCancelNextClick && (y.clickResetTimer = window.setTimeout(() => {
1158
+ const at = S.current;
1159
+ at.shouldCancelNextClick = !1, at.clickResetTimer = null;
1160
1160
  }, 0));
1161
- const qt = at.current.startVelocityThreshold;
1162
- H(), f.hasPointerCapture(g.pointerId) && f.releasePointerCapture(g.pointerId), Math.abs(bt) >= qt && Yt.current?.(bt);
1163
- }, ot = (g) => {
1164
- if (v.current.pointerId !== null || (v.current.shouldCancelNextClick && (it(), v.current.shouldCancelNextClick = !1), !(Xt.current && Jt.current)) || !ke(g.pointerType, Bt.current) || g.button !== 0 && g.pointerType === "mouse" || g.ctrlKey || g.metaKey || g.altKey || yt(g.target))
1161
+ const Lt = lt.current.startVelocityThreshold;
1162
+ H(), d.hasPointerCapture(m.pointerId) && d.releasePointerCapture(m.pointerId), Math.abs(Nt) >= Lt && Yt.current?.(Nt);
1163
+ }, Dt = (m) => {
1164
+ if (S.current.pointerId !== null) {
1165
+ if (!m.isPrimary || m.pointerType !== S.current.pointerType)
1166
+ return;
1167
+ St(S.current.pointerId);
1168
+ }
1169
+ if (S.current.shouldCancelNextClick && (nt(), S.current.shouldCancelNextClick = !1), !($t.current && Jt.current) || !ke(m.pointerType, Bt.current) || m.button !== 0 && m.pointerType === "mouse" || m.ctrlKey || m.metaKey || m.altKey || Pt(m.target))
1165
1170
  return;
1166
- window.dispatchEvent(new CustomEvent(ze, { detail: { paneId: Ht } })), Et.current?.();
1167
- const w = v.current;
1168
- it(), w.pointerId = g.pointerId, w.pointerType = g.pointerType, w.startClientY = g.clientY, w.startScroll = N.current, w.isDragging = !1, w.shouldCancelNextClick = !1, w.velocitySamples = [];
1169
- }, Lt = (g) => {
1170
- if (v.current.pointerId !== g.pointerId) {
1171
- Mt();
1171
+ window.dispatchEvent(new CustomEvent(ze, { detail: { paneId: Xt } })), Ct.current?.();
1172
+ const y = S.current;
1173
+ nt(), y.pointerId = m.pointerId, y.pointerType = m.pointerType, y.startClientY = m.clientY, y.startScroll = N.current, y.isDragging = !1, y.shouldCancelNextClick = !1, y.velocitySamples = [];
1174
+ }, qt = (m) => {
1175
+ if (S.current.pointerId !== m.pointerId) {
1176
+ ut();
1172
1177
  return;
1173
1178
  }
1174
- rt(g.pointerId);
1175
- }, Qt = [
1176
- ["click", wt, !0],
1177
- ["pointerdown", ot, { passive: !1 }],
1178
- ["lostpointercapture", (g) => {
1179
- v.current.pointerId === g.pointerId && rt(g.pointerId);
1179
+ st(m) && St(m.pointerId);
1180
+ }, dt = [
1181
+ ["click", Mt, !0],
1182
+ ["pointerdown", Dt, { passive: !1 }],
1183
+ ["lostpointercapture", (m) => {
1184
+ m.target !== d || S.current.pointerId !== m.pointerId || St(m.pointerId);
1180
1185
  }, void 0]
1181
- ], ct = [
1182
- ["pointermove", Dt, { passive: !1 }],
1183
- ["pointerup", ft, void 0],
1184
- ["pointercancel", Lt, void 0]
1186
+ ], Qt = [
1187
+ ["pointermove", yt, { passive: !1 }],
1188
+ ["pointerup", ot, void 0],
1189
+ ["pointercancel", qt, void 0]
1185
1190
  ];
1186
- return Ee(f, Qt, "add"), Ee(window, ct, "add"), () => {
1187
- Ee(f, Qt, "remove"), Ee(window, ct, "remove");
1188
- const g = v.current;
1189
- g.pointerId !== null && f.hasPointerCapture(g.pointerId) && f.releasePointerCapture(g.pointerId), it(), H();
1191
+ return Ee(d, dt, "add"), Ee(window, Qt, "add"), () => {
1192
+ Ee(d, dt, "remove"), Ee(window, Qt, "remove");
1193
+ const m = S.current;
1194
+ m.pointerId !== null && d.hasPointerCapture(m.pointerId) && d.releasePointerCapture(m.pointerId), nt(), H();
1190
1195
  };
1191
- }, [Ht]);
1192
- const jt = S(
1193
- (f) => (U(), k(f)),
1196
+ }, [Xt]);
1197
+ const Wt = v(
1198
+ (d) => (U(), k(d)),
1194
1199
  [k, U]
1195
1200
  );
1196
- return /* @__PURE__ */ ue("div", { ref: q, "data-testid": M, className: ce("aqvs-scroll-pane", I), style: E, children: [
1197
- /* @__PURE__ */ ue(
1201
+ return /* @__PURE__ */ de("div", { ref: q, "data-testid": P, className: ue("aqvs-scroll-pane", I), style: E, children: [
1202
+ /* @__PURE__ */ de(
1198
1203
  "div",
1199
1204
  {
1200
1205
  ref: et,
1201
- className: ce("aqvs-scroll-pane-content"),
1206
+ className: ue("aqvs-scroll-pane-content"),
1202
1207
  "data-testid": "aqvs-scroll-pane-content",
1203
1208
  style: {
1204
1209
  height: e,
1205
- paddingTop: St.top,
1206
- paddingBottom: St.bottom,
1210
+ paddingTop: Tt.top,
1211
+ paddingBottom: Tt.bottom,
1207
1212
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1208
1213
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1209
1214
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
1210
1215
  // touch-action はペン入力にも効くため、判定は touch と pen の論理和にする
1211
- ...c && Z && d.some((f) => f === "touch" || f === "pen") ? { touchAction: "none" } : {}
1216
+ //
1217
+ // ❗ この値はタッチ開始時にラッチされる (実測: 1ms 後に none へ変えても手遅れ)。
1218
+ // 中身が非同期に届くリストでは、「まだスクロール不能」な一瞬に指が着地すると
1219
+ // **そのジェスチャ 1 回分**はブラウザに接収されたまま戻らない。
1220
+ // 指を離して置き直せば次のジェスチャからは正常に効くため、損失は 1 ジェスチャに
1221
+ // 限られ恒久破損にはならない (実測で確認)。ドラッグ許可の判定 (isScrollable) と
1222
+ // 同一条件で揃えてあるため状態としても一貫している。
1223
+ // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1224
+ // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1225
+ ...c && Z && f.some((d) => d === "touch" || d === "pen") ? { touchAction: "none" } : {}
1212
1226
  },
1213
- id: Ht,
1227
+ id: Xt,
1214
1228
  children: [
1215
- h,
1229
+ g,
1216
1230
  n(N.current)
1217
1231
  ]
1218
1232
  }
1219
1233
  ),
1220
- /* @__PURE__ */ st(
1234
+ /* @__PURE__ */ it(
1221
1235
  xr,
1222
1236
  {
1223
1237
  contentSize: t,
1224
1238
  viewportSize: e,
1225
1239
  scrollPosition: N.current,
1226
- onScroll: jt,
1240
+ onScroll: Wt,
1227
1241
  enableThumbDrag: i,
1228
1242
  enableTrackClick: s,
1229
1243
  enableArrowButtons: l,
1230
1244
  scrollBarWidth: r,
1231
- ariaControls: Ht,
1245
+ ariaControls: Xt,
1232
1246
  tapScrollCircleOptions: _,
1233
1247
  itemCount: j,
1234
- renderThumbOverlay: ut,
1235
- visibleStartIndex: Tt,
1248
+ renderThumbOverlay: ft,
1249
+ visibleStartIndex: It,
1236
1250
  visibleEndIndex: D
1237
1251
  },
1238
1252
  "scrollbar"
@@ -1240,55 +1254,55 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1240
1254
  O?.()
1241
1255
  ] });
1242
1256
  }
1243
- ), $e = (n, t, e) => Math.min(Math.max(n, t), e), _r = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1244
- const i = Math.max(r / 2, 1), s = 1 + t * 0.65, l = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, d = 0.8 + t * 0.18, x = 3 * e, I = 6 * e, M = 22 * e, E = Math.abs(c) + I, h = c > 0 ? x : -Math.abs(c) - x, _ = Math.max(2.5, 3 * e), z = $e(n.offsetX, -i, i), j = $e(n.offsetY, -i, i), ut = i * 0.35, Q = z / i * ut, tt = j / i * ut, mt = Q * 0.45, Tt = tt * 0.45, D = Math.max(M * 0.38, 6), O = 0.65 + t * 0.2, P = n.active;
1245
- return /* @__PURE__ */ ue(je, { children: [
1246
- /* @__PURE__ */ st(
1257
+ ), $e = (n, t, e) => Math.min(Math.max(n, t), e), kr = ({ dragState: n, normalizedDistance: t, sizeScale: e, size: r }) => {
1258
+ const i = Math.max(r / 2, 1), s = 1 + t * 0.65, l = Math.max(0.65, 1 - t * 0.25), c = n.direction * t * 26 * e, f = 0.8 + t * 0.18, x = 3 * e, I = 6 * e, P = 22 * e, E = Math.abs(c) + I, g = c > 0 ? x : -Math.abs(c) - x, _ = Math.max(2.5, 3 * e), z = $e(n.offsetX, -i, i), j = $e(n.offsetY, -i, i), ft = i * 0.35, Q = z / i * ft, tt = j / i * ft, pt = Q * 0.45, It = tt * 0.45, D = Math.max(P * 0.38, 6), O = 0.65 + t * 0.2, M = n.active;
1259
+ return /* @__PURE__ */ de(je, { children: [
1260
+ /* @__PURE__ */ it(
1247
1261
  "div",
1248
1262
  {
1249
1263
  className: "aqvs-tap-scroll-circle-gradient",
1250
1264
  style: {
1251
1265
  transform: `scale(${l}, ${s})`,
1252
- transition: P ? "40ms transform ease-out" : "200ms ease transform"
1266
+ transition: M ? "40ms transform ease-out" : "200ms ease transform"
1253
1267
  }
1254
1268
  }
1255
1269
  ),
1256
- /* @__PURE__ */ st(
1270
+ /* @__PURE__ */ it(
1257
1271
  "div",
1258
1272
  {
1259
1273
  className: "aqvs-sample-visual-pupil",
1260
1274
  style: {
1261
- width: M,
1262
- height: M,
1263
- transform: `translate(calc(-50% + ${Q}px), calc(-50% + ${tt}px)) scale(${l}, ${d * s})`,
1264
- transition: P ? "70ms transform ease-out" : "200ms ease transform"
1275
+ width: P,
1276
+ height: P,
1277
+ transform: `translate(calc(-50% + ${Q}px), calc(-50% + ${tt}px)) scale(${l}, ${f * s})`,
1278
+ transition: M ? "70ms transform ease-out" : "200ms ease transform"
1265
1279
  }
1266
1280
  }
1267
1281
  ),
1268
- /* @__PURE__ */ st(
1282
+ /* @__PURE__ */ it(
1269
1283
  "div",
1270
1284
  {
1271
1285
  className: "aqvs-sample-visual-highlight",
1272
1286
  style: {
1273
1287
  width: D,
1274
1288
  height: D,
1275
- transform: `translate(calc(-50% + ${mt}px), calc(-50% + ${Tt}px)) scale(${l}, ${s})`,
1289
+ transform: `translate(calc(-50% + ${pt}px), calc(-50% + ${It}px)) scale(${l}, ${s})`,
1276
1290
  opacity: O,
1277
1291
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1278
- transition: P ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1292
+ transition: M ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1279
1293
  }
1280
1294
  }
1281
1295
  ),
1282
- /* @__PURE__ */ st(
1296
+ /* @__PURE__ */ it(
1283
1297
  "div",
1284
1298
  {
1285
1299
  className: "aqvs-sample-visual-rod",
1286
1300
  style: {
1287
1301
  width: _,
1288
1302
  height: E,
1289
- transform: `translate(-50%, ${h}px)`,
1303
+ transform: `translate(-50%, ${g}px)`,
1290
1304
  opacity: t,
1291
- transition: P ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1305
+ transition: M ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
1292
1306
  }
1293
1307
  }
1294
1308
  )
@@ -1302,7 +1316,7 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1302
1316
  if (!Number.isFinite(n))
1303
1317
  throw new Error(`valueFn returned a non-finite value at index ${t}: ${n}`);
1304
1318
  return n;
1305
- }, he = (n) => {
1319
+ }, ge = (n) => {
1306
1320
  if (n <= 0 || !Number.isFinite(n))
1307
1321
  return 0;
1308
1322
  const t = Math.trunc(n);
@@ -1311,7 +1325,7 @@ const It = (n, t, e) => Math.max(t, Math.min(e, n)), ze = "virtualscroll:tap-scr
1311
1325
  const e = BigInt(t) & -BigInt(t);
1312
1326
  return Number(e);
1313
1327
  };
1314
- class le {
1328
+ class ae {
1315
1329
  /**
1316
1330
  * @private
1317
1331
  * @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
@@ -1381,21 +1395,21 @@ class le {
1381
1395
  from: 0,
1382
1396
  to: Math.min(Ne - 1, i - 1)
1383
1397
  };
1384
- let d = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), i - 1);
1385
- if (d > x && (d = 0, x = Math.min(Ne - 1, i - 1)), i > Ne)
1386
- s = le._sampleBaseValueStrided(e, i, Ne), r?.materialize && (l = { from: d, values: le._collectValidatedValues(e, d, x) });
1398
+ let f = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), i - 1);
1399
+ if (f > x && (f = 0, x = Math.min(Ne - 1, i - 1)), i > Ne)
1400
+ s = ae._sampleBaseValueStrided(e, i, Ne), r?.materialize && (l = { from: f, values: ae._collectValidatedValues(e, f, x) });
1387
1401
  else {
1388
- const I = le._collectValidatedValues(e, d, x);
1389
- s = le._modeOrMedian([...I]), r?.materialize && (l = { from: d, values: I });
1402
+ const I = ae._collectValidatedValues(e, f, x);
1403
+ s = ae._modeOrMedian([...I]), r?.materialize && (l = { from: f, values: I });
1390
1404
  }
1391
1405
  }
1392
1406
  if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = e, this.baseValue = s, l)
1393
1407
  for (let c = 0; c < l.values.length; c++) {
1394
- const d = l.from + c;
1395
- if (d >= this.size)
1408
+ const f = l.from + c;
1409
+ if (f >= this.size)
1396
1410
  break;
1397
1411
  const x = l.values[c] - this.baseValue;
1398
- x !== 0 && (this.deltas.set(d, x), this._updateTree(d, x));
1412
+ x !== 0 && (this.deltas.set(f, x), this._updateTree(f, x));
1399
1413
  }
1400
1414
  this.total = this.getTotal();
1401
1415
  }
@@ -1452,9 +1466,9 @@ class le {
1452
1466
  }
1453
1467
  if (s > t.length * 0.2) {
1454
1468
  const l = [];
1455
- for (const [d, x] of i.entries())
1456
- x === s && l.push(d);
1457
- const c = l.reduce((d, x) => d + x, 0);
1469
+ for (const [f, x] of i.entries())
1470
+ x === s && l.push(f);
1471
+ const c = l.reduce((f, x) => f + x, 0);
1458
1472
  r = Math.floor(c / l.length);
1459
1473
  }
1460
1474
  return r;
@@ -1477,7 +1491,7 @@ class le {
1477
1491
  const s = [];
1478
1492
  for (let l = 0; l < e && s.length < r; l += i)
1479
1493
  s.push(Oe(t(l), l));
1480
- return le._modeOrMedian(s);
1494
+ return ae._modeOrMedian(s);
1481
1495
  }
1482
1496
  /**
1483
1497
  * @method update
@@ -1549,7 +1563,7 @@ class le {
1549
1563
  let r = t + 1;
1550
1564
  for (; r <= this.size; ) {
1551
1565
  this.tree.set(r, (this.tree.get(r) ?? 0) + e);
1552
- const i = he(r);
1566
+ const i = ge(r);
1553
1567
  if (i === 0)
1554
1568
  break;
1555
1569
  r += i;
@@ -1575,8 +1589,8 @@ class le {
1575
1589
  throw new Error(`Value must be a finite number: ${s}`);
1576
1590
  if (s < 0)
1577
1591
  throw new Error("Value cannot be negative.");
1578
- const l = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = l + this.baseValue, d = s - c;
1579
- d !== 0 && e.push({ index: i, change: d }), r.set(i, l + d);
1592
+ const l = r.has(i) ? r.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = l + this.baseValue, f = s - c;
1593
+ f !== 0 && e.push({ index: i, change: f }), r.set(i, l + f);
1580
1594
  }
1581
1595
  return e;
1582
1596
  }
@@ -1593,7 +1607,7 @@ class le {
1593
1607
  let t = 0, e = this.size;
1594
1608
  for (; e > 0; ) {
1595
1609
  t += this.tree.get(e) ?? 0;
1596
- const r = he(e);
1610
+ const r = ge(e);
1597
1611
  if (r === 0)
1598
1612
  break;
1599
1613
  e -= r;
@@ -1632,8 +1646,8 @@ class le {
1632
1646
  const i = t.ranges;
1633
1647
  if (i && i.length > 0) {
1634
1648
  for (const c of i) {
1635
- const d = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), this.size - 1);
1636
- for (let I = d; I <= x; I++)
1649
+ const f = Math.max(0, Math.trunc(c.from)), x = Math.min(Math.trunc(c.to), this.size - 1);
1650
+ for (let I = f; I <= x; I++)
1637
1651
  this._materialize(I);
1638
1652
  }
1639
1653
  if (e === void 0)
@@ -1700,8 +1714,8 @@ class le {
1700
1714
  for (; s > 0; s >>= 1) {
1701
1715
  const l = r + s;
1702
1716
  if (l <= this.size) {
1703
- const d = (this.tree.get(l) ?? 0) + this.baseValue * s;
1704
- (e ? i + d < t : i + d <= t) && (r = l, i += d);
1717
+ const f = (this.tree.get(l) ?? 0) + this.baseValue * s;
1718
+ (e ? i + f < t : i + f <= t) && (r = l, i += f);
1705
1719
  }
1706
1720
  }
1707
1721
  return e ? r : r - 1;
@@ -1720,36 +1734,36 @@ class le {
1720
1734
  this._materializeRanges(e.materializeOption);
1721
1735
  const s = e.materializeOption?.materialize === !0;
1722
1736
  for (; ; ) {
1723
- let l = 0n, c = i - 1n, d, x, I = this.total;
1737
+ let l = 0n, c = i - 1n, f, x, I = this.total;
1724
1738
  for (; l <= c; ) {
1725
- const h = l + c >> 1n, _ = Number(h), z = this.prefixSum(_);
1739
+ const g = l + c >> 1n, _ = Number(g), z = this.prefixSum(_);
1726
1740
  if (I = z.total, r ? z.cumulative >= t : z.cumulative <= t)
1727
- if (d = h, x = z, r) {
1728
- if (h === 0n)
1741
+ if (f = g, x = z, r) {
1742
+ if (g === 0n)
1729
1743
  break;
1730
- c = h - 1n;
1744
+ c = g - 1n;
1731
1745
  } else
1732
- l = h + 1n;
1746
+ l = g + 1n;
1733
1747
  else if (r)
1734
- l = h + 1n;
1748
+ l = g + 1n;
1735
1749
  else {
1736
- if (h === 0n)
1750
+ if (g === 0n)
1737
1751
  break;
1738
- c = h - 1n;
1752
+ c = g - 1n;
1739
1753
  }
1740
1754
  }
1741
- const M = x, E = d !== void 0 ? Number(d) : -1;
1755
+ const P = x, E = f !== void 0 ? Number(f) : -1;
1742
1756
  if (s && E >= 0) {
1743
- const h = this.deltas.get(E) ?? 0;
1744
- if (this._materialize(E), (this.deltas.get(E) ?? 0) !== h)
1757
+ const g = this.deltas.get(E) ?? 0;
1758
+ if (this._materialize(E), (this.deltas.get(E) ?? 0) !== g)
1745
1759
  continue;
1746
1760
  }
1747
1761
  return {
1748
1762
  index: E,
1749
1763
  total: I,
1750
- cumulative: M?.cumulative,
1751
- currentValue: M?.currentValue,
1752
- safeIndex: M?.safeIndex
1764
+ cumulative: P?.cumulative,
1765
+ currentValue: P?.currentValue,
1766
+ safeIndex: P?.safeIndex
1753
1767
  };
1754
1768
  }
1755
1769
  }
@@ -1766,13 +1780,13 @@ class le {
1766
1780
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1767
1781
  if (this.size === 0)
1768
1782
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1769
- const r = It(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1783
+ const r = xt(Math.trunc(t), 0, this.size - 1), i = e?.materializeOption;
1770
1784
  this._materializeRanges(i, r, !0);
1771
1785
  let s = 0, l = r + 1;
1772
1786
  for (; l > 0; ) {
1773
- const d = this.tree.get(l) ?? 0;
1774
- s += d;
1775
- const x = he(l);
1787
+ const f = this.tree.get(l) ?? 0;
1788
+ s += f;
1789
+ const x = ge(l);
1776
1790
  if (x === 0)
1777
1791
  break;
1778
1792
  l -= x;
@@ -1835,7 +1849,7 @@ class le {
1835
1849
  let s = r + 1;
1836
1850
  for (; s <= this.size; ) {
1837
1851
  e.set(s, (e.get(s) ?? 0) + i);
1838
- const l = he(s);
1852
+ const l = ge(s);
1839
1853
  if (l === 0)
1840
1854
  break;
1841
1855
  s += l;
@@ -1952,14 +1966,14 @@ class le {
1952
1966
  _propagateDeltaToGrownNodes(t, e, r, i) {
1953
1967
  let s = t + 1;
1954
1968
  for (; s <= r; ) {
1955
- const l = he(s);
1969
+ const l = ge(s);
1956
1970
  if (l === 0)
1957
1971
  break;
1958
1972
  s += l;
1959
1973
  }
1960
1974
  for (; s <= i; ) {
1961
1975
  this.tree.set(s, (this.tree.get(s) ?? 0) + e);
1962
- const l = he(s);
1976
+ const l = ge(s);
1963
1977
  if (l === 0)
1964
1978
  break;
1965
1979
  s += l;
@@ -1975,7 +1989,7 @@ class le {
1975
1989
  */
1976
1990
  _growSize(t, e) {
1977
1991
  if (this.size = e, this.deltas.size > 0) {
1978
- const r = le._minCoveredLowBound(t, e);
1992
+ const r = ae._minCoveredLowBound(t, e);
1979
1993
  if (t - r < this.deltas.size)
1980
1994
  for (let s = r; s < t; s++) {
1981
1995
  const l = this.deltas.get(s);
@@ -2053,20 +2067,20 @@ class le {
2053
2067
  return this._findIndex(t, e ?? {}, !1);
2054
2068
  }
2055
2069
  }
2056
- const Sr = (n, t) => {
2070
+ const Pr = (n, t) => {
2057
2071
  const e = n?.sampleRange, r = t?.sampleRange;
2058
2072
  return e === r ? !1 : e && r ? e.from !== r.from || e.to !== r.to : !0;
2059
2073
  }, Mr = (n, t, e) => {
2060
2074
  const r = Number.isFinite(n) && n > 0 ? Math.trunc(n) : 0, i = T(null), s = T({ size: r, valueOrFn: t, options: e });
2061
- i.current === null && (i.current = new le(r, t, e));
2062
- const l = i.current, c = s.current, d = c.size !== r, x = c.valueOrFn !== t, I = Sr(c.options, e), M = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2075
+ i.current === null && (i.current = new ae(r, t, e));
2076
+ const l = i.current, c = s.current, f = c.size !== r, x = c.valueOrFn !== t, I = Pr(c.options, e), P = c.size === 0 && r > 0 && (!i.current || i.current.base === 0);
2063
2077
  if (x || I) {
2064
2078
  const E = e?.resetOnValueFnChange ?? !0;
2065
- I || x && E || M ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: I }), l.reset(r, t, e)) : (d && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), l.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), l.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2066
- } else d && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), M ? l.reset(r, t, e) : l.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2079
+ I || x && E || P ? (e?.debug && C.debug("[useFenwickMapTree] reset", { valueOrFnChanged: x, optionsChanged: I }), l.reset(r, t, e)) : (f && (e?.debug && C.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: r }), l.changeSize(r)), e?.debug && C.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: x }), l.setValueFn(t, { reset: !1 })), s.current = { size: r, valueOrFn: t, options: e };
2080
+ } else f && (e?.debug && C.debug("[useFenwickMapTree] resize", { from: c.size, to: r }), P ? l.reset(r, t, e) : l.changeSize(r), s.current = { size: r, valueOrFn: t, options: e });
2067
2081
  return l;
2068
2082
  };
2069
- class Pr {
2083
+ class yr {
2070
2084
  key;
2071
2085
  value;
2072
2086
  prev = null;
@@ -2116,7 +2130,7 @@ class Fe {
2116
2130
  this.remove(t), this.addToTail(t);
2117
2131
  }
2118
2132
  }
2119
- function yr(n) {
2133
+ function wr(n) {
2120
2134
  const t = T(/* @__PURE__ */ new Map()), e = T(new Fe()), r = Math.floor(n), i = T(r);
2121
2135
  Y(() => {
2122
2136
  if (i.current = r, Number.isNaN(r) || r < 0) {
@@ -2132,73 +2146,73 @@ function yr(n) {
2132
2146
  break;
2133
2147
  }
2134
2148
  }, [n, r]);
2135
- const s = S((I) => {
2136
- const M = t.current.get(I);
2137
- if (M)
2138
- return e.current.moveToTail(M), M.value;
2139
- }, []), l = S((I, M) => {
2149
+ const s = v((I) => {
2150
+ const P = t.current.get(I);
2151
+ if (P)
2152
+ return e.current.moveToTail(P), P.value;
2153
+ }, []), l = v((I, P) => {
2140
2154
  const E = i.current;
2141
2155
  if (Number.isNaN(E) || E <= 0)
2142
2156
  return;
2143
- let h = t.current.get(I);
2144
- if (h)
2145
- h.value = M, e.current.moveToTail(h);
2157
+ let g = t.current.get(I);
2158
+ if (g)
2159
+ g.value = P, e.current.moveToTail(g);
2146
2160
  else {
2147
2161
  if (t.current.size >= E) {
2148
2162
  const _ = e.current.removeHead();
2149
2163
  _ && t.current.delete(_.key);
2150
2164
  }
2151
- h = new Pr(I, M), t.current.set(I, h), e.current.addToTail(h);
2165
+ g = new yr(I, P), t.current.set(I, g), e.current.addToTail(g);
2152
2166
  }
2153
- }, []), c = S((I) => t.current.has(I), []), d = S((I) => {
2154
- const M = t.current.get(I);
2155
- M && (e.current.remove(M), t.current.delete(I));
2156
- }, []), x = S(() => {
2167
+ }, []), c = v((I) => t.current.has(I), []), f = v((I) => {
2168
+ const P = t.current.get(I);
2169
+ P && (e.current.remove(P), t.current.delete(I));
2170
+ }, []), x = v(() => {
2157
2171
  t.current.clear(), e.current = new Fe();
2158
2172
  }, []);
2159
- return At(() => ({ get: s, set: l, has: c, remove: d, clear: x }), [s, l, c, d, x]);
2173
+ return At(() => ({ get: s, set: l, has: c, remove: f, clear: x }), [s, l, c, f, x]);
2160
2174
  }
2161
- const wr = 1e4, kr = () => {
2162
- const { get: n, set: t, has: e, clear: r } = yr(wr);
2175
+ const Rr = 1e4, Or = () => {
2176
+ const { get: n, set: t, has: e, clear: r } = wr(Rr);
2163
2177
  return At(() => ({ get: n, set: t, has: e, clear: r }), [n, t, e, r]);
2164
- }, gt = (n, t) => t <= 0 ? 0 : It(n, 0, t - 1), Ue = (n) => ({
2178
+ }, bt = (n, t) => t <= 0 ? 0 : xt(n, 0, t - 1), Ue = (n) => ({
2165
2179
  top: Math.max(0, n?.top ?? 0),
2166
2180
  bottom: Math.max(0, n?.bottom ?? 0)
2167
- }), ne = (n, t) => n <= t ? 0 : n - t, ge = (n, t) => n <= 0 ? t : n + t, Ve = 1e3, Ke = 2e3, Rr = 1048576, Pe = (n) => {
2181
+ }), ne = (n, t) => n <= t ? 0 : n - t, be = (n, t) => n <= 0 ? t : n + t, Ve = 1e3, Ke = 2e3, Cr = 1048576, Me = (n) => {
2168
2182
  if (!Number.isFinite(n)) return 0n;
2169
2183
  const t = Math.trunc(n);
2170
2184
  return t <= 0 ? 0n : BigInt(t);
2171
- }, Cr = (n, t, e, r, i, s, l, c) => {
2172
- const d = Pe(r);
2173
- if (d === 0n)
2185
+ }, Er = (n, t, e, r, i, s, l, c) => {
2186
+ const f = Me(r);
2187
+ if (f === 0n)
2174
2188
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2175
- const x = (D) => D < 0n ? 0n : D >= d ? d - 1n : D, I = { materializeOption: { materialize: !1 } }, { index: M, cumulative: E } = s.findIndexAtOrAfter(n, I);
2176
- let h;
2177
- M === -1 ? h = d - 1n : (E === n ? h = Pe(M + 1) : h = Pe(M), h >= d && (h = d - 1n)), n <= 0 && (h = 0n), c && n >= l && (h = d - 1n);
2189
+ const x = (D) => D < 0n ? 0n : D >= f ? f - 1n : D, I = { materializeOption: { materialize: !1 } }, { index: P, cumulative: E } = s.findIndexAtOrAfter(n, I);
2190
+ let g;
2191
+ P === -1 ? g = f - 1n : (E === n ? g = Me(P + 1) : g = Me(P), g >= f && (g = f - 1n)), n <= 0 && (g = 0n), c && n >= l && (g = f - 1n);
2178
2192
  const _ = (D) => {
2179
2193
  const O = Number(D);
2180
2194
  if (!Number.isSafeInteger(O))
2181
2195
  return null;
2182
- const { cumulative: P } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
2183
- if (!Number.isFinite(P))
2196
+ const { cumulative: M } = s.prefixSum(O, { materializeOption: { materialize: !1 } });
2197
+ if (!Number.isFinite(M))
2184
2198
  return null;
2185
- const { index: B } = s.findIndexAtOrAfter(P + 0.5, { materializeOption: { materialize: !1 } });
2199
+ const { index: B } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
2186
2200
  if (B === -1)
2187
2201
  return null;
2188
- const N = Pe(B);
2202
+ const N = Me(B);
2189
2203
  return N > D ? N : null;
2190
2204
  }, z = (D) => {
2191
- let O = 0, P = D, B = D, N = 0n, q = 0;
2192
- for (; P < d && O < t; ) {
2193
- const et = Number(P), G = i(et);
2194
- if (O += G, B = P, P += 1n, N += 1n, !Number.isFinite(G) || G < 0)
2205
+ let O = 0, M = D, B = D, N = 0n, q = 0;
2206
+ for (; M < f && O < t; ) {
2207
+ const et = Number(M), G = i(et);
2208
+ if (O += G, B = M, M += 1n, N += 1n, !Number.isFinite(G) || G < 0)
2195
2209
  break;
2196
2210
  if (G === 0) {
2197
2211
  if (q += 1, q > Ve) {
2198
- const p = _(B);
2199
- if (p !== null && p > P)
2200
- P = p, q = 0;
2201
- else if (p !== null && p === P && i(Number(P)) > 0)
2212
+ const h = _(B);
2213
+ if (h !== null && h > M)
2214
+ M = h, q = 0;
2215
+ else if (h !== null && h === M && i(Number(M)) > 0)
2202
2216
  q = 0;
2203
2217
  else
2204
2218
  break;
@@ -2208,72 +2222,72 @@ const wr = 1e4, kr = () => {
2208
2222
  }
2209
2223
  return N === 0n && (B = D), { height: O, end: B };
2210
2224
  };
2211
- let { height: j, end: ut } = z(h);
2212
- if (j < t && h > 0n) {
2213
- let D = h, O = j, P = 0;
2225
+ let { height: j, end: ft } = z(g);
2226
+ if (j < t && g > 0n) {
2227
+ let D = g, O = j, M = 0;
2214
2228
  for (; D > 0n && O < t; ) {
2215
2229
  D -= 1n;
2216
2230
  const N = Number(D), q = i(N);
2217
2231
  if (O += q, !Number.isFinite(q) || q < 0)
2218
2232
  break;
2219
2233
  if (q === 0) {
2220
- if (P += 1, P > Ve) {
2234
+ if (M += 1, M > Ve) {
2221
2235
  const et = Number(D);
2222
2236
  if (!Number.isSafeInteger(et))
2223
2237
  break;
2224
2238
  const { cumulative: G } = s.prefixSum(et, { materializeOption: { materialize: !1 } });
2225
2239
  if (!Number.isFinite(G))
2226
2240
  break;
2227
- const { index: p } = s.findIndexAtOrAfter(G - 0.5, { materializeOption: { materialize: !1 } }), $ = p === -1 ? -1n : Pe(p);
2241
+ const { index: h } = s.findIndexAtOrAfter(G - 0.5, { materializeOption: { materialize: !1 } }), $ = h === -1 ? -1n : Me(h);
2228
2242
  if ($ >= 0n && $ < D)
2229
- D = $ + 1n, P = 0;
2243
+ D = $ + 1n, M = 0;
2230
2244
  else if ($ === D && D >= 1n && i(Number(D - 1n)) > 0)
2231
- P = 0;
2245
+ M = 0;
2232
2246
  else
2233
2247
  break;
2234
2248
  }
2235
2249
  } else
2236
- P = 0;
2250
+ M = 0;
2237
2251
  }
2238
- h = x(D);
2239
- const B = z(h);
2240
- j = B.height, ut = B.end;
2252
+ g = x(D);
2253
+ const B = z(g);
2254
+ j = B.height, ft = B.end;
2241
2255
  }
2242
- const Q = x(h), tt = x(ut), mt = x(Q - BigInt(Math.max(0, e))), Tt = x(tt + BigInt(Math.max(0, e)));
2256
+ const Q = x(g), tt = x(ft), pt = x(Q - BigInt(Math.max(0, e))), It = x(tt + BigInt(Math.max(0, e)));
2243
2257
  return {
2244
- renderingStartIndex: gt(Number(mt), r),
2245
- renderingEndIndex: gt(Number(Tt), r),
2246
- visibleStartIndex: gt(Number(Q), r),
2247
- visibleEndIndex: gt(Number(tt), r)
2258
+ renderingStartIndex: bt(Number(pt), r),
2259
+ renderingEndIndex: bt(Number(It), r),
2260
+ visibleStartIndex: bt(Number(Q), r),
2261
+ visibleEndIndex: bt(Number(tt), r)
2248
2262
  };
2249
- }, Er = (n, t, e, r, i, s, l) => {
2263
+ }, Nr = (n, t, e, r, i, s, l) => {
2250
2264
  if (r === 0)
2251
2265
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2252
- const c = Number.isFinite(l), d = c ? Math.min(Math.max(0, n), l) : Math.max(0, n);
2266
+ const c = Number.isFinite(l), f = c ? Math.min(Math.max(0, n), l) : Math.max(0, n);
2253
2267
  if (r >= Number.MAX_SAFE_INTEGER)
2254
- return Cr(d, t, e, r, i, s, l, c);
2255
- const { index: x, cumulative: I, currentValue: M } = s.findIndexAtOrAfter(d, { materializeOption: { materialize: !1 } }), E = x === -1 ? t <= 0 || (I ?? 0) < d + (M ?? 0) ? r - 1 : 0 : x;
2256
- let h = gt(E, r), _ = 0;
2257
- if (x !== -1 && I === d)
2258
- h = gt(x + 1, r), _ = 0;
2259
- else if (h === x && I !== void 0 && M !== void 0)
2260
- _ = I - M - d;
2268
+ return Er(f, t, e, r, i, s, l, c);
2269
+ const { index: x, cumulative: I, currentValue: P } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), E = x === -1 ? t <= 0 || (I ?? 0) < f + (P ?? 0) ? r - 1 : 0 : x;
2270
+ let g = bt(E, r), _ = 0;
2271
+ if (x !== -1 && I === f)
2272
+ g = bt(x + 1, r), _ = 0;
2273
+ else if (g === x && I !== void 0 && P !== void 0)
2274
+ _ = I - P - f;
2261
2275
  else {
2262
- const { cumulative: D, currentValue: O } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
2263
- _ = (D ?? 0) - (O ?? 0) - d;
2276
+ const { cumulative: D, currentValue: O } = s.prefixSum(g, { materializeOption: { materialize: !1 } });
2277
+ _ = (D ?? 0) - (O ?? 0) - f;
2264
2278
  }
2265
2279
  const z = _, j = (D, O) => {
2266
- let P = D, B = O, N = 0;
2267
- for (; P < r && B < t; ) {
2268
- const q = i(P);
2269
- if (B += q, P++, !Number.isFinite(q) || q < 0)
2280
+ let M = D, B = O, N = 0;
2281
+ for (; M < r && B < t; ) {
2282
+ const q = i(M);
2283
+ if (B += q, M++, !Number.isFinite(q) || q < 0)
2270
2284
  break;
2271
2285
  if (q === 0) {
2272
2286
  if (N++, N > Ve) {
2273
- const { cumulative: et } = s.prefixSum(P - 1, { materializeOption: { materialize: !1 } }), { index: G } = Number.isFinite(et) ? s.findIndexAtOrAfter(et + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2274
- if (G > P)
2275
- P = G, N = 0;
2276
- else if (G === P && i(P) > 0)
2287
+ const { cumulative: et } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: G } = Number.isFinite(et) ? s.findIndexAtOrAfter(et + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2288
+ if (G > M)
2289
+ M = G, N = 0;
2290
+ else if (G === M && i(M) > 0)
2277
2291
  N = 0;
2278
2292
  else
2279
2293
  break;
@@ -2281,11 +2295,11 @@ const wr = 1e4, kr = () => {
2281
2295
  } else
2282
2296
  N = 0;
2283
2297
  }
2284
- return { cursor: P, height: B };
2285
- }, ut = j(h, _);
2286
- let Q = ut.cursor;
2287
- if (_ = ut.height, _ < t && h > 0) {
2288
- let D = _ + Math.abs(Math.min(0, z)), O = h - 1, P = 0;
2298
+ return { cursor: M, height: B };
2299
+ }, ft = j(g, _);
2300
+ let Q = ft.cursor;
2301
+ if (_ = ft.height, _ < t && g > 0) {
2302
+ let D = _ + Math.abs(Math.min(0, z)), O = g - 1, M = 0;
2289
2303
  for (; O >= 0 && D < t; ) {
2290
2304
  const N = i(O);
2291
2305
  if (D += N, !Number.isFinite(N) || N < 0) {
@@ -2293,29 +2307,29 @@ const wr = 1e4, kr = () => {
2293
2307
  break;
2294
2308
  }
2295
2309
  if (N === 0) {
2296
- if (P++, P > Ve) {
2310
+ if (M++, M > Ve) {
2297
2311
  const { cumulative: q } = s.prefixSum(O, { materializeOption: { materialize: !1 } }), { index: et } = Number.isFinite(q) ? s.findIndexAtOrAfter(q - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2298
2312
  if (et !== -1 && et < O) {
2299
- O = et, P = 0;
2313
+ O = et, M = 0;
2300
2314
  continue;
2301
2315
  }
2302
2316
  if (et === O && O >= 1 && i(O - 1) > 0)
2303
- P = 0;
2317
+ M = 0;
2304
2318
  else {
2305
2319
  O--;
2306
2320
  break;
2307
2321
  }
2308
2322
  }
2309
2323
  } else
2310
- P = 0;
2324
+ M = 0;
2311
2325
  O--;
2312
2326
  }
2313
- h = gt(O + 1, r);
2314
- const B = j(h, 0);
2327
+ g = bt(O + 1, r);
2328
+ const B = j(g, 0);
2315
2329
  Q = B.cursor, _ = B.height;
2316
2330
  }
2317
- const tt = gt(h - e, r), mt = gt(Math.max(Q - 1, h), r), Tt = gt(mt + e, r);
2318
- return { renderingStartIndex: tt, renderingEndIndex: Tt, visibleStartIndex: h, visibleEndIndex: mt };
2331
+ const tt = bt(g - e, r), pt = bt(Math.max(Q - 1, g), r), It = bt(pt + e, r);
2332
+ return { renderingStartIndex: tt, renderingEndIndex: It, visibleStartIndex: g, visibleEndIndex: pt };
2319
2333
  }, We = (n, t, e) => {
2320
2334
  const r = Math.max(0, t ?? 0), i = T({ last: 0, id: null, arg: null }).current;
2321
2335
  return Y(
@@ -2323,13 +2337,13 @@ const wr = 1e4, kr = () => {
2323
2337
  i.id !== null && (cancelAnimationFrame(i.id), i.id = null);
2324
2338
  },
2325
2339
  [i]
2326
- ), S(
2340
+ ), v(
2327
2341
  (s) => {
2328
2342
  if (i.arg = s, i.id !== null) return;
2329
2343
  const l = (c) => {
2330
2344
  if (i.id = null, i.arg === null) return;
2331
- const d = c - i.last;
2332
- if (r === 0 || i.last === 0 || d >= r) {
2345
+ const f = c - i.last;
2346
+ if (r === 0 || i.last === 0 || f >= r) {
2333
2347
  if (n.current)
2334
2348
  try {
2335
2349
  e(n.current, i.arg);
@@ -2344,11 +2358,11 @@ const wr = 1e4, kr = () => {
2344
2358
  },
2345
2359
  [r, e, n, i]
2346
2360
  );
2347
- }, Nr = Je.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: l, onKeyDown: c, onFocus: d, registerItemRef: x }) => {
2348
- const I = S((_) => x(n, _), [n, x]), M = S((_) => c(_, n), [n, c]), E = S(() => d(n), [n, d]), h = S((_) => {
2361
+ }, Vr = Je.memo(({ index: n, top: t, height: e, item: r, children: i, clipItemHeight: s, enableKeyboardNavigation: l, onKeyDown: c, onFocus: f, registerItemRef: x }) => {
2362
+ const I = v((_) => x(n, _), [n, x]), P = v((_) => c(_, n), [n, c]), E = v(() => f(n), [n, f]), g = v((_) => {
2349
2363
  _.currentTarget.focus({ preventScroll: !0 });
2350
2364
  }, []);
2351
- return /* @__PURE__ */ st(
2365
+ return /* @__PURE__ */ it(
2352
2366
  "div",
2353
2367
  {
2354
2368
  ref: I,
@@ -2361,13 +2375,13 @@ const wr = 1e4, kr = () => {
2361
2375
  overflow: s ? "hidden" : void 0
2362
2376
  },
2363
2377
  tabIndex: l ? -1 : void 0,
2364
- onPointerDown: l ? h : void 0,
2365
- onKeyDownCapture: l ? M : void 0,
2378
+ onPointerDown: l ? g : void 0,
2379
+ onKeyDownCapture: l ? P : void 0,
2366
2380
  onFocusCapture: l ? E : void 0,
2367
2381
  children: i(r, n)
2368
2382
  }
2369
2383
  );
2370
- }), Vr = ({
2384
+ }), Ar = ({
2371
2385
  itemCount: n,
2372
2386
  getItem: t,
2373
2387
  getItemKey: e,
@@ -2376,34 +2390,34 @@ const wr = 1e4, kr = () => {
2376
2390
  overscanCount: s = 15,
2377
2391
  className: l,
2378
2392
  testId: c,
2379
- onScroll: d,
2393
+ onScroll: f,
2380
2394
  onRangeChange: x,
2381
2395
  children: I,
2382
- background: M,
2396
+ background: P,
2383
2397
  initialScrollIndex: E,
2384
- initialScrollOffset: h,
2398
+ initialScrollOffset: g,
2385
2399
  callbackThrottleMs: _ = 5,
2386
2400
  contentInsets: z,
2387
2401
  onItemFocus: j,
2388
- scrollBarOptions: ut,
2402
+ scrollBarOptions: ft,
2389
2403
  behaviorOptions: Q,
2390
2404
  onWheelHorizontal: tt
2391
- }, mt) => {
2392
- const { width: Tt, enableThumbDrag: D, enableTrackClick: O, enableArrowButtons: P, enableScrollToTopBottomButtons: B, renderThumbOverlay: N, tapScrollCircleOptions: q } = ut ?? {}, { enablePointerDrag: et, pointerDragInputs: G, enableKeyboardNavigation: p = !0, wheelSpeedMultiplier: $, inertiaOptions: St, clipItemHeight: Rt = !1, resetOnGetItemHeightChange: Z = !1 } = Q ?? {}, k = T(null), Ct = T({
2405
+ }, pt) => {
2406
+ const { width: It, enableThumbDrag: D, enableTrackClick: O, enableArrowButtons: M, enableScrollToTopBottomButtons: B, renderThumbOverlay: N, tapScrollCircleOptions: q } = ft ?? {}, { enablePointerDrag: et, pointerDragInputs: G, enableKeyboardNavigation: h = !0, wheelSpeedMultiplier: $, inertiaOptions: Tt, clipItemHeight: wt = !1, resetOnGetItemHeightChange: Z = !1 } = Q ?? {}, k = T(null), Rt = T({
2393
2407
  renderingStartIndex: 0,
2394
2408
  renderingEndIndex: 0,
2395
2409
  visibleStartIndex: 0,
2396
2410
  visibleEndIndex: 0,
2397
2411
  scrollPosition: 0,
2398
2412
  totalHeight: 0
2399
- }), U = T(null), Et = T(!1);
2413
+ }), U = T(null), Ct = T(!1);
2400
2414
  Y(() => {
2401
2415
  Z && (U.current = null);
2402
2416
  }, [Z, r]);
2403
- const y = At(() => Ue(z), [z]), [Yt] = Zt(() => {
2417
+ const w = At(() => Ue(z), [z]), [Yt] = Zt(() => {
2404
2418
  const u = typeof E == "number" && Number.isFinite(E) ? Math.max(0, Math.trunc(E)) : 0;
2405
2419
  return { from: Math.max(0, u - 50), to: u + 50 };
2406
- }), Ht = At(
2420
+ }), Xt = At(
2407
2421
  // 目的: Fenwick Tree のオプション設定
2408
2422
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2409
2423
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
@@ -2414,436 +2428,436 @@ const wr = 1e4, kr = () => {
2414
2428
  materialize: !0
2415
2429
  }),
2416
2430
  [Z, Yt]
2417
- ), v = Mr(n, r, Ht), [Xt] = Zt(() => {
2418
- let o = 0, u = 0;
2431
+ ), S = Mr(n, r, Xt), [$t] = Zt(() => {
2432
+ let a = 0, u = 0;
2419
2433
  if (typeof E == "number") {
2420
- const m = It(E, 0, n - 1), V = It(m - s * 2, 0, n - 1), A = It(m + s * 2, 0, n - 1), F = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } } : void 0, { cumulative: K, total: W, currentValue: Pt } = v.prefixSum(E, F), pt = Math.max(K - Pt, 0);
2421
- o = ge(pt, y.top), u = W ?? v.getTotal();
2422
- } else typeof h == "number" && (o = ge(Math.max(h, 0), y.top)), u = v.getTotal();
2423
- return { position: o, total: u };
2424
- }), [Bt, Jt] = Zt(Xt.position), [at, jt] = Zt(Xt.total), f = T(Xt.position), dt = T(y.top), lt = T(d ?? void 0), H = T(x ?? void 0), it = T(/* @__PURE__ */ new Map()), J = T(null), yt = T(null), [wt, Nt] = Zt(null), [rt, Dt] = Zt(!1), Mt = T(null), ft = T(!1), ot = T(0), Lt = T(!1), $t = T(!1), Qt = T(n);
2425
- Qt.current !== n && (Qt.current = n, $t.current = !0), Y(() => {
2426
- lt.current = d ?? void 0, H.current = x ?? void 0;
2427
- }, [x, d]);
2428
- const ct = S(
2429
- (o) => {
2430
- if (p && o && typeof o.focus == "function")
2434
+ const p = xt(E, 0, n - 1), V = xt(p - s * 2, 0, n - 1), A = xt(p + s * 2, 0, n - 1), F = E > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } } : void 0, { cumulative: K, total: W, currentValue: vt } = S.prefixSum(E, F), ht = Math.max(K - vt, 0);
2435
+ a = be(ht, w.top), u = W ?? S.getTotal();
2436
+ } else typeof g == "number" && (a = be(Math.max(g, 0), w.top)), u = S.getTotal();
2437
+ return { position: a, total: u };
2438
+ }), [Bt, Jt] = Zt($t.position), [lt, Wt] = Zt($t.total), d = T($t.position), mt = T(w.top), ct = T(f ?? void 0), H = T(x ?? void 0), nt = T(/* @__PURE__ */ new Map()), J = T(null), Pt = T(null), [Mt, Et] = Zt(null), [st, St] = Zt(!1), yt = T(null), ut = T(!1), ot = T(0), Dt = T(!1), qt = T(!1), le = T(n);
2439
+ le.current !== n && (le.current = n, qt.current = !0), Y(() => {
2440
+ ct.current = f ?? void 0, H.current = x ?? void 0;
2441
+ }, [x, f]);
2442
+ const dt = v(
2443
+ (a) => {
2444
+ if (h && a && typeof a.focus == "function")
2431
2445
  try {
2432
- o.focus({ preventScroll: !0 });
2446
+ a.focus({ preventScroll: !0 });
2433
2447
  } catch {
2434
- o.focus();
2448
+ a.focus();
2435
2449
  }
2436
2450
  },
2437
- [p]
2438
- ), g = S((o, { position: u, totalHeight: m }) => {
2439
- o(u, m);
2440
- }, []), w = We(lt, _, g), bt = S((o, u) => {
2441
- o(u);
2442
- }, []), qt = We(H, _, bt), xt = T(y.top);
2443
- xt.current = y.top;
2444
- const _t = T(w);
2445
- _t.current = w, Y(() => (Et.current = !1, () => {
2446
- Et.current = !0, Mt.current && (clearTimeout(Mt.current), Mt.current = null);
2451
+ [h]
2452
+ ), Qt = v((a, { position: u, totalHeight: p }) => {
2453
+ a(u, p);
2454
+ }, []), m = We(ct, _, Qt), y = v((a, u) => {
2455
+ a(u);
2456
+ }, []), Nt = We(H, _, y), Lt = T(w.top);
2457
+ Lt.current = w.top;
2458
+ const at = T(m);
2459
+ at.current = m, Y(() => (Ct.current = !1, () => {
2460
+ Ct.current = !0, yt.current && (clearTimeout(yt.current), yt.current = null);
2447
2461
  }), []), Y(() => {
2448
- p || (it.current.clear(), J.current = null, yt.current = null);
2449
- }, [p]);
2450
- const vt = S(
2451
- (o, u) => {
2462
+ h || (nt.current.clear(), J.current = null, Pt.current = null);
2463
+ }, [h]);
2464
+ const _t = v(
2465
+ (a, u) => {
2452
2466
  if (!u) {
2453
- it.current.delete(o);
2467
+ nt.current.delete(a);
2454
2468
  return;
2455
2469
  }
2456
- p && (it.current.set(o, u), J.current === o && (J.current = null, yt.current = o, ct(u)));
2470
+ h && (nt.current.set(a, u), J.current === a && (J.current = null, Pt.current = a, dt(u)));
2457
2471
  },
2458
- [p, ct]
2459
- ), Ut = 0.01, Ft = T({
2472
+ [h, dt]
2473
+ ), Ht = 0.01, kt = T({
2460
2474
  rafId: null,
2461
2475
  loopActive: !1,
2462
2476
  idleFrames: 0,
2463
- lastRenderedPosition: Xt.position
2464
- }), ie = S(() => {
2465
- const o = Ft.current;
2466
- o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
2477
+ lastRenderedPosition: $t.position
2478
+ }), jt = v(() => {
2479
+ const a = kt.current;
2480
+ a.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(a.rafId), a.rafId = null, a.loopActive = !1, a.idleFrames = 0;
2467
2481
  }, []);
2468
2482
  Y(
2469
2483
  () => () => {
2470
- ie();
2484
+ jt();
2471
2485
  },
2472
- [ie]
2486
+ [jt]
2473
2487
  );
2474
- const xe = T(() => {
2475
- }), de = S(() => {
2476
- const o = Ft.current;
2477
- o.rafId = null;
2478
- const u = f.current, m = ne(u, xt.current), V = v.getTotal();
2479
- if (Jt((F) => Math.abs(F - u) < Ut ? F : u), Math.abs(o.lastRenderedPosition - u) >= Ut ? (_t.current({ position: m, totalHeight: V }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2480
- ie();
2488
+ const ce = T(() => {
2489
+ }), fe = v(() => {
2490
+ const a = kt.current;
2491
+ a.rafId = null;
2492
+ const u = d.current, p = ne(u, Lt.current), V = S.getTotal();
2493
+ if (Jt((F) => Math.abs(F - u) < Ht ? F : u), Math.abs(a.lastRenderedPosition - u) >= Ht ? (at.current({ position: p, totalHeight: V }), a.lastRenderedPosition = u, a.idleFrames = 0) : a.idleFrames += 1, a.idleFrames >= 2) {
2494
+ jt();
2481
2495
  return;
2482
2496
  }
2483
2497
  if (typeof requestAnimationFrame == "function") {
2484
- o.rafId = requestAnimationFrame((F) => xe.current(F));
2498
+ a.rafId = requestAnimationFrame((F) => ce.current(F));
2485
2499
  return;
2486
2500
  }
2487
- o.loopActive = !1;
2488
- }, [v, ie]);
2489
- xe.current = de;
2490
- const Ie = S(() => {
2491
- const o = Ft.current;
2492
- if (o.idleFrames = 0, !o.loopActive) {
2493
- if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
2494
- o.rafId = requestAnimationFrame(de);
2501
+ a.loopActive = !1;
2502
+ }, [S, jt]);
2503
+ ce.current = fe;
2504
+ const Ie = v(() => {
2505
+ const a = kt.current;
2506
+ if (a.idleFrames = 0, !a.loopActive) {
2507
+ if (a.loopActive = !0, typeof requestAnimationFrame == "function") {
2508
+ a.rafId = requestAnimationFrame(fe);
2495
2509
  return;
2496
2510
  }
2497
- o.loopActive = !1;
2511
+ a.loopActive = !1;
2498
2512
  }
2499
- }, [de]), nt = S(
2500
- (o, u) => {
2501
- const m = u?.immediate ?? !1, V = ne(o, y.top);
2502
- if (f.current = o, m) {
2503
- Ft.current.lastRenderedPosition = o, Ft.current.idleFrames = 0, Jt(o), w({ position: V, totalHeight: v.getTotal() });
2513
+ }, [fe]), rt = v(
2514
+ (a, u) => {
2515
+ const p = u?.immediate ?? !1, V = ne(a, w.top);
2516
+ if (d.current = a, p) {
2517
+ kt.current.lastRenderedPosition = a, kt.current.idleFrames = 0, Jt(a), m({ position: V, totalHeight: S.getTotal() });
2504
2518
  return;
2505
2519
  }
2506
2520
  Ie();
2507
2521
  },
2508
- [Ie, v, y.top, w]
2509
- ), zt = S((o) => {
2522
+ [Ie, S, w.top, m]
2523
+ ), zt = v((a) => {
2510
2524
  const u = k.current;
2511
2525
  if (!u)
2512
- return o;
2513
- const m = u.getScrollPosition();
2526
+ return a;
2527
+ const p = u.getScrollPosition();
2514
2528
  ot.current += 1;
2515
- const V = u.scrollTo(o);
2516
- return V === m && (ot.current = Math.max(0, ot.current - 1)), Math.abs(V - o) > 0.5 && (Lt.current = !0), V;
2529
+ const V = u.scrollTo(a);
2530
+ return V === p && (ot.current = Math.max(0, ot.current - 1)), Math.abs(V - a) > 0.5 && (Dt.current = !0), V;
2517
2531
  }, []), Te = T(!1);
2518
2532
  Y(() => {
2519
2533
  if (!Te.current)
2520
- if (Te.current = !0, typeof h == "number") {
2521
- const o = ge(Math.max(h, 0), y.top), u = Math.abs(o - f.current) > 0.5;
2522
- nt(o, { immediate: !0 }), u && k.current?.scrollTo(o);
2534
+ if (Te.current = !0, typeof g == "number") {
2535
+ const a = be(Math.max(g, 0), w.top), u = Math.abs(a - d.current) > 0.5;
2536
+ rt(a, { immediate: !0 }), u && k.current?.scrollTo(a);
2523
2537
  } else
2524
- nt(f.current, { immediate: !0 });
2525
- }, [h, y.top, nt]), Y(() => {
2526
- const o = v.getTotal();
2527
- if (at !== o) {
2528
- jt(o);
2538
+ rt(d.current, { immediate: !0 });
2539
+ }, [g, w.top, rt]), Y(() => {
2540
+ const a = S.getTotal();
2541
+ if (lt !== a) {
2542
+ Wt(a);
2529
2543
  return;
2530
2544
  }
2531
- if (Lt.current) {
2532
- Lt.current = !1;
2545
+ if (Dt.current) {
2546
+ Dt.current = !1;
2533
2547
  const u = k.current;
2534
- if (u && Math.abs(u.getScrollPosition() - f.current) > 0.5) {
2535
- const m = zt(f.current);
2536
- Lt.current = !1, nt(m, { immediate: !0 });
2548
+ if (u && Math.abs(u.getScrollPosition() - d.current) > 0.5) {
2549
+ const p = zt(d.current);
2550
+ Dt.current = !1, rt(p, { immediate: !0 });
2537
2551
  }
2538
2552
  }
2539
- }, [v, at, n, zt, nt]), Y(() => {
2553
+ }, [S, lt, n, zt, rt]), Y(() => {
2540
2554
  if (U.current !== null) {
2541
- const { index: o, align: u, offset: m } = U.current, V = gt(o, n), { cumulative: A, currentValue: F } = v.prefixSum(V, { materializeOption: { materialize: !1 } });
2555
+ const { index: a, align: u, offset: p } = U.current, V = bt(a, n), { cumulative: A, currentValue: F } = S.prefixSum(V, { materializeOption: { materialize: !1 } });
2542
2556
  if (A !== void 0 && F !== void 0) {
2543
2557
  const K = Math.max(A - F, 0);
2544
2558
  let W = K;
2545
- u === "bottom" ? W = A - i : u === "center" && (W = K + F / 2 - i / 2), m && (W -= m), W = Math.max(0, W);
2546
- const Pt = Math.max(0, at + y.top + y.bottom - i), pt = Math.min(ge(W, y.top), Pt);
2547
- Math.abs(pt - f.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2548
- from: f.current,
2549
- to: pt,
2559
+ u === "bottom" ? W = A - i : u === "center" && (W = K + F / 2 - i / 2), p && (W -= p), W = Math.max(0, W);
2560
+ const vt = Math.max(0, lt + w.top + w.bottom - i), ht = Math.min(be(W, w.top), vt);
2561
+ Math.abs(ht - d.current) > 1 && (C.debug("[VirtualScroll] Drift correction", {
2562
+ from: d.current,
2563
+ to: ht,
2550
2564
  targetIndex: V
2551
- }), ot.current === 0 && (ot.current += 1), k.current?.scrollTo(pt), nt(pt, { immediate: !0 }));
2565
+ }), ot.current === 0 && (ot.current += 1), k.current?.scrollTo(ht), rt(ht, { immediate: !0 }));
2552
2566
  }
2553
2567
  }
2554
- $t.current = !1;
2555
- }, [at, v, n, y.top, nt, i, y.bottom]), Y(() => {
2556
- const o = dt.current;
2557
- if (o === y.top) return;
2558
- const u = ne(f.current, o), m = ge(u, y.top);
2559
- dt.current = y.top, f.current = m, k.current?.scrollTo(m), nt(m, { immediate: !0 });
2560
- }, [y.top, nt]);
2561
- const ve = S(
2562
- (o, u) => {
2568
+ qt.current = !1;
2569
+ }, [lt, S, n, w.top, rt, i, w.bottom]), Y(() => {
2570
+ const a = mt.current;
2571
+ if (a === w.top) return;
2572
+ const u = ne(d.current, a), p = be(u, w.top);
2573
+ mt.current = w.top, d.current = p, k.current?.scrollTo(p), rt(p, { immediate: !0 });
2574
+ }, [w.top, rt]);
2575
+ const Se = v(
2576
+ (a, u) => {
2563
2577
  if (n === 0)
2564
2578
  return;
2565
- const m = gt(o, n), V = v.get(m), A = u - V, F = v.update(m, u);
2566
- F !== void 0 && jt(F), C.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: F });
2579
+ const p = bt(a, n), V = S.get(p), A = u - V, F = S.update(p, u);
2580
+ F !== void 0 && Wt(F), C.debug("[VirtualScroll] Updated item size manually", { index: p, size: u, total: F });
2567
2581
  let K = U.current ? U.current.index : null;
2568
2582
  if (K === null) {
2569
- const W = f.current, Pt = Ue(z).top, pt = ne(W, Pt), { index: ht, cumulative: kt } = v.findIndexAtOrAfter(pt, { materializeOption: { materialize: !1 } });
2570
- K = kt !== void 0 && kt === pt ? ht + 1 : ht;
2583
+ const W = d.current, vt = Ue(z).top, ht = ne(W, vt), { index: gt, cumulative: Ot } = S.findIndexAtOrAfter(ht, { materializeOption: { materialize: !1 } });
2584
+ K = Ot !== void 0 && Ot === ht ? gt + 1 : gt;
2571
2585
  }
2572
- if (K !== -1 && m < K && A !== 0) {
2573
- const W = f.current, Pt = W + A;
2574
- zt(Pt), nt(Pt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: W, to: Pt, causedByIndex: m, delta: A, activeVisibleStartIndex: K });
2586
+ if (K !== -1 && p < K && A !== 0) {
2587
+ const W = d.current, vt = W + A;
2588
+ zt(vt), rt(vt, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: W, to: vt, causedByIndex: p, delta: A, activeVisibleStartIndex: K });
2575
2589
  }
2576
2590
  },
2577
- [v, n, zt, nt, z]
2578
- ), Wt = S(
2579
- (o, u) => {
2591
+ [S, n, zt, rt, z]
2592
+ ), Kt = v(
2593
+ (a, u) => {
2580
2594
  if (!k.current || n === 0)
2581
2595
  return;
2582
- const m = gt(o, n), V = gt(m - s * 2, n), A = gt(m + s * 2, n), { cumulative: F, total: K, currentValue: W } = v.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } });
2583
- if (C.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", F, "Total height:", K, "ItemHeight:", W, "safeIndexFrom:", V, "safeIndexTo:", A), !K)
2596
+ const p = bt(a, n), V = bt(p - s * 2, n), A = bt(p + s * 2, n), { cumulative: F, total: K, currentValue: W } = S.prefixSum(p, { materializeOption: { materialize: !0, ranges: [{ from: V, to: A }] } });
2597
+ if (C.debug("[VirtualScroll] Scrolling to index:", p, "ItemBottom:", F, "Total height:", K, "ItemHeight:", W, "safeIndexFrom:", V, "safeIndexTo:", A), !K)
2584
2598
  return;
2585
- const Pt = Math.max(F - W, 0);
2586
- let pt = Pt;
2587
- u?.align === "bottom" ? pt = F - i : u?.align === "center" && (pt = Pt + W / 2 - i / 2), u?.offset && (pt -= u.offset), pt = Math.max(0, pt);
2588
- const ht = ge(pt, y.top), kt = k.current?.getContentSize() ?? K + y.top + y.bottom, Vt = Math.max(0, kt - i), Ot = Math.min(ht, Vt);
2599
+ const vt = Math.max(F - W, 0);
2600
+ let ht = vt;
2601
+ u?.align === "bottom" ? ht = F - i : u?.align === "center" && (ht = vt + W / 2 - i / 2), u?.offset && (ht -= u.offset), ht = Math.max(0, ht);
2602
+ const gt = be(ht, w.top), Ot = k.current?.getContentSize() ?? K + w.top + w.bottom, Vt = Math.max(0, Ot - i), Ft = Math.min(gt, Vt);
2589
2603
  U.current = {
2590
- index: m,
2604
+ index: p,
2591
2605
  align: u?.align,
2592
2606
  offset: u?.offset
2593
2607
  };
2594
- const Se = k.current?.getScrollPosition() ?? -1, De = Math.abs(Se - Ot) > 0.5;
2595
- ft.current = !1, ot.current = 0, De && (ft.current = !0, ot.current += 1, k.current?.scrollTo(Ot)), jt(K), nt(Ot, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", Ot, { original: ht, max: Vt });
2608
+ const ve = k.current?.getScrollPosition() ?? -1, De = Math.abs(ve - Ft) > 0.5;
2609
+ ut.current = !1, ot.current = 0, De && (ut.current = !0, ot.current += 1, k.current?.scrollTo(Ft)), Wt(K), rt(Ft, { immediate: !0 }), C.debug("[VirtualScroll] Setting scroll position to:", Ft, { original: gt, max: Vt });
2596
2610
  },
2597
- [v, s, n, y.top, y.bottom, i, nt]
2598
- ), ye = S(
2599
- (o) => {
2611
+ [S, s, n, w.top, w.bottom, i, rt]
2612
+ ), ye = v(
2613
+ (a) => {
2600
2614
  if (!k.current || n === 0)
2601
2615
  return;
2602
- const u = v.getTotal(), m = It(Math.floor(o), 0, u), { index: V, cumulative: A, currentValue: F } = v.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), W = (A ?? 0) - (F ?? 0) - m;
2603
- Wt(V, { offset: W });
2616
+ const u = S.getTotal(), p = xt(Math.floor(a), 0, u), { index: V, cumulative: A, currentValue: F } = S.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } }), W = (A ?? 0) - (F ?? 0) - p;
2617
+ Kt(V, { offset: W });
2604
2618
  },
2605
- [v, n, Wt]
2606
- ), fe = S(
2607
- (o) => {
2608
- const u = ne(f.current, y.top), m = typeof o == "function" ? o(u) : o;
2609
- ye(m);
2610
- const V = k.current?.getScrollPosition(), A = typeof V == "number" ? V : f.current;
2611
- return nt(A), A;
2619
+ [S, n, Kt]
2620
+ ), me = v(
2621
+ (a) => {
2622
+ const u = ne(d.current, w.top), p = typeof a == "function" ? a(u) : a;
2623
+ ye(p);
2624
+ const V = k.current?.getScrollPosition(), A = typeof V == "number" ? V : d.current;
2625
+ return rt(A), A;
2612
2626
  },
2613
- [y.top, ye, nt]
2614
- ), Ae = S(
2615
- (o, u) => {
2616
- C.debug("[VirtualScroll] Scroll position changed:", o);
2617
- const m = ft.current;
2618
- m && (ft.current = !1);
2627
+ [w.top, ye, rt]
2628
+ ), Ae = v(
2629
+ (a, u) => {
2630
+ C.debug("[VirtualScroll] Scroll position changed:", a);
2631
+ const p = ut.current;
2632
+ p && (ut.current = !1);
2619
2633
  const V = ot.current > 0;
2620
- if (V && (ot.current = 0), m || V || $t.current || (U.current = null), nt(o), B) {
2621
- if (m || V)
2634
+ if (V && (ot.current = 0), p || V || qt.current || (U.current = null), rt(a), B) {
2635
+ if (p || V)
2622
2636
  return;
2623
- const A = o - u;
2624
- if (C.debug("[VirtualScroll] Scroll diff:", A, "New:", o, "Prev:", u), Math.abs(A) > 1) {
2637
+ const A = a - u;
2638
+ if (C.debug("[VirtualScroll] Scroll diff:", A, "New:", a, "Prev:", u), Math.abs(A) > 1) {
2625
2639
  const F = A > 0 ? "down" : "up";
2626
- Nt(F), Dt(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", F), Mt.current && clearTimeout(Mt.current), Mt.current = setTimeout(() => {
2627
- Dt(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2640
+ Et(F), St(!0), C.debug("[VirtualScroll] Showing scroll buttons. Direction:", F), yt.current && clearTimeout(yt.current), yt.current = setTimeout(() => {
2641
+ St(!1), C.debug("[VirtualScroll] Hiding scroll buttons");
2628
2642
  }, 2e3);
2629
2643
  }
2630
2644
  }
2631
2645
  },
2632
- [nt, B]
2633
- ), te = At(() => ne(Bt, y.top), [y.top, Bt]), se = At(() => {
2634
- const o = v.getTotal(), u = Er(te, i, s, n, r, v, o);
2646
+ [rt, B]
2647
+ ), te = At(() => ne(Bt, w.top), [w.top, Bt]), ie = At(() => {
2648
+ const a = S.getTotal(), u = Nr(te, i, s, n, r, S, a);
2635
2649
  return C.debug("[VirtualScroll] Calculated rendering range:", () => ({
2636
2650
  ...u,
2637
2651
  scrollPosition: te,
2638
- renderingContentSize: o,
2652
+ renderingContentSize: a,
2639
2653
  overscanCount: s,
2640
2654
  viewportSize: i
2641
2655
  })), u;
2642
- }, [te, i, s, n, r, v]), { renderingStartIndex: Kt, renderingEndIndex: ee, visibleStartIndex: oe, visibleEndIndex: me } = se, re = S(
2643
- (o, u) => {
2644
- if (!p || n === 0)
2656
+ }, [te, i, s, n, r, S]), { renderingStartIndex: Ut, renderingEndIndex: ee, visibleStartIndex: se, visibleEndIndex: pe } = ie, re = v(
2657
+ (a, u) => {
2658
+ if (!h || n === 0)
2645
2659
  return;
2646
- const m = gt(o, n);
2660
+ const p = bt(a, n);
2647
2661
  if (!(u?.ensureVisible ?? !0)) {
2648
- const Vt = it.current.get(m);
2649
- Vt && (J.current = null, yt.current = m, ct(Vt));
2662
+ const Vt = nt.current.get(p);
2663
+ Vt && (J.current = null, Pt.current = p, dt(Vt));
2650
2664
  return;
2651
2665
  }
2652
- const A = v.prefixSum(m, { materializeOption: { materialize: !1 } }), F = A.currentValue, K = Math.max(A.cumulative - F, 0), W = K + F, Pt = ne(f.current, y.top), pt = Pt + i;
2653
- if (K < Pt || W > pt) {
2654
- Wt(m);
2655
- const Vt = it.current.get(m);
2656
- Vt ? (J.current = null, yt.current = m, ct(Vt)) : J.current = m;
2666
+ const A = S.prefixSum(p, { materializeOption: { materialize: !1 } }), F = A.currentValue, K = Math.max(A.cumulative - F, 0), W = K + F, vt = ne(d.current, w.top), ht = vt + i;
2667
+ if (K < vt || W > ht) {
2668
+ Kt(p);
2669
+ const Vt = nt.current.get(p);
2670
+ Vt ? (J.current = null, Pt.current = p, dt(Vt)) : J.current = p;
2657
2671
  return;
2658
2672
  }
2659
- const kt = it.current.get(m);
2660
- if (kt) {
2661
- J.current = null, yt.current = m, ct(kt);
2673
+ const Ot = nt.current.get(p);
2674
+ if (Ot) {
2675
+ J.current = null, Pt.current = p, dt(Ot);
2662
2676
  return;
2663
2677
  }
2664
- J.current = m;
2678
+ J.current = p;
2665
2679
  },
2666
- [p, n, v, y.top, Wt, ct, i]
2667
- ), we = S(
2668
- (o, u) => {
2669
- if (!p || o.defaultPrevented || o.altKey || o.metaKey || o.ctrlKey)
2680
+ [h, n, S, w.top, Kt, dt, i]
2681
+ ), we = v(
2682
+ (a, u) => {
2683
+ if (!h || a.defaultPrevented || a.altKey || a.metaKey || a.ctrlKey)
2670
2684
  return;
2671
- const m = o.target;
2672
- if (m) {
2673
- const V = m.tagName;
2674
- if (V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || m.isContentEditable)
2685
+ const p = a.target;
2686
+ if (p) {
2687
+ const V = p.tagName;
2688
+ if (V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || p.isContentEditable)
2675
2689
  return;
2676
2690
  }
2677
- if (o.key === "ArrowDown") {
2678
- u < n - 1 && (o.preventDefault(), re(u + 1));
2691
+ if (a.key === "ArrowDown") {
2692
+ u < n - 1 && (a.preventDefault(), re(u + 1));
2679
2693
  return;
2680
2694
  }
2681
- if (o.key === "ArrowUp") {
2682
- u > 0 && (o.preventDefault(), re(u - 1));
2695
+ if (a.key === "ArrowUp") {
2696
+ u > 0 && (a.preventDefault(), re(u - 1));
2683
2697
  return;
2684
2698
  }
2685
- if (o.key === "PageDown") {
2699
+ if (a.key === "PageDown") {
2686
2700
  if (u < n - 1) {
2687
- o.preventDefault();
2688
- const { visibleStartIndex: V, visibleEndIndex: A } = Ct.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = gt(Math.min(u + K, n - 1), n);
2701
+ a.preventDefault();
2702
+ const { visibleStartIndex: V, visibleEndIndex: A } = Rt.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = bt(Math.min(u + K, n - 1), n);
2689
2703
  re(W);
2690
2704
  }
2691
2705
  return;
2692
2706
  }
2693
- if (o.key === "PageUp" && u > 0) {
2694
- o.preventDefault();
2695
- const { visibleStartIndex: V, visibleEndIndex: A } = Ct.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = gt(u - K, n);
2707
+ if (a.key === "PageUp" && u > 0) {
2708
+ a.preventDefault();
2709
+ const { visibleStartIndex: V, visibleEndIndex: A } = Rt.current, F = Math.max(A - V + 1, 1), K = Math.max(F, 1), W = bt(u - K, n);
2696
2710
  re(W);
2697
2711
  }
2698
2712
  },
2699
- [p, n, re]
2700
- ), Re = S(
2701
- (o) => {
2702
- if (!p)
2713
+ [h, n, re]
2714
+ ), Re = v(
2715
+ (a) => {
2716
+ if (!h)
2703
2717
  return;
2704
- const u = gt(o, n);
2705
- J.current = null, yt.current = u, j?.(u);
2718
+ const u = bt(a, n);
2719
+ J.current = null, Pt.current = u, j?.(u);
2706
2720
  },
2707
- [p, n, j]
2721
+ [h, n, j]
2708
2722
  );
2709
2723
  Y(() => {
2710
- const o = k.current?.getScrollPosition() ?? 0, u = f.current, m = ne(u, y.top);
2724
+ const a = k.current?.getScrollPosition() ?? 0, u = d.current, p = ne(u, w.top);
2711
2725
  C.debug("[VirtualScroll] Range change effect triggered", () => ({
2712
- renderingStartIndex: Kt,
2726
+ renderingStartIndex: Ut,
2713
2727
  renderingEndIndex: ee,
2714
- visibleStartIndex: oe,
2715
- visibleEndIndex: me,
2728
+ visibleStartIndex: se,
2729
+ visibleEndIndex: pe,
2716
2730
  scrollPositionState: Bt,
2717
2731
  paneScrollPosition: u,
2718
- logicalScrollPosition: m,
2719
- contentSize: at,
2720
- scrollPaneScrollPosition: o
2721
- })), qt({
2722
- renderingStartIndex: Kt,
2732
+ logicalScrollPosition: p,
2733
+ contentSize: lt,
2734
+ scrollPaneScrollPosition: a
2735
+ })), Nt({
2736
+ renderingStartIndex: Ut,
2723
2737
  renderingEndIndex: ee,
2724
- visibleStartIndex: oe,
2725
- visibleEndIndex: me,
2726
- scrollPosition: m,
2727
- totalHeight: at
2738
+ visibleStartIndex: se,
2739
+ visibleEndIndex: pe,
2740
+ scrollPosition: p,
2741
+ totalHeight: lt
2728
2742
  });
2729
- }, [at, ee, Kt, y.top, qt, Bt, me, oe]);
2730
- const Ce = S(() => B ? /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": rt && wt !== null, children: wt === "up" ? /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ st(
2743
+ }, [lt, ee, Ut, w.top, Nt, Bt, pe, se]);
2744
+ const Ce = v(() => B ? /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": st && Mt !== null, children: Mt === "up" ? /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ it(
2731
2745
  "button",
2732
2746
  {
2733
2747
  type: "button",
2734
2748
  className: "aqvs-scroll-to-edge-button",
2735
- onClick: (m) => {
2736
- m.stopPropagation(), ft.current = !0, Wt(0), Dt(!1);
2749
+ onClick: (p) => {
2750
+ p.stopPropagation(), ut.current = !0, Kt(0), St(!1);
2737
2751
  },
2738
2752
  children: "Top"
2739
2753
  }
2740
- ) }) : /* @__PURE__ */ st("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ st(
2754
+ ) }) : /* @__PURE__ */ it("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ it(
2741
2755
  "button",
2742
2756
  {
2743
2757
  type: "button",
2744
2758
  className: "aqvs-scroll-to-edge-button",
2745
- onClick: (m) => {
2746
- m.stopPropagation(), ft.current = !0, Wt(n - 1), Dt(!1);
2759
+ onClick: (p) => {
2760
+ p.stopPropagation(), ut.current = !0, Kt(n - 1), St(!1);
2747
2761
  },
2748
2762
  children: "Bottom"
2749
2763
  }
2750
- ) }) }) : null, [B, rt, wt, Wt, n]), pe = T(0), { visibleItems: a, renderAnchor: b } = At(() => {
2764
+ ) }) }) : null, [B, st, Mt, Kt, n]), he = T(0), { visibleItems: o, renderAnchor: b } = At(() => {
2751
2765
  if (n === 0)
2752
2766
  return {
2753
- visibleItems: /* @__PURE__ */ st("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ st("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2767
+ visibleItems: /* @__PURE__ */ it("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ it("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2754
2768
  renderAnchor: 0
2755
2769
  };
2756
- const o = gt(Kt, n), u = gt(ee, n), { cumulative: m, currentValue: V } = v.prefixSum(o, { materializeOption: { materialize: !1 } }), A = m - V;
2757
- Number.isFinite(A) && Math.abs(A - pe.current) > Rr && (pe.current = A);
2758
- const F = pe.current, K = [], W = [];
2759
- let Pt = 0, pt = A;
2760
- for (let ht = o; ht <= u; ht++) {
2770
+ const a = bt(Ut, n), u = bt(ee, n), { cumulative: p, currentValue: V } = S.prefixSum(a, { materializeOption: { materialize: !1 } }), A = p - V;
2771
+ Number.isFinite(A) && Math.abs(A - he.current) > Cr && (he.current = A);
2772
+ const F = he.current, K = [], W = [];
2773
+ let vt = 0, ht = A;
2774
+ for (let gt = a; gt <= u; gt++) {
2761
2775
  if (W.length >= Ke) {
2762
- C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ke, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
2776
+ C.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: Ke, safeRenderingStartIndex: a, safeRenderingEndIndex: u });
2763
2777
  break;
2764
2778
  }
2765
- const kt = r(ht), Vt = v.get(ht), Ot = kt - Vt;
2766
- Ot !== 0 && K.push({ index: ht, value: kt });
2767
- const Se = pt + Pt, De = e ? e(ht) : ht;
2779
+ const Ot = r(gt), Vt = S.get(gt), Ft = Ot - Vt;
2780
+ Ft !== 0 && K.push({ index: gt, value: Ot });
2781
+ const ve = ht + vt, De = e ? e(gt) : gt;
2768
2782
  W.push(
2769
- /* @__PURE__ */ st(
2770
- Nr,
2783
+ /* @__PURE__ */ it(
2784
+ Vr,
2771
2785
  {
2772
- index: ht,
2773
- top: Se - F,
2774
- height: kt,
2775
- item: t(ht),
2776
- clipItemHeight: Rt,
2777
- enableKeyboardNavigation: p,
2786
+ index: gt,
2787
+ top: ve - F,
2788
+ height: Ot,
2789
+ item: t(gt),
2790
+ clipItemHeight: wt,
2791
+ enableKeyboardNavigation: h,
2778
2792
  onKeyDown: we,
2779
2793
  onFocus: Re,
2780
- registerItemRef: vt,
2794
+ registerItemRef: _t,
2781
2795
  children: I
2782
2796
  },
2783
2797
  De
2784
2798
  )
2785
- ), Pt += Ot, pt += Vt;
2799
+ ), vt += Ft, ht += Vt;
2786
2800
  }
2787
2801
  return K.length > 0 && Promise.resolve().then(() => {
2788
- if (Et.current)
2802
+ if (Ct.current)
2789
2803
  return;
2790
- let ht = 0;
2791
- for (const Ot of K)
2792
- if (Ot.index < oe) {
2793
- const Se = v.get(Ot.index);
2794
- ht += Ot.value - Se;
2804
+ let gt = 0;
2805
+ for (const Ft of K)
2806
+ if (Ft.index < se) {
2807
+ const ve = S.get(Ft.index);
2808
+ gt += Ft.value - ve;
2795
2809
  }
2796
- const kt = v.updates(K);
2797
- if (Et.current || typeof kt != "number")
2810
+ const Ot = S.updates(K);
2811
+ if (Ct.current || typeof Ot != "number")
2798
2812
  return;
2799
- jt(kt), C.debug("[VirtualScroll] Updated heights for items", K, "New total height:", kt);
2800
- const Vt = k.current?.getScrollPosition() ?? f.current;
2801
- if (ht !== 0) {
2802
- const Ot = Vt + ht;
2803
- zt(Ot), nt(Ot, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Vt, to: Ot, shiftAmount: ht });
2804
- } else Vt !== f.current && nt(Vt);
2813
+ Wt(Ot), C.debug("[VirtualScroll] Updated heights for items", K, "New total height:", Ot);
2814
+ const Vt = k.current?.getScrollPosition() ?? d.current;
2815
+ if (gt !== 0) {
2816
+ const Ft = Vt + gt;
2817
+ zt(Ft), rt(Ft, { immediate: !0 }), C.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Vt, to: Ft, shiftAmount: gt });
2818
+ } else Vt !== d.current && rt(Vt);
2805
2819
  }), { visibleItems: W, renderAnchor: F };
2806
2820
  }, [
2807
2821
  I,
2808
- Rt,
2809
- at,
2810
- p,
2822
+ wt,
2823
+ lt,
2824
+ h,
2811
2825
  n,
2812
- v,
2826
+ S,
2813
2827
  t,
2814
2828
  e,
2815
2829
  r,
2816
2830
  Re,
2817
2831
  we,
2818
2832
  zt,
2819
- vt,
2833
+ _t,
2820
2834
  ee,
2821
- Kt,
2822
- nt,
2823
- oe
2824
- ]), R = S(
2825
- (o) => {
2826
- const u = (_ ?? 0) > 0, m = Math.abs(o - Bt), V = u && m > 0.5 ? Bt : o, A = ne(V, y.top);
2835
+ Ut,
2836
+ rt,
2837
+ se
2838
+ ]), R = v(
2839
+ (a) => {
2840
+ const u = (_ ?? 0) > 0, p = Math.abs(a - Bt), V = u && p > 0.5 ? Bt : a, A = ne(V, w.top);
2827
2841
  if (C.debug("[VirtualScroll] Rendering visible items", () => ({
2828
- currentScrollPosition: o,
2842
+ currentScrollPosition: a,
2829
2843
  effectiveScrollPosition: A,
2830
- renderingStartIndex: Kt,
2844
+ renderingStartIndex: Ut,
2831
2845
  renderingEndIndex: ee,
2832
2846
  itemCount: n,
2833
2847
  viewportSize: i,
2834
2848
  callbackThrottleMs: _,
2835
- diff: m,
2849
+ diff: p,
2836
2850
  rawEffectiveScrollPosition: V
2837
2851
  })), n === 0)
2838
- return a;
2839
- const F = y.top + b - V, K = y.bottom > 0 ? /* @__PURE__ */ st(
2852
+ return o;
2853
+ const F = w.top + b - V, K = w.bottom > 0 ? /* @__PURE__ */ it(
2840
2854
  "div",
2841
2855
  {
2842
2856
  className: "aqvs-bottom-inset",
2843
2857
  style: {
2844
2858
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
2845
- top: v.getTotal() - b,
2846
- height: y.bottom
2859
+ top: S.getTotal() - b,
2860
+ height: w.bottom
2847
2861
  }
2848
2862
  },
2849
2863
  "virtualscroll-bottom-inset"
@@ -2851,49 +2865,49 @@ const wr = 1e4, kr = () => {
2851
2865
  return C.debug("[VirtualScroll] Rendering items", () => ({
2852
2866
  containerTop: F,
2853
2867
  logicalScrollPosition: te,
2854
- resolvedInsets: y,
2868
+ resolvedInsets: w,
2855
2869
  effectiveScrollPosition: A
2856
- })), /* @__PURE__ */ ue("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${F}px)`, willChange: "transform" }, children: [
2857
- a,
2870
+ })), /* @__PURE__ */ de("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${F}px)`, willChange: "transform" }, children: [
2871
+ o,
2858
2872
  K
2859
2873
  ] });
2860
2874
  },
2861
- [_, n, v, te, b, ee, Kt, y, Bt, i, a]
2875
+ [_, n, S, te, b, ee, Ut, w, Bt, i, o]
2862
2876
  ), L = At(
2863
2877
  () => ({
2864
- renderingStartIndex: se.renderingStartIndex,
2865
- renderingEndIndex: se.renderingEndIndex,
2866
- visibleStartIndex: se.visibleStartIndex,
2867
- visibleEndIndex: se.visibleEndIndex,
2878
+ renderingStartIndex: ie.renderingStartIndex,
2879
+ renderingEndIndex: ie.renderingEndIndex,
2880
+ visibleStartIndex: ie.visibleStartIndex,
2881
+ visibleEndIndex: ie.visibleEndIndex,
2868
2882
  scrollPosition: te,
2869
- totalHeight: v.getTotal()
2883
+ totalHeight: S.getTotal()
2870
2884
  // contentSize (State) ではなく最新値を反映
2871
2885
  }),
2872
2886
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
2873
2887
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
2874
- [se, te, v, at]
2888
+ [ie, te, S, lt]
2875
2889
  );
2876
2890
  Y(() => {
2877
- Ct.current = L;
2891
+ Rt.current = L;
2878
2892
  }, [L]), Be(
2879
- mt,
2893
+ pt,
2880
2894
  () => ({
2881
2895
  getScrollPosition: () => k.current?.getScrollPosition() ?? -1,
2882
2896
  getContentSize: () => k.current?.getContentSize() ?? -1,
2883
2897
  getViewportSize: () => k.current?.getViewportSize() ?? -1,
2884
- scrollTo: fe,
2885
- scrollToIndex: Wt,
2886
- getFenwickTreeTotalHeight: () => v.getTotal(),
2887
- getFenwickSize: () => v.getSize(),
2898
+ scrollTo: me,
2899
+ scrollToIndex: Kt,
2900
+ getFenwickTreeTotalHeight: () => S.getTotal(),
2901
+ getFenwickSize: () => S.getSize(),
2888
2902
  focusItemAtIndex: re,
2889
- getRange: () => Ct.current,
2890
- updateItemSize: ve
2903
+ getRange: () => Rt.current,
2904
+ updateItemSize: Se
2891
2905
  }),
2892
- [fe, Wt, v, re, ve]
2906
+ [me, Kt, S, re, Se]
2893
2907
  );
2894
- const X = v.getTotal() + y.top + y.bottom;
2895
- return /* @__PURE__ */ st(
2896
- Tr,
2908
+ const X = S.getTotal() + w.top + w.bottom;
2909
+ return /* @__PURE__ */ it(
2910
+ Sr,
2897
2911
  {
2898
2912
  ref: k,
2899
2913
  contentSize: X,
@@ -2901,39 +2915,39 @@ const wr = 1e4, kr = () => {
2901
2915
  className: l,
2902
2916
  testId: c,
2903
2917
  onScroll: Ae,
2904
- background: M,
2918
+ background: P,
2905
2919
  tapScrollCircleOptions: q,
2906
- inertiaOptions: St,
2920
+ inertiaOptions: Tt,
2907
2921
  itemCount: n,
2908
- scrollBarWidth: Tt,
2922
+ scrollBarWidth: It,
2909
2923
  enableThumbDrag: D,
2910
2924
  enableTrackClick: O,
2911
- enableArrowButtons: P,
2925
+ enableArrowButtons: M,
2912
2926
  enablePointerDrag: et,
2913
2927
  pointerDragInputs: G,
2914
2928
  renderThumbOverlay: N,
2915
2929
  wheelSpeedMultiplier: $,
2916
2930
  onWheelHorizontal: tt,
2917
- contentInsets: y,
2918
- visibleStartIndex: oe,
2919
- visibleEndIndex: me,
2931
+ contentInsets: w,
2932
+ visibleStartIndex: se,
2933
+ visibleEndIndex: pe,
2920
2934
  renderOverlay: Ce,
2921
- initialScrollPosition: Xt.position,
2935
+ initialScrollPosition: $t.position,
2922
2936
  children: R
2923
2937
  }
2924
2938
  );
2925
- }, Or = Ye(Vr);
2939
+ }, Fr = Ye(Ar);
2926
2940
  export {
2927
- le as FenwickMapTree,
2941
+ ae as FenwickMapTree,
2928
2942
  xr as ScrollBar,
2929
- Tr as ScrollPane,
2943
+ Sr as ScrollPane,
2930
2944
  Ze as TAP_SCROLL_SPEED_DEFAULTS,
2931
- Or as VirtualScroll,
2945
+ Fr as VirtualScroll,
2932
2946
  br as computeAutoTapScrollMaxSpeedMultiplier,
2933
2947
  gr as computeTapScrollSpeed,
2934
- It as minmax,
2935
- _r as tapScrollCircleSampleVisual,
2948
+ xt as minmax,
2949
+ kr as tapScrollCircleSampleVisual,
2936
2950
  Mr as useFenwickMapTree,
2937
- kr as useHeightCache,
2938
- yr as useLruCache
2951
+ Or as useHeightCache,
2952
+ wr as useLruCache
2939
2953
  };