@anker-in/headless-ui 1.3.82 → 1.3.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  2. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  3. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  4. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  5. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  6. package/dist/cjs/biz-components/Listing/hooks/useStickyFlip.d.ts +20 -0
  7. package/dist/cjs/biz-components/Listing/hooks/useStickyFlip.js +1 -0
  8. package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -2
  9. package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
  10. package/dist/cjs/biz-components/MiniCart/index.d.ts +6 -3
  11. package/dist/cjs/biz-components/MiniCart/index.js +1 -1
  12. package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
  13. package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
  14. package/dist/cjs/biz-components/Title/index.js +1 -1
  15. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  16. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  17. package/dist/esm/biz-components/Graphic/index.js +1 -1
  18. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  19. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  20. package/dist/esm/biz-components/Listing/hooks/useStickyFlip.d.ts +20 -0
  21. package/dist/esm/biz-components/Listing/hooks/useStickyFlip.js +1 -0
  22. package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -2
  23. package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
  24. package/dist/esm/biz-components/MiniCart/index.d.ts +6 -3
  25. package/dist/esm/biz-components/MiniCart/index.js +1 -1
  26. package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
  27. package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
  28. package/dist/esm/biz-components/Title/index.js +1 -1
  29. package/package.json +1 -1
  30. package/style.css +24 -12
