@anker-in/headless-ui 1.3.86 → 1.3.88

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 (157) hide show
  1. package/CONTRIBUTING.md +57 -0
  2. package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
  3. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  4. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
  5. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  6. package/dist/cjs/biz-components/ActiveShelf/types.d.ts +12 -1
  7. package/dist/cjs/biz-components/ActiveShelf/types.js +1 -1
  8. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  9. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +28 -0
  10. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  11. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
  12. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  13. package/dist/cjs/biz-components/BrandEquity/types.d.ts +2 -0
  14. package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
  15. package/dist/cjs/biz-components/Chat/button.js +1 -1
  16. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  17. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  18. package/dist/cjs/biz-components/HeroBanner/types.d.ts +12 -6
  19. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  20. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  21. package/dist/cjs/biz-components/ImageWithText/types.d.ts +8 -2
  22. package/dist/cjs/biz-components/ImageWithText/types.js +1 -1
  23. package/dist/cjs/biz-components/Ksp/index.d.ts +2 -0
  24. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  25. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +8 -2
  26. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  27. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  31. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  32. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  33. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  34. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  35. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  36. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  37. package/dist/cjs/biz-components/Listing/types/product.d.ts +9 -0
  38. package/dist/cjs/biz-components/Listing/types/product.js +1 -1
  39. package/dist/cjs/biz-components/Listing/types.d.ts +19 -0
  40. package/dist/cjs/biz-components/Listing/types.js +1 -1
  41. package/dist/cjs/biz-components/Listing/utils/priceCalc.d.ts +28 -0
  42. package/dist/cjs/biz-components/Listing/utils/priceCalc.js +1 -0
  43. package/dist/cjs/biz-components/MarqueeReview/index.js +1 -1
  44. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  45. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  46. package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
  47. package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
  48. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  49. package/dist/cjs/biz-components/ProductHero/types.d.ts +2 -0
  50. package/dist/cjs/biz-components/ProductHero/types.js +1 -1
  51. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  52. package/dist/cjs/biz-components/ProductNav/types.d.ts +5 -2
  53. package/dist/cjs/biz-components/ProductNav/types.js +1 -1
  54. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +5 -4
  55. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  56. package/dist/cjs/biz-components/Specs/dropdown.js +1 -2
  57. package/dist/cjs/biz-components/Specs/index.js +1 -1
  58. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  59. package/dist/cjs/biz-components/index.d.ts +3 -0
  60. package/dist/cjs/biz-components/index.js +1 -1
  61. package/dist/cjs/components/link.js +1 -1
  62. package/dist/cjs/hooks/useBoaButton.d.ts +27 -0
  63. package/dist/cjs/hooks/useBoaButton.js +1 -0
  64. package/dist/cjs/hooks/useDraggableScroll.js +1 -1
  65. package/dist/cjs/hooks/useExposure.d.ts +1 -1
  66. package/dist/cjs/hooks/useExposure.js +1 -1
  67. package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
  68. package/dist/cjs/index.d.ts +10 -2
  69. package/dist/cjs/index.js +1 -1
  70. package/dist/cjs/shared/ContainerGridContext.d.ts +20 -0
  71. package/dist/cjs/shared/ContainerGridContext.js +1 -0
  72. package/dist/cjs/shared/Styles.d.ts +2 -0
  73. package/dist/cjs/shared/Styles.js +1 -1
  74. package/dist/cjs/shared/adTrack.d.ts +38 -0
  75. package/dist/cjs/shared/adTrack.js +1 -0
  76. package/dist/cjs/shared/amazonAttribution.d.ts +31 -0
  77. package/dist/cjs/shared/amazonAttribution.js +1 -0
  78. package/dist/cjs/shared/mediaGridSpec.d.ts +87 -0
  79. package/dist/cjs/shared/mediaGridSpec.js +1 -0
  80. package/dist/cjs/stories/BoaStoryProvider.d.ts +10 -0
  81. package/dist/cjs/stories/BoaStoryProvider.js +1 -0
  82. package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
  83. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  84. package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
  85. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  86. package/dist/esm/biz-components/ActiveShelf/types.d.ts +12 -1
  87. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  88. package/dist/esm/biz-components/AiuiProvider/index.d.ts +28 -0
  89. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  90. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
  91. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  92. package/dist/esm/biz-components/BrandEquity/types.d.ts +2 -0
  93. package/dist/esm/biz-components/Chat/button.js +1 -1
  94. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  95. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  96. package/dist/esm/biz-components/HeroBanner/types.d.ts +12 -6
  97. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  98. package/dist/esm/biz-components/ImageWithText/types.d.ts +8 -2
  99. package/dist/esm/biz-components/Ksp/index.d.ts +2 -0
  100. package/dist/esm/biz-components/Ksp/index.js +1 -1
  101. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +8 -2
  102. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  103. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  104. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  105. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  106. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  107. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  108. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  109. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  110. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  111. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  112. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  113. package/dist/esm/biz-components/Listing/types/product.d.ts +9 -0
  114. package/dist/esm/biz-components/Listing/types.d.ts +19 -0
  115. package/dist/esm/biz-components/Listing/utils/priceCalc.d.ts +28 -0
  116. package/dist/esm/biz-components/Listing/utils/priceCalc.js +1 -0
  117. package/dist/esm/biz-components/MarqueeReview/index.js +1 -1
  118. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  119. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  120. package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
  121. package/dist/esm/biz-components/ProductCompare/index.js +1 -1
  122. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  123. package/dist/esm/biz-components/ProductHero/types.d.ts +2 -0
  124. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  125. package/dist/esm/biz-components/ProductNav/types.d.ts +5 -2
  126. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +5 -4
  127. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  128. package/dist/esm/biz-components/Specs/dropdown.js +1 -2
  129. package/dist/esm/biz-components/Specs/index.js +1 -1
  130. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  131. package/dist/esm/biz-components/index.d.ts +3 -0
  132. package/dist/esm/biz-components/index.js +1 -1
  133. package/dist/esm/components/link.js +1 -1
  134. package/dist/esm/hooks/useBoaButton.d.ts +27 -0
  135. package/dist/esm/hooks/useBoaButton.js +1 -0
  136. package/dist/esm/hooks/useDraggableScroll.js +1 -1
  137. package/dist/esm/hooks/useExposure.d.ts +1 -1
  138. package/dist/esm/hooks/useExposure.js +1 -1
  139. package/dist/esm/hooks/useViewItemList.d.ts +1 -1
  140. package/dist/esm/index.d.ts +10 -2
  141. package/dist/esm/index.js +1 -1
  142. package/dist/esm/shared/ContainerGridContext.d.ts +20 -0
  143. package/dist/esm/shared/ContainerGridContext.js +1 -0
  144. package/dist/esm/shared/Styles.d.ts +2 -0
  145. package/dist/esm/shared/Styles.js +1 -1
  146. package/dist/esm/shared/adTrack.d.ts +38 -0
  147. package/dist/esm/shared/adTrack.js +1 -0
  148. package/dist/esm/shared/amazonAttribution.d.ts +31 -0
  149. package/dist/esm/shared/amazonAttribution.js +1 -0
  150. package/dist/esm/shared/mediaGridSpec.d.ts +87 -0
  151. package/dist/esm/shared/mediaGridSpec.js +1 -0
  152. package/dist/esm/stories/BoaStoryProvider.d.ts +10 -0
  153. package/dist/esm/stories/BoaStoryProvider.js +1 -0
  154. package/dist/tokens/base.css +22 -1
  155. package/package.json +5 -2
  156. package/style.css +250 -136
  157. package/tailwind.config.js +5 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 价格相关的纯数字计算。只返回 number,不做任何格式化。
