@anker-in/campaign-ui 0.2.10-beta.9 → 0.2.11-beta.3

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 (918) hide show
  1. package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
  2. package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
  3. package/dist/cjs/components/chat/index.js +1 -1
  4. package/dist/cjs/components/chat/index.js.map +3 -3
  5. package/dist/cjs/components/credits/context/const.d.ts +2 -1
  6. package/dist/cjs/components/credits/context/const.js +1 -1
  7. package/dist/cjs/components/credits/context/const.js.map +2 -2
  8. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  10. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  14. package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  18. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  19. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  21. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  22. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  23. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  24. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  25. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  26. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  27. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  28. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  29. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  30. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  31. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  35. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  36. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +1 -1
  37. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  38. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  39. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  40. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  41. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  42. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  43. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  44. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  45. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  46. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  47. package/dist/cjs/components/credits/context/provider.js +1 -1
  48. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  49. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  50. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  51. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  52. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  53. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  54. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  56. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  57. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  58. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  59. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  60. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  61. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  62. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  63. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  64. package/dist/cjs/components/credits/context/utils.d.ts +4 -0
  65. package/dist/cjs/components/credits/context/utils.js +1 -1
  66. package/dist/cjs/components/credits/context/utils.js.map +3 -3
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  68. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  69. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  70. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  71. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  72. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  73. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  74. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  75. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  76. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  77. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  78. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  80. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
  81. package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
  82. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js +1 -1
  83. package/dist/cjs/components/credits/{credits-benefits → creditsBenefits}/iconInfo.js.map +2 -2
  84. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  85. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  86. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  87. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  88. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  89. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  90. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  91. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  94. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  97. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  98. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  100. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  101. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  102. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  103. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  104. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  105. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  106. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  111. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  112. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  113. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  114. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js +2 -0
  115. package/dist/cjs/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  116. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  117. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  118. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  119. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  120. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  121. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  122. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  123. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  124. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  125. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  126. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  127. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  128. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  129. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  130. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  133. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  134. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  135. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  136. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  141. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  142. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  151. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  152. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  156. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  159. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  161. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  162. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  163. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  164. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  165. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  167. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  168. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  170. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  172. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  173. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  174. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  175. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  176. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  177. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  178. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  179. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  180. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  181. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  182. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  183. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  184. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  185. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  186. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  187. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  188. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  189. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  190. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  191. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  192. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  193. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  194. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  195. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  196. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  197. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  198. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  199. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  200. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  201. package/dist/cjs/components/credits/modal/tip.js +1 -1
  202. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  203. package/dist/cjs/components/credits/type.d.ts +24 -5
  204. package/dist/cjs/components/credits/type.js +1 -1
  205. package/dist/cjs/components/credits/type.js.map +1 -1
  206. package/dist/cjs/components/index.d.ts +2 -1
  207. package/dist/cjs/components/index.js +1 -1
  208. package/dist/cjs/components/index.js.map +2 -2
  209. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  210. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  211. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  212. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  213. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  214. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  215. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  216. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  217. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  218. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  219. package/dist/cjs/components/registration/context/index.js +2 -0
  220. package/dist/cjs/components/registration/context/index.js.map +7 -0
  221. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  222. package/dist/cjs/components/registration/context/provider.js +2 -0
  223. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  224. package/dist/cjs/components/registration/index.d.ts +2 -0
  225. package/dist/cjs/components/registration/index.js +2 -0
  226. package/dist/cjs/components/registration/index.js.map +7 -0
  227. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  228. package/dist/cjs/components/registration/modalContainer.js +2 -0
  229. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  230. package/dist/cjs/constants.d.ts +1 -0
  231. package/dist/cjs/constants.js +2 -0
  232. package/dist/cjs/constants.js.map +7 -0
  233. package/dist/cjs/debug-env.js +2 -0
  234. package/dist/cjs/debug-env.js.map +7 -0
  235. package/dist/cjs/helpers/fetcher.d.ts +1 -1
  236. package/dist/cjs/helpers/fetcher.js +1 -1
  237. package/dist/cjs/helpers/fetcher.js.map +3 -3
  238. package/dist/cjs/helpers/index.d.ts +2 -2
  239. package/dist/cjs/helpers/index.js +1 -1
  240. package/dist/cjs/helpers/index.js.map +2 -2
  241. package/dist/cjs/helpers/track.d.ts +6 -2
  242. package/dist/cjs/helpers/track.js +1 -1
  243. package/dist/cjs/helpers/track.js.map +3 -3
  244. package/dist/cjs/index.d.ts +3 -2
  245. package/dist/cjs/index.js +1 -726
  246. package/dist/cjs/index.js.map +4 -4
  247. package/dist/cjs/stories/chat.stories.js +2 -0
  248. package/dist/cjs/stories/chat.stories.js.map +7 -0
  249. package/dist/cjs/templates/credits.d.ts +73 -0
  250. package/dist/cjs/templates/credits.js +2 -0
  251. package/dist/cjs/templates/credits.js.map +7 -0
  252. package/dist/cjs/templates/index.d.ts +1 -0
  253. package/dist/cjs/templates/index.js +2 -0
  254. package/dist/cjs/templates/index.js.map +7 -0
  255. package/dist/esm/components/chat/index.js +1 -1
  256. package/dist/esm/components/chat/index.js.map +2 -2
  257. package/dist/esm/components/credits/context/const.d.ts +2 -1
  258. package/dist/esm/components/credits/context/const.js +1 -1
  259. package/dist/esm/components/credits/context/const.js.map +2 -2
  260. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  264. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  265. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  266. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  267. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  268. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  269. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  270. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  271. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  272. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  273. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  274. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  275. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  276. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  277. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  278. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  279. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  280. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  281. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  282. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  283. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +1 -1
  284. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +3 -3
  285. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  286. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  287. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +7 -3
  288. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +1 -1
  289. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +3 -3
  290. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  291. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  292. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  293. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  294. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  295. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  296. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  297. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  298. package/dist/esm/components/credits/context/provider.js +1 -1
  299. package/dist/esm/components/credits/context/provider.js.map +3 -3
  300. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  301. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  302. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  303. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  304. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  305. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  306. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  307. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  308. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  309. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  310. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  311. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  312. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  313. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  314. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  315. package/dist/esm/components/credits/context/utils.d.ts +4 -0
  316. package/dist/esm/components/credits/context/utils.js +1 -1
  317. package/dist/esm/components/credits/context/utils.js.map +3 -3
  318. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  319. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  320. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  321. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  322. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  323. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  324. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  325. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  326. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  327. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  328. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  329. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  330. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +4 -1
  331. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -2
  332. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +4 -4
  333. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +1 -1
  334. package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +2 -2
  335. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  336. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  337. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  338. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  339. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  340. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  341. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  342. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  343. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  344. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  345. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  346. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  347. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  348. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  349. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  350. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  351. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  352. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  353. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  354. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  355. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  356. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  357. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  358. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  359. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  360. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  361. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  362. package/dist/esm/components/credits/creditsMemberPrice/Pagination.d.ts +7 -0
  363. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js +2 -0
  364. package/dist/esm/components/credits/creditsMemberPrice/Pagination.js.map +7 -0
  365. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  366. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  367. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  368. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  369. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  370. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  371. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  372. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  373. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  374. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  375. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  376. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  377. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  378. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  379. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  380. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  381. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  382. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  383. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  384. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  385. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  386. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  387. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  388. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  389. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  390. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  391. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  392. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  393. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  394. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  395. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  396. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  397. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  398. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  399. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  400. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  401. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  402. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  403. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  404. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  405. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  406. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  407. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  408. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  409. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  410. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  411. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  412. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  413. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  414. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  415. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  416. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  417. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  418. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  419. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  420. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  421. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  422. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  423. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  424. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  425. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  426. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  427. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  428. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  429. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  430. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  431. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  432. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  433. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  434. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  435. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  436. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  437. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  438. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  439. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  440. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  441. package/dist/esm/components/credits/modal/tip.js +1 -1
  442. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  443. package/dist/esm/components/credits/type.d.ts +24 -5
  444. package/dist/esm/components/index.d.ts +2 -1
  445. package/dist/esm/components/index.js +1 -1
  446. package/dist/esm/components/index.js.map +2 -2
  447. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  448. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  449. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  450. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  451. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  452. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  453. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  454. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  455. package/dist/esm/components/registration/context/index.d.ts +1 -0
  456. package/dist/esm/components/registration/context/index.js +2 -0
  457. package/dist/esm/components/registration/context/index.js.map +7 -0
  458. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  459. package/dist/esm/components/registration/context/provider.js +2 -0
  460. package/dist/esm/components/registration/context/provider.js.map +7 -0
  461. package/dist/esm/components/registration/index.d.ts +2 -0
  462. package/dist/esm/components/registration/index.js +2 -0
  463. package/dist/esm/components/registration/index.js.map +7 -0
  464. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  465. package/dist/esm/components/registration/modalContainer.js +2 -0
  466. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  467. package/dist/esm/constants.d.ts +1 -0
  468. package/dist/esm/constants.js +2 -0
  469. package/dist/esm/constants.js.map +7 -0
  470. package/dist/esm/helpers/fetcher.d.ts +1 -1
  471. package/dist/esm/helpers/fetcher.js +1 -1
  472. package/dist/esm/helpers/fetcher.js.map +3 -3
  473. package/dist/esm/helpers/index.d.ts +2 -2
  474. package/dist/esm/helpers/index.js +1 -1
  475. package/dist/esm/helpers/index.js.map +2 -2
  476. package/dist/esm/helpers/track.d.ts +6 -2
  477. package/dist/esm/helpers/track.js +1 -1
  478. package/dist/esm/helpers/track.js.map +3 -3
  479. package/dist/esm/index.d.ts +3 -2
  480. package/dist/esm/index.js +1 -1
  481. package/dist/esm/index.js.map +2 -2
  482. package/dist/esm/templates/credits.d.ts +73 -0
  483. package/dist/esm/templates/credits.js +2 -0
  484. package/dist/esm/templates/credits.js.map +7 -0
  485. package/dist/esm/templates/index.d.ts +1 -0
  486. package/dist/esm/templates/index.js +2 -0
  487. package/dist/esm/templates/index.js.map +7 -0
  488. package/package.json +25 -22
  489. package/src/components/chat/index.tsx +1 -1
  490. package/src/components/credits/context/const.ts +1 -0
  491. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  492. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  493. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  494. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  495. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  496. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  497. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  498. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  499. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  500. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  501. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  502. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  503. package/src/components/credits/context/memberPriceConst.ts +13 -0
  504. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  505. package/src/components/credits/context/provider.tsx +25 -20
  506. package/src/components/credits/context/utils/atobID.ts +8 -0
  507. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  508. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  509. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  510. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  511. package/src/components/credits/context/utils.ts +9 -0
  512. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +273 -0
  513. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  514. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  515. package/src/components/credits/creditsBanner/index.tsx +16 -18
  516. package/src/components/credits/creditsBenefits/BenefitItem.tsx +108 -0
  517. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  518. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  519. package/src/components/credits/creditsCash/RedeemableItem.tsx +66 -44
  520. package/src/components/credits/creditsCash/index.ts +2 -0
  521. package/src/components/credits/creditsCash/type.ts +2 -4
  522. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  523. package/src/components/credits/creditsFaq/index.tsx +9 -6
  524. package/src/components/credits/creditsInfoCard/index.tsx +43 -36
  525. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +314 -0
  526. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +181 -0
  527. package/src/components/credits/creditsMemberPrice/Pagination.tsx +113 -0
  528. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  529. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  530. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  531. package/src/components/credits/creditsNavigation/index.ts +2 -0
  532. package/src/components/credits/creditsNavigation/type.ts +10 -0
  533. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +8 -3
  534. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +6 -1
  535. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +6 -5
  536. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +31 -35
  537. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  538. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  539. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +15 -11
  540. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  541. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  542. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  543. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  544. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +5 -1
  545. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  546. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +24 -32
  547. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  548. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  549. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +79 -20
  550. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  551. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  552. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  553. package/src/components/credits/modal/MyRewardsModal.tsx +84 -63
  554. package/src/components/credits/modal/activitiesModal.tsx +62 -46
  555. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +10 -1
  556. package/src/components/credits/modal/loadingDots.tsx +9 -7
  557. package/src/components/credits/modal/modalContainer.tsx +6 -1
  558. package/src/components/credits/modal/rulesModal.tsx +1 -1
  559. package/src/components/credits/modal/subscribeModal.tsx +202 -0
  560. package/src/components/credits/modal/tip.tsx +11 -1
  561. package/src/components/credits/type.ts +24 -5
  562. package/src/components/index.ts +3 -3
  563. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  564. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  565. package/src/components/registration/authCodeActivate/type.ts +23 -0
  566. package/src/components/registration/context/index.tsx +1 -0
  567. package/src/components/registration/context/provider.tsx +86 -0
  568. package/src/components/registration/index.ts +2 -0
  569. package/src/components/registration/modalContainer.tsx +115 -0
  570. package/src/constants.ts +1 -0
  571. package/src/index.ts +3 -4
  572. package/src/styles/global.css +15 -0
  573. package/src/templates/Credits.tsx +165 -0
  574. package/src/templates/index.ts +1 -0
  575. package/style.css +1 -0
  576. package/tailwind.config.ts +10 -0
  577. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  578. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  579. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  580. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  581. package/dist/cjs/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  582. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  583. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  584. package/dist/cjs/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  586. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  587. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  588. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  589. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  590. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  591. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  595. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  596. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  598. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  599. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  600. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  601. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  602. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  603. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  604. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  605. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  606. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  607. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  608. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  609. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  610. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  611. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  613. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  614. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  615. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  616. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  617. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  618. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  619. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  620. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  621. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  622. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  623. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  624. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  625. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  627. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  628. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  629. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  630. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  631. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  632. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  633. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  634. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  635. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  636. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  637. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  638. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  639. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  640. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  641. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  642. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  643. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  644. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  645. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  646. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  647. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  648. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  649. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  650. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  651. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  652. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  653. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  654. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  655. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  656. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  657. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  658. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  659. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  660. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  661. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  662. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  663. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  664. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  665. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  666. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  667. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  668. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  669. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  670. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  671. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  672. package/dist/cjs/index.css +0 -2
  673. package/dist/cjs/index.css.map +0 -7
  674. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  675. package/dist/cjs/shopify/context/index.d.ts +0 -1
  676. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  677. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  678. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  679. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  680. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  681. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  682. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  683. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  684. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  685. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  686. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  687. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  688. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  689. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  690. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  691. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  692. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  693. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  694. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  695. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  696. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  697. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  698. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  699. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  700. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  701. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  702. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  703. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  704. package/dist/cjs/shopify/src/index.d.ts +0 -5
  705. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  706. package/dist/cjs/shopify/types/article.d.ts +0 -48
  707. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  708. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  709. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  710. package/dist/cjs/shopify/types/common.d.ts +0 -42
  711. package/dist/cjs/shopify/types/config.d.ts +0 -12
  712. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  713. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  714. package/dist/cjs/shopify/types/index.d.ts +0 -12
  715. package/dist/cjs/shopify/types/page.d.ts +0 -33
  716. package/dist/cjs/shopify/types/product.d.ts +0 -174
  717. package/dist/cjs/shopify/types/search.d.ts +0 -54
  718. package/dist/cjs/shopify/types/site.d.ts +0 -33
  719. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  720. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  721. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  722. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  723. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  724. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  725. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  726. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  727. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  728. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  729. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  730. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  731. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  732. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  733. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  734. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  735. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  736. package/dist/esm/components/chat/chat-context.js +0 -2
  737. package/dist/esm/components/chat/chat-context.js.map +0 -7
  738. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  739. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  740. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  741. package/dist/esm/components/credits/credits-benefits/benefitItem.d.ts +0 -19
  742. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  743. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  744. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  745. package/dist/esm/components/credits/credits-benefits/iconInfo.js +0 -2
  746. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  747. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  748. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  749. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  750. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  751. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  752. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  753. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  754. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  755. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  756. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  757. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  758. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  759. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  760. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  761. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  762. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  763. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  764. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  765. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  766. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  767. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  769. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  770. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  771. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  772. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  773. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  774. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  775. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  776. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  777. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  778. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  779. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  780. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  781. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  782. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  785. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  788. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  791. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  794. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  797. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  800. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  801. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  802. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  804. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  805. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  806. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  807. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  808. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  809. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  810. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  811. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  812. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  813. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  814. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  815. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  816. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  817. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  818. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  819. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  820. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  821. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  822. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  823. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  824. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  825. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  826. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  827. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  828. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  829. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  830. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  831. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  832. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  833. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  834. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  835. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  836. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  837. package/dist/esm/index.css +0 -2
  838. package/dist/esm/index.css.map +0 -7
  839. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  840. package/dist/esm/shopify/context/index.d.ts +0 -1
  841. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  842. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  843. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  844. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  845. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  846. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  847. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  851. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  852. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  853. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  854. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  855. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  856. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  857. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  858. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  859. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  860. package/dist/esm/shopify/gql/index.d.ts +0 -3
  861. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  862. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  863. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  864. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  865. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  866. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  867. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  868. package/dist/esm/shopify/queries/index.d.ts +0 -1
  869. package/dist/esm/shopify/src/index.d.ts +0 -5
  870. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  871. package/dist/esm/shopify/types/article.d.ts +0 -48
  872. package/dist/esm/shopify/types/cart.d.ts +0 -173
  873. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  874. package/dist/esm/shopify/types/collection.d.ts +0 -122
  875. package/dist/esm/shopify/types/common.d.ts +0 -42
  876. package/dist/esm/shopify/types/config.d.ts +0 -12
  877. package/dist/esm/shopify/types/customer.d.ts +0 -30
  878. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  879. package/dist/esm/shopify/types/index.d.ts +0 -12
  880. package/dist/esm/shopify/types/page.d.ts +0 -33
  881. package/dist/esm/shopify/types/product.d.ts +0 -174
  882. package/dist/esm/shopify/types/search.d.ts +0 -54
  883. package/dist/esm/shopify/types/site.d.ts +0 -33
  884. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  885. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  886. package/dist/esm/shopify/utils/const.d.ts +0 -76
  887. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  888. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  889. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  890. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  891. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  892. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  893. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  894. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  895. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  896. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  897. package/dist/esm/shopify/utils/store.d.ts +0 -2
  898. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  899. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  900. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  901. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  902. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  903. package/src/components/credits/creditsCash/index.tsx +0 -102
  904. package/src/helpers/fetchResponse.ts +0 -35
  905. package/src/helpers/fetcher.ts +0 -44
  906. package/src/helpers/index.ts +0 -2
  907. package/src/helpers/track.ts +0 -55
  908. package/src/helpers/utils.ts +0 -8
  909. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  910. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  911. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  912. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  913. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  914. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  915. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  916. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  917. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  918. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -0,0 +1,2 @@
