@anker-in/headless-ui 1.3.7 → 1.3.9-alpha.1780375101375

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 (417) 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/ActivityMechanism/index.js +1 -1
  4. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
  5. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  6. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
  7. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  8. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  9. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  11. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  12. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  13. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  14. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +3 -3
  15. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
  16. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  17. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
  18. package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
  19. package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +2 -0
  20. package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
  21. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +2 -0
  22. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  23. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +3 -3
  24. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
  25. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
  26. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  27. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  28. package/dist/cjs/biz-components/Category/index.js +1 -1
  29. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  30. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  31. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  32. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  33. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  34. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  35. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  36. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  37. package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
  38. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  39. package/dist/cjs/biz-components/GiftShelf/index.js.map +2 -2
  40. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  41. package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
  42. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
  43. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  44. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  45. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
  46. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
  47. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
  48. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
  49. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
  50. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
  51. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  52. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  53. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +8 -1
  54. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  55. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  56. package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  57. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  58. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  59. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  60. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  61. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  62. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
  63. package/dist/cjs/biz-components/ImageTextOverlay/index.js +2 -2
  64. package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +3 -3
  65. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  66. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  67. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  68. package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
  69. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +5 -1
  70. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  71. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  72. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
  73. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +2 -0
  74. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
  75. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  76. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  77. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
  78. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  79. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  80. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  81. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  82. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  83. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  84. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  85. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  86. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  87. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  88. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  89. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  90. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  91. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  92. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
  93. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
  94. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
  95. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  96. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  97. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
  98. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
  99. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  100. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  101. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  102. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  103. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  104. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  105. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
  106. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js +2 -0
  107. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
  108. package/dist/cjs/biz-components/Listing/const.d.ts +11 -0
  109. package/dist/cjs/biz-components/Listing/const.js +1 -1
  110. package/dist/cjs/biz-components/Listing/const.js.map +3 -3
  111. package/dist/cjs/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
  112. package/dist/cjs/biz-components/Listing/hooks/useComponentData.js +2 -0
  113. package/dist/cjs/biz-components/Listing/hooks/useComponentData.js.map +7 -0
  114. package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
  115. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +2 -2
  116. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
  117. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +1 -1
  118. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
  119. package/dist/cjs/biz-components/LotteryShared/types.d.ts +9 -0
  120. package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
  121. package/dist/cjs/biz-components/Media/index.js +1 -1
  122. package/dist/cjs/biz-components/Media/index.js.map +3 -3
  123. package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
  124. package/dist/cjs/biz-components/MediaEndorsement/index.js.map +3 -3
  125. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  126. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  127. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  128. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
  129. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  130. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
  131. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  132. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
  133. package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.js +1 -1
  134. package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.js.map +3 -3
  135. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js +1 -1
  136. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +3 -3
  137. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  138. package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
  139. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
  140. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  141. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  142. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  143. package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
  144. package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
  145. package/dist/cjs/biz-components/ProductCompare/index.js.map +2 -2
  146. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  147. package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
  148. package/dist/cjs/biz-components/ProductLottery/types.d.ts +62 -5
  149. package/dist/cjs/biz-components/ProductLottery/types.js +1 -1
  150. package/dist/cjs/biz-components/ProductLottery/types.js.map +2 -2
  151. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  152. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  153. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  154. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  155. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  156. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +2 -2
  157. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  158. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  159. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  160. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  161. package/dist/cjs/biz-components/Specs/index.js +1 -1
  162. package/dist/cjs/biz-components/Specs/index.js.map +3 -3
  163. package/dist/cjs/biz-components/Subscribe/index.js +1 -1
  164. package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
  165. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  166. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  167. package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js +1 -1
  168. package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +3 -3
  169. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  170. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  171. package/dist/cjs/biz-components/Title/index.js +1 -1
  172. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  173. package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
  174. package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
  175. package/dist/cjs/biz-components/index.d.ts +5 -1
  176. package/dist/cjs/biz-components/index.js +1 -1
  177. package/dist/cjs/biz-components/index.js.map +3 -3
  178. package/dist/cjs/components/Countdown.js +1 -1
  179. package/dist/cjs/components/Countdown.js.map +3 -3
  180. package/dist/cjs/components/alert.d.ts +1 -0
  181. package/dist/cjs/components/alert.js +1 -1
  182. package/dist/cjs/components/alert.js.map +2 -2
  183. package/dist/cjs/components/checkbox.js +1 -1
  184. package/dist/cjs/components/checkbox.js.map +2 -2
  185. package/dist/cjs/components/dialog.js +1 -1
  186. package/dist/cjs/components/dialog.js.map +3 -3
  187. package/dist/cjs/components/index.d.ts +1 -0
  188. package/dist/cjs/components/index.js +1 -1
  189. package/dist/cjs/components/index.js.map +3 -3
  190. package/dist/cjs/components/link.js +1 -1
  191. package/dist/cjs/components/link.js.map +2 -2
  192. package/dist/cjs/components/otp-input.d.ts +18 -0
  193. package/dist/cjs/components/otp-input.js +2 -0
  194. package/dist/cjs/components/otp-input.js.map +7 -0
  195. package/dist/cjs/components/tabs.js +1 -1
  196. package/dist/cjs/components/tabs.js.map +3 -3
  197. package/dist/cjs/helpers/index.d.ts +1 -1
  198. package/dist/cjs/helpers/index.js +1 -1
  199. package/dist/cjs/helpers/index.js.map +2 -2
  200. package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
  201. package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
  202. package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
  203. package/dist/cjs/hooks/useIsomorphicMediaQuery.d.ts +14 -0
  204. package/dist/cjs/hooks/useIsomorphicMediaQuery.js +2 -0
  205. package/dist/cjs/hooks/useIsomorphicMediaQuery.js.map +7 -0
  206. package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
  207. package/dist/cjs/hooks/useProductListTrack.js +2 -0
  208. package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
  209. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  210. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  211. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  212. package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
  213. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  214. package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
  215. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  216. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  217. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  218. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  219. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  220. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  221. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  222. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +3 -3
  223. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
  224. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  225. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
  226. package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
  227. package/dist/esm/biz-components/BuyOneGetOneShelf/context.js +2 -0
  228. package/dist/esm/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
  229. package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +2 -0
  230. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  231. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +3 -3
  232. package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
  233. package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
  234. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  235. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  236. package/dist/esm/biz-components/Category/index.js +1 -1
  237. package/dist/esm/biz-components/Category/index.js.map +3 -3
  238. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  239. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  240. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  241. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  242. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  243. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  244. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  245. package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
  246. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  247. package/dist/esm/biz-components/GiftShelf/index.js.map +2 -2
  248. package/dist/esm/biz-components/Graphic/index.js +1 -1
  249. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  250. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
  251. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  252. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  253. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
  254. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
  255. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
  256. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
  257. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
  258. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
  259. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  260. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  261. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +8 -1
  262. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  263. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  264. package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  265. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  266. package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  267. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  268. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  269. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  270. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
  271. package/dist/esm/biz-components/ImageTextOverlay/index.js +2 -2
  272. package/dist/esm/biz-components/ImageTextOverlay/index.js.map +3 -3
  273. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  274. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  275. package/dist/esm/biz-components/Ksp/index.js +1 -1
  276. package/dist/esm/biz-components/Ksp/index.js.map +3 -3
  277. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +5 -1
  278. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  279. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  280. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
  281. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +2 -0
  282. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
  283. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  284. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  285. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
  286. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  287. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  288. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  289. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  290. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  291. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  292. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  293. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  294. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  295. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  296. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  297. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  298. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  299. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  300. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
  301. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
  302. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
  303. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  304. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  305. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
  306. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
  307. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  308. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  309. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  310. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  311. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  312. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  313. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
  314. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js +2 -0
  315. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
  316. package/dist/esm/biz-components/Listing/const.d.ts +11 -0
  317. package/dist/esm/biz-components/Listing/const.js +1 -1
  318. package/dist/esm/biz-components/Listing/const.js.map +3 -3
  319. package/dist/esm/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
  320. package/dist/esm/biz-components/Listing/hooks/useComponentData.js +2 -0
  321. package/dist/esm/biz-components/Listing/hooks/useComponentData.js.map +7 -0
  322. package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
  323. package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +2 -2
  324. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
  325. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +1 -1
  326. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
  327. package/dist/esm/biz-components/LotteryShared/types.d.ts +9 -0
  328. package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
  329. package/dist/esm/biz-components/Media/index.js +1 -1
  330. package/dist/esm/biz-components/Media/index.js.map +3 -3
  331. package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
  332. package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
  333. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  334. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  335. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  336. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  337. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  338. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
  339. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  340. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
  341. package/dist/esm/biz-components/MediaSceneSwitcherV2/index.js +1 -1
  342. package/dist/esm/biz-components/MediaSceneSwitcherV2/index.js.map +3 -3
  343. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js +1 -1
  344. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +3 -3
  345. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  346. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  347. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
  348. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  349. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  350. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  351. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  352. package/dist/esm/biz-components/ProductCompare/index.js +1 -1
  353. package/dist/esm/biz-components/ProductCompare/index.js.map +2 -2
  354. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  355. package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
  356. package/dist/esm/biz-components/ProductLottery/types.d.ts +62 -5
  357. package/dist/esm/biz-components/ProductLottery/types.js.map +2 -2
  358. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  359. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  360. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  361. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  362. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  363. package/dist/esm/biz-components/SecondaryBanner/index.js.map +2 -2
  364. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  365. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  366. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  367. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  368. package/dist/esm/biz-components/Specs/index.js +1 -1
  369. package/dist/esm/biz-components/Specs/index.js.map +3 -3
  370. package/dist/esm/biz-components/Subscribe/index.js +1 -1
  371. package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
  372. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  373. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  374. package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js +1 -1
  375. package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +3 -3
  376. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  377. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  378. package/dist/esm/biz-components/Title/index.js +1 -1
  379. package/dist/esm/biz-components/Title/index.js.map +3 -3
  380. package/dist/esm/biz-components/WheelLottery/index.js +1 -1
  381. package/dist/esm/biz-components/WheelLottery/index.js.map +2 -2
  382. package/dist/esm/biz-components/index.d.ts +5 -1
  383. package/dist/esm/biz-components/index.js +1 -1
  384. package/dist/esm/biz-components/index.js.map +3 -3
  385. package/dist/esm/components/Countdown.js +1 -1
  386. package/dist/esm/components/Countdown.js.map +3 -3
  387. package/dist/esm/components/alert.d.ts +1 -0
  388. package/dist/esm/components/alert.js +1 -1
  389. package/dist/esm/components/alert.js.map +2 -2
  390. package/dist/esm/components/checkbox.js +1 -1
  391. package/dist/esm/components/checkbox.js.map +2 -2
  392. package/dist/esm/components/dialog.js +1 -1
  393. package/dist/esm/components/dialog.js.map +3 -3
  394. package/dist/esm/components/index.d.ts +1 -0
  395. package/dist/esm/components/index.js +1 -1
  396. package/dist/esm/components/index.js.map +2 -2
  397. package/dist/esm/components/link.js +1 -1
  398. package/dist/esm/components/link.js.map +2 -2
  399. package/dist/esm/components/otp-input.d.ts +18 -0
  400. package/dist/esm/components/otp-input.js +2 -0
  401. package/dist/esm/components/otp-input.js.map +7 -0
  402. package/dist/esm/components/tabs.js +1 -1
  403. package/dist/esm/components/tabs.js.map +3 -3
  404. package/dist/esm/helpers/index.d.ts +1 -1
  405. package/dist/esm/helpers/index.js +1 -1
  406. package/dist/esm/helpers/index.js.map +3 -3
  407. package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
  408. package/dist/esm/helpers/isLexicalEmpty.js +1 -1
  409. package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
  410. package/dist/esm/hooks/useIsomorphicMediaQuery.d.ts +14 -0
  411. package/dist/esm/hooks/useIsomorphicMediaQuery.js +2 -0
  412. package/dist/esm/hooks/useIsomorphicMediaQuery.js.map +7 -0
  413. package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
  414. package/dist/esm/hooks/useProductListTrack.js +2 -0
  415. package/dist/esm/hooks/useProductListTrack.js.map +7 -0
  416. package/package.json +1 -1
  417. package/style.css +108 -18
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var T=Object.create;var m=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var H=(e,i)=>{for(var r in i)m(e,r,{get:i[r],enumerable:!0})},v=(e,i,r,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of I(i))!D.call(e,n)&&n!==r&&m(e,n,{get:()=>i[n],enumerable:!(o=E(i,n))||o.enumerable});return e};var h=(e,i,r)=>(r=e!=null?T(j(e)):{},v(i||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),q=e=>v(m({},"__esModule",{value:!0}),e);var W={};H(W,{default:()=>Q});module.exports=q(W);var t=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=h(require("../../components/picture.js")),L=require("../../shared/Styles.js"),N=require("react-responsive"),C=require("../../hooks/useExposure.js"),M=require("../AiuiProvider/index.js"),c=require("swiper/react"),a=require("swiper/modules"),G=require("../Title/index.js"),S=h(require("../../components/link.js"));const z="copy",R="store_benefits",F=(e,i)=>{const r=[];for(let o=0;o<e.length;o+=i)r.push(e.slice(o,o+i));return r},w=(0,s.forwardRef)(({data:{items:e=[],itemShape:i},className:r},o)=>{const[n,B]=(0,s.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 768px)"}),x=(0,s.useRef)(null),u=(0,s.useRef)(null),{locale:k="us"}=(0,M.useAiuiContext)();(0,s.useImperativeHandle)(o,()=>u.current),(0,C.useExposure)(u,{componentType:z,componentName:R}),(0,s.useEffect)(()=>{B(f)},[f]);const A=n?F(e,3):e;return(0,t.jsx)("div",{ref:u,className:(0,l.cn)("brand-equity-wrapper w-full",r),children:n?(0,t.jsxs)(c.Swiper,{className:(0,l.cn)(r),modules:[a.FreeMode,a.Mousewheel,a.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:x.current},breakpoints:{0:{spaceBetween:12}},children:[A?.map((p,d)=>(0,t.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(p)&&p?.map((P,g)=>(0,t.jsx)(b,{data:P,itemShape:i,index:g,locale:k},g))},"SwiperSlide"+d)),(0,t.jsx)("div",{ref:x,className:"mt-3 flex justify-center"})]}):(0,t.jsx)("div",{className:(0,l.cn)("laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3"),children:e.map((p,d)=>(0,t.jsx)(b,{data:p,itemShape:i,index:d,locale:k},d))})})}),b=({data:e,itemShape:i,index:r,locale:o})=>(0,t.jsxs)("div",{className:(0,l.cn)("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]",i==="round"?"rounded-box":"rounded-none"),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3",children:[(0,t.jsx)("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}),(0,t.jsx)("div",{className:"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,t.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsxs)("div",{className:"box-border overflow-hidden",children:[(0,t.jsx)("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||""}),(0,t.jsxs)(S.default,{href:(0,l.getLocalizedPath)(e?.link||"",o),asChild:!e?.link,className:"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline",children:[(0,t.jsx)("span",{className:"link-item-text laptop:text-base text-sm",children:e?.linkText}),(0,t.jsx)("div",{className:"size-6",children:(0,t.jsx)("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,t.jsx)("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})]});w.displayName="BrandCardLink";var Q=(0,L.withLayout)(w);
1
+ "use strict";"use client";var T=Object.create;var m=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var z=(e,i)=>{for(var r in i)m(e,r,{get:i[r],enumerable:!0})},v=(e,i,r,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of j(i))!q.call(e,s)&&s!==r&&m(e,s,{get:()=>i[s],enumerable:!(o=H(i,s))||o.enumerable});return e};var w=(e,i,r)=>(r=e!=null?T(R(e)):{},v(i||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),F=e=>v(m({},"__esModule",{value:!0}),e);var Q={};z(Q,{default:()=>$});module.exports=F(Q);var t=require("react/jsx-runtime"),n=require("react"),a=require("../../helpers/utils.js"),C=w(require("../../components/picture.js")),M=require("../../shared/Styles.js"),S=require("../../hooks/useIsomorphicMediaQuery.js"),B=require("../../hooks/useExposure.js"),f=require("../AiuiProvider/index.js"),A=require("../../shared/trackUrlRef.js"),c=require("swiper/react"),l=require("swiper/modules"),P=w(require("../../components/link.js"));const b="copy",y="store_benefits",_=(e,i)=>{const r=[];for(let o=0;o<e.length;o+=i)r.push(e.slice(o,o+i));return r},L=(0,n.forwardRef)(({data:{items:e=[],itemShape:i},className:r},o)=>{const[s,D]=(0,n.useState)(!1),k=(0,S.useIsomorphicMediaQuery)({query:"(max-width: 768px)"}),x=(0,n.useRef)(null),u=(0,n.useRef)(null),{locale:g="us",trackingData:U}=(0,f.useAiuiContext)();(0,n.useImperativeHandle)(o,()=>u.current),(0,B.useExposure)(u,{componentType:b,componentName:y}),(0,n.useEffect)(()=>{D(k)},[k]);const E=s?_(e,3):e;return(0,t.jsx)("div",{ref:u,className:(0,a.cn)("brand-equity-wrapper w-full",r),children:s?(0,t.jsxs)(c.Swiper,{className:(0,a.cn)(r),modules:[l.FreeMode,l.Mousewheel,l.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:x.current},breakpoints:{0:{spaceBetween:12}},children:[E?.map((p,d)=>(0,t.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(p)&&p?.map((I,h)=>(0,t.jsx)(N,{data:I,itemShape:i,index:h,locale:g},h))},"SwiperSlide"+d)),(0,t.jsx)("div",{ref:x,className:"mt-3 flex justify-center"})]}):(0,t.jsx)("div",{className:(0,a.cn)("laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3"),children:e.map((p,d)=>(0,t.jsx)(N,{data:p,itemShape:i,index:d,locale:g},d))})})}),N=({data:e,itemShape:i,index:r,locale:o})=>{const{trackingData:s}=(0,f.useAiuiContext)();return(0,t.jsxs)("div",{className:(0,a.cn)("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]",i==="round"?"rounded-box":"rounded-none"),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3",children:[(0,t.jsx)("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}),(0,t.jsx)("div",{className:"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,t.jsx)(C.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsxs)("div",{className:"box-border overflow-hidden",children:[(0,t.jsx)("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||""}),(0,t.jsxs)(P.default,{href:(0,A.trackUrlRef)((0,a.getLocalizedPath)(e?.link||"",o),`${s?.contextHandle||""}_${b}_${y}`),asChild:!e?.link,className:"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline",children:[(0,t.jsx)("span",{className:"link-item-text laptop:text-base text-sm",children:e?.linkText}),(0,t.jsx)("div",{className:"size-6",children:(0,t.jsx)("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,t.jsx)("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})]})};L.displayName="BrandCardLink";var $=(0,M.withLayout)(L);
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.displayName = 'BrandCardLink'\n\nexport default withLayout(BrandCardLink)\n"],
5
- "mappings": "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",
6
- "names": ["BrandCardLink_exports", "__export", "BrandCardLink_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_react_responsive", "import_useExposure", "import_AiuiProvider", "import_modules", "import_Title", "import_link", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "i", "BrandCardLink", "items", "itemShape", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "locale", "itemsArray", "item", "jIndex", "index", "BrandCardLinkItem", "data", "Picture", "Link"]
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 { useIsomorphicMediaQuery } from '../../hooks/useIsomorphicMediaQuery.js'\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 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 = useIsomorphicMediaQuery({ 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": "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",
6
+ "names": ["BrandCardLink_exports", "__export", "BrandCardLink_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_useIsomorphicMediaQuery", "import_useExposure", "import_AiuiProvider", "import_trackUrlRef", "import_modules", "import_link", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "i", "BrandCardLink", "items", "itemShape", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "locale", "trackingData", "itemsArray", "item", "jIndex", "index", "BrandCardLinkItem", "data", "Picture", "Link"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var i in t)d(e,i,{get:t[i],enumerable:!0})},k=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of L(t))!A.call(e,o)&&o!==i&&d(e,o,{get:()=>t[o],enumerable:!(a=P(t,o))||a.enumerable});return e};var h=(e,t,i)=>(i=e!=null?j(z(e)):{},k(t||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),D=e=>k(d({},"__esModule",{value:!0}),e);var F={};H(F,{default:()=>C});module.exports=D(F);var r=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=h(require("../../components/picture.js")),q=require("../../shared/Styles.js"),E=require("react-responsive"),S=require("../../hooks/useExposure.js"),c=require("swiper/react"),n=require("swiper/modules"),M=h(require("../Title/index.js"));const R="copy",Q="store_benefits",$=(e,t)=>{const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i},N=(0,s.forwardRef)(({data:{items:e=[],itemShape:t,title:i,theme:a},className:o},u)=>{const[x,B]=(0,s.useState)(!1),v=(0,E.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,s.useRef)(null),f=(0,s.useRef)(null);(0,s.useImperativeHandle)(u,()=>f.current),(0,S.useExposure)(f,{componentType:R,componentName:Q}),(0,s.useEffect)(()=>{B(v)},[v]);const T=x?$(e,3):e;return(0,r.jsxs)("div",{ref:f,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":a==="dark"},o),children:[i&&(0,r.jsx)(M.default,{data:{title:i}}),x?(0,r.jsxs)(c.Swiper,{className:(0,l.cn)(o),modules:[n.FreeMode,n.Mousewheel,n.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:b.current},breakpoints:{0:{spaceBetween:12}},children:[T?.map((p,m)=>(0,r.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(p)&&p?.map((I,g)=>(0,r.jsx)(w,{data:I,itemShape:t,index:g,theme:a},g))},"SwiperSlide"+m)),(0,r.jsx)("div",{ref:b,className:"mt-3 flex justify-center"})]}):(0,r.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((p,m)=>(0,r.jsx)(w,{data:p,itemShape:t,index:m,theme:a},m))})]})}),w=({data:e,itemShape:t,index:i,theme:a})=>(0,r.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${i+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(i),"bg-container-primary":a==="dark"},t==="round"?"rounded-box":"rounded-none",e.className),children:[(0,r.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,r.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,r.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((o,u)=>(0,r.jsx)("div",{className:(0,l.cn)("border-container-primary size-[30px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,r.jsx)(y.default,{source:o.avatar?.url,alt:o.avatar?.alt,className:"size-full object-cover"})},u))}):(0,r.jsx)("div",{className:"lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,r.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,r.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]});N.displayName="BrandEquity";var C=(0,q.withLayout)(N);
1
+ "use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var i in t)d(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of L(t))!A.call(e,o)&&o!==i&&d(e,o,{get:()=>t[o],enumerable:!(a=P(t,o))||a.enumerable});return e};var k=(e,t,i)=>(i=e!=null?j(z(e)):{},h(t||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),D=e=>h(d({},"__esModule",{value:!0}),e);var F={};H(F,{default:()=>C});module.exports=D(F);var r=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=k(require("../../components/picture.js")),q=require("../../shared/Styles.js"),E=require("../../hooks/useIsomorphicMediaQuery.js"),S=require("../../hooks/useExposure.js"),c=require("swiper/react"),n=require("swiper/modules"),M=k(require("../Title/index.js"));const R="copy",Q="store_benefits",$=(e,t)=>{const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i},N=(0,s.forwardRef)(({data:{items:e=[],itemShape:t,title:i,theme:a},className:o},u)=>{const[x,B]=(0,s.useState)(!1),v=(0,E.useIsomorphicMediaQuery)({query:"(max-width: 768px)"}),b=(0,s.useRef)(null),f=(0,s.useRef)(null);(0,s.useImperativeHandle)(u,()=>f.current),(0,S.useExposure)(f,{componentType:R,componentName:Q}),(0,s.useEffect)(()=>{B(v)},[v]);const I=x?$(e,3):e;return(0,r.jsxs)("div",{ref:f,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":a==="dark"},o),children:[i&&(0,r.jsx)(M.default,{data:{title:i}}),x?(0,r.jsxs)(c.Swiper,{className:(0,l.cn)(o),modules:[n.FreeMode,n.Mousewheel,n.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:b.current},breakpoints:{0:{spaceBetween:12}},children:[I?.map((p,m)=>(0,r.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(p)&&p?.map((T,g)=>(0,r.jsx)(w,{data:T,itemShape:t,index:g,theme:a},g))},"SwiperSlide"+m)),(0,r.jsx)("div",{ref:b,className:"mt-3 flex justify-center"})]}):(0,r.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((p,m)=>(0,r.jsx)(w,{data:p,itemShape:t,index:m,theme:a},m))})]})}),w=({data:e,itemShape:t,index:i,theme:a})=>(0,r.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${i+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(i),"bg-container-primary":a==="dark"},t==="round"?"rounded-box":"rounded-none",e.className),children:[(0,r.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,r.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,r.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((o,u)=>(0,r.jsx)("div",{className:(0,l.cn)("border-container-primary size-[30px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,r.jsx)(y.default,{source:o.avatar?.url,alt:o.avatar?.alt,className:"size-full object-cover"})},u))}):(0,r.jsx)("div",{className:"lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,r.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,r.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]});N.displayName="BrandEquity";var C=(0,q.withLayout)(N);
2
2
  //# sourceMappingURL=BrandEquity.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BrandEquity/BrandEquity.tsx"],
4
- "sourcesContent": ["'use client'\nimport { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'\n\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { BrandEquityProps, BrandEquityItemProps } from './types.js'\n\nimport type { Img, Theme } from '../../types/props.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport Title from '../Title/index.js'\n\nconst componentType = 'copy'\nconst componentName = 'store_benefits'\n\nconst chunkArray = (arr: BrandEquityItemProps[], 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 BrandEquity = forwardRef<HTMLDivElement, BrandEquityProps>(\n ({ data: { items = [], itemShape, title, theme }, 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 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', { 'aiui-dark': theme === 'dark' }, className)}>\n {title && <Title data={{ title: title }} />}\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 <BrandEquityItem key={index} data={item} itemShape={itemShape} index={index} theme={theme} />\n ))}\n </SwiperSlide>\n ))}\n <div ref={paginationRef} className=\"mt-3 flex justify-center\"></div>\n </Swiper>\n ) : (\n <div className={cn('grid grid-cols-1 gap-3', 'tablet:grid-cols-2', 'laptop:gap-4 laptop:grid-cols-10')}>\n {items.map((item, index) => (\n <BrandEquityItem key={index} data={item} itemShape={itemShape} index={index} theme={theme} />\n ))}\n </div>\n )}\n </div>\n )\n }\n)\n\nconst BrandEquityItem = ({\n data,\n itemShape,\n index,\n theme,\n}: {\n data: BrandEquityItemProps\n itemShape?: 'round' | 'square'\n index: number\n theme?: Theme\n}) => {\n return (\n <div\n className={cn(\n 'brand-equity-item',\n `brand-equity-item-${index + 1}`,\n data.containerName ? `brand-equity-item--${data.containerName}` : undefined,\n 'bg-container-secondary-1 box-border flex w-full flex-col p-4',\n 'desktop:p-6 justify-between',\n 'laptop:col-span-3 lg-desktop:p-8',\n 'laptop:h-[192px] lg-desktop:h-[240px] h-[160px]',\n {\n ['laptop:col-span-4']: [0, 5, 6, 11].includes(index),\n 'bg-container-primary': theme === 'dark',\n },\n itemShape === 'round' ? 'rounded-box' : 'rounded-none',\n data.className\n )}\n >\n <div className=\"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.type === 'avatar' ? (\n <div className=\"flex shrink-0 -space-x-2\">\n {data?.avatarList?.map((item: { avatar: Img }, index: number) => (\n <div\n key={index}\n className={cn(\n 'border-container-primary size-[30px] overflow-hidden rounded-full border-2',\n 'relative inline-block shrink-0',\n 'lg-desktop:size-[36px]'\n )}\n >\n <Picture source={item.avatar?.url} alt={item.avatar?.alt} className=\"size-full object-cover\" />\n </div>\n ))}\n </div>\n ) : (\n <div className=\"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 )}\n </div>\n <p className=\"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n )\n}\n\nBrandEquity.displayName = 'BrandEquity'\n\nexport default withLayout(BrandEquity)\n"],
5
- "mappings": "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",
6
- "names": ["BrandEquity_exports", "__export", "BrandEquity_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_react_responsive", "import_useExposure", "import_modules", "import_Title", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "i", "BrandEquity", "items", "itemShape", "title", "theme", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "itemsArray", "Title", "item", "jIndex", "index", "BrandEquityItem", "data", "Picture"]
4
+ "sourcesContent": ["'use client'\nimport { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'\n\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { BrandEquityProps, BrandEquityItemProps } from './types.js'\n\nimport type { Img, Theme } from '../../types/props.js'\nimport { useIsomorphicMediaQuery } from '../../hooks/useIsomorphicMediaQuery.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport Title from '../Title/index.js'\n\nconst componentType = 'copy'\nconst componentName = 'store_benefits'\n\nconst chunkArray = (arr: BrandEquityItemProps[], 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 BrandEquity = forwardRef<HTMLDivElement, BrandEquityProps>(\n ({ data: { items = [], itemShape, title, theme }, className }, ref) => {\n const [isMobile, setIsMobile] = useState(false)\n const mediaQuery = useIsomorphicMediaQuery({ query: '(max-width: 768px)' })\n const paginationRef = useRef<HTMLDivElement>(null)\n const innerRef = useRef<HTMLDivElement>(null)\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', { 'aiui-dark': theme === 'dark' }, className)}>\n {title && <Title data={{ title: title }} />}\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 <BrandEquityItem key={index} data={item} itemShape={itemShape} index={index} theme={theme} />\n ))}\n </SwiperSlide>\n ))}\n <div ref={paginationRef} className=\"mt-3 flex justify-center\"></div>\n </Swiper>\n ) : (\n <div className={cn('grid grid-cols-1 gap-3', 'tablet:grid-cols-2', 'laptop:gap-4 laptop:grid-cols-10')}>\n {items.map((item, index) => (\n <BrandEquityItem key={index} data={item} itemShape={itemShape} index={index} theme={theme} />\n ))}\n </div>\n )}\n </div>\n )\n }\n)\n\nconst BrandEquityItem = ({\n data,\n itemShape,\n index,\n theme,\n}: {\n data: BrandEquityItemProps\n itemShape?: 'round' | 'square'\n index: number\n theme?: Theme\n}) => {\n return (\n <div\n className={cn(\n 'brand-equity-item',\n `brand-equity-item-${index + 1}`,\n data.containerName ? `brand-equity-item--${data.containerName}` : undefined,\n 'bg-container-secondary-1 box-border flex w-full flex-col p-4',\n 'desktop:p-6 justify-between',\n 'laptop:col-span-3 lg-desktop:p-8',\n 'laptop:h-[192px] lg-desktop:h-[240px] h-[160px]',\n {\n ['laptop:col-span-4']: [0, 5, 6, 11].includes(index),\n 'bg-container-primary': theme === 'dark',\n },\n itemShape === 'round' ? 'rounded-box' : 'rounded-none',\n data.className\n )}\n >\n <div className=\"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.type === 'avatar' ? (\n <div className=\"flex shrink-0 -space-x-2\">\n {data?.avatarList?.map((item: { avatar: Img }, index: number) => (\n <div\n key={index}\n className={cn(\n 'border-container-primary size-[30px] overflow-hidden rounded-full border-2',\n 'relative inline-block shrink-0',\n 'lg-desktop:size-[36px]'\n )}\n >\n <Picture source={item.avatar?.url} alt={item.avatar?.alt} className=\"size-full object-cover\" />\n </div>\n ))}\n </div>\n ) : (\n <div className=\"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 )}\n </div>\n <p className=\"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n )\n}\n\nBrandEquity.displayName = 'BrandEquity'\n\nexport default withLayout(BrandEquity)\n"],
5
+ "mappings": "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",
6
+ "names": ["BrandEquity_exports", "__export", "BrandEquity_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_useIsomorphicMediaQuery", "import_useExposure", "import_modules", "import_Title", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "i", "BrandEquity", "items", "itemShape", "title", "theme", "className", "ref", "isMobile", "setIsMobile", "mediaQuery", "paginationRef", "innerRef", "itemsArray", "Title", "item", "jIndex", "index", "BrandEquityItem", "data", "Picture"]
7
7
  }
@@ -13,7 +13,7 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
13
13
  tags?: ProductTag[];
14
14
  /** 当前选中的赠品SKU(受控组件) */
15
15
  selectedGiftSku?: string;
16
- /** 布局模式 */
16
+ /** @deprecated Layout is now automatically inferred by Root based on children count. */
17
17
  layout?: 'horizontal' | 'vertical';
18
18
  classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>;
19
19
  /** @deprecated Use `onProductImageClick` instead. */
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var q=Object.create;var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},F=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of J(t))!Q.call(e,l)&&l!==o&&p(e,l,{get:()=>t[l],enumerable:!(s=D(t,l))||s.enumerable});return e};var d=(e,t,o)=>(o=e!=null?q(K(e)):{},F(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),X=e=>F(p({},"__esModule",{value:!0}),e);var Z={};U(Z,{default:()=>Y});module.exports=X(Z);var n=require("react/jsx-runtime"),a=d(require("react")),S=require("../../helpers/index.js"),N=d(require("./ProductImage.js")),y=d(require("./ProductInfo.js")),L=d(require("./GiftSelection.js")),M=d(require("./PriceAndActions.js"));const g=a.forwardRef(({productData:e,gifts:t=[],giftType:o=1,selectedGiftSku:s,sceneImages:l,tags:I,layout:G="horizontal",className:O,onProductClick:P,onProductImageClick:x,onLearnMore:T,onShopNow:z,onGiftClick:b,onGiftSelectionChange:R,classNames:j,...A},B)=>{const[E,k]=a.useState(!1),[H,C]=a.useState(!1),[w,f]=a.useState(()=>!t||t.length===0?[]:o===2?t.map(r=>r.id):[t[0].id]),u=a.useMemo(()=>t?t.map(r=>({...r,selected:w.includes(r.id)})):[],[t,w]);a.useEffect(()=>{if(!t||t.length===0){f([]);return}f(o===2?t.map(r=>r.id):r=>{const i=r[0];return i&&t.some(h=>h.id===i)?[i]:[t[0].id]})},[t,o]);const m=a.useMemo(()=>({...e,gifts:t,gift_type:o}),[e,t,o]),W=r=>{if(o===2){const i=u.filter(c=>c.selected);b?.(r,i);return}f(()=>{const i=[r.id],c=t?.filter(h=>i.includes(h.id))||[];return b?.(r,c),R?.(c,m),i})},v=()=>{(x??P)?.(m)},V=async()=>{const r=u.filter(i=>i.selected);k(!0);try{await T?.(m,r)}finally{k(!1)}},_=async()=>{const r=u.filter(i=>i.selected);C(!0);try{await z?.(m,r)}finally{C(!1)}};return(0,n.jsxs)("div",{ref:B,className:(0,S.cn)("bg-container-primary rounded-box flex items-stretch overflow-hidden",G==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col"]:["flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap","flex-col justify-between","min-h-[610px] "],x??P?"cursor-pointer":"",O),...A,children:[(0,n.jsx)(N.default,{images:l,name:e.name,layout:G,tags:e.tags||I,onClick:v}),(0,n.jsx)("div",{className:(0,S.cn)("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",G==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:(0,n.jsxs)("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[(0,n.jsx)(y.default,{name:e.name,onClick:v,description:e.description,classNames:j}),(0,n.jsx)(L.default,{freeGiftLabel:e.freeGiftLabel,freeGifts:u,onGiftClick:W,giftType:o,selectedGiftSku:s}),(0,n.jsx)(M.default,{currentPrice:e.currentPrice??"",originalPrice:e.originalPrice,learnMoreText:e.learnMoreText,shopNowText:e.shopNowText,onLearnMore:V,onShopNow:_,availableForSale:e.availableForSale,learnMoreLoading:E,shopNowLoading:H,trackingTitle:e.name,trackingDescription:e.description,trackingSku:e.sku})]})})]})});g.displayName="BuyOneGetOneShelf.ProductCard";var Y=g;
1
+ "use strict";"use client";var K=Object.create;var p=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Z=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},v=(e,t,o,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of U(t))!Y.call(e,a)&&a!==o&&p(e,a,{get:()=>t[a],enumerable:!(d=Q(t,a))||d.enumerable});return e};var s=(e,t,o)=>(o=e!=null?K(X(e)):{},v(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),$=e=>v(p({},"__esModule",{value:!0}),e);var te={};Z(te,{default:()=>ee});module.exports=$(te);var i=require("react/jsx-runtime"),l=s(require("react")),x=require("../../helpers/index.js"),g=s(require("./ProductImage.js")),L=s(require("./ProductInfo.js")),N=s(require("./GiftSelection.js")),M=s(require("./PriceAndActions.js")),I=require("./context.js");const F=l.forwardRef(({productData:e,gifts:t=[],giftType:o=1,selectedGiftSku:d,sceneImages:a,tags:O,layout:T,className:B,onProductClick:S,onProductImageClick:P,onLearnMore:R,onShopNow:j,onGiftClick:b,onGiftSelectionChange:z,classNames:A,...E},H)=>{const{layout:W}=l.useContext(I.BuyOneGetOneShelfContext),G=T??W,[V,C]=l.useState(!1),[_,k]=l.useState(!1),[w,f]=l.useState(()=>!t||t.length===0?[]:o===2?t.map(r=>r.id):[t[0].id]),u=l.useMemo(()=>t?t.map(r=>({...r,selected:w.includes(r.id)})):[],[t,w]);l.useEffect(()=>{if(!t||t.length===0){f([]);return}f(o===2?t.map(r=>r.id):r=>{const n=r[0];return n&&t.some(h=>h.id===n)?[n]:[t[0].id]})},[t,o]);const m=l.useMemo(()=>({...e,gifts:t,gift_type:o}),[e,t,o]),q=r=>{if(o===2){const n=u.filter(c=>c.selected);b?.(r,n);return}f(()=>{const n=[r.id],c=t?.filter(h=>n.includes(h.id))||[];return b?.(r,c),z?.(c,m),n})},y=()=>{(P??S)?.(m)},D=async()=>{const r=u.filter(n=>n.selected);C(!0);try{await R?.(m,r)}finally{C(!1)}},J=async()=>{const r=u.filter(n=>n.selected);k(!0);try{await j?.(m,r)}finally{k(!1)}};return(0,i.jsxs)("div",{ref:H,className:(0,x.cn)("bg-container-primary rounded-box flex items-stretch overflow-hidden",G==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col"]:["flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap","flex-col justify-between","min-h-[610px] "],P??S?"cursor-pointer":"",B),...E,children:[(0,i.jsx)(g.default,{images:a,name:e.name,layout:G,tags:e.tags||O,onClick:y}),(0,i.jsx)("div",{className:(0,x.cn)("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",G==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:(0,i.jsxs)("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[(0,i.jsx)(L.default,{name:e.name,onClick:y,description:e.description,classNames:A}),(0,i.jsx)(N.default,{freeGiftLabel:e.freeGiftLabel,freeGifts:u,onGiftClick:q,giftType:o,selectedGiftSku:d}),(0,i.jsx)(M.default,{currentPrice:e.currentPrice??"",originalPrice:e.originalPrice,learnMoreText:e.learnMoreText,shopNowText:e.shopNowText,onLearnMore:D,onShopNow:J,availableForSale:e.availableForSale,learnMoreLoading:V,shopNowLoading:_,trackingTitle:e.name,trackingDescription:e.description,trackingSku:e.sku})]})})]})});F.displayName="BuyOneGetOneShelf.ProductCard";var ee=F;
2
2
  //# sourceMappingURL=ProductCard.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/ProductCard.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** \u5E03\u5C40\u6A21\u5F0F */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout = 'horizontal',\n className,\n onProductClick,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n ...props\n },\n ref\n ) => {\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const handleProductImageClick = () => {\n const callback = onProductImageClick ?? onProductClick\n callback?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n // \u6C34\u5E73\u5E03\u5C40\uFF1Aflex-row\uFF0C\u5360\u6EE1\u6574\u884C\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col', // 964px + 700px\n ]\n : [\n // \u5782\u76F4\u5E03\u5C40\uFF1Aflex-col\uFF0C\u9002\u5408\u4E00\u884C\u4E24\u4E2A\n 'flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap',\n 'flex-col justify-between',\n 'min-h-[610px] ',\n ],\n (onProductImageClick ?? onProductClick) ? 'cursor-pointer' : '',\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={handleProductImageClick}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={handleProductImageClick}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n trackingTitle={productData.name}\n trackingDescription={productData.description}\n trackingSku={productData.sku}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'BuyOneGetOneShelf.ProductCard'\n\nexport default ProductCard\n"],
