@anker-in/campaign-ui 0.2.10-beta.2 → 0.2.10-beta.20

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 (726) hide show
  1. package/dist/index.d.mts +494 -0
  2. package/dist/index.d.ts +494 -0
  3. package/dist/index.js +31227 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +31211 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +33 -30
  8. package/src/components/credits/context/hooks/useActivities.ts +2 -2
  9. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  10. package/src/components/credits/context/hooks/useAlpcFetch.ts +8 -8
  11. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  12. package/src/components/credits/context/hooks/useMyRewards.ts +2 -2
  13. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  14. package/src/components/credits/context/hooks/useRedeemCoupon.ts +2 -2
  15. package/src/components/credits/context/hooks/useRedeemProduct.ts +2 -2
  16. package/src/components/credits/context/hooks/useRedeemableList.ts +2 -2
  17. package/src/components/credits/context/hooks/useSendEmailValidation.ts +2 -2
  18. package/src/components/credits/context/hooks/useSubscribed.ts +2 -2
  19. package/src/components/credits/context/hooks/useSubscriptions.ts +2 -2
  20. package/src/components/credits/creditsBanner/index.tsx +1 -1
  21. package/src/components/credits/creditsBenefits/benefitItem.tsx +1 -1
  22. package/src/components/credits/creditsBenefits/index.tsx +6 -8
  23. package/src/components/credits/creditsCash/RedeemableItem.tsx +13 -18
  24. package/src/components/credits/creditsCash/index.tsx +2 -2
  25. package/src/components/credits/creditsCash/type.ts +1 -1
  26. package/src/components/credits/creditsInfoCard/index.tsx +4 -3
  27. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +2 -2
  28. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +2 -2
  29. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +2 -2
  30. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +2 -2
  31. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +2 -2
  32. package/src/components/credits/creditsRedeemList/index.tsx +1 -1
  33. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +4 -3
  34. package/src/components/credits/modal/MyRewardsModal.tsx +77 -65
  35. package/src/components/credits/modal/activitiesModal.tsx +54 -44
  36. package/src/components/credits/modal/loadingDots.tsx +8 -6
  37. package/src/components/credits/type.ts +1 -1
  38. package/src/helpers/track.ts +18 -0
  39. package/src/index.ts +2 -21
  40. package/tailwind.config.ts +10 -0
  41. package/dist/cjs/components/chat/action.d.ts +0 -25
  42. package/dist/cjs/components/chat/action.js +0 -2
  43. package/dist/cjs/components/chat/action.js.map +0 -7
  44. package/dist/cjs/components/chat/button.d.ts +0 -3
  45. package/dist/cjs/components/chat/button.js +0 -2
  46. package/dist/cjs/components/chat/button.js.map +0 -7
  47. package/dist/cjs/components/chat/chatContext.d.ts +0 -101
  48. package/dist/cjs/components/chat/chatContext.js +0 -2
  49. package/dist/cjs/components/chat/chatContext.js.map +0 -7
  50. package/dist/cjs/components/chat/index.d.ts +0 -71
  51. package/dist/cjs/components/chat/index.js +0 -2
  52. package/dist/cjs/components/chat/index.js.map +0 -7
  53. package/dist/cjs/components/chat/markdown.d.ts +0 -5
  54. package/dist/cjs/components/chat/markdown.js +0 -2
  55. package/dist/cjs/components/chat/markdown.js.map +0 -7
  56. package/dist/cjs/components/chat/messages.d.ts +0 -3
  57. package/dist/cjs/components/chat/messages.js +0 -2
  58. package/dist/cjs/components/chat/messages.js.map +0 -7
  59. package/dist/cjs/components/chat/props.d.ts +0 -43
  60. package/dist/cjs/components/chat/props.js +0 -2
  61. package/dist/cjs/components/chat/props.js.map +0 -7
  62. package/dist/cjs/components/chat/response.d.ts +0 -4
  63. package/dist/cjs/components/chat/response.js +0 -2
  64. package/dist/cjs/components/chat/response.js.map +0 -7
  65. package/dist/cjs/components/chat/suggestions.d.ts +0 -3
  66. package/dist/cjs/components/chat/suggestions.js +0 -2
  67. package/dist/cjs/components/chat/suggestions.js.map +0 -7
  68. package/dist/cjs/components/chat/utils.d.ts +0 -3
  69. package/dist/cjs/components/chat/utils.js +0 -2
  70. package/dist/cjs/components/chat/utils.js.map +0 -7
  71. package/dist/cjs/components/credits/context/const.d.ts +0 -81
  72. package/dist/cjs/components/credits/context/const.js +0 -2
  73. package/dist/cjs/components/credits/context/const.js.map +0 -7
  74. package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +0 -12
  75. package/dist/cjs/components/credits/context/hooks/useActivities.js +0 -2
  76. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +0 -7
  77. package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
  78. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +0 -2
  79. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +0 -7
  80. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
  81. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +0 -2
  82. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
  83. package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +0 -3
  84. package/dist/cjs/components/credits/context/hooks/useClickOutside.js +0 -2
  85. package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +0 -7
  86. package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +0 -5
  87. package/dist/cjs/components/credits/context/hooks/useCopy.js +0 -2
  88. package/dist/cjs/components/credits/context/hooks/useCopy.js.map +0 -7
  89. package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +0 -8
  90. package/dist/cjs/components/credits/context/hooks/useCountries.js +0 -2
  91. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +0 -7
  92. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
  93. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
  94. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
  95. package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +0 -14
  96. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +0 -2
  97. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +0 -7
  98. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
  99. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +0 -2
  100. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
  101. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
  102. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
  103. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
  104. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
  105. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +0 -2
  106. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
  107. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
  108. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +0 -2
  109. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
  110. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
  111. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +0 -2
  112. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +0 -7
  113. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  114. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  115. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  116. package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +0 -1
  117. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +0 -2
  118. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +0 -7
  119. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  120. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  121. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  122. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
  123. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +0 -2
  124. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
  125. package/dist/cjs/components/credits/context/provider.d.ts +0 -49
  126. package/dist/cjs/components/credits/context/provider.js +0 -2
  127. package/dist/cjs/components/credits/context/provider.js.map +0 -7
  128. package/dist/cjs/components/credits/context/response.d.ts +0 -63
  129. package/dist/cjs/components/credits/context/response.js +0 -2
  130. package/dist/cjs/components/credits/context/response.js.map +0 -7
  131. package/dist/cjs/components/credits/context/utils.d.ts +0 -25
  132. package/dist/cjs/components/credits/context/utils.js +0 -2
  133. package/dist/cjs/components/credits/context/utils.js.map +0 -7
  134. package/dist/cjs/components/credits/creditsBanner/index.d.ts +0 -23
  135. package/dist/cjs/components/credits/creditsBanner/index.js +0 -2
  136. package/dist/cjs/components/credits/creditsBanner/index.js.map +0 -7
  137. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  138. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +0 -2
  139. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +0 -7
  140. package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
  141. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +0 -2
  142. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +0 -7
  143. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +0 -12
  144. package/dist/cjs/components/credits/creditsBenefits/index.js +0 -4
  145. package/dist/cjs/components/credits/creditsBenefits/index.js.map +0 -7
  146. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
  147. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +0 -2
  148. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +0 -7
  149. package/dist/cjs/components/credits/creditsCash/index.d.ts +0 -13
  150. package/dist/cjs/components/credits/creditsCash/index.js +0 -2
  151. package/dist/cjs/components/credits/creditsCash/index.js.map +0 -7
  152. package/dist/cjs/components/credits/creditsCash/type.d.ts +0 -47
  153. package/dist/cjs/components/credits/creditsCash/type.js +0 -2
  154. package/dist/cjs/components/credits/creditsCash/type.js.map +0 -7
  155. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
  156. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
  157. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
  158. package/dist/cjs/components/credits/creditsFaq/index.d.ts +0 -16
  159. package/dist/cjs/components/credits/creditsFaq/index.js +0 -2
  160. package/dist/cjs/components/credits/creditsFaq/index.js.map +0 -7
  161. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +0 -20
  162. package/dist/cjs/components/credits/creditsInfoCard/index.js +0 -2
  163. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +0 -7
  164. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
  165. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
  166. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
  167. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
  168. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
  169. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
  170. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
  171. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
  172. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
  173. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
  174. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
  175. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +0 -7
  176. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +0 -2
  177. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
  178. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
  179. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
  180. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +0 -2
  181. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
  182. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
  183. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
  184. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
  185. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
  186. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
  187. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
  188. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
  189. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
  190. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
  191. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
  192. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
  193. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
  194. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
  195. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
  196. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
  197. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
  198. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
  199. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
  200. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
  201. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
  202. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
  203. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
  204. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
  205. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
  206. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +0 -13
  207. package/dist/cjs/components/credits/creditsRedeemList/index.js +0 -2
  208. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +0 -7
  209. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +0 -77
  210. package/dist/cjs/components/credits/creditsRedeemList/type.js +0 -2
  211. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +0 -7
  212. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
  213. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +0 -2
  214. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
  215. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
  216. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +0 -2
  217. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
  218. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
  219. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
  220. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
  221. package/dist/cjs/components/credits/index.d.ts +0 -10
  222. package/dist/cjs/components/credits/index.js +0 -2
  223. package/dist/cjs/components/credits/index.js.map +0 -7
  224. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -29
  225. package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
  226. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
  227. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +0 -29
  228. package/dist/cjs/components/credits/modal/activitiesModal.js +0 -2
  229. package/dist/cjs/components/credits/modal/activitiesModal.js.map +0 -7
  230. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
  231. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +0 -2
  232. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
  233. package/dist/cjs/components/credits/modal/loadingDots.d.ts +0 -5
  234. package/dist/cjs/components/credits/modal/loadingDots.js +0 -2
  235. package/dist/cjs/components/credits/modal/loadingDots.js.map +0 -7
  236. package/dist/cjs/components/credits/modal/modalContainer.d.ts +0 -15
  237. package/dist/cjs/components/credits/modal/modalContainer.js +0 -2
  238. package/dist/cjs/components/credits/modal/modalContainer.js.map +0 -7
  239. package/dist/cjs/components/credits/modal/rulesModal.d.ts +0 -7
  240. package/dist/cjs/components/credits/modal/rulesModal.js +0 -2
  241. package/dist/cjs/components/credits/modal/rulesModal.js.map +0 -7
  242. package/dist/cjs/components/credits/modal/tip.d.ts +0 -5
  243. package/dist/cjs/components/credits/modal/tip.js +0 -2
  244. package/dist/cjs/components/credits/modal/tip.js.map +0 -7
  245. package/dist/cjs/components/credits/type.d.ts +0 -55
  246. package/dist/cjs/components/credits/type.js +0 -2
  247. package/dist/cjs/components/credits/type.js.map +0 -7
  248. package/dist/cjs/components/index.d.ts +0 -3
  249. package/dist/cjs/components/index.js +0 -2
  250. package/dist/cjs/components/index.js.map +0 -7
  251. package/dist/cjs/debug-env.d.ts +0 -7
  252. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  253. package/dist/cjs/helpers/fetchResponse.js +0 -2
  254. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  255. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  256. package/dist/cjs/helpers/fetcher.js +0 -2
  257. package/dist/cjs/helpers/fetcher.js.map +0 -7
  258. package/dist/cjs/helpers/index.d.ts +0 -2
  259. package/dist/cjs/helpers/index.js +0 -2
  260. package/dist/cjs/helpers/index.js.map +0 -7
  261. package/dist/cjs/helpers/track.d.ts +0 -15
  262. package/dist/cjs/helpers/track.js +0 -2
  263. package/dist/cjs/helpers/track.js.map +0 -7
  264. package/dist/cjs/helpers/utils.d.ts +0 -3
  265. package/dist/cjs/helpers/utils.js +0 -2
  266. package/dist/cjs/helpers/utils.js.map +0 -7
  267. package/dist/cjs/index.css +0 -2
  268. package/dist/cjs/index.css.map +0 -7
  269. package/dist/cjs/index.d.ts +0 -7
  270. package/dist/cjs/index.js +0 -2
  271. package/dist/cjs/index.js.map +0 -7
  272. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  273. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -13
  274. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  275. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  276. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  277. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  278. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  279. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  280. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  281. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  282. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  283. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  284. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  285. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  286. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  287. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  288. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  289. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  290. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  291. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  292. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  293. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  294. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  295. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  296. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  297. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  298. package/dist/cjs/shopify/src/index.d.ts +0 -5
  299. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  300. package/dist/cjs/shopify/types/article.d.ts +0 -48
  301. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  302. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  303. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  304. package/dist/cjs/shopify/types/common.d.ts +0 -42
  305. package/dist/cjs/shopify/types/config.d.ts +0 -12
  306. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  307. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  308. package/dist/cjs/shopify/types/index.d.ts +0 -10
  309. package/dist/cjs/shopify/types/page.d.ts +0 -33
  310. package/dist/cjs/shopify/types/product.d.ts +0 -174
  311. package/dist/cjs/shopify/types/search.d.ts +0 -54
  312. package/dist/cjs/shopify/types/site.d.ts +0 -33
  313. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  314. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  315. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  316. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  317. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  318. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  319. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  320. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  321. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  322. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  323. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  324. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  325. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  326. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  327. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  328. package/dist/cjs/stories/chat.stories.d.ts +0 -7
  329. package/dist/esm/components/chat/action.d.ts +0 -25
  330. package/dist/esm/components/chat/action.js +0 -2
  331. package/dist/esm/components/chat/action.js.map +0 -7
  332. package/dist/esm/components/chat/button.d.ts +0 -3
  333. package/dist/esm/components/chat/button.js +0 -2
  334. package/dist/esm/components/chat/button.js.map +0 -7
  335. package/dist/esm/components/chat/chatContext.d.ts +0 -101
  336. package/dist/esm/components/chat/chatContext.js +0 -2
  337. package/dist/esm/components/chat/chatContext.js.map +0 -7
  338. package/dist/esm/components/chat/index.d.ts +0 -71
  339. package/dist/esm/components/chat/index.js +0 -2
  340. package/dist/esm/components/chat/index.js.map +0 -7
  341. package/dist/esm/components/chat/markdown.d.ts +0 -5
  342. package/dist/esm/components/chat/markdown.js +0 -2
  343. package/dist/esm/components/chat/markdown.js.map +0 -7
  344. package/dist/esm/components/chat/messages.d.ts +0 -3
  345. package/dist/esm/components/chat/messages.js +0 -2
  346. package/dist/esm/components/chat/messages.js.map +0 -7
  347. package/dist/esm/components/chat/props.d.ts +0 -43
  348. package/dist/esm/components/chat/props.js +0 -1
  349. package/dist/esm/components/chat/props.js.map +0 -7
  350. package/dist/esm/components/chat/response.d.ts +0 -4
  351. package/dist/esm/components/chat/response.js +0 -2
  352. package/dist/esm/components/chat/response.js.map +0 -7
  353. package/dist/esm/components/chat/suggestions.d.ts +0 -3
  354. package/dist/esm/components/chat/suggestions.js +0 -2
  355. package/dist/esm/components/chat/suggestions.js.map +0 -7
  356. package/dist/esm/components/chat/utils.d.ts +0 -3
  357. package/dist/esm/components/chat/utils.js +0 -2
  358. package/dist/esm/components/chat/utils.js.map +0 -7
  359. package/dist/esm/components/credits/context/const.d.ts +0 -81
  360. package/dist/esm/components/credits/context/const.js +0 -2
  361. package/dist/esm/components/credits/context/const.js.map +0 -7
  362. package/dist/esm/components/credits/context/hooks/useActivities.d.ts +0 -12
  363. package/dist/esm/components/credits/context/hooks/useActivities.js +0 -2
  364. package/dist/esm/components/credits/context/hooks/useActivities.js.map +0 -7
  365. package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +0 -34
  366. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +0 -2
  367. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +0 -7
  368. package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +0 -23
  369. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +0 -2
  370. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +0 -7
  371. package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +0 -3
  372. package/dist/esm/components/credits/context/hooks/useClickOutside.js +0 -2
  373. package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +0 -7
  374. package/dist/esm/components/credits/context/hooks/useCopy.d.ts +0 -5
  375. package/dist/esm/components/credits/context/hooks/useCopy.js +0 -2
  376. package/dist/esm/components/credits/context/hooks/useCopy.js.map +0 -7
  377. package/dist/esm/components/credits/context/hooks/useCountries.d.ts +0 -8
  378. package/dist/esm/components/credits/context/hooks/useCountries.js +0 -2
  379. package/dist/esm/components/credits/context/hooks/useCountries.js.map +0 -7
  380. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +0 -1
  381. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +0 -2
  382. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +0 -7
  383. package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +0 -14
  384. package/dist/esm/components/credits/context/hooks/useMyRewards.js +0 -2
  385. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +0 -7
  386. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +0 -2
  387. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +0 -2
  388. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +0 -7
  389. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +0 -14
  390. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +0 -2
  391. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +0 -7
  392. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +0 -17
  393. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +0 -2
  394. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +0 -7
  395. package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +0 -16
  396. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +0 -2
  397. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +0 -7
  398. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +0 -7
  399. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +0 -2
  400. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +0 -7
  401. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  402. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  403. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  404. package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +0 -1
  405. package/dist/esm/components/credits/context/hooks/useSubscribed.js +0 -2
  406. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +0 -7
  407. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  408. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  409. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  410. package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +0 -14
  411. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +0 -2
  412. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +0 -7
  413. package/dist/esm/components/credits/context/provider.d.ts +0 -49
  414. package/dist/esm/components/credits/context/provider.js +0 -2
  415. package/dist/esm/components/credits/context/provider.js.map +0 -7
  416. package/dist/esm/components/credits/context/response.d.ts +0 -63
  417. package/dist/esm/components/credits/context/response.js +0 -1
  418. package/dist/esm/components/credits/context/response.js.map +0 -7
  419. package/dist/esm/components/credits/context/utils.d.ts +0 -25
  420. package/dist/esm/components/credits/context/utils.js +0 -2
  421. package/dist/esm/components/credits/context/utils.js.map +0 -7
  422. package/dist/esm/components/credits/creditsBanner/index.d.ts +0 -23
  423. package/dist/esm/components/credits/creditsBanner/index.js +0 -2
  424. package/dist/esm/components/credits/creditsBanner/index.js.map +0 -7
  425. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  426. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
  427. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
  428. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
  429. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
  430. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +0 -7
  431. package/dist/esm/components/credits/creditsBenefits/index.d.ts +0 -12
  432. package/dist/esm/components/credits/creditsBenefits/index.js +0 -4
  433. package/dist/esm/components/credits/creditsBenefits/index.js.map +0 -7
  434. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +0 -15
  435. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +0 -2
  436. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +0 -7
  437. package/dist/esm/components/credits/creditsCash/index.d.ts +0 -13
  438. package/dist/esm/components/credits/creditsCash/index.js +0 -2
  439. package/dist/esm/components/credits/creditsCash/index.js.map +0 -7
  440. package/dist/esm/components/credits/creditsCash/type.d.ts +0 -47
  441. package/dist/esm/components/credits/creditsCash/type.js +0 -1
  442. package/dist/esm/components/credits/creditsCash/type.js.map +0 -7
  443. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +0 -13
  444. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +0 -2
  445. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +0 -7
  446. package/dist/esm/components/credits/creditsFaq/index.d.ts +0 -16
  447. package/dist/esm/components/credits/creditsFaq/index.js +0 -2
  448. package/dist/esm/components/credits/creditsFaq/index.js.map +0 -7
  449. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +0 -20
  450. package/dist/esm/components/credits/creditsInfoCard/index.js +0 -2
  451. package/dist/esm/components/credits/creditsInfoCard/index.js.map +0 -7
  452. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +0 -14
  453. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +0 -2
  454. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +0 -7
  455. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +0 -6
  456. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +0 -2
  457. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +0 -7
  458. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +0 -13
  459. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +0 -2
  460. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +0 -7
  461. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +0 -15
  462. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +0 -2
  463. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +0 -7
  464. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +0 -2
  465. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +0 -2
  466. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +0 -7
  467. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +0 -26
  468. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +0 -1
  469. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +0 -7
  470. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +0 -9
  471. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +0 -2
  472. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +0 -7
  473. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +0 -20
  474. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +0 -2
  475. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +0 -7
  476. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +0 -8
  477. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +0 -2
  478. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +0 -7
  479. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +0 -11
  480. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +0 -2
  481. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +0 -7
  482. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +0 -8
  483. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +0 -2
  484. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +0 -7
  485. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +0 -13
  486. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +0 -2
  487. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +0 -7
  488. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +0 -11
  489. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +0 -2
  490. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +0 -7
  491. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +0 -9
  492. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +0 -2
  493. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +0 -7
  494. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +0 -13
  495. package/dist/esm/components/credits/creditsRedeemList/index.js +0 -2
  496. package/dist/esm/components/credits/creditsRedeemList/index.js.map +0 -7
  497. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +0 -77
  498. package/dist/esm/components/credits/creditsRedeemList/type.js +0 -1
  499. package/dist/esm/components/credits/creditsRedeemList/type.js.map +0 -7
  500. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +0 -2
  501. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +0 -2
  502. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +0 -7
  503. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +0 -60
  504. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +0 -2
  505. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +0 -7
  506. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +0 -96
  507. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +0 -2
  508. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +0 -7
  509. package/dist/esm/components/credits/index.d.ts +0 -10
  510. package/dist/esm/components/credits/index.js +0 -2
  511. package/dist/esm/components/credits/index.js.map +0 -7
  512. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -29
  513. package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
  514. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
  515. package/dist/esm/components/credits/modal/activitiesModal.d.ts +0 -29
  516. package/dist/esm/components/credits/modal/activitiesModal.js +0 -2
  517. package/dist/esm/components/credits/modal/activitiesModal.js.map +0 -7
  518. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +0 -24
  519. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +0 -2
  520. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +0 -7
  521. package/dist/esm/components/credits/modal/loadingDots.d.ts +0 -5
  522. package/dist/esm/components/credits/modal/loadingDots.js +0 -2
  523. package/dist/esm/components/credits/modal/loadingDots.js.map +0 -7
  524. package/dist/esm/components/credits/modal/modalContainer.d.ts +0 -15
  525. package/dist/esm/components/credits/modal/modalContainer.js +0 -2
  526. package/dist/esm/components/credits/modal/modalContainer.js.map +0 -7
  527. package/dist/esm/components/credits/modal/rulesModal.d.ts +0 -7
  528. package/dist/esm/components/credits/modal/rulesModal.js +0 -2
  529. package/dist/esm/components/credits/modal/rulesModal.js.map +0 -7
  530. package/dist/esm/components/credits/modal/tip.d.ts +0 -5
  531. package/dist/esm/components/credits/modal/tip.js +0 -2
  532. package/dist/esm/components/credits/modal/tip.js.map +0 -7
  533. package/dist/esm/components/credits/type.d.ts +0 -55
  534. package/dist/esm/components/credits/type.js +0 -1
  535. package/dist/esm/components/credits/type.js.map +0 -7
  536. package/dist/esm/components/index.d.ts +0 -3
  537. package/dist/esm/components/index.js +0 -2
  538. package/dist/esm/components/index.js.map +0 -7
  539. package/dist/esm/debug-env.d.ts +0 -7
  540. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  541. package/dist/esm/helpers/fetchResponse.js +0 -2
  542. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  543. package/dist/esm/helpers/fetcher.d.ts +0 -2
  544. package/dist/esm/helpers/fetcher.js +0 -2
  545. package/dist/esm/helpers/fetcher.js.map +0 -7
  546. package/dist/esm/helpers/index.d.ts +0 -2
  547. package/dist/esm/helpers/index.js +0 -2
  548. package/dist/esm/helpers/index.js.map +0 -7
  549. package/dist/esm/helpers/track.d.ts +0 -15
  550. package/dist/esm/helpers/track.js +0 -2
  551. package/dist/esm/helpers/track.js.map +0 -7
  552. package/dist/esm/helpers/utils.d.ts +0 -3
  553. package/dist/esm/helpers/utils.js +0 -2
  554. package/dist/esm/helpers/utils.js.map +0 -7
  555. package/dist/esm/index.css +0 -2
  556. package/dist/esm/index.css.map +0 -7
  557. package/dist/esm/index.d.ts +0 -7
  558. package/dist/esm/index.js +0 -2
  559. package/dist/esm/index.js.map +0 -7
  560. package/dist/esm/package.json +0 -3
  561. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  562. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -13
  563. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  564. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  565. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  566. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  567. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  568. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  569. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  570. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  571. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  572. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  573. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  574. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  575. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  576. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  577. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  578. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  579. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  580. package/dist/esm/shopify/gql/index.d.ts +0 -3
  581. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  582. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  583. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  584. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  585. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  586. package/dist/esm/shopify/queries/index.d.ts +0 -1
  587. package/dist/esm/shopify/src/index.d.ts +0 -5
  588. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  589. package/dist/esm/shopify/types/article.d.ts +0 -48
  590. package/dist/esm/shopify/types/cart.d.ts +0 -173
  591. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  592. package/dist/esm/shopify/types/collection.d.ts +0 -122
  593. package/dist/esm/shopify/types/common.d.ts +0 -42
  594. package/dist/esm/shopify/types/config.d.ts +0 -12
  595. package/dist/esm/shopify/types/customer.d.ts +0 -30
  596. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  597. package/dist/esm/shopify/types/index.d.ts +0 -10
  598. package/dist/esm/shopify/types/page.d.ts +0 -33
  599. package/dist/esm/shopify/types/product.d.ts +0 -174
  600. package/dist/esm/shopify/types/search.d.ts +0 -54
  601. package/dist/esm/shopify/types/site.d.ts +0 -33
  602. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  603. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  604. package/dist/esm/shopify/utils/const.d.ts +0 -76
  605. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  606. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  607. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  608. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  609. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  610. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  611. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  612. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  613. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  614. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  615. package/dist/esm/shopify/utils/store.d.ts +0 -2
  616. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  617. package/dist/esm/stories/chat.stories.d.ts +0 -7
  618. package/src/shopify/MIGRATION_GUIDE.md +0 -156
  619. package/src/shopify/context/ShopifyProvider.tsx +0 -34
  620. package/src/shopify/dist/cart-BNkVu3fh.d.ts +0 -220
  621. package/src/shopify/dist/cart-BcrGTPdx.d.cts +0 -220
  622. package/src/shopify/dist/fetchers.cjs +0 -7945
  623. package/src/shopify/dist/fetchers.cjs.map +0 -1
  624. package/src/shopify/dist/fetchers.d.cts +0 -3
  625. package/src/shopify/dist/fetchers.d.ts +0 -3
  626. package/src/shopify/dist/fetchers.js +0 -7942
  627. package/src/shopify/dist/fetchers.js.map +0 -1
  628. package/src/shopify/dist/fragments.cjs +0 -731
  629. package/src/shopify/dist/fragments.cjs.map +0 -1
  630. package/src/shopify/dist/fragments.d.cts +0 -25
  631. package/src/shopify/dist/fragments.d.ts +0 -25
  632. package/src/shopify/dist/fragments.js +0 -705
  633. package/src/shopify/dist/fragments.js.map +0 -1
  634. package/src/shopify/dist/graphql-D4M28V-x.d.cts +0 -3558
  635. package/src/shopify/dist/graphql-D4M28V-x.d.ts +0 -3558
  636. package/src/shopify/dist/hooks.cjs +0 -9431
  637. package/src/shopify/dist/hooks.cjs.map +0 -1
  638. package/src/shopify/dist/hooks.d.cts +0 -14
  639. package/src/shopify/dist/hooks.d.ts +0 -14
  640. package/src/shopify/dist/hooks.js +0 -9427
  641. package/src/shopify/dist/hooks.js.map +0 -1
  642. package/src/shopify/dist/index-BTtE4HZM.d.ts +0 -42
  643. package/src/shopify/dist/index-BjNIecYX.d.cts +0 -42
  644. package/src/shopify/dist/index.cjs +0 -9642
  645. package/src/shopify/dist/index.cjs.map +0 -1
  646. package/src/shopify/dist/index.d.cts +0 -11
  647. package/src/shopify/dist/index.d.ts +0 -11
  648. package/src/shopify/dist/index.js +0 -9619
  649. package/src/shopify/dist/index.js.map +0 -1
  650. package/src/shopify/dist/product-Bqi3sqb9.d.cts +0 -262
  651. package/src/shopify/dist/product-DNk6jYAP.d.ts +0 -262
  652. package/src/shopify/dist/queries.cjs +0 -615
  653. package/src/shopify/dist/queries.cjs.map +0 -1
  654. package/src/shopify/dist/queries.d.cts +0 -3
  655. package/src/shopify/dist/queries.d.ts +0 -3
  656. package/src/shopify/dist/queries.js +0 -601
  657. package/src/shopify/dist/queries.js.map +0 -1
  658. package/src/shopify/dist/types.cjs +0 -19
  659. package/src/shopify/dist/types.cjs.map +0 -1
  660. package/src/shopify/dist/types.d.cts +0 -282
  661. package/src/shopify/dist/types.d.ts +0 -282
  662. package/src/shopify/dist/types.js +0 -1
  663. package/src/shopify/dist/types.js.map +0 -1
  664. package/src/shopify/dist/utils.cjs +0 -334
  665. package/src/shopify/dist/utils.cjs.map +0 -1
  666. package/src/shopify/dist/utils.d.cts +0 -12
  667. package/src/shopify/dist/utils.d.ts +0 -12
  668. package/src/shopify/dist/utils.js +0 -319
  669. package/src/shopify/dist/utils.js.map +0 -1
  670. package/src/shopify/fetchers/create-cart.ts +0 -40
  671. package/src/shopify/fetchers/get-products-by-handles.ts +0 -41
  672. package/src/shopify/fetchers/index.ts +0 -3
  673. package/src/shopify/fragments/article.ts +0 -51
  674. package/src/shopify/fragments/blog.ts +0 -10
  675. package/src/shopify/fragments/cart.ts +0 -190
  676. package/src/shopify/fragments/collection.ts +0 -15
  677. package/src/shopify/fragments/image.ts +0 -8
  678. package/src/shopify/fragments/index.ts +0 -11
  679. package/src/shopify/fragments/metafields.ts +0 -17
  680. package/src/shopify/fragments/page-info.ts +0 -8
  681. package/src/shopify/fragments/page.ts +0 -12
  682. package/src/shopify/fragments/product.ts +0 -71
  683. package/src/shopify/fragments/seo.ts +0 -6
  684. package/src/shopify/fragments/variant.ts +0 -29
  685. package/src/shopify/gql/fragment-masking.ts +0 -85
  686. package/src/shopify/gql/gql.ts +0 -110
  687. package/src/shopify/gql/graphql.ts +0 -11780
  688. package/src/shopify/gql/index.ts +0 -4
  689. package/src/shopify/hooks/index.ts +0 -2
  690. package/src/shopify/hooks/useCreateCart.ts +0 -24
  691. package/src/shopify/hooks/useProductsByHandles.ts +0 -25
  692. package/src/shopify/mutations/create-cart.ts +0 -16
  693. package/src/shopify/package.json +0 -84
  694. package/src/shopify/queries/get-product-by-handles.ts +0 -32
  695. package/src/shopify/queries/index.ts +0 -2
  696. package/src/shopify/src/index.ts +0 -5
  697. package/src/shopify/tsconfig.json +0 -25
  698. package/src/shopify/tsup.config.ts +0 -21
  699. package/src/shopify/types/article.ts +0 -46
  700. package/src/shopify/types/cart.ts +0 -202
  701. package/src/shopify/types/checkout.ts +0 -44
  702. package/src/shopify/types/collection.ts +0 -104
  703. package/src/shopify/types/common.ts +0 -53
  704. package/src/shopify/types/config.ts +0 -14
  705. package/src/shopify/types/customer.ts +0 -31
  706. package/src/shopify/types/fetcher.ts +0 -61
  707. package/src/shopify/types/index.ts +0 -10
  708. package/src/shopify/types/page.ts +0 -45
  709. package/src/shopify/types/product.ts +0 -176
  710. package/src/shopify/types/search.ts +0 -62
  711. package/src/shopify/types/site.ts +0 -38
  712. package/src/shopify/types/type-helper.ts +0 -5
  713. package/src/shopify/utils/colors.ts +0 -206
  714. package/src/shopify/utils/const.ts +0 -115
  715. package/src/shopify/utils/cookie.ts +0 -39
  716. package/src/shopify/utils/errors.ts +0 -65
  717. package/src/shopify/utils/fetch-graphql-api.ts +0 -67
  718. package/src/shopify/utils/handle-fetch-response.ts +0 -60
  719. package/src/shopify/utils/helper.ts +0 -89
  720. package/src/shopify/utils/normalize/cart.ts +0 -106
  721. package/src/shopify/utils/normalize/customer.ts +0 -18
  722. package/src/shopify/utils/normalize/index.ts +0 -2
  723. package/src/shopify/utils/normalize/metafield.ts +0 -69
  724. package/src/shopify/utils/normalize/product.ts +0 -193
  725. package/src/shopify/utils/store.ts +0 -5
  726. package/src/shopify/utils/type-helper.ts +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