1
+ import{FunctionDiscountType as c,RoundSelected as i}from"../memberPriceConst";import n from"decimal.js";const b=({config:t,price:o})=>{const{apply_price_ending:r,one_decimal_place:a,two_decimal_place:u,round_selected:s}=t.price_ending_conf||{};let e=new n(o);switch(t.discount_type){case c.Percentage:e=e.mul(100-t.discount_value).div(100);break;case c.FixedAmount:e=e.sub(t.discount_value);break;case c.FixedPrice:e=new n(t.discount_value);break;default:break}if(r){switch(s){case i.RoundHighest:e=e.ceil();break;case i.RoundLowest:e=e.floor();break;case i.RoundNearest:e=e.round();break;default:e=new n(e.toFixed(2,n.ROUND_DOWN));break}const d=e.toString().split(".");e=new n(d[0]+"."+a+u)}return e.toNumber()};export{b as functionDiscountCalculate};
2
+ //# sourceMappingURL=functionDiscountCalculate.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/functionDiscountCalculate.ts"],
4
+ "sourcesContent": ["import { FunctionDiscountType, RoundSelected } from '../memberPriceConst'\nimport { DiscountConfig } from '../memberPriceTypes'\nimport Decimal from 'decimal.js'\n\n// Function \u8BA1\u7B97\u6298\u540E\u4EF7\nexport const functionDiscountCalculate = ({\n config,\n price,\n}: {\n config: DiscountConfig\n price: number\n}) => {\n const { apply_price_ending, one_decimal_place, two_decimal_place, round_selected } =\n config.price_ending_conf || {}\n\n let salePrice = new Decimal(price)\n\n switch (config.discount_type) {\n // \u767E\u5206\u6BD4\u6298\u6263\n case FunctionDiscountType.Percentage:\n salePrice = salePrice.mul(100 - config.discount_value).div(100)\n break\n // \u56FA\u5B9A\u91D1\u989D\u6298\u6263\n case FunctionDiscountType.FixedAmount:\n salePrice = salePrice.sub(config.discount_value)\n break\n // \u56FA\u5B9A\u4EF7\u683C\u6298\u6263\n case FunctionDiscountType.FixedPrice:\n salePrice = new Decimal(config.discount_value)\n break\n default:\n break\n }\n\n if (apply_price_ending) {\n // \u5C0F\u6570\u4F4D\u53D6\u820D\n switch (round_selected) {\n case RoundSelected.RoundHighest:\n salePrice = salePrice.ceil()\n break\n case RoundSelected.RoundLowest:\n salePrice = salePrice.floor()\n break\n case RoundSelected.RoundNearest:\n salePrice = salePrice.round()\n break\n default:\n salePrice = new Decimal(salePrice.toFixed(2, Decimal.ROUND_DOWN))\n break\n }\n\n const priceEnding = salePrice.toString().split('.')\n salePrice = new Decimal(priceEnding[0] + '.' + one_decimal_place + two_decimal_place)\n }\n\n return salePrice.toNumber()\n}\n"],
5
+ "mappings": "AAAA,OAAS,wBAAAA,EAAsB,iBAAAC,MAAqB,sBAEpD,OAAOC,MAAa,aAGb,MAAMC,EAA4B,CAAC,CACxC,OAAAC,EACA,MAAAC,CACF,IAGM,CACJ,KAAM,CAAE,mBAAAC,EAAoB,kBAAAC,EAAmB,kBAAAC,EAAmB,eAAAC,CAAe,EAC/EL,EAAO,mBAAqB,CAAC,EAE/B,IAAIM,EAAY,IAAIR,EAAQG,CAAK,EAEjC,OAAQD,EAAO,cAAe,CAE5B,KAAKJ,EAAqB,WACxBU,EAAYA,EAAU,IAAI,IAAMN,EAAO,cAAc,EAAE,IAAI,GAAG,EAC9D,MAEF,KAAKJ,EAAqB,YACxBU,EAAYA,EAAU,IAAIN,EAAO,cAAc,EAC/C,MAEF,KAAKJ,EAAqB,WACxBU,EAAY,IAAIR,EAAQE,EAAO,cAAc,EAC7C,MACF,QACE,KACJ,CAEA,GAAIE,EAAoB,CAEtB,OAAQG,EAAgB,CACtB,KAAKR,EAAc,aACjBS,EAAYA,EAAU,KAAK,EAC3B,MACF,KAAKT,EAAc,YACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,KAAKT,EAAc,aACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,QACEA,EAAY,IAAIR,EAAQQ,EAAU,QAAQ,EAAGR,EAAQ,UAAU,CAAC,EAChE,KACJ,CAEA,MAAMS,EAAcD,EAAU,SAAS,EAAE,MAAM,GAAG,EAClDA,EAAY,IAAIR,EAAQS,EAAY,CAAC,EAAI,IAAMJ,EAAoBC,CAAiB,CACtF,CAEA,OAAOE,EAAU,SAAS,CAC5B",
6
+ "names": ["FunctionDiscountType", "RoundSelected", "Decimal", "functionDiscountCalculate", "config", "price", "apply_price_ending", "one_decimal_place", "two_decimal_place", "round_selected", "salePrice", "priceEnding"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes';
2
+ import { ProductVariant } from '@anker-in/lib';
3
+ export declare const getFunctionMemberPrice: ({ memberPriceDiscount, currencyCode, variant, locale, }: {
4
+ memberPriceDiscount?: FunctionMemberPriceConfig[];
5
+ currencyCode?: string;
6
+ variant?: ProductVariant;
7
+ locale: string;
8
+ }) => false | FunctionMemberPriceResult;
@@ -0,0 +1,2 @@
1
+ import{formatPrice as o}from"../utils";import{functionDiscountCalculate as b}from"./functionDiscountCalculate";import n from"decimal.js";import{getFunctionMemberPriceDiscountConfig as D}from"./getFunctionMemberPriceDiscountConfig";import d from"./variantGetCoupon";const V=({memberPriceDiscount:l,currencyCode:r,variant:e,locale:i})=>{const m=d({variant:e}),{memberPriceDiscountConfig:c,activeMemberPriceConfig:y}=D({config:l,variant:e}),s=!!y?.discount_combinations.other_product_discounts;if(!c)return!1;const u={amount:e?.price.amount||0,priceWithCurrency:o({amount:e?.price.amount||0,currencyCode:r||"USD",locale:i})},t=c?b({config:c,price:e?.price.amount||0}):e?.price.amount||0,a={amount:t,priceWithCurrency:o({amount:t,currencyCode:r||"USD",locale:i})};let p=t;if(m?.variant_price4wscode&&e&&s)if(s){const P=new n(e.price.amount).minus(m.variant_price4wscode);p=new n(t).minus(P).toNumber()}else{const P=new n(e.price.amount).minus(m.variant_price4wscode);if(t>P.toNumber())return!1}const C={amount:p,priceWithCurrency:o({amount:p,currencyCode:r||"USD",locale:i})},h=new n(u.amount).minus(C.amount).toNumber(),f={amount:h,priceWithCurrency:o({amount:h,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})},W=new n(u.amount).minus(a.amount).toNumber(),g={amount:W,priceWithCurrency:o({amount:W,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})};return{hasMemberPrice:!!c,useCoupon:s,originalPrice:u.amount,originalPriceWithCurrency:u.priceWithCurrency,salePrice:C.amount,salePriceWithCurrency:C.priceWithCurrency,salePriceWithoutCoupon:a.amount,salePriceWithoutCouponWithCurrency:a.priceWithCurrency,savePrice:f.amount,savePriceWithCurrency:f.priceWithCurrency,savePriceWithoutCoupon:g.amount,savePriceWithoutCouponWithCurrency:g.priceWithCurrency}};export{V as getFunctionMemberPrice};
2
+ //# sourceMappingURL=getFunctionMemberPrice.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPrice.ts"],
4
+ "sourcesContent": ["import { formatPrice } from '../utils'\nimport { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { functionDiscountCalculate } from './functionDiscountCalculate'\nimport Decimal from 'decimal.js'\nimport { getFunctionMemberPriceDiscountConfig } from './getFunctionMemberPriceDiscountConfig'\nimport variantGetCoupon from './variantGetCoupon'\n\n// \u8BA1\u7B97\u5355\u4EF6\u5546\u54C1\u7684\u4F1A\u5458\u4EF7\nexport const getFunctionMemberPrice = ({\n memberPriceDiscount,\n currencyCode,\n variant,\n locale,\n}: {\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n currencyCode?: string\n variant?: ProductVariant\n locale: string\n}) => {\n const couponData = variantGetCoupon({ variant })\n\n // variant\u5BF9\u5E94\u7684\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\n const { memberPriceDiscountConfig, activeMemberPriceConfig } = getFunctionMemberPriceDiscountConfig({\n config: memberPriceDiscount,\n variant,\n })\n\n const useCoupon = !!activeMemberPriceConfig?.discount_combinations.other_product_discounts\n\n if (!memberPriceDiscountConfig) {\n return false as false\n }\n\n const originalPrice = {\n amount: variant?.price.amount || 0,\n priceWithCurrency: formatPrice({\n amount: variant?.price.amount || 0,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const salePriceWithoutCouponAmount = memberPriceDiscountConfig\n ? functionDiscountCalculate({\n config: memberPriceDiscountConfig,\n price: variant?.price.amount || 0,\n })\n : variant?.price.amount || 0\n const salePriceWithoutCoupon = {\n amount: salePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n // function \u4F1A\u5458\u4EF7\u662F\u5728\u539F\u4EF7\u7684\u57FA\u7840\u4E0A\u8FDB\u884C\u8BA1\u7B97\uFF0C\u6682\u4E0D\u652F\u6301\u6298\u540E\u4EF7\n let salePriceAmount = salePriceWithoutCouponAmount\n\n // \u51CF\u53BBcode\u7684\u4F18\u60E0\n if (couponData?.variant_price4wscode && variant && useCoupon) {\n if (useCoupon) {\n // code\u7684\u4F18\u60E0\u91D1\u989D\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n salePriceAmount = new Decimal(salePriceWithoutCouponAmount).minus(codeSaveAmountDecimal).toNumber()\n } else {\n // \u4E0D\u80FD\u4E0E code \u540C\u65F6\u4F7F\u7528\uFF0C\u9700\u8981\u5224\u65AD\u4F1A\u5458\u4EF7\u662F\u5426\u5C0F\u4E8E code \u7684\u4F18\u60E0\u91D1\u989D\uFF0C\u5982\u679C\u5C0F\u4E8E\u5219\u5F53\u505A\u6CA1\u6709\u4F1A\u5458\u4EF7\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n if (salePriceWithoutCouponAmount > codeSaveAmountDecimal.toNumber()) {\n return false as false\n }\n }\n }\n\n const salePrice = {\n amount: salePriceAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const savePriceAmount = new Decimal(originalPrice.amount).minus(salePrice.amount).toNumber()\n const savePrice = {\n amount: savePriceAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const savePriceWithoutCouponAmount = new Decimal(originalPrice.amount)\n .minus(salePriceWithoutCoupon.amount)\n .toNumber()\n const savePriceWithoutCoupon = {\n amount: savePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const result: FunctionMemberPriceResult = {\n // \u662F\u5426\u5B58\u5728\u4F1A\u5458\u4EF7\n hasMemberPrice: !!memberPriceDiscountConfig,\n useCoupon,\n // \u539F\u4EF7\n originalPrice: originalPrice.amount,\n originalPriceWithCurrency: originalPrice.priceWithCurrency as string,\n // \u4F7F\u7528\u5238\u540E\u7684\u6298\u540E\u4EF7\n salePrice: salePrice.amount,\n salePriceWithCurrency: salePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u6298\u540E\u4EF7\n salePriceWithoutCoupon: salePriceWithoutCoupon.amount,\n salePriceWithoutCouponWithCurrency: salePriceWithoutCoupon.priceWithCurrency as string,\n\n // \u5305\u542B\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePrice: savePrice.amount,\n savePriceWithCurrency: savePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePriceWithoutCoupon: savePriceWithoutCoupon.amount,\n savePriceWithoutCouponWithCurrency: savePriceWithoutCoupon.priceWithCurrency as string,\n }\n\n return result\n}\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,MAAmB,WAG5B,OAAS,6BAAAC,MAAiC,8BAC1C,OAAOC,MAAa,aACpB,OAAS,wCAAAC,MAA4C,yCACrD,OAAOC,MAAsB,qBAGtB,MAAMC,EAAyB,CAAC,CACrC,oBAAAC,EACA,aAAAC,EACA,QAAAC,EACA,OAAAC,CACF,IAKM,CACJ,MAAMC,EAAaN,EAAiB,CAAE,QAAAI,CAAQ,CAAC,EAGzC,CAAE,0BAAAG,EAA2B,wBAAAC,CAAwB,EAAIT,EAAqC,CAClG,OAAQG,EACR,QAAAE,CACF,CAAC,EAEKK,EAAY,CAAC,CAACD,GAAyB,sBAAsB,wBAEnE,GAAI,CAACD,EACH,MAAO,GAGT,MAAMG,EAAgB,CACpB,OAAQN,GAAS,MAAM,QAAU,EACjC,kBAAmBR,EAAY,CAC7B,OAAQQ,GAAS,MAAM,QAAU,EACjC,aAAcD,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMM,EAA+BJ,EACjCV,EAA0B,CACxB,OAAQU,EACR,MAAOH,GAAS,MAAM,QAAU,CAClC,CAAC,EACDA,GAAS,MAAM,QAAU,EACvBQ,EAAyB,CAC7B,OAAQD,EACR,kBAAmBf,EAAY,CAC7B,OAAQe,EACR,aAAcR,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAGA,IAAIQ,EAAkBF,EAGtB,GAAIL,GAAY,sBAAwBF,GAAWK,EACjD,GAAIA,EAAW,CAEb,MAAMK,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrGO,EAAkB,IAAIf,EAAQa,CAA4B,EAAE,MAAMG,CAAqB,EAAE,SAAS,CACpG,KAAO,CAEL,MAAMA,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrG,GAAIK,EAA+BG,EAAsB,SAAS,EAChE,MAAO,EAEX,CAGF,MAAMC,EAAY,CAChB,OAAQF,EACR,kBAAmBjB,EAAY,CAC7B,OAAQiB,EACR,aAAcV,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMW,EAAkB,IAAIlB,EAAQY,EAAc,MAAM,EAAE,MAAMK,EAAU,MAAM,EAAE,SAAS,EACrFE,EAAY,CAChB,OAAQD,EACR,kBAAmBpB,EAAY,CAC7B,OAAQoB,EACR,aAAcb,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EAEMa,EAA+B,IAAIpB,EAAQY,EAAc,MAAM,EAClE,MAAME,EAAuB,MAAM,EACnC,SAAS,EACNO,EAAyB,CAC7B,OAAQD,EACR,kBAAmBtB,EAAY,CAC7B,OAAQsB,EACR,aAAcf,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EA0BA,MAxB0C,CAExC,eAAgB,CAAC,CAACE,EAClB,UAAAE,EAEA,cAAeC,EAAc,OAC7B,0BAA2BA,EAAc,kBAEzC,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBH,EAAuB,OAC/C,mCAAoCA,EAAuB,kBAG3D,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBE,EAAuB,OAC/C,mCAAoCA,EAAuB,iBAC7D,CAGF",
6
+ "names": ["formatPrice", "functionDiscountCalculate", "Decimal", "getFunctionMemberPriceDiscountConfig", "variantGetCoupon", "getFunctionMemberPrice", "memberPriceDiscount", "currencyCode", "variant", "locale", "couponData", "memberPriceDiscountConfig", "activeMemberPriceConfig", "useCoupon", "originalPrice", "salePriceWithoutCouponAmount", "salePriceWithoutCoupon", "salePriceAmount", "codeSaveAmountDecimal", "salePrice", "savePriceAmount", "savePrice", "savePriceWithoutCouponAmount", "savePriceWithoutCoupon"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes';
2
+ import { ProductVariant } from '@anker-in/lib';
3
+ export declare const getFunctionMemberPriceDiscountConfig: ({ config, variant, }: {
4
+ config?: FunctionMemberPriceConfig[];
5
+ variant?: ProductVariant;
6
+ }) => {
7
+ memberPriceDiscountConfig: DiscountConfig | undefined;
8
+ activeMemberPriceConfig: FunctionMemberPriceConfig | undefined;
9
+ };
@@ -0,0 +1,2 @@
1
+ import{atobID as f}from"./atobID";const b=({config:e,variant:t})=>{let i,r;if(!e||!t)return{memberPriceDiscountConfig:i,activeMemberPriceConfig:r};for(const o of e)if(i=o.result_detail.member_discounts?.find(n=>n.main_products.all_store_variant?n:n.main_products.variants.find(c=>String(c.variant_id)===f(t.id)))?.discount_conf,i){r=o;break}return i?{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}:{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}};export{b as getFunctionMemberPriceDiscountConfig};
2
+ //# sourceMappingURL=getFunctionMemberPriceDiscountConfig.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts"],
4
+ "sourcesContent": ["import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\n// \u83B7\u53D6\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\nexport const getFunctionMemberPriceDiscountConfig = ({\n config,\n variant,\n}: {\n config?: FunctionMemberPriceConfig[]\n variant?: ProductVariant\n}) => {\n let memberPriceDiscountConfig: DiscountConfig | undefined\n let activeMemberPriceConfig: FunctionMemberPriceConfig | undefined\n\n if (!config || !variant) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n for (const configItem of config) {\n memberPriceDiscountConfig = configItem.result_detail.member_discounts?.find(discountItem => {\n if (discountItem.main_products.all_store_variant) {\n return discountItem\n }\n\n return discountItem.main_products.variants.find(\n variantConfig => String(variantConfig.variant_id) === atobID(variant.id as string)\n )\n })?.discount_conf\n\n if (memberPriceDiscountConfig) {\n activeMemberPriceConfig = configItem\n break\n }\n }\n\n if (!memberPriceDiscountConfig) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n}\n"],
5
+ "mappings": "AAEA,OAAS,UAAAA,MAAc,WAGhB,MAAMC,EAAuC,CAAC,CACnD,OAAAC,EACA,QAAAC,CACF,IAGM,CACJ,IAAIC,EACAC,EAEJ,GAAI,CAACH,GAAU,CAACC,EACd,MAAO,CACL,0BAAAC,EACA,wBAAAC,CACF,EAGF,UAAWC,KAAcJ,EAWvB,GAVAE,EAA4BE,EAAW,cAAc,kBAAkB,KAAKC,GACtEA,EAAa,cAAc,kBACtBA,EAGFA,EAAa,cAAc,SAAS,KACzCC,GAAiB,OAAOA,EAAc,UAAU,IAAMR,EAAOG,EAAQ,EAAY,CACnF,CACD,GAAG,cAEAC,EAA2B,CAC7BC,EAA0BC,EAC1B,KACF,CAGF,OAAKF,EAOE,CACL,0BAAAA,EACA,wBAAAC,CACF,EATS,CACL,0BAAAD,EACA,wBAAAC,CACF,CAOJ",
6
+ "names": ["atobID", "getFunctionMemberPriceDiscountConfig", "config", "variant", "memberPriceDiscountConfig", "activeMemberPriceConfig", "configItem", "discountItem", "variantConfig"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import { ProductVariant } from '@anker-in/lib';
2
+ declare const variantGetCoupon: ({ variant, channel, }: {
3
+ variant?: ProductVariant;
4
+ channel?: string;
5
+ }) => any;
6
+ export default variantGetCoupon;
@@ -0,0 +1,2 @@
1
+ import{atobID as a}from"./atobID";const r=({variant:e,channel:i=""})=>{if(!e)return;const s="wsch";return(e?.metafields?.discountCodeApp||[])?.filter(t=>{const n=a(e.id);return(!t?.ends_at||new Date(t?.ends_at).getTime()>new Date().getTime())&&new Date(t?.starts_at).getTime()<=new Date().getTime()&&t.variant_shopify_id===+(n||"")&&(i?t?.title?.toLocaleLowerCase().includes(i):!t?.title?.toLocaleLowerCase().includes(s))})?.[0]};var f=r;export{f as default};
2
+ //# sourceMappingURL=variantGetCoupon.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/components/credits/context/utils/variantGetCoupon.ts"],
4
+ "sourcesContent": ["import { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\nconst variantGetCoupon = ({\n variant,\n channel = '',\n}: {\n variant?: ProductVariant\n channel?: string\n}) => {\n if (!variant) return undefined\n\n const hideChannel = 'wsch'\n const discountCodeApp = variant?.metafields?.discountCodeApp || []\n\n const results = discountCodeApp?.filter((coupon: any) => {\n const variantId = atobID(variant.id as string)\n const isActive =\n (!coupon?.ends_at || new Date(coupon?.ends_at).getTime() > new Date().getTime()) &&\n new Date(coupon?.starts_at).getTime() <= new Date().getTime() &&\n coupon.variant_shopify_id === +(variantId || '')\n\n return (\n isActive &&\n (channel\n ? coupon?.title?.toLocaleLowerCase().includes(channel)\n : !coupon?.title?.toLocaleLowerCase().includes(hideChannel))\n )\n })\n\n return results?.[0]\n}\n\nexport default variantGetCoupon\n"],
5
+ "mappings": "AACA,OAAS,UAAAA,MAAc,WAEvB,MAAMC,EAAmB,CAAC,CACxB,QAAAC,EACA,QAAAC,EAAU,EACZ,IAGM,CACJ,GAAI,CAACD,EAAS,OAEd,MAAME,EAAc,OAkBpB,OAjBwBF,GAAS,YAAY,iBAAmB,CAAC,IAEhC,OAAQG,GAAgB,CACvD,MAAMC,EAAYN,EAAOE,EAAQ,EAAY,EAM7C,OAJG,CAACG,GAAQ,SAAW,IAAI,KAAKA,GAAQ,OAAO,EAAE,QAAQ,EAAI,IAAI,KAAK,EAAE,QAAQ,IAC9E,IAAI,KAAKA,GAAQ,SAAS,EAAE,QAAQ,GAAK,IAAI,KAAK,EAAE,QAAQ,GAC5DA,EAAO,qBAAuB,EAAEC,GAAa,MAI5CH,EACGE,GAAQ,OAAO,kBAAkB,EAAE,SAASF,CAAO,EACnD,CAACE,GAAQ,OAAO,kBAAkB,EAAE,SAASD,CAAW,EAEhE,CAAC,IAEgB,CAAC,CACpB,EAEA,IAAOG,EAAQN",
6
+ "names": ["atobID", "variantGetCoupon", "variant", "channel", "hideChannel", "coupon", "variantId", "variantGetCoupon_default"]
7
+ }
@@ -23,3 +23,7 @@ export declare function formatVariantPrice({ amount, baseAmount, currencyCode, l
23
23
  basePrice: string | undefined;
24
24
  discount: string | null;
25
25
  };
26
+ /**
27
+ * 提取 variant id,去掉 gid://shopify/ProductVariant/ 前缀
28
+ */
29
+ export declare function extractVariantId(id: string | number | undefined): string | null;
@@ -1,2 +1,2 @@
1
- import g from"js-cookie";import{PRICE_SYMBOL as a}from"./const";function k(e=""){let n=!1;const r=g.get("alpcEU");return r===void 0||r===""?["de","eu-de","eu","eu-en","uk","fr","fra"].includes(e)&&(n=!0):Number(r)&&(n=!0),n?"/api/multipass/alpc-eu":"/api/multipass/alpc"}function C(e=0){return typeof Intl>"u"?e:new Intl.NumberFormat().format(e)}const E=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),c=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",nz:"en-nz",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[e]||"";function f({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:u,removeTrailingZeros:o=!1}){let i=new Intl.NumberFormat(c(r)||r,{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:u,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(i=i?.toString()?.replace(/[\s]/g,"")),o&&(i=i.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),i}function I({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${a[t]}${e}`,basePrice:`${a[t]}${n}`,discount:`${a[t]}${n-e||0}`};const i=n>e,m=new Intl.NumberFormat(c(t),{style:"percent"}),p=i?m.format((n-e)/n):null,l=f({amount:e,currencyCode:r,locale:t,removeTrailingZeros:s}),d=i?f({amount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}):void 0;return{price:l,basePrice:d,discount:p}}export{E as emailValidate,f as formatPrice,I as formatVariantPrice,k as getAlpcPath,c as languageTerritory,C as numberFormat};
1
+ import g from"js-cookie";import{PRICE_SYMBOL as a}from"./const";function I(e=""){let n=!1;const r=g.get("alpcEU");return r===void 0||r===""?["de","eu-de","eu","eu-en","uk","fr","fra"].includes(e)&&(n=!0):Number(r)&&(n=!0),n?"/api/multipass/alpc-eu":"/api/multipass/alpc"}function P(e=0){return typeof Intl>"u"?e:new Intl.NumberFormat().format(e)}const k=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),c=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",nz:"en-nz",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[e]||"";function f({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:u,removeTrailingZeros:o=!1}){let i=new Intl.NumberFormat(c(r)||r,{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:u,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(i=i?.toString()?.replace(/[\s]/g,"")),o&&(i=i.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),i}function x({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${a[t]}${e}`,basePrice:`${a[t]}${n}`,discount:`${a[t]}${n-e||0}`};const i=n>e,m=new Intl.NumberFormat(c(t),{style:"percent"}),p=i?m.format((n-e)/n):null,l=f({amount:e,currencyCode:r,locale:t,removeTrailingZeros:s}),d=i?f({amount:n,currencyCode:r,locale:t,maximumFractionDigits:u,minimumFractionDigits:o,removeTrailingZeros:s}):void 0;return{price:l,basePrice:d,discount:p}}function C(e){return e?(typeof e=="number"?e.toString():e).replace("gid://shopify/ProductVariant/",""):null}export{k as emailValidate,C as extractVariantId,f as formatPrice,x as formatVariantPrice,I as getAlpcPath,c as languageTerritory,P as numberFormat};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/context/utils.ts"],
4
- "sourcesContent": ["import Cookies from 'js-cookie'\nimport { PRICE_SYMBOL } from './const'\n\nexport function getAlpcPath(locale = '') {\n let isEU = false\n const alpcEUCookie = Cookies.get('alpcEU')\n if (alpcEUCookie === undefined || alpcEUCookie === '') {\n if (['de', 'eu-de', 'eu', 'eu-en', 'uk', 'fr', 'fra'].includes(locale)) {\n isEU = true\n }\n } else {\n let alpcEU = Number(alpcEUCookie)\n if (alpcEU) {\n isEU = true\n }\n }\n\n if (isEU) {\n return '/api/multipass/alpc-eu'\n }\n\n return '/api/multipass/alpc'\n}\n\nexport function numberFormat(num: number = 0) {\n if (typeof Intl === 'undefined') {\n return num\n }\n\n return new Intl.NumberFormat().format(num)\n}\n\nexport const emailValidate = (email: any) => {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n )\n}\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n nz: 'en-nz',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale) || locale, {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
5
- "mappings": "AAAA,OAAOA,MAAa,YACpB,OAAS,gBAAAC,MAAoB,UAEtB,SAASC,EAAYC,EAAS,GAAI,CACvC,IAAIC,EAAO,GACX,MAAMC,EAAeL,EAAQ,IAAI,QAAQ,EAYzC,OAXIK,IAAiB,QAAaA,IAAiB,GAC7C,CAAC,KAAM,QAAS,KAAM,QAAS,KAAM,KAAM,KAAK,EAAE,SAASF,CAAM,IACnEC,EAAO,IAGI,OAAOC,CAAY,IAE9BD,EAAO,IAIPA,EACK,yBAGF,qBACT,CAEO,SAASE,EAAaC,EAAc,EAAG,CAC5C,OAAI,OAAO,KAAS,IACXA,EAGF,IAAI,KAAK,aAAa,EAAE,OAAOA,CAAG,CAC3C,CAEO,MAAMC,EAAiBC,GACrB,yJAAyJ,KAC9JA,CACF,EAGWC,EAAqBP,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASQ,EAAY,CAC1B,OAAAC,EACA,aAAAC,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaP,EAAkBP,CAAM,GAAKA,EAAQ,CAChF,MAAO,WACP,SAAUU,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAAST,CAAM,IAChDc,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAASC,EAAmB,CACjC,OAAAN,EACA,WAAAO,EACA,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAGf,EAAaE,CAAmC,CAAC,GAAGS,CAAM,GACpE,UAAW,GAAGX,EAAaE,CAAmC,CAAC,GAAGgB,CAAU,GAC5E,SAAU,GAAGlB,EAAaE,CAAmC,CAAC,GAAGgB,EAAaP,GAAU,CAAC,EAC3F,EAGF,MAAMQ,EAAcD,EAAaP,EAC3BS,EAAiB,IAAI,KAAK,aAAaX,EAAkBP,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKmB,EAAWF,EAAcC,EAAe,QAAQF,EAAaP,GAAUO,CAAU,EAAI,KAErFI,EAAQZ,EAAY,CAAE,OAAAC,EAAQ,aAAAC,EAAc,OAAAV,EAAQ,oBAAAa,CAAoB,CAAC,EACzEQ,EAAYJ,EACdT,EAAY,CACV,OAAQQ,EACR,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAO,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
6
- "names": ["Cookies", "PRICE_SYMBOL", "getAlpcPath", "locale", "isEU", "alpcEUCookie", "numberFormat", "num", "emailValidate", "email", "languageTerritory", "formatPrice", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "formatVariantPrice", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
4
+ "sourcesContent": ["import Cookies from 'js-cookie'\nimport { PRICE_SYMBOL } from './const'\n\nexport function getAlpcPath(locale = '') {\n let isEU = false\n const alpcEUCookie = Cookies.get('alpcEU')\n if (alpcEUCookie === undefined || alpcEUCookie === '') {\n if (['de', 'eu-de', 'eu', 'eu-en', 'uk', 'fr', 'fra'].includes(locale)) {\n isEU = true\n }\n } else {\n let alpcEU = Number(alpcEUCookie)\n if (alpcEU) {\n isEU = true\n }\n }\n\n if (isEU) {\n return '/api/multipass/alpc-eu'\n }\n\n return '/api/multipass/alpc'\n}\n\nexport function numberFormat(num: number = 0) {\n if (typeof Intl === 'undefined') {\n return num\n }\n\n return new Intl.NumberFormat().format(num)\n}\n\nexport const emailValidate = (email: any) => {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n )\n}\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n nz: 'en-nz',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale) || locale, {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n\n/**\n * \u63D0\u53D6 variant id\uFF0C\u53BB\u6389 gid://shopify/ProductVariant/ \u524D\u7F00\n */\nexport function extractVariantId(id: string | number | undefined): string | null {\n if (!id) return null\n const idStr = typeof id === 'number' ? id.toString() : id\n return idStr.replace('gid://shopify/ProductVariant/', '')\n}\n"],
5
+ "mappings": "AAAA,OAAOA,MAAa,YACpB,OAAS,gBAAAC,MAAoB,UAEtB,SAASC,EAAYC,EAAS,GAAI,CACvC,IAAIC,EAAO,GACX,MAAMC,EAAeL,EAAQ,IAAI,QAAQ,EAYzC,OAXIK,IAAiB,QAAaA,IAAiB,GAC7C,CAAC,KAAM,QAAS,KAAM,QAAS,KAAM,KAAM,KAAK,EAAE,SAASF,CAAM,IACnEC,EAAO,IAGI,OAAOC,CAAY,IAE9BD,EAAO,IAIPA,EACK,yBAGF,qBACT,CAEO,SAASE,EAAaC,EAAc,EAAG,CAC5C,OAAI,OAAO,KAAS,IACXA,EAGF,IAAI,KAAK,aAAa,EAAE,OAAOA,CAAG,CAC3C,CAEO,MAAMC,EAAiBC,GACrB,yJAAyJ,KAC9JA,CACF,EAGWC,EAAqBP,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASQ,EAAY,CAC1B,OAAAC,EACA,aAAAC,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaP,EAAkBP,CAAM,GAAKA,EAAQ,CAChF,MAAO,WACP,SAAUU,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAAST,CAAM,IAChDc,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAASC,EAAmB,CACjC,OAAAN,EACA,WAAAO,EACA,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAGf,EAAaE,CAAmC,CAAC,GAAGS,CAAM,GACpE,UAAW,GAAGX,EAAaE,CAAmC,CAAC,GAAGgB,CAAU,GAC5E,SAAU,GAAGlB,EAAaE,CAAmC,CAAC,GAAGgB,EAAaP,GAAU,CAAC,EAC3F,EAGF,MAAMQ,EAAcD,EAAaP,EAC3BS,EAAiB,IAAI,KAAK,aAAaX,EAAkBP,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKmB,EAAWF,EAAcC,EAAe,QAAQF,EAAaP,GAAUO,CAAU,EAAI,KAErFI,EAAQZ,EAAY,CAAE,OAAAC,EAAQ,aAAAC,EAAc,OAAAV,EAAQ,oBAAAa,CAAoB,CAAC,EACzEQ,EAAYJ,EACdT,EAAY,CACV,OAAQQ,EACR,aAAAN,EACA,OAAAV,EACA,sBAAAW,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAO,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC,CAKO,SAASG,EAAiBC,EAAgD,CAC/E,OAAKA,GACS,OAAOA,GAAO,SAAWA,EAAG,SAAS,EAAIA,GAC1C,QAAQ,gCAAiC,EAAE,EAFxC,IAGlB",
6
+ "names": ["Cookies", "PRICE_SYMBOL", "getAlpcPath", "locale", "isEU", "alpcEUCookie", "numberFormat", "num", "emailValidate", "email", "languageTerritory", "formatPrice", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "formatVariantPrice", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice", "extractVariantId", "id"]
7
7
  }
@@ -0,0 +1,4 @@
1
+ import { type CreditsAnkersolixTaskProps } from './type';
2
+ export declare const CreditsAnkersolixTask: ({ copy, classNames, id }: CreditsAnkersolixTaskProps & {
3
+ id?: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{Fragment as M,jsx as e,jsxs as i}from"react/jsx-runtime";import{Button as I,Container as j,Heading as y,Picture as z,Text as A}from"@anker-in/headless-ui";import{ChevronDownIcon as _,ChevronUpIcon as E}from"@heroicons/react/24/outline";import{motion as H}from"framer-motion";import{useMemo as q,useState as d}from"react";import{TaskType as b}from"./type";import{useActions as V}from"../creditsWaysToGetCredits/useActions";import{useCreditsContext as G}from"../context/provider";import{classNames as h,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:g})=>{const[l,v]=d(!1),{profile:R}=G(),{authCodeActivate:L}=K(),{brand:T}=J(),p=X.includes(T),x=!!R,[U,k]=d(!1),[O,u]=d(!1),[C,B]=d(!1),[F,D]=d(!1),{actions:m}=V({copy:s,subscribe:{openSubscribePopup:()=>u(!0),isSuccess:C},uploadReceipt:{openUploadReceiptPopup:()=>k(!0),isSuccess:F}}),N=q(()=>{const t=s.list.map(n=>{if(!m[n.id])return;const{finished:a,notLogin:w,notFinished:f,completed:P}=m[n.id];let r="",c,S;return x?a?(r=P.buttonLabel,c=void 0):(r=f.buttonLabel,c=f.handleClick,S=f.link):(r=w.buttonLabel,c=w.handleClick),{...n,buttonLabel:r,handleClick:c,finished:a,link:S}}).filter(Boolean);return x?t.sort((n,a)=>n?.finished&&!a?.finished?1:!n?.finished&&a?.finished?-1:0):t},[m,s.list,x]),o=N.length>3;return i(j,{id:g,className:"bg-[#F5F5F7]",children:[e(y,{as:"h2",size:"4",html:s.title}),i("div",{className:h("mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden",p?"rounded-[8px]":"",!p&&"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%)"}}),i("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:[i("div",{className:"flex flex-col gap-[8px] l:mt-[8px]",children:[e(y,{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 tracking-[-1.92px] 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(z,{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})]}),i("div",{className:"relative mt-[24px]",children:[i(H.div,{className:h("grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto"),initial:{height:o?512:"auto"},animate:{height:l||!o?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!l&&o&&window.screen.width<768){const t=document.getElementById(g||"ankersolix-task");t&&t.scrollIntoView({behavior:"smooth",block:"end"})}},children:[N.map(t=>i("div",{className:h("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]",p?"rounded-[16px]":""),children:[i("div",{children:[e(A,{as:"p",html:t.title,size:2,className:"text-pretty text-[24px] font-bold xxl:text-[20px]"}),i("div",{className:"mt-[8px] l:mt-[4px] flex items-center",children:[e(z,{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(A,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] text-[18px] xxl:text-[14px]"})]})]}),t.handleClick&&!(t.id===b.UploadReceipt&&F)&&!(t.id===b.Activate&&L.isActivateSuccess)&&!(t.id===b.Subscribe&&C)?e(I,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]",children:t.buttonLabel}):e(I,{variant:"primary",size:"lg",className:"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]",disabled:!0,children:t.buttonLabel})]},t.id)),!l&&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(M,{children:l?e("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{v(!1)},children:e(E,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):e(M,{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(!l),children:e(_,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})})]})]}),s.receipt&&e(Q,{isOpen:U,onClose:()=>{k(!1)},copy:s.receipt,onSuccess:()=>{D(!0)}}),s.subscribe&&e(W,{copy:s.subscribe,onSuccess:()=>{B(!0),setTimeout(()=>{u(!1)},3e3)},isOpen:O,onClose:()=>{u(!1)}})]})};export{ce as CreditsAnkersolixTask};
2
+ //# sourceMappingURL=CreditsAnkersolixTask.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx"],
4
+ "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsAnkersolixTaskProps } from './type'\nimport { useActions } from '../creditsWaysToGetCredits/useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/subscribeModal'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport const CreditsAnkersolixTask = ({ copy, classNames, id }: CreditsAnkersolixTaskProps & { id?: string }) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\n })\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n // \u53EA\u6709\u5927\u4E8E3\u4E2A\u4EFB\u52A1\u65F6\u624D\u663E\u793A\u8499\u5C42\n const shouldShowMask = list.length > 3\n\n return (\n <Container id={id} className=\"bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy.title} />\n <div\n className={cn(\n 'mt-[24px] p-[32px] md-l:p-[32px] md:p-[16px] relative overflow-hidden',\n rounded ? 'rounded-[8px]' : '',\n !rounded && 'l:rounded-none'\n )}\n style={{\n background: 'linear-gradient(180deg, rgba(255, 241, 214, 0) 39.51%, #F4CA81 119.53%)',\n }}\n >\n {/* \u5F84\u5411\u6E10\u53D8\u80CC\u666F\u5C42 - \u4F7F\u7528\u4F2A\u5143\u7D20\u6A21\u62DF */}\n <div\n className=\"absolute inset-0 pointer-events-none -z-10\"\n style={{\n background: 'radial-gradient(ellipse 130% 205% at 45% -20%, #FFF6EA 0%, #FFFFFF 73%, #FFF1D6 100%)',\n }}\n />\n {/* \u526F\u6807\u9898\u548C\u88C5\u9970\u56FE\u90E8\u5206 */}\n <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\">\n <div className=\"flex flex-col gap-[8px] l:mt-[8px]\">\n <Heading\n as=\"h3\"\n size={4}\n html={copy?.subtitle}\n className=\"text-[32px] font-bold text-[#080a0f] tracking-[-1.28px] leading-[1.2] xl:text-[24px]\"\n />\n <div className=\"flex items-center gap-[8px]\">\n <p\n className=\"text-[48px] font-bold tracking-[-1.92px] 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]\"\n dangerouslySetInnerHTML={{ __html: copy.equalCredits }}\n />\n </div>\n </div>\n {copy.mainImage?.url && (\n <Picture\n className=\"h-full object-contain l:mx-auto md:h-auto md:w-full md-l:h-[302px]\"\n imgClassName=\"!h-full !object-contain\"\n source={copy.mainImage.url}\n />\n )}\n </div>\n\n {/* \u5361\u7247\u5217\u8868 */}\n <div className=\"relative mt-[24px]\">\n <motion.div\n className={cn('grid grid-cols-3 gap-[16px] overflow-hidden md:grid-cols-1 md-l:grid-cols-2 min-md:!h-auto')}\n initial={{ height: shouldShowMask ? 512 : 'auto' }}\n animate={{ height: showMore || !shouldShowMask ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && shouldShowMask && window.screen.width < 768) {\n const section = document.getElementById(id || 'ankersolix-task')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className={cn(\n '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]',\n rounded ? 'rounded-[16px]' : ''\n )}\n >\n <div>\n <Text\n as=\"p\"\n html={item.title}\n size={2}\n className=\"text-pretty text-[24px] font-bold xxl:text-[20px]\"\n />\n <div className=\"mt-[8px] l:mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xxl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text\n as=\"p\"\n html={item.credits}\n size={2}\n className=\"ml-[4px] mt-[6px] text-[18px] xxl:text-[14px]\"\n />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[24px] w-fit bg-[#080a0f] text-white text-[16px] font-bold tracking-[-0.64px] leading-[1.2]\"\n disabled\n >\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && shouldShowMask && (\n <div\n className=\"absolute inset-0 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(244, 202, 129, 0) 66.37%, #f4ca81 100%)' }}\n ></div>\n )}\n </motion.div>\n {shouldShowMask && (\n <>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </>\n )}\n </div>\n </div>\n {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n setTimeout(() => {\n setIsSubscribeModalOpen(false)\n }, 3000)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AAkGM,OAqIU,YAAAA,EArIV,OAAAC,EAoBI,QAAAC,MApBJ,oBAlGN,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,8BAC/C,OAAS,UAAAC,MAAc,gBACvB,OAAS,WAAAC,EAAS,YAAAC,MAAgB,QAElC,OAAS,YAAAC,MAAiD,SAC1D,OAAS,cAAAC,MAAkB,wCAC3B,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,cAAcC,EAAI,sBAAAC,MAA0B,gBACrD,OAAS,mBAAAC,MAAuB,qBAChC,OAAS,6BAAAC,MAAiC,qCAC1C,OAAS,yBAAAC,MAA6B,0BACtC,OAAS,kBAAAC,MAAsB,qBAExB,MAAMC,GAAwB,CAAC,CAAE,KAAAC,EAAM,WAAAC,EAAY,GAAAC,CAAG,IAAoD,CAC/G,KAAM,CAACC,EAAUC,CAAW,EAAIf,EAAS,EAAK,EACxC,CAAE,QAAAgB,CAAQ,EAAIb,EAAkB,EAChC,CAAE,iBAAAc,CAAiB,EAAIX,EAAgB,EACvC,CAAE,MAAAY,CAAM,EAAIb,EAAmB,EAC/Bc,EAAUV,EAAe,SAASS,CAAK,EACvCE,EAAU,CAAC,CAACJ,EAEZ,CAACK,EAA0BC,CAA2B,EAAItB,EAAS,EAAK,EACxE,CAACuB,EAAsBC,CAAuB,EAAIxB,EAAS,EAAK,EAChE,CAACyB,EAAoBC,CAAqB,EAAI1B,EAAS,EAAK,EAC5D,CAAC2B,EAAwBC,CAAyB,EAAI5B,EAAS,EAAK,EAEpE,CAAE,QAAA6B,CAAQ,EAAI3B,EAAW,CAC7B,KAAAS,EACA,UAAW,CACT,mBAAoB,IAAMa,EAAwB,EAAI,EACtD,UAAWC,CACb,EACA,cAAe,CACb,uBAAwB,IAAMH,EAA4B,EAAI,EAC9D,UAAWK,CACb,CACF,CAAC,EACKG,EAAO/B,EAAQ,IAAM,CACzB,MAAM+B,EAAOnB,EAAK,KACf,IAAIoB,GAAQ,CACX,GAAI,CAACF,EAAQE,EAAK,EAA0B,EAC1C,OAEF,KAAM,CAAE,SAAAC,EAAU,SAAAC,EAAU,YAAAC,EAAa,UAAAC,CAAU,EAAIN,EAAQE,EAAK,EAA0B,EAC9F,IAAIK,EAAc,GACdC,EACAC,EACJ,OAAKlB,EAGMY,GACTI,EAAcD,EAAU,YACxBE,EAAc,SAEdD,EAAcF,EAAY,YAC1BG,EAAcH,EAAY,YAC1BI,EAAQJ,EAAiC,OARzCE,EAAcH,EAAS,YACvBI,EAAcJ,EAAS,aASlB,CACL,GAAGF,EACH,YAAAK,EACA,YAAAC,EACA,SAAAL,EACA,KAAAM,CACF,CACF,CAAC,EACA,OAAO,OAAO,EAWjB,OAAIlB,EACKU,EAAK,KAAK,CAACS,EAAGC,IACfD,GAAG,UAAY,CAACC,GAAG,SACd,EAEL,CAACD,GAAG,UAAYC,GAAG,SACd,GAEF,CACR,EAEMV,CAEX,EAAG,CAACD,EAASlB,EAAK,KAAMS,CAAO,CAAC,EAG1BqB,EAAiBX,EAAK,OAAS,EAErC,OACExC,EAACE,EAAA,CAAU,GAAIqB,EAAI,UAAU,eAC3B,UAAAxB,EAACI,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,KAAMkB,EAAK,MAAO,EAC5CrB,EAAC,OACC,UAAWc,EACT,wEACAe,EAAU,gBAAkB,GAC5B,CAACA,GAAW,gBACd,EACA,MAAO,CACL,WAAY,yEACd,EAGA,UAAA9B,EAAC,OACC,UAAU,6CACV,MAAO,CACL,WAAY,uFACd,EACF,EAEAC,EAAC,OAAI,UAAU,wKACb,UAAAA,EAAC,OAAI,UAAU,qCACb,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAM,EACN,KAAMkB,GAAM,SACZ,UAAU,uFACZ,EACAtB,EAAC,OAAI,UAAU,8BACb,SAAAA,EAAC,KACC,UAAU,2MACV,wBAAyB,CAAE,OAAQsB,EAAK,YAAa,EACvD,EACF,GACF,EACCA,EAAK,WAAW,KACftB,EAACK,EAAA,CACC,UAAU,qEACV,aAAa,0BACb,OAAQiB,EAAK,UAAU,IACzB,GAEJ,EAGArB,EAAC,OAAI,UAAU,qBACb,UAAAA,EAACQ,EAAO,IAAP,CACC,UAAWM,EAAG,4FAA4F,EAC1G,QAAS,CAAE,OAAQqC,EAAiB,IAAM,MAAO,EACjD,QAAS,CAAE,OAAQ3B,GAAY,CAAC2B,EAAiB,OAAS,GAAI,EAC9D,WAAY,CAAE,SAAU,EAAI,EAC5B,oBAAqB,IAAM,CACzB,GAAI,CAAC3B,GAAY2B,GAAkB,OAAO,OAAO,MAAQ,IAAK,CAC5D,MAAMC,EAAU,SAAS,eAAe7B,GAAM,iBAAiB,EAC3D6B,GACFA,EAAQ,eAAe,CAAE,SAAU,SAAU,MAAO,KAAM,CAAC,CAE/D,CACF,EAEC,UAAAZ,EAAK,IAAIC,GACRzC,EAAC,OAEC,UAAWc,EACT,oIACAe,EAAU,iBAAmB,EAC/B,EAEA,UAAA7B,EAAC,OACC,UAAAD,EAACM,EAAA,CACC,GAAG,IACH,KAAMoC,EAAK,MACX,KAAM,EACN,UAAU,oDACZ,EACAzC,EAAC,OAAI,UAAU,wCACb,UAAAD,EAACK,EAAA,CACC,UAAU,iDACV,OAAO,0FACT,EACAL,EAACM,EAAA,CACC,GAAG,IACH,KAAMoC,EAAK,QACX,KAAM,EACN,UAAU,gDACZ,GACF,GACF,EAECA,EAAK,aACN,EAAEA,EAAK,KAAO9B,EAAS,eAAiB0B,IACxC,EAAEI,EAAK,KAAO9B,EAAS,UAAYgB,EAAiB,oBACpD,EAAEc,EAAK,KAAO9B,EAAS,WAAawB,GAClCpC,EAACE,EAAA,CACC,GAAIwC,EAAK,KAAO,IAAM,SACrB,GAAIA,EAAK,MAAQ,CAAE,KAAMA,EAAK,IAAK,EACnC,GAAIA,EAAK,aAAe,CAAE,QAASA,EAAK,WAAY,EACrD,QAAQ,UACR,KAAK,KACL,UAAU,iGAET,SAAAA,EAAK,YACR,EAEA1C,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,UAAU,iGACV,SAAQ,GAEP,SAAAwC,EAAK,YACR,IAjDGA,EAAK,EAmDZ,CACD,EACA,CAACjB,GAAY2B,GACZpD,EAAC,OACC,UAAU,qDACV,MAAO,CAAE,WAAY,sEAAuE,EAC7F,GAEL,EACCoD,GACCpD,EAAAD,EAAA,CACG,SAAA0B,EACCzB,EAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACb0B,EAAY,EAAK,CACnB,EAEA,SAAA1B,EAACQ,EAAA,CAAc,UAAU,kDAAkD,EAC7E,EAEAR,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAI,UAAU,6EACb,SAAAA,EAAC,UAAO,UAAU,QAAQ,QAAS,IAAM0B,EAAY,CAACD,CAAQ,EAC5D,SAAAzB,EAACO,EAAA,CAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,EAEJ,GAEJ,GACF,EACCe,EAAK,SACJtB,EAACkB,EAAA,CACC,OAAQc,EACR,QAAS,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMX,EAAK,QACX,UAAW,IAAM,CACfiB,EAA0B,EAAI,CAChC,EACF,EAEDjB,EAAK,WACJtB,EAACmB,EAAA,CACC,KAAMG,EAAK,UACX,UAAW,IAAM,CACfe,EAAsB,EAAI,EAC1B,WAAW,IAAM,CACfF,EAAwB,EAAK,CAC/B,EAAG,GAAI,CACT,EACA,OAAQD,EACR,QAAS,IAAM,CACbC,EAAwB,EAAK,CAC/B,EACF,GAEJ,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "ChevronDownIcon", "ChevronUpIcon", "motion", "useMemo", "useState", "TaskType", "useActions", "useCreditsContext", "cn", "useHeadlessContext", "useRegistration", "CreditsUploadReceiptModal", "CreditsSubscribeModal", "ROUNDED_BRANDS", "CreditsAnkersolixTask", "copy", "classNames", "id", "showMore", "setShowMore", "profile", "authCodeActivate", "brand", "rounded", "isLogin", "isUploadReceiptModalOpen", "setIsUploadReceiptModalOpen", "isSubscribeModalOpen", "setIsSubscribeModalOpen", "isSubscribeSuccess", "setIsSubscribeSuccess", "isUploadReceiptSuccess", "setIsUploadReceiptSuccess", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "shouldShowMask", "section"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './CreditsAnkersolixTask';
@@ -0,0 +1,2 @@
1
+ export*from"./type";export*from"./CreditsAnkersolixTask";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/index.ts"],
4
+ "sourcesContent": ["export * from './type'\nexport * from './CreditsAnkersolixTask'\n"],
5
+ "mappings": "AAAA,WAAc,SACd,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export { type BenefitItem, type CreditsWaysToGetCreditsCopy as CreditsAnkersolixTaskCopy, type CreditsWaysToGetCreditsProps as CreditsAnkersolixTaskProps, TaskType, } from '../creditsWaysToGetCredits/type';
@@ -0,0 +1,2 @@
1
+ import{TaskType as t}from"../creditsWaysToGetCredits/type";export{t as TaskType};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsAnkersolixTask/type.ts"],
4
+ "sourcesContent": ["// \u76F4\u63A5\u5F15\u7528\u65E7\u7EC4\u4EF6\u7684\u7C7B\u578B\nexport {\n type BenefitItem,\n type CreditsWaysToGetCreditsCopy as CreditsAnkersolixTaskCopy,\n type CreditsWaysToGetCreditsProps as CreditsAnkersolixTaskProps,\n TaskType,\n} from '../creditsWaysToGetCredits/type'\n"],
5
+ "mappings": "AACA,OAIE,YAAAA,MACK",
6
+ "names": ["TaskType"]
7
+ }
@@ -2,22 +2,23 @@ type Img = {
2
2
  url: string;
3
3
  alt: string;
4
4
  };