5
- "mappings": "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",
6
- "names": ["ProductCard_exports", "__export", "ProductCard_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductImage", "import_ProductInfo", "import_GiftSelection", "import_PriceAndActions", "ProductCard", "productData", "gifts", "giftType", "selectedGiftSku", "sceneImages", "tags", "layout", "className", "onProductClick", "onProductImageClick", "onLearnMore", "onShopNow", "onGiftClick", "onGiftSelectionChange", "classNames", "props", "ref", "learnMoreLoading", "setLearnMoreLoading", "shopNowLoading", "setShopNowLoading", "selectedGiftIds", "setSelectedGiftIds", "gift", "giftsWithSelection", "prevSelectedIds", "currentSelectedId", "fullProductData", "handleGiftClick", "currentSelectedGifts", "g", "newSelectedIds", "newSelectedGifts", "handleProductImageClick", "handleLearnMoreClick", "selectedGifts", "handleShopNowClick", "ProductImage", "ProductInfo", "GiftSelection", "PriceAndActions"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport { BuyOneGetOneShelfContext } from './context.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** @deprecated Layout is now automatically inferred by Root based on children count. */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout: layoutProp,\n className,\n onProductClick,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n ...props\n },\n ref\n ) => {\n const { layout: contextLayout } = React.useContext(BuyOneGetOneShelfContext)\n const layout = layoutProp ?? contextLayout\n\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const handleProductImageClick = () => {\n const callback = onProductImageClick ?? onProductClick\n callback?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n // \u6C34\u5E73\u5E03\u5C40\uFF1Aflex-row\uFF0C\u5360\u6EE1\u6574\u884C\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col', // 964px + 700px\n ]\n : [\n // \u5782\u76F4\u5E03\u5C40\uFF1Aflex-col\uFF0C\u9002\u5408\u4E00\u884C\u4E24\u4E2A\n 'flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap',\n 'flex-col justify-between',\n 'min-h-[610px] ',\n ],\n (onProductImageClick ?? onProductClick) ? 'cursor-pointer' : '',\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={handleProductImageClick}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={handleProductImageClick}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n trackingTitle={productData.name}\n trackingDescription={productData.description}\n trackingSku={productData.sku}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'BuyOneGetOneShelf.ProductCard'\n\nexport default ProductCard\n"],
5
+ "mappings": "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",
6
+ "names": ["ProductCard_exports", "__export", "ProductCard_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductImage", "import_ProductInfo", "import_GiftSelection", "import_PriceAndActions", "import_context", "ProductCard", "productData", "gifts", "giftType", "selectedGiftSku", "sceneImages", "tags", "layoutProp", "className", "onProductClick", "onProductImageClick", "onLearnMore", "onShopNow", "onGiftClick", "onGiftSelectionChange", "classNames", "props", "ref", "contextLayout", "layout", "learnMoreLoading", "setLearnMoreLoading", "shopNowLoading", "setShopNowLoading", "selectedGiftIds", "setSelectedGiftIds", "gift", "giftsWithSelection", "prevSelectedIds", "currentSelectedId", "fullProductData", "handleGiftClick", "currentSelectedGifts", "g", "newSelectedIds", "newSelectedGifts", "handleProductImageClick", "handleLearnMoreClick", "selectedGifts", "handleShopNowClick", "ProductImage", "ProductInfo", "GiftSelection", "PriceAndActions"]
7
7
  }
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ export declare const BuyOneGetOneShelfContext: React.Context<{
3
+ layout: "horizontal" | "vertical";
4
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.create;var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var y=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},l=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of h(o))!x.call(t,a)&&a!==e&&n(t,a,{get:()=>o[a],enumerable:!(r=i(o,a))||r.enumerable});return t};var f=(t,o,e)=>(e=t!=null?c(u(t)):{},l(o||!t||!t.__esModule?n(e,"default",{value:t,enumerable:!0}):e,t)),m=t=>l(n({},"__esModule",{value:!0}),t);var z={};y(z,{BuyOneGetOneShelfContext:()=>s});module.exports=m(z);var p=f(require("react"));const s=p.createContext({layout:"horizontal"});
2
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/context.tsx"],
4
+ "sourcesContent": ["import * as React from 'react'\n\nexport const BuyOneGetOneShelfContext = React.createContext<{\n layout: 'horizontal' | 'vertical'\n}>({\n layout: 'horizontal',\n})\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBAEhB,MAAMF,EAA2BE,EAAM,cAE3C,CACD,OAAQ,YACV,CAAC",
6
+ "names": ["context_exports", "__export", "BuyOneGetOneShelfContext", "__toCommonJS", "React"]
7
+ }
@@ -1,8 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import type { BuyOneGetOneShelfProps } from './types.js';
3
+ import { BuyOneGetOneShelfContext } from './context.js';
3
4
  declare const BuyOneGetOneShelf: {
4
5
  Root: React.ForwardRefExoticComponent<BuyOneGetOneShelfProps & React.RefAttributes<HTMLDivElement>>;
5
6
  ProductCard: React.ForwardRefExoticComponent<import("./ProductCard.js").ProductCardProps & React.RefAttributes<HTMLDivElement>>;
6
7
  };
