@anker-in/headless-ui 1.0.26-alpha.1762163448499 → 1.0.26-alpha.1762243303200

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 (319) hide show
  1. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +4 -0
  2. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  3. package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
  4. package/dist/cjs/biz-components/HeroBanner/Countdown.d.ts +9 -0
  5. package/dist/cjs/biz-components/HeroBanner/Countdown.js +2 -0
  6. package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +7 -0
  7. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  8. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  9. package/dist/cjs/biz-components/HeroBanner/types.d.ts +6 -0
  10. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  11. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +118 -0
  12. package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
  13. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
  14. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
  15. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
  16. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
  17. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
  18. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
  19. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
  20. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
  21. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
  22. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
  23. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
  24. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +2 -0
  25. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
  26. package/dist/cjs/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
  27. package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js +2 -0
  28. package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
  29. package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
  30. package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js +2 -0
  31. package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
  32. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
  33. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
  34. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
  35. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
  36. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
  37. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
  38. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
  39. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
  40. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
  41. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
  42. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
  43. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
  44. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
  45. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
  46. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
  47. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
  48. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
  49. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
  50. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
  51. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
  52. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
  53. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
  54. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
  55. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
  56. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
  57. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
  58. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
  59. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
  60. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
  61. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
  62. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
  63. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
  64. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
  65. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
  66. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
  67. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
  68. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
  69. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
  70. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
  71. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
  72. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
  73. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
  74. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
  75. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
  76. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
  77. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
  78. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
  79. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
  80. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
  81. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
  82. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
  83. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
  84. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
  85. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
  86. package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
  87. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
  88. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
  89. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
  90. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
  91. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
  92. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
  93. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
  94. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
  95. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
  96. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
  97. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
  98. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
  99. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
  100. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
  101. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
  102. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
  103. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
  104. package/dist/cjs/biz-components/Listing/components/index.d.ts +3 -0
  105. package/dist/cjs/biz-components/Listing/components/index.js +2 -0
  106. package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
  107. package/dist/cjs/biz-components/Listing/const.d.ts +29 -0
  108. package/dist/cjs/biz-components/Listing/const.js +2 -0
  109. package/dist/cjs/biz-components/Listing/const.js.map +7 -0
  110. package/dist/cjs/biz-components/Listing/hooks/use-options.d.ts +3 -0
  111. package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
  112. package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
  113. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
  114. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
  115. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
  116. package/dist/cjs/biz-components/Listing/hooks/use-variant.d.ts +5 -0
  117. package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
  118. package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
  119. package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
  120. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +2 -0
  121. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +7 -0
  122. package/dist/cjs/biz-components/Listing/hooks/useCopy.d.ts +5 -0
  123. package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
  124. package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
  125. package/dist/cjs/biz-components/Listing/index.d.ts +3 -0
  126. package/dist/cjs/biz-components/Listing/index.js +2 -0
  127. package/dist/cjs/biz-components/Listing/index.js.map +7 -0
  128. package/dist/cjs/biz-components/Listing/types/graphql.d.ts +7473 -0
  129. package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
  130. package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
  131. package/dist/cjs/biz-components/Listing/types/product.d.ts +141 -0
  132. package/dist/cjs/biz-components/Listing/types/product.js +2 -0
  133. package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
  134. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
  135. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
  136. package/dist/cjs/biz-components/Listing/types/type-helper.d.ts +5 -0
  137. package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
  138. package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
  139. package/dist/cjs/biz-components/Listing/types.d.ts +28 -0
  140. package/dist/cjs/biz-components/Listing/types.js +2 -0
  141. package/dist/cjs/biz-components/Listing/types.js.map +7 -0
  142. package/dist/cjs/biz-components/Listing/utils/helper.d.ts +36 -0
  143. package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
  144. package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
  145. package/dist/cjs/biz-components/Listing/utils/index.d.ts +37 -0
  146. package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
  147. package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
  148. package/dist/cjs/biz-components/Listing/utils/textFormat.d.ts +73 -0
  149. package/dist/cjs/biz-components/Listing/utils/textFormat.js +2 -0
  150. package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +7 -0
  151. package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +1 -1
  152. package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +2 -2
  153. package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
  154. package/dist/cjs/biz-components/index.d.ts +17 -0
  155. package/dist/cjs/biz-components/index.js +1 -1
  156. package/dist/cjs/biz-components/index.js.map +3 -3
  157. package/dist/cjs/components/checkbox.d.ts +1 -0
  158. package/dist/cjs/components/checkbox.js +1 -1
  159. package/dist/cjs/components/checkbox.js.map +3 -3
  160. package/dist/esm/biz-components/AiuiProvider/index.d.ts +4 -0
  161. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  162. package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
  163. package/dist/esm/biz-components/HeroBanner/Countdown.d.ts +9 -0
  164. package/dist/esm/biz-components/HeroBanner/Countdown.js +2 -0
  165. package/dist/esm/biz-components/HeroBanner/Countdown.js.map +7 -0
  166. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  167. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  168. package/dist/esm/biz-components/HeroBanner/types.d.ts +6 -0
  169. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +118 -0
  170. package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
  171. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
  172. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
  173. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
  174. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
  175. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
  176. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
  177. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
  178. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
  179. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
  180. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
  181. package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
  182. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +2 -0
  183. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
  184. package/dist/esm/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
  185. package/dist/esm/biz-components/Listing/components/PaidShipping/type.js +2 -0
  186. package/dist/esm/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
  187. package/dist/esm/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
  188. package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js +2 -0
  189. package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
  190. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
  191. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
  192. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
  193. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
  194. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
  195. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
  196. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
  197. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
  198. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
  199. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
  200. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
  201. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
  202. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
  203. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
  204. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
  205. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
  206. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
  207. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
  208. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
  209. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
  210. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
  211. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
  212. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
  213. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
  214. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
  215. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
  216. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
  217. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
  218. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
  219. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
  220. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
  221. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
  222. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
  223. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
  224. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
  225. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
  226. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
  227. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
  228. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
  229. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
  230. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
  231. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
  232. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
  233. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
  234. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
  235. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
  236. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
  237. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
  238. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
  239. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
  240. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
  241. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
  242. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
  243. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
  244. package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
  245. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
  246. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
  247. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
  248. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
  249. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
  250. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
  251. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
  252. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
  253. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
  254. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
  255. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
  256. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
  257. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
  258. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
  259. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
  260. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
  261. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
  262. package/dist/esm/biz-components/Listing/components/index.d.ts +3 -0
  263. package/dist/esm/biz-components/Listing/components/index.js +2 -0
  264. package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
  265. package/dist/esm/biz-components/Listing/const.d.ts +29 -0
  266. package/dist/esm/biz-components/Listing/const.js +2 -0
  267. package/dist/esm/biz-components/Listing/const.js.map +7 -0
  268. package/dist/esm/biz-components/Listing/hooks/use-options.d.ts +3 -0
  269. package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
  270. package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
  271. package/dist/esm/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
  272. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
  273. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
  274. package/dist/esm/biz-components/Listing/hooks/use-variant.d.ts +5 -0
  275. package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
  276. package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
  277. package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
  278. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +2 -0
  279. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +7 -0
  280. package/dist/esm/biz-components/Listing/hooks/useCopy.d.ts +5 -0
  281. package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
  282. package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
  283. package/dist/esm/biz-components/Listing/index.d.ts +3 -0
  284. package/dist/esm/biz-components/Listing/index.js +2 -0
  285. package/dist/esm/biz-components/Listing/index.js.map +7 -0
  286. package/dist/esm/biz-components/Listing/types/graphql.d.ts +7473 -0
  287. package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
  288. package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
  289. package/dist/esm/biz-components/Listing/types/product.d.ts +141 -0
  290. package/dist/esm/biz-components/Listing/types/product.js +2 -0
  291. package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
  292. package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
  293. package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
  294. package/dist/esm/biz-components/Listing/types/type-helper.d.ts +5 -0
  295. package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
  296. package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
  297. package/dist/esm/biz-components/Listing/types.d.ts +28 -0
  298. package/dist/esm/biz-components/Listing/types.js +1 -0
  299. package/dist/esm/biz-components/Listing/types.js.map +7 -0
  300. package/dist/esm/biz-components/Listing/utils/helper.d.ts +36 -0
  301. package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
  302. package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
  303. package/dist/esm/biz-components/Listing/utils/index.d.ts +37 -0
  304. package/dist/esm/biz-components/Listing/utils/index.js +2 -0
  305. package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
  306. package/dist/esm/biz-components/Listing/utils/textFormat.d.ts +73 -0
  307. package/dist/esm/biz-components/Listing/utils/textFormat.js +2 -0
  308. package/dist/esm/biz-components/Listing/utils/textFormat.js.map +7 -0
  309. package/dist/esm/biz-components/TabWithImage/TabWithImage.js +1 -1
  310. package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +2 -2
  311. package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
  312. package/dist/esm/biz-components/index.d.ts +17 -0
  313. package/dist/esm/biz-components/index.js +1 -1
  314. package/dist/esm/biz-components/index.js.map +2 -2
  315. package/dist/esm/components/checkbox.d.ts +1 -0
  316. package/dist/esm/components/checkbox.js +1 -1
  317. package/dist/esm/components/checkbox.js.map +3 -3
  318. package/dist/tokens/base.css +1 -1
  319. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/index.tsx"],
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => ({\n ...item,\n galleries: galleryMap[item?.galleries] || [],\n }))\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n // \u4E3A\u6BCF\u4E2A galleryTab \u521B\u5EFA\u5BF9\u5E94\u7684 ref\n const gallerySwiperRefs = useRef<{ [key: string]: SwiperRef | null }>({})\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n\n\n // useEffect(() => {\n // if (selectedOptions?.color) {\n // setActiveGalleryTab(galleryTabs?.find((item: any) => item.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN))\n // }\n // }, [selectedOptions, galleryTabs])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n // case GalleryTabType.GALLERY_IMAGE_MAIN ||\n // GalleryTabType.GALLERY_IMAGE_FEATURES ||\n // GalleryTabType.GALLERY_IMAGE_SCENE:\n // return (\n // <ProductGalleryTabImage\n // {...tab}\n // // onCurrentTabLoopEnd={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // // onCurrentTabLoopStart={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // index={index}\n // />\n // )\n\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_VIDEO:\n return <ProductGalleryTabVideo {...tab} />\n // case GalleryTabType.GALLERY_3D_VIEW:\n // return <ProductGalleryTab3DView {...item} />\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" defaultValue={galleryTabs?.[0]?.tabValue}>\n {/* <Swiper\n className=\"h-[420px] laptop:h-[700px] bg-[#EAEAEC] rounded-2xl\"\n onSwiper={setSwiper}\n loop={true}\n // onProgress={swiper => {\n // setStart(swiper.isBeginning)\n // setEnd(swiper.isEnd)\n // }}\n modules={[Mousewheel]}\n mousewheel={{\n forceToAxis: true,\n }}\n >\n {galleryTabs.map((item, index) => {\n return (\n <Content forceMount key={item.tabValue} value={item.tabValue}>\n <SwiperSlide key={index}>{renderGalleryForTab(activeGalleryTab)}</SwiperSlide>\n </Content>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'absolute top-1/2 left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slidePrev()\n }\n }}\n />\n </div>\n <div\n className={cn(\n 'absolute top-1/2 right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slideNext()\n }\n }}\n />\n </div> */}\n <div className=\"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n />\n </Root>\n </div>\n )\n}\n\nconst ProductGalleryTab = ({\n galleryTabs,\n activeGalleryTab,\n setActiveGalleryTab,\n}: {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n}) => {\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n ref={scrollContainerRef}\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map(item => {\n return (\n <Trigger\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => {\n setActiveGalleryTab(item)\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n onSlideChange={swiper => {\n if (swiper) {\n if (swiper.isEnd) {\n props?.onCurrentTabLoopEnd?.()\n } else if (swiper.isBeginning) {\n props?.onCurrentTabLoopStart?.()\n }\n }\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <Picture\n source={item?.image?.url}\n alt={item?.image?.altText}\n className={cn(\"h-full\", imageClassName)}\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-8 laptop:size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#1D1D1F] line-clamp-2\"\n />\n </div>\n )}\n </div>\n <div ref={paginationRef} className=\"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10\" />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
5
+ "mappings": "AA8BI,OA6OM,YAAAA,GA5OJ,OAAAC,EADF,QAAAC,MAAA,oBA9BJ,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,QAAAC,EAAM,WAAAC,EAAiB,SAAAC,MAAa,4BAC7C,OAEE,WAAAC,EACA,YAAAC,EACA,cAAAC,EACA,UAAAC,MAKK,QACP,OAAS,UAAAC,EAAQ,eAAAC,MAAmC,eACpD,OAAS,cAAAC,EAAY,cAAAC,EAAY,UAAAC,EAAQ,cAAAC,MAAkB,iBAC3D,OAAS,MAAAC,MAAU,kCACnB,OAAS,kBAAAC,MAAsB,aAC/B,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAC7C,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,mBAAAC,MAAuB,sCAChC,OAAS,cAAAC,MAAkB,6BAC3B,OAAOC,MAAkB,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6BACzC,OAAQ,wBAAwBA,GAAO,EAAE,4BAC3C,EACA,QAAS,CAACf,EAAYC,EAAQF,EAAYG,CAAU,EACpD,WAAY,CACV,YAAa,EACf,EACA,YAAa,CACX,EAAG,CACD,cAAe,EACf,SAAU,EACZ,CACF,EAEC,SAAAa,GAAO,WAAW,IAAI,CAACkB,EAAM0B,IAE1BxE,EAACW,EAAA,CAAY,UAAU,SACrB,SAAAV,EAAC,SAAM,SAAQ,GAAC,UAAU,YACxB,UAAAD,EAAC,SAAM,KAAK,WAAW,EACvBA,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,EACvD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,EACxD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmClB,GAAO,GAAK,kBAAoB4C,CAOrE,CAEH,EACH,EACAxE,EAAC,OACC,UAAWgB,EACT,uIACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC2B,EAAA,CAAqB,UAAU,oCAAoC,EACtE,EACA3B,EAAC,OACC,UAAWgB,EACT,wIACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC6B,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,EAIE4C,GAA2B7C,GACxB5B,EAAC,OAAI,mBAAO,EAGrB,IAAO0E,GAAQ5C",
6
+ "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "Text", "Picture", "Badge", "useMemo", "useState", "forwardRef", "useRef", "Swiper", "SwiperSlide", "Navigation", "Mousewheel", "Thumbs", "Pagination", "cn", "GalleryTabType", "Content", "List", "Root", "Trigger", "useBizProductContext", "useVariantMedia", "SpecsModal", "CompareModal", "formatPrice", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "selectedOptions", "defaultMediaData", "swiper", "setSwiper", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "gallerySwiperRefs", "activeGalleryTab", "setActiveGalleryTab", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "scrollContainerRef", "el", "container", "button", "scrollLeft", "ref", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "imageClassName", "jIndex", "ProductGalleryTab3DView", "ProductGallery_default"]
7
+ }
@@ -0,0 +1,37 @@
1
+ import type { Img } from '../../../../../types/props.js';
2
+ import type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js';
3
+ export interface ProductGalleryProps {
4
+ data: {
5
+ gallerySections: {
6
+ title: string;
7
+ }[];
8
+ };
9
+ }
10
+ export interface ProductGalleryTabItemProps {
11
+ index: number;
12
+ galleryTabType: GalleryTabType;
13
+ galleries: ImageMedia[] | VideoMedia[];
14
+ onCurrentTabLoopStart?: () => void;
15
+ onCurrentTabLoopEnd?: () => void;
16
+ id: string;
17
+ comment?: {
18
+ content: string;
19
+ avatar: Img;
20
+ };
21
+ tabLabel: string;
22
+ tabValue: string;
23
+ }
24
+ export interface GalleryTabItemProps {
25
+ tabLabel: string;
26
+ tabValue: string;
27
+ id: string;
28
+ galleryTabType: GalleryTabType;
29
+ galleries: ImageMedia[] | VideoMedia[];
30
+ }
31
+ export declare enum GalleryTabType {
32
+ GALLERY_IMAGE_MAIN = "ipc-gallery-tab-image-main",
33
+ GALLERY_IMAGE_FEATURES = "ipc-gallery-tab-image-features",
34
+ GALLERY_IMAGE_SCENE = "ipc-gallery-tab-image-scene",
35
+ GALLERY_VIDEO = "ipc-gallery-tab-video",
36
+ GALLERY_3D_VIEW = "ipc-gallery-tab-3d-view"
37
+ }
@@ -0,0 +1,2 @@
1
+ var a=(e=>(e.GALLERY_IMAGE_MAIN="ipc-gallery-tab-image-main",e.GALLERY_IMAGE_FEATURES="ipc-gallery-tab-image-features",e.GALLERY_IMAGE_SCENE="ipc-gallery-tab-image-scene",e.GALLERY_VIDEO="ipc-gallery-tab-video",e.GALLERY_3D_VIEW="ipc-gallery-tab-3d-view",e))(a||{});export{a as GalleryTabType};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/types.ts"],
4
+ "sourcesContent": ["import type { Img, Video } from '../../../../../types/props.js'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\n\nexport interface ProductGalleryProps {\n data: {\n gallerySections: {\n title: string\n }[]\n }\n}\n\nexport interface ProductGalleryTabItemProps {\n index: number\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n onCurrentTabLoopStart?: () => void\n onCurrentTabLoopEnd?: () => void\n id: string\n comment?: {\n content: string\n avatar: Img\n }\n tabLabel: string\n tabValue: string\n // galleryImgs?: Img[]\n // galleryVideo?: Video\n // gallery3DView?: Video\n}\n\nexport interface GalleryTabItemProps {\n tabLabel: string\n tabValue: string\n id: string\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n}[]\n\nexport enum GalleryTabType {\n GALLERY_IMAGE_MAIN = 'ipc-gallery-tab-image-main',\n GALLERY_IMAGE_FEATURES = 'ipc-gallery-tab-image-features',\n GALLERY_IMAGE_SCENE = 'ipc-gallery-tab-image-scene',\n GALLERY_VIDEO = 'ipc-gallery-tab-video',\n GALLERY_3D_VIEW = 'ipc-gallery-tab-3d-view',\n}\n"],
5
+ "mappings": "AAqCO,IAAKA,OACVA,EAAA,mBAAqB,6BACrBA,EAAA,uBAAyB,iCACzBA,EAAA,oBAAsB,8BACtBA,EAAA,cAAgB,wBAChBA,EAAA,gBAAkB,0BALRA,OAAA",
6
+ "names": ["GalleryTabType"]
7
+ }
@@ -0,0 +1,6 @@
1
+ declare const ProductGridBox: ({ BoxLeftGallery, BoxRightDetail, BoxBottomSummary, }: {
2
+ BoxLeftGallery: React.ReactNode;
3
+ BoxRightDetail: React.ReactNode;
4
+ BoxBottomSummary: React.ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default ProductGridBox;
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{Grid as s,GridItem as t}from"../../../../components";const c=({BoxLeftGallery:p,BoxRightDetail:a,BoxBottomSummary:d})=>e("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[e(s,{className:"desktop:gap-4 lg-desktop:gap-8 gap-8",children:[o(t,{className:"col-span-12 laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:p}),o(t,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:a})]}),d]});var r=c;export{r as default};
2
+ //# sourceMappingURL=ProductGridBox.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/ProductGridBox.tsx"],
4
+ "sourcesContent": ["import { Grid, GridItem } from '../../../../components'\n\nconst ProductGridBox = ({\n BoxLeftGallery,\n BoxRightDetail,\n BoxBottomSummary,\n}: {\n BoxLeftGallery: React.ReactNode\n BoxRightDetail: React.ReactNode\n BoxBottomSummary: React.ReactNode\n}) => {\n return (\n <div id=\"ipc-product-card\" className=\"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]\">\n <Grid className=\"desktop:gap-4 lg-desktop:gap-8 gap-8\">\n <GridItem className=\"col-span-12 laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit\">\n {BoxLeftGallery}\n </GridItem>\n <GridItem className=\"col-span-12 desktop:col-start-9 desktop:col-span-4\">{BoxRightDetail}</GridItem>\n </Grid>\n {BoxBottomSummary}\n </div>\n )\n}\n\nexport default ProductGridBox\n"],
5
+ "mappings": "AAaM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAbN,OAAS,QAAAC,EAAM,YAAAC,MAAgB,yBAE/B,MAAMC,EAAiB,CAAC,CACtB,eAAAC,EACA,eAAAC,EACA,iBAAAC,CACF,IAMIN,EAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,UAAAA,EAACC,EAAA,CAAK,UAAU,uCACd,UAAAF,EAACG,EAAA,CAAS,UAAU,0GACjB,SAAAE,EACH,EACAL,EAACG,EAAA,CAAS,UAAU,qDAAsD,SAAAG,EAAe,GAC3F,EACCC,GACH,EAIJ,IAAOC,EAAQJ",
6
+ "names": ["jsx", "jsxs", "Grid", "GridItem", "ProductGridBox", "BoxLeftGallery", "BoxRightDetail", "BoxBottomSummary", "ProductGridBox_default"]
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { ProductSummaryProps } from './types';
2
+ declare const ProductSummary: ({}: ProductSummaryProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export default ProductSummary;
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Text as s,Button as P,Grid as H,GridItem as j,Picture as B,Heading as M}from"../../../../../components";import{useBizProductContext as C}from"../../../BizProductProvider";import{useEffect as W,useMemo as G,useState as J}from"react";import{formatPrice as g}from"../../../utils";import{useAiuiContext as z}from"../../../../AiuiProvider";import"../../../../../helpers";import E from"decimal.js";const q=({})=>{const{locale:r="us",copyWriting:t}=z(),{product:d,variant:o,finalPrice:p,comparePrice:x,coupon:h,selectedOptions:i,selectedVariants:u,totalSavings:y,onAddToCart:R,onBuyNow:D,savingDetail:k,checkedBundle:w,joinedRecommendBuyProducts:n,setJoinedRecommendBuyProducts:b}=C(),[m,f]=J({bundle:!1,gift:!1,exchange:!1}),[N]=u,O=G(()=>{const[c]=w?.variants||[],T=new E(N?.price?.amount||0).minus(c?.price||N?.price?.amount).toNumber();return new E(N?.price?.amount||0).minus(k?.coupon).minus(T).toNumber()},[N,y,w]);if(!o.availableForSale)return null;const{bundleVariant:F,giftVariant:V,exchangeVariant:I}=K()||{},[l,v]=J();W(()=>{v({bundle:n.bundle?void 0:F,gift:n.gift?void 0:V,exchange:n.exchange?void 0:I})},[F,V,n]);const $=G(()=>new E(x).minus(k.freeGift).toNumber(),[x,k]);return e("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 mt-8 desktop:mt-16",children:e("div",{className:"bg-[#F5F5F7] laptop:rounded-2xl",children:a(H,{className:"px-4 py-6 tablet:p-8",children:[a(j,{className:"col-span-12 laptop:col-start-1 laptop:col-span-5",children:[e(M,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${d.title} is ready <br/><span>Just the way you want it.</span>`}),e("div",{className:"aspect-[644/320]",children:e(B,{source:o.image?.url||d?.images?.[0]?.url,className:"h-full w-full",imgClassName:"object-contain h-full"})})]}),a(j,{className:"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between",children:[a("div",{children:[a("div",{className:"flex flex-col gap-4",children:[a("div",{className:"flex items-center justify-between",children:[a("div",{className:"shrink-0 flex items-center gap-4",children:[e(B,{source:o.image?.url||d?.images?.[0]?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:d.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${i.color||i.colour||i.couleur}`})]})]}),a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:O,currencyCode:o.price.currencyCode,locale:r})}),y>0&&e(s,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:g({amount:o?.price?.amount,currencyCode:o.price.currencyCode,locale:r})})]})]}),n?.gift&&e(A,{giftOperation:c=>{b?.({...n,gift:void 0}),v?.({...l,gift:c})},status:!!n?.gift,gift:n?.gift,currentJoinedRecommendBuyProducts:m?.gift}),n?.bundle&&e(S,{bundleOperation:c=>{b?.({...n,bundle:void 0}),v?.({...l,bundle:c})},status:!!n?.bundle,bundleListItem:n?.bundle,currentJoinedRecommendBuyProducts:m?.bundle}),n?.exchange&&e(L,{exchangeOperation:c=>{b?.({...n,exchange:void 0}),v?.({...l,exchange:c})},status:!!n?.exchange,currentJoinedRecommendBuyProducts:m?.exchange,exchange:n?.exchange})]}),(l?.bundle||l?.gift||l?.exchange)&&a("div",{className:"mt-6",children:[e(s,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),a("div",{className:"flex flex-col gap-6 mt-6",children:[l?.exchange&&e(L,{exchangeOperation:c=>{b?.({exchange:c}),f({...m,exchange:!1}),v?.({...l,exchange:void 0})},currentJoinedRecommendBuyProducts:m?.exchange,status:!l?.exchange,exchange:l?.exchange}),l?.bundle&&e(S,{bundleOperation:c=>{b?.({bundle:c}),f({...m,bundle:!1}),v?.({...l,bundle:void 0})},currentJoinedRecommendBuyProducts:m?.bundle,status:!l?.bundle,bundleListItem:l?.bundle}),l?.gift&&e(A,{giftOperation:c=>{b?.({gift:c}),f({...m,gift:!1}),v?.({...l,gift:void 0})},currentJoinedRecommendBuyProducts:m?.gift,status:!l?.gift,gift:l?.gift})]})]})]}),a("div",{className:"text-right",children:[e(s,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${t?.totalPrice} ${g({amount:p,currencyCode:o.price.currencyCode,locale:r})}`}),y>0&&e(s,{className:"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:g({amount:$,currencyCode:o.price.currencyCode,locale:r})}),a("div",{className:"flex gap-3 mt-2 justify-end",children:[e(P,{size:"lg",variant:"secondary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>R?.(),children:t?.addToCart}),e(P,{size:"lg",variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>D?.(),children:t?.shopNow})]})]})]})]})})})},K=()=>{const{bundle:r,variant:t,checkedBundle:d,freeGift:o,checkedGift:p,exchangePurchase:x,checkedExchangePurchase:h}=C();let i,u,y;const{bundleList:R}=r||{},{giftList:D=[]}=o||{},{giftList:k=[]}=x||{},w=R?.filter(f=>f.variants.slice(1,f.variants.length).every(N=>N.variant.availableForSale))||[],[n]=w;i=d||n;const[b]=D?.filter(f=>f.availableForSale);u=p||b;const[m]=k?.filter(f=>f.availableForSale);return y=h||m,{bundleVariant:i,giftVariant:u,exchangeVariant:y}},S=({bundleOperation:r,bundleListItem:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{variant:x,setCheckedBundle:h}=C(),i=t?.variants.filter(u=>u.variant.sku!==x.sku);return a("div",{className:"flex items-center justify-between",children:[i?.map(u=>a("div",{className:"flex items-center gap-4",children:[e(B,{source:u?.variant?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),e("div",{className:"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none",children:e(s,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:u.variant.product.title})})]},u.variant.id)),a("div",{className:"flex flex-col items-end gap-1 justify-center",children:[!!t&&e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:i[0]?.price,locale:p,currencyCode:i[0]?.variant?.price?.currencyCode})}),!d&&e(P,{size:"icon",variant:"link",onClick:()=>{h?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},A=({giftOperation:r,gift:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{freeGift:x,setCheckedGift:h}=C(),{freeLabel:i,count:u}=x||{};return a("div",{className:"flex items-center justify-between",children:[a("div",{className:"flex items-center gap-4",children:[e(B,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x${u} | ${i}`})]})]}),a("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:i}),e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:g({amount:t.price.amount,locale:p,currencyCode:t.price.currencyCode})})]}),d&&e(P,{size:"icon",variant:"link",onClick:()=>{h?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},L=({exchangeOperation:r,exchange:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{setCheckedExchangePurchase:x}=C();return a("div",{className:"flex items-center justify-between",children:[a("div",{className:"flex items-center gap-4",children:[e(B,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]"})]})]}),a("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:t.finalPrice?.amount||0,locale:p,currencyCode:t.price.currencyCode})}),e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:g({amount:t.price?.amount||0,locale:p,currencyCode:t.price.currencyCode})})]}),d&&e(P,{size:"icon",variant:"link",onClick:()=>{x?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})};var ne=q;export{ne as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
4
+ "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const [currentJoinedRecommendBuyProducts, setCurrentJoinedRecommendBuyProducts] = useState<{\n bundle?: boolean\n gift?: boolean\n exchange?: boolean\n }>({\n bundle: false,\n gift: false,\n exchange: false,\n })\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const [currentBundleVariant] = checkedBundle?.variants || []\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n return new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(savingDetail?.coupon)\n .minus(currentBundlePrice)\n .toNumber()\n }, [currentProductVariant, totalSavings, checkedBundle])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 mt-8 desktop:mt-16\">\n <div className=\"bg-[#F5F5F7] laptop:rounded-2xl\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 laptop:col-start-1 laptop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.gift}\n />\n )}\n {joinedRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.bundle}\n />\n )}\n {joinedRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, exchange: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.exchange}\n exchange={joinedRecommendBuyProducts?.exchange}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({ exchange })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, exchange: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.exchange}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ bundle })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, bundle: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.bundle}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ gift })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, gift: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.gift}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2 justify-end\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n variant=\"primary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale)\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale)\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n bundleOperation: (bundle: BundleListItem) => void\n bundleListItem: BundleListItem\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {!!bundleListItem && (\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariants[0]?.price,\n locale,\n currencyCode: bundleVariants[0]?.variant?.price?.currencyCode,\n })}\n />\n )}\n {!currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation(bundleListItem)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {!!status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n giftOperation: (gift: ProductVariant) => void\n gift: ProductVariant\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n exchangeOperation: (exchange: ProductVariant) => void\n exchange: ProductVariant & { finalPrice?: ProductPrice }\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={exchange?.product?.title}\n />\n <Text className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
+ "mappings": "AA+EU,OACE,OAAAA,EADF,QAAAC,MAAA,oBA/EV,OAAS,QAAAC,EAAM,UAAAC,EAAmB,QAAAC,EAAM,YAAAC,EAAU,WAAAC,EAAS,WAAAC,MAAe,4BAE1E,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,kBAAAC,MAAsB,2BAE/B,MAAmB,yBACnB,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,CAAC,CAAC,IAA2B,C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3D",
6
+ "names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useBizProductContext", "useEffect", "useMemo", "useState", "formatPrice", "useAiuiContext", "Decimal", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "currentJoinedRecommendBuyProducts", "setCurrentJoinedRecommendBuyProducts", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "currentBundlePrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "status", "setCheckedBundle", "bundleVariants", "giftOperation", "setCheckedGift", "freeLabel", "count", "exchangeOperation", "setCheckedExchangePurchase", "ProductSummary_default"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export interface ProductSummaryProps {
2
+ }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ declare const ProductCard: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ProductCard;
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as p}from"react/jsx-runtime";import{Grid as d,GridItem as o}from"../../../../components";import r from"./ProductGallery/index.js";import s from"./ProductDetail/index.js";import a from"./ProductSummary/index.js";const e=()=>p("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[p(d,{className:"laptop:gap-6",children:[t(o,{className:"col-span-12 tablet:px-8 laptop:px-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit",children:t(r,{})}),t(o,{className:"col-span-12 desktop:col-start-9 desktop:col-span-4",children:t(s,{})})]}),t(a,{})]});var k=e;export{k as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/index.tsx"],
4
+ "sourcesContent": ["import { Grid, GridItem } from '../../../../components'\nimport ProductGallery from './ProductGallery/index.js'\nimport ProductDetail from './ProductDetail/index.js'\nimport ProductSummary from './ProductSummary/index.js'\n\n\n\nconst ProductCard = () => {\n return (\n <div id=\"ipc-product-card\" className=\"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]\">\n <Grid className=\"laptop:gap-6\">\n <GridItem className=\"col-span-12 tablet:px-8 laptop:px-16 desktop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] h-fit\">\n <ProductGallery />\n </GridItem>\n <GridItem className=\"col-span-12 desktop:col-start-9 desktop:col-span-4\">\n <ProductDetail />\n </GridItem>\n </Grid>\n <ProductSummary />\n </div>\n )\n}\n\nexport default ProductCard\n"],
5
+ "mappings": "AAUM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAVN,OAAS,QAAAC,EAAM,YAAAC,MAAgB,yBAC/B,OAAOC,MAAoB,4BAC3B,OAAOC,MAAmB,2BAC1B,OAAOC,MAAoB,4BAI3B,MAAMC,EAAc,IAEhBN,EAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,UAAAA,EAACC,EAAA,CAAK,UAAU,eACd,UAAAF,EAACG,EAAA,CAAS,UAAU,oIAClB,SAAAH,EAACI,EAAA,EAAe,EAClB,EACAJ,EAACG,EAAA,CAAS,UAAU,qDAClB,SAAAH,EAACK,EAAA,EAAe,EAClB,GACF,EACAL,EAACM,EAAA,EAAe,GAClB,EAIJ,IAAOE,EAAQD",
6
+ "names": ["jsx", "jsxs", "Grid", "GridItem", "ProductGallery", "ProductDetail", "ProductSummary", "ProductCard", "ProductCard_default"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const ProductActions: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ProductActions;
@@ -0,0 +1,2 @@
1
+ import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as a,Button as x}from"../../../../../components";import{useAiuiContext as C}from"../../../../AiuiProvider/index.js";import{useBizProductContext as N}from"../../../BizProductProvider.js";import{useMemo as y}from"react";import{formatPrice as m}from"../../../utils";import p from"decimal.js";const w=()=>{const{copyWriting:o,locale:i="us"}=C(),{variant:e,finalPrice:b,totalSavings:r,memberFunctionResult:c,isLogin:d,comparePrice:u,onAddToCart:f,onBuyNow:v,savingDetail:n,coupon:h}=N(),g=y(()=>new p(u).minus(n.freeGift).toNumber(),[u,n]),s=Math.max(c?.withCouponMemberTotalSave??0,c?.withoutCouponMaxMemberTotalSave??0);return l("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[e.availableForSale?l("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[l("div",{className:"flex items-center gap-1",children:[t(a,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:b,currencyCode:e.price.currencyCode,locale:i})}),r>0&&t(a,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:g,currencyCode:e.price.currencyCode,locale:i})})]}),r>0&&t(a,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${s>0&&d?o?.memberSaving:o?.totalSavings} ${m({amount:s>0&&d?s:new p(r).minus(n?.freeGift).toNumber(),currencyCode:e.price.currencyCode,locale:i})}`})]}):t(a,{className:"text-[20px] font-bold text-[#999999]",html:o?.soldOut??"Sold Out"}),l("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[t(x,{variant:"secondary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>f?.(),children:o?.addToCart??"Add to Cart"}),t(x,{variant:"primary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>v?.(),children:o?.buyNow??"Buy Now"})]})]})};var T=w;export{T as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
4
+ "sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n memberFunctionResult,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n coupon,\n } = useBizProductContext()\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n const memberPriceSave = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n {totalSavings > 0 && (\n <Text\n className=\"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl\"\n html={`${memberPriceSave > 0 && isLogin ? copyWriting?.memberSaving : copyWriting?.totalSavings} ${formatPrice({ amount: memberPriceSave > 0 && isLogin ? memberPriceSave : new Decimal(totalSavings).minus(savingDetail?.freeGift).toNumber(), currencyCode: variant.price.currencyCode, locale })}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
5
+ "mappings": "AAoCU,OACE,OAAAA,EADF,QAAAC,MAAA,oBApCV,OAAS,QAAAC,EAAM,UAAAC,MAAc,4BAC7B,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,WAAAC,MAAe,QACxB,OAAS,eAAAC,MAAmB,iBAC5B,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,EAAIP,EAAe,EAChD,CACJ,QAAAQ,EACA,WAAAC,EACA,aAAAC,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AQ,UACR,SAAU,CAACS,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMO,IAAW,EAEzB,SAAAT,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOc,EAAQf",
6
+ "names": ["jsx", "jsxs", "Text", "Button", "useAiuiContext", "useBizProductContext", "useMemo", "formatPrice", "Decimal", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "memberFunctionResult", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "comparePriceRemovedFreeGift", "memberPriceSave", "ProductActions_default"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { ScrollSpyNavProps } from './types.js';
2
+ declare const MobileScrollSpyNav: ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const DesktopScrollSpyNav: ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => import("react/jsx-runtime").JSX.Element;
4
+ export { MobileScrollSpyNav, DesktopScrollSpyNav };
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as s}from"react/jsx-runtime";import"../../../../AiuiProvider/index.js";import{cn as m}from"../../../../../helpers/index.js";import{useState as c,useCallback as p,useRef as x}from"react";import{gsap as S}from"gsap";import{useBizProductContext as h}from"../../../BizProductProvider.js";const g=t=>o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:o("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"#1D1D1F",strokeLinecap:"round",strokeLinejoin:"round"})}),w=({tabs:t,purchaseBarHeight:a,onSpyNavItemClick:i})=>{const[n,r]=c(!1),[e,f]=c(t?.[0]),d=x(null),{renderRating:u}=h(),v=p(l=>{f(l),i?.(l),r(!1)},[]),b=p(()=>{r(!n),S.fromTo(d?.current,{height:0},{height:"auto",duration:.5,ease:"power2.inOut"})},[n]);return s("div",{children:[s("button",{className:"text-sm h-[28px] font-bold flex gap-1 items-center leading-[28px] px-[10px] border rounded-full border-black",onClick:b,children:[e?.label,o(g,{className:"size-3"})]}),s("div",{className:m("absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0",{hidden:!n}),style:{height:`calc(100dvh - ${a}px)`},children:[s("div",{ref:d,className:"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white",children:[t?.map(l=>o("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",onClick:()=>v(l),children:l.label},l.id)),o("button",{className:"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold",children:u})]}),o("div",{className:"flex-1",onClick:()=>r(!1)})]})]})},N=({tabs:t,onSpyNavItemClick:a})=>{const[i,n]=c(t?.[0]),r=p(e=>{n(e),a?.(e)},[]);return o("div",{className:"flex gap-8",children:t?.map(e=>s("button",{className:"text-sm relative py-[10px] font-bold",onClick:()=>r(e),children:[e.label,o("div",{className:m("absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0",{"w-full":i?.id===e.id})})]},e.id))})};export{N as DesktopScrollSpyNav,w as MobileScrollSpyNav};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.tsx"],
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\n\nconst ArrowDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M3 4.5L6 7.5L9 4.5\" stroke=\"#1D1D1F\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\nconst MobileScrollSpyNav = ({ tabs, purchaseBarHeight, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [dropdownOpen, setDropdownOpen] = useState(false)\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n const dropdownRef = useRef<HTMLDivElement>(null)\n const { renderRating } = useBizProductContext()\n \n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n setDropdownOpen(false)\n }, [])\n\n const onDropdownOpen = useCallback(() => {\n setDropdownOpen(!dropdownOpen)\n gsap.fromTo(dropdownRef?.current, { height: 0 }, { height: 'auto', duration: 0.5, ease: 'power2.inOut' })\n }, [dropdownOpen])\n\n return (\n <div>\n <button\n className=\"text-sm h-[28px] font-bold flex gap-1 items-center leading-[28px] px-[10px] border rounded-full border-black\"\n onClick={onDropdownOpen}\n >\n {activeTab?.label}<ArrowDownIcon className='size-3'/>\n </button>\n <div\n className={cn('absolute top-full w-full flex flex-col z-[60] bg-black/60 left-0', {\n ['hidden']: !dropdownOpen,\n })}\n style={{\n height: `calc(100dvh - ${purchaseBarHeight}px)`,\n }}\n >\n <div ref={dropdownRef} className=\"border-t overflow-hidden border-[#E4E5E6] flex flex-col bg-white\">\n {tabs?.map(tab => (\n <button\n className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\"\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n </button>\n ))}\n <button className=\"text-sm hover:bg-[#EAEAEC] p-4 text-left font-bold\">{renderRating}</button>\n </div>\n <div className=\"flex-1\" onClick={() => setDropdownOpen(false)} />\n </div>\n </div>\n )\n}\n\nconst DesktopScrollSpyNav = ({ tabs, onSpyNavItemClick }: ScrollSpyNavProps) => {\n const [activeTab, setActiveTab] = useState(tabs?.[0])\n\n const onTabClick = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n }, [])\n\n return (\n <div className=\"flex gap-8\">\n {tabs?.map(tab => (\n <button className=\"text-sm relative py-[10px] font-bold\" key={tab.id} onClick={() => onTabClick(tab)}>\n {tab.label}\n <div\n className={cn('absolute bottom-0 left-0 w-0 transition-all duration-300 ease-in-out h-[2px] bg-brand-0', {\n 'w-full': activeTab?.id === tab.id,\n })}\n />\n </button>\n ))}\n </div>\n )\n}\n\nexport { MobileScrollSpyNav, DesktopScrollSpyNav }\n"],
5
+ "mappings": "AAUM,cAAAA,EAwBA,QAAAC,MAxBA,oBAVN,MAA+B,oCAC/B,OAAS,MAAAC,MAAU,kCACnB,OAAS,YAAAC,EAAU,eAAAC,EAAa,UAAAC,MAAc,QAC9C,OAAS,QAAAC,MAAY,OAErB,OAAS,wBAAAC,MAA4B,iCAErC,MAAMC,EAAiBC,GAEnBT,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGS,EACjG,SAAAT,EAAC,QAAK,EAAE,qBAAqB,OAAO,UAAU,cAAc,QAAQ,eAAe,QAAQ,EAC7F,EAIEU,EAAqB,CAAC,CAAE,KAAAC,EAAM,kBAAAC,EAAmB,kBAAAC,CAAkB,IAAyB,CAChG,KAAM,CAACC,EAAcC,CAAe,EAAIZ,EAAS,EAAK,EAChD,CAACa,EAAWC,CAAY,EAAId,EAASQ,IAAO,CAAC,CAAC,EAC9CO,EAAcb,EAAuB,IAAI,EACzC,CAAE,aAAAc,CAAa,EAAIZ,EAAqB,EAExCa,EAAahB,EAAaiB,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,EACvBN,EAAgB,EAAK,CACvB,EAAG,CAAC,CAAC,EAECO,EAAiBlB,EAAY,IAAM,CACvCW,EAAgB,CAACD,CAAY,EAC7BR,EAAK,OAAOY,GAAa,QAAS,CAAE,OAAQ,CAAE,EAAG,CAAE,OAAQ,OAAQ,SAAU,GAAK,KAAM,cAAe,CAAC,CAC1G,EAAG,CAACJ,CAAY,CAAC,EAEjB,OACEb,EAAC,OACC,UAAAA,EAAC,UACC,UAAU,+GACV,QAASqB,EAER,UAAAN,GAAW,MAAMhB,EAACQ,EAAA,CAAc,UAAU,SAAQ,GACrD,EACAP,EAAC,OACC,UAAWC,EAAG,mEAAoE,CAC/E,OAAW,CAACY,CACf,CAAC,EACD,MAAO,CACL,OAAQ,iBAAiBF,CAAiB,KAC5C,EAEA,UAAAX,EAAC,OAAI,IAAKiB,EAAa,UAAU,mEAC9B,UAAAP,GAAM,IAAIU,GACTrB,EAAC,UACC,UAAU,qDAEV,QAAS,IAAMoB,EAAWC,CAAG,EAE5B,SAAAA,EAAI,OAHAA,EAAI,EAIX,CACD,EACDrB,EAAC,UAAO,UAAU,qDAAsD,SAAAmB,EAAa,GACvF,EACAnB,EAAC,OAAI,UAAU,SAAS,QAAS,IAAMe,EAAgB,EAAK,EAAG,GACjE,GACF,CAEJ,EAEMQ,EAAsB,CAAC,CAAE,KAAAZ,EAAM,kBAAAE,CAAkB,IAAyB,CAC9E,KAAM,CAACG,EAAWC,CAAY,EAAId,EAASQ,IAAO,CAAC,CAAC,EAE9CS,EAAahB,EAAaiB,GAA0B,CACxDJ,EAAaI,CAAG,EAChBR,IAAoBQ,CAAG,CACzB,EAAG,CAAC,CAAC,EAEL,OACErB,EAAC,OAAI,UAAU,aACZ,SAAAW,GAAM,IAAIU,GACTpB,EAAC,UAAO,UAAU,uCAAoD,QAAS,IAAMmB,EAAWC,CAAG,EAChG,UAAAA,EAAI,MACLrB,EAAC,OACC,UAAWE,EAAG,0FAA2F,CACvG,SAAUc,GAAW,KAAOK,EAAI,EAClC,CAAC,EACH,IAN4DA,EAAI,EAOlE,CACD,EACH,CAEJ",
6
+ "names": ["jsx", "jsxs", "cn", "useState", "useCallback", "useRef", "gsap", "useBizProductContext", "ArrowDownIcon", "props", "MobileScrollSpyNav", "tabs", "purchaseBarHeight", "onSpyNavItemClick", "dropdownOpen", "setDropdownOpen", "activeTab", "setActiveTab", "dropdownRef", "renderRating", "onTabClick", "tab", "onDropdownOpen", "DesktopScrollSpyNav"]
7
+ }
@@ -0,0 +1,10 @@
1
+ export interface ScrollSpyNavItem {
2
+ label: string;
3
+ href: string;
4
+ id: string;
5
+ }
6
+ export interface ScrollSpyNavProps {
7
+ tabs: ScrollSpyNavItem[];
8
+ purchaseBarHeight?: number;
9
+ onSpyNavItemClick?: (tab: ScrollSpyNavItem) => void;
10
+ }
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ import type { PurchaseBarProps } from './types.js';
2
+ declare const PurchaseBar: ({ onSpyNavItemClick }: PurchaseBarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default PurchaseBar;
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useState as n,useMemo as u}from"react";import{Heading as d,Container as f}from"../../../../components";import"gsap";import"../../../AiuiProvider/index.js";import"../../../../helpers/index.js";import{ProductActions as b}from"../index.js";import{useBizProductContext as h}from"../../BizProductProvider.js";import{MobileScrollSpyNav as y,DesktopScrollSpyNav as x}from"./ScrollSpyNav/index.js";const v=({onSpyNavItemClick:r})=>{const[p,i]=n(0),{isMobile:g,product:t,renderRating:l,isDesktop:o}=h(),s=u(()=>t?.payload?.components?.find(c=>c.componentKey==="PurchaseBar")?.data||[],[t?.payload]);return m(()=>{i(document.querySelector("#purchase-bar")?.clientHeight||0)},[]),e("div",{id:"purchase-bar",className:"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]",children:e(f,{children:a("div",{className:"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full",children:[a("div",{className:"flex-1 py-3 desktop:pt-6 desktop:pb-0 tablet:flex-none",children:[e(d,{size:2,className:"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]",html:t?.title}),o&&a("div",{className:"flex justify-between gap-8 items-center mt-3",children:[e(x,{tabs:s,onSpyNavItemClick:r}),l]})]}),o?e(b,{}):e(y,{tabs:s,purchaseBarHeight:p,onSpyNavItemClick:r})]})})})};var R=v;export{R as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useRef, useState, useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components'\nimport type { PurchaseBarProps, ScrollSpyNavProps, ScrollSpyNavItem } from './types.js'\nimport { gsap } from 'gsap'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { MobileScrollSpyNav, DesktopScrollSpyNav } from './ScrollSpyNav/index.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const { isMobile, product, renderRating, isDesktop } = useBizProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\n\n useEffect(() => {\n setPurchaseBarHeight(document.querySelector('#purchase-bar')?.clientHeight || 0)\n }, [])\n\n return (\n <div id=\"purchase-bar\" className=\"bg-white sticky top-0 left-0 w-full z-[52] border-b border-[#E4E5E6]\">\n <Container>\n {/* // py-3 desktop:pt-6 desktop:pb-0 */}\n <div className=\"flex gap-[10px] items-center tablet:justify-between tablet:gap-0 tablet:w-full\">\n <div className=\"flex-1 py-3 desktop:pt-6 desktop:pb-0 tablet:flex-none\">\n <Heading\n size={2}\n className=\"line-clamp-2 tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px]\"\n html={product?.title}\n />\n {isDesktop && (\n <div className=\"flex justify-between gap-8 items-center mt-3\">\n <DesktopScrollSpyNav tabs={PurchaseBarData} onSpyNavItemClick={onSpyNavItemClick} />\n {renderRating}\n </div>\n )}\n </div>\n {!isDesktop ? (\n <MobileScrollSpyNav\n tabs={PurchaseBarData}\n purchaseBarHeight={purchaseBarHeight}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n ) : (\n <ProductActions />\n )}\n </div>\n </Container>\n </div>\n )\n}\n\nexport default PurchaseBar\n"],
5
+ "mappings": "AA4BY,cAAAA,EAME,QAAAC,MANF,oBA5BZ,OAAsB,aAAAC,EAAmB,YAAAC,EAAU,WAAAC,MAAe,QAClE,OAAe,WAAAC,EAAiB,aAAAC,MAAiB,yBAEjD,MAAqB,OACrB,MAA+B,iCAC/B,MAAmB,+BACnB,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,sBAAAC,EAAoB,uBAAAC,MAA2B,0BAExD,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAACC,EAAmBC,CAAoB,EAAIX,EAAS,CAAC,EACtD,CAAE,SAAAY,EAAU,QAAAC,EAAS,aAAAC,EAAc,UAAAC,CAAU,EAAIV,EAAqB,EAEtEW,EAAkBf,EAAQ,IACvBY,GAAS,SAAS,YAAY,KAAMI,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACJ,GAAS,OAAO,CAAC,EAErB,OAAAd,EAAU,IAAM,CACdY,EAAqB,SAAS,cAAc,eAAe,GAAG,cAAgB,CAAC,CACjF,EAAG,CAAC,CAAC,EAGHd,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,SAAAA,EAACM,EAAA,CAEC,SAAAL,EAAC,OAAI,UAAU,iFACb,UAAAA,EAAC,OAAI,UAAU,yDACb,UAAAD,EAACK,EAAA,CACC,KAAM,EACN,UAAU,mFACV,KAAMW,GAAS,MACjB,EACCE,GACCjB,EAAC,OAAI,UAAU,+CACb,UAAAD,EAACU,EAAA,CAAoB,KAAMS,EAAiB,kBAAmBP,EAAmB,EACjFK,GACH,GAEJ,EACEC,EAOAlB,EAACO,EAAA,EAAe,EANhBP,EAACS,EAAA,CACC,KAAMU,EACN,kBAAmBN,EACnB,kBAAmBD,EACrB,GAIJ,EACF,EACF,CAEJ,EAEA,IAAOS,EAAQV",
6
+ "names": ["jsx", "jsxs", "useEffect", "useState", "useMemo", "Heading", "Container", "ProductActions", "useBizProductContext", "MobileScrollSpyNav", "DesktopScrollSpyNav", "PurchaseBar", "onSpyNavItemClick", "purchaseBarHeight", "setPurchaseBarHeight", "isMobile", "product", "renderRating", "isDesktop", "PurchaseBarData", "item", "PurchaseBar_default"]
7
+ }
@@ -0,0 +1,12 @@
1
+ export interface PurchaseBarProps {
2
+ onSpyNavItemClick?: (tab: ScrollSpyNavItem) => void;
3
+ }
4
+ export interface ScrollSpyNavItem {
5
+ label: string;
6
+ href: string;
7
+ id: string;
8
+ }
9
+ export interface ScrollSpyNavProps extends Pick<PurchaseBarProps, 'onSpyNavItemClick'> {
10
+ tabs: ScrollSpyNavItem[];
11
+ purchaseBarHeight: number;
12
+ }
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ export { default as PurchaseBar } from './PurchaseBar/index.js';
2
+ export { default as ProductActions } from './PurchaseBar/ProductActions/index.js';
3
+ export { default as ProductCard } from './ProductCard/index.js';
@@ -0,0 +1,2 @@
1
+ import{default as o}from"./PurchaseBar/index.js";import{default as e}from"./PurchaseBar/ProductActions/index.js";import{default as f}from"./ProductCard/index.js";export{e as ProductActions,f as ProductCard,o as PurchaseBar};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/components/index.ts"],
4
+ "sourcesContent": ["export { default as PurchaseBar } from './PurchaseBar/index.js'\nexport { default as ProductActions } from './PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './ProductCard/index.js'"],
5
+ "mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAAiC,wCAC1C,OAAoB,WAAXA,MAA8B",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1,29 @@
1
+ export declare enum DiscountType {
2
+ fixedAmount = "fixed_amount",
3
+ percentage = "percentage",
4
+ fixedDiscountAmount = "fix_discount_amount"
5
+ }
6
+ export declare enum CouponChannel {
7
+ LIGHTNING_DEAL = "LIGHTNING_DEAL",
8
+ DEAL = "LIGHTNING_DEAL",
9
+ COUPON = "COUPON",
10
+ PED = "PED",
11
+ WS24 = "WS24",
12
+ WSTD = "WSTD",
13
+ WSCH = "WSCH"
14
+ }
15
+ export declare const PRICE_SYMBOL: {
16
+ us: string;
17
+ uk: string;
18
+ ca: string;
19
+ eu: string;
20
+ pl: string;
21
+ fr: string;
22
+ de: string;
23
+ vn: string;
24
+ cl: string;
25
+ sg: string;
26
+ ae: string;
27
+ es: string;
28
+ };
29
+ export declare const COLOR_LABEL: string[];
@@ -0,0 +1,2 @@
1
+ var t=(e=>(e.fixedAmount="fixed_amount",e.percentage="percentage",e.fixedDiscountAmount="fix_discount_amount",e))(t||{}),L=(r=>(r.LIGHTNING_DEAL="LIGHTNING_DEAL",r.DEAL="LIGHTNING_DEAL",r.COUPON="COUPON",r.PED="PED",r.WS24="WS24",r.WSTD="WSTD",r.WSCH="WSCH",r))(L||{});const c={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"},E=["color","colour","couleur","cor","colore","farbe","\uC0C9","\u8272","\u30AB\u30E9\u30FC","f\xE4rg","farve"];export{E as COLOR_LABEL,L as CouponChannel,t as DiscountType,c as PRICE_SYMBOL};
2
+ //# sourceMappingURL=const.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/Listing/const.ts"],
4
+ "sourcesContent": ["export enum DiscountType {\n fixedAmount = 'fixed_amount',\n percentage = 'percentage',\n fixedDiscountAmount = 'fix_discount_amount',\n}\n\nexport enum CouponChannel {\n LIGHTNING_DEAL = 'LIGHTNING_DEAL',\n DEAL = 'LIGHTNING_DEAL',\n COUPON = 'COUPON',\n PED = 'PED',\n WS24 = 'WS24',\n WSTD = 'WSTD',\n WSCH = 'WSCH',\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n\nexport const COLOR_LABEL = [\n 'color',\n 'colour',\n 'couleur',\n 'cor',\n 'colore',\n 'farbe',\n '\uC0C9',\n '\u8272',\n '\u30AB\u30E9\u30FC',\n 'f\u00E4rg',\n 'farve',\n]"],
5
+ "mappings": "AAAO,IAAKA,OACVA,EAAA,YAAc,eACdA,EAAA,WAAa,aACbA,EAAA,oBAAsB,sBAHZA,OAAA,IAMAC,OACVA,EAAA,eAAiB,iBACjBA,EAAA,KAAO,iBACPA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OAPGA,OAAA,IAUL,MAAMC,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN,EAEaC,EAAc,CACzB,QACA,SACA,UACA,MACA,SACA,QACA,SACA,SACA,qBACA,UACA,OACF",
6
+ "names": ["DiscountType", "CouponChannel", "PRICE_SYMBOL", "COLOR_LABEL"]
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { Options, Product } from '../types/product';
2
+ import { type Dispatch, type SetStateAction } from 'react';
3
+ export declare function useSelectedOptions(product: Product, sku?: string): [Options, Dispatch<SetStateAction<Options>>];
@@ -0,0 +1,2 @@
1
+ import{btoaID as f,isObjEmpty as m}from"../utils/helper";import{parse as u}from"query-string";import{useEffect as d,useState as O}from"react";import{optionsConstructor as v}from"../utils";function l(t,o){const[p,i]=O({});return d(()=>{const n=u(window.location.search);let r=t.variants[0];if(n.variant){const c=f(n.variant),a=t.variants.find(e=>o?e.sku===o:e.id===c);a&&(r=a)}const s=v(r.options);m(s)||i(s)},[t,o]),[p,i]}export{l as useSelectedOptions};
2
+ //# sourceMappingURL=use-options.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/hooks/use-options.ts"],
4
+ "sourcesContent": ["import type { Options, Product, ProductVariant } from '../types/product'\nimport { btoaID, isObjEmpty } from '../utils/helper'\nimport { parse } from 'query-string'\nimport { type Dispatch, type SetStateAction, useEffect, useState } from 'react'\n\nimport { optionsConstructor } from '../utils'\n\nexport function useSelectedOptions(product: Product, sku?: string) {\n /**\n * \u6839\u636E query string \u521D\u59CB\u5316 selectedOptions\n * \u5982\u679C\u4F20\u5165 sku \u5219\u6839\u636E sku \u83B7\u53D6 variant\uFF0C\u5426\u5219\u9ED8\u8BA4\u6839\u636E query \u7684 variant \u83B7\u53D6\n */\n const [options, setOptions] = useState<Options>({})\n\n useEffect(() => {\n const query = parse(window.location.search) as { variant?: string }\n // \u9875\u9762\u521D\u59CB\u5316\u8BFB\u53D6 query \u4E2D\u7684 variant, \u5982\u679C\u6CA1\u6709\u627E\u5230\u5BF9\u5E94 query \u4E2D id \u7684 variant\uFF0C\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n let variant = product.variants[0]\n if (query.variant) {\n const variantId = btoaID(query.variant)\n\n const foundVariant = product.variants.find((variant: ProductVariant) =>\n sku ? variant.sku === sku : variant.id === variantId,\n )\n if (foundVariant) {\n variant = foundVariant\n }\n }\n\n // \u66F4\u65B0\u5F53\u524D variant \u5BF9\u5E94\u7684 options\n const options = optionsConstructor(variant.options)\n\n if (!isObjEmpty(options)) {\n setOptions(options)\n }\n }, [product, sku])\n\n return [options, setOptions] as [Options, Dispatch<SetStateAction<Options>>]\n}\n"],
5
+ "mappings": "AACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,kBACnC,OAAS,SAAAC,MAAa,eACtB,OAA6C,aAAAC,EAAW,YAAAC,MAAgB,QAExE,OAAS,sBAAAC,MAA0B,WAE5B,SAASC,EAAmBC,EAAkBC,EAAc,CAKjE,KAAM,CAACC,EAASC,CAAU,EAAIN,EAAkB,CAAC,CAAC,EAElD,OAAAD,EAAU,IAAM,CACd,MAAMQ,EAAQT,EAAM,OAAO,SAAS,MAAM,EAE1C,IAAIU,EAAUL,EAAQ,SAAS,CAAC,EAChC,GAAII,EAAM,QAAS,CACjB,MAAME,EAAYb,EAAOW,EAAM,OAAO,EAEhCG,EAAeP,EAAQ,SAAS,KAAMK,GAC1CJ,EAAMI,EAAQ,MAAQJ,EAAMI,EAAQ,KAAOC,CAC7C,EACIC,IACFF,EAAUE,EAEd,CAGA,MAAML,EAAUJ,EAAmBO,EAAQ,OAAO,EAE7CX,EAAWQ,CAAO,GACrBC,EAAWD,CAAO,CAEtB,EAAG,CAACF,EAASC,CAAG,CAAC,EAEV,CAACC,EAASC,CAAU,CAC7B",
6
+ "names": ["btoaID", "isObjEmpty", "parse", "useEffect", "useState", "optionsConstructor", "useSelectedOptions", "product", "sku", "options", "setOptions", "query", "variant", "variantId", "foundVariant"]
7
+ }
@@ -0,0 +1,14 @@
1
+ import { MediaContentType } from '../types/graphql';
2
+ import type { Replace } from '../types/type-helper';
3
+ import type { Product, ProductMedia, ProductVariant } from '../types/product';
4
+ export type ImageMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Image>;
5
+ export type VideoMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Video>;
6
+ export declare function useVariantMedia({ product, variant }: {
7
+ product: Product;
8
+ variant: ProductVariant;
9
+ }): {
10
+ productList: ImageMedia[];
11
+ sceneList: ImageMedia[];
12
+ keyFeaturesList: ImageMedia[];
13
+ videoList: VideoMedia[];
14
+ };
@@ -0,0 +1,2 @@
1
+ import{MediaContentType as a}from"../types/graphql";import{getVariantMediaList as f}from"../utils/helper";import{useEffect as C,useState as s}from"react";function v({product:t,variant:m}){const d=t?.media?.filter(e=>e.mediaContentType===a.Image),o=[d?.[0]],r=d?.slice(1,o.length),c=d?.slice(2,o.length),p=t?.media?.filter(e=>e.mediaContentType===a.Video),[M,g]=s(o||[]),[y,L]=s(r||[]),[u,I]=s(p||[]),[l,V]=s(c||[]);return C(()=>{const e=f({product:t,variant:m}),i=e?.filter(n=>n.mediaContentType===a.Image);g(i?.[0]?[i[0]]:[]),L(i?.slice(1,i?.length)||[]),V([]),I(e?.filter(n=>n.mediaContentType===a.Video)||[])},[t,m]),{productList:M,sceneList:y,videoList:u,keyFeaturesList:l}}export{v as useVariantMedia};
2
+ //# sourceMappingURL=use-variant-media.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/hooks/use-variant-media.ts"],
4
+ "sourcesContent": ["import { MediaContentType } from '../types/graphql'\nimport { getVariantMediaList } from '../utils/helper'\nimport type { Replace } from '../types/type-helper'\nimport type { Product, ProductMedia, ProductVariant } from '../types/product'\nimport { useEffect, useState } from 'react'\n\nexport type ImageMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Image>\nexport type VideoMedia = Replace<ProductMedia, 'mediaContentType', MediaContentType.Video>\n\nexport function useVariantMedia({ product, variant }: { product: Product; variant: ProductVariant }): {\n productList: ImageMedia[]\n sceneList: ImageMedia[]\n keyFeaturesList: ImageMedia[]\n videoList: VideoMedia[]\n} {\n const mediaList = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Image)\n const productImageList = [mediaList?.[0]] as ImageMedia[]\n const scenes = mediaList?.slice(1, productImageList.length) as ImageMedia[]\n const keyFeatures = mediaList?.slice(2, productImageList.length) as ImageMedia[]\n const videos = product?.media?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]\n const [imageList, setImageList] = useState<ImageMedia[]>(productImageList || [])\n const [sceneList, setSeneList] = useState<ImageMedia[]>(scenes || [])\n const [videoList, setVideoList] = useState<VideoMedia[]>(videos || [])\n const [keyFeaturesList, setKeyFeaturesList] = useState<ImageMedia[]>(keyFeatures || [])\n useEffect(() => {\n const mediaList = getVariantMediaList({ product, variant })\n\n const imageList = mediaList?.filter((media) => media.mediaContentType === MediaContentType.Image) as ImageMedia[]\n setImageList(imageList?.[0] ? [imageList[0]] : [])\n setSeneList(imageList?.slice(1, imageList?.length) || [])\n setKeyFeaturesList([])\n setVideoList(\n (mediaList?.filter((media) => media.mediaContentType === MediaContentType.Video) as VideoMedia[]) || [],\n )\n }, [product, variant])\n\n return { productList: imageList, sceneList, videoList: videoList, keyFeaturesList }\n}\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,mBACjC,OAAS,uBAAAC,MAA2B,kBAGpC,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QAK7B,SAASC,EAAgB,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAKjD,CACA,MAAMC,EAAYF,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC/FS,EAAmB,CAACF,IAAY,CAAC,CAAC,EAClCG,EAASH,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACpDE,EAAcJ,GAAW,MAAM,EAAGE,EAAiB,MAAM,EACzDG,EAASP,GAAS,OAAO,OAAQG,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAC5F,CAACa,EAAWC,CAAY,EAAIX,EAAuBM,GAAoB,CAAC,CAAC,EACzE,CAACM,EAAWC,CAAW,EAAIb,EAAuBO,GAAU,CAAC,CAAC,EAC9D,CAACO,EAAWC,CAAY,EAAIf,EAAuBS,GAAU,CAAC,CAAC,EAC/D,CAACO,EAAiBC,CAAkB,EAAIjB,EAAuBQ,GAAe,CAAC,CAAC,EACtF,OAAAT,EAAU,IAAM,CACd,MAAMK,EAAYN,EAAoB,CAAE,QAAAI,EAAS,QAAAC,CAAQ,CAAC,EAEpDO,EAAYN,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,EAChGc,EAAaD,IAAY,CAAC,EAAI,CAACA,EAAU,CAAC,CAAC,EAAI,CAAC,CAAC,EACjDG,EAAYH,GAAW,MAAM,EAAGA,GAAW,MAAM,GAAK,CAAC,CAAC,EACxDO,EAAmB,CAAC,CAAC,EACrBF,EACGX,GAAW,OAAQC,GAAUA,EAAM,mBAAqBR,EAAiB,KAAK,GAAsB,CAAC,CACxG,CACF,EAAG,CAACK,EAASC,CAAO,CAAC,EAEd,CAAE,YAAaO,EAAW,UAAAE,EAAW,UAAWE,EAAW,gBAAAE,CAAgB,CACpF",
6
+ "names": ["MediaContentType", "getVariantMediaList", "useEffect", "useState", "useVariantMedia", "product", "variant", "mediaList", "media", "productImageList", "scenes", "keyFeatures", "videos", "imageList", "setImageList", "sceneList", "setSeneList", "videoList", "setVideoList", "keyFeaturesList", "setKeyFeaturesList"]
7
+ }