@anker-in/headless-ui 1.1.17-alpha.1765880007709 → 1.1.17-alpha.1765940169723

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  3. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +2 -0
  4. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  5. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  6. package/dist/cjs/components/brand-strip.d.ts +26 -0
  7. package/dist/cjs/components/brand-strip.js +2 -0
  8. package/dist/cjs/components/brand-strip.js.map +7 -0
  9. package/dist/cjs/components/index.d.ts +1 -0
  10. package/dist/cjs/components/index.js +1 -1
  11. package/dist/cjs/components/index.js.map +3 -3
  12. package/dist/cjs/stories/brandStrip.stories.js +2 -0
  13. package/dist/cjs/stories/brandStrip.stories.js.map +7 -0
  14. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  15. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  16. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +2 -0
  17. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  18. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  19. package/dist/esm/components/brand-strip.d.ts +26 -0
  20. package/dist/esm/components/brand-strip.js +2 -0
  21. package/dist/esm/components/brand-strip.js.map +7 -0
  22. package/dist/esm/components/index.d.ts +1 -0
  23. package/dist/esm/components/index.js +1 -1
  24. package/dist/esm/components/index.js.map +2 -2
  25. package/dist/esm/stories/brandStrip.stories.js +2 -0
  26. package/dist/esm/stories/brandStrip.stories.js.map +7 -0
  27. package/package.json +1 -1
  28. package/style.css +21 -0
@@ -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 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}\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 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
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAgDO,IAAKI,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBAJEA,OAAA,IAOAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
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}\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
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAiDO,IAAKI,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBAJEA,OAAA,IAOAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
6
6
  "names": ["types_exports", "__export", "HeaderNavigationActionBlockType", "HeaderNavigationBlockType", "HeaderNavigationMenu", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ type BrandStripItem = {
3
+ /** 品牌名称,用于默认展示和辅助文本 */
4
+ name: string;
5
+ /** 品牌 Logo 的图片地址,默认是内置的文字 Logo */
6
+ logo?: string;
7
+ /** 自定义 alt 文案 */
8
+ alt?: string;
9
+ /** 跳转链接,可选 */
10
+ link?: string;
11
+ };
12
+ type BrandStripProps = {
13
+ data: any;
14
+ /** 外层容器 class */
15
+ className?: string;
16
+ /** 每个卡片的 class */
17
+ itemClassName?: string;
18
+ };
19
+ /**
20
+ * BrandStrip - 品牌徽标展示条
21
+ *
22
+ * @description 展示品牌 Logo 列表的组件,支持自定义标题、Logo 和跳转链接
23
+ */
24
+ declare const BrandStrip: React.FC<BrandStripProps>;
25
+ export type { BrandStripProps, BrandStripItem };
26
+ export default BrandStrip;
@@ -0,0 +1,2 @@
1
+ "use strict";var f=Object.create;var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var b=(t,r)=>{for(var e in r)s(t,e,{get:r[e],enumerable:!0})},o=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of g(r))!u.call(t,n)&&n!==e&&s(t,n,{get:()=>r[n],enumerable:!(i=d(r,n))||i.enumerable});return t};var y=(t,r,e)=>(e=t!=null?f(c(t)):{},o(r||!t||!t.__esModule?s(e,"default",{value:t,enumerable:!0}):e,t)),h=t=>o(s({},"__esModule",{value:!0}),t);var _={};b(_,{default:()=>S});module.exports=h(_);var l=require("react/jsx-runtime"),N=require("react"),p=y(require("./link.js")),a=require("../helpers/utils.js"),m=require("./container.js");const k=({data:t,className:r,itemClassName:e})=>(0,l.jsx)("div",{className:(0,a.cn)("w-full bg-[#f5f7fb]",r),children:(0,l.jsxs)(m.Container,{children:[t?.title?(0,l.jsx)("p",{className:"mb-2 text-sm font-bold text-[#767880]",dangerouslySetInnerHTML:{__html:t?.title||""}}):null,(0,l.jsx)("ul",{className:"flex gap-2",role:"list",children:t?.leftIcon?.map?.((i,n)=>(0,l.jsx)("li",{children:(0,l.jsx)(p.default,{href:i.link,asChild:!i.link,className:"desktop:block hidden h-full",children:(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:i.logo||""},className:(0,a.cn)("brand-strip-item box-border flex h-fit items-center justify-center bg-[#F5F6F7] px-4 py-2 [&_svg]:h-full [&_svg]:w-auto [&_svg_path]:[fill:#080A0F]",e)})})},n))})]})});var S=k;
2
+ //# sourceMappingURL=brand-strip.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/brand-strip.tsx"],
4
+ "sourcesContent": ["import React from 'react'\nimport Link from './link.js'\nimport { cn } from '../helpers/utils.js'\nimport { Container } from './container.js'\n\ntype BrandStripItem = {\n /** \u54C1\u724C\u540D\u79F0\uFF0C\u7528\u4E8E\u9ED8\u8BA4\u5C55\u793A\u548C\u8F85\u52A9\u6587\u672C */\n name: string\n /** \u54C1\u724C Logo \u7684\u56FE\u7247\u5730\u5740\uFF0C\u9ED8\u8BA4\u662F\u5185\u7F6E\u7684\u6587\u5B57 Logo */\n logo?: string\n /** \u81EA\u5B9A\u4E49 alt \u6587\u6848 */\n alt?: string\n /** \u8DF3\u8F6C\u94FE\u63A5\uFF0C\u53EF\u9009 */\n link?: string\n}\n\ntype BrandStripProps = {\n data: any\n /** \u5916\u5C42\u5BB9\u5668 class */\n className?: string\n /** \u6BCF\u4E2A\u5361\u7247\u7684 class */\n itemClassName?: string\n}\n\n/**\n * BrandStrip - \u54C1\u724C\u5FBD\u6807\u5C55\u793A\u6761\n *\n * @description \u5C55\u793A\u54C1\u724C Logo \u5217\u8868\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u81EA\u5B9A\u4E49\u6807\u9898\u3001Logo \u548C\u8DF3\u8F6C\u94FE\u63A5\n */\nconst BrandStrip: React.FC<BrandStripProps> = ({ data, className, itemClassName }) => {\n return (\n <div className={cn('w-full bg-[#f5f7fb]', className)}>\n <Container>\n {data?.title ? (\n <p\n className=\"mb-2 text-sm font-bold text-[#767880]\"\n dangerouslySetInnerHTML={{ __html: data?.title || '' }}\n />\n ) : null}\n <ul className=\"flex gap-2\" role=\"list\">\n {data?.leftIcon?.map?.((item: any, index: number) => {\n return (\n <li key={index}>\n <Link href={item.link} asChild={!item.link} className=\"desktop:block hidden h-full\">\n <div\n dangerouslySetInnerHTML={{ __html: item.logo || '' }}\n className={cn(\n 'brand-strip-item box-border flex h-fit items-center justify-center bg-[#F5F6F7] px-4 py-2 [&_svg]:h-full [&_svg]:w-auto [&_svg_path]:[fill:#080A0F]',\n itemClassName\n )}\n />\n </Link>\n </li>\n )\n })}\n </ul>\n </Container>\n </div>\n )\n}\n\nexport type { BrandStripProps, BrandStripItem }\nexport default BrandStrip\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgCM,IAAAI,EAAA,6BAhCNC,EAAkB,iBAClBC,EAAiB,wBACjBC,EAAmB,+BACnBC,EAA0B,0BA0B1B,MAAMC,EAAwC,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,cAAAC,CAAc,OAE5E,OAAC,OAAI,aAAW,MAAG,sBAAuBD,CAAS,EACjD,oBAAC,aACE,UAAAD,GAAM,SACL,OAAC,KACC,UAAU,wCACV,wBAAyB,CAAE,OAAQA,GAAM,OAAS,EAAG,EACvD,EACE,QACJ,OAAC,MAAG,UAAU,aAAa,KAAK,OAC7B,SAAAA,GAAM,UAAU,MAAM,CAACG,EAAWC,OAE/B,OAAC,MACC,mBAAC,EAAAC,QAAA,CAAK,KAAMF,EAAK,KAAM,QAAS,CAACA,EAAK,KAAM,UAAU,8BACpD,mBAAC,OACC,wBAAyB,CAAE,OAAQA,EAAK,MAAQ,EAAG,EACnD,aAAW,MACT,sJACAD,CACF,EACF,EACF,GATOE,CAUT,CAEH,EACH,GACF,EACF,EAKJ,IAAOZ,EAAQO",
6
+ "names": ["brand_strip_exports", "__export", "brand_strip_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_link", "import_utils", "import_container", "BrandStrip", "data", "className", "itemClassName", "item", "index", "Link"]
7
+ }
@@ -26,3 +26,4 @@ export { default as Board } from './board.js';
26
26
  export { default as LoadingDots } from './loadingDots.js';