3
+ * 宿主可调用这些函数拿到与组件内部一致的金额,再自行格式化后通过 `formattedPrices` 传入。
4
+ */
5
+ /**
6
+ * ProductSummary 中「当前商品最终价」。
7
+ * = 商品价 - (已登录 ? 会员节省 : 0) - 优惠券节省,保留 2 位小数。
8
+ */
9
+ export declare function calcSummaryFinalPrice({ price, memberSaving, couponSaving, isLogin, }: {
10
+ /** 当前商品原价,即 selectedVariants[0].price.amount */
11
+ price: number;
12
+ /** savingDetail.member */
13
+ memberSaving?: number;
14
+ /** savingDetail.coupon */
15
+ couponSaving?: number;
16
+ /** 是否已登录,对应组件内 `Boolean(profile?.email)` */
17
+ isLogin: boolean;
18
+ }): number;
19
+ /**
20
+ * ProductActions 中「已解锁的节省金额」。
21
+ * 不可叠加时取会员与 code 折扣的较大值,可叠加时取二者之和,保留 2 位小数。
22
+ */
23
+ export declare function calcUnlockedSaving({ memberSaving, couponSaving, exclusive, }: {
24
+ memberSaving: number;
25
+ couponSaving: number;
26
+ /** 对应 `Boolean(memberFunctionResult?.withoutCouponMaxMemberTotalSave)` */
27
+ exclusive: boolean;
28
+ }): number;
@@ -0,0 +1 @@
1
+ import i from"decimal.js";function a({price:e,memberSaving:n=0,couponSaving:r=0,isLogin:o}){let u=new i(e||0);o&&(u=u.minus(n||0));const m=u.minus(r).toNumber();return parseFloat(m.toFixed(2))}function c({memberSaving:e,couponSaving:n,exclusive:r}){return Math.round((r?Math.max(e,n):e+n)*100)/100}export{a as calcSummaryFinalPrice,c as calcUnlockedSaving};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import"react";import{Text as n,Heading as c,Avatar as u,AvatarImage as C,AvatarFallback as L}from"../../components/index.js";import{cn as m}from"../../helpers/utils.js";import{withLayout as k}from"../../shared/Styles.js";const x=9,b=3,y=(t,a)=>Array.from({length:Math.ceil(t.length/a)},(l,r)=>t.slice(r*a,(r+1)*a)),N=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})}),M=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"13",viewBox:"0 0 14 13",fill:"none",children:e("path",{d:"M6.07501 0.418036C6.35012 -0.139398 7.145 -0.139397 7.42011 0.418037L8.9242 3.46565C9.03344 3.68701 9.24462 3.84043 9.4889 3.87593L12.8521 4.36464C13.4673 4.45403 13.7129 5.21 13.2678 5.64391L10.8341 8.01614C10.6574 8.18844 10.5767 8.43669 10.6184 8.67999L11.1929 12.0296C11.298 12.6423 10.655 13.1095 10.1047 12.8203L7.09656 11.2388C6.87807 11.1239 6.61705 11.1239 6.39855 11.2388L3.39038 12.8203C2.84016 13.1095 2.19709 12.6423 2.30217 12.0296L2.87668 8.67999C2.91841 8.43669 2.83775 8.18844 2.66098 8.01614L0.227318 5.64391C-0.21782 5.21 0.0278133 4.45403 0.642979 4.36464L4.00622 3.87593C4.2505 3.84043 4.46167 3.68701 4.57092 3.46565L6.07501 0.418036Z",fill:"#75787F"})}),T=({item:t})=>s("div",{className:"rounded-box bg-container-primary text-info-primary min-l:p-[24px] laptop:h-[240px] desktop:h-[240px] lg-desktop:h-[240px] flex h-[240px] grow flex-col justify-between p-[16px]",children:[s("div",{className:"flex justify-between",children:[s("div",{className:"flex flex-col",children:[e(n,{size:4,html:t.name,className:"laptop:block hidden"}),e(n,{size:2,html:t.name,className:"laptop:hidden block"}),s("div",{className:"mt-2 flex gap-1",children:[new Array(t.rating||5).fill(0).map((a,l)=>e(N,{},l)),new Array(5-(t.rating||5)).fill(0).map((a,l)=>e("span",{children:M()},l))]})]}),s(u,{size:"small",className:" laptop:size-[48px] size-[40px]",children:[e(C,{src:t.avatar?.url,alt:t.avatar?.alt||""}),e(L,{children:(t.name??"").slice(0,2).toUpperCase()})]})]}),e("div",{children:e(c,{as:"h6",size:2,html:`${t.comment}`,className:"line-clamp-5 min-h-[120px] text-wrap"})})]});function R({data:t,className:a,...l}){const{title:r,subtitle:h,items:i=[],theme:d="light",titleTag:f}=t,v=y(i.length<x?[...i,...i.slice(x-i.length)]:i,b).slice(0,3).map(o=>[...o,...o]);return s("section",{...l,className:m("text-info-primary flex flex-col items-center justify-center py-3",a,{"aiui-dark":d==="dark"}),children:[e(c,{as:f??"h2",size:4,html:r,className:"laptop:text-center w-full text-left"}),e(n,{size:2,html:h,className:"tablet:mt-[16px] tablet:text-[14px] laptop:text-center laptop:text-[14px] desktop:mt-[8px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] w-full text-left text-[14px]"}),e("div",{className:m("mask-fade-vertical laptop:h-[384px] desktop:h-[512px] lg-desktop:h-[640px] mt-[24px] flex h-[480px] gap-4 overflow-hidden"),children:v.map((o,p)=>e("div",{className:m("animate-marquee-scroll relative flex h-fit flex-1 flex-col gap-4",{"top-10":p===0||p===2,"hidden desktop:flex":p===1,"hidden tablet:flex":p===2}),children:o.map((g,w)=>e(T,{item:g},w))},p))})]})}var F=k(R);export{F as default};
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import"react";import{Text as n,Heading as c,Avatar as u,AvatarImage as k,AvatarFallback as C}from"../../components/index.js";import{cn as m}from"../../helpers/utils.js";import{withLayout as L}from"../../shared/Styles.js";const x=9,b=3,y=(t,a)=>Array.from({length:Math.ceil(t.length/a)},(l,r)=>t.slice(r*a,(r+1)*a)),N=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})}),M=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"13",viewBox:"0 0 14 13",fill:"none",children:e("path",{d:"M6.07501 0.418036C6.35012 -0.139398 7.145 -0.139397 7.42011 0.418037L8.9242 3.46565C9.03344 3.68701 9.24462 3.84043 9.4889 3.87593L12.8521 4.36464C13.4673 4.45403 13.7129 5.21 13.2678 5.64391L10.8341 8.01614C10.6574 8.18844 10.5767 8.43669 10.6184 8.67999L11.1929 12.0296C11.298 12.6423 10.655 13.1095 10.1047 12.8203L7.09656 11.2388C6.87807 11.1239 6.61705 11.1239 6.39855 11.2388L3.39038 12.8203C2.84016 13.1095 2.19709 12.6423 2.30217 12.0296L2.87668 8.67999C2.91841 8.43669 2.83775 8.18844 2.66098 8.01614L0.227318 5.64391C-0.21782 5.21 0.0278133 4.45403 0.642979 4.36464L4.00622 3.87593C4.2505 3.84043 4.46167 3.68701 4.57092 3.46565L6.07501 0.418036Z",fill:"#75787F"})}),T=({item:t})=>s("div",{className:"rounded-box bg-container-primary text-info-primary laptop:p-[24px] laptop:h-[192px] desktop:h-[192px] lg-desktop:h-[240px] flex h-[176px] grow flex-col justify-between p-[16px]",children:[s("div",{className:"flex justify-between",children:[s("div",{className:"flex flex-col",children:[e(n,{size:4,html:t.name,className:"desktop:block hidden"}),e(n,{size:2,html:t.name,className:"desktop:hidden block"}),s("div",{className:"mt-2 flex gap-1",children:[new Array(t.rating||5).fill(0).map((a,l)=>e(N,{},l)),new Array(5-(t.rating||5)).fill(0).map((a,l)=>e("span",{children:M()},l))]})]}),s(u,{size:"small",className:" desktop:size-[48px] size-[40px]",children:[e(k,{src:t.avatar?.url,alt:t.avatar?.alt||""}),e(C,{children:(t.name??"").slice(0,2).toUpperCase()})]})]}),e("div",{children:e(c,{as:"h6",size:2,html:`${t.comment}`,className:"line-clamp-3 text-wrap"})})]});function R({data:t,className:a,...l}){const{title:r,subtitle:h,items:i=[],theme:d="light",titleTag:f}=t,v=y(i.length<x?[...i,...i.slice(x-i.length)]:i,b).slice(0,3).map(o=>[...o,...o]);return s("section",{...l,className:m("text-info-primary flex flex-col items-center justify-center py-3",a,{"aiui-dark":d==="dark"}),children:[e(c,{as:f??"h2",size:4,html:r,className:"laptop:text-center w-full text-left"}),e(n,{size:2,html:h,className:"tablet:mt-[16px] tablet:text-[14px] laptop:text-center laptop:text-[14px] desktop:mt-[8px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] w-full text-left text-[14px]"}),e("div",{className:m("mask-fade-vertical laptop:h-[384px] desktop:h-[512px] lg-desktop:h-[640px] mt-[24px] flex h-[480px] gap-4 overflow-hidden"),children:v.map((o,p)=>e("div",{className:m("animate-marquee-scroll relative flex h-fit flex-1 flex-col gap-4",{"desktop:top-10":p===0,"top-10":p===2,"hidden desktop:flex":p===1,"hidden tablet:flex":p===2}),children:o.map((g,w)=>e(T,{item:g},w))},p))})]})}var F=L(R);export{F as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as Pe,jsx as e,jsxs as s}from"react/jsx-runtime";import{useState as y,useRef as n,useMemo as we,useEffect as D,forwardRef as ke,useImperativeHandle as Ne}from"react";import{debounce as He}from"lodash";import{cn as l}from"../../helpers/utils.js";import{withLayout as Te}from"../../shared/Styles.js";import le from"../../components/button.js";import{Heading as ze,Text as se}from"../../components/index.js";import{VideoModal as Me}from"../VideoModal/index.js";import{convertLexicalToHTML as ae}from"@payloadcms/richtext-lexical/html";import{useInView as Le}from"react-intersection-observer";import{useExposure as Re}from"../../hooks/useExposure.js";import L from"../../helpers/ScrollLoadVideo.js";import{gsap as m}from"gsap";import{SplitText as oe}from"gsap/dist/SplitText";import{ScrollTrigger as F}from"gsap/dist/ScrollTrigger";const Ie="media_player_base",Ee="video";m.registerPlugin(F,oe);const re=({defaultConverters:f})=>({...f,text:R=>{const{node:a}=R;return a.$&&a.$.color?`<span class="lexical-${a.$.color}">${a.text}</span>`:a.text}}),ne=ke(({className:f="",id:R,onBtnClick:a,data:{title:b,videoTitle:h,btnText:w,youtubeId:q,video:k,mobileVideo:U,theme:I,img:N,shape:Se,titleAnimation:H="fade-in",variant:ie,headline:Y,paragraphs:E,metrics:P,...ce},...S},pe)=>{const{sticky:i}=ce,[O,G]=y(!1),[J,de]=y(0),[ue,me]=y(0),[T,fe]=y(0),[K,_]=y(!1),d=n(null),Q=n(null),r=n(null),z=n(null),W=n(null),M=n(null),g=n(null),$=n(null),B=n(null),{ref:X,inView:c}=Le();Ne(pe,()=>r.current);const x=typeof b=="string"?b:b&&ae({data:b,converters:re}),Z=typeof h=="string"?h:h&&ae({data:h,converters:re});D(()=>{c?(d.current?.play(),G(!0)):(d.current?.pause(),G(!1))},[c]);const C=He(()=>{if(r.current){const t=r.current.getBoundingClientRect(),o=window.innerHeight,v=window.scrollY||window.pageYOffset,p=t.bottom+v,u=document.documentElement.scrollHeight-p;de(u>o?o:u)}if(r.current){const t=r.current.clientHeight,o=window.innerHeight;me(t+o)}},600);D(()=>(C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[]),D(()=>{function t(){if(!z.current||H!=="fade-in")return;const v=z.current?.clientHeight||80;M.current=new oe(z.current,{type:"words",wordsClass:"word"});const p=M.current.words;m.set(p,{opacity:0}),g.current&&m.set(g.current,{opacity:0}),$.current=F.create({trigger:r.current,start:"top center-=10%",end:`top+=${v*1.5+80}px center-=10%`,scrub:!0,onUpdate:A=>{const u=A.progress,ee=p.length,xe=1/ee,te=.5;p.forEach((ve,ye)=>{const be=ye/ee*(1-te),he=xe*(1+te);let j=(u-be)/he;j=Math.max(0,Math.min(j,1)),m.set(ve,{opacity:j})}),m.set(Q.current,{opacity:u}),g.current&&m.set(g.current,{opacity:u>=.6?1:0})}})}function o(){B.current=F.create({trigger:r.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:v=>{const p=v.progress;fe(p)}})}return c&&(t(),o()),()=>{M.current&&M.current.revert(),$.current&&$.current.kill(),B.current&&B.current.kill()}},[H,c]),Re(W,{componentType:Ee,componentName:Ie,componentTitle:x});const ge=we(()=>c&&T>0&&T<.9?3:c?2:1,[T,c]);if(ie==="text-layout")return s("div",{...S,ref:r,className:l("relative flex w-full items-center overflow-hidden","aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]","laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]",{"aiui-dark":I==="dark"},f),children:[e("div",{ref:X,className:"pointer-events-none absolute inset-0"}),s("div",{className:"absolute inset-0 z-0",children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute inset-0 bg-black/30"})]}),s("div",{className:l("relative z-10 mx-auto flex w-full max-w-[1920px] flex-col","gap-6 px-4 py-10","tablet:gap-8 tablet:px-8","laptop:flex-row laptop:gap-12 laptop:px-16","desktop:gap-16 desktop:px-20","lg-desktop:px-24"),children:[e("div",{className:"laptop:w-1/2 w-full shrink-0",children:Y&&e(ze,{as:"h2",size:5,className:"text-info-primary",children:Y})}),s("div",{className:l("laptop:w-1/2 flex w-full flex-col justify-start","tablet:gap-8 laptop:gap-10 desktop:gap-12 gap-6"),children:[E&&E.length>0&&e("div",{className:"tablet:gap-4 flex flex-col gap-3",children:E.map((t,o)=>e(se,{as:"p",size:3,className:"text-info-primary lg-desktop:text-[18px] opacity-90",children:typeof t=="string"?t:t.text},o))}),P&&P.length>0&&e("div",{className:l("tablet:grid-cols-3 grid grid-cols-2","tablet:gap-6 desktop:gap-8 gap-4"),children:P.map((t,o)=>s("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-info-primary desktop:text-[40px] lg-desktop:text-[48px] text-balance text-[32px] font-bold leading-[100%] tracking-[-0.04em]",children:t.value}),e(se,{as:"span",size:2,className:"text-info-primary opacity-80",children:t.label})]},o))})]})]})]});const V="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return s(Pe,{children:[i&&e("div",{...S,ref:r,className:l("pointer-events-none relative z-10",V,{"aiui-dark":I==="dark"},f),children:e("div",{ref:X,children:!H&&s("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[x&&!O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),Z&&O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:Z}}),w&&e(le,{variant:"link",className:l("member-equity-button-secondary text-info-primary"),onClick:()=>{_(!0),a&&a?.()},children:w})]})})}),s("div",{...i?{}:S,style:i?{marginBottom:`-${J}px`,marginTop:`-${ue}px`,zIndex:ge}:{zIndex:5},className:l("relative",f),children:[e("div",{className:"sticky top-0 ",children:s("div",{id:R,className:l("relative overflow-hidden",i?"h-screen w-full":V,{"aiui-dark":I==="dark"}),children:[H==="fade-in"&&s("div",{className:l("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",i?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[x&&e("div",{ref:z,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),w&&e(le,{ref:g,variant:"link",className:l("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{_(!0),a&&a?.()},children:w})]}),s("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-T*100}vh`},children:[e(L,{videoRef:d,poster:N?.url||"",src:k?.url,className:"tablet:block hidden size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||k?.url,className:"tablet:hidden block size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:Q,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),i&&e("div",{className:l(i&&"pointer-events-none relative box-content block",V),style:i?{height:`${J}px`}:{},ref:W})]}),K&&q&&e(Me,{visible:K,youTubeId:q,onCloseModal:()=>_(!1)})]})});ne.displayName="MediaPlayerBase";var Ke=Te(ne);export{Ke as default};
1
+ "use client";import{Fragment as Pe,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as y,useRef as n,useMemo as ke,useEffect as D,forwardRef as we,useImperativeHandle as Ne}from"react";import{debounce as He}from"lodash";import{cn as s}from"../../helpers/utils.js";import{withLayout as Te}from"../../shared/Styles.js";import se from"../../components/button.js";import{Heading as ze,Text as le}from"../../components/index.js";import{VideoModal as Me}from"../VideoModal/index.js";import{convertLexicalToHTML as oe}from"@payloadcms/richtext-lexical/html";import{useInView as Le}from"react-intersection-observer";import{useExposure as Re}from"../../hooks/useExposure.js";import L from"../../helpers/ScrollLoadVideo.js";import{gsap as m}from"gsap";import{SplitText as ae}from"gsap/dist/SplitText";import{ScrollTrigger as F}from"gsap/dist/ScrollTrigger";const Ie="media_player_base",Ee="video";m.registerPlugin(F,ae);const re=({defaultConverters:f})=>({...f,text:R=>{const{node:o}=R;return o.$&&o.$.color?`<span class="lexical-${o.$.color}">${o.text}</span>`:o.text}}),ne=we(({className:f="",id:R,onBtnClick:o,data:{title:b,videoTitle:h,btnText:k,youtubeId:q,video:w,mobileVideo:U,theme:I,img:N,shape:_e,titleAnimation:H="fade-in",variant:ie,headline:Y,paragraphs:E,metrics:P,...ce},..._},pe)=>{const{sticky:i}=ce,[O,G]=y(!1),[J,de]=y(0),[ue,me]=y(0),[T,fe]=y(0),[K,S]=y(!1),d=n(null),Q=n(null),r=n(null),z=n(null),W=n(null),M=n(null),g=n(null),$=n(null),B=n(null),{ref:X,inView:c}=Le();Ne(pe,()=>r.current);const x=typeof b=="string"?b:b&&oe({data:b,converters:re}),Z=typeof h=="string"?h:h&&oe({data:h,converters:re});D(()=>{c?(d.current?.play(),G(!0)):(d.current?.pause(),G(!1))},[c]);const C=He(()=>{if(r.current){const t=r.current.getBoundingClientRect(),a=window.innerHeight,v=window.scrollY||window.pageYOffset,p=t.bottom+v,u=document.documentElement.scrollHeight-p;de(u>a?a:u)}if(r.current){const t=r.current.clientHeight,a=window.innerHeight;me(t+a)}},600);D(()=>(C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}),[]),D(()=>{function t(){if(!z.current||H!=="fade-in")return;const v=z.current?.clientHeight||80;M.current=new ae(z.current,{type:"words",wordsClass:"word"});const p=M.current.words;m.set(p,{opacity:0}),g.current&&m.set(g.current,{opacity:0}),$.current=F.create({trigger:r.current,start:"top center-=10%",end:`top+=${v*1.5+80}px center-=10%`,scrub:!0,onUpdate:A=>{const u=A.progress,ee=p.length,xe=1/ee,te=.5;p.forEach((ve,ye)=>{const be=ye/ee*(1-te),he=xe*(1+te);let j=(u-be)/he;j=Math.max(0,Math.min(j,1)),m.set(ve,{opacity:j})}),m.set(Q.current,{opacity:u}),g.current&&m.set(g.current,{opacity:u>=.6?1:0})}})}function a(){B.current=F.create({trigger:r.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:v=>{const p=v.progress;fe(p)}})}return c&&(t(),a()),()=>{M.current&&M.current.revert(),$.current&&$.current.kill(),B.current&&B.current.kill()}},[H,c]),Re(W,{componentType:Ee,componentName:Ie,componentTitle:x});const ge=ke(()=>c&&T>0&&T<.9?3:c?2:1,[T,c]);if(ie==="text-layout")return l("div",{..._,ref:r,className:s("relative flex w-full items-center overflow-hidden","aspect-w-[390] aspect-h-[660] tablet:aspect-w-[768] tablet:aspect-h-[660]","laptop:aspect-w-[1024] laptop:aspect-h-[520] desktop:aspect-w-[1440] desktop:aspect-h-[700]","lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930]",{"aiui-dark":I==="dark"},f),children:[e("div",{ref:X,className:"pointer-events-none absolute inset-0"}),l("div",{className:"absolute inset-0 z-0",children:[e(L,{videoRef:d,poster:N?.url||"",src:w?.url,className:"tablet:block hidden size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||w?.url,className:"tablet:hidden block size-full",videoClassName:"size-full object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{className:"absolute inset-0 bg-black/30"})]}),l("div",{className:s("relative z-10 mx-auto flex w-full max-w-[1920px] flex-col","gap-6 p-4","tablet:gap-8 tablet:px-8","laptop:grid laptop:grid-cols-[837fr_960fr] laptop:gap-12 laptop:px-16","desktop:gap-16 desktop:px-20 desktop:py-8","lg-desktop:py-12"),children:[e("div",{className:"w-full",children:Y&&e(ze,{as:"h2",size:4,className:"text-info-primary",children:Y})}),l("div",{className:s("flex w-full flex-col justify-start","desktop:gap-8 lg-desktop:gap-12 gap-4"),children:[E&&E.length>0&&e("div",{className:"tablet:gap-4 flex flex-col gap-3",children:E.map((t,a)=>e(le,{as:"p",size:2,className:"text-info-primary desktop:text-[16px] lg-desktop:text-[18px] opacity-90",children:typeof t=="string"?t:t.text},a))}),P&&P.length>0&&e("div",{className:s("tablet:grid-cols-3 grid grid-cols-2","desktop:gap-8 lg-desktop:gap-12 gap-4"),children:P.map((t,a)=>l("div",{className:"flex flex-col gap-1",children:[e("span",{className:"text-info-primary desktop:text-[56px] lg-desktop:text-[64px] text-balance text-[40px] font-bold leading-[100%] tracking-[-0.04em]",children:t.value}),e(le,{as:"span",size:2,className:"text-info-primary desktop:text-[16px] lg-desktop:text-[18px] opacity-80",children:t.label})]},a))})]})]})]});const V="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return l(Pe,{children:[i&&e("div",{..._,ref:r,className:s("pointer-events-none relative z-10",V,{"aiui-dark":I==="dark"},f),children:e("div",{ref:X,children:!H&&l("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[x&&!O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),Z&&O&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:Z}}),k&&e(se,{variant:"link",className:s("member-equity-button-secondary text-info-primary"),onClick:()=>{S(!0),o&&o?.()},children:k})]})})}),l("div",{...i?{}:_,style:i?{marginBottom:`-${J}px`,marginTop:`-${ue}px`,zIndex:ge}:{zIndex:5},className:s("relative",f),children:[e("div",{className:"sticky top-0 ",children:l("div",{id:R,className:s("relative overflow-hidden",i?"h-screen w-full":V,{"aiui-dark":I==="dark"}),children:[H==="fade-in"&&l("div",{className:s("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",i?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[x&&e("div",{ref:z,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:x}}),k&&e(se,{ref:g,variant:"link",className:s("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{S(!0),o&&o?.()},children:k})]}),l("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-T*100}vh`},children:[e(L,{videoRef:d,poster:N?.url||"",src:w?.url,className:"tablet:block hidden size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(L,{videoRef:d,poster:N?.url||"",src:U?.url||w?.url,className:"tablet:hidden block size-full",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:Q,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),i&&e("div",{className:s(i&&"pointer-events-none relative box-content block",V),style:i?{height:`${J}px`}:{},ref:W})]}),K&&q&&e(Me,{visible:K,youTubeId:q,onCloseModal:()=>S(!1)})]})});ne.displayName="MediaPlayerBase";var Ke=Te(ne);export{Ke as default};
@@ -1,4 +1,4 @@
1
- "use client";import{Fragment as H,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as U,useRef as N,useEffect as q,forwardRef as P,useImperativeHandle as R}from"react";import{useMediaQuery as B}from"react-responsive";import{cn as m}from"../../helpers/utils.js";import{withLayout as O}from"../../shared/Styles.js";import{Heading as w,Text as y,Picture as S,Tabs as $,TabsList as G,TabsTrigger as K,TabsContent as Q}from"../../components/index.js";import{useExposure as M}from"../../hooks/useExposure.js";import{Swiper as Y,SwiperSlide as J}from"swiper/react";import{Autoplay as W}from"swiper/modules";import"swiper/css";const A="media",E="media_scene_switcher",k=3e3,X=({data:t,configuration:a,theme:d})=>{const p=N(null),r=a?.isActive||!1;return M(p,{componentType:A,componentName:E,componentTitle:t?.title,position:(a?.index??0)+1}),l("div",{ref:p,className:m("media-scene-switcher-item rounded-box cursor-pointer overflow-hidden transition-colors","relative text-[#6D6D6F]",r?"opacity-100":"opacity-60",{"bg-[#1D1D1F] text-white":r,"bg-[#EAEAEC] text-[#1D1D1F]":r&&d==="light"}),onClick:()=>a?.onItemClick?.(a?.index??0),children:[l("div",{className:"media-scene-switcher-item-content laptop:gap-[32px] laptop:p-[12px] desktop:gap-[48px] desktop:p-[24px] flex items-center justify-between gap-[24px]",children:[l("div",{children:[e("div",{className:"media-scene-switcher-item-title flex-1",children:e(w,{as:"h6",size:2,html:t?.title})}),t?.description&&r&&e(y,{size:2,className:"media-scene-switcher-item-description tablet:text-base desktop:text-lg mt-1 text-sm font-bold",html:t.description})]}),e("div",{className:m("media-scene-switcher-item-badge rounded-btn border-[1.6px] px-[18px] py-[7px]",d==="dark"?"border-[#B5B7BB]":"border-[#4A4C56]",{"!border-[#F5F6F7]":d==="dark"&&r}),children:e(w,{as:"h6",size:2,html:t?.tag})})]}),e("div",{className:m("media-scene-switcher-progress absolute bottom-0 left-0 h-[2px] w-full",{"media-scene-switcher-progress-active":r}),style:{transform:"translate3d(-100%, 0, 0)",background:"linear-gradient(90deg, #3ad1ff 0%, #008cd6 100%)",animation:r?`progress-bar ${k}ms ease-out`:"none"}})]})},Z=({data:t,configuration:a,theme:d})=>{const p=N(null),r=a?.isActive||!1,o=B({query:"(max-width: 768px)"});M(p,{componentType:A,componentName:E,componentTitle:t?.title,position:(a?.index??0)+1});const u=o&&t?.mobVideoUrl?.url?t.mobVideoUrl.url:t?.videoUrl?.url,i=o&&t?.mobImageUrl?.url?t.mobImageUrl.url:t?.imageUrl?.url,v=i||t?.videoUrl?.thumbnailURL||"";return l("div",{ref:p,className:m("media-scene-switcher-mobile-item rounded-box flex max-w-full flex-col overflow-hidden",{"aiui-dark":d==="dark"}),children:[e("div",{className:"media-scene-switcher-mobile-media aspect-w-[296] aspect-h-[256] relative w-full shrink-0 overflow-hidden",children:u?e("video",{src:u,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,poster:v,className:"size-full object-cover"}):i?e(S,{className:"size-full",imgClassName:"size-full object-cover",source:i,alt:t?.title||""}):null}),l("div",{className:m("media-scene-switcher-mobile-bottom bg-container-primary text-info-primary flex flex-1 items-start justify-between gap-[8px] p-[16px]"),children:[l("div",{children:[e("div",{className:"media-scene-switcher-mobile-title line-clamp-3",children:e(w,{as:"h6",size:2,html:t?.title})}),t?.description&&e(y,{size:2,className:"media-scene-switcher-item-description tablet:text-base desktop:text-lg mt-1 line-clamp-2 text-sm font-bold",html:t.description})]}),e("div",{className:m("media-scene-switcher-mobile-badge rounded-btn shrink-0 border-[1.6px] px-[12px] py-[5px]",d==="dark"?"border-[#B5B7BB]":"border-[#4A4C56]",{"!border-[#F5F6F7]":d==="dark"&&r}),children:e(w,{as:"h6",size:1,html:t?.tag})})]}),e("div",{className:m("media-scene-switcher-progress h-[2px] w-full",{"media-scene-switcher-progress-active":r}),style:{transform:"translate3d(-100%, 0, 0)",background:"linear-gradient(90deg, #3ad1ff 0%, #008cd6 100%)",animation:r?`progress-bar ${k}ms ease-out`:"none"}})]})},D=P(({sectionData:t,id:a,className:d="",tabId:p},r)=>{const{title:o,subtitle:u,items:i=[],theme:v="light",layout:f,titleIcon:h}=t,[g,x]=U(0),[n,j]=U(0),z=N(null),b=N(0),C=B({query:"(max-width: 1023px)"});R(r,()=>z.current),q(()=>{if(!(C||i.length===0))return b.current=window.setInterval(()=>{x(s=>(s+1)%i.length)},k),()=>{b.current&&window.clearInterval(b.current)}},[C,i.length]);const V=s=>{x(s),b.current&&window.clearInterval(b.current),b.current=window.setInterval(()=>{x(c=>(c+1)%i.length)},k)},I=i[g],ee=I?.videoUrl?.url,ie=I?.imageUrl?.url||I?.videoUrl?.thumbnailURL||"";return l("section",{id:a,ref:z,className:m("media-scene-switcher text-info-primary w-full",{"aiui-dark":v==="dark"},d),children:[l("div",{className:"media-scene-switcher-desktop laptop:gap-[24px] lg-desktop:gap-[40px] laptop:flex hidden w-full items-stretch gap-[20px] overflow-hidden",children:[e("div",{className:m("media-scene-switcher-preview rounded-box laptop:flex-1 relative aspect-[824/640] max-w-[824px] shrink-0 overflow-hidden",{"order-1":f==="right"}),children:i.map((s,c)=>{const L=s?.videoUrl?.url,T=s?.imageUrl?.url,_=T||s?.videoUrl?.thumbnailURL||"";return e("div",{className:m("media-scene-switcher-media rounded-box absolute inset-0 hidden size-full overflow-hidden",{"inline-block":c===g}),children:L?e("video",{src:L,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,poster:_,className:"size-full object-cover"}):T?e(S,{className:"size-full",imgClassName:"size-full object-cover",source:T,alt:s?.title||""}):null},s.id||c)})}),l("div",{className:"media-scene-switcher-sidebar laptop:flex-1 flex shrink-0 flex-col justify-between",children:[l("div",{className:"media-scene-switcher-header flex flex-col",children:[l("div",{className:"desktop:gap-2 flex items-center gap-1",children:[o&&e(w,{as:"h3",html:o,size:4,className:"media-scene-switcher-title text-info-primary tablet:!text-[40px] desktop:!text-[56px] lg-desktop:!text-[64px] text-[40px] leading-none text-[#00BEFA]"}),h&&e(S,{source:h.url,alt:h.alt||"title icon",className:"desktop:h-8 lg-desktop:h-10 h-6",imgClassName:"!w-auto h-full"})]}),u&&e(y,{as:"span",size:4,html:u,className:"media-scene-switcher-subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] relative -top-2 mt-3 text-[14px]"})]}),e("div",{className:"media-scene-switcher-list flex flex-col gap-[16px]",children:i.map((s,c)=>e(X,{data:s,configuration:{index:c,isActive:c===g,onItemClick:V},theme:v},s.id||c))})]})]}),l("div",{className:"media-scene-switcher-mobile laptop:hidden flex flex-col overflow-visible",children:[l("div",{className:"media-scene-switcher-mobile-header",children:[l("div",{className:"desktop:gap-2 flex items-center gap-1",children:[o&&e(w,{as:"h2",html:o,size:2,className:"media-scene-switcher-title tablet:!text-[40px] desktop:!text-[56px] lg-desktop:!text-[64px] text-[40px] leading-tight text-[#00BEFA]"}),h&&e(S,{source:h.url,alt:h.alt||"title icon",className:"desktop:h-8 lg-desktop:h-10 h-6",imgClassName:"!w-auto h-full"})]}),u&&e(y,{as:"span",size:4,html:u,className:"media-scene-switcher-subtitle text-[14px]"})]}),e("div",{className:"media-scene-switcher-mobile-swiper mt-[24px] overflow-visible",children:e(Y,{onSlideChange:s=>j(s.realIndex),initialSlide:0,modules:[W],loop:i.length>1,autoplay:i.length>1?{delay:k,disableOnInteraction:!1}:!1,spaceBetween:12,breakpoints:{0:{slidesPerView:1},374:{slidesPerView:1.2},768:{slidesPerView:2.3}},watchSlidesProgress:!0,className:"w-full !overflow-visible",children:i.map((s,c)=>e(J,{className:"!h-auto max-w-full",children:e(Z,{data:s,configuration:{index:c,isActive:c===n},theme:v})},s.id||c))},p)})]})]})});D.displayName="SceneSection";const F=P(({className:t="",data:a,id:d},p)=>{const r=a?.isShowTab??!1,o=a?.tabs,u=a?.tabAlign??"left",[i,v]=U(o?.[0]?.id??""),f=N(null);R(p,()=>f.current);const g=o?.find(n=>n.id===i)??a;M(f,{componentType:A,componentName:E,componentTitle:g?.title});const x=`
1
+ "use client";import{Fragment as R,jsx as e,jsxs as l}from"react/jsx-runtime";import{useState as I,useRef as w,useEffect as _,forwardRef as L,useImperativeHandle as B}from"react";import{useMediaQuery as D}from"react-responsive";import{cn as m}from"../../helpers/utils.js";import{withLayout as q}from"../../shared/Styles.js";import{Heading as k,Text as y,Picture as S,Tabs as O,TabsList as $,TabsTrigger as G,TabsContent as K}from"../../components/index.js";import{useExposure as A}from"../../hooks/useExposure.js";import{Swiper as Q,SwiperSlide as Y}from"swiper/react";import{Autoplay as J}from"swiper/modules";import"swiper/css";const E="media",M="media_scene_switcher",g=3e3,W=({data:t,configuration:r,theme:o})=>{const p=w(null),i=r?.isActive||!1;return A(p,{componentType:E,componentName:M,componentTitle:t?.title,position:(r?.index??0)+1}),l("div",{ref:p,className:m("media-scene-switcher-item rounded-box flex cursor-pointer flex-col overflow-hidden transition-colors","relative text-[#4A4C56]",i?"opacity-100":"opacity-60",{"bg-[#1E2024] text-white":i&&o==="dark","bg-[#EAEAEC] text-[#080A0F]":i&&o==="light"}),onClick:()=>r?.onItemClick?.(r?.index??0),children:[l("div",{className:"media-scene-switcher-item-content laptop:p-[12px] desktop:p-[24px] flex flex-1 items-center justify-between gap-[24px]",children:[l("div",{className:"flex min-w-0 flex-1 flex-col gap-[4px]",children:[e(k,{as:"h6",size:2,className:"text-inherit",html:t?.title}),i&&t?.description&&e(y,{size:2,className:"media-scene-switcher-item-description laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 font-bold leading-[1.4]",html:t.description})]}),e("div",{className:m("media-scene-switcher-item-badge border-[1.6px] text-center","laptop:min-w-[36px] desktop:min-w-[42px] laptop:rounded-[16px] desktop:rounded-[14px] laptop:px-[6px] desktop:px-[8px] laptop:pt-[3px] laptop:pb-[4px] desktop:pt-[5px] desktop:pb-[4px]","laptop:text-[14px] desktop:text-[16px] font-bold leading-[1.2]",o==="dark"?"border-[#B5B7BB]":"border-[#4A4C56]",{"!border-[#F5F6F7]":o==="dark"&&i}),children:t?.tag})]}),e("div",{className:m("media-scene-switcher-progress absolute bottom-0 left-0 h-[2px] w-full",{"media-scene-switcher-progress-active":i}),style:{transform:"translate3d(-100%, 0, 0)",background:"#00BEFA",animation:i?`progress-bar ${g}ms ease-out`:"none"}})]})},X=({data:t,configuration:r,theme:o})=>{const p=w(null),i=r?.isActive||!1,n=D({query:"(max-width: 768px)"});A(p,{componentType:E,componentName:M,componentTitle:t?.title,position:(r?.index??0)+1});const x=n&&t?.mobVideoUrl?.url?t.mobVideoUrl.url:t?.videoUrl?.url,a=n&&t?.mobImageUrl?.url?t.mobImageUrl.url:t?.imageUrl?.url,f=a||t?.videoUrl?.thumbnailURL||"";return l("div",{ref:p,className:m("media-scene-switcher-mobile-item rounded-box flex h-full max-w-full flex-col overflow-hidden",{"aiui-dark":o==="dark","bg-[#EAEAEC]":i&&o==="light","bg-[#1E2024]":i&&o==="dark"}),children:[e("div",{className:"media-scene-switcher-mobile-media relative h-[258px] w-full shrink-0 overflow-hidden",children:x?e("video",{src:x,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,poster:f,className:"size-full object-cover"}):a?e(S,{className:"size-full",imgClassName:"size-full object-cover",source:a,alt:t?.title||""}):null}),l("div",{className:m("media-scene-switcher-mobile-bottom text-info-primary flex flex-1 items-start justify-between gap-[8px] p-[16px]",!i&&"bg-container-primary"),children:[l("div",{children:[e("div",{className:"media-scene-switcher-mobile-title line-clamp-3",children:e(k,{as:"h6",size:2,className:"text-inherit",html:t?.title})}),t?.description&&e(y,{size:2,className:"media-scene-switcher-item-description mt-[4px] line-clamp-2 text-[14px] font-bold leading-[1.4]",html:t.description})]}),e("div",{className:m("media-scene-switcher-mobile-badge min-w-[36px] shrink-0 border-[1.6px] text-center","rounded-[16px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",o==="dark"?"border-[#B5B7BB]":"border-[#4A4C56]",{"!border-[#F5F6F7]":o==="dark"&&i}),children:t?.tag})]}),e("div",{className:m("media-scene-switcher-progress h-[2px] w-full",{"media-scene-switcher-progress-active":i}),style:{transform:"translate3d(-100%, 0, 0)",background:"#00BEFA",animation:i?`progress-bar ${g}ms ease-out`:"none"}})]})},C=L(({sectionData:t,id:r,className:o="",tabId:p},i)=>{const{title:n,subtitle:x,items:a=[],theme:f="light",layout:v,titleIcon:u}=t,[N,h]=I(0),[c,H]=I(0),U=w(null),b=w(0),z=D({query:"(max-width: 1023px)"});B(i,()=>U.current),_(()=>{if(!(z||a.length===0))return b.current=window.setInterval(()=>{h(s=>(s+1)%a.length)},g),()=>{b.current&&window.clearInterval(b.current)}},[z,a.length]);const j=s=>{h(s),b.current&&window.clearInterval(b.current),b.current=window.setInterval(()=>{h(d=>(d+1)%a.length)},g)};return l("section",{id:r,ref:U,className:m("media-scene-switcher text-info-primary w-full",{"aiui-dark":f==="dark"},o),children:[l("div",{className:"media-scene-switcher-desktop laptop:gap-[40px] laptop:flex hidden w-full items-stretch overflow-hidden",children:[e("div",{className:m("media-scene-switcher-preview rounded-box laptop:h-[560px] relative min-w-0 shrink-0 overflow-hidden","laptop:w-[824px] laptop:flex-none",{"order-1":v==="right"}),children:a.map((s,d)=>{const P=s?.videoUrl?.url,T=s?.imageUrl?.url,V=T||s?.videoUrl?.thumbnailURL||"";return e("div",{className:m("media-scene-switcher-media rounded-box absolute inset-0 hidden size-full overflow-hidden",{"inline-block":d===N}),children:P?e("video",{src:P,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,poster:V,className:"size-full object-cover"}):T?e(S,{className:"size-full",imgClassName:"size-full object-cover",source:T,alt:s?.title||""}):null},s.id||d)})}),l("div",{className:"media-scene-switcher-sidebar laptop:flex-1 flex min-w-0 shrink-0 flex-col justify-between",children:[e("div",{className:"media-scene-switcher-header flex flex-col gap-[16px]",children:l("div",{className:"flex flex-col gap-[4px]",children:[l("div",{className:"flex items-center gap-[8px]",children:[u&&e(S,{source:u.url,alt:u.alt||"title icon",className:"laptop:size-[40px] h-6 shrink-0",imgClassName:"!size-full !object-contain"}),n&&e(k,{as:"h3",html:n,size:4,className:"media-scene-switcher-title text-info-primary text-[#00BEFA]"})]}),x&&e(y,{as:"span",html:x,className:"media-scene-switcher-subtitle laptop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#080A0F]"})]})}),e("div",{className:"media-scene-switcher-list laptop:gap-[24px] flex flex-col",children:a.map((s,d)=>e(W,{data:s,configuration:{index:d,isActive:d===N,onItemClick:j},theme:f},s.id||d))})]})]}),l("div",{className:"media-scene-switcher-mobile laptop:hidden flex flex-col overflow-visible",children:[e("div",{className:"media-scene-switcher-mobile-header flex flex-col gap-[8px]",children:l("div",{className:"flex flex-col gap-[4px]",children:[l("div",{className:"flex items-center gap-[4px]",children:[u&&e(S,{source:u.url,alt:u.alt||"title icon",className:"size-[24px] shrink-0",imgClassName:"!size-full !object-contain"}),n&&e(k,{as:"h2",html:n,size:4,className:"media-scene-switcher-title text-[#00BEFA]"})]}),x&&e(y,{as:"span",html:x,className:"media-scene-switcher-subtitle text-[14px] font-bold leading-[1.4] text-[#080A0F]"})]})}),e("div",{className:"media-scene-switcher-mobile-swiper mt-[24px] overflow-visible",children:e(Q,{onSlideChange:s=>H(s.realIndex),initialSlide:0,modules:[J],loop:a.length>1,autoplay:a.length>1?{delay:g,disableOnInteraction:!1}:!1,spaceBetween:12,breakpoints:{0:{slidesPerView:1},374:{slidesPerView:1.2},768:{slidesPerView:2.3}},watchSlidesProgress:!0,className:"w-full !overflow-visible",children:a.map((s,d)=>e(Y,{className:"!h-auto max-w-full",children:e(X,{data:s,configuration:{index:d,isActive:d===c},theme:f})},s.id||d))},p)})]})]})});C.displayName="SceneSection";const F=L(({className:t="",data:r,id:o},p)=>{const i=r?.isShowTab??!1,n=r?.tabs,x=r?.tabAlign??"left",[a,f]=I(n?.[0]?.id??""),v=w(null);B(p,()=>v.current);const N=n?.find(c=>c.id===a)??r;A(v,{componentType:E,componentName:M,componentTitle:N?.title});const h=`
2
2
  @keyframes progress-bar {
3
3
  from {
4
4
  transform: translate3d(-100%, 0, 0);
@@ -7,4 +7,4 @@
7
7
  transform: translate3d(0, 0, 0);
8
8
  }
9
9
  }
10
- `;return!r||!o||o.length===0?l(H,{children:[e("style",{children:x}),e(D,{ref:f,sectionData:a,id:d,className:t})]}):l(H,{children:[e("style",{children:x}),e("div",{ref:f,children:l($,{value:i,onValueChange:v,align:u,children:[e("div",{className:"media-scene-switcher-tabs mb-6",children:e(G,{children:o.map(n=>e(K,{value:n.id,children:n.label},n.id))})}),o.map(n=>e(Q,{value:n.id,children:e(D,{sectionData:n,className:t,tabId:n.id})},n.id))]})})]})});F.displayName="MediaSceneSwitcher";var pe=O(F,{style:"overflow: hidden;"});export{pe as default};
10
+ `;return!i||!n||n.length===0?l(R,{children:[e("style",{children:h}),e(C,{ref:v,sectionData:r,id:o,className:t})]}):l(R,{children:[e("style",{children:h}),e("div",{ref:v,children:l(O,{value:a,onValueChange:f,align:x,children:[e("div",{className:"media-scene-switcher-tabs mb-6",children:e($,{children:n.map(c=>e(G,{value:c.id,children:c.label},c.id))})}),n.map(c=>e(K,{value:c.id,children:e(C,{sectionData:c,className:t,tabId:c.id})},c.id))]})})]})});F.displayName="MediaSceneSwitcher";var ne=q(F,{style:"overflow: hidden;"});export{ne as default};
@@ -16,7 +16,7 @@ export type TitleType = 'selling-point' | 'primary' | 'secondary';
16
16
  /** 文本对齐方式 */
17
17
  export type TextAlign = 'left' | 'center';
18
18
  /** 图片宽度比例(2张图片时) */
19
- export type TwoImageRatio = '2:3' | '1:1';
19
+ export type TwoImageRatio = '2:3' | '4:6' | '1:1';
20
20
  /** 图片宽度比例(3张图片时) */
21
21
  export type ThreeImageRatio = '1:1:1';
22
22
  export interface ProductCompareProps extends React.HTMLAttributes<HTMLElement> {
@@ -1 +1 @@
1
- import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useEffect as N,useRef as P,useState as R}from"react";import{Heading as f,Text as z}from"../../components/index.js";import{cn as l}from"../../helpers/index.js";import{withLayout as k}from"../../shared/Styles.js";function L({children:e,offset:r=800}){const[o,i]=R(!1),p=P(null);return N(()=>{const s=new IntersectionObserver(([d])=>d.isIntersecting&&i(!0),{rootMargin:`${r}px`});return p.current&&s.observe(p.current),()=>s.disconnect()},[r]),t("div",{ref:p,className:"size-full",children:o&&e})}function b({media:e,poster:r,className:o}){return e?.url?e.mimeType?.startsWith("video/")?t("video",{src:e.url,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,poster:r?.url||"",preload:"metadata",disablePictureInPicture:!0,disableRemotePlayback:!0,className:o,width:e.width,height:e.height}):t("img",{src:e.url,alt:e.alt||"",className:o,width:e.width,height:e.height}):null}function C(e,r,o){return r===2?o==="1:1"?"laptop:flex-[1]":e===0?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]"}function A({data:e,className:r,...o}){const{title:i,titleType:p="primary",titleIcon:s,subtitle:d,subtitleImage:n,textAlign:h="left",products:c=[],twoImageRatio:y="2:3",threeImageRatio:E="1:1:1",theme:T="light"}=e,u=h==="center"?"text-center":"text-left laptop:text-left",g=()=>p==="secondary"?3:4,v=()=>i?p==="selling-point"&&s?x("div",{className:l("product-compare-title-wrapper flex items-center gap-[8px]",u==="text-center"?"justify-center":""),children:[t("img",{src:s.url,alt:s.alt||"",className:"product-compare-title-icon laptop:size-[32px] size-[24px]"}),t(f,{as:"h2",size:g(),html:i,className:"product-compare-title",style:{color:"#00BEFA"}})]}):t(f,{as:"h2",size:g(),html:i,className:l("product-compare-title",u)}):null;return x("section",{...o,className:l("product-compare text-info-primary",r,{"aiui-dark":T==="dark"}),children:[v(),d&&t(z,{as:"p",size:2,html:d,className:l("product-compare-subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",u)}),n&&t("div",{className:l("product-compare-subtitle-image laptop:mt-[24px] mt-[16px]",u==="text-center"?"flex justify-center":""),children:t("img",{src:n.url,alt:n.alt||"",className:"max-w-full",width:n.width,height:n.height})}),t("div",{className:"product-compare-container tablet:flex-row tablet:flex-nowrap laptop:mt-[32px] mt-[24px] flex w-full flex-col items-stretch gap-[16px]",children:c.map((a,m)=>{const w=m===c.length-1,I=C(m,c.length,y),M=w?"bg-brand-0":"bg-[rgba(0,0,0,0.2)]";return x("div",{className:l("product-compare-item rounded-box relative shrink overflow-hidden",I,{"order-2 tablet:order-1":m===0&&c.length===2,"order-1 tablet:order-2":m===1&&c.length===2}),children:[a.text&&t("div",{className:l("product-compare-label rounded-btn laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px] text-badge-foreground absolute left-[16px] top-[16px] z-10 px-[20px] pb-[10px] pt-[11px] font-bold",M),children:t(f,{as:"h6",className:"font-bold",size:1,children:a.text})}),x(L,{offset:1500,children:[t(b,{media:a.media,poster:a.poster,className:"product-compare-media laptop:block hidden size-full object-cover"}),t(b,{media:a.mobMedia?a.mobMedia:a.media,poster:a.mobPoster?a.mobPoster:a.poster,className:"product-compare-media-mobile laptop:hidden block w-full"})]})]},m)})})]})}var S=k(A);export{S as default};
1
+ import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useEffect as P,useRef as z,useState as R}from"react";import{Heading as f,Text as k}from"../../components/index.js";import{cn as l}from"../../helpers/index.js";import{withLayout as C}from"../../shared/Styles.js";import{useContainerGrid as L}from"../../shared/ContainerGridContext.js";function A({children:e,offset:o=800}){const[a,i]=R(!1),p=z(null);return P(()=>{const s=new IntersectionObserver(([d])=>d.isIntersecting&&i(!0),{rootMargin:`${o}px`});return p.current&&s.observe(p.current),()=>s.disconnect()},[o]),t("div",{ref:p,className:"size-full",children:a&&e})}function h({media:e,poster:o,className:a}){return e?.url?e.mimeType?.startsWith("video/")?t("video",{src:e.url,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,poster:o?.url||"",preload:"metadata",disablePictureInPicture:!0,disableRemotePlayback:!0,className:a,width:e.width,height:e.height}):t("img",{src:e.url,alt:e.alt||"",className:a,width:e.width,height:e.height}):null}function H(e,o,a){return o===2?a==="1:1"?"laptop:flex-[1]":a==="4:6"?e===0?"laptop:flex-[4]":"laptop:flex-[6]":e===0?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]"}function E({data:e,className:o,...a}){const{title:i,titleType:p="primary",titleIcon:s,subtitle:d,subtitleImage:n,textAlign:b="left",products:c=[],twoImageRatio:y="2:3",threeImageRatio:j="1:1:1",theme:v="light"}=e,T=L()?.gridColumns===12,u=b==="center"?"text-center":"text-left laptop:text-left",g=()=>p==="secondary"?3:4,I=()=>i?p==="selling-point"&&s?x("div",{className:l("product-compare-title-wrapper flex items-center gap-[8px]",u==="text-center"?"justify-center":""),children:[t("img",{src:s.url,alt:s.alt||"",className:"product-compare-title-icon laptop:size-[32px] size-[24px]"}),t(f,{as:"h2",size:g(),html:i,className:"product-compare-title",style:{color:"#00BEFA"}})]}):t(f,{as:"h2",size:g(),html:i,className:l("product-compare-title",u)}):null;return x("section",{...a,className:l("product-compare text-info-primary",o,{"aiui-dark":v==="dark"}),children:[I(),d&&t(k,{as:"p",size:2,html:d,className:l("product-compare-subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",u)}),n&&t("div",{className:l("product-compare-subtitle-image laptop:mt-[24px] mt-[16px]",u==="text-center"?"flex justify-center":""),children:t("img",{src:n.url,alt:n.alt||"",className:"max-w-full",width:n.width,height:n.height})}),t("div",{className:"product-compare-container tablet:flex-row tablet:flex-nowrap laptop:mt-[32px] mt-[24px] flex w-full flex-col items-stretch gap-[16px]",children:c.map((r,m)=>{const M=m===c.length-1,w=H(m,c.length,y),N=M?"bg-brand-0":"bg-[rgba(0,0,0,0.2)]";return x("div",{className:l("product-compare-item rounded-box relative shrink overflow-hidden",T&&"laptop:h-[560px] h-[240px]",w,{"order-2 tablet:order-1":m===0&&c.length===2,"order-1 tablet:order-2":m===1&&c.length===2}),children:[r.text&&t("div",{className:l("product-compare-label rounded-btn laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px] text-badge-foreground absolute left-[16px] top-[16px] z-10 px-[20px] pb-[10px] pt-[11px] font-bold",N),children:t(f,{as:"h6",className:"font-bold",size:1,children:r.text})}),x(A,{offset:1500,children:[t(h,{media:r.media,poster:r.poster,className:"product-compare-media laptop:block hidden size-full object-cover"}),t(h,{media:r.mobMedia?r.mobMedia:r.media,poster:r.mobPoster?r.mobPoster:r.poster,className:"product-compare-media-mobile laptop:hidden block size-full object-cover"})]})]},m)})})]})}var O=C(E);export{O as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import _,{useRef as k,useImperativeHandle as N}from"react";import{Heading as c,Button as g,Picture as v,Text as H}from"../../components/index.js";import{cn as P}from"../../helpers/utils.js";import{withLayout as T}from"../../shared/Styles.js";import{useExposure as w}from"../../hooks/useExposure.js";import{useTracking as y}from"../../hooks/useTracking.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as L}from"../../shared/track.js";const p="image",i="product_hero",m=_.forwardRef(({data:n,className:u},d)=>{const{title:o,subtitle:e,ctaText:r,poster:f,mobPoster:b,ctaLink:a,theme:h="light"}=n,s=k(null),{buildRef:x}=y();return w(s,{componentType:p,componentName:i,componentTitle:o,componentDescription:e}),N(d,()=>s.current),l("section",{ref:s,"data-ui-component-id":"ProductHero",className:P("product-hero text-info-primary tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px] flex w-full flex-col items-center justify-between gap-[32px]",{"aiui-dark":h==="dark"},u),children:[l("div",{className:"product-hero__content tablet:basis-[42%] laptop:basis-[36%] flex w-full flex-col items-start gap-[24px]",children:[l("div",{className:"product-hero__text",children:[t(c,{as:"h3",size:4,html:o,className:"product-hero__title"}),t(c,{as:"h4",size:2,html:e,className:"product-hero__subtitle product-hero__subtitle--desktop laptop:mt-[12px] laptop:block desktop:mt-[16px] mt-[4px] hidden"}),t(H,{as:"p",size:2,html:e,className:"product-hero__subtitle product-hero__subtitle--mobile laptop:mt-[12px] laptop:hidden desktop:mt-[16px] mt-[4px] block"})]}),r&&t("a",{href:a?R(a,x(p,i)):void 0,className:"product-hero__cta-link",...L({interactive:!!a,componentType:p,componentName:i,title:o,description:e,buttonName:r}),children:t(g,{className:"product-hero__cta-button w-fit",children:r})})]}),t(v,{className:"product-hero__image tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%] rounded-box aspect-[358/360] shrink",source:`${f?.url}, ${b?.url} 768`,imgClassName:"h-full object-cover"})]})});m.displayName="ProductHero";var I=T(m);export{I as default};
1
+ "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import N,{useRef as v,useImperativeHandle as H}from"react";import{Heading as u,Button as P,Picture as T,Text as w}from"../../components/index.js";import{cn as a}from"../../helpers/utils.js";import{withLayout as y}from"../../shared/Styles.js";import{useContainerGrid as R}from"../../shared/ContainerGridContext.js";import{useExposure as L}from"../../hooks/useExposure.js";import{useTracking as C}from"../../hooks/useTracking.js";import{trackUrlRef as D}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as E}from"../../shared/track.js";const i="image",l="product_hero",d=N.forwardRef(({data:m,className:f},h)=>{const{title:o,subtitle:e,ctaText:r,poster:x,mobPoster:b,ctaLink:p,theme:_="light"}=m,s=v(null),{buildRef:g}=C(),k=R(),n=m.gridVariant??(k?.gridColumns===12?"12":"10");return L(s,{componentType:i,componentName:l,componentTitle:o,componentDescription:e}),H(h,()=>s.current),c("section",{ref:s,"data-ui-component-id":"ProductHero",className:a("product-hero text-info-primary laptop:flex-row desktop:gap-[48px] lg-desktop:gap-[64px] flex w-full flex-col items-center justify-between gap-[32px]",{"aiui-dark":_==="dark"},f),children:[c("div",{className:a("product-hero__content lg-desktop:gap-[32px] flex w-full flex-col items-start gap-[24px]",n==="12"?"laptop:basis-5/12":"laptop:basis-2/5"),children:[c("div",{className:"product-hero__text",children:[t(u,{as:"h3",size:4,html:o,className:"product-hero__title"}),t(u,{as:"h4",size:2,html:e,className:"product-hero__subtitle product-hero__subtitle--desktop desktop:mt-[8px] laptop:block mt-[4px] hidden"}),t(w,{as:"p",size:2,html:e,className:"product-hero__subtitle product-hero__subtitle--mobile desktop:mt-[8px] laptop:hidden mt-[4px] block"})]}),r&&t("a",{href:p?D(p,g(i,l)):void 0,className:"product-hero__cta-link",...E({interactive:!!p,componentType:i,componentName:l,title:o,description:e,buttonName:r}),children:t(P,{className:"product-hero__cta-button w-fit",children:r})})]}),t(T,{className:a("product-hero__image rounded-box laptop:h-auto laptop:aspect-[824/640] h-[360px] w-full shrink",n==="12"?"laptop:basis-7/12 lg-desktop:aspect-[964/640]":"laptop:basis-3/5 lg-desktop:aspect-[824/560]"),source:`${x?.url}, ${b?.url} 768`,imgClassName:"h-full object-cover"})]})});d.displayName="ProductHero";var q=y(d);export{q as default};
@@ -17,6 +17,8 @@ export interface ProductHeroProps {
17
17
  modelSrc?: string;
18
18
  /** 主题,默认 light */
19
19
  theme?: Theme;
20
+ /** 栅格变体:'10'(默认)内容/图片=40%/60%;'12' 内容/图片=5/12 / 7/12。决定内部比例与图片尺寸。 */
21
+ gridVariant?: '10' | '12';
20
22
  };
21
23
  /** 自定义类名 */
22
24
  className?: string;
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import{useState as _,useEffect as y,useCallback as q,forwardRef as U,useImperativeHandle as W,useRef as h}from"react";import{cn as $}from"../../helpers/utils.js";import{withLayout as J}from"../../shared/Styles.js";import{Button as I,Link as K,Text as A}from"../../components/index.js";import{useExposure as Q}from"../../hooks/useExposure.js";import{useTracking as X}from"../../hooks/useTracking.js";import{trackUrlRef as Z}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as T}from"../../shared/track.js";import*as C from"@radix-ui/react-popover";const N="navigation",E="product_nav",P=d=>d.anchorId??d.id??"",ee=d=>o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d,children:o("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),L=U(({className:d="",data:B,id:z,onAnchorClick:D,scrollOffsetExtra:R=0},j)=>{const{tabLinks:p=[],anchorList:s=[],textLink:i,buyBtn:a,theme:Y="light"}=B||{},{buildRef:F}=X(),u=(e,t,n=1)=>({href:Z(e,F(N,E)),"data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(t)}`,"data-headless-nav-position":`${T(t)}#${n}`}),[G,g]=_(""),f=h(null),w=h(!1),v=h(""),x=h(null),S=h(new Map);W(j,()=>f.current),Q(f,{componentType:N,componentName:E,componentTitle:[...p.map(e=>e.label),...s.map(e=>e.label)].join(" | "),componentDescription:a?.text??i?.text??""});const b=q(()=>{if(s.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;s.forEach(n=>{const r=P(n),l=document.getElementById(r);if(l){const k=l.getBoundingClientRect();t.set(r,k.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[s]);y(()=>{if(s.length===0)return;const e=setTimeout(b,100);return()=>clearTimeout(e)},[s,b]),y(()=>{if(s.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(b,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[s,b]),y(()=>{if(s.length===0)return;const e=()=>{if(w.current){x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{w.current=!1,v.current&&(g(v.current),v.current="")},100);return}const n=f.current?.offsetHeight||0,r=window.scrollY+n+R+10;let l="";const k=S.current;for(let m=s.length-1;m>=0;m--){const V=s[m],M=P(V),H=k.get(M);if(H!==void 0&&r>=H){l=M;break}}if(!l&&s.length>0){const m=k.get(P(s[0]));m!==void 0&&r<m&&(l="")}g(l)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),x.current&&clearTimeout(x.current)}},[s,R]),y(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(n=>{const r=n;t.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{t.forEach(({element:n,originalPosition:r})=>{n.style.position=r==="static"?"":r})}},[]);const O=(e,t)=>{e.preventDefault();const n=S.current.get(t);if(n===void 0){console.warn(`Cached position for "${t}" not found`);return}g(t),v.current=t,w.current=!0;const r=f.current?.offsetHeight||0,l=n-r-R;window.scrollTo({top:l,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return c("div",{id:z,ref:f,className:$("product-nav text-info-primary bg-container-primary px-grid !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden py-0",{"aiui-dark":Y==="dark"},d),children:[c("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[c("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[c("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[p.map((e,t)=>c("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:$("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":t!==0,"hidden desktop:block":t===1}),children:o("span",{children:e.label})}),t!==p.length-1&&o("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||t)),p.length>1&&c(C.Root,{children:[o(C.Trigger,{asChild:!0,children:o("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:o(ee,{className:"text-[#1D1D1F]"})})}),o(C.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:p.slice(1).map(e=>o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:o("span",{children:e.label})},e.link))})]})]}),c("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[i?.link&&o("a",{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]}),o("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.map((e,t)=>{const n=P(e);return c("a",{href:`#${n}`,className:"product-nav-anchor-link","data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(e.label)}`,"data-headless-nav-position":`${T(e.label)}#${t+1}`,onClick:r=>{D?(r.preventDefault(),g(n),v.current=n,w.current=!0,D(e,t)):O(r,n)},children:[o(A,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),o("div",{className:$("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":G===n})})]},n)})})]}),c("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[i?.link&&o(K,{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link no-underline",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]})});L.displayName="ProductNav";var ce=J(L);export{ce as default};
1
+ "use client";import{jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as ae,useEffect as B,useCallback as se,forwardRef as ie,useImperativeHandle as le,useRef as w}from"react";import{cn as I}from"../../helpers/utils.js";import{withLayout as ce}from"../../shared/Styles.js";import{Button as K,Text as D}from"../../components/index.js";import{useExposure as de}from"../../hooks/useExposure.js";import{useBoaButton as pe}from"../../hooks/useBoaButton.js";import{useTracking as ue}from"../../hooks/useTracking.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as P}from"../../shared/track.js";import*as j from"@radix-ui/react-popover";const v="navigation",p="product_nav",R=m=>m.anchorId??m.id??"",me=m=>n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m,children:n("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Q=ie(({className:m="",data:X,id:Z,onAnchorClick:Y,scrollOffsetExtra:C=0},ee)=>{const{tabLinks:u=[],anchorList:i=[],textLink:a,buyBtn:s,theme:te="light"}=X||{},{buildRef:E}=ue(),f=(e,t,o=1)=>({href:_(e,E(v,p)),"data-headless-type-name":`${v}#${p}`,"data-headless-title-desc-button":`##${P(t)}`,"data-headless-nav-position":`${P(t)}#${o}`}),[ne,y]=ae(""),k=w(null),T=w(!1),g=w(""),b=w(null),S=w(new Map);le(ee,()=>k.current);const{resolveLink:G,trackAd:O,hasAdTrack:N}=pe(),l=G(a?.link,a),h=G(s?.link,s),L=l.isAmazon?l.href:_(l.href,E(v,p)),$=h.isAmazon?h.href:_(h.href,E(v,p)),H=a?.target??(l.isAmazon?"_blank":"_self"),M=s?.target??(h.isAmazon?"_blank":void 0),V=M==="_blank"?"noopener noreferrer":void 0,q=l.isAmazon&&H==="_blank"?"noopener noreferrer":void 0,F=()=>O(a,{componentName:p,buttonPosition:"text_link",buttonText:a?.text,href:L}),U=()=>O(s,{componentName:p,buttonPosition:"buy",buttonText:s?.text,href:$});de(k,{componentType:v,componentName:p,componentTitle:[...u.map(e=>e.label),...i.map(e=>e.label)].join(" | "),componentDescription:s?.text??a?.text??""});const z=se(()=>{if(i.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;i.forEach(o=>{const r=R(o),c=document.getElementById(r);if(c){const A=c.getBoundingClientRect();t.set(r,A.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[i]);B(()=>{if(i.length===0)return;const e=setTimeout(z,100);return()=>clearTimeout(e)},[i,z]),B(()=>{if(i.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(z,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[i,z]),B(()=>{if(i.length===0)return;const e=()=>{if(T.current){b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{T.current=!1,g.current&&(y(g.current),g.current="")},100);return}const o=k.current?.offsetHeight||0,r=window.scrollY+o+C+10;let c="";const A=S.current;for(let x=i.length-1;x>=0;x--){const re=i[x],W=R(re),J=A.get(W);if(J!==void 0&&r>=J){c=W;break}}if(!c&&i.length>0){const x=A.get(R(i[0]));x!==void 0&&r<x&&(c="")}y(c)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),b.current&&clearTimeout(b.current)}},[i,C]),B(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(o=>{const r=o;t.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{t.forEach(({element:o,originalPosition:r})=>{o.style.position=r==="static"?"":r})}},[]);const oe=(e,t)=>{e.preventDefault();const o=S.current.get(t);if(o===void 0){console.warn(`Cached position for "${t}" not found`);return}y(t),g.current=t,T.current=!0;const r=k.current?.offsetHeight||0,c=o-r-C;window.scrollTo({top:c,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return d("div",{id:Z,ref:k,className:I("product-nav text-info-primary bg-info-white px-grid !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden py-0",{"aiui-dark":te==="dark"},m),children:[d("div",{className:"product-nav-main desktop:flex-row desktop:gap-[32px] lg-desktop:gap-[48px] flex w-full flex-col justify-start",children:[d("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] py-[6px]",children:[d("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[u.map((e,t)=>d("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[n("a",{...f(e.link,e.label,u.indexOf(e)+1),className:I("product-nav-tab-link hover:text-brand-color desktop:text-[16px] lg-desktop:text-[18px] text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-info-tertiary":t!==0,"hidden desktop:block":t===1}),children:n("span",{children:e.label})}),t!==u.length-1&&n("div",{className:"product-nav-tab-divider desktop:inline-block bg-lines hidden h-[14px] w-px"})]},e.link||t)),u.length>1&&d(j.Root,{children:[n(j.Trigger,{asChild:!0,children:n("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:n(me,{className:"text-info-primary"})})}),n(j.Content,{className:"product-nav-dropdown-content border-lines bg-info-white rounded-[6px] border p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:u.slice(1).map(e=>n("a",{...f(e.link,e.label,u.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:n("span",{children:e.label})},e.link))})]})]}),d("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[a?.link&&n("a",{...f(a.link,a.text),href:L,target:H,rel:q,onClick:F,"data-headless-ad-track":N(a)?"true":void 0,"data-headless-amazon":l.isAmazon?"true":void 0,"data-headless-amazon-style":l.isAmazon?"link":void 0,className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:n(D,{size:2,className:"text-nowrap",children:a.text})}),s?.link&&n(K,{as:"a",...f(s.link,s.text),href:$,target:M,rel:V,onClick:U,"data-headless-ad-track":N(s)?"true":void 0,"data-headless-amazon":h.isAmazon?"true":void 0,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]}),n("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[6px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.map((e,t)=>{const o=R(e);return d("a",{href:`#${o}`,className:"product-nav-anchor-link","data-headless-type-name":`${v}#${p}`,"data-headless-title-desc-button":`##${P(e.label)}`,"data-headless-nav-position":`${P(e.label)}#${t+1}`,onClick:r=>{Y?(r.preventDefault(),y(o),g.current=o,T.current=!0,Y(e,t)):oe(r,o)},children:[n(D,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),n("div",{className:I("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":ne===o})})]},o)})})]}),d("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[a?.link&&n("a",{...f(a.link,a.text),href:L,target:H,rel:q,onClick:F,"data-headless-ad-track":N(a)?"true":void 0,"data-headless-amazon":l.isAmazon?"true":void 0,"data-headless-amazon-style":l.isAmazon?"link":void 0,className:"product-nav-text-link hover:text-brand-color text-info-primary cursor-pointer",children:n(D,{size:2,className:"text-nowrap",children:a.text})}),s?.link&&n(K,{as:"a",...f(s.link,s.text),href:$,target:M,rel:V,onClick:U,"data-headless-ad-track":N(s)?"true":void 0,"data-headless-amazon":h.isAmazon?"true":void 0,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]})});Q.displayName="ProductNav";var Te=ce(Q);export{Te as default};
@@ -1,4 +1,5 @@
1
1
  import type { ComponentCommonProps, Theme } from '../../types/props.js';
2
+ import type { BoaButtonFields } from '../../hooks/useBoaButton.js';
2
3
  export interface TabLink {
3
4
  link: string;
4
5
  label: string;
@@ -9,11 +10,13 @@ export interface AnchorItem {
9
10
  anchorId?: string;
10
11
  label: string;
11
12
  }
12
- export interface BuyButton {
13
+ export interface BuyButton extends BoaButtonFields {
13
14
  link: string;
14
15
  text: string;
16
+ /** 打开方式,亚马逊链接默认新窗口 */
17
+ target?: '_self' | '_blank';
15
18
  }
16
- export interface TextLink {
19
+ export interface TextLink extends BoaButtonFields {
17
20
  /** 链接地址 */
18
21
  link: string;
19
22
  /** 链接文字 */
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { Media as MediaType, Theme } from '../../types/props.js';
3
3
  import type { ButtonProps } from '../../components/button.js';
4
+ import { type BoaButtonFields } from '../../hooks/useBoaButton.js';
4
5
  export type SecondaryBannerSemanticName = 'root' | 'title' | 'superTitle' | 'subtitle' | 'content' | 'buttonGroup' | 'primaryButton' | 'secondaryButton';
5
6
  /**
6
7
  * Accessibility label overrides for the SecondaryBanner carousel controls.
@@ -80,12 +81,12 @@ export interface SecondaryBannerSlideData {
80
81
  text: string;
81
82
  link?: string;
82
83
  onClick?: () => void;
83
- } & Omit<ButtonProps, 'children'>;
84
+ } & BoaButtonFields & Omit<ButtonProps, 'children'>;
84
85
  secondaryButton?: {
85
86
  text: string;
86
87
  link?: string;
87
88
  onClick?: () => void;
88
- } & Omit<ButtonProps, 'children'>;
89
+ } & BoaButtonFields & Omit<ButtonProps, 'children'>;
89
90
  iconArray?: Array<{
90
91
  pcImage: MediaType;
91
92
  }>;
@@ -157,13 +158,13 @@ export interface SecondaryBannerData {
157
158
  text: string;
158
159
  link?: string;
159
160
  onClick?: () => void;
160
- } & Omit<ButtonProps, 'children'>;
161
+ } & BoaButtonFields & Omit<ButtonProps, 'children'>;
161
162
  /** 次级按钮配置 */
162
163
  secondaryButton?: {
163
164
  text: string;
164
165
  link?: string;
165
166
  onClick?: () => void;
166
- } & Omit<ButtonProps, 'children'>;
167
+ } & BoaButtonFields & Omit<ButtonProps, 'children'>;
167
168
  iconArray?: Array<{
168
169
  pcImage: MediaType;
169
170
  }>;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as g}from"react/jsx-runtime";import*as p from"react";import{cva as ue}from"class-variance-authority";import{useMediaQuery as H}from"react-responsive";import E from"jump.js";import{cn as s,getLocalizedPath as w}from"../../helpers/index.js";import{Text as O,Button as P,Heading as ge,Picture as be,Countdown as ye}from"../../components/index.js";import{withLayout as fe}from"../../shared/Styles.js";import ke from"../Media/index.js";import{useAiuiContext as xe}from"../AiuiProvider/index.js";import{useExposure as he}from"../../hooks/useExposure.js";import{buildTrackingRef as Te,trackUrlRef as V}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as _,resolveComponentMediaType as ve}from"../../shared/track.js";import Be from"./SecondaryBannerCarousel.js";const u="secondary_banner",Ie=ue("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/480] desktop:aspect-[1440/480] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/1320] laptop:aspect-[1024/864] desktop:aspect-[1440/1152] lg-desktop:aspect-[1920/1440] aspect-[390/1440] overflow-visible"}},defaultVariants:{size:"base"}}),j=p.forwardRef(({className:h,classNames:a={},data:e,jumpOptions:T={},isActive:$,a11yLabels:J,trackExposure:q=!0,frameIndex:b,...v},l)=>{const{pcImage:F,padImage:W,mobileImage:G,isVideoLoop:Q,endDate:B,endDate_tz:U,dateFormat:K,size:X,iconArray:y,theme:Y,primaryButton:n,secondaryButton:i,title:c,titleTag:Z}=e,ee=Q??!0,f=X??"base",te=Y??"light",ne=Z??"h2",{locale:I="us",pageHandle:ie}=xe(),oe=H({query:"(max-width: 767px)"}),ae=H({query:"(min-width: 768px) and (max-width: 1024px)"}),M=oe?e.mobileImage:ae?e.padImage??e.pcImage:e.pcImage,m=ve(M?.mimeType==="video/mp4"),S=b??1,C=`${Te(ie??"",m,u)}${b===void 0?"":`_${b}`}`,k=M?.id||e.pcImage?.id||"",L=p.useRef(null),se=p.useCallback(o=>{L.current=o,typeof l=="function"?l(o):l&&(l.current=o)},[l]),re=p.useRef(null);he(q?L:re,{componentType:m,componentName:u,componentTitle:c?.trim()||"",componentDescription:e.subtitle?.trim()||"",position:1,creativeId:k});const le=!!(i?.link||typeof i?.onClick=="function"),pe=!!(n?.link||typeof n?.onClick=="function"),z=i?.link&&!i.link.startsWith("#")?V(w(i.link,I),C):void 0,N=n?.link&&!n.link.startsWith("#")?V(w(n.link,I),C):void 0,ce=_({interactive:le,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:i?.text,position:S,creativeId:k}),me=_({interactive:pe,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:n?.text,position:S,creativeId:k}),R={...{duration:500,offset:0},...T},x=p.useId(),d=c?`${x}-title`:void 0,D=e.subtitle?`${x}-subtitle`:void 0,A=e.superTitle?`${x}-super-title`:void 0,de=[A,D].filter(Boolean).join(" ")||void 0;return e.items&&e.items.length>0?t(Be,{data:e,className:h,classNames:a,jumpOptions:T,a11yLabels:J,ref:l,...v}):g("section",{ref:se,role:"banner","aria-labelledby":d,"aria-describedby":de,className:s({"aiui-dark":te==="dark"},Ie({size:f}),h,a?.root),...v,children:[t("div",{className:s("absolute inset-0",{"h-fit":f==="xlg"}),children:t(ke,{pcImage:F,padImage:W,mobileImage:G,className:"size-full",imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:ee,playsInline:!0,autoPlay:$??!0})}),g("div",{className:s("banner-content laptop:top-[min(50%,50vh)] laptop:-translate-y-1/2 px-grid absolute top-12 z-10 flex flex-col items-start justify-center text-left",a?.content),children:[g("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[e.superTitle&&t(O,{as:"p",size:2,id:A,className:s("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",a?.superTitle),html:e.superTitle}),e.title&&t(ge,{as:ne,size:["xlg","lg"].includes(f)?5:4,id:d,className:s("banner-title ",a?.title),html:e.title}),e.subtitle&&t(O,{as:"p",size:3,id:D,className:s("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",a?.subtitle),html:e.subtitle})]}),B&&t("div",{className:"banner-countdown",children:t(ye,{endDate:B,endDate_tz:U,dateFormat:K,variant:"spacious",className:"lg-desktop:mt-8 mt-6"})}),g("div",{className:s("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",a?.buttonGroup),children:[i?.text&&t(P,{variant:"secondary",onClick:o=>{if(i.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(i.link);r&&E(r,R)}i.onClick?.()},className:s("",a?.secondaryButton),"aria-describedby":d,...z?{as:"a",href:z}:{},...ce,children:i.text}),n?.text&&t(P,{onClick:o=>{if(n.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(n.link);r&&E(r,R)}n.onClick?.()},className:s("",a?.primaryButton),"aria-describedby":d,...N?{as:"a",href:N}:{},...me,children:n.text})]}),Array.isArray(y)&&y.length>0&&t("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:y.map((o,r)=>o.pcImage?t(be,{source:o.pcImage.url,alt:o.pcImage.alt||`icon ${r+1}`,role:"img",className:"laptop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},r):null)})]})]})});j.displayName="SecondaryBanner";var Pe=fe(j);export{Pe as default,Ie as secondaryBannerVariants};
1
+ "use client";import{jsx as a,jsxs as f}from"react/jsx-runtime";import*as p from"react";import{cva as xe}from"class-variance-authority";import{useMediaQuery as O}from"react-responsive";import P from"jump.js";import{cn as s,getLocalizedPath as he}from"../../helpers/index.js";import{Text as F,Button as V,Heading as Be,Picture as Te,Countdown as ve}from"../../components/index.js";import{withLayout as Ie}from"../../shared/Styles.js";import Me from"../Media/index.js";import{useAiuiContext as Le}from"../AiuiProvider/index.js";import{useExposure as ze}from"../../hooks/useExposure.js";import{buildTrackingRef as Se,trackUrlRef as Ce}from"../../shared/trackUrlRef.js";import{useBoaButton as Ae}from"../../hooks/useBoaButton.js";import{buildClickTrackingProps as j,resolveComponentMediaType as Ne}from"../../shared/track.js";import Re from"./SecondaryBannerCarousel.js";const c="secondary_banner",_e=xe("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/480] desktop:aspect-[1440/480] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/1320] laptop:aspect-[1024/864] desktop:aspect-[1440/1152] lg-desktop:aspect-[1920/1440] aspect-[390/1440] overflow-visible"}},defaultVariants:{size:"base"}}),$=p.forwardRef(({className:L,classNames:r={},data:t,jumpOptions:z={},isActive:J,a11yLabels:q,trackExposure:W=!0,frameIndex:b,...S},l)=>{const{pcImage:G,padImage:Q,mobileImage:U,isVideoLoop:K,endDate:C,endDate_tz:X,dateFormat:Y,size:Z,iconArray:y,theme:ee,primaryButton:n,secondaryButton:o,title:d,titleTag:te}=t,ne=K??!0,k=Z??"base",oe=ee??"light",ie=te??"h2",{locale:ae="us",pageHandle:re}=Le(),{resolveLink:x,hasAdTrack:m,trackAd:se}=Ae(),le=O({query:"(max-width: 767px)"}),pe=O({query:"(min-width: 768px) and (max-width: 1024px)"}),A=le?t.mobileImage:pe?t.padImage??t.pcImage:t.pcImage,u=Ne(A?.mimeType==="video/mp4"),N=b??1,ce=`${Se(re??"",u,c)}${b===void 0?"":`_${b}`}`,h=A?.id||t.pcImage?.id||"",R=p.useRef(null),de=p.useCallback(e=>{R.current=e,typeof l=="function"?l(e):l&&(l.current=e)},[l]),me=p.useRef(null);ze(W?R:me,{componentType:u,componentName:c,componentTitle:d?.trim()||"",componentDescription:t.subtitle?.trim()||"",position:1,creativeId:h});const ue=!!(o?.link||typeof o?.onClick=="function"||m(o)),ge=!!(n?.link||typeof n?.onClick=="function"||m(n)),_=e=>{if(!e?.link||e.link.startsWith("#"))return{href:void 0,target:void 0};const i=x(e.link,e);return i.isAmazon?{href:i.href,target:e.target??"_blank"}:{href:Ce(he(e.link,ae),ce),target:void 0}},B=_(o),T=_(n),v=B.href,I=T.href,D=(e,i,ke)=>se(e,{componentName:c,buttonPosition:i,buttonText:e?.text,href:ke}),fe=j({interactive:ue,componentType:u,componentName:c,title:d,description:t.subtitle,buttonName:o?.text,position:N,creativeId:h}),be=j({interactive:ge,componentType:u,componentName:c,title:d,description:t.subtitle,buttonName:n?.text,position:N,creativeId:h}),H={...{duration:500,offset:0},...z},M=p.useId(),g=d?`${M}-title`:void 0,E=t.subtitle?`${M}-subtitle`:void 0,w=t.superTitle?`${M}-super-title`:void 0,ye=[w,E].filter(Boolean).join(" ")||void 0;return t.items&&t.items.length>0?a(Re,{data:t,className:L,classNames:r,jumpOptions:z,a11yLabels:q,ref:l,...S}):f("section",{ref:de,role:"banner","aria-labelledby":g,"aria-describedby":ye,className:s({"aiui-dark":oe==="dark"},_e({size:k}),L,r?.root),...S,children:[a("div",{className:s("absolute inset-0",{"h-fit":k==="xlg"}),children:a(Me,{pcImage:G,padImage:Q,mobileImage:U,className:"size-full",imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:ne,playsInline:!0,autoPlay:J??!0})}),f("div",{className:s("banner-content laptop:top-[min(50%,50vh)] laptop:-translate-y-1/2 px-grid absolute top-12 z-10 flex flex-col items-start justify-center text-left",r?.content),children:[f("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[t.superTitle&&a(F,{as:"p",size:2,id:w,className:s("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",r?.superTitle),html:t.superTitle}),t.title&&a(Be,{as:ie,size:["xlg","lg"].includes(k)?5:4,id:g,className:s("banner-title ",r?.title),html:t.title}),t.subtitle&&a(F,{as:"p",size:2,id:E,className:s("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",r?.subtitle),html:t.subtitle})]}),C&&a("div",{className:"banner-countdown",children:a(ve,{endDate:C,endDate_tz:X,dateFormat:Y,variant:"spacious",className:"lg-desktop:mt-8 lg-desktop:[&_.time-block]:size-12 lg-desktop:[&_.time-block]:p-1 lg-desktop:[&_.separator]:text-2xl mt-6 [&_.separator]:text-xl [&_.time-block]:size-10 [&_.time-block]:p-[2px]"})}),f("div",{className:s("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",r?.buttonGroup),children:[o?.text&&a(V,{variant:"secondary","data-headless-ad-track":m(o)?"true":void 0,"data-headless-amazon":x(o.link,o).isAmazon?"true":void 0,onClick:e=>{if(D(o,"secondary",v),o.link?.startsWith("#")){e.preventDefault();const i=document.querySelector(o.link);i&&P(i,H)}o.onClick?.()},className:s("",r?.secondaryButton),"aria-describedby":g,...v?{as:"a",href:v,...B.target?{target:B.target,rel:o.rel??"noopener noreferrer"}:{}}:{},...fe,children:o.text}),n?.text&&a(V,{onClick:e=>{if(D(n,"primary",I),n.link?.startsWith("#")){e.preventDefault();const i=document.querySelector(n.link);i&&P(i,H)}n.onClick?.()},className:s("",r?.primaryButton),"data-headless-ad-track":m(n)?"true":void 0,"data-headless-amazon":x(n.link,n).isAmazon?"true":void 0,"aria-describedby":g,...I?{as:"a",href:I,...T.target?{target:T.target,rel:n.rel??"noopener noreferrer"}:{}}:{},...be,children:n.text})]}),Array.isArray(y)&&y.length>0&&a("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:y.map((e,i)=>e.pcImage?a(Te,{source:e.pcImage.url,alt:e.pcImage.alt||`icon ${i+1}`,role:"img",className:"lg-desktop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},i):null)})]})]})});$.displayName="SecondaryBanner";var Qe=Ie($);export{Qe as default,_e as secondaryBannerVariants};
@@ -1,2 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{useEffect as f,useRef as b}from"react";const m="openDropDown",v=({index:n,active:a,list:u,setActive:p,setVisible:d,visible:l,resolveName:c})=>{const i=b(null);return f(()=>{const e=o=>{const t=o?.target?.getAttribute?.("class");!i?.current?.contains(o?.target)&&!t?.includes(m)&&d({...l,[n]:!1})};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[]),s("div",{ref:i,className:`absolute left-0 top-[104%] z-30 box-border max-h-[340px] w-full overflow-auto rounded-lg bg-white ${l?.[n]?"block":"hidden"}`,children:s("div",{className:"dropdown-wrapper m-0 box-border h-full flex-1 overflow-hidden p-0 [&:last-child]:border-r-0",children:u?.map((e,o)=>{const t=e?.sku||e?.variants?.[0]?.sku,r=c?c(e,t):e?.name||e?.title;return s("div",{onClick:()=>{p({...a,[n]:{sku:t,name:r,handle:e?.handle}}),d({...l,[n]:!1})},title:r,className:`openDropDown min-xl:text-lg min-xxl:text-lg box-border cursor-pointer truncate px-6 py-4 text-base font-bold [&:hover]:bg-[#EAEAEC]
2
- ${e?.handle===a?.handle?"bg-[#EAEAEC]":""}`,children:r},o)})})})};var k=v;export{k as default};
1
+ import{jsx as s}from"react/jsx-runtime";import{useEffect as m,useRef as y}from"react";import{cn as p}from"../../helpers/index.js";const b="openDropDown",v=({index:e,active:l,list:u,setActive:f,setVisible:c,visible:a,resolveName:i})=>{const d=y(null);return m(()=>{const n=o=>{const r=o?.target?.getAttribute?.("class");!d?.current?.contains(o?.target)&&!r?.includes(b)&&c({...a,[e]:!1})};return document.addEventListener("click",n),()=>document.removeEventListener("click",n)},[]),s("div",{ref:d,className:p("specs-dropdown-panel rounded-box-small bg-container-secondary-1 text-info-primary absolute left-0 top-[calc(100%+8px)] z-30 box-border max-h-[340px] w-full overflow-y-auto",a?.[e]?"block":"hidden"),children:s("div",{className:"dropdown-wrapper m-0 box-border h-full flex-1 overflow-hidden p-0 [&:last-child]:border-r-0",children:u?.map((n,o)=>{const r=n?.sku||n?.variants?.[0]?.sku,t=i?i(n,r):n?.name||n?.title;return s("div",{onClick:()=>{f({...l,[e]:{sku:r,name:t,handle:n?.handle}}),c({...a,[e]:!1})},title:t,className:p("openDropDown specs-dropdown-option text-info-primary box-border cursor-pointer truncate px-6 py-4 text-base font-bold","[&:hover]:bg-container-primary",n?.handle===l?.handle?"bg-container-primary":""),children:t},o)})})})};var k=v;export{k as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as P,jsx as n,jsxs as i}from"react/jsx-runtime";import X from"./dropdown.js";import{useAiuiContext as Y}from"../AiuiProvider/index.js";import{useMediaQuery as Z}from"react-responsive";import{useMemo as j,useState as b,useEffect as H,useCallback as ee}from"react";import{withLayout as te}from"../../shared/Styles.js";import{formatVariantPrice as se}from"../ShelfDisplay/shelfDisplay.js";import{Picture as C,Text as ne,Button as oe,Heading as M}from"../../components/index.js";import{cn as ae}from"../../helpers/index.js";import re,{useImperativeHandle as le,useRef as ce}from"react";const F=re.forwardRef(({data:u,buildData:d,onChange:R,onSecondaryChange:ie,className:_,...I},$)=>{const m=Z({query:"(max-width: 768px)"}),[l,g]=b({}),[h,O]=b([]),[S,L]=b(!1),[v,D]=b({}),A=ce(null),{locale:U="us",currencyDisplay:V,trackingData:B,currencyCode:z}=Y(),q=B?.showComparePrice??!0,{LeftMenu:E,RightMenu:y,DefaultSelectMenu:x}=j(()=>u?.data||{},[u?.data]),w=j(()=>{const e={};return(Array.isArray(u?.items)?u?.items:[]).forEach(t=>{t?.custom_name&&(t?.sku&&(e[t.sku]=t.custom_name),t?.handle&&(e[t.handle]=t.custom_name))}),e},[u?.items]),k=ee((e,s)=>w[s||""]||w[e?.handle||""]||e?.name||e?.title||"",[w]),Q=e=>{try{const t=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(t)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},W=(e,s)=>{const t=e?.variants?.find?.(c=>c?.sku===e?.sku),o=t?.coupons?.[0],{price:a,basePrice:r}=se({locale:z==="CAD"?"us":U||"us",amount:o?o?.variant_price4wscode:t?.price,baseAmount:o?t?.price:0,currencyDisplay:V,currencyCode:e?.price?.currencyCode||"USD"}),p=typeof x?.buttonText=="string"?x?.buttonText:x?.buttonText?.[String(s)]||"";return i("div",{className:"specs-sku-node-wrap box-border",children:[i(ne,{as:"div",className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>{if(h?.length<=1)return null;D({...v,[s]:!v?.[s]})},children:[i("div",{className:"flex items-center justify-between overflow-hidden",children:[n("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:l?.[s]?.name||"",children:l?.[s]?.name||""}),h?.length>1?n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:n("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]}),n(X,{index:s,list:h,active:l,setActive:g,visible:v,setVisible:D,resolveName:k})]}),n("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:n(C,{source:t?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),n("div",{className:"lg-desktop:text-2xl mb-2 mt-6 text-xl font-bold",children:n("div",{className:"lg-desktop:min-h-[32px] flex min-h-[28px] flex-wrap items-center gap-1",children:t?.availableForSale?i(P,{children:[n("div",{className:"specs-sku-node-price whitespace-nowrap text-[#080A0F]",children:a||""}),q&&r&&n("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price whitespace-nowrap text-xl text-[#86868C] line-through",children:r})]}):null})}),p?n(oe,{onClick:()=>{R?.(e,s)},className:"specs-sku-node-button",children:p}):null]})},G=e=>e&&typeof e!="string"?i("div",{className:"size-full",children:[n("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e?.text||""}}),n(C,{source:e?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):n("div",{className:"break-all",children:Q(e)?n(C,{source:e,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):n("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#080A0F] md:text-sm",dangerouslySetInnerHTML:{__html:e||""}})}),T=e=>e.map((s,t)=>{const o=t===0;return i("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[n(M,{as:"h3",html:s||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),n("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${S?3:2} specs-product-node-body col-span-2 grid flex-1 py-6`,children:Object.keys(l)?.map?.(a=>{const r=l?.[a],p=y?.menus?.find?.(c=>c?.handle===r?.handle)?.subTitle;return G(p?.[s])})})]},s)}),J=e=>{if(!l)return;const{subTitle:s,isProduct:t}=e;return t?i(P,{children:[i("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[e?.title&&n(M,{as:"h3",html:e?.title||"",className:"lg-desktop:text-lg desktop:px-6 specs-product-node-title l:hidden specs-item-product-title py-4 text-base font-bold md:text-sm"}),n("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:px-6 desktop:pb-6 lg-desktop:gap-16 grid-cols-${S?3:2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`,children:Object.keys(l)?.map((o,a)=>{const r=l?.[o],p=d?.products?.find?.(c=>c?.handle===r?.handle);return n("div",{children:W({...p,item:o,sku:r?.sku},a)},o)})})]}),e?.categoryLabel&&n(M,{size:2,as:"h4",html:e?.categoryLabel||"",className:"desktop:p-6 specs-item-product-category py-6"}),s?.length?T(s):null]}):T(s)};return le($,()=>A.current),H(()=>{if(!d?.products?.length)return;const e=x?.sku?.split?.(",")||[],s=m&&e?.length>2?e?.slice(0,2):e;let t={};s?.forEach?.((a,r)=>{const c=y?.menus?.find?.(f=>f?.sku===a)?.handle,N=c?d?.products?.find?.(f=>f?.handle===c):d?.products?.find?.(f=>{if(f?.variants?.find?.(K=>K?.sku===a))return!0});N&&(t={...t,[r]:{sku:a,name:k(N,a),handle:N?.handle}})});const o=d?.products?.filter(a=>y?.menus?.find(r=>r?.handle===a?.handle));g(t),O(o),L(e?.length>2&&!m)},[d,m,k]),H(()=>{if(m){const e=Object.keys(l||{});if(e?.length>2){const s=e?.slice?.(0,2);let t={};s?.forEach?.(o=>{t={...t,[o]:l?.[o]}}),L(!1),g(t)}}},[m]),n("div",{...I,className:ae("specs-wrapper w-full overflow-hidden",_),ref:A,children:E?.data?n("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:E?.data?.map?.((e,s)=>n("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:J(e)},s))}):null})});F.displayName="Specs";var ye=te(F);export{ye as default};
1
+ "use client";import{Fragment as _,jsx as o,jsxs as i}from"react/jsx-runtime";import Y from"./dropdown.js";import{useAiuiContext as Z}from"../AiuiProvider/index.js";import{useMediaQuery as ee}from"react-responsive";import{useMemo as H,useState as h,useEffect as E,useCallback as te}from"react";import{withLayout as se}from"../../shared/Styles.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{Picture as S,Text as ne,Button as re,Heading as C}from"../../components/index.js";import{cn as P}from"../../helpers/index.js";import ae,{useImperativeHandle as le,useRef as ie}from"react";const R=ae.forwardRef(({data:d,buildData:p,onChange:$,onSecondaryChange:ce,className:I,...O},U)=>{const u=ee({query:"(max-width: 768px)"}),[l,v]=h({}),[y,V]=h([]),[g,L]=h(!1),[b,D]=h({}),T=ie(null),{locale:q="us",currencyDisplay:B,trackingData:z,currencyCode:F}=Z(),Q=z?.showComparePrice??!0,{LeftMenu:A,RightMenu:k,DefaultSelectMenu:x}=H(()=>d?.data||{},[d?.data]),w=H(()=>{const e={};return(Array.isArray(d?.items)?d?.items:[]).forEach(t=>{t?.custom_name&&(t?.sku&&(e[t.sku]=t.custom_name),t?.handle&&(e[t.handle]=t.custom_name))}),e},[d?.items]),N=te((e,s)=>w[s||""]||w[e?.handle||""]||e?.name||e?.title||"",[w]),W=e=>{try{const t=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(t)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},G=(e,s)=>{const t=e?.variants?.find?.(c=>c?.sku===e?.sku),n=t?.coupons?.[0],{price:r,basePrice:a}=oe({locale:F==="CAD"?"us":q||"us",amount:n?n?.variant_price4wscode:t?.price,baseAmount:n?t?.price:0,currencyDisplay:B,currencyCode:e?.price?.currencyCode||"USD"}),m=typeof x?.buttonText=="string"?x?.buttonText:x?.buttonText?.[String(s)]||"";return i("div",{className:"specs-sku-node-wrap box-border",children:[i(ne,{as:"div",className:"md-tablet:px-4 md-tablet:py-2.5 md-tablet:text-sm l-tablet:mb-4 l-tablet:text-sm laptop:flex laptop:h-[54px] laptop:flex-col laptop:justify-center laptop:py-0 desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text rounded-box-small border-lines bg-container-secondary-0 text-info-primary relative mb-4 box-border block border px-4 py-3 text-base font-bold",onClick:()=>{if(y?.length<=1)return null;D({...b,[s]:!b?.[s]})},children:[i("div",{className:"flex items-center justify-between overflow-hidden",children:[o("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title text-info-primary flex-1 truncate text-base",title:l?.[s]?.name||"",children:l?.[s]?.name||""}),y?.length>1?o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:P("openDropDown specs-sku-node-chevron shrink-0 transition-transform duration-300",b?.[s]?"rotate-180":""),children:o("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]}),o(Y,{index:s,list:y,active:l,setActive:v,visible:b,setVisible:D,resolveName:N})]}),o("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:o(S,{source:t?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),o("div",{className:"lg-desktop:text-2xl mb-2 mt-6 text-xl font-bold tracking-[-0.04em]",children:o("div",{className:"lg-desktop:min-h-[32px] flex min-h-[28px] items-center",children:t?.availableForSale?i(_,{children:[o("div",{className:"specs-sku-node-price text-info-primary",children:r||""}),Q&&a&&o("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price text-info-quaternary ml-1 text-xl line-through",children:a})]}):null})}),m?o(re,{onClick:()=>{$?.(e,s)},className:"specs-sku-node-button hover:text-info-primary",children:m}):null]})},J=e=>e&&typeof e!="string"?i("div",{className:"size-full",children:[o("p",{className:"desktop:text-base lg-desktop:text-lg specs-normal-node-text text-info-primary text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.text||""}}),o(S,{source:e?.imgUrl,className:"m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):o("div",{className:"break-all",children:W(e)?o(S,{source:e,className:"m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):o("p",{className:"desktop:text-base lg-desktop:text-lg specs-normal-node-text text-info-primary text-sm font-bold",dangerouslySetInnerHTML:{__html:e||""}})}),j=e=>e.map(s=>i("div",{className:`l-tablet:flex l-tablet:flex-col border-t-lines specs-product-node-wrap box-border grid w-full cursor-pointer overflow-hidden border-t ${g?"grid-cols-4":"grid-cols-3"}`,children:[o(C,{as:"h3",html:s||"",className:"l-tablet:text-info-quaternary tablet:py-4 laptop:py-6 desktop:p-6 lg-desktop:text-lg specs-product-node-title desktop:text-base mr-2 flex-1 pt-4 text-sm font-bold"}),o("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 specs-product-node-body grid flex-1 py-4 ${g?"col-span-3 grid-cols-3":"col-span-2 grid-cols-2"}`,children:Object.keys(l)?.map?.(t=>{const n=l?.[t],r=k?.menus?.find?.(a=>a?.handle===n?.handle)?.subTitle;return J(r?.[s])})})]},s)),K=e=>{if(!l)return;const{subTitle:s,isProduct:t}=e;return t?i(_,{children:[i("div",{className:`l-tablet:flex l-tablet:flex-col specs-content-item-product border-t-lines box-border grid w-full cursor-pointer border-t-0 ${g?"grid-cols-4":"grid-cols-3"}`,children:[e?.title&&o(C,{as:"h3",html:e?.title||"",className:"l-tablet:hidden lg-desktop:text-lg specs-product-node-title specs-item-product-title desktop:text-base text-sm font-bold"}),o("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 specs-item-product-body grid flex-1 pb-4 pr-0 ${g?"col-span-3 grid-cols-3":"col-span-2 grid-cols-2"}`,children:Object.keys(l)?.map((n,r)=>{const a=l?.[n],m=p?.products?.find?.(c=>c?.handle===a?.handle);return o("div",{children:G({...m,item:n,sku:a?.sku},r)},n)})})]}),e?.categoryLabel&&o(C,{size:2,as:"h4",html:e?.categoryLabel||"",className:"desktop:p-6 specs-item-product-category py-6"}),s?.length?j(s):null]}):j(s)};return le(U,()=>T.current),E(()=>{if(!p?.products?.length)return;const e=x?.sku?.split?.(",")||[],s=u&&e?.length>2?e?.slice(0,2):e;let t={};s?.forEach?.((r,a)=>{const c=k?.menus?.find?.(f=>f?.sku===r)?.handle,M=c?p?.products?.find?.(f=>f?.handle===c):p?.products?.find?.(f=>{if(f?.variants?.find?.(X=>X?.sku===r))return!0});M&&(t={...t,[a]:{sku:r,name:N(M,r),handle:c||M?.handle}})});const n=p?.products?.filter(r=>k?.menus?.find(a=>a?.handle===r?.handle));v(t),V(n),L(e?.length>2&&!u)},[p,u,N]),E(()=>{if(u){const e=Object.keys(l||{});if(e?.length>2){const s=e?.slice?.(0,2);let t={};s?.forEach?.(n=>{t={...t,[n]:l?.[n]}}),L(!1),v(t)}}},[u]),o("div",{...O,className:P("specs-wrapper w-full overflow-hidden",I),ref:T,children:A?.data?o("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:A?.data?.map?.((e,s)=>o("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:K(e)},s))}):null})});R.displayName="Specs";var ye=se(R);export{ye as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as G,jsx as t,jsxs as o}from"react/jsx-runtime";import c,{useRef as d,useImperativeHandle as M}from"react";import{Button as k,Heading as p,Picture as y,Text as N}from"../../components/index.js";import{cn as i,getLocalizedPath as T}from"../../helpers/utils.js";import{withLayout as I}from"../../shared/Styles.js";import{useExposure as U}from"../../hooks/useExposure.js";import{useAiuiContext as $}from"../AiuiProvider/index.js";import{useTracking as O}from"../../hooks/useTracking.js";import{trackUrlRef as V}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as u}from"../../shared/track.js";import{Swiper as S,SwiperSlide as C}from"swiper/react";import{Navigation as W,EffectCoverflow as A}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";import"swiper/css/effect-coverflow";const m="carousel",f="three_d_carousel",q=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),F=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),L=c.forwardRef(({data:z,className:E},R)=>{const{title:h,items:s=[],titleTag:D}=z,v=s.length<4?[...s,...s]:s,r=d(null),n=d(null),x=d(null),[P,j]=c.useState(180),{locale:w="us"}=$(),{buildRef:B}=O(),b=e=>e?V(T(e,w),B(m,f)):T("",w),g=e=>e.buttonLink?{"data-headless-type-name":`${m}#${f}`,"data-headless-title-desc-button":`${u(e.title)}#${u(e.description)}#${u(e.buttonText)}`,"data-headless-nav-position":`#${s.indexOf(e)+1}`}:{};return U(n,{componentType:m,componentName:f,componentTitle:h}),M(R,()=>n.current),c.useEffect(()=>{const e=x.current;if(!e)return;const l=()=>{const H=e.offsetWidth,_=Math.round(H*.125);j(_),r.current?.params?.coverflowEffect&&(r.current.params.coverflowEffect.stretch=_,r.current.update())};l();const a=new ResizeObserver(l);return a.observe(e),()=>a.disconnect()},[]),o("section",{ref:n,"data-ui-component-id":"ThreeDCarousel",className:i("three-d-carousel laptop:overflow-hidden w-full overflow-visible",E),children:[t(p,{as:D??"h2",size:4,html:h,className:"three-d-carousel__title laptop:text-center text-left"}),o("div",{ref:x,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[t(S,{onSwiper:e=>r.current=e,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[A,W],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:P,depth:300,modifier:1,slideShadows:!0},children:v.map((e,l)=>t(C,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:a})=>o(G,{children:[t(y,{source:e.imageUrl?.url||"",alt:e.imageUrl?.alt||e.title,className:i("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:a?"":"brightness(50%) contrast(120%)"}}),o("div",{className:i("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 box-border flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark","opacity-0":!a}),children:[t(p,{as:"h2",size:2,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]"}),e.buttonText&&t("a",{href:b(e.buttonLink),...g(e),className:"three-d-carousel__image-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:e.buttonText})})]})]})},l))}),o("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>r.current?.slidePrev(),"aria-label":"Previous slide",children:t(q,{})}),t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>r.current?.slideNext(),"aria-label":"Next slide",children:t(F,{})})]})]}),t("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:t(S,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:v.map((e,l)=>o(C,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[t(y,{source:e.mobImageUrl?.url||e.imageUrl?.url||"",alt:e.mobImageUrl?.alt||e.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),o("div",{className:i("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark"}),children:[t(p,{as:"h2",size:2,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),e.buttonText&&t("a",{href:b(e.buttonLink),...g(e),className:"three-d-carousel__image-mobile-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:e.buttonText})})]})]},l))})})]})});L.displayName="ThreeDCarousel";var ce=I(L,{style:"overflow: hidden;"});export{ce as default};
1
+ "use client";import{Fragment as G,jsx as t,jsxs as o}from"react/jsx-runtime";import c,{useRef as d,useImperativeHandle as j}from"react";import{Button as k,Heading as u,Picture as y,Text as N}from"../../components/index.js";import{cn as i,getLocalizedPath as T}from"../../helpers/utils.js";import{withLayout as I}from"../../shared/Styles.js";import{useExposure as U}from"../../hooks/useExposure.js";import{useAiuiContext as $}from"../AiuiProvider/index.js";import{useTracking as O}from"../../hooks/useTracking.js";import{trackUrlRef as V}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as p}from"../../shared/track.js";import{Swiper as S,SwiperSlide as C}from"swiper/react";import{Navigation as W,EffectCoverflow as A}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";import"swiper/css/effect-coverflow";const m="carousel",h="three_d_carousel",q=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 hover:text-info-primary scale-[70%] text-white",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),F=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 hover:text-info-primary scale-[70%] text-white",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),L=c.forwardRef(({data:z,className:E},R)=>{const{title:f,items:s=[],titleTag:D}=z,v=s.length<6?[...s,...s]:s,r=d(null),n=d(null),b=d(null),[P,B]=c.useState(180),{locale:w="us"}=$(),{buildRef:H}=O(),x=e=>e?V(T(e,w),H(m,h)):T("",w),g=e=>e.buttonLink?{"data-headless-type-name":`${m}#${h}`,"data-headless-title-desc-button":`${p(e.title)}#${p(e.description)}#${p(e.buttonText)}`,"data-headless-nav-position":`#${s.indexOf(e)+1}`}:{};return U(n,{componentType:m,componentName:h,componentTitle:f}),j(R,()=>n.current),c.useEffect(()=>{const e=b.current;if(!e)return;const l=()=>{const M=e.offsetWidth,_=Math.round(M*.125);B(_),r.current?.params?.coverflowEffect&&(r.current.params.coverflowEffect.stretch=_,r.current.update())};l();const a=new ResizeObserver(l);return a.observe(e),()=>a.disconnect()},[]),o("section",{ref:n,"data-ui-component-id":"ThreeDCarousel",className:i("three-d-carousel laptop:overflow-hidden w-full overflow-visible",E),children:[t(u,{as:D??"h2",size:4,html:f,className:"three-d-carousel__title laptop:text-center text-left"}),o("div",{ref:b,className:"three-d-carousel__desktop laptop:block lg-desktop:max-w-[1648px] relative mx-auto mt-[24px] hidden w-full",children:[t(S,{onSwiper:e=>r.current=e,centeredSlides:!0,initialSlide:0,loop:!0,loopAdditionalSlides:2,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[A,W],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[103/30] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:P,depth:300,modifier:1,slideShadows:!0},children:v.map((e,l)=>t(C,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100 [.swiper-slide-visible&]:opacity-100",children:({isActive:a})=>o(G,{children:[t(y,{source:e.imageUrl?.url||"",alt:e.imageUrl?.alt||e.title,className:i("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:a?"":"brightness(50%) contrast(120%)"}}),o("div",{className:i("three-d-carousel__image-content tablet:p-[24px] desktop:p-[24px] lg-desktop:p-[32px] text-info-primary absolute left-0 top-0 box-border flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark","opacity-0":!a}),children:[t(u,{as:"h3",size:3,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]"}),e.buttonText&&t("a",{href:x(e.buttonLink),...g(e),className:"three-d-carousel__image-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:e.buttonText})})]})]})},l))}),o("div",{className:"three-d-carousel__nav-controls pointer-events-none absolute inset-0 z-20",children:[t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev pointer-events-auto absolute left-[calc(25%-24px)] top-1/2 -translate-x-full -translate-y-1/2",onClick:()=>r.current?.slidePrev(),"aria-label":"Previous slide",children:t(q,{})}),t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next pointer-events-auto absolute right-[calc(25%-24px)] top-1/2 -translate-y-1/2 translate-x-full",onClick:()=>r.current?.slideNext(),"aria-label":"Next slide",children:t(F,{})})]})]}),t("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:t(S,{loop:!0,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:v.map((e,l)=>o(C,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[t(y,{source:e.mobImageUrl?.url||e.imageUrl?.url||"",alt:e.mobImageUrl?.alt||e.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),o("div",{className:i("three-d-carousel__image-mobile-content text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark"}),children:[t(u,{as:"h3",size:3,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),e.buttonText&&t("a",{href:x(e.buttonLink),...g(e),className:"three-d-carousel__image-mobile-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:e.buttonText})})]})]},l))})})]})});L.displayName="ThreeDCarousel";var ce=I(L,{style:"overflow: hidden;"});export{ce as default};
@@ -50,6 +50,8 @@ export { default as GraphicOverlay } from './GraphicOverlay/index.js';
50
50
  export { default as Specs } from './Specs/index.js';
51
51
  export { default as TabGroup } from './TabsGroup/index.js';
52
52
  export { default as BizProductProvider, useBizProductContext } from './Listing/BizProductProvider.js';
53
+ export type { ListingFormattedPrices } from './Listing/types.js';
54
+ export { calcSummaryFinalPrice, calcUnlockedSaving } from './Listing/utils/priceCalc.js';
53
55
  export { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js';
54
56
  export { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js';
55
57
  export type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js';
@@ -249,6 +251,7 @@ export declare const PAYLOAD_COMPONENT_MAP: {
249
251
  export { CartSummaryHeader, CartItemRow, CartGiftSection, CartPerksSection, CartThirdPartyBanner, CartPriceSummary, } from './CartDetail/index.js';
250
252
  export type { CartSummaryHeaderProps, CartItemRowProps, CartGiftSectionProps, CartPerksSectionProps, CartPerk, CartThirdPartyProps, GiftOption, GiftSlotConfig, CartPriceSummaryProps, } from './CartDetail/index.js';
251
253
  export { useAiuiContext } from './AiuiProvider/index.js';
254
+ export type { AdTrackEvent, AdTrackContext, OnAdTrackCallback } from '../shared/adTrack.js';
252
255
  export type { ContainerProps } from '../shared/Styles.js';
253
256
  export { default as ModalRegisterSubscribe } from './ModalRegisterSubscribe/index.js';
254
257
  export { default as ModalSubscribeConfirm } from './ModalSubscribeConfirm/index.js';