@anker-in/headless-ui 1.1.83 → 1.1.84-alpha.1776249522021

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 (379) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
  3. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
  4. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  5. package/dist/cjs/biz-components/ActiveShelf/index.js.map +3 -3
  6. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  7. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
  8. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  9. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  13. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  14. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  15. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  16. package/dist/cjs/biz-components/Category/index.js +1 -1
  17. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  18. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  19. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  20. package/dist/cjs/biz-components/EventSchedule/index.d.ts +2 -7
  21. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  22. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  24. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  25. package/dist/cjs/biz-components/Faq/types.d.ts +1 -0
  26. package/dist/cjs/biz-components/Faq/types.js +1 -1
  27. package/dist/cjs/biz-components/Faq/types.js.map +1 -1
  28. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  29. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  30. package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  31. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js +1 -1
  32. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  33. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  34. package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
  35. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  36. package/dist/cjs/biz-components/GiftShelf/index.js.map +3 -3
  37. package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
  38. package/dist/cjs/biz-components/GiftTierShelf/index.js.map +3 -3
  39. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  40. package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
  41. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  42. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  43. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  44. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  45. package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +3 -3
  46. package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
  47. package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +3 -3
  48. package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +4 -0
  49. package/dist/cjs/biz-components/ImageTextOverlay/index.js +2 -0
  50. package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +7 -0
  51. package/dist/cjs/biz-components/ImageTextOverlay/types.d.ts +58 -0
  52. package/dist/cjs/biz-components/ImageTextOverlay/types.js +2 -0
  53. package/dist/cjs/biz-components/ImageTextOverlay/types.js.map +7 -0
  54. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  55. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  56. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  57. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  58. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  59. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  60. package/dist/cjs/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  61. package/dist/cjs/biz-components/LotteryShared/BaseModal.js +2 -0
  62. package/dist/cjs/biz-components/LotteryShared/BaseModal.js.map +7 -0
  63. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  64. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js +2 -0
  65. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  66. package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  67. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js +2 -0
  68. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  69. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  70. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  71. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  72. package/dist/cjs/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  73. package/dist/cjs/biz-components/LotteryShared/PrizePool.js +2 -0
  74. package/dist/cjs/biz-components/LotteryShared/PrizePool.js.map +7 -0
  75. package/dist/cjs/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  76. package/dist/cjs/biz-components/LotteryShared/RulesModal.js +2 -0
  77. package/dist/cjs/biz-components/LotteryShared/RulesModal.js.map +7 -0
  78. package/dist/cjs/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  79. package/dist/cjs/biz-components/LotteryShared/ShareModal.js +2 -0
  80. package/dist/cjs/biz-components/LotteryShared/ShareModal.js.map +7 -0
  81. package/dist/cjs/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  82. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js +2 -0
  83. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  84. package/dist/cjs/biz-components/LotteryShared/index.d.ts +23 -0
  85. package/dist/cjs/biz-components/LotteryShared/index.js +2 -0
  86. package/dist/cjs/biz-components/LotteryShared/index.js.map +7 -0
  87. package/dist/cjs/biz-components/LotteryShared/types.d.ts +760 -0
  88. package/dist/cjs/biz-components/LotteryShared/types.js +2 -0
  89. package/dist/cjs/biz-components/LotteryShared/types.js.map +7 -0
  90. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  91. package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
  92. package/dist/cjs/biz-components/Marquee/type.d.ts +5 -2
  93. package/dist/cjs/biz-components/Marquee/type.js.map +1 -1
  94. package/dist/cjs/biz-components/Media/index.d.ts +15 -3
  95. package/dist/cjs/biz-components/Media/index.js +1 -1
  96. package/dist/cjs/biz-components/Media/index.js.map +3 -3
  97. package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
  98. package/dist/cjs/biz-components/MediaEndorsement/index.js.map +2 -2
  99. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  100. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
  101. package/dist/cjs/biz-components/MediaShelf/index.d.ts +2 -2
  102. package/dist/cjs/biz-components/MediaShelf/index.js +1 -1
  103. package/dist/cjs/biz-components/MediaShelf/index.js.map +3 -3
  104. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  105. package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
  106. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  107. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  108. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  109. package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
  110. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  111. package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
  112. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  113. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  114. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  115. package/dist/cjs/biz-components/ProductLottery/index.d.ts +17 -0
  116. package/dist/cjs/biz-components/ProductLottery/index.js +2 -0
  117. package/dist/cjs/biz-components/ProductLottery/index.js.map +7 -0
  118. package/dist/cjs/biz-components/ProductLottery/types.d.ts +363 -0
  119. package/dist/cjs/biz-components/ProductLottery/types.js +2 -0
  120. package/dist/cjs/biz-components/ProductLottery/types.js.map +7 -0
  121. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  122. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  123. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  124. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  125. package/dist/cjs/biz-components/SceneShelfV2/index.d.ts +88 -0
  126. package/dist/cjs/biz-components/SceneShelfV2/index.js +2 -0
  127. package/dist/cjs/biz-components/SceneShelfV2/index.js.map +7 -0
  128. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.d.ts +80 -0
  129. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +2 -0
  130. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
  131. package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +76 -0
  132. package/dist/cjs/biz-components/SceneShelfV3/index.js +2 -0
  133. package/dist/cjs/biz-components/SceneShelfV3/index.js.map +7 -0
  134. package/dist/cjs/biz-components/SceneShelfV3/types.d.ts +19 -0
  135. package/dist/cjs/biz-components/SceneShelfV3/types.js +2 -0
  136. package/dist/cjs/biz-components/SceneShelfV3/types.js.map +7 -0
  137. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  138. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  139. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  140. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  141. package/dist/cjs/biz-components/Specs/index.js +1 -1
  142. package/dist/cjs/biz-components/Specs/index.js.map +3 -3
  143. package/dist/cjs/biz-components/Subscribe/index.js +1 -1
  144. package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
  145. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  146. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  147. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  148. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  149. package/dist/cjs/biz-components/Tabs/types.d.ts +3 -0
  150. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  151. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  152. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  153. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  154. package/dist/cjs/biz-components/Title/index.js +1 -1
  155. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  156. package/dist/cjs/biz-components/Title/types.d.ts +48 -1
  157. package/dist/cjs/biz-components/Title/types.js +1 -1
  158. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  159. package/dist/cjs/biz-components/WebPushPopup/index.d.ts +44 -0
  160. package/dist/cjs/biz-components/WebPushPopup/index.js +2 -0
  161. package/dist/cjs/biz-components/WebPushPopup/index.js.map +7 -0
  162. package/dist/cjs/biz-components/WheelLottery/index.d.ts +11 -11
  163. package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
  164. package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
  165. package/dist/cjs/biz-components/WheelLottery/types.d.ts +17 -723
  166. package/dist/cjs/biz-components/WheelLottery/types.js +1 -1
  167. package/dist/cjs/biz-components/WheelLottery/types.js.map +3 -3
  168. package/dist/cjs/biz-components/index.d.ts +13 -0
  169. package/dist/cjs/biz-components/index.js +1 -1
  170. package/dist/cjs/biz-components/index.js.map +3 -3
  171. package/dist/cjs/components/Countdown.js +1 -1
  172. package/dist/cjs/components/Countdown.js.map +3 -3
  173. package/dist/cjs/components/link.js +1 -1
  174. package/dist/cjs/components/link.js.map +2 -2
  175. package/dist/cjs/helpers/index.d.ts +1 -1
  176. package/dist/cjs/helpers/index.js +1 -1
  177. package/dist/cjs/helpers/index.js.map +2 -2
  178. package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
  179. package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
  180. package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
  181. package/dist/cjs/hooks/useEmarsysWebPush.d.ts +111 -0
  182. package/dist/cjs/hooks/useEmarsysWebPush.js +2 -0
  183. package/dist/cjs/hooks/useEmarsysWebPush.js.map +7 -0
  184. package/dist/cjs/hooks/useGridRowCount.d.ts +16 -0
  185. package/dist/cjs/hooks/useGridRowCount.js +2 -0
  186. package/dist/cjs/hooks/useGridRowCount.js.map +7 -0
  187. package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
  188. package/dist/cjs/hooks/useProductListTrack.js +2 -0
  189. package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
  190. package/dist/cjs/types/props.d.ts +16 -0
  191. package/dist/cjs/types/props.js +1 -1
  192. package/dist/cjs/types/props.js.map +1 -1
  193. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  194. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  195. package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
  196. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  197. package/dist/esm/biz-components/ActiveShelf/index.js.map +3 -3
  198. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  199. package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
  200. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  201. package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
  202. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  203. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  204. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  205. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  206. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  207. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  208. package/dist/esm/biz-components/Category/index.js +1 -1
  209. package/dist/esm/biz-components/Category/index.js.map +3 -3
  210. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  211. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  212. package/dist/esm/biz-components/EventSchedule/index.d.ts +2 -7
  213. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  214. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  215. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  216. package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
  217. package/dist/esm/biz-components/Faq/types.d.ts +1 -0
  218. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  219. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  220. package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  221. package/dist/esm/biz-components/FeaturedBlogPosts/index.js +1 -1
  222. package/dist/esm/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  223. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  224. package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
  225. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  226. package/dist/esm/biz-components/GiftShelf/index.js.map +3 -3
  227. package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
  228. package/dist/esm/biz-components/GiftTierShelf/index.js.map +3 -3
  229. package/dist/esm/biz-components/Graphic/index.js +1 -1
  230. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  231. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  232. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  233. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  234. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  235. package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +3 -3
  236. package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
  237. package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +3 -3
  238. package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +4 -0
  239. package/dist/esm/biz-components/ImageTextOverlay/index.js +2 -0
  240. package/dist/esm/biz-components/ImageTextOverlay/index.js.map +7 -0
  241. package/dist/esm/biz-components/ImageTextOverlay/types.d.ts +58 -0
  242. package/dist/esm/biz-components/ImageTextOverlay/types.js +1 -0
  243. package/dist/esm/biz-components/ImageTextOverlay/types.js.map +7 -0
  244. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  245. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  246. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  247. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  248. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  249. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  250. package/dist/esm/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  251. package/dist/esm/biz-components/LotteryShared/BaseModal.js +2 -0
  252. package/dist/esm/biz-components/LotteryShared/BaseModal.js.map +7 -0
  253. package/dist/esm/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  254. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js +2 -0
  255. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  256. package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  257. package/dist/esm/biz-components/LotteryShared/ErrorModal.js +2 -0
  258. package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  259. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  260. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  261. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  262. package/dist/esm/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  263. package/dist/esm/biz-components/LotteryShared/PrizePool.js +2 -0
  264. package/dist/esm/biz-components/LotteryShared/PrizePool.js.map +7 -0
  265. package/dist/esm/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  266. package/dist/esm/biz-components/LotteryShared/RulesModal.js +2 -0
  267. package/dist/esm/biz-components/LotteryShared/RulesModal.js.map +7 -0
  268. package/dist/esm/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  269. package/dist/esm/biz-components/LotteryShared/ShareModal.js +2 -0
  270. package/dist/esm/biz-components/LotteryShared/ShareModal.js.map +7 -0
  271. package/dist/esm/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  272. package/dist/esm/biz-components/LotteryShared/WinnerModal.js +2 -0
  273. package/dist/esm/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  274. package/dist/esm/biz-components/LotteryShared/index.d.ts +23 -0
  275. package/dist/esm/biz-components/LotteryShared/index.js +2 -0
  276. package/dist/esm/biz-components/LotteryShared/index.js.map +7 -0
  277. package/dist/esm/biz-components/LotteryShared/types.d.ts +760 -0
  278. package/dist/esm/biz-components/LotteryShared/types.js +2 -0
  279. package/dist/esm/biz-components/LotteryShared/types.js.map +7 -0
  280. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  281. package/dist/esm/biz-components/Marquee/Marquee.js.map +3 -3
  282. package/dist/esm/biz-components/Marquee/type.d.ts +5 -2
  283. package/dist/esm/biz-components/Media/index.d.ts +15 -3
  284. package/dist/esm/biz-components/Media/index.js +1 -1
  285. package/dist/esm/biz-components/Media/index.js.map +3 -3
  286. package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
  287. package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
  288. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  289. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  290. package/dist/esm/biz-components/MediaShelf/index.d.ts +2 -2
  291. package/dist/esm/biz-components/MediaShelf/index.js +1 -1
  292. package/dist/esm/biz-components/MediaShelf/index.js.map +3 -3
  293. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  294. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  295. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  296. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  297. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  298. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  299. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  300. package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
  301. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  302. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  303. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  304. package/dist/esm/biz-components/ProductLottery/index.d.ts +17 -0
  305. package/dist/esm/biz-components/ProductLottery/index.js +2 -0
  306. package/dist/esm/biz-components/ProductLottery/index.js.map +7 -0
  307. package/dist/esm/biz-components/ProductLottery/types.d.ts +363 -0
  308. package/dist/esm/biz-components/ProductLottery/types.js +2 -0
  309. package/dist/esm/biz-components/ProductLottery/types.js.map +7 -0
  310. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  311. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  312. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  313. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  314. package/dist/esm/biz-components/SceneShelfV2/index.d.ts +88 -0
  315. package/dist/esm/biz-components/SceneShelfV2/index.js +2 -0
  316. package/dist/esm/biz-components/SceneShelfV2/index.js.map +7 -0
  317. package/dist/esm/biz-components/SceneShelfV3/ProductCard.d.ts +80 -0
  318. package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +2 -0
  319. package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
  320. package/dist/esm/biz-components/SceneShelfV3/index.d.ts +76 -0
  321. package/dist/esm/biz-components/SceneShelfV3/index.js +2 -0
  322. package/dist/esm/biz-components/SceneShelfV3/index.js.map +7 -0
  323. package/dist/esm/biz-components/SceneShelfV3/types.d.ts +19 -0
  324. package/dist/esm/biz-components/SceneShelfV3/types.js +1 -0
  325. package/dist/esm/biz-components/SceneShelfV3/types.js.map +7 -0
  326. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  327. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  328. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  329. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  330. package/dist/esm/biz-components/Specs/index.js +1 -1
  331. package/dist/esm/biz-components/Specs/index.js.map +3 -3
  332. package/dist/esm/biz-components/Subscribe/index.js +1 -1
  333. package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
  334. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  335. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  336. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  337. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  338. package/dist/esm/biz-components/Tabs/types.d.ts +3 -0
  339. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  340. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  341. package/dist/esm/biz-components/Title/index.js +1 -1
  342. package/dist/esm/biz-components/Title/index.js.map +3 -3
  343. package/dist/esm/biz-components/Title/types.d.ts +48 -1
  344. package/dist/esm/biz-components/WebPushPopup/index.d.ts +44 -0
  345. package/dist/esm/biz-components/WebPushPopup/index.js +2 -0
  346. package/dist/esm/biz-components/WebPushPopup/index.js.map +7 -0
  347. package/dist/esm/biz-components/WheelLottery/index.d.ts +11 -11
  348. package/dist/esm/biz-components/WheelLottery/index.js +1 -1
  349. package/dist/esm/biz-components/WheelLottery/index.js.map +3 -3
  350. package/dist/esm/biz-components/WheelLottery/types.d.ts +17 -723
  351. package/dist/esm/biz-components/WheelLottery/types.js +1 -1
  352. package/dist/esm/biz-components/WheelLottery/types.js.map +3 -3
  353. package/dist/esm/biz-components/index.d.ts +13 -0
  354. package/dist/esm/biz-components/index.js +1 -1
  355. package/dist/esm/biz-components/index.js.map +3 -3
  356. package/dist/esm/components/Countdown.js +1 -1
  357. package/dist/esm/components/Countdown.js.map +3 -3
  358. package/dist/esm/components/link.js +1 -1
  359. package/dist/esm/components/link.js.map +2 -2
  360. package/dist/esm/helpers/index.d.ts +1 -1
  361. package/dist/esm/helpers/index.js +1 -1
  362. package/dist/esm/helpers/index.js.map +3 -3
  363. package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
  364. package/dist/esm/helpers/isLexicalEmpty.js +1 -1
  365. package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
  366. package/dist/esm/hooks/useEmarsysWebPush.d.ts +111 -0
  367. package/dist/esm/hooks/useEmarsysWebPush.js +2 -0
  368. package/dist/esm/hooks/useEmarsysWebPush.js.map +7 -0
  369. package/dist/esm/hooks/useGridRowCount.d.ts +16 -0
  370. package/dist/esm/hooks/useGridRowCount.js +2 -0
  371. package/dist/esm/hooks/useGridRowCount.js.map +7 -0
  372. package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
  373. package/dist/esm/hooks/useProductListTrack.js +2 -0
  374. package/dist/esm/hooks/useProductListTrack.js.map +7 -0
  375. package/dist/esm/types/props.d.ts +16 -0
  376. package/package.json +4 -2
  377. package/static/emarsys-service-worker.js +31 -0
  378. package/style.css +208 -5
  379. package/tailwind.config.js +11 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
