@aiquants/virtualscroll 2.6.0 → 3.0.0

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 le, jsxs as Tt, Fragment as ur } from "react/jsx-runtime";
2
- import br, { memo as xr, forwardRef as Gt, useState as nt, useRef as g, useCallback as v, useImperativeHandle as Zt, useMemo as Ye, useLayoutEffect as it, useEffect as X, useId as Ir } from "react";
3
- import { twMerge as Rt } from "tailwind-merge";
1
+ import { jsx as de, jsxs as Mt, Fragment as dr } from "react/jsx-runtime";
2
+ import xr, { memo as Ir, forwardRef as Zt, useState as rt, useRef as g, useCallback as S, useImperativeHandle as Jt, useMemo as Fe, useLayoutEffect as nt, useEffect as q, useId as Sr } from "react";
3
+ import { twMerge as Et } from "tailwind-merge";
4
4
  class T {
5
5
  level;
6
6
  prefix;
@@ -146,17 +146,17 @@ class T {
146
146
  this.level <= 3 && this.impl.error(...this.formatMessage(T.resolveLazy(e)), ...t.map(T.resolveLazy));
147
147
  }
148
148
  }
149
- const tr = {
149
+ const rr = {
150
150
  active: !1,
151
151
  offsetX: 0,
152
152
  offsetY: 0,
153
153
  distance: 0,
154
154
  direction: 0,
155
155
  pointerId: null
156
- }, Xt = 6, Sr = 8, vr = ({ dragState: r, normalizedDistance: e }) => {
156
+ }, $t = 6, vr = 8, wr = ({ dragState: r, normalizedDistance: e }) => {
157
157
  const t = 1 + e * 0.18, n = 0.16 + e * 0.24, i = 0.38 + e * 0.28, s = r.active ? "80ms ease-out" : "220ms ease";
158
- return /* @__PURE__ */ Tt(ur, { children: [
159
- /* @__PURE__ */ le(
158
+ return /* @__PURE__ */ Mt(dr, { children: [
159
+ /* @__PURE__ */ de(
160
160
  "div",
161
161
  {
162
162
  className: "aqvs-tap-scroll-circle-visual-outer",
@@ -168,7 +168,7 @@ const tr = {
168
168
  }
169
169
  }
170
170
  ),
171
- /* @__PURE__ */ le(
171
+ /* @__PURE__ */ de(
172
172
  "div",
173
173
  {
174
174
  className: "aqvs-tap-scroll-circle-inner",
@@ -181,154 +181,154 @@ const tr = {
181
181
  }
182
182
  )
183
183
  ] });
184
- }, dr = xr(
185
- Gt(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
186
- const [p, b] = nt(tr), I = g(null), w = g(null), C = g({ x: 0, y: 0 }), h = g(null), z = g(0), J = v(
187
- (S) => {
188
- b(S), r(S);
184
+ }, fr = Ir(
185
+ Zt(({ onDragChange: r, className: e, maxVisualDistance: t = 160, size: n = 40, style: i, opacity: s = 1, renderVisual: a }, c) => {
186
+ const [f, b] = rt(rr), I = g(null), w = g(null), V = g({ x: 0, y: 0 }), h = g(null), z = g(0), G = S(
187
+ (v) => {
188
+ b(v), r(v);
189
189
  },
190
190
  [r]
191
- ), B = v(
192
- (S, $, Ve = !1) => {
193
- const { x: Qe, y: N } = C.current, De = S - Qe, Ge = $ - N, ye = Math.abs(Ge), Ce = ye < Xt ? 0 : Ge < 0 ? -1 : 1, Ze = z.current;
194
- let $e = Ce;
195
- const H = Xt + Sr;
196
- Ce === 0 ? Ze !== 0 && ye < H ? $e = Ze : ($e = 0, Ve || (z.current = 0)) : Ce !== Ze && Ze !== 0 && ye < H ? $e = Ze : z.current = Ce, J({
197
- active: Ve || ye >= Xt,
198
- offsetX: De,
199
- offsetY: Ge,
200
- distance: ye,
201
- direction: $e,
191
+ ), H = S(
192
+ (v, W, ge = !1) => {
193
+ const { x: qe, y: ee } = V.current, X = v - qe, Xe = W - ee, $e = Math.abs(Xe), ze = $e < $t ? 0 : Xe < 0 ? -1 : 1, Ce = z.current;
194
+ let je = ze;
195
+ const Ge = $t + vr;
196
+ ze === 0 ? Ce !== 0 && $e < Ge ? je = Ce : (je = 0, ge || (z.current = 0)) : ze !== Ce && Ce !== 0 && $e < Ge ? je = Ce : z.current = ze, G({
197
+ active: ge || $e >= $t,
198
+ offsetX: X,
199
+ offsetY: Xe,
200
+ distance: $e,
201
+ direction: je,
202
202
  pointerId: I.current
203
203
  });
204
204
  },
205
- [J]
206
- ), de = v((S) => {
207
- if (S === null)
205
+ [G]
206
+ ), pe = S((v) => {
207
+ if (v === null)
208
208
  return;
209
- const $ = h.current;
210
- $?.hasPointerCapture(S) && $.releasePointerCapture(S);
211
- }, []), fe = v(
212
- (S = !1) => {
213
- S && de(I.current), I.current = null, w.current = null, z.current = 0, J(tr);
209
+ const W = h.current;
210
+ W?.hasPointerCapture(v) && W.releasePointerCapture(v);
211
+ }, []), me = S(
212
+ (v = !1) => {
213
+ v && pe(I.current), I.current = null, w.current = null, z.current = 0, G(rr);
214
214
  },
215
- [J, de]
216
- ), ne = v(
217
- (S) => {
218
- if (I.current !== null && I.current !== S.pointerId) {
219
- w.current = { pointerId: S.pointerId, clientX: S.clientX, clientY: S.clientY }, S.preventDefault(), S.stopPropagation();
215
+ [G, pe]
216
+ ), oe = S(
217
+ (v) => {
218
+ if (I.current !== null && I.current !== v.pointerId) {
219
+ w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY }, v.preventDefault(), v.stopPropagation();
220
220
  return;
221
221
  }
222
- S.preventDefault(), S.stopPropagation();
223
- const $ = h.current ?? S.currentTarget, { left: Ve, top: Qe, width: N, height: De } = $.getBoundingClientRect();
224
- C.current = { x: Ve + N / 2, y: Qe + De / 2 }, I.current = S.pointerId;
222
+ v.preventDefault(), v.stopPropagation();
223
+ const W = h.current ?? v.currentTarget, { left: ge, top: qe, width: ee, height: X } = W.getBoundingClientRect();
224
+ V.current = { x: ge + ee / 2, y: qe + X / 2 }, I.current = v.pointerId;
225
225
  try {
226
- $.setPointerCapture(S.pointerId);
226
+ W.setPointerCapture(v.pointerId);
227
227
  } catch {
228
228
  }
229
- B(S.clientX, S.clientY, !0);
229
+ H(v.clientX, v.clientY, !0);
230
230
  },
231
- [B]
232
- ), ae = v(
233
- (S) => {
234
- if (I.current !== S.pointerId) {
235
- w.current !== null && w.current.pointerId === S.pointerId && (w.current = { pointerId: S.pointerId, clientX: S.clientX, clientY: S.clientY });
231
+ [H]
232
+ ), ce = S(
233
+ (v) => {
234
+ if (I.current !== v.pointerId) {
235
+ w.current !== null && w.current.pointerId === v.pointerId && (w.current = { pointerId: v.pointerId, clientX: v.clientX, clientY: v.clientY });
236
236
  return;
237
237
  }
238
- S.preventDefault(), B(S.clientX, S.clientY);
238
+ v.preventDefault(), H(v.clientX, v.clientY);
239
239
  },
240
- [B]
241
- ), pe = v(
242
- (S) => {
243
- if (I.current !== S.pointerId) {
244
- w.current !== null && w.current.pointerId === S.pointerId && (w.current = null);
240
+ [H]
241
+ ), he = S(
242
+ (v) => {
243
+ if (I.current !== v.pointerId) {
244
+ w.current !== null && w.current.pointerId === v.pointerId && (w.current = null);
245
245
  return;
246
246
  }
247
- S.preventDefault(), S.stopPropagation();
248
- const $ = w.current;
249
- if (w.current = null, $ !== null) {
250
- de(S.pointerId);
251
- const Ve = h.current;
252
- let Qe = !0;
253
- if (Ve !== null && typeof Ve.setPointerCapture == "function")
247
+ v.preventDefault(), v.stopPropagation();
248
+ const W = w.current;
249
+ if (w.current = null, W !== null) {
250
+ pe(v.pointerId);
251
+ const ge = h.current;
252
+ let qe = !0;
253
+ if (ge !== null && typeof ge.setPointerCapture == "function")
254
254
  try {
255
- Ve.setPointerCapture($.pointerId);
256
- } catch (N) {
257
- (typeof N == "object" && N !== null && "name" in N ? N.name : void 0) === "NotFoundError" && (Qe = !1);
255
+ ge.setPointerCapture(W.pointerId);
256
+ } catch (ee) {
257
+ (typeof ee == "object" && ee !== null && "name" in ee ? ee.name : void 0) === "NotFoundError" && (qe = !1);
258
258
  }
259
- if (Qe) {
260
- I.current = $.pointerId, B($.clientX, $.clientY, !0);
259
+ if (qe) {
260
+ I.current = W.pointerId, H(W.clientX, W.clientY, !0);
261
261
  return;
262
262
  }
263
263
  }
264
- fe(!0);
264
+ me(!0);
265
265
  },
266
- [fe, de, B]
267
- ), P = v(
268
- (S) => {
269
- S.target === S.currentTarget && I.current === S.pointerId && fe(!1);
266
+ [me, pe, H]
267
+ ), P = S(
268
+ (v) => {
269
+ v.target === v.currentTarget && I.current === v.pointerId && me(!1);
270
270
  },
271
- [fe]
271
+ [me]
272
272
  );
273
- Zt(
273
+ Jt(
274
274
  c,
275
275
  () => ({
276
276
  reset: () => {
277
- fe(!0);
277
+ me(!0);
278
278
  },
279
279
  getElement: () => h.current
280
280
  }),
281
- [fe]
281
+ [me]
282
282
  );
283
- const _ = Math.min(Math.max(s, 0), 1), M = n / 64, j = Math.min(p.distance, t) / t, te = p.direction * j * 10 * M, G = a ?? vr, Y = {
284
- dragState: p,
285
- normalizedDistance: j,
283
+ const _ = Math.min(Math.max(s, 0), 1), M = n / 64, Z = Math.min(f.distance, t) / t, Q = f.direction * Z * 10 * M, U = a ?? wr, Se = {
284
+ dragState: f,
285
+ normalizedDistance: Z,
286
286
  sizeScale: M,
287
287
  size: n,
288
288
  opacity: _
289
- }, Z = {
289
+ }, C = {
290
290
  ...i,
291
291
  width: n,
292
292
  height: n,
293
- transform: `translateY(${te}px)`
293
+ transform: `translateY(${Q}px)`
294
294
  };
295
- return Z.opacity = _, /* @__PURE__ */ le(
295
+ return C.opacity = _, /* @__PURE__ */ de(
296
296
  "div",
297
297
  {
298
298
  ref: h,
299
299
  "data-testid": "virtual-scroll-tap-circle",
300
- className: Rt("aqvs-tap-scroll-circle", e),
301
- style: Z,
300
+ className: Et("aqvs-tap-scroll-circle", e),
301
+ style: C,
302
302
  tabIndex: -1,
303
- onPointerDown: ne,
304
- onPointerMove: ae,
305
- onPointerUp: pe,
306
- onPointerCancel: pe,
303
+ onPointerDown: oe,
304
+ onPointerMove: ce,
305
+ onPointerUp: he,
306
+ onPointerCancel: he,
307
307
  onLostPointerCapture: P,
308
308
  role: "presentation",
309
- children: G(Y)
309
+ children: U(Se)
310
310
  }
311
311
  );
312
312
  })
313
313
  );
314
- dr.displayName = "TapScrollCircle";
315
- const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scroll-cancel", rr = 20, wr = 250, Tr = 60, Mr = 20, Pr = 20, fr = {
314
+ fr.displayName = "TapScrollCircle";
315
+ const le = (r, e, t) => Math.max(e, Math.min(t, r)), Gt = "virtualscroll:tap-scroll-cancel", nr = 20, Tr = 250, Pr = 60, Mr = 20, yr = 20, pr = {
316
316
  /** 速度が最大に達する引き距離 (px)。`maxVisualDistance` の既定値。 */
317
317
  maxDistance: 240,
318
318
  /** 最小速度倍率 (ビューポート比)。 */
319
319
  minSpeedMultiplier: 0.2
320
- }, yr = fr.maxDistance, nr = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, $t = 2.2, Rr = 8, Er = 120, Nr = 1 / 10, ut = {
320
+ }, Rr = pr.maxDistance, ir = { active: !1, offsetX: 0, offsetY: 0, distance: 0, direction: 0, pointerId: null }, Ut = 2.2, Er = 8, Nr = 120, Vr = 1 / 10, dt = {
321
321
  enabled: !0,
322
322
  size: 40,
323
323
  offsetX: -80,
324
324
  offsetY: 0,
325
325
  className: void 0,
326
- maxVisualDistance: yr,
327
- minSpeedMultiplier: fr.minSpeedMultiplier,
326
+ maxVisualDistance: Rr,
327
+ minSpeedMultiplier: pr.minSpeedMultiplier,
328
328
  opacity: 0.9,
329
329
  renderVisual: void 0,
330
330
  maxSpeedCurve: void 0
331
- }, Vr = (r) => r ? {
331
+ }, zr = (r) => r ? {
332
332
  mainSizeKey: "width",
333
333
  crossSizeKey: "height",
334
334
  positionKey: "left",
@@ -349,69 +349,69 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
349
349
  directionClass: "aqvs-scrollbar-vertical",
350
350
  orientation: "vertical"
351
351
  }, Cr = (r, e) => {
352
- const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : Or(e);
352
+ const t = r?.maxSpeedMultiplier, n = typeof t == "number" ? t : _r(e);
353
353
  return {
354
- enabled: r?.enabled ?? ut.enabled,
355
- size: r?.size ?? ut.size,
356
- offsetX: r?.offsetX ?? ut.offsetX,
357
- offsetY: r?.offsetY ?? ut.offsetY,
358
- className: r?.className ?? ut.className,
359
- maxVisualDistance: r?.maxVisualDistance ?? ut.maxVisualDistance,
354
+ enabled: r?.enabled ?? dt.enabled,
355
+ size: r?.size ?? dt.size,
356
+ offsetX: r?.offsetX ?? dt.offsetX,
357
+ offsetY: r?.offsetY ?? dt.offsetY,
358
+ className: r?.className ?? dt.className,
359
+ maxVisualDistance: r?.maxVisualDistance ?? dt.maxVisualDistance,
360
360
  maxSpeedMultiplier: n,
361
- minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? ut.minSpeedMultiplier, 0),
362
- opacity: oe(r?.opacity ?? ut.opacity, 0, 1),
363
- renderVisual: r?.renderVisual ?? ut.renderVisual,
364
- maxSpeedCurve: r?.maxSpeedCurve ?? ut.maxSpeedCurve
361
+ minSpeedMultiplier: Math.max(r?.minSpeedMultiplier ?? dt.minSpeedMultiplier, 0),
362
+ opacity: le(r?.opacity ?? dt.opacity, 0, 1),
363
+ renderVisual: r?.renderVisual ?? dt.renderVisual,
364
+ maxSpeedCurve: r?.maxSpeedCurve ?? dt.maxSpeedCurve
365
365
  };
366
- }, zr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => Ye(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), Dr = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
367
- const i = g(null), s = g(null), a = g(null), c = v(() => {
366
+ }, Dr = ({ isDragging: r, isThumbHovered: e, enableThumbDrag: t }) => Fe(() => t ? r ? "dragging" : e ? "hover" : "idle" : "disabled", [t, r, e]), Ar = ({ canUseArrowButtons: r, enableArrowButtons: e, resetTapScroll: t, scrollByStep: n }) => {
367
+ const i = g(null), s = g(null), a = g(null), c = S(() => {
368
368
  i.current !== null && (window.clearInterval(i.current), i.current = null), s.current !== null && (window.clearTimeout(s.current), s.current = null), a.current !== null && (window.removeEventListener("pointerup", a.current), window.removeEventListener("pointercancel", a.current), window.removeEventListener("blur", a.current), a.current = null);
369
- }, []), p = v(() => {
369
+ }, []), f = S(() => {
370
370
  c();
371
- }, [c]), b = v(
372
- (w) => (C) => {
371
+ }, [c]), b = S(
372
+ (w) => (V) => {
373
373
  if (!r)
374
374
  return;
375
- C.cancelable && C.preventDefault(), C.stopPropagation(), t(), c(), n(w), s.current = window.setTimeout(() => {
375
+ V.cancelable && V.preventDefault(), V.stopPropagation(), t(), c(), n(w), s.current = window.setTimeout(() => {
376
376
  i.current = window.setInterval(() => {
377
377
  n(w);
378
- }, Tr);
379
- }, wr);
378
+ }, Pr);
379
+ }, Tr);
380
380
  const h = () => c();
381
381
  a.current = h, window.addEventListener("pointerup", h), window.addEventListener("pointercancel", h), window.addEventListener("blur", h);
382
382
  },
383
383
  [r, c, t, n]
384
- ), I = v(
385
- (w) => (C) => {
386
- e && (C.key === "Enter" || C.key === " " || C.key === "Spacebar") && (C.preventDefault(), n(w));
384
+ ), I = S(
385
+ (w) => (V) => {
386
+ e && (V.key === "Enter" || V.key === " " || V.key === "Spacebar") && (V.preventDefault(), n(w));
387
387
  },
388
388
  [e, n]
389
389
  );
390
- return X(() => {
390
+ return q(() => {
391
391
  r || c();
392
- }, [r, c]), X(() => () => {
392
+ }, [r, c]), q(() => () => {
393
393
  c();
394
- }, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: p, handleArrowKeyDown: I };
395
- }, Ar = 700, It = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Lr = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
396
- const c = Math.max(It(r, 0), 0), p = It(e, 0), b = p > 0 ? Math.min(c, p) / p : 1, I = Math.max(It(t, 0), 0), w = Math.max(It(n, 0), 0), C = Math.max(It(i, 0), 0), h = Math.max(I * w, 40), z = s ? h : 1200, J = Math.max(I * C, z), B = a ? Math.max(It(a.exponentialScale, C), 0) : 0, de = a ? Math.min(J, Math.max(I * B, h)) : J, fe = Math.max(de, h);
397
- let ne = b ** 1.1;
394
+ }, [c]), { handleArrowPointerDown: b, handleArrowPointerUp: f, handleArrowKeyDown: I };
395
+ }, Lr = 700, It = (r, e) => typeof r == "number" && Number.isFinite(r) ? r : e, Or = ({ distance: r, maxDistance: e, viewportSize: t, minSpeedMultiplier: n, maxSpeedMultiplier: i, hasCustomMaxSpeedMultiplier: s, curve: a }) => {
396
+ const c = Math.max(It(r, 0), 0), f = It(e, 0), b = f > 0 ? Math.min(c, f) / f : 1, I = Math.max(It(t, 0), 0), w = Math.max(It(n, 0), 0), V = Math.max(It(i, 0), 0), h = Math.max(I * w, 40), z = s ? h : 1200, G = Math.max(I * V, z), H = a ? Math.max(It(a.exponentialScale, V), 0) : 0, pe = a ? Math.min(G, Math.max(I * H, h)) : G, me = Math.max(pe, h);
397
+ let oe = b ** 1.1;
398
398
  if (a) {
399
- const pe = Math.min(Math.max(It(a.exponentialSteepness, 0), 0), Ar);
400
- if (pe === 0)
401
- ne = b;
399
+ const he = Math.min(Math.max(It(a.exponentialSteepness, 0), 0), Lr);
400
+ if (he === 0)
401
+ oe = b;
402
402
  else {
403
- const P = Math.expm1(pe) || 1;
404
- ne = Math.min(Math.max(Math.expm1(pe * b) / P, 0), 1);
403
+ const P = Math.expm1(he) || 1;
404
+ oe = Math.min(Math.max(Math.expm1(he * b) / P, 0), 1);
405
405
  }
406
406
  }
407
- const ae = Math.min(Math.max(It(a?.easedOffset, 0), 0), 1);
408
- return h + (fe - h) * (ae + (1 - ae) * ne);
409
- }, Or = (r) => {
407
+ const ce = Math.min(Math.max(It(a?.easedOffset, 0), 0), 1);
408
+ return h + (me - h) * (ce + (1 - ce) * oe);
409
+ }, _r = (r) => {
410
410
  if (!r || r <= 0)
411
- return $t;
412
- const e = Math.max(1, r), t = Math.log10(e), n = $t + t * Rr;
413
- return oe(n, $t, Er);
414
- }, _r = ({
411
+ return Ut;
412
+ const e = Math.max(1, r), t = Math.log10(e), n = Ut + t * Er;
413
+ return le(n, Ut, Nr);
414
+ }, kr = ({
415
415
  contentSize: r,
416
416
  viewportSize: e,
417
417
  scrollPosition: t,
@@ -420,247 +420,247 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
420
420
  enableTrackClick: s = !0,
421
421
  enableArrowButtons: a = !0,
422
422
  horizontal: c = !1,
423
- scrollBarWidth: p = 12,
423
+ scrollBarWidth: f = 12,
424
424
  className: b,
425
425
  ariaControls: I,
426
426
  tapScrollCircleOptions: w,
427
- itemCount: C,
427
+ itemCount: V,
428
428
  renderThumbOverlay: h,
429
429
  visibleStartIndex: z,
430
- visibleEndIndex: J
430
+ visibleEndIndex: G
431
431
  }) => {
432
- const [B, de] = nt(!1), [fe, ne] = nt(!1), [ae, pe] = nt(!1), P = g(null), _ = g({
432
+ const [H, pe] = rt(!1), [me, oe] = rt(!1), [ce, he] = rt(!1), P = g(null), _ = g({
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
- }), M = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), j = g(t), te = g(n), G = g(nr), Y = g(null), Z = g(null), S = g(null), $ = g(0), Ve = g(0), Qe = Ye(() => Cr(w, C), [C, w]), N = Ye(() => Vr(c), [c]), {
440
- enabled: De,
441
- size: Ge,
442
- offsetX: ye,
443
- offsetY: Ce,
444
- className: Ze,
445
- maxVisualDistance: $e,
446
- maxSpeedMultiplier: H,
447
- minSpeedMultiplier: Ae,
448
- opacity: ie,
449
- renderVisual: he,
450
- maxSpeedCurve: Be
451
- } = Qe, Le = g({
439
+ }), M = g({ pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 }), Z = g(t), Q = g(n), U = g(ir), Se = g(null), C = g(null), v = g(null), W = g(0), ge = g(0), qe = Fe(() => Cr(w, V), [V, w]), ee = Fe(() => zr(c), [c]), {
440
+ enabled: X,
441
+ size: Xe,
442
+ offsetX: $e,
443
+ offsetY: ze,
444
+ className: Ce,
445
+ maxVisualDistance: je,
446
+ maxSpeedMultiplier: Ge,
447
+ minSpeedMultiplier: K,
448
+ opacity: Ae,
449
+ renderVisual: ue,
450
+ maxSpeedCurve: be
451
+ } = qe, Te = g({
452
452
  viewportSize: e,
453
453
  maxScrollPosition: Math.max(r - e, 0),
454
454
  scrollBarVisible: r > e,
455
- effectiveTapMaxDistance: Math.max($e, 1),
456
- tapCircleMaxSpeedMultiplier: H,
457
- tapCircleMinSpeedMultiplier: Ae,
458
- tapCircleMaxSpeedCurve: Be,
455
+ effectiveTapMaxDistance: Math.max(je, 1),
456
+ tapCircleMaxSpeedMultiplier: Ge,
457
+ tapCircleMinSpeedMultiplier: K,
458
+ tapCircleMaxSpeedCurve: be,
459
459
  tapScrollCircleOptions: w,
460
460
  effectiveTrackLength: 0,
461
461
  onScroll: n,
462
462
  scrollPosition: t
463
- }), { mainSizeKey: dt, crossSizeKey: R, positionKey: ft, selectDelta: pt, getPointerCoordinate: V, arrowLabels: Q, arrowIcons: We, directionClass: gt, orientation: He } = N, et = Math.max($e, 1), ce = e / r, d = Math.max(e - p * 2, 0), W = ce * d, U = Math.min(Math.max(rr, W || 0), d || rr), k = r - e, q = Math.max(d - U, 0), Ie = k <= 0 || q <= 0 ? 0 : oe(t / k * q, 0, q), Re = Ie + U / 2, ee = r > e || B, Oe = ee && a;
464
- it(() => {
465
- Le.current = {
463
+ }), { mainSizeKey: et, crossSizeKey: mt, positionKey: N, selectDelta: it, getPointerCoordinate: vt, arrowLabels: E, arrowIcons: J, directionClass: Ze, orientation: ht } = ee, Le = Math.max(je, 1), st = e / r, ie = Math.max(e - f * 2, 0), p = st * ie, F = Math.min(Math.max(nr, p || 0), ie || nr), B = r - e, Y = Math.max(ie - F, 0), te = B <= 0 || Y <= 0 ? 0 : le(t / B * Y, 0, Y), Me = te + F / 2, j = r > e || H, re = j && a;
464
+ nt(() => {
465
+ Te.current = {
466
466
  viewportSize: e,
467
- maxScrollPosition: k,
468
- scrollBarVisible: ee,
469
- effectiveTapMaxDistance: et,
470
- tapCircleMaxSpeedMultiplier: H,
471
- tapCircleMinSpeedMultiplier: Ae,
472
- tapCircleMaxSpeedCurve: Be,
467
+ maxScrollPosition: B,
468
+ scrollBarVisible: j,
469
+ effectiveTapMaxDistance: Le,
470
+ tapCircleMaxSpeedMultiplier: Ge,
471
+ tapCircleMinSpeedMultiplier: K,
472
+ tapCircleMaxSpeedCurve: be,
473
473
  tapScrollCircleOptions: w,
474
- effectiveTrackLength: q,
474
+ effectiveTrackLength: Y,
475
475
  onScroll: n,
476
476
  scrollPosition: t
477
477
  };
478
- }), it(() => {
479
- j.current = t;
480
- }, [t]), it(() => {
481
- te.current = n;
482
- }, [n]), X(() => {
483
- i || ne(!1);
478
+ }), nt(() => {
479
+ Z.current = t;
480
+ }, [t]), nt(() => {
481
+ Q.current = n;
482
+ }, [n]), q(() => {
483
+ i || oe(!1);
484
484
  }, [i]);
485
- const ge = zr({ isDragging: B, isThumbHovered: fe, enableThumbDrag: i }), ze = v((l, x) => {
486
- const y = Le.current, D = x ?? j.current;
487
- if (te.current) {
488
- const ve = te.current(l, D);
489
- if (typeof ve == "number" && Number.isFinite(ve))
490
- return j.current = ve, ve;
485
+ const De = Dr({ isDragging: H, isThumbHovered: me, enableThumbDrag: i }), ne = S((l, x) => {
486
+ const R = Te.current, D = x ?? Z.current;
487
+ if (Q.current) {
488
+ const Ee = Q.current(l, D);
489
+ if (typeof Ee == "number" && Number.isFinite(Ee))
490
+ return Z.current = Ee, Ee;
491
491
  }
492
- const K = typeof l == "function" ? l(D) : l, se = Math.max(y.maxScrollPosition, 0), Ne = y.scrollBarVisible ? oe(K, 0, se) : 0;
493
- return j.current = Ne, Ne;
494
- }, []), Ue = v(
492
+ const $ = typeof l == "function" ? l(D) : l, ye = Math.max(R.maxScrollPosition, 0), Re = R.scrollBarVisible ? le($, 0, ye) : 0;
493
+ return Z.current = Re, Re;
494
+ }, []), Je = S(
495
495
  (l) => {
496
- const x = Le.current, y = j.current;
496
+ const x = Te.current, R = Z.current;
497
497
  if (!x.scrollBarVisible || x.maxScrollPosition <= 0) {
498
- const Ke = ze(0, y), Pt = Ke - y;
499
- return { nextPosition: Ke, actualDelta: Pt, reachedBoundary: !0 };
498
+ const Ye = ne(0, R), xt = Ye - R;
499
+ return { nextPosition: Ye, actualDelta: xt, reachedBoundary: !0 };
500
500
  }
501
501
  if (l === 0)
502
- return { nextPosition: y, actualDelta: 0, reachedBoundary: !1 };
503
- const K = ze((Ke) => oe(Ke + l, 0, x.maxScrollPosition), y), se = K - y, Ne = l < 0 && y + l <= 0, ve = l > 0 && y + l >= x.maxScrollPosition, at = l < 0 && (K <= 0 || Ne && se === 0) || l > 0 && (K >= x.maxScrollPosition || ve && se === 0);
504
- return { nextPosition: K, actualDelta: se, reachedBoundary: at };
502
+ return { nextPosition: R, actualDelta: 0, reachedBoundary: !1 };
503
+ const $ = ne((Ye) => le(Ye + l, 0, x.maxScrollPosition), R), ye = $ - R, Re = l < 0 && R + l <= 0, Ee = l > 0 && R + l >= x.maxScrollPosition, lt = l < 0 && ($ <= 0 || Re && ye === 0) || l > 0 && ($ >= x.maxScrollPosition || Ee && ye === 0);
504
+ return { nextPosition: $, actualDelta: ye, reachedBoundary: lt };
505
505
  },
506
- [ze]
507
- ), Te = v(
506
+ [ne]
507
+ ), Oe = S(
508
508
  (l, x) => {
509
509
  l.current += x;
510
- const y = Math.max(Le.current.maxScrollPosition, 0);
511
- y > 0 && (l.current = oe(l.current, -y, y));
512
- const D = Ue(l.current);
510
+ const R = Math.max(Te.current.maxScrollPosition, 0);
511
+ R > 0 && (l.current = le(l.current, -R, R));
512
+ const D = Je(l.current);
513
513
  return l.current -= D.actualDelta, D.reachedBoundary && (l.current = 0), D;
514
514
  },
515
- [Ue]
516
- ), be = v(() => {
517
- Z.current !== null && (window.cancelAnimationFrame(Z.current), Z.current = null), S.current = null, $.current = 0, Ve.current = 0;
518
- }, []), Me = v(() => {
519
- G.current = { ...nr }, pe(!1), Y.current?.reset(), be();
520
- }, [be]), Ee = v(
515
+ [Je]
516
+ ), ae = S(() => {
517
+ C.current !== null && (window.cancelAnimationFrame(C.current), C.current = null), v.current = null, W.current = 0, ge.current = 0;
518
+ }, []), ve = S(() => {
519
+ U.current = { ...ir }, he(!1), Se.current?.reset(), ae();
520
+ }, [ae]), Ue = S(
521
521
  (l) => {
522
- const x = G.current, y = Le.current;
522
+ const x = U.current, R = Te.current;
523
523
  if (!x.active || x.direction === 0) {
524
- be();
524
+ ae();
525
525
  return;
526
526
  }
527
- if (!y.scrollBarVisible || y.maxScrollPosition <= 0) {
528
- be();
527
+ if (!R.scrollBarVisible || R.maxScrollPosition <= 0) {
528
+ ae();
529
529
  return;
530
530
  }
531
- const D = S.current ?? l, K = Math.max((l - D) / 1e3, 0), se = Math.min(K, Nr);
532
- if (S.current = l, se <= 0) {
533
- Z.current = window.requestAnimationFrame(Ee);
531
+ const D = v.current ?? l, $ = Math.max((l - D) / 1e3, 0), ye = Math.min($, Vr);
532
+ if (v.current = l, ye <= 0) {
533
+ C.current = window.requestAnimationFrame(Ue);
534
534
  return;
535
535
  }
536
- const Ne = Lr({
536
+ const Re = Or({
537
537
  distance: x.distance,
538
- maxDistance: y.effectiveTapMaxDistance,
539
- viewportSize: y.viewportSize,
540
- minSpeedMultiplier: y.tapCircleMinSpeedMultiplier,
541
- maxSpeedMultiplier: y.tapCircleMaxSpeedMultiplier,
542
- hasCustomMaxSpeedMultiplier: typeof y.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
- curve: y.tapCircleMaxSpeedCurve
538
+ maxDistance: R.effectiveTapMaxDistance,
539
+ viewportSize: R.viewportSize,
540
+ minSpeedMultiplier: R.tapCircleMinSpeedMultiplier,
541
+ maxSpeedMultiplier: R.tapCircleMaxSpeedMultiplier,
542
+ hasCustomMaxSpeedMultiplier: typeof R.tapScrollCircleOptions?.maxSpeedMultiplier == "number",
543
+ curve: R.tapCircleMaxSpeedCurve
544
544
  });
545
- Ve.current !== x.direction && (Ve.current = x.direction, $.current = 0);
546
- const { reachedBoundary: ve } = Te($, x.direction * Ne * se);
547
- if (ve) {
548
- be();
545
+ ge.current !== x.direction && (ge.current = x.direction, W.current = 0);
546
+ const { reachedBoundary: Ee } = Oe(W, x.direction * Re * ye);
547
+ if (Ee) {
548
+ ae();
549
549
  return;
550
550
  }
551
- Z.current = window.requestAnimationFrame(Ee);
551
+ C.current = window.requestAnimationFrame(Ue);
552
552
  },
553
- [Te, be]
554
- ), tt = v(() => {
555
- Z.current === null && (S.current = null, $.current = 0, Z.current = window.requestAnimationFrame(Ee));
556
- }, [Ee]);
557
- X(() => {
558
- const l = G.current;
559
- !l.active || l.direction === 0 || tt();
560
- }, [r, e, tt]), X(() => () => {
561
- be();
562
- }, [be]);
563
- const rt = v(
553
+ [Oe, ae]
554
+ ), Ve = S(() => {
555
+ C.current === null && (v.current = null, W.current = 0, C.current = window.requestAnimationFrame(Ue));
556
+ }, [Ue]);
557
+ q(() => {
558
+ const l = U.current;
559
+ !l.active || l.direction === 0 || Ve();
560
+ }, [r, e, Ve]), q(() => () => {
561
+ ae();
562
+ }, [ae]);
563
+ const ft = S(
564
564
  (l) => {
565
- G.current = l, pe(l.active), l.active && l.direction !== 0 ? tt() : be();
565
+ U.current = l, he(l.active), l.active && l.direction !== 0 ? Ve() : ae();
566
566
  },
567
- [tt, be]
567
+ [Ve, ae]
568
568
  );
569
- X(() => {
570
- De || Me();
571
- }, [Me, De]), X(() => {
569
+ q(() => {
570
+ X || ve();
571
+ }, [ve, X]), q(() => {
572
572
  const l = (x) => {
573
573
  const D = x.detail?.paneId;
574
- D && I && D !== I || Me();
574
+ D && I && D !== I || ve();
575
575
  };
576
- return window.addEventListener(jt, l), () => {
577
- window.removeEventListener(jt, l);
576
+ return window.addEventListener(Gt, l), () => {
577
+ window.removeEventListener(Gt, l);
578
578
  };
579
- }, [I, Me]), X(() => {
580
- if (!De)
579
+ }, [I, ve]), q(() => {
580
+ if (!X)
581
581
  return;
582
582
  const l = (x) => {
583
- if (!G.current.active || G.current.pointerId === x.pointerId)
583
+ if (!U.current.active || U.current.pointerId === x.pointerId)
584
584
  return;
585
- const y = x.target;
586
- if (!(y instanceof Node)) {
587
- Me();
585
+ const R = x.target;
586
+ if (!(R instanceof Node)) {
587
+ ve();
588
588
  return;
589
589
  }
590
- Y.current?.getElement()?.contains(y) || Me();
590
+ Se.current?.getElement()?.contains(R) || ve();
591
591
  };
592
592
  return document.addEventListener("pointerdown", l, !0), () => {
593
593
  document.removeEventListener("pointerdown", l, !0);
594
594
  };
595
- }, [Me, De]);
596
- const st = (l) => {
597
- if (!ee || q <= 0 || k <= 0)
595
+ }, [ve, X]);
596
+ const Qe = (l) => {
597
+ if (!j || Y <= 0 || B <= 0)
598
598
  return 0;
599
- const x = oe(l, 0, q);
600
- return oe(x / q * k, 0, k);
601
- }, f = v((l) => {
602
- const { scrollBarVisible: x, effectiveTrackLength: y, maxScrollPosition: D } = Le.current;
603
- if (T.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: y, maxScroll: D })), y <= 0 || D <= 0)
599
+ const x = le(l, 0, Y);
600
+ return le(x / Y * B, 0, B);
601
+ }, ot = S((l) => {
602
+ const { scrollBarVisible: x, effectiveTrackLength: R, maxScrollPosition: D } = Te.current;
603
+ if (T.debug("[ScrollBar] calculateScrollPositionFromThumb", () => ({ thumbPos: l, trackLen: R, maxScroll: D })), R <= 0 || D <= 0)
604
604
  return null;
605
- const K = oe(l, 0, y);
606
- return oe(K / y * D, 0, D);
607
- }, []), E = v(
605
+ const $ = le(l, 0, R);
606
+ return le($ / R * D, 0, D);
607
+ }, []), d = S(
608
608
  (l) => {
609
- const x = l.getBoundingClientRect(), y = c ? x.width : x.height, D = (at) => {
610
- const Ke = Number.parseFloat(at);
611
- return Number.isFinite(Ke) ? Ke : 0;
612
- }, K = window.getComputedStyle(l), se = D(c ? K.width : K.height), Ne = se > 0 ? se + D(c ? K.paddingLeft : K.paddingTop) + D(c ? K.paddingRight : K.paddingBottom) + D(c ? K.borderLeftWidth : K.borderTopWidth) + D(c ? K.borderRightWidth : K.borderBottomWidth) : 0, ve = Ne > 0 ? Ne : c ? l.offsetWidth : l.offsetHeight;
613
- return ve <= 0 || y <= 0 ? 1 : y / ve;
609
+ const x = l.getBoundingClientRect(), R = c ? x.width : x.height, D = (lt) => {
610
+ const Ye = Number.parseFloat(lt);
611
+ return Number.isFinite(Ye) ? Ye : 0;
612
+ }, $ = window.getComputedStyle(l), ye = D(c ? $.width : $.height), Re = ye > 0 ? ye + D(c ? $.paddingLeft : $.paddingTop) + D(c ? $.paddingRight : $.paddingBottom) + D(c ? $.borderLeftWidth : $.borderTopWidth) + D(c ? $.borderRightWidth : $.borderBottomWidth) : 0, Ee = Re > 0 ? Re : c ? l.offsetWidth : l.offsetHeight;
613
+ return Ee <= 0 || R <= 0 ? 1 : R / Ee;
614
614
  },
615
615
  [c]
616
- ), Se = v(
616
+ ), y = S(
617
617
  (l) => {
618
618
  const x = _.current;
619
619
  if (x.pointerId !== l.pointerId)
620
620
  return;
621
- const y = l.clientX - x.startClientX, D = l.clientY - x.startClientY, K = pt(y, D) / (x.scale || 1);
621
+ const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1);
622
622
  T.debug("[ScrollBar] handleThumbPointerMove", () => ({
623
- delta: K,
623
+ delta: $,
624
624
  startThumbPosition: x.startThumbPosition,
625
625
  clientY: l.clientY,
626
626
  startClientY: x.startClientY,
627
- metrics: Le.current
627
+ metrics: Te.current
628
628
  }));
629
- const se = f(x.startThumbPosition + K);
630
- se !== null && ze(se), l.cancelable && l.preventDefault();
629
+ const ye = ot(x.startThumbPosition + $);
630
+ ye !== null && ne(ye), l.cancelable && l.preventDefault();
631
631
  },
632
- [pt, f, ze]
633
- ), _e = v(
632
+ [it, ot, ne]
633
+ ), xe = S(
634
634
  (l) => {
635
635
  const x = _.current;
636
636
  if (x.pointerId !== l.pointerId)
637
637
  return;
638
- document.removeEventListener("pointermove", Se), document.removeEventListener("pointerup", _e), document.removeEventListener("pointercancel", _e);
639
- const y = x.captureTarget;
640
- if (y?.hasPointerCapture?.(l.pointerId) && y.releasePointerCapture(l.pointerId), _.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, de(!1), P.current) {
638
+ document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
639
+ const R = x.captureTarget;
640
+ if (R?.hasPointerCapture?.(l.pointerId) && R.releasePointerCapture(l.pointerId), _.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1, captureTarget: null }, pe(!1), P.current) {
641
641
  const D = P.current.getBoundingClientRect();
642
- l.clientX >= D.left && l.clientX <= D.right && l.clientY >= D.top && l.clientY <= D.bottom || ne(!1);
642
+ l.clientX >= D.left && l.clientX <= D.right && l.clientY >= D.top && l.clientY <= D.bottom || oe(!1);
643
643
  } else
644
- ne(!1);
644
+ oe(!1);
645
645
  },
646
- [Se]
646
+ [y]
647
647
  );
648
- X(() => () => {
649
- document.removeEventListener("pointermove", Se), document.removeEventListener("pointerup", _e), document.removeEventListener("pointercancel", _e);
650
- }, [Se, _e]);
651
- const ke = g(0), ot = g(0), lt = v(
648
+ q(() => () => {
649
+ document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", xe), document.removeEventListener("pointercancel", xe);
650
+ }, [y, xe]);
651
+ const tt = g(0), _e = g(0), ct = S(
652
652
  (l) => {
653
- const x = Math.max(Math.round(Le.current.viewportSize / Pr), Mr);
654
- ot.current !== l && (ot.current = l, ke.current = 0), Te(ke, l * x);
653
+ const x = Math.max(Math.round(Te.current.viewportSize / yr), Mr);
654
+ _e.current !== l && (_e.current = l, tt.current = 0), Oe(tt, l * x);
655
655
  },
656
- [Te]
657
- ), { handleArrowPointerDown: mt, handleArrowPointerUp: ct, handleArrowKeyDown: ht } = Dr({
658
- canUseArrowButtons: Oe,
656
+ [Oe]
657
+ ), { handleArrowPointerDown: ut, handleArrowPointerUp: at, handleArrowKeyDown: gt } = Ar({
658
+ canUseArrowButtons: re,
659
659
  enableArrowButtons: a,
660
- resetTapScroll: Me,
661
- scrollByStep: lt
662
- }), Mt = (l) => {
663
- if (!ee)
660
+ resetTapScroll: ve,
661
+ scrollByStep: ct
662
+ }), pt = (l) => {
663
+ if (!j)
664
664
  return;
665
665
  if (!i) {
666
666
  l.preventDefault(), l.stopPropagation();
@@ -668,8 +668,8 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
668
668
  }
669
669
  if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
670
670
  return;
671
- Me();
672
- const x = l.currentTarget, y = E(x);
671
+ ve();
672
+ const x = l.currentTarget, R = d(x);
673
673
  let D = null;
674
674
  if (x.setPointerCapture)
675
675
  try {
@@ -679,14 +679,14 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
679
679
  }
680
680
  _.current = {
681
681
  pointerId: l.pointerId,
682
- startThumbPosition: Ie,
682
+ startThumbPosition: te,
683
683
  startClientX: l.clientX,
684
684
  startClientY: l.clientY,
685
- scale: y,
685
+ scale: R,
686
686
  captureTarget: D
687
- }, document.addEventListener("pointermove", Se), document.addEventListener("pointerup", _e), document.addEventListener("pointercancel", _e), de(!0), ne(!0), l.preventDefault(), l.stopPropagation();
688
- }, Dt = (l) => {
689
- if (!ee)
687
+ }, document.addEventListener("pointermove", y), document.addEventListener("pointerup", xe), document.addEventListener("pointercancel", xe), pe(!0), oe(!0), l.preventDefault(), l.stopPropagation();
688
+ }, yt = (l) => {
689
+ if (!j)
690
690
  return;
691
691
  if (!s) {
692
692
  l.preventDefault(), l.stopPropagation();
@@ -694,168 +694,168 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
694
694
  }
695
695
  if (l.pointerType === "mouse" && l.button !== 0 || l.ctrlKey)
696
696
  return;
697
- const x = l.currentTarget, y = x.getBoundingClientRect(), D = V(l), K = E(x), se = (D - (c ? y.left : y.top)) / K;
698
- Me();
699
- const Ne = se - U / 2, ve = st(Ne);
700
- if (ze(ve), x.setPointerCapture)
697
+ const x = l.currentTarget, R = x.getBoundingClientRect(), D = vt(l), $ = d(x), ye = (D - (c ? R.left : R.top)) / $;
698
+ ve();
699
+ const Re = ye - F / 2, Ee = Qe(Re);
700
+ if (ne(Ee), x.setPointerCapture)
701
701
  try {
702
702
  x.setPointerCapture(l.pointerId);
703
703
  } catch {
704
704
  }
705
705
  M.current = {
706
706
  pointerId: l.pointerId,
707
- startThumbPosition: Ne,
707
+ startThumbPosition: Re,
708
708
  startClientX: l.clientX,
709
709
  startClientY: l.clientY,
710
- scale: K
710
+ scale: $
711
711
  }, l.preventDefault(), l.stopPropagation();
712
- }, bt = () => {
712
+ }, wt = () => {
713
713
  M.current = { pointerId: null, startThumbPosition: 0, startClientX: 0, startClientY: 0, scale: 1 };
714
- }, At = (l) => {
714
+ }, Nt = (l) => {
715
715
  const x = M.current;
716
716
  if (x.pointerId !== l.pointerId)
717
717
  return;
718
718
  if (l.pointerType === "mouse" && l.buttons === 0) {
719
- bt();
719
+ wt();
720
720
  return;
721
721
  }
722
- const y = l.clientX - x.startClientX, D = l.clientY - x.startClientY, K = pt(y, D) / (x.scale || 1), se = st(x.startThumbPosition + K);
723
- ze(se), l.cancelable && l.preventDefault();
724
- }, xe = (l) => {
722
+ const R = l.clientX - x.startClientX, D = l.clientY - x.startClientY, $ = it(R, D) / (x.scale || 1), ye = Qe(x.startThumbPosition + $);
723
+ ne(ye), l.cancelable && l.preventDefault();
724
+ }, At = (l) => {
725
725
  if (M.current.pointerId !== l.pointerId)
726
726
  return;
727
727
  const x = l.currentTarget;
728
- x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), bt(), l.preventDefault(), l.stopPropagation();
729
- }, xt = (l) => {
728
+ x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt(), l.preventDefault(), l.stopPropagation();
729
+ }, we = (l) => {
730
730
  if (M.current.pointerId !== l.pointerId)
731
731
  return;
732
732
  const x = l.currentTarget;
733
- x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), bt();
734
- }, Lt = (l) => {
735
- l.target === l.currentTarget && M.current.pointerId === l.pointerId && bt();
736
- }, Ot = Ye(() => oe((ae ? 1 : 0.8) * ie, 0, 1), [ae, ie]), Je = Ye(() => {
737
- const x = `calc(50% - ${Ge / 2}px + ${Ce}px)`;
733
+ x.hasPointerCapture?.(l.pointerId) && x.releasePointerCapture(l.pointerId), wt();
734
+ }, bt = (l) => {
735
+ l.target === l.currentTarget && M.current.pointerId === l.pointerId && wt();
736
+ }, Lt = Fe(() => le((ce ? 1 : 0.8) * Ae, 0, 1), [ce, Ae]), Ot = Fe(() => {
737
+ const x = `calc(50% - ${Xe / 2}px + ${ze}px)`;
738
738
  return {
739
- left: ye,
739
+ left: $e,
740
740
  top: x
741
741
  };
742
- }, [ye, Ce, Ge]), Et = (l, x, y, D) => /* @__PURE__ */ le(
742
+ }, [$e, ze, Xe]), We = (l, x, R, D) => /* @__PURE__ */ de(
743
743
  "button",
744
744
  {
745
745
  type: "button",
746
746
  tabIndex: 0,
747
747
  className: "aqvs-scrollbar-arrow-button",
748
748
  style: {
749
- [dt]: p,
750
- [R]: p
749
+ [et]: f,
750
+ [mt]: f
751
751
  },
752
752
  "aria-label": x,
753
- onPointerDown: mt(l),
754
- onPointerUp: ct,
755
- onPointerLeave: ct,
756
- onPointerCancel: ct,
757
- onKeyDown: ht(l),
753
+ onPointerDown: ut(l),
754
+ onPointerUp: at,
755
+ onPointerLeave: at,
756
+ onPointerCancel: at,
757
+ onKeyDown: gt(l),
758
758
  "aria-disabled": !a,
759
- disabled: !Oe,
760
- children: /* @__PURE__ */ le("span", { "aria-hidden": "true", children: y })
759
+ disabled: !re,
760
+ children: /* @__PURE__ */ de("span", { "aria-hidden": "true", children: R })
761
761
  },
762
762
  D
763
- ), Nt = h && ee ? {
764
- orientation: He,
763
+ ), Vt = h && j ? {
764
+ orientation: ht,
765
765
  scrollPosition: t,
766
- maxScrollPosition: k,
766
+ maxScrollPosition: B,
767
767
  contentSize: r,
768
768
  viewportSize: e,
769
- thumbSize: U,
770
- thumbPosition: Ie,
771
- thumbCenter: Re,
772
- trackSize: d,
773
- isDragging: B,
774
- isTapScrollActive: ae,
769
+ thumbSize: F,
770
+ thumbPosition: te,
771
+ thumbCenter: Me,
772
+ trackSize: ie,
773
+ isDragging: H,
774
+ isTapScrollActive: ce,
775
775
  visibleStartIndex: z,
776
- visibleEndIndex: J
776
+ visibleEndIndex: G
777
777
  } : null;
778
- return /* @__PURE__ */ Tt(
778
+ return /* @__PURE__ */ Mt(
779
779
  "div",
780
780
  {
781
- className: Rt("aqvs-scrollbar", gt, b),
781
+ className: Et("aqvs-scrollbar", Ze, b),
782
782
  style: {
783
- [dt]: e,
784
- [R]: p
783
+ [et]: e,
784
+ [mt]: f
785
785
  },
786
- "data-visible": ee ? "true" : "false",
786
+ "data-visible": j ? "true" : "false",
787
787
  role: "scrollbar",
788
788
  tabIndex: -1,
789
789
  "aria-controls": I,
790
790
  "aria-valuenow": t,
791
791
  "aria-valuemin": 0,
792
- "aria-valuemax": k,
792
+ "aria-valuemax": B,
793
793
  "aria-orientation": c ? "horizontal" : "vertical",
794
794
  children: [
795
- !c && ee && De && /* @__PURE__ */ le(
796
- dr,
795
+ !c && j && X && /* @__PURE__ */ de(
796
+ fr,
797
797
  {
798
- ref: Y,
799
- className: Rt("aqvs-scrollbar-tap-circle-wrapper", Ze),
800
- size: Ge,
801
- maxVisualDistance: et,
802
- style: Je,
803
- opacity: Ot,
804
- renderVisual: he,
805
- onDragChange: rt
798
+ ref: Se,
799
+ className: Et("aqvs-scrollbar-tap-circle-wrapper", Ce),
800
+ size: Xe,
801
+ maxVisualDistance: Le,
802
+ style: Ot,
803
+ opacity: Lt,
804
+ renderVisual: ue,
805
+ onDragChange: ft
806
806
  },
807
807
  "tap-circle"
808
808
  ),
809
- Et(-1, Q[0], We[0], "arrow-start"),
810
- /* @__PURE__ */ Tt(
809
+ We(-1, E[0], J[0], "arrow-start"),
810
+ /* @__PURE__ */ Mt(
811
811
  "div",
812
812
  {
813
813
  className: "aqvs-scrollbar-track",
814
814
  style: {
815
- borderRadius: p / 2
815
+ borderRadius: f / 2
816
816
  },
817
- onPointerDown: Dt,
818
- onPointerMove: At,
819
- onPointerUp: xe,
820
- onPointerCancel: xt,
821
- onLostPointerCapture: Lt,
817
+ onPointerDown: yt,
818
+ onPointerMove: Nt,
819
+ onPointerUp: At,
820
+ onPointerCancel: we,
821
+ onLostPointerCapture: bt,
822
822
  "aria-disabled": !s,
823
823
  children: [
824
- Nt && /* @__PURE__ */ le("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(Nt) }, "overlay"),
825
- /* @__PURE__ */ le(
824
+ Vt && /* @__PURE__ */ de("div", { className: "aqvs-scrollbar-overlay", "aria-hidden": !0, children: h?.(Vt) }, "overlay"),
825
+ /* @__PURE__ */ de(
826
826
  "div",
827
827
  {
828
828
  className: "aqvs-scrollbar-thumb-wrapper",
829
829
  style: {
830
- [dt]: U,
831
- [ft]: Ie,
830
+ [et]: F,
831
+ [N]: te,
832
832
  ...c ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
833
833
  },
834
- "data-visible": ee || B ? "true" : "false",
835
- onPointerDown: Mt,
834
+ "data-visible": j || H ? "true" : "false",
835
+ onPointerDown: pt,
836
836
  role: "slider",
837
837
  "aria-orientation": c ? "horizontal" : "vertical",
838
838
  "aria-valuenow": t,
839
839
  "aria-valuemin": 0,
840
- "aria-valuemax": k,
840
+ "aria-valuemax": B,
841
841
  "aria-disabled": !i,
842
842
  tabIndex: -1,
843
- children: /* @__PURE__ */ le(
843
+ children: /* @__PURE__ */ de(
844
844
  "div",
845
845
  {
846
846
  ref: P,
847
- className: Rt("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
847
+ className: Et("aqvs-scrollbar-thumb", c ? "aqvs-scrollbar-thumb-horizontal" : "aqvs-scrollbar-thumb-vertical"),
848
848
  "data-testid": "aqvs-scrollbar-thumb",
849
- "data-thumb-state": ge,
849
+ "data-thumb-state": De,
850
850
  style: {
851
- borderRadius: p - 1,
851
+ borderRadius: f - 1,
852
852
  cursor: i ? "pointer" : "default"
853
853
  },
854
854
  onMouseEnter: () => {
855
- i && ne(!0);
855
+ i && oe(!0);
856
856
  },
857
857
  onMouseLeave: () => {
858
- i && ne(!1);
858
+ i && oe(!1);
859
859
  }
860
860
  },
861
861
  "thumb"
@@ -867,11 +867,11 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
867
867
  },
868
868
  "track"
869
869
  ),
870
- Et(1, Q[1], We[1], "arrow-end")
870
+ We(1, E[1], J[1], "arrow-end")
871
871
  ]
872
872
  }
873
873
  );
874
- }, kr = 16, ir = (r, e, t) => e === 1 ? r * kr : e === 2 ? r * t : r, Fr = (r, e) => {
874
+ }, Fr = 16, sr = (r, e, t) => e === 1 ? r * Fr : e === 2 ? r * t : r, Yr = (r, e) => {
875
875
  const t = r.shiftKey && r.deltaX === 0, n = t ? r.deltaY : r.deltaX, i = t ? 0 : r.deltaY, s = n !== 0 && Math.abs(n) >= Math.abs(i);
876
876
  return {
877
877
  // ❗ ズームでもデルタは潰さない。ここは**事実だけ**を報告し、「横取りしない」という
@@ -880,21 +880,21 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
880
880
  // どのテストも検出できなくなる (変異解析で実証済み)。
881
881
  isZoomGesture: r.ctrlKey,
882
882
  isHorizontalDominant: s,
883
- horizontalDelta: ir(n, r.deltaMode, e),
884
- verticalDelta: ir(i, r.deltaMode, e)
883
+ horizontalDelta: sr(n, r.deltaMode, e),
884
+ verticalDelta: sr(i, r.deltaMode, e)
885
885
  };
886
- }, pr = /* @__PURE__ */ new WeakSet(), sr = (r) => {
887
- pr.add(r);
888
- }, Yr = (r) => pr.has(r), Br = ["mouse", "pen", "touch"], Wt = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), Hr = (r) => r === "mouse" || r === "pen", Ct = {
886
+ }, mr = /* @__PURE__ */ new WeakSet(), or = (r) => {
887
+ mr.add(r);
888
+ }, Br = (r) => mr.has(r), Hr = ["mouse", "pen", "touch"], Wt = (r, e) => !(r === "mouse" || r === "pen" || r === "touch") || e.includes(r), qr = (r) => r === "mouse" || r === "pen", Ct = {
889
889
  maxVelocity: 6,
890
890
  minVelocity: 0.02,
891
891
  deceleration: 25e-4,
892
892
  velocitySampleWindow: 90,
893
893
  startVelocityThreshold: 0.04
894
- }, _t = (r, e, t) => {
894
+ }, kt = (r, e, t) => {
895
895
  for (const [n, i, s] of e)
896
896
  t === "add" ? r.addEventListener(n, i, s) : r.removeEventListener(n, i, s);
897
- }, qr = Gt(
897
+ }, Xr = Zt(
898
898
  ({
899
899
  children: r,
900
900
  contentSize: e,
@@ -904,233 +904,238 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
904
904
  enableThumbDrag: s = !0,
905
905
  enableTrackClick: a = !0,
906
906
  enableArrowButtons: c = !0,
907
- enablePointerDrag: p = !0,
908
- pointerDragInputs: b = Br,
907
+ enablePointerDrag: f = !0,
908
+ pointerDragInputs: b = Hr,
909
909
  onScroll: I,
910
910
  className: w,
911
- testId: C,
911
+ testId: V,
912
912
  style: h,
913
913
  background: z,
914
- tapScrollCircleOptions: J,
915
- inertiaOptions: B,
916
- itemCount: de,
917
- renderThumbOverlay: fe,
918
- wheelSpeedMultiplier: ne = 1,
919
- onWheelHorizontal: ae,
920
- contentInsets: pe,
921
- visibleStartIndex: P,
922
- visibleEndIndex: _,
923
- renderOverlay: M,
924
- initialScrollPosition: j = 0,
925
- contentProps: te
926
- }, G) => {
927
- const Y = g(Number.isFinite(j) ? Math.max(0, j) : 0), Z = g(null), S = g(null), $ = t === void 0, [Ve, Qe] = nt(0), N = t ?? Ve, De = g(null);
928
- it(() => {
929
- if (!$)
914
+ tapScrollCircleOptions: G,
915
+ inertiaOptions: H,
916
+ itemCount: pe,
917
+ renderThumbOverlay: me,
918
+ wheelSpeedMultiplier: oe = 1,
919
+ overscrollBehavior: ce = "auto",
920
+ onWheelHorizontal: he,
921
+ contentInsets: P,
922
+ visibleStartIndex: _,
923
+ visibleEndIndex: M,
924
+ renderOverlay: Z,
925
+ initialScrollPosition: Q = 0,
926
+ contentProps: U
927
+ }, Se) => {
928
+ const C = g(Number.isFinite(Q) ? Math.max(0, Q) : 0), v = g(null), W = g(null), ge = t === void 0, [qe, ee] = rt(0), X = t ?? qe, Xe = g(null);
929
+ nt(() => {
930
+ if (!ge)
930
931
  return;
931
- const d = S.current;
932
- if (!d)
932
+ const p = W.current;
933
+ if (!p)
933
934
  return;
934
- const W = () => {
935
- const k = d.offsetHeight;
936
- if (k > 0) {
937
- Qe((q) => q === k ? q : k);
935
+ const F = () => {
936
+ const Y = p.offsetHeight;
937
+ if (Y > 0) {
938
+ ee((te) => te === Y ? te : Y);
938
939
  return;
939
940
  }
940
- d.offsetParent !== null && e > 0 && De.current !== "zero" && (De.current = "zero", T.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
941
+ p.offsetParent !== null && e > 0 && Xe.current !== "zero" && (Xe.current = "zero", T.warn("[ScrollPane] The self-measured viewport is 0px. Give the scroll pane's host element a definite height (e.g. h-full, flex-1 + min-h-0, an explicit px height), or pass viewportSize explicitly."));
941
942
  };
942
- if (W(), typeof ResizeObserver != "function")
943
+ if (F(), typeof ResizeObserver != "function")
943
944
  return;
944
- const U = new ResizeObserver(W);
945
- return U.observe(d), () => {
946
- U.disconnect();
945
+ const B = new ResizeObserver(F);
946
+ return B.observe(p), () => {
947
+ B.disconnect();
947
948
  };
948
- }, [e, $]), it(() => {
949
- $ && n?.(Ve);
950
- }, [$, Ve, n]), it(() => {
951
- if ($)
949
+ }, [e, ge]), nt(() => {
950
+ ge && n?.(qe);
951
+ }, [ge, qe, n]), nt(() => {
952
+ if (ge)
952
953
  return;
953
- const d = Z.current;
954
- if (!d)
954
+ const p = v.current;
955
+ if (!p)
955
956
  return;
956
- const W = () => {
957
- const k = d.clientHeight;
958
- if (k <= 0 || Math.abs(k - N) <= 1)
957
+ const F = () => {
958
+ const Y = p.clientHeight;
959
+ if (Y <= 0 || Math.abs(Y - X) <= 1)
959
960
  return;
960
- const q = `${N}/${k}`;
961
- De.current !== q && (De.current = q, T.warn(
962
- `[ScrollPane] viewportSize=${N} but the host band is ${k}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
961
+ const te = `${X}/${Y}`;
962
+ Xe.current !== te && (Xe.current = te, T.warn(
963
+ `[ScrollPane] viewportSize=${X} but the host band is ${Y}px. The clip window, max scroll position, thumb mapping, rendered row count and scrollability all derive from viewportSize, so they are now wrong. Omit viewportSize to let the pane measure itself.`
963
964
  ));
964
965
  };
965
- if (W(), typeof ResizeObserver != "function")
966
+ if (F(), typeof ResizeObserver != "function")
966
967
  return;
967
- const U = new ResizeObserver(W);
968
- return U.observe(d), () => {
969
- U.disconnect();
968
+ const B = new ResizeObserver(F);
969
+ return B.observe(p), () => {
970
+ B.disconnect();
970
971
  };
971
- }, [$, N]);
972
- const Ge = g(ae);
973
- X(() => {
974
- Ge.current = ae;
975
- }, [ae]);
976
- const ye = g({
972
+ }, [ge, X]);
973
+ const $e = g(he);
974
+ q(() => {
975
+ $e.current = he;
976
+ }, [he]);
977
+ const ze = g({
977
978
  frame: null,
978
979
  velocity: 0,
979
980
  lastTimestamp: null,
980
981
  generation: 0
981
- }), Ce = Ye(
982
+ }), Ce = Fe(
982
983
  () => ({
983
- maxVelocity: B?.maxVelocity ?? Ct.maxVelocity,
984
- minVelocity: B?.minVelocity ?? Ct.minVelocity,
985
- deceleration: B?.deceleration ?? Ct.deceleration,
986
- velocitySampleWindow: B?.velocitySampleWindow ?? Ct.velocitySampleWindow,
987
- startVelocityThreshold: B?.startVelocityThreshold ?? Ct.startVelocityThreshold
984
+ maxVelocity: H?.maxVelocity ?? Ct.maxVelocity,
985
+ minVelocity: H?.minVelocity ?? Ct.minVelocity,
986
+ deceleration: H?.deceleration ?? Ct.deceleration,
987
+ velocitySampleWindow: H?.velocitySampleWindow ?? Ct.velocitySampleWindow,
988
+ startVelocityThreshold: H?.startVelocityThreshold ?? Ct.startVelocityThreshold
988
989
  }),
989
- [B]
990
- ), Ze = Ye(() => ({
991
- top: Math.max(0, pe?.top ?? 0),
992
- bottom: Math.max(0, pe?.bottom ?? 0)
993
- }), [pe]);
990
+ [H]
991
+ ), je = Fe(() => ({
992
+ top: Math.max(0, P?.top ?? 0),
993
+ bottom: Math.max(0, P?.bottom ?? 0)
994
+ }), [P]);
994
995
  T.debug("[ScrollPane] ScrollPane rendered", () => ({
995
996
  contentSize: e,
996
- viewportSize: N,
997
+ viewportSize: X,
997
998
  scrollBarWidth: i,
998
999
  className: w,
999
1000
  style: h,
1000
- tapScrollCircleOptions: J,
1001
- inertiaOptions: B,
1002
- enablePointerDrag: p,
1003
- contentInsets: Ze
1001
+ tapScrollCircleOptions: G,
1002
+ inertiaOptions: H,
1003
+ enablePointerDrag: f,
1004
+ contentInsets: je
1004
1005
  }));
1005
- const $e = g({ contentSize: e, viewportSize: N }), H = Ye(() => e > N, [e, N]), Ae = v(
1006
- (d, W) => {
1007
- let U = W ?? $e.current;
1008
- W && !(Number.isFinite(W.contentSize) && Number.isFinite(W.viewportSize)) && (T.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: W }), U = $e.current);
1009
- const { contentSize: k, viewportSize: q } = U, Ie = k > q, Re = Y.current;
1010
- if (T.debug("[ScrollPane] scrollTo called", () => ({ newPosition: d, contentSize: k, viewportSize: q, currentIsScrollable: Ie, prevPosition: Re })), !Ie)
1011
- return Y.current !== 0 && (Y.current = 0, I?.(0, Re)), Y.current;
1012
- const ee = typeof d == "function" ? d(Y.current) : d;
1013
- if (!Number.isFinite(ee))
1014
- return T.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: ee }), Y.current;
1015
- const Oe = Math.max(k - q, 0), ge = oe(ee, 0, Oe);
1016
- return Y.current !== ge && (Y.current = ge, I?.(ge, Re)), Y.current;
1006
+ const Ge = g({ contentSize: e, viewportSize: X }), K = Fe(() => e > X, [e, X]), Ae = S(
1007
+ (p, F) => {
1008
+ let B = F ?? Ge.current;
1009
+ F && !(Number.isFinite(F.contentSize) && Number.isFinite(F.viewportSize)) && (T.warn("[ScrollPane] scrollTo received non-finite dimsOverride; falling back to the committed dims", { dimsOverride: F }), B = Ge.current);
1010
+ const { contentSize: Y, viewportSize: te } = B, Me = Y > te, j = C.current;
1011
+ if (T.debug("[ScrollPane] scrollTo called", () => ({ newPosition: p, contentSize: Y, viewportSize: te, currentIsScrollable: Me, prevPosition: j })), !Me)
1012
+ return C.current !== 0 && (C.current = 0, I?.(0, j)), C.current;
1013
+ const re = typeof p == "function" ? p(C.current) : p;
1014
+ if (!Number.isFinite(re))
1015
+ return T.warn("[ScrollPane] scrollTo received a non-finite position; keeping the current position", { nextPosition: re }), C.current;
1016
+ const De = Math.max(Y - te, 0), ne = le(re, 0, De);
1017
+ return C.current !== ne && (C.current = ne, I?.(ne, j)), C.current;
1017
1018
  },
1018
1019
  [I]
1019
- ), ie = g(Ae);
1020
- X(() => {
1021
- ie.current = Ae;
1020
+ ), ue = g(Ae);
1021
+ q(() => {
1022
+ ue.current = Ae;
1022
1023
  }, [Ae]);
1023
- const he = v(() => {
1024
- const d = ye.current;
1025
- d.generation += 1, d.frame !== null && cancelAnimationFrame(d.frame), d.frame = null, d.velocity = 0, d.lastTimestamp = null;
1026
- }, []), Be = g(he);
1027
- X(() => {
1028
- Be.current = he;
1029
- }, [he]), X(() => () => {
1030
- Be.current();
1024
+ const be = S(() => {
1025
+ const p = ze.current;
1026
+ p.generation += 1, p.frame !== null && cancelAnimationFrame(p.frame), p.frame = null, p.velocity = 0, p.lastTimestamp = null;
1027
+ }, []), Te = g(be);
1028
+ q(() => {
1029
+ Te.current = be;
1030
+ }, [be]), q(() => () => {
1031
+ Te.current();
1031
1032
  }, []);
1032
- const Le = v(
1033
- (d) => {
1034
- if (!H)
1033
+ const et = S(
1034
+ (p) => {
1035
+ if (!K)
1035
1036
  return;
1036
- const { maxVelocity: W, minVelocity: U, deceleration: k, startVelocityThreshold: q } = Ce, Ie = oe(d, -W, W);
1037
- if (Math.abs(Ie) < q)
1037
+ const { maxVelocity: F, minVelocity: B, deceleration: Y, startVelocityThreshold: te } = Ce, Me = le(p, -F, F);
1038
+ if (Math.abs(Me) < te)
1038
1039
  return;
1039
- he(), ye.current.velocity = Ie, ye.current.lastTimestamp = null;
1040
- const Re = ye.current.generation, ee = (Oe) => {
1041
- const ge = ye.current;
1042
- if (ge.generation !== Re)
1040
+ be(), ze.current.velocity = Me, ze.current.lastTimestamp = null;
1041
+ const j = ze.current.generation, re = (De) => {
1042
+ const ne = ze.current;
1043
+ if (ne.generation !== j)
1043
1044
  return;
1044
- if (ge.lastTimestamp === null) {
1045
- ge.lastTimestamp = Oe, ge.frame = requestAnimationFrame(ee);
1045
+ if (ne.lastTimestamp === null) {
1046
+ ne.lastTimestamp = De, ne.frame = requestAnimationFrame(re);
1046
1047
  return;
1047
1048
  }
1048
- const ze = Oe - ge.lastTimestamp;
1049
- if (ge.lastTimestamp = Oe, ze <= 0) {
1050
- ge.frame = requestAnimationFrame(ee);
1049
+ const Je = De - ne.lastTimestamp;
1050
+ if (ne.lastTimestamp = De, Je <= 0) {
1051
+ ne.frame = requestAnimationFrame(re);
1051
1052
  return;
1052
1053
  }
1053
- const Ue = ge.velocity;
1054
- let Te = Ue;
1055
- const be = k * ze;
1056
- Ue > 0 ? Te = Math.max(0, Ue - be) : Ue < 0 && (Te = Math.min(0, Ue + be));
1057
- const Ee = (Ue + Te) / 2 * ze, tt = Y.current;
1058
- if (Ee !== 0 && ie.current((_e) => _e + Ee), ye.current.generation !== Re)
1054
+ const Oe = ne.velocity;
1055
+ let ae = Oe;
1056
+ const ve = Y * Je;
1057
+ Oe > 0 ? ae = Math.max(0, Oe - ve) : Oe < 0 && (ae = Math.min(0, Oe + ve));
1058
+ const Ve = (Oe + ae) / 2 * Je, ft = C.current;
1059
+ if (Ve !== 0 && ue.current((tt) => tt + Ve), ze.current.generation !== j)
1059
1060
  return;
1060
- const rt = Y.current, { contentSize: st, viewportSize: f } = $e.current, E = Math.max(st - f, 0);
1061
- ge.velocity = Te;
1062
- const Se = rt === tt || rt <= 0 && Te <= 0 || rt >= E && Te >= 0;
1063
- if (Math.abs(Te) < U || Se) {
1064
- he();
1061
+ const Qe = C.current, { contentSize: ot, viewportSize: d } = Ge.current, y = Math.max(ot - d, 0);
1062
+ ne.velocity = ae;
1063
+ const xe = Qe === ft || Qe <= 0 && ae <= 0 || Qe >= y && ae >= 0;
1064
+ if (Math.abs(ae) < B || xe) {
1065
+ be();
1065
1066
  return;
1066
1067
  }
1067
- ge.frame = requestAnimationFrame(ee);
1068
+ ne.frame = requestAnimationFrame(re);
1068
1069
  };
1069
- ye.current.frame = requestAnimationFrame(ee);
1070
+ ze.current.frame = requestAnimationFrame(re);
1070
1071
  },
1071
- [H, Ce, he]
1072
- ), dt = g(Le);
1073
- X(() => {
1074
- dt.current = Le;
1075
- }, [Le]), it(() => {
1076
- $e.current = { contentSize: e, viewportSize: N };
1077
- }, [e, N]), it(() => {
1078
- const d = S.current;
1079
- if (!d) return;
1080
- const W = () => {
1081
- d.scrollTop !== 0 && (T.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: d.scrollTop })), d.scrollTop = 0), d.scrollLeft !== 0 && (d.scrollLeft = 0);
1072
+ [K, Ce, be]
1073
+ ), mt = g(et);
1074
+ q(() => {
1075
+ mt.current = et;
1076
+ }, [et]), nt(() => {
1077
+ Ge.current = { contentSize: e, viewportSize: X };
1078
+ }, [e, X]), nt(() => {
1079
+ const p = W.current;
1080
+ if (!p) return;
1081
+ const F = () => {
1082
+ p.scrollTop !== 0 && (T.debug("[ScrollPane] Native scroll detected, resetting to 0", () => ({ scrollTop: p.scrollTop })), p.scrollTop = 0), p.scrollLeft !== 0 && (p.scrollLeft = 0);
1082
1083
  };
1083
- return d.addEventListener("scroll", W), () => d.removeEventListener("scroll", W);
1084
- }, []), it(() => {
1085
- if (H) {
1086
- T.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: N, scrollPosition: Y.current }));
1087
- const d = oe(e - N, 0, e);
1088
- Y.current > d && Ae(d);
1084
+ return p.addEventListener("scroll", F), () => p.removeEventListener("scroll", F);
1085
+ }, []), nt(() => {
1086
+ if (K) {
1087
+ T.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", () => ({ contentSize: e, viewportSize: X, scrollPosition: C.current }));
1088
+ const p = le(e - X, 0, e);
1089
+ C.current > p && Ae(p);
1089
1090
  } else
1090
1091
  Ae(0);
1091
- }, [H, Ae, e, N]);
1092
- const R = g({ isScrollable: H, viewportSize: N, wheelSpeedMultiplier: ne });
1093
- it(() => {
1094
- R.current = { isScrollable: H, viewportSize: N, wheelSpeedMultiplier: ne };
1095
- }, [H, N, ne]);
1096
- const ft = v(
1097
- (d) => {
1098
- if (Yr(d))
1092
+ }, [K, Ae, e, X]);
1093
+ const N = g({ isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce });
1094
+ nt(() => {
1095
+ N.current = { isScrollable: K, viewportSize: X, wheelSpeedMultiplier: oe, overscrollBehavior: ce };
1096
+ }, [K, X, oe, ce]);
1097
+ const it = S(
1098
+ (p) => {
1099
+ if (Br(p))
1099
1100
  return !1;
1100
- const { isScrollable: W, viewportSize: U, wheelSpeedMultiplier: k } = R.current, q = Fr(d, U);
1101
- if (q.isZoomGesture)
1101
+ const { isScrollable: F, viewportSize: B, wheelSpeedMultiplier: Y, overscrollBehavior: te } = N.current, Me = Yr(p, B);
1102
+ if (Me.isZoomGesture)
1102
1103
  return !1;
1103
- if (q.isHorizontalDominant)
1104
- return Ge.current ? (sr(d), d.preventDefault(), he(), Ge.current(q.horizontalDelta), !0) : !1;
1105
- if (!W || q.verticalDelta === 0)
1104
+ if (Me.isHorizontalDominant)
1105
+ return $e.current ? (or(p), p.preventDefault(), be(), $e.current(Me.horizontalDelta), !0) : !1;
1106
+ if (!F || Me.verticalDelta === 0)
1106
1107
  return !1;
1107
- sr(d), d.preventDefault(), he();
1108
- let Ie = q.verticalDelta;
1109
- return k !== 1 && (Ie *= k), T.debug("[ScrollPane] wheel event", () => ({ deltaY: Ie, scrollPosition: Y.current, wheelSpeedMultiplier: k, deltaMode: d.deltaMode, scrollTop: S.current?.scrollTop })), Ae((Re) => Re + Ie), !0;
1108
+ let j = Me.verticalDelta;
1109
+ if (Y !== 1 && (j *= Y), te !== "contain") {
1110
+ const re = C.current, De = Math.max(Ge.current.contentSize - B, 0);
1111
+ if (j > 0 && re >= De || j < 0 && re <= 0)
1112
+ return !1;
1113
+ }
1114
+ return or(p), p.preventDefault(), be(), T.debug("[ScrollPane] wheel event", () => ({ deltaY: j, scrollPosition: C.current, wheelSpeedMultiplier: Y, deltaMode: p.deltaMode, scrollTop: W.current?.scrollTop })), Ae((re) => re + j), !0;
1110
1115
  },
1111
- [Ae, he]
1116
+ [Ae, be]
1112
1117
  );
1113
- X(() => {
1114
- const d = (k) => {
1115
- ft(k);
1116
- }, W = () => {
1117
- he();
1118
- }, U = Z.current;
1119
- return U && (U.addEventListener("wheel", d, { passive: !1 }), U.addEventListener("pointerdown", W, { capture: !0, passive: !0 })), () => {
1120
- U && (U.removeEventListener("wheel", d), U.removeEventListener("pointerdown", W, { capture: !0 }));
1118
+ q(() => {
1119
+ const p = (Y) => {
1120
+ it(Y);
1121
+ }, F = () => {
1122
+ be();
1123
+ }, B = v.current;
1124
+ return B && (B.addEventListener("wheel", p, { passive: !1 }), B.addEventListener("pointerdown", F, { capture: !0, passive: !0 })), () => {
1125
+ B && (B.removeEventListener("wheel", p), B.removeEventListener("pointerdown", F, { capture: !0 }));
1121
1126
  };
1122
- }, [ft, he]), Zt(
1123
- G,
1127
+ }, [it, be]), Jt(
1128
+ Se,
1124
1129
  () => ({
1125
- scrollTo: (d, W) => (he(), Ae(d, W)),
1126
- getScrollPosition: () => Y.current,
1130
+ scrollTo: (p, F) => (be(), Ae(p, F)),
1131
+ getScrollPosition: () => C.current,
1127
1132
  getContentSize: () => e,
1128
- getViewportSize: () => N,
1129
- applyWheel: ft
1133
+ getViewportSize: () => X,
1134
+ applyWheel: it
1130
1135
  }),
1131
- [Ae, e, N, he, ft]
1136
+ [Ae, e, X, be, it]
1132
1137
  );
1133
- const pt = Ir(), V = te?.id ?? pt, Q = g({
1138
+ const vt = Sr(), E = U?.id ?? vt, J = g({
1134
1139
  pointerType: "",
1135
1140
  pointerId: null,
1136
1141
  startClientY: 0,
@@ -1139,151 +1144,151 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
1139
1144
  shouldCancelNextClick: !1,
1140
1145
  clickResetTimer: null,
1141
1146
  velocitySamples: []
1142
- }), We = g(p), gt = g(b);
1143
- X(() => {
1144
- We.current = p;
1145
- }, [p]), X(() => {
1146
- gt.current = b;
1147
+ }), Ze = g(f), ht = g(b);
1148
+ q(() => {
1149
+ Ze.current = f;
1150
+ }, [f]), q(() => {
1151
+ ht.current = b;
1147
1152
  }, [b]);
1148
- const He = g(H);
1149
- X(() => {
1150
- He.current = H;
1151
- }, [H]);
1152
- const et = g(Ce);
1153
- X(() => {
1154
- et.current = Ce;
1155
- }, [Ce]), X(() => {
1156
- const d = Q.current;
1157
- if (p && H && (d.pointerId === null || Wt(d.pointerType, b)) || d.pointerId === null)
1153
+ const Le = g(K);
1154
+ q(() => {
1155
+ Le.current = K;
1156
+ }, [K]);
1157
+ const st = g(Ce);
1158
+ q(() => {
1159
+ st.current = Ce;
1160
+ }, [Ce]), q(() => {
1161
+ const p = J.current;
1162
+ if (f && K && (p.pointerId === null || Wt(p.pointerType, b)) || p.pointerId === null)
1158
1163
  return;
1159
- const W = S.current;
1160
- d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
1161
- const U = d.isDragging && d.shouldCancelNextClick, k = d.pointerId;
1162
- d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.shouldCancelNextClick = U, d.velocitySamples = [], W?.hasPointerCapture(k) && W.releasePointerCapture(k);
1163
- }, [p, b, H]), X(() => {
1164
- const d = S.current;
1165
- if (!d)
1164
+ const F = W.current;
1165
+ p.clickResetTimer !== null && (window.clearTimeout(p.clickResetTimer), p.clickResetTimer = null);
1166
+ const B = p.isDragging && p.shouldCancelNextClick, Y = p.pointerId;
1167
+ p.pointerId = null, p.pointerType = "", p.startClientY = 0, p.startScroll = 0, p.isDragging = !1, p.shouldCancelNextClick = B, p.velocitySamples = [], F?.hasPointerCapture(Y) && F.releasePointerCapture(Y);
1168
+ }, [f, b, K]), q(() => {
1169
+ const p = W.current;
1170
+ if (!p)
1166
1171
  return;
1167
- const W = 6, U = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), k = () => {
1168
- const f = Q.current;
1169
- f.pointerId = null, f.pointerType = "", f.startClientY = 0, f.startScroll = 0, f.isDragging = !1, f.velocitySamples = [];
1170
- }, q = () => {
1171
- const f = Q.current;
1172
- f.clickResetTimer !== null && (window.clearTimeout(f.clickResetTimer), f.clickResetTimer = null);
1173
- }, Ie = (f) => {
1174
- const E = Q.current, Se = U();
1175
- E.velocitySamples.push({ clientY: f, time: Se });
1176
- const _e = et.current.velocitySampleWindow;
1177
- E.velocitySamples = E.velocitySamples.filter((ke) => Se - ke.time <= _e);
1178
- }, Re = (f) => f instanceof HTMLElement && f.closest("[data-scrollpane-ignore-drag='true']") !== null, ee = (f) => {
1179
- const E = Q.current;
1180
- E.shouldCancelNextClick && (f.preventDefault(), f.stopPropagation(), E.shouldCancelNextClick = !1);
1181
- }, Oe = (f) => {
1182
- const E = Q.current;
1183
- if (!E.isDragging) {
1184
- if (E.isDragging = !0, E.shouldCancelNextClick = !0, !d.hasPointerCapture(f.pointerId))
1172
+ const F = 6, B = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Y = () => {
1173
+ const d = J.current;
1174
+ d.pointerId = null, d.pointerType = "", d.startClientY = 0, d.startScroll = 0, d.isDragging = !1, d.velocitySamples = [];
1175
+ }, te = () => {
1176
+ const d = J.current;
1177
+ d.clickResetTimer !== null && (window.clearTimeout(d.clickResetTimer), d.clickResetTimer = null);
1178
+ }, Me = (d) => {
1179
+ const y = J.current, xe = B();
1180
+ y.velocitySamples.push({ clientY: d, time: xe });
1181
+ const tt = st.current.velocitySampleWindow;
1182
+ y.velocitySamples = y.velocitySamples.filter((_e) => xe - _e.time <= tt);
1183
+ }, j = (d) => d instanceof HTMLElement && d.closest("[data-scrollpane-ignore-drag='true']") !== null, re = (d) => {
1184
+ const y = J.current;
1185
+ y.shouldCancelNextClick && (d.preventDefault(), d.stopPropagation(), y.shouldCancelNextClick = !1);
1186
+ }, De = (d) => {
1187
+ const y = J.current;
1188
+ if (!y.isDragging) {
1189
+ if (y.isDragging = !0, y.shouldCancelNextClick = !0, !p.hasPointerCapture(d.pointerId))
1185
1190
  try {
1186
- d.setPointerCapture(f.pointerId);
1191
+ p.setPointerCapture(d.pointerId);
1187
1192
  } catch {
1188
1193
  }
1189
- Ie(f.clientY);
1194
+ Me(d.clientY);
1190
1195
  }
1191
- }, ge = (f) => f.isTrusted || f.target === d, ze = (f) => {
1192
- const E = Q.current;
1193
- d.hasPointerCapture(f) && d.releasePointerCapture(f), E.shouldCancelNextClick = !1, q(), k();
1194
- }, Ue = (f) => {
1195
- const E = Q.current;
1196
- if (E.pointerId !== f.pointerId)
1196
+ }, ne = (d) => d.isTrusted || d.target === p, Je = (d) => {
1197
+ const y = J.current;
1198
+ p.hasPointerCapture(d) && p.releasePointerCapture(d), y.shouldCancelNextClick = !1, te(), Y();
1199
+ }, Oe = (d) => {
1200
+ const y = J.current;
1201
+ if (y.pointerId !== d.pointerId)
1197
1202
  return;
1198
- if (f.buttons === 0 && Hr(f.pointerType)) {
1199
- ze(f.pointerId);
1203
+ if (d.buttons === 0 && qr(d.pointerType)) {
1204
+ Je(d.pointerId);
1200
1205
  return;
1201
1206
  }
1202
- if (!(We.current && He.current) || !Wt(f.pointerType, gt.current) || !E.isDragging && (Math.abs(f.clientY - E.startClientY) < W || (Oe(f), !E.isDragging)))
1207
+ if (!(Ze.current && Le.current) || !Wt(d.pointerType, ht.current) || !y.isDragging && (Math.abs(d.clientY - y.startClientY) < F || (De(d), !y.isDragging)))
1203
1208
  return;
1204
- Ie(f.clientY);
1205
- const Se = f.clientY - E.startClientY, _e = E.startScroll - Se;
1206
- ie.current(_e), f.cancelable && f.preventDefault();
1207
- }, Te = () => {
1208
- const f = Q.current;
1209
- return f.pointerId !== null || !f.shouldCancelNextClick ? !1 : (q(), f.clickResetTimer = window.setTimeout(() => {
1210
- const E = Q.current;
1211
- E.shouldCancelNextClick = !1, E.clickResetTimer = null;
1209
+ Me(d.clientY);
1210
+ const xe = d.clientY - y.startClientY, tt = y.startScroll - xe;
1211
+ ue.current(tt), d.cancelable && d.preventDefault();
1212
+ }, ae = () => {
1213
+ const d = J.current;
1214
+ return d.pointerId !== null || !d.shouldCancelNextClick ? !1 : (te(), d.clickResetTimer = window.setTimeout(() => {
1215
+ const y = J.current;
1216
+ y.shouldCancelNextClick = !1, y.clickResetTimer = null;
1212
1217
  }, 0), !0);
1213
- }, be = (f) => {
1214
- const E = Q.current;
1215
- if (E.pointerId !== f.pointerId) {
1216
- Te();
1218
+ }, ve = (d) => {
1219
+ const y = J.current;
1220
+ if (y.pointerId !== d.pointerId) {
1221
+ ae();
1217
1222
  return;
1218
1223
  }
1219
- E.isDragging && E.shouldCancelNextClick && f.cancelable && (f.preventDefault(), f.stopPropagation()), E.isDragging && Ie(f.clientY);
1220
- let Se = 0;
1221
- if (E.isDragging && E.velocitySamples.length >= 2) {
1222
- const ke = E.velocitySamples, ot = et.current.velocitySampleWindow, lt = ke[ke.length - 1], mt = ke.find((ct) => lt.time - ct.time <= ot) ?? ke[0];
1223
- if (lt && mt && lt.time !== mt.time) {
1224
- const ct = lt.clientY - mt.clientY, ht = lt.time - mt.time;
1225
- Se = -(ct / ht);
1224
+ y.isDragging && y.shouldCancelNextClick && d.cancelable && (d.preventDefault(), d.stopPropagation()), y.isDragging && Me(d.clientY);
1225
+ let xe = 0;
1226
+ if (y.isDragging && y.velocitySamples.length >= 2) {
1227
+ const _e = y.velocitySamples, ct = st.current.velocitySampleWindow, ut = _e[_e.length - 1], at = _e.find((gt) => ut.time - gt.time <= ct) ?? _e[0];
1228
+ if (ut && at && ut.time !== at.time) {
1229
+ const gt = ut.clientY - at.clientY, pt = ut.time - at.time;
1230
+ xe = -(gt / pt);
1226
1231
  }
1227
1232
  }
1228
- q(), E.shouldCancelNextClick && (E.clickResetTimer = window.setTimeout(() => {
1229
- const ke = Q.current;
1230
- ke.shouldCancelNextClick = !1, ke.clickResetTimer = null;
1233
+ te(), y.shouldCancelNextClick && (y.clickResetTimer = window.setTimeout(() => {
1234
+ const _e = J.current;
1235
+ _e.shouldCancelNextClick = !1, _e.clickResetTimer = null;
1231
1236
  }, 0));
1232
- const _e = et.current.startVelocityThreshold;
1233
- k(), d.hasPointerCapture(f.pointerId) && d.releasePointerCapture(f.pointerId), Math.abs(Se) >= _e && dt.current?.(Se);
1234
- }, Me = (f) => {
1235
- if (Q.current.pointerId !== null) {
1236
- if (!f.isPrimary || f.pointerType !== Q.current.pointerType)
1237
+ const tt = st.current.startVelocityThreshold;
1238
+ Y(), p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), Math.abs(xe) >= tt && mt.current?.(xe);
1239
+ }, Ue = (d) => {
1240
+ if (J.current.pointerId !== null) {
1241
+ if (!d.isPrimary || d.pointerType !== J.current.pointerType)
1237
1242
  return;
1238
- ze(Q.current.pointerId);
1243
+ Je(J.current.pointerId);
1239
1244
  }
1240
- if (Q.current.shouldCancelNextClick && (q(), Q.current.shouldCancelNextClick = !1), !(We.current && He.current) || !Wt(f.pointerType, gt.current) || f.button !== 0 && f.pointerType === "mouse" || f.ctrlKey || f.metaKey || f.altKey || Re(f.target))
1245
+ if (J.current.shouldCancelNextClick && (te(), J.current.shouldCancelNextClick = !1), !(Ze.current && Le.current) || !Wt(d.pointerType, ht.current) || d.button !== 0 && d.pointerType === "mouse" || d.ctrlKey || d.metaKey || d.altKey || j(d.target))
1241
1246
  return;
1242
- window.dispatchEvent(new CustomEvent(jt, { detail: { paneId: pt } })), Be.current?.();
1243
- const E = Q.current;
1244
- q(), E.pointerId = f.pointerId, E.pointerType = f.pointerType, E.startClientY = f.clientY, E.startScroll = Y.current, E.isDragging = !1, E.shouldCancelNextClick = !1, E.velocitySamples = [];
1245
- }, Ee = (f) => {
1246
- if (Q.current.pointerId !== f.pointerId) {
1247
- Te();
1247
+ window.dispatchEvent(new CustomEvent(Gt, { detail: { paneId: vt } })), Te.current?.();
1248
+ const y = J.current;
1249
+ te(), y.pointerId = d.pointerId, y.pointerType = d.pointerType, y.startClientY = d.clientY, y.startScroll = C.current, y.isDragging = !1, y.shouldCancelNextClick = !1, y.velocitySamples = [];
1250
+ }, Ve = (d) => {
1251
+ if (J.current.pointerId !== d.pointerId) {
1252
+ ae();
1248
1253
  return;
1249
1254
  }
1250
- ge(f) && ze(f.pointerId);
1251
- }, rt = [
1252
- ["click", ee, !0],
1253
- ["pointerdown", Me, { passive: !1 }],
1254
- ["lostpointercapture", (f) => {
1255
- f.target !== d || Q.current.pointerId !== f.pointerId || ze(f.pointerId);
1255
+ ne(d) && Je(d.pointerId);
1256
+ }, Qe = [
1257
+ ["click", re, !0],
1258
+ ["pointerdown", Ue, { passive: !1 }],
1259
+ ["lostpointercapture", (d) => {
1260
+ d.target !== p || J.current.pointerId !== d.pointerId || Je(d.pointerId);
1256
1261
  }, void 0]
1257
- ], st = [
1258
- ["pointermove", Ue, { passive: !1 }],
1259
- ["pointerup", be, void 0],
1260
- ["pointercancel", Ee, void 0]
1262
+ ], ot = [
1263
+ ["pointermove", Oe, { passive: !1 }],
1264
+ ["pointerup", ve, void 0],
1265
+ ["pointercancel", Ve, void 0]
1261
1266
  ];
1262
- return _t(d, rt, "add"), _t(window, st, "add"), () => {
1263
- _t(d, rt, "remove"), _t(window, st, "remove");
1264
- const f = Q.current;
1265
- f.pointerId !== null && d.hasPointerCapture(f.pointerId) && d.releasePointerCapture(f.pointerId), q(), k();
1267
+ return kt(p, Qe, "add"), kt(window, ot, "add"), () => {
1268
+ kt(p, Qe, "remove"), kt(window, ot, "remove");
1269
+ const d = J.current;
1270
+ d.pointerId !== null && p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), te(), Y();
1266
1271
  };
1267
- }, [pt]);
1268
- const ce = v(
1269
- (d) => (he(), Ae(d)),
1270
- [Ae, he]
1272
+ }, [vt]);
1273
+ const ie = S(
1274
+ (p) => (be(), Ae(p)),
1275
+ [Ae, be]
1271
1276
  );
1272
- return /* @__PURE__ */ Tt("div", { ref: Z, "data-testid": C, "data-self-measured": $ ? "true" : void 0, className: Rt("aqvs-scroll-pane", w), style: h, children: [
1273
- /* @__PURE__ */ Tt(
1277
+ return /* @__PURE__ */ Mt("div", { ref: v, "data-testid": V, "data-self-measured": ge ? "true" : void 0, className: Et("aqvs-scroll-pane", w), style: h, children: [
1278
+ /* @__PURE__ */ Mt(
1274
1279
  "div",
1275
1280
  {
1276
- ref: S,
1277
- className: Rt("aqvs-scroll-pane-content"),
1281
+ ref: W,
1282
+ className: Et("aqvs-scroll-pane-content"),
1278
1283
  "data-testid": "aqvs-scroll-pane-content",
1279
1284
  style: {
1280
1285
  // ❗ 自己計測モードでは高さを書かない。CSS の `height: 100%` (= ルートの確定高さ) が
1281
1286
  // レイアウトを所有することで、「計測した値を書き戻して自分のサイズを変える」
1282
1287
  // フィードバックループが構造的に起こらず、初回 paint の時点でも帯は実寸で正しい
1283
1288
  // (数値の反映だけが 1 コミット遅れる)。明示モードは従来どおり px を書く。
1284
- height: $ ? void 0 : N,
1285
- paddingTop: Ze.top,
1286
- paddingBottom: Ze.bottom,
1289
+ height: ge ? void 0 : X,
1290
+ paddingTop: je.top,
1291
+ paddingBottom: je.bottom,
1287
1292
  // スクロール不能時 (contentSize <= viewportSize) は touch-action を通常に戻し、
1288
1293
  // 短いリスト上のタッチがページ全体のパンを妨げるデッドゾーン化を防ぐ。
1289
1294
  // 直接操作 (指・ペン) のドラッグを許可していない場合も付けない。
@@ -1297,43 +1302,43 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
1297
1302
  // 同一条件で揃えてあるため状態としても一貫している。
1298
1303
  // 非同期コンテンツを先読みして確保する挙動は意図的に入れていない
1299
1304
  // (空のペインがページのパンを殺すデッドゾーンになり、そちらの実害の方が大きいため)。
1300
- ...p && H && b.some((d) => d === "touch" || d === "pen") ? { touchAction: "none" } : {}
1305
+ ...f && K && b.some((p) => p === "touch" || p === "pen") ? { touchAction: "none" } : {}
1301
1306
  },
1302
- ...te,
1303
- id: V,
1307
+ ...U,
1308
+ id: E,
1304
1309
  children: [
1305
1310
  z,
1306
- r(Y.current)
1311
+ r(C.current)
1307
1312
  ]
1308
1313
  }
1309
1314
  ),
1310
- /* @__PURE__ */ le(
1311
- _r,
1315
+ /* @__PURE__ */ de(
1316
+ kr,
1312
1317
  {
1313
1318
  contentSize: e,
1314
- viewportSize: N,
1315
- scrollPosition: Y.current,
1316
- onScroll: ce,
1319
+ viewportSize: X,
1320
+ scrollPosition: C.current,
1321
+ onScroll: ie,
1317
1322
  enableThumbDrag: s,
1318
1323
  enableTrackClick: a,
1319
1324
  enableArrowButtons: c,
1320
1325
  scrollBarWidth: i,
1321
- ariaControls: V,
1322
- tapScrollCircleOptions: J,
1323
- itemCount: de,
1324
- renderThumbOverlay: fe,
1325
- visibleStartIndex: P,
1326
- visibleEndIndex: _
1326
+ ariaControls: E,
1327
+ tapScrollCircleOptions: G,
1328
+ itemCount: pe,
1329
+ renderThumbOverlay: me,
1330
+ visibleStartIndex: _,
1331
+ visibleEndIndex: M
1327
1332
  },
1328
1333
  "scrollbar"
1329
1334
  ),
1330
- M?.()
1335
+ Z?.()
1331
1336
  ] });
1332
1337
  }
1333
- ), or = (r, e, t) => Math.min(Math.max(r, e), t), an = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
1334
- const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), c = r.direction * e * 26 * t, p = 0.8 + e * 0.18, b = 3 * t, I = 6 * t, w = 22 * t, C = Math.abs(c) + I, h = c > 0 ? b : -Math.abs(c) - b, z = Math.max(2.5, 3 * t), J = or(r.offsetX, -i, i), B = or(r.offsetY, -i, i), de = i * 0.35, fe = J / i * de, ne = B / i * de, ae = fe * 0.45, pe = ne * 0.45, P = Math.max(w * 0.38, 6), _ = 0.65 + e * 0.2, M = r.active;
1335
- return /* @__PURE__ */ Tt(ur, { children: [
1336
- /* @__PURE__ */ le(
1338
+ ), ar = (r, e, t) => Math.min(Math.max(r, e), t), an = ({ dragState: r, normalizedDistance: e, sizeScale: t, size: n }) => {
1339
+ const i = Math.max(n / 2, 1), s = 1 + e * 0.65, a = Math.max(0.65, 1 - e * 0.25), c = r.direction * e * 26 * t, f = 0.8 + e * 0.18, b = 3 * t, I = 6 * t, w = 22 * t, V = Math.abs(c) + I, h = c > 0 ? b : -Math.abs(c) - b, z = Math.max(2.5, 3 * t), G = ar(r.offsetX, -i, i), H = ar(r.offsetY, -i, i), pe = i * 0.35, me = G / i * pe, oe = H / i * pe, ce = me * 0.45, he = oe * 0.45, P = Math.max(w * 0.38, 6), _ = 0.65 + e * 0.2, M = r.active;
1340
+ return /* @__PURE__ */ Mt(dr, { children: [
1341
+ /* @__PURE__ */ de(
1337
1342
  "div",
1338
1343
  {
1339
1344
  className: "aqvs-tap-scroll-circle-gradient",
@@ -1343,39 +1348,39 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
1343
1348
  }
1344
1349
  }
1345
1350
  ),
1346
- /* @__PURE__ */ le(
1351
+ /* @__PURE__ */ de(
1347
1352
  "div",
1348
1353
  {
1349
1354
  className: "aqvs-sample-visual-pupil",
1350
1355
  style: {
1351
1356
  width: w,
1352
1357
  height: w,
1353
- transform: `translate(calc(-50% + ${fe}px), calc(-50% + ${ne}px)) scale(${a}, ${p * s})`,
1358
+ transform: `translate(calc(-50% + ${me}px), calc(-50% + ${oe}px)) scale(${a}, ${f * s})`,
1354
1359
  transition: M ? "70ms transform ease-out" : "200ms ease transform"
1355
1360
  }
1356
1361
  }
1357
1362
  ),
1358
- /* @__PURE__ */ le(
1363
+ /* @__PURE__ */ de(
1359
1364
  "div",
1360
1365
  {
1361
1366
  className: "aqvs-sample-visual-highlight",
1362
1367
  style: {
1363
1368
  width: P,
1364
1369
  height: P,
1365
- transform: `translate(calc(-50% + ${ae}px), calc(-50% + ${pe}px)) scale(${a}, ${s})`,
1370
+ transform: `translate(calc(-50% + ${ce}px), calc(-50% + ${he}px)) scale(${a}, ${s})`,
1366
1371
  opacity: _,
1367
1372
  boxShadow: "0 0 8px rgba(255,255,255,0.45)",
1368
1373
  transition: M ? "120ms opacity 150ms, 120ms transform ease-out ease-out" : "220ms ease transform, 240ms opacity ease"
1369
1374
  }
1370
1375
  }
1371
1376
  ),
1372
- /* @__PURE__ */ le(
1377
+ /* @__PURE__ */ de(
1373
1378
  "div",
1374
1379
  {
1375
1380
  className: "aqvs-sample-visual-rod",
1376
1381
  style: {
1377
1382
  width: z,
1378
- height: C,
1383
+ height: V,
1379
1384
  transform: `translate(-50%, ${h}px)`,
1380
1385
  opacity: e,
1381
1386
  transition: M ? "40ms height, 60ms opacity ease-out ease-out" : "200ms ease height, 120ms ease opacity"
@@ -1383,16 +1388,16 @@ const oe = (r, e, t) => Math.max(e, Math.min(t, r)), jt = "virtualscroll:tap-scr
1383
1388
  }
1384
1389
  )
1385
1390
  ] });
1386
- }, kt = 100, Xr = (r) => {
1391
+ }, Ft = 100, $r = (r) => {
1387
1392
  if (!Number.isFinite(r))
1388
1393
  return 0n;
1389
1394
  const e = Math.trunc(r);
1390
1395
  return e <= 0 ? 0n : BigInt(e);
1391
- }, Ut = (r, e) => {
1396
+ }, Kt = (r, e) => {
1392
1397
  if (!Number.isFinite(r))
1393
1398
  throw new Error(`valueFn returned a non-finite value at index ${e}: ${r}`);
1394
1399
  return r;
1395
- }, yt = (r) => {
1400
+ }, Rt = (r) => {
1396
1401
  if (r <= 0 || !Number.isFinite(r))
1397
1402
  return 0;
1398
1403
  const e = Math.trunc(r);
@@ -1469,23 +1474,23 @@ class St {
1469
1474
  if (i > 0) {
1470
1475
  const c = n?.sampleRange ?? {
1471
1476
  from: 0,
1472
- to: Math.min(kt - 1, i - 1)
1477
+ to: Math.min(Ft - 1, i - 1)
1473
1478
  };
1474
- let p = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
1475
- if (p > b && (p = 0, b = Math.min(kt - 1, i - 1)), i > kt)
1476
- s = St._sampleBaseValueStrided(t, i, kt), n?.materialize && (a = { from: p, values: St._collectValidatedValues(t, p, b) });
1479
+ let f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), i - 1);
1480
+ if (f > b && (f = 0, b = Math.min(Ft - 1, i - 1)), i > Ft)
1481
+ s = St._sampleBaseValueStrided(t, i, Ft), n?.materialize && (a = { from: f, values: St._collectValidatedValues(t, f, b) });
1477
1482
  else {
1478
- const I = St._collectValidatedValues(t, p, b);
1479
- s = St._modeOrMedian([...I]), n?.materialize && (a = { from: p, values: I });
1483
+ const I = St._collectValidatedValues(t, f, b);
1484
+ s = St._modeOrMedian([...I]), n?.materialize && (a = { from: f, values: I });
1480
1485
  }
1481
1486
  }
1482
1487
  if (this.size = i, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, this.valueFn = t, this.baseValue = s, a)
1483
1488
  for (let c = 0; c < a.values.length; c++) {
1484
- const p = a.from + c;
1485
- if (p >= this.size)
1489
+ const f = a.from + c;
1490
+ if (f >= this.size)
1486
1491
  break;
1487
1492
  const b = a.values[c] - this.baseValue;
1488
- b !== 0 && (this.deltas.set(p, b), this._updateTree(p, b));
1493
+ b !== 0 && (this.deltas.set(f, b), this._updateTree(f, b));
1489
1494
  }
1490
1495
  this.total = this.getTotal();
1491
1496
  }
@@ -1516,7 +1521,7 @@ class St {
1516
1521
  static _collectValidatedValues(e, t, n) {
1517
1522
  const i = [];
1518
1523
  for (let s = t; s <= n; s++)
1519
- i.push(Ut(e(s), s));
1524
+ i.push(Kt(e(s), s));
1520
1525
  return i;
1521
1526
  }
1522
1527
  /**
@@ -1542,9 +1547,9 @@ class St {
1542
1547
  }
1543
1548
  if (s > e.length * 0.2) {
1544
1549
  const a = [];
1545
- for (const [p, b] of i.entries())
1546
- b === s && a.push(p);
1547
- const c = a.reduce((p, b) => p + b, 0);
1550
+ for (const [f, b] of i.entries())
1551
+ b === s && a.push(f);
1552
+ const c = a.reduce((f, b) => f + b, 0);
1548
1553
  n = Math.floor(c / a.length);
1549
1554
  }
1550
1555
  return n;
@@ -1566,7 +1571,7 @@ class St {
1566
1571
  i % 2 === 0 && (i += 1);
1567
1572
  const s = [];
1568
1573
  for (let a = 0; a < t && s.length < n; a += i)
1569
- s.push(Ut(e(a), a));
1574
+ s.push(Kt(e(a), a));
1570
1575
  return St._modeOrMedian(s);
1571
1576
  }
1572
1577
  /**
@@ -1639,7 +1644,7 @@ class St {
1639
1644
  let n = e + 1;
1640
1645
  for (; n <= this.size; ) {
1641
1646
  this.tree.set(n, (this.tree.get(n) ?? 0) + t);
1642
- const i = yt(n);
1647
+ const i = Rt(n);
1643
1648
  if (i === 0)
1644
1649
  break;
1645
1650
  n += i;
@@ -1665,8 +1670,8 @@ class St {
1665
1670
  throw new Error(`Value must be a finite number: ${s}`);
1666
1671
  if (s < 0)
1667
1672
  throw new Error("Value cannot be negative.");
1668
- const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, p = s - c;
1669
- p !== 0 && t.push({ index: i, change: p }), n.set(i, a + p);
1673
+ const a = n.has(i) ? n.get(i) ?? 0 : this.deltas.get(i) ?? 0, c = a + this.baseValue, f = s - c;
1674
+ f !== 0 && t.push({ index: i, change: f }), n.set(i, a + f);
1670
1675
  }
1671
1676
  return t;
1672
1677
  }
@@ -1683,7 +1688,7 @@ class St {
1683
1688
  let e = 0, t = this.size;
1684
1689
  for (; t > 0; ) {
1685
1690
  e += this.tree.get(t) ?? 0;
1686
- const n = yt(t);
1691
+ const n = Rt(t);
1687
1692
  if (n === 0)
1688
1693
  break;
1689
1694
  t -= n;
@@ -1700,7 +1705,7 @@ class St {
1700
1705
  */
1701
1706
  _materialize(e, t = !0) {
1702
1707
  if (this.valueFn) {
1703
- const n = this.deltas.get(e) ?? 0, s = Ut(this.valueFn(e), e) - this.baseValue;
1708
+ const n = this.deltas.get(e) ?? 0, s = Kt(this.valueFn(e), e) - this.baseValue;
1704
1709
  if (s !== n && (s === 0 ? this.deltas.delete(e) : this.deltas.set(e, s), t)) {
1705
1710
  const a = s - n;
1706
1711
  this._updateTree(e, a);
@@ -1722,8 +1727,8 @@ class St {
1722
1727
  const i = e.ranges;
1723
1728
  if (i && i.length > 0) {
1724
1729
  for (const c of i) {
1725
- const p = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
1726
- for (let I = p; I <= b; I++)
1730
+ const f = Math.max(0, Math.trunc(c.from)), b = Math.min(Math.trunc(c.to), this.size - 1);
1731
+ for (let I = f; I <= b; I++)
1727
1732
  this._materialize(I);
1728
1733
  }
1729
1734
  if (t === void 0)
@@ -1790,8 +1795,8 @@ class St {
1790
1795
  for (; s > 0; s >>= 1) {
1791
1796
  const a = n + s;
1792
1797
  if (a <= this.size) {
1793
- const p = (this.tree.get(a) ?? 0) + this.baseValue * s;
1794
- (t ? i + p < e : i + p <= e) && (n = a, i += p);
1798
+ const f = (this.tree.get(a) ?? 0) + this.baseValue * s;
1799
+ (t ? i + f < e : i + f <= e) && (n = a, i += f);
1795
1800
  }
1796
1801
  }
1797
1802
  return t ? n : n - 1;
@@ -1804,17 +1809,17 @@ class St {
1804
1809
  _findIndexLarge(e, t, n) {
1805
1810
  if (this.size === 0)
1806
1811
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1807
- const i = Xr(this.size);
1812
+ const i = $r(this.size);
1808
1813
  if (i === 0n)
1809
1814
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
1810
1815
  this._materializeRanges(t.materializeOption);
1811
1816
  const s = t.materializeOption?.materialize === !0;
1812
1817
  for (; ; ) {
1813
- let a = 0n, c = i - 1n, p, b, I = this.total;
1818
+ let a = 0n, c = i - 1n, f, b, I = this.total;
1814
1819
  for (; a <= c; ) {
1815
- const h = a + c >> 1n, z = Number(h), J = this.prefixSum(z);
1816
- if (I = J.total, n ? J.cumulative >= e : J.cumulative <= e)
1817
- if (p = h, b = J, n) {
1820
+ const h = a + c >> 1n, z = Number(h), G = this.prefixSum(z);
1821
+ if (I = G.total, n ? G.cumulative >= e : G.cumulative <= e)
1822
+ if (f = h, b = G, n) {
1818
1823
  if (h === 0n)
1819
1824
  break;
1820
1825
  c = h - 1n;
@@ -1828,14 +1833,14 @@ class St {
1828
1833
  c = h - 1n;
1829
1834
  }
1830
1835
  }
1831
- const w = b, C = p !== void 0 ? Number(p) : -1;
1832
- if (s && C >= 0) {
1833
- const h = this.deltas.get(C) ?? 0;
1834
- if (this._materialize(C), (this.deltas.get(C) ?? 0) !== h)
1836
+ const w = b, V = f !== void 0 ? Number(f) : -1;
1837
+ if (s && V >= 0) {
1838
+ const h = this.deltas.get(V) ?? 0;
1839
+ if (this._materialize(V), (this.deltas.get(V) ?? 0) !== h)
1835
1840
  continue;
1836
1841
  }
1837
1842
  return {
1838
- index: C,
1843
+ index: V,
1839
1844
  total: I,
1840
1845
  cumulative: w?.cumulative,
1841
1846
  currentValue: w?.currentValue,
@@ -1856,13 +1861,13 @@ class St {
1856
1861
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
1857
1862
  if (this.size === 0)
1858
1863
  return { cumulative: 0, total: this.total ?? 0, currentValue: 0, safeIndex: 0 };
1859
- const n = oe(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
1864
+ const n = le(Math.trunc(e), 0, this.size - 1), i = t?.materializeOption;
1860
1865
  this._materializeRanges(i, n, !0);
1861
1866
  let s = 0, a = n + 1;
1862
1867
  for (; a > 0; ) {
1863
- const p = this.tree.get(a) ?? 0;
1864
- s += p;
1865
- const b = yt(a);
1868
+ const f = this.tree.get(a) ?? 0;
1869
+ s += f;
1870
+ const b = Rt(a);
1866
1871
  if (b === 0)
1867
1872
  break;
1868
1873
  a -= b;
@@ -1925,7 +1930,7 @@ class St {
1925
1930
  let s = n + 1;
1926
1931
  for (; s <= this.size; ) {
1927
1932
  t.set(s, (t.get(s) ?? 0) + i);
1928
- const a = yt(s);
1933
+ const a = Rt(s);
1929
1934
  if (a === 0)
1930
1935
  break;
1931
1936
  s += a;
@@ -2042,14 +2047,14 @@ class St {
2042
2047
  _propagateDeltaToGrownNodes(e, t, n, i) {
2043
2048
  let s = e + 1;
2044
2049
  for (; s <= n; ) {
2045
- const a = yt(s);
2050
+ const a = Rt(s);
2046
2051
  if (a === 0)
2047
2052
  break;
2048
2053
  s += a;
2049
2054
  }
2050
2055
  for (; s <= i; ) {
2051
2056
  this.tree.set(s, (this.tree.get(s) ?? 0) + t);
2052
- const a = yt(s);
2057
+ const a = Rt(s);
2053
2058
  if (a === 0)
2054
2059
  break;
2055
2060
  s += a;
@@ -2143,20 +2148,20 @@ class St {
2143
2148
  return this._findIndex(e, t ?? {}, !1);
2144
2149
  }
2145
2150
  }
2146
- const $r = (r, e) => {
2151
+ const Ur = (r, e) => {
2147
2152
  const t = r?.sampleRange, n = e?.sampleRange;
2148
2153
  return t === n ? !1 : t && n ? t.from !== n.from || t.to !== n.to : !0;
2149
2154
  }, Wr = (r, e, t) => {
2150
2155
  const n = Number.isFinite(r) && r > 0 ? Math.trunc(r) : 0, i = g(null), s = g({ size: n, valueOrFn: e, options: t });
2151
2156
  i.current === null && (i.current = new St(n, e, t));
2152
- const a = i.current, c = s.current, p = c.size !== n, b = c.valueOrFn !== e, I = $r(c.options, t), w = c.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2157
+ const a = i.current, c = s.current, f = c.size !== n, b = c.valueOrFn !== e, I = Ur(c.options, t), w = c.size === 0 && n > 0 && (!i.current || i.current.base === 0);
2153
2158
  if (b || I) {
2154
- const C = t?.resetOnValueFnChange ?? !0;
2155
- I || b && C || w ? (t?.debug && T.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: I }), a.reset(n, e, t)) : (p && (t?.debug && T.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: n }), a.changeSize(n)), t?.debug && T.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
2156
- } else p && (t?.debug && T.debug("[useFenwickMapTree] resize", { from: c.size, to: n }), w ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
2159
+ const V = t?.resetOnValueFnChange ?? !0;
2160
+ I || b && V || w ? (t?.debug && T.debug("[useFenwickMapTree] reset", { valueOrFnChanged: b, optionsChanged: I }), a.reset(n, e, t)) : (f && (t?.debug && T.debug("[useFenwickMapTree] resize (with valueFn change)", { from: c.size, to: n }), a.changeSize(n)), t?.debug && T.debug("[useFenwickMapTree] setValueFn (no reset)", { valueOrFnChanged: b }), a.setValueFn(e, { reset: !1 })), s.current = { size: n, valueOrFn: e, options: t };
2161
+ } else f && (t?.debug && T.debug("[useFenwickMapTree] resize", { from: c.size, to: n }), w ? a.reset(n, e, t) : a.changeSize(n), s.current = { size: n, valueOrFn: e, options: t });
2157
2162
  return a;
2158
2163
  };
2159
- class Ur {
2164
+ class Kr {
2160
2165
  key;
2161
2166
  value;
2162
2167
  prev = null;
@@ -2165,7 +2170,7 @@ class Ur {
2165
2170
  this.key = e, this.value = t;
2166
2171
  }
2167
2172
  }
2168
- class Kt {
2173
+ class jt {
2169
2174
  head = null;
2170
2175
  tail = null;
2171
2176
  /**
@@ -2206,11 +2211,11 @@ class Kt {
2206
2211
  this.remove(e), this.addToTail(e);
2207
2212
  }
2208
2213
  }
2209
- function Kr(r) {
2210
- const e = g(/* @__PURE__ */ new Map()), t = g(new Kt()), n = Math.floor(r), i = g(n);
2211
- X(() => {
2214
+ function jr(r) {
2215
+ const e = g(/* @__PURE__ */ new Map()), t = g(new jt()), n = Math.floor(r), i = g(n);
2216
+ q(() => {
2212
2217
  if (i.current = n, Number.isNaN(n) || n < 0) {
2213
- T.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new Kt();
2218
+ T.warn(`useLruCache: invalid capacity ${r}; the cache will not store any entries.`), e.current.clear(), t.current = new jt();
2214
2219
  return;
2215
2220
  }
2216
2221
  if (Number.isFinite(n))
@@ -2222,42 +2227,42 @@ function Kr(r) {
2222
2227
  break;
2223
2228
  }
2224
2229
  }, [r, n]);
2225
- const s = v((I) => {
2230
+ const s = S((I) => {
2226
2231
  const w = e.current.get(I);
2227
2232
  if (w)
2228
2233
  return t.current.moveToTail(w), w.value;
2229
- }, []), a = v((I, w) => {
2230
- const C = i.current;
2231
- if (Number.isNaN(C) || C <= 0)
2234
+ }, []), a = S((I, w) => {
2235
+ const V = i.current;
2236
+ if (Number.isNaN(V) || V <= 0)
2232
2237
  return;
2233
2238
  let h = e.current.get(I);
2234
2239
  if (h)
2235
2240
  h.value = w, t.current.moveToTail(h);
2236
2241
  else {
2237
- if (e.current.size >= C) {
2242
+ if (e.current.size >= V) {
2238
2243
  const z = t.current.removeHead();
2239
2244
  z && e.current.delete(z.key);
2240
2245
  }
2241
- h = new Ur(I, w), e.current.set(I, h), t.current.addToTail(h);
2246
+ h = new Kr(I, w), e.current.set(I, h), t.current.addToTail(h);
2242
2247
  }
2243
- }, []), c = v((I) => e.current.has(I), []), p = v((I) => {
2248
+ }, []), c = S((I) => e.current.has(I), []), f = S((I) => {
2244
2249
  const w = e.current.get(I);
2245
2250
  w && (t.current.remove(w), e.current.delete(I));
2246
- }, []), b = v(() => {
2247
- e.current.clear(), t.current = new Kt();
2251
+ }, []), b = S(() => {
2252
+ e.current.clear(), t.current = new jt();
2248
2253
  }, []);
2249
- return Ye(() => ({ get: s, set: a, has: c, remove: p, clear: b }), [s, a, c, p, b]);
2254
+ return Fe(() => ({ get: s, set: a, has: c, remove: f, clear: b }), [s, a, c, f, b]);
2250
2255
  }
2251
- const jr = 1e4, ln = () => {
2252
- const { get: r, set: e, has: t, clear: n } = Kr(jr);
2253
- return Ye(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
2256
+ const Gr = 1e4, ln = () => {
2257
+ const { get: r, set: e, has: t, clear: n } = jr(Gr);
2258
+ return Fe(() => ({ get: r, set: e, has: t, clear: n }), [r, e, t, n]);
2254
2259
  }, cn = (r, e) => {
2255
2260
  const t = g(e), n = g(r);
2256
- it(() => {
2261
+ nt(() => {
2257
2262
  t.current = e, n.current = r;
2258
2263
  }, [e, r]);
2259
2264
  const i = g(/* @__PURE__ */ new WeakMap());
2260
- return v((s) => {
2265
+ return S((s) => {
2261
2266
  if (!s || i.current.has(s))
2262
2267
  return;
2263
2268
  const a = (c) => {
@@ -2267,28 +2272,20 @@ const jr = 1e4, ln = () => {
2267
2272
  i.current.get(s) === a && (s.removeEventListener("wheel", a), i.current.delete(s));
2268
2273
  };
2269
2274
  }, []);
2270
- }, we = (r, e) => e <= 0 ? 0 : oe(r, 0, e - 1), ar = (r) => ({
2275
+ }, Pe = (r, e) => e <= 0 ? 0 : le(r, 0, e - 1), lr = (r) => ({
2271
2276
  top: Math.max(0, r?.top ?? 0),
2272
2277
  bottom: Math.max(0, r?.bottom ?? 0)
2273
- }), je = (r, e) => r <= e ? 0 : r - e, wt = (r, e) => r <= 0 ? 0 : r + e, Ft = 1e3, lr = 2e3, Gr = 1048576, Zr = 40, Jr = (r) => {
2274
- const e = r.ownerDocument.defaultView?.getSelection();
2275
- if (!e || e.isCollapsed || e.rangeCount === 0)
2276
- return !1;
2277
- for (let t = 0; t < e.rangeCount; t += 1)
2278
- if (e.getRangeAt(t).intersectsNode(r))
2279
- return !0;
2280
- return !1;
2281
- }, zt = (r) => {
2278
+ }), Ke = (r, e) => r <= e ? 0 : r - e, Pt = (r, e) => r <= 0 ? 0 : r + e, Yt = 1e3, cr = 2e3, Zr = 1048576, Jr = 40, Dt = (r) => {
2282
2279
  if (!Number.isFinite(r)) return 0n;
2283
2280
  const e = Math.trunc(r);
2284
2281
  return e <= 0 ? 0n : BigInt(e);
2285
2282
  }, Qr = (r, e, t, n, i, s, a, c) => {
2286
- const p = zt(n);
2287
- if (p === 0n)
2283
+ const f = Dt(n);
2284
+ if (f === 0n)
2288
2285
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2289
- const b = (P) => P < 0n ? 0n : P >= p ? p - 1n : P, I = { materializeOption: { materialize: !1 } }, { index: w, cumulative: C } = s.findIndexAtOrAfter(r, I);
2286
+ const b = (P) => P < 0n ? 0n : P >= f ? f - 1n : P, I = { materializeOption: { materialize: !1 } }, { index: w, cumulative: V } = s.findIndexAtOrAfter(r, I);
2290
2287
  let h;
2291
- w === -1 ? h = p - 1n : (C === r ? h = zt(w + 1) : h = zt(w), h >= p && (h = p - 1n)), r <= 0 && (h = 0n), c && r >= a && (h = p - 1n);
2288
+ w === -1 ? h = f - 1n : (V === r ? h = Dt(w + 1) : h = Dt(w), h >= f && (h = f - 1n)), r <= 0 && (h = 0n), c && r >= a && (h = f - 1n);
2292
2289
  const z = (P) => {
2293
2290
  const _ = Number(P);
2294
2291
  if (!Number.isSafeInteger(_))
@@ -2296,52 +2293,52 @@ const jr = 1e4, ln = () => {
2296
2293
  const { cumulative: M } = s.prefixSum(_, { materializeOption: { materialize: !1 } });
2297
2294
  if (!Number.isFinite(M))
2298
2295
  return null;
2299
- const { index: j } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
2300
- if (j === -1)
2296
+ const { index: Z } = s.findIndexAtOrAfter(M + 0.5, { materializeOption: { materialize: !1 } });
2297
+ if (Z === -1)
2301
2298
  return null;
2302
- const te = zt(j);
2303
- return te > P ? te : null;
2304
- }, J = (P) => {
2305
- let _ = 0, M = P, j = P, te = 0n, G = 0;
2306
- for (; M < p && _ < e; ) {
2307
- const Y = Number(M), Z = i(Y);
2308
- if (_ += Z, j = M, M += 1n, te += 1n, !Number.isFinite(Z) || Z < 0)
2299
+ const Q = Dt(Z);
2300
+ return Q > P ? Q : null;
2301
+ }, G = (P) => {
2302
+ let _ = 0, M = P, Z = P, Q = 0n, U = 0;
2303
+ for (; M < f && _ < e; ) {
2304
+ const Se = Number(M), C = i(Se);
2305
+ if (_ += C, Z = M, M += 1n, Q += 1n, !Number.isFinite(C) || C < 0)
2309
2306
  break;
2310
- if (Z === 0) {
2311
- if (G += 1, G > Ft) {
2312
- const S = z(j);
2313
- if (S !== null && S > M)
2314
- M = S, G = 0;
2315
- else if (S !== null && S === M && i(Number(M)) > 0)
2316
- G = 0;
2307
+ if (C === 0) {
2308
+ if (U += 1, U > Yt) {
2309
+ const v = z(Z);
2310
+ if (v !== null && v > M)
2311
+ M = v, U = 0;
2312
+ else if (v !== null && v === M && i(Number(M)) > 0)
2313
+ U = 0;
2317
2314
  else
2318
2315
  break;
2319
2316
  }
2320
2317
  } else
2321
- G = 0;
2318
+ U = 0;
2322
2319
  }
2323
- return te === 0n && (j = P), { height: _, end: j };
2320
+ return Q === 0n && (Z = P), { height: _, end: Z };
2324
2321
  };
2325
- let { height: B, end: de } = J(h);
2326
- if (B < e && h > 0n) {
2327
- let P = h, _ = B, M = 0;
2322
+ let { height: H, end: pe } = G(h);
2323
+ if (H < e && h > 0n) {
2324
+ let P = h, _ = H, M = 0;
2328
2325
  for (; P > 0n && _ < e; ) {
2329
2326
  P -= 1n;
2330
- const te = Number(P), G = i(te);
2331
- if (_ += G, !Number.isFinite(G) || G < 0)
2327
+ const Q = Number(P), U = i(Q);
2328
+ if (_ += U, !Number.isFinite(U) || U < 0)
2332
2329
  break;
2333
- if (G === 0) {
2334
- if (M += 1, M > Ft) {
2335
- const Y = Number(P);
2336
- if (!Number.isSafeInteger(Y))
2330
+ if (U === 0) {
2331
+ if (M += 1, M > Yt) {
2332
+ const Se = Number(P);
2333
+ if (!Number.isSafeInteger(Se))
2337
2334
  break;
2338
- const { cumulative: Z } = s.prefixSum(Y, { materializeOption: { materialize: !1 } });
2339
- if (!Number.isFinite(Z))
2335
+ const { cumulative: C } = s.prefixSum(Se, { materializeOption: { materialize: !1 } });
2336
+ if (!Number.isFinite(C))
2340
2337
  break;
2341
- const { index: S } = s.findIndexAtOrAfter(Z - 0.5, { materializeOption: { materialize: !1 } }), $ = S === -1 ? -1n : zt(S);
2342
- if ($ >= 0n && $ < P)
2343
- P = $ + 1n, M = 0;
2344
- else if ($ === P && P >= 1n && i(Number(P - 1n)) > 0)
2338
+ const { index: v } = s.findIndexAtOrAfter(C - 0.5, { materializeOption: { materialize: !1 } }), W = v === -1 ? -1n : Dt(v);
2339
+ if (W >= 0n && W < P)
2340
+ P = W + 1n, M = 0;
2341
+ else if (W === P && P >= 1n && i(Number(P - 1n)) > 0)
2345
2342
  M = 0;
2346
2343
  else
2347
2344
  break;
@@ -2350,70 +2347,70 @@ const jr = 1e4, ln = () => {
2350
2347
  M = 0;
2351
2348
  }
2352
2349
  h = b(P);
2353
- const j = J(h);
2354
- B = j.height, de = j.end;
2350
+ const Z = G(h);
2351
+ H = Z.height, pe = Z.end;
2355
2352
  }
2356
- const fe = b(h), ne = b(de), ae = b(fe - BigInt(Math.max(0, t))), pe = b(ne + BigInt(Math.max(0, t)));
2353
+ const me = b(h), oe = b(pe), ce = b(me - BigInt(Math.max(0, t))), he = b(oe + BigInt(Math.max(0, t)));
2357
2354
  return {
2358
- renderingStartIndex: we(Number(ae), n),
2359
- renderingEndIndex: we(Number(pe), n),
2360
- visibleStartIndex: we(Number(fe), n),
2361
- visibleEndIndex: we(Number(ne), n)
2355
+ renderingStartIndex: Pe(Number(ce), n),
2356
+ renderingEndIndex: Pe(Number(he), n),
2357
+ visibleStartIndex: Pe(Number(me), n),
2358
+ visibleEndIndex: Pe(Number(oe), n)
2362
2359
  };
2363
2360
  }, en = (r, e, t, n, i, s, a) => {
2364
2361
  if (n === 0)
2365
2362
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
2366
- const c = Number.isFinite(a), p = c ? Math.min(Math.max(0, r), a) : Math.max(0, r);
2363
+ const c = Number.isFinite(a), f = c ? Math.min(Math.max(0, r), a) : Math.max(0, r);
2367
2364
  if (n >= Number.MAX_SAFE_INTEGER)
2368
- return Qr(p, e, t, n, i, s, a, c);
2369
- const { index: b, cumulative: I, currentValue: w } = s.findIndexAtOrAfter(p, { materializeOption: { materialize: !1 } }), C = b === -1 ? e <= 0 || (I ?? 0) < p + (w ?? 0) ? n - 1 : 0 : b;
2370
- let h = we(C, n), z = 0;
2371
- if (b !== -1 && I === p)
2372
- h = we(b + 1, n), z = 0;
2365
+ return Qr(f, e, t, n, i, s, a, c);
2366
+ const { index: b, cumulative: I, currentValue: w } = s.findIndexAtOrAfter(f, { materializeOption: { materialize: !1 } }), V = b === -1 ? e <= 0 || (I ?? 0) < f + (w ?? 0) ? n - 1 : 0 : b;
2367
+ let h = Pe(V, n), z = 0;
2368
+ if (b !== -1 && I === f)
2369
+ h = Pe(b + 1, n), z = 0;
2373
2370
  else if (h === b && I !== void 0 && w !== void 0)
2374
- z = I - w - p;
2371
+ z = I - w - f;
2375
2372
  else {
2376
2373
  const { cumulative: P, currentValue: _ } = s.prefixSum(h, { materializeOption: { materialize: !1 } });
2377
- z = (P ?? 0) - (_ ?? 0) - p;
2374
+ z = (P ?? 0) - (_ ?? 0) - f;
2378
2375
  }
2379
- const J = z, B = (P, _) => {
2380
- let M = P, j = _, te = 0;
2381
- for (; M < n && j < e; ) {
2382
- const G = i(M);
2383
- if (j += G, M++, !Number.isFinite(G) || G < 0)
2376
+ const G = z, H = (P, _) => {
2377
+ let M = P, Z = _, Q = 0;
2378
+ for (; M < n && Z < e; ) {
2379
+ const U = i(M);
2380
+ if (Z += U, M++, !Number.isFinite(U) || U < 0)
2384
2381
  break;
2385
- if (G === 0) {
2386
- if (te++, te > Ft) {
2387
- const { cumulative: Y } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: Z } = Number.isFinite(Y) ? s.findIndexAtOrAfter(Y + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2388
- if (Z > M)
2389
- M = Z, te = 0;
2390
- else if (Z === M && i(M) > 0)
2391
- te = 0;
2382
+ if (U === 0) {
2383
+ if (Q++, Q > Yt) {
2384
+ const { cumulative: Se } = s.prefixSum(M - 1, { materializeOption: { materialize: !1 } }), { index: C } = Number.isFinite(Se) ? s.findIndexAtOrAfter(Se + 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2385
+ if (C > M)
2386
+ M = C, Q = 0;
2387
+ else if (C === M && i(M) > 0)
2388
+ Q = 0;
2392
2389
  else
2393
2390
  break;
2394
2391
  }
2395
2392
  } else
2396
- te = 0;
2393
+ Q = 0;
2397
2394
  }
2398
- return { cursor: M, height: j };
2399
- }, de = B(h, z);
2400
- let fe = de.cursor;
2401
- if (z = de.height, z < e && h > 0) {
2402
- let P = z + Math.abs(Math.min(0, J)), _ = h - 1, M = 0;
2395
+ return { cursor: M, height: Z };
2396
+ }, pe = H(h, z);
2397
+ let me = pe.cursor;
2398
+ if (z = pe.height, z < e && h > 0) {
2399
+ let P = z + Math.abs(Math.min(0, G)), _ = h - 1, M = 0;
2403
2400
  for (; _ >= 0 && P < e; ) {
2404
- const te = i(_);
2405
- if (P += te, !Number.isFinite(te) || te < 0) {
2401
+ const Q = i(_);
2402
+ if (P += Q, !Number.isFinite(Q) || Q < 0) {
2406
2403
  _--;
2407
2404
  break;
2408
2405
  }
2409
- if (te === 0) {
2410
- if (M++, M > Ft) {
2411
- const { cumulative: G } = s.prefixSum(_, { materializeOption: { materialize: !1 } }), { index: Y } = Number.isFinite(G) ? s.findIndexAtOrAfter(G - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2412
- if (Y !== -1 && Y < _) {
2413
- _ = Y, M = 0;
2406
+ if (Q === 0) {
2407
+ if (M++, M > Yt) {
2408
+ const { cumulative: U } = s.prefixSum(_, { materializeOption: { materialize: !1 } }), { index: Se } = Number.isFinite(U) ? s.findIndexAtOrAfter(U - 0.5, { materializeOption: { materialize: !1 } }) : { index: -1 };
2409
+ if (Se !== -1 && Se < _) {
2410
+ _ = Se, M = 0;
2414
2411
  continue;
2415
2412
  }
2416
- if (Y === _ && _ >= 1 && i(_ - 1) > 0)
2413
+ if (Se === _ && _ >= 1 && i(_ - 1) > 0)
2417
2414
  M = 0;
2418
2415
  else {
2419
2416
  _--;
@@ -2424,15 +2421,15 @@ const jr = 1e4, ln = () => {
2424
2421
  M = 0;
2425
2422
  _--;
2426
2423
  }
2427
- h = we(_ + 1, n);
2428
- const j = B(h, 0);
2429
- fe = j.cursor, z = j.height;
2424
+ h = Pe(_ + 1, n);
2425
+ const Z = H(h, 0);
2426
+ me = Z.cursor, z = Z.height;
2430
2427
  }
2431
- const ne = we(h - t, n), ae = we(Math.max(fe - 1, h), n), pe = we(ae + t, n);
2432
- return { renderingStartIndex: ne, renderingEndIndex: pe, visibleStartIndex: h, visibleEndIndex: ae };
2433
- }, cr = (r, e, t) => {
2428
+ const oe = Pe(h - t, n), ce = Pe(Math.max(me - 1, h), n), he = Pe(ce + t, n);
2429
+ return { renderingStartIndex: oe, renderingEndIndex: he, visibleStartIndex: h, visibleEndIndex: ce };
2430
+ }, ur = (r, e, t) => {
2434
2431
  const n = Math.max(0, e ?? 0), i = g({ last: 0, id: null, arg: null }).current;
2435
- return X(
2432
+ return q(
2436
2433
  () => () => {
2437
2434
  if (i.id !== null && (cancelAnimationFrame(i.id), i.id = null), i.arg !== null && r.current) {
2438
2435
  try {
@@ -2444,13 +2441,13 @@ const jr = 1e4, ln = () => {
2444
2441
  }
2445
2442
  },
2446
2443
  [i, r, t]
2447
- ), v(
2444
+ ), S(
2448
2445
  (s) => {
2449
2446
  if (i.arg = s, i.id !== null) return;
2450
2447
  const a = (c) => {
2451
2448
  if (i.id = null, i.arg === null) return;
2452
- const p = c - i.last;
2453
- if (n === 0 || i.last === 0 || p >= n) {
2449
+ const f = c - i.last;
2450
+ if (n === 0 || i.last === 0 || f >= n) {
2454
2451
  if (r.current)
2455
2452
  try {
2456
2453
  t(r.current, i.arg);
@@ -2465,11 +2462,11 @@ const jr = 1e4, ln = () => {
2465
2462
  },
2466
2463
  [n, t, r, i]
2467
2464
  );
2468
- }, tn = br.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: p, registerItemRef: b }) => {
2469
- const I = v((z) => b(r, z), [r, b]), w = v((z) => c(z, r), [r, c]), C = v(() => p(r), [r, p]), h = v((z) => {
2465
+ }, tn = xr.memo(({ index: r, top: e, height: t, item: n, children: i, clipItemHeight: s, enableKeyboardNavigation: a, onKeyDown: c, onFocus: f, registerItemRef: b }) => {
2466
+ const I = S((z) => b(r, z), [r, b]), w = S((z) => c(z, r), [r, c]), V = S(() => f(r), [r, f]), h = S((z) => {
2470
2467
  z.currentTarget.focus({ preventScroll: !0 });
2471
2468
  }, []);
2472
- return /* @__PURE__ */ le(
2469
+ return /* @__PURE__ */ de(
2473
2470
  "div",
2474
2471
  {
2475
2472
  ref: I,
@@ -2484,7 +2481,7 @@ const jr = 1e4, ln = () => {
2484
2481
  tabIndex: a ? -1 : void 0,
2485
2482
  onPointerDown: a ? h : void 0,
2486
2483
  onKeyDownCapture: a ? w : void 0,
2487
- onFocusCapture: a ? C : void 0,
2484
+ onFocusCapture: a ? V : void 0,
2488
2485
  children: i(n, r)
2489
2486
  }
2490
2487
  );
@@ -2497,625 +2494,623 @@ const jr = 1e4, ln = () => {
2497
2494
  overscanCount: s = 15,
2498
2495
  className: a,
2499
2496
  testId: c,
2500
- onScroll: p,
2497
+ onScroll: f,
2501
2498
  onRangeChange: b,
2502
2499
  children: I,
2503
2500
  background: w,
2504
- initialScrollIndex: C,
2501
+ initialScrollIndex: V,
2505
2502
  initialScrollOffset: h,
2506
2503
  initialScrollAnchor: z,
2507
- callbackThrottleMs: J = 5,
2508
- contentInsets: B,
2509
- onItemFocus: de,
2510
- scrollBarOptions: fe,
2511
- behaviorOptions: ne,
2512
- onWheelHorizontal: ae,
2513
- horizontalKeyInputs: pe,
2514
- horizontalKeyStep: P = Zr,
2504
+ callbackThrottleMs: G = 5,
2505
+ contentInsets: H,
2506
+ onItemFocus: pe,
2507
+ scrollBarOptions: me,
2508
+ behaviorOptions: oe,
2509
+ onWheelHorizontal: ce,
2510
+ horizontalKeyInputs: he,
2511
+ horizontalKeyStep: P = Jr,
2515
2512
  contentProps: _
2516
2513
  }, M) => {
2517
- const { width: j, enableThumbDrag: te, enableTrackClick: G, enableArrowButtons: Y, enableScrollToTopBottomButtons: Z, renderThumbOverlay: S, tapScrollCircleOptions: $ } = fe ?? {}, { enablePointerDrag: Ve, pointerDragInputs: Qe, enableKeyboardNavigation: N = !0, wheelSpeedMultiplier: De, inertiaOptions: Ge, clipItemHeight: ye = !1, resetOnGetItemHeightChange: Ce = !1 } = ne ?? {}, [Ze, $e] = nt(0), H = i ?? Ze, Ae = v((o) => {
2518
- $e((u) => u === o ? u : o);
2519
- }, []), ie = g(null), he = g({
2514
+ const { width: Z, enableThumbDrag: Q, enableTrackClick: U, enableArrowButtons: Se, enableScrollToTopBottomButtons: C, renderThumbOverlay: v, tapScrollCircleOptions: W } = me ?? {}, { enablePointerDrag: ge, pointerDragInputs: qe, enableKeyboardNavigation: ee = !0, wheelSpeedMultiplier: X, inertiaOptions: Xe, overscrollBehavior: $e, clipItemHeight: ze = !1, resetOnGetItemHeightChange: Ce = !1 } = oe ?? {}, [je, Ge] = rt(0), K = i ?? je, Ae = S((o) => {
2515
+ Ge((u) => u === o ? u : o);
2516
+ }, []), ue = g(null), be = g({
2520
2517
  renderingStartIndex: 0,
2521
2518
  renderingEndIndex: 0,
2522
2519
  visibleStartIndex: 0,
2523
2520
  visibleEndIndex: 0,
2524
2521
  scrollPosition: 0,
2525
2522
  totalHeight: 0
2526
- }), Be = g(z && r > 0 ? { index: oe(Math.trunc(z.index), 0, r - 1), align: "top", offset: -Math.max(0, z.offsetPx ?? 0) } : null), Le = g(!1), dt = g(!0);
2527
- X(() => {
2528
- if (dt.current) {
2529
- dt.current = !1;
2523
+ }), Te = g(z && r > 0 ? { index: le(Math.trunc(z.index), 0, r - 1), align: "top", offset: -Math.max(0, z.offsetPx ?? 0) } : null), et = g(!1), mt = g(!0);
2524
+ q(() => {
2525
+ if (mt.current) {
2526
+ mt.current = !1;
2530
2527
  return;
2531
2528
  }
2532
- Ce && (Be.current = null);
2529
+ Ce && (Te.current = null);
2533
2530
  }, [Ce, n]);
2534
- const R = Ye(() => ar(B), [B]), [ft] = nt(() => {
2535
- const u = z?.index ?? C, m = typeof u == "number" && Number.isFinite(u) ? Math.max(0, Math.trunc(u)) : 0;
2531
+ const N = Fe(() => lr(H), [H]), [it] = rt(() => {
2532
+ const u = z?.index ?? V, m = typeof u == "number" && Number.isFinite(u) ? Math.max(0, Math.trunc(u)) : 0;
2536
2533
  return { from: Math.max(0, m - 50), to: m + 50 };
2537
- }), pt = Ye(
2534
+ }), vt = Fe(
2538
2535
  // 目的: Fenwick Tree のオプション設定
2539
2536
  // 依存関係: resetOnGetItemHeightChange, initialSampleRange (マウント時固定)
2540
2537
  // itemCount には依存させない (依存させると追記のたびに options 参照が変わり、計測済み高さが全消去される)。
2541
2538
  // この useMemo により sampleRange を毎レンダー新規生成しない = 参照同一性由来の破壊的 reset を防ぐ。
2542
2539
  () => ({
2543
- sampleRange: ft,
2540
+ sampleRange: it,
2544
2541
  resetOnValueFnChange: Ce,
2545
2542
  materialize: !0
2546
2543
  }),
2547
- [Ce, ft]
2548
- ), V = Wr(r, n, pt), [Q] = nt(() => {
2544
+ [Ce, it]
2545
+ ), E = Wr(r, n, vt), [J] = rt(() => {
2549
2546
  let o = 0, u = 0;
2550
2547
  if (z && r > 0) {
2551
- const m = oe(Math.trunc(z.index), 0, r - 1), A = Math.max(0, z.offsetPx ?? 0), L = oe(m - s * 2, 0, r - 1), O = oe(m + s * 2, 0, r - 1), F = m > 0 || A > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: L, to: O }] } } : void 0, { cumulative: re, total: Pe, currentValue: me } = V.prefixSum(m, F), ue = Math.max(re - me + A, 0);
2552
- o = wt(ue, R.top), u = Pe ?? V.getTotal();
2553
- } else if (typeof C == "number") {
2554
- const m = oe(C, 0, r - 1), A = oe(m - s * 2, 0, r - 1), L = oe(m + s * 2, 0, r - 1), O = C > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } } : void 0, { cumulative: F, total: re, currentValue: Pe } = V.prefixSum(C, O), me = Math.max(F - Pe, 0);
2555
- o = wt(me, R.top), u = re ?? V.getTotal();
2556
- } else typeof h == "number" && (o = wt(Math.max(h, 0), R.top)), u = V.getTotal();
2548
+ const m = le(Math.trunc(z.index), 0, r - 1), A = Math.max(0, z.offsetPx ?? 0), L = le(m - s * 2, 0, r - 1), O = le(m + s * 2, 0, r - 1), k = m > 0 || A > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: L, to: O }] } } : void 0, { cumulative: se, total: Ne, currentValue: Ie } = E.prefixSum(m, k), fe = Math.max(se - Ie + A, 0);
2549
+ o = Pt(fe, N.top), u = Ne ?? E.getTotal();
2550
+ } else if (typeof V == "number") {
2551
+ const m = le(V, 0, r - 1), A = le(m - s * 2, 0, r - 1), L = le(m + s * 2, 0, r - 1), O = V > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } } : void 0, { cumulative: k, total: se, currentValue: Ne } = E.prefixSum(V, O), Ie = Math.max(k - Ne, 0);
2552
+ o = Pt(Ie, N.top), u = se ?? E.getTotal();
2553
+ } else typeof h == "number" && (o = Pt(Math.max(h, 0), N.top)), u = E.getTotal();
2557
2554
  return { position: o, total: u };
2558
- }), [We, gt] = nt(Q.position), [He, et] = nt(Q.total), ce = g(Q.position), d = g(R.top), W = g(p ?? void 0), U = g(b ?? void 0), k = g(ae), q = (pe?.length ?? 0) > 0, Ie = !!ae;
2559
- X(() => {
2560
- q && (N || T.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), Ie || T.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(P) && P > 0 || T.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
2561
- }, [q, Ie, N, P]);
2562
- const Re = g(/* @__PURE__ */ new Map()), ee = g(null), Oe = g(null), [ge, ze] = nt(null), [Ue, Te] = nt(!1), be = g(null), Me = g(!1), Ee = g(0), tt = g(!1), rt = g(!1), st = g(r);
2563
- st.current !== r && (st.current = r, rt.current = !0), it(() => {
2564
- W.current = p ?? void 0, U.current = b ?? void 0, k.current = ae;
2565
- }, [b, p, ae]);
2566
- const f = v(
2555
+ }), [Ze, ht] = rt(J.position), [Le, st] = rt(J.total), ie = g(J.position), p = g(N.top), F = g(f ?? void 0), B = g(b ?? void 0), Y = g(ce), te = (he?.length ?? 0) > 0, Me = !!ce;
2556
+ q(() => {
2557
+ te && (ee || T.warn("[VirtualScroll] horizontalKeyInputs is set but behaviorOptions.enableKeyboardNavigation is false; horizontal keyboard scrolling is disabled because the row key handler is not mounted."), Me || T.warn("[VirtualScroll] horizontalKeyInputs is set but onWheelHorizontal is missing; horizontal keyboard scrolling is disabled because the package does not own the horizontal axis."), Number.isFinite(P) && P > 0 || T.warn(`[VirtualScroll] horizontalKeyStep must be a finite positive number, received ${P}. Horizontal arrow keys are left untouched.`));
2558
+ }, [te, Me, ee, P]);
2559
+ const j = g(/* @__PURE__ */ new Map()), re = g(null), De = g(null), [ne, Je] = rt(null), [Oe, ae] = rt(!1), ve = g(null), Ue = g(!1), Ve = g(0), ft = g(!1), Qe = g(!1), ot = g(r);
2560
+ ot.current !== r && (ot.current = r, Qe.current = !0), nt(() => {
2561
+ F.current = f ?? void 0, B.current = b ?? void 0, Y.current = ce;
2562
+ }, [b, f, ce]);
2563
+ const d = S(
2567
2564
  (o) => {
2568
- if (N && o && typeof o.focus == "function")
2565
+ if (ee && o && typeof o.focus == "function")
2569
2566
  try {
2570
2567
  o.focus({ preventScroll: !0 });
2571
2568
  } catch {
2572
2569
  o.focus();
2573
2570
  }
2574
2571
  },
2575
- [N]
2576
- ), E = v((o, { position: u, totalHeight: m }) => {
2572
+ [ee]
2573
+ ), y = S((o, { position: u, totalHeight: m }) => {
2577
2574
  o(u, m);
2578
- }, []), Se = cr(W, J, E), _e = v((o, u) => {
2575
+ }, []), xe = ur(F, G, y), tt = S((o, u) => {
2579
2576
  o(u);
2580
- }, []), ke = cr(U, J, _e), ot = g(R.top);
2581
- ot.current = R.top;
2582
- const lt = g(Se);
2583
- lt.current = Se, X(() => (Le.current = !1, () => {
2584
- Le.current = !0, be.current && (clearTimeout(be.current), be.current = null);
2585
- }), []), X(() => {
2586
- N || (Re.current.clear(), ee.current = null, Oe.current = null);
2587
- }, [N]);
2588
- const mt = v(
2577
+ }, []), _e = ur(B, G, tt), ct = g(N.top);
2578
+ ct.current = N.top;
2579
+ const ut = g(xe);
2580
+ ut.current = xe, q(() => (et.current = !1, () => {
2581
+ et.current = !0, ve.current && (clearTimeout(ve.current), ve.current = null);
2582
+ }), []), q(() => {
2583
+ ee || (j.current.clear(), re.current = null, De.current = null);
2584
+ }, [ee]);
2585
+ const at = S(
2589
2586
  (o, u) => {
2590
2587
  if (!u) {
2591
- Re.current.delete(o);
2588
+ j.current.delete(o);
2592
2589
  return;
2593
2590
  }
2594
- N && (Re.current.set(o, u), ee.current === o && (ee.current = null, Oe.current = o, f(u)));
2591
+ ee && (j.current.set(o, u), re.current === o && (re.current = null, De.current = o, d(u)));
2595
2592
  },
2596
- [N, f]
2597
- ), ct = 0.01, ht = g({
2593
+ [ee, d]
2594
+ ), gt = 0.01, pt = g({
2598
2595
  rafId: null,
2599
2596
  loopActive: !1,
2600
2597
  idleFrames: 0,
2601
- lastRenderedPosition: Q.position
2602
- }), Mt = v(() => {
2603
- const o = ht.current;
2598
+ lastRenderedPosition: J.position
2599
+ }), yt = S(() => {
2600
+ const o = pt.current;
2604
2601
  o.rafId !== null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(o.rafId), o.rafId = null, o.loopActive = !1, o.idleFrames = 0;
2605
2602
  }, []);
2606
- X(
2603
+ q(
2607
2604
  () => () => {
2608
- Mt();
2605
+ yt();
2609
2606
  },
2610
- [Mt]
2607
+ [yt]
2611
2608
  );
2612
- const Dt = g(() => {
2613
- }), bt = v(() => {
2614
- const o = ht.current;
2609
+ const wt = g(() => {
2610
+ }), Nt = S(() => {
2611
+ const o = pt.current;
2615
2612
  o.rafId = null;
2616
- const u = ce.current, m = je(u, ot.current), A = V.getTotal();
2617
- if (gt((O) => Math.abs(O - u) < ct ? O : u), Math.abs(o.lastRenderedPosition - u) >= ct ? (lt.current({ position: m, totalHeight: A }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2618
- Mt();
2613
+ const u = ie.current, m = Ke(u, ct.current), A = E.getTotal();
2614
+ if (ht((O) => Math.abs(O - u) < gt ? O : u), Math.abs(o.lastRenderedPosition - u) >= gt ? (ut.current({ position: m, totalHeight: A }), o.lastRenderedPosition = u, o.idleFrames = 0) : o.idleFrames += 1, o.idleFrames >= 2) {
2615
+ yt();
2619
2616
  return;
2620
2617
  }
2621
2618
  if (typeof requestAnimationFrame == "function") {
2622
- o.rafId = requestAnimationFrame((O) => Dt.current(O));
2619
+ o.rafId = requestAnimationFrame((O) => wt.current(O));
2623
2620
  return;
2624
2621
  }
2625
2622
  o.loopActive = !1;
2626
- }, [V, Mt]);
2627
- Dt.current = bt;
2628
- const At = v(() => {
2629
- const o = ht.current;
2623
+ }, [E, yt]);
2624
+ wt.current = Nt;
2625
+ const At = S(() => {
2626
+ const o = pt.current;
2630
2627
  if (o.idleFrames = 0, !o.loopActive) {
2631
2628
  if (o.loopActive = !0, typeof requestAnimationFrame == "function") {
2632
- o.rafId = requestAnimationFrame(bt);
2629
+ o.rafId = requestAnimationFrame(Nt);
2633
2630
  return;
2634
2631
  }
2635
2632
  o.loopActive = !1;
2636
2633
  }
2637
- }, [bt]), xe = v(
2634
+ }, [Nt]), we = S(
2638
2635
  (o, u) => {
2639
- const m = u?.immediate ?? !1, A = je(o, R.top);
2640
- if (ce.current = o, m) {
2641
- ht.current.lastRenderedPosition = o, ht.current.idleFrames = 0, gt(o), Se({ position: A, totalHeight: V.getTotal() });
2636
+ const m = u?.immediate ?? !1, A = Ke(o, N.top);
2637
+ if (ie.current = o, m) {
2638
+ pt.current.lastRenderedPosition = o, pt.current.idleFrames = 0, ht(o), xe({ position: A, totalHeight: E.getTotal() });
2642
2639
  return;
2643
2640
  }
2644
2641
  At();
2645
2642
  },
2646
- [At, V, R.top, Se]
2647
- ), xt = v((o, u = 0) => {
2648
- const m = ie.current;
2643
+ [At, E, N.top, xe]
2644
+ ), bt = S((o, u = 0) => {
2645
+ const m = ue.current;
2649
2646
  if (!m)
2650
2647
  return o;
2651
2648
  const A = m.getScrollPosition();
2652
- Ee.current += 1;
2653
- const L = m.getContentSize() + u, O = m.getViewportSize(), F = m.scrollTo(o, { contentSize: L, viewportSize: O });
2654
- return F === A && (Ee.current = Math.max(0, Ee.current - 1)), Math.abs(F - o) > 0.5 && (tt.current = !0), F;
2649
+ Ve.current += 1;
2650
+ const L = m.getContentSize() + u, O = m.getViewportSize(), k = m.scrollTo(o, { contentSize: L, viewportSize: O });
2651
+ return k === A && (Ve.current = Math.max(0, Ve.current - 1)), Math.abs(k - o) > 0.5 && (ft.current = !0), k;
2655
2652
  }, []), Lt = g(!1);
2656
- X(() => {
2653
+ q(() => {
2657
2654
  if (!Lt.current)
2658
- if (Lt.current = !0, z == null && typeof C != "number" && typeof h == "number") {
2659
- const o = wt(Math.max(h, 0), R.top), u = Math.abs(o - ce.current) > 0.5;
2660
- xe(o, { immediate: !0 }), u && ie.current?.scrollTo(o);
2655
+ if (Lt.current = !0, z == null && typeof V != "number" && typeof h == "number") {
2656
+ const o = Pt(Math.max(h, 0), N.top), u = Math.abs(o - ie.current) > 0.5;
2657
+ we(o, { immediate: !0 }), u && ue.current?.scrollTo(o);
2661
2658
  } else
2662
- xe(ce.current, { immediate: !0 });
2663
- }, [z, C, h, R.top, xe]), X(() => {
2664
- const o = V.getTotal();
2665
- if (He !== o) {
2666
- et(o);
2659
+ we(ie.current, { immediate: !0 });
2660
+ }, [z, V, h, N.top, we]), q(() => {
2661
+ const o = E.getTotal();
2662
+ if (Le !== o) {
2663
+ st(o);
2667
2664
  return;
2668
2665
  }
2669
- if (tt.current) {
2670
- tt.current = !1;
2671
- const u = ie.current;
2672
- if (u && Math.abs(u.getScrollPosition() - ce.current) > 0.5) {
2673
- const m = xt(ce.current);
2674
- tt.current = !1, xe(m, { immediate: !0 });
2666
+ if (ft.current) {
2667
+ ft.current = !1;
2668
+ const u = ue.current;
2669
+ if (u && Math.abs(u.getScrollPosition() - ie.current) > 0.5) {
2670
+ const m = bt(ie.current);
2671
+ ft.current = !1, we(m, { immediate: !0 });
2675
2672
  }
2676
2673
  }
2677
- }, [V, He, r, xt, xe]), X(() => {
2678
- if (Be.current !== null) {
2679
- const { index: o, align: u, offset: m } = Be.current, A = we(o, r), { cumulative: L, currentValue: O } = V.prefixSum(A, { materializeOption: { materialize: !1 } });
2674
+ }, [E, Le, r, bt, we]), q(() => {
2675
+ if (Te.current !== null) {
2676
+ const { index: o, align: u, offset: m } = Te.current, A = Pe(o, r), { cumulative: L, currentValue: O } = E.prefixSum(A, { materializeOption: { materialize: !1 } });
2680
2677
  if (L !== void 0 && O !== void 0) {
2681
- const F = Math.max(L - O, 0);
2682
- let re = F;
2683
- u === "bottom" ? re = L - H : u === "center" && (re = F + O / 2 - H / 2), m && (re -= m), re = Math.max(0, re);
2684
- const Pe = Math.max(0, He + R.top + R.bottom - H), me = Math.min(wt(re, R.top), Pe);
2685
- Math.abs(me - ce.current) > 1 && (T.debug("[VirtualScroll] Drift correction", {
2686
- from: ce.current,
2687
- to: me,
2678
+ const k = Math.max(L - O, 0);
2679
+ let se = k;
2680
+ u === "bottom" ? se = L - K : u === "center" && (se = k + O / 2 - K / 2), m && (se -= m), se = Math.max(0, se);
2681
+ const Ne = Math.max(0, Le + N.top + N.bottom - K), Ie = Math.min(Pt(se, N.top), Ne);
2682
+ Math.abs(Ie - ie.current) > 1 && (T.debug("[VirtualScroll] Drift correction", {
2683
+ from: ie.current,
2684
+ to: Ie,
2688
2685
  targetIndex: A
2689
- }), Ee.current === 0 && (Ee.current += 1), ie.current?.scrollTo(me), xe(me, { immediate: !0 }));
2686
+ }), Ve.current === 0 && (Ve.current += 1), ue.current?.scrollTo(Ie), we(Ie, { immediate: !0 }));
2690
2687
  }
2691
2688
  }
2692
- rt.current = !1;
2693
- }, [He, V, r, R.top, xe, H, R.bottom]), X(() => {
2694
- const o = d.current;
2695
- if (o === R.top || (d.current = R.top, Be.current))
2689
+ Qe.current = !1;
2690
+ }, [Le, E, r, N.top, we, K, N.bottom]), q(() => {
2691
+ const o = p.current;
2692
+ if (o === N.top || (p.current = N.top, Te.current))
2696
2693
  return;
2697
- const u = je(ce.current, o), m = wt(u, R.top);
2698
- ce.current = m, ie.current?.scrollTo(m), xe(m, { immediate: !0 });
2699
- }, [R.top, xe]);
2700
- const Ot = v(
2694
+ const u = Ke(ie.current, o), m = Pt(u, N.top);
2695
+ ie.current = m, ue.current?.scrollTo(m), we(m, { immediate: !0 });
2696
+ }, [N.top, we]);
2697
+ const Ot = S(
2701
2698
  (o, u) => {
2702
2699
  if (r === 0)
2703
2700
  return;
2704
- const m = we(o, r), A = V.get(m), L = u - A, O = V.update(m, u);
2705
- O !== void 0 && et(O), T.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: O });
2706
- let F = Be.current ? Be.current.index : null;
2707
- if (F === null) {
2708
- const re = ce.current, Pe = ar(B).top, me = je(re, Pe), { index: ue, cumulative: qe } = V.findIndexAtOrAfter(me, { materializeOption: { materialize: !1 } });
2709
- F = qe !== void 0 && qe === me ? ue + 1 : ue;
2701
+ const m = Pe(o, r), A = E.get(m), L = u - A, O = E.update(m, u);
2702
+ O !== void 0 && st(O), T.debug("[VirtualScroll] Updated item size manually", { index: m, size: u, total: O });
2703
+ let k = Te.current ? Te.current.index : null;
2704
+ if (k === null) {
2705
+ const se = ie.current, Ne = lr(H).top, Ie = Ke(se, Ne), { index: fe, cumulative: Be } = E.findIndexAtOrAfter(Ie, { materializeOption: { materialize: !1 } });
2706
+ k = Be !== void 0 && Be === Ie ? fe + 1 : fe;
2710
2707
  }
2711
- if (F !== -1 && m < F && L !== 0) {
2712
- const re = ce.current, Pe = re + L;
2713
- xt(Pe, L), xe(Pe, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: re, to: Pe, causedByIndex: m, delta: L, activeVisibleStartIndex: F });
2708
+ if (k !== -1 && m < k && L !== 0) {
2709
+ const se = ie.current, Ne = se + L;
2710
+ bt(Ne, L), we(Ne, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (manual update)", { from: se, to: Ne, causedByIndex: m, delta: L, activeVisibleStartIndex: k });
2714
2711
  }
2715
2712
  },
2716
- [V, r, xt, xe, B]
2717
- ), Je = v(
2713
+ [E, r, bt, we, H]
2714
+ ), We = S(
2718
2715
  (o, u) => {
2719
- if (!ie.current || r === 0)
2716
+ if (!ue.current || r === 0)
2720
2717
  return;
2721
- const m = we(o, r), A = we(m - s * 2, r), L = we(m + s * 2, r), { cumulative: O, total: F, currentValue: re } = V.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } });
2722
- if (T.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", O, "Total height:", F, "ItemHeight:", re, "safeIndexFrom:", A, "safeIndexTo:", L), !F)
2718
+ const m = Pe(o, r), A = Pe(m - s * 2, r), L = Pe(m + s * 2, r), { cumulative: O, total: k, currentValue: se } = E.prefixSum(m, { materializeOption: { materialize: !0, ranges: [{ from: A, to: L }] } });
2719
+ if (T.debug("[VirtualScroll] Scrolling to index:", m, "ItemBottom:", O, "Total height:", k, "ItemHeight:", se, "safeIndexFrom:", A, "safeIndexTo:", L), !k)
2723
2720
  return;
2724
- const Pe = Math.max(O - re, 0);
2725
- let me = Pe;
2726
- u?.align === "bottom" ? me = O - H : u?.align === "center" && (me = Pe + re / 2 - H / 2), u?.offset && (me -= u.offset), me = Math.max(0, me);
2727
- const ue = wt(me, R.top), qe = ie.current?.getContentSize() ?? F + R.top + R.bottom, Fe = Math.max(0, qe - H), Xe = Math.min(ue, Fe);
2728
- Be.current = {
2721
+ const Ne = Math.max(O - se, 0);
2722
+ let Ie = Ne;
2723
+ u?.align === "bottom" ? Ie = O - K : u?.align === "center" && (Ie = Ne + se / 2 - K / 2), u?.offset && (Ie -= u.offset), Ie = Math.max(0, Ie);
2724
+ const fe = Pt(Ie, N.top), Be = ue.current?.getContentSize() ?? k + N.top + N.bottom, ke = Math.max(0, Be - K), He = Math.min(fe, ke);
2725
+ Te.current = {
2729
2726
  index: m,
2730
2727
  align: u?.align,
2731
2728
  offset: u?.offset
2732
2729
  };
2733
- const Vt = ie.current?.getScrollPosition() ?? -1, qt = Math.abs(Vt - Xe) > 0.5;
2734
- Me.current = !1, Ee.current = 0, qt && (Me.current = !0, Ee.current += 1, ie.current?.scrollTo(Xe)), et(F), xe(Xe, { immediate: !0 }), T.debug("[VirtualScroll] Setting scroll position to:", Xe, { original: ue, max: Fe });
2730
+ const zt = ue.current?.getScrollPosition() ?? -1, Xt = Math.abs(zt - He) > 0.5;
2731
+ Ue.current = !1, Ve.current = 0, Xt && (Ue.current = !0, Ve.current += 1, ue.current?.scrollTo(He)), st(k), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Setting scroll position to:", He, { original: fe, max: ke });
2735
2732
  },
2736
- [V, s, r, R.top, R.bottom, H, xe]
2737
- ), Et = g(z && r === 0 ? z : null);
2738
- X(() => {
2739
- const o = Et.current;
2740
- !o || r === 0 || (Et.current = null, Je(oe(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
2741
- }, [r, Je]);
2742
- const Nt = v(
2733
+ [E, s, r, N.top, N.bottom, K, we]
2734
+ ), Vt = g(z && r === 0 ? z : null);
2735
+ q(() => {
2736
+ const o = Vt.current;
2737
+ !o || r === 0 || (Vt.current = null, We(le(Math.trunc(o.index), 0, r - 1), { align: "top", offset: -Math.max(0, o.offsetPx ?? 0) }));
2738
+ }, [r, We]);
2739
+ const l = S(
2743
2740
  (o) => {
2744
- if (!ie.current || r === 0)
2741
+ if (!ue.current || r === 0)
2745
2742
  return;
2746
- const u = V.getTotal(), m = oe(Math.floor(o), 0, u), { index: A, cumulative: L, currentValue: O } = V.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), re = (L ?? 0) - (O ?? 0) - m;
2747
- Je(A, { offset: re });
2743
+ const u = E.getTotal(), m = le(Math.floor(o), 0, u), { index: A, cumulative: L, currentValue: O } = E.findIndexAtOrAfter(m, { materializeOption: { materialize: !1 } }), se = (L ?? 0) - (O ?? 0) - m;
2744
+ We(A, { offset: se });
2748
2745
  },
2749
- [V, r, Je]
2750
- ), l = v(() => {
2746
+ [E, r, We]
2747
+ ), x = S(() => {
2751
2748
  if (r === 0)
2752
2749
  return null;
2753
- const o = je(ce.current, R.top), { index: u, cumulative: m, currentValue: A } = V.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
2750
+ const o = Ke(ie.current, N.top), { index: u, cumulative: m, currentValue: A } = E.findIndexAtOrAfter(o, { materializeOption: { materialize: !1 } });
2754
2751
  if (u === -1)
2755
2752
  return { index: r - 1, offsetPx: 0 };
2756
2753
  if (m === o)
2757
- return { index: oe(u + 1, 0, r - 1), offsetPx: 0 };
2754
+ return { index: le(u + 1, 0, r - 1), offsetPx: 0 };
2758
2755
  const L = (m ?? 0) - (A ?? 0);
2759
2756
  return { index: u, offsetPx: Math.max(0, o - L) };
2760
- }, [V, r, R.top]), x = v(
2757
+ }, [E, r, N.top]), R = S(
2761
2758
  (o) => {
2762
- const u = je(ce.current, R.top), m = typeof o == "function" ? o(u) : o;
2763
- Nt(m);
2764
- const A = ie.current?.getScrollPosition(), L = typeof A == "number" ? A : ce.current;
2765
- return xe(L), je(L, ot.current);
2759
+ const u = Ke(ie.current, N.top), m = typeof o == "function" ? o(u) : o;
2760
+ l(m);
2761
+ const A = ue.current?.getScrollPosition(), L = typeof A == "number" ? A : ie.current;
2762
+ return we(L), Ke(L, ct.current);
2766
2763
  },
2767
- [R.top, Nt, xe]
2768
- ), y = v((o) => {
2769
- const u = ie.current;
2764
+ [N.top, l, we]
2765
+ ), D = S((o) => {
2766
+ const u = ue.current;
2770
2767
  if (!u)
2771
- return je(ce.current, ot.current);
2768
+ return Ke(ie.current, ct.current);
2772
2769
  const m = u.scrollTo((A) => A + o);
2773
- return je(m, ot.current);
2774
- }, []), D = v((o) => ie.current?.applyWheel(o) ?? !1, []), K = v(
2770
+ return Ke(m, ct.current);
2771
+ }, []), $ = S((o) => ue.current?.applyWheel(o) ?? !1, []), ye = S(
2775
2772
  (o, u) => {
2776
2773
  T.debug("[VirtualScroll] Scroll position changed:", o);
2777
- const m = Me.current;
2778
- m && (Me.current = !1);
2779
- const A = Ee.current > 0;
2780
- A && (Ee.current = 0);
2781
- const L = rt.current && st.current === r;
2782
- if (m || A || L || (Be.current = null), xe(o), Z) {
2774
+ const m = Ue.current;
2775
+ m && (Ue.current = !1);
2776
+ const A = Ve.current > 0;
2777
+ A && (Ve.current = 0);
2778
+ const L = Qe.current && ot.current === r;
2779
+ if (m || A || L || (Te.current = null), we(o), C) {
2783
2780
  if (m || A)
2784
2781
  return;
2785
2782
  const O = o - u;
2786
2783
  if (T.debug("[VirtualScroll] Scroll diff:", O, "New:", o, "Prev:", u), Math.abs(O) > 1) {
2787
- const F = O > 0 ? "down" : "up";
2788
- ze(F), Te(!0), T.debug("[VirtualScroll] Showing scroll buttons. Direction:", F), be.current && clearTimeout(be.current), be.current = setTimeout(() => {
2789
- Te(!1), T.debug("[VirtualScroll] Hiding scroll buttons");
2784
+ const k = O > 0 ? "down" : "up";
2785
+ Je(k), ae(!0), T.debug("[VirtualScroll] Showing scroll buttons. Direction:", k), ve.current && clearTimeout(ve.current), ve.current = setTimeout(() => {
2786
+ ae(!1), T.debug("[VirtualScroll] Hiding scroll buttons");
2790
2787
  }, 2e3);
2791
2788
  }
2792
2789
  }
2793
2790
  },
2794
- [xe, Z, r]
2795
- ), se = Ye(() => je(We, R.top), [R.top, We]), Ne = Ye(() => {
2796
- const o = V.getTotal(), u = en(se, H, s, r, n, V, o);
2791
+ [we, C, r]
2792
+ ), Re = Fe(() => Ke(Ze, N.top), [N.top, Ze]), Ee = Fe(() => {
2793
+ const o = E.getTotal(), u = en(Re, K, s, r, n, E, o);
2797
2794
  return T.debug("[VirtualScroll] Calculated rendering range:", () => ({
2798
2795
  ...u,
2799
- scrollPosition: se,
2796
+ scrollPosition: Re,
2800
2797
  renderingContentSize: o,
2801
2798
  overscanCount: s,
2802
- viewportSize: H
2799
+ viewportSize: K
2803
2800
  })), u;
2804
- }, [se, H, s, r, n, V]), { renderingStartIndex: ve, renderingEndIndex: at, visibleStartIndex: Ke, visibleEndIndex: Pt } = Ne, vt = v(
2801
+ }, [Re, K, s, r, n, E]), { renderingStartIndex: lt, renderingEndIndex: Ye, visibleStartIndex: xt, visibleEndIndex: _t } = Ee, Tt = S(
2805
2802
  (o, u) => {
2806
- if (!N || r === 0)
2803
+ if (!ee || r === 0)
2807
2804
  return;
2808
- const m = we(o, r);
2805
+ const m = Pe(o, r);
2809
2806
  if (!(u?.ensureVisible ?? !0)) {
2810
- const Fe = Re.current.get(m);
2811
- Fe && (ee.current = null, Oe.current = m, f(Fe));
2807
+ const ke = j.current.get(m);
2808
+ ke && (re.current = null, De.current = m, d(ke));
2812
2809
  return;
2813
2810
  }
2814
- const L = V.prefixSum(m, { materializeOption: { materialize: !1 } }), O = L.currentValue, F = Math.max(L.cumulative - O, 0), re = F + O, Pe = je(ce.current, R.top), me = Pe + H;
2815
- if (F < Pe || re > me) {
2816
- Je(m);
2817
- const Fe = Re.current.get(m);
2818
- Fe ? (ee.current = null, Oe.current = m, f(Fe)) : ee.current = m;
2811
+ const L = E.prefixSum(m, { materializeOption: { materialize: !1 } }), O = L.currentValue, k = Math.max(L.cumulative - O, 0), se = k + O, Ne = Ke(ie.current, N.top), Ie = Ne + K;
2812
+ if (k < Ne || se > Ie) {
2813
+ We(m);
2814
+ const ke = j.current.get(m);
2815
+ ke ? (re.current = null, De.current = m, d(ke)) : re.current = m;
2819
2816
  return;
2820
2817
  }
2821
- const qe = Re.current.get(m);
2822
- if (qe) {
2823
- ee.current = null, Oe.current = m, f(qe);
2818
+ const Be = j.current.get(m);
2819
+ if (Be) {
2820
+ re.current = null, De.current = m, d(Be);
2824
2821
  return;
2825
2822
  }
2826
- ee.current = m;
2823
+ re.current = m;
2827
2824
  },
2828
- [N, r, V, R.top, Je, f, H]
2829
- ), Jt = v(
2825
+ [ee, r, E, N.top, We, d, K]
2826
+ ), Qt = S(
2830
2827
  (o, u) => {
2831
- if (!(!N || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
2828
+ if (!(!ee || o.defaultPrevented) && !(o.altKey || o.metaKey || o.ctrlKey) && o.target === o.currentTarget && !o.currentTarget.isContentEditable) {
2832
2829
  if (o.key === "ArrowLeft" || o.key === "ArrowRight") {
2833
- const m = k.current;
2834
- if (!m)
2835
- return;
2836
- const A = o.shiftKey ? "shift-arrow" : "arrow";
2837
- if (!pe?.includes(A) || o.shiftKey && Jr(o.currentTarget) || !(Number.isFinite(P) && P > 0))
2830
+ const m = Y.current;
2831
+ if (!m || o.shiftKey || !he?.includes("arrow") || !(Number.isFinite(P) && P > 0))
2838
2832
  return;
2839
2833
  o.preventDefault(), m(o.key === "ArrowLeft" ? -P : P);
2840
2834
  return;
2841
2835
  }
2842
2836
  if (o.key === "ArrowDown") {
2843
- u < r - 1 && (o.preventDefault(), vt(u + 1));
2837
+ u < r - 1 && (o.preventDefault(), Tt(u + 1));
2844
2838
  return;
2845
2839
  }
2846
2840
  if (o.key === "ArrowUp") {
2847
- u > 0 && (o.preventDefault(), vt(u - 1));
2841
+ u > 0 && (o.preventDefault(), Tt(u - 1));
2848
2842
  return;
2849
2843
  }
2850
2844
  if (o.key === "PageDown") {
2851
2845
  if (u < r - 1) {
2852
2846
  o.preventDefault();
2853
- const { visibleStartIndex: m, visibleEndIndex: A } = he.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), F = we(Math.min(u + O, r - 1), r);
2854
- vt(F);
2847
+ const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(Math.min(u + O, r - 1), r);
2848
+ Tt(k);
2855
2849
  }
2856
2850
  return;
2857
2851
  }
2858
2852
  if (o.key === "PageUp" && u > 0) {
2859
2853
  o.preventDefault();
2860
- const { visibleStartIndex: m, visibleEndIndex: A } = he.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), F = we(u - O, r);
2861
- vt(F);
2854
+ const { visibleStartIndex: m, visibleEndIndex: A } = be.current, L = Math.max(A - m + 1, 1), O = Math.max(L, 1), k = Pe(u - O, r);
2855
+ Tt(k);
2862
2856
  }
2863
2857
  }
2864
2858
  },
2865
- [N, r, vt, pe, P]
2866
- ), Qt = v(
2859
+ [ee, r, Tt, he, P]
2860
+ ), er = S(
2867
2861
  (o) => {
2868
- if (!N)
2862
+ if (!ee)
2869
2863
  return;
2870
- const u = we(o, r);
2871
- ee.current = null, Oe.current = u, de?.(u);
2864
+ const u = Pe(o, r);
2865
+ re.current = null, De.current = u, pe?.(u);
2872
2866
  },
2873
- [N, r, de]
2867
+ [ee, r, pe]
2874
2868
  );
2875
- X(() => {
2876
- const o = ie.current?.getScrollPosition() ?? 0, u = ce.current, m = je(u, R.top);
2869
+ q(() => {
2870
+ const o = ue.current?.getScrollPosition() ?? 0, u = ie.current, m = Ke(u, N.top);
2877
2871
  T.debug("[VirtualScroll] Range change effect triggered", () => ({
2878
- renderingStartIndex: ve,
2879
- renderingEndIndex: at,
2880
- visibleStartIndex: Ke,
2881
- visibleEndIndex: Pt,
2882
- scrollPositionState: We,
2872
+ renderingStartIndex: lt,
2873
+ renderingEndIndex: Ye,
2874
+ visibleStartIndex: xt,
2875
+ visibleEndIndex: _t,
2876
+ scrollPositionState: Ze,
2883
2877
  paneScrollPosition: u,
2884
2878
  logicalScrollPosition: m,
2885
- contentSize: He,
2879
+ contentSize: Le,
2886
2880
  scrollPaneScrollPosition: o
2887
- })), ke({
2888
- renderingStartIndex: ve,
2889
- renderingEndIndex: at,
2890
- visibleStartIndex: Ke,
2891
- visibleEndIndex: Pt,
2881
+ })), _e({
2882
+ renderingStartIndex: lt,
2883
+ renderingEndIndex: Ye,
2884
+ visibleStartIndex: xt,
2885
+ visibleEndIndex: _t,
2892
2886
  scrollPosition: m,
2893
- totalHeight: He
2887
+ totalHeight: Le
2894
2888
  });
2895
- }, [He, at, ve, R.top, ke, We, Pt, Ke]);
2896
- const mr = v(() => {
2897
- if (!Z)
2889
+ }, [Le, Ye, lt, N.top, _e, Ze, _t, xt]);
2890
+ const hr = S(() => {
2891
+ if (!C)
2898
2892
  return null;
2899
- const o = Ue && ge !== null;
2900
- return /* @__PURE__ */ le("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: ge === "up" ? /* @__PURE__ */ le("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ le(
2893
+ const o = Oe && ne !== null;
2894
+ return /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-overlay", "data-visible": o, inert: !o, children: ne === "up" ? /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-top", children: /* @__PURE__ */ de(
2901
2895
  "button",
2902
2896
  {
2903
2897
  type: "button",
2904
2898
  className: "aqvs-scroll-to-edge-button",
2905
2899
  tabIndex: o ? 0 : -1,
2906
2900
  onClick: (m) => {
2907
- m.stopPropagation(), Me.current = !0, Je(0), Te(!1);
2901
+ m.stopPropagation(), Ue.current = !0, We(0), ae(!1);
2908
2902
  },
2909
2903
  children: "Top"
2910
2904
  }
2911
- ) }) : /* @__PURE__ */ le("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ le(
2905
+ ) }) : /* @__PURE__ */ de("div", { className: "aqvs-scroll-to-edge-button-container aqvs-scroll-to-edge-button-container-bottom", children: /* @__PURE__ */ de(
2912
2906
  "button",
2913
2907
  {
2914
2908
  type: "button",
2915
2909
  className: "aqvs-scroll-to-edge-button",
2916
2910
  tabIndex: o ? 0 : -1,
2917
2911
  onClick: (m) => {
2918
- m.stopPropagation(), Me.current = !0, Je(r - 1), Te(!1);
2912
+ m.stopPropagation(), Ue.current = !0, We(r - 1), ae(!1);
2919
2913
  },
2920
2914
  children: "Bottom"
2921
2915
  }
2922
2916
  ) }) });
2923
- }, [Z, Ue, ge, Je, r]), Yt = g(0), { visibleItems: Bt, renderAnchor: Ht } = Ye(() => {
2917
+ }, [C, Oe, ne, We, r]), Bt = g(0), { visibleItems: Ht, renderAnchor: qt } = Fe(() => {
2924
2918
  if (r === 0)
2925
2919
  return {
2926
- visibleItems: /* @__PURE__ */ le("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ le("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2920
+ visibleItems: /* @__PURE__ */ de("div", { className: "aqvs-no-items-container", children: /* @__PURE__ */ de("div", { className: "aqvs-no-items-text", children: "No items" }) }),
2927
2921
  renderAnchor: 0
2928
2922
  };
2929
- const o = we(ve, r), u = we(at, r), { cumulative: m, currentValue: A } = V.prefixSum(o, { materializeOption: { materialize: !1 } }), L = m - A;
2930
- Number.isFinite(L) && Math.abs(L - Yt.current) > Gr && (Yt.current = L);
2931
- const O = Yt.current, F = [], re = [];
2932
- let Pe = 0, me = L;
2933
- for (let ue = o; ue <= u; ue++) {
2934
- if (re.length >= lr) {
2935
- T.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: lr, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
2923
+ const o = Pe(lt, r), u = Pe(Ye, r), { cumulative: m, currentValue: A } = E.prefixSum(o, { materializeOption: { materialize: !1 } }), L = m - A;
2924
+ Number.isFinite(L) && Math.abs(L - Bt.current) > Zr && (Bt.current = L);
2925
+ const O = Bt.current, k = [], se = [];
2926
+ let Ne = 0, Ie = L;
2927
+ for (let fe = o; fe <= u; fe++) {
2928
+ if (se.length >= cr) {
2929
+ T.warn("[VirtualScroll] Rendered item count reached the safety cap; truncating render window.", { cap: cr, safeRenderingStartIndex: o, safeRenderingEndIndex: u });
2936
2930
  break;
2937
2931
  }
2938
- const qe = n(ue), Fe = V.get(ue), Xe = qe - Fe;
2939
- Xe !== 0 && F.push({ index: ue, value: qe });
2940
- const Vt = me + Pe, qt = t ? t(ue) : ue;
2941
- re.push(
2942
- /* @__PURE__ */ le(
2932
+ const Be = n(fe), ke = E.get(fe), He = Be - ke;
2933
+ He !== 0 && k.push({ index: fe, value: Be });
2934
+ const zt = Ie + Ne, Xt = t ? t(fe) : fe;
2935
+ se.push(
2936
+ /* @__PURE__ */ de(
2943
2937
  tn,
2944
2938
  {
2945
- index: ue,
2946
- top: Vt - O,
2947
- height: qe,
2948
- item: e(ue),
2949
- clipItemHeight: ye,
2950
- enableKeyboardNavigation: N,
2951
- onKeyDown: Jt,
2952
- onFocus: Qt,
2953
- registerItemRef: mt,
2939
+ index: fe,
2940
+ top: zt - O,
2941
+ height: Be,
2942
+ item: e(fe),
2943
+ clipItemHeight: ze,
2944
+ enableKeyboardNavigation: ee,
2945
+ onKeyDown: Qt,
2946
+ onFocus: er,
2947
+ registerItemRef: at,
2954
2948
  children: I
2955
2949
  },
2956
- qt
2950
+ Xt
2957
2951
  )
2958
- ), Pe += Xe, me += Fe;
2952
+ ), Ne += He, Ie += ke;
2959
2953
  }
2960
- return F.length > 0 && Promise.resolve().then(() => {
2961
- if (Le.current)
2954
+ return k.length > 0 && Promise.resolve().then(() => {
2955
+ if (et.current)
2962
2956
  return;
2963
- let ue = 0;
2964
- for (const Xe of F)
2965
- if (Xe.index < Ke) {
2966
- const Vt = V.get(Xe.index);
2967
- ue += Xe.value - Vt;
2957
+ let fe = 0;
2958
+ for (const He of k)
2959
+ if (He.index < xt) {
2960
+ const zt = E.get(He.index);
2961
+ fe += He.value - zt;
2968
2962
  }
2969
- const qe = V.updates(F);
2970
- if (Le.current || typeof qe != "number")
2963
+ const Be = E.updates(k);
2964
+ if (et.current || typeof Be != "number")
2971
2965
  return;
2972
- et(qe), T.debug("[VirtualScroll] Updated heights for items", F, "New total height:", qe);
2973
- const Fe = ie.current?.getScrollPosition() ?? ce.current;
2974
- if (ue !== 0) {
2975
- const Xe = Fe + ue;
2976
- xt(Xe, ue), xe(Xe, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: Fe, to: Xe, shiftAmount: ue });
2977
- } else Fe !== ce.current && xe(Fe);
2978
- }), { visibleItems: re, renderAnchor: O };
2966
+ st(Be), T.debug("[VirtualScroll] Updated heights for items", k, "New total height:", Be);
2967
+ const ke = ue.current?.getScrollPosition() ?? ie.current;
2968
+ if (fe !== 0) {
2969
+ const He = ke + fe;
2970
+ bt(He, fe), we(He, { immediate: !0 }), T.debug("[VirtualScroll] Adjusted scroll for layout shift (auto update)", { from: ke, to: He, shiftAmount: fe });
2971
+ } else ke !== ie.current && we(ke);
2972
+ }), { visibleItems: se, renderAnchor: O };
2979
2973
  }, [
2980
2974
  I,
2981
- ye,
2982
- He,
2983
- N,
2975
+ ze,
2976
+ Le,
2977
+ ee,
2984
2978
  r,
2985
- V,
2979
+ E,
2986
2980
  e,
2987
2981
  t,
2988
2982
  n,
2983
+ er,
2989
2984
  Qt,
2990
- Jt,
2991
- xt,
2992
- mt,
2985
+ bt,
2993
2986
  at,
2994
- ve,
2995
- xe,
2996
- Ke
2997
- ]), hr = v(
2987
+ Ye,
2988
+ lt,
2989
+ we,
2990
+ xt
2991
+ ]), gr = S(
2998
2992
  (o) => {
2999
- const u = (J ?? 0) > 0, m = Math.abs(o - We), A = u && m > 0.5 ? We : o, L = je(A, R.top);
2993
+ const u = (G ?? 0) > 0, m = Math.abs(o - Ze), A = u && m > 0.5 ? Ze : o, L = Ke(A, N.top);
3000
2994
  if (T.debug("[VirtualScroll] Rendering visible items", () => ({
3001
2995
  currentScrollPosition: o,
3002
2996
  effectiveScrollPosition: L,
3003
- renderingStartIndex: ve,
3004
- renderingEndIndex: at,
2997
+ renderingStartIndex: lt,
2998
+ renderingEndIndex: Ye,
3005
2999
  itemCount: r,
3006
- viewportSize: H,
3007
- callbackThrottleMs: J,
3000
+ viewportSize: K,
3001
+ callbackThrottleMs: G,
3008
3002
  diff: m,
3009
3003
  rawEffectiveScrollPosition: A
3010
3004
  })), r === 0)
3011
- return Bt;
3012
- const O = R.top + Ht - A, F = R.bottom > 0 ? /* @__PURE__ */ le(
3005
+ return Ht;
3006
+ const O = N.top + qt - A, k = N.bottom > 0 ? /* @__PURE__ */ de(
3013
3007
  "div",
3014
3008
  {
3015
3009
  className: "aqvs-bottom-inset",
3016
3010
  style: {
3017
3011
  // ラッパー座標での bottom インセット位置 = コンテンツ総高さ (最終行の下端) - アンカー。
3018
- top: V.getTotal() - Ht,
3019
- height: R.bottom
3012
+ top: E.getTotal() - qt,
3013
+ height: N.bottom
3020
3014
  }
3021
3015
  },
3022
3016
  "virtualscroll-bottom-inset"
3023
3017
  ) : null;
3024
3018
  return T.debug("[VirtualScroll] Rendering items", () => ({
3025
3019
  containerTop: O,
3026
- logicalScrollPosition: se,
3027
- resolvedInsets: R,
3020
+ logicalScrollPosition: Re,
3021
+ resolvedInsets: N,
3028
3022
  effectiveScrollPosition: L
3029
- })), /* @__PURE__ */ Tt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${O}px)`, willChange: "transform" }, children: [
3030
- Bt,
3031
- F
3023
+ })), /* @__PURE__ */ Mt("div", { className: "aqvs-items-wrapper", style: { top: 0, transform: `translateY(${O}px)`, willChange: "transform" }, children: [
3024
+ Ht,
3025
+ k
3032
3026
  ] });
3033
3027
  },
3034
- [J, r, V, se, Ht, at, ve, R, We, H, Bt]
3035
- ), er = Ye(
3028
+ [G, r, E, Re, qt, Ye, lt, N, Ze, K, Ht]
3029
+ ), tr = Fe(
3036
3030
  () => ({
3037
- renderingStartIndex: Ne.renderingStartIndex,
3038
- renderingEndIndex: Ne.renderingEndIndex,
3039
- visibleStartIndex: Ne.visibleStartIndex,
3040
- visibleEndIndex: Ne.visibleEndIndex,
3041
- scrollPosition: se,
3042
- totalHeight: V.getTotal()
3031
+ renderingStartIndex: Ee.renderingStartIndex,
3032
+ renderingEndIndex: Ee.renderingEndIndex,
3033
+ visibleStartIndex: Ee.visibleStartIndex,
3034
+ visibleEndIndex: Ee.visibleEndIndex,
3035
+ scrollPosition: Re,
3036
+ totalHeight: E.getTotal()
3043
3037
  // contentSize (State) ではなく最新値を反映
3044
3038
  }),
3045
3039
  // contentSize を依存に含めることで、updateItemSize/updates 等で木の総高さが変わった際に
3046
3040
  // (fenwickTree は安定参照のため getTotal() の変化だけでは再計算されない) 総高さを再取得する。
3047
- [Ne, se, V, He]
3041
+ [Ee, Re, E, Le]
3048
3042
  );
3049
- X(() => {
3050
- he.current = er;
3051
- }, [er]), Zt(
3043
+ q(() => {
3044
+ be.current = tr;
3045
+ }, [tr]), Jt(
3052
3046
  M,
3053
3047
  () => ({
3054
3048
  getScrollPosition: () => {
3055
- const o = ie.current?.getScrollPosition();
3056
- return typeof o == "number" ? je(o, ot.current) : -1;
3049
+ const o = ue.current?.getScrollPosition();
3050
+ return typeof o == "number" ? Ke(o, ct.current) : -1;
3057
3051
  },
3058
- getContentSize: () => ie.current?.getContentSize() ?? -1,
3059
- getViewportSize: () => ie.current?.getViewportSize() ?? -1,
3060
- scrollTo: x,
3061
- scrollBy: y,
3062
- applyWheel: D,
3063
- scrollToIndex: Je,
3064
- getFenwickTreeTotalHeight: () => V.getTotal(),
3065
- getFenwickSize: () => V.getSize(),
3066
- focusItemAtIndex: vt,
3067
- getRange: () => he.current,
3068
- getScrollAnchor: l,
3052
+ getContentSize: () => ue.current?.getContentSize() ?? -1,
3053
+ getViewportSize: () => ue.current?.getViewportSize() ?? -1,
3054
+ scrollTo: R,
3055
+ scrollBy: D,
3056
+ applyWheel: $,
3057
+ scrollToIndex: We,
3058
+ getFenwickTreeTotalHeight: () => E.getTotal(),
3059
+ getFenwickSize: () => E.getSize(),
3060
+ focusItemAtIndex: Tt,
3061
+ getRange: () => be.current,
3062
+ getScrollAnchor: x,
3069
3063
  updateItemSize: Ot
3070
3064
  }),
3071
- [x, y, D, Je, V, vt, l, Ot]
3065
+ [R, D, $, We, E, Tt, x, Ot]
3072
3066
  );
3073
- const gr = V.getTotal() + R.top + R.bottom;
3074
- return /* @__PURE__ */ le(
3075
- qr,
3067
+ const br = E.getTotal() + N.top + N.bottom;
3068
+ return /* @__PURE__ */ de(
3069
+ Xr,
3076
3070
  {
3077
- ref: ie,
3078
- contentSize: gr,
3071
+ ref: ue,
3072
+ contentSize: br,
3079
3073
  viewportSize: i,
3080
3074
  onViewportSizeChange: Ae,
3081
3075
  className: a,
3082
3076
  testId: c,
3083
- onScroll: K,
3077
+ onScroll: ye,
3084
3078
  background: w,
3085
- tapScrollCircleOptions: $,
3086
- inertiaOptions: Ge,
3079
+ tapScrollCircleOptions: W,
3080
+ inertiaOptions: Xe,
3081
+ overscrollBehavior: $e,
3087
3082
  itemCount: r,
3088
- scrollBarWidth: j,
3089
- enableThumbDrag: te,
3090
- enableTrackClick: G,
3091
- enableArrowButtons: Y,
3092
- enablePointerDrag: Ve,
3093
- pointerDragInputs: Qe,
3094
- renderThumbOverlay: S,
3095
- wheelSpeedMultiplier: De,
3096
- onWheelHorizontal: ae,
3097
- contentInsets: R,
3083
+ scrollBarWidth: Z,
3084
+ enableThumbDrag: Q,
3085
+ enableTrackClick: U,
3086
+ enableArrowButtons: Se,
3087
+ enablePointerDrag: ge,
3088
+ pointerDragInputs: qe,
3089
+ renderThumbOverlay: v,
3090
+ wheelSpeedMultiplier: X,
3091
+ onWheelHorizontal: ce,
3092
+ contentInsets: N,
3098
3093
  contentProps: _,
3099
- visibleStartIndex: Ke,
3100
- visibleEndIndex: Pt,
3101
- renderOverlay: mr,
3102
- initialScrollPosition: Q.position,
3103
- children: hr
3094
+ visibleStartIndex: xt,
3095
+ visibleEndIndex: _t,
3096
+ renderOverlay: hr,
3097
+ initialScrollPosition: J.position,
3098
+ children: gr
3104
3099
  }
3105
3100
  );
3106
- }, un = Gt(rn);
3101
+ }, un = Zt(rn);
3107
3102
  export {
3108
3103
  St as FenwickMapTree,
3109
- _r as ScrollBar,
3110
- qr as ScrollPane,
3111
- fr as TAP_SCROLL_SPEED_DEFAULTS,
3104
+ kr as ScrollBar,
3105
+ Xr as ScrollPane,
3106
+ pr as TAP_SCROLL_SPEED_DEFAULTS,
3112
3107
  un as VirtualScroll,
3113
- Or as computeAutoTapScrollMaxSpeedMultiplier,
3114
- Lr as computeTapScrollSpeed,
3115
- oe as minmax,
3108
+ _r as computeAutoTapScrollMaxSpeedMultiplier,
3109
+ Or as computeTapScrollSpeed,
3110
+ le as minmax,
3116
3111
  an as tapScrollCircleSampleVisual,
3117
3112
  Wr as useFenwickMapTree,
3118
3113
  ln as useHeightCache,
3119
- Kr as useLruCache,
3114
+ jr as useLruCache,
3120
3115
  cn as useWheelBridge
3121
3116
  };