5
- type BannerProps = {
6
- copy: {
7
- pcImg: Img;
8
- laptopImg: Img;
9
- mobileImg: Img;
10
- joinNow: string;
11
- loginIn: string;
12
- login: {
13
- title: string;
14
- description: string;
15
- };
16
- unLogin: {
17
- title: string;
18
- description: string;
19
- };
5
+ export type CreditsBannerCopy = {
6
+ pcImg: Img;
7
+ laptopImg: Img;
8
+ mobileImg: Img;
9
+ joinNow: string;
10
+ loginIn: string;
11
+ login: {
12
+ title: string;
13
+ description: string;
14
+ };
15
+ unLogin: {
16
+ title: string;
17
+ description: string;
20
18
  };
21
19
  };
22
- export declare function CreditsBanner({ copy }: BannerProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function CreditsBanner({ copy, id }: {
21
+ copy: CreditsBannerCopy;
22
+ id?: string;
23
+ }): import("react/jsx-runtime").JSX.Element;
23
24
  export {};
@@ -1,2 +1,2 @@
1
- import{Fragment as I,jsx as i,jsxs as l}from"react/jsx-runtime";import{Button as s,Container as p,Heading as d,Picture as c,Text as u}from"@anker-in/headless-ui";import f from"classnames";import{useCreditsContext as x}from"../context/provider";function C({copy:t}){const{profile:e,openSignInPopup:r,openSignUpPopup:o}=x(),n=e?Object.keys(e).length!==0:!1,m=e?.first_name?e?.first_name+" "+e?.last_name:e?.email?.split("@")[0],a=g=>{g==="primary"?o():r()};return i(I,{children:l("div",{className:" relative w-full",children:[i(c,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&i("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),i(p,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:i("div",{className:"grid grid-cols-12",children:l("div",{className:"l:col-span-12 l:justify-start l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[i(d,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",m||""):t.unLogin.title}),i(u,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&l("div",{className:f("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[i(s,{variant:"secondary",size:"lg",onClick:()=>{a("primary")},children:t.joinNow}),i(s,{variant:"primary",size:"lg",onClick:()=>{a("secondary")},children:t.loginIn})]})]})})})]})})}export{C as CreditsBanner};
1
+ import{Fragment as h,jsx as i,jsxs as l}from"react/jsx-runtime";import{Button as s,Container as d,Heading as c,Picture as u,Text as x}from"@anker-in/headless-ui";import f from"classnames";import{useCreditsContext as I}from"../context/provider";function w({copy:t,id:r}){const{profile:e,openSignInPopup:o,openSignUpPopup:g}=I(),n=e?Object.keys(e).length!==0:!1,m=e?.first_name?e?.first_name+" "+e?.last_name:e?.email?.split("@")[0],a=p=>{p==="primary"?g():o()};return i(h,{children:l("div",{id:r,className:" relative w-full",children:[i(u,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&i("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),i(d,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:i("div",{className:"grid grid-cols-12",children:l("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[i(c,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",m||""):t.unLogin.title}),i(x,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&l("div",{className:f("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[i(s,{variant:"secondary",size:"lg",onClick:()=>{a("primary")},children:t.joinNow}),i(s,{variant:"primary",size:"lg",onClick:()=>{a("secondary")},children:t.loginIn})]})]})})})]})})}export{w as CreditsBanner};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsBanner/index.tsx"],
4
- "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\n\ntype Img = {\n url: string\n alt: string\n}\ntype BannerProps = {\n copy: {\n pcImg: Img\n laptopImg: Img\n mobileImg: Img\n joinNow: string\n loginIn: string\n login: {\n title: string\n description: string\n }\n unLogin: {\n title: string\n description: string\n }\n }\n}\n\nexport function CreditsBanner({ copy }: BannerProps) {\n const { profile, openSignInPopup, openSignUpPopup } = useCreditsContext()\n const isLogin = profile ? Object.keys(profile).length !== 0 : false\n\n const displayName = profile?.first_name\n ? profile?.first_name + ' ' + profile?.last_name\n : profile?.email?.split('@')[0]\n\n const handleButtonClick = (buttonType: 'primary' | 'secondary') => {\n buttonType === 'primary' ? openSignUpPopup() : openSignInPopup()\n }\n\n return (\n <>\n <div className=\" relative w-full\">\n <Picture\n className=\"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]\"\n source={`${copy.pcImg?.url}, ${copy.laptopImg?.url} 1024, ${copy.mobileImg?.url} 768`}\n alt={copy.pcImg?.alt}\n loading=\"eager\"\n ></Picture>\n {isLogin && (\n <div\n className=\"absolute inset-0 \"\n style={{\n background: 'linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)',\n }}\n ></div>\n )}\n\n <Container className=\"l:h-auto !absolute inset-0 mx-auto grid h-full\" asChild>\n <div className=\"grid grid-cols-12\">\n <div className=\"l:col-span-12 l:justify-start l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]\">\n <Heading\n as=\"h1\"\n size=\"5\"\n html={isLogin ? copy.login.title?.replace('$name', displayName || '') : copy.unLogin.title}\n ></Heading>\n\n <Text\n size=\"3\"\n className=\"l:mt-[4px] l-xxl:text-[14px] mt-[16px]\"\n html={isLogin ? copy.login.description : copy.unLogin.description}\n ></Text>\n\n {!isLogin && (\n <div\n className={classNames(\n 'mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]',\n isLogin && 'hidden'\n )}\n >\n <Button\n variant=\"secondary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('primary')\n }}\n >\n {copy.joinNow}\n </Button>\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('secondary')\n }}\n >\n {copy.loginIn}\n </Button>\n </div>\n )}\n </div>\n </div>\n </Container>\n </div>\n </>\n )\n}\n"],
5
- "mappings": "AAuCI,mBAAAA,EAEI,OAAAC,EA+BQ,QAAAC,MAjCZ,oBAvCJ,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAOC,MAAgB,aACvB,OAAS,qBAAAC,MAAyB,sBAwB3B,SAASC,EAAc,CAAE,KAAAC,CAAK,EAAgB,CACnD,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,gBAAAC,CAAgB,EAAIL,EAAkB,EAClEM,EAAUH,EAAU,OAAO,KAAKA,CAAO,EAAE,SAAW,EAAI,GAExDI,EAAcJ,GAAS,WACzBA,GAAS,WAAa,IAAMA,GAAS,UACrCA,GAAS,OAAO,MAAM,GAAG,EAAE,CAAC,EAE1BK,EAAqBC,GAAwC,CACjEA,IAAe,UAAYJ,EAAgB,EAAID,EAAgB,CACjE,EAEA,OACEZ,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,mBACb,UAAAD,EAACK,EAAA,CACC,UAAU,6GACV,OAAQ,GAAGK,EAAK,OAAO,GAAG,KAAKA,EAAK,WAAW,GAAG,UAAUA,EAAK,WAAW,GAAG,OAC/E,IAAKA,EAAK,OAAO,IACjB,QAAQ,QACT,EACAI,GACCd,EAAC,OACC,UAAU,oBACV,MAAO,CACL,WAAY,sEACd,EACD,EAGHA,EAACG,EAAA,CAAU,UAAU,iDAAiD,QAAO,GAC3E,SAAAH,EAAC,OAAI,UAAU,oBACb,SAAAC,EAAC,OAAI,UAAU,0GACb,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAK,IACL,KAAMU,EAAUJ,EAAK,MAAM,OAAO,QAAQ,QAASK,GAAe,EAAE,EAAIL,EAAK,QAAQ,MACtF,EAEDV,EAACM,EAAA,CACC,KAAK,IACL,UAAU,yCACV,KAAMQ,EAAUJ,EAAK,MAAM,YAAcA,EAAK,QAAQ,YACvD,EAEA,CAACI,GACAb,EAAC,OACC,UAAWM,EACT,4DACAO,GAAW,QACb,EAEA,UAAAd,EAACE,EAAA,CACC,QAAQ,YACR,KAAK,KACL,QAAS,IAAM,CACbc,EAAkB,SAAS,CAC7B,EAEC,SAAAN,EAAK,QACR,EACAV,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAM,CACbc,EAAkB,WAAW,CAC/B,EAEC,SAAAN,EAAK,QACR,GACF,GAEJ,EACF,EACF,GACF,EACF,CAEJ",
6
- "names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "classNames", "useCreditsContext", "CreditsBanner", "copy", "profile", "openSignInPopup", "openSignUpPopup", "isLogin", "displayName", "handleButtonClick", "buttonType"]
4
+ "sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\n\ntype Img = {\n url: string\n alt: string\n}\nexport type CreditsBannerCopy = {\n pcImg: Img\n laptopImg: Img\n mobileImg: Img\n joinNow: string\n loginIn: string\n login: {\n title: string\n description: string\n }\n unLogin: {\n title: string\n description: string\n }\n}\n\nexport function CreditsBanner({ copy, id }: { copy: CreditsBannerCopy; id?: string }) {\n const { profile, openSignInPopup, openSignUpPopup } = useCreditsContext()\n const isLogin = profile ? Object.keys(profile).length !== 0 : false\n\n const displayName = profile?.first_name\n ? profile?.first_name + ' ' + profile?.last_name\n : profile?.email?.split('@')[0]\n\n const handleButtonClick = (buttonType: 'primary' | 'secondary') => {\n buttonType === 'primary' ? openSignUpPopup() : openSignInPopup()\n }\n\n return (\n <>\n <div id={id} className=\" relative w-full\">\n <Picture\n className=\"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]\"\n source={`${copy.pcImg?.url}, ${copy.laptopImg?.url} 1024, ${copy.mobileImg?.url} 768`}\n alt={copy.pcImg?.alt}\n loading=\"eager\"\n ></Picture>\n {isLogin && (\n <div\n className=\"absolute inset-0 \"\n style={{\n background: 'linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)',\n }}\n ></div>\n )}\n\n <Container className=\"l:h-auto !absolute inset-0 mx-auto grid h-full\" asChild>\n <div className=\"grid grid-cols-12\">\n <div className=\"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]\">\n <Heading\n as=\"h1\"\n size=\"5\"\n html={isLogin ? copy.login.title?.replace('$name', displayName || '') : copy.unLogin.title}\n ></Heading>\n\n <Text\n size=\"3\"\n className=\"l:mt-[4px] l-xxl:text-[14px] mt-[16px]\"\n html={isLogin ? copy.login.description : copy.unLogin.description}\n ></Text>\n\n {!isLogin && (\n <div\n className={classNames(\n 'mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]',\n isLogin && 'hidden'\n )}\n >\n <Button\n variant=\"secondary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('primary')\n }}\n >\n {copy.joinNow}\n </Button>\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('secondary')\n }}\n >\n {copy.loginIn}\n </Button>\n </div>\n )}\n </div>\n </div>\n </Container>\n </div>\n </>\n )\n}\n"],
5
+ "mappings": "AAqCI,mBAAAA,EAEI,OAAAC,EA+BQ,QAAAC,MAjCZ,oBArCJ,OAAS,UAAAC,EAAQ,aAAAC,EAAW,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBAC1D,OAAOC,MAAgB,aACvB,OAAS,qBAAAC,MAAyB,sBAsB3B,SAASC,EAAc,CAAE,KAAAC,EAAM,GAAAC,CAAG,EAA6C,CACpF,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,gBAAAC,CAAgB,EAAIN,EAAkB,EAClEO,EAAUH,EAAU,OAAO,KAAKA,CAAO,EAAE,SAAW,EAAI,GAExDI,EAAcJ,GAAS,WACzBA,GAAS,WAAa,IAAMA,GAAS,UACrCA,GAAS,OAAO,MAAM,GAAG,EAAE,CAAC,EAE1BK,EAAqBC,GAAwC,CACjEA,IAAe,UAAYJ,EAAgB,EAAID,EAAgB,CACjE,EAEA,OACEb,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,GAAIU,EAAI,UAAU,mBACrB,UAAAX,EAACK,EAAA,CACC,UAAU,6GACV,OAAQ,GAAGK,EAAK,OAAO,GAAG,KAAKA,EAAK,WAAW,GAAG,UAAUA,EAAK,WAAW,GAAG,OAC/E,IAAKA,EAAK,OAAO,IACjB,QAAQ,QACT,EACAK,GACCf,EAAC,OACC,UAAU,oBACV,MAAO,CACL,WAAY,sEACd,EACD,EAGHA,EAACG,EAAA,CAAU,UAAU,iDAAiD,QAAO,GAC3E,SAAAH,EAAC,OAAI,UAAU,oBACb,SAAAC,EAAC,OAAI,UAAU,qHACb,UAAAD,EAACI,EAAA,CACC,GAAG,KACH,KAAK,IACL,KAAMW,EAAUL,EAAK,MAAM,OAAO,QAAQ,QAASM,GAAe,EAAE,EAAIN,EAAK,QAAQ,MACtF,EAEDV,EAACM,EAAA,CACC,KAAK,IACL,UAAU,yCACV,KAAMS,EAAUL,EAAK,MAAM,YAAcA,EAAK,QAAQ,YACvD,EAEA,CAACK,GACAd,EAAC,OACC,UAAWM,EACT,4DACAQ,GAAW,QACb,EAEA,UAAAf,EAACE,EAAA,CACC,QAAQ,YACR,KAAK,KACL,QAAS,IAAM,CACbe,EAAkB,SAAS,CAC7B,EAEC,SAAAP,EAAK,QACR,EACAV,EAACE,EAAA,CACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAM,CACbe,EAAkB,WAAW,CAC/B,EAEC,SAAAP,EAAK,QACR,GACF,GAEJ,EACF,EACF,GACF,EACF,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Container", "Heading", "Picture", "Text", "classNames", "useCreditsContext", "CreditsBanner", "copy", "id", "profile", "openSignInPopup", "openSignUpPopup", "isLogin", "displayName", "handleButtonClick", "buttonType"]
7
7
  }