- "mappings": "aAyMc,cAAAA,MAAA,oBAvMd,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAuB,yBAC9B,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,cAAAC,MAAkB,yBAW3B,MAAMC,EAA2BJ,EAC/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pF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,UAAWxC,EACTM,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BgB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBhB,GAAY,IACd,EAEC,SAAAW,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAZ,EAAiB,YAAc,mBAC/B,IAAO+B,EAAQrC,EAAWM,CAAgB",
6
- "names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "withLayout", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'copy'\nconst componentName = 'anchor_navigation'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u66DD\u5149\u57CB\u70B9\n useExposure(rootRef, {\n componentType,\n componentName,\n componentTitle: '',\n componentDescription: '',\n })\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`##${item.label}`}\n data-headless-nav-position={`${item.label}#${index + 1}`}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
+ "mappings": "aAqNc,cAAAA,MAAA,oBAnNd,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAuB,yBAC9B,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAE5B,MAAMC,EAAgB,OAChBC,EAAgB,oBAWhBC,EAA2BP,EAC/B,4FACA,CACE,SAAU,CACR,UAAW,CACT,MAAO,uBACP,OAAQ,wBACR,IAAK,oBACP,EACA,KAAM,CACJ,MAAO,QACP,MAAO,OACT,CACF,EACA,gBAAiB,CACf,UAAW,QACX,KAAM,OACR,CACF,CACF,EAKMQ,EAAqBR,EACzB,oLACA,CACE,SAAU,CACR,KAAM,CACJ,MAAO,OACP,MAAO,MACT,CACF,EACA,gBAAiB,CACf,KAAM,OACR,CACF,CACF,EAKMS,EAAoBT,EAAI,6BAA8B,CAC1D,SAAU,CACR,MAAO,CACL,MAAO,WACP,KAAM,cACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAwDKU,EAA8C,CAClD,aAAc,iBACd,YAAa,iBACb,qBAAsB,kBACxB,EAGMC,EAA6C,CACjD,aAAc,iBACd,YAAa,aACb,qBAAsB,kBACxB,EAOMC,EAAmBd,EAAM,WAC7B,CA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 "names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "withLayout", "useExposure", "componentType", "componentName", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{forwardRef as b,useEffect as y,useRef as x,useState as L,useImperativeHandle as N}from"react";import{cn as a,getLocalizedPath as C}from"../../helpers/utils.js";import M from"../../components/picture.js";import{withLayout as S}from"../../shared/Styles.js";import{useMediaQuery as B}from"react-responsive";import{useExposure as A}from"../../hooks/useExposure.js";import{useAiuiContext as P}from"../AiuiProvider/index.js";import{Swiper as T,SwiperSlide as E}from"swiper/react";import{Pagination as I,FreeMode as j,Mousewheel as D}from"swiper/modules";import"../Title/index.js";import H from"../../components/link.js";const q="copy",z="store_benefits",R=(e,r)=>{const o=[];for(let i=0;i<e.length;i+=r)o.push(e.slice(i,i+r));return o},k=b(({data:{items:e=[],itemShape:r},className:o},i)=>{const[d,v]=L(!1),m=B({query:"(max-width: 768px)"}),c=x(null),p=x(null),{locale:u="us"}=P();N(i,()=>p.current),A(p,{componentType:q,componentName:z}),y(()=>{v(m)},[m]);const h=d?R(e,3):e;return t("div",{ref:p,className:a("brand-equity-wrapper w-full",o),children:d?s(T,{className:a(o),modules:[j,D,I],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:c.current},breakpoints:{0:{spaceBetween:12}},children:[h?.map((n,l)=>t(E,{className:"!flex flex-col gap-3",children:Array.isArray(n)&&n?.map((w,f)=>t(g,{data:w,itemShape:r,index:f,locale:u},f))},"SwiperSlide"+l)),t("div",{ref:c,className:"mt-3 flex justify-center"})]}):t("div",{className:a("laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3"),children:e.map((n,l)=>t(g,{data:n,itemShape:r,index:l,locale:u},l))})})}),g=({data:e,itemShape:r,index:o,locale:i})=>s("div",{className:a("brand-equity-item","lg-desktop:p-8 desktop:p-6 p-4","box-border flex w-full flex-col justify-between overflow-hidden bg-[#DAE7F2]",r==="round"?"rounded-box":"rounded-none"),children:[s("div",{className:"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3",children:[t("h3",{className:"link-item-title lg-desktop:text-[18px] desktop:text-[16px] line-clamp-2 flex-1 text-[14px] font-bold leading-[1.2] tracking-[-0.02em] text-[#080A0F]",children:e.title}),t("div",{className:"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0",children:t(M,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),s("div",{className:"box-border overflow-hidden",children:[t("p",{title:e.description||"",className:"link-item-description lg-desktop:text-[24px] line-clamp-4 text-[20px] font-semibold leading-[1.2] tracking-[-0.04em] text-[#767880]",children:e.description||""}),s(H,{href:C(e?.link||"",i),asChild:!e?.link,className:"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline",children:[t("span",{className:"link-item-text laptop:text-base text-sm",children:e?.linkText}),t("div",{className:"size-6",children:t("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:t("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})]});k.displayName="BrandCardLink";var Z=S(k);export{Z as default};
1
+ "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{forwardRef as N,useEffect as C,useRef as k,useState as M,useImperativeHandle as S}from"react";import{cn as p,getLocalizedPath as B}from"../../helpers/utils.js";import A from"../../components/picture.js";import{withLayout as P}from"../../shared/Styles.js";import{useMediaQuery as T}from"react-responsive";import{useExposure as D}from"../../hooks/useExposure.js";import{useAiuiContext as x}from"../AiuiProvider/index.js";import{trackUrlRef as E}from"../../shared/trackUrlRef.js";import{Swiper as I,SwiperSlide as j}from"swiper/react";import{Pagination as H,FreeMode as R,Mousewheel as q}from"swiper/modules";import"../Title/index.js";import z from"../../components/link.js";const g="copy",v="store_benefits",F=(e,r)=>{const o=[];for(let i=0;i<e.length;i+=r)o.push(e.slice(i,i+r));return o},h=N(({data:{items:e=[],itemShape:r},className:o},i)=>{const[n,b]=M(!1),m=T({query:"(max-width: 768px)"}),c=k(null),d=k(null),{locale:u="us",trackingData:_}=x();S(i,()=>d.current),D(d,{componentType:g,componentName:v}),C(()=>{b(m)},[m]);const y=n?F(e,3):e;return t("div",{ref:d,className:p("brand-equity-wrapper w-full",o),children:n?s(I,{className:p(o),modules:[R,q,H],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:c.current},breakpoints:{0:{spaceBetween:12}},children:[y?.map((a,l)=>t(j,{className:"!flex flex-col gap-3",children:Array.isArray(a)&&a?.map((L,f)=>t(w,{data:L,itemShape:r,index:f,locale:u},f))},"SwiperSlide"+l)),t("div",{ref:c,className:"mt-3 flex justify-center"})]}):t("div",{className:p("laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3"),children:e.map((a,l)=>t(w,{data:a,itemShape:r,index:l,locale:u},l))})})}),w=({data:e,itemShape:r,index:o,locale:i})=>{const{trackingData:n}=x();return s("div",{className:p("brand-equity-item","lg-desktop:p-8 desktop:p-6 p-4","box-border flex w-full flex-col justify-between overflow-hidden bg-[#DAE7F2]",r==="round"?"rounded-box":"rounded-none"),children:[s("div",{className:"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3",children:[t("h3",{className:"link-item-title lg-desktop:text-[18px] desktop:text-[16px] line-clamp-2 flex-1 text-[14px] font-bold leading-[1.2] tracking-[-0.02em] text-[#080A0F]",children:e.title}),t("div",{className:"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0",children:t(A,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),s("div",{className:"box-border overflow-hidden",children:[t("p",{title:e.description||"",className:"link-item-description lg-desktop:text-[24px] line-clamp-4 text-[20px] font-semibold leading-[1.2] tracking-[-0.04em] text-[#767880]",children:e.description||""}),s(z,{href:E(B(e?.link||"",i),`${n?.contextHandle||""}_${g}_${v}`),asChild:!e?.link,className:"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline",children:[t("span",{className:"link-item-text laptop:text-base text-sm",children:e?.linkText}),t("div",{className:"size-6",children:t("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:t("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})]})};h.displayName="BrandCardLink";var te=P(h);export{te as default};
2
2
  //# sourceMappingURL=BrandCardLink.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BrandCardLink/BrandCardLink.tsx"],
4
- "sourcesContent": ["'use client'\nimport { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { BrandCardLinkProps, BrandCardLinkItemProps } from './types.js'\n\nimport type { Img } from '../../types/props.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport Title from '../Title/index.js'\nimport Link from '../../components/link.js'\n\nconst componentType = 'copy'\nconst componentName = 'store_benefits'\n\nconst chunkArray = (arr: BrandCardLinkItemProps[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst BrandCardLink = forwardRef<HTMLDivElement, BrandCardLinkProps>(\n ({ data: { items = [], itemShape }, className }, ref) => {\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n const paginationRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef<HTMLDivElement>(null)\n const { locale = 'us' } = useAiuiContext()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const itemsArray = isMobile ? chunkArray(items, 3) : items\n return (\n <div ref={innerRef} className={cn('brand-equity-wrapper w-full', className)}>\n {isMobile ? (\n <Swiper\n className={cn(className)}\n modules={[FreeMode, Mousewheel, Pagination]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n },\n }}\n >\n {itemsArray?.map((item, jIndex) => (\n <SwiperSlide key={'SwiperSlide' + jIndex} className=\"!flex flex-col gap-3\">\n {Array.isArray(item) &&\n item?.map((item, index) => (\n <BrandCardLinkItem key={index} data={item} itemShape={itemShape} index={index} locale={locale} />\n ))}\n </SwiperSlide>\n ))}\n <div ref={paginationRef} className=\"mt-3 flex justify-center\"></div>\n </Swiper>\n ) : (\n <div className={cn('laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3')}>\n {items.map((item, index) => (\n <BrandCardLinkItem key={index} data={item} itemShape={itemShape} index={index} locale={locale} />\n ))}\n </div>\n )}\n </div>\n )\n }\n)\n\nconst BrandCardLinkItem = ({\n data,\n itemShape,\n index,\n locale,\n}: {\n data: BrandCardLinkItemProps\n itemShape?: 'round' | 'square'\n index: number\n locale: string\n}) => {\n return (\n <div\n className={cn(\n 'brand-equity-item',\n 'lg-desktop:p-8 desktop:p-6 p-4',\n // 'laptop:h-[192px] lg-desktop:h-[240px] h-[160px]',\n 'box-border flex w-full flex-col justify-between overflow-hidden bg-[#DAE7F2]',\n itemShape === 'round' ? 'rounded-box' : 'rounded-none'\n )}\n >\n <div className=\"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3\">\n <h3 className=\"link-item-title lg-desktop:text-[18px] desktop:text-[16px] line-clamp-2 flex-1 text-[14px] font-bold leading-[1.2] tracking-[-0.02em] text-[#080A0F]\">\n {data.title}\n </h3>\n <div className=\"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0\">\n <Picture\n className=\"size-full object-cover\"\n source={data.icon?.url}\n alt={data.icon?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n </div>\n <div className=\"box-border overflow-hidden\">\n <p\n title={data.description || ''}\n className=\"link-item-description lg-desktop:text-[24px] line-clamp-4 text-[20px] font-semibold leading-[1.2] tracking-[-0.04em] text-[#767880]\"\n >\n {data.description || ''}\n </p>\n <Link\n href={getLocalizedPath(data?.link || '', locale)}\n asChild={!data?.link}\n className=\"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline\"\n >\n <span className=\"link-item-text laptop:text-base text-sm\">{data?.linkText}</span>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </Link>\n </div>\n </div>\n )\n}\n\nBrandCardLink.displ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BACf,EACF,GACF,EACAzC,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,KACC,MAAO0C,EAAK,aAAe,GAC3B,UAAU,sIAET,SAAAA,EAAK,aAAe,GACvB,EACAzC,EAACkB,EAAA,CACC,KAAMX,EAAiBkC,GAAM,MAAQ,GAAIN,CAAM,EAC/C,QAAS,CAACM,GAAM,KAChB,UAAU,2EAEV,UAAA1C,EAAC,QAAK,UAAU,0CAA2C,SAAA0C,GAAM,SAAS,EAC1E1C,EAAC,OAAI,UAAU,SACb,SAAAA,EAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,YAAY,MACZ,cAAc,QACf,EACH,EACF,GACF,GACF,GACF,EAIJ0B,EAAc,YAAc,gBAE5B,IAAOiB,EAAQjC,EAAWgB,CAAa",
6
- "names": ["jsx", "jsxs", "forwardRef", "useEffect", "useRef", "useState", "useImperativeHandle", "cn", "getLocalizedPath", "Picture", "withLayout", "useMediaQuery", "useExposure", "useAiuiContext", "Swiper", "SwiperSlide", "Pagination", "FreeMode", "Mousewheel", "Link", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "BrandCardLink", "items", "itemShape", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "locale", "itemsArray", "item", "jIndex", "index", "BrandCardLinkItem", "data", "BrandCardLink_default"]
4
+ "sourcesContent": ["'use client'\nimport { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { BrandCardLinkProps, BrandCardLinkItemProps } from './types.js'\n\nimport type { Img } from '../../types/props.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport Title from '../Title/index.js'\nimport Link from '../../components/link.js'\n\nconst componentType = 'copy'\nconst componentName = 'store_benefits'\n\nconst chunkArray = (arr: BrandCardLinkItemProps[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst BrandCardLink = forwardRef<HTMLDivElement, BrandCardLinkProps>(\n ({ data: { items = [], itemShape }, className }, ref) => {\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n const paginationRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef<HTMLDivElement>(null)\n const { locale = 'us', trackingData } = useAiuiContext()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const itemsArray = isMobile ? chunkArray(items, 3) : items\n return (\n <div ref={innerRef} className={cn('brand-equity-wrapper w-full', className)}>\n {isMobile ? (\n <Swiper\n className={cn(className)}\n modules={[FreeMode, Mousewheel, Pagination]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n },\n }}\n >\n {itemsArray?.map((item, jIndex) => (\n <SwiperSlide key={'SwiperSlide' + jIndex} className=\"!flex flex-col gap-3\">\n {Array.isArray(item) &&\n item?.map((item, index) => (\n <BrandCardLinkItem key={index} data={item} itemShape={itemShape} index={index} locale={locale} />\n ))}\n </SwiperSlide>\n ))}\n <div ref={paginationRef} className=\"mt-3 flex justify-center\"></div>\n </Swiper>\n ) : (\n <div className={cn('laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3')}>\n {items.map((item, index) => (\n <BrandCardLinkItem key={index} data={item} itemShape={itemShape} index={index} locale={locale} />\n ))}\n </div>\n )}\n </div>\n )\n }\n)\n\nconst BrandCardLinkItem = ({\n data,\n itemShape,\n index,\n locale,\n}: {\n data: BrandCardLinkItemProps\n itemShape?: 'round' | 'square'\n index: number\n locale: string\n}) => {\n const { trackingData } = useAiuiContext()\n return (\n <div\n className={cn(\n 'brand-equity-item',\n 'lg-desktop:p-8 desktop:p-6 p-4',\n // 'laptop:h-[192px] lg-desktop:h-[240px] h-[160px]',\n 'box-border flex w-full flex-col justify-between overflow-hidden bg-[#DAE7F2]',\n itemShape === 'round' ? 'rounded-box' : 'rounded-none'\n )}\n >\n <div className=\"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3\">\n <h3 className=\"link-item-title lg-desktop:text-[18px] desktop:text-[16px] line-clamp-2 flex-1 text-[14px] font-bold leading-[1.2] tracking-[-0.02em] text-[#080A0F]\">\n {data.title}\n </h3>\n <div className=\"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0\">\n <Picture\n className=\"size-full object-cover\"\n source={data.icon?.url}\n alt={data.icon?.alt}\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n </div>\n <div className=\"box-border overflow-hidden\">\n <p\n title={data.description || ''}\n className=\"link-item-description lg-desktop:text-[24px] line-clamp-4 text-[20px] font-semibold leading-[1.2] tracking-[-0.04em] text-[#767880]\"\n >\n {data.description || ''}\n </p>\n <Link\n href={trackUrlRef(\n getLocalizedPath(data?.link || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n asChild={!data?.link}\n className=\"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline\"\n >\n <span className=\"link-item-text laptop:text-base text-sm\">{data?.linkText}</span>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </Link>\n </div>\n </div>\n )\n}\n\nBrandCardLink.displayName = 'BrandCardLink'\n\nexport default withLayout(BrandCardLink)\n"],
5
+ "mappings": "aAoDU,OAqBU,OAAAA,EArBV,QAAAC,MAAA,oBAnDV,OAAS,cAAAC,EAAY,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,EAAU,uBAAAC,MAA2B,QAE7E,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAOC,MAAa,8BACpB,OAAS,cAAAC,MAAkB,yBAI3B,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,eAAAC,MAAmB,8BAE5B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,YAAAC,EAAU,cAAAC,MAAkB,iBACjD,MAAkB,oBAClB,OAAOC,MAAU,2BAEjB,MAAMC,EAAgB,OAChBC,EAAgB,iBAEhBC,EAAa,CAACC,EAA+BC,IAAiB,CAClE,MAAMC,EAAS,CAAC,EAChB,QAAS,EAAI,EAAG,EAAIF,EAAI,OAAQ,GAAKC,EACnCC,EAAO,KAAKF,EAAI,MAAM,EAAG,EAAIC,CAAI,CAAC,EAEpC,OAAOC,CACT,EAEMC,EAAgBzB,EACpB,CAAC,CAAE,KAAM,CAAE,MAAA0B,EAAQ,CAAC,EAAG,UAAAC,CAAU,EAAG,UAAAC,CAAU,EAAGC,IAAQ,CACvD,KAAM,CAACC,EAAUC,CAAW,EAAI5B,EAAS,EAAK,EACxC6B,EAAavB,EAAc,CAAE,MAAO,oBAAqB,CAAC,EAC1DwB,EAAgB/B,EAAuB,IAAI,EAC3CgC,EAAWhC,EAAuB,IAAI,EACtC,CAAE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AC,OACC,UAAWM,EACT,oBACA,iCAEA,+EACAsB,IAAc,QAAU,cAAgB,cAC1C,EAEA,UAAA5B,EAAC,OAAI,UAAU,mEACb,UAAAD,EAAC,MAAG,UAAU,uJACX,SAAA4C,EAAK,MACR,EACA5C,EAAC,OAAI,UAAU,4DACb,SAAAA,EAACS,EAAA,CACC,UAAU,yBACV,OAAQmC,EAAK,MAAM,IACnB,IAAKA,EAAK,MAAM,IAChB,aAAa,6BACf,EACF,GACF,EACA3C,EAAC,OAAI,UAAU,6BACb,UAAAD,EAAC,KACC,MAAO4C,EAAK,aAAe,GAC3B,UAAU,sIAET,SAAAA,EAAK,aAAe,GACvB,EACA3C,EAACmB,EAAA,CACC,KAAMN,EACJN,EAAiBoC,GAAM,MAAQ,GAAIP,CAAM,EACzC,GAAGC,GAAc,eAAiB,EAAE,IAAIjB,CAAa,IAAIC,CAAa,EACxE,EACA,QAAS,CAACsB,GAAM,KAChB,UAAU,2EAEV,UAAA5C,EAAC,QAAK,UAAU,0CAA2C,SAAA4C,GAAM,SAAS,EAC1E5C,EAAC,OAAI,UAAU,SACb,SAAAA,EAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,YAAY,MACZ,cAAc,QACf,EACH,EACF,GACF,GACF,GACF,CAEJ,EAEA2B,EAAc,YAAc,gBAE5B,IAAOkB,GAAQnC,EAAWiB,CAAa",
6
+ "names": ["jsx", "jsxs", "forwardRef", "useEffect", "useRef", "useState", "useImperativeHandle", "cn", "getLocalizedPath", "Picture", "withLayout", "useMediaQuery", "useExposure", "useAiuiContext", "trackUrlRef", "Swiper", "SwiperSlide", "Pagination", "FreeMode", "Mousewheel", "Link", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "BrandCardLink", "items", "itemShape", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "locale", "trackingData", "itemsArray", "item", "jIndex", "index", "BrandCardLinkItem", "data", "BrandCardLink_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as r,jsxs as u}from"react/jsx-runtime";import p from"react";import{Swiper as d,SwiperSlide as f}from"swiper/react";import{Pagination as w,FreeMode as c,Mousewheel as m}from"swiper/modules";import"swiper/css";import"swiper/css/pagination";const a=p.forwardRef(({data:e,Slide:n,id:i,isHalf:s,paginationClassName:t},g)=>u(d,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1,el:`.swiper-pagination-${i}`},className:`!overflow-visible ${t||""}`,modules:[c,m,w],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:s?2:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:s?2:1,slidesPerGroup:1},767:{spaceBetween:16,freeMode:!1,slidesPerView:4,slidesPerGroup:4},1441:{spaceBetween:16,freeMode:!1,slidesPerView:Math.min(6,e?.list?.length),slidesPerGroup:Math.min(6,e?.list?.length)}},children:[e?.list?.map((l,o)=>r(f,{className:"!h-[unset]",children:r(n,{data:l,configuration:{...e?.configuration,index:o}})},i+"SwiperSlide"+o)),r("div",{className:`swiper-pagination-${i} swiper-pagination`})]}));a.displayName="SwiperBox";var b=a;export{b as default};
1
+ "use client";import{jsx as i,jsxs as B}from"react/jsx-runtime";import c,{useState as u,useEffect as w}from"react";import{Swiper as m,SwiperSlide as g}from"swiper/react";import{Pagination as S,FreeMode as M,Mousewheel as P}from"swiper/modules";import"swiper/css";import"swiper/css/pagination";const t=c.forwardRef(({data:e,Slide:a,id:s,isHalf:r,paginationClassName:n},l)=>{const[p,f]=u(!1);return w(()=>{f(!0)},[]),p?B(m,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1,el:`.swiper-pagination-${s}`},className:`!overflow-visible ${n||""}`,modules:[M,P,S],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:r?2:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:r?2:1,slidesPerGroup:1},767:{spaceBetween:16,freeMode:!1,slidesPerView:4,slidesPerGroup:4},1441:{spaceBetween:16,freeMode:!1,slidesPerView:Math.min(6,e?.list?.length),slidesPerGroup:Math.min(6,e?.list?.length)}},children:[e?.list?.map((d,o)=>i(g,{className:"!h-[unset]",children:i(a,{data:d,configuration:{...e?.configuration,index:o}})},s+"SwiperSlide"+o)),i("div",{className:`swiper-pagination-${s} swiper-pagination`})]}):i("div",{ref:l})});t.displayName="SwiperBox";var N=t;export{N as default};
2
2
  //# sourceMappingURL=SwiperCategory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/SwiperCategory.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/pagination' // \u5206\u9875\u5668\u6837\u5F0F\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n }\n id: string\n className?: string\n isHalf?: boolean\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any }>\n /** \u81EA\u5B9A\u4E49 pagination \u6837\u5F0F\u7C7B\u540D */\n paginationClassName?: string\n}\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(\n ({ data, Slide, id, isHalf, paginationClassName }, ref) => {\n return (\n <Swiper\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n dynamicBullets: false,\n el: `.swiper-pagination-${id}`,\n }}\n className={`!overflow-visible ${paginationClassName || ''}`}\n modules={[FreeMode, Mousewheel, Pagination]}\n breakpoints={{\n 0: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: isHalf ? 2 : 1,\n slidesPerGroup: 1,\n },\n 376: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: isHalf ? 2 : 1,\n slidesPerGroup: 1,\n },\n 767: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n 1441: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: Math.min(6, data?.list?.length),\n slidesPerGroup: Math.min(6, data?.list?.length),\n },\n }}\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!h-[unset]\">\n <Slide data={item} configuration={{ ...data?.configuration, index: jIndex }} />\n </SwiperSlide>\n ))}\n <div className={`swiper-pagination-${id} swiper-pagination`} />\n </Swiper>\n )\n }\n)\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
- "mappings": "aAwBM,OAyCM,OAAAA,EAzCN,QAAAC,MAAA,oBAvBN,OAAOC,MAAW,QAClB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,YAAAC,EAAU,cAAAC,MAAkB,iBACjD,MAAO,aACP,MAAO,wBAgBP,MAAMC,EAAYN,EAAM,WACtB,CAAC,CAAE,KAAAO,EAAM,MAAAC,EAAO,GAAAC,EAAI,OAAAC,EAAQ,oBAAAC,CAAoB,EAAGC,IAE/Cb,EAACE,EAAA,CACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,GAChB,GAAI,sBAAsBQ,CAAE,EAC9B,EACA,UAAW,qBAAqBE,GAAuB,EAAE,GACzD,QAAS,CAACP,EAAUC,EAAYF,CAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAeO,EAAS,EAAI,EAC5B,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAS,EAAI,EAC5B,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,KAAK,IAAI,EAAGH,GAAM,MAAM,MAAM,EAC7C,eAAgB,KAAK,IAAI,EAAGA,GAAM,MAAM,MAAM,CAChD,CACF,EAEC,UAAAA,GAAM,MAAM,IAAI,CAACM,EAAMC,IACtBhB,EAACI,EAAA,CAA8C,UAAU,aACvD,SAAAJ,EAACU,EAAA,CAAM,KAAMK,EAAM,cAAe,CAAE,GAAGN,GAAM,cAAe,MAAOO,CAAO,EAAG,GAD7DL,EAAK,cAAgBK,CAEvC,CACD,EACDhB,EAAC,OAAI,UAAW,qBAAqBW,CAAE,qBAAsB,GAC/D,CAGN,EAEAH,EAAU,YAAc,YAExB,IAAOS,EAAQT",
6
- "names": ["jsx", "jsxs", "React", "Swiper", "SwiperSlide", "Pagination", "FreeMode", "Mousewheel", "SwiperBox", "data", "Slide", "id", "isHalf", "paginationClassName", "ref", "item", "jIndex", "SwiperCategory_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect } from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/pagination' // \u5206\u9875\u5668\u6837\u5F0F\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n }\n id: string\n className?: string\n isHalf?: boolean\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any }>\n /** \u81EA\u5B9A\u4E49 pagination \u6837\u5F0F\u7C7B\u540D */\n paginationClassName?: string\n}\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(\n ({ data, Slide, id, isHalf, paginationClassName }, ref) => {\n const [isMounted, setIsMounted] = useState(false)\n\n useEffect(() => {\n setIsMounted(true)\n }, [])\n\n if (!isMounted) {\n return <div ref={ref as React.Ref<HTMLDivElement>} />\n }\n\n return (\n <Swiper\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n dynamicBullets: false,\n el: `.swiper-pagination-${id}`,\n }}\n className={`!overflow-visible ${paginationClassName || ''}`}\n modules={[FreeMode, Mousewheel, Pagination]}\n breakpoints={{\n 0: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: isHalf ? 2 : 1,\n slidesPerGroup: 1,\n },\n 376: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: isHalf ? 2 : 1,\n slidesPerGroup: 1,\n },\n 767: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n 1441: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: Math.min(6, data?.list?.length),\n slidesPerGroup: Math.min(6, data?.list?.length),\n },\n }}\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!h-[unset]\">\n <Slide data={item} configuration={{ ...data?.configuration, index: jIndex }} />\n </SwiperSlide>\n ))}\n <div className={`swiper-pagination-${id} swiper-pagination`} />\n </Swiper>\n )\n }\n)\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
+ "mappings": "aA8Ba,cAAAA,EAIP,QAAAC,MAJO,oBA7Bb,OAAOC,GAAS,YAAAC,EAAU,aAAAC,MAAiB,QAC3C,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,YAAAC,EAAU,cAAAC,MAAkB,iBACjD,MAAO,aACP,MAAO,wBAgBP,MAAMC,EAAYR,EAAM,WACtB,CAAC,CAAE,KAAAS,EAAM,MAAAC,EAAO,GAAAC,EAAI,OAAAC,EAAQ,oBAAAC,CAAoB,EAAGC,IAAQ,CACzD,KAAM,CAACC,EAAWC,CAAY,EAAIf,EAAS,EAAK,EAMhD,OAJAC,EAAU,IAAM,CACdc,EAAa,EAAI,CACnB,EAAG,CAAC,CAAC,EAEAD,EAKHhB,EAACI,EAAA,CACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,GAChB,GAAI,sBAAsBQ,CAAE,EAC9B,EACA,UAAW,qBAAqBE,GAAuB,EAAE,GACzD,QAAS,CAACP,EAAUC,EAAYF,CAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAeO,EAAS,EAAI,EAC5B,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAS,EAAI,EAC5B,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,KAAK,IAAI,EAAGH,GAAM,MAAM,MAAM,EAC7C,eAAgB,KAAK,IAAI,EAAGA,GAAM,MAAM,MAAM,CAChD,CACF,EAEC,UAAAA,GAAM,MAAM,IAAI,CAACQ,EAAMC,IACtBpB,EAACM,EAAA,CAA8C,UAAU,aACvD,SAAAN,EAACY,EAAA,CAAM,KAAMO,EAAM,cAAe,CAAE,GAAGR,GAAM,cAAe,MAAOS,CAAO,EAAG,GAD7DP,EAAK,cAAgBO,CAEvC,CACD,EACDpB,EAAC,OAAI,UAAW,qBAAqBa,CAAE,qBAAsB,GAC/D,EAjDOb,EAAC,OAAI,IAAKgB,EAAkC,CAmDvD,CACF,EAEAN,EAAU,YAAc,YAExB,IAAOW,EAAQX",
6
+ "names": ["jsx", "jsxs", "React", "useState", "useEffect", "Swiper", "SwiperSlide", "Pagination", "FreeMode", "Mousewheel", "SwiperBox", "data", "Slide", "id", "isHalf", "paginationClassName", "ref", "isMounted", "setIsMounted", "item", "jIndex", "SwiperCategory_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as o,jsxs as u}from"react/jsx-runtime";import N,{useImperativeHandle as _,useRef as c}from"react";import{cn as n}from"../../helpers/utils.js";import x from"../../components/picture.js";import{withLayout as I}from"../../shared/Styles.js";import $ from"../Title/index.js";import v from"./SwiperCategory.js";import{useExposure as y}from"../../hooks/useExposure.js";import{trackUrlRef as b}from"../../shared/trackUrlRef.js";const l="image",p="category_banner",d=5,L=3,T=(e,a)=>{const t=[];for(let i=0;i<e.length;i+=a)t.push(e.slice(i,i+a));return t},E=({data:e,configuration:a})=>{const t=c(null);return y(t,{componentType:l,componentName:p,componentTitle:e?.name,position:a?.index+1}),o("div",{className:n("relative max-h-[240px] overflow-hidden"),children:o("div",{className:n("aspect-w-[167] aspect-h-[120]","tablet:aspect-w-[404] tablet:aspect-h-[240]","laptop:aspect-w-[212] laptop:aspect-h-[144]","desktop:aspect-w-[205] desktop:aspect-h-[192]","lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]"),children:u("div",{ref:t,className:n("tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 max-h-[240px] justify-between","bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300",a?.shape==="round"?"rounded-2xl":"rounded-none"),children:[o("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:o("a",{"aria-label":e?.name,href:b(e?.link,`${l}_${p}`),"data-headless-type-name":`${l}#${p}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>a?.event?.primaryButton(e,a?.index),children:o(x,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-1/2 tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),o("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})})})},M=({data:e,configuration:a,index:t,isFirstItemLarger:i})=>{const s=c(null);y(s,{componentType:l,componentName:p,componentTitle:e?.name,position:a?.index+1});const r=t===0;return u("div",{ref:s,className:n("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",i?n("p-4",r?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",a?.shape==="round"?"rounded-2xl":"rounded-none"),children:[o("a",{href:b(e?.link,`${l}_${p}`),"data-headless-type-name":`${l}#${p}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-position":`''#${a?.index+1}`,onClick:()=>a?.event?.primaryButton(e,a?.index+1),children:o(x,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:n("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",i?n(r?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),o("p",{className:n("text-info-primary w-full text-center text-sm font-bold",i?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},S=({data:e,configuration:a})=>{const i=(a?.totalCategories??0)<=d;return o("div",{className:`gap-3 ${i?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((s,r)=>o(M,{index:r,data:s,configuration:a,isFirstItemLarger:i},r))})},w=N.forwardRef((e,a)=>{const{data:t,className:i="",key:s,event:r,...k}=e,m=(t?.isShowSelect?t?.products:t?.productData)||[],g=m.length>d,h=m.length,C=T(m,g?L:d),f=c(null);return _(a,()=>f.current),u("div",{...k,ref:f,className:n("w-full overflow-hidden",i,{"aiui-dark":t?.theme==="dark"}),children:[t?.title&&o($,{data:{title:t?.title},className:"text-4xl"}),o("div",{className:"tablet:block hidden",children:o(v,{id:`Category${s}`,Slide:E,data:{list:m,configuration:{shape:t?.shape,event:r,title:t?.title,totalCategories:h}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"tablet:hidden block",children:o(v,{id:`Category1${s}`,Slide:S,data:{list:C,configuration:{shape:t?.shape,event:r,title:t?.title,totalCategories:h}},isHalf:g,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"h-7"})]})});w.displayName="Category";var F=I(w);export{F as default};
1
+ "use client";import{jsx as o,jsxs as g}from"react/jsx-runtime";import N,{useImperativeHandle as I,useRef as d}from"react";import{cn as r}from"../../helpers/utils.js";import v from"../../components/picture.js";import{withLayout as $}from"../../shared/Styles.js";import H from"../Title/index.js";import y from"./SwiperCategory.js";import{useExposure as b}from"../../hooks/useExposure.js";import{trackUrlRef as k}from"../../shared/trackUrlRef.js";import{useAiuiContext as w}from"../AiuiProvider/index.js";const c="image",p="category_banner",u=5,L=3,T=(e,a)=>{const t=[];for(let n=0;n<e.length;n+=a)t.push(e.slice(n,n+a));return t},D=({data:e,configuration:a})=>{const t=d(null),{trackingData:n}=w(),i=n?.contextHandle||"";return b(t,{componentType:c,componentName:p,componentTitle:e?.name,position:a?.index+1}),o("div",{className:r("relative max-h-[240px] overflow-hidden"),children:o("div",{className:r("aspect-w-[167] aspect-h-[120]","tablet:aspect-w-[404] tablet:aspect-h-[240]","laptop:aspect-w-[212] laptop:aspect-h-[144]","desktop:aspect-w-[205] desktop:aspect-h-[192]","lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]"),children:g("div",{ref:t,className:r("tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 max-h-[240px] justify-between","bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300",a?.shape==="round"?"rounded-2xl":"rounded-none"),children:[o("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:o("a",{"aria-label":e?.name,href:k(e?.link,`${i}_${c}_${p}`),"data-headless-type-name":`${c}#${p}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>a?.event?.primaryButton(e,a?.index),children:o(v,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-1/2 tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),o("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})})})},E=({data:e,configuration:a,index:t,isFirstItemLarger:n})=>{const i=d(null),{trackingData:s}=w(),m=s?.contextHandle||"";b(i,{componentType:c,componentName:p,componentTitle:e?.name,position:a?.index+1});const l=t===0;return g("div",{ref:i,className:r("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",n?r("p-4",l?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",a?.shape==="round"?"rounded-2xl":"rounded-none"),children:[o("a",{href:k(e?.link,`${m}_${c}_${p}`),"data-headless-type-name":`${c}#${p}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-position":`''#${a?.index+1}`,onClick:()=>a?.event?.primaryButton(e,a?.index+1),children:o(v,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:r("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",n?r(l?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),o("p",{className:r("text-info-primary w-full text-center text-sm font-bold",n?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},M=({data:e,configuration:a})=>{const n=(a?.totalCategories??0)<=u;return o("div",{className:`gap-3 ${n?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((i,s)=>o(E,{index:s,data:i,configuration:a,isFirstItemLarger:n},s))})},C=N.forwardRef((e,a)=>{const{data:t,className:n="",key:i,event:s,...m}=e,l=(t?.isShowSelect?t?.products:t?.productData)||[],f=l.length>u,h=l.length,_=T(l,f?L:u),x=d(null);return I(a,()=>x.current),g("div",{...m,ref:x,className:r("w-full overflow-hidden",n,{"aiui-dark":t?.theme==="dark"}),children:[t?.title&&o(H,{data:{title:t?.title},className:"text-4xl"}),o("div",{className:"tablet:block hidden",children:o(y,{id:`Category${i}`,Slide:D,data:{list:l,configuration:{shape:t?.shape,event:s,title:t?.title,totalCategories:h}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"tablet:hidden block",children:o(y,{id:`Category1${i}`,Slide:M,data:{list:_,configuration:{shape:t?.shape,event:s,title:t?.title,totalCategories:h}},isHalf:f,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"h-7"})]})});C.displayName="Category";var G=$(C);export{G as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\nconst MOBILE_FULL_PAGE_CAPACITY = 5\nconst MOBILE_COMPACT_PAGE_SIZE = 3\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n return (\n <div className={cn('relative max-h-[240px] overflow-hidden')}>\n <div\n className={cn(\n 'aspect-w-[167] aspect-h-[120]',\n 'tablet:aspect-w-[404] tablet:aspect-h-[240]',\n 'laptop:aspect-w-[212] laptop:aspect-h-[144]',\n 'desktop:aspect-w-[205] desktop:aspect-h-[192]',\n 'lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]'\n )}\n >\n <div\n ref={ref}\n className={cn(\n 'tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 max-h-[240px] justify-between',\n 'bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"flex items-center justify-center transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-1/2 tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <p className=\"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4\">\n {data?.name}\n </p>\n </div>\n </div>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\u7EC4\u4EF6\nconst SingleMobileItem = ({\n data,\n configuration,\n index,\n isFirstItemLarger,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n isFirstItemLarger: boolean\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n const isFirstItem = index === 0\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer duration-300',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6837\u5F0F\n isFirstItemLarger\n ? cn('p-4', isFirstItem ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]')\n : 'max-h-[126px] px-3 py-4',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index + 1)}\n >\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'm-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u56FE\u7247\u5C3A\u5BF8\n isFirstItemLarger\n ? cn(isFirstItem ? 'size-full max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]')\n : 'size-[72px]'\n )}\n />\n </a>\n <p\n className={cn(\n 'text-info-primary w-full text-center text-sm font-bold',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6587\u5B57\u663E\u793A\n isFirstItemLarger ? 'line-clamp-2' : 'shrink-0 truncate'\n )}\n >\n {data?.name}\n </p>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n const totalCategories = configuration?.totalCategories ?? 0\n // \u5F53\u6570\u91CF\u5C11\u4E8E\u5BB9\u5668\u65F6\uFF0C\u7B2C\u4E00\u4E2A\u9879\u76EE\u4F1A\u5360\u636E\u66F4\u5927\u7A7A\u95F4\n const isFirstItemLarger = totalCategories <= MOBILE_FULL_PAGE_CAPACITY\n return (\n <div className={`gap-3 ${isFirstItemLarger ? 'grid grid-cols-2' : 'flex h-full flex-col'}`}>\n {data?.map((item, index) => (\n <SingleMobileItem\n key={index}\n index={index}\n data={item}\n configuration={configuration}\n isFirstItemLarger={isFirstItemLarger}\n />\n ))}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event, ...rest } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = (data?.isShowSelect ? data?.products : data?.productData) || []\n const isCardShow = currentData.length > MOBILE_FULL_PAGE_CAPACITY\n const totalCategories = currentData.length\n const mobileSlides = chunkArray(currentData, isCardShow ? MOBILE_COMPACT_PAGE_SIZE : MOBILE_FULL_PAGE_CAPACITY)\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div\n {...rest}\n ref={innerRef}\n className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{\n list: currentData,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n paginationClassName=\"[&_.swiper-pagination]:!-bottom-6\"\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{\n list: mobileSlides,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n isHalf={isCardShow}\n paginationClassName=\"[&_.swiper-pagination]:!-bottom-6\"\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nCategory.displayName = 'Category'\n\nexport default withLayout(Category)\n"],
5
- "mappings": "aA0EQ,OAgBM,OAAAA,EAhBN,QAAAC,MAAA,oBAzER,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAW,oBAClB,OAAOC,MAAe,sBACtB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAG5B,MAAMC,EAAgB,QAChBC,EAAgB,kBAChBC,EAA4B,EAC5BC,EAA2B,EA+B3BC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CAAC,EAChB,QAAS,EAAI,EAAG,EAAIF,EAAI,OAAQ,GAAKC,EACnCC,EAAO,KAAKF,EAAI,MAAM,EAAG,EAAIC,CAAI,CAAC,EAEpC,OAAOC,CACT,EAEMC,EAAiB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAmD,CAC/F,MAAMC,EAAMnB,EAAuB,IAAI,EAEvC,OAAAM,EAAYa,EAAK,CACf,cAAAX,EACA,cAAAC,EACA,eAAgBQ,GAAM,KACtB,SAAUC,GAAe,MAAQ,CACnC,CAAC,EAGCtB,EAAC,OAAI,UAAWK,EAAG,wCAAwC,EACzD,SAAAL,EAAC,OACC,UAAWK,EACT,gCACA,8CACA,8CACA,gDACA,qDACF,EAEA,SAAAJ,EAAC,OACC,IAAKsB,EACL,UAAWlB,EACT,mFACA,sHACAiB,GAAe,QAAU,QAAU,cAAgB,cACrD,EAEA,UAAAtB,EAAC,OAAI,UAAU,qFACb,SAAAA,EAAC,KACC,aAAYqB,GAAM,KAClB,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F,EACA,oBAAoB,oCACtB,EACF,EACAtC,EAAC,OAAI,UAAU,sBACb,SAAAA,EAACS,EAAA,CACC,GAAI,YAAYwB,CAAG,GACnB,MAAOL,EACP,KAAM,CACJ,KAAMW,EACN,cAAe,CAAE,MAAOlB,GAAM,MAAO,MAAOa,EAAO,MAAOb,GAAM,MAAO,gBAAAiB,CAAgB,CACzF,EACA,OAAQD,EACR,oBAAoB,oCACtB,EACF,EACArC,EAAC,OAAI,UAAU,MAAM,GACvB,CAEJ,CAAC,EAED8B,EAAS,YAAc,WAEvB,IAAOW,EAAQlC,EAAWuB,CAAQ",
6
- "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "cn", "Picture", "withLayout", "Title", "SwiperBox", "useExposure", "trackUrlRef", "componentType", "componentName", "MOBILE_FULL_PAGE_CAPACITY", "MOBILE_COMPACT_PAGE_SIZE", "chunkArray", "arr", "size", "chunks", "CategoryPcItem", "data", "configuration", "ref", "SingleMobileItem", "index", "isFirstItemLarger", "isFirstItem", "CategoryMobileItem", "item", "Category", "props", "className", "key", "event", "rest", "currentData", "isCardShow", "totalCategories", "mobileSlides", "innerRef", "Category_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\nconst MOBILE_FULL_PAGE_CAPACITY = 5\nconst MOBILE_COMPACT_PAGE_SIZE = 3\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n const { trackingData } = useAiuiContext()\n const contextHandle = trackingData?.contextHandle || ''\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n return (\n <div className={cn('relative max-h-[240px] overflow-hidden')}>\n <div\n className={cn(\n 'aspect-w-[167] aspect-h-[120]',\n 'tablet:aspect-w-[404] tablet:aspect-h-[240]',\n 'laptop:aspect-w-[212] laptop:aspect-h-[144]',\n 'desktop:aspect-w-[205] desktop:aspect-h-[192]',\n 'lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]'\n )}\n >\n <div\n ref={ref}\n className={cn(\n 'tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 max-h-[240px] justify-between',\n 'bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"flex items-center justify-center transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${contextHandle}_${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-1/2 tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <p className=\"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4\">\n {data?.name}\n </p>\n </div>\n </div>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\u7EC4\u4EF6\nconst SingleMobileItem = ({\n data,\n configuration,\n index,\n isFirstItemLarger,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n isFirstItemLarger: boolean\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n\n const { trackingData } = useAiuiContext()\n const contextHandle = trackingData?.contextHandle || ''\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n const isFirstItem = index === 0\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer duration-300',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6837\u5F0F\n isFirstItemLarger\n ? cn('p-4', isFirstItem ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]')\n : 'max-h-[126px] px-3 py-4',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${contextHandle}_${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index + 1)}\n >\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'm-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u56FE\u7247\u5C3A\u5BF8\n isFirstItemLarger\n ? cn(isFirstItem ? 'size-full max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]')\n : 'size-[72px]'\n )}\n />\n </a>\n <p\n className={cn(\n 'text-info-primary w-full text-center text-sm font-bold',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6587\u5B57\u663E\u793A\n isFirstItemLarger ? 'line-clamp-2' : 'shrink-0 truncate'\n )}\n >\n {data?.name}\n </p>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n const totalCategories = configuration?.totalCategories ?? 0\n // \u5F53\u6570\u91CF\u5C11\u4E8E\u5BB9\u5668\u65F6\uFF0C\u7B2C\u4E00\u4E2A\u9879\u76EE\u4F1A\u5360\u636E\u66F4\u5927\u7A7A\u95F4\n const isFirstItemLarger = totalCategories <= MOBILE_FULL_PAGE_CAPACITY\n return (\n <div className={`gap-3 ${isFirstItemLarger ? 'grid grid-cols-2' : 'flex h-full flex-col'}`}>\n {data?.map((item, index) => (\n <SingleMobileItem\n key={index}\n index={index}\n data={item}\n configuration={configuration}\n isFirstItemLarger={isFirstItemLarger}\n />\n ))}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event, ...rest } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = (data?.isShowSelect ? data?.products : data?.productData) || []\n const isCardShow = currentData.length > MOBILE_FULL_PAGE_CAPACITY\n const totalCategories = currentData.length\n const mobileSlides = chunkArray(currentData, isCardShow ? MOBILE_COMPACT_PAGE_SIZE : MOBILE_FULL_PAGE_CAPACITY)\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div\n {...rest}\n ref={innerRef}\n className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{\n list: currentData,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n paginationClassName=\"[&_.swiper-pagination]:!-bottom-6\"\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{\n list: mobileSlides,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n isHalf={isCardShow}\n paginationClassName=\"[&_.swiper-pagination]:!-bottom-6\"\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nCategory.displayName = 'Category'\n\nexport default withLayout(Category)\n"],
5
+ "mappings": "aA8EQ,OAgBM,OAAAA,EAhBN,QAAAC,MAAA,oBA7ER,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAW,oBAClB,OAAOC,MAAe,sBACtB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,kBAAAC,MAAsB,2BAG/B,MAAMC,EAAgB,QAChBC,EAAgB,kBAChBC,EAA4B,EAC5BC,EAA2B,EA+B3BC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CA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"Title", "SwiperBox", "useExposure", "trackUrlRef", "useAiuiContext", "componentType", "componentName", "MOBILE_FULL_PAGE_CAPACITY", "MOBILE_COMPACT_PAGE_SIZE", "chunkArray", "arr", "size", "chunks", "i", "CategoryPcItem", "data", "configuration", "ref", "trackingData", "contextHandle", "SingleMobileItem", "index", "isFirstItemLarger", "isFirstItem", "CategoryMobileItem", "item", "Category", "props", "className", "key", "event", "rest", "currentData", "isCardShow", "totalCategories", "mobileSlides", "innerRef", "Category_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import w,{useImperativeHandle as h,useRef as x,useState as g}from"react";import{createPortal as k}from"react-dom";import y from"../Title/index.js";import{cn as p,getLocalizedPath as N}from"../../helpers/utils.js";import M from"../../components/picture.js";import L from"../SwiperBox/index.js";import{withLayout as T}from"../../shared/Styles.js";import{Avatar as C,AvatarImage as E,AvatarFallback as P}from"../../components/avatar.js";import{Container as z}from"../../components/container.js";import{Text as A}from"../../components/text.js";import{useExposure as B}from"../../hooks/useExposure.js";import{trackUrlRef as $}from"../../shared/trackUrlRef.js";import{useAiuiContext as I}from"../AiuiProvider/index.js";const u="copy",f="product_review",R=({data:e,configuration:i})=>{const d=x(null),[r,a]=g({visible:!1,x:0,y:0,text:""}),m=s=>{const o=Number(s),v=Number.isFinite(o)?Math.max(0,Math.floor(o)):0;return Array.from({length:v})||[]},n=s=>{e?.description&&a({visible:!0,x:s.clientX,y:s.clientY,text:e.description})},c=()=>{a(s=>({...s,visible:!1}))};return B(d,{componentType:u,componentName:f,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),t("div",{ref:d,className:p("bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",i?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:l("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[l("div",{className:p("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[l("div",{className:"flex-1",children:[e?.title?t("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,t("div",{className:"mt-1 flex items-center",children:m(e?.rating)?.map?.((s,o)=>t("div",{className:"mr-1",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:t("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},o))})]}),t("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?l(C,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[t(E,{src:e?.avatar?.url}),t(P,{children:e?.title})]}):null})]}),l("div",{className:"flex-1",onMouseMove:n,onMouseLeave:c,children:[t(A,{className:p("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&r.visible&&k(t("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${r.x+16}px`,top:`${r.y+16}px`},children:r.text}),document.body)]}),t("a",{href:$(N(e?.link||"",i?.locale||"us"),`${u}_${f}`),onClick:()=>{i?.event?.primaryButton(e,i?.index+1)},"data-headless-type-name":`${u}#${f}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-position":`''#${i?.index+1}`,children:l("div",{className:p("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",i?.shape==="round"?"rounded-lg":"rounded-none"),children:[t("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:t(M,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),t("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},b=w.forwardRef(({className:e="",data:i,key:d,...r},a)=>{const{products:m,title:n,theme:c,...s}=i,o=x(null),{locale:v="us"}=I();return h(a,()=>o.current),t("div",{...r,ref:o,className:e,children:t("div",{className:"evaluate-box relative z-10",children:t(z,{...i?.containerProps||{},className:"overflow-hidden",children:l("div",{ref:a,className:p("w-full",e,{"aiui-dark":c==="dark"}),children:[n&&t(y,{data:{title:n}}),t(L,{className:"!overflow-visible",id:"Evaluate"+d,data:{list:m,configuration:{...s,title:n,locale:v}},Slide:R,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});b.displayName="Evaluate";var J=T(b);export{J as default};
1
+ "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import g,{useImperativeHandle as k,useRef as b,useState as y}from"react";import{createPortal as N}from"react-dom";import M from"../Title/index.js";import{cn as n,getLocalizedPath as L}from"../../helpers/utils.js";import T from"../../components/picture.js";import C from"../SwiperBox/index.js";import{withLayout as E}from"../../shared/Styles.js";import{Avatar as P,AvatarImage as $,AvatarFallback as z}from"../../components/avatar.js";import{Container as A}from"../../components/container.js";import{Text as B}from"../../components/text.js";import{useExposure as D}from"../../hooks/useExposure.js";import{trackUrlRef as H}from"../../shared/trackUrlRef.js";import{useAiuiContext as w}from"../AiuiProvider/index.js";const u="copy",f="product_review",I=({data:e,configuration:i})=>{const p=b(null),{trackingData:m}=w(),[o,d]=y({visible:!1,x:0,y:0,text:""}),a=s=>{const l=Number(s),x=Number.isFinite(l)?Math.max(0,Math.floor(l)):0;return Array.from({length:x})||[]},c=s=>{e?.description&&d({visible:!0,x:s.clientX,y:s.clientY,text:e.description})},v=()=>{d(s=>({...s,visible:!1}))};return D(p,{componentType:u,componentName:f,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),t("div",{ref:p,className:n("bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",i?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:r("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[r("div",{className:n("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[r("div",{className:"flex-1",children:[e?.title?t("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,t("div",{className:"mt-1 flex items-center",children:a(e?.rating)?.map?.((s,l)=>t("div",{className:"mr-1",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:t("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},l))})]}),t("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?r(P,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[t($,{src:e?.avatar?.url}),t(z,{children:e?.title})]}):null})]}),r("div",{className:"flex-1",onMouseMove:c,onMouseLeave:v,children:[t(B,{className:n("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&o.visible&&N(t("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${o.x+16}px`,top:`${o.y+16}px`},children:o.text}),document.body)]}),t("a",{href:H(L(e?.link||"",i?.locale||"us"),`${m?.contextHandle||""}_${u}_${f}`),onClick:()=>{i?.event?.primaryButton(e,i?.index+1)},"data-headless-type-name":`${u}#${f}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-position":`''#${i?.index+1}`,children:r("div",{className:n("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",i?.shape==="round"?"rounded-lg":"rounded-none"),children:[t("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:t(T,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),t("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},h=g.forwardRef(({className:e="",data:i,key:p,...m},o)=>{const{products:d,title:a,theme:c,...v}=i,s=b(null),{locale:l="us",trackingData:x}=w();return k(o,()=>s.current),t("div",{...m,ref:s,className:e,children:t("div",{className:"evaluate-box relative z-10",children:t(A,{...i?.containerProps||{},className:"overflow-hidden",children:r("div",{ref:o,className:n("w-full",e,{"aiui-dark":c==="dark"}),children:[a&&t(M,{data:{title:a}}),t(C,{className:"!overflow-visible",id:"Evaluate"+p,data:{list:d,configuration:{...v,title:a,locale:l}},Slide:I,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});h.displayName="Evaluate";var K=E(h);export{K as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Evaluate/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport Title from '../Title/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps extends React.HTMLAttributes<HTMLDivElement> {\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n <a\n href={trackUrlRef(\n getLocalizedPath(data?.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key, ...rest }, ref) => {\n const { products, title, theme, ...other } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const { locale = 'us' } = useAiuiContext()\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div {...rest} ref={innerRef} className={className}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...other, title: title, locale } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
- "mappings": "aAqGU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBApGV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QAC7D,OAAS,gBAAAC,MAAoB,YAC7B,OAAOC,MAAW,oBAClB,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAOC,MAAa,8BACpB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,kBAAAC,MAAsB,6BACpD,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,QAAAC,MAAY,2BAErB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,kBAAAC,MAAsB,2BAG/B,MAAMC,EAAgB,OAChBC,EAAgB,iBAgChBC,EAAe,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAmD,CAC7F,MAAMC,EAAMtB,EAAuB,IAAI,EACjC,CAACuB,EAASC,CAAU,EAAIvB,EAAmE,CAC/F,QAAS,GACT,EAAG,EACH,EAAG,EACH,KAAM,EACR,CAAC,EAEKwB,EAAgBC,GAAgB,CACpC,MAAMC,EAAM,OAAOD,CAAG,EAChBE,EAAQ,OAAO,SAASD,CAAG,EAAI,KAAK,IAAI,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,EACvCuB,EAAW3C,EAAuB,IAAI,EACtC,CAAE,OAAA4C,EAAS,IAAK,EAAI5B,EAAe,EACzC,OAAAjB,EAAoBuB,EAAK,IAAMqB,EAAS,OAAyB,EAG/D/C,EAAC,OAAK,GAAG0C,EAAM,IAAKK,EAAU,UAAWP,EACvC,SAAAxC,EAAC,OAAI,UAAU,6BACb,SAAAA,EAACgB,EAAA,CAAW,GAAIQ,GAAM,gBAAkB,CAAC,EAAI,UAAU,kBACrD,SAAAvB,EAAC,OAAI,IAAKyB,EAAK,UAAWlB,EAAG,SAAUgC,EAAW,CAAE,YAAaK,IAAU,MAAO,CAAC,EAChF,UAAAD,GAAS5C,EAACO,EAAA,CAAM,KAAM,CAAE,MAAOqC,CAAM,EAAG,EACzC5C,EAACW,EAAA,CACC,UAAU,oBACV,GAAI,WAAa8B,EACjB,KAAM,CAAE,KAAME,EAAU,cAAe,CAAE,GAAGG,EAAO,MAAOF,EAAO,OAAAI,CAAO,CAAE,EAC1E,MAAOzB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDgB,EAAS,YAAc,WAEvB,IAAOU,EAAQrC,EAAW2B,CAAQ",
6
- "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useState", "createPortal", "Title", "cn", "getLocalizedPath", "Picture", "SwiperBox", "withLayout", "Avatar", "AvatarImage", "AvatarFallback", "Container", "Text", "useExposure", "trackUrlRef", "useAiuiContext", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "tooltip", "setTooltip", "handleRating", "num", "raw", "count", "handleMouseMove", "e", "handleMouseLeave", "prev", "_", "index", "Evaluate", "className", "key", "rest", "products", "title", "theme", "other", "innerRef", "locale", "Evaluate_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport Title from '../Title/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps extends React.HTMLAttributes<HTMLDivElement> {\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const { trackingData } = useAiuiContext()\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n <a\n href={trackUrlRef(\n getLocalizedPath(data?.link || '', configuration?.locale || 'us'),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key, ...rest }, ref) => {\n const { products, title, theme, ...other } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const { locale = 'us', trackingData } = useAiuiContext()\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div {...rest} ref={innerRef} className={className}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...other, title: title, locale } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
+ "mappings": "aAsGU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBArGV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QAC7D,OAAS,gBAAAC,MAAoB,YAC7B,OAAOC,MAAW,oBAClB,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAOC,MAAa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AGG,EAAO,MAAOF,EAAO,OAAAI,CAAO,CAAE,EAC1E,MAAO1B,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDiB,EAAS,YAAc,WAEvB,IAAOU,EAAQtC,EAAW4B,CAAQ",
6
+ "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useState", "createPortal", "Title", "cn", "getLocalizedPath", "Picture", "SwiperBox", "withLayout", "Avatar", "AvatarImage", "AvatarFallback", "Container", "Text", "useExposure", "trackUrlRef", "useAiuiContext", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "trackingData", "tooltip", "setTooltip", "handleRating", "num", "raw", "count", "handleMouseMove", "e", "handleMouseLeave", "prev", "_", "index", "Evaluate", "className", "key", "rest", "products", "title", "theme", "other", "innerRef", "locale", "Evaluate_default"]
7
7
  }
@@ -60,10 +60,5 @@ export interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement>
60
60
  data: EventScheduleData;
61
61
  classNames?: Partial<Record<EventScheduleSemanticName, string>>;
62
62
  }
63
- /**
64
- * EventSchedule - 活动日程组件
65
- *
66
- * @description 显示活动日程时间轴和活动卡片列表
67
- */
68
- declare const EventSchedule: React.ForwardRefExoticComponent<EventScheduleProps & React.RefAttributes<HTMLDivElement>>;
69
- export default EventSchedule;
63
+ declare const _default: any;
64
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as s,jsxs as h}from"react/jsx-runtime";import*as i from"react";import{cn as g}from"../../helpers/index.js";import{Text as D,Picture as R,Heading as z,Container as j}from"../../components/index.js";import{Swiper as F,SwiperSlide as L}from"swiper/react";import w from"dayjs";import{cva as b}from"class-variance-authority";const x=(r,t)=>{const d=w(),c=w(r).startOf("day"),u=w(t).endOf("day");return d.isAfter(u)?"completed":d.isBefore(c)?"not-started":"in-progress"},H=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),$=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),O=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),q=({timeStatus:r,theme:t="light",className:d,index:c,nodeLength:u})=>{const o=`${r}-${t}`,n=c===0,a=c===u-1;return h("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[s("div",{className:g(H({state:o}),n&&"rounded-l-full",a&&"rounded-r-full",d)}),s("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:s("div",{className:$({state:o})})})]})},G=(r,t)=>{if(r)return t==="in-progress"?r.active:t==="completed"&&r.completed||r.inactive},J=({timeStatus:r,item:t,theme:d="light",className:c,scheduleCount:u})=>{const o=i.useMemo(()=>G(t.icon,r),[t.icon,r]),n=`${r}-${d}`;return h("div",{className:g(O({state:n}),c),children:[o&&s("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:s(R,{source:o.url,alt:o.alt,className:"aspect-square"})}),h("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[s(z,{html:t.title,className:g(u>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:n}))}),s("div",{className:"flex flex-col gap-0.5",children:t.items.map((a,l)=>h("div",{className:"flex items-center gap-2",children:[a.icon&&s(D,{className:g("desktop:size-6 size-5 shrink-0",k({state:n})),html:a.icon}),s(D,{html:a.label,className:g("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",k({state:n}))})]},l))})]})]})},V=i.forwardRef(({classNames:r={},data:t,className:d,...c},u)=>{const o=t.theme||"light",n=i.useRef(null),a=i.useRef(null),l=i.useRef(!1),f=i.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=i.useMemo(()=>t.scheduleList.findIndex(e=>x(e.startDate,e.endDate)==="in-progress"),[t.scheduleList]),v=i.useCallback((e,m=!1)=>{const p=P=>{switch(P){case"mobile":return{slidesPerView:1.17};case"tablet":return e===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return e===2?{}:e===4?{slidesPerView:3.2}:{slidesPerView:e};case"desktop":return e===2?{slidesPerView:2}:{slidesPerView:e}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),y=p("desktop");return m?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{...y,spaceBetween:16}}:{0:T,768:C,1024:N,1440:y}},[]),A=i.useMemo(()=>v(f,!0),[f,v]),I=i.useMemo(()=>v(f,!1),[f,v]),E=t.showTimeline!==!1,M=i.useCallback(e=>{l.current||!a.current||(l.current=!0,a.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]),B=i.useCallback(e=>{l.current||!n.current||(l.current=!0,n.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]);return i.useEffect(()=>{n.current&&a.current&&S>=0&&setTimeout(()=>{l.current=!0,n.current?.slideTo(S,500),a.current?.slideTo(S,500),setTimeout(()=>{l.current=!1},600)},100)},[S]),h(j,{...c,ref:u,className:g("overflow-hidden",r?.root,d),children:[E&&s(F,{breakpoints:I,className:"h-4 w-full !overflow-visible",onSwiper:e=>{a.current=e},onSlideChange:B,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(L,{className:"",children:s(q,{className:r?.timeline,timeStatus:p,theme:o,index:m,nodeLength:t.scheduleList.length})},"timelineNode"+m)})}),s(F,{breakpoints:A,className:"w-full !overflow-visible",onSwiper:e=>{n.current=e},onSlideChange:M,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(L,{children:s(J,{timeStatus:p,className:g(E?"laptop:mt-4 mt-2":"",r?.eventScheduleCard),item:e,theme:o,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+m)})})]})});V.displayName="EventSchedule";var Y=V;export{Y as default};
1
+ "use client";import{jsx as n,jsxs as f}from"react/jsx-runtime";import*as s from"react";import{withLayout as H}from"../../shared/Styles.js";import{cn as h,extractLexicalText as z}from"../../helpers/index.js";import{Text as L,Picture as j,Heading as $,Container as O}from"../../components/index.js";import{Swiper as F,SwiperSlide as M}from"swiper/react";import w from"dayjs";import{cva as b}from"class-variance-authority";import{useExposure as q}from"../../hooks/useExposure.js";const _="image",G="event_schedule",k=(r,t)=>{const o=w(),d=w(r).startOf("day"),u=w(t).endOf("day");return o.isAfter(u)?"completed":o.isBefore(d)?"not-started":"in-progress"},J=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),K=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),T=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),Q=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),U=({timeStatus:r,theme:t="light",className:o,index:d,nodeLength:u})=>{const a=`${r}-${t}`,l=d===0,i=d===u-1;return f("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[n("div",{className:h(J({state:a}),l&&"rounded-l-full",i&&"rounded-r-full",o)}),n("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:n("div",{className:K({state:a})})})]})},W=(r,t)=>{if(r)return t==="in-progress"?r.active:t==="completed"&&r.completed||r.inactive},X=({timeStatus:r,item:t,theme:o="light",className:d,scheduleCount:u})=>{const a=s.useMemo(()=>W(t.icon,r),[t.icon,r]),l=`${r}-${o}`;return f("div",{className:h(Q({state:l}),d),children:[a&&n("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:n(j,{source:a.url,alt:a.alt,className:"aspect-square"})}),f("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[n($,{html:t.title,className:h(u>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",T({state:l}))}),n("div",{className:"flex flex-col gap-0.5",children:t.items.map((i,m)=>f("div",{className:"flex items-center gap-2",children:[i.icon&&n(L,{className:h("desktop:size-6 size-5 shrink-0",T({state:l})),html:i.icon}),n(L,{html:i.label,className:h("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",T({state:l}))})]},m))})]})]})},V=s.forwardRef(({classNames:r={},data:t,className:o,...d},u)=>{const a=s.useRef(null);s.useImperativeHandle(u,()=>a.current),q(a,{componentType:_,componentName:G,componentTitle:z(t.scheduleList?.[0]?.title),componentDescription:""});const l=t.theme||"light",i=s.useRef(null),m=s.useRef(null),c=s.useRef(!1),v=s.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=s.useMemo(()=>t.scheduleList.findIndex(e=>k(e.startDate,e.endDate)==="in-progress"),[t.scheduleList]),x=s.useCallback((e,g=!1)=>{const p=R=>{switch(R){case"mobile":return{slidesPerView:1.17};case"tablet":return e===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return e===2?{}:e===4?{slidesPerView:3.2}:{slidesPerView:e};case"desktop":return e===2?{slidesPerView:2}:{slidesPerView:e}}},C=p("mobile"),N=p("tablet"),y=p("laptop"),D=p("desktop");return g?{0:{...C,spaceBetween:12},768:{...N,spaceBetween:12},1024:{...y,spaceBetween:16},1440:{...D,spaceBetween:16}}:{0:C,768:N,1024:y,1440:D}},[]),I=s.useMemo(()=>x(v,!0),[v,x]),A=s.useMemo(()=>x(v,!1),[v,x]),E=t.showTimeline!==!1,B=s.useCallback(e=>{c.current||!m.current||(c.current=!0,m.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{c.current=!1},50))},[]),P=s.useCallback(e=>{c.current||!i.current||(c.current=!0,i.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{c.current=!1},50))},[]);return s.useEffect(()=>{i.current&&m.current&&S>=0&&setTimeout(()=>{c.current=!0,i.current?.slideTo(S,500),m.current?.slideTo(S,500),setTimeout(()=>{c.current=!1},600)},100)},[S]),f(O,{...d,ref:a,className:h("overflow-hidden",r?.root,o),children:[E&&n(F,{breakpoints:A,className:"h-4 w-full !overflow-visible",onSwiper:e=>{m.current=e},onSlideChange:P,children:t.scheduleList.map((e,g)=>{const p=k(e.startDate,e.endDate);return n(M,{className:"",children:n(U,{className:r?.timeline,timeStatus:p,theme:l,index:g,nodeLength:t.scheduleList.length})},"timelineNode"+g)})}),n(F,{breakpoints:I,className:"w-full !overflow-visible",onSwiper:e=>{i.current=e},onSlideChange:B,children:t.scheduleList.map((e,g)=>{const p=k(e.startDate,e.endDate);return n(M,{children:n(X,{timeStatus:p,className:h(E?"laptop:mt-4 mt-2":"",r?.eventScheduleCard),item:e,theme:l,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+g)})})]})});V.displayName="EventSchedule";var ie=H(V);export{ie as default};
2
2
  //# sourceMappingURL=index.js.map