@telefonica/mistica 16.31.0 → 16.32.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.
Files changed (259) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +6 -6
  3. package/dist/align.css-mistica.js +1 -1
  4. package/dist/avatar.css-mistica.js +1 -1
  5. package/dist/badge.css-mistica.js +1 -1
  6. package/dist/box.css-mistica.js +13 -13
  7. package/dist/box.js +5 -5
  8. package/dist/boxed.css-mistica.js +24 -24
  9. package/dist/button-group.css-mistica.js +1 -1
  10. package/dist/button-group.js +2 -2
  11. package/dist/button-layout.css-mistica.js +13 -13
  12. package/dist/button.css-mistica.js +16 -16
  13. package/dist/callout.css-mistica.js +5 -5
  14. package/dist/card.css-mistica.js +3 -3
  15. package/dist/carousel.css-mistica.js +99 -44
  16. package/dist/carousel.css.d.ts +35 -16
  17. package/dist/carousel.d.ts +43 -5
  18. package/dist/carousel.js +570 -384
  19. package/dist/checkbox.css-mistica.js +7 -7
  20. package/dist/checkbox.js +2 -2
  21. package/dist/chip.css-mistica.js +12 -12
  22. package/dist/circle.css-mistica.js +1 -1
  23. package/dist/community/advanced-data-card.css-mistica.js +6 -6
  24. package/dist/community/advanced-data-card.js +4 -4
  25. package/dist/community/blocks.css-mistica.js +1 -1
  26. package/dist/community/example-component.css-mistica.js +1 -1
  27. package/dist/counter.css-mistica.js +1 -1
  28. package/dist/counter.js +8 -8
  29. package/dist/cover-hero.css-mistica.js +14 -15
  30. package/dist/credit-card-number-field.css-mistica.js +3 -3
  31. package/dist/date-field.css-mistica.js +1 -1
  32. package/dist/date-time-picker.css-mistica.js +1 -1
  33. package/dist/dialog.css-mistica.js +4 -4
  34. package/dist/dialog.js +14 -14
  35. package/dist/divider.css-mistica.js +2 -2
  36. package/dist/double-field.css-mistica.js +2 -2
  37. package/dist/drawer.css-mistica.js +1 -1
  38. package/dist/empty-state-card.css-mistica.js +1 -1
  39. package/dist/empty-state.css-mistica.js +5 -5
  40. package/dist/fade-in.css-mistica.js +1 -1
  41. package/dist/feedback.css-mistica.js +1 -1
  42. package/dist/fixed-footer-layout.css-mistica.js +4 -4
  43. package/dist/fixed-footer-layout.js +5 -5
  44. package/dist/form.css-mistica.js +1 -1
  45. package/dist/form.js +5 -5
  46. package/dist/grid-layout.css-mistica.js +3 -3
  47. package/dist/grid.css-mistica.js +122 -122
  48. package/dist/grid.js +9 -9
  49. package/dist/header.css-mistica.js +1 -1
  50. package/dist/hero.css-mistica.js +2 -2
  51. package/dist/highlighted-card.css-mistica.js +4 -4
  52. package/dist/horizontal-scroll.css-mistica.js +1 -1
  53. package/dist/horizontal-scroll.js +2 -2
  54. package/dist/icon-button.css-mistica.js +42 -42
  55. package/dist/icon-button.js +3 -3
  56. package/dist/icons/icon-chevron.css-mistica.js +2 -2
  57. package/dist/icons/icon-error.css-mistica.js +1 -1
  58. package/dist/image.css-mistica.js +3 -3
  59. package/dist/image.js +5 -5
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +6 -0
  62. package/dist/inline.css-mistica.js +10 -10
  63. package/dist/list.css-mistica.js +1 -1
  64. package/dist/loading-bar.css-mistica.js +1 -1
  65. package/dist/loading-bar.js +2 -2
  66. package/dist/loading-screen.css-mistica.js +4 -4
  67. package/dist/loading-screen.js +3 -3
  68. package/dist/logo.css-mistica.js +5 -5
  69. package/dist/maybe-dismissable.css-mistica.js +1 -1
  70. package/dist/menu.css-mistica.js +12 -12
  71. package/dist/menu.js +7 -7
  72. package/dist/mosaic.css-mistica.js +1 -1
  73. package/dist/mosaic.d.ts +2 -1
  74. package/dist/mosaic.js +33 -32
  75. package/dist/navigation-bar.css-mistica.js +16 -16
  76. package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
  77. package/dist/package-version.js +1 -1
  78. package/dist/pin-field.css-mistica.js +1 -1
  79. package/dist/pin-field.js +2 -2
  80. package/dist/popover.css-mistica.js +1 -1
  81. package/dist/progress-bar.css-mistica.js +4 -4
  82. package/dist/progress-bar.js +2 -2
  83. package/dist/radio-button.css-mistica.js +14 -14
  84. package/dist/radio-button.d.ts +1 -0
  85. package/dist/radio-button.js +72 -61
  86. package/dist/rating.css-mistica.js +2 -2
  87. package/dist/rating.js +8 -8
  88. package/dist/responsive-layout.css-mistica.js +4 -4
  89. package/dist/responsive-layout.js +6 -6
  90. package/dist/screen-reader-only.css-mistica.js +1 -1
  91. package/dist/select.css-mistica.js +15 -15
  92. package/dist/select.js +9 -9
  93. package/dist/sheet-action-row.css-mistica.js +1 -1
  94. package/dist/sheet-common.css-mistica.js +1 -1
  95. package/dist/sheet-info.css-mistica.js +1 -1
  96. package/dist/skeletons.css-mistica.js +4 -4
  97. package/dist/skins/skin-contract.css-mistica.js +354 -354
  98. package/dist/slider.css-mistica.js +10 -10
  99. package/dist/slider.js +9 -9
  100. package/dist/snackbar.css-mistica.js +4 -4
  101. package/dist/spinner.css-mistica.js +1 -1
  102. package/dist/stack.css-mistica.js +5 -5
  103. package/dist/stacking-group.css-mistica.js +1 -1
  104. package/dist/stepper.css-mistica.js +2 -2
  105. package/dist/stepper.js +3 -3
  106. package/dist/switch-component.css-mistica.js +26 -26
  107. package/dist/table.css-mistica.js +8 -8
  108. package/dist/table.js +8 -8
  109. package/dist/tabs.css-mistica.js +12 -12
  110. package/dist/tag.css-mistica.js +1 -1
  111. package/dist/text-field-base.css-mistica.js +1 -1
  112. package/dist/text-field-base.js +126 -115
  113. package/dist/text-field-components.css-mistica.js +6 -6
  114. package/dist/text-field-components.js +2 -2
  115. package/dist/text-link.css-mistica.js +5 -5
  116. package/dist/text-tokens.d.ts +8 -0
  117. package/dist/text-tokens.js +142 -110
  118. package/dist/text.css-mistica.js +7 -7
  119. package/dist/text.js +7 -7
  120. package/dist/theme-context.css-mistica.js +394 -394
  121. package/dist/timeline.css-mistica.js +10 -10
  122. package/dist/timer.css-mistica.js +6 -6
  123. package/dist/tooltip.css-mistica.js +1 -1
  124. package/dist/touchable.css-mistica.js +1 -1
  125. package/dist/utils/aspect-ratio-support.css-mistica.js +3 -3
  126. package/dist/utils/aspect-ratio-support.js +3 -3
  127. package/dist/video.css-mistica.js +1 -1
  128. package/dist/video.js +2 -2
  129. package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
  130. package/dist-es/accordion.css-mistica.js +6 -6
  131. package/dist-es/align.css-mistica.js +1 -1
  132. package/dist-es/avatar.css-mistica.js +1 -1
  133. package/dist-es/badge.css-mistica.js +1 -1
  134. package/dist-es/box.css-mistica.js +13 -13
  135. package/dist-es/box.js +9 -9
  136. package/dist-es/boxed.css-mistica.js +23 -23
  137. package/dist-es/button-group.css-mistica.js +1 -1
  138. package/dist-es/button-group.js +4 -4
  139. package/dist-es/button-layout.css-mistica.js +13 -13
  140. package/dist-es/button.css-mistica.js +16 -16
  141. package/dist-es/callout.css-mistica.js +5 -5
  142. package/dist-es/callout.js +5 -5
  143. package/dist-es/card.css-mistica.js +3 -3
  144. package/dist-es/carousel.css-mistica.js +9 -8
  145. package/dist-es/carousel.js +587 -407
  146. package/dist-es/checkbox.css-mistica.js +7 -7
  147. package/dist-es/checkbox.js +6 -6
  148. package/dist-es/chip.css-mistica.js +12 -12
  149. package/dist-es/circle.css-mistica.js +1 -1
  150. package/dist-es/community/advanced-data-card.css-mistica.js +6 -6
  151. package/dist-es/community/advanced-data-card.js +11 -11
  152. package/dist-es/community/blocks.css-mistica.js +1 -1
  153. package/dist-es/community/example-component.css-mistica.js +1 -1
  154. package/dist-es/counter.css-mistica.js +1 -1
  155. package/dist-es/counter.js +8 -8
  156. package/dist-es/cover-hero.css-mistica.js +4 -5
  157. package/dist-es/credit-card-number-field.css-mistica.js +3 -3
  158. package/dist-es/date-field.css-mistica.js +1 -1
  159. package/dist-es/date-time-picker.css-mistica.js +1 -1
  160. package/dist-es/dialog.css-mistica.js +4 -4
  161. package/dist-es/dialog.js +31 -31
  162. package/dist-es/divider.css-mistica.js +2 -2
  163. package/dist-es/double-field.css-mistica.js +2 -2
  164. package/dist-es/drawer.css-mistica.js +1 -1
  165. package/dist-es/empty-state-card.css-mistica.js +1 -1
  166. package/dist-es/empty-state.css-mistica.js +5 -5
  167. package/dist-es/empty-state.js +7 -7
  168. package/dist-es/fade-in.css-mistica.js +1 -1
  169. package/dist-es/feedback.css-mistica.js +1 -1
  170. package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
  171. package/dist-es/fixed-footer-layout.js +5 -5
  172. package/dist-es/form.css-mistica.js +1 -1
  173. package/dist-es/form.js +5 -5
  174. package/dist-es/grid-layout.css-mistica.js +3 -3
  175. package/dist-es/grid.css-mistica.js +122 -122
  176. package/dist-es/grid.js +10 -10
  177. package/dist-es/header.css-mistica.js +1 -1
  178. package/dist-es/hero.css-mistica.js +2 -2
  179. package/dist-es/highlighted-card.css-mistica.js +4 -4
  180. package/dist-es/horizontal-scroll.css-mistica.js +1 -1
  181. package/dist-es/horizontal-scroll.js +2 -2
  182. package/dist-es/icon-button.css-mistica.js +42 -42
  183. package/dist-es/icon-button.js +3 -3
  184. package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
  185. package/dist-es/icons/icon-error.css-mistica.js +1 -1
  186. package/dist-es/image.css-mistica.js +3 -3
  187. package/dist-es/image.js +5 -5
  188. package/dist-es/index.js +1843 -1843
  189. package/dist-es/inline.css-mistica.js +10 -10
  190. package/dist-es/list.css-mistica.js +1 -1
  191. package/dist-es/list.js +18 -18
  192. package/dist-es/loading-bar.css-mistica.js +1 -1
  193. package/dist-es/loading-bar.js +6 -6
  194. package/dist-es/loading-screen.css-mistica.js +4 -4
  195. package/dist-es/loading-screen.js +8 -8
  196. package/dist-es/logo.css-mistica.js +5 -5
  197. package/dist-es/maybe-dismissable.css-mistica.js +1 -1
  198. package/dist-es/menu.css-mistica.js +12 -12
  199. package/dist-es/menu.js +7 -7
  200. package/dist-es/mosaic.css-mistica.js +1 -1
  201. package/dist-es/mosaic.js +47 -46
  202. package/dist-es/navigation-bar.css-mistica.js +16 -16
  203. package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
  204. package/dist-es/package-version.js +1 -1
  205. package/dist-es/pin-field.css-mistica.js +1 -1
  206. package/dist-es/pin-field.js +8 -8
  207. package/dist-es/popover.css-mistica.js +1 -1
  208. package/dist-es/progress-bar.css-mistica.js +4 -4
  209. package/dist-es/progress-bar.js +10 -10
  210. package/dist-es/radio-button.css-mistica.js +14 -14
  211. package/dist-es/radio-button.js +98 -88
  212. package/dist-es/rating.css-mistica.js +2 -2
  213. package/dist-es/rating.js +12 -12
  214. package/dist-es/responsive-layout.css-mistica.js +4 -4
  215. package/dist-es/responsive-layout.js +15 -15
  216. package/dist-es/screen-reader-only.css-mistica.js +1 -1
  217. package/dist-es/select.css-mistica.js +15 -15
  218. package/dist-es/select.js +15 -15
  219. package/dist-es/sheet-action-row.css-mistica.js +1 -1
  220. package/dist-es/sheet-common.css-mistica.js +1 -1
  221. package/dist-es/sheet-common.js +6 -6
  222. package/dist-es/sheet-info.css-mistica.js +1 -1
  223. package/dist-es/skeletons.css-mistica.js +4 -4
  224. package/dist-es/skins/skin-contract.css-mistica.js +354 -354
  225. package/dist-es/slider.css-mistica.js +10 -10
  226. package/dist-es/slider.js +9 -9
  227. package/dist-es/snackbar.css-mistica.js +4 -4
  228. package/dist-es/spinner.css-mistica.js +1 -1
  229. package/dist-es/stack.css-mistica.js +5 -5
  230. package/dist-es/stacking-group.css-mistica.js +1 -1
  231. package/dist-es/stepper.css-mistica.js +2 -2
  232. package/dist-es/stepper.js +3 -3
  233. package/dist-es/style.css +1 -1
  234. package/dist-es/switch-component.css-mistica.js +26 -26
  235. package/dist-es/table.css-mistica.js +8 -8
  236. package/dist-es/table.js +12 -12
  237. package/dist-es/tabs.css-mistica.js +12 -12
  238. package/dist-es/tag.css-mistica.js +1 -1
  239. package/dist-es/tag.js +8 -8
  240. package/dist-es/text-field-base.css-mistica.js +1 -1
  241. package/dist-es/text-field-base.js +153 -141
  242. package/dist-es/text-field-components.css-mistica.js +5 -5
  243. package/dist-es/text-field-components.js +4 -4
  244. package/dist-es/text-link.css-mistica.js +5 -5
  245. package/dist-es/text-tokens.js +79 -59
  246. package/dist-es/text.css-mistica.js +7 -7
  247. package/dist-es/text.js +6 -6
  248. package/dist-es/theme-context.css-mistica.js +394 -394
  249. package/dist-es/timeline.css-mistica.js +10 -10
  250. package/dist-es/timeline.js +4 -4
  251. package/dist-es/timer.css-mistica.js +6 -6
  252. package/dist-es/tooltip.css-mistica.js +1 -1
  253. package/dist-es/touchable.css-mistica.js +1 -1
  254. package/dist-es/utils/aspect-ratio-support.css-mistica.js +3 -3
  255. package/dist-es/utils/aspect-ratio-support.js +10 -10
  256. package/dist-es/video.css-mistica.js +1 -1
  257. package/dist-es/video.js +5 -5
  258. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
  259. package/package.json +1 -1
