@anker-in/headless-ui 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/DownLoad/index.js +1 -1
- package/dist/cjs/biz-components/DownLoad/index.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/DownLoad/index.js +1 -1
- package/dist/esm/biz-components/DownLoad/index.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/package.json +1 -1
- package/style.css +13 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Button, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo, type ReactNode } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\n\nexport interface ProductActionsProps {\n /** \u81EA\u5B9A\u4E49\u603B\u8282\u7701\u7EC4\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 totalSavings \u663E\u793A */\n totalSavingsSlot?: ReactNode\n}\n\nconst ProductActions = ({ totalSavingsSlot }: ProductActionsProps = {}) => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_textFormat", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "totalSavingsText"]
|
|
4
|
+
"sourcesContent": ["import { Text, Button, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo, type ReactNode } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\n\nexport interface ProductActionsProps {\n /** \u81EA\u5B9A\u4E49\u603B\u8282\u7701\u7EC4\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 totalSavings \u663E\u793A */\n totalSavingsSlot?: ReactNode\n}\n\nconst ProductActions = ({ totalSavingsSlot }: ProductActionsProps = {}) => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n discount,\n memberFunctionResult,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const unlockedSavingText = useMemo(() => {\n if (!copyWriting?.unlockedSaving) return undefined\n\n const couponSaving = commonCoupon?.enable ? Number(commonCoupon?.config?.fixed_value || 0) : 0\n const memberSaving = memberDiscount?.enable ? (memberDiscount.config?.amount ?? 0) : 0\n\n // \u4E0D\u53EF\u53E0\u52A0\u65F6\u53D6\u4F1A\u5458\u4EF7\u4E0E code \u6298\u6263\u7684\u6700\u5927\u503C\uFF0C\u53EF\u53E0\u52A0\u65F6\u53D6\u4E8C\u8005\u4E4B\u548C\n const totalUnlocked = Math.round((\n memberFunctionResult?.withoutCouponMaxMemberTotalSave\n ? Math.max(memberSaving, couponSaving)\n : memberSaving + couponSaving\n ) * 100) / 100\n\n if (totalUnlocked <= 0) return undefined\n\n return replaceTemplate(copyWriting.unlockedSaving, {\n amount: formatPrice({\n amount: totalUnlocked,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })\n }, [\n copyWriting?.unlockedSaving,\n commonCoupon?.enable,\n commonCoupon?.config?.fixed_value,\n memberDiscount?.enable,\n memberDiscount?.config?.amount,\n memberFunctionResult,\n variant.price.currencyCode,\n locale,\n ])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4\"\n className=\"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"laptop-md:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: Math.floor(finalPrice * 100) / 100,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {totalSavingsSlot ||\n (totalSavings > 0 || (savingDetail?.member > 0 && isLogin) ? (\n <Text\n className=\"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n ) : unlockedSavingText ? (\n <Text\n className=\"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={unlockedSavingText}\n />\n ) : null)}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onAddToCart?.()}\n loading={addToCartLoading}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n loading={buyNowLoading}\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8EU,IAAAI,EAAA,6BA9EVC,EAAwC,8CACxCC,EAA+B,6CAC/BC,EAAqC,0CACrCC,EAAwC,iBACxCC,EAA4B,mCAC5BC,EAAgC,wCAChCC,EAA4B,yCAO5B,MAAMC,EAAiB,CAAC,CAAE,iBAAAC,CAAiB,EAAyB,CAAC,IAAM,CACzE,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,QAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,SAAAC,EACA,qBAAAC,CACF,KAAI,wBA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Y,CAChB,OAAQC,EACR,aAAcJ,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,EAEDQ,GAAc,OAAS,GAAKJ,MAC3B,OAAC,QACC,UAAU,gEACV,KAAML,GAAa,aAAe,eACpC,GAEJ,EACCD,IACEK,EAAe,GAAMK,GAAc,OAAS,GAAKJ,KAChD,OAAC,QACC,UAAU,4HACV,KAAM,GAAGY,CAAgB,GAC3B,EACEC,KACF,OAAC,QACC,UAAU,oIACV,KAAMA,EACR,EACE,OACR,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMlB,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAc,EAC7B,QAASG,EAER,SAAAV,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,QAASS,EACT,UAAU,sBACV,QAAS,IAAMH,IAAW,EAEzB,SAAAR,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOZ,EAAQU",
|
|
6
|
+
"names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_textFormat", "import_useBenefits", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "discount", "memberFunctionResult", "benefits", "commonCoupon", "memberDiscount", "totalSavingsText", "unlockedSavingText", "couponSaving", "memberSaving", "totalUnlocked"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var _=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var se=(s,a)=>{for(var o in a)_(s,o,{get:a[o],enumerable:!0})},D=(s,a,o,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of ee(a))!ae.call(s,p)&&p!==o&&_(s,p,{get:()=>a[p],enumerable:!(f=X(a,p))||f.enumerable});return s};var V=(s,a,o)=>(o=s!=null?W(te(s)):{},D(a||!s||!s.__esModule?_(o,"default",{value:s,enumerable:!0}):o,s)),le=s=>D(_({},"__esModule",{value:!0}),s);var ie={};se(ie,{default:()=>oe});module.exports=le(ie);var e=require("react/jsx-runtime"),r=V(require("react")),Q=require("react-responsive"),Y=require("../../shared/Styles.js"),R=V(require("../../components/picture.js")),U=V(require("../../components/button.js")),E=require("../../components/heading.js"),q=require("../VideoModal/index.js"),L=require("../../components/grid.js"),O=V(require("../Title/index.js")),i=require("../../helpers/utils.js"),S=V(require("../SwiperBox/index.js")),H=require("../../shared/mimeType.js"),y=require("../../components/tabs.js"),Z=require("../../hooks/useExposure.js"),z=require("../../shared/trackUrlRef.js"),F=require("../AiuiProvider/index.js"),J=require("../../shared/track.js");const g="image",v="p1_banner",C=({data:s,configuration:a,jIndex:o,spanType:f,title:p,onSecondaryButtonClick:M,onPrimaryButtonClick:j})=>{const[k,n]=(0,r.useState)(!1),P=(0,Q.useMediaQuery)({query:"(max-width: 768px)"}),B=(0,r.useRef)(null),w=()=>{if(f)switch(f){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(a?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,Z.useExposure)(B,{componentType:g,componentName:v,position:o,componentTitle:s.title,componentDescription:s.description,navigation:a?.activeTab}),(0,r.useEffect)(()=>{n(P)},[P]);const{theme:I="light",title:c,description:m,imageUrl:d,primaryButton:x,secondaryButton:h,imageMobileUrl:u,blockLink:N,video:T,youtubeId:b,isYouTube:G,id:$}=s,t="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,i.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",w(),{"rounded-2xl":a?.shape==="rounded","aiui-dark":I==="dark","h-[400px]":k},"text-info-primary"),ref:B,children:[(N||h.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(N||h.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${m}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,H.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,H.isVideo)(u?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:u?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:u?.url||d?.url,alt:u?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"})]}),(0,e.jsxs)("div",{className:(0,i.cn)("pointer-events-none absolute inset-0 z-20 flex flex-col",f==="full"?"laptop:justify-center justify-end":"justify-end"),children:[(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(E.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(E.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:m})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[h&&h.text&&(0,e.jsxs)(U.default,{"aria-label":c??m,className:(0,i.cn)(t,"link-left"),variant:"secondary",as:"a","data-track":`${$}-link-left`,onClick:()=>{M?.(s)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(h.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${m}#${h.text}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,children:[h.text,(0,e.jsx)("span",{className:"sr-only",children:c??m})]}),x&&x.text&&(0,e.jsx)(U.default,{"aria-label":c??m,className:(0,i.cn)(t,"link-right"),variant:"primary","data-track":`${$}-link-right`,as:"a",onClick:()=>{j?.(s)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(x.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${m}#${x.text}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,children:x.text})]})]}),(T?.url||b)&&(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:(0,e.jsx)("button",{onClick:()=>{a?.onVideoPlayBtnClick?.(T?.url||b,G)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},A=r.default.forwardRef((s,a)=>{const{data:o,className:f,onSecondaryButtonClick:p,onPrimaryButtonClick:M,...j}=s,{shape:k,sectionTitle:n,groupByTab:P=!1,items:B=[],carousel:w}=o,[I,c]=(0,r.useState)(!1),[m,d]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),{locale:u="us"}=(0,F.useAiuiContext)(),N=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},T=B.map(t=>t.tabName).filter(Boolean).filter((t,l,K)=>K.indexOf(t)===l),b=(t,l)=>{c(!0),l?h?.(t||""):d?.(t||"")},G=(t,l)=>{switch(t){case 1:return 1;case 2:return 2;default:return l?2.3:3}},$=T.map(t=>({tabName:t,items:B.filter(l=>l.tabName===t)})).reduce((t,l)=>(t[l.tabName]=l.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:a,...j,className:(0,i.cn)("multiLayoutGraphicBlock","text-info-primary",f),children:[n&&(0,e.jsx)(O.default,{data:{title:n},className:"section-title"}),P?(0,e.jsxs)(y.Tabs,{shape:k,align:"left",defaultValue:(0,i.spaceToHyphen)(T[0]),children:[(0,e.jsx)(y.TabsList,{children:T.map((t,l)=>(0,e.jsx)(y.TabsTrigger,{value:(0,i.spaceToHyphen)(t),onClick:()=>{(0,J.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:g,component_name:v,component_title:n,component_position:1,navigation:t,button_name:t}})},children:t},l))}),T.map((t,l)=>(0,e.jsx)(y.TabsContent,{value:(0,i.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:$?.[t]||[],configuration:{shape:k,isTab:P,activeTab:t,title:n,num:$?.[t]?.length||0,locale:u,onVideoPlayBtnClick:b,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:G($?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:G($?.[t]?.length||0)}}}),w&&w?.items.length>0?(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:w?.items||[],configuration:{shape:k,isTab:P,locale:u,onVideoPlayBtnClick:b,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},l))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(L.Grid,{className:"w-full",children:[B.map((t,l)=>(0,e.jsx)(L.GridItem,{span:N(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(C,{data:t,configuration:{shape:k,locale:u,onVideoPlayBtnClick:b,title:n},jIndex:l,spanType:t.width,onSecondaryButtonClick:p,onPrimaryButtonClick:M})},`${t?.title||""}${l}`)),B.map((t,l)=>(0,e.jsx)(L.GridItem,{span:N("full"),className:"laptop:hidden block",children:(0,e.jsx)(C,{data:t,configuration:{shape:k,locale:u,onVideoPlayBtnClick:b,title:n},jIndex:l,spanType:"full"})},`${t?.title||""}${l}`))]}),w&&w?.items.length>0?(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:w?.items||[],configuration:{shape:k,locale:u,onVideoPlayBtnClick:b,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),I&&(0,e.jsx)(q.VideoModal,{visible:I,youTubeId:x,videoUrl:m,onCloseModal:()=>c(!1)})]})});A.displayName="MultiLayoutGraphicBlock";var oe=(0,Y.withLayout)(A);
|
|
1
|
+
"use strict";var W=Object.create;var _=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var se=(s,a)=>{for(var o in a)_(s,o,{get:a[o],enumerable:!0})},D=(s,a,o,k)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of ee(a))!ae.call(s,p)&&p!==o&&_(s,p,{get:()=>a[p],enumerable:!(k=X(a,p))||k.enumerable});return s};var C=(s,a,o)=>(o=s!=null?W(te(s)):{},D(a||!s||!s.__esModule?_(o,"default",{value:s,enumerable:!0}):o,s)),le=s=>D(_({},"__esModule",{value:!0}),s);var ie={};se(ie,{default:()=>oe});module.exports=le(ie);var e=require("react/jsx-runtime"),r=C(require("react")),Q=require("react-responsive"),Y=require("../../shared/Styles.js"),R=C(require("../../components/picture.js")),U=C(require("../../components/button.js")),E=require("../../components/heading.js"),q=require("../VideoModal/index.js"),I=require("../../components/grid.js"),O=C(require("../Title/index.js")),i=require("../../helpers/utils.js"),S=C(require("../SwiperBox/index.js")),H=require("../../shared/mimeType.js"),y=require("../../components/tabs.js"),Z=require("../../hooks/useExposure.js"),z=require("../../shared/trackUrlRef.js"),F=require("../AiuiProvider/index.js"),J=require("../../shared/track.js");const g="image",v="p1_banner",L=({data:s,configuration:a,jIndex:o,spanType:k,title:p,onSecondaryButtonClick:M,onPrimaryButtonClick:j})=>{const[w,n]=(0,r.useState)(!1),P=(0,Q.useMediaQuery)({query:"(max-width: 768px)"}),B=(0,r.useRef)(null),b=()=>{if(k)switch(k){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(a?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,Z.useExposure)(B,{componentType:g,componentName:v,position:o,componentTitle:s.title,componentDescription:s.description,navigation:a?.activeTab}),(0,r.useEffect)(()=>{n(P)},[P]);const{theme:G="light",title:c,description:h,imageUrl:d,primaryButton:x,secondaryButton:f,imageMobileUrl:u,blockLink:N,video:T,youtubeId:m,isYouTube:V,id:$}=s,t="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,i.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",b(),{"rounded-2xl":a?.shape==="rounded","aiui-dark":G==="dark","h-[400px]":w},"text-info-primary"),ref:B,children:[(N||f.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(N||f.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${h}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,H.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,H.isVideo)(u?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:u?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:u?.url||d?.url,alt:u?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"})]}),(0,e.jsxs)("div",{className:(0,i.cn)("pointer-events-none absolute inset-0 z-20 flex flex-col",k==="full"?"laptop:justify-center justify-end":"justify-end"),children:[(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(E.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(E.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:h})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[f&&f.text&&(0,e.jsxs)(U.default,{"aria-label":c??h,className:(0,i.cn)(t,"link-left"),variant:"secondary",as:"a","data-track":`${$}-link-left`,onClick:()=>{M?.(s)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(f.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${h}#${f.text}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,children:[f.text,(0,e.jsx)("span",{className:"sr-only",children:c??h})]}),x&&x.text&&(0,e.jsx)(U.default,{"aria-label":c??h,className:(0,i.cn)(t,"link-right"),variant:"primary","data-track":`${$}-link-right`,as:"a",onClick:()=>{j?.(s)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(x.link||"",a?.locale||"us"),`${g}_${v}`),"data-headless-type-name":`${g}#${v}`,"data-headless-title-desc-button":`${c}#${h}#${x.text}`,"data-headless-nav-position":`${a?.activeTab}#${o}`,children:x.text})]})]}),(T?.url||m)&&(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:(0,e.jsx)("button",{onClick:()=>{a?.onVideoPlayBtnClick?.(V&&m?m:T?.url||m,V)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},A=r.default.forwardRef((s,a)=>{const{data:o,className:k,onSecondaryButtonClick:p,onPrimaryButtonClick:M,...j}=s,{shape:w,sectionTitle:n,groupByTab:P=!1,items:B=[],carousel:b}=o,[G,c]=(0,r.useState)(!1),[h,d]=(0,r.useState)(""),[x,f]=(0,r.useState)(""),{locale:u="us"}=(0,F.useAiuiContext)(),N=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},T=B.map(t=>t.tabName).filter(Boolean).filter((t,l,K)=>K.indexOf(t)===l),m=(t,l)=>{c(!0),l?f?.(t||""):d?.(t||"")},V=(t,l)=>{switch(t){case 1:return 1;case 2:return 2;default:return l?2.3:3}},$=T.map(t=>({tabName:t,items:B.filter(l=>l.tabName===t)})).reduce((t,l)=>(t[l.tabName]=l.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:a,...j,className:(0,i.cn)("multiLayoutGraphicBlock","text-info-primary",k),children:[n&&(0,e.jsx)(O.default,{data:{title:n},className:"section-title"}),P?(0,e.jsxs)(y.Tabs,{shape:w,align:"left",defaultValue:(0,i.spaceToHyphen)(T[0]),children:[(0,e.jsx)(y.TabsList,{children:T.map((t,l)=>(0,e.jsx)(y.TabsTrigger,{value:(0,i.spaceToHyphen)(t),onClick:()=>{(0,J.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:g,component_name:v,component_title:n,component_position:1,navigation:t,button_name:t}})},children:t},l))}),T.map((t,l)=>(0,e.jsx)(y.TabsContent,{value:(0,i.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:$?.[t]||[],configuration:{shape:w,isTab:P,activeTab:t,title:n,num:$?.[t]?.length||0,locale:u,onVideoPlayBtnClick:m,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:L,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:V($?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:V($?.[t]?.length||0)}}}),b&&b?.items.length>0?(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:b?.items||[],configuration:{shape:w,isTab:P,locale:u,onVideoPlayBtnClick:m,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:L,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},l))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(I.Grid,{className:"w-full",children:[B.map((t,l)=>(0,e.jsx)(I.GridItem,{span:N(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(L,{data:t,configuration:{shape:w,locale:u,onVideoPlayBtnClick:m,title:n},jIndex:l,spanType:t.width,onSecondaryButtonClick:p,onPrimaryButtonClick:M})},`${t?.title||""}${l}`)),B.map((t,l)=>(0,e.jsx)(I.GridItem,{span:N("full"),className:"laptop:hidden block",children:(0,e.jsx)(L,{data:t,configuration:{shape:w,locale:u,onVideoPlayBtnClick:m,title:n},jIndex:l,spanType:"full"})},`${t?.title||""}${l}`))]}),b&&b?.items.length>0?(0,e.jsx)(S.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:b?.items||[],configuration:{shape:w,locale:u,onVideoPlayBtnClick:m,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:M}},Slide:L,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),G&&(0,e.jsx)(q.VideoModal,{visible:G,youTubeId:x,videoUrl:h,onCloseModal:()=>c(!1)})]})});A.displayName="MultiLayoutGraphicBlock";var oe=(0,Y.withLayout)(A);
|
|
2
2
|
//# sourceMappingURL=MultiLayoutGraphicBlock.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/grid.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen, getLocalizedPath } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n id,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(\n getLocalizedPath(blockLink || secondaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden size-full overflow-hidden object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block size-full overflow-hidden object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n </div>\n <div\n className={cn(\n 'pointer-events-none absolute inset-0 z-20 flex flex-col',\n spanType === 'full' ? 'laptop:justify-center justify-end' : 'justify-end'\n )}\n >\n <div className=\"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4\">\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n data-track={`${id}-link-left`}\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(\n getLocalizedPath(secondaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n data-track={`${id}-link-right`}\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(\n getLocalizedPath(primaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n {(video?.url || youtubeId) && (\n <div className=\"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4\">\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { data, className, onSecondaryButtonClick, onPrimaryButtonClick, ...rest } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const { locale = 'us' } = useAiuiContext()\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n {...rest}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
|
|
5
|
-
"mappings": "kkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAmHQ,IAAAI,EAAA,6BAnHRC,EAAmD,oBACnDC,EAA8B,4BAE9BC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAwB,uCACxBC,EAA2B,kCAC3BC,EAA+B,oCAC/BC,EAAkB,gCAClBC,EAAoD,kCACpDC,EAAsB,oCACtBC,EAAwB,oCACxBC,EAAyD,oCACzDC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAA+B,oCAC/BC,EAAwB,iCAExB,MAAMC,EAAgB,QAChBC,EAAgB,YAEhBC,EAAY,CAAC,CACjB,KAAMC,EACN,cAAAC,EACA,OAAAC,EACA,SAAAC,EACA,MAAOC,EACP,uBAAAC,EACA,qBAAAC,CACF,IAQM,CACJ,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAkB,EAAK,EACjDC,KAAa,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAE1DC,KAAM,UAAuB,IAAI,EAEjCC,EAAe,IAAM,CACzB,GAAIR,EACF,OAAQA,EAAU,CAChB,IAA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B,OAAC,QAAK,UAAU,UAAW,SAAAJ,GAASC,EAAY,GAClD,EAEDE,GAAiBA,EAAc,SAC9B,OAAC,EAAAU,QAAA,CACC,aAAYb,GAASC,EACrB,aAAW,MAAGU,EAAc,YAAY,EACxC,QAAQ,UACR,aAAY,GAAGD,CAAE,cACjB,GAAG,IACH,QAAS,IAAM,CACbjB,IAAuBN,CAAI,CAC7B,EACA,QAAM,kBACJ,oBAAiBgB,EAAc,MAAQ,GAAIf,GAAe,QAAU,IAAI,EACxE,GAAGJ,CAAa,IAAIC,CAAa,EACnC,EACA,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGe,CAAK,IAAIC,CAAW,IAAIE,EAAc,IAAI,GAC9E,6BAA4B,GAAGf,GAAe,SAAS,IAAIC,CAAM,GAEhE,SAAAc,EAAc,KACjB,GAEJ,GACF,GACEI,GAAO,KAAOC,OACd,OAAC,OAAI,UAAU,+EACb,mBAAC,UACC,QAAS,IAAM,CACbpB,GAAe,
|
|
4
|
+
"sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/grid.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen, getLocalizedPath } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n id,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(\n getLocalizedPath(blockLink || secondaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden size-full overflow-hidden object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block size-full overflow-hidden object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n </div>\n <div\n className={cn(\n 'pointer-events-none absolute inset-0 z-20 flex flex-col',\n spanType === 'full' ? 'laptop:justify-center justify-end' : 'justify-end'\n )}\n >\n <div className=\"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4\">\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n data-track={`${id}-link-left`}\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(\n getLocalizedPath(secondaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n data-track={`${id}-link-right`}\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(\n getLocalizedPath(primaryButton.link || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-position={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n {(video?.url || youtubeId) && (\n <div className=\"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4\">\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(\n isYouTube && youtubeId ? youtubeId : video?.url || youtubeId,\n isYouTube\n )\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n </div>\n )}\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { data, className, onSecondaryButtonClick, onPrimaryButtonClick, ...rest } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const { locale = 'us' } = useAiuiContext()\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n {...rest}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n locale,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
|
|
5
|
+
"mappings": "kkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAmHQ,IAAAI,EAAA,6BAnHRC,EAAmD,oBACnDC,EAA8B,4BAE9BC,EAA2B,kCAC3BC,EAAoB,0CACp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P,OAAAW,EACA,oBAAqBM,EACrB,MAAOhB,CACT,EACA,OAAQc,EACR,SAAU,OACZ,GAXa,GAAGhD,GAAM,OAAS,EAAE,GAAGgD,CAAK,EAY3C,CACD,GACH,EACCX,GAAYA,GAAU,MAAM,OAAS,KACpC,OAAC,EAAAuB,QAAA,CACC,UAAU,oBACV,GAAI,2BACJ,KAAM,CACJ,KAAMvB,GAAU,OAAS,CAAC,EAC1B,cAAe,CACb,MAAOJ,EACP,OAAAW,EACA,oBAAqBM,EACrB,MAAOhB,EACP,uBAAA7B,EACA,qBAAAC,CACF,CACF,EACA,MAAOP,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACE,MACN,EAEDuC,MACC,OAAC,cACC,QAASA,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDZ,EAAwB,YAAc,0BAEtC,IAAOlD,MAAQ,cAAWkD,CAAuB",
|
|
6
6
|
"names": ["MultiLayoutGraphicBlock_exports", "__export", "MultiLayoutGraphicBlock_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_responsive", "import_Styles", "import_picture", "import_button", "import_heading", "import_VideoModal", "import_grid", "import_Title", "import_utils", "import_SwiperBox", "import_mimeType", "import_tabs", "import_useExposure", "import_trackUrlRef", "import_AiuiProvider", "import_track", "componentType", "componentName", "ItemBlock", "item", "configuration", "jIndex", "spanType", "titleProp", "onSecondaryButtonClick", "onPrimaryButtonClick", "isMobile", "setIsMobile", "mediaQuery", "ref", "handleAspect", "theme", "title", "description", "imageUrl", "primaryButton", "secondaryButton", "imageMobileUrl", "blockLink", "video", "youtubeId", "isYouTube", "id", "lgButtonSize", "Picture", "Button", "MultiLayoutGraphicBlock", "React", "props", "data", "className", "rest", "shape", "sectionTitle", "groupByTab", "items", "carousel", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "locale", "getSpan", "width", "tabNames", "index", "arr", "handleVideoPlayBtnClick", "url", "handleTabNumber", "num", "flag", "tabItemsMaps", "tabName", "acc", "cur", "Title", "SwiperBox"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as m,jsx as t,jsxs as
|
|
1
|
+
"use client";import{Fragment as m,jsx as t,jsxs as a}from"react/jsx-runtime";import{cn as x}from"../../helpers/utils.js";import{withLayout as r}from"../../shared/Styles.js";import{Text as l,Link as d}from"../../components/index.js";const g=({data:p,className:o,...i})=>{const{list:s}=p;return t(m,{children:t("div",{...i,className:x("rounded-box flex w-full flex-col gap-[12px] bg-[#EAEAEC] p-[12px]",o),children:s?.map((e,n)=>t("div",{className:"w-full",children:a(d,{href:e?.link,target:"_blank",className:"flex w-full items-center justify-between px-[24px] py-[12px]",children:[a("div",{className:"laptop:gap-[24px] flex flex-row items-center gap-[12px]",children:[t(l,{html:e?.title,className:"laptop:text-[16px] break-all text-[14px] font-bold leading-[1.4]"}),e?.text&&t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"2",height:"17",viewBox:"0 0 2 17",fill:"none",children:t("path",{d:"M1 0.5V16.5",stroke:"#3D3D3F"})}),t(l,{html:e?.text,className:"laptop:text-[16px] text-[14px] font-bold leading-[1.4]"})]}),a("div",{className:"laptop:gap-[24px] flex flex-row items-center justify-center gap-[4px]",children:[t(l,{html:e?.time,className:"laptop:text-[16px] text-[14px] font-bold leading-[1.4]"}),t("svg",{className:"icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("path",{d:"M21 11.5C21.5523 11.5 22 11.9477 22 12.5V18.5C22 20.1569 20.6569 21.5 19 21.5H5C3.34315 21.5 2 20.1569 2 18.5V12.5C2 11.9477 2.44772 11.5 3 11.5C3.55228 11.5 4 11.9477 4 12.5V18.5C4 19.0523 4.44772 19.5 5 19.5H19C19.5523 19.5 20 19.0523 20 18.5V12.5C20 11.9477 20.4477 11.5 21 11.5ZM12.0039 2.25391C12.5562 2.25391 13.0039 2.70162 13.0039 3.25391V13.4736L16.4893 9.98828C16.8798 9.59777 17.5128 9.59779 17.9033 9.98828C18.2938 10.3788 18.2938 11.0118 17.9033 11.4023L13.4541 15.8516C12.6471 16.6583 11.3392 16.6582 10.5322 15.8516L6.08984 11.4092C5.69932 11.0187 5.69932 10.3856 6.08984 9.99512C6.48037 9.60466 7.11341 9.60462 7.50391 9.99512L11.0039 13.4951V3.25391C11.0039 2.70162 11.4516 2.25391 12.0039 2.25391Z",fill:"currentColor"})})]})]})},n))})})};var v=r(g);export{v as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/DownLoad/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Text, Link } from '../../components/index.js'\n\nexport type DownLoadDataType = {\n title: string\n text: string\n time: string\n link: string\n line: Img\n icon: Img\n}\n\ninterface DownLoadType extends React.HTMLAttributes<HTMLDivElement> {\n data: {\n list: DownLoadDataType[]\n }\n}\n\nconst DownLoad = ({ data, className, ...rest }: DownLoadType) => {\n const { list } = data\n\n return (\n <>\n <div {...rest} className={cn('rounded-box flex w-full flex-col gap-[12px] bg-[#EAEAEC] p-[12px]', className)}>\n {list?.map((item, index) => (\n <div key={index} className=\"w-full\">\n <Link\n href={item?.link}\n target=\"_blank\"\n className=\"flex w-full items-center justify-between px-[24px] py-[12px]\"\n >\n <div className=\"laptop:gap-[24px] flex flex-row items-center gap-[12px]\">\n <Text html={item?.title} className=\"laptop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n {/* <Picture\n className=\"h-[16px]\"\n source={item.line?.url}\n alt={item.line?.alt || ''}\n /> */}\n {item?.text && (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"2\" height=\"17\" viewBox=\"0 0 2 17\" fill=\"none\">\n <path d=\"M1 0.5V16.5\" stroke=\"#3D3D3F\" />\n </svg>\n )}\n <Text html={item?.text} className=\"laptop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n\n {/* <Link\n href={item?.link}\n target=\"_blank\"\n > */}\n <div className=\"laptop:gap-[24px] flex flex-row items-center justify-center gap-[4px]\">\n <Text html={item?.time} className=\"laptop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n {/* <Picture\n className=\"w-[24px]\"\n imgClassName=\"w-full h-auto\"\n source={item.icon?.url}\n alt={item.icon?.alt || ''}\n /> */}\n <svg\n className=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n >\n <path\n d=\"M21 11.5C21.5523 11.5 22 11.9477 22 12.5V18.5C22 20.1569 20.6569 21.5 19 21.5H5C3.34315 21.5 2 20.1569 2 18.5V12.5C2 11.9477 2.44772 11.5 3 11.5C3.55228 11.5 4 11.9477 4 12.5V18.5C4 19.0523 4.44772 19.5 5 19.5H19C19.5523 19.5 20 19.0523 20 18.5V12.5C20 11.9477 20.4477 11.5 21 11.5ZM12.0039 2.25391C12.5562 2.25391 13.0039 2.70162 13.0039 3.25391V13.4736L16.4893 9.98828C16.8798 9.59777 17.5128 9.59779 17.9033 9.98828C18.2938 10.3788 18.2938 11.0118 17.9033 11.4023L13.4541 15.8516C12.6471 16.6583 11.3392 16.6582 10.5322 15.8516L6.08984 11.4092C5.69932 11.0187 5.69932 10.3856 6.08984 9.99512C6.48037 9.60466 7.11341 9.60462 7.50391 9.99512L11.0039 13.4951V3.25391C11.0039 2.70162 11.4516 2.25391 12.0039 2.25391Z\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n\n {/* </Link> */}\n </Link>\n </div>\n ))}\n </div>\n </>\n )\n}\n\nexport default withLayout(DownLoad)\n"],
|
|
5
|
-
"mappings": "aAyBI,mBAAAA,EAUY,OAAAC,EADF,QAAAC,MATV,oBAxBJ,OAAS,MAAAC,MAAU,yBAEnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,QAAAC,MAAY,4BAiB3B,MAAMC,EAAW,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,GAAGC,CAAK,IAAoB,CAC/D,KAAM,CAAE,KAAAC,CAAK,EAAIH,EAEjB,OACEP,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAK,GAAGS,EAAM,UAAWP,EAAG,oEAAqEM,CAAS,EACxG,SAAAE,GAAM,IAAI,CAACC,EAAMC,IAChBZ,EAAC,OAAgB,UAAU,SACzB,SAAAC,EAACI,EAAA,CACC,KAAMM,GAAM,KACZ,OAAO,SACP,UAAU,+DAEV,UAAAV,EAAC,OAAI,UAAU,0DACb,UAAAD,EAACI,EAAA,CAAK,KAAMO,GAAM,MAAO,UAAU,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Text, Link } from '../../components/index.js'\n\nexport type DownLoadDataType = {\n title: string\n text: string\n time: string\n link: string\n line: Img\n icon: Img\n}\n\ninterface DownLoadType extends React.HTMLAttributes<HTMLDivElement> {\n data: {\n list: DownLoadDataType[]\n }\n}\n\nconst DownLoad = ({ data, className, ...rest }: DownLoadType) => {\n const { list } = data\n\n return (\n <>\n <div {...rest} className={cn('rounded-box flex w-full flex-col gap-[12px] bg-[#EAEAEC] p-[12px]', className)}>\n {list?.map((item, index) => (\n <div key={index} className=\"w-full\">\n <Link\n href={item?.link}\n target=\"_blank\"\n className=\"flex w-full items-center justify-between px-[24px] py-[12px]\"\n >\n <div className=\"laptop:gap-[24px] flex flex-row items-center gap-[12px]\">\n <Text html={item?.title} className=\"laptop:text-[16px] break-all text-[14px] font-bold leading-[1.4]\" />\n {/* <Picture\n className=\"h-[16px]\"\n source={item.line?.url}\n alt={item.line?.alt || ''}\n /> */}\n {item?.text && (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"2\" height=\"17\" viewBox=\"0 0 2 17\" fill=\"none\">\n <path d=\"M1 0.5V16.5\" stroke=\"#3D3D3F\" />\n </svg>\n )}\n <Text html={item?.text} className=\"laptop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n\n {/* <Link\n href={item?.link}\n target=\"_blank\"\n > */}\n <div className=\"laptop:gap-[24px] flex flex-row items-center justify-center gap-[4px]\">\n <Text html={item?.time} className=\"laptop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n {/* <Picture\n className=\"w-[24px]\"\n imgClassName=\"w-full h-auto\"\n source={item.icon?.url}\n alt={item.icon?.alt || ''}\n /> */}\n <svg\n className=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n >\n <path\n d=\"M21 11.5C21.5523 11.5 22 11.9477 22 12.5V18.5C22 20.1569 20.6569 21.5 19 21.5H5C3.34315 21.5 2 20.1569 2 18.5V12.5C2 11.9477 2.44772 11.5 3 11.5C3.55228 11.5 4 11.9477 4 12.5V18.5C4 19.0523 4.44772 19.5 5 19.5H19C19.5523 19.5 20 19.0523 20 18.5V12.5C20 11.9477 20.4477 11.5 21 11.5ZM12.0039 2.25391C12.5562 2.25391 13.0039 2.70162 13.0039 3.25391V13.4736L16.4893 9.98828C16.8798 9.59777 17.5128 9.59779 17.9033 9.98828C18.2938 10.3788 18.2938 11.0118 17.9033 11.4023L13.4541 15.8516C12.6471 16.6583 11.3392 16.6582 10.5322 15.8516L6.08984 11.4092C5.69932 11.0187 5.69932 10.3856 6.08984 9.99512C6.48037 9.60466 7.11341 9.60462 7.50391 9.99512L11.0039 13.4951V3.25391C11.0039 2.70162 11.4516 2.25391 12.0039 2.25391Z\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n\n {/* </Link> */}\n </Link>\n </div>\n ))}\n </div>\n </>\n )\n}\n\nexport default withLayout(DownLoad)\n"],
|
|
5
|
+
"mappings": "aAyBI,mBAAAA,EAUY,OAAAC,EADF,QAAAC,MATV,oBAxBJ,OAAS,MAAAC,MAAU,yBAEnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,QAAAC,MAAY,4BAiB3B,MAAMC,EAAW,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,GAAGC,CAAK,IAAoB,CAC/D,KAAM,CAAE,KAAAC,CAAK,EAAIH,EAEjB,OACEP,EAAAD,EAAA,CACE,SAAAC,EAAC,OAAK,GAAGS,EAAM,UAAWP,EAAG,oEAAqEM,CAAS,EACxG,SAAAE,GAAM,IAAI,CAACC,EAAMC,IAChBZ,EAAC,OAAgB,UAAU,SACzB,SAAAC,EAACI,EAAA,CACC,KAAMM,GAAM,KACZ,OAAO,SACP,UAAU,+DAEV,UAAAV,EAAC,OAAI,UAAU,0DACb,UAAAD,EAACI,EAAA,CAAK,KAAMO,GAAM,MAAO,UAAU,mEAAmE,EAMrGA,GAAM,MACLX,EAAC,OAAI,MAAM,6BAA6B,MAAM,IAAI,OAAO,KAAK,QAAQ,WAAW,KAAK,OACpF,SAAAA,EAAC,QAAK,EAAE,cAAc,OAAO,UAAU,EACzC,EAEFA,EAACI,EAAA,CAAK,KAAMO,GAAM,KAAM,UAAU,yDAAyD,GAC7F,EAMAV,EAAC,OAAI,UAAU,wEACb,UAAAD,EAACI,EAAA,CAAK,KAAMO,GAAM,KAAM,UAAU,yDAAyD,EAO3FX,EAAC,OACC,UAAU,OACV,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,EAAE,8sBACF,KAAK,eACP,EACF,GACF,GAGF,GAjDQY,CAkDV,CACD,EACH,EACF,CAEJ,EAEA,IAAOC,EAAQV,EAAWG,CAAQ",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "cn", "withLayout", "Text", "Link", "DownLoad", "data", "className", "rest", "list", "item", "index", "DownLoad_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import"react";import{withLayout as c}from"../../shared/Styles.js";import{Picture as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import"react";import{withLayout as c}from"../../shared/Styles.js";import{Picture as p,Text as n}from"../../components/index.js";import{cn as r}from"../../helpers/index.js";import{Swiper as u,SwiperSlide as f}from"swiper/react";import{Pagination as w,Mousewheel as g,FreeMode as x}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";const m=({item:t})=>i("div",{className:"rounded-card laptop:p-[20px] tablet:h-full tablet:px-3 laptop:px-4 lg-desktop:p-8 box-border flex h-[120px] flex-col items-center justify-center overflow-hidden bg-[#EAEAEC] px-4 py-[12px]",children:[i("div",{className:"min-h-0 flex-1",children:[t?.img?.url&&e(p,{className:"laptop:block desktop:w-[116px] lg-desktop:w-[146px] hidden aspect-[194/194] w-[88px]",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),t?.mobileImg?.url&&e(p,{className:"laptop:hidden block aspect-[120/120] h-full",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})]}),e(n,{html:t?.title,className:"laptop:text-[18px] line-clamp-2 shrink-0 text-center text-[14px] font-bold leading-[1.4]"})]}),b=t=>{const{data:d,className:o}=t,{list:s}=d;return i("div",{className:"w-full",children:[e("div",{className:r("tablet:hidden grid grid-cols-2 gap-3",o),children:s.map((l,a)=>e(m,{item:l},`mobile-${a}`))}),e("div",{className:r("tablet:block hidden",o),children:i("div",{className:"relative",children:[e(u,{modules:[w,g,x],freeMode:!0,spaceBetween:16,slidesPerView:"auto",pagination:{clickable:!0,el:".gift-box-pagination"},mousewheel:{forceToAxis:!0},breakpoints:{768:{spaceBetween:12,slidesPerView:4},1025:{spaceBetween:16,slidesPerView:4},1440:{spaceBetween:16,slidesPerView:6}},className:"laptop:!overflow-visible [&_.swiper-slide]:!h-auto [&_.swiper-wrapper]:items-stretch",children:s.map((l,a)=>e(f,{className:"!h-full items-stretch",children:e(m,{item:l})},`carousel-${a}`))}),e("div",{className:"gift-box-pagination laptop:hidden mt-3 flex justify-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:size-2 [&_.swiper-pagination-bullet]:rounded-full [&_.swiper-pagination-bullet]:bg-[#767880] [&_.swiper-pagination-bullet]:opacity-100"})]})})]})};var A=c(b);export{A as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/GiftBox/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useState } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, Mousewheel, FreeMode } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport type { GiftBoxDataType, GiftBoxType } from './types.js'\n\nconst GiftItem = ({ item }: { item: GiftBoxDataType }) => (\n <div className=\"rounded-card laptop:p-[20px] tablet:h-full tablet:px-3 laptop:px-4 lg-desktop:p-8 flex h-[120px] flex-col items-center justify-center overflow-hidden bg-[#EAEAEC] px-4 py-[12px]\">\n <div className=\"min-h-0 flex-1\">\n {item?.img?.url && (\n <Picture\n className=\"laptop:block desktop:w-[116px] lg-desktop:w-[146px] hidden aspect-[194/194] w-[88px]\"\n imgClassName=\"\"\n source={item?.img?.url}\n alt={item?.img?.alt || ''}\n />\n )}\n {item?.mobileImg?.url && (\n <Picture\n className=\"laptop:hidden block aspect-[120/120] h-full\"\n imgClassName=\"\"\n source={item?.mobileImg?.url}\n alt={item?.mobileImg?.alt || ''}\n />\n )}\n </div>\n <Text\n html={item?.title}\n className=\"laptop:text-[18px] line-clamp-2 shrink-0 text-center text-[14px] font-bold leading-[1.4]\"\n />\n </div>\n)\n\nconst GiftBox = (props: GiftBoxType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <div className=\"w-full\">\n {/* Mobile: Grid \u9759\u6001\u5E03\u5C40 2 \u5217 (<768px) */}\n <div className={cn('tablet:hidden grid grid-cols-2 gap-3', className)}>\n {list.map((item, index) => (\n <GiftItem key={`mobile-${index}`} item={item} />\n ))}\n </div>\n\n {/* Tablet+: Swiper \u8F6E\u64AD (\u2265768px)\n - 768px~1024px (tablet~laptop): 4 \u4E2A\u53EF\u89C1\n - \u22651025px (laptop+): 4.2 \u4E2A\u53EF\u89C1\n - \u22651440px (desktop+): 6 \u4E2A\u53EF\u89C1\n */}\n <div className={cn('tablet:block hidden', className)}>\n <div className=\"relative\">\n <Swiper\n modules={[Pagination, Mousewheel, FreeMode]}\n freeMode={true}\n spaceBetween={16}\n slidesPerView=\"auto\"\n pagination={{\n clickable: true,\n el: '.gift-box-pagination',\n }}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 768: {\n spaceBetween: 12,\n slidesPerView: 4,\n },\n 1025: {\n spaceBetween: 16,\n slidesPerView: 4,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: 6,\n },\n }}\n className=\"laptop:!overflow-visible [&_.swiper-slide]:!h-auto [&_.swiper-wrapper]:items-stretch\"\n >\n {list.map((item, index) => (\n <SwiperSlide key={`carousel-${index}`} className=\"!h-full items-stretch\">\n <GiftItem item={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n {/* \u81EA\u5B9A\u4E49 Pagination - \u4EC5 tablet \u663E\u793A */}\n <div className=\"gift-box-pagination laptop:hidden mt-3 flex justify-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:size-2 [&_.swiper-pagination-bullet]:rounded-full [&_.swiper-pagination-bullet]:bg-[#767880] [&_.swiper-pagination-bullet]:opacity-100\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default withLayout(GiftBox)\n"],
|
|
5
|
-
"mappings": "aAcI,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAbJ,MAAgC,QAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,cAAAC,EAAY,YAAAC,MAAgB,iBACjD,MAAO,aACP,MAAO,wBACP,MAAO,wBAGP,MAAMC,EAAW,CAAC,CAAE,KAAAC,CAAK,IACvBX,EAAC,OAAI,UAAU,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useState } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, Mousewheel, FreeMode } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport type { GiftBoxDataType, GiftBoxType } from './types.js'\n\nconst GiftItem = ({ item }: { item: GiftBoxDataType }) => (\n <div className=\"rounded-card laptop:p-[20px] tablet:h-full tablet:px-3 laptop:px-4 lg-desktop:p-8 box-border flex h-[120px] flex-col items-center justify-center overflow-hidden bg-[#EAEAEC] px-4 py-[12px]\">\n <div className=\"min-h-0 flex-1\">\n {item?.img?.url && (\n <Picture\n className=\"laptop:block desktop:w-[116px] lg-desktop:w-[146px] hidden aspect-[194/194] w-[88px]\"\n imgClassName=\"\"\n source={item?.img?.url}\n alt={item?.img?.alt || ''}\n />\n )}\n {item?.mobileImg?.url && (\n <Picture\n className=\"laptop:hidden block aspect-[120/120] h-full\"\n imgClassName=\"\"\n source={item?.mobileImg?.url}\n alt={item?.mobileImg?.alt || ''}\n />\n )}\n </div>\n <Text\n html={item?.title}\n className=\"laptop:text-[18px] line-clamp-2 shrink-0 text-center text-[14px] font-bold leading-[1.4]\"\n />\n </div>\n)\n\nconst GiftBox = (props: GiftBoxType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <div className=\"w-full\">\n {/* Mobile: Grid \u9759\u6001\u5E03\u5C40 2 \u5217 (<768px) */}\n <div className={cn('tablet:hidden grid grid-cols-2 gap-3', className)}>\n {list.map((item, index) => (\n <GiftItem key={`mobile-${index}`} item={item} />\n ))}\n </div>\n\n {/* Tablet+: Swiper \u8F6E\u64AD (\u2265768px)\n - 768px~1024px (tablet~laptop): 4 \u4E2A\u53EF\u89C1\n - \u22651025px (laptop+): 4.2 \u4E2A\u53EF\u89C1\n - \u22651440px (desktop+): 6 \u4E2A\u53EF\u89C1\n */}\n <div className={cn('tablet:block hidden', className)}>\n <div className=\"relative\">\n <Swiper\n modules={[Pagination, Mousewheel, FreeMode]}\n freeMode={true}\n spaceBetween={16}\n slidesPerView=\"auto\"\n pagination={{\n clickable: true,\n el: '.gift-box-pagination',\n }}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 768: {\n spaceBetween: 12,\n slidesPerView: 4,\n },\n 1025: {\n spaceBetween: 16,\n slidesPerView: 4,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: 6,\n },\n }}\n className=\"laptop:!overflow-visible [&_.swiper-slide]:!h-auto [&_.swiper-wrapper]:items-stretch\"\n >\n {list.map((item, index) => (\n <SwiperSlide key={`carousel-${index}`} className=\"!h-full items-stretch\">\n <GiftItem item={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n {/* \u81EA\u5B9A\u4E49 Pagination - \u4EC5 tablet \u663E\u793A */}\n <div className=\"gift-box-pagination laptop:hidden mt-3 flex justify-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:size-2 [&_.swiper-pagination-bullet]:rounded-full [&_.swiper-pagination-bullet]:bg-[#767880] [&_.swiper-pagination-bullet]:opacity-100\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default withLayout(GiftBox)\n"],
|
|
5
|
+
"mappings": "aAcI,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAbJ,MAAgC,QAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,cAAAC,EAAY,YAAAC,MAAgB,iBACjD,MAAO,aACP,MAAO,wBACP,MAAO,wBAGP,MAAMC,EAAW,CAAC,CAAE,KAAAC,CAAK,IACvBX,EAAC,OAAI,UAAU,+LACb,UAAAA,EAAC,OAAI,UAAU,iBACZ,UAAAW,GAAM,KAAK,KACVZ,EAACG,EAAA,CACC,UAAU,uFACV,aAAa,GACb,OAAQS,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDA,GAAM,WAAW,KAChBZ,EAACG,EAAA,CACC,UAAU,8CACV,aAAa,GACb,OAAQS,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,GAEJ,EACAZ,EAACI,EAAA,CACC,KAAMQ,GAAM,MACZ,UAAU,2FACZ,GACF,EAGIC,EAAWC,GAAuB,CACtC,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,OACEd,EAAC,OAAI,UAAU,SAEb,UAAAD,EAAC,OAAI,UAAWK,EAAG,uCAAwCW,CAAS,EACjE,SAAAC,EAAK,IAAI,CAACL,EAAMM,IACflB,EAACW,EAAA,CAAiC,KAAMC,GAAzB,UAAUM,CAAK,EAAgB,CAC/C,EACH,EAOAlB,EAAC,OAAI,UAAWK,EAAG,sBAAuBW,CAAS,EACjD,SAAAf,EAAC,OAAI,UAAU,WACb,UAAAD,EAACM,EAAA,CACC,QAAS,CAACE,EAAYC,EAAYC,CAAQ,EAC1C,SAAU,GACV,aAAc,GACd,cAAc,OACd,WAAY,CACV,UAAW,GACX,GAAI,sBACN,EACA,WAAY,CACV,YAAa,EACf,EACA,YAAa,CACX,IAAK,CACH,aAAc,GACd,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,cAAe,CACjB,CACF,EACA,UAAU,uFAET,SAAAO,EAAK,IAAI,CAACL,EAAMM,IACflB,EAACO,EAAA,CAAsC,UAAU,wBAC/C,SAAAP,EAACW,EAAA,CAAS,KAAMC,EAAM,GADN,YAAYM,CAAK,EAEnC,CACD,EACH,EAEAlB,EAAC,OAAI,UAAU,qRAAqR,GACtS,EACF,GACF,CAEJ,EAEA,IAAOmB,EAAQjB,EAAWW,CAAO",
|
|
6
6
|
"names": ["jsx", "jsxs", "withLayout", "Picture", "Text", "cn", "Swiper", "SwiperSlide", "Pagination", "Mousewheel", "FreeMode", "GiftItem", "item", "GiftBox", "props", "data", "className", "list", "index", "GiftBox_default"]
|
|
7
7
|
}
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as P,jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as c,Picture as N}from"../../../../../../components/index.js";import{cn as m}from"../../../../../../helpers/index.js";import{useState as h,useMemo as k}from"react";import{useBizProductContext as b}from"../../../../BizProductProvider.js";import{useAiuiContext as w}from"../../../../../AiuiProvider/index.js";import{handle as _}from"../../../../utils/helper.js";import{withLayout as C}from"../../../../../../shared/Styles.js";const E=()=>{const{product:r,selectedOptions:n,setSelectedOptions:l,setJoinedRecommendBuyProducts:p}=b(),{storeDomain:u}=w(),[f,x]=h({}),g=k(()=>r?.payload?.components?.find(e=>e.componentKey==="ProductOptions")?.data||{},[r?.payload]);return r.options.length?o("div",{className:"flex flex-col gap-12",children:r.options.map(e=>{const v=e.name.toLowerCase();if(["color","colour","couleur"].some(t=>v.includes(t)))return i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:g?.selectColor+n[e.name]}),o("div",{className:"lg-desktop:mt-5 ml-1 lg-desktop:mt-4 mt-3 flex items-center gap-4",children:e.values.map(({label:t},s)=>{const a=`https://${u}/cdn/shop/files/${_(t)}.png`;return i("div",{className:"ipc-product-detail-options-value relative",children:[o("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{l(d=>({...d,[e.name]:t})),p?.({gift:void 0,bundle:void 0})},className:m("flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":n[e.name]===t}),children:!f[t]&&o(P,{children:o(N,{className:"w-full",source:a,onError:({currentTarget:d})=>{d.onerror=null,x(y=>({...y,[t]:!0}))}})})}),o("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+s)})})]},e.id);{const t=e.name.charAt(0).toUpperCase()+e.name.slice(1);return i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",size:3,className:"font-bold text-[14px] leading-[1.2] lg-desktop:text-[16px]",html:t}),o("div",{className:"lg-desktop:mt-4 mt-3
|
|
1
|
+
import{Fragment as P,jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as c,Picture as N}from"../../../../../../components/index.js";import{cn as m}from"../../../../../../helpers/index.js";import{useState as h,useMemo as k}from"react";import{useBizProductContext as b}from"../../../../BizProductProvider.js";import{useAiuiContext as w}from"../../../../../AiuiProvider/index.js";import{handle as _}from"../../../../utils/helper.js";import{withLayout as C}from"../../../../../../shared/Styles.js";const E=()=>{const{product:r,selectedOptions:n,setSelectedOptions:l,setJoinedRecommendBuyProducts:p}=b(),{storeDomain:u}=w(),[f,x]=h({}),g=k(()=>r?.payload?.components?.find(e=>e.componentKey==="ProductOptions")?.data||{},[r?.payload]);return r.options.length?o("div",{className:"flex flex-col gap-12",children:r.options.map(e=>{const v=e.name.toLowerCase();if(["color","colour","couleur"].some(t=>v.includes(t)))return i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:g?.selectColor+n[e.name]}),o("div",{className:"lg-desktop:mt-5 ml-1 lg-desktop:mt-4 mt-3 flex items-center gap-4",children:e.values.map(({label:t},s)=>{const a=`https://${u}/cdn/shop/files/${_(t)}.png`;return i("div",{className:"ipc-product-detail-options-value relative",children:[o("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{l(d=>({...d,[e.name]:t})),p?.({gift:void 0,bundle:void 0})},className:m("flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":n[e.name]===t}),children:!f[t]&&o(P,{children:o(N,{className:"w-full",source:a,onError:({currentTarget:d})=>{d.onerror=null,x(y=>({...y,[t]:!0}))}})})}),o("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+s)})})]},e.id);{const t=e.name.charAt(0).toUpperCase()+e.name.slice(1);return i("div",{className:"ipc-product-detail-options",children:[o(c,{as:"p",size:3,className:"font-bold text-[14px] leading-[1.2] lg-desktop:text-[16px]",html:t}),o("div",{className:"lg-desktop:mt-4 mt-3 grid grid-cols-2 gap-3",children:e.values.map(({label:s})=>o("button",{onClick:()=>{l(a=>({...a,[e.name]:s}))},className:m("rounded-box border-2 text-[14px] laptop:text-[16px] border-[#E4E5E6] px-4 py-6 text-left font-bold",{"border-brand":n[e.name]===s}),children:s},s))})]},e.id)}})}):null};var S=C(E);export{S as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Text, Picture } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useState, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { handle } from '../../../../utils/helper.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\n\nconst ProductOptions = () => {\n const { product, selectedOptions, setSelectedOptions, setJoinedRecommendBuyProducts } = useBizProductContext()\n const { storeDomain } = useAiuiContext()\n const [imgLoadError, setImgLoadError] = useState({})\n\n const productOptionsData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductOptions')?.data || {}\n }, [product?.payload])\n\n if (!product.options.length) return null\n\n return (\n <div className=\"flex flex-col gap-12\">\n {product.options.map(option => {\n const lowercasedName = option.name.toLowerCase()\n const colorKeywords = ['color', 'colour', 'couleur']\n if (colorKeywords.some(keyword => lowercasedName.includes(keyword))) {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text\n as=\"p\"\n className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\"\n html={productOptionsData?.selectColor + selectedOptions[option.name]}\n />\n <div className=\"lg-desktop:mt-5 ml-1 lg-desktop:mt-4 mt-3 flex items-center gap-4\">\n {option.values.map(({ label }, index) => {\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div key={label + index} className=\"ipc-product-detail-options-value relative\">\n <button\n aria-label={`switch to ${label}`}\n title={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n setJoinedRecommendBuyProducts?.({ gift: undefined, bundle: undefined })\n }}\n className={cn(\n 'flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white',\n {\n 'outline-brand': selectedOptions[option.name] === label,\n }\n )}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n })}\n </div>\n </div>\n )\n } else {\n const capitalizedName = option.name.charAt(0).toUpperCase() + option.name.slice(1)\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text\n as=\"p\"\n size={3}\n className=\"font-bold text-[14px] leading-[1.2] lg-desktop:text-[16px]\"\n html={capitalizedName}\n />\n <div className=\"lg-desktop:mt-4 mt-3
|
|
5
|
-
"mappings": "AA2Bc,OAyBY,YAAAA,EAzBZ,OAAAC,EASM,QAAAC,MATN,oBA3Bd,OAAS,QAAAC,EAAM,WAAAC,MAAe,wCAC9B,OAAS,MAAAC,MAAU,qCACnB,OAAS,YAAAC,EAAU,WAAAC,MAAe,QAClC,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,kBAAAC,MAAsB,uCAC/B,OAAS,UAAAC,MAAc,8BACvB,OAAS,cAAAC,MAAkB,qCAE3B,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,mBAAAC,EAAoB,8BAAAC,CAA8B,EAAIR,EAAqB,EACvG,CAAE,YAAAS,CAAY,EAAIR,EAAe,EACjC,CAACS,EAAcC,CAAe,EAAIb,EAAS,CAAC,C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J,EACAxB,EAAC,OAAI,UAAU,6HAA6H,IA5BpIwB,EAAQC,CA6BlB,CAEJ,CAAC,EACH,IA1CQJ,EAAO,EA2CjB,EAEG,CACL,MAAMQ,EAAkBR,EAAO,KAAK,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAO,KAAK,MAAM,CAAC,EACjF,OACEpB,EAAC,OAAoB,UAAU,6BAC7B,UAAAD,EAACE,EAAA,CACC,GAAG,IACH,KAAM,EACN,UAAU,6DACV,KAAM2B,EACR,EACA7B,EAAC,OAAI,UAAU
|
|
4
|
+
"sourcesContent": ["import { Text, Picture } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useState, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { handle } from '../../../../utils/helper.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\n\nconst ProductOptions = () => {\n const { product, selectedOptions, setSelectedOptions, setJoinedRecommendBuyProducts } = useBizProductContext()\n const { storeDomain } = useAiuiContext()\n const [imgLoadError, setImgLoadError] = useState({})\n\n const productOptionsData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductOptions')?.data || {}\n }, [product?.payload])\n\n if (!product.options.length) return null\n\n return (\n <div className=\"flex flex-col gap-12\">\n {product.options.map(option => {\n const lowercasedName = option.name.toLowerCase()\n const colorKeywords = ['color', 'colour', 'couleur']\n if (colorKeywords.some(keyword => lowercasedName.includes(keyword))) {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text\n as=\"p\"\n className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\"\n html={productOptionsData?.selectColor + selectedOptions[option.name]}\n />\n <div className=\"lg-desktop:mt-5 ml-1 lg-desktop:mt-4 mt-3 flex items-center gap-4\">\n {option.values.map(({ label }, index) => {\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div key={label + index} className=\"ipc-product-detail-options-value relative\">\n <button\n aria-label={`switch to ${label}`}\n title={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n setJoinedRecommendBuyProducts?.({ gift: undefined, bundle: undefined })\n }}\n className={cn(\n 'flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white',\n {\n 'outline-brand': selectedOptions[option.name] === label,\n }\n )}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n })}\n </div>\n </div>\n )\n } else {\n const capitalizedName = option.name.charAt(0).toUpperCase() + option.name.slice(1)\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text\n as=\"p\"\n size={3}\n className=\"font-bold text-[14px] leading-[1.2] lg-desktop:text-[16px]\"\n html={capitalizedName}\n />\n <div className=\"lg-desktop:mt-4 mt-3 grid grid-cols-2 gap-3\">\n {option.values.map(({ label }) => (\n <button\n key={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n }}\n className={cn('rounded-box border-2 text-[14px] laptop:text-[16px] border-[#E4E5E6] px-4 py-6 text-left font-bold', {\n 'border-brand': selectedOptions[option.name] === label,\n })}\n >\n {label}\n </button>\n ))}\n </div>\n </div>\n )\n }\n })}\n </div>\n )\n}\n\nexport default withLayout(ProductOptions)\n"],
|
|
5
|
+
"mappings": "AA2Bc,OAyBY,YAAAA,EAzBZ,OAAAC,EASM,QAAAC,MATN,oBA3Bd,OAAS,QAAAC,EAAM,WAAAC,MAAe,wCAC9B,OAAS,MAAAC,MAAU,qCACnB,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AAQ,MAAU,CAAC,CACxE,EACA,UAAWX,EACT,oIACA,CACE,gBAAiBS,EAAgBQ,EAAO,IAAI,IAAMG,CACpD,CACF,EAEC,UAACP,EAAaO,CAAkC,GAC/CxB,EAAAD,EAAA,CACE,SAAAC,EAACG,EAAA,CACC,UAAU,SACV,OAAQuB,EACR,QAAS,CAAC,CAAE,cAAAE,CAAc,IAAM,CAC9BA,EAAc,QAAU,KACxBV,EAAgBS,IAAS,CAAE,GAAGA,EAAM,CAACH,CAAK,EAAG,EAAK,EAAE,CACtD,EACF,EACF,EAEJ,EACAxB,EAAC,OAAI,UAAU,6HAA6H,IA5BpIwB,EAAQC,CA6BlB,CAEJ,CAAC,EACH,IA1CQJ,EAAO,EA2CjB,EAEG,CACL,MAAMQ,EAAkBR,EAAO,KAAK,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAO,KAAK,MAAM,CAAC,EACjF,OACEpB,EAAC,OAAoB,UAAU,6BAC7B,UAAAD,EAACE,EAAA,CACC,GAAG,IACH,KAAM,EACN,UAAU,6DACV,KAAM2B,EACR,EACA7B,EAAC,OAAI,UAAU,8CACZ,SAAAqB,EAAO,OAAO,IAAI,CAAC,CAAE,MAAAG,CAAM,IAC1BxB,EAAC,UAEC,QAAS,IAAM,CACbc,EAAmBa,IAAS,CAAE,GAAGA,EAAM,CAACN,EAAO,IAAI,EAAGG,CAAM,EAAE,CAChE,EACA,UAAWpB,EAAG,qGAAsG,CAClH,eAAgBS,EAAgBQ,EAAO,IAAI,IAAMG,CACnD,CAAC,EAEA,SAAAA,GARIA,CASP,CACD,EACH,IArBQH,EAAO,EAsBjB,CAEJ,CACF,CAAC,EACH,EAnFkC,IAqFtC,EAEA,IAAOS,EAAQpB,EAAWC,CAAc",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Text", "Picture", "cn", "useState", "useMemo", "useBizProductContext", "useAiuiContext", "handle", "withLayout", "ProductOptions", "product", "selectedOptions", "setSelectedOptions", "setJoinedRecommendBuyProducts", "storeDomain", "imgLoadError", "setImgLoadError", "productOptionsData", "item", "option", "lowercasedName", "keyword", "label", "index", "imagePath", "prev", "currentTarget", "capitalizedName", "ProductOptions_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as Te,jsx as e,jsxs as h}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 L,useMemo as Y,useState as P,forwardRef as Q,useRef as D,useEffect as F,useImperativeHandle as re}from"react";import{Swiper as H,SwiperSlide as $}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 k}from"../../../../../helpers/index.js";import{GalleryTabType as A}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=t=>h("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("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=t=>h("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("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:t}=Z(),{product:c,variant:m,selectedOptions:C}=q(),b=pe({product:c,variant:m}),[u,w]=P(null),I=D(null),g=m?.metafields?.component?.custom_media_list;let r,x,S,G;g&&g?.available?(r=g?.product||[],x=g?.scenarios||[],S=g?.keyFeatures||[],G=g?.video||[]):(r=b?.productList,x=b?.sceneList,S=b?.keyFeaturesList,G=b?.videoList);const n=Y(()=>[...r,...x,...G],[r,x,G]),p={productList:r,sceneList:x,keyFeaturesList:S,videoList:G},a=Y(()=>{const i=c?.payload?.components?.find(f=>f.componentKey==="ProductGallery")?.data||[],s=m?.payload?.components?.find(f=>f.componentKey==="ProductGallery")?.data||[];return i?.map(f=>{const E=s?.find(z=>f?.galleries===z?.galleries);let V=p[f?.galleries]||[];if(E?.images&&Array.isArray(E.images)&&E.images.length>0){const z=E.images.map(d=>{const _=[];if(d.image_1920&&d.image_1920.trim()&&_.push(`${d.image_1920}`),d.image_1440&&d.image_1440.trim()&&_.push(`${d.image_1440} 1919`),d.image_1024&&d.image_1024.trim()&&_.push(`${d.image_1024} 1439`),d.image_768&&d.image_768.trim()&&_.push(`${d.image_768} 1023`),d.image_390&&d.image_390.trim()&&_.push(`${d.image_390} 767`),_.length>0){const U=_.join(", ");return{image:{url:U,altText:f.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(d=>d!==null);z.length>0&&(V=z)}return{...f,galleries:V}}).filter(f=>f.galleries.length>0)},[m?.payload,p,c?.payload]),[y,l]=P(a?.[0]),[o,N]=P(0),[v,T]=P(null),M=L(()=>{const i=(o+1)%a.length;N(i),l(a[i]),T(0)},[o,a]),R=L(()=>{const i=o===0?a.length-1:o-1;N(i),l(a[i]);const s=a[i]?.galleries||[];T(s.length-1)},[o,a]);F(()=>{o!=null&&requestAnimationFrame(()=>{I.current?.scrollToTab(o)})},[o]),F(()=>{l(a[0]),N(0)},[m?.id]);const B=(i,s)=>{switch(i?.galleryTabType){case A.GALLERY_IMAGE_MAIN:return e(j,{...i,index:s,onNextTab:M,onPrevTab:R,targetSlideIndex:v,onSlideChange:()=>T(null)});case A.GALLERY_IMAGE_FEATURES:return e(j,{...i,index:s,onNextTab:M,onPrevTab:R,targetSlideIndex:v,onSlideChange:()=>T(null)});case A.GALLERY_IMAGE_SCENE:return e(j,{...i,index:s,onNextTab:M,onPrevTab:R,targetSlideIndex:v,onSlideChange:()=>T(null)});case A.GALLERY_VIDEO:return e(xe,{...i,onNextTab:M,onPrevTab:R,targetSlideIndex:v,onSlideChange:()=>T(null)});default:return null}};return e("div",{id:"ipc-product-gallery",children:h(de,{className:"relative",value:y?.tabValue,defaultValue:a?.[0]?.tabValue,children:[e("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:a.map((i,s)=>e(se,{className:"h-full",value:i.tabValue,children:B(i,s)},i.tabValue))}),e(ie,{ref:I,galleryTabs:a,activeGalleryTab:y,setActiveGalleryTab:l,setActiveTabIndex:N,setTargetSlideIndex:T})]})})},ie=Q((t,c)=>{const{galleryTabs:m,activeGalleryTab:C,setActiveGalleryTab:b,setActiveTabIndex:u,setTargetSlideIndex:w}=t,{product:I}=q(),g=D(null),r=D(new Map),x=L(n=>{if(g.current){const p=g.current,a=n.currentTarget,y=a.offsetLeft-p.offsetWidth/2+a.offsetWidth/2;p.scrollTo({left:y,behavior:"smooth"})}},[]),S=L((n,p,a)=>{b(p),u(a),w(0),x(n)},[b,u,w,x]),G=L(n=>{if(g.current&&m[n]){const p=g.current,a=m[n],y=r.current.get(a.tabValue);if(y){const l=y.offsetLeft-p.offsetWidth/2+y.offsetWidth/2;p.scrollTo({left:l,behavior:"smooth"})}}},[m]);return re(c,()=>({scrollToTab:G})),h("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:[e(ce,{ref:g,className:"laptop:p-0 laptop-md:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:m?.map((n,p)=>e(ue,{ref:a=>{a?r.current.set(n.tabValue,a):r.current.delete(n.tabValue)},className:k("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===C?.tabValue&&"bg-white"),onClick:a=>S(a,n,p),value:n.tabValue,children:n.tabLabel},n.tabValue+p))})}),e("div",{className:"desktop:gap-2 desktop:flex hidden",children:I.metafields?.global?.specifications&&h(Te,{children:[e(me,{})," | ",e(be,{})]})})]})});ie.displayName="ProductGalleryTab";const j=Q((t,c)=>{const{locale:m="us",copyWriting:C}=Z(),{variant:b,totalSavings:u}=q(),w=D(null),[I,g]=P(null),[r,x]=P(null),[S,G]=P([]),n=D(null),p=Y(()=>{if(t?.galleryTabType===A.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===A.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,A.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),a=L(()=>{r?.isBeginning?t.onPrevTab?.():r?.slidePrev()},[r,t]),y=L(()=>{r?.isEnd?t.onNextTab?.():r?.slideNext()},[r,t]);return F(()=>{r&&t.targetSlideIndex&&(r.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[r,t.targetSlideIndex,t]),F(()=>{const l=()=>{if(!t?.comment?.content||!n.current)return;const v=n.current;v.textContent="Test";const M=v.offsetHeight*2+2,B=t.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),i=[];let s="";for(let f=0;f<B.length;f++){const E=B[f],V=s?`${s} ${E}`:E;v.textContent=V,v.offsetHeight>M?s?(i.push(s),s=E):(i.push(E),s=""):s=V}s&&i.push(s),v.textContent="",G(i)},o=requestAnimationFrame(()=>{requestAnimationFrame(()=>{l()})}),N=()=>{l()};return window.addEventListener("resize",te(N,500)),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",te(N,500))}},[t?.comment?.content]),h("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(H,{ref:c,className:"h-full",onSwiper:x,onTouchEnd:(l,o)=>{l.isBeginning&&l.swipeDirection==="prev"?a():l.isEnd&&l.swipeDirection==="next"&&y()},pagination:{clickable:!0,el:w.current},thumbs:{swiper:I},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((l,o)=>{const N=`${t.tabValue}-${o}`,v=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${b.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:o+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},T=l?._responsiveSource||l?.image?.url||"";return e($,{className:"h-full",children:e(ye,{onExposure:v,exposureKey:N,threshold:.5,duration:2e3,className:"h-full",children:e(W,{source:T,alt:l?.image?.altText,className:k("h-full",p),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+o)})}),b.availableForSale&&!!u&&!t.index&&e(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:u,currencyCode:b?.price?.currencyCode,locale:m})} ${C?.off}`}),e("div",{className:k("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:a,children:e(ae,{className:k("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:k("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:y,children:e(le,{className:k("tablet:size-10 lg-desktop:size-12")})}),h("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:[e("div",{className:"tablet:block hidden",children:e(H,{className:"flex items-center justify-between",onSwiper:g,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[K,O],children:t?.galleries?.map((l,o)=>e($,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:e(W,{source:l.image?.url,alt:l.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+o))})}),!t?.index&&h("div",{className:"flex items-center gap-2",children:[e(W,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),h("div",{className:"relative max-w-[528px]",children:[e("div",{ref:n,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),e(H,{modules:[ne],loop:S.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:S.length>0?S.map((l,o)=>e($,{children:e(J,{html:l,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},o+"text-group")):e($,{children:e(J,{as:"div",html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]})]}),e("div",{ref:w,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=t=>{const[c,m]=P(null),C=L(()=>{c?.isBeginning?t.onPrevTab?.():c?.slidePrev()},[c,t]),b=L(()=>{c?.isEnd?t.onNextTab?.():c?.slideNext()},[c,t]);return F(()=>{c&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(c.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[c,t.targetSlideIndex,t]),h("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(H,{className:"h-full",onSwiper:m,onTouchEnd:(u,w)=>{u.isBeginning&&u.swipeDirection==="prev"?C():u.isEnd&&u.swipeDirection==="next"&&b()},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((u,w)=>e($,{className:"h-full",children:h("video",{controls:!0,className:"size-full object-cover",children:[e("track",{kind:"captions"}),e("source",{src:u?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:u?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:u?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+w))}),e("div",{className:k("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:C,children:e(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:k("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:b,children:e(le,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Fe=t=>e("div",{children:"3D View"});var $e=fe(he);export{$e as default};
|
|
1
|
+
import{Fragment as we,jsx as t,jsxs as h}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 L,useMemo as Y,useState as P,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 k}from"../../../../../helpers/index.js";import{GalleryTabType as I}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=>h("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=>h("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:d,selectedOptions:C}=q(),m=pe({product:o,variant:d}),[f,w]=P(null),A=V(null),b=d?.metafields?.component?.custom_media_list;let n,x,S,G;b&&b?.available?(n=b?.product||[],x=b?.scenarios||[],S=b?.keyFeatures||[],G=b?.video||[]):(n=m?.productList,x=m?.sceneList,S=m?.keyFeaturesList,G=m?.videoList);const s=Y(()=>[...n,...x,...G],[n,x,G]),p={productList:n,sceneList:x,keyFeaturesList:S,videoList:G},a=Y(()=>{const i=o?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[],c=d?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[];return i?.map(g=>{const E=c?.find(F=>g?.galleries===F?.galleries);let D=p[g?.galleries]||[];if(E?.images&&Array.isArray(E.images)&&E.images.length>0){const F=E.images.map(u=>{const _=[];if(u.image_1920&&u.image_1920.trim()&&_.push(`${u.image_1920}`),u.image_1440&&u.image_1440.trim()&&_.push(`${u.image_1440} 1919`),u.image_1024&&u.image_1024.trim()&&_.push(`${u.image_1024} 1439`),u.image_768&&u.image_768.trim()&&_.push(`${u.image_768} 1023`),u.image_390&&u.image_390.trim()&&_.push(`${u.image_390} 767`),_.length>0){const U=_.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)},[d?.payload,p,o?.payload]),[y,l]=P(a?.[0]),[r,N]=P(0),[v,T]=P(null),M=L(()=>{const i=(r+1)%a.length;N(i),l(a[i]),T(0)},[r,a]),z=L(()=>{const i=r===0?a.length-1:r-1;N(i),l(a[i]);const c=a[i]?.galleries||[];T(c.length-1)},[r,a]);R(()=>{r!=null&&requestAnimationFrame(()=>{A.current?.scrollToTab(r)})},[r]),R(()=>{l(a[0]),N(0)},[d?.id]);const H=(i,c)=>{switch(i?.galleryTabType){case I.GALLERY_IMAGE_MAIN:return t(j,{...i,index:c,onNextTab:M,onPrevTab:z,targetSlideIndex:v,onSlideChange:()=>T(null)});case I.GALLERY_IMAGE_FEATURES:return t(j,{...i,index:c,onNextTab:M,onPrevTab:z,targetSlideIndex:v,onSlideChange:()=>T(null)});case I.GALLERY_IMAGE_SCENE:return t(j,{...i,index:c,onNextTab:M,onPrevTab:z,targetSlideIndex:v,onSlideChange:()=>T(null)});case I.GALLERY_VIDEO:return t(Te,{...i,onNextTab:M,onPrevTab:z,targetSlideIndex:v,onSlideChange:()=>T(null)});default:return null}};return t("div",{id:"ipc-product-gallery",children:h(de,{className:"relative",value:y?.tabValue,defaultValue:a?.[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:a.map((i,c)=>t(se,{className:"h-full",value:i.tabValue,children:H(i,c)},i.tabValue))}),t(ie,{ref:A,galleryTabs:a,activeGalleryTab:y,setActiveGalleryTab:l,setActiveTabIndex:N,setTargetSlideIndex:T})]})})},ie=Q((e,o)=>{const{galleryTabs:d,activeGalleryTab:C,setActiveGalleryTab:m,setActiveTabIndex:f,setTargetSlideIndex:w}=e,{product:A}=q(),b=V(null),n=V(new Map),x=L(s=>{if(b.current){const p=b.current,a=s.currentTarget,y=a.offsetLeft-p.offsetWidth/2+a.offsetWidth/2;p.scrollTo({left:y,behavior:"smooth"})}},[]),S=L((s,p,a)=>{m(p),f(a),w(0),x(s)},[m,f,w,x]),G=L(s=>{if(b.current&&d[s]){const p=b.current,a=d[s],y=n.current.get(a.tabValue);if(y){const l=y.offsetLeft-p.offsetWidth/2+y.offsetWidth/2;p.scrollTo({left:l,behavior:"smooth"})}}},[d]);return re(o,()=>({scrollToTab:G})),h("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:b,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:d?.map((s,p)=>t(ue,{ref:a=>{a?n.current.set(s.tabValue,a):n.current.delete(s.tabValue)},className:k("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",s.tabValue===C?.tabValue&&"bg-white"),onClick:a=>S(a,s,p),value:s.tabValue,children:s.tabLabel},s.tabValue+p))})}),t("div",{className:"desktop:gap-2 desktop:flex hidden",children:A.metafields?.global?.specifications&&h(we,{children:[t(me,{})," | ",t(be,{})]})})]})});ie.displayName="ProductGalleryTab";const j=Q((e,o)=>{const{locale:d="us",copyWriting:C}=Z(),{variant:m,totalSavings:f}=q(),w=V(null),[A,b]=P(null),[n,x]=P(null),[S,G]=P([]),s=V(null),p=Y(()=>{if(e?.galleryTabType===I.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";e?.galleryTabType===I.GALLERY_IMAGE_FEATURES||(e?.galleryTabType,I.GALLERY_IMAGE_SCENE)},[e?.galleryTabType]),a=L(()=>{n?.isBeginning?e.onPrevTab?.():n?.slidePrev()},[n,e]),y=L(()=>{n?.isEnd?e.onNextTab?.():n?.slideNext()},[n,e]);return R(()=>{n&&e.targetSlideIndex&&(n.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[n,e.targetSlideIndex,e]),R(()=>{const l=()=>{if(!e?.comment?.content||!s.current)return;const v=s.current;v.textContent="Test";const M=v.offsetHeight*2+2,H=e.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),i=[];let c="";for(let g=0;g<H.length;g++){const E=H[g],D=c?`${c} ${E}`:E;v.textContent=D,v.offsetHeight>M?c?(i.push(c),c=E):(i.push(E),c=""):c=D}c&&i.push(c),v.textContent="",G(i)},r=requestAnimationFrame(()=>{requestAnimationFrame(()=>{l()})}),N=()=>{l()};return window.addEventListener("resize",te(N,500)),()=>{cancelAnimationFrame(r),window.removeEventListener("resize",te(N,500))}},[e?.comment?.content]),h("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{ref:o,className:"h-full",onSwiper:x,onTouchEnd:(l,r)=>{l.isBeginning&&l.swipeDirection==="prev"?a():l.isEnd&&l.swipeDirection==="next"&&y()},pagination:{clickable:!0,el:w.current},thumbs:{swiper:A},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((l,r)=>{const N=`${e.tabValue}-${r}`,v=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${m.sku}`,component_type:"image",component_name:e?.tabLabel||"",position:r+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},T=l?._responsiveSource||l?.image?.url||"";return t(B,{className:"h-full",children:t(ye,{onExposure:v,exposureKey:N,threshold:.5,duration:2e3,className:"h-full",children:t(W,{source:T,alt:l?.image?.altText,className:k("h-full",p),imgClassName:"object-cover h-full"})})},e?.id+"SwiperSlideItem"+r)})}),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:d})} ${C?.off}`}),t("div",{className:k("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:a,children:t(ae,{className:k("tablet:size-10 lg-desktop:size-12")})}),t("div",{className:k("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:y,children:t(le,{className:k("tablet:size-10 lg-desktop:size-12")})}),h("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:b,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[K,O],children:e?.galleries?.map((l,r)=>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:l.image?.url,alt:l.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},e?.id+"SwiperSlideThumbItem"+r))})}),!e?.index&&h("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 "}),h("div",{className:"relative max-w-[528px]",children:[t("div",{ref:s,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),t($,{modules:[ne],loop:S.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:S.length>0?S.map((l,r)=>t(B,{children:t(J,{html:l,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},r+"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:w,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 o=V(null);return R(()=>{const d=o.current;d&&(d.muted=!0,d.play().catch(()=>{}))},[]),h("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,d]=P(null),C=L(()=>{o?.isBeginning?e.onPrevTab?.():o?.slidePrev()},[o,e]),m=L(()=>{o?.isEnd?e.onNextTab?.():o?.slideNext()},[o,e]);return R(()=>{o&&e.targetSlideIndex!==null&&e.targetSlideIndex!==void 0&&(o.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[o,e.targetSlideIndex,e]),h("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{className:"h-full",onSwiper:d,onTouchEnd:(f,w)=>{f.isBeginning&&f.swipeDirection==="prev"?C():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,w)=>t(B,{className:"h-full bg-info-primary",children:t(xe,{src:f?.sources?.[0]?.url})},e?.id+"SwiperSlideItem"+w))}),t("div",{className:k("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:C,children:t(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),t("div",{className:k("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"})})]})},Be=e=>t("div",{children:"3D View"});var He=fe(he);export{He as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|