@anker-in/headless-ui 1.0.14 → 1.0.16

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 (125) 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/AiuiProvider/index.js +1 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  5. package/dist/cjs/biz-components/Category/index.js +1 -1
  6. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  7. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  8. package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  10. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  11. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  12. package/dist/cjs/biz-components/Faq/Faq.js.map +1 -1
  13. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  14. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  15. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  16. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  17. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  18. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  19. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  20. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
  21. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  22. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  23. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  25. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -64
  26. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -5
  27. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  28. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +74 -0
  29. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  30. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  31. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.d.ts +8 -0
  32. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +10 -0
  33. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +7 -0
  34. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  35. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  36. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  37. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  38. package/dist/cjs/biz-components/SwiperBox/types.d.ts +1 -0
  39. package/dist/cjs/biz-components/SwiperBox/types.js +1 -1
  40. package/dist/cjs/biz-components/SwiperBox/types.js.map +1 -1
  41. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  42. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  43. package/dist/cjs/biz-components/Tabs/types.d.ts +4 -1
  44. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  45. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  46. package/dist/cjs/biz-components/TextModal/index.js +1 -1
  47. package/dist/cjs/biz-components/TextModal/index.js.map +2 -2
  48. package/dist/cjs/biz-components/Title/index.js +1 -1
  49. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  50. package/dist/cjs/biz-components/VideoModal/YouTubePlayer.js +1 -1
  51. package/dist/cjs/biz-components/VideoModal/YouTubePlayer.js.map +2 -2
  52. package/dist/cjs/biz-components/VideoModal/index.js +1 -1
  53. package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
  54. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js +1 -1
  55. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js.map +2 -2
  56. package/dist/cjs/components/button.d.ts +1 -0
  57. package/dist/cjs/components/button.js +1 -1
  58. package/dist/cjs/components/button.js.map +3 -3
  59. package/dist/cjs/components/tabs.js +1 -1
  60. package/dist/cjs/components/tabs.js.map +3 -3
  61. package/dist/cjs/stories/graphic.stories.d.ts +1 -1
  62. package/dist/cjs/stories/shelfDisplay.stories.d.ts +1 -1
  63. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  64. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  65. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  66. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  67. package/dist/esm/biz-components/Category/index.js +1 -1
  68. package/dist/esm/biz-components/Category/index.js.map +2 -2
  69. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  70. package/dist/esm/biz-components/CreativeModule/index.js.map +2 -2
  71. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  72. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  73. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  74. package/dist/esm/biz-components/Faq/Faq.js.map +1 -1
  75. package/dist/esm/biz-components/Graphic/index.js +1 -1
  76. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  77. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  78. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  79. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  80. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  81. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  82. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
  83. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  84. package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
  85. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  86. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  87. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -64
  88. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -5
  89. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  90. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +74 -0
  91. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  92. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  93. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.d.ts +8 -0
  94. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +10 -0
  95. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +7 -0
  96. package/dist/esm/biz-components/Slogan/index.js +1 -1
  97. package/dist/esm/biz-components/Slogan/index.js.map +2 -2
  98. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  99. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  100. package/dist/esm/biz-components/SwiperBox/types.d.ts +1 -0
  101. package/dist/esm/biz-components/SwiperBox/types.js.map +1 -1
  102. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  103. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  104. package/dist/esm/biz-components/Tabs/types.d.ts +4 -1
  105. package/dist/esm/biz-components/TextModal/index.js +1 -1
  106. package/dist/esm/biz-components/TextModal/index.js.map +2 -2
  107. package/dist/esm/biz-components/Title/index.js +1 -1
  108. package/dist/esm/biz-components/Title/index.js.map +2 -2
  109. package/dist/esm/biz-components/VideoModal/YouTubePlayer.js +1 -1
  110. package/dist/esm/biz-components/VideoModal/YouTubePlayer.js.map +2 -2
  111. package/dist/esm/biz-components/VideoModal/index.js +1 -1
  112. package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
  113. package/dist/esm/biz-components/WhyChoose/WhyChoose.js +1 -1
  114. package/dist/esm/biz-components/WhyChoose/WhyChoose.js.map +2 -2
  115. package/dist/esm/components/button.d.ts +1 -0
  116. package/dist/esm/components/button.js +1 -1
  117. package/dist/esm/components/button.js.map +3 -3
  118. package/dist/esm/components/tabs.js +1 -1
  119. package/dist/esm/components/tabs.js.map +3 -3
  120. package/dist/esm/stories/graphic.stories.d.ts +1 -1
  121. package/dist/esm/stories/shelfDisplay.stories.d.ts +1 -1
  122. package/dist/tokens/base.css +6 -0
  123. package/package.json +1 -1
  124. package/style.css +7 -4
  125. package/tailwind.config.js +2 -0
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var A=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var W=(e,i)=>{for(var s in i)f(e,s,{get:i[s],enumerable:!0})},I=(e,i,s,d)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of j(i))!V.call(e,a)&&a!==s&&f(e,a,{get:()=>i[a],enumerable:!(d=D(i,a))||d.enumerable});return e};var m=(e,i,s)=>(s=e!=null?A(P(e)):{},I(i||!e||!e.__esModule?f(s,"default",{value:e,enumerable:!0}):s,e)),q=e=>I(f({},"__esModule",{value:!0}),e);var G={};W(G,{default:()=>F});module.exports=q(G);var o=require("react/jsx-runtime"),B=m(require("../Title/index.js")),l=require("../../helpers/utils.js"),y=m(require("../../components/picture.js")),x=m(require("../../components/button.js")),E=m(require("../SwiperBox/index.js")),L=require("../../shared/Styles.js"),r=m(require("react")),H=require("../../hooks/useExposure.js"),u=require("../../shared/trackUrlRef.js"),M=require("../../shared/track.js"),R=m(require("../../shared/throttle.js")),w=require("../../components/heading.js");const c="image",p="scene_banner",U=r.default.forwardRef(({data:e,className:i="",event:s},d)=>{const[a,C]=(0,r.useState)(0),v=(0,r.useRef)(0),h=(0,r.useRef)([]),b=(0,r.useRef)(!1),[k,S]=(0,r.useState)(0),g=(0,r.useRef)(null);(0,r.useImperativeHandle)(d,()=>g.current),(0,H.useExposure)(g,{componentType:c,componentName:p,componentTitle:e?.title});const $=(t,n)=>{n&&(h.current[t]=n)};(0,r.useEffect)(()=>{const t=()=>{h.current[v.current]&&S(h.current[v.current].offsetWidth)};t();const n=(0,R.default)(t,300);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]);const z=({data:t,configuration:n})=>(0,o.jsxs)("div",{className:(0,l.cn)("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",n?.itemShape==="round"?"rounded-2xl":""),children:[(0,o.jsx)("a",{href:(0,u.trackUrlRef)(t?.imgLink,`${c}_${p}`),children:(0,o.jsx)(y.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:t?.mobileImg?.url||"",alt:t?.mobileImg?.alt||""})}),(0,o.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[(0,o.jsxs)("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[(0,o.jsx)("p",{className:"text-info-primary text-2xl font-bold leading-[1.2]",children:t?.title}),(0,o.jsx)("h3",{className:"text-info-primary line-clamp-2 text-sm font-semibold",children:t?.subTitle})]}),(0,o.jsx)(x.default,{"aria-label":t?.title??t?.subTitle,variant:"secondary",className:(0,l.cn)("text-info-primary text-sm font-bold"),as:"a",href:(0,u.trackUrlRef)(t.link,`${c}_${p}`),children:n?.primaryButton})]})]}),_=(0,r.useCallback)(t=>{a===t||b.current||(b.current=!0,C(t),v.current=t,(0,M.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:c,component_name:p,component_title:e?.products[t]?.title,component_description:e?.products[t]?.subTitle,position:t+1}}))},[e?.products,a]);return(0,o.jsxs)(o.Fragment,{children:[e?.title&&(0,o.jsx)(B.default,{data:{title:e?.title}}),(0,o.jsx)("div",{ref:g,className:(0,l.cn)("laptop:block hidden",{"aiui-dark":e?.theme==="dark"}),children:(0,o.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((t,n)=>{const T=a===n;return(0,o.jsxs)("div",{style:{flex:`${T?8:1} 1 0%`,transition:"all 0.6s"},ref:N=>{N&&$(n,N)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",e?.itemShape==="round"?"rounded-2xl":""),onMouseEnter:()=>_(n),onMouseLeave:()=>{b.current=!1},onClick:()=>{_(n)},children:[(0,o.jsx)("a",{href:(0,u.trackUrlRef)(t?.imgLink,`${c}_${p}`),children:(0,o.jsx)(y.default,{source:t?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:t?.img?.alt||""})}),(0,o.jsxs)("div",{style:{width:k},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",T&&k?"opacity-100":"opacity-0"),children:[(0,o.jsxs)("div",{className:"mr-16 flex-1 overflow-hidden",children:[(0,o.jsx)(w.Heading,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:t?.title}),(0,o.jsx)(w.Heading,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:t?.subTitle})]}),(0,o.jsxs)(x.default,{className:(0,l.cn)("mb-1.5 font-bold"),as:"a",href:(0,u.trackUrlRef)(t?.link,`${c}_${p}`),onClick:()=>s?.primaryButton?.(e,n),children:[e?.primaryButton,(0,o.jsx)("span",{className:"sr-only",children:t?.title??t?.subTitle})]})]})]},n)})})}),(0,o.jsx)("div",{className:(0,l.cn)("laptop:hidden block",{"aiui-dark":e?.theme==="dark"}),children:(0,o.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:s}},Slide:z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});var F=(0,L.withLayout)(U);
1
+ "use strict";"use client";var A=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var W=(t,i)=>{for(var s in i)f(t,s,{get:i[s],enumerable:!0})},N=(t,i,s,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of j(i))!V.call(t,p)&&p!==s&&f(t,p,{get:()=>i[p],enumerable:!(u=D(i,p))||u.enumerable});return t};var c=(t,i,s)=>(s=t!=null?A(P(t)):{},N(i||!t||!t.__esModule?f(s,"default",{value:t,enumerable:!0}):s,t)),q=t=>N(f({},"__esModule",{value:!0}),t);var G={};W(G,{default:()=>F});module.exports=q(G);var o=require("react/jsx-runtime"),B=c(require("../Title/index.js")),l=require("../../helpers/utils.js"),g=c(require("../../components/picture.js")),x=c(require("../../components/button.js")),I=c(require("../SwiperBox/index.js")),E=require("../../shared/Styles.js"),n=c(require("react")),L=require("../../hooks/useExposure.js"),d=require("../../shared/trackUrlRef.js"),H=require("../../shared/track.js"),M=c(require("../../shared/throttle.js")),w=require("../../components/heading.js");const a="image",m="scene_banner",U=n.default.forwardRef(({data:t,className:i="",event:s},u)=>{const[p,R]=(0,n.useState)(0),v=(0,n.useRef)(0),h=(0,n.useRef)([]),b=(0,n.useRef)(!1),[k,C]=(0,n.useState)(0),y=(0,n.useRef)(null);(0,n.useImperativeHandle)(u,()=>y.current),(0,L.useExposure)(y,{componentType:a,componentName:m,componentTitle:t?.title});const S=(e,r)=>{r&&(h.current[e]=r)};(0,n.useEffect)(()=>{const e=()=>{h.current[v.current]&&C(h.current[v.current].offsetWidth)};e();const r=(0,M.default)(e,300);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]);const z=({data:e,configuration:r})=>(0,o.jsxs)("div",{className:(0,l.cn)("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",r?.itemShape==="round"?"rounded-2xl":""),children:[(0,o.jsx)("a",{href:(0,d.trackUrlRef)(e?.imgLink,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}@${e?.subTitle}`,"data-headless-nav-postion":`''#${r?.index+1}`,children:(0,o.jsx)(g.default,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""})}),(0,o.jsxs)("div",{className:(0,l.cn)("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[(0,o.jsxs)("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[(0,o.jsx)("p",{className:"text-info-primary text-2xl font-bold leading-[1.2]",children:e?.title}),(0,o.jsx)("h3",{className:"text-info-primary line-clamp-2 text-sm font-semibold",children:e?.subTitle})]}),(0,o.jsx)(x.default,{as:"a",variant:"secondary","aria-label":e?.title??e?.subTitle,className:(0,l.cn)("text-info-primary text-sm font-bold"),href:(0,d.trackUrlRef)(e.link,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-nav-postion":`''#${r?.index+1}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${r?.primaryButton}`,children:r?.primaryButton})]})]}),$=(0,n.useCallback)(e=>{p===e||b.current||(b.current=!0,R(e),v.current=e,(0,H.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:a,component_name:m,component_title:t?.products[e]?.title,component_description:t?.products[e]?.subTitle,position:e+1}}))},[t?.products,p]);return(0,o.jsxs)(o.Fragment,{children:[t?.title&&(0,o.jsx)(B.default,{data:{title:t?.title}}),(0,o.jsx)("div",{ref:y,className:(0,l.cn)("laptop:block hidden",{"aiui-dark":t?.theme==="dark"}),children:(0,o.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:t?.products?.map((e,r)=>{const T=p===r;return(0,o.jsxs)("div",{style:{flex:`${T?8:1} 1 0%`,transition:"all 0.6s"},ref:_=>{_&&S(r,_)},className:(0,l.cn)("relative cursor-pointer overflow-hidden",t?.itemShape==="round"?"rounded-2xl":""),onMouseEnter:()=>$(r),onMouseLeave:()=>{b.current=!1},onClick:()=>{$(r)},children:[(0,o.jsx)("a",{href:(0,d.trackUrlRef)(e?.imgLink,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}`,children:(0,o.jsx)(g.default,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""})}),(0,o.jsxs)("div",{style:{width:k},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",T&&k?"opacity-100":"opacity-0"),children:[(0,o.jsxs)("div",{className:"mr-16 flex-1 overflow-hidden",children:[(0,o.jsx)(w.Heading,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:e?.title}),(0,o.jsx)(w.Heading,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:e?.subTitle})]}),(0,o.jsxs)(x.default,{className:(0,l.cn)("mb-1.5 font-bold"),as:"a",href:(0,d.trackUrlRef)(e?.link,`${a}_${m}`),"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${t?.primaryButton}`,onClick:()=>s?.primaryButton?.(t,r),children:[t?.primaryButton,(0,o.jsx)("span",{className:"sr-only",children:e?.title??e?.subTitle})]})]})]},r)})})}),(0,o.jsx)("div",{className:(0,l.cn)("laptop:hidden block",{"aiui-dark":t?.theme==="dark"}),children:(0,o.jsx)(I.default,{className:(0,l.cn)("h-[400px] !overflow-visible",i),id:"AccordionCards"+t?.key,data:{list:t?.products,configuration:{shape:t?.shape,itemShape:t?.itemShape,primaryButton:t?.primaryButton,event:s,title:t?.title}},Slide:z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});var F=(0,E.withLayout)(U);
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 } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.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 /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(({ data, 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 isAnimation = useRef<boolean>(false)\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\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 MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div\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 href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}>\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 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 <Button\n aria-label={data?.title ?? data?.subTitle}\n variant=\"secondary\"\n className={cn('text-info-primary text-sm font-bold')}\n as=\"a\"\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n >\n {configuration?.primaryButton}\n </Button>\n </div>\n </div>\n )\n }\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx || isAnimation.current) return\n isAnimation.current = true\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.products[idx]?.title,\n component_description: data?.products[idx]?.subTitle,\n position: idx + 1,\n },\n })\n },\n [data?.products, hoverIndex]\n )\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 const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\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(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onMouseLeave={() => {\n isAnimation.current = false\n }}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}>\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\n as=\"h3\"\n className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\"\n >\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 <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {data?.primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n </div>\n </div>\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 },\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})\nexport default withLayout(Acc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AA2B,QAAA,CACC,aAAW,MAAG,8BAA+B1B,CAAS,EACtD,GAAI,iBAAmBD,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOE,CACT,CACF,EACA,MAAOgB,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,CAAC,EACD,IAAOrC,KAAQ,cAAWiB,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 } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.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 /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(({ data, 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 isAnimation = useRef<boolean>(false)\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\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 MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n return (\n <div\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 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 <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 </div>\n </div>\n )\n }\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx || isAnimation.current) return\n isAnimation.current = true\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.products[idx]?.title,\n component_description: data?.products[idx]?.subTitle,\n position: idx + 1,\n },\n })\n },\n [data?.products, hoverIndex]\n )\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 const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\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(\n 'relative cursor-pointer overflow-hidden',\n data?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onMouseLeave={() => {\n isAnimation.current = false\n }}\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\n as=\"h3\"\n className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\"\n >\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 <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}#${data?.primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {data?.primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n </div>\n </div>\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})\nexport default withLayout(AccordionCards)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmGU,IAAAI,EAAA,6BAlGVC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAqF,oBACrFC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,iCAExBC,EAAqB,uCACrBC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,eAmChBC,EAAiB,EAAAC,QAAM,WAA+C,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,GAAI,MAAAC,CAAM,EAAGC,IAAQ,CACpH,KAAM,CAACC,EAAYC,CAAa,KAAI,YAAwB,CAAC,EAEvDC,KAAgB,UAAe,CAAC,EAChCC,KAAe,UAAyB,CAAC,CAAC,EAC1CC,KAAc,UAAgB,EAAK,EACnC,CAACC,EAAcC,CAAe,KAAI,YAAiB,CAAC,EAEpDC,KAAW,UAAuB,IAAI,KAC5C,uBAAoBR,EAAK,IAAMQ,EAAS,OAAyB,KACjE,eAAYA,EAAU,CACpB,cAAAf,EACA,cAAAC,EACA,eAAgBG,GAAM,KACxB,CAAC,EAED,MAAMY,EAAS,CAACC,EAAeC,IAAuB,CAChDA,IACFP,EAAa,QAAQM,CAAK,EAAIC,EAElC,KAEA,aAAU,IAAM,CACd,MAAMC,EAAe,IAAM,CACrBR,EAAa,QAAQD,EAAc,OAAO,GAC5CI,EAAgBH,EAAa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
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_track", "import_throttle", "import_heading", "componentType", "componentName", "AccordionCards", "React", "data", "className", "event", "ref", "hoverIndex", "setHoverIndex", "hoverIndexRef", "accordionRef", "isAnimation", "contentWidth", "setContentWidth", "innerRef", "getRef", "index", "el", "handleResize", "throttleResize", "throttle", "MobileItem", "configuration", "Picture", "Button", "handleSwiperItemClick", "idx", "Title", "item", "isExpanded", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var p=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},A=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of s(t))!x.call(e,i)&&i!==r&&c(e,i,{get:()=>t[i],enumerable:!(u=d(t,i))||u.enumerable});return e};var g=e=>A(c({},"__esModule",{value:!0}),e);var f={};p(f,{AiuiContext:()=>n,default:()=>y,useAiuiContext:()=>C});module.exports=g(f);var a=require("react/jsx-runtime"),o=require("react");const n=(0,o.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),C=()=>{if(!(0,o.useContext)(n))throw new Error("useAiui must be used in <AiuiProvider>");return(0,o.useContext)(n)},l=({children:e,...t})=>(0,a.jsx)(n.Provider,{value:t,children:e});var y=l;
1
+ "use strict";var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var k=(a,e)=>{for(var o in e)p(a,o,{get:e[o],enumerable:!0})},x=(a,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!A.call(a,t)&&t!==o&&p(a,t,{get:()=>e[t],enumerable:!(s=f(e,t))||s.enumerable});return a};var C=a=>x(p({},"__esModule",{value:!0}),a);var T={};k(T,{AiuiContext:()=>c,default:()=>P,useAiuiContext:()=>_});module.exports=C(T);var b=require("react/jsx-runtime"),h=require("../../shared/track.js"),r=require("react");const c=(0,r.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),_=()=>{if(!(0,r.useContext)(c))throw new Error("useAiui must be used in <AiuiProvider>");return(0,r.useContext)(c)},E=({children:a,...e})=>((0,r.useEffect)(()=>{const o=(t,n)=>{t?.stopPropagation?.();const i={};if(!n||!n.attributes)return i;for(const g of Array.from(n.attributes)){const u=g?.name;u?.startsWith("data-headless-")&&(i[u]=n.getAttribute(u))}const y=i?.["data-headless-sku"],l=i?.["data-headless-type-name"]?.split?.("#"),d=i?.["data-headless-title-desc-button"]?.split?.("#"),m=i?.["data-headless-nav-postion"]?.split?.("#");(0,h.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:e?.trackingData?.pageGroup||"Home Page",component_type:l?.[0]||"",component_name:l?.[1]||"",position:m?.[1]||"",navigation:m?.[0]||"",button_name:d?.[2]||"",SKU:y||"",component_title:d?.[0]||"",component_description:d?.[1]||""}})},s=new MutationObserver(()=>{document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",n=>o(n,t)),t.setAttribute("data-headless-track-bound","true"))})});return s.observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",n=>o(n,t)),t.setAttribute("data-headless-track-bound","true"))}),()=>s.disconnect()},[]),(0,b.jsx)(c.Provider,{value:e,children:a}));var P=E;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AiuiProvider/index.tsx"],
4
- "sourcesContent": ["import React, { createContext, useContext } from 'react'\n\ninterface AiuiContextType {\n trackingData: Record<string, any>\n locale?: string\n copyWriting?: Record<string, string>\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return useContext(AiuiContext)\n}\n\nconst AiuiProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GA4BS,IAAAM,EAAA,6BA5BTC,EAAiD,iBAQ1C,MAAML,KAAc,iBAA+B,CACxD,aAAc,CAAC,EACf,OAAQ,OACR,YAAa,CAAC,CAChB,CAAC,EAEYE,EAAiB,IAAM,CAElC,GAAI,IADY,cAAWF,CAAW,EAEpC,MAAM,IAAI,MAAM,wCAAwC,EAE1D,SAAO,cAAWA,CAAW,CAC/B,EAEMM,EAAe,CAAC,CACpB,SAAAC,EACA,GAAGC,CACL,OAGS,OAACR,EAAY,SAAZ,CAAqB,MAAOQ,EAAO,SAAAD,EAAS,EAGtD,IAAON,EAAQK",
6
- "names": ["AiuiProvider_exports", "__export", "AiuiContext", "AiuiProvider_default", "useAiuiContext", "__toCommonJS", "import_jsx_runtime", "import_react", "AiuiProvider", "children", "rest"]
4
+ "sourcesContent": ["import { gaTrack } from '../../shared/track.js'\nimport React, { createContext, useContext, useEffect } from 'react'\n\ninterface AiuiContextType {\n trackingData: Record<string, any>\n locale?: string\n copyWriting?: Record<string, string>\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return useContext(AiuiContext)\n}\n\nconst AiuiProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n useEffect(() => {\n const handleTrackClick = (e: any, el: any) => {\n e?.stopPropagation?.()\n const out: any = {}\n if (!el || !el.attributes) return out\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as any)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name)\n }\n }\n const sku = out?.['data-headless-sku']\n const nameType = out?.['data-headless-type-name']?.split?.('#')\n const titleDesc = out?.['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out?.['data-headless-nav-postion']?.split?.('#')\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: rest?.trackingData?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n const observer = new MutationObserver(() => {\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true') // \u907F\u514D\u91CD\u590D\u7ED1\u5B9A\n }\n })\n })\n observer.observe(document.body, { childList: true, subtree: true })\n // \u521D\u59CB\u5316\u4E00\u6B21\u73B0\u6709\u8282\u70B9\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true')\n }\n })\n return () => observer.disconnect()\n }, [])\n\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA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S,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,CACH,CAAC,EACD,OAAAQ,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,EAAK,CAAC,EAElE,SAAS,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,EACM,IAAMQ,EAAS,WAAW,CACnC,EAAG,CAAC,CAAC,KAEE,OAACpB,EAAY,SAAZ,CAAqB,MAAOS,EAAO,SAAAD,EAAS,GAGtD,IAAOP,EAAQM",
6
+ "names": ["AiuiProvider_exports", "__export", "AiuiContext", "AiuiProvider_default", "useAiuiContext", "__toCommonJS", "import_jsx_runtime", "import_track", "import_react", "AiuiProvider", "children", "rest", "handleTrackClick", "e", "el", "out", "attr", "name", "sku", "nameType", "titleDesc", "navPosition", "observer"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var N=Object.create;var s=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)s(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of I(t))!j.call(e,n)&&n!==o&&s(e,n,{get:()=>t[n],enumerable:!(a=C(t,n))||a.enumerable});return e};var m=(e,t,o)=>(o=e!=null?N(_(e)):{},y(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e)),D=e=>y(s({},"__esModule",{value:!0}),e);var E={};S(E,{default:()=>R});module.exports=D(E);var r=require("react/jsx-runtime"),l=m(require("react")),i=require("../../helpers/utils.js"),c=m(require("../../components/picture.js")),v=require("../../shared/Styles.js"),b=m(require("../Title/index.js")),g=m(require("./SwiperCategory.js")),k=require("../../hooks/useExposure.js"),f=require("../../shared/trackUrlRef.js"),w=require("../../components/heading.js");const d="image",u="category_banner",$=(e,t)=>{const o=[];for(let a=0;a<e.length;a+=t)o.push(e.slice(a,a+t));return o},H=({data:e,configuration:t})=>(0,r.jsxs)("div",{className:(0,i.cn)("tablet:h-[120px] laptop:h-[144px] desktop:h-[192px] lg-desktop:h-[240px]","tablet:p-3 laptop:p-4 desktop:p-6 lg-desktop:p-8","bg-container-secondary-1 hover:bg-info-white group box-border flex size-full cursor-pointer flex-col overflow-hidden duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("div",{className:"transition-all duration-300 group-hover:scale-110",children:(0,r.jsx)("a",{"aria-label":e?.name,href:(0,f.trackUrlRef)(e?.link,`${d}_${u}`),onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,r.jsx)(c.default,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),(0,r.jsx)(w.Heading,{as:"h3",className:"lg-desktop:text-[18px] text-info-primary box-border line-clamp-2 flex-1 text-center text-[14px] font-bold",children:e?.name})]}),T=({data:e,configuration:t})=>(0,r.jsxs)("div",{className:(0,i.cn)("bg-container-secondary-1 box-border max-h-[126px] w-full overflow-hidden","hover:bg-info-white cursor-pointer px-3 py-4 duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("a",{href:(0,f.trackUrlRef)(e?.link,`${d}_${u}`),onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,r.jsx)(c.default,{alt:e?.image?.alt||"",className:"m-auto mb-2 flex size-[72px] justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",source:e?.image?.url||""})}),(0,r.jsx)("p",{className:"text-info-primary flex-1 truncate text-center text-sm font-bold",children:e?.name})]},`${e?.name}`),z=({data:e,configuration:t,index:o})=>(0,r.jsxs)("div",{className:(0,i.cn)("bg-container-secondary-1 box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer p-4",o===0?"aspect-h-[252] row-span-2":"aspect-h-[120]",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("a",{href:e?.link||"",onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,r.jsx)(c.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,i.cn)("mb-2 flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",o===0?"max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]")})}),(0,r.jsx)("p",{className:"text-info-primary line-clamp-2 text-center text-sm font-bold",children:e?.name})]}),B=({data:e,configuration:t})=>(0,r.jsx)("div",{className:"grid grid-cols-2 gap-3",children:e?.map((o,a)=>e?.length===5?(0,r.jsx)(z,{index:a,data:o,configuration:t},a):(0,r.jsx)(T,{data:o,configuration:t},a))}),M=l.default.forwardRef((e,t)=>{const{data:o,className:a="",key:n,event:x}=e,h=o?.isShowSelect?o?.products:o?.productData,p=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>p.current),(0,k.useExposure)(p,{componentType:d,componentName:u,componentTitle:o?.title}),(0,r.jsxs)("div",{ref:p,className:(0,i.cn)("w-full overflow-hidden",a,{"aiui-dark":o?.theme==="dark"}),children:[o?.title&&(0,r.jsx)(b.default,{data:{title:o?.title},className:"text-4xl"}),(0,r.jsx)("div",{className:"tablet:block hidden",children:(0,r.jsx)(g.default,{id:`Category${n}`,Slide:H,data:{list:h,configuration:{shape:o?.shape,event:x}}})}),(0,r.jsx)("div",{className:"tablet:hidden block",children:(0,r.jsx)(g.default,{id:`Category1${n}`,Slide:B,data:{list:$(h,6),configuration:{shape:o?.shape,event:x}}})}),(0,r.jsx)("div",{className:"h-7"})]})});var R=(0,v.withLayout)(M);
1
+ "use strict";"use client";var N=Object.create;var c=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},y=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of I(t))!_.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(a=C(t,n))||a.enumerable});return e};var p=(e,t,o)=>(o=e!=null?N($(e)):{},y(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e)),S=e=>y(c({},"__esModule",{value:!0}),e);var E={};j(E,{default:()=>R});module.exports=S(E);var r=require("react/jsx-runtime"),l=p(require("react")),i=require("../../helpers/utils.js"),d=p(require("../../components/picture.js")),v=require("../../shared/Styles.js"),b=p(require("../Title/index.js")),g=p(require("./SwiperCategory.js")),k=require("../../hooks/useExposure.js"),f=require("../../shared/trackUrlRef.js"),w=require("../../components/heading.js");const s="image",m="category_banner",D=(e,t)=>{const o=[];for(let a=0;a<e.length;a+=t)o.push(e.slice(a,a+t));return o},H=({data:e,configuration:t})=>(0,r.jsxs)("div",{className:(0,i.cn)("tablet:h-[120px] laptop:h-[144px] desktop:h-[192px] lg-desktop:h-[240px]","tablet:p-3 laptop:p-4 desktop:p-6 lg-desktop:p-8","bg-container-secondary-1 hover:bg-info-white group box-border flex size-full cursor-pointer flex-col overflow-hidden duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("div",{className:"transition-all duration-300 group-hover:scale-110",children:(0,r.jsx)("a",{"aria-label":e?.name,href:(0,f.trackUrlRef)(e?.link,`${s}_${m}`),"data-headless-type-name":`${s}#${m}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,r.jsx)(d.default,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),(0,r.jsx)(w.Heading,{as:"h3",className:"lg-desktop:text-[18px] text-info-primary box-border line-clamp-2 flex-1 text-center text-[14px] font-bold",children:e?.name})]}),T=({data:e,configuration:t})=>(0,r.jsxs)("div",{className:(0,i.cn)("bg-container-secondary-1 box-border max-h-[126px] w-full overflow-hidden","hover:bg-info-white cursor-pointer px-3 py-4 duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("a",{href:(0,f.trackUrlRef)(e?.link,`${s}_${m}`),"data-headless-type-name":`${s}#${m}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-postion":`''#${t?.index+1}`,onClick:()=>t?.event?.primaryButton(e,t?.index+1),children:(0,r.jsx)(d.default,{alt:e?.image?.alt||"",className:"m-auto mb-2 flex size-[72px] justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",source:e?.image?.url||""})}),(0,r.jsx)("p",{className:"text-info-primary flex-1 truncate text-center text-sm font-bold",children:e?.name})]},`${e?.name}`),z=({data:e,configuration:t,index:o})=>(0,r.jsxs)("div",{className:(0,i.cn)("bg-container-secondary-1 box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer p-4",o===0?"aspect-h-[252] row-span-2":"aspect-h-[120]",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,r.jsx)("a",{href:e?.link||"",onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,r.jsx)(d.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,i.cn)("mb-2 flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",o===0?"max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]")})}),(0,r.jsx)("p",{className:"text-info-primary line-clamp-2 text-center text-sm font-bold",children:e?.name})]}),B=({data:e,configuration:t})=>(0,r.jsx)("div",{className:"grid grid-cols-2 gap-3",children:e?.map((o,a)=>e?.length===5?(0,r.jsx)(z,{index:a,data:o,configuration:t},a):(0,r.jsx)(T,{data:o,configuration:t},a))}),M=l.default.forwardRef((e,t)=>{const{data:o,className:a="",key:n,event:h}=e,x=o?.isShowSelect?o?.products:o?.productData,u=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>u.current),(0,k.useExposure)(u,{componentType:s,componentName:m,componentTitle:o?.title}),(0,r.jsxs)("div",{ref:u,className:(0,i.cn)("w-full overflow-hidden",a,{"aiui-dark":o?.theme==="dark"}),children:[o?.title&&(0,r.jsx)(b.default,{data:{title:o?.title},className:"text-4xl"}),(0,r.jsx)("div",{className:"tablet:block hidden",children:(0,r.jsx)(g.default,{id:`Category${n}`,Slide:H,data:{list:x,configuration:{shape:o?.shape,event:h,title:o?.title}}})}),(0,r.jsx)("div",{className:"tablet:hidden block",children:(0,r.jsx)(g.default,{id:`Category1${n}`,Slide:B,data:{list:D(x,6),configuration:{shape:o?.shape,event:h,title:o?.title}}})}),(0,r.jsx)("div",{className:"h-7"})]})});var R=(0,v.withLayout)(M);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'tablet:h-[120px] laptop:h-[144px] desktop:h-[192px] lg-desktop:h-[240px]',\n 'tablet:p-3 laptop:p-4 desktop:p-6 lg-desktop:p-8',\n 'bg-container-secondary-1 hover:bg-info-white group box-border flex size-full cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <Heading\n as=\"h3\"\n className=\"lg-desktop:text-[18px] text-info-primary box-border line-clamp-2 flex-1 text-center text-[14px] font-bold\"\n >\n {data?.name}\n </Heading>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\nconst SingleItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n key={`${data?.name}`}\n className={cn(\n 'bg-container-secondary-1 box-border max-h-[126px] w-full overflow-hidden',\n 'hover:bg-info-white cursor-pointer px-3 py-4 duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n className=\"m-auto mb-2 flex size-[72px] justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n source={data?.image?.url || ''}\n />\n </a>\n <p className=\"text-info-primary flex-1 truncate text-center text-sm font-bold\">{data?.name}</p>\n </div>\n )\n}\n\n// soundcore mobile\u5C55\u793A\nconst SingleMobileCategoryItem = ({\n data,\n configuration,\n index,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n}) => {\n return (\n <div\n className={cn(\n 'bg-container-secondary-1 box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer p-4',\n index === 0 ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a href={data?.link || ''} onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}>\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'mb-2 flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover',\n index === 0 ? 'max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]'\n )}\n />\n </a>\n <p className=\"text-info-primary line-clamp-2 text-center text-sm font-bold\">{data?.name}</p>\n </div>\n )\n}\n\n// \u5176\u5B83\u54C1\u724Cmobile\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n return (\n <div className=\"grid grid-cols-2 gap-3\">\n {data?.map((item, index) => {\n return data?.length === 5 ? (\n <SingleMobileCategoryItem key={index} index={index} data={item} configuration={configuration} />\n ) : (\n <SingleItem key={index} data={item} configuration={configuration} />\n )\n })}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = data?.isShowSelect ? data?.products : data?.productData\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n return (\n <div ref={innerRef} className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}>\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{ list: currentData, configuration: { shape: data?.shape, event: event } }}\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{ list: chunkArray(currentData, 6), configuration: { shape: data?.shape, event: event } }}\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nexport default withLayout(Category)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuDI,IAAAI,EAAA,6BAtDJC,EAAmD,oBACnDC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,kCACtBC,EAA4B,sCAC5BC,EAA4B,uCAE5BC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,kBAgChBC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,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EAAa,cAAe,CAAE,MAAOf,GAAM,MAAO,MAAOc,CAAM,CAAE,EACjF,EACF,KACA,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAI,QAAA,CACC,GAAI,YAAYL,CAAG,GACnB,MAAOP,EACP,KAAM,CAAE,KAAMZ,EAAWqB,EAAa,CAAC,EAAG,cAAe,CAAE,MAAOf,GAAM,MAAO,MAAOc,CAAM,CAAE,EAChG,EACF,KACA,OAAC,OAAI,UAAU,MAAM,GACvB,CAEJ,CAAC,EAED,IAAOlC,KAAQ,cAAW4B,CAAQ",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'tablet:h-[120px] laptop:h-[144px] desktop:h-[192px] lg-desktop:h-[240px]',\n 'tablet:p-3 laptop:p-4 desktop:p-6 lg-desktop:p-8',\n 'bg-container-secondary-1 hover:bg-info-white group box-border flex size-full cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <Heading\n as=\"h3\"\n className=\"lg-desktop:text-[18px] text-info-primary box-border line-clamp-2 flex-1 text-center text-[14px] font-bold\"\n >\n {data?.name}\n </Heading>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\nconst SingleItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n return (\n <div\n key={`${data?.name}`}\n className={cn(\n 'bg-container-secondary-1 box-border max-h-[126px] w-full overflow-hidden',\n 'hover:bg-info-white cursor-pointer px-3 py-4 duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index + 1)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n className=\"m-auto mb-2 flex size-[72px] justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n source={data?.image?.url || ''}\n />\n </a>\n <p className=\"text-info-primary flex-1 truncate text-center text-sm font-bold\">{data?.name}</p>\n </div>\n )\n}\n\n// soundcore mobile\u5C55\u793A\nconst SingleMobileCategoryItem = ({\n data,\n configuration,\n index,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n}) => {\n return (\n <div\n className={cn(\n 'bg-container-secondary-1 box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer p-4',\n index === 0 ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a href={data?.link || ''} onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}>\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'mb-2 flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover',\n index === 0 ? 'max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]'\n )}\n />\n </a>\n <p className=\"text-info-primary line-clamp-2 text-center text-sm font-bold\">{data?.name}</p>\n </div>\n )\n}\n\n// \u5176\u5B83\u54C1\u724Cmobile\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n return (\n <div className=\"grid grid-cols-2 gap-3\">\n {data?.map((item, index) => {\n return data?.length === 5 ? (\n <SingleMobileCategoryItem key={index} index={index} data={item} configuration={configuration} />\n ) : (\n <SingleItem key={index} data={item} configuration={configuration} />\n )\n })}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = data?.isShowSelect ? data?.products : data?.productData\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n return (\n <div ref={innerRef} className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}>\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{ list: currentData, configuration: { shape: data?.shape, event: event, title: data?.title } }}\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{ list: chunkArray(currentData, 6), configuration: { shape: data?.shape, event: event, title: data?.title } }}\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nexport default withLayout(Category)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuDI,IAAAI,EAAA,6BAtDJC,EAAmD,oBACnDC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,kCACtBC,EAA4B,sCAC5BC,EAA4B,uCAE5BC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,kBAgChBC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAI,OAAQG,GAAKF,EACnCC,EAAO,KAAKF,EAAI,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEpC,OAAOC,CACT,EAEME,EAAiB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAE1C,QAAC,OACC,aAAW,MACT,2EACA,mDACA,oIACAA,GAAe,QAAU,QAAU,cAAgB,cACrD,EAEA,oBAAC,OAAI,UAAU,oDACb,mBAAC,KACC,aAAYD,GAAM,KAClB,QAAM,eAAYA,GAAM,KAAM,GAAGR,CAAa,IAAIC,CAAa,EAAE,EACjE,0BAAyB,GAAGD,C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ACP,KAAM,CAAE,KAAMZ,EAAWqB,EAAa,CAAC,EAAG,cAAe,CAAE,MAAOf,GAAM,MAAO,MAAOc,EAAO,MAAOd,GAAM,KAAM,CAAE,EACpH,EACF,KACA,OAAC,OAAI,UAAU,MAAM,GACvB,CAEJ,CAAC,EAED,IAAOpB,KAAQ,cAAW4B,CAAQ",
6
6
  "names": ["Category_exports", "__export", "Category_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_Title", "import_SwiperCategory", "import_useExposure", "import_trackUrlRef", "import_heading", "componentType", "componentName", "chunkArray", "arr", "size", "chunks", "i", "CategoryPcItem", "data", "configuration", "Picture", "SingleItem", "SingleMobileCategoryItem", "index", "CategoryMobileItem", "item", "Category", "React", "props", "ref", "className", "key", "event", "currentData", "innerRef", "Title", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var g=Object.create;var p=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of b(l))!h.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(r=x(l,a))||r.enumerable});return e};var N=(e,l,o)=>(o=e!=null?g(v(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),k=e=>n(p({},"__esModule",{value:!0}),e);var I={};w(I,{default:()=>C});module.exports=k(I);var t=require("react/jsx-runtime"),d=require("../../helpers/utils.js"),c=N(require("../SwiperBox/index.js")),u=require("../../shared/Styles.js"),m=require("../../components/gird.js"),s=require("../../components/index.js");const y=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,d.cn)("text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]",l?.shape==="rounded"?"rounded-2xl":"rounded-none",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(s.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute bottom-4 left-4 box-border flex w-full flex-col",children:[(0,t.jsx)(s.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(s.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),M=e=>{const{data:l,className:o}=e,{productsTab:r,shape:a}=l;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"laptop:block box-border hidden w-full overflow-hidden",children:(0,t.jsx)(m.Grid,{className:(0,d.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",o),children:r?.map((i,f)=>(0,t.jsxs)(m.GridItem,{span:i.span,className:(0,d.cn)("text-info-primary relative w-full cursor-pointer overflow-hidden",a==="rounded"?"rounded-2xl":"rounded-none","lg-desktop:max-h-[480px] desktop:max-h-[384px] laptop:max-h-[288px]",{"aiui-dark":i.theme==="dark"}),children:[(0,t.jsx)(s.Picture,{source:i.img.url,className:"size-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:left-8 desktop:bottom-6 desktop:left-6 absolute bottom-4 left-4",children:[i.title&&(0,t.jsx)(s.Text,{html:i.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl text-xl font-bold"}),i.description&&(0,t.jsx)(s.Text,{html:i.description,className:"desktop:text-lg text-sm font-bold"})]})]},f))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,d.cn)("!overflow-visible",o),data:{list:r||[],configuration:{shape:a}},Slide:y,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var C=(0,u.withLayout)(M);
1
+ "use strict";"use client";var x=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of v(l))!b.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(d=g(l,a))||d.enumerable});return e};var k=(e,l,o)=>(o=e!=null?x(h(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),N=e=>n(p({},"__esModule",{value:!0}),e);var C={};w(C,{default:()=>I});module.exports=N(C);var t=require("react/jsx-runtime"),r=require("../../helpers/utils.js"),c=k(require("../SwiperBox/index.js")),u=require("../../shared/Styles.js"),m=require("../../components/gird.js"),i=require("../../components/index.js");const y=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]",l?.shape==="rounded"?"rounded-2xl":"rounded-none",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(i.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute bottom-4 left-0 right-0 box-border flex w-full flex-col px-4 overflow-hidden",children:[(0,t.jsx)(i.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(i.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),M=e=>{const{data:l,className:o}=e,{productsTab:d,shape:a}=l;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden"),children:(0,t.jsx)(m.Grid,{className:(0,r.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",o),children:d?.map((s,f)=>(0,t.jsxs)(m.GridItem,{span:s.span,className:(0,r.cn)("text-info-primary relative w-full overflow-hidden",a==="rounded"?"rounded-2xl":"rounded-none","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":s.theme==="dark"}),children:[(0,t.jsx)(i.Picture,{source:s.img.url,className:"size-full",imgClassName:"h-full object-cover"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute bottom-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden",children:[s.title&&(0,t.jsx)(i.Text,{html:s.title,as:"p",className:"line-clamp-2 desktop:text-[32px] laptop:text-2xl text-xl font-bold"}),s.description&&(0,t.jsx)(i.Text,{html:s.description,className:"line-clamp-2 desktop:text-lg text-sm font-bold"})]})]},f))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,r.cn)("!overflow-visible",o),data:{list:d||[],configuration:{shape:a}},Slide:y,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var I=(0,u.withLayout)(M);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/CreativeModule/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type CreativeModuleDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n theme: 'light' | 'dark'\n span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n}\n\ntype CreativeModuleType = {\n data: {\n shape?: 'rounded' | 'square'\n productsTab: CreativeModuleDataType[]\n }\n className?: string\n}\n\nconst Item = ({ data, configuration }: { data: CreativeModuleDataType; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]',\n configuration?.shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div className=\"absolute inset-0\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.mobileImg?.url || data?.img?.url}\n alt={data?.mobileImg?.alt || data?.img?.alt || ''}\n />\n <div className=\"z-1 absolute bottom-4 left-4 box-border flex w-full flex-col\">\n <Text html={data?.title} className=\"graphic-title truncate text-xl font-bold leading-[1.2]\" />\n {data?.description && (\n <Text html={data?.description} className=\"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]\" />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst CreativeModule = (props: CreativeModuleType) => {\n const { data, className } = props\n const { productsTab, shape } = data\n\n return (\n <>\n <div className=\"laptop:block box-border hidden w-full overflow-hidden\">\n <Grid className={cn('tablet:gap-4 grid grid-cols-12 gap-3 ', className)}>\n {productsTab?.map((item, index) => {\n return (\n <GridItem\n key={index}\n span={item.span}\n className={cn(\n 'text-info-primary relative w-full cursor-pointer overflow-hidden',\n shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:max-h-[480px] desktop:max-h-[384px] laptop:max-h-[288px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Picture\n source={item.img.url}\n className=\"size-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <div className=\"lg-desktop:bottom-8 lg-desktop:left-8 desktop:bottom-6 desktop:left-6 absolute bottom-4 left-4\">\n {item.title && (\n <Text html={item.title} as=\"p\" className=\"desktop:text-[32px] laptop:text-2xl text-xl font-bold\" />\n )}\n {item.description && <Text html={item.description} className=\"desktop:text-lg text-sm font-bold\" />}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n </div>\n <div className=\"laptop:hidden block w-full\">\n <SwiperBox\n id=\"CreativeModule\"\n className={cn('!overflow-visible', className)}\n data={{\n list: productsTab || [],\n configuration: {\n shape,\n },\n }}\n Slide={Item}\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 }}\n />\n </div>\n </>\n )\n}\n\nexport default withLayout(CreativeModule)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqCQ,IAAAI,EAAA,6BApCRC,EAAmB,kCACnBC,EAAsB,oCAEtBC,EAA2B,kCAC3BC,EAA+B,oCAC/BC,EAA8B,qCAmB9B,MAAMC,EAAO,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,OAEhC,OAAC,OACC,aAAW,MACT,4GACAA,GAAe,QAAU,UAAY,cAAgB,eACrD,CACE,YAAaD,EAAK,QAAU,MAC9B,CACF,EAEA,oBAAC,OAAI,UAAU,mBACb,oBAAC,WACC,UAAU,SACV,aAAa,sBACb,OAAQA,GAAM,WAAW,KAAO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d,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOR,KAAQ,cAAWW,CAAc",
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type CreativeModuleDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n theme: 'light' | 'dark'\n span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n}\n\ntype CreativeModuleType = {\n data: {\n shape?: 'rounded' | 'square'\n productsTab: CreativeModuleDataType[]\n }\n className?: string\n}\n\nconst Item = ({ data, configuration }: { data: CreativeModuleDataType; configuration?: any }) => {\n return (\n <div\n className={cn(\n 'creativeModuleItem',\n 'text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]',\n configuration?.shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div className=\"absolute inset-0\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.mobileImg?.url || data?.img?.url}\n alt={data?.mobileImg?.alt || data?.img?.alt || ''}\n />\n <div className=\"z-1 absolute bottom-4 left-0 right-0 box-border flex w-full flex-col px-4 overflow-hidden\">\n <Text html={data?.title} className=\"graphic-title truncate text-xl font-bold leading-[1.2]\" />\n {data?.description && (\n <Text html={data?.description} className=\"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]\" />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst CreativeModule = (props: CreativeModuleType) => {\n const { data, className } = props\n const { productsTab, shape } = data\n\n return (\n <>\n <div className={cn('creativeModuleBlock', 'laptop:block box-border hidden w-full overflow-hidden')}>\n <Grid className={cn('tablet:gap-4 grid grid-cols-12 gap-3 ', className)}>\n {productsTab?.map((item, index) => {\n return (\n <GridItem\n key={index}\n span={item.span}\n className={cn(\n 'text-info-primary relative w-full overflow-hidden',\n shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Picture source={item.img.url} className=\"size-full\" imgClassName=\"h-full object-cover\" />\n <div className=\"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute bottom-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden\">\n {item.title && (\n <Text\n html={item.title}\n as=\"p\"\n className=\"line-clamp-2 desktop:text-[32px] laptop:text-2xl text-xl font-bold\"\n />\n )}\n {item.description && (\n <Text html={item.description} className=\"line-clamp-2 desktop:text-lg text-sm font-bold\" />\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n </div>\n <div className=\"laptop:hidden block w-full\">\n <SwiperBox\n id=\"CreativeModule\"\n className={cn('!overflow-visible', className)}\n data={{\n list: productsTab || [],\n configuration: {\n shape,\n },\n }}\n Slide={Item}\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 }}\n />\n </div>\n </>\n )\n}\n\nexport default withLayout(CreativeModule)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCQ,IAAAI,EAAA,6BArCRC,EAAmB,kCACnBC,EAAsB,oCAEtBC,EAA2B,kCAC3BC,EAA+B,oCAC/BC,EAA8B,qCAmB9B,MAAMC,EAAO,CAAC,CAAE,KAAAC,EAAM,cA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Ae,CAAC,EACtB,cAAe,CACb,MAAAC,CACF,CACF,EACA,MAAOP,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,CACF,EACF,EACF,GACF,CAEJ,EAEA,IAAOR,KAAQ,cAAWW,CAAc",
6
6
  "names": ["CreativeModule_exports", "__export", "CreativeModule_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_SwiperBox", "import_Styles", "import_gird", "import_components", "Item", "data", "configuration", "CreativeModule", "props", "className", "productsTab", "shape", "item", "index", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var P=Object.create;var p=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var s in r)p(e,s,{get:r[s],enumerable:!0})},v=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of B(r))!A.call(e,a)&&a!==s&&p(e,a,{get:()=>r[a],enumerable:!(i=T(r,a))||i.enumerable});return e};var m=(e,r,s)=>(s=e!=null?P(M(e)):{},v(r||!e||!e.__esModule?p(s,"default",{value:e,enumerable:!0}):s,e)),z=e=>v(p({},"__esModule",{value:!0}),e);var H={};I(H,{default:()=>V});module.exports=z(H);var t=require("react/jsx-runtime"),l=m(require("react")),x=m(require("../Title/index.js")),o=require("../../helpers/utils.js"),w=m(require("../../components/picture.js")),g=m(require("../SwiperBox/index.js")),h=require("../../shared/Styles.js"),n=require("../../components/avatar.js"),b=require("../../components/container.js"),k=require("../../components/text.js"),N=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js");const f="copy",u="product_review",F=({data:e,configuration:r})=>{const s=i=>i?Array.from(new Array(Number(i)))||[]:[];return(0,t.jsx)("div",{className:(0,o.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",r?.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,o.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:s(e?.rating)?.map?.((i,a)=>(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"})})},a))})]}),(0,t.jsx)("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?(0,t.jsxs)(n.Avatar,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[(0,t.jsx)(n.AvatarImage,{src:e?.avatar?.url}),(0,t.jsx)(n.AvatarFallback,{children:e?.title})]}):null})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(k.Text,{className:(0,o.cn)("desktop:max-h-[151px] tablet:max-h-[140px]","lg-desktop:text-2xl text-info-primary line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""})}),(0,t.jsx)("a",{href:(0,y.trackUrlRef)(e?.link,`${f}_${u}`),onClick:()=>{r?.event?.primaryButton(e,r?.index)},children:(0,t.jsxs)("div",{className:(0,o.cn)("mt-3 flex items-center cursor-pointer overflow-hidden bg-[#F7F8F9] p-3",r?.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)(w.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||""})]})})]})})},R=l.default.forwardRef(({className:e="",data:r,key:s,...i},a)=>{const{products:C,title:d,theme:L,...E}=r,c=(0,l.useRef)(null);return(0,l.useImperativeHandle)(a,()=>c.current),(0,N.useExposure)(c,{componentType:f,componentName:u,componentTitle:d}),(0,t.jsx)("div",{className:e,ref:c,children:(0,t.jsx)("div",{className:"evaluate-box",children:(0,t.jsx)(b.Container,{...r?.containerProps||{},className:"overflow-hidden",children:(0,t.jsxs)("div",{ref:a,className:(0,o.cn)("w-full",e,{"aiui-dark":L==="dark"}),children:[d&&(0,t.jsx)(x.default,{data:{title:d}}),(0,t.jsx)(g.default,{className:"!overflow-visible",id:"Evaluate"+s,data:{list:C,configuration:{...E}},Slide:F,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}}})]})})})})});var V=(0,h.withLayout)(R);
1
+ "use strict";"use client";var E=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var s in r)d(e,s,{get:r[s],enumerable:!0})},u=(e,r,s,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of B(r))!A.call(e,i)&&i!==s&&d(e,i,{get:()=>r[i],enumerable:!(a=P(r,i))||a.enumerable});return e};var m=(e,r,s)=>(s=e!=null?E(M(e)):{},u(r||!e||!e.__esModule?d(s,"default",{value:e,enumerable:!0}):s,e)),$=e=>u(d({},"__esModule",{value:!0}),e);var V={};I(V,{default:()=>R});module.exports=$(V);var t=require("react/jsx-runtime"),o=m(require("react")),x=m(require("../Title/index.js")),l=require("../../helpers/utils.js"),w=m(require("../../components/picture.js")),h=m(require("../SwiperBox/index.js")),b=require("../../shared/Styles.js"),n=require("../../components/avatar.js"),g=require("../../components/container.js"),k=require("../../components/text.js"),N=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js");const v="copy",f="product_review",z=({data:e,configuration:r})=>{const s=a=>a?Array.from(new Array(Number(a)))||[]:[];return(0,t.jsx)("div",{className:(0,l.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",r?.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,l.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:s(e?.rating)?.map?.((a,i)=>(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"})})},i))})]}),(0,t.jsx)("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?(0,t.jsxs)(n.Avatar,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[(0,t.jsx)(n.AvatarImage,{src:e?.avatar?.url}),(0,t.jsx)(n.AvatarFallback,{children:e?.title})]}):null})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(k.Text,{className:(0,l.cn)("desktop:max-h-[151px] tablet:max-h-[140px]","lg-desktop:text-2xl text-info-primary line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""})}),(0,t.jsx)("a",{href:(0,y.trackUrlRef)(e?.link,`${v}_${f}`),onClick:()=>{r?.event?.primaryButton(e,r?.index+1)},"data-headless-type-name":`${v}#${f}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-postion":`''#${r?.index+1}`,children:(0,t.jsxs)("div",{className:(0,l.cn)("mt-3 flex items-center cursor-pointer overflow-hidden bg-[#F7F8F9] p-3",r?.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)(w.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||""})]})})]})})},F=o.default.forwardRef(({className:e="",data:r,key:s,...a},i)=>{const{products:C,title:p,theme:L,...T}=r,c=(0,o.useRef)(null);return(0,o.useImperativeHandle)(i,()=>c.current),(0,N.useExposure)(c,{componentType:v,componentName:f,componentTitle:p}),(0,t.jsx)("div",{className:e,ref:c,children:(0,t.jsx)("div",{className:"evaluate-box",children:(0,t.jsx)(g.Container,{...r?.containerProps||{},className:"overflow-hidden",children:(0,t.jsxs)("div",{ref:i,className:(0,l.cn)("w-full",e,{"aiui-dark":L==="dark"}),children:[p&&(0,t.jsx)(x.default,{data:{title:p}}),(0,t.jsx)(h.default,{className:"!overflow-visible",id:"Evaluate"+s,data:{list:C,configuration:{...T,title:p}},Slide:z,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}}})]})})})})});var R=(0,b.withLayout)(F);
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 } from 'react'\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 handleRating = (num: number) => {\n if (num) {\n return Array.from(new Array(Number(num))) || []\n }\n return []\n }\n\n return (\n <div\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\">\n <Text\n className={cn(\n 'desktop:max-h-[151px] tablet:max-h-[140px]',\n 'lg-desktop:text-2xl text-info-primary line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index)\n }}\n >\n <div\n className={cn(\n 'mt-3 flex items-center cursor-pointer 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, ...rest }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box\">\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 } }}\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>\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AAI,WAAaT,EACjB,KAAM,CAAE,KAAMG,EAAU,cAAe,CAAE,GAAGG,CAAM,CAAE,EACpD,MAAOjB,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,EAED,IAAOhB,KAAQ,cAAWwB,CAAQ",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\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 handleRating = (num: number) => {\n if (num) {\n return Array.from(new Array(Number(num))) || []\n }\n return []\n }\n\n return (\n <div\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\">\n <Text\n className={cn(\n 'desktop:max-h-[151px] tablet:max-h-[140px]',\n 'lg-desktop:text-2xl text-info-primary line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\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 items-center cursor-pointer 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, ...rest }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box\">\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\nexport default withLayout(Evaluate)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqEU,IAAAI,EAAA,6BApEVC,EAAmD,oBACnDC,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,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAmD,CAC7F,MAAMC,EAAgBC,GAChBA,EACK,MAAM,KAAK,IAAI,MAAM,OAAOA,CAAG,CAAC,CAAC,GAAK,CAAC,EAEzC,CAAC,EAGV,SACE,OAAC,OACC,aAAW,MACT,qGACAF,GAAe,QAAU,QAAU,cAAgB,eACnD,oGACA,qFACA,qBACF,EAEA,oBAAC,OAAI,UAAU,4EACb,qBAAC,OAAI,aAAW,MAAG,iEAAiE,EAClF,qBAAC,OAAI,UAAU,SACZ,UAAAD,GAAM,SAAQ,OAAC,MAAG,UAAU,mCAAoC,SAAAA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AY,GAAI,KAAAT,EAAM,IAAAU,EAAK,GAAGC,CAAK,EAAGC,IAAQ,CAChH,KAAM,CAAE,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAM,EAAIhB,EACvCiB,KAAW,UAAuB,IAAI,EAC5C,gCAAoBL,EAAK,IAAMK,EAAS,OAAyB,KAEjE,eAAYA,EAAU,CACpB,cAAApB,EACA,cAAAC,EACA,eAAgBgB,CAClB,CAAC,KAGC,OAAC,OAAI,UAAWL,EAAW,IAAKQ,EAC9B,mBAAC,OAAI,UAAU,eACb,mBAAC,aAAW,GAAIjB,GAAM,gBAAkB,CAAC,EAAI,UAAU,kBACrD,oBAAC,OAAI,IAAKY,EAAK,aAAW,MAAG,SAAUH,EAAW,CAAE,YAAaM,IAAU,MAAO,CAAC,EAChF,UAAAD,MAAS,OAAC,EAAAI,QAAA,CAAM,KAAM,CAAE,MAAOJ,CAAM,EAAG,KACzC,OAAC,EAAAK,QAAA,CACC,UAAU,oBACV,GAAI,WAAaT,EACjB,KAAM,CAAE,KAAMG,EAAU,cAAe,CAAE,GAAGG,EAAO,MAAOF,CAAM,CAAE,EAClE,MAAOf,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,EAED,IAAOhB,KAAQ,cAAWwB,CAAQ",
6
6
  "names": ["Evaluate_exports", "__export", "Evaluate_default", "__toCommonJS", "import_jsx_runtime", "import_react", "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", "handleRating", "num", "_", "index", "Picture", "Evaluate", "React", "className", "key", "rest", "ref", "products", "title", "theme", "ohter", "innerRef", "Title", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var u=Object.create;var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},m=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y(t))!N.call(e,i)&&i!==o&&n(e,i,{get:()=>t[i],enumerable:!(s=v(t,i))||s.enumerable});return e};var F=(e,t,o)=>(o=e!=null?u(g(e)):{},m(t||!e||!e.__esModule?n(o,"default",{value:e,enumerable:!0}):o,e)),h=e=>m(n({},"__esModule",{value:!0}),e);var D={};b(D,{FaqItem:()=>d,default:()=>q});module.exports=h(D);var a=require("react/jsx-runtime"),r=F(require("react")),p=require("../../components/index.js"),l=require("../../helpers/index.js"),c=require("../../shared/Styles.js");const x=r.default.forwardRef(({data:e,className:t},o)=>{const s=(0,r.useRef)(null);return(0,r.useImperativeHandle)(o,()=>s.current),(0,a.jsx)("div",{ref:s,className:(0,l.cn)(t),children:(0,a.jsx)("div",{children:e?.productData?.map((i,f)=>(0,a.jsx)(d,{data:i},f))})})});x.displayName="Faq";const d=({data:e})=>{const[t,o]=(0,r.useState)(!1);return(0,a.jsx)("div",{className:"tablet:py-[24px] border-b border-[#E4E5E6] py-[16px]",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{onClick:()=>{o(!t)},className:"tablet:gap-[128px] flex cursor-pointer items-center justify-between gap-[16px]",children:[(0,a.jsx)(p.Text,{html:e?.title,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#1D1D1F]"}),(0,a.jsx)("div",{className:" transition-transform duration-300",children:(0,a.jsx)(p.Picture,{source:e?.img?.url,className:(0,l.cn)("w-[20px] transition-transform duration-300",t&&"rotate-180")})})]}),(0,a.jsx)("div",{className:(0,l.cn)(" overflow-hidden transition-all duration-500",t?"mt-[8px] max-h-[500px] opacity-100":"max-h-0 opacity-0"),children:(0,a.jsx)(p.Text,{html:e?.desc,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#3D3D3F]"})})]})})};d.displayName="FaqItem";var q=(0,c.withLayout)(x);
1
+ "use strict";"use client";var u=Object.create;var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},m=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y(t))!N.call(e,i)&&i!==o&&n(e,i,{get:()=>t[i],enumerable:!(s=v(t,i))||s.enumerable});return e};var F=(e,t,o)=>(o=e!=null?u(g(e)):{},m(t||!e||!e.__esModule?n(o,"default",{value:e,enumerable:!0}):o,e)),h=e=>m(n({},"__esModule",{value:!0}),e);var D={};b(D,{FaqItem:()=>d,default:()=>q});module.exports=h(D);var a=require("react/jsx-runtime"),r=F(require("react")),p=require("../../components/index.js"),l=require("../../helpers/index.js"),c=require("../../shared/Styles.js");const x=r.default.forwardRef(({data:e,className:t},o)=>{const s=(0,r.useRef)(null);return(0,r.useImperativeHandle)(o,()=>s.current),(0,a.jsx)("div",{ref:s,className:(0,l.cn)(t),children:(0,a.jsx)("div",{children:e?.productData?.map((i,f)=>(0,a.jsx)(d,{data:i},f))})})});x.displayName="Faq";const d=({data:e})=>{const[t,o]=(0,r.useState)(!1);return(0,a.jsx)("div",{className:"tablet:py-[24px] border-b border-[#E4E5E6] py-[16px]",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{onClick:()=>{o(!t)},className:"tablet:gap-[128px] flex cursor-pointer items-center justify-between gap-[16px]",children:[(0,a.jsx)(p.Text,{html:e?.title,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#1D1D1F]"}),(0,a.jsx)("div",{className:" transition-transform duration-300",children:(0,a.jsx)(p.Picture,{source:e?.img?.url,className:(0,l.cn)("w-[20px] transition-transform duration-300",t&&"rotate-180")})})]}),(0,a.jsx)("div",{className:(0,l.cn)(" overflow-hidden transition-all duration-500",t?"mt-[8px] max-h-[500px] opacity-100":"max-h-0 opacity-0"),children:(0,a.jsx)(p.Text,{html:e?.desc,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#6D6D6F]"})})]})})};d.displayName="FaqItem";var q=(0,c.withLayout)(x);
2
2
  //# sourceMappingURL=Faq.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Faq/Faq.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport type { FaqProps, FaqItem as ItemType } from './types.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\n// import { withStyles } from '../../shared/Styles.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst Faq = React.forwardRef<HTMLDivElement, FaqProps>(({ data, className }, ref) => {\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current!)\n\n return (\n <div ref={innerRef} className={cn(className)}>\n <div>{data?.productData?.map((item: any, index: number) => <FaqItem key={index} data={item} />)}</div>\n </div>\n )\n})\n\nFaq.displayName = 'Faq'\n\nconst FaqItem = ({ data }: { data: ItemType }) => {\n const [open, setOpen] = useState(false)\n\n const handleToggle = () => {\n setOpen(!open)\n }\n\n return (\n <div className=\"tablet:py-[24px] border-b border-[#E4E5E6] py-[16px]\">\n <div>\n <div\n onClick={handleToggle}\n className=\"tablet:gap-[128px] flex cursor-pointer items-center justify-between gap-[16px]\"\n >\n <Text\n html={data?.title}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#1D1D1F]\"\n />\n <div className=\" transition-transform duration-300\">\n <Picture\n source={data?.img?.url}\n className={cn('w-[20px] transition-transform duration-300', open && 'rotate-180')}\n />\n </div>\n </div>\n\n {/* \u5E26\u8FC7\u6E21\u7684\u5185\u5BB9\u533A\u57DF */}\n <div\n className={cn(\n ' overflow-hidden transition-all duration-500',\n open ? 'mt-[8px] max-h-[500px] opacity-100' : 'max-h-0 opacity-0'\n )}\n >\n <Text\n html={data?.desc}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#3D3D3F]\"\n />\n </div>\n </div>\n </div>\n )\n}\n\nFaqItem.displayName = 'FaqItem'\n\nexport default withLayout(Faq)\nexport { FaqItem }\n"],
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport type { FaqProps, FaqItem as ItemType } from './types.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\n// import { withStyles } from '../../shared/Styles.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst Faq = React.forwardRef<HTMLDivElement, FaqProps>(({ data, className }, ref) => {\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current!)\n\n return (\n <div ref={innerRef} className={cn(className)}>\n <div>{data?.productData?.map((item: any, index: number) => <FaqItem key={index} data={item} />)}</div>\n </div>\n )\n})\n\nFaq.displayName = 'Faq'\n\nconst FaqItem = ({ data }: { data: ItemType }) => {\n const [open, setOpen] = useState(false)\n\n const handleToggle = () => {\n setOpen(!open)\n }\n\n return (\n <div className=\"tablet:py-[24px] border-b border-[#E4E5E6] py-[16px]\">\n <div>\n <div\n onClick={handleToggle}\n className=\"tablet:gap-[128px] flex cursor-pointer items-center justify-between gap-[16px]\"\n >\n <Text\n html={data?.title}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#1D1D1F]\"\n />\n <div className=\" transition-transform duration-300\">\n <Picture\n source={data?.img?.url}\n className={cn('w-[20px] transition-transform duration-300', open && 'rotate-180')}\n />\n </div>\n </div>\n\n {/* \u5E26\u8FC7\u6E21\u7684\u5185\u5BB9\u533A\u57DF */}\n <div\n className={cn(\n ' overflow-hidden transition-all duration-500',\n open ? 'mt-[8px] max-h-[500px] opacity-100' : 'max-h-0 opacity-0'\n )}\n >\n <Text\n html={data?.desc}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n </div>\n </div>\n </div>\n )\n}\n\nFaqItem.displayName = 'FaqItem'\n\nexport default withLayout(Faq)\nexport { FaqItem }\n"],
5
5
  "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAciE,IAAAK,EAAA,6BAbjEC,EAA6D,oBAE7DC,EAA8B,qCAC9BC,EAAmB,kCAEnBC,EAA2B,kCAE3B,MAAMC,EAAM,EAAAC,QAAM,WAAqC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACnF,MAAMC,KAAW,UAAuB,IAAI,EAC5C,gCAAoBD,EAAK,IAAMC,EAAS,OAAQ,KAG9C,OAAC,OAAI,IAAKA,EAAU,aAAW,MAAGF,CAAS,EACzC,mBAAC,OAAK,SAAAD,GAAM,aAAa,IAAI,CAACI,EAAWC,OAAkB,OAACf,EAAA,CAAoB,KAAMc,GAAbC,CAAmB,CAAE,EAAE,EAClG,CAEJ,CAAC,EAEDP,EAAI,YAAc,MAElB,MAAMR,EAAU,CAAC,CAAE,KAAAU,CAAK,IAA0B,CAChD,KAAM,CAACM,EAAMC,CAAO,KAAI,YAAS,EAAK,EAMtC,SACE,OAAC,OAAI,UAAU,uDACb,oBAAC,OACC,qBAAC,OACC,QARa,IAAM,CACzBA,EAAQ,CAACD,CAAI,CACf,EAOQ,UAAU,iFAEV,oBAAC,QACC,KAAMN,GAAM,MACZ,UAAU,gGACZ,KACA,OAAC,OAAI,UAAU,qCACb,mBAAC,WACC,OAAQA,GAAM,KAAK,IACnB,aAAW,MAAG,6CAA8CM,GAAQ,YAAY,EAClF,EACF,GACF,KAGA,OAAC,OACC,aAAW,MACT,+CACAA,EAAO,qCAAuC,mBAChD,EAEA,mBAAC,QACC,KAAMN,GAAM,KACZ,UAAU,gGACZ,EACF,GACF,EACF,CAEJ,EAEAV,EAAQ,YAAc,UAEtB,IAAOC,KAAQ,cAAWO,CAAG",
6
6
  "names": ["Faq_exports", "__export", "FaqItem", "Faq_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_helpers", "import_Styles", "Faq", "React", "data", "className", "ref", "innerRef", "item", "index", "open", "setOpen"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var R=Object.create;var u=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var _=(e,o)=>{for(var i in o)u(e,i,{get:o[i],enumerable:!0})},I=(e,o,i,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of q(o))!Y.call(e,r)&&r!==i&&u(e,r,{get:()=>o[r],enumerable:!(a=$(o,r))||a.enumerable});return e};var b=(e,o,i)=>(i=e!=null?R(F(e)):{},I(o||!e||!e.__esModule?u(i,"default",{value:e,enumerable:!0}):i,e)),A=e=>I(u({},"__esModule",{value:!0}),e);var J={};_(J,{default:()=>Z});module.exports=A(J);var t=require("react/jsx-runtime"),V=require("react-responsive"),s=b(require("react")),m=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),C=b(require("../SwiperBox/index.js")),f=require("../../components/index.js"),d=require("../../components/index.js"),P=b(require("../Title/index.js")),G=require("../VideoModal/index.js"),S=require("../TextModal/index.js"),E=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js");const g="image",w="graphic",Q=({data:e,configuration:o})=>{const i=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};function a(n){throw new Error("Function not implemented.")}function r(n){throw new Error("Function not implemented.")}function v(n){throw new Error("Function not implemented.")}return(0,t.jsx)("div",{className:(0,m.cn)(i(),"laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,m.cn)("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":o?.itemShape==="round"}),children:(0,t.jsxs)("a",{"aria-label":e?.title??e?.description,href:(0,x.trackUrlRef)(e?.href,`${g}_${w}`),className:"relative block size-full cursor-pointer overflow-hidden",children:[(0,t.jsx)(d.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""}),(0,t.jsxs)("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[(0,t.jsxs)("div",{className:(0,m.cn)("flex items-end overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(d.Text,{html:e?.title,style:{color:e?.textColor},className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(f.Heading,{html:e?.description,style:{color:e?.textColor},as:"h3",className:"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]"})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-10 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onIconClick?.(e,o)},className:" laptop:size-9 flex size-6 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,t.jsx)(d.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(f.Button,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"desktop:mt-[24px] mt-[12px] self-start",href:(0,x.trackUrlRef)(e?.href,`${g}_${w}`),children:e.buttonText})]})]})})})},M=s.default.forwardRef(({data:e,className:o},i)=>{const a=(0,V.useMediaQuery)({query:"(max-width: 768px)"}),r=(0,s.useRef)(null),[v,n]=(0,s.useState)(!1),[y,B]=(0,s.useState)(""),[H,L]=(0,s.useState)(""),[D,U]=(0,s.useState)(""),[z,k]=(0,s.useState)(null),[j,T]=(0,s.useState)(!1),h=p=>{const l=e?.items?.length>3,c=e?.items?.length>2;switch(p){case 1440:return l?4:e?.items?.length;case 1024:return l?3:e?.items?.length;case 768:return l||c?2.3:2;default:return 1.2}};return(0,s.useImperativeHandle)(i,()=>r.current),(0,E.useExposure)(r,{componentType:g,componentName:w,componentTitle:e?.title}),(0,s.useEffect)(()=>{const p=r.current?.querySelectorAll(".graphic-description");if(p&&p.length>0){let l=0;p.forEach(c=>{l=Math.max(l,c.offsetHeight)}),p.forEach(c=>{c.style.height=`${l}px`})}},[]),(0,t.jsxs)("div",{className:o,ref:r,children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(P.default,{data:{title:e?.title}}),(0,t.jsx)(C.default,{id:"Graphic",className:(0,m.cn)("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(p,l)=>{n(!0),l?.isYouTube?L?.(l?.youtubeId||""):(B?.(l?.video?.url||""),U?.(l?.mobileVideo?.url||""))},onIconClick:p=>{T(!0),k(p)}}},Slide:Q,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h()},768:{spaceBetween:16,freeMode:!1,slidesPerView:h(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:h(1440)}}})]}),(0,t.jsx)(G.VideoModal,{visible:v,youTubeId:H,onCloseModal:()=>n(!1),videoUrl:a&&D||y}),(0,t.jsx)(S.TextModal,{textVisible:j,extension:z?.extension,onCloseModal:()=>{T(!1),k(null)}})]})});M.displayName="Graphic";var Z=(0,N.withLayout)(M);
1
+ "use strict";"use client";var z=Object.create;var b=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var Y=(e,s)=>{for(var i in s)b(e,i,{get:s[i],enumerable:!0})},T=(e,s,i,m)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of R(s))!F.call(e,r)&&r!==i&&b(e,r,{get:()=>s[r],enumerable:!(m=j(s,r))||m.enumerable});return e};var g=(e,s,i)=>(i=e!=null?z(q(e)):{},T(s||!e||!e.__esModule?b(i,"default",{value:e,enumerable:!0}):i,e)),_=e=>T(b({},"__esModule",{value:!0}),e);var Z={};Y(Z,{default:()=>Q});module.exports=_(Z);var t=require("react/jsx-runtime"),M=require("react-responsive"),o=g(require("react")),c=require("../../helpers/utils.js"),V=require("../../shared/Styles.js"),N=g(require("../SwiperBox/index.js")),a=require("../../components/index.js"),C=g(require("../Title/index.js")),P=require("../VideoModal/index.js"),$=require("../TextModal/index.js"),G=require("../../hooks/useExposure.js"),w=require("../../shared/trackUrlRef.js");const h="image",u="graphic",A=({data:e,configuration:s})=>{const i=()=>{switch(s.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};function m(n){throw new Error("Function not implemented.")}function r(n){throw new Error("Function not implemented.")}function x(n){throw new Error("Function not implemented.")}return(0,t.jsx)("div",{className:(0,c.cn)(i(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":s?.itemShape==="round"}),children:(0,t.jsxs)("div",{className:"relative block size-full cursor-pointer overflow-hidden",children:[(0,t.jsx)("a",{"aria-label":e?.title??e?.description,href:e?.href?(0,w.trackUrlRef)(e?.href||"",`${h}_${u}`):"",className:"block size-full cursor-pointer overflow-hidden","data-headless-nav-postion":`''#${s?.index+1}`,"data-headless-type-name":`${h}#${u}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,t.jsx)(a.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),(0,t.jsxs)("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(a.Text,{html:e?.title,style:{color:e?.textColor},className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(a.Heading,{html:e?.description,style:{color:e?.textColor},as:"h3",className:"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]"})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:n=>{n.preventDefault(),n.stopPropagation(),s?.onVideoPlayBtnClick?.(s?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),s?.onIconClick?.(e,s)},className:"laptop:size-9 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75 overflow-hidden",children:(0,t.jsx)(a.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(a.Button,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"mt-[8px] self-start",href:(0,w.trackUrlRef)(e?.href,`${h}_${u}`),"data-headless-nav-postion":`''#${s?.index+1}`,"data-headless-type-name":`${h}#${u}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},I=o.default.forwardRef(({data:e,className:s},i)=>{const m=(0,M.useMediaQuery)({query:"(max-width: 768px)"}),r=(0,o.useRef)(null),[x,n]=(0,o.useState)(!1),[v,S]=(0,o.useState)(""),[E,B]=(0,o.useState)(""),[H,L]=(0,o.useState)(""),[D,y]=(0,o.useState)(null),[U,k]=(0,o.useState)(!1),f=p=>{const l=e?.items?.length>3,d=e?.items?.length>2;switch(p){case 1440:return l?4:e?.items?.length;case 1024:return l?3:e?.items?.length;case 768:return l||d?2.3:2;default:return 1.2}};return(0,o.useImperativeHandle)(i,()=>r.current),(0,G.useExposure)(r,{componentType:h,componentName:u,componentTitle:e?.title}),(0,o.useEffect)(()=>{const p=r.current?.querySelectorAll(".graphic-description");if(p&&p.length>0){let l=0;p.forEach(d=>{l=Math.max(l,d.offsetHeight)}),p.forEach(d=>{d.style.height=`${l}px`})}},[]),(0,t.jsxs)("div",{className:(0,c.cn)("graphicBlock",s),ref:r,children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(C.default,{data:{title:e?.title}}),(0,t.jsx)(N.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(p,l)=>{n(!0),l?.isYouTube?B?.(l?.youtubeId||""):(S?.(l?.video?.url||""),L?.(l?.mobileVideo?.url||""))},onIconClick:p=>{k(!0),y(p)},title:e?.title}},Slide:A,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:f()},768:{spaceBetween:16,freeMode:!1,slidesPerView:f(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:f(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:f(1440)}}})]}),(0,t.jsx)(P.VideoModal,{visible:x,youTubeId:E,onCloseModal:()=>n(!1),videoUrl:m&&H||v}),(0,t.jsx)($.TextModal,{textVisible:U,extension:D?.extension,onCloseModal:()=>{k(!1),y(null)}})]})});I.displayName="Graphic";var Q=(0,V.withLayout)(I);
2
2
  //# sourceMappingURL=index.js.map