@anker-in/headless-ui 1.3.86 → 1.3.88
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/CONTRIBUTING.md +57 -0
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/types.d.ts +12 -1
- package/dist/cjs/biz-components/ActiveShelf/types.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +28 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
- package/dist/cjs/biz-components/Chat/button.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +12 -6
- package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/cjs/biz-components/ImageWithText/types.js +1 -1
- package/dist/cjs/biz-components/Ksp/index.d.ts +2 -0
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +8 -2
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
- package/dist/cjs/biz-components/Listing/types/product.d.ts +9 -0
- package/dist/cjs/biz-components/Listing/types/product.js +1 -1
- package/dist/cjs/biz-components/Listing/types.d.ts +19 -0
- package/dist/cjs/biz-components/Listing/types.js +1 -1
- package/dist/cjs/biz-components/Listing/utils/priceCalc.d.ts +28 -0
- package/dist/cjs/biz-components/Listing/utils/priceCalc.js +1 -0
- package/dist/cjs/biz-components/MarqueeReview/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/cjs/biz-components/ProductHero/types.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/ProductNav/types.d.ts +5 -2
- package/dist/cjs/biz-components/ProductNav/types.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +5 -4
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.js +1 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/index.d.ts +3 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/hooks/useBoaButton.d.ts +27 -0
- package/dist/cjs/hooks/useBoaButton.js +1 -0
- package/dist/cjs/hooks/useDraggableScroll.js +1 -1
- package/dist/cjs/hooks/useExposure.d.ts +1 -1
- package/dist/cjs/hooks/useExposure.js +1 -1
- package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
- package/dist/cjs/index.d.ts +10 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/shared/ContainerGridContext.d.ts +20 -0
- package/dist/cjs/shared/ContainerGridContext.js +1 -0
- package/dist/cjs/shared/Styles.d.ts +2 -0
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/adTrack.d.ts +38 -0
- package/dist/cjs/shared/adTrack.js +1 -0
- package/dist/cjs/shared/amazonAttribution.d.ts +31 -0
- package/dist/cjs/shared/amazonAttribution.js +1 -0
- package/dist/cjs/shared/mediaGridSpec.d.ts +87 -0
- package/dist/cjs/shared/mediaGridSpec.js +1 -0
- package/dist/cjs/stories/BoaStoryProvider.d.ts +10 -0
- package/dist/cjs/stories/BoaStoryProvider.js +1 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/types.d.ts +12 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +28 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/esm/biz-components/Chat/button.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/esm/biz-components/HeroBanner/types.d.ts +12 -6
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +2 -0
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +8 -2
- package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
- package/dist/esm/biz-components/Listing/types/product.d.ts +9 -0
- package/dist/esm/biz-components/Listing/types.d.ts +19 -0
- package/dist/esm/biz-components/Listing/utils/priceCalc.d.ts +28 -0
- package/dist/esm/biz-components/Listing/utils/priceCalc.js +1 -0
- package/dist/esm/biz-components/MarqueeReview/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/ProductNav/types.d.ts +5 -2
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +5 -4
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.js +1 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/index.d.ts +3 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/hooks/useBoaButton.d.ts +27 -0
- package/dist/esm/hooks/useBoaButton.js +1 -0
- package/dist/esm/hooks/useDraggableScroll.js +1 -1
- package/dist/esm/hooks/useExposure.d.ts +1 -1
- package/dist/esm/hooks/useExposure.js +1 -1
- package/dist/esm/hooks/useViewItemList.d.ts +1 -1
- package/dist/esm/index.d.ts +10 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/shared/ContainerGridContext.d.ts +20 -0
- package/dist/esm/shared/ContainerGridContext.js +1 -0
- package/dist/esm/shared/Styles.d.ts +2 -0
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/adTrack.d.ts +38 -0
- package/dist/esm/shared/adTrack.js +1 -0
- package/dist/esm/shared/amazonAttribution.d.ts +31 -0
- package/dist/esm/shared/amazonAttribution.js +1 -0
- package/dist/esm/shared/mediaGridSpec.d.ts +87 -0
- package/dist/esm/shared/mediaGridSpec.js +1 -0
- package/dist/esm/stories/BoaStoryProvider.d.ts +10 -0
- package/dist/esm/stories/BoaStoryProvider.js +1 -0
- package/dist/tokens/base.css +22 -1
- package/package.json +5 -2
- package/style.css +250 -136
- package/tailwind.config.js +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as de}from"react/jsx-runtime";import{createContext as oe,useContext as d,useState as c,useEffect as ne,useMemo as re}from"react";import{VARIANT_PAYLOAD_EXCLUDED_KEYS as ie}from"./const.js";const n=oe({}),me=()=>{if(!d(n))throw new Error("useProductContext must be used in <ProductProvider>");return d(n)},ae=({product:t,isLogin:u,profile:s,isMobile:p,isDesktop:l,children:m,renderRating:P,freeGift:b,bundle:g,checkedBundle:y,checkedGift:f,setCheckedBundle:C,setCheckedGift:h,functionFreeGift:v,checkedFunctionGifts:S,setCheckedFunctionGifts:x,variant:e,selectedOptions:D,setSelectedOptions:B,compareData:R,coupon:A,finalPrice:O,comparePrice:k,totalSavings:_,formattedPrices:F,savingDetail:M,setSavingDetail:V,selectedVariants:G,onAddToCart:T,onBuyNow:N,creditsRedemption:w,memberFunctionResult:E,openModal:J,openSignInPopup:L,openAuthCodePopup:U,openSignUpPopup:j,renderInstallments:W,onUseCouponChange:z,onUseMemberDiscountChange:I,discount:K,buyNowLoading:Y,addToCartLoading:X,notifyMeMode:q,onNotifyMeClick:H})=>{const[Q,r]=c({}),[Z,i]=c([]),$=re(()=>{const ee=e?.payload?.components??[],te=ie;return ee.filter(o=>{const a=o.componentKey??o.blockType??o.blockName;return a&&!te.includes(a)}).length>0?e?.payload:t?.payload},[e?.payload,t?.payload]);return ne(()=>{e?.id&&(r({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),i([]))},[e?.id]),de(n.Provider,{value:{product:t,variant:e,isMobile:p,isDesktop:l,isLogin:u,profile:s,coupon:A,renderRating:P,finalPrice:O,comparePrice:k,formattedPrices:F,savingDetail:M,setSavingDetail:V,totalSavings:_,selectedOptions:D,setSelectedOptions:B,freeGift:b,functionFreeGift:v,checkedFunctionGifts:S,setCheckedFunctionGifts:x,checkedGift:f,setCheckedGift:h,checkedBundle:y,setCheckedBundle:C,bundle:g,compareData:R,selectedVariants:G,onAddToCart:T,onBuyNow:N,joinedRecommendBuyProducts:Q,setJoinedRecommendBuyProducts:r,creditsRedemption:w,memberFunctionResult:E,openModal:J,openSignInPopup:L,openAuthCodePopup:U,openSignUpPopup:j,renderInstallments:W,onUseCouponChange:z,onUseMemberDiscountChange:I,discount:K,buyNowLoading:Y,addToCartLoading:X,notifyMeMode:q,onNotifyMeClick:H,addOrder:Z,setAddOrder:i,resolvedPayload:$},children:m})};var Pe=ae;export{n as BizProductContext,Pe as default,me as useBizProductContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{formatPrice as
|
|
1
|
+
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{formatPrice as f}from"../../utils/index.js";import{useAiuiContext as b}from"../../../AiuiProvider/index.js";import{Text as r}from"../../../../components/index.js";import{cn as t}from"../../../../helpers/index.js";import{ShippingMethodMode as u}from"./type.js";const g=({item:e,index:p,active:i,toggleShipping:l,currencyCode:n,metafields:x,className:s=""})=>{const{copyWriting:m,locale:c="us"}=b();return a("div",{role:"button",tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&l(e,p)},className:t("relative flex cursor-pointer justify-between gap-[16px] desktop:gap-3 lg-desktop:gap-5 overflow-hidden rounded-box border-2 border-[#E8E8E8] px-4 text-[#1F2021]",{"cursor-not-allowed opacity-60":e.disabled,"border-brand":i},s),onClick:()=>l(e,p),children:[a("div",{className:"relative flex flex-col justify-center",children:[o(r,{className:t("laptop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4]",{}),as:"p",html:e.title}),o(r,{className:t("laptop:text-[14px] lg-desktop:mt-1 text-[12px] font-bold leading-[1.4] text-[#6D6D6F]",{}),as:"p",html:e.subtitle})]}),o(r,{className:t("relative my-auto h-fit text-[18px] desktop:text-xl lg-desktop:text-2xl font-bold",{}),as:"p",html:e.price?e.formattedPrice??f({amount:e.price,currencyCode:n,locale:c,removeTrailingZeros:!0}):m?.free}),e.mode!==u.FREE&&o("div",{className:t("bg-brand-0 absolute -right-px -top-px rounded-bl-[8px] rounded-tr-[8px] overflow-hidden px-[8px] py-[2px] desktop:text-[14px] text-[12px] font-bold leading-[1.4] text-white"),children:x?.memberOnly})]})};var w=g;export{w as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Fragment as
|
|
1
|
+
import{Fragment as F,jsx as e,jsxs as a}from"react/jsx-runtime";import{Button as re,Checkbox as pe,Text as d,Picture as D,Heading as O,Link as ce}from"../../../../../components/index.js";import m from"./ProductBenefitsTabs/index.js";import{useBizProductContext as $}from"../../../BizProductProvider.js";import{useComponentData as de}from"../../../hooks/useComponentData.js";import{useBenefits as ue}from"../../../hooks/useBenefits.js";import{formatPrice as k}from"../../../utils/index.js";import{replaceTemplate as G}from"../../../utils/textFormat.js";import fe,{useEffect as W,useMemo as q,useRef as me,useState as P}from"react";import{useAiuiContext as Y}from"../../../../AiuiProvider/index.js";import ge from"../../../../../hooks/useCountDown.js";import be from"../../../hooks/useCopy.js";import{cn as y}from"../../../../../helpers/index.js";import xe from"./ProductBenefitsTabs/ModalContainer.js";import{withLayout as Ce}from"../../../../../shared/Styles.js";import he from"./CreditCouponRedeem/index.js";const ve={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",off:" off",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",memberBenefitsNotLoginText:"Sign Up to Get Benefits Below",forNewMember:"{amount} off for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},ye=fe.memo(function({endsAt:C,daysLeft:i,endsText:l,daysText:g,hurryLabel:b,expiredText:h,onOpenModal:B}){const{days:s,hours:N,minutes:u,seconds:I}=ge({endTime:C});return e("button",{onClick:B,className:"lg-desktop:mt-[24px] text-brand-0 laptop-md:mt-4 lg-desktop:text-[16px] md-l:hidden mt-[14px] text-left text-[14px] font-bold text-[#1F2021]",children:Number(s)<Number(i)?a(F,{children:[a("span",{children:[l," ",s==="00"?"0":s," ",g]}),e("span",{className:"font-bold",children:` ${N.toString()}:${u.toString()}:${I.toString()}`})]}):b||h})}),Be=({item:n,textConfig:C,benefitPayloadData:i})=>{const{trackingData:l}=Y(),{copied:g,copy:b}=be(),[h,B]=P(!1),s=l?.common?.coupon,{openModal:N}=$();return a(F,{children:[e("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 @@ import{Fragment as I,jsx as e,jsxs as a}from"react/jsx-runtime";import{Button as
|
|
|
14
14
|
bottom left;
|
|
15
15
|
mask-repeat: no-repeat;
|
|
16
16
|
}
|
|
17
|
-
`}),a("div",{style:{background:n.couponBgColor||"white"},className:y("laptop:h-[112px] lg-desktop:h-[130px] relative h-[100px] overflow-hidden p-3",n.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),...n.useAble&&{role:"button",tabIndex:0,onClick:()=>{n?.onUseChange?.(
|
|
17
|
+
`}),a("div",{style:{background:n.couponBgColor||"white"},className:y("laptop:h-[112px] lg-desktop:h-[130px] relative h-[100px] overflow-hidden p-3",n.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),...n.useAble&&{role:"button",tabIndex:0,onClick:()=>{n?.onUseChange?.(h)!==!1&&B(!h)}},children:[n?.bgImage?.url&&e(D,{source:n.bgImage.url,alt:n.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),a("div",{className:"z-1 relative ",children:[a("div",{className:"flex items-center justify-start",children:[n.useAble&&e(pe,{size:"lg",className:"data-[state=checked]:border-primary mr-2 rounded-full border-[1.6px] border-[#D1D1D1]",checked:n?.isAutoUse}),e(d,{html:n.title,className:"laptop:text-[20px] lg-desktop:text-[24px] text-[16px] font-bold leading-[1.2]"})]}),n.description&&e(d,{...typeof n.description=="string"?{html:n.description}:{},as:"p",className:"lg-desktop:text-[16px] mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F]",children:n.description}),n.code&&a("div",{className:"laptop-md:mt-2 flex items-center gap-2",children:[e(d,{html:`${i?.couponBenefitData?.commonCoupon?.couponCode}: ${n.code}`,className:"lg-desktop:text-[16px] text-[14px] font-bold text-[#3D3D3F]"}),e(ce,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:u=>{u.preventDefault(),u.stopPropagation(),b(n.code||"")},children:g?s?.copied||i?.couponBenefitData?.commonCoupon?.copied:s?.copy||i?.couponBenefitData?.commonCoupon?.copyCode})]}),n.ends_at&&e(ye,{endsAt:n.ends_at,daysLeft:s?.hurry?.daysLeft??0,endsText:s?.ends??"",daysText:s?.days??"",hurryLabel:s?.hurry?.label??"",expiredText:i?.couponBenefitData?.commonCoupon?.expired??"",onOpenModal:()=>{s?.modal&&N(s?.modal)}})]})]})]})},Ne=({coupons:n,className:C,textConfig:i,benefitPayloadData:l})=>e("div",{className:y("laptop:grid laptop:grid-cols-2 laptop-md:grid-cols-1 flex flex-col gap-3",C),children:n?.map((g,b)=>e(Be,{item:g,textConfig:i,benefitPayloadData:l},b))}),we=({creditCouponRedeem:n,textConfig:C})=>{const{profile:i,variant:l,renderInstallments:g,onUseCouponChange:b,onUseMemberDiscountChange:h,discount:B,savingDetail:s,openModal:N,openSignInPopup:u,openAuthCodePopup:I,openSignUpPopup:J,creditsRedemption:K}=$(),{usedPoints:Te=0,availablePoints:De=0}=K??{},[Q,A]=P(!1),x=de("ProductBenefits")??{},[X,U]=P(!1),ee=ue({variant:l}),{locale:w="us",copyWriting:te}=Y(),H=me(null),oe={...ve,...C},{activated:ne=!1}=i||{},{memberDiscount:p,commonCoupon:f,creditsRedemption:T,freeGift:Z,functionFreeGift:E,bundle:V,paidShipping:ae,fullGift:R,levelDiscount:z}=ee,t=q(()=>{const o=x?.benefitTabs?.find(c=>c?.value==="coupon")??{},r=x?.benefitTabs?.find(c=>c?.value==="membership")??{},M=x?.benefitTabs?.find(c=>c?.value==="installment")??{},L=x?.benefitTabs?.find(c=>c?.value==="pay")??{};return{couponBenefitData:o,membershipBenefitData:r,installmentBenefitData:M,payBenefitData:L}},[x]),v=[f?.enable?{...f.config,isAutoUse:s?.coupon>0,useAble:!0,borderStyle:"rounded",code:f?.config?.title??"",description:f?.config?.desc??"",onUseChange:o=>{const r=o?B?.codeSavings??0:0;b?.(r)},title:G(t?.couponBenefitData?.commonCoupon?.offCoupon,{discount:f?.config?.value_type=="percentage"?Math.abs(Number(f?.config?.value||0))+"%":f?.config?.formattedFixedValue??k({amount:Math.abs(Number(f?.config?.fixed_value||0)),currencyCode:l.price.currencyCode,locale:w})})}:null,p.enable?{useAble:!0,isAutoUse:!!i?.email&&!!s?.member,title:G(t?.couponBenefitData?.member?.offMemberOnly,{amount:p?.config?.formattedAmount??k({amount:p?.config?.amount??0,currencyCode:l.price.currencyCode,locale:w})}),description:a(F,{children:[i?.email?t?.couponBenefitData?.member?.memberDiscounts:t?.membershipBenefitData?.memberBenefitsNotLogin?.replace("{amount}",p?.config?.formattedAmount??k({amount:p?.config?.amount??0,currencyCode:l.price.currencyCode,locale:w}))??""," ",i?.email?"":e("span",{role:"button",tabIndex:0,onClick:()=>u?.(),className:"underline",children:t?.couponBenefitData?.member?.loginNow})]}),borderStyle:"rounded",onUseChange:o=>{if(i?.email){const r=o?p?.config?.amount??0:0;return h?.(r),!0}else return u?.(),!1}}:null,z.enable?{title:z?.config?.title??"",description:z?.config?.tag??"",borderStyle:"inset",bgImage:{url:t?.couponBenefitData?.levelDiscount?.bgImage}}:null,E.enable?{title:E?.config?.title??"",description:t?.couponBenefitData?.freeGift?.selectFreeGift,borderStyle:"inset",bgImage:{url:t?.couponBenefitData?.freeGift?.bgImage},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,Z.enable?{title:Z?.config?.title??"",description:t?.couponBenefitData?.freeGift?.selectFreeGift,borderStyle:"inset",bgImage:{url:t?.couponBenefitData?.freeGift?.bgImage},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,V.enable?{title:`${t?.couponBenefitData?.bundle?.bundleSaveUpTo} ${V.config?.maxSavings}`,borderStyle:"inset",description:t?.couponBenefitData?.bundle?.bundleOffer.replace("{count}",V?.config?.bundleOptions?.length?.toString()??""),bgImage:{url:t?.couponBenefitData?.bundle?.bgImage},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,R.enable?{title:R?.config?.title??"",description:R?.config?.desc??"",borderStyle:"inset",bgImage:{url:t?.couponBenefitData?.fullGift?.bgImage},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,T.enable?{title:t?.couponBenefitData?.creditsRedemption?.creditsTitle,description:t?.couponBenefitData?.creditsRedemption?.creditsDesc,borderStyle:"inset",bgImage:{url:t?.couponBenefitData?.creditsRedemption?.bgImage},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean);W(()=>{_(v?.length?"coupon":"membership")},[v?.length]),W(()=>{A(!1)},[l?.id]);const[j,_]=P("coupon"),ie=()=>{I?.()},se=(o,r)=>{if(_(r),H.current){const M=H.current,L=o.currentTarget,c=L.offsetLeft-M.offsetWidth/2+L.offsetWidth/2;M.scrollTo({left:c,behavior:"smooth"})}},le=q(()=>x?.benefitTabs?.map(o=>o?.value==="coupon"&&!v?.length?null:o).filter(Boolean),[x,v]);return m?a(m,{className:"relative",onValueChange:o=>{_(o),A(o==="installment")},value:j,children:[e("div",{className:"absolute right-0 top-0 z-[1] h-[40px] w-[25px] rounded-xl bg-gradient-to-r from-transparent to-[#EAEAEC]"}),e(m.List,{ref:H,children:le?.map(o=>e(m.Trigger,{className:y(j===o.value&&"text-[#080A0F]"),value:o.value,onClick:r=>se(r,o?.value),children:o.label},o?.value))}),e("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,7 +32,7 @@ import{Fragment as I,jsx as e,jsxs as a}from"react/jsx-runtime";import{Button as
|
|
|
32
32
|
.benefits-tabs-content::-webkit-scrollbar-thumb:hover {
|
|
33
33
|
background-color: rgba(100, 100, 100, 0.6);
|
|
34
34
|
}
|
|
35
|
-
`}),v?.length?e(
|
|
35
|
+
`}),v?.length?e(m.Content,{value:"coupon",className:"benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto",children:e("div",{className:"lg-desktop:p-4 p-3",children:e(Ne,{coupons:v,textConfig:oe,benefitPayloadData:t})})}):null,e(m.Content,{value:"membership",className:y("benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto"),children:a("div",{className:"lg-desktop:p-4 p-3",children:[n&&e("div",{className:"laptop-md:mb-4 mb-2",children:e(he,{...n})}),a("div",{className:y("rounded-lg",{"benefits-tabs-content lg-desktop:h-[calc(240px-100px)] laptop-md:h-[calc(196px-80px)] laptop:h-[calc(220px-72px)] h-[calc(180px-73px)] overflow-y-auto":!i?.email}),children:[!i?.email&&e("h3",{className:"laptop-md:mb-2 mb-1 text-left text-lg font-bold !leading-[1.3]",children:t?.membershipBenefitData?.memberBenefitsNotLoginText}),a("ul",{className:`laptop-md:[&_li]:py-4 list-none
|
|
36
36
|
[&_li:first-child]:rounded-t-lg [&_li:last-child]:rounded-b-lg [&_li:last-child]:last:border-b-0 [&_li]:flex
|
|
37
37
|
[&_li]:items-center [&_li]:gap-2 [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4 [&_li]:py-[10px]
|
|
38
|
-
[&_li]:text-left`,children:[
|
|
38
|
+
[&_li]:text-left`,children:[T.enable?a("li",{children:[e("svg",{className:"laptop-md:size-6 size-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),e(d,{as:"p",className:"x:text-[14px] text-left text-[16px] font-bold",children:!ne&&i?.email?a(F,{children:[t?.membershipBenefitData?.creditsAfterActivation,e("span",{role:"button",tabIndex:0,onClick:()=>ie(),className:"underline",children:t?.membershipBenefitData?.active})]}):T?.config?.label?.replace("{{amount}}",T?.config?.formattedAmount??k({amount:T?.config?.amount??0,currencyCode:l.price.currencyCode,locale:w}))})]}):null,p.enable&&a("li",{className:"justify-between",children:[a("div",{className:"flex gap-2",children:[e("svg",{xmlns:"http://www.w3.org/2000/svg",className:"laptop-md:size-6 size-4",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M20 3.5C21.6569 3.5 23 4.84315 23 6.5V9.65625C23 10.0791 22.7342 10.4566 22.3359 10.5986C21.6665 10.8372 21.1816 11.4844 21.1816 12.25C21.1816 13.0156 21.6665 13.6628 22.3359 13.9014C22.7342 14.0434 23 14.4209 23 14.8438V18C23 19.6569 21.6569 21 20 21H4C2.34315 21 1 19.6569 1 18V14.8438L1.01172 14.6875C1.06803 14.3301 1.31557 14.0256 1.66406 13.9014C2.33345 13.6628 2.81836 13.0156 2.81836 12.25C2.81836 11.4844 2.33345 10.8372 1.66406 10.5986C1.26583 10.4566 1 10.0791 1 9.65625V6.5C1 4.84315 2.34315 3.5 4 3.5H20ZM4 5.5C3.44772 5.5 3 5.94772 3 6.5V9.03125C4.08987 9.68678 4.81836 10.8833 4.81836 12.25C4.81836 13.6165 4.08963 14.8122 3 15.4678V18C3 18.5523 3.44772 19 4 19H20C20.5523 19 21 18.5523 21 18V15.4678C19.9104 14.8122 19.1816 13.6165 19.1816 12.25C19.1816 10.8833 19.9101 9.68677 21 9.03125V6.5C21 5.94772 20.5523 5.5 20 5.5H4ZM15.793 6.79297C16.1835 6.40244 16.8165 6.40244 17.207 6.79297C17.5976 7.18349 17.5976 7.81651 17.207 8.20703L8.20703 17.207C7.81651 17.5976 7.18349 17.5976 6.79297 17.207C6.40244 16.8165 6.40244 16.1835 6.79297 15.793L15.793 6.79297ZM15.25 13.25C16.3546 13.25 17.25 14.1454 17.25 15.25C17.25 16.3546 16.3546 17.25 15.25 17.25C14.1454 17.25 13.25 16.3546 13.25 15.25C13.25 14.1454 14.1454 13.25 15.25 13.25ZM15.25 14.75C14.9739 14.75 14.75 14.9739 14.75 15.25C14.75 15.5261 14.9739 15.75 15.25 15.75C15.5261 15.75 15.75 15.5261 15.75 15.25C15.75 14.9739 15.5261 14.75 15.25 14.75ZM8.75 6.75C9.85457 6.75 10.75 7.64543 10.75 8.75C10.75 9.85457 9.85457 10.75 8.75 10.75C7.64543 10.75 6.75 9.85457 6.75 8.75C6.75 7.64543 7.64543 6.75 8.75 6.75ZM8.75 8.25C8.47386 8.25 8.25 8.47386 8.25 8.75C8.25 9.02614 8.47386 9.25 8.75 9.25C9.02614 9.25 9.25 9.02614 9.25 8.75C9.25 8.47386 9.02614 8.25 8.75 8.25Z",fill:"#1D1D1F"})}),e(d,{as:"p",className:"x:text-[14px] text-left text-[16px] font-bold",children:G(t?.membershipBenefitData?.forNewMember,{amount:p?.config?.formattedAmount??k({amount:p?.config?.amount??0,currencyCode:l.price.currencyCode,locale:w})})})]}),!!i?.email&&e(S,{})]}),t?.membershipBenefitData?.equities?.map((o,r)=>o.modalText?a("li",{className:"justify-between gap-2",children:[a("button",{onClick:()=>N?.({title:o.label,content:o.modalText}),className:"flex justify-between",children:[e(D,{source:o.icon,alt:o.text,className:"laptop-md:size-6 size-4 shrink-0"}),e(d,{className:"x:text-[14px] text-wrap text-left text-[16px] font-bold",children:o.text})]},r),!!i?.email&&e(S,{})]},r):a("li",{className:"justify-between",children:[a("div",{className:"flex items-center gap-2",children:[e(D,{source:o.icon,alt:o.text,className:"laptop-md:size-6 size-4 shrink-0"}),e(d,{as:"p",className:"x:text-[14px] text-wrap text-left text-[16px] font-bold",children:o.label})]}),!!i?.email&&e(S,{})]},r)),ae.enable?a("li",{className:"justify-between",children:[a("div",{className:"flex gap-2",children:[e("svg",{className:"laptop-md:size-6 size-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),e(d,{as:"p",className:"x:text-[14px] text-left text-[16px] font-bold",children:t?.membershipBenefitData?.expressShipping})]}),!!i?.email&&e(S,{})]}):null]})]}),!i?.email&&e("div",{className:"laptop-md:pt-4 pt-2",children:e(re,{variant:"primary",className:"w-full",onClick:()=>J?.(),children:te?.signUp})})]})}),a(m.Content,{value:"pay",className:"benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto ",children:[a("div",{className:"lg-desktop:p-4 p-3",children:[e(O,{size:2,className:"mb-2 text-left text-lg font-bold",children:t?.payBenefitData?.payMethod}),a("div",{className:"lg-desktop:p-4 flex items-center justify-between gap-2 rounded-lg bg-white p-3",children:[a("div",{className:"flex items-center gap-2",children:[e(D,{source:t?.payBenefitData?.icon,className:"laptop-md:size-[70px] laptop-md:h-[34px] size-[40px] h-[20px] shrink-0"}),e(d,{as:"p",className:"x:text-[14px] text-left text-[16px] font-bold",html:t?.payBenefitData?.withCheckout})]}),e("button",{className:"hover:text-brand-0 laptop-md:text-[16px] whitespace-nowrap text-sm font-bold underline",onClick:()=>U(!0),children:t?.payBenefitData?.learnMore})]})]}),e(xe,{showModal:X,closeModal:()=>U(!1),children:e(D,{source:t?.payBenefitData?.payImage})})]}),e(m.Content,{value:"installment",forceMount:!0,className:y("benefits-tabs-content lg-desktop:h-[240px] laptop-md:h-[196px] laptop:h-[220px] h-[180px] overflow-y-auto ",Q?"block":"hidden"),children:a("div",{className:"lg-desktop:p-4 p-3",children:[e(O,{size:2,className:"mb-2 text-left text-lg font-bold",children:t?.installmentBenefitData?.flexibleInstallment}),e("div",{className:"lg-desktop:p-4 overflow-hidden rounded-lg bg-white p-3",children:g})]})})]}):null},S=n=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...n,children:e("path",{d:"M4 9.19472L8.51935 13.667L16.2668 6.00024",stroke:"#2BBC4F",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});var Ze=Ce(we);export{Ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as V,jsx as e,jsxs as i}from"react/jsx-runtime";import{Text as n,Picture as g}from"../../../../../../components/index.js";import{useBizProductContext as S}from"../../../../BizProductProvider.js";import{useComponentData as R}from"../../../../hooks/useComponentData.js";import{useBenefits as _}from"../../../../hooks/useBenefits.js";import{formatPrice as G}from"../../../../utils/index.js";import{replaceTemplate as b}from"../../../../utils/textFormat.js";import{useEffect as U,useState as d}from"react";import{useAiuiContext as O}from"../../../../../AiuiProvider/index.js";import{cn as E}from"../../../../../../helpers/index.js";import j from"./../ProductBenefitsTabs/ModalContainer.js";import W from"../ProductServiceBenefits/index.js";import N from"../../../SlideUpModal/index.js";const q=({showServiceBenefits:s=!0}={})=>{const{profile:a,variant:r,renderInstallments:c,savingDetail:B,openSignInPopup:k,openAuthCodePopup:y,product:t1}=S(),{activated:z=!1}=a||{},[u,F]=d(c);U(()=>{c&&F(c),typeof window<"u"&&window.affirm?.ui?.refresh&&window.affirm.ui.refresh()},[c,r.id]);const t=R("ProductBenefits")??{},[A,h]=d(!1),[I,v]=d(!1),[P,x]=d(!1),T=_({variant:r}),{locale:D="us",copyWriting:l1}=O(),{creditsRedemption:C,freeGift:M,functionFreeGift:w,bundle:p,fullGift:m,levelDiscount:f}=T,L=[C.enable?{title:t?.creditsRedemption?.creditsTitle,description:t?.creditsRedemption?.creditsDesc,icon:e(H,{className:"desktop:size-6 size-5"})}:null,C.enable?{title:e(V,{children:!z&&a?.email?i(V,{children:[t?.creditsRedemption?.creditsAfterActivation,e("span",{role:"button",tabIndex:0,onClick:()=>y?.(),className:"underline",children:t?.creditsRedemption?.active})]}):C?.config?.label?.replace("{{amount}}",G({amount:C?.config?.amount??0,currencyCode:r.price.currencyCode,locale:D}))}),icon:e(H,{className:"desktop:size-6 size-5"})}:null,f.enable?{title:f?.config?.title??"",description:f?.config?.tag??"",icon:e(K,{className:"desktop:size-6 size-5"})}:null,m.enable?{title:m?.config?.title??"",description:m?.config?.desc??"",icon:e(X,{className:"desktop:size-6 size-5"})}:null,M.enable?{title:M?.config?.title??"",icon:e(Z,{className:"desktop:size-6 size-5"})}:null,w.enable?{title:w?.config?.title??"",icon:e(Z,{className:"desktop:size-6 size-5"})}:null,p.enable?{title:b(t?.bundle?.bundleSaveUpTo,{count:p?.config?.maxSavings||""}),description:b(t?.bundle?.bundleOffer,{count:p?.config?.bundleOptions?.length?.toString()||""}),icon:e(Q,{className:"desktop:size-6 size-5"})}:null,t?.paymentMethod?.title?{title:t?.paymentMethod?.title,image:t?.paymentMethod?.image,icon:e($,{className:"desktop:size-6 size-5"}),event:()=>h(!0)}:null,{useAble:!0,isAutoUse:!!a?.email&&!!B?.member,title:a?.email?t?.member?.loginTitle:i("div",{children:[e("span",{className:"mr-2 desktop:mr-3",dangerouslySetInnerHTML:{__html:t?.member?.unloginTitle}}),e("span",{role:"button",tabIndex:0,onClick:l=>{l?.stopPropagation(),k?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:t?.member?.loginNow}})]}),icon:e(J,{className:"desktop:size-6 size-5"}),event:()=>v(!0)},u?{customRenderTitle:u,icon:e(Y,{className:"desktop:size-6 size-5"})}:null,t?.priceMatch?{title:t?.priceMatch?.title,icon:t?.priceMatch?.icon,event:()=>x(!0)}:null].filter(Boolean);return i("div",{children:[t?.benefitTitle&&e(n,{as:"div",html:t?.benefitTitle,className:"text-sm mb-3 lg-desktop:mb-4 lg-desktop:text-base font-bold leading-[1.2]"}),i("ul",{className:"desktop:px-4 px-3 rounded-box bg-[#F5F6F7]",children:[L?.map((l,o)=>i("li",{children:[i("div",{className:"flex gap-3 items-start py-3 laptop:py-4",children:[e("div",{className:"shrink-0",children:typeof l?.icon=="string"?e(g,{source:l?.icon,className:"desktop:size-6 size-5"}):l?.icon}),i("div",{onClick:l?.event,className:E("flex flex-1 items-center gap-1 desktop:gap-2",l?.event&&"cursor-pointer justify-between"),children:[i("div",{children:[l?.customRenderTitle?e("div",{children:l?.customRenderTitle}):i("div",{className:"flex items-center gap-2 desktop:gap-3 text-[14px] laptop:text-base font-bold leading-[1.2]",children:[l?.title,l?.image&&e(g,{source:l?.image,className:"w-[40px] h-[20px] shrink-0"})]}),l?.description&&e(n,{...typeof l.description=="string"?{html:l.description}:{},as:"p",className:"laptop:text-[14px] text-[12px] font-bold text-[#2A2C32]",children:l.description})]}),l?.event&&e(e1,{className:"size-4 desktop:size-6"})]})]}),o!=L?.length-1&&e("div",{className:"bg-[#DADCE0] h-[1px]"})]},o)),s&&e(W,{className:"desktop:px-0 px-0"})]}),e(j,{showModal:A,closeModal:()=>h(!1),children:e(g,{source:t?.paymentMethod?.payImage})}),t?.priceMatch?.modal&&e(N,{title:t?.priceMatch?.modal?.title??t?.priceMatch?.title,showModal:P,closeModal:()=>x(!1),children:e("ul",{className:"list-disc list-outside flex flex-col gap-3 px-8 tablet:px-12 pb-6 tablet:py-8",children:(t?.priceMatch?.modal?.list??[]).map((l,o)=>e("li",{children:e(n,{html:l.desc,className:"text-[14px] tablet:text-[16px] leading-[1.6] text-[#6D6D6F]"})},o))})}),t?.member?.modelBenefits&&e(N,{title:t?.member?.modelTitle,showModal:I,closeModal:()=>v(!1),children:e("ul",{className:"flex flex-col overflow-y-auto tablet:max-h-[calc(80vh-52px)] tablet:py-8 gap-5 pb-6 tablet:pb-8 tablet:gap-8 px-4 tablet:px-8",children:t?.member?.modelBenefits?.map((l,o)=>i("li",{className:"flex flex-col gap-1",children:[e(n,{html:l?.title,className:"text-[16px] tablet:text-[18px] font-bold leading-[1.4]"}),e(n,{html:l?.desc,className:"text-[14px] text-[#1D1D1F] tablet:text-[16px] font-bold leading-[1.4] opacity-75"})]},o))})})]})},H=({className:s})=>e("svg",{className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),J=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.4294 1.58368C15.0354 1.5838 15.6026 1.88286 15.944 2.38348L19.4997 7.5993C19.9918 8.32123 19.9058 9.29041 19.2946 9.91473L11.8571 17.5104C10.8453 18.5435 9.18314 18.5447 8.16961 17.5134L0.696949 9.90692C0.0916662 9.29063 -0.000821769 8.3354 0.474293 7.61395L3.90203 2.4079C4.24121 1.89312 4.81678 1.58368 5.43328 1.58368H14.4294ZM2.00457 8.62177L9.47722 16.2292C9.77143 16.5282 10.2539 16.5278 10.5475 16.2282L17.9841 8.63153L14.4294 3.41669H5.43328L2.00457 8.62177ZM13.5759 7.74481C13.9008 7.41946 14.4279 7.41834 14.7536 7.74286C15.0792 8.06792 15.0804 8.59584 14.7555 8.92157L10.6247 13.0593C10.2833 13.401 9.72933 13.4013 9.38738 13.0602L5.24382 8.92352C4.91829 8.59852 4.9172 8.07056 5.24187 7.74481C5.56689 7.41925 6.09484 7.41813 6.42058 7.74286L10.0046 11.321L13.5759 7.74481Z",fill:"#080A0F"})}),K=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("path",{d:"M13.1615 5.66083C13.4869 5.33539 14.0144 5.33539 14.3398 5.66083C14.6653 5.98626 14.6653 6.51378 14.3398 6.83921L6.83984 14.3392C6.51441 14.6646 5.98689 14.6646 5.66146 14.3392C5.33602 14.0138 5.33602 13.4863 5.66146 13.1608L13.1615 5.66083Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.709 11.0417C13.6295 11.0417 14.3756 11.7879 14.3756 12.7084C14.3756 13.6288 13.6295 14.375 12.709 14.375C11.7885 14.375 11.0423 13.6288 11.0423 12.7084C11.0423 11.7879 11.7885 11.0417 12.709 11.0417ZM12.709 12.2917C12.4789 12.2917 12.2923 12.4782 12.2923 12.7084C12.2923 12.9385 12.4789 13.125 12.709 13.125C12.9391 13.125 13.1256 12.9385 13.1256 12.7084C13.1256 12.4782 12.9391 12.2917 12.709 12.2917Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.29232 5.62502C8.21279 5.62502 8.95898 6.37121 8.95898 7.29169C8.95898 8.21216 8.21279 8.95835 7.29232 8.95835C6.37184 8.95835 5.62565 8.21216 5.62565 7.29169C5.62565 6.37121 6.37184 5.62502 7.29232 5.62502ZM7.29232 6.87502C7.0622 6.87502 6.87565 7.06157 6.87565 7.29169C6.87565 7.52181 7.0622 7.70835 7.29232 7.70835C7.52244 7.70835 7.70898 7.52181 7.70898 7.29169C7.70898 7.06157 7.52244 6.87502 7.29232 6.87502Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.6673 2.91669C18.048 2.91669 19.1673 4.03597 19.1673 5.41669V8.0469C19.1673 8.39923 18.9458 8.71388 18.6139 8.83221C18.0561 9.03101 17.652 9.57037 17.652 10.2084C17.652 10.8463 18.0561 11.3857 18.6139 11.5845C18.9458 11.7028 19.1673 12.0175 19.1673 12.3698V15C19.1673 16.3807 18.048 17.5 16.6673 17.5H3.33398C1.95327 17.5 0.833984 16.3807 0.833984 15V12.3698L0.84375 12.2396C0.890672 11.9418 1.09696 11.688 1.38737 11.5845C1.94519 11.3857 2.34928 10.8463 2.34928 10.2084C2.34928 9.57036 1.94519 9.03101 1.38737 8.83221C1.05551 8.71388 0.833984 8.39923 0.833984 8.0469V5.41669C0.833985 4.03598 1.95327 2.91669 3.33398 2.91669H16.6673ZM3.33398 4.58335C2.87375 4.58335 2.50065 4.95645 2.50065 5.41669V7.52606C3.40888 8.07233 4.01595 9.06946 4.01595 10.2084C4.01595 11.3471 3.40868 12.3435 2.50065 12.8898V15C2.50065 15.4603 2.87375 15.8334 3.33398 15.8334H16.6673C17.1276 15.8334 17.5006 15.4603 17.5006 15V12.8898C16.5926 12.3435 15.9853 11.3471 15.9853 10.2084C15.9853 9.06945 16.5924 8.07233 17.5006 7.52606V5.41669C17.5006 4.95645 17.1276 4.58335 16.6673 4.58335H3.33398Z",fill:"#080A0F"})]}),Z=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.4951 1.47201C12.791 1.17663 13.2707 1.17634 13.5664 1.47201C13.862 1.76788 13.8622 2.24851 13.5664 2.54428L11.8301 4.2806H17.5752C17.9935 4.28073 18.333 4.62012 18.333 5.03842V8.06869C18.333 8.48701 17.9935 8.82638 17.5752 8.8265H17.1982V17.1595C17.198 17.5776 16.8585 17.9171 16.4404 17.9173H3.56152C3.14327 17.9173 2.80394 17.5777 2.80371 17.1595V8.8265H2.42383C2.00543 8.8265 1.66602 8.48709 1.66602 8.06869V5.03842C1.66605 4.62005 2.00545 4.2806 2.42383 4.2806H8.16992L6.43359 2.54428C6.13775 2.24843 6.13776 1.76786 6.43359 1.47201C6.72945 1.17616 7.21001 1.17616 7.50586 1.47201L10 3.96615L12.4951 1.47201ZM4.31934 16.4017H9.24219V8.8265H4.31934V16.4017ZM10.7578 16.4017H15.6826V8.8265H10.7578V16.4017ZM3.18164 7.31088H16.8174V5.79623H3.18164V7.31088Z",fill:"#080A0F"})}),Q=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M14.1152 1.18357L14.2551 1.26642L18.4546 3.9088C18.8514 4.15858 19.178 4.50301 19.4043 4.91029C19.6306 5.31758 19.7492 5.77458 19.7493 6.23909V16.0194C19.7495 16.3825 19.6772 16.742 19.5366 17.0775C19.396 17.413 19.1898 17.7179 18.9298 17.9747C18.6697 18.2315 18.361 18.4352 18.0212 18.5742C17.6814 18.7132 17.3172 18.7847 16.9494 18.7847H8.55091C8.1623 18.7852 7.77786 18.7056 7.42219 18.5511C7.06652 18.3965 6.74745 18.1704 6.48539 17.8871L1.61712 16.3743C1.35494 16.2904 1.11208 16.1563 0.902404 15.9797C0.692732 15.8031 0.520358 15.5875 0.395126 15.3451C0.269895 15.1027 0.194259 14.8384 0.172541 14.5672C0.150822 14.296 0.183446 14.0232 0.268548 13.7644L3.25386 4.69868C3.36315 4.36757 3.55522 4.06899 3.81232 3.83053C4.06942 3.59207 4.38326 3.42141 4.72484 3.33434L9.66236 2.26275L11.246 1.26642C11.6722 0.998206 12.1641 0.848941 12.6694 0.834475C13.1747 0.820008 13.6746 0.94088 14.1159 1.18426L14.1152 1.18357ZM11.9979 2.44503L7.79829 5.08741C7.59979 5.21229 7.43639 5.38454 7.32319 5.58825C7.20998 5.79196 7.15061 6.02055 7.15058 6.2529V16.0201C7.15058 16.7838 7.7773 17.4024 8.55021 17.4024H16.9494C17.1333 17.4025 17.3155 17.3668 17.4855 17.2974C17.6555 17.228 17.8099 17.1261 17.94 16.9978C18.0701 16.8694 18.1733 16.717 18.2438 16.5492C18.3142 16.3815 18.3504 16.2017 18.3504 16.0201V6.2529C18.3504 5.78063 18.1056 5.3415 17.7027 5.08741L13.5031 2.44503C13.2784 2.30354 13.0174 2.22837 12.7508 2.22837C12.4843 2.22837 12.2233 2.30354 11.9986 2.44503H11.9979ZM6.49449 4.36243L5.07457 4.67106C4.96068 4.70009 4.85604 4.757 4.77033 4.83654C4.68463 4.91607 4.62062 5.01565 4.58425 5.12608L1.59823 14.1911C1.56987 14.2774 1.559 14.3683 1.56626 14.4587C1.57351 14.5491 1.59875 14.6373 1.64051 14.7181C1.68228 14.7988 1.73976 14.8707 1.80968 14.9296C1.87959 14.9884 1.96057 15.0331 2.04799 15.0611L5.76005 16.2459C5.75394 16.1708 5.75091 16.0955 5.75095 16.0201V6.23978C5.75095 5.53552 6.02235 4.86715 6.49518 4.36243H6.49449ZM15.4938 11.8801C15.909 11.8803 16.3148 12.0019 16.6599 12.2297C17.005 12.4575 17.2739 12.7812 17.4327 13.1599C17.5914 13.5386 17.6329 13.9552 17.5517 14.3571C17.4706 14.759 17.2706 15.1282 16.9769 15.4178C16.6832 15.7075 16.3091 15.9048 15.9019 15.9846C15.4947 16.0644 15.0727 16.0232 14.6892 15.8663C14.3057 15.7093 13.9779 15.4436 13.7474 15.1028C13.5168 14.762 13.3939 14.3613 13.394 13.9515C13.394 12.8074 14.3341 11.8801 15.4938 11.8801ZM10.0995 13.5124L15.0489 8.63015C15.1753 8.50803 15.3437 8.4376 15.5204 8.43301C15.6972 8.42841 15.8691 8.48998 16.0018 8.60536C16.1344 8.72074 16.2179 8.88139 16.2355 9.05504C16.2532 9.22869 16.2036 9.40249 16.0967 9.54155L16.0387 9.60645L11.0893 14.4887C10.963 14.6108 10.7945 14.6812 10.6178 14.6858C10.4411 14.6904 10.2691 14.6288 10.1365 14.5135C10.0038 14.3981 9.92029 14.2374 9.90267 14.0638C9.88506 13.8901 9.93464 13.7163 10.0415 13.5773L10.0995 13.5124ZM15.4938 13.261C15.3083 13.261 15.1304 13.3338 14.9992 13.4633C14.868 13.5928 14.7943 13.7684 14.7943 13.9515C14.7943 14.1346 14.868 14.3102 14.9992 14.4397C15.1304 14.5692 15.3083 14.642 15.4938 14.642C15.6793 14.642 15.8572 14.5692 15.9884 14.4397C16.1196 14.3102 16.1933 14.1346 16.1933 13.9515C16.1933 13.7684 16.1196 13.5928 15.9884 13.4633C15.8572 13.3338 15.6793 13.261 15.4938 13.261ZM10.5947 7.04693C11.0099 7.04706 11.4157 7.16872 11.7608 7.39652C12.1059 7.62431 12.3749 7.94801 12.5336 8.32668C12.6924 8.70536 12.7338 9.12199 12.6527 9.5239C12.5715 9.92582 12.3715 10.295 12.0778 10.5846C11.7842 10.8743 11.4101 11.0716 11.0029 11.1514C10.5957 11.2312 10.1736 11.19 9.79012 11.0331C9.40661 10.8761 9.07886 10.6104 8.84833 10.2696C8.61779 9.92877 8.49482 9.52811 8.49496 9.1183C8.49496 7.97421 9.43504 7.04693 10.5947 7.04693ZM10.5947 8.42784C10.5029 8.4278 10.4119 8.44561 10.327 8.48027C10.2422 8.51492 10.165 8.56574 10.1 8.62983C9.96881 8.75925 9.89503 8.93483 9.89493 9.11795C9.89484 9.30107 9.96845 9.47673 10.0996 9.60628C10.2307 9.73583 10.4085 9.80866 10.594 9.80876C10.7796 9.80876 10.9575 9.73601 11.0886 9.60653C11.2198 9.47704 11.2935 9.30142 11.2935 9.1183C11.2935 8.93518 11.2198 8.75956 11.0886 8.63007C10.9575 8.50059 10.7796 8.42784 10.594 8.42784H10.5947Z",fill:"#080A0F",stroke:"#080A0F","stroke-width":"0.166667"})}),X=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.45492 6.28808C6.43123 5.31177 8.01457 5.31177 8.99089 6.28808C9.96696 7.26431 9.96685 8.84695 8.99089 9.82324C8.01457 10.7996 6.43123 10.7996 5.45492 9.82324C4.47891 8.84694 4.4788 7.26431 5.45492 6.28808ZM8.04769 7.23047C7.59205 6.77513 6.85282 6.77495 6.3973 7.23047C5.94188 7.686 5.94199 8.42526 6.3973 8.88086C6.85287 9.33643 7.59207 9.33636 8.04769 8.88086C8.5033 8.42525 8.5033 7.68608 8.04769 7.23047Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.07715 1.95703C9.58012 1.90116 10.0815 2.07705 10.4395 2.43473L18.1234 10.1187C18.7739 10.7695 18.7741 11.8246 18.1234 12.4754L11.6414 18.9574C10.9907 19.6081 9.93555 19.6079 9.28467 18.9574L1.60075 11.2734C1.28783 10.9603 1.11442 10.5376 1.11328 10.0999L1.12305 9.91113L1.77165 4.0778C1.85775 3.30308 2.46909 2.69171 3.24381 2.60563L9.07715 1.95703ZM3.42773 4.26172L2.77913 10.095L10.4631 17.779L16.945 11.297L9.26107 3.61312L3.42773 4.26172Z",fill:"#080A0F"})]}),Y=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("g",{"clip-path":"url(#clip0_8416_45916)",children:e("path",{d:"M12.0391 0.392503C13.014 -0.174504 14.2592 0.162733 14.8206 1.14283L14.8223 1.14608L16.974 5.01978C18.2095 5.17141 19.1663 6.22452 19.1663 7.50106V16.6677C19.1661 18.0483 18.0469 19.1677 16.6663 19.1677H3.33301C1.95242 19.1677 0.833208 18.0483 0.833008 16.6677V7.50106C0.833008 6.12035 1.9523 5.00106 3.33301 5.00106H4.12077L12.0391 0.392503ZM3.33301 6.66773C2.87277 6.66773 2.49967 7.04083 2.49967 7.50106V16.6677C2.49987 17.1278 2.87289 17.5011 3.33301 17.5011H16.6663C17.1265 17.5011 17.4995 17.1278 17.4997 16.6677V15.8344H13.7497C11.6787 15.8344 9.99987 14.1553 9.99967 12.0844C9.99967 10.0133 11.6786 8.3344 13.7497 8.3344H17.4997V7.50106C17.4997 7.04083 17.1266 6.66773 16.6663 6.66773H3.33301ZM13.7497 10.0011C12.5991 10.0011 11.6663 10.9338 11.6663 12.0844C11.6665 13.2348 12.5992 14.1677 13.7497 14.1677H17.4997V10.0011H13.7497ZM13.333 11.2511C13.7932 11.2511 14.1663 11.6242 14.1663 12.0844C14.1661 12.5445 13.7931 12.9177 13.333 12.9177C12.8729 12.9177 12.4999 12.5445 12.4997 12.0844C12.4997 11.6242 12.8728 11.2511 13.333 11.2511ZM13.473 1.80526C13.3156 1.62235 13.0553 1.56238 12.8341 1.66122L12.7682 1.6954L7.08952 5.00106H9.0459L13.7708 2.32121L13.5348 1.89234L13.473 1.80526ZM11.5801 5.00106H15.2495L14.3747 3.41578L11.5801 5.00106Z",fill:"#080A0F"})}),e("defs",{children:e("clipPath",{id:"clip0_8416_45916",children:e("rect",{width:"20",height:"20",fill:"white"})})})]}),$=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M16.667 2.49915C18.0476 2.49915 19.1668 3.61858 19.167 4.99915V14.9991C19.1668 16.3797 18.0476 17.4991 16.667 17.4991H3.33398C1.95353 17.499 0.834161 16.3796 0.833984 14.9991V4.99915C0.83416 3.61869 1.95353 2.49932 3.33398 2.49915H16.667ZM2.5 14.9991C2.50018 15.4591 2.87401 15.832 3.33398 15.8322H16.667C17.1271 15.8322 17.4998 15.4592 17.5 14.9991V8.33215H2.50098L2.5 8.33118V14.9991ZM10.001 12.5333C10.4426 12.5335 10.8007 12.8915 10.8008 13.3331C10.8008 13.7748 10.4427 14.1328 10.001 14.1329H5.00098C4.55915 14.1329 4.20117 13.775 4.20117 13.3331C4.20126 12.8914 4.5592 12.5333 5.00098 12.5333H10.001ZM3.33398 4.16516C2.874 4.16534 2.50018 4.53917 2.5 4.99915V6.66614H17.5V4.99915C17.4998 4.53906 17.1271 4.16516 16.667 4.16516H3.33398Z",fill:"#080A0F"})}),e1=({className:s})=>e("svg",{className:s,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M6.91058 4.4108C7.23602 4.08536 7.76353 4.08536 8.08897 4.4108L13.089 9.41079C13.4144 9.73623 13.4144 10.2637 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2637 6.58514 14.7362 6.91058 14.4108L11.3214 9.99999L6.91058 5.58918C6.58514 5.26374 6.58514 4.73623 6.91058 4.4108Z",fill:"#080A0F"})});var h1=q;import{default as M1}from"../ProductServiceBenefits/index.js";export{M1 as ProductServiceBenefits,h1 as default};
|
|
1
|
+
import{Fragment as V,jsx as e,jsxs as i}from"react/jsx-runtime";import{Text as a,Picture as g}from"../../../../../../components/index.js";import{useBizProductContext as S}from"../../../../BizProductProvider.js";import{useComponentData as R}from"../../../../hooks/useComponentData.js";import{useBenefits as _}from"../../../../hooks/useBenefits.js";import{formatPrice as G}from"../../../../utils/index.js";import{replaceTemplate as b}from"../../../../utils/textFormat.js";import{useEffect as U,useState as d}from"react";import{useAiuiContext as O}from"../../../../../AiuiProvider/index.js";import{cn as E}from"../../../../../../helpers/index.js";import j from"./../ProductBenefitsTabs/ModalContainer.js";import W from"../ProductServiceBenefits/index.js";import N from"../../../SlideUpModal/index.js";const q=({showServiceBenefits:s=!0}={})=>{const{profile:c,variant:r,renderInstallments:C,savingDetail:B,openSignInPopup:k,openAuthCodePopup:y,product:t1}=S(),{activated:z=!1}=c||{},[u,A]=d(C);U(()=>{C&&A(C),typeof window<"u"&&window.affirm?.ui?.refresh&&window.affirm.ui.refresh()},[C,r.id]);const t=R("ProductBenefits")??{},[F,h]=d(!1),[I,v]=d(!1),[P,x]=d(!1),T=_({variant:r}),{locale:D="us",copyWriting:l1}=O(),{creditsRedemption:n,freeGift:M,functionFreeGift:w,bundle:p,fullGift:m,levelDiscount:f}=T,L=[n.enable?{title:t?.creditsRedemption?.creditsTitle,description:t?.creditsRedemption?.creditsDesc,icon:e(H,{className:"desktop:size-6 size-5"})}:null,n.enable?{title:e(V,{children:!z&&c?.email?i(V,{children:[t?.creditsRedemption?.creditsAfterActivation,e("span",{role:"button",tabIndex:0,onClick:()=>y?.(),className:"underline",children:t?.creditsRedemption?.active})]}):n?.config?.label?.replace("{{amount}}",n?.config?.formattedAmount??G({amount:n?.config?.amount??0,currencyCode:r.price.currencyCode,locale:D}))}),icon:e(H,{className:"desktop:size-6 size-5"})}:null,f.enable?{title:f?.config?.title??"",description:f?.config?.tag??"",icon:e(K,{className:"desktop:size-6 size-5"})}:null,m.enable?{title:m?.config?.title??"",description:m?.config?.desc??"",icon:e(X,{className:"desktop:size-6 size-5"})}:null,M.enable?{title:M?.config?.title??"",icon:e(Z,{className:"desktop:size-6 size-5"})}:null,w.enable?{title:w?.config?.title??"",icon:e(Z,{className:"desktop:size-6 size-5"})}:null,p.enable?{title:b(t?.bundle?.bundleSaveUpTo,{count:p?.config?.maxSavings||""}),description:b(t?.bundle?.bundleOffer,{count:p?.config?.bundleOptions?.length?.toString()||""}),icon:e(Q,{className:"desktop:size-6 size-5"})}:null,t?.paymentMethod?.title?{title:t?.paymentMethod?.title,image:t?.paymentMethod?.image,icon:e($,{className:"desktop:size-6 size-5"}),event:()=>h(!0)}:null,{useAble:!0,isAutoUse:!!c?.email&&!!B?.member,title:c?.email?t?.member?.loginTitle:i("div",{children:[e("span",{className:"mr-2 desktop:mr-3",dangerouslySetInnerHTML:{__html:t?.member?.unloginTitle}}),e("span",{role:"button",tabIndex:0,onClick:l=>{l?.stopPropagation(),k?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:t?.member?.loginNow}})]}),icon:e(J,{className:"desktop:size-6 size-5"}),event:()=>v(!0)},u?{customRenderTitle:u,icon:e(Y,{className:"desktop:size-6 size-5"})}:null,t?.priceMatch?{title:t?.priceMatch?.title,icon:t?.priceMatch?.icon,event:()=>x(!0)}:null].filter(Boolean);return i("div",{children:[t?.benefitTitle&&e(a,{as:"div",html:t?.benefitTitle,className:"text-sm mb-3 lg-desktop:mb-4 lg-desktop:text-base font-bold leading-[1.2]"}),i("ul",{className:"desktop:px-4 px-3 rounded-box bg-[#F5F6F7]",children:[L?.map((l,o)=>i("li",{children:[i("div",{className:"flex gap-3 items-start py-3 laptop:py-4",children:[e("div",{className:"shrink-0",children:typeof l?.icon=="string"?e(g,{source:l?.icon,className:"desktop:size-6 size-5"}):l?.icon}),i("div",{onClick:l?.event,className:E("flex flex-1 items-center gap-1 desktop:gap-2",l?.event&&"cursor-pointer justify-between"),children:[i("div",{children:[l?.customRenderTitle?e("div",{children:l?.customRenderTitle}):i("div",{className:"flex items-center gap-2 desktop:gap-3 text-[14px] laptop:text-base font-bold leading-[1.2]",children:[l?.title,l?.image&&e(g,{source:l?.image,className:"w-[40px] h-[20px] shrink-0"})]}),l?.description&&e(a,{...typeof l.description=="string"?{html:l.description}:{},as:"p",className:"laptop:text-[14px] text-[12px] font-bold text-[#2A2C32]",children:l.description})]}),l?.event&&e(e1,{className:"size-4 desktop:size-6"})]})]}),o!=L?.length-1&&e("div",{className:"bg-[#DADCE0] h-[1px]"})]},o)),s&&e(W,{className:"desktop:px-0 px-0"})]}),e(j,{showModal:F,closeModal:()=>h(!1),children:e(g,{source:t?.paymentMethod?.payImage})}),t?.priceMatch?.modal&&e(N,{title:t?.priceMatch?.modal?.title??t?.priceMatch?.title,showModal:P,closeModal:()=>x(!1),children:e("ul",{className:"list-disc list-outside flex flex-col gap-3 px-8 tablet:px-12 pb-6 tablet:py-8",children:(t?.priceMatch?.modal?.list??[]).map((l,o)=>e("li",{children:e(a,{html:l.desc,className:"text-[14px] tablet:text-[16px] leading-[1.6] text-[#6D6D6F]"})},o))})}),t?.member?.modelBenefits&&e(N,{title:t?.member?.modelTitle,showModal:I,closeModal:()=>v(!1),children:e("ul",{className:"flex flex-col overflow-y-auto tablet:max-h-[calc(80vh-52px)] tablet:py-8 gap-5 pb-6 tablet:pb-8 tablet:gap-8 px-4 tablet:px-8",children:t?.member?.modelBenefits?.map((l,o)=>i("li",{className:"flex flex-col gap-1",children:[e(a,{html:l?.title,className:"text-[16px] tablet:text-[18px] font-bold leading-[1.4]"}),e(a,{html:l?.desc,className:"text-[14px] text-[#1D1D1F] tablet:text-[16px] font-bold leading-[1.4] opacity-75"})]},o))})})]})},H=({className:s})=>e("svg",{className:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),J=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.4294 1.58368C15.0354 1.5838 15.6026 1.88286 15.944 2.38348L19.4997 7.5993C19.9918 8.32123 19.9058 9.29041 19.2946 9.91473L11.8571 17.5104C10.8453 18.5435 9.18314 18.5447 8.16961 17.5134L0.696949 9.90692C0.0916662 9.29063 -0.000821769 8.3354 0.474293 7.61395L3.90203 2.4079C4.24121 1.89312 4.81678 1.58368 5.43328 1.58368H14.4294ZM2.00457 8.62177L9.47722 16.2292C9.77143 16.5282 10.2539 16.5278 10.5475 16.2282L17.9841 8.63153L14.4294 3.41669H5.43328L2.00457 8.62177ZM13.5759 7.74481C13.9008 7.41946 14.4279 7.41834 14.7536 7.74286C15.0792 8.06792 15.0804 8.59584 14.7555 8.92157L10.6247 13.0593C10.2833 13.401 9.72933 13.4013 9.38738 13.0602L5.24382 8.92352C4.91829 8.59852 4.9172 8.07056 5.24187 7.74481C5.56689 7.41925 6.09484 7.41813 6.42058 7.74286L10.0046 11.321L13.5759 7.74481Z",fill:"#080A0F"})}),K=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("path",{d:"M13.1615 5.66083C13.4869 5.33539 14.0144 5.33539 14.3398 5.66083C14.6653 5.98626 14.6653 6.51378 14.3398 6.83921L6.83984 14.3392C6.51441 14.6646 5.98689 14.6646 5.66146 14.3392C5.33602 14.0138 5.33602 13.4863 5.66146 13.1608L13.1615 5.66083Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.709 11.0417C13.6295 11.0417 14.3756 11.7879 14.3756 12.7084C14.3756 13.6288 13.6295 14.375 12.709 14.375C11.7885 14.375 11.0423 13.6288 11.0423 12.7084C11.0423 11.7879 11.7885 11.0417 12.709 11.0417ZM12.709 12.2917C12.4789 12.2917 12.2923 12.4782 12.2923 12.7084C12.2923 12.9385 12.4789 13.125 12.709 13.125C12.9391 13.125 13.1256 12.9385 13.1256 12.7084C13.1256 12.4782 12.9391 12.2917 12.709 12.2917Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.29232 5.62502C8.21279 5.62502 8.95898 6.37121 8.95898 7.29169C8.95898 8.21216 8.21279 8.95835 7.29232 8.95835C6.37184 8.95835 5.62565 8.21216 5.62565 7.29169C5.62565 6.37121 6.37184 5.62502 7.29232 5.62502ZM7.29232 6.87502C7.0622 6.87502 6.87565 7.06157 6.87565 7.29169C6.87565 7.52181 7.0622 7.70835 7.29232 7.70835C7.52244 7.70835 7.70898 7.52181 7.70898 7.29169C7.70898 7.06157 7.52244 6.87502 7.29232 6.87502Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.6673 2.91669C18.048 2.91669 19.1673 4.03597 19.1673 5.41669V8.0469C19.1673 8.39923 18.9458 8.71388 18.6139 8.83221C18.0561 9.03101 17.652 9.57037 17.652 10.2084C17.652 10.8463 18.0561 11.3857 18.6139 11.5845C18.9458 11.7028 19.1673 12.0175 19.1673 12.3698V15C19.1673 16.3807 18.048 17.5 16.6673 17.5H3.33398C1.95327 17.5 0.833984 16.3807 0.833984 15V12.3698L0.84375 12.2396C0.890672 11.9418 1.09696 11.688 1.38737 11.5845C1.94519 11.3857 2.34928 10.8463 2.34928 10.2084C2.34928 9.57036 1.94519 9.03101 1.38737 8.83221C1.05551 8.71388 0.833984 8.39923 0.833984 8.0469V5.41669C0.833985 4.03598 1.95327 2.91669 3.33398 2.91669H16.6673ZM3.33398 4.58335C2.87375 4.58335 2.50065 4.95645 2.50065 5.41669V7.52606C3.40888 8.07233 4.01595 9.06946 4.01595 10.2084C4.01595 11.3471 3.40868 12.3435 2.50065 12.8898V15C2.50065 15.4603 2.87375 15.8334 3.33398 15.8334H16.6673C17.1276 15.8334 17.5006 15.4603 17.5006 15V12.8898C16.5926 12.3435 15.9853 11.3471 15.9853 10.2084C15.9853 9.06945 16.5924 8.07233 17.5006 7.52606V5.41669C17.5006 4.95645 17.1276 4.58335 16.6673 4.58335H3.33398Z",fill:"#080A0F"})]}),Z=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.4951 1.47201C12.791 1.17663 13.2707 1.17634 13.5664 1.47201C13.862 1.76788 13.8622 2.24851 13.5664 2.54428L11.8301 4.2806H17.5752C17.9935 4.28073 18.333 4.62012 18.333 5.03842V8.06869C18.333 8.48701 17.9935 8.82638 17.5752 8.8265H17.1982V17.1595C17.198 17.5776 16.8585 17.9171 16.4404 17.9173H3.56152C3.14327 17.9173 2.80394 17.5777 2.80371 17.1595V8.8265H2.42383C2.00543 8.8265 1.66602 8.48709 1.66602 8.06869V5.03842C1.66605 4.62005 2.00545 4.2806 2.42383 4.2806H8.16992L6.43359 2.54428C6.13775 2.24843 6.13776 1.76786 6.43359 1.47201C6.72945 1.17616 7.21001 1.17616 7.50586 1.47201L10 3.96615L12.4951 1.47201ZM4.31934 16.4017H9.24219V8.8265H4.31934V16.4017ZM10.7578 16.4017H15.6826V8.8265H10.7578V16.4017ZM3.18164 7.31088H16.8174V5.79623H3.18164V7.31088Z",fill:"#080A0F"})}),Q=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M14.1152 1.18357L14.2551 1.26642L18.4546 3.9088C18.8514 4.15858 19.178 4.50301 19.4043 4.91029C19.6306 5.31758 19.7492 5.77458 19.7493 6.23909V16.0194C19.7495 16.3825 19.6772 16.742 19.5366 17.0775C19.396 17.413 19.1898 17.7179 18.9298 17.9747C18.6697 18.2315 18.361 18.4352 18.0212 18.5742C17.6814 18.7132 17.3172 18.7847 16.9494 18.7847H8.55091C8.1623 18.7852 7.77786 18.7056 7.42219 18.5511C7.06652 18.3965 6.74745 18.1704 6.48539 17.8871L1.61712 16.3743C1.35494 16.2904 1.11208 16.1563 0.902404 15.9797C0.692732 15.8031 0.520358 15.5875 0.395126 15.3451C0.269895 15.1027 0.194259 14.8384 0.172541 14.5672C0.150822 14.296 0.183446 14.0232 0.268548 13.7644L3.25386 4.69868C3.36315 4.36757 3.55522 4.06899 3.81232 3.83053C4.06942 3.59207 4.38326 3.42141 4.72484 3.33434L9.66236 2.26275L11.246 1.26642C11.6722 0.998206 12.1641 0.848941 12.6694 0.834475C13.1747 0.820008 13.6746 0.94088 14.1159 1.18426L14.1152 1.18357ZM11.9979 2.44503L7.79829 5.08741C7.59979 5.21229 7.43639 5.38454 7.32319 5.58825C7.20998 5.79196 7.15061 6.02055 7.15058 6.2529V16.0201C7.15058 16.7838 7.7773 17.4024 8.55021 17.4024H16.9494C17.1333 17.4025 17.3155 17.3668 17.4855 17.2974C17.6555 17.228 17.8099 17.1261 17.94 16.9978C18.0701 16.8694 18.1733 16.717 18.2438 16.5492C18.3142 16.3815 18.3504 16.2017 18.3504 16.0201V6.2529C18.3504 5.78063 18.1056 5.3415 17.7027 5.08741L13.5031 2.44503C13.2784 2.30354 13.0174 2.22837 12.7508 2.22837C12.4843 2.22837 12.2233 2.30354 11.9986 2.44503H11.9979ZM6.49449 4.36243L5.07457 4.67106C4.96068 4.70009 4.85604 4.757 4.77033 4.83654C4.68463 4.91607 4.62062 5.01565 4.58425 5.12608L1.59823 14.1911C1.56987 14.2774 1.559 14.3683 1.56626 14.4587C1.57351 14.5491 1.59875 14.6373 1.64051 14.7181C1.68228 14.7988 1.73976 14.8707 1.80968 14.9296C1.87959 14.9884 1.96057 15.0331 2.04799 15.0611L5.76005 16.2459C5.75394 16.1708 5.75091 16.0955 5.75095 16.0201V6.23978C5.75095 5.53552 6.02235 4.86715 6.49518 4.36243H6.49449ZM15.4938 11.8801C15.909 11.8803 16.3148 12.0019 16.6599 12.2297C17.005 12.4575 17.2739 12.7812 17.4327 13.1599C17.5914 13.5386 17.6329 13.9552 17.5517 14.3571C17.4706 14.759 17.2706 15.1282 16.9769 15.4178C16.6832 15.7075 16.3091 15.9048 15.9019 15.9846C15.4947 16.0644 15.0727 16.0232 14.6892 15.8663C14.3057 15.7093 13.9779 15.4436 13.7474 15.1028C13.5168 14.762 13.3939 14.3613 13.394 13.9515C13.394 12.8074 14.3341 11.8801 15.4938 11.8801ZM10.0995 13.5124L15.0489 8.63015C15.1753 8.50803 15.3437 8.4376 15.5204 8.43301C15.6972 8.42841 15.8691 8.48998 16.0018 8.60536C16.1344 8.72074 16.2179 8.88139 16.2355 9.05504C16.2532 9.22869 16.2036 9.40249 16.0967 9.54155L16.0387 9.60645L11.0893 14.4887C10.963 14.6108 10.7945 14.6812 10.6178 14.6858C10.4411 14.6904 10.2691 14.6288 10.1365 14.5135C10.0038 14.3981 9.92029 14.2374 9.90267 14.0638C9.88506 13.8901 9.93464 13.7163 10.0415 13.5773L10.0995 13.5124ZM15.4938 13.261C15.3083 13.261 15.1304 13.3338 14.9992 13.4633C14.868 13.5928 14.7943 13.7684 14.7943 13.9515C14.7943 14.1346 14.868 14.3102 14.9992 14.4397C15.1304 14.5692 15.3083 14.642 15.4938 14.642C15.6793 14.642 15.8572 14.5692 15.9884 14.4397C16.1196 14.3102 16.1933 14.1346 16.1933 13.9515C16.1933 13.7684 16.1196 13.5928 15.9884 13.4633C15.8572 13.3338 15.6793 13.261 15.4938 13.261ZM10.5947 7.04693C11.0099 7.04706 11.4157 7.16872 11.7608 7.39652C12.1059 7.62431 12.3749 7.94801 12.5336 8.32668C12.6924 8.70536 12.7338 9.12199 12.6527 9.5239C12.5715 9.92582 12.3715 10.295 12.0778 10.5846C11.7842 10.8743 11.4101 11.0716 11.0029 11.1514C10.5957 11.2312 10.1736 11.19 9.79012 11.0331C9.40661 10.8761 9.07886 10.6104 8.84833 10.2696C8.61779 9.92877 8.49482 9.52811 8.49496 9.1183C8.49496 7.97421 9.43504 7.04693 10.5947 7.04693ZM10.5947 8.42784C10.5029 8.4278 10.4119 8.44561 10.327 8.48027C10.2422 8.51492 10.165 8.56574 10.1 8.62983C9.96881 8.75925 9.89503 8.93483 9.89493 9.11795C9.89484 9.30107 9.96845 9.47673 10.0996 9.60628C10.2307 9.73583 10.4085 9.80866 10.594 9.80876C10.7796 9.80876 10.9575 9.73601 11.0886 9.60653C11.2198 9.47704 11.2935 9.30142 11.2935 9.1183C11.2935 8.93518 11.2198 8.75956 11.0886 8.63007C10.9575 8.50059 10.7796 8.42784 10.594 8.42784H10.5947Z",fill:"#080A0F",stroke:"#080A0F","stroke-width":"0.166667"})}),X=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.45492 6.28808C6.43123 5.31177 8.01457 5.31177 8.99089 6.28808C9.96696 7.26431 9.96685 8.84695 8.99089 9.82324C8.01457 10.7996 6.43123 10.7996 5.45492 9.82324C4.47891 8.84694 4.4788 7.26431 5.45492 6.28808ZM8.04769 7.23047C7.59205 6.77513 6.85282 6.77495 6.3973 7.23047C5.94188 7.686 5.94199 8.42526 6.3973 8.88086C6.85287 9.33643 7.59207 9.33636 8.04769 8.88086C8.5033 8.42525 8.5033 7.68608 8.04769 7.23047Z",fill:"#080A0F"}),e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.07715 1.95703C9.58012 1.90116 10.0815 2.07705 10.4395 2.43473L18.1234 10.1187C18.7739 10.7695 18.7741 11.8246 18.1234 12.4754L11.6414 18.9574C10.9907 19.6081 9.93555 19.6079 9.28467 18.9574L1.60075 11.2734C1.28783 10.9603 1.11442 10.5376 1.11328 10.0999L1.12305 9.91113L1.77165 4.0778C1.85775 3.30308 2.46909 2.69171 3.24381 2.60563L9.07715 1.95703ZM3.42773 4.26172L2.77913 10.095L10.4631 17.779L16.945 11.297L9.26107 3.61312L3.42773 4.26172Z",fill:"#080A0F"})]}),Y=({className:s})=>i("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e("g",{"clip-path":"url(#clip0_8416_45916)",children:e("path",{d:"M12.0391 0.392503C13.014 -0.174504 14.2592 0.162733 14.8206 1.14283L14.8223 1.14608L16.974 5.01978C18.2095 5.17141 19.1663 6.22452 19.1663 7.50106V16.6677C19.1661 18.0483 18.0469 19.1677 16.6663 19.1677H3.33301C1.95242 19.1677 0.833208 18.0483 0.833008 16.6677V7.50106C0.833008 6.12035 1.9523 5.00106 3.33301 5.00106H4.12077L12.0391 0.392503ZM3.33301 6.66773C2.87277 6.66773 2.49967 7.04083 2.49967 7.50106V16.6677C2.49987 17.1278 2.87289 17.5011 3.33301 17.5011H16.6663C17.1265 17.5011 17.4995 17.1278 17.4997 16.6677V15.8344H13.7497C11.6787 15.8344 9.99987 14.1553 9.99967 12.0844C9.99967 10.0133 11.6786 8.3344 13.7497 8.3344H17.4997V7.50106C17.4997 7.04083 17.1266 6.66773 16.6663 6.66773H3.33301ZM13.7497 10.0011C12.5991 10.0011 11.6663 10.9338 11.6663 12.0844C11.6665 13.2348 12.5992 14.1677 13.7497 14.1677H17.4997V10.0011H13.7497ZM13.333 11.2511C13.7932 11.2511 14.1663 11.6242 14.1663 12.0844C14.1661 12.5445 13.7931 12.9177 13.333 12.9177C12.8729 12.9177 12.4999 12.5445 12.4997 12.0844C12.4997 11.6242 12.8728 11.2511 13.333 11.2511ZM13.473 1.80526C13.3156 1.62235 13.0553 1.56238 12.8341 1.66122L12.7682 1.6954L7.08952 5.00106H9.0459L13.7708 2.32121L13.5348 1.89234L13.473 1.80526ZM11.5801 5.00106H15.2495L14.3747 3.41578L11.5801 5.00106Z",fill:"#080A0F"})}),e("defs",{children:e("clipPath",{id:"clip0_8416_45916",children:e("rect",{width:"20",height:"20",fill:"white"})})})]}),$=({className:s})=>e("svg",{className:s,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M16.667 2.49915C18.0476 2.49915 19.1668 3.61858 19.167 4.99915V14.9991C19.1668 16.3797 18.0476 17.4991 16.667 17.4991H3.33398C1.95353 17.499 0.834161 16.3796 0.833984 14.9991V4.99915C0.83416 3.61869 1.95353 2.49932 3.33398 2.49915H16.667ZM2.5 14.9991C2.50018 15.4591 2.87401 15.832 3.33398 15.8322H16.667C17.1271 15.8322 17.4998 15.4592 17.5 14.9991V8.33215H2.50098L2.5 8.33118V14.9991ZM10.001 12.5333C10.4426 12.5335 10.8007 12.8915 10.8008 13.3331C10.8008 13.7748 10.4427 14.1328 10.001 14.1329H5.00098C4.55915 14.1329 4.20117 13.775 4.20117 13.3331C4.20126 12.8914 4.5592 12.5333 5.00098 12.5333H10.001ZM3.33398 4.16516C2.874 4.16534 2.50018 4.53917 2.5 4.99915V6.66614H17.5V4.99915C17.4998 4.53906 17.1271 4.16516 16.667 4.16516H3.33398Z",fill:"#080A0F"})}),e1=({className:s})=>e("svg",{className:s,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M6.91058 4.4108C7.23602 4.08536 7.76353 4.08536 8.08897 4.4108L13.089 9.41079C13.4144 9.73623 13.4144 10.2637 13.089 10.5892L8.08897 15.5892C7.76353 15.9146 7.23602 15.9146 6.91058 15.5892C6.58515 15.2637 6.58514 14.7362 6.91058 14.4108L11.3214 9.99999L6.91058 5.58918C6.58514 5.26374 6.58514 4.73623 6.91058 4.4108Z",fill:"#080A0F"})});var h1=q;import{default as M1}from"../ProductServiceBenefits/index.js";export{M1 as ProductServiceBenefits,h1 as default};
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as P,jsx as e,jsxs as r}from"react/jsx-runtime";import w from"react";import{cn as k,formatPrice as y}from"../../../../../../helpers/index.js";import{Text as p,Link as F,Checkbox as N}from"../../../../../../components/index.js";import M from"../../../../hooks/useCopy.js";import{useBenefits as I}from"../../../../hooks/useBenefits.js";import{useBizProductContext as _}from"../../../../BizProductProvider.js";import{useComponentData as S}from"../../../../hooks/useComponentData.js";import{replaceTemplate as g}from"../../../../utils/textFormat.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import R from"../../../../../../hooks/useCountDown.js";const L=w.memo(function({endTime:a,template:t}){const{days:c,hours:i,minutes:
|
|
1
|
+
"use client";import{Fragment as P,jsx as e,jsxs as r}from"react/jsx-runtime";import w from"react";import{cn as k,formatPrice as y}from"../../../../../../helpers/index.js";import{Text as p,Link as F,Checkbox as N}from"../../../../../../components/index.js";import M from"../../../../hooks/useCopy.js";import{useBenefits as I}from"../../../../hooks/useBenefits.js";import{useBizProductContext as _}from"../../../../BizProductProvider.js";import{useComponentData as S}from"../../../../hooks/useComponentData.js";import{replaceTemplate as g}from"../../../../utils/textFormat.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import R from"../../../../../../hooks/useCountDown.js";const L=w.memo(function({endTime:a,template:t}){const{days:c,hours:i,minutes:l,seconds:m}=R({endTime:a});return e(P,{children:g(t,{countdown:`${c}:${i}:${l}:${m}`})})}),h=({checked:d,discountText:a,codeText:t,code:c,countdownText:i,copyText:l,copiedText:m,onClick:s,className:f})=>{const{copied:b,copy:C}=M();return e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",f),role:"button",tabIndex:0,onClick:s,children:r("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:[r("div",{className:"flex flex-col gap-1",children:[r("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:d}),e(p,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:a})]}),r("div",{className:"flex w-full items-center gap-2",children:[e("div",{className:"flex shrink-0 flex-col items-start",children:e(p,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]",children:t})}),e(F,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:o=>{o.preventDefault(),o.stopPropagation(),C(c)},children:b?m:l})]})]}),i&&e(p,{className:"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]",children:i})]})})};h.displayName="CouponCard";const T=({checked:d,discountText:a,description:t,onClick:c,className:i})=>e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",i),role:"button",tabIndex:0,onClick:c,children:e("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:r("div",{className:"flex flex-col gap-1",children:[r("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:d}),e(p,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:a})]}),t&&e(p,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8",children:t})]})})});T.displayName="MemberDiscountCard";const D=({className:d})=>{const{profile:a,variant:t,onUseCouponChange:c,onUseMemberDiscountChange:i,openSignInPopup:l,discount:m,savingDetail:s}=_(),{locale:f="us",trackingData:b}=B(),C=I({variant:t}),{commonCoupon:o,memberDiscount:u}=C,v=b?.common?.coupon,n=S("ProductCoupon")??{};return!o?.enable&&!u?.enable||!t?.availableForSale?null:r("div",{className:k("ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4",d),children:[n?.title&&e(p,{className:"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]",children:n.title}),o?.enable&&e(h,{checked:s?.coupon>0,discountText:g(n?.common?.offCoupon,{discount:o?.config?.value_type=="percentage"?Math.abs(Number(o?.config?.value||0))+"%":(o?.config?.formattedFixedValue??y({amount:Math.abs(Number(o?.config?.fixed_value||0)),currencyCode:t.price.currencyCode,locale:f}))||""}),codeText:g(n?.common?.withCode,{code:o?.config?.title??""}),code:o?.config?.title??"",countdownText:o?.config?.ends_at?e(L,{endTime:o.config.ends_at,template:n?.common?.endsIn??""}):void 0,copyText:v?.copy||n?.copyCode,copiedText:v?.copied||n?.copied,onClick:()=>{const x=s?.coupon?0:m?.codeSavings??0;c?.(x)}}),u?.enable&&e(T,{checked:!!a?.email&&!!s?.member,discountText:g(n?.member?.offMember,{discount:(u?.config?.formattedAmount??y({amount:u?.config?.amount??0,currencyCode:t.price.currencyCode,locale:f}))||""}),description:a?.email?n?.member?.loginDesc:r(P,{children:[e("span",{className:"mr-2",dangerouslySetInnerHTML:{__html:n?.member?.unloginDesc}}),e("span",{role:"button",tabIndex:0,onClick:x=>{x?.stopPropagation(),l?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:n?.member?.login}})]}),onClick:()=>{if(!a?.email){l?.();return}const x=s?.member?0:u?.config?.amount??0;i?.(x)}})]})};D.displayName="ProductCoupon";var K=D;export{h as CouponCard,T as MemberDiscountCard,K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const A=()=>{const{locale:u="us"}=B(),{tooltip:x,getTooltipProps:b}=T(),{freeGift:h,checkedGift:l,setCheckedGift:i,setCheckedBundle:L,setSavingDetail:g,savingDetail:k,setJoinedRecommendBuyProducts:a,joinedRecommendBuyProducts:s,setAddOrder:c}=F(),{title:v,giftList:p=[],freeLabel:C}=h||{},n=w(()=>p?.filter(e=>e.availableForSale),[p]),N=e=>{l?.id===e.id?(i?.(void 0),g?.({...k,freeGift:0}),a?.({...s,gift:{value:void 0,canOperate:!0}}),c?.(d=>d.filter(m=>m!=="gift"))):(i?.(e),a?.({...s,gift:{value:e,canOperate:!1}}),c?.(d=>[...d.filter(y=>y!=="gift"),"gift"]))};return n?.length?o("div",{className:"ipc-product-detail-free-gift",children:[t(r,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:v}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:n.map(e=>o("div",{className:f("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[t(E,{onCheckedChange:()=>N(e),size:"lg",className:f("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(P,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(r,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...x})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:C}),t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:e.price.formattedAmount??G({amount:e.price.amount,locale:u,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var I=D(A);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as N,useState as y}from"react";import{Dialog as D,DialogTrigger as C,DialogContent as h,DialogHeader as E,DialogTitle as G,Grid as c,GridItem as o,Text as f}from"../../../../../../components/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import I from"./Select.js";import{useAiuiContext as k}from"../../../../../AiuiProvider/index.js";import{formatPrice as g}from"../../../../utils/index.js";import{ShopifyColorOption as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as N,useState as y}from"react";import{Dialog as D,DialogTrigger as C,DialogContent as h,DialogHeader as E,DialogTitle as G,Grid as c,GridItem as o,Text as f}from"../../../../../../components/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import I from"./Select.js";import{useAiuiContext as k}from"../../../../../AiuiProvider/index.js";import{formatPrice as g}from"../../../../utils/index.js";import{ShopifyColorOption as P}from"./ShopifyColorOption.js";const z=()=>{const{locale:u="us",copyWriting:n}=k(),{compareData:p,product:b}=w(),[m,x]=y();N(()=>{x(p?.availableCompareList[0]?.handle)},[p?.availableCompareList]);const d=[p?.currentProductCompareData?.product,p?.availableCompareList.find(a=>a.handle===m)?.product].filter(Boolean);return p?.specificationKeys?r(D,{children:[e(C,{className:"text-base font-bold leading-[1.4]",children:n?.compare}),r(h,{overlayClassName:"z-[100]",className:"rounded-box bg-white [&_.dialog-close-icon]:laptop:size-6 laptop:p-0 laptop:w-[896px] z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden !py-0 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[e(E,{className:"laptop:pt-4 laptop:pb-3 laptop:px-8 px-4 pb-2 pt-4",children:e(G,{className:"laptop:text-[24px] text-left text-[20px] font-bold",children:n?.compare})}),r("div",{className:"laptop:px-8 h-[calc(80vh-64px)] overflow-y-auto px-4",children:[r(c,{className:"laptop:py-3 grid-cols-3 items-center gap-[40px] py-4",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#595959]",children:n?.product||"Product"})}),e(o,{span:1,children:e(f,{as:"div",className:"rounded-btn flex h-[48px] w-full items-center border border-[#E8E8E8] px-4 text-[16px] font-bold",html:p.currentProductCompareData?.shortName||b.title})}),m&&e(o,{span:1,children:e(I,{className:"rounded-btn h-[48px] px-4",value:m,onChange:a=>{x(a)},list:p.options})})]}),r(c,{className:"laptop:gap-8 laptop:py-3 grid-cols-3 py-4",children:[e(o,{span:1}),d.map((a,s)=>e(o,{span:1,className:"flex items-center",children:e("img",{src:a.images[0].url,alt:a.title,className:"size-[100px]",role:"presentation"})},s))]}),r(c,{className:"laptop:py-6 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e(o,{span:1}),d.map((a,s)=>{const t=a.variants[0];return e(o,{span:1,className:"flex h-full",children:e("div",{className:"flex flex-col gap-[8px]",children:t.price.amount<9999999&&e("div",{className:"flex items-center gap-[8px]",children:r("div",{className:"flex items-center gap-[6px]",children:[e("span",{className:"text-[18px] font-bold",children:(t?.coupons?.[0]?.variant_price4wscode?t.coupons[0].formattedVariantPrice4wscode:t.price.formattedAmount)??g({locale:u,amount:t?.coupons?.[0]?.variant_price4wscode||t.price.amount,currencyCode:t.price.currencyCode})}),Number(t?.coupons?.[0]?.variant_price4wscode)>0&&e("span",{className:"text-[18px] font-bold text-[#6D6D6F] line-through",children:t.price.formattedAmount??g({locale:u,amount:t.price.amount,currencyCode:t.price.currencyCode})})]})})})},s)})]}),r(c,{className:"laptop:py-6 grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e(o,{span:1,children:e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:n?.color||"Color"})}),d.map((a,s)=>{const t=a.options?.find(l=>["color","colour","couleur"].find(i=>l.name.toLowerCase().includes(i)))?.values.map(l=>l.label);return e(o,{span:1,className:"flex h-full",children:t?.length&&e("div",{className:"flex items-center gap-4",children:t.map(l=>e(P,{label:l,className:"size-6"},l))})},s)})]}),e(c,{className:"laptop:gap-0 grid-cols-12 items-center gap-0 border-b border-[#E8E8E8]",children:p.specificationKeys?.map(a=>r(o,{span:12,className:"laptop:py-6 laptop:gap-4 grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-4",children:[e("div",{className:"text-[16px] font-bold text-[#6D6D6F]",children:a}),d.map((s,t)=>{let i=s.metafields?.global?.specifications?.find(v=>v?.key===a)?.value||"";switch(i.trim().toLowerCase()){case"true":i="\u2714\uFE0F";break;case"false":i="\u274C";break;default:break}return e("div",{className:"flex items-center",children:e(f,{className:"text-[16px] font-bold text-[#1D1D1F]",html:i})},t)})]},a))})]})]})]}):null};var K=z;export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useAiuiContext as Z}from"../../../../AiuiProvider/index.js";import{Text as J,Picture as W,Badge as oe}from"../../../../../components/index.js";import{useCallback as N,useMemo as Y,useState as E,forwardRef as Q,useRef as V,useEffect as R,useImperativeHandle as re}from"react";import{Swiper as $,SwiperSlide as B}from"swiper/react";import{Navigation as K,Mousewheel as X,Thumbs as O,Pagination as ee,Autoplay as ne}from"swiper/modules";import{cn as L}from"../../../../../helpers/index.js";import{GalleryTabType as _}from"./types.js";import{Content as se,List as ce,Root as de,Trigger as ue}from"@radix-ui/react-tabs";import{useBizProductContext as q}from"../../../BizProductProvider.js";import{useVariantMedia as pe}from"../../../hooks/use-variant-media.js";import{SpecsModal as me}from"./components/SpecsModal.js";import be from"./components/CompareModal.js";import{formatPrice as ge}from"../../../utils/index.js";import{withLayout as fe}from"../../../../../shared/Styles.js";import{gaTrack as ve}from"../../../../../shared/track.js";import{ExposureDetector as ye}from"../../../../../components/index.js";import{debounce as te}from"es-toolkit";const ae=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),t("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),le=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),t("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),he=()=>{const{copyWriting:e}=Z(),{product:r,variant:c,selectedOptions:P}=q(),m=pe({product:r,variant:c}),[f,S]=E(null),A=V(null),T=c?.metafields?.component?.custom_media_list;let o,v,y,h;T&&T?.available?(o=T?.product||[],v=T?.scenarios||[],y=T?.keyFeatures||[],h=T?.video||[]):(o=m?.productList,v=m?.sceneList,y=m?.keyFeaturesList,h=m?.videoList);const k=Y(()=>[...o,...v,...h],[o,v,h]),I={productList:o,sceneList:v,keyFeaturesList:y,videoList:h},d=Y(()=>{const i=r?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[],s=c?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[];return i?.map(g=>{const G=Array.isArray(s)?s?.find(F=>g?.galleries===F?.galleries):{};let D=I[g?.galleries]||[];if(G?.images&&Array.isArray(G.images)&&G.images.length>0){const F=G.images.map(u=>{const C=[];if(u.image_1920&&u.image_1920.trim()&&C.push(`${u.image_1920}`),u.image_1440&&u.image_1440.trim()&&C.push(`${u.image_1440} 1919`),u.image_1024&&u.image_1024.trim()&&C.push(`${u.image_1024} 1439`),u.image_768&&u.image_768.trim()&&C.push(`${u.image_768} 1023`),u.image_390&&u.image_390.trim()&&C.push(`${u.image_390} 767`),C.length>0){const U=C.join(", ");return{image:{url:U,altText:g.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(u=>u!==null);F.length>0&&(D=F)}return{...g,galleries:D}}).filter(g=>g.galleries.length>0)},[c?.payload,I,r?.payload]),[n,a]=E(d?.[0]),[l,p]=E(0),[b,w]=E(null),M=N(()=>{const i=(l+1)%d.length;p(i),a(d[i]),w(0)},[l,d]),z=N(()=>{const i=l===0?d.length-1:l-1;p(i),a(d[i]);const s=d[i]?.galleries||[];w(s.length-1)},[l,d]);R(()=>{l!=null&&requestAnimationFrame(()=>{A.current?.scrollToTab(l)})},[l]),R(()=>{a(d[0]),p(0)},[c?.id]);const H=(i,s)=>{switch(i?.galleryTabType){case _.GALLERY_IMAGE_MAIN:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_IMAGE_FEATURES:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_IMAGE_SCENE:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_VIDEO:return t(Te,{...i,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});default:return null}};return t("div",{id:"ipc-product-gallery",children:x(de,{className:"relative",value:n?.tabValue,defaultValue:d?.[0]?.tabValue,children:[t("div",{className:"tablet:h-[620px] laptop-md:rounded-2xl laptop-md:h-[560px] lg-desktop:h-[700px] laptop-md:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:d.map((i,s)=>t(se,{className:"h-full",value:i.tabValue,children:H(i,s)},i.tabValue))}),t(ie,{ref:A,galleryTabs:d,activeGalleryTab:n,setActiveGalleryTab:a,setActiveTabIndex:p,setTargetSlideIndex:w})]})})},ie=Q((e,r)=>{const{galleryTabs:c,activeGalleryTab:P,setActiveGalleryTab:m,setActiveTabIndex:f,setTargetSlideIndex:S}=e,{product:A,compareData:T}=q(),o=V(null),v=V(new Map),y=!!A.metafields?.global?.specifications?.length,h=!!T?.specificationKeys?.length,k=N(n=>{if(o.current){const a=o.current,l=n.currentTarget,p=l.offsetLeft-a.offsetWidth/2+l.offsetWidth/2;a.scrollTo({left:p,behavior:"smooth"})}},[]),I=N((n,a,l)=>{m(a),f(l),S(0),k(n)},[m,f,S,k]),d=N(n=>{if(o.current&&c[n]){const a=o.current,l=c[n],p=v.current.get(l.tabValue);if(p){const b=p.offsetLeft-a.offsetWidth/2+p.offsetWidth/2;a.scrollTo({left:b,behavior:"smooth"})}}},[c]);return re(r,()=>({scrollToTab:d})),x("div",{className:"laptop:inset-x-16 tablet:mt-3 laptop-md:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[t(ce,{ref:o,className:"laptop:p-0 laptop-md:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t("div",{className:"whitespace-nowrap",children:c?.map((n,a)=>t(ue,{ref:l=>{l?v.current.set(n.tabValue,l):v.current.delete(n.tabValue)},className:L("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",n.tabValue===P?.tabValue&&"bg-white"),onClick:l=>I(l,n,a),value:n.tabValue,children:n.tabLabel},n.tabValue+a))})}),(y||h)&&x("div",{className:"desktop:gap-2 desktop:flex hidden",children:[y&&t(me,{}),y&&h&&t("span",{children:"|"}),h&&t(be,{})]})]})});ie.displayName="ProductGalleryTab";const j=Q((e,r)=>{const{locale:c="us",copyWriting:P}=Z(),{variant:m,totalSavings:f}=q(),S=V(null),[A,T]=E(null),[o,v]=E(null),[y,h]=E([]),k=V(null),I=Y(()=>{if(e?.galleryTabType===_.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";e?.galleryTabType===_.GALLERY_IMAGE_FEATURES||(e?.galleryTabType,_.GALLERY_IMAGE_SCENE)},[e?.galleryTabType]),d=N(()=>{o?.isBeginning?e.onPrevTab?.():o?.slidePrev()},[o,e]),n=N(()=>{o?.isEnd?e.onNextTab?.():o?.slideNext()},[o,e]);return R(()=>{o&&e.targetSlideIndex&&(o.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[o,e.targetSlideIndex,e]),R(()=>{const a=()=>{if(!e?.comment?.content||!k.current)return;const b=k.current;b.textContent="Test";const M=b.offsetHeight*2+2,H=e.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),i=[];let s="";for(let g=0;g<H.length;g++){const G=H[g],D=s?`${s} ${G}`:G;b.textContent=D,b.offsetHeight>M?s?(i.push(s),s=G):(i.push(G),s=""):s=D}s&&i.push(s),b.textContent="",h(i)},l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{a()})}),p=()=>{a()};return window.addEventListener("resize",te(p,500)),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",te(p,500))}},[e?.comment?.content]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{ref:r,className:"h-full",onSwiper:v,onTouchEnd:(a,l)=>{a.isBeginning&&a.swipeDirection==="prev"?d():a.isEnd&&a.swipeDirection==="next"&&n()},pagination:{clickable:!0,el:S.current},thumbs:{swiper:A},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((a,l)=>{const p=`${e.tabValue}-${l}`,b=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${m.sku}`,component_type:"image",component_name:e?.tabLabel||"",position:l+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},w=a?._responsiveSource||a?.image?.url||"";return t(B,{className:"h-full",children:t(ye,{onExposure:b,exposureKey:p,threshold:.5,duration:2e3,className:"h-full",children:t(W,{source:w,alt:a?.image?.altText,className:L("h-full",I),imgClassName:"object-cover h-full"})})},e?.id+"SwiperSlideItem"+l)})}),m.availableForSale&&!!f&&!e.index&&t(oe,{size:"lg",className:"bg-brand-0 laptop:left-16 laptop:top-5 laptop-md:left-6 laptop-md:top-6 absolute left-4 top-3 z-[2] text-white",children:`${ge({amount:f,currencyCode:m?.price?.currencyCode,locale:c})} ${P?.off}`}),t("div",{className:L("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 laptop-md:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:d,children:t(ae,{className:L("tablet:size-10 lg-desktop:size-12")})}),t("div",{className:L("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 laptop-md:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:n,children:t(le,{className:L("tablet:size-10 lg-desktop:size-12")})}),x("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 laptop-md:bottom-[20px] laptop-md:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[t("div",{className:"tablet:block hidden",children:t($,{className:"flex items-center justify-between",onSwiper:T,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[K,O],children:e?.galleries?.map((a,l)=>t(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:t(W,{source:a.image?.url,alt:a.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},e?.id+"SwiperSlideThumbItem"+l))})}),!e?.index&&x("div",{className:"flex items-center gap-2",children:[t(W,{source:e?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),x("div",{className:"relative max-w-[528px]",children:[t("div",{ref:k,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),t($,{modules:[ne],loop:y.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:y.length>0?y.map((a,l)=>t(B,{children:t(J,{html:a,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},l+"text-group")):t(B,{children:t(J,{as:"div",html:e?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]})]}),t("div",{ref:S,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})});j.displayName="ProductGalleryTabImage";const xe=({src:e})=>{const r=V(null);return R(()=>{const c=r.current;c&&(c.muted=!0,c.play().catch(()=>{}))},[]),x("video",{ref:r,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,controls:!0,className:"w-full mt-20 laptop:size-full laptop:mt-0 aspect-video laptop:aspect-auto object-cover",children:[t("track",{kind:"captions"}),t("source",{src:e,type:"video/mp4"}),t("source",{src:e,type:"video/webm"}),t("source",{src:e,type:"video/ogg"})]})},Te=e=>{const[r,c]=E(null),P=N(()=>{r?.isBeginning?e.onPrevTab?.():r?.slidePrev()},[r,e]),m=N(()=>{r?.isEnd?e.onNextTab?.():r?.slideNext()},[r,e]);return R(()=>{r&&e.targetSlideIndex!==null&&e.targetSlideIndex!==void 0&&(r.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[r,e.targetSlideIndex,e]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{className:"h-full",onSwiper:c,onTouchEnd:(f,S)=>{f.isBeginning&&f.swipeDirection==="prev"?P():f.isEnd&&f.swipeDirection==="next"&&m()},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((f,S)=>t(B,{className:"h-full bg-info-primary",children:t(xe,{src:f?.sources?.[0]?.url})},e?.id+"SwiperSlideItem"+S))}),t("div",{className:L("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:P,children:t(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),t("div",{className:L("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:m,children:t(le,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Fe=e=>t("div",{children:"3D View"});var Be=fe(he);export{Be as default};
|
|
1
|
+
import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useAiuiContext as Z}from"../../../../AiuiProvider/index.js";import{Text as J,Picture as j,Badge as oe}from"../../../../../components/index.js";import{useCallback as S,useMemo as W,useState as E,forwardRef as Q,useRef as z,useEffect as D,useImperativeHandle as re}from"react";import{Swiper as H,SwiperSlide as B}from"swiper/react";import{Navigation as Y,Mousewheel as X,Thumbs as K,Pagination as ee,Autoplay as ne}from"swiper/modules";import{cn as L}from"../../../../../helpers/index.js";import{GalleryTabType as V}from"./types.js";import{Content as se,List as ce,Root as de,Trigger as ue}from"@radix-ui/react-tabs";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useVariantMedia as pe}from"../../../hooks/use-variant-media.js";import{SpecsModal as me}from"./components/SpecsModal.js";import be from"./components/CompareModal.js";import{formatPrice as ge}from"../../../utils/index.js";import{withLayout as fe}from"../../../../../shared/Styles.js";import{gaTrack as ve}from"../../../../../shared/track.js";import{ExposureDetector as ye}from"../../../../../components/index.js";import{debounce as te}from"es-toolkit";const ae=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),t("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),le=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),t("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),he=()=>{const{copyWriting:e}=Z(),{product:o,variant:c,selectedOptions:k}=O(),g=pe({product:o,variant:c}),[f,G]=E(null),C=z(null),T=c?.metafields?.component?.custom_media_list;let v,s,w,y;T&&T?.available?(v=T?.product||[],s=T?.scenarios||[],w=T?.keyFeatures||[],y=T?.video||[]):(v=g?.productList,s=g?.sceneList,w=g?.keyFeaturesList,y=g?.videoList);const F=W(()=>[...v,...s,...y],[v,s,y]),N={productList:v,sceneList:s,keyFeaturesList:w,videoList:y},p=W(()=>{const i=o?.payload?.components?.find(n=>n.componentKey==="ProductGallery")?.data||[],b=c?.payload?.components?.find(n=>n.componentKey==="ProductGallery")?.data||[];return i?.map(n=>{const P=Array.isArray(b)?b?.find(I=>n?.galleries===I?.galleries):{};let A=N[n?.galleries]||[];if(P?.images&&Array.isArray(P.images)&&P.images.length>0){const I=P.images.map(u=>{const M=[];if(u.image_1920&&u.image_1920.trim()&&M.push(`${u.image_1920}`),u.image_1440&&u.image_1440.trim()&&M.push(`${u.image_1440} 1919`),u.image_1024&&u.image_1024.trim()&&M.push(`${u.image_1024} 1439`),u.image_768&&u.image_768.trim()&&M.push(`${u.image_768} 1023`),u.image_390&&u.image_390.trim()&&M.push(`${u.image_390} 767`),M.length>0){const U=M.join(", ");return{image:{url:U,altText:n.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(u=>u!==null);I.length>0&&(A=I)}return{...n,galleries:A}}).filter(n=>n.galleries.length>0)},[c?.payload,N,o?.payload]),[r,d]=E(p?.[0]),[a,l]=E(0),[h,m]=E(null),_=S(()=>{const i=(a+1)%p.length;l(i),d(p[i]),m(0)},[a,p]),R=S(()=>{const i=a===0?p.length-1:a-1;l(i),d(p[i]);const b=p[i]?.galleries||[];m(b.length-1)},[a,p]);D(()=>{a!=null&&requestAnimationFrame(()=>{C.current?.scrollToTab(a)})},[a]),D(()=>{d(p[0]),l(0)},[c?.id]);const q=(i,b)=>{switch(i?.galleryTabType){case V.GALLERY_IMAGE_MAIN:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_IMAGE_FEATURES:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_IMAGE_SCENE:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_VIDEO:return t(Te,{...i,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});default:return null}};return t("div",{id:"ipc-product-gallery",children:x(de,{className:"relative",value:r?.tabValue,defaultValue:p?.[0]?.tabValue,children:[t("div",{className:"tablet:h-[620px] laptop-md:rounded-2xl laptop-md:h-[560px] lg-desktop:h-[700px] laptop-md:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:p.map((i,b)=>t(se,{className:"h-full",value:i.tabValue,children:q(i,b)},i.tabValue))}),t(ie,{ref:C,galleryTabs:p,activeGalleryTab:r,setActiveGalleryTab:d,setActiveTabIndex:l,setTargetSlideIndex:m})]})})},ie=Q((e,o)=>{const{galleryTabs:c,activeGalleryTab:k,setActiveGalleryTab:g,setActiveTabIndex:f,setTargetSlideIndex:G}=e,{product:C,compareData:T}=O(),v=z(null),s=z(new Map),w=!!C.metafields?.global?.specifications?.length,y=!!T?.specificationKeys?.length,F=S(r=>{if(v.current){const d=v.current,a=r.currentTarget,l=a.offsetLeft-d.offsetWidth/2+a.offsetWidth/2;d.scrollTo({left:l,behavior:"smooth"})}},[]),N=S((r,d,a)=>{g(d),f(a),G(0),F(r)},[g,f,G,F]),p=S(r=>{if(v.current&&c[r]){const d=v.current,a=c[r],l=s.current.get(a.tabValue);if(l){const h=l.offsetLeft-d.offsetWidth/2+l.offsetWidth/2;d.scrollTo({left:h,behavior:"smooth"})}}},[c]);return re(o,()=>({scrollToTab:p})),x("div",{className:"laptop:inset-x-16 tablet:mt-3 laptop-md:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[t(ce,{ref:v,className:"laptop:p-0 laptop-md:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t("div",{className:"whitespace-nowrap",children:c?.map((r,d)=>t(ue,{ref:a=>{a?s.current.set(r.tabValue,a):s.current.delete(r.tabValue)},className:L("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",r.tabValue===k?.tabValue&&"bg-white"),onClick:a=>N(a,r,d),value:r.tabValue,children:r.tabLabel},r.tabValue+d))})}),(w||y)&&x("div",{className:"desktop:gap-2 desktop:flex hidden",children:[w&&t(me,{}),w&&y&&t("span",{children:"|"}),y&&t(be,{})]})]})});ie.displayName="ProductGalleryTab";const $=Q((e,o)=>{const{locale:c="us",copyWriting:k}=Z(),{variant:g,totalSavings:f,formattedPrices:G}=O(),C=z(null),[T,v]=E(null),[s,w]=E(null),[y,F]=E([]),N=z(null),p=W(()=>{if(e?.galleryTabType===V.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";e?.galleryTabType===V.GALLERY_IMAGE_FEATURES||(e?.galleryTabType,V.GALLERY_IMAGE_SCENE)},[e?.galleryTabType]),r=S(()=>{s?.isBeginning?e.onPrevTab?.():s?.slidePrev()},[s,e]),d=S(()=>{s?.isEnd?e.onNextTab?.():s?.slideNext()},[s,e]);return D(()=>{s&&e.targetSlideIndex&&(s.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[s,e.targetSlideIndex,e]),D(()=>{const a=()=>{if(!e?.comment?.content||!N.current)return;const m=N.current;m.textContent="Test";const R=m.offsetHeight*2+2,i=e.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),b=[];let n="";for(let P=0;P<i.length;P++){const A=i[P],I=n?`${n} ${A}`:A;m.textContent=I,m.offsetHeight>R?n?(b.push(n),n=A):(b.push(A),n=""):n=I}n&&b.push(n),m.textContent="",F(b)},l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{a()})}),h=()=>{a()};return window.addEventListener("resize",te(h,500)),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",te(h,500))}},[e?.comment?.content]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t(H,{ref:o,className:"h-full",onSwiper:w,onTouchEnd:(a,l)=>{a.isBeginning&&a.swipeDirection==="prev"?r():a.isEnd&&a.swipeDirection==="next"&&d()},pagination:{clickable:!0,el:C.current},thumbs:{swiper:T},modules:[X,K,Y,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((a,l)=>{const h=`${e.tabValue}-${l}`,m=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${g.sku}`,component_type:"image",component_name:e?.tabLabel||"",position:l+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},_=a?._responsiveSource||a?.image?.url||"";return t(B,{className:"h-full",children:t(ye,{onExposure:m,exposureKey:h,threshold:.5,duration:2e3,className:"h-full",children:t(j,{source:_,alt:a?.image?.altText,className:L("h-full",p),imgClassName:"object-cover h-full"})})},e?.id+"SwiperSlideItem"+l)})}),g.availableForSale&&!!f&&!e.index&&t(oe,{size:"lg",className:"bg-brand-0 laptop:left-16 laptop:top-5 laptop-md:left-6 laptop-md:top-6 absolute left-4 top-3 z-[2] text-white",children:`${G?.totalSavings??ge({amount:f,currencyCode:g?.price?.currencyCode,locale:c})} ${k?.off}`}),t("div",{className:L("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 laptop-md:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:r,children:t(ae,{className:L("tablet:size-10 lg-desktop:size-12")})}),t("div",{className:L("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 laptop-md:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:d,children:t(le,{className:L("tablet:size-10 lg-desktop:size-12")})}),x("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 laptop-md:bottom-[20px] laptop-md:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[t("div",{className:"tablet:block hidden",children:t(H,{className:"flex items-center justify-between",onSwiper:v,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[Y,K],children:e?.galleries?.map((a,l)=>t(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:t(j,{source:a.image?.url,alt:a.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},e?.id+"SwiperSlideThumbItem"+l))})}),!e?.index&&x("div",{className:"flex items-center gap-2",children:[t(j,{source:e?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),x("div",{className:"relative max-w-[528px]",children:[t("div",{ref:N,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),t(H,{modules:[ne],loop:y.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:y.length>0?y.map((a,l)=>t(B,{children:t(J,{html:a,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},l+"text-group")):t(B,{children:t(J,{as:"div",html:e?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]})]}),t("div",{ref:C,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})});$.displayName="ProductGalleryTabImage";const xe=({src:e})=>{const o=z(null);return D(()=>{const c=o.current;c&&(c.muted=!0,c.play().catch(()=>{}))},[]),x("video",{ref:o,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,controls:!0,className:"w-full mt-20 laptop:size-full laptop:mt-0 aspect-video laptop:aspect-auto object-cover",children:[t("track",{kind:"captions"}),t("source",{src:e,type:"video/mp4"}),t("source",{src:e,type:"video/webm"}),t("source",{src:e,type:"video/ogg"})]})},Te=e=>{const[o,c]=E(null),k=S(()=>{o?.isBeginning?e.onPrevTab?.():o?.slidePrev()},[o,e]),g=S(()=>{o?.isEnd?e.onNextTab?.():o?.slideNext()},[o,e]);return D(()=>{o&&e.targetSlideIndex!==null&&e.targetSlideIndex!==void 0&&(o.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[o,e.targetSlideIndex,e]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t(H,{className:"h-full",onSwiper:c,onTouchEnd:(f,G)=>{f.isBeginning&&f.swipeDirection==="prev"?k():f.isEnd&&f.swipeDirection==="next"&&g()},modules:[X,K,Y,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((f,G)=>t(B,{className:"h-full bg-info-primary",children:t(xe,{src:f?.sources?.[0]?.url})},e?.id+"SwiperSlideItem"+G))}),t("div",{className:L("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:k,children:t(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),t("div",{className:L("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:g,children:t(le,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Fe=e=>t("div",{children:"3D View"});var Be=fe(he);export{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Text as s,Button as X,Grid as Y,GridItem as M,Picture as S,Heading as Z}from"../../../../../components/index.js";import{useBizProductContext as A}from"../../../BizProductProvider.js";import{useComponentData as tt}from"../../../hooks/useComponentData.js";import{useEffect as et,useMemo as y,useState as at}from"react";import{formatPrice as V}from"../../../utils/index.js";import{useAiuiContext as I}from"../../../../AiuiProvider/index.js";import{replaceTemplate as ot}from"../../../utils/textFormat.js";import{calcSummaryFinalPrice as lt}from"../../../utils/priceCalc.js";import{withLayout as it}from"../../../../../shared/Styles.js";import{ExposureDetector as rt}from"../../../../../components/index.js";import{gaTrack as nt}from"../../../../../shared/track.js";import st from"../../CartActionButtons/index.js";const ct=()=>{const{locale:N="us",copyWriting:o,trackingData:u}=I(),{product:p,variant:l,finalPrice:m,comparePrice:f,coupon:h,selectedOptions:i,selectedVariants:x,totalSavings:k,onAddToCart:P,onBuyNow:w,savingDetail:c,checkedBundle:g,joinedRecommendBuyProducts:e,setJoinedRecommendBuyProducts:B,setSavingDetail:mt,addToCartLoading:q,buyNowLoading:W,notifyMeMode:J,onNotifyMeClick:Q,profile:$,addOrder:O,setAddOrder:_,formattedPrices:D}=A(),C=r=>V({amount:r,currencyCode:l.price.currencyCode,locale:N}),G=u?.showComparePrice??!0,v=tt("ProductSummary")??{},[j]=x,z=y(()=>lt({price:j?.price?.amount||0,memberSaving:c?.member,couponSaving:c?.coupon,isLogin:!!$?.email}),[j,g,$,c?.member,c?.coupon]),{giftVariant:L}=pt()||{},[d,E]=at();et(()=>{E({gift:e.gift?.value?void 0:L})},[L,e]);const H=y(()=>{const r=[];return O&&O.forEach((n,b)=>{e[n]?.value&&r.push({type:n,key:`${n}-${b}`})}),r},[O,e]),K=y(()=>{const r=i?.quantity||"",n=i?.color||i?.colour||i?.couleur||"";return`${r&&n?`${r} | ${n}`:r||n}`},[i?.quantity,i?.color,i?.colour,i?.couleur]),U=y(()=>{const{image_1920:r,image_1440:n,image_1024:b,image_768:F,image_390:T}=v?.thumbnail||{};return(v?.thumbnail?`${r} 1920, ${n} 1440, ${b} 1024, ${F} 768, ${T} 390`:l.image?.url)||l.image?.url},[v?.thumbnail,l.image?.url]);return l.availableForSale?t("div",{className:"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16",children:t("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:a(Y,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[a(M,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[t(Z,{className:"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:v?.readyWant?.replace?.("{title}",p?.title)}),t("div",{className:"",children:t(S,{source:U,className:"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]",imgClassName:"object-cover h-full"})})]}),a(M,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[a("div",{children:[a("div",{className:"flex flex-col gap-4",children:[t(rt,{exposureKey:"listing_selector",onExposure:()=>{nt({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${l.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:a("div",{className:"flex items-center justify-between gap-6",children:[a("div",{className:"flex items-center gap-4",children:[t(S,{source:l.image?.url||p?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),a("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:p.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:K})]})]}),a("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:D?.summaryFinalPrice??C(z)}),G&&z<l?.price?.amount&&t(s,{className:"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:l?.price?.formattedAmount??C(l?.price?.amount)})]})]})}),H.map(({type:r,key:n})=>r==="gift"&&e?.gift?.value?t(R,{giftOperation:b=>{B?.({...e,gift:{value:void 0,canOperate:!0}}),E?.({...d,gift:b}),_?.(F=>F.filter(T=>T!=="gift"))},status:!!e?.gift,gift:e?.gift?.value,canOperate:e?.gift?.canOperate},n):null)]}),d?.gift&&a("div",{className:"laptop-md:mt-8 mt-6",children:[t(s,{className:"laptop-md:text-[18px] text-sm font-bold",html:v?.recommendBuy}),t("div",{className:"laptop-md:gap-4 mt-4 flex flex-col gap-6",children:d?.gift&&t(R,{giftOperation:r=>{B?.({...e,gift:{value:r,canOperate:!0}}),E?.({...d,gift:void 0}),_?.(n=>[...n,"gift"])},canOperate:e?.gift?.canOperate,status:!d?.gift,gift:d?.gift})})]})]}),a("div",{className:"text-right",children:[t(s,{className:"laptop:text-xl laptop-md:text-2xl text-right font-bold",html:`${ot(o?.totalPrice||"",{amount:D?.finalPrice??C(parseFloat(m.toFixed(2)))})}`}),G&&k>0&&t(s,{className:"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:D?.comparePrice??C(f)}),t("div",{className:"mt-4 flex justify-end gap-3",children:t(st,{mode:J,availableForSale:l.availableForSale,addToCartText:o?.addToCart,buyNowText:o?.shopNow,addToCartLoading:q,buyNowLoading:W,addToCartClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",buyNowClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",onAddToCart:P,onBuyNow:w,onNotifyMeClick:Q,notifyMeText:o?.notifyMe,notifyMeClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2"})})]})]})]})})}):null},pt=()=>{const{bundle:N,variant:o,checkedBundle:u,freeGift:p,checkedGift:l}=A();let m;const{giftList:f=[]}=p||{},[h]=f?.filter(i=>i.availableForSale)??[];return m=l||h,{giftVariant:m}},R=({giftOperation:N,gift:o,status:u,canOperate:p})=>{const{locale:l="us",copyWriting:m}=I(),{freeGift:f,setCheckedGift:h}=A(),{freeLabel:i}=f||{},{options:x}=o||{},k=y(()=>{const P=x?.find(e=>e.name==="color"||e.name==="colour"||e.name==="couleur")||{},w=x?.find(e=>e.name==="quantity")||{},c=P?P.values?.[0]?.label:"",g=w?w.values?.[0]?.label:"";return`${c&&g?g+" | "+c:g||c} | ${i}`},[i,x]);return a("div",{className:"flex items-center justify-between gap-6",children:[a("div",{className:"flex items-center gap-4",children:[t(S,{source:o?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),a("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:o?.product?.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:k})]})]}),a("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!o&&a("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:i}),t(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:o.price.formattedAmount??V({amount:o.price.amount,locale:l,currencyCode:o.price.currencyCode})})]}),p&&t(X,{size:"icon",variant:"link",onClick:()=>{h?.(u?void 0:o),N(o)},className:"size-auto shrink-0 underline",children:u?m?.remove:m?.add})]})]})};var Ot=it(ct);export{Ot as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as u}from"react/jsx-runtime";import{Text as r,Container as E}from"../../../../../components/index.js";import{useAiuiContext as O}from"../../../../AiuiProvider/index.js";import{useBizProductContext as U}from"../../../BizProductProvider.js";import{useMemo as C}from"react";import{formatPrice as _}from"../../../utils/index.js";import{replaceTemplate as y}from"../../../utils/textFormat.js";import{calcUnlockedSaving as j}from"../../../utils/priceCalc.js";import{useBenefits as q}from"../../../hooks/useBenefits.js";import z from"../../CartActionButtons/index.js";const W=({totalSavingsSlot:N,renderComparePrice:x}={})=>{const{copyWriting:e,locale:d="us",trackingData:h,currencyCode:S}=O(),{variant:o,finalPrice:w,totalSavings:n,isLogin:s,comparePrice:b,onAddToCart:P,onBuyNow:k,savingDetail:p,addToCartLoading:T,buyNowLoading:M,notifyMeMode:A,onNotifyMeClick:B,discount:$,memberFunctionResult:f,formattedPrices:a}=U(),F=q({variant:o}),{commonCoupon:i,memberDiscount:l}=F,D=h?.showComparePrice??!0,c=m=>_({amount:m,currencyCode:o.price.currencyCode,locale:S==="CAD"?"us":d||"us"}),R=C(()=>y(e?.totalSavings||"",{amount:a?.totalSavings??c(n)}),[e?.totalSavings,n,o.price.currencyCode,d,a?.totalSavings]),g=C(()=>{if(!e?.unlockedSaving)return;const m=i?.enable?Number(i?.config?.fixed_value||0):0,L=l?.enable?l.config?.amount??0:0,v=j({memberSaving:L,couponSaving:m,exclusive:!!f?.withoutCouponMaxMemberTotalSave});if(!(v<=0))return y(e.unlockedSaving,{amount:a?.unlockedSaving??c(v)})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,l?.enable,l?.config?.amount,f,o.price.currencyCode,d,a?.unlockedSaving]);return u(E,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 lg-desktop:px-grid tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[o.availableForSale?u("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[t(r,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:a?.finalPrice??c(parseFloat(w.toFixed(2)))}),x?x({comparePrice:b}):D&&(n>0||p?.member>0&&s)&&t(r,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:a?.comparePrice??c(b)}),p?.member>0&&s&&t(r,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),N||(n>0||p?.member>0&&s?t(r,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${R}`}):g?t(r,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:g}):null)]}):t(r,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),t("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:t(z,{mode:A,availableForSale:o.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:T,buyNowLoading:M,onAddToCart:P,onBuyNow:k,onNotifyMeClick:B,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Z=W;export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useBizProductContext as
|
|
1
|
+
import{useBizProductContext as C}from"../BizProductProvider.js";import{checkItemAvailableForProduct as h}from"../utils/helper.js";import{useDiscountEnable as G}from"./useDiscountEnable.js";import{useAiuiContext as D}from"../../AiuiProvider/index.js";const x=({variant:e})=>{const{coupon:i,product:a,bundle:r,freeGift:c,functionFreeGift:f,memberFunctionResult:o,creditsRedemption:s,profile:d,formattedPrices:p}=C(),{amount:u}=s??{},{trackingData:t}=D(),g=Math.max(o?.withCouponMemberTotalSave??0,o?.withoutCouponMaxMemberTotalSave??0),m=G({profile:d,variant:e,memberFunctionResult:o,coupon:i}),b=!!(t?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),l=t?.freeGift,B=l?.excludeProducts?.map(n=>typeof n=="object"&&"sku"in n?n.sku:n)??[],P=t?.levelDiscount&&h({product:a,variant:e,item:t?.levelDiscount});return{commonCoupon:{enable:m.showCommonCoupon&&!!i,config:i??{}},freeGift:{enable:!!c&&!!c?.giftList?.length,config:c},functionFreeGift:{enable:!!f&&!!f?.giftItems?.length,config:f},bundle:{enable:!!r&&!!r?.bundleOptions?.length,config:r},memberDiscount:{enable:m.showMemberDiscount,config:{amount:g,formattedAmount:p?.memberDiscount,description:o?.labels?.[0]}},creditsRedemption:{enable:!!u&&u>0,config:{amount:u,formattedAmount:s?.formattedAmount,label:t?.creditsRedemptionLabel}},paidShipping:{enable:b,config:{}},fullGift:{enable:!!(l&&!B.includes(e.sku)),config:l??{}},levelDiscount:{enable:!!P,config:t?.levelDiscount??{}}}};export{x as useBenefits};
|
|
@@ -3,6 +3,11 @@ import { DiscountType } from '../const.js';
|
|
|
3
3
|
export type ProductPrice = {
|
|
4
4
|
amount: number;
|
|
5
5
|
currencyCode: CurrencyCode;
|
|
6
|
+
/**
|
|
7
|
+
* 宿主已格式化好的金额(含货币符号)。传入后组件直接展示;
|
|
8
|
+
* 未传入时回退到组件库内置的 formatPrice(旧逻辑)。
|
|
9
|
+
*/
|
|
10
|
+
formattedAmount?: string;
|
|
6
11
|
};
|
|
7
12
|
export type ProductOption = {
|
|
8
13
|
__typename?: 'MultipleChoiceOption';
|
|
@@ -98,6 +103,10 @@ export type VariantCoupon = {
|
|
|
98
103
|
fixed_value: string;
|
|
99
104
|
value_style: string;
|
|
100
105
|
variant_price4wscode: number;
|
|
106
|
+
/** 宿主已格式化的固定减免金额(取绝对值,含货币符号)。未传入时回退到内置 formatPrice */
|
|
107
|
+
formattedFixedValue?: string;
|
|
108
|
+
/** 宿主已格式化的 variant_price4wscode(含货币符号)。未传入时回退到内置 formatPrice */
|
|
109
|
+
formattedVariantPrice4wscode?: string;
|
|
101
110
|
discount_type: string;
|
|
102
111
|
amazon_deal: boolean;
|
|
103
112
|
cdi_id: number;
|
|
@@ -19,6 +19,25 @@ export type CompareData = {
|
|
|
19
19
|
};
|
|
20
20
|
show: boolean;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* 宿主已格式化好的价格字符串(含货币符号)。
|
|
24
|
+
* 每个字段都是可选的:传入则组件直接展示;未传入则该处回退到组件库内置的 formatPrice(旧逻辑)。
|
|
25
|
+
* 字段对应的数字请通过 `utils/priceCalc` 或 context 中的同名数字字段获取。
|
|
26
|
+
*/
|
|
27
|
+
export type ListingFormattedPrices = {
|
|
28
|
+
/** 对应 context.finalPrice(取 2 位小数) */
|
|
29
|
+
finalPrice?: string;
|
|
30
|
+
/** 对应 context.comparePrice */
|
|
31
|
+
comparePrice?: string;
|
|
32
|
+
/** 对应 context.totalSavings */
|
|
33
|
+
totalSavings?: string;
|
|
34
|
+
/** 对应 calcSummaryFinalPrice() 的结果(ProductSummary 当前商品最终价) */
|
|
35
|
+
summaryFinalPrice?: string;
|
|
36
|
+
/** 对应 calcUnlockedSaving() 的结果(ProductActions 已解锁节省),结果 <= 0 时不会展示 */
|
|
37
|
+
unlockedSaving?: string;
|
|
38
|
+
/** 对应会员折扣金额 max(withCouponMemberTotalSave, withoutCouponMaxMemberTotalSave) */
|
|
39
|
+
memberDiscount?: string;
|
|
40
|
+
};
|
|
22
41
|
export type DiscountData = {
|
|
23
42
|
memberFunctionSaving: number;
|
|
24
43
|
codeSavings: number;
|