@anker-in/campaign-ui 0.2.10-beta.21 → 0.2.10-beta.23

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 (396) hide show
  1. package/dist/cjs/components/chat/action.js +2 -0
  2. package/dist/cjs/components/chat/action.js.map +7 -0
  3. package/dist/cjs/components/chat/button.js +2 -0
  4. package/dist/cjs/components/chat/button.js.map +7 -0
  5. package/dist/cjs/components/chat/chatContext.js +2 -0
  6. package/dist/cjs/components/chat/chatContext.js.map +7 -0
  7. package/dist/cjs/components/chat/index.js +2 -0
  8. package/dist/cjs/components/chat/index.js.map +7 -0
  9. package/dist/cjs/components/chat/markdown.js +2 -0
  10. package/dist/cjs/components/chat/markdown.js.map +7 -0
  11. package/dist/cjs/components/chat/messages.js +2 -0
  12. package/dist/cjs/components/chat/messages.js.map +7 -0
  13. package/dist/cjs/components/chat/props.js +2 -0
  14. package/dist/cjs/components/chat/props.js.map +7 -0
  15. package/dist/cjs/components/chat/response.js +2 -0
  16. package/dist/cjs/components/chat/response.js.map +7 -0
  17. package/dist/cjs/components/chat/suggestions.js +2 -0
  18. package/dist/cjs/components/chat/suggestions.js.map +7 -0
  19. package/dist/cjs/components/chat/utils.js +2 -0
  20. package/dist/cjs/components/chat/utils.js.map +7 -0
  21. package/dist/cjs/components/credits/context/const.js +2 -0
  22. package/dist/cjs/components/credits/context/const.js.map +7 -0
  23. package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
  24. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
  25. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
  26. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  27. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
  28. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  29. package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
  30. package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
  31. package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
  32. package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
  33. package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
  34. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
  35. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  36. package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  37. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
  38. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
  39. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  40. package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  41. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  42. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  43. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  44. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  45. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
  46. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  47. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
  48. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  49. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +2 -0
  50. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
  51. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
  52. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
  53. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +2 -0
  54. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +7 -0
  55. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
  56. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  57. package/dist/cjs/components/credits/context/provider.js +2 -0
  58. package/dist/cjs/components/credits/context/provider.js.map +7 -0
  59. package/dist/cjs/components/credits/context/response.js +2 -0
  60. package/dist/cjs/components/credits/context/response.js.map +7 -0
  61. package/dist/cjs/components/credits/context/utils.js +2 -0
  62. package/dist/cjs/components/credits/context/utils.js.map +7 -0
  63. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  64. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  65. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  66. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  67. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
  68. package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  69. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  70. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  71. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  72. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  73. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  74. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  75. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  76. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  77. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  78. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  80. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  81. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  82. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  83. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  84. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  85. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  86. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  87. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  88. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  89. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  90. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  91. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  92. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
  94. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  95. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  96. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  97. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  98. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  100. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  102. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  103. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  104. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  106. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  108. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  109. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  110. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  112. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  115. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  116. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  117. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  118. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  120. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  121. package/dist/cjs/components/credits/index.js +2 -0
  122. package/dist/cjs/components/credits/index.js.map +7 -0
  123. package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
  124. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
  125. package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
  126. package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
  127. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  128. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  129. package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
  130. package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
  131. package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
  132. package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
  133. package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
  134. package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
  135. package/dist/cjs/components/credits/modal/tip.js +2 -0
  136. package/dist/cjs/components/credits/modal/tip.js.map +7 -0
  137. package/dist/cjs/components/credits/type.js +2 -0
  138. package/dist/cjs/components/credits/type.js.map +7 -0
  139. package/dist/cjs/components/index.js +2 -0
  140. package/dist/cjs/components/index.js.map +7 -0
  141. package/dist/cjs/debug-env.js +2 -0
  142. package/dist/cjs/debug-env.js.map +7 -0
  143. package/dist/cjs/helpers/fetchResponse.js +2 -0
  144. package/dist/cjs/helpers/fetchResponse.js.map +7 -0
  145. package/dist/cjs/helpers/fetcher.js +2 -0
  146. package/dist/cjs/helpers/fetcher.js.map +7 -0
  147. package/dist/cjs/helpers/index.js +2 -0
  148. package/dist/cjs/helpers/index.js.map +7 -0
  149. package/dist/cjs/helpers/track.js +2 -0
  150. package/dist/cjs/helpers/track.js.map +7 -0
  151. package/dist/cjs/helpers/utils.js +2 -0
  152. package/dist/cjs/helpers/utils.js.map +7 -0
  153. package/dist/cjs/index.js +2 -0
  154. package/dist/cjs/index.js.map +7 -0
  155. package/dist/cjs/stories/chat.stories.js +2 -0
  156. package/dist/cjs/stories/chat.stories.js.map +7 -0
  157. package/dist/components/chat/action.d.ts +25 -0
  158. package/dist/components/chat/button.d.ts +3 -0
  159. package/dist/components/chat/chatContext.d.ts +101 -0
  160. package/dist/components/chat/index.d.ts +71 -0
  161. package/dist/components/chat/markdown.d.ts +5 -0
  162. package/dist/components/chat/messages.d.ts +3 -0
  163. package/dist/components/chat/props.d.ts +43 -0
  164. package/dist/components/chat/response.d.ts +4 -0
  165. package/dist/components/chat/suggestions.d.ts +3 -0
  166. package/dist/components/chat/utils.d.ts +3 -0
  167. package/dist/components/credits/context/const.d.ts +81 -0
  168. package/dist/components/credits/context/hooks/useActivities.d.ts +12 -0
  169. package/dist/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
  170. package/dist/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
  171. package/dist/components/credits/context/hooks/useClickOutside.d.ts +3 -0
  172. package/dist/components/credits/context/hooks/useCopy.d.ts +5 -0
  173. package/dist/components/credits/context/hooks/useCountries.d.ts +8 -0
  174. package/dist/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
  175. package/dist/components/credits/context/hooks/useMyRewards.d.ts +14 -0
  176. package/dist/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
  177. package/dist/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
  178. package/dist/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
  179. package/dist/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
  180. package/dist/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
  181. package/dist/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
  182. package/dist/components/credits/context/hooks/useSubscribed.d.ts +1 -0
  183. package/dist/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
  184. package/dist/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
  185. package/dist/components/credits/context/provider.d.ts +49 -0
  186. package/dist/components/credits/context/response.d.ts +63 -0
  187. package/dist/components/credits/context/utils.d.ts +25 -0
  188. package/dist/components/credits/creditsBanner/index.d.ts +23 -0
  189. package/dist/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
  190. package/dist/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
  191. package/dist/components/credits/creditsBenefits/index.d.ts +12 -0
  192. package/dist/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
  193. package/dist/components/credits/creditsCash/index.d.ts +13 -0
  194. package/dist/components/credits/creditsCash/type.d.ts +47 -0
  195. package/dist/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
  196. package/dist/components/credits/creditsFaq/index.d.ts +16 -0
  197. package/dist/components/credits/creditsInfoCard/index.d.ts +20 -0
  198. package/dist/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
  199. package/dist/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
  200. package/dist/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
  201. package/dist/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
  202. package/dist/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
  203. package/dist/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
  204. package/dist/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
  205. package/dist/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
  206. package/dist/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
  207. package/dist/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
  208. package/dist/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
  209. package/dist/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
  210. package/dist/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
  211. package/dist/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
  212. package/dist/components/credits/creditsRedeemList/index.d.ts +13 -0
  213. package/dist/components/credits/creditsRedeemList/type.d.ts +77 -0
  214. package/dist/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
  215. package/dist/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
  216. package/dist/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
  217. package/dist/components/credits/index.d.ts +10 -0
  218. package/dist/components/credits/modal/MyRewardsModal.d.ts +32 -0
  219. package/dist/components/credits/modal/activitiesModal.d.ts +32 -0
  220. package/dist/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
  221. package/dist/components/credits/modal/loadingDots.d.ts +6 -0
  222. package/dist/components/credits/modal/modalContainer.d.ts +15 -0
  223. package/dist/components/credits/modal/rulesModal.d.ts +7 -0
  224. package/dist/components/credits/modal/tip.d.ts +5 -0
  225. package/dist/components/credits/type.d.ts +55 -0
  226. package/dist/components/index.d.ts +3 -0
  227. package/dist/debug-env.d.ts +7 -0
  228. package/dist/esm/components/chat/action.js +2 -0
  229. package/dist/esm/components/chat/action.js.map +7 -0
  230. package/dist/esm/components/chat/button.js +2 -0
  231. package/dist/esm/components/chat/button.js.map +7 -0
  232. package/dist/esm/components/chat/chatContext.js +2 -0
  233. package/dist/esm/components/chat/chatContext.js.map +7 -0
  234. package/dist/esm/components/chat/index.js +2 -0
  235. package/dist/esm/components/chat/index.js.map +7 -0
  236. package/dist/esm/components/chat/markdown.js +2 -0
  237. package/dist/esm/components/chat/markdown.js.map +7 -0
  238. package/dist/esm/components/chat/messages.js +2 -0
  239. package/dist/esm/components/chat/messages.js.map +7 -0
  240. package/dist/esm/components/chat/props.js +1 -0
  241. package/dist/esm/components/chat/props.js.map +7 -0
  242. package/dist/esm/components/chat/response.js +2 -0
  243. package/dist/esm/components/chat/response.js.map +7 -0
  244. package/dist/esm/components/chat/suggestions.js +2 -0
  245. package/dist/esm/components/chat/suggestions.js.map +7 -0
  246. package/dist/esm/components/chat/utils.js +2 -0
  247. package/dist/esm/components/chat/utils.js.map +7 -0
  248. package/dist/esm/components/credits/context/const.js +2 -0
  249. package/dist/esm/components/credits/context/const.js.map +7 -0
  250. package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
  251. package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
  252. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
  253. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
  254. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
  255. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
  256. package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
  257. package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
  258. package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
  259. package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
  260. package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
  261. package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
  262. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
  263. package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
  264. package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
  265. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
  266. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
  267. package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
  268. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
  269. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
  270. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
  271. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
  272. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
  273. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
  274. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
  275. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
  276. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +2 -0
  277. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
  278. package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
  279. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
  280. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +2 -0
  281. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +7 -0
  282. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
  283. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
  284. package/dist/esm/components/credits/context/provider.js +2 -0
  285. package/dist/esm/components/credits/context/provider.js.map +7 -0
  286. package/dist/esm/components/credits/context/response.js +1 -0
  287. package/dist/esm/components/credits/context/response.js.map +7 -0
  288. package/dist/esm/components/credits/context/utils.js +2 -0
  289. package/dist/esm/components/credits/context/utils.js.map +7 -0
  290. package/dist/esm/components/credits/creditsBanner/index.js +2 -0
  291. package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
  292. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -0
  293. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  294. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
  295. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
  296. package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
  297. package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
  298. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
  299. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  300. package/dist/esm/components/credits/creditsCash/index.js +2 -0
  301. package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
  302. package/dist/esm/components/credits/creditsCash/type.js +1 -0
  303. package/dist/esm/components/credits/creditsCash/type.js.map +7 -0
  304. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  305. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  306. package/dist/esm/components/credits/creditsFaq/index.js +2 -0
  307. package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
  308. package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
  309. package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
  310. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  311. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  312. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
  313. package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
  314. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
  315. package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
  316. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  317. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  318. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  319. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  320. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
  321. package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
  322. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  323. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  324. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  325. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  326. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
  327. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
  328. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  329. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  330. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  331. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  332. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  333. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  334. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  335. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  336. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  337. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  338. package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
  339. package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
  340. package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
  341. package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
  342. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
  343. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  344. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
  345. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  346. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  347. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  348. package/dist/esm/components/credits/index.js +2 -0
  349. package/dist/esm/components/credits/index.js.map +7 -0
  350. package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
  351. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
  352. package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
  353. package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
  354. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
  355. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
  356. package/dist/esm/components/credits/modal/loadingDots.js +2 -0
  357. package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
  358. package/dist/esm/components/credits/modal/modalContainer.js +2 -0
  359. package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
  360. package/dist/esm/components/credits/modal/rulesModal.js +2 -0
  361. package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
  362. package/dist/esm/components/credits/modal/tip.js +2 -0
  363. package/dist/esm/components/credits/modal/tip.js.map +7 -0
  364. package/dist/esm/components/credits/type.js +1 -0
  365. package/dist/esm/components/credits/type.js.map +7 -0
  366. package/dist/esm/components/index.js +2 -0
  367. package/dist/esm/components/index.js.map +7 -0
  368. package/dist/esm/debug-env.js +2 -0
  369. package/dist/esm/debug-env.js.map +7 -0
  370. package/dist/esm/helpers/fetchResponse.js +2 -0
  371. package/dist/esm/helpers/fetchResponse.js.map +7 -0
  372. package/dist/esm/helpers/fetcher.js +2 -0
  373. package/dist/esm/helpers/fetcher.js.map +7 -0
  374. package/dist/esm/helpers/index.js +2 -0
  375. package/dist/esm/helpers/index.js.map +7 -0
  376. package/dist/esm/helpers/track.js +2 -0
  377. package/dist/esm/helpers/track.js.map +7 -0
  378. package/dist/esm/helpers/utils.js +2 -0
  379. package/dist/esm/helpers/utils.js.map +7 -0
  380. package/dist/esm/index.js +2 -0
  381. package/dist/esm/index.js.map +7 -0
  382. package/dist/esm/package.json +3 -0
  383. package/dist/esm/stories/chat.stories.js +2 -0
  384. package/dist/esm/stories/chat.stories.js.map +7 -0
  385. package/dist/helpers/fetchResponse.d.ts +14 -0
  386. package/dist/helpers/fetcher.d.ts +2 -0
  387. package/dist/helpers/index.d.ts +2 -0
  388. package/dist/helpers/track.d.ts +19 -0
  389. package/dist/helpers/utils.d.ts +3 -0
  390. package/dist/index.d.ts +1 -493
  391. package/dist/index.js +1245 -4292
  392. package/dist/index.mjs +1130 -4154
  393. package/dist/stories/chat.stories.d.ts +7 -0
  394. package/package.json +7 -2
  395. package/src/styles/global.css +15 -0
  396. package/style.css +1 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemAndBuy.ts"],