8
+ export { BuyOneGetOneShelfContext };
7
9
  export default BuyOneGetOneShelf;
8
10
  export type { FreeGift, FreeGiftWithSelection, ProductTag, BuyOneGetOneShelfSemanticName, BuyOneGetOneShelfRootSemanticName, BuyOneGetOneShelfProductCardSemanticName, ResponsiveImage, ResponsiveImages, BaseProductData, PureProductData, WithGiftData, ProductData, ProductCardData, CopyConfig, BogoItem, BuyOneGetOneShelfData, BuyOneGetOneShelfProps, BuyOneGetOneShelfCardProps, } from './types.js';
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var G=Object.create;var f=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var o in t)f(e,o,{get:t[o],enumerable:!0})},l=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of P(t))!v.call(e,n)&&n!==o&&f(e,n,{get:()=>t[n],enumerable:!(r=B(t,n))||r.enumerable});return e};var u=(e,t,o)=>(o=e!=null?G(g(e)):{},l(t||!e||!e.__esModule?f(o,"default",{value:e,enumerable:!0}):o,e)),R=e=>l(f({},"__esModule",{value:!0}),e);var b={};D(b,{default:()=>T});module.exports=R(b);var a=require("react/jsx-runtime"),m=u(require("react")),i=require("../../helpers/index.js"),d=u(require("./ProductCard.js")),p=require("../../components/index.js"),y=require("../../hooks/useExposure.js");const x="shelf",C="buy_one_get_one_shelf",c=m.forwardRef(({className:e,classNames:t={},theme:o,title:r,subtitle:n,children:O,...h},S)=>{const s=m.useRef(null);return(0,y.useExposure)(s,{componentType:x,componentName:C,componentTitle:r,componentDescription:n}),m.useImperativeHandle(S,()=>s.current),(0,a.jsxs)("div",{ref:s,className:(0,i.cn)("bogo-shelf-root w-full py-0",{"aiui-dark":o==="dark"},e,t?.root),...h,children:[r&&(0,a.jsx)(p.Heading,{as:"h2",html:r,className:(0,i.cn)("bogo-shelf-title text-info-primary mb-4",t?.title)}),n&&(0,a.jsx)(p.Text,{size:3,as:"p",html:n,className:(0,i.cn)("bogo-shelf-description text-info-primary mb-6",t?.description)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-wrap justify-center gap-6","laptop:justify-start laptop:flex-row"),children:O})]})});c.displayName="BuyOneGetOneShelf.Root";const N={Root:c,ProductCard:d.default};var T=N;
1
+ "use strict";"use client";var x=Object.create;var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var o in t)f(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of D(t))!N.call(e,r)&&r!==o&&f(e,r,{get:()=>t[r],enumerable:!(a=C(t,r))||a.enumerable});return e};var O=(e,t,o)=>(o=e!=null?x(E(e)):{},y(t||!e||!e.__esModule?f(o,"default",{value:e,enumerable:!0}):o,e)),b=e=>y(f({},"__esModule",{value:!0}),e);var j={};T(j,{BuyOneGetOneShelfContext:()=>p.BuyOneGetOneShelfContext,default:()=>_});module.exports=b(j);var n=require("react/jsx-runtime"),i=O(require("react")),l=require("../../helpers/index.js"),G=O(require("./ProductCard.js")),m=require("../../components/index.js"),R=require("../../hooks/useExposure.js"),p=require("./context.js");const H="shelf",w="buy_one_get_one_shelf",S=i.forwardRef(({className:e,classNames:t={},theme:o,title:a,subtitle:r,children:h,...B},P)=>{const c=i.useRef(null);(0,R.useExposure)(c,{componentType:H,componentName:w,componentTitle:a,componentDescription:r}),i.useImperativeHandle(P,()=>c.current);const d=g=>{const u=[];return i.Children.forEach(g,s=>{i.isValidElement(s)&&(s.type===i.Fragment?u.push(...d(s.props.children)):u.push(s))}),u},v=d(h).length<=1?"horizontal":"vertical";return(0,n.jsx)(p.BuyOneGetOneShelfContext.Provider,{value:{layout:v},children:(0,n.jsxs)("div",{ref:c,className:(0,l.cn)("bogo-shelf-root w-full py-0",{"aiui-dark":o==="dark"},e,t?.root),...B,children:[a&&(0,n.jsx)(m.Heading,{as:"h2",html:a,className:(0,l.cn)("bogo-shelf-title text-info-primary mb-4",t?.title)}),r&&(0,n.jsx)(m.Text,{size:3,as:"p",html:r,className:(0,l.cn)("bogo-shelf-description text-info-primary mb-6",t?.description)}),(0,n.jsx)("div",{className:(0,l.cn)("flex flex-wrap justify-center gap-6","laptop:justify-start laptop:flex-row"),children:h})]})})});S.displayName="BuyOneGetOneShelf.Root";const I={Root:S,ProductCard:G.default};var _=I;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductCard from './ProductCard.js'\nimport { Heading, Text } from '../../components/index.js'\nimport type { BuyOneGetOneShelfProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nconst componentType = 'shelf'\nconst componentName = 'buy_one_get_one_shelf'\n\n/**\n * BuyOneGetOneShelfRoot - \u4E70\u8D60\u8D27\u67B6\u6839\u5BB9\u5668\u7EC4\u4EF6\n *\n * @description \u7EC4\u5408\u5F0F\u8BBE\u8BA1\u7684\u4E70\u8D60\u8D27\u67B6\u5BB9\u5668\uFF0C\u8D1F\u8D23\u5E03\u5C40\u548C\u6807\u9898\u5C55\u793A\n * \u652F\u6301\u4F20\u5165\u591A\u4E2A BuyOneGetOneShelf.ProductCard \u5B50\u7EC4\u4EF6\n */\nconst BuyOneGetOneShelfRoot = React.forwardRef<HTMLDivElement, BuyOneGetOneShelfProps>(\n ({ className, classNames = {}, theme, title, subtitle, children, ...props }, ref) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n return (\n <div\n ref={boxRef}\n className={cn(\n 'bogo-shelf-root w-full py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.root\n )}\n {...props}\n >\n {title && (\n <Heading as=\"h2\" html={title} className={cn('bogo-shelf-title text-info-primary mb-4', classNames?.title)} />\n )}\n {subtitle && (\n <Text\n size={3}\n as=\"p\"\n html={subtitle}\n className={cn('bogo-shelf-description text-info-primary mb-6', classNames?.description)}\n />\n )}\n {/* \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u533A\u57DF */}\n <div className={cn('flex flex-wrap justify-center gap-6', 'laptop:justify-start laptop:flex-row')}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nBuyOneGetOneShelfRoot.displayName = 'BuyOneGetOneShelf.Root'\n\n// \u521B\u5EFA\u547D\u540D\u7A7A\u95F4\u5BF9\u8C61\uFF0C\u5305\u542B Root \u548C ProductCard \u7EC4\u4EF6\nconst BuyOneGetOneShelf = {\n Root: BuyOneGetOneShelfRoot,\n ProductCard: ProductCard,\n}\n\nexport default BuyOneGetOneShelf\n\n// Re-export types for external use\nexport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductTag,\n BuyOneGetOneShelfSemanticName,\n BuyOneGetOneShelfRootSemanticName,\n BuyOneGetOneShelfProductCardSemanticName,\n ResponsiveImage,\n ResponsiveImages,\n BaseProductData,\n PureProductData,\n WithGiftData,\n ProductData,\n ProductCardData,\n CopyConfig,\n BogoItem,\n BuyOneGetOneShelfData,\n BuyOneGetOneShelfProps,\n BuyOneGetOneShelfCardProps,\n} from './types.js'\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgCM,IAAAI,EAAA,6BA9BNC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAwB,+BACxBC,EAA8B,qCAE9BC,EAA4B,sCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,wBAQhBC,EAAwBP,EAAM,WAClC,CAAC,CAAE,UAAAQ,EAAW,WAAAC,EAAa,CAAC,EAAG,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CACnF,MAAMC,EAAShB,EAAM,OAAuB,IAAI,EAEhD,wBAAYgB,EAAQ,CAClB,cAAAX,EACA,cAAAC,EACA,eAAgBK,EAChB,qBAAsBC,CACxB,CAAC,EAEDZ,EAAM,oBAAoBe,EAAK,IAAMC,EAAO,OAAyB,KAGnE,QAAC,OACC,IAAKA,EACL,aAAW,MACT,8BACA,CACE,YAAaN,IAAU,MACzB,EACAF,EACAC,GAAY,IACd,EACC,GAAGK,EAEH,UAAAH,MACC,OAAC,WAAQ,GAAG,KAAK,KAAMA,EAAO,aAAW,MAAG,0CAA2CF,GAAY,KAAK,EAAG,EAE5GG,MACC,OAAC,QACC,KAAM,EACN,GAAG,IACH,KAAMA,EACN,aAAW,MAAG,gDAAiDH,GAAY,WAAW,EACxF,KAGF,OAAC,OAAI,aAAW,MAAG,sCAAuC,sCAAsC,EAC7F,SAAAI,EACH,GACF,CAEJ,CACF,EAEAN,EAAsB,YAAc,yBAGpC,MAAMU,EAAoB,CACxB,KAAMV,EACN,YAAa,EAAAW,OACf,EAEA,IAAOrB,EAAQoB",
6
- "names": ["BuyOneGetOneShelf_exports", "__export", "BuyOneGetOneShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductCard", "import_components", "import_useExposure", "componentType", "componentName", "BuyOneGetOneShelfRoot", "className", "classNames", "theme", "title", "subtitle", "children", "props", "ref", "boxRef", "BuyOneGetOneShelf", "ProductCard"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductCard from './ProductCard.js'\nimport { Heading, Text } from '../../components/index.js'\nimport type { BuyOneGetOneShelfProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { BuyOneGetOneShelfContext } from './context.js'\n\nconst componentType = 'shelf'\nconst componentName = 'buy_one_get_one_shelf'\n\nconst BuyOneGetOneShelfRoot = React.forwardRef<HTMLDivElement, BuyOneGetOneShelfProps>(\n ({ className, classNames = {}, theme, title, subtitle, children, ...props }, ref) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const flattenChildren = (nodes: React.ReactNode): React.ReactElement[] => {\n const result: React.ReactElement[] = []\n React.Children.forEach(nodes, node => {\n if (React.isValidElement(node)) {\n if (node.type === React.Fragment) {\n result.push(...flattenChildren(node.props.children))\n } else {\n result.push(node)\n }\n }\n })\n return result\n }\n\n const childArray = flattenChildren(children)\n const layout = childArray.length <= 1 ? 'horizontal' : 'vertical'\n\n return (\n <BuyOneGetOneShelfContext.Provider value={{ layout }}>\n <div\n ref={boxRef}\n className={cn(\n 'bogo-shelf-root w-full py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.root\n )}\n {...props}\n >\n {title && (\n <Heading\n as=\"h2\"\n html={title}\n className={cn('bogo-shelf-title text-info-primary mb-4', classNames?.title)}\n />\n )}\n {subtitle && (\n <Text\n size={3}\n as=\"p\"\n html={subtitle}\n className={cn('bogo-shelf-description text-info-primary mb-6', classNames?.description)}\n />\n )}\n {/* \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u533A\u57DF */}\n <div className={cn('flex flex-wrap justify-center gap-6', 'laptop:justify-start laptop:flex-row')}>\n {children}\n </div>\n </div>\n </BuyOneGetOneShelfContext.Provider>\n )\n }\n)\n\nBuyOneGetOneShelfRoot.displayName = 'BuyOneGetOneShelf.Root'\n\nconst BuyOneGetOneShelf = {\n Root: BuyOneGetOneShelfRoot,\n ProductCard: ProductCard,\n}\n\nexport { BuyOneGetOneShelfContext }\n\nexport default BuyOneGetOneShelf\n\n// Re-export types for external use\nexport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductTag,\n BuyOneGetOneShelfSemanticName,\n BuyOneGetOneShelfRootSemanticName,\n BuyOneGetOneShelfProductCardSemanticName,\n ResponsiveImage,\n ResponsiveImages,\n BaseProductData,\n PureProductData,\n WithGiftData,\n ProductData,\n ProductCardData,\n CopyConfig,\n BogoItem,\n BuyOneGetOneShelfData,\n BuyOneGetOneShelfProps,\n BuyOneGetOneShelfCardProps,\n} from './types.js'\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qEAAAE,IAAA,eAAAC,EAAAH,GA6CQ,IAAAI,EAAA,6BA3CRC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAwB,+BACxBC,EAA8B,qCAE9BC,EAA4B,sCAC5BC,EAAyC,wBAEzC,MAAMC,EAAgB,QAChBC,EAAgB,wBAEhBC,EAAwBR,EAAM,WAClC,CAAC,CAAE,UAAAS,EAAW,WAAAC,EAAa,CAAC,EAAG,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IAAQ,CACnF,MAAMC,EAASjB,EAAM,OAAuB,IAAI,KAEhD,eAAYiB,EAAQ,CAClB,cAAAX,EACA,cAAAC,EACA,eAAgBK,EAChB,qBAAsBC,CACxB,CAAC,EAEDb,EAAM,oBAAoBgB,EAAK,IAAMC,EAAO,OAAyB,EAErE,MAAMC,EAAmBC,GAAiD,CACxE,MAAMC,EAA+B,CAAC,EACtC,OAAApB,EAAM,SAAS,QAAQmB,EAAOE,GAAQ,CAChCrB,EAAM,eAAeqB,CAAI,IACvBA,EAAK,OAASrB,EAAM,SACtBoB,EAAO,KAAK,GAAGF,EAAgBG,EAAK,MAAM,QAAQ,CAAC,EAEnDD,EAAO,KAAKC,CAAI,EAGtB,CAAC,EACMD,CACT,EAGME,EADaJ,EAAgBJ,CAAQ,EACjB,QAAU,EAAI,aAAe,WAEvD,SACE,OAAC,2BAAyB,SAAzB,CAAkC,MAAO,CAAE,OAAAQ,CAAO,EACjD,oBAAC,OACC,IAAKL,EACL,aAAW,MACT,8BACA,CACE,YAAaN,IAAU,MACzB,EACAF,EACAC,GAAY,IACd,EACC,GAAGK,EAEH,UAAAH,MACC,OAAC,WACC,GAAG,KACH,KAAMA,EACN,aAAW,MAAG,0CAA2CF,GAAY,KAAK,EAC5E,EAEDG,MACC,OAAC,QACC,KAAM,EACN,GAAG,IACH,KAAMA,EACN,aAAW,MAAG,gDAAiDH,GAAY,WAAW,EACxF,KAGF,OAAC,OAAI,aAAW,MAAG,sCAAuC,sCAAsC,EAC7F,SAAAI,EACH,GACF,EACF,CAEJ,CACF,EAEAN,EAAsB,YAAc,yBAEpC,MAAMe,EAAoB,CACxB,KAAMf,EACN,YAAa,EAAAgB,OACf,EAIA,IAAO3B,EAAQ0B",
6
+ "names": ["BuyOneGetOneShelf_exports", "__export", "BuyOneGetOneShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductCard", "import_components", "import_useExposure", "import_context", "componentType", "componentName", "BuyOneGetOneShelfRoot", "className", "classNames", "theme", "title", "subtitle", "children", "props", "ref", "boxRef", "flattenChildren", "nodes", "result", "node", "layout", "BuyOneGetOneShelf", "ProductCard"]
7
7
  }
@@ -186,7 +186,7 @@ export interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HT
186
186
  giftType?: 1 | 2;
187
187
  /** 场景图片 */
188
188
  sceneImages?: ResponsiveImages;
189
- /** 布局模式(通常由父组件自动决定) */
189
+ /** @deprecated Layout is now automatically inferred by Root based on children count. */
190
190
  layout?: 'horizontal' | 'vertical';
191
191
  /** ProductCard 组件的自定义类名 */
192
192
  classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/types.ts"],
4
- "sourcesContent": ["import * as React from 'react'\nimport type { Theme } from '../../types/props'\n\n/**\n * \u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGift {\n /** \u8D60\u54C1ID */\n id: string\n /** \u8D60\u54C1\u56FE\u7247URL */\n image: string\n /** \u8D60\u54C1\u540D\u79F0 */\n name: string\n /** \u539F\u4EF7 */\n originalPrice: string\n /** \u73B0\u4EF7\uFF08\u901A\u5E38\u4E3AFree\uFF09 */\n currentPrice: string\n /** \u6570\u91CF */\n quantity: number\n /** \u53D8\u4F53ID */\n variantId: string\n /** SKU */\n sku: string\n /** \u53E5\u67C4 */\n handle: string\n /** \u8D60\u54C1tag */\n tag?: string\n}\n\n/**\n * \u5E26\u9009\u62E9\u72B6\u6001\u7684\u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGiftWithSelection extends FreeGift {\n /** \u662F\u5426\u5DF2\u9009\u4E2D */\n selected?: boolean\n}\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u63A5\u53E3\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant: 'outline' | 'fill' | 'promotional'\n /** \u4FC3\u9500\u7C7B\u578B\uFF08\u4EC5\u5F53 variant \u4E3A 'promotional' \u65F6\u6709\u6548\uFF09 */\n promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\n}\n\n// Root \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfRootSemanticName = 'root' | 'title' | 'description' | 'content'\n\n// ProductCard \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfProductCardSemanticName =\n | 'productCard'\n | 'productCardImage'\n | 'productCardTitle'\n | 'productCardDescription'\n | 'productCardPrice'\n | 'productCardGiftsContainer'\n | 'productCardBtnGroup'\n\n// \u5B8C\u6574\u7684\u8BED\u4E49\u7C7B\u540D\uFF08\u5411\u540E\u517C\u5BB9\uFF09\nexport type BuyOneGetOneShelfSemanticName = BuyOneGetOneShelfRootSemanticName | BuyOneGetOneShelfProductCardSemanticName\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u63A5\u53E3\n */\nexport interface ResponsiveImage {\n id: number\n baseUrl?: string\n url: string\n thumbnailURL?: string\n filename?: string\n mimeType?: string\n width?: number\n height?: number\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u96C6\u5408\u63A5\u53E3\n */\nexport interface ResponsiveImages {\n laptop?: ResponsiveImage\n mobile?: ResponsiveImage\n tablet?: ResponsiveImage\n desktop?: ResponsiveImage\n lgDesktop?: ResponsiveImage\n}\n\n/**\n * \u4EA7\u54C1\u57FA\u7840\u6570\u636E\u63A5\u53E3\n */\nexport interface BaseProductData {\n sku: string\n name: string\n image: string\n value: string\n handle: string\n shopify_id: string\n}\n\nexport interface WithGiftData {\n /**\n * \u8D60\u54C1\n */\n gifts: FreeGift[]\n /**\n * \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1\n */\n gift_type: 1 | 2\n}\n\n/**\n * \u7EAF\u4EA7\u54C1\u6570\u636E\u63A5\u53E3\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09\n */\nexport interface PureProductData extends BaseProductData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n availableForSale: boolean\n}\n\nexport interface ProductData extends BaseProductData, WithGiftData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n}\n\n// Alias for consistency with other components\nexport type ProductCardData = ProductData\n\n/**\n * \u6587\u6848\u914D\u7F6E\u63A5\u53E3\n */\nexport interface CopyConfig {\n shopNowText: string\n freeGiftLabel: string\n learnMoreText: string\n freeGiftHeading: string\n}\n\n/**\n * \u4E70\u8D60\u9879\u76EE\u63A5\u53E3\n */\nexport interface BogoItem {\n id: string\n data: ProductData[]\n images: ResponsiveImages\n shopNowFun: string\n shopNowText: string\n learnMoreText: string\n}\n\n/**\n * BuyOneGetOneShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3 - \u65B0\u683C\u5F0F\n */\nexport interface BuyOneGetOneShelfData {\n copy: CopyConfig\n theme: string\n title: string\n subtitle: string\n bogoItems: BogoItem[]\n}\n\n// Root \u7EC4\u4EF6 Props\uFF08\u65B0\u7684\u7EC4\u5408\u5F0F\u8BBE\u8BA1\uFF09\nexport interface BuyOneGetOneShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n theme?: Theme\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** Root \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfRootSemanticName, string>>\n}\n\n// \u5361\u7247\u7EC4\u4EF6Props - \u57FA\u4E8EProductCardProps\u4F46\u7B80\u5316\nexport interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u4EA7\u54C1\u6570\u636E */\n productData: BaseProductData & {\n description?: string\n currentPrice?: string\n originalPrice?: string\n learnMoreText?: string\n shopNowText?: string\n freeGiftLabel?: string\n }\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages?: ResponsiveImages\n /** \u5E03\u5C40\u6A21\u5F0F\uFF08\u901A\u5E38\u7531\u7236\u7EC4\u4EF6\u81EA\u52A8\u51B3\u5B9A\uFF09 */\n layout?: 'horizontal' | 'vertical'\n /** ProductCard \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n// \u4FDD\u6301\u5411\u540E\u517C\u5BB9\u7684\u4F20\u7EDFProps\nexport interface BuyOneGetOneShelfLegacyProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: BuyOneGetOneShelfData\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n onAddToCart?: (product: ProductCardData) => void\n /** \u8D60\u54C1\u70B9\u51FB\u4E8B\u4EF6 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u4E8B\u4EF6 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n classNames?: Partial<Record<BuyOneGetOneShelfSemanticName, string>>\n}\n"],
4
+ "sourcesContent": ["import * as React from 'react'\nimport type { Theme } from '../../types/props'\n\n/**\n * \u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGift {\n /** \u8D60\u54C1ID */\n id: string\n /** \u8D60\u54C1\u56FE\u7247URL */\n image: string\n /** \u8D60\u54C1\u540D\u79F0 */\n name: string\n /** \u539F\u4EF7 */\n originalPrice: string\n /** \u73B0\u4EF7\uFF08\u901A\u5E38\u4E3AFree\uFF09 */\n currentPrice: string\n /** \u6570\u91CF */\n quantity: number\n /** \u53D8\u4F53ID */\n variantId: string\n /** SKU */\n sku: string\n /** \u53E5\u67C4 */\n handle: string\n /** \u8D60\u54C1tag */\n tag?: string\n}\n\n/**\n * \u5E26\u9009\u62E9\u72B6\u6001\u7684\u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGiftWithSelection extends FreeGift {\n /** \u662F\u5426\u5DF2\u9009\u4E2D */\n selected?: boolean\n}\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u63A5\u53E3\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant: 'outline' | 'fill' | 'promotional'\n /** \u4FC3\u9500\u7C7B\u578B\uFF08\u4EC5\u5F53 variant \u4E3A 'promotional' \u65F6\u6709\u6548\uFF09 */\n promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\n}\n\n// Root \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfRootSemanticName = 'root' | 'title' | 'description' | 'content'\n\n// ProductCard \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfProductCardSemanticName =\n | 'productCard'\n | 'productCardImage'\n | 'productCardTitle'\n | 'productCardDescription'\n | 'productCardPrice'\n | 'productCardGiftsContainer'\n | 'productCardBtnGroup'\n\n// \u5B8C\u6574\u7684\u8BED\u4E49\u7C7B\u540D\uFF08\u5411\u540E\u517C\u5BB9\uFF09\nexport type BuyOneGetOneShelfSemanticName = BuyOneGetOneShelfRootSemanticName | BuyOneGetOneShelfProductCardSemanticName\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u63A5\u53E3\n */\nexport interface ResponsiveImage {\n id: number\n baseUrl?: string\n url: string\n thumbnailURL?: string\n filename?: string\n mimeType?: string\n width?: number\n height?: number\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u96C6\u5408\u63A5\u53E3\n */\nexport interface ResponsiveImages {\n laptop?: ResponsiveImage\n mobile?: ResponsiveImage\n tablet?: ResponsiveImage\n desktop?: ResponsiveImage\n lgDesktop?: ResponsiveImage\n}\n\n/**\n * \u4EA7\u54C1\u57FA\u7840\u6570\u636E\u63A5\u53E3\n */\nexport interface BaseProductData {\n sku: string\n name: string\n image: string\n value: string\n handle: string\n shopify_id: string\n}\n\nexport interface WithGiftData {\n /**\n * \u8D60\u54C1\n */\n gifts: FreeGift[]\n /**\n * \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1\n */\n gift_type: 1 | 2\n}\n\n/**\n * \u7EAF\u4EA7\u54C1\u6570\u636E\u63A5\u53E3\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09\n */\nexport interface PureProductData extends BaseProductData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n availableForSale: boolean\n}\n\nexport interface ProductData extends BaseProductData, WithGiftData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n}\n\n// Alias for consistency with other components\nexport type ProductCardData = ProductData\n\n/**\n * \u6587\u6848\u914D\u7F6E\u63A5\u53E3\n */\nexport interface CopyConfig {\n shopNowText: string\n freeGiftLabel: string\n learnMoreText: string\n freeGiftHeading: string\n}\n\n/**\n * \u4E70\u8D60\u9879\u76EE\u63A5\u53E3\n */\nexport interface BogoItem {\n id: string\n data: ProductData[]\n images: ResponsiveImages\n shopNowFun: string\n shopNowText: string\n learnMoreText: string\n}\n\n/**\n * BuyOneGetOneShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3 - \u65B0\u683C\u5F0F\n */\nexport interface BuyOneGetOneShelfData {\n copy: CopyConfig\n theme: string\n title: string\n subtitle: string\n bogoItems: BogoItem[]\n}\n\n// Root \u7EC4\u4EF6 Props\uFF08\u65B0\u7684\u7EC4\u5408\u5F0F\u8BBE\u8BA1\uFF09\nexport interface BuyOneGetOneShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n theme?: Theme\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** Root \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfRootSemanticName, string>>\n}\n\n// \u5361\u7247\u7EC4\u4EF6Props - \u57FA\u4E8EProductCardProps\u4F46\u7B80\u5316\nexport interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u4EA7\u54C1\u6570\u636E */\n productData: BaseProductData & {\n description?: string\n currentPrice?: string\n originalPrice?: string\n learnMoreText?: string\n shopNowText?: string\n freeGiftLabel?: string\n }\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages?: ResponsiveImages\n /** @deprecated Layout is now automatically inferred by Root based on children count. */\n layout?: 'horizontal' | 'vertical'\n /** ProductCard \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n// \u4FDD\u6301\u5411\u540E\u517C\u5BB9\u7684\u4F20\u7EDFProps\nexport interface BuyOneGetOneShelfLegacyProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: BuyOneGetOneShelfData\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n onAddToCart?: (product: ProductCardData) => void\n /** \u8D60\u54C1\u70B9\u51FB\u4E8B\u4EF6 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u4E8B\u4EF6 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n classNames?: Partial<Record<BuyOneGetOneShelfSemanticName, string>>\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAA,IAAAE,EAAuB",
6
6
  "names": ["types_exports", "__toCommonJS", "React"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var m=Object.create;var t=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var M=(e,i)=>{for(var r in i)t(e,r,{get:i[r],enumerable:!0})},d=(e,i,r,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of g(i))!P.call(e,s)&&s!==r&&t(e,s,{get:()=>i[s],enumerable:!(n=u(i,s))||n.enumerable});return e};var B=(e,i,r)=>(r=e!=null?m(S(e)):{},d(i||!e||!e.__esModule?t(r,"default",{value:e,enumerable:!0}):r,e)),y=e=>d(t({},"__esModule",{value:!0}),e);var h={};M(h,{default:()=>b});module.exports=y(h);var o=require("react/jsx-runtime"),w=B(require("react")),l=require("swiper/react"),a=require("swiper/modules"),k=require("swiper/css"),v=require("swiper/css/pagination");const f=w.default.forwardRef(({data:e,Slide:i,id:r,isHalf:n,paginationClassName:s},x)=>(0,o.jsxs)(l.Swiper,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1,el:`.swiper-pagination-${r}`},className:`!overflow-visible ${s||""}`,modules:[a.FreeMode,a.Mousewheel,a.Pagination],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:n?2:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:n?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((c,p)=>(0,o.jsx)(l.SwiperSlide,{className:"!h-[unset]",children:(0,o.jsx)(i,{data:c,configuration:{...e?.configuration,index:p}})},r+"SwiperSlide"+p)),(0,o.jsx)("div",{className:`swiper-pagination-${r} swiper-pagination`})]}));f.displayName="SwiperBox";var b=f;
1
+ "use strict";"use client";var S=Object.create;var l=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var b=(e,i)=>{for(var s in i)l(e,s,{get:i[s],enumerable:!0})},d=(e,i,s,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of P(i))!y.call(e,r)&&r!==s&&l(e,r,{get:()=>i[r],enumerable:!(n=M(i,r))||n.enumerable});return e};var h=(e,i,s)=>(s=e!=null?S(B(e)):{},d(i||!e||!e.__esModule?l(s,"default",{value:e,enumerable:!0}):s,e)),v=e=>d(l({},"__esModule",{value:!0}),e);var N={};b(N,{default:()=>x});module.exports=v(N);var o=require("react/jsx-runtime"),t=h(require("react")),p=require("swiper/react"),a=require("swiper/modules"),k=require("swiper/css"),G=require("swiper/css/pagination");const c=t.default.forwardRef(({data:e,Slide:i,id:s,isHalf:n,paginationClassName:r},u)=>{const[w,m]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{m(!0)},[]),w?(0,o.jsxs)(p.Swiper,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1,el:`.swiper-pagination-${s}`},className:`!overflow-visible ${r||""}`,modules:[a.FreeMode,a.Mousewheel,a.Pagination],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:n?2:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:n?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((g,f)=>(0,o.jsx)(p.SwiperSlide,{className:"!h-[unset]",children:(0,o.jsx)(i,{data:g,configuration:{...e?.configuration,index:f}})},s+"SwiperSlide"+f)),(0,o.jsx)("div",{className:`swiper-pagination-${s} swiper-pagination`})]}):(0,o.jsx)("div",{ref:u})});c.displayName="SwiperBox";var x=c;
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwBM,IAAAI,EAAA,6BAvBNC,EAAkB,oBAClBA,EAAoC,wBACpCC,EAAiD,0BACjDC,EAAO,sBACPC,EAAO,iCAgBP,MAAMC,EAAY,EAAAC,QAAM,WACtB,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,GAAAC,EAAI,OAAAC,EAAQ,oBAAAC,CAAoB,EAAGC,OAE/C,QAAC,UACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,GAChB,GAAI,sBAAsBH,CAAE,EAC9B,EACA,UAAW,qBAAqBE,GAAuB,EAAE,GACzD,QAAS,CAAC,WAAU,aAAY,YAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAeD,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,OACtB,OAAC,eAA8C,UAAU,aACvD,mBAACN,EAAA,CAAM,KAAMK,EAAM,cAAe,CAAE,GAAGN,GAAM,cAAe,MAAOO,CAAO,EAAG,GAD7DL,EAAK,cAAgBK,CAEvC,CACD,KACD,OAAC,OAAI,UAAW,qBAAqBL,CAAE,qBAAsB,GAC/D,CAGN,EAEAJ,EAAU,YAAc,YAExB,IAAOP,EAAQO",
6
- "names": ["SwiperCategory_exports", "__export", "SwiperCategory_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_modules", "import_css", "import_pagination", "SwiperBox", "React", "data", "Slide", "id", "isHalf", "paginationClassName", "ref", "item", "jIndex"]
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8Ba,IAAAI,EAAA,6BA7BbC,EAA2C,oBAC3CA,EAAoC,wBACpCC,EAAiD,0BACjDC,EAAO,sBACPC,EAAO,iCAgBP,MAAMC,EAAY,EAAAC,QAAM,WACtB,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,GAAAC,EAAI,OAAAC,EAAQ,oBAAAC,CAAoB,EAAGC,IAAQ,CACzD,KAAM,CAACC,EAAWC,CAAY,KAAI,YAAS,EAAK,EAMhD,SAJA,aAAU,IAAM,CACdA,EAAa,EAAI,CACnB,EAAG,CAAC,CAAC,EAEAD,KAKH,QAAC,UACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,GAChB,GAAI,sBAAsBJ,CAAE,EAC9B,EACA,UAAW,qBAAqBE,GAAuB,EAAE,GACzD,QAAS,CAAC,WAAU,aAAY,YAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAeD,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,OACtB,OAAC,eAA8C,UAAU,aACvD,mBAACR,EAAA,CAAM,KAAMO,EAAM,cAAe,CAAE,GAAGR,GAAM,cAAe,MAAOS,CAAO,EAAG,GAD7DP,EAAK,cAAgBO,CAEvC,CACD,KACD,OAAC,OAAI,UAAW,qBAAqBP,CAAE,qBAAsB,GAC/D,KAjDO,OAAC,OAAI,IAAKG,EAAkC,CAmDvD,CACF,EAEAP,EAAU,YAAc,YAExB,IAAOP,EAAQO",
6
+ "names": ["SwiperCategory_exports", "__export", "SwiperCategory_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_modules", "import_css", "import_pagination", "SwiperBox", "React", "data", "Slide", "id", "isHalf", "paginationClassName", "ref", "isMounted", "setIsMounted", "item", "jIndex"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var L=Object.create;var d=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},k=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of E(t))!S.call(e,n)&&n!==a&&d(e,n,{get:()=>t[n],enumerable:!(i=T(t,n))||i.enumerable});return e};var u=(e,t,a)=>(a=e!=null?L(M(e)):{},k(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),j=e=>k(d({},"__esModule",{value:!0}),e);var F={};D(F,{default:()=>z});module.exports=j(F);var o=require("react/jsx-runtime"),l=u(require("react")),r=require("../../helpers/utils.js"),h=u(require("../../components/picture.js")),N=require("../../shared/Styles.js"),_=u(require("../Title/index.js")),f=u(require("./SwiperCategory.js")),x=require("../../hooks/useExposure.js"),v=require("../../shared/trackUrlRef.js");const p="image",m="category_banner",g=5,H=3,P=(e,t)=>{const a=[];for(let i=0;i<e.length;i+=t)a.push(e.slice(i,i+t));return a},A=({data:e,configuration:t})=>{const a=(0,l.useRef)(null);return(0,x.useExposure)(a,{componentType:p,componentName:m,componentTitle:e?.name,position:t?.index+1}),(0,o.jsx)("div",{className:(0,r.cn)("relative max-h-[240px] overflow-hidden"),children:(0,o.jsx)("div",{className:(0,r.cn)("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:(0,o.jsxs)("div",{ref:a,className:(0,r.cn)("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",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:(0,o.jsx)("a",{"aria-label":e?.name,href:(0,v.trackUrlRef)(e?.link,`${p}_${m}`),"data-headless-type-name":`${p}#${m}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,o.jsx)(h.default,{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"})})}),(0,o.jsx)("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})]})})})},B=({data:e,configuration:t,index:a,isFirstItemLarger:i})=>{const n=(0,l.useRef)(null);(0,x.useExposure)(n,{componentType:p,componentName:m,componentTitle:e?.name,position:t?.index+1});const s=a===0;return(0,o.jsxs)("div",{ref:n,className:(0,r.cn)("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?(0,r.cn)("p-4",s?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("a",{href:(0,v.trackUrlRef)(e?.link,`${p}_${m}`),"data-headless-type-name":`${p}#${m}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-position":`''#${t?.index+1}`,onClick:()=>t?.event?.primaryButton(e,t?.index+1),children:(0,o.jsx)(h.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,r.cn)("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",i?(0,r.cn)(s?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),(0,o.jsx)("p",{className:(0,r.cn)("text-info-primary w-full text-center text-sm font-bold",i?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},R=({data:e,configuration:t})=>{const i=(t?.totalCategories??0)<=g;return(0,o.jsx)("div",{className:`gap-3 ${i?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((n,s)=>(0,o.jsx)(B,{index:s,data:n,configuration:t,isFirstItemLarger:i},s))})},C=l.default.forwardRef((e,t)=>{const{data:a,className:i="",key:n,event:s,...I}=e,c=(a?.isShowSelect?a?.products:a?.productData)||[],y=c.length>g,b=c.length,$=P(c,y?H:g),w=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>w.current),(0,o.jsxs)("div",{...I,ref:w,className:(0,r.cn)("w-full overflow-hidden",i,{"aiui-dark":a?.theme==="dark"}),children:[a?.title&&(0,o.jsx)(_.default,{data:{title:a?.title},className:"text-4xl"}),(0,o.jsx)("div",{className:"tablet:block hidden",children:(0,o.jsx)(f.default,{id:`Category${n}`,Slide:A,data:{list:c,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),(0,o.jsx)("div",{className:"tablet:hidden block",children:(0,o.jsx)(f.default,{id:`Category1${n}`,Slide:R,data:{list:$,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}},isHalf:y,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),(0,o.jsx)("div",{className:"h-7"})]})});C.displayName="Category";var z=(0,N.withLayout)(C);
1
+ "use strict";"use client";var L=Object.create;var d=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},_=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D(t))!M.call(e,i)&&i!==a&&d(e,i,{get:()=>t[i],enumerable:!(n=T(t,i))||n.enumerable});return e};var u=(e,t,a)=>(a=e!=null?L(E(e)):{},_(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),j=e=>_(d({},"__esModule",{value:!0}),e);var O={};S(O,{default:()=>F});module.exports=j(O);var o=require("react/jsx-runtime"),s=u(require("react")),r=require("../../helpers/utils.js"),h=u(require("../../components/picture.js")),I=require("../../shared/Styles.js"),$=u(require("../Title/index.js")),x=u(require("./SwiperCategory.js")),v=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js"),b=require("../AiuiProvider/index.js");const p="image",m="category_banner",f=5,A=3,P=(e,t)=>{const a=[];for(let n=0;n<e.length;n+=t)a.push(e.slice(n,n+t));return a},B=({data:e,configuration:t})=>{const a=(0,s.useRef)(null),{trackingData:n}=(0,b.useAiuiContext)(),i=n?.contextHandle||"";return(0,v.useExposure)(a,{componentType:p,componentName:m,componentTitle:e?.name,position:t?.index+1}),(0,o.jsx)("div",{className:(0,r.cn)("relative max-h-[240px] overflow-hidden"),children:(0,o.jsx)("div",{className:(0,r.cn)("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:(0,o.jsxs)("div",{ref:a,className:(0,r.cn)("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",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:(0,o.jsx)("a",{"aria-label":e?.name,href:(0,y.trackUrlRef)(e?.link,`${i}_${p}_${m}`),"data-headless-type-name":`${p}#${m}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,o.jsx)(h.default,{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"})})}),(0,o.jsx)("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})]})})})},R=({data:e,configuration:t,index:a,isFirstItemLarger:n})=>{const i=(0,s.useRef)(null),{trackingData:l}=(0,b.useAiuiContext)(),g=l?.contextHandle||"";(0,v.useExposure)(i,{componentType:p,componentName:m,componentTitle:e?.name,position:t?.index+1});const c=a===0;return(0,o.jsxs)("div",{ref:i,className:(0,r.cn)("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?(0,r.cn)("p-4",c?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("a",{href:(0,y.trackUrlRef)(e?.link,`${g}_${p}_${m}`),"data-headless-type-name":`${p}#${m}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-position":`''#${t?.index+1}`,onClick:()=>t?.event?.primaryButton(e,t?.index+1),children:(0,o.jsx)(h.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,r.cn)("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",n?(0,r.cn)(c?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),(0,o.jsx)("p",{className:(0,r.cn)("text-info-primary w-full text-center text-sm font-bold",n?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},z=({data:e,configuration:t})=>{const n=(t?.totalCategories??0)<=f;return(0,o.jsx)("div",{className:`gap-3 ${n?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((i,l)=>(0,o.jsx)(R,{index:l,data:i,configuration:t,isFirstItemLarger:n},l))})},N=s.default.forwardRef((e,t)=>{const{data:a,className:n="",key:i,event:l,...g}=e,c=(a?.isShowSelect?a?.products:a?.productData)||[],k=c.length>f,w=c.length,H=P(c,k?A:f),C=(0,s.useRef)(null);return(0,s.useImperativeHandle)(t,()=>C.current),(0,o.jsxs)("div",{...g,ref:C,className:(0,r.cn)("w-full overflow-hidden",n,{"aiui-dark":a?.theme==="dark"}),children:[a?.title&&(0,o.jsx)($.default,{data:{title:a?.title},className:"text-4xl"}),(0,o.jsx)("div",{className:"tablet:block hidden",children:(0,o.jsx)(x.default,{id:`Category${i}`,Slide:B,data:{list:c,configuration:{shape:a?.shape,event:l,title:a?.title,totalCategories:w}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),(0,o.jsx)("div",{className:"tablet:hidden block",children:(0,o.jsx)(x.default,{id:`Category1${i}`,Slide:z,data:{list:H,configuration:{shape:a?.shape,event:l,title:a?.title,totalCategories:w}},isHalf:k,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),(0,o.jsx)("div",{className:"h-7"})]})});N.displayName="Category";var F=(0,I.withLayout)(N);
2
2
  //# sourceMappingURL=index.js.map