4
- "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useShopifyContext } from '@shopify/context/ShopifyProvider'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useShopifyContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAgBM,IAAAI,EAAA,6BAhBNC,EAAwB,iCACxBC,EAA4B,+BAG5BC,EAAkC,4CAO3B,MAAML,EAAc,CAAC,CAAE,KAAAM,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,qBAAkB,EAErC,SACE,QAAC,OAAI,UAAU,0EACb,oBAAC,WACC,UAAU,6HACV,OAAQF,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,QAAC,OAAI,UAAU,sBACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,UAAU,iIACV,OAAQA,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,OAAC,OAAI,UAAU,2DAA2D,MAAOA,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,KAEA,QAAC,OAAI,UAAU,yBACb,oBAAC,OAAI,UAAU,yDAAyD,MAAOA,EAAK,QAAQ,MACzF,SAAAA,EAAK,QAAQ,MAChB,KACA,QAAC,OAAI,UAAU,+CACb,qBAAC,OAAI,UAAU,qEACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,aAAa,MAAE,KAC/C,OAAC,QAAK,UAAU,OAAQ,SAAAD,EAAK,QAAQ,OAAS,GAAG,GACnD,KACA,QAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,iBAAiB,MAAE,KACnD,OAAC,QAAK,UAAU,OACb,2BAAY,CACX,OAAQ,EACR,aAAcD,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,KACA,QAAC,OAAI,UAAU,mDACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAD,EAAK,YAAY,QAAQ,cAAc,MAAE,KAChD,OAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,KACA,QAAC,OAAI,UAAU,0CACb,qBAAC,QAAM,UAAAA,EAAK,YAAY,QAAQ,gBAAgB,MAAE,KAClD,QAAC,QAAK,UAAU,OACb,UAAAD,EAAK,MAAM,eAAe,IAAEC,GAAM,WACrC,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
6
- "names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_ShopifyProvider", "item", "copy", "locale"]
7
- }
@@ -1,13 +0,0 @@
1
- import type { RedeemableItem as RedeemableItemType } from '../../type';
2
- import { CreditsRedeemListCopy } from '../type';
3
- type SuccessProps = {
4
- copy: CreditsRedeemListCopy;
5
- shippingProduct: string;
6
- loading: boolean;
7
- address: Record<string, any> | undefined;
8
- disabled: boolean;
9
- onClose: () => void;
10
- item: RedeemableItemType;
11
- };
12
- export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";var f=Object.create;var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var m in t)a(e,m,{get:t[m],enumerable:!0})},l=(e,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of y(t))!g.call(e,d)&&d!==m&&a(e,d,{get:()=>t[d],enumerable:!(p=b(t,d))||p.enumerable});return e};var w=(e,t,m)=>(m=e!=null?f(v(e)):{},l(t||!e||!e.__esModule?a(m,"default",{value:e,enumerable:!0}):m,e)),C=e=>l(a({},"__esModule",{value:!0}),e);var T={};N(T,{Success:()=>R});module.exports=C(T);var o=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=w(require("classnames")),i=require("./ProductInfo");const R=({copy:e,shippingProduct:t,loading:m,address:p,disabled:d,onClose:x,item:n})=>(0,o.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((c,u)=>(0,o.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:c},u))}),t&&(0,o.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,o.jsx)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:(0,o.jsx)(i.ProductInfo,{item:n,copy:e})}),(0,o.jsx)(s.Button,{loading:m||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:x,disabled:d,children:e.redeemModal.product.paymentButton})]})});
2
- //# sourceMappingURL=Success.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
4
- "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAnBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAYrB,MAAML,EAAU,CAAC,CAAE,KAAAM,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,OAEvF,OAAC,OAAI,aAAW,EAAAC,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAP,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACQ,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,UAAU,gEACb,mBAAC,eAAY,KAAMK,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
6
- "names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "classNames", "description", "index"]
7
- }
@@ -1,11 +0,0 @@
1
- import { AlpcErrorCode } from '../../context/const';
2
- import type { ModalContainerProps } from '../../modal/modalContainer';
3
- import type { RedeemableItem as RedeemableItemType } from '../../type';
4
- import { CreditsRedeemListCopy } from '../type';
5
- type RedeemProductModalProps = ModalContainerProps & {
6
- item: RedeemableItemType;
7
- copy: CreditsRedeemListCopy;
8
- onError: (code: AlpcErrorCode) => void;
9
- };
10
- declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
11
- export default RedeemProductModal;
@@ -1,2 +0,0 @@
1
- "use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},N=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var S=(r,e,t)=>(t=r!=null?W(Z(r)):{},N(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>N(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var l=require("react/jsx-runtime"),v=S(require("classnames")),s=require("react"),y=require("../../context/provider"),L=S(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@shopify/context/ShopifyProvider"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:b}=(0,y.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useShopifyContext)(),{validatorInfo:B}=e,{shippingAddress:G,shippingProduct:P}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[n,J]=(0,s.useState)(),[V,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:R=[],isLoading:de}=(0,L.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:A}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(b?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(b?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:z}=(0,x.useAddressValidate)({address:n,validatorInfo:B,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),H=(0,s.useCallback)(async()=>{const o=[];if(h&&((R.find(Q=>Q.code===n.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;console.log("address",n);let d={...n};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),A({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,A,h,E,n,R]);return(0,s.useEffect)(()=>{a.isOpen||(u(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,l.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,l.jsx)(w.Error,{errorInfo:V}),m==="success"&&(0,l.jsx)(F.Success,{copy:e,shippingProduct:P,loading:M,address:n,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,l.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:J,validateAddress:E,validateErrors:z,shippingProduct:P,loading:M,address:n,disabled:C,handlePayment:H,item:r}),m==="init"&&(0,l.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:c})]})}var re=ee;
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx"],
4
- "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useShopifyContext } from '@shopify/context/ShopifyProvider'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useShopifyContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n console.log('address', address)\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAuJI,IAAAI,EAAA,6BAvJJC,EAAuB,yBACvBC,EAA0D,iBAC1DC,EAAkC,kCAClCC,EAAyB,+CACzBC,EAA8B,+BAC9BC,EAAmC,kDACnCC,EAAiC,gDAEjCC,EAAsC,sCAEtCC,EAAkC,4CAElCC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAwB,qBACxBC,EAAqB,kB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C,EAC5C,QAAS,OAAOjC,EAAK,MAAM,EAAE,CAC/B,CAAC,CACH,EAAG,CAACA,EAAMuB,EAASK,EAAeC,EAAiBhB,EAASM,CAAS,CAAC,EAEtE,sBAAU,IAAM,CACThB,EAAM,SACTe,EAAY,EAAK,EACjBF,EAAa,CAAE,KAAM,EAAG,QAAS,GAAI,SAAU,EAAG,CAAC,EAEvD,EAAG,CAACb,EAAM,OAAQI,CAAM,CAAC,KAGvB,QAAC,yBACE,GAAGJ,EACJ,aAAW,EAAA+B,SACT,sDACAvB,IAAW,QAAU,qBACvB,EACA,gBAAgB,+BAChB,kBAAgB,EAAAuB,SAAW,WAAYvB,IAAW,QAAU,cAAc,EAC1E,MAAOA,IAAW,UAAY,qBAAuB,GAEpD,UAAAA,IAAW,YAAW,OAAC,SAAM,UAAWI,EAAW,EACnDJ,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBS,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBe,EACjB,eAAgBC,EAChB,gBAAiBpB,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,cAAec,EACf,KAAM/B,EACR,EAEDW,IAAW,WACV,OAAC,QAAK,KAAMX,EAAM,KAAMC,EAAM,QAASqB,EAAS,SAAUL,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAO7B,GAAQgB",
6
- "names": ["RedeemProductModal_exports", "__export", "RedeemProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_modalContainer", "import_ShopifyProvider", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
7
- }
@@ -1,9 +0,0 @@
1
- import type { RedeemableItem as RedeemableItemType } from '../type';
2
- import type { CreditsRedeemListCopy } from './type';
3
- export declare function RedeemableItem({ copy, className, item, onRulesOpen, onRedeem, }: {
4
- copy: CreditsRedeemListCopy;
5
- className?: string;
6
- item: RedeemableItemType;
7
- onRulesOpen: (rules: string[]) => void;
8
- onRedeem: (item: RedeemableItemType) => void;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- "use strict";var N=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var I=(t,a)=>{for(var e in a)m(t,e,{get:a[e],enumerable:!0})},b=(t,a,e,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of R(a))!w.call(t,n)&&n!==e&&m(t,n,{get:()=>a[n],enumerable:!(p=C(a,n))||p.enumerable});return t};var k=(t,a,e)=>(e=t!=null?N(T(t)):{},b(a||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),L=t=>b(m({},"__esModule",{value:!0}),t);var E={};I(E,{RedeemableItem:()=>S});module.exports=L(E);var l=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),c=require("react"),x=k(require("classnames")),h=require("../context/provider"),o=require("../context/const"),_=require("../context/utils"),u=require("../../../helpers/track");function S({copy:t,className:a,item:e,onRulesOpen:p,onRedeem:n}){const{creditInfo:f,profile:r,gtm:{pageGroup:v}}=(0,h.useCreditsContext)(),s=Object.keys(r||{}).length>0,y=(0,c.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||s&&r?.activated&&e.alpc?.consumeCredits>Number(f?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,s,r?.activated,f?.available_credit,e.variant?.availableForSale]),g=(0,c.useMemo)(()=>s?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:t?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[s,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return(0,l.jsxs)("div",{className:(0,x.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",a),children:[e.config?.type!==o.ConsumeType.Product?(0,l.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,l.jsx)(i.Picture,{source:t?.imageMapping[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,l.jsx)("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]",children:e.config?.value?(0,l.jsxs)("div",{className:"flex items-end",children:[(0,l.jsx)(i.Text,{className:"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:e.config?.value}),(0,l.jsx)(i.Text,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:e.config?.type===o.ConsumeType.GiftCard?t?.giftCardLabel:t?.off})]}):(0,l.jsx)(i.Text,{size:3,html:e.config?.title||e.alpc?.title})})]}):(0,l.jsx)("div",{className:(0,x.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,l.jsx)(i.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}),(0,l.jsxs)("div",{className:(0,x.default)("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[(0,l.jsx)(i.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,l.jsx)("button",{type:"button",onClick:()=>{p(e.config?.rules||[]),(0,u.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:t?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&d.preventDefault()},children:t?.ruleLabel}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,l.jsx)(i.Picture,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,l.jsx)(i.Text,{html:`${(0,_.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),(0,l.jsx)(i.Button,{disabled:y,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{n(e),(0,u.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:g,info:e.alpc?.id?.toString()}})},children:g})]})]})]})}
2
- //# sourceMappingURL=RedeemableItem.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
4
- "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : copy?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n copy?.soldOut,\n ])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n {item.config?.type !== ConsumeType.Product ? (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={copy?.imageMapping[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white md:bottom-[2px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-bold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? copy?.giftCardLabel : copy?.off}\n />\n </div>\n ) : (\n <Text size={3} html={item.config?.title || item.alpc?.title} />\n )}\n </div>\n </div>\n ) : (\n <div className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product.images?.[0]?.url}\n ></Picture>\n </div>\n )}\n <div className={classNames('mt-[22px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"text-[24px] font-bold leading-[1.2] l:text-[16px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[24px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[20px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAsFU,IAAAI,EAAA,6BAtFVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA6B,4BAE7BC,EAAwB,kCAEjB,SAAST,EAAe,CAC7B,KAAAU,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,KAAI,qBAAkB,EAChBC,EAAU,OAAO,KAAKF,GAAW,CAAC,CAAC,EAAE,OAAS,EAE9CG,KAAa,WAAQ,IACrB,GAAAP,EAAK,MAA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OAAI,aAAW,EAAAS,SAAW,uDAAuD,EAChF,oBAAC,QACC,KAAMT,EAAK,QAAQ,OAASA,EAAK,MAAM,MACvC,MAAOA,EAAK,QAAQ,OAASA,EAAK,MAAM,MACxC,KAAM,EACN,UAAU,sEACZ,EACCA,EAAK,QAAQ,OAAO,OAAS,MAC5B,OAAC,UACC,KAAK,SACL,QAAS,IAAM,CACbC,EAAYD,EAAK,QAAQ,OAAS,CAAC,CAAC,KACpC,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaA,GAAM,UACnB,KAAME,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EACA,UAAU,uEACV,SAAU,EACV,UAAWU,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAZ,GAAM,UACT,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,cACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaE,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,kGACZ,GACF,KAEA,OAAC,UACC,SAAUO,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbL,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaU,EACb,KAAMR,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAQ,EACH,GACF,GACF,GACF,CAEJ",
6
- "names": ["RedeemableItem_exports", "__export", "RedeemableItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_classnames", "import_provider", "import_const", "import_utils", "import_track", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "isLogin", "isDisabled", "redeemButtonText", "classNames", "e"]
7
- }
@@ -1,13 +0,0 @@
1
- import { CreditsRedeemListCopy } from './type';
2
- export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
3
- copy: CreditsRedeemListCopy;
4
- className?: string;
5
- tabClassName?: string;
6
- hideTitle?: boolean;
7
- cardClassName?: string;
8
- activate: {
9
- openAuthCodePopup: () => void;
10
- isSuccess: boolean;
11
- setOnSuccess: (callback: Function) => void;
12
- };
13
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- "use strict";var J=Object.create;var C=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var a in t)C(e,a,{get:t[a],enumerable:!0})},S=(e,t,a,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Q(t))!X.call(e,d)&&d!==a&&C(e,d,{get:()=>t[d],enumerable:!(f=K(t,d))||f.enumerable});return e};var g=(e,t,a)=>(a=e!=null?J(W(e)):{},S(t||!e||!e.__esModule?C(a,"default",{value:e,enumerable:!0}):a,e)),Z=e=>S(C({},"__esModule",{value:!0}),e);var ee={};Y(ee,{CreditsRedeemList:()=>$});module.exports=Z(ee);var n=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),R=g(require("classnames")),l=require("react"),E=g(require("./RedeemCouponModal")),O=g(require("./RedeemProductModal")),A=require("../context/provider"),M=g(require("../context/hooks/useRedeemableList")),u=require("../context/const"),F=require("@shopify/hooks/useProductsByHandles"),D=require("./RedeemableItem"),z=g(require("../modal/rulesModal")),H=require("../../../helpers/track");function $({copy:e,className:t="",tabClassName:a="",hideTitle:f=!1,cardClassName:d,activate:v}){const{profile:L,openSignUpPopup:j,gtm:{pageGroup:w}}=(0,A.useCreditsContext)(),B=Object.keys(L||{}).length>0,[T,G]=(0,l.useState)(e.list[0].label),[i,b]=(0,l.useState)(void 0),[h,N]=(0,l.useState)(),{listLoading:U,redeemableList:k,getRedeemableList:x}=(0,M.default)(),p=(0,l.useMemo)(()=>k.map(s=>({id:s.id.toString(),title:s.name,consumeCredits:s.consume_credits,remainingInventory:s.remaining_inventory,isLimited:!!s.is_limited,consumeType:s.consume_type,handle:s.sku_handle,sku:s.goods_sku,image:s.goods_url})),[e.list,T,k]),V=p.map(s=>s.handle),{data:_}=(0,F.useProductsByHandles)({handles:V}),q=(0,l.useMemo)(()=>e.list.find(o=>o.label===T)?.list.filter(o=>p.some(c=>c.id===o.id)).map(o=>{const c=p.find(m=>m.id===o.id),y=_?.find(m=>m.handle===c?.handle),P=y?.variants.find(m=>m.sku===c?.sku);return c?.consumeType===u.AlpcConsumeType.Product&&(!y||!P)?null:{alpc:p.find(m=>m.id===o.id),config:o,product:y,variant:P}}).filter(o=>o!==null),[p,_]),I=(0,l.useCallback)(s=>{s===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough&&x()},[x]);return console.log("popRedeemData",i),(0,n.jsxs)(r.Container,{className:(0,R.default)("relative bg-[#F5F5F7]",t),children:[!f&&(0,n.jsx)(r.Heading,{as:"h2",size:"4",html:e.title}),(0,n.jsx)(r.Tabs,{shape:"rounded",align:"left",className:(0,R.default)("sticky top-0 z-20 py-[24px] md:justify-center",a),value:T.toString(),onValueChange:s=>{G(s),(0,H.gaTrack)({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:s,page_group:w}})},children:(0,n.jsx)(r.TabsList,{children:e.list.map(s=>(0,n.jsx)(r.TabsTrigger,{value:s.label,children:s.label},s.label))})}),!!p?.length&&!U&&(0,n.jsx)("div",{className:(0,R.default)("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:q?.map(s=>(0,n.jsx)(D.RedeemableItem,{copy:e,item:s,onRedeem:o=>{B?!L?.activated&&!v.isSuccess?(v.openAuthCodePopup(),v.setOnSuccess(()=>{b(o)})):b(o):j()},onRulesOpen:N,className:d},s?.alpc?.id))}),i?.alpc?.consumeType===u.AlpcConsumeType.Coupon&&e?.redeemModal?.coupon&&i&&(0,n.jsx)(E.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),i?.alpc?.consumeType===u.AlpcConsumeType.Product&&e?.redeemModal&&i&&(0,n.jsx)(O.default,{isOpen:!!i,item:i,copy:e,onError:I,onClose:()=>{b(void 0)}}),h&&(0,n.jsx)(z.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:h.length>0,onClose:()=>N([]),titleClassName:"border-b-transparent h-[56px]",rules:h,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:e?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsRedeemList/index.tsx"],
4
- "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@shopify/hooks/useProductsByHandles'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n setOnSuccess: (callback: Function) => void\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n console.log('popRedeemData', popRedeemData)\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n activate.setOnSuccess(() => {\n setPopRedeemData(item)\n })\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\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_headless_ui", "import_classnames", "import_react", "import_RedeemCouponModal", "import_RedeemProductModal", "import_provider", "import_useRedeemableList", "import_const", "import_useProductsByHandles", "import_RedeemableItem", "import_rulesModal", "import_track", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "useRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "classNames", "value", "RedeemCouponModal", "RedeemProductModal", "RulesModal"]
7
- }
@@ -1,77 +0,0 @@
1
- import { CreditsPageCommon } from '../type';
2
- export type CreditsRedeemListCopy = {
3
- title: string;
4
- giftCardLabel: string;
5
- unlockRewards: string;
6
- btnRedeem: string;
7
- list: {
8
- label: string;
9
- list: {
10
- id: string;
11
- type: string;
12
- value: string;
13
- rules: string[];
14
- }[];
15
- }[];
16
- validatorInfo: {
17
- addressInfo: {
18
- name: string;
19
- country: string;
20
- province: string;
21
- city: string;
22
- address: string;
23
- };
24
- };
25
- redeemModal: {
26
- confirmTitle: string;
27
- confirmButton: string;
28
- commonError: string;
29
- redeemLimitError: string;
30
- inventoryNotEnough: string;
31
- creditsNotEnough: string;
32
- crossSiteError: string;
33
- errorImageUrl: string;
34
- coupon: {
35
- successDesc: string;
36
- successTitle: string;
37
- successButton: string;
38
- successButtonUrl: string;
39
- };
40
- product: {
41
- required: string;
42
- invalidEmail: string;
43
- shippingAddress: string;
44
- shippingProduct: string;
45
- addressForm: {
46
- key: string;
47
- type: string;
48
- label: string;
49
- isSelect: boolean;
50
- required: boolean;
51
- placeholder: string;
52
- }[][];
53
- form: {
54
- key: string;
55
- type: string;
56
- isSelect: boolean;
57
- required: boolean;
58
- placeholder: string;
59
- }[][];
60
- successDesc: string[];
61
- rules: string[];
62
- steps: {
63
- imageUrl: string;
64
- title: string;
65
- }[];
66
- quantityLabel: string;
67
- totalPriceLabel: string;
68
- variantLabel: string;
69
- shippingFeeLabel: string;
70
- paymentButton: string;
71
- stepTitle: string;
72
- };
73
- };
74
- copied: string;
75
- off: string;
76
- copy: string;
77
- } & CreditsPageCommon;
@@ -1,2 +0,0 @@
1
- "use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of o(r))!l.call(t,s)&&s!==n&&e(t,s,{get:()=>r[s],enumerable:!(i=g(r,s))||i.enumerable});return t};var c=t=>a(e({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
2
- //# sourceMappingURL=type.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsRedeemList/type.ts"],
4
- "sourcesContent": ["import { CreditsPageCommon } from '../type'\n\nexport type CreditsRedeemListCopy = {\n title: string\n giftCardLabel: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n validatorInfo: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n copied: string\n off: string\n copy: string\n} & CreditsPageCommon\n"],
5
- "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
- "names": ["type_exports", "__toCommonJS"]
7
- }
@@ -1,2 +0,0 @@
1
- import { type CreditsWaysToGetCreditsProps } from './type';
2
- export declare const CreditsWaysToGetCredits: ({ copy, activate, subscribe, uploadReceipt, classNames, }: CreditsWaysToGetCreditsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- "use strict";var v=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var B=(i,l)=>{for(var o in l)v(i,o,{get:l[o],enumerable:!0})},G=(i,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of S(l))!A.call(i,n)&&n!==o&&v(i,n,{get:()=>l[n],enumerable:!(a=D(l,n))||a.enumerable});return i};var M=i=>G(v({},"__esModule",{value:!0}),i);var U={};B(U,{CreditsWaysToGetCredits:()=>P});module.exports=M(U);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),u=require("@heroicons/react/24/outline"),F=require("framer-motion"),f=require("react"),m=require("./type"),y=require("./useActions"),z=require("../context/provider"),k=require("../../../helpers/index");const P=({copy:i,activate:l,subscribe:o,uploadReceipt:a,classNames:n})=>{const[r,C]=(0,f.useState)(!1),{profile:I}=(0,z.useCreditsContext)(),h=!!I,{actions:b}=(0,y.useActions)({copy:i,activate:l,subscribe:o,uploadReceipt:a}),L=(0,f.useMemo)(()=>{const t=i.list.map(d=>{if(!b[d.id])return;const{finished:p,notLogin:N,notFinished:g,completed:T}=b[d.id];let c="",x,w;return h?p?(c=T.buttonLabel,x=void 0):(c=g.buttonLabel,x=g.handleClick,w=g.link):(c=N.buttonLabel,x=N.handleClick),{...d,buttonLabel:c,handleClick:x,finished:p,link:w}}).filter(Boolean);return h?t.sort((d,p)=>d?.finished&&!p?.finished?1:!d?.finished&&p?.finished?-1:0):t},[b,i.list,h]);return(0,e.jsx)(s.Container,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:(0,e.jsxs)("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[(0,e.jsx)(s.Heading,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(s.Heading,{size:3,as:"h3",html:i.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&(0,e.jsx)(s.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),(0,e.jsx)(s.Heading,{html:i.equalCredits,size:4,as:"h3",className:(0,k.cn)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(s.Picture,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(F.motion.div,{className:(0,k.cn)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:r?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!r&&window.screen.width<768){const t=document.getElementById("ways-to-get-credits");t&&t.scrollIntoView({behavior:"smooth",block:"end"})}},children:[L.map(t=>(0,e.jsxs)("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Heading,{as:"h4",html:t.title,size:2,className:"text-pretty"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(s.Picture,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),(0,e.jsx)(s.Text,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),t.handleClick&&!(t.id===m.TaskType.UploadReceipt&&a.isSuccess)&&!(t.id===m.TaskType.Activate&&l.isSuccess)&&!(t.id===m.TaskType.Subscribe&&o.isSuccess)?(0,e.jsx)(s.Button,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",loading:t.id===m.TaskType.Activate&&l.isSendingActivateEmail,size:"lg",className:"mt-[24px] w-fit",children:t.buttonLabel}):(0,e.jsx)(s.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:t.buttonLabel})]},t.id)),!r&&(0,e.jsx)("div",{className:"absolute inset-0 min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),r?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{C(!1)},children:(0,e.jsx)(u.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>C(!r),children:(0,e.jsx)(u.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.tsx"],
4
- "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n loading={item.id === TaskType.Activate && activate.isSendingActivateEmail}\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAiFQ,IAAAI,EAAA,6BAjFRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAuB,yBACvBC,EAAkC,iBAElCC,EAA4D,kBAC5DC,EAA2B,wBAC3BC,EAAkC,+BAClCC,EAAmB,kCAEZ,MAAMV,EAA0B,CAAC,CACtC,KAAAW,EACA,SAAAC,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,CACF,IAAoC,CAClC,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxC,CAAE,QAAAC,CAAQ,KAAI,qBAAkB,EAChCC,EAAU,CAAC,CAACD,EAEZ,CAAE,QAAAE,CAAQ,KAAI,cAAW,CAAE,KAAAT,EAAM,SAAAC,EAAU,UAAAC,EAAW,cAAAC,CAAc,CAAC,EAErEO,KAAO,WAAQ,IAAM,CACzB,MAAMA,EAAOV,EAAK,KACf,IAAIW,GAAQ,CACX,GAAI,CAACF,EAAQE,EAAK,EAA0B,EAC1C,OAEF,KAAM,CAAE,SAAAC,EAAU,SAAAC,EAAU,YAAAC,EAAa,UAAAC,CAAU,EAAIN,EAAQE,EAAK,EAA0B,EAC9F,IAAIK,EAAc,GACdC,EACAC,EACJ,OAAKV,EAGMI,GACTI,EAAcD,EAAU,YACxBE,EAAc,SAEdD,EAAcF,EAAY,YAC1BG,EAAcH,EAAY,YAC1BI,EAAQJ,EAAiC,OARzCE,EAAcH,EAAS,YACvBI,EAAcJ,EAAS,aASlB,CACL,GAAGF,EACH,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"import_headless_ui", "import_outline", "import_framer_motion", "import_react", "import_type", "import_useActions", "import_provider", "import_helpers", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "section"]
7
- }
@@ -1,60 +0,0 @@
1
- import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
2
- export type BenefitItem = {
3
- title: string;
4
- credits: string;
5
- id: string;
6
- };
7
- export type WaysToGetCreditsCopy = {
8
- title: string;
9
- subtitle: string;
10
- equalCredits: string;
11
- musicIcon: string;
12
- list: BenefitItem[];
13
- mainImage: {
14
- url: string;
15
- alt: string;
16
- };
17
- joinNow: string;
18
- activate: string;
19
- completed: string;
20
- completeProfile: string;
21
- makeFirstPurchase: string;
22
- goShopLink: string;
23
- uploadReceipt: string;
24
- shopNow: string;
25
- subscribe: string;
26
- sendEmailSuccess: string;
27
- creditsIcon: {
28
- url: string;
29
- alt: string;
30
- };
31
- receipt: ReceiptCopy;
32
- };
33
- export declare enum TaskType {
34
- Activate = "activate",
35
- Subscribe = "subscribe",
36
- CompleteProfile = "completeProfile",
37
- FirstPurchase = "firstPurchase",
38
- UploadReceipt = "uploadReceipt",
39
- Shop = "shop"
40
- }
41
- export type CreditsWaysToGetCreditsProps = {
42
- copy: WaysToGetCreditsCopy;
43
- classNames?: {
44
- equalCreditsText?: string;
45
- subtitle?: string;
46
- };
47
- activate: {
48
- openAuthCodePopup: () => void;
49
- isSuccess: boolean;
50
- isSendingActivateEmail: boolean;
51
- };
52
- subscribe: {
53
- openSubscribePopup: () => void;
54
- isSuccess: boolean;
55
- };
56
- uploadReceipt: {
57
- openUploadReceiptPopup: () => void;
58
- isSuccess: boolean;
59
- };
60
- };
@@ -1,2 +0,0 @@
1
- "use strict";var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:!0})},g=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!a.call(t,s)&&s!==o&&r(t,s,{get:()=>e[s],enumerable:!(c=p(e,s))||c.enumerable});return t};var d=t=>g(r({},"__esModule",{value:!0}),t);var m={};u(m,{TaskType:()=>n});module.exports=d(m);var n=(i=>(i.Activate="activate",i.Subscribe="subscribe",i.CompleteProfile="completeProfile",i.FirstPurchase="firstPurchase",i.UploadReceipt="uploadReceipt",i.Shop="shop",i))(n||{});
2
- //# sourceMappingURL=type.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
4
- "sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n isSendingActivateEmail: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAmCO,IAAKE,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
6
- "names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
7
- }
@@ -1,96 +0,0 @@
1
- import type { CreditsWaysToGetCreditsProps } from './type';
2
- export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
3
- gaParameters?: {
4
- position: string;
5
- };
6
- }) => {
7
- actions: {
8
- activate: {
9
- finished: any;
10
- notLogin: {
11
- buttonLabel: string;
12
- handleClick: () => void;
13
- };
14
- notFinished: {
15
- buttonLabel: string;
16
- handleClick: () => void;
17
- };
18
- completed: {
19
- buttonLabel: string;
20
- };
21
- };
22
- subscribe: {
23
- finished: boolean;
24
- notLogin: {
25
- buttonLabel: string;
26
- handleClick: () => void;
27
- };
28
- notFinished: {
29
- buttonLabel: string;
30
- handleClick: () => void;
31
- };
32
- completed: {
33
- buttonLabel: string;
34
- };
35
- };
36
- completeProfile: {
37
- finished: any;
38
- notLogin: {
39
- buttonLabel: string;
40
- handleClick: () => void;
41
- };
42
- notFinished: {
43
- buttonLabel: string;
44
- link: string;
45
- handleClick: () => void;
46
- };
47
- completed: {
48
- buttonLabel: string;
49
- };
50
- };
51
- firstPurchase: {
52
- finished: boolean;
53
- notLogin: {
54
- buttonLabel: string;
55
- handleClick: () => void;
56
- };
57
- notFinished: {
58
- buttonLabel: string;
59
- link: string;
60
- handleClick: () => void;
61
- };
62
- completed: {
63
- buttonLabel: string;
64
- };
65
- };
66
- uploadReceipt: {
67
- finished: boolean;
68
- notLogin: {
69
- buttonLabel: string;
70
- handleClick: () => void;
71
- };
72
- notFinished: {
73
- buttonLabel: string;
74
- handleClick: () => void;
75
- };
76
- completed: {
77
- buttonLabel: string;
78
- };
79
- };
80
- shop: {
81
- finished: boolean;
82
- notLogin: {
83
- buttonLabel: string;
84
- handleClick: () => void;
85
- };
86
- notFinished: {
87
- buttonLabel: string;
88
- link: string;
89
- handleClick: () => void;
90
- };
91
- completed: {
92
- buttonLabel: string;
93
- };
94
- };
95
- };
96
- };
@@ -1,2 +0,0 @@
1
- "use strict";var j=Object.create;var r=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(e,i)=>{for(var a in i)r(e,a,{get:i[a],enumerable:!0})},h=(e,i,a,b)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of R(i))!U.call(e,n)&&n!==a&&r(e,n,{get:()=>i[n],enumerable:!(b=_(i,n))||b.enumerable});return e};var x=(e,i,a)=>(a=e!=null?j(T(e)):{},h(i||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),G=e=>h(r({},"__esModule",{value:!0}),e);var E={};A(E,{useActions:()=>W});module.exports=G(E);var t=require("./type"),k=require("../context/provider"),d=require("react"),f=x(require("../context/hooks/useReceiptUploaded")),N=require("../context/hooks/useFirstPurchaseFinished"),L=require("../context/hooks/useSubscribed"),C=require("@shopify/context/ShopifyProvider"),P=require("../../../helpers/track");const W=({copy:e,subscribe:i,uploadReceipt:a,activate:b,gaParameters:n})=>{const{openSignUpPopup:s,gtm:g,profile:l}=(0,k.useCreditsContext)(),u=(0,L.useSubscribed)(),c=(0,N.useFirstPurchaseFinished)(),m=(0,f.default)(),{appName:v}=(0,C.useShopifyContext)(),p=(0,d.useMemo)(()=>(l?.first_name||l?.last_name)&&l?.phone_number&&l?.dob,[l]);return(0,d.useMemo)(()=>{const o=({buttonName:F,id:w,callback:S})=>{(0,P.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:g.pageGroup,position:n?.position||e.title,button_name:F,info:w}}),S()};return{actions:{[t.TaskType.Activate]:{finished:l?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>o({buttonName:e?.activate,callback:()=>b.openAuthCodePopup(),id:t.TaskType.Activate})},completed:{buttonLabel:e?.completed}},[t.TaskType.Subscribe]:{finished:u,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>o({buttonName:e?.subscribe,callback:()=>i.openSubscribePopup(),id:t.TaskType.Subscribe})},completed:{buttonLabel:e?.completed}},[t.TaskType.CompleteProfile]:{finished:p,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`/account/profile?app=${v}`,handleClick:()=>o({buttonName:e?.completeProfile,callback:()=>{},id:t.TaskType.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.TaskType.FirstPurchase]:{finished:c,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:s,id:t.TaskType.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.TaskType.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.TaskType.UploadReceipt]:{finished:m,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>o({buttonName:e?.uploadReceipt,callback:()=>a.openUploadReceiptPopup(),id:t.TaskType.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.TaskType.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.shopNow,callback:()=>{},id:t.TaskType.Shop})},completed:{buttonLabel:e?.completed}}}}},[l?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,u,p,c,m,n?.position,s])};
2
- //# sourceMappingURL=useActions.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
4
- "sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useShopifyContext } from '@shopify/context/ShopifyProvider'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName } = useShopifyContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,kBACzBC,EAAkC,+BAClCC,EAAwB,iBACxBC,EAA+B,kDAC/BC,EAAyC,qDACzCC,EAA8B,0CAE9BC,EAAkC,4CAClCC,EAAwB,kCAEjB,MAAMT,EAAa,CAAC,CACzB,KAAAU,EACA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U,GACV,SAAU,CACR,YAAaA,GAAM,QACnB,YAAa,IACXc,EAAqB,CACnB,WAAYd,GAAM,QAClB,SAAUK,EACV,GAAI,WAAS,IACf,CAAC,CACL,EACA,YAAa,CACX,YAAaL,GAAM,QACnB,KAAMA,GAAM,WACZ,YAAa,IACXc,EAAqB,CACnB,WAAYd,GAAM,QAClB,SAAU,IAAM,CAAC,EACjB,GAAI,WAAS,IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaA,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDO,GAAS,UACTP,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAK,EACAJ,EACAC,EACAN,GAAc,SACdC,CACF,CAAC,CACH",
6
- "names": ["useActions_exports", "__export", "useActions", "__toCommonJS", "import_type", "import_provider", "import_react", "import_useReceiptUploaded", "import_useFirstPurchaseFinished", "import_useSubscribed", "import_ShopifyProvider", "import_track", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "useReceiptUploaded", "appName", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
7
- }