@anker-in/headless-ui 1.0.26-temp-111002 → 1.0.26-temp-111005
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/biz-components/AccordionCards/index.d.ts +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +3 -2
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +3 -2
- package/dist/cjs/biz-components/Category/index.d.ts +2 -2
- package/dist/cjs/biz-components/CollectionShelves/index.d.ts +3 -2
- package/dist/cjs/biz-components/CollectionsBanner/index.d.ts +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.d.ts +2 -0
- package/dist/cjs/biz-components/CollectionsFilters/index.d.ts +4 -2
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +3 -2
- package/dist/cjs/biz-components/DownLoad/index.d.ts +3 -2
- package/dist/cjs/biz-components/Evaluate/index.d.ts +2 -2
- package/dist/cjs/biz-components/Faq/Faq.d.ts +2 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +2 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +2 -2
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +2 -2
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js +1 -1
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.d.ts +3 -2
- package/dist/cjs/biz-components/FootCharger/index.d.ts +3 -2
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +3 -2
- package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -2
- package/dist/cjs/biz-components/Graphic/index.d.ts +2 -2
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +3 -2
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/Countdown.d.ts +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +2 -2
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +2 -2
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js.map +2 -2
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +2 -2
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
- package/dist/cjs/biz-components/Ksp/index.d.ts +3 -2
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +2 -4
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/index.d.ts +1 -0
- package/dist/cjs/biz-components/Listing/index.js +1 -1
- package/dist/cjs/biz-components/Listing/index.js.map +3 -3
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +2 -2
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +3 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +3 -2
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +3 -2
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +2 -2
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +3 -2
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +1 -0
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +3 -2
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +2 -2
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +2 -2
- package/dist/cjs/biz-components/SelectStore/index.d.ts +3 -2
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +2 -2
- package/dist/cjs/biz-components/Slogan/index.d.ts +2 -2
- package/dist/cjs/biz-components/Spacer/index.d.ts +2 -2
- package/dist/cjs/biz-components/Specs/dropdown.js +2 -2
- package/dist/cjs/biz-components/Specs/dropdown.js.map +2 -2
- package/dist/cjs/biz-components/Specs/index.d.ts +2 -2
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +2 -2
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +2 -2
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +2 -2
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +2 -2
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +2 -2
- package/dist/cjs/biz-components/TextMarquee/index.d.ts +3 -2
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +2 -2
- package/dist/cjs/biz-components/Title/index.d.ts +2 -2
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +2 -2
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.js +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.js.map +2 -2
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +2 -2
- package/dist/cjs/components/alert.d.ts +2 -2
- package/dist/cjs/components/avatar.d.ts +8 -8
- package/dist/cjs/components/container.d.ts +7 -7
- package/dist/cjs/components/dialog.d.ts +1 -1
- package/dist/cjs/components/drop-down.d.ts +3 -3
- package/dist/cjs/components/input-number.d.ts +15 -15
- package/dist/cjs/components/link.d.ts +6 -6
- package/dist/cjs/components/tabs.d.ts +2 -2
- package/dist/cjs/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/cjs/shared/Styles.d.ts +2 -2
- package/dist/cjs/stories/HeroBanner.stories.js +2 -2
- package/dist/cjs/stories/HeroBanner.stories.js.map +3 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/AccordionCards/index.d.ts +2 -2
- package/dist/esm/biz-components/AplusDesc/index.d.ts +3 -2
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +3 -2
- package/dist/esm/biz-components/Category/index.d.ts +2 -2
- package/dist/esm/biz-components/CollectionShelves/index.d.ts +3 -2
- package/dist/esm/biz-components/CollectionsBanner/index.d.ts +2 -2
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.d.ts +2 -0
- package/dist/esm/biz-components/CollectionsFilters/index.d.ts +4 -2
- package/dist/esm/biz-components/CreativeModule/index.d.ts +3 -2
- package/dist/esm/biz-components/DownLoad/index.d.ts +3 -2
- package/dist/esm/biz-components/Evaluate/index.d.ts +2 -2
- package/dist/esm/biz-components/Faq/Faq.d.ts +2 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +2 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +2 -2
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +2 -2
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js +1 -1
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js.map +2 -2
- package/dist/esm/biz-components/Features/index.d.ts +3 -2
- package/dist/esm/biz-components/FootCharger/index.d.ts +3 -2
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +3 -2
- package/dist/esm/biz-components/GiftBox/index.d.ts +3 -2
- package/dist/esm/biz-components/Graphic/index.d.ts +2 -2
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +2 -2
- package/dist/esm/biz-components/GraphicMore/index.d.ts +3 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/Countdown.d.ts +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +2 -2
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +2 -2
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js.map +2 -2
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +2 -2
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +3 -2
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/Ksp/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +2 -4
- package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/index.d.ts +1 -0
- package/dist/esm/biz-components/Listing/index.js +1 -1
- package/dist/esm/biz-components/Listing/index.js.map +3 -3
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +2 -2
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +3 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +3 -2
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +3 -2
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +2 -2
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +3 -2
- package/dist/esm/biz-components/MemberEquity/index.d.ts +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +1 -0
- package/dist/esm/biz-components/ProductCompare/index.d.ts +3 -2
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +2 -2
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +2 -2
- package/dist/esm/biz-components/SelectStore/index.d.ts +3 -2
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +2 -2
- package/dist/esm/biz-components/Slogan/index.d.ts +2 -2
- package/dist/esm/biz-components/Spacer/index.d.ts +2 -2
- package/dist/esm/biz-components/Specs/dropdown.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.js.map +2 -2
- package/dist/esm/biz-components/Specs/index.d.ts +2 -2
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +2 -2
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +2 -2
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +2 -2
- package/dist/esm/biz-components/TabsGroup/index.d.ts +2 -2
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +2 -2
- package/dist/esm/biz-components/TextMarquee/index.d.ts +3 -2
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +2 -2
- package/dist/esm/biz-components/Title/index.d.ts +2 -2
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +2 -2
- package/dist/esm/biz-components/VideoFeature/VideoFeature.js +1 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.js.map +2 -2
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +2 -2
- package/dist/esm/components/alert.d.ts +2 -2
- package/dist/esm/components/avatar.d.ts +8 -8
- package/dist/esm/components/container.d.ts +7 -7
- package/dist/esm/components/dialog.d.ts +1 -1
- package/dist/esm/components/drop-down.d.ts +3 -3
- package/dist/esm/components/input-number.d.ts +15 -15
- package/dist/esm/components/link.d.ts +6 -6
- package/dist/esm/components/tabs.d.ts +2 -2
- package/dist/esm/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/esm/shared/Styles.d.ts +2 -2
- package/dist/esm/stories/HeroBanner.stories.js +2 -2
- package/dist/esm/stories/HeroBanner.stories.js.map +2 -2
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/style.css +1 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["BizProductProvider_exports", "__export", "BizProductContext", "BizProductProvider_default", "useBizProductContext", "__toCommonJS", "import_jsx_runtime", "import_react", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "
|
|
4
|
+
"sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderInstallments?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,EAAA,YAAAC,GAAA,yBAAAC,IAAA,eAAAC,EAAAL,IAwOI,IAAAM,EAAA,6BAxOJC,EAQO,iBA2JA,MAAML,KAAoB,iBAAkC,CAAC,CAAuB,EAE9EE,EAAuB,IAAM,CAExC,GAAI,IADY,cAAWF,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,SAAO,cAAWA,CAAiB,CACrC,EAEMM,GAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,E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ACH,CAEJ,EAEA,IAAOX,GAAQK",
|
|
6
|
+
"names": ["BizProductProvider_exports", "__export", "BizProductContext", "BizProductProvider_default", "useBizProductContext", "__toCommonJS", "import_jsx_runtime", "import_react", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var X=Object.create;var y=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var se=(t,o)=>{for(var l in o)y(t,l,{get:o[l],enumerable:!0})},V=(t,o,l,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of te(o))!ne.call(t,a)&&a!==l&&y(t,a,{get:()=>o[a],enumerable:!(r=ee(o,a))||r.enumerable});return t};var A=(t,o,l)=>(l=t!=null?X(oe(t)):{},V(o||!t||!t.__esModule?y(l,"default",{value:t,enumerable:!0}):l,t)),ie=t=>V(y({},"__esModule",{value:!0}),t);var de={};se(de,{default:()=>pe});module.exports=ie(de);var e=require("react/jsx-runtime"),i=require("../../../../../components/index.js"),d=A(require("./ProductBenefitsTabs/index.js")),I=require("../../../BizProductProvider.js"),E=require("../../../hooks/useBenefits"),f=require("../../../utils/index.js"),N=require("../../../utils/textFormat"),T=require("react"),_=require("../../../../AiuiProvider/index.js"),z=A(require("../../../../../hooks/useCountDown.js")),G=A(require("../../../hooks/useCopy")),b=require("../../../../../helpers/index.js");const le={couponCode:"Code",copyCode:"Copy Code",copied:"Copied",expired:"Expired",offCoupon:"{discount} off coupon",offMemberOnly:"{amount} off Member Only",loginNow:"Login now",selectFreeGift:"You can select the free gift below.",bundleSaveUpTo:"Bundle purchases save extra up to",bundleOffer:"We offer {count} bundle for you",creditsTitle:"Soundcore credits for cash",creditsDesc:"100 Soundcore credits=$1",yourBenefits:"Your Benefits",off:" off",memberBenefits:"Member Benefits",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",memberBenefitsNotLoginText:"Sign Up to Get Benefits Below",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},re=({item:t,textConfig:o})=>{const{trackingData:l}=(0,_.useAiuiContext)(),{copied:r,copy:a}=(0,G.default)(),c=l?.common?.coupon,{days:x,hours:k,minutes:B,seconds:w}=(0,z.default)({endTime:t?.ends_at||""}),{openModal:C,isLogin:U}=(0,I.useBizProductContext)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{jsx:!0,children:`
|
|
2
2
|
.coupon-card {
|
|
3
3
|
/* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */
|
|
4
4
|
mask:
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
bottom left;
|
|
15
15
|
mask-repeat: no-repeat;
|
|
16
16
|
}
|
|
17
|
-
`}),(0,e.jsxs)("div",{style:{background:t.couponBgColor||"white"},className:(0,b.cn)("relative h-[100px] p-3 overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(i.Picture,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),(0,e.jsxs)("div",{className:"relative z-1 ",children:[(0,e.jsxs)("div",{className:"flex items-center justify-start",children:[t.useAble&&(0,e.jsx)(i.Checkbox,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:
|
|
17
|
+
`}),(0,e.jsxs)("div",{style:{background:t.couponBgColor||"white"},className:(0,b.cn)("relative h-[100px] p-3 overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&(0,e.jsx)(i.Picture,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),(0,e.jsxs)("div",{className:"relative z-1 ",children:[(0,e.jsxs)("div",{className:"flex items-center justify-start",children:[t.useAble&&(0,e.jsx)(i.Checkbox,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:L=>{t?.onUseChange?.(L)}}),(0,e.jsx)(i.Text,{html:t.title,className:"text-[16px] leading-[1.2] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),t.description&&(0,e.jsx)(i.Text,{...typeof t.description=="string"?{html:t.description}:{},as:"p",className:"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]",children:t.description}),t.code&&(0,e.jsxs)("div",{className:"desktop:mt-2 flex items-center gap-2",children:[(0,e.jsx)(i.Text,{html:`${o.couponCode}: ${t.code}`,className:"text-[14px] lg-desktop:text-[16px] font-bold text-[#3D3D3F]"}),(0,e.jsx)("button",{className:"text-[14px] lg-desktop:text-[16px] font-bold underline",onClick:()=>a(t.code??""),children:r?c?.copied||o.copied:c?.copy||o.copyCode})]}),t.ends_at&&(0,e.jsx)("button",{onClick:()=>{c?.modal&&C(c?.modal)},className:"lg-desktop:mt-[24px] text-brand-0 desktop:mt-4 mt-[14px] text-left text-[14px] font-bold lg-desktop:text-[16px] text-[#1F2021] md-l:hidden",children:Number(x)<Number(c?.hurry?.daysLeft)?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:c?.ends}),(0,e.jsx)("span",{className:"font-bold",children:` ${x} ${c?.days} ${k.toString().padStart(2,"0")}:${B.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`})]}):c?.hurry?.label||o.expired})]})]})]})},ae=({coupons:t,className:o,textConfig:l})=>(0,e.jsx)("div",{className:(0,b.cn)("flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1",o),children:t?.map((r,a)=>(0,e.jsx)(re,{item:r,textConfig:l},a))}),ce=({textConfig:t})=>{const{isLogin:o,profile:l,variant:r,renderInstallments:a,onUseCouponChange:c,onUseMemberDiscountChange:x,discount:k,savingDetail:B,openModal:w,openSignInPopup:C,openAuthCodePopup:U,openSignUpPopup:L}=(0,I.useBizProductContext)(),O=(0,E.useBenefits)({variant:r}),[M,j]=(0,T.useState)("coupon"),{trackingData:Z,locale:m="us",copyWriting:W}=(0,_.useAiuiContext)(),S=(0,T.useRef)(null),n={...le,...t},{activated:Y=!1}=l||{},{memberDiscount:u,commonCoupon:g,creditsRedemption:h,freeGift:R,bundle:D,paidShipping:q,fullGift:F,levelDiscount:P}=O,J=Z?.product?.support??{},{thirdParty:ue={}}=Z?.common||{},v=[g?.enable?{...g.config,isAutoUse:B?.coupon>0,useAble:!0,borderStyle:"rounded",code:g?.config?.title??"",description:g?.config?.desc??"",onUseChange:s=>{const p=s?k?.codeSavings??0:0;c?.(p)},title:(0,N.replaceTemplate)(n.offCoupon,{discount:g?.config?.value_type=="percentage"?Math.abs(Number(g?.config?.value||0))+"%":(0,f.formatPrice)({amount:Math.abs(Number(g?.config?.fixed_value||0)),currencyCode:r.price.currencyCode,locale:m})})}:null,u.enable?{useAble:!0,isAutoUse:o,title:(0,N.replaceTemplate)(n.offMemberOnly,{amount:(0,f.formatPrice)({amount:u?.config?.amount??0,currencyCode:r.price.currencyCode,locale:m})}),description:(0,e.jsxs)(e.Fragment,{children:[o?u?.config?.description??"":n.memberBenefitsNotLogin.replace("{amount}",(0,f.formatPrice)({amount:u?.config?.amount??0,currencyCode:r.price.currencyCode,locale:m}))??""," ",o?"":(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>C?.(),className:"underline",children:n.loginNow})]}),borderStyle:"rounded",onUseChange:s=>{if(o){const p=s?u?.config?.amount??0:0;x?.(p)}else C?.()}}:null,P.enable?{title:P?.config?.title??"",description:P?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,R.enable?{title:R?.config?.title??"",description:n.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,D.enable?{title:`${n.bundleSaveUpTo} ${(0,f.formatPrice)({amount:Math.max(...D?.config?.bundleList?.map(s=>s.savings??0)??[]),currencyCode:r.price.currencyCode,locale:m})}`,borderStyle:"inset",description:n.bundleOffer.replace("{count}",D?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,F.enable?{title:F?.config?.title??"",description:F?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,h.enable?{title:n.creditsTitle,description:n.creditsDesc,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean),K=()=>{U?.()};if(!d.default)return null;const H=s=>{if(S.current){const p=S.current,$=s.currentTarget,Q=$.offsetLeft-p.offsetWidth/2+$.offsetWidth/2;p.scrollTo({left:Q,behavior:"smooth"})}};return(0,e.jsxs)(d.default,{onValueChange:s=>j(s),defaultValue:v?.length?"coupon":"membership",children:[(0,e.jsxs)(d.default.List,{ref:S,children:[v?.length?(0,e.jsx)(d.default.Trigger,{className:(0,b.cn)(M==="coupon"&&"text-[#1D1D1F]"),value:"coupon",onClick:H,children:n.yourBenefits}):null,(0,e.jsx)(d.default.Trigger,{className:(0,b.cn)(M==="membership"&&"text-[#1D1D1F]"),value:"membership",onClick:H,children:n.memberBenefits}),(0,e.jsx)(d.default.Trigger,{className:(0,b.cn)(M==="installment"&&"text-[#1D1D1F]"),value:"installment",onClick:H,children:n.installment})]}),(0,e.jsx)("style",{global:!0,jsx:!0,children:`
|
|
18
18
|
.benefits-tabs-content::-webkit-scrollbar {
|
|
19
19
|
width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */
|
|
20
20
|
height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
.benefits-tabs-content::-webkit-scrollbar-thumb:hover {
|
|
33
33
|
background-color: rgba(100, 100, 100, 0.6);
|
|
34
34
|
}
|
|
35
|
-
`}),v?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]",children:(0,e.jsx)("div",{className:"p-3 lg-desktop:p-4",children:(0,e.jsx)(
|
|
35
|
+
`}),v?.length?(0,e.jsx)(d.default.Content,{value:"coupon",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]",children:(0,e.jsx)("div",{className:"p-3 lg-desktop:p-4",children:(0,e.jsx)(ae,{coupons:v,className:"",textConfig:n})})}):null,(0,e.jsx)(d.default.Content,{value:"membership",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]",children:(0,e.jsxs)("div",{className:"p-3 lg-desktop:p-4",children:[!o&&(0,e.jsx)("h3",{className:"mb-2 text-left text-lg font-bold",children:n.memberBenefitsNotLoginText}),(0,e.jsx)("div",{className:`rounded-[16px] ${o?"max-h-[240px]":"max-h-[160px]"}`,children:(0,e.jsxs)("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
|
|
36
36
|
[&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2
|
|
37
37
|
[&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4
|
|
38
38
|
[&_li]:py-4
|
|
39
|
-
[&_li]:text-left`,children:[u.enable&&(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-bold x:text-[14px]",children:(0,N.replaceTemplate)(n.forNewMember,{amount:(0,
|
|
39
|
+
[&_li]:text-left`,children:[u.enable&&(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-bold x:text-[14px]",children:(0,N.replaceTemplate)(n.forNewMember,{amount:(0,f.formatPrice)({amount:u?.config?.amount??0,currencyCode:r.price.currencyCode,locale:m})})})]}),J.items?.map((s,p)=>s.modalText?(0,e.jsx)("li",{children:(0,e.jsxs)("button",{onClick:()=>w?.({title:s.text,content:s.modalText}),className:"flex",children:[(0,e.jsx)(i.Picture,{source:s.icon,alt:s.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{className:"text-left text-[16px] font-bold x:text-[14px]",children:s.text})]},p)},p):(0,e.jsxs)("li",{className:"flex",children:[(0,e.jsx)(i.Picture,{source:s.icon,alt:s.text,className:"mr-[8px] size-[20px] shrink-0"}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-bold x:text-[14px]",children:s.text})]},p)),q.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-bold x:text-[14px]",children:n.expressShipping})]}):null,h.enable?(0,e.jsxs)("li",{children:[(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),(0,e.jsx)(i.Text,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:Y?h?.config?.label?.replace("{{amount}}",(0,f.formatPrice)({amount:h?.config?.amount??0,currencyCode:r.price.currencyCode,locale:m})):(0,e.jsxs)(e.Fragment,{children:[n.creditsAfterActivation,(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:()=>K(),className:"underline",children:n.active})]})})]}):null]})}),!o&&(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(i.Button,{variant:"primary",className:"w-full",onClick:()=>L?.(),children:W?.signUp})})]})}),(0,e.jsx)(d.default.Content,{value:"installment",className:"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px] ",children:(0,e.jsxs)("div",{className:"p-3 lg-desktop:p-4",children:[(0,e.jsx)(i.Heading,{size:2,className:"mb-2 text-left text-lg font-bold",children:n.flexibleInstallment}),(0,e.jsx)("div",{className:"overflow-hidden rounded-[16px] p-3 lg-desktop:p-4 bg-white",children:a})]})})]})};var pe=ce;
|
|
40
40
|
//# sourceMappingURL=BenefitsTab.js.map
|
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { Button, Checkbox, Text, Picture, Heading } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\nimport React, { useRef, useState } from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy'\nimport { cn } from '../../../../../helpers/index.js'\n// \u6587\u6848\u914D\u7F6E\u63A5\u53E3\ninterface BenefitsTabTextConfig {\n // Coupon \u76F8\u5173\n couponCode?: string // \"Code\"\n copyCode?: string // \"Copy Code\"\n copied?: string // \"Copied\"\n expired?: string // \"Expired\"\n offCoupon?: string // \"off coupon\"\n offMemberOnly?: string // \"{amount} off Member Only\"\n loginNow?: string // \"login now\"\n selectFreeGift?: string // \"You can select the free gift below.\"\n bundleSaveUpTo?: string // \"Bundle purchases save extra up to\"\n bundleOffer?: string // \"We offer {count} bundle for you\"\n creditsTitle?: string // \"Soundcore credits for cash\"\n creditsDesc?: string // \"100 Soundcore credits=$1\"\n\n // Tab \u6807\u7B7E\n yourBenefits?: string // \"Your Benefits\"\n off?: string // \"off\"\n memberBenefits?: string // \"Member Benefits\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n memberBenefitsNotLoginText?: string //\n installment?: string // \"Installment\"\n\n // Member Benefits \u90E8\u5206\n forNewMember?: string // \"for New Member\"\n expressShipping?: string // \"Express Shipping Method\"\n creditsAfterActivation?: string // \"You will get soundcoreCredits after activation.\"\n active?: string // \"Active\"\n\n // Installment \u90E8\u5206\n flexibleInstallment?: string // \"Flexible installment payment\"\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\ninterface BenefitsTabProps {\n textConfig?: BenefitsTabTextConfig\n}\n\n// \u9ED8\u8BA4\u6587\u6848\u914D\u7F6E\nconst defaultTextConfig: Required<BenefitsTabTextConfig> = {\n couponCode: 'Code',\n copyCode: 'Copy Code',\n copied: 'Copied',\n expired: 'Expired',\n offCoupon: '{discount} off coupon',\n offMemberOnly: '{amount} off Member Only',\n loginNow: 'Login now',\n selectFreeGift: 'You can select the free gift below.',\n bundleSaveUpTo: 'Bundle purchases save extra up to',\n bundleOffer: 'We offer {count} bundle for you',\n creditsTitle: 'Soundcore credits for cash',\n creditsDesc: '100 Soundcore credits=$1',\n yourBenefits: 'Your Benefits',\n off: ' off',\n memberBenefits: 'Member Benefits',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n memberBenefitsNotLoginText: 'Sign Up to Get Benefits Below',\n installment: 'Installment',\n forNewMember: '{amount} for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => void\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n couponBgColor?: string\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal, isLogin } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n style={{\n background: item.couponBgColor || 'white',\n }}\n className={cn(\n 'relative h-[100px] p-3 overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\n )}\n >\n {item?.bgImage?.url && (\n <Picture\n source={item.bgImage.url}\n alt={item.bgImage.alt}\n className=\"absolute bottom-0 right-0 w-auto\"\n imgClassName=\"object-contain\"\n />\n )}\n <div className=\"relative z-1 \">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n size=\"lg\"\n className=\"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary\"\n checked={item?.isAutoUse}\n onCheckedChange={(e: boolean) => {\n item?.onUseChange?.(e)\n }}\n />\n )}\n <Text html={item.title} className=\"text-[16px] leading-[1.2] font-bold laptop:text-[20px] lg-desktop:text-[24px]\" />\n </div>\n {item.description && (\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]\"\n >\n {item.description}\n </Text>\n )}\n {item.code && (\n <div className=\"desktop:mt-2 flex items-center gap-2\">\n <Text html={`${textConfig.couponCode}: ${item.code}`} className=\"text-[14px] lg-desktop:text-[16px] font-bold text-[#3D3D3F]\" />\n <button className=\"text-[14px] lg-desktop:text-[16px] font-bold underline\" onClick={() => copyToClipboard(item.code ?? '')}>\n {isCopied ? couponCopy?.copied || textConfig.copied : couponCopy?.copy || textConfig.copyCode}\n </button>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"lg-desktop:mt-[24px] desktop:mt-4 mt-[14px] text-left text-[14px] font-bold lg-desktop:text-[16px] text-[#1F2021] md-l:hidden\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${couponCopy?.days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || textConfig.expired\n )} \n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig> }) => {\n return (\n <div className={cn('flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1', className)}>\n {coupons?.map((item, index) => (\n <CouponItem key={index} item={item} textConfig={textConfig} />\n ))}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n isLogin,\n profile,\n variant,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<'coupon' | 'membership' | 'installment'>(\n 'coupon'\n )\n const { trackingData, locale = 'us', copyWriting } = useAiuiContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const productsBenefits = trackingData?.product?.support ?? {}\n const { thirdParty = {} } = trackingData?.common || {}\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: savingDetail?.coupon > 0,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n onUseChange: (value: boolean) => {\n const couponSaving = value ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n },\n title: replaceTemplate(mergedTextConfig.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n }\n : null,\n memberDiscount.enable\n ? {\n useAble: true,\n isAutoUse: isLogin,\n title: replaceTemplate(mergedTextConfig.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {isLogin\n ? (memberDiscount?.config?.description ?? '')\n : (mergedTextConfig.memberBenefitsNotLogin.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {isLogin ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {mergedTextConfig.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (isLogin) {\n const memberSaving = value ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n // setSavingDetail(prev => ({\n // ...prev,\n // member: value ? (memberDiscount?.config?.amount ?? 0) : 0,\n // }))\n } else {\n openSignInPopup?.()\n }\n },\n }\n : null,\n levelDiscount.enable\n ? {\n title: levelDiscount?.config?.title ?? '',\n description: levelDiscount?.config?.tag ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385',\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: mergedTextConfig.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n bundle.enable\n ? {\n title: `${mergedTextConfig.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: mergedTextConfig.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n creditsRedemption.enable\n ? {\n title: mergedTextConfig.creditsTitle,\n description: mergedTextConfig.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n ].filter(Boolean)\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n const handleProductBenefitsTabListClick = (el: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n\n return (\n <ProductBenefitsTabs\n onValueChange={value => setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'installment')}\n defaultValue={coupons?.length ? 'coupon' : 'membership'}\n >\n <ProductBenefitsTabs.List ref={scrollContainerRef}>\n {coupons?.length ? (\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'coupon' && 'text-[#1D1D1F]')}\n value=\"coupon\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.yourBenefits}\n {/* {(savingDetail.coupon || 0) > 0 && (\n <ProductBenefitsTabs.Badge>\n {commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n {mergedTextConfig.off}\n </ProductBenefitsTabs.Badge>\n )} */}\n </ProductBenefitsTabs.Trigger>\n ) : null}\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'membership' && 'text-[#1D1D1F]')}\n value=\"membership\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.memberBenefits}\n </ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'installment' && 'text-[#1D1D1F]')}\n value=\"installment\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.installment}\n </ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .benefits-tabs-content::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content\n value=\"coupon\"\n className=\"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]\"\n >\n <div className=\"p-3 lg-desktop:p-4\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n className=\"\"\n textConfig={mergedTextConfig}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n\n <ProductBenefitsTabs.Content\n value=\"membership\"\n className=\"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]\"\n >\n <div className=\"p-3 lg-desktop:p-4 \">\n {!isLogin && (\n <h3 className=\"mb-2 text-left text-lg font-bold\">{mergedTextConfig.memberBenefitsNotLoginText}</h3>\n )}\n <div className={`rounded-[16px] ${isLogin ? 'max-h-[240px]' : 'max-h-[160px]'}`}>\n <ul\n className={`list-none [&_li:first-child]:rounded-t-[16px] \n [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2\n [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4\n [&_li]:py-4 \n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {replaceTemplate(mergedTextConfig.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </li>\n )}\n {productsBenefits.items?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index}>\n <button\n onClick={() => openModal?.({ title: item.text, content: item.modalText })}\n key={index}\n className=\"flex\"\n >\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text className=\"text-left text-[16px] font-bold x:text-[14px]\">{item.text}</Text>\n </button>\n </li>\n ) : (\n <li key={index} className=\"flex\">\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {item.text}\n </Text>\n </li>\n )\n )}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {mergedTextConfig.expressShipping}\n </Text>\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {activated ? (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n ) : (\n <>\n {mergedTextConfig.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {mergedTextConfig.active}\n </span>\n </>\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!isLogin && (\n <div className=\"px-4 pt-4\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content\n value=\"installment\"\n className=\"benefits-tabs-content overflow-y-auto px-4 lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px] \"\n >\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {mergedTextConfig.flexibleInstallment}\n </Heading>\n <div className=\"overflow-hidden rounded-[16px] bg-white\">\n {renderAffirm}\n {renderKlarna}\n {renderPaypal}\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nexport default BenefitsTab\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_BizProductProvider", "import_useBenefits", "import_utils", "import_textFormat", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "import_helpers", "defaultTextConfig", "CouponItem", "item", "textConfig", "trackingData", "isCopied", "copyToClipboard", "useCopy", "couponCopy", "days", "hours", "minutes", "seconds", "useCountDown", "openModal", "isLogin", "e", "CouponContent", "coupons", "className", "index", "BenefitsTab", "profile", "variant", "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { Button, Checkbox, Text, Picture, Heading } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\nimport React, { useRef, useState } from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy'\nimport { cn } from '../../../../../helpers/index.js'\n// \u6587\u6848\u914D\u7F6E\u63A5\u53E3\ninterface BenefitsTabTextConfig {\n // Coupon \u76F8\u5173\n couponCode?: string // \"Code\"\n copyCode?: string // \"Copy Code\"\n copied?: string // \"Copied\"\n expired?: string // \"Expired\"\n offCoupon?: string // \"off coupon\"\n offMemberOnly?: string // \"{amount} off Member Only\"\n loginNow?: string // \"login now\"\n selectFreeGift?: string // \"You can select the free gift below.\"\n bundleSaveUpTo?: string // \"Bundle purchases save extra up to\"\n bundleOffer?: string // \"We offer {count} bundle for you\"\n creditsTitle?: string // \"Soundcore credits for cash\"\n creditsDesc?: string // \"100 Soundcore credits=$1\"\n\n // Tab \u6807\u7B7E\n yourBenefits?: string // \"Your Benefits\"\n off?: string // \"off\"\n memberBenefits?: string // \"Member Benefits\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n memberBenefitsNotLoginText?: string //\n installment?: string // \"Installment\"\n\n // Member Benefits \u90E8\u5206\n forNewMember?: string // \"for New Member\"\n expressShipping?: string // \"Express Shipping Method\"\n creditsAfterActivation?: string // \"You will get soundcoreCredits after activation.\"\n active?: string // \"Active\"\n\n // Installment \u90E8\u5206\n flexibleInstallment?: string // \"Flexible installment payment\"\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\ninterface BenefitsTabProps {\n textConfig?: BenefitsTabTextConfig\n}\n\n// \u9ED8\u8BA4\u6587\u6848\u914D\u7F6E\nconst defaultTextConfig: Required<BenefitsTabTextConfig> = {\n couponCode: 'Code',\n copyCode: 'Copy Code',\n copied: 'Copied',\n expired: 'Expired',\n offCoupon: '{discount} off coupon',\n offMemberOnly: '{amount} off Member Only',\n loginNow: 'Login now',\n selectFreeGift: 'You can select the free gift below.',\n bundleSaveUpTo: 'Bundle purchases save extra up to',\n bundleOffer: 'We offer {count} bundle for you',\n creditsTitle: 'Soundcore credits for cash',\n creditsDesc: '100 Soundcore credits=$1',\n yourBenefits: 'Your Benefits',\n off: ' off',\n memberBenefits: 'Member Benefits',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n memberBenefitsNotLoginText: 'Sign Up to Get Benefits Below',\n installment: 'Installment',\n forNewMember: '{amount} for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => void\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n couponBgColor?: string\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal, isLogin } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n style={{\n background: item.couponBgColor || 'white',\n }}\n className={cn(\n 'relative h-[100px] p-3 overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\n )}\n >\n {item?.bgImage?.url && (\n <Picture\n source={item.bgImage.url}\n alt={item.bgImage.alt}\n className=\"absolute bottom-0 right-0 w-auto\"\n imgClassName=\"object-contain\"\n />\n )}\n <div className=\"relative z-1 \">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n size=\"lg\"\n className=\"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary\"\n checked={item?.isAutoUse}\n onCheckedChange={(e: boolean) => {\n item?.onUseChange?.(e)\n }}\n />\n )}\n <Text html={item.title} className=\"text-[16px] leading-[1.2] font-bold laptop:text-[20px] lg-desktop:text-[24px]\" />\n </div>\n {item.description && (\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]\"\n >\n {item.description}\n </Text>\n )}\n {item.code && (\n <div className=\"desktop:mt-2 flex items-center gap-2\">\n <Text html={`${textConfig.couponCode}: ${item.code}`} className=\"text-[14px] lg-desktop:text-[16px] font-bold text-[#3D3D3F]\" />\n <button className=\"text-[14px] lg-desktop:text-[16px] font-bold underline\" onClick={() => copyToClipboard(item.code ?? '')}>\n {isCopied ? couponCopy?.copied || textConfig.copied : couponCopy?.copy || textConfig.copyCode}\n </button>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"lg-desktop:mt-[24px] text-brand-0 desktop:mt-4 mt-[14px] text-left text-[14px] font-bold lg-desktop:text-[16px] text-[#1F2021] md-l:hidden\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${couponCopy?.days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || textConfig.expired\n )} \n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig> }) => {\n return (\n <div className={cn('flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1', className)}>\n {coupons?.map((item, index) => (\n <CouponItem key={index} item={item} textConfig={textConfig} />\n ))}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n isLogin,\n profile,\n variant,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<'coupon' | 'membership' | 'installment'>(\n 'coupon'\n )\n const { trackingData, locale = 'us', copyWriting } = useAiuiContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const productsBenefits = trackingData?.product?.support ?? {}\n const { thirdParty = {} } = trackingData?.common || {}\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: savingDetail?.coupon > 0,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n onUseChange: (value: boolean) => {\n const couponSaving = value ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n },\n title: replaceTemplate(mergedTextConfig.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n }\n : null,\n memberDiscount.enable\n ? {\n useAble: true,\n isAutoUse: isLogin,\n title: replaceTemplate(mergedTextConfig.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {isLogin\n ? (memberDiscount?.config?.description ?? '')\n : (mergedTextConfig.memberBenefitsNotLogin.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {isLogin ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {mergedTextConfig.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (isLogin) {\n const memberSaving = value ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n // setSavingDetail(prev => ({\n // ...prev,\n // member: value ? (memberDiscount?.config?.amount ?? 0) : 0,\n // }))\n } else {\n openSignInPopup?.()\n }\n },\n }\n : null,\n levelDiscount.enable\n ? {\n title: levelDiscount?.config?.title ?? '',\n description: levelDiscount?.config?.tag ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385',\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: mergedTextConfig.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n bundle.enable\n ? {\n title: `${mergedTextConfig.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: mergedTextConfig.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n creditsRedemption.enable\n ? {\n title: mergedTextConfig.creditsTitle,\n description: mergedTextConfig.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n ].filter(Boolean)\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n const handleProductBenefitsTabListClick = (el: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n\n return (\n <ProductBenefitsTabs\n onValueChange={value => setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'installment')}\n defaultValue={coupons?.length ? 'coupon' : 'membership'}\n >\n <ProductBenefitsTabs.List ref={scrollContainerRef}>\n {coupons?.length ? (\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'coupon' && 'text-[#1D1D1F]')}\n value=\"coupon\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.yourBenefits}\n {/* {(savingDetail.coupon || 0) > 0 && (\n <ProductBenefitsTabs.Badge>\n {commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n {mergedTextConfig.off}\n </ProductBenefitsTabs.Badge>\n )} */}\n </ProductBenefitsTabs.Trigger>\n ) : null}\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'membership' && 'text-[#1D1D1F]')}\n value=\"membership\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.memberBenefits}\n </ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'installment' && 'text-[#1D1D1F]')}\n value=\"installment\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.installment}\n </ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .benefits-tabs-content::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .benefits-tabs-content::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content\n value=\"coupon\"\n className=\"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]\"\n >\n <div className=\"p-3 lg-desktop:p-4\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n className=\"\"\n textConfig={mergedTextConfig}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n\n <ProductBenefitsTabs.Content\n value=\"membership\"\n className=\"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px]\"\n >\n <div className=\"p-3 lg-desktop:p-4\">\n {!isLogin && (\n <h3 className=\"mb-2 text-left text-lg font-bold\">{mergedTextConfig.memberBenefitsNotLoginText}</h3>\n )}\n <div className={`rounded-[16px] ${isLogin ? 'max-h-[240px]' : 'max-h-[160px]'}`}>\n <ul\n className={`list-none [&_li:first-child]:rounded-t-[16px] \n [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2\n [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4\n [&_li]:py-4 \n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {replaceTemplate(mergedTextConfig.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </li>\n )}\n {productsBenefits.items?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index}>\n <button\n onClick={() => openModal?.({ title: item.text, content: item.modalText })}\n key={index}\n className=\"flex\"\n >\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text className=\"text-left text-[16px] font-bold x:text-[14px]\">{item.text}</Text>\n </button>\n </li>\n ) : (\n <li key={index} className=\"flex\">\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {item.text}\n </Text>\n </li>\n )\n )}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-bold x:text-[14px]\">\n {mergedTextConfig.expressShipping}\n </Text>\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {activated ? (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n ) : (\n <>\n {mergedTextConfig.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {mergedTextConfig.active}\n </span>\n </>\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!isLogin && (\n <div className=\"px-4 pt-4\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content\n value=\"installment\"\n className=\"benefits-tabs-content overflow-y-auto lg-desktop:h-[240px] desktop:h-[196px] h-[180px] laptop:h-[220px] \"\n >\n <div className=\"p-3 lg-desktop:p-4\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {mergedTextConfig.flexibleInstallment}\n </Heading>\n <div className=\"overflow-hidden rounded-[16px] p-3 lg-desktop:p-4 bg-white\">{renderInstallments}</div>\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nexport default BenefitsTab\n"],
|
|
5
|
+
"mappings": "okBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAqHM,IAAAI,EAAA,6BApHNC,EAAyD,8CACzDC,EAAgC,6CAChCC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EJ,EACF,KAEA,OAAC,EAAAkB,QAAoB,QAApB,CACC,MAAM,cACN,UAAU,2GAEV,oBAAC,OAAI,UAAU,qBACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,mCACzB,SAAAhB,EAAiB,oBACpB,KACA,OAAC,OAAI,UAAU,6DAA8D,SAAAd,EAAmB,GAClG,EACF,GACF,CAEJ,EAEA,IAAOtC,GAAQmC",
|
|
6
|
+
"names": ["BenefitsTab_exports", "__export", "BenefitsTab_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_ProductBenefitsTabs", "import_BizProductProvider", "import_useBenefits", "import_utils", "import_textFormat", "import_react", "import_AiuiProvider", "import_useCountDown", "import_useCopy", "import_helpers", "defaultTextConfig", "CouponItem", "item", "textConfig", "trackingData", "isCopied", "copyToClipboard", "useCopy", "couponCopy", "days", "hours", "minutes", "seconds", "useCountDown", "openModal", "isLogin", "e", "CouponContent", "coupons", "className", "index", "BenefitsTab", "profile", "variant", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "benefits", "productBenefitsTabsValue", "setProductBenefitsTabsValue", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "productsBenefits", "thirdParty", "value", "couponSaving", "memberSaving", "handleActivate", "ProductBenefitsTabs", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft"]
|
|
7
7
|
}
|
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var z=(r,a)=>{for(var l in a)n(r,l,{get:a[l],enumerable:!0})},L=(r,a,l,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of D(a))!O.call(r,o)&&o!==l&&n(r,o,{get:()=>a[o],enumerable:!(s=P(a,o))||s.enumerable});return r};var E=r=>L(n({},"__esModule",{value:!0}),r);var S={};z(S,{default:()=>F});module.exports=E(S);var t=require("react/jsx-runtime"),d=require("../../../../../../components"),p=require("../../../../../../helpers/index.js"),v=require("../../../../../AiuiProvider"),x=require("../../../../BizProductProvider.js"),u=require("../../../../utils");const w=()=>{const{locale:r="us"}=(0,v.useAiuiContext)(),{variant:a,bundle:l,checkedBundle:s,setCheckedBundle:o,setCheckedGift:g,savingDetail:h,setSavingDetail:k,setCheckedExchangePurchase:y,setJoinedRecommendBuyProducts:m,joinedRecommendBuyProducts:j}=(0,x.useBizProductContext)(),{title:C,bundleList:N,showAtListing:B}=l||{},f=N?.filter(e=>e.variants.slice(1,e.variants.length).every(c=>c.variant.availableForSale));if(!f?.length&&B)return null;const b=e=>{s?.id===e.id?(o?.(void 0),m?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:void 0,canOperate:!0}})):(g?.(void 0),y?.(void 0),o?.(e),k?.({...h,exchangePurchase:0}),m?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:e,canOperate:!1}}))};return(0,t.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,t.jsx)(d.Text,{size:3,className:"font-bold",html:C}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 mt-3 desktop:grid-cols-1 desktop:mt-4",children:f?.map(e=>{const c=e.variants.filter(i=>i.variant.sku!==a.sku);return(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":s?.id===e.id}),children:[(0,t.jsx)(d.Checkbox,{onCheckedChange:()=>b(e),size:"lg",className:(0,p.cn)("rounded-full border-[#D1D1D1] border-[
|
|
1
|
+
"use strict";var n=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var z=(r,a)=>{for(var l in a)n(r,l,{get:a[l],enumerable:!0})},L=(r,a,l,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of D(a))!O.call(r,o)&&o!==l&&n(r,o,{get:()=>a[o],enumerable:!(s=P(a,o))||s.enumerable});return r};var E=r=>L(n({},"__esModule",{value:!0}),r);var S={};z(S,{default:()=>F});module.exports=E(S);var t=require("react/jsx-runtime"),d=require("../../../../../../components"),p=require("../../../../../../helpers/index.js"),v=require("../../../../../AiuiProvider"),x=require("../../../../BizProductProvider.js"),u=require("../../../../utils");const w=()=>{const{locale:r="us"}=(0,v.useAiuiContext)(),{variant:a,bundle:l,checkedBundle:s,setCheckedBundle:o,setCheckedGift:g,savingDetail:h,setSavingDetail:k,setCheckedExchangePurchase:y,setJoinedRecommendBuyProducts:m,joinedRecommendBuyProducts:j}=(0,x.useBizProductContext)(),{title:C,bundleList:N,showAtListing:B}=l||{},f=N?.filter(e=>e.variants.slice(1,e.variants.length).every(c=>c.variant.availableForSale));if(!f?.length&&B)return null;const b=e=>{s?.id===e.id?(o?.(void 0),m?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:void 0,canOperate:!0}})):(g?.(void 0),y?.(void 0),o?.(e),k?.({...h,exchangePurchase:0}),m?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:e,canOperate:!1}}))};return(0,t.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,t.jsx)(d.Text,{size:3,className:"font-bold",html:C}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 mt-3 desktop:grid-cols-1 desktop:mt-4",children:f?.map(e=>{const c=e.variants.filter(i=>i.variant.sku!==a.sku);return(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:(0,p.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":s?.id===e.id}),children:[(0,t.jsx)(d.Checkbox,{onCheckedChange:()=>b(e),size:"lg",className:(0,p.cn)("rounded-full border-[#D1D1D1] border-[2px]",{"border-brand":s?.id===e.id}),id:e.id,value:e.id,checked:s?.id===e.id}),(0,t.jsx)("label",{htmlFor:e.id,className:"size-full cursor-pointer py-6",children:c?.map(i=>(0,t.jsxs)("div",{className:"flex justify-between items-center gap-6 ",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Picture,{source:i?.variant?.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(d.Text,{className:"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold",html:i.variant.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0",children:[(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold",html:(0,u.formatPrice)({amount:i.price,locale:r,currencyCode:i.variant.price.currencyCode})}),i.price<i.variant.price.amount&&(0,t.jsx)(d.Text,{className:"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,u.formatPrice)({amount:i.variant.price.amount,locale:r,currencyCode:i.variant.price.currencyCode})})]})]},i.variant.id))})]})},e.id)})})]})};var F=w;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture, Button, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport type { BundleListItem } from '../../../../types/product'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n } else {\n setCheckedGift?.(undefined)\n setCheckedExchangePurchase?.(undefined)\n setCheckedBundle?.(bundleItem)\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n }\n }\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 mt-3 desktop:grid-cols-1 desktop:mt-4\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,G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Z,SAAAG,GAAqB,IAAIZ,GAAU,CAClC,MAAMgB,EAAiBhB,EAAO,SAAS,OAAOa,GAAKA,EAAE,QAAQ,MAAQd,EAAQ,GAAG,EAChF,SACE,OAAC,OACC,oBAAC,OACC,aAAW,MACT,yFACA,CACG,eAAiBE,GAAe,KAAOD,EAAO,EACjD,CACF,EAEA,oBAAC,YACC,gBAAiB,IAAMc,EAAqBd,CAAM,EAClD,KAAK,KACL,aAAW,MAAG
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport type { BundleListItem } from '../../../../types/product'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n } else {\n setCheckedGift?.(undefined)\n setCheckedExchangePurchase?.(undefined)\n setCheckedBundle?.(bundleItem)\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n }\n }\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 mt-3 desktop:grid-cols-1 desktop:mt-4\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[2px]', {\n 'border-brand': checkedBundle?.id === bundle.id,\n })}\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full cursor-pointer py-6\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex justify-between items-center gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture source={bundleVariant?.variant?.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n <div className=\"flex items-center justify-end gap-1 laptop:flex-row flex-col shrink-0\">\n <Text\n className=\"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>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OX,EAAQQ",
|
|
6
6
|
"names": ["ProductBundle_exports", "__export", "ProductBundle_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_AiuiProvider", "import_BizProductProvider", "import_utils", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "savingDetail", "setSavingDetail", "setCheckedExchangePurchase", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "bundleVariants", "bundleVariant"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var c in t)n(r,c,{get:t[c],enumerable:!0})},D=(r,t,c,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of C(t))!N.call(r,d)&&d!==c&&n(r,d,{get:()=>t[d],enumerable:!(l=k(t,d))||l.enumerable});return r};var E=r=>D(n({},"__esModule",{value:!0}),r);var z={};y(z,{default:()=>B});module.exports=E(z);var a=require("react/jsx-runtime"),o=require("../../../../../../components"),i=require("../../../../../../helpers/index.js"),x=require("react"),h=require("../../../../BizProductProvider.js"),s=require("../../../../utils"),f=require("../../../../../AiuiProvider");const O=()=>{const{locale:r="us"}=(0,f.useAiuiContext)(),{checkedExchangePurchase:t,exchangePurchase:c,setCheckedBundle:l,setJoinedRecommendBuyProducts:d,setSavingDetail:b,setCheckedExchangePurchase:u,joinedRecommendBuyProducts:R,savingDetail:P}=(0,h.useBizProductContext)(),{title:v,giftList:p=[],freeLabel:w}=c||{},m=(0,x.useMemo)(()=>p?.filter(e=>e.availableForSale),[p]),g=e=>{t?.id===e.id?(u?.(void 0),d?.({gift:{value:void 0,canOperate:!0},bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),b?.({...P,exchangePurchase:0})):(l?.(void 0),u?.(e),d?.({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:e,canOperate:!1}}))};return m?.length?(0,a.jsxs)("div",{className:"ipc-product-detail-exchange-purchase",children:[(0,a.jsx)(o.Text,{size:3,className:"font-bold",html:v}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4",children:m.map(e=>(0,a.jsxs)("div",{className:(0,i.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":t?.id===e.id}),children:[(0,a.jsx)(o.Checkbox,{onCheckedChange:()=>g(e),size:"lg",className:(0,i.cn)("rounded-full border-[#D1D1D1] border-[
|
|
1
|
+
"use strict";var n=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var c in t)n(r,c,{get:t[c],enumerable:!0})},D=(r,t,c,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of C(t))!N.call(r,d)&&d!==c&&n(r,d,{get:()=>t[d],enumerable:!(l=k(t,d))||l.enumerable});return r};var E=r=>D(n({},"__esModule",{value:!0}),r);var z={};y(z,{default:()=>B});module.exports=E(z);var a=require("react/jsx-runtime"),o=require("../../../../../../components"),i=require("../../../../../../helpers/index.js"),x=require("react"),h=require("../../../../BizProductProvider.js"),s=require("../../../../utils"),f=require("../../../../../AiuiProvider");const O=()=>{const{locale:r="us"}=(0,f.useAiuiContext)(),{checkedExchangePurchase:t,exchangePurchase:c,setCheckedBundle:l,setJoinedRecommendBuyProducts:d,setSavingDetail:b,setCheckedExchangePurchase:u,joinedRecommendBuyProducts:R,savingDetail:P}=(0,h.useBizProductContext)(),{title:v,giftList:p=[],freeLabel:w}=c||{},m=(0,x.useMemo)(()=>p?.filter(e=>e.availableForSale),[p]),g=e=>{t?.id===e.id?(u?.(void 0),d?.({gift:{value:void 0,canOperate:!0},bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),b?.({...P,exchangePurchase:0})):(l?.(void 0),u?.(e),d?.({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:e,canOperate:!1}}))};return m?.length?(0,a.jsxs)("div",{className:"ipc-product-detail-exchange-purchase",children:[(0,a.jsx)(o.Text,{size:3,className:"font-bold",html:v}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4",children:m.map(e=>(0,a.jsxs)("div",{className:(0,i.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":t?.id===e.id}),children:[(0,a.jsx)(o.Checkbox,{onCheckedChange:()=>g(e),size:"lg",className:(0,i.cn)("rounded-full border-[#D1D1D1] border-[2px]",{"border-brand":t?.id===e.id}),id:e.id,checked:t?.id===e.id,value:e.id}),(0,a.jsxs)("label",{htmlFor:e.id,className:"flex py-6 cursor-pointer justify-between items-center gap-4 w-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.Picture,{source:e.image?.url,className:"size-12 flex-shrink-0"}),(0,a.jsx)(o.Text,{className:"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold",html:e.product.title})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 tablet:flex-row flex-col shrink-0",children:[(0,a.jsx)(o.Text,{className:"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold",html:(0,s.formatPrice)({amount:e?.finalPrice?.amount||0,locale:r,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),(0,a.jsx)(o.Text,{className:"text-base text-[#6D6D6F] laptop:text-[20px] lg-desktop:text-2xl font-bold line-through",html:(0,s.formatPrice)({amount:e.price.amount,locale:r,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var B=O;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value,\n canOperate: false,\n },\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn('flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2', {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n })}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiEM,IAAAI,EAAA,6BAjENC,EAA4E,wCAC5EC,EAAmB,8CACnBC,EAAwB,iBACxBC,EAAqC,6CACrCC,EAA4B,6BAC5BC,EAA+B,uCAG/B,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,wBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,8BAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,2BAAAC,EACA,aAAAC,CACF,KAAI,wBAAqB,EACnB,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIT,GAAoB,CAAC,EAC3DU,KAAiB,WAAQ,IAAMF,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDd,GAAyB,KAAOc,EAAM,IACxCT,IAA6B,MAAS,EACtCF,IAAgC,CAC9B,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDC,IAAkB,CAAE,GAAGG,EAAc,iBAAkB,CAAE,CAAC,IAE1DL,IAAmB,MAAS,EAC5BG,IAA6BS,CAAK,EAClCX,IAAgC,CAC9B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAAW,EACA,WAAY,EACd,CACF,CAAC,EAEL,EAEA,OAAKH,GAAgB,UAGnB,QAAC,OAAI,UAAU,uCACb,oBAAC,QAAK,KAAM,EAAG,UAAU,YAAY,KAAMH,EAAO,KAClD,OAAC,OAAI,UAAU,kFACZ,SAAAG,EAAe,IAAKI,MACnB,QAAC,OAEC,aAAW,MAAG,yFAA0F,CACrG,eAAiBf,GAAyB,KAAOe,EAAK,EACzD,CAAC,EAED,oBAAC,YACC,gBAAiB,IAAMF,EAAoBE,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value,\n canOperate: false,\n },\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn('flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2', {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n })}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[2px]', {\n 'border-brand': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label htmlFor={gift.id} className=\"flex py-6 cursor-pointer justify-between items-center gap-4 w-full\">\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold\"\n html={gift.product.title}\n />\n </div>\n <div className=\"flex items-center gap-1 tablet:flex-row flex-col shrink-0\">\n <Text\n className=\"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"text-base text-[#6D6D6F] laptop:text-[20px] lg-desktop:text-2xl font-bold line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ProductExchangePurchase\n"],
|
|
5
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0F,CACrG,eAAiBf,GAAyB,KAAOe,EAAK,EACzD,CAAC,EAED,oBAAC,YACC,gBAAiB,IAAMF,EAAoBE,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG,6CAA8C,CAC1D,eAAgBf,GAAyB,KAAOe,EAAK,EACvD,CAAC,EACD,GAAIA,EAAK,GACT,QAASf,GAAyB,KAAOe,EAAK,GAC9C,MAAOA,EAAK,GACb,KACD,QAAC,SAAM,QAASA,EAAK,GAAI,UAAU,qEACjC,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,wBAAwB,KACpE,OAAC,QACC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,GACF,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QACC,UAAU,6DACV,QAAM,eAAY,CAChB,OAAQA,GAAM,YAAY,QAAU,EACpC,OAAAhB,EACA,aAAcgB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,KACA,OAAC,QACC,UAAU,yFACV,QAAM,eAAY,CAChB,OAAQA,EAAK,MAAM,OACnB,OAAAhB,EACA,aAAcgB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAzCKA,EAAK,EA0CZ,CACD,EACH,GACF,EArDkC,IAuDtC,EAEA,IAAO1B,EAAQS",
|
|
6
6
|
"names": ["ProductExchangePurchase_exports", "__export", "ProductExchangePurchase_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_utils", "import_AiuiProvider", "ProductExchangePurchase", "locale", "checkedExchangePurchase", "exchangePurchase", "setCheckedBundle", "setJoinedRecommendBuyProducts", "setSavingDetail", "setCheckedExchangePurchase", "joinedRecommendBuyProducts", "savingDetail", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "gift"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var P=(o,d)=>{for(var r in d)n(o,r,{get:d[r],enumerable:!0})},D=(o,d,r,i)=>{if(d&&typeof d=="object"||typeof d=="function")for(let a of y(d))!G.call(o,a)&&a!==r&&n(o,a,{get:()=>d[a],enumerable:!(i=N(d,a))||i.enumerable});return o};var B=o=>D(n({},"__esModule",{value:!0}),o);var F={};P(F,{default:()=>z});module.exports=B(F);var t=require("react/jsx-runtime"),l=require("../../../../../../components"),c=require("../../../../../../helpers/index.js"),m=require("react"),f=require("../../../../BizProductProvider.js"),x=require("../../../../utils"),b=require("../../../../../AiuiProvider");const O=()=>{const{locale:o="us"}=(0,b.useAiuiContext)(),{freeGift:d,checkedGift:r,setCheckedGift:i,setCheckedBundle:a,setSavingDetail:h,savingDetail:v,setJoinedRecommendBuyProducts:s,joinedRecommendBuyProducts:R}=(0,f.useBizProductContext)(),{title:k,giftList:u=[],freeLabel:g}=d||{},p=(0,m.useMemo)(()=>u?.filter(e=>e.availableForSale),[u]),C=e=>{r?.id===e.id?(i?.(void 0),h?.({...v,freeGift:0}),s?.({bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},gift:{value:void 0}})):(a?.(void 0),i?.(e),s?.({bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},gift:{value:e,canOperate:!1}}))};return p?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(l.Text,{size:3,className:"font-bold",html:k}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4",children:p.map(e=>(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":r?.id===e.id}),children:[(0,t.jsx)(l.Checkbox,{onCheckedChange:()=>C(e),size:"lg",className:(0,c.cn)("rounded-full border-[#D1D1D1] border-[
|
|
1
|
+
"use strict";var n=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var P=(o,d)=>{for(var r in d)n(o,r,{get:d[r],enumerable:!0})},D=(o,d,r,i)=>{if(d&&typeof d=="object"||typeof d=="function")for(let a of y(d))!G.call(o,a)&&a!==r&&n(o,a,{get:()=>d[a],enumerable:!(i=N(d,a))||i.enumerable});return o};var B=o=>D(n({},"__esModule",{value:!0}),o);var F={};P(F,{default:()=>z});module.exports=B(F);var t=require("react/jsx-runtime"),l=require("../../../../../../components"),c=require("../../../../../../helpers/index.js"),m=require("react"),f=require("../../../../BizProductProvider.js"),x=require("../../../../utils"),b=require("../../../../../AiuiProvider");const O=()=>{const{locale:o="us"}=(0,b.useAiuiContext)(),{freeGift:d,checkedGift:r,setCheckedGift:i,setCheckedBundle:a,setSavingDetail:h,savingDetail:v,setJoinedRecommendBuyProducts:s,joinedRecommendBuyProducts:R}=(0,f.useBizProductContext)(),{title:k,giftList:u=[],freeLabel:g}=d||{},p=(0,m.useMemo)(()=>u?.filter(e=>e.availableForSale),[u]),C=e=>{r?.id===e.id?(i?.(void 0),h?.({...v,freeGift:0}),s?.({bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},gift:{value:void 0}})):(a?.(void 0),i?.(e),s?.({bundle:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},gift:{value:e,canOperate:!1}}))};return p?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(l.Text,{size:3,className:"font-bold",html:k}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4",children:p.map(e=>(0,t.jsxs)("div",{className:(0,c.cn)("flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2",{"border-brand":r?.id===e.id}),children:[(0,t.jsx)(l.Checkbox,{onCheckedChange:()=>C(e),size:"lg",className:(0,c.cn)("rounded-full border-[#D1D1D1] border-[2px]",{"border-brand":r?.id===e.id}),id:e.id,checked:r?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex justify-between items-center cursor-pointer gap-4 w-full py-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Picture,{source:e.image?.url,className:"size-12 flex-shrink-0"}),(0,t.jsx)(l.Text,{className:"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold",html:e.product.title})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 tablet:flex-row flex-col shrink-0",children:[(0,t.jsx)(l.Text,{className:"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold",html:g}),(0,t.jsx)(l.Text,{className:"text-base text-[#6D6D6F] laptop:text-[20px] lg-desktop:text-2xl font-bold line-through",html:(0,x.formatPrice)({amount:e.price.amount,locale:o,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var z=O;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant } from '../../../../types/product'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n },\n })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value,\n canOperate: false,\n },\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn('flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2', {\n ['border-brand']: checkedGift?.id === gift.id,\n })}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgEM,IAAAI,EAAA,6BAhENC,EAA4E,wCAC5EC,EAAmB,8CACnBC,EAAwB,iBACxBC,EAAqC,6CACrCC,EAA4B,6BAC5BC,EAA+B,uCAG/B,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,SAAAC,EACA,YAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,8BAAAC,EACA,2BAAAC,CACF,KAAI,wBAAqB,EACnB,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIV,GAAY,CAAC,EACnDW,KAAiB,WAAQ,IAAMF,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDb,GAAa,KAAOa,EAAM,IAC5BZ,IAAiB,MAAS,EAC1BE,IAAkB,CAAE,GAAGC,EAAc,SAAU,CAAE,CAAC,EAClDC,IAAgC,CAC9B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,MACT,CACF,CAAC,IAEDH,IAAmB,MAAS,EAC5BD,IAAiBY,CAAK,EACtBR,IAAgC,CAC9B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAAQ,EACA,WAAY,EACd,CACF,CAAC,EAEL,EAEA,OAAKH,GAAgB,UAGnB,QAAC,OAAI,UAAU,+BACb,oBAAC,QAAK,KAAM,EAAG,UAAU,YAAY,KAAMH,EAAO,KAClD,OAAC,OAAI,UAAU,kFACZ,SAAAG,EAAe,IAAII,MAClB,QAAC,OAEC,aAAW,MAAG,yFAA0F,CACrG,eAAiBd,GAAa,KAAOc,EAAK,EAC7C,CAAC,EAED,oBAAC,YACC,gBAAiB,IAAMF,EAAoBE,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG
|
|
4
|
+
"sourcesContent": ["import { Text, Picture, Button, RadioGroup, RadioGroupItem, Checkbox } from '../../../../../../components'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils'\nimport { useAiuiContext } from '../../../../../AiuiProvider'\nimport type { ProductVariant } from '../../../../types/product'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n },\n })\n } else {\n setCheckedBundle?.(undefined)\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value,\n canOperate: false,\n },\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text size={3} className=\"font-bold\" html={title} />\n <div className=\"grid grid-cols-1 gap-3 laptop:grid-cols-2 desktop:grid-cols-1 mt-3 desktop:mt-4\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn('flex items-center gap-2 text-left font-bold px-4 rounded-box border-[#E4E5E6] border-2', {\n ['border-brand']: checkedGift?.id === gift.id,\n })}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-[#D1D1D1] border-[2px]', {\n 'border-brand': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label htmlFor={gift.id} className=\"flex justify-between items-center cursor-pointer gap-4 w-full py-6\">\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 flex-shrink-0\" />\n <Text\n className=\"text-sm laptop:text-[16px] line-clamp-2 lg-desktop:text-[18px] font-bold\"\n html={gift.product.title}\n />\n </div>\n <div className=\"flex items-center gap-1 tablet:flex-row flex-col shrink-0\">\n <Text className=\"text-base laptop:text-[20px] lg-desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base text-[#6D6D6F] laptop:text-[20px] lg-desktop:text-2xl font-bold line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ProductFreeGift\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgEM,IAAAI,EAAA,6BAhENC,EAA4E,wCAC5EC,EAAmB,8CACnBC,EAAwB,iBACxBC,EAAqC,6CACrCC,EAA4B,6BAC5BC,EAA+B,uCAG/B,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,SAAAC,EACA,YAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,8BAAAC,EACA,2BAAAC,CACF,KAAI,wBAAqB,EACnB,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIV,GAAY,CAAC,EACnDW,KAAiB,WAAQ,IAAMF,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDb,GAAa,KAAOa,EAAM,IAC5BZ,IAAiB,MAAS,EAC1BE,IAAkB,CAAE,GAAGC,EAAc,SAAU,CAAE,CAAC,EAClDC,IAAgC,CAC9B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,MACT,CACF,CAAC,IAEDH,IAAmB,MAAS,EAC5BD,IAAiBY,CAAK,EACtBR,IAAgC,CAC9B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAAQ,EACA,WAAY,EACd,CACF,CAAC,EAEL,EAEA,OAAKH,GAAgB,UAGnB,QAAC,OAAI,UAAU,+BACb,oBAAC,QAAK,KAAM,EAAG,UAAU,YAAY,KAAMH,EAAO,KAClD,OAAC,OAAI,UAAU,kFACZ,SAAAG,EAAe,IAAII,MAClB,QAAC,OAEC,aAAW,MAAG,yFAA0F,CACrG,eAAiBd,GAAa,KAAOc,EAAK,EAC7C,CAAC,EAED,oBAAC,YACC,gBAAiB,IAAMF,EAAoBE,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG,6CAA8C,CAC1D,eAAgBd,GAAa,KAAOc,EAAK,EAC3C,CAAC,EACD,GAAIA,EAAK,GACT,QAASd,GAAa,KAAOc,EAAK,GAClC,MAAOA,EAAK,GACb,KACD,QAAC,SAAM,QAASA,EAAK,GAAI,UAAU,qEACjC,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,wBAAwB,KACpE,OAAC,QACC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,GACF,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QAAK,UAAU,6DAA6D,KAAML,EAAW,KAC9F,OAAC,QACC,UAAU,yFACV,QAAM,eAAY,CAChB,OAAQK,EAAK,MAAM,OACnB,OAAAhB,EACA,aAAcgB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAlCKA,EAAK,EAmCZ,CACD,EACH,GACF,EA9CkC,IAgDtC,EAEA,IAAO1B,EAAQS",
|
|
6
6
|
"names": ["ProductFreeGift_exports", "__export", "ProductFreeGift_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_utils", "import_AiuiProvider", "ProductFreeGift", "locale", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setSavingDetail", "savingDetail", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "gift"]
|
|
7
7
|
}
|