27
27
  export { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js';
28
28
  export { default as Breadcrumb } from './breadcrumb.js';
29
+ export { default as BrandStrip } from './brand-strip.js';
@@ -1,2 +1,2 @@
1
- "use strict";var F=Object.create;var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var q=(t,p)=>{for(var d in p)f(t,d,{get:p[d],enumerable:!0})},P=(t,p,d,w)=>{if(p&&typeof p=="object"||typeof p=="function")for(let m of E(p))!j.call(t,m)&&m!==d&&f(t,m,{get:()=>p[m],enumerable:!(w=N(p,m))||w.enumerable});return t};var n=(t,p,d)=>(d=t!=null?F(O(t)):{},P(p||!t||!t.__esModule?f(d,"default",{value:t,enumerable:!0}):d,t)),z=t=>P(f({},"__esModule",{value:!0}),t);var J={};q(J,{Alert:()=>D.Alert,AlertDescription:()=>D.AlertDescription,AlertTitle:()=>D.AlertTitle,Avatar:()=>s.Avatar,AvatarFallback:()=>s.AvatarFallback,AvatarImage:()=>s.AvatarImage,Badge:()=>M.default,Board:()=>H.default,Breadcrumb:()=>B.default,Button:()=>T.default,Card:()=>a.Card,CardContent:()=>a.CardContent,CardDescription:()=>a.CardDescription,CardFooter:()=>a.CardFooter,CardHeader:()=>a.CardHeader,CardTitle:()=>a.CardTitle,Carousel:()=>u.Carousel,CarouselContent:()=>u.CarouselContent,CarouselItem:()=>u.CarouselItem,CarouselNext:()=>u.CarouselNext,CarouselPrevious:()=>u.CarouselPrevious,Checkbox:()=>b.default,Color:()=>v.Color,Container:()=>G.Container,Dialog:()=>o.Dialog,DialogClose:()=>o.DialogClose,DialogContent:()=>o.DialogContent,DialogDescription:()=>o.DialogDescription,DialogFooter:()=>o.DialogFooter,DialogHeader:()=>o.DialogHeader,DialogOverlay:()=>o.DialogOverlay,DialogPortal:()=>o.DialogPortal,DialogTitle:()=>o.DialogTitle,DialogTrigger:()=>o.DialogTrigger,Drawer:()=>e.Drawer,DrawerClose:()=>e.DrawerClose,DrawerContent:()=>e.DrawerContent,DrawerDescription:()=>e.DrawerDescription,DrawerFooter:()=>e.DrawerFooter,DrawerHeader:()=>e.DrawerHeader,DrawerOverlay:()=>e.DrawerOverlay,DrawerPortal:()=>e.DrawerPortal,DrawerTitle:()=>e.DrawerTitle,DrawerTrigger:()=>e.DrawerTrigger,DropdownMenu:()=>r.DropdownMenu,DropdownMenuCheckboxItem:()=>r.DropdownMenuCheckboxItem,DropdownMenuContent:()=>r.DropdownMenuContent,DropdownMenuGroup:()=>r.DropdownMenuGroup,DropdownMenuItem:()=>r.DropdownMenuItem,DropdownMenuLabel:()=>r.DropdownMenuLabel,DropdownMenuPortal:()=>r.DropdownMenuPortal,DropdownMenuRadioGroup:()=>r.DropdownMenuRadioGroup,DropdownMenuRadioItem:()=>r.DropdownMenuRadioItem,DropdownMenuSeparator:()=>r.DropdownMenuSeparator,DropdownMenuShortcut:()=>r.DropdownMenuShortcut,DropdownMenuSub:()=>r.DropdownMenuSub,DropdownMenuSubContent:()=>r.DropdownMenuSubContent,DropdownMenuSubTrigger:()=>r.DropdownMenuSubTrigger,DropdownMenuTrigger:()=>r.DropdownMenuTrigger,ExposureDetector:()=>h.ExposureDetector,Grid:()=>g.Grid,GridItem:()=>g.GridItem,Heading:()=>c.Heading,Input:()=>x.Input,InputNumber:()=>S.default,InputSlot:()=>x.InputSlot,Link:()=>A.default,LoadingDots:()=>L.default,Picture:()=>k.default,Popover:()=>l.Popover,PopoverContent:()=>l.PopoverContent,PopoverTrigger:()=>l.PopoverTrigger,RadioGroup:()=>C.RadioGroup,RadioGroupItem:()=>C.RadioGroupItem,Skeleton:()=>y.default,Tabs:()=>i.Tabs,TabsContent:()=>i.TabsContent,TabsList:()=>i.TabsList,TabsTrigger:()=>i.TabsTrigger,Text:()=>I.Text,Theme:()=>R.default});module.exports=z(J);var T=n(require("./button.js")),M=n(require("./badge.js")),x=require("./input.js"),b=n(require("./checkbox.js")),y=n(require("./skeleton.js")),o=require("./dialog.js"),l=require("./popover.js"),C=require("./radio.js"),I=require("./text.js"),g=require("./grid.js"),c=require("./heading.js"),G=require("./container.js"),v=require("./color.js"),e=require("./drawer.js"),A=n(require("./link.js")),s=require("./avatar.js"),S=n(require("./input-number.js")),r=require("./drop-down.js"),a=require("./card.js"),u=require("./carousel.js"),i=require("./tabs.js"),D=require("./alert.js"),k=n(require("./picture.js")),R=n(require("./theme.js")),H=n(require("./board.js")),L=n(require("./loadingDots.js")),h=require("./ExposureDetector.js"),B=n(require("./breadcrumb.js"));
1
+ "use strict";var N=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var z=(t,n)=>{for(var d in n)f(t,d,{get:n[d],enumerable:!0})},P=(t,n,d,w)=>{if(n&&typeof n=="object"||typeof n=="function")for(let D of O(n))!q.call(t,D)&&D!==d&&f(t,D,{get:()=>n[D],enumerable:!(w=E(n,D))||w.enumerable});return t};var a=(t,n,d)=>(d=t!=null?N(j(t)):{},P(n||!t||!t.__esModule?f(d,"default",{value:t,enumerable:!0}):d,t)),J=t=>P(f({},"__esModule",{value:!0}),t);var K={};z(K,{Alert:()=>m.Alert,AlertDescription:()=>m.AlertDescription,AlertTitle:()=>m.AlertTitle,Avatar:()=>s.Avatar,AvatarFallback:()=>s.AvatarFallback,AvatarImage:()=>s.AvatarImage,Badge:()=>M.default,Board:()=>B.default,BrandStrip:()=>F.default,Breadcrumb:()=>h.default,Button:()=>T.default,Card:()=>p.Card,CardContent:()=>p.CardContent,CardDescription:()=>p.CardDescription,CardFooter:()=>p.CardFooter,CardHeader:()=>p.CardHeader,CardTitle:()=>p.CardTitle,Carousel:()=>u.Carousel,CarouselContent:()=>u.CarouselContent,CarouselItem:()=>u.CarouselItem,CarouselNext:()=>u.CarouselNext,CarouselPrevious:()=>u.CarouselPrevious,Checkbox:()=>b.default,Color:()=>v.Color,Container:()=>G.Container,Dialog:()=>o.Dialog,DialogClose:()=>o.DialogClose,DialogContent:()=>o.DialogContent,DialogDescription:()=>o.DialogDescription,DialogFooter:()=>o.DialogFooter,DialogHeader:()=>o.DialogHeader,DialogOverlay:()=>o.DialogOverlay,DialogPortal:()=>o.DialogPortal,DialogTitle:()=>o.DialogTitle,DialogTrigger:()=>o.DialogTrigger,Drawer:()=>e.Drawer,DrawerClose:()=>e.DrawerClose,DrawerContent:()=>e.DrawerContent,DrawerDescription:()=>e.DrawerDescription,DrawerFooter:()=>e.DrawerFooter,DrawerHeader:()=>e.DrawerHeader,DrawerOverlay:()=>e.DrawerOverlay,DrawerPortal:()=>e.DrawerPortal,DrawerTitle:()=>e.DrawerTitle,DrawerTrigger:()=>e.DrawerTrigger,DropdownMenu:()=>r.DropdownMenu,DropdownMenuCheckboxItem:()=>r.DropdownMenuCheckboxItem,DropdownMenuContent:()=>r.DropdownMenuContent,DropdownMenuGroup:()=>r.DropdownMenuGroup,DropdownMenuItem:()=>r.DropdownMenuItem,DropdownMenuLabel:()=>r.DropdownMenuLabel,DropdownMenuPortal:()=>r.DropdownMenuPortal,DropdownMenuRadioGroup:()=>r.DropdownMenuRadioGroup,DropdownMenuRadioItem:()=>r.DropdownMenuRadioItem,DropdownMenuSeparator:()=>r.DropdownMenuSeparator,DropdownMenuShortcut:()=>r.DropdownMenuShortcut,DropdownMenuSub:()=>r.DropdownMenuSub,DropdownMenuSubContent:()=>r.DropdownMenuSubContent,DropdownMenuSubTrigger:()=>r.DropdownMenuSubTrigger,DropdownMenuTrigger:()=>r.DropdownMenuTrigger,ExposureDetector:()=>L.ExposureDetector,Grid:()=>g.Grid,GridItem:()=>g.GridItem,Heading:()=>c.Heading,Input:()=>x.Input,InputNumber:()=>A.default,InputSlot:()=>x.InputSlot,Link:()=>S.default,LoadingDots:()=>H.default,Picture:()=>k.default,Popover:()=>l.Popover,PopoverContent:()=>l.PopoverContent,PopoverTrigger:()=>l.PopoverTrigger,RadioGroup:()=>C.RadioGroup,RadioGroupItem:()=>C.RadioGroupItem,Skeleton:()=>y.default,Tabs:()=>i.Tabs,TabsContent:()=>i.TabsContent,TabsList:()=>i.TabsList,TabsTrigger:()=>i.TabsTrigger,Text:()=>I.Text,Theme:()=>R.default});module.exports=J(K);var T=a(require("./button.js")),M=a(require("./badge.js")),x=require("./input.js"),b=a(require("./checkbox.js")),y=a(require("./skeleton.js")),o=require("./dialog.js"),l=require("./popover.js"),C=require("./radio.js"),I=require("./text.js"),g=require("./grid.js"),c=require("./heading.js"),G=require("./container.js"),v=require("./color.js"),e=require("./drawer.js"),S=a(require("./link.js")),s=require("./avatar.js"),A=a(require("./input-number.js")),r=require("./drop-down.js"),p=require("./card.js"),u=require("./carousel.js"),i=require("./tabs.js"),m=require("./alert.js"),k=a(require("./picture.js")),R=a(require("./theme.js")),B=a(require("./board.js")),H=a(require("./loadingDots.js")),L=require("./ExposureDetector.js"),h=a(require("./breadcrumb.js")),F=a(require("./brand-strip.js"));
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as Breadcrumb } from './breadcrumb.js'\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,igFAAAE,EAAAF,GAAA,IAAAG,EAAkC,0BAClCC,EAAiC,yBACjCC,EAAiC,sBAEjCC,EAAoC,4BAEpCC,EAAoC,4BACpCC,EAWO,uBACPC,EAAwD,wBACxDC,EAA2F,sBAC3FC,EAAqC,qBACrCC,EAAmE,qBACnEC,EAA2C,wBAC3CC,EAA+C,0BAC/CC,EAAuC,sBACvCC,EAWO,uBACPC,EAAgD,wBAChDC,EAAoD,uBACpDC,EAA8D,gCAC9DC,EAgBO,0BACPC,EAAsF,qBACtFC,EAOO,yBACPC,EAAyD,qBACzDC,EAAoD,sBACpDC,EAAmC,2BACnCC,EAAiC,yBACjCC,EAAiC,yBACjCC,EAAuC,+BACvCC,EAA6D,iCAC7DC,EAAsC",
6
- "names": ["components_exports", "__export", "__toCommonJS", "import_button", "import_badge", "import_input", "import_checkbox", "import_skeleton", "import_dialog", "import_popover", "import_radio", "import_text", "import_grid", "import_heading", "import_container", "import_color", "import_drawer", "import_link", "import_avatar", "import_input_number", "import_drop_down", "import_card", "import_carousel", "import_tabs", "import_alert", "import_picture", "import_theme", "import_board", "import_loadingDots", "import_ExposureDetector", "import_breadcrumb"]
4
+ "sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as Breadcrumb } from './breadcrumb.js'\nexport { default as BrandStrip } from './brand-strip.js'\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0hFAAAE,EAAAF,GAAA,IAAAG,EAAkC,0BAClCC,EAAiC,yBACjCC,EAAiC,sBAEjCC,EAAoC,4BAEpCC,EAAoC,4BACpCC,EAWO,uBACPC,EAAwD,wBACxDC,EAA2F,sBAC3FC,EAAqC,qBACrCC,EAAmE,qBACnEC,EAA2C,wBAC3CC,EAA+C,0BAC/CC,EAAuC,sBACvCC,EAWO,uBACPC,EAAgD,wBAChDC,EAAoD,uBACpDC,EAA8D,gCAC9DC,EAgBO,0BACPC,EAAsF,qBACtFC,EAOO,yBACPC,EAAyD,qBACzDC,EAAoD,sBACpDC,EAAmC,2BACnCC,EAAiC,yBACjCC,EAAiC,yBACjCC,EAAuC,+BACvCC,EAA6D,iCAC7DC,EAAsC,8BACtCC,EAAsC",
6
+ "names": ["components_exports", "__export", "__toCommonJS", "import_button", "import_badge", "import_input", "import_checkbox", "import_skeleton", "import_dialog", "import_popover", "import_radio", "import_text", "import_grid", "import_heading", "import_container", "import_color", "import_drawer", "import_link", "import_avatar", "import_input_number", "import_drop_down", "import_card", "import_carousel", "import_tabs", "import_alert", "import_picture", "import_theme", "import_board", "import_loadingDots", "import_ExposureDetector", "import_breadcrumb", "import_brand_strip"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var g=(t,o)=>{for(var e in o)s(t,e,{get:o[e],enumerable:!0})},i=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of f(o))!c.call(t,n)&&n!==e&&s(t,n,{get:()=>o[n],enumerable:!(a=l(o,n))||a.enumerable});return t};var u=(t,o,e)=>(e=t!=null?p(y(t)):{},i(o||!t||!t.__esModule?s(e,"default",{value:t,enumerable:!0}):e,t)),d=t=>i(s({},"__esModule",{value:!0}),t);var B={};g(B,{Default:()=>k,WithLinks:()=>h,default:()=>x});module.exports=d(B);var m=u(require("../components/brand-strip.js"));const w={title:"Components/BrandStrip",component:m.default,parameters:{layout:"fullscreen"},tags:["autodocs"]};var x=w;const r=(t,o="#0B6CFF")=>`data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${Math.max(120,t.length*11)} 32'><text x='0' y='22' font-family="Inter, Arial, sans-serif" font-size='20' font-weight='700' fill='${o}'>${t}</text></svg>`)}`,S=[{name:"ANKER",logo:r("ANKER","#0B6CFF"),link:"https://www.anker.com"},{name:"ANKER SOLIX",logo:r("ANKER SOLIX","#111827"),link:"https://www.anker.com/solix"},{name:"eufy",logo:r("eufy","#00A5A5"),link:"https://us.eufy.com"},{name:"eufy Make",logo:r("eufy Make","#0B6CFF"),link:"https://us.eufy.com"},{name:"soundcore",logo:r("soundcore","#101828"),link:"https://us.soundcore.com"}],k={args:{}},h={args:{brands:S}};
2
+ //# sourceMappingURL=brandStrip.stories.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/stories/brandStrip.stories.tsx"],
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport BrandStrip, { type BrandStripItem } from '../components/brand-strip.js'\n\nconst meta = {\n title: 'Components/BrandStrip',\n component: BrandStrip,\n parameters: {\n layout: 'fullscreen',\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof BrandStrip>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst createTextLogo = (label: string, color: string = '#0B6CFF') =>\n `data:image/svg+xml,${encodeURIComponent(\n `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${Math.max(\n 120,\n label.length * 11\n )} 32'><text x='0' y='22' font-family=\"Inter, Arial, sans-serif\" font-size='20' font-weight='700' fill='${color}'>${label}</text></svg>`\n )}`\n\nconst demoBrands: BrandStripItem[] = [\n { name: 'ANKER', logo: createTextLogo('ANKER', '#0B6CFF'), link: 'https://www.anker.com' },\n { name: 'ANKER SOLIX', logo: createTextLogo('ANKER SOLIX', '#111827'), link: 'https://www.anker.com/solix' },\n { name: 'eufy', logo: createTextLogo('eufy', '#00A5A5'), link: 'https://us.eufy.com' },\n { name: 'eufy Make', logo: createTextLogo('eufy Make', '#0B6CFF'), link: 'https://us.eufy.com' },\n { name: 'soundcore', logo: createTextLogo('soundcore', '#101828'), link: 'https://us.soundcore.com' },\n]\n\nexport const Default: Story = {\n args: {},\n}\n\nexport const WithLinks: Story = {\n args: {\n brands: demoBrands,\n },\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,cAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GACA,IAAAM,EAAgD,2CAEhD,MAAMC,EAAO,CACX,MAAO,wBACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,YACV,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOJ,EAAQG,EAGf,MAAME,EAAiB,CAACC,EAAeC,EAAgB,YACrD,sBAAsB,mBACpB,wDAAwD,KAAK,IAC3D,IACAD,EAAM,OAAS,EACjB,CAAC,yGAAyGC,CAAK,KAAKD,CAAK,eAC3H,CAAC,GAEGE,EAA+B,CACnC,CAAE,KAAM,QAAS,KAAMH,EAAe,QAAS,SAAS,EAAG,KAAM,uBAAwB,EACzF,CAAE,KAAM,cAAe,KAAMA,EAAe,cAAe,SAAS,EAAG,KAAM,6BAA8B,EAC3G,CAAE,KAAM,OAAQ,KAAMA,EAAe,OAAQ,SAAS,EAAG,KAAM,qBAAsB,EACrF,CAAE,KAAM,YAAa,KAAMA,EAAe,YAAa,SAAS,EAAG,KAAM,qBAAsB,EAC/F,CAAE,KAAM,YAAa,KAAMA,EAAe,YAAa,SAAS,EAAG,KAAM,0BAA2B,CACtG,EAEaP,EAAiB,CAC5B,KAAM,CAAC,CACT,EAEaC,EAAmB,CAC9B,KAAM,CACJ,OAAQS,CACV,CACF",
6
+ "names": ["brandStrip_stories_exports", "__export", "Default", "WithLinks", "brandStrip_stories_default", "__toCommonJS", "import_brand_strip", "meta", "BrandStrip", "createTextLogo", "label", "color", "demoBrands"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as K,jsx as e,jsxs as l}from"react/jsx-runtime";import Ce,{forwardRef as ee,useCallback as G,useEffect as H,useImperativeHandle as Se,useMemo as M,useRef as j,useState as B}from"react";import{Picture as q,Text as x,Button as $,Container as te,Link as O,Heading as se}from"../../components/index.js";import"../../shared/Styles.js";import{cn as w,atobID as De}from"../../helpers/utils.js";import Le,{useNavContext as W}from"./NavProvider.js";import{HeaderNavigationMenu as R,HeaderNavigationBlockType as I,HeaderNavigationActionBlockType as T}from"./types.js";import{debounce as Me}from"es-toolkit";import Pe from"jump.js";import{useGSAP as re}from"@gsap/react";import{gsap as oe}from"gsap";import{WithSidebar as ie,WithSupports as ce,WithMulticol as de,WithGroupCategory as ue}from"./withCategory.js";import{Menu as Ee,Close as pe,User as Be,RightArrow as ze,LeftArrow as He,DownArrow as ae,Polygon as Te}from"./icons/index.js";import $e from"../NavigationSearch/index.js";const Re=ee((t,a)=>{const{data:{headerNavigation:n}={},buildProps:c,event:i,profile:p,theme:d="light",isTop:b=!1,searchResult:f,onSearch:y,isSearching:o,keywords:D,onPrimaryNavClick:N,onSeriesProductClick:v,onSidebarNavClick:h,headerId:m,cartCount:g}=t,[r,u]=B(!1),[P,S]=B(!1),L=j(null),C=j(null),A=()=>{const k=document?.querySelector("body")?.offsetWidth||0;S(k<=1440)};H(()=>(A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]),Se(a,()=>C.current),H(()=>{C.current&&b&&Pe(C.current,{duration:0,offset:C.current?.getBoundingClientRect()?.bottom||0})},[b]),H(()=>{i&&(i.search=()=>u(!0))},[i]),re(()=>{L?.current&&r&&oe.fromTo(L.current,{height:0},{height:"auto",duration:.3})},[r]),H(()=>{document.documentElement.style.overflow=r?"hidden":"auto"},[r]);const Q=M(()=>n?.headerBar?.actions?.find(k=>k?.blockType===T.Search)?.searchBar?.[0]||{},[n]);return e(Le,{buildProps:c,profile:p,isMobile:P,event:i,payloadData:n,onSidebarNavClick:h,onSeriesProductClick:v,cartCount:g,children:e("header",{id:m||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:C,children:l("div",{className:w("hover:bg-white hover:text-black",d==="light"?"text-black":"text-white",{}),children:[e(Ae,{data:n,className:"desktop:block hidden !bg-white",theme:d,onPrimaryNavClick:N}),e(Oe,{data:n,className:"desktop:hidden block !bg-white",onPrimaryNavClick:N}),r&&l("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:L,className:w("overflow-y-auto",{}),children:e($e,{data:Q,keywords:D,isSearching:o,searchResult:f,onSearch:k=>{y?.(k)},onClose:()=>{y?.(),u(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>u(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:k=>{(k.key==="Enter"||k.key===" "||k.key==="Escape")&&(k.preventDefault(),u(!1))}})]})]})})})}),Ae=ee((t,a)=>{const{data:n,onNavItemClick:c,className:i,theme:p,onPrimaryNavClick:d}=t,{event:b,profile:f}=W(),[y,o]=B(!1),D=M(()=>ue(n?.categories?.filter(s=>s?.pcShow)),[n]),[N,v]=B(null),[h,m]=B([]),g=j(null),[r,u]=B(!1),P=j(null),S=j(null),L=j(D.map(s=>Array(s?.length||0).fill(null)));H(()=>{D?.length&&m(D?.map((s,E)=>s?.map((z,F)=>({groupIndex:E,index:F,open:!1}))))},[D]);const C=M(()=>{let s=null;for(const E of h){for(const z of E)if(z.open){s=z;break}if(s)break}return s},[h]);H(()=>{document.documentElement.style.overflow=C?.open||r?"hidden":"auto"},[C?.open,r]);const A=(s,E,z)=>{if(u(!1),N?.components?.[0]?.blockType===I.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url);else{const F=D?.flat()||[],U=F?.findIndex(_=>_?.id===D[E][z]?.id);s.stopPropagation(),c?.(),d?.(F[U],U),v(D[E][z]),m(_=>_.map(we=>we.map(Y=>Y.groupIndex===E&&Y.index===z?{...Y,open:!Y.open}:{...Y,open:!1})))}},Q=(s,E,z)=>{s.key==="Enter"||s.key===" "?(s.preventDefault(),A(s,E,z)):s.key==="Escape"&&C?.groupIndex===E&&C?.index===z&&(s.preventDefault(),k())},k=()=>{m(s=>s.map(E=>E.map(z=>({...z,open:!1}))))},X=M(()=>{if(N)return N?.components?.[0]?.blockType},[N]),J=ie(je,N),xe=de(Fe,N),Ne=ce(_e,{categoriesItem:N,currentNavItemRef:L.current?.[C?.groupIndex||0]?.[C?.index||0]}),ke=M(()=>{switch(X){case I.Sidebar:return e(J,{});case I.Supports:return e(Ne,{});case I.Multicol:return e(xe,{});default:return null}},[X,N]),ne=M(()=>n?.headerBar?.actions?.filter(s=>s?.pcShow),[n]),V=M(()=>ne?.find(s=>s?.blockType===T.Profile),[ne]),le=G(()=>{u(s=>!s)},[]);return H(()=>{if(g?.current){const s=g.current;return s.addEventListener("click",le),()=>{s.removeEventListener("click",le)}}},[le]),re(()=>{C?.open&&oe.fromTo(S?.current,{height:0},{height:"auto"})},[C?.open]),l(te,{className:w("relative h-[96px]",i),children:[l("div",{ref:P,onClick:k,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(ge,{}),e(he,{ref:g,actions:ne,activeStatus:r})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:D?.map((s,E)=>e("div",{className:"flex gap-3",children:s?.map((z,F)=>{const U=C?.groupIndex===E&&C?.index===F;return e("div",{ref:_=>{L.current[E][F]=_},className:"group cursor-pointer",children:l("div",{className:"relative",children:[l("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:_=>A(_,E,F),onKeyDown:_=>Q(_,E,F),"aria-expanded":U,"aria-haspopup":"true","aria-label":z.text,children:[e(x,{html:z.text,className:"text-sm font-bold leading-[1.4]"}),e(ae,{"aria-hidden":"true",className:w("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":U,"opacity-100":y&&U})})]}),e("div",{className:w("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":U},p==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},z.id)})},`groupCategory-${E}`))})]}),l("div",{role:"menu","aria-hidden":!(C?.open&&N),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:!(C?.open&&N)}),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{height:`calc(100dvh - ${P?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:S,className:w("relative z-50",{"overflow-hidden":X!==I.Supports}),children:ke}),e("div",{className:"flex-1 bg-transparent",onClick:k,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),k())}})]}),r&&l("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% - ${g?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:f?.email?l(K,{children:[e(x,{html:f?.nick_name||V?.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:V?.profiles?.map(s=>e(Z,{className:"py-2",label:s?.title,href:s?.url},s.id))})]}):l(K,{children:[e(Te,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(x,{html:V?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:V?.benefits?.map(s=>l("div",{className:"flex items-center gap-[6px]",children:[e(q,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),e(x,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e($,{variant:"secondary",size:"lg",onClick:()=>b?.join?.(),children:e(x,{html:V?.primaryButton||"Join Now",className:"font-bold"})}),e($,{variant:"primary",size:"lg",onClick:()=>b?.login?.(),children:e(x,{html:V?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>u(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),u(!1))}})]})]})}),je=Ce.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:n,onSidebarNavClick:c}=W(),[i,p]=B([]),[d,b]=B(-1),f=j(null),y=G(()=>{const v=t?.subcategories;if(!v?.length)return;const h=v.findIndex(r=>!!r?.subSubCategories),m=v.findIndex(r=>!r?.subSubCategories),g=v.map((r,u)=>({index:u,open:h===u||m===u}));p(g)},[t]);H(()=>{y()},[y]);const o=M(()=>{const v=t?.subcategories?.[i?.find(m=>m.open)?.index||0],h=a?.find(m=>m?.label?.toLowerCase()===v?.label?.toLowerCase())||{};if(v?.collections){const m=n?.categories?.[v?.collections]||{};return{label:h?.label,isCollection:!0,banner:h?.banner,primary:h?.primary,series:[{products:m?.products}]}}else if(v?.subSubCategories){const m=v?.subSubCategories?.[d],g=a?.find(r=>r?.label?.toLowerCase()===m?.label?.toLowerCase())||{};if(m?.collections){const r=n?.categories?.[m?.collections]||{};return{label:g?.label,isCollection:!0,banner:g?.banner,primary:g?.primary,series:[{products:r?.products}]}}else return g}else return h},[t,i,d,a,n]),D=G((v,h)=>{if(h?.subSubCategories?.length>0?b(0):b(-1),h?.subSubCategories?.length>0)p(m=>m.map(g=>g.index===v?{...g,open:!0}:{...g,open:!1}));else{const g=t?.subcategories?.findIndex(r=>!!r?.subSubCategories);p(r=>r.map(u=>({...u,open:u.index===v||u.index===g})))}},[t]),N=(v,h)=>{p(m=>m.map(g=>g.index===v?{...g,open:!0}:{...g,open:!1})),b(h)};return l(te,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:f,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((v,h)=>{const m=Array.isArray(v?.subSubCategories)&&v?.subSubCategories?.length>0,g=i?.find(r=>r.index===h)?.open;return l("div",{children:[l("button",{className:w("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!m&&g}),onClick:()=>{D(h,v),c?.(v,h)},"aria-expanded":m?g:void 0,"aria-haspopup":m?"true":void 0,children:[e(x,{html:v.label,className:"p-4 text-sm font-bold leading-[1.4]"}),m&&e(ae,{"aria-hidden":"true",className:w("size-4",{"rotate-180":g})})]}),g&&e("div",{className:"flex flex-col",role:"menu",children:v.subSubCategories?.map((r,u)=>e("button",{onClick:()=>{N(h,u),c?.(r,u)},className:w("w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left",{"bg-[#F5F5F7]":d===u}),role:"menuitem","aria-label":r.label,children:e(x,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]"})},`subSubItem-${h}-${u}`))})]},`subcategoryItem-${h}`)})}),t&&e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),l("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(o).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(x,{html:o?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),o?.primary&&!o?.primary?.hide&&e($,{as:"a",href:`${o?.primary?.url}?ref=${o?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:o?.primary?.label})]}),e(O,{href:o?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:o?.guide?.label})]}),e("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:o?.series?.map((v,h)=>l("div",{children:[v.label&&e(x,{html:v.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),l("div",{className:"grid grid-cols-3 gap-4",children:[!!o?.banner&&e(O,{asChild:!o?.banner?.href,href:o?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(q,{source:o?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(se,{size:2,html:o?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(x,{html:o?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),v.products?.map((m,g)=>e(me,{seriesLabel:o?.label,product:m,isCollection:o?.isCollection},`seriesProductItem-${g}`))]})]},`seriesItem-${h}`))})]})]})}),Fe=({multicolMetadata:t})=>{const a=j(null);return e("div",{ref:a,children:e(te,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((n,c)=>e("div",{className:"w-1/4",children:e(be,{item:n})},`multicolItem-${n?.label}-${c}`))})})})},_e=({supportsMetadata:t,currentNavItemRef:a})=>{const n=j(null),[c,i]=B(null),[p,d]=B(0);H(()=>{if(n?.current){const f=n?.current?.getBoundingClientRect();d(f.height)}},[n]);const b=Me(()=>{if(a){const f=a.getBoundingClientRect();i(f)}},500);return H(()=>(b(),window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}),[b]),H(()=>{if(a){const f=a.getBoundingClientRect();i(f)}},[a]),e("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${c?.right}px)`,height:p},children:e("div",{ref:n,className:"p-4",children:t?.map(f=>e("div",{className:"py-2",children:e(O,{href:f.url,className:"text-sm font-bold leading-[1.4] no-underline",children:f.label})},f.id))})})},me=({product:t,isCollection:a,position:n,seriesLabel:c})=>{const{buildProps:i,onSeriesProductClick:p}=W();let d=a?t:i?.products?.find(o=>o.handle===t.handle);const b=d?.variants?.find(o=>o.sku===t.sku)||d?.variants?.[0],f=M(()=>`/products/${d?.handle}?variant=${De(b?.id)}`,[d?.handle,b?.id]),y=M(()=>d?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2),[d?.tags]);return b?.availableForSale?e(O,{href:f,onClick:o=>{o.preventDefault(),window.open(f,"_self"),p?.(d,n||0,c)},className:"no-underline hover:text-current",children:l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",children:[e("div",{className:"shrink-0",children:e(q,{source:`${b?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),l("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(y)&&y?.map(o=>e(x,{as:"p",html:o,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(x,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:d?.title||t?.name}),t?.desc&&e(x,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},be=({item:t,allPicture:a})=>l(K,{children:[t?.columns&&l(K,{children:[e(x,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>l("div",{className:"flex items-center gap-1 py-2",children:[e(O,{href:`${n.url}?ref=navMenu`,asChild:!n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label}),n?.badge&&e(x,{as:"p",html:n?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},n.label))})]}),t?.imageUrl&&e("div",{className:w("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:l(O,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[e(q,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),l("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(x,{html:t.title,className:w("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(x,{html:t.subtitle,className:w("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e($,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:w("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),Oe=ee(({data:t,className:a,onPrimaryNavClick:n},c)=>{const i=M(()=>ue(t?.categories?.filter(k=>k?.mobileShow)),[t]),{currentMenu:p,setCurrentMenu:d,subSubCategory:b}=W(),[f,y]=B(!1),[o,D]=B(0),[N,v]=B(null),h=j(null);H(()=>{if(h?.current&&f){const k=h?.current?.getBoundingClientRect();D(window?.innerHeight-(k?.bottom||0))}},[f]),re(()=>{oe.fromTo(h.current,{height:0},{height:o,duration:.3})},[o]),H(()=>{document.documentElement.style.overflow=f?"hidden":"auto"},[f]);const m=M(()=>N?.components?.[0]?.blockType,[N]),g=ce(Ke,{categoriesItem:N}),r=ie(We,N),u=de(Ue,N),P=M(()=>{switch(m){case I.Sidebar:return e(r,{});case I.Supports:return e(g,{});case I.Multicol:return e(u,{});default:return null}},[m,N,g]),S=G(()=>{y(!1),D(0),d&&d(R.Primary)},[y,D,d]),L=M(()=>t?.headerBar?.actions?.filter(k=>k?.mobileShow&&k?.blockType!==T.Profile),[t]),C=M(()=>t?.headerBar?.actions?.find(k=>k?.mobileShow&&k?.blockType===T.Profile)||{},[t]),A=M(()=>{switch(p){case R.Primary:return e(Je,{actions:L,menuOpen:f,onMenuOpenClose:()=>{y(!1),D(0)},onMenuOpenClick:()=>y(!0)});case R.Secondary:return e(ye,{title:N?.text,onMenuOpenClose:S,onMenuBackClick:()=>d?.(R.Primary)});case R.Third:return e(ye,{title:b?.label,onMenuOpenClose:S,onMenuBackClick:()=>d?.(R.Secondary)});default:return null}},[f,p,d,N,L,b,S]),Q=G((k,X)=>{const J=Array.isArray(i)?Array.isArray(i[k])?i[k][X]:{}:{};v(J),J?.components?.[0]?.blockType===I.Links?J?.components?.[0]?.url&&window.open(J?.components?.[0]?.url):d?.(R.Secondary)},[i,d]);return l(te,{className:w("relative h-[52px]",a),children:[A,f&&e("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:o},role:"navigation","aria-label":"Mobile navigation menu",children:p===R.Primary?e(Ie,{categories:i,onPrimaryMenuClick:Q,onPrimaryNavClick:n,profileAction:C}):P})]})}),Ie=({categories:t,onPrimaryMenuClick:a,profileAction:n,onPrimaryNavClick:c})=>l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((i,p)=>l("div",{className:"",children:[i?.map((d,b)=>e(Z,{label:d.text,onClick:()=>{const y=(t?.flat()||[])?.findIndex(o=>o?.id===t[p][b]?.id);a(p,b),c?.(d,y)},icon:d.components?.[0]?.icon},d.id)),e("div",{className:w("my-2 h-px w-full bg-[#E5E5E7]",{hidden:p===t.length-1})})]},`groupCategory-${p}`))}),e(Ge,{profileAction:n})]}),We=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:n,setCurrentMenu:c,subSubCategory:i,setSubSubCategory:p,setCurrentSeriesMetadata:d,currentSeriesMetadata:b,buildProps:f,onSidebarNavClick:y}=W(),[o,D]=B([]),[N,v]=B([]);H(()=>{t?.subcategories?.length&&D(t?.subcategories?.map((r,u)=>({index:u,open:!1})))},[t]),H(()=>{i?.subSubCategories?.length&&v(i?.subSubCategories?.map((r,u)=>({index:u,open:u===0})))},[i]);const h=G((r,u)=>{c&&c(R.Third),p?.(r);const P=a?.find(S=>u!==void 0?r?.subSubCategories?.[u]?.label?.toLowerCase()===S.label?.toLowerCase():r?.label?.toLowerCase()===S.label?.toLowerCase())||{};if(r?.collections){const S=f?.categories?.[r?.collections]||{};d?.({label:P?.label,isCollection:!0,banner:P?.banner,primary:P?.primary,series:[{products:S?.products}]})}else d?.(P)},[a,c,p,d,f?.categories]),m=M(()=>a?.find(r=>!!r?.guide)?.guide,[a]);return M(()=>{switch(n){case R.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[e("div",{children:t?.subcategories?.map((r,u)=>e("div",{children:e(Z,{label:r?.label,active:o.find(P=>P.index===u)?.open,onClick:()=>{h(r),y?.(r,u)}})},`${r.label}-${u}`))}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case R.Third:return l("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[i?.subSubCategories?i?.subSubCategories?.map((r,u)=>{const P=a?.find(L=>L.label.toLowerCase()===r?.label?.toLowerCase())||{};let S={};if(r?.collections){const L=f?.categories?.[r?.collections]||{};S={label:P?.label,isCollection:!0,banner:P?.banner,primary:P?.primary,series:[{products:L?.products}]}}else S=P;return l("div",{children:[Reflect.ownKeys(r).length>0&&e(fe,{matchSeriesMetadata:S,onSubSubCategoryItemClick:()=>{y?.(r,u),v(L=>L.map((C,A)=>({...C,open:A===u?!C.open:C.open})))},expanded:!!N?.find(L=>L.index===u)?.open}),N?.find(L=>L.index===u)?.open&&l(K,{children:[e(ve,{matchSeriesMetadata:S}),S?.primary&&e("div",{className:"my-4 text-center",children:e($,{as:"a",href:S?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:S?.primary?.label})})]})]},`${r.label}-${u}`)}):l(K,{children:[Reflect.ownKeys(b).length>0&&e(fe,{matchSeriesMetadata:b}),e(ve,{matchSeriesMetadata:b}),b?.primary&&e("div",{className:"my-4 text-center ",children:e($,{as:"a",href:`${b?.primary?.url}?ref=${b?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:b?.primary?.label})})]}),m&&e(O,{href:m?.url,children:e("div",{className:"mt-4",children:e(x,{html:m?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[n,t,a,o,N,i,b,f?.categories,m,h,y])},fe=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:n})=>{const c=l(K,{children:[t?.label&&e(x,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(ae,{"aria-hidden":"true",className:w("size-5",{"rotate-180":n})})]});return a?e("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":n,children:c}):e("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:c})},ve=({matchSeriesMetadata:t})=>e("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((a,n)=>l("div",{children:[a.label&&e(x,{html:a.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),l("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(O,{asChild:!t?.banner?.href,href:t?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(q,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(se,{size:2,html:t?.banner?.title||"Buy in Guide",className:w("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(x,{html:t?.banner?.desc||"20.000mAh",className:w("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((c,i)=>e(me,{position:i,product:c,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n}-${i}`))]})]},`seriesItem-${n}`))}),Ke=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Z,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),Ue=({multicolMetadata:t})=>{const a=M(()=>!t?.some(n=>!!n.columns),[t]);return e("div",{className:w("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((n,c)=>e("div",{children:e(be,{item:n,allPicture:a})},`multicolItem-${n?.label}-${c}`))})},Ge=({profileAction:t})=>{const[a,n]=B(!1),{profile:c,event:i}=W();return l("div",{className:w("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[l("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>n(!a),"aria-expanded":a,"aria-label":c?.nick_name||t?.welcome,children:[l("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(Be,{"aria-hidden":"true"})}),e(x,{html:c?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&e(ae,{"aria-hidden":"true",className:w("laptop:size-4 size-5",{"rotate-180":a})})]}),c?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:t?.profiles?.map(p=>e(Z,{label:p?.title,href:p?.url},p.id))}),a&&!c?.email&&l("div",{className:"mt-4",children:[e(x,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(p=>l("div",{className:"flex items-center gap-[6px]",children:[e(q,{source:p.benefitIcon?.url,className:"size-4",alt:p.benefit,width:16,height:16}),e(x,{html:p.benefit,className:"text-sm font-bold leading-[1.4]"})]},p.id))})]}),!c?.email&&l("div",{className:"mt-4 flex items-center gap-3",children:[e($,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>i?.join?.(),children:e(x,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e($,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>i?.login?.(),children:e(x,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Je=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:n,actions:c})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ge,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(he,{actions:c}),t?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu","aria-expanded":"true",children:e(pe,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Ee,{className:"size-5","aria-hidden":"true"})})]})]}),ge=()=>{const{payloadData:t,isMobile:a}=W();return e("a",{href:"/",className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},he=ee(({actions:t,activeStatus:a=!1},n)=>{const{event:c,cartCount:i}=W(),[p,d]=B(null),b=y=>{switch(y){case T.Search:return"Search";case T.Cart:return`Shopping cart${i>0?` (${i} items)`:""}`;case T.Profile:return"User profile";case T.Livestream:return"Livestream";default:return"Action"}},f=G((y,o)=>{switch(d(o),y?.blockType){case T.Search:c?.search?.();break;case T.Cart:c?.cart?.();break;case T.Profile:c?.profile?.();break;case T.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((y,o)=>l("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:y.blockType===T.Profile?n:null,onClick:()=>f(y,o),"aria-label":b(y.blockType),"aria-pressed":a&&p===o,children:[e(x,{html:y.icon,className:w("size-5",{"text-brand-0":a&&p===o}),"aria-hidden":"true"}),y.blockType===T.Cart&&i>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(x,{html:i?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},y.id))})}),ye=({title:t,onMenuOpenClose:a,onMenuBackClick:n})=>l("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Back to previous menu",children:e(He,{className:"size-5","aria-hidden":"true"})}),e(x,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu",children:e(pe,{className:"size-5","aria-hidden":"true"})})]}),Z=({label:t,href:a,onClick:n,active:c,icon:i,className:p})=>{const d=l(K,{children:[l("div",{className:"flex items-center gap-4",children:[e(x,{html:t,className:w("text-sm font-bold leading-[1.4]",{underline:i})}),i&&e(x,{html:i,"aria-hidden":"true"})]}),e(ze,{className:w("laptop:size-4 size-5",{"rotate-90":c}),"aria-hidden":"true"})]});return a?e(O,{href:a,className:w("flex cursor-pointer items-center justify-between py-4 no-underline",p),children:d}):e("button",{className:w("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",p),onClick:n,"aria-expanded":c,children:d})};var it=Re;export{it as default};
1
+ "use client";import{Fragment as U,jsx as e,jsxs as l}from"react/jsx-runtime";import Ce,{forwardRef as ee,useCallback as V,useEffect as H,useImperativeHandle as Se,useMemo as L,useRef as j,useState as B}from"react";import{Picture as X,Text as h,Button as R,Container as te,Link as O,Heading as ie,BrandStrip as De}from"../../components/index.js";import"../../shared/Styles.js";import{cn as k,atobID as Le}from"../../helpers/utils.js";import Me,{useNavContext as K}from"./NavProvider.js";import{HeaderNavigationMenu as A,HeaderNavigationBlockType as I,HeaderNavigationActionBlockType as T}from"./types.js";import{debounce as Pe}from"es-toolkit";import Ee from"jump.js";import{useGSAP as oe}from"@gsap/react";import{gsap as se}from"gsap";import{WithSidebar as ce,WithSupports as de,WithMulticol as ue,WithGroupCategory as pe}from"./withCategory.js";import{Menu as Be,Close as me,User as ze,RightArrow as He,LeftArrow as Te,DownArrow as ae,Polygon as $e}from"./icons/index.js";import Re from"../NavigationSearch/index.js";const Ae=ee((t,a)=>{const{data:{headerNavigation:n}={},menuData:i,buildProps:b,event:c,profile:f,theme:p="light",isTop:y=!1,searchResult:v,onSearch:r,isSearching:M,keywords:w,onPrimaryNavClick:d,onSeriesProductClick:x,onSidebarNavClick:m,headerId:g,cartCount:o}=t,[u,S]=B(!1),[D,P]=B(!1),C=j(null),$=j(null),G=()=>{const N=document?.querySelector("body")?.offsetWidth||0;P(N<=1440)};H(()=>(G(),window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}),[]),Se(a,()=>$.current),H(()=>{$.current&&y&&Ee($.current,{duration:0,offset:$.current?.getBoundingClientRect()?.bottom||0})},[y]),H(()=>{c&&(c.search=()=>S(!0))},[c]),oe(()=>{C?.current&&u&&se.fromTo(C.current,{height:0},{height:"auto",duration:.3})},[u]),H(()=>{document.documentElement.style.overflow=u?"hidden":"auto"},[u]);const W=L(()=>n?.headerBar?.actions?.find(N=>N?.blockType===T.Search)?.searchBar?.[0]||{},[n]);return e(Me,{buildProps:b,profile:f,isMobile:D,event:c,payloadData:n,onSidebarNavClick:m,onSeriesProductClick:x,cartCount:o,children:e("header",{id:g||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:$,children:l("div",{className:k("hover:bg-white hover:text-black",p==="light"?"text-black":"text-white",{}),children:[e(je,{data:n,className:"desktop:block hidden !bg-white",theme:p,onPrimaryNavClick:d}),e(Ie,{data:n,menuData:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:d}),u&&l("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${$?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[e("div",{ref:C,className:k("overflow-y-auto",{}),children:e(Re,{data:W,keywords:w,isSearching:M,searchResult:v,onSearch:N=>{r?.(N)},onClose:()=>{r?.(),S(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>S(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:N=>{(N.key==="Enter"||N.key===" "||N.key==="Escape")&&(N.preventDefault(),S(!1))}})]})]})})})}),je=ee((t,a)=>{const{data:n,onNavItemClick:i,className:b,theme:c,onPrimaryNavClick:f}=t,{event:p,profile:y}=K(),[v,r]=B(!1),M=L(()=>pe(n?.categories?.filter(s=>s?.pcShow)),[n]),[w,d]=B(null),[x,m]=B([]),g=j(null),[o,u]=B(!1),S=j(null),D=j(null),P=j(M.map(s=>Array(s?.length||0).fill(null)));H(()=>{M?.length&&m(M?.map((s,E)=>s?.map((z,F)=>({groupIndex:E,index:F,open:!1}))))},[M]);const C=L(()=>{let s=null;for(const E of x){for(const z of E)if(z.open){s=z;break}if(s)break}return s},[x]);H(()=>{document.documentElement.style.overflow=C?.open||o?"hidden":"auto"},[C?.open,o]);const $=(s,E,z)=>{if(u(!1),w?.components?.[0]?.blockType===I.Links)w?.components?.[0]?.url&&window.open(w?.components?.[0]?.url);else{const F=M?.flat()||[],J=F?.findIndex(_=>_?.id===M[E][z]?.id);s.stopPropagation(),i?.(),f?.(F[J],J),d(M[E][z]),m(_=>_.map(we=>we.map(Y=>Y.groupIndex===E&&Y.index===z?{...Y,open:!Y.open}:{...Y,open:!1})))}},G=(s,E,z)=>{s.key==="Enter"||s.key===" "?(s.preventDefault(),$(s,E,z)):s.key==="Escape"&&C?.groupIndex===E&&C?.index===z&&(s.preventDefault(),W())},W=()=>{m(s=>s.map(E=>E.map(z=>({...z,open:!1}))))},N=L(()=>{if(w)return w?.components?.[0]?.blockType},[w]),ne=ce(Fe,w),q=ue(_e,w),Ne=de(Oe,{categoriesItem:w,currentNavItemRef:P.current?.[C?.groupIndex||0]?.[C?.index||0]}),ke=L(()=>{switch(N){case I.Sidebar:return e(ne,{});case I.Supports:return e(Ne,{});case I.Multicol:return e(q,{});default:return null}},[N,w]),le=L(()=>n?.headerBar?.actions?.filter(s=>s?.pcShow),[n]),Q=L(()=>le?.find(s=>s?.blockType===T.Profile),[le]),re=V(()=>{u(s=>!s)},[]);return H(()=>{if(g?.current){const s=g.current;return s.addEventListener("click",re),()=>{s.removeEventListener("click",re)}}},[re]),oe(()=>{C?.open&&se.fromTo(D?.current,{height:0},{height:"auto"})},[C?.open]),l(te,{className:k("relative h-[96px]",b),children:[l("div",{ref:S,onClick:W,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(he,{}),e(ye,{ref:g,actions:le,activeStatus:o})]}),e("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:M?.map((s,E)=>e("div",{className:"flex gap-3",children:s?.map((z,F)=>{const J=C?.groupIndex===E&&C?.index===F;return e("div",{ref:_=>{P.current[E][F]=_},className:"group cursor-pointer",children:l("div",{className:"relative",children:[l("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:_=>$(_,E,F),onKeyDown:_=>G(_,E,F),"aria-expanded":J,"aria-haspopup":"true","aria-label":z.text,children:[e(h,{html:z.text,className:"text-sm font-bold leading-[1.4]"}),e(ae,{"aria-hidden":"true",className:k("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":J,"opacity-100":v&&J})})]}),e("div",{className:k("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":J},c==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},z.id)})},`groupCategory-${E}`))})]}),l("div",{role:"menu","aria-hidden":!(C?.open&&w),className:k("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:!(C?.open&&w)}),onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{height:`calc(100dvh - ${S?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:D,className:k("relative z-50",{"overflow-hidden":N!==I.Supports}),children:ke}),e("div",{className:"flex-1 bg-transparent",onClick:W,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),W())}})]}),o&&l("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% - ${g?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:y?.email?l(U,{children:[e(h,{html:y?.nick_name||Q?.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:Q?.profiles?.map(s=>e(Z,{className:"py-2",label:s?.title,href:s?.url},s.id))})]}):l(U,{children:[e($e,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),e(h,{html:Q?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:Q?.benefits?.map(s=>l("div",{className:"flex items-center gap-[6px]",children:[e(X,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),e(h,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e(R,{variant:"secondary",size:"lg",onClick:()=>p?.join?.(),children:e(h,{html:Q?.primaryButton||"Join Now",className:"font-bold"})}),e(R,{variant:"primary",size:"lg",onClick:()=>p?.login?.(),children:e(h,{html:Q?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>u(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:s=>{(s.key==="Enter"||s.key===" "||s.key==="Escape")&&(s.preventDefault(),u(!1))}})]})]})}),Fe=Ce.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:n,onSidebarNavClick:i}=K(),[b,c]=B([]),[f,p]=B(-1),y=j(null),v=V(()=>{const d=t?.subcategories;if(!d?.length)return;const x=d.findIndex(o=>!!o?.subSubCategories),m=d.findIndex(o=>!o?.subSubCategories),g=d.map((o,u)=>({index:u,open:x===u||m===u}));c(g)},[t]);H(()=>{v()},[v]);const r=L(()=>{const d=t?.subcategories?.[b?.find(m=>m.open)?.index||0],x=a?.find(m=>m?.label?.toLowerCase()===d?.label?.toLowerCase())||{};if(d?.collections){const m=n?.categories?.[d?.collections]||{};return{label:x?.label,isCollection:!0,banner:x?.banner,primary:x?.primary,series:[{products:m?.products}]}}else if(d?.subSubCategories){const m=d?.subSubCategories?.[f],g=a?.find(o=>o?.label?.toLowerCase()===m?.label?.toLowerCase())||{};if(m?.collections){const o=n?.categories?.[m?.collections]||{};return{label:g?.label,isCollection:!0,banner:g?.banner,primary:g?.primary,series:[{products:o?.products}]}}else return g}else return x},[t,b,f,a,n]),M=V((d,x)=>{if(x?.subSubCategories?.length>0?p(0):p(-1),x?.subSubCategories?.length>0)c(m=>m.map(g=>g.index===d?{...g,open:!0}:{...g,open:!1}));else{const g=t?.subcategories?.findIndex(o=>!!o?.subSubCategories);c(o=>o.map(u=>({...u,open:u.index===d||u.index===g})))}},[t]),w=(d,x)=>{c(m=>m.map(g=>g.index===d?{...g,open:!0}:{...g,open:!1})),p(x)};return l(te,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:y,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((d,x)=>{const m=Array.isArray(d?.subSubCategories)&&d?.subSubCategories?.length>0,g=b?.find(o=>o.index===x)?.open;return l("div",{children:[l("button",{className:k("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!m&&g}),onClick:()=>{M(x,d),i?.(d,x)},"aria-expanded":m?g:void 0,"aria-haspopup":m?"true":void 0,children:[e(h,{html:d.label,className:"p-4 text-sm font-bold leading-[1.4]"}),m&&e(ae,{"aria-hidden":"true",className:k("size-4",{"rotate-180":g})})]}),g&&e("div",{className:"flex flex-col",role:"menu",children:d.subSubCategories?.map((o,u)=>e("button",{onClick:()=>{w(x,u),i?.(o,u)},className:k("w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left",{"bg-[#F5F5F7]":f===u}),role:"menuitem","aria-label":o.label,children:e(h,{html:o.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]"})},`subSubItem-${x}-${u}`))})]},`subcategoryItem-${x}`)})}),t&&e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[t?.primary&&e(R,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&e(R,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),l("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(r).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(h,{html:r?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),r?.primary&&!r?.primary?.hide&&e(R,{as:"a",href:`${r?.primary?.url}?ref=${r?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:r?.primary?.label})]}),e(O,{href:r?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:r?.guide?.label})]}),e("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r?.series?.map((d,x)=>l("div",{children:[d.label&&e(h,{html:d.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),l("div",{className:"grid grid-cols-3 gap-4",children:[!!r?.banner&&e(O,{asChild:!r?.banner?.href,href:r?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(X,{source:r?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(ie,{size:2,html:r?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(h,{html:r?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),d.products?.map((m,g)=>e(be,{seriesLabel:r?.label,product:m,isCollection:r?.isCollection},`seriesProductItem-${g}`))]})]},`seriesItem-${x}`))})]})]})}),_e=({multicolMetadata:t})=>{const a=j(null);return e("div",{ref:a,children:e(te,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((n,i)=>e("div",{className:"w-1/4",children:e(fe,{item:n})},`multicolItem-${n?.label}-${i}`))})})})},Oe=({supportsMetadata:t,currentNavItemRef:a})=>{const n=j(null),[i,b]=B(null),[c,f]=B(0);H(()=>{if(n?.current){const y=n?.current?.getBoundingClientRect();f(y.height)}},[n]);const p=Pe(()=>{if(a){const y=a.getBoundingClientRect();b(y)}},500);return H(()=>(p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}),[p]),H(()=>{if(a){const y=a.getBoundingClientRect();b(y)}},[a]),e("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${i?.right}px)`,height:c},children:e("div",{ref:n,className:"p-4",children:t?.map(y=>e("div",{className:"py-2",children:e(O,{href:y.url,className:"text-sm font-bold leading-[1.4] no-underline",children:y.label})},y.id))})})},be=({product:t,isCollection:a,position:n,seriesLabel:i})=>{const{buildProps:b,onSeriesProductClick:c}=K();let f=a?t:b?.products?.find(r=>r.handle===t.handle);const p=f?.variants?.find(r=>r.sku===t.sku)||f?.variants?.[0],y=L(()=>`/products/${f?.handle}?variant=${Le(p?.id)}`,[f?.handle,p?.id]),v=L(()=>f?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2),[f?.tags]);return p?.availableForSale?e(O,{href:y,onClick:r=>{r.preventDefault(),window.open(y,"_self"),c?.(f,n||0,i)},className:"no-underline hover:text-current",children:l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",children:[e("div",{className:"shrink-0",children:e(X,{source:`${p?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),l("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(v)&&v?.map(r=>e(h,{as:"p",html:r,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(h,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:f?.title||t?.name}),t?.desc&&e(h,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},fe=({item:t,allPicture:a})=>l(U,{children:[t?.columns&&l(U,{children:[e(h,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>l("div",{className:"flex items-center gap-1 py-2",children:[e(O,{href:`${n.url}?ref=navMenu`,asChild:!n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label}),n?.badge&&e(h,{as:"p",html:n?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},n.label))})]}),t?.imageUrl&&e("div",{className:k("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:l(O,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[e(X,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),l("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(h,{html:t.title,className:k("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(h,{html:t.subtitle,className:k("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e(R,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:k("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),Ie=ee(({data:t,menuData:a,className:n,onPrimaryNavClick:i},b)=>{const c=L(()=>pe(t?.categories?.filter(N=>N?.mobileShow)),[t]),{currentMenu:f,setCurrentMenu:p,subSubCategory:y}=K(),[v,r]=B(!1),[M,w]=B(0),[d,x]=B(null),m=j(null);H(()=>{if(m?.current&&v){const N=m?.current?.getBoundingClientRect();w(window?.innerHeight-(N?.bottom||0))}},[v]),oe(()=>{se.fromTo(m.current,{height:0},{height:M,duration:.3})},[M]),H(()=>{document.documentElement.style.overflow=v?"hidden":"auto"},[v]);const g=L(()=>d?.components?.[0]?.blockType,[d]),o=de(Ue,{categoriesItem:d}),u=ce(Ke,d),S=ue(Ge,d),D=L(()=>{switch(g){case I.Sidebar:return e(u,{});case I.Supports:return e(o,{});case I.Multicol:return e(S,{});default:return null}},[g,d,o]),P=V(()=>{r(!1),w(0),p&&p(A.Primary)},[r,w,p]),C=L(()=>t?.headerBar?.actions?.filter(N=>N?.mobileShow&&N?.blockType!==T.Profile),[t]),$=L(()=>t?.headerBar?.actions?.find(N=>N?.mobileShow&&N?.blockType===T.Profile)||{},[t]),G=L(()=>{switch(f){case A.Primary:return e(Ve,{actions:C,menuOpen:v,onMenuOpenClose:()=>{r(!1),w(0)},onMenuOpenClick:()=>r(!0)});case A.Secondary:return e(xe,{title:d?.text,onMenuOpenClose:P,onMenuBackClick:()=>p?.(A.Primary)});case A.Third:return e(xe,{title:y?.label,onMenuOpenClose:P,onMenuBackClick:()=>p?.(A.Secondary)});default:return null}},[v,f,p,d,C,y,P]),W=V((N,ne)=>{const q=Array.isArray(c)?Array.isArray(c[N])?c[N][ne]:{}:{};x(q),q?.components?.[0]?.blockType===I.Links?q?.components?.[0]?.url&&window.open(q?.components?.[0]?.url):p?.(A.Secondary)},[c,p]);return l(te,{className:k("relative h-[52px]",n),children:[G,e(De,{data:a}),v&&e("nav",{ref:m,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:M},role:"navigation","aria-label":"Mobile navigation menu",children:f===A.Primary?e(We,{categories:c,onPrimaryMenuClick:W,onPrimaryNavClick:i,profileAction:$}):D})]})}),We=({categories:t,onPrimaryMenuClick:a,profileAction:n,onPrimaryNavClick:i})=>l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((b,c)=>l("div",{className:"",children:[b?.map((f,p)=>e(Z,{label:f.text,onClick:()=>{const v=(t?.flat()||[])?.findIndex(r=>r?.id===t[c][p]?.id);a(c,p),i?.(f,v)},icon:f.components?.[0]?.icon},f.id)),e("div",{className:k("my-2 h-px w-full bg-[#E5E5E7]",{hidden:c===t.length-1})})]},`groupCategory-${c}`))}),e(Je,{profileAction:n})]}),Ke=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:n,setCurrentMenu:i,subSubCategory:b,setSubSubCategory:c,setCurrentSeriesMetadata:f,currentSeriesMetadata:p,buildProps:y,onSidebarNavClick:v}=K(),[r,M]=B([]),[w,d]=B([]);H(()=>{t?.subcategories?.length&&M(t?.subcategories?.map((o,u)=>({index:u,open:!1})))},[t]),H(()=>{b?.subSubCategories?.length&&d(b?.subSubCategories?.map((o,u)=>({index:u,open:u===0})))},[b]);const x=V((o,u)=>{i&&i(A.Third),c?.(o);const S=a?.find(D=>u!==void 0?o?.subSubCategories?.[u]?.label?.toLowerCase()===D.label?.toLowerCase():o?.label?.toLowerCase()===D.label?.toLowerCase())||{};if(o?.collections){const D=y?.categories?.[o?.collections]||{};f?.({label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:D?.products}]})}else f?.(S)},[a,i,c,f,y?.categories]),m=L(()=>a?.find(o=>!!o?.guide)?.guide,[a]);return L(()=>{switch(n){case A.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[e("div",{children:t?.subcategories?.map((o,u)=>e("div",{children:e(Z,{label:o?.label,active:r.find(S=>S.index===u)?.open,onClick:()=>{x(o),v?.(o,u)}})},`${o.label}-${u}`))}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e(R,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e(R,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case A.Third:return l("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[b?.subSubCategories?b?.subSubCategories?.map((o,u)=>{const S=a?.find(P=>P.label.toLowerCase()===o?.label?.toLowerCase())||{};let D={};if(o?.collections){const P=y?.categories?.[o?.collections]||{};D={label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:P?.products}]}}else D=S;return l("div",{children:[Reflect.ownKeys(o).length>0&&e(ve,{matchSeriesMetadata:D,onSubSubCategoryItemClick:()=>{v?.(o,u),d(P=>P.map((C,$)=>({...C,open:$===u?!C.open:C.open})))},expanded:!!w?.find(P=>P.index===u)?.open}),w?.find(P=>P.index===u)?.open&&l(U,{children:[e(ge,{matchSeriesMetadata:D}),D?.primary&&e("div",{className:"my-4 text-center",children:e(R,{as:"a",href:D?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:D?.primary?.label})})]})]},`${o.label}-${u}`)}):l(U,{children:[Reflect.ownKeys(p).length>0&&e(ve,{matchSeriesMetadata:p}),e(ge,{matchSeriesMetadata:p}),p?.primary&&e("div",{className:"my-4 text-center ",children:e(R,{as:"a",href:`${p?.primary?.url}?ref=${p?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:p?.primary?.label})})]}),m&&e(O,{href:m?.url,children:e("div",{className:"mt-4",children:e(h,{html:m?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[n,t,a,r,w,b,p,y?.categories,m,x,v])},ve=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:n})=>{const i=l(U,{children:[t?.label&&e(h,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(ae,{"aria-hidden":"true",className:k("size-5",{"rotate-180":n})})]});return a?e("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":n,children:i}):e("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:i})},ge=({matchSeriesMetadata:t})=>e("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((a,n)=>l("div",{children:[a.label&&e(h,{html:a.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),l("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(O,{asChild:!t?.banner?.href,href:t?.banner?.href,children:l("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(X,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[e(ie,{size:2,html:t?.banner?.title||"Buy in Guide",className:k("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(h,{html:t?.banner?.desc||"20.000mAh",className:k("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((i,b)=>e(be,{position:b,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n}-${b}`))]})]},`seriesItem-${n}`))}),Ue=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Z,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),Ge=({multicolMetadata:t})=>{const a=L(()=>!t?.some(n=>!!n.columns),[t]);return e("div",{className:k("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((n,i)=>e("div",{children:e(fe,{item:n,allPicture:a})},`multicolItem-${n?.label}-${i}`))})},Je=({profileAction:t})=>{const[a,n]=B(!1),{profile:i,event:b}=K();return l("div",{className:k("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[l("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>n(!a),"aria-expanded":a,"aria-label":i?.nick_name||t?.welcome,children:[l("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(ze,{"aria-hidden":"true"})}),e(h,{html:i?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!i?.email&&e(ae,{"aria-hidden":"true",className:k("laptop:size-4 size-5",{"rotate-180":a})})]}),i?.email&&e("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:t?.profiles?.map(c=>e(Z,{label:c?.title,href:c?.url},c.id))}),a&&!i?.email&&l("div",{className:"mt-4",children:[e(h,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(c=>l("div",{className:"flex items-center gap-[6px]",children:[e(X,{source:c.benefitIcon?.url,className:"size-4",alt:c.benefit,width:16,height:16}),e(h,{html:c.benefit,className:"text-sm font-bold leading-[1.4]"})]},c.id))})]}),!i?.email&&l("div",{className:"mt-4 flex items-center gap-3",children:[e(R,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>b?.join?.(),children:e(h,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(R,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>b?.login?.(),children:e(h,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Ve=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:n,actions:i})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(he,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(ye,{actions:i}),t?e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu","aria-expanded":"true",children:e(me,{className:"size-5","aria-hidden":"true"})}):e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:e(Be,{className:"size-5","aria-hidden":"true"})})]})]}),he=()=>{const{payloadData:t,isMobile:a}=K();return e("a",{href:"/",className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},ye=ee(({actions:t,activeStatus:a=!1},n)=>{const{event:i,cartCount:b}=K(),[c,f]=B(null),p=v=>{switch(v){case T.Search:return"Search";case T.Cart:return`Shopping cart${b>0?` (${b} items)`:""}`;case T.Profile:return"User profile";case T.Livestream:return"Livestream";default:return"Action"}},y=V((v,r)=>{switch(f(r),v?.blockType){case T.Search:i?.search?.();break;case T.Cart:i?.cart?.();break;case T.Profile:i?.profile?.();break;case T.Livestream:i?.livestream?.();break;default:return()=>{}}},[i]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((v,r)=>l("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:v.blockType===T.Profile?n:null,onClick:()=>y(v,r),"aria-label":p(v.blockType),"aria-pressed":a&&c===r,children:[e(h,{html:v.icon,className:k("size-5",{"text-brand-0":a&&c===r}),"aria-hidden":"true"}),v.blockType===T.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(h,{html:b?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},v.id))})}),xe=({title:t,onMenuOpenClose:a,onMenuBackClick:n})=>l("div",{className:"flex h-full items-center gap-3",children:[e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Back to previous menu",children:e(Te,{className:"size-5","aria-hidden":"true"})}),e(h,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>a(),"aria-label":"Close menu",children:e(me,{className:"size-5","aria-hidden":"true"})})]}),Z=({label:t,href:a,onClick:n,active:i,icon:b,className:c})=>{const f=l(U,{children:[l("div",{className:"flex items-center gap-4",children:[e(h,{html:t,className:k("text-sm font-bold leading-[1.4]",{underline:b})}),b&&e(h,{html:b,"aria-hidden":"true"})]}),e(He,{className:k("laptop:size-4 size-5",{"rotate-90":i}),"aria-hidden":"true"})]});return a?e(O,{href:a,className:k("flex cursor-pointer items-center justify-between py-4 no-underline",c),children:f}):e("button",{className:k("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",c),onClick:n,"aria-expanded":i,children:f})};var ct=Ae;export{ct as default};
2
2
  //# sourceMappingURL=index.js.map