@anker-in/headless-ui 1.3.72 → 1.3.74

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 (65) hide show
  1. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  2. package/dist/cjs/biz-components/ActiveShelf/styles.js +1 -1
  3. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +9 -0
  5. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  6. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  7. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  8. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +2 -1
  9. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  10. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
  11. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
  12. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
  13. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  14. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +1 -1
  15. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
  16. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.d.ts +2 -1
  17. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  18. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  19. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  20. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +1 -0
  21. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  22. package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.d.ts +30 -0
  23. package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.js +1 -0
  24. package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.d.ts +2 -1
  25. package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.js +1 -1
  26. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  27. package/dist/cjs/biz-components/Listing/utils/index.js +1 -1
  28. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  29. package/dist/cjs/components/badge.d.ts +1 -1
  30. package/dist/cjs/components/badge.js +1 -1
  31. package/dist/cjs/components/board.js +1 -1
  32. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  33. package/dist/esm/biz-components/ActiveShelf/styles.js +1 -1
  34. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  35. package/dist/esm/biz-components/AiuiProvider/index.d.ts +9 -0
  36. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  37. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  38. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  39. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +2 -1
  40. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  41. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
  42. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
  43. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
  44. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  45. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +1 -1
  46. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
  47. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.d.ts +2 -1
  48. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  49. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  50. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  51. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +1 -0
  52. package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.d.ts +30 -0
  53. package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.js +1 -0
  54. package/dist/esm/biz-components/HeaderNavigation/useScrollLock.d.ts +2 -1
  55. package/dist/esm/biz-components/HeaderNavigation/useScrollLock.js +1 -1
  56. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  57. package/dist/esm/biz-components/Listing/utils/index.js +1 -1
  58. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  59. package/dist/esm/components/badge.d.ts +1 -1
  60. package/dist/esm/components/badge.js +1 -1
  61. package/dist/esm/components/board.js +1 -1
  62. package/dist/tokens/oneAnker.css +22 -0
  63. package/package.json +1 -1
  64. package/style.css +55 -4
  65. package/tailwind.config.js +5 -0