4
+ "sourcesContent": ["import useSWRMutation, { SWRMutationConfiguration } from 'swr/mutation'\nimport { useRedeemCoupon } from './useRedeemCoupon'\nimport type { ProductVariant } from '@anker-in/lib'\nimport { useCreditsContext } from '../provider'\nimport { useBuyNow } from '@anker-in/lib'\n\nexport const useRedeemAndBuy = (\n _: any,\n swrOptions?: SWRMutationConfiguration<undefined, Error, string, any> & {\n throwOnError?: boolean\n }\n) => {\n const { trigger } = useRedeemCoupon()\n const { profile } = useCreditsContext()\n\n const { trigger: buyNow } = useBuyNow(\n {},\n {\n throwOnError: true,\n }\n )\n\n return useSWRMutation(\n 'redeemAndBuy',\n async (\n _,\n {\n arg,\n }: {\n arg: {\n productVariant: ProductVariant\n quantity?: number\n redeemId: number\n }\n }\n ) => {\n const res = await trigger({\n user_id: profile?.user_id,\n rule_id: arg.redeemId,\n })\n if (res && res?.data?.coupon_code) {\n buyNow({\n discountCodes: [res.data.coupon_code],\n lineItems: [\n {\n variant: arg.productVariant,\n quantity: arg.quantity || 1,\n },\n ],\n })\n } else {\n throw new Error('Redeem failed')\n }\n },\n swrOptions\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyD,2BACzDC,EAAgC,6BAEhCC,EAAkC,uBAClCC,EAA0B,yBAEnB,MAAML,EAAkB,CAC7BM,EACAC,IAGG,CACH,KAAM,CAAE,QAAAC,CAAQ,KAAI,mBAAgB,EAC9B,CAAE,QAAAC,CAAQ,KAAI,qBAAkB,EAEhC,CAAE,QAASC,CAAO,KAAI,aAC1B,CAAC,EACD,CACE,aAAc,EAChB,CACF,EAEA,SAAO,EAAAC,SACL,eACA,MACEL,EACA,CACE,IAAAM,CACF,IAOG,CACH,MAAMC,EAAM,MAAML,EAAQ,CACxB,QAASC,GAAS,QAClB,QAASG,EAAI,QACf,CAAC,EACD,GAAIC,GAAOA,GAAK,MAAM,YACpBH,EAAO,CACL,cAAe,CAACG,EAAI,KAAK,WAAW,EACpC,UAAW,CACT,CACE,QAASD,EAAI,eACb,SAAUA,EAAI,UAAY,CAC5B,CACF,CACF,CAAC,MAED,OAAM,IAAI,MAAM,eAAe,CAEnC,EACAL,CACF,CACF",
6
+ "names": ["useRedeemAndBuy_exports", "__export", "useRedeemAndBuy", "__toCommonJS", "import_mutation", "import_useRedeemCoupon", "import_provider", "import_lib", "_", "swrOptions", "trigger", "profile", "buyNow", "useSWRMutation", "arg", "res"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var n in e)p(o,n,{get:e[n],enumerable:!0})},C=(o,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!d.call(o,t)&&t!==n&&p(o,t,{get:()=>e[t],enumerable:!(s=i(e,t))||s.enumerable});return o};var R=o=>C(p({},"__esModule",{value:!0}),o);var _={};c(_,{useRedeemCoupon:()=>l});module.exports=R(_);var r=require("../const"),u=require("./useAlpcFetch"),a=require("@anker-in/lib");const l=(o={})=>{const{locale:e,appName:n,brand:s}=(0,a.useHeadlessContext)();return(0,u.useAlpcMutation)({url:"/v1/credit/redeem/coupon",initData:{brand:s,country:r.ALPC_COUNTRY_MAP.get(e)||e,app_name:n}},o)};
2
+ //# sourceMappingURL=useRedeemCoupon.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemCoupon.ts"],
4
+ "sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype RedeemCouponResponse = {\n code: number\n data: {\n success: boolean\n coupon_code: string\n }\n}\n\nexport const useRedeemCoupon = (mutationOptions: UseMutationConfig<RedeemCouponResponse> = {}) => {\n const { locale, appName, brand } = useHeadlessContext()\n\n return useAlpcMutation<\n RedeemCouponResponse,\n {\n user_id?: string\n rule_id: number\n }\n >(\n {\n url: `/v1/credit/redeem/coupon`,\n initData: {\n brand,\n country: ALPC_COUNTRY_MAP.get(locale) || locale,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiC,oBACjCC,EAAwD,0BACxDC,EAAmC,yBAU5B,MAAMJ,EAAkB,CAACK,EAA2D,CAAC,IAAM,CAChG,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,MAAAC,CAAM,KAAI,sBAAmB,EAEtD,SAAO,mBAOL,CACE,IAAK,2BACL,SAAU,CACR,MAAAA,EACA,QAAS,mBAAiB,IAAIF,CAAM,GAAKA,EACzC,SAAUC,CACZ,CACF,EACAF,CACF,CACF",
6
+ "names": ["useRedeemCoupon_exports", "__export", "useRedeemCoupon", "__toCommonJS", "import_const", "import_useAlpcFetch", "import_lib", "mutationOptions", "locale", "appName", "brand"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var c=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},R=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of m(e))!p.call(o,n)&&n!==t&&s(o,n,{get:()=>e[n],enumerable:!(r=i(e,n))||r.enumerable});return o};var l=o=>R(s({},"__esModule",{value:!0}),o);var C={};c(C,{useRedeemProduct:()=>g});module.exports=l(C);var a=require("../const"),d=require("./useAlpcFetch"),u=require("@anker-in/lib");const g=(o={})=>{const{storeDomain:e,locale:t,appName:r,brand:n}=(0,u.useHeadlessContext)();return(0,d.useAlpcMutation)({url:"/v1/credit/exchange/goods",initData:{quantity:1,brand:n,country:(a.ALPC_COUNTRY_MAP.get(t||"")||t)?.toUpperCase(),domain:e,app_name:r}},o)};
2
+ //# sourceMappingURL=useRedeemProduct.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemProduct.ts"],
4
+ "sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype RedeemProductResponse = {\n code: number\n data: {\n success: boolean\n }\n}\n\nexport const useRedeemProduct = (mutationOptions: UseMutationConfig<RedeemProductResponse> = {}) => {\n const { storeDomain, locale, appName, brand } = useHeadlessContext()\n\n return useAlpcMutation<\n RedeemProductResponse,\n {\n rule_id: number\n address: string\n }\n >(\n {\n url: `/v1/credit/exchange/goods`,\n initData: {\n quantity: 1,\n brand,\n country: (ALPC_COUNTRY_MAP.get(locale || '') || locale)?.toUpperCase(),\n domain: storeDomain,\n app_name: appName,\n },\n },\n mutationOptions\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiC,oBACjCC,EAAwD,0BACxDC,EAAmC,yBAS5B,MAAMJ,EAAmB,CAACK,EAA4D,CAAC,IAAM,CAClG,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAQ,QAAAC,EAAS,MAAAC,CAAM,KAAI,sBAAmB,EAEnE,SAAO,mBAOL,CACE,IAAK,4BACL,SAAU,CACR,SAAU,EACV,MAAAA,EACA,SAAU,mBAAiB,IAAIF,GAAU,EAAE,GAAKA,IAAS,YAAY,EACrE,OAAQD,EACR,SAAUE,CACZ,CACF,EACAH,CACF,CACF",
6
+ "names": ["useRedeemProduct_exports", "__export", "useRedeemProduct", "__toCommonJS", "import_const", "import_useAlpcFetch", "import_lib", "mutationOptions", "storeDomain", "locale", "appName", "brand"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var d=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var s in t)d(e,s,{get:t[s],enumerable:!0})},M=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!D.call(e,r)&&r!==s&&d(e,r,{get:()=>t[r],enumerable:!(n=N(t,r))||n.enumerable});return e};var O=e=>M(d({},"__esModule",{value:!0}),e);var v={};I(v,{default:()=>k});module.exports=O(v);var i=require("react"),R=require("./useAlpcFetch"),S=require("../const"),b=require("../provider"),x=require("@anker-in/lib");function P(){let e="";const{profile:t,isLoadingProfile:s}=(0,b.useCreditsContext)(),{locale:n,brand:r}=(0,x.useHeadlessContext)();n==="pl"?e="eu":e=n;const[y,_]=(0,i.useState)([]),{isMutating:h,trigger:p}=(0,R.useAlpcMutation)({url:"/v1/credit/consume_credit_rules",initData:{brand:r,page:1,page_size:20,country:(S.ALPC_COUNTRY_MAP.get(e)||e)?.toUpperCase(),task_target:1}}),u=(0,i.useCallback)(()=>{const f=`consume_credit_rules-${e}`,g=localStorage?.getItem(f);if(g){try{const c=JSON.parse(g);if(c.expire>Date.now()&&c.consume_credit_rules.length){_(c.consume_credit_rules);return}}catch{}localStorage?.removeItem(f)}p({user_id:t?.user_id},{onSuccess(c){let C=c.data.consume_credit_rules||[],l=C.filter(o=>o.consume_type==1)||[],a=C.filter(o=>o.consume_type==2)||[];l=l.sort((o,m)=>o.consume_credits-m.consume_credits),a=a.sort((o,m)=>o.consume_credits-m.consume_credits);const L=l.concat(a);_(L),localStorage?.setItem(`consume_credit_rules-${e}`,JSON.stringify({expire:Date.now()+10*60*1e3,consume_credit_rules:L}))}})},[t,p,e]);return(0,i.useEffect)(()=>{s||u()},[u,s]),{listLoading:h,redeemableList:y,getRedeemableList:u}}var k=P;
2
+ //# sourceMappingURL=useRedeemableList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemableList.ts"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList() {\n let locale = '' as string\n const { profile, isLoadingProfile } = useCreditsContext()\n const { locale: contextLocale, brand } = useHeadlessContext()\n\n if (contextLocale === 'pl') {\n locale = 'eu'\n } else {\n locale = contextLocale\n }\n\n const [redeemableList, setRedeemableList] = useState<ConsumeCreditRuleResponse[]>([])\n const { isMutating: listLoading, trigger } = useAlpcMutation<\n {\n data: { consume_credit_rules: ConsumeCreditRuleResponse[] }\n },\n { user_id?: string }\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 20,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n task_target: 1, // 1: 'app', 2: 'website'\n },\n })\n\n const getRedeemableList = useCallback(() => {\n const cacheName = `consume_credit_rules-${locale}`\n\n const cacheStr = localStorage?.getItem(cacheName)\n if (cacheStr) {\n try {\n const cache = JSON.parse(cacheStr)\n if (cache.expire > Date.now() && cache.consume_credit_rules.length) {\n // \u7F13\u5B58\u672A\u8FC7\u671F\n setRedeemableList(cache.consume_credit_rules)\n return\n }\n } catch (e) {}\n localStorage?.removeItem(cacheName)\n }\n trigger(\n {\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n let list = responseData.data.consume_credit_rules || []\n let cList = list.filter(i => i.consume_type == 1) || []\n let pList = list.filter(i => i.consume_type == 2) || []\n cList = cList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n pList = pList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n const resultList = cList.concat(pList)\n setRedeemableList(resultList)\n\n localStorage?.setItem(\n `consume_credit_rules-${locale}`,\n JSON.stringify({\n expire: Date.now() + 10 * 60 * 1000,\n consume_credit_rules: resultList,\n })\n )\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList()\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiD,iBAEjDC,EAAgC,0BAChCC,EAAiC,oBACjCC,EAAkC,uBAElCC,EAAmC,yBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,CAAiB,KAAI,qBAAkB,EAClD,CAAE,OAAQC,EAAe,MAAAC,CAAM,KAAI,sBAAmB,EAExDD,IAAkB,KACpBH,EAAS,KAETA,EAASG,EAGX,KAAM,CAACE,EAAgBC,CAAiB,KAAI,YAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYC,EAAa,QAAAC,CAAQ,KAAI,mBAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAJ,EACA,KAAM,EACN,UAAW,GACX,SAAU,mBAAiB,IAAIJ,CAAM,GAAKA,IAAS,YAAY,EAC/D,YAAa,CACf,CACF,CAAC,EAEKS,KAAoB,eAAY,IAAM,CAC1C,MAAMC,EAAY,wBAAwBV,CAAM,GAE1CW,EAAW,cAAc,QAAQD,CAAS,EAChD,GAAIC,EAAU,CACZ,GAAI,CACF,MAAMC,EAAQ,KAAK,MAAMD,CAAQ,EACjC,GAAIC,EAAM,OAAS,KAAK,IAAI,GAAKA,EAAM,qBAAqB,OAAQ,CAElEN,EAAkBM,EAAM,oBAAoB,EAC5C,MACF,CACF,MAAY,CAAC,CACb,cAAc,WAAWF,CAAS,CACpC,CACAF,EACE,CACE,QAASP,GAAS,OACpB,EACA,CACE,UAAUY,EAAc,CACtB,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAClDE,EAAQD,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EAClDC,EAAQH,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EACtDD,EAAQA,EAAM,KAAK,CAACG,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9EF,EAAQA,EAAM,KAAK,CAACC,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9E,MAAMC,EAAaL,EAAM,OAAOE,CAAK,EACrCX,EAAkBc,CAAU,EAE5B,cAAc,QACZ,wBAAwBpB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBoB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAACnB,EAASO,EAASR,CAAM,CAAC,EAE7B,sBAAU,IAAM,CACTE,GACHO,EAAkB,CAEtB,EAAG,CAACA,EAAmBP,CAAgB,CAAC,EAEjC,CACL,YAAAK,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOjB,EAAQO",
6
+ "names": ["useRedeemableList_exports", "__export", "useRedeemableList_default", "__toCommonJS", "import_react", "import_useAlpcFetch", "import_const", "import_provider", "import_lib", "useRedeemableList", "locale", "profile", "isLoadingProfile", "contextLocale", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "cacheName", "cacheStr", "cache", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.create;var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},r=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f(t))!v.call(e,a)&&a!==o&&i(e,a,{get:()=>t[a],enumerable:!(n=d(t,a))||n.enumerable});return e};var m=(e,t,o)=>(o=e!=null?c(h(e)):{},r(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),C=e=>r(i({},"__esModule",{value:!0}),e);var y={};x(y,{useSendEmailValidation:()=>S});module.exports=C(y);var s=m(require("../../../../helpers/fetcher")),l=m(require("swr/mutation")),p=require("../provider"),u=require("@anker-in/lib");function S(){const{profile:e}=(0,p.useCreditsContext)(),{appName:t,locale:o}=(0,u.useHeadlessContext)();return(0,l.default)("send-email-validation",()=>(0,s.default)({locale:o,url:"/api/multipass/account/users/send_validation_email",method:"POST",body:{email:e?.email,app:t},needRecaptcha:!0,action:"verifyAccount"}))}
2
+ //# sourceMappingURL=useSendEmailValidation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useSendEmailValidation.ts"],
4
+ "sourcesContent": ["import fetcher from '../../../../helpers/fetcher'\nimport useSWRMutation from 'swr/mutation'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport function useSendEmailValidation() {\n const { profile } = useCreditsContext()\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', () =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n method: 'POST',\n body: { email: profile?.email, app: appName },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoB,0CACpBC,EAA2B,2BAC3BC,EAAkC,uBAClCC,EAAmC,yBAE5B,SAASL,GAAyB,CACvC,KAAM,CAAE,QAAAM,CAAQ,KAAI,qBAAkB,EAChC,CAAE,QAAAC,EAAS,OAAAC,CAAO,KAAI,sBAAmB,EAE/C,SAAO,EAAAC,SAAe,wBAAyB,OAC7C,EAAAC,SAAQ,CACN,OAAAF,EACA,IAAK,qDACL,OAAQ,OACR,KAAM,CAAE,MAAOF,GAAS,MAAO,IAAKC,CAAQ,EAC5C,cAAe,GACf,OAAQ,eACV,CAAC,CACH,CACF",
6
+ "names": ["useSendEmailValidation_exports", "__export", "useSendEmailValidation", "__toCommonJS", "import_fetcher", "import_mutation", "import_provider", "import_lib", "profile", "appName", "locale", "useSWRMutation", "fetcher"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var S=Object.create;var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var g=(e,s)=>{for(var r in s)u(e,r,{get:s[r],enumerable:!0})},c=(e,s,r,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let t of v(s))!C.call(e,t)&&t!==r&&u(e,t,{get:()=>s[t],enumerable:!(i=l(s,t))||i.enumerable});return e};var b=(e,s,r)=>(r=e!=null?S(x(e)):{},c(s||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),k=e=>c(u({},"__esModule",{value:!0}),e);var R={};g(R,{useSubscribed:()=>y});module.exports=k(R);var n=require("react"),p=require("../const"),m=b(require("./useActivities")),a=b(require("./useSubscriptions")),f=require("../provider"),d=require("@anker-in/lib");const y=()=>{const{profile:e}=(0,f.useCreditsContext)(),{brand:s}=(0,d.useHeadlessContext)(),r=(0,n.useMemo)(()=>({page:1,pageSize:50}),[]),{activities:i}=(0,m.default)(r),{subscriptionData:t}=(0,a.default)(e?.email);return(0,n.useMemo)(()=>t?.preference?t.preference.some(o=>o.brand===s&&o.subscribe)?!0:i?.some(o=>o.task_sub_type===p.TaskSubType.Subscription):!1,[t,i])};
2
+ //# sourceMappingURL=useSubscribed.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useSubscribed.ts"],
4
+ "sourcesContent": ["import { useMemo } from 'react'\n\nimport { TaskSubType } from '../const'\nimport useActivities from './useActivities'\nimport useSubscriptions from './useSubscriptions'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport const useSubscribed = () => {\n const { profile } = useCreditsContext()\n const { brand } = useHeadlessContext()\n\n const activitiesOptions = useMemo(() => ({ page: 1, pageSize: 50 }), [])\n\n const { activities } = useActivities(activitiesOptions)\n const { subscriptionData } = useSubscriptions(profile?.email)\n\n const isSubscribed = useMemo(() => {\n if (!subscriptionData?.preference) {\n return false\n }\n\n const subscribeResult = subscriptionData.preference.some(item => {\n return item.brand === brand && item.subscribe\n })\n\n if (subscribeResult) {\n return true\n }\n\n return activities?.some(item => {\n return item.task_sub_type === TaskSubType.Subscription\n })\n }, [subscriptionData, activities])\n\n return isSubscribed\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwB,iBAExBC,EAA4B,oBAC5BC,EAA0B,8BAC1BC,EAA6B,iCAC7BC,EAAkC,uBAClCC,EAAmC,yBAE5B,MAAMP,EAAgB,IAAM,CACjC,KAAM,CAAE,QAAAQ,CAAQ,KAAI,qBAAkB,EAChC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAE/BC,KAAoB,WAAQ,KAAO,CAAE,KAAM,EAAG,SAAU,EAAG,GAAI,CAAC,CAAC,EAEjE,CAAE,WAAAC,CAAW,KAAI,EAAAC,SAAcF,CAAiB,EAChD,CAAE,iBAAAG,CAAiB,KAAI,EAAAC,SAAiBN,GAAS,KAAK,EAoB5D,SAlBqB,WAAQ,IACtBK,GAAkB,WAICA,EAAiB,WAAW,KAAKE,GAChDA,EAAK,QAAUN,GAASM,EAAK,SACrC,EAGQ,GAGFJ,GAAY,KAAKI,GACfA,EAAK,gBAAkB,cAAY,YAC3C,EAbQ,GAcR,CAACF,EAAkBF,CAAU,CAAC,CAGnC",
6
+ "names": ["useSubscribed_exports", "__export", "useSubscribed", "__toCommonJS", "import_react", "import_const", "import_useActivities", "import_useSubscriptions", "import_provider", "import_lib", "profile", "brand", "activitiesOptions", "activities", "useActivities", "subscriptionData", "useSubscriptions", "item"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var S=(t,r)=>{for(var e in r)i(t,e,{get:r[e],enumerable:!0})},a=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of m(r))!d.call(t,o)&&o!==e&&i(t,o,{get:()=>r[o],enumerable:!(n=b(r,o))||n.enumerable});return t};var h=(t,r,e)=>(e=t!=null?l(y(t)):{},a(r||!t||!t.__esModule?i(e,"default",{value:t,enumerable:!0}):e,t)),g=t=>a(i({},"__esModule",{value:!0}),t);var D={};S(D,{default:()=>C});module.exports=g(D);var s=require("react"),p=h(require("../../../../helpers/fetcher")),f=require("@anker-in/lib");function x(t){const r=(0,s.useRef)(!1),[e,n]=(0,s.useState)(),{locale:o}=(0,f.useHeadlessContext)(),u=(0,s.useCallback)(async()=>{if(t&&!r.current){r.current=!0;try{const c=await(0,p.default)({method:"GET",url:"/api/multipass/account/subscriptions",body:{email:t},action:"login",locale:o,headers:{},type:""});c&&n(c)}catch(c){console.error(c)}finally{r.current=!1}}},[t,o,r]);return(0,s.useEffect)(()=>{u()},[u]),{subscriptionData:e}}var C=x;
2
+ //# sourceMappingURL=useSubscriptions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useSubscriptions.ts"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useRef, useState } from 'react'\nimport type { Subscription } from '../../type'\nimport fetcher from '../../../../helpers/fetcher'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useSubscriptions(email?: string) {\n const loading = useRef(false)\n const [subscriptionData, setSubscriptionData] = useState<Subscription>()\n const { locale } = useHeadlessContext()\n\n const fetchSubscription = useCallback(async () => {\n if (!email) {\n return\n }\n\n if (loading.current) {\n return\n }\n\n loading.current = true\n\n try {\n const response = await fetcher({\n method: 'GET',\n url: '/api/multipass/account/subscriptions',\n body: {\n email,\n },\n action: 'login',\n locale,\n headers: {},\n type: '',\n })\n\n if (response) {\n setSubscriptionData(response)\n }\n } catch (error) {\n console.error(error)\n } finally {\n loading.current = false\n }\n }, [email, locale, loading])\n\n useEffect(() => {\n fetchSubscription()\n }, [fetchSubscription])\n\n return {\n subscriptionData,\n }\n}\n\nexport default useSubscriptions\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyD,iBAEzDC,EAAoB,0CACpBC,EAAmC,yBAEnC,SAASC,EAAiBC,EAAgB,CACxC,MAAMC,KAAU,UAAO,EAAK,EACtB,CAACC,EAAkBC,CAAmB,KAAI,YAAuB,EACjE,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAEhCC,KAAoB,eAAY,SAAY,CAChD,GAAKL,GAID,CAAAC,EAAQ,QAIZ,CAAAA,EAAQ,QAAU,GAElB,GAAI,CACF,MAAMK,EAAW,QAAM,EAAAC,SAAQ,CAC7B,OAAQ,MACR,IAAK,uCACL,KAAM,CACJ,MAAAP,CACF,EACA,OAAQ,QACR,OAAAI,EACA,QAAS,CAAC,EACV,KAAM,EACR,CAAC,EAEGE,GACFH,EAAoBG,CAAQ,CAEhC,OAASE,EAAO,CACd,QAAQ,MAAMA,CAAK,CACrB,QAAE,CACAP,EAAQ,QAAU,EACpB,EACF,EAAG,CAACD,EAAOI,EAAQH,CAAO,CAAC,EAE3B,sBAAU,IAAM,CACdI,EAAkB,CACpB,EAAG,CAACA,CAAiB,CAAC,EAEf,CACL,iBAAAH,CACF,CACF,CAEA,IAAOR,EAAQK",
6
+ "names": ["useSubscriptions_exports", "__export", "useSubscriptions_default", "__toCommonJS", "import_react", "import_fetcher", "import_lib", "useSubscriptions", "email", "loading", "subscriptionData", "setSubscriptionData", "locale", "fetchSubscription", "response", "fetcher", "error"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var _=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},n=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of l(o))!m.call(e,a)&&a!==t&&d(e,a,{get:()=>o[a],enumerable:!(r=c(o,a))||r.enumerable});return e};var y=(e,o,t)=>(t=e!=null?p(u(e)):{},n(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),g=e=>n(d({},"__esModule",{value:!0}),e);var k={};_(k,{uploadReceipt:()=>i,useUploadReceipt:()=>h});module.exports=g(k);var s=y(require("swr/mutation"));const i=async(e,{arg:{orderName:o}})=>{const t=await fetch("/api/multipass/mktsrv/v1/credit/upload_third_party_order",{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({order_name:o})}),{data:r}=await t.json();return console.log("data",r),{ok:r?.code===0,code:r?.code}},h=()=>(0,s.default)("/api/multipass/mktsrv/v1/credit/upload_third_party_order",i);
2
+ //# sourceMappingURL=useUploadReceipt.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useUploadReceipt.tsx"],
4
+ "sourcesContent": ["import useSWRMutation from 'swr/mutation'\n\nexport const uploadReceipt = async (\n _: any,\n { arg: { orderName } }: { arg: { orderName: string } }\n): Promise<{\n ok: boolean\n code: number\n}> => {\n const response = await fetch(`/api/multipass/mktsrv/v1/credit/upload_third_party_order`, {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n order_name: orderName,\n }),\n })\n const { data } = await response.json()\n console.log('data', data)\n return {\n ok: data?.code === 0,\n code: data?.code,\n }\n}\n\nexport const useUploadReceipt = () => {\n return useSWRMutation('/api/multipass/mktsrv/v1/credit/upload_third_party_order', uploadReceipt)\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,qBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAA2B,2BAEpB,MAAMH,EAAgB,MAC3BI,EACA,CAAE,IAAK,CAAE,UAAAC,CAAU,CAAE,IAIjB,CACJ,MAAMC,EAAW,MAAM,MAAM,2DAA4D,CACvF,YAAa,UACb,OAAQ,OACR,QAAS,CACP,eAAgB,kBAClB,EACA,KAAM,KAAK,UAAU,CACnB,WAAYD,CACd,CAAC,CACH,CAAC,EACK,CAAE,KAAAE,CAAK,EAAI,MAAMD,EAAS,KAAK,EACrC,eAAQ,IAAI,OAAQC,CAAI,EACjB,CACL,GAAIA,GAAM,OAAS,EACnB,KAAMA,GAAM,IACd,CACF,EAEaN,EAAmB,OACvB,EAAAO,SAAe,2DAA4DR,CAAa",
6
+ "names": ["useUploadReceipt_exports", "__export", "uploadReceipt", "useUploadReceipt", "__toCommonJS", "import_mutation", "_", "orderName", "response", "data", "useSWRMutation"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var I=(e,o)=>{for(var i in o)p(e,i,{get:o[i],enumerable:!0})},T=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of m(o))!v.call(e,n)&&n!==i&&p(e,n,{get:()=>o[n],enumerable:!(r=P(o,n))||r.enumerable});return e};var y=e=>T(p({},"__esModule",{value:!0}),e);var R={};I(R,{CreditsContext:()=>d,CreditsProvider:()=>S,useCreditsContext:()=>_});module.exports=y(R);var s=require("react/jsx-runtime"),t=require("react");const d=(0,t.createContext)({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:e=>{},gtm:{pageGroup:""}});function S({children:e,profile:o,removeProfile:i,isLoadingProfile:r,openSignInPopup:n,openSignUpPopup:a,taskIdToTypeMapping:f,creditInfo:g,customer:u,customerLoading:c,fetchCreditInfo:l,gtm:C}){return(0,s.jsx)(d.Provider,{value:{profile:o,isLoadingProfile:r,removeProfile:i,openSignInPopup:n,openSignUpPopup:a,taskIdToTypeMapping:f,creditInfo:g,fetchCreditInfo:l,customer:u,customerLoading:c,gtm:C},children:e})}function _(){return(0,t.useContext)(d)}
2
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/context/provider.tsx"],
4
+ "sourcesContent": ["import React, { createContext, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\n\nexport const CreditsContext = createContext<{\n profile: any\n isLoadingProfile: boolean\n removeProfile: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n openSignInPopup: () => void\n openSignUpPopup: () => void\n creditInfo?: CreditInfoResponse\n customer?: any\n customerLoading: boolean\n fetchCreditInfo: (user_id: string) => void\n gtm: {\n pageGroup: string\n }\n}>({\n profile: null,\n isLoadingProfile: false,\n taskIdToTypeMapping: {},\n removeProfile: () => {},\n openSignInPopup: () => {},\n openSignUpPopup: () => {},\n creditInfo: undefined,\n customerLoading: false,\n fetchCreditInfo: (user_id: string) => {},\n gtm: {\n pageGroup: '',\n },\n})\n\nexport function CreditsProvider({\n children,\n profile,\n removeProfile,\n isLoadingProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n customer,\n customerLoading,\n fetchCreditInfo,\n gtm,\n}: {\n children: React.ReactNode\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n openSignInPopup: () => void\n openSignUpPopup: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n creditInfo?: CreditInfoResponse\n customer: any\n fetchCreditInfo: (user_id: string) => void\n customerLoading: boolean\n gtm: {\n pageGroup: string\n }\n}) {\n return (\n <CreditsContext.Provider\n value={{\n profile,\n isLoadingProfile,\n removeProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n fetchCreditInfo,\n customer,\n customerLoading,\n gtm,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n return useContext(CreditsContext)\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,oBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAL,GA+DI,IAAAM,EAAA,6BA/DJC,EAAiD,iBAI1C,MAAML,KAAiB,iBAc3B,CACD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBM,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,EACb,CACF,CAAC,EAEM,SAASL,EAAgB,CAC9B,SAAAM,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,CACF,EAeG,CACD,SACE,OAAClB,EAAe,SAAf,CACC,MAAO,CACL,QAAAQ,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,CACF,EAEC,SAAAX,EACH,CAEJ,CAEO,SAASL,GAAoB,CAClC,SAAO,cAAWF,CAAc,CAClC",
6
+ "names": ["provider_exports", "__export", "CreditsContext", "CreditsProvider", "useCreditsContext", "__toCommonJS", "import_jsx_runtime", "import_react", "user_id", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var m=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!o.call(n,t)&&t!==i&&s(n,t,{get:()=>e[t],enumerable:!(r=a(e,t))||r.enumerable});return n};var p=n=>m(s({},"__esModule",{value:!0}),n);var d={};module.exports=p(d);
2
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/context/response.ts"],
4
+ "sourcesContent": ["import { ApprovalStatus, AlpcConsumeType, CreditType, TaskSubType, TaskType } from './const'\n\n// ALPC\u670D\u52A1\u54CD\u5E94\u6570\u636E\u7C7B\u578B\n\ninterface BaseResponse {\n brand: string\n}\n\nexport interface Task extends BaseResponse {\n goods_sku?: string\n task_type: TaskType\n task_sub_type: TaskSubType\n task_rule_id: number\n task_name: string\n task_note: string\n app_name: string\n}\n\n// \u79EF\u5206\u6D41\u6C34\nexport interface CreditLogResponse extends Task {\n credit: number\n task_name: string\n create_time: number\n credit_type: CreditType\n pending_time: number\n status: number\n expired_time?: number\n}\n\nexport interface ConsumeCreditRuleResponse extends BaseResponse {\n id: number\n name: string\n note: string\n consume_credits: number\n consume_type: AlpcConsumeType\n coupon_rule: string\n remaining_inventory: number\n is_limited: number\n sku_handle: string\n goods_sku: string\n goods_url: string\n extra?: string // discount, type\n}\n\nexport interface RedeemLogResponse extends BaseResponse {\n goods_title: string\n coupon_code: string\n order_number: string\n create_time: number\n consume_credits: number\n fulfillment_status: string\n approval_status: ApprovalStatus\n rule_id: number\n code_status: number\n}\n\nexport interface CreditTaskResponse extends Task {\n status: number\n is_enable: number\n id: number\n weight: number\n reward_type: number\n}\n\nexport interface CreditInfoResponse extends BaseResponse {\n total_credit: number\n available_credit: number\n pending_credit: number\n expired_credit: number\n cancel_credit: number\n consumed_credit: number\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["response_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var k=Object.create;var o=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var $=(e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})},p=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of E(n))!P.call(e,i)&&i!==r&&o(e,i,{get:()=>n[i],enumerable:!(t=C(n,i))||t.enumerable});return e};var F=(e,n,r)=>(r=e!=null?k(I(e)):{},p(n||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),x=e=>p(o({},"__esModule",{value:!0}),e);var z={};$(z,{emailValidate:()=>U,formatPrice:()=>m,formatVariantPrice:()=>v,getAlpcPath:()=>D,languageTerritory:()=>f,numberFormat:()=>S});module.exports=x(z);var l=F(require("js-cookie")),s=require("./const");function D(e=""){let n=!1;const r=l.default.get("alpcEU");return r===void 0||r===""?["de","eu-de","eu","eu-en","uk","fr","fra"].includes(e)&&(n=!0):Number(r)&&(n=!0),n?"/api/multipass/alpc-eu":"/api/multipass/alpc"}function S(e=0){return typeof Intl>"u"?e:new Intl.NumberFormat().format(e)}const U=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),f=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",nz:"en-nz",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[e]||"";function m({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:a=!1}){let u=new Intl.NumberFormat(f(r)||r,{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(u=u?.toString()?.replace(/[\s]/g,"")),a&&(u=u.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),u}function v({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:c}){if(typeof Intl>"u")return{price:`${s.PRICE_SYMBOL[t]}${e}`,basePrice:`${s.PRICE_SYMBOL[t]}${n}`,discount:`${s.PRICE_SYMBOL[t]}${n-e||0}`};const u=n>e,d=new Intl.NumberFormat(f(t),{style:"percent"}),g=u?d.format((n-e)/n):null,b=m({amount:e,currencyCode:r,locale:t,removeTrailingZeros:c}),y=u?m({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:c}):void 0;return{price:b,basePrice:y,discount:g}}
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/context/utils.ts"],
4
+ "sourcesContent": ["import Cookies from 'js-cookie'\nimport { PRICE_SYMBOL } from './const'\n\nexport function getAlpcPath(locale = '') {\n let isEU = false\n const alpcEUCookie = Cookies.get('alpcEU')\n if (alpcEUCookie === undefined || alpcEUCookie === '') {\n if (['de', 'eu-de', 'eu', 'eu-en', 'uk', 'fr', 'fra'].includes(locale)) {\n isEU = true\n }\n } else {\n let alpcEU = Number(alpcEUCookie)\n if (alpcEU) {\n isEU = true\n }\n }\n\n if (isEU) {\n return '/api/multipass/alpc-eu'\n }\n\n return '/api/multipass/alpc'\n}\n\nexport function numberFormat(num: number = 0) {\n if (typeof Intl === 'undefined') {\n return num\n }\n\n return new Intl.NumberFormat().format(num)\n}\n\nexport const emailValidate = (email: any) => {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n )\n}\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n nz: 'en-nz',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale) || locale, {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,gBAAAC,EAAA,sBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAoB,wBACpBC,EAA6B,mBAEtB,SAASL,EAAYM,EAAS,GAAI,CACvC,IAAIC,EAAO,GACX,MAAMC,EAAe,EAAAC,QAAQ,IAAI,QAAQ,EAYzC,OAXID,IAAiB,QAAaA,IAAiB,GAC7C,CAAC,KAAM,QAAS,KAAM,QAAS,KAAM,KAAM,KAAK,EAAE,SAASF,CAAM,IACnEC,EAAO,IAGI,OAAOC,CAAY,IAE9BD,EAAO,IAIPA,EACK,yBAGF,qBACT,CAEO,SAASL,EAAaQ,EAAc,EAAG,CAC5C,OAAI,OAAO,KAAS,IACXA,EAGF,IAAI,KAAK,aAAa,EAAE,OAAOA,CAAG,CAC3C,CAEO,MAAMb,EAAiBc,GACrB,yJAAyJ,KAC9JA,CACF,EAGWV,EAAqBK,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASR,EAAY,CAC1B,OAAAc,EACA,aAAAC,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAahB,EAAkBK,CAAM,GAAKA,EAAQ,CAChF,MAAO,WACP,SAAUO,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAASN,CAAM,IAChDW,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAASlB,EAAmB,CACjC,OAAAa,EACA,WAAAM,EACA,aAAAL,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAG,eAAaV,CAAmC,CAAC,GAAGM,CAAM,GACpE,UAAW,GAAG,eAAaN,CAAmC,CAAC,GAAGY,CAAU,GAC5E,SAAU,GAAG,eAAaZ,CAAmC,CAAC,GAAGY,EAAaN,GAAU,CAAC,EAC3F,EAGF,MAAMO,EAAcD,EAAaN,EAC3BQ,EAAiB,IAAI,KAAK,aAAanB,EAAkBK,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKe,EAAWF,EAAcC,EAAe,QAAQF,EAAaN,GAAUM,CAAU,EAAI,KAErFI,EAAQxB,EAAY,CAAE,OAAAc,EAAQ,aAAAC,EAAc,OAAAP,EAAQ,oBAAAU,CAAoB,CAAC,EACzEO,EAAYJ,EACdrB,EAAY,CACV,OAAQoB,EACR,aAAAL,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAM,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
6
+ "names": ["utils_exports", "__export", "emailValidate", "formatPrice", "formatVariantPrice", "getAlpcPath", "languageTerritory", "numberFormat", "__toCommonJS", "import_js_cookie", "import_const", "locale", "isEU", "alpcEUCookie", "Cookies", "num", "email", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.create;var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var v=(t,i)=>{for(var a in i)r(t,a,{get:i[a],enumerable:!0})},m=(t,i,a,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of x(i))!h.call(t,n)&&n!==a&&r(t,n,{get:()=>i[n],enumerable:!(s=f(i,n))||s.enumerable});return t};var N=(t,i,a)=>(a=t!=null?u(I(t)):{},m(i||!t||!t.__esModule?r(a,"default",{value:t,enumerable:!0}):a,t)),C=t=>m(r({},"__esModule",{value:!0}),t);var b={};v(b,{CreditsBanner:()=>w});module.exports=C(b);var e=require("react/jsx-runtime"),l=require("@anker-in/headless-ui"),g=N(require("classnames")),p=require("../context/provider");function w({copy:t}){const{profile:i,openSignInPopup:a,openSignUpPopup:s}=(0,p.useCreditsContext)(),n=i?Object.keys(i).length!==0:!1,d=i?.first_name?i?.first_name+" "+i?.last_name:i?.email?.split("@")[0],o=c=>{c==="primary"?s():a()};return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:" relative w-full",children:[(0,e.jsx)(l.Picture,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&(0,e.jsx)("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),(0,e.jsx)(l.Container,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:(0,e.jsx)("div",{className:"grid grid-cols-12",children:(0,e.jsxs)("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[(0,e.jsx)(l.Heading,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",d||""):t.unLogin.title}),(0,e.jsx)(l.Text,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&(0,e.jsxs)("div",{className:(0,g.default)("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>{o("primary")},children:t.joinNow}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>{o("secondary")},children:t.loginIn})]})]})})})]})})}
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBanner/index.tsx"],
4
+ "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\n\ntype Img = {\n url: string\n alt: string\n}\ntype BannerProps = {\n copy: {\n pcImg: Img\n laptopImg: Img\n mobileImg: Img\n joinNow: string\n loginIn: string\n login: {\n title: string\n description: string\n }\n unLogin: {\n title: string\n description: string\n }\n }\n}\n\nexport function CreditsBanner({ copy }: BannerProps) {\n const { profile, openSignInPopup, openSignUpPopup } = useCreditsContext()\n const isLogin = profile ? Object.keys(profile).length !== 0 : false\n\n const displayName = profile?.first_name\n ? profile?.first_name + ' ' + profile?.last_name\n : profile?.email?.split('@')[0]\n\n const handleButtonClick = (buttonType: 'primary' | 'secondary') => {\n buttonType === 'primary' ? openSignUpPopup() : openSignInPopup()\n }\n\n return (\n <>\n <div className=\" relative w-full\">\n <Picture\n className=\"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]\"\n source={`${copy.pcImg?.url}, ${copy.laptopImg?.url} 1024, ${copy.mobileImg?.url} 768`}\n alt={copy.pcImg?.alt}\n loading=\"eager\"\n ></Picture>\n {isLogin && (\n <div\n className=\"absolute inset-0 \"\n style={{\n background: 'linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)',\n }}\n ></div>\n )}\n\n <Container className=\"l:h-auto !absolute inset-0 mx-auto grid h-full\" asChild>\n <div className=\"grid grid-cols-12\">\n <div className=\"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]\">\n <Heading\n as=\"h1\"\n size=\"5\"\n html={isLogin ? copy.login.title?.replace('$name', displayName || '') : copy.unLogin.title}\n ></Heading>\n\n <Text\n size=\"3\"\n className=\"l:mt-[4px] l-xxl:text-[14px] mt-[16px]\"\n html={isLogin ? copy.login.description : copy.unLogin.description}\n ></Text>\n\n {!isLogin && (\n <div\n className={classNames(\n 'mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]',\n isLogin && 'hidden'\n )}\n >\n <Button\n variant=\"secondary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('primary')\n }}\n >\n {copy.joinNow}\n </Button>\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('secondary')\n }}\n >\n {copy.loginIn}\n </Button>\n </div>\n )}\n </div>\n </div>\n </Container>\n </div>\n </>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAuCI,IAAAI,EAAA,6BAvCJC,EAA0D,iCAC1DC,EAAuB,yBACvBC,EAAkC,+BAwB3B,SAASL,EAAc,CAAE,KAAAM,CAAK,EAAgB,CACnD,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,gBAAAC,CAAgB,KAAI,qBAAkB,EAClEC,EAAUH,EAAU,OAAO,KAAKA,CAAO,EAAE,SAAW,EAAI,GAExDI,EAAcJ,GAAS,WACzBA,GAAS,WAAa,IAAMA,GAAS,UACrCA,GAAS,OAAO,MAAM,GAAG,EAAE,CAAC,EAE1BK,EAAqBC,GAAwC,CACjEA,IAAe,UAAYJ,EAAgB,EAAID,EAAgB,CACjE,EAEA,SACE,mBACE,oBAAC,OAAI,UAAU,mBACb,oBAAC,WACC,UAAU,6GACV,OAAQ,GAAGF,EAAK,OAAO,GAAG,KAAKA,EAAK,WAAW,GAAG,UAAUA,EAAK,WAAW,GAAG,OAC/E,IAAKA,EAAK,OAAO,IACjB,QAAQ,QACT,EACAI,MACC,OAAC,OACC,UAAU,oBACV,MAAO,CACL,WAAY,sEACd,EACD,KAGH,OAAC,aAAU,UAAU,iDAAiD,QAAO,GAC3E,mBAAC,OAAI,UAAU,oBACb,oBAAC,OAAI,UAAU,qHACb,oBAAC,WACC,GAAG,KACH,KAAK,IACL,KAAMA,EAAUJ,EAAK,MAAM,OAAO,QAAQ,QAASK,GAAe,EAAE,EAAIL,EAAK,QAAQ,MACtF,KAED,OAAC,QACC,KAAK,IACL,UAAU,yCACV,KAAMI,EAAUJ,EAAK,MAAM,YAAcA,EAAK,QAAQ,YACvD,EAEA,CAACI,MACA,QAAC,OACC,aAAW,EAAAI,SACT,4DACAJ,GAAW,QACb,EAEA,oBAAC,UACC,QAAQ,YACR,KAAK,KACL,QAAS,IAAM,CACbE,EAAkB,SAAS,CAC7B,EAEC,SAAAN,EAAK,QACR,KACA,OAAC,UACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAM,CACbM,EAAkB,WAAW,CAC/B,EAEC,SAAAN,EAAK,QACR,GACF,GAEJ,EACF,EACF,GACF,EACF,CAEJ",
6
+ "names": ["creditsBanner_exports", "__export", "CreditsBanner", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_provider", "copy", "profile", "openSignInPopup", "openSignUpPopup", "isLogin", "displayName", "handleButtonClick", "buttonType", "classNames"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var i in o)d(e,i,{get:o[i],enumerable:!0})},r=(e,o,i,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of c(o))!b.call(e,l)&&l!==i&&d(e,l,{get:()=>o[l],enumerable:!(n=m(o,l))||n.enumerable});return e};var u=(e,o,i)=>(i=e!=null?p(f(e)):{},r(o||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),g=e=>r(d({},"__esModule",{value:!0}),e);var h={};v(h,{default:()=>N});module.exports=g(h);var t=require("react/jsx-runtime"),a=require("@anker-in/headless-ui"),x=require("../../../helpers/utils"),s=u(require("./iconInfo"));const F=({item:e,handleClick:o,isNoteActive:i,index:n})=>(0,t.jsx)("div",{className:"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",style:{background:"linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)"},children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(a.Picture,{className:"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0",alt:e.icon?.alt,source:e.icon?.url}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(a.Heading,{html:e.text,size:"2",className:"break-all"}),e.note&&(0,t.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>o({item:e,index:n}),children:[(0,t.jsx)(s.default,{}),(0,t.jsx)("div",{className:(0,x.cn)("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",i?"block":"hidden"),children:(0,t.jsxs)("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",children:[(0,t.jsx)(a.Text,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),(0,t.jsx)("div",{className:"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),e.tag&&(0,t.jsx)(a.Text,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})});var N=F;
2
+ //# sourceMappingURL=benefitItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/benefitItem.tsx"],
4
+ "sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { cn } from '../../../helpers/utils'\nimport IconInfo from './iconInfo'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n}) => {\n return (\n <div\n className=\"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]\"\n style={{\n background: 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)',\n }}\n >\n <div className=\"flex flex-col\">\n <Picture\n className=\"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0\"\n alt={item.icon?.alt}\n source={item.icon?.url}\n />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow\">\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div className=\"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgCQ,IAAAI,EAAA,6BAhCRC,EAAuC,iCACvCC,EAAmB,kCACnBC,EAAqB,yBAWrB,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,CACF,OAOI,OAAC,OACC,UAAU,8HACV,MAAO,CACL,WAAY,4EACd,EAEA,oBAAC,OAAI,UAAU,gBACb,oBAAC,WACC,UAAU,6EACV,IAAKH,EAAK,MAAM,IAChB,OAAQA,EAAK,MAAM,IACrB,KACA,QAAC,OAAI,UAAU,oBACb,oBAAC,WAAQ,KAAMA,EAAK,KAAM,KAAK,IAAI,UAAU,YAAY,EACxDA,EAAK,SACJ,QAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWI,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMH,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,oBAAC,EAAAE,QAAA,EAAS,KACV,OAAC,OACC,aAAW,MACT,qGACAH,EAAe,QAAU,QAC3B,EAEA,oBAAC,OAAI,UAAU,0FACb,oBAAC,QAAK,GAAG,IAAI,KAAK,IAAI,KAAMF,EAAK,KAAM,UAAU,sBAAsB,KACvE,OAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GAEJ,EACCA,EAAK,QAAO,OAAC,QAAK,GAAG,MAAM,KAAMA,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,EAIJ,IAAOP,EAAQM",
6
+ "names": ["benefitItem_exports", "__export", "benefitItem_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_iconInfo", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "e", "IconInfo"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(l,C)=>{for(var t in C)e(l,t,{get:C[t],enumerable:!0})},r=(l,C,t,i)=>{if(C&&typeof C=="object"||typeof C=="function")for(let o of f(C))!g.call(l,o)&&o!==t&&e(l,o,{get:()=>C[o],enumerable:!(i=p(C,o))||i.enumerable});return l};var w=l=>r(e({},"__esModule",{value:!0}),l);var a={};h(a,{IconInfo:()=>n,default:()=>v});module.exports=w(a);var s=require("react/jsx-runtime");const n=()=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-[18px] cursor-pointer [&_svg]:size-full",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[(0,s.jsx)("path",{d:"M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z",fill:"#6D6D6F"}),(0,s.jsx)("path",{d:"M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z",fill:"#6D6D6F"})]});var v=n;
2
+ //# sourceMappingURL=iconInfo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/iconInfo.tsx"],
4
+ "sourcesContent": ["export const IconInfo = () => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n className='size-[18px] cursor-pointer [&_svg]:size-full'\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n >\n <path\n d='M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z'\n fill='#6D6D6F'\n />\n <path\n d='M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z'\n fill='#6D6D6F'\n />\n </svg>\n )\n}\n\nexport default IconInfo\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAEI,IAAAK,EAAA,6BAFG,MAAMH,EAAW,OAEpB,QAAC,OACC,MAAM,6BACN,UAAU,+CACV,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,oBAAC,QACC,EAAE,6rBACF,KAAK,UACP,KACA,OAAC,QACC,EAAE,+aACF,KAAK,UACP,GACF,EAIJ,IAAOC,EAAQD",
6
+ "names": ["iconInfo_exports", "__export", "IconInfo", "iconInfo_default", "__toCommonJS", "import_jsx_runtime"]
7
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";var C=Object.create;var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!N.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(l=x(t,o))||l.enumerable});return e};var B=(e,t,i)=>(i=e!=null?C(h(e)):{},f(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),y=e=>f(a({},"__esModule",{value:!0}),e);var P={};_(P,{CreditsBenefits:()=>I});module.exports=y(P);var n=require("react/jsx-runtime"),z=require("swiper/css"),D=require("swiper/css/grid"),G=require("swiper/css/pagination"),p=require("@anker-in/headless-ui"),g=require("react"),m=require("swiper/modules"),d=require("swiper/react"),c=B(require("./benefitItem")),v=require("../context/provider"),b=require("../../../helpers/track"),w=require("../../../helpers/utils");const I=({copy:e})=>{const[t,i]=(0,g.useState)(null),{profile:l,gtm:o}=(0,v.useCreditsContext)(),u=({item:s,index:r})=>{(0,b.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:o.pageGroup,position:e.title,button_name:s.text,info:""}}),t===r?i(null):(i(r),setTimeout(()=>{i(null)},5e3))};return(0,n.jsxs)(p.Container,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[(0,n.jsx)(p.Heading,{as:"h2",size:"4",html:e?.title}),(0,n.jsx)("div",{className:"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch",children:e.benefits.map((s,r)=>(0,n.jsx)(c.default,{item:s,handleClick:u,isNoteActive:t===r,index:r},r))}),(0,n.jsxs)("div",{className:"mt-[24px] hidden l:block",children:[(0,n.jsx)(d.Swiper,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"!items-stretch",modules:[m.Grid,m.Pagination],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(s,r){return`<div class='${r} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
+ </div>`}},children:e.benefits.map((s,r)=>(0,n.jsx)(d.SwiperSlide,{className:(0,w.cn)("!h-auto !flex",t===r&&"!z-[100]"),children:(0,n.jsx)(c.default,{item:s,handleClick:u,isNoteActive:t===r,index:r})},r))}),(0,n.jsx)("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
+ [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),t&&(0,n.jsx)("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>i(null),onKeyDown:s=>s.key==="Escape"&&i(null)})]})};
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/index.tsx"],
4
+ "sourcesContent": ["import 'swiper/css'\nimport 'swiper/css/grid'\nimport 'swiper/css/pagination'\n\nimport { Container, Heading } from '@anker-in/headless-ui'\nimport { useState } from 'react'\nimport { Grid, Pagination } from 'swiper/modules'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nimport BenefitItem, { type BenefitItemCopy } from './benefitItem'\nimport { useCreditsContext } from '../context/provider'\nimport { gaTrack } from '../../../helpers/track'\nimport { cn } from '../../../helpers/utils'\n\ninterface CreditsBenefitsProps {\n copy: {\n title: string\n benefits: BenefitItemCopy[]\n }\n}\n\nexport const CreditsBenefits = ({ copy }: CreditsBenefitsProps) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n\n const handleClick = ({ item, index }: { item: BenefitItemCopy; index: number }) => {\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: copy.title,\n button_name: item.text,\n info: '',\n },\n })\n if (activeNoteIndex === index) {\n setActiveNoteIndex(null)\n } else {\n setActiveNoteIndex(index)\n setTimeout(() => {\n setActiveNoteIndex(null)\n }, 5000)\n }\n }\n\n return (\n <Container id=\"benefits\" className=\"!z-[30] bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy?.title} />\n <div className=\"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch\">\n {copy.benefits.map((item, index) => (\n <BenefitItem\n key={index}\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n ))}\n </div>\n <div className=\"mt-[24px] hidden l:block\">\n <Swiper\n spaceBetween={16}\n slidesPerView={2}\n slidesPerGroup={2}\n grid={{\n rows: 2,\n fill: 'row',\n }}\n breakpoints={{\n 768: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n }}\n wrapperClass=\"!items-stretch\"\n modules={[Grid, Pagination]}\n pagination={{\n clickable: true,\n el: '#benefits-pagination',\n renderBullet(index, className) {\n return `<div class='${className} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>\n </div>`\n },\n }}\n >\n {copy.benefits.map((item, index) => (\n <SwiperSlide key={index} className={cn('!h-auto !flex', activeNoteIndex === index && '!z-[100]')}>\n <BenefitItem\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n <div\n id=\"benefits-pagination\"\n className=\"mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515] \n [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full\"\n ></div>\n </div>\n\n {activeNoteIndex && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setActiveNoteIndex(null)}\n onKeyDown={e => e.key === 'Escape' && setActiveNoteIndex(null)}\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAiDM,IAAAI,EAAA,6BAjDNC,EAAO,sBACPC,EAAO,2BACPC,EAAO,iCAEPC,EAAmC,iCACnCC,EAAyB,iBACzBC,EAAiC,0BACjCD,EAAoC,wBAEpCE,EAAkD,4BAClDC,EAAkC,+BAClCC,EAAwB,kCACxBC,EAAmB,kCASZ,MAAMZ,EAAkB,CAAC,CAAE,KAAAa,CAAK,IAA4B,CACjE,KAAM,CAACC,EAAiBC,CAAkB,KAAI,YAAwB,IAAI,EACpE,CAAE,QAAAC,EAAS,IAAAC,CAAI,KAAI,qBAAkB,EAErCC,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,IACjF,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBJ,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EAAI,UAChB,SAAUJ,EAAK,MACf,YAAaM,EAAK,KAClB,KAAM,EACR,CACF,CAAC,EACGL,IAAoBM,EACtBL,EAAmB,IAAI,GAEvBA,EAAmBK,CAAK,EACxB,WAAW,IAAM,CACfL,EAAmB,IAAI,CACzB,EAAG,GAAI,EAEX,EAEA,SACE,QAAC,aAAU,GAAG,WAAW,UAAU,uBACjC,oBAAC,WAAQ,GAAG,KAAK,KAAK,IAAI,KAAMF,GAAM,MAAO,KAC7C,OAAC,OAAI,UAAU,8EACZ,SAAAA,EAAK,SAAS,IAAI,CAACM,EAAMC,OACxB,OAAC,EAAAC,QAAA,CAEC,KAAMF,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,GAJFA,CAKP,CACD,EACH,KACA,QAAC,OAAI,UAAU,2BACb,oBAAC,UACC,aAAc,GACd,cAAe,EACf,eAAgB,EAChB,KAAM,CACJ,KAAM,EACN,KAAM,KACR,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,eAAgB,CAClB,CACF,EACA,aAAa,iBACb,QAAS,CAAC,OAAM,YAAU,EAC1B,WAAY,CACV,UAAW,GACX,GAAI,uBACJ,aAAaA,EAAOE,EAAW,CAC7B,MAAO,eAAeA,CAAS;AAAA,qBAEjC,CACF,EAEC,SAAAT,EAAK,SAAS,IAAI,CAACM,EAAMC,OACxB,OAAC,eAAwB,aAAW,MAAG,gBAAiBN,IAAoBM,GAAS,UAAU,EAC7F,mBAAC,EAAAC,QAAA,CACC,KAAMF,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACT,GANgBA,CAOlB,CACD,EACH,KACA,OAAC,OACC,GAAG,sBACH,UAAU;AAAA,mGAEX,GACH,EAECN,MACC,OAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMC,EAAmB,IAAI,EACtC,UAAWQ,GAAKA,EAAE,MAAQ,UAAYR,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
6
+ "names": ["creditsBenefits_exports", "__export", "CreditsBenefits", "__toCommonJS", "import_jsx_runtime", "import_css", "import_grid", "import_pagination", "import_headless_ui", "import_react", "import_modules", "import_benefitItem", "import_provider", "import_track", "import_utils", "copy", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "handleClick", "item", "index", "BenefitItem", "className", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var o in e)x(t,o,{get:e[o],enumerable:!0})},F=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of R(e))!k.call(t,l)&&l!==o&&x(t,l,{get:()=>e[l],enumerable:!(c=y(e,l))||c.enumerable});return t};var V=t=>F(x({},"__esModule",{value:!0}),t);var L={};E(L,{default:()=>A});module.exports=V(L);var i=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),p=require("react"),d=require("../../../helpers"),b=require("../context/provider"),h=require("../context/hooks/useRedeemAndBuy"),N=require("../context/utils"),f=require("../../../helpers/track");function z({copy:t,itemData:e,setRules:o,className:c,authCodeActivate:l}){const{creditInfo:v,profile:n,openSignUpPopup:C,gtm:{pageGroup:g}}=(0,b.useCreditsContext)(),{trigger:_,isMutating:S}=(0,h.useRedeemAndBuy)({},{onError:()=>console.log("error")}),s=(0,p.useMemo)(()=>!!n,[n?.activated]),u=(0,p.useMemo)(()=>s&&n?.activated&&e.alpcData?.consumeCredits>Number(v?.available_credit||0),[s,n?.activated,e.alpcData?.consumeCredits,v?.available_credit]),w=(0,p.useMemo)(()=>!!(e.alpcData?.remainingInventory<=0&&e.alpcData?.isLimited||!e.productVariant?.availableForSale||u),[e.alpcData?.remainingInventory,e.alpcData?.isLimited,e.productVariant?.availableForSale,u]),I=()=>{const a=()=>_({productVariant:e?.productVariant,redeemId:e?.config?.redeemId});s?!n?.activated&&!(l.isSendingActivateEmail||l.isSuccess)?(l.openAuthCodePopup(),l.setOnSuccess(a)):(a(),(0,f.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:n?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:m,info:e?.alpcData?.id?.toString()}})):C()},m=(0,p.useMemo)(()=>e.productVariant?.availableForSale?s?t.btnRedeem:t.unlockRewards:t?.soldOut||"Sold Out",[s,e.productVariant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return(0,i.jsxs)("div",{className:(0,d.cn)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",c),children:[(0,i.jsx)("div",{className:(0,d.cn)("relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]"),children:(0,i.jsx)(r.Picture,{className:"mx-auto h-full w-auto",imgClassName:"h-full object-contain",source:e?.config?.image?.url||e?.productVariant?.metafields?.global?.transparentImg||e?.productVariant?.image?.url})}),(0,i.jsxs)("div",{className:(0,d.cn)("mt-[22px] w-full l:mt-[8px]"),children:[(0,i.jsx)(r.Text,{html:e?.product?.title,title:e.config?.title||e.alpcData?.title||e.product?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:line-clamp-3 l:h-[56px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e?.config?.rules?.split("<br>")?.length>0&&(0,i.jsx)("button",{type:"button",onClick:()=>{o(e?.config?.rules?.split("<br>")),(0,f.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:n?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:t?.ruleLabel,info:e?.alpcData?.id?.toString()}})},className:"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},children:t?.ruleLabel}),(0,i.jsxs)("div",{className:"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]",children:[(0,i.jsx)(r.Picture,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,i.jsx)(r.Text,{html:`${(0,N.numberFormat)(e?.alpcData?.consumeCredits)} + ${e?.config?.price}`,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,i.jsxs)("div",{className:"group relative w-full",children:[(0,i.jsx)(r.Button,{disabled:w,variant:"primary",size:"lg",className:"mt-[8px] md:px-[10px] l:w-full",loading:S,onClick:()=>{I()},title:u?"Insufficient credit":m,children:m}),(0,i.jsx)("div",{className:(0,d.cn)("absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]",u?"block":"hidden"),children:(0,i.jsxs)("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]",children:[(0,i.jsx)(r.Text,{as:"p",size:"2",html:t?.insufficientCredits,className:"text-[14px]"}),(0,i.jsx)("div",{className:"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]})]})}var A=z;
2
+ //# sourceMappingURL=RedeemableItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/RedeemableItem.tsx"],
4
+ "sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\nimport { useMemo } from 'react'\nimport { cn } from '../../../helpers'\n\nimport { CreditsCashCopy, RedeemItem } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemAndBuy } from '../context/hooks/useRedeemAndBuy'\nimport { numberFormat } from '../context/utils'\nimport { gaTrack } from '../../../helpers/track'\n\nfunction RedeemableItem({\n copy,\n itemData,\n setRules,\n className,\n authCodeActivate,\n}: {\n copy: CreditsCashCopy\n itemData: RedeemItem\n className?: string\n setRules: (rules: string[]) => void\n currencyCode: string\n authCodeActivate: {\n openAuthCodePopup: Function\n isSuccess: boolean\n setOnSuccess: (arg: Function) => void\n isSendingActivateEmail: boolean\n }\n}) {\n const {\n creditInfo,\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const { trigger, isMutating } = useRedeemAndBuy(\n {},\n {\n onError: () => console.log('error'),\n }\n )\n\n const isLogin = useMemo(() => {\n return !!profile\n }, [profile?.activated])\n\n const inSufficientCredit = useMemo(() => {\n return (\n isLogin && profile?.activated && itemData.alpcData?.consumeCredits > Number(creditInfo?.available_credit || 0)\n )\n }, [isLogin, profile?.activated, itemData.alpcData?.consumeCredits, creditInfo?.available_credit])\n\n const isDisabled = useMemo(() => {\n // \u5151\u6362\u9650\u5236\n if (itemData.alpcData?.remainingInventory <= 0 && itemData.alpcData?.isLimited) {\n return true\n }\n\n // \u5546\u54C1\u5E93\u5B58\u9650\u5236\n if (!itemData.productVariant?.availableForSale) {\n return true\n }\n\n // \u79EF\u5206\u4E0D\u8DB3\n if (inSufficientCredit) {\n return true\n }\n return false\n }, [\n itemData.alpcData?.remainingInventory,\n itemData.alpcData?.isLimited,\n itemData.productVariant?.availableForSale,\n inSufficientCredit,\n ])\n\n const handleRedeem = () => {\n const buyNow = () =>\n trigger({\n productVariant: itemData?.productVariant,\n redeemId: itemData?.config?.redeemId,\n })\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !(authCodeActivate.isSendingActivateEmail || authCodeActivate.isSuccess)) {\n authCodeActivate.openAuthCodePopup()\n authCodeActivate.setOnSuccess(buyNow)\n } else {\n buyNow()\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: itemData?.alpcData?.id?.toString(),\n },\n })\n }\n }\n\n const redeemButtonText = useMemo(() => {\n // \u7F3A\u8D27\u6587\u6848\n if (!itemData.productVariant?.availableForSale) {\n return copy?.soldOut || 'Sold Out'\n } else if (!isLogin) {\n return copy.unlockRewards\n } else {\n return copy.btnRedeem\n }\n }, [isLogin, itemData.productVariant?.availableForSale, copy.btnRedeem, copy.unlockRewards, copy?.soldOut])\n\n return (\n <div\n className={cn(\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 <div className={cn('relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"mx-auto h-full w-auto\"\n imgClassName=\"h-full object-contain\"\n source={\n itemData?.config?.image?.url ||\n itemData?.productVariant?.metafields?.global?.transparentImg ||\n itemData?.productVariant?.image?.url\n }\n ></Picture>\n </div>\n <div className={cn('mt-[22px] w-full l:mt-[8px]')}>\n <Text\n html={itemData?.product?.title}\n title={itemData.config?.title || itemData.alpcData?.title || itemData.product?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:line-clamp-3 l:h-[56px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {itemData?.config?.rules?.split('<br>')?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n setRules(itemData?.config?.rules?.split('<br>'))\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: itemData?.alpcData?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]\"\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 className=\"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]\">\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(itemData?.alpcData?.consumeCredits)} + ${itemData?.config?.price}`}\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 <div className=\"group relative w-full\">\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[10px] l:w-full\"\n loading={isMutating}\n onClick={() => {\n handleRedeem()\n }}\n title={inSufficientCredit ? 'Insufficient credit' : redeemButtonText}\n >\n {redeemButtonText}\n </Button>\n <div\n className={cn(\n 'absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]',\n inSufficientCredit ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]\">\n <Text as=\"p\" size=\"2\" html={copy?.insufficientCredits} className=\"text-[14px]\" />\n <div className=\"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default RedeemableItem\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyHQ,IAAAI,EAAA,6BAzHRC,EAAsC,iCACtCC,EAAwB,iBACxBC,EAAmB,4BAGnBC,EAAkC,+BAClCC,EAAgC,4CAChCC,EAA6B,4BAC7BC,EAAwB,kCAExB,SAASC,EAAe,CACtB,KAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,iBAAAC,CACF,EAYG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,KAAI,qBAAkB,EAChB,CAAE,QAAAC,EAAS,WAAAC,CAAW,KAAI,mBAC9B,CAAC,EACD,CACE,QAAS,IAAM,QAAQ,IAAI,OAAO,CACpC,CACF,EAEMC,KAAU,WAAQ,IACf,CAAC,CAACL,EACR,CAACA,GAAS,SAAS,CAAC,EAEjBM,KAAqB,WAAQ,IAE/BD,GAAWL,GAAS,WAAaL,EAAS,UAAU,eAAiB,OAAOI,GAAY,kBAAoB,CAAC,EAE9G,CAACM,EAASL,GAAS,UAAWL,EAAS,UAAU,eAAgBI,GAAY,gBAAgB,CAAC,EAE3FQ,KAAa,WAAQ,IAErB,GAAAZ,EAAS,UAAU,oBAAsB,GAAKA,EAAS,UAAU,WAKjE,CAACA,EAAS,gBAAgB,kBAK1BW,GAIH,CACDX,EAAS,UAAU,mBACnBA,EAAS,UAAU,UACnBA,EAAS,gBAAgB,iBACzBW,CACF,CAAC,EAEKE,EAAe,IAAM,CACzB,MAAMC,EAAS,IACbN,EAAQ,CACN,eAAgBR,GAAU,eAC1B,SAAUA,GAAU,QAAQ,QAC9B,CAAC,EACEU,EAEM,CAACL,GAAS,WAAa,EAAEF,EAAiB,wBAA0BA,EAAiB,YAC9FA,EAAiB,kBAAkB,EACnCA,EAAiB,aAAaW,CAAM,IAEpCA,EAAO,KACP,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBT,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYE,EACZ,SAAUR,EAAK,MACf,YAAagB,EACb,KAAMf,GAAU,UAAU,IAAI,SAAS,CACzC,CACF,CAAC,GAhBDM,EAAgB,CAkBpB,EAEMS,KAAmB,WAAQ,IAE1Bf,EAAS,gBAAgB,iBAElBU,EAGHX,EAAK,UAFLA,EAAK,cAFLA,GAAM,SAAW,WAMzB,CAACW,EAASV,EAAS,gBAAgB,iBAAkBD,EAAK,UAAWA,EAAK,cAAeA,GAAM,OAAO,CAAC,EAE1G,SACE,QAAC,OACC,aAAW,MACT,6HACAG,CACF,EAEA,oBAAC,OAAI,aAAW,MAAG,8DAA8D,EAC/E,mBAAC,WACC,UAAU,wBACV,aAAa,wBACb,OACEF,GAAU,QAAQ,OAAO,KACzBA,GAAU,gBAAgB,YAAY,QAAQ,gBAC9CA,GAAU,gBAAgB,OAAO,IAEpC,EACH,KACA,QAAC,OAAI,aAAW,MAAG,6BAA6B,EAC9C,oBAAC,QACC,KAAMA,GAAU,SAAS,MACzB,MAAOA,EAAS,QAAQ,OAASA,EAAS,UAAU,OAASA,EAAS,SAAS,MAC/E,KAAM,EACN,UAAU,2HACZ,EACCA,GAAU,QAAQ,OAAO,MAAM,MAAM,GAAG,OAAS,MAChD,OAAC,UACC,KAAK,SACL,QAAS,IAAM,CACbC,EAASD,GAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,KAC/C,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBK,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYE,EACZ,SAAUR,EAAK,MACf,YAAaA,GAAM,UACnB,KAAMC,GAAU,UAAU,IAAI,SAAS,CACzC,CACF,CAAC,CACH,EACA,UAAU,2DACV,SAAU,EACV,UAAWgB,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAjB,GAAM,UACT,KAEF,QAAC,OAAI,UAAU,oFACb,oBAAC,WACC,UAAU,cACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaC,GAAU,UAAU,cAAc,CAAC,MAAMA,GAAU,QAAQ,KAAK,GACtF,KAAM,EACN,GAAG,IACH,UAAU,kGACZ,GACF,KAEA,QAAC,OAAI,UAAU,wBACb,oBAAC,UACC,SAAUY,EACV,QAAQ,UACR,KAAK,KACL,UAAU,iCACV,QAASH,EACT,QAAS,IAAM,CACbI,EAAa,CACf,EACA,MAAOF,EAAqB,sBAAwBI,EAEnD,SAAAA,EACH,KACA,OAAC,OACC,aAAW,MACT,qJACAJ,EAAqB,QAAU,QACjC,EAEA,oBAAC,OAAI,UAAU,mHACb,oBAAC,QAAK,GAAG,IAAI,KAAK,IAAI,KAAMZ,GAAM,oBAAqB,UAAU,cAAc,KAC/E,OAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GACF,GACF,CAEJ,CAEA,IAAOX,EAAQU",
6
+ "names": ["RedeemableItem_exports", "__export", "RedeemableItem_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_helpers", "import_provider", "import_useRedeemAndBuy", "import_utils", "import_track", "RedeemableItem", "copy", "itemData", "setRules", "className", "authCodeActivate", "creditInfo", "profile", "openSignUpPopup", "pageGroup", "trigger", "isMutating", "isLogin", "inSufficientCredit", "isDisabled", "handleRedeem", "buyNow", "redeemButtonText", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var k=Object.create;var l=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var s in t)l(e,s,{get:t[s],enumerable:!0})},v=(e,t,s,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D(t))!P.call(e,i)&&i!==s&&l(e,i,{get:()=>t[i],enumerable:!(m=A(t,i))||m.enumerable});return e};var f=(e,t,s)=>(s=e!=null?k(L(e)):{},v(t||!e||!e.__esModule?l(s,"default",{value:e,enumerable:!0}):s,e)),H=e=>v(l({},"__esModule",{value:!0}),e);var B={};_(B,{CreditsCash:()=>M});module.exports=H(B);var r=require("react/jsx-runtime"),c=require("@anker-in/headless-ui"),u=require("react"),y=f(require("./RedeemableItem")),x=f(require("../context/hooks/useRedeemableList")),N=require("../../../helpers"),I=f(require("../modal/rulesModal")),R=require("@anker-in/lib");const M=({copy:e,className:t="",hideTitle:s=!1,cardClassName:m,authCodeActivate:i})=>{const[p,g]=(0,u.useState)(),{redeemableList:h}=(0,x.default)(),S="us",F=[],{data:C}=(0,R.useProductsByHandles)({locale:S,handles:e?.list?.map(a=>a.products?.[0]?.handle)||[],metafieldIdentifiers:{variant:F}}),b=(0,u.useMemo)(()=>C?.map(a=>{const o=e.list.find(d=>d.products?.[0]?.handle===a.handle),n=h.find(d=>d.id?.toString()===o?.redeemId?.toString());return{product:a,productVariant:a.variants?.find(d=>d.sku===o?.products?.[0]?.sku)||a.variants?.[0],alpcData:{id:n?.id,consumeCredits:n?.consume_credits,remainingInventory:n?.remaining_inventory,isLimited:n?.is_limited,consumeType:n?.consume_type,title:n?.name,desc:n?.note},config:o}}),[C,e.list,h]);return console.log("list",b),(0,r.jsxs)(c.Container,{className:(0,N.cn)("bg-[#F5F5F5]",t),children:[!s&&(0,r.jsx)(c.Heading,{as:"h2",size:"4",html:e.title}),(0,r.jsx)("div",{className:"relative mt-[24px] grid grid-cols-4 gap-[16px] md:grid-cols-2 md-xl:grid-cols-3",children:b?.map((a,o)=>(0,r.jsx)(y.default,{copy:e,itemData:a,setRules:g,className:m,currencyCode:C?.[0]?.price.currencyCode||"USD",authCodeActivate:i},o))}),p&&(0,r.jsx)(I.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:p.length>0,onClose:()=>g([]),titleClassName:"border-b-transparent h-[56px]",rules:p,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:e?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/index.tsx"],
4
+ "sourcesContent": ["import { Container, Heading } from '@anker-in/headless-ui'\nimport { useMemo, useState } from 'react'\n\nimport RedeemableItem from './RedeemableItem'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { cn } from '../../../helpers'\nimport RulesModal from '../modal/rulesModal'\nimport { useProductsByHandles } from '@anker-in/lib'\nimport { CreditsCashCopy, RedeemItem } from './type'\nimport { Product } from '@anker-in/lib'\n\nexport const CreditsCash = ({\n copy,\n className = '',\n hideTitle = false,\n cardClassName,\n authCodeActivate,\n}: {\n copy: CreditsCashCopy\n className?: string\n hideTitle?: boolean\n cardClassName?: string\n authCodeActivate: {\n openAuthCodePopup: Function\n isSuccess: boolean\n setOnSuccess: (arg: Function) => void\n isSendingActivateEmail: boolean\n }\n}) => {\n const [rules, setRules] = useState<string | string[]>()\n const { redeemableList } = useRedeemableList()\n\n // Temporary variables until proper configuration\n const locale = 'us'\n const variantMetafieldIdentifiers: any[] = []\n\n const { data: productByHandles } = useProductsByHandles({\n locale,\n handles: copy?.list?.map(item => item.products?.[0]?.handle) || [],\n metafieldIdentifiers: {\n variant: variantMetafieldIdentifiers,\n },\n })\n\n const list = useMemo(() => {\n return productByHandles?.map((product: Product) => {\n const config = copy.list.find(item => item.products?.[0]?.handle === product.handle)\n const alpcData = redeemableList.find(item => item.id?.toString() === config?.redeemId?.toString())\n\n return {\n product,\n productVariant:\n product.variants?.find((variant: any) => variant.sku === config?.products?.[0]?.sku) || product.variants?.[0],\n alpcData: {\n id: alpcData?.id,\n consumeCredits: alpcData?.consume_credits,\n remainingInventory: alpcData?.remaining_inventory,\n isLimited: alpcData?.is_limited,\n consumeType: alpcData?.consume_type,\n title: alpcData?.name,\n desc: alpcData?.note,\n },\n config,\n }\n }) as unknown as RedeemItem[]\n }, [productByHandles, copy.list, redeemableList])\n\n console.log('list', list)\n\n return (\n <Container className={cn('bg-[#F5F5F5]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n <div className=\"relative mt-[24px] grid grid-cols-4 gap-[16px] md:grid-cols-2 md-xl:grid-cols-3\">\n {list?.map((item, index: number) => (\n <RedeemableItem\n key={index}\n copy={copy}\n itemData={item}\n setRules={setRules}\n className={cardClassName}\n currencyCode={productByHandles?.[0]?.price.currencyCode || 'USD'}\n authCodeActivate={authCodeActivate}\n />\n ))}\n </div>\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}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAsEI,IAAAI,EAAA,6BAtEJC,EAAmC,iCACnCC,EAAkC,iBAElCC,EAA2B,+BAC3BC,EAA8B,iDAC9BC,EAAmB,4BACnBC,EAAuB,kCACvBC,EAAqC,yBAI9B,MAAMT,EAAc,CAAC,CAC1B,KAAAU,EACA,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,cAAAC,EACA,iBAAAC,CACF,IAWM,CACJ,KAAM,CAACC,EAAOC,CAAQ,KAAI,YAA4B,EAChD,CAAE,eAAAC,CAAe,KAAI,EAAAC,SAAkB,EAGvCC,EAAS,KACTC,EAAqC,CAAC,EAEtC,CAAE,KAAMC,CAAiB,KAAI,wBAAqB,CACtD,OAAAF,EACA,QAAST,GAAM,MAAM,IAAIY,GAAQA,EAAK,WAAW,CAAC,GAAG,MAAM,GAAK,CAAC,EACjE,qBAAsB,CACpB,QAASF,CACX,CACF,CAAC,EAEKG,KAAO,WAAQ,IACZF,GAAkB,IAAKG,GAAqB,CACjD,MAAMC,EAASf,EAAK,KAAK,KAAKY,GAAQA,EAAK,WAAW,CAAC,GAAG,SAAWE,EAAQ,MAAM,EAC7EE,EAAWT,EAAe,KAAKK,GAAQA,EAAK,IAAI,SAAS,IAAMG,GAAQ,UAAU,SAAS,CAAC,EAEjG,MAAO,CACL,QAAAD,EACA,eACEA,EAAQ,UAAU,KAAMG,GAAiBA,EAAQ,MAAQF,GAAQ,WAAW,CAAC,GAAG,GAAG,GAAKD,EAAQ,WAAW,CAAC,EAC9G,SAAU,CACR,GAAIE,GAAU,GACd,eAAgBA,GAAU,gBAC1B,mBAAoBA,GAAU,oBAC9B,UAAWA,GAAU,WACrB,YAAaA,GAAU,aACvB,MAAOA,GAAU,KACjB,KAAMA,GAAU,IAClB,EACA,OAAAD,CACF,CACF,CAAC,EACA,CAACJ,EAAkBX,EAAK,KAAMO,CAAc,CAAC,EAEhD,eAAQ,IAAI,OAAQM,CAAI,KAGtB,QAAC,aAAU,aAAW,MAAG,eAAgBZ,CAAS,EAC/C,WAACC,MAAa,OAAC,WAAQ,GAAG,KAAK,KAAK,IAAI,KAAMF,EAAK,MAAO,KAC3D,OAAC,OAAI,UAAU,kFACZ,SAAAa,GAAM,IAAI,CAACD,EAAMM,OAChB,OAAC,EAAAC,QAAA,CAEC,KAAMnB,EACN,SAAUY,EACV,SAAUN,EACV,UAAWH,EACX,aAAcQ,IAAmB,CAAC,GAAG,MAAM,cAAgB,MAC3D,iBAAkBP,GANbc,CAOP,CACD,EACH,EAECb,MACC,OAAC,EAAAe,QAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQf,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOL,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
6
+ "names": ["creditsCash_exports", "__export", "CreditsCash", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_RedeemableItem", "import_useRedeemableList", "import_helpers", "import_rulesModal", "import_lib", "copy", "className", "hideTitle", "cardClassName", "authCodeActivate", "rules", "setRules", "redeemableList", "useRedeemableList", "locale", "variantMetafieldIdentifiers", "productByHandles", "item", "list", "product", "config", "alpcData", "variant", "index", "RedeemableItem", "RulesModal"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var g=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!m.call(t,r)&&r!==s&&n(t,r,{get:()=>e[r],enumerable:!(i=o(e,r))||i.enumerable});return t};var u=t=>g(n({},"__esModule",{value:!0}),t);var a={};module.exports=u(a);
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsCash/type.ts"],
4
+ "sourcesContent": ["import { ProductVariant, Product } from '@anker-in/lib'\nimport { AlpcConsumeType } from '../context/const'\n\ntype RedeemableItemConfig = {\n title: string\n desc: string\n price: string\n credit: string\n rules: string\n image: {\n url: string\n }\n mobileImage: {\n url: string\n }\n redeemId: number\n}\n\nexport type CreditsCashCopy = {\n title: string\n list: (RedeemableItemConfig & {\n products: { handle: string; sku: string }[]\n })[]\n soldOut: string\n ruleLabel: string\n unlockRewards: string\n btnRedeem: string\n off: string\n insufficientCredits: string\n}\n\nexport type RedeemItem = {\n product: Product\n productVariant: ProductVariant\n alpcData: {\n id: number\n consumeCredits: number\n remainingInventory: number\n isLimited: boolean\n consumeType: AlpcConsumeType.Product\n showCredit: boolean\n title: string\n desc: string\n }\n config: RedeemableItemConfig\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["type_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var o in e)m(t,o,{get:e[o],enumerable:!0})},y=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!h.call(t,a)&&a!==o&&m(t,a,{get:()=>e[a],enumerable:!(i=u(e,a))||i.enumerable});return t};var N=t=>y(m({},"__esModule",{value:!0}),t);var k={};g(k,{FaqItem:()=>D});module.exports=N(k);var r=require("react/jsx-runtime"),d=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),n=require("../../../../helpers/index"),b=require("framer-motion"),l=require("react");const D=({index:t,question:e,answer:o,showDots:i,itemRightIconRender:a,defaultExpended:c=!1})=>{const[p,x]=(0,l.useState)(c);return(0,l.useEffect)(()=>{t==0&&x(!0),e||x(!0)},[t,e]),(0,r.jsxs)("div",{className:(0,n.cn)("relative mx-0 border-b-[1px] border-[#e4e5e6] py-[24px] l:py-[16px]"),children:[(0,r.jsxs)("div",{className:"relative flex items-center",onClick:()=>{x(!p)},role:"button",tabIndex:0,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&s.preventDefault()},children:[(0,r.jsx)(d.Heading,{html:e,as:"h3",className:(0,n.cn)(i?'before:absolute before:left-[-15px] before:top-[8px] before:h-[6px] before:w-[6px] before:rounded-[50%] before:bg-[#000] before:content-[""]':"","relative block flex-1 cursor-pointer pr-[10px] text-[18px] font-bold text-[#1D1D1F] l:text-[16px]")}),a?a({expanded:p}):(0,r.jsx)(f.ChevronDownIcon,{className:(0,n.cn)("size-[16px] shrink-0 cursor-pointer stroke-[2.5px] transition-all",p?"rotate-180":"")})]}),(0,r.jsx)(b.motion.div,{initial:!1,animate:{height:p?"auto":0},className:"overflow-hidden [&_td]:border [&_td]:border-[#333] [&_td]:px-[8px] [&_td]:py-[4px]",children:o?.toString()?.includes("https://www.youtube.com")?(0,r.jsx)(d.Text,{as:"div",className:(0,n.cn)("mt-[8px]"),"data-ratio":"16:9","data-content":o,html:o?.toString()}):(0,r.jsx)(d.Text,{as:"div",html:o?.toString(),className:(0,n.cn)("mt-[8px] text-[16px] font-bold leading-[1.5] text-[#3D3D3F] l:text-[14px] [&_a]:text-brand [&_a]:underline")})})]},t)};
2
+ //# sourceMappingURL=FaqItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/creditsFaq/faqItem/FaqItem.tsx"],
4
+ "sourcesContent": ["import { Heading, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon } from '@heroicons/react/24/outline'\nimport { cn } from '../../../../helpers/index'\nimport { motion } from 'framer-motion'\nimport { type ReactNode, useEffect, useState } from 'react'\n\ntype FaqItemProps = {\n index: number\n question?: string\n answer?: string | number\n showDots: boolean\n itemRightIconRender?: ({ expanded }: { expanded: boolean }) => ReactNode\n defaultExpended?: boolean\n}\n\nexport const FaqItem = ({\n index,\n question,\n answer,\n showDots,\n itemRightIconRender,\n defaultExpended = false,\n}: FaqItemProps) => {\n const [expanded, setExpanded] = useState(defaultExpended)\n useEffect(() => {\n if (index == 0) {\n setExpanded(true)\n }\n if (!question) {\n setExpanded(true)\n }\n }, [index, question])\n\n return (\n <div key={index} className={cn('relative mx-0 border-b-[1px] border-[#e4e5e6] py-[24px] l:py-[16px]')}>\n <div\n className='relative flex items-center'\n onClick={() => {\n setExpanded(!expanded)\n }}\n role='button'\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n <Heading\n html={question}\n as='h3'\n className={cn(\n showDots\n ? 'before:absolute before:left-[-15px] before:top-[8px] before:h-[6px] before:w-[6px] before:rounded-[50%] before:bg-[#000] before:content-[\"\"]'\n : '',\n 'relative block flex-1 cursor-pointer pr-[10px] text-[18px] font-bold text-[#1D1D1F] l:text-[16px]',\n )}\n ></Heading>\n {itemRightIconRender ? (\n itemRightIconRender({ expanded })\n ) : (\n <ChevronDownIcon\n className={cn(\n 'size-[16px] shrink-0 cursor-pointer stroke-[2.5px] transition-all',\n expanded ? 'rotate-180' : '',\n )}\n />\n )}\n </div>\n <motion.div\n initial={false}\n animate={{ height: !expanded ? 0 : 'auto' }}\n className='overflow-hidden [&_td]:border [&_td]:border-[#333] [&_td]:px-[8px] [&_td]:py-[4px]'\n >\n {answer?.toString()?.includes('https://www.youtube.com') ? (\n <Text\n as='div'\n className={cn('mt-[8px]')}\n data-ratio='16:9'\n data-content={answer}\n html={answer?.toString()}\n ></Text>\n ) : (\n <Text\n as='div'\n html={answer?.toString()}\n className={cn(\n 'mt-[8px] text-[16px] font-bold leading-[1.5] text-[#3D3D3F] l:text-[14px] [&_a]:text-brand [&_a]:underline',\n )}\n ></Text>\n )}\n </motion.div>\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmCM,IAAAI,EAAA,6BAnCNC,EAA8B,iCAC9BC,EAAgC,uCAChCC,EAAmB,qCACnBC,EAAuB,yBACvBC,EAAoD,iBAW7C,MAAMP,EAAU,CAAC,CACtB,MAAAQ,EACA,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,oBAAAC,EACA,gBAAAC,EAAkB,EACpB,IAAoB,CAClB,KAAM,CAACC,EAAUC,CAAW,KAAI,YAASF,CAAe,EACxD,sBAAU,IAAM,CACVL,GAAS,GACXO,EAAY,EAAI,EAEbN,GACHM,EAAY,EAAI,CAEpB,EAAG,CAACP,EAAOC,CAAQ,CAAC,KAGlB,QAAC,OAAgB,aAAW,MAAG,sEAAsE,EACnG,qBAAC,OACC,UAAU,6BACV,QAAS,IAAM,CACbM,EAAY,CAACD,CAAQ,CACvB,EACA,KAAK,SACL,SAAU,EACV,UAAYE,GAAM,EACZA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEA,oBAAC,WACC,KAAMP,EACN,GAAG,KACH,aAAW,MACTE,EACI,+IACA,GACJ,mGACF,EACD,EACAC,EACCA,EAAoB,CAAE,SAAAE,CAAS,CAAC,KAEhC,OAAC,mBACC,aAAW,MACT,oEACAA,EAAW,aAAe,EAC5B,EACF,GAEJ,KACA,OAAC,SAAO,IAAP,CACC,QAAS,GACT,QAAS,CAAE,OAASA,EAAe,OAAJ,CAAW,EAC1C,UAAU,qFAET,SAAAJ,GAAQ,SAAS,GAAG,SAAS,yBAAyB,KACrD,OAAC,QACC,GAAG,MACH,aAAW,MAAG,UAAU,EACxB,aAAW,OACX,eAAcA,EACd,KAAMA,GAAQ,SAAS,EACxB,KAED,OAAC,QACC,GAAG,MACH,KAAMA,GAAQ,SAAS,EACvB,aAAW,MACT,4GACF,EACD,EAEL,IAzDQF,CA0DV,CAEJ",
6
+ "names": ["FaqItem_exports", "__export", "FaqItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_helpers", "import_framer_motion", "import_react", "index", "question", "answer", "showDots", "itemRightIconRender", "defaultExpended", "expanded", "setExpanded", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var f=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var h=(e,s)=>{for(var r in s)f(e,r,{get:s[r],enumerable:!0})},q=(e,s,r,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let l of d(s))!T.call(e,l)&&l!==r&&f(e,l,{get:()=>s[l],enumerable:!(i=c(s,l))||i.enumerable});return e};var v=e=>q(f({},"__esModule",{value:!0}),e);var F={};h(F,{CreditsFaq:()=>w});module.exports=v(F);var a=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),u=require("../../../helpers/index"),o=require("react"),b=require("./faqItem/FaqItem");const w=({copy:e})=>{const{title:s,items:r,subTitle:i=""}=e||{},l=(0,o.useMemo)(()=>Array.from(new Set(r?.map?.(t=>t.category_name).filter(t=>!!t))),[r]),[g,p]=(0,o.useState)(l[0]?.toString()||""),x=(0,o.useMemo)(()=>r?l.length?r.filter(t=>t?.category_name===g):r:[],[r,l.length,g]);return(0,a.jsxs)(n.Container,{className:"bg-[#F5F5F7]",id:"faq",children:[s&&(0,a.jsx)(n.Heading,{as:"h2",size:"4",html:e?.title}),i&&(0,a.jsx)("div",{className:"mt-[8px] flex flex-row",children:(0,a.jsx)(n.Text,{size:"4",as:"p",html:i,className:"flex-1"})}),(0,a.jsx)(n.Tabs,{align:"left",shape:"rounded",className:"mt-[24px]",value:g.toString(),onValueChange:t=>{p(t)},children:(0,a.jsx)(n.TabsList,{children:l.map((t,m)=>(0,a.jsx)(n.TabsTrigger,{value:t?.toString()||"",children:t},m))})}),(0,a.jsx)("div",{className:(0,u.cn)("mt-[24px] flex flex-col overflow-auto pt-0"),children:x?.map((t,m)=>(0,a.jsx)(b.FaqItem,{index:m,defaultExpended:r.length===1,question:t.question,answer:t.answer,showDots:!1},m))}),e.learnMore?.link&&e.learnMore?.label&&(0,a.jsx)("a",{href:e.learnMore?.link,target:"_blank",className:"mt-[64px] block w-full text-center text-[18px] font-bold text-brand hover:underline l:text-[16px]",children:e.learnMore?.label})]})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsFaq/index.tsx"],
4
+ "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger, Text } from '@anker-in/headless-ui'\nimport { cn } from '../../../helpers/index'\nimport { useMemo, useState } from 'react'\n\nimport { FaqItem } from './faqItem/FaqItem'\n\nexport type FaqCopy = {\n title: string\n subTitle: string\n learnMore: {\n link: string\n label: string\n }\n items: {\n category_name: string\n question: string\n answer: string\n }[]\n}\nexport const CreditsFaq = ({ copy }: { copy: FaqCopy }) => {\n const { title, items: faqList, subTitle = '' } = copy || {}\n const categoryList = useMemo(() => {\n return Array.from(new Set(faqList?.map?.(faq => faq.category_name).filter(item => !!item)))\n }, [faqList])\n const [activeTab, setActiveTab] = useState<string>(categoryList[0]?.toString() || '')\n\n const currentList = useMemo(() => {\n if (!faqList) return []\n if (categoryList.length) {\n return faqList.filter(item => item?.category_name === activeTab)\n }\n return faqList\n }, [faqList, categoryList.length, activeTab])\n\n return (\n <Container className=\"bg-[#F5F5F7]\" id=\"faq\">\n {title && <Heading as=\"h2\" size=\"4\" html={copy?.title} />}\n {subTitle && (\n <div className=\"mt-[8px] flex flex-row\">\n <Text size=\"4\" as=\"p\" html={subTitle} className=\"flex-1\" />\n </div>\n )}\n {/* faq-nav */}\n <Tabs\n align=\"left\"\n shape=\"rounded\"\n className=\"mt-[24px]\"\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n }}\n >\n <TabsList>\n {categoryList.map((item, index) => (\n <TabsTrigger key={index} value={item?.toString() || ''}>\n {item}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n <div className={cn('mt-[24px] flex flex-col overflow-auto pt-0')}>\n {currentList?.map((item, index) => {\n return (\n <FaqItem\n key={index}\n index={index}\n defaultExpended={faqList.length === 1}\n question={item.question}\n answer={item.answer}\n showDots={false}\n ></FaqItem>\n )\n })}\n </div>\n {copy.learnMore?.link && copy.learnMore?.label && (\n <a\n href={copy.learnMore?.link}\n target=\"_blank\"\n className=\"mt-[64px] block w-full text-center text-[18px] font-bold text-brand hover:underline l:text-[16px]\"\n >\n {copy.learnMore?.label}\n </a>\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAmCI,IAAAI,EAAA,6BAnCJC,EAAsE,iCACtEC,EAAmB,kCACnBC,EAAkC,iBAElCC,EAAwB,6BAejB,MAAMN,EAAa,CAAC,CAAE,KAAAO,CAAK,IAAyB,CACzD,KAAM,CAAE,MAAAC,EAAO,MAAOC,EAAS,SAAAC,EAAW,EAAG,EAAIH,GAAQ,CAAC,EACpDI,KAAe,WAAQ,IACpB,MAAM,KAAK,IAAI,IAAIF,GAAS,MAAMG,GAAOA,EAAI,aAAa,EAAE,OAAOC,GAAQ,CAAC,CAACA,CAAI,CAAC,CAAC,EACzF,CAACJ,CAAO,CAAC,EACN,CAACK,EAAWC,CAAY,KAAI,YAAiBJ,EAAa,CAAC,GAAG,SAAS,GAAK,EAAE,EAE9EK,KAAc,WAAQ,IACrBP,EACDE,EAAa,OACRF,EAAQ,OAAOI,GAAQA,GAAM,gBAAkBC,CAAS,EAE1DL,EAJc,CAAC,EAKrB,CAACA,EAASE,EAAa,OAAQG,CAAS,CAAC,EAE5C,SACE,QAAC,aAAU,UAAU,eAAe,GAAG,MACpC,UAAAN,MAAS,OAAC,WAAQ,GAAG,KAAK,KAAK,IAAI,KAAMD,GAAM,MAAO,EACtDG,MACC,OAAC,OAAI,UAAU,yBACb,mBAAC,QAAK,KAAK,IAAI,GAAG,IAAI,KAAMA,EAAU,UAAU,SAAS,EAC3D,KAGF,OAAC,QACC,MAAM,OACN,MAAM,UACN,UAAU,YACV,MAAOI,EAAU,SAAS,EAC1B,cAAeG,GAAS,CACtBF,EAAaE,CAAK,CACpB,EAEA,mBAAC,YACE,SAAAN,EAAa,IAAI,CAACE,EAAMK,OACvB,OAAC,eAAwB,MAAOL,GAAM,SAAS,GAAK,GACjD,SAAAA,GADeK,CAElB,CACD,EACH,EACF,KACA,OAAC,OAAI,aAAW,MAAG,4CAA4C,EAC5D,SAAAF,GAAa,IAAI,CAACH,EAAMK,OAErB,OAAC,WAEC,MAAOA,EACP,gBAAiBT,EAAQ,SAAW,EACpC,SAAUI,EAAK,SACf,OAAQA,EAAK,OACb,SAAU,IALLK,CAMN,CAEJ,EACH,EACCX,EAAK,WAAW,MAAQA,EAAK,WAAW,UACvC,OAAC,KACC,KAAMA,EAAK,WAAW,KACtB,OAAO,SACP,UAAU,oGAET,SAAAA,EAAK,WAAW,MACnB,GAEJ,CAEJ",
6
+ "names": ["creditsFaq_exports", "__export", "CreditsFaq", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_helpers", "import_react", "import_FaqItem", "copy", "title", "faqList", "subTitle", "categoryList", "faq", "item", "activeTab", "setActiveTab", "currentList", "value", "index"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var k=Object.create;var d=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var z=(e,i)=>{for(var s in i)d(e,s,{get:i[s],enumerable:!0})},b=(e,i,s,p)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of h(i))!A.call(e,o)&&o!==s&&d(e,o,{get:()=>i[o],enumerable:!(p=M(i,o))||p.enumerable});return e};var g=(e,i,s)=>(s=e!=null?k(R(e)):{},b(i||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e)),I=e=>b(d({},"__esModule",{value:!0}),e);var S={};z(S,{CreditsInfoCard:()=>B});module.exports=I(S);var t=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),n=require("react"),u=require("../context/provider"),l=require("../../../helpers"),f=require("../context/utils"),y=g(require("../modal/activitiesModal")),w=g(require("../modal/MyRewardsModal")),N=require("../../../helpers/track");function B({data:e}){const[i,s]=(0,n.useState)(!1),[p,o]=(0,n.useState)(!1),[c,m]=(0,n.useState)(!1),C=(0,n.useCallback)(a=>{if((0,N.gaNormalClick)({position:"info_card",label:a.text}),a.type)switch(a.type){case"activities":s(!0);break;case"rewards":o(!0);break}},[]),{creditInfo:x}=(0,u.useCreditsContext)();return(0,t.jsxs)(r.Container,{asChild:!0,id:"infoCard",className:"-mb-[86px] -translate-y-[86px] x:-mb-[30px] x:-translate-y-[30px]",children:[(0,t.jsxs)("div",{className:(0,l.cn)("mx-auto flex justify-between items-center rounded-[12px] border border-white px-[24px] py-[40px]","l:flex-col l:items-start","min-l:px-[48px]","min-xl:px-[100px]"),style:{background:"linear-gradient(119.61deg, rgba(250, 250, 250, 0.6) 38.58%, rgba(255, 255, 255, 0.6) 63.73%, rgba(249, 252, 255, 0.6) 89.37%)",backdropFilter:"blur(8px)"},children:[(0,t.jsxs)("div",{className:(0,l.cn)("grid grid-cols-2 gap-[24px] font-bold l:w-full md:grid-cols-1 md:flex-col md:gap-[16px] min-md:items-center"),children:[(0,t.jsxs)("div",{className:"mr-[80px] md:mr-[0] md:flex-1 md-xl:mr-[64px]",children:[(0,t.jsx)("div",{className:(0,l.cn)("mb-[24px] text-[14px] font-bold l:mb-[6px] xl:text-[16px] min-md:text-[18px] l-xl:mb-[16px]"),children:e.balanceLabel}),(0,t.jsxs)("div",{className:"flex items-baseline",children:[(0,t.jsx)("div",{className:(0,l.cn)("mr-[8px] text-[36px] font-extrabold","min-md:text-[44px]","min-xl:text-[56px]"),children:x?(0,f.numberFormat)(x.available_credit):0}),(0,t.jsx)("div",{className:"text-[16px]",children:e?.pointUnit})]})]}),(0,t.jsxs)("div",{className:"w-fit md:flex-1",children:[(0,t.jsxs)("div",{className:(0,l.cn)("mb-[24px] flex text-[18px] l:mb-[6px] l:text-[14px] l-xl:mb-[16px]"),children:[(0,t.jsx)(r.Text,{className:"text-[14px] font-bold xl:text-[16px] min-md:text-[18px]",html:e.comingSoonLabel}),e.comingSoonTips&&(0,t.jsxs)("div",{className:"group relative ml-[4px] flex cursor-pointer items-start",children:[(0,t.jsx)(r.Text,{as:"div",html:e?.infoIcon,className:"size-[18px] cursor-pointer [&_svg]:size-full",onClick:()=>{c?m(!1):(m(!0),setTimeout(()=>{m(!1)},5e3))}}),(0,t.jsx)("div",{className:(0,l.cn)("absolute -bottom-[12px] -left-[32px] z-10 w-[356px] translate-y-full md:w-[276px]",c?"block":"hidden"),children:(0,t.jsxs)("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",children:[(0,t.jsx)(r.Text,{size:"2",html:e.comingSoonTips,className:"desktop:text-[18px]"}),(0,t.jsx)("div",{className:"absolute -top-[10px] left-[40px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),(0,t.jsxs)("div",{className:"flex items-baseline ",children:[(0,t.jsx)("div",{className:(0,l.cn)("mr-[8px] text-[36px] font-extrabold","min-l:text-[44px]","min-xl:text-[56px]"),children:x?(0,f.numberFormat)(x.pending_credit):0}),(0,t.jsx)("div",{className:"text-[16px]",children:e?.pointUnit})]})]})]}),(0,t.jsx)("div",{className:(0,l.cn)("grid w-fit md:w-full l:mt-[32px] l:gap-[12px] min-l:gap-[16px] min-l:pl-[48px] md-l:grid-cols-2"),children:e.buttons?.map((a,v)=>(0,t.jsx)(r.Button,{variant:v===0?"secondary":"primary",size:"lg",className:"min-w-[156px] laptop:min-w-[189px]",onClick:()=>{C(a)},children:a.text},v))}),e?.myActivities&&(0,t.jsx)(y.default,{isOpen:i,data:e?.myActivities,onClose:()=>{s(!1)}}),e?.myRewards&&(0,t.jsx)(w.default,{isOpen:p,data:e?.myRewards,onClose:()=>{o(!1)}})]}),c&&(0,t.jsx)("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>m(!1),onKeyDown:a=>a.key==="Escape"&&m(!1)})]})}
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsInfoCard/index.tsx"],
4
+ "sourcesContent": ["import { Button, Container, Text } from '@anker-in/headless-ui'\n\nimport { useCallback, useState } from 'react'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers'\nimport { numberFormat } from '../context/utils'\nimport ActivitiesModal from '../modal/activitiesModal'\nimport MyRewardsModal, { type MyRewardsMetafields } from '../modal/MyRewardsModal'\nimport { type MyActivitiesMetafields } from '../modal/activitiesModal'\nimport { gaNormalClick } from '../../../helpers/track'\n\ntype ButtonConfig = {\n text: string\n type: 'activities' | 'rewards'\n}\nexport interface InfoCardProps {\n data: {\n balanceLabel: string\n comingSoonLabel: string\n comingSoonTips: string\n buttons: ButtonConfig[]\n pointUnit: string\n infoIcon: string\n myActivities: MyActivitiesMetafields\n myRewards: MyRewardsMetafields\n }\n}\nexport function CreditsInfoCard({ data }: InfoCardProps) {\n const [openActivities, setOpenActivities] = useState(false)\n const [openRewards, setOpenRewards] = useState(false)\n const [hover, setHover] = useState<boolean>(false)\n\n const handleButtonClick = useCallback((buttonConfig: ButtonConfig) => {\n gaNormalClick({ position: 'info_card', label: buttonConfig.text })\n\n if (buttonConfig.type) {\n switch (buttonConfig.type) {\n case 'activities':\n setOpenActivities(true)\n break\n case 'rewards':\n setOpenRewards(true)\n break\n }\n }\n }, [])\n\n const { creditInfo } = useCreditsContext()\n\n return (\n <Container asChild id=\"infoCard\" className=\"-mb-[86px] -translate-y-[86px] x:-mb-[30px] x:-translate-y-[30px]\">\n <div\n className={cn(\n 'mx-auto flex justify-between items-center rounded-[12px] border border-white px-[24px] py-[40px]',\n 'l:flex-col l:items-start',\n 'min-l:px-[48px]',\n 'min-xl:px-[100px]'\n )}\n style={{\n background:\n 'linear-gradient(119.61deg, rgba(250, 250, 250, 0.6) 38.58%, rgba(255, 255, 255, 0.6) 63.73%, rgba(249, 252, 255, 0.6) 89.37%)',\n backdropFilter: 'blur(8px)',\n }}\n >\n <div\n className={cn(\n 'grid grid-cols-2 gap-[24px] font-bold l:w-full md:grid-cols-1 md:flex-col md:gap-[16px] min-md:items-center'\n )}\n >\n <div className=\"mr-[80px] md:mr-[0] md:flex-1 md-xl:mr-[64px]\">\n <div\n className={cn(\n 'mb-[24px] text-[14px] font-bold l:mb-[6px] xl:text-[16px] min-md:text-[18px] l-xl:mb-[16px]'\n )}\n >\n {data.balanceLabel}\n </div>\n <div className=\"flex items-baseline\">\n <div className={cn('mr-[8px] text-[36px] font-extrabold', 'min-md:text-[44px]', 'min-xl:text-[56px]')}>\n {creditInfo ? numberFormat(creditInfo.available_credit) : 0}\n </div>\n <div className=\"text-[16px]\">{data?.pointUnit}</div>\n </div>\n </div>\n <div className=\"w-fit md:flex-1\">\n <div className={cn('mb-[24px] flex text-[18px] l:mb-[6px] l:text-[14px] l-xl:mb-[16px]')}>\n <Text className=\"text-[14px] font-bold xl:text-[16px] min-md:text-[18px]\" html={data.comingSoonLabel} />\n {data.comingSoonTips && (\n <div className=\"group relative ml-[4px] flex cursor-pointer items-start\">\n <Text\n as=\"div\"\n html={data?.infoIcon}\n className=\"size-[18px] cursor-pointer [&_svg]:size-full\"\n onClick={() => {\n if (hover) {\n setHover(false)\n } else {\n setHover(true)\n setTimeout(() => {\n setHover(false)\n }, 5000)\n }\n }}\n />\n <div\n className={cn(\n 'absolute -bottom-[12px] -left-[32px] z-10 w-[356px] translate-y-full md:w-[276px]',\n hover ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow\">\n <Text size=\"2\" html={data.comingSoonTips} className=\"desktop:text-[18px]\" />\n <div className=\"absolute -top-[10px] left-[40px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n )}\n </div>\n <div className=\"flex items-baseline \">\n <div className={cn('mr-[8px] text-[36px] font-extrabold', 'min-l:text-[44px]', 'min-xl:text-[56px]')}>\n {creditInfo ? numberFormat(creditInfo.pending_credit) : 0}\n </div>\n <div className=\"text-[16px]\">{data?.pointUnit}</div>\n </div>\n </div>\n </div>\n <div\n className={cn(\n 'grid w-fit md:w-full l:mt-[32px] l:gap-[12px] min-l:gap-[16px] min-l:pl-[48px] md-l:grid-cols-2'\n )}\n >\n {data.buttons?.map((item, index) => (\n <Button\n key={index}\n variant={index === 0 ? 'secondary' : 'primary'}\n size=\"lg\"\n className=\"min-w-[156px] laptop:min-w-[189px]\"\n onClick={() => {\n handleButtonClick(item)\n }}\n >\n {item.text}\n </Button>\n ))}\n </div>\n\n {data?.myActivities && (\n <ActivitiesModal\n isOpen={openActivities}\n data={data?.myActivities}\n onClose={() => {\n setOpenActivities(false)\n }}\n />\n )}\n {data?.myRewards && (\n <MyRewardsModal\n isOpen={openRewards}\n data={data?.myRewards}\n onClose={() => {\n setOpenRewards(false)\n }}\n ></MyRewardsModal>\n )}\n </div>\n {hover && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setHover(false)}\n onKeyDown={e => e.key === 'Escape' && setHover(false)}\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAsEY,IAAAI,EAAA,6BAtEZC,EAAwC,iCAExCC,EAAsC,iBACtCC,EAAkC,+BAClCC,EAAmB,4BACnBC,EAA6B,4BAC7BC,EAA4B,uCAC5BC,EAAyD,sCAEzDC,EAA8B,kCAkBvB,SAASV,EAAgB,CAAE,KAAAW,CAAK,EAAkB,CACvD,KAAM,CAACC,EAAgBC,CAAiB,KAAI,YAAS,EAAK,EACpD,CAACC,EAAaC,CAAc,KAAI,YAAS,EAAK,EAC9C,CAACC,EAAOC,CAAQ,KAAI,YAAkB,EAAK,EAE3CC,KAAoB,eAAaC,GAA+B,CAGpE,MAFA,iBAAc,CAAE,SAAU,YAAa,MAAOA,EAAa,IAAK,CAAC,EAE7DA,EAAa,KACf,OAAQA,EAAa,KAAM,CACzB,IAAK,aACHN,EAAkB,EAAI,EACtB,MACF,IAAK,UACHE,EAAe,EAAI,EACnB,KACJ,CAEJ,EAAG,CAAC,CAAC,EAEC,CAAE,WAAAK,CAAW,KAAI,qBAAkB,EAEzC,SACE,QAAC,aAAU,QAAO,GAAC,GAAG,WAAW,UAAU,oEACzC,qBAAC,OACC,aAAW,MACT,mGACA,2BACA,kBACA,mBACF,EACA,MAAO,CACL,WACE,gIACF,eAAgB,WAClB,EAEA,qBAAC,OACC,aAAW,MACT,6GACF,EAEA,qBAAC,OAAI,UAAU,gDACb,oBAAC,OACC,aAAW,MACT,6FACF,EAEC,SAAAT,EAAK,aACR,KACA,QAAC,OAAI,UAAU,sBACb,oBAAC,OAAI,aAAW,MAAG,sCAAuC,qBAAsB,oBAAoB,EACjG,SAAAS,KAAa,gBAAaA,EAAW,gBAAgB,EAAI,EAC5D,KACA,OAAC,OAAI,UAAU,cAAe,SAAAT,GAAM,UAAU,GAChD,GACF,KACA,QAAC,OAAI,UAAU,kBACb,qBAAC,OAAI,aAAW,MAAG,oEAAoE,EACrF,oBAAC,QAAK,UAAU,0DAA0D,KAAMA,EAAK,gBAAiB,EACrGA,EAAK,mBACJ,QAAC,OAAI,UAAU,0DACb,oBAAC,QACC,GAAG,MACH,KAAMA,GAAM,SACZ,UAAU,+CACV,QAAS,IAAM,CACTK,EACFC,EAAS,EAAK,GAEdA,EAAS,EAAI,EACb,WAAW,IAAM,CACfA,EAAS,EAAK,CAChB,EAAG,GAAI,EAEX,EACF,KACA,OAAC,OACC,aAAW,MACT,oFACAD,EAAQ,QAAU,QACpB,EAEA,oBAAC,OAAI,UAAU,0FACb,oBAAC,QAAK,KAAK,IAAI,KAAML,EAAK,eAAgB,UAAU,sBAAsB,KAC1E,OAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GAEJ,KACA,QAAC,OAAI,UAAU,uBACb,oBAAC,OAAI,aAAW,MAAG,sCAAuC,oBAAqB,oBAAoB,EAChG,SAAAS,KAAa,gBAAaA,EAAW,cAAc,EAAI,EAC1D,KACA,OAAC,OAAI,UAAU,cAAe,SAAAT,GAAM,UAAU,GAChD,GACF,GACF,KACA,OAAC,OACC,aAAW,MACT,iGACF,EAEC,SAAAA,EAAK,SAAS,IAAI,CAACU,EAAMC,OACxB,OAAC,UAEC,QAASA,IAAU,EAAI,YAAc,UACrC,KAAK,KACL,UAAU,qCACV,QAAS,IAAM,CACbJ,EAAkBG,CAAI,CACxB,EAEC,SAAAA,EAAK,MARDC,CASP,CACD,EACH,EAECX,GAAM,iBACL,OAAC,EAAAY,QAAA,CACC,OAAQX,EACR,KAAMD,GAAM,aACZ,QAAS,IAAM,CACbE,EAAkB,EAAK,CACzB,EACF,EAEDF,GAAM,cACL,OAAC,EAAAa,QAAA,CACC,OAAQV,EACR,KAAMH,GAAM,UACZ,QAAS,IAAM,CACbI,EAAe,EAAK,CACtB,EACD,GAEL,EACCC,MACC,OAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMC,EAAS,EAAK,EAC7B,UAAWQ,GAAKA,EAAE,MAAQ,UAAYR,EAAS,EAAK,EACtD,GAEJ,CAEJ",
6
+ "names": ["creditsInfoCard_exports", "__export", "CreditsInfoCard", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_provider", "import_helpers", "import_utils", "import_activitiesModal", "import_MyRewardsModal", "import_track", "data", "openActivities", "setOpenActivities", "openRewards", "setOpenRewards", "hover", "setHover", "handleButtonClick", "buttonConfig", "creditInfo", "item", "index", "ActivitiesModal", "MyRewardsModal", "e"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var h=Object.create;var p=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var N=(o,t)=>{for(var n in t)p(o,n,{get:t[n],enumerable:!0})},u=(o,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of k(t))!E.call(o,l)&&l!==n&&p(o,l,{get:()=>t[l],enumerable:!(a=C(t,l))||a.enumerable});return o};var f=(o,t,n)=>(n=o!=null?h(w(o)):{},u(t||!o||!o.__esModule?p(n,"default",{value:o,enumerable:!0}):n,o)),D=o=>u(p({},"__esModule",{value:!0}),o);var A={};N(A,{CountrySelect:()=>S});module.exports=D(A);var s=require("react/jsx-runtime"),g=require("@anker-in/headless-ui"),m=f(require("../../context/hooks/useClickOutside")),r=f(require("classnames")),i=require("react");function S({countries:o,loading:t,className:n,value:a,onChange:l}){const[x,c]=(0,i.useState)(!1),[b,d]=(0,i.useState)(""),v=(0,m.default)(()=>{c(!1)});return(0,i.useEffect)(()=>{const e=o.filter(y=>y.code===a);e.length&&d(e[0].name)},[d,o,a]),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{className:(0,r.default)("!h-[50px] pr-[45px] min-l:hidden",n),style:{WebkitTextFillColor:"black"},disabled:t,value:a,onChange:e=>{l(e.target.value)},children:o.map(e=>(0,s.jsx)("option",{value:e.code,children:e.name},e.code))}),(0,s.jsx)("div",{className:(0,r.default)("absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block",n),onClick:()=>{c(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:b}),(0,s.jsx)(g.Picture,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",imgClassName:"pointer-events-none absolute right-0 top-0 bottom-0 !w-[45px] object-cover",alt:"arrow"}),(0,s.jsx)("div",{ref:v,className:(0,r.default)("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto rounded-[4px] bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",{"!hidden":!x}),children:(0,s.jsx)("ul",{className:"py-[6px]",children:o.map(e=>(0,s.jsxs)("li",{value:e.code,className:(0,r.default)("relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]",{"!bg-[#EAEAEC]":e.code===a}),children:[(0,s.jsx)("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:e.code,onClick:()=>{d(e.name),c(!1),l(e.code)}}),e.name]},e.code))})})]})}
2
+ //# sourceMappingURL=CountrySelect.js.map