@aiquants/virtualscroll 0.2.2 → 0.4.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 ge, { useState as X, useRef as Y, useEffect as B, forwardRef as de, useReducer as be, useMemo as ne, useCallback as L, useLayoutEffect as oe, useImperativeHandle as he, useId as ve } from "react";
2
- import { twMerge as ae } from "tailwind-merge";
3
- var re = { exports: {} }, ee = {};
1
+ import He, { forwardRef as Re, useState as le, useRef as H, useCallback as $, useImperativeHandle as Ae, useMemo as U, useEffect as ae, useReducer as $e, useLayoutEffect as be, useId as Ue } from "react";
2
+ import { twMerge as pe } from "tailwind-merge";
3
+ var Te = { exports: {} }, fe = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var re = { exports: {} }, ee = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var ie;
14
- function xe() {
15
- if (ie) return ee;
16
- ie = 1;
17
- var l = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
18
- function r(t, s, a) {
19
- var o = null;
20
- if (a !== void 0 && (o = "" + a), s.key !== void 0 && (o = "" + s.key), "key" in s) {
13
+ var Ve;
14
+ function qe() {
15
+ if (Ve) return fe;
16
+ Ve = 1;
17
+ var c = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
18
+ function n(r, s, a) {
19
+ var i = null;
20
+ if (a !== void 0 && (i = "" + a), s.key !== void 0 && (i = "" + s.key), "key" in s) {
21
21
  a = {};
22
- for (var d in s)
23
- d !== "key" && (a[d] = s[d]);
22
+ for (var f in s)
23
+ f !== "key" && (a[f] = s[f]);
24
24
  } else a = s;
25
25
  return s = a.ref, {
26
- $$typeof: l,
27
- type: t,
28
- key: o,
26
+ $$typeof: c,
27
+ type: r,
28
+ key: i,
29
29
  ref: s !== void 0 ? s : null,
30
30
  props: a
31
31
  };
32
32
  }
33
- return ee.Fragment = e, ee.jsx = r, ee.jsxs = r, ee;
33
+ return fe.Fragment = e, fe.jsx = n, fe.jsxs = n, fe;
34
34
  }
35
- var te = {};
35
+ var me = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,423 +42,874 @@ var te = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var le;
46
- function pe() {
47
- return le || (le = 1, process.env.NODE_ENV !== "production" && (function() {
48
- function l(n) {
49
- if (n == null) return null;
50
- if (typeof n == "function")
51
- return n.$$typeof === H ? null : n.displayName || n.name || null;
52
- if (typeof n == "string") return n;
53
- switch (n) {
54
- case j:
45
+ var ke;
46
+ function Xe() {
47
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && (function() {
48
+ function c(t) {
49
+ if (t == null) return null;
50
+ if (typeof t == "function")
51
+ return t.$$typeof === l ? null : t.displayName || t.name || null;
52
+ if (typeof t == "string") return t;
53
+ switch (t) {
54
+ case N:
55
55
  return "Fragment";
56
- case I:
56
+ case F:
57
57
  return "Profiler";
58
- case b:
58
+ case K:
59
59
  return "StrictMode";
60
- case V:
60
+ case k:
61
61
  return "Suspense";
62
62
  case C:
63
63
  return "SuspenseList";
64
- case J:
64
+ case se:
65
65
  return "Activity";
66
66
  }
67
- if (typeof n == "object")
68
- switch (typeof n.tag == "number" && console.error(
67
+ if (typeof t == "object")
68
+ switch (typeof t.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
- ), n.$$typeof) {
71
- case S:
70
+ ), t.$$typeof) {
71
+ case ie:
72
72
  return "Portal";
73
- case f:
74
- return (n.displayName || "Context") + ".Provider";
75
- case k:
76
- return (n._context.displayName || "Context") + ".Consumer";
77
- case P:
78
- var u = n.render;
79
- return n = n.displayName, n || (n = u.displayName || u.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
80
- case $:
81
- return u = n.displayName || null, u !== null ? u : l(n.type) || "Memo";
82
- case w:
83
- u = n._payload, n = n._init;
73
+ case Z:
74
+ return (t.displayName || "Context") + ".Provider";
75
+ case m:
76
+ return (t._context.displayName || "Context") + ".Consumer";
77
+ case A:
78
+ var o = t.render;
79
+ return t = t.displayName, t || (t = o.displayName || o.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
80
+ case B:
81
+ return o = t.displayName || null, o !== null ? o : c(t.type) || "Memo";
82
+ case X:
83
+ o = t._payload, t = t._init;
84
84
  try {
85
- return l(n(u));
85
+ return c(t(o));
86
86
  } catch {
87
87
  }
88
88
  }
89
89
  return null;
90
90
  }
91
- function e(n) {
92
- return "" + n;
91
+ function e(t) {
92
+ return "" + t;
93
93
  }
94
- function r(n) {
94
+ function n(t) {
95
95
  try {
96
- e(n);
97
- var u = !1;
96
+ e(t);
97
+ var o = !1;
98
98
  } catch {
99
- u = !0;
99
+ o = !0;
100
100
  }
101
- if (u) {
102
- u = console;
103
- var h = u.error, x = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
104
- return h.call(
105
- u,
101
+ if (o) {
102
+ o = console;
103
+ var T = o.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
104
+ return T.call(
105
+ o,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- x
108
- ), e(n);
107
+ y
108
+ ), e(t);
109
109
  }
110
110
  }
111
- function t(n) {
112
- if (n === j) return "<>";
113
- if (typeof n == "object" && n !== null && n.$$typeof === w)
111
+ function r(t) {
112
+ if (t === N) return "<>";
113
+ if (typeof t == "object" && t !== null && t.$$typeof === X)
114
114
  return "<...>";
115
115
  try {
116
- var u = l(n);
117
- return u ? "<" + u + ">" : "<...>";
116
+ var o = c(t);
117
+ return o ? "<" + o + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function s() {
123
- var n = U.A;
124
- return n === null ? null : n.getOwner();
123
+ var t = Y.A;
124
+ return t === null ? null : t.getOwner();
125
125
  }
126
126
  function a() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function o(n) {
130
- if (Z.call(n, "key")) {
131
- var u = Object.getOwnPropertyDescriptor(n, "key").get;
132
- if (u && u.isReactWarning) return !1;
129
+ function i(t) {
130
+ if (j.call(t, "key")) {
131
+ var o = Object.getOwnPropertyDescriptor(t, "key").get;
132
+ if (o && o.isReactWarning) return !1;
133
133
  }
134
- return n.key !== void 0;
134
+ return t.key !== void 0;
135
135
  }
136
- function d(n, u) {
137
- function h() {
138
- g || (g = !0, console.error(
136
+ function f(t, o) {
137
+ function T() {
138
+ E || (E = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- u
140
+ o
141
141
  ));
142
142
  }
143
- h.isReactWarning = !0, Object.defineProperty(n, "key", {
144
- get: h,
143
+ T.isReactWarning = !0, Object.defineProperty(t, "key", {
144
+ get: T,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function i() {
149
- var n = l(this.type);
150
- return E[n] || (E[n] = !0, console.error(
148
+ function p() {
149
+ var t = c(this.type);
150
+ return M[t] || (M[t] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
- )), n = this.props.ref, n !== void 0 ? n : null;
152
+ )), t = this.props.ref, t !== void 0 ? t : null;
153
153
  }
154
- function c(n, u, h, x, z, T, q, G) {
155
- return h = T.ref, n = {
156
- $$typeof: p,
157
- type: n,
158
- key: u,
159
- props: T,
160
- _owner: z
161
- }, (h !== void 0 ? h : null) !== null ? Object.defineProperty(n, "ref", {
154
+ function g(t, o, T, y, w, V, D, _) {
155
+ return T = V.ref, t = {
156
+ $$typeof: ne,
157
+ type: t,
158
+ key: o,
159
+ props: V,
160
+ _owner: w
161
+ }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(t, "ref", {
162
162
  enumerable: !1,
163
- get: i
164
- }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
163
+ get: p
164
+ }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
167
167
  writable: !0,
168
168
  value: 0
169
- }), Object.defineProperty(n, "_debugInfo", {
169
+ }), Object.defineProperty(t, "_debugInfo", {
170
170
  configurable: !1,
171
171
  enumerable: !1,
172
172
  writable: !0,
173
173
  value: null
174
- }), Object.defineProperty(n, "_debugStack", {
174
+ }), Object.defineProperty(t, "_debugStack", {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: q
179
- }), Object.defineProperty(n, "_debugTask", {
178
+ value: D
179
+ }), Object.defineProperty(t, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: G
184
- }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
183
+ value: _
184
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
185
185
  }
186
- function m(n, u, h, x, z, T, q, G) {
187
- var R = u.children;
186
+ function x(t, o, T, y, w, V, D, _) {
187
+ var R = o.children;
188
188
  if (R !== void 0)
189
- if (x)
190
- if (F(R)) {
191
- for (x = 0; x < R.length; x++)
192
- v(R[x]);
189
+ if (y)
190
+ if (L(R)) {
191
+ for (y = 0; y < R.length; y++)
192
+ P(R[y]);
193
193
  Object.freeze && Object.freeze(R);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else v(R);
199
- if (Z.call(u, "key")) {
200
- R = l(n);
201
- var W = Object.keys(u).filter(function(se) {
202
- return se !== "key";
198
+ else P(R);
199
+ if (j.call(o, "key")) {
200
+ R = c(t);
201
+ var G = Object.keys(o).filter(function(u) {
202
+ return u !== "key";
203
203
  });
204
- x = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", M[R + x] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ y = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", I[R + y] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
- x,
211
+ y,
212
212
  R,
213
- W,
213
+ G,
214
214
  R
215
- ), M[R + x] = !0);
215
+ ), I[R + y] = !0);
216
216
  }
217
- if (R = null, h !== void 0 && (r(h), R = "" + h), o(u) && (r(u.key), R = "" + u.key), "key" in u) {
218
- h = {};
219
- for (var K in u)
220
- K !== "key" && (h[K] = u[K]);
221
- } else h = u;
222
- return R && d(
223
- h,
224
- typeof n == "function" ? n.displayName || n.name || "Unknown" : n
225
- ), c(
226
- n,
227
- R,
217
+ if (R = null, T !== void 0 && (n(T), R = "" + T), i(o) && (n(o.key), R = "" + o.key), "key" in o) {
218
+ T = {};
219
+ for (var J in o)
220
+ J !== "key" && (T[J] = o[J]);
221
+ } else T = o;
222
+ return R && f(
228
223
  T,
229
- z,
224
+ typeof t == "function" ? t.displayName || t.name || "Unknown" : t
225
+ ), g(
226
+ t,
227
+ R,
228
+ V,
229
+ w,
230
230
  s(),
231
- h,
232
- q,
233
- G
231
+ T,
232
+ D,
233
+ _
234
234
  );
235
235
  }
236
- function v(n) {
237
- typeof n == "object" && n !== null && n.$$typeof === p && n._store && (n._store.validated = 1);
236
+ function P(t) {
237
+ typeof t == "object" && t !== null && t.$$typeof === ne && t._store && (t._store.validated = 1);
238
238
  }
239
- var _ = ge, p = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), f = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), J = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), U = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, F = Array.isArray, Q = console.createTask ? console.createTask : function() {
239
+ var S = He, ne = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), K = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), m = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), A = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), X = Symbol.for("react.lazy"), se = Symbol.for("react.activity"), l = Symbol.for("react.client.reference"), Y = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, L = Array.isArray, b = console.createTask ? console.createTask : function() {
240
240
  return null;
241
241
  };
242
- _ = {
243
- react_stack_bottom_frame: function(n) {
244
- return n();
242
+ S = {
243
+ react_stack_bottom_frame: function(t) {
244
+ return t();
245
245
  }
246
246
  };
247
- var g, E = {}, y = _.react_stack_bottom_frame.bind(
248
- _,
247
+ var E, M = {}, h = S.react_stack_bottom_frame.bind(
248
+ S,
249
249
  a
250
- )(), O = Q(t(a)), M = {};
251
- te.Fragment = j, te.jsx = function(n, u, h, x, z) {
252
- var T = 1e4 > U.recentlyCreatedOwnerStacks++;
253
- return m(
254
- n,
255
- u,
256
- h,
250
+ )(), v = b(r(a)), I = {};
251
+ me.Fragment = N, me.jsx = function(t, o, T, y, w) {
252
+ var V = 1e4 > Y.recentlyCreatedOwnerStacks++;
253
+ return x(
254
+ t,
255
+ o,
256
+ T,
257
257
  !1,
258
- x,
259
- z,
260
- T ? Error("react-stack-top-frame") : y,
261
- T ? Q(t(n)) : O
258
+ y,
259
+ w,
260
+ V ? Error("react-stack-top-frame") : h,
261
+ V ? b(r(t)) : v
262
262
  );
263
- }, te.jsxs = function(n, u, h, x, z) {
264
- var T = 1e4 > U.recentlyCreatedOwnerStacks++;
265
- return m(
266
- n,
267
- u,
268
- h,
263
+ }, me.jsxs = function(t, o, T, y, w) {
264
+ var V = 1e4 > Y.recentlyCreatedOwnerStacks++;
265
+ return x(
266
+ t,
267
+ o,
268
+ T,
269
269
  !0,
270
- x,
271
- z,
272
- T ? Error("react-stack-top-frame") : y,
273
- T ? Q(t(n)) : O
270
+ y,
271
+ w,
272
+ V ? Error("react-stack-top-frame") : h,
273
+ V ? b(r(t)) : v
274
274
  );
275
275
  };
276
- })()), te;
276
+ })()), me;
277
277
  }
278
- var ue;
279
- function Te() {
280
- return ue || (ue = 1, process.env.NODE_ENV === "production" ? re.exports = xe() : re.exports = pe()), re.exports;
278
+ var Le;
279
+ function We() {
280
+ return Le || (Le = 1, process.env.NODE_ENV === "production" ? Te.exports = qe() : Te.exports = Xe()), Te.exports;
281
281
  }
282
- var D = Te();
283
- const N = {
284
- debug(l, ...e) {
285
- typeof window < "u" && window.localStorage?.getItem("debug") === "true" && console.debug(`[VirtualScroll] ${l}`, ...e);
282
+ var q = We();
283
+ const re = {
284
+ debug(c, ...e) {
285
+ typeof window < "u" && window.localStorage?.getItem("debug") === "true" && console.debug(`[VirtualScroll] ${c}`, ...e);
286
286
  },
287
- warn(l, ...e) {
288
- console.warn(`[VirtualScroll] ${l}`, ...e);
287
+ warn(c, ...e) {
288
+ console.warn(`[VirtualScroll] ${c}`, ...e);
289
289
  },
290
- error(l, ...e) {
291
- console.error(`[VirtualScroll] ${l}`, ...e);
290
+ error(c, ...e) {
291
+ console.error(`[VirtualScroll] ${c}`, ...e);
292
292
  }
293
- }, A = (l, e, r) => Math.min(r, Math.max(e, l)), ce = (l, e, r) => {
294
- const t = "touches" in l.nativeEvent, s = t ? l.nativeEvent.touches[0] : l.nativeEvent, a = (d) => {
295
- t && d.cancelable && d.preventDefault();
296
- const i = "touches" in d ? d.touches[0] : d;
293
+ }, z = (c, e, n) => Math.min(n, Math.max(e, c)), Ie = {
294
+ active: !1,
295
+ offsetY: 0,
296
+ distance: 0,
297
+ direction: 0
298
+ }, Oe = 6, je = Re(({ onDragChange: c, className: e, maxVisualDistance: n = 160, size: r = 64, style: s, opacity: a = 1 }, i) => {
299
+ const [f, p] = le(Ie), g = H(null), x = H({ x: 0, y: 0 }), P = H(null), S = $(
300
+ (b, E = !1) => {
301
+ const { y: M } = x.current, h = b - M, v = Math.abs(h), I = v < Oe ? 0 : h < 0 ? -1 : 1, t = {
302
+ active: E || v >= Oe,
303
+ offsetY: h,
304
+ distance: v,
305
+ direction: I
306
+ };
307
+ p(t), c(t);
308
+ },
309
+ [c]
310
+ ), ne = $(
311
+ (b = !1) => {
312
+ if (b && g.current !== null) {
313
+ const E = P.current;
314
+ E?.hasPointerCapture(g.current) && E.releasePointerCapture(g.current);
315
+ }
316
+ g.current = null, p(Ie), c(Ie);
317
+ },
318
+ [c]
319
+ ), ie = $(
320
+ (b) => {
321
+ b.preventDefault(), b.stopPropagation();
322
+ const E = P.current ?? b.currentTarget, M = E.getBoundingClientRect();
323
+ x.current = {
324
+ x: M.left + M.width / 2,
325
+ y: M.top + M.height / 2
326
+ }, g.current = b.pointerId, E.setPointerCapture(b.pointerId), S(b.clientY, !0);
327
+ },
328
+ [S]
329
+ ), N = $(
330
+ (b) => {
331
+ g.current === b.pointerId && (b.preventDefault(), S(b.clientY));
332
+ },
333
+ [S]
334
+ ), K = $(
335
+ (b) => {
336
+ g.current === b.pointerId && (b.preventDefault(), b.stopPropagation(), ne(!0));
337
+ },
338
+ [ne]
339
+ );
340
+ Ae(
341
+ i,
342
+ () => ({
343
+ reset: () => {
344
+ ne(!0);
345
+ },
346
+ getElement: () => P.current
347
+ }),
348
+ [ne]
349
+ );
350
+ const F = U(() => Math.min(f.distance, n) / n, [f.distance, n]), m = U(() => r / 64, [r]), Z = U(() => 1 + F * 0.4, [F]), A = U(() => f.direction * F * 10 * m, [f.direction, F, m]), k = U(() => f.direction * F * 26 * m, [f.direction, F, m]), C = U(() => 22 * m, [m]), B = U(() => Math.max(2.5, 3 * m), [m]), X = U(() => 6 * m, [m]), se = U(() => 3 * m, [m]), l = U(() => Math.min(Math.max(a, 0), 1), [a]), Y = U(() => {
351
+ const b = {
352
+ ...s,
353
+ width: r,
354
+ height: r,
355
+ transform: `translateY(${A}px)`
356
+ };
357
+ return b.opacity = l, b;
358
+ }, [l, A, r, s]), j = U(() => Math.abs(k) + X, [X, k]), L = U(() => k > 0 ? se : -Math.abs(k) - se, [se, k]);
359
+ return /* @__PURE__ */ q.jsxs(
360
+ "div",
361
+ {
362
+ ref: P,
363
+ className: pe(
364
+ "relative flex items-center justify-center touch-none select-none",
365
+ "transition-transform duration-100 ease-out",
366
+ e
367
+ ),
368
+ style: Y,
369
+ onPointerDown: ie,
370
+ onPointerMove: N,
371
+ onPointerUp: K,
372
+ onPointerCancel: K,
373
+ role: "presentation",
374
+ children: [
375
+ /* @__PURE__ */ q.jsx(
376
+ "div",
377
+ {
378
+ className: "absolute inset-0 rounded-full border border-white/40 bg-gradient-to-br from-[#1d4ed8]/60 via-[#60a5fa]/55 to-[#bfdbfe]/40 shadow-md",
379
+ style: {
380
+ transform: `scaleY(${Z})`,
381
+ transition: f.active ? "transform 40ms ease-out" : "transform 200ms ease"
382
+ }
383
+ }
384
+ ),
385
+ /* @__PURE__ */ q.jsx(
386
+ "div",
387
+ {
388
+ className: "absolute left-1/2 top-1/2 h-6 w-6 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white/50 bg-white/85",
389
+ style: {
390
+ width: C,
391
+ height: C,
392
+ transform: `translate(-50%, calc(-50% + ${k * 0.3}px)) scale(${1 + F * 0.2})`,
393
+ transition: f.active ? "transform 40ms ease-out" : "transform 200ms ease"
394
+ }
395
+ }
396
+ ),
397
+ /* @__PURE__ */ q.jsx(
398
+ "div",
399
+ {
400
+ className: "absolute left-1/2 top-1/2 w-1 rounded-full bg-white/50",
401
+ style: {
402
+ width: B,
403
+ height: j,
404
+ transform: `translate(-50%, ${L}px)`,
405
+ opacity: F,
406
+ transition: f.active ? "height 40ms ease-out, opacity 60ms" : "height 200ms ease, opacity 120ms"
407
+ }
408
+ }
409
+ )
410
+ ]
411
+ }
412
+ );
413
+ });
414
+ je.displayName = "TapScrollCircle";
415
+ const De = (c, e, n) => {
416
+ const r = "touches" in c.nativeEvent, s = r ? c.nativeEvent.touches[0] : c.nativeEvent, a = (f) => {
417
+ r && f.cancelable && f.preventDefault();
418
+ const p = "touches" in f ? f.touches[0] : f;
297
419
  e({
298
- deltaX: i.clientX - s.clientX,
299
- deltaY: i.clientY - s.clientY
420
+ deltaX: p.clientX - s.clientX,
421
+ deltaY: p.clientY - s.clientY
300
422
  });
301
- }, o = () => {
302
- t ? (document.removeEventListener("touchmove", a), document.removeEventListener("touchend", o)) : (document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o)), r?.();
423
+ }, i = () => {
424
+ r ? (document.removeEventListener("touchmove", a), document.removeEventListener("touchend", i)) : (document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", i)), n?.();
303
425
  };
304
- t ? (document.addEventListener("touchmove", a, { passive: !1 }), document.addEventListener("touchend", o)) : (document.addEventListener("mousemove", a), document.addEventListener("mouseup", o));
305
- }, Ee = 20, _e = ({ contentSize: l, viewportSize: e, scrollPosition: r, onScroll: t, horizontal: s = !1, scrollBarWidth: a = 12, className: o, ariaControls: d }) => {
306
- const [i, c] = X(!1), m = Y(null), v = e / l, _ = Math.max(Ee, v * e), p = l - e, S = r / p * (e - _), j = l > e;
307
- B(() => {
308
- m.current && (i ? m.current.style.backgroundColor = "#4F4F4F" : m.current.style.backgroundColor = "#7F7F7F");
309
- }, [i]);
310
- const b = (f) => A(f / (e - _) * p, 0, p), I = (f) => {
311
- if (!j || "button" in f && f.button !== 0 || f.ctrlKey)
426
+ r ? (document.addEventListener("touchmove", a, { passive: !1 }), document.addEventListener("touchend", i)) : (document.addEventListener("mousemove", a), document.addEventListener("mouseup", i));
427
+ }, Pe = "virtualscroll:tap-scroll-cancel", Fe = 20, Ge = 250, Je = 60, Be = 20, Ke = 20, Ze = 220, Ne = { active: !1, offsetY: 0, distance: 0, direction: 0 }, _e = 2.2, Qe = 8, et = 120, ce = {
428
+ enabled: !0,
429
+ size: 64,
430
+ offsetX: -80,
431
+ offsetY: 0,
432
+ className: void 0,
433
+ maxVisualDistance: Ze,
434
+ opacity: 1
435
+ }, tt = (c) => {
436
+ if (!c || c <= 0)
437
+ return _e;
438
+ const e = Math.max(1, c), n = Math.log10(e), r = _e + n * Qe;
439
+ return z(r, _e, et);
440
+ }, rt = ({ contentSize: c, viewportSize: e, scrollPosition: n, onScroll: r, horizontal: s = !1, scrollBarWidth: a = 12, className: i, ariaControls: f, tapScrollCircleOptions: p, itemCount: g }) => {
441
+ const [x, P] = le(!1), [S, ne] = le(!1), ie = H(null), N = H(n), K = H(null), F = H(null), m = H(Ne), Z = H(null), A = H(null), k = H(null), C = U(() => {
442
+ const d = p?.maxSpeedMultiplier, O = typeof d == "number" ? d : tt(g);
443
+ return {
444
+ enabled: p?.enabled ?? ce.enabled,
445
+ size: p?.size ?? ce.size,
446
+ offsetX: p?.offsetX ?? ce.offsetX,
447
+ offsetY: p?.offsetY ?? ce.offsetY,
448
+ className: p?.className ?? ce.className,
449
+ maxVisualDistance: p?.maxVisualDistance ?? ce.maxVisualDistance,
450
+ maxSpeedMultiplier: O,
451
+ opacity: z(p?.opacity ?? ce.opacity, 0, 1)
452
+ };
453
+ }, [g, p]), {
454
+ enabled: B,
455
+ size: X,
456
+ offsetX: se,
457
+ offsetY: l,
458
+ className: Y,
459
+ maxVisualDistance: j,
460
+ maxSpeedMultiplier: L,
461
+ opacity: b
462
+ } = C, E = Math.max(j, 1), M = e / c, h = a, v = Math.max(e - h * 2, 0), I = M * v, t = Math.min(Math.max(Fe, I || 0), v || Fe), o = c - e, T = Math.max(v - t, 0), y = o <= 0 || T <= 0 ? 0 : n / o * T, w = c > e;
463
+ ae(() => {
464
+ N.current = n;
465
+ }, [n]), ae(() => {
466
+ ie.current && (x ? ie.current.style.backgroundColor = "#4F4F4F" : ie.current.style.backgroundColor = "#7F7F7F");
467
+ }, [x]);
468
+ const V = $(() => {
469
+ K.current !== null && (window.clearInterval(K.current), K.current = null), F.current !== null && (window.clearTimeout(F.current), F.current = null);
470
+ }, []), D = $(() => {
471
+ A.current !== null && (window.cancelAnimationFrame(A.current), A.current = null), k.current = null;
472
+ }, []), _ = $(() => {
473
+ m.current = { ...Ne }, ne(!1), Z.current?.reset(), D();
474
+ }, [D]), R = $(
475
+ (d) => {
476
+ const O = m.current;
477
+ if (!O.active || O.direction === 0) {
478
+ D();
479
+ return;
480
+ }
481
+ if (!w || o <= 0) {
482
+ D();
483
+ return;
484
+ }
485
+ const te = k.current ?? d, Q = Math.max((d - te) / 1e3, 0);
486
+ if (k.current = d, Q <= 0) {
487
+ A.current = window.requestAnimationFrame(R);
488
+ return;
489
+ }
490
+ const Ee = (Math.min(O.distance, E) / E) ** 1.1, de = Math.max(e * 0.2, 40), we = Math.max(e * L, 1200), Se = de + (we - de) * Ee, xe = N.current, ye = z(xe + O.direction * Se * Q, 0, o);
491
+ if (ye === xe) {
492
+ D();
493
+ return;
494
+ }
495
+ N.current = ye, r?.(ye, xe), A.current = window.requestAnimationFrame(R);
496
+ },
497
+ [E, o, r, w, D, L, e]
498
+ ), G = $(() => {
499
+ A.current === null && (k.current = null, A.current = window.requestAnimationFrame(R));
500
+ }, [R]);
501
+ ae(() => () => {
502
+ V(), D();
503
+ }, [V, D]);
504
+ const J = $(
505
+ (d) => {
506
+ m.current = d, ne(d.active), d.active && d.direction !== 0 ? G() : D();
507
+ },
508
+ [G, D]
509
+ );
510
+ ae(() => {
511
+ B || _();
512
+ }, [_, B]), ae(() => {
513
+ const d = (O) => {
514
+ const Q = O.detail?.paneId;
515
+ Q && f && Q !== f || _();
516
+ };
517
+ return window.addEventListener(Pe, d), () => {
518
+ window.removeEventListener(Pe, d);
519
+ };
520
+ }, [f, _]), ae(() => {
521
+ if (!B)
312
522
  return;
313
- f.stopPropagation();
314
- const P = S;
315
- c(!0), ce(
316
- f,
317
- ({ deltaX: V, deltaY: C }) => {
318
- t?.(b(P + (s ? V : C)), S);
523
+ const d = (O) => {
524
+ if (!m.current.active)
525
+ return;
526
+ const te = O.target;
527
+ if (!(te instanceof Node)) {
528
+ _();
529
+ return;
530
+ }
531
+ Z.current?.getElement()?.contains(te) || _();
532
+ };
533
+ return document.addEventListener("pointerdown", d, !0), () => {
534
+ document.removeEventListener("pointerdown", d, !0);
535
+ };
536
+ }, [_, B]);
537
+ const u = (d) => {
538
+ if (!w || T <= 0 || o <= 0)
539
+ return 0;
540
+ const O = z(d, 0, T);
541
+ return z(O / T * o, 0, o);
542
+ }, ee = (d) => {
543
+ if (!w || o <= 0)
544
+ return;
545
+ const O = Math.max(Math.round(e / Ke), Be), te = N.current, Q = z(te + d * O, 0, o);
546
+ Q !== te && (N.current = Q, r?.(Q, te));
547
+ }, W = () => {
548
+ V();
549
+ }, oe = (d) => (O) => {
550
+ w && (O.preventDefault(), O.stopPropagation(), _(), V(), ee(d), F.current = window.setTimeout(() => {
551
+ K.current = window.setInterval(() => {
552
+ ee(d);
553
+ }, Je);
554
+ }, Ge));
555
+ }, ue = (d) => (O) => {
556
+ (O.key === "Enter" || O.key === " " || O.key === "Spacebar") && (O.preventDefault(), ee(d));
557
+ }, ge = (d) => {
558
+ if (!w || "button" in d && d.button !== 0 || d.ctrlKey)
559
+ return;
560
+ d.stopPropagation(), _();
561
+ const O = y;
562
+ P(!0), De(
563
+ d,
564
+ ({ deltaX: te, deltaY: Q }) => {
565
+ r?.(u(O + (s ? te : Q)), y);
319
566
  },
320
567
  () => {
321
- c(!1);
568
+ P(!1);
322
569
  }
323
570
  );
324
- }, k = (f) => {
325
- if (!j || "button" in f && f.button !== 0 || f.ctrlKey)
571
+ }, Me = (d) => {
572
+ if (!w || "button" in d && d.button !== 0 || d.ctrlKey)
326
573
  return;
327
- const V = "touches" in f.nativeEvent ? f.nativeEvent.touches[0] : f.nativeEvent, C = s ? V.clientX : V.clientY, $ = f.currentTarget.getBoundingClientRect(), J = (s ? C - $.left : C - $.top) - _ / 2;
328
- t?.(b(J), S), ce(f, ({ deltaX: H, deltaY: U }) => {
329
- t?.(b(J + (s ? H : U)), S);
574
+ const te = "touches" in d.nativeEvent ? d.nativeEvent.touches[0] : d.nativeEvent, Q = s ? te.clientX : te.clientY, ve = d.currentTarget.getBoundingClientRect(), Ee = s ? Q - ve.left : Q - ve.top;
575
+ _();
576
+ const de = Ee - t / 2;
577
+ r?.(u(de), y), De(d, ({ deltaX: we, deltaY: Se }) => {
578
+ r?.(u(de + (s ? we : Se)), y);
330
579
  });
331
- };
332
- return (
333
- // スクロールバーのコンテナ
334
- /* @__PURE__ */ D.jsx(
335
- "div",
336
- {
337
- className: ae("group relative cursor-default select-none", o),
338
- style: {
339
- [s ? "width" : "height"]: e,
340
- [s ? "height" : "width"]: a,
341
- backgroundColor: "white",
342
- userSelect: "none"
343
- },
344
- onMouseDown: k,
345
- onTouchStart: k,
346
- role: "scrollbar",
347
- tabIndex: -1,
348
- "aria-controls": d,
349
- "aria-valuenow": r,
350
- "aria-valuemin": 0,
351
- "aria-valuemax": p,
352
- "aria-orientation": s ? "horizontal" : "vertical",
353
- children: l > e && // スクロールバーのつまみの当たり判定を広げるためのラッパー
354
- /* @__PURE__ */ D.jsx(
580
+ }, Ye = U(() => z((S ? 1 : 0.8) * b, 0, 1), [S, b]), ze = U(() => {
581
+ const O = `calc(50% - ${X / 2}px + ${l}px)`;
582
+ return {
583
+ left: se,
584
+ top: O
585
+ };
586
+ }, [se, l, X]);
587
+ return /* @__PURE__ */ q.jsxs(
588
+ "div",
589
+ {
590
+ className: pe(
591
+ "group relative cursor-default select-none",
592
+ s ? "flex flex-row items-stretch" : "flex flex-col items-stretch",
593
+ i
594
+ ),
595
+ style: {
596
+ [s ? "width" : "height"]: e,
597
+ [s ? "height" : "width"]: a,
598
+ backgroundColor: "white",
599
+ userSelect: "none",
600
+ position: "relative"
601
+ },
602
+ role: "scrollbar",
603
+ tabIndex: -1,
604
+ "aria-controls": f,
605
+ "aria-valuenow": n,
606
+ "aria-valuemin": 0,
607
+ "aria-valuemax": o,
608
+ "aria-orientation": s ? "horizontal" : "vertical",
609
+ children: [
610
+ !s && w && B && /* @__PURE__ */ q.jsx(
611
+ je,
612
+ {
613
+ ref: Z,
614
+ className: pe(
615
+ "pointer-events-auto absolute transition-opacity duration-150",
616
+ Y
617
+ ),
618
+ size: X,
619
+ maxVisualDistance: E,
620
+ style: ze,
621
+ opacity: Ye,
622
+ onDragChange: J
623
+ }
624
+ ),
625
+ /* @__PURE__ */ q.jsx(
626
+ "button",
627
+ {
628
+ type: "button",
629
+ className: "flex items-center justify-center text-xs text-[#313131] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[#60a5fa] focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
630
+ style: {
631
+ [s ? "width" : "height"]: h,
632
+ [s ? "height" : "width"]: a,
633
+ backgroundColor: "#E0E0E0"
634
+ },
635
+ "aria-label": s ? "Scroll left" : "Scroll up",
636
+ onMouseDown: oe(-1),
637
+ onTouchStart: oe(-1),
638
+ onMouseUp: W,
639
+ onMouseLeave: W,
640
+ onTouchEnd: W,
641
+ onTouchCancel: W,
642
+ onKeyDown: ue(-1),
643
+ disabled: !w,
644
+ children: /* @__PURE__ */ q.jsx("span", { "aria-hidden": "true", children: s ? "◀" : "▲" })
645
+ }
646
+ ),
647
+ /* @__PURE__ */ q.jsx(
355
648
  "div",
356
649
  {
357
- className: "group absolute",
650
+ className: "relative flex-1",
358
651
  style: {
359
- [s ? "width" : "height"]: _,
360
- [s ? "left" : "top"]: S,
361
- // 当たり判定を上下または左右に広げる
362
- ...s ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
652
+ backgroundColor: "#F5F5F5",
653
+ borderRadius: a / 2
363
654
  },
364
- onMouseDown: I,
365
- onTouchStart: I,
366
- role: "slider",
367
- "aria-orientation": s ? "horizontal" : "vertical",
368
- "aria-valuenow": r,
369
- "aria-valuemin": 0,
370
- "aria-valuemax": p,
371
- tabIndex: 0,
372
- children: /* @__PURE__ */ D.jsx(
655
+ onMouseDown: Me,
656
+ onTouchStart: Me,
657
+ children: c > e && // スクロールバーのつまみの当たり判定を広げるためのラッパー
658
+ /* @__PURE__ */ q.jsx(
373
659
  "div",
374
660
  {
375
- ref: m,
376
- className: ae(
377
- "absolute",
378
- s ? `inset-x-0 inset-y-[1.5px] group-hover:inset-y-[-0.5px] ${i ? "inset-y-[-2px]" : "group-active:inset-y-[-2px]"}` : `inset-x-[1.5px] inset-y-0 group-hover:inset-x-[-0.5px] ${i ? "inset-x-[-2px]" : "group-active:inset-x-[-2px]"}`
379
- ),
661
+ className: "group absolute",
380
662
  style: {
381
- backgroundColor: "#7F7F7F",
382
- borderRadius: a - 1,
383
- // Tailwind が適用されない場合のフォールバック
384
- ...s ? {
385
- left: 0,
386
- right: 0,
387
- top: i ? -2 : 1.5,
388
- bottom: i ? -2 : 1.5
389
- } : {
390
- top: 0,
391
- bottom: 0,
392
- left: i ? -2 : 1.5,
393
- right: i ? -2 : 1.5
394
- }
663
+ [s ? "width" : "height"]: t,
664
+ [s ? "left" : "top"]: y,
665
+ ...s ? { top: 0, bottom: 0 } : { left: 0, right: 0 }
395
666
  },
396
- onMouseEnter: (f) => {
397
- s ? (f.currentTarget.style.top = "-0.5px", f.currentTarget.style.bottom = "-0.5px") : (f.currentTarget.style.left = "-0.5px", f.currentTarget.style.right = "-0.5px"), i || (f.currentTarget.style.backgroundColor = "#5F5F5F");
398
- },
399
- onMouseLeave: (f) => {
400
- s ? (f.currentTarget.style.top = i ? "-2px" : "1.5px", f.currentTarget.style.bottom = i ? "-2px" : "1.5px") : (f.currentTarget.style.left = i ? "-2px" : "1.5px", f.currentTarget.style.right = i ? "-2px" : "1.5px"), i || (f.currentTarget.style.backgroundColor = "#7F7F7F");
401
- }
667
+ onMouseDown: ge,
668
+ onTouchStart: ge,
669
+ role: "slider",
670
+ "aria-orientation": s ? "horizontal" : "vertical",
671
+ "aria-valuenow": n,
672
+ "aria-valuemin": 0,
673
+ "aria-valuemax": o,
674
+ tabIndex: 0,
675
+ children: /* @__PURE__ */ q.jsx(
676
+ "div",
677
+ {
678
+ ref: ie,
679
+ className: pe(
680
+ "absolute",
681
+ s ? `inset-x-0 inset-y-[1.5px] group-hover:inset-y-[-0.5px] ${x ? "inset-y-[-2px]" : "group-active:inset-y-[-2px]"}` : `inset-x-[1.5px] inset-y-0 group-hover:inset-x-[-0.5px] ${x ? "inset-x-[-2px]" : "group-active:inset-x-[-2px]"}`
682
+ ),
683
+ style: {
684
+ backgroundColor: "#7F7F7F",
685
+ borderRadius: a - 1,
686
+ ...s ? {
687
+ left: 0,
688
+ right: 0,
689
+ top: x ? -2 : 1.5,
690
+ bottom: x ? -2 : 1.5
691
+ } : {
692
+ top: 0,
693
+ bottom: 0,
694
+ left: x ? -2 : 1.5,
695
+ right: x ? -2 : 1.5
696
+ }
697
+ },
698
+ onMouseEnter: (d) => {
699
+ s ? (d.currentTarget.style.top = "-0.5px", d.currentTarget.style.bottom = "-0.5px") : (d.currentTarget.style.left = "-0.5px", d.currentTarget.style.right = "-0.5px"), x || (d.currentTarget.style.backgroundColor = "#5F5F5F");
700
+ },
701
+ onMouseLeave: (d) => {
702
+ s ? (d.currentTarget.style.top = x ? "-2px" : "1.5px", d.currentTarget.style.bottom = x ? "-2px" : "1.5px") : (d.currentTarget.style.left = x ? "-2px" : "1.5px", d.currentTarget.style.right = x ? "-2px" : "1.5px"), x || (d.currentTarget.style.backgroundColor = "#7F7F7F");
703
+ }
704
+ }
705
+ )
402
706
  }
403
707
  )
404
708
  }
709
+ ),
710
+ /* @__PURE__ */ q.jsx(
711
+ "button",
712
+ {
713
+ type: "button",
714
+ className: "flex items-center justify-center text-xs text-[#313131] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[#60a5fa] focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
715
+ style: {
716
+ [s ? "width" : "height"]: h,
717
+ [s ? "height" : "width"]: a,
718
+ backgroundColor: "#E0E0E0"
719
+ },
720
+ "aria-label": s ? "Scroll right" : "Scroll down",
721
+ onMouseDown: oe(1),
722
+ onTouchStart: oe(1),
723
+ onMouseUp: W,
724
+ onMouseLeave: W,
725
+ onTouchEnd: W,
726
+ onTouchCancel: W,
727
+ onKeyDown: ue(1),
728
+ disabled: !w,
729
+ children: /* @__PURE__ */ q.jsx("span", { "aria-hidden": "true", children: s ? "▶" : "▼" })
730
+ }
405
731
  )
406
- }
407
- )
732
+ ]
733
+ }
734
+ );
735
+ }, he = {
736
+ maxVelocity: 6,
737
+ minVelocity: 0.02,
738
+ deceleration: 25e-4,
739
+ velocitySampleWindow: 90,
740
+ startVelocityThreshold: 0.04
741
+ }, nt = Re(({ children: c, contentSize: e, viewportSize: n, scrollBarWidth: r = 12, onScroll: s, className: a, style: i, background: f, tapScrollCircleOptions: p, inertiaOptions: g, itemCount: x }, P) => {
742
+ const S = H(0), [ne, ie] = $e((l) => l + 1, 0), N = H(null), K = H(null), F = H({
743
+ frame: null,
744
+ velocity: 0,
745
+ lastTimestamp: null
746
+ }), m = U(
747
+ () => ({
748
+ maxVelocity: g?.maxVelocity ?? he.maxVelocity,
749
+ minVelocity: g?.minVelocity ?? he.minVelocity,
750
+ deceleration: g?.deceleration ?? he.deceleration,
751
+ velocitySampleWindow: g?.velocitySampleWindow ?? he.velocitySampleWindow,
752
+ startVelocityThreshold: g?.startVelocityThreshold ?? he.startVelocityThreshold
753
+ }),
754
+ [g]
408
755
  );
409
- }, Ie = de(({ children: l, contentSize: e, viewportSize: r, scrollBarWidth: t = 12, onScroll: s, className: a, style: o, background: d }, i) => {
410
- const c = Y(0), [m, v] = be((I) => I + 1, 0), _ = Y(null);
411
- N.debug("[ScrollPane] ScrollPane rendered", { contentSize: e, viewportSize: r, scrollBarWidth: t, className: a, style: o });
412
- const p = ne(() => e > r, [e, r]), S = L(
413
- (I) => {
414
- const k = e > r, f = c.current;
415
- if (N.debug("[ScrollPane] scrollTo called", { newPosition: I, contentSize: e, viewportSize: r, currentIsScrollable: k, prevPosition: f }), !k) {
416
- c.current !== 0 && (c.current = 0, s?.(0, f));
756
+ re.debug("[ScrollPane] ScrollPane rendered", { contentSize: e, viewportSize: n, scrollBarWidth: r, className: a, style: i, tapScrollCircleOptions: p, inertiaOptions: g });
757
+ const Z = H({ contentSize: e, viewportSize: n }), A = U(() => e > n, [e, n]), k = $(
758
+ (l) => {
759
+ const { contentSize: Y, viewportSize: j } = Z.current, L = Y > j, b = S.current;
760
+ if (re.debug("[ScrollPane] scrollTo called", { newPosition: l, contentSize: Y, viewportSize: j, currentIsScrollable: L, prevPosition: b }), !L) {
761
+ S.current !== 0 && (S.current = 0, s?.(0, b));
417
762
  return;
418
763
  }
419
- const P = typeof I == "function" ? I(c.current) : I, V = A(P, 0, e - r);
420
- c.current !== V && (c.current = V, s?.(V, f));
764
+ const E = typeof l == "function" ? l(S.current) : l, M = z(E, 0, Y - j);
765
+ S.current !== M && (S.current = M, s?.(M, b));
421
766
  },
422
- [s, e, r]
767
+ [s]
768
+ ), C = $(() => {
769
+ const l = F.current;
770
+ l.frame !== null && cancelAnimationFrame(l.frame), l.frame = null, l.velocity = 0, l.lastTimestamp = null;
771
+ }, []), B = $(
772
+ (l) => {
773
+ if (!A)
774
+ return;
775
+ const { maxVelocity: Y, minVelocity: j, deceleration: L, startVelocityThreshold: b } = m, E = z(l, -Y, Y);
776
+ if (Math.abs(E) < b)
777
+ return;
778
+ C(), F.current.velocity = E, F.current.lastTimestamp = null;
779
+ const M = (h) => {
780
+ const v = F.current;
781
+ if (v.lastTimestamp === null) {
782
+ v.lastTimestamp = h, v.frame = requestAnimationFrame(M);
783
+ return;
784
+ }
785
+ const I = h - v.lastTimestamp;
786
+ if (v.lastTimestamp = h, I <= 0) {
787
+ v.frame = requestAnimationFrame(M);
788
+ return;
789
+ }
790
+ const t = v.velocity;
791
+ let o = t;
792
+ const T = L * I;
793
+ t > 0 ? o = Math.max(0, t - T) : t < 0 && (o = Math.min(0, t + T));
794
+ const w = (t + o) / 2 * I, V = S.current;
795
+ w !== 0 && k((u) => u + w);
796
+ const D = S.current, { contentSize: _, viewportSize: R } = Z.current, G = Math.max(_ - R, 0);
797
+ v.velocity = o;
798
+ const J = D === V || D <= 0 && o <= 0 || D >= G && o >= 0;
799
+ if (Math.abs(o) < j || J) {
800
+ C();
801
+ return;
802
+ }
803
+ v.frame = requestAnimationFrame(M);
804
+ };
805
+ F.current.frame = requestAnimationFrame(M);
806
+ },
807
+ [A, m, k, C]
423
808
  );
424
- oe(() => {
425
- if (p) {
426
- N.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", { contentSize: e, viewportSize: r, scrollPosition: c.current });
427
- const I = A(e - r, 0, e);
428
- c.current > I && S(I);
809
+ be(() => {
810
+ Z.current = { contentSize: e, viewportSize: n };
811
+ }, [e, n]), be(() => {
812
+ if (A) {
813
+ re.debug("[ScrollPane] Adjusting scroll position due to content or viewport size change", { contentSize: e, viewportSize: n, scrollPosition: S.current });
814
+ const l = z(e - n, 0, e);
815
+ S.current > l && k(l);
429
816
  } else
430
- S(0);
431
- }, [p, S, e, r]), B(() => {
432
- const I = (f) => {
433
- if (!p)
817
+ k(0);
818
+ }, [A, k, e, n]), ae(() => {
819
+ const l = (j) => {
820
+ if (!A)
434
821
  return;
435
- f.preventDefault();
436
- let P = f.deltaY;
437
- f.deltaMode === 1 ? P *= 16 : f.deltaMode === 2 && (P *= r), N.debug("[ScrollPane] wheel event", { deltaY: P, scrollPosition: c.current }), S((V) => V + P);
438
- }, k = _.current;
439
- return k && k.addEventListener("wheel", I, { passive: !1 }), () => {
440
- k && k.removeEventListener("wheel", I);
822
+ j.preventDefault(), C();
823
+ let L = j.deltaY;
824
+ j.deltaMode === 1 ? L *= 16 : j.deltaMode === 2 && (L *= n), re.debug("[ScrollPane] wheel event", { deltaY: L, scrollPosition: S.current }), k((b) => b + L);
825
+ }, Y = N.current;
826
+ return Y && Y.addEventListener("wheel", l, { passive: !1 }), () => {
827
+ Y && Y.removeEventListener("wheel", l);
441
828
  };
442
- }, [p, S, r]), he(
443
- i,
829
+ }, [A, k, C, n]), Ae(
830
+ P,
444
831
  () => ({
445
- scrollTo: S,
446
- getScrollPosition: () => c.current,
832
+ scrollTo: k,
833
+ getScrollPosition: () => S.current,
447
834
  getContentSize: () => e,
448
- getViewportSize: () => r
835
+ getViewportSize: () => n
449
836
  }),
450
- [S, e, r]
837
+ [k, e, n]
451
838
  );
452
- const j = ve();
453
- return ne(() => /* @__PURE__ */ D.jsxs("div", { ref: _, className: ae("flex", a), style: o, children: [
454
- /* @__PURE__ */ D.jsxs("div", { className: "relative h-full flex-1 overflow-hidden", style: { height: r }, id: j, children: [
455
- d,
456
- l(c.current)
839
+ const X = Ue(), se = U(() => /* @__PURE__ */ q.jsxs("div", { ref: N, className: pe("flex", a), style: i, children: [
840
+ /* @__PURE__ */ q.jsxs("div", { ref: K, className: "relative h-full flex-1 overflow-hidden", style: { height: n, touchAction: "none" }, id: X, children: [
841
+ f,
842
+ c(S.current)
457
843
  ] }),
458
- p && /* @__PURE__ */ D.jsx(_e, { contentSize: e, viewportSize: r, scrollPosition: c.current, onScroll: S, scrollBarWidth: t, ariaControls: j })
459
- ] }), [l, e, r, t, a, o, p, S, j, d]);
844
+ A && /* @__PURE__ */ q.jsx(
845
+ rt,
846
+ {
847
+ contentSize: e,
848
+ viewportSize: n,
849
+ scrollPosition: S.current,
850
+ onScroll: k,
851
+ scrollBarWidth: r,
852
+ ariaControls: X,
853
+ tapScrollCircleOptions: p,
854
+ itemCount: x
855
+ }
856
+ )
857
+ ] }), [c, e, n, r, a, i, A, k, X, f, p, x]);
858
+ return ae(() => {
859
+ const l = K.current;
860
+ if (!l)
861
+ return;
862
+ const Y = 6, j = "input, textarea, select, button, a[href], [role='button']";
863
+ let L = null, b = 0, E = 0, M = !1, h = !1, v = !1, I = null, t = [];
864
+ const o = () => {
865
+ L = null, b = 0, E = 0, M = !1, h = !1, t = [];
866
+ }, T = (u) => {
867
+ const ee = performance.now();
868
+ t.push({ clientY: u, time: ee }), t = t.filter((W) => ee - W.time <= m.velocitySampleWindow);
869
+ }, y = (u) => u instanceof HTMLElement ? u.closest("[data-scrollpane-ignore-drag='true']") !== null : !1, w = (u) => u instanceof HTMLElement ? u.closest(j) !== null : !1, V = (u) => {
870
+ v && (u.preventDefault(), u.stopPropagation(), v = !1);
871
+ }, D = (u) => {
872
+ M || (M = !0, h = !1, v = !0, l.hasPointerCapture(u.pointerId) || l.setPointerCapture(u.pointerId), T(u.clientY));
873
+ }, _ = (u) => {
874
+ if (L !== u.pointerId)
875
+ return;
876
+ if (!M) {
877
+ const oe = Math.abs(u.clientY - b);
878
+ if (h && oe < Y)
879
+ return;
880
+ D(u);
881
+ }
882
+ if (!M)
883
+ return;
884
+ T(u.clientY);
885
+ const ee = u.clientY - b, W = E - ee;
886
+ k(W), u.cancelable && u.preventDefault();
887
+ }, R = (u) => {
888
+ if (L !== u.pointerId)
889
+ return;
890
+ M && v && u.cancelable && (u.preventDefault(), u.stopPropagation()), l.hasPointerCapture(u.pointerId) && l.releasePointerCapture(u.pointerId);
891
+ let ee = 0;
892
+ if (M && t.length >= 2) {
893
+ const W = t[t.length - 1], oe = t.find((ue) => W.time - ue.time <= m.velocitySampleWindow) ?? t[0];
894
+ if (W && oe && W.time !== oe.time) {
895
+ const ue = W.clientY - oe.clientY, ge = W.time - oe.time;
896
+ ee = -(ue / ge);
897
+ }
898
+ }
899
+ o(), I !== null && window.clearTimeout(I), v && (I = window.setTimeout(() => {
900
+ v = !1, I = null;
901
+ }, 0)), Math.abs(ee) >= m.startVelocityThreshold && B(ee);
902
+ }, G = (u) => {
903
+ A && (u.button !== 0 && u.pointerType === "mouse" || u.ctrlKey || u.metaKey || u.altKey || y(u.target) || (window.dispatchEvent(new CustomEvent(Pe, { detail: { paneId: X } })), C(), L = u.pointerId, b = u.clientY, E = S.current, h = w(u.target), M = !1, v = !1, t = [], h || (v = !0, D(u), T(u.clientY), u.cancelable && u.preventDefault())));
904
+ }, J = (u) => {
905
+ L === u.pointerId && (v = !1, l.hasPointerCapture(u.pointerId) && l.releasePointerCapture(u.pointerId), I !== null && (window.clearTimeout(I), I = null), o());
906
+ };
907
+ return l.addEventListener("click", V, !0), l.addEventListener("pointerdown", G, { passive: !1 }), l.addEventListener("pointermove", _, { passive: !1 }), l.addEventListener("pointerup", R), l.addEventListener("pointercancel", J), window.addEventListener("pointermove", _, { passive: !1 }), window.addEventListener("pointerup", R), window.addEventListener("pointercancel", J), () => {
908
+ l.removeEventListener("click", V, !0), l.removeEventListener("pointerdown", G), l.removeEventListener("pointermove", _), l.removeEventListener("pointerup", R), l.removeEventListener("pointercancel", J), window.removeEventListener("pointermove", _), window.removeEventListener("pointerup", R), window.removeEventListener("pointercancel", J), L !== null && l.hasPointerCapture(L) && l.releasePointerCapture(L), I !== null && window.clearTimeout(I), C();
909
+ };
910
+ }, [X, A, m, k, B, C]), se;
460
911
  });
461
- class Re {
912
+ class st {
462
913
  /**
463
914
  * @private
464
915
  * @property {Map<number, number>} tree - The Map storing the Fenwick tree structure, specifically the sums of deltas. It is 1-indexed.
@@ -498,8 +949,8 @@ class Re {
498
949
  * @param {number | ((index: number) => number)} valueOrFn - The value for all elements, or a function to generate values.
499
950
  * @param {{ sampleRange?: { from: number; to: number }, materialize?: boolean }} [options] - Optional settings for initialization.
500
951
  */
501
- constructor(e, r, t) {
502
- this.reset(e, r, t);
952
+ constructor(e, n, r) {
953
+ this.reset(e, n, r);
503
954
  }
504
955
  /**
505
956
  * @method reset
@@ -509,26 +960,26 @@ class Re {
509
960
  * @param {number | ((index: number) => number)} valueOrFn - The value for all elements, or a function to generate values.
510
961
  * @param {{ sampleRange?: { from: number; to: number }, materialize?: boolean }} [options] - Optional settings for initialization.
511
962
  */
512
- reset(e, r, t) {
513
- if (this.size = e, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, typeof r == "function") {
514
- if (this.valueFn = r, this.size > 0) {
515
- const a = t?.sampleRange ?? {
963
+ reset(e, n, r) {
964
+ if (this.size = e, this.tree = /* @__PURE__ */ new Map(), this.deltas = /* @__PURE__ */ new Map(), this.total = void 0, typeof n == "function") {
965
+ if (this.valueFn = n, this.size > 0) {
966
+ const a = r?.sampleRange ?? {
516
967
  from: 0,
517
968
  to: Math.min(99, this.size - 1)
518
- }, { mode: o, materializedValues: d } = this._calculateMode(a.from, a.to);
519
- if (this.baseValue = o, t?.materialize)
520
- for (let i = 0; i < d.length; i++) {
521
- const c = d[i], m = a.from + i;
522
- if (m >= this.size)
969
+ }, { mode: i, materializedValues: f } = this._calculateMode(a.from, a.to);
970
+ if (this.baseValue = i, r?.materialize)
971
+ for (let p = 0; p < f.length; p++) {
972
+ const g = f[p], x = a.from + p;
973
+ if (x >= this.size)
523
974
  break;
524
- const v = c - this.baseValue;
525
- this.deltas.set(m, v), this._updateTree(m, v);
975
+ const P = g - this.baseValue;
976
+ this.deltas.set(x, P), this._updateTree(x, P);
526
977
  }
527
978
  } else
528
979
  this.baseValue = 0;
529
980
  this.total = this.getTotal();
530
981
  } else
531
- this.valueFn = void 0, this.baseValue = r, this.total = this.baseValue * this.size;
982
+ this.valueFn = void 0, this.baseValue = n, this.total = this.baseValue * this.size;
532
983
  }
533
984
  /**
534
985
  * @method setValueFn
@@ -548,33 +999,33 @@ class Re {
548
999
  * @param {number} to - The ending index of the range (inclusive).
549
1000
  * @returns {{ mode: number; materializedValues: number[] }} An object containing the calculated mode and the array of generated values.
550
1001
  */
551
- _calculateMode(e, r) {
1002
+ _calculateMode(e, n) {
552
1003
  if (!this.valueFn)
553
1004
  return { mode: 0, materializedValues: [] };
554
- const t = [];
555
- for (let c = e; c <= r && !(c >= this.size); c++)
556
- t.push(this.valueFn(c));
557
- const s = [...t];
558
- if (t.length === 0)
1005
+ const r = [];
1006
+ for (let g = e; g <= n && !(g >= this.size); g++)
1007
+ r.push(this.valueFn(g));
1008
+ const s = [...r];
1009
+ if (r.length === 0)
559
1010
  return { mode: 0, materializedValues: [] };
560
- t.sort((c, m) => c - m);
561
- const a = Math.floor(t.length / 2);
562
- let o;
563
- t.length % 2 === 0 ? o = Math.floor((t[a - 1] + t[a]) / 2) : o = t[a];
564
- const d = /* @__PURE__ */ new Map();
565
- let i = 0;
566
- for (const c of t) {
567
- const m = (d.get(c) ?? 0) + 1;
568
- d.set(c, m), m > i && (i = m);
1011
+ r.sort((g, x) => g - x);
1012
+ const a = Math.floor(r.length / 2);
1013
+ let i;
1014
+ r.length % 2 === 0 ? i = Math.floor((r[a - 1] + r[a]) / 2) : i = r[a];
1015
+ const f = /* @__PURE__ */ new Map();
1016
+ let p = 0;
1017
+ for (const g of r) {
1018
+ const x = (f.get(g) ?? 0) + 1;
1019
+ f.set(g, x), x > p && (p = x);
569
1020
  }
570
- if (i > 1) {
571
- const c = [];
572
- for (const [v, _] of d.entries())
573
- _ === i && c.push(v);
574
- const m = c.reduce((v, _) => v + _, 0);
575
- o = Math.floor(m / c.length);
1021
+ if (p > 1) {
1022
+ const g = [];
1023
+ for (const [P, S] of f.entries())
1024
+ S === p && g.push(P);
1025
+ const x = g.reduce((P, S) => P + S, 0);
1026
+ i = Math.floor(x / g.length);
576
1027
  }
577
- return { mode: o, materializedValues: s };
1028
+ return { mode: i, materializedValues: s };
578
1029
  }
579
1030
  /**
580
1031
  * @method update
@@ -583,8 +1034,8 @@ class Re {
583
1034
  * @param {number} index - The 0-based index to update.
584
1035
  * @param {number} value - The new value.
585
1036
  */
586
- update(e, r) {
587
- return this.updates([{ index: e, value: r }]);
1037
+ update(e, n) {
1038
+ return this.updates([{ index: e, value: n }]);
588
1039
  }
589
1040
  /**
590
1041
  * @method updates
@@ -593,15 +1044,15 @@ class Re {
593
1044
  * @param {{ index: number; value: number }[]} updates - An array of updates, each with an index and the new value.
594
1045
  */
595
1046
  updates(e) {
596
- const r = e.map(({ index: t, value: s }) => {
597
- if (t < 0 || t >= this.size)
598
- throw new Error(`Index ${t} out of bounds`);
1047
+ const n = e.map(({ index: r, value: s }) => {
1048
+ if (r < 0 || r >= this.size)
1049
+ throw new Error(`Index ${r} out of bounds`);
599
1050
  if (s < 0)
600
1051
  throw new Error("Value cannot be negative.");
601
- const a = this.deltas.has(t) ? (this.deltas.get(t) ?? 0) + this.baseValue : this.baseValue, o = s - a;
602
- return { index: t, change: o };
603
- }).filter((t) => t.change !== 0);
604
- return r.length > 0 ? this.updateDeltas(r) : this.total;
1052
+ const a = this.deltas.has(r) ? (this.deltas.get(r) ?? 0) + this.baseValue : this.baseValue, i = s - a;
1053
+ return { index: r, change: i };
1054
+ }).filter((r) => r.change !== 0);
1055
+ return n.length > 0 ? this.updateDeltas(n) : this.total;
605
1056
  }
606
1057
  /**
607
1058
  * @method updateDelta
@@ -610,8 +1061,8 @@ class Re {
610
1061
  * @param {number} index - The 0-based index to update.
611
1062
  * @param {number} change - The value to add to the delta at the given index.
612
1063
  */
613
- updateDelta(e, r) {
614
- return this.updateDeltas([{ index: e, change: r }]);
1064
+ updateDelta(e, n) {
1065
+ return this.updateDeltas([{ index: e, change: n }]);
615
1066
  }
616
1067
  /**
617
1068
  * @method updateDeltas
@@ -620,11 +1071,11 @@ class Re {
620
1071
  * @param {{ index: number; change: number }[]} updates - An array of updates, each with an index and the change to apply.
621
1072
  */
622
1073
  updateDeltas(e) {
623
- for (const { index: r, change: t } of e) {
624
- if (r < 0 || r >= this.size)
625
- throw new Error(`Index ${r} out of bounds`);
626
- const s = this.deltas.get(r) ?? 0;
627
- this.deltas.set(r, s + t), this._updateTree(r, t);
1074
+ for (const { index: n, change: r } of e) {
1075
+ if (n < 0 || n >= this.size)
1076
+ throw new Error(`Index ${n} out of bounds`);
1077
+ const s = this.deltas.get(n) ?? 0;
1078
+ this.deltas.set(n, s + r), this._updateTree(n, r);
628
1079
  }
629
1080
  return this.total;
630
1081
  }
@@ -636,13 +1087,13 @@ class Re {
636
1087
  * @param {number} index - The 0-based index that changed.
637
1088
  * @param {number} change - The change in value.
638
1089
  */
639
- _updateTree(e, r) {
640
- if (r === 0)
1090
+ _updateTree(e, n) {
1091
+ if (n === 0)
641
1092
  return;
642
- let t = e + 1;
643
- for (; t <= this.size; )
644
- this.tree.set(t, (this.tree.get(t) ?? 0) + r), t += t & -t;
645
- this.total !== void 0 && (this.total += r);
1093
+ let r = e + 1;
1094
+ for (; r <= this.size; )
1095
+ this.tree.set(r, (this.tree.get(r) ?? 0) + n), r += r & -r;
1096
+ this.total !== void 0 && (this.total += n);
646
1097
  }
647
1098
  /**
648
1099
  * @private
@@ -652,12 +1103,12 @@ class Re {
652
1103
  * @param {number} index - The 0-based index to materialize.
653
1104
  * @param {boolean} [updateTree=true] - Whether to update the Fenwick tree after materialization.
654
1105
  */
655
- _materialize(e, r = !0) {
1106
+ _materialize(e, n = !0) {
656
1107
  if (this.valueFn) {
657
- const t = this.deltas.get(e) ?? 0, a = this.valueFn(e) - this.baseValue;
658
- if (a !== t && (this.deltas.set(e, a), r)) {
659
- const o = a - t;
660
- this._updateTree(e, o);
1108
+ const r = this.deltas.get(e) ?? 0, a = this.valueFn(e) - this.baseValue;
1109
+ if (a !== r && (this.deltas.set(e, a), n)) {
1110
+ const i = a - r;
1111
+ this._updateTree(e, i);
661
1112
  }
662
1113
  }
663
1114
  }
@@ -674,26 +1125,26 @@ class Re {
674
1125
  * @param {number} options.materializeOption.ranges.to - The ending index of the range.
675
1126
  * @returns {{ cumulative: number; total: number | undefined; currentValue: number; safeIndex: number }} The cumulative sum of values from index 0 to the given index, the total sum, and the value at the given index.
676
1127
  */
677
- prefixSum(e, r) {
1128
+ prefixSum(e, n) {
678
1129
  if (e < 0)
679
1130
  return { cumulative: 0, total: this.total, currentValue: 0, safeIndex: 0 };
680
- const t = A(e, 0, this.size - 1), s = r?.materializeOption;
1131
+ const r = z(e, 0, this.size - 1), s = n?.materializeOption;
681
1132
  if (s?.materialize && this.valueFn) {
682
1133
  if (s.ranges)
683
- for (const i of s.ranges) {
684
- const c = i.from, m = Math.min(i.to, this.size - 1);
685
- for (let v = c; v <= m; v++)
686
- this._materialize(v);
1134
+ for (const p of s.ranges) {
1135
+ const g = p.from, x = Math.min(p.to, this.size - 1);
1136
+ for (let P = g; P <= x; P++)
1137
+ this._materialize(P);
687
1138
  }
688
- this._materialize(t);
1139
+ this._materialize(r);
689
1140
  }
690
- let a = 0, o = t + 1;
691
- for (; o > 0; ) {
692
- const i = this.tree.get(o) ?? 0;
693
- a += i, o -= o & -o;
1141
+ let a = 0, i = r + 1;
1142
+ for (; i > 0; ) {
1143
+ const p = this.tree.get(i) ?? 0;
1144
+ a += p, i -= i & -i;
694
1145
  }
695
- const d = s?.materialize ? this.get(t) : (this.deltas.get(t) || 0) + this.baseValue;
696
- return { cumulative: a + this.baseValue * (t + 1), total: this.total, currentValue: d, safeIndex: t };
1146
+ const f = s?.materialize ? this.get(r) : (this.deltas.get(r) || 0) + this.baseValue;
1147
+ return { cumulative: a + this.baseValue * (r + 1), total: this.total, currentValue: f, safeIndex: r };
697
1148
  }
698
1149
  /**
699
1150
  * @method get
@@ -708,18 +1159,18 @@ class Re {
708
1159
  * @param {number} options.materializeOption.ranges.to - The ending index of the range.
709
1160
  * @returns {number} The value at the given index.
710
1161
  */
711
- get(e, r) {
1162
+ get(e, n) {
712
1163
  if (e < 0 || e >= this.size)
713
1164
  throw new Error("Index out of bounds");
714
- const t = r?.materializeOption;
715
- if (t?.materialize && this.valueFn)
716
- if (t.ranges) {
717
- for (const s of t.ranges) {
718
- const a = s.from, o = Math.min(s.to, this.size - 1);
719
- for (let d = a; d <= o; d++)
720
- this._materialize(d);
1165
+ const r = n?.materializeOption;
1166
+ if (r?.materialize && this.valueFn)
1167
+ if (r.ranges) {
1168
+ for (const s of r.ranges) {
1169
+ const a = s.from, i = Math.min(s.to, this.size - 1);
1170
+ for (let f = a; f <= i; f++)
1171
+ this._materialize(f);
721
1172
  }
722
- e >= t.ranges[0].from && e <= t.ranges[t.ranges.length - 1].to && this._materialize(e);
1173
+ e >= r.ranges[0].from && e <= r.ranges[r.ranges.length - 1].to && this._materialize(e);
723
1174
  } else
724
1175
  this._materialize(e);
725
1176
  return (this.deltas.get(e) ?? 0) + this.baseValue;
@@ -737,21 +1188,21 @@ class Re {
737
1188
  * @returns {number} The total sum of all values.
738
1189
  */
739
1190
  getTotal(e) {
740
- const r = e?.materializeOption;
741
- if (r?.materialize && this.valueFn && r.ranges)
742
- for (const t of r.ranges) {
743
- const s = t.from, a = Math.min(t.to, this.size - 1);
744
- for (let o = s; o <= a; o++)
745
- this._materialize(o);
1191
+ const n = e?.materializeOption;
1192
+ if (n?.materialize && this.valueFn && n.ranges)
1193
+ for (const r of n.ranges) {
1194
+ const s = r.from, a = Math.min(r.to, this.size - 1);
1195
+ for (let i = s; i <= a; i++)
1196
+ this._materialize(i);
746
1197
  }
747
1198
  if (this.total === void 0)
748
1199
  if (this.size === 0)
749
1200
  this.total = 0;
750
1201
  else {
751
- let t = this.baseValue * this.size;
1202
+ let r = this.baseValue * this.size;
752
1203
  for (const s of this.deltas.values())
753
- t += s;
754
- this.total = t, console.assert(this.prefixSum(this.getSize() - 1).cumulative === this.prefixSum(this.getSize() - 1).total, "Inconsistent Fenwick Tree state");
1204
+ r += s;
1205
+ this.total = r, console.assert(this.prefixSum(this.getSize() - 1).cumulative === this.prefixSum(this.getSize() - 1).total, "Inconsistent Fenwick Tree state");
755
1206
  }
756
1207
  return this.total;
757
1208
  }
@@ -768,16 +1219,16 @@ class Re {
768
1219
  this.reset(this.size, (a) => s(a), { materialize: !0 });
769
1220
  return;
770
1221
  }
771
- const r = /* @__PURE__ */ new Map();
772
- let t = this.baseValue * this.size;
1222
+ const n = /* @__PURE__ */ new Map();
1223
+ let r = this.baseValue * this.size;
773
1224
  for (const [s, a] of this.deltas.entries()) {
774
- if (t += a, a === 0)
1225
+ if (r += a, a === 0)
775
1226
  continue;
776
- let o = s + 1;
777
- for (; o <= this.size; )
778
- r.set(o, (r.get(o) ?? 0) + a), o += o & -o;
1227
+ let i = s + 1;
1228
+ for (; i <= this.size; )
1229
+ n.set(i, (n.get(i) ?? 0) + a), i += i & -i;
779
1230
  }
780
- this.tree = r, this.total = t;
1231
+ this.tree = n, this.total = r;
781
1232
  }
782
1233
  /**
783
1234
  * @method calculateAccumulatedError
@@ -789,8 +1240,8 @@ class Re {
789
1240
  if (this.total === void 0)
790
1241
  return 0;
791
1242
  let e = this.baseValue * this.size;
792
- for (const r of this.deltas.values())
793
- e += r;
1243
+ for (const n of this.deltas.values())
1244
+ e += n;
794
1245
  return this.total - e;
795
1246
  }
796
1247
  /**
@@ -800,11 +1251,11 @@ class Re {
800
1251
  * @param {number} newSize - The new size of the tree.
801
1252
  */
802
1253
  changeSize(e) {
803
- const r = this.size;
804
- if (e !== r) {
805
- if (e < r)
806
- for (const t of this.deltas.keys())
807
- t >= e && this.deltas.delete(t);
1254
+ const n = this.size;
1255
+ if (e !== n) {
1256
+ if (e < n)
1257
+ for (const r of this.deltas.keys())
1258
+ r >= e && this.deltas.delete(r);
808
1259
  this.size = e, this.rebuildTree(), console.assert(this.prefixSum(this.getSize() - 1).cumulative === this.prefixSum(this.getSize() - 1).total, "Inconsistent Fenwick Tree state");
809
1260
  }
810
1261
  }
@@ -830,15 +1281,15 @@ class Re {
830
1281
  * @param {number} options.materializeOption.ranges.to - The ending index of the range.
831
1282
  * @returns {{ index: number, total: number | undefined, cumulative: number | undefined, currentValue: number | undefined, safeIndex: number | undefined }} The 0-based index and the total sum, or -1 if not found.
832
1283
  */
833
- findIndexAtOrAfter(e, r) {
1284
+ findIndexAtOrAfter(e, n) {
834
1285
  if (this.size === 0)
835
1286
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
836
- let t = 0, s = this.size - 1, a = -1, o, d = this.total;
837
- for (; t <= s; ) {
838
- const i = Math.floor((t + s) / 2);
839
- o = this.prefixSum(i, r), d = o.total, o.cumulative >= e ? (a = i, s = i - 1) : t = i + 1;
1287
+ let r = 0, s = this.size - 1, a = -1, i, f = this.total;
1288
+ for (; r <= s; ) {
1289
+ const p = Math.floor((r + s) / 2);
1290
+ i = this.prefixSum(p, n), f = i.total, i.cumulative >= e ? (a = p, s = p - 1) : r = p + 1;
840
1291
  }
841
- return { index: a, total: d, cumulative: o?.cumulative, currentValue: o?.currentValue, safeIndex: o?.safeIndex };
1292
+ return { index: a, total: f, cumulative: i?.cumulative, currentValue: i?.currentValue, safeIndex: i?.safeIndex };
842
1293
  }
843
1294
  /**
844
1295
  * @method findIndexAtOrBefore
@@ -853,161 +1304,175 @@ class Re {
853
1304
  * @param {number} options.materializeOption.ranges.to - The ending index of the range.
854
1305
  * @returns {{ index: number, total: number | undefined, cumulative: number | undefined, currentValue: number | undefined, safeIndex: number | undefined }} The 0-based index and the total sum, or -1 if not found.
855
1306
  */
856
- findIndexAtOrBefore(e, r) {
1307
+ findIndexAtOrBefore(e, n) {
857
1308
  if (this.size === 0)
858
1309
  return { index: -1, total: this.total ?? 0, cumulative: void 0, currentValue: void 0, safeIndex: void 0 };
859
- let t = 0, s = this.size - 1, a = -1, o, d = this.total;
860
- for (; t <= s; ) {
861
- const i = Math.floor((t + s) / 2);
862
- o = this.prefixSum(i, r), d = o.total, o.cumulative <= e ? (a = i, t = i + 1) : s = i - 1;
1310
+ let r = 0, s = this.size - 1, a = -1, i, f = this.total;
1311
+ for (; r <= s; ) {
1312
+ const p = Math.floor((r + s) / 2);
1313
+ i = this.prefixSum(p, n), f = i.total, i.cumulative <= e ? (a = p, r = p + 1) : s = p - 1;
863
1314
  }
864
- return { index: a, total: d, cumulative: o?.cumulative, currentValue: o?.currentValue, safeIndex: o?.safeIndex };
1315
+ return { index: a, total: f, cumulative: i?.cumulative, currentValue: i?.currentValue, safeIndex: i?.safeIndex };
865
1316
  }
866
1317
  }
867
- const Se = (l, e, r) => {
868
- const t = Math.max(0, l), s = Y(null), a = ne(() => new Re(t, e, r), [t, e, r]);
1318
+ const ot = (c, e, n) => {
1319
+ const r = Math.max(0, c), s = H(null), a = U(() => new st(r, e, n), [r, e, n]);
869
1320
  return Object.is(s.current, a) || console.warn("[useFenwickMapTree] instance changed"), s.current = a, a;
870
1321
  };
871
- function ke({ itemCount: l, getItem: e, getItemHeight: r, viewportSize: t, overscanCount: s = 5, className: a, onScroll: o, onRangeChange: d, children: i, background: c, initialScrollIndex: m, initialScrollOffset: v }, _) {
872
- const p = Y(null), S = Y(!1);
873
- B(() => (S.current = !0, () => {
874
- S.current = !1;
1322
+ function at({ itemCount: c, getItem: e, getItemHeight: n, viewportSize: r, overscanCount: s = 5, className: a, onScroll: i, onRangeChange: f, children: p, background: g, initialScrollIndex: x, initialScrollOffset: P, tapScrollCircleOptions: S, inertiaOptions: ne }, ie) {
1323
+ const N = H(null), K = H(!1);
1324
+ ae(() => (K.current = !0, () => {
1325
+ K.current = !1;
875
1326
  }), []);
876
- const j = Y({ size: l, valueOrFn: r, options: { sampleRange: { from: 0, to: 100 } } }), b = Se(j.current.size, j.current.valueOrFn, j.current.options), [I] = X(() => {
877
- let g = 0, E = 0;
878
- if (typeof m == "number") {
879
- const y = A(m, 0, l - 1), O = A(y - s * 2, 0, l - 1), M = A(y + s * 2, 0, l - 1), n = m > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: O, to: M }] } } : void 0, { cumulative: u, total: h, currentValue: x } = b.prefixSum(m, n);
880
- g = u - x, E = h ?? b.getTotal();
881
- } else typeof v == "number" && (g = v), E = b.getTotal();
882
- return { position: g, total: E };
883
- }), [k, f] = X(I.position), [P, V] = X(I.total), [C, $] = X(I.position), [w, J] = X(l);
884
- oe(() => {
885
- b.setValueFn(r), w !== l && (b.changeSize(l), J(l));
886
- const g = b.getTotal();
887
- P !== g && V(g);
888
- }, [b, w, l, P, r]), oe(() => {
889
- C !== null && p.current && (N.debug("[VirtualScroll] Scrolling to position:", C), p.current.scrollTo(C), $(null));
890
- }, [C]);
891
- const H = L(
892
- (g) => {
893
- if (p.current) {
894
- N.debug("[VirtualScroll] Scrolling to index:", g);
895
- const E = A(g, 0, w - 1), y = A(E - s * 2, 0, w - 1), O = A(E + s * 2, 0, w - 1), { cumulative: M, total: n, currentValue: u } = b.prefixSum(E, { materializeOption: { materialize: !0, ranges: [{ from: y, to: O }] } });
896
- N.debug("[VirtualScroll] Scrolling to index:", g, "Offset:", M, "Total height:", n, "Current value:", u, "safeIndex:", E, "safeIndexFrom:", y, "safeIndexTo:", O), n && (V(n), $(M - u)), N.debug("[VirtualScroll] Setting scroll position to:", M - u);
1327
+ const F = H({ size: c, valueOrFn: n, options: { sampleRange: { from: 0, to: 100 } } }), m = ot(F.current.size, F.current.valueOrFn, F.current.options), [Z] = le(() => {
1328
+ let h = 0, v = 0;
1329
+ if (typeof x == "number") {
1330
+ const I = z(x, 0, c - 1), t = z(I - s * 2, 0, c - 1), o = z(I + s * 2, 0, c - 1), T = x > 0 ? { materializeOption: { materialize: !0, ranges: [{ from: t, to: o }] } } : void 0, { cumulative: y, total: w, currentValue: V } = m.prefixSum(x, T);
1331
+ h = y - V, v = w ?? m.getTotal();
1332
+ } else typeof P == "number" && (h = P), v = m.getTotal();
1333
+ return { position: h, total: v };
1334
+ }), [A, k] = le(Z.position), [C, B] = le(Z.total), [X, se] = le(Z.position), [l, Y] = le(c);
1335
+ be(() => {
1336
+ m.setValueFn(n), l !== c && (m.changeSize(c), Y(c));
1337
+ const h = m.getTotal();
1338
+ C !== h && B(h);
1339
+ }, [m, l, c, C, n]), be(() => {
1340
+ X !== null && N.current && (re.debug("[VirtualScroll] Scrolling to position:", X), N.current.scrollTo(X), se(null));
1341
+ }, [X]);
1342
+ const j = $(
1343
+ (h) => {
1344
+ if (N.current) {
1345
+ re.debug("[VirtualScroll] Scrolling to index:", h);
1346
+ const v = z(h, 0, l - 1), I = z(v - s * 2, 0, l - 1), t = z(v + s * 2, 0, l - 1), { cumulative: o, total: T, currentValue: y } = m.prefixSum(v, { materializeOption: { materialize: !0, ranges: [{ from: I, to: t }] } });
1347
+ re.debug("[VirtualScroll] Scrolling to index:", h, "Offset:", o, "Total height:", T, "Current value:", y, "safeIndex:", v, "safeIndexFrom:", I, "safeIndexTo:", t), T && (B(T), se(o - y)), re.debug("[VirtualScroll] Setting scroll position to:", o - y);
897
1348
  }
898
1349
  },
899
- [b, s, w]
900
- ), U = L(
901
- (g) => {
902
- if (p.current) {
903
- const E = b.getTotal(), y = A(Math.floor(g), 0, E), O = b.findIndexAtOrAfter(y, { materializeOption: { materialize: !1 } }).index;
904
- H(O);
1350
+ [m, s, l]
1351
+ ), L = $(
1352
+ (h) => {
1353
+ if (N.current) {
1354
+ const v = m.getTotal(), I = z(Math.floor(h), 0, v), t = m.findIndexAtOrAfter(I, { materializeOption: { materialize: !1 } }).index;
1355
+ j(t);
905
1356
  }
906
1357
  },
907
- [b, H]
908
- ), Z = L(
909
- (g, E) => {
910
- N.debug("[VirtualScroll] Scroll position changed:", g), f(g);
911
- const y = b.getTotal();
912
- o?.(g, y);
1358
+ [m, j]
1359
+ ), b = $(
1360
+ (h, v) => {
1361
+ re.debug("[VirtualScroll] Scroll position changed:", h), k(h);
1362
+ const I = m.getTotal();
1363
+ i?.(h, I);
913
1364
  },
914
- [b, o]
915
- ), F = ne(() => {
916
- if (w === 0)
1365
+ [m, i]
1366
+ ), E = U(() => {
1367
+ if (l === 0)
917
1368
  return { renderingStartIndex: 0, renderingEndIndex: 0, visibleStartIndex: 0, visibleEndIndex: 0 };
918
- const { index: g, cumulative: E, currentValue: y } = b.findIndexAtOrAfter(k, { materializeOption: { materialize: !1 } });
919
- let O = 0;
920
- g === -1 ? O = 0 : (E ?? 0) < k + (y ?? 0) ? O = 1 : O = 0;
921
- const M = g === -1 ? 0 : g + O, n = A(M - s, 0, w - 1);
922
- let u = 0, h = g === -1 ? 0 : g + O;
923
- for (; h < w && u < t; ) {
924
- const z = r(h);
925
- u += z, h++;
1369
+ const { index: h, cumulative: v, currentValue: I } = m.findIndexAtOrAfter(A, { materializeOption: { materialize: !1 } });
1370
+ let t = 0;
1371
+ h === -1 ? t = 0 : (v ?? 0) < A + (I ?? 0) ? t = 1 : t = 0;
1372
+ const o = h === -1 ? 0 : h + t, T = z(o - s, 0, l - 1);
1373
+ let y = 0, w = h === -1 ? 0 : h + t;
1374
+ for (; w < l && y < r; ) {
1375
+ const D = n(w);
1376
+ y += D, w++;
926
1377
  }
927
- h -= 1;
928
- const x = A(h + s, 0, w - 1);
929
- return N.debug("[VirtualScroll] Calculated rendering range:", {
930
- renderingStartIndex: n,
931
- renderingEndIndex: x,
932
- visibleStartIndex: M,
933
- visibleEndIndex: h,
934
- scrollPosition: k,
935
- renderingContentSize: b.getTotal(),
1378
+ w -= 1;
1379
+ const V = z(w + s, 0, l - 1);
1380
+ return re.debug("[VirtualScroll] Calculated rendering range:", {
1381
+ renderingStartIndex: T,
1382
+ renderingEndIndex: V,
1383
+ visibleStartIndex: o,
1384
+ visibleEndIndex: w,
1385
+ scrollPosition: A,
1386
+ renderingContentSize: m.getTotal(),
936
1387
  overscanCount: s,
937
- viewportSize: t
938
- }), { renderingStartIndex: n, renderingEndIndex: x, visibleStartIndex: M, visibleEndIndex: h };
939
- }, [k, s, t, r, b, w]);
940
- B(() => {
941
- const g = p.current?.getScrollPosition() ?? 0;
942
- N.debug("[VirtualScroll] Range change effect triggered", {
943
- renderingStartIndex: F.renderingStartIndex,
944
- renderingEndIndex: F.renderingEndIndex,
945
- visibleStartIndex: F.visibleStartIndex,
946
- visibleEndIndex: F.visibleEndIndex,
947
- scrollPosition: k,
948
- contentSize: P,
949
- scrollPaneScrollPosition: g
950
- }), d?.(F.renderingStartIndex, F.renderingEndIndex, F.visibleStartIndex, F.visibleEndIndex, k, P);
951
- }, [F.renderingStartIndex, F.renderingEndIndex, F.visibleStartIndex, F.visibleEndIndex, d, k, P]);
952
- const Q = L(
953
- (g) => {
954
- const { renderingStartIndex: E, renderingEndIndex: y } = F;
955
- if (N.debug("[VirtualScroll] Rendering visible items", { currentScrollPosition: g, renderingStartIndex: E, renderingEndIndex: y, fenwickSize: w, viewportSize: t }), w === 0)
956
- return /* @__PURE__ */ D.jsx("div", { className: "absolute w-full", style: { top: 0 }, children: /* @__PURE__ */ D.jsx("div", { className: "text-center text-gray-500", children: "No items" }) });
957
- const O = A(E, 0, w - 1), { cumulative: M, currentValue: n } = b.prefixSum(O, { materializeOption: { materialize: !1 } }), u = M - n, h = [], x = [];
958
- for (let T = E; T <= y; T++) {
959
- const q = r(T);
960
- h.push({ item: e(T), height: q }), b.get(T) !== q && x.push({ index: T, value: q });
1388
+ viewportSize: r
1389
+ }), { renderingStartIndex: T, renderingEndIndex: V, visibleStartIndex: o, visibleEndIndex: w };
1390
+ }, [A, s, r, n, m, l]);
1391
+ ae(() => {
1392
+ const h = N.current?.getScrollPosition() ?? 0;
1393
+ re.debug("[VirtualScroll] Range change effect triggered", {
1394
+ renderingStartIndex: E.renderingStartIndex,
1395
+ renderingEndIndex: E.renderingEndIndex,
1396
+ visibleStartIndex: E.visibleStartIndex,
1397
+ visibleEndIndex: E.visibleEndIndex,
1398
+ scrollPosition: A,
1399
+ contentSize: C,
1400
+ scrollPaneScrollPosition: h
1401
+ }), f?.(E.renderingStartIndex, E.renderingEndIndex, E.visibleStartIndex, E.visibleEndIndex, A, C);
1402
+ }, [E.renderingStartIndex, E.renderingEndIndex, E.visibleStartIndex, E.visibleEndIndex, f, A, C]);
1403
+ const M = $(
1404
+ (h) => {
1405
+ const { renderingStartIndex: v, renderingEndIndex: I } = E;
1406
+ if (re.debug("[VirtualScroll] Rendering visible items", { currentScrollPosition: h, renderingStartIndex: v, renderingEndIndex: I, fenwickSize: l, viewportSize: r }), l === 0)
1407
+ return /* @__PURE__ */ q.jsx("div", { className: "absolute w-full", style: { top: 0 }, children: /* @__PURE__ */ q.jsx("div", { className: "text-center text-gray-500", children: "No items" }) });
1408
+ const t = z(v, 0, l - 1), { cumulative: o, currentValue: T } = m.prefixSum(t, { materializeOption: { materialize: !1 } }), y = o - T, w = [], V = [];
1409
+ for (let _ = v; _ <= I; _++) {
1410
+ const R = n(_);
1411
+ w.push({ item: e(_), height: R }), m.get(_) !== R && V.push({ index: _, value: R });
961
1412
  }
962
- x.length > 0 && Promise.resolve().then(() => {
963
- const T = b.updates(x);
964
- T && (V(T), N.debug("[VirtualScroll] Updated heights for items", x, "New total height:", T));
1413
+ V.length > 0 && Promise.resolve().then(() => {
1414
+ const _ = m.updates(V);
1415
+ _ && (B(_), re.debug("[VirtualScroll] Updated heights for items", V, "New total height:", _));
965
1416
  });
966
- const z = P < t ? 0 : u - g;
967
- return N.debug("[VirtualScroll] Rendering items", { visibleItems: h, containerTop: z }), /* @__PURE__ */ D.jsx("div", { className: "absolute w-full", style: { top: z }, children: h.map(({ item: T, height: q }, G) => {
968
- const R = E + G, W = A(R, 0, w - 1), { cumulative: K, currentValue: se } = b.prefixSum(W, { materializeOption: { materialize: !1 } }), me = K - se;
969
- return /* @__PURE__ */ D.jsx(
1417
+ const D = C < r ? 0 : y - h;
1418
+ return re.debug("[VirtualScroll] Rendering items", { visibleItems: w, containerTop: D }), /* @__PURE__ */ q.jsx("div", { className: "absolute w-full", style: { top: D }, children: w.map(({ item: _, height: R }, G) => {
1419
+ const J = v + G, u = z(J, 0, l - 1), { cumulative: ee, currentValue: W } = m.prefixSum(u, { materializeOption: { materialize: !1 } }), oe = ee - W;
1420
+ return /* @__PURE__ */ q.jsx(
970
1421
  "div",
971
1422
  {
972
- "data-index": R,
1423
+ "data-index": J,
973
1424
  style: {
974
1425
  position: "absolute",
975
- top: me - u,
1426
+ top: oe - y,
976
1427
  width: "100%"
977
1428
  },
978
- children: i(T, R)
1429
+ children: p(_, J)
979
1430
  },
980
- R
1431
+ J
981
1432
  );
982
1433
  }) });
983
1434
  },
984
- [e, i, P, t, F, b, w, r]
1435
+ [e, p, C, r, E, m, l, n]
985
1436
  );
986
- return he(
987
- _,
1437
+ return Ae(
1438
+ ie,
988
1439
  () => ({
989
- getScrollPosition: () => p.current?.getScrollPosition() ?? -1,
990
- getContentSize: () => p.current?.getContentSize() ?? -1,
991
- getViewportSize: () => p.current?.getViewportSize() ?? -1,
992
- scrollTo: (g) => U(g),
993
- scrollToIndex: (g) => H(g),
994
- getFenwickTreeTotalHeight: () => b.getTotal(),
995
- getFenwickSize: () => b.getSize()
1440
+ getScrollPosition: () => N.current?.getScrollPosition() ?? -1,
1441
+ getContentSize: () => N.current?.getContentSize() ?? -1,
1442
+ getViewportSize: () => N.current?.getViewportSize() ?? -1,
1443
+ scrollTo: (h) => L(h),
1444
+ scrollToIndex: (h) => j(h),
1445
+ getFenwickTreeTotalHeight: () => m.getTotal(),
1446
+ getFenwickSize: () => m.getSize()
996
1447
  }),
997
- [H, b, U]
998
- ), /* @__PURE__ */ D.jsx(Ie, { ref: p, contentSize: P, viewportSize: t, className: a, onScroll: Z, background: c, children: Q });
1448
+ [j, m, L]
1449
+ ), /* @__PURE__ */ q.jsx(
1450
+ nt,
1451
+ {
1452
+ ref: N,
1453
+ contentSize: C,
1454
+ viewportSize: r,
1455
+ className: a,
1456
+ onScroll: b,
1457
+ background: g,
1458
+ tapScrollCircleOptions: S,
1459
+ inertiaOptions: ne,
1460
+ itemCount: c,
1461
+ children: M
1462
+ }
1463
+ );
999
1464
  }
1000
- const Fe = de(ke);
1001
- class Pe {
1465
+ const ft = Re(at);
1466
+ class it {
1002
1467
  key;
1003
1468
  value;
1004
1469
  prev = null;
1005
1470
  next = null;
1006
- constructor(e, r) {
1007
- this.key = e, this.value = r;
1471
+ constructor(e, n) {
1472
+ this.key = e, this.value = n;
1008
1473
  }
1009
1474
  }
1010
- class fe {
1475
+ class Ce {
1011
1476
  head = null;
1012
1477
  tail = null;
1013
1478
  /**
@@ -1048,54 +1513,54 @@ class fe {
1048
1513
  this.remove(e), this.addToTail(e);
1049
1514
  }
1050
1515
  }
1051
- function we(l) {
1052
- const e = Y(/* @__PURE__ */ new Map()), r = Y(new fe());
1053
- B(() => {
1054
- for (; e.current.size > l; ) {
1055
- const c = r.current.removeHead();
1056
- if (c)
1057
- e.current.delete(c.key);
1516
+ function lt(c) {
1517
+ const e = H(/* @__PURE__ */ new Map()), n = H(new Ce());
1518
+ ae(() => {
1519
+ for (; e.current.size > c; ) {
1520
+ const g = n.current.removeHead();
1521
+ if (g)
1522
+ e.current.delete(g.key);
1058
1523
  else
1059
1524
  break;
1060
1525
  }
1061
- }, [l]);
1062
- const t = L((c) => {
1063
- const m = e.current.get(c);
1064
- if (m)
1065
- return r.current.moveToTail(m), m.value;
1066
- }, []), s = L(
1067
- (c, m) => {
1068
- if (l <= 0)
1526
+ }, [c]);
1527
+ const r = $((g) => {
1528
+ const x = e.current.get(g);
1529
+ if (x)
1530
+ return n.current.moveToTail(x), x.value;
1531
+ }, []), s = $(
1532
+ (g, x) => {
1533
+ if (c <= 0)
1069
1534
  return;
1070
- let v = e.current.get(c);
1071
- if (v)
1072
- v.value = m, r.current.moveToTail(v);
1535
+ let P = e.current.get(g);
1536
+ if (P)
1537
+ P.value = x, n.current.moveToTail(P);
1073
1538
  else {
1074
- if (e.current.size >= l) {
1075
- const _ = r.current.removeHead();
1076
- _ && e.current.delete(_.key);
1539
+ if (e.current.size >= c) {
1540
+ const S = n.current.removeHead();
1541
+ S && e.current.delete(S.key);
1077
1542
  }
1078
- v = new Pe(c, m), e.current.set(c, v), r.current.addToTail(v);
1543
+ P = new it(g, x), e.current.set(g, P), n.current.addToTail(P);
1079
1544
  }
1080
1545
  },
1081
- [l]
1082
- ), a = L((c) => e.current.has(c), []), o = L(() => {
1083
- e.current.clear(), r.current = new fe();
1084
- }, []), [d, i] = X(() => ({ get: t, set: s, has: a, clear: o }));
1085
- return B(() => i({ get: t, set: s, has: a, clear: o }), [t, s, a, o]), d;
1546
+ [c]
1547
+ ), a = $((g) => e.current.has(g), []), i = $(() => {
1548
+ e.current.clear(), n.current = new Ce();
1549
+ }, []), [f, p] = le(() => ({ get: r, set: s, has: a, clear: i }));
1550
+ return ae(() => p({ get: r, set: s, has: a, clear: i }), [r, s, a, i]), f;
1086
1551
  }
1087
- const Ve = 1e4, Ae = () => {
1088
- const { get: l, set: e, has: r, clear: t } = we(Ve);
1089
- return { get: l, set: e, has: r, clear: t };
1552
+ const ct = 1e4, mt = () => {
1553
+ const { get: c, set: e, has: n, clear: r } = lt(ct);
1554
+ return { get: c, set: e, has: n, clear: r };
1090
1555
  };
1091
1556
  export {
1092
- Re as FenwickMapTree,
1093
- _e as ScrollBar,
1094
- Ie as ScrollPane,
1095
- Fe as VirtualScroll,
1096
- A as minmax,
1097
- Se as useFenwickMapTree,
1098
- Ae as useHeightCache,
1099
- we as useLruCache
1557
+ st as FenwickMapTree,
1558
+ rt as ScrollBar,
1559
+ nt as ScrollPane,
1560
+ ft as VirtualScroll,
1561
+ z as minmax,
1562
+ ot as useFenwickMapTree,
1563
+ mt as useHeightCache,
1564
+ lt as useLruCache
1100
1565
  };
1101
1566
  //# sourceMappingURL=index.js.map