@@ -1 +1 @@
1
- "use strict";"use client";var be=Object.create;var N=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Se=(e,a)=>{for(var o in a)N(e,o,{get:a[o],enumerable:!0})},$=(e,a,o,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of ye(a))!ve.call(e,c)&&c!==o&&N(e,c,{get:()=>a[c],enumerable:!(d=fe(a,c))||d.enumerable});return e};var Ce=(e,a,o)=>(o=e!=null?be(pe(e)):{},$(a||!e||!e.__esModule?N(o,"default",{value:e,enumerable:!0}):o,e)),he=e=>$(N({},"__esModule",{value:!0}),e);var Ae={};Se(Ae,{ProductCard:()=>B,default:()=>Ne});module.exports=he(Ae);var t=require("react/jsx-runtime"),A=Ce(require("react")),n=require("../../helpers/index.js"),i=require("../../components/index.js"),G=require("./MemberLabel.js"),z=require("./styles.js");const xe=5;function Te(e,a,o,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return a===void 0?!0:o<=a;case"below-percentage":return a===void 0?!0:o/d*100<=a;default:return!0}}const ke=({items:e})=>e?.length?(0,t.jsx)("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((a,o)=>typeof a.icon=="string"?(0,t.jsx)("img",{src:a.icon,alt:a.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},o):(0,t.jsx)(i.Text,{"aria-label":a.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:a.icon},o))}):null,U={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Pe=({text:e,style:a="style1",icon:o,className:d,textClassName:c,layoutMode:h="flex",renderBadge:v})=>{if(!e)return null;const b=a==="custom",s=b&&!!v,S=b&&!v&&!!o?.url,C=b?void 0:U[a],f=U.style1,u=z.layoutModeStyles[h],x={style1:u.discountBadgeText,style2:u.discountBadgeTextStyle2,style3:u.discountBadgeTextStyle3},T=b?u.discountBadgeTextCenter:x[a];return(0,t.jsxs)("div",{className:(0,n.cn)("active-shelf-discount-badge","absolute left-0 top-0 z-10",u.discountBadgeSize,d),children:[s?v({text:e,layoutMode:h}):S?(0,t.jsx)(i.Picture,{source:o.url,alt:o.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):(0,t.jsx)("img",{src:(C??f).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!s&&(0,t.jsx)(i.Text,{className:(0,n.cn)("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",T,(C??f).textClass,c),html:e})]})},B=A.forwardRef(({product:e,className:a,showTags:o=!0,stockDisplayMode:d,stockThresholdValue:c,onLearnMore:h,onShopNow:v,onAddToCart:b,classNames:s,secondaryButtonText:S,secondaryButtonFun:C,primaryButtonText:f,primaryButtonFun:u,showOriginalPrice:x,renderOriginalPrice:T,copy:y,onProductImageClick:k,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:H,customTagsIcon:K,customTagStyle:J,onMemberSignUp:Q,onPlusMemberAddCart:W,showMemberPrice:I,layoutMode:L,renderDiscountBadge:X},Y)=>{const[Z,ee]=A.useState(!1),[te,ae]=A.useState(!1),ie=e?.memberDiscountAmount,ne=e?.plusMemberDiscountAmount,oe=e?.activityLabels??[],se=P==="guest"?"guest":"member",E=oe.find(l=>l.type===se)?.label,re=P==="guest"?y?.memberActivityLabelUnLogin:y?.memberActivityLabel,le=!!E||!!re,ce=e?.discountAmount,r=z.layoutModeStyles[L??"flex"],de=A.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?xe:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(l,g)=>{if(!l)return;const m=g==="primary"?ee:ae;m(!0);try{switch(l){case"buyNow":await v?.(e);break;case"addCart":await b?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{m(!1)}},ue=e.availableForSale&&e.quantityAvailable<=0,ge=(l,g)=>{const m=l===0?_?.firstTagVariant:l===1?_?.secondTagVariant:void 0,D=(m||void 0)??(g==="fill"?"fill":g!==void 0?"outline":l===0?"fill":"outline"),p=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...p.outline?{outlineColor:p.outline}:{},...p.bg?{backgroundColor:p.bg,backgroundImage:"none"}:{}};return D==="outline"&&p.outline&&(O.color=p.outline),{variant:D,style:O}},j=!!e.custom_bg_image,me=!!e.custom_scene_image,q=l=>l?{backgroundImage:`url(${l})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return(0,t.jsxs)(i.Card,{ref:Y,className:(0,n.cn)("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",r.cardRadius,a,s?.productCard),children:[(0,t.jsx)(Pe,{text:ce,style:J,icon:K,layoutMode:L,renderBadge:X,className:s?.discountBadge,textClassName:s?.discountBadgeText}),(0,t.jsxs)(i.CardContent,{className:(0,n.cn)(r.cardContent,"relative flex flex-1 flex-col justify-between"),children:[(0,t.jsxs)("div",{className:"product-image-wrapper group/product-image relative mb-4",children:[j&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0 z-20",r.imageOffset),style:q(e.custom_bg_image)}),me&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",r.imageOffset),style:q(e.custom_scene_image)}),(0,t.jsx)("div",{className:(0,n.cn)("product-image mx-auto cursor-pointer overflow-hidden",r.image),children:(0,t.jsx)("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:(0,n.cn)("block size-full",j&&"opacity-0"),children:(0,t.jsx)(i.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),(0,t.jsx)(ke,{items:e?.socialEndorsements})]}),o&&(0,t.jsx)("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((l,g)=>{if(!l.label)return null;const{variant:m,style:V}=ge(g,l.variant);return(0,t.jsx)(i.Badge,{size:"sm",variant:m,className:"active-shelf-items-tag py-0",style:V,children:l.label},g)})}),(0,t.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Heading,{as:"h3",size:"none",className:(0,n.cn)("text-info-primary",r.title,s?.productTitle),children:(0,t.jsx)("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("active-shelf-product-description text-info-primary",r.description,s?.productDescription),html:e.custom_description||e.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:(0,n.cn)(s?.productPrice),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-baseline",r.priceGap),children:e.availableForSale?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-primary",r.price),as:"h6",children:e.price}),T?T(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary line-through",r.price,s?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary",r.price),children:y?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&(0,t.jsx)("div",{className:(0,n.cn)("min-h-[1lh]",r.priceLabel),children:(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("text-brand-0",s?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),(0,t.jsxs)("div",{className:(0,n.cn)("mt-2 flex",r.buttonContainer,s?.buttonGroup),children:[S&&(0,t.jsx)(i.Button,{variant:"secondary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.secondaryButton),onClick:()=>F(C,"secondary"),disabled:!e.availableForSale&&C!=="learnMore",loading:te,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${S}`,"data-headless-sku":e.sku,children:S}),f&&(0,t.jsx)(i.Button,{variant:"primary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.primaryButton),onClick:()=>F(u,"primary"),disabled:!e.availableForSale&&u!=="learnMore",loading:Z,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f})]}),Te(d,c,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,t.jsx)(i.Progress,{value:de,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",s?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",s?.stockBar)}}),(0,t.jsx)(i.Text,{size:3,className:"text-info-tertiary text-[14px]",children:ue?y?.limitedStock:y?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&(0,t.jsx)(G.MemberLabel,{userType:P,copy:y,images:H,onSignUp:Q,onPlusMemberAddCart:W,hasActivity:le,activityLabel:E,memberDiscountAmount:ie,plusMemberDiscountAmount:ne,layoutMode:L})]})});B.displayName="ActiveShelf.ProductCard";var Ne=B;
1
+ "use strict";"use client";var be=Object.create;var N=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Se=(e,a)=>{for(var o in a)N(e,o,{get:a[o],enumerable:!0})},$=(e,a,o,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of ye(a))!ve.call(e,c)&&c!==o&&N(e,c,{get:()=>a[c],enumerable:!(d=fe(a,c))||d.enumerable});return e};var Ce=(e,a,o)=>(o=e!=null?be(pe(e)):{},$(a||!e||!e.__esModule?N(o,"default",{value:e,enumerable:!0}):o,e)),he=e=>$(N({},"__esModule",{value:!0}),e);var Ae={};Se(Ae,{ProductCard:()=>B,default:()=>Ne});module.exports=he(Ae);var t=require("react/jsx-runtime"),A=Ce(require("react")),n=require("../../helpers/index.js"),i=require("../../components/index.js"),G=require("./MemberLabel.js"),z=require("./styles.js");const xe=5;function ke(e,a,o,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return a===void 0?!0:o<=a;case"below-percentage":return a===void 0?!0:o/d*100<=a;default:return!0}}const Te=({items:e})=>e?.length?(0,t.jsx)("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((a,o)=>typeof a.icon=="string"?(0,t.jsx)("img",{src:a.icon,alt:a.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},o):(0,t.jsx)(i.Text,{"aria-label":a.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:a.icon},o))}):null,U={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Pe=({text:e,style:a="style1",icon:o,className:d,textClassName:c,layoutMode:h="flex",renderBadge:v})=>{if(!e)return null;const b=a==="custom",s=b&&!!v,S=b&&!v&&!!o?.url,C=b?void 0:U[a],f=U.style1,u=z.layoutModeStyles[h],x={style1:u.discountBadgeText,style2:u.discountBadgeTextStyle2,style3:u.discountBadgeTextStyle3},k=b?u.discountBadgeTextCenter:x[a];return(0,t.jsxs)("div",{className:(0,n.cn)("active-shelf-discount-badge","absolute left-0 top-0 z-10",u.discountBadgeSize,d),children:[s?v({text:e,layoutMode:h}):S?(0,t.jsx)(i.Picture,{source:o.url,alt:o.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):(0,t.jsx)("img",{src:(C??f).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!s&&(0,t.jsx)(i.Text,{className:(0,n.cn)("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",k,(C??f).textClass,c),html:e})]})},B=A.forwardRef(({product:e,className:a,showTags:o=!0,stockDisplayMode:d,stockThresholdValue:c,onLearnMore:h,onShopNow:v,onAddToCart:b,classNames:s,secondaryButtonText:S,secondaryButtonFun:C,primaryButtonText:f,primaryButtonFun:u,showOriginalPrice:x,renderOriginalPrice:k,copy:y,onProductImageClick:T,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:H,customTagsIcon:K,customTagStyle:J,onMemberSignUp:Q,onPlusMemberAddCart:W,showMemberPrice:I,layoutMode:L,renderDiscountBadge:X},Y)=>{const[Z,ee]=A.useState(!1),[te,ae]=A.useState(!1),ie=e?.memberDiscountAmount,ne=e?.plusMemberDiscountAmount,oe=e?.activityLabels??[],se=P==="guest"?"guest":"member",E=oe.find(l=>l.type===se)?.label,re=P==="guest"?y?.memberActivityLabelUnLogin:y?.memberActivityLabel,le=!!E||!!re,ce=e?.discountAmount,r=z.layoutModeStyles[L??"flex"],de=A.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?xe:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(l,g)=>{if(!l)return;const m=g==="primary"?ee:ae;m(!0);try{switch(l){case"buyNow":await v?.(e);break;case"addCart":await b?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{m(!1)}},ue=e.availableForSale&&e.quantityAvailable<=0,ge=(l,g)=>{const m=l===0?_?.firstTagVariant:l===1?_?.secondTagVariant:void 0,D=(m||void 0)??(g==="fill"?"fill":g!==void 0?"outline":l===0?"fill":"outline"),p=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...p.outline?{outlineColor:p.outline}:{},...p.bg?{backgroundColor:p.bg,backgroundImage:"none"}:{}};return D==="outline"&&p.outline&&(O.color=p.outline),{variant:D,style:O}},j=!!e.custom_bg_image,me=!!e.custom_scene_image,q=l=>l?{backgroundImage:`url(${l})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return(0,t.jsxs)(i.Card,{ref:Y,className:(0,n.cn)("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",r.cardRadius,a,s?.productCard),children:[(0,t.jsx)(Pe,{text:ce,style:J,icon:K,layoutMode:L,renderBadge:X,className:s?.discountBadge,textClassName:s?.discountBadgeText}),(0,t.jsxs)(i.CardContent,{className:(0,n.cn)(r.cardContent,"relative flex flex-1 flex-col justify-between"),children:[(0,t.jsxs)("div",{className:"product-image-wrapper group/product-image laptop:pb-2 laptop:mb-4 desktop:pb-6 desktop:mb-4 relative pb-4",children:[j&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0 z-20",r.imageOffset),style:q(e.custom_bg_image)}),me&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",r.imageOffset),style:q(e.custom_scene_image)}),(0,t.jsx)("div",{className:(0,n.cn)("product-image mx-auto cursor-pointer overflow-hidden",r.image),children:(0,t.jsx)("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:(0,n.cn)("block size-full",j&&"opacity-0"),children:(0,t.jsx)(i.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),(0,t.jsx)(Te,{items:e?.socialEndorsements})]}),o&&(0,t.jsx)("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((l,g)=>{if(!l.label)return null;const{variant:m,style:V}=ge(g,l.variant);return(0,t.jsx)(i.Badge,{size:"sm",variant:m,className:"active-shelf-items-tag py-0",style:V,children:l.label},g)})}),(0,t.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Heading,{as:"h3",size:"none",className:(0,n.cn)("text-info-primary",r.title,s?.productTitle),children:(0,t.jsx)("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("active-shelf-product-description text-info-primary",r.description,s?.productDescription),html:e.custom_description||e.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:(0,n.cn)(s?.productPrice),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-baseline",r.priceGap),children:e.availableForSale?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-primary",r.price),as:"h6",children:e.price}),k?k(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary line-through",r.price,s?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary",r.price),children:y?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&(0,t.jsx)("div",{className:(0,n.cn)("min-h-[1lh]",r.priceLabel),children:(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("text-brand-0",s?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),(0,t.jsxs)("div",{className:(0,n.cn)("mt-2 flex",r.buttonContainer,s?.buttonGroup),children:[S&&(0,t.jsx)(i.Button,{variant:"secondary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.secondaryButton),onClick:()=>F(C,"secondary"),disabled:!e.availableForSale&&C!=="learnMore",loading:te,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${S}`,"data-headless-sku":e.sku,children:S}),f&&(0,t.jsx)(i.Button,{variant:"primary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.primaryButton),onClick:()=>F(u,"primary"),disabled:!e.availableForSale&&u!=="learnMore",loading:Z,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f})]}),ke(d,c,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,t.jsx)(i.Progress,{value:de,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",s?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",s?.stockBar)}}),(0,t.jsx)(i.Text,{size:3,className:"text-info-tertiary text-[14px]",children:ue?y?.limitedStock:y?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&(0,t.jsx)(G.MemberLabel,{userType:P,copy:y,images:H,onSignUp:Q,onPlusMemberAddCart:W,hasActivity:le,activityLabel:E,memberDiscountAmount:ie,plusMemberDiscountAmount:ne,layoutMode:L})]})});B.displayName="ActiveShelf.ProductCard";var Ne=B;
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},n=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!d.call(e,p)&&p!==o&&l(e,p,{get:()=>t[p],enumerable:!(a=x(t,p))||a.enumerable});return e};var g=e=>n(l({},"__esModule",{value:!0}),e);var c={};i(c,{layoutModeStyles:()=>r});module.exports=g(c);const r={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-6 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 desktop:-top-6 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};
1
+ "use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},n=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!d.call(e,p)&&p!==o&&l(e,p,{get:()=>t[p],enumerable:!(a=x(t,p))||a.enumerable});return e};var g=e=>n(l({},"__esModule",{value:!0}),e);var c={};i(c,{layoutModeStyles:()=>r});module.exports=g(c);const r={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};
@@ -1 +1 @@
1
- "use strict";"use client";var C=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var i in e)f(t,i,{get:e[i],enumerable:!0})},A=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of D(e))!P.call(t,o)&&o!==i&&f(t,o,{get:()=>e[o],enumerable:!(l=z(e,o))||l.enumerable});return t};var L=(t,e,i)=>(i=t!=null?C(H(t)):{},A(e||!t||!t.__esModule?f(i,"default",{value:t,enumerable:!0}):i,t)),B=t=>A(f({},"__esModule",{value:!0}),t);var _={};w(_,{default:()=>j});module.exports=B(_);var s=require("react/jsx-runtime"),d=L(require("react")),a=require("../../components/index.js"),O=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),T=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js"),k=require("class-variance-authority"),y=require("../../helpers/index.js"),V=require("../AiuiProvider/index.js");const h="image",v="activity_mechanism",M=(0,k.cva)("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=(0,k.cva)("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),E=(0,k.cva)("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),g={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},S=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${g.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${g.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${g.tablet}`),t.default?.url&&e.push(`${t.default.url} ${g.default}`),e.join(", ")},b=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",F=({item:t,theme:e,classNames:i})=>{const{title:l,description:o,linkText:n,linkHref:c,backgroundImage:m}=t,p=S(m),u=b(m),{locale:$="us"}=(0,V.useAiuiContext)();return(0,s.jsx)("div",{className:(0,r.cn)("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:[400px]",i?.card),"data-headless-type-name":`${h}#${v}`,children:c?(0,s.jsxs)(a.Link,{href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:"no-underline",children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o}),n&&(0,s.jsx)(a.Button,{variant:"link",as:"a",href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:(0,r.cn)(E({theme:e}),i?.link),"data-headless-title-desc-button":`${l}#${o}#${n}`,children:n})]})]}):(0,s.jsxs)(s.Fragment,{children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o})]})]})})},N=d.default.forwardRef(({data:t,classNames:e},i)=>{const{items:l=[],theme:o="light"}=t,n=(0,d.useRef)(null);if((0,d.useImperativeHandle)(i,()=>n.current),(0,T.useExposure)(n,{componentType:h,componentName:v,componentTitle:l[0]?.title||"",componentDescription:l[0]?.description||""}),!l||l.length===0)return null;const c={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},m=c[Math.min(l.length,4)]||c[4];return(0,s.jsx)(a.Container,{"data-ui-component-id":"ActivityMechanism",className:(0,r.cn)("activity-mechanism","w-full",e?.root),ref:n,children:(0,s.jsx)("div",{className:(0,r.cn)("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",m,e?.grid),children:l.map((p,u)=>(0,s.jsx)(F,{item:p,theme:o,classNames:{...e,...l?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${p.title}-${u}`))})})});N.displayName="ActivityMechanism";var j=N;
1
+ "use strict";"use client";var C=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var i in e)f(t,i,{get:e[i],enumerable:!0})},A=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of D(e))!P.call(t,o)&&o!==i&&f(t,o,{get:()=>e[o],enumerable:!(l=z(e,o))||l.enumerable});return t};var L=(t,e,i)=>(i=t!=null?C(H(t)):{},A(e||!t||!t.__esModule?f(i,"default",{value:t,enumerable:!0}):i,t)),B=t=>A(f({},"__esModule",{value:!0}),t);var _={};w(_,{default:()=>j});module.exports=B(_);var s=require("react/jsx-runtime"),d=L(require("react")),a=require("../../components/index.js"),O=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),T=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js"),k=require("class-variance-authority"),y=require("../../helpers/index.js"),V=require("../AiuiProvider/index.js");const h="image",v="activity_mechanism",M=(0,k.cva)("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=(0,k.cva)("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),E=(0,k.cva)("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),g={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},S=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${g.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${g.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${g.tablet}`),t.default?.url&&e.push(`${t.default.url} ${g.default}`),e.join(", ")},b=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",F=({item:t,theme:e,classNames:i})=>{const{title:l,description:o,linkText:n,linkHref:c,backgroundImage:m}=t,p=S(m),u=b(m),{locale:$="us"}=(0,V.useAiuiContext)();return(0,s.jsx)("div",{className:(0,r.cn)("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:h-[400px]",i?.card),"data-headless-type-name":`${h}#${v}`,children:c?(0,s.jsxs)(a.Link,{href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:"no-underline",children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o}),n&&(0,s.jsx)(a.Button,{variant:"link",as:"a",href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:(0,r.cn)(E({theme:e}),i?.link),"data-headless-title-desc-button":`${l}#${o}#${n}`,children:n})]})]}):(0,s.jsxs)(s.Fragment,{children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o})]})]})})},N=d.default.forwardRef(({data:t,classNames:e},i)=>{const{items:l=[],theme:o="light"}=t,n=(0,d.useRef)(null);if((0,d.useImperativeHandle)(i,()=>n.current),(0,T.useExposure)(n,{componentType:h,componentName:v,componentTitle:l[0]?.title||"",componentDescription:l[0]?.description||""}),!l||l.length===0)return null;const c={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},m=c[Math.min(l.length,4)]||c[4];return(0,s.jsx)(a.Container,{"data-ui-component-id":"ActivityMechanism",className:(0,r.cn)("activity-mechanism","w-full",e?.root),ref:n,children:(0,s.jsx)("div",{className:(0,r.cn)("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",m,e?.grid),children:l.map((p,u)=>(0,s.jsx)(F,{item:p,theme:o,classNames:{...e,...l?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${p.title}-${u}`))})})});N.displayName="ActivityMechanism";var j=N;
@@ -81,6 +81,15 @@ interface AiuiContextType {
81
81
  * @example { 'eu-pl': 'pl-PL', 'eu-pt': 'pt-PT' }
82
82
  */
83
83
  localeMap?: Record<string, string>;
84
+ /**
85
+ * 导航折叠状态(HeaderNavigation 内容驱动测量结果),供 Board 等兄弟组件视觉联动。
86
+ * HeaderNavigation 在内部测量后写入,Board 读取以控制 leftIcon 显隐。
87
+ */
88
+ navCollapsed?: boolean;
89
+ /**
90
+ * 设置导航折叠状态。仅供 HeaderNavigation 内部写入,消费方无需关心。
91
+ */
92
+ setNavCollapsed?: (_collapsed: boolean) => void;
84
93
  }
85
94
  export declare const AiuiContext: React.Context<AiuiContextType>;
86
95
  export declare const useAiuiContext: () => AiuiContextType;
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var i in t)l(e,i,{get:t[i],enumerable:!0})},T=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!C.call(e,a)&&a!==i&&l(e,a,{get:()=>t[a],enumerable:!(c=A(t,a))||c.enumerable});return e};var _=e=>T(l({},"__esModule",{value:!0}),e);var L={};D(L,{AiuiContext:()=>d,default:()=>R,useAiuiContext:()=>M});module.exports=_(L);var m=require("react/jsx-runtime"),v=require("../../shared/track.js"),n=require("react"),h=require("../../helpers/index.js");const d=(0,n.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),M=()=>{const e=(0,n.useContext)(d);if(!e)throw new Error("useAiui must be used in <AiuiProvider>");return e},P=({children:e,...t})=>{const i=(0,n.useRef)(null),c=(0,n.useRef)(t?.trackingData);return(0,n.useEffect)(()=>{t.localeMap&&Object.keys(t.localeMap).length>0&&(0,h.extendLocaleMap)(t.localeMap)},[t.localeMap]),(0,n.useEffect)(()=>{c.current=t?.trackingData},[t?.trackingData]),(0,n.useEffect)(()=>{const a=i.current;if(!a)return;const g=(o,r)=>{const s={};if(!r||!r.attributes)return s;for(const x of Array.from(r.attributes)){const u=x?.name;u?.startsWith("data-headless-")&&(s[u]=r.getAttribute(u))}const k=s?.["data-headless-sku"],f=s?.["data-headless-type-name"]?.split?.("#"),p=s?.["data-headless-title-desc-button"]?.split?.("#"),b=s?.["data-headless-nav-position"]?.split?.("#");(0,v.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:c.current?.pageGroup||"Home Page",component_type:f?.[0]||"",component_name:f?.[1]||"",position:b?.[1]||"",navigation:b?.[0]||"",button_name:p?.[2]||"",SKU:k||"",component_title:p?.[0]||"",component_description:p?.[1]||""}})},y=new MutationObserver(()=>{a.querySelectorAll("[data-headless-type-name]").forEach(o=>{o.hasAttribute("data-headless-track-bound")||(o.addEventListener("click",r=>g(r,o)),o.setAttribute("data-headless-track-bound","true"))})});return y.observe(a,{childList:!0,subtree:!0}),a.querySelectorAll("[data-headless-type-name]").forEach(o=>{o.hasAttribute("data-headless-track-bound")||(o.addEventListener("click",r=>g(r,o)),o.setAttribute("data-headless-track-bound","true"))}),()=>y.disconnect()},[]),(0,m.jsx)(d.Provider,{value:t,children:(0,m.jsx)("div",{ref:i,children:e})})};var R=P;
1
+ "use strict";var d=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var M=(a,e)=>{for(var i in e)d(a,i,{get:e[i],enumerable:!0})},P=(a,e,i,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of T(e))!_.call(a,o)&&o!==i&&d(a,o,{get:()=>e[o],enumerable:!(c=D(e,o))||c.enumerable});return a};var R=a=>P(d({},"__esModule",{value:!0}),a);var S={};M(S,{AiuiContext:()=>m,default:()=>O,useAiuiContext:()=>L});module.exports=R(S);var g=require("react/jsx-runtime"),h=require("../../shared/track.js"),t=require("react"),k=require("../../helpers/index.js");const m=(0,t.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),L=()=>{const a=(0,t.useContext)(m);if(!a)throw new Error("useAiui must be used in <AiuiProvider>");return a},N=({children:a,...e})=>{const i=(0,t.useRef)(null),c=(0,t.useRef)(e?.trackingData),[o,x]=(0,t.useState)(!1);(0,t.useEffect)(()=>{e.localeMap&&Object.keys(e.localeMap).length>0&&(0,k.extendLocaleMap)(e.localeMap)},[e.localeMap]),(0,t.useEffect)(()=>{c.current=e?.trackingData},[e?.trackingData]),(0,t.useEffect)(()=>{const p=i.current;if(!p)return;const y=(n,r)=>{const s={};if(!r||!r.attributes)return s;for(const E of Array.from(r.attributes)){const u=E?.name;u?.startsWith("data-headless-")&&(s[u]=r.getAttribute(u))}const A=s?.["data-headless-sku"],b=s?.["data-headless-type-name"]?.split?.("#"),l=s?.["data-headless-title-desc-button"]?.split?.("#"),f=s?.["data-headless-nav-position"]?.split?.("#");(0,h.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:c.current?.pageGroup||"Home Page",component_type:b?.[0]||"",component_name:b?.[1]||"",position:f?.[1]||"",navigation:f?.[0]||"",button_name:l?.[2]||"",SKU:A||"",component_title:l?.[0]||"",component_description:l?.[1]||""}})},v=new MutationObserver(()=>{p.querySelectorAll("[data-headless-type-name]").forEach(n=>{n.hasAttribute("data-headless-track-bound")||(n.addEventListener("click",r=>y(r,n)),n.setAttribute("data-headless-track-bound","true"))})});return v.observe(p,{childList:!0,subtree:!0}),p.querySelectorAll("[data-headless-type-name]").forEach(n=>{n.hasAttribute("data-headless-track-bound")||(n.addEventListener("click",r=>y(r,n)),n.setAttribute("data-headless-track-bound","true"))}),()=>v.disconnect()},[]);const C=(0,t.useMemo)(()=>({...e,navCollapsed:o,setNavCollapsed:x}),[e,o]);return(0,g.jsx)(m.Provider,{value:C,children:(0,g.jsx)("div",{ref:i,children:a})})};var O=N;
@@ -1 +1 @@
1
- "use strict";"use client";var x=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of b(l))!h.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(d=v(l,a))||d.enumerable});return e};var k=(e,l,o)=>(o=e!=null?x(g(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),M=e=>n(p({},"__esModule",{value:!0}),e);var T={};w(T,{default:()=>I});module.exports=M(T);var t=require("react/jsx-runtime"),r=require("../../helpers/utils.js"),c=k(require("../SwiperBox/index.js")),f=require("../../shared/Styles.js"),m=require("../../components/grid.js"),i=require("../../components/index.js");const N=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(i.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[(0,t.jsx)(i.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(i.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),y=({data:e,className:l,...o})=>{const{productsTab:d,shape:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...o,className:(0,r.cn)("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",l),children:(0,t.jsx)(m.Grid,{className:(0,r.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",l),children:d?.map((s,u)=>(0,t.jsxs)(m.GridItem,{span:s.span,className:(0,r.cn)("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":s.theme==="dark"}),children:[(0,t.jsx)(i.Picture,{source:s.img.url,className:"size-full",imgClassName:"h-full object-cover"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[s.title&&(0,t.jsx)(i.Text,{html:s.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold"}),s.description&&(0,t.jsx)(i.Text,{html:s.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold"})]})]},u))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,r.cn)("!overflow-visible",l),data:{list:d||[],configuration:{shape:a}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var I=(0,f.withLayout)(y);
1
+ "use strict";"use client";var x=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of v(l))!h.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(d=g(l,a))||d.enumerable});return e};var k=(e,l,o)=>(o=e!=null?x(b(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),M=e=>n(p({},"__esModule",{value:!0}),e);var T={};w(T,{default:()=>I});module.exports=M(T);var t=require("react/jsx-runtime"),r=require("../../helpers/utils.js"),c=k(require("../SwiperBox/index.js")),f=require("../../shared/Styles.js"),m=require("../../components/grid.js"),i=require("../../components/index.js");const N=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(i.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[(0,t.jsx)(i.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(i.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),y=({data:e,className:l,...o})=>{const{productsTab:d,shape:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...o,className:(0,r.cn)("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",l),children:(0,t.jsx)(m.Grid,{className:(0,r.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",l),children:d?.map((s,u)=>(0,t.jsxs)(m.GridItem,{span:s.span,className:(0,r.cn)("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":s.theme==="dark"}),children:[(0,t.jsx)(i.Picture,{source:s.img.url,className:"size-full",imgClassName:"h-full object-cover"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[s.title&&(0,t.jsx)(i.Text,{html:s.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold !leading-tight"}),s.description&&(0,t.jsx)(i.Text,{html:s.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold !leading-normal"})]})]},u))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,r.cn)("!overflow-visible",l),data:{list:d||[],configuration:{shape:a}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var I=(0,f.withLayout)(y);
@@ -1 +1 @@
1
- "use strict";var L=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(t,l)=>{for(var s in l)y(t,s,{get:l[s],enumerable:!0})},w=(t,l,s,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of S(l))!A.call(t,i)&&i!==s&&y(t,i,{get:()=>l[i],enumerable:!(p=D(l,i))||p.enumerable});return t};var T=(t,l,s)=>(s=t!=null?L(z(t)):{},w(l||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),P=t=>w(y({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=P(R);var e=require("react/jsx-runtime"),m=require("react"),o=require("../../components/index.js"),M=T(require("../Subscribe/index.js")),k=require("./types.js"),x=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),F=require("../../shared/Styles.js");const $=({data:{footer:t}={},currentCountry:l,event:s,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...u})=>{const[f,c]=(0,m.useState)(!1),g=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{c(g)},[g]);const h=(0,m.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...u,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:s?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:s,currentCountry:l,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:s,isMobile:f,currentCountry:l,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:l,subscribeLoading:s,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:s}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(n?.link,i,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:l,isMobile:s,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,b.useAiuiContext)(),[r,u]=(0,m.useState)(!1),{services:f,mainNav:c,country:g}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(v,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(v,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(v,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),s&&(0,e.jsx)("button",{onClick:()=>u(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&s||!s)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:s,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:l,event:s,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,u)=>(0,e.jsxs)(m.Fragment,{children:[u<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(o.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},u))]})}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:s?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:s?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},v=({title:t,lists:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)(),[i,n]=(0,m.useState)(!1),[r,u]=(0,m.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{u(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:l?.map(g=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(o.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},B=({title:t,apps:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)();return l?.length?(0,e.jsxs)("div",{className:s,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:l?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:l,className:s,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),l&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,F.withLayout)($);
1
+ "use strict";var L=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(t,l)=>{for(var s in l)y(t,s,{get:l[s],enumerable:!0})},w=(t,l,s,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of S(l))!A.call(t,i)&&i!==s&&y(t,i,{get:()=>l[i],enumerable:!(p=D(l,i))||p.enumerable});return t};var T=(t,l,s)=>(s=t!=null?L(z(t)):{},w(l||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),P=t=>w(y({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=P(R);var e=require("react/jsx-runtime"),m=require("react"),o=require("../../components/index.js"),M=T(require("../Subscribe/index.js")),k=require("./types.js"),x=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),F=require("../../shared/Styles.js");const $=({data:{footer:t}={},currentCountry:l,event:s,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...u})=>{const[f,c]=(0,m.useState)(!1),g=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{c(g)},[g]);const h=(0,m.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...u,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:s?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:s,currentCountry:l,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:s,isMobile:f,currentCountry:l,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:l,subscribeLoading:s,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:s}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(n?.link,i,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:l,isMobile:s,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,b.useAiuiContext)(),[r,u]=(0,m.useState)(!1),{services:f,mainNav:c,country:g}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(v,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(v,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(v,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),s&&(0,e.jsx)("button",{onClick:()=>u(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&s||!s)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:s,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:l,event:s,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,u)=>(0,e.jsxs)(m.Fragment,{children:[u<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(o.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},u))]})}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:s?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:s?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},v=({title:t,lists:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)(),[i,n]=(0,m.useState)(!1),[r,u]=(0,m.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{u(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:l?.map(g=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(o.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},B=({title:t,apps:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)();return l?.length?(0,e.jsxs)("div",{className:s,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:l?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:l,className:s,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),l&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,F.withLayout)($);
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * 移动端菜单项
3
3
  */
4
- export declare const MenuItem: ({ label, href, onClick, active, icon, className, }: {
4
+ export declare const MenuItem: ({ label, href, target, onClick, active, icon, className, }: {
5
5
  label: string;
6
6
  href?: string;
7
+ target?: string;
7
8
  onClick?: () => void;
8
9
  active?: boolean;
9
10
  icon?: string;
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var x=(t,l)=>{for(var n in l)b(t,n,{get:l[n],enumerable:!0})},v=(t,l,n,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of f(l))!g.call(t,i)&&i!==n&&b(t,i,{get:()=>l[i],enumerable:!(r=u(l,i))||r.enumerable});return t};var h=t=>v(b({},"__esModule",{value:!0}),t);var w={};x(w,{MenuItem:()=>N,SubSubCategoryContentComp:()=>k,SubSubCategoryItemComp:()=>y});module.exports=h(w);var e=require("react/jsx-runtime"),L=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),p=require("./icons/index.js"),c=require("./SidebarDropdown.js"),d=require("../AiuiProvider/index.js");const N=({label:t,href:l,onClick:n,active:r,icon:i,className:a})=>{const m=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(o.Text,{html:t,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{underline:i})}),i&&(0,e.jsx)(o.Text,{html:i,"aria-hidden":"true"})]}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return l?(0,e.jsx)(o.Link,{href:l,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",a),onClick:n,children:m}):(0,e.jsx)("button",{onClick:n,className:(0,s.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",a),"aria-expanded":r,children:m})},y=({matchSeriesMetadata:t,onSubSubCategoryItemClick:l,expanded:n})=>{const r=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(o.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(p.DownArrow,{"aria-hidden":"true",className:(0,s.cn)("size-5",{"rotate-180":n})})]});return l?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:l,"aria-expanded":n,children:r}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:r})},k=({matchSeriesMetadata:t})=>{const{locale:l="us"}=(0,d.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((n,r)=>(0,e.jsxs)("div",{children:[n.label&&(0,e.jsx)(o.Text,{html:n.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(o.Link,{asChild:!t?.banner?.href,href:(0,s.getLocalizedPath)(t?.banner?.href,l),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,s.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,s.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),n.products?.map((i,a)=>(0,e.jsx)(c.SeriesProductItem,{position:a,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n?.label||""}-${r}-${a}`))]})]},`seriesItem-${n?.label||""}-${r}`))})};
1
+ "use strict";var b=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var v=(t,n)=>{for(var l in n)b(t,l,{get:n[l],enumerable:!0})},h=(t,n,l,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of g(n))!x.call(t,i)&&i!==l&&b(t,i,{get:()=>n[i],enumerable:!(r=f(n,i))||r.enumerable});return t};var N=t=>h(b({},"__esModule",{value:!0}),t);var C={};v(C,{MenuItem:()=>k,SubSubCategoryContentComp:()=>y,SubSubCategoryItemComp:()=>w});module.exports=N(C);var e=require("react/jsx-runtime"),$=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),p=require("./icons/index.js"),c=require("./SidebarDropdown.js"),u=require("../AiuiProvider/index.js");const k=({label:t,href:n,target:l,onClick:r,active:i,icon:a,className:d})=>{const m=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(o.Text,{html:t,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{underline:a})}),a&&(0,e.jsx)(o.Text,{html:a,"aria-hidden":"true"})]}),(0,e.jsx)("svg",{className:`size-5 ${i?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return n?(0,e.jsx)(o.Link,{href:n,target:l,rel:l==="_blank"?"noopener noreferrer":void 0,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",d),onClick:r,children:m}):(0,e.jsx)("button",{onClick:r,className:(0,s.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",d),"aria-expanded":i,children:m})},w=({matchSeriesMetadata:t,onSubSubCategoryItemClick:n,expanded:l})=>{const r=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(o.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),n&&(0,e.jsx)(p.DownArrow,{"aria-hidden":"true",className:(0,s.cn)("size-5",{"rotate-180":l})})]});return n?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":l,children:r}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:r})},y=({matchSeriesMetadata:t})=>{const{locale:n="us"}=(0,u.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((l,r)=>(0,e.jsxs)("div",{children:[l.label&&(0,e.jsx)(o.Text,{html:l.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(o.Link,{asChild:!t?.banner?.href,href:(0,s.getLocalizedPath)(t?.banner?.href,n,"ref=navMenu"),children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,s.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,s.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),l.products?.map((i,a)=>(0,e.jsx)(c.SeriesProductItem,{position:a,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${l?.label||""}-${r}-${a}`))]})]},`seriesItem-${l?.label||""}-${r}`))})};
@@ -1 +1 @@
1
- "use strict";var C=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var _=(a,n)=>{for(var r in n)C(a,r,{get:n[r],enumerable:!0})},A=(a,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of B(n))!E.call(a,l)&&l!==r&&C(a,l,{get:()=>n[l],enumerable:!(i=z(n,l))||i.enumerable});return a};var I=a=>A(C({},"__esModule",{value:!0}),a);var F={};_(F,{MobileResourceSidebarMenu:()=>T});module.exports=I(F);var e=require("react/jsx-runtime"),s=require("react"),x=require("../../components/index.js"),m=require("./types.js"),k=require("./NavProvider.js"),b=require("./ResourceItem.js"),M=require("../AiuiProvider/index.js"),h=require("../../helpers/utils.js");const K=({label:a,onClick:n,active:r})=>(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-1",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:a})}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]}),T=({resourceCategoriesMetadata:a,resourcesMetadata:n})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:S,onSidebarNavClick:d,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,k.useNavContext)(),{locale:y="us"}=(0,M.useAiuiContext)(),[w,L]=(0,s.useState)([]),[g,R]=(0,s.useState)([]);(0,s.useEffect)(()=>{a?.subcategories?.length&&L(a?.subcategories?.map((o,t)=>({index:t,open:!1})))},[a]),(0,s.useEffect)(()=>{l?.subSubCategories?.length&&R(l?.subSubCategories?.map((o,t)=>({index:t,open:t===0})))},[l]);const N=(0,s.useCallback)(o=>{S?.(o);const t=n?.find(c=>o?.label?.toLowerCase()===c.label?.toLowerCase())||{};i&&i(m.HeaderNavigationMenu.Third),f&&f(t)},[n,i,S,f]);return(0,s.useMemo)(()=>{switch(r){case m.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsx)("div",{children:a?.subcategories?.map((o,t)=>(0,e.jsx)("div",{children:(0,e.jsx)(K,{label:o?.label,active:w.find(c=>c.index===t)?.open,onClick:()=>{N(o),d?.(o,t)}})},`${o.label}-${t}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(x.Button,{as:"a",href:`${(0,h.getLocalizedPath)(a?.primary?.url,y)}?ref=${a?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(x.Button,{as:"a",href:(0,h.getLocalizedPath)(a?.secondary?.url,y),variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case m.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:l?.subSubCategories?l?.subSubCategories?.map((o,t)=>{const c=n?.find(u=>u.label.toLowerCase()===o?.label?.toLowerCase())||{};return(0,e.jsxs)("div",{children:[Reflect.ownKeys(o).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:c,onSubSubCategoryItemClick:()=>{d?.(o,t),R(u=>u.map((v,$)=>({...v,open:$===t?!v.open:v.open})))},expanded:!!g?.find(u=>u.index===t)?.open}),g?.find(u=>u.index===t)?.open&&(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:c})]},`${o.label}-${t}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:p}),(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:p})]})});default:return null}},[r,a,n,w,g,l,p,N,d,y])};
1
+ "use strict";var C=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var _=(a,n)=>{for(var r in n)C(a,r,{get:n[r],enumerable:!0})},A=(a,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of B(n))!E.call(a,l)&&l!==r&&C(a,l,{get:()=>n[l],enumerable:!(i=z(n,l))||i.enumerable});return a};var I=a=>A(C({},"__esModule",{value:!0}),a);var F={};_(F,{MobileResourceSidebarMenu:()=>T});module.exports=I(F);var e=require("react/jsx-runtime"),s=require("react"),x=require("../../components/index.js"),m=require("./types.js"),k=require("./NavProvider.js"),b=require("./ResourceItem.js"),M=require("../AiuiProvider/index.js"),h=require("../../helpers/utils.js");const K=({label:a,onClick:n,active:r})=>(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-1",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:a})}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]}),T=({resourceCategoriesMetadata:a,resourcesMetadata:n})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:S,onSidebarNavClick:d,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,k.useNavContext)(),{locale:y="us"}=(0,M.useAiuiContext)(),[w,L]=(0,s.useState)([]),[v,R]=(0,s.useState)([]);(0,s.useEffect)(()=>{a?.subcategories?.length&&L(a?.subcategories?.map((o,t)=>({index:t,open:!1})))},[a]),(0,s.useEffect)(()=>{l?.subSubCategories?.length&&R(l?.subSubCategories?.map((o,t)=>({index:t,open:t===0})))},[l]);const N=(0,s.useCallback)(o=>{S?.(o);const t=n?.find(c=>o?.label?.toLowerCase()===c.label?.toLowerCase())||{};i&&i(m.HeaderNavigationMenu.Third),f&&f(t)},[n,i,S,f]);return(0,s.useMemo)(()=>{switch(r){case m.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsx)("div",{children:a?.subcategories?.map((o,t)=>(0,e.jsx)("div",{children:(0,e.jsx)(K,{label:o?.label,active:w.find(c=>c.index===t)?.open,onClick:()=>{N(o),d?.(o,t)}})},`${o.label}-${t}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(x.Button,{as:"a",href:(0,h.getLocalizedPath)(a?.primary?.url,y,`ref=${a?.primary?.label}_shopall`),variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(x.Button,{as:"a",href:(0,h.getLocalizedPath)(a?.secondary?.url,y,"ref=navMenu"),variant:"link",size:"lg",className:"link-btn tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case m.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:l?.subSubCategories?l?.subSubCategories?.map((o,t)=>{const c=n?.find(u=>u.label.toLowerCase()===o?.label?.toLowerCase())||{};return(0,e.jsxs)("div",{children:[Reflect.ownKeys(o).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:c,onSubSubCategoryItemClick:()=>{d?.(o,t),R(u=>u.map((g,$)=>({...g,open:$===t?!g.open:g.open})))},expanded:!!v?.find(u=>u.index===t)?.open}),v?.find(u=>u.index===t)?.open&&(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:c})]},`${o.label}-${t}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:p}),(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:p})]})});default:return null}},[r,a,n,w,v,l,p,N,d,y])};
@@ -1 +1 @@
1
- "use strict";var w=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var D=(a,n)=>{for(var m in n)w(a,m,{get:n[m],enumerable:!0})},K=(a,n,m,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of R(n))!T.call(a,o)&&o!==m&&w(a,o,{get:()=>n[o],enumerable:!(d=E(n,o))||d.enumerable});return a};var P=a=>K(w({},"__esModule",{value:!0}),a);var F={};D(F,{MobileSidebarMenu:()=>A});module.exports=P(F);var e=require("react/jsx-runtime"),i=require("react"),u=require("../../components/index.js"),v=require("./types.js"),z=require("./NavProvider.js"),b=require("./MobileMenuComponents.js"),B=require("../AiuiProvider/index.js"),f=require("../../helpers/utils.js");const A=({sidebarCategoriesMetadata:a,seriesMetadata:n})=>{const{currentMenu:m,setCurrentMenu:d,subSubCategory:o,setSubSubCategory:N,setCurrentSeriesMetadata:g,currentSeriesMetadata:p,buildProps:S,onSidebarNavClick:h}=(0,z.useNavContext)(),{locale:y="us"}=(0,B.useAiuiContext)(),[k,M]=(0,i.useState)([]),[x,L]=(0,i.useState)([]);(0,i.useEffect)(()=>{a?.subcategories?.length&&M(a?.subcategories?.map((l,r)=>({index:r,open:!1})))},[a]),(0,i.useEffect)(()=>{o?.subSubCategories?.length&&L(o?.subSubCategories?.map((l,r)=>({index:r,open:r===0})))},[o]);const $=(0,i.useCallback)((l,r)=>{d&&d(v.HeaderNavigationMenu.Third),N?.(l);const s=n?.find(t=>r!==void 0?l?.subSubCategories?.[r]?.label?.toLowerCase()===t.label?.toLowerCase():l?.label?.toLowerCase()===t.label?.toLowerCase())||{};if(l?.collections){const t=S?.categories?.[l?.collections]||{};g?.({label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:t?.products}]})}else g?.(s)},[n,d,N,g,S?.categories]);return(0,i.useMemo)(()=>{switch(m){case v.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsxs)("div",{children:[a?.subcategories?.map((l,r)=>(0,e.jsx)("div",{children:(0,e.jsx)(b.MenuItem,{label:l?.label,active:k.find(s=>s.index===r)?.open,onClick:()=>{$(l),h?.(l,r)}})},`${l.label}-${r}`)),a?.guide?.label&&(0,e.jsx)(u.Link,{href:(0,f.getLocalizedPath)(a?.guide?.url,y),children:(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(u.Text,{html:a?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(u.Button,{as:"a",href:`${(0,f.getLocalizedPath)(a?.primary?.url,y)}?ref=${a?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(u.Button,{as:"a",href:(0,f.getLocalizedPath)(a?.secondary?.url,y),variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case v.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:o?.subSubCategories?o?.subSubCategories?.map((l,r)=>{const s=n?.find(c=>c.label.toLowerCase()===l?.label?.toLowerCase())||{};let t={};if(l?.collections){const c=S?.categories?.[l?.collections]||{};t={label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:c?.products}]}}else t=s;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(l).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:t,onSubSubCategoryItemClick:()=>{h?.(l,r),L(c=>c.map((C,_)=>({...C,open:_===r?!C.open:C.open})))},expanded:!!x?.find(c=>c.index===r)?.open}),x?.find(c=>c.index===r)?.open&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:t}),t?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(u.Button,{as:"a",href:(0,f.getLocalizedPath)(t?.primary?.url,y),className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:t?.primary?.label})})]})]},`${l.label}-${r}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:p}),(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:p}),p?.primary&&(0,e.jsx)("div",{className:"my-4 text-center ",children:(0,e.jsx)(u.Button,{as:"a",href:`${(0,f.getLocalizedPath)(p?.primary?.url,y)}?ref=${p?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:p?.primary?.label})})]})});default:return null}},[m,a,n,k,x,o,p,S?.categories,$,h,y])};
1
+ "use strict";var w=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var D=(a,r)=>{for(var m in r)w(a,m,{get:r[m],enumerable:!0})},K=(a,r,m,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of R(r))!T.call(a,t)&&t!==m&&w(a,t,{get:()=>r[t],enumerable:!(d=E(r,t))||d.enumerable});return a};var P=a=>K(w({},"__esModule",{value:!0}),a);var F={};D(F,{MobileSidebarMenu:()=>A});module.exports=P(F);var e=require("react/jsx-runtime"),i=require("react"),c=require("../../components/index.js"),S=require("./types.js"),$=require("./NavProvider.js"),b=require("./MobileMenuComponents.js"),z=require("../AiuiProvider/index.js"),f=require("../../helpers/utils.js");const A=({sidebarCategoriesMetadata:a,seriesMetadata:r})=>{const{currentMenu:m,setCurrentMenu:d,subSubCategory:t,setSubSubCategory:N,setCurrentSeriesMetadata:g,currentSeriesMetadata:p,buildProps:v,onSidebarNavClick:h}=(0,$.useNavContext)(),{locale:y="us"}=(0,z.useAiuiContext)(),[k,B]=(0,i.useState)([]),[x,L]=(0,i.useState)([]);(0,i.useEffect)(()=>{a?.subcategories?.length&&B(a?.subcategories?.map((l,n)=>({index:n,open:!1})))},[a]),(0,i.useEffect)(()=>{t?.subSubCategories?.length&&L(t?.subSubCategories?.map((l,n)=>({index:n,open:n===0})))},[t]);const M=(0,i.useCallback)((l,n)=>{d&&d(S.HeaderNavigationMenu.Third),N?.(l);const s=r?.find(o=>n!==void 0?l?.subSubCategories?.[n]?.label?.toLowerCase()===o.label?.toLowerCase():l?.label?.toLowerCase()===o.label?.toLowerCase())||{};if(l?.collections){const o=v?.categories?.[l?.collections]||{};g?.({label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:o?.products}]})}else g?.(s)},[r,d,N,g,v?.categories]);return(0,i.useMemo)(()=>{switch(m){case S.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col gap-8 p-4",children:[(0,e.jsxs)("div",{children:[a?.subcategories?.map((l,n)=>(0,e.jsx)("div",{children:(0,e.jsx)(b.MenuItem,{label:l?.label,active:k.find(s=>s.index===n)?.open,onClick:()=>{M(l),h?.(l,n)}})},`${l.label}-${n}`)),a?.guide?.label&&(0,e.jsx)(c.Link,{href:(0,f.getLocalizedPath)(a?.guide?.url,y,"ref=navMenu"),children:(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(c.Text,{html:a?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[a?.primary&&(0,e.jsx)(c.Button,{as:"a",href:(0,f.getLocalizedPath)(a?.primary?.url,y,`ref=${a?.primary?.label}_shopall`),variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:a?.primary?.label}),a?.secondary&&(0,e.jsx)(c.Button,{as:"a",href:(0,f.getLocalizedPath)(a?.secondary?.url,y,"ref=navMenu"),variant:"link",size:"lg",className:"link-btn tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case S.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.subSubCategories?t?.subSubCategories?.map((l,n)=>{const s=r?.find(u=>u.label.toLowerCase()===l?.label?.toLowerCase())||{};let o={};if(l?.collections){const u=v?.categories?.[l?.collections]||{};o={label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:u?.products}]}}else o=s;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(l).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:o,onSubSubCategoryItemClick:()=>{h?.(l,n),L(u=>u.map((C,_)=>({...C,open:_===n?!C.open:C.open})))},expanded:!!x?.find(u=>u.index===n)?.open}),x?.find(u=>u.index===n)?.open&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:o}),o?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(c.Button,{as:"a",href:(0,f.getLocalizedPath)(o?.primary?.url,y,"ref=navMenu"),className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:o?.primary?.label})})]})]},`${l.label}-${n}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:p}),(0,e.jsx)(b.SubSubCategoryContentComp,{matchSeriesMetadata:p}),p?.primary&&(0,e.jsx)("div",{className:"my-4 text-center ",children:(0,e.jsx)(c.Button,{as:"a",href:(0,f.getLocalizedPath)(p?.primary?.url,y,`ref=${p?.label}_viewmore`),variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:p?.primary?.label})})]})});default:return null}},[m,a,r,k,x,t,p,v?.categories,M,h,y])};
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(a,o)=>{for(var e in o)l(a,e,{get:o[e],enumerable:!0})},s=(a,o,e,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of u(o))!d.call(a,t)&&t!==e&&l(a,t,{get:()=>o[t],enumerable:!(p=c(o,t))||p.enumerable});return a};var b=a=>s(l({},"__esModule",{value:!0}),a);var x={};f(x,{MobileSupportMenu:()=>M});module.exports=b(x);var i=require("react/jsx-runtime"),h=require("react"),r=require("./MobileMenuComponents.js"),m=require("../AiuiProvider/index.js"),n=require("../../helpers/utils.js");const M=({supportsMetadata:a})=>{const{locale:o="us"}=(0,m.useAiuiContext)();return(0,i.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:a?.map(e=>(0,i.jsx)(r.MenuItem,{href:(0,n.getLocalizedPath)(e.url,o),label:e.label,onClick:()=>{}},e.id))})};
1
+ "use strict";var l=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var d=(o,e)=>{for(var a in e)l(o,a,{get:e[a],enumerable:!0})},s=(o,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of c(e))!f.call(o,t)&&t!==a&&l(o,t,{get:()=>e[t],enumerable:!(i=u(e,t))||i.enumerable});return o};var M=o=>s(l({},"__esModule",{value:!0}),o);var v={};d(v,{MobileSupportMenu:()=>b});module.exports=M(v);var r=require("react/jsx-runtime"),y=require("react"),p=require("./MobileMenuComponents.js"),n=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js");const b=({supportsMetadata:o})=>{const{locale:e="us"}=(0,n.useAiuiContext)();return(0,r.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:o?.map(a=>(0,r.jsx)(p.MenuItem,{href:(0,m.getLocalizedPath)(a.url,e,"ref=navMenu"),label:a.label,onClick:()=>{}},a.id))})};
@@ -1 +1 @@
1
- "use strict";var b=Object.create;var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,l)=>{for(var o in l)d(e,o,{get:l[o],enumerable:!0})},m=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of h(l))!N.call(e,s)&&s!==o&&d(e,s,{get:()=>l[s],enumerable:!(r=v(l,s))||r.enumerable});return e};var w=(e,l,o)=>(o=e!=null?b(g(e)):{},m(l||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>m(d({},"__esModule",{value:!0}),e);var z={};k(z,{MulticolDropdown:()=>C,MulticolItem:()=>f});module.exports=y(z);var a=require("react/jsx-runtime"),p=require("react"),t=require("../../components/index.js"),c=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js"),u=require("./NavProvider.js");const C=({multicolMetadata:e,showStatsBanner:l,statsBannerData:o})=>{const r=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:r,className:"bg-white py-4",children:(0,a.jsx)(t.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(c.default,{data:o}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((s,i)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(f,{item:s})},`multicolItem-${s?.label}-${i}`))})]})})})},f=({item:e,allPicture:l})=>{const{locale:o="us"}=(0,x.useAiuiContext)(),{componentOverrides:r}=(0,u.useNavContext)(),s=r?.badge?.variant;return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(i=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(i.url,o)}?ref=navMenu`,asChild:!i.url,className:"text-sm font-bold leading-[1.4] no-underline",children:i.label}),i?.badge&&(0,a.jsx)(t.Badge,{size:"sm",variant:s,children:i?.badge||"badge"})]},i.label))})]}),e?.imageUrl&&(0,a.jsx)("div",{className:(0,n.cn)("rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":l}),children:(0,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(e.url,o)}?ref=navMenu`,asChild:!e.url,children:(0,a.jsxs)("div",{className:"size-full",children:[(0,a.jsx)(t.Picture,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,a.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,a.jsx)(t.Text,{html:e.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&(0,a.jsx)(t.Text,{html:e.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&(0,a.jsx)(t.Button,{as:"a",href:(0,n.getLocalizedPath)(e?.primary?.url,o),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:(0,n.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};
1
+ "use strict";var b=Object.create;var d=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,l)=>{for(var o in l)d(e,o,{get:l[o],enumerable:!0})},m=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of v(l))!N.call(e,s)&&s!==o&&d(e,s,{get:()=>l[s],enumerable:!(r=h(l,s))||r.enumerable});return e};var w=(e,l,o)=>(o=e!=null?b(g(e)):{},m(l||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>m(d({},"__esModule",{value:!0}),e);var z={};k(z,{MulticolDropdown:()=>C,MulticolItem:()=>f});module.exports=y(z);var a=require("react/jsx-runtime"),p=require("react"),t=require("../../components/index.js"),c=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js"),u=require("./NavProvider.js");const C=({multicolMetadata:e,showStatsBanner:l,statsBannerData:o})=>{const r=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:r,className:"bg-white py-4",children:(0,a.jsx)(t.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(c.default,{data:o}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((s,i)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(f,{item:s})},`multicolItem-${s?.label}-${i}`))})]})})})},f=({item:e,allPicture:l})=>{const{locale:o="us"}=(0,x.useAiuiContext)(),{componentOverrides:r}=(0,u.useNavContext)(),s=r?.badge?.variant;return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(i=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(t.Link,{href:(0,n.getLocalizedPath)(i.url,o,"ref=navMenu"),asChild:!i.url,className:"text-sm font-bold leading-[1.4] no-underline",children:i.label}),i?.badge&&(0,a.jsx)(t.Badge,{size:"xs",variant:s,children:i?.badge||"badge"})]},i.label))})]}),e?.imageUrl&&(0,a.jsx)("div",{className:(0,n.cn)("rounded-image-text laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":l}),children:(0,a.jsx)(t.Link,{href:(0,n.getLocalizedPath)(e.url,o,"ref=navMenu"),asChild:!e.url,children:(0,a.jsxs)("div",{className:"size-full",children:[(0,a.jsx)(t.Picture,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,a.jsxs)("div",{className:(0,n.cn)("absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",{"aiui-dark":e?.theme==="light"}),children:[(0,a.jsx)(t.Text,{html:e.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&(0,a.jsx)(t.Text,{html:e.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&(0,a.jsx)(t.Button,{as:"a",href:(0,n.getLocalizedPath)(e?.primary?.url,o,"ref=navMenu"),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:(0,n.cn)("link-btn mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var x=(t,a)=>{for(var l in a)d(t,l,{get:a[l],enumerable:!0})},v=(t,a,l,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of h(a))!c.call(t,n)&&n!==l&&d(t,n,{get:()=>a[n],enumerable:!(o=r(a,n))||o.enumerable});return t};var p=t=>v(d({},"__esModule",{value:!0}),t);var u={};x(u,{ResourceItem:()=>f,ResourceSubSubCategoryContentComp:()=>g,ResourceSubSubCategoryItemComp:()=>b});module.exports=p(u);var e=require("react/jsx-runtime"),i=require("../../components/index.js"),s=require("../../helpers/utils.js"),m=require("../AiuiProvider/index.js");const f=({resource:t})=>{const{locale:a="us"}=(0,m.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-none desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",children:(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(t?.href,a),className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(i.Picture,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{as:"p",html:t?.title,className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})}),t?.desc&&(0,e.jsx)(i.Text,{html:t?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})})]})]})})})},b=({matchResourcesMetadata:t,onSubSubCategoryItemClick:a,expanded:l})=>{const o=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(i.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&(0,e.jsx)("svg",{className:(0,s.cn)("size-5",{"rotate-180":l}),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]});return a?(0,e.jsx)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":l,children:o}):(0,e.jsx)("div",{className:"flex items-center justify-between py-4",children:o})},g=({matchResourcesMetadata:t})=>{const{locale:a="us"}=(0,m.useAiuiContext)();return(0,e.jsx)("div",{className:"tablet:grid tablet:grid-cols-2 flex grid-cols-1 flex-col gap-4",children:!!t?.resources?.length&&t?.resources?.map((l,o)=>(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(l?.href,a),className:"no-underline hover:text-current",children:(0,e.jsx)("div",{className:"laptop:h-[280px] tablet:max-w-none relative h-[240px] max-w-[358px]",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,e.jsx)(i.Picture,{source:l.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{html:l?.title,as:"p",className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})}),l?.desc&&(0,e.jsx)(i.Text,{html:l?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})})]})]})})},`resourceItem-${o}`))})};
1
+ "use strict";var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var x=(t,a)=>{for(var l in a)d(t,l,{get:a[l],enumerable:!0})},v=(t,a,l,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of h(a))!c.call(t,n)&&n!==l&&d(t,n,{get:()=>a[n],enumerable:!(o=m(a,n))||o.enumerable});return t};var p=t=>v(d({},"__esModule",{value:!0}),t);var g={};x(g,{ResourceItem:()=>f,ResourceSubSubCategoryContentComp:()=>u,ResourceSubSubCategoryItemComp:()=>b});module.exports=p(g);var e=require("react/jsx-runtime"),i=require("../../components/index.js"),s=require("../../helpers/utils.js"),r=require("../AiuiProvider/index.js");const f=({resource:t})=>{const{locale:a="us"}=(0,r.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-none desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",children:(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(t?.href,a,"ref=navMenu"),className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(i.Picture,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{as:"p",html:t?.title,className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})}),t?.desc&&(0,e.jsx)(i.Text,{html:t?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":t?.theme!=="dark","text-black":t?.theme==="dark"})})]})]})})})},b=({matchResourcesMetadata:t,onSubSubCategoryItemClick:a,expanded:l})=>{const o=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(i.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&(0,e.jsx)("svg",{className:(0,s.cn)("size-5",{"rotate-180":l}),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6.91009 4.41009C7.23553 4.08466 7.76304 4.08466 8.08848 4.41009L13.0885 9.41009C13.4139 9.73553 13.4139 10.263 13.0885 10.5885L8.08848 15.5885C7.76304 15.9139 7.23553 15.9139 6.91009 15.5885C6.58466 15.263 6.58466 14.7355 6.91009 14.4101L11.3209 9.99929L6.91009 5.58848C6.58466 5.26304 6.58466 4.73553 6.91009 4.41009Z",fill:"#080A0F"})})]});return a?(0,e.jsx)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:a,"aria-expanded":l,children:o}):(0,e.jsx)("div",{className:"flex items-center justify-between py-4",children:o})},u=({matchResourcesMetadata:t})=>{const{locale:a="us"}=(0,r.useAiuiContext)();return(0,e.jsx)("div",{className:"tablet:grid tablet:grid-cols-2 flex grid-cols-1 flex-col gap-4",children:!!t?.resources?.length&&t?.resources?.map((l,o)=>(0,e.jsx)(i.Link,{href:(0,s.getLocalizedPath)(l?.href,a,"ref=navMenu"),className:"no-underline hover:text-current",children:(0,e.jsx)("div",{className:"laptop:h-[280px] tablet:max-w-none relative h-[240px] max-w-[358px]",children:(0,e.jsxs)("div",{className:"relative h-full overflow-hidden",children:[(0,e.jsx)(i.Picture,{source:l.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(i.Text,{html:l?.title,as:"p",className:(0,s.cn)("text-xl font-bold leading-[1.2]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})}),l?.desc&&(0,e.jsx)(i.Text,{html:l?.desc,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{"text-white":l?.theme!=="dark","text-black":l?.theme==="dark"})})]})]})})},`resourceItem-${o}`))})};
@@ -1 +1 @@
1
- "use strict";var $=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var B=(e,s)=>{for(var u in s)f(e,u,{get:s[u],enumerable:!0})},h=(e,s,u,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of E(s))!O.call(e,c)&&c!==u&&f(e,c,{get:()=>s[c],enumerable:!(m=D(s,c))||m.enumerable});return e};var I=(e,s,u)=>(u=e!=null?$(z(e)):{},h(s||!e||!e.__esModule?f(u,"default",{value:e,enumerable:!0}):u,e)),T=e=>h(f({},"__esModule",{value:!0}),e);var W={};B(W,{ResourceSidebarDropdown:()=>A});module.exports=T(W);var n=require("react/jsx-runtime"),i=I(require("react")),d=require("../../components/index.js"),p=require("../../helpers/utils.js"),w=require("./icons/index.js"),N=require("./NavProvider.js"),C=require("./ResourceItem.js"),k=require("../AiuiProvider/index.js");const A=i.default.memo(({resourceCategoriesMetadata:e,resourcesMetadata:s})=>{const{onSidebarNavClick:u}=(0,N.useNavContext)(),[m,c]=(0,i.useState)([]),[y,g]=(0,i.useState)(-1),R=(0,i.useRef)(null),{locale:x="us"}=(0,k.useAiuiContext)(),v=(0,i.useCallback)(()=>{const o=e?.subcategories;if(!o?.length)return;const a=o.findIndex(l=>!!l?.subSubCategories),t=o.findIndex(l=>!l?.subSubCategories),r=o.map((l,b)=>({index:b,open:a===b||t===b}));c(r)},[e]);(0,i.useEffect)(()=>{v()},[v]);const S=(0,i.useMemo)(()=>{const o=e?.subcategories?.[m?.find(t=>t.open)?.index||0],a=s?.find(t=>t?.label?.toLowerCase()===o?.label?.toLowerCase())||{};if(o?.subSubCategories){const t=o?.subSubCategories?.[y];return s?.find(l=>l?.label?.toLowerCase()===t?.label?.toLowerCase())||{}}else return a},[e,m,y,s]),F=(0,i.useCallback)((o,a)=>{a?.subSubCategories?.length>0?g(0):g(-1),c(t=>t.map((r,l)=>({...r,open:l===o?!r.open:!1})))},[]),L=(o,a)=>{c(t=>t.map(r=>r.index===o?{...r,open:!0}:{...r,open:!1})),g(a)};return(0,n.jsxs)(d.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,n.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:R,children:[(0,n.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e?.subcategories?.map((o,a)=>{const t=Array.isArray(o?.subSubCategories)&&o?.subSubCategories?.length>0,r=m?.find(l=>l.index===a)?.open;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{className:(0,p.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!t&&r}),onClick:()=>{F(a,o),u?.(o,a)},"aria-expanded":t?r:void 0,"aria-haspopup":t?"true":void 0,children:[(0,n.jsx)(d.Text,{html:o.label,className:"p-4 text-sm font-bold leading-[1.4]"}),t&&(0,n.jsx)(w.DownArrow,{"aria-hidden":"true",className:(0,p.cn)("size-4",{"rotate-180":r})})]}),r&&(0,n.jsx)("div",{className:"flex flex-col",role:"menu",children:o.subSubCategories?.map((l,b)=>(0,n.jsx)("button",{onClick:()=>{L(a,b),u?.(l,b)},className:(0,p.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":y===b}),role:"menuitem","aria-label":l.label,children:(0,n.jsx)(d.Text,{html:l.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${a}-${b}`))})]},`subcategoryItem-${a}`)})}),e&&(0,n.jsx)("div",{className:"flex",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[e?.primary&&(0,n.jsx)(d.Button,{as:"a",href:`${(0,p.getLocalizedPath)(e?.primary?.url,x)}?ref=${e?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:e?.primary?.label}),e?.secondary&&(0,n.jsx)(d.Button,{as:"a",href:(0,p.getLocalizedPath)(e?.secondary?.url,x),variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:e?.secondary?.label})]})})]}),(0,n.jsx)("div",{className:"desktop:h-[509px] flex-1 overflow-y-auto py-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,n.jsx)("div",{className:"grid grid-cols-3 gap-4 ",children:Array.isArray(S?.resources)?S.resources.map((o,a)=>(0,n.jsx)(C.ResourceItem,{resource:o},`resourceItem-${a}`)):null})})]})});A.displayName="ResourceSidebarDropdown";
1
+ "use strict";var D=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var B=(e,s)=>{for(var u in s)f(e,u,{get:s[u],enumerable:!0})},h=(e,s,u,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let c of $(s))!O.call(e,c)&&c!==u&&f(e,c,{get:()=>s[c],enumerable:!(m=E(s,c))||m.enumerable});return e};var I=(e,s,u)=>(u=e!=null?D(z(e)):{},h(s||!e||!e.__esModule?f(u,"default",{value:e,enumerable:!0}):u,e)),T=e=>h(f({},"__esModule",{value:!0}),e);var W={};B(W,{ResourceSidebarDropdown:()=>A});module.exports=T(W);var o=require("react/jsx-runtime"),i=I(require("react")),d=require("../../components/index.js"),p=require("../../helpers/utils.js"),w=require("./icons/index.js"),N=require("./NavProvider.js"),k=require("./ResourceItem.js"),C=require("../AiuiProvider/index.js");const A=i.default.memo(({resourceCategoriesMetadata:e,resourcesMetadata:s})=>{const{onSidebarNavClick:u}=(0,N.useNavContext)(),[m,c]=(0,i.useState)([]),[y,g]=(0,i.useState)(-1),R=(0,i.useRef)(null),{locale:x="us"}=(0,C.useAiuiContext)(),v=(0,i.useCallback)(()=>{const n=e?.subcategories;if(!n?.length)return;const a=n.findIndex(l=>!!l?.subSubCategories),t=n.findIndex(l=>!l?.subSubCategories),r=n.map((l,b)=>({index:b,open:a===b||t===b}));c(r)},[e]);(0,i.useEffect)(()=>{v()},[v]);const S=(0,i.useMemo)(()=>{const n=e?.subcategories?.[m?.find(t=>t.open)?.index||0],a=s?.find(t=>t?.label?.toLowerCase()===n?.label?.toLowerCase())||{};if(n?.subSubCategories){const t=n?.subSubCategories?.[y];return s?.find(l=>l?.label?.toLowerCase()===t?.label?.toLowerCase())||{}}else return a},[e,m,y,s]),F=(0,i.useCallback)((n,a)=>{a?.subSubCategories?.length>0?g(0):g(-1),c(t=>t.map((r,l)=>({...r,open:l===n?!r.open:!1})))},[]),L=(n,a)=>{c(t=>t.map(r=>r.index===n?{...r,open:!0}:{...r,open:!1})),g(a)};return(0,o.jsxs)(d.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,o.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:R,children:[(0,o.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e?.subcategories?.map((n,a)=>{const t=Array.isArray(n?.subSubCategories)&&n?.subSubCategories?.length>0,r=m?.find(l=>l.index===a)?.open;return(0,o.jsxs)("div",{children:[(0,o.jsxs)("button",{className:(0,p.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!t&&r}),onClick:()=>{F(a,n),u?.(n,a)},"aria-expanded":t?r:void 0,"aria-haspopup":t?"true":void 0,children:[(0,o.jsx)(d.Text,{html:n.label,className:"p-4 text-sm font-bold leading-[1.4]"}),t&&(0,o.jsx)(w.DownArrow,{"aria-hidden":"true",className:(0,p.cn)("size-4",{"rotate-180":r})})]}),r&&(0,o.jsx)("div",{className:"flex flex-col",role:"menu",children:n.subSubCategories?.map((l,b)=>(0,o.jsx)("button",{onClick:()=>{L(a,b),u?.(l,b)},className:(0,p.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":y===b}),role:"menuitem","aria-label":l.label,children:(0,o.jsx)(d.Text,{html:l.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${a}-${b}`))})]},`subcategoryItem-${a}`)})}),e&&(0,o.jsx)("div",{className:"flex",children:(0,o.jsxs)("div",{className:"flex flex-col gap-4",children:[e?.primary&&(0,o.jsx)(d.Button,{as:"a",href:(0,p.getLocalizedPath)(e?.primary?.url,x,`ref=${e?.primary?.label}_shopall`),variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:e?.primary?.label}),e?.secondary&&(0,o.jsx)(d.Button,{as:"a",href:(0,p.getLocalizedPath)(e?.secondary?.url,x,"ref=navMenu"),variant:"link",size:"lg",className:"link-btn lg-desktop:text-base justify-start !p-0 text-sm",children:e?.secondary?.label})]})})]}),(0,o.jsx)("div",{className:"desktop:h-[509px] flex-1 overflow-y-auto py-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,o.jsx)("div",{className:"grid grid-cols-3 gap-4 ",children:Array.isArray(S?.resources)?S.resources.map((n,a)=>(0,o.jsx)(k.ResourceItem,{resource:n},`resourceItem-${a}`)):null})})]})});A.displayName="ResourceSidebarDropdown";
@@ -3,9 +3,10 @@ import React from 'react';
3
3
  * 侧边栏下拉
4
4
  * @param categoriesItem 分类项
5
5
  */
6
- export declare const SidebarDropdown: React.MemoExoticComponent<({ sidebarCategoriesMetadata, seriesMetadata }: {
6
+ export declare const SidebarDropdown: React.MemoExoticComponent<({ sidebarCategoriesMetadata, seriesMetadata, navigationTitle, }: {
7
7
  sidebarCategoriesMetadata: any;
8
8
  seriesMetadata: any;
9
+ navigationTitle?: string;
9
10
  }) => import("react/jsx-runtime").JSX.Element>;
10
11
  /**
11
12
  * 系列产品项组件
@@ -1 +1 @@
1
- "use strict";var A=Object.create;var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var R=(t,i)=>{for(var m in i)C(t,m,{get:i[m],enumerable:!0})},L=(t,i,m,x)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of j(i))!O.call(t,p)&&p!==m&&C(t,p,{get:()=>i[p],enumerable:!(x=B(i,p))||x.enumerable});return t};var V=(t,i,m)=>(m=t!=null?A(E(t)):{},L(i||!t||!t.__esModule?C(m,"default",{value:t,enumerable:!0}):m,t)),W=t=>L(C({},"__esModule",{value:!0}),t);var H={};R(H,{SeriesProductItem:()=>_,SidebarDropdown:()=>P});module.exports=W(H);var e=require("react/jsx-runtime"),c=V(require("react")),n=require("../../components/index.js"),b=require("../../helpers/utils.js"),D=require("./icons/index.js"),$=require("./NavProvider.js"),F=require("../AiuiProvider/index.js");const P=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:m,onSidebarNavClick:x}=(0,$.useNavContext)(),{locale:p="us"}=(0,F.useAiuiContext)(),[v,N]=(0,c.useState)([]),[h,S]=(0,c.useState)(-1),g=(0,c.useRef)(null),y=(0,c.useRef)(null),k=(0,c.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),l=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||l===d}));N(r)},[t]);(0,c.useEffect)(()=>{k()},[k]);const s=(0,c.useMemo)(()=>{const a=t?.subcategories?.[v?.find(l=>l.open)?.index||0],o=i?.find(l=>l?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const l=m?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:l?.products}]}}else if(a?.subSubCategories){const l=a?.subSubCategories?.[h],r=i?.find(u=>u?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const u=m?.categories?.[l?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,v,h,i,m]),f=(0,c.useCallback)((a,o)=>{const l=o?.subSubCategories?.length>0;S(l?0:-1);const r=y.current;N(u=>u.map((d,z)=>z===a?{...d,open:!d.open}:l?{...d,open:!1}:!r&&h===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!l&&h===-1?{...d,open:!1}:d)),y.current={index:a,hasSubSubCategories:l}},[h]),w=(a,o)=>{N(l=>l.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),S(o)};return(0,e.jsxs)(n.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:g,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const l=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=v?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,b.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!l&&r}),onClick:()=>{f(o,a),x?.(a,o)},"aria-expanded":l?r:void 0,"aria-haspopup":l?"true":void 0,children:[(0,e.jsx)(n.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(D.DownArrow,{"aria-hidden":"true",className:(0,b.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{w(o,d),x?.(u,d)},className:(0,b.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":h===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(n.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(t?.primary?.url,p)}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",iconClassName:"size-4",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(s?.primary?.url,p)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,b.getLocalizedPath)(t?.guide?.url,p),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(n.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,b.getLocalizedPath)(s?.banner?.href,p),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:s?.banner?.title||"Buy in Guide",className:(0,b.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,b.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((l,r)=>(0,e.jsx)(_,{seriesLabel:s?.label,product:l,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});P.displayName="SidebarDropdown";const _=({product:t,isCollection:i,position:m,seriesLabel:x})=>{const{locale:p="us"}=(0,F.useAiuiContext)(),{buildProps:v,onSeriesProductClick:N,componentOverrides:h}=(0,$.useNavContext)(),S=h?.badge?.variant;let g=i?t:v?.products?.find(f=>f.handle===t.handle);const y=g?.variants?.find(f=>f.sku===t.sku)||g?.variants?.[0],k=(0,c.useMemo)(()=>`${(0,b.getLocalizedPath)(`/products/${g?.handle}`,p)}?variant=${(0,b.atobID)(y?.id)}`,[g?.handle,y?.id,p]),s=(0,c.useMemo)(()=>g?.tags?.filter?.(f=>f?.startsWith?.("CLtag"))?.map?.(f=>f?.replace?.("CLtag:",""))?.slice?.(0,2),[g?.tags]);return y?.availableForSale?(0,e.jsx)(n.Link,{href:k,onClick:f=>{f.preventDefault(),window.open(k,"_self"),N?.(g,m||0,x)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:`${y?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:g?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(s)&&s?.map((f,w)=>(0,e.jsx)(n.Badge,{size:"sm",variant:S,className:"mb-1 whitespace-nowrap",children:f},w))}),(0,e.jsx)(n.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:t?.custom_name||y?.metafields?.infos?.page_short_title||g?.title}),t?.desc&&(0,e.jsx)(n.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null};
1
+ "use strict";var H=Object.create;var _=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var K=(t,c)=>{for(var b in c)_(t,b,{get:c[b],enumerable:!0})},P=(t,c,b,y)=>{if(c&&typeof c=="object"||typeof c=="function")for(let v of T(c))!W.call(t,v)&&v!==b&&_(t,v,{get:()=>c[v],enumerable:!(y=G(c,v))||y.enumerable});return t};var U=(t,c,b)=>(b=t!=null?H(V(t)):{},P(c||!t||!t.__esModule?_(b,"default",{value:t,enumerable:!0}):b,t)),q=t=>P(_({},"__esModule",{value:!0}),t);var I={};K(I,{SeriesProductItem:()=>B,SidebarDropdown:()=>j});module.exports=q(I);var e=require("react/jsx-runtime"),i=U(require("react")),l=require("../../components/index.js"),p=require("../../helpers/utils.js"),z=require("./icons/index.js"),D=require("./NavProvider.js"),L=require("../AiuiProvider/index.js"),A=require("../../shared/track.js");const j=i.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:c,navigationTitle:b})=>{const{buildProps:y,onSidebarNavClick:v}=(0,D.useNavContext)(),{locale:x="us",pageHandle:k,trackingData:C}=(0,L.useAiuiContext)(),[h,f]=(0,i.useState)([]),[g,N]=(0,i.useState)(-1),S=(0,i.useRef)(null),m=(0,i.useRef)(null),w=(0,i.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),n=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||n===d}));f(r)},[t]);(0,i.useEffect)(()=>{w()},[w]);const s=(0,i.useMemo)(()=>{const a=t?.subcategories?.[h?.find(n=>n.open)?.index||0],o=c?.find(n=>n?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const n=y?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:n?.products}]}}else if(a?.subSubCategories){const n=a?.subSubCategories?.[g],r=c?.find(u=>u?.label?.toLowerCase()===n?.label?.toLowerCase())||{};if(n?.collections){const u=y?.categories?.[n?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,h,g,c,y]),F=(0,i.useMemo)(()=>h?.find(a=>a.open)?.index??-1,[h]),$=(0,i.useMemo)(()=>k?`Activity Page_${k}`:C?.pageGroup||"Home Page",[k,C]);(0,i.useEffect)(()=>{F<0||!s?.label||(0,A.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:$,component_type:"copy",component_name:"navigation",position:F+1,component_title:s?.label,navigation:b||""}})},[s?.label,F,$,b]);const E=(0,i.useCallback)((a,o)=>{const n=o?.subSubCategories?.length>0;N(n?0:-1);const r=m.current;f(u=>u.map((d,R)=>R===a?{...d,open:!d.open}:n?{...d,open:!1}:!r&&g===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!n&&g===-1?{...d,open:!1}:d)),m.current={index:a,hasSubSubCategories:n}},[g]),O=(a,o)=>{f(n=>n.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),N(o)};return(0,e.jsxs)(l.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:S,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const n=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=h?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,p.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!n&&r}),onClick:()=>{E(o,a),v?.(a,o)},"aria-expanded":n?r:void 0,"aria-haspopup":n?"true":void 0,children:[(0,e.jsx)(l.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),n&&(0,e.jsx)(z.DownArrow,{"aria-hidden":"true",className:(0,p.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{O(o,d),v?.(u,d)},className:(0,p.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":g===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(l.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(l.Button,{as:"a",href:(0,p.getLocalizedPath)(t?.primary?.url,x,`ref=${t?.primary?.label}_shopall`),variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(l.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",iconClassName:"size-4",className:"link-btn lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(l.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(l.Button,{as:"a",href:(0,p.getLocalizedPath)(s?.primary?.url,x,`ref=${s?.label}_viewmore`),variant:"link",size:"lg",iconClassName:"size-4",className:"link-btn flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(l.Link,{href:(0,p.getLocalizedPath)(t?.guide?.url,x,"ref=navMenu"),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(l.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(l.Link,{asChild:!s?.banner?.href,href:(0,p.getLocalizedPath)(s?.banner?.href,x,"ref=navMenu"),children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(l.Picture,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(l.Heading,{size:2,html:s?.banner?.title||"Buy in Guide",className:(0,p.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(l.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,p.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((n,r)=>(0,e.jsx)(B,{seriesLabel:s?.label,product:n,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});j.displayName="SidebarDropdown";const B=({product:t,isCollection:c,position:b,seriesLabel:y})=>{const{locale:v="us"}=(0,L.useAiuiContext)(),{buildProps:x,onSeriesProductClick:k,componentOverrides:C}=(0,D.useNavContext)(),h=C?.badge?.variant;let f=c?t:x?.products?.find(m=>m.handle===t.handle);const g=f?.variants?.find(m=>m.sku===t.sku)||f?.variants?.[0],N=(0,i.useMemo)(()=>(0,p.getLocalizedPath)(`/products/${f?.handle}`,v,`variant=${(0,p.atobID)(g?.id)}&ref=navMenu`),[f?.handle,g?.id,v]),S=(0,i.useMemo)(()=>f?.tags?.filter?.(m=>m?.startsWith?.("CLtag"))?.map?.(m=>m?.replace?.("CLtag:",""))?.slice?.(0,1),[f?.tags]);return g?.availableForSale?(0,e.jsx)(l.Link,{href:N,onClick:m=>{m.preventDefault(),window.open(N,"_self"),k?.(f,b||0,y)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:`${g?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:f?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),Array.isArray(S)&&S?.length>0&&(0,e.jsx)("div",{className:"absolute right-1 top-1 flex gap-1",children:S?.map((m,w)=>(0,e.jsx)(l.Badge,{size:"xs",variant:h,className:"whitespace-nowrap",children:m},w))}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[(0,e.jsx)(l.Text,{className:"lg-desktop:text-base line-clamp-2 text-sm font-bold leading-[1.4]",html:t?.custom_name||g?.metafields?.infos?.page_short_title||f?.title}),t?.desc&&(0,e.jsx)(l.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null};
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!b.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var R=t=>L(a({},"__esModule",{value:!0}),t);var E={};D(E,{SupportsDropdown:()=>y});module.exports=R(E);var l=require("react/jsx-runtime"),n=require("react"),u=require("../../components/index.js"),p=require("es-toolkit"),g=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js");const y=({supportsMetadata:t,currentNavItemRef:e})=>{const{locale:r="us"}=(0,g.useAiuiContext)(),i=(0,n.useRef)(null),[s,c]=(0,n.useState)(null),[f,h]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(i?.current){const o=i?.current?.getBoundingClientRect();h(o.height)}},[i]);const d=(0,p.debounce)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},500);return(0,n.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,n.useEffect)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},[e]),(0,l.jsx)("div",{className:"rounded-b-box absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:f},children:(0,l.jsx)("div",{ref:i,className:"p-4",children:t?.map(o=>(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(u.Link,{href:(0,m.getLocalizedPath)(o.url,r),className:"text-sm font-bold leading-[1.4] no-underline",children:o.label})},o.id))})})};
1
+ "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!b.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var R=t=>L(a({},"__esModule",{value:!0}),t);var E={};D(E,{SupportsDropdown:()=>y});module.exports=R(E);var l=require("react/jsx-runtime"),o=require("react"),u=require("../../components/index.js"),p=require("es-toolkit"),f=require("../AiuiProvider/index.js"),g=require("../../helpers/utils.js");const y=({supportsMetadata:t,currentNavItemRef:e})=>{const{locale:r="us"}=(0,f.useAiuiContext)(),i=(0,o.useRef)(null),[s,c]=(0,o.useState)(null),[m,h]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(i?.current){const n=i?.current?.getBoundingClientRect();h(n.height)}},[i]);const d=(0,p.debounce)(()=>{if(e){const n=e.getBoundingClientRect();c(n)}},500);return(0,o.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,o.useEffect)(()=>{if(e){const n=e.getBoundingClientRect();c(n)}},[e]),(0,l.jsx)("div",{className:"rounded-b-box absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:m},children:(0,l.jsx)("div",{ref:i,className:"p-4",children:t?.map(n=>(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(u.Link,{href:(0,g.getLocalizedPath)(n.url,r,"ref=navMenu"),className:"text-sm font-bold leading-[1.4] no-underline",children:n.label})},n.id))})})};