react-spring-carousel 3.0.0-beta-2.0.104 → 3.0.0-beta-2.0.105

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.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsxs as jt, jsx as tt } from "react/jsx-runtime";
2
- import { useSpringRef as Bt, useSpring as St } from "@react-spring/web";
3
- import et, { useRef as $, useEffect as U, useState as Ut } from "react";
4
- function Kt(e, t, r) {
1
+ import { jsxs as Ut, jsx as tt } from "react/jsx-runtime";
2
+ import { useSpringRef as Kt, useSpring as kt } from "@react-spring/web";
3
+ import et, { useRef as $, useEffect as U, useState as Gt } from "react";
4
+ function zt(e, t, r) {
5
5
  return Math.max(t, Math.min(e, r));
6
6
  }
7
7
  const b = {
@@ -21,17 +21,17 @@ const b = {
21
21
  e[0] -= t[0], e[1] -= t[1];
22
22
  }
23
23
  };
24
- function ht(e, t, r) {
24
+ function mt(e, t, r) {
25
25
  return t === 0 || Math.abs(t) === 1 / 0 ? Math.pow(e, r * 5) : e * t * r / (t + r * e);
26
26
  }
27
- function pt(e, t, r, n = 0.15) {
28
- return n === 0 ? Kt(e, t, r) : e < t ? -ht(t - e, r - t, n) + t : e > r ? +ht(e - r, r - t, n) + r : e;
27
+ function gt(e, t, r, n = 0.15) {
28
+ return n === 0 ? zt(e, t, r) : e < t ? -mt(t - e, r - t, n) + t : e > r ? +mt(e - r, r - t, n) + r : e;
29
29
  }
30
- function Gt(e, [t, r], [n, s]) {
30
+ function Wt(e, [t, r], [n, s]) {
31
31
  const [[o, a], [c, f]] = e;
32
- return [pt(t, o, a, n), pt(r, c, f, s)];
32
+ return [gt(t, o, a, n), gt(r, c, f, s)];
33
33
  }
34
- function zt(e, t) {
34
+ function Yt(e, t) {
35
35
  if (typeof e != "object" || e === null) return e;
36
36
  var r = e[Symbol.toPrimitive];
37
37
  if (r !== void 0) {
@@ -41,19 +41,19 @@ function zt(e, t) {
41
41
  }
42
42
  return (t === "string" ? String : Number)(e);
43
43
  }
44
- function Wt(e) {
45
- var t = zt(e, "string");
44
+ function Ft(e) {
45
+ var t = Yt(e, "string");
46
46
  return typeof t == "symbol" ? t : String(t);
47
47
  }
48
- function S(e, t, r) {
49
- return t = Wt(t), t in e ? Object.defineProperty(e, t, {
48
+ function T(e, t, r) {
49
+ return t = Ft(t), t in e ? Object.defineProperty(e, t, {
50
50
  value: r,
51
51
  enumerable: !0,
52
52
  configurable: !0,
53
53
  writable: !0
54
54
  }) : e[t] = r, e;
55
55
  }
56
- function mt(e, t) {
56
+ function vt(e, t) {
57
57
  var r = Object.keys(e);
58
58
  if (Object.getOwnPropertySymbols) {
59
59
  var n = Object.getOwnPropertySymbols(e);
@@ -66,15 +66,15 @@ function mt(e, t) {
66
66
  function p(e) {
67
67
  for (var t = 1; t < arguments.length; t++) {
68
68
  var r = arguments[t] != null ? arguments[t] : {};
69
- t % 2 ? mt(Object(r), !0).forEach(function(n) {
70
- S(e, n, r[n]);
71
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : mt(Object(r)).forEach(function(n) {
69
+ t % 2 ? vt(Object(r), !0).forEach(function(n) {
70
+ T(e, n, r[n]);
71
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : vt(Object(r)).forEach(function(n) {
72
72
  Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
73
73
  });
74
74
  }
75
75
  return e;
76
76
  }
77
- const It = {
77
+ const Ct = {
78
78
  pointer: {
79
79
  start: "down",
80
80
  change: "move",
@@ -96,63 +96,63 @@ const It = {
96
96
  end: "end"
97
97
  }
98
98
  };
99
- function gt(e) {
99
+ function yt(e) {
100
100
  return e ? e[0].toUpperCase() + e.slice(1) : "";
101
101
  }
102
- const Yt = ["enter", "leave"];
103
- function Ft(e = !1, t) {
104
- return e && !Yt.includes(t);
102
+ const Ht = ["enter", "leave"];
103
+ function Xt(e = !1, t) {
104
+ return e && !Ht.includes(t);
105
105
  }
106
- function Ht(e, t = "", r = !1) {
107
- const n = It[e], s = n && n[t] || t;
108
- return "on" + gt(e) + gt(s) + (Ft(r, s) ? "Capture" : "");
106
+ function qt(e, t = "", r = !1) {
107
+ const n = Ct[e], s = n && n[t] || t;
108
+ return "on" + yt(e) + yt(s) + (Xt(r, s) ? "Capture" : "");
109
109
  }
110
- const Xt = ["gotpointercapture", "lostpointercapture"];
111
- function qt(e) {
110
+ const Jt = ["gotpointercapture", "lostpointercapture"];
111
+ function Qt(e) {
112
112
  let t = e.substring(2).toLowerCase();
113
113
  const r = !!~t.indexOf("passive");
114
114
  r && (t = t.replace("passive", ""));
115
- const n = Xt.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(n);
115
+ const n = Jt.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(n);
116
116
  return s && (t = t.replace("capture", "")), {
117
117
  device: t,
118
118
  capture: s,
119
119
  passive: r
120
120
  };
121
121
  }
122
- function Jt(e, t = "") {
123
- const r = It[e], n = r && r[t] || t;
122
+ function Zt(e, t = "") {
123
+ const r = Ct[e], n = r && r[t] || t;
124
124
  return e + n;
125
125
  }
126
126
  function X(e) {
127
127
  return "touches" in e;
128
128
  }
129
- function kt(e) {
129
+ function Dt(e) {
130
130
  return X(e) ? "touch" : "pointerType" in e ? e.pointerType : "mouse";
131
131
  }
132
- function Qt(e) {
132
+ function te(e) {
133
133
  return Array.from(e.touches).filter((t) => {
134
134
  var r, n;
135
135
  return t.target === e.currentTarget || ((r = e.currentTarget) === null || r === void 0 || (n = r.contains) === null || n === void 0 ? void 0 : n.call(r, t.target));
136
136
  });
137
137
  }
138
- function Zt(e) {
138
+ function ee(e) {
139
139
  return e.type === "touchend" || e.type === "touchcancel" ? e.changedTouches : e.targetTouches;
140
140
  }
141
- function Ct(e) {
142
- return X(e) ? Zt(e)[0] : e;
141
+ function $t(e) {
142
+ return X(e) ? ee(e)[0] : e;
143
143
  }
144
- function te(e) {
145
- return Qt(e).map((t) => t.identifier);
144
+ function re(e) {
145
+ return te(e).map((t) => t.identifier);
146
146
  }
147
147
  function rt(e) {
148
- const t = Ct(e);
148
+ const t = $t(e);
149
149
  return X(e) ? t.identifier : t.pointerId;
150
150
  }
151
- function vt(e) {
152
- const t = Ct(e);
151
+ function bt(e) {
152
+ const t = $t(e);
153
153
  return [t.clientX, t.clientY];
154
154
  }
155
- function ee(e) {
155
+ function ne(e) {
156
156
  const t = {};
157
157
  if ("buttons" in e && (t.buttons = e.buttons), "shiftKey" in e) {
158
158
  const {
@@ -173,21 +173,21 @@ function ee(e) {
173
173
  function H(e, ...t) {
174
174
  return typeof e == "function" ? e(...t) : e;
175
175
  }
176
- function re() {
176
+ function se() {
177
177
  }
178
- function ne(...e) {
179
- return e.length === 0 ? re : e.length === 1 ? e[0] : function() {
178
+ function ie(...e) {
179
+ return e.length === 0 ? se : e.length === 1 ? e[0] : function() {
180
180
  let t;
181
181
  for (const r of e)
182
182
  t = r.apply(this, arguments) || t;
183
183
  return t;
184
184
  };
185
185
  }
186
- function yt(e, t) {
186
+ function _t(e, t) {
187
187
  return Object.assign({}, t, e || {});
188
188
  }
189
- const se = 32;
190
- class ie {
189
+ const oe = 32;
190
+ class ae {
191
191
  constructor(t, r, n) {
192
192
  this.ctrl = t, this.args = r, this.key = n, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset());
193
193
  }
@@ -244,30 +244,30 @@ class ie {
244
244
  } = this;
245
245
  r.args = this.args;
246
246
  let o = 0;
247
- if (t && (r.event = t, n.preventDefault && t.cancelable && r.event.preventDefault(), r.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, ee(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, o = t.timeStamp - r.timeStamp, r.timeStamp = t.timeStamp, r.elapsedTime = r.timeStamp - r.startTime), r._active) {
247
+ if (t && (r.event = t, n.preventDefault && t.cancelable && r.event.preventDefault(), r.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, ne(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, o = t.timeStamp - r.timeStamp, r.timeStamp = t.timeStamp, r.elapsedTime = r.timeStamp - r.startTime), r._active) {
248
248
  const A = r._delta.map(Math.abs);
249
249
  b.addTo(r._distance, A);
250
250
  }
251
251
  this.axisIntent && this.axisIntent(t);
252
- const [a, c] = r._movement, [f, d] = n.threshold, {
252
+ const [a, c] = r._movement, [f, h] = n.threshold, {
253
253
  _step: u,
254
254
  values: _
255
255
  } = r;
256
- if (n.hasCustomTransform ? (u[0] === !1 && (u[0] = Math.abs(a) >= f && _[0]), u[1] === !1 && (u[1] = Math.abs(c) >= d && _[1])) : (u[0] === !1 && (u[0] = Math.abs(a) >= f && Math.sign(a) * f), u[1] === !1 && (u[1] = Math.abs(c) >= d && Math.sign(c) * d)), r.intentional = u[0] !== !1 || u[1] !== !1, !r.intentional) return;
256
+ if (n.hasCustomTransform ? (u[0] === !1 && (u[0] = Math.abs(a) >= f && _[0]), u[1] === !1 && (u[1] = Math.abs(c) >= h && _[1])) : (u[0] === !1 && (u[0] = Math.abs(a) >= f && Math.sign(a) * f), u[1] === !1 && (u[1] = Math.abs(c) >= h && Math.sign(c) * h)), r.intentional = u[0] !== !1 || u[1] !== !1, !r.intentional) return;
257
257
  const m = [0, 0];
258
258
  if (n.hasCustomTransform) {
259
- const [A, h] = _;
260
- m[0] = u[0] !== !1 ? A - u[0] : 0, m[1] = u[1] !== !1 ? h - u[1] : 0;
259
+ const [A, d] = _;
260
+ m[0] = u[0] !== !1 ? A - u[0] : 0, m[1] = u[1] !== !1 ? d - u[1] : 0;
261
261
  } else
262
262
  m[0] = u[0] !== !1 ? a - u[0] : 0, m[1] = u[1] !== !1 ? c - u[1] : 0;
263
263
  this.restrictToAxis && !r._blocked && this.restrictToAxis(m);
264
- const I = r.offset, D = r._active && !r._blocked || r.active;
264
+ const S = r.offset, D = r._active && !r._blocked || r.active;
265
265
  D && (r.first = r._active && !r.active, r.last = !r._active && r.active, r.active = s[this.ingKey] = r._active, t && (r.first && ("bounds" in n && (r._bounds = H(n.bounds, r)), this.setup && this.setup()), r.movement = m, this.computeOffset()));
266
- const [O, x] = r.offset, [[w, M], [y, k]] = r._bounds;
267
- r.overflow = [O < w ? -1 : O > M ? 1 : 0, x < y ? -1 : x > k ? 1 : 0], r._movementBound[0] = r.overflow[0] ? r._movementBound[0] === !1 ? r._movement[0] : r._movementBound[0] : !1, r._movementBound[1] = r.overflow[1] ? r._movementBound[1] === !1 ? r._movement[1] : r._movementBound[1] : !1;
266
+ const [O, x] = r.offset, [[w, M], [y, I]] = r._bounds;
267
+ r.overflow = [O < w ? -1 : O > M ? 1 : 0, x < y ? -1 : x > I ? 1 : 0], r._movementBound[0] = r.overflow[0] ? r._movementBound[0] === !1 ? r._movement[0] : r._movementBound[0] : !1, r._movementBound[1] = r.overflow[1] ? r._movementBound[1] === !1 ? r._movement[1] : r._movementBound[1] : !1;
268
268
  const L = r._active ? n.rubberband || [0, 0] : [0, 0];
269
- if (r.offset = Gt(r._bounds, r.offset, L), r.delta = b.sub(r.offset, I), this.computeMovement(), D && (!r.last || o > se)) {
270
- r.delta = b.sub(r.offset, I);
269
+ if (r.offset = Wt(r._bounds, r.offset, L), r.delta = b.sub(r.offset, S), this.computeMovement(), D && (!r.last || o > oe)) {
270
+ r.delta = b.sub(r.offset, S);
271
271
  const A = r.delta.map(Math.abs);
272
272
  b.addTo(r.distance, A), r.direction = r.delta.map(Math.sign), r._direction = r._delta.map(Math.sign), !r.first && o > 0 && (r.velocity = [A[0] / o, A[1] / o], r.timeDelta = o);
273
273
  }
@@ -284,16 +284,16 @@ class ie {
284
284
  this.eventStore.clean(), this.timeoutStore.clean();
285
285
  }
286
286
  }
287
- function oe([e, t], r) {
287
+ function ce([e, t], r) {
288
288
  const n = Math.abs(e), s = Math.abs(t);
289
289
  if (n > s && n > r)
290
290
  return "x";
291
291
  if (s > n && s > r)
292
292
  return "y";
293
293
  }
294
- class ae extends ie {
294
+ class ue extends ae {
295
295
  constructor(...t) {
296
- super(...t), S(this, "aliasKey", "xy");
296
+ super(...t), T(this, "aliasKey", "xy");
297
297
  }
298
298
  reset() {
299
299
  super.reset(), this.state.axis = void 0;
@@ -310,8 +310,8 @@ class ae extends ie {
310
310
  axisIntent(t) {
311
311
  const r = this.state, n = this.config;
312
312
  if (!r.axis && t) {
313
- const s = typeof n.axisThreshold == "object" ? n.axisThreshold[kt(t)] : n.axisThreshold;
314
- r.axis = oe(r._movement, s);
313
+ const s = typeof n.axisThreshold == "object" ? n.axisThreshold[Dt(t)] : n.axisThreshold;
314
+ r.axis = ce(r._movement, s);
315
315
  }
316
316
  r._blocked = (n.lockDirection || !!n.axis) && !r.axis || !!n.axis && n.axis !== r.axis;
317
317
  }
@@ -327,7 +327,7 @@ class ae extends ie {
327
327
  }
328
328
  }
329
329
  }
330
- const bt = (e) => e, _t = 0.15, ot = {
330
+ const xt = (e) => e, wt = 0.15, ot = {
331
331
  enabled(e = !0) {
332
332
  return e;
333
333
  },
@@ -343,7 +343,7 @@ const bt = (e) => e, _t = 0.15, ot = {
343
343
  rubberband(e = 0) {
344
344
  switch (e) {
345
345
  case !0:
346
- return [_t, _t];
346
+ return [wt, wt];
347
347
  case !1:
348
348
  return [0, 0];
349
349
  default:
@@ -357,13 +357,13 @@ const bt = (e) => e, _t = 0.15, ot = {
357
357
  transform(e, t, r) {
358
358
  const n = e || r.shared.transform;
359
359
  if (this.hasCustomTransform = !!n, process.env.NODE_ENV === "development") {
360
- const s = n || bt;
360
+ const s = n || xt;
361
361
  return (o) => {
362
362
  const a = s(o);
363
363
  return (!isFinite(a[0]) || !isFinite(a[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${a[0]},${[1]}]`), a;
364
364
  };
365
365
  }
366
- return n || bt;
366
+ return n || xt;
367
367
  },
368
368
  threshold(e) {
369
369
  return b.toVector(e, 0);
@@ -386,13 +386,13 @@ process.env.NODE_ENV === "development" && Object.assign(ot, {
386
386
  return NaN;
387
387
  }
388
388
  });
389
- const ce = 0, K = p(p({}, ot), {}, {
389
+ const le = 0, K = p(p({}, ot), {}, {
390
390
  axis(e, t, {
391
391
  axis: r
392
392
  }) {
393
393
  if (this.lockDirection = r === "lock", !this.lockDirection) return r;
394
394
  },
395
- axisThreshold(e = ce) {
395
+ axisThreshold(e = le) {
396
396
  return e;
397
397
  },
398
398
  bounds(e = {}) {
@@ -410,15 +410,15 @@ const ce = 0, K = p(p({}, ot), {}, {
410
410
  } = e;
411
411
  return [[t, r], [n, s]];
412
412
  }
413
- }), xt = {
413
+ }), Et = {
414
414
  ArrowRight: (e, t = 1) => [e * t, 0],
415
415
  ArrowLeft: (e, t = 1) => [-1 * e * t, 0],
416
416
  ArrowUp: (e, t = 1) => [0, -1 * e * t],
417
417
  ArrowDown: (e, t = 1) => [0, e * t]
418
418
  };
419
- class ue extends ae {
419
+ class fe extends ue {
420
420
  constructor(...t) {
421
- super(...t), S(this, "ingKey", "dragging");
421
+ super(...t), T(this, "ingKey", "dragging");
422
422
  }
423
423
  reset() {
424
424
  super.reset();
@@ -453,7 +453,7 @@ class ue extends ae {
453
453
  const r = this.config, n = this.state;
454
454
  if (t.buttons != null && (Array.isArray(r.pointerButtons) ? !r.pointerButtons.includes(t.buttons) : r.pointerButtons !== -1 && r.pointerButtons !== t.buttons)) return;
455
455
  const s = this.ctrl.setEventIds(t);
456
- r.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && n._pointerActive) && (this.start(t), this.setupPointer(t), n._pointerId = rt(t), n._pointerActive = !0, this.computeValues(vt(t)), this.computeInitial(), r.preventScrollAxis && kt(t) !== "mouse" ? (n._active = !1, this.setupScrollPrevention(t)) : r.delay > 0 ? (this.setupDelayTrigger(t), r.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
456
+ r.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && n._pointerActive) && (this.start(t), this.setupPointer(t), n._pointerId = rt(t), n._pointerActive = !0, this.computeValues(bt(t)), this.computeInitial(), r.preventScrollAxis && Dt(t) !== "mouse" ? (n._active = !1, this.setupScrollPrevention(t)) : r.delay > 0 ? (this.setupDelayTrigger(t), r.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
457
457
  }
458
458
  startPointerDrag(t) {
459
459
  const r = this.state;
@@ -464,7 +464,7 @@ class ue extends ae {
464
464
  if (!r._pointerActive) return;
465
465
  const s = rt(t);
466
466
  if (r._pointerId !== void 0 && s !== r._pointerId) return;
467
- const o = vt(t);
467
+ const o = bt(t);
468
468
  if (document.pointerLockElement === t.target ? r._delta = [t.movementX, t.movementY] : (r._delta = b.sub(o, r._values), this.computeValues(o)), b.addTo(r._movement, r._delta), this.compute(t), r._delayed && r.intentional) {
469
469
  this.timeoutStore.remove("dragDelay"), r.active = !1, this.startPointerDrag(t);
470
470
  return;
@@ -498,10 +498,10 @@ class ue extends ae {
498
498
  if (r.tap = o <= n.tapsThreshold && a <= n.tapsThreshold, r.tap && n.filterTaps)
499
499
  r._force = !0;
500
500
  else {
501
- const [c, f] = r._delta, [d, u] = r._movement, [_, m] = n.swipe.velocity, [I, D] = n.swipe.distance, O = n.swipe.duration;
501
+ const [c, f] = r._delta, [h, u] = r._movement, [_, m] = n.swipe.velocity, [S, D] = n.swipe.distance, O = n.swipe.duration;
502
502
  if (r.elapsedTime < O) {
503
503
  const x = Math.abs(c / r.timeDelta), w = Math.abs(f / r.timeDelta);
504
- x > _ && Math.abs(d) > I && (r.swipe[0] = Math.sign(c)), w > m && Math.abs(u) > D && (r.swipe[1] = Math.sign(f));
504
+ x > _ && Math.abs(h) > S && (r.swipe[0] = Math.sign(c)), w > m && Math.abs(u) > D && (r.swipe[1] = Math.sign(f));
505
505
  }
506
506
  }
507
507
  this.emit();
@@ -528,7 +528,7 @@ class ue extends ae {
528
528
  this.state._preventScroll && t.cancelable && t.preventDefault();
529
529
  }
530
530
  setupScrollPrevention(t) {
531
- this.state._preventScroll = !1, le(t);
531
+ this.state._preventScroll = !1, de(t);
532
532
  const r = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
533
533
  passive: !1
534
534
  });
@@ -540,14 +540,14 @@ class ue extends ae {
540
540
  }, this.config.delay);
541
541
  }
542
542
  keyDown(t) {
543
- const r = xt[t.key];
543
+ const r = Et[t.key];
544
544
  if (r) {
545
545
  const n = this.state, s = t.shiftKey ? 10 : t.altKey ? 0.1 : 1;
546
546
  this.start(t), n._delta = r(this.config.keyboardDisplacement, s), n._keyboardActive = !0, b.addTo(n._movement, n._delta), this.compute(t), this.emit();
547
547
  }
548
548
  }
549
549
  keyUp(t) {
550
- t.key in xt && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
550
+ t.key in Et && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
551
551
  }
552
552
  bind(t) {
553
553
  const r = this.config.device;
@@ -557,23 +557,23 @@ class ue extends ae {
557
557
  });
558
558
  }
559
559
  }
560
- function le(e) {
560
+ function de(e) {
561
561
  "persist" in e && typeof e.persist == "function" && e.persist();
562
562
  }
563
563
  const G = typeof window < "u" && window.document && window.document.createElement;
564
- function Dt() {
564
+ function Pt() {
565
565
  return G && "ontouchstart" in window;
566
566
  }
567
- function fe() {
568
- return Dt() || G && window.navigator.maxTouchPoints > 1;
567
+ function he() {
568
+ return Pt() || G && window.navigator.maxTouchPoints > 1;
569
569
  }
570
- function de() {
570
+ function pe() {
571
571
  return G && "onpointerdown" in window;
572
572
  }
573
- function he() {
573
+ function me() {
574
574
  return G && "exitPointerLock" in window.document;
575
575
  }
576
- function pe() {
576
+ function ge() {
577
577
  try {
578
578
  return "constructor" in GestureEvent;
579
579
  } catch {
@@ -582,16 +582,16 @@ function pe() {
582
582
  }
583
583
  const P = {
584
584
  isBrowser: G,
585
- gesture: pe(),
586
- touch: Dt(),
587
- touchscreen: fe(),
588
- pointer: de(),
589
- pointerLock: he()
590
- }, me = 250, ge = 180, ve = 0.5, ye = 50, be = 250, _e = 10, wt = {
585
+ gesture: ge(),
586
+ touch: Pt(),
587
+ touchscreen: he(),
588
+ pointer: pe(),
589
+ pointerLock: me()
590
+ }, ve = 250, ye = 180, be = 0.5, _e = 50, xe = 250, we = 10, Tt = {
591
591
  mouse: 0,
592
592
  touch: 0,
593
593
  pen: 8
594
- }, $t = p(p({}, K), {}, {
594
+ }, Ot = p(p({}, K), {}, {
595
595
  device(e, t, {
596
596
  pointer: {
597
597
  touch: r = !1,
@@ -604,7 +604,7 @@ const P = {
604
604
  preventScrollAxis(e, t, {
605
605
  preventScroll: r
606
606
  }) {
607
- if (this.preventScrollDelay = typeof r == "number" ? r : r || r === void 0 && e ? me : void 0, !(!P.touchscreen || r === !1))
607
+ if (this.preventScrollDelay = typeof r == "number" ? r : r || r === void 0 && e ? ve : void 0, !(!P.touchscreen || r === !1))
608
608
  return e || (r !== void 0 ? "y" : void 0);
609
609
  },
610
610
  pointerCapture(e, t, {
@@ -625,9 +625,9 @@ const P = {
625
625
  return this.filterTaps = r, this.tapsThreshold = n, o;
626
626
  },
627
627
  swipe({
628
- velocity: e = ve,
629
- distance: t = ye,
630
- duration: r = be
628
+ velocity: e = be,
629
+ distance: t = _e,
630
+ duration: r = xe
631
631
  } = {}) {
632
632
  return {
633
633
  velocity: this.transform(b.toVector(e)),
@@ -638,7 +638,7 @@ const P = {
638
638
  delay(e = 0) {
639
639
  switch (e) {
640
640
  case !0:
641
- return ge;
641
+ return ye;
642
642
  case !1:
643
643
  return 0;
644
644
  default:
@@ -646,13 +646,13 @@ const P = {
646
646
  }
647
647
  },
648
648
  axisThreshold(e) {
649
- return e ? p(p({}, wt), e) : wt;
649
+ return e ? p(p({}, Tt), e) : Tt;
650
650
  },
651
- keyboardDisplacement(e = _e) {
651
+ keyboardDisplacement(e = we) {
652
652
  return e;
653
653
  }
654
654
  });
655
- process.env.NODE_ENV === "development" && Object.assign($t, {
655
+ process.env.NODE_ENV === "development" && Object.assign(Ot, {
656
656
  useTouch(e) {
657
657
  if (e !== void 0)
658
658
  throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");
@@ -698,13 +698,13 @@ p(p({}, ot), {}, {
698
698
  angleBounds: n = {}
699
699
  }) {
700
700
  const s = (a) => {
701
- const c = yt(H(r, a), {
701
+ const c = _t(H(r, a), {
702
702
  min: -1 / 0,
703
703
  max: 1 / 0
704
704
  });
705
705
  return [c.min, c.max];
706
706
  }, o = (a) => {
707
- const c = yt(H(n, a), {
707
+ const c = _t(H(n, a), {
708
708
  min: -1 / 0,
709
709
  max: 1 / 0
710
710
  });
@@ -728,25 +728,25 @@ p(p({}, K), {}, {
728
728
  p(p({}, K), {}, {
729
729
  mouseOnly: (e = !0) => e
730
730
  });
731
- const Pt = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map();
732
- function xe(e) {
733
- Pt.set(e.key, e.engine), it.set(e.key, e.resolver);
731
+ const At = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map();
732
+ function Ee(e) {
733
+ At.set(e.key, e.engine), it.set(e.key, e.resolver);
734
734
  }
735
- const we = {
735
+ const Te = {
736
736
  key: "drag",
737
- engine: ue,
738
- resolver: $t
737
+ engine: fe,
738
+ resolver: Ot
739
739
  };
740
- function Ee(e, t) {
740
+ function Se(e, t) {
741
741
  if (e == null) return {};
742
742
  var r = {}, n = Object.keys(e), s, o;
743
743
  for (o = 0; o < n.length; o++)
744
744
  s = n[o], !(t.indexOf(s) >= 0) && (r[s] = e[s]);
745
745
  return r;
746
746
  }
747
- function Te(e, t) {
747
+ function Ie(e, t) {
748
748
  if (e == null) return {};
749
- var r = Ee(e, t), n, s;
749
+ var r = Se(e, t), n, s;
750
750
  if (Object.getOwnPropertySymbols) {
751
751
  var o = Object.getOwnPropertySymbols(e);
752
752
  for (s = 0; s < o.length; s++)
@@ -754,7 +754,7 @@ function Te(e, t) {
754
754
  }
755
755
  return r;
756
756
  }
757
- const Se = {
757
+ const ke = {
758
758
  target(e) {
759
759
  if (e)
760
760
  return () => "current" in e ? e.current : e;
@@ -777,7 +777,7 @@ const Se = {
777
777
  transform(e) {
778
778
  return e;
779
779
  }
780
- }, Ie = ["target", "eventOptions", "window", "enabled", "transform"];
780
+ }, Ce = ["target", "eventOptions", "window", "enabled", "transform"];
781
781
  function F(e = {}, t) {
782
782
  const r = {};
783
783
  for (const [n, s] of Object.entries(t))
@@ -798,32 +798,32 @@ function F(e = {}, t) {
798
798
  }
799
799
  return r;
800
800
  }
801
- function ke(e, t, r = {}) {
801
+ function De(e, t, r = {}) {
802
802
  const n = e, {
803
803
  target: s,
804
804
  eventOptions: o,
805
805
  window: a,
806
806
  enabled: c,
807
807
  transform: f
808
- } = n, d = Te(n, Ie);
808
+ } = n, h = Ie(n, Ce);
809
809
  if (r.shared = F({
810
810
  target: s,
811
811
  eventOptions: o,
812
812
  window: a,
813
813
  enabled: c,
814
814
  transform: f
815
- }, Se), t) {
815
+ }, ke), t) {
816
816
  const u = it.get(t);
817
817
  r[t] = F(p({
818
818
  shared: r.shared
819
- }, d), u);
819
+ }, h), u);
820
820
  } else
821
- for (const u in d) {
821
+ for (const u in h) {
822
822
  const _ = it.get(u);
823
823
  if (_)
824
824
  r[u] = F(p({
825
825
  shared: r.shared
826
- }, d[u]), _);
826
+ }, h[u]), _);
827
827
  else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(u)) {
828
828
  if (u === "domTarget")
829
829
  throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
@@ -832,15 +832,15 @@ function ke(e, t, r = {}) {
832
832
  }
833
833
  return r;
834
834
  }
835
- class Ot {
835
+ class Nt {
836
836
  constructor(t, r) {
837
- S(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = r;
837
+ T(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = r;
838
838
  }
839
839
  add(t, r, n, s, o) {
840
- const a = this._listeners, c = Jt(r, n), f = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, d = p(p({}, f), o);
841
- t.addEventListener(c, s, d);
840
+ const a = this._listeners, c = Zt(r, n), f = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, h = p(p({}, f), o);
841
+ t.addEventListener(c, s, h);
842
842
  const u = () => {
843
- t.removeEventListener(c, s, d), a.delete(u);
843
+ t.removeEventListener(c, s, h), a.delete(u);
844
844
  };
845
845
  return a.add(u), u;
846
846
  }
@@ -848,9 +848,9 @@ class Ot {
848
848
  this._listeners.forEach((t) => t()), this._listeners.clear();
849
849
  }
850
850
  }
851
- class Ce {
851
+ class $e {
852
852
  constructor() {
853
- S(this, "_timeouts", /* @__PURE__ */ new Map());
853
+ T(this, "_timeouts", /* @__PURE__ */ new Map());
854
854
  }
855
855
  add(t, r, n = 140, ...s) {
856
856
  this.remove(t), this._timeouts.set(t, window.setTimeout(r, n, ...s));
@@ -863,20 +863,20 @@ class Ce {
863
863
  this._timeouts.forEach((t) => void window.clearTimeout(t)), this._timeouts.clear();
864
864
  }
865
865
  }
866
- class De {
866
+ class Pe {
867
867
  constructor(t) {
868
- S(this, "gestures", /* @__PURE__ */ new Set()), S(this, "_targetEventStore", new Ot(this)), S(this, "gestureEventStores", {}), S(this, "gestureTimeoutStores", {}), S(this, "handlers", {}), S(this, "config", {}), S(this, "pointerIds", /* @__PURE__ */ new Set()), S(this, "touchIds", /* @__PURE__ */ new Set()), S(this, "state", {
868
+ T(this, "gestures", /* @__PURE__ */ new Set()), T(this, "_targetEventStore", new Nt(this)), T(this, "gestureEventStores", {}), T(this, "gestureTimeoutStores", {}), T(this, "handlers", {}), T(this, "config", {}), T(this, "pointerIds", /* @__PURE__ */ new Set()), T(this, "touchIds", /* @__PURE__ */ new Set()), T(this, "state", {
869
869
  shared: {
870
870
  shiftKey: !1,
871
871
  metaKey: !1,
872
872
  ctrlKey: !1,
873
873
  altKey: !1
874
874
  }
875
- }), $e(this, t);
875
+ }), Oe(this, t);
876
876
  }
877
877
  setEventIds(t) {
878
878
  if (X(t))
879
- return this.touchIds = new Set(te(t)), this.touchIds;
879
+ return this.touchIds = new Set(re(t)), this.touchIds;
880
880
  if ("pointerId" in t)
881
881
  return t.type === "pointerup" || t.type === "pointercancel" ? this.pointerIds.delete(t.pointerId) : t.type === "pointerdown" && this.pointerIds.add(t.pointerId), this.pointerIds;
882
882
  }
@@ -884,7 +884,7 @@ class De {
884
884
  this.handlers = t, this.nativeHandlers = r;
885
885
  }
886
886
  applyConfig(t, r) {
887
- this.config = ke(t, r, this.config);
887
+ this.config = De(t, r, this.config);
888
888
  }
889
889
  clean() {
890
890
  this._targetEventStore.clean();
@@ -900,13 +900,13 @@ class De {
900
900
  if (!(r.target && (s = r.target(), !s))) {
901
901
  if (r.enabled) {
902
902
  for (const a of this.gestures) {
903
- const c = this.config[a], f = Et(n, c.eventOptions, !!s);
903
+ const c = this.config[a], f = St(n, c.eventOptions, !!s);
904
904
  if (c.enabled) {
905
- const d = Pt.get(a);
906
- new d(this, t, a).bind(f);
905
+ const h = At.get(a);
906
+ new h(this, t, a).bind(f);
907
907
  }
908
908
  }
909
- const o = Et(n, r.eventOptions, !!s);
909
+ const o = St(n, r.eventOptions, !!s);
910
910
  for (const a in this.nativeHandlers)
911
911
  o(a, "", (c) => this.nativeHandlers[a](p(p({}, this.state.shared), {}, {
912
912
  event: c,
@@ -914,14 +914,14 @@ class De {
914
914
  })), void 0, !0);
915
915
  }
916
916
  for (const o in n)
917
- n[o] = ne(...n[o]);
917
+ n[o] = ie(...n[o]);
918
918
  if (!s) return n;
919
919
  for (const o in n) {
920
920
  const {
921
921
  device: a,
922
922
  capture: c,
923
923
  passive: f
924
- } = qt(o);
924
+ } = Qt(o);
925
925
  this._targetEventStore.add(s, a, "", n[o], {
926
926
  capture: c,
927
927
  passive: f
@@ -931,29 +931,29 @@ class De {
931
931
  }
932
932
  }
933
933
  function B(e, t) {
934
- e.gestures.add(t), e.gestureEventStores[t] = new Ot(e, t), e.gestureTimeoutStores[t] = new Ce();
934
+ e.gestures.add(t), e.gestureEventStores[t] = new Nt(e, t), e.gestureTimeoutStores[t] = new $e();
935
935
  }
936
- function $e(e, t) {
936
+ function Oe(e, t) {
937
937
  t.drag && B(e, "drag"), t.wheel && B(e, "wheel"), t.scroll && B(e, "scroll"), t.move && B(e, "move"), t.pinch && B(e, "pinch"), t.hover && B(e, "hover");
938
938
  }
939
- const Et = (e, t, r) => (n, s, o, a = {}, c = !1) => {
940
- var f, d;
941
- const u = (f = a.capture) !== null && f !== void 0 ? f : t.capture, _ = (d = a.passive) !== null && d !== void 0 ? d : t.passive;
942
- let m = c ? n : Ht(n, s, u);
939
+ const St = (e, t, r) => (n, s, o, a = {}, c = !1) => {
940
+ var f, h;
941
+ const u = (f = a.capture) !== null && f !== void 0 ? f : t.capture, _ = (h = a.passive) !== null && h !== void 0 ? h : t.passive;
942
+ let m = c ? n : qt(n, s, u);
943
943
  r && _ && (m += "Passive"), e[m] = e[m] || [], e[m].push(o);
944
944
  };
945
- function Pe(e, t = {}, r, n) {
946
- const s = et.useMemo(() => new De(e), []);
945
+ function Ae(e, t = {}, r, n) {
946
+ const s = et.useMemo(() => new Pe(e), []);
947
947
  if (s.applyHandlers(e, n), s.applyConfig(t, r), et.useEffect(s.effect.bind(s)), et.useEffect(() => s.clean.bind(s), []), t.target === void 0)
948
948
  return s.bind.bind(s);
949
949
  }
950
- function Oe(e, t) {
951
- return xe(we), Pe({
950
+ function Ne(e, t) {
951
+ return Ee(Te), Ae({
952
952
  drag: e
953
953
  }, t || {}, "drag");
954
954
  }
955
955
  const nt = "RSC::Event";
956
- function Ae() {
956
+ function Le() {
957
957
  const e = $(null);
958
958
  function t(n) {
959
959
  U(() => {
@@ -985,11 +985,11 @@ function Ae() {
985
985
  emitEvent: r
986
986
  };
987
987
  }
988
- function Ne(e) {
988
+ function Me(e) {
989
989
  let t = e.replace(/\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$/gm, "");
990
990
  return t = t.replace(/[\n\t]+/g, " "), t = t.replace(/\s*([{}:;,])\s*/g, "$1"), t = t.replace(/\s+}/g, "}"), t = t.replace(/{\s+/g, "{"), t = t.replace(/\s+/g, " "), t.trim();
991
991
  }
992
- function Be({
992
+ function Ke({
993
993
  init: e = !0,
994
994
  items: t,
995
995
  withLoop: r = !1,
@@ -999,13 +999,13 @@ function Be({
999
999
  carouselAxis: a = "x",
1000
1000
  startingPosition: c = "start",
1001
1001
  enableGestures: f = !0,
1002
- slideWhenDragThresholdIsReached: d = !0,
1002
+ slideWhenDragThresholdIsReached: h = !0,
1003
1003
  onInit: u,
1004
1004
  slideType: _ = "item",
1005
1005
  initialActiveItem: m = 0
1006
1006
  }) {
1007
- const [I, D] = Ut(!1), O = $(e), x = $(null), w = $(null), M = $(0), y = $(0), k = $(!r), L = $(!1), A = $(0), h = $(0);
1008
- function At(i) {
1007
+ const [S, D] = Gt(!1), O = $(e), x = $(null), w = $(null), M = $(0), y = $(0), I = $(!r), L = $(!1), A = $(0), d = $(0);
1008
+ function Lt(i) {
1009
1009
  if (i === void 0) return 0;
1010
1010
  if (typeof i == "number")
1011
1011
  return t[i] ? i : (console.warn(
@@ -1014,14 +1014,14 @@ function Be({
1014
1014
  const l = t.findIndex((g) => g.id === i);
1015
1015
  return l < 0 ? (console.warn(`initialActiveItem: item with id "${i}" doesn't exist.`), 0) : l;
1016
1016
  }
1017
- const z = Bt(), q = St({
1017
+ const z = Kt(), q = kt({
1018
1018
  value: 0,
1019
1019
  ref: z,
1020
1020
  onChange({ value: i }) {
1021
1021
  const l = a === "x" ? `translate3d(calc(${i.value}px + var(--${n}-offset-modifier)), 0px, 0px)` : `translate3d(0px, calc(${i.value}px + var(--${n}-offset-modifier)), 0px)`;
1022
1022
  w.current.style.transform = l;
1023
1023
  }
1024
- }), Nt = r ? [
1024
+ }), at = r ? [
1025
1025
  ...t.map((i) => ({
1026
1026
  ...i,
1027
1027
  id: `prev-repeated-item-${i.id}`,
@@ -1033,12 +1033,12 @@ function Be({
1033
1033
  id: `next-repeated-item-${i.id}`,
1034
1034
  isClonedItem: !0
1035
1035
  }))
1036
- ] : t, { useListenToCustomEvent: at, emitEvent: W } = Ae();
1037
- function ct() {
1038
- const { totalGutterCssVar: i } = ut();
1036
+ ] : t, { useListenToCustomEvent: ct, emitEvent: W } = Le();
1037
+ function ut() {
1038
+ const { totalGutterCssVar: i } = lt();
1039
1039
  return i;
1040
1040
  }
1041
- function Lt() {
1041
+ function Mt() {
1042
1042
  if (x.current) {
1043
1043
  const l = window.getComputedStyle(
1044
1044
  x.current
@@ -1055,7 +1055,7 @@ function Be({
1055
1055
  }));
1056
1056
  }
1057
1057
  function Q(i) {
1058
- O.current && (k.current || R({
1058
+ O.current && (I.current || R({
1059
1059
  type: "prev",
1060
1060
  toIndex: i,
1061
1061
  actionType: "click"
@@ -1065,42 +1065,44 @@ function Be({
1065
1065
  type: i,
1066
1066
  shouldAnimate: l = !0,
1067
1067
  toIndex: g,
1068
- actionType: E
1068
+ actionType: k
1069
1069
  }) {
1070
- var j, ft;
1071
- const T = !l;
1072
- k.current = !1, L.current = !1;
1070
+ var dt, ht;
1071
+ const E = !l;
1072
+ I.current = !1, L.current = !1;
1073
1073
  let v = q.value.get(), C = 0;
1074
- if (i === "next" && (h.current += 1), i === "prev" && (h.current === 0 ? h.current = t.length - 1 : h.current -= 1), g !== void 0 && (h.current = g), i === "next") {
1074
+ if (i === "next" && (d.current += 1), i === "prev" && (d.current === 0 ? d.current = t.length - 1 : d.current -= 1), g !== void 0 && (d.current = g), i === "next") {
1075
1075
  const V = Z(
1076
1076
  r ? y.current * (t.length * 2) : 0
1077
1077
  );
1078
- C = -(h.current * y.current), r && h.current === t.length && (h.current = 0, v = v + y.current * t.length, C = 0), !r && (Math.abs(C) >= V || h.current === t.length - 1) && (L.current = !0, C = -V);
1078
+ C = -(d.current * y.current), r && d.current === t.length && (d.current = 0, v = v + y.current * t.length, C = 0), !r && (Math.abs(C) >= V || d.current === t.length - 1) && (L.current = !0, C = -V);
1079
1079
  }
1080
- i === "prev" && (C = -(h.current * y.current), h.current === t.length - 1 && (v = v - t.length * y.current), !r && C >= 0 && (k.current = !0, C = 0)), M.current = C;
1081
- const N = r ? h.current % t.length : h.current;
1082
- E === "resize" ? (C = -(h.current * y.current), W({
1080
+ i === "prev" && (C = -(d.current * y.current), d.current === t.length - 1 && (v = v - t.length * y.current), !r && C >= 0 && (I.current = !0, C = 0)), M.current = C;
1081
+ const N = r ? d.current % t.length : d.current, j = r ? t.length + d.current % t.length : d.current;
1082
+ k === "resize" ? (C = -(d.current * y.current), W({
1083
1083
  eventName: "onResize",
1084
- sliceActionType: E,
1084
+ sliceActionType: k,
1085
1085
  slideDirection: i,
1086
1086
  currentItem: {
1087
1087
  index: N,
1088
- id: ((j = t.at(N)) == null ? void 0 : j.id) ?? "",
1089
- startReached: k.current,
1088
+ id: ((dt = t.at(N)) == null ? void 0 : dt.id) ?? "",
1089
+ trackIndex: j,
1090
+ startReached: I.current,
1090
1091
  endReached: L.current
1091
1092
  }
1092
1093
  })) : W({
1093
1094
  eventName: "onSlideStartChange",
1094
- sliceActionType: E,
1095
+ sliceActionType: k,
1095
1096
  slideDirection: i,
1096
1097
  nextItem: {
1097
1098
  index: N,
1098
- id: ((ft = t.at(N)) == null ? void 0 : ft.id) ?? "",
1099
- startReached: k.current,
1099
+ id: ((ht = t.at(N)) == null ? void 0 : ht.id) ?? "",
1100
+ trackIndex: j,
1101
+ startReached: I.current,
1100
1102
  endReached: L.current
1101
1103
  }
1102
1104
  }), z.start({
1103
- immediate: T,
1105
+ immediate: E,
1104
1106
  from: {
1105
1107
  value: v
1106
1108
  },
@@ -1114,15 +1116,16 @@ function Be({
1114
1116
  onRest({ finished: V }) {
1115
1117
  var Y;
1116
1118
  if (V) {
1117
- const dt = r ? h.current % t.length : h.current;
1119
+ const pt = r ? d.current % t.length : d.current, Bt = r ? t.length + d.current % t.length : d.current;
1118
1120
  W({
1119
1121
  eventName: "onSlideChangeComplete",
1120
- sliceActionType: E,
1122
+ sliceActionType: k,
1121
1123
  slideDirection: i,
1122
1124
  currentItem: {
1123
- index: dt,
1124
- id: ((Y = t.at(dt)) == null ? void 0 : Y.id) ?? "",
1125
- startReached: k.current,
1125
+ index: pt,
1126
+ id: ((Y = t.at(pt)) == null ? void 0 : Y.id) ?? "",
1127
+ trackIndex: Bt,
1128
+ startReached: I.current,
1126
1129
  endReached: L.current
1127
1130
  }
1128
1131
  });
@@ -1130,33 +1133,33 @@ function Be({
1130
1133
  }
1131
1134
  });
1132
1135
  }
1133
- function Mt() {
1136
+ function Vt() {
1134
1137
  const i = w.current;
1135
1138
  let l = 0;
1136
- return _ === "item" ? l = i.children[0].getBoundingClientRect()[a === "x" ? "width" : "height"] + ct() : l = i.getBoundingClientRect()[a === "x" ? "width" : "height"] + ct(), l;
1139
+ return _ === "item" ? l = i.children[0].getBoundingClientRect()[a === "x" ? "width" : "height"] + ut() : l = i.getBoundingClientRect()[a === "x" ? "width" : "height"] + ut(), l;
1137
1140
  }
1138
1141
  function Z(i) {
1139
1142
  const l = w.current;
1140
1143
  return l[a === "x" ? "scrollWidth" : "scrollHeight"] - l.getBoundingClientRect()[a === "x" ? "width" : "height"] - i;
1141
1144
  }
1142
- function ut() {
1145
+ function lt() {
1143
1146
  let i = 0, l = 0;
1144
1147
  if (x.current) {
1145
1148
  const g = window.getComputedStyle(
1146
1149
  x.current
1147
- ), E = g.getPropertyValue(`--${n}-start-end-gutter`).trim();
1148
- E.includes("px") && (i = Number(
1149
- E.replace("px", "")
1150
+ ), k = g.getPropertyValue(`--${n}-start-end-gutter`).trim();
1151
+ k.includes("px") && (i = Number(
1152
+ k.replace("px", "")
1150
1153
  ));
1151
- const T = g.getPropertyValue(`--${n}-gutter`).trim();
1152
- T.includes("px") && (l = Number(T.replace("px", "")));
1154
+ const E = g.getPropertyValue(`--${n}-gutter`).trim();
1155
+ E.includes("px") && (l = Number(E.replace("px", "")));
1153
1156
  }
1154
1157
  return { totalStartEndGutterCssVar: i, totalGutterCssVar: l };
1155
1158
  }
1156
1159
  U(() => {
1157
- function i(T) {
1158
- const v = Lt();
1159
- switch (T) {
1160
+ function i(E) {
1161
+ const v = Mt();
1162
+ switch (E) {
1160
1163
  case "start":
1161
1164
  return 0;
1162
1165
  case "middle-start":
@@ -1172,43 +1175,43 @@ function Be({
1172
1175
  }
1173
1176
  }
1174
1177
  function l() {
1175
- y.current = Mt(), A.current = y.current / 4;
1176
- const { totalStartEndGutterCssVar: T } = ut();
1178
+ y.current = Vt(), A.current = y.current / 4;
1179
+ const { totalStartEndGutterCssVar: E } = lt();
1177
1180
  let v = 0;
1178
- r && (v = y.current * t.length), v -= y.current * i(c), v -= T / 2, x.current.style.setProperty(
1181
+ r && (v = y.current * t.length), v -= y.current * i(c), v -= E / 2, x.current.style.setProperty(
1179
1182
  `--${n}-offset-modifier`,
1180
1183
  `${-v}px`
1181
1184
  );
1182
1185
  }
1183
- function g(T) {
1184
- x.current && (l(), D(!0), T && T());
1186
+ function g(E) {
1187
+ x.current && (l(), D(!0), E && E());
1185
1188
  }
1186
- function E() {
1189
+ function k() {
1187
1190
  g(), R({
1188
1191
  type: "resize",
1189
- toIndex: h.current,
1192
+ toIndex: d.current,
1190
1193
  shouldAnimate: !1,
1191
1194
  actionType: "resize"
1192
1195
  });
1193
1196
  }
1194
1197
  if (e)
1195
- return O.current = !0, g(u), window.addEventListener("resize", E), () => {
1196
- window.removeEventListener("resize", E);
1198
+ return O.current = !0, g(u), window.addEventListener("resize", k), () => {
1199
+ window.removeEventListener("resize", k);
1197
1200
  };
1198
1201
  }, [e, r, n, a, s, c]), U(() => {
1199
- const i = At(m);
1200
- e && i !== h.current && R({
1202
+ const i = Lt(m);
1203
+ e && i !== d.current && R({
1201
1204
  type: "next",
1202
1205
  toIndex: i,
1203
1206
  actionType: "resize",
1204
1207
  shouldAnimate: !1
1205
1208
  });
1206
1209
  }, [e, m]);
1207
- const lt = f, Vt = Oe(
1210
+ const ft = f, Rt = Ne(
1208
1211
  (i) => {
1209
1212
  if (!O.current)
1210
1213
  return;
1211
- const l = i.dragging, g = i.offset[a === "x" ? 0 : 1], E = i.movement[a === "x" ? 0 : 1], T = E > A.current, v = E < -A.current, C = i.velocity;
1214
+ const l = i.dragging, g = i.offset[a === "x" ? 0 : 1], k = i.movement[a === "x" ? 0 : 1], E = k > A.current, v = k < -A.current, C = i.velocity;
1212
1215
  l && (W({
1213
1216
  ...i,
1214
1217
  eventName: "onDrag",
@@ -1223,7 +1226,7 @@ function Be({
1223
1226
  const j = a === "x" ? `translate3d(calc(${N.value}px + var(--${n}-offset-modifier)), 0px, 0px)` : `translate3d(0px, calc(${N.value}px + var(--${n}-offset-modifier)), 0px)`;
1224
1227
  w.current.style.transform = j;
1225
1228
  }
1226
- }), d && (T || v) && i.cancel()), i.last && (T ? (R({
1229
+ }), h && (E || v) && i.cancel()), i.last && (E ? (R({
1227
1230
  actionType: "drag",
1228
1231
  type: "prev"
1229
1232
  }), i.cancel()) : v ? (R({
@@ -1241,7 +1244,7 @@ function Be({
1241
1244
  }), i.cancel()));
1242
1245
  },
1243
1246
  {
1244
- enabled: lt,
1247
+ enabled: ft,
1245
1248
  axis: a,
1246
1249
  rubberband: !r,
1247
1250
  ...r ? {} : {
@@ -1255,25 +1258,26 @@ function Be({
1255
1258
  from: () => [q.value.get(), q.value.get()]
1256
1259
  }
1257
1260
  );
1258
- function Rt(i) {
1259
- var l, g;
1260
- return typeof i == "number" ? h.current === i : ((l = t.find((E) => E.id === i)) == null ? void 0 : l.id) === ((g = t[h.current]) == null ? void 0 : g.id);
1261
+ function jt(i) {
1262
+ var g;
1263
+ const l = r ? t.length + d.current % t.length : d.current;
1264
+ return typeof i == "number" ? l === i : i === ((g = at[l]) == null ? void 0 : g.id);
1261
1265
  }
1262
1266
  return {
1263
- carouselFragment: /* @__PURE__ */ jt(
1267
+ carouselFragment: /* @__PURE__ */ Ut(
1264
1268
  "div",
1265
1269
  {
1266
1270
  ref: x,
1267
1271
  className: "ReactSpringCarouselContainer",
1268
1272
  "data-part": "Container",
1269
1273
  "data-part-internal": `${n}-Container`,
1270
- ...Vt(),
1274
+ ...Rt(),
1271
1275
  children: [
1272
1276
  /* @__PURE__ */ tt(
1273
1277
  "style",
1274
1278
  {
1275
1279
  dangerouslySetInnerHTML: {
1276
- __html: Ne(`
1280
+ __html: Me(`
1277
1281
  [data-part-internal="${n}-Container"] {
1278
1282
  display: flex;
1279
1283
  width: 100%;
@@ -1286,14 +1290,14 @@ function Be({
1286
1290
  --${n}-scroll-y-value: ${a === "y" ? `calc(var(--${n}-offset-position) + var(--${n}-offset-modifier))` : "0px"};
1287
1291
  --${n}-gutter: 0px;
1288
1292
  --${n}-start-end-gutter: 0px;
1289
- touch-action: ${lt ? a === "x" ? "pan-y" : "pan-x" : "auto"};
1293
+ touch-action: ${ft ? a === "x" ? "pan-y" : "pan-x" : "auto"};
1290
1294
  }
1291
1295
  [data-part-internal="${n}-Track"] {
1292
1296
  display: flex;
1293
1297
  position: relative;
1294
1298
  --initial-offset-modifier: calc(calc(-100% - var(--${n}-gutter) + calc(var(--${n}-start-end-gutter) / 2 / ${t.length} * var(--${n}-items-per-slide)) + var(--${n}-start-end-gutter)) * ${t.length} / var(--${n}-items-per-slide));
1295
- left: ${r && a === "x" && !I ? "var(--initial-offset-modifier)" : "0px"};
1296
- top: ${r && a === "y" && !I ? "var(--initial-offset-modifier)" : "0px"};
1299
+ left: ${r && a === "x" && !S ? "var(--initial-offset-modifier)" : "0px"};
1300
+ top: ${r && a === "y" && !S ? "var(--initial-offset-modifier)" : "0px"};
1297
1301
  flex-direction: ${a === "x" ? "row" : "column"};
1298
1302
  width: 100%;
1299
1303
  height: 100%;
@@ -1335,9 +1339,9 @@ function Be({
1335
1339
  "data-part": "Track",
1336
1340
  "data-part-internal": `${n}-Track`,
1337
1341
  onScroll: () => {
1338
- k.current = !1, L.current = !1;
1342
+ I.current = !1, L.current = !1;
1339
1343
  },
1340
- children: Nt.map((i, l) => /* @__PURE__ */ tt(
1344
+ children: at.map((i, l) => /* @__PURE__ */ tt(
1341
1345
  "div",
1342
1346
  {
1343
1347
  className: "ReactSpringCarouselItem",
@@ -1345,10 +1349,10 @@ function Be({
1345
1349
  "data-part-internal": `${n}-Item`,
1346
1350
  "data-id": i.id,
1347
1351
  children: typeof i.renderItem == "function" ? i.renderItem({
1348
- useListenToCustomEvent: at,
1349
- index: r ? l % t.length : l,
1352
+ useListenToCustomEvent: ct,
1353
+ index: l,
1350
1354
  isClonedItem: !!i.isClonedItem,
1351
- isActiveItem: Rt
1355
+ isActiveItem: jt
1352
1356
  }) : i.renderItem
1353
1357
  },
1354
1358
  `${i.id}-${l}`
@@ -1358,7 +1362,7 @@ function Be({
1358
1362
  ]
1359
1363
  }
1360
1364
  ),
1361
- useListenToCustomEvent: at,
1365
+ useListenToCustomEvent: ct,
1362
1366
  slideToNextItem: () => J(),
1363
1367
  slideToPrevItem: () => Q(),
1364
1368
  slideToItem: (i) => {
@@ -1369,7 +1373,7 @@ function Be({
1369
1373
  );
1370
1374
  return;
1371
1375
  }
1372
- i > h.current ? J(i) : Q(i);
1376
+ i > d.current ? J(i) : Q(i);
1373
1377
  }
1374
1378
  if (typeof i == "string") {
1375
1379
  const l = t.findIndex((g) => g.id === i);
@@ -1379,25 +1383,25 @@ function Be({
1379
1383
  );
1380
1384
  return;
1381
1385
  }
1382
- l > h.current ? J(l) : Q(l);
1386
+ l > d.current ? J(l) : Q(l);
1383
1387
  }
1384
1388
  }
1385
1389
  };
1386
1390
  }
1387
- function Le(e) {
1391
+ function Ve(e) {
1388
1392
  let t = 0;
1389
1393
  const r = getComputedStyle(e).getPropertyValue("gap");
1390
1394
  return r.includes("px") && (t = Number(r.replace("px", ""))), t;
1391
1395
  }
1392
- function Tt(e) {
1396
+ function It(e) {
1393
1397
  return e.scrollWidth - e.clientWidth;
1394
1398
  }
1395
1399
  function st(e) {
1396
- const t = e.children[0], r = Le(e);
1400
+ const t = e.children[0], r = Ve(e);
1397
1401
  return t.getBoundingClientRect().width + r;
1398
1402
  }
1399
- function Ue({ container: e, onReach: t }) {
1400
- const r = $("start"), n = $(0), [, s] = St(() => ({
1403
+ function Ge({ container: e, onReach: t }) {
1404
+ const r = $("start"), n = $(0), [, s] = kt(() => ({
1401
1405
  x: 0
1402
1406
  }));
1403
1407
  function o(c) {
@@ -1418,18 +1422,18 @@ function Ue({ container: e, onReach: t }) {
1418
1422
  return;
1419
1423
  let f = 0;
1420
1424
  if (c === "next" && (n.current += 1), c === "prev" && (n.current -= 1), f = n.current * st(e.current), c === "next") {
1421
- const d = Tt(e.current);
1422
- f > d && (r.current = "end", f = d, t && t("end"));
1425
+ const h = It(e.current);
1426
+ f > h && (r.current = "end", f = h, t && t("end"));
1423
1427
  }
1424
1428
  c === "prev" && f <= 0 && (r.current = "start", n.current = 0, f = 0, t && t("start")), o(f);
1425
1429
  }
1426
1430
  return U(() => {
1427
1431
  function c() {
1428
1432
  var M;
1429
- const I = st(e.current), D = ((M = [...e.current.children].at(0)) == null ? void 0 : M.getBoundingClientRect().width) || 0, O = Array(e.current.childElementCount).fill(0).map((y, k) => ({
1430
- index: k,
1431
- start: I * k,
1432
- end: I * (k + 1)
1433
+ const S = st(e.current), D = ((M = [...e.current.children].at(0)) == null ? void 0 : M.getBoundingClientRect().width) || 0, O = Array(e.current.childElementCount).fill(0).map((y, I) => ({
1434
+ index: I,
1435
+ start: S * I,
1436
+ end: S * (I + 1)
1433
1437
  })), x = e.current.scrollLeft + D, w = O.find(
1434
1438
  (y) => x >= y.start && x < y.end
1435
1439
  );
@@ -1438,9 +1442,9 @@ function Ue({ container: e, onReach: t }) {
1438
1442
  function f() {
1439
1443
  s.stop();
1440
1444
  }
1441
- function d(I) {
1442
- const D = I.target;
1443
- D.scrollLeft === 0 ? (n.current = 0, r.current = "start", t && t("start")) : D.scrollLeft >= Tt(D) ? (r.current = "end", t && t("end")) : r.current !== "idle" && (r.current = "idle", t && t("idle"));
1445
+ function h(S) {
1446
+ const D = S.target;
1447
+ D.scrollLeft === 0 ? (n.current = 0, r.current = "start", t && t("start")) : D.scrollLeft >= It(D) ? (r.current = "end", t && t("end")) : r.current !== "idle" && (r.current = "idle", t && t("idle"));
1444
1448
  }
1445
1449
  let u, _ = 0;
1446
1450
  function m() {
@@ -1451,8 +1455,8 @@ function Ue({ container: e, onReach: t }) {
1451
1455
  if (e.current)
1452
1456
  return e.current.addEventListener("wheel", f, {
1453
1457
  passive: !0
1454
- }), e.current.addEventListener("scroll", d), e.current.addEventListener("scroll", m), () => {
1455
- e.current && (e.current.removeEventListener("scroll", m), e.current.removeEventListener("scroll", d), e.current.removeEventListener("wheel", f));
1458
+ }), e.current.addEventListener("scroll", h), e.current.addEventListener("scroll", m), () => {
1459
+ e.current && (e.current.removeEventListener("scroll", m), e.current.removeEventListener("scroll", h), e.current.removeEventListener("wheel", f));
1456
1460
  };
1457
1461
  }, [e, t]), U(() => {
1458
1462
  if (e.current) {
@@ -1473,6 +1477,6 @@ function Ue({ container: e, onReach: t }) {
1473
1477
  };
1474
1478
  }
1475
1479
  export {
1476
- Be as useSpringCarousel,
1477
- Ue as useSpringScroll
1480
+ Ke as useSpringCarousel,
1481
+ Ge as useSpringScroll
1478
1482
  };