package/dist/carousel.js CHANGED
@@ -11,28 +11,34 @@ function _export(target, all) {
11
11
  }
12
12
  _export(exports, {
13
13
  Carousel: function() {
14
- return qt;
14
+ return Oo;
15
+ },
16
+ CarouselAutoplayControl: function() {
17
+ return $e;
15
18
  },
16
19
  CarouselContextConsumer: function() {
17
- return Yt;
20
+ return Do;
18
21
  },
19
22
  CarouselContextProvider: function() {
20
- return Kt;
23
+ return Wo;
24
+ },
25
+ CarouselPageControls: function() {
26
+ return Ue;
21
27
  },
22
28
  CenteredCarousel: function() {
23
- return Zt;
29
+ return zo;
24
30
  },
25
31
  PageBullets: function() {
26
- return we;
32
+ return Fe;
27
33
  },
28
34
  Slideshow: function() {
29
- return Ht;
35
+ return Go;
30
36
  },
31
37
  useCarouselContext: function() {
32
- return Ut;
38
+ return Vo;
33
39
  },
34
40
  useSlideshowContext: function() {
35
- return $t;
41
+ return _o;
36
42
  }
37
43
  });
38
44
  const _jsxruntime = require("react/jsx-runtime");
@@ -41,7 +47,6 @@ const _iconchevronleftregular = /*#__PURE__*/ _interop_require_default(require("
41
47
  const _iconchevronrightregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-chevron-right-regular.js"));
42
48
  const _hooks = require("./hooks.js");
43
49
  const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
44
- const _touchable = require("./touchable.js");
45
50
  const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
46
51
  const _themevariantcontext = require("./theme-variant-context.js");
47
52
  const _dom = require("./utils/dom.js");
@@ -53,7 +58,12 @@ const _desktopcontainertypecontext = require("./desktop-container-type-context.j
53
58
  const _constants = require("./skins/constants.js");
54
59
  const _css = require("./utils/css.js");
55
60
  const _responsivelayout = require("./responsive-layout.js");
61
+ const _iconbutton = require("./icon-button.js");
62
+ const _iconpausefilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-pause-filled.js"));
63
+ const _iconplayfilled = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-play-filled.js"));
64
+ const _iconreloadregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-reload-regular.js"));
56
65
  const _texttokens = require("./text-tokens.js");
66
+ const _environment = require("./utils/environment.js");
57
67
  function _interop_require_default(obj) {
58
68
  return obj && obj.__esModule ? obj : {
59
69
  default: obj
@@ -152,90 +162,173 @@ function _object_spread_props(target, source) {
152
162
  }
153
163
  return target;
154
164
  }
155
- const Pe = (t, e)=>{
156
- const s = (0, _documentvisibility.useDocumentVisibility)();
157
- return (0, _hooks.useIsInViewport)(e, !1) && s && !!t;
158
- }, we = (param)=>{
159
- let { currentIndex: t, numPages: e, onPress: s } = param;
160
- var _e_tablet;
161
- const r = (0, _themevariantcontext.useIsInverseOrMediaVariant)(), { isDesktopOrBigger: i } = (0, _hooks.useScreenSize)(), m = (u)=>{
162
- const f = u === t;
163
- return r ? f ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse : f ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet;
164
- }, P = typeof e == "number" ? e : Math.max(e.mobile, (_e_tablet = e.tablet) !== null && _e_tablet !== void 0 ? _e_tablet : e.mobile, e.desktop);
165
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
166
- space: 0,
167
- alignItems: "center",
168
- dataAttributes: {
169
- "component-name": "PageBullets"
170
- },
171
- children: Array.from({
172
- length: P
173
- }, (u, f)=>/* @__PURE__ */ {
174
- var _e_tablet;
175
- return (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
176
- className: (0, _classnames.default)(typeof e == "number" ? _carouselcssmistica.bulletButton : {
177
- [_carouselcssmistica.bulletButtonMobile]: f < e.mobile,
178
- [_carouselcssmistica.bulletButtonTablet]: f < ((_e_tablet = e.tablet) !== null && _e_tablet !== void 0 ? _e_tablet : e.mobile),
179
- [_carouselcssmistica.bulletButtonDesktop]: f < e.desktop
180
- }),
181
- style: f === 0 ? {
182
- paddingLeft: 0
183
- } : {},
184
- maybe: !0,
185
- onPress: i && s ? ()=>s(f) : void 0,
186
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
187
- className: m(f)
188
- })
189
- }, f);
190
- })
191
- });
192
- }, se = ()=>{
165
+ const Oe = (e, t)=>{
166
+ const r = (0, _environment.isClientSide)() ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1, [s, f] = _react.useState(!!e && !r), i = (0, _documentvisibility.useDocumentVisibility)(), m = (0, _hooks.useIsInViewport)(t, !1);
167
+ return {
168
+ isAutoplayEnabled: s && !!e,
169
+ shouldAutoplay: m && i && !!e && s,
170
+ setShouldAutoPlay: f
171
+ };
172
+ }, w = ()=>{
193
173
  throw new Error("You must wrap your component with a CarouselContextProvider to use CarouselContext");
194
- }, Ie = se, Me = se, ke = se, Ne = {
174
+ }, ze = {
195
175
  currentIndex: 0,
196
176
  numPages: 0
197
- }, re = /*#__PURE__*/ _react.createContext({
198
- goPrev: Ie,
199
- goNext: Me,
200
- goToPage: ke,
201
- bulletsProps: Ne
202
- }), le = /*#__PURE__*/ _react.createContext(null), Kt = (param)=>{
203
- let { children: t } = param;
204
- const [e, s] = _react.useState(Ne), r = _react.useRef(Ie), i = _react.useRef(Me), m = _react.useRef(ke), P = _react.useMemo(()=>({
177
+ }, _e = {
178
+ isAutoplayEnabled: !1,
179
+ isAtLastPage: !1,
180
+ onAutoplayChanged: w
181
+ }, Ge = {
182
+ setShouldAutoplay: w,
183
+ prevArrowEnabled: !1,
184
+ nextArrowEnabled: !1
185
+ }, ge = /*#__PURE__*/ _react.createContext({
186
+ goPrev: w,
187
+ goNext: w,
188
+ goToPage: w,
189
+ bulletsProps: ze,
190
+ autoplayControlProps: _e,
191
+ pageControlsProps: Ge
192
+ }), Ce = /*#__PURE__*/ _react.createContext(null), Wo = (param)=>{
193
+ let { children: e } = param;
194
+ const [t, r] = _react.useState(ze), [s, f] = _react.useState(_e), [i, m] = _react.useState(Ge), v = _react.useRef(w), h = _react.useRef(w), l = _react.useRef(w), u = _react.useRef(w), A = _react.useMemo(()=>({
205
195
  goPrev: ()=>{
206
- r.current();
196
+ v.current();
207
197
  },
208
198
  goNext: ()=>{
209
- i.current();
199
+ h.current();
210
200
  },
211
- goToPage: function(u) {
212
- let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
213
- m.current(u, f);
201
+ goToPage: function(d) {
202
+ let _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
203
+ l.current(d, _);
214
204
  },
215
- bulletsProps: e
205
+ bulletsProps: t,
206
+ autoplayControlProps: s,
207
+ pageControlsProps: i
216
208
  }), [
217
- e
209
+ t,
210
+ s,
211
+ i
218
212
  ]);
219
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(re.Provider, {
220
- value: P,
221
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(le.Provider, {
213
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(ge.Provider, {
214
+ value: A,
215
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Ce.Provider, {
222
216
  value: {
223
- setGoPrev: (u)=>{
224
- r.current = u;
217
+ setGoPrev: (d)=>{
218
+ v.current = d;
225
219
  },
226
- setGoNext: (u)=>{
227
- i.current = u;
220
+ setGoNext: (d)=>{
221
+ h.current = d;
228
222
  },
229
- setGoToPage: (u)=>{
230
- m.current = u;
223
+ setGoToPage: (d)=>{
224
+ l.current = d;
231
225
  },
232
- setBulletsProps: s
226
+ setBulletsProps: r,
227
+ setAutoplayControlProps: f,
228
+ setPageControlsProps: m,
229
+ setIsAutoplayEnabledSetter: (d)=>{
230
+ u.current = d;
231
+ }
233
232
  },
234
- children: t
233
+ children: e
234
+ })
235
+ });
236
+ }, Vo = ()=>_react.useContext(ge), Do = ge.Consumer, Fe = (param)=>{
237
+ let { currentIndex: e, numPages: t } = param;
238
+ var _t_tablet;
239
+ const r = (0, _themevariantcontext.useIsInverseOrMediaVariant)(), { isTablet: s, isDesktopOrBigger: f } = (0, _hooks.useScreenSize)(), i = typeof t == "number" ? t : f ? t.desktop : s ? (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile : t.mobile, m = (h)=>{
240
+ const l = {};
241
+ if (r ? l[e === h ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse] = !0 : l[e === h ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet] = !0, e === h) return l[_carouselcssmistica.bulletActiveSizing] = !0, l;
242
+ const u = Math.abs(h - e);
243
+ return i <= _carouselcssmistica.VISIBLE_BULLETS || u === 1 ? (l[_carouselcssmistica.bulletInactiveSizing] = !0, l) : e === 0 || e === i - 1 ? (l[_carouselcssmistica.bulletInactiveSizing] = u === 2, l[_carouselcssmistica.bulletInactiveMediumSizing] = u === 3, l[_carouselcssmistica.bulletInactiveSmallSizing] = u > 3, l) : (l[_carouselcssmistica.bulletInactiveMediumSizing] = u === 2, l[_carouselcssmistica.bulletInactiveSmallSizing] = u > 2, l);
244
+ }, v = (h)=>e + 2 < _carouselcssmistica.VISIBLE_BULLETS ? h : i - e + 1 < _carouselcssmistica.VISIBLE_BULLETS ? h - (i - _carouselcssmistica.VISIBLE_BULLETS) : h - (e - 2);
245
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)({
246
+ "component-name": "PageBullets"
247
+ })), {
248
+ className: (0, _classnames.default)(_carouselcssmistica.bulletsScrollableContainerBase, {
249
+ [_carouselcssmistica.bulletsScrollableContainer]: i > _carouselcssmistica.VISIBLE_BULLETS
250
+ }),
251
+ children: Array.from({
252
+ length: i
253
+ }, (h, l)=>{
254
+ const u = v(l);
255
+ var _t_tablet;
256
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
257
+ className: (0, _classnames.default)({
258
+ [_carouselcssmistica.scrollableBullet]: i > _carouselcssmistica.VISIBLE_BULLETS
259
+ }, typeof t == "number" ? {
260
+ [_carouselcssmistica.bulletButton]: !0,
261
+ [_carouselcssmistica.bulletVisibility]: l < t
262
+ } : {
263
+ [_carouselcssmistica.bulletButton]: !0,
264
+ [_carouselcssmistica.bulletVisibilityMobile]: l < t.mobile,
265
+ [_carouselcssmistica.bulletVisibilityTablet]: l < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
266
+ [_carouselcssmistica.bulletVisibilityDesktop]: l < t.desktop
267
+ }),
268
+ style: _object_spread({}, (0, _css.applyCssVars)({
269
+ [_carouselcssmistica.vars.desktopBulletLeftPosition]: `${u * _carouselcssmistica.LARGE_BULLET_FULL_SIZE}px`,
270
+ [_carouselcssmistica.vars.mobileBulletLeftPosition]: `${u * _carouselcssmistica.SMALL_BULLET_FULL_SIZE}px`
271
+ })),
272
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
273
+ className: (0, _classnames.default)(m(l))
274
+ })
275
+ }, l);
235
276
  })
277
+ }));
278
+ }, Ue = (param)=>{
279
+ let { bleedLeft: e, bleedRight: t, goPrev: r, goNext: s, setShouldAutoplay: f, prevArrowEnabled: i, nextArrowEnabled: m } = param;
280
+ const { texts: v, t: h } = (0, _hooks.useTheme)(), l = (0, _themevariantcontext.useThemeVariant)();
281
+ return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
282
+ space: l === "media" ? 16 : 8,
283
+ children: [
284
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.IconButton, {
285
+ Icon: _iconchevronleftregular.default,
286
+ "aria-label": v.carouselPrevButton || h(_texttokens.carouselPrevButton),
287
+ type: "neutral",
288
+ backgroundType: l === "media" ? "transparent" : "soft",
289
+ small: !0,
290
+ bleedLeft: e,
291
+ onPress: ()=>{
292
+ r(), f(!1);
293
+ },
294
+ disabled: !i
295
+ }),
296
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.IconButton, {
297
+ Icon: _iconchevronrightregular.default,
298
+ "aria-label": v.carouselNextButton || h(_texttokens.carouselNextButton),
299
+ type: "neutral",
300
+ backgroundType: l === "media" ? "transparent" : "soft",
301
+ small: !0,
302
+ bleedRight: t,
303
+ onPress: ()=>{
304
+ s(), f(!1);
305
+ },
306
+ disabled: !m
307
+ })
308
+ ]
236
309
  });
237
- }, Ut = ()=>_react.useContext(re), Yt = re.Consumer, ie = (t, e, s)=>s ? typeof s == "number" ? s : s[t] || e[t] : e[t], It = (t, e)=>{
238
- const s = {
310
+ }, $e = (param)=>{
311
+ let { isAutoplayEnabled: e, isAtLastPage: t, onAutoplayChanged: r, bleedLeft: s = !1, bleedRight: f = !1 } = param;
312
+ const { texts: i, t: m } = (0, _hooks.useTheme)();
313
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.ToggleIconButton, {
314
+ checkedProps: {
315
+ Icon: _iconpausefilled.default,
316
+ type: "neutral",
317
+ "aria-label": i.carouselPauseAutoplay || m(_texttokens.carouselPauseAutoplay)
318
+ },
319
+ uncheckedProps: {
320
+ Icon: t ? _iconreloadregular.default : _iconplayfilled.default,
321
+ type: "neutral",
322
+ "aria-label": t ? i.carouselReloadAutoplay || m(_texttokens.carouselReloadAutoplay) : i.carouselEnableAutoplay || m(_texttokens.carouselEnableAutoplay)
323
+ },
324
+ small: !0,
325
+ bleedLeft: s,
326
+ bleedRight: f,
327
+ onChange: r,
328
+ checked: e
329
+ });
330
+ }, Ne = (e, t, r)=>r ? typeof r == "number" ? r : r[e] || t[e] : t[e], io = (e, t)=>{
331
+ const r = {
239
332
  mobile: 1,
240
333
  tablet: 2,
241
334
  desktop: {
@@ -244,279 +337,346 @@ const Pe = (t, e)=>{
244
337
  large: 3
245
338
  }
246
339
  };
247
- if (!e) return _object_spread_props(_object_spread({}, s), {
248
- desktop: ie(t, s.desktop)
340
+ if (!t) return _object_spread_props(_object_spread({}, r), {
341
+ desktop: Ne(e, r.desktop)
249
342
  });
250
- if (typeof e == "number") return {
251
- mobile: e,
252
- tablet: e,
253
- desktop: e
343
+ if (typeof t == "number") return {
344
+ mobile: t,
345
+ tablet: t,
346
+ desktop: t
254
347
  };
255
- const r = ie(t, s.desktop, e.desktop);
256
- return _object_spread_props(_object_spread({}, s, e), {
257
- desktop: r
348
+ const s = Ne(e, r.desktop, t.desktop);
349
+ return _object_spread_props(_object_spread({}, r, t), {
350
+ desktop: s
258
351
  });
259
- }, ue = (t, e)=>{
260
- if (t.length === 0) return [];
261
- const s = Math.ceil(t.length / e), r = [];
262
- for(let i = 0; i < t.length; i += s)r.push(t[i]);
263
- return r[r.length - 1] = t[t.length - s], r;
264
- }, Mt = (t, e)=>{
265
- const s = [];
266
- for(let r = 0; r < e.length; r++)r === 0 ? s.push(e[0]) : s.push((e[r] + e[r - 1]) / 2);
267
- for(let r = s.length - 1; r >= 0; r--)if (t - s[r] >= -1) return r;
352
+ }, Be = (e, t)=>{
353
+ if (e.length === 0) return [];
354
+ const r = Math.ceil(e.length / t), s = [];
355
+ for(let f = 0; f < e.length; f += r)s.push(e[f]);
356
+ return s[s.length - 1] = e[e.length - r], s;
357
+ }, uo = (e, t)=>{
358
+ const r = [];
359
+ for(let s = 0; s < t.length; s++)s === 0 ? r.push(t[0]) : r.push((t[s] + t[s - 1]) / 2);
360
+ for(let s = r.length - 1; s >= 0; s--)if (e - r[s] >= -1) return s;
268
361
  return 0;
269
- }, Se = 5e3, Re = (param)=>{
270
- let { items: t, itemStyle: e, itemClassName: s, withBullets: r, renderBullets: i, initialActiveItem: m, itemsPerPage: P, itemsToScroll: u, mobilePageOffset: f, gap: S, free: I, centered: h, autoplay: x, onPageChange: N, dataAttributes: J } = param;
271
- const { texts: R, platformOverrides: w, skinName: j, t: F } = (0, _hooks.useTheme)(), Q = (0, _desktopcontainertypecontext.useDesktopContainerType)(), a = It(Q || "large", P), { isDesktopOrBigger: B, isTablet: W } = (0, _hooks.useScreenSize)(), K = W ? a.tablet : a.mobile, C = Math.max(Math.floor(B ? a.desktop : K), 1), l = _react.useRef(null), p = Math.ceil(t.length / Math.max(Math.floor(a.mobile), 1)), v = Math.ceil(t.length / Math.max(Math.floor(a.tablet), 1)), M = Math.ceil(t.length / Math.max(Math.floor(a.desktop), 1)), E = Math.ceil(t.length / C), [{ scrollLeft: A, scrollRight: D }, Le] = _react.useState({
362
+ }, je = 5e3, Ke = (param)=>{
363
+ let { items: e, itemStyle: t, itemClassName: r, withBullets: s, renderBullets: f, initialActiveItem: i, itemsPerPage: m, itemsToScroll: v, mobilePageOffset: h, gap: l, free: u, centered: A, autoplay: d, withControls: _ = !0, onPageChange: G, dataAttributes: ie, "aria-label": N, "aria-labelledby": B } = param;
364
+ const { platformOverrides: W, skinName: P, texts: ue, t: q } = (0, _hooks.useTheme)(), D = (0, _desktopcontainertypecontext.useDesktopContainerType)(), b = io(D || "large", m), { isDesktopOrBigger: V, isTablet: J } = (0, _hooks.useScreenSize)(), F = J ? b.tablet : b.mobile, T = Math.max(Math.floor(V ? b.desktop : F), 1), L = _react.useRef(null), n = Math.ceil(e.length / Math.max(Math.floor(b.mobile), 1)), g = Math.ceil(e.length / Math.max(Math.floor(b.tablet), 1)), y = Math.ceil(e.length / Math.max(Math.floor(b.desktop), 1)), I = Math.ceil(e.length / T), [{ scrollLeft: Q, scrollRight: O }, fe] = _react.useState({
272
365
  scrollLeft: 0,
273
- scrollRight: 0
274
- }), [X, Te] = _react.useState([]), U = _react.useMemo(()=>ue(X, E), [
275
- X,
276
- E
277
- ]), Y = u ? ue(X, Math.ceil(t.length / u)) : U, ye = D !== 0, We = A !== 0;
366
+ scrollRight: 1
367
+ }), [de, Ye] = _react.useState([]), X = _react.useMemo(()=>Be(de, I), [
368
+ de,
369
+ I
370
+ ]), ee = v ? Be(de, Math.ceil(e.length / v)) : X, U = O !== 0, te = Q !== 0, { isAutoplayEnabled: oe, shouldAutoplay: ve, setShouldAutoPlay: E } = Oe(!!d, L);
278
371
  _react.useEffect(()=>{
279
- if (l.current) {
280
- const c = l.current, d = ()=>{
281
- const { scrollWidth: Z, clientWidth: O } = c, $ = Math.round(c.scrollLeft), H = Math.round(Z - ($ + O));
282
- Le({
283
- scrollLeft: $,
284
- scrollRight: H
372
+ if (L.current) {
373
+ const c = L.current, p = ()=>{
374
+ const { scrollWidth: re, clientWidth: Z } = c, ne = Math.round(c.scrollLeft), ae = Math.round(re - (ne + Z));
375
+ fe({
376
+ scrollLeft: ne,
377
+ scrollRight: ae
285
378
  });
286
- }, b = ()=>{
287
- const Z = c.scrollWidth - c.clientWidth;
288
- Te(Array.from(c.querySelectorAll("[data-item]")).map((O, $)=>{
289
- if ($ === t.length - 1) return Z;
290
- const H = O.offsetLeft, Ge = parseInt(getComputedStyle(O).scrollMargin), Oe = h && !B ? H - O.clientWidth / 2 : H;
291
- return Math.min(Oe - Ge - c.offsetLeft, Z);
379
+ }, C = ()=>{
380
+ const re = c.scrollWidth - c.clientWidth;
381
+ Ye(Array.from(c.querySelectorAll("[data-item]")).map((Z, ne)=>{
382
+ if (ne === e.length - 1) return re;
383
+ const ae = Z.offsetLeft, Xe = parseInt(getComputedStyle(Z).scrollMargin), et = A && !V ? ae - Z.clientWidth / 2 : ae;
384
+ return Math.min(et - Xe - c.offsetLeft, re);
292
385
  }));
293
386
  };
294
- d(), b(), c.addEventListener("scroll", d);
295
- const g = (0, _dom.listenResize)(c, ()=>{
296
- d(), b();
387
+ p(), C(), c.addEventListener("scroll", p);
388
+ const R = (0, _dom.listenResize)(c, ()=>{
389
+ p(), C();
297
390
  });
298
391
  return ()=>{
299
- c.removeEventListener("scroll", d), g();
392
+ c.removeEventListener("scroll", p), R();
300
393
  };
301
394
  }
302
395
  return ()=>{};
303
396
  }, [
304
- a.desktop,
305
- a.tablet,
306
- a.mobile,
307
- E,
308
- S,
309
- h,
310
- B,
311
- t.length
397
+ b.desktop,
398
+ b.tablet,
399
+ b.mobile,
400
+ I,
401
+ l,
402
+ A,
403
+ V,
404
+ e.length
312
405
  ]);
313
- const L = _react.useCallback(function(c) {
314
- let d = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
315
- const b = l.current;
316
- if (b) {
317
- const g = U[c];
318
- b.scrollTo({
319
- left: g,
320
- behavior: d ? "smooth" : "auto"
406
+ const $ = _react.useCallback(function(c) {
407
+ let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
408
+ const C = L.current;
409
+ if (C) {
410
+ const R = X[c];
411
+ C.scrollTo({
412
+ left: R,
413
+ behavior: p ? "smooth" : "auto"
321
414
  });
322
415
  }
323
416
  }, [
324
- U
325
- ]), ee = _react.useCallback(()=>{
326
- const c = l.current;
417
+ X
418
+ ]), he = _react.useCallback(()=>{
419
+ const c = L.current;
327
420
  if (c) {
328
- const { scrollLeft: d } = c, b = [
329
- ...Y
330
- ].reverse().find((g)=>g - d < -1);
421
+ const { scrollLeft: p } = c, C = [
422
+ ...ee
423
+ ].reverse().find((R)=>R - p < -1);
331
424
  c.scrollTo({
332
- left: b,
425
+ left: C,
333
426
  behavior: "smooth"
334
427
  });
335
428
  }
336
429
  }, [
337
- Y
338
- ]), G = _react.useCallback(()=>{
339
- const c = l.current;
430
+ ee
431
+ ]), j = _react.useCallback(()=>{
432
+ const c = L.current;
340
433
  if (c) {
341
- const { scrollLeft: d } = c, b = Y.find((g)=>g - d > 1);
434
+ const { scrollLeft: p } = c, C = ee.find((R)=>R - p > 1);
342
435
  c.scrollTo({
343
- left: b,
436
+ left: C,
344
437
  behavior: "smooth"
345
438
  });
346
439
  }
347
440
  }, [
348
- Y
349
- ]), ne = Pe(!!x, l);
441
+ ee
442
+ ]);
350
443
  _react.useEffect(()=>{
351
- m !== void 0 && L(Math.floor(m / C), !1);
444
+ i !== void 0 && $(Math.floor(i / T), !1);
352
445
  }, [
353
- m,
354
- L,
355
- C
356
- ]), _react.useEffect(()=>{
357
- if (ne && x) {
358
- const c = typeof x == "boolean" ? Se : x.time, d = typeof x == "object" && x.loop, b = setInterval(()=>{
359
- var g;
360
- D !== 0 ? G() : d && ((g = l.current) == null || g.scrollTo({
446
+ i,
447
+ $,
448
+ T
449
+ ]);
450
+ const se = typeof d == "object" && d.loop || !1, K = _react.useRef({
451
+ interacting: !1,
452
+ left: 0
453
+ });
454
+ _react.useEffect(()=>{
455
+ if (ve && d) {
456
+ const c = typeof d == "boolean" ? je : d.time, p = setInterval(()=>{
457
+ var C;
458
+ K.current.interacting || (O !== 0 ? j() : se && ((C = L.current) == null || C.scrollTo({
361
459
  left: 0,
362
460
  behavior: "smooth"
363
- }));
461
+ })));
364
462
  }, c);
365
- return ()=>clearInterval(b);
463
+ return ()=>clearInterval(p);
366
464
  }
367
465
  }, [
368
- x,
369
- G,
370
- D,
371
- ne
466
+ d,
467
+ j,
468
+ O,
469
+ ve,
470
+ se
372
471
  ]);
373
- const k = Mt(A, U), ce = _react.useRef(!m), ae = _react.useRef(0);
472
+ const S = uo(Q, X), qe = 20;
374
473
  _react.useEffect(()=>{
375
- if (N) {
376
- const c = Math.min((k + 1) * C - 1, t.length - 1), d = [];
377
- for(let b = 0; b < C; b++){
378
- const g = c - b;
379
- g >= 0 && d.unshift(g);
474
+ S === I - 1 && !se && E(!1);
475
+ }, [
476
+ S,
477
+ I,
478
+ E,
479
+ se
480
+ ]);
481
+ const Pe = _react.useRef(!i), ye = _react.useRef(0);
482
+ _react.useEffect(()=>{
483
+ if (G) {
484
+ const c = Math.min((S + 1) * T - 1, e.length - 1), p = [];
485
+ for(let C = 0; C < T; C++){
486
+ const R = c - C;
487
+ R >= 0 && p.unshift(R);
380
488
  }
381
- ce.current ? ae.current !== k && N({
382
- pageIndex: k,
383
- shownItemIndexes: d
384
- }) : ce.current = d.includes(m || 0), ae.current = k;
489
+ Pe.current ? ye.current !== S && G({
490
+ pageIndex: S,
491
+ shownItemIndexes: p
492
+ }) : Pe.current = p.includes(i || 0), ye.current = S;
385
493
  }
386
494
  }, [
387
- k,
388
- t.length,
389
- C,
390
- m,
391
- N
495
+ S,
496
+ e.length,
497
+ T,
498
+ i,
499
+ G
392
500
  ]);
393
- const T = _react.useContext(le), te = _react.useMemo(()=>({
394
- currentIndex: k,
501
+ const M = _react.useContext(Ce), pe = _react.useMemo(()=>({
502
+ currentIndex: S,
395
503
  numPages: {
396
- mobile: p,
397
- tablet: v,
398
- desktop: M
504
+ mobile: n,
505
+ tablet: g,
506
+ desktop: y
399
507
  }
400
508
  }), [
401
- k,
402
- M,
403
- p,
404
- v
509
+ S,
510
+ y,
511
+ n,
512
+ g
513
+ ]), Se = _react.useMemo(()=>({
514
+ isAutoplayEnabled: oe,
515
+ isAtLastPage: S === I - 1,
516
+ onAutoplayChanged: E
517
+ }), [
518
+ oe,
519
+ S,
520
+ I,
521
+ E
522
+ ]), Ee = _react.useMemo(()=>({
523
+ setShouldAutoplay: E,
524
+ prevArrowEnabled: te,
525
+ nextArrowEnabled: U
526
+ }), [
527
+ E,
528
+ te,
529
+ U
405
530
  ]);
406
531
  _react.useEffect(()=>{
407
- T && (T.setGoPrev(ee), T.setGoNext(G), T.setGoToPage(L), T.setBulletsProps(te));
532
+ M && (M.setGoPrev(he), M.setGoNext(j), M.setGoToPage($), M.setBulletsProps(pe), M.setAutoplayControlProps(Se), M.setPageControlsProps(Ee), M.setIsAutoplayEnabledSetter(E));
408
533
  }, [
409
- T,
410
- G,
411
- ee,
534
+ M,
535
+ j,
536
+ he,
537
+ pe,
538
+ Se,
539
+ Ee,
540
+ $,
412
541
  te,
413
- L
542
+ U,
543
+ d,
544
+ oe,
545
+ E
414
546
  ]);
415
- let q = null;
416
- i ? q = i({
417
- numPages: E,
418
- currentIndex: k,
419
- onPress: L
420
- }) : r && (q = /* @__PURE__ */ (0, _jsxruntime.jsx)(we, _object_spread_props(_object_spread({}, te), {
421
- onPress: L
422
- })));
423
- const Ae = "64px", De = "36px";
547
+ let le = null;
548
+ f ? le = f({
549
+ numPages: I,
550
+ currentIndex: S
551
+ }) : s && (le = /* @__PURE__ */ (0, _jsxruntime.jsx)(Fe, _object_spread({}, pe)));
552
+ const Je = "64px", Qe = "36px", Ae = /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
553
+ className: (0, _classnames.default)(_carouselcssmistica.carouselBullets, !f && {
554
+ [_carouselcssmistica.noCarouselBulletsDesktop]: y <= 1,
555
+ [_carouselcssmistica.noCarouselBulletsTablet]: g <= 1,
556
+ [_carouselcssmistica.noCarouselBulletsMobile]: n <= 1
557
+ }),
558
+ children: le
559
+ });
424
560
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(_object_spread({
425
561
  "component-name": "Carousel"
426
- }, J))), {
562
+ }, ie))), {
563
+ className: _carouselcssmistica.carouselComponentContainer,
564
+ role: "region",
565
+ "aria-label": N ? `${N}, ${ue.carouselRegion || q(_texttokens.carouselRegion)}` : void 0,
566
+ "aria-labelledby": N ? void 0 : B,
427
567
  children: [
428
- /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
429
- className: _carouselcssmistica.carouselContainer,
430
- children: [
431
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
432
- isInverse: !1,
433
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
434
- className: _carouselcssmistica.carouselPrevArrowButton,
435
- "aria-label": R.carouselPrevButton || F(_texttokens.carouselPrevButton),
436
- onPress: ee,
437
- disabled: !We,
438
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
439
- })
440
- }),
441
- /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
442
- className: (0, _classnames.default)(_carouselcssmistica.carousel, {
443
- [_carouselcssmistica.centeredCarousel]: h,
444
- [_carouselcssmistica.carouselWithScrollMobile]: p > 1,
445
- [_carouselcssmistica.carouselWithScrollTablet]: v > 1
446
- }),
447
- style: _object_spread_props(_object_spread({}, (0, _css.applyCssVars)(_object_spread({
448
- [_carouselcssmistica.vars.itemsPerPageDesktop]: String(a.desktop),
449
- [_carouselcssmistica.vars.itemsPerPageTablet]: String(a.tablet),
450
- [_carouselcssmistica.vars.itemsPerPageMobile]: String(a.mobile)
451
- }, f === "large" ? {
452
- [_carouselcssmistica.vars.mobilePageOffset]: Ae
453
- } : j === _constants.VIVO_NEW_SKIN ? {
454
- [_carouselcssmistica.vars.mobilePageOffset]: De
455
- } : {}, S !== void 0 ? {
456
- [_carouselcssmistica.vars.gap]: String(S)
457
- } : {}))), {
458
- scrollSnapType: I ? "initial" : "x mandatory",
459
- // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
460
- // there is a webkit rendering bug that causes a half pixel white line to appear at
461
- // the bottom of the scrollable area in retina displays when it has a height with
462
- // decimals. This extra padding avoids that line to partially cover the carousel
463
- // slides border:
464
- paddingBottom: (0, _platform.isIos)(w) && !(0, _platform.isRunningAcceptanceTest)(w) ? 0.5 : void 0
568
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
569
+ className: (0, _classnames.default)(_carouselcssmistica.carouselControlsVisibility, {
570
+ [_carouselcssmistica.carouselControlsVisibilityMobile]: n > 1,
571
+ [_carouselcssmistica.carouselControlsVisibilityTablet]: g > 1,
572
+ [_carouselcssmistica.carouselControlsVisibilityDesktop]: y > 1
573
+ }),
574
+ children: _ ? /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
575
+ space: "between",
576
+ alignItems: "center",
577
+ className: _carouselcssmistica.carouselControlsContainer,
578
+ children: [
579
+ !!d && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
580
+ className: _carouselcssmistica.carouselAutoplayControlContainer,
581
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)($e, {
582
+ isAutoplayEnabled: oe,
583
+ isAtLastPage: S === I - 1,
584
+ onAutoplayChanged: (c)=>{
585
+ !U && c && $(0), E(c);
586
+ }
587
+ })
465
588
  }),
466
- ref: l,
467
- children: t.map((c, d)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
468
- className: (0, _classnames.default)(_carouselcssmistica.carouselItem, s),
469
- style: _object_spread_props(_object_spread({}, e), {
470
- scrollSnapStop: (0, _platform.isAndroid)(w) ? "always" : "normal"
471
- }),
472
- "data-item": !0,
473
- children: c
474
- }, d))
475
- }),
476
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
477
- isInverse: !1,
478
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
479
- className: _carouselcssmistica.carouselNextArrowButton,
480
- "aria-label": R.carouselNextButton || F(_texttokens.carouselNextButton),
481
- onPress: G,
482
- disabled: !ye,
483
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
589
+ Ae,
590
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
591
+ className: _carouselcssmistica.carouselPagesControlsContainer,
592
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Ue, {
593
+ goNext: j,
594
+ goPrev: he,
595
+ setShouldAutoplay: E,
596
+ prevArrowEnabled: te,
597
+ nextArrowEnabled: U
598
+ })
484
599
  })
485
- })
486
- ]
600
+ ]
601
+ }) : le && /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
602
+ space: "around",
603
+ className: _carouselcssmistica.carouselControlsContainer,
604
+ children: Ae
605
+ })
487
606
  }),
488
- q && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
489
- className: (0, _classnames.default)(_carouselcssmistica.carouselBullets, !i && {
490
- [_carouselcssmistica.noCarouselBulletsDesktop]: M <= 1,
491
- [_carouselcssmistica.noCarouselBulletsTablet]: v <= 1,
492
- [_carouselcssmistica.noCarouselBulletsMobile]: p <= 1
493
- }),
494
- children: q
607
+ /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
608
+ className: _carouselcssmistica.carouselContainer,
609
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
610
+ className: (0, _classnames.default)(_carouselcssmistica.carousel, {
611
+ [_carouselcssmistica.centeredCarousel]: A,
612
+ [_carouselcssmistica.carouselWithScrollMobile]: n > 1,
613
+ [_carouselcssmistica.carouselWithScrollTablet]: g > 1
614
+ }),
615
+ role: "list",
616
+ style: _object_spread_props(_object_spread({}, (0, _css.applyCssVars)(_object_spread({
617
+ [_carouselcssmistica.vars.itemsPerPageDesktop]: String(b.desktop),
618
+ [_carouselcssmistica.vars.itemsPerPageTablet]: String(b.tablet),
619
+ [_carouselcssmistica.vars.itemsPerPageMobile]: String(b.mobile)
620
+ }, h === "large" ? {
621
+ [_carouselcssmistica.vars.mobilePageOffset]: Je
622
+ } : P === _constants.VIVO_NEW_SKIN ? {
623
+ [_carouselcssmistica.vars.mobilePageOffset]: Qe
624
+ } : {}, l !== void 0 ? {
625
+ [_carouselcssmistica.vars.gap]: String(l)
626
+ } : {}))), {
627
+ scrollSnapType: u ? "initial" : "x mandatory",
628
+ // Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
629
+ // there is a webkit rendering bug that causes a half pixel white line to appear at
630
+ // the bottom of the scrollable area in retina displays when it has a height with
631
+ // decimals. This extra padding avoids that line to partially cover the carousel
632
+ // slides border:
633
+ paddingBottom: (0, _platform.isIos)(W) && !(0, _platform.isRunningAcceptanceTest)(W) ? 0.5 : void 0
634
+ }),
635
+ ref: L,
636
+ onTouchStart: (c)=>{
637
+ K.current.left = c.currentTarget.scrollLeft, K.current.interacting = !0;
638
+ },
639
+ onTouchEnd: (c)=>{
640
+ K.current.interacting = !1, Math.abs(c.currentTarget.scrollLeft - K.current.left) > qe && E(!1);
641
+ },
642
+ onKeyDown: ()=>{
643
+ E(!1);
644
+ },
645
+ children: e.map((c, p)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
646
+ className: (0, _classnames.default)(_carouselcssmistica.carouselItem, r),
647
+ style: _object_spread_props(_object_spread({}, t), {
648
+ scrollSnapStop: (0, _platform.isAndroid)(W) ? "always" : "normal"
649
+ }),
650
+ role: "listitem",
651
+ "data-item": !0,
652
+ children: c
653
+ }, p))
654
+ })
495
655
  })
