@anker-in/headless-ui 1.1.66 → 1.1.67
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/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +1 -1
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
- package/dist/cjs/components/brand-strip.js +1 -1
- package/dist/cjs/components/brand-strip.js.map +2 -2
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +1 -1
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
- package/dist/esm/components/brand-strip.js +1 -1
- package/dist/esm/components/brand-strip.js.map +2 -2
- package/dist/tokens/soundcore.css +16 -0
- package/package.json +1 -2
- package/style.css +3 -0
- package/tailwind.config.js +2 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as xe,jsx as e,jsxs as n}from"react/jsx-runtime";import{forwardRef as Q,useCallback as V,useEffect as K,useImperativeHandle as De,useMemo as x,useRef as O,useState as P}from"react";import{Picture as le,Text as N,Button as X,Container as se,BrandStrip as Ee}from"../../components/index.js";import{withLayout as Te}from"../../shared/Styles.js";import{cn as w,getLocalizedPath as ce}from"../../helpers/utils.js";import He,{useNavContext as q}from"./NavProvider.js";import{HeaderNavigationMenu as B,HeaderNavigationBlockType as M,HeaderNavigationActionBlockType as k}from"./types.js";import Le from"jump.js";import{useGSAP as ae}from"@gsap/react";import{gsap as ne}from"gsap";import{WithSidebar as ue,WithSupports as me,WithMulticol as de,WithGroupCategory as pe,WithResource as fe}from"./withCategory.js";import{Menu as Be,Close as be,User as Re,LeftArrow as ze,DownArrow as ve,Polygon as Ie}from"./icons/index.js";import Ae from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as Oe}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as je}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as We}from"./SidebarDropdown.js";import{useScrollLock as oe}from"./useScrollLock.js";import{MulticolDropdown as _e}from"./MulticolDropdown.js";import{SupportsDropdown as $e}from"./SupportsDropdown.js";import{MobileSidebarMenu as Ke}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Fe}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ue}from"./MobileMulticolMenu.js";import{MenuItem as re}from"./MobileMenuComponents.js";import{useAiuiContext as ge}from"../AiuiProvider/index.js";const he=Q((a,l)=>{const{data:{header:s}={},buildProps:c,event:b,profile:p,theme:o="light",isTop:d=!1,searchResult:D,onSearch:i,isSearching:v,keywords:A,onPrimaryNavClick:h,onSeriesProductClick:u,onSidebarNavClick:F,headerId:H,cartCount:R,menuData:L}=a,[E,S]=P(!1),[j,W]=P(!1),T=O(null),r=O(null),z=()=>{const g=document?.querySelector("body")?.offsetWidth||0;W(g<=1440)};K(()=>(z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[]),De(l,()=>r.current),K(()=>{r.current&&d&&Le(r.current,{duration:0,offset:r.current?.getBoundingClientRect()?.bottom||0})},[d]),K(()=>{b&&(b.search=()=>S(!0))},[b]),ae(()=>{T?.current&&E&&ne.fromTo(T.current,{height:0},{height:"auto",duration:.3})},[E]),oe(E);const U=x(()=>s?.bar?.actions?.find(g=>g?.blockType===k.Search)?.searchBar?.[0]||{},[s]);return e(He,{buildProps:c,profile:p,isMobile:j,event:b,payloadData:s,onSidebarNavClick:F,onSeriesProductClick:u,cartCount:R,children:e("header",{id:H||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:r,children:n("div",{className:w("hover:bg-white hover:text-black",o==="light"?"text-black":"text-white",{}),children:[e(ye,{data:s,className:"desktop:block hidden !bg-white",theme:o,onPrimaryNavClick:h}),e(Ne,{menuData:L,data:s,className:"desktop:hidden block !bg-white",onPrimaryNavClick:h}),E&&n("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${r?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:T,className:w("overflow-y-auto",{}),children:e(Ae,{data:U,keywords:A,isSearching:v,searchResult:D,onSearch:g=>{i?.(g)},onClose:()=>{i?.(),S(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>S(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:g=>{(g.key==="Enter"||g.key===" "||g.key==="Escape")&&(g.preventDefault(),S(!1))}})]})]})})})}),ye=Q((a,l)=>{const{data:s,onNavItemClick:c,className:b,theme:p,onPrimaryNavClick:o}=a,{event:d,profile:D}=q(),[i,v]=P(!1),{locale:A="us"}=ge(),h=x(()=>pe(s?.categories?.filter(t=>t?.pcShow)),[s]),[u,F]=P(null),[H,R]=P([]),L=O(null),[E,S]=P(!1),j=O(null),W=O(null),T=O(h.map(t=>Array(t?.length||0).fill(null)));K(()=>{h?.length&&R(h?.map((t,m)=>t?.map((f,C)=>({groupIndex:m,index:C,open:!1}))))},[h]);const r=x(()=>{let t=null;for(const m of H){for(const f of m)if(f.open){t=f;break}if(t)break}return t},[H]);oe(!!r?.open||E);const z=(t,m,f)=>{S(!1);const C=h[m][f];if(C?.components?.[0]?.blockType===M.Links)C?.components?.[0]?.url&&window.open(C?.components?.[0]?.url);else{const G=h?.flat()||[],I=G?.findIndex(te=>te?.id===h[m][f]?.id);t.stopPropagation(),c?.(),o?.(G[I],I),F(C),R(te=>te.map(Pe=>Pe.map(J=>J.groupIndex===m&&J.index===f?{...J,open:!J.open}:{...J,open:!1})))}},U=(t,m,f)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),z(t,m,f)):t.key==="Escape"&&r?.groupIndex===m&&r?.index===f&&(t.preventDefault(),g())},g=()=>{R(t=>t.map(m=>m.map(f=>({...f,open:!1}))))},y=x(()=>{if(u)return u?.components?.[0]?.blockType},[u]),Y=ue(We,u),_=fe(Oe,u),we=de(_e,u),Me=me($e,{categoriesItem:u,currentNavItemRef:T.current?.[r?.groupIndex||0]?.[r?.index||0]}),Se=x(()=>{switch(y){case M.Sidebar:return e(Y,{});case M.Resource:return e(_,{});case M.Supports:return e(Me,{});case M.Multicol:return e(we,{});default:return null}},[y,u]),Z=x(()=>s?.bar?.actions?.filter(t=>t?.pcShow),[s]),$=x(()=>Z?.find(t=>t?.blockType===k.Profile),[Z]),ee=V(()=>{S(t=>!t)},[]);return K(()=>{if(L?.current){const t=L.current;return t.addEventListener("click",ee),()=>{t.removeEventListener("click",ee)}}},[ee]),ae(()=>{r?.open&&ne.fromTo(W?.current,{height:0},{height:"auto"})},[r?.open]),n(se,{className:w("relative h-[96px]",b),children:[n("div",{ref:j,onClick:g,className:"flex h-full flex-col justify-end gap-4",children:[n("div",{className:"flex items-center justify-between",children:[e(ke,{}),e(ie,{ref:L,actions:Z,activeStatus:E})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:h?.map((t,m)=>e("div",{className:"flex gap-3",children:t?.map((f,C)=>{const G=r?.groupIndex===m&&r?.index===C;return e("div",{ref:I=>{T.current[m][C]=I},className:"group",children:n("div",{className:"relative",children:[n("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:I=>z(I,m,C),onKeyDown:I=>U(I,m,C),"aria-expanded":G,"aria-haspopup":"true","aria-label":f.text,children:[e(N,{html:f.text,className:"text-sm font-bold leading-[1.4]"}),e(ve,{className:w("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":r?.groupIndex===m&&r?.index===C,"opacity-100":i&&r?.groupIndex===m&&r?.index===C,invisible:!f?.components?.length||f?.components?.[0]?.blockType===M.Links})})]}),e("div",{className:w("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":G},p==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},f.id)})},`groupCategory-${m}`))})]}),n("div",{role:"menu","aria-hidden":!(r?.open&&u),className:w("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(r?.open&&u)}),onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),style:{height:`calc(100dvh - ${j?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:W,className:w("relative z-50",{"overflow-hidden":y!==M.Supports}),children:Se}),e("div",{className:"flex-1 bg-transparent",onClick:g,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),g())}})]}),E&&n("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[e("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${L?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:D?.email?n(xe,{children:[e(N,{html:D?.nick_name||$?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),e("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:$?.profiles?.map(t=>e(re,{className:"py-2",label:t?.title,href:ce(t?.url,A)},t.id))})]}):n(xe,{children:[e(Ie,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(N,{html:$?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:$?.benefits?.map(t=>n("div",{className:"flex items-center gap-[6px]",children:[e(le,{source:t.benefitIcon?.url,className:"size-4",alt:t.benefit,width:16,height:16}),e(N,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),n("div",{className:"mt-4 flex items-center gap-2",children:[e(X,{variant:"secondary",size:"lg",onClick:()=>d?.join?.(),children:e(N,{html:$?.primaryButton||"Join Now",className:"font-bold"})}),e(X,{variant:"primary",size:"lg",onClick:()=>d?.login?.(),children:e(N,{html:$?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>S(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),S(!1))}})]})]})}),Ne=Q(({data:a,menuData:l,className:s,onPrimaryNavClick:c},b)=>{const p=x(()=>pe(a?.categories?.filter(y=>y?.mobileShow)),[a]),{currentMenu:o,setCurrentMenu:d,subSubCategory:D}=q(),[i,v]=P(!1),[A,h]=P(0),[u,F]=P(null),H=O(null);K(()=>{if(H?.current&&i){const y=H?.current?.getBoundingClientRect();h(window?.innerHeight-(y?.bottom||0))}},[i]),ae(()=>{ne.fromTo(H.current,{height:0},{height:A,duration:.3})},[A]),oe(i);const R=x(()=>u?.components?.[0]?.blockType,[u]),L=me(Fe,{categoriesItem:u}),E=ue(Ke,u),S=fe(je,u),j=de(Ue,u),W=x(()=>{switch(R){case M.Sidebar:return e(E,{});case M.Resource:return e(S,{});case M.Supports:return e(L,{});case M.Multicol:return e(j,{});default:return null}},[R,u,L]),T=V(()=>{v(!1),h(0),d&&d(B.Primary)},[v,h,d]),r=x(()=>a?.bar?.actions?.filter(y=>y?.mobileShow&&y?.blockType!==k.Profile),[a]),z=x(()=>a?.bar?.actions?.find(y=>y?.mobileShow&&y?.blockType===k.Profile)||{},[a]),U=x(()=>{switch(o){case B.Primary:return e(qe,{actions:r,menuOpen:i,onMenuOpenClose:()=>{v(!1),h(0)},onMenuOpenClick:()=>v(!0)});case B.Secondary:return e(Ce,{title:u?.text,onMenuOpenClose:T,onMenuBackClick:()=>d?.(B.Primary)});case B.Third:return e(Ce,{title:D?.label,onMenuOpenClose:T,onMenuBackClick:()=>d?.(B.Secondary)});default:return null}},[i,o,d,u,r,D,T]),g=V((y,Y)=>{const _=Array.isArray(p)?Array.isArray(p[y])?p[y][Y]:{}:{};F(_),_?.components?.[0]?.blockType===M.Links?_?.components?.[0]?.url&&window.open(_?.components?.[0]?.url):d?.(B.Secondary)},[p,d]);return n(se,{className:w("relative h-[52px]",s),children:[U,i&&n("nav",{ref:H,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:A},role:"navigation","aria-label":"Mobile navigation menu",children:[o===B.Primary&&l?e("div",{className:"pt-4",children:e(Ee,{data:l})}):null,o===B.Primary?e(Ge,{categories:p,onPrimaryMenuClick:g,onPrimaryNavClick:c,profileAction:z}):W]})]})}),Ge=({categories:a,onPrimaryMenuClick:l,profileAction:s,onPrimaryNavClick:c})=>n("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((b,p)=>n("div",{className:"",children:[e("div",{className:w("my-2 h-px w-full bg-[#E5E5E7]")}),b?.map((o,d)=>e(re,{label:o.text,onClick:()=>{const i=(a?.flat()||[])?.findIndex(v=>v?.id===a[p][d]?.id);l(p,d),c?.(o,i)},icon:o.components?.[0]?.icon},o.id))]},`groupCategory-${p}`))}),e(Je,{profileAction:s})]}),Je=({profileAction:a})=>{const[l,s]=P(!1),{profile:c,event:b}=q(),{locale:p="us"}=ge();return n("div",{className:w("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[n("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>s(!l),"aria-expanded":l,"aria-label":c?.nick_name||a?.welcome,children:[n("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Re,{"aria-hidden":"true"})}),e(N,{html:c?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&e(ve,{"aria-hidden":"true",className:w("laptop:size-4 size-5",{"rotate-180":l})})]}),c?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(o=>e(re,{label:o?.title,href:ce(o?.url,p)},o.id))}),l&&!c?.email&&n("div",{className:"mt-4",children:[e(N,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(o=>n("div",{className:"flex items-center gap-[6px]",children:[e(le,{source:o.benefitIcon?.url,className:"size-4",alt:o.benefit,width:16,height:16}),e(N,{html:o.benefit,className:"text-sm font-bold leading-[1.4]"})]},o.id))})]}),!c?.email&&n("div",{className:"mt-4 flex items-center gap-3",children:[e(X,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>b?.join?.(),children:e(N,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(X,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>b?.login?.(),children:e(N,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:l,onMenuOpenClick:s,actions:c})=>n("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ke,{}),n("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(ie,{actions:c}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu","aria-expanded":"true",children:e(be,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>s(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Be,{className:"size-5","aria-hidden":"true"})})]})]}),ke=()=>{const{payloadData:a,isMobile:l}=q();return e("a",{href:"/",className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:l?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},ie=Q(({actions:a,activeStatus:l=!1},s)=>{const{event:c,cartCount:b}=q(),[p,o]=P(null),d=i=>{switch(i){case k.Search:return"Search";case k.Cart:return`Shopping cart${b>0?` (${b} items)`:""}`;case k.Profile:return"User profile";case k.Livestream:return"Livestream";default:return"Action"}},D=V((i,v)=>{switch(o(v),i?.blockType){case k.Search:c?.search?.();break;case k.Cart:c?.cart?.();break;case k.Profile:c?.profile?.();break;case k.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((i,v)=>n("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:i.blockType===k.Profile?s:null,onClick:()=>D(i,v),"aria-label":d(i.blockType),"aria-pressed":l&&p===v,children:[e(N,{html:i.icon,className:w("size-5",{"text-brand-0":l&&p===v}),"aria-hidden":"true"}),i.blockType===k.Cart&&b>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:e(N,{html:b?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},i.id))})}),Ce=({title:a,onMenuOpenClose:l,onMenuBackClick:s})=>n("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>s(),"aria-label":"Back to previous menu",children:e(ze,{className:"size-5","aria-hidden":"true"})}),e(N,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>l(),"aria-label":"Close menu",children:e(be,{className:"size-5","aria-hidden":"true"})})]});Ne.displayName="MobileNavigation",ie.displayName="Actions",he.displayName="HeaderNavigation",ye.displayName="DesktopNavigation";var yt=Te(he);export{yt as default};
|
|
1
|
+
"use client";import{Fragment as Se,jsx as e,jsxs as o}from"react/jsx-runtime";import{forwardRef as te,useCallback as ae,useEffect as $,useImperativeHandle as De,useMemo as C,useRef as K,useState as w}from"react";import{Picture as me,Text as N,Button as oe,Container as pe,BrandStrip as Ee}from"../../components/index.js";import{withLayout as Te}from"../../shared/Styles.js";import{cn as M,getLocalizedPath as re}from"../../helpers/utils.js";import He,{useNavContext as ee}from"./NavProvider.js";import{HeaderNavigationMenu as z,HeaderNavigationBlockType as S,HeaderNavigationActionBlockType as k}from"./types.js";import Le from"jump.js";import{useGSAP as ie}from"@gsap/react";import{gsap as le}from"gsap";import{WithSidebar as fe,WithSupports as be,WithMulticol as ve,WithGroupCategory as ge,WithResource as he}from"./withCategory.js";import{Menu as Be,Close as ye,User as Re,LeftArrow as ze,DownArrow as Ne,Polygon as Ie}from"./icons/index.js";import Ae from"../NavigationSearch/index.js";import{ResourceSidebarDropdown as Oe}from"./ResourceSidebarDropdown.js";import{MobileResourceSidebarMenu as je}from"./MobileResourceSidebarMenu.js";import{SidebarDropdown as We}from"./SidebarDropdown.js";import{useScrollLock as se}from"./useScrollLock.js";import{MulticolDropdown as _e}from"./MulticolDropdown.js";import{SupportsDropdown as $e}from"./SupportsDropdown.js";import{MobileSidebarMenu as Ke}from"./MobileSidebarMenu.js";import{MobileSupportMenu as Fe}from"./MobileSupportMenu.js";import{MobileMulticolMenu as Ue}from"./MobileMulticolMenu.js";import{MenuItem as ce}from"./MobileMenuComponents.js";import{useAiuiContext as ue}from"../AiuiProvider/index.js";import Ge from"../../shared/throttle.js";const ke=te((a,u)=>{const{data:{header:i}={},buildProps:d,event:v,profile:f,theme:n="light",isTop:p=!1,searchResult:D,onSearch:l,isSearching:g,keywords:W,onPrimaryNavClick:h,onSeriesProductClick:m,onSidebarNavClick:q,headerId:L,cartCount:I,menuData:B}=a,[E,P]=w(!1),[F,A]=w(!1),[R,s]=w(!1),[U,Q]=w(!1),T=K(null),c=K(null),_=()=>{const y=document?.querySelector("body")?.offsetWidth||0;Q(y<=1440)};$(()=>(_(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[]),De(u,()=>c.current),$(()=>{c.current&&p&&Le(c.current,{duration:0,offset:c.current?.getBoundingClientRect()?.bottom||0})},[p]),$(()=>{let y=0,G=0,V=0;const J=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,H=J();y=H,A(H>300),s(H>30);const Y=Ge(()=>{const t=J(),r=t-y;s(t>30),r>0?(G=0,V+=r,V>=300&&t>300&&A(!0)):r<0&&(V=0,G+=Math.abs(r),G>=300&&(A(!1),G=0)),y=t},100);return window.addEventListener("scroll",Y,{passive:!0}),()=>window.removeEventListener("scroll",Y)},[]),$(()=>{v&&(v.search=()=>P(!0))},[v]),ie(()=>{T?.current&&E&&le.fromTo(T.current,{height:0},{height:"auto",duration:.3})},[E]),se(E);const O=C(()=>i?.bar?.actions?.find(y=>y?.blockType===k.Search)?.searchBar?.[0]||{},[i]);return e(He,{buildProps:d,profile:f,isMobile:U,event:v,payloadData:i,onSidebarNavClick:q,onSeriesProductClick:m,cartCount:I,children:e("header",{id:L||"header","data-ui-component-id":"HeaderNavigation",className:M("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":F}),ref:c,children:o("div",{className:M("hover:bg-white hover:text-black",n==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":R},{"hover:!text-black":n==="dark","!text-black":R}),onClick:()=>s(!0),children:[e(xe,{data:i,className:"desktop:block hidden !bg-white",theme:n,onNavItemClick:()=>s(!0),onPrimaryNavClick:h}),e(Ce,{menuData:B,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:h}),E&&o("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${c?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:T,className:M("overflow-y-auto",{}),children:e(Ae,{data:O,keywords:W,isSearching:g,searchResult:D,onSearch:y=>{l?.(y)},onClose:()=>{l?.(),P(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>P(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:y=>{(y.key==="Enter"||y.key===" "||y.key==="Escape")&&(y.preventDefault(),P(!1))}})]})]})})})}),xe=te((a,u)=>{const{data:i,onNavItemClick:d,className:v,theme:f,onPrimaryNavClick:n}=a,{event:p,profile:D}=ee(),[l,g]=w(!1),{locale:W="us"}=ue(),h=C(()=>ge(i?.categories?.filter(t=>t?.pcShow)),[i]),[m,q]=w(null),[L,I]=w([]),B=K(null),[E,P]=w(!1),F=K(null),A=K(null),R=K(h.map(t=>Array(t?.length||0).fill(null)));$(()=>{h?.length&&I(h?.map((t,r)=>t?.map((b,x)=>({groupIndex:r,index:x,open:!1}))))},[h]);const s=C(()=>{let t=null;for(const r of L){for(const b of r)if(b.open){t=b;break}if(t)break}return t},[L]);se(!!s?.open||E);const U=(t,r,b)=>{P(!1);const x=h[r][b];if(x?.components?.[0]?.blockType===S.Links)x?.components?.[0]?.url&&window.open(x?.components?.[0]?.url);else{const X=h?.flat()||[],j=X?.findIndex(ne=>ne?.id===h[r][b]?.id);t.stopPropagation(),d?.(),n?.(X[j],j),q(x),I(ne=>ne.map(Pe=>Pe.map(Z=>Z.groupIndex===r&&Z.index===b?{...Z,open:!Z.open}:{...Z,open:!1})))}},Q=(t,r,b)=>{t.key==="Enter"||t.key===" "?(t.preventDefault(),U(t,r,b)):t.key==="Escape"&&s?.groupIndex===r&&s?.index===b&&(t.preventDefault(),T())},T=()=>{I(t=>t.map(r=>r.map(b=>({...b,open:!1}))))},c=C(()=>{if(m)return m?.components?.[0]?.blockType},[m]),_=fe(We,m),O=he(Oe,m),y=ve(_e,m),G=be($e,{categoriesItem:m,currentNavItemRef:R.current?.[s?.groupIndex||0]?.[s?.index||0]}),V=C(()=>{switch(c){case S.Sidebar:return e(_,{});case S.Resource:return e(O,{});case S.Supports:return e(G,{});case S.Multicol:return e(y,{});default:return null}},[c,m]),J=C(()=>i?.bar?.actions?.filter(t=>t?.pcShow),[i]),H=C(()=>J?.find(t=>t?.blockType===k.Profile),[J]),Y=ae(()=>{P(t=>!t)},[]);return $(()=>{if(B?.current){const t=B.current;return t.addEventListener("click",Y),()=>{t.removeEventListener("click",Y)}}},[Y]),ie(()=>{s?.open&&le.fromTo(A?.current,{height:0},{height:"auto"})},[s?.open]),o(pe,{className:M("relative h-[96px]",v),children:[o("div",{ref:F,onClick:T,className:"flex h-full flex-col justify-end gap-4",children:[o("div",{className:"flex items-center justify-between",children:[e(we,{}),e(de,{ref:B,actions:J,activeStatus:E})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:h?.map((t,r)=>e("div",{className:"flex gap-3",children:t?.map((b,x)=>{const X=s?.groupIndex===r&&s?.index===x;return e("div",{ref:j=>{R.current[r][x]=j},className:"group",children:o("div",{className:"relative",children:[o("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:j=>U(j,r,x),onKeyDown:j=>Q(j,r,x),"aria-expanded":X,"aria-haspopup":"true","aria-label":b.text,children:[e(N,{html:b.text,className:"text-sm font-bold leading-[1.4]"}),e(Ne,{className:M("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":s?.groupIndex===r&&s?.index===x,"opacity-100":l&&s?.groupIndex===r&&s?.index===x,invisible:!b?.components?.length||b?.components?.[0]?.blockType===S.Links})})]}),e("div",{className:M("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":X},f==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},b.id)})},`groupCategory-${r}`))})]}),o("div",{role:"menu","aria-hidden":!(s?.open&&m),className:M("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(s?.open&&m)}),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{height:`calc(100dvh - ${F?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:A,className:M("relative z-50",{"overflow-hidden":c!==S.Supports}),children:V}),e("div",{className:"flex-1 bg-transparent",onClick:T,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),T())}})]}),E&&o("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[e("div",{className:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${B?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:D?.email?o(Se,{children:[e(N,{html:D?.nick_name||H?.welcome,className:"text-sm font-bold"}),e("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),e("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:H?.profiles?.map(t=>e(ce,{className:"py-2",label:t?.title,href:re(t?.url,W)},t.id))})]}):o(Se,{children:[e(Ie,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(N,{html:H?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:H?.benefits?.map(t=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:t.benefitIcon?.url,className:"size-4",alt:t.benefit,width:16,height:16}),e(N,{html:t.benefit,className:"text-sm font-bold leading-[1.4]"})]},t.id))}),o("div",{className:"mt-4 flex items-center gap-2",children:[e(oe,{variant:"secondary",size:"lg",onClick:()=>p?.join?.(),children:e(N,{html:H?.primaryButton||"Join Now",className:"font-bold"})}),e(oe,{variant:"primary",size:"lg",onClick:()=>p?.login?.(),children:e(N,{html:H?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>P(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:t=>{(t.key==="Enter"||t.key===" "||t.key==="Escape")&&(t.preventDefault(),P(!1))}})]})]})}),Ce=te(({data:a,menuData:u,className:i,onPrimaryNavClick:d},v)=>{const f=C(()=>ge(a?.categories?.filter(c=>c?.mobileShow)),[a]),{currentMenu:n,setCurrentMenu:p,subSubCategory:D}=ee(),[l,g]=w(!1),[W,h]=w(0),[m,q]=w(null),L=K(null);$(()=>{if(L?.current&&l){const c=L?.current?.getBoundingClientRect();h(window?.innerHeight-(c?.bottom||0))}},[l]),ie(()=>{le.fromTo(L.current,{height:0},{height:W,duration:.3})},[W]),se(l);const I=C(()=>m?.components?.[0]?.blockType,[m]),B=be(Fe,{categoriesItem:m}),E=fe(Ke,m),P=he(je,m),F=ve(Ue,m),A=C(()=>{switch(I){case S.Sidebar:return e(E,{});case S.Resource:return e(P,{});case S.Supports:return e(B,{});case S.Multicol:return e(F,{});default:return null}},[I,m,B]),R=ae(()=>{g(!1),h(0),p&&p(z.Primary)},[g,h,p]),s=C(()=>a?.bar?.actions?.filter(c=>c?.mobileShow&&c?.blockType!==k.Profile),[a]),U=C(()=>a?.bar?.actions?.find(c=>c?.mobileShow&&c?.blockType===k.Profile)||{},[a]),Q=C(()=>{switch(n){case z.Primary:return e(qe,{actions:s,menuOpen:l,onMenuOpenClose:()=>{g(!1),h(0)},onMenuOpenClick:()=>g(!0)});case z.Secondary:return e(Me,{title:m?.text,onMenuOpenClose:R,onMenuBackClick:()=>p?.(z.Primary)});case z.Third:return e(Me,{title:D?.label,onMenuOpenClose:R,onMenuBackClick:()=>p?.(z.Secondary)});default:return null}},[l,n,p,m,s,D,R]),T=ae((c,_)=>{const O=Array.isArray(f)?Array.isArray(f[c])?f[c][_]:{}:{};q(O),O?.components?.[0]?.blockType===S.Links?O?.components?.[0]?.url&&window.open(O?.components?.[0]?.url):p?.(z.Secondary)},[f,p]);return o(pe,{className:M("relative h-[52px]",i),children:[Q,l&&o("nav",{ref:L,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:W},role:"navigation","aria-label":"Mobile navigation menu",children:[n===z.Primary&&u?e("div",{className:"pt-4",children:e(Ee,{data:u})}):null,n===z.Primary?e(Je,{categories:f,onPrimaryMenuClick:T,onPrimaryNavClick:d,profileAction:U}):A]})]})}),Je=({categories:a,onPrimaryMenuClick:u,profileAction:i,onPrimaryNavClick:d})=>o("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map((v,f)=>o("div",{className:"",children:[e("div",{className:M("my-2 h-px w-full bg-[#E5E5E7]")}),v?.map((n,p)=>e(ce,{label:n.text,onClick:()=>{const l=(a?.flat()||[])?.findIndex(g=>g?.id===a[f][p]?.id);u(f,p),d?.(n,l)},icon:n.components?.[0]?.icon},n.id))]},`groupCategory-${f}`))}),e(Ye,{profileAction:i})]}),Ye=({profileAction:a})=>{const[u,i]=w(!1),{profile:d,event:v}=ee(),{locale:f="us"}=ue();return o("div",{className:M("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":u}),children:[o("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>i(!u),"aria-expanded":u,"aria-label":d?.nick_name||a?.welcome,children:[o("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Re,{"aria-hidden":"true"})}),e(N,{html:d?.nick_name||a?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!d?.email&&e(Ne,{"aria-hidden":"true",className:M("laptop:size-4 size-5",{"rotate-180":u})})]}),d?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:a?.profiles?.map(n=>e(ce,{label:n?.title,href:re(n?.url,f)},n.id))}),u&&!d?.email&&o("div",{className:"mt-4",children:[e(N,{html:a?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:a?.benefits?.map(n=>o("div",{className:"flex items-center gap-[6px]",children:[e(me,{source:n.benefitIcon?.url,className:"size-4",alt:n.benefit,width:16,height:16}),e(N,{html:n.benefit,className:"text-sm font-bold leading-[1.4]"})]},n.id))})]}),!d?.email&&o("div",{className:"mt-4 flex items-center gap-3",children:[e(oe,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>v?.join?.(),children:e(N,{html:a?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(oe,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>v?.login?.(),children:e(N,{html:a?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},qe=({menuOpen:a,onMenuOpenClose:u,onMenuOpenClick:i,actions:d})=>o("div",{className:"flex h-full items-center justify-between gap-4",children:[e(we,{}),o("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(de,{actions:d}),a?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>u(),"aria-label":"Close menu","aria-expanded":"true",children:e(ye,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Be,{className:"size-5","aria-hidden":"true"})})]})]}),we=()=>{const{payloadData:a,isMobile:u}=ee(),{locale:i="us"}=ue();return e("a",{href:re("/",i),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:u?a?.bar?.mobileLogo:a?.bar?.desktopLogo}})},de=te(({actions:a,activeStatus:u=!1},i)=>{const{event:d,cartCount:v}=ee(),[f,n]=w(null),p=l=>{switch(l){case k.Search:return"Search";case k.Cart:return`Shopping cart${v>0?` (${v} items)`:""}`;case k.Profile:return"User profile";case k.Livestream:return"Livestream";default:return"Action"}},D=ae((l,g)=>{switch(n(g),l?.blockType){case k.Search:d?.search?.();break;case k.Cart:d?.cart?.();break;case k.Profile:d?.profile?.();break;case k.Livestream:d?.livestream?.();break;default:return()=>{}}},[d]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(a)&&a?.map((l,g)=>o("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:l.blockType===k.Profile?i:null,onClick:()=>D(l,g),"aria-label":p(l.blockType),"aria-pressed":u&&f===g,children:[e(N,{html:l.icon,className:M("size-5",{"text-brand-0":u&&f===g}),"aria-hidden":"true"}),l.blockType===k.Cart&&v>0&&e("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:e(N,{html:v?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},l.id))})}),Me=({title:a,onMenuOpenClose:u,onMenuBackClick:i})=>o("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Back to previous menu",children:e(ze,{className:"size-5","aria-hidden":"true"})}),e(N,{html:a,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>u(),"aria-label":"Close menu",children:e(ye,{className:"size-5","aria-hidden":"true"})})]});Ce.displayName="MobileNavigation",de.displayName="Actions",ke.displayName="HeaderNavigation",xe.displayName="DesktopNavigation";var kt=Te(ke);export{kt as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeaderNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n headerId,\n cartCount,\n menuData,\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n // const [headerHidden, setHeaderHidden] = useState(false)\n // const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n // useEffect(() => {\n // let upwardDistance = 0\n // let lastScrollY = 0\n // const showDownNav = throttle(latest => {\n // const delta = lastScrollY - latest\n // if (delta > 0) {\n // upwardDistance += delta\n // if (upwardDistance >= 300) {\n // setHeaderHidden(false)\n // upwardDistance = 0\n // }\n // } else {\n // setHeaderHidden(latest > 300)\n // }\n // setChangeHeaderBackground(latest > 30)\n // lastScrollY = latest\n // }, 200)\n\n // const scrollAnimate = () => {\n // let scrollTop = 0\n // if (document?.documentElement && document?.documentElement?.scrollTop) {\n // scrollTop = document?.documentElement.scrollTop\n // } else if (document?.body) {\n // scrollTop = document?.body.scrollTop\n // }\n // showDownNav(scrollTop)\n // }\n\n // window.addEventListener('scroll', scrollAnimate)\n\n // return () => window.removeEventListener('scroll', scrollAnimate)\n // }, [])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n >\n <header\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n // className={cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n // ['translate-y-[-100%]']: headerHidden,\n // })}\n className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n // {\n // ['!bg-white transition-all duration-500 ease-in-out']: changeHeaderBackground,\n // },\n {\n // ['hover:!text-black']: theme === 'dark',\n // ['!text-black']: changeHeaderBackground,\n }\n )}\n // onClick={() => setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n // onNavItemClick={() => setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url && window.open(currentCategoriesItem?.components?.[0]?.url)\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"absolute w-[272px] bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.bottom || 0))\n }\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n return (\n <a\n href=\"/\"\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
|
|
5
|
-
"mappings": "aA4LU,OA8UI,YAAAA,GA9UJ,OAAAC,EAcE,QAAAC,MAdF,oBA3LV,OAAgB,cAAAC,EAAY,eAAAC,EAAa,aAAAC,EAAW,uBAAAC,GAAqB,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAE1G,OAAS,WAAAC,GAAS,QAAAC,EAAM,UAAAC,EAAQ,aAAAC,GAAW,cAAAC,OAAkB,4BAE7D,OAAS,cAAAC,OAAkB,yBAE3B,OAAS,MAAAC,EAAI,oBAAAC,OAAwB,yBASrC,OAAOC,IAAe,iBAAAC,MAAqB,mBAE3C,OAAS,wBAAAC,EAAsB,6BAAAC,EAA2B,mCAAAC,MAAuC,aAEjG,OAAOC,OAAU,UAEjB,OAAS,WAAAC,OAAe,cACxB,OAAS,QAAAC,OAAY,OAErB,OAAS,eAAAC,GA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AhK,EAACiC,GAAA,CAAU,UAAU,SAAS,cAAY,OAAO,EACnD,EACAjC,EAACU,EAAA,CAAK,KAAMqJ,EAAO,UAAU,uDAAuD,EACpF/J,EAAC,UACC,UAAU,6CACV,QAAS,IAAMqJ,EAAgB,EAC/B,aAAW,aAEX,SAAArJ,EAAC+B,GAAA,CAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJ+C,GAAiB,YAAc,mBAC/B0C,GAAQ,YAAc,UACtBxE,GAAiB,YAAc,mBAC/B6B,GAAkB,YAAc,oBAEhC,IAAOoF,GAAQnJ,GAAWkC,EAAgB",
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Picture", "Text", "Button", "Container", "BrandStrip", "withLayout", "cn", "getLocalizedPath", "NavProvider", "useNavContext", "HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType", "jump", "useGSAP", "gsap", "WithSidebar", "WithSupports", "WithMulticol", "WithGroupCategory", "WithResource", "Menu", "Close", "User", "LeftArrow", "DownArrow", "Polygon", "NavigationSearch", "ResourceSidebarDropdown", "MobileResourceSidebarMenu", "SidebarDropdown", "useScrollLock", "MulticolDropdown", "SupportsDropdown", "MobileSidebarMenu", "MobileSupportMenu", "MobileMulticolMenu", "MenuItem", "useAiuiContext", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "headerId", "cartCount", "menuData", "searchOpen", "setSearchOpen", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "searchPage", "item", "DesktopNavigation", "MobileNavigation", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "rect", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick", "HeaderNavigation_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n headerId,\n cartCount,\n menuData,\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n >\n <header\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })}\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: changeHeaderBackground,\n }\n )}\n onClick={() => setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url && window.open(currentCategoriesItem?.components?.[0]?.url)\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.bottom || 0))\n }\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
|
|
5
|
+
"mappings": "aA4MU,OA8UI,YAAAA,GA9UJ,OAAAC,EAcE,QAAAC,MAdF,oBA3MV,OAAgB,cAAAC,GAAY,eAAAC,GAAa,aAAAC,EAAW,uBAAAC,GAAqB,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAE1G,OAAS,WAAAC,GAAS,QAAAC,EAAM,UAAAC,GAAQ,aAAAC,GAAW,cAAAC,OAAkB,4BAE7D,OAAS,cAAAC,OAAkB,yBAE3B,OAAS,MAAAC,EAAI,oBAAAC,OAAwB,yBASrC,OAAOC,IAAe,iBAAAC,OAAqB,mBAE3C,OAAS,wBAAAC,EAAsB,6BAAAC,EAA2B,mCAAAC,MAAuC,aAEjG,OAAOC,OAAU,UAEjB,OAAS,WAAAC,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AMkK,EAAO,UAAU,uDAAuD,EACpF5K,EAAC,UACC,UAAU,6CACV,QAAS,IAAMkK,EAAgB,EAC/B,aAAW,aAEX,SAAAlK,EAAC+B,GAAA,CAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJ4D,GAAiB,YAAc,mBAC/B0C,GAAQ,YAAc,UACtBpF,GAAiB,YAAc,mBAC/ByC,GAAkB,YAAc,oBAEhC,IAAOoF,GAAQhK,GAAWmC,EAAgB",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Picture", "Text", "Button", "Container", "BrandStrip", "withLayout", "cn", "getLocalizedPath", "NavProvider", "useNavContext", "HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType", "jump", "useGSAP", "gsap", "WithSidebar", "WithSupports", "WithMulticol", "WithGroupCategory", "WithResource", "Menu", "Close", "User", "LeftArrow", "DownArrow", "Polygon", "NavigationSearch", "ResourceSidebarDropdown", "MobileResourceSidebarMenu", "SidebarDropdown", "useScrollLock", "MulticolDropdown", "SupportsDropdown", "MobileSidebarMenu", "MobileSupportMenu", "MobileMulticolMenu", "MenuItem", "useAiuiContext", "throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "headerId", "cartCount", "menuData", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "currentScrollY", "delta", "searchPage", "item", "DesktopNavigation", "MobileNavigation", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "rect", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick", "HeaderNavigation_default"]
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ export interface HeaderNavigationProps {
|
|
|
4
4
|
menuData: any;
|
|
5
5
|
onPrimaryNavClick?: (_category: any, _position: number) => void;
|
|
6
6
|
onSidebarNavClick?: (_series: any, _index: number) => void;
|
|
7
|
-
onSeriesProductClick?: (_product: any, _position: number) => void;
|
|
7
|
+
onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void;
|
|
8
8
|
searchResult?: any;
|
|
9
9
|
onSearch?: (_value?: string) => void;
|
|
10
10
|
isSearching?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeaderNavigation/types.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
|
|
4
|
+
"sourcesContent": ["import type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
|
|
5
5
|
"mappings": "AAiDO,IAAKA,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAC,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBACRA,EAAA,SAAW,0BALDA,OAAA,IAQAC,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
|
|
6
6
|
"names": ["HeaderNavigationMenu", "HeaderNavigationBlockType", "HeaderNavigationActionBlockType"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Fragment as E,jsx as
|
|
1
|
+
import{Fragment as E,jsx as o,jsxs as s}from"react/jsx-runtime";import{Picture as w,Text as l,Button as H,Container as K,Link as v,Heading as L,Grid as j,GridItem as M}from"../../components/index.js";import{Search as V,Close as R}from"../HeaderNavigation/icons/index.js";import{forwardRef as J,useCallback as C,useMemo as D,useState as F,useEffect as O,useRef as Q}from"react";import{useAiuiContext as U}from"../AiuiProvider/index.js";import{getLocalizedPath as n}from"../../helpers/utils.js";import{SearchStatus as u}from"./types.js";import{debounce as X}from"es-toolkit";import{cn as h,atobID as I,highlightSearchWord as Y}from"../../helpers/utils.js";const Z=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),S=J(({data:t,onSearch:c,onClose:p,searchResult:i,isSearching:d,keywords:m},P)=>{const{locale:a="us",copyWriting:te}=U(),[r,T]=F(""),[k,y]=F(!1),f=Q(null);O(()=>{f.current&&f.current.focus({preventScroll:!0})},[]);const B=X(e=>{c(e)},300),A=C(e=>{e.key==="Enter"&&!k&&window.open(n(`${t?.moreLink}?q=${r.toLowerCase()}`,a),"_self")},[k,r,a,t?.moreLink]),_=D(()=>Array.isArray(m)&&m?.length?m.map(e=>e.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(e=>e.popularWord):[],[m,t?.popularWords]),z=C(e=>{switch(e.__typename||e.type){case"Product":return n(`/products${e.path}?q=${r.toLowerCase()}`,a);case"Article":return n(`/blogs/${e.blog.handle}/${e.handle.replace("storefront-","")}?q=${r.toLowerCase()}`,a);default:break}},[r,a]),N=D(()=>{if(r){if(i?.totalCount)return u.Predict;if(!d)return u.Empty}else return u.Default},[i?.totalCount,r,d]);return s(K,{childClassName:"!bg-white",className:"relative",ref:P,children:[o("style",{children:`
|
|
2
2
|
.navigation-search-component input:-webkit-autofill,
|
|
3
3
|
.navigation-search-component input:-webkit-autofill:hover,
|
|
4
4
|
.navigation-search-component input:-webkit-autofill:focus {
|
|
@@ -7,5 +7,5 @@ import{Fragment as E,jsx as s,jsxs as o}from"react/jsx-runtime";import{Picture a
|
|
|
7
7
|
transition: background-color 9999s ease-in-out 0s !important;
|
|
8
8
|
caret-color: #000;
|
|
9
9
|
}
|
|
10
|
-
`}),
|
|
10
|
+
`}),s("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black",children:[o("input",{ref:f,value:r,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1),onKeyDown:A,onChange:e=>{T(e.target.value),e.target.value&&B(e.target.value)},type:"text",className:"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none placeholder:text-[#4A4C56] focus-visible:!outline-none",placeholder:t?.placeholder}),s("div",{className:"flex items-center gap-3",children:[o(V,{className:"size-5 cursor-pointer",onClick:()=>c(r)}),o("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),o(R,{className:"size-5 cursor-pointer",onClick:p})]})]}),o("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:N===u.Predict?s(E,{children:[s("div",{children:[s("div",{className:"flex items-center gap-1",children:[o(l,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),i?.items?.length>6&&o(H,{as:"a",iconClassName:"size-4",href:n(`${t?.moreLink}?q=${r.toLowerCase()}`,a),className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),o("div",{className:"mt-2 flex flex-col",children:i?.items?.filter(e=>Z(e)).slice(0,6)?.map(e=>o(v,{className:"rounded-sidebar-shelf w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:z(e),children:o(l,{html:Y(e.title,r),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},e.id))})]}),s("div",{children:[o(l,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),s("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&o(v,{asChild:!t?.advertisingLink,href:n(t?.advertisingLink,a),children:s("div",{className:"rounded-sidebar-shelf relative",children:[o(w,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),s("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[o(L,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:h("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),o(l,{html:t?.advertisingSubtitle||"20.000mAh",className:h("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),i?.items?.filter(e=>e.type.toLowerCase()==="product").slice(0,t?.advertisingBgImg?.url?7:8)?.map(e=>{const g=e?.variants?.[0],b=`${g?.image?.url||e?.images?.[0]?.url}`,x=e?.title||e?.name,W=e?.description,q=e?.badge||"",G=n(`/products/${e?.handle}?variant=${I(g?.id)}`,a);return o($,{productImage:b,productName:x,productDesc:W,productBadge:q,listingLink:G},e.id)})]})]},"predict-advertising-card")]}):s(E,{children:[N===u.Empty&&o(l,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),s("div",{children:[o(l,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),s("div",{className:"mt-2",children:[o(ee,{data:t,keywords:_,locale:a}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&o(j,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(e=>o(M,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:o("a",{href:n(`${t?.moreLink}?q=${e?.popularPage.toLowerCase()}`,a),className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:e?.popularPage})},e?.id))})]})]}),s("div",{children:[o(l,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),s("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&o(v,{asChild:!t?.advertisingLink,href:n(t?.advertisingLink,a),children:s("div",{className:"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[o(w,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),s("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[o(L,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:h("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),o(l,{html:t?.advertisingSubtitle||"20.000mAh",className:h("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),t?.hotProducts?.slice(0,t?.advertisingBgImg?.url?7:8)?.map(e=>{const g=e?.custom_description,b=e?.badge||"",x=n(`/products/${e?.handle}?variant=${I(e?.shopify_id)}`,a);return o($,{productImage:e?.image,productName:e?.name,productDesc:g,productBadge:b,listingLink:x},e.shopify_id||e.id)})]})]},"empty-advertising-card")]})})]})});S.displayName="NavigationSearch";const $=({productImage:t,productName:c,productDesc:p,productBadge:i,className:d,listingLink:m})=>o(v,{href:m,className:"block no-underline hover:text-current",children:s("div",{className:h("rounded-sidebar-shelf flex shrink-0 gap-4 overflow-hidden bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",d),children:[o("div",{className:"shrink-0",children:o("img",{src:t,loading:"lazy",alt:c,width:90,height:90,className:"size-[96px] object-contain"})}),s("div",{className:"relative",children:[o("div",{className:" h-[24px] ",children:i&&o(l,{as:"p",html:i,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"})}),s("div",{children:[o(l,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:c}),p&&o(l,{as:"p",html:p,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]})}),ee=({data:t,keywords:c,locale:p})=>o("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:c?.map((i,d)=>o("a",{href:n(`${t?.moreLink}?q=${i?.toLowerCase()}`,p),className:"rounded-sidebar-shelf laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:i},d))});var pe=S;export{Z as canSearch,pe as default};
|
|
11
11
|
//# sourceMappingURL=index.js.map
|