react-spring-carousel 3.0.0-beta090.24 → 3.0.0-beta090.26

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,15 +1,1702 @@
1
- import { useSpringCarousel as n, useSpringCarouselContext as u } from "./index.es2.js";
2
- import { useTransitionCarousel as C, useTransitionCarouselContext as l } from "./index.es3.js";
3
- import "./useThumbsModule-4e4b7969.js";
4
- import "react";
5
- import "@react-spring/web";
6
- import "@use-gesture/react";
7
- import "resize-observer-polyfill";
8
- import "screenfull";
1
+ import lr, { useRef as $, useEffect as de, createContext as fr, useCallback as Oe, useContext as dr, useState as Er } from "react";
2
+ import { useSpring as vr, config as De, useIsomorphicLayoutEffect as Tr, useTransition as Rr, a as wr } from "@react-spring/web";
3
+ import { useDrag as hr } from "@use-gesture/react";
4
+ import _r from "resize-observer-polyfill";
5
+ import Re from "screenfull";
6
+ var A = {}, Cr = {
7
+ get exports() {
8
+ return A;
9
+ },
10
+ set exports(n) {
11
+ A = n;
12
+ }
13
+ }, Be = {};
14
+ /**
15
+ * @license React
16
+ * react-jsx-runtime.production.min.js
17
+ *
18
+ * Copyright (c) Facebook, Inc. and its affiliates.
19
+ *
20
+ * This source code is licensed under the MIT license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+ var cr;
24
+ function Ir() {
25
+ if (cr)
26
+ return Be;
27
+ cr = 1;
28
+ var n = lr, g = Symbol.for("react.element"), y = Symbol.for("react.fragment"), D = Object.prototype.hasOwnProperty, Y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
29
+ function T(l, f, d) {
30
+ var W, q = {}, _ = null, u = null;
31
+ d !== void 0 && (_ = "" + d), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (u = f.ref);
32
+ for (W in f)
33
+ D.call(f, W) && !v.hasOwnProperty(W) && (q[W] = f[W]);
34
+ if (l && l.defaultProps)
35
+ for (W in f = l.defaultProps, f)
36
+ q[W] === void 0 && (q[W] = f[W]);
37
+ return { $$typeof: g, type: l, key: _, ref: u, props: q, _owner: Y.current };
38
+ }
39
+ return Be.Fragment = y, Be.jsx = T, Be.jsxs = T, Be;
40
+ }
41
+ var qe = {};
42
+ /**
43
+ * @license React
44
+ * react-jsx-runtime.development.js
45
+ *
46
+ * Copyright (c) Facebook, Inc. and its affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */
51
+ var sr;
52
+ function Pr() {
53
+ return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
54
+ var n = lr, g = Symbol.for("react.element"), y = Symbol.for("react.portal"), D = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), U = Symbol.iterator, x = "@@iterator";
55
+ function ae(e) {
56
+ if (e === null || typeof e != "object")
57
+ return null;
58
+ var t = U && e[U] || e[x];
59
+ return typeof t == "function" ? t : null;
60
+ }
61
+ var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
62
+ function O(e) {
63
+ {
64
+ for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
65
+ i[s - 1] = arguments[s];
66
+ ee("error", e, i);
67
+ }
68
+ }
69
+ function ee(e, t, i) {
70
+ {
71
+ var s = j.ReactDebugCurrentFrame, b = s.getStackAddendum();
72
+ b !== "" && (t += "%s", i = i.concat([b]));
73
+ var w = i.map(function(p) {
74
+ return String(p);
75
+ });
76
+ w.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, w);
77
+ }
78
+ }
79
+ var re = !1, J = !1, Z = !1, oe = !1, z = !1, ve;
80
+ ve = Symbol.for("react.module.reference");
81
+ function we(e) {
82
+ return !!(typeof e == "string" || typeof e == "function" || e === D || e === v || z || e === Y || e === d || e === W || oe || e === u || re || J || Z || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === q || e.$$typeof === T || e.$$typeof === l || e.$$typeof === f || // This needs to include all possible module reference object
83
+ // types supported by any Flight configuration anywhere since
84
+ // we don't know which Flight build this will end up being used
85
+ // with.
86
+ e.$$typeof === ve || e.getModuleId !== void 0));
87
+ }
88
+ function V(e, t, i) {
89
+ var s = e.displayName;
90
+ if (s)
91
+ return s;
92
+ var b = t.displayName || t.name || "";
93
+ return b !== "" ? i + "(" + b + ")" : i;
94
+ }
95
+ function I(e) {
96
+ return e.displayName || "Context";
97
+ }
98
+ function m(e) {
99
+ if (e == null)
100
+ return null;
101
+ if (typeof e.tag == "number" && O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
102
+ return e.displayName || e.name || null;
103
+ if (typeof e == "string")
104
+ return e;
105
+ switch (e) {
106
+ case D:
107
+ return "Fragment";
108
+ case y:
109
+ return "Portal";
110
+ case v:
111
+ return "Profiler";
112
+ case Y:
113
+ return "StrictMode";
114
+ case d:
115
+ return "Suspense";
116
+ case W:
117
+ return "SuspenseList";
118
+ }
119
+ if (typeof e == "object")
120
+ switch (e.$$typeof) {
121
+ case l:
122
+ var t = e;
123
+ return I(t) + ".Consumer";
124
+ case T:
125
+ var i = e;
126
+ return I(i._context) + ".Provider";
127
+ case f:
128
+ return V(e, e.render, "ForwardRef");
129
+ case q:
130
+ var s = e.displayName || null;
131
+ return s !== null ? s : m(e.type) || "Memo";
132
+ case _: {
133
+ var b = e, w = b._payload, p = b._init;
134
+ try {
135
+ return m(p(w));
136
+ } catch {
137
+ return null;
138
+ }
139
+ }
140
+ }
141
+ return null;
142
+ }
143
+ var E = Object.assign, P = 0, he, me, c, R, F, te, L;
144
+ function Me() {
145
+ }
146
+ Me.__reactDisabledLog = !0;
147
+ function Pe() {
148
+ {
149
+ if (P === 0) {
150
+ he = console.log, me = console.info, c = console.warn, R = console.error, F = console.group, te = console.groupCollapsed, L = console.groupEnd;
151
+ var e = {
152
+ configurable: !0,
153
+ enumerable: !0,
154
+ value: Me,
155
+ writable: !0
156
+ };
157
+ Object.defineProperties(console, {
158
+ info: e,
159
+ log: e,
160
+ warn: e,
161
+ error: e,
162
+ group: e,
163
+ groupCollapsed: e,
164
+ groupEnd: e
165
+ });
166
+ }
167
+ P++;
168
+ }
169
+ }
170
+ function ue() {
171
+ {
172
+ if (P--, P === 0) {
173
+ var e = {
174
+ configurable: !0,
175
+ enumerable: !0,
176
+ writable: !0
177
+ };
178
+ Object.defineProperties(console, {
179
+ log: E({}, e, {
180
+ value: he
181
+ }),
182
+ info: E({}, e, {
183
+ value: me
184
+ }),
185
+ warn: E({}, e, {
186
+ value: c
187
+ }),
188
+ error: E({}, e, {
189
+ value: R
190
+ }),
191
+ group: E({}, e, {
192
+ value: F
193
+ }),
194
+ groupCollapsed: E({}, e, {
195
+ value: te
196
+ }),
197
+ groupEnd: E({}, e, {
198
+ value: L
199
+ })
200
+ });
201
+ }
202
+ P < 0 && O("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
203
+ }
204
+ }
205
+ var B = j.ReactCurrentDispatcher, pe;
206
+ function ce(e, t, i) {
207
+ {
208
+ if (pe === void 0)
209
+ try {
210
+ throw Error();
211
+ } catch (b) {
212
+ var s = b.stack.trim().match(/\n( *(at )?)/);
213
+ pe = s && s[1] || "";
214
+ }
215
+ return `
216
+ ` + pe + e;
217
+ }
218
+ }
219
+ var We = !1, ke;
220
+ {
221
+ var Le = typeof WeakMap == "function" ? WeakMap : Map;
222
+ ke = new Le();
223
+ }
224
+ function Ne(e, t) {
225
+ if (!e || We)
226
+ return "";
227
+ {
228
+ var i = ke.get(e);
229
+ if (i !== void 0)
230
+ return i;
231
+ }
232
+ var s;
233
+ We = !0;
234
+ var b = Error.prepareStackTrace;
235
+ Error.prepareStackTrace = void 0;
236
+ var w;
237
+ w = B.current, B.current = null, Pe();
238
+ try {
239
+ if (t) {
240
+ var p = function() {
241
+ throw Error();
242
+ };
243
+ if (Object.defineProperty(p.prototype, "props", {
244
+ set: function() {
245
+ throw Error();
246
+ }
247
+ }), typeof Reflect == "object" && Reflect.construct) {
248
+ try {
249
+ Reflect.construct(p, []);
250
+ } catch (fe) {
251
+ s = fe;
252
+ }
253
+ Reflect.construct(e, [], p);
254
+ } else {
255
+ try {
256
+ p.call();
257
+ } catch (fe) {
258
+ s = fe;
259
+ }
260
+ e.call(p.prototype);
261
+ }
262
+ } else {
263
+ try {
264
+ throw Error();
265
+ } catch (fe) {
266
+ s = fe;
267
+ }
268
+ e();
269
+ }
270
+ } catch (fe) {
271
+ if (fe && s && typeof fe.stack == "string") {
272
+ for (var h = fe.stack.split(`
273
+ `), H = s.stack.split(`
274
+ `), N = h.length - 1, S = H.length - 1; N >= 1 && S >= 0 && h[N] !== H[S]; )
275
+ S--;
276
+ for (; N >= 1 && S >= 0; N--, S--)
277
+ if (h[N] !== H[S]) {
278
+ if (N !== 1 || S !== 1)
279
+ do
280
+ if (N--, S--, S < 0 || h[N] !== H[S]) {
281
+ var Q = `
282
+ ` + h[N].replace(" at new ", " at ");
283
+ return e.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", e.displayName)), typeof e == "function" && ke.set(e, Q), Q;
284
+ }
285
+ while (N >= 1 && S >= 0);
286
+ break;
287
+ }
288
+ }
289
+ } finally {
290
+ We = !1, B.current = w, ue(), Error.prepareStackTrace = b;
291
+ }
292
+ var je = e ? e.displayName || e.name : "", ur = je ? ce(je) : "";
293
+ return typeof e == "function" && ke.set(e, ur), ur;
294
+ }
295
+ function He(e, t, i) {
296
+ return Ne(e, !1);
297
+ }
298
+ function Qe(e) {
299
+ var t = e.prototype;
300
+ return !!(t && t.isReactComponent);
301
+ }
302
+ function C(e, t, i) {
303
+ if (e == null)
304
+ return "";
305
+ if (typeof e == "function")
306
+ return Ne(e, Qe(e));
307
+ if (typeof e == "string")
308
+ return ce(e);
309
+ switch (e) {
310
+ case d:
311
+ return ce("Suspense");
312
+ case W:
313
+ return ce("SuspenseList");
314
+ }
315
+ if (typeof e == "object")
316
+ switch (e.$$typeof) {
317
+ case f:
318
+ return He(e.render);
319
+ case q:
320
+ return C(e.type, t, i);
321
+ case _: {
322
+ var s = e, b = s._payload, w = s._init;
323
+ try {
324
+ return C(w(b), t, i);
325
+ } catch {
326
+ }
327
+ }
328
+ }
329
+ return "";
330
+ }
331
+ var G = Object.prototype.hasOwnProperty, M = {}, Ae = j.ReactDebugCurrentFrame;
332
+ function ne(e) {
333
+ if (e) {
334
+ var t = e._owner, i = C(e.type, e._source, t ? t.type : null);
335
+ Ae.setExtraStackFrame(i);
336
+ } else
337
+ Ae.setExtraStackFrame(null);
338
+ }
339
+ function _e(e, t, i, s, b) {
340
+ {
341
+ var w = Function.call.bind(G);
342
+ for (var p in e)
343
+ if (w(e, p)) {
344
+ var h = void 0;
345
+ try {
346
+ if (typeof e[p] != "function") {
347
+ var H = Error((s || "React class") + ": " + i + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
348
+ throw H.name = "Invariant Violation", H;
349
+ }
350
+ h = e[p](t, p, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
351
+ } catch (N) {
352
+ h = N;
353
+ }
354
+ h && !(h instanceof Error) && (ne(b), O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, p, typeof h), ne(null)), h instanceof Error && !(h.message in M) && (M[h.message] = !0, ne(b), O("Failed %s type: %s", i, h.message), ne(null));
355
+ }
356
+ }
357
+ }
358
+ var Fe = Array.isArray;
359
+ function X(e) {
360
+ return Fe(e);
361
+ }
362
+ function Ce(e) {
363
+ {
364
+ var t = typeof Symbol == "function" && Symbol.toStringTag, i = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
365
+ return i;
366
+ }
367
+ }
368
+ function ge(e) {
369
+ try {
370
+ return se(e), !1;
371
+ } catch {
372
+ return !0;
373
+ }
374
+ }
375
+ function se(e) {
376
+ return "" + e;
377
+ }
378
+ function Je(e) {
379
+ if (ge(e))
380
+ return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ce(e)), se(e);
381
+ }
382
+ var ye = j.ReactCurrentOwner, ir = {
383
+ key: !0,
384
+ ref: !0,
385
+ __self: !0,
386
+ __source: !0
387
+ }, ze, Xe, be;
388
+ be = {};
389
+ function Ge(e) {
390
+ if (G.call(e, "ref")) {
391
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
392
+ if (t && t.isReactWarning)
393
+ return !1;
394
+ }
395
+ return e.ref !== void 0;
396
+ }
397
+ function xe(e) {
398
+ if (G.call(e, "key")) {
399
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
400
+ if (t && t.isReactWarning)
401
+ return !1;
402
+ }
403
+ return e.key !== void 0;
404
+ }
405
+ function Ve(e, t) {
406
+ if (typeof e.ref == "string" && ye.current && t && ye.current.stateNode !== t) {
407
+ var i = m(ye.current.type);
408
+ be[i] || (O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', m(ye.current.type), e.ref), be[i] = !0);
409
+ }
410
+ }
411
+ function Se(e, t) {
412
+ {
413
+ var i = function() {
414
+ ze || (ze = !0, O("%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://reactjs.org/link/special-props)", t));
415
+ };
416
+ i.isReactWarning = !0, Object.defineProperty(e, "key", {
417
+ get: i,
418
+ configurable: !0
419
+ });
420
+ }
421
+ }
422
+ function Ye(e, t) {
423
+ {
424
+ var i = function() {
425
+ Xe || (Xe = !0, O("%s: `ref` 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://reactjs.org/link/special-props)", t));
426
+ };
427
+ i.isReactWarning = !0, Object.defineProperty(e, "ref", {
428
+ get: i,
429
+ configurable: !0
430
+ });
431
+ }
432
+ }
433
+ var Ue = function(e, t, i, s, b, w, p) {
434
+ var h = {
435
+ // This tag allows us to uniquely identify this as a React Element
436
+ $$typeof: g,
437
+ // Built-in properties that belong on the element
438
+ type: e,
439
+ key: t,
440
+ ref: i,
441
+ props: p,
442
+ // Record the component responsible for creating this element.
443
+ _owner: w
444
+ };
445
+ return h._store = {}, Object.defineProperty(h._store, "validated", {
446
+ configurable: !1,
447
+ enumerable: !1,
448
+ writable: !0,
449
+ value: !1
450
+ }), Object.defineProperty(h, "_self", {
451
+ configurable: !1,
452
+ enumerable: !1,
453
+ writable: !1,
454
+ value: s
455
+ }), Object.defineProperty(h, "_source", {
456
+ configurable: !1,
457
+ enumerable: !1,
458
+ writable: !1,
459
+ value: b
460
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
461
+ };
462
+ function er(e, t, i, s, b) {
463
+ {
464
+ var w, p = {}, h = null, H = null;
465
+ i !== void 0 && (Je(i), h = "" + i), xe(t) && (Je(t.key), h = "" + t.key), Ge(t) && (H = t.ref, Ve(t, b));
466
+ for (w in t)
467
+ G.call(t, w) && !ir.hasOwnProperty(w) && (p[w] = t[w]);
468
+ if (e && e.defaultProps) {
469
+ var N = e.defaultProps;
470
+ for (w in N)
471
+ p[w] === void 0 && (p[w] = N[w]);
472
+ }
473
+ if (h || H) {
474
+ var S = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
475
+ h && Se(p, S), H && Ye(p, S);
476
+ }
477
+ return Ue(e, h, H, b, s, ye.current, p);
478
+ }
479
+ }
480
+ var Ie = j.ReactCurrentOwner, Ke = j.ReactDebugCurrentFrame;
481
+ function Ee(e) {
482
+ if (e) {
483
+ var t = e._owner, i = C(e.type, e._source, t ? t.type : null);
484
+ Ke.setExtraStackFrame(i);
485
+ } else
486
+ Ke.setExtraStackFrame(null);
487
+ }
488
+ var r;
489
+ r = !1;
490
+ function o(e) {
491
+ return typeof e == "object" && e !== null && e.$$typeof === g;
492
+ }
493
+ function a() {
494
+ {
495
+ if (Ie.current) {
496
+ var e = m(Ie.current.type);
497
+ if (e)
498
+ return `
499
+
500
+ Check the render method of \`` + e + "`.";
501
+ }
502
+ return "";
503
+ }
504
+ }
505
+ function k(e) {
506
+ {
507
+ if (e !== void 0) {
508
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
509
+ return `
510
+
511
+ Check your code at ` + t + ":" + i + ".";
512
+ }
513
+ return "";
514
+ }
515
+ }
516
+ var K = {};
517
+ function Te(e) {
518
+ {
519
+ var t = a();
520
+ if (!t) {
521
+ var i = typeof e == "string" ? e : e.displayName || e.name;
522
+ i && (t = `
523
+
524
+ Check the top-level render call using <` + i + ">.");
525
+ }
526
+ return t;
527
+ }
528
+ }
529
+ function le(e, t) {
530
+ {
531
+ if (!e._store || e._store.validated || e.key != null)
532
+ return;
533
+ e._store.validated = !0;
534
+ var i = Te(t);
535
+ if (K[i])
536
+ return;
537
+ K[i] = !0;
538
+ var s = "";
539
+ e && e._owner && e._owner !== Ie.current && (s = " It was passed a child from " + m(e._owner.type) + "."), Ee(e), O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), Ee(null);
540
+ }
541
+ }
542
+ function Ze(e, t) {
543
+ {
544
+ if (typeof e != "object")
545
+ return;
546
+ if (X(e))
547
+ for (var i = 0; i < e.length; i++) {
548
+ var s = e[i];
549
+ o(s) && le(s, t);
550
+ }
551
+ else if (o(e))
552
+ e._store && (e._store.validated = !0);
553
+ else if (e) {
554
+ var b = ae(e);
555
+ if (typeof b == "function" && b !== e.entries)
556
+ for (var w = b.call(e), p; !(p = w.next()).done; )
557
+ o(p.value) && le(p.value, t);
558
+ }
559
+ }
560
+ }
561
+ function ie(e) {
562
+ {
563
+ var t = e.type;
564
+ if (t == null || typeof t == "string")
565
+ return;
566
+ var i;
567
+ if (typeof t == "function")
568
+ i = t.propTypes;
569
+ else if (typeof t == "object" && (t.$$typeof === f || // Note: Memo only checks outer props here.
570
+ // Inner props are checked in the reconciler.
571
+ t.$$typeof === q))
572
+ i = t.propTypes;
573
+ else
574
+ return;
575
+ if (i) {
576
+ var s = m(t);
577
+ _e(i, e.props, "prop", s, e);
578
+ } else if (t.PropTypes !== void 0 && !r) {
579
+ r = !0;
580
+ var b = m(t);
581
+ O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
582
+ }
583
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
584
+ }
585
+ }
586
+ function ar(e) {
587
+ {
588
+ for (var t = Object.keys(e.props), i = 0; i < t.length; i++) {
589
+ var s = t[i];
590
+ if (s !== "children" && s !== "key") {
591
+ Ee(e), O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), Ee(null);
592
+ break;
593
+ }
594
+ }
595
+ e.ref !== null && (Ee(e), O("Invalid attribute `ref` supplied to `React.Fragment`."), Ee(null));
596
+ }
597
+ }
598
+ function or(e, t, i, s, b, w) {
599
+ {
600
+ var p = we(e);
601
+ if (!p) {
602
+ var h = "";
603
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
604
+ var H = k(b);
605
+ H ? h += H : h += a();
606
+ var N;
607
+ e === null ? N = "null" : X(e) ? N = "array" : e !== void 0 && e.$$typeof === g ? (N = "<" + (m(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, h);
608
+ }
609
+ var S = er(e, t, i, b, w);
610
+ if (S == null)
611
+ return S;
612
+ if (p) {
613
+ var Q = t.children;
614
+ if (Q !== void 0)
615
+ if (s)
616
+ if (X(Q)) {
617
+ for (var je = 0; je < Q.length; je++)
618
+ Ze(Q[je], e);
619
+ Object.freeze && Object.freeze(Q);
620
+ } else
621
+ O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
622
+ else
623
+ Ze(Q, e);
624
+ }
625
+ return e === D ? ar(S) : ie(S), S;
626
+ }
627
+ }
628
+ function gr(e, t, i) {
629
+ return or(e, t, i, !0);
630
+ }
631
+ function yr(e, t, i) {
632
+ return or(e, t, i, !1);
633
+ }
634
+ var br = yr, xr = gr;
635
+ qe.Fragment = D, qe.jsx = br, qe.jsxs = xr;
636
+ }()), qe;
637
+ }
638
+ (function(n) {
639
+ process.env.NODE_ENV === "production" ? n.exports = Ir() : n.exports = Pr();
640
+ })(Cr);
641
+ const rr = "RSC::Event";
642
+ function mr() {
643
+ const n = $(null);
644
+ function g(D) {
645
+ de(() => {
646
+ n.current || (n.current = document.createElement("div"));
647
+ function Y(v) {
648
+ D(v.detail);
649
+ }
650
+ if (n.current)
651
+ return n.current.addEventListener(rr, Y, !1), () => {
652
+ var v;
653
+ (v = n.current) == null || v.removeEventListener(rr, Y, !1);
654
+ };
655
+ }, [D]);
656
+ }
657
+ function y(D) {
658
+ if (n.current) {
659
+ const Y = new CustomEvent(rr, {
660
+ detail: D
661
+ });
662
+ n.current.dispatchEvent(Y);
663
+ }
664
+ }
665
+ return {
666
+ useListenToCustomEvent: g,
667
+ emitEvent: y
668
+ };
669
+ }
670
+ function kr({
671
+ mainCarouselWrapperRef: n,
672
+ onFullScreenChange: g,
673
+ handleResize: y
674
+ }) {
675
+ const D = $(!1);
676
+ de(() => {
677
+ function f() {
678
+ document.fullscreenElement && (Y(!0), g(!0), y && y()), document.fullscreenElement || (Y(!1), g(!1), y && y());
679
+ }
680
+ if (Re.isEnabled)
681
+ return Re.on("change", f), () => {
682
+ Re.isEnabled && Re.off("change", f);
683
+ };
684
+ }, []);
685
+ function Y(f) {
686
+ D.current = f;
687
+ }
688
+ function v() {
689
+ return D.current;
690
+ }
691
+ function T(f) {
692
+ Re.isEnabled && Re.request(f || n.current);
693
+ }
694
+ function l() {
695
+ Re.isEnabled && Re.exit();
696
+ }
697
+ return {
698
+ enterFullscreen: T,
699
+ exitFullscreen: l,
700
+ getIsFullscreen: v
701
+ };
702
+ }
703
+ function Fr(n) {
704
+ const g = n.getBoundingClientRect();
705
+ return g.top >= 0 && g.left >= 0 && g.bottom <= (window.innerHeight || document.documentElement.clientHeight) && g.right <= (window.innerWidth || document.documentElement.clientWidth);
706
+ }
707
+ function pr({
708
+ thumbsSlideAxis: n = "x",
709
+ withThumbs: g = !1,
710
+ prepareThumbsData: y,
711
+ items: D,
712
+ renderThumbFnProps: Y
713
+ }) {
714
+ const v = $(null), [T, l] = vr(() => ({
715
+ val: 0
716
+ }));
717
+ function f() {
718
+ var _;
719
+ return v.current ? Math.round(
720
+ Number((_ = v.current) == null ? void 0 : _[n === "x" ? "scrollWidth" : "scrollHeight"]) - v.current.getBoundingClientRect()[n === "x" ? "width" : "height"]
721
+ ) : 0;
722
+ }
723
+ function d(_) {
724
+ var x;
725
+ function u() {
726
+ return v.current ? v.current.querySelector(
727
+ `#thumb-item-${D[_].id}`
728
+ ) : null;
729
+ }
730
+ const U = u();
731
+ if (U && v.current && !Fr(U)) {
732
+ const ae = U.offsetLeft, j = ae > f() ? f() : ae;
733
+ l.start({
734
+ from: {
735
+ val: ((x = v.current) == null ? void 0 : x[n === "x" ? "scrollLeft" : "scrollTop"]) ?? 0
736
+ },
737
+ to: {
738
+ val: j
739
+ },
740
+ onChange: ({ value: O }) => {
741
+ v.current && (v.current[n === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(
742
+ O.val
743
+ ));
744
+ }
745
+ });
746
+ }
747
+ }
748
+ function W() {
749
+ function _(u) {
750
+ return u.map((U) => ({
751
+ id: U.id,
752
+ renderThumb: U.renderThumb
753
+ }));
754
+ }
755
+ return y ? y(_(D)) : _(D);
756
+ }
757
+ return {
758
+ thumbsFragment: g ? /* @__PURE__ */ A.jsx(
759
+ "div",
760
+ {
761
+ className: "use-spring-carousel-thumbs-wrapper",
762
+ ref: v,
763
+ onWheel: () => T.val.stop(),
764
+ style: {
765
+ display: "flex",
766
+ flex: "1",
767
+ position: "relative",
768
+ width: "100%",
769
+ height: "100%",
770
+ flexDirection: n === "x" ? "row" : "column",
771
+ ...n === "x" ? { overflowX: "auto" } : {
772
+ overflowY: "auto",
773
+ maxHeight: "100%"
774
+ }
775
+ },
776
+ children: W().map(({ id: _, renderThumb: u }) => {
777
+ const U = `thumb-item-${_}`;
778
+ return /* @__PURE__ */ A.jsx("div", { id: U, className: "thumb-item", children: typeof u == "function" ? u(Y) : u }, U);
779
+ })
780
+ }
781
+ ) : null,
782
+ handleScroll: d
783
+ };
784
+ }
785
+ function Wr({
786
+ items: n,
787
+ init: g = !0,
788
+ withThumbs: y,
789
+ thumbsSlideAxis: D = "x",
790
+ itemsPerSlide: Y = 1,
791
+ slideType: v = "fixed",
792
+ gutter: T = 0,
793
+ withLoop: l = !1,
794
+ startEndGutter: f = 0,
795
+ carouselSlideAxis: d = "x",
796
+ disableGestures: W = !1,
797
+ draggingSlideTreshold: q,
798
+ slideWhenThresholdIsReached: _ = !1,
799
+ freeScroll: u,
800
+ enableFreeScrollDrag: U,
801
+ initialStartingPosition: x,
802
+ prepareThumbsData: ae,
803
+ initialActiveItem: j = 0,
804
+ animateWhenActiveItemChange: O = !0,
805
+ slideGroupOfItems: ee = !1,
806
+ slideAmount: re
807
+ }) {
808
+ const J = Y > n.length ? n.length : Y, Z = $(!1), oe = $(q ?? 0), z = $("initial"), ve = $("initial"), we = $("initial"), V = $(j), I = $(j === 0), m = $(v === "fixed" && j === n.length - 1), E = $(null), P = $(null), he = $(0), me = $(0), c = $(0), R = $(l), F = $(v), te = $(u), L = $(!1), Pe = Oe(() => l ? [
809
+ ...n.map((r) => ({
810
+ ...r,
811
+ id: `prev-repeated-item-${r.id}`
812
+ })),
813
+ ...n,
814
+ ...n.map((r) => ({
815
+ ...r,
816
+ id: `next-repeated-item-${r.id}`
817
+ }))
818
+ ] : [...n], [n, l])(), [ue, B] = vr(
819
+ () => ({
820
+ val: 0,
821
+ pause: !g,
822
+ onChange: ({ value: r }) => {
823
+ u && E.current ? (d === "x" ? E.current.scrollLeft = Math.abs(r.val) : E.current.scrollTop = Math.abs(r.val), be()) : P.current && (d === "x" ? P.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : P.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
824
+ }
825
+ }),
826
+ [u]
827
+ ), { emitEvent: pe, useListenToCustomEvent: ce } = mr(), { thumbsFragment: We, handleScroll: ke } = pr({
828
+ withThumbs: !!y,
829
+ thumbsSlideAxis: D,
830
+ prepareThumbsData: ae,
831
+ items: n,
832
+ renderThumbFnProps: {
833
+ getIsActiveItem: Ue,
834
+ getIsPrevItem: Ye,
835
+ useListenToCustomEvent: ce,
836
+ getIsNextItem: Se
837
+ }
838
+ }), { enterFullscreen: Le, exitFullscreen: Ne, getIsFullscreen: He } = kr({
839
+ mainCarouselWrapperRef: E,
840
+ handleResize: () => Fe(),
841
+ onFullScreenChange: (r) => {
842
+ pe({
843
+ eventName: "onFullscreenChange",
844
+ isFullscreen: r
845
+ });
846
+ }
847
+ });
848
+ function Qe(r) {
849
+ return v === "fixed" && !u ? {
850
+ marginRight: `${r ? 0 : T}px`,
851
+ flex: `1 0 calc(100% / ${J} - ${T * (J - 1) / J}px)`
852
+ } : {
853
+ marginRight: `${r ? 0 : T}px`
854
+ };
855
+ }
856
+ const C = Oe(() => {
857
+ var a;
858
+ if (typeof re == "number" && re > 0 && (v === "fluid" || u))
859
+ return re;
860
+ const r = ee ? E.current : (a = E.current) == null ? void 0 : a.querySelector(".use-spring-carousel-item");
861
+ if (!r)
862
+ throw Error("No carousel items available!");
863
+ let o = r.getBoundingClientRect()[d === "x" ? "width" : "height"];
864
+ return ee || (o += T), ee && (o += T - f * 2), o;
865
+ }, [
866
+ d,
867
+ u,
868
+ T,
869
+ re,
870
+ ee,
871
+ v,
872
+ f
873
+ ]);
874
+ function G({ from: r, to: o, nextActiveItem: a, immediate: k = !1, slideMode: K }) {
875
+ ve.current = K, typeof a == "number" && (u || (V.current = a), pe({
876
+ eventName: "onSlideStartChange",
877
+ slideActionType: z.current,
878
+ slideMode: ve.current,
879
+ nextItem: {
880
+ startReached: I.current,
881
+ endReached: m.current,
882
+ index: u ? -1 : V.current,
883
+ id: u ? "" : n[V.current].id
884
+ }
885
+ })), c.current = o, B.start({
886
+ immediate: k,
887
+ from: {
888
+ val: r
889
+ },
890
+ to: {
891
+ val: o
892
+ },
893
+ config: {
894
+ ...De.default,
895
+ velocity: ue.val.velocity
896
+ },
897
+ onRest(Te) {
898
+ !k && Te.finished && pe({
899
+ eventName: "onSlideChange",
900
+ slideActionType: z.current,
901
+ slideMode: ve.current,
902
+ currentItem: {
903
+ startReached: I.current,
904
+ endReached: m.current,
905
+ index: u ? -1 : V.current,
906
+ id: u ? "" : n[V.current].id
907
+ }
908
+ });
909
+ }
910
+ }), y && !k && ke(V.current);
911
+ }
912
+ const M = Oe(() => {
913
+ var r;
914
+ return P.current ? l ? C() * n.length : Math.round(
915
+ Number(
916
+ (r = P.current) == null ? void 0 : r[d === "x" ? "scrollWidth" : "scrollHeight"]
917
+ ) - P.current.getBoundingClientRect()[d === "x" ? "width" : "height"] - f * 2
918
+ ) : 0;
919
+ }, [d, C, n.length, f, l]);
920
+ function Ae() {
921
+ const r = `calc(100% - ${f * 2}px)`;
922
+ return {
923
+ width: d === "x" ? r : "100%",
924
+ height: d === "y" ? r : "100%"
925
+ };
926
+ }
927
+ const ne = Oe(() => {
928
+ var o;
929
+ const r = (o = P.current) == null ? void 0 : o.querySelector(".use-spring-carousel-item");
930
+ if (!r)
931
+ throw Error("No carousel items available!");
932
+ return r.getBoundingClientRect()[d === "x" ? "width" : "height"] + T;
933
+ }, [d, T]), _e = Oe(
934
+ (r) => {
935
+ const o = d === "x" ? "left" : "top", a = P.current;
936
+ a && (l ? (a.style.top = "0px", a.style.left = "0px", a.style[o] = `-${r - f}px`, I.current = !1, m.current = !1) : (a.style.left = "0px", a.style.top = "0px"));
937
+ },
938
+ [d, f, l]
939
+ ), Fe = Oe(
940
+ (r = !1) => {
941
+ if (P.current && r && (P.current.style.transform = "translate3d(0px, 0px,0px)", P.current.style.left = "0", P.current.style.top = "0"), v === "fixed" && _e(
942
+ x === "center" ? ne() * n.length - C() * Math.round((J - 1) / 2) : x === "end" ? ne() * n.length - C() * Math.round(J - 1) : ne() * n.length
943
+ ), v === "fluid") {
944
+ if (_e(ne() * n.length), m.current && M() !== Math.abs(c.current) && !l) {
945
+ const o = -M();
946
+ c.current = o, B.start({
947
+ immediate: !0,
948
+ val: c.current
949
+ });
950
+ return;
951
+ }
952
+ if (Math.abs(c.current) > 0 && M() !== Math.abs(c.current) && !l && !u && we.current === "backward") {
953
+ const o = he.current - M(), a = c.current + o;
954
+ return B.start({
955
+ immediate: !0,
956
+ val: a
957
+ }), () => {
958
+ c.current = a;
959
+ };
960
+ }
961
+ console.log("here");
962
+ return;
963
+ }
964
+ if (!u && v === "fixed") {
965
+ const o = -(C() * V.current);
966
+ if (Math.abs(o) > M() && !l) {
967
+ const a = -M();
968
+ m.current = !0, c.current = a, B.start({
969
+ immediate: !0,
970
+ val: c.current
971
+ });
972
+ } else
973
+ c.current = o, B.start({
974
+ immediate: !0,
975
+ val: o
976
+ });
977
+ setTimeout(() => {
978
+ Z.current = !1;
979
+ }, 0);
980
+ }
981
+ },
982
+ [
983
+ u,
984
+ ne,
985
+ C,
986
+ M,
987
+ x,
988
+ n.length,
989
+ J,
990
+ _e,
991
+ B,
992
+ v,
993
+ l
994
+ ]
995
+ );
996
+ function X() {
997
+ return u && E.current ? E.current[d === "x" ? "scrollLeft" : "scrollTop"] : ue.val.get();
998
+ }
999
+ function Ce(r, o) {
1000
+ if (u && r === "next") {
1001
+ const a = c.current + C();
1002
+ return a > M() ? M() : a;
1003
+ }
1004
+ if (u && r === "prev") {
1005
+ const a = c.current - C();
1006
+ return a < 0 ? 0 : a;
1007
+ }
1008
+ return r === "next" ? typeof o == "number" ? -(o * C()) : c.current - C() : typeof o == "number" ? -(o * C()) : c.current + C();
1009
+ }
1010
+ function ge({ type: r, index: o, immediate: a }) {
1011
+ if (!g || L.current || I.current && !l)
1012
+ return;
1013
+ m.current && (we.current = "backward"), z.current = "prev", m.current = !1;
1014
+ const k = typeof o == "number" ? o : V.current - 1;
1015
+ if (u && be(), !l) {
1016
+ const K = u ? Ce("prev", o) - C() / 3 < 0 : Ce("prev", o) + C() / 3 > 0;
1017
+ if (I.current)
1018
+ return;
1019
+ if (K) {
1020
+ I.current = !0, m.current = !1, G({
1021
+ slideMode: r,
1022
+ from: X(),
1023
+ to: 0,
1024
+ nextActiveItem: 0,
1025
+ immediate: a
1026
+ });
1027
+ return;
1028
+ }
1029
+ }
1030
+ if (l && (I.current || k < 0)) {
1031
+ I.current = !1, m.current = !0, G({
1032
+ slideMode: r,
1033
+ from: X() - C() * n.length,
1034
+ to: -(C() * n.length) + C(),
1035
+ nextActiveItem: n.length - 1,
1036
+ immediate: a
1037
+ });
1038
+ return;
1039
+ }
1040
+ k === 0 && (I.current = !0), (k === n.length - 1 || k === -1) && (m.current = !0), G({
1041
+ slideMode: r,
1042
+ from: X(),
1043
+ to: Ce("prev", o),
1044
+ nextActiveItem: k,
1045
+ immediate: a
1046
+ });
1047
+ }
1048
+ function se({ type: r, index: o, immediate: a }) {
1049
+ if (!g || L.current || m.current && !l)
1050
+ return;
1051
+ I.current && (we.current = "forward"), z.current = "next", I.current = !1;
1052
+ const k = o || V.current + 1;
1053
+ if (u && be(), !l) {
1054
+ const K = Math.abs(Ce("next", o)) > M() - C() / 3;
1055
+ if (m.current)
1056
+ return;
1057
+ if (K) {
1058
+ I.current = !1, m.current = !0, G({
1059
+ slideMode: r,
1060
+ from: X(),
1061
+ to: u ? M() : -M(),
1062
+ nextActiveItem: k,
1063
+ immediate: a
1064
+ });
1065
+ return;
1066
+ }
1067
+ }
1068
+ if (l && (m.current || k > n.length - 1)) {
1069
+ m.current = !1, I.current = !0, G({
1070
+ slideMode: r,
1071
+ from: X() + C() * n.length,
1072
+ to: 0,
1073
+ nextActiveItem: 0,
1074
+ immediate: a
1075
+ });
1076
+ return;
1077
+ }
1078
+ k === 0 && (I.current = !0), k === n.length - 1 && (m.current = !0), G({
1079
+ slideMode: r,
1080
+ from: X(),
1081
+ to: Ce("next", o),
1082
+ nextActiveItem: k,
1083
+ immediate: a
1084
+ });
1085
+ }
1086
+ function Je() {
1087
+ q ? oe.current = q : oe.current = Math.floor(C() / 2 / 2);
1088
+ }
1089
+ function ye() {
1090
+ P.current && (he.current = M(), R.current = l, F.current = v, te.current = u, me.current = window.innerWidth, c.current = 0, Ve({ id: 0, immediate: !0, shouldReset: !0 }), Je(), Fe());
1091
+ }
1092
+ const ze = hr(
1093
+ (r) => {
1094
+ const o = r.dragging, a = r.offset[d === "x" ? 0 : 1], k = r.movement[d === "x" ? 0 : 1], K = r.direction[d === "x" ? 0 : 1], Te = k > oe.current, le = k < -oe.current, Ze = M(), ie = r.velocity;
1095
+ if (o) {
1096
+ if (K > 0 ? z.current = "prev" : z.current = "next", pe({
1097
+ ...r,
1098
+ eventName: "onDrag",
1099
+ slideActionType: z.current
1100
+ }), u) {
1101
+ if (a > 0) {
1102
+ B.start({
1103
+ from: {
1104
+ val: X()
1105
+ },
1106
+ to: {
1107
+ val: 0
1108
+ },
1109
+ config: {
1110
+ velocity: ie,
1111
+ friction: 50,
1112
+ tension: 1e3
1113
+ }
1114
+ }), r.cancel();
1115
+ return;
1116
+ }
1117
+ B.start({
1118
+ from: {
1119
+ val: X()
1120
+ },
1121
+ to: {
1122
+ val: -a
1123
+ },
1124
+ config: {
1125
+ velocity: ie,
1126
+ friction: 50,
1127
+ tension: 1e3
1128
+ }
1129
+ });
1130
+ return;
1131
+ }
1132
+ B.start({
1133
+ val: a,
1134
+ config: {
1135
+ velocity: ie,
1136
+ friction: 50,
1137
+ tension: 1e3
1138
+ }
1139
+ }), _ && le ? (se({ type: "drag" }), r.cancel()) : _ && Te && (ge({ type: "drag" }), r.cancel()), Ze - Math.abs(a) < -(C() * 2) && r.cancel();
1140
+ return;
1141
+ }
1142
+ if (r.last && u && a > 0) {
1143
+ B.start({
1144
+ from: {
1145
+ val: X()
1146
+ },
1147
+ to: {
1148
+ val: 0
1149
+ },
1150
+ config: {
1151
+ velocity: ie,
1152
+ friction: 50,
1153
+ tension: 1e3
1154
+ }
1155
+ });
1156
+ return;
1157
+ }
1158
+ r.last && !r.canceled && u && (z.current === "prev" && ge({ type: "drag" }), z.current === "next" && se({ type: "drag" })), r.last && !r.canceled && !u && (le ? !l && m.current ? B.start({
1159
+ val: -M(),
1160
+ config: {
1161
+ ...De.default,
1162
+ velocity: ie
1163
+ }
1164
+ }) : se({ type: "drag" }) : Te ? !l && I.current ? B.start({
1165
+ val: 0,
1166
+ config: {
1167
+ ...De.default,
1168
+ velocity: ie
1169
+ }
1170
+ }) : ge({ type: "drag" }) : B.start({
1171
+ val: c.current,
1172
+ config: {
1173
+ ...De.default,
1174
+ velocity: ie
1175
+ }
1176
+ })), r.last && r.canceled && B.start({
1177
+ val: c.current,
1178
+ config: {
1179
+ ...De.default,
1180
+ velocity: ie
1181
+ }
1182
+ });
1183
+ },
1184
+ {
1185
+ enabled: g && !W && !u || !!u && !!U,
1186
+ axis: d,
1187
+ from: () => u && E.current ? [
1188
+ -E.current.scrollLeft,
1189
+ -E.current.scrollTop
1190
+ ] : d === "x" ? [ue.val.get(), ue.val.get()] : [ue.val.get(), ue.val.get()]
1191
+ }
1192
+ );
1193
+ function Xe() {
1194
+ return u ? d === "x" ? {
1195
+ overflowX: "auto"
1196
+ } : {
1197
+ overflowY: "auto"
1198
+ } : {};
1199
+ }
1200
+ function be() {
1201
+ E.current && (c.current = E.current[d === "x" ? "scrollLeft" : "scrollTop"], E.current[d === "x" ? "scrollLeft" : "scrollTop"] === 0 && (I.current = !0, m.current = !1), E.current[d === "x" ? "scrollLeft" : "scrollTop"] > 0 && E.current[d === "x" ? "scrollLeft" : "scrollTop"] < M() && (I.current = !1, m.current = !1), E.current[d === "x" ? "scrollLeft" : "scrollTop"] === M() && (I.current = !1, m.current = !0));
1202
+ }
1203
+ function Ge() {
1204
+ return u ? {
1205
+ onWheel() {
1206
+ ue.val.stop(), be();
1207
+ }
1208
+ } : {};
1209
+ }
1210
+ function xe(r, o) {
1211
+ let a = 0;
1212
+ if (typeof r == "string" ? a = n.findIndex((k) => k.id === r) : a = r, a < 0 || a >= n.length) {
1213
+ if (o)
1214
+ throw new Error(o);
1215
+ console.error(`The item doesn't exist; check that the id provided - ${r} - is correct.`), a = -1;
1216
+ }
1217
+ return a;
1218
+ }
1219
+ function Ve({ id: r, immediate: o, shouldReset: a, type: k }) {
1220
+ if (!g || L.current)
1221
+ return;
1222
+ I.current = !1, m.current = !1;
1223
+ const K = xe(
1224
+ r,
1225
+ "The item you want to slide to doesn't exist; check the provided id."
1226
+ );
1227
+ if (K === V.current && !a)
1228
+ return;
1229
+ const Te = xe(n[V.current].id), le = xe(n[K].id);
1230
+ le > Te ? se({
1231
+ type: k || a ? "initial" : "click",
1232
+ index: le,
1233
+ immediate: o
1234
+ }) : ge({
1235
+ type: k || a ? "initial" : "click",
1236
+ index: le,
1237
+ immediate: o
1238
+ });
1239
+ }
1240
+ function Se(r) {
1241
+ const o = xe(r, "The item doesn't exist; check the provided id."), a = V.current;
1242
+ return l && a === n.length - 1 ? o === 0 : o === a + 1;
1243
+ }
1244
+ function Ye(r) {
1245
+ const o = xe(r, "The item doesn't exist; check the provided id."), a = V.current;
1246
+ return l && a === 0 ? o === n.length - 1 : o === a - 1;
1247
+ }
1248
+ function Ue(r) {
1249
+ return xe(r, "The item you want to check doesn't exist; check the provided id.") === V.current;
1250
+ }
1251
+ function er() {
1252
+ return W ? "unset" : d === "x" ? "pan-y" : "pan-x";
1253
+ }
1254
+ const Ie = u ? {
1255
+ useListenToCustomEvent: ce,
1256
+ enterFullscreen: Le,
1257
+ exitFullscreen: Ne,
1258
+ getIsFullscreen: He,
1259
+ slideToPrevItem: (r = !0) => {
1260
+ ge({
1261
+ type: "click",
1262
+ immediate: !r
1263
+ });
1264
+ },
1265
+ slideToNextItem: (r = !0) => {
1266
+ se({
1267
+ type: "click",
1268
+ immediate: !r
1269
+ });
1270
+ }
1271
+ } : {
1272
+ useListenToCustomEvent: ce,
1273
+ enterFullscreen: Le,
1274
+ exitFullscreen: Ne,
1275
+ getIsFullscreen: He,
1276
+ slideToPrevItem: (r = !0) => {
1277
+ ge({
1278
+ type: "click",
1279
+ immediate: !r
1280
+ });
1281
+ },
1282
+ slideToNextItem: (r = !0) => {
1283
+ se({
1284
+ type: "click",
1285
+ immediate: !r
1286
+ });
1287
+ },
1288
+ slideToItem: (r, o = !0) => {
1289
+ Ve({ id: r, immediate: !o });
1290
+ },
1291
+ getIsNextItem: Se,
1292
+ getIsPrevItem: Ye,
1293
+ getIsActiveItem: Ue
1294
+ };
1295
+ Tr(() => {
1296
+ P.current && g && (Z.current = !0, ye());
1297
+ }, [g]), de(() => {
1298
+ V.current !== j && (Z.current = !0, Ve({
1299
+ id: j,
1300
+ immediate: !O
1301
+ }));
1302
+ }, [j]), de(() => {
1303
+ if (g) {
1304
+ if (j > n.length - 1)
1305
+ throw new Error(
1306
+ `initialActiveItem (${j}) is greater than the total quantity available items (${n.length}).`
1307
+ );
1308
+ J > n.length && console.warn(
1309
+ `itemsPerSlide (${J}) is greater than the total quantity available items (${n.length}). Fallback to ${n.length})`
1310
+ );
1311
+ }
1312
+ }, [j, n.length, J, g]), de(() => {
1313
+ me.current = window.innerWidth;
1314
+ }, []), de(() => {
1315
+ if (g) {
1316
+ if (l && u)
1317
+ throw new Error("`withLoop` and `freeScroll` can't be used together.");
1318
+ if (u && v === "fixed")
1319
+ throw new Error("`freeScroll` can't be used when `scrollType: fixed`.");
1320
+ if (U && (v !== "fluid" || !u))
1321
+ throw new Error(
1322
+ "`enableFreeScrollDrag` must be used with `slideType: fluid` and `freeScroll=true`"
1323
+ );
1324
+ if (ee && u)
1325
+ throw new Error("`slideGroupOfItems` and `freeScroll` can't be used together.");
1326
+ if (typeof re == "number" && re > 0 && v === "fixed")
1327
+ throw new Error("`slideAmount` must be used with `slideType: fluid`");
1328
+ Z.current = !0, ye();
1329
+ }
1330
+ }, [
1331
+ x,
1332
+ J,
1333
+ f,
1334
+ T,
1335
+ g,
1336
+ l,
1337
+ v,
1338
+ u,
1339
+ U,
1340
+ ee
1341
+ ]), de(() => {
1342
+ if (!g)
1343
+ return;
1344
+ function r() {
1345
+ document.hidden ? L.current = !0 : L.current = !1;
1346
+ }
1347
+ return document.addEventListener("visibilitychange", r), () => {
1348
+ document.removeEventListener("visibilitychange", r);
1349
+ };
1350
+ }, [g]), de(() => {
1351
+ if (E.current) {
1352
+ let r;
1353
+ const o = new _r(() => {
1354
+ if (!L.current && !Z.current) {
1355
+ me.current = window.innerWidth;
1356
+ const a = Fe();
1357
+ window.clearTimeout(r), r = setTimeout(() => {
1358
+ he.current = M(), typeof a == "function" && a();
1359
+ }, 100);
1360
+ }
1361
+ });
1362
+ return o.observe(E.current), () => {
1363
+ o.disconnect();
1364
+ };
1365
+ }
1366
+ }, [Fe, M]);
1367
+ const Ke = /* @__PURE__ */ A.jsx(tr.Provider, { value: Ie, children: We }), Ee = /* @__PURE__ */ A.jsx(tr.Provider, { value: Ie, children: /* @__PURE__ */ A.jsx(
1368
+ "div",
1369
+ {
1370
+ className: "use-spring-carousel-main-wrapper",
1371
+ ref: E,
1372
+ ...Ge(),
1373
+ style: {
1374
+ display: "flex",
1375
+ position: "relative",
1376
+ width: "100%",
1377
+ height: "100%",
1378
+ ...Xe()
1379
+ },
1380
+ children: /* @__PURE__ */ A.jsxs(
1381
+ "div",
1382
+ {
1383
+ className: "use-spring-carousel-track-wrapper",
1384
+ ref: P,
1385
+ ...ze(),
1386
+ style: {
1387
+ position: "relative",
1388
+ display: "flex",
1389
+ flexDirection: d === "x" ? "row" : "column",
1390
+ touchAction: er(),
1391
+ ...Ae()
1392
+ },
1393
+ children: [
1394
+ (u || !l) && f ? /* @__PURE__ */ A.jsx(
1395
+ "div",
1396
+ {
1397
+ style: {
1398
+ flexShrink: 0,
1399
+ width: f
1400
+ }
1401
+ }
1402
+ ) : null,
1403
+ Pe.map((r, o) => /* @__PURE__ */ A.jsx(
1404
+ "div",
1405
+ {
1406
+ className: "use-spring-carousel-item",
1407
+ "data-testid": "use-spring-carousel-item-wrapper",
1408
+ style: {
1409
+ display: "flex",
1410
+ position: "relative",
1411
+ flex: "1",
1412
+ ...Qe(
1413
+ o === Pe.findIndex(
1414
+ (a) => a.id === Pe[Pe.length - 1].id
1415
+ )
1416
+ )
1417
+ },
1418
+ children: typeof r.renderItem == "function" ? r.renderItem({
1419
+ getIsActiveItem: Ue,
1420
+ getIsNextItem: Se,
1421
+ getIsPrevItem: Ye,
1422
+ useListenToCustomEvent: ce
1423
+ }) : r.renderItem
1424
+ },
1425
+ `${r.id}-${o}`
1426
+ )),
1427
+ (u || !l) && f ? /* @__PURE__ */ A.jsx(
1428
+ "div",
1429
+ {
1430
+ style: {
1431
+ flexShrink: 0,
1432
+ width: f
1433
+ }
1434
+ }
1435
+ ) : null
1436
+ ]
1437
+ }
1438
+ )
1439
+ }
1440
+ ) });
1441
+ return { ...Ie, carouselFragment: Ee, thumbsFragment: Ke };
1442
+ }
1443
+ const tr = fr(void 0);
1444
+ function Nr() {
1445
+ const n = dr(tr);
1446
+ if (!n)
1447
+ throw new Error("useSpringCarouselContext must be used within the carousel.");
1448
+ return n;
1449
+ }
1450
+ const $e = {
1451
+ initial: {
1452
+ opacity: 1,
1453
+ position: "relative"
1454
+ },
1455
+ from: {
1456
+ opacity: 0,
1457
+ position: "relative"
1458
+ },
1459
+ enter: {
1460
+ position: "relative",
1461
+ opacity: 1
1462
+ },
1463
+ leave: {
1464
+ opacity: 1,
1465
+ position: "absolute"
1466
+ }
1467
+ };
1468
+ function Vr({
1469
+ init: n = !0,
1470
+ disableGestures: g = !1,
1471
+ items: y,
1472
+ springConfig: D = De.default,
1473
+ exitBeforeEnter: Y = !1,
1474
+ trail: v,
1475
+ withLoop: T = !1,
1476
+ activeItem: l,
1477
+ toPrevItemSpringProps: f = $e,
1478
+ toNextItemSpringProps: d = $e,
1479
+ draggingSlideTreshold: W = 50,
1480
+ thumbsSlideAxis: q = "x"
1481
+ }) {
1482
+ const _ = $("next"), u = $("initial"), U = $(null), [x, ae] = Er(l ?? 0), { emitEvent: j, useListenToCustomEvent: O } = mr(), { handleScroll: ee, thumbsFragment: re } = pr({
1483
+ thumbsSlideAxis: q,
1484
+ items: y,
1485
+ renderThumbFnProps: {
1486
+ getIsNextItem: I,
1487
+ getIsPrevItem: m,
1488
+ useListenToCustomEvent: O,
1489
+ activeItem: {
1490
+ index: x,
1491
+ id: y[x].id
1492
+ }
1493
+ }
1494
+ });
1495
+ function J() {
1496
+ return _.current === "prev" ? {
1497
+ initial: {
1498
+ ...f.initial
1499
+ },
1500
+ from: {
1501
+ ...f.from
1502
+ },
1503
+ enter: {
1504
+ ...f.enter
1505
+ },
1506
+ leave: {
1507
+ ...f.leave
1508
+ }
1509
+ } : _.current === "next" ? {
1510
+ initial: {
1511
+ ...d.initial
1512
+ },
1513
+ from: {
1514
+ ...d.from
1515
+ },
1516
+ enter: {
1517
+ ...d.enter
1518
+ },
1519
+ leave: {
1520
+ ...d.leave
1521
+ }
1522
+ } : {
1523
+ initial: {
1524
+ ...$e.initial
1525
+ },
1526
+ from: {
1527
+ ...$e.from
1528
+ },
1529
+ enter: {
1530
+ ...$e.enter
1531
+ },
1532
+ leave: {
1533
+ ...$e.leave
1534
+ }
1535
+ };
1536
+ }
1537
+ de(() => {
1538
+ typeof l == "number" && l !== x && ae(l);
1539
+ }, [l]);
1540
+ function Z({ to: c, slideType: R, slideMode: F }) {
1541
+ _.current = R, u.current = F, j({
1542
+ eventName: "onSlideStartChange",
1543
+ slideActionType: _.current,
1544
+ slideMode: u.current,
1545
+ nextItem: {
1546
+ index: c,
1547
+ id: y[c].id,
1548
+ startReached: c === 0,
1549
+ endReached: c === y.length - 1
1550
+ }
1551
+ }), ae(c), ee(x);
1552
+ }
1553
+ function oe(c) {
1554
+ if (!n)
1555
+ return;
1556
+ const R = x === 0;
1557
+ !T && R || Z(T && R ? {
1558
+ to: y.length - 1,
1559
+ slideType: "prev",
1560
+ slideMode: c
1561
+ } : {
1562
+ to: x - 1,
1563
+ slideType: "prev",
1564
+ slideMode: c
1565
+ });
1566
+ }
1567
+ function z(c) {
1568
+ if (!n)
1569
+ return;
1570
+ const R = x === y.length - 1;
1571
+ !T && R || Z(T && R ? {
1572
+ to: 0,
1573
+ slideType: "next",
1574
+ slideMode: c
1575
+ } : {
1576
+ to: x + 1,
1577
+ slideType: "next",
1578
+ slideMode: c
1579
+ });
1580
+ }
1581
+ const ve = Rr(x, {
1582
+ config: D,
1583
+ key: null,
1584
+ trail: v,
1585
+ exitBeforeEnter: Y,
1586
+ ...J(),
1587
+ onRest(c, R, F) {
1588
+ c.finished && F === x && j({
1589
+ eventName: "onSlideChange",
1590
+ slideActionType: _.current,
1591
+ slideMode: u.current,
1592
+ currentItem: {
1593
+ index: x,
1594
+ id: y[x].id,
1595
+ startReached: x === 0,
1596
+ endReached: x === y.length - 1
1597
+ }
1598
+ });
1599
+ }
1600
+ }), we = hr(
1601
+ ({ last: c, movement: [R] }) => {
1602
+ if (c) {
1603
+ const F = R > W, te = R < -W, L = x === 0, Me = x === y.length - 1;
1604
+ if (te) {
1605
+ if (!T && Me)
1606
+ return;
1607
+ j({
1608
+ eventName: "onLeftSwipe"
1609
+ }), z("swipe");
1610
+ } else if (F) {
1611
+ if (!T && L)
1612
+ return;
1613
+ j({
1614
+ eventName: "onRightSwipe"
1615
+ }), oe("swipe");
1616
+ }
1617
+ }
1618
+ },
1619
+ {
1620
+ enabled: !g
1621
+ }
1622
+ );
1623
+ function V(c, R) {
1624
+ let F = 0;
1625
+ if (typeof c == "string" ? F = y.findIndex((te) => te.id === c) : F = c, F < 0 || F >= y.length) {
1626
+ if (R)
1627
+ throw new Error(R);
1628
+ console.error(`The item doesn't exist; check that the id provided - ${c} - is correct.`), F = -1;
1629
+ }
1630
+ return F;
1631
+ }
1632
+ function I(c) {
1633
+ const R = V(c, "The item doesn't exist; check the provided id."), F = x;
1634
+ return T && F === y.length - 1 ? R === 0 : R === F + 1;
1635
+ }
1636
+ function m(c) {
1637
+ const R = V(c, "The item doesn't exist; check the provided id."), F = x;
1638
+ return T && F === 0 ? R === y.length - 1 : R === F - 1;
1639
+ }
1640
+ const E = ve((c, R, F, te) => {
1641
+ const L = y[R].renderItem;
1642
+ return /* @__PURE__ */ A.jsx(
1643
+ wr.div,
1644
+ {
1645
+ id: `use-transition-carousel-item-${te}`,
1646
+ className: "use-transition-carousel-item",
1647
+ style: {
1648
+ ...c,
1649
+ flex: "1 0 100%",
1650
+ width: "100%",
1651
+ height: "100%"
1652
+ },
1653
+ children: typeof L == "function" ? L({
1654
+ useListenToCustomEvent: O,
1655
+ getIsNextItem: I,
1656
+ getIsPrevItem: m,
1657
+ activeItem: {
1658
+ index: x,
1659
+ id: y[x].id
1660
+ }
1661
+ }) : L
1662
+ }
1663
+ );
1664
+ }), P = {
1665
+ useListenToCustomEvent: O,
1666
+ slideToPrevItem: () => oe("click"),
1667
+ slideToNextItem: () => z("click")
1668
+ }, he = /* @__PURE__ */ A.jsx(nr.Provider, { value: P, children: re }), me = /* @__PURE__ */ A.jsx(nr.Provider, { value: P, children: /* @__PURE__ */ A.jsx(
1669
+ "div",
1670
+ {
1671
+ ref: U,
1672
+ ...we(),
1673
+ style: {
1674
+ display: "flex",
1675
+ position: "relative",
1676
+ width: "100%",
1677
+ height: "100%",
1678
+ overflow: "hidden"
1679
+ },
1680
+ children: E
1681
+ }
1682
+ ) });
1683
+ return {
1684
+ ...P,
1685
+ carouselFragment: me,
1686
+ thumbsFragment: he
1687
+ };
1688
+ }
1689
+ const nr = fr(void 0);
1690
+ function Sr() {
1691
+ const n = dr(nr);
1692
+ if (!n)
1693
+ throw new Error("useTransitionCarouselContext must be used within the carousel.");
1694
+ return n;
1695
+ }
9
1696
  export {
10
- n as useSpringCarousel,
11
- u as useSpringCarouselContext,
12
- C as useTransitionCarousel,
13
- l as useTransitionCarouselContext
1697
+ Wr as useSpringCarousel,
1698
+ Nr as useSpringCarouselContext,
1699
+ Vr as useTransitionCarousel,
1700
+ Sr as useTransitionCarouselContext
14
1701
  };
15
1702
  //# sourceMappingURL=index.es.js.map