@anker-in/headless-ui 1.3.72-alpha.1790150413679 → 1.3.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +1 -2
- package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +0 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/types.d.ts +2 -2
- package/dist/cjs/biz-components/Ksp/index.d.ts +0 -2
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +0 -10
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplayHorizontal/shelfDisplayHorizontalItem.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.d.ts +1 -2
- package/dist/cjs/biz-components/Specs/dropdown.js +2 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/components/badge.d.ts +1 -1
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/hooks/useDraggableScroll.js +1 -1
- package/dist/cjs/hooks/useExposure.d.ts +1 -1
- package/dist/cjs/hooks/useExposure.js +1 -1
- package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +1 -2
- package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +0 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/types.d.ts +2 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +0 -2
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +0 -10
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplayHorizontal/shelfDisplayHorizontalItem.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.d.ts +1 -2
- package/dist/esm/biz-components/Specs/dropdown.js +2 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/components/badge.d.ts +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/hooks/useDraggableScroll.js +1 -1
- package/dist/esm/hooks/useExposure.d.ts +1 -1
- package/dist/esm/hooks/useExposure.js +1 -1
- package/dist/esm/hooks/useViewItemList.d.ts +1 -1
- package/dist/tokens/oneAnker.css +0 -22
- package/package.json +1 -1
- package/style.css +9 -33
- package/tailwind.config.js +0 -5
- package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.d.ts +0 -30
- package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.js +0 -1
- package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.d.ts +0 -30
- package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"
|
|
1
|
+
"use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"large",r=v.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),k=v.useMemo(()=>{const n=N=>{switch(N){case"mobile":return{slidesPerView:1.17,spaceBetween:12};case"tablet":return r===2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.4,spaceBetween:12};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16};case"desktop":return r===2?{slidesPerView:2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16}}},u=n("mobile"),S=n("tablet"),b=n("laptop"),A=n("desktop");return{0:u,768:S,1024:b,1440:A}},[r]);return(0,i.jsx)(l.Container,{ref:c,className:(0,d.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"ActivitySchedule",...a,children:(0,i.jsx)(h.Swiper,{breakpoints:k,className:"w-full !overflow-visible",children:t.scheduleList.map((n,u)=>(0,i.jsx)(h.SwiperSlide,{children:(0,i.jsx)(w,{item:n,theme:s,size:o,className:e?.card})},"activityScheduleCardItem"+u))})})});x.displayName="ActivitySchedule";var M=(0,y.withLayout)(x);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,r)=>{for(var
|
|
1
|
+
"use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,r)=>{for(var i in r)d(e,i,{get:r[i],enumerable:!0})},h=(e,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of L(r))!A.call(e,o)&&o!==i&&d(e,o,{get:()=>r[o],enumerable:!(a=P(r,o))||a.enumerable});return e};var k=(e,r,i)=>(i=e!=null?j(z(e)):{},h(r||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),D=e=>h(d({},"__esModule",{value:!0}),e);var F={};H(F,{default:()=>C});module.exports=D(F);var t=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=k(require("../../components/picture.js")),q=require("../../shared/Styles.js"),E=require("react-responsive"),S=require("../../hooks/useExposure.js"),c=require("swiper/react"),p=require("swiper/modules"),M=k(require("../Title/index.js"));const R="copy",Q="store_benefits",$=(e,r)=>{const i=[];for(let a=0;a<e.length;a+=r)i.push(e.slice(a,a+r));return i},N=(0,s.forwardRef)(({data:{items:e=[],itemShape:r,title:i,theme:a},className:o},u)=>{const[x,B]=(0,s.useState)(!1),v=(0,E.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,s.useRef)(null),f=(0,s.useRef)(null);(0,s.useImperativeHandle)(u,()=>f.current),(0,S.useExposure)(f,{componentType:R,componentName:Q}),(0,s.useEffect)(()=>{B(v)},[v]);const T=x?$(e,3):e;return(0,t.jsxs)("div",{ref:f,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":a==="dark"},o),children:[i&&(0,t.jsx)(M.default,{data:{title:i}}),x?(0,t.jsxs)(c.Swiper,{className:(0,l.cn)(o),modules:[p.FreeMode,p.Mousewheel,p.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:b.current},breakpoints:{0:{spaceBetween:12}},children:[T?.map((n,m)=>(0,t.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(n)&&n?.map((I,g)=>(0,t.jsx)(w,{data:I,itemShape:r,index:g,theme:a},g))},"SwiperSlide"+m)),(0,t.jsx)("div",{ref:b,className:"mt-3 flex justify-center"})]}):(0,t.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((n,m)=>(0,t.jsx)(w,{data:n,itemShape:r,index:m,theme:a},m))})]})}),w=({data:e,itemShape:r,index:i,theme:a})=>(0,t.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${i+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(i),"bg-container-primary":a==="dark"},"rounded-box",e.className),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,t.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((o,u)=>(0,t.jsx)("div",{className:(0,l.cn)("border-container-primary size-[30px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,t.jsx)(y.default,{source:o.avatar?.url,alt:o.avatar?.alt,className:"size-full object-cover"})},u))}):(0,t.jsx)("div",{className:"lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,t.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]});N.displayName="BrandEquity";var C=(0,q.withLayout)(N);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var Z=Object.create;var u=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var i in o)u(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of K(o))!U.call(e,c)&&c!==i&&u(e,c,{get:()=>o[c],enumerable:!(m=J(o,c))||m.enumerable});return e};var W=(e,o,i)=>(i=e!=null?Z(Q(e)):{},N(o||!e||!e.__esModule?u(i,"default",{value:e,enumerable:!0}):i,e)),X=e=>N(u({},"__esModule",{value:!0}),e);var ae={};V(ae,{CreditsProductCard:()=>g,default:()=>ee});module.exports=X(ae);var a=require("react/jsx-runtime"),d=W(require("react")),s=require("../../helpers/index.js"),t=require("../../components/index.js"),k=require("./context.js");const Y=()=>(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M8 1L10.163 5.279L15 6.001L11.5 9.409L12.326 14.226L8 11.97L3.674 14.226L4.5 9.409L1 6.001L5.837 5.279L8 1Z",fill:"currentColor"})}),g=d.forwardRef(({product:e,className:o,showTags:i,onLearnMore:m,onShopNow:c,onAddToCart:P,classNames:T,secondaryButtonText:B,secondaryButtonFun:L,primaryButtonText:S,primaryButtonFun:F,showOriginalPrice:z,copy:M,onProductImageClick:D},A)=>{const n=(0,k.useCreditsShelfContext)(),O=i??n?.showTags??!0,$=z??n?.showOriginalPrice??!0,f=M??n?.copy,r=T??n?.classNames,y=B??n?.secondaryButtonText,h=L??n?.secondaryButtonFun,x=S??n?.primaryButtonText,C=F??n?.primaryButtonFun,j=m??n?.onLearnMore,H=c??n?.onShopNow,I=P??n?.onAddToCart,
|
|
1
|
+
"use strict";"use client";var Z=Object.create;var u=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var i in o)u(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of K(o))!U.call(e,c)&&c!==i&&u(e,c,{get:()=>o[c],enumerable:!(m=J(o,c))||m.enumerable});return e};var W=(e,o,i)=>(i=e!=null?Z(Q(e)):{},N(o||!e||!e.__esModule?u(i,"default",{value:e,enumerable:!0}):i,e)),X=e=>N(u({},"__esModule",{value:!0}),e);var ae={};V(ae,{CreditsProductCard:()=>g,default:()=>ee});module.exports=X(ae);var a=require("react/jsx-runtime"),d=W(require("react")),s=require("../../helpers/index.js"),t=require("../../components/index.js"),k=require("./context.js");const Y=()=>(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M8 1L10.163 5.279L15 6.001L11.5 9.409L12.326 14.226L8 11.97L3.674 14.226L4.5 9.409L1 6.001L5.837 5.279L8 1Z",fill:"currentColor"})}),g=d.forwardRef(({product:e,className:o,showTags:i,onLearnMore:m,onShopNow:c,onAddToCart:P,classNames:T,secondaryButtonText:B,secondaryButtonFun:L,primaryButtonText:S,primaryButtonFun:F,showOriginalPrice:z,copy:M,onProductImageClick:D},A)=>{const n=(0,k.useCreditsShelfContext)(),O=i??n?.showTags??!0,$=z??n?.showOriginalPrice??!0,f=M??n?.copy,r=T??n?.classNames,y=B??n?.secondaryButtonText,h=L??n?.secondaryButtonFun,x=S??n?.primaryButtonText,C=F??n?.primaryButtonFun,j=m??n?.onLearnMore,H=c??n?.onShopNow,I=P??n?.onAddToCart,v=D??n?.onProductImageClick,[R,_]=d.useState(!1),[q,E]=d.useState(!1),w=async(l,p)=>{if(!l)return;const b=p==="primary"?_:E;b(!0);try{switch(l){case"buyNow":await H?.(e);break;case"addCart":await I?.(e);break;case"learnMore":await j?.(e);break;default:break}}finally{b(!1)}},G=d.useMemo(()=>e.creditSavingAmount?(f?.creditsSavingLabel??"Save up to {amount} with Credits").replace("{amount}",e.creditSavingAmount):null,[e.creditSavingAmount,f?.creditsSavingLabel]);return(0,a.jsxs)(t.Card,{ref:A,className:(0,s.cn)("bg-container-primary hover:bg-container-secondary-0 box-border flex h-full flex-col overflow-hidden border-none",o,r?.productCard),children:[(0,a.jsxs)(t.CardContent,{className:"lg-desktop:gap-[10px] lg-desktop:px-6 lg-desktop:py-4 relative flex flex-1 flex-col gap-2 p-4",children:[(0,a.jsx)("div",{className:"lg-desktop:h-[28px] flex h-[24px] gap-1",children:O&&e.tags?.map((l,p)=>l.label?(0,a.jsx)(t.Badge,{size:"sm",variant:l.variant||"outline",className:(0,s.cn)(l.variant==="promotional"?"ml-2":""),promotionalType:l.promotionalType,children:l.label},p):(0,a.jsx)(d.Fragment,{children:l},p))}),(0,a.jsx)("div",{className:"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden",children:(0,a.jsx)("a",{onClick:()=>v?.(e),...!v&&{href:e?.listingLink},rel:"noreferrer",children:(0,a.jsx)(t.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"w-full h-full object-contain"})})}),(0,a.jsxs)("div",{className:"lg-desktop:gap-6 flex flex-1 grow flex-col justify-between gap-4",children:[(0,a.jsxs)("div",{className:"lg-desktop:gap-1 flex flex-col gap-0.5",children:[(0,a.jsx)(t.Heading,{as:"h3",size:2,className:(0,s.cn)("text-info-primary line-clamp-2 min-h-[2.4em]",r?.productTitle),html:e.custom_name||e.name}),e?.description&&(0,a.jsx)(t.Text,{size:2,className:(0,s.cn)("text-info-secondary desktop:line-clamp-2 desktop:min-h-[2.4em] line-clamp-2 min-h-[2.4em]",r?.productDescription),html:e.custom_description||e.description})]}),(0,a.jsxs)("div",{className:"lg-desktop:gap-2 flex flex-col gap-1.5",children:[(0,a.jsx)("div",{className:(0,s.cn)(r?.productPrice),children:(0,a.jsx)("div",{className:"flex items-baseline gap-1",children:e.availableForSale?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Heading,{size:2,className:"text-info-primary",as:"h6",children:e.price}),$&&e.originalPrice&&(0,a.jsx)(t.Heading,{size:2,className:(0,s.cn)("text-info-tertiary line-through",r?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,a.jsx)(t.Heading,{size:2,className:"text-info-tertiary",children:f?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&(0,a.jsx)(t.Text,{size:4,className:(0,s.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.productPriceLabel),children:e.priceLabel}),(0,a.jsxs)("div",{className:(0,s.cn)("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",r?.buttonGroup),children:[y&&(0,a.jsx)(t.Button,{variant:"secondary",size:"base",className:(0,s.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.secondaryButton),onClick:()=>w(h,"secondary"),disabled:!e.availableForSale&&h!=="learnMore",loading:q,"data-headless-type-name":"CreditsShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${y}`,"data-headless-sku":e.sku,children:y}),x&&(0,a.jsx)(t.Button,{variant:"primary",size:"base",className:(0,s.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.primaryButton),onClick:()=>w(C,"primary"),disabled:!e.availableForSale&&C!=="learnMore",loading:R,"data-headless-type-name":"CreditsShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${x}`,"data-headless-sku":e.sku,children:x})]})]})]})]}),(0,a.jsxs)("div",{className:(0,s.cn)("bg-container-secondary-0 lg-desktop:px-6 lg-desktop:py-4 flex items-center justify-center gap-1 px-4 py-3",r?.creditTip),children:[(0,a.jsx)("div",{className:"bg-info-primary flex size-6 items-center justify-center rounded-full p-1",children:(0,a.jsx)("span",{className:"text-info-white",children:(0,a.jsx)(Y,{})})}),(0,a.jsx)(t.Text,{size:2,className:"text-info-primary",children:G})]})]})});g.displayName="CreditsShelf.ProductCard";var ee=g;
|
|
@@ -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 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),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),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 +1 @@
|
|
|
1
|
-
"use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),
|
|
1
|
+
"use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),v=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),_=P(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),D=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),H=require("../AiuiProvider/index.js");const y="image",w="p1_banner",W=({data:a,configuration:t,jIndex:s})=>{const[h,i]=(0,r.useState)(!1),m=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,r.useRef)(null),b=()=>{switch(t?.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-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,D.useExposure)(u,{componentType:y,componentName:w,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{i(m)},[m]);const{theme:n="light",title:c,description:o,imageUrl:d,primaryButton:f,secondaryButton:g,imageMobileUrl:k,blockLink:x,video:$,youtubeId:N,isYouTube:B}=a,T="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",b(),{"rounded-box":!0,"aiui-dark":n==="dark","h-[400px]":h},"text-info-primary"),ref:u,children:[x&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(x||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,L.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:k?.url||d?.url,alt:k?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:o})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:c??o})]}),f&&f.text&&(0,e.jsx)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:n==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:h,onVideoPlayBtnClick:i})=>{const m=u=>{const b=a?.length,n=b>3,c=b>2,o=b>1;switch(!0){case u>=1440:case u>=1024:return n?3:b;case u>=768:return n||c?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(_.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:h,onVideoPlayBtnClick:i}},Slide:W,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:m(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:m(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:m(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:m(1440)}}})},U=r.default.forwardRef((a,t)=>{const{data:s,className:h,...i}=a,{shape:m,items:u=[],isShowTab:b=!1,tabs:n,tabAlign:c="left"}=s,[o,d]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[$,N]=(0,r.useState)(n?.[0]?.id??""),{locale:B="us"}=(0,H.useAiuiContext)(),T=(l,Y)=>{d(!0),Y?x?.(l||""):g?.(l||"")},S=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:k,videoUrl:f,onCloseModal:()=>d(!1)});return!b||!n||n.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[u&&u.length>0?(0,e.jsx)(z,{items:u,shape:m,locale:B,onVideoPlayBtnClick:T}):null,o&&S()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[(0,e.jsxs)(v.Tabs,{value:$,onValueChange:N,align:c,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(v.TabsList,{children:n.map(l=>(0,e.jsx)(v.TabsTrigger,{value:l.id,children:l.label},l.id))})}),n.map(l=>(0,e.jsx)(v.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:m,locale:B,activeTab:l.id,onVideoPlayBtnClick:T}):null},l.id))]}),o&&S()]})});U.displayName="GraphicOverlayBlock";var X=(0,A.withLayout)(U);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 移动端菜单项
|
|
3
3
|
*/
|
|
4
|
-
export declare const MenuItem: ({ label, href,
|
|
4
|
+
export declare const MenuItem: ({ label, href, onClick, active, icon, className, }: {
|
|
5
5
|
label: string;
|
|
6
6
|
href?: string;
|
|
7
|
-
target?: string;
|
|
8
7
|
onClick?: () => void;
|
|
9
8
|
active?: boolean;
|
|
10
9
|
icon?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty;var
|
|
1
|
+
"use strict";var b=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var x=(t,l)=>{for(var n in l)b(t,n,{get:l[n],enumerable:!0})},v=(t,l,n,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of f(l))!g.call(t,i)&&i!==n&&b(t,i,{get:()=>l[i],enumerable:!(r=u(l,i))||r.enumerable});return t};var h=t=>v(b({},"__esModule",{value:!0}),t);var w={};x(w,{MenuItem:()=>N,SubSubCategoryContentComp:()=>k,SubSubCategoryItemComp:()=>y});module.exports=h(w);var e=require("react/jsx-runtime"),L=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),p=require("./icons/index.js"),c=require("./SidebarDropdown.js"),d=require("../AiuiProvider/index.js");const N=({label:t,href:l,onClick:n,active:r,icon:i,className:a})=>{const m=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(o.Text,{html:t,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{underline:i})}),i&&(0,e.jsx)(o.Text,{html:i,"aria-hidden":"true"})]}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return l?(0,e.jsx)(o.Link,{href:l,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",a),onClick:n,children:m}):(0,e.jsx)("button",{onClick:n,className:(0,s.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",a),"aria-expanded":r,children:m})},y=({matchSeriesMetadata:t,onSubSubCategoryItemClick:l,expanded:n})=>{const r=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(o.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(p.DownArrow,{"aria-hidden":"true",className:(0,s.cn)("size-5",{"rotate-180":n})})]});return l?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:l,"aria-expanded":n,children:r}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:r})},k=({matchSeriesMetadata:t})=>{const{locale:l="us"}=(0,d.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((n,r)=>(0,e.jsxs)("div",{children:[n.label&&(0,e.jsx)(o.Text,{html:n.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(o.Link,{asChild:!t?.banner?.href,href:(0,s.getLocalizedPath)(t?.banner?.href,l),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,s.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,s.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),n.products?.map((i,a)=>(0,e.jsx)(c.SeriesProductItem,{position:a,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n?.label||""}-${r}-${a}`))]})]},`seriesItem-${n?.label||""}-${r}`))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var _=(a,n)=>{for(var r in n)C(a,r,{get:n[r],enumerable:!0})},A=(a,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of B(n))!E.call(a,l)&&l!==r&&C(a,l,{get:()=>n[l],enumerable:!(i=z(n,l))||i.enumerable});return a};var I=a=>A(C({},"__esModule",{value:!0}),a);var F={};_(F,{MobileResourceSidebarMenu:()=>T});module.exports=I(F);var e=require("react/jsx-runtime"),s=require("react"),x=require("../../components/index.js"),m=require("./types.js"),k=require("./NavProvider.js"),b=require("./ResourceItem.js"),M=require("../AiuiProvider/index.js"),h=require("../../helpers/utils.js");const K=({label:a,onClick:n,active:r})=>(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-1",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:a})}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]}),T=({resourceCategoriesMetadata:a,resourcesMetadata:n})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:S,onSidebarNavClick:d,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,k.useNavContext)(),{locale:y="us"}=(0,M.useAiuiContext)(),[w,L]=(0,s.useState)([]),[
|
|
1
|
+
"use strict";var C=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var _=(a,n)=>{for(var r in n)C(a,r,{get:n[r],enumerable:!0})},A=(a,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of B(n))!E.call(a,l)&&l!==r&&C(a,l,{get:()=>n[l],enumerable:!(i=z(n,l))||i.enumerable});return a};var I=a=>A(C({},"__esModule",{value:!0}),a);var F={};_(F,{MobileResourceSidebarMenu:()=>T});module.exports=I(F);var e=require("react/jsx-runtime"),s=require("react"),x=require("../../components/index.js"),m=require("./types.js"),k=require("./NavProvider.js"),b=require("./ResourceItem.js"),M=require("../AiuiProvider/index.js"),h=require("../../helpers/utils.js");const K=({label:a,onClick:n,active:r})=>(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-1",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:a})}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]}),T=({resourceCategoriesMetadata:a,resourcesMetadata:n})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:S,onSidebarNavClick:d,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,k.useNavContext)(),{locale:y="us"}=(0,M.useAiuiContext)(),[w,L]=(0,s.useState)([]),[g,R]=(0,s.useState)([]);(0,s.useEffect)(()=>{a?.subcategories?.length&&L(a?.subcategories?.map((o,t)=>({index:t,open:!1})))},[a]),(0,s.useEffect)(()=>{l?.subSubCategories?.length&&R(l?.subSubCategories?.map((o,t)=>({index:t,open:t===0})))},[l]);const N=(0,s.useCallback)(o=>{S?.(o);const t=n?.find(c=>o?.label?.toLowerCase()===c.label?.toLowerCase())||{};i&&i(m.HeaderNavigationMenu.Third),f&&f(t)},[n,i,S,f]);return(0,s.useMemo)(()=>{switch(r){case m.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsx)("div",{children:a?.subcategories?.map((o,t)=>(0,e.jsx)("div",{children:(0,e.jsx)(K,{label:o?.label,active:w.find(c=>c.index===t)?.open,onClick:()=>{N(o),d?.(o,t)}})},`${o.label}-${t}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(x.Button,{as:"a",href:`${(0,h.getLocalizedPath)(a?.primary?.url,y)}?ref=${a?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(x.Button,{as:"a",href:(0,h.getLocalizedPath)(a?.secondary?.url,y),variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case m.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:l?.subSubCategories?l?.subSubCategories?.map((o,t)=>{const c=n?.find(u=>u.label.toLowerCase()===o?.label?.toLowerCase())||{};return(0,e.jsxs)("div",{children:[Reflect.ownKeys(o).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:c,onSubSubCategoryItemClick:()=>{d?.(o,t),R(u=>u.map((v,$)=>({...v,open:$===t?!v.open:v.open})))},expanded:!!g?.find(u=>u.index===t)?.open}),g?.find(u=>u.index===t)?.open&&(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:c})]},`${o.label}-${t}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:p}),(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:p})]})});default:return null}},[r,a,n,w,g,l,p,N,d,y])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var D=(a,
|
|
1
|
+
"use strict";var w=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var D=(a,n)=>{for(var m in n)w(a,m,{get:n[m],enumerable:!0})},K=(a,n,m,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of R(n))!T.call(a,o)&&o!==m&&w(a,o,{get:()=>n[o],enumerable:!(d=E(n,o))||d.enumerable});return a};var P=a=>K(w({},"__esModule",{value:!0}),a);var F={};D(F,{MobileSidebarMenu:()=>A});module.exports=P(F);var e=require("react/jsx-runtime"),i=require("react"),u=require("../../components/index.js"),v=require("./types.js"),z=require("./NavProvider.js"),b=require("./MobileMenuComponents.js"),B=require("../AiuiProvider/index.js"),f=require("../../helpers/utils.js");const A=({sidebarCategoriesMetadata:a,seriesMetadata:n})=>{const{currentMenu:m,setCurrentMenu:d,subSubCategory:o,setSubSubCategory:N,setCurrentSeriesMetadata:g,currentSeriesMetadata:p,buildProps:S,onSidebarNavClick:h}=(0,z.useNavContext)(),{locale:y="us"}=(0,B.useAiuiContext)(),[k,M]=(0,i.useState)([]),[x,L]=(0,i.useState)([]);(0,i.useEffect)(()=>{a?.subcategories?.length&&M(a?.subcategories?.map((l,r)=>({index:r,open:!1})))},[a]),(0,i.useEffect)(()=>{o?.subSubCategories?.length&&L(o?.subSubCategories?.map((l,r)=>({index:r,open:r===0})))},[o]);const $=(0,i.useCallback)((l,r)=>{d&&d(v.HeaderNavigationMenu.Third),N?.(l);const s=n?.find(t=>r!==void 0?l?.subSubCategories?.[r]?.label?.toLowerCase()===t.label?.toLowerCase():l?.label?.toLowerCase()===t.label?.toLowerCase())||{};if(l?.collections){const t=S?.categories?.[l?.collections]||{};g?.({label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:t?.products}]})}else g?.(s)},[n,d,N,g,S?.categories]);return(0,i.useMemo)(()=>{switch(m){case v.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsxs)("div",{children:[a?.subcategories?.map((l,r)=>(0,e.jsx)("div",{children:(0,e.jsx)(b.MenuItem,{label:l?.label,active:k.find(s=>s.index===r)?.open,onClick:()=>{$(l),h?.(l,r)}})},`${l.label}-${r}`)),a?.guide?.label&&(0,e.jsx)(u.Link,{href:(0,f.getLocalizedPath)(a?.guide?.url,y),children:(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(u.Text,{html:a?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(u.Button,{as:"a",href:`${(0,f.getLocalizedPath)(a?.primary?.url,y)}?ref=${a?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(u.Button,{as:"a",href:(0,f.getLocalizedPath)(a?.secondary?.url,y),variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case v.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:o?.subSubCategories?o?.subSubCategories?.map((l,r)=>{const s=n?.find(c=>c.label.toLowerCase()===l?.label?.toLowerCase())||{};let t={};if(l?.collections){const c=S?.categories?.[l?.collections]||{};t={label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:c?.products}]}}else t=s;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(l).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:t,onSubSubCategoryItemClick:()=>{h?.(l,r),L(c=>c.map((C,_)=>({...C,open:_===r?!C.open:C.open})))},expanded:!!x?.find(c=>c.index===r)?.open}),x?.find(c=>c.index===r)?.open&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:t}),t?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(u.Button,{as:"a",href:(0,f.getLocalizedPath)(t?.primary?.url,y),className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:t?.primary?.label})})]})]},`${l.label}-${r}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:p}),(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:p}),p?.primary&&(0,e.jsx)("div",{className:"my-4 text-center ",children:(0,e.jsx)(u.Button,{as:"a",href:`${(0,f.getLocalizedPath)(p?.primary?.url,y)}?ref=${p?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:p?.primary?.label})})]})});default:return null}},[m,a,n,k,x,o,p,S?.categories,$,h,y])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(a,o)=>{for(var e in o)l(a,e,{get:o[e],enumerable:!0})},s=(a,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of u(o))!d.call(a,t)&&t!==e&&l(a,t,{get:()=>o[t],enumerable:!(p=c(o,t))||p.enumerable});return a};var b=a=>s(l({},"__esModule",{value:!0}),a);var x={};f(x,{MobileSupportMenu:()=>M});module.exports=b(x);var i=require("react/jsx-runtime"),h=require("react"),r=require("./MobileMenuComponents.js"),m=require("../AiuiProvider/index.js"),n=require("../../helpers/utils.js");const M=({supportsMetadata:a})=>{const{locale:o="us"}=(0,m.useAiuiContext)();return(0,i.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map(e=>(0,i.jsx)(r.MenuItem,{href:(0,n.getLocalizedPath)(e.url,o),label:e.label,onClick:()=>{}},e.id))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.create;var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,l)=>{for(var o in l)d(e,o,{get:l[o],enumerable:!0})},m=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of h(l))!N.call(e,s)&&s!==o&&d(e,s,{get:()=>l[s],enumerable:!(r=v(l,s))||r.enumerable});return e};var w=(e,l,o)=>(o=e!=null?b(g(e)):{},m(l||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>m(d({},"__esModule",{value:!0}),e);var z={};k(z,{MulticolDropdown:()=>C,MulticolItem:()=>f});module.exports=y(z);var a=require("react/jsx-runtime"),p=require("react"),t=require("../../components/index.js"),c=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js"),u=require("./NavProvider.js");const C=({multicolMetadata:e,showStatsBanner:l,statsBannerData:o})=>{const r=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:r,className:"bg-white py-4",children:(0,a.jsx)(t.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(c.default,{data:o}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((s,i)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(f,{item:s})},`multicolItem-${s?.label}-${i}`))})]})})})},f=({item:e,allPicture:l})=>{const{locale:o="us"}=(0,x.useAiuiContext)(),{componentOverrides:r}=(0,u.useNavContext)(),s=r?.badge?.variant;return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(i=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(t.Link,{href
|
|
1
|
+
"use strict";var b=Object.create;var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,l)=>{for(var o in l)d(e,o,{get:l[o],enumerable:!0})},m=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of h(l))!N.call(e,s)&&s!==o&&d(e,s,{get:()=>l[s],enumerable:!(r=v(l,s))||r.enumerable});return e};var w=(e,l,o)=>(o=e!=null?b(g(e)):{},m(l||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>m(d({},"__esModule",{value:!0}),e);var z={};k(z,{MulticolDropdown:()=>C,MulticolItem:()=>f});module.exports=y(z);var a=require("react/jsx-runtime"),p=require("react"),t=require("../../components/index.js"),c=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js"),u=require("./NavProvider.js");const C=({multicolMetadata:e,showStatsBanner:l,statsBannerData:o})=>{const r=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:r,className:"bg-white py-4",children:(0,a.jsx)(t.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(c.default,{data:o}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((s,i)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(f,{item:s})},`multicolItem-${s?.label}-${i}`))})]})})})},f=({item:e,allPicture:l})=>{const{locale:o="us"}=(0,x.useAiuiContext)(),{componentOverrides:r}=(0,u.useNavContext)(),s=r?.badge?.variant;return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(i=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(i.url,o)}?ref=navMenu`,asChild:!i.url,className:"text-sm font-bold leading-[1.4] no-underline",children:i.label}),i?.badge&&(0,a.jsx)(t.Badge,{size:"sm",variant:s,children:i?.badge||"badge"})]},i.label))})]}),e?.imageUrl&&(0,a.jsx)("div",{className:(0,n.cn)("rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":l}),children:(0,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(e.url,o)}?ref=navMenu`,asChild:!e.url,children:(0,a.jsxs)("div",{className:"size-full",children:[(0,a.jsx)(t.Picture,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,a.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,a.jsx)(t.Text,{html:e.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&(0,a.jsx)(t.Text,{html:e.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&(0,a.jsx)(t.Button,{as:"a",href:(0,n.getLocalizedPath)(e?.primary?.url,o),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:(0,n.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var x=(t,a)=>{for(var l in a)d(t,l,{get:a[l],enumerable:!0})},v=(t,a,l,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of h(a))!c.call(t,n)&&n!==l&&d(t,n,{get:()=>a[n],enumerable:!(o=r(a,n))||o.enumerable});return t};var p=t=>v(d({},"__esModule",{value:!0}),t);var u={};x(u,{ResourceItem:()=>f,ResourceSubSubCategoryContentComp:()=>g,ResourceSubSubCategoryItemComp:()=>b});module.exports=p(u);var e=require("react/jsx-runtime"),i=require("../../components/index.js"),s=require("../../helpers/utils.js"),m=require("../AiuiProvider/index.js");const f=({resource:t})=>{const{locale:a="us"}=(0,m.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-none desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",children:(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(t?.href,a),className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(i.Picture,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{as:"p",html:t?.title,className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})}),t?.desc&&(0,e.jsx)(i.Text,{html:t?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})})]})]})})})},b=({matchResourcesMetadata:t,onSubSubCategoryItemClick:a,expanded:l})=>{const o=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(i.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&(0,e.jsx)("svg",{className:(0,s.cn)("size-5",{"rotate-180":l}),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]});return a?(0,e.jsx)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":l,children:o}):(0,e.jsx)("div",{className:"flex items-center justify-between py-4",children:o})},g=({matchResourcesMetadata:t})=>{const{locale:a="us"}=(0,m.useAiuiContext)();return(0,e.jsx)("div",{className:"tablet:grid tablet:grid-cols-2 flex grid-cols-1 flex-col gap-4",children:!!t?.resources?.length&&t?.resources?.map((l,o)=>(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(l?.href,a),className:"no-underline hover:text-current",children:(0,e.jsx)("div",{className:"laptop:h-[280px] tablet:max-w-none relative h-[240px] max-w-[358px]",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,e.jsx)(i.Picture,{source:l.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{html:l?.title,as:"p",className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})}),l?.desc&&(0,e.jsx)(i.Text,{html:l?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})})]})]})})},`resourceItem-${o}`))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var $=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var B=(e,s)=>{for(var u in s)f(e,u,{get:s[u],enumerable:!0})},h=(e,s,u,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of E(s))!O.call(e,c)&&c!==u&&f(e,c,{get:()=>s[c],enumerable:!(m=D(s,c))||m.enumerable});return e};var I=(e,s,u)=>(u=e!=null?$(z(e)):{},h(s||!e||!e.__esModule?f(u,"default",{value:e,enumerable:!0}):u,e)),T=e=>h(f({},"__esModule",{value:!0}),e);var W={};B(W,{ResourceSidebarDropdown:()=>A});module.exports=T(W);var n=require("react/jsx-runtime"),i=I(require("react")),d=require("../../components/index.js"),p=require("../../helpers/utils.js"),w=require("./icons/index.js"),N=require("./NavProvider.js"),C=require("./ResourceItem.js"),k=require("../AiuiProvider/index.js");const A=i.default.memo(({resourceCategoriesMetadata:e,resourcesMetadata:s})=>{const{onSidebarNavClick:u}=(0,N.useNavContext)(),[m,c]=(0,i.useState)([]),[y,g]=(0,i.useState)(-1),R=(0,i.useRef)(null),{locale:x="us"}=(0,k.useAiuiContext)(),v=(0,i.useCallback)(()=>{const o=e?.subcategories;if(!o?.length)return;const a=o.findIndex(l=>!!l?.subSubCategories),t=o.findIndex(l=>!l?.subSubCategories),r=o.map((l,b)=>({index:b,open:a===b||t===b}));c(r)},[e]);(0,i.useEffect)(()=>{v()},[v]);const S=(0,i.useMemo)(()=>{const o=e?.subcategories?.[m?.find(t=>t.open)?.index||0],a=s?.find(t=>t?.label?.toLowerCase()===o?.label?.toLowerCase())||{};if(o?.subSubCategories){const t=o?.subSubCategories?.[y];return s?.find(l=>l?.label?.toLowerCase()===t?.label?.toLowerCase())||{}}else return a},[e,m,y,s]),F=(0,i.useCallback)((o,a)=>{a?.subSubCategories?.length>0?g(0):g(-1),c(t=>t.map((r,l)=>({...r,open:l===o?!r.open:!1})))},[]),L=(o,a)=>{c(t=>t.map(r=>r.index===o?{...r,open:!0}:{...r,open:!1})),g(a)};return(0,n.jsxs)(d.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,n.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:R,children:[(0,n.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e?.subcategories?.map((o,a)=>{const t=Array.isArray(o?.subSubCategories)&&o?.subSubCategories?.length>0,r=m?.find(l=>l.index===a)?.open;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{className:(0,p.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!t&&r}),onClick:()=>{F(a,o),u?.(o,a)},"aria-expanded":t?r:void 0,"aria-haspopup":t?"true":void 0,children:[(0,n.jsx)(d.Text,{html:o.label,className:"p-4 text-sm font-bold leading-[1.4]"}),t&&(0,n.jsx)(w.DownArrow,{"aria-hidden":"true",className:(0,p.cn)("size-4",{"rotate-180":r})})]}),r&&(0,n.jsx)("div",{className:"flex flex-col",role:"menu",children:o.subSubCategories?.map((l,b)=>(0,n.jsx)("button",{onClick:()=>{L(a,b),u?.(l,b)},className:(0,p.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":y===b}),role:"menuitem","aria-label":l.label,children:(0,n.jsx)(d.Text,{html:l.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${a}-${b}`))})]},`subcategoryItem-${a}`)})}),e&&(0,n.jsx)("div",{className:"flex",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[e?.primary&&(0,n.jsx)(d.Button,{as:"a",href:`${(0,p.getLocalizedPath)(e?.primary?.url,x)}?ref=${e?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:e?.primary?.label}),e?.secondary&&(0,n.jsx)(d.Button,{as:"a",href:(0,p.getLocalizedPath)(e?.secondary?.url,x),variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:e?.secondary?.label})]})})]}),(0,n.jsx)("div",{className:"desktop:h-[509px] flex-1 overflow-y-auto py-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,n.jsx)("div",{className:"grid grid-cols-3 gap-4 ",children:Array.isArray(S?.resources)?S.resources.map((o,a)=>(0,n.jsx)(C.ResourceItem,{resource:o},`resourceItem-${a}`)):null})})]})});A.displayName="ResourceSidebarDropdown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.create;var C=Object.defineProperty;var
|
|
1
|
+
"use strict";var A=Object.create;var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var R=(t,i)=>{for(var m in i)C(t,m,{get:i[m],enumerable:!0})},L=(t,i,m,x)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of j(i))!O.call(t,p)&&p!==m&&C(t,p,{get:()=>i[p],enumerable:!(x=B(i,p))||x.enumerable});return t};var V=(t,i,m)=>(m=t!=null?A(E(t)):{},L(i||!t||!t.__esModule?C(m,"default",{value:t,enumerable:!0}):m,t)),W=t=>L(C({},"__esModule",{value:!0}),t);var H={};R(H,{SeriesProductItem:()=>_,SidebarDropdown:()=>P});module.exports=W(H);var e=require("react/jsx-runtime"),c=V(require("react")),n=require("../../components/index.js"),b=require("../../helpers/utils.js"),D=require("./icons/index.js"),$=require("./NavProvider.js"),F=require("../AiuiProvider/index.js");const P=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:m,onSidebarNavClick:x}=(0,$.useNavContext)(),{locale:p="us"}=(0,F.useAiuiContext)(),[v,N]=(0,c.useState)([]),[h,S]=(0,c.useState)(-1),g=(0,c.useRef)(null),y=(0,c.useRef)(null),k=(0,c.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),l=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||l===d}));N(r)},[t]);(0,c.useEffect)(()=>{k()},[k]);const s=(0,c.useMemo)(()=>{const a=t?.subcategories?.[v?.find(l=>l.open)?.index||0],o=i?.find(l=>l?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const l=m?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:l?.products}]}}else if(a?.subSubCategories){const l=a?.subSubCategories?.[h],r=i?.find(u=>u?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const u=m?.categories?.[l?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,v,h,i,m]),f=(0,c.useCallback)((a,o)=>{const l=o?.subSubCategories?.length>0;S(l?0:-1);const r=y.current;N(u=>u.map((d,z)=>z===a?{...d,open:!d.open}:l?{...d,open:!1}:!r&&h===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!l&&h===-1?{...d,open:!1}:d)),y.current={index:a,hasSubSubCategories:l}},[h]),w=(a,o)=>{N(l=>l.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),S(o)};return(0,e.jsxs)(n.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:g,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const l=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=v?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,b.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!l&&r}),onClick:()=>{f(o,a),x?.(a,o)},"aria-expanded":l?r:void 0,"aria-haspopup":l?"true":void 0,children:[(0,e.jsx)(n.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(D.DownArrow,{"aria-hidden":"true",className:(0,b.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{w(o,d),x?.(u,d)},className:(0,b.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":h===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(n.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(t?.primary?.url,p)}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",iconClassName:"size-4",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(s?.primary?.url,p)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,b.getLocalizedPath)(t?.guide?.url,p),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(n.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,b.getLocalizedPath)(s?.banner?.href,p),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:s?.banner?.title||"Buy in Guide",className:(0,b.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,b.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((l,r)=>(0,e.jsx)(_,{seriesLabel:s?.label,product:l,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});P.displayName="SidebarDropdown";const _=({product:t,isCollection:i,position:m,seriesLabel:x})=>{const{locale:p="us"}=(0,F.useAiuiContext)(),{buildProps:v,onSeriesProductClick:N,componentOverrides:h}=(0,$.useNavContext)(),S=h?.badge?.variant;let g=i?t:v?.products?.find(f=>f.handle===t.handle);const y=g?.variants?.find(f=>f.sku===t.sku)||g?.variants?.[0],k=(0,c.useMemo)(()=>`${(0,b.getLocalizedPath)(`/products/${g?.handle}`,p)}?variant=${(0,b.atobID)(y?.id)}`,[g?.handle,y?.id,p]),s=(0,c.useMemo)(()=>g?.tags?.filter?.(f=>f?.startsWith?.("CLtag"))?.map?.(f=>f?.replace?.("CLtag:",""))?.slice?.(0,2),[g?.tags]);return y?.availableForSale?(0,e.jsx)(n.Link,{href:k,onClick:f=>{f.preventDefault(),window.open(k,"_self"),N?.(g,m||0,x)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:`${y?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:g?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(s)&&s?.map((f,w)=>(0,e.jsx)(n.Badge,{size:"sm",variant:S,className:"mb-1 whitespace-nowrap",children:f},w))}),(0,e.jsx)(n.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:t?.custom_name||y?.metafields?.infos?.page_short_title||g?.title}),t?.desc&&(0,e.jsx)(n.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!b.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var R=t=>L(a({},"__esModule",{value:!0}),t);var E={};D(E,{SupportsDropdown:()=>y});module.exports=R(E);var l=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!b.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var R=t=>L(a({},"__esModule",{value:!0}),t);var E={};D(E,{SupportsDropdown:()=>y});module.exports=R(E);var l=require("react/jsx-runtime"),n=require("react"),u=require("../../components/index.js"),p=require("es-toolkit"),g=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js");const y=({supportsMetadata:t,currentNavItemRef:e})=>{const{locale:r="us"}=(0,g.useAiuiContext)(),i=(0,n.useRef)(null),[s,c]=(0,n.useState)(null),[f,h]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(i?.current){const o=i?.current?.getBoundingClientRect();h(o.height)}},[i]);const d=(0,p.debounce)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},500);return(0,n.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,n.useEffect)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},[e]),(0,l.jsx)("div",{className:"rounded-b-box absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:f},children:(0,l.jsx)("div",{ref:i,className:"p-4",children:t?.map(o=>(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(u.Link,{href:(0,m.getLocalizedPath)(o.url,r),className:"text-sm font-bold leading-[1.4] no-underline",children:o.label})},o.id))})})};
|