@anker-in/campaign-ui 0.3.5 → 0.4.0-beta.2

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 (292) hide show
  1. package/dist/cjs/components/credits/context/const.d.ts +10 -2
  2. package/dist/cjs/components/credits/context/const.js +1 -1
  3. package/dist/cjs/components/credits/context/const.js.map +2 -2
  4. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  5. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  6. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  7. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  8. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  9. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  10. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  12. package/dist/cjs/components/credits/context/provider.d.ts +5 -1
  13. package/dist/cjs/components/credits/context/provider.js +1 -1
  14. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  15. package/dist/cjs/components/credits/context/response.d.ts +1 -0
  16. package/dist/cjs/components/credits/context/response.js.map +1 -1
  17. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  18. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +2 -2
  19. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
  20. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +2 -2
  21. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  22. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  23. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  24. package/dist/cjs/components/credits/creditsGoGift/index.d.ts +2 -0
  25. package/dist/cjs/components/credits/creditsGoGift/index.js +2 -0
  26. package/dist/cjs/components/credits/creditsGoGift/index.js.map +7 -0
  27. package/dist/cjs/components/credits/creditsGoGift/type.d.ts +22 -0
  28. package/dist/cjs/components/credits/creditsGoGift/type.js +2 -0
  29. package/dist/cjs/components/credits/creditsGoGift/type.js.map +7 -0
  30. package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
  31. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
  32. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  33. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +2 -2
  34. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  35. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  36. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  37. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  38. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  39. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  40. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  41. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  42. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  43. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  44. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  45. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  46. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  47. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  48. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  49. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  50. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  51. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  52. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  53. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  54. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  55. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  56. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  57. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  58. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  59. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  60. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  61. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  62. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  63. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  64. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  65. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  66. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  67. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  68. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  69. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  70. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  71. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  72. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  73. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  74. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +11 -0
  75. package/dist/cjs/components/credits/creditsRedeemList/type.js +1 -1
  76. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
  77. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  78. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +2 -2
  79. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  80. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  81. package/dist/cjs/components/credits/index.d.ts +2 -1
  82. package/dist/cjs/components/credits/index.js +1 -1
  83. package/dist/cjs/components/credits/index.js.map +3 -3
  84. package/dist/{esm/components/credits/modal/activitiesModal.d.ts → cjs/components/credits/modal/ActivitiesModal.d.ts} +1 -1
  85. package/dist/cjs/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +2 -2
  86. package/dist/cjs/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +3 -3
  87. package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +2 -2
  88. package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +3 -3
  89. package/dist/cjs/components/credits/modal/{loadingDots.js → LoadingDots.js} +1 -1
  90. package/dist/cjs/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +2 -2
  91. package/dist/cjs/components/credits/modal/ModalContainer.js +2 -0
  92. package/dist/cjs/components/credits/modal/ModalContainer.js.map +7 -0
  93. package/dist/cjs/components/credits/modal/RewardsModal.d.ts +64 -0
  94. package/dist/cjs/components/credits/modal/RewardsModal.js +2 -0
  95. package/dist/cjs/components/credits/modal/RewardsModal.js.map +7 -0
  96. package/dist/cjs/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +1 -1
  97. package/dist/cjs/components/credits/modal/{rulesModal.js → RulesModal.js} +2 -2
  98. package/dist/cjs/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +3 -3
  99. package/dist/cjs/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +1 -1
  100. package/dist/cjs/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +2 -2
  101. package/dist/cjs/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +3 -3
  102. package/dist/cjs/components/credits/modal/{tip.js → Tip.js} +1 -1
  103. package/dist/cjs/components/credits/modal/{tip.js.map → Tip.js.map} +2 -2
  104. package/dist/cjs/components/credits/type.d.ts +67 -5
  105. package/dist/cjs/components/credits/type.js +1 -1
  106. package/dist/cjs/components/credits/type.js.map +1 -1
  107. package/dist/cjs/templates/Credits.d.ts +1 -87
  108. package/dist/cjs/templates/Credits.js +1 -1
  109. package/dist/cjs/templates/Credits.js.map +3 -3
  110. package/dist/cjs/templates/Credits.types.d.ts +96 -0
  111. package/dist/cjs/templates/Credits.types.js +2 -0
  112. package/dist/cjs/templates/Credits.types.js.map +7 -0
  113. package/dist/esm/components/credits/context/const.d.ts +10 -2
  114. package/dist/esm/components/credits/context/const.js +1 -1
  115. package/dist/esm/components/credits/context/const.js.map +2 -2
  116. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  117. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  118. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  119. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  120. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  121. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  122. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  123. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  124. package/dist/esm/components/credits/context/provider.d.ts +5 -1
  125. package/dist/esm/components/credits/context/provider.js +1 -1
  126. package/dist/esm/components/credits/context/provider.js.map +3 -3
  127. package/dist/esm/components/credits/context/response.d.ts +1 -0
  128. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  129. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +1 -1
  130. package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
  131. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +1 -1
  132. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  133. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  134. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  135. package/dist/esm/components/credits/creditsGoGift/index.d.ts +2 -0
  136. package/dist/esm/components/credits/creditsGoGift/index.js +2 -0
  137. package/dist/esm/components/credits/creditsGoGift/index.js.map +7 -0
  138. package/dist/esm/components/credits/creditsGoGift/type.d.ts +22 -0
  139. package/dist/esm/components/credits/creditsGoGift/type.js +1 -0
  140. package/dist/esm/components/credits/creditsGoGift/type.js.map +7 -0
  141. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  142. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  143. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  144. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +1 -1
  145. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  146. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  147. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  148. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  149. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  150. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  151. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  152. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  153. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  154. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  155. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  156. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  157. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  158. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  159. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  160. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  161. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  162. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  163. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  164. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  165. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  166. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  167. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  168. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  169. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  170. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  171. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  172. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  173. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  174. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  175. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  176. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  177. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  178. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  179. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  180. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  181. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  182. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  183. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  184. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  185. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +11 -0
  186. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  187. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +1 -1
  188. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  189. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  190. package/dist/esm/components/credits/index.d.ts +2 -1
  191. package/dist/esm/components/credits/index.js +1 -1
  192. package/dist/esm/components/credits/index.js.map +3 -3
  193. package/dist/{cjs/components/credits/modal/activitiesModal.d.ts → esm/components/credits/modal/ActivitiesModal.d.ts} +1 -1
  194. package/dist/esm/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +2 -2
  195. package/dist/esm/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +3 -3
  196. package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +2 -2
  197. package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +2 -2
  198. package/dist/esm/components/credits/modal/{loadingDots.js → LoadingDots.js} +1 -1
  199. package/dist/esm/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +2 -2
  200. package/dist/esm/components/credits/modal/ModalContainer.js +2 -0
  201. package/dist/esm/components/credits/modal/ModalContainer.js.map +7 -0
  202. package/dist/esm/components/credits/modal/RewardsModal.d.ts +64 -0
  203. package/dist/esm/components/credits/modal/RewardsModal.js +2 -0
  204. package/dist/esm/components/credits/modal/RewardsModal.js.map +7 -0
  205. package/dist/esm/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +1 -1
  206. package/dist/esm/components/credits/modal/{rulesModal.js → RulesModal.js} +2 -2
  207. package/dist/esm/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +3 -3
  208. package/dist/esm/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +1 -1
  209. package/dist/esm/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +2 -2
  210. package/dist/esm/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +2 -2
  211. package/dist/esm/components/credits/modal/{tip.js → Tip.js} +1 -1
  212. package/dist/esm/components/credits/modal/{tip.js.map → Tip.js.map} +2 -2
  213. package/dist/esm/components/credits/type.d.ts +67 -5
  214. package/dist/esm/templates/Credits.d.ts +1 -87
  215. package/dist/esm/templates/Credits.js +1 -1
  216. package/dist/esm/templates/Credits.js.map +3 -3
  217. package/dist/esm/templates/Credits.types.d.ts +96 -0
  218. package/dist/esm/templates/Credits.types.js +2 -0
  219. package/dist/esm/templates/Credits.types.js.map +7 -0
  220. package/package.json +1 -1
  221. package/src/components/credits/context/const.ts +8 -0
  222. package/src/components/credits/context/hooks/useMyRewards.ts +7 -31
  223. package/src/components/credits/context/hooks/useRedeemGoGift.ts +36 -0
  224. package/src/components/credits/context/hooks/useRedeemableList.ts +13 -19
  225. package/src/components/credits/context/provider.tsx +17 -2
  226. package/src/components/credits/context/response.ts +1 -0
  227. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +2 -2
  228. package/src/components/credits/creditsCash/CreditsCash.tsx +1 -1
  229. package/src/components/credits/creditsGoGift/CreditsGoGift.tsx +210 -0
  230. package/src/components/credits/creditsGoGift/index.ts +2 -0
  231. package/src/components/credits/creditsGoGift/type.ts +23 -0
  232. package/src/components/credits/creditsInfoCard/index.tsx +5 -28
  233. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +1 -1
  234. package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +39 -17
  235. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx +77 -0
  236. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx +86 -0
  237. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +29 -138
  238. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +5 -6
  239. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +11 -12
  240. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -14
  241. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -9
  242. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -5
  243. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +29 -28
  244. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx +101 -0
  245. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx +65 -0
  246. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx +156 -0
  247. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +1 -1
  248. package/src/components/credits/creditsRedeemList/type.ts +11 -0
  249. package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +2 -2
  250. package/src/components/credits/creditsWaysToGetCredits/type.ts +2 -2
  251. package/src/components/credits/index.ts +2 -1
  252. package/src/components/credits/modal/{activitiesModal.tsx → ActivitiesModal.tsx} +2 -2
  253. package/src/components/credits/modal/{creditsUploadReceiptModal.tsx → CreditsUploadReceiptModal.tsx} +1 -1
  254. package/src/components/credits/modal/{modalContainer.tsx → ModalContainer.tsx} +1 -1
  255. package/src/components/credits/modal/{MyRewardsModal.tsx → RewardsModal.tsx} +145 -103
  256. package/src/components/credits/modal/{rulesModal.tsx → RulesModal.tsx} +1 -1
  257. package/src/components/credits/modal/{subscribeModal.tsx → SubscribeModal.tsx} +1 -1
  258. package/src/components/credits/type.ts +68 -5
  259. package/src/templates/Credits.tsx +110 -142
  260. package/src/templates/Credits.types.ts +110 -0
  261. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -32
  262. package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
  263. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
  264. package/dist/cjs/components/credits/modal/modalContainer.js +0 -2
  265. package/dist/cjs/components/credits/modal/modalContainer.js.map +0 -7
  266. package/dist/cjs/stories/CartCard.stories.d.ts +0 -33
  267. package/dist/cjs/stories/CartCard.stories.js +0 -21
  268. package/dist/cjs/stories/CartCard.stories.js.map +0 -7
  269. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -32
  270. package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
  271. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
  272. package/dist/esm/components/credits/modal/modalContainer.js +0 -2
  273. package/dist/esm/components/credits/modal/modalContainer.js.map +0 -7
  274. package/dist/esm/stories/CartCard.stories.d.ts +0 -33
  275. package/dist/esm/stories/CartCard.stories.js +0 -21
  276. package/dist/esm/stories/CartCard.stories.js.map +0 -7
  277. package/dist/index.d.mts +0 -1305
  278. package/dist/index.d.ts +0 -1305
  279. package/dist/index.js +0 -26656
  280. package/dist/index.js.map +0 -1
  281. package/dist/index.mjs +0 -26641
  282. package/dist/index.mjs.map +0 -1
  283. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  284. /package/dist/cjs/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  285. /package/dist/cjs/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  286. /package/dist/cjs/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  287. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  288. /package/dist/esm/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  289. /package/dist/esm/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  290. /package/dist/esm/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  291. /package/src/components/credits/modal/{loadingDots.tsx → LoadingDots.tsx} +0 -0
  292. /package/src/components/credits/modal/{tip.tsx → Tip.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/templates/Credits.tsx"],
4
- "sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\nimport { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask, CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice, CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport { CreditsNavigation, CreditsNavigationCopy } from '../components/credits/creditsNavigation'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\n\nexport enum ComponentKey {\n Navigation = 'creditsNavigation',\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n AnkersolixTask = 'creditsAnkersolixTask',\n RedeemList = 'creditsRedeemList',\n SpendCreditsLikeCash = 'creditsCash',\n MemberPrice = 'creditsMemberPrice',\n Faqs = 'creditsFaq',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n }\n creditsConfig?: {\n alpcBrand?: string\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Navigation]?: CreditsNavigationCopy\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n pageHandle?: string\n }\n cartConfig?: {\n addToCart: (params: {\n variantList: Array<{\n variant: any\n quantity: number\n attributes?: Array<{ key: string; value: string }>\n }>\n cartAttributes?: Record<string, string>\n discountCodes?: string[]\n }) => void | Promise<any>\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n console.log('siteConfig', siteConfig)\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n cartConfig={cartConfig}\n >\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA2HY,IAAAK,EAAA,6BA3HZC,EAA6D,yBAC7DC,EAAqC,uDAGrCA,EAAgC,kDAIhCC,EAAiD,+CACjDC,EAAqD,iDACrDC,EAAqD,iDACrDC,EAAqE,yDACrEC,EAAiE,uDACjEC,EAAyD,mDACzDC,EAA6C,6CAC7CC,EAA2D,oDAC3DC,EAA2C,4CAC3CC,EAAyD,mDAG7Cf,OACVA,EAAA,WAAa,oBACbA,EAAA,OAAS,gBACTA,EAAA,SAAW,kBACXA,EAAA,SAAW,kBACXA,EAAA,iBAAmB,0BACnBA,EAAA,eAAiB,wBACjBA,EAAA,WAAa,oBACbA,EAAA,qBAAuB,cACvBA,EAAA,YAAc,qBACdA,EAAA,KAAO,aAVGA,OAAA,IAsEL,MAAMC,EAAkB,CAAC,CAC9B,eAAAe,EACA,WAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,IAAAC,EACA,WAAAC,CACF,KACE,QAAQ,IAAI,aAAcN,CAAU,KAElC,OAAC,oBAAiB,eAAgBD,EAChC,mBAAC,wBAAqB,KAAMC,EAAW,sBAAuB,MAAOE,GAAa,SAAS,MACzF,oBAAC,mBACC,QAASA,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBE,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYF,GAAa,WACzB,oBAAqBF,EAAW,oBAChC,SAAUE,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKG,EACL,WAAYF,EAAW,OACvB,oBAAqBH,EAAW,oBAChC,UAAWC,GAAe,UAC1B,WAAYK,EAGX,UAAAH,EAAW,WAAW,sBACrB,OAAC,qBAAkB,KAAMA,EAAW,WAAW,kBAA0B,KAE3E,OAAC,OAAI,aAAW,cAAW,4BAA4B,EACpD,SAAAA,EAAW,MAAM,IAAII,GAAO,CAE3B,GAAIA,IAAQ,oBAAyB,OAAO,KAC5C,MAAMC,EAAgBL,EAAW,aAAaI,CAAG,EACjD,OAAKC,KAEH,oBACG,UAAAD,IAAQ,oBAAuB,OAAC,iBAAc,KAAMC,EAAoC,GAAID,EAAK,EACjGA,IAAQ,mBAAyBL,GAAa,YAC7C,OAAC,mBAAgB,KAAMM,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,sBACP,OAAC,mBAAgB,KAAMC,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,8BACP,OAAC,2BACC,KAAMC,EACN,GAAID,EACJ,WACER,EAAe,QAAU,QACrB,CACE,SAAU,aACV,iBACE,4EACJ,EACA,CACE,SAAU,iBACV,iBAAkB,gBACpB,EAER,EAEDQ,IAAQ,4BACP,OAAC,yBAAsB,KAAMC,EAA4C,GAAID,EAAK,EAEnFA,IAAQ,wBACP,OAAC,qBAAkB,KAAMC,EAAwC,GAAID,EAAK,EAE3EA,IAAQ,kBACP,OAAC,eAAY,KAAMC,EAAkC,GAAID,EAAK,EAE/DA,IAAQ,yBACP,OAAC,sBAAmB,KAAMC,EAAyC,GAAID,EAAK,EAE7EA,IAAQ,iBAAqB,OAAC,cAAW,KAAMC,EAAiC,GAAID,EAAK,EACzFA,IAAQ,oBACP,OAAC,OAAI,UAAU,qEAAqE,GAExF,EA5CyB,IA8C7B,CAAC,EACH,GACF,EACF,EACF",
6
- "names": ["Credits_exports", "__export", "ComponentKey", "CreditsTemplate", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_provider", "import_creditsBanner", "import_creditsInfoCard", "import_creditsBenefits", "import_creditsWaysToGetCredits", "import_creditsAnkersolixTask", "import_creditsRedeemList", "import_creditsCash", "import_creditsMemberPrice", "import_creditsFaq", "import_creditsNavigation", "headlessConfig", "siteConfig", "creditsConfig", "userContext", "pageConfig", "registrationContext", "gtm", "cartConfig", "key", "componentCopy"]
4
+ "sourcesContent": ["import { classNames, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\nimport { CreditsProvider, useCreditsContext } from '../components/credits/context/provider'\nimport { CreditsBanner } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList } from '../components/credits/creditsRedeemList'\nimport { CreditsGoGift } from '../components/credits/creditsGoGift'\nimport { CreditsCash } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq } from '../components/credits/creditsFaq'\nimport { CreditsNavigation } from '../components/credits/creditsNavigation'\nimport ActivitiesModal from '../components/credits/modal/ActivitiesModal'\nimport RewardsModal from '../components/credits/modal/RewardsModal'\nimport { ComponentKey } from './Credits.types'\nimport type {\n CreditsTemplateProps,\n CreditsContentProps,\n CreditsBannerCopy,\n CreditsInfoCardCopy,\n CreditsBenefitsCopy,\n CreditsWaysToGetCreditsCopy,\n CreditsAnkersolixTaskCopy,\n CreditsRedeemListCopy,\n CreditsGoGiftCopy,\n CreditsCashCopy,\n CreditsMemberPriceCopy,\n CreditsFaqCopy,\n} from './Credits.types'\n\nconst CreditsContent = ({ headlessConfig, pageConfig, userContext }: CreditsContentProps) => {\n const { openMyRewardsModal, setOpenMyRewardsModal, openActivitiesModal, setOpenActivitiesModal, pageCommon } = useCreditsContext()\n\n return (\n <>\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.GoGift && <CreditsGoGift copy={componentCopy as CreditsGoGiftCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n\n {/* Global Modals */}\n {pageCommon?.activitiesModal && (\n <ActivitiesModal\n isOpen={openActivitiesModal}\n data={pageCommon.activitiesModal}\n onClose={() => setOpenActivitiesModal(false)}\n />\n )}\n {pageCommon?.rewardsModal && (\n <RewardsModal\n isOpen={openMyRewardsModal}\n data={pageCommon.rewardsModal}\n onClose={() => setOpenMyRewardsModal(false)}\n />\n )}\n </>\n )\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n cartConfig={cartConfig}\n >\n <CreditsContent headlessConfig={headlessConfig} pageConfig={pageConfig} userContext={userContext} />\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAuCQ,IAAAI,EAAA,6BAvCRC,EAA6C,yBAC7CC,EAAqC,uDACrCA,EAAmD,kDACnDC,EAA8B,+CAC9BC,EAAgC,iDAChCC,EAAgC,iDAChCC,EAAwC,yDACxCC,EAAsC,uDACtCC,EAAkC,mDAClCC,EAA8B,+CAC9BC,EAA4B,6CAC5BC,EAAmC,oDACnCC,EAA2B,4CAC3BC,EAAkC,mDAClCC,EAA4B,0DAC5BC,EAAyB,uDACzBC,EAA6B,2BAgB7B,MAAMC,EAAiB,CAAC,CAAE,eAAAC,EAAgB,WAAAC,EAAY,YAAAC,CAAY,IAA2B,CAC3F,KAAM,CAAE,mBAAAC,EAAoB,sBAAAC,EAAuB,oBAAAC,EAAqB,uBAAAC,EAAwB,WAAAC,CAAW,KAAI,qBAAkB,EAEjI,SACE,oBAEG,UAAAN,EAAW,WAAW,eAAa,UAAU,MAC5C,OAAC,qBAAkB,KAAMA,EAAW,WAAW,eAAa,UAAU,EAAG,KAE3E,OAAC,OAAI,aAAW,cAAW,4BAA4B,EACpD,SAAAA,EAAW,MAAM,IAAIO,GAAO,CAE3B,GAAIA,IAAQ,eAAa,WAAY,OAAO,KAC5C,MAAMC,EAAgBR,EAAW,aAAaO,CAAG,EACjD,OAAKC,KAEH,oBACG,UAAAD,IAAQ,eAAa,WAAU,OAAC,iBAAc,KAAMC,EAAoC,GAAID,EAAK,EACjGA,IAAQ,eAAa,UAAYN,GAAa,YAC7C,OAAC,mBAAgB,KAAMO,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,eAAa,aACpB,OAAC,mBAAgB,KAAMC,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,eAAa,qBACpB,OAAC,2BACC,KAAMC,EACN,GAAID,EACJ,WACER,EAAe,QAAU,QACrB,CACA,SAAU,aACV,iBACE,4EACJ,EACE,CACA,SAAU,iBACV,iBAAkB,gBACpB,EAEN,EAEDQ,IAAQ,eAAa,mBACpB,OAAC,yBAAsB,KAAMC,EAA4C,GAAID,EAAK,EAEnFA,IAAQ,eAAa,eACpB,OAAC,qBAAkB,KAAMC,EAAwC,GAAID,EAAK,EAE3EA,IAAQ,eAAa,WAAU,OAAC,iBAAc,KAAMC,EAAoC,GAAID,EAAK,EACjGA,IAAQ,eAAa,yBACpB,OAAC,eAAY,KAAMC,EAAkC,GAAID,EAAK,EAE/DA,IAAQ,eAAa,gBACpB,OAAC,sBAAmB,KAAMC,EAAyC,GAAID,EAAK,EAE7EA,IAAQ,eAAa,SAAQ,OAAC,cAAW,KAAMC,EAAiC,GAAID,EAAK,EACzFA,IAAQ,eAAa,WACpB,OAAC,OAAI,UAAU,qEAAqE,GAExF,EA7CyB,IA+C7B,CAAC,EACH,EAGCD,GAAY,oBACX,OAAC,EAAAG,QAAA,CACC,OAAQL,EACR,KAAME,EAAW,gBACjB,QAAS,IAAMD,EAAuB,EAAK,EAC7C,EAEDC,GAAY,iBACX,OAAC,EAAAI,QAAA,CACC,OAAQR,EACR,KAAMI,EAAW,aACjB,QAAS,IAAMH,EAAsB,EAAK,EAC5C,GAEJ,CAEJ,EAEaxB,EAAkB,CAAC,CAC9B,eAAAoB,EACA,WAAAY,EACA,cAAAC,EACA,YAAAX,EACA,WAAAD,EACA,oBAAAa,EACA,IAAAC,EACA,WAAAC,CACF,OAEI,OAAC,oBAAiB,eAAgBhB,EAChC,mBAAC,wBAAqB,KAAMY,EAAW,sBAAuB,MAAOV,GAAa,SAAS,MACzF,mBAAC,mBACC,QAASA,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBY,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYZ,GAAa,WACzB,oBAAqBU,EAAW,oBAChC,SAAUV,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKa,EACL,WAAYd,EAAW,OACvB,oBAAqBW,EAAW,oBAChC,UAAWC,GAAe,UAC1B,WAAYG,EAEZ,mBAACjB,EAAA,CAAe,eAAgBC,EAAgB,WAAYC,EAAY,YAAaC,EAAa,EACpG,EACF,EACF",
6
+ "names": ["Credits_exports", "__export", "CreditsTemplate", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_provider", "import_creditsBanner", "import_creditsInfoCard", "import_creditsBenefits", "import_creditsWaysToGetCredits", "import_creditsAnkersolixTask", "import_creditsRedeemList", "import_creditsGoGift", "import_creditsCash", "import_creditsMemberPrice", "import_creditsFaq", "import_creditsNavigation", "import_ActivitiesModal", "import_RewardsModal", "import_Credits", "CreditsContent", "headlessConfig", "pageConfig", "userContext", "openMyRewardsModal", "setOpenMyRewardsModal", "openActivitiesModal", "setOpenActivitiesModal", "pageCommon", "key", "componentCopy", "ActivitiesModal", "RewardsModal", "siteConfig", "creditsConfig", "registrationContext", "gtm", "cartConfig"]
7
7
  }
@@ -0,0 +1,96 @@
1
+ import { HeadlessConfig } from '@anker-in/lib';
2
+ import { DTC_TASK_TYPE } from '../components/credits/context/const';
3
+ import { CreditsPageCommon } from '../components/credits/type';
4
+ import { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes';
5
+ import { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type';
6
+ import type { CreditsBannerCopy } from '../components/credits/creditsBanner';
7
+ import type { CreditsInfoCardCopy } from '../components/credits/creditsInfoCard';
8
+ import type { CreditsBenefitsCopy } from '../components/credits/creditsBenefits';
9
+ import type { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits';
10
+ import type { CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask';
11
+ import type { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList';
12
+ import type { CreditsGoGiftCopy } from '../components/credits/creditsGoGift';
13
+ import type { CreditsCashCopy } from '../components/credits/creditsCash';
14
+ import type { CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice';
15
+ import type { CreditsFaqCopy } from '../components/credits/creditsFaq';
16
+ import type { CreditsNavigationCopy } from '../components/credits/creditsNavigation';
17
+ export type { CreditsBannerCopy, CreditsInfoCardCopy, CreditsBenefitsCopy, CreditsWaysToGetCreditsCopy, CreditsAnkersolixTaskCopy, CreditsRedeemListCopy, CreditsGoGiftCopy, CreditsCashCopy, CreditsMemberPriceCopy, CreditsFaqCopy, CreditsNavigationCopy, };
18
+ export declare enum ComponentKey {
19
+ Navigation = "creditsNavigation",
20
+ Banner = "creditsBanner",
21
+ InfoCard = "creditsInfoCard",
22
+ Benefits = "creditsBenefits",
23
+ WaysToGetCredits = "creditsWaysToGetCredits",
24
+ AnkersolixTask = "creditsAnkersolixTask",
25
+ RedeemList = "creditsRedeemList",
26
+ GoGift = "creditsGoGift",
27
+ SpendCreditsLikeCash = "creditsCash",
28
+ MemberPrice = "creditsMemberPrice",
29
+ Faqs = "creditsFaq"
30
+ }
31
+ export type CreditsTemplateProps = {
32
+ headlessConfig: HeadlessConfig;
33
+ siteConfig: {
34
+ registrationsSettings: {
35
+ authCodeActivate: AuthCodeActivateCopy;
36
+ };
37
+ taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
38
+ memberPriceDiscount?: FunctionMemberPriceConfig[];
39
+ };
40
+ creditsConfig?: {
41
+ alpcBrand?: string;
42
+ };
43
+ pageConfig: {
44
+ order: ComponentKey[];
45
+ common: CreditsPageCommon;
46
+ components: {
47
+ [ComponentKey.Navigation]?: CreditsNavigationCopy;
48
+ [ComponentKey.Banner]?: CreditsBannerCopy;
49
+ [ComponentKey.InfoCard]?: CreditsInfoCardCopy;
50
+ [ComponentKey.Benefits]?: CreditsBenefitsCopy;
51
+ [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy;
52
+ [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy;
53
+ [ComponentKey.RedeemList]?: CreditsRedeemListCopy;
54
+ [ComponentKey.GoGift]?: CreditsGoGiftCopy;
55
+ [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy;
56
+ [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy;
57
+ [ComponentKey.Faqs]?: CreditsFaqCopy;
58
+ };
59
+ };
60
+ userContext: {
61
+ profile: any;
62
+ removeProfile: () => void;
63
+ isLoadingProfile: boolean;
64
+ creditInfo: any;
65
+ customer: any;
66
+ customerLoading: boolean;
67
+ fetchCreditInfo: () => void;
68
+ };
69
+ registrationContext: {
70
+ openSignUpPopup: () => void;
71
+ openSignInPopup: () => void;
72
+ };
73
+ gtm: {
74
+ pageGroup: string;
75
+ pageHandle?: string;
76
+ };
77
+ cartConfig?: {
78
+ addToCart: (params: {
79
+ variantList: Array<{
80
+ variant: any;
81
+ quantity: number;
82
+ attributes?: Array<{
83
+ key: string;
84
+ value: string;
85
+ }>;
86
+ }>;
87
+ cartAttributes?: Record<string, string>;
88
+ discountCodes?: string[];
89
+ }) => void | Promise<any>;
90
+ };
91
+ };
92
+ export type CreditsContentProps = {
93
+ headlessConfig: HeadlessConfig;
94
+ pageConfig: CreditsTemplateProps['pageConfig'];
95
+ userContext: CreditsTemplateProps['userContext'];
96
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var m=(i,t)=>{for(var o in t)s(i,o,{get:t[o],enumerable:!0})},c=(i,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!a.call(i,r)&&r!==o&&s(i,r,{get:()=>t[r],enumerable:!(n=d(t,r))||n.enumerable});return i};var y=i=>c(s({},"__esModule",{value:!0}),i);var f={};m(f,{ComponentKey:()=>C});module.exports=y(f);var C=(e=>(e.Navigation="creditsNavigation",e.Banner="creditsBanner",e.InfoCard="creditsInfoCard",e.Benefits="creditsBenefits",e.WaysToGetCredits="creditsWaysToGetCredits",e.AnkersolixTask="creditsAnkersolixTask",e.RedeemList="creditsRedeemList",e.GoGift="creditsGoGift",e.SpendCreditsLikeCash="creditsCash",e.MemberPrice="creditsMemberPrice",e.Faqs="creditsFaq",e))(C||{});
2
+ //# sourceMappingURL=Credits.types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/templates/Credits.types.ts"],
4
+ "sourcesContent": ["import { HeadlessConfig } from '@anker-in/lib'\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsPageCommon } from '../components/credits/type'\nimport { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\nimport type { CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport type { CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport type { CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport type { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport type { CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'\nimport type { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport type { CreditsGoGiftCopy } from '../components/credits/creditsGoGift'\nimport type { CreditsCashCopy } from '../components/credits/creditsCash'\nimport type { CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'\nimport type { CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport type { CreditsNavigationCopy } from '../components/credits/creditsNavigation'\n\n// Re-export copy types for convenience\nexport type {\n CreditsBannerCopy,\n CreditsInfoCardCopy,\n CreditsBenefitsCopy,\n CreditsWaysToGetCreditsCopy,\n CreditsAnkersolixTaskCopy,\n CreditsRedeemListCopy,\n CreditsGoGiftCopy,\n CreditsCashCopy,\n CreditsMemberPriceCopy,\n CreditsFaqCopy,\n CreditsNavigationCopy,\n}\n\nexport enum ComponentKey {\n Navigation = 'creditsNavigation',\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n AnkersolixTask = 'creditsAnkersolixTask',\n RedeemList = 'creditsRedeemList',\n GoGift = 'creditsGoGift',\n SpendCreditsLikeCash = 'creditsCash',\n MemberPrice = 'creditsMemberPrice',\n Faqs = 'creditsFaq',\n}\n\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n }\n creditsConfig?: {\n alpcBrand?: string\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Navigation]?: CreditsNavigationCopy\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.GoGift]?: CreditsGoGiftCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n pageHandle?: string\n }\n cartConfig?: {\n addToCart: (params: {\n variantList: Array<{\n variant: any\n quantity: number\n attributes?: Array<{ key: string; value: string }>\n }>\n cartAttributes?: Record<string, string>\n discountCodes?: string[]\n }) => void | Promise<any>\n }\n}\n\nexport type CreditsContentProps = {\n headlessConfig: HeadlessConfig\n pageConfig: CreditsTemplateProps['pageConfig']\n userContext: CreditsTemplateProps['userContext']\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAgCO,IAAKE,OACVA,EAAA,WAAa,oBACbA,EAAA,OAAS,gBACTA,EAAA,SAAW,kBACXA,EAAA,SAAW,kBACXA,EAAA,iBAAmB,0BACnBA,EAAA,eAAiB,wBACjBA,EAAA,WAAa,oBACbA,EAAA,OAAS,gBACTA,EAAA,qBAAuB,cACvBA,EAAA,YAAc,qBACdA,EAAA,KAAO,aAXGA,OAAA",
6
+ "names": ["Credits_types_exports", "__export", "ComponentKey", "__toCommonJS"]
7
+ }
@@ -13,7 +13,8 @@ export declare enum ConsumeType {
13
13
  }
14
14
  export declare enum AlpcConsumeType {
15
15
  Coupon = 1,
16
- Product = 2
16
+ Product = 2,
17
+ ExternalProduct = 5
17
18
  }
18
19
  export declare enum TaskType {
19
20
  Program = 1,
@@ -46,7 +47,14 @@ export declare enum RewardType {
46
47
  ApproveFail = 3,
47
48
  Unfulfilled = 4,
48
49
  Fulfilled = 5,
49
- Failed = 6
50
+ Failed = 6,
51
+ GogiftPending = 7,
52
+ GogiftApproved = 8,
53
+ GogiftSecondConfirm = 9,
54
+ GogiftRejected = 10,
55
+ GogiftCallbackPending = 11,
56
+ GogiftCallbackSuccess = 12,
57
+ GogiftCallbackTimeout = 13
50
58
  }
51
59
  export declare enum AlpcErrorCode {
52
60
  CodeLpcRedeemFailed = 180001,
@@ -1,2 +1,2 @@
1
- var h=(i=>(i[i.All=0]="All",i[i.Earned=1]="Earned",i[i.Deducted=2]="Deducted",i[i.Expired=3]="Expired",i))(h||{}),u=(f=>(f.Coupon="coupon",f.GiftCard="giftCard",f.GoGift="goGift",f.Product="product",f.ShippingCoupon="shippingCoupon",f))(u||{}),L=(o=>(o[o.Coupon=1]="Coupon",o[o.Product=2]="Product",o))(L||{}),U=(x=>(x[x.Program=1]="Program",x[x.Operation=2]="Operation",x[x.Redeem=3]="Redeem",x))(U||{}),m=(x=>(x.FirstPurchase="firstPurchase",x.UploadReceipt="uploadReceipt",x.Shopping="shopping",x))(m||{}),P=(t=>(t[t.Activation=1]="Activation",t[t.UpdateName=2]="UpdateName",t[t.UpdatePhone=3]="UpdatePhone",t[t.UpdateBirthday=4]="UpdateBirthday",t[t.Subscription=5]="Subscription",t[t.UpadteAppName=7]="UpadteAppName",t[t.Refund=3e3]="Refund",t[t.ProductUnApproved=5e3]="ProductUnApproved",t))(P||{}),c=(o=>(o.FixedMount="fixed_amount",o.Percent="percent",o))(c||{}),F=(g=>(g[g.Received=0]="Received",g[g.Pending=1]="Pending",g[g.ApproveSuccess=2]="ApproveSuccess",g[g.ApproveFail=3]="ApproveFail",g[g.Unfulfilled=4]="Unfulfilled",g[g.Fulfilled=5]="Fulfilled",g[g.Failed=6]="Failed",g))(F||{}),d=(n=>(n[n.CodeLpcRedeemFailed=180001]="CodeLpcRedeemFailed",n[n.CodeLpcUserNotFound=180002]="CodeLpcUserNotFound",n[n.CodeLpcCreditRuleNotFound=180003]="CodeLpcCreditRuleNotFound",n[n.CodeLpcUnknownError=180004]="CodeLpcUnknownError",n[n.CodeLpcNotEnoughCredits=180005]="CodeLpcNotEnoughCredits",n[n.CodeLpcUserMigrate=180006]="CodeLpcUserMigrate",n[n.CodeLpcRuleInventoryNotEnough=180007]="CodeLpcRuleInventoryNotEnough",n[n.CodeLpcShopifyCouponRuleRedeemLimit=180009]="CodeLpcShopifyCouponRuleRedeemLimit",n[n.CodeCrossSiteError=180011]="CodeCrossSiteError",n))(d||{});const M=new Map([["eu-en","eu"],["eu-de","de"]]);var N=(i=>(i[i.Pending=0]="Pending",i[i.Success=1]="Success",i[i.Failed=2]="Failed",i[i.DoubleConfirm=3]="DoubleConfirm",i))(N||{});const G={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"};export{M as ALPC_COUNTRY_MAP,L as AlpcConsumeType,d as AlpcErrorCode,N as ApprovalStatus,u as ConsumeType,c as CouponType,h as CreditType,m as DTC_TASK_TYPE,G as PRICE_SYMBOL,F as RewardType,P as TaskSubType,U as TaskType};
1
+ var c=(g=>(g[g.All=0]="All",g[g.Earned=1]="Earned",g[g.Deducted=2]="Deducted",g[g.Expired=3]="Expired",g))(c||{}),P=(f=>(f.Coupon="coupon",f.GiftCard="giftCard",f.GoGift="goGift",f.Product="product",f.ShippingCoupon="shippingCoupon",f))(P||{}),u=(t=>(t[t.Coupon=1]="Coupon",t[t.Product=2]="Product",t[t.ExternalProduct=5]="ExternalProduct",t))(u||{}),h=(t=>(t[t.Program=1]="Program",t[t.Operation=2]="Operation",t[t.Redeem=3]="Redeem",t))(h||{}),G=(t=>(t.FirstPurchase="firstPurchase",t.UploadReceipt="uploadReceipt",t.Shopping="shopping",t))(G||{}),L=(o=>(o[o.Activation=1]="Activation",o[o.UpdateName=2]="UpdateName",o[o.UpdatePhone=3]="UpdatePhone",o[o.UpdateBirthday=4]="UpdateBirthday",o[o.Subscription=5]="Subscription",o[o.UpadteAppName=7]="UpadteAppName",o[o.Refund=3e3]="Refund",o[o.ProductUnApproved=5e3]="ProductUnApproved",o))(L||{}),U=(x=>(x.FixedMount="fixed_amount",x.Percent="percent",x))(U||{}),m=(n=>(n[n.Received=0]="Received",n[n.Pending=1]="Pending",n[n.ApproveSuccess=2]="ApproveSuccess",n[n.ApproveFail=3]="ApproveFail",n[n.Unfulfilled=4]="Unfulfilled",n[n.Fulfilled=5]="Fulfilled",n[n.Failed=6]="Failed",n[n.GogiftPending=7]="GogiftPending",n[n.GogiftApproved=8]="GogiftApproved",n[n.GogiftSecondConfirm=9]="GogiftSecondConfirm",n[n.GogiftRejected=10]="GogiftRejected",n[n.GogiftCallbackPending=11]="GogiftCallbackPending",n[n.GogiftCallbackSuccess=12]="GogiftCallbackSuccess",n[n.GogiftCallbackTimeout=13]="GogiftCallbackTimeout",n))(m||{}),F=(i=>(i[i.CodeLpcRedeemFailed=180001]="CodeLpcRedeemFailed",i[i.CodeLpcUserNotFound=180002]="CodeLpcUserNotFound",i[i.CodeLpcCreditRuleNotFound=180003]="CodeLpcCreditRuleNotFound",i[i.CodeLpcUnknownError=180004]="CodeLpcUnknownError",i[i.CodeLpcNotEnoughCredits=180005]="CodeLpcNotEnoughCredits",i[i.CodeLpcUserMigrate=180006]="CodeLpcUserMigrate",i[i.CodeLpcRuleInventoryNotEnough=180007]="CodeLpcRuleInventoryNotEnough",i[i.CodeLpcShopifyCouponRuleRedeemLimit=180009]="CodeLpcShopifyCouponRuleRedeemLimit",i[i.CodeCrossSiteError=180011]="CodeCrossSiteError",i))(F||{});const M=new Map([["eu-en","eu"],["eu-de","de"]]);var N=(g=>(g[g.Pending=0]="Pending",g[g.Success=1]="Success",g[g.Failed=2]="Failed",g[g.DoubleConfirm=3]="DoubleConfirm",g))(N||{});const $={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",pl:"z\u0142",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED",es:"\u20AC"};export{M as ALPC_COUNTRY_MAP,u as AlpcConsumeType,F as AlpcErrorCode,N as ApprovalStatus,P as ConsumeType,U as CouponType,c as CreditType,G as DTC_TASK_TYPE,$ as PRICE_SYMBOL,m as RewardType,L as TaskSubType,h as TaskType};
2
2
  //# sourceMappingURL=const.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/context/const.ts"],
4
- "sourcesContent": ["export enum CreditType {\n All = 0,\n Earned = 1,\n Deducted = 2,\n Expired = 3,\n}\n\nexport enum ConsumeType {\n Coupon = 'coupon',\n GiftCard = 'giftCard',\n GoGift = 'goGift',\n Product = 'product',\n ShippingCoupon = 'shippingCoupon',\n}\n\nexport enum AlpcConsumeType {\n Coupon = 1,\n Product = 2,\n}\n\nexport enum TaskType {\n Program = 1,\n Operation = 2,\n Redeem = 3,\n}\n\nexport enum DTC_TASK_TYPE {\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shopping = 'shopping',\n}\n\nexport enum TaskSubType {\n Activation = 1, // \u6FC0\u6D3B\u4E8B\u4EF6\n UpdateName = 2, // \u5B8C\u5584\u59D3\u540D\n UpdatePhone = 3, // \u66F4\u65B0\u624B\u673A\u53F7\n UpdateBirthday = 4, // \u66F4\u65B0\u751F\u65E5\n Subscription = 5, // \u8BA2\u9605\n UpadteAppName = 7, // \u5B8C\u5584APP\u59D3\u540D\n Refund = 3000, // \u8D2D\u7269\u9001\u79EF\u5206\u4EFB\u52A1\u9000\u6B3E\n ProductUnApproved = 5000, // \u5151\u6362\u5546\u54C1\u5BA1\u6838\u4E0D\u901A\u8FC7\n}\n\nexport enum CouponType {\n FixedMount = 'fixed_amount',\n Percent = 'percent',\n}\n\nexport enum RewardType {\n Received = 0,\n Pending = 1,\n ApproveSuccess = 2,\n ApproveFail = 3,\n Unfulfilled = 4,\n Fulfilled = 5,\n Failed = 6,\n}\n\nexport enum AlpcErrorCode {\n CodeLpcRedeemFailed = 180001,\n //user not found\n CodeLpcUserNotFound = 180002,\n //credit rule not found\n CodeLpcCreditRuleNotFound = 180003,\n //unknown error\n CodeLpcUnknownError = 180004,\n // not enough credits\n CodeLpcNotEnoughCredits = 180005,\n // user migrate\n CodeLpcUserMigrate = 180006,\n // \u5E93\u5B58\u4E0D\u8DB3\n CodeLpcRuleInventoryNotEnough = 180007,\n // \u5151\u6362\u6B21\u6570\u9650\u5236\n CodeLpcShopifyCouponRuleRedeemLimit = 180009,\n // \u8DE8\u533A\u5151\u6362\u9519\u8BEF\uFF08\u975E\u6B27\u5151\u6362\u6B27\u6D32\u7684\uFF09\n CodeCrossSiteError = 180011,\n}\n\nexport const ALPC_COUNTRY_MAP = new Map<string, string>([\n ['eu-en', 'eu'],\n ['eu-de', 'de'],\n])\n\nexport enum ApprovalStatus {\n Pending = 0,\n Success = 1,\n Failed = 2,\n DoubleConfirm = 3,\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n"],
5
- "mappings": "AAAO,IAAKA,OACVA,IAAA,IAAM,GAAN,MACAA,IAAA,OAAS,GAAT,SACAA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UAJUA,OAAA,IAOAC,OACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,eAAiB,iBALPA,OAAA,IAQAC,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,QAAU,GAAV,UAFUA,OAAA,IAKAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SAHUA,OAAA,IAMAC,OACVA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAHDA,OAAA,IAMAC,OACVA,IAAA,WAAa,GAAb,aACAA,IAAA,WAAa,GAAb,aACAA,IAAA,YAAc,GAAd,cACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,aAAe,GAAf,eACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,OAAS,KAAT,SACAA,IAAA,kBAAoB,KAApB,oBARUA,OAAA,IAWAC,OACVA,EAAA,WAAa,eACbA,EAAA,QAAU,UAFAA,OAAA,IAKAC,OACVA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,YAAc,GAAd,cACAA,IAAA,YAAc,GAAd,cACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SAPUA,OAAA,IAUAC,OACVA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,0BAA4B,QAA5B,4BAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,wBAA0B,QAA1B,0BAEAA,IAAA,mBAAqB,QAArB,qBAEAA,IAAA,8BAAgC,QAAhC,gCAEAA,IAAA,oCAAsC,QAAtC,sCAEAA,IAAA,mBAAqB,QAArB,qBAjBUA,OAAA,IAoBL,MAAMC,EAAmB,IAAI,IAAoB,CACtD,CAAC,QAAS,IAAI,EACd,CAAC,QAAS,IAAI,CAChB,CAAC,EAEM,IAAKC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBAJUA,OAAA,IAOL,MAAMC,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN",
4
+ "sourcesContent": ["export enum CreditType {\n All = 0,\n Earned = 1,\n Deducted = 2,\n Expired = 3,\n}\n\nexport enum ConsumeType {\n Coupon = 'coupon',\n GiftCard = 'giftCard',\n GoGift = 'goGift',\n Product = 'product',\n ShippingCoupon = 'shippingCoupon',\n}\n\nexport enum AlpcConsumeType {\n Coupon = 1,\n Product = 2,\n ExternalProduct = 5,\n}\n\nexport enum TaskType {\n Program = 1,\n Operation = 2,\n Redeem = 3,\n}\n\nexport enum DTC_TASK_TYPE {\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shopping = 'shopping',\n}\n\nexport enum TaskSubType {\n Activation = 1, // \u6FC0\u6D3B\u4E8B\u4EF6\n UpdateName = 2, // \u5B8C\u5584\u59D3\u540D\n UpdatePhone = 3, // \u66F4\u65B0\u624B\u673A\u53F7\n UpdateBirthday = 4, // \u66F4\u65B0\u751F\u65E5\n Subscription = 5, // \u8BA2\u9605\n UpadteAppName = 7, // \u5B8C\u5584APP\u59D3\u540D\n Refund = 3000, // \u8D2D\u7269\u9001\u79EF\u5206\u4EFB\u52A1\u9000\u6B3E\n ProductUnApproved = 5000, // \u5151\u6362\u5546\u54C1\u5BA1\u6838\u4E0D\u901A\u8FC7\n}\n\nexport enum CouponType {\n FixedMount = 'fixed_amount',\n Percent = 'percent',\n}\n\nexport enum RewardType {\n Received = 0,\n Pending = 1,\n ApproveSuccess = 2,\n ApproveFail = 3,\n Unfulfilled = 4,\n Fulfilled = 5,\n Failed = 6,\n GogiftPending = 7,\n GogiftApproved = 8,\n GogiftSecondConfirm = 9,\n GogiftRejected = 10,\n GogiftCallbackPending = 11,\n GogiftCallbackSuccess = 12,\n GogiftCallbackTimeout = 13,\n}\n\nexport enum AlpcErrorCode {\n CodeLpcRedeemFailed = 180001,\n //user not found\n CodeLpcUserNotFound = 180002,\n //credit rule not found\n CodeLpcCreditRuleNotFound = 180003,\n //unknown error\n CodeLpcUnknownError = 180004,\n // not enough credits\n CodeLpcNotEnoughCredits = 180005,\n // user migrate\n CodeLpcUserMigrate = 180006,\n // \u5E93\u5B58\u4E0D\u8DB3\n CodeLpcRuleInventoryNotEnough = 180007,\n // \u5151\u6362\u6B21\u6570\u9650\u5236\n CodeLpcShopifyCouponRuleRedeemLimit = 180009,\n // \u8DE8\u533A\u5151\u6362\u9519\u8BEF\uFF08\u975E\u6B27\u5151\u6362\u6B27\u6D32\u7684\uFF09\n CodeCrossSiteError = 180011,\n}\n\nexport const ALPC_COUNTRY_MAP = new Map<string, string>([\n ['eu-en', 'eu'],\n ['eu-de', 'de'],\n])\n\nexport enum ApprovalStatus {\n Pending = 0,\n Success = 1,\n Failed = 2,\n DoubleConfirm = 3,\n}\n\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n pl: 'z\u0142',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n es: '\u20AC',\n}\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,IAAA,IAAM,GAAN,MACAA,IAAA,OAAS,GAAT,SACAA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UAJUA,OAAA,IAOAC,OACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,eAAiB,iBALPA,OAAA,IAQAC,OACVA,IAAA,OAAS,GAAT,SACAA,IAAA,QAAU,GAAV,UACAA,IAAA,gBAAkB,GAAlB,kBAHUA,OAAA,IAMAC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SAHUA,OAAA,IAMAC,OACVA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WAHDA,OAAA,IAMAC,OACVA,IAAA,WAAa,GAAb,aACAA,IAAA,WAAa,GAAb,aACAA,IAAA,YAAc,GAAd,cACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,aAAe,GAAf,eACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,OAAS,KAAT,SACAA,IAAA,kBAAoB,KAApB,oBARUA,OAAA,IAWAC,OACVA,EAAA,WAAa,eACbA,EAAA,QAAU,UAFAA,OAAA,IAKAC,OACVA,IAAA,SAAW,GAAX,WACAA,IAAA,QAAU,GAAV,UACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,YAAc,GAAd,cACAA,IAAA,YAAc,GAAd,cACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,eAAiB,GAAjB,iBACAA,IAAA,oBAAsB,GAAtB,sBACAA,IAAA,eAAiB,IAAjB,iBACAA,IAAA,sBAAwB,IAAxB,wBACAA,IAAA,sBAAwB,IAAxB,wBACAA,IAAA,sBAAwB,IAAxB,wBAdUA,OAAA,IAiBAC,OACVA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,0BAA4B,QAA5B,4BAEAA,IAAA,oBAAsB,QAAtB,sBAEAA,IAAA,wBAA0B,QAA1B,0BAEAA,IAAA,mBAAqB,QAArB,qBAEAA,IAAA,8BAAgC,QAAhC,gCAEAA,IAAA,oCAAsC,QAAtC,sCAEAA,IAAA,mBAAqB,QAArB,qBAjBUA,OAAA,IAoBL,MAAMC,EAAmB,IAAI,IAAoB,CACtD,CAAC,QAAS,IAAI,EACd,CAAC,QAAS,IAAI,CAChB,CAAC,EAEM,IAAKC,OACVA,IAAA,QAAU,GAAV,UACAA,IAAA,QAAU,GAAV,UACAA,IAAA,OAAS,GAAT,SACAA,IAAA,cAAgB,GAAhB,gBAJUA,OAAA,IAOL,MAAMC,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,MACJ,GAAI,QACN",
6
6
  "names": ["CreditType", "ConsumeType", "AlpcConsumeType", "TaskType", "DTC_TASK_TYPE", "TaskSubType", "CouponType", "RewardType", "AlpcErrorCode", "ALPC_COUNTRY_MAP", "ApprovalStatus", "PRICE_SYMBOL"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{useCallback as M,useEffect as w,useState as c}from"react";import{ALPC_COUNTRY_MAP as P,AlpcConsumeType as _}from"../const";import{useAlpcMutation as x}from"./useAlpcFetch";import{useCreditsContext as N}from"../provider";import{useHeadlessContext as T}from"@anker-in/lib";function h({page:e,pageSize:s,consumeType:r}){const{isLoadingProfile:n,profile:t,alpcBrand:g}=N(),{brand:f,locale:d,appName:C}=T(),y=g||f,R=!!t,[a,m]=c([]),[p,b]=c(0),[l,L]=c(0),{isMutating:o,trigger:u}=x({url:"/v1/credit/log/coupon",initData:{brand:y,country:P.get(d)||d,app_name:C}});w(()=>{n||!t||o||e!==l&&e&&u({consume_type:r||_.Coupon,page:e,page_size:s,user_id:t?.user_id},{onSuccess(i){L(e),b(i?.data?.total),m(a.concat(i?.data?.redeem_logs||[]))}})},[u,a,r,e,s,l,t,n,o]);const A=M(async()=>{n||!R||!t||o||await u({consume_type:r||_.Coupon,page:e,page_size:s,user_id:t?.user_id},{onSuccess(i){m(i?.data?.redeem_logs||[])}})},[r,o,n,e,s,t,u]);return{myRewards:a,isLoading:o,total:p,getMyRewards:A,canNext:p>a.length&&!o}}var H=h;export{H as default};
1
+ import{useCallback as y,useEffect as R,useState as m}from"react";import{ALPC_COUNTRY_MAP as C,AlpcConsumeType as b}from"../const";import{useAlpcMutation as A}from"./useAlpcFetch";import{useCreditsContext as M}from"../provider";import{useHeadlessContext as w}from"@anker-in/lib";function L({page:t,pageSize:o,consumeType:r}){const{profile:e,alpcBrand:i}=M(),{brand:d,locale:n,appName:c}=w(),l=i||d,[a,g]=m([]),[u,T]=m(0),{isMutating:p,trigger:_}=A({url:"/v1/credit/log/coupon",initData:{brand:l,country:C.get(n)||n,app_name:c}}),s=y(async()=>{e?.user_id&&await _({consume_type:r||b.Coupon,page:t,page_size:o,user_id:e?.user_id},{onSuccess(f){g(f?.data?.redeem_logs||[])}})},[r,t,o,e?.user_id]);return R(()=>{s()},[s]),{myRewards:a,isLoading:p,total:u,getMyRewards:s,canNext:u>a.length&&!p}}var P=L;export{P as default};
2
2
  //# sourceMappingURL=useMyRewards.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/context/hooks/useMyRewards.ts"],
4
- "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { ALPC_COUNTRY_MAP, AlpcConsumeType } from '../const'\nimport { useAlpcMutation } from './useAlpcFetch'\nimport type { RedeemLogResponse } from '../response'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useMyRewards({\n page,\n pageSize,\n consumeType,\n}: {\n page: number\n pageSize: number\n consumeType?: AlpcConsumeType\n}) {\n const { isLoadingProfile, profile, alpcBrand } = useCreditsContext()\n const { brand: headlessBrand, locale, appName } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n const isLogin = !!profile\n\n const [myRewards, setMyRewards] = useState<RedeemLogResponse[]>([])\n const [total, setTotal] = useState(0)\n\n const [currentPage, setCurrentPage] = useState(0)\n\n const { isMutating: isLoading, trigger } = useAlpcMutation<\n { data: { redeem_logs: RedeemLogResponse[]; total: number } },\n {\n page: number\n page_size: number\n consume_type: AlpcConsumeType\n user_id: string\n }\n >({\n url: `/v1/credit/log/coupon`,\n initData: {\n brand: brand,\n country: ALPC_COUNTRY_MAP.get(locale) || locale,\n app_name: appName,\n },\n })\n\n useEffect(() => {\n if (isLoadingProfile || !profile || isLoading) {\n return\n }\n\n if (page !== currentPage && page) {\n trigger(\n {\n consume_type: consumeType || AlpcConsumeType.Coupon,\n page,\n page_size: pageSize,\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n setCurrentPage(page)\n setTotal(responseData?.data?.total)\n setMyRewards(myRewards.concat(responseData?.data?.redeem_logs || []))\n },\n }\n )\n }\n }, [trigger, myRewards, consumeType, page, pageSize, currentPage, profile, isLoadingProfile, isLoading])\n\n const getMyRewards = useCallback(async () => {\n if (isLoadingProfile || !isLogin || !profile || isLoading) {\n return\n }\n await trigger(\n {\n consume_type: consumeType || AlpcConsumeType.Coupon,\n page,\n page_size: pageSize,\n user_id: profile?.user_id,\n },\n {\n // \u4EC5\u652F\u63011\u9875\u7684\n onSuccess(responseData) {\n setMyRewards(responseData?.data?.redeem_logs || [])\n },\n }\n )\n }, [consumeType, isLoading, isLoadingProfile, page, pageSize, profile, trigger])\n\n return {\n myRewards,\n isLoading,\n total,\n getMyRewards,\n canNext: total > myRewards.length && !isLoading,\n }\n}\n\nexport default useMyRewards\n"],
5
- "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,oBAAAC,EAAkB,mBAAAC,MAAuB,WAClD,OAAS,mBAAAC,MAAuB,iBAEhC,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,EAAa,CACpB,KAAAC,EACA,SAAAC,EACA,YAAAC,CACF,EAIG,CACD,KAAM,CAAE,iBAAAC,EAAkB,QAAAC,EAAS,UAAAC,CAAU,EAAIR,EAAkB,EAC7D,CAAE,MAAOS,EAAe,OAAAC,EAAQ,QAAAC,CAAQ,EAAIV,EAAmB,EAC/DW,EAAQJ,GAAaC,EACrBI,EAAU,CAAC,CAACN,EAEZ,CAACO,EAAWC,CAAY,EAAInB,EAA8B,CAAC,CAAC,EAC5D,CAACoB,EAAOC,CAAQ,EAAIrB,EAAS,CAAC,EAE9B,CAACsB,EAAaC,CAAc,EAAIvB,EAAS,CAAC,EAE1C,CAAE,WAAYwB,EAAW,QAAAC,CAAQ,EAAItB,EAQzC,CACA,IAAK,wBACL,SAAU,CACR,MAAOa,EACP,QAASf,EAAiB,IAAIa,CAAM,GAAKA,EACzC,SAAUC,CACZ,CACF,CAAC,EAEDhB,EAAU,IAAM,CACVW,GAAoB,CAACC,GAAWa,GAIhCjB,IAASe,GAAef,GAC1BkB,EACE,CACE,aAAchB,GAAeP,EAAgB,OAC7C,KAAAK,EACA,UAAWC,EACX,QAASG,GAAS,OACpB,EACA,CACE,UAAUe,EAAc,CACtBH,EAAehB,CAAI,EACnBc,EAASK,GAAc,MAAM,KAAK,EAClCP,EAAaD,EAAU,OAAOQ,GAAc,MAAM,aAAe,CAAC,CAAC,CAAC,CACtE,CACF,CACF,CAEJ,EAAG,CAACD,EAASP,EAAWT,EAAaF,EAAMC,EAAUc,EAAaX,EAASD,EAAkBc,CAAS,CAAC,EAEvG,MAAMG,EAAe7B,EAAY,SAAY,CACvCY,GAAoB,CAACO,GAAW,CAACN,GAAWa,GAGhD,MAAMC,EACJ,CACE,aAAchB,GAAeP,EAAgB,OAC7C,KAAAK,EACA,UAAWC,EACX,QAASG,GAAS,OACpB,EACA,CAEE,UAAUe,EAAc,CACtBP,EAAaO,GAAc,MAAM,aAAe,CAAC,CAAC,CACpD,CACF,CACF,CACF,EAAG,CAACjB,EAAae,EAAWd,EAAkBH,EAAMC,EAAUG,EAASc,CAAO,CAAC,EAE/E,MAAO,CACL,UAAAP,EACA,UAAAM,EACA,MAAAJ,EACA,aAAAO,EACA,QAASP,EAAQF,EAAU,QAAU,CAACM,CACxC,CACF,CAEA,IAAOI,EAAQtB",
6
- "names": ["useCallback", "useEffect", "useState", "ALPC_COUNTRY_MAP", "AlpcConsumeType", "useAlpcMutation", "useCreditsContext", "useHeadlessContext", "useMyRewards", "page", "pageSize", "consumeType", "isLoadingProfile", "profile", "alpcBrand", "headlessBrand", "locale", "appName", "brand", "isLogin", "myRewards", "setMyRewards", "total", "setTotal", "currentPage", "setCurrentPage", "isLoading", "trigger", "responseData", "getMyRewards", "useMyRewards_default"]
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { ALPC_COUNTRY_MAP, AlpcConsumeType } from '../const'\nimport { useAlpcMutation } from './useAlpcFetch'\nimport type { RedeemLogResponse } from '../response'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useMyRewards({\n page,\n pageSize,\n consumeType,\n}: {\n page: number\n pageSize: number\n consumeType?: AlpcConsumeType\n}) {\n const { profile, alpcBrand } = useCreditsContext()\n const { brand: headlessBrand, locale, appName } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n\n const [myRewards, setMyRewards] = useState<RedeemLogResponse[]>([])\n const [total, setTotal] = useState(0)\n\n const { isMutating: isLoading, trigger } = useAlpcMutation<\n { data: { redeem_logs: RedeemLogResponse[]; total: number } },\n {\n page: number\n page_size: number\n consume_type: AlpcConsumeType\n user_id: string\n }\n >({\n url: `/v1/credit/log/coupon`,\n initData: {\n brand: brand,\n country: ALPC_COUNTRY_MAP.get(locale) || locale,\n app_name: appName,\n },\n })\n\n const getMyRewards = useCallback(async () => {\n if (!profile?.user_id) {\n return\n }\n await trigger(\n {\n consume_type: consumeType || AlpcConsumeType.Coupon,\n page,\n page_size: pageSize,\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n setMyRewards(responseData?.data?.redeem_logs || [])\n },\n }\n )\n }, [consumeType, page, pageSize, profile?.user_id])\n\n useEffect(() => {\n getMyRewards()\n }, [getMyRewards])\n\n return {\n myRewards,\n isLoading,\n total,\n getMyRewards,\n canNext: total > myRewards.length && !isLoading,\n }\n}\n\nexport default useMyRewards\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,oBAAAC,EAAkB,mBAAAC,MAAuB,WAClD,OAAS,mBAAAC,MAAuB,iBAEhC,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,EAAa,CACpB,KAAAC,EACA,SAAAC,EACA,YAAAC,CACF,EAIG,CACD,KAAM,CAAG,QAAAC,EAAS,UAAAC,CAAU,EAAIP,EAAkB,EAC5C,CAAE,MAAOQ,EAAe,OAAAC,EAAQ,QAAAC,CAAQ,EAAIT,EAAmB,EAC/DU,EAAQJ,GAAaC,EAErB,CAACI,EAAWC,CAAY,EAAIjB,EAA8B,CAAC,CAAC,EAC5D,CAACkB,EAAOC,CAAQ,EAAInB,EAAS,CAAC,EAE9B,CAAE,WAAYoB,EAAW,QAAAC,CAAQ,EAAIlB,EAQzC,CACA,IAAK,wBACL,SAAU,CACR,MAAOY,EACP,QAASd,EAAiB,IAAIY,CAAM,GAAKA,EACzC,SAAUC,CACZ,CACF,CAAC,EAEKQ,EAAexB,EAAY,SAAY,CACtCY,GAAS,SAGd,MAAMW,EACJ,CACE,aAAcZ,GAAeP,EAAgB,OAC7C,KAAAK,EACA,UAAWC,EACX,QAASE,GAAS,OACpB,EACA,CACE,UAAUa,EAAc,CACtBN,EAAaM,GAAc,MAAM,aAAe,CAAC,CAAC,CACpD,CACF,CACF,CACF,EAAG,CAACd,EAAaF,EAAMC,EAAUE,GAAS,OAAO,CAAC,EAElD,OAAAX,EAAU,IAAM,CACduB,EAAa,CACf,EAAG,CAACA,CAAY,CAAC,EAEV,CACL,UAAAN,EACA,UAAAI,EACA,MAAAF,EACA,aAAAI,EACA,QAASJ,EAAQF,EAAU,QAAU,CAACI,CACxC,CACF,CAEA,IAAOI,EAAQlB",
6
+ "names": ["useCallback", "useEffect", "useState", "ALPC_COUNTRY_MAP", "AlpcConsumeType", "useAlpcMutation", "useCreditsContext", "useHeadlessContext", "useMyRewards", "page", "pageSize", "consumeType", "profile", "alpcBrand", "headlessBrand", "locale", "appName", "brand", "myRewards", "setMyRewards", "total", "setTotal", "isLoading", "trigger", "getMyRewards", "responseData", "useMyRewards_default"]
7
7
  }
@@ -0,0 +1,17 @@
1
+ import { type UseMutationConfig } from './useAlpcFetch';
2
+ type RedeemGoGiftResponse = {
3
+ data: {
4
+ id: string;
5
+ };
6
+ msg: string;
7
+ code: number;
8
+ };
9
+ export declare const useRedeemGoGift: (mutationOptions?: UseMutationConfig<RedeemGoGiftResponse>) => {
10
+ isMutating: boolean;
11
+ trigger: (fetchData: {
12
+ user_id?: string;
13
+ rule_id: number;
14
+ }, opts?: UseMutationConfig<RedeemGoGiftResponse>) => Promise<RedeemGoGiftResponse | undefined>;
15
+ data: RedeemGoGiftResponse | undefined;
16
+ };
17
+ export {};
@@ -0,0 +1,2 @@
1
+ import{ALPC_COUNTRY_MAP as s}from"../const";import{useAlpcMutation as i}from"./useAlpcFetch";import{useHeadlessContext as a}from"@anker-in/lib";import{useCreditsContext as d}from"../provider";const g=(t={})=>{const{alpcBrand:o}=d(),{locale:e,appName:n,brand:r}=a();return i({url:"/v1/credit/redeem/gogift",initData:{brand:o||r,country:s.get(e)||e,app_name:n}},t)};export{g as useRedeemGoGift};
2
+ //# sourceMappingURL=useRedeemGoGift.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/hooks/useRedeemGoGift.ts"],
4
+ "sourcesContent": ["import { ALPC_COUNTRY_MAP } from '../const'\nimport { useAlpcMutation, type UseMutationConfig } from './useAlpcFetch'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { useCreditsContext } from '../provider'\n\ntype RedeemGoGiftResponse = {\n data: {\n id: string\n }\n msg: string // \u62A5\u9519\u4FE1\u606F\n code: number // \u62A5\u9519\u7801\n}\n\nexport const useRedeemGoGift = (mutationOptions: UseMutationConfig<RedeemGoGiftResponse> = {}) => {\n const { alpcBrand } = useCreditsContext()\n const { locale, appName, brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\n\n return useAlpcMutation<\n RedeemGoGiftResponse,\n {\n user_id?: string\n rule_id: number\n }\n >(\n {\n url: `/v1/credit/redeem/gogift`,\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": "AAAA,OAAS,oBAAAA,MAAwB,WACjC,OAAS,mBAAAC,MAA+C,iBACxD,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,qBAAAC,MAAyB,cAU3B,MAAMC,EAAkB,CAACC,EAA2D,CAAC,IAAM,CAChG,KAAM,CAAE,UAAAC,CAAU,EAAIH,EAAkB,EAClC,CAAE,OAAAI,EAAQ,QAAAC,EAAS,MAAOC,CAAc,EAAIP,EAAmB,EAGrE,OAAOD,EAOL,CACE,IAAK,2BACL,SAAU,CACR,MAZQK,GAAaG,EAarB,QAAST,EAAiB,IAAIO,CAAM,GAAKA,EACzC,SAAUC,CACZ,CACF,EACAH,CACF,CACF",
6
+ "names": ["ALPC_COUNTRY_MAP", "useAlpcMutation", "useHeadlessContext", "useCreditsContext", "useRedeemGoGift", "mutationOptions", "alpcBrand", "locale", "appName", "headlessBrand"]
7
+ }
@@ -1,7 +1,12 @@
1
+ import { AlpcConsumeType } from '../const';
1
2
  import type { ConsumeCreditRuleResponse } from '../response';
2
- declare function useRedeemableList(): {
3
+ declare function useRedeemableList(props?: {
4
+ consumeType: AlpcConsumeType;
5
+ }): {
3
6
  listLoading: boolean;
4
7
  redeemableList: ConsumeCreditRuleResponse[];
5
- getRedeemableList: () => void;
8
+ getRedeemableList: (props?: {
9
+ consumeType?: AlpcConsumeType;
10
+ }) => void;
6
11
  };
7
12
  export default useRedeemableList;
@@ -1,2 +1,2 @@
1
- import{useCallback as R,useEffect as b,useState as x}from"react";import{useAlpcMutation as y}from"./useAlpcFetch";import{ALPC_COUNTRY_MAP as S}from"../const";import{useCreditsContext as A}from"../provider";import{useHeadlessContext as M}from"@anker-in/lib";function P(){let t="";const{profile:n,isLoadingProfile:c,alpcBrand:m}=A(),{locale:u,brand:p}=M(),_=m||p;u==="pl"?t="eu":t=u;const[f,g]=x([]),{isMutating:C,trigger:l}=y({url:"/v1/credit/consume_credit_rules",initData:{brand:_,page:1,page_size:999,country:(S.get(t)||t)?.toUpperCase()}}),s=R(()=>{l({user_id:n?.user_id},{onSuccess(L){let a=L.data.consume_credit_rules||[],r=a.filter(e=>e.consume_type==1)||[],o=a.filter(e=>e.consume_type==2)||[];r=r.sort((e,i)=>e.consume_credits-i.consume_credits),o=o.sort((e,i)=>e.consume_credits-i.consume_credits);const d=r.concat(o);g(d),localStorage?.setItem(`consume_credit_rules-${t}`,JSON.stringify({expire:Date.now()+10*60*1e3,consume_credit_rules:d}))}})},[n,l,t]);return b(()=>{c||s()},[s,c]),{listLoading:C,redeemableList:f,getRedeemableList:s}}var h=P;export{h as default};
1
+ import{useCallback as y,useEffect as _,useState as g}from"react";import{useAlpcMutation as T}from"./useAlpcFetch";import{ALPC_COUNTRY_MAP as R}from"../const";import{useCreditsContext as L}from"../provider";import{useHeadlessContext as b}from"@anker-in/lib";function A(c){let e="";const{profile:t,isLoadingProfile:o,alpcBrand:l}=L(),{locale:n,brand:m}=b(),p=l||m;n==="pl"?e="eu":e=n;const[a,d]=g([]),{isMutating:C,trigger:r}=T({url:"/v1/credit/consume_credit_rules",initData:{brand:p,page:1,page_size:999,country:(R.get(e)||e)?.toUpperCase()}}),s=y(u=>{r({user_id:t?.user_id,...u?.consumeType&&{consume_type:u.consumeType}},{onSuccess(i){console.log("responseData",i);let f=i.data.consume_credit_rules||[];d(f)}})},[t,r,e]);return _(()=>{o||s({consumeType:c?.consumeType})},[s,o]),{listLoading:C,redeemableList:a,getRedeemableList:s}}var h=A;export{h as default};
2
2
  //# sourceMappingURL=useRedeemableList.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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, alpcBrand } = useCreditsContext()\n const { locale: contextLocale, brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\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: 999,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n },\n })\n\n const getRedeemableList = useCallback(() => {\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": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,mBAAAC,MAAuB,iBAChC,OAAS,oBAAAC,MAAwB,WACjC,OAAS,qBAAAC,MAAyB,cAElC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,UAAAC,CAAU,EAAIN,EAAkB,EAC7D,CAAE,OAAQO,EAAe,MAAOC,CAAc,EAAIP,EAAmB,EACrEQ,EAAQH,GAAaE,EAEvBD,IAAkB,KACpBJ,EAAS,KAETA,EAASI,EAGX,KAAM,CAACG,EAAgBC,CAAiB,EAAId,EAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYe,EAAa,QAAAC,CAAQ,EAAIf,EAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAW,EACA,KAAM,EACN,UAAW,IACX,SAAUV,EAAiB,IAAII,CAAM,GAAKA,IAAS,YAAY,CACjE,CACF,CAAC,EAEKW,EAAoBnB,EAAY,IAAM,CAC1CkB,EACE,CACE,QAAST,GAAS,OACpB,EACA,CACE,UAAUW,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,EACrCR,EAAkBW,CAAU,EAE5B,cAAc,QACZ,wBAAwBnB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBmB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAAClB,EAASS,EAASV,CAAM,CAAC,EAE7B,OAAAP,EAAU,IAAM,CACTS,GACHS,EAAkB,CAEtB,EAAG,CAACA,EAAmBT,CAAgB,CAAC,EAEjC,CACL,YAAAO,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOS,EAAQrB",
6
- "names": ["useCallback", "useEffect", "useState", "useAlpcMutation", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "useRedeemableList", "locale", "profile", "isLoadingProfile", "alpcBrand", "contextLocale", "headlessBrand", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList", "useRedeemableList_default"]
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP, AlpcConsumeType } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList(props?: { consumeType: AlpcConsumeType }) {\n let locale = '' as string\n const { profile, isLoadingProfile, alpcBrand } = useCreditsContext()\n const { locale: contextLocale, brand: headlessBrand } = useHeadlessContext()\n const brand = alpcBrand || headlessBrand\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 { consume_type?: AlpcConsumeType, user_id?: string}\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 999,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n },\n })\n\n const getRedeemableList = useCallback((props?: { consumeType?: AlpcConsumeType}) => {\n trigger(\n {\n user_id: profile?.user_id,\n ...(props?.consumeType && {consume_type: props.consumeType})\n },\n {\n onSuccess(responseData) {\n console.log('responseData', 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(list)\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList({ consumeType: props?.consumeType })\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAS,mBAAAC,MAAuB,iBAChC,OAAS,oBAAAC,MAAyC,WAClD,OAAS,qBAAAC,MAAyB,cAElC,OAAS,sBAAAC,MAA0B,gBAEnC,SAASC,EAAkBC,EAA0C,CACnE,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,EAAkB,UAAAC,CAAU,EAAIP,EAAkB,EAC7D,CAAE,OAAQQ,EAAe,MAAOC,CAAc,EAAIR,EAAmB,EACrES,EAAQH,GAAaE,EAEvBD,IAAkB,KACpBJ,EAAS,KAETA,EAASI,EAGX,KAAM,CAACG,EAAgBC,CAAiB,EAAIf,EAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYgB,EAAa,QAAAC,CAAQ,EAAIhB,EAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAY,EACA,KAAM,EACN,UAAW,IACX,SAAUX,EAAiB,IAAIK,CAAM,GAAKA,IAAS,YAAY,CACjE,CACF,CAAC,EAEKW,EAAoBpB,EAAaQ,GAA6C,CAClFW,EACE,CACE,QAAST,GAAS,QAClB,GAAIF,GAAO,aAAe,CAAC,aAAcA,EAAM,WAAW,CAC5D,EACA,CACE,UAAUa,EAAc,CACtB,QAAQ,IAAI,eAAgBA,CAAY,EACxC,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAMtDJ,EAAkBK,CAAI,CACxB,CACF,CACF,CACF,EAAG,CAACZ,EAASS,EAASV,CAAM,CAAC,EAE7B,OAAAR,EAAU,IAAM,CACTU,GACHS,EAAkB,CAAE,YAAaZ,GAAO,WAAY,CAAC,CAEzD,EAAG,CAACY,EAAmBT,CAAgB,CAAC,EAEjC,CACL,YAAAO,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOG,EAAQhB",
6
+ "names": ["useCallback", "useEffect", "useState", "useAlpcMutation", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "useRedeemableList", "props", "locale", "profile", "isLoadingProfile", "alpcBrand", "contextLocale", "headlessBrand", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "responseData", "list", "useRedeemableList_default"]
7
7
  }
@@ -35,8 +35,12 @@ type Context = {
35
35
  discountCodes?: string[];
36
36
  }) => void | Promise<any>;
37
37
  };
38
+ openMyRewardsModal: boolean;
39
+ setOpenMyRewardsModal: (open: boolean) => void;
40
+ openActivitiesModal: boolean;
41
+ setOpenActivitiesModal: (open: boolean) => void;
38
42
  };
39
43
  export declare const CreditsContext: import("react").Context<Context>;
40
- export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, memberPriceDiscount, alpcBrand, cartConfig, }: PropsWithChildren<Context>): import("react/jsx-runtime").JSX.Element;
44
+ export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, memberPriceDiscount, alpcBrand, cartConfig, }: PropsWithChildren<Omit<Context, 'openMyRewardsModal' | 'setOpenMyRewardsModal' | 'openActivitiesModal' | 'setOpenActivitiesModal'>>): import("react/jsx-runtime").JSX.Element;
41
45
  export declare function useCreditsContext(): Context;
42
46
  export {};
@@ -1,2 +1,2 @@
1
- import{jsx as y}from"react/jsx-runtime";import{createContext as l,useContext as v}from"react";const o=l({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:e=>{},gtm:{pageGroup:"",pageHandle:""},pageCommon:{},memberPriceDiscount:void 0,alpcBrand:void 0,cartConfig:void 0});function _({children:e,profile:r,removeProfile:n,isLoadingProfile:t,openSignInPopup:i,openSignUpPopup:s,taskIdToTypeMapping:d,creditInfo:p,customer:a,customerLoading:g,fetchCreditInfo:u,gtm:C,pageCommon:m,memberPriceDiscount:f,alpcBrand:c,cartConfig:P}){return y(o.Provider,{value:{profile:r,isLoadingProfile:t,removeProfile:n,openSignInPopup:i,openSignUpPopup:s,taskIdToTypeMapping:d,creditInfo:p,fetchCreditInfo:u,customer:a,customerLoading:g,gtm:C,pageCommon:m,memberPriceDiscount:f,alpcBrand:c,cartConfig:P},children:e})}function A(){const e=v(o);if(!e)throw new Error("useCreditsContext must be used within a CreditsProvider");return e}export{o as CreditsContext,_ as CreditsProvider,A as useCreditsContext};
1
+ import{jsx as R}from"react/jsx-runtime";import{createContext as A,useContext as x,useState as o}from"react";const t=A({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:e=>{},gtm:{pageGroup:"",pageHandle:""},pageCommon:{},memberPriceDiscount:void 0,alpcBrand:void 0,cartConfig:void 0,openMyRewardsModal:!1,setOpenMyRewardsModal:()=>{},openActivitiesModal:!1,setOpenActivitiesModal:()=>{}});function _({children:e,profile:n,removeProfile:i,isLoadingProfile:r,openSignInPopup:s,openSignUpPopup:a,taskIdToTypeMapping:d,creditInfo:p,customer:l,customerLoading:c,fetchCreditInfo:f,gtm:u,pageCommon:g,memberPriceDiscount:m,alpcBrand:C,cartConfig:M}){const[v,P]=o(!1),[y,b]=o(!1);return R(t.Provider,{value:{profile:n,isLoadingProfile:r,removeProfile:i,openSignInPopup:s,openSignUpPopup:a,taskIdToTypeMapping:d,creditInfo:p,fetchCreditInfo:f,customer:l,customerLoading:c,gtm:u,pageCommon:g,memberPriceDiscount:m,alpcBrand:C,cartConfig:M,openMyRewardsModal:v,setOpenMyRewardsModal:P,openActivitiesModal:y,setOpenActivitiesModal:b},children:e})}function L(){const e=x(t);if(!e)throw new Error("useCreditsContext must be used within a CreditsProvider");return e}export{t as CreditsContext,_ as CreditsProvider,L as useCreditsContext};
2
2
  //# sourceMappingURL=provider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/context/provider.tsx"],
4
- "sourcesContent": ["import { createContext, PropsWithChildren, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\nimport { CreditsPageCommon } from '../type'\nimport { FunctionMemberPriceConfig } from './memberPriceTypes'\n\ntype Context = {\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 pageHandle?: string\n }\n pageCommon: CreditsPageCommon\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n alpcBrand?: string\n cartConfig?: {\n addToCart: (params: {\n variantList: Array<{\n variant: any\n quantity: number\n attributes?: Array<{ key: string; value: string }>\n }>\n cartAttributes?: Record<string, string>\n discountCodes?: string[]\n }) => void | Promise<any>\n }\n}\n\nexport const CreditsContext = createContext<Context>({\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 pageHandle: '',\n },\n pageCommon: {},\n memberPriceDiscount: undefined,\n alpcBrand: undefined,\n cartConfig: undefined,\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 pageCommon,\n memberPriceDiscount,\n alpcBrand,\n cartConfig,\n}: PropsWithChildren<Context>) {\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 pageCommon,\n memberPriceDiscount,\n alpcBrand,\n cartConfig,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n const context = useContext(CreditsContext)\n if (!context) {\n throw new Error('useCreditsContext must be used within a CreditsProvider')\n }\n return context\n}\n"],
5
- "mappings": "AA4EI,cAAAA,MAAA,oBA5EJ,OAAS,iBAAAC,EAAkC,cAAAC,MAAkB,QAqCtD,MAAMC,EAAiBF,EAAuB,CACnD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBG,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,GACX,WAAY,EACd,EACA,WAAY,CAAC,EACb,oBAAqB,OACrB,UAAW,OACX,WAAY,MACd,CAAC,EAEM,SAASC,EAAgB,CAC9B,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,EACA,WAAAC,CACF,EAA+B,CAC7B,OACErB,EAACG,EAAe,SAAf,CACC,MAAO,CACL,QAAAI,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,EACA,WAAAC,CACF,EAEC,SAAAf,EACH,CAEJ,CAEO,SAASgB,GAAoB,CAClC,MAAMC,EAAUrB,EAAWC,CAAc,EACzC,GAAI,CAACoB,EACH,MAAM,IAAI,MAAM,yDAAyD,EAE3E,OAAOA,CACT",
6
- "names": ["jsx", "createContext", "useContext", "CreditsContext", "user_id", "CreditsProvider", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm", "pageCommon", "memberPriceDiscount", "alpcBrand", "cartConfig", "useCreditsContext", "context"]
4
+ "sourcesContent": ["import { createContext, PropsWithChildren, useContext, useState } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\nimport { CreditsPageCommon } from '../type'\nimport { FunctionMemberPriceConfig } from './memberPriceTypes'\n\ntype Context = {\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 pageHandle?: string\n }\n pageCommon: CreditsPageCommon\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n alpcBrand?: string\n cartConfig?: {\n addToCart: (params: {\n variantList: Array<{\n variant: any\n quantity: number\n attributes?: Array<{ key: string; value: string }>\n }>\n cartAttributes?: Record<string, string>\n discountCodes?: string[]\n }) => void | Promise<any>\n }\n openMyRewardsModal: boolean\n setOpenMyRewardsModal: (open: boolean) => void\n openActivitiesModal: boolean\n setOpenActivitiesModal: (open: boolean) => void\n}\n\nexport const CreditsContext = createContext<Context>({\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 pageHandle: '',\n },\n pageCommon: {},\n memberPriceDiscount: undefined,\n alpcBrand: undefined,\n cartConfig: undefined,\n openMyRewardsModal: false,\n setOpenMyRewardsModal: () => {},\n openActivitiesModal: false,\n setOpenActivitiesModal: () => {},\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 pageCommon,\n memberPriceDiscount,\n alpcBrand,\n cartConfig,\n}: PropsWithChildren<Omit<Context, 'openMyRewardsModal' | 'setOpenMyRewardsModal' | 'openActivitiesModal' | 'setOpenActivitiesModal'>>) {\n const [openMyRewardsModal, setOpenMyRewardsModal] = useState(false)\n const [openActivitiesModal, setOpenActivitiesModal] = useState(false)\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 pageCommon,\n memberPriceDiscount,\n alpcBrand,\n cartConfig,\n openMyRewardsModal,\n setOpenMyRewardsModal,\n openActivitiesModal,\n setOpenActivitiesModal,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n const context = useContext(CreditsContext)\n if (!context) {\n throw new Error('useCreditsContext must be used within a CreditsProvider')\n }\n return context\n}\n"],
5
+ "mappings": "AAuFI,cAAAA,MAAA,oBAvFJ,OAAS,iBAAAC,EAAkC,cAAAC,EAAY,YAAAC,MAAgB,QAyChE,MAAMC,EAAiBH,EAAuB,CACnD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBI,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,GACX,WAAY,EACd,EACA,WAAY,CAAC,EACb,oBAAqB,OACrB,UAAW,OACX,WAAY,OACZ,mBAAoB,GACpB,sBAAuB,IAAM,CAAC,EAC9B,oBAAqB,GACrB,uBAAwB,IAAM,CAAC,CACjC,CAAC,EAEM,SAASC,EAAgB,CAC9B,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,EACA,WAAAC,CACF,EAAwI,CACtI,KAAM,CAACC,EAAoBC,CAAqB,EAAIrB,EAAS,EAAK,EAC5D,CAACsB,EAAqBC,CAAsB,EAAIvB,EAAS,EAAK,EAEpE,OACEH,EAACI,EAAe,SAAf,CACC,MAAO,CACL,QAAAI,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,EACA,WAAAC,EACA,oBAAAC,EACA,UAAAC,EACA,WAAAC,EACA,mBAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,uBAAAC,CACF,EAEC,SAAAnB,EACH,CAEJ,CAEO,SAASoB,GAAoB,CAClC,MAAMC,EAAU1B,EAAWE,CAAc,EACzC,GAAI,CAACwB,EACH,MAAM,IAAI,MAAM,yDAAyD,EAE3E,OAAOA,CACT",
6
+ "names": ["jsx", "createContext", "useContext", "useState", "CreditsContext", "user_id", "CreditsProvider", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm", "pageCommon", "memberPriceDiscount", "alpcBrand", "cartConfig", "openMyRewardsModal", "setOpenMyRewardsModal", "openActivitiesModal", "setOpenActivitiesModal", "useCreditsContext", "context"]
7
7
  }
@@ -44,6 +44,7 @@ export interface RedeemLogResponse extends BaseResponse {
44
44
  approval_status: ApprovalStatus;
45
45
  rule_id: number;
46
46
  code_status: number;
47
+ link?: string;
47
48
  }
48
49
  export interface CreditTaskResponse extends Task {
49
50
  status: number;
@@ -1,2 +1,2 @@
1
- import{Fragment as R,jsx as e,jsxs as l}from"react/jsx-runtime";import{Button as w,Container as j,Heading as I,Picture as y,Text as z}from"@anker-in/headless-ui";import{ChevronDownIcon as E,ChevronUpIcon as _}from"@heroicons/react/24/outline";import{useMemo as H,useState as r,useEffect as q}from"react";import{TaskType as h}from"./type";import{useActions as V}from"../creditsWaysToGetCredits/useActions";import{useCreditsContext as G}from"../context/provider";import{classNames as g,useHeadlessContext as J}from"@anker-in/lib";import{useRegistration as K}from"../../registration";import{CreditsUploadReceiptModal as Q}from"../modal/creditsUploadReceiptModal";import{CreditsSubscribeModal as W}from"../modal/subscribeModal";import{ROUNDED_BRANDS as X}from"../../../constants";const ce=({copy:s,classNames:Y,id:p})=>{const[n,v]=r(!1),{profile:T}=G(),{authCodeActivate:M}=K(),{brand:A}=J(),u=X.includes(A),x=!!T,[L,k]=r(!1),[U,m]=r(!1),[C,O]=r(!1),[F,B]=r(!1),{actions:f}=V({copy:s,subscribe:{openSubscribePopup:()=>m(!0),isSuccess:C},uploadReceipt:{openUploadReceiptPopup:()=>k(!0),isSuccess:F}}),o=(s?.list||[]).length>3;q(()=>{if(!n&&o&&window.screen.width<768){const t=setTimeout(()=>{const i=document.getElementById(p||"ankersolix-task");i&&i.scrollIntoView({behavior:"smooth",block:"end"})},300);return()=>clearTimeout(t)}},[n,o,p]);const D=H(()=>{const t=s.list.map(i=>{if(!f[i.id])return;const{finished:a,notLogin:N,notFinished:b,completed:P}=f[i.id];let d="",c,S;return x?a?(d=P.buttonLabel,c=void 0):(d=b.buttonLabel,c=b.handleClick,S=b.link):(d=N.buttonLabel,c=N.handleClick),{...i,buttonLabel:d,handleClick:c,finished:a,link:S}}).filter(Boolean);return x?t.sort((i,a)=>i?.finished&&!a?.finished?1:!i?.finished&&a?.finished?-1:0):t},[f,s.list,x]);return l(j,{id:p,className:"bg-[#F5F5F7]",children:[e(I,{as:"h2",size:"4",html:s.title}),l("div",{className:g("mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden",u?"rounded-[8px]":"",!u&&"l:rounded-none"),style:{background:"linear-gradient(180deg, rgba(255, 241, 214, 0) 39.51%, #F4CA81 119.53%)"},children:[e("div",{className:"absolute inset-0 pointer-events-none -z-10",style:{background:"radial-gradient(ellipse 130% 205% at 45% -20%, #FFF6EA 0%, #FFFFFF 73%, #FFF1D6 100%)"}}),l("div",{className:"flex items-center justify-between xl-xxl:h-[448px] l-xl:h-[336px] h-[560px] l:h-auto md:flex-col md:items-start l:h-auto l:mb-[16px] l:flex-col-reverse l:items-start",children:[l("div",{className:"flex flex-col gap-[8px] l:mt-[8px]",children:[e(I,{as:"h3",size:4,html:s?.subtitle,className:"text-[32px] font-bold text-[#080a0f] tracking-[-1.28px] leading-[1.2] xl:text-[24px]"}),e("div",{className:"flex items-center gap-[8px]",children:e("p",{className:"text-[48px] font-bold leading-none bg-gradient-to-r from-[#2c7ed0] via-[#00a9e1] via-43% to-[#00db84] bg-clip-text text-transparent xl-xxl:text-[40px] l-xl:text-[32px] l:text-[24px]",dangerouslySetInnerHTML:{__html:s.equalCredits}})})]}),s.mainImage?.url&&e(y,{className:"h-full object-contain l:mx-auto md:h-auto md:w-full md-l:h-[302px]",imgClassName:"!h-full !object-contain",source:s.mainImage.url})]}),l("div",{className:"relative mt-[24px]",children:[l("div",{className:g("grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto transition-all duration-300 ease-in-out"),style:{height:n||!o?"auto":"512px"},children:[D.map(t=>l("div",{className:g("flex min-h-[241px] xl-xxl:min-h-[192px] l:min-h-[160px] l-xl:min-h-[170px] flex-col justify-between bg-white p-[32px] xl:p-[16px]",u?"rounded-[16px]":""),children:[l("div",{children:[e(z,{as:"p",html:t.title,size:2,className:"text-pretty text-[24px] font-bold xxl:text-[20px]"}),l("div",{className:"mt-[8px] l:mt-[4px] flex items-center",children:[e(y,{className:"size-[24px] xxl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),e(z,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] xxl:text-[14px]"})]})]}),t.handleClick&&!(t.id===h.UploadReceipt&&F)&&!(t.id===h.Activate&&M.isActivateSuccess)&&!(t.id===h.Subscribe&&C)?e(w,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:t.buttonLabel}):e(w,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:t.buttonLabel})]},t.id)),!n&&o&&e("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(244, 202, 129, 0) 66.37%, #f4ca81 100%)"}})]}),o&&e(R,{children:n?e("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:e(_,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):e(R,{children:e("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:e("button",{className:"w-fit",onClick:()=>v(!n),children:e(E,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})})]})]}),s.receipt&&e(Q,{isOpen:L,onClose:()=>{k(!1)},copy:s.receipt,onSuccess:()=>{B(!0)}}),s.subscribe&&e(W,{copy:s.subscribe,onSuccess:()=>{O(!0),setTimeout(()=>{m(!1)},3e3)},isOpen:U,onClose:()=>{m(!1)}})]})};export{ce as CreditsAnkersolixTask};
1
+ import{Fragment as R,jsx as e,jsxs as l}from"react/jsx-runtime";import{Button as w,Container as j,Heading as I,Picture as y,Text as z}from"@anker-in/headless-ui";import{ChevronDownIcon as E,ChevronUpIcon as _}from"@heroicons/react/24/outline";import{useMemo as H,useState as r,useEffect as q}from"react";import{TaskType as h}from"./type";import{useActions as V}from"../creditsWaysToGetCredits/useActions";import{useCreditsContext as G}from"../context/provider";import{classNames as g,useHeadlessContext as J}from"@anker-in/lib";import{useRegistration as K}from"../../registration";import{CreditsUploadReceiptModal as Q}from"../modal/CreditsUploadReceiptModal";import{CreditsSubscribeModal as W}from"../modal/SubscribeModal";import{ROUNDED_BRANDS as X}from"../../../constants";const ce=({copy:s,classNames:Y,id:p})=>{const[n,v]=r(!1),{profile:T}=G(),{authCodeActivate:M}=K(),{brand:A}=J(),u=X.includes(A),x=!!T,[L,k]=r(!1),[U,m]=r(!1),[C,O]=r(!1),[F,B]=r(!1),{actions:f}=V({copy:s,subscribe:{openSubscribePopup:()=>m(!0),isSuccess:C},uploadReceipt:{openUploadReceiptPopup:()=>k(!0),isSuccess:F}}),o=(s?.list||[]).length>3;q(()=>{if(!n&&o&&window.screen.width<768){const t=setTimeout(()=>{const i=document.getElementById(p||"ankersolix-task");i&&i.scrollIntoView({behavior:"smooth",block:"end"})},300);return()=>clearTimeout(t)}},[n,o,p]);const D=H(()=>{const t=s.list.map(i=>{if(!f[i.id])return;const{finished:a,notLogin:N,notFinished:b,completed:P}=f[i.id];let d="",c,S;return x?a?(d=P.buttonLabel,c=void 0):(d=b.buttonLabel,c=b.handleClick,S=b.link):(d=N.buttonLabel,c=N.handleClick),{...i,buttonLabel:d,handleClick:c,finished:a,link:S}}).filter(Boolean);return x?t.sort((i,a)=>i?.finished&&!a?.finished?1:!i?.finished&&a?.finished?-1:0):t},[f,s.list,x]);return l(j,{id:p,className:"bg-[#F5F5F7]",children:[e(I,{as:"h2",size:"4",html:s.title}),l("div",{className:g("mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden",u?"rounded-[8px]":"",!u&&"l:rounded-none"),style:{background:"linear-gradient(180deg, rgba(255, 241, 214, 0) 39.51%, #F4CA81 119.53%)"},children:[e("div",{className:"absolute inset-0 pointer-events-none -z-10",style:{background:"radial-gradient(ellipse 130% 205% at 45% -20%, #FFF6EA 0%, #FFFFFF 73%, #FFF1D6 100%)"}}),l("div",{className:"flex items-center justify-between xl-xxl:h-[448px] l-xl:h-[336px] h-[560px] l:h-auto md:flex-col md:items-start l:h-auto l:mb-[16px] l:flex-col-reverse l:items-start",children:[l("div",{className:"flex flex-col gap-[8px] l:mt-[8px]",children:[e(I,{as:"h3",size:4,html:s?.subtitle,className:"text-[32px] font-bold text-[#080a0f] tracking-[-1.28px] leading-[1.2] xl:text-[24px]"}),e("div",{className:"flex items-center gap-[8px]",children:e("p",{className:"text-[48px] font-bold leading-none bg-gradient-to-r from-[#2c7ed0] via-[#00a9e1] via-43% to-[#00db84] bg-clip-text text-transparent xl-xxl:text-[40px] l-xl:text-[32px] l:text-[24px]",dangerouslySetInnerHTML:{__html:s.equalCredits}})})]}),s.mainImage?.url&&e(y,{className:"h-full object-contain l:mx-auto md:h-auto md:w-full md-l:h-[302px]",imgClassName:"!h-full !object-contain",source:s.mainImage.url})]}),l("div",{className:"relative mt-[24px]",children:[l("div",{className:g("grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto transition-all duration-300 ease-in-out"),style:{height:n||!o?"auto":"512px"},children:[D.map(t=>l("div",{className:g("flex min-h-[241px] xl-xxl:min-h-[192px] l:min-h-[160px] l-xl:min-h-[170px] flex-col justify-between bg-white p-[32px] xl:p-[16px]",u?"rounded-[16px]":""),children:[l("div",{children:[e(z,{as:"p",html:t.title,size:2,className:"text-pretty text-[24px] font-bold xxl:text-[20px]"}),l("div",{className:"mt-[8px] l:mt-[4px] flex items-center",children:[e(y,{className:"size-[24px] xxl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),e(z,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] xxl:text-[14px]"})]})]}),t.handleClick&&!(t.id===h.UploadReceipt&&F)&&!(t.id===h.Activate&&M.isActivateSuccess)&&!(t.id===h.Subscribe&&C)?e(w,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:t.buttonLabel}):e(w,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:t.buttonLabel})]},t.id)),!n&&o&&e("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(244, 202, 129, 0) 66.37%, #f4ca81 100%)"}})]}),o&&e(R,{children:n?e("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:e(_,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):e(R,{children:e("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:e("button",{className:"w-fit",onClick:()=>v(!n),children:e(E,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})})]})]}),s.receipt&&e(Q,{isOpen:L,onClose:()=>{k(!1)},copy:s.receipt,onSuccess:()=>{B(!0)}}),s.subscribe&&e(W,{copy:s.subscribe,onSuccess:()=>{O(!0),setTimeout(()=>{m(!1)},3e3)},isOpen:U,onClose:()=>{m(!1)}})]})};export{ce as CreditsAnkersolixTask};
2
2
  //# sourceMappingURL=CreditsAnkersolixTask.js.map