@@ -1 +1 @@
1
- "use strict";"use client";var v=Object.create;var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var y=(e,r)=>{for(var i in r)d(e,i,{get:r[i],enumerable:!0})},c=(e,r,i,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of g(r))!k.call(e,s)&&s!==i&&d(e,s,{get:()=>r[s],enumerable:!(l=u(r,s))||l.enumerable});return e};var x=(e,r,i)=>(i=e!=null?v(b(e)):{},c(r||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),w=e=>c(d({},"__esModule",{value:!0}),e);var G={};y(G,{default:()=>z});module.exports=w(G);var t=require("react/jsx-runtime"),F=x(require("react")),o=require("../../helpers/index.js"),B=require("../../components/badge.js"),h=x(require("../../components/picture.js")),a=require("../../components/text.js");const N=({checked:e,theme:r})=>{const i=r==="dark";return e?(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:i?"#F5F6F7":"#080A0F"}),(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),(0,t.jsx)("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:i?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},m=F.forwardRef(({gift:e,onClick:r,className:i,giftType:l,theme:s,tagBgColor:n,tagTextColor:p},f)=>(0,t.jsx)("div",{ref:f,className:(0,o.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all",l===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,i),onClick:()=>{l===1&&r?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col",children:[(0,t.jsx)("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...n?{backgroundColor:n}:{},...p?{color:p}:{}},children:e.tag})}),(0,t.jsxs)("div",{className:(0,o.cn)("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[(0,t.jsx)("div",{className:"flex size-5 shrink-0 items-center justify-center",children:(0,t.jsx)(N,{checked:!!e.selected,theme:s})}),(0,t.jsx)("div",{className:(0,o.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(h.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(a.Text,{size:2,html:e.name,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&(0,t.jsxs)(a.Text,{size:4,className:(0,o.cn)("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})}));m.displayName="FreeGiftItem";var z=m;
1
+ "use strict";"use client";var g=Object.create;var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var w=(e,r)=>{for(var i in r)n(e,i,{get:r[i],enumerable:!0})},p=(e,r,i,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of b(r))!y.call(e,s)&&s!==i&&n(e,s,{get:()=>r[s],enumerable:!(l=v(r,s))||l.enumerable});return e};var x=(e,r,i)=>(i=e!=null?g(k(e)):{},p(r||!e||!e.__esModule?n(i,"default",{value:e,enumerable:!0}):i,e)),F=e=>p(n({},"__esModule",{value:!0}),e);var P={};w(P,{default:()=>G});module.exports=F(P);var t=require("react/jsx-runtime"),N=x(require("react")),o=require("../../helpers/index.js"),L=require("../../components/badge.js"),f=x(require("../../components/picture.js")),a=require("../../components/text.js");const z=({checked:e,theme:r})=>{const i=r==="dark";return e?(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:i?"#F5F6F7":"#080A0F"}),(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),(0,t.jsx)("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:i?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},m=N.forwardRef(({gift:e,onClick:r,className:i,giftType:l,theme:s,tagBgColor:d,tagTextColor:c},h)=>{const u=l===2||!!e.selected;return(0,t.jsx)("div",{ref:h,className:(0,o.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","buy-one-get-one-shelf-free-gift-item",u?"buy-one-get-one-shelf-free-gift-item-selected":"buy-one-get-one-shelf-free-gift-item-unselected",l===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,i),onClick:()=>{l===1&&r?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col",children:[(0,t.jsx)("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...d?{backgroundColor:d}:{},...c?{color:c}:{}},children:e.tag})}),(0,t.jsxs)("div",{className:(0,o.cn)("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[(0,t.jsx)("div",{className:"flex size-5 shrink-0 items-center justify-center",children:(0,t.jsx)(z,{checked:!!e.selected,theme:s})}),(0,t.jsx)("div",{className:(0,o.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(f.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(a.Text,{size:2,html:e.name,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&(0,t.jsxs)(a.Text,{size:4,className:(0,o.cn)("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})})});m.displayName="FreeGiftItem";var G=m;
@@ -1 +1 @@
1
- "use strict";var L=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(t,l)=>{for(var s in l)y(t,s,{get:l[s],enumerable:!0})},w=(t,l,s,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of S(l))!A.call(t,i)&&i!==s&&y(t,i,{get:()=>l[i],enumerable:!(p=D(l,i))||p.enumerable});return t};var T=(t,l,s)=>(s=t!=null?L(z(t)):{},w(l||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),P=t=>w(y({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=P(R);var e=require("react/jsx-runtime"),m=require("react"),o=require("../../components/index.js"),M=T(require("../Subscribe/index.js")),k=require("./types.js"),x=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),F=require("../../shared/Styles.js");const $=({data:{footer:t}={},currentCountry:l,event:s,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...u})=>{const[f,c]=(0,m.useState)(!1),g=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{c(g)},[g]);const h=(0,m.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...u,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:s?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:s,currentCountry:l,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:s,isMobile:f,currentCountry:l,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:l,subscribeLoading:s,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:s}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(n?.link,i,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:l,isMobile:s,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,b.useAiuiContext)(),[r,u]=(0,m.useState)(!1),{services:f,mainNav:c,country:g}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(v,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(v,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(v,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),s&&(0,e.jsx)("button",{onClick:()=>u(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&s||!s)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:s,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:l,event:s,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,u)=>(0,e.jsxs)(m.Fragment,{children:[u<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(o.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},u))]})}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:s?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:s?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},v=({title:t,lists:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)(),[i,n]=(0,m.useState)(!1),[r,u]=(0,m.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{u(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:l?.map(g=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(o.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},B=({title:t,apps:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)();return l?.length?(0,e.jsxs)("div",{className:s,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:l?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:l,className:s,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),l&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,F.withLayout)($);
1
+ "use strict";var z=Object.create;var N=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var O=(t,s)=>{for(var i in s)N(t,i,{get:s[i],enumerable:!0})},C=(t,s,i,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of T(s))!$.call(t,o)&&o!==i&&N(t,o,{get:()=>s[o],enumerable:!(p=A(s,o))||p.enumerable});return t};var j=(t,s,i)=>(i=t!=null?z(P(t)):{},C(s||!t||!t.__esModule?N(i,"default",{value:t,enumerable:!0}):i,t)),Q=t=>C(N({},"__esModule",{value:!0}),t);var J={};O(J,{default:()=>H});module.exports=Q(J);var e=require("react/jsx-runtime"),u=require("react"),a=require("../../components/index.js"),L=j(require("../Subscribe/index.js")),v=require("./types.js"),x=require("./icons/index.js"),B=require("react-responsive"),d=require("../../helpers/utils.js"),k=require("../AiuiProvider/index.js"),S=require("../../shared/Styles.js");const M=t=>!!(t?.countryName||t?.country),q=({data:{footer:t}={},currentCountry:s,event:i,subscribeLoading:p,classNames:o,className:n,moduleIds:r,...h})=>{const[f,c]=(0,u.useState)(!1),g=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});(0,u.useEffect)(()=>{c(g)},[g]);const y=(0,u.useMemo)(()=>t?.blocks?.find(m=>m?.blockType===v.FooterNavigationBlockType.Brand)?.country,[t]);return(0,e.jsx)("footer",{...h,className:(0,d.cn)(o?.root,n),children:(0,e.jsxs)(a.Container,{className:(0,d.cn)(o?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(a.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(m=>{if(m?.blockType===v.FooterNavigationBlockType.Signup)return(0,e.jsx)(R,{subscribeLoading:p,data:m,onSubmit:i?.signup,id:r?.marketingConversion},m.id);if(m?.blockType===v.FooterNavigationBlockType.Brand)return(0,e.jsx)(G,{data:m,isMobile:f,event:i,currentCountry:s,id:r?.footerBrand},m?.id);if(m?.blockType===v.FooterNavigationBlockType.Main)return(0,e.jsx)(_,{data:{...m,country:y},event:i,isMobile:f,currentCountry:s,id:r?.mainServices},m.id)})]})})},R=({data:t,onSubmit:s,subscribeLoading:i,id:p="footer-marketing-conversion"})=>{const{locale:o="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(L.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:s,loading:i}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(n?.link,o,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},_=({data:t,event:s,isMobile:i,currentCountry:p,id:o="footer-main-services"})=>{const{locale:n="us"}=(0,k.useAiuiContext)(),[r,h]=(0,u.useState)(!1),{services:f,mainNav:c,country:g}=t,y="contact-section",m=!!f?.storeBenefits?.title&&!!f?.storeBenefits?.reasons?.length,b=!!f?.download?.title&&!!f?.download?.apps?.length,E=M(p||g);return(0,e.jsxs)("nav",{id:o,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(m||b)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":b}),children:[m&&(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":b}),children:[(0,e.jsx)(a.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":b}),children:f?.storeBenefits?.reasons?.map(l=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},l?.id))})]}),(0,e.jsx)(F,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":b}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(w,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(w,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(w,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(a.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:y}),i&&(0,e.jsx)("button",{onClick:()=>h(!r),"aria-expanded":r,"aria-controls":y,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&i||!i)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":y,children:c?.contact?.contacts?.map(l=>(0,e.jsxs)(a.Link,{href:l?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},l?.id))}),E?(0,e.jsx)(D,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:i,onChangeCountry:s?.country}):(0,e.jsx)("div",{className:"desktop:hidden border-b border-[#3D3E3F]","aria-hidden":"true"}),b&&(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(F,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":l?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},l?.id))}),!!c?.payment?.length&&(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,role:"listitem","aria-label":l?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},l?.id))})]})]})]})},G=({data:t,isMobile:s,event:i,currentCountry:p,id:o="footer-brand"})=>{const{locale:n="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:o,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(a.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,h)=>(0,e.jsxs)(u.Fragment,{children:[h<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(a.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},h))]})}),(0,e.jsx)(D,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:s,onChangeCountry:i?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(a.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:i?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},w=({title:t,lists:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)(),[o,n]=(0,u.useState)(!1),[r,h]=(0,u.useState)(!1),f=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});if((0,u.useEffect)(()=>{h(f)},[f]),!t)return null;const c=`nav-section-${t.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(a.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!o),"aria-expanded":o,"aria-controls":c,"aria-label":o?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:o?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(o&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:s?.map(g=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(a.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},F=({title:t,apps:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)();return!t||!s?.length?null:(0,e.jsxs)("div",{className:i,children:[(0,e.jsx)(a.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:s?.map(o=>(0,e.jsxs)(a.Link,{href:(0,d.getLocalizedPath)(o?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":o?.icon?.alt||o?.label||"Download app",children:[(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),o?.label&&(0,e.jsx)(a.Text,{html:o?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},o?.id))})]})},D=({country:t,isMobile:s,className:i,onChangeCountry:p})=>M(t)?(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(a.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),s&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})}):null;var H=(0,S.withLayout)(q);
@@ -1 +1 @@
1
- "use strict";"use client";var K=Object.create;var x=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(e,o)=>{for(var s in o)x(e,s,{get:o[s],enumerable:!0})},V=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of W(o))!te.call(e,i)&&i!==s&&x(e,i,{get:()=>o[i],enumerable:!(n=O(o,i))||n.enumerable});return e};var y=(e,o,s)=>(s=e!=null?K(ee(e)):{},V(o||!e||!e.__esModule?x(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>V(x({},"__esModule",{value:!0}),e);var re={};oe(re,{default:()=>ie});module.exports=se(re);var t=require("react/jsx-runtime"),D=require("react-responsive"),r=y(require("react")),A=require("react-dom"),c=require("../../helpers/utils.js"),U=require("../../shared/Styles.js"),z=y(require("../SwiperBox/index.js")),l=require("../../components/index.js"),I=y(require("../Title/index.js")),H=require("../VideoModal/index.js"),R=require("../TextModal/index.js"),C=require("../../hooks/useExposure.js"),w=require("../../shared/trackUrlRef.js"),E=require("../AiuiProvider/index.js"),ae=require("swiper/css");const u="image",h="graphic",G=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),n=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${i} 1919`,`${p} 1439`,`${g} 1024`,`${b} 768`].join(", ")},P="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",le=({data:e,configuration:o})=>{const s=(0,r.useRef)(null),[n,i]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),p=o?.descriptionTag||"h3",g=()=>{switch(o.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-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=a=>{e?.description&&i({visible:!0,x:a.clientX,y:a.clientY,text:e.description})},m=()=>{i(a=>({...a,visible:!1}))};(0,C.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const k=e?.href?"a":"div",T=e?.href?{href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return(0,t.jsx)("div",{ref:s,className:(0,c.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?G(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?G(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(k,{...T,className:(0,c.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:m,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:p,className:`${P} graphic-description`}):(0,t.jsx)(p,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${P} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,A.createPortal)((0,t.jsx)(l.Text,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},B=({items:e=[],sharedConfig:o})=>{const s=n=>{const i=e.length>3,p=e.length>2;switch(n){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(z.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:le,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},L=r.default.forwardRef(({data:e,className:o,...s},n)=>{const i=(0,D.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[g,b]=(0,r.useState)(!1),[m,k]=(0,r.useState)(""),[T,a]=(0,r.useState)(""),[j,_]=(0,r.useState)(""),[Y,M]=(0,r.useState)(null),[q,N]=(0,r.useState)(!1),{locale:Q="us"}=(0,E.useAiuiContext)(),X=e?.isShowTab??!1,f=e?.tabs,Z=e?.tabAlign??"left",[F,J]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(n,()=>p.current),(0,C.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const $={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:Q,onVideoPlayBtnClick:(d,v)=>{b(!0),v?.isYouTube?a?.(v?.youtubeId||""):(k?.(v?.video?.url||""),_?.(v?.mobileVideo?.url||""))},onIconClick:d=>{N(!0),M(d)}},S=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.VideoModal,{visible:g,youTubeId:T,onCloseModal:()=>b(!1),videoUrl:i&&j||m}),(0,t.jsx)(R.TextModal,{textVisible:q,extension:Y?.extension,onCloseModal:()=>{N(!1),M(null)}})]});return!X||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(B,{items:e?.items,sharedConfig:$})]}),S()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:F,onValueChange:J,align:Z,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(B,{items:d.items,sharedConfig:$})},d.id))]}),S()]})});L.displayName="Graphic";var ie=(0,U.withLayout)(L);
1
+ "use strict";"use client";var K=Object.create;var k=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(e,o)=>{for(var s in o)k(e,s,{get:o[s],enumerable:!0})},G=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of W(o))!te.call(e,i)&&i!==s&&k(e,i,{get:()=>o[i],enumerable:!(n=O(o,i))||n.enumerable});return e};var y=(e,o,s)=>(s=e!=null?K(ee(e)):{},G(o||!e||!e.__esModule?k(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>G(k({},"__esModule",{value:!0}),e);var re={};oe(re,{default:()=>ie});module.exports=se(re);var t=require("react/jsx-runtime"),A=require("react-responsive"),r=y(require("react")),U=require("react-dom"),c=require("../../helpers/utils.js"),z=require("../../shared/Styles.js"),H=y(require("../SwiperBox/index.js")),l=require("../../components/index.js"),I=y(require("../Title/index.js")),R=require("../VideoModal/index.js"),E=require("../TextModal/index.js"),C=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),j=require("../AiuiProvider/index.js"),ae=require("swiper/css");const u="image",h="graphic",P=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),n=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${i} 1919`,`${p} 1439`,`${g} 1024`,`${b} 768`].join(", ")},B="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",le=({data:e,configuration:o})=>{const s=(0,r.useRef)(null),[n,i]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),p=o?.descriptionTag||"h3",g=()=>{switch(o.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-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=a=>{e?.description&&i({visible:!0,x:a.clientX,y:a.clientY,text:e.description})},m=()=>{i(a=>({...a,visible:!1}))};(0,C.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return(0,t.jsx)("div",{ref:s,className:(0,c.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(v,{...x,className:(0,c.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:m,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:p,className:`${B} graphic-description`}):(0,t.jsx)(p,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${B} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,U.createPortal)((0,t.jsx)(l.Text,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},L=({items:e=[],sharedConfig:o})=>{const s=n=>{const i=e.length>3,p=e.length>2;switch(n){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(H.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:le,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},D=r.default.forwardRef(({data:e,className:o,...s},n)=>{const i=(0,A.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[g,b]=(0,r.useState)(!1),[m,v]=(0,r.useState)(""),[x,a]=(0,r.useState)(""),[_,M]=(0,r.useState)(""),[Y,N]=(0,r.useState)(null),[q,$]=(0,r.useState)(!1),{locale:Q="us"}=(0,j.useAiuiContext)(),X=e?.isShowTab??!1,f=e?.tabs,Z=e?.tabAlign??"left",[F,J]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(n,()=>p.current),(0,C.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const S={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:Q,onVideoPlayBtnClick:(d,w)=>{b(!0),w?.isYouTube?(a(w?.youtubeId||""),v(""),M("")):(a(""),v(w?.video?.url||""),M(w?.mobileVideo?.url||""))},onIconClick:d=>{$(!0),N(d)}},V=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.VideoModal,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":i&&_||m}),(0,t.jsx)(E.TextModal,{textVisible:q,extension:Y?.extension,onCloseModal:()=>{$(!1),N(null)}})]});return!X||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(L,{items:e?.items,sharedConfig:S})]}),V()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:F,onValueChange:J,align:Z,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(L,{items:d.items,sharedConfig:S})},d.id))]}),V()]})});D.displayName="Graphic";var ie=(0,z.withLayout)(D);
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var s=(t,p)=>{for(var a in p)c(t,a,{get:p[a],enumerable:!0})},x=(t,p,a,e)=>{if(p&&typeof p=="object"||typeof p=="function")for(let d of m(p))!r.call(t,d)&&d!==a&&c(t,d,{get:()=>p[d],enumerable:!(e=i(p,d))||e.enumerable});return t};var g=t=>x(c({},"__esModule",{value:!0}),t);var R={};s(R,{default:()=>N});module.exports=g(R);var o=require("react/jsx-runtime"),l=require("../../../../components/index.js");const G=({BoxLeftGallery:t,BoxRightDetail:p,BoxBottomSummary:a})=>(0,o.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,o.jsxs)(l.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,o.jsx)(l.GridItem,{className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:t}),(0,o.jsx)(l.GridItem,{className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:p})]}),a]});var N=G;
1
+ "use strict";"use client";var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(p,t)=>{for(var a in t)i(p,a,{get:t[a],enumerable:!0})},x=(p,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!f.call(p,o)&&o!==a&&i(p,o,{get:()=>t[o],enumerable:!(l=r(t,o))||l.enumerable});return p};var n=p=>x(i({},"__esModule",{value:!0}),p);var G={};g(G,{default:()=>u});module.exports=n(G);var e=require("react/jsx-runtime"),c=require("react"),d=require("../../../../components/index.js"),m=require("../../hooks/useStickyFlip.js");const R=({BoxLeftGallery:p,BoxRightDetail:t,BoxBottomSummary:a})=>{const l=(0,c.useRef)(null),o=(0,c.useRef)(null);return(0,m.useStickyFlip)(l,o),(0,e.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,e.jsxs)(d.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,e.jsx)(d.GridItem,{ref:l,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:p}),(0,e.jsx)(d.GridItem,{ref:o,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:t})]}),a]})};var u=R;
@@ -1 +1 @@
1
- "use strict";var q=Object.create;var p=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)p(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of U(o))!$.call(t,i)&&i!==e&&p(t,i,{get:()=>o[i],enumerable:!(n=z(o,i))||n.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?p(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(p({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),T=require("../../../BizProductProvider.js"),f=require("react"),c=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),k=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:n="us",trackingData:i,currencyCode:d}=(0,P.useAiuiContext)(),{variant:r,finalPrice:M,totalSavings:m,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,T.useBizProductContext)(),O=(0,k.useBenefits)({variant:r}),{commonCoupon:s,memberDiscount:u}=O,_=i?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,c.formatPrice)({amount:m,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),[e?.totalSavings,m,r.price.currencyCode,n]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const N=s?.enable?Number(s?.config?.fixed_value||0):0,h=u?.enable?u.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(h,N):h+N)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,c.formatPrice)({amount:w,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})})},[e?.unlockedSaving,s?.enable,s?.config?.fixed_value,u?.enable,u?.config?.amount,y,r.price.currencyCode,n]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[r.availableForSale?(0,a.jsxs)("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,c.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),o?o({comparePrice:C}):_&&(m>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,c.formatPrice)({amount:C,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(m>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:r.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
1
+ "use strict";var q=Object.create;var u=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)u(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of U(o))!$.call(t,c)&&c!==e&&u(t,c,{get:()=>o[c],enumerable:!(r=z(o,c))||r.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(u({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),k=require("../../../BizProductProvider.js"),f=require("react"),i=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),T=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:r="us",trackingData:c,currencyCode:d}=(0,P.useAiuiContext)(),{variant:n,finalPrice:M,totalSavings:s,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,k.useBizProductContext)(),O=(0,T.useBenefits)({variant:n}),{commonCoupon:p,memberDiscount:m}=O,_=c?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,i.formatPrice)({amount:s,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),[e?.totalSavings,s,n.price.currencyCode,r]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const h=p?.enable?Number(p?.config?.fixed_value||0):0,N=m?.enable?m.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(N,h):N+h)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,i.formatPrice)({amount:w,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})})},[e?.unlockedSaving,p?.enable,p?.config?.fixed_value,m?.enable,m?.config?.amount,y,n.price.currencyCode,r]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[n.availableForSale?(0,a.jsxs)("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,i.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),o?o({comparePrice:C}):_&&(s>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,i.formatPrice)({amount:C,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(s>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:n.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const FLIP_DURATION = 250;
3
+ export declare const FLIP_EASING = "cubic-bezier(0.2, 0, 0, 1)";
4
+ export declare const FLIP_DESKTOP_QUERY = "(min-width: 1280px)";
5
+ export declare function parseTranslateY(transform: string | null | undefined): number;
6
+ /** 旧视觉位置与新布局位置的差值,小于 MIN_DELTA 视为没有位移 */
7
+ export declare function computeFlipDelta(prevVisualTop: number, nextLayoutTop: number): number;
8
+ /**
9
+ * sticky 元素被容器底部顶住时,观察元素高度变化会让它瞬间跳位。
10
+ * 这里在布局变化后、绘制前,用 FLIP 把这次跳动变成平滑过渡,不改变滚动位置。
11
+ *
12
+ * - 仅在 `query` 命中且未开启 prefers-reduced-motion 时生效
13
+ * - resize 期间不播放动画,避免拖动窗口时拖尾
14
+ * - 动画中再次触发会从当前视觉位置重新起动画
15
+ */
16
+ export declare function useStickyFlip(targetRef: RefObject<HTMLElement | null>, observedRef: RefObject<HTMLElement | null>, options?: {
17
+ query?: string;
18
+ duration?: number;
19
+ easing?: string;
20
+ }): void;
@@ -0,0 +1 @@
1
+ "use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Y(t))!q.call(e,r)&&r!==n&&f(e,r,{get:()=>t[r],enumerable:!(s=C(t,r))||s.enumerable});return e};var U=e=>P(f({},"__esModule",{value:!0}),e);var H={};N(H,{FLIP_DESKTOP_QUERY:()=>z,FLIP_DURATION:()=>M,FLIP_EASING:()=>O,computeFlipDelta:()=>I,parseTranslateY:()=>_,useStickyFlip:()=>k});module.exports=U(H);var h=require("react");const M=250,O="cubic-bezier(0.2, 0, 0, 1)",z="(min-width: 1280px)",j="(prefers-reduced-motion: reduce)",B=.5,$=150;function _(e){if(!e||e==="none")return 0;const t=e.match(/^matrix3d\((.+)\)$/);if(t)return parseFloat(t[1].split(",")[13])||0;const n=e.match(/^matrix\((.+)\)$/);return n&&parseFloat(n[1].split(",")[5])||0}function I(e,t){const n=e-t;return Math.abs(n)<B?0:n}function k(e,t,n={}){const{query:s=z,duration:r=M,easing:T=O}=n;(0,h.useEffect)(()=>{const o=e.current,E=t.current;if(!o||!E||typeof ResizeObserver>"u")return;const S=window.matchMedia(s),F=window.matchMedia(j),D=()=>S.matches&&!F.matches&&typeof o.animate=="function";let i=null,u=!1,d,b=!1;const w=()=>i?_(getComputedStyle(o).transform):0;let m=o.getBoundingClientRect().top;const c=()=>{m=o.getBoundingClientRect().top-w()},a=()=>{const p=i;i=null,p?.cancel()},A=()=>{if(!b){b=!0,c();return}if(u||!D()){a(),c();return}const p=m+w();a();const v=o.getBoundingClientRect().top;m=v;const y=I(p,v);if(!y)return;const l=o.animate([{transform:`translateY(${y}px)`},{transform:"translateY(0)"}],{duration:r,easing:T}),L=()=>{i===l&&(i=null)};l.onfinish=L,l.oncancel=L,i=l},g=()=>c(),x=()=>{u=!0,a(),c(),clearTimeout(d),d=setTimeout(()=>{u=!1,c()},$)},R=new ResizeObserver(A);return R.observe(E),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",x),()=>{R.disconnect(),window.removeEventListener("scroll",g),window.removeEventListener("resize",x),clearTimeout(d),a()}},[e,t,s,r,T])}
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var H=Object.create;var C=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,r)=>{for(var s in r)C(e,s,{get:r[s],enumerable:!0})},z=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of K(r))!U.call(e,c)&&c!==s&&C(e,c,{get:()=>r[c],enumerable:!(i=J(r,c))||i.enumerable});return e};var Z=(e,r,s)=>(s=e!=null?H(Q(e)):{},z(r||!e||!e.__esModule?C(s,"default",{value:e,enumerable:!0}):s,e)),_=e=>z(C({},"__esModule",{value:!0}),e);var re={};V(re,{default:()=>te});module.exports=_(re);var t=require("react/jsx-runtime"),ee=Z(require("react")),m=require("../../components/index.js"),n=require("../../helpers/index.js");const T=({totalSteps:e=4,currentStep:r=0,image:s,label:i,progressColor:c="var(--brand-color-0)",labelColor:E="var(--marketing-color-1)",trackColor:R="#DADCE0",backgroundColor:$="#EAEAEC",size:d=64,laptopSize:g=96,gap:M=3,centerText:N,dimmed:G=!1,dimmedBadge:P,className:I,classNames:o})=>{const f=Math.max(d,g),k=6,a=(f-k)/2,p=f/2,S=ee.useMemo(()=>{const A=(M+k)/a*(180/Math.PI),W=(360-A*e)/e,v=l=>l*Math.PI/180,X=(l,u)=>{const x=l-90,y=u-90,Y=p+a*Math.cos(v(x)),F=p+a*Math.sin(v(x)),L=p+a*Math.cos(v(y)),q=p+a*Math.sin(v(y)),B=u-l>180?1:0;return`M ${Y} ${F} A ${a} ${a} 0 ${B} 1 ${L} ${q}`},w=[];let j=e===2?-45:0;for(let l=0;l<e;l++){const u=j+A/2,x=u+W,y=l<r;w.push({path:X(u,x),isCompleted:y,index:l}),j=x+A/2}return w},[e,r,M,a,p]),[D,...O]=(N||"").split(`
2
- `),h=O.join(" ");return(0,t.jsxs)("div",{className:(0,n.cn)("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",I,o?.root),style:{"--circle-size":`${d}px`,"--circle-laptop-size":`${g}px`,"--circle-height":`${i?d+8:d}px`,"--circle-laptop-height":`${i?g+8:g}px`},children:[(0,t.jsxs)("div",{className:(0,n.cn)("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",o?.ring),children:[(0,t.jsxs)("svg",{viewBox:`0 0 ${f} ${f}`,className:(0,n.cn)("absolute inset-0 size-full",i?"translate-y-[-8px]":""),children:[(0,t.jsx)("circle",{cx:p,cy:p,r:a,fill:$,stroke:"none"}),S.map(b=>(0,t.jsx)("path",{d:b.path,fill:"none",stroke:b.isCompleted?c:R,strokeWidth:k,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},b.index))]}),(0,t.jsx)("div",{className:(0,n.cn)("absolute inset-[10px] flex items-center justify-center",i?"translate-y-[-8px]":"",o?.inner),children:(0,t.jsxs)("div",{className:(0,n.cn)("flex size-full items-center justify-center overflow-hidden rounded-full",P&&"relative"),style:{backgroundColor:$},children:[s?.url&&(0,t.jsx)(m.Picture,{className:(0,n.cn)("size-full",G&&"opacity-40 grayscale",o?.image),imgClassName:"h-full object-contain",source:s.url,alt:s.alt||""}),!s?.url&&N&&(0,t.jsxs)("div",{className:(0,n.cn)("text-info-primary flex flex-col items-center justify-center text-center",h?"gap-0.5":"",o?.centerText),children:[(0,t.jsx)(m.Text,{className:(0,n.cn)("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",h&&"font-bold",o?.centerTextMain),html:D}),h&&(0,t.jsx)(m.Text,{className:(0,n.cn)("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",o?.centerTextSub),html:h})]}),P&&(0,t.jsx)("span",{className:(0,n.cn)("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",o?.badge),children:(0,t.jsx)(m.Text,{size:1,className:"text-center text-white",html:P})})]})})]}),i&&(0,t.jsx)("div",{className:(0,n.cn)("absolute bottom-0 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",o?.label),style:{backgroundColor:E},children:(0,t.jsx)(m.Text,{className:"text-xs font-medium text-white",html:i})})]})};T.displayName="CircleProgress";var te=T;
1
+ "use strict";"use client";var _=Object.create;var w=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var se=(e,r)=>{for(var n in r)w(e,n,{get:r[n],enumerable:!0})},F=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let m of te(r))!ne.call(e,m)&&m!==n&&w(e,m,{get:()=>r[m],enumerable:!(o=ee(r,m))||o.enumerable});return e};var G=(e,r,n)=>(n=e!=null?_(re(e)):{},F(r||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),ie=e=>F(w({},"__esModule",{value:!0}),e);var ae={};se(ae,{default:()=>oe});module.exports=ie(ae);var t=require("react/jsx-runtime"),z=G(require("react")),D=G(require("fitty")),d=require("../../components/index.js"),s=require("../../helpers/index.js");const H=({totalSteps:e=4,currentStep:r=0,image:n,label:o,progressColor:m="var(--brand-color-0)",labelColor:O="var(--marketing-color-1)",trackColor:W="#DADCE0",backgroundColor:$="#EAEAEC",size:b=64,laptopSize:y=96,gap:N=3,centerText:S,dimmed:X=!1,dimmedBadge:P,className:Y,classNames:a})=>{const v=Math.max(b,y),k=6,c=(v-k)/2,u=v/2,q=z.useMemo(()=>{const f=(N+k)/c*(180/Math.PI),i=(360-f*e)/e,C=l=>l*Math.PI/180,J=(l,x)=>{const h=l-90,M=x-90,K=u+c*Math.cos(C(h)),Q=u+c*Math.sin(C(h)),U=u+c*Math.cos(C(M)),V=u+c*Math.sin(C(M)),Z=x-l>180?1:0;return`M ${K} ${Q} A ${c} ${c} 0 ${Z} 1 ${U} ${V}`},L=[];let I=e===2?-45:0;for(let l=0;l<e;l++){const x=I+f/2,h=x+i,M=l<r;L.push({path:J(x,h),isCompleted:M,index:l}),I=h+f/2}return L},[e,r,N,c,u]),[T,...B]=(S||"").split(`
2
+ `),g=B.join(" "),j=z.useRef(null),R=z.useRef(null);return z.useEffect(()=>{const p=[j.current,R.current].filter(i=>!!i);if(!p.length)return;let f=[];const A=()=>{f=p.map(i=>(0,D.default)(i,{minSize:6,maxSize:parseFloat(getComputedStyle(i).fontSize),multiLine:!1}))},E=()=>{f.forEach(i=>i.unsubscribe()),A()};return A(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E),f.forEach(i=>i.unsubscribe())}},[T,g]),(0,t.jsxs)("div",{className:(0,s.cn)("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",Y,a?.root),style:{"--circle-size":`${b}px`,"--circle-laptop-size":`${y}px`,"--circle-height":`${o?b+8:b}px`,"--circle-laptop-height":`${o?y+8:y}px`},children:[(0,t.jsxs)("div",{className:(0,s.cn)("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",a?.ring),children:[(0,t.jsxs)("svg",{viewBox:`0 0 ${v} ${v}`,className:(0,s.cn)("absolute inset-0 size-full",o?"translate-y-[-8px]":""),children:[(0,t.jsx)("circle",{cx:u,cy:u,r:c,fill:$,stroke:"none"}),q.map(p=>(0,t.jsx)("path",{d:p.path,className:(0,s.cn)("mini-cart-progress-segment",p.isCompleted&&"mini-cart-progress-segment-completed"),fill:"none",stroke:p.isCompleted?m:W,strokeWidth:k,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},p.index))]}),(0,t.jsx)("div",{className:(0,s.cn)("absolute inset-[10px] flex items-center justify-center",o?"translate-y-[-8px]":"",a?.inner),children:(0,t.jsxs)("div",{className:(0,s.cn)("flex size-full items-center justify-center overflow-hidden rounded-full",P&&"relative"),style:{backgroundColor:$},children:[n?.url&&(0,t.jsx)(d.Picture,{className:(0,s.cn)("size-full",X&&"opacity-40 grayscale",a?.image),imgClassName:"h-full object-contain",source:n.url,alt:n.alt||""}),!n?.url&&S&&(0,t.jsxs)("div",{className:(0,s.cn)("text-info-primary flex w-4/5 flex-col items-center justify-center text-center",g?"gap-0.5":"",a?.centerText),children:[(0,t.jsx)(d.Text,{ref:j,className:(0,s.cn)("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",g&&"font-bold",a?.centerTextMain),html:T}),g&&(0,t.jsx)(d.Text,{ref:R,className:(0,s.cn)("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",a?.centerTextSub),html:g})]}),P&&(0,t.jsx)("span",{className:(0,s.cn)("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",a?.badge),children:(0,t.jsx)(d.Text,{size:1,className:"text-center text-white",html:P})})]})})]}),o&&(0,t.jsx)("div",{className:(0,s.cn)("mini-cart-progress-label absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",a?.label),style:{backgroundColor:O},children:(0,t.jsx)(d.Text,{className:"mini-cart-progress-label-text text-xs font-medium text-white",html:o})})]})};H.displayName="CircleProgress";var oe=H;
@@ -1 +1 @@
1
- "use strict";"use client";var w=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var P=(n,e)=>{for(var s in e)w(n,s,{get:e[s],enumerable:!0})},L=(n,e,s,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!z.call(n,r)&&r!==s&&w(n,r,{get:()=>e[r],enumerable:!(p=I(e,r))||p.enumerable});return n};var M=n=>L(w({},"__esModule",{value:!0}),n);var j={};P(j,{MiniCartDialog:()=>v,default:()=>S});module.exports=M(j);var t=require("react/jsx-runtime"),i=require("../../helpers/index.js"),o=require("../../components/index.js"),D=require("./index.js");const k=({className:n})=>(0,t.jsx)("svg",{className:n,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),q=({className:n})=>(0,t.jsx)("svg",{className:n,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),T=({item:n,classNames:e,labelStyles:s,onIncrease:p,onDecrease:r})=>{const{merchandise:u,quantity:m,cost:C,readonly:y,productLabel:g,labelVariant:h}=n,{image:d,title:f}=u,{totalAmount:x,subtotalAmount:c}=C,b=f||u.sku||"Product",a=x?.formattedPrice||"",l=c&&x&&parseFloat(c.amount)>parseFloat(x.amount);return(0,t.jsxs)("div",{className:(0,i.cn)("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",e?.item),children:[(0,t.jsxs)("div",{className:(0,i.cn)("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",e?.itemImage),children:[d?.url&&(0,t.jsx)("img",{src:d.url,alt:d.altText||b,className:"size-full object-cover"}),g&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center px-1 py-px backdrop-blur-sm",style:(0,D.resolveCartLineLabelStyle)(h,s),children:(0,t.jsx)(o.Text,{size:1,className:"text-center text-white",html:g})})]}),(0,t.jsxs)("div",{className:(0,i.cn)("laptop:gap-4 flex flex-1 flex-col gap-2",e?.itemInfo),children:[(0,t.jsx)(o.Text,{as:"p",size:3,className:(0,i.cn)("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",e?.itemTitle),children:b}),(0,t.jsxs)("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center gap-1",e?.itemPrice),children:[a&&(0,t.jsx)(o.Text,{size:4,className:(0,i.cn)("text-info-primary laptop:text-[18px] text-[16px]",e?.itemCurrentPrice),children:a}),l&&c?.formattedPrice&&(0,t.jsx)(o.Text,{size:4,className:(0,i.cn)("text-info-tertiary laptop:text-[18px] text-[16px] line-through",e?.itemOriginalPrice),children:c.formattedPrice})]}),y?(0,t.jsx)("div",{className:(0,i.cn)("flex items-center",e?.quantityControl),children:(0,t.jsxs)("span",{className:"text-info-primary text-sm font-semibold",children:["x",m]})}):(0,t.jsxs)("div",{className:(0,i.cn)("flex items-center",e?.quantityControl),children:[(0,t.jsx)("button",{type:"button",onClick:r,disabled:m<=0,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",e?.quantityButton),"aria-label":"Decrease quantity",children:(0,t.jsx)(k,{className:"laptop:size-3 size-[10.67px]"})}),(0,t.jsx)("div",{className:(0,i.cn)("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",e?.quantityValue),children:m}),(0,t.jsx)("button",{type:"button",onClick:p,className:(0,i.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",e?.quantityButton),"aria-label":"Increase quantity",children:(0,t.jsx)(q,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},v=({open:n,onOpenChange:e,cart:s,copy:p,classNames:r={},labelStyles:u,onIncreaseQuantity:m,onDecreaseQuantity:C,onQuantityChange:y})=>{const g=p?.title||"Selected ({count})",h=p?.emptyText||"Your cart is empty",d=s?.lineItems?.reduce((a,l)=>a+(l?.quantity||0),0)||0,f=s?.lineItems||[],x=f.length===0,c=(a,l)=>{m?.(a,l),y?.(a,l+1)},b=(a,l)=>{l>0&&(C?.(a,l),y?.(a,l-1))};return(0,t.jsx)(o.Dialog,{open:n,onOpenChange:e,children:(0,t.jsxs)(o.DialogContent,{className:(0,i.cn)("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",r?.root),children:[(0,t.jsx)(o.DialogHeader,{className:(0,i.cn)("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",r?.header),children:(0,t.jsx)(o.DialogTitle,{asChild:!0,children:(0,t.jsx)(o.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary font-bold",r?.title),children:g.replace("{count}",d.toString())})})}),(0,t.jsx)("div",{className:(0,i.cn)("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",r?.content),children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(o.Text,{size:2,className:"text-info-tertiary",children:h})}):(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col gap-2",r?.itemList),children:f.map(a=>(0,t.jsx)(T,{item:a,classNames:r,labelStyles:u,onIncrease:()=>c(a.id,a.quantity),onDecrease:()=>b(a.id,a.quantity)},a.id))})}),(0,t.jsx)("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};v.displayName="MiniCartDialog";var S=v;
1
+ "use strict";"use client";var M=Object.create;var v=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var j=(i,t)=>{for(var l in t)v(i,l,{get:t[l],enumerable:!0})},I=(i,t,l,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of k(t))!S.call(i,r)&&r!==l&&v(i,r,{get:()=>t[r],enumerable:!(c=T(t,r))||c.enumerable});return i};var H=(i,t,l)=>(l=i!=null?M(q(i)):{},I(t||!i||!i.__esModule?v(l,"default",{value:i,enumerable:!0}):l,i)),B=i=>I(v({},"__esModule",{value:!0}),i);var A={};j(A,{MiniCartDialog:()=>C,default:()=>E});module.exports=B(A);var e=require("react/jsx-runtime"),h=require("react"),N=H(require("fitty")),a=require("../../helpers/index.js"),o=require("../../components/index.js"),z=require("./index.js");const O=({className:i})=>(0,e.jsx)("svg",{className:i,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),R=({className:i})=>(0,e.jsx)("svg",{className:i,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),V=({item:i,classNames:t,labelStyles:l,onIncrease:c,onDecrease:r})=>{const{merchandise:y,quantity:m,cost:w,readonly:g,productLabel:d,labelVariant:D}=i,{image:x,title:b}=y,{totalAmount:u,subtotalAmount:p}=w,f=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(!f.current)return;const P=(0,N.default)(f.current,{minSize:8,maxSize:12,multiLine:!1});return()=>P.unsubscribe()},[d]);const n=b||y.sku||"Product",s=u?.formattedPrice||"",L=p&&u&&parseFloat(p.amount)>parseFloat(u.amount);return(0,e.jsxs)("div",{className:(0,a.cn)("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",t?.item),children:[(0,e.jsxs)("div",{className:(0,a.cn)("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",t?.itemImage),children:[x?.url&&(0,e.jsx)("img",{src:x.url,alt:x.altText||n,className:"size-full object-cover"}),d&&(0,e.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex max-h-4 items-center justify-center overflow-hidden py-0 text-center backdrop-blur-sm",style:(0,z.resolveCartLineLabelStyle)(D,l),children:(0,e.jsx)(o.Text,{ref:f,size:1,className:"leading-[16px] text-white",html:d})})]}),(0,e.jsxs)("div",{className:(0,a.cn)("laptop:gap-4 flex flex-1 flex-col gap-2",t?.itemInfo),children:[(0,e.jsx)(o.Text,{as:"p",size:3,className:(0,a.cn)("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",t?.itemTitle),children:n}),(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[(0,e.jsxs)("div",{className:(0,a.cn)("flex items-center gap-1",t?.itemPrice),children:[s&&(0,e.jsx)(o.Text,{size:4,className:(0,a.cn)("text-info-primary laptop:text-[18px] text-[16px]",t?.itemCurrentPrice),children:s}),L&&p?.formattedPrice&&(0,e.jsx)(o.Text,{size:4,className:(0,a.cn)("text-info-tertiary laptop:text-[18px] text-[16px] line-through",t?.itemOriginalPrice),children:p.formattedPrice})]}),g?(0,e.jsx)("div",{className:(0,a.cn)("flex items-center",t?.quantityControl),children:(0,e.jsxs)("span",{className:"text-info-primary text-sm font-semibold",children:["x",m]})}):(0,e.jsxs)("div",{className:(0,a.cn)("flex items-center",t?.quantityControl),children:[(0,e.jsx)("button",{type:"button",onClick:r,disabled:m<=0,className:(0,a.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",t?.quantityButton),"aria-label":"Decrease quantity",children:(0,e.jsx)(O,{className:"laptop:size-3 size-[10.67px]"})}),(0,e.jsx)("div",{className:(0,a.cn)("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",t?.quantityValue),children:m}),(0,e.jsx)("button",{type:"button",onClick:c,className:(0,a.cn)("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",t?.quantityButton),"aria-label":"Increase quantity",children:(0,e.jsx)(R,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},C=({open:i,onOpenChange:t,cart:l,copy:c,classNames:r={},labelStyles:y,onIncreaseQuantity:m,onDecreaseQuantity:w,onQuantityChange:g})=>{const d=c?.title||"Selected ({count})",D=c?.emptyText||"Your cart is empty",x=l?.lineItems?.reduce((n,s)=>n+(s?.quantity||0),0)||0,b=l?.lineItems||[],u=b.length===0,p=(n,s)=>{m?.(n,s),g?.(n,s+1)},f=(n,s)=>{s>0&&(w?.(n,s),g?.(n,s-1))};return(0,e.jsx)(o.Dialog,{open:i,onOpenChange:t,children:(0,e.jsxs)(o.DialogContent,{className:(0,a.cn)("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",r?.root),children:[(0,e.jsx)(o.DialogHeader,{className:(0,a.cn)("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",r?.header),children:(0,e.jsx)(o.DialogTitle,{asChild:!0,children:(0,e.jsx)(o.Heading,{as:"h3",size:2,className:(0,a.cn)("text-info-primary font-bold",r?.title),children:d.replace("{count}",x.toString())})})}),(0,e.jsx)("div",{className:(0,a.cn)("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",r?.content),children:u?(0,e.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,e.jsx)(o.Text,{size:2,className:"text-info-tertiary",children:D})}):(0,e.jsx)("div",{className:(0,a.cn)("flex flex-col gap-2",r?.itemList),children:b.map(n=>(0,e.jsx)(V,{item:n,classNames:r,labelStyles:y,onIncrease:()=>p(n.id,n.quantity),onDecrease:()=>f(n.id,n.quantity)},n.id))})}),(0,e.jsx)("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};C.displayName="MiniCartDialog";var E=C;
@@ -20,15 +20,18 @@ export interface CircleProgressConfig {
20
20
  labelColor?: string;
21
21
  /** 背景颜色,默认为容器背景色 */
22
22
  backgroundColor?: string;
23
- /** 移动端组件尺寸,默认 48 */
23
+ /** 移动端组件尺寸,默认 64 */
24
24
  size?: number;
25
- /** laptop 以上组件尺寸,默认 80 */
25
+ /** laptop 以上组件尺寸,默认 96 */
26
26
  laptopSize?: number;
27
27
  /** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
28
28
  centerText?: string;
29
29
  /** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
30
30
  dimmed?: boolean;
31
- /** 中间图片上的售罄角标文案(如 "Sold Out") */
31
+ /**
32
+ * 盖在中间图片上的角标,按 HTML 渲染(Text html),传文字、<img> 或 <svg> 均可;有值才渲染,默认不渲染。
33
+ * 默认样式是贴底部的灰色文字条;要改成铺满圆形的印章(如赠品售罄),通过 classNames.badge 覆盖位置与尺寸。
34
+ */
32
35
  dimmedBadge?: string;
33
36
  /** 未完成阶段的颜色 */
34
37
  trackColor?: string;
@@ -1 +1 @@
1
- "use strict";"use client";var Pt=Object.create;var v=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Tt=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty;var At=(i,e)=>{for(var c in e)v(i,c,{get:e[c],enumerable:!0})},U=(i,e,c,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Tt(e))!Bt.call(i,a)&&a!==c&&v(i,a,{get:()=>e[a],enumerable:!(s=It(e,a))||s.enumerable});return i};var X=(i,e,c)=>(c=i!=null?Pt(zt(i)):{},U(e||!i||!i.__esModule?v(c,"default",{value:i,enumerable:!0}):c,i)),Dt=i=>U(v({},"__esModule",{value:!0}),i);var Vt={};At(Vt,{default:()=>Rt,resolveCartLineLabelStyle:()=>$});module.exports=Dt(Vt);var t=require("react/jsx-runtime"),l=X(require("react")),r=require("../../helpers/index.js"),Q=require("../../components/index.js"),f=require("../../components/index.js"),g=require("../../components/index.js"),O=X(require("./CircleProgress.js")),Y=require("../../hooks/useExposure.js");const Et="cart",jt="mini_cart",$=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:c,cart:s,progressConfig:a,onRemoveItem:Z,onCheckout:_,onClickToView:S,...J},K)=>{const y=l.useRef(null),{copy:p,theme:N="light",locale:Ht="us",showMobileViewMore:tt=!0,maxQuantityDisplay:C,labelStyles:et}=c||{};(0,Y.useExposure)(y,{componentType:Et,componentName:jt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),l.useImperativeHandle(K,()=>y.current);const ot=p?.emptyCart||"Your Cart is Empty",P=p?.description||"",rt=p?.itemsInCart||"You have selected {count} items",at=p?.total||"Total {total}",Wt=p?.totalWithCoupon||"total: {total} ({subtotal})",I=p?.clickToView||"Click to view cart",nt=p?.buyNowText||"Buy Now",it=p?.savingText||"Saving {amount}",m=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((o,n)=>o+(n?.quantity||0),0),lt=T===0,st=parseFloat(s?.cost?.totalAmount?.amount||"0"),ct=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),pt=parseFloat(s?.cost?.savingAmount?.amount||"0"),dt=s?.cost?.totalAmount?.formattedPrice||"",z=ct>st?s?.cost?.subtotalAmount?.formattedPrice:null,B=pt>0?s?.cost?.savingAmount?.formattedPrice:null,d=l.useRef(null),[w,mt]=l.useState(!1),[A,D]=l.useState(!1),[E,j]=l.useState(null),R=async o=>{if(!E){j(o);try{await Z?.(o,s)}finally{j(null)}}},[V,k]=l.useState(!1),[ut,gt]=l.useState(0),[bt,ft]=l.useState(0),[H,xt]=l.useState(!1),[W,ht]=l.useState(!0),x=l.useCallback(()=>{const o=d.current;if(!o)return;const{scrollLeft:n,scrollWidth:u,clientWidth:h}=o;xt(n>0),ht(n<u-h-1)},[]),vt=l.useCallback(()=>{x()},[x]);l.useEffect(()=>{x()},[m.length,x]);const yt=o=>{d.current&&(k(!0),gt(o.pageX-d.current.offsetLeft),ft(d.current.scrollLeft))},Ct=o=>{if(!V||!d.current)return;o.preventDefault();const u=(o.pageX-d.current.offsetLeft-ut)*1.5;d.current.scrollLeft=bt-u},wt=()=>{k(!1)},kt=()=>{k(!1)},q=o=>{if(d.current){const n=d.current,u=100;n.scrollBy({left:o==="right"?u:-u,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),Lt=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Mt=o=>m.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:d,onMouseDown:yt,onMouseMove:Ct,onMouseUp:wt,onMouseLeave:kt,onScroll:vt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[m.filter(n=>n&&n.id).map(n=>{const h=(n.merchandise||{}).image||{},G=h.url,Nt=h.altText||"Product image",M=E===n.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[G&&(0,t.jsx)("img",{src:G,alt:Nt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),n.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:$(n.labelVariant,et),children:(0,t.jsx)(f.Text,{size:1,className:"relative text-center text-white",html:n.productLabel})})}),n.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:(0,t.jsx)(f.Text,{className:"text-sm",html:St(n.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>R(n.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(Lt,{className:"pointer-events-none size-[20px] text-white"})})]},n.id)}),tt&&(0,t.jsx)("button",{onClick:()=>S?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&(0,t.jsx)("button",{onClick:()=>q("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,b=!lt&&m.length>0,St=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:y,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":N==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",a&&"laptop:pl-[104px] pl-[72px]"),children:[a&&(0,t.jsx)(O.default,{totalSteps:a.totalSteps,currentStep:a.currentStep,image:a.image,label:a.label,progressColor:a.progressColor,labelColor:a.labelColor,backgroundColor:a.backgroundColor,size:a.size,laptopSize:a.laptopSize,centerText:a.centerText,dimmed:a.dimmed,dimmedBadge:a.dimmedBadge,trackColor:a.trackColor,classNames:a.classNames,className:(0,r.cn)("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:b?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:rt.replace("{count}",`<span class="text-brand-0">${T||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?mt(!w):S?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(f.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",w?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:ot})}),P&&(0,t.jsx)(f.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:P})]})]}),b&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",w?"block":"hidden"),children:Mt(N)}),b&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:at.replace("{total}",dt)}),z&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:z})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:it.replace("{amount}",B)})]}),(0,t.jsx)(Q.Button,{disabled:!b,loading:A,onClick:async()=>{if(!A){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("whitespace-nowrap",e?.actionButton),children:nt})]})]})})});F.displayName="MiniCart";var Rt=F;
1
+ "use strict";"use client";var It=Object.create;var w=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Dt=(i,e)=>{for(var p in e)w(i,p,{get:e[p],enumerable:!0})},X=(i,e,p,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of At(e))!Et.call(i,n)&&n!==p&&w(i,n,{get:()=>e[n],enumerable:!(s=zt(e,n))||s.enumerable});return i};var S=(i,e,p)=>(p=i!=null?It(Bt(i)):{},X(e||!i||!i.__esModule?w(p,"default",{value:i,enumerable:!0}):p,i)),jt=i=>X(w({},"__esModule",{value:!0}),i);var Wt={};Dt(Wt,{default:()=>Vt,resolveCartLineLabelStyle:()=>K});module.exports=jt(Wt);var t=require("react/jsx-runtime"),l=S(require("react")),Q=S(require("fitty")),r=require("../../helpers/index.js"),O=require("../../components/index.js"),b=require("../../components/index.js"),g=require("../../components/index.js"),Y=S(require("./CircleProgress.js")),$=require("../../hooks/useExposure.js");const Rt="cart",Ht="mini_cart",K=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:p,cart:s,progressConfig:n,onRemoveItem:Z,onCheckout:_,onClickToView:N,...J},tt)=>{const x=l.useRef(null),{copy:d,theme:P="light",locale:qt="us",showMobileViewMore:et=!0,maxQuantityDisplay:C,labelStyles:ot}=p||{};(0,$.useExposure)(x,{componentType:Rt,componentName:Ht,componentTitle:d?.itemsInCart||"Mini Cart",componentDescription:d?.description}),l.useImperativeHandle(tt,()=>x.current);const rt=d?.emptyCart||"Your Cart is Empty",T=d?.description||"",at=d?.itemsInCart||"You have selected {count} items",nt=d?.total||"Total {total}",Gt=d?.totalWithCoupon||"total: {total} ({subtotal})",I=d?.clickToView||"Click to view cart",it=d?.buyNowText||"Buy Now",lt=d?.savingText||"Saving {amount}",u=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),z=u.reduce((o,a)=>o+(a?.quantity||0),0),st=z===0,ct=parseFloat(s?.cost?.totalAmount?.amount||"0"),pt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),dt=parseFloat(s?.cost?.savingAmount?.amount||"0"),mt=s?.cost?.totalAmount?.formattedPrice||"",A=pt>ct?s?.cost?.subtotalAmount?.formattedPrice:null,B=dt>0?s?.cost?.savingAmount?.formattedPrice:null,m=l.useRef(null),[h,ut]=l.useState(!1),[E,D]=l.useState(!1),[j,R]=l.useState(null),H=async o=>{if(!j){R(o);try{await Z?.(o,s)}finally{R(null)}}},[V,k]=l.useState(!1),[gt,ft]=l.useState(0),[bt,xt]=l.useState(0),[W,ht]=l.useState(!1),[q,vt]=l.useState(!0),v=l.useCallback(()=>{const o=m.current;if(!o)return;const{scrollLeft:a,scrollWidth:c,clientWidth:y}=o;ht(a>0),vt(a<c-y-1)},[]),yt=l.useCallback(()=>{v()},[v]);l.useEffect(()=>{v()},[u.length,v]);const wt=u.map(o=>o.productLabel??"").join("|");l.useEffect(()=>{const o=x.current?.querySelectorAll("[data-fit-label]");if(!o?.length)return;const a=Array.from(o,c=>(0,Q.default)(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[wt,h]);const Ct=o=>{m.current&&(k(!0),ft(o.pageX-m.current.offsetLeft),xt(m.current.scrollLeft))},kt=o=>{if(!V||!m.current)return;o.preventDefault();const c=(o.pageX-m.current.offsetLeft-gt)*1.5;m.current.scrollLeft=bt-c},Lt=()=>{k(!1)},Mt=()=>{k(!1)},G=o=>{if(m.current){const a=m.current,c=100;a.scrollBy({left:o==="right"?c:-c,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),St=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Nt=o=>u.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:m,onMouseDown:Ct,onMouseMove:kt,onMouseUp:Lt,onMouseLeave:Mt,onScroll:yt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[u.filter(a=>a&&a.id).map(a=>{const y=(a.merchandise||{}).image||{},U=y.url,Tt=y.altText||"Product image",M=j===a.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[U&&(0,t.jsx)("img",{src:U,alt:Tt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:K(a.labelVariant,ot),children:(0,t.jsx)("div",{className:"w-full text-center",children:(0,t.jsx)(b.Text,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:(0,t.jsx)(b.Text,{className:"whitespace-nowrap text-sm leading-none",html:Pt(a.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(St,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),et&&(0,t.jsx)("button",{onClick:()=>N?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!q&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!q}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,f=!st&&u.length>0,Pt=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:x,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":P==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&(0,t.jsx)(Y.default,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:(0,r.cn)("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:f?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:at.replace("{count}",`<span class="mini-cart-count text-brand-0">${z||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?ut(!h):N?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(b.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",h?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:rt})}),T&&(0,t.jsx)(b.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:T})]})]}),f&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",h?"block":"hidden"),children:Nt(P)}),f&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:nt.replace("{total}",mt)}),A&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:A})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:lt.replace("{amount}",B)})]}),(0,t.jsx)(O.Button,{disabled:!f,loading:E,onClick:async()=>{if(!E){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("mini-cart-action-button whitespace-nowrap",e?.actionButton),children:it})]})]})})});F.displayName="MiniCart";var Vt=F;
@@ -1 +1 @@
1
- "use strict";"use client";var j=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of O(r))!A.call(t,l)&&l!==e&&g(t,l,{get:()=>r[l],enumerable:!(m=D(r,l))||m.enumerable});return t};var I=(t,r,e)=>(e=t!=null?j(q(t)):{},b(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),R=t=>b(g({},"__esModule",{value:!0}),t);var U={};H(U,{SceneProductCard:()=>x});module.exports=R(U);var a=require("react/jsx-runtime"),M=I(require("react")),i=require("../../helpers/index.js"),s=require("../../components/index.js"),k=require("./context.js"),C=require("../../shared/LocalizedLink.js");const x=M.forwardRef(({className:t,classNames:r,product:e,selected:m,onSelectChange:l,showTags:P,showOriginalPrice:u,onProductImageClick:N,...S},v)=>{const c=(0,k.useSceneShelfContext)(),w=P??c?.showTags??!0,y=u??c?.showOriginalPrice??!0,o=r??c?.classNames??{},p=m??(c?c.selectedIds.has(e.id):!1),h=l??c?.onSelectChange,f=N??c?.onProductImageClick,d=e.soldOut??!1,z=n=>{d||typeof n=="boolean"&&h?.(n,e)},T=()=>{d||h?.(!p,e)};return(0,a.jsxs)("div",{ref:v,className:(0,i.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",p?(0,i.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,i.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:T,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...S,children:[(0,a.jsx)("div",{className:(0,i.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:w&&e.tags?.map((n,L)=>(0,a.jsx)(s.Badge,{variant:n.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:n.label},L))}),(0,a.jsx)(s.Checkbox,{checked:p,disabled:d,onCheckedChange:z,onClick:n=>n.stopPropagation(),className:(0,i.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:f?(0,a.jsx)("a",{onClick:()=>f(e),role:"button",children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(C.LocalizedLink,{href:e.href,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary line-clamp-2 h-[2.2em]",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),y&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,i.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});x.displayName="SceneShelf.ProductCard";
1
+ "use strict";"use client";var j=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of O(r))!A.call(t,l)&&l!==e&&g(t,l,{get:()=>r[l],enumerable:!(m=D(r,l))||m.enumerable});return t};var I=(t,r,e)=>(e=t!=null?j(q(t)):{},b(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),R=t=>b(g({},"__esModule",{value:!0}),t);var U={};H(U,{SceneProductCard:()=>x});module.exports=R(U);var a=require("react/jsx-runtime"),M=I(require("react")),i=require("../../helpers/index.js"),s=require("../../components/index.js"),k=require("./context.js"),C=require("../../shared/LocalizedLink.js");const x=M.forwardRef(({className:t,classNames:r,product:e,selected:m,onSelectChange:l,showTags:P,showOriginalPrice:u,onProductImageClick:N,...S},v)=>{const c=(0,k.useSceneShelfContext)(),w=P??c?.showTags??!0,y=u??c?.showOriginalPrice??!0,o=r??c?.classNames??{},p=m??(c?c.selectedIds.has(e.id):!1),h=l??c?.onSelectChange,f=N??c?.onProductImageClick,d=e.soldOut??!1,z=n=>{d||typeof n=="boolean"&&h?.(n,e)},T=()=>{d||h?.(!p,e)};return(0,a.jsxs)("div",{ref:v,className:(0,i.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",p?(0,i.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,i.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:T,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...S,children:[(0,a.jsx)("div",{className:(0,i.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:w&&e.tags?.map((n,L)=>(0,a.jsx)(s.Badge,{variant:n.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:n.label},L))}),(0,a.jsx)(s.Checkbox,{checked:p,disabled:d,onCheckedChange:z,onClick:n=>n.stopPropagation(),className:(0,i.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:f?(0,a.jsx)("a",{onClick:()=>f(e),role:"button",children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(C.LocalizedLink,{href:e.href,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary line-clamp-2",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),y&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,i.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});x.displayName="SceneShelf.ProductCard";
@@ -1 +1 @@
1
- "use strict";"use client";var W=Object.create;var x=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var $=(e,r)=>{for(var o in r)x(e,o,{get:r[o],enumerable:!0})},D=(e,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of Y(r))!_.call(e,c)&&c!==o&&x(e,c,{get:()=>r[c],enumerable:!(u=X(r,c))||u.enumerable});return e};var ee=(e,r,o)=>(o=e!=null?W(Z(e)):{},D(r||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),te=e=>D(x({},"__esModule",{value:!0}),e);var ae={};$(ae,{SceneShelfProductsPanel:()=>g});module.exports=te(ae);var t=require("react/jsx-runtime"),f=ee(require("react")),y=require("swiper/react"),P=require("swiper/modules"),n=require("../../helpers/index.js"),i=require("../../components/index.js"),F=require("./context.js"),oe=require("swiper/css");const g=f.forwardRef(({title:e,totalPriceLabel:r,totalCurrentPrice:o,totalOriginalPrice:u,primaryButtonText:c,primaryButtonFun:M,secondaryButtonText:A,secondaryButtonFun:R,bundleDiscountLabel:O,className:z,children:V,...H},j)=>{const a=(0,F.useSceneShelfContext)(),s=a?.classNames,h=r??a?.totalPriceLabel??"Total Price:",p=o??a?.totalCurrentPrice,w=u??a?.totalOriginalPrice,B=c??a?.primaryButtonText??"Shop Now",T=M??a?.primaryButtonFun??"buyNow",N=A??a?.secondaryButtonText??"Add to Cart",S=R??a?.secondaryButtonFun??"addCart",m=O??a?.bundleDiscountLabel,d=a?.selectedProducts??[],E=a?.onLearnMore,q=a?.onShopNow,G=a?.onAddToCart,I=a?.showOriginalPrice??!0,[J,K]=f.useState(!1),[Q,U]=f.useState(!1),L=f.Children.toArray(V),v=async(l,b)=>{if(!l)return;const C=b==="primary"?K:U;C(!0);try{switch(l){case"buyNow":await q?.(d);break;case"addCart":await G?.(d);break;case"learnMore":await E?.(d);break;default:break}}finally{C(!1)}},k=l=>l==="learnMore"?!1:d.length===0;return(0,t.jsxs)("div",{ref:j,className:(0,n.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",z,s?.content),...H,children:[e&&(0,t.jsx)(i.Heading,{as:"h2",size:3,className:(0,n.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",s?.title),html:e}),(0,t.jsx)("div",{className:(0,n.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",s?.productList),children:(0,t.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:10,breakpoints:{0:{slidesPerView:1.5},768:{spaceBetween:16,slidesPerView:2.8},1024:{slidesPerView:2.3},1440:{spaceBetween:16,slidesPerView:L.length<=3?3:3.2}},children:L.map((l,b)=>(0,t.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:l},b))})}),(0,t.jsxs)("div",{className:(0,n.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",s?.footer),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,n.cn)("flex flex-wrap items-center gap-1",s?.totalPrice),children:[h&&(0,t.jsx)(i.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:h}),p&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",s?.currentTotalPrice),children:p.formatted}),I&&w&&p&&w.value>p.value&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",s?.originalTotalPrice),children:w.formatted})]}),m&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",s?.bundleDiscountLabel),children:typeof m=="function"?m(d):m})]}),(0,t.jsxs)("div",{className:(0,n.cn)("flex items-stretch gap-3",s?.buttonGroup),children:[N&&(0,t.jsx)(i.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>v(S,"secondary"),disabled:k(S),loading:Q,children:N}),B&&(0,t.jsx)(i.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>v(T,"primary"),disabled:k(T),loading:J,children:B})]})]})]})});g.displayName="SceneShelf.ProductsPanel";
1
+ "use strict";"use client";var Y=Object.create;var f=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ne=(t,r)=>{for(var n in r)f(t,n,{get:r[n],enumerable:!0})},R=(t,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of te(r))!re.call(t,l)&&l!==n&&f(t,l,{get:()=>r[l],enumerable:!(p=ee(r,l))||p.enumerable});return t};var oe=(t,r,n)=>(n=t!=null?Y(ae(t)):{},R(r||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>R(f({},"__esModule",{value:!0}),t);var ie={};ne(ie,{SceneShelfProductsPanel:()=>S});module.exports=se(ie);var e=require("react/jsx-runtime"),c=oe(require("react")),y=require("swiper/react"),P=require("swiper/modules"),o=require("../../helpers/index.js"),s=require("../../components/index.js"),z=require("../SwiperBox/buildSsrSlideCss.js"),H=require("./context.js"),ce=require("swiper/css");const S=c.forwardRef(({title:t,totalPriceLabel:r,totalCurrentPrice:n,totalOriginalPrice:p,primaryButtonText:l,primaryButtonFun:O,secondaryButtonText:V,secondaryButtonFun:_,bundleDiscountLabel:j,className:E,children:I,...$},q)=>{const a=(0,H.useSceneShelfContext)(),i=a?.classNames,T=r??a?.totalPriceLabel??"Total Price:",m=n??a?.totalCurrentPrice,w=p??a?.totalOriginalPrice,N=l??a?.primaryButtonText??"Shop Now",L=O??a?.primaryButtonFun??"buyNow",C=V??a?.secondaryButtonText??"Add to Cart",k=_??a?.secondaryButtonFun??"addCart",x=j??a?.bundleDiscountLabel,u=a?.selectedProducts??[],G=a?.onLearnMore,W=a?.onShopNow,Z=a?.onAddToCart,J=a?.showOriginalPrice??!0,[K,Q]=c.useState(!1),[U,X]=c.useState(!1),v=c.Children.toArray(I),D=v.length,g=c.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:D<=3?3:3.2,spaceBetween:16}}),[D]),b=`swiper-ssr-${c.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,h=c.useMemo(()=>(0,z.buildSsrSlideCss)(`.${b}`,g),[b,g]),F=async(d,B)=>{if(!d)return;const A=B==="primary"?Q:X;A(!0);try{switch(d){case"buyNow":await W?.(u);break;case"addCart":await Z?.(u);break;case"learnMore":await G?.(u);break;default:break}}finally{A(!1)}},M=d=>d==="learnMore"?!1:u.length===0;return(0,e.jsxs)("div",{ref:q,className:(0,o.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",E,i?.content),...$,children:[t&&(0,e.jsx)(s.Heading,{as:"h2",size:3,className:(0,o.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",i?.title),html:t}),(0,e.jsxs)("div",{className:(0,o.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",i?.productList),children:[h&&(0,e.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:h}}),(0,e.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},className:h?b:void 0,breakpoints:g,children:v.map((d,B)=>(0,e.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:d},B))})]}),(0,e.jsxs)("div",{className:(0,o.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",i?.footer),children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsxs)("div",{className:(0,o.cn)("flex flex-wrap items-center gap-1",i?.totalPrice),children:[T&&(0,e.jsx)(s.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:T}),m&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",i?.currentTotalPrice),children:m.formatted}),J&&w&&m&&w.value>m.value&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",i?.originalTotalPrice),children:w.formatted})]}),x&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",i?.bundleDiscountLabel),children:typeof x=="function"?x(u):x})]}),(0,e.jsxs)("div",{className:(0,o.cn)("flex items-stretch gap-3",i?.buttonGroup),children:[C&&(0,e.jsx)(s.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(k,"secondary"),disabled:M(k),loading:U,children:C}),N&&(0,e.jsx)(s.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(L,"primary"),disabled:M(L),loading:K,children:N})]})]})]})});S.displayName="SceneShelf.ProductsPanel";
@@ -1 +1 @@
1
- "use strict";"use client";var pt=Object.create;var w=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var wt=(t,n)=>{for(var e in n)w(t,e,{get:n[e],enumerable:!0})},S=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ht(n))!xt.call(t,r)&&r!==e&&w(t,r,{get:()=>n[r],enumerable:!(o=ft(n,r))||o.enumerable});return t};var bt=(t,n,e)=>(e=t!=null?pt(gt(t)):{},S(n||!t||!t.__esModule?w(e,"default",{value:t,enumerable:!0}):e,t)),yt=t=>S(w({},"__esModule",{value:!0}),t);var Ft={};wt(Ft,{default:()=>Lt});module.exports=yt(Ft);var i=require("react/jsx-runtime"),a=bt(require("react")),b=require("gsap"),F=require("gsap/dist/SplitText"),H=require("gsap/dist/ScrollTrigger"),l=require("../../helpers/utils.js"),C=require("class-variance-authority"),d=require("../../components/index.js"),O=require("../../shared/Styles.js"),U=require("../AiuiProvider/index.js"),W=require("@payloadcms/richtext-lexical/plaintext"),Z=require("../../shared/trackUrlRef.js"),q=require("react-intersection-observer");const $="link",_="title";function vt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const n=t?.root?.children;return!Array.isArray(n)||n.length===0?!1:n.some(e=>{const o=e?.children;return!Array.isArray(o)||o.length===0?!1:o.some(r=>typeof r?.text=="string"&&r.text.length>0)})}function B(t){if(!t)return"";if(typeof t=="string")return t;try{return(0,W.convertLexicalToPlaintext)({data:t})||""}catch{return""}}const kt=(0,C.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),Tt=(0,C.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),I=({data:t,onClick:n,className:e})=>{const{theme:o="light",extensions:r,title:h,caption:y,align:g}=t,{locale:v="us"}=(0,U.useAiuiContext)();if(!r?.textLink)return null;const u=r?.link?(0,Z.trackUrlRef)((0,l.getLocalizedPath)(r.link,v),`${$}_${_}`):void 0;return(0,i.jsxs)("a",{className:(0,l.cn)({"aiui-dark":o==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":o==="light"},{"text-[#F5F6F7]":o==="dark"},{"justify-center mt-4":g==="center"},{"mt-1 laptop:mt-0":g==="left"},e),...u?{href:u}:{},"data-headless-type-name":`${$}#${_}`,"data-headless-title-desc-button":`${B(h)}#${B(y)}`,...n?{onClick:n}:{},children:[(0,i.jsx)("div",{className:"truncate whitespace-nowrap",children:r?.textLink}),(0,i.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,i.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:o==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},j=a.default.forwardRef(({data:t,className:n,classNames:e,as:o="h2",weight:r="bold",onButtonClick:h,id:y,...g},v)=>{const{title:u,titleSize:G=4,caption:D,subtitle:M,content:z,countdown:s,showCountdown:J=!1,theme:x="light",extensions:E,align:m="left"}=t,P=(0,a.useRef)(null),p=(0,a.useRef)(null),c=(0,a.useRef)(null),f=(0,a.useRef)(null),[K,Q]=(0,a.useState)(!0),{ref:X,inView:R}=(0,q.useInView)();(0,a.useImperativeHandle)(v,()=>P.current);const Y=()=>{Q(!1)},tt=s?.targetDateTime||s?.targetDate||"",et=s?.targetDateTime_tz,nt=s?.labels?{day:s.labels.days||"Day",hour:s.labels.hours||"Hours",minute:s.labels.minutes||"Mins",second:s.labels.seconds||"Secs"}:void 0;return(0,a.useEffect)(()=>{b.gsap.registerPlugin(F.SplitText,H.ScrollTrigger);function rt(){if(!p.current)return;const it=p.current?.clientHeight||80;c.current&&c.current.revert(),f.current&&f.current.kill(),c.current=new F.SplitText(p.current,{type:"words",wordsClass:"word"});const k=c.current.words;b.gsap.set(k,{opacity:0}),f.current=H.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${it*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:ot=>{const st=ot.progress,A=k.length||1,at=.5,T=1/A,V=T*(1-at),N=(A-1)*V+T,lt=Math.min(1,N>0?st/N:0);k.forEach((dt,ct)=>{const ut=ct*V,mt=T;let L=(lt-ut)/mt;L=Math.max(0,Math.min(1,L)),b.gsap.set(dt,{opacity:L})})}})}return R&&rt(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[R]),(0,i.jsxs)("div",{id:E?.id?E?.id:y,className:(0,l.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",n,e?.wrapper),...g,ref:P,children:[(0,i.jsxs)("div",{ref:X,className:(0,l.cn)("flex-1",e?.container,{"aiui-dark":x==="dark","text-center":m==="center","text-left":m==="left"}),children:[(D||u)&&(0,i.jsx)(d.Heading,{ref:p,as:o,size:G,html:D||u,weight:r,className:(0,l.cn)(kt({theme:x}),e?.title)}),M&&(0,i.jsx)(d.Text,{html:M,as:"div",className:(0,l.cn)(Tt({theme:x}),e?.subtitle)}),vt(z)&&(0,i.jsx)(d.Text,{html:z,as:"div",size:4,className:(0,l.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,i.jsx)(I,{data:t,className:(0,l.cn)({"laptop:hidden":m==="left"},e?.button),onClick:h}),J&&s&&K&&(0,i.jsx)(d.Countdown,{endDate:tt,endDate_tz:et,timeLabels:nt,showDays:s?.showDays,showHours:s?.showHours,showMinutes:s?.showMinutes,showSeconds:s?.showSeconds,theme:x,onExpire:Y,hideWhenExpired:!0,align:m==="center"?"center":"left",className:(0,l.cn)("mt-4",e?.countdown)})]}),(0,i.jsx)(I,{data:t,className:(0,l.cn)("hidden",{"laptop:flex":m==="left"},e?.button),onClick:h})]})});j.displayName="Title";var Lt=(0,O.withLayout)(j);
1
+ "use strict";"use client";var pt=Object.create;var x=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var ht=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var xt=(t,n)=>{for(var e in n)x(t,e,{get:n[e],enumerable:!0})},A=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of ft(n))!gt.call(t,l)&&l!==e&&x(t,l,{get:()=>n[l],enumerable:!(o=mt(n,l))||o.enumerable});return t};var wt=(t,n,e)=>(e=t!=null?pt(ht(t)):{},A(n||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),yt=t=>A(x({},"__esModule",{value:!0}),t);var kt={};xt(kt,{default:()=>vt});module.exports=yt(kt);var r=require("react/jsx-runtime"),s=wt(require("react")),w=require("gsap"),k=require("gsap/dist/SplitText"),C=require("gsap/dist/ScrollTrigger"),a=require("../../helpers/utils.js"),c=require("../../components/index.js"),O=require("../../shared/Styles.js"),U=require("../AiuiProvider/index.js"),W=require("@payloadcms/richtext-lexical/plaintext"),Z=require("../../shared/trackUrlRef.js"),q=require("react-intersection-observer");const V="link",B="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const n=t?.root?.children;return!Array.isArray(n)||n.length===0?!1:n.some(e=>{const o=e?.children;return!Array.isArray(o)||o.length===0?!1:o.some(l=>typeof l?.text=="string"&&l.text.length>0)})}function I(t){if(!t)return"";if(typeof t=="string")return t;try{return(0,W.convertLexicalToPlaintext)({data:t})||""}catch{return""}}const Tt="text-info-primary desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",_=({data:t,onClick:n,className:e})=>{const{extensions:o,title:l,caption:f,align:h}=t,{locale:y="us"}=(0,U.useAiuiContext)();if(!o?.textLink)return null;const g=o?.link?(0,Z.trackUrlRef)((0,a.getLocalizedPath)(o.link,y),`${V}_${B}`):void 0;return(0,r.jsxs)("a",{className:(0,a.cn)("text-info-primary hover:text-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"justify-center mt-4":h==="center"},{"mt-1 laptop:mt-0":h==="left"},e),...g?{href:g}:{},"data-headless-type-name":`${V}#${B}`,"data-headless-title-desc-button":`${I(l)}#${I(f)}`,...n?{onClick:n}:{},children:[(0,r.jsx)("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),(0,r.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,r.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:"currentColor",className:"transition-all duration-[0.4s]"})})})]})},j=s.default.forwardRef(({data:t,className:n,classNames:e,as:o="h2",weight:l="bold",onButtonClick:f,id:h,...y},g)=>{const{title:L,titleSize:F=4,caption:H,subtitle:D,content:M,countdown:i,showCountdown:G=!1,theme:z="light",extensions:E,align:u="left"}=t,P=(0,s.useRef)(null),p=(0,s.useRef)(null),d=(0,s.useRef)(null),m=(0,s.useRef)(null),[J,K]=(0,s.useState)(!0),{ref:Q,inView:R}=(0,q.useInView)();(0,s.useImperativeHandle)(g,()=>P.current);const X=()=>{K(!1)},Y=i?.targetDateTime||i?.targetDate||"",tt=i?.targetDateTime_tz,et=i?.labels?{day:i.labels.days||"Day",hour:i.labels.hours||"Hours",minute:i.labels.minutes||"Mins",second:i.labels.seconds||"Secs"}:void 0;return(0,s.useEffect)(()=>{w.gsap.registerPlugin(k.SplitText,C.ScrollTrigger);function nt(){if(!p.current)return;const rt=p.current?.clientHeight||80;d.current&&d.current.revert(),m.current&&m.current.kill(),d.current=new k.SplitText(p.current,{type:"words",wordsClass:"word"});const b=d.current.words;w.gsap.set(b,{opacity:0}),m.current=C.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${rt*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:ot=>{const it=ot.progress,N=b.length||1,st=.5,T=1/N,S=T*(1-st),$=(N-1)*S+T,lt=Math.min(1,$>0?it/$:0);b.forEach((at,ct)=>{const dt=ct*S,ut=T;let v=(lt-dt)/ut;v=Math.max(0,Math.min(1,v)),w.gsap.set(at,{opacity:v})})}})}return R&&nt(),()=>{d.current&&d.current.revert(),m.current&&m.current.kill()}},[R]),(0,r.jsxs)("div",{id:E?.id?E?.id:h,className:(0,a.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",{"aiui-dark":z==="dark"},n,e?.wrapper),...y,ref:P,children:[(0,r.jsxs)("div",{ref:Q,className:(0,a.cn)("flex-1",e?.container,{"text-center":u==="center","text-left":u==="left"}),children:[(H||L)&&(0,r.jsx)(c.Heading,{ref:p,as:o,size:F,html:H||L,weight:l,className:(0,a.cn)("text-info-primary",e?.title)}),D&&(0,r.jsx)(c.Text,{html:D,as:"div",className:(0,a.cn)(Tt,e?.subtitle)}),bt(M)&&(0,r.jsx)(c.Text,{html:M,as:"div",size:4,className:(0,a.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,r.jsx)(_,{data:t,className:(0,a.cn)({"laptop:hidden":u==="left"},e?.button),onClick:f}),G&&i&&J&&(0,r.jsx)(c.Countdown,{endDate:Y,endDate_tz:tt,timeLabels:et,showDays:i?.showDays,showHours:i?.showHours,showMinutes:i?.showMinutes,showSeconds:i?.showSeconds,theme:z,onExpire:X,hideWhenExpired:!0,align:u==="center"?"center":"left",className:(0,a.cn)("mt-4",e?.countdown)})]}),(0,r.jsx)(_,{data:t,className:(0,a.cn)("hidden",{"laptop:flex":u==="left"},e?.button),onClick:f})]})});j.displayName="Title";var vt=(0,O.withLayout)(j);
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as m from"react";import{cn as r}from"../../helpers/index.js";import"../../components/badge.js";import h from"../../components/picture.js";import{Text as s}from"../../components/text.js";const f=({checked:e,theme:l})=>{const o=l==="dark";return e?i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:o?"#F5F6F7":"#080A0F"}),t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),t("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:o?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},p=m.forwardRef(({gift:e,onClick:l,className:o,giftType:a,theme:c,tagBgColor:d,tagTextColor:n},x)=>t("div",{ref:x,className:r("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all",a===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,o),onClick:()=>{a===1&&l?.(e)},children:i("div",{className:"flex size-full flex-col",children:[t("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&t("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...d?{backgroundColor:d}:{},...n?{color:n}:{}},children:e.tag})}),i("div",{className:r("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[t("div",{className:"flex size-5 shrink-0 items-center justify-center",children:t(f,{checked:!!e.selected,theme:c})}),t("div",{className:r("size-14 shrink-0","tablet:size-12"),children:t(h,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),i("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[t(s,{size:2,html:e.name,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),i("div",{className:"mt-auto flex items-center justify-between gap-2",children:[i("div",{className:"flex items-center gap-2",children:[t(s,{size:2,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&t(s,{size:2,className:r("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&i(s,{size:4,className:r("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})}));p.displayName="FreeGiftItem";var y=p;export{y as default};
1
+ "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as f from"react";import{cn as r}from"../../helpers/index.js";import"../../components/badge.js";import h from"../../components/picture.js";import{Text as s}from"../../components/text.js";const u=({checked:e,theme:l})=>{const o=l==="dark";return e?i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:o?"#F5F6F7":"#080A0F"}),t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),t("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:o?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},c=f.forwardRef(({gift:e,onClick:l,className:o,giftType:a,theme:p,tagBgColor:n,tagTextColor:d},x)=>{const m=a===2||!!e.selected;return t("div",{ref:x,className:r("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","buy-one-get-one-shelf-free-gift-item",m?"buy-one-get-one-shelf-free-gift-item-selected":"buy-one-get-one-shelf-free-gift-item-unselected",a===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,o),onClick:()=>{a===1&&l?.(e)},children:i("div",{className:"flex size-full flex-col",children:[t("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&t("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...n?{backgroundColor:n}:{},...d?{color:d}:{}},children:e.tag})}),i("div",{className:r("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[t("div",{className:"flex size-5 shrink-0 items-center justify-center",children:t(u,{checked:!!e.selected,theme:p})}),t("div",{className:r("size-14 shrink-0","tablet:size-12"),children:t(h,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),i("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[t(s,{size:2,html:e.name,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),i("div",{className:"mt-auto flex items-center justify-between gap-2",children:[i("div",{className:"flex items-center gap-2",children:[t(s,{size:2,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&t(s,{size:2,className:r("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&i(s,{size:4,className:r("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})})});c.displayName="FreeGiftItem";var w=c;export{w as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Fragment as D,useEffect as w,useMemo as S,useState as y}from"react";import{Text as d,Container as z,Link as m}from"../../components/index.js";import A from"../Subscribe/index.js";import{FooterNavigationBlockType as v}from"./types.js";import{AddIcon as B,SubtractIcon as C,ArrowRightIcon as E,CountryIcon as T}from"./icons/index.js";import{useMediaQuery as M}from"react-responsive";import{cn as x,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as k}from"../AiuiProvider/index.js";import{withLayout as P}from"../../shared/Styles.js";const $=({data:{footer:a}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:s,moduleIds:l,...g})=>{const[c,r]=y(!1),b=M({query:"(max-width: 1439px)"});w(()=>{r(b)},[b]);const h=S(()=>a?.blocks?.find(t=>t?.blockType===v.Brand)?.country||{},[a]);return e("footer",{...g,className:x(i?.root,s),children:o(z,{className:x(i?.child),childClassName:x("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===v.Signup)return e(O,{subscribeLoading:f,data:t,onSubmit:n?.signup,id:l?.marketingConversion},t.id);if(t?.blockType===v.Brand)return e(Q,{data:t,isMobile:c,event:n,currentCountry:p,id:l?.footerBrand},t?.id);if(t?.blockType===v.Main)return e(j,{data:{...t,country:h},event:n,isMobile:c,currentCountry:p,id:l?.mainServices},t.id)})]})})},O=({data:a,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=k();return o("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(A,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),o("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[o("div",{className:"flex-1",children:[e(d,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(s=>o("div",{className:"flex-start flex gap-2",children:[e("img",{src:s?.icon?.url,loading:"lazy",alt:s?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},s?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),o("div",{className:"flex-1",children:[e(d,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(s=>e(m,{href:u(s?.link,i,"ref=footer"),asChild:!s?.link,className:"no-underline",children:e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},s?.id))})]})]})]})},j=({data:a,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:s="us"}=k(),[l,g]=y(!1),{services:c,mainNav:r,country:b}=a,h="contact-section";return o("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[o("div",{className:x({"desktop:gap-16 flex":c?.download?.title}),children:[o("div",{className:x("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:x("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>o("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(m,{href:u(t?.link,s,"ref=footer"),asChild:!t?.link,className:"no-underline",children:e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(F,{className:x({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),o("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(N,{title:r?.products?.title,lists:r?.products?.products}),e(N,{title:r?.explore?.title,lists:r?.explore?.explores}),e(N,{title:r?.support?.title,lists:r?.support?.supports}),o("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[o("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),n&&e("button",{onClick:()=>g(!l),"aria-expanded":l,"aria-controls":h,"aria-label":l?"Collapse contact section":"Expand contact section",children:l?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(l&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:r?.contact?.contacts?.map(t=>o(m,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(L,{country:f||b,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}),e("div",{className:"desktop:hidden mt-8",children:e(F,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(m,{href:u(t?.link,s,"ref=footer"),className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(m,{href:u(t?.link,s,"ref=footer"),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},Q=({data:a,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:s="us"}=k();return o("div",{id:i,className:"flex flex-col gap-4",children:[o("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[e("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:o("div",{className:"flex flex-wrap items-center gap-3",children:[e(m,{variant:"secondary",href:u(a?.brand?.link,s,"ref=footer"),asChild:!a?.brand?.link,children:e(d,{html:a?.brand?.currentBrand,"aria-hidden":"true"})}),!!a?.brand?.brands?.length&&a?.brand?.brands?.map((l,g)=>o(D,{children:[g<=0&&e("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),e(m,{variant:"secondary",href:u(l?.link,s,"ref=footer"),className:"text-base leading-normal no-underline",children:e(d,{html:l?.icon,"aria-hidden":"true"})},l?.id)]},g))]})}),e(L,{country:f||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),o("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),o("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(l=>e(m,{href:u(l?.link,s,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:l?.label},l?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},N=({title:a,lists:p,className:n})=>{const{locale:f="us"}=k(),[i,s]=y(!1),[l,g]=y(!1),c=M({query:"(max-width: 1439px)"});w(()=>{g(c)},[c]);const r=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return o("div",{className:x("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[o("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:r}),l&&e("button",{onClick:()=>s(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(i&&l||!l)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(b=>e(m,{href:u(b?.link,f,"ref=footer"),className:"no-underline",children:e(d,{html:b?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},b?.id))})]})},F=({title:a,apps:p,className:n})=>{const{locale:f="us"}=k();return p?.length?o("div",{className:n,children:[e(d,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>o(m,{href:u(i?.link,f,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},L=({country:a,isMobile:p,className:n,onChangeCountry:f})=>e("div",{className:x("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:o("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[o("div",{className:"group flex items-center gap-2",children:[e(T,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(E,{width:20,height:20,"aria-hidden":"true"})]})});var W=P($);export{W as default};
1
+ import{Fragment as H,jsx as e,jsxs as a}from"react/jsx-runtime";import{Fragment as A,useEffect as C,useMemo as T,useState as N}from"react";import{Text as d,Container as P,Link as u}from"../../components/index.js";import $ from"../Subscribe/index.js";import{FooterNavigationBlockType as w}from"./types.js";import{AddIcon as M,SubtractIcon as F,ArrowRightIcon as O,CountryIcon as j}from"./icons/index.js";import{useMediaQuery as D}from"react-responsive";import{cn as g,getLocalizedPath as h}from"../../helpers/utils.js";import{useAiuiContext as v}from"../AiuiProvider/index.js";import{withLayout as Q}from"../../shared/Styles.js";const L=t=>!!(t?.countryName||t?.country),q=({data:{footer:t}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:s,moduleIds:l,...b})=>{const[c,r]=N(!1),x=D({query:"(max-width: 1439px)"});C(()=>{r(x)},[x]);const y=T(()=>t?.blocks?.find(m=>m?.blockType===w.Brand)?.country,[t]);return e("footer",{...b,className:g(i?.root,s),children:a(P,{className:g(i?.child),childClassName:g("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(m=>{if(m?.blockType===w.Signup)return e(R,{subscribeLoading:f,data:m,onSubmit:n?.signup,id:l?.marketingConversion},m.id);if(m?.blockType===w.Brand)return e(G,{data:m,isMobile:c,event:n,currentCountry:p,id:l?.footerBrand},m?.id);if(m?.blockType===w.Main)return e(_,{data:{...m,country:y},event:n,isMobile:c,currentCountry:p,id:l?.mainServices},m.id)})]})})},R=({data:t,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=v();return a("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e($,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),a("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[a("div",{className:"flex-1",children:[e(d,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(s=>a("div",{className:"flex-start flex gap-2",children:[e("img",{src:s?.icon?.url,loading:"lazy",alt:s?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},s?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),a("div",{className:"flex-1",children:[e(d,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(s=>e(u,{href:h(s?.link,i,"ref=footer"),asChild:!s?.link,className:"no-underline",children:e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},s?.id))})]})]})]})},_=({data:t,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:s="us"}=v(),[l,b]=N(!1),{services:c,mainNav:r,country:x}=t,y="contact-section",m=!!c?.storeBenefits?.title&&!!c?.storeBenefits?.reasons?.length,k=!!c?.download?.title&&!!c?.download?.apps?.length,z=L(f||x);return a("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(m||k)&&a(H,{children:[a("div",{className:g({"desktop:gap-16 flex":k}),children:[m&&a("div",{className:g("w-full",{"desktop:flex-[1260]":k}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:g("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":k}),children:c?.storeBenefits?.reasons?.map(o=>a("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"size-5 shrink-0"}),e(u,{href:h(o?.link,s,"ref=footer"),asChild:!o?.link,className:"no-underline",children:e(d,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},o?.id))})]}),e(S,{className:g({"desktop:flex-[404] hidden desktop:block":k}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"})]}),a("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(B,{title:r?.products?.title,lists:r?.products?.products}),e(B,{title:r?.explore?.title,lists:r?.explore?.explores}),e(B,{title:r?.support?.title,lists:r?.support?.supports}),a("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[a("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:y}),n&&e("button",{onClick:()=>b(!l),"aria-expanded":l,"aria-controls":y,"aria-label":l?"Collapse contact section":"Expand contact section",children:l?e(F,{width:20,height:20}):e(M,{width:20,height:20})})]}),(l&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":y,children:r?.contact?.contacts?.map(o=>a(u,{href:o?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},o?.id))}),z?e(E,{country:f||x,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}):e("div",{className:"desktop:hidden border-b border-[#3D3E3F]","aria-hidden":"true"}),k&&e("div",{className:"desktop:hidden mt-8",children:e(S,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(o=>e(u,{href:h(o?.link,s,"ref=footer"),className:"group",role:"listitem","aria-label":o?.icon?.alt||"Social media",children:e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},o?.id))}),!!r?.payment?.length&&e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(o=>e(u,{href:h(o?.link,s,"ref=footer"),asChild:!o?.link,role:"listitem","aria-label":o?.icon?.alt||"Payment method",children:e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},o?.id))})]})]})]})},G=({data:t,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:s="us"}=v();return a("div",{id:i,className:"flex flex-col gap-4",children:[a("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[e("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:a("div",{className:"flex flex-wrap items-center gap-3",children:[e(u,{variant:"secondary",href:h(t?.brand?.link,s,"ref=footer"),asChild:!t?.brand?.link,children:e(d,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((l,b)=>a(A,{children:[b<=0&&e("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),e(u,{variant:"secondary",href:h(l?.link,s,"ref=footer"),className:"text-base leading-normal no-underline",children:e(d,{html:l?.icon,"aria-hidden":"true"})},l?.id)]},b))]})}),e(E,{country:f||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),a("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(l=>e(u,{href:h(l?.link,s,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:l?.label},l?.id)),t?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},B=({title:t,lists:p,className:n})=>{const{locale:f="us"}=v(),[i,s]=N(!1),[l,b]=N(!1),c=D({query:"(max-width: 1439px)"});if(C(()=>{b(c)},[c]),!t)return null;const r=`nav-section-${t.replace(/\s+/g,"-").toLowerCase()}`;return a("div",{className:g("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[a("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:r}),l&&e("button",{onClick:()=>s(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(F,{width:20,height:20}):e(M,{width:20,height:20})})]}),(i&&l||!l)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(x=>e(u,{href:h(x?.link,f,"ref=footer"),className:"no-underline",children:e(d,{html:x?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},x?.id))})]})},S=({title:t,apps:p,className:n})=>{const{locale:f="us"}=v();return!t||!p?.length?null:a("div",{className:n,children:[e(d,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>a(u,{href:h(i?.link,f,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]})},E=({country:t,isMobile:p,className:n,onChangeCountry:f})=>L(t)?e("div",{className:g("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:a("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[a("div",{className:"group flex items-center gap-2",children:[e(j,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(O,{width:20,height:20,"aria-hidden":"true"})]})}):null;var ee=Q(q);export{ee as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as ne,jsx as t,jsxs as r}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as $,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as k}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as T,Text as S,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import V from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as G}from"../../hooks/useExposure.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";const u="image",h="graphic",P=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),n=s(e.lgDesktop),a=s(e.desktop),i=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${a} 1919`,`${i} 1439`,`${g} 1024`,`${b} 768`].join(", ")},B="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",re=({data:e,configuration:o})=>{const s=$(null),[n,a]=p({visible:!1,x:0,y:0,text:""}),i=o?.descriptionTag||"h3",g=()=>{switch(o.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-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&a({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{a(l=>({...l,visible:!1}))};G(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const x=e?.href?"a":"div",w=e?.href?{href:y(k(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return t("div",{ref:s,className:m(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:r("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?r("a",{"aria-label":e?.title||e?.description,href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),r(x,{...w,className:m("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[r("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[r("div",{className:"flex-1 overflow-hidden",children:[t(S,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&r("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:i,className:`${B} graphic-description`}):t(i,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${B} graphic-description-item`}),typeof window<"u"&&n.visible&&Z(t(S,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(T,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},L=({items:e=[],sharedConfig:o})=>{const s=n=>{const a=e.length>3,i=e.length>2;switch(n){case 1440:return a?4:e.length;case 1024:return a?3:e.length;case 768:return e.length===1?1:a||i?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:re,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},D=Q.forwardRef(({data:e,className:o,...s},n)=>{const a=q({query:"(max-width: 768px)"}),i=$(null),[g,b]=p(!1),[d,x]=p(""),[w,l]=p(""),[A,U]=p(""),[z,I]=p(null),[H,C]=p(!1),{locale:R="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[_,Y]=p(f?.[0]?.id??"");X(n,()=>i.current),G(i,{componentType:u,componentName:h,componentTitle:e?.title});const M={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:R,onVideoPlayBtnClick:(c,v)=>{b(!0),v?.isYouTube?l?.(v?.youtubeId||""):(x?.(v?.video?.url||""),U?.(v?.mobileVideo?.url||""))},onIconClick:c=>{C(!0),I(c)}},N=()=>r(ne,{children:[t(se,{visible:g,youTubeId:w,onCloseModal:()=>b(!1),videoUrl:a&&A||d}),t(le,{textVisible:H,extension:z?.extension,onCloseModal:()=>{C(!1),I(null)}})]});return!E||!f||f.length===0?r("div",{...s,ref:i,className:m("graphicBlock",o),children:[r("div",{className:"graphic-box",children:[e?.title&&t(V,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(L,{items:e?.items,sharedConfig:M})]}),N()]}):r("div",{...s,ref:i,className:m("graphicBlock",o),children:[e?.title&&t(V,{data:{title:e.title,align:e?.titleAlign??"left"}}),r(W,{value:_,onValueChange:Y,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(c=>t(te,{value:c.id,children:c.label},c.id))})}),f.map(c=>t(oe,{value:c.id,children:t(L,{items:c.items,sharedConfig:M})},c.id))]}),N()]})});D.displayName="Graphic";var Te=F(D);export{Te as default};
1
+ "use client";import{Fragment as ne,jsx as t,jsxs as r}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as S,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as k}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as T,Text as V,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import G from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as P}from"../../hooks/useExposure.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";const u="image",h="graphic",B=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),n=s(e.lgDesktop),a=s(e.desktop),i=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${a} 1919`,`${i} 1439`,`${g} 1024`,`${b} 768`].join(", ")},L="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",re=({data:e,configuration:o})=>{const s=S(null),[n,a]=p({visible:!1,x:0,y:0,text:""}),i=o?.descriptionTag||"h3",g=()=>{switch(o.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-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&a({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{a(l=>({...l,visible:!1}))};P(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:y(k(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return t("div",{ref:s,className:m(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:r("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?r("a",{"aria-label":e?.title||e?.description,href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),r(v,{...x,className:m("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[r("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[r("div",{className:"flex-1 overflow-hidden",children:[t(V,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&r("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:i,className:`${L} graphic-description`}):t(i,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${L} graphic-description-item`}),typeof window<"u"&&n.visible&&Z(t(V,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(T,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},D=({items:e=[],sharedConfig:o})=>{const s=n=>{const a=e.length>3,i=e.length>2;switch(n){case 1440:return a?4:e.length;case 1024:return a?3:e.length;case 768:return e.length===1?1:a||i?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:re,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},A=Q.forwardRef(({data:e,className:o,...s},n)=>{const a=q({query:"(max-width: 768px)"}),i=S(null),[g,b]=p(!1),[d,v]=p(""),[x,l]=p(""),[U,I]=p(""),[z,C]=p(null),[H,M]=p(!1),{locale:R="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[_,Y]=p(f?.[0]?.id??"");X(n,()=>i.current),P(i,{componentType:u,componentName:h,componentTitle:e?.title});const N={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:R,onVideoPlayBtnClick:(c,w)=>{b(!0),w?.isYouTube?(l(w?.youtubeId||""),v(""),I("")):(l(""),v(w?.video?.url||""),I(w?.mobileVideo?.url||""))},onIconClick:c=>{M(!0),C(c)}},$=()=>r(ne,{children:[t(se,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":a&&U||d}),t(le,{textVisible:H,extension:z?.extension,onCloseModal:()=>{M(!1),C(null)}})]});return!E||!f||f.length===0?r("div",{...s,ref:i,className:m("graphicBlock",o),children:[r("div",{className:"graphic-box",children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(D,{items:e?.items,sharedConfig:N})]}),$()]}):r("div",{...s,ref:i,className:m("graphicBlock",o),children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),r(W,{value:_,onValueChange:Y,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(c=>t(te,{value:c.id,children:c.label},c.id))})}),f.map(c=>t(oe,{value:c.id,children:t(D,{items:c.items,sharedConfig:N})},c.id))]}),$()]})});A.displayName="Graphic";var Te=F(A);export{Te as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Grid as c,GridItem as p}from"../../../../components/index.js";const e=({BoxLeftGallery:o,BoxRightDetail:d,BoxBottomSummary:l})=>a("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[a(c,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[t(p,{className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:o}),t(p,{className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:d})]}),l]});var m=e;export{m as default};
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useRef as o}from"react";import{Grid as m,GridItem as a}from"../../../../components/index.js";import{useStickyFlip as r}from"../../hooks/useStickyFlip.js";const s=({BoxLeftGallery:d,BoxRightDetail:i,BoxBottomSummary:c})=>{const t=o(null),p=o(null);return r(t,p),l("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[l(m,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[e(a,{ref:t,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:d}),e(a,{ref:p,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:i})]}),c]})};var n=s;export{n as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Text as n,Container as L}from"../../../../../components/index.js";import{useAiuiContext as E}from"../../../../AiuiProvider/index.js";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useMemo as v}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as N}from"../../../utils/textFormat.js";import{useBenefits as _}from"../../../hooks/useBenefits.js";import j from"../../CartActionButtons/index.js";const q=({totalSavingsSlot:h,renderComparePrice:p}={})=>{const{copyWriting:e,locale:a="us",trackingData:w,currencyCode:r}=E(),{variant:t,finalPrice:S,totalSavings:l,isLogin:m,comparePrice:x,onAddToCart:P,onBuyNow:T,savingDetail:s,addToCartLoading:k,buyNowLoading:A,notifyMeMode:M,onNotifyMeClick:D,discount:z,memberFunctionResult:b}=O(),B=_({variant:t}),{commonCoupon:i,memberDiscount:c}=B,F=w?.showComparePrice??!0,R=v(()=>N(e?.totalSavings||"",{amount:d({amount:l,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),[e?.totalSavings,l,t.price.currencyCode,a]),f=v(()=>{if(!e?.unlockedSaving)return;const g=i?.enable?Number(i?.config?.fixed_value||0):0,C=c?.enable?c.config?.amount??0:0,y=Math.round((b?.withoutCouponMaxMemberTotalSave?Math.max(C,g):C+g)*100)/100;if(!(y<=0))return N(e.unlockedSaving,{amount:d({amount:y,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,c?.enable,c?.config?.amount,b,t.price.currencyCode,a]);return u(L,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?u("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"flex items-center gap-1",children:[o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(S.toFixed(2)),currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),p?p({comparePrice:x}):F&&(l>0||s?.member>0&&m)&&o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:x,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),s?.member>0&&m&&o(n,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),h||(l>0||s?.member>0&&m?o(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]",html:`${R}`}):f?o(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]",html:f}):null)]}):o(n,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(j,{mode:M,availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:k,buyNowLoading:A,onAddToCart:P,onBuyNow:T,onNotifyMeClick:D,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Q=q;export{Q as default};
1
+ import{jsx as o,jsxs as m}from"react/jsx-runtime";import{Text as r,Container as L}from"../../../../../components/index.js";import{useAiuiContext as E}from"../../../../AiuiProvider/index.js";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useMemo as v}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as h}from"../../../utils/textFormat.js";import{useBenefits as _}from"../../../hooks/useBenefits.js";import j from"../../CartActionButtons/index.js";const q=({totalSavingsSlot:N,renderComparePrice:u}={})=>{const{copyWriting:e,locale:a="us",trackingData:w,currencyCode:n}=E(),{variant:t,finalPrice:S,totalSavings:l,isLogin:s,comparePrice:x,onAddToCart:P,onBuyNow:k,savingDetail:p,addToCartLoading:T,buyNowLoading:A,notifyMeMode:M,onNotifyMeClick:D,discount:z,memberFunctionResult:b}=O(),B=_({variant:t}),{commonCoupon:c,memberDiscount:i}=B,F=w?.showComparePrice??!0,R=v(()=>h(e?.totalSavings||"",{amount:d({amount:l,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),[e?.totalSavings,l,t.price.currencyCode,a]),f=v(()=>{if(!e?.unlockedSaving)return;const g=c?.enable?Number(c?.config?.fixed_value||0):0,C=i?.enable?i.config?.amount??0:0,y=Math.round((b?.withoutCouponMaxMemberTotalSave?Math.max(C,g):C+g)*100)/100;if(!(y<=0))return h(e.unlockedSaving,{amount:d({amount:y,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,c?.enable,c?.config?.fixed_value,i?.enable,i?.config?.amount,b,t.price.currencyCode,a]);return m(L,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?m("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[m("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[o(r,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(S.toFixed(2)),currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),u?u({comparePrice:x}):F&&(l>0||p?.member>0&&s)&&o(r,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:x,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),p?.member>0&&s&&o(r,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),N||(l>0||p?.member>0&&s?o(r,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${R}`}):f?o(r,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:f}):null)]}):o(r,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(j,{mode:M,availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:T,buyNowLoading:A,onAddToCart:P,onBuyNow:k,onNotifyMeClick:D,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Q=q;export{Q as default};
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const FLIP_DURATION = 250;
3
+ export declare const FLIP_EASING = "cubic-bezier(0.2, 0, 0, 1)";
4
+ export declare const FLIP_DESKTOP_QUERY = "(min-width: 1280px)";
5
+ export declare function parseTranslateY(transform: string | null | undefined): number;
6
+ /** 旧视觉位置与新布局位置的差值,小于 MIN_DELTA 视为没有位移 */
7
+ export declare function computeFlipDelta(prevVisualTop: number, nextLayoutTop: number): number;
8
+ /**
9
+ * sticky 元素被容器底部顶住时,观察元素高度变化会让它瞬间跳位。
10
+ * 这里在布局变化后、绘制前,用 FLIP 把这次跳动变成平滑过渡,不改变滚动位置。
11
+ *
12
+ * - 仅在 `query` 命中且未开启 prefers-reduced-motion 时生效
13
+ * - resize 期间不播放动画,避免拖动窗口时拖尾
14
+ * - 动画中再次触发会从当前视觉位置重新起动画
15
+ */
16
+ export declare function useStickyFlip(targetRef: RefObject<HTMLElement | null>, observedRef: RefObject<HTMLElement | null>, options?: {
17
+ query?: string;
18
+ duration?: number;
19
+ easing?: string;
20
+ }): void;
@@ -0,0 +1 @@
1
+ import{useEffect as z}from"react";const _=250,I="cubic-bezier(0.2, 0, 0, 1)",S="(min-width: 1280px)",F="(prefers-reduced-motion: reduce)",D=.5,A=150;function C(e){if(!e||e==="none")return 0;const t=e.match(/^matrix3d\((.+)\)$/);if(t)return parseFloat(t[1].split(",")[13])||0;const n=e.match(/^matrix\((.+)\)$/);return n&&parseFloat(n[1].split(",")[5])||0}function Y(e,t){const n=e-t;return Math.abs(n)<D?0:n}function N(e,t,n={}){const{query:m=S,duration:p=_,easing:f=I}=n;z(()=>{const r=e.current,T=t.current;if(!r||!T||typeof ResizeObserver>"u")return;const L=window.matchMedia(m),h=window.matchMedia(F),M=()=>L.matches&&!h.matches&&typeof r.animate=="function";let o=null,a=!1,l,E=!1;const b=()=>o?C(getComputedStyle(r).transform):0;let u=r.getBoundingClientRect().top;const i=()=>{u=r.getBoundingClientRect().top-b()},s=()=>{const d=o;o=null,d?.cancel()},O=()=>{if(!E){E=!0,i();return}if(a||!M()){s(),i();return}const d=u+b();s();const R=r.getBoundingClientRect().top;u=R;const v=Y(d,R);if(!v)return;const c=r.animate([{transform:`translateY(${v}px)`},{transform:"translateY(0)"}],{duration:p,easing:f}),y=()=>{o===c&&(o=null)};c.onfinish=y,c.oncancel=y,o=c},w=()=>i(),g=()=>{a=!0,s(),i(),clearTimeout(l),l=setTimeout(()=>{a=!1,i()},A)},x=new ResizeObserver(O);return x.observe(T),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",g),()=>{x.disconnect(),window.removeEventListener("scroll",w),window.removeEventListener("resize",g),clearTimeout(l),s()}},[e,t,m,p,f])}export{S as FLIP_DESKTOP_QUERY,_ as FLIP_DURATION,I as FLIP_EASING,Y as computeFlipDelta,C as parseTranslateY,N as useStickyFlip};
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import*as B from"react";import{Picture as H,Text as v}from"../../components/index.js";import{cn as e}from"../../helpers/index.js";const j=({totalSteps:a=4,currentStep:k=0,image:m,label:o,progressColor:z="var(--brand-color-0)",labelColor:T="var(--marketing-color-1)",trackColor:E="#DADCE0",backgroundColor:A="#EAEAEC",size:u=64,laptopSize:x=96,gap:$=3,centerText:M,dimmed:R=!1,dimmedBadge:y,className:G,classNames:r})=>{const d=Math.max(u,x),C=6,s=(d-C)/2,i=d/2,I=B.useMemo(()=>{const P=($+C)/s*(180/Math.PI),O=(360-P*a)/a,h=n=>n*Math.PI/180,W=(n,l)=>{const c=n-90,b=l-90,X=i+s*Math.cos(h(c)),Y=i+s*Math.sin(h(c)),F=i+s*Math.cos(h(b)),L=i+s*Math.sin(h(b)),q=l-n>180?1:0;return`M ${X} ${Y} A ${s} ${s} 0 ${q} 1 ${F} ${L}`},N=[];let w=a===2?-45:0;for(let n=0;n<a;n++){const l=w+P/2,c=l+O,b=n<k;N.push({path:W(l,c),isCompleted:b,index:n}),w=c+P/2}return N},[a,k,$,s,i]),[S,...D]=(M||"").split(`
2
- `),g=D.join(" ");return p("div",{className:e("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",G,r?.root),style:{"--circle-size":`${u}px`,"--circle-laptop-size":`${x}px`,"--circle-height":`${o?u+8:u}px`,"--circle-laptop-height":`${o?x+8:x}px`},children:[p("div",{className:e("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",r?.ring),children:[p("svg",{viewBox:`0 0 ${d} ${d}`,className:e("absolute inset-0 size-full",o?"translate-y-[-8px]":""),children:[t("circle",{cx:i,cy:i,r:s,fill:A,stroke:"none"}),I.map(f=>t("path",{d:f.path,fill:"none",stroke:f.isCompleted?z:E,strokeWidth:C,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},f.index))]}),t("div",{className:e("absolute inset-[10px] flex items-center justify-center",o?"translate-y-[-8px]":"",r?.inner),children:p("div",{className:e("flex size-full items-center justify-center overflow-hidden rounded-full",y&&"relative"),style:{backgroundColor:A},children:[m?.url&&t(H,{className:e("size-full",R&&"opacity-40 grayscale",r?.image),imgClassName:"h-full object-contain",source:m.url,alt:m.alt||""}),!m?.url&&M&&p("div",{className:e("text-info-primary flex flex-col items-center justify-center text-center",g?"gap-0.5":"",r?.centerText),children:[t(v,{className:e("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",g&&"font-bold",r?.centerTextMain),html:S}),g&&t(v,{className:e("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",r?.centerTextSub),html:g})]}),y&&t("span",{className:e("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",r?.badge),children:t(v,{size:1,className:"text-center text-white",html:y})})]})})]}),o&&t("div",{className:e("absolute bottom-0 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",r?.label),style:{backgroundColor:T},children:t(v,{className:"text-xs font-medium text-white",html:o})})]})};j.displayName="CircleProgress";var Z=j;export{Z as default};
1
+ "use client";import{jsx as r,jsxs as d}from"react/jsx-runtime";import*as C from"react";import U from"fitty";import{Picture as V,Text as M}from"../../components/index.js";import{cn as e}from"../../helpers/index.js";const I=({totalSteps:p=4,currentStep:A=0,image:g,label:l,progressColor:F="var(--brand-color-0)",labelColor:G="var(--marketing-color-1)",trackColor:H="#DADCE0",backgroundColor:E="#EAEAEC",size:x=64,laptopSize:h=96,gap:$=3,centerText:N,dimmed:D=!1,dimmedBadge:w,className:O,classNames:n})=>{const b=Math.max(x,h),z=6,s=(b-z)/2,a=b/2,W=C.useMemo(()=>{const c=($+z)/s*(180/Math.PI),t=(360-c*p)/p,y=i=>i*Math.PI/180,Y=(i,u)=>{const f=i-90,v=u-90,q=a+s*Math.cos(y(f)),B=a+s*Math.sin(y(f)),J=a+s*Math.cos(y(v)),K=a+s*Math.sin(y(v)),Q=u-i>180?1:0;return`M ${q} ${B} A ${s} ${s} 0 ${Q} 1 ${J} ${K}`},R=[];let L=p===2?-45:0;for(let i=0;i<p;i++){const u=L+c/2,f=u+t,v=i<A;R.push({path:Y(u,f),isCompleted:v,index:i}),L=f+c/2}return R},[p,A,$,s,a]),[S,...X]=(N||"").split(`
2
+ `),m=X.join(" "),T=C.useRef(null),j=C.useRef(null);return C.useEffect(()=>{const o=[T.current,j.current].filter(t=>!!t);if(!o.length)return;let c=[];const P=()=>{c=o.map(t=>U(t,{minSize:6,maxSize:parseFloat(getComputedStyle(t).fontSize),multiLine:!1}))},k=()=>{c.forEach(t=>t.unsubscribe()),P()};return P(),window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k),c.forEach(t=>t.unsubscribe())}},[S,m]),d("div",{className:e("relative inline-flex shrink-0 flex-col items-center","laptop:w-[--circle-laptop-size] w-[--circle-size]","laptop:h-[--circle-laptop-height] h-[--circle-height]",O,n?.root),style:{"--circle-size":`${x}px`,"--circle-laptop-size":`${h}px`,"--circle-height":`${l?x+8:x}px`,"--circle-laptop-height":`${l?h+8:h}px`},children:[d("div",{className:e("laptop:size-[--circle-laptop-size] relative size-[--circle-size]",n?.ring),children:[d("svg",{viewBox:`0 0 ${b} ${b}`,className:e("absolute inset-0 size-full",l?"translate-y-[-8px]":""),children:[r("circle",{cx:a,cy:a,r:s,fill:E,stroke:"none"}),W.map(o=>r("path",{d:o.path,className:e("mini-cart-progress-segment",o.isCompleted&&"mini-cart-progress-segment-completed"),fill:"none",stroke:o.isCompleted?F:H,strokeWidth:z,strokeLinecap:"round",style:{transition:"stroke 0.3s ease-in-out"}},o.index))]}),r("div",{className:e("absolute inset-[10px] flex items-center justify-center",l?"translate-y-[-8px]":"",n?.inner),children:d("div",{className:e("flex size-full items-center justify-center overflow-hidden rounded-full",w&&"relative"),style:{backgroundColor:E},children:[g?.url&&r(V,{className:e("size-full",D&&"opacity-40 grayscale",n?.image),imgClassName:"h-full object-contain",source:g.url,alt:g.alt||""}),!g?.url&&N&&d("div",{className:e("text-info-primary flex w-4/5 flex-col items-center justify-center text-center",m?"gap-0.5":"",n?.centerText),children:[r(M,{ref:T,className:e("desktop:text-[18px] whitespace-nowrap text-[12px] font-semibold leading-none",m&&"font-bold",n?.centerTextMain),html:S}),m&&r(M,{ref:j,className:e("desktop:text-[14px] whitespace-nowrap text-[10px] font-semibold uppercase leading-none",n?.centerTextSub),html:m})]}),w&&r("span",{className:e("absolute inset-x-0 bottom-0 flex items-center justify-center bg-[rgba(118,120,128,0.9)] px-1 py-px",n?.badge),children:r(M,{size:1,className:"text-center text-white",html:w})})]})})]}),l&&r("div",{className:e("mini-cart-progress-label absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full px-2 py-0.5",n?.label),style:{backgroundColor:G},children:r(M,{className:"mini-cart-progress-label-text text-xs font-medium text-white",html:l})})]})};I.displayName="CircleProgress";var re=I;export{re as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{cn as i}from"../../helpers/index.js";import{Heading as D,Text as d,Dialog as I,DialogContent as N,DialogHeader as z,DialogTitle as P}from"../../components/index.js";import{resolveCartLineLabelStyle as L}from"./index.js";const M=({className:l})=>t("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),k=({className:l})=>t("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),q=({item:l,classNames:a,labelStyles:x,onIncrease:u,onDecrease:n})=>{const{merchandise:y,quantity:p,cost:C,readonly:g,productLabel:f,labelVariant:h}=l,{image:c,title:b}=y,{totalAmount:m,subtotalAmount:s}=C,v=b||y.sku||"Product",e=m?.formattedPrice||"",o=s&&m&&parseFloat(s.amount)>parseFloat(m.amount);return r("div",{className:i("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",a?.item),children:[r("div",{className:i("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",a?.itemImage),children:[c?.url&&t("img",{src:c.url,alt:c.altText||v,className:"size-full object-cover"}),f&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center px-1 py-px backdrop-blur-sm",style:L(h,x),children:t(d,{size:1,className:"text-center text-white",html:f})})]}),r("div",{className:i("laptop:gap-4 flex flex-1 flex-col gap-2",a?.itemInfo),children:[t(d,{as:"p",size:3,className:i("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",a?.itemTitle),children:v}),r("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[r("div",{className:i("flex items-center gap-1",a?.itemPrice),children:[e&&t(d,{size:4,className:i("text-info-primary laptop:text-[18px] text-[16px]",a?.itemCurrentPrice),children:e}),o&&s?.formattedPrice&&t(d,{size:4,className:i("text-info-tertiary laptop:text-[18px] text-[16px] line-through",a?.itemOriginalPrice),children:s.formattedPrice})]}),g?t("div",{className:i("flex items-center",a?.quantityControl),children:r("span",{className:"text-info-primary text-sm font-semibold",children:["x",p]})}):r("div",{className:i("flex items-center",a?.quantityControl),children:[t("button",{type:"button",onClick:n,disabled:p<=0,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",a?.quantityButton),"aria-label":"Decrease quantity",children:t(M,{className:"laptop:size-3 size-[10.67px]"})}),t("div",{className:i("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",a?.quantityValue),children:p}),t("button",{type:"button",onClick:u,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",a?.quantityButton),"aria-label":"Increase quantity",children:t(k,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},w=({open:l,onOpenChange:a,cart:x,copy:u,classNames:n={},labelStyles:y,onIncreaseQuantity:p,onDecreaseQuantity:C,onQuantityChange:g})=>{const f=u?.title||"Selected ({count})",h=u?.emptyText||"Your cart is empty",c=x?.lineItems?.reduce((e,o)=>e+(o?.quantity||0),0)||0,b=x?.lineItems||[],m=b.length===0,s=(e,o)=>{p?.(e,o),g?.(e,o+1)},v=(e,o)=>{o>0&&(C?.(e,o),g?.(e,o-1))};return t(I,{open:l,onOpenChange:a,children:r(N,{className:i("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",n?.root),children:[t(z,{className:i("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",n?.header),children:t(P,{asChild:!0,children:t(D,{as:"h3",size:2,className:i("text-info-primary font-bold",n?.title),children:f.replace("{count}",c.toString())})})}),t("div",{className:i("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",n?.content),children:m?t("div",{className:"flex items-center justify-center py-8",children:t(d,{size:2,className:"text-info-tertiary",children:h})}):t("div",{className:i("flex flex-col gap-2",n?.itemList),children:b.map(e=>t(q,{item:e,classNames:n,labelStyles:y,onIncrease:()=>s(e.id,e.quantity),onDecrease:()=>v(e.id,e.quantity)},e.id))})}),t("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};w.displayName="MiniCartDialog";var H=w;export{w as MiniCartDialog,H as default};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useEffect as N,useRef as z}from"react";import L from"fitty";import{cn as i}from"../../helpers/index.js";import{Heading as P,Text as u,Dialog as M,DialogContent as T,DialogHeader as k,DialogTitle as q}from"../../components/index.js";import{resolveCartLineLabelStyle as S}from"./index.js";const j=({className:l})=>e("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),H=({className:l})=>e("svg",{className:l,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M6 2V10M2 6H10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),B=({item:l,classNames:a,labelStyles:f,onIncrease:y,onDecrease:o})=>{const{merchandise:g,quantity:c,cost:C,readonly:b,productLabel:p,labelVariant:h}=l,{image:m,title:v}=g,{totalAmount:d,subtotalAmount:s}=C,x=z(null);N(()=>{if(!x.current)return;const I=L(x.current,{minSize:8,maxSize:12,multiLine:!1});return()=>I.unsubscribe()},[p]);const t=v||g.sku||"Product",n=d?.formattedPrice||"",D=s&&d&&parseFloat(s.amount)>parseFloat(d.amount);return r("div",{className:i("bg-container-primary rounded-box flex items-center gap-2 px-2 py-4","laptop:bg-container-primary laptop:gap-4 laptop:p-4",a?.item),children:[r("div",{className:i("rounded-box relative size-16 shrink-0 overflow-hidden","laptop:size-20",a?.itemImage),children:[m?.url&&e("img",{src:m.url,alt:m.altText||t,className:"size-full object-cover"}),p&&e("div",{className:"absolute inset-x-0 bottom-0 flex max-h-4 items-center justify-center overflow-hidden py-0 text-center backdrop-blur-sm",style:S(h,f),children:e(u,{ref:x,size:1,className:"leading-[16px] text-white",html:p})})]}),r("div",{className:i("laptop:gap-4 flex flex-1 flex-col gap-2",a?.itemInfo),children:[e(u,{as:"p",size:3,className:i("text-info-primary laptop:text-[16px] line-clamp-2 text-[14px]",a?.itemTitle),children:t}),r("div",{className:"laptop:flex-row laptop:items-center laptop:justify-between flex flex-col items-start gap-1",children:[r("div",{className:i("flex items-center gap-1",a?.itemPrice),children:[n&&e(u,{size:4,className:i("text-info-primary laptop:text-[18px] text-[16px]",a?.itemCurrentPrice),children:n}),D&&s?.formattedPrice&&e(u,{size:4,className:i("text-info-tertiary laptop:text-[18px] text-[16px] line-through",a?.itemOriginalPrice),children:s.formattedPrice})]}),b?e("div",{className:i("flex items-center",a?.quantityControl),children:r("span",{className:"text-info-primary text-sm font-semibold",children:["x",c]})}):r("div",{className:i("flex items-center",a?.quantityControl),children:[e("button",{type:"button",onClick:o,disabled:c<=0,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors","disabled:cursor-not-allowed disabled:opacity-50",a?.quantityButton),"aria-label":"Decrease quantity",children:e(j,{className:"laptop:size-3 size-[10.67px]"})}),e("div",{className:i("border-lines text-info-primary flex size-8 items-center justify-center border-y text-center text-sm font-semibold","laptop:size-10 laptop:text-base",a?.quantityValue),children:c}),e("button",{type:"button",onClick:y,className:i("border-lines flex size-8 items-center justify-center border","laptop:size-10","text-info-primary hover:bg-container-secondary-0 transition-colors",a?.quantityButton),"aria-label":"Increase quantity",children:e(H,{className:"laptop:size-3 size-[10.67px]"})})]})]})]})]})},w=({open:l,onOpenChange:a,cart:f,copy:y,classNames:o={},labelStyles:g,onIncreaseQuantity:c,onDecreaseQuantity:C,onQuantityChange:b})=>{const p=y?.title||"Selected ({count})",h=y?.emptyText||"Your cart is empty",m=f?.lineItems?.reduce((t,n)=>t+(n?.quantity||0),0)||0,v=f?.lineItems||[],d=v.length===0,s=(t,n)=>{c?.(t,n),b?.(t,n+1)},x=(t,n)=>{n>0&&(C?.(t,n),b?.(t,n-1))};return e(M,{open:l,onOpenChange:a,children:r(T,{className:i("bg-container-secondary-0 fixed left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-hidden p-0","rounded-box max-h-[80vh] w-[calc(100%-64px)] min-w-[326px]","laptop:w-full laptop:max-w-[560px] laptop:rounded-box",o?.root),children:[e(k,{className:i("bg-container-secondary-0 flex flex-row items-start justify-between gap-4 px-4 pb-2 pt-4",o?.header),children:e(q,{asChild:!0,children:e(P,{as:"h3",size:2,className:i("text-info-primary font-bold",o?.title),children:p.replace("{count}",m.toString())})})}),e("div",{className:i("bg-container-secondary-0 h- flex flex-col gap-2 overflow-y-auto px-4 py-2",o?.content),children:d?e("div",{className:"flex items-center justify-center py-8",children:e(u,{size:2,className:"text-info-tertiary",children:h})}):e("div",{className:i("flex flex-col gap-2",o?.itemList),children:v.map(t=>e(B,{item:t,classNames:o,labelStyles:g,onIncrease:()=>s(t.id,t.quantity),onDecrease:()=>x(t.id,t.quantity)},t.id))})}),e("div",{className:"bg-container-secondary-0 h-8 w-full"})]})})};w.displayName="MiniCartDialog";var F=w;export{w as MiniCartDialog,F as default};
@@ -20,15 +20,18 @@ export interface CircleProgressConfig {
20
20
  labelColor?: string;
21
21
  /** 背景颜色,默认为容器背景色 */
22
22
  backgroundColor?: string;
23
- /** 移动端组件尺寸,默认 48 */
23
+ /** 移动端组件尺寸,默认 64 */
24
24
  size?: number;
25
- /** laptop 以上组件尺寸,默认 80 */
25
+ /** laptop 以上组件尺寸,默认 96 */
26
26
  laptopSize?: number;
27
27
  /** 圆环中间显示的文字(如满减档位优惠),传入 image 时不渲染;字号随断点 12 / 16 / 18px */
28
28
  centerText?: string;
29
29
  /** 中间图片置灰(未达当前档时赠品图变灰),默认 false */
30
30
  dimmed?: boolean;
31
- /** 中间图片上的售罄角标文案(如 "Sold Out") */
31
+ /**
32
+ * 盖在中间图片上的角标,按 HTML 渲染(Text html),传文字、<img> 或 <svg> 均可;有值才渲染,默认不渲染。
33
+ * 默认样式是贴底部的灰色文字条;要改成铺满圆形的印章(如赠品售罄),通过 classNames.badge 覆盖位置与尺寸。
34
+ */
32
35
  dimmedBadge?: string;
33
36
  /** 未完成阶段的颜色 */
34
37
  trackColor?: string;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as i from"react";import{cn as o}from"../../helpers/index.js";import{Button as wt}from"../../components/index.js";import{Text as h}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import kt from"./CircleProgress.js";import{useExposure as Lt}from"../../hooks/useExposure.js";const Mt="cart",St="mini_cart",Nt=(b,r)=>b==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:b==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=i.forwardRef(({className:b,classNames:r={},data:U,cart:s,progressConfig:n,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const v=i.useRef(null),{copy:c,theme:S="light",locale:Pt="us",showMobileViewMore:Y=!0,maxQuantityDisplay:y,labelStyles:$}=U||{};Lt(v,{componentType:Mt,componentName:St,componentTitle:c?.itemsInCart||"Mini Cart",componentDescription:c?.description}),i.useImperativeHandle(O,()=>v.current);const Z=c?.emptyCart||"Your Cart is Empty",N=c?.description||"",_=c?.itemsInCart||"You have selected {count} items",J=c?.total||"Total {total}",It=c?.totalWithCoupon||"total: {total} ({subtotal})",P=c?.clickToView||"Click to view cart",K=c?.buyNowText||"Buy Now",tt=c?.savingText||"Saving {amount}",d=i.useMemo(()=>s?.lineItems||[],[s?.lineItems]),I=d.reduce((e,a)=>e+(a?.quantity||0),0),et=I===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",T=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,p=i.useRef(null),[C,it]=i.useState(!1),[B,A]=i.useState(!1),[D,E]=i.useState(null),j=async e=>{if(!D){E(e);try{await X?.(e,s)}finally{E(null)}}},[R,w]=i.useState(!1),[lt,st]=i.useState(0),[ct,pt]=i.useState(0),[V,dt]=i.useState(!1),[H,mt]=i.useState(!0),f=i.useCallback(()=>{const e=p.current;if(!e)return;const{scrollLeft:a,scrollWidth:m,clientWidth:x}=e;dt(a>0),mt(a<m-x-1)},[]),ut=i.useCallback(()=>{f()},[f]);i.useEffect(()=>{f()},[d.length,f]);const gt=e=>{p.current&&(w(!0),st(e.pageX-p.current.offsetLeft),pt(p.current.scrollLeft))},bt=e=>{if(!R||!p.current)return;e.preventDefault();const m=(e.pageX-p.current.offsetLeft-lt)*1.5;p.current.scrollLeft=ct-m},ft=()=>{w(!1)},xt=()=>{w(!1)},W=e=>{if(p.current){const a=p.current,m=100;a.scrollBy({left:e==="right"?m:-m,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),ht=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=e=>d.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[d.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:p,onMouseDown:gt,onMouseMove:bt,onMouseUp:ft,onMouseLeave:xt,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[d.filter(a=>a&&a.id).map(a=>{const x=(a.merchandise||{}).image||{},q=x.url,Ct=x.altText||"Product image",L=D===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"relative flex w-full items-center justify-center rounded-b-lg px-1 py-px backdrop-blur-sm",style:Nt(a.labelVariant,$),children:t(h,{size:1,className:"relative text-center text-white",html:a.productLabel})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 laptop:size-4 absolute bottom-0 right-0 z-10 flex size-4 items-center justify-center rounded-full text-white",children:t(h,{className:"text-sm",html:yt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(ht,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&d.length>0,yt=e=>y!==void 0&&e>y?`${y}+`:String(e);return t("div",{ref:v,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",b,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&t(kt,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:o("absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:_.replace("{count}",`<span class="text-brand-0">${I||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!C):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(h,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",C?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:Z})}),N&&t(h,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",C?"block":"hidden"),children:vt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:J.replace("{total}",nt)}),T&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:T})]}),z&&t(u,{size:2,as:"h6",className:o("laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(wt,{disabled:!g,loading:B,onClick:async()=>{if(!B){A(!0);try{await F?.(s)}finally{A(!1)}}},className:o("whitespace-nowrap",r?.actionButton),children:K})]})]})})});G.displayName="MiniCart";var jt=G;export{jt as default,Nt as resolveCartLineLabelStyle};
1
+ "use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as n from"react";import kt from"fitty";import{cn as o}from"../../helpers/index.js";import{Button as Lt}from"../../components/index.js";import{Text as y}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import Mt from"./CircleProgress.js";import{useExposure as St}from"../../hooks/useExposure.js";const Nt="cart",Pt="mini_cart",Tt=(f,r)=>f==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:f==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=n.forwardRef(({className:f,classNames:r={},data:U,cart:s,progressConfig:i,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const b=n.useRef(null),{copy:p,theme:S="light",locale:It="us",showMobileViewMore:Y=!0,maxQuantityDisplay:w,labelStyles:$}=U||{};St(b,{componentType:Nt,componentName:Pt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),n.useImperativeHandle(O,()=>b.current);const K=p?.emptyCart||"Your Cart is Empty",N=p?.description||"",Z=p?.itemsInCart||"You have selected {count} items",_=p?.total||"Total {total}",zt=p?.totalWithCoupon||"total: {total} ({subtotal})",P=p?.clickToView||"Click to view cart",J=p?.buyNowText||"Buy Now",tt=p?.savingText||"Saving {amount}",m=n.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((e,a)=>e+(a?.quantity||0),0),et=T===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",I=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,d=n.useRef(null),[x,it]=n.useState(!1),[A,B]=n.useState(!1),[E,D]=n.useState(null),j=async e=>{if(!E){D(e);try{await X?.(e,s)}finally{D(null)}}},[R,C]=n.useState(!1),[lt,st]=n.useState(0),[ct,pt]=n.useState(0),[H,dt]=n.useState(!1),[V,mt]=n.useState(!0),h=n.useCallback(()=>{const e=d.current;if(!e)return;const{scrollLeft:a,scrollWidth:c,clientWidth:v}=e;dt(a>0),mt(a<c-v-1)},[]),ut=n.useCallback(()=>{h()},[h]);n.useEffect(()=>{h()},[m.length,h]);const gt=m.map(e=>e.productLabel??"").join("|");n.useEffect(()=>{const e=b.current?.querySelectorAll("[data-fit-label]");if(!e?.length)return;const a=Array.from(e,c=>kt(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[gt,x]);const ft=e=>{d.current&&(C(!0),st(e.pageX-d.current.offsetLeft),pt(d.current.scrollLeft))},bt=e=>{if(!R||!d.current)return;e.preventDefault();const c=(e.pageX-d.current.offsetLeft-lt)*1.5;d.current.scrollLeft=ct-c},xt=()=>{C(!1)},ht=()=>{C(!1)},W=e=>{if(d.current){const a=d.current,c=100;a.scrollBy({left:e==="right"?c:-c,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),yt=e=>m.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[m.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:d,onMouseDown:ft,onMouseMove:bt,onMouseUp:xt,onMouseLeave:ht,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[m.filter(a=>a&&a.id).map(a=>{const v=(a.merchandise||{}).image||{},q=v.url,Ct=v.altText||"Product image",L=E===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:Tt(a.labelVariant,$),children:t("div",{className:"w-full text-center",children:t(y,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:t(y,{className:"whitespace-nowrap text-sm leading-none",html:wt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(vt,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&m.length>0,wt=e=>w!==void 0&&e>w?`${w}+`:String(e);return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",f,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",i&&"laptop:pl-[104px] pl-[72px]"),children:[i&&t(Mt,{totalSteps:i.totalSteps,currentStep:i.currentStep,image:i.image,label:i.label,progressColor:i.progressColor,labelColor:i.labelColor,backgroundColor:i.backgroundColor,size:i.size,laptopSize:i.laptopSize,centerText:i.centerText,dimmed:i.dimmed,dimmedBadge:i.dimmedBadge,trackColor:i.trackColor,classNames:i.classNames,className:o("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:Z.replace("{count}",`<span class="mini-cart-count text-brand-0">${T||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!x):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(y,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",x?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:K})}),N&&t(y,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",x?"block":"hidden"),children:yt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:_.replace("{total}",nt)}),I&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:I})]}),z&&t(u,{size:2,as:"h6",className:o("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(Lt,{disabled:!g,loading:A,onClick:async()=>{if(!A){B(!0);try{await F?.(s)}finally{B(!1)}}},className:o("mini-cart-action-button whitespace-nowrap",r?.actionButton),children:J})]})]})})});G.displayName="MiniCart";var Vt=G;export{Vt as default,Tt as resolveCartLineLabelStyle};
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as c,Picture as n}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const r=O(),S=k??r?.showTags??!0,v=C??r?.showOriginalPrice??!0,s=h??r?.classNames??{},l=f??(r?r.selectedIds.has(e.id):!1),m=b??r?.onSelectChange,g=P??r?.onProductImageClick,o=e.soldOut??!1,w=i=>{o||typeof i=="boolean"&&m?.(i,e)},y=()=>{o||m?.(!l,e)};return d("div",{ref:N,className:t("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",o?"cursor-not-allowed opacity-50":"cursor-pointer",l?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",!o&&"hover:bg-container-secondary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((i,z)=>a(j,{variant:i.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:i.label},z))}),a(L,{checked:l,disabled:o,onCheckedChange:w,onClick:i=>i.stopPropagation(),className:t("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2 h-[2.2em]",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(c,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(c,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(c,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
1
+ "use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as c,Picture as n}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const r=O(),S=k??r?.showTags??!0,v=C??r?.showOriginalPrice??!0,s=h??r?.classNames??{},l=f??(r?r.selectedIds.has(e.id):!1),m=b??r?.onSelectChange,g=P??r?.onProductImageClick,o=e.soldOut??!1,w=i=>{o||typeof i=="boolean"&&m?.(i,e)},y=()=>{o||m?.(!l,e)};return d("div",{ref:N,className:t("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",o?"cursor-not-allowed opacity-50":"cursor-pointer",l?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",!o&&"hover:bg-container-secondary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((i,z)=>a(j,{variant:i.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:i.label},z))}),a(L,{checked:l,disabled:o,onCheckedChange:w,onClick:i=>i.stopPropagation(),className:t("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(c,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(c,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(c,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as l from"react";import{Swiper as K,SwiperSlide as Q}from"swiper/react";import{FreeMode as U,Mousewheel as W}from"swiper/modules";import{cn as r}from"../../helpers/index.js";import{Heading as X,Button as T,Text as d}from"../../components/index.js";import{useSceneShelfContext as Y}from"./context.js";import"swiper/css";const N=l.forwardRef(({title:m,totalPriceLabel:S,totalCurrentPrice:L,totalOriginalPrice:v,primaryButtonText:k,primaryButtonFun:C,secondaryButtonText:D,secondaryButtonFun:F,bundleDiscountLabel:M,className:A,children:R,...O},z)=>{const e=Y(),a=e?.classNames,x=S??e?.totalPriceLabel??"Total Price:",s=L??e?.totalCurrentPrice,u=v??e?.totalOriginalPrice,f=k??e?.primaryButtonText??"Shop Now",y=C??e?.primaryButtonFun??"buyNow",P=D??e?.secondaryButtonText??"Add to Cart",w=F??e?.secondaryButtonFun??"addCart",c=M??e?.bundleDiscountLabel,n=e?.selectedProducts??[],V=e?.onLearnMore,H=e?.onShopNow,j=e?.onAddToCart,E=e?.showOriginalPrice??!0,[q,G]=l.useState(!1),[I,J]=l.useState(!1),b=l.Children.toArray(R),g=async(o,p)=>{if(!o)return;const B=p==="primary"?G:J;B(!0);try{switch(o){case"buyNow":await H?.(n);break;case"addCart":await j?.(n);break;case"learnMore":await V?.(n);break;default:break}}finally{B(!1)}},h=o=>o==="learnMore"?!1:n.length===0;return i("div",{ref:z,className:r("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",A,a?.content),...O,children:[m&&t(X,{as:"h2",size:3,className:r("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",a?.title),html:m}),t("div",{className:r("lg-desktop:mb-[24px] mb-[16px] flex-1 ",a?.productList),children:t(K,{modules:[U,W],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:10,breakpoints:{0:{slidesPerView:1.5},768:{spaceBetween:16,slidesPerView:2.8},1024:{slidesPerView:2.3},1440:{spaceBetween:16,slidesPerView:b.length<=3?3:3.2}},children:b.map((o,p)=>t(Q,{className:"h-fit shrink-0",children:o},p))})}),i("div",{className:r("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",a?.footer),children:[i("div",{className:"flex flex-col",children:[i("div",{className:r("flex flex-wrap items-center gap-1",a?.totalPrice),children:[x&&t(d,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:x}),s&&t(d,{as:"span",size:2,className:r("text-info-primary lg-desktop:text-[24px] text-[20px]",a?.currentTotalPrice),children:s.formatted}),E&&u&&s&&u.value>s.value&&t(d,{as:"span",size:2,className:r("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",a?.originalTotalPrice),children:u.formatted})]}),c&&t(d,{as:"span",size:2,className:r("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",a?.bundleDiscountLabel),children:typeof c=="function"?c(n):c})]}),i("div",{className:r("flex items-stretch gap-3",a?.buttonGroup),children:[P&&t(T,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>g(w,"secondary"),disabled:h(w),loading:I,children:P}),f&&t(T,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>g(y,"primary"),disabled:h(y),loading:q,children:f})]})]})]})});N.displayName="SceneShelf.ProductsPanel";export{N as SceneShelfProductsPanel};
1
+ "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import*as n from"react";import{Swiper as K,SwiperSlide as Q}from"swiper/react";import{FreeMode as U,Mousewheel as X}from"swiper/modules";import{cn as r}from"../../helpers/index.js";import{Heading as Y,Button as C,Text as d}from"../../components/index.js";import{buildSsrSlideCss as ee}from"../SwiperBox/buildSsrSlideCss.js";import{useSceneShelfContext as te}from"./context.js";import"swiper/css";const k=n.forwardRef(({title:y,totalPriceLabel:v,totalCurrentPrice:D,totalOriginalPrice:F,primaryButtonText:M,primaryButtonFun:A,secondaryButtonText:R,secondaryButtonFun:z,bundleDiscountLabel:H,className:O,children:V,..._},j)=>{const e=te(),a=e?.classNames,P=v??e?.totalPriceLabel??"Total Price:",l=D??e?.totalCurrentPrice,u=F??e?.totalOriginalPrice,w=M??e?.primaryButtonText??"Shop Now",g=A??e?.primaryButtonFun??"buyNow",b=R??e?.secondaryButtonText??"Add to Cart",h=z??e?.secondaryButtonFun??"addCart",c=H??e?.bundleDiscountLabel,i=e?.selectedProducts??[],E=e?.onLearnMore,I=e?.onShopNow,$=e?.onAddToCart,q=e?.showOriginalPrice??!0,[G,W]=n.useState(!1),[Z,J]=n.useState(!1),B=n.Children.toArray(V),S=B.length,p=n.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:S<=3?3:3.2,spaceBetween:16}}),[S]),m=`swiper-ssr-${n.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,x=n.useMemo(()=>ee(`.${m}`,p),[m,p]),T=async(o,f)=>{if(!o)return;const L=f==="primary"?W:J;L(!0);try{switch(o){case"buyNow":await I?.(i);break;case"addCart":await $?.(i);break;case"learnMore":await E?.(i);break;default:break}}finally{L(!1)}},N=o=>o==="learnMore"?!1:i.length===0;return s("div",{ref:j,className:r("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",O,a?.content),..._,children:[y&&t(Y,{as:"h2",size:3,className:r("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",a?.title),html:y}),s("div",{className:r("lg-desktop:mb-[24px] mb-[16px] flex-1 ",a?.productList),children:[x&&t("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:x}}),t(K,{modules:[U,X],freeMode:!0,mousewheel:{forceToAxis:!0},className:x?m:void 0,breakpoints:p,children:B.map((o,f)=>t(Q,{className:"h-fit shrink-0",children:o},f))})]}),s("div",{className:r("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",a?.footer),children:[s("div",{className:"flex flex-col",children:[s("div",{className:r("flex flex-wrap items-center gap-1",a?.totalPrice),children:[P&&t(d,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:P}),l&&t(d,{as:"span",size:2,className:r("text-info-primary lg-desktop:text-[24px] text-[20px]",a?.currentTotalPrice),children:l.formatted}),q&&u&&l&&u.value>l.value&&t(d,{as:"span",size:2,className:r("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",a?.originalTotalPrice),children:u.formatted})]}),c&&t(d,{as:"span",size:2,className:r("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",a?.bundleDiscountLabel),children:typeof c=="function"?c(i):c})]}),s("div",{className:r("flex items-stretch gap-3",a?.buttonGroup),children:[b&&t(C,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>T(h,"secondary"),disabled:N(h),loading:Z,children:b}),w&&t(C,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>T(g,"primary"),disabled:N(g),loading:G,children:w})]})]})]})});k.displayName="SceneShelf.ProductsPanel";export{k as SceneShelfProductsPanel};
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as T}from"react/jsx-runtime";import at,{useEffect as lt,useRef as g,useImperativeHandle as dt,useState as ct}from"react";import{gsap as k}from"gsap";import{SplitText as R}from"gsap/dist/SplitText";import{ScrollTrigger as A}from"gsap/dist/ScrollTrigger";import{cn as s,getLocalizedPath as ut}from"../../helpers/utils.js";import{cva as V}from"class-variance-authority";import{Heading as mt,Text as N,Countdown as pt}from"../../components/index.js";import{withLayout as ft}from"../../shared/Styles.js";import{useAiuiContext as ht}from"../AiuiProvider/index.js";import{convertLexicalToPlaintext as gt}from"@payloadcms/richtext-lexical/plaintext";import{trackUrlRef as xt}from"../../shared/trackUrlRef.js";import{useInView as wt}from"react-intersection-observer";const S="link",$="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const a=t?.root?.children;return!Array.isArray(a)||a.length===0?!1:a.some(n=>{const r=n?.children;return!Array.isArray(r)||r.length===0?!1:r.some(o=>typeof o?.text=="string"&&o.text.length>0)})}function _(t){if(!t)return"";if(typeof t=="string")return t;try{return gt({data:t})||""}catch{return""}}const yt=V("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),vt=V("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),B=({data:t,onClick:a,className:n})=>{const{theme:r="light",extensions:o,title:p,caption:x,align:f}=t,{locale:w="us"}=ht();if(!o?.textLink)return null;const d=o?.link?xt(ut(o.link,w),`${S}_${$}`):void 0;return T("a",{className:s({"aiui-dark":r==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":r==="light"},{"text-[#F5F6F7]":r==="dark"},{"justify-center mt-4":f==="center"},{"mt-1 laptop:mt-0":f==="left"},n),...d?{href:d}:{},"data-headless-type-name":`${S}#${$}`,"data-headless-title-desc-button":`${_(p)}#${_(x)}`,...a?{onClick:a}:{},children:[i("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),i("div",{className:"lg-desktop:size-5 size-4",children:i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:r==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},I=at.forwardRef(({data:t,className:a,classNames:n,as:r="h2",weight:o="bold",onButtonClick:p,id:x,...f},w)=>{const{title:d,titleSize:j=4,caption:L,subtitle:F,content:H,countdown:e,showCountdown:O=!1,theme:h="light",extensions:C,align:c="left"}=t,D=g(null),u=g(null),l=g(null),m=g(null),[U,W]=ct(!0),{ref:Z,inView:M}=wt();dt(w,()=>D.current);const q=()=>{W(!1)},G=e?.targetDateTime||e?.targetDate||"",J=e?.targetDateTime_tz,K=e?.labels?{day:e.labels.days||"Day",hour:e.labels.hours||"Hours",minute:e.labels.minutes||"Mins",second:e.labels.seconds||"Secs"}:void 0;return lt(()=>{k.registerPlugin(R,A);function Q(){if(!u.current)return;const X=u.current?.clientHeight||80;l.current&&l.current.revert(),m.current&&m.current.kill(),l.current=new R(u.current,{type:"words",wordsClass:"word"});const b=l.current.words;k.set(b,{opacity:0}),m.current=A.create({trigger:u.current,start:"bottom bottom-=4%",end:`bottom+=${X*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:Y=>{const tt=Y.progress,z=b.length||1,et=.5,y=1/z,E=y*(1-et),P=(z-1)*E+y,nt=Math.min(1,P>0?tt/P:0);b.forEach((rt,it)=>{const ot=it*E,st=y;let v=(nt-ot)/st;v=Math.max(0,Math.min(1,v)),k.set(rt,{opacity:v})})}})}return M&&Q(),()=>{l.current&&l.current.revert(),m.current&&m.current.kill()}},[M]),T("div",{id:C?.id?C?.id:x,className:s("titleBottom title-box flex items-end justify-between gap-2 pb-6",a,n?.wrapper),...f,ref:D,children:[T("div",{ref:Z,className:s("flex-1",n?.container,{"aiui-dark":h==="dark","text-center":c==="center","text-left":c==="left"}),children:[(L||d)&&i(mt,{ref:u,as:r,size:j,html:L||d,weight:o,className:s(yt({theme:h}),n?.title)}),F&&i(N,{html:F,as:"div",className:s(vt({theme:h}),n?.subtitle)}),bt(H)&&i(N,{html:H,as:"div",size:4,className:s("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",n?.content)}),i(B,{data:t,className:s({"laptop:hidden":c==="left"},n?.button),onClick:p}),O&&e&&U&&i(pt,{endDate:G,endDate_tz:J,timeLabels:K,showDays:e?.showDays,showHours:e?.showHours,showMinutes:e?.showMinutes,showSeconds:e?.showSeconds,theme:h,onExpire:q,hideWhenExpired:!0,align:c==="center"?"center":"left",className:s("mt-4",n?.countdown)})]}),i(B,{data:t,className:s("hidden",{"laptop:flex":c==="left"},n?.button),onClick:p})]})});I.displayName="Title";var At=ft(I);export{At as default};
1
+ "use client";import{jsx as o,jsxs as T}from"react/jsx-runtime";import st,{useEffect as lt,useRef as h,useImperativeHandle as at,useState as ct}from"react";import{gsap as b}from"gsap";import{SplitText as N}from"gsap/dist/SplitText";import{ScrollTrigger as S}from"gsap/dist/ScrollTrigger";import{cn as i,getLocalizedPath as dt}from"../../helpers/utils.js";import{Heading as ut,Text as $,Countdown as pt}from"../../components/index.js";import{withLayout as mt}from"../../shared/Styles.js";import{useAiuiContext as ft}from"../AiuiProvider/index.js";import{convertLexicalToPlaintext as ht}from"@payloadcms/richtext-lexical/plaintext";import{trackUrlRef as gt}from"../../shared/trackUrlRef.js";import{useInView as xt}from"react-intersection-observer";const A="link",V="title";function wt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const s=t?.root?.children;return!Array.isArray(s)||s.length===0?!1:s.some(n=>{const r=n?.children;return!Array.isArray(r)||r.length===0?!1:r.some(l=>typeof l?.text=="string"&&l.text.length>0)})}function B(t){if(!t)return"";if(typeof t=="string")return t;try{return ht({data:t})||""}catch{return""}}const yt="text-info-primary desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",I=({data:t,onClick:s,className:n})=>{const{extensions:r,title:l,caption:p,align:m}=t,{locale:g="us"}=ft();if(!r?.textLink)return null;const f=r?.link?gt(dt(r.link,g),`${A}_${V}`):void 0;return T("a",{className:i("text-info-primary hover:text-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"justify-center mt-4":m==="center"},{"mt-1 laptop:mt-0":m==="left"},n),...f?{href:f}:{},"data-headless-type-name":`${A}#${V}`,"data-headless-title-desc-button":`${B(l)}#${B(p)}`,...s?{onClick:s}:{},children:[o("div",{className:"truncate whitespace-nowrap",children:r?.textLink}),o("div",{className:"lg-desktop:size-5 size-4",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:o("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:"currentColor",className:"transition-all duration-[0.4s]"})})})]})},_=st.forwardRef(({data:t,className:s,classNames:n,as:r="h2",weight:l="bold",onButtonClick:p,id:m,...g},f)=>{const{title:v,titleSize:j=4,caption:k,subtitle:C,content:L,countdown:e,showCountdown:O=!1,theme:H="light",extensions:D,align:c="left"}=t,M=h(null),d=h(null),a=h(null),u=h(null),[U,W]=ct(!0),{ref:Z,inView:z}=xt();at(f,()=>M.current);const q=()=>{W(!1)},F=e?.targetDateTime||e?.targetDate||"",G=e?.targetDateTime_tz,J=e?.labels?{day:e.labels.days||"Day",hour:e.labels.hours||"Hours",minute:e.labels.minutes||"Mins",second:e.labels.seconds||"Secs"}:void 0;return lt(()=>{b.registerPlugin(N,S);function K(){if(!d.current)return;const Q=d.current?.clientHeight||80;a.current&&a.current.revert(),u.current&&u.current.kill(),a.current=new N(d.current,{type:"words",wordsClass:"word"});const x=a.current.words;b.set(x,{opacity:0}),u.current=S.create({trigger:d.current,start:"bottom bottom-=4%",end:`bottom+=${Q*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:X=>{const Y=X.progress,E=x.length||1,tt=.5,w=1/E,P=w*(1-tt),R=(E-1)*P+w,et=Math.min(1,R>0?Y/R:0);x.forEach((nt,rt)=>{const ot=rt*P,it=w;let y=(et-ot)/it;y=Math.max(0,Math.min(1,y)),b.set(nt,{opacity:y})})}})}return z&&K(),()=>{a.current&&a.current.revert(),u.current&&u.current.kill()}},[z]),T("div",{id:D?.id?D?.id:m,className:i("titleBottom title-box flex items-end justify-between gap-2 pb-6",{"aiui-dark":H==="dark"},s,n?.wrapper),...g,ref:M,children:[T("div",{ref:Z,className:i("flex-1",n?.container,{"text-center":c==="center","text-left":c==="left"}),children:[(k||v)&&o(ut,{ref:d,as:r,size:j,html:k||v,weight:l,className:i("text-info-primary",n?.title)}),C&&o($,{html:C,as:"div",className:i(yt,n?.subtitle)}),wt(L)&&o($,{html:L,as:"div",size:4,className:i("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",n?.content)}),o(I,{data:t,className:i({"laptop:hidden":c==="left"},n?.button),onClick:p}),O&&e&&U&&o(pt,{endDate:F,endDate_tz:G,timeLabels:J,showDays:e?.showDays,showHours:e?.showHours,showMinutes:e?.showMinutes,showSeconds:e?.showSeconds,theme:H,onExpire:q,hideWhenExpired:!0,align:c==="center"?"center":"left",className:i("mt-4",n?.countdown)})]}),o(I,{data:t,className:i("hidden",{"laptop:flex":c==="left"},n?.button),onClick:p})]})});_.displayName="Title";var Pt=mt(_);export{Pt as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.82",
3
+ "version": "1.3.84",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
package/style.css CHANGED
@@ -614,6 +614,9 @@ video {
614
614
  .bottom-0 {
615
615
  bottom: 0px;
616
616
  }
617
+ .bottom-2 {
618
+ bottom: 0.5rem;
619
+ }
617
620
  .bottom-4 {
618
621
  bottom: 1rem;
619
622
  }
@@ -1554,9 +1557,6 @@ video {
1554
1557
  .h-\[1px\] {
1555
1558
  height: 1px;
1556
1559
  }
1557
- .h-\[2\.2em\] {
1558
- height: 2.2em;
1559
- }
1560
1560
  .h-\[200px\] {
1561
1561
  height: 200px;
1562
1562
  }
@@ -1702,6 +1702,9 @@ video {
1702
1702
  .\!max-h-none {
1703
1703
  max-height: none !important;
1704
1704
  }
1705
+ .max-h-4 {
1706
+ max-height: 1rem;
1707
+ }
1705
1708
  .max-h-\[126px\] {
1706
1709
  max-height: 126px;
1707
1710
  }
@@ -1999,6 +2002,9 @@ video {
1999
2002
  .min-w-32 {
2000
2003
  min-width: 8rem;
2001
2004
  }
2005
+ .min-w-4 {
2006
+ min-width: 1rem;
2007
+ }
2002
2008
  .min-w-5 {
2003
2009
  min-width: 1.25rem;
2004
2010
  }
@@ -2226,6 +2232,9 @@ video {
2226
2232
  --tw-scale-y: 70%;
2227
2233
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2228
2234
  }
2235
+ .\!transform {
2236
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
2237
+ }
2229
2238
  .transform {
2230
2239
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2231
2240
  }
@@ -2723,9 +2732,9 @@ video {
2723
2732
  border-bottom-right-radius: var(--box-radius);
2724
2733
  border-bottom-left-radius: var(--box-radius);
2725
2734
  }
2726
- .rounded-b-lg {
2727
- border-bottom-right-radius: 0.5rem;
2728
- border-bottom-left-radius: 0.5rem;
2735
+ .rounded-b-box-small {
2736
+ border-bottom-right-radius: var(--box-radius-small);
2737
+ border-bottom-left-radius: var(--box-radius-small);
2729
2738
  }
2730
2739
  .rounded-b-none {
2731
2740
  border-bottom-right-radius: 0px;
@@ -3965,6 +3974,9 @@ video {
3965
3974
  .leading-\[140\%\] {
3966
3975
  line-height: 140%;
3967
3976
  }
3977
+ .leading-\[16px\] {
3978
+ line-height: 16px;
3979
+ }
3968
3980
  .leading-\[24px\] {
3969
3981
  line-height: 24px;
3970
3982
  }
@@ -6654,6 +6666,9 @@ video {
6654
6666
  .laptop\:w-\[128px\] {
6655
6667
  width: 128px;
6656
6668
  }
6669
+ .laptop\:w-\[156px\] {
6670
+ width: 156px;
6671
+ }
6657
6672
  .laptop\:w-\[160px\] {
6658
6673
  width: 160px;
6659
6674
  }
@@ -6663,9 +6678,6 @@ video {
6663
6678
  .laptop\:w-\[232px\] {
6664
6679
  width: 232px;
6665
6680
  }
6666
- .laptop\:w-\[256px\] {
6667
- width: 256px;
6668
- }
6669
6681
  .laptop\:w-\[27\%\] {
6670
6682
  width: 27%;
6671
6683
  }
@@ -7785,6 +7797,9 @@ video {
7785
7797
  .desktop\:w-\[160px\] {
7786
7798
  width: 160px;
7787
7799
  }
7800
+ .desktop\:w-\[256px\] {
7801
+ width: 256px;
7802
+ }
7788
7803
  .desktop\:w-\[32\%\] {
7789
7804
  width: 32%;
7790
7805
  }
@@ -9170,9 +9185,6 @@ video {
9170
9185
  .\[\&_svg\]\:shrink-0 svg {
9171
9186
  flex-shrink: 0;
9172
9187
  }
9173
- .\[\&_svg_path\]\:hover\:fill-brand-0:hover svg path {
9174
- fill: var(--brand-color-0);
9175
- }
9176
9188
  .swiper-slide-active.\[\.swiper-slide-active\&\]\:opacity-100 {
9177
9189
  opacity: 1;
9178
9190
  }