@telefonica/mistica 13.2.3 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,56 +50,56 @@ function _objectSpreadProps(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import * as a from "react";
53
+ import * as c from "react";
54
54
  import X from "./generated/mistica-icons/icon-chevron-left-regular.js";
55
55
  import Z from "./generated/mistica-icons/icon-chevron-right-regular.js";
56
- import { useScreenSize as $, useTheme as ee, useIsInViewport as me, useIsomorphicLayoutEffect as pe } from "./hooks.js";
57
- import ge from "./inline.js";
56
+ import { useScreenSize as $, useTheme as ee, useIsInViewport as pe, useIsomorphicLayoutEffect as ge } from "./hooks.js";
57
+ import ve from "./inline.js";
58
58
  import be from "./stack.js";
59
- import { BaseTouchable as M } from "./touchable.js";
59
+ import { BaseTouchable as R } from "./touchable.js";
60
60
  import J from "classnames";
61
- import { useIsInverseVariant as ve, ThemeVariant as R } from "./theme-variant-context.js";
62
- import { DisableBorderRadiusProvider as Ie } from "./image.js";
63
- import { listenResize as te, getPrefixedDataAttributes as Pe } from "./utils/dom.js";
61
+ import { useIsInverseVariant as Ie, ThemeVariant as M } from "./theme-variant-context.js";
62
+ import { MediaBorderRadiusProvider as Pe } from "./image.js";
63
+ import { listenResize as te, getPrefixedDataAttributes as xe } from "./utils/dom.js";
64
64
  import { isAndroid as se } from "./utils/platform.js";
65
65
  import { useDocumentVisibility as we } from "./utils/document-visibility.js";
66
- import { slideshowContainer as xe, slideshowPrevArrowButton as Se, slideshow as ke, slideshowItem as Le, slideshowNextArrowButton as Ne, slideshowBullets as Ae, bulletActiveInverse as Ce, bulletInverse as Re, bulletActive as Me, bullet as Be, carouselContainer as Ee, carouselPrevArrowButton as ye, carousel as Te, centeredCarousel as We, carouselWithScroll as De, vars as j, carouselItem as Ve, carouselNextArrowButton as Oe, carouselBullets as ze } from "./carousel.css-mistica.js";
67
- import { assignInlineVars as je } from "@vanilla-extract/dynamic";
68
- import { sprinkles as _e } from "./sprinkles.css-mistica.js";
69
- import { useDesktopContainerType as Fe } from "./desktop-container-type-context.js";
70
- import { jsx as l, jsxs as Y } from "./_virtual/jsx-runtime.js";
66
+ import { slideshowContainer as Se, slideshowPrevArrowButton as ke, slideshow as Le, slideshowItem as Ce, slideshowNextArrowButton as Ne, slideshowBullets as Ae, bulletActiveInverse as Me, bulletInverse as Re, bulletActive as Be, bullet as Ee, carouselContainer as ye, carouselPrevArrowButton as Te, carousel as We, centeredCarousel as De, carouselWithScroll as Ve, vars as _, carouselItem as Oe, carouselNextArrowButton as ze, carouselBullets as je } from "./carousel.css-mistica.js";
67
+ import { assignInlineVars as _e } from "@vanilla-extract/dynamic";
68
+ import { sprinkles as Fe } from "./sprinkles.css-mistica.js";
69
+ import { useDesktopContainerType as Ue } from "./desktop-container-type-context.js";
70
+ import { jsx as s, jsxs as G } from "./_virtual/jsx-runtime.js";
71
71
  const oe = (e, r)=>{
72
72
  const t = we();
73
- return me(r, !1) && t && !!e;
73
+ return pe(r, !1) && t && !!e;
74
74
  }, re = (param)=>{
75
75
  let { currentIndex: e , numPages: r , onPress: t } = param;
76
- const s = ve(), { isDesktopOrBigger: f } = $(), p = (v)=>{
77
- const c = v === e;
78
- return s ? c ? Ce : Re : c ? Me : Be;
76
+ const o = Ie(), { isDesktopOrBigger: u } = $(), I = (P)=>{
77
+ const d = P === e;
78
+ return o ? d ? Me : Re : d ? Be : Ee;
79
79
  };
80
- return /* @__PURE__ */ l(ge, {
81
- space: f ? 16 : 8,
80
+ return /* @__PURE__ */ s(ve, {
81
+ space: u ? 16 : 8,
82
82
  alignItems: "center",
83
83
  dataAttributes: {
84
84
  "component-name": "PageBullets"
85
85
  },
86
86
  children: Array.from({
87
87
  length: r
88
- }, (v, c)=>/* @__PURE__ */ l(M, {
89
- className: _e({
88
+ }, (P, d)=>/* @__PURE__ */ s(R, {
89
+ className: Fe({
90
90
  display: "block",
91
91
  padding: 0,
92
92
  border: "none",
93
93
  background: "transparent"
94
94
  }),
95
95
  maybe: !0,
96
- onPress: f && t ? ()=>t(c) : void 0,
97
- children: /* @__PURE__ */ l("div", {
98
- className: p(c)
96
+ onPress: u && t ? ()=>t(d) : void 0,
97
+ children: /* @__PURE__ */ s("div", {
98
+ className: I(d)
99
99
  })
100
- }, c))
100
+ }, d))
101
101
  });
102
- }, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], Ue = (e, r)=>{
102
+ }, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], qe = (e, r)=>{
103
103
  const t = {
104
104
  mobile: 1,
105
105
  tablet: 2,
@@ -117,216 +117,216 @@ const oe = (e, r)=>{
117
117
  tablet: r,
118
118
  desktop: r
119
119
  };
120
- const s = K(e, t.desktop, r.desktop);
120
+ const o = K(e, t.desktop, r.desktop);
121
121
  return _objectSpreadProps(_objectSpread({}, t, r), {
122
- desktop: s
122
+ desktop: o
123
123
  });
124
124
  }, Q = (e, r)=>{
125
125
  if (e.length === 0) return [];
126
- const t = Math.ceil(e.length / r), s = [];
127
- for(let f = 0; f < e.length; f += t)s.push(e[f]);
128
- return s[s.length - 1] = e[e.length - t], s;
129
- }, qe = (e, r)=>{
126
+ const t = Math.ceil(e.length / r), o = [];
127
+ for(let u = 0; u < e.length; u += t)o.push(e[u]);
128
+ return o[o.length - 1] = e[e.length - t], o;
129
+ }, Ye = (e, r)=>{
130
130
  const t = [];
131
- for(let s = 0; s < r.length; s++)s === 0 ? t.push(r[0]) : t.push((r[s] + r[s - 1]) / 2);
132
- for(let s1 = t.length - 1; s1 >= 0; s1--)if (e - t[s1] >= -1) return s1;
131
+ for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
132
+ for(let o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
133
133
  return 0;
134
134
  }, le = 5e3, ne = (param)=>{
135
- let { items: e , itemStyle: r , itemClassName: t , withBullets: s , renderBullets: f , initialActiveItem: p , itemsPerPage: v , itemsToScroll: c , gap: w , free: S , centered: k , autoplay: g , onPageChange: P , dataAttributes: _ } = param;
136
- const { texts: B , platformOverrides: L } = ee(), E = Fe(), o = Ue(E || "large", v), { isDesktopOrBigger: h , isMobile: N } = $(), x = N ? o.mobile : o.tablet, I = Math.max(Math.floor(h ? o.desktop : x), 1), m = a.useRef(null), b = Math.ceil(e.length / I), [{ scrollLeft: G , scrollRight: F }, ce] = a.useState({
135
+ let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , itemsPerPage: P , itemsToScroll: d , gap: f , free: B , centered: w , autoplay: x , onPageChange: S , dataAttributes: k } = param;
136
+ const { texts: E , platformOverrides: F } = ee(), L = Ue(), m = qe(L || "large", P), { isDesktopOrBigger: n , isMobile: g } = $(), C = g ? m.mobile : m.tablet, p = Math.max(Math.floor(n ? m.desktop : C), 1), v = c.useRef(null), b = Math.ceil(e.length / p), [{ scrollLeft: y , scrollRight: U }, ie] = c.useState({
137
137
  scrollLeft: 0,
138
138
  scrollRight: 0
139
- }), [U, ie] = a.useState([]), y = a.useMemo(()=>Q(U, b), [
140
- U,
139
+ }), [q, ae] = c.useState([]), T = c.useMemo(()=>Q(q, b), [
140
+ q,
141
141
  b
142
- ]), T = c ? Q(U, Math.ceil(e.length / c)) : y, ae = F !== 0, ue = G !== 0;
143
- pe(()=>{
144
- if (m.current) {
145
- const n = m.current, i = ()=>{
146
- const { scrollWidth: V , clientWidth: C } = n, O = Math.round(n.scrollLeft), z = Math.round(V - (O + C));
147
- ce({
148
- scrollLeft: O,
149
- scrollRight: z
142
+ ]), W = d ? Q(q, Math.ceil(e.length / d)) : T, ue = U !== 0, de = y !== 0;
143
+ ge(()=>{
144
+ if (v.current) {
145
+ const l = v.current, i = ()=>{
146
+ const { scrollWidth: O , clientWidth: A } = l, z = Math.round(l.scrollLeft), j = Math.round(O - (z + A));
147
+ ie({
148
+ scrollLeft: z,
149
+ scrollRight: j
150
150
  });
151
- }, u = ()=>{
152
- const V = n.scrollWidth - n.clientWidth;
153
- ie(Array.from(n.querySelectorAll("[data-item]")).map((C, O)=>{
154
- if (O === e.length - 1) return V;
155
- const z = C.offsetLeft, de = parseInt(getComputedStyle(C).scrollMargin), he = k && !h ? z - C.clientWidth / 2 : z;
156
- return Math.min(he - de - n.offsetLeft, V);
151
+ }, a = ()=>{
152
+ const O = l.scrollWidth - l.clientWidth;
153
+ ae(Array.from(l.querySelectorAll("[data-item]")).map((A, z)=>{
154
+ if (z === e.length - 1) return O;
155
+ const j = A.offsetLeft, he = parseInt(getComputedStyle(A).scrollMargin), me = w && !n ? j - A.clientWidth / 2 : j;
156
+ return Math.min(me - he - l.offsetLeft, O);
157
157
  }));
158
158
  };
159
- i(), u(), n.addEventListener("scroll", i);
160
- const d = te(n, ()=>{
161
- i(), u();
159
+ i(), a(), l.addEventListener("scroll", i);
160
+ const h = te(l, ()=>{
161
+ i(), a();
162
162
  });
163
163
  return ()=>{
164
- n.removeEventListener("scroll", i), d();
164
+ l.removeEventListener("scroll", i), h();
165
165
  };
166
166
  }
167
167
  return ()=>{};
168
168
  }, [
169
- o.desktop,
170
- o.tablet,
171
- o.mobile,
169
+ m.desktop,
170
+ m.tablet,
171
+ m.mobile,
172
172
  b,
173
+ f,
173
174
  w,
174
- k,
175
- h,
175
+ n,
176
176
  e.length
177
177
  ]);
178
- const W = a.useCallback(function(n) {
178
+ const D = c.useCallback(function(l) {
179
179
  let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
180
- const u = m.current;
181
- if (u) {
182
- const d = y[n];
183
- u.scrollTo({
184
- left: d,
180
+ const a = v.current;
181
+ if (a) {
182
+ const h = T[l];
183
+ a.scrollTo({
184
+ left: h,
185
185
  behavior: i ? "smooth" : "auto"
186
186
  });
187
187
  }
188
188
  }, [
189
- y
190
- ]), fe = a.useCallback(()=>{
191
- const n = m.current;
192
- if (n) {
193
- const { scrollLeft: i } = n, u = [
194
- ...T
195
- ].reverse().find((d)=>d - i < -1);
196
- n.scrollTo({
197
- left: u,
189
+ T
190
+ ]), fe = c.useCallback(()=>{
191
+ const l = v.current;
192
+ if (l) {
193
+ const { scrollLeft: i } = l, a = [
194
+ ...W
195
+ ].reverse().find((h)=>h - i < -1);
196
+ l.scrollTo({
197
+ left: a,
198
198
  behavior: "smooth"
199
199
  });
200
200
  }
201
201
  }, [
202
- T
203
- ]), q = a.useCallback(()=>{
204
- const n = m.current;
205
- if (n) {
206
- const { scrollLeft: i } = n, u = T.find((d)=>d - i > 1);
207
- n.scrollTo({
208
- left: u,
202
+ W
203
+ ]), Y = c.useCallback(()=>{
204
+ const l = v.current;
205
+ if (l) {
206
+ const { scrollLeft: i } = l, a = W.find((h)=>h - i > 1);
207
+ l.scrollTo({
208
+ left: a,
209
209
  behavior: "smooth"
210
210
  });
211
211
  }
212
212
  }, [
213
- T
214
- ]), H = oe(!!g, m);
215
- a.useEffect(()=>{
216
- p !== void 0 && W(Math.floor(p / I), !1);
213
+ W
214
+ ]), H = oe(!!x, v);
215
+ c.useEffect(()=>{
216
+ I !== void 0 && D(Math.floor(I / p), !1);
217
217
  }, [
218
- p,
219
- W,
220
- I
221
- ]), a.useEffect(()=>{
222
- if (H && g) {
223
- const n = typeof g == "boolean" ? le : g.time, i = typeof g == "object" && g.loop, u = setInterval(()=>{
224
- var d;
225
- F !== 0 ? q() : i && ((d = m.current) == null || d.scrollTo({
218
+ I,
219
+ D,
220
+ p
221
+ ]), c.useEffect(()=>{
222
+ if (H && x) {
223
+ const l = typeof x == "boolean" ? le : x.time, i = typeof x == "object" && x.loop, a = setInterval(()=>{
224
+ var h;
225
+ U !== 0 ? Y() : i && ((h = v.current) == null || h.scrollTo({
226
226
  left: 0,
227
227
  behavior: "smooth"
228
228
  }));
229
- }, n);
230
- return ()=>clearInterval(u);
229
+ }, l);
230
+ return ()=>clearInterval(a);
231
231
  }
232
232
  }, [
233
- g,
234
- q,
235
- F,
233
+ x,
234
+ Y,
235
+ U,
236
236
  H
237
237
  ]);
238
- const A = qe(G, y);
239
- a.useEffect(()=>{
240
- if (P) {
241
- const n = Math.min((A + 1) * I - 1, e.length - 1), i = [];
242
- for(let u = 0; u < I; u++){
243
- const d = n - u;
244
- d >= 0 && i.unshift(d);
238
+ const N = Ye(y, T);
239
+ c.useEffect(()=>{
240
+ if (S) {
241
+ const l = Math.min((N + 1) * p - 1, e.length - 1), i = [];
242
+ for(let a = 0; a < p; a++){
243
+ const h = l - a;
244
+ h >= 0 && i.unshift(h);
245
245
  }
246
- P({
247
- pageIndex: A,
246
+ S({
247
+ pageIndex: N,
248
248
  shownItemIndexes: i
249
249
  });
250
250
  }
251
251
  }, [
252
- A,
252
+ N,
253
253
  e.length,
254
- I,
255
- P
254
+ p,
255
+ S
256
256
  ]);
257
- let D = null;
258
- return f ? D = f({
257
+ let V = null;
258
+ return u ? V = u({
259
259
  numPages: b,
260
- currentIndex: A,
261
- onPress: W
262
- }) : s && (D = b > 1 && /* @__PURE__ */ l(re, {
260
+ currentIndex: N,
261
+ onPress: D
262
+ }) : o && (V = b > 1 && /* @__PURE__ */ s(re, {
263
263
  numPages: b,
264
- currentIndex: A,
265
- onPress: W
266
- })), /* @__PURE__ */ Y(be, {
264
+ currentIndex: N,
265
+ onPress: D
266
+ })), /* @__PURE__ */ G(be, {
267
267
  space: 24,
268
268
  dataAttributes: _objectSpread({
269
269
  "component-name": "Carousel"
270
- }, _),
270
+ }, k),
271
271
  children: [
272
- /* @__PURE__ */ Y("div", {
273
- className: Ee,
272
+ /* @__PURE__ */ G("div", {
273
+ className: ye,
274
274
  children: [
275
- /* @__PURE__ */ l(R, {
275
+ /* @__PURE__ */ s(M, {
276
276
  isInverse: !1,
277
- children: /* @__PURE__ */ l(M, {
278
- className: ye,
279
- "aria-label": B.carouselPrevButton,
277
+ children: /* @__PURE__ */ s(R, {
278
+ className: Te,
279
+ "aria-label": E.carouselPrevButton,
280
280
  onPress: fe,
281
- disabled: !ue,
282
- children: /* @__PURE__ */ l(X, {})
281
+ disabled: !de,
282
+ children: /* @__PURE__ */ s(X, {})
283
283
  })
284
284
  }),
285
- /* @__PURE__ */ l("div", {
286
- className: J(Te, {
287
- [We]: k,
288
- [De]: b > 1
285
+ /* @__PURE__ */ s("div", {
286
+ className: J(We, {
287
+ [De]: w,
288
+ [Ve]: b > 1
289
289
  }),
290
- style: _objectSpreadProps(_objectSpread({}, je(_objectSpread({
291
- [j.itemsPerPageDesktop]: String(o.desktop),
292
- [j.itemsPerPageTablet]: String(o.tablet),
293
- [j.itemsPerPageMobile]: String(o.mobile)
294
- }, w !== void 0 ? {
295
- [j.gap]: String(w)
290
+ style: _objectSpreadProps(_objectSpread({}, _e(_objectSpread({
291
+ [_.itemsPerPageDesktop]: String(m.desktop),
292
+ [_.itemsPerPageTablet]: String(m.tablet),
293
+ [_.itemsPerPageMobile]: String(m.mobile)
294
+ }, f !== void 0 ? {
295
+ [_.gap]: String(f)
296
296
  } : {}))), {
297
- scrollSnapType: S ? "initial" : "x mandatory"
297
+ scrollSnapType: B ? "initial" : "x mandatory"
298
298
  }),
299
- ref: m,
300
- children: e.map((n, i)=>/* @__PURE__ */ l("div", {
301
- className: J(Ve, t),
299
+ ref: v,
300
+ children: e.map((l, i)=>/* @__PURE__ */ s("div", {
301
+ className: J(Oe, t),
302
302
  style: _objectSpreadProps(_objectSpread({}, r), {
303
- scrollSnapStop: se(L) ? "always" : "normal"
303
+ scrollSnapStop: se(F) ? "always" : "normal"
304
304
  }),
305
305
  "data-item": !0,
306
- children: n
306
+ children: l
307
307
  }, i))
308
308
  }),
309
- /* @__PURE__ */ l(R, {
309
+ /* @__PURE__ */ s(M, {
310
310
  isInverse: !1,
311
- children: /* @__PURE__ */ l(M, {
312
- className: Oe,
313
- "aria-label": B.carouselNextButton,
314
- onPress: q,
315
- disabled: !ae,
316
- children: /* @__PURE__ */ l(Z, {})
311
+ children: /* @__PURE__ */ s(R, {
312
+ className: ze,
313
+ "aria-label": E.carouselNextButton,
314
+ onPress: Y,
315
+ disabled: !ue,
316
+ children: /* @__PURE__ */ s(Z, {})
317
317
  })
318
318
  })
319
319
  ]
320
320
  }),
321
- D && /* @__PURE__ */ l("div", {
322
- className: ze,
323
- children: D
321
+ V && /* @__PURE__ */ s("div", {
322
+ className: je,
323
+ children: V
324
324
  })
325
325
  ]
326
326
  });
327
- }, it = (e)=>/* @__PURE__ */ l(ne, _objectSpread({}, e)), at = (param)=>/* @__PURE__ */ {
328
- let { items: e , itemStyle: r , itemClassName: t , withBullets: s , renderBullets: f , initialActiveItem: p , onPageChange: v , dataAttributes: c } = param;
329
- return l(ne, {
327
+ }, ut = (e)=>/* @__PURE__ */ s(ne, _objectSpread({}, e)), dt = (param)=>/* @__PURE__ */ {
328
+ let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , onPageChange: P , dataAttributes: d } = param;
329
+ return s(ne, {
330
330
  items: e,
331
331
  itemStyle: r,
332
332
  itemClassName: t,
@@ -338,119 +338,128 @@ const oe = (e, r)=>{
338
338
  centered: !0,
339
339
  itemsToScroll: 1,
340
340
  gap: 0,
341
- withBullets: s,
342
- renderBullets: f,
343
- initialActiveItem: p,
344
- onPageChange: v,
345
- dataAttributes: c
341
+ withBullets: o,
342
+ renderBullets: u,
343
+ initialActiveItem: I,
344
+ onPageChange: P,
345
+ dataAttributes: d
346
+ });
347
+ }, ce = /*#__PURE__*/ c.createContext(!1), ft = ()=>c.useContext(ce), Ge = (param)=>/* @__PURE__ */ {
348
+ let { children: e } = param;
349
+ return s(ce.Provider, {
350
+ value: !0,
351
+ children: e
346
352
  });
347
- }, ut = (param)=>{
348
- let { items: e , withBullets: r , autoplay: t , onPageChange: s , dataAttributes: f } = param;
349
- const { texts: p , platformOverrides: v } = ee(), c = a.useRef(null), [{ scrollLeft: w , scrollRight: S }, k] = a.useState({
353
+ }, ht = (param)=>{
354
+ let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: u , inverseBullets: I = !0 } = param;
355
+ const { texts: P , platformOverrides: d } = ee(), f = c.useRef(null), [{ scrollLeft: B , scrollRight: w }, x] = c.useState({
350
356
  scrollLeft: 0,
351
357
  scrollRight: 0
352
- }), g = a.useCallback(()=>{
353
- const o = c.current;
354
- o && o.scrollBy({
355
- left: -o.clientWidth,
358
+ }), S = c.useCallback(()=>{
359
+ const n = f.current;
360
+ n && n.scrollBy({
361
+ left: -n.clientWidth,
356
362
  behavior: "smooth"
357
363
  });
358
- }, []), P = a.useCallback(()=>{
359
- const o = c.current;
360
- o && o.scrollBy({
361
- left: o.clientWidth,
364
+ }, []), k = c.useCallback(()=>{
365
+ const n = f.current;
366
+ n && n.scrollBy({
367
+ left: n.clientWidth,
362
368
  behavior: "smooth"
363
369
  });
364
- }, []), _ = S !== 0, B = w !== 0, L = c.current ? Math.floor((w + c.current.clientWidth / 2) / c.current.clientWidth) : 0;
365
- a.useLayoutEffect(()=>{
366
- const o = c.current;
367
- if (o) {
368
- const h = ()=>{
369
- const { scrollWidth: x , clientWidth: I } = o, m = Math.round(o.scrollLeft), b = Math.round(x - (m + I));
370
- k({
371
- scrollLeft: m,
372
- scrollRight: b
370
+ }, []), E = w !== 0, F = B !== 0, L = f.current ? Math.floor((B + f.current.clientWidth / 2) / f.current.clientWidth) : 0;
371
+ c.useLayoutEffect(()=>{
372
+ const n = f.current;
373
+ if (n) {
374
+ const g = ()=>{
375
+ const { scrollWidth: p , clientWidth: v } = n, b = Math.round(n.scrollLeft), y = Math.round(p - (b + v));
376
+ x({
377
+ scrollLeft: b,
378
+ scrollRight: y
373
379
  });
374
380
  };
375
- h(), o.addEventListener("scroll", h);
376
- const N = te(o, h);
381
+ g(), n.addEventListener("scroll", g);
382
+ const C = te(n, g);
377
383
  return ()=>{
378
- o.removeEventListener("scroll", h), N();
384
+ n.removeEventListener("scroll", g), C();
379
385
  };
380
386
  }
381
387
  }, [
382
388
  e.length
383
389
  ]);
384
- const E = oe(!!t, c);
385
- return a.useEffect(()=>{
386
- if (E && t) {
387
- const o = typeof t == "boolean" ? le : t.time, h = typeof t == "object" && t.loop, N = setInterval(()=>{
388
- var x;
389
- S !== 0 ? P() : h && ((x = c.current) == null || x.scrollTo({
390
+ const m = oe(!!t, f);
391
+ return c.useEffect(()=>{
392
+ if (m && t) {
393
+ const n = typeof t == "boolean" ? le : t.time, g = typeof t == "object" && t.loop, C = setInterval(()=>{
394
+ var p;
395
+ w !== 0 ? k() : g && ((p = f.current) == null || p.scrollTo({
390
396
  left: 0,
391
397
  behavior: "smooth"
392
398
  }));
393
- }, o);
394
- return ()=>clearInterval(N);
399
+ }, n);
400
+ return ()=>clearInterval(C);
395
401
  }
396
402
  }, [
397
403
  t,
398
- P,
399
- S,
400
- E
401
- ]), a.useEffect(()=>{
402
- s && s(L);
404
+ k,
405
+ w,
406
+ m
407
+ ]), c.useEffect(()=>{
408
+ o && o(L);
403
409
  }, [
404
410
  L,
405
- s
406
- ]), /* @__PURE__ */ Y("div", _objectSpreadProps(_objectSpread({
407
- className: xe
408
- }, Pe(f, "SlideShow")), {
409
- children: [
410
- /* @__PURE__ */ l(R, {
411
- isInverse: !1,
412
- children: /* @__PURE__ */ l(M, {
413
- className: Se,
414
- "aria-label": p.carouselPrevButton,
415
- onPress: g,
416
- disabled: !B,
417
- children: /* @__PURE__ */ l(X, {})
418
- })
419
- }),
420
- /* @__PURE__ */ l(Ie, {
421
- children: /* @__PURE__ */ l("div", {
422
- className: ke,
423
- ref: c,
424
- children: e.map((o, h)=>/* @__PURE__ */ l("div", {
425
- className: Le,
426
- style: {
427
- scrollSnapStop: se(v) ? "always" : "normal"
428
- },
429
- children: o
430
- }, h))
431
- })
432
- }),
433
- /* @__PURE__ */ l(R, {
434
- isInverse: !1,
435
- children: /* @__PURE__ */ l(M, {
436
- className: Ne,
437
- "aria-label": p.carouselNextButton,
438
- onPress: P,
439
- disabled: !_,
440
- children: /* @__PURE__ */ l(Z, {})
441
- })
442
- }),
443
- r && e.length > 1 && /* @__PURE__ */ l(R, {
444
- isInverse: !0,
445
- children: /* @__PURE__ */ l("div", {
446
- className: Ae,
447
- children: /* @__PURE__ */ l(re, {
448
- numPages: e.length,
449
- currentIndex: L
411
+ o
412
+ ]), /* @__PURE__ */ s(Ge, {
413
+ children: /* @__PURE__ */ G("div", _objectSpreadProps(_objectSpread({
414
+ className: Se
415
+ }, xe(u, "SlideShow")), {
416
+ children: [
417
+ /* @__PURE__ */ s(M, {
418
+ isInverse: !1,
419
+ children: /* @__PURE__ */ s(R, {
420
+ className: ke,
421
+ "aria-label": P.carouselPrevButton,
422
+ onPress: S,
423
+ disabled: !F,
424
+ children: /* @__PURE__ */ s(X, {})
425
+ })
426
+ }),
427
+ /* @__PURE__ */ s(Pe, {
428
+ value: !1,
429
+ children: /* @__PURE__ */ s("div", {
430
+ className: Le,
431
+ ref: f,
432
+ children: e.map((n, g)=>/* @__PURE__ */ s("div", {
433
+ className: Ce,
434
+ style: {
435
+ scrollSnapStop: se(d) ? "always" : "normal"
436
+ },
437
+ children: n
438
+ }, g))
439
+ })
440
+ }),
441
+ /* @__PURE__ */ s(M, {
442
+ isInverse: !1,
443
+ children: /* @__PURE__ */ s(R, {
444
+ className: Ne,
445
+ "aria-label": P.carouselNextButton,
446
+ onPress: k,
447
+ disabled: !E,
448
+ children: /* @__PURE__ */ s(Z, {})
449
+ })
450
+ }),
451
+ r && e.length > 1 && /* @__PURE__ */ s(M, {
452
+ isInverse: I,
453
+ children: /* @__PURE__ */ s("div", {
454
+ className: Ae,
455
+ children: /* @__PURE__ */ s(re, {
456
+ numPages: e.length,
457
+ currentIndex: L
458
+ })
450
459
  })
451
460
  })
452
- })
453
- ]
454
- }));
461
+ ]
462
+ }))
463
+ });
455
464
  };
456
- export { it as Carousel, at as CenteredCarousel, re as PageBullets, ut as Slideshow };
465
+ export { ut as Carousel, dt as CenteredCarousel, Ge as IsInsideSlideshowProvider, re as PageBullets, ht as Slideshow, ft as useIsInsideSlideshowContext };