@anker-in/campaign-ui 0.2.10-beta.22 → 0.2.10-beta.24
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.
- package/dist/cjs/components/chat/action.d.ts +25 -0
- package/dist/cjs/components/chat/action.js +2 -0
- package/dist/cjs/components/chat/action.js.map +7 -0
- package/dist/cjs/components/chat/button.d.ts +3 -0
- package/dist/cjs/components/chat/button.js +2 -0
- package/dist/cjs/components/chat/button.js.map +7 -0
- package/dist/cjs/components/chat/chatContext.d.ts +101 -0
- package/dist/cjs/components/chat/chatContext.js +2 -0
- package/dist/cjs/components/chat/chatContext.js.map +7 -0
- package/dist/cjs/components/chat/index.d.ts +71 -0
- package/dist/cjs/components/chat/index.js +2 -0
- package/dist/cjs/components/chat/index.js.map +7 -0
- package/dist/cjs/components/chat/markdown.d.ts +5 -0
- package/dist/cjs/components/chat/markdown.js +2 -0
- package/dist/cjs/components/chat/markdown.js.map +7 -0
- package/dist/cjs/components/chat/messages.d.ts +3 -0
- package/dist/cjs/components/chat/messages.js +2 -0
- package/dist/cjs/components/chat/messages.js.map +7 -0
- package/dist/cjs/components/chat/props.d.ts +43 -0
- package/dist/cjs/components/chat/props.js +2 -0
- package/dist/cjs/components/chat/props.js.map +7 -0
- package/dist/cjs/components/chat/response.d.ts +4 -0
- package/dist/cjs/components/chat/response.js +2 -0
- package/dist/cjs/components/chat/response.js.map +7 -0
- package/dist/cjs/components/chat/suggestions.d.ts +3 -0
- package/dist/cjs/components/chat/suggestions.js +2 -0
- package/dist/cjs/components/chat/suggestions.js.map +7 -0
- package/dist/cjs/components/chat/utils.d.ts +3 -0
- package/dist/cjs/components/chat/utils.js +2 -0
- package/dist/cjs/components/chat/utils.js.map +7 -0
- package/dist/cjs/components/credits/context/const.d.ts +81 -0
- package/dist/cjs/components/credits/context/const.js +2 -0
- package/dist/cjs/components/credits/context/const.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/cjs/components/credits/context/provider.d.ts +49 -0
- package/dist/cjs/components/credits/context/provider.js +2 -0
- package/dist/cjs/components/credits/context/provider.js.map +7 -0
- package/dist/cjs/components/credits/context/response.d.ts +63 -0
- package/dist/cjs/components/credits/context/response.js +2 -0
- package/dist/cjs/components/credits/context/response.js.map +7 -0
- package/dist/cjs/components/credits/context/utils.d.ts +25 -0
- package/dist/cjs/components/credits/context/utils.js +2 -0
- package/dist/cjs/components/credits/context/utils.js.map +7 -0
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
- package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/index.d.ts +13 -0
- package/dist/cjs/components/credits/creditsCash/index.js +2 -0
- package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/cjs/components/credits/creditsCash/type.js +2 -0
- package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/cjs/components/credits/index.d.ts +10 -0
- package/dist/cjs/components/credits/index.js +2 -0
- package/dist/cjs/components/credits/index.js.map +7 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
- package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
- package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
- package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
- package/dist/cjs/components/credits/modal/tip.js +2 -0
- package/dist/cjs/components/credits/modal/tip.js.map +7 -0
- package/dist/cjs/components/credits/type.d.ts +55 -0
- package/dist/cjs/components/credits/type.js +2 -0
- package/dist/cjs/components/credits/type.js.map +7 -0
- package/dist/cjs/components/index.d.ts +3 -0
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/components/index.js.map +7 -0
- package/dist/cjs/debug-env.d.ts +7 -0
- package/dist/cjs/debug-env.js +2 -0
- package/dist/cjs/debug-env.js.map +7 -0
- package/dist/cjs/helpers/fetchResponse.d.ts +14 -0
- package/dist/cjs/helpers/fetchResponse.js +2 -0
- package/dist/cjs/helpers/fetchResponse.js.map +7 -0
- package/dist/cjs/helpers/fetcher.d.ts +2 -0
- package/dist/cjs/helpers/fetcher.js +2 -0
- package/dist/cjs/helpers/fetcher.js.map +7 -0
- package/dist/cjs/helpers/index.d.ts +2 -0
- package/dist/cjs/helpers/index.js +2 -0
- package/dist/cjs/helpers/index.js.map +7 -0
- package/dist/cjs/helpers/track.d.ts +19 -0
- package/dist/cjs/helpers/track.js +2 -0
- package/dist/cjs/helpers/track.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +3 -0
- package/dist/cjs/helpers/utils.js +2 -0
- package/dist/cjs/helpers/utils.js.map +7 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/stories/chat.stories.d.ts +7 -0
- package/dist/cjs/stories/chat.stories.js +2 -0
- package/dist/cjs/stories/chat.stories.js.map +7 -0
- package/dist/esm/components/chat/action.d.ts +25 -0
- package/dist/esm/components/chat/action.js +2 -0
- package/dist/esm/components/chat/action.js.map +7 -0
- package/dist/esm/components/chat/button.d.ts +3 -0
- package/dist/esm/components/chat/button.js +2 -0
- package/dist/esm/components/chat/button.js.map +7 -0
- package/dist/esm/components/chat/chatContext.d.ts +101 -0
- package/dist/esm/components/chat/chatContext.js +2 -0
- package/dist/esm/components/chat/chatContext.js.map +7 -0
- package/dist/esm/components/chat/index.d.ts +71 -0
- package/dist/esm/components/chat/index.js +2 -0
- package/dist/esm/components/chat/index.js.map +7 -0
- package/dist/esm/components/chat/markdown.d.ts +5 -0
- package/dist/esm/components/chat/markdown.js +2 -0
- package/dist/esm/components/chat/markdown.js.map +7 -0
- package/dist/esm/components/chat/messages.d.ts +3 -0
- package/dist/esm/components/chat/messages.js +2 -0
- package/dist/esm/components/chat/messages.js.map +7 -0
- package/dist/esm/components/chat/props.d.ts +43 -0
- package/dist/esm/components/chat/props.js +1 -0
- package/dist/esm/components/chat/props.js.map +7 -0
- package/dist/esm/components/chat/response.d.ts +4 -0
- package/dist/esm/components/chat/response.js +2 -0
- package/dist/esm/components/chat/response.js.map +7 -0
- package/dist/esm/components/chat/suggestions.d.ts +3 -0
- package/dist/esm/components/chat/suggestions.js +2 -0
- package/dist/esm/components/chat/suggestions.js.map +7 -0
- package/dist/esm/components/chat/utils.d.ts +3 -0
- package/dist/esm/components/chat/utils.js +2 -0
- package/dist/esm/components/chat/utils.js.map +7 -0
- package/dist/esm/components/credits/context/const.d.ts +81 -0
- package/dist/esm/components/credits/context/const.js +2 -0
- package/dist/esm/components/credits/context/const.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +17 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/esm/components/credits/context/provider.d.ts +49 -0
- package/dist/esm/components/credits/context/provider.js +2 -0
- package/dist/esm/components/credits/context/provider.js.map +7 -0
- package/dist/esm/components/credits/context/response.d.ts +63 -0
- package/dist/esm/components/credits/context/response.js +1 -0
- package/dist/esm/components/credits/context/response.js.map +7 -0
- package/dist/esm/components/credits/context/utils.d.ts +25 -0
- package/dist/esm/components/credits/context/utils.js +2 -0
- package/dist/esm/components/credits/context/utils.js.map +7 -0
- package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/esm/components/credits/creditsBanner/index.js +2 -0
- package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
- package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +15 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/index.d.ts +13 -0
- package/dist/esm/components/credits/creditsCash/index.js +2 -0
- package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/esm/components/credits/creditsCash/type.js +1 -0
- package/dist/esm/components/credits/creditsCash/type.js.map +7 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/esm/components/credits/creditsFaq/index.js +2 -0
- package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +60 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/esm/components/credits/index.d.ts +10 -0
- package/dist/esm/components/credits/index.js +2 -0
- package/dist/esm/components/credits/index.js.map +7 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
- package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/esm/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/esm/components/credits/modal/loadingDots.js +2 -0
- package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/esm/components/credits/modal/modalContainer.js +2 -0
- package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/esm/components/credits/modal/rulesModal.js +2 -0
- package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/tip.d.ts +5 -0
- package/dist/esm/components/credits/modal/tip.js +2 -0
- package/dist/esm/components/credits/modal/tip.js.map +7 -0
- package/dist/esm/components/credits/type.d.ts +55 -0
- package/dist/esm/components/credits/type.js +1 -0
- package/dist/esm/components/credits/type.js.map +7 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +7 -0
- package/dist/esm/debug-env.d.ts +7 -0
- package/dist/esm/debug-env.js +2 -0
- package/dist/esm/debug-env.js.map +7 -0
- package/dist/esm/helpers/fetchResponse.d.ts +14 -0
- package/dist/esm/helpers/fetchResponse.js +2 -0
- package/dist/esm/helpers/fetchResponse.js.map +7 -0
- package/dist/esm/helpers/fetcher.d.ts +2 -0
- package/dist/esm/helpers/fetcher.js +2 -0
- package/dist/esm/helpers/fetcher.js.map +7 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +2 -0
- package/dist/esm/helpers/index.js.map +7 -0
- package/dist/esm/helpers/track.d.ts +19 -0
- package/dist/esm/helpers/track.js +2 -0
- package/dist/esm/helpers/track.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +3 -0
- package/dist/esm/helpers/utils.js +2 -0
- package/dist/esm/helpers/utils.js.map +7 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/stories/chat.stories.d.ts +7 -0
- package/dist/esm/stories/chat.stories.js +2 -0
- package/dist/esm/stories/chat.stories.js.map +7 -0
- package/package.json +10 -9
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useRedeemableList.ts"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\n\nimport { useAlpcMutation } from './useAlpcFetch'\nimport { ALPC_COUNTRY_MAP } from '../const'\nimport { useCreditsContext } from '../provider'\nimport type { ConsumeCreditRuleResponse } from '../response'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useRedeemableList() {\n let locale = '' as string\n const { profile, isLoadingProfile } = useCreditsContext()\n const { locale: contextLocale, brand } = useHeadlessContext()\n\n if (contextLocale === 'pl') {\n locale = 'eu'\n } else {\n locale = contextLocale\n }\n\n const [redeemableList, setRedeemableList] = useState<ConsumeCreditRuleResponse[]>([])\n const { isMutating: listLoading, trigger } = useAlpcMutation<\n {\n data: { consume_credit_rules: ConsumeCreditRuleResponse[] }\n },\n { user_id?: string }\n >({\n url: `/v1/credit/consume_credit_rules`,\n initData: {\n brand,\n page: 1,\n page_size: 20,\n country: (ALPC_COUNTRY_MAP.get(locale) || locale)?.toUpperCase(),\n task_target: 1, // 1: 'app', 2: 'website'\n },\n })\n\n const getRedeemableList = useCallback(() => {\n const cacheName = `consume_credit_rules-${locale}`\n\n const cacheStr = localStorage?.getItem(cacheName)\n if (cacheStr) {\n try {\n const cache = JSON.parse(cacheStr)\n if (cache.expire > Date.now() && cache.consume_credit_rules.length) {\n // \u7F13\u5B58\u672A\u8FC7\u671F\n setRedeemableList(cache.consume_credit_rules)\n return\n }\n } catch (e) {}\n localStorage?.removeItem(cacheName)\n }\n trigger(\n {\n user_id: profile?.user_id,\n },\n {\n onSuccess(responseData) {\n let list = responseData.data.consume_credit_rules || []\n let cList = list.filter(i => i.consume_type == 1) || []\n let pList = list.filter(i => i.consume_type == 2) || []\n cList = cList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n pList = pList.sort((prev, next) => prev.consume_credits - next.consume_credits)\n const resultList = cList.concat(pList)\n setRedeemableList(resultList)\n\n localStorage?.setItem(\n `consume_credit_rules-${locale}`,\n JSON.stringify({\n expire: Date.now() + 10 * 60 * 1000,\n consume_credit_rules: resultList,\n })\n )\n },\n }\n )\n }, [profile, trigger, locale])\n\n useEffect(() => {\n if (!isLoadingProfile) {\n getRedeemableList()\n }\n }, [getRedeemableList, isLoadingProfile])\n\n return {\n listLoading,\n redeemableList,\n getRedeemableList,\n }\n}\n\nexport default useRedeemableList\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAiD,iBAEjDC,EAAgC,0BAChCC,EAAiC,oBACjCC,EAAkC,uBAElCC,EAAmC,yBAEnC,SAASC,GAAoB,CAC3B,IAAIC,EAAS,GACb,KAAM,CAAE,QAAAC,EAAS,iBAAAC,CAAiB,KAAI,qBAAkB,EAClD,CAAE,OAAQC,EAAe,MAAAC,CAAM,KAAI,sBAAmB,EAExDD,IAAkB,KACpBH,EAAS,KAETA,EAASG,EAGX,KAAM,CAACE,EAAgBC,CAAiB,KAAI,YAAsC,CAAC,CAAC,EAC9E,CAAE,WAAYC,EAAa,QAAAC,CAAQ,KAAI,mBAK3C,CACA,IAAK,kCACL,SAAU,CACR,MAAAJ,EACA,KAAM,EACN,UAAW,GACX,SAAU,mBAAiB,IAAIJ,CAAM,GAAKA,IAAS,YAAY,EAC/D,YAAa,CACf,CACF,CAAC,EAEKS,KAAoB,eAAY,IAAM,CAC1C,MAAMC,EAAY,wBAAwBV,CAAM,GAE1CW,EAAW,cAAc,QAAQD,CAAS,EAChD,GAAIC,EAAU,CACZ,GAAI,CACF,MAAMC,EAAQ,KAAK,MAAMD,CAAQ,EACjC,GAAIC,EAAM,OAAS,KAAK,IAAI,GAAKA,EAAM,qBAAqB,OAAQ,CAElEN,EAAkBM,EAAM,oBAAoB,EAC5C,MACF,CACF,MAAY,CAAC,CACb,cAAc,WAAWF,CAAS,CACpC,CACAF,EACE,CACE,QAASP,GAAS,OACpB,EACA,CACE,UAAUY,EAAc,CACtB,IAAIC,EAAOD,EAAa,KAAK,sBAAwB,CAAC,EAClDE,EAAQD,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EAClDC,EAAQH,EAAK,OAAOE,GAAKA,EAAE,cAAgB,CAAC,GAAK,CAAC,EACtDD,EAAQA,EAAM,KAAK,CAACG,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9EF,EAAQA,EAAM,KAAK,CAACC,EAAMC,IAASD,EAAK,gBAAkBC,EAAK,eAAe,EAC9E,MAAMC,EAAaL,EAAM,OAAOE,CAAK,EACrCX,EAAkBc,CAAU,EAE5B,cAAc,QACZ,wBAAwBpB,CAAM,GAC9B,KAAK,UAAU,CACb,OAAQ,KAAK,IAAI,EAAI,GAAK,GAAK,IAC/B,qBAAsBoB,CACxB,CAAC,CACH,CACF,CACF,CACF,CACF,EAAG,CAACnB,EAASO,EAASR,CAAM,CAAC,EAE7B,sBAAU,IAAM,CACTE,GACHO,EAAkB,CAEtB,EAAG,CAACA,EAAmBP,CAAgB,CAAC,EAEjC,CACL,YAAAK,EACA,eAAAF,EACA,kBAAAI,CACF,CACF,CAEA,IAAOjB,EAAQO",
|
|
6
|
+
"names": ["useRedeemableList_exports", "__export", "useRedeemableList_default", "__toCommonJS", "import_react", "import_useAlpcFetch", "import_const", "import_provider", "import_lib", "useRedeemableList", "locale", "profile", "isLoadingProfile", "contextLocale", "brand", "redeemableList", "setRedeemableList", "listLoading", "trigger", "getRedeemableList", "cacheName", "cacheStr", "cache", "responseData", "list", "cList", "i", "pList", "prev", "next", "resultList"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSendEmailValidation(): import("swr/mutation").SWRMutationResponse<any, any, "send-email-validation", never>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var c=Object.create;var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},r=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f(t))!v.call(e,a)&&a!==o&&i(e,a,{get:()=>t[a],enumerable:!(n=d(t,a))||n.enumerable});return e};var m=(e,t,o)=>(o=e!=null?c(h(e)):{},r(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),C=e=>r(i({},"__esModule",{value:!0}),e);var y={};x(y,{useSendEmailValidation:()=>S});module.exports=C(y);var s=m(require("../../../../helpers/fetcher")),l=m(require("swr/mutation")),p=require("../provider"),u=require("@anker-in/lib");function S(){const{profile:e}=(0,p.useCreditsContext)(),{appName:t,locale:o}=(0,u.useHeadlessContext)();return(0,l.default)("send-email-validation",()=>(0,s.default)({locale:o,url:"/api/multipass/account/users/send_validation_email",method:"POST",body:{email:e?.email,app:t},needRecaptcha:!0,action:"verifyAccount"}))}
|
|
2
|
+
//# sourceMappingURL=useSendEmailValidation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSendEmailValidation.ts"],
|
|
4
|
+
"sourcesContent": ["import fetcher from '../../../../helpers/fetcher'\nimport useSWRMutation from 'swr/mutation'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport function useSendEmailValidation() {\n const { profile } = useCreditsContext()\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', () =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n method: 'POST',\n body: { email: profile?.email, app: appName },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoB,0CACpBC,EAA2B,2BAC3BC,EAAkC,uBAClCC,EAAmC,yBAE5B,SAASL,GAAyB,CACvC,KAAM,CAAE,QAAAM,CAAQ,KAAI,qBAAkB,EAChC,CAAE,QAAAC,EAAS,OAAAC,CAAO,KAAI,sBAAmB,EAE/C,SAAO,EAAAC,SAAe,wBAAyB,OAC7C,EAAAC,SAAQ,CACN,OAAAF,EACA,IAAK,qDACL,OAAQ,OACR,KAAM,CAAE,MAAOF,GAAS,MAAO,IAAKC,CAAQ,EAC5C,cAAe,GACf,OAAQ,eACV,CAAC,CACH,CACF",
|
|
6
|
+
"names": ["useSendEmailValidation_exports", "__export", "useSendEmailValidation", "__toCommonJS", "import_fetcher", "import_mutation", "import_provider", "import_lib", "profile", "appName", "locale", "useSWRMutation", "fetcher"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSubscribed: () => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var S=Object.create;var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var g=(e,s)=>{for(var r in s)u(e,r,{get:s[r],enumerable:!0})},c=(e,s,r,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let t of v(s))!C.call(e,t)&&t!==r&&u(e,t,{get:()=>s[t],enumerable:!(i=l(s,t))||i.enumerable});return e};var b=(e,s,r)=>(r=e!=null?S(x(e)):{},c(s||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),k=e=>c(u({},"__esModule",{value:!0}),e);var R={};g(R,{useSubscribed:()=>y});module.exports=k(R);var n=require("react"),p=require("../const"),m=b(require("./useActivities")),a=b(require("./useSubscriptions")),f=require("../provider"),d=require("@anker-in/lib");const y=()=>{const{profile:e}=(0,f.useCreditsContext)(),{brand:s}=(0,d.useHeadlessContext)(),r=(0,n.useMemo)(()=>({page:1,pageSize:50}),[]),{activities:i}=(0,m.default)(r),{subscriptionData:t}=(0,a.default)(e?.email);return(0,n.useMemo)(()=>t?.preference?t.preference.some(o=>o.brand===s&&o.subscribe)?!0:i?.some(o=>o.task_sub_type===p.TaskSubType.Subscription):!1,[t,i])};
|
|
2
|
+
//# sourceMappingURL=useSubscribed.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSubscribed.ts"],
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react'\n\nimport { TaskSubType } from '../const'\nimport useActivities from './useActivities'\nimport useSubscriptions from './useSubscriptions'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport const useSubscribed = () => {\n const { profile } = useCreditsContext()\n const { brand } = useHeadlessContext()\n\n const activitiesOptions = useMemo(() => ({ page: 1, pageSize: 50 }), [])\n\n const { activities } = useActivities(activitiesOptions)\n const { subscriptionData } = useSubscriptions(profile?.email)\n\n const isSubscribed = useMemo(() => {\n if (!subscriptionData?.preference) {\n return false\n }\n\n const subscribeResult = subscriptionData.preference.some(item => {\n return item.brand === brand && item.subscribe\n })\n\n if (subscribeResult) {\n return true\n }\n\n return activities?.some(item => {\n return item.task_sub_type === TaskSubType.Subscription\n })\n }, [subscriptionData, activities])\n\n return isSubscribed\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwB,iBAExBC,EAA4B,oBAC5BC,EAA0B,8BAC1BC,EAA6B,iCAC7BC,EAAkC,uBAClCC,EAAmC,yBAE5B,MAAMP,EAAgB,IAAM,CACjC,KAAM,CAAE,QAAAQ,CAAQ,KAAI,qBAAkB,EAChC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAE/BC,KAAoB,WAAQ,KAAO,CAAE,KAAM,EAAG,SAAU,EAAG,GAAI,CAAC,CAAC,EAEjE,CAAE,WAAAC,CAAW,KAAI,EAAAC,SAAcF,CAAiB,EAChD,CAAE,iBAAAG,CAAiB,KAAI,EAAAC,SAAiBN,GAAS,KAAK,EAoB5D,SAlBqB,WAAQ,IACtBK,GAAkB,WAICA,EAAiB,WAAW,KAAKE,GAChDA,EAAK,QAAUN,GAASM,EAAK,SACrC,EAGQ,GAGFJ,GAAY,KAAKI,GACfA,EAAK,gBAAkB,cAAY,YAC3C,EAbQ,GAcR,CAACF,EAAkBF,CAAU,CAAC,CAGnC",
|
|
6
|
+
"names": ["useSubscribed_exports", "__export", "useSubscribed", "__toCommonJS", "import_react", "import_const", "import_useActivities", "import_useSubscriptions", "import_provider", "import_lib", "profile", "brand", "activitiesOptions", "activities", "useActivities", "subscriptionData", "useSubscriptions", "item"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var l=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var S=(t,r)=>{for(var e in r)i(t,e,{get:r[e],enumerable:!0})},a=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of m(r))!d.call(t,o)&&o!==e&&i(t,o,{get:()=>r[o],enumerable:!(n=b(r,o))||n.enumerable});return t};var h=(t,r,e)=>(e=t!=null?l(y(t)):{},a(r||!t||!t.__esModule?i(e,"default",{value:t,enumerable:!0}):e,t)),g=t=>a(i({},"__esModule",{value:!0}),t);var D={};S(D,{default:()=>C});module.exports=g(D);var s=require("react"),p=h(require("../../../../helpers/fetcher")),f=require("@anker-in/lib");function x(t){const r=(0,s.useRef)(!1),[e,n]=(0,s.useState)(),{locale:o}=(0,f.useHeadlessContext)(),u=(0,s.useCallback)(async()=>{if(t&&!r.current){r.current=!0;try{const c=await(0,p.default)({method:"GET",url:"/api/multipass/account/subscriptions",body:{email:t},action:"login",locale:o,headers:{},type:""});c&&n(c)}catch(c){console.error(c)}finally{r.current=!1}}},[t,o,r]);return(0,s.useEffect)(()=>{u()},[u]),{subscriptionData:e}}var C=x;
|
|
2
|
+
//# sourceMappingURL=useSubscriptions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useSubscriptions.ts"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useRef, useState } from 'react'\nimport type { Subscription } from '../../type'\nimport fetcher from '../../../../helpers/fetcher'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nfunction useSubscriptions(email?: string) {\n const loading = useRef(false)\n const [subscriptionData, setSubscriptionData] = useState<Subscription>()\n const { locale } = useHeadlessContext()\n\n const fetchSubscription = useCallback(async () => {\n if (!email) {\n return\n }\n\n if (loading.current) {\n return\n }\n\n loading.current = true\n\n try {\n const response = await fetcher({\n method: 'GET',\n url: '/api/multipass/account/subscriptions',\n body: {\n email,\n },\n action: 'login',\n locale,\n headers: {},\n type: '',\n })\n\n if (response) {\n setSubscriptionData(response)\n }\n } catch (error) {\n console.error(error)\n } finally {\n loading.current = false\n }\n }, [email, locale, loading])\n\n useEffect(() => {\n fetchSubscription()\n }, [fetchSubscription])\n\n return {\n subscriptionData,\n }\n}\n\nexport default useSubscriptions\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyD,iBAEzDC,EAAoB,0CACpBC,EAAmC,yBAEnC,SAASC,EAAiBC,EAAgB,CACxC,MAAMC,KAAU,UAAO,EAAK,EACtB,CAACC,EAAkBC,CAAmB,KAAI,YAAuB,EACjE,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAEhCC,KAAoB,eAAY,SAAY,CAChD,GAAKL,GAID,CAAAC,EAAQ,QAIZ,CAAAA,EAAQ,QAAU,GAElB,GAAI,CACF,MAAMK,EAAW,QAAM,EAAAC,SAAQ,CAC7B,OAAQ,MACR,IAAK,uCACL,KAAM,CACJ,MAAAP,CACF,EACA,OAAQ,QACR,OAAAI,EACA,QAAS,CAAC,EACV,KAAM,EACR,CAAC,EAEGE,GACFH,EAAoBG,CAAQ,CAEhC,OAASE,EAAO,CACd,QAAQ,MAAMA,CAAK,CACrB,QAAE,CACAP,EAAQ,QAAU,EACpB,EACF,EAAG,CAACD,EAAOI,EAAQH,CAAO,CAAC,EAE3B,sBAAU,IAAM,CACdI,EAAkB,CACpB,EAAG,CAACA,CAAiB,CAAC,EAEf,CACL,iBAAAH,CACF,CACF,CAEA,IAAOR,EAAQK",
|
|
6
|
+
"names": ["useSubscriptions_exports", "__export", "useSubscriptions_default", "__toCommonJS", "import_react", "import_fetcher", "import_lib", "useSubscriptions", "email", "loading", "subscriptionData", "setSubscriptionData", "locale", "fetchSubscription", "response", "fetcher", "error"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const uploadReceipt: (_: any, { arg: { orderName } }: {
|
|
2
|
+
arg: {
|
|
3
|
+
orderName: string;
|
|
4
|
+
};
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
ok: boolean;
|
|
7
|
+
code: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useUploadReceipt: () => import("swr/mutation").SWRMutationResponse<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
code: number;
|
|
12
|
+
}, any, "/api/multipass/mktsrv/v1/credit/upload_third_party_order", {
|
|
13
|
+
orderName: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.create;var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var _=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},n=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of l(o))!m.call(e,a)&&a!==t&&d(e,a,{get:()=>o[a],enumerable:!(r=c(o,a))||r.enumerable});return e};var y=(e,o,t)=>(t=e!=null?p(u(e)):{},n(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),g=e=>n(d({},"__esModule",{value:!0}),e);var k={};_(k,{uploadReceipt:()=>i,useUploadReceipt:()=>h});module.exports=g(k);var s=y(require("swr/mutation"));const i=async(e,{arg:{orderName:o}})=>{const t=await fetch("/api/multipass/mktsrv/v1/credit/upload_third_party_order",{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({order_name:o})}),{data:r}=await t.json();return console.log("data",r),{ok:r?.code===0,code:r?.code}},h=()=>(0,s.default)("/api/multipass/mktsrv/v1/credit/upload_third_party_order",i);
|
|
2
|
+
//# sourceMappingURL=useUploadReceipt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/context/hooks/useUploadReceipt.tsx"],
|
|
4
|
+
"sourcesContent": ["import useSWRMutation from 'swr/mutation'\n\nexport const uploadReceipt = async (\n _: any,\n { arg: { orderName } }: { arg: { orderName: string } }\n): Promise<{\n ok: boolean\n code: number\n}> => {\n const response = await fetch(`/api/multipass/mktsrv/v1/credit/upload_third_party_order`, {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n order_name: orderName,\n }),\n })\n const { data } = await response.json()\n console.log('data', data)\n return {\n ok: data?.code === 0,\n code: data?.code,\n }\n}\n\nexport const useUploadReceipt = () => {\n return useSWRMutation('/api/multipass/mktsrv/v1/credit/upload_third_party_order', uploadReceipt)\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,qBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAA2B,2BAEpB,MAAMH,EAAgB,MAC3BI,EACA,CAAE,IAAK,CAAE,UAAAC,CAAU,CAAE,IAIjB,CACJ,MAAMC,EAAW,MAAM,MAAM,2DAA4D,CACvF,YAAa,UACb,OAAQ,OACR,QAAS,CACP,eAAgB,kBAClB,EACA,KAAM,KAAK,UAAU,CACnB,WAAYD,CACd,CAAC,CACH,CAAC,EACK,CAAE,KAAAE,CAAK,EAAI,MAAMD,EAAS,KAAK,EACrC,eAAQ,IAAI,OAAQC,CAAI,EACjB,CACL,GAAIA,GAAM,OAAS,EACnB,KAAMA,GAAM,IACd,CACF,EAEaN,EAAmB,OACvB,EAAAO,SAAe,2DAA4DR,CAAa",
|
|
6
|
+
"names": ["useUploadReceipt_exports", "__export", "uploadReceipt", "useUploadReceipt", "__toCommonJS", "import_mutation", "_", "orderName", "response", "data", "useSWRMutation"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DTC_TASK_TYPE } from './const';
|
|
3
|
+
import type { CreditInfoResponse } from './response';
|
|
4
|
+
export declare const CreditsContext: React.Context<{
|
|
5
|
+
profile: any;
|
|
6
|
+
isLoadingProfile: boolean;
|
|
7
|
+
removeProfile: () => void;
|
|
8
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
9
|
+
openSignInPopup: () => void;
|
|
10
|
+
openSignUpPopup: () => void;
|
|
11
|
+
creditInfo?: CreditInfoResponse;
|
|
12
|
+
customer?: any;
|
|
13
|
+
customerLoading: boolean;
|
|
14
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
15
|
+
gtm: {
|
|
16
|
+
pageGroup: string;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, }: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
profile: any;
|
|
22
|
+
removeProfile: () => void;
|
|
23
|
+
isLoadingProfile: boolean;
|
|
24
|
+
openSignInPopup: () => void;
|
|
25
|
+
openSignUpPopup: () => void;
|
|
26
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
27
|
+
creditInfo?: CreditInfoResponse;
|
|
28
|
+
customer: any;
|
|
29
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
30
|
+
customerLoading: boolean;
|
|
31
|
+
gtm: {
|
|
32
|
+
pageGroup: string;
|
|
33
|
+
};
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function useCreditsContext(): {
|
|
36
|
+
profile: any;
|
|
37
|
+
isLoadingProfile: boolean;
|
|
38
|
+
removeProfile: () => void;
|
|
39
|
+
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
40
|
+
openSignInPopup: () => void;
|
|
41
|
+
openSignUpPopup: () => void;
|
|
42
|
+
creditInfo?: CreditInfoResponse;
|
|
43
|
+
customer?: any;
|
|
44
|
+
customerLoading: boolean;
|
|
45
|
+
fetchCreditInfo: (user_id: string) => void;
|
|
46
|
+
gtm: {
|
|
47
|
+
pageGroup: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var I=(e,o)=>{for(var i in o)p(e,i,{get:o[i],enumerable:!0})},T=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of m(o))!v.call(e,n)&&n!==i&&p(e,n,{get:()=>o[n],enumerable:!(r=P(o,n))||r.enumerable});return e};var y=e=>T(p({},"__esModule",{value:!0}),e);var R={};I(R,{CreditsContext:()=>d,CreditsProvider:()=>S,useCreditsContext:()=>_});module.exports=y(R);var s=require("react/jsx-runtime"),t=require("react");const d=(0,t.createContext)({profile:null,isLoadingProfile:!1,taskIdToTypeMapping:{},removeProfile:()=>{},openSignInPopup:()=>{},openSignUpPopup:()=>{},creditInfo:void 0,customerLoading:!1,fetchCreditInfo:e=>{},gtm:{pageGroup:""}});function S({children:e,profile:o,removeProfile:i,isLoadingProfile:r,openSignInPopup:n,openSignUpPopup:a,taskIdToTypeMapping:f,creditInfo:g,customer:u,customerLoading:c,fetchCreditInfo:l,gtm:C}){return(0,s.jsx)(d.Provider,{value:{profile:o,isLoadingProfile:r,removeProfile:i,openSignInPopup:n,openSignUpPopup:a,taskIdToTypeMapping:f,creditInfo:g,fetchCreditInfo:l,customer:u,customerLoading:c,gtm:C},children:e})}function _(){return(0,t.useContext)(d)}
|
|
2
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/context/provider.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { createContext, useContext } from 'react'\nimport type { DTC_TASK_TYPE } from './const'\nimport type { CreditInfoResponse } from './response'\n\nexport const CreditsContext = createContext<{\n profile: any\n isLoadingProfile: boolean\n removeProfile: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n openSignInPopup: () => void\n openSignUpPopup: () => void\n creditInfo?: CreditInfoResponse\n customer?: any\n customerLoading: boolean\n fetchCreditInfo: (user_id: string) => void\n gtm: {\n pageGroup: string\n }\n}>({\n profile: null,\n isLoadingProfile: false,\n taskIdToTypeMapping: {},\n removeProfile: () => {},\n openSignInPopup: () => {},\n openSignUpPopup: () => {},\n creditInfo: undefined,\n customerLoading: false,\n fetchCreditInfo: (user_id: string) => {},\n gtm: {\n pageGroup: '',\n },\n})\n\nexport function CreditsProvider({\n children,\n profile,\n removeProfile,\n isLoadingProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n customer,\n customerLoading,\n fetchCreditInfo,\n gtm,\n}: {\n children: React.ReactNode\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n openSignInPopup: () => void\n openSignUpPopup: () => void\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n creditInfo?: CreditInfoResponse\n customer: any\n fetchCreditInfo: (user_id: string) => void\n customerLoading: boolean\n gtm: {\n pageGroup: string\n }\n}) {\n return (\n <CreditsContext.Provider\n value={{\n profile,\n isLoadingProfile,\n removeProfile,\n openSignInPopup,\n openSignUpPopup,\n taskIdToTypeMapping,\n creditInfo,\n fetchCreditInfo,\n customer,\n customerLoading,\n gtm,\n }}\n >\n {children}\n </CreditsContext.Provider>\n )\n}\n\nexport function useCreditsContext() {\n return useContext(CreditsContext)\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,oBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAL,GA+DI,IAAAM,EAAA,6BA/DJC,EAAiD,iBAI1C,MAAML,KAAiB,iBAc3B,CACD,QAAS,KACT,iBAAkB,GAClB,oBAAqB,CAAC,EACtB,cAAe,IAAM,CAAC,EACtB,gBAAiB,IAAM,CAAC,EACxB,gBAAiB,IAAM,CAAC,EACxB,WAAY,OACZ,gBAAiB,GACjB,gBAAkBM,GAAoB,CAAC,EACvC,IAAK,CACH,UAAW,EACb,CACF,CAAC,EAEM,SAASL,EAAgB,CAC9B,SAAAM,EACA,QAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,IAAAC,CACF,EAeG,CACD,SACE,OAAClB,EAAe,SAAf,CACC,MAAO,CACL,QAAAQ,EACA,iBAAAE,EACA,cAAAD,EACA,gBAAAE,EACA,gBAAAC,EACA,oBAAAC,EACA,WAAAC,EACA,gBAAAG,EACA,SAAAF,EACA,gBAAAC,EACA,IAAAE,CACF,EAEC,SAAAX,EACH,CAEJ,CAEO,SAASL,GAAoB,CAClC,SAAO,cAAWF,CAAc,CAClC",
|
|
6
|
+
"names": ["provider_exports", "__export", "CreditsContext", "CreditsProvider", "useCreditsContext", "__toCommonJS", "import_jsx_runtime", "import_react", "user_id", "children", "profile", "removeProfile", "isLoadingProfile", "openSignInPopup", "openSignUpPopup", "taskIdToTypeMapping", "creditInfo", "customer", "customerLoading", "fetchCreditInfo", "gtm"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ApprovalStatus, AlpcConsumeType, CreditType, TaskSubType, TaskType } from './const';
|
|
2
|
+
interface BaseResponse {
|
|
3
|
+
brand: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Task extends BaseResponse {
|
|
6
|
+
goods_sku?: string;
|
|
7
|
+
task_type: TaskType;
|
|
8
|
+
task_sub_type: TaskSubType;
|
|
9
|
+
task_rule_id: number;
|
|
10
|
+
task_name: string;
|
|
11
|
+
task_note: string;
|
|
12
|
+
app_name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CreditLogResponse extends Task {
|
|
15
|
+
credit: number;
|
|
16
|
+
task_name: string;
|
|
17
|
+
create_time: number;
|
|
18
|
+
credit_type: CreditType;
|
|
19
|
+
pending_time: number;
|
|
20
|
+
status: number;
|
|
21
|
+
expired_time?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ConsumeCreditRuleResponse extends BaseResponse {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
note: string;
|
|
27
|
+
consume_credits: number;
|
|
28
|
+
consume_type: AlpcConsumeType;
|
|
29
|
+
coupon_rule: string;
|
|
30
|
+
remaining_inventory: number;
|
|
31
|
+
is_limited: number;
|
|
32
|
+
sku_handle: string;
|
|
33
|
+
goods_sku: string;
|
|
34
|
+
goods_url: string;
|
|
35
|
+
extra?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RedeemLogResponse extends BaseResponse {
|
|
38
|
+
goods_title: string;
|
|
39
|
+
coupon_code: string;
|
|
40
|
+
order_number: string;
|
|
41
|
+
create_time: number;
|
|
42
|
+
consume_credits: number;
|
|
43
|
+
fulfillment_status: string;
|
|
44
|
+
approval_status: ApprovalStatus;
|
|
45
|
+
rule_id: number;
|
|
46
|
+
code_status: number;
|
|
47
|
+
}
|
|
48
|
+
export interface CreditTaskResponse extends Task {
|
|
49
|
+
status: number;
|
|
50
|
+
is_enable: number;
|
|
51
|
+
id: number;
|
|
52
|
+
weight: number;
|
|
53
|
+
reward_type: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CreditInfoResponse extends BaseResponse {
|
|
56
|
+
total_credit: number;
|
|
57
|
+
available_credit: number;
|
|
58
|
+
pending_credit: number;
|
|
59
|
+
expired_credit: number;
|
|
60
|
+
cancel_credit: number;
|
|
61
|
+
consumed_credit: number;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var m=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!o.call(n,t)&&t!==i&&s(n,t,{get:()=>e[t],enumerable:!(r=a(e,t))||r.enumerable});return n};var p=n=>m(s({},"__esModule",{value:!0}),n);var d={};module.exports=p(d);
|
|
2
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/context/response.ts"],
|
|
4
|
+
"sourcesContent": ["import { ApprovalStatus, AlpcConsumeType, CreditType, TaskSubType, TaskType } from './const'\n\n// ALPC\u670D\u52A1\u54CD\u5E94\u6570\u636E\u7C7B\u578B\n\ninterface BaseResponse {\n brand: string\n}\n\nexport interface Task extends BaseResponse {\n goods_sku?: string\n task_type: TaskType\n task_sub_type: TaskSubType\n task_rule_id: number\n task_name: string\n task_note: string\n app_name: string\n}\n\n// \u79EF\u5206\u6D41\u6C34\nexport interface CreditLogResponse extends Task {\n credit: number\n task_name: string\n create_time: number\n credit_type: CreditType\n pending_time: number\n status: number\n expired_time?: number\n}\n\nexport interface ConsumeCreditRuleResponse extends BaseResponse {\n id: number\n name: string\n note: string\n consume_credits: number\n consume_type: AlpcConsumeType\n coupon_rule: string\n remaining_inventory: number\n is_limited: number\n sku_handle: string\n goods_sku: string\n goods_url: string\n extra?: string // discount, type\n}\n\nexport interface RedeemLogResponse extends BaseResponse {\n goods_title: string\n coupon_code: string\n order_number: string\n create_time: number\n consume_credits: number\n fulfillment_status: string\n approval_status: ApprovalStatus\n rule_id: number\n code_status: number\n}\n\nexport interface CreditTaskResponse extends Task {\n status: number\n is_enable: number\n id: number\n weight: number\n reward_type: number\n}\n\nexport interface CreditInfoResponse extends BaseResponse {\n total_credit: number\n available_credit: number\n pending_credit: number\n expired_credit: number\n cancel_credit: number\n consumed_credit: number\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["response_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function getAlpcPath(locale?: string): "/api/multipass/alpc-eu" | "/api/multipass/alpc";
|
|
2
|
+
export declare function numberFormat(num?: number): string | number;
|
|
3
|
+
export declare const emailValidate: (email: any) => boolean;
|
|
4
|
+
export declare const languageTerritory: (locale: string) => string;
|
|
5
|
+
export declare function formatPrice({ amount, currencyCode, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZeros, }: {
|
|
6
|
+
amount: number;
|
|
7
|
+
currencyCode: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
maximumFractionDigits?: number;
|
|
10
|
+
minimumFractionDigits?: number;
|
|
11
|
+
removeTrailingZeros?: boolean;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function formatVariantPrice({ amount, baseAmount, currencyCode, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZeros, }: {
|
|
14
|
+
baseAmount: number;
|
|
15
|
+
amount: number;
|
|
16
|
+
currencyCode: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
maximumFractionDigits?: number;
|
|
19
|
+
minimumFractionDigits?: number;
|
|
20
|
+
removeTrailingZeros?: boolean;
|
|
21
|
+
}): {
|
|
22
|
+
price: string;
|
|
23
|
+
basePrice: string | undefined;
|
|
24
|
+
discount: string | null;
|
|
25
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var k=Object.create;var o=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var $=(e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})},p=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of E(n))!P.call(e,i)&&i!==r&&o(e,i,{get:()=>n[i],enumerable:!(t=C(n,i))||t.enumerable});return e};var F=(e,n,r)=>(r=e!=null?k(I(e)):{},p(n||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),x=e=>p(o({},"__esModule",{value:!0}),e);var z={};$(z,{emailValidate:()=>U,formatPrice:()=>m,formatVariantPrice:()=>v,getAlpcPath:()=>D,languageTerritory:()=>f,numberFormat:()=>S});module.exports=x(z);var l=F(require("js-cookie")),s=require("./const");function D(e=""){let n=!1;const r=l.default.get("alpcEU");return r===void 0||r===""?["de","eu-de","eu","eu-en","uk","fr","fra"].includes(e)&&(n=!0):Number(r)&&(n=!0),n?"/api/multipass/alpc-eu":"/api/multipass/alpc"}function S(e=0){return typeof Intl>"u"?e:new Intl.NumberFormat().format(e)}const U=e=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),f=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",nz:"en-nz",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[e]||"";function m({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:a=!1}){let u=new Intl.NumberFormat(f(r)||r,{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(u=u?.toString()?.replace(/[\s]/g,"")),a&&(u=u.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),u}function v({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:c}){if(typeof Intl>"u")return{price:`${s.PRICE_SYMBOL[t]}${e}`,basePrice:`${s.PRICE_SYMBOL[t]}${n}`,discount:`${s.PRICE_SYMBOL[t]}${n-e||0}`};const u=n>e,d=new Intl.NumberFormat(f(t),{style:"percent"}),g=u?d.format((n-e)/n):null,b=m({amount:e,currencyCode:r,locale:t,removeTrailingZeros:c}),y=u?m({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:c}):void 0;return{price:b,basePrice:y,discount:g}}
|
|
2
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/context/utils.ts"],
|
|
4
|
+
"sourcesContent": ["import Cookies from 'js-cookie'\nimport { PRICE_SYMBOL } from './const'\n\nexport function getAlpcPath(locale = '') {\n let isEU = false\n const alpcEUCookie = Cookies.get('alpcEU')\n if (alpcEUCookie === undefined || alpcEUCookie === '') {\n if (['de', 'eu-de', 'eu', 'eu-en', 'uk', 'fr', 'fra'].includes(locale)) {\n isEU = true\n }\n } else {\n let alpcEU = Number(alpcEUCookie)\n if (alpcEU) {\n isEU = true\n }\n }\n\n if (isEU) {\n return '/api/multipass/alpc-eu'\n }\n\n return '/api/multipass/alpc'\n}\n\nexport function numberFormat(num: number = 0) {\n if (typeof Intl === 'undefined') {\n return num\n }\n\n return new Intl.NumberFormat().format(num)\n}\n\nexport const emailValidate = (email: any) => {\n return /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(\n email\n )\n}\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n nz: 'en-nz',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale) || locale, {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,gBAAAC,EAAA,sBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAoB,wBACpBC,EAA6B,mBAEtB,SAASL,EAAYM,EAAS,GAAI,CACvC,IAAIC,EAAO,GACX,MAAMC,EAAe,EAAAC,QAAQ,IAAI,QAAQ,EAYzC,OAXID,IAAiB,QAAaA,IAAiB,GAC7C,CAAC,KAAM,QAAS,KAAM,QAAS,KAAM,KAAM,KAAK,EAAE,SAASF,CAAM,IACnEC,EAAO,IAGI,OAAOC,CAAY,IAE9BD,EAAO,IAIPA,EACK,yBAGF,qBACT,CAEO,SAASL,EAAaQ,EAAc,EAAG,CAC5C,OAAI,OAAO,KAAS,IACXA,EAGF,IAAI,KAAK,aAAa,EAAE,OAAOA,CAAG,CAC3C,CAEO,MAAMb,EAAiBc,GACrB,yJAAyJ,KAC9JA,CACF,EAGWV,EAAqBK,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASR,EAAY,CAC1B,OAAAc,EACA,aAAAC,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAahB,EAAkBK,CAAM,GAAKA,EAAQ,CAChF,MAAO,WACP,SAAUO,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAASN,CAAM,IAChDW,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAASlB,EAAmB,CACjC,OAAAa,EACA,WAAAM,EACA,aAAAL,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAG,eAAaV,CAAmC,CAAC,GAAGM,CAAM,GACpE,UAAW,GAAG,eAAaN,CAAmC,CAAC,GAAGY,CAAU,GAC5E,SAAU,GAAG,eAAaZ,CAAmC,CAAC,GAAGY,EAAaN,GAAU,CAAC,EAC3F,EAGF,MAAMO,EAAcD,EAAaN,EAC3BQ,EAAiB,IAAI,KAAK,aAAanB,EAAkBK,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKe,EAAWF,EAAcC,EAAe,QAAQF,EAAaN,GAAUM,CAAU,EAAI,KAErFI,EAAQxB,EAAY,CAAE,OAAAc,EAAQ,aAAAC,EAAc,OAAAP,EAAQ,oBAAAU,CAAoB,CAAC,EACzEO,EAAYJ,EACdrB,EAAY,CACV,OAAQoB,EACR,aAAAL,EACA,OAAAP,EACA,sBAAAQ,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAM,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
|
|
6
|
+
"names": ["utils_exports", "__export", "emailValidate", "formatPrice", "formatVariantPrice", "getAlpcPath", "languageTerritory", "numberFormat", "__toCommonJS", "import_js_cookie", "import_const", "locale", "isEU", "alpcEUCookie", "Cookies", "num", "email", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Img = {
|
|
2
|
+
url: string;
|
|
3
|
+
alt: string;
|
|
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
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function CreditsBanner({ copy }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var u=Object.create;var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var v=(t,i)=>{for(var a in i)r(t,a,{get:i[a],enumerable:!0})},m=(t,i,a,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of x(i))!h.call(t,n)&&n!==a&&r(t,n,{get:()=>i[n],enumerable:!(s=f(i,n))||s.enumerable});return t};var N=(t,i,a)=>(a=t!=null?u(I(t)):{},m(i||!t||!t.__esModule?r(a,"default",{value:t,enumerable:!0}):a,t)),C=t=>m(r({},"__esModule",{value:!0}),t);var b={};v(b,{CreditsBanner:()=>w});module.exports=C(b);var e=require("react/jsx-runtime"),l=require("@anker-in/headless-ui"),g=N(require("classnames")),p=require("../context/provider");function w({copy:t}){const{profile:i,openSignInPopup:a,openSignUpPopup:s}=(0,p.useCreditsContext)(),n=i?Object.keys(i).length!==0:!1,d=i?.first_name?i?.first_name+" "+i?.last_name:i?.email?.split("@")[0],o=c=>{c==="primary"?s():a()};return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:" relative w-full",children:[(0,e.jsx)(l.Picture,{className:"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]",source:`${t.pcImg?.url}, ${t.laptopImg?.url} 1024, ${t.mobileImg?.url} 768`,alt:t.pcImg?.alt,loading:"eager"}),n&&(0,e.jsx)("div",{className:"absolute inset-0 ",style:{background:"linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)"}}),(0,e.jsx)(l.Container,{className:"l:h-auto !absolute inset-0 mx-auto grid h-full",asChild:!0,children:(0,e.jsx)("div",{className:"grid grid-cols-12",children:(0,e.jsxs)("div",{className:"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]",children:[(0,e.jsx)(l.Heading,{as:"h1",size:"5",html:n?t.login.title?.replace("$name",d||""):t.unLogin.title}),(0,e.jsx)(l.Text,{size:"3",className:"l:mt-[4px] l-xxl:text-[14px] mt-[16px]",html:n?t.login.description:t.unLogin.description}),!n&&(0,e.jsxs)("div",{className:(0,g.default)("mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]",n&&"hidden"),children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>{o("primary")},children:t.joinNow}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>{o("secondary")},children:t.loginIn})]})]})})})]})})}
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBanner/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\n\ntype Img = {\n url: string\n alt: string\n}\ntype BannerProps = {\n copy: {\n pcImg: Img\n laptopImg: Img\n mobileImg: Img\n joinNow: string\n loginIn: string\n login: {\n title: string\n description: string\n }\n unLogin: {\n title: string\n description: string\n }\n }\n}\n\nexport function CreditsBanner({ copy }: BannerProps) {\n const { profile, openSignInPopup, openSignUpPopup } = useCreditsContext()\n const isLogin = profile ? Object.keys(profile).length !== 0 : false\n\n const displayName = profile?.first_name\n ? profile?.first_name + ' ' + profile?.last_name\n : profile?.email?.split('@')[0]\n\n const handleButtonClick = (buttonType: 'primary' | 'secondary') => {\n buttonType === 'primary' ? openSignUpPopup() : openSignInPopup()\n }\n\n return (\n <>\n <div className=\" relative w-full\">\n <Picture\n className=\"aspect-h-[804] aspect-w-[1920] md:aspect-h-[660] md:aspect-w-[390] md-l:aspect-h-[660] md-l:aspect-w-[768]\"\n source={`${copy.pcImg?.url}, ${copy.laptopImg?.url} 1024, ${copy.mobileImg?.url} 768`}\n alt={copy.pcImg?.alt}\n loading=\"eager\"\n ></Picture>\n {isLogin && (\n <div\n className=\"absolute inset-0 \"\n style={{\n background: 'linear-gradient(180deg, rgba(245, 245, 247, 0) 70.31%, #F5F5F7 100%)',\n }}\n ></div>\n )}\n\n <Container className=\"l:h-auto !absolute inset-0 mx-auto grid h-full\" asChild>\n <div className=\"grid grid-cols-12\">\n <div className=\"l:col-span-12 l:justify-start l:truncate l:pt-[64px] col-span-5 flex h-full flex-col justify-center text-[#1F2021]\">\n <Heading\n as=\"h1\"\n size=\"5\"\n html={isLogin ? copy.login.title?.replace('$name', displayName || '') : copy.unLogin.title}\n ></Heading>\n\n <Text\n size=\"3\"\n className=\"l:mt-[4px] l-xxl:text-[14px] mt-[16px]\"\n html={isLogin ? copy.login.description : copy.unLogin.description}\n ></Text>\n\n {!isLogin && (\n <div\n className={classNames(\n 'mt-[32px] grid w-fit grid-flow-col gap-[12px] l:mt-[24px]',\n isLogin && 'hidden'\n )}\n >\n <Button\n variant=\"secondary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('primary')\n }}\n >\n {copy.joinNow}\n </Button>\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => {\n handleButtonClick('secondary')\n }}\n >\n {copy.loginIn}\n </Button>\n </div>\n )}\n </div>\n </div>\n </Container>\n </div>\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAuCI,IAAAI,EAAA,6BAvCJC,EAA0D,iCAC1DC,EAAuB,yBACvBC,EAAkC,+BAwB3B,SAASL,EAAc,CAAE,KAAAM,CAAK,EAAgB,CACnD,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,gBAAAC,CAAgB,KAAI,qBAAkB,EAClEC,EAAUH,EAAU,OAAO,KAAKA,CAAO,EAAE,SAAW,EAAI,GAExDI,EAAcJ,GAAS,WACzBA,GAAS,WAAa,IAAMA,GAAS,UACrCA,GAAS,OAAO,MAAM,GAAG,EAAE,CAAC,EAE1BK,EAAqBC,GAAwC,CACjEA,IAAe,UAAYJ,EAAgB,EAAID,EAAgB,CACjE,EAEA,SACE,mBACE,oBAAC,OAAI,UAAU,mBACb,oBAAC,WACC,UAAU,6GACV,OAAQ,GAAGF,EAAK,OAAO,GAAG,KAAKA,EAAK,WAAW,GAAG,UAAUA,EAAK,WAAW,GAAG,OAC/E,IAAKA,EAAK,OAAO,IACjB,QAAQ,QACT,EACAI,MACC,OAAC,OACC,UAAU,oBACV,MAAO,CACL,WAAY,sEACd,EACD,KAGH,OAAC,aAAU,UAAU,iDAAiD,QAAO,GAC3E,mBAAC,OAAI,UAAU,oBACb,oBAAC,OAAI,UAAU,qHACb,oBAAC,WACC,GAAG,KACH,KAAK,IACL,KAAMA,EAAUJ,EAAK,MAAM,OAAO,QAAQ,QAASK,GAAe,EAAE,EAAIL,EAAK,QAAQ,MACtF,KAED,OAAC,QACC,KAAK,IACL,UAAU,yCACV,KAAMI,EAAUJ,EAAK,MAAM,YAAcA,EAAK,QAAQ,YACvD,EAEA,CAACI,MACA,QAAC,OACC,aAAW,EAAAI,SACT,4DACAJ,GAAW,QACb,EAEA,oBAAC,UACC,QAAQ,YACR,KAAK,KACL,QAAS,IAAM,CACbE,EAAkB,SAAS,CAC7B,EAEC,SAAAN,EAAK,QACR,KACA,OAAC,UACC,QAAQ,UACR,KAAK,KACL,QAAS,IAAM,CACbM,EAAkB,WAAW,CAC/B,EAEC,SAAAN,EAAK,QACR,GACF,GAEJ,EACF,EACF,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["creditsBanner_exports", "__export", "CreditsBanner", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_provider", "copy", "profile", "openSignInPopup", "openSignUpPopup", "isLogin", "displayName", "handleButtonClick", "buttonType", "classNames"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface BenefitItemCopy {
|
|
2
|
+
icon: {
|
|
3
|
+
alt: string;
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
text: string;
|
|
7
|
+
note?: string;
|
|
8
|
+
tag?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const BenefitItem: ({ item, handleClick, isNoteActive, index, }: {
|
|
11
|
+
item: BenefitItemCopy;
|
|
12
|
+
handleClick: ({ item, index }: {
|
|
13
|
+
item: BenefitItemCopy;
|
|
14
|
+
index: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
isNoteActive: boolean;
|
|
17
|
+
index: number;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default BenefitItem;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.create;var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var i in o)d(e,i,{get:o[i],enumerable:!0})},r=(e,o,i,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of c(o))!b.call(e,l)&&l!==i&&d(e,l,{get:()=>o[l],enumerable:!(n=m(o,l))||n.enumerable});return e};var u=(e,o,i)=>(i=e!=null?p(f(e)):{},r(o||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),g=e=>r(d({},"__esModule",{value:!0}),e);var h={};v(h,{default:()=>N});module.exports=g(h);var t=require("react/jsx-runtime"),a=require("@anker-in/headless-ui"),x=require("../../../helpers/utils"),s=u(require("./iconInfo"));const F=({item:e,handleClick:o,isNoteActive:i,index:n})=>(0,t.jsx)("div",{className:"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",style:{background:"linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)"},children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(a.Picture,{className:"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0",alt:e.icon?.alt,source:e.icon?.url}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(a.Heading,{html:e.text,size:"2",className:"break-all"}),e.note&&(0,t.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&l.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>o({item:e,index:n}),children:[(0,t.jsx)(s.default,{}),(0,t.jsx)("div",{className:(0,x.cn)("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",i?"block":"hidden"),children:(0,t.jsxs)("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",children:[(0,t.jsx)(a.Text,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),(0,t.jsx)("div",{className:"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]}),e.tag&&(0,t.jsx)(a.Text,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})});var N=F;
|
|
2
|
+
//# sourceMappingURL=benefitItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBenefits/benefitItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { cn } from '../../../helpers/utils'\nimport IconInfo from './iconInfo'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n}) => {\n return (\n <div\n className=\"relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]\"\n style={{\n background: 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)',\n }}\n >\n <div className=\"flex flex-col\">\n <Picture\n className=\"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0\"\n alt={item.icon?.alt}\n source={item.icon?.url}\n />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow\">\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div className=\"absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgCQ,IAAAI,EAAA,6BAhCRC,EAAuC,iCACvCC,EAAmB,kCACnBC,EAAqB,yBAWrB,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,CACF,OAOI,OAAC,OACC,UAAU,8HACV,MAAO,CACL,WAAY,4EACd,EAEA,oBAAC,OAAI,UAAU,gBACb,oBAAC,WACC,UAAU,6EACV,IAAKH,EAAK,MAAM,IAChB,OAAQA,EAAK,MAAM,IACrB,KACA,QAAC,OAAI,UAAU,oBACb,oBAAC,WAAQ,KAAMA,EAAK,KAAM,KAAK,IAAI,UAAU,YAAY,EACxDA,EAAK,SACJ,QAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWI,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMH,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,oBAAC,EAAAE,QAAA,EAAS,KACV,OAAC,OACC,aAAW,MACT,qGACAH,EAAe,QAAU,QAC3B,EAEA,oBAAC,OAAI,UAAU,0FACb,oBAAC,QAAK,GAAG,IAAI,KAAK,IAAI,KAAMF,EAAK,KAAM,UAAU,sBAAsB,KACvE,OAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GAEJ,EACCA,EAAK,QAAO,OAAC,QAAK,GAAG,MAAM,KAAMA,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,EAIJ,IAAOP,EAAQM",
|
|
6
|
+
"names": ["benefitItem_exports", "__export", "benefitItem_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_iconInfo", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "e", "IconInfo"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(l,C)=>{for(var t in C)e(l,t,{get:C[t],enumerable:!0})},r=(l,C,t,i)=>{if(C&&typeof C=="object"||typeof C=="function")for(let o of f(C))!g.call(l,o)&&o!==t&&e(l,o,{get:()=>C[o],enumerable:!(i=p(C,o))||i.enumerable});return l};var w=l=>r(e({},"__esModule",{value:!0}),l);var a={};h(a,{IconInfo:()=>n,default:()=>v});module.exports=w(a);var s=require("react/jsx-runtime");const n=()=>(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-[18px] cursor-pointer [&_svg]:size-full",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[(0,s.jsx)("path",{d:"M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z",fill:"#6D6D6F"}),(0,s.jsx)("path",{d:"M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z",fill:"#6D6D6F"})]});var v=n;
|
|
2
|
+
//# sourceMappingURL=iconInfo.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBenefits/iconInfo.tsx"],
|
|
4
|
+
"sourcesContent": ["export const IconInfo = () => {\n return (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n className='size-[18px] cursor-pointer [&_svg]:size-full'\n width='18'\n height='18'\n viewBox='0 0 18 18'\n fill='none'\n >\n <path\n d='M9 1.125C11.1744 1.125 13.1441 2.00737 14.5684 3.43164C15.9926 4.85593 16.875 6.8256 16.875 9C16.875 11.1744 15.9926 13.1441 14.5684 14.5684C13.1441 15.9926 11.1744 16.875 9 16.875C6.8256 16.875 4.85593 15.9926 3.43164 14.5684C2.00737 13.1441 1.125 11.1744 1.125 9C1.125 6.8256 2.00738 4.85593 3.43164 3.43164C4.85593 2.00738 6.8256 1.125 9 1.125ZM9 2.625C7.23941 2.625 5.64668 3.33772 4.49219 4.49219C3.33772 5.64668 2.625 7.23941 2.625 9C2.625 10.7606 3.33772 12.3533 4.49219 13.5078C5.64668 14.6623 7.23941 15.375 9 15.375C10.7606 15.375 12.3533 14.6623 13.5078 13.5078C14.6623 12.3533 15.375 10.7606 15.375 9C15.375 7.23941 14.6623 5.64668 13.5078 4.49219C12.3533 3.33772 10.7606 2.625 9 2.625Z'\n fill='#6D6D6F'\n />\n <path\n d='M9 11.583C9.51777 11.583 9.9375 12.0027 9.9375 12.5205V12.5596C9.93718 13.0771 9.51757 13.4971 9 13.4971C8.48243 13.4971 8.06282 13.0771 8.0625 12.5596V12.5205C8.0625 12.0027 8.48223 11.583 9 11.583ZM8.99902 4.5C9.51671 4.49959 9.93696 4.91886 9.9375 5.43652L9.94043 9.37109C9.94084 9.88884 9.52165 10.3091 9.00391 10.3096C8.48616 10.31 8.06587 9.89079 8.06543 9.37305L8.0625 5.43848C8.06209 4.92079 8.48136 4.50054 8.99902 4.5Z'\n fill='#6D6D6F'\n />\n </svg>\n )\n}\n\nexport default IconInfo\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAEI,IAAAK,EAAA,6BAFG,MAAMH,EAAW,OAEpB,QAAC,OACC,MAAM,6BACN,UAAU,+CACV,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,oBAAC,QACC,EAAE,6rBACF,KAAK,UACP,KACA,OAAC,QACC,EAAE,+aACF,KAAK,UACP,GACF,EAIJ,IAAOC,EAAQD",
|
|
6
|
+
"names": ["iconInfo_exports", "__export", "IconInfo", "iconInfo_default", "__toCommonJS", "import_jsx_runtime"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'swiper/css';
|
|
2
|
+
import 'swiper/css/grid';
|
|
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 {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var C=Object.create;var a=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var _=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!N.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(l=x(t,o))||l.enumerable});return e};var B=(e,t,i)=>(i=e!=null?C(h(e)):{},f(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),y=e=>f(a({},"__esModule",{value:!0}),e);var P={};_(P,{CreditsBenefits:()=>I});module.exports=y(P);var n=require("react/jsx-runtime"),z=require("swiper/css"),D=require("swiper/css/grid"),G=require("swiper/css/pagination"),p=require("@anker-in/headless-ui"),g=require("react"),m=require("swiper/modules"),d=require("swiper/react"),c=B(require("./benefitItem")),v=require("../context/provider"),b=require("../../../helpers/track"),w=require("../../../helpers/utils");const I=({copy:e})=>{const[t,i]=(0,g.useState)(null),{profile:l,gtm:o}=(0,v.useCreditsContext)(),u=({item:s,index:r})=>{(0,b.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:o.pageGroup,position:e.title,button_name:s.text,info:""}}),t===r?i(null):(i(r),setTimeout(()=>{i(null)},5e3))};return(0,n.jsxs)(p.Container,{id:"benefits",className:"!z-[30] bg-[#F5F5F7]",children:[(0,n.jsx)(p.Heading,{as:"h2",size:"4",html:e?.title}),(0,n.jsx)("div",{className:"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch",children:e.benefits.map((s,r)=>(0,n.jsx)(c.default,{item:s,handleClick:u,isNoteActive:t===r,index:r},r))}),(0,n.jsxs)("div",{className:"mt-[24px] hidden l:block",children:[(0,n.jsx)(d.Swiper,{spaceBetween:16,slidesPerView:2,slidesPerGroup:2,grid:{rows:2,fill:"row"},breakpoints:{768:{slidesPerView:3,slidesPerGroup:3}},wrapperClass:"!items-stretch",modules:[m.Grid,m.Pagination],pagination:{clickable:!0,el:"#benefits-pagination",renderBullet(s,r){return`<div class='${r} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>
|
|
2
|
+
</div>`}},children:e.benefits.map((s,r)=>(0,n.jsx)(d.SwiperSlide,{className:(0,w.cn)("!h-auto !flex",t===r&&"!z-[100]"),children:(0,n.jsx)(c.default,{item:s,handleClick:u,isNoteActive:t===r,index:r})},r))}),(0,n.jsx)("div",{id:"benefits-pagination",className:`mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515]
|
|
3
|
+
[&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full`})]}),t&&(0,n.jsx)("div",{role:"button",tabIndex:0,className:"fixed inset-0 z-10",onClick:()=>i(null),onKeyDown:s=>s.key==="Escape"&&i(null)})]})};
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsBenefits/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import 'swiper/css'\nimport 'swiper/css/grid'\nimport 'swiper/css/pagination'\n\nimport { Container, Heading } from '@anker-in/headless-ui'\nimport { useState } from 'react'\nimport { Grid, Pagination } from 'swiper/modules'\nimport { Swiper, SwiperSlide } from 'swiper/react'\n\nimport BenefitItem, { type BenefitItemCopy } from './benefitItem'\nimport { useCreditsContext } from '../context/provider'\nimport { gaTrack } from '../../../helpers/track'\nimport { cn } from '../../../helpers/utils'\n\ninterface CreditsBenefitsProps {\n copy: {\n title: string\n benefits: BenefitItemCopy[]\n }\n}\n\nexport const CreditsBenefits = ({ copy }: CreditsBenefitsProps) => {\n const [activeNoteIndex, setActiveNoteIndex] = useState<number | null>(null)\n const { profile, gtm } = useCreditsContext()\n\n const handleClick = ({ item, index }: { item: BenefitItemCopy; index: number }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: copy.title,\n button_name: item.text,\n info: '',\n },\n })\n if (activeNoteIndex === index) {\n setActiveNoteIndex(null)\n } else {\n setActiveNoteIndex(index)\n setTimeout(() => {\n setActiveNoteIndex(null)\n }, 5000)\n }\n }\n\n return (\n <Container id=\"benefits\" className=\"!z-[30] bg-[#F5F5F7]\">\n <Heading as=\"h2\" size=\"4\" html={copy?.title} />\n <div className=\"mt-[24px] grid grid-cols-4 xl:grid-cols-3 gap-[16px] l:hidden items-stretch\">\n {copy.benefits.map((item, index) => (\n <BenefitItem\n key={index}\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n ))}\n </div>\n <div className=\"mt-[24px] hidden l:block\">\n <Swiper\n spaceBetween={16}\n slidesPerView={2}\n slidesPerGroup={2}\n grid={{\n rows: 2,\n fill: 'row',\n }}\n breakpoints={{\n 768: {\n slidesPerView: 3,\n slidesPerGroup: 3,\n },\n }}\n wrapperClass=\"!items-stretch\"\n modules={[Grid, Pagination]}\n pagination={{\n clickable: true,\n el: '#benefits-pagination',\n renderBullet(index, className) {\n return `<div class='${className} !flex justify-center size-[8px] rounded-full bg-[#D9D9D9] cursor-pointer items-center'>\n </div>`\n },\n }}\n >\n {copy.benefits.map((item, index) => (\n <SwiperSlide key={index} className={cn('!h-auto !flex', activeNoteIndex === index && '!z-[100]')}>\n <BenefitItem\n item={item}\n handleClick={handleClick}\n isNoteActive={activeNoteIndex === index}\n index={index}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n <div\n id=\"benefits-pagination\"\n className=\"mx-auto mt-[12px] grid !w-fit grid-flow-col [&_.swiper-pagination-bullet-active>div]:!bg-[#151515] \n [&_.swiper-pagination-bullet]:cursor-pointer [&_.swiper-pagination-bullet]:rounded-full\"\n ></div>\n </div>\n\n {activeNoteIndex && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"fixed inset-0 z-10\"\n onClick={() => setActiveNoteIndex(null)}\n onKeyDown={e => e.key === 'Escape' && setActiveNoteIndex(null)}\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAiDM,IAAAI,EAAA,6BAjDNC,EAAO,sBACPC,EAAO,2BACPC,EAAO,iCAEPC,EAAmC,iCACnCC,EAAyB,iBACzBC,EAAiC,0BACjCD,EAAoC,wBAEpCE,EAAkD,4BAClDC,EAAkC,+BAClCC,EAAwB,kCACxBC,EAAmB,kCASZ,MAAMZ,EAAkB,CAAC,CAAE,KAAAa,CAAK,IAA4B,CACjE,KAAM,CAACC,EAAiBC,CAAkB,KAAI,YAAwB,IAAI,EACpE,CAAE,QAAAC,EAAS,IAAAC,CAAI,KAAI,qBAAkB,EAErCC,EAAc,CAAC,CAAE,KAAAC,EAAM,MAAAC,CAAM,IAAgD,IACjF,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBJ,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EAAI,UAChB,SAAUJ,EAAK,MACf,YAAaM,EAAK,KAClB,KAAM,EACR,CACF,CAAC,EACGL,IAAoBM,EACtBL,EAAmB,IAAI,GAEvBA,EAAmBK,CAAK,EACxB,WAAW,IAAM,CACfL,EAAmB,IAAI,CACzB,EAAG,GAAI,EAEX,EAEA,SACE,QAAC,aAAU,GAAG,WAAW,UAAU,uBACjC,oBAAC,WAAQ,GAAG,KAAK,KAAK,IAAI,KAAMF,GAAM,MAAO,KAC7C,OAAC,OAAI,UAAU,8EACZ,SAAAA,EAAK,SAAS,IAAI,CAACM,EAAMC,OACxB,OAAC,EAAAC,QAAA,CAEC,KAAMF,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,GAJFA,CAKP,CACD,EACH,KACA,QAAC,OAAI,UAAU,2BACb,oBAAC,UACC,aAAc,GACd,cAAe,EACf,eAAgB,EAChB,KAAM,CACJ,KAAM,EACN,KAAM,KACR,EACA,YAAa,CACX,IAAK,CACH,cAAe,EACf,eAAgB,CAClB,CACF,EACA,aAAa,iBACb,QAAS,CAAC,OAAM,YAAU,EAC1B,WAAY,CACV,UAAW,GACX,GAAI,uBACJ,aAAaA,EAAOE,EAAW,CAC7B,MAAO,eAAeA,CAAS;AAAA,qBAEjC,CACF,EAEC,SAAAT,EAAK,SAAS,IAAI,CAACM,EAAMC,OACxB,OAAC,eAAwB,aAAW,MAAG,gBAAiBN,IAAoBM,GAAS,UAAU,EAC7F,mBAAC,EAAAC,QAAA,CACC,KAAMF,EACN,YAAaD,EACb,aAAcJ,IAAoBM,EAClC,MAAOA,EACT,GANgBA,CAOlB,CACD,EACH,KACA,OAAC,OACC,GAAG,sBACH,UAAU;AAAA,mGAEX,GACH,EAECN,MACC,OAAC,OACC,KAAK,SACL,SAAU,EACV,UAAU,qBACV,QAAS,IAAMC,EAAmB,IAAI,EACtC,UAAWQ,GAAKA,EAAE,MAAQ,UAAYR,EAAmB,IAAI,EAC/D,GAEJ,CAEJ",
|
|
6
|
+
"names": ["creditsBenefits_exports", "__export", "CreditsBenefits", "__toCommonJS", "import_jsx_runtime", "import_css", "import_grid", "import_pagination", "import_headless_ui", "import_react", "import_modules", "import_benefitItem", "import_provider", "import_track", "import_utils", "copy", "activeNoteIndex", "setActiveNoteIndex", "profile", "gtm", "handleClick", "item", "index", "BenefitItem", "className", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CreditsCashCopy, RedeemItem } from './type';
|
|
2
|
+
declare function RedeemableItem({ copy, itemData, setRules, className, authCodeActivate, }: {
|
|
3
|
+
copy: CreditsCashCopy;
|
|
4
|
+
itemData: RedeemItem;
|
|
5
|
+
className?: string;
|
|
6
|
+
setRules: (rules: string[]) => void;
|
|
7
|
+
currencyCode: string;
|
|
8
|
+
authCodeActivate: {
|
|
9
|
+
openAuthCodePopup: Function;
|
|
10
|
+
isSuccess: boolean;
|
|
11
|
+
setOnSuccess: (arg: Function) => void;
|
|
12
|
+
isSendingActivateEmail: boolean;
|
|
13
|
+
};
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default RedeemableItem;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var o in e)x(t,o,{get:e[o],enumerable:!0})},F=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of R(e))!k.call(t,l)&&l!==o&&x(t,l,{get:()=>e[l],enumerable:!(c=y(e,l))||c.enumerable});return t};var V=t=>F(x({},"__esModule",{value:!0}),t);var L={};E(L,{default:()=>A});module.exports=V(L);var i=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),p=require("react"),d=require("../../../helpers"),b=require("../context/provider"),h=require("../context/hooks/useRedeemAndBuy"),N=require("../context/utils"),f=require("../../../helpers/track");function z({copy:t,itemData:e,setRules:o,className:c,authCodeActivate:l}){const{creditInfo:v,profile:n,openSignUpPopup:C,gtm:{pageGroup:g}}=(0,b.useCreditsContext)(),{trigger:_,isMutating:S}=(0,h.useRedeemAndBuy)({},{onError:()=>console.log("error")}),s=(0,p.useMemo)(()=>!!n,[n?.activated]),u=(0,p.useMemo)(()=>s&&n?.activated&&e.alpcData?.consumeCredits>Number(v?.available_credit||0),[s,n?.activated,e.alpcData?.consumeCredits,v?.available_credit]),w=(0,p.useMemo)(()=>!!(e.alpcData?.remainingInventory<=0&&e.alpcData?.isLimited||!e.productVariant?.availableForSale||u),[e.alpcData?.remainingInventory,e.alpcData?.isLimited,e.productVariant?.availableForSale,u]),I=()=>{const a=()=>_({productVariant:e?.productVariant,redeemId:e?.config?.redeemId});s?!n?.activated&&!(l.isSendingActivateEmail||l.isSuccess)?(l.openAuthCodePopup(),l.setOnSuccess(a)):(a(),(0,f.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:n?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:m,info:e?.alpcData?.id?.toString()}})):C()},m=(0,p.useMemo)(()=>e.productVariant?.availableForSale?s?t.btnRedeem:t.unlockRewards:t?.soldOut||"Sold Out",[s,e.productVariant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return(0,i.jsxs)("div",{className:(0,d.cn)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",c),children:[(0,i.jsx)("div",{className:(0,d.cn)("relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]"),children:(0,i.jsx)(r.Picture,{className:"mx-auto h-full w-auto",imgClassName:"h-full object-contain",source:e?.config?.image?.url||e?.productVariant?.metafields?.global?.transparentImg||e?.productVariant?.image?.url})}),(0,i.jsxs)("div",{className:(0,d.cn)("mt-[22px] w-full l:mt-[8px]"),children:[(0,i.jsx)(r.Text,{html:e?.product?.title,title:e.config?.title||e.alpcData?.title||e.product?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:line-clamp-3 l:h-[56px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e?.config?.rules?.split("<br>")?.length>0&&(0,i.jsx)("button",{type:"button",onClick:()=>{o(e?.config?.rules?.split("<br>")),(0,f.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:n?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:t?.ruleLabel,info:e?.alpcData?.id?.toString()}})},className:"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},children:t?.ruleLabel}),(0,i.jsxs)("div",{className:"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]",children:[(0,i.jsx)(r.Picture,{className:"size-[20px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,i.jsx)(r.Text,{html:`${(0,N.numberFormat)(e?.alpcData?.consumeCredits)} + ${e?.config?.price}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),(0,i.jsxs)("div",{className:"group relative w-full",children:[(0,i.jsx)(r.Button,{disabled:w,variant:"primary",size:"lg",className:"mt-[8px] md:px-[10px] l:w-full",loading:S,onClick:()=>{I()},title:u?"Insufficient credit":m,children:m}),(0,i.jsx)("div",{className:(0,d.cn)("absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]",u?"block":"hidden"),children:(0,i.jsxs)("div",{className:"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]",children:[(0,i.jsx)(r.Text,{as:"p",size:"2",html:t?.insufficientCredits,className:"text-[14px]"}),(0,i.jsx)("div",{className:"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]"})]})})]})]})]})}var A=z;
|
|
2
|
+
//# sourceMappingURL=RedeemableItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsCash/RedeemableItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\nimport { useMemo } from 'react'\nimport { cn } from '../../../helpers'\n\nimport { CreditsCashCopy, RedeemItem } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemAndBuy } from '../context/hooks/useRedeemAndBuy'\nimport { numberFormat } from '../context/utils'\nimport { gaTrack } from '../../../helpers/track'\n\nfunction RedeemableItem({\n copy,\n itemData,\n setRules,\n className,\n authCodeActivate,\n}: {\n copy: CreditsCashCopy\n itemData: RedeemItem\n className?: string\n setRules: (rules: string[]) => void\n currencyCode: string\n authCodeActivate: {\n openAuthCodePopup: Function\n isSuccess: boolean\n setOnSuccess: (arg: Function) => void\n isSendingActivateEmail: boolean\n }\n}) {\n const {\n creditInfo,\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const { trigger, isMutating } = useRedeemAndBuy(\n {},\n {\n onError: () => console.log('error'),\n }\n )\n\n const isLogin = useMemo(() => {\n return !!profile\n }, [profile?.activated])\n\n const inSufficientCredit = useMemo(() => {\n return (\n isLogin && profile?.activated && itemData.alpcData?.consumeCredits > Number(creditInfo?.available_credit || 0)\n )\n }, [isLogin, profile?.activated, itemData.alpcData?.consumeCredits, creditInfo?.available_credit])\n\n const isDisabled = useMemo(() => {\n // \u5151\u6362\u9650\u5236\n if (itemData.alpcData?.remainingInventory <= 0 && itemData.alpcData?.isLimited) {\n return true\n }\n\n // \u5546\u54C1\u5E93\u5B58\u9650\u5236\n if (!itemData.productVariant?.availableForSale) {\n return true\n }\n\n // \u79EF\u5206\u4E0D\u8DB3\n if (inSufficientCredit) {\n return true\n }\n return false\n }, [\n itemData.alpcData?.remainingInventory,\n itemData.alpcData?.isLimited,\n itemData.productVariant?.availableForSale,\n inSufficientCredit,\n ])\n\n const handleRedeem = () => {\n const buyNow = () =>\n trigger({\n productVariant: itemData?.productVariant,\n redeemId: itemData?.config?.redeemId,\n })\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !(authCodeActivate.isSendingActivateEmail || authCodeActivate.isSuccess)) {\n authCodeActivate.openAuthCodePopup()\n authCodeActivate.setOnSuccess(buyNow)\n } else {\n buyNow()\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: itemData?.alpcData?.id?.toString(),\n },\n })\n }\n }\n\n const redeemButtonText = useMemo(() => {\n // \u7F3A\u8D27\u6587\u6848\n if (!itemData.productVariant?.availableForSale) {\n return copy?.soldOut || 'Sold Out'\n } else if (!isLogin) {\n return copy.unlockRewards\n } else {\n return copy.btnRedeem\n }\n }, [isLogin, itemData.productVariant?.availableForSale, copy.btnRedeem, copy.unlockRewards, copy?.soldOut])\n\n return (\n <div\n className={cn(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n <div className={cn('relative mx-auto h-[224px] w-fit l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"mx-auto h-full w-auto\"\n imgClassName=\"h-full object-contain\"\n source={\n itemData?.config?.image?.url ||\n itemData?.productVariant?.metafields?.global?.transparentImg ||\n itemData?.productVariant?.image?.url\n }\n ></Picture>\n </div>\n <div className={cn('mt-[22px] w-full l:mt-[8px]')}>\n <Text\n html={itemData?.product?.title}\n title={itemData.config?.title || itemData.alpcData?.title || itemData.product?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:line-clamp-3 l:h-[56px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {itemData?.config?.rules?.split('<br>')?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n setRules(itemData?.config?.rules?.split('<br>'))\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: itemData?.alpcData?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] text-[16px] font-bold underline xxl:text-[14px]\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div className=\"mt-[24px] flex items-center l:mt-[12px] laptop:text-[16px] lg-desktop:text-[18px]\">\n <Picture\n className=\"size-[20px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(itemData?.alpcData?.consumeCredits)} + ${itemData?.config?.price}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[28px] font-bold leading-[1.2] md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <div className=\"group relative w-full\">\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[10px] l:w-full\"\n loading={isMutating}\n onClick={() => {\n handleRedeem()\n }}\n title={inSufficientCredit ? 'Insufficient credit' : redeemButtonText}\n >\n {redeemButtonText}\n </Button>\n <div\n className={cn(\n 'absolute -bottom-[20px] left-0 z-10 w-[300px] translate-y-full opacity-0 transition-opacity group-hover:opacity-100 md:-bottom-[14px] md:w-[160px]',\n inSufficientCredit ? 'block' : 'hidden'\n )}\n >\n <div className=\"relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow md:px-[10px] md:py-[8px]\">\n <Text as=\"p\" size=\"2\" html={copy?.insufficientCredits} className=\"text-[14px]\" />\n <div className=\"absolute -top-[10px] left-[48px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default RedeemableItem\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyHQ,IAAAI,EAAA,6BAzHRC,EAAsC,iCACtCC,EAAwB,iBACxBC,EAAmB,4BAGnBC,EAAkC,+BAClCC,EAAgC,4CAChCC,EAA6B,4BAC7BC,EAAwB,kCAExB,SAASC,EAAe,CACtB,KAAAC,EACA,SAAAC,EACA,SAAAC,EACA,UAAAC,EACA,iBAAAC,CACF,EAYG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,KAAI,qBAAkB,EAChB,CAAE,QAAAC,EAAS,WAAAC,CAAW,KAAI,mBAC9B,CAAC,EACD,CACE,QAAS,IAAM,QAAQ,IAAI,OAAO,CACpC,CACF,EAEMC,KAAU,WAAQ,IACf,CAAC,CAACL,EACR,CAACA,GAAS,SAAS,CAAC,EAEjBM,KAAqB,WAAQ,IAE/BD,GAAWL,GAAS,WAAaL,EAAS,UAAU,eAAiB,OAAOI,GAAY,kBAAoB,CAAC,EAE9G,CAACM,EAASL,GAAS,UAAWL,EAAS,UAAU,eAAgBI,GAAY,gBAAgB,CAAC,EAE3FQ,KAAa,WAAQ,IAErB,GAAAZ,EAAS,UAAU,oBAAsB,GAAKA,EAAS,UAAU,WAKjE,CAACA,EAAS,gBAAgB,kBAK1BW,GAIH,CACDX,EAAS,UAAU,mBACnBA,EAAS,UAAU,UACnBA,EAAS,gBAAgB,iBACzBW,CACF,CAAC,EAEKE,EAAe,IAAM,CACzB,MAAMC,EAAS,IACbN,EAAQ,CACN,eAAgBR,GAAU,eAC1B,SAAUA,GAAU,QAAQ,QAC9B,CAAC,EACEU,EAEM,CAACL,GAAS,WAAa,EAAEF,EAAiB,wBAA0BA,EAAiB,YAC9FA,EAAiB,kBAAkB,EACnCA,EAAiB,aAAaW,CAAM,IAEpCA,EAAO,KACP,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBT,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYE,EACZ,SAAUR,EAAK,MACf,YAAagB,EACb,KAAMf,GAAU,UAAU,IAAI,SAAS,CACzC,CACF,CAAC,GAhBDM,EAAgB,CAkBpB,EAEMS,KAAmB,WAAQ,IAE1Bf,EAAS,gBAAgB,iBAElBU,EAGHX,EAAK,UAFLA,EAAK,cAFLA,GAAM,SAAW,WAMzB,CAACW,EAASV,EAAS,gBAAgB,iBAAkBD,EAAK,UAAWA,EAAK,cAAeA,GAAM,OAAO,CAAC,EAE1G,SACE,QAAC,OACC,aAAW,MACT,6HACAG,CACF,EAEA,oBAAC,OAAI,aAAW,MAAG,8DAA8D,EAC/E,mBAAC,WACC,UAAU,wBACV,aAAa,wBACb,OACEF,GAAU,QAAQ,OAAO,KACzBA,GAAU,gBAAgB,YAAY,QAAQ,gBAC9CA,GAAU,gBAAgB,OAAO,IAEpC,EACH,KACA,QAAC,OAAI,aAAW,MAAG,6BAA6B,EAC9C,oBAAC,QACC,KAAMA,GAAU,SAAS,MACzB,MAAOA,EAAS,QAAQ,OAASA,EAAS,UAAU,OAASA,EAAS,SAAS,MAC/E,KAAM,EACN,UAAU,2HACZ,EACCA,GAAU,QAAQ,OAAO,MAAM,MAAM,GAAG,OAAS,MAChD,OAAC,UACC,KAAK,SACL,QAAS,IAAM,CACbC,EAASD,GAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,KAC/C,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBK,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYE,EACZ,SAAUR,EAAK,MACf,YAAaA,GAAM,UACnB,KAAMC,GAAU,UAAU,IAAI,SAAS,CACzC,CACF,CAAC,CACH,EACA,UAAU,2DACV,SAAU,EACV,UAAWgB,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAjB,GAAM,UACT,KAEF,QAAC,OAAI,UAAU,oFACb,oBAAC,WACC,UAAU,cACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaC,GAAU,UAAU,cAAc,CAAC,MAAMA,GAAU,QAAQ,KAAK,GACtF,KAAM,EACN,GAAG,IACH,UAAU,kGACZ,GACF,KAEA,QAAC,OAAI,UAAU,wBACb,oBAAC,UACC,SAAUY,EACV,QAAQ,UACR,KAAK,KACL,UAAU,iCACV,QAASH,EACT,QAAS,IAAM,CACbI,EAAa,CACf,EACA,MAAOF,EAAqB,sBAAwBI,EAEnD,SAAAA,EACH,KACA,OAAC,OACC,aAAW,MACT,qJACAJ,EAAqB,QAAU,QACjC,EAEA,oBAAC,OAAI,UAAU,mHACb,oBAAC,QAAK,GAAG,IAAI,KAAK,IAAI,KAAMZ,GAAM,oBAAqB,UAAU,cAAc,KAC/E,OAAC,OAAI,UAAU,mHAAmH,GACpI,EACF,GACF,GACF,GACF,CAEJ,CAEA,IAAOX,EAAQU",
|
|
6
|
+
"names": ["RedeemableItem_exports", "__export", "RedeemableItem_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_helpers", "import_provider", "import_useRedeemAndBuy", "import_utils", "import_track", "RedeemableItem", "copy", "itemData", "setRules", "className", "authCodeActivate", "creditInfo", "profile", "openSignUpPopup", "pageGroup", "trigger", "isMutating", "isLogin", "inSufficientCredit", "isDisabled", "handleRedeem", "buyNow", "redeemButtonText", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CreditsCashCopy } from './type';
|
|
2
|
+
export declare const CreditsCash: ({ copy, className, hideTitle, cardClassName, authCodeActivate, }: {
|
|
3
|
+
copy: CreditsCashCopy;
|
|
4
|
+
className?: string;
|
|
5
|
+
hideTitle?: boolean;
|
|
6
|
+
cardClassName?: string;
|
|
7
|
+
authCodeActivate: {
|
|
8
|
+
openAuthCodePopup: Function;
|
|
9
|
+
isSuccess: boolean;
|
|
10
|
+
setOnSuccess: (arg: Function) => void;
|
|
11
|
+
isSendingActivateEmail: boolean;
|
|
12
|
+
};
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|