@anker-in/headless-ui 1.3.38 → 1.3.39-alpha.1784616869310

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 (395) hide show
  1. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
  2. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
  3. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
  4. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
  5. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
  6. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
  7. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
  8. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
  9. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
  10. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
  11. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
  12. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
  13. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
  14. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
  15. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
  16. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
  17. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
  18. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
  19. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
  20. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
  21. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
  22. package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +7 -0
  23. package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
  24. package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
  25. package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +16 -0
  26. package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
  27. package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
  28. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +14 -0
  29. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
  30. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
  31. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
  32. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
  33. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
  34. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
  35. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
  36. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
  37. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +13 -0
  38. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
  39. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
  40. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
  41. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
  42. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
  43. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
  44. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js +2 -0
  45. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
  46. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +54 -0
  47. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
  48. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
  49. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
  50. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
  51. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
  52. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
  53. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
  54. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
  55. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +9 -0
  56. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +2 -0
  57. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
  58. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
  59. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
  60. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
  61. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
  62. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
  63. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
  64. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +12 -0
  65. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
  66. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
  67. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
  68. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
  69. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
  70. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
  71. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
  72. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
  73. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
  74. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
  75. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
  76. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
  77. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +2 -0
  78. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
  79. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
  80. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
  81. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
  82. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
  83. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
  84. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
  85. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
  86. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js +2 -0
  87. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
  88. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +36 -0
  89. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
  90. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
  91. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
  92. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js +2 -0
  93. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
  94. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +47 -0
  95. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
  96. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
  97. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
  98. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
  99. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
  100. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
  101. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
  102. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
  103. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
  104. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
  105. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
  106. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
  107. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
  108. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
  109. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
  110. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js +2 -0
  111. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
  112. package/dist/cjs/biz-components/CartDetail/index.d.ts +16 -0
  113. package/dist/cjs/biz-components/CartDetail/index.js +2 -0
  114. package/dist/cjs/biz-components/CartDetail/index.js.map +7 -0
  115. package/dist/cjs/biz-components/CartDetail/types.d.ts +132 -0
  116. package/dist/cjs/biz-components/CartDetail/types.js +2 -0
  117. package/dist/cjs/biz-components/CartDetail/types.js.map +7 -0
  118. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +13 -9
  119. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  120. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  121. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  122. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  123. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  124. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  125. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  126. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  127. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  128. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -0
  129. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  130. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  131. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.d.ts +48 -0
  132. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js +2 -0
  133. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js.map +7 -0
  134. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.d.ts +1 -1
  135. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  136. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  137. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +0 -2
  138. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  139. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +4 -4
  140. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.d.ts +3 -0
  141. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js +2 -0
  142. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js.map +7 -0
  143. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.d.ts +115 -0
  144. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js +2 -0
  145. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js.map +7 -0
  146. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  147. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  148. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  149. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  150. package/dist/cjs/biz-components/Listing/components/index.d.ts +0 -1
  151. package/dist/cjs/biz-components/Listing/components/index.js +1 -1
  152. package/dist/cjs/biz-components/Listing/components/index.js.map +3 -3
  153. package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +8 -2
  154. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  155. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  156. package/dist/cjs/biz-components/Listing/types/product.d.ts +0 -21
  157. package/dist/cjs/biz-components/Listing/types/product.js +1 -1
  158. package/dist/cjs/biz-components/Listing/types/product.js.map +1 -1
  159. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  160. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  161. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  162. package/dist/cjs/biz-components/NotifyMeDialog/index.d.ts +2 -0
  163. package/dist/cjs/biz-components/NotifyMeDialog/index.js +2 -0
  164. package/dist/cjs/biz-components/NotifyMeDialog/index.js.map +7 -0
  165. package/dist/cjs/biz-components/NotifyMeDialog/types.d.ts +111 -0
  166. package/dist/cjs/biz-components/NotifyMeDialog/types.js +2 -0
  167. package/dist/cjs/biz-components/NotifyMeDialog/types.js.map +7 -0
  168. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  169. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  170. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  171. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  172. package/dist/cjs/biz-components/index.d.ts +11 -3
  173. package/dist/cjs/biz-components/index.js +1 -1
  174. package/dist/cjs/biz-components/index.js.map +3 -3
  175. package/dist/cjs/components/breadcrumb.d.ts +12 -0
  176. package/dist/cjs/components/breadcrumb.js +2 -0
  177. package/dist/cjs/components/breadcrumb.js.map +7 -0
  178. package/dist/cjs/components/index.d.ts +2 -0
  179. package/dist/cjs/components/index.js +1 -1
  180. package/dist/cjs/components/index.js.map +3 -3
  181. package/dist/cjs/components/input-number.d.ts +22 -0
  182. package/dist/cjs/components/input-number.js +1 -1
  183. package/dist/cjs/components/input-number.js.map +3 -3
  184. package/dist/cjs/components/input.d.ts +5 -0
  185. package/dist/cjs/components/input.js +1 -1
  186. package/dist/cjs/components/input.js.map +3 -3
  187. package/dist/cjs/components/tabs.js +1 -1
  188. package/dist/cjs/components/tabs.js.map +3 -3
  189. package/dist/cjs/components/toast.d.ts +25 -0
  190. package/dist/cjs/components/toast.js +2 -0
  191. package/dist/cjs/components/toast.js.map +7 -0
  192. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
  193. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
  194. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
  195. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
  196. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
  197. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
  198. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
  199. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
  200. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
  201. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
  202. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
  203. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
  204. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
  205. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
  206. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
  207. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
  208. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
  209. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
  210. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
  211. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
  212. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
  213. package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +7 -0
  214. package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
  215. package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
  216. package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +16 -0
  217. package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
  218. package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
  219. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +14 -0
  220. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
  221. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
  222. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
  223. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
  224. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
  225. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
  226. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
  227. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
  228. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +13 -0
  229. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
  230. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
  231. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
  232. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
  233. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
  234. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
  235. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js +2 -0
  236. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
  237. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +54 -0
  238. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
  239. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
  240. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
  241. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
  242. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
  243. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
  244. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
  245. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
  246. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +9 -0
  247. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +1 -0
  248. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
  249. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
  250. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
  251. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
  252. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
  253. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
  254. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
  255. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +12 -0
  256. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
  257. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
  258. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
  259. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
  260. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
  261. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
  262. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
  263. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
  264. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
  265. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
  266. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
  267. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
  268. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +1 -0
  269. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
  270. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
  271. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
  272. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
  273. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
  274. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
  275. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
  276. package/dist/esm/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
  277. package/dist/esm/biz-components/CartDetail/CartItemRow/index.js +2 -0
  278. package/dist/esm/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
  279. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +36 -0
  280. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
  281. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
  282. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
  283. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js +2 -0
  284. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
  285. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +47 -0
  286. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
  287. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
  288. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
  289. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
  290. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
  291. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
  292. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
  293. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
  294. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
  295. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
  296. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
  297. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
  298. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
  299. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
  300. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
  301. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js +2 -0
  302. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
  303. package/dist/esm/biz-components/CartDetail/index.d.ts +16 -0
  304. package/dist/esm/biz-components/CartDetail/index.js +2 -0
  305. package/dist/esm/biz-components/CartDetail/index.js.map +7 -0
  306. package/dist/esm/biz-components/CartDetail/types.d.ts +132 -0
  307. package/dist/esm/biz-components/CartDetail/types.js +1 -0
  308. package/dist/esm/biz-components/CartDetail/types.js.map +7 -0
  309. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +13 -9
  310. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  311. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  312. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  313. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  314. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  315. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  316. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  317. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  318. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  319. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -0
  320. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  321. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  322. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.d.ts +48 -0
  323. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js +1 -0
  324. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js.map +7 -0
  325. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.d.ts +1 -1
  326. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  327. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  328. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +0 -2
  329. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  330. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +3 -3
  331. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.d.ts +3 -0
  332. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js +2 -0
  333. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js.map +7 -0
  334. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.d.ts +115 -0
  335. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js +1 -0
  336. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js.map +7 -0
  337. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  338. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  339. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  340. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  341. package/dist/esm/biz-components/Listing/components/index.d.ts +0 -1
  342. package/dist/esm/biz-components/Listing/components/index.js +1 -1
  343. package/dist/esm/biz-components/Listing/components/index.js.map +2 -2
  344. package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +8 -2
  345. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  346. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  347. package/dist/esm/biz-components/Listing/types/product.d.ts +0 -21
  348. package/dist/esm/biz-components/Listing/types/product.js.map +1 -1
  349. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  350. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  351. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  352. package/dist/esm/biz-components/NotifyMeDialog/index.d.ts +2 -0
  353. package/dist/esm/biz-components/NotifyMeDialog/index.js +2 -0
  354. package/dist/esm/biz-components/NotifyMeDialog/index.js.map +7 -0
  355. package/dist/esm/biz-components/NotifyMeDialog/types.d.ts +111 -0
  356. package/dist/esm/biz-components/NotifyMeDialog/types.js +1 -0
  357. package/dist/esm/biz-components/NotifyMeDialog/types.js.map +7 -0
  358. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  359. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  360. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  361. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  362. package/dist/esm/biz-components/index.d.ts +11 -3
  363. package/dist/esm/biz-components/index.js +1 -1
  364. package/dist/esm/biz-components/index.js.map +3 -3
  365. package/dist/esm/components/breadcrumb.d.ts +12 -0
  366. package/dist/esm/components/breadcrumb.js +2 -0
  367. package/dist/esm/components/breadcrumb.js.map +7 -0
  368. package/dist/esm/components/index.d.ts +2 -0
  369. package/dist/esm/components/index.js +1 -1
  370. package/dist/esm/components/index.js.map +3 -3
  371. package/dist/esm/components/input-number.d.ts +22 -0
  372. package/dist/esm/components/input-number.js +1 -1
  373. package/dist/esm/components/input-number.js.map +3 -3
  374. package/dist/esm/components/input.d.ts +5 -0
  375. package/dist/esm/components/input.js +1 -1
  376. package/dist/esm/components/input.js.map +3 -3
  377. package/dist/esm/components/tabs.js +1 -1
  378. package/dist/esm/components/tabs.js.map +3 -3
  379. package/dist/esm/components/toast.d.ts +25 -0
  380. package/dist/esm/components/toast.js +2 -0
  381. package/dist/esm/components/toast.js.map +7 -0
  382. package/package.json +1 -1
  383. package/style.css +275 -0
  384. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +0 -2
  385. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  386. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  387. package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +0 -2
  388. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +0 -2
  389. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +0 -7
  390. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +0 -2
  391. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  392. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  393. package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +0 -2
  394. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +0 -2
  395. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +0 -7