496
656
  ]
497
657
  }));
498
- }, Be = ()=>{
499
- const [t, e] = _react.useState(1);
658
+ }, Ze = ()=>{
659
+ const [e, t] = _react.useState(1);
500
660
  return _react.useEffect(()=>{
501
- const s = ()=>{
502
- window.innerWidth !== 0 && (e((r)=>r + 1), window.removeEventListener("resize", s));
661
+ const r = ()=>{
662
+ window.innerWidth !== 0 && (t((s)=>s + 1), window.removeEventListener("resize", r));
503
663
  };
504
- return window.innerWidth === 0 && window.addEventListener("resize", s), ()=>{
505
- window.removeEventListener("resize", s);
664
+ return window.innerWidth === 0 && window.addEventListener("resize", r), ()=>{
665
+ window.removeEventListener("resize", r);
506
666
  };
507
- }, []), t;
508
- }, qt = (t)=>{
509
- const e = Be();
510
- return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(Re, _object_spread_props(_object_spread({}, t), {
511
- key: e
667
+ }, []), e;
668
+ }, Oo = (e)=>{
669
+ const t = Ze();
670
+ return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(Ke, _object_spread_props(_object_spread({}, e), {
671
+ key: t
512
672
  }));
513
- }, Zt = (param)=>{
514
- let { items: t, itemStyle: e, itemClassName: s, withBullets: r, renderBullets: i, initialActiveItem: m, onPageChange: P, dataAttributes: u } = param;
515
- const f = Be();
516
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(Re, {
517
- items: t,
518
- itemStyle: e,
519
- itemClassName: s,
673
+ }, zo = (param)=>{
674
+ let { items: e, itemStyle: t, itemClassName: r, withBullets: s, renderBullets: f, withControls: i = !0, initialActiveItem: m, onPageChange: v, dataAttributes: h, "aria-label": l, "aria-labelledby": u } = param;
675
+ const A = Ze();
676
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(Ke, {
677
+ items: e,
678
+ itemStyle: t,
679
+ itemClassName: r,
520
680
  itemsPerPage: {
521
681
  mobile: 1,
522
682
  tablet: 1,
@@ -525,159 +685,185 @@ const Pe = (t, e)=>{
525
685
  centered: !0,
526
686
  itemsToScroll: 1,
527
687
  gap: 0,
528
- withBullets: r,
529
- renderBullets: i,
688
+ withBullets: s,
689
+ renderBullets: f,
690
+ withControls: i,
530
691
  initialActiveItem: m,
531
- onPageChange: P,
532
- dataAttributes: u
533
- }, f);
534
- }, Ee = /*#__PURE__*/ _react.createContext(void 0), $t = ()=>_react.useContext(Ee), Ht = (param)=>{
535
- let { items: t, withBullets: e, autoplay: s, initialPageIndex: r = 0, onPageChange: i, dataAttributes: m, inverseBullets: P = !0 } = param;
536
- const { texts: u, platformOverrides: f, t: S } = (0, _hooks.useTheme)(), I = _react.useContext(le), h = _react.useRef(null), [{ scrollLeft: x, scrollRight: N }, J] = _react.useState({
692
+ onPageChange: v,
693
+ dataAttributes: h,
694
+ "aria-label": l,
695
+ "aria-labelledby": u
696
+ }, A);
697
+ }, He = /*#__PURE__*/ _react.createContext(void 0), _o = ()=>_react.useContext(He), Go = (param)=>{
698
+ let { items: e, withBullets: t, withControls: r = !0, autoplay: s, initialPageIndex: f = 0, onPageChange: i, dataAttributes: m, inverseBullets: v = !0 } = param;
699
+ const { platformOverrides: h } = (0, _hooks.useTheme)(), l = _react.useContext(Ce), u = _react.useRef(null), [{ scrollLeft: A, scrollRight: d }, _] = _react.useState({
537
700
  scrollLeft: 0,
538
- scrollRight: 0
539
- }), R = _react.useCallback(()=>{
540
- const l = h.current;
541
- l && l.scrollBy({
542
- left: -l.clientWidth,
701
+ scrollRight: 1
702
+ }), G = d !== 0, ie = A !== 0, N = _react.useCallback(()=>{
703
+ const n = u.current;
704
+ n && n.scrollBy({
705
+ left: -n.clientWidth,
543
706
  behavior: "smooth"
544
707
  });
545
- }, []), w = _react.useCallback(()=>{
546
- const l = h.current;
547
- l && l.scrollBy({
548
- left: l.clientWidth,
708
+ }, []), B = _react.useCallback(()=>{
709
+ const n = u.current;
710
+ n && n.scrollBy({
711
+ left: n.clientWidth,
549
712
  behavior: "smooth"
550
713
  });
551
- }, []), j = _react.useCallback(function(l) {
552
- let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
553
- const v = h.current;
554
- v && v.scrollTo({
555
- left: v.clientWidth * l,
556
- behavior: p ? "smooth" : "auto"
714
+ }, []), W = _react.useCallback(function(n) {
715
+ let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
716
+ const y = u.current;
717
+ y && y.scrollTo({
718
+ left: y.clientWidth * n,
719
+ behavior: g ? "smooth" : "auto"
557
720
  });
558
721
  }, [
559
- h
560
- ]), F = N !== 0, Q = x !== 0, a = h.current ? Math.floor((x + h.current.clientWidth / 2) / h.current.clientWidth) : 0;
722
+ u
723
+ ]), P = u.current ? Math.floor((A + u.current.clientWidth / 2) / u.current.clientWidth) : 0;
561
724
  _react.useLayoutEffect(()=>{
562
- const l = h.current;
563
- if (l) {
564
- const p = ()=>{
565
- const { scrollWidth: M, clientWidth: E } = l, A = Math.round(l.scrollLeft), D = Math.round(M - (A + E));
566
- J({
567
- scrollLeft: A,
568
- scrollRight: D
725
+ const n = u.current;
726
+ if (n) {
727
+ const g = ()=>{
728
+ const { scrollWidth: I, clientWidth: Q } = n, O = Math.round(n.scrollLeft), fe = Math.round(I - (O + Q));
729
+ _({
730
+ scrollLeft: O,
731
+ scrollRight: fe
569
732
  });
570
733
  };
571
- p(), l.addEventListener("scroll", p);
572
- const v = (0, _dom.listenResize)(l, p);
734
+ g(), n.addEventListener("scroll", g);
735
+ const y = (0, _dom.listenResize)(n, g);
573
736
  return ()=>{
574
- l.removeEventListener("scroll", p), v();
737
+ n.removeEventListener("scroll", g), y();
575
738
  };
576
739
  }
577
740
  }, [
578
- t.length
741
+ e.length
579
742
  ]);
580
- const B = Pe(!!s, h);
743
+ const { isAutoplayEnabled: ue, shouldAutoplay: q, setShouldAutoPlay: D } = Oe(!!s, u), b = typeof s == "object" && s.loop || !1;
581
744
  _react.useEffect(()=>{
582
- if (B && s) {
583
- const l = typeof s == "boolean" ? Se : s.time, p = typeof s == "object" && s.loop, v = setInterval(()=>{
584
- var M;
585
- N !== 0 ? w() : p && ((M = h.current) == null || M.scrollTo({
745
+ if (q && s) {
746
+ const n = typeof s == "boolean" ? je : s.time, g = setInterval(()=>{
747
+ var y;
748
+ d !== 0 ? B() : b && ((y = u.current) == null || y.scrollTo({
586
749
  left: 0,
587
750
  behavior: "smooth"
588
751
  }));
589
- }, l);
590
- return ()=>clearInterval(v);
752
+ }, n);
753
+ return ()=>clearInterval(g);
591
754
  }
592
755
  }, [
593
756
  s,
594
- w,
595
- N,
596
- B
757
+ B,
758
+ d,
759
+ q,
760
+ b
761
+ ]), _react.useEffect(()=>{
762
+ P === e.length - 1 && !b && D(!1);
763
+ }, [
764
+ P,
765
+ e.length,
766
+ D,
767
+ b
597
768
  ]);
598
- const W = _react.useRef(!1), K = _react.useRef(0);
769
+ const V = _react.useRef(!1), J = _react.useRef(0);
599
770
  _react.useEffect(()=>{
600
- i && (W.current ? K.current !== a && i(a) : W.current = r === a), K.current = a;
771
+ i && (V.current ? J.current !== P && i(P) : V.current = f === P), J.current = P;
601
772
  }, [
602
- a,
603
- r,
773
+ P,
774
+ f,
604
775
  i
605
776
  ]), _react.useEffect(()=>{
606
- const l = h.current;
607
- r !== void 0 && l && !W.current && l.scrollTo({
608
- left: l.clientWidth * r
777
+ const n = u.current;
778
+ f !== void 0 && n && !V.current && n.scrollTo({
779
+ left: n.clientWidth * f
609
780
  });
610
781
  }, [
611
- r
782
+ f
612
783
  ]);
613
- const C = _react.useMemo(()=>({
614
- currentIndex: a,
615
- numPages: t.length
784
+ const F = _react.useMemo(()=>({
785
+ currentIndex: P,
786
+ numPages: e.length
616
787
  }), [
617
- a,
618
- t.length
788
+ P,
789
+ e.length
619
790
  ]);
620
- return _react.useEffect(()=>{
621
- I && (I.setGoPrev(R), I.setGoNext(w), I.setGoToPage(j), I.setBulletsProps(C));
791
+ _react.useEffect(()=>{
792
+ l && (l.setGoPrev(N), l.setGoNext(B), l.setGoToPage(W), l.setBulletsProps(F));
622
793
  }, [
623
- I,
624
- w,
625
- R,
626
- C,
627
- j
628
- ]), /* @__PURE__ */ (0, _jsxruntime.jsx)(Ee.Provider, {
794
+ l,
795
+ B,
796
+ N,
797
+ F,
798
+ W
799
+ ]);
800
+ const T = t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
801
+ className: _carouselcssmistica.slideshowBulletsContainer,
802
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
803
+ variant: v ? "inverse" : "default",
804
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(Fe, _object_spread({}, F))
805
+ })
806
+ }), L = !t && !s;
807
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(He.Provider, {
629
808
  value: {
630
- withBullets: !!e
809
+ withBullets: !!t
631
810
  },
632
811
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_responsivelayout.ResetResponsiveLayout, {
633
812
  skipDesktop: !0,
634
813
  children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
635
814
  className: (0, _classnames.default)(_carouselcssmistica.slideshowContainer, {
636
- [_carouselcssmistica.slideshowWithBullets]: !!e
815
+ [_carouselcssmistica.slideshowWithBullets]: !!t
637
816
  })
638
817
  }, (0, _dom.getPrefixedDataAttributes)(m, "SlideShow")), {
639
818
  children: [
640
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
641
- isInverse: !1,
642
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
643
- className: _carouselcssmistica.slideshowPrevArrowButton,
644
- "aria-label": u.carouselPrevButton || S(_texttokens.carouselPrevButton),
645
- onPress: R,
646
- disabled: !Q,
647
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
819
+ e.length > 1 && (r ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
820
+ variant: "media",
821
+ children: /* @__PURE__ */ (0, _jsxruntime.jsxs)(_inline.default, {
822
+ space: L ? 0 : "between",
823
+ alignItems: "center",
824
+ className: (0, _classnames.default)(_carouselcssmistica.slideshowControlsContainer, {
825
+ [_carouselcssmistica.slideshowControlsContainerSingleItem]: L
826
+ }),
827
+ children: [
828
+ !!s && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
829
+ className: _carouselcssmistica.slideshowAutoplayControlContainer,
830
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)($e, {
831
+ isAutoplayEnabled: ue,
832
+ isAtLastPage: P === e.length - 1,
833
+ onAutoplayChanged: (n)=>{
834
+ P === e.length - 1 && n && W(0), D(n);
835
+ }
836
+ })
837
+ }),
838
+ T,
839
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(Ue, {
840
+ goNext: B,
841
+ goPrev: N,
842
+ setShouldAutoplay: D,
843
+ prevArrowEnabled: ie,
844
+ nextArrowEnabled: G
845
+ })
846
+ ]
648
847
  })
649
- }),
848
+ }) : t && /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
849
+ space: "around",
850
+ className: _carouselcssmistica.slideshowControlsContainer,
851
+ children: T
852
+ })),
650
853
  /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
651
854
  style: (0, _css.applyCssVars)({
652
855
  [_imagecssmistica.vars.mediaBorderRadius]: "0px"
653
856
  }),
654
857
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
655
858
  className: _carouselcssmistica.slideshow,
656
- ref: h,
657
- children: t.map((l, p)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
859
+ ref: u,
860
+ children: e.map((n, g)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
658
861
  className: _carouselcssmistica.slideshowItem,
659
862
  style: {
660
- scrollSnapStop: (0, _platform.isAndroid)(f) ? "always" : "normal"
863
+ scrollSnapStop: (0, _platform.isAndroid)(h) ? "always" : "normal"
661
864
  },
662
- children: l
663
- }, p))
664
- })
665
- }),
666
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
667
- isInverse: !1,
668
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
669
- className: _carouselcssmistica.slideshowNextArrowButton,
670
- "aria-label": u.carouselNextButton || S(_texttokens.carouselNextButton),
671
- onPress: w,
672
- disabled: !F,
673
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
674
- })
675
- }),
676
- e && t.length > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
677
- isInverse: P,
678
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
679
- className: _carouselcssmistica.slideshowBullets,
680
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(we, _object_spread({}, C))
865
+ children: n
866
+ }, g))
681
867
  })
682
868
  })
683
869
  ]