@anker-in/headless-ui 1.1.58 → 1.1.59

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 (79) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  3. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  4. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  5. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  6. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js.map +3 -3
  7. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
  8. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +3 -3
  9. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
  10. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js.map +3 -3
  11. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
  12. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js.map +3 -3
  13. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  14. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  15. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +1 -1
  16. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js.map +3 -3
  17. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
  18. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +3 -3
  19. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  20. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  21. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  22. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js.map +3 -3
  23. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  24. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  25. package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.d.ts +7 -0
  26. package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.js +2 -0
  27. package/dist/cjs/biz-components/HeaderNavigation/useScrollLock.js.map +7 -0
  28. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  29. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
  30. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  31. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  32. package/dist/cjs/biz-components/Specs/index.js +1 -1
  33. package/dist/cjs/biz-components/Specs/index.js.map +2 -2
  34. package/dist/cjs/helpers/index.d.ts +1 -1
  35. package/dist/cjs/helpers/index.js +1 -1
  36. package/dist/cjs/helpers/index.js.map +2 -2
  37. package/dist/cjs/helpers/utils.d.ts +7 -0
  38. package/dist/cjs/helpers/utils.js +1 -1
  39. package/dist/cjs/helpers/utils.js.map +3 -3
  40. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  41. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  42. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  43. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  44. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  45. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js.map +3 -3
  46. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +1 -1
  47. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +3 -3
  48. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js +1 -1
  49. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js.map +3 -3
  50. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js +1 -1
  51. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js.map +3 -3
  52. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  53. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  54. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +1 -1
  55. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js.map +3 -3
  56. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +1 -1
  57. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +3 -3
  58. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  59. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  60. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  61. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js.map +3 -3
  62. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  63. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  64. package/dist/esm/biz-components/HeaderNavigation/useScrollLock.d.ts +7 -0
  65. package/dist/esm/biz-components/HeaderNavigation/useScrollLock.js +2 -0
  66. package/dist/esm/biz-components/HeaderNavigation/useScrollLock.js.map +7 -0
  67. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  68. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  69. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  70. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  71. package/dist/esm/biz-components/Specs/index.js +1 -1
  72. package/dist/esm/biz-components/Specs/index.js.map +2 -2
  73. package/dist/esm/helpers/index.d.ts +1 -1
  74. package/dist/esm/helpers/index.js +1 -1
  75. package/dist/esm/helpers/index.js.map +3 -3
  76. package/dist/esm/helpers/utils.d.ts +7 -0
  77. package/dist/esm/helpers/utils.js +1 -1
  78. package/dist/esm/helpers/utils.js.map +3 -3
  79. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var D=Object.create;var T=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var i in t)T(e,i,{get:t[i],enumerable:!0})},E=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!P.call(e,d)&&d!==i&&T(e,d,{get:()=>t[d],enumerable:!(p=j(t,d))||p.enumerable});return e};var v=(e,t,i)=>(i=e!=null?D(z(e)):{},E(t||!e||!e.__esModule?T(i,"default",{value:e,enumerable:!0}):i,e)),W=e=>E(T({},"__esModule",{value:!0}),e);var U={};V(U,{default:()=>J});module.exports=W(U);var n=require("react/jsx-runtime"),M=v(require("../Title/index.js")),l=require("../../helpers/utils.js"),N=v(require("../../components/picture.js")),_=v(require("../../components/button.js")),H=v(require("../SwiperBox/index.js")),C=require("../../shared/Styles.js"),r=v(require("react")),R=require("../../hooks/useExposure.js"),g=require("../../shared/trackUrlRef.js"),S=v(require("../../shared/throttle.js")),B=require("../../components/heading.js");const a="image",m="scene_banner",q=({item:e,idx:t,itemShape:i,hoverIndex:p,getRef:d,handleSwiperItemClick:u,contentWidth:h,primaryButton:c,event:f,data:w,accordionRef:k})=>{const y=p===t,$=y?8:1;return(0,R.useExposure)({current:k.current[t]},{componentType:a,componentName:m,componentTitle:e?.title,position:t+1,componentDescription:e?.subTitle}),(0,n.jsxs)("div",{style:{flex:`${$} 1 0%`,transition:"all 0.6s"},ref:x=>{x&&d(t,x)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",i==="round"?"rounded-2xl":""),onMouseEnter:()=>u(t),onClick:()=>{u(t)},children:[(0,n.jsx)("a",{href:(0,g.trackUrlRef)(e?.imgLink,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}`,children:(0,n.jsx)(N.default,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""})}),(0,n.jsxs)("div",{style:{width:h},className:(0,l.cn)("absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in",y&&h?"opacity-100":"opacity-0"),children:[(0,n.jsxs)("div",{className:"mr-16 flex-1 overflow-hidden",children:[(0,n.jsx)(B.Heading,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:e?.title}),(0,n.jsx)(B.Heading,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:e?.subTitle})]}),c&&(0,n.jsxs)(_.default,{className:(0,l.cn)("mb-1.5 font-bold"),as:"a",href:(0,g.trackUrlRef)(e?.link,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${c}`,onClick:()=>f?.primaryButton?.(w,t),children:[c,(0,n.jsx)("span",{className:"sr-only",children:e?.title??e?.subTitle})]})]})]},t)},O=({data:e,configuration:t})=>{const i=(0,r.useRef)(null);return(0,R.useExposure)(i,{componentType:a,componentName:m,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.subTitle}),(0,n.jsxs)("div",{ref:i,className:(0,l.cn)("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",t?.itemShape==="round"?"rounded-2xl":""),children:[(0,n.jsx)("a",{href:(0,g.trackUrlRef)(e?.imgLink,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}@${e?.subTitle}`,"data-headless-nav-postion":`''#${t?.index+1}`,children:(0,n.jsx)(N.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""})}),(0,n.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[(0,n.jsxs)("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[(0,n.jsx)("p",{className:"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]",children:e?.title}),(0,n.jsx)("h3",{className:"text-info-primary line-clamp-2 text-sm font-semibold",children:e?.subTitle})]}),t?.primaryButton&&(0,n.jsx)(_.default,{as:"a",variant:"secondary","aria-label":e?.title??e?.subTitle,className:(0,l.cn)("text-info-primary text-sm font-bold"),href:(0,g.trackUrlRef)(e.link,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-nav-postion":`''#${t?.index+1}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${t?.primaryButton}`,children:t?.primaryButton})]})]})},L=r.default.forwardRef(({data:e,autoplay:t={enabled:!1,loop:!1,interval:1500},className:i="",event:p},d)=>{const[u,h]=(0,r.useState)(0),c=(0,r.useRef)(0),f=(0,r.useRef)([]),[w,k]=(0,r.useState)(0),y=(0,r.useRef)(null);(0,r.useImperativeHandle)(d,()=>y.current);const $=(o,s)=>{s&&(f.current[o]=s)};(0,r.useEffect)(()=>{const o=()=>{f.current[c.current]&&k(f.current[c.current].offsetWidth)};o();const s=(0,S.default)(o,300);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const x=(0,r.useCallback)(o=>{u!==o&&(h(o),c.current=o)},[e?.products,u]);return(0,r.useEffect)(()=>{let o;return t?.enabled&&(o=setInterval(()=>{h(s=>{const I=s??0;let b;if(t.loop!==!1)b=(I+1)%e?.products?.length;else if(b=I+1,b>=e?.products?.length)return b=e?.products?.length-1,o&&clearInterval(o),I;return c.current=b,b})},t?.interval)),()=>{o&&clearInterval(o)}},[t?.enabled,t?.interval,t?.loop,e?.products?.length,x]),(0,n.jsxs)(n.Fragment,{children:[e?.title&&(0,n.jsx)(M.default,{data:{title:e?.title}}),(0,n.jsx)("div",{ref:y,className:(0,l.cn)("laptop:block hidden",{"aiui-dark":e?.theme==="dark"}),children:(0,n.jsx)("div",{className:(0,l.cn)("lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden",i),children:e?.products?.map((o,s)=>(0,n.jsx)(q,{item:o,idx:s,itemShape:e?.itemShape,hoverIndex:u,getRef:$,handleSwiperItemClick:x,contentWidth:w,primaryButton:e?.primaryButton,event:p,data:e,accordionRef:f},s))})}),(0,n.jsx)("div",{className:(0,l.cn)("laptop:hidden block",{"aiui-dark":e?.theme==="dark"}),children:(0,n.jsx)(H.default,{className:(0,l.cn)("h-[400px] !overflow-visible",i),id:"AccordionCards"+e?.key,data:{list:e?.products,configuration:{shape:e?.shape,itemShape:e?.itemShape,primaryButton:e?.primaryButton,event:p,title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});L.displayName="AccordionCards";var J=(0,C.withLayout)(L);
1
+ "use strict";"use client";var D=Object.create;var T=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var i in t)T(e,i,{get:t[i],enumerable:!0})},R=(e,t,i,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of A(t))!P.call(e,m)&&m!==i&&T(e,m,{get:()=>t[m],enumerable:!(p=j(t,m))||p.enumerable});return e};var h=(e,t,i)=>(i=e!=null?D(z(e)):{},R(t||!e||!e.__esModule?T(i,"default",{value:e,enumerable:!0}):i,e)),W=e=>R(T({},"__esModule",{value:!0}),e);var U={};V(U,{default:()=>J});module.exports=W(U);var n=require("react/jsx-runtime"),B=h(require("../Title/index.js")),l=require("../../helpers/utils.js"),_=h(require("../../components/picture.js")),N=h(require("../../components/button.js")),E=h(require("../SwiperBox/index.js")),S=require("../../shared/Styles.js"),r=h(require("react")),L=require("../../hooks/useExposure.js"),g=require("../../shared/trackUrlRef.js"),C=h(require("../../shared/throttle.js")),M=require("../../components/heading.js");const a="image",d="scene_banner",q=({item:e,idx:t,itemShape:i,hoverIndex:p,getRef:m,handleSwiperItemClick:u,contentWidth:v,primaryButton:c,event:f,data:w,accordionRef:k})=>{const y=p===t,$=y?8:1;return(0,L.useExposure)({current:k.current[t]},{componentType:a,componentName:d,componentTitle:e?.title,position:t+1,componentDescription:e?.subTitle}),(0,n.jsxs)("div",{style:{flex:`${$} 1 0%`,transition:"all 0.6s"},ref:x=>{x&&m(t,x)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",i==="round"?"rounded-2xl":""),onMouseEnter:()=>u(t),onClick:()=>{u(t)},children:[(0,n.jsx)("a",{href:(0,g.trackUrlRef)(e?.imgLink,`${a}_${d}`),"data-headless-type-name":`${a}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}`,children:(0,n.jsx)(_.default,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""})}),(0,n.jsxs)("div",{style:{width:v},className:(0,l.cn)("absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in",y&&v?"opacity-100":"opacity-0"),children:[(0,n.jsxs)("div",{className:"mr-16 flex-1 overflow-hidden",children:[(0,n.jsx)(M.Heading,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:e?.title}),(0,n.jsx)(M.Heading,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:e?.subTitle})]}),c&&(0,n.jsxs)(N.default,{className:(0,l.cn)("mb-1.5 font-bold"),as:"a",href:(0,g.trackUrlRef)(e?.link,`${a}_${d}`),"data-headless-type-name":`${a}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${c}`,onClick:()=>f?.primaryButton?.(w,t),children:[c,(0,n.jsx)("span",{className:"sr-only",children:e?.title??e?.subTitle})]})]})]},t)},O=({data:e,configuration:t})=>{const i=(0,r.useRef)(null);return(0,L.useExposure)(i,{componentType:a,componentName:d,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.subTitle}),(0,n.jsxs)("div",{ref:i,className:(0,l.cn)("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",t?.itemShape==="round"?"rounded-2xl":""),children:[(0,n.jsx)("a",{href:(0,g.trackUrlRef)(e?.imgLink,`${a}_${d}`),"data-headless-type-name":`${a}#${d}`,"data-headless-title-desc-button":`${e?.title}@${e?.subTitle}`,"data-headless-nav-postion":`''#${t?.index+1}`,children:(0,n.jsx)(_.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""})}),(0,n.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[(0,n.jsxs)("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[(0,n.jsx)("h3",{className:"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]",dangerouslySetInnerHTML:{__html:e?.title}}),(0,n.jsx)("h4",{className:"text-info-primary line-clamp-2 text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.subTitle}})]}),t?.primaryButton&&(0,n.jsx)(N.default,{as:"a",variant:"secondary","aria-label":e?.title??e?.subTitle,className:(0,l.cn)("text-info-primary text-sm font-bold"),href:(0,g.trackUrlRef)(e.link,`${a}_${d}`),"data-headless-type-name":`${a}#${d}`,"data-headless-nav-postion":`''#${t?.index+1}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${t?.primaryButton}`,children:t?.primaryButton})]})]})},H=r.default.forwardRef(({data:e,autoplay:t={enabled:!1,loop:!1,interval:1500},className:i="",event:p},m)=>{const[u,v]=(0,r.useState)(0),c=(0,r.useRef)(0),f=(0,r.useRef)([]),[w,k]=(0,r.useState)(0),y=(0,r.useRef)(null);(0,r.useImperativeHandle)(m,()=>y.current);const $=(o,s)=>{s&&(f.current[o]=s)};(0,r.useEffect)(()=>{const o=()=>{f.current[c.current]&&k(f.current[c.current].offsetWidth)};o();const s=(0,C.default)(o,300);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const x=(0,r.useCallback)(o=>{u!==o&&(v(o),c.current=o)},[e?.products,u]);return(0,r.useEffect)(()=>{let o;return t?.enabled&&(o=setInterval(()=>{v(s=>{const I=s??0;let b;if(t.loop!==!1)b=(I+1)%e?.products?.length;else if(b=I+1,b>=e?.products?.length)return b=e?.products?.length-1,o&&clearInterval(o),I;return c.current=b,b})},t?.interval)),()=>{o&&clearInterval(o)}},[t?.enabled,t?.interval,t?.loop,e?.products?.length,x]),(0,n.jsxs)(n.Fragment,{children:[e?.title&&(0,n.jsx)(B.default,{data:{title:e?.title}}),(0,n.jsx)("div",{ref:y,className:(0,l.cn)("laptop:block hidden",{"aiui-dark":e?.theme==="dark"}),children:(0,n.jsx)("div",{className:(0,l.cn)("lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden",i),children:e?.products?.map((o,s)=>(0,n.jsx)(q,{item:o,idx:s,itemShape:e?.itemShape,hoverIndex:u,getRef:$,handleSwiperItemClick:x,contentWidth:w,primaryButton:e?.primaryButton,event:p,data:e,accordionRef:f},s))})}),(0,n.jsx)("div",{className:(0,l.cn)("laptop:hidden block",{"aiui-dark":e?.theme==="dark"}),children:(0,n.jsx)(E.default,{className:(0,l.cn)("h-[400px] !overflow-visible",i),id:"AccordionCards"+e?.key,data:{list:e?.products,configuration:{shape:e?.shape,itemShape:e?.itemShape,primaryButton:e?.primaryButton,event:p,title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});H.displayName="AccordionCards";var J=(0,S.withLayout)(H);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /**\n * \u81EA\u52A8\u64AD\u653E\u914D\u7F6E\n */\n autoplay?: {\n /**\n * \u662F\u5426\u5F00\u542F\u81EA\u52A8\u64AD\u653E\n */\n enabled: boolean\n /**\n * \u662F\u5426\u5FAA\u73AF\u64AD\u653E\n */\n loop?: boolean\n /**\n * \u81EA\u52A8\u64AD\u653E\u95F4\u9694\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\n */\n interval?: number\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (_idx: number, _el: HTMLDivElement) => void\n handleSwiperItemClick: (_idx: number) => void\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a\n href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n {primaryButton && (\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a\n href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <p className=\"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]\">{data?.title}</p>\n <h3 className=\"text-info-primary line-clamp-2 text-sm font-semibold\">{data?.subTitle}</h3>\n </div>\n\n {configuration?.primaryButton && (\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(\n ({ data, autoplay = { enabled: false, loop: false, interval: 1500 }, className = '', event }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [data?.products, hoverIndex]\n )\n\n useEffect(() => {\n let autoPlayTimer: NodeJS.Timeout\n if (autoplay?.enabled) {\n autoPlayTimer = setInterval(() => {\n setHoverIndex(prev => {\n const currentIndex = prev ?? 0\n let nextIndex: number\n\n if (autoplay.loop !== false) {\n // \u9ED8\u8BA4\u5FAA\u73AF\u64AD\u653E\n nextIndex = (currentIndex + 1) % data?.products?.length\n } else {\n // \u4E0D\u5FAA\u73AF\uFF1A\u64AD\u653E\u5230\u6700\u540E\u4E00\u4E2A\u540E\u505C\u6B62\n nextIndex = currentIndex + 1\n if (nextIndex >= data?.products?.length) {\n nextIndex = data?.products?.length - 1\n // \u505C\u6B62\u81EA\u52A8\u64AD\u653E\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n return currentIndex // \u4FDD\u6301\u5728\u6700\u540E\u4E00\u4E2A\n }\n }\n\n hoverIndexRef.current = nextIndex\n return nextIndex\n })\n }, autoplay?.interval)\n }\n return () => {\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n }\n }, [autoplay?.enabled, autoplay?.interval, autoplay?.loop, data?.products?.length, handleSwiperItemClick])\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div ref={innerRef} className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </>\n )\n }\n)\n\nAccordionCards.displayName = 'AccordionCards'\nexport default withLayout(AccordionCards)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4HQ,IAAAI,EAAA,6BA3HRC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAqG,oBACrGC,EAA4B,sCAC5BC,EAA4B,uCAE5BC,EAAqB,uCACrBC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,eAoDhBC,EAAuB,CAAC,CAC5B,KAAAC,EACA,IAAAC,EACA,UAAAC,EACA,WAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,aAAAC,EACA,cAAAC,EACA,MAAAC,EACA,KAAAC,EACA,aAAAC,CACF,IAYM,CACJ,MAAMC,EAAaR,IAAeF,EAC5BW,EAAYD,EAAa,EAAI,EAEnC,wBAAY,CAAE,QAASD,EAAa,QAAQT,CAAG,CAAE,EAAgC,CAC/E,cAAAJ,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,SAAUC,EAAM,EAChB,qBAAsBD,GAAM,QAC9B,CAAC,KAGC,QAAC,OAEC,MAAO,CACL,KAAM,GAAGY,CAAS,QAClB,WAAY,UACd,EACA,IAA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GAAU,SAAUA,GAAU,KAAMZ,GAAM,UAAU,OAAQJ,CAAqB,CAAC,KAGvG,oBACG,UAAAI,GAAM,UAAS,OAAC,EAAA0B,QAAA,CAAM,KAAM,CAAE,MAAO1B,GAAM,KAAM,EAAG,KACrD,OAAC,OAAI,IAAKiB,EAAU,aAAW,MAAG,sBAAuB,CAAE,YAAajB,GAAM,QAAU,MAAO,CAAC,EAC9F,mBAAC,OACC,aAAW,MACT,2KACAa,CACF,EAEC,SAAAb,GAAM,UAAU,IAAI,CAACT,EAAMC,OAC1B,OAACF,EAAA,CAEC,KAAMC,EACN,IAAKC,EACL,UAAWQ,GAAM,UACjB,WAAYN,EACZ,OAAQC,EACR,sBAAuBC,EACvB,aAAcC,EACd,cAAeG,GAAM,cACrB,MAAOD,EACP,KAAMC,EACN,aAAcC,GAXTT,CAYP,CACD,EACH,EACF,KACA,OAAC,OAAI,aAAW,MAAG,sBAAuB,CAAE,YAAaQ,GAAM,QAAU,MAAO,CAAC,EAC/E,mBAAC,EAAA2B,QAAA,CACC,aAAW,MAAG,8BAA+Bd,CAAS,EACtD,GAAI,iBAAmBb,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOD,EACP,MAAOC,GAAM,KACf,CACF,EACA,MAAOO,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEAG,EAAe,YAAc,iBAC7B,IAAOpC,KAAQ,cAAWoC,CAAc",
4
+ "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /**\n * \u81EA\u52A8\u64AD\u653E\u914D\u7F6E\n */\n autoplay?: {\n /**\n * \u662F\u5426\u5F00\u542F\u81EA\u52A8\u64AD\u653E\n */\n enabled: boolean\n /**\n * \u662F\u5426\u5FAA\u73AF\u64AD\u653E\n */\n loop?: boolean\n /**\n * \u81EA\u52A8\u64AD\u653E\u95F4\u9694\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\n */\n interval?: number\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (_idx: number, _el: HTMLDivElement) => void\n handleSwiperItemClick: (_idx: number) => void\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a\n href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n {primaryButton && (\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a\n href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <h3\n className=\"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n ></h3>\n <h4\n className=\"text-info-primary line-clamp-2 text-sm font-bold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n ></h4>\n </div>\n\n {configuration?.primaryButton && (\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(\n ({ data, autoplay = { enabled: false, loop: false, interval: 1500 }, className = '', event }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [data?.products, hoverIndex]\n )\n\n useEffect(() => {\n let autoPlayTimer: NodeJS.Timeout\n if (autoplay?.enabled) {\n autoPlayTimer = setInterval(() => {\n setHoverIndex(prev => {\n const currentIndex = prev ?? 0\n let nextIndex: number\n\n if (autoplay.loop !== false) {\n // \u9ED8\u8BA4\u5FAA\u73AF\u64AD\u653E\n nextIndex = (currentIndex + 1) % data?.products?.length\n } else {\n // \u4E0D\u5FAA\u73AF\uFF1A\u64AD\u653E\u5230\u6700\u540E\u4E00\u4E2A\u540E\u505C\u6B62\n nextIndex = currentIndex + 1\n if (nextIndex >= data?.products?.length) {\n nextIndex = data?.products?.length - 1\n // \u505C\u6B62\u81EA\u52A8\u64AD\u653E\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n return currentIndex // \u4FDD\u6301\u5728\u6700\u540E\u4E00\u4E2A\n }\n }\n\n hoverIndexRef.current = nextIndex\n return nextIndex\n })\n }, autoplay?.interval)\n }\n return () => {\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n }\n }, [autoplay?.enabled, autoplay?.interval, autoplay?.loop, data?.products?.length, handleSwiperItemClick])\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div ref={innerRef} className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </>\n )\n }\n)\n\nAccordionCards.displayName = 'AccordionCards'\nexport default withLayout(AccordionCards)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4HQ,IAAAI,EAAA,6BA3HRC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAqG,oBACrGC,EAA4B,sCAC5BC,EAA4B,uCAE5BC,EAAqB,uCACrBC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,eAoDhBC,EAAuB,CAAC,CAC5B,KAAAC,EACA,IAAAC,EACA,UAAAC,EACA,WAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,aAAAC,EACA,cAAAC,EACA,MAAAC,EACA,KAAAC,EACA,aAAAC,CACF,IAYM,CACJ,MAAMC,EAAaR,IAAeF,EAC5BW,EAAYD,EAAa,EAAI,EAEnC,wBAAY,CAAE,QAASD,EAAa,QAAQT,CAAG,CAAE,EAAgC,CAC/E,cAAAJ,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,SAAUC,EAAM,EAChB,qBAAsBD,GAAM,QAC9B,CAAC,KAGC,QAAC,OAEC,MAAO,CACL,KAAM,GAAGY,CAAS,QAClB,WAAY,UACd,EACA,IAAMC,GAA8B,CAC9BA,GAAIT,EAAOH,EAAKY,CAAE,CACxB,EACA,aAAW,MAAG,0CAA2CX,IAAc,QAAU,cAAgB,EAAE,EACnG,aAAc,IAAMG,EAAsBJ,CAAG,EAC7C,QAAS,IAAM,CACbI,EAAsBJ,CAAG,CAC3B,EAEA,oBAAC,KACC,QAAM,eAAYD,GAAM,QAAS,GAAGH,CAAa,IAAIC,CAAa,EAAE,EACpE,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGE,GAAM,KAAK,IAAIA,GAAM,Q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AACT,EAAMC,OAC1B,OAACF,EAAA,CAEC,KAAMC,EACN,IAAKC,EACL,UAAWQ,GAAM,UACjB,WAAYN,EACZ,OAAQC,EACR,sBAAuBC,EACvB,aAAcC,EACd,cAAeG,GAAM,cACrB,MAAOD,EACP,KAAMC,EACN,aAAcC,GAXTT,CAYP,CACD,EACH,EACF,KACA,OAAC,OAAI,aAAW,MAAG,sBAAuB,CAAE,YAAaQ,GAAM,QAAU,MAAO,CAAC,EAC/E,mBAAC,EAAA2B,QAAA,CACC,aAAW,MAAG,8BAA+Bd,CAAS,EACtD,GAAI,iBAAmBb,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOD,EACP,MAAOC,GAAM,KACf,CACF,EACA,MAAOO,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEAG,EAAe,YAAc,iBAC7B,IAAOpC,KAAQ,cAAWoC,CAAc",
6
6
  "names": ["AccordionCards_exports", "__export", "AccordionCards_default", "__toCommonJS", "import_jsx_runtime", "import_Title", "import_utils", "import_picture", "import_button", "import_SwiperBox", "import_Styles", "import_react", "import_useExposure", "import_trackUrlRef", "import_throttle", "import_heading", "componentType", "componentName", "AccordionCardsPcItem", "item", "idx", "itemShape", "hoverIndex", "getRef", "handleSwiperItemClick", "contentWidth", "primaryButton", "event", "data", "accordionRef", "isExpanded", "flexValue", "el", "Picture", "Button", "MobileItem", "configuration", "ref", "AccordionCards", "React", "autoplay", "className", "setHoverIndex", "hoverIndexRef", "setContentWidth", "innerRef", "index", "handleResize", "throttleResize", "throttle", "autoPlayTimer", "prev", "currentIndex", "nextIndex", "Title", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var B=Object.create;var c=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var F=(e,i)=>{for(var s in i)c(e,s,{get:i[s],enumerable:!0})},w=(e,i,s,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of z(i))!A.call(e,r)&&r!==s&&c(e,r,{get:()=>i[r],enumerable:!(o=$(i,r))||o.enumerable});return e};var v=(e,i,s)=>(s=e!=null?B(I(e)):{},w(i||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),R=e=>w(c({},"__esModule",{value:!0}),e);var V={};F(V,{default:()=>H});module.exports=R(V);var t=require("react/jsx-runtime"),a=v(require("react")),g=require("react-dom"),y=v(require("../Title/index.js")),n=require("../../helpers/utils.js"),k=v(require("../../components/picture.js")),N=v(require("../SwiperBox/index.js")),M=require("../../shared/Styles.js"),p=require("../../components/avatar.js"),L=require("../../components/container.js"),C=require("../../components/text.js"),E=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js");const x="copy",b="product_review",D=({data:e,configuration:i})=>{const s=(0,a.useRef)(null),[o,r]=(0,a.useState)({visible:!1,x:0,y:0,text:""}),d=l=>{const m=Number(l),P=Number.isFinite(m)?Math.max(0,Math.floor(m)):0;return Array.from({length:P})||[]},u=l=>{e?.description&&r({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},f=()=>{r(l=>({...l,visible:!1}))};return(0,E.useExposure)(s,{componentType:x,componentName:b,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),(0,t.jsx)("div",{ref:s,className:(0,n.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",i?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:(0,t.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[(0,t.jsxs)("div",{className:(0,n.cn)("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[(0,t.jsxs)("div",{className:"flex-1",children:[e?.title?(0,t.jsx)("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,(0,t.jsx)("div",{className:"mt-1 flex items-center",children:d(e?.rating)?.map?.((l,m)=>(0,t.jsx)("div",{className:"mr-1",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,t.jsx)("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},m))})]}),(0,t.jsx)("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?(0,t.jsxs)(p.Avatar,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[(0,t.jsx)(p.AvatarImage,{src:e?.avatar?.url}),(0,t.jsx)(p.AvatarFallback,{children:e?.title})]}):null})]}),(0,t.jsxs)("div",{className:"flex-1",onMouseMove:u,onMouseLeave:f,children:[(0,t.jsx)(C.Text,{className:(0,n.cn)("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&o.visible&&(0,g.createPortal)((0,t.jsx)("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${o.x+16}px`,top:`${o.y+16}px`},children:o.text}),document.body)]}),(0,t.jsx)("a",{href:(0,T.trackUrlRef)(e?.link,`${x}_${b}`),onClick:()=>{i?.event?.primaryButton(e,i?.index+1)},"data-headless-type-name":`${x}#${b}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-postion":`''#${i?.index+1}`,children:(0,t.jsxs)("div",{className:(0,n.cn)("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",i?.shape==="round"?"rounded-lg":"rounded-none"),children:[(0,t.jsx)("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:(0,t.jsx)(k.default,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),(0,t.jsx)("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},h=a.default.forwardRef(({className:e="",data:i,key:s},o)=>{const{products:r,title:d,theme:u,...f}=i,l=(0,a.useRef)(null);return(0,a.useImperativeHandle)(o,()=>l.current),(0,t.jsx)("div",{className:e,ref:l,children:(0,t.jsx)("div",{className:"evaluate-box relative z-10",children:(0,t.jsx)(L.Container,{...i?.containerProps||{},className:"overflow-hidden",children:(0,t.jsxs)("div",{ref:o,className:(0,n.cn)("w-full",e,{"aiui-dark":u==="dark"}),children:[d&&(0,t.jsx)(y.default,{data:{title:d}}),(0,t.jsx)(N.default,{className:"!overflow-visible",id:"Evaluate"+s,data:{list:r,configuration:{...f,title:d}},Slide:D,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},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});h.displayName="Evaluate";var H=(0,M.withLayout)(h);
1
+ "use strict";"use client";var B=Object.create;var c=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var F=(e,i)=>{for(var s in i)c(e,s,{get:i[s],enumerable:!0})},w=(e,i,s,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of z(i))!A.call(e,r)&&r!==s&&c(e,r,{get:()=>i[r],enumerable:!(o=$(i,r))||o.enumerable});return e};var v=(e,i,s)=>(s=e!=null?B(I(e)):{},w(i||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),R=e=>w(c({},"__esModule",{value:!0}),e);var V={};F(V,{default:()=>H});module.exports=R(V);var t=require("react/jsx-runtime"),a=v(require("react")),g=require("react-dom"),k=v(require("../Title/index.js")),n=require("../../helpers/utils.js"),y=v(require("../../components/picture.js")),N=v(require("../SwiperBox/index.js")),M=require("../../shared/Styles.js"),p=require("../../components/avatar.js"),L=require("../../components/container.js"),C=require("../../components/text.js"),E=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js");const x="copy",b="product_review",D=({data:e,configuration:i})=>{const s=(0,a.useRef)(null),[o,r]=(0,a.useState)({visible:!1,x:0,y:0,text:""}),d=l=>{const m=Number(l),P=Number.isFinite(m)?Math.max(0,Math.floor(m)):0;return Array.from({length:P})||[]},u=l=>{e?.description&&r({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},f=()=>{r(l=>({...l,visible:!1}))};return(0,E.useExposure)(s,{componentType:x,componentName:b,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),(0,t.jsx)("div",{ref:s,className:(0,n.cn)("bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",i?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:(0,t.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[(0,t.jsxs)("div",{className:(0,n.cn)("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[(0,t.jsxs)("div",{className:"flex-1",children:[e?.title?(0,t.jsx)("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,(0,t.jsx)("div",{className:"mt-1 flex items-center",children:d(e?.rating)?.map?.((l,m)=>(0,t.jsx)("div",{className:"mr-1",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,t.jsx)("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},m))})]}),(0,t.jsx)("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?(0,t.jsxs)(p.Avatar,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[(0,t.jsx)(p.AvatarImage,{src:e?.avatar?.url}),(0,t.jsx)(p.AvatarFallback,{children:e?.title})]}):null})]}),(0,t.jsxs)("div",{className:"flex-1",onMouseMove:u,onMouseLeave:f,children:[(0,t.jsx)(C.Text,{className:(0,n.cn)("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&o.visible&&(0,g.createPortal)((0,t.jsx)("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${o.x+16}px`,top:`${o.y+16}px`},children:o.text}),document.body)]}),(0,t.jsx)("a",{href:(0,T.trackUrlRef)(e?.link,`${x}_${b}`),onClick:()=>{i?.event?.primaryButton(e,i?.index+1)},"data-headless-type-name":`${x}#${b}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-postion":`''#${i?.index+1}`,children:(0,t.jsxs)("div",{className:(0,n.cn)("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",i?.shape==="round"?"rounded-lg":"rounded-none"),children:[(0,t.jsx)("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:(0,t.jsx)(y.default,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),(0,t.jsx)("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},h=a.default.forwardRef(({className:e="",data:i,key:s},o)=>{const{products:r,title:d,theme:u,...f}=i,l=(0,a.useRef)(null);return(0,a.useImperativeHandle)(o,()=>l.current),(0,t.jsx)("div",{className:e,ref:l,children:(0,t.jsx)("div",{className:"evaluate-box relative z-10",children:(0,t.jsx)(L.Container,{...i?.containerProps||{},className:"overflow-hidden",children:(0,t.jsxs)("div",{ref:o,className:(0,n.cn)("w-full",e,{"aiui-dark":u==="dark"}),children:[d&&(0,t.jsx)(k.default,{data:{title:d}}),(0,t.jsx)(N.default,{className:"!overflow-visible",id:"Evaluate"+s,data:{list:r,configuration:{...f,title:d}},Slide:D,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},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});h.displayName="Evaluate";var H=(0,M.withLayout)(h);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Evaluate/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n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ACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDiB,EAAS,YAAc,WAEvB,IAAOlC,KAAQ,cAAWkC,CAAQ",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqGU,IAAAI,EAAA,6BApGVC,EAA6D,oBAC7DC,EAA6B,qBAC7BC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAoD,sCACpDC,EAA0B,yCAC1BC,EAAqB,oCAErBC,EAA4B,sCAC5BC,EAA4B,uCAG5B,MAAMC,EAAgB,OAChBC,EAAgB,iBAiChBC,EAAe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EAAGjB,IAAQ,CACvG,KAAM,CAAE,SAAAkB,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAM,EAAIvB,EACvCwB,KAAW,UAAuB,IAAI,EAC5C,gCAAoBtB,EAAK,IAAMsB,EAAS,OAAyB,KAG/D,OAAC,OAAI,UAAWN,EAAW,IAAKM,EAC9B,mBAAC,OAAI,UAAU,6BACb,mBAAC,aAAW,GAAIxB,GAAM,gBAAkB,CAAC,EAAI,UAAU,kBACrD,oBAAC,OAAI,IAAKE,EAAK,aAAW,MAAG,SAAUgB,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EAChF,UAAAD,MAAS,OAAC,EAAAI,QAAA,CAAM,KAAM,CAAE,MAAOJ,CAAM,EAAG,KACzC,OAAC,EAAAK,QAAA,CACC,UAAU,oBACV,GAAI,WAAaP,EACjB,KAAM,CAAE,KAAMC,EAAU,cAAe,CAAE,GAAGG,EAAO,MAAOF,CAAM,CAAE,EAClE,MAAOtB,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDiB,EAAS,YAAc,WAEvB,IAAOlC,KAAQ,cAAWkC,CAAQ",
6
6
  "names": ["Evaluate_exports", "__export", "Evaluate_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_dom", "import_Title", "import_utils", "import_picture", "import_SwiperBox", "import_Styles", "import_avatar", "import_container", "import_text", "import_useExposure", "import_trackUrlRef", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "tooltip", "setTooltip", "handleRating", "num", "raw", "count", "handleMouseMove", "e", "handleMouseLeave", "prev", "_", "index", "Picture", "Evaluate", "React", "className", "key", "products", "title", "theme", "ohter", "innerRef", "Title", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(t,l)=>{for(var n in l)a(t,n,{get:l[n],enumerable:!0})},x=(t,l,n,i)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of u(l))!f.call(t,r)&&r!==n&&a(t,r,{get:()=>l[r],enumerable:!(i=d(l,r))||i.enumerable});return t};var v=t=>x(a({},"__esModule",{value:!0}),t);var k={};g(k,{MenuItem:()=>h,SubSubCategoryContentComp:()=>y,SubSubCategoryItemComp:()=>N});module.exports=v(k);var e=require("react/jsx-runtime"),C=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),p=require("./icons/index.js"),c=require("./SidebarDropdown.js");const h=({label:t,href:l,onClick:n,active:i,icon:r,className:b})=>{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:r})}),r&&(0,e.jsx)(o.Text,{html:r,"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 l?(0,e.jsx)(o.Link,{href:l,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",b),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",b),"aria-expanded":i,children:m})},N=({matchSeriesMetadata:t,onSubSubCategoryItemClick:l,expanded:n})=>{const i=(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:i}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:i})},y=({matchSeriesMetadata:t})=>(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((l,n)=>(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:t?.banner?.href,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"})})]})]})}),l.products?.map((i,r)=>(0,e.jsx)(c.SeriesProductItem,{position:r,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${l?.label||""}-${n}-${r}`))]})]},`seriesItem-${l?.label||""}-${n}`))});
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}`))})};
2
2
  //# sourceMappingURL=MobileMenuComponents.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MobileMenuComponents.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { Text, Link, Heading, Picture } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { DownArrow } from './icons/index.js'\nimport { SeriesProductItem } from './SidebarDropdown.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u83DC\u5355\u9879\n */\nexport const MenuItem = ({\n label,\n href,\n onClick,\n active,\n icon,\n className,\n}: {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}) => {\n const content = (\n <>\n <div className=\"flex items-center gap-4\">\n <Text html={label} className={cn('text-sm font-bold leading-[1.4]', { underline: icon })} />\n {icon && <Text html={icon} aria-hidden=\"true\" />}\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </>\n )\n\n return href ? (\n <Link\n href={href}\n className={cn('flex cursor-pointer items-center justify-between py-4 no-underline', className)}\n onClick={onClick}\n >\n {content}\n </Link>\n ) : (\n <button\n onClick={onClick}\n className={cn(\n 'flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left',\n className\n )}\n aria-expanded={active}\n >\n {content}\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u6807\u9898\u7EC4\u4EF6\n */\nexport const SubSubCategoryItemComp = ({\n matchSeriesMetadata,\n onSubSubCategoryItemClick,\n expanded,\n}: {\n matchSeriesMetadata: any\n onSubSubCategoryItemClick?: () => void\n expanded?: boolean\n}) => {\n const content = (\n <>\n {matchSeriesMetadata?.label && (\n <Text html={matchSeriesMetadata?.label} className=\"text-sm font-bold leading-[1.4]\" />\n )}\n {onSubSubCategoryItemClick && (\n <DownArrow\n aria-hidden=\"true\"\n className={cn('size-5', {\n ['rotate-180']: expanded,\n })}\n />\n )}\n </>\n )\n\n return onSubSubCategoryItemClick ? (\n <button\n className=\"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onSubSubCategoryItemClick}\n aria-expanded={expanded}\n >\n {content}\n </button>\n ) : (\n <div className=\"tablet:pt-0 flex items-center justify-between py-4\">{content}</div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u5185\u5BB9\u7EC4\u4EF6\n */\nexport const SubSubCategoryContentComp = ({ matchSeriesMetadata }: { matchSeriesMetadata: any }) => {\n return (\n <div className=\"laptop:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.series?.length &&\n matchSeriesMetadata?.series?.map((seriesItem: any, pIndex: number) => (\n <div key={`seriesItem-${seriesItem?.label || ''}-${pIndex}`}>\n {seriesItem.label && (\n <Text html={seriesItem.label} as=\"p\" className=\"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]\" />\n )}\n <div className=\"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.banner && (\n <Link asChild={!matchSeriesMetadata?.banner?.href} href={matchSeriesMetadata?.banner?.href}>\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={matchSeriesMetadata?.banner?.imageUrl}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={matchSeriesMetadata?.banner?.title || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n <Text\n html={matchSeriesMetadata?.banner?.desc || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {seriesItem.products?.map((product: any, index: number) => (\n <SeriesProductItem\n position={index}\n key={`seriesProductItem-${seriesItem?.label || ''}-${pIndex}-${index}`}\n product={product}\n seriesLabel={matchSeriesMetadata?.label}\n isCollection={matchSeriesMetadata?.isCollection}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,8BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAL,GAyBI,IAAAM,EAAA,6BAzBJC,EAAkB,iBAClBC,EAA6C,qCAC7CC,EAAmB,kCACnBC,EAA0B,4BAC1BC,EAAkC,gCAK3B,MAAMT,EAAW,CAAC,CACvB,MAAAU,EACA,KAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,EACA,UAAAC,CACF,IAOM,CACJ,MAAMC,KACJ,oBACE,qBAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,KAAMN,EAAO,aAAW,MAAG,kCAAmC,CAAE,UAAWI,CAAK,CAAC,EAAG,EACzFA,MAAQ,OAAC,QAAK,KAAMA,EAAM,cAAY,OAAO,GAChD,KACA,OAAC,OACC,UAAW,UAAUD,EAAS,YAAc,EAAE,GAC9C,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,cAAY,OAEZ,mBAAC,QAAK,EAAE,kBAAkB,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,EAC/G,GACF,EAGF,OAAOF,KACL,OAAC,QACC,KAAMA,EACN,aAAW,MAAG,qEAAsEI,CAAS,EAC7F,QAASH,EAER,SAAAI,EACH,KAEA,OAAC,UACC,QAASJ,EACT,aAAW,MACT,iGACAG,CACF,EACA,gBAAeF,EAEd,SAAAG,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AAaL,GAAqB,MAClC,aAAcA,GAAqB,cAH9B,qBAAqBG,GAAY,OAAS,EAAE,IAAIC,CAAM,IAAIE,CAAK,EAItE,CACD,GACH,IAxCQ,cAAcH,GAAY,OAAS,EAAE,IAAIC,CAAM,EAyCzD,CACD,EACL",
6
- "names": ["MobileMenuComponents_exports", "__export", "MenuItem", "SubSubCategoryContentComp", "SubSubCategoryItemComp", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_icons", "import_SidebarDropdown", "label", "href", "onClick", "active", "icon", "className", "content", "matchSeriesMetadata", "onSubSubCategoryItemClick", "expanded", "seriesItem", "pIndex", "product", "index"]
4
+ "sourcesContent": ["import React from 'react'\nimport { Text, Link, Heading, Picture } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { DownArrow } from './icons/index.js'\nimport { SeriesProductItem } from './SidebarDropdown.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u83DC\u5355\u9879\n */\nexport const MenuItem = ({\n label,\n href,\n onClick,\n active,\n icon,\n className,\n}: {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}) => {\n const content = (\n <>\n <div className=\"flex items-center gap-4\">\n <Text html={label} className={cn('text-sm font-bold leading-[1.4]', { underline: icon })} />\n {icon && <Text html={icon} aria-hidden=\"true\" />}\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </>\n )\n\n return href ? (\n <Link\n href={href}\n className={cn('flex cursor-pointer items-center justify-between py-4 no-underline', className)}\n onClick={onClick}\n >\n {content}\n </Link>\n ) : (\n <button\n onClick={onClick}\n className={cn(\n 'flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left',\n className\n )}\n aria-expanded={active}\n >\n {content}\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u6807\u9898\u7EC4\u4EF6\n */\nexport const SubSubCategoryItemComp = ({\n matchSeriesMetadata,\n onSubSubCategoryItemClick,\n expanded,\n}: {\n matchSeriesMetadata: any\n onSubSubCategoryItemClick?: () => void\n expanded?: boolean\n}) => {\n const content = (\n <>\n {matchSeriesMetadata?.label && (\n <Text html={matchSeriesMetadata?.label} className=\"text-sm font-bold leading-[1.4]\" />\n )}\n {onSubSubCategoryItemClick && (\n <DownArrow\n aria-hidden=\"true\"\n className={cn('size-5', {\n ['rotate-180']: expanded,\n })}\n />\n )}\n </>\n )\n\n return onSubSubCategoryItemClick ? (\n <button\n className=\"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onSubSubCategoryItemClick}\n aria-expanded={expanded}\n >\n {content}\n </button>\n ) : (\n <div className=\"tablet:pt-0 flex items-center justify-between py-4\">{content}</div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u5185\u5BB9\u7EC4\u4EF6\n */\nexport const SubSubCategoryContentComp = ({ matchSeriesMetadata }: { matchSeriesMetadata: any }) => {\n const { locale = 'us' } = useAiuiContext()\n return (\n <div className=\"laptop:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.series?.length &&\n matchSeriesMetadata?.series?.map((seriesItem: any, pIndex: number) => (\n <div key={`seriesItem-${seriesItem?.label || ''}-${pIndex}`}>\n {seriesItem.label && (\n <Text html={seriesItem.label} as=\"p\" className=\"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]\" />\n )}\n <div className=\"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.banner && (\n <Link\n asChild={!matchSeriesMetadata?.banner?.href}\n href={getLocalizedPath(matchSeriesMetadata?.banner?.href, locale)}\n >\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={matchSeriesMetadata?.banner?.imageUrl}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={matchSeriesMetadata?.banner?.title || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n <Text\n html={matchSeriesMetadata?.banner?.desc || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {seriesItem.products?.map((product: any, index: number) => (\n <SeriesProductItem\n position={index}\n key={`seriesProductItem-${seriesItem?.label || ''}-${pIndex}-${index}`}\n product={product}\n seriesLabel={matchSeriesMetadata?.label}\n isCollection={matchSeriesMetadata?.isCollection}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,8BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAL,GA0BI,IAAAM,EAAA,6BA1BJC,EAAkB,iBAClBC,EAA6C,qCAC7CC,EAAqC,kCACrCC,EAA0B,4BAC1BC,EAAkC,gCAClCC,EAA+B,oCAKxB,MAAMV,EAAW,CAAC,CACvB,MAAAW,EACA,KAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,EACA,UAAAC,CACF,IAOM,CACJ,MAAMC,KACJ,oBACE,qBAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,KAAMN,EAAO,aAAW,MAAG,kCAAmC,CAAE,UAAWI,CAAK,CAAC,EAAG,EACzFA,MAAQ,OAAC,QAAK,KAAMA,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CAAM,EAEhE,oBAAC,OAAI,UAAU,2FACb,oBAAC,WACC,OAAQH,GAAqB,QAAQ,SACrC,UAAU,6BACV,aAAa,sBACf,KACA,QAAC,OAAI,UAAU,kCACb,oBAAC,WACC,KAAM,EACN,KAAMA,GAAqB,QAAQ,OAAS,eAC5C,aAAW,MAAG,uBAAwB,CACpC,aAAcA,GAAqB,QAAQ,QAAU,MACvD,CAAC,EACH,KACA,OAAC,QACC,KAAMA,GAAqB,QAAQ,MAAQ,YAC3C,aAAW,MAAG,+BAAgC,CAC5C,aAAcA,GAAqB,QAAQ,QAAU,MACvD,CAAC,EACH,GACF,GACF,EACF,EAEDI,EAAW,UAAU,IAAI,CAACE,EAAcC,OACvC,OAAC,qBACC,SAAUA,EAEV,QAASD,EACT,YAAaN,GAAqB,MAClC,aAAcA,GAAqB,cAH9B,qBAAqBI,GAAY,OAAS,EAAE,IAAIC,CAAM,IAAIE,CAAK,EAItE,CACD,GACH,IA3CQ,cAAcH,GAAY,OAAS,EAAE,IAAIC,CAAM,EA4CzD,CACD,EACL,CAEJ",
6
+ "names": ["MobileMenuComponents_exports", "__export", "MenuItem", "SubSubCategoryContentComp", "SubSubCategoryItemComp", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_icons", "import_SidebarDropdown", "import_AiuiProvider", "label", "href", "onClick", "active", "icon", "className", "content", "matchSeriesMetadata", "onSubSubCategoryItemClick", "expanded", "locale", "seriesItem", "pIndex", "product", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var g=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var B=(t,a)=>{for(var r in a)g(t,r,{get:a[r],enumerable:!0})},j=(t,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of L(a))!$.call(t,l)&&l!==r&&g(t,l,{get:()=>a[l],enumerable:!(i=M(a,l))||i.enumerable});return t};var z=t=>j(g({},"__esModule",{value:!0}),t);var I={};B(I,{MobileResourceSidebarMenu:()=>_});module.exports=z(I);var e=require("react/jsx-runtime"),s=require("react"),x=require("../../components/index.js"),d=require("./types.js"),R=require("./NavProvider.js"),c=require("./ResourceItem.js");const E=({label:t,onClick:a,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:a,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-4",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:t})}),(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"})})]}),_=({resourceCategoriesMetadata:t,resourcesMetadata:a})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:h,onSidebarNavClick:m,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,R.useNavContext)(),[S,k]=(0,s.useState)([]),[y,w]=(0,s.useState)([]);(0,s.useEffect)(()=>{t?.subcategories?.length&&k(t?.subcategories?.map((o,n)=>({index:n,open:!1})))},[t]),(0,s.useEffect)(()=>{l?.subSubCategories?.length&&w(l?.subSubCategories?.map((o,n)=>({index:n,open:n===0})))},[l]);const C=(0,s.useCallback)(o=>{h?.(o);const n=a?.find(b=>o?.label?.toLowerCase()===b.label?.toLowerCase())||{};i&&i(d.HeaderNavigationMenu.Third),f&&f(n)},[a,i,h,f]);return(0,s.useMemo)(()=>{switch(r){case d.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[(0,e.jsx)("div",{children:t?.subcategories?.map((o,n)=>(0,e.jsx)("div",{children:(0,e.jsx)(E,{label:o?.label,active:S.find(b=>b.index===n)?.open,onClick:()=>{C(o),m?.(o,n)}})},`${o.label}-${n}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&(0,e.jsx)(x.Button,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(x.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case d.HeaderNavigationMenu.Third:return(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:l?.subSubCategories?l?.subSubCategories?.map((o,n)=>{const b=a?.find(u=>u.label.toLowerCase()===o?.label?.toLowerCase())||{};return(0,e.jsxs)("div",{children:[Reflect.ownKeys(o).length>0&&(0,e.jsx)(c.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:b,onSubSubCategoryItemClick:()=>{m?.(o,n),w(u=>u.map((v,N)=>({...v,open:N===n?!v.open:v.open})))},expanded:!!y?.find(u=>u.index===n)?.open}),y?.find(u=>u.index===n)?.open&&(0,e.jsx)(c.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:b})]},`${o.label}-${n}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(p).length>0&&(0,e.jsx)(c.ResourceSubSubCategoryItemComp,{matchResourcesMetadata:p}),(0,e.jsx)(c.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:p})]})});default:return null}},[r,t,a,S,y,l,p,C,m])};
1
+ "use strict";var x=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var E=(t,a)=>{for(var r in a)x(t,r,{get:a[r],enumerable:!0})},_=(t,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of B(a))!j.call(t,l)&&l!==r&&x(t,l,{get:()=>a[l],enumerable:!(i=z(a,l))||i.enumerable});return t};var I=t=>_(x({},"__esModule",{value:!0}),t);var A={};E(A,{MobileResourceSidebarMenu:()=>T});module.exports=I(A);var e=require("react/jsx-runtime"),s=require("react"),h=require("../../components/index.js"),m=require("./types.js"),N=require("./NavProvider.js"),b=require("./ResourceItem.js"),M=require("../AiuiProvider/index.js"),C=require("../../helpers/utils.js");const K=({label:t,onClick:a,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:a,"aria-expanded":r,children:[(0,e.jsx)("div",{className:"flex items-center gap-4",children:(0,e.jsx)("span",{className:"text-sm font-bold leading-[1.4]",children:t})}),(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"})})]}),T=({resourceCategoriesMetadata:t,resourcesMetadata:a})=>{const{currentMenu:r,setCurrentMenu:i,subSubCategory:l,setSubSubCategory:S,onSidebarNavClick:d,currentResourceMetadata:p,setCurrentResourceMetadata:f}=(0,N.useNavContext)(),{locale:y="us"}=(0,M.useAiuiContext)(),[w,L]=(0,s.useState)([]),[g,R]=(0,s.useState)([]);(0,s.useEffect)(()=>{t?.subcategories?.length&&L(t?.subcategories?.map((o,n)=>({index:n,open:!1})))},[t]),(0,s.useEffect)(()=>{l?.subSubCategories?.length&&R(l?.subSubCategories?.map((o,n)=>({index:n,open:n===0})))},[l]);const k=(0,s.useCallback)(o=>{S?.(o);const n=a?.find(c=>o?.label?.toLowerCase()===c.label?.toLowerCase())||{};i&&i(m.HeaderNavigationMenu.Third),f&&f(n)},[a,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 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[(0,e.jsx)("div",{children:t?.subcategories?.map((o,n)=>(0,e.jsx)("div",{children:(0,e.jsx)(K,{label:o?.label,active:w.find(c=>c.index===n)?.open,onClick:()=>{k(o),d?.(o,n)}})},`${o.label}-${n}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&(0,e.jsx)(h.Button,{as:"a",href:`${(0,C.getLocalizedPath)(t?.primary?.url,y)}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(h.Button,{as:"a",href:(0,C.getLocalizedPath)(t?.secondary?.url,y),variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.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,n)=>{const c=a?.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,n),R(u=>u.map((v,$)=>({...v,open:$===n?!v.open:v.open})))},expanded:!!g?.find(u=>u.index===n)?.open}),g?.find(u=>u.index===n)?.open&&(0,e.jsx)(b.ResourceSubSubCategoryContentComp,{matchResourcesMetadata:c})]},`${o.label}-${n}`)}):(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,t,a,w,g,l,p,k,d,y])};
2
2
  //# sourceMappingURL=MobileResourceSidebarMenu.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MobileResourceSidebarMenu.tsx"],
4
- "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { ResourceSubSubCategoryItemComp, ResourceSubSubCategoryContentComp } from './ResourceItem.js'\n\ninterface MenuItem {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}\n\nconst MenuItem = ({ label, onClick, active }: MenuItem) => {\n return (\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onClick}\n aria-expanded={active}\n >\n <div className=\"flex items-center gap-4\">\n <span className=\"text-sm font-bold leading-[1.4]\">{label}</span>\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u8D44\u6E90\u4F4D\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param resourceCategoriesMetadata \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n * @param resourcesMetadata \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n */\nexport const MobileResourceSidebarMenu = ({\n resourceCategoriesMetadata,\n resourcesMetadata,\n}: {\n resourceCategoriesMetadata: any\n resourcesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n onSidebarNavClick,\n currentResourceMetadata,\n setCurrentResourceMetadata,\n } = useNavContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedResourceCategories, setExpandedResourceCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (resourceCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n resourceCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [resourceCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedResourceCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any) => {\n setSubSubCategory?.(item)\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (resourceItem: any) => item?.label?.toLowerCase() === resourceItem.label?.toLowerCase()\n ) || {}\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setCurrentResourceMetadata && setCurrentResourceMetadata(curResourcesMetadata)\n },\n [resourcesMetadata, setCurrentMenu, setSubSubCategory, setCurrentResourceMetadata]\n )\n\n const MobileResourceSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {resourceCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {resourceCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${resourceCategoriesMetadata?.primary?.url}?ref=${resourceCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {resourceCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {resourceCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={resourceCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {resourceCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <ResourceSubSubCategoryItemComp\n matchResourcesMetadata={curResourcesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedResourceCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedResourceCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedResourceCategories?.find(item => item.index === index)?.open && (\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={curResourcesMetadata} />\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentResourceMetadata).length > 0 && (\n <ResourceSubSubCategoryItemComp matchResourcesMetadata={currentResourceMetadata} />\n )}\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={currentResourceMetadata} />\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n resourceCategoriesMetadata,\n resourcesMetadata,\n expandedSubcategory,\n expandedResourceCategories,\n subSubCategory,\n currentResourceMetadata,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n ])\n\n return MobileResourceSidebarMenuComp\n}\n"],
5
- "mappings": "yaA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AAC,OACE,kBAAQ,QAAQA,CAAkB,EAAE,OAAS,MAC5C,OAAC,kCACC,uBAAwBF,EACxB,0BAA2B,IAAM,CAC/BX,IAAoBa,EAAoBL,CAAK,EAC7CF,EAA8BQ,GAC5BA,EAAK,IAAI,CAACJ,EAAMK,KAAO,CAAE,GAAGL,EAAM,KAAMK,IAAMP,EAAQ,CAACE,EAAK,KAAOA,EAAK,IAAK,EAAE,CACjF,CACF,EACA,SAAU,CAAC,CAACL,GAA4B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,KAC9E,EAEDH,GAA4B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,SAC/D,OAAC,qCAAkC,uBAAwBG,EAAsB,IAd3E,GAAGE,EAAmB,KAAK,IAAIL,CAAK,EAgB9C,CAEJ,CAAC,KAED,oBACG,kBAAQ,QAAQP,CAAuB,EAAE,OAAS,MACjD,OAAC,kCAA+B,uBAAwBA,EAAyB,KAEnF,OAAC,qCAAkC,uBAAwBA,EAAyB,GACtF,EAEJ,EAEJ,QACE,OAAO,IACX,CACF,EAAG,CACDL,EACAF,EACAC,EACAQ,EACAE,EACAP,EACAG,EACAQ,EACAT,CACF,CAAC,CAGH",
6
- "names": ["MobileResourceSidebarMenu_exports", "__export", "MobileResourceSidebarMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_types", "import_NavProvider", "import_ResourceItem", "MenuItem", "label", "onClick", "active", "resourceCategoriesMetadata", "resourcesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "onSidebarNavClick", "currentResourceMetadata", "setCurrentResourceMetadata", "expandedSubcategory", "setExpandedSubcategory", "expandedResourceCategories", "setExpandedResourceCategories", "_", "index", "handleSubSubCategoryClick", "item", "curResourcesMetadata", "resourceItem", "subSubCategoryItem", "prev", "i"]
4
+ "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { ResourceSubSubCategoryItemComp, ResourceSubSubCategoryContentComp } from './ResourceItem.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\ninterface MenuItem {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}\n\nconst MenuItem = ({ label, onClick, active }: MenuItem) => {\n return (\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onClick}\n aria-expanded={active}\n >\n <div className=\"flex items-center gap-4\">\n <span className=\"text-sm font-bold leading-[1.4]\">{label}</span>\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u8D44\u6E90\u4F4D\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param resourceCategoriesMetadata \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n * @param resourcesMetadata \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n */\nexport const MobileResourceSidebarMenu = ({\n resourceCategoriesMetadata,\n resourcesMetadata,\n}: {\n resourceCategoriesMetadata: any\n resourcesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n onSidebarNavClick,\n currentResourceMetadata,\n setCurrentResourceMetadata,\n } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedResourceCategories, setExpandedResourceCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (resourceCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n resourceCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [resourceCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedResourceCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any) => {\n setSubSubCategory?.(item)\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (resourceItem: any) => item?.label?.toLowerCase() === resourceItem.label?.toLowerCase()\n ) || {}\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setCurrentResourceMetadata && setCurrentResourceMetadata(curResourcesMetadata)\n },\n [resourcesMetadata, setCurrentMenu, setSubSubCategory, setCurrentResourceMetadata]\n )\n\n const MobileResourceSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {resourceCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {resourceCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(resourceCategoriesMetadata?.primary?.url, locale)}?ref=${resourceCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {resourceCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {resourceCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={getLocalizedPath(resourceCategoriesMetadata?.secondary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {resourceCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <ResourceSubSubCategoryItemComp\n matchResourcesMetadata={curResourcesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedResourceCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedResourceCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedResourceCategories?.find(item => item.index === index)?.open && (\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={curResourcesMetadata} />\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentResourceMetadata).length > 0 && (\n <ResourceSubSubCategoryItemComp matchResourcesMetadata={currentResourceMetadata} />\n )}\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={currentResourceMetadata} />\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n resourceCategoriesMetadata,\n resourcesMetadata,\n expandedSubcategory,\n expandedResourceCategories,\n subSubCategory,\n currentResourceMetadata,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n locale,\n ])\n\n return MobileResourceSidebarMenuComp\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAA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JjB,GAAmB,KAChBgB,GAAcA,EAAK,MAAM,YAAY,IAAMG,GAAoB,OAAO,YAAY,CACrF,GAAK,CAAC,EACR,SACE,QAAC,OACE,kBAAQ,QAAQA,CAAkB,EAAE,OAAS,MAC5C,OAAC,kCACC,uBAAwBF,EACxB,0BAA2B,IAAM,CAC/BZ,IAAoBc,EAAoBL,CAAK,EAC7CF,EAA8BQ,GAC5BA,EAAK,IAAI,CAACJ,EAAMK,KAAO,CAAE,GAAGL,EAAM,KAAMK,IAAMP,EAAQ,CAACE,EAAK,KAAOA,EAAK,IAAK,EAAE,CACjF,CACF,EACA,SAAU,CAAC,CAACL,GAA4B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,KAC9E,EAEDH,GAA4B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,SAC/D,OAAC,qCAAkC,uBAAwBG,EAAsB,IAd3E,GAAGE,EAAmB,KAAK,IAAIL,CAAK,EAgB9C,CAEJ,CAAC,KAED,oBACG,kBAAQ,QAAQR,CAAuB,EAAE,OAAS,MACjD,OAAC,kCAA+B,uBAAwBA,EAAyB,KAEnF,OAAC,qCAAkC,uBAAwBA,EAAyB,GACtF,EAEJ,EAEJ,QACE,OAAO,IACX,CACF,EAAG,CACDL,EACAF,EACAC,EACAS,EACAE,EACAR,EACAG,EACAS,EACAV,EACAG,CACF,CAAC,CAGH",
6
+ "names": ["MobileResourceSidebarMenu_exports", "__export", "MobileResourceSidebarMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_types", "import_NavProvider", "import_ResourceItem", "import_AiuiProvider", "import_utils", "MenuItem", "label", "onClick", "active", "resourceCategoriesMetadata", "resourcesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "onSidebarNavClick", "currentResourceMetadata", "setCurrentResourceMetadata", "locale", "expandedSubcategory", "setExpandedSubcategory", "expandedResourceCategories", "setExpandedResourceCategories", "_", "index", "handleSubSubCategoryClick", "item", "curResourcesMetadata", "resourceItem", "subSubCategoryItem", "prev", "i"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var x=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var E=(a,r)=>{for(var m in r)x(a,m,{get:r[m],enumerable:!0})},R=(a,r,m,y)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of z(r))!_.call(a,t)&&t!==m&&x(a,t,{get:()=>r[t],enumerable:!(y=M(r,t))||y.enumerable});return a};var T=a=>R(x({},"__esModule",{value:!0}),a);var K={};E(K,{MobileSidebarMenu:()=>D});module.exports=T(K);var e=require("react/jsx-runtime"),i=require("react"),u=require("../../components/index.js"),f=require("./types.js"),L=require("./NavProvider.js"),b=require("./MobileMenuComponents.js");const D=({sidebarCategoriesMetadata:a,seriesMetadata:r})=>{const{currentMenu:m,setCurrentMenu:y,subSubCategory:t,setSubSubCategory:C,setCurrentSeriesMetadata:S,currentSeriesMetadata:p,buildProps:d,onSidebarNavClick:v}=(0,L.useNavContext)(),[w,$]=(0,i.useState)([]),[g,N]=(0,i.useState)([]);(0,i.useEffect)(()=>{a?.subcategories?.length&&$(a?.subcategories?.map((l,n)=>({index:n,open:!1})))},[a]),(0,i.useEffect)(()=>{t?.subSubCategories?.length&&N(t?.subSubCategories?.map((l,n)=>({index:n,open:n===0})))},[t]);const k=(0,i.useCallback)((l,n)=>{y&&y(f.HeaderNavigationMenu.Third),C?.(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=d?.categories?.[l?.collections]||{};S?.({label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:o?.products}]})}else S?.(s)},[r,y,C,S,d?.categories]);return(0,i.useMemo)(()=>{switch(m){case f.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between 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:w.find(s=>s.index===n)?.open,onClick:()=>{k(l),v?.(l,n)}})},`${l.label}-${n}`)),a?.guide?.label&&(0,e.jsx)(u.Link,{href:a?.guide?.url,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:`${a?.primary?.url}?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:a?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:a?.secondary?.label})]})]});case f.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(c=>c.label.toLowerCase()===l?.label?.toLowerCase())||{};let o={};if(l?.collections){const c=d?.categories?.[l?.collections]||{};o={label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:c?.products}]}}else o=s;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(l).length>0&&(0,e.jsx)(b.SubSubCategoryItemComp,{matchSeriesMetadata:o,onSubSubCategoryItemClick:()=>{v?.(l,n),N(c=>c.map((h,B)=>({...h,open:B===n?!h.open:h.open})))},expanded:!!g?.find(c=>c.index===n)?.open}),g?.find(c=>c.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)(u.Button,{as:"a",href:o?.primary?.url,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)(u.Button,{as:"a",href:`${p?.primary?.url}?ref=${p?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:p?.primary?.label})})]})});default:return null}},[m,a,r,w,g,t,p,d?.categories,k,v])};
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,y)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of R(n))!T.call(a,t)&&t!==m&&w(a,t,{get:()=>n[t],enumerable:!(y=E(n,t))||y.enumerable});return a};var P=a=>K(w({},"__esModule",{value:!0}),a);var A={};D(A,{MobileSidebarMenu:()=>j});module.exports=P(A);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 j=({sidebarCategoriesMetadata:a,seriesMetadata:n})=>{const{currentMenu:m,setCurrentMenu:y,subSubCategory:t,setSubSubCategory:N,setCurrentSeriesMetadata:g,currentSeriesMetadata:p,buildProps:S,onSidebarNavClick:h}=(0,z.useNavContext)(),{locale:d="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)(()=>{t?.subSubCategories?.length&&L(t?.subSubCategories?.map((l,r)=>({index:r,open:r===0})))},[t]);const $=(0,i.useCallback)((l,r)=>{y&&y(v.HeaderNavigationMenu.Third),N?.(l);const s=n?.find(o=>r!==void 0?l?.subSubCategories?.[r]?.label?.toLowerCase()===o.label?.toLowerCase():l?.label?.toLowerCase()===o.label?.toLowerCase())||{};if(l?.collections){const o=S?.categories?.[l?.collections]||{};g?.({label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:o?.products}]})}else g?.(s)},[n,y,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 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between 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,d),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,d)}?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,d),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:t?.subSubCategories?t?.subSubCategories?.map((l,r)=>{const s=n?.find(c=>c.label.toLowerCase()===l?.label?.toLowerCase())||{};let o={};if(l?.collections){const c=S?.categories?.[l?.collections]||{};o={label:s?.label,isCollection:!0,banner:s?.banner,primary:s?.primary,series:[{products:c?.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,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:o}),o?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(u.Button,{as:"a",href:(0,f.getLocalizedPath)(o?.primary?.url,d),className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:o?.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,d)}?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,t,p,S?.categories,$,h,d])};
2
2
  //# sourceMappingURL=MobileSidebarMenu.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MobileSidebarMenu.tsx"],
4
- "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button, Text, Link } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { MenuItem, SubSubCategoryItemComp, SubSubCategoryContentComp } from './MobileMenuComponents.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nexport const MobileSidebarMenu = ({\n sidebarCategoriesMetadata,\n seriesMetadata,\n}: {\n sidebarCategoriesMetadata: any\n seriesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n setCurrentSeriesMetadata,\n currentSeriesMetadata,\n buildProps,\n onSidebarNavClick,\n } = useNavContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedSeriesCategories, setExpandedSeriesCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (sidebarCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n sidebarCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [sidebarCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedSeriesCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any, subIndex?: number) => {\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setSubSubCategory?.(item)\n const curSeriesMetadata =\n seriesMetadata?.find((seriesItem: any) =>\n subIndex !== undefined\n ? item?.subSubCategories?.[subIndex]?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n : item?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n ) || {}\n // \u901A\u8FC7categoriesMetadata\u7684subSubCategories\u7684label\u4E0Eseries\u7684label\u5339\u914D\n if (item?.collections) {\n const category = buildProps?.categories?.[item?.collections] || {}\n setCurrentSeriesMetadata?.({\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n })\n } else {\n setCurrentSeriesMetadata?.(curSeriesMetadata)\n }\n },\n [seriesMetadata, setCurrentMenu, setSubSubCategory, setCurrentSeriesMetadata, buildProps?.categories]\n )\n\n const MobileSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {sidebarCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n {sidebarCategoriesMetadata?.guide?.label && (\n <Link href={sidebarCategoriesMetadata?.guide?.url}>\n <div className=\"mt-4\">\n <Text\n html={sidebarCategoriesMetadata?.guide?.label}\n className=\"text-sm font-bold leading-[1.2] text-[#6D6D6F]\"\n />\n </div>\n </Link>\n )}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {sidebarCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${sidebarCategoriesMetadata?.primary?.url}?ref=${sidebarCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {sidebarCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {sidebarCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={sidebarCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {sidebarCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curSeriesMetadata =\n seriesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n let matchSeriesMetadata = {} as any\n if (subSubCategoryItem?.collections) {\n const category = buildProps?.categories?.[subSubCategoryItem?.collections] || {}\n matchSeriesMetadata = {\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n matchSeriesMetadata = curSeriesMetadata\n }\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <SubSubCategoryItemComp\n matchSeriesMetadata={matchSeriesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedSeriesCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedSeriesCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedSeriesCategories?.find(item => item.index === index)?.open && (\n <>\n <SubSubCategoryContentComp matchSeriesMetadata={matchSeriesMetadata} />\n {matchSeriesMetadata?.primary && (\n <div className=\"my-4 text-center\">\n <Button\n as=\"a\"\n href={matchSeriesMetadata?.primary?.url}\n className=\"text-base leading-[1.2] no-underline\"\n variant=\"secondary\"\n size=\"base\"\n >\n {matchSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentSeriesMetadata).length > 0 && (\n <SubSubCategoryItemComp matchSeriesMetadata={currentSeriesMetadata} />\n )}\n <SubSubCategoryContentComp matchSeriesMetadata={currentSeriesMetadata} />\n {currentSeriesMetadata?.primary && (\n <div className=\"my-4 text-center \">\n <Button\n as=\"a\"\n href={`${currentSeriesMetadata?.primary?.url}?ref=${currentSeriesMetadata?.label}_viewmore`}\n variant=\"secondary\"\n size=\"base\"\n className=\"text-base leading-[1.2] no-underline\"\n >\n {currentSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n sidebarCategoriesMetadata,\n seriesMetadata,\n expandedSubcategory,\n expandedSeriesCategories,\n subSubCategory,\n currentSeriesMetadata,\n buildProps?.categories,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n ])\n\n return MobileSidebarMenuComp\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GA0FY,IAAAI,EAAA,6BA1FZC,EAAiE,iBACjEC,EAAmC,qCACnCC,EAAqC,sBACrCC,EAA8B,4BAC9BC,EAA4E,qCAOrE,MAAMP,EAAoB,CAAC,CAChC,0BAAAQ,EACA,eAAAC,CACF,IAGM,CACJ,KAAM,CACJ,YAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,yBAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,kBAAAC,CACF,KAAI,iBAAc,EACZ,CAACC,EAAqBC,CAAsB,KAAI,YAA6C,CAAC,CAAC,EAC/F,CAACC,EAA0BC,CAA2B,KAAI,YAA6C,CAAC,CAAC,KAE/G,aAAU,IAAM,CACVb,GAA2B,eAAe,QAC5CW,EACEX,GAA2B,eAAe,IAAI,CAACc,EAAQC,KAAmB,CACxE,MAAAA,EACA,KAAM,EACR,EAAE,CACJ,CAEJ,EAAG,CAACf,CAAyB,CAAC,KAE9B,aAAU,IA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F,EACA,SAAU,CAAC,CAACL,GAA0B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,KAC5E,EAEDH,GAA0B,KAAKK,GAAQA,EAAK,QAAUF,CAAK,GAAG,SAC7D,oBACE,oBAAC,6BAA0B,oBAAqBQ,EAAqB,EACpEA,GAAqB,YACpB,OAAC,OAAI,UAAU,mBACb,mBAAC,UACC,GAAG,IACH,KAAMA,GAAqB,SAAS,IACpC,UAAU,uCACV,QAAQ,YACR,KAAK,OAEJ,SAAAA,GAAqB,SAAS,MACjC,EACF,GAEJ,IA7BM,GAAGD,EAAmB,KAAK,IAAIP,CAAK,EA+B9C,CAEJ,CAAC,KAED,oBACG,kBAAQ,QAAQR,CAAqB,EAAE,OAAS,MAC/C,OAAC,0BAAuB,oBAAqBA,EAAuB,KAEtE,OAAC,6BAA0B,oBAAqBA,EAAuB,EACtEA,GAAuB,YACtB,OAAC,OAAI,UAAU,oBACb,mBAAC,UACC,GAAG,IACH,KAAM,GAAGA,GAAuB,SAAS,GAAG,QAAQA,GAAuB,KAAK,YAChF,QAAQ,YACR,KAAK,OACL,UAAU,uCAET,SAAAA,GAAuB,SAAS,MACnC,EACF,GAEJ,EAEJ,EAEJ,QACE,OAAO,IACX,CACF,EAAG,CACDL,EACAF,EACAC,EACAS,EACAE,EACAR,EACAG,EACAC,GAAY,WACZQ,EACAP,CACF,CAAC,CAGH",
6
- "names": ["MobileSidebarMenu_exports", "__export", "MobileSidebarMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_types", "import_NavProvider", "import_MobileMenuComponents", "sidebarCategoriesMetadata", "seriesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "setCurrentSeriesMetadata", "currentSeriesMetadata", "buildProps", "onSidebarNavClick", "expandedSubcategory", "setExpandedSubcategory", "expandedSeriesCategories", "setExpandedSeriesCategories", "_", "index", "handleSubSubCategoryClick", "item", "subIndex", "curSeriesMetadata", "seriesItem", "category", "subSubCategoryItem", "matchSeriesMetadata", "prev", "i"]
4
+ "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button, Text, Link } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { MenuItem, SubSubCategoryItemComp, SubSubCategoryContentComp } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nexport const MobileSidebarMenu = ({\n sidebarCategoriesMetadata,\n seriesMetadata,\n}: {\n sidebarCategoriesMetadata: any\n seriesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n setCurrentSeriesMetadata,\n currentSeriesMetadata,\n buildProps,\n onSidebarNavClick,\n } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedSeriesCategories, setExpandedSeriesCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (sidebarCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n sidebarCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [sidebarCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedSeriesCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any, subIndex?: number) => {\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setSubSubCategory?.(item)\n const curSeriesMetadata =\n seriesMetadata?.find((seriesItem: any) =>\n subIndex !== undefined\n ? item?.subSubCategories?.[subIndex]?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n : item?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n ) || {}\n // \u901A\u8FC7categoriesMetadata\u7684subSubCategories\u7684label\u4E0Eseries\u7684label\u5339\u914D\n if (item?.collections) {\n const category = buildProps?.categories?.[item?.collections] || {}\n setCurrentSeriesMetadata?.({\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n })\n } else {\n setCurrentSeriesMetadata?.(curSeriesMetadata)\n }\n },\n [seriesMetadata, setCurrentMenu, setSubSubCategory, setCurrentSeriesMetadata, buildProps?.categories]\n )\n\n const MobileSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {sidebarCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n {sidebarCategoriesMetadata?.guide?.label && (\n <Link href={getLocalizedPath(sidebarCategoriesMetadata?.guide?.url, locale)}>\n <div className=\"mt-4\">\n <Text\n html={sidebarCategoriesMetadata?.guide?.label}\n className=\"text-sm font-bold leading-[1.2] text-[#6D6D6F]\"\n />\n </div>\n </Link>\n )}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {sidebarCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(sidebarCategoriesMetadata?.primary?.url, locale)}?ref=${sidebarCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {sidebarCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {sidebarCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={getLocalizedPath(sidebarCategoriesMetadata?.secondary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {sidebarCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curSeriesMetadata =\n seriesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n let matchSeriesMetadata = {} as any\n if (subSubCategoryItem?.collections) {\n const category = buildProps?.categories?.[subSubCategoryItem?.collections] || {}\n matchSeriesMetadata = {\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n matchSeriesMetadata = curSeriesMetadata\n }\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <SubSubCategoryItemComp\n matchSeriesMetadata={matchSeriesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedSeriesCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedSeriesCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedSeriesCategories?.find(item => item.index === index)?.open && (\n <>\n <SubSubCategoryContentComp matchSeriesMetadata={matchSeriesMetadata} />\n {matchSeriesMetadata?.primary && (\n <div className=\"my-4 text-center\">\n <Button\n as=\"a\"\n href={getLocalizedPath(matchSeriesMetadata?.primary?.url, locale)}\n className=\"text-base leading-[1.2] no-underline\"\n variant=\"secondary\"\n size=\"base\"\n >\n {matchSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentSeriesMetadata).length > 0 && (\n <SubSubCategoryItemComp matchSeriesMetadata={currentSeriesMetadata} />\n )}\n <SubSubCategoryContentComp matchSeriesMetadata={currentSeriesMetadata} />\n {currentSeriesMetadata?.primary && (\n <div className=\"my-4 text-center \">\n <Button\n as=\"a\"\n href={`${getLocalizedPath(currentSeriesMetadata?.primary?.url, locale)}?ref=${currentSeriesMetadata?.label}_viewmore`}\n variant=\"secondary\"\n size=\"base\"\n className=\"text-base leading-[1.2] no-underline\"\n >\n {currentSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n sidebarCategoriesMetadata,\n seriesMetadata,\n expandedSubcategory,\n expandedSeriesCategories,\n subSubCategory,\n currentSeriesMetadata,\n buildProps?.categories,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n locale,\n ])\n\n return MobileSidebarMenuComp\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GA6FY,IAAAI,EAAA,6BA7FZC,EAAiE,iBACjEC,EAAmC,qCACnCC,EAAqC,sBACrCC,EAA8B,4BAC9BC,EAA4E,qCAC5EC,EAA+B,oCAC/BC,EAAiC,kCAO1B,MAAMT,EAAoB,CAAC,CAChC,0BAAAU,EACA,eAAAC,CACF,IAGM,CACJ,KAAM,CACJ,YAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,yBAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,kBAAA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X,CACF,EAAG,CACDL,EACAF,EACAC,EACAU,EACAE,EACAT,EACAG,EACAC,GAAY,WACZS,EACAR,EACAC,CACF,CAAC,CAGH",
6
+ "names": ["MobileSidebarMenu_exports", "__export", "MobileSidebarMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_types", "import_NavProvider", "import_MobileMenuComponents", "import_AiuiProvider", "import_utils", "sidebarCategoriesMetadata", "seriesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "setCurrentSeriesMetadata", "currentSeriesMetadata", "buildProps", "onSidebarNavClick", "locale", "expandedSubcategory", "setExpandedSubcategory", "expandedSeriesCategories", "setExpandedSeriesCategories", "_", "index", "handleSubSubCategoryClick", "item", "subIndex", "curSeriesMetadata", "seriesItem", "category", "subSubCategoryItem", "matchSeriesMetadata", "prev", "i"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var m=(e,a)=>{for(var o in a)p(e,o,{get:a[o],enumerable:!0})},M=(e,a,o,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of b(a))!d.call(e,l)&&l!==o&&p(e,l,{get:()=>a[l],enumerable:!(r=n(a,l))||r.enumerable});return e};var c=e=>M(p({},"__esModule",{value:!0}),e);var u={};m(u,{MobileSupportMenu:()=>f});module.exports=c(u);var t=require("react/jsx-runtime"),k=require("react"),i=require("./MobileMenuComponents.js");const f=({supportsMetadata:e})=>(0,t.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:e?.map(a=>(0,t.jsx)(i.MenuItem,{href:a.url,label:a.label,onClick:()=>{}},a.id))});
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))})};
2
2
  //# sourceMappingURL=MobileSupportMenu.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MobileSupportMenu.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport { MenuItem } from './MobileMenuComponents.js'\n\n/**\n * \u79FB\u52A8\u7AEFsupport\u83DC\u5355\n * @param supportsMetadata support\u83DC\u5355\u5143\u6570\u636E\n */\nexport const MobileSupportMenu = ({ supportsMetadata }: { supportsMetadata: any }) => {\n return (\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {supportsMetadata?.map((supportItem: any) => (\n <MenuItem key={supportItem.id} href={supportItem.url} label={supportItem.label} onClick={() => {}} />\n ))}\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAWQ,IAAAI,EAAA,6BAXRC,EAAkB,iBAClBC,EAAyB,qCAMlB,MAAMJ,EAAoB,CAAC,CAAE,iBAAAK,CAAiB,OAEjD,OAAC,OAAI,UAAU,+BACZ,SAAAA,GAAkB,IAAKC,MACtB,OAAC,YAA8B,KAAMA,EAAY,IAAK,MAAOA,EAAY,MAAO,QAAS,IAAM,CAAC,GAAjFA,EAAY,EAAwE,CACpG,EACH",
6
- "names": ["MobileSupportMenu_exports", "__export", "MobileSupportMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_MobileMenuComponents", "supportsMetadata", "supportItem"]
4
+ "sourcesContent": ["import React from 'react'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\n/**\n * \u79FB\u52A8\u7AEFsupport\u83DC\u5355\n * @param supportsMetadata support\u83DC\u5355\u5143\u6570\u636E\n */\nexport const MobileSupportMenu = ({ supportsMetadata }: { supportsMetadata: any }) => {\n const { locale = 'us' } = useAiuiContext()\n return (\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {supportsMetadata?.map((supportItem: any) => (\n <MenuItem\n key={supportItem.id}\n href={getLocalizedPath(supportItem.url, locale)}\n label={supportItem.label}\n onClick={() => {}}\n />\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAcQ,IAAAI,EAAA,6BAdRC,EAAkB,iBAClBC,EAAyB,qCACzBC,EAA+B,oCAC/BC,EAAiC,kCAM1B,MAAMN,EAAoB,CAAC,CAAE,iBAAAO,CAAiB,IAAiC,CACpF,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACzC,SACE,OAAC,OAAI,UAAU,+BACZ,SAAAD,GAAkB,IAAKE,MACtB,OAAC,YAEC,QAAM,oBAAiBA,EAAY,IAAKD,CAAM,EAC9C,MAAOC,EAAY,MACnB,QAAS,IAAM,CAAC,GAHXA,EAAY,EAInB,CACD,EACH,CAEJ",
6
+ "names": ["MobileSupportMenu_exports", "__export", "MobileSupportMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_MobileMenuComponents", "import_AiuiProvider", "import_utils", "supportsMetadata", "locale", "supportItem"]
7
7
  }