@@ -7,7 +7,7 @@ export interface BenefitItemCopy {
7
7
  note?: string;
8
8
  tag?: string;
9
9
  }
10
- declare const BenefitItem: ({ item, handleClick, isNoteActive, index, }: {
10
+ declare const BenefitItem: ({ item, handleClick, isNoteActive, index, bigIcon, cardBgColor, cardBorderColor, }: {
11
11
  item: BenefitItemCopy;
12
12
  handleClick: ({ item, index }: {
13
13
  item: BenefitItemCopy;
@@ -15,5 +15,8 @@ declare const BenefitItem: ({ item, handleClick, isNoteActive, index, }: {
15
15
  }) => void;
16
16
  isNoteActive: boolean;
17
17
  index: number;
18
+ bigIcon?: boolean;
19
+ cardBgColor?: string;
20
+ cardBorderColor?: string;
18
21
  }) => import("react/jsx-runtime").JSX.Element;
19
22
  export default BenefitItem;
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as i}from"react/jsx-runtime";import{Heading as r,Picture as s,Text as a}from"@anker-in/headless-ui";import{cn as p}from"../../../helpers/utils";import x from"./iconInfo";const m=({item:e,handleClick:l,isNoteActive:n,index:d})=>t("div",{className:"relative h-full rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",style:{background:"linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)"},children:i("div",{className:"flex flex-col",children:[t(s,{className:"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0",alt:e.icon?.alt,source:e.icon?.url}),i("div",{className:"flex items-center",children:[t(r,{html:e.text,size:"2",className:"break-all"}),e.note&&i("div",{role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&o.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>l({item:e,index:d}),children:[t(x,{}),t("div",{className:p("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",n?"block":"hidden"),children:i("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",children:[t(a,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),t("div",{className:"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),e.tag&&t(a,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})});var u=m;export{u as default};
2
- //# sourceMappingURL=benefitItem.js.map
1
+ import{jsx as t,jsxs as i}from"react/jsx-runtime";import{Heading as u,Picture as g,Text as r}from"@anker-in/headless-ui";import{classNames as n,useHeadlessContext as v}from"@anker-in/lib";import F from"./IconInfo";import{ROUNDED_BRANDS as N}from"../../../constants";const h=({item:e,handleClick:x,isNoteActive:m,index:p,bigIcon:c,cardBgColor:l,cardBorderColor:d})=>{const{brand:b}=v(),s=N.includes(b),f=c?"mb-[16px] size-[64px] xl-xxl:size-[54px] xl:size-[48px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0":"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0";console.log("cardBgColor in BenefitItem",l);const o={};return l?o.background=l:o.background="linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)",d&&(o.borderColor=d),t("div",{className:n("relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",!s&&"rounded-none"),style:o,children:i("div",{className:"flex flex-col",children:[t(g,{className:f,alt:e.icon?.alt,source:e.icon?.url}),i("div",{className:"flex items-center",children:[t(u,{html:e.text,size:"2",className:"break-all md-l:line-clamp-3"}),e.note&&i("div",{role:"button",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>x({item:e,index:p}),children:[t(F,{}),t("div",{className:n("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",m?"block":"hidden"),children:i("div",{className:n("relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",!s&&"rounded-none"),children:[t(r,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),t("div",{className:n("absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]",!s&&"rounded-none")})]})})]})]}),e.tag&&t(r,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})})};var z=h;export{z as default};
2
+ //# sourceMappingURL=BenefitItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsBenefits/benefitItem.tsx"],
4
- "sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { cn } from '../../../helpers/utils'\nimport IconInfo from './iconInfo'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n}) => {\n return (\n <div\n className=\"relative h-full rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]\"\n style={{\n background: 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)',\n }}\n >\n <div className=\"flex flex-col\">\n <Picture\n className=\"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0\"\n alt={item.icon?.alt}\n source={item.icon?.url}\n />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow\">\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div className=\"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
5
- "mappings": "AAgCQ,cAAAA,EA0BQ,QAAAC,MA1BR,oBAhCR,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBACvC,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAc,aAWrB,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,CACF,IAOIX,EAAC,OACC,UAAU,gHACV,MAAO,CACL,WAAY,4EACd,EAEA,SAAAC,EAAC,OAAI,UAAU,gBACb,UAAAD,EAACG,EAAA,CACC,UAAU,6EACV,IAAKK,EAAK,MAAM,IAChB,OAAQA,EAAK,MAAM,IACrB,EACAP,EAAC,OAAI,UAAU,oBACb,UAAAD,EAACE,EAAA,CAAQ,KAAMM,EAAK,KAAM,KAAK,IAAI,UAAU,YAAY,EACxDA,EAAK,MACJP,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWW,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMH,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,UAAAX,EAACM,EAAA,EAAS,EACVN,EAAC,OACC,UAAWK,EACT,qGACAK,EAAe,QAAU,QAC3B,EAEA,SAAAT,EAAC,OAAI,UAAU,0FACb,UAAAD,EAACI,EAAA,CAAK,GAAG,IAAI,KAAK,IAAI,KAAMI,EAAK,KAAM,UAAU,sBAAsB,EACvER,EAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GAEJ,EACCQ,EAAK,KAAOR,EAACI,EAAA,CAAK,GAAG,MAAM,KAAMI,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,EAIJ,IAAOK,EAAQN",
6
- "names": ["jsx", "jsxs", "Heading", "Picture", "Text", "cn", "IconInfo", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "e", "benefitItem_default"]
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/BenefitItem.tsx"],
4
+ "sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport IconInfo from './IconInfo'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n bigIcon,\n cardBgColor,\n cardBorderColor,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n bigIcon?: boolean\n cardBgColor?: string\n cardBorderColor?: string\n}) => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n // \u6839\u636E bigIcon \u8BBE\u7F6E\u4E0D\u540C\u5C4F\u5E55\u4E0B\u7684\u56FE\u6807\u5927\u5C0F\n // \u5C3A\u5BF8\uFF1A\u22651921px=64px, 1441-1920px=54px, \u22641440px=48px\n const iconSizeClass = bigIcon\n ? 'mb-[16px] size-[64px] xl-xxl:size-[54px] xl:size-[48px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0'\n : 'mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0'\n\n console.log('cardBgColor in BenefitItem', cardBgColor)\n // \u80CC\u666F\u8272\u548C\u8FB9\u6846\u8272\u5904\u7406\n const cardStyle: React.CSSProperties = {}\n if (cardBgColor) {\n cardStyle.background = cardBgColor\n } else {\n cardStyle.background = 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)'\n }\n if (cardBorderColor) {\n cardStyle.borderColor = cardBorderColor\n }\n\n return (\n <div\n className={cn(\n 'relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]',\n !rounded && 'rounded-none'\n )}\n style={cardStyle}\n >\n <div className=\"flex flex-col\">\n <Picture className={iconSizeClass} alt={item.icon?.alt} source={item.icon?.url} />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all md-l:line-clamp-3\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div\n className={cn(\n 'relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow',\n !rounded && 'rounded-none'\n )}\n >\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div\n className={cn(\n 'absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]',\n !rounded && 'rounded-none'\n )}\n />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
5
+ "mappings": "AA6DQ,cAAAA,EAsBQ,QAAAC,MAtBR,oBA7DR,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBACvC,OAAS,cAAcC,EAAI,sBAAAC,MAA0B,gBACrD,OAAOC,MAAc,aACrB,OAAS,kBAAAC,MAAsB,qBAW/B,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,EACA,QAAAC,EACA,YAAAC,EACA,gBAAAC,CACF,IAQM,CACJ,KAAM,CAAE,MAAAC,CAAM,EAAIX,EAAmB,EAC/BY,EAAUV,EAAe,SAASS,CAAK,EAIvCE,EAAgBL,EAClB,+GACA,6EAEJ,QAAQ,IAAI,6BAA8BC,CAAW,EAErD,MAAMK,EAAiC,CAAC,EACxC,OAAIL,EACFK,EAAU,WAAaL,EAEvBK,EAAU,WAAa,6EAErBJ,IACFI,EAAU,YAAcJ,GAIxBhB,EAAC,OACC,UAAWK,EACT,8HACA,CAACa,GAAW,cACd,EACA,MAAOE,EAEP,SAAAnB,EAAC,OAAI,UAAU,gBACb,UAAAD,EAACG,EAAA,CAAQ,UAAWgB,EAAe,IAAKT,EAAK,MAAM,IAAK,OAAQA,EAAK,MAAM,IAAK,EAChFT,EAAC,OAAI,UAAU,oBACb,UAAAD,EAACE,EAAA,CAAQ,KAAMQ,EAAK,KAAM,KAAK,IAAI,UAAU,8BAA8B,EAC1EA,EAAK,MACJT,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWoB,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMV,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,UAAAb,EAACO,EAAA,EAAS,EACVP,EAAC,OACC,UAAWK,EACT,qGACAO,EAAe,QAAU,QAC3B,EAEA,SAAAX,EAAC,OACC,UAAWI,EACT,0FACA,CAACa,GAAW,cACd,EAEA,UAAAlB,EAACI,EAAA,CAAK,GAAG,IAAI,KAAK,IAAI,KAAMM,EAAK,KAAM,UAAU,sBAAsB,EACvEV,EAAC,OACC,UAAWK,EACT,mHACA,CAACa,GAAW,cACd,EACF,GACF,EACF,GACF,GAEJ,EACCR,EAAK,KAAOV,EAACI,EAAA,CAAK,GAAG,MAAM,KAAMM,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,CAEJ,EAEA,IAAOY,EAAQb",
6
+ "names": ["jsx", "jsxs", "Heading", "Picture", "Text", "cn", "useHeadlessContext", "IconInfo", "ROUNDED_BRANDS", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "bigIcon", "cardBgColor", "cardBorderColor", "brand", "rounded", "iconSizeClass", "cardStyle", "e", "BenefitItem_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import{jsx as C,jsxs as o}from"react/jsx-runtime";const l=()=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-[18px] cursor-pointer [&_svg]:size-full",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[C("path",{d:"M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z",fill:"#6D6D6F"}),C("path",{d:"M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z",fill:"#6D6D6F"})]});var s=l;export{l as IconInfo,s as default};
2
- //# sourceMappingURL=iconInfo.js.map
2
+ //# sourceMappingURL=IconInfo.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/creditsBenefits/iconInfo.tsx"],
3
+ "sources": ["../../../../../src/components/credits/creditsBenefits/IconInfo.tsx"],
4
4
  "sourcesContent": ["export const IconInfo = () => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n className='size-[18px] cursor-pointer [&_svg]:size-full'\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n >\n <path\n d='M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z'\n fill='#6D6D6F'\n />\n <path\n d='M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z'\n fill='#6D6D6F'\n />\n </svg>\n )\n}\n\nexport default IconInfo\n"],
5
5
  "mappings": "AAEI,OAQE,OAAAA,EARF,QAAAC,MAAA,oBAFG,MAAMC,EAAW,IAEpBD,EAAC,OACC,MAAM,6BACN,UAAU,+CACV,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,UAAAD,EAAC,QACC,EAAE,6rBACF,KAAK,UACP,EACAA,EAAC,QACC,EAAE,+aACF,KAAK,UACP,GACF,EAIJ,IAAOG,EAAQD",
6
- "names": ["jsx", "jsxs", "IconInfo", "iconInfo_default"]
6
+ "names": ["jsx", "jsxs", "IconInfo", "IconInfo_default"]
7
7
  }
@@ -1,12 +1,15 @@
1
1
  import 'swiper/css';
2
2
  import 'swiper/css/grid';
3
3
  import 'swiper/css/pagination';
4
- import { type BenefitItemCopy } from './benefitItem';
5
- interface CreditsBenefitsProps {
6
- copy: {
7
- title: string;
8
- benefits: BenefitItemCopy[];
9
- };
10
- }
11
- export declare const CreditsBenefits: ({ copy }: CreditsBenefitsProps) => import("react/jsx-runtime").JSX.Element;
12
- export {};
4
+ import { type BenefitItemCopy } from './BenefitItem';
5
+ export type CreditsBenefitsCopy = {
6
+ title: string;
7
+ benefits: BenefitItemCopy[];
8
+ bigIcon?: boolean;
9
+ cardBgColor?: string;
10
+ cardBorderColor?: string;
11
+ };
12
+ export declare const CreditsBenefits: ({ copy, id }: {
13
+ copy: CreditsBenefitsCopy;
14
+ id?: string;
15
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import"swiper/css";import"swiper/css/grid";import"swiper/css/pagination";import{Container as d,Heading as c}from"@anker-in/headless-ui";import{useState as u}from"react";import{Grid as f,Pagination as g}from"swiper/modules";import{Swiper as v,SwiperSlide as b}from"swiper/react";import l from"./benefitItem";import{useCreditsContext as w}from"../context/provider";import{gaTrack as C}from"../../../helpers/track";import{cn as x}from"../../../helpers/utils";const G=({copy:o})=>{const[n,r]=u(null),{profile:p,gtm:m}=w(),s=({item:i,index:e})=>{C({event:"ga4Event",event_name:"lp_button",member_active_status:p?.activated?"active":"not active",event_parameters:{page_group:m.pageGroup,position:o.title,button_name:i.text,info:""}}),n===e?r(null):(r(e),setTimeout(()=>{r(null)},5e3))};return a(d,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[t(c,{as:"h2",size:"4",html:o?.title}),t("div",{className:"mt-[24px] grid grid-cols-2 gap-[16px] l:hidden min-md:grid-cols-3 min-xl:grid-cols-4",children:o.benefits.map((i,e)=>t(l,{item:i,handleClick:s,isNoteActive:n===e,index:e},e))}),a("div",{className:"mt-[24px] hidden l:block",children:[t(v,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"items-stretch",modules:[f,g],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(i,e){return`<div class='${e} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
- </div>`}},children:o.benefits.map((i,e)=>t(b,{className:x("!h-auto",n===e&&"!z-[100]"),children:t(l,{item:i,handleClick:s,isNoteActive:n===e,index:e})},e))}),t("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
- [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),n&&t("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>r(null),onKeyDown:i=>i.key==="Escape"&&r(null)})]})};export{G as CreditsBenefits};
1
+ import{jsx as r,jsxs as a}from"react/jsx-runtime";import"swiper/css";import"swiper/css/grid";import"swiper/css/pagination";import{Container as c,Heading as g}from"@anker-in/headless-ui";import{useState as u}from"react";import{Grid as f,Pagination as b}from"swiper/modules";import{Swiper as C,SwiperSlide as v}from"swiper/react";import s from"./BenefitItem";import{useCreditsContext as B}from"../context/provider";import{gaTrack as w,classNames as x}from"@anker-in/lib";const G=({copy:t,id:d})=>{const[o,n]=u(null),{profile:m,gtm:p}=B(),l=({item:i,index:e})=>{w({event:"ga4Event",event_name:"lp_button",member_active_status:m?.activated?"active":"not active",event_parameters:{page_group:p.pageGroup,position:t.title,button_name:i.text,info:""}}),o===e?n(null):(n(e),setTimeout(()=>{n(null)},5e3))};return a(c,{id:d,className:"!z-[30] bg-[#F5F5F7]",children:[r(g,{as:"h2",size:"4",html:t?.title}),r("div",{className:"mt-[24px] grid grid-cols-4 gap-[16px] l:hidden items-stretch",children:t.benefits.map((i,e)=>r(s,{item:i,handleClick:l,isNoteActive:o===e,index:e,bigIcon:t.bigIcon,cardBgColor:t.cardBgColor,cardBorderColor:t.cardBorderColor},e))}),a("div",{className:"mt-[24px] hidden l:block",children:[r(C,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"!items-stretch",modules:[f,b],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(i,e){return`<div class='${e} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
2
+ </div>`}},children:t.benefits.map((i,e)=>r(v,{className:x("!h-auto !flex",o===e&&"!z-[100]"),children:r(s,{item:i,handleClick:l,isNoteActive:o===e,index:e,bigIcon:t.bigIcon,cardBgColor:t.cardBgColor,cardBorderColor:t.cardBorderColor})},e))}),r("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
3
+ [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),o&&r("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>n(null),onKeyDown:i=>i.key==="Escape"&&n(null)})]})};export{G as CreditsBenefits};
4
4
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsBenefits/index.tsx"],
4
- "sourcesContent": ["import 'swiper/css'\nimport 'swiper/css/grid'\nimport 'swiper/css/pagination'\n\nimport { Container, Heading } from '@anker-in/headless-ui'\nimport { useState } from 'react'\nimport { Grid, Pagination } from 'swiper/modules'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nimport BenefitItem, { type BenefitItemCopy } from './benefitItem'\nimport { useCreditsContext } from '../context/provider'\nimport { gaTrack } from '../../../helpers/track'\nimport { cn } from '../../../helpers/utils'\n\ninterface CreditsBenefitsProps {\n copy: {\n title: string\n benefits: BenefitItemCopy[]\n }\n}\n\nexport const CreditsBenefits = ({ copy }: CreditsBenefitsProps) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n\n const handleClick = ({ item, index }: { item: BenefitItemCopy; index: number }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: copy.title,\n button_name: item.text,\n info: '',\n },\n })\n if (activeNoteIndex === index) {\n setActiveNoteIndex(null)\n } else {\n setActiveNoteIndex(index)\n setTimeout(() => {\n setActiveNoteIndex(null)\n }, 5000)\n }\n }\n\n return (\n <Container id=\"benefits\" className=\"!z-[30] bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy?.title} />\n <div className=\"mt-[24px] grid grid-cols-2 gap-[16px] l:hidden min-md:grid-cols-3 min-xl:grid-cols-4\">\n {copy.benefits.map((item, index) => (\n <BenefitItem\n key={index}\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n ))}\n </div>\n <div className=\"mt-[24px] hidden l:block\">\n <Swiper\n spaceBetween={16}\n slidesPerView={2}\n slidesPerGroup={2}\n grid={{\n rows: 2,\n fill: 'row',\n }}\n breakpoints={{\n 768: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n }}\n wrapperClass=\"items-stretch\"\n modules={[Grid, Pagination]}\n pagination={{\n clickable: true,\n el: '#benefits-pagination',\n renderBullet(index, className) {\n return `<div class='${className} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>\n </div>`\n },\n }}\n >\n {copy.benefits.map((item, index) => (\n <SwiperSlide key={index} className={cn('!h-auto', activeNoteIndex === index && '!z-[100]')}>\n <BenefitItem\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n <div\n id=\"benefits-pagination\"\n className=\"mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515] \n [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full\"\n ></div>\n </div>\n\n {activeNoteIndex && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setActiveNoteIndex(null)}\n onKeyDown={e => e.key === 'Escape' && setActiveNoteIndex(null)}\n />\n )}\n </Container>\n )\n}\n"],
5
- "mappings": "AAiDM,cAAAA,EAYA,QAAAC,MAZA,oBAjDN,MAAO,aACP,MAAO,kBACP,MAAO,wBAEP,OAAS,aAAAC,EAAW,WAAAC,MAAe,wBACnC,OAAS,YAAAC,MAAgB,QACzB,OAAS,QAAAC,EAAM,cAAAC,MAAkB,iBACjC,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAOC,MAA2C,gBAClD,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,MAAe,yBACxB,OAAS,MAAAC,MAAU,yBASZ,MAAMC,EAAkB,CAAC,CAAE,KAAAC,CAAK,IAA4B,CACjE,KAAM,CAACC,EAAiBC,CAAkB,EAAIZ,EAAwB,IAAI,EACpE,CAAE,QAAAa,EAAS,IAAAC,CAAI,EAAIR,EAAkB,EAErCS,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,CACjFV,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBM,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EAAI,UAChB,SAAUJ,EAAK,MACf,YAAaM,EAAK,KAClB,KAAM,EACR,CACF,CAAC,EACGL,IAAoBM,EACtBL,EAAmB,IAAI,GAEvBA,EAAmBK,CAAK,EACxB,WAAW,IAAM,CACfL,EAAmB,IAAI,CACzB,EAAG,GAAI,EAEX,EAEA,OACEf,EAACC,EAAA,CAAU,GAAG,WAAW,UAAU,uBACjC,UAAAF,EAACG,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,KAAMW,GAAM,MAAO,EAC7Cd,EAAC,OAAI,UAAU,uFACZ,SAAAc,EAAK,SAAS,IAAI,CAACM,EAAMC,IACxBrB,EAACS,EAAA,CAEC,KAAMW,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,GAJFA,CAKP,CACD,EACH,EACApB,EAAC,OAAI,UAAU,2BACb,UAAAD,EAACO,EAAA,CACC,aAAc,GACd,cAAe,EACf,eAAgB,EAChB,KAAM,CACJ,KAAM,EACN,KAAM,KACR,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,eAAgB,CAClB,CACF,EACA,aAAa,gBACb,QAAS,CAACF,EAAMC,CAAU,EAC1B,WAAY,CACV,UAAW,GACX,GAAI,uBACJ,aAAae,EAAOC,EAAW,CAC7B,MAAO,eAAeA,CAAS;AAAA,qBAEjC,CACF,EAEC,SAAAR,EAAK,SAAS,IAAI,CAACM,EAAMC,IACxBrB,EAACQ,EAAA,CAAwB,UAAWI,EAAG,UAAWG,IAAoBM,GAAS,UAAU,EACvF,SAAArB,EAACS,EAAA,CACC,KAAMW,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACT,GANgBA,CAOlB,CACD,EACH,EACArB,EAAC,OACC,GAAG,sBACH,UAAU;AAAA,mGAEX,GACH,EAECe,GACCf,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMgB,EAAmB,IAAI,EACtC,UAAWO,GAAKA,EAAE,MAAQ,UAAYP,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
6
- "names": ["jsx", "jsxs", "Container", "Heading", "useState", "Grid", "Pagination", "Swiper", "SwiperSlide", "BenefitItem", "useCreditsContext", "gaTrack", "cn", "CreditsBenefits", "copy", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "handleClick", "item", "index", "className", "e"]
4
+ "sourcesContent": ["import 'swiper/css'\nimport 'swiper/css/grid'\nimport 'swiper/css/pagination'\n\nimport { Container, Heading } from '@anker-in/headless-ui'\nimport { useState } from 'react'\nimport { Grid, Pagination } from 'swiper/modules'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nimport BenefitItem, { type BenefitItemCopy } from './BenefitItem'\nimport { useCreditsContext } from '../context/provider'\nimport { gaTrack, classNames as cn } from '@anker-in/lib'\n\nexport type CreditsBenefitsCopy = {\n title: string\n benefits: BenefitItemCopy[]\n bigIcon?: boolean\n cardBgColor?: string\n cardBorderColor?: string\n}\n\nexport const CreditsBenefits = ({ copy, id }: { copy: CreditsBenefitsCopy; id?: string }) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n const handleClick = ({ item, index }: { item: BenefitItemCopy; index: number }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: copy.title,\n button_name: item.text,\n info: '',\n },\n })\n if (activeNoteIndex === index) {\n setActiveNoteIndex(null)\n } else {\n setActiveNoteIndex(index)\n setTimeout(() => {\n setActiveNoteIndex(null)\n }, 5000)\n }\n }\n\n return (\n <Container id={id} className=\"!z-[30] bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy?.title} />\n <div className=\"mt-[24px] grid grid-cols-4 gap-[16px] l:hidden items-stretch\">\n {copy.benefits.map((item, index) => (\n <BenefitItem\n key={index}\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n bigIcon={copy.bigIcon}\n cardBgColor={copy.cardBgColor}\n cardBorderColor={copy.cardBorderColor}\n />\n ))}\n </div>\n <div className=\"mt-[24px] hidden l:block\">\n <Swiper\n spaceBetween={16}\n slidesPerView={2}\n slidesPerGroup={2}\n grid={{\n rows: 2,\n fill: 'row',\n }}\n breakpoints={{\n 768: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n }}\n wrapperClass=\"!items-stretch\"\n modules={[Grid, Pagination]}\n pagination={{\n clickable: true,\n el: '#benefits-pagination',\n renderBullet(index, className) {\n return `<div class='${className} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>\n </div>`\n },\n }}\n >\n {copy.benefits.map((item, index) => (\n <SwiperSlide key={index} className={cn('!h-auto !flex', activeNoteIndex === index && '!z-[100]')}>\n <BenefitItem\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n bigIcon={copy.bigIcon}\n cardBgColor={copy.cardBgColor}\n cardBorderColor={copy.cardBorderColor}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n <div\n id=\"benefits-pagination\"\n className=\"mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515] \n [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full\"\n ></div>\n </div>\n\n {activeNoteIndex && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setActiveNoteIndex(null)}\n onKeyDown={e => e.key === 'Escape' && setActiveNoteIndex(null)}\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AAgDM,cAAAA,EAeA,QAAAC,MAfA,oBAhDN,MAAO,aACP,MAAO,kBACP,MAAO,wBAEP,OAAS,aAAAC,EAAW,WAAAC,MAAe,wBACnC,OAAS,YAAAC,MAAgB,QACzB,OAAS,QAAAC,EAAM,cAAAC,MAAkB,iBACjC,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eAEpC,OAAOC,MAA2C,gBAClD,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,WAAAC,EAAS,cAAcC,MAAU,gBAUnC,MAAMC,EAAkB,CAAC,CAAE,KAAAC,EAAM,GAAAC,CAAG,IAAkD,CAC3F,KAAM,CAACC,EAAiBC,CAAkB,EAAIb,EAAwB,IAAI,EACpE,CAAE,QAAAc,EAAS,IAAAC,CAAI,EAAIT,EAAkB,EACrCU,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,CACjFX,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBO,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EAAI,UAChB,SAAUL,EAAK,MACf,YAAaO,EAAK,KAClB,KAAM,EACR,CACF,CAAC,EACGL,IAAoBM,EACtBL,EAAmB,IAAI,GAEvBA,EAAmBK,CAAK,EACxB,WAAW,IAAM,CACfL,EAAmB,IAAI,CACzB,EAAG,GAAI,EAEX,EAEA,OACEhB,EAACC,EAAA,CAAU,GAAIa,EAAI,UAAU,uBAC3B,UAAAf,EAACG,EAAA,CAAQ,GAAG,KAAK,KAAK,IAAI,KAAMW,GAAM,MAAO,EAC7Cd,EAAC,OAAI,UAAU,+DACZ,SAAAc,EAAK,SAAS,IAAI,CAACO,EAAMC,IACxBtB,EAACS,EAAA,CAEC,KAAMY,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACP,QAASR,EAAK,QACd,YAAaA,EAAK,YAClB,gBAAiBA,EAAK,iBAPjBQ,CAQP,CACD,EACH,EACArB,EAAC,OAAI,UAAU,2BACb,UAAAD,EAACO,EAAA,CACC,aAAc,GACd,cAAe,EACf,eAAgB,EAChB,KAAM,CACJ,KAAM,EACN,KAAM,KACR,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,eAAgB,CAClB,CACF,EACA,aAAa,iBACb,QAAS,CAACF,EAAMC,CAAU,EAC1B,WAAY,CACV,UAAW,GACX,GAAI,uBACJ,aAAagB,EAAOC,EAAW,CAC7B,MAAO,eAAeA,CAAS;AAAA,qBAEjC,CACF,EAEC,SAAAT,EAAK,SAAS,IAAI,CAACO,EAAMC,IACxBtB,EAACQ,EAAA,CAAwB,UAAWI,EAAG,gBAAiBI,IAAoBM,GAAS,UAAU,EAC7F,SAAAtB,EAACS,EAAA,CACC,KAAMY,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACP,QAASR,EAAK,QACd,YAAaA,EAAK,YAClB,gBAAiBA,EAAK,gBACxB,GATgBQ,CAUlB,CACD,EACH,EACAtB,EAAC,OACC,GAAG,sBACH,UAAU;AAAA,mGAEX,GACH,EAECgB,GACChB,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMiB,EAAmB,IAAI,EACtC,UAAWO,GAAKA,EAAE,MAAQ,UAAYP,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Container", "Heading", "useState", "Grid", "Pagination", "Swiper", "SwiperSlide", "BenefitItem", "useCreditsContext", "gaTrack", "cn", "CreditsBenefits", "copy", "id", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "handleClick", "item", "index", "className", "e"]
7
7
  }