@arc-ui/components 12.0.0-beta.5 → 12.0.0-beta.8

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 (445) hide show
  1. package/dist/Alert/Alert.cjs.js +9 -10
  2. package/dist/Alert/Alert.esm.js +4 -5
  3. package/dist/Alert/styles.css +1 -0
  4. package/dist/Align/Align.cjs.js +7 -8
  5. package/dist/Align/Align.esm.js +1 -2
  6. package/dist/Align/styles.css +1 -0
  7. package/dist/AppButton/AppButton.cjs.js +4 -3
  8. package/dist/AppButton/AppButton.esm.js +4 -3
  9. package/dist/AppButton/styles.css +1 -0
  10. package/dist/Avatar/Avatar.cjs.js +7 -8
  11. package/dist/Avatar/Avatar.esm.js +7 -8
  12. package/dist/Avatar/styles.css +1 -0
  13. package/dist/AvatarGroup/AvatarGroup.cjs.js +14 -15
  14. package/dist/AvatarGroup/AvatarGroup.esm.js +7 -8
  15. package/dist/AvatarGroup/styles.css +1 -0
  16. package/dist/Badge/Badge.cjs.js +5 -13
  17. package/dist/Badge/Badge.esm.js +4 -12
  18. package/dist/Badge/styles.css +1 -0
  19. package/dist/Box/Box.cjs.js +6 -24
  20. package/dist/Box/Box.esm.js +5 -23
  21. package/dist/Box/styles.css +1 -0
  22. package/dist/BrandLogo/BrandLogo.cjs.js +3 -4
  23. package/dist/BrandLogo/BrandLogo.esm.js +3 -4
  24. package/dist/BrandLogo/styles.css +1 -0
  25. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +5 -5
  26. package/dist/Breadcrumbs/Breadcrumbs.esm.js +5 -5
  27. package/dist/Breadcrumbs/styles.css +1 -0
  28. package/dist/Button/Button.cjs.js +5 -6
  29. package/dist/Button/Button.esm.js +5 -6
  30. package/dist/Button/styles.css +1 -0
  31. package/dist/ButtonV2/ButtonV2.cjs.js +5 -6
  32. package/dist/ButtonV2/ButtonV2.esm.js +5 -6
  33. package/dist/ButtonV2/styles.css +1 -0
  34. package/dist/Calendar/Calendar.cjs.js +10 -11
  35. package/dist/Calendar/Calendar.esm.js +10 -11
  36. package/dist/Calendar/styles.css +1 -0
  37. package/dist/CardFooter/CardFooter.cjs.js +17 -0
  38. package/dist/CardFooter/CardFooter.esm.js +9 -0
  39. package/dist/CardFooter/package.json +7 -0
  40. package/dist/CardFooter/styles.css +1 -0
  41. package/dist/CardHeading/CardHeading.cjs.js +14 -0
  42. package/dist/CardHeading/CardHeading.esm.js +6 -0
  43. package/dist/CardHeading/package.json +7 -0
  44. package/dist/CardHeading/styles.css +1 -0
  45. package/dist/Carousel/Carousel.cjs.js +1921 -0
  46. package/dist/Carousel/Carousel.esm.js +1913 -0
  47. package/dist/Carousel/package.json +7 -0
  48. package/dist/Carousel/styles.css +1 -0
  49. package/dist/Checkbox/Checkbox.cjs.js +8 -9
  50. package/dist/Checkbox/Checkbox.esm.js +8 -9
  51. package/dist/Checkbox/styles.css +1 -0
  52. package/dist/Columns/Columns.cjs.js +2 -3
  53. package/dist/Columns/Columns.esm.js +2 -3
  54. package/dist/Columns/styles.css +1 -0
  55. package/dist/ConditionalWrapper/ConditionalWrapper.cjs.js +10 -0
  56. package/dist/ConditionalWrapper/ConditionalWrapper.esm.js +2 -0
  57. package/dist/ConditionalWrapper/package.json +7 -0
  58. package/dist/ContentSwitcher/ContentSwitcher.cjs.js +20 -0
  59. package/dist/ContentSwitcher/ContentSwitcher.esm.js +12 -0
  60. package/dist/ContentSwitcher/package.json +7 -0
  61. package/dist/ContentSwitcher/styles.css +1 -0
  62. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs.js +23 -0
  63. package/dist/ContentSwitcherDropdown/ContentSwitcherDropdown.esm.js +15 -0
  64. package/dist/ContentSwitcherDropdown/package.json +7 -0
  65. package/dist/ContentSwitcherDropdown/styles.css +1 -0
  66. package/dist/DatePicker/DatePicker.cjs.js +19 -23
  67. package/dist/DatePicker/DatePicker.esm.js +19 -23
  68. package/dist/DatePicker/styles.css +1 -0
  69. package/dist/Disclosure/Disclosure.cjs.js +8 -9
  70. package/dist/Disclosure/Disclosure.esm.js +4 -5
  71. package/dist/Disclosure/styles.css +1 -0
  72. package/dist/DisclosureMini/DisclosureMini.cjs.js +5 -6
  73. package/dist/DisclosureMini/DisclosureMini.esm.js +5 -6
  74. package/dist/DisclosureMini/styles.css +1 -0
  75. package/dist/Download/Download.cjs.js +16 -0
  76. package/dist/Download/Download.esm.js +8 -0
  77. package/dist/Download/package.json +7 -0
  78. package/dist/Download/styles.css +1 -0
  79. package/dist/Elevation/Elevation.cjs.js +5 -5
  80. package/dist/Elevation/Elevation.esm.js +1 -1
  81. package/dist/Elevation/styles.css +1 -0
  82. package/dist/Filter/Filter.cjs.js +4 -4
  83. package/dist/Filter/Filter.esm.js +4 -4
  84. package/dist/Filter/styles.css +1 -0
  85. package/dist/FormControl/FormControl.cjs.js +7 -8
  86. package/dist/FormControl/FormControl.esm.js +7 -8
  87. package/dist/FormControl/styles.css +1 -0
  88. package/dist/Grid/Grid.cjs.js +2 -3
  89. package/dist/Grid/Grid.esm.js +2 -3
  90. package/dist/Grid/styles.css +1 -0
  91. package/dist/Group/Group.cjs.js +3 -3
  92. package/dist/Group/Group.esm.js +3 -3
  93. package/dist/Group/styles.css +1 -0
  94. package/dist/Heading/Heading.cjs.js +3 -4
  95. package/dist/Heading/Heading.esm.js +3 -4
  96. package/dist/Heading/styles.css +1 -0
  97. package/dist/HeroBanner/HeroBanner.cjs.js +63 -0
  98. package/dist/HeroBanner/HeroBanner.esm.js +55 -0
  99. package/dist/HeroBanner/package.json +7 -0
  100. package/dist/HeroBanner/styles.css +1 -0
  101. package/dist/HeroButton/HeroButton.cjs.js +5 -6
  102. package/dist/HeroButton/HeroButton.esm.js +5 -6
  103. package/dist/HeroButton/styles.css +1 -0
  104. package/dist/Hidden/Hidden.cjs.js +5 -5
  105. package/dist/Hidden/Hidden.esm.js +1 -1
  106. package/dist/Hidden/styles.css +1 -0
  107. package/dist/Icon/Icon.cjs.js +3 -4
  108. package/dist/Icon/Icon.esm.js +3 -4
  109. package/dist/Icon/styles.css +1 -0
  110. package/dist/Image/Image.cjs.js +2 -3
  111. package/dist/Image/Image.esm.js +2 -3
  112. package/dist/Image/styles.css +1 -0
  113. package/dist/ImpactCard/ImpactCard.cjs.js +17 -18
  114. package/dist/ImpactCard/ImpactCard.esm.js +11 -12
  115. package/dist/ImpactCard/styles.css +1 -0
  116. package/dist/InformationCard/InformationCard.cjs.js +37 -51
  117. package/dist/InformationCard/InformationCard.esm.js +34 -48
  118. package/dist/InformationCard/styles.css +1 -0
  119. package/dist/Link/Link.cjs.js +15 -16
  120. package/dist/Link/Link.esm.js +8 -9
  121. package/dist/Link/styles.css +1 -0
  122. package/dist/Markup/Markup.cjs.js +6 -6
  123. package/dist/Markup/Markup.esm.js +2 -2
  124. package/dist/Markup/styles.css +1 -0
  125. package/dist/MediaCard/MediaCard.cjs.js +15 -15
  126. package/dist/MediaCard/MediaCard.esm.js +15 -15
  127. package/dist/MediaCard/styles.css +1 -0
  128. package/dist/Modal/Modal.cjs.js +44 -1201
  129. package/dist/Modal/Modal.esm.js +13 -1169
  130. package/dist/Modal/styles.css +1 -0
  131. package/dist/Pagination/Pagination.cjs.js +12 -13
  132. package/dist/Pagination/Pagination.esm.js +3 -4
  133. package/dist/Pagination/styles.css +1 -0
  134. package/dist/PaginationSimple/PaginationSimple.cjs.js +85 -17
  135. package/dist/PaginationSimple/PaginationSimple.esm.js +82 -14
  136. package/dist/PaginationSimple/styles.css +1 -0
  137. package/dist/Poster/Poster.cjs.js +4 -5
  138. package/dist/Poster/Poster.esm.js +4 -5
  139. package/dist/Poster/styles.css +1 -0
  140. package/dist/ProgressBar/ProgressBar.cjs.js +12 -13
  141. package/dist/ProgressBar/ProgressBar.esm.js +6 -7
  142. package/dist/ProgressBar/styles.css +1 -0
  143. package/dist/ProgressStepper/ProgressStepper.cjs.js +5 -6
  144. package/dist/ProgressStepper/ProgressStepper.esm.js +5 -6
  145. package/dist/ProgressStepper/styles.css +1 -0
  146. package/dist/RadioGroup/RadioGroup.cjs.js +8 -9
  147. package/dist/RadioGroup/RadioGroup.esm.js +8 -9
  148. package/dist/RadioGroup/styles.css +1 -0
  149. package/dist/Rule/Rule.cjs.js +5 -5
  150. package/dist/Rule/Rule.esm.js +2 -2
  151. package/dist/Rule/styles.css +1 -0
  152. package/dist/ScrollToTop/ScrollToTop.cjs.js +26 -10
  153. package/dist/ScrollToTop/ScrollToTop.esm.js +21 -5
  154. package/dist/ScrollToTop/styles.css +1 -0
  155. package/dist/Section/Section.cjs.js +2 -2
  156. package/dist/Section/Section.esm.js +2 -2
  157. package/dist/Section/styles.css +1 -0
  158. package/dist/Select/Select.cjs.js +31 -1132
  159. package/dist/Select/Select.esm.js +18 -1119
  160. package/dist/Select/styles.css +1 -0
  161. package/dist/SiteFooter/SiteFooter.cjs.js +7 -8
  162. package/dist/SiteFooter/SiteFooter.esm.js +7 -8
  163. package/dist/SiteFooter/styles.css +1 -0
  164. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +12 -13
  165. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +12 -13
  166. package/dist/SiteHeaderV2/styles.css +1 -0
  167. package/dist/SkipLink/SkipLink.cjs.js +4 -4
  168. package/dist/SkipLink/SkipLink.esm.js +3 -3
  169. package/dist/SkipLink/styles.css +1 -0
  170. package/dist/Spinner/Spinner.cjs.js +12 -0
  171. package/dist/Spinner/Spinner.esm.js +4 -0
  172. package/dist/Spinner/package.json +7 -0
  173. package/dist/Spinner/styles.css +1 -0
  174. package/dist/Surface/Surface.cjs.js +2 -2
  175. package/dist/Surface/Surface.esm.js +2 -2
  176. package/dist/Surface/styles.css +1 -0
  177. package/dist/Switch/Switch.cjs.js +16 -18
  178. package/dist/Switch/Switch.esm.js +12 -14
  179. package/dist/Switch/styles.css +1 -0
  180. package/dist/Tabs/Tabs.cjs.js +9 -11
  181. package/dist/Tabs/Tabs.esm.js +9 -11
  182. package/dist/Tabs/styles.css +1 -0
  183. package/dist/Tag/Tag.cjs.js +77 -9
  184. package/dist/Tag/Tag.esm.js +76 -8
  185. package/dist/Tag/styles.css +1 -0
  186. package/dist/Text/Text.cjs.js +3 -4
  187. package/dist/Text/Text.esm.js +3 -4
  188. package/dist/Text/styles.css +1 -0
  189. package/dist/TextArea/TextArea.cjs.js +64 -59
  190. package/dist/TextArea/TextArea.esm.js +60 -55
  191. package/dist/TextArea/styles.css +1 -0
  192. package/dist/TextInput/TextInput.cjs.js +8 -10
  193. package/dist/TextInput/TextInput.esm.js +8 -10
  194. package/dist/TextInput/styles.css +1 -0
  195. package/dist/Theme/Theme.cjs.js +7 -6
  196. package/dist/Theme/Theme.esm.js +5 -4
  197. package/dist/Theme/styles.css +1 -0
  198. package/dist/ThemeIcon/ThemeIcon.cjs.js +3 -4
  199. package/dist/ThemeIcon/ThemeIcon.esm.js +3 -4
  200. package/dist/ThemeIcon/styles.css +1 -0
  201. package/dist/Toast/Toast.cjs.js +8 -10
  202. package/dist/Toast/Toast.esm.js +8 -10
  203. package/dist/Toast/styles.css +1 -0
  204. package/dist/Truncate/Truncate.cjs.js +3 -3
  205. package/dist/Truncate/Truncate.esm.js +3 -3
  206. package/dist/Truncate/styles.css +1 -0
  207. package/dist/TypographyCard/TypographyCard.cjs.js +15 -16
  208. package/dist/TypographyCard/TypographyCard.esm.js +10 -11
  209. package/dist/TypographyCard/styles.css +1 -0
  210. package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
  211. package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
  212. package/dist/UniversalHeader/styles.css +1 -0
  213. package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
  214. package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
  215. package/dist/VerticalSpace/styles.css +1 -0
  216. package/dist/VideoPlayer/VideoPlayer.cjs.js +38 -26
  217. package/dist/VideoPlayer/VideoPlayer.esm.js +37 -25
  218. package/dist/VideoPlayer/styles.css +1 -0
  219. package/dist/Visible/Visible.cjs.js +5 -5
  220. package/dist/Visible/Visible.esm.js +1 -1
  221. package/dist/Visible/styles.css +1 -0
  222. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +2 -1
  223. package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -1
  224. package/dist/VisuallyHidden/styles.css +1 -0
  225. package/dist/_shared/cjs/{Avatar-fc0d9b8b.js → Avatar-7478d063.js} +11 -12
  226. package/dist/_shared/cjs/Badge-ca986033.js +17 -0
  227. package/dist/_shared/cjs/Box-e225b4a4.js +29 -0
  228. package/dist/_shared/cjs/{BrandLogo-1d2ca2c7.js → BrandLogo-bf632f2b.js} +7 -8
  229. package/dist/_shared/cjs/{Breadcrumbs-7af0af2c.js → Breadcrumbs-bb292a9e.js} +15 -14
  230. package/dist/_shared/cjs/BtIconArrowRight.esm-c78e3c11.js +30 -0
  231. package/dist/_shared/cjs/BtIconChevronRight2Px.esm-e8329e34.js +44 -0
  232. package/dist/_shared/cjs/BtIconChevronRightMid.esm-745faaca.js +28 -0
  233. package/dist/_shared/cjs/BtIconPlayFill.esm-7e848bd9.js +30 -0
  234. package/dist/_shared/cjs/{Button-7d891a89.js → Button-76215474.js} +12 -13
  235. package/dist/_shared/cjs/{ButtonV2-b2db3f46.js → ButtonV2-320f74b2.js} +21 -16
  236. package/dist/_shared/cjs/{Calendar-649cc139.js → Calendar-16ed5bec.js} +915 -915
  237. package/dist/_shared/cjs/CardFooter-6aa9a280.js +79 -0
  238. package/dist/_shared/cjs/CardHeading-30ef8abc.js +16 -0
  239. package/dist/_shared/cjs/{Checkbox-0e423653.js → Checkbox-4dbaac21.js} +17 -12
  240. package/dist/_shared/cjs/{Columns-1224bdff.js → Columns-ff4977f8.js} +9 -10
  241. package/dist/_shared/cjs/Combination-d19b4dc6.js +1203 -0
  242. package/dist/_shared/cjs/ContentSwitcher-1b789e2f.js +98 -0
  243. package/dist/_shared/cjs/ContentSwitcherDropdown-0de9f7e4.js +47 -0
  244. package/dist/_shared/cjs/DatePicker-a0f14025.js +939 -0
  245. package/dist/_shared/cjs/{DisclosureMini-c01ecce0.js → DisclosureMini-09ee2d12.js} +10 -10
  246. package/dist/_shared/cjs/Download-08d71049.js +43 -0
  247. package/dist/_shared/cjs/{Filter-3b897d92.js → Filter-60b0dd96.js} +14 -14
  248. package/dist/_shared/cjs/{FormControl-88d48f42.js → FormControl-fa7bb586.js} +12 -12
  249. package/dist/_shared/cjs/{Grid-9e91fb3d.js → Grid-a50fb206.js} +10 -11
  250. package/dist/_shared/cjs/{Group-3d5ea240.js → Group-1aba9855.js} +9 -9
  251. package/dist/_shared/cjs/{Heading-fb63844f.js → Heading-cb321adf.js} +9 -9
  252. package/dist/_shared/cjs/{HeroButton-0586a7c4.js → HeroButton-75e1ab78.js} +20 -20
  253. package/dist/_shared/cjs/Icon-859c6c00.js +47 -0
  254. package/dist/_shared/cjs/{Image-e9a5a326.js → Image-b807e951.js} +9 -10
  255. package/dist/_shared/cjs/{MediaCard-8f41b411.js → MediaCard-8101ae8b.js} +18 -18
  256. package/dist/_shared/cjs/{Poster-b7242b37.js → Poster-46b6803e.js} +13 -14
  257. package/dist/_shared/cjs/{ProgressStepper-fb8405c2.js → ProgressStepper-5fb2e7ac.js} +18 -42
  258. package/dist/_shared/cjs/{RadioGroup-a4186267.js → RadioGroup-f8963bd2.js} +14 -14
  259. package/dist/_shared/cjs/{Section-ecfc659b.js → Section-bee4a090.js} +5 -5
  260. package/dist/_shared/cjs/{SiteFooter-7c4072b5.js → SiteFooter-3fee99ae.js} +11 -11
  261. package/dist/_shared/cjs/{SiteHeaderV2-94687999.js → SiteHeaderV2-0f072158.js} +71 -106
  262. package/dist/_shared/cjs/Spinner-2a1d9f20.js +24 -0
  263. package/dist/_shared/cjs/{index-df60851b.js → Surface-4bc47dcb.js} +53 -65
  264. package/dist/_shared/cjs/Tabs-ba44ea49.js +90 -0
  265. package/dist/_shared/cjs/{Text-1c1110a4.js → Text-f6be8fdd.js} +8 -8
  266. package/dist/_shared/cjs/{TextInput-762e2309.js → TextInput-9d9a53ac.js} +13 -13
  267. package/dist/_shared/cjs/{ThemeIcon-ee814862.js → ThemeIcon-6b10d20a.js} +8 -9
  268. package/dist/_shared/cjs/{Toast-d06a89e0.js → Toast-a33b5a2e.js} +16 -17
  269. package/dist/_shared/cjs/{UniversalHeader-f6d9c63a.js → UniversalHeader-114ac8f5.js} +6 -6
  270. package/dist/_shared/cjs/{VerticalSpace-e128ec68.js → VerticalSpace-3908ae62.js} +5 -5
  271. package/dist/_shared/cjs/{VisuallyHidden-b0de4c7b.js → VisuallyHidden-821078c9.js} +3 -2
  272. package/dist/_shared/cjs/{component-df82bc05.js → component-ae4b7058.js} +4 -4
  273. package/dist/_shared/cjs/{Combination-3a639f6d.js → floating-ui.react-dom-08b8b87c.js} +37 -1103
  274. package/dist/_shared/cjs/{Tabs-75c34f43.js → index-1e7a1fce.js} +11 -96
  275. package/dist/_shared/cjs/{index-3d629205.js → index-2bf59363.js} +19 -1
  276. package/dist/_shared/cjs/{index-996dec94.js → index-527f962b.js} +1 -1
  277. package/dist/_shared/cjs/index-6b0bf2cc.js +2204 -0
  278. package/dist/_shared/cjs/{index-7aa7f96a.js → index-879e71ee.js} +8 -1
  279. package/dist/_shared/cjs/{index-41b09e85.js → index-ba3141f5.js} +20 -1
  280. package/dist/_shared/cjs/{index-0c6319ec.js → index-dbc843d3.js} +1 -1
  281. package/dist/_shared/cjs/{index.es-16759329.js → index.es-11fc5df7.js} +2 -2
  282. package/dist/_shared/cjs/index.es-b404d2c5.js +324 -0
  283. package/dist/_shared/esm/{Avatar-38cc0595.js → Avatar-b2fde5c6.js} +5 -6
  284. package/dist/_shared/esm/Badge-a6bda4a7.js +11 -0
  285. package/dist/_shared/esm/Box-2a1645ed.js +23 -0
  286. package/dist/_shared/esm/{BrandLogo-7ed8aeda.js → BrandLogo-3424eb79.js} +2 -3
  287. package/dist/_shared/esm/{Breadcrumbs-9078b68e.js → Breadcrumbs-7de7bfa5.js} +11 -10
  288. package/dist/_shared/esm/BtIconArrowRight.esm-8bcaa8ad.js +24 -0
  289. package/dist/_shared/esm/BtIconChevronRight2Px.esm-84262845.js +37 -0
  290. package/dist/_shared/esm/BtIconChevronRightMid.esm-f67f0ca3.js +22 -0
  291. package/dist/_shared/esm/BtIconPlayFill.esm-ec2797a0.js +24 -0
  292. package/dist/_shared/esm/{Button-dde2b46a.js → Button-9cab8eec.js} +4 -5
  293. package/dist/_shared/esm/{ButtonV2-49cd0615.js → ButtonV2-4dc8830e.js} +13 -8
  294. package/dist/_shared/esm/{Calendar-60591442.js → Calendar-e3f8c4f0.js} +893 -893
  295. package/dist/_shared/esm/CardFooter-2902bd84.js +73 -0
  296. package/dist/_shared/esm/CardHeading-6d3dbfad.js +10 -0
  297. package/dist/_shared/esm/{Checkbox-0baca464.js → Checkbox-f40de2e9.js} +12 -7
  298. package/dist/_shared/esm/{Columns-6a8f6fbb.js → Columns-5e02e601.js} +1 -2
  299. package/dist/_shared/esm/Combination-a063f96d.js +1163 -0
  300. package/dist/_shared/esm/ContentSwitcher-e0bd73a7.js +92 -0
  301. package/dist/_shared/esm/ContentSwitcherDropdown-306b4660.js +41 -0
  302. package/dist/_shared/esm/DatePicker-3f82e2c4.js +910 -0
  303. package/dist/_shared/esm/{DisclosureMini-38f4c459.js → DisclosureMini-60cb2a6c.js} +4 -4
  304. package/dist/_shared/esm/Download-a5443778.js +37 -0
  305. package/dist/_shared/esm/{Filter-49dcf5ce.js → Filter-bc821cbc.js} +11 -11
  306. package/dist/_shared/esm/{FormControl-d873f7fa.js → FormControl-7ff0a178.js} +5 -5
  307. package/dist/_shared/esm/{Grid-fb9fc522.js → Grid-75251350.js} +1 -2
  308. package/dist/_shared/esm/{Group-66196f07.js → Group-b4e10621.js} +2 -2
  309. package/dist/_shared/esm/{Heading-906c7c7c.js → Heading-14df0c64.js} +5 -5
  310. package/dist/_shared/esm/{HeroButton-7ea692bf.js → HeroButton-1221bd94.js} +12 -12
  311. package/dist/_shared/esm/{Icon-512f834f.js → Icon-3e813b34.js} +16 -6
  312. package/dist/_shared/esm/{Image-57d08939.js → Image-85c39506.js} +1 -2
  313. package/dist/_shared/esm/{MediaCard-c12d89ea.js → MediaCard-387c8f11.js} +10 -10
  314. package/dist/_shared/esm/{Poster-e05a8b45.js → Poster-adcd3ba3.js} +4 -5
  315. package/dist/_shared/esm/{ProgressStepper-189ed0f9.js → ProgressStepper-72b070a8.js} +9 -33
  316. package/dist/_shared/esm/{RadioGroup-8ff17cbb.js → RadioGroup-6e657cee.js} +7 -7
  317. package/dist/_shared/esm/{Section-1acbc06a.js → Section-b9caea45.js} +1 -1
  318. package/dist/_shared/esm/{SiteFooter-b65497e8.js → SiteFooter-61b4ae63.js} +6 -6
  319. package/dist/_shared/esm/{SiteHeaderV2-784b3bf8.js → SiteHeaderV2-1fde7d20.js} +10 -45
  320. package/dist/_shared/esm/Spinner-9d28043d.js +18 -0
  321. package/dist/_shared/esm/{index-288c66b5.js → Surface-56d329b0.js} +48 -65
  322. package/dist/_shared/esm/Tabs-276a0836.js +84 -0
  323. package/dist/_shared/esm/{Text-a46fb76b.js → Text-98ad2e78.js} +5 -5
  324. package/dist/_shared/esm/{TextInput-94c7b1a4.js → TextInput-eccd0140.js} +6 -6
  325. package/dist/_shared/esm/{ThemeIcon-c2dc41a6.js → ThemeIcon-810de4bc.js} +2 -3
  326. package/dist/_shared/esm/{Toast-de6ca2f3.js → Toast-62932e3b.js} +6 -7
  327. package/dist/_shared/esm/{UniversalHeader-456ad60c.js → UniversalHeader-370d7fa4.js} +3 -3
  328. package/dist/_shared/esm/{VerticalSpace-b07cd8e6.js → VerticalSpace-549fbdc8.js} +1 -1
  329. package/dist/_shared/esm/VisuallyHidden-fee374a8.js +12 -0
  330. package/dist/_shared/esm/{component-d0a555cf.js → component-94b3dbfe.js} +1 -1
  331. package/dist/_shared/esm/{Combination-ae3a3f08.js → floating-ui.react-dom-1bb71aae.js} +15 -1079
  332. package/dist/_shared/esm/{index-f97466e9.js → index-14c7f4da.js} +1 -1
  333. package/dist/_shared/esm/index-24509173.js +2169 -0
  334. package/dist/_shared/esm/{index-cace3545.js → index-57d4cb34.js} +33 -33
  335. package/dist/_shared/esm/{Tabs-21ac7dfe.js → index-89a7c31c.js} +6 -90
  336. package/dist/_shared/esm/{index-4e58de24.js → index-ac50b180.js} +21 -3
  337. package/dist/_shared/esm/{index-7740883c.js → index-b9923ee4.js} +9 -2
  338. package/dist/_shared/esm/{index-605031ca.js → index-ce6dee84.js} +53 -53
  339. package/dist/_shared/esm/index-e969452b.js +41 -0
  340. package/dist/_shared/esm/{index-fa93ec97.js → index-f2ddcbe2.js} +1 -1
  341. package/dist/_shared/esm/index.es-4921e8dd.js +318 -0
  342. package/dist/_shared/esm/{index.es-1b6d33c2.js → index.es-52a3bcff.js} +2 -2
  343. package/dist/index.es.js +14634 -13762
  344. package/dist/index.es.js.map +1 -1
  345. package/dist/index.js +14637 -13761
  346. package/dist/index.js.map +1 -1
  347. package/dist/styles.css +9 -7
  348. package/dist/types/components/Avatar/index.d.ts +1 -1
  349. package/dist/types/components/Box/Box.d.ts +4 -0
  350. package/dist/types/components/ButtonV2/ButtonV2.d.ts +2 -2
  351. package/dist/types/components/CardHeading/index.d.ts +1 -0
  352. package/dist/types/components/Carousel/Carousel.d.ts +34 -0
  353. package/dist/types/components/Carousel/components/DotButton.d.ts +10 -0
  354. package/dist/types/components/Carousel/constants/breakpoints.d.ts +5 -0
  355. package/dist/types/components/Carousel/helpers/get-options.d.ts +3 -0
  356. package/dist/types/components/Carousel/helpers/get-slide-width.d.ts +12 -0
  357. package/dist/types/components/Carousel/index.d.ts +1 -0
  358. package/dist/types/components/Carousel/types/breakpoints.d.ts +1 -0
  359. package/dist/types/components/Carousel/types/keynames.d.ts +5 -0
  360. package/dist/types/components/Carousel/types/responsive.d.ts +3 -0
  361. package/dist/types/components/Carousel/types/screen-sizes.d.ts +2 -0
  362. package/dist/types/components/Carousel/types/slide-config.d.ts +5 -0
  363. package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
  364. package/dist/types/components/ContentSwitcher/ContentSwitcher.d.ts +28 -0
  365. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/ContentSwitcherContent.d.ts +12 -0
  366. package/dist/types/components/ContentSwitcher/ContentSwitcherContent/index.d.ts +1 -0
  367. package/dist/types/components/ContentSwitcher/ContentSwitcherList/ContentSwitcherList.d.ts +24 -0
  368. package/dist/types/components/ContentSwitcher/ContentSwitcherList/index.d.ts +1 -0
  369. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/ContentSwitcherTab.d.ts +17 -0
  370. package/dist/types/components/ContentSwitcher/ContentSwitcherTab/index.d.ts +1 -0
  371. package/dist/types/components/ContentSwitcher/index.d.ts +1 -0
  372. package/dist/types/components/ContentSwitcherDropdown/ContentSwitcherDropdown.d.ts +37 -0
  373. package/dist/types/components/ContentSwitcherDropdown/index.d.ts +1 -0
  374. package/dist/types/components/Disclosure/index.d.ts +1 -1
  375. package/dist/types/components/Download/Download.d.ts +41 -0
  376. package/dist/types/components/Download/index.d.ts +1 -0
  377. package/dist/types/components/Heading/Heading.d.ts +4 -0
  378. package/dist/types/components/Heading/index.d.ts +1 -1
  379. package/dist/types/components/HeroBanner/HeroBanner.d.ts +52 -0
  380. package/dist/types/components/HeroBanner/index.d.ts +1 -0
  381. package/dist/types/components/Icon/Icon.d.ts +2 -2
  382. package/dist/types/components/ImpactCard/ImpactCard.d.ts +2 -2
  383. package/dist/types/components/ImpactCard/index.d.ts +1 -1
  384. package/dist/types/components/InformationCard/InformationCard.d.ts +2 -2
  385. package/dist/types/components/InformationCard/index.d.ts +1 -1
  386. package/dist/types/components/MediaCard/MediaCard.d.ts +1 -1
  387. package/dist/types/components/MediaCard/index.d.ts +1 -1
  388. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +24 -16
  389. package/dist/types/components/Spinner/Spinner.d.ts +16 -0
  390. package/dist/types/components/Spinner/index.d.ts +1 -0
  391. package/dist/types/components/Surface/Surface.d.ts +4 -0
  392. package/dist/types/components/Switch/Switch.d.ts +4 -0
  393. package/dist/types/components/Tabs/TabsList/TabsList.d.ts +5 -0
  394. package/dist/types/components/Text/Text.d.ts +4 -0
  395. package/dist/types/components/TextInput/TextInput.d.ts +2 -2
  396. package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -1
  397. package/dist/types/components/Truncate/Truncate.d.ts +1 -1
  398. package/dist/types/components/TypographyCard/TypographyCard.d.ts +2 -2
  399. package/dist/types/components/TypographyCard/index.d.ts +1 -1
  400. package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +9 -0
  401. package/dist/types/components/index.d.ts +4 -0
  402. package/dist/types/helpers/index.d.ts +0 -2
  403. package/dist/types/styles.d.ts +9 -4
  404. package/package.json +24 -16
  405. package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +0 -28
  406. package/dist/_shared/cjs/BtIconArrowRight.esm-5989f2ca.js +0 -38
  407. package/dist/_shared/cjs/BtIconChevronRightMid.esm-3e8d18a9.js +0 -28
  408. package/dist/_shared/cjs/BtIconPlayFill.esm-b8997cfc.js +0 -30
  409. package/dist/_shared/cjs/CardFooter-5414bc4f.js +0 -79
  410. package/dist/_shared/cjs/DatePicker-2417e55b.js +0 -550
  411. package/dist/_shared/cjs/Icon-0ec0c1fb.js +0 -37
  412. package/dist/_shared/cjs/Surface-8599dbe4.js +0 -57
  413. package/dist/_shared/cjs/Tag-452048f6.js +0 -44
  414. package/dist/_shared/cjs/index-039a9d35.js +0 -23
  415. package/dist/_shared/cjs/index-28447df0.js +0 -23
  416. package/dist/_shared/cjs/index-dcfdd5da.js +0 -11
  417. package/dist/_shared/cjs/suffix-modifier-c8a34402.js +0 -19
  418. package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +0 -22
  419. package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +0 -31
  420. package/dist/_shared/esm/BtIconChevronRightMid.esm-4764708f.js +0 -22
  421. package/dist/_shared/esm/BtIconPlayFill.esm-05fc0344.js +0 -24
  422. package/dist/_shared/esm/CardFooter-c79fb2db.js +0 -73
  423. package/dist/_shared/esm/DatePicker-c7bb178e.js +0 -539
  424. package/dist/_shared/esm/Surface-71d21a9e.js +0 -48
  425. package/dist/_shared/esm/Tag-2513c185.js +0 -38
  426. package/dist/_shared/esm/VisuallyHidden-06692fd3.js +0 -11
  427. package/dist/_shared/esm/index-5113ed53.js +0 -24
  428. package/dist/_shared/esm/index-6028d797.js +0 -21
  429. package/dist/_shared/esm/index-69089474.js +0 -21
  430. package/dist/_shared/esm/index-a624de47.js +0 -9
  431. package/dist/_shared/esm/suffix-modifier-1ce05abe.js +0 -17
  432. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +0 -2
  433. package/dist/types/helpers/filter-data-attrs.d.ts +0 -1
  434. package/dist/types/helpers/suffix-modifier.d.ts +0 -9
  435. package/dist/types/private-components/CardHeading/index.d.ts +0 -1
  436. package/dist/types/private-components/index.d.ts +0 -3
  437. package/dist/_shared/cjs/{ConditionalWrapper-be3b2625.js → ConditionalWrapper-bf944594.js} +0 -0
  438. package/dist/_shared/cjs/{index-7e31a45b.js → index-28fbfd5b.js} +52 -52
  439. package/dist/_shared/cjs/{index-3dd54df1.js → index-76f7dd53.js} +31 -31
  440. /package/dist/_shared/esm/{ConditionalWrapper-59be8f35.js → ConditionalWrapper-b85979de.js} +0 -0
  441. /package/dist/types/{private-components → components}/CardFooter/CardFooter.d.ts +0 -0
  442. /package/dist/types/{private-components → components}/CardFooter/index.d.ts +0 -0
  443. /package/dist/types/{private-components → components}/CardHeading/CardHeading.d.ts +0 -0
  444. /package/dist/types/{private-components → components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
  445. /package/dist/types/{private-components → components}/ConditionalWrapper/index.d.ts +0 -0
@@ -0,0 +1,1913 @@
1
+ import React__default, { useRef, useState, useCallback, useEffect, useId } from 'react';
2
+ import { c as classNames } from '../_shared/esm/index-2e73c2e9.js';
3
+ import { u as useMediaQuery } from '../_shared/esm/use-media-query-d3622da8.js';
4
+ import { T as ThemeIcon } from '../_shared/esm/ThemeIcon-810de4bc.js';
5
+ import { a as __assign } from '../_shared/esm/index.es-4921e8dd.js';
6
+ import '../_shared/esm/Surface-56d329b0.js';
7
+
8
+ function isObject$1(subject) {
9
+ return Object.prototype.toString.call(subject) === '[object Object]';
10
+ }
11
+ function isRecord(subject) {
12
+ return isObject$1(subject) || Array.isArray(subject);
13
+ }
14
+ function canUseDOM() {
15
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
16
+ }
17
+ function areOptionsEqual(optionsA, optionsB) {
18
+ const optionsAKeys = Object.keys(optionsA);
19
+ const optionsBKeys = Object.keys(optionsB);
20
+ if (optionsAKeys.length !== optionsBKeys.length) return false;
21
+ const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
22
+ const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
23
+ if (breakpointsA !== breakpointsB) return false;
24
+ return optionsAKeys.every(key => {
25
+ const valueA = optionsA[key];
26
+ const valueB = optionsB[key];
27
+ if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
28
+ if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
29
+ return areOptionsEqual(valueA, valueB);
30
+ });
31
+ }
32
+ function sortAndMapPluginToOptions(plugins) {
33
+ return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
34
+ }
35
+ function arePluginsEqual(pluginsA, pluginsB) {
36
+ if (pluginsA.length !== pluginsB.length) return false;
37
+ const optionsA = sortAndMapPluginToOptions(pluginsA);
38
+ const optionsB = sortAndMapPluginToOptions(pluginsB);
39
+ return optionsA.every((optionA, index) => {
40
+ const optionB = optionsB[index];
41
+ return areOptionsEqual(optionA, optionB);
42
+ });
43
+ }
44
+
45
+ function isNumber(subject) {
46
+ return typeof subject === 'number';
47
+ }
48
+ function isString(subject) {
49
+ return typeof subject === 'string';
50
+ }
51
+ function isBoolean(subject) {
52
+ return typeof subject === 'boolean';
53
+ }
54
+ function isObject(subject) {
55
+ return Object.prototype.toString.call(subject) === '[object Object]';
56
+ }
57
+ function mathAbs(n) {
58
+ return Math.abs(n);
59
+ }
60
+ function mathSign(n) {
61
+ return Math.sign(n);
62
+ }
63
+ function deltaAbs(valueB, valueA) {
64
+ return mathAbs(valueB - valueA);
65
+ }
66
+ function factorAbs(valueB, valueA) {
67
+ if (valueB === 0 || valueA === 0) return 0;
68
+ if (mathAbs(valueB) <= mathAbs(valueA)) return 0;
69
+ const diff = deltaAbs(mathAbs(valueB), mathAbs(valueA));
70
+ return mathAbs(diff / valueB);
71
+ }
72
+ function arrayKeys(array) {
73
+ return objectKeys(array).map(Number);
74
+ }
75
+ function arrayLast(array) {
76
+ return array[arrayLastIndex(array)];
77
+ }
78
+ function arrayLastIndex(array) {
79
+ return Math.max(0, array.length - 1);
80
+ }
81
+ function arrayIsLastIndex(array, index) {
82
+ return index === arrayLastIndex(array);
83
+ }
84
+ function arrayFromNumber(n, startAt = 0) {
85
+ return Array.from(Array(n), (_, i) => startAt + i);
86
+ }
87
+ function objectKeys(object) {
88
+ return Object.keys(object);
89
+ }
90
+ function objectsMergeDeep(objectA, objectB) {
91
+ return [objectA, objectB].reduce((mergedObjects, currentObject) => {
92
+ objectKeys(currentObject).forEach(key => {
93
+ const valueA = mergedObjects[key];
94
+ const valueB = currentObject[key];
95
+ const areObjects = isObject(valueA) && isObject(valueB);
96
+ mergedObjects[key] = areObjects ? objectsMergeDeep(valueA, valueB) : valueB;
97
+ });
98
+ return mergedObjects;
99
+ }, {});
100
+ }
101
+ function isMouseEvent(evt, ownerWindow) {
102
+ return typeof ownerWindow.MouseEvent !== 'undefined' && evt instanceof ownerWindow.MouseEvent;
103
+ }
104
+
105
+ function Alignment(align, viewSize) {
106
+ const predefined = {
107
+ start,
108
+ center,
109
+ end
110
+ };
111
+ function start() {
112
+ return 0;
113
+ }
114
+ function center(n) {
115
+ return end(n) / 2;
116
+ }
117
+ function end(n) {
118
+ return viewSize - n;
119
+ }
120
+ function measure(n, index) {
121
+ if (isString(align)) return predefined[align](n);
122
+ return align(viewSize, n, index);
123
+ }
124
+ const self = {
125
+ measure
126
+ };
127
+ return self;
128
+ }
129
+
130
+ function EventStore() {
131
+ let listeners = [];
132
+ function add(node, type, handler, options = {
133
+ passive: true
134
+ }) {
135
+ let removeListener;
136
+ if ('addEventListener' in node) {
137
+ node.addEventListener(type, handler, options);
138
+ removeListener = () => node.removeEventListener(type, handler, options);
139
+ } else {
140
+ const legacyMediaQueryList = node;
141
+ legacyMediaQueryList.addListener(handler);
142
+ removeListener = () => legacyMediaQueryList.removeListener(handler);
143
+ }
144
+ listeners.push(removeListener);
145
+ return self;
146
+ }
147
+ function clear() {
148
+ listeners = listeners.filter(remove => remove());
149
+ }
150
+ const self = {
151
+ add,
152
+ clear
153
+ };
154
+ return self;
155
+ }
156
+
157
+ function Animations(ownerDocument, ownerWindow, update, render) {
158
+ const documentVisibleHandler = EventStore();
159
+ const timeStep = 1000 / 60;
160
+ let lastTimeStamp = null;
161
+ let lag = 0;
162
+ let animationFrame = 0;
163
+ function init() {
164
+ documentVisibleHandler.add(ownerDocument, 'visibilitychange', () => {
165
+ if (ownerDocument.hidden) reset();
166
+ });
167
+ }
168
+ function destroy() {
169
+ stop();
170
+ documentVisibleHandler.clear();
171
+ }
172
+ function animate(timeStamp) {
173
+ if (!animationFrame) return;
174
+ if (!lastTimeStamp) lastTimeStamp = timeStamp;
175
+ const elapsed = timeStamp - lastTimeStamp;
176
+ lastTimeStamp = timeStamp;
177
+ lag += elapsed;
178
+ while (lag >= timeStep) {
179
+ update(timeStep);
180
+ lag -= timeStep;
181
+ }
182
+ const lagOffset = lag / timeStep;
183
+ render(lagOffset);
184
+ if (animationFrame) ownerWindow.requestAnimationFrame(animate);
185
+ }
186
+ function start() {
187
+ if (animationFrame) return;
188
+ animationFrame = ownerWindow.requestAnimationFrame(animate);
189
+ }
190
+ function stop() {
191
+ ownerWindow.cancelAnimationFrame(animationFrame);
192
+ lastTimeStamp = null;
193
+ lag = 0;
194
+ animationFrame = 0;
195
+ }
196
+ function reset() {
197
+ lastTimeStamp = null;
198
+ lag = 0;
199
+ }
200
+ const self = {
201
+ init,
202
+ destroy,
203
+ start,
204
+ stop,
205
+ update: () => update(timeStep),
206
+ render
207
+ };
208
+ return self;
209
+ }
210
+
211
+ function Axis(axis, contentDirection) {
212
+ const isRightToLeft = contentDirection === 'rtl';
213
+ const isVertical = axis === 'y';
214
+ const scroll = isVertical ? 'y' : 'x';
215
+ const cross = isVertical ? 'x' : 'y';
216
+ const sign = !isVertical && isRightToLeft ? -1 : 1;
217
+ const startEdge = getStartEdge();
218
+ const endEdge = getEndEdge();
219
+ function measureSize(nodeRect) {
220
+ const {
221
+ height,
222
+ width
223
+ } = nodeRect;
224
+ return isVertical ? height : width;
225
+ }
226
+ function getStartEdge() {
227
+ if (isVertical) return 'top';
228
+ return isRightToLeft ? 'right' : 'left';
229
+ }
230
+ function getEndEdge() {
231
+ if (isVertical) return 'bottom';
232
+ return isRightToLeft ? 'left' : 'right';
233
+ }
234
+ function direction(n) {
235
+ return n * sign;
236
+ }
237
+ const self = {
238
+ scroll,
239
+ cross,
240
+ startEdge,
241
+ endEdge,
242
+ measureSize,
243
+ direction
244
+ };
245
+ return self;
246
+ }
247
+
248
+ function Limit(min = 0, max = 0) {
249
+ const length = mathAbs(min - max);
250
+ function reachedMin(n) {
251
+ return n < min;
252
+ }
253
+ function reachedMax(n) {
254
+ return n > max;
255
+ }
256
+ function reachedAny(n) {
257
+ return reachedMin(n) || reachedMax(n);
258
+ }
259
+ function constrain(n) {
260
+ if (!reachedAny(n)) return n;
261
+ return reachedMin(n) ? min : max;
262
+ }
263
+ function removeOffset(n) {
264
+ if (!length) return n;
265
+ return n - length * Math.ceil((n - max) / length);
266
+ }
267
+ const self = {
268
+ length,
269
+ max,
270
+ min,
271
+ constrain,
272
+ reachedAny,
273
+ reachedMax,
274
+ reachedMin,
275
+ removeOffset
276
+ };
277
+ return self;
278
+ }
279
+
280
+ function Counter(max, start, loop) {
281
+ const {
282
+ constrain
283
+ } = Limit(0, max);
284
+ const loopEnd = max + 1;
285
+ let counter = withinLimit(start);
286
+ function withinLimit(n) {
287
+ return !loop ? constrain(n) : mathAbs((loopEnd + n) % loopEnd);
288
+ }
289
+ function get() {
290
+ return counter;
291
+ }
292
+ function set(n) {
293
+ counter = withinLimit(n);
294
+ return self;
295
+ }
296
+ function add(n) {
297
+ return clone().set(get() + n);
298
+ }
299
+ function clone() {
300
+ return Counter(max, get(), loop);
301
+ }
302
+ const self = {
303
+ get,
304
+ set,
305
+ add,
306
+ clone
307
+ };
308
+ return self;
309
+ }
310
+
311
+ function DragHandler(axis, rootNode, ownerDocument, ownerWindow, target, dragTracker, location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, baseFriction, watchDrag) {
312
+ const {
313
+ cross: crossAxis,
314
+ direction
315
+ } = axis;
316
+ const focusNodes = ['INPUT', 'SELECT', 'TEXTAREA'];
317
+ const nonPassiveEvent = {
318
+ passive: false
319
+ };
320
+ const initEvents = EventStore();
321
+ const dragEvents = EventStore();
322
+ const goToNextThreshold = Limit(50, 225).constrain(percentOfView.measure(20));
323
+ const snapForceBoost = {
324
+ mouse: 300,
325
+ touch: 400
326
+ };
327
+ const freeForceBoost = {
328
+ mouse: 500,
329
+ touch: 600
330
+ };
331
+ const baseSpeed = dragFree ? 43 : 25;
332
+ let isMoving = false;
333
+ let startScroll = 0;
334
+ let startCross = 0;
335
+ let pointerIsDown = false;
336
+ let preventScroll = false;
337
+ let preventClick = false;
338
+ let isMouse = false;
339
+ function init(emblaApi) {
340
+ if (!watchDrag) return;
341
+ function downIfAllowed(evt) {
342
+ if (isBoolean(watchDrag) || watchDrag(emblaApi, evt)) down(evt);
343
+ }
344
+ const node = rootNode;
345
+ initEvents.add(node, 'dragstart', evt => evt.preventDefault(), nonPassiveEvent).add(node, 'touchmove', () => undefined, nonPassiveEvent).add(node, 'touchend', () => undefined).add(node, 'touchstart', downIfAllowed).add(node, 'mousedown', downIfAllowed).add(node, 'touchcancel', up).add(node, 'contextmenu', up).add(node, 'click', click, true);
346
+ }
347
+ function destroy() {
348
+ initEvents.clear();
349
+ dragEvents.clear();
350
+ }
351
+ function addDragEvents() {
352
+ const node = isMouse ? ownerDocument : rootNode;
353
+ dragEvents.add(node, 'touchmove', move, nonPassiveEvent).add(node, 'touchend', up).add(node, 'mousemove', move, nonPassiveEvent).add(node, 'mouseup', up);
354
+ }
355
+ function isFocusNode(node) {
356
+ const nodeName = node.nodeName || '';
357
+ return focusNodes.includes(nodeName);
358
+ }
359
+ function forceBoost() {
360
+ const boost = dragFree ? freeForceBoost : snapForceBoost;
361
+ const type = isMouse ? 'mouse' : 'touch';
362
+ return boost[type];
363
+ }
364
+ function allowedForce(force, targetChanged) {
365
+ const next = index.add(mathSign(force) * -1);
366
+ const baseForce = scrollTarget.byDistance(force, !dragFree).distance;
367
+ if (dragFree || mathAbs(force) < goToNextThreshold) return baseForce;
368
+ if (skipSnaps && targetChanged) return baseForce * 0.5;
369
+ return scrollTarget.byIndex(next.get(), 0).distance;
370
+ }
371
+ function down(evt) {
372
+ const isMouseEvt = isMouseEvent(evt, ownerWindow);
373
+ isMouse = isMouseEvt;
374
+ preventClick = dragFree && isMouseEvt && !evt.buttons && isMoving;
375
+ isMoving = deltaAbs(target.get(), location.get()) >= 2;
376
+ if (isMouseEvt && evt.button !== 0) return;
377
+ if (isFocusNode(evt.target)) return;
378
+ pointerIsDown = true;
379
+ dragTracker.pointerDown(evt);
380
+ scrollBody.useFriction(0).useDuration(0);
381
+ target.set(location);
382
+ addDragEvents();
383
+ startScroll = dragTracker.readPoint(evt);
384
+ startCross = dragTracker.readPoint(evt, crossAxis);
385
+ eventHandler.emit('pointerDown');
386
+ }
387
+ function move(evt) {
388
+ const isTouchEvt = !isMouseEvent(evt, ownerWindow);
389
+ if (isTouchEvt && evt.touches.length >= 2) return up(evt);
390
+ const lastScroll = dragTracker.readPoint(evt);
391
+ const lastCross = dragTracker.readPoint(evt, crossAxis);
392
+ const diffScroll = deltaAbs(lastScroll, startScroll);
393
+ const diffCross = deltaAbs(lastCross, startCross);
394
+ if (!preventScroll && !isMouse) {
395
+ if (!evt.cancelable) return up(evt);
396
+ preventScroll = diffScroll > diffCross;
397
+ if (!preventScroll) return up(evt);
398
+ }
399
+ const diff = dragTracker.pointerMove(evt);
400
+ if (diffScroll > dragThreshold) preventClick = true;
401
+ scrollBody.useFriction(0.3).useDuration(0.75);
402
+ animation.start();
403
+ target.add(direction(diff));
404
+ evt.preventDefault();
405
+ }
406
+ function up(evt) {
407
+ const currentLocation = scrollTarget.byDistance(0, false);
408
+ const targetChanged = currentLocation.index !== index.get();
409
+ const rawForce = dragTracker.pointerUp(evt) * forceBoost();
410
+ const force = allowedForce(direction(rawForce), targetChanged);
411
+ const forceFactor = factorAbs(rawForce, force);
412
+ const speed = baseSpeed - 10 * forceFactor;
413
+ const friction = baseFriction + forceFactor / 50;
414
+ preventScroll = false;
415
+ pointerIsDown = false;
416
+ dragEvents.clear();
417
+ scrollBody.useDuration(speed).useFriction(friction);
418
+ scrollTo.distance(force, !dragFree);
419
+ isMouse = false;
420
+ eventHandler.emit('pointerUp');
421
+ }
422
+ function click(evt) {
423
+ if (preventClick) {
424
+ evt.stopPropagation();
425
+ evt.preventDefault();
426
+ preventClick = false;
427
+ }
428
+ }
429
+ function pointerDown() {
430
+ return pointerIsDown;
431
+ }
432
+ const self = {
433
+ init,
434
+ destroy,
435
+ pointerDown
436
+ };
437
+ return self;
438
+ }
439
+
440
+ function DragTracker(axis, ownerWindow) {
441
+ const logInterval = 170;
442
+ let startEvent;
443
+ let lastEvent;
444
+ function readTime(evt) {
445
+ return evt.timeStamp;
446
+ }
447
+ function readPoint(evt, evtAxis) {
448
+ const property = evtAxis || axis.scroll;
449
+ const coord = `client${property === 'x' ? 'X' : 'Y'}`;
450
+ return (isMouseEvent(evt, ownerWindow) ? evt : evt.touches[0])[coord];
451
+ }
452
+ function pointerDown(evt) {
453
+ startEvent = evt;
454
+ lastEvent = evt;
455
+ return readPoint(evt);
456
+ }
457
+ function pointerMove(evt) {
458
+ const diff = readPoint(evt) - readPoint(lastEvent);
459
+ const expired = readTime(evt) - readTime(startEvent) > logInterval;
460
+ lastEvent = evt;
461
+ if (expired) startEvent = evt;
462
+ return diff;
463
+ }
464
+ function pointerUp(evt) {
465
+ if (!startEvent || !lastEvent) return 0;
466
+ const diffDrag = readPoint(lastEvent) - readPoint(startEvent);
467
+ const diffTime = readTime(evt) - readTime(startEvent);
468
+ const expired = readTime(evt) - readTime(lastEvent) > logInterval;
469
+ const force = diffDrag / diffTime;
470
+ const isFlick = diffTime && !expired && mathAbs(force) > 0.1;
471
+ return isFlick ? force : 0;
472
+ }
473
+ const self = {
474
+ pointerDown,
475
+ pointerMove,
476
+ pointerUp,
477
+ readPoint
478
+ };
479
+ return self;
480
+ }
481
+
482
+ function NodeRects() {
483
+ function measure(node) {
484
+ const {
485
+ offsetTop,
486
+ offsetLeft,
487
+ offsetWidth,
488
+ offsetHeight
489
+ } = node;
490
+ const offset = {
491
+ top: offsetTop,
492
+ right: offsetLeft + offsetWidth,
493
+ bottom: offsetTop + offsetHeight,
494
+ left: offsetLeft,
495
+ width: offsetWidth,
496
+ height: offsetHeight
497
+ };
498
+ return offset;
499
+ }
500
+ const self = {
501
+ measure
502
+ };
503
+ return self;
504
+ }
505
+
506
+ function PercentOfView(viewSize) {
507
+ function measure(n) {
508
+ return viewSize * (n / 100);
509
+ }
510
+ const self = {
511
+ measure
512
+ };
513
+ return self;
514
+ }
515
+
516
+ function ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects) {
517
+ const observeNodes = [container].concat(slides);
518
+ let resizeObserver;
519
+ let containerSize;
520
+ let slideSizes = [];
521
+ let destroyed = false;
522
+ function readSize(node) {
523
+ return axis.measureSize(nodeRects.measure(node));
524
+ }
525
+ function init(emblaApi) {
526
+ if (!watchResize) return;
527
+ containerSize = readSize(container);
528
+ slideSizes = slides.map(readSize);
529
+ function defaultCallback(entries) {
530
+ for (const entry of entries) {
531
+ if (destroyed) return;
532
+ const isContainer = entry.target === container;
533
+ const slideIndex = slides.indexOf(entry.target);
534
+ const lastSize = isContainer ? containerSize : slideSizes[slideIndex];
535
+ const newSize = readSize(isContainer ? container : slides[slideIndex]);
536
+ const diffSize = mathAbs(newSize - lastSize);
537
+ if (diffSize >= 0.5) {
538
+ emblaApi.reInit();
539
+ eventHandler.emit('resize');
540
+ break;
541
+ }
542
+ }
543
+ }
544
+ resizeObserver = new ResizeObserver(entries => {
545
+ if (isBoolean(watchResize) || watchResize(emblaApi, entries)) {
546
+ defaultCallback(entries);
547
+ }
548
+ });
549
+ ownerWindow.requestAnimationFrame(() => {
550
+ observeNodes.forEach(node => resizeObserver.observe(node));
551
+ });
552
+ }
553
+ function destroy() {
554
+ destroyed = true;
555
+ if (resizeObserver) resizeObserver.disconnect();
556
+ }
557
+ const self = {
558
+ init,
559
+ destroy
560
+ };
561
+ return self;
562
+ }
563
+
564
+ function ScrollBody(location, offsetLocation, previousLocation, target, baseDuration, baseFriction) {
565
+ let bodyVelocity = 0;
566
+ let scrollDirection = 0;
567
+ let scrollDuration = baseDuration;
568
+ let scrollFriction = baseFriction;
569
+ let rawLocation = location.get();
570
+ let rawLocationPrevious = 0;
571
+ function seek(timeStep) {
572
+ const fixedDeltaTimeSeconds = timeStep / 1000;
573
+ const duration = scrollDuration * fixedDeltaTimeSeconds;
574
+ const diff = target.get() - location.get();
575
+ const isInstant = !scrollDuration;
576
+ let directionDiff = 0;
577
+ if (isInstant) {
578
+ bodyVelocity = 0;
579
+ previousLocation.set(target);
580
+ location.set(target);
581
+ directionDiff = diff;
582
+ } else {
583
+ previousLocation.set(location);
584
+ bodyVelocity += diff / duration;
585
+ bodyVelocity *= scrollFriction;
586
+ rawLocation += bodyVelocity;
587
+ location.add(bodyVelocity * fixedDeltaTimeSeconds);
588
+ directionDiff = rawLocation - rawLocationPrevious;
589
+ }
590
+ scrollDirection = mathSign(directionDiff);
591
+ rawLocationPrevious = rawLocation;
592
+ return self;
593
+ }
594
+ function settled() {
595
+ const diff = target.get() - offsetLocation.get();
596
+ return mathAbs(diff) < 0.001;
597
+ }
598
+ function duration() {
599
+ return scrollDuration;
600
+ }
601
+ function direction() {
602
+ return scrollDirection;
603
+ }
604
+ function velocity() {
605
+ return bodyVelocity;
606
+ }
607
+ function useBaseDuration() {
608
+ return useDuration(baseDuration);
609
+ }
610
+ function useBaseFriction() {
611
+ return useFriction(baseFriction);
612
+ }
613
+ function useDuration(n) {
614
+ scrollDuration = n;
615
+ return self;
616
+ }
617
+ function useFriction(n) {
618
+ scrollFriction = n;
619
+ return self;
620
+ }
621
+ const self = {
622
+ direction,
623
+ duration,
624
+ velocity,
625
+ seek,
626
+ settled,
627
+ useBaseFriction,
628
+ useBaseDuration,
629
+ useFriction,
630
+ useDuration
631
+ };
632
+ return self;
633
+ }
634
+
635
+ function ScrollBounds(limit, location, target, scrollBody, percentOfView) {
636
+ const pullBackThreshold = percentOfView.measure(10);
637
+ const edgeOffsetTolerance = percentOfView.measure(50);
638
+ const frictionLimit = Limit(0.1, 0.99);
639
+ let disabled = false;
640
+ function shouldConstrain() {
641
+ if (disabled) return false;
642
+ if (!limit.reachedAny(target.get())) return false;
643
+ if (!limit.reachedAny(location.get())) return false;
644
+ return true;
645
+ }
646
+ function constrain(pointerDown) {
647
+ if (!shouldConstrain()) return;
648
+ const edge = limit.reachedMin(location.get()) ? 'min' : 'max';
649
+ const diffToEdge = mathAbs(limit[edge] - location.get());
650
+ const diffToTarget = target.get() - location.get();
651
+ const friction = frictionLimit.constrain(diffToEdge / edgeOffsetTolerance);
652
+ target.subtract(diffToTarget * friction);
653
+ if (!pointerDown && mathAbs(diffToTarget) < pullBackThreshold) {
654
+ target.set(limit.constrain(target.get()));
655
+ scrollBody.useDuration(25).useBaseFriction();
656
+ }
657
+ }
658
+ function toggleActive(active) {
659
+ disabled = !active;
660
+ }
661
+ const self = {
662
+ shouldConstrain,
663
+ constrain,
664
+ toggleActive
665
+ };
666
+ return self;
667
+ }
668
+
669
+ function ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance) {
670
+ const scrollBounds = Limit(-contentSize + viewSize, 0);
671
+ const snapsBounded = measureBounded();
672
+ const scrollContainLimit = findScrollContainLimit();
673
+ const snapsContained = measureContained();
674
+ function usePixelTolerance(bound, snap) {
675
+ return deltaAbs(bound, snap) < 1;
676
+ }
677
+ function findScrollContainLimit() {
678
+ const startSnap = snapsBounded[0];
679
+ const endSnap = arrayLast(snapsBounded);
680
+ const min = snapsBounded.lastIndexOf(startSnap);
681
+ const max = snapsBounded.indexOf(endSnap) + 1;
682
+ return Limit(min, max);
683
+ }
684
+ function measureBounded() {
685
+ return snapsAligned.map((snapAligned, index) => {
686
+ const {
687
+ min,
688
+ max
689
+ } = scrollBounds;
690
+ const snap = scrollBounds.constrain(snapAligned);
691
+ const isFirst = !index;
692
+ const isLast = arrayIsLastIndex(snapsAligned, index);
693
+ if (isFirst) return max;
694
+ if (isLast) return min;
695
+ if (usePixelTolerance(min, snap)) return min;
696
+ if (usePixelTolerance(max, snap)) return max;
697
+ return snap;
698
+ }).map(scrollBound => parseFloat(scrollBound.toFixed(3)));
699
+ }
700
+ function measureContained() {
701
+ if (contentSize <= viewSize + pixelTolerance) return [scrollBounds.max];
702
+ if (containScroll === 'keepSnaps') return snapsBounded;
703
+ const {
704
+ min,
705
+ max
706
+ } = scrollContainLimit;
707
+ return snapsBounded.slice(min, max);
708
+ }
709
+ const self = {
710
+ snapsContained,
711
+ scrollContainLimit
712
+ };
713
+ return self;
714
+ }
715
+
716
+ function ScrollLimit(contentSize, scrollSnaps, loop) {
717
+ const max = scrollSnaps[0];
718
+ const min = loop ? max - contentSize : arrayLast(scrollSnaps);
719
+ const limit = Limit(min, max);
720
+ const self = {
721
+ limit
722
+ };
723
+ return self;
724
+ }
725
+
726
+ function ScrollLooper(contentSize, limit, location, vectors) {
727
+ const jointSafety = 0.1;
728
+ const min = limit.min + jointSafety;
729
+ const max = limit.max + jointSafety;
730
+ const {
731
+ reachedMin,
732
+ reachedMax
733
+ } = Limit(min, max);
734
+ function shouldLoop(direction) {
735
+ if (direction === 1) return reachedMax(location.get());
736
+ if (direction === -1) return reachedMin(location.get());
737
+ return false;
738
+ }
739
+ function loop(direction) {
740
+ if (!shouldLoop(direction)) return;
741
+ const loopDistance = contentSize * (direction * -1);
742
+ vectors.forEach(v => v.add(loopDistance));
743
+ }
744
+ const self = {
745
+ loop
746
+ };
747
+ return self;
748
+ }
749
+
750
+ function ScrollProgress(limit) {
751
+ const {
752
+ max,
753
+ length
754
+ } = limit;
755
+ function get(n) {
756
+ const currentLocation = n - max;
757
+ return length ? currentLocation / -length : 0;
758
+ }
759
+ const self = {
760
+ get
761
+ };
762
+ return self;
763
+ }
764
+
765
+ function ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll) {
766
+ const {
767
+ startEdge,
768
+ endEdge
769
+ } = axis;
770
+ const {
771
+ groupSlides
772
+ } = slidesToScroll;
773
+ const alignments = measureSizes().map(alignment.measure);
774
+ const snaps = measureUnaligned();
775
+ const snapsAligned = measureAligned();
776
+ function measureSizes() {
777
+ return groupSlides(slideRects).map(rects => arrayLast(rects)[endEdge] - rects[0][startEdge]).map(mathAbs);
778
+ }
779
+ function measureUnaligned() {
780
+ return slideRects.map(rect => containerRect[startEdge] - rect[startEdge]).map(snap => -mathAbs(snap));
781
+ }
782
+ function measureAligned() {
783
+ return groupSlides(snaps).map(g => g[0]).map((snap, index) => snap + alignments[index]);
784
+ }
785
+ const self = {
786
+ snaps,
787
+ snapsAligned
788
+ };
789
+ return self;
790
+ }
791
+
792
+ function SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes) {
793
+ const {
794
+ groupSlides
795
+ } = slidesToScroll;
796
+ const {
797
+ min,
798
+ max
799
+ } = scrollContainLimit;
800
+ const slideRegistry = createSlideRegistry();
801
+ function createSlideRegistry() {
802
+ const groupedSlideIndexes = groupSlides(slideIndexes);
803
+ const doNotContain = !containSnaps || containScroll === 'keepSnaps';
804
+ if (scrollSnaps.length === 1) return [slideIndexes];
805
+ if (doNotContain) return groupedSlideIndexes;
806
+ return groupedSlideIndexes.slice(min, max).map((group, index, groups) => {
807
+ const isFirst = !index;
808
+ const isLast = arrayIsLastIndex(groups, index);
809
+ if (isFirst) {
810
+ const range = arrayLast(groups[0]) + 1;
811
+ return arrayFromNumber(range);
812
+ }
813
+ if (isLast) {
814
+ const range = arrayLastIndex(slideIndexes) - arrayLast(groups)[0] + 1;
815
+ return arrayFromNumber(range, arrayLast(groups)[0]);
816
+ }
817
+ return group;
818
+ });
819
+ }
820
+ const self = {
821
+ slideRegistry
822
+ };
823
+ return self;
824
+ }
825
+
826
+ function ScrollTarget(loop, scrollSnaps, contentSize, limit, targetVector) {
827
+ const {
828
+ reachedAny,
829
+ removeOffset,
830
+ constrain
831
+ } = limit;
832
+ function minDistance(distances) {
833
+ return distances.concat().sort((a, b) => mathAbs(a) - mathAbs(b))[0];
834
+ }
835
+ function findTargetSnap(target) {
836
+ const distance = loop ? removeOffset(target) : constrain(target);
837
+ const ascDiffsToSnaps = scrollSnaps.map((snap, index) => ({
838
+ diff: shortcut(snap - distance, 0),
839
+ index
840
+ })).sort((d1, d2) => mathAbs(d1.diff) - mathAbs(d2.diff));
841
+ const {
842
+ index
843
+ } = ascDiffsToSnaps[0];
844
+ return {
845
+ index,
846
+ distance
847
+ };
848
+ }
849
+ function shortcut(target, direction) {
850
+ const targets = [target, target + contentSize, target - contentSize];
851
+ if (!loop) return target;
852
+ if (!direction) return minDistance(targets);
853
+ const matchingTargets = targets.filter(t => mathSign(t) === direction);
854
+ if (matchingTargets.length) return minDistance(matchingTargets);
855
+ return arrayLast(targets) - contentSize;
856
+ }
857
+ function byIndex(index, direction) {
858
+ const diffToSnap = scrollSnaps[index] - targetVector.get();
859
+ const distance = shortcut(diffToSnap, direction);
860
+ return {
861
+ index,
862
+ distance
863
+ };
864
+ }
865
+ function byDistance(distance, snap) {
866
+ const target = targetVector.get() + distance;
867
+ const {
868
+ index,
869
+ distance: targetSnapDistance
870
+ } = findTargetSnap(target);
871
+ const reachedBound = !loop && reachedAny(target);
872
+ if (!snap || reachedBound) return {
873
+ index,
874
+ distance
875
+ };
876
+ const diffToSnap = scrollSnaps[index] - targetSnapDistance;
877
+ const snapDistance = distance + shortcut(diffToSnap, 0);
878
+ return {
879
+ index,
880
+ distance: snapDistance
881
+ };
882
+ }
883
+ const self = {
884
+ byDistance,
885
+ byIndex,
886
+ shortcut
887
+ };
888
+ return self;
889
+ }
890
+
891
+ function ScrollTo(animation, indexCurrent, indexPrevious, scrollBody, scrollTarget, targetVector, eventHandler) {
892
+ function scrollTo(target) {
893
+ const distanceDiff = target.distance;
894
+ const indexDiff = target.index !== indexCurrent.get();
895
+ targetVector.add(distanceDiff);
896
+ if (distanceDiff) {
897
+ if (scrollBody.duration()) {
898
+ animation.start();
899
+ } else {
900
+ animation.update();
901
+ animation.render(1);
902
+ animation.update();
903
+ }
904
+ }
905
+ if (indexDiff) {
906
+ indexPrevious.set(indexCurrent.get());
907
+ indexCurrent.set(target.index);
908
+ eventHandler.emit('select');
909
+ }
910
+ }
911
+ function distance(n, snap) {
912
+ const target = scrollTarget.byDistance(n, snap);
913
+ scrollTo(target);
914
+ }
915
+ function index(n, direction) {
916
+ const targetIndex = indexCurrent.clone().set(n);
917
+ const target = scrollTarget.byIndex(targetIndex.get(), direction);
918
+ scrollTo(target);
919
+ }
920
+ const self = {
921
+ distance,
922
+ index
923
+ };
924
+ return self;
925
+ }
926
+
927
+ function SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus) {
928
+ const focusListenerOptions = {
929
+ passive: true,
930
+ capture: true
931
+ };
932
+ let lastTabPressTime = 0;
933
+ function init(emblaApi) {
934
+ if (!watchFocus) return;
935
+ function defaultCallback(index) {
936
+ const nowTime = new Date().getTime();
937
+ const diffTime = nowTime - lastTabPressTime;
938
+ if (diffTime > 10) return;
939
+ eventHandler.emit('slideFocusStart');
940
+ root.scrollLeft = 0;
941
+ const group = slideRegistry.findIndex(group => group.includes(index));
942
+ if (!isNumber(group)) return;
943
+ scrollBody.useDuration(0);
944
+ scrollTo.index(group, 0);
945
+ eventHandler.emit('slideFocus');
946
+ }
947
+ eventStore.add(document, 'keydown', registerTabPress, false);
948
+ slides.forEach((slide, slideIndex) => {
949
+ eventStore.add(slide, 'focus', evt => {
950
+ if (isBoolean(watchFocus) || watchFocus(emblaApi, evt)) {
951
+ defaultCallback(slideIndex);
952
+ }
953
+ }, focusListenerOptions);
954
+ });
955
+ }
956
+ function registerTabPress(event) {
957
+ if (event.code === 'Tab') lastTabPressTime = new Date().getTime();
958
+ }
959
+ const self = {
960
+ init
961
+ };
962
+ return self;
963
+ }
964
+
965
+ function Vector1D(initialValue) {
966
+ let value = initialValue;
967
+ function get() {
968
+ return value;
969
+ }
970
+ function set(n) {
971
+ value = normalizeInput(n);
972
+ }
973
+ function add(n) {
974
+ value += normalizeInput(n);
975
+ }
976
+ function subtract(n) {
977
+ value -= normalizeInput(n);
978
+ }
979
+ function normalizeInput(n) {
980
+ return isNumber(n) ? n : n.get();
981
+ }
982
+ const self = {
983
+ get,
984
+ set,
985
+ add,
986
+ subtract
987
+ };
988
+ return self;
989
+ }
990
+
991
+ function Translate(axis, container) {
992
+ const translate = axis.scroll === 'x' ? x : y;
993
+ const containerStyle = container.style;
994
+ let disabled = false;
995
+ function x(n) {
996
+ return `translate3d(${n}px,0px,0px)`;
997
+ }
998
+ function y(n) {
999
+ return `translate3d(0px,${n}px,0px)`;
1000
+ }
1001
+ function to(target) {
1002
+ if (disabled) return;
1003
+ containerStyle.transform = translate(axis.direction(target));
1004
+ }
1005
+ function toggleActive(active) {
1006
+ disabled = !active;
1007
+ }
1008
+ function clear() {
1009
+ if (disabled) return;
1010
+ containerStyle.transform = '';
1011
+ if (!container.getAttribute('style')) container.removeAttribute('style');
1012
+ }
1013
+ const self = {
1014
+ clear,
1015
+ to,
1016
+ toggleActive
1017
+ };
1018
+ return self;
1019
+ }
1020
+
1021
+ function SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, location, slides) {
1022
+ const roundingSafety = 0.5;
1023
+ const ascItems = arrayKeys(slideSizesWithGaps);
1024
+ const descItems = arrayKeys(slideSizesWithGaps).reverse();
1025
+ const loopPoints = startPoints().concat(endPoints());
1026
+ function removeSlideSizes(indexes, from) {
1027
+ return indexes.reduce((a, i) => {
1028
+ return a - slideSizesWithGaps[i];
1029
+ }, from);
1030
+ }
1031
+ function slidesInGap(indexes, gap) {
1032
+ return indexes.reduce((a, i) => {
1033
+ const remainingGap = removeSlideSizes(a, gap);
1034
+ return remainingGap > 0 ? a.concat([i]) : a;
1035
+ }, []);
1036
+ }
1037
+ function findSlideBounds(offset) {
1038
+ return snaps.map((snap, index) => ({
1039
+ start: snap - slideSizes[index] + roundingSafety + offset,
1040
+ end: snap + viewSize - roundingSafety + offset
1041
+ }));
1042
+ }
1043
+ function findLoopPoints(indexes, offset, isEndEdge) {
1044
+ const slideBounds = findSlideBounds(offset);
1045
+ return indexes.map(index => {
1046
+ const initial = isEndEdge ? 0 : -contentSize;
1047
+ const altered = isEndEdge ? contentSize : 0;
1048
+ const boundEdge = isEndEdge ? 'end' : 'start';
1049
+ const loopPoint = slideBounds[index][boundEdge];
1050
+ return {
1051
+ index,
1052
+ loopPoint,
1053
+ slideLocation: Vector1D(-1),
1054
+ translate: Translate(axis, slides[index]),
1055
+ target: () => location.get() > loopPoint ? initial : altered
1056
+ };
1057
+ });
1058
+ }
1059
+ function startPoints() {
1060
+ const gap = scrollSnaps[0];
1061
+ const indexes = slidesInGap(descItems, gap);
1062
+ return findLoopPoints(indexes, contentSize, false);
1063
+ }
1064
+ function endPoints() {
1065
+ const gap = viewSize - scrollSnaps[0] - 1;
1066
+ const indexes = slidesInGap(ascItems, gap);
1067
+ return findLoopPoints(indexes, -contentSize, true);
1068
+ }
1069
+ function canLoop() {
1070
+ return loopPoints.every(({
1071
+ index
1072
+ }) => {
1073
+ const otherIndexes = ascItems.filter(i => i !== index);
1074
+ return removeSlideSizes(otherIndexes, viewSize) <= 0.1;
1075
+ });
1076
+ }
1077
+ function loop() {
1078
+ loopPoints.forEach(loopPoint => {
1079
+ const {
1080
+ target,
1081
+ translate,
1082
+ slideLocation
1083
+ } = loopPoint;
1084
+ const shiftLocation = target();
1085
+ if (shiftLocation === slideLocation.get()) return;
1086
+ translate.to(shiftLocation);
1087
+ slideLocation.set(shiftLocation);
1088
+ });
1089
+ }
1090
+ function clear() {
1091
+ loopPoints.forEach(loopPoint => loopPoint.translate.clear());
1092
+ }
1093
+ const self = {
1094
+ canLoop,
1095
+ clear,
1096
+ loop,
1097
+ loopPoints
1098
+ };
1099
+ return self;
1100
+ }
1101
+
1102
+ function SlidesHandler(container, eventHandler, watchSlides) {
1103
+ let mutationObserver;
1104
+ let destroyed = false;
1105
+ function init(emblaApi) {
1106
+ if (!watchSlides) return;
1107
+ function defaultCallback(mutations) {
1108
+ for (const mutation of mutations) {
1109
+ if (mutation.type === 'childList') {
1110
+ emblaApi.reInit();
1111
+ eventHandler.emit('slidesChanged');
1112
+ break;
1113
+ }
1114
+ }
1115
+ }
1116
+ mutationObserver = new MutationObserver(mutations => {
1117
+ if (destroyed) return;
1118
+ if (isBoolean(watchSlides) || watchSlides(emblaApi, mutations)) {
1119
+ defaultCallback(mutations);
1120
+ }
1121
+ });
1122
+ mutationObserver.observe(container, {
1123
+ childList: true
1124
+ });
1125
+ }
1126
+ function destroy() {
1127
+ if (mutationObserver) mutationObserver.disconnect();
1128
+ destroyed = true;
1129
+ }
1130
+ const self = {
1131
+ init,
1132
+ destroy
1133
+ };
1134
+ return self;
1135
+ }
1136
+
1137
+ function SlidesInView(container, slides, eventHandler, threshold) {
1138
+ const intersectionEntryMap = {};
1139
+ let inViewCache = null;
1140
+ let notInViewCache = null;
1141
+ let intersectionObserver;
1142
+ let destroyed = false;
1143
+ function init() {
1144
+ intersectionObserver = new IntersectionObserver(entries => {
1145
+ if (destroyed) return;
1146
+ entries.forEach(entry => {
1147
+ const index = slides.indexOf(entry.target);
1148
+ intersectionEntryMap[index] = entry;
1149
+ });
1150
+ inViewCache = null;
1151
+ notInViewCache = null;
1152
+ eventHandler.emit('slidesInView');
1153
+ }, {
1154
+ root: container.parentElement,
1155
+ threshold
1156
+ });
1157
+ slides.forEach(slide => intersectionObserver.observe(slide));
1158
+ }
1159
+ function destroy() {
1160
+ if (intersectionObserver) intersectionObserver.disconnect();
1161
+ destroyed = true;
1162
+ }
1163
+ function createInViewList(inView) {
1164
+ return objectKeys(intersectionEntryMap).reduce((list, slideIndex) => {
1165
+ const index = parseInt(slideIndex);
1166
+ const {
1167
+ isIntersecting
1168
+ } = intersectionEntryMap[index];
1169
+ const inViewMatch = inView && isIntersecting;
1170
+ const notInViewMatch = !inView && !isIntersecting;
1171
+ if (inViewMatch || notInViewMatch) list.push(index);
1172
+ return list;
1173
+ }, []);
1174
+ }
1175
+ function get(inView = true) {
1176
+ if (inView && inViewCache) return inViewCache;
1177
+ if (!inView && notInViewCache) return notInViewCache;
1178
+ const slideIndexes = createInViewList(inView);
1179
+ if (inView) inViewCache = slideIndexes;
1180
+ if (!inView) notInViewCache = slideIndexes;
1181
+ return slideIndexes;
1182
+ }
1183
+ const self = {
1184
+ init,
1185
+ destroy,
1186
+ get
1187
+ };
1188
+ return self;
1189
+ }
1190
+
1191
+ function SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow) {
1192
+ const {
1193
+ measureSize,
1194
+ startEdge,
1195
+ endEdge
1196
+ } = axis;
1197
+ const withEdgeGap = slideRects[0] && readEdgeGap;
1198
+ const startGap = measureStartGap();
1199
+ const endGap = measureEndGap();
1200
+ const slideSizes = slideRects.map(measureSize);
1201
+ const slideSizesWithGaps = measureWithGaps();
1202
+ function measureStartGap() {
1203
+ if (!withEdgeGap) return 0;
1204
+ const slideRect = slideRects[0];
1205
+ return mathAbs(containerRect[startEdge] - slideRect[startEdge]);
1206
+ }
1207
+ function measureEndGap() {
1208
+ if (!withEdgeGap) return 0;
1209
+ const style = ownerWindow.getComputedStyle(arrayLast(slides));
1210
+ return parseFloat(style.getPropertyValue(`margin-${endEdge}`));
1211
+ }
1212
+ function measureWithGaps() {
1213
+ return slideRects.map((rect, index, rects) => {
1214
+ const isFirst = !index;
1215
+ const isLast = arrayIsLastIndex(rects, index);
1216
+ if (isFirst) return slideSizes[index] + startGap;
1217
+ if (isLast) return slideSizes[index] + endGap;
1218
+ return rects[index + 1][startEdge] - rect[startEdge];
1219
+ }).map(mathAbs);
1220
+ }
1221
+ const self = {
1222
+ slideSizes,
1223
+ slideSizesWithGaps,
1224
+ startGap,
1225
+ endGap
1226
+ };
1227
+ return self;
1228
+ }
1229
+
1230
+ function SlidesToScroll(axis, viewSize, slidesToScroll, loop, containerRect, slideRects, startGap, endGap, pixelTolerance) {
1231
+ const {
1232
+ startEdge,
1233
+ endEdge,
1234
+ direction
1235
+ } = axis;
1236
+ const groupByNumber = isNumber(slidesToScroll);
1237
+ function byNumber(array, groupSize) {
1238
+ return arrayKeys(array).filter(i => i % groupSize === 0).map(i => array.slice(i, i + groupSize));
1239
+ }
1240
+ function bySize(array) {
1241
+ if (!array.length) return [];
1242
+ return arrayKeys(array).reduce((groups, rectB, index) => {
1243
+ const rectA = arrayLast(groups) || 0;
1244
+ const isFirst = rectA === 0;
1245
+ const isLast = rectB === arrayLastIndex(array);
1246
+ const edgeA = containerRect[startEdge] - slideRects[rectA][startEdge];
1247
+ const edgeB = containerRect[startEdge] - slideRects[rectB][endEdge];
1248
+ const gapA = !loop && isFirst ? direction(startGap) : 0;
1249
+ const gapB = !loop && isLast ? direction(endGap) : 0;
1250
+ const chunkSize = mathAbs(edgeB - gapB - (edgeA + gapA));
1251
+ if (index && chunkSize > viewSize + pixelTolerance) groups.push(rectB);
1252
+ if (isLast) groups.push(array.length);
1253
+ return groups;
1254
+ }, []).map((currentSize, index, groups) => {
1255
+ const previousSize = Math.max(groups[index - 1] || 0);
1256
+ return array.slice(previousSize, currentSize);
1257
+ });
1258
+ }
1259
+ function groupSlides(array) {
1260
+ return groupByNumber ? byNumber(array, slidesToScroll) : bySize(array);
1261
+ }
1262
+ const self = {
1263
+ groupSlides
1264
+ };
1265
+ return self;
1266
+ }
1267
+
1268
+ function Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler) {
1269
+ // Options
1270
+ const {
1271
+ align,
1272
+ axis: scrollAxis,
1273
+ direction,
1274
+ startIndex,
1275
+ loop,
1276
+ duration,
1277
+ dragFree,
1278
+ dragThreshold,
1279
+ inViewThreshold,
1280
+ slidesToScroll: groupSlides,
1281
+ skipSnaps,
1282
+ containScroll,
1283
+ watchResize,
1284
+ watchSlides,
1285
+ watchDrag,
1286
+ watchFocus
1287
+ } = options;
1288
+ // Measurements
1289
+ const pixelTolerance = 2;
1290
+ const nodeRects = NodeRects();
1291
+ const containerRect = nodeRects.measure(container);
1292
+ const slideRects = slides.map(nodeRects.measure);
1293
+ const axis = Axis(scrollAxis, direction);
1294
+ const viewSize = axis.measureSize(containerRect);
1295
+ const percentOfView = PercentOfView(viewSize);
1296
+ const alignment = Alignment(align, viewSize);
1297
+ const containSnaps = !loop && !!containScroll;
1298
+ const readEdgeGap = loop || !!containScroll;
1299
+ const {
1300
+ slideSizes,
1301
+ slideSizesWithGaps,
1302
+ startGap,
1303
+ endGap
1304
+ } = SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow);
1305
+ const slidesToScroll = SlidesToScroll(axis, viewSize, groupSlides, loop, containerRect, slideRects, startGap, endGap, pixelTolerance);
1306
+ const {
1307
+ snaps,
1308
+ snapsAligned
1309
+ } = ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll);
1310
+ const contentSize = -arrayLast(snaps) + arrayLast(slideSizesWithGaps);
1311
+ const {
1312
+ snapsContained,
1313
+ scrollContainLimit
1314
+ } = ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance);
1315
+ const scrollSnaps = containSnaps ? snapsContained : snapsAligned;
1316
+ const {
1317
+ limit
1318
+ } = ScrollLimit(contentSize, scrollSnaps, loop);
1319
+ // Indexes
1320
+ const index = Counter(arrayLastIndex(scrollSnaps), startIndex, loop);
1321
+ const indexPrevious = index.clone();
1322
+ const slideIndexes = arrayKeys(slides);
1323
+ // Animation
1324
+ const update = ({
1325
+ dragHandler,
1326
+ scrollBody,
1327
+ scrollBounds,
1328
+ options: {
1329
+ loop
1330
+ }
1331
+ }, timeStep) => {
1332
+ if (!loop) scrollBounds.constrain(dragHandler.pointerDown());
1333
+ scrollBody.seek(timeStep);
1334
+ };
1335
+ const render = ({
1336
+ scrollBody,
1337
+ translate,
1338
+ location,
1339
+ offsetLocation,
1340
+ scrollLooper,
1341
+ slideLooper,
1342
+ dragHandler,
1343
+ animation,
1344
+ eventHandler,
1345
+ scrollBounds,
1346
+ options: {
1347
+ loop
1348
+ }
1349
+ }, lagOffset) => {
1350
+ const shouldSettle = scrollBody.settled();
1351
+ const withinBounds = !scrollBounds.shouldConstrain();
1352
+ const hasSettled = loop ? shouldSettle : shouldSettle && withinBounds;
1353
+ if (hasSettled && !dragHandler.pointerDown()) {
1354
+ animation.stop();
1355
+ eventHandler.emit('settle');
1356
+ }
1357
+ if (!hasSettled) eventHandler.emit('scroll');
1358
+ const interpolatedLocation = location.get() * lagOffset + previousLocation.get() * (1 - lagOffset);
1359
+ offsetLocation.set(interpolatedLocation);
1360
+ if (loop) {
1361
+ scrollLooper.loop(scrollBody.direction());
1362
+ slideLooper.loop();
1363
+ }
1364
+ translate.to(offsetLocation.get());
1365
+ };
1366
+ const animation = Animations(ownerDocument, ownerWindow, timeStep => update(engine, timeStep), lagOffset => render(engine, lagOffset));
1367
+ // Shared
1368
+ const friction = 0.68;
1369
+ const startLocation = scrollSnaps[index.get()];
1370
+ const location = Vector1D(startLocation);
1371
+ const previousLocation = Vector1D(startLocation);
1372
+ const offsetLocation = Vector1D(startLocation);
1373
+ const target = Vector1D(startLocation);
1374
+ const scrollBody = ScrollBody(location, offsetLocation, previousLocation, target, duration, friction);
1375
+ const scrollTarget = ScrollTarget(loop, scrollSnaps, contentSize, limit, target);
1376
+ const scrollTo = ScrollTo(animation, index, indexPrevious, scrollBody, scrollTarget, target, eventHandler);
1377
+ const scrollProgress = ScrollProgress(limit);
1378
+ const eventStore = EventStore();
1379
+ const slidesInView = SlidesInView(container, slides, eventHandler, inViewThreshold);
1380
+ const {
1381
+ slideRegistry
1382
+ } = SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes);
1383
+ const slideFocus = SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus);
1384
+ // Engine
1385
+ const engine = {
1386
+ ownerDocument,
1387
+ ownerWindow,
1388
+ eventHandler,
1389
+ containerRect,
1390
+ slideRects,
1391
+ animation,
1392
+ axis,
1393
+ dragHandler: DragHandler(axis, root, ownerDocument, ownerWindow, target, DragTracker(axis, ownerWindow), location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, friction, watchDrag),
1394
+ eventStore,
1395
+ percentOfView,
1396
+ index,
1397
+ indexPrevious,
1398
+ limit,
1399
+ location,
1400
+ offsetLocation,
1401
+ previousLocation,
1402
+ options,
1403
+ resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects),
1404
+ scrollBody,
1405
+ scrollBounds: ScrollBounds(limit, offsetLocation, target, scrollBody, percentOfView),
1406
+ scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [location, offsetLocation, previousLocation, target]),
1407
+ scrollProgress,
1408
+ scrollSnapList: scrollSnaps.map(scrollProgress.get),
1409
+ scrollSnaps,
1410
+ scrollTarget,
1411
+ scrollTo,
1412
+ slideLooper: SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, offsetLocation, slides),
1413
+ slideFocus,
1414
+ slidesHandler: SlidesHandler(container, eventHandler, watchSlides),
1415
+ slidesInView,
1416
+ slideIndexes,
1417
+ slideRegistry,
1418
+ slidesToScroll,
1419
+ target,
1420
+ translate: Translate(axis, container)
1421
+ };
1422
+ return engine;
1423
+ }
1424
+
1425
+ function EventHandler() {
1426
+ let listeners = {};
1427
+ let api;
1428
+ function init(emblaApi) {
1429
+ api = emblaApi;
1430
+ }
1431
+ function getListeners(evt) {
1432
+ return listeners[evt] || [];
1433
+ }
1434
+ function emit(evt) {
1435
+ getListeners(evt).forEach(e => e(api, evt));
1436
+ return self;
1437
+ }
1438
+ function on(evt, cb) {
1439
+ listeners[evt] = getListeners(evt).concat([cb]);
1440
+ return self;
1441
+ }
1442
+ function off(evt, cb) {
1443
+ listeners[evt] = getListeners(evt).filter(e => e !== cb);
1444
+ return self;
1445
+ }
1446
+ function clear() {
1447
+ listeners = {};
1448
+ }
1449
+ const self = {
1450
+ init,
1451
+ emit,
1452
+ off,
1453
+ on,
1454
+ clear
1455
+ };
1456
+ return self;
1457
+ }
1458
+
1459
+ const defaultOptions = {
1460
+ align: 'center',
1461
+ axis: 'x',
1462
+ container: null,
1463
+ slides: null,
1464
+ containScroll: 'trimSnaps',
1465
+ direction: 'ltr',
1466
+ slidesToScroll: 1,
1467
+ inViewThreshold: 0,
1468
+ breakpoints: {},
1469
+ dragFree: false,
1470
+ dragThreshold: 10,
1471
+ loop: false,
1472
+ skipSnaps: false,
1473
+ duration: 25,
1474
+ startIndex: 0,
1475
+ active: true,
1476
+ watchDrag: true,
1477
+ watchResize: true,
1478
+ watchSlides: true,
1479
+ watchFocus: true
1480
+ };
1481
+
1482
+ function OptionsHandler(ownerWindow) {
1483
+ function mergeOptions(optionsA, optionsB) {
1484
+ return objectsMergeDeep(optionsA, optionsB || {});
1485
+ }
1486
+ function optionsAtMedia(options) {
1487
+ const optionsAtMedia = options.breakpoints || {};
1488
+ const matchedMediaOptions = objectKeys(optionsAtMedia).filter(media => ownerWindow.matchMedia(media).matches).map(media => optionsAtMedia[media]).reduce((a, mediaOption) => mergeOptions(a, mediaOption), {});
1489
+ return mergeOptions(options, matchedMediaOptions);
1490
+ }
1491
+ function optionsMediaQueries(optionsList) {
1492
+ return optionsList.map(options => objectKeys(options.breakpoints || {})).reduce((acc, mediaQueries) => acc.concat(mediaQueries), []).map(ownerWindow.matchMedia);
1493
+ }
1494
+ const self = {
1495
+ mergeOptions,
1496
+ optionsAtMedia,
1497
+ optionsMediaQueries
1498
+ };
1499
+ return self;
1500
+ }
1501
+
1502
+ function PluginsHandler(optionsHandler) {
1503
+ let activePlugins = [];
1504
+ function init(emblaApi, plugins) {
1505
+ activePlugins = plugins.filter(({
1506
+ options
1507
+ }) => optionsHandler.optionsAtMedia(options).active !== false);
1508
+ activePlugins.forEach(plugin => plugin.init(emblaApi, optionsHandler));
1509
+ return plugins.reduce((map, plugin) => Object.assign(map, {
1510
+ [plugin.name]: plugin
1511
+ }), {});
1512
+ }
1513
+ function destroy() {
1514
+ activePlugins = activePlugins.filter(plugin => plugin.destroy());
1515
+ }
1516
+ const self = {
1517
+ init,
1518
+ destroy
1519
+ };
1520
+ return self;
1521
+ }
1522
+
1523
+ function EmblaCarousel(root, userOptions, userPlugins) {
1524
+ const ownerDocument = root.ownerDocument;
1525
+ const ownerWindow = ownerDocument.defaultView;
1526
+ const optionsHandler = OptionsHandler(ownerWindow);
1527
+ const pluginsHandler = PluginsHandler(optionsHandler);
1528
+ const mediaHandlers = EventStore();
1529
+ const eventHandler = EventHandler();
1530
+ const {
1531
+ mergeOptions,
1532
+ optionsAtMedia,
1533
+ optionsMediaQueries
1534
+ } = optionsHandler;
1535
+ const {
1536
+ on,
1537
+ off,
1538
+ emit
1539
+ } = eventHandler;
1540
+ const reInit = reActivate;
1541
+ let destroyed = false;
1542
+ let engine;
1543
+ let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions);
1544
+ let options = mergeOptions(optionsBase);
1545
+ let pluginList = [];
1546
+ let pluginApis;
1547
+ let container;
1548
+ let slides;
1549
+ function storeElements() {
1550
+ const {
1551
+ container: userContainer,
1552
+ slides: userSlides
1553
+ } = options;
1554
+ const customContainer = isString(userContainer) ? root.querySelector(userContainer) : userContainer;
1555
+ container = customContainer || root.children[0];
1556
+ const customSlides = isString(userSlides) ? container.querySelectorAll(userSlides) : userSlides;
1557
+ slides = [].slice.call(customSlides || container.children);
1558
+ }
1559
+ function createEngine(options) {
1560
+ const engine = Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler);
1561
+ if (options.loop && !engine.slideLooper.canLoop()) {
1562
+ const optionsWithoutLoop = Object.assign({}, options, {
1563
+ loop: false
1564
+ });
1565
+ return createEngine(optionsWithoutLoop);
1566
+ }
1567
+ return engine;
1568
+ }
1569
+ function activate(withOptions, withPlugins) {
1570
+ if (destroyed) return;
1571
+ optionsBase = mergeOptions(optionsBase, withOptions);
1572
+ options = optionsAtMedia(optionsBase);
1573
+ pluginList = withPlugins || pluginList;
1574
+ storeElements();
1575
+ engine = createEngine(options);
1576
+ optionsMediaQueries([optionsBase, ...pluginList.map(({
1577
+ options
1578
+ }) => options)]).forEach(query => mediaHandlers.add(query, 'change', reActivate));
1579
+ if (!options.active) return;
1580
+ engine.translate.to(engine.location.get());
1581
+ engine.animation.init();
1582
+ engine.slidesInView.init();
1583
+ engine.slideFocus.init(self);
1584
+ engine.eventHandler.init(self);
1585
+ engine.resizeHandler.init(self);
1586
+ engine.slidesHandler.init(self);
1587
+ if (engine.options.loop) engine.slideLooper.loop();
1588
+ if (container.offsetParent && slides.length) engine.dragHandler.init(self);
1589
+ pluginApis = pluginsHandler.init(self, pluginList);
1590
+ }
1591
+ function reActivate(withOptions, withPlugins) {
1592
+ const startIndex = selectedScrollSnap();
1593
+ deActivate();
1594
+ activate(mergeOptions({
1595
+ startIndex
1596
+ }, withOptions), withPlugins);
1597
+ eventHandler.emit('reInit');
1598
+ }
1599
+ function deActivate() {
1600
+ engine.dragHandler.destroy();
1601
+ engine.eventStore.clear();
1602
+ engine.translate.clear();
1603
+ engine.slideLooper.clear();
1604
+ engine.resizeHandler.destroy();
1605
+ engine.slidesHandler.destroy();
1606
+ engine.slidesInView.destroy();
1607
+ engine.animation.destroy();
1608
+ pluginsHandler.destroy();
1609
+ mediaHandlers.clear();
1610
+ }
1611
+ function destroy() {
1612
+ if (destroyed) return;
1613
+ destroyed = true;
1614
+ mediaHandlers.clear();
1615
+ deActivate();
1616
+ eventHandler.emit('destroy');
1617
+ eventHandler.clear();
1618
+ }
1619
+ function scrollTo(index, jump, direction) {
1620
+ if (!options.active || destroyed) return;
1621
+ engine.scrollBody.useBaseFriction().useDuration(jump === true ? 0 : options.duration);
1622
+ engine.scrollTo.index(index, direction || 0);
1623
+ }
1624
+ function scrollNext(jump) {
1625
+ const next = engine.index.add(1).get();
1626
+ scrollTo(next, jump, -1);
1627
+ }
1628
+ function scrollPrev(jump) {
1629
+ const prev = engine.index.add(-1).get();
1630
+ scrollTo(prev, jump, 1);
1631
+ }
1632
+ function canScrollNext() {
1633
+ const next = engine.index.add(1).get();
1634
+ return next !== selectedScrollSnap();
1635
+ }
1636
+ function canScrollPrev() {
1637
+ const prev = engine.index.add(-1).get();
1638
+ return prev !== selectedScrollSnap();
1639
+ }
1640
+ function scrollSnapList() {
1641
+ return engine.scrollSnapList;
1642
+ }
1643
+ function scrollProgress() {
1644
+ return engine.scrollProgress.get(engine.location.get());
1645
+ }
1646
+ function selectedScrollSnap() {
1647
+ return engine.index.get();
1648
+ }
1649
+ function previousScrollSnap() {
1650
+ return engine.indexPrevious.get();
1651
+ }
1652
+ function slidesInView() {
1653
+ return engine.slidesInView.get();
1654
+ }
1655
+ function slidesNotInView() {
1656
+ return engine.slidesInView.get(false);
1657
+ }
1658
+ function plugins() {
1659
+ return pluginApis;
1660
+ }
1661
+ function internalEngine() {
1662
+ return engine;
1663
+ }
1664
+ function rootNode() {
1665
+ return root;
1666
+ }
1667
+ function containerNode() {
1668
+ return container;
1669
+ }
1670
+ function slideNodes() {
1671
+ return slides;
1672
+ }
1673
+ const self = {
1674
+ canScrollNext,
1675
+ canScrollPrev,
1676
+ containerNode,
1677
+ internalEngine,
1678
+ destroy,
1679
+ off,
1680
+ on,
1681
+ emit,
1682
+ plugins,
1683
+ previousScrollSnap,
1684
+ reInit,
1685
+ rootNode,
1686
+ scrollNext,
1687
+ scrollPrev,
1688
+ scrollProgress,
1689
+ scrollSnapList,
1690
+ scrollTo,
1691
+ selectedScrollSnap,
1692
+ slideNodes,
1693
+ slidesInView,
1694
+ slidesNotInView
1695
+ };
1696
+ activate(userOptions, userPlugins);
1697
+ setTimeout(() => eventHandler.emit('init'), 0);
1698
+ return self;
1699
+ }
1700
+ EmblaCarousel.globalOptions = undefined;
1701
+
1702
+ function useEmblaCarousel(options = {}, plugins = []) {
1703
+ const storedOptions = useRef(options);
1704
+ const storedPlugins = useRef(plugins);
1705
+ const [emblaApi, setEmblaApi] = useState();
1706
+ const [viewport, setViewport] = useState();
1707
+ const reInit = useCallback(() => {
1708
+ if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);
1709
+ }, [emblaApi]);
1710
+ useEffect(() => {
1711
+ if (areOptionsEqual(storedOptions.current, options)) return;
1712
+ storedOptions.current = options;
1713
+ reInit();
1714
+ }, [options, reInit]);
1715
+ useEffect(() => {
1716
+ if (arePluginsEqual(storedPlugins.current, plugins)) return;
1717
+ storedPlugins.current = plugins;
1718
+ reInit();
1719
+ }, [plugins, reInit]);
1720
+ useEffect(() => {
1721
+ if (canUseDOM() && viewport) {
1722
+ EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions;
1723
+ const newEmblaApi = EmblaCarousel(viewport, storedOptions.current, storedPlugins.current);
1724
+ setEmblaApi(newEmblaApi);
1725
+ return () => newEmblaApi.destroy();
1726
+ } else {
1727
+ setEmblaApi(undefined);
1728
+ }
1729
+ }, [viewport, setEmblaApi]);
1730
+ return [setViewport, emblaApi];
1731
+ }
1732
+ useEmblaCarousel.globalOptions = undefined;
1733
+
1734
+ /**
1735
+ * Do not edit directly
1736
+ * Generated on Tue, 12 Nov 2024 11:46:58 GMT
1737
+ */
1738
+ var ArcSizeBreakpointsXs = "320px";
1739
+ var ArcSizeBreakpointsS = "636px";
1740
+ var ArcSizeBreakpointsM = "768px";
1741
+ var ArcSizeBreakpointsL = "1024px";
1742
+ var ArcSizeBreakpointsXl = "1280px";
1743
+
1744
+ var XS_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsXs, ")");
1745
+ var S_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsS, ")");
1746
+ var M_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsM, ")");
1747
+ var L_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsL, ")");
1748
+ var XL_BREAKPOINT = "(min-width: ".concat(ArcSizeBreakpointsXl, ")");
1749
+
1750
+ var getOptions = function (itemsToScroll, loop, responsive) {
1751
+ var breakpoints = [
1752
+ [XS_BREAKPOINT, "xs"],
1753
+ [S_BREAKPOINT, "s"],
1754
+ [M_BREAKPOINT, "m"],
1755
+ [L_BREAKPOINT, "l"],
1756
+ [XL_BREAKPOINT, "xl"],
1757
+ ];
1758
+ var breakpointOptions = breakpoints.reduce(function (acc, _a) {
1759
+ var _b;
1760
+ var _c;
1761
+ var query = _a[0], breakpoint = _a[1];
1762
+ return __assign(__assign({}, acc), __assign({}, ((responsive === null || responsive === void 0 ? void 0 : responsive[breakpoint])
1763
+ ? (_b = {},
1764
+ _b[query] = {
1765
+ slidesToScroll: (_c = responsive === null || responsive === void 0 ? void 0 : responsive[breakpoint]) === null || _c === void 0 ? void 0 : _c.itemsToScroll
1766
+ },
1767
+ _b) : {})));
1768
+ }, {});
1769
+ return {
1770
+ loop: loop,
1771
+ skipSnaps: true,
1772
+ align: "start",
1773
+ slidesToScroll: itemsToScroll,
1774
+ breakpoints: breakpointOptions
1775
+ };
1776
+ };
1777
+
1778
+ var getSlideWidth = function (_a) {
1779
+ var screenSizes = _a.screenSizes, itemsPerSlide = _a.itemsPerSlide, isPartialVisible = _a.isPartialVisible, responsive = _a.responsive, children = _a.children;
1780
+ var responsiveConfig = responsive &&
1781
+ Object.keys(screenSizes).find(function (size) {
1782
+ return responsive && screenSizes[size] && responsive[size];
1783
+ });
1784
+ var slideConfig = responsiveConfig
1785
+ ? responsive[responsiveConfig]
1786
+ : { itemsPerSlide: itemsPerSlide, isPartialVisible: isPartialVisible };
1787
+ var totalItems = React__default.Children.count(children);
1788
+ var itemsPerView = slideConfig.itemsPerSlide > totalItems
1789
+ ? 1
1790
+ : Math.max(1, slideConfig.itemsPerSlide);
1791
+ var widthAdjustment = slideConfig.isPartialVisible ? 10 : 0;
1792
+ return (100 - widthAdjustment) / itemsPerView;
1793
+ };
1794
+
1795
+ var DotButton = function (_a) {
1796
+ var visibleSlideIndex = _a.visibleSlideIndex, scrollSnapIndex = _a.scrollSnapIndex, focusIndex = _a.focusIndex, onKeyDown = _a.onKeyDown, onClick = _a.onClick;
1797
+ var ref = useRef(null);
1798
+ var isSelected = visibleSlideIndex === scrollSnapIndex;
1799
+ useEffect(function () {
1800
+ var _a;
1801
+ if (focusIndex === scrollSnapIndex) {
1802
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
1803
+ }
1804
+ }, [focusIndex, scrollSnapIndex]);
1805
+ return (React__default.createElement("button", { ref: ref, tabIndex: scrollSnapIndex === 0 ? 0 : -1, className: classNames("arc-Carousel-dot", {
1806
+ "arc-Carousel-dot--selected": isSelected
1807
+ }), onKeyDown: onKeyDown(scrollSnapIndex), onClick: function () { return onClick(scrollSnapIndex); }, "aria-selected": isSelected, role: "tab", "aria-label": "Show slide ".concat(scrollSnapIndex + 1) }));
1808
+ };
1809
+
1810
+ var KeyNames;
1811
+ (function (KeyNames) {
1812
+ KeyNames["ArrowLeft"] = "ArrowLeft";
1813
+ KeyNames["ArrowRight"] = "ArrowRight";
1814
+ KeyNames["Escape"] = "Escape";
1815
+ })(KeyNames || (KeyNames = {}));
1816
+
1817
+ var Carousel = function (_a) {
1818
+ var children = _a.children, responsive = _a.responsive, _b = _a.itemsToScroll, itemsToScroll = _b === void 0 ? 1 : _b, _c = _a.itemsPerSlide, itemsPerSlide = _c === void 0 ? 1 : _c, _d = _a.withGutter, withGutter = _d === void 0 ? true : _d, _e = _a.loop, loop = _e === void 0 ? false : _e, _f = _a.isPartialVisible, isPartialVisible = _f === void 0 ? false : _f;
1819
+ var id = useId();
1820
+ var _g = useEmblaCarousel(getOptions(itemsToScroll, loop, responsive)), emblaRef = _g[0], emblaApi = _g[1];
1821
+ var _h = useState(), dotButtonFocusIndex = _h[0], setDotButtonFocusIndex = _h[1];
1822
+ var prevButtonRef = useRef(null);
1823
+ var _j = useState(0), visibleSlideIndex = _j[0], setVisibleSlideIndex = _j[1];
1824
+ var _k = useState(true), prevButtonEnabled = _k[0], setPrevButtonEnabled = _k[1];
1825
+ var _l = useState(true), nextButtonEnabled = _l[0], setNextButtonEnabled = _l[1];
1826
+ var isMinWidthArcBreakpointXs = useMediaQuery(XS_BREAKPOINT);
1827
+ var isMinWidthArcBreakpointS = useMediaQuery(S_BREAKPOINT);
1828
+ var isMinWidthArcBreakpointM = useMediaQuery(M_BREAKPOINT);
1829
+ var isMinWidthArcBreakpointL = useMediaQuery(L_BREAKPOINT);
1830
+ var isMinWidthArcBreakpointXl = useMediaQuery(XL_BREAKPOINT);
1831
+ var slideWidth = getSlideWidth({
1832
+ screenSizes: {
1833
+ xl: isMinWidthArcBreakpointXl,
1834
+ l: isMinWidthArcBreakpointL,
1835
+ m: isMinWidthArcBreakpointM,
1836
+ s: isMinWidthArcBreakpointS,
1837
+ xs: isMinWidthArcBreakpointXs
1838
+ },
1839
+ itemsPerSlide: itemsPerSlide,
1840
+ isPartialVisible: isPartialVisible,
1841
+ responsive: responsive,
1842
+ children: children
1843
+ });
1844
+ var scrollSnaps = Array.from({
1845
+ length: (emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollSnapList().length) || 0
1846
+ }).map(function (_, i) { return i; });
1847
+ var scrollPrev = useCallback(function () { return emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollPrev(); }, [emblaApi]);
1848
+ var scrollNext = useCallback(function () { return emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.scrollNext(); }, [emblaApi]);
1849
+ var onSelect = useCallback(function (emblaApi) {
1850
+ setVisibleSlideIndex(emblaApi.selectedScrollSnap());
1851
+ setPrevButtonEnabled(emblaApi.canScrollPrev());
1852
+ setNextButtonEnabled(emblaApi.canScrollNext());
1853
+ }, []);
1854
+ var onDotButtonClick = useCallback(function (index) {
1855
+ if (!emblaApi)
1856
+ return;
1857
+ emblaApi.scrollTo(index);
1858
+ }, [emblaApi]);
1859
+ var onSlideKeyDown = function (e) {
1860
+ var _a;
1861
+ if (e.key === KeyNames.Escape) {
1862
+ prevButtonEnabled
1863
+ ? (_a = prevButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus()
1864
+ : setDotButtonFocusIndex(0);
1865
+ }
1866
+ };
1867
+ var onDotButtonKeyDown = function (index) { return function (e) {
1868
+ if (e.key === KeyNames.ArrowLeft) {
1869
+ setDotButtonFocusIndex(index === 0 ? scrollSnaps.length - 1 : index - 1);
1870
+ }
1871
+ if (e.key === KeyNames.ArrowRight) {
1872
+ setDotButtonFocusIndex(index + 1 === scrollSnaps.length ? 0 : index + 1);
1873
+ }
1874
+ }; };
1875
+ useEffect(function () {
1876
+ if (!emblaApi)
1877
+ return;
1878
+ onSelect(emblaApi);
1879
+ emblaApi.on("reInit", onSelect).on("select", onSelect);
1880
+ }, [emblaApi, onSelect]);
1881
+ useEffect(function () {
1882
+ if (!emblaApi)
1883
+ return;
1884
+ emblaApi.scrollTo(0);
1885
+ }, [
1886
+ emblaApi,
1887
+ isMinWidthArcBreakpointXs,
1888
+ isMinWidthArcBreakpointS,
1889
+ isMinWidthArcBreakpointM,
1890
+ isMinWidthArcBreakpointL,
1891
+ isMinWidthArcBreakpointXl,
1892
+ ]);
1893
+ return (React__default.createElement("div", { className: "arc-Carousel" },
1894
+ React__default.createElement("div", { className: "arc-Carousel-container" },
1895
+ React__default.createElement("div", { ref: emblaRef, className: classNames("arc-Carousel-viewport", {
1896
+ "arc-Carousel-viewport--gutter": withGutter
1897
+ }) },
1898
+ React__default.createElement("div", { className: "arc-Carousel-slider", role: "region", "aria-roledescription": "carousel" }, React__default.Children.map(children, function (child, i) { return (React__default.createElement("div", { onKeyDown: onSlideKeyDown, style: { flex: "0 0 ".concat(slideWidth, "%"), width: "".concat(slideWidth, "%") }, className: "arc-Carousel-slide", key: "".concat(id, "-option-").concat(i), role: "group", "aria-roledescription": "slide" }, child)); })))),
1899
+ React__default.createElement("div", { className: "arc-Carousel-nav" },
1900
+ React__default.createElement("button", { "data-testid": "previous-button", ref: prevButtonRef, className: classNames("arc-Carousel-navButton", {
1901
+ "arc-Carousel-navButton--hidden": !prevButtonEnabled
1902
+ }), onClick: scrollPrev, "aria-label": "Show slide ".concat(visibleSlideIndex) },
1903
+ React__default.createElement(ThemeIcon, { size: 32, icon: "carouselLeft" })),
1904
+ React__default.createElement("div", { className: "arc-Carousel-dotContainer", role: "tablist" }, scrollSnaps.map(function (scrollSnapIndex) { return (React__default.createElement(DotButton, { key: "".concat(id, "-dot-").concat(scrollSnapIndex), focusIndex: dotButtonFocusIndex, scrollSnapIndex: scrollSnapIndex, visibleSlideIndex: visibleSlideIndex, onKeyDown: onDotButtonKeyDown, onClick: function (index) { return onDotButtonClick(index); } })); })),
1905
+ React__default.createElement("button", { "data-testid": "next-button", className: classNames("arc-Carousel-navButton", {
1906
+ "arc-Carousel-navButton--hidden": !nextButtonEnabled
1907
+ }), onClick: scrollNext, "aria-label": "Show slide ".concat(loop && visibleSlideIndex === scrollSnaps.length - 1
1908
+ ? 1
1909
+ : visibleSlideIndex + 2) },
1910
+ React__default.createElement(ThemeIcon, { size: 32, icon: "carouselRight" })))));
1911
+ };
1912
+
1913
+ export { Carousel };