@@ -0,0 +1,111 @@
1
+ /**
2
+ * CheckboxConfig - 勾选框配置
3
+ *
4
+ * 每项独立控制展示与提交限制,顺序按数组顺序渲染。
5
+ * label 有值时展示该项,无值时跳过不渲染。
6
+ */
7
+ export interface CheckboxConfig {
8
+ /** checkbox 名称标识,用于提交时识别选中了哪些项 */
9
+ checkbox_id: string;
10
+ /** checkbox 旁展示的文案;为空或不传则不渲染该 checkbox */
11
+ label: string;
12
+ /** 是否必须勾选才能提交;true 时未勾选则按钮 disabled;默认 false */
13
+ required?: boolean;
14
+ }
15
+ /**
16
+ * SubscriptionMeta - 订阅元数据
17
+ *
18
+ * 区分 OOS 到货通知和活动订阅两种模式,确保提交时携带正确的业务参数。
19
+ */
20
+ export type SubscriptionMeta = {
21
+ /** 固定值,标识 OOS 到货通知 */
22
+ mode: 'oos';
23
+ } | {
24
+ /** 固定值,标识活动订阅 */
25
+ mode: 'activity';
26
+ /** 活动标识,由业务层从 activeNotifyInfo 配置中读取 */
27
+ dealsType: string;
28
+ };
29
+ /**
30
+ * ErrorDetail - 按错误码映射错误提示
31
+ *
32
+ * 支持消费方根据接口返回的错误码配置不同的提示文案。
33
+ * code 匹配时显示对应 message;未匹配到则回退到 errorSubmit。
34
+ */
35
+ export interface ErrorDetail {
36
+ /** 错误码,如 "422"、"500" */
37
+ code: string;
38
+ /** 该错误码对应的提示文案 */
39
+ message: string;
40
+ }
41
+ /**
42
+ * NotifyMeDialogCopy - 文案配置
43
+ *
44
+ * 将弹窗内所有可配置文案集中到一个对象中,
45
+ * 方便从 CMS / 多语言配置层一次性传入。
46
+ */
47
+ export interface NotifyMeDialogCopy {
48
+ /** 弹窗主标题,如 "Email me when available" */
49
+ title: string;
50
+ /** 弹窗副标题;为空时不渲染 */
51
+ subTitle?: string;
52
+ /** 邮箱输入框占位文案 */
53
+ emailPlaceholder?: string;
54
+ /** 提交按钮文案 */
55
+ submitBtnText?: string;
56
+ /** 邮箱输入框标签文案,默认 "Email address" */
57
+ emailLabel?: string;
58
+ /** 邮箱输入框为空时的错误提示 */
59
+ errorEmpty: string;
60
+ /** 邮箱格式不合法时的错误提示 */
61
+ errorInvalidEmail: string;
62
+ /** 必选 checkbox 未勾选时的提示文案 */
63
+ errorCheckboxRequired: string;
64
+ /** 接口调用失败时的默认错误提示,当 errorSubmitDetail 中未匹配到对应 code 时使用 */
65
+ errorSubmit?: string;
66
+ /** 按错误码映射的错误提示,code 匹配到时显示对应 message;未传入或不匹配时回退到 errorSubmit */
67
+ errorSubmitDetail?: ErrorDetail[];
68
+ /** 提交成功后的主标题 */
69
+ successTitle: string;
70
+ /** 提交成功后的副文案;为空时不渲染 */
71
+ successDesc?: string;
72
+ /** 提交成功后的按钮文案;为空时不渲染按钮 */
73
+ successBtnText?: string;
74
+ }
75
+ /**
76
+ * NotifyMeDialogSemanticName - 组件语义化区域名
77
+ *
78
+ * 用于 classNames prop,按语义区域自定义样式。
79
+ * 未传入的 key 使用组件默认样式。
80
+ */
81
+ export type NotifyMeDialogSemanticName = 'root' | 'header' | 'title' | 'subTitle' | 'emailInput' | 'checkboxes' | 'checkboxItem' | 'submitBtn' | 'errorText' | 'successText';
82
+ /**
83
+ * SubscribeFormData - 提交时暴露的完整表单数据
84
+ */
85
+ export interface SubscribeFormData {
86
+ /** 用户输入的邮箱 */
87
+ email: string;
88
+ /** 各 checkbox 的状态列表,仅包含配置了 name 的项 */
89
+ checkedItems: {
90
+ checkbox_id: string;
91
+ checked: boolean;
92
+ }[];
93
+ /** 订阅元数据 */
94
+ meta: SubscriptionMeta;
95
+ }
96
+ export interface NotifyMeDialogProps {
97
+ /** 是否打开弹窗 */
98
+ open: boolean;
99
+ /** 关闭弹窗回调 */
100
+ onOpenChange: (open: boolean) => void;
101
+ /** 文案配置 */
102
+ copy: NotifyMeDialogCopy;
103
+ /** 各区域自定义样式 */
104
+ classNames?: Partial<Record<NotifyMeDialogSemanticName, string>>;
105
+ /** 勾选框列表,支持配置多个;每项 label 有值时展示,无值时跳过 */
106
+ checkboxes?: CheckboxConfig[];
107
+ /** 订阅元数据,区分 OOS / 活动两种模式 */
108
+ subscriptionMeta: SubscriptionMeta;
109
+ /** 提交回调,接收完整表单数据,业务层决定调哪个接口 */
110
+ onSubmit: (data: SubscribeFormData) => Promise<void>;
111
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as l,jsxs as Se}from"react/jsx-runtime";import ie,{useState as L,useEffect as b,useRef as y,useImperativeHandle as oe,useId as le}from"react";import{cn as ce}from"../../helpers/utils.js";import{Tabs as me,TabsList as fe,TabsTrigger as pe}from"../../components/tabs.js";import ue from"../Title/index.js";import de from"../SwiperBox/index.js";import{withLayout as he}from"../../shared/Styles.js";import{gaTrack as V}from"../../shared/track.js";import{useMediaQuery as ge}from"react-responsive";import{useRollout as _e}from"../../hooks/useRollout.js";import{ShelfDisplayWrapItem as we,ShelfDisplayHorizontalItem as be}from"./shelfDisplayItem.js";const ye="image",Te="product_shelf",ve=f=>f==null?"default":String(f).replace(/[^a-zA-Z0-9_-]/g,"")||"default",B=ie.forwardRef(({key:f,data:p,event:E,buildData:T,breakpoints:N,className:z="",recommendedData:i,target:A="_self",metafields:q,isDisplayGudgments:v=!1,isDisplayBackImage:$=!1,renderOriginalPrice:O,renderPriceLabel:K,renderPrice:Q,onAddCart:W,onBuyNow:Z,onLearnMore:j,formatPrice:F,...G},J)=>{const{productsTab:a=[],productsCard:S=[],title:k,isShowTab:u=!0,tabShape:U="square",isShowTag:X=!1,isShowOriginalPrice:Y=!0,isShowRecommendedCard:I=!1,...ee}=p,[d,R]=L(""),[r,g]=L([]),D=y(!1),_=y(!1),x=y(null),te=le(),se=ge({query:"(max-width: 768px)"}),[ne,M]=_e({threshold:0}),h=r?.length<=1&&v,c=!se&&r?.length<=2&&v,w=e=>{switch(e){case 1440:return c?r?.length:4;case 1024:return c?r?.length:3;default:return c?r?.length:2.3}},P=()=>{V({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:i?.map((e,s)=>{const n=e?.variants?.find(t=>t?.sku===e?.sku)||e?.variants?.[0];return{item_id:e?.sku||n?.sku,item_name:e?.name,item_variant:n?.name,price:n?.price,index:s+1}})}})},m=(e,s)=>{if(s){const o=i?.map?.(n=>({...n,isShowRecommended:!0}));g(o?.length?o||[]:[])}else if(Array.isArray(e)){const n=e?.map?.(t=>{const H=T?.products?.find(re=>re?.handle===t?.handle);if(H)return{sku:t.sku,isShowRecommended:!1,custom_name:t.custom_name,custom_description:t.custom_description,custom_image:t.custom_image,custom_theme:t.custom_theme,custom_primary_link:t?.custom_primary_link||"",custom_secondary_link:t?.custom_secondary_link||"",custom_bg_image:t?.custom_bg_image||"",...H}})?.filter(t=>t);g(n?.length?n||[]:[])}else g([])};oe(J,()=>x.current),b(()=>{M&&i?.length&&!D.current&&(D.current=!0,P())},[M,i]),b(()=>{if(!_.current){if(!_.current&&i?.length&&(_.current=!0),u){const e=a?.find(s=>s?.tab===d)||a?.[0];R(e?.tab||""),m(e?.data||[],e?.isShowRecommendedTab);return}m(S,I)}},[i]),b(()=>{if(u){const e=a?.find(s=>s?.tab===d)||a?.[0];m(e?.data||[],e?.isShowRecommendedTab);return}m(S,I)},[T]);const ae=ve(d),C=`${te}-${ae}`;return Se("div",{ref:x,...G,className:ce("shelf-display-wrap text-info-primary w-full",z,{"aiui-dark":p?.theme==="dark"}),children:[k&&l(ue,{data:{title:k}}),u&&a?.length>0&&l(me,{value:d,onValueChange:e=>{const s=a?.find(o=>o?.tab===e);if(s){if(R(e),m(s.data||[],s.isShowRecommendedTab),!s.isShowRecommendedTab){V({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:ye,component_name:Te,component_title:p?.title,component_position:1,navigation:e}});return}P()}},shape:U==="rounded"?"rounded":"square",children:l(fe,{children:a.map(e=>l(pe,{value:e?.tab,children:e?.tab||""},e?.id||e?.tab))})}),l("div",{ref:ne,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:l(de,{data:{list:r,configuration:{...ee,event:E,isShowTag:X,isShowOriginalPrice:Y,target:A,metafields:q,itemLength:r?.length,isDisplayBackImage:$,renderOriginalPrice:O,renderPriceLabel:K,renderPrice:Q,onAddCart:W,onBuyNow:Z,onLearnMore:j,formatPrice:F}},id:C,className:`${u?"mt-6":""} shelf-display-swiper-box !overflow-visible`,itemClassName:c?"flex-1":"",Slide:c?be:we,breakpoints:N||{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h?1:1.2},768:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:w()},1024:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:w(1024)},1440:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:w(1440)}}},C)})]})});B.displayName="ShelfDisplay";var Ve=he(B);export{Ve as default};
1
+ "use client";import{jsx as i,jsxs as z}from"react/jsx-runtime";import re,{useState as ie,useEffect as H,useRef as L,useImperativeHandle as ae,useId as le,useMemo as b,useCallback as ce}from"react";import{cn as me}from"../../helpers/utils.js";import{Tabs as pe,TabsList as ue,TabsTrigger as fe,TabsContent as de}from"../../components/tabs.js";import he from"../Title/index.js";import _e from"../SwiperBox/index.js";import{withLayout as ge}from"../../shared/Styles.js";import{gaTrack as C}from"../../shared/track.js";import{useMediaQuery as be}from"react-responsive";import{useRollout as we}from"../../hooks/useRollout.js";import{ShelfDisplayWrapItem as ye,ShelfDisplayHorizontalItem as ve}from"./shelfDisplayItem.js";const ke="image",Se="product_shelf",E=a=>a==null?"default":String(a).replace(/[^a-zA-Z0-9_-]/g,"")||"default";function w(a){return a.trim().replace(/\s+/g,"-")}const N=re.forwardRef(({key:a,data:p,event:q,buildData:u,breakpoints:$,className:I="",recommendedData:o,target:O="_self",metafields:A,isDisplayGudgments:c=!1,isDisplayBackImage:Q=!1,renderOriginalPrice:W,renderPriceLabel:Z,renderPrice:j,onAddCart:F,onBuyNow:J,onLearnMore:K,formatPrice:U,...X},Y)=>{const{productsTab:r=[],productsCard:y=[],title:v,isShowTab:m=!0,tabShape:G="square",isShowTag:ee=!1,isShowOriginalPrice:ne=!0,isShowRecommendedCard:k=!1,...se}=p,[f,S]=ie(""),T=L(!1),x=L(null),te=le(),h=be({query:"(max-width: 768px)"}),[D,R]=we({threshold:0}),oe=E(te),M=ce(e=>e.isShowRecommendedTab?o?.map(n=>({...n,isShowRecommended:!0}))||[]:e.data?.map(n=>{const s=u?.products?.find(t=>t?.handle===n?.handle);if(s)return{sku:n.sku,isShowRecommended:!1,custom_name:n.custom_name,custom_description:n.custom_description,custom_image:n.custom_image,custom_theme:n.custom_theme,custom_primary_link:n?.custom_primary_link||"",custom_secondary_link:n?.custom_secondary_link||"",custom_bg_image:n?.custom_bg_image||"",...s}}).filter(Boolean)||[],[u,o]),d=b(()=>r.map(e=>({...e,resolvedData:M(e)})),[r,M]),_=b(()=>k?o?.map(e=>({...e,isShowRecommended:!0}))||[]:y?.map(e=>{const n=u?.products?.find(s=>s?.handle===e?.handle);if(n)return{sku:e.sku,isShowRecommended:!1,custom_name:e.custom_name,custom_description:e.custom_description,custom_image:e.custom_image,custom_theme:e.custom_theme,custom_primary_link:e?.custom_primary_link||"",custom_secondary_link:e?.custom_secondary_link||"",custom_bg_image:e?.custom_bg_image||"",...n}}).filter(Boolean)||[],[y,u,o,k]),B=b(()=>m?d.find(n=>w(n?.tab)===w(f))?.resolvedData||d[0]?.resolvedData||[]:_,[m,d,f,_]),Te=B?.length<=1&&c,xe=!h&&B?.length<=2&&c,g=(e,n)=>{const s=!h&&e?.length<=2&&c;switch(n){case 1440:return s?e?.length:4;case 1024:return s?e?.length:3;default:return s?e?.length:2.3}},P=()=>{C({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:o?.map((e,n)=>{const t=e?.variants?.find(l=>l?.sku===e?.sku)||e?.variants?.[0];return{item_id:e?.sku||t?.sku,item_name:e?.name,item_variant:t?.name,price:t?.price,index:n+1}})}})};ae(Y,()=>x.current),H(()=>{R&&o?.length&&!T.current&&(T.current=!0,P())},[R,o]),H(()=>{m&&r?.length>0&&!f&&S(r[0]?.tab||"")},[]);const V=(e,n)=>{const s=`${oe}-${E(n)}`,t=!h&&e?.length<=2&&c,l=e?.length<=1&&c;return i(_e,{data:{list:e,configuration:{...se,event:q,isShowTag:ee,isShowOriginalPrice:ne,target:O,metafields:A,itemLength:e?.length,isDisplayBackImage:Q,renderOriginalPrice:W,renderPriceLabel:Z,renderPrice:j,onAddCart:F,onBuyNow:J,onLearnMore:K,formatPrice:U}},id:s,className:`${m?"mt-6":""} shelf-display-swiper-box !overflow-visible`,itemClassName:t?"flex-1":"",Slide:t?ve:ye,breakpoints:$||{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:l?1:1.2},768:{spaceBetween:l?0:16,freeMode:!1,slidesPerView:g(e)},1024:{spaceBetween:l?0:16,freeMode:!1,slidesPerView:g(e,1024)},1440:{spaceBetween:l?0:16,freeMode:!1,slidesPerView:g(e,1440)}}},s)};return z("div",{ref:x,...X,className:me("shelf-display-wrap text-info-primary w-full",I,{"aiui-dark":p?.theme==="dark"}),children:[v&&i(he,{data:{title:v}}),m&&r?.length>0?z(pe,{value:f,onValueChange:e=>{const n=r?.find(s=>w(s?.tab)===e);if(n){if(S(e),!n.isShowRecommendedTab){C({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:ke,component_name:Se,component_title:p?.title,component_position:1,navigation:e}});return}P()}},shape:G==="rounded"?"rounded":"square",children:[i(ue,{children:r.map(e=>i(fe,{value:e?.tab,children:e?.tab||""},e?.id||e?.tab))}),d.map(e=>i(de,{value:e?.tab,children:i("div",{ref:D,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:V(e.resolvedData||[],e?.tab||"")})},e?.id||e?.tab))]}):i("div",{ref:D,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:V(_,"card")})]})});N.displayName="ShelfDisplay";var Ne=ge(N);export{Ne as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle, useId } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst sanitizeCssSelector = (value?: string | number) => {\n if (value === undefined || value === null) return 'default'\n const sanitized = String(value).replace(/[^a-zA-Z0-9_-]/g, '')\n return sanitized || 'default'\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n metafields,\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n onAddCart,\n onBuyNow,\n onLearnMore,\n formatPrice,\n ...rest\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isView = useRef<boolean>(false)\n const isRecommend = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n const instanceId = useId()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (size?: number) => {\n switch (size) {\n case 1440:\n return isShowGudgments ? currentItems?.length : 4\n case 1024:\n return isShowGudgments ? currentItems?.length : 3\n default:\n return isShowGudgments ? currentItems?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n custom_image: item.custom_image,\n custom_theme: item.custom_theme,\n custom_primary_link: item?.custom_primary_link || '',\n custom_secondary_link: item?.custom_secondary_link || '',\n custom_bg_image: item?.custom_bg_image || '',\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n setTabId(currentTab?.tab || '')\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n useEffect(() => {\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n // buildData \u66F4\u65B0\u65F6\u9700\u8981\u91CD\u65B0\u8BA1\u7B97\u5F53\u524D\u5217\u8868\n }, [buildData])\n\n const safeTabKey = sanitizeCssSelector(tabId)\n const swiperInstanceId = `${instanceId}-${safeTabKey}`\n\n return (\n <div\n ref={innerRef}\n {...rest}\n className={cn('shelf-display-wrap text-info-primary w-full', className, {\n 'aiui-dark': data?.theme === 'dark',\n })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && productsTab?.length > 0 && (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab?.find(item => item?.tab === value)\n if (currentTab) {\n setTabId(value)\n handleCurrentTab(currentTab.data || [], currentTab.isShowRecommendedTab)\n if (!currentTab.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: value,\n },\n })\n return\n }\n gackViewEvent()\n }\n }}\n shape={tabShape === 'rounded' ? 'rounded' : 'square'}\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item?.id || item?.tab} value={item?.tab}>\n {item?.tab || ''}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n key={swiperInstanceId}\n data={{\n list: currentItems,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n metafields: metafields,\n itemLength: currentItems?.length,\n isDisplayBackImage: isDisplayBackImage,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n onAddCart,\n onBuyNow,\n onLearnMore,\n formatPrice,\n },\n }}\n id={swiperInstanceId}\n className={`${isShowTab ? 'mt-6' : ''} shelf-display-swiper-box !overflow-visible`}\n itemClassName={isShowGudgments ? 'flex-1' : ''}\n Slide={isShowGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: isOnce ? 1 : 1.2,\n },\n 768: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(),\n },\n 1024: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1024),\n },\n 1440: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1440),\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nShelfDisplay.displayName = 'ShelfDisplay'\nexport default withLayout(ShelfDisplay)\n"],
5
- "mappings": "aAsLM,OAOY,OAAAA,EAPZ,QAAAC,OAAA,oBArLN,OAAOC,IAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,GAAqB,SAAAC,OAAa,QAC/E,OAAS,MAAAC,OAAU,yBACnB,OAAS,QAAAC,GAAM,YAAAC,GAAU,eA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cA,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,CAChC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,CACF,GApDGe,CAsDP,EACF,GACF,CAEJ,CACF,EAEA1D,EAAa,YAAc,eAC3B,IAAO2D,GAAQrE,GAAWU,CAAY",
6
- "names": ["jsx", "jsxs", "React", "useState", "useEffect", "useRef", "useImperativeHandle", "useId", "cn", "Tabs", "TabsList", "TabsTrigger", "Title", "SwiperBox", "withLayout", "gaTrack", "useMediaQuery", "useRollout", "ShelfDisplayWrapItem", "ShelfDisplayHorizontalItem", "componentType", "componentName", "sanitizeCssSelector", "value", "ShelfDisplay", "key", "data", "event", "buildData", "breakpoints", "className", "recommendedData", "target", "metafields", "isDisplayGudgments", "isDisplayBackImage", "renderOriginalPrice", "renderPriceLabel", "renderPrice", "onAddCart", "onBuyNow", "onLearnMore", "formatPrice", "rest", "ref", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowTag", "isShowOriginalPrice", "isShowRecommendedCard", "other", "tabId", "setTabId", "currentItems", "setCurrentItems", "isView", "isRecommend", "innerRef", "instanceId", "isMobile", "viewRef", "inView", "isOnce", "isShowGudgments", "showItemLength", "size", "gackViewEvent", "item", "index", "variant", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "params", "currentTab", "safeTabKey", "swiperInstanceId", "ShelfDisplay_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle, useId, useMemo, useCallback } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst sanitizeCssSelector = (value?: string | number) => {\n if (value === undefined || value === null) return 'default'\n const sanitized = String(value).replace(/[^a-zA-Z0-9_-]/g, '')\n return sanitized || 'default'\n}\n\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/\\s+/g, '-')\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n metafields,\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n onAddCart,\n onBuyNow,\n onLearnMore,\n formatPrice,\n ...rest\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n\n const isView = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n const instanceId = useId()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const safeInstanceId = sanitizeCssSelector(instanceId)\n\n const resolveTabData = useCallback(\n (tabItem: any) => {\n if (tabItem.isShowRecommendedTab) {\n return recommendedData?.map((item: any) => ({ ...item, isShowRecommended: true })) || []\n }\n return (\n tabItem.data\n ?.map((dataItem: ShelfDisplayItem) => {\n const findData = buildData?.products?.find((params: any) => params?.handle === dataItem?.handle)\n if (findData) {\n return {\n sku: dataItem.sku,\n isShowRecommended: false,\n custom_name: dataItem.custom_name,\n custom_description: dataItem.custom_description,\n custom_image: dataItem.custom_image,\n custom_theme: dataItem.custom_theme,\n custom_primary_link: dataItem?.custom_primary_link || '',\n custom_secondary_link: dataItem?.custom_secondary_link || '',\n custom_bg_image: dataItem?.custom_bg_image || '',\n ...findData,\n }\n }\n })\n .filter(Boolean) || []\n )\n },\n [buildData, recommendedData]\n )\n\n const resolvedTabs = useMemo(() => {\n return productsTab.map(item => ({ ...item, resolvedData: resolveTabData(item) }))\n }, [productsTab, resolveTabData])\n\n const cardItems = useMemo(() => {\n if (isShowRecommendedCard) {\n return recommendedData?.map((item: any) => ({ ...item, isShowRecommended: true })) || []\n }\n return (\n productsCard\n ?.map((dataItem: ShelfDisplayItem) => {\n const findData = buildData?.products?.find((params: any) => params?.handle === dataItem?.handle)\n if (findData) {\n return {\n sku: dataItem.sku,\n isShowRecommended: false,\n custom_name: dataItem.custom_name,\n custom_description: dataItem.custom_description,\n custom_image: dataItem.custom_image,\n custom_theme: dataItem.custom_theme,\n custom_primary_link: dataItem?.custom_primary_link || '',\n custom_secondary_link: dataItem?.custom_secondary_link || '',\n custom_bg_image: dataItem?.custom_bg_image || '',\n ...findData,\n }\n }\n })\n .filter(Boolean) || []\n )\n }, [productsCard, buildData, recommendedData, isShowRecommendedCard])\n\n const currentItems = useMemo(() => {\n if (!isShowTab) return cardItems\n const tab = resolvedTabs.find(item => sanitizeTabValue(item?.tab) === sanitizeTabValue(tabId))\n return tab?.resolvedData || resolvedTabs[0]?.resolvedData || []\n }, [isShowTab, resolvedTabs, tabId, cardItems])\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (items: ShelfDisplayItem[], size?: number) => {\n const showGudgments = !isMobile && items?.length <= 2 && isDisplayGudgments\n switch (size) {\n case 1440:\n return showGudgments ? items?.length : 4\n case 1024:\n return showGudgments ? items?.length : 3\n default:\n return showGudgments ? items?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n useEffect(() => {\n if (isShowTab && productsTab?.length > 0 && !tabId) {\n setTabId(productsTab[0]?.tab || '')\n }\n }, [])\n\n const renderSwiperBox = (items: ShelfDisplayItem[], tabKey: string) => {\n const swipperId = `${safeInstanceId}-${sanitizeCssSelector(tabKey)}`\n const showGudgments = !isMobile && items?.length <= 2 && isDisplayGudgments\n const once = items?.length <= 1 && isDisplayGudgments\n\n return (\n <SwiperBox\n key={swipperId}\n data={{\n list: items,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n metafields: metafields,\n itemLength: items?.length,\n isDisplayBackImage: isDisplayBackImage,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n onAddCart,\n onBuyNow,\n onLearnMore,\n formatPrice,\n },\n }}\n id={swipperId}\n className={`${isShowTab ? 'mt-6' : ''} shelf-display-swiper-box !overflow-visible`}\n itemClassName={showGudgments ? 'flex-1' : ''}\n Slide={showGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: once ? 1 : 1.2,\n },\n 768: {\n spaceBetween: once ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(items),\n },\n 1024: {\n spaceBetween: once ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(items, 1024),\n },\n 1440: {\n spaceBetween: once ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(items, 1440),\n },\n }\n }\n />\n )\n }\n\n return (\n <div\n ref={innerRef}\n {...rest}\n className={cn('shelf-display-wrap text-info-primary w-full', className, {\n 'aiui-dark': data?.theme === 'dark',\n })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && productsTab?.length > 0 ? (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab?.find(item => sanitizeTabValue(item?.tab) === value)\n if (currentTab) {\n setTabId(value)\n if (!currentTab.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: value,\n },\n })\n return\n }\n gackViewEvent()\n }\n }}\n shape={tabShape === 'rounded' ? 'rounded' : 'square'}\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item?.id || item?.tab} value={item?.tab}>\n {item?.tab || ''}\n </TabsTrigger>\n ))}\n </TabsList>\n {resolvedTabs.map(item => (\n <TabsContent key={item?.id || item?.tab} value={item?.tab}>\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n {renderSwiperBox(item.resolvedData || [], item?.tab || '')}\n </div>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n {renderSwiperBox(cardItems, 'card')}\n </div>\n )}\n </div>\n )\n }\n)\n\nShelfDisplay.displayName = 'ShelfDisplay'\nexport default withLayout(ShelfDisplay)\n"],
5
+ "mappings": "aAuMQ,cAAAA,EAqEE,QAAAC,MArEF,oBAt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
+ "names": ["jsx", "jsxs", "React", "useState", "useEffect", "useRef", "useImperativeHandle", "useId", "useMemo", "useCallback", "cn", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "Title", "SwiperBox", "withLayout", "gaTrack", "useMediaQuery", "useRollout", "ShelfDisplayWrapItem", "ShelfDisplayHorizontalItem", "componentType", "componentName", "sanitizeCssSelector", "value", "sanitizeTabValue", "ShelfDisplay", "key", "data", "event", "buildData", "breakpoints", "className", "recommendedData", "target", "metafields", "isDisplayGudgments", "isDisplayBackImage", "renderOriginalPrice", "renderPriceLabel", "renderPrice", "onAddCart", "onBuyNow", "onLearnMore", "formatPrice", "rest", "ref", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowTag", "isShowOriginalPrice", "isShowRecommendedCard", "other", "tabId", "setTabId", "isView", "innerRef", "instanceId", "isMobile", "viewRef", "inView", "safeInstanceId", "resolveTabData", "tabItem", "item", "dataItem", "findData", "params", "resolvedTabs", "cardItems", "currentItems", "isOnce", "isShowGudgments", "showItemLength", "items", "size", "showGudgments", "gackViewEvent", "index", "variant", "v", "renderSwiperBox", "tabKey", "swipperId", "once", "currentTab", "ShelfDisplay_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as ge,jsx as i,jsxs as b}from"react/jsx-runtime";import{useAiuiContext as ve}from"../AiuiProvider/index.js";import{formatVariantPrice as be}from"./shelfDisplay.js";import he from"../../components/picture.js";import xe from"../../components/badge.js";import{cn as v}from"../../helpers/utils.js";import{Text as ke}from"../../components/text.js";import ie from"../../components/button.js";import{gaTrack as we}from"../../shared/track.js";import{trackUrlRef as _e}from"../../shared/trackUrlRef.js";import{Heading as Se}from"../../components/heading.js";import{useExposure as Ne}from"../../hooks/useExposure.js";import{useRef as Te,useEffect as Be,useMemo as oe,useState as B}from"react";const ne="image",le="product_shelf",ae=999999999e-2,Ce=e=>{const t=e?.sku,C=e?.variants,P=C?.find(L=>L?.sku===t),W=P?.image?.url||C?.[0]?.image?.url||"",U=P?.image?.altText||C?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:W,altText:U}},ze=({data:e,configuration:t})=>{const{isDisplayBackImage:C=!1,itemShape:P,metafields:W,isTopTag:U=!1,isShowTag:L,isShowOriginalPrice:Q,isShowShortTitle:ce=!1,formatPrice:$,renderOriginalPrice:z,renderPriceLabel:X,renderPrice:y}=t||{},{locale:_="es",copyWriting:me,currencyDisplay:Y}=ve(),{discounts:Z,discountsCopy:H}=W||{},E=Te(null),[R,ee]=B([]),[V,pe]=B(""),[te,c]=B(!1),[q,se]=B(!1),D=(s,r,o,l)=>{const{primaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.primaryButton?.(s,r+1,o,l)},de=(s,r,o,l)=>{const{secondaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.secondaryButton?.(s,r+1,o,l)},m=oe(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(r=>r?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=m?.id?.split?.("/")||[],G=u?.[u?.length-1],S=!m?.availableForSale||m?.price?.amount===ae||m?.price===ae,h=m?.coupons?.[0],N=!!(Q&&h),T=e?.price?.currencyCode||"USD",k=oe(()=>be({locale:_,amount:N?h?.variant_price4wscode:m?.price,baseAmount:N?m?.price:0,currencyCode:T,currencyDisplay:Y,customFormatPrice:$}),[T,_,N,h?.variant_price4wscode,m,$]),{price:x,basePrice:I,discount:w,discountAmount:f}=k,{imageUrl:A,altText:F}=Ce(e),M=e?.custom_name||e?.title,J=ce&&m?.metafields?.infos?.page_short_title||M,j=e?.custom_description||e?.description,ue=()=>{if(h?.value_type==="fixed_amount"){const s=f||"",r=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,o,l,p]=r;let d=l;return l.endsWith(".00")?d=l.replace(/\.00$/,""):l.endsWith(",00")&&(d=l.replace(/,00$/,"")),`${o}${d}${p}`}return s}return w||""};Be(()=>{let s=[];if(w||f){const o=`${ue()} ${Z?.off||H?.off||""}`;pe(o),s.push(o)}const r=e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,w?1:2);ee(s.concat(r))},[e?.tags,w,f,Z?.off,H?.off]),Ne(E,{componentType:ne,componentName:le,componentTitle:M,componentDescription:j,position:t?.index+1});const fe=async()=>{if(!te&&!e?.custom_primary_link){c(!0);try{await D(e,t?.index,t,h)}finally{c(!1)}}},O=async()=>{if(!q&&!e?.custom_secondary_link){se(!0);try{await de(e,t?.index,t,h)}finally{se(!1)}}},re=()=>b(ge,{children:[L&&R?.length>0?i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:R?.map?.((s,r)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:s},r))}):null,J?i(Se,{as:"h3",title:J||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12",html:J||""}):null,i(ke,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm",html:j||""}),i("div",{className:"mb-2 mt-4 flex items-center",children:y?y(e,{price:x,basePrice:I,discount:w,discountAmount:f,variant:m,coupon:h,isSoldOut:S}):S?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:me?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:m?.availableForSale&&x||""}),z?z(e,{price:x,basePrice:I,discount:w,discountAmount:f}):I&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&I||""})]})}),!y&&X?.(e,m),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:S&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:O,loading:q,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:S&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:fe,loading:te,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]}),n=e?.custom_bg_image,a=e?.custom_theme;return i("div",{ref:E,className:v("box-border w-full cursor-pointer overflow-hidden duration-300","rounded-box","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item",n?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":a==="dark"}),style:n?{backgroundImage:`url(${n})`}:void 0,children:C?i("div",{className:"absolute inset-0 box-border overflow-hidden",children:b("div",{className:"relative inset-0 size-full",children:[i(he,{source:A,alt:F,className:v("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":n})}),i("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:re()})]})}):b("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[V&&U&&i(xe,{className:"shelf-prices-tag absolute left-4 top-4 z-10",variant:"fill",children:V||""}),i("div",{className:v("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden",{"opacity-0":n}),children:i("a",{"aria-label":M,target:t?.target,href:_e(`${_==="us"||!_?"":`/${_}`}/products/${e?.handle}?variant=${G}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:i(he,{source:A,alt:F,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),re()]})},e?.id||e?.handle)},He=({data:e,configuration:t})=>{const{itemShape:C,itemLength:P,metafields:W,isShowShortTitle:U,formatPrice:L,renderOriginalPrice:Q,renderPriceLabel:ce,renderPrice:$}=t||{},{discounts:z,discountsCopy:X}=W||{},{locale:y="us",copyWriting:_,currencyDisplay:me}=ve(),[Y,Z]=B([]),H=Te(null),[E,R]=B(!1),[ee,V]=B(!1),pe=(n,a,s,r)=>{const{primaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.primaryButton?.(n,a+1,s,r)},te=(n,a,s,r)=>{const{secondaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.secondaryButton?.(n,a+1,s,r)},c=oe(()=>{const n=e?.variants||[];if(n.length)return e?.sku&&n.find(a=>a?.sku===e?.sku)||n[0]},[e?.sku,e?.variants]),q=c?.id?.split?.("/")||[],se=q?.[q?.length-1],D=!c?.availableForSale||c?.price?.amount===ae||c?.price===ae,de=t?.isShowTag,m=t?.isShowOriginalPrice,u=c?.coupons?.[0],G=!!(m&&u),S=e?.price?.currencyCode||"USD",h=oe(()=>be({locale:y,amount:G?u?.variant_price4wscode:c?.price,baseAmount:G?c?.price:0,currencyCode:S,currencyDisplay:me,customFormatPrice:L}),[S,y,G,u?.variant_price4wscode,c,L]),{price:N,basePrice:T,discount:k,discountAmount:x}=h,{imageUrl:I,altText:w}=Ce(e),f=e?.custom_name||e?.title,A=U&&c?.metafields?.infos?.page_short_title||f,F=e?.custom_description||e?.description;Ne(H,{componentType:ne,componentName:le,componentTitle:f,componentDescription:F,position:t?.index+1});const M=async()=>{if(!E&&!e?.custom_primary_link){R(!0);try{await pe(e,t?.index,t,u)}finally{R(!1)}}},J=async()=>{if(!ee&&!e?.custom_secondary_link){V(!0);try{await te(e,t?.index,t,u)}finally{V(!1)}}},j=()=>P>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},ue=()=>P>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",fe=()=>{if(u?.value_type==="fixed_amount"){const n=x||"",a=n.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,r,o]=a;let l=r;return r.endsWith(".00")?l=r.replace(/\.00$/,""):r.endsWith(",00")&&(l=r.replace(/,00$/,"")),`${s}${l}${o}`}return n}return k||""};Be(()=>{let n=[];if(k||x){const s=`${fe()} ${z?.off||X?.off||""}`;n.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,k?1:2);Z(n.concat(a))},[e?.tags,k,x,z?.off,X?.off]);const O=e?.custom_bg_image,re=e?.custom_theme;return i("div",{ref:H,className:v(j().wrap,"rounded-box","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",O?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":re==="dark"}),style:O?{backgroundImage:`url(${O})`}:void 0,children:b("div",{className:v(ue(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[i("div",{className:v(j().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":O}),children:i("a",{"aria-label":f,target:t?.target,href:_e(`${y==="us"||!y?"":`/${y}`}/products/${e?.handle}?variant=${se}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||c?.sku,item_name:e?.name,item_variant:c?.name,price:c?.price,index:t?.index+1}]}})},children:i(he,{source:I,alt:w,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),b("div",{className:v("flex flex-col items-start justify-center",j().boxItem),children:[de&&i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:Y?.length>0&&Y?.map?.((n,a)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:n},a))}),A?i(Se,{as:"h3",title:A||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:A||""}):null,F?i(ke,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:F||""}):null,i("div",{className:"mb-2 mt-5 flex items-center",children:$?$(e,{price:N,basePrice:T,discount:k,discountAmount:x,variant:c,coupon:u,isSoldOut:D}):D?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:_?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:c?.availableForSale&&N||""}),Q?Q(e,{price:N,basePrice:T,discount:k,discountAmount:x}):T&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:c?.availableForSale&&T||""})]})}),!$&&ce?.(e,c),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:D&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:J,loading:ee,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:D&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:M,loading:E,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{He as ShelfDisplayHorizontalItem,ze as ShelfDisplayWrapItem,Ce as getProductImage};
1
+ import{Fragment as ge,jsx as i,jsxs as b}from"react/jsx-runtime";import{useAiuiContext as ve}from"../AiuiProvider/index.js";import{formatVariantPrice as be}from"./shelfDisplay.js";import he from"../../components/picture.js";import xe from"../../components/badge.js";import{cn as v}from"../../helpers/utils.js";import{Text as ke}from"../../components/text.js";import ie from"../../components/button.js";import{gaTrack as we}from"../../shared/track.js";import{trackUrlRef as _e}from"../../shared/trackUrlRef.js";import{Heading as Se}from"../../components/heading.js";import{useExposure as Ne}from"../../hooks/useExposure.js";import{useRef as Te,useEffect as Be,useMemo as oe,useState as B}from"react";const ne="image",le="product_shelf",ae=999999999e-2,Ce=e=>{const t=e?.sku,C=e?.variants,P=C?.find(L=>L?.sku===t),W=P?.image?.url||C?.[0]?.image?.url||"",U=P?.image?.altText||C?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:W,altText:U}},ze=({data:e,configuration:t})=>{const{isDisplayBackImage:C=!1,itemShape:P,metafields:W,isTopTag:U=!1,isShowTag:L,isShowOriginalPrice:Q,isShowShortTitle:ce=!1,formatPrice:$,renderOriginalPrice:z,renderPriceLabel:X,renderPrice:y}=t||{},{locale:_="es",copyWriting:me,currencyDisplay:Y}=ve(),{discounts:Z,discountsCopy:H}=W||{},E=Te(null),[R,ee]=B([]),[V,pe]=B(""),[te,c]=B(!1),[q,se]=B(!1),D=(s,r,o,l)=>{const{primaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.primaryButton?.(s,r+1,o,l)},de=(s,r,o,l)=>{const{secondaryFun:p,onAddCart:d,onBuyNow:g,onLearnMore:K,event:ye}=t||{};if(p){if(p==="AddCart"&&d)return d(s,r+1,o,l);if(p==="BuyNow"&&g)return g(s,r+1,o,l);if(p==="LearnMore"&&K)return K(s,r+1,o,l)}ye?.secondaryButton?.(s,r+1,o,l)},m=oe(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(r=>r?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=m?.id?.split?.("/")||[],G=u?.[u?.length-1],S=!m?.availableForSale||m?.price?.amount===ae||m?.price===ae,h=m?.coupons?.[0],N=!!(Q&&h),T=e?.price?.currencyCode||"USD",k=oe(()=>be({locale:_,amount:N?h?.variant_price4wscode:m?.price,baseAmount:N?m?.price:0,currencyCode:T,currencyDisplay:Y,customFormatPrice:$}),[T,_,N,h?.variant_price4wscode,m,$]),{price:x,basePrice:I,discount:w,discountAmount:f}=k,{imageUrl:A,altText:F}=Ce(e),M=e?.custom_name||e?.title,J=ce&&m?.metafields?.infos?.page_short_title||M,j=e?.custom_description||e?.description,ue=()=>{if(h?.value_type==="fixed_amount"){const s=f||"",r=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,o,l,p]=r;let d=l;return l.endsWith(".00")?d=l.replace(/\.00$/,""):l.endsWith(",00")&&(d=l.replace(/,00$/,"")),`${o}${d}${p}`}return s}return w||""};Be(()=>{let s=[];if(w||f){const o=`${ue()} ${Z?.off||H?.off||""}`;pe(o),s.push(o)}const r=e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,w?1:2)||[];ee(s.concat(r))},[e?.tags,w,f,Z?.off,H?.off]),Ne(E,{componentType:ne,componentName:le,componentTitle:M,componentDescription:j,position:t?.index+1});const fe=async()=>{if(!te&&!e?.custom_primary_link){c(!0);try{await D(e,t?.index,t,h)}finally{c(!1)}}},O=async()=>{if(!q&&!e?.custom_secondary_link){se(!0);try{await de(e,t?.index,t,h)}finally{se(!1)}}},re=()=>b(ge,{children:[L&&R?.length>0?i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:R?.map?.((s,r)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:s},r))}):null,J?i(Se,{as:"h3",title:J||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12",html:J||""}):null,i(ke,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm",html:j||""}),i("div",{className:"mb-2 mt-4 flex items-center",children:y?y(e,{price:x,basePrice:I,discount:w,discountAmount:f,variant:m,coupon:h,isSoldOut:S}):S?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:me?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:m?.availableForSale&&x||""}),z?z(e,{price:x,basePrice:I,discount:w,discountAmount:f}):I&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&I||""})]})}),!y&&X?.(e,m),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:S&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:O,loading:q,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:S&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:fe,loading:te,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]}),n=e?.custom_bg_image,a=e?.custom_theme;return i("div",{ref:E,className:v("box-border w-full cursor-pointer overflow-hidden duration-300","rounded-box","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item",n?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":a==="dark"}),style:n?{backgroundImage:`url(${n})`}:void 0,children:C?i("div",{className:"absolute inset-0 box-border overflow-hidden",children:b("div",{className:"relative inset-0 size-full",children:[i(he,{source:A,alt:F,className:v("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":n})}),i("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:re()})]})}):b("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[V&&U&&i(xe,{className:"shelf-prices-tag absolute left-4 top-4 z-10",variant:"fill",children:V||""}),i("div",{className:v("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden",{"opacity-0":n}),children:i("a",{"aria-label":M,target:t?.target,href:_e(`${_==="us"||!_?"":`/${_}`}/products/${e?.handle}?variant=${G}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:i(he,{source:A,alt:F,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),re()]})},e?.id||e?.handle)},He=({data:e,configuration:t})=>{const{itemShape:C,itemLength:P,metafields:W,isShowShortTitle:U,formatPrice:L,renderOriginalPrice:Q,renderPriceLabel:ce,renderPrice:$}=t||{},{discounts:z,discountsCopy:X}=W||{},{locale:y="us",copyWriting:_,currencyDisplay:me}=ve(),[Y,Z]=B([]),H=Te(null),[E,R]=B(!1),[ee,V]=B(!1),pe=(n,a,s,r)=>{const{primaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.primaryButton?.(n,a+1,s,r)},te=(n,a,s,r)=>{const{secondaryFun:o,onAddCart:l,onBuyNow:p,onLearnMore:d,event:g}=t||{};if(o){if(o==="AddCart"&&l)return l(n,a+1,s,r);if(o==="BuyNow"&&p)return p(n,a+1,s,r);if(o==="LearnMore"&&d)return d(n,a+1,s,r)}g?.secondaryButton?.(n,a+1,s,r)},c=oe(()=>{const n=e?.variants||[];if(n.length)return e?.sku&&n.find(a=>a?.sku===e?.sku)||n[0]},[e?.sku,e?.variants]),q=c?.id?.split?.("/")||[],se=q?.[q?.length-1],D=!c?.availableForSale||c?.price?.amount===ae||c?.price===ae,de=t?.isShowTag,m=t?.isShowOriginalPrice,u=c?.coupons?.[0],G=!!(m&&u),S=e?.price?.currencyCode||"USD",h=oe(()=>be({locale:y,amount:G?u?.variant_price4wscode:c?.price,baseAmount:G?c?.price:0,currencyCode:S,currencyDisplay:me,customFormatPrice:L}),[S,y,G,u?.variant_price4wscode,c,L]),{price:N,basePrice:T,discount:k,discountAmount:x}=h,{imageUrl:I,altText:w}=Ce(e),f=e?.custom_name||e?.title,A=U&&c?.metafields?.infos?.page_short_title||f,F=e?.custom_description||e?.description;Ne(H,{componentType:ne,componentName:le,componentTitle:f,componentDescription:F,position:t?.index+1});const M=async()=>{if(!E&&!e?.custom_primary_link){R(!0);try{await pe(e,t?.index,t,u)}finally{R(!1)}}},J=async()=>{if(!ee&&!e?.custom_secondary_link){V(!0);try{await te(e,t?.index,t,u)}finally{V(!1)}}},j=()=>P>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},ue=()=>P>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",fe=()=>{if(u?.value_type==="fixed_amount"){const n=x||"",a=n.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,r,o]=a;let l=r;return r.endsWith(".00")?l=r.replace(/\.00$/,""):r.endsWith(",00")&&(l=r.replace(/,00$/,"")),`${s}${l}${o}`}return n}return k||""};Be(()=>{let n=[];if(k||x){const s=`${fe()} ${z?.off||X?.off||""}`;n.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,k?1:2)||[];Z(n.concat(a))},[e?.tags,k,x,z?.off,X?.off]);const O=e?.custom_bg_image,re=e?.custom_theme;return i("div",{ref:H,className:v(j().wrap,"rounded-box","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",O?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":re==="dark"}),style:O?{backgroundImage:`url(${O})`}:void 0,children:b("div",{className:v(ue(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[i("div",{className:v(j().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":O}),children:i("a",{"aria-label":f,target:t?.target,href:_e(`${y==="us"||!y?"":`/${y}`}/products/${e?.handle}?variant=${se}`,`${ne}_${le}`),onClick:()=>{we({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||c?.sku,item_name:e?.name,item_variant:c?.name,price:c?.price,index:t?.index+1}]}})},children:i(he,{source:I,alt:w,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),b("div",{className:v("flex flex-col items-start justify-center",j().boxItem),children:[de&&i("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:Y?.length>0&&Y?.map?.((n,a)=>i(xe,{className:"shelf-items-tag",variant:"fill",children:n},a))}),A?i(Se,{as:"h3",title:A||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:A||""}):null,F?i(ke,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:F||""}):null,i("div",{className:"mb-2 mt-5 flex items-center",children:$?$(e,{price:N,basePrice:T,discount:k,discountAmount:x,variant:c,coupon:u,isSoldOut:D}):D?i("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:_?.soldOutText}):b(ge,{children:[i("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:c?.availableForSale&&N||""}),Q?Q(e,{price:N,basePrice:T,discount:k,discountAmount:x}):T&&i("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:c?.availableForSale&&T||""})]})}),!$&&ce?.(e,c),b("div",{className:v("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?i(ie,{disabled:D&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:J,loading:ee,className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?i(ie,{disabled:D&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:M,loading:E,className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{He as ShelfDisplayHorizontalItem,ze as ShelfDisplayWrapItem,Ce as getProductImage};
2
2
  //# sourceMappingURL=shelfDisplayItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplayItem.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n isShowShortTitle = false,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\n }\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\n ) : isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n )}\n </>\n )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'box-border w-full cursor-pointer overflow-hidden duration-300',\n 'rounded-box',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-background tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className={cn('flex h-full justify-center object-cover [&_img]:w-auto', {\n 'opacity-0': custom_bg_image,\n })}\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\" variant=\"fill\">\n {currentPriceTag || ''}\n </Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden',\n { 'opacity-0': custom_bg_image }\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n itemShape,\n itemLength,\n metafields,\n isShowShortTitle,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\n }\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n 'rounded-box',\n 'shelf-display-item',\n 'duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-container-secondary-1 tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div\n className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden', {\n 'opacity-0': custom_bg_image,\n })}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\n ) : isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n )}\n </>\n )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === '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AAM,MAyIzB,CAEJ",
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n isShowShortTitle = false,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags =\n data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2) || []\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\n }\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\n ) : isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n )}\n </>\n )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'box-border w-full cursor-pointer overflow-hidden duration-300',\n 'rounded-box',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-background tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className={cn('flex h-full justify-center object-cover [&_img]:w-auto', {\n 'opacity-0': custom_bg_image,\n })}\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\" variant=\"fill\">\n {currentPriceTag || ''}\n </Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden',\n { 'opacity-0': custom_bg_image }\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n itemShape,\n itemLength,\n metafields,\n isShowShortTitle,\n formatPrice,\n renderOriginalPrice,\n renderPriceLabel,\n renderPrice,\n } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n const [primaryLoading, setPrimaryLoading] = useState(false)\n const [secondaryLoading, setSecondaryLoading] = useState(false)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n customFormatPrice: formatPrice,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant, formatPrice]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const handlePrimaryClick = async () => {\n if (primaryLoading) return\n if (data?.custom_primary_link) return\n setPrimaryLoading(true)\n try {\n await onPrimaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setPrimaryLoading(false)\n }\n }\n\n const handleSecondaryClick = async () => {\n if (secondaryLoading) return\n if (data?.custom_secondary_link) return\n setSecondaryLoading(true)\n try {\n await onSecondaryButton(data, configuration?.index, configuration, coupon)\n } finally {\n setSecondaryLoading(false)\n }\n }\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags =\n data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2) || []\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n 'rounded-box',\n 'shelf-display-item',\n 'duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-container-secondary-1 tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div\n className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden', {\n 'opacity-0': custom_bg_image,\n })}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\" variant=\"fill\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {renderPrice ? (\n renderPrice(data, { price, basePrice, discount, discountAmount, variant, coupon, isSoldOut })\n ) : isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n {renderOriginalPrice\n ? renderOriginalPrice(data, { price, basePrice, discount, discountAmount })\n : basePrice && (\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n )}\n </>\n )}\n </div>\n {!renderPrice && renderPriceLabel?.(data, variant)}\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={handleSecondaryClick}\n loading={secondaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={handlePrimaryClick}\n loading={primaryLoading}\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAoNc,OA0BF,YAAAA,GA1BE,OAAAC,EA0BF,QAAAC,MA1BE,oBApNd,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,sBAAAC,OAA0B,oBACnC,OAAOC,OAAa,8BACpB,OAAOC,OAAW,4BAClB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,OAAY,2BACrB,OAAOC,OAAY,6BACnB,OAAS,WAAAC,OAAe,wBACxB,OAAS,eAAAC,OAAmB,8BAC5B,OAAS,WAAAC,OAAe,8BAExB,OAAS,eAAAC,OAAmB,6BAC5B,OAAS,UAAAC,GAAQ,aAAAC,GAAW,WAAAC,GAAS,YAAAC,MAAgB,QAErD,MAAMC,GAAgB,QAChBC,GAAgB,gBAEhBC,GAAiB,aAGVC,GAAmBC,GAAc,CAC5C,MAAMC,EAAMD,GAAM,IACZE,EAAWF,GAAM,SACjBG,EAAUD,GAAU,KAAME,GAAcA,GAAM,MAAQH,CAAG,EACzDI,EAAWF,GAAS,OAAO,KAAOD,IAAW,CAAC,GAAG,OAAO,KAAO,GAC/DI,EAAUH,GAAS,OAAO,SAAWD,IAAW,CAAC,GAAG,OAAO,SAAWF,GAAM,aAAeA,GAAM,OAAS,GAEhH,MAAO,CACL,SAAAK,EACA,QAAAC,CACF,CACF,EAEaC,GAAuB,CAAC,CAAE,KAAAP,EAAM,cAAAQ,CAAc,IAA0C,CACnG,KAAM,CACJ,mBAAAC,EAAqB,GACrB,UAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EACA,oBAAAC,EACA,iBAAAC,GAAmB,GACnB,YAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,YAAAC,CACF,EAAIX,GAAiB,CAAC,EA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Ac,WAAa,SAAW,GAE9D,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAxIKR,GAAM,IAAMA,GAAM,MAyIzB,CAEJ",
6
6
  "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "formatVariantPrice", "Picture", "Badge", "cn", "Text", "Button", "gaTrack", "trackUrlRef", "Heading", "useExposure", "useRef", "useEffect", "useMemo", "useState", "componentType", "componentName", "SOLD_OUT_PRICE", "getProductImage", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "ShelfDisplayWrapItem", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "isShowShortTitle", "formatPrice", "renderOriginalPrice", "renderPriceLabel", "renderPrice", "locale", "copyWriting", "currencyDisplay", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "onPrimaryButton", "params", "index", "coupon", "primaryFun", "onAddCart", "onBuyNow", "onLearnMore", "event", "onSecondaryButton", "secondaryFun", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "discountAmount", "displayTitle", "currentDisplayTitle", "displayDescription", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "handleTags", "discountTag", "newTags", "handlePrimaryClick", "handleSecondaryClick", "bottomContent", "custom_bg_image", "custom_theme", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
7
7
  }