@anker-in/headless-ui 1.3.84 → 1.3.85

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 (183) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
  3. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  4. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  5. package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +4 -7
  6. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  7. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  8. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  9. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  10. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  11. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
  12. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  13. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
  14. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  15. package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
  16. package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
  17. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  18. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  19. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
  20. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  21. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
  22. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
  23. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  24. package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
  25. package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
  26. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
  27. package/dist/cjs/biz-components/Category/index.d.ts +4 -2
  28. package/dist/cjs/biz-components/Category/index.js +1 -1
  29. package/dist/cjs/biz-components/Chat/action.d.ts +25 -0
  30. package/dist/cjs/biz-components/Chat/action.js +1 -0
  31. package/dist/cjs/biz-components/Chat/button.d.ts +3 -0
  32. package/dist/cjs/biz-components/Chat/button.js +1 -0
  33. package/dist/cjs/biz-components/Chat/chatContext.d.ts +101 -0
  34. package/dist/cjs/biz-components/Chat/chatContext.js +1 -0
  35. package/dist/cjs/biz-components/Chat/exports.d.ts +3 -0
  36. package/dist/cjs/biz-components/Chat/exports.js +1 -0
  37. package/dist/cjs/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
  38. package/dist/cjs/biz-components/Chat/helpers/fetchResponse.js +1 -0
  39. package/dist/cjs/biz-components/Chat/helpers/fetcher.d.ts +2 -0
  40. package/dist/cjs/biz-components/Chat/helpers/fetcher.js +1 -0
  41. package/dist/cjs/biz-components/Chat/index.d.ts +71 -0
  42. package/dist/cjs/biz-components/Chat/index.js +1 -0
  43. package/dist/cjs/biz-components/Chat/markdown.d.ts +5 -0
  44. package/dist/cjs/biz-components/Chat/markdown.js +1 -0
  45. package/dist/cjs/biz-components/Chat/messages.d.ts +3 -0
  46. package/dist/cjs/biz-components/Chat/messages.js +1 -0
  47. package/dist/cjs/biz-components/Chat/props.d.ts +43 -0
  48. package/dist/cjs/biz-components/Chat/props.js +1 -0
  49. package/dist/cjs/biz-components/Chat/response.d.ts +4 -0
  50. package/dist/cjs/biz-components/Chat/response.js +1 -0
  51. package/dist/cjs/biz-components/Chat/suggestions.d.ts +3 -0
  52. package/dist/cjs/biz-components/Chat/suggestions.js +1 -0
  53. package/dist/cjs/biz-components/Chat/utils.d.ts +3 -0
  54. package/dist/cjs/biz-components/Chat/utils.js +1 -0
  55. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  56. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  57. package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -1
  58. package/dist/cjs/biz-components/Faq/Faq.js +2 -2
  59. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  60. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  61. package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
  62. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  63. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  64. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  65. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  66. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  67. package/dist/cjs/biz-components/MiniCart/index.js +1 -1
  68. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  69. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  70. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  71. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
  72. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  73. package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
  74. package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
  75. package/dist/cjs/biz-components/SceneShelf/Root.js +1 -1
  76. package/dist/cjs/biz-components/SceneShelf/context.d.ts +11 -1
  77. package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
  78. package/dist/cjs/biz-components/SceneShelf/types.d.ts +5 -0
  79. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  80. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  81. package/dist/cjs/biz-components/Title/index.js +1 -1
  82. package/dist/cjs/shared/track.d.ts +13 -7
  83. package/dist/cjs/shared/track.js +1 -1
  84. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  85. package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
  86. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  87. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  88. package/dist/esm/biz-components/ActivityMechanism/index.d.ts +4 -7
  89. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  90. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  91. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  92. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  93. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  94. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
  95. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  96. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
  97. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  98. package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
  99. package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
  100. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  101. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  102. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
  103. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  104. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
  105. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
  106. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  107. package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
  108. package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
  109. package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
  110. package/dist/esm/biz-components/Category/index.d.ts +4 -2
  111. package/dist/esm/biz-components/Category/index.js +1 -1
  112. package/dist/esm/biz-components/Chat/action.d.ts +25 -0
  113. package/dist/esm/biz-components/Chat/action.js +1 -0
  114. package/dist/esm/biz-components/Chat/button.d.ts +3 -0
  115. package/dist/esm/biz-components/Chat/button.js +1 -0
  116. package/dist/esm/biz-components/Chat/chatContext.d.ts +101 -0
  117. package/dist/esm/biz-components/Chat/chatContext.js +1 -0
  118. package/dist/esm/biz-components/Chat/exports.d.ts +3 -0
  119. package/dist/esm/biz-components/Chat/exports.js +1 -0
  120. package/dist/esm/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
  121. package/dist/esm/biz-components/Chat/helpers/fetchResponse.js +1 -0
  122. package/dist/esm/biz-components/Chat/helpers/fetcher.d.ts +2 -0
  123. package/dist/esm/biz-components/Chat/helpers/fetcher.js +1 -0
  124. package/dist/esm/biz-components/Chat/index.d.ts +71 -0
  125. package/dist/esm/biz-components/Chat/index.js +1 -0
  126. package/dist/esm/biz-components/Chat/markdown.d.ts +5 -0
  127. package/dist/esm/biz-components/Chat/markdown.js +1 -0
  128. package/dist/esm/biz-components/Chat/messages.d.ts +3 -0
  129. package/dist/esm/biz-components/Chat/messages.js +1 -0
  130. package/dist/esm/biz-components/Chat/props.d.ts +43 -0
  131. package/dist/esm/biz-components/Chat/props.js +1 -0
  132. package/dist/esm/biz-components/Chat/response.d.ts +4 -0
  133. package/dist/esm/biz-components/Chat/response.js +1 -0
  134. package/dist/esm/biz-components/Chat/suggestions.d.ts +3 -0
  135. package/dist/esm/biz-components/Chat/suggestions.js +1 -0
  136. package/dist/esm/biz-components/Chat/utils.d.ts +3 -0
  137. package/dist/esm/biz-components/Chat/utils.js +1 -0
  138. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  139. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  140. package/dist/esm/biz-components/Faq/Faq.d.ts +3 -1
  141. package/dist/esm/biz-components/Faq/Faq.js +2 -2
  142. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  143. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  144. package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
  145. package/dist/esm/biz-components/Graphic/index.js +1 -1
  146. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  147. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  148. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  149. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  150. package/dist/esm/biz-components/MiniCart/index.js +1 -1
  151. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  152. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  153. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  154. package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
  155. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  156. package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
  157. package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
  158. package/dist/esm/biz-components/SceneShelf/Root.js +1 -1
  159. package/dist/esm/biz-components/SceneShelf/context.d.ts +11 -1
  160. package/dist/esm/biz-components/SceneShelf/context.js +1 -1
  161. package/dist/esm/biz-components/SceneShelf/types.d.ts +5 -0
  162. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  163. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  164. package/dist/esm/biz-components/Title/index.js +1 -1
  165. package/dist/esm/shared/track.d.ts +13 -7
  166. package/dist/esm/shared/track.js +1 -1
  167. package/package.json +50 -3
  168. package/src/biz-components/Chat/styles/chat.css +14 -0
  169. package/src/biz-components/Chat/styles/css/animations.css +35 -0
  170. package/src/biz-components/Chat/styles/css/button.css +56 -0
  171. package/src/biz-components/Chat/styles/css/colors.css +12 -0
  172. package/src/biz-components/Chat/styles/css/console.css +134 -0
  173. package/src/biz-components/Chat/styles/css/header.css +43 -0
  174. package/src/biz-components/Chat/styles/css/input.css +89 -0
  175. package/src/biz-components/Chat/styles/css/markdown.css +131 -0
  176. package/src/biz-components/Chat/styles/css/messages.css +85 -0
  177. package/src/biz-components/Chat/styles/css/panel.css +23 -0
  178. package/src/biz-components/Chat/styles/css/popup.css +44 -0
  179. package/src/biz-components/Chat/styles/css/response.css +25 -0
  180. package/src/biz-components/Chat/styles/css/sidebar.css +31 -0
  181. package/src/biz-components/Chat/styles/css/suggestions.css +36 -0
  182. package/src/biz-components/Chat/styles/css/window.css +60 -0
  183. package/src/biz-components/Chat/styles/image.png +0 -0
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as y}from"react/jsx-runtime";import*as n from"react";import{cn as m}from"../../helpers/index.js";import{Text as C,Picture as E,Button as ot,Container as nt,Heading as at}from"../../components/index.js";import{cva as T}from"class-variance-authority";import{Swiper as st,SwiperSlide as rt}from"swiper/react";import{withLayout as it}from"../../shared/Styles.js";import{formatVariantPrice as lt}from"../Listing/utils/index.js";import{useAiuiContext as ut}from"../AiuiProvider/index.js";import{replaceTemplate as L}from"../Listing/utils/textFormat.js";const ct=T("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),dt=T("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),ft=T("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),pt=T("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),mt=T("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),M=T("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),U=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},q=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",ht=t=>{const e=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return`${e.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},j=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},O=t=>{if(!t)return!1;const e=j(t.startTime),a=(t.durationDays??1)*24*3600*1e3,i=t.rounds??1,d=Date.now();if(d<e)return!1;const h=d-e,u=Math.floor(h/a)+1;if(u>i)return!1;const f=e+u*a-d,s=5*60*1e3;return f<=s&&f>0},H=(t,e)=>{if(!t||!e)return t||"";const a=j(e.startTime),i=(e.durationDays??1)*24*3600*1e3,d=e.rounds??1,h=Date.now();if(h<a){const g=new Date(a),l=`${(g.getUTCMonth()+1).toString().padStart(2,"0")}${g.getUTCDate().toString().padStart(2,"0")}`;return`${t}${l}`}const u=h-a,w=Math.min(Math.floor(u/i)+1,d),f=a+(w-1)*i,s=new Date(f),p=`${(s.getUTCMonth()+1).toString().padStart(2,"0")}${s.getUTCDate().toString().padStart(2,"0")}`;return`${t}${p}`},W=n.memo(({config:t,theme:e="light",className:a,countdownText:i="Next round start time",lastRoundText:d="Last round",beforeStartText:h="Start time",countdownIcon:u,onStateChange:w})=>{const[f,s]=n.useState(0),[p,g]=n.useState("beforeStart"),l=n.useMemo(()=>j(t.startTime),[t.startTime]),S=t.rounds??1,N=(t.durationDays??1)*24*3600*1e3;n.useEffect(()=>{const P=()=>{const x=Date.now();if(x<l){const G=Math.max(0,Math.floor((l-x)/1e3));s(G),g("beforeStart");return}const R=x-l,b=Math.floor(R/N)+1;if(b>S){g("finished");return}const D=l+b*N,r=Math.max(0,Math.floor((D-x)/1e3));s(r),g(b===S?"lastRound":"running")};P();const A=setInterval(P,1e3);return()=>clearInterval(A)},[l,N,S]),n.useEffect(()=>{w?.(p)},[p,w]);const V=n.useMemo(()=>{switch(p){case"beforeStart":return h;case"lastRound":return d;default:return i}},[p,h,d,i]);return p==="finished"?null:y("div",{className:m("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",a),children:[u&&o(E,{source:u.url,alt:u.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),o(C,{html:V,className:"whitespace-nowrap font-bold"}),o("span",{className:"font-bold",children:"|"}),o(C,{className:"font-bold",html:ht(f)})]})});W.displayName="Countdown";const J=n.memo(({progress:t,theme:e="light",className:a})=>{const i=Math.min(100,Math.max(0,t));return o("div",{className:m("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",a),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:o("div",{className:m("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${i}%`}})})});J.displayName="ProgressBar";const K=n.memo(({item:t,theme:e="light",layout:a="vertical",className:i,buttonClassName:d,countdownClassName:h,onButtonClick:u,onProductImageClick:w,buildData:f,buttonText:s,remainText:p,lowStockText:g,soldOutButtonText:l,discountText:S="Only {price}",countdownText:N,countdownIcon:V,lastRoundText:P,beforeStartText:A,comingSoonButtonText:x,loading:R})=>{const{locale:b="us",currencyCode:D}=ut(),r=t.products?.[0],[G,X]=n.useState(()=>O(t.countdown)),[I,Y]=n.useState(()=>H(t.codePrefix,t.countdown)),[$,Z]=n.useState("beforeStart");n.useEffect(()=>{const v=()=>{X(O(t.countdown));const F=H(t.codePrefix,t.countdown);Y(_=>_!==F?F:_)};v();const z=setInterval(v,1e3);return()=>clearInterval(z)},[t.codePrefix,t.countdown]);const tt=n.useCallback(v=>{Z(v)},[]),B=n.useMemo(()=>!r?.handle||!f?.products?.length?null:f.products.find(v=>v.handle===r.handle)||null,[r?.handle,f?.products]),c=n.useMemo(()=>B?.variants?.find(v=>v?.sku===r?.sku)||{},[r?.sku,B?.variants]),k=n.useMemo(()=>{const{price:v,basePrice:z}=lt({locale:D==="CAD"?"us":b||"us",baseAmount:c?.price?.amount,amount:r?.custom_price??c?.price?.amount,currencyCode:B?.price?.currencyCode||"USD"});return{value:z,description:r?.custom_description,salePrice:L(S||"",{price:v})}},[B,c,b,S,r?.custom_price,r?.custom_description]),et=n.useCallback(()=>{u?.({product:r,code:I})},[u,I,r]);return y("div",{className:m(ct({state:e}),i),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&o("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:o(W,{config:t.countdown,theme:e,className:h,countdownText:N,lastRoundText:P,beforeStartText:A,countdownIcon:V,onStateChange:tt})}),y("div",{className:dt({layout:a}),children:[y("div",{className:ft({layout:a}),children:[t.backgroundImage&&(w?o("a",{onClick:()=>r&&w(r),className:"cursor-pointer",children:o(E,{source:U(t.backgroundImage),alt:q(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):o(E,{source:U(t.backgroundImage),alt:q(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),o("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:y("div",{className:"flex flex-col gap-1",children:[k.value&&o(at,{html:k.value,size:4,className:m("font-bold leading-none",M({state:e}))}),k.description&&o(C,{html:k.description,className:m("text-base font-bold opacity-60",M({state:e}))})]})})]}),y("div",{className:pt({layout:a}),children:[k.salePrice&&o(C,{as:"p",html:k.salePrice,className:m("lg-desktop:text-2xl text-xl font-bold",M({state:e}))}),o(J,{progress:r?.custom_inventory?(c?.quantityAvailable||0)/r.custom_inventory*100:0,theme:e,className:m("mb-1 mt-2",c?.availableForSale&&(c?.quantityAvailable??0)<=0&&"invisible")}),p&&(c?.quantityAvailable??0)>=0&&o(C,{html:L(p,{inventory:r?.custom_inventory?.toString()||"",quantity:c?.quantityAvailable?.toString()||"0"}),as:"p",className:m("laptop:text-base text-sm font-bold",M({state:e}))}),g&&c?.availableForSale&&(c?.quantityAvailable??0)<0&&o(C,{html:g,as:"p",className:m("laptop:text-base text-sm font-bold text-red-500",M({state:e}))}),o(ot,{size:"lg",className:m(mt({state:e}),d),onClick:et,disabled:!c?.availableForSale||R||G||$==="beforeStart"||$==="finished",loading:R&&c?.availableForSale,children:$==="beforeStart"?x||s:c?.availableForSale?s:l||s})]})]})]})});K.displayName="GiftShelfCard";const Q=n.forwardRef(({classNames:t={},data:e,onButtonClick:a,onProductImageClick:i,buildData:d,loading:h,...u},w)=>{const f=e.theme||"light",s=n.useMemo(()=>e?.items?.length||4,[e?.items]),p=s===2?"horizontal":"vertical",g=n.useMemo(()=>{const l=S=>{switch(S){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return s<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return s<=3?{slidesPerView:s,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(s,4),spaceBetween:20}}};return{0:l("mobile"),768:l("tablet"),1025:l("laptop"),1440:l("desktop")}},[s]);return o(nt,{ref:w,className:m(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...u,children:o(st,{breakpoints:g,className:"w-full !overflow-visible",children:e.items.map((l,S)=>o(rt,{children:o(K,{item:l,theme:f,layout:p,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:a,onProductImageClick:i,buildData:d,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:h})},"giftShelfCardItem"+S))})})});Q.displayName="GiftShelf";var Tt=it(Q);export{Tt as default};
1
+ "use client";import{jsx as s,jsxs as R}from"react/jsx-runtime";import*as o from"react";import{cn as g}from"../../helpers/index.js";import{Text as N,Picture as j,Button as ct,Container as dt,Heading as pt}from"../../components/index.js";import{cva as M}from"class-variance-authority";import{Swiper as mt,SwiperSlide as ft}from"swiper/react";import{withLayout as ht}from"../../shared/Styles.js";import{formatVariantPrice as gt}from"../Listing/utils/index.js";import{useAiuiContext as vt}from"../AiuiProvider/index.js";import{replaceTemplate as W}from"../Listing/utils/textFormat.js";import{useExposure as St}from"../../hooks/useExposure.js";import{useViewItemList as wt}from"../../hooks/useViewItemList.js";import{useTracking as xt}from"../../hooks/useTracking.js";import{buildClickTrackingProps as J,trackSelectItem as kt}from"../../shared/track.js";const $="image",P="gift_shelf",K=(t,e,r)=>{const a=r?.find(c=>c.handle===t.handle),i=a?.variants?.find(c=>c?.sku===t.sku);return{item_id:t.sku||"",item_name:i?.title||a?.title||t.name||"",item_variant:i?.title||"",price:String(t.custom_price??i?.price?.amount??""),index:e+1}},bt=M("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),Ct=M("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),Tt=M("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),yt=M("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),Nt=M("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),A=M("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),Q=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},X=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",Mt=t=>{const e=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60;return`${e.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`},F=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},Y=t=>{if(!t)return!1;const e=F(t.startTime),r=(t.durationDays??1)*24*3600*1e3,a=t.rounds??1,i=Date.now();if(i<e)return!1;const c=i-e,f=Math.floor(c/r)+1;if(f>a)return!1;const d=e+f*r-i,l=5*60*1e3;return d<=l&&d>0},Z=(t,e)=>{if(!t||!e)return t||"";const r=F(e.startTime),a=(e.durationDays??1)*24*3600*1e3,i=e.rounds??1,c=Date.now();if(c<r){const u=new Date(r),v=`${(u.getUTCMonth()+1).toString().padStart(2,"0")}${u.getUTCDate().toString().padStart(2,"0")}`;return`${t}${v}`}const f=c-r,S=Math.min(Math.floor(f/a)+1,i),d=r+(S-1)*a,l=new Date(d),h=`${(l.getUTCMonth()+1).toString().padStart(2,"0")}${l.getUTCDate().toString().padStart(2,"0")}`;return`${t}${h}`},tt=o.memo(({config:t,theme:e="light",className:r,countdownText:a="Next round start time",lastRoundText:i="Last round",beforeStartText:c="Start time",countdownIcon:f,onStateChange:S})=>{const[d,l]=o.useState(0),[h,u]=o.useState("beforeStart"),v=o.useMemo(()=>F(t.startTime),[t.startTime]),b=t.rounds??1,p=(t.durationDays??1)*24*3600*1e3;o.useEffect(()=>{const C=()=>{const T=Date.now();if(T<v){const G=Math.max(0,Math.floor((v-T)/1e3));l(G),u("beforeStart");return}const D=T-v,k=Math.floor(D/p)+1;if(k>b){u("finished");return}const I=v+k*p,B=Math.max(0,Math.floor((I-T)/1e3));l(B),u(k===b?"lastRound":"running")};C();const E=setInterval(C,1e3);return()=>clearInterval(E)},[v,p,b]),o.useEffect(()=>{S?.(h)},[h,S]);const w=o.useMemo(()=>{switch(h){case"beforeStart":return c;case"lastRound":return i;default:return a}},[h,c,i,a]);return h==="finished"?null:R("div",{className:g("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",r),children:[f&&s(j,{source:f.url,alt:f.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),s(N,{html:w,className:"whitespace-nowrap font-bold"}),s("span",{className:"font-bold",children:"|"}),s(N,{className:"font-bold",html:Mt(d)})]})});tt.displayName="Countdown";const et=o.memo(({progress:t,theme:e="light",className:r})=>{const a=Math.min(100,Math.max(0,t));return s("div",{className:g("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",r),role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:s("div",{className:g("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${a}%`}})})});et.displayName="ProgressBar";const ot=o.memo(({item:t,theme:e="light",layout:r="vertical",className:a,buttonClassName:i,countdownClassName:c,onButtonClick:f,onProductImageClick:S,buildData:d,buttonText:l,remainText:h,lowStockText:u,soldOutButtonText:v,discountText:b="Only {price}",countdownText:p,countdownIcon:w,lastRoundText:C,beforeStartText:E,comingSoonButtonText:T,loading:D,position:k})=>{const{locale:I="us",currencyCode:B}=vt(),{pageGroup:G}=xt(),n=t.products?.[0],[st,rt]=o.useState(()=>Y(t.countdown)),[U,at]=o.useState(()=>Z(t.codePrefix,t.countdown)),[_,it]=o.useState("beforeStart");o.useEffect(()=>{const x=()=>{rt(Y(t.countdown));const O=Z(t.codePrefix,t.countdown);at(H=>H!==O?O:H)};x();const L=setInterval(x,1e3);return()=>clearInterval(L)},[t.codePrefix,t.countdown]);const lt=o.useCallback(x=>{it(x)},[]),V=o.useMemo(()=>!n?.handle||!d?.products?.length?null:d.products.find(x=>x.handle===n.handle)||null,[n?.handle,d?.products]),m=o.useMemo(()=>V?.variants?.find(x=>x?.sku===n?.sku)||{},[n?.sku,V?.variants]),y=o.useMemo(()=>{const{price:x,basePrice:L}=gt({locale:B==="CAD"?"us":I||"us",baseAmount:m?.price?.amount,amount:n?.custom_price??m?.price?.amount,currencyCode:V?.price?.currencyCode||"USD"});return{value:L,description:n?.custom_description,salePrice:W(b||"",{price:x})}},[V,m,I,b,n?.custom_price,n?.custom_description]),z=o.useCallback(()=>{n&&kt({pageGroup:G,currency:B||"USD",itemListName:P,position:k+1,items:[K(n,k,d?.products)]})},[n,G,B,k,d?.products]),ut=o.useCallback(()=>{z(),f?.({product:n,code:U})},[z,f,U,n]),q=m?.title||V?.title||n?.name;return R("div",{className:g(bt({state:e}),a),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&s("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:s(tt,{config:t.countdown,theme:e,className:c,countdownText:p,lastRoundText:C,beforeStartText:E,countdownIcon:w,onStateChange:lt})}),R("div",{className:Ct({layout:r}),children:[R("div",{className:Tt({layout:r}),children:[t.backgroundImage&&(S?s("a",{onClick:()=>{n&&(z(),S(n))},className:"cursor-pointer",...J({interactive:!!n,componentType:$,componentName:P,title:q,sku:n?.sku,position:k+1}),children:s(j,{source:Q(t.backgroundImage),alt:X(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):s(j,{source:Q(t.backgroundImage),alt:X(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),s("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:R("div",{className:"flex flex-col gap-1",children:[y.value&&s(pt,{html:y.value,size:4,className:g("font-bold leading-none",A({state:e}))}),y.description&&s(N,{html:y.description,className:g("text-base font-bold opacity-60",A({state:e}))})]})})]}),R("div",{className:yt({layout:r}),children:[y.salePrice&&s(N,{as:"p",html:y.salePrice,className:g("lg-desktop:text-2xl text-xl font-bold",A({state:e}))}),s(et,{progress:n?.custom_inventory?(m?.quantityAvailable||0)/n.custom_inventory*100:0,theme:e,className:g("mb-1 mt-2",m?.availableForSale&&(m?.quantityAvailable??0)<=0&&"invisible")}),h&&(m?.quantityAvailable??0)>=0&&s(N,{html:W(h,{inventory:n?.custom_inventory?.toString()||"",quantity:m?.quantityAvailable?.toString()||"0"}),as:"p",className:g("laptop:text-base text-sm font-bold",A({state:e}))}),u&&m?.availableForSale&&(m?.quantityAvailable??0)<0&&s(N,{html:u,as:"p",className:g("laptop:text-base text-sm font-bold text-red-500",A({state:e}))}),s(ct,{size:"lg",className:g(Nt({state:e}),i),onClick:ut,...J({interactive:!!n,componentType:$,componentName:P,title:q,buttonName:l,sku:n?.sku,position:k+1}),disabled:!m?.availableForSale||D||st||_==="beforeStart"||_==="finished",loading:D&&m?.availableForSale,children:_==="beforeStart"?T||l:m?.availableForSale?l:v||l})]})]})]})});ot.displayName="GiftShelfCard";const nt=o.forwardRef(({classNames:t={},data:e,onButtonClick:r,onProductImageClick:a,buildData:i,loading:c,...f},S)=>{const d=e.theme||"light",l=o.useRef(null);o.useImperativeHandle(S,()=>l.current);const h=o.useMemo(()=>e.items.flatMap((p,w)=>{const C=p.products?.[0];return C?[K(C,w,i?.products)]:[]}),[e.items,i?.products]);St(l,{componentType:$,componentName:P,componentTitle:e.items?.[0]?.products?.[0]?.name}),wt(l,{componentType:$,componentName:P,itemListName:P,items:h});const u=o.useMemo(()=>e?.items?.length||4,[e?.items]),v=u===2?"horizontal":"vertical",b=o.useMemo(()=>{const p=w=>{switch(w){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return u<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return u<=3?{slidesPerView:u,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(u,4),spaceBetween:20}}};return{0:p("mobile"),768:p("tablet"),1025:p("laptop"),1440:p("desktop")}},[u]);return s(dt,{ref:l,className:g(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...f,children:s(mt,{breakpoints:b,className:"w-full !overflow-visible",children:e.items.map((p,w)=>s(ft,{children:s(ot,{item:p,theme:d,layout:v,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:r,onProductImageClick:a,buildData:i,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:c,position:w})},"giftShelfCardItem"+w))})})});nt.displayName="GiftShelf";var Lt=ht(nt);export{Lt as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as f}from"react/jsx-runtime";import*as r from"react";import{cn as m}from"../../helpers/index.js";import{Text as S,Picture as T,Container as A,Heading as L}from"../../components/index.js";import{cva as C}from"class-variance-authority";import{Swiper as b,SwiperSlide as P}from"swiper/react";import*as M from"swiper/modules";import{withLayout as U}from"../../shared/Styles.js";import{useAiuiContext as D}from"../AiuiProvider/index.js";import{formatPrice as E}from"../Listing/utils/index.js";const H=C("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),y=C("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),V=r.memo(({image:t})=>t?e(T,{source:t.url,alt:t.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);V.displayName="MemberTag";const G=r.memo(({theme:t="light"})=>{const l=t==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return e("div",{className:"flex h-4 w-full items-center",children:e("div",{className:m("flex h-1 w-full items-center justify-center",l),children:e("div",{className:m("relative size-4 shrink-0 rounded-full",l)})})})});G.displayName="TimelineItem";const B=r.memo(({item:t,theme:l="light",className:h,onClick:g,onProductImageClick:n,buildData:u})=>{const{locale:w="us"}=D(),s=t.products?.[0],o=r.useMemo(()=>!s?.handle||!u?.products?.length?null:u.products.find(p=>p.handle===s.handle)||null,[s?.handle,u?.products]),c=r.useMemo(()=>o?.variants?.find(p=>p?.sku===s?.sku)||{},[s?.sku,o?.variants]),v=E({locale:w||"us",amount:s?.custom_price??c?.price?.amount,currencyCode:o?.price?.currencyCode||"USD"});return f("div",{className:m(H({theme:l}),h),onClick:g,"data-ui-component-id":"GiftTierCard",children:[e("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:t.showMemberTag&&t.memberTagImage&&e(V,{image:t.memberTagImage})}),e("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:n?e("a",{onClick:n,className:"cursor-pointer",children:e(T,{source:c?.image?.url||o?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}):e(T,{source:c?.image?.url||o?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),f("div",{className:m("z-10 flex w-full shrink-0 flex-col gap-2",y({theme:l})),children:[f("div",{className:"flex items-end gap-1",children:[e(L,{html:v,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),t.valueUnit&&e(S,{html:t.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),e(S,{html:c?.title||o?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});B.displayName="GiftTierCard";const I=r.forwardRef(({classNames:t={},data:l,onCardClick:h,onProductImageClick:g,buildData:n,...u},w)=>{const s=l.theme||"light",o=l.showTimeline!==!1,[c,v]=r.useState(null),[p,F]=r.useState(null),d=r.useMemo(()=>n?.products?.length?l.items.filter(i=>{const a=i.products?.[0];return a?.handle?n.products.find(k=>k.handle===a.handle)?.variants?.find(k=>k?.sku===a?.sku)?.availableForSale!==!1:!0}):l.items,[l.items,n?.products]),z=r.useMemo(()=>{const i=d.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(i,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(i,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(i,4),spaceBetween:16}}},[d.length]),j=r.useMemo(()=>{const i=d.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(i,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(i,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(i,4),spaceBetween:0}}},[d.length]),N=r.useMemo(()=>M.Controller?[M.Controller]:[],[]);return f(A,{ref:w,className:m(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...u,children:[e(b,{modules:N,breakpoints:z,className:"w-full !overflow-visible",onSwiper:v,controller:{control:p},children:d.map((i,a)=>e(P,{children:e(B,{item:i,theme:s,buildData:n,className:t?.card,onClick:()=>h?.(i,a),onProductImageClick:()=>{const x=i.products?.[0];x&&g?.(x,i)}})},"giftTierItem"+a))}),o&&e("div",{className:"mt-4 flex flex-col gap-4",children:e("div",{className:m("w-full",t?.timeline),children:e(b,{modules:N,breakpoints:j,className:"w-full !overflow-visible",onSwiper:F,controller:{control:c},children:d.map((i,a)=>e(P,{children:f("div",{className:"flex flex-col items-center",children:[e(G,{theme:s}),e(S,{html:i.threshold,className:m("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",y({theme:s}),t?.thresholdText)})]})},"timelineItem"+a))})})})]})});I.displayName="GiftTierShelf";var X=U(I);export{X as default};
1
+ "use client";import{jsx as t,jsxs as S}from"react/jsx-runtime";import*as r from"react";import{cn as f}from"../../helpers/index.js";import{Text as N,Picture as P,Container as K,Heading as O}from"../../components/index.js";import{cva as M}from"class-variance-authority";import{Swiper as y,SwiperSlide as I}from"swiper/react";import*as G from"swiper/modules";import{withLayout as Q}from"../../shared/Styles.js";import{useAiuiContext as V}from"../AiuiProvider/index.js";import{formatPrice as W}from"../Listing/utils/index.js";import{useExposure as X}from"../../hooks/useExposure.js";import{useViewItemList as Y}from"../../hooks/useViewItemList.js";import{useTracking as Z}from"../../hooks/useTracking.js";import{buildClickTrackingProps as $,trackSelectItem as ee}from"../../shared/track.js";const b="image",T="gift_tier_shelf",B=(e,o,h)=>{const u=h?.find(d=>d.handle===e.handle),s=u?.variants?.find(d=>d?.sku===e.sku);return{item_id:e.sku||"",item_name:s?.title||u?.title||e.name||"",item_variant:s?.title||"",price:String(e.custom_price??s?.price?.amount??""),index:o+1}},te=M("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),F=M("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),z=r.memo(({image:e})=>e?t(P,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);z.displayName="MemberTag";const L=r.memo(({theme:e="light"})=>{const o=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return t("div",{className:"flex h-4 w-full items-center",children:t("div",{className:f("flex h-1 w-full items-center justify-center",o),children:t("div",{className:f("relative size-4 shrink-0 rounded-full",o)})})})});L.displayName="TimelineItem";const _=r.memo(({item:e,theme:o="light",className:h,onClick:u,onProductImageClick:s,interactive:d,buildData:v})=>{const{locale:k="us"}=V(),n=e.products?.[0],a=r.useMemo(()=>!n?.handle||!v?.products?.length?null:v.products.find(w=>w.handle===n.handle)||null,[n?.handle,v?.products]),p=r.useMemo(()=>a?.variants?.find(w=>w?.sku===n?.sku)||{},[n?.sku,a?.variants]),g=W({locale:k||"us",amount:n?.custom_price??p?.price?.amount,currencyCode:a?.price?.currencyCode||"USD"});return S("div",{className:f(te({theme:o}),h),onClick:u,"data-ui-component-id":"GiftTierCard",...$({interactive:!!d,componentType:b,componentName:T,title:e.threshold,description:p?.title||a?.title,sku:n?.sku}),children:[t("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&t(z,{image:e.memberTagImage})}),t("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:s?t("a",{onClick:s,className:"cursor-pointer",children:t(P,{source:p?.image?.url||a?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}):t(P,{source:p?.image?.url||a?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),S("div",{className:f("z-10 flex w-full shrink-0 flex-col gap-2",F({theme:o})),children:[S("div",{className:"flex items-end gap-1",children:[t(O,{html:g,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&t(N,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),t(N,{html:p?.title||a?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});_.displayName="GiftTierCard";const j=r.forwardRef(({classNames:e={},data:o,onCardClick:h,onProductImageClick:u,buildData:s,...d},v)=>{const k=o.theme||"light",n=o.showTimeline!==!1,{pageGroup:a}=Z(),{currencyCode:p}=V(),g=r.useRef(null);r.useImperativeHandle(v,()=>g.current);const w=!!(h||u),[A,E]=r.useState(null),[H,R]=r.useState(null),c=r.useMemo(()=>s?.products?.length?o.items.filter(i=>{const l=i.products?.[0];return l?.handle?s.products.find(x=>x.handle===l.handle)?.variants?.find(x=>x?.sku===l?.sku)?.availableForSale!==!1:!0}):o.items,[o.items,s?.products]),U=r.useMemo(()=>c.flatMap((i,l)=>{const m=i.products?.[0];return m?[B(m,l,s?.products)]:[]}),[c,s?.products]);X(g,{componentType:b,componentName:T,componentTitle:c[0]?.threshold}),Y(g,{componentType:b,componentName:T,itemListName:T,items:U});const D=(i,l)=>{const m=i.products?.[0];w&&m&&ee({pageGroup:a,currency:p||"USD",itemListName:T,position:l+1,items:[B(m,l,s?.products)]}),h?.(i,l)},q=r.useMemo(()=>{const i=c.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(i,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(i,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(i,4),spaceBetween:16}}},[c.length]),J=r.useMemo(()=>{const i=c.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(i,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(i,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(i,4),spaceBetween:0}}},[c.length]),C=r.useMemo(()=>G.Controller?[G.Controller]:[],[]);return S(K,{ref:g,className:f(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...d,children:[t(y,{modules:C,breakpoints:q,className:"w-full !overflow-visible",onSwiper:E,controller:{control:H},children:c.map((i,l)=>t(I,{children:t(_,{item:i,theme:k,buildData:s,className:e?.card,interactive:w,onClick:()=>D(i,l),onProductImageClick:()=>{const m=i.products?.[0];m&&u?.(m,i)}})},"giftTierItem"+l))}),n&&t("div",{className:"mt-4 flex flex-col gap-4",children:t("div",{className:f("w-full",e?.timeline),children:t(y,{modules:C,breakpoints:J,className:"w-full !overflow-visible",onSwiper:R,controller:{control:A},children:c.map((i,l)=>t(I,{children:S("div",{className:"flex flex-col items-center",children:[t(L,{theme:k}),t(N,{html:i.threshold,className:f("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",F({theme:k}),e?.thresholdText)})]})},"timelineItem"+l))})})})]})});j.displayName="GiftTierShelf";var fe=Q(j);export{fe as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as ne,jsx as t,jsxs as r}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as S,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as k}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as T,Text as V,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import G from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as P}from"../../hooks/useExposure.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";const u="image",h="graphic",B=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),n=s(e.lgDesktop),a=s(e.desktop),i=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${a} 1919`,`${i} 1439`,`${g} 1024`,`${b} 768`].join(", ")},L="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",re=({data:e,configuration:o})=>{const s=S(null),[n,a]=p({visible:!1,x:0,y:0,text:""}),i=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&a({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{a(l=>({...l,visible:!1}))};P(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:y(k(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return t("div",{ref:s,className:m(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:r("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?r("a",{"aria-label":e?.title||e?.description,href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),r(v,{...x,className:m("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[r("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[r("div",{className:"flex-1 overflow-hidden",children:[t(V,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&r("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:i,className:`${L} graphic-description`}):t(i,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${L} graphic-description-item`}),typeof window<"u"&&n.visible&&Z(t(V,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(T,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},D=({items:e=[],sharedConfig:o})=>{const s=n=>{const a=e.length>3,i=e.length>2;switch(n){case 1440:return a?4:e.length;case 1024:return a?3:e.length;case 768:return e.length===1?1:a||i?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:re,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},A=Q.forwardRef(({data:e,className:o,...s},n)=>{const a=q({query:"(max-width: 768px)"}),i=S(null),[g,b]=p(!1),[d,v]=p(""),[x,l]=p(""),[U,I]=p(""),[z,C]=p(null),[H,M]=p(!1),{locale:R="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[_,Y]=p(f?.[0]?.id??"");X(n,()=>i.current),P(i,{componentType:u,componentName:h,componentTitle:e?.title});const N={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:R,onVideoPlayBtnClick:(c,w)=>{b(!0),w?.isYouTube?(l(w?.youtubeId||""),v(""),I("")):(l(""),v(w?.video?.url||""),I(w?.mobileVideo?.url||""))},onIconClick:c=>{M(!0),C(c)}},$=()=>r(ne,{children:[t(se,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":a&&U||d}),t(le,{textVisible:H,extension:z?.extension,onCloseModal:()=>{M(!1),C(null)}})]});return!E||!f||f.length===0?r("div",{...s,ref:i,className:m("graphicBlock",o),children:[r("div",{className:"graphic-box",children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(D,{items:e?.items,sharedConfig:N})]}),$()]}):r("div",{...s,ref:i,className:m("graphicBlock",o),children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),r(W,{value:_,onValueChange:Y,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(c=>t(te,{value:c.id,children:c.label},c.id))})}),f.map(c=>t(oe,{value:c.id,children:t(D,{items:c.items,sharedConfig:N})},c.id))]}),$()]})});A.displayName="Graphic";var Te=F(A);export{Te as default};
1
+ "use client";import{Fragment as ae,jsx as t,jsxs as n}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as $,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as T}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as y,Text as G,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import P from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as B}from"../../hooks/useExposure.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";import{useTracking as re}from"../../hooks/useTracking.js";const u="image",h="graphic",L=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),c=s(e.lgDesktop),l=s(e.desktop),r=s(e.laptop),b=s(e.tablet),g=e.default?.url;return[`${c} 9999`,`${l} 1919`,`${r} 1439`,`${b} 1024`,`${g} 768`].join(", ")},D="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",ne=({data:e,configuration:o})=>{const{buildRef:s}=re(),c=$(null),[l,r]=p({visible:!1,x:0,y:0,text:""}),b=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},d=i=>{e?.description&&r({visible:!0,x:i.clientX,y:i.clientY,text:e.description})},v=()=>{r(i=>({...i,visible:!1}))};B(c,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const x=e?.href?"a":"div",w=e?.href?{href:I(T(e.href,o?.locale||"us"),s(u,h))}:{};return t("div",{ref:c,className:m(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:n("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?n("a",{"aria-label":e?.title||e?.description,href:I(T(e?.href||"",o?.locale||"us"),s(u,h)),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(y,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?L(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(y,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?L(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),n(x,{...w,className:m("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[n("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[n("div",{className:"flex-1 overflow-hidden",children:[t(G,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&n("div",{onMouseMove:d,onMouseLeave:v,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:b,className:`${D} graphic-description`}):t(b,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${D} graphic-description-item`}),typeof window<"u"&&l.visible&&Z(t(G,{as:"div",html:l.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${l.x+16}px`,top:`${l.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(y,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:I(T(e?.href||"",o?.locale||"us"),s(u,h)),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},A=({items:e=[],sharedConfig:o})=>{const s=c=>{const l=e.length>3,r=e.length>2;switch(c){case 1440:return l?4:e.length;case 1024:return l?3:e.length;case 768:return e.length===1?1:l||r?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:ne,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},U=Q.forwardRef(({data:e,className:o,...s},c)=>{const l=q({query:"(max-width: 768px)"}),r=$(null),[b,g]=p(!1),[d,v]=p(""),[x,w]=p(""),[i,C]=p(""),[z,M]=p(null),[R,N]=p(!1),{locale:H="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[Y,_]=p(f?.[0]?.id??"");X(c,()=>r.current),B(r,{componentType:u,componentName:h,componentTitle:e?.title});const S={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:H,onVideoPlayBtnClick:(a,k)=>{g(!0),k?.isYouTube?(w(k?.youtubeId||""),v(""),C("")):(w(""),v(k?.video?.url||""),C(k?.mobileVideo?.url||""))},onIconClick:a=>{N(!0),M(a)}},V=()=>n(ae,{children:[t(se,{visible:b,youTubeId:x,onCloseModal:()=>g(!1),videoUrl:x?"":l&&i||d}),t(le,{textVisible:R,extension:z?.extension,onCloseModal:()=>{N(!1),M(null)}})]});return!E||!f||f.length===0?n("div",{...s,ref:r,className:m("graphicBlock",o),children:[n("div",{className:"graphic-box",children:[e?.title&&t(P,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(A,{items:e?.items,sharedConfig:S})]}),V()]}):n("div",{...s,ref:r,className:m("graphicBlock",o),children:[e?.title&&t(P,{data:{title:e.title,align:e?.titleAlign??"left"}}),n(W,{value:Y,onValueChange:_,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(a=>t(te,{value:a.id,children:a.label},a.id))})}),f.map(a=>t(oe,{value:a.id,children:t(A,{items:a.items,sharedConfig:S})},a.id))]}),V()]})});U.displayName="Graphic";var Ie=F(U);export{Ie as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as c}from"react/jsx-runtime";import U,{useState as T,useEffect as R,useRef as A}from"react";import{useMediaQuery as E}from"react-responsive";import{withLayout as _}from"../../shared/Styles.js";import C from"../../components/picture.js";import O from"../../components/button.js";import{Heading as I}from"../../components/heading.js";import{Tabs as D,TabsList as H,TabsTrigger as Y,TabsContent as Q}from"../../components/tabs.js";import{VideoModal as q}from"../VideoModal/index.js";import{cn as b,getLocalizedPath as M}from"../../helpers/utils.js";import Z from"../SwiperBox/index.js";import{isVideo as L}from"../../shared/mimeType.js";import{useExposure as j}from"../../hooks/useExposure.js";import{trackUrlRef as P}from"../../shared/trackUrlRef.js";import{useAiuiContext as F}from"../AiuiProvider/index.js";const v="image",f="p1_banner",J=({data:p,configuration:t,jIndex:d})=>{const[g,y]=T(!1),r=E({query:"(max-width: 768px)"}),n=A(null),m=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};j(n,{componentType:v,componentName:f,position:d,componentTitle:p.title,componentDescription:p.description,navigation:t?.activeTab}),R(()=>{y(r)},[r]);const{theme:o="light",title:l,description:a,imageUrl:i,primaryButton:u,secondaryButton:h,imageMobileUrl:w,blockLink:k,video:$,youtubeId:N,isYouTube:B}=p,x="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return c("div",{className:b("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",m(),{"rounded-box":!0,"aiui-dark":o==="dark","h-[400px]":g},"text-info-primary"),ref:n,children:[k&&e("a",{className:"absolute inset-0 z-10",href:P(M(k||"",t?.locale||"us"),`${v}_${f}`),"data-headless-type-name":`${v}#${f}`,"data-headless-title-desc-button":`${l}#${a}`,"data-headless-nav-position":`${t?.activeTab}#${d}`,"aria-hidden":"true",tabIndex:-1}),c("div",{className:"absolute inset-0",children:[L(i?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:e("source",{src:i?.url,type:"video/mp4"})}):e(C,{source:i?.url,alt:i?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:b("h-full object-cover",k&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${i?.width}/${i?.height}`}}),L(w?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:e("source",{src:w?.url,type:"video/mp4"})}):e(C,{source:w?.url||i?.url,alt:w?.alt||i?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),c("div",{className:b("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":p?.width==="full"}),children:[c("div",{className:"flex flex-col gap-1",children:[e(I,{size:3,as:"h3",className:"item-title",html:l}),e(I,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:a})]}),c("div",{className:"lg-desktop:gap-3 flex gap-2",children:[h&&h.text&&c(O,{"aria-label":l??a,className:b(x,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:P(M(h.link||"",t?.locale||"us"),`${v}_${f}`),"data-headless-type-name":`${v}#${f}`,"data-headless-title-desc-button":`${l}#${a}#${h?.text}`,"data-headless-nav-position":`${t?.activeTab}#${d}`,children:[h.text,e("span",{className:"sr-only",children:l??a})]}),u&&u.text&&e(O,{"aria-label":l??a,className:b(x,"link-right pointer-events-auto"),variant:"primary",as:"a",href:P(M(u.link||"",t?.locale||"us"),`${v}_${f}`),"data-headless-type-name":`${v}#${f}`,"data-headless-title-desc-button":`${l}#${a}#${u.text}`,"data-headless-nav-position":`${t?.activeTab}#${d}`,children:u.text})]})]})]}),e("div",{children:e("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&e("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:e("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:o==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},S=({items:p=[],shape:t,locale:d,activeTab:g,onVideoPlayBtnClick:y})=>{const r=n=>{const m=p?.length,o=m>3,l=m>2,a=m>1;switch(!0){case n>=1440:case n>=1024:return o?3:m;case n>=768:return o||l?2.3:a?2:1;default:return a?1.2:1}};return e(Z,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:p||[],configuration:{shape:t,num:p.length,locale:d,activeTab:g,onVideoPlayBtnClick:y}},Slide:J,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:r(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:r(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:r(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:r(1440)}}})},G=U.forwardRef((p,t)=>{const{data:d,className:g,...y}=p,{shape:r,items:n=[],isShowTab:m=!1,tabs:o,tabAlign:l="left"}=d,[a,i]=T(!1),[u,h]=T(""),[w,k]=T(""),[$,N]=T(o?.[0]?.id??""),{locale:B="us"}=F(),x=(s,z)=>{i(!0),z?k?.(s||""):h?.(s||"")},V=()=>e(q,{visible:a,youTubeId:w,videoUrl:u,onCloseModal:()=>i(!1)});return!m||!o||o.length===0?c("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...y,className:b("graphicOverlayBlock text-info-primary ",g),children:[n&&n.length>0?e(S,{items:n,shape:r,locale:B,onVideoPlayBtnClick:x}):null,a&&V()]}):c("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...y,className:b("graphicOverlayBlock text-info-primary ",g),children:[c(D,{value:$,onValueChange:N,align:l,children:[e("div",{className:"mb-6",children:e(H,{children:o.map(s=>e(Y,{value:s.id,children:s.label},s.id))})}),o.map(s=>e(Q,{value:s.id,children:s.items&&s.items.length>0?e(S,{items:s.items,shape:r,locale:B,activeTab:s.id,onVideoPlayBtnClick:x}):null},s.id))]}),a&&V()]})});G.displayName="GraphicOverlayBlock";var de=_(G);export{de as default};
1
+ import{jsx as e,jsxs as d}from"react/jsx-runtime";import R,{useState as B,useEffect as U,useRef as A}from"react";import{useMediaQuery as E}from"react-responsive";import{withLayout as D}from"../../shared/Styles.js";import C from"../../components/picture.js";import O from"../../components/button.js";import{Heading as I}from"../../components/heading.js";import{Tabs as H,TabsList as Y,TabsTrigger as Q,TabsContent as q}from"../../components/tabs.js";import{VideoModal as Z}from"../VideoModal/index.js";import{cn as v,getLocalizedPath as P}from"../../helpers/utils.js";import _ from"../SwiperBox/index.js";import{isVideo as L}from"../../shared/mimeType.js";import{useExposure as j}from"../../hooks/useExposure.js";import{trackUrlRef as V}from"../../shared/trackUrlRef.js";import{useAiuiContext as F}from"../AiuiProvider/index.js";import{useTracking as J}from"../../hooks/useTracking.js";const f="image",g="p1_banner",K=({data:o,configuration:t,jIndex:m})=>{const{buildRef:u}=J(),[y,n]=B(!1),l=E({query:"(max-width: 768px)"}),c=A(null),i=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};j(c,{componentType:f,componentName:g,position:m,componentTitle:o.title,componentDescription:o.description,navigation:t?.activeTab}),U(()=>{n(l)},[l]);const{theme:k="light",title:a,description:p,imageUrl:r,primaryButton:h,secondaryButton:b,imageMobileUrl:w,blockLink:x,video:$,youtubeId:T,isYouTube:M}=o,N="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return d("div",{className:v("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",i(),{"rounded-box":!0,"aiui-dark":k==="dark","h-[400px]":y},"text-info-primary"),ref:c,children:[x&&e("a",{className:"absolute inset-0 z-10",href:V(P(x||"",t?.locale||"us"),u(f,g)),"data-headless-type-name":`${f}#${g}`,"data-headless-title-desc-button":`${a}#${p}`,"data-headless-nav-position":`${t?.activeTab}#${m}`,"aria-hidden":"true",tabIndex:-1}),d("div",{className:"absolute inset-0",children:[L(r?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:e("source",{src:r?.url,type:"video/mp4"})}):e(C,{source:r?.url,alt:r?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:v("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${r?.width}/${r?.height}`}}),L(w?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:e("source",{src:w?.url,type:"video/mp4"})}):e(C,{source:w?.url||r?.url,alt:w?.alt||r?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),d("div",{className:v("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":o?.width==="full"}),children:[d("div",{className:"flex flex-col gap-1",children:[e(I,{size:3,as:"h3",className:"item-title",html:a}),e(I,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:p})]}),d("div",{className:"lg-desktop:gap-3 flex gap-2",children:[b&&b.text&&d(O,{"aria-label":a??p,className:v(N,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:V(P(b.link||"",t?.locale||"us"),u(f,g)),"data-headless-type-name":`${f}#${g}`,"data-headless-title-desc-button":`${a}#${p}#${b?.text}`,"data-headless-nav-position":`${t?.activeTab}#${m}`,children:[b.text,e("span",{className:"sr-only",children:a??p})]}),h&&h.text&&e(O,{"aria-label":a??p,className:v(N,"link-right pointer-events-auto"),variant:"primary",as:"a",href:V(P(h.link||"",t?.locale||"us"),u(f,g)),"data-headless-type-name":`${f}#${g}`,"data-headless-title-desc-button":`${a}#${p}#${h.text}`,"data-headless-nav-position":`${t?.activeTab}#${m}`,children:h.text})]})]})]}),e("div",{children:e("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||T)&&e("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||T,M)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:e("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:k==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},S=({items:o=[],shape:t,locale:m,activeTab:u,onVideoPlayBtnClick:y})=>{const n=l=>{const c=o?.length,i=c>3,k=c>2,a=c>1;switch(!0){case l>=1440:case l>=1024:return i?3:c;case l>=768:return i||k?2.3:a?2:1;default:return a?1.2:1}};return e(_,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:o||[],configuration:{shape:t,num:o.length,locale:m,activeTab:u,onVideoPlayBtnClick:y}},Slide:K,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:n(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:n(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:n(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:n(1440)}}})},G=R.forwardRef((o,t)=>{const{data:m,className:u,...y}=o,{shape:n,items:l=[],isShowTab:c=!1,tabs:i,tabAlign:k="left"}=m,[a,p]=B(!1),[r,h]=B(""),[b,w]=B(""),[x,$]=B(i?.[0]?.id??""),{locale:T="us"}=F(),M=(s,z)=>{p(!0),z?w?.(s||""):h?.(s||"")},N=()=>e(Z,{visible:a,youTubeId:b,videoUrl:r,onCloseModal:()=>p(!1)});return!c||!i||i.length===0?d("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...y,className:v("graphicOverlayBlock text-info-primary ",u),children:[l&&l.length>0?e(S,{items:l,shape:n,locale:T,onVideoPlayBtnClick:M}):null,a&&N()]}):d("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...y,className:v("graphicOverlayBlock text-info-primary ",u),children:[d(H,{value:x,onValueChange:$,align:k,children:[e("div",{className:"mb-6",children:e(Y,{children:i.map(s=>e(Q,{value:s.id,children:s.label},s.id))})}),i.map(s=>e(q,{value:s.id,children:s.items&&s.items.length>0?e(S,{items:s.items,shape:n,locale:T,activeTab:s.id,onVideoPlayBtnClick:M}):null},s.id))]}),a&&N()]})});G.displayName="GraphicOverlayBlock";var ue=D(G);export{ue as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as d}from"react/jsx-runtime";import ge,{useImperativeHandle as ve,useRef as g,useState as v,useEffect as Q}from"react";import{Heading as y,Picture as S,Text as M,Link as U}from"../../components/index.js";import{cn as r,getLocalizedPath as X}from"../../helpers/utils.js";import{withLayout as be}from"../../shared/Styles.js";import{useExposure as we}from"../../hooks/useExposure.js";import{useIntersectionObserverDelay as _e}from"../../hooks/useIntersectionObserver.js";import{useAiuiContext as ye}from"../AiuiProvider/index.js";import{motion as Y,AnimatePresence as ee}from"framer-motion";const ke="image",Ne="image_with_text",te=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),ie=ge.forwardRef(({data:ae,className:oe},le)=>{const{title:b,subtitle:k,desc:f,descIcon:P,image:w,padImage:D,mobileImage:z,theme:se="dark",items:E=[],layout:re="left",mediaType:ne="image",datalist:s=[],video:H,padVideo:j,mobVideo:R,button:u,textAlign:l="left",titleTag:me}=ae,i=re,{locale:W="us"}=ye(),V=g(null),N=g(null),T=g(null),I=g(null),C=g(null),[p,de]=v(0),A=g([]),[q,pe]=v({left:0,width:0}),[h,$]=v(""),[B,F]=v(""),[O,Z]=v(""),n=s.length>0,_=ne==="video";we(V,{componentType:ke,componentName:Ne,componentTitle:b,componentDescription:k}),ve(le,()=>V.current),Q(()=>{if(s.length>0){const t=A.current[p];if(t){const{offsetLeft:o,offsetWidth:a}=t;pe({left:o,width:a})}}},[p,s.length]);const[G,ce]=v(!1);_e(C,{once:!0,threshold:.01,callback:()=>{ce(!0)}}),Q(()=>{if(!G||!_)return;let t="",o="",a="";if(n&&s[p]){const c=s[p];t=c.video?.url||"",o=c.padVideo?.url||t,a=c.mobVideo?.url||t}else t=H?.url||"",o=j?.url||t,a=R?.url||t;t&&$(t),o&&F(o),a&&Z(a),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},200)},[G,_,n,p,s,H?.url,j?.url,R?.url]);const xe=(t,o)=>{if(de(t),o.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),_&&n&&s[t]){const a=s[t];a.video?.url&&$(a.video.url),a.padVideo?.url&&F(a.padVideo.url),a.mobVideo?.url&&Z(a.mobVideo.url),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},300)}},ue=()=>!L||!u?.text||i==="top"||i==="bottom"?null:e("div",{className:r("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":l==="center","flex justify-start":l==="left"}),children:e(U,{href:X(u.link||"",W),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:te,children:u.text})}),m=E.length>0,L=!!u,J=()=>{if(n&&s[p]){const t=s[p];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return w?`${w?.url},${D?.url||w?.url} 1024, ${z?.url||w?.url} 768`:""},K=()=>{if(n){const c=s[p],x=c.image?.url,fe=c.imgPad?.url||x,he=c.imageMob?.url||x;return e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:d("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:x,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:fe,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:he,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},c.video?.url||c.image?.url)})}const t=w?.url,o=D?.url||t,a=z?.url||t;return d("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:B||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:O||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return d("section",{ref:V,"data-ui-component-id":"ImageWithText",className:r("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!n,"flex-col":!n&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!n&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":n,"aiui-dark":se==="dark"},oe),children:[n&&(b||f||s.length>0)&&d("div",{className:r("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":l==="left","text-center":l==="center"}),children:[d("div",{className:"image-with-text__header",children:[e(y,{as:"h3",size:4,html:b,className:"image-with-text__title"}),e(M,{as:"p",size:1,html:f,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),e("div",{className:r("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":l==="center"}),children:d("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[e("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:q.left,width:q.width}}),s.map((t,o)=>e("div",{ref:a=>{A.current[o]=a},onClick:a=>xe(o,a),className:r("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",p===o?"image-with-text__tab--active text-black":"text-white"),children:e(y,{as:me??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},o))]})})]}),!n&&(b||k||f)&&d("div",{className:r("image-with-text__content flex w-full flex-col",{"justify-center":!L,"justify-between":L,"items-start":l==="left"&&m,"items-center":l==="center"&&m,"text-left":l==="left","text-center":l==="center","laptop:order-1":i==="left"}),children:[d("div",{className:r("image-with-text__main-content",{"flex flex-col":L}),children:[d("div",{className:r("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&u?.text}),children:[d("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[e(y,{as:"h2",size:4,html:b,className:r("image-with-text__title",{"text-left":m&&l==="left","text-center":m&&l==="center"})}),k&&e(M,{as:"p",size:m?4:3,html:k,className:r("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!m,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":m,"text-left":m&&l==="left","text-center":m&&l==="center"})})]}),(i==="top"||i==="bottom")&&u?.text&&e(U,{href:X(u.link||"",W),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:te,children:u.text})]}),!m&&(f||P)&&d("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[P&&e("img",{src:P,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),f&&e(y,{as:"h4",size:5,html:f,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),m&&e("div",{className:r("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:E.map((t,o)=>d("div",{className:r("image-with-text__item",{"text-center":l==="center"}),children:[d("div",{className:r("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":l==="center","justify-start":l==="left"}),children:[t.icon?.url&&e(S,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),e(y,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),e(M,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},o))})]}),ue()]}),e("div",{ref:C,className:r("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":m,"laptop:basis-[63%] desktop:basis-[57%]":m&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":n,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:n?_?K():e(ee,{mode:"wait",children:e(Y.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:e(S,{source:J(),alt:s[p].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},s[p].image?.url)}):_?K():e(S,{source:J(),className:r("image-with-text__image rounded-box laptop:rounded-box")})})]})});ie.displayName="ImageWithText";var ze=be(ie);export{ze as default};
1
+ "use client";import{jsx as e,jsxs as d}from"react/jsx-runtime";import ke,{useImperativeHandle as ye,useRef as v,useState as b,useEffect as ee}from"react";import{Heading as y,Picture as S,Text as M,Link as te}from"../../components/index.js";import{cn as r,getLocalizedPath as Ne}from"../../helpers/utils.js";import{withLayout as Te}from"../../shared/Styles.js";import{useExposure as Ie}from"../../hooks/useExposure.js";import{useIntersectionObserverDelay as Le}from"../../hooks/useIntersectionObserver.js";import{useAiuiContext as Pe}from"../AiuiProvider/index.js";import{useTracking as Ve}from"../../hooks/useTracking.js";import{trackUrlRef as Se}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as Me}from"../../shared/track.js";import{motion as ie,AnimatePresence as oe}from"framer-motion";const D="image",z="image_with_text",ae=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),le=ke.forwardRef(({data:se,className:re},ne)=>{const{title:f,subtitle:w,desc:g,descIcon:P,image:_,padImage:H,mobileImage:E,theme:me="dark",items:R=[],layout:de="left",mediaType:ce="image",datalist:s=[],video:j,padVideo:C,mobVideo:W,button:u,textAlign:l="left",titleTag:pe}=se,i=de,{locale:xe="us"}=Pe(),{buildRef:ue}=Ve(),V=v(null),N=v(null),T=v(null),I=v(null),A=v(null),[c,fe]=b(0),q=v([]),[B,ge]=b({left:0,width:0}),[h,$]=b(""),[F,O]=b(""),[U,Z]=b(""),n=s.length>0,k=ce==="video";Ie(V,{componentType:D,componentName:z,componentTitle:f,componentDescription:w}),ye(ne,()=>V.current),ee(()=>{if(s.length>0){const t=q.current[c];if(t){const{offsetLeft:a,offsetWidth:o}=t;ge({left:a,width:o})}}},[c,s.length]);const[G,he]=b(!1);Le(A,{once:!0,threshold:.01,callback:()=>{he(!0)}}),ee(()=>{if(!G||!k)return;let t="",a="",o="";if(n&&s[c]){const p=s[c];t=p.video?.url||"",a=p.padVideo?.url||t,o=p.mobVideo?.url||t}else t=j?.url||"",a=C?.url||t,o=W?.url||t;t&&$(t),a&&O(a),o&&Z(o),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},200)},[G,k,n,c,s,j?.url,C?.url,W?.url]);const ve=(t,a)=>{if(fe(t),a.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k&&n&&s[t]){const o=s[t];o.video?.url&&$(o.video.url),o.padVideo?.url&&O(o.padVideo.url),o.mobVideo?.url&&Z(o.mobVideo.url),setTimeout(()=>{[N.current?.querySelector("video"),T.current?.querySelector("video"),I.current?.querySelector("video")].forEach(x=>{x&&(x.load(),x.play().catch(()=>{}))})},300)}},J=Ne(u?.link||"",xe),K=u?.link?Se(J,ue(D,z)):J,Q=Me({interactive:!!u?.link,componentType:D,componentName:z,title:f,description:w,buttonName:u?.text}),be=()=>!L||!u?.text||i==="top"||i==="bottom"?null:e("div",{className:r("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":l==="center","flex justify-start":l==="left"}),children:e(te,{href:K,...Q,className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:ae,children:u.text})}),m=R.length>0,L=!!u,X=()=>{if(n&&s[c]){const t=s[c];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return _?`${_?.url},${H?.url||_?.url} 1024, ${E?.url||_?.url} 768`:""},Y=()=>{if(n){const p=s[c],x=p.image?.url,we=p.imgPad?.url||x,_e=p.imageMob?.url||x;return e(oe,{mode:"wait",children:e(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:d("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:x,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:we,src:F||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:_e,src:U||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},p.video?.url||p.image?.url)})}const t=_?.url,a=H?.url||t,o=E?.url||t;return d("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[e("div",{ref:N,className:"image-with-text__desktop-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:h,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),e("div",{ref:T,className:"image-with-text__tablet-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:F||h,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),e("div",{ref:I,className:"image-with-text__mobile-video-container",children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:U||h,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return d("section",{ref:V,"data-ui-component-id":"ImageWithText",className:r("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!n,"flex-col":!n&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!n&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":n,"aiui-dark":me==="dark"},re),children:[n&&(f||g||s.length>0)&&d("div",{className:r("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":l==="left","text-center":l==="center"}),children:[d("div",{className:"image-with-text__header",children:[e(y,{as:"h3",size:4,html:f,className:"image-with-text__title"}),e(M,{as:"p",size:1,html:g,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),e("div",{className:r("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":l==="center"}),children:d("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[e("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:B.left,width:B.width}}),s.map((t,a)=>e("div",{ref:o=>{q.current[a]=o},onClick:o=>ve(a,o),className:r("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",c===a?"image-with-text__tab--active text-black":"text-white"),children:e(y,{as:pe??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},a))]})})]}),!n&&(f||w||g)&&d("div",{className:r("image-with-text__content flex w-full flex-col",{"justify-center":!L,"justify-between":L,"items-start":l==="left"&&m,"items-center":l==="center"&&m,"text-left":l==="left","text-center":l==="center","laptop:order-1":i==="left"}),children:[d("div",{className:r("image-with-text__main-content",{"flex flex-col":L}),children:[d("div",{className:r("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&u?.text}),children:[d("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[e(y,{as:"h2",size:4,html:f,className:r("image-with-text__title",{"text-left":m&&l==="left","text-center":m&&l==="center"})}),w&&e(M,{as:"p",size:m?4:3,html:w,className:r("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!m,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":m,"text-left":m&&l==="left","text-center":m&&l==="center"})})]}),(i==="top"||i==="bottom")&&u?.text&&e(te,{href:K,...Q,className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:ae,children:u.text})]}),!m&&(g||P)&&d("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[P&&e("img",{src:P,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),g&&e(y,{as:"h4",size:5,html:g,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),m&&e("div",{className:r("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:R.map((t,a)=>d("div",{className:r("image-with-text__item",{"text-center":l==="center"}),children:[d("div",{className:r("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":l==="center","justify-start":l==="left"}),children:[t.icon?.url&&e(S,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),e(y,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),e(M,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},a))})]}),be()]}),e("div",{ref:A,className:r("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":m,"laptop:basis-[63%] desktop:basis-[57%]":m&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":n,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:n?k?Y():e(oe,{mode:"wait",children:e(ie.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:e(S,{source:X(),alt:s[c].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},s[c].image?.url)}):k?Y():e(S,{source:X(),className:r("image-with-text__image rounded-box laptop:rounded-box")})})]})});le.displayName="ImageWithText";var $e=Te(le);export{$e as default};
@@ -1 +1 @@
1
- "use client";import{jsx as l,jsxs as i}from"react/jsx-runtime";import{useState as r,forwardRef as C,useRef as h}from"react";import{cn as V,getLocalizedPath as B}from"../../helpers/utils.js";import{withLayout as $}from"../../shared/Styles.js";import{Picture as v,Link as z,Text as D}from"../../components/index.js";import E from"../Title/index.js";import H from"../SwiperBox/index.js";import{Container as R}from"../../components/container.js";import{VideoModal as S}from"../VideoModal/index.js";import{convertLexicalToHTML as U}from"@payloadcms/richtext-lexical/html";import{useExposure as _}from"../../hooks/useExposure.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{trackUrlRef as q}from"../../shared/trackUrlRef.js";const a="video",p="media_player_multi",Y=({data:e,configuration:o})=>{const t=h(null);return _(t,{componentType:a,componentName:p,componentTitle:e?.title,position:o?.index+1,componentDescription:e?.description}),i("div",{ref:t,className:V("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto","rounded-box"),children:[i("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(v,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(v,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),i("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[i("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(z,{asChild:!e?.href,href:q(B(e?.href||"",o?.locale||"us"),`${a}_${p}`),"data-headless-type-name":`${a}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(D,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=C(({data:{items:e=[],shape:o="square",title:t,containerProps:g},className:n="",key:w,onVideoPlayBtnClick:y,...M},k)=>{const[m,d]=r(!1),[P,c]=r(""),[N,f]=r(""),{locale:L="us"}=j(),u=typeof t=="string"?t:t&&U({data:t}),T=h(null),x=e.length===2;return i("div",{...M,ref:T,className:n,children:[l("div",{className:"mediaplayermulti-box",children:l(R,{...g||{},className:"overflow-hidden",children:i("div",{className:n,ref:k,children:[t&&l(E,{className:"mediaplayermulti-title",data:{title:u||""}}),l(H,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+w,data:{list:e,configuration:{shape:o,locale:L,onVideoPlayBtnClick:(I,s)=>{d(!0),s?.isYouTube?(f(s?.youtubeId||""),c("")):(c(s?.video?.url||""),f("")),y?.(I)},title:u}},Slide:Y,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),m&&l(S,{visible:m,youTubeId:N,videoUrl:P,onCloseModal:()=>d(!1)})]})});b.displayName="MediaPlayerMulti";var te=$(b);export{te as default};
1
+ "use client";import{jsx as l,jsxs as i}from"react/jsx-runtime";import{useState as a,forwardRef as C,useRef as b}from"react";import{cn as V,getLocalizedPath as B}from"../../helpers/utils.js";import{withLayout as z}from"../../shared/Styles.js";import{Picture as v,Link as R,Text as D}from"../../components/index.js";import E from"../Title/index.js";import H from"../SwiperBox/index.js";import{Container as S}from"../../components/container.js";import{VideoModal as U}from"../VideoModal/index.js";import{convertLexicalToHTML as $}from"@payloadcms/richtext-lexical/html";import{useExposure as j}from"../../hooks/useExposure.js";import{useAiuiContext as q}from"../AiuiProvider/index.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useTracking as Y}from"../../hooks/useTracking.js";const p="video",n="media_player_multi",A=({data:e,configuration:o})=>{const{buildRef:t}=Y(),s=b(null);return j(s,{componentType:p,componentName:n,componentTitle:e?.title,position:o?.index+1,componentDescription:e?.description}),i("div",{ref:s,className:V("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto","rounded-box"),children:[i("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[l(v,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),l(v,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),l("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&l("button",{onClick:()=>{o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:l("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),i("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[i("div",{className:"flex flex-col",children:[l("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&l(R,{asChild:!e?.href,href:_(B(e?.href||"",o?.locale||"us"),t(p,n)),"data-headless-type-name":`${p}#${n}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:l(D,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),l("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},g=C(({data:{items:e=[],shape:o="square",title:t,containerProps:s},className:m="",key:w,onVideoPlayBtnClick:y,...M},k)=>{const[d,c]=a(!1),[P,f]=a(""),[N,u]=a(""),{locale:T="us"}=q(),x=typeof t=="string"?t:t&&$({data:t}),L=b(null),h=e.length===2;return i("div",{...M,ref:L,className:m,children:[l("div",{className:"mediaplayermulti-box",children:l(S,{...s||{},className:"overflow-hidden",children:i("div",{className:m,ref:k,children:[t&&l(E,{className:"mediaplayermulti-title",data:{title:x||""}}),l(H,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+w,data:{list:e,configuration:{shape:o,locale:T,onVideoPlayBtnClick:(I,r)=>{c(!0),r?.isYouTube?(u(r?.youtubeId||""),f("")):(f(r?.video?.url||""),u("")),y?.(I)},title:x}},Slide:A,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:h?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),d&&l(U,{visible:d,youTubeId:N,videoUrl:P,onCloseModal:()=>c(!1)})]})});g.displayName="MediaPlayerMulti";var ie=z(g);export{ie as default};
@@ -1,4 +1,4 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import w,{useImperativeHandle as z,useRef as H}from"react";import{useMediaQuery as P}from"react-responsive";import{Button as x,Heading as T,Picture as y,Text as j}from"../../components/index.js";import{withLayout as C}from"../../shared/Styles.js";import{cn as c,getLocalizedPath as R}from"../../helpers/utils.js";import{isVideo as b}from"../../shared/mimeType.js";import{useExposure as _}from"../../hooks/useExposure.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{useAiuiContext as L}from"../AiuiProvider/index.js";const r="image",m="member_area",f=w.forwardRef(({data:g,className:k="",...v},h)=>{const{title:t,description:o,backgroundImage:s,mobileBackgroundImage:p,primaryButton:i,secondaryButton:a,theme:N,shape:D,primaryButtonHandler:d,secondaryButtonHandler:B}=g,$=P({query:"(max-width: 768px)"}),n=H(null),{locale:q="us"}=L();z(h,()=>n.current),_(n,{componentType:r,componentName:m,componentTitle:t,componentDescription:o});const M=()=>{console.log("primaryButtonHandler",d),d?.()},E=()=>{B?.()},u="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return l("section",{"data-ui-component-id":"MemberEquity",...v,className:c("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",k,{"aiui-dark":N==="dark","rounded-box":!0,"h-[480px]":$}),ref:n,children:[b(s?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:e("source",{src:s?.url,type:"video/mp4"})}):e(y,{source:s?.url,alt:s?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),b(p?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:e("source",{src:p?.url,type:"video/mp4"})}):e(y,{source:p?.url,alt:p?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),e("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:l("div",{className:`
1
+ "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import T,{useImperativeHandle as z,useRef as H}from"react";import{useMediaQuery as P}from"react-responsive";import{Button as x,Heading as R,Picture as y,Text as j}from"../../components/index.js";import{withLayout as C}from"../../shared/Styles.js";import{cn as c,getLocalizedPath as I}from"../../helpers/utils.js";import{isVideo as b}from"../../shared/mimeType.js";import{useExposure as L}from"../../hooks/useExposure.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useAiuiContext as D}from"../AiuiProvider/index.js";import{useTracking as S}from"../../hooks/useTracking.js";const r="image",m="member_area",f=T.forwardRef(({data:g,className:k="",...v},h)=>{const{buildRef:N}=S(),{title:t,description:o,backgroundImage:l,mobileBackgroundImage:p,primaryButton:i,secondaryButton:a,theme:B,shape:A,primaryButtonHandler:d,secondaryButtonHandler:q}=g,M=P({query:"(max-width: 768px)"}),n=H(null),{locale:E="us"}=D();z(h,()=>n.current),L(n,{componentType:r,componentName:m,componentTitle:t,componentDescription:o});const $=()=>{console.log("primaryButtonHandler",d),d?.()},w=()=>{q?.()},u="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return s("section",{"data-ui-component-id":"MemberEquity",...v,className:c("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",k,{"aiui-dark":B==="dark","rounded-box":!0,"h-[480px]":M}),ref:n,children:[b(l?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:e("source",{src:l?.url,type:"video/mp4"})}):e(y,{source:l?.url,alt:l?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),b(p?.mimeType)?e("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:e("source",{src:p?.url,type:"video/mp4"})}):e(y,{source:p?.url,alt:p?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),e("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:s("div",{className:`
2
2
  tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5
3
3
  laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4
4
- `,children:[l("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[e(T,{as:"h2",size:3,className:"member-equity-title ",html:t}),e(j,{size:2,className:"member-equity-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]",html:o})]}),l("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[a&&a.text&&l(x,{"aria-label":t??o,variant:"secondary",onClick:E,className:c("member-equity-button-secondary ",u),as:"a",href:I(R(a.link||"",q),`${r}_${m}`),"data-headless-type-name":`${r}#${m}`,"data-headless-title-desc-button":`${t}#${o}#${a.text}`,children:[a.text,e("span",{className:"sr-only",children:t??o})]}),i&&i.text&&e(x,{variant:"primary",onClick:M,className:c("member-equity-button-primary ",u),"data-headless-type-name":`${r}#${m}`,"data-headless-title-desc-button":`${t}#${o}#${i.text}`,children:i.text})]})]})})]})});f.displayName="MemberEquity";var O=C(f);export{O as default};
4
+ `,children:[s("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[e(R,{as:"h2",size:3,className:"member-equity-title ",html:t}),e(j,{size:2,className:"member-equity-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]",html:o})]}),s("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[a&&a.text&&s(x,{"aria-label":t??o,variant:"secondary",onClick:w,className:c("member-equity-button-secondary ",u),as:"a",href:_(I(a.link||"",E),N(r,m)),"data-headless-type-name":`${r}#${m}`,"data-headless-title-desc-button":`${t}#${o}#${a.text}`,children:[a.text,e("span",{className:"sr-only",children:t??o})]}),i&&i.text&&e(x,{variant:"primary",onClick:$,className:c("member-equity-button-primary ",u),"data-headless-type-name":`${r}#${m}`,"data-headless-title-desc-button":`${t}#${o}#${i.text}`,children:i.text})]})]})})]})});f.displayName="MemberEquity";var Y=C(f);export{Y as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import*as n from"react";import kt from"fitty";import{cn as o}from"../../helpers/index.js";import{Button as Lt}from"../../components/index.js";import{Text as y}from"../../components/index.js";import{Heading as u}from"../../components/index.js";import Mt from"./CircleProgress.js";import{useExposure as St}from"../../hooks/useExposure.js";const Nt="cart",Pt="mini_cart",Tt=(f,r)=>f==="notEligible"?{backgroundColor:r?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:f==="gift"?{backgroundColor:r?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},G=n.forwardRef(({className:f,classNames:r={},data:U,cart:s,progressConfig:i,onRemoveItem:X,onCheckout:F,onClickToView:M,...Q},O)=>{const b=n.useRef(null),{copy:p,theme:S="light",locale:It="us",showMobileViewMore:Y=!0,maxQuantityDisplay:w,labelStyles:$}=U||{};St(b,{componentType:Nt,componentName:Pt,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),n.useImperativeHandle(O,()=>b.current);const K=p?.emptyCart||"Your Cart is Empty",N=p?.description||"",Z=p?.itemsInCart||"You have selected {count} items",_=p?.total||"Total {total}",zt=p?.totalWithCoupon||"total: {total} ({subtotal})",P=p?.clickToView||"Click to view cart",J=p?.buyNowText||"Buy Now",tt=p?.savingText||"Saving {amount}",m=n.useMemo(()=>s?.lineItems||[],[s?.lineItems]),T=m.reduce((e,a)=>e+(a?.quantity||0),0),et=T===0,ot=parseFloat(s?.cost?.totalAmount?.amount||"0"),rt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),at=parseFloat(s?.cost?.savingAmount?.amount||"0"),nt=s?.cost?.totalAmount?.formattedPrice||"",I=rt>ot?s?.cost?.subtotalAmount?.formattedPrice:null,z=at>0?s?.cost?.savingAmount?.formattedPrice:null,d=n.useRef(null),[x,it]=n.useState(!1),[A,B]=n.useState(!1),[E,D]=n.useState(null),j=async e=>{if(!E){D(e);try{await X?.(e,s)}finally{D(null)}}},[R,C]=n.useState(!1),[lt,st]=n.useState(0),[ct,pt]=n.useState(0),[H,dt]=n.useState(!1),[V,mt]=n.useState(!0),h=n.useCallback(()=>{const e=d.current;if(!e)return;const{scrollLeft:a,scrollWidth:c,clientWidth:v}=e;dt(a>0),mt(a<c-v-1)},[]),ut=n.useCallback(()=>{h()},[h]);n.useEffect(()=>{h()},[m.length,h]);const gt=m.map(e=>e.productLabel??"").join("|");n.useEffect(()=>{const e=b.current?.querySelectorAll("[data-fit-label]");if(!e?.length)return;const a=Array.from(e,c=>kt(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[gt,x]);const ft=e=>{d.current&&(C(!0),st(e.pageX-d.current.offsetLeft),pt(d.current.scrollLeft))},bt=e=>{if(!R||!d.current)return;e.preventDefault();const c=(e.pageX-d.current.offsetLeft-lt)*1.5;d.current.scrollLeft=ct-c},xt=()=>{C(!1)},ht=()=>{C(!1)},W=e=>{if(d.current){const a=d.current,c=100;a.scrollBy({left:e==="right"?c:-c,behavior:"smooth"})}},k=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),yt=e=>m.length?l("div",{className:o("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",r?.itemsGrid),children:[m.length>=5&&t("button",{onClick:()=>W("left"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!H&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!H}),"aria-label":"Scroll left to see more items",children:t(k,{className:"laptop:size-4 size-5 rotate-180"})}),l("div",{ref:d,onMouseDown:ft,onMouseMove:bt,onMouseUp:xt,onMouseLeave:ht,onScroll:ut,className:o("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R?"cursor-grabbing":"cursor-grab",r?.itemGridContainer),children:[m.filter(a=>a&&a.id).map(a=>{const v=(a.merchandise||{}).image||{},q=v.url,Ct=v.altText||"Product image",L=E===a.id;return l("div",{className:o("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",r?.gridItem),children:[q&&t("img",{src:q,alt:Ct,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),L&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:l("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>j(a.id),className:o("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",L&&"pointer-events-none opacity-0"),"aria-label":"delete",children:l("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:Tt(a.labelVariant,$),children:t("div",{className:"w-full text-center",children:t(y,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:t(y,{className:"whitespace-nowrap text-sm leading-none",html:wt(a.quantity)})}),t("div",{role:"button",onClick:()=>j(a.id),className:o("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",L&&"laptop:hidden",r?.gridItemOverlay),"aria-label":"Remove item",children:t(vt,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),Y&&t("button",{onClick:()=>M?.(s),className:o("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",r?.mobileViewMoreButton),"aria-label":P,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&t("button",{onClick:()=>W("right"),className:o("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!V&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",r?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!V}),"aria-label":"Scroll right to see more items",children:t(k,{className:"laptop:size-4 size-5"})})]}):null,g=!et&&m.length>0,wt=e=>w!==void 0&&e>w?`${w}+`:String(e);return t("div",{ref:b,className:o("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",f,r?.root,{"aiui-dark bg-container-primary":S==="dark"}),...Q,children:l("div",{className:o("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",r?.content),children:[l("div",{className:o("relative flex shrink flex-row items-center gap-2","desktop:gap-4",i&&"laptop:pl-[104px] pl-[72px]"),children:[i&&t(Mt,{totalSteps:i.totalSteps,currentStep:i.currentStep,image:i.image,label:i.label,progressColor:i.progressColor,labelColor:i.labelColor,backgroundColor:i.backgroundColor,size:i.size,laptopSize:i.laptopSize,centerText:i.centerText,dimmed:i.dimmed,dimmedBadge:i.dimmedBadge,trackColor:i.trackColor,classNames:i.classNames,className:o("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",r?.circleProgress)}),l("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:o("tablet:gap-2 flex flex-col gap-1",r?.cartInfo),children:g?l("div",{className:"flex w-full items-center gap-2",children:[t(u,{size:2,as:"h3",className:o("",r?.cartTitle),html:Z.replace("{count}",`<span class="mini-cart-count text-brand-0">${T||0}</span>`)}),l(u,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?it(!x):M?.(s)},className:o("flex cursor-pointer items-center gap-1",r?.expandButton),children:[t(y,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:P}),t(k,{className:o("size-4 transition-transform",x?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(u,{as:"h3",size:2,className:o("tablet:text-2xl text-xl",r?.cartTitle),html:K})}),N&&t(y,{size:2,className:o("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.cartDescription),html:N})]})]}),g&&t("div",{className:o("laptop:block laptop:shrink",x?"block":"hidden"),children:yt(S)}),g&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),l("div",{className:o("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",r?.priceSection),children:[l("div",{className:"flex flex-col items-end justify-center",children:[l("div",{className:"flex items-center gap-2",children:[t(u,{as:"h6",size:2,className:o("whitespace-nowrap text-nowrap",r?.totalPrice),html:_.replace("{total}",nt)}),I&&t(u,{as:"h6",size:2,className:o("text-info-tertiary whitespace-nowrap line-through",r?.originalPrice),html:I})]}),z&&t(u,{size:2,as:"h6",className:o("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",r?.saveAmount),html:tt.replace("{amount}",z)})]}),t(Lt,{disabled:!g,loading:A,onClick:async()=>{if(!A){B(!0);try{await F?.(s)}finally{B(!1)}}},className:o("mini-cart-action-button whitespace-nowrap",r?.actionButton),children:J})]})]})})});G.displayName="MiniCart";var Vt=G;export{Vt as default,Tt as resolveCartLineLabelStyle};
1
+ "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import*as i from"react";import It from"fitty";import{cn as r}from"../../helpers/index.js";import{Button as zt}from"../../components/index.js";import{Text as k}from"../../components/index.js";import{Heading as f}from"../../components/index.js";import At from"./CircleProgress.js";import{useExposure as Bt}from"../../hooks/useExposure.js";import{toPlainTrackingText as x}from"../../shared/track.js";const Q="cart",O="mini_cart",Et=(h,a)=>h==="notEligible"?{backgroundColor:a?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:h==="gift"?{backgroundColor:a?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},Y=i.forwardRef(({className:h,classNames:a={},data:K,cart:c,progressConfig:l,onRemoveItem:Z,onCheckout:_,onClickToView:T,...J},tt)=>{const v=i.useRef(null),{copy:p,theme:I="light",locale:Dt="us",showMobileViewMore:et=!0,maxQuantityDisplay:L,labelStyles:ot}=K||{};Bt(v,{componentType:Q,componentName:O,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),i.useImperativeHandle(tt,()=>v.current);const rt=p?.emptyCart||"Your Cart is Empty",z=p?.description||"",at=p?.itemsInCart||"You have selected {count} items",nt=p?.total||"Total {total}",jt=p?.totalWithCoupon||"total: {total} ({subtotal})",y=p?.clickToView||"Click to view cart",A=p?.buyNowText||"Buy Now",it=x(p?.itemsInCart||"Mini Cart"),lt=x(p?.description),u=(e,o=1,n)=>({"data-headless-type-name":`${Q}#${O}`,"data-headless-title-desc-button":`${n?.title??it}#${lt}#${x(e)}`,"data-headless-nav-position":`#${o}`,...n?.sku?{"data-headless-sku":n.sku}:{}}),st=p?.savingText||"Saving {amount}",m=i.useMemo(()=>c?.lineItems||[],[c?.lineItems]),B=m.reduce((e,o)=>e+(o?.quantity||0),0),ct=B===0,pt=parseFloat(c?.cost?.totalAmount?.amount||"0"),dt=parseFloat(c?.cost?.subtotalAmount?.amount||"0"),mt=parseFloat(c?.cost?.savingAmount?.amount||"0"),ut=c?.cost?.totalAmount?.formattedPrice||"",E=dt>pt?c?.cost?.subtotalAmount?.formattedPrice:null,D=mt>0?c?.cost?.savingAmount?.formattedPrice:null,d=i.useRef(null),[w,gt]=i.useState(!1),[j,R]=i.useState(!1),[H,V]=i.useState(null),W=async e=>{if(!H){V(e);try{await Z?.(e,c)}finally{V(null)}}},[$,M]=i.useState(!1),[ft,bt]=i.useState(0),[xt,ht]=i.useState(0),[q,vt]=i.useState(!1),[G,yt]=i.useState(!0),C=i.useCallback(()=>{const e=d.current;if(!e)return;const{scrollLeft:o,scrollWidth:n,clientWidth:g}=e;vt(o>0),yt(o<n-g-1)},[]),wt=i.useCallback(()=>{C()},[C]);i.useEffect(()=>{C()},[m.length,C]);const Ct=m.map(e=>e.productLabel??"").join("|");i.useEffect(()=>{const e=v.current?.querySelectorAll("[data-fit-label]");if(!e?.length)return;const o=Array.from(e,n=>It(n,{minSize:8,maxSize:12,multiLine:!1}));return()=>o.forEach(n=>n.unsubscribe())},[Ct,w]);const kt=e=>{d.current&&(M(!0),bt(e.pageX-d.current.offsetLeft),ht(d.current.scrollLeft))},Lt=e=>{if(!$||!d.current)return;e.preventDefault();const n=(e.pageX-d.current.offsetLeft-ft)*1.5;d.current.scrollLeft=xt-n},Mt=()=>{M(!1)},St=()=>{M(!1)},U=e=>{if(d.current){const o=d.current,n=100;o.scrollBy({left:e==="right"?n:-n,behavior:"smooth"})}},S=({className:e})=>t("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),Nt=({className:e})=>t("svg",{className:e,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Pt=e=>m.length?s("div",{className:r("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",a?.itemsGrid),children:[m.length>=5&&t("button",{onClick:()=>U("left"),...u("prev"),className:r("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!q&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",a?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!q}),"aria-label":"Scroll left to see more items",children:t(S,{className:"laptop:size-4 size-5 rotate-180"})}),s("div",{ref:d,onMouseDown:kt,onMouseMove:Lt,onMouseUp:Mt,onMouseLeave:St,onScroll:wt,className:r("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",$?"cursor-grabbing":"cursor-grab",a?.itemGridContainer),children:[m.filter(o=>o&&o.id).map((o,n)=>{const g=o.merchandise||{},X=g.image||{},F=X.url,N=X.altText||"Product image",P=H===o.id;return s("div",{className:r("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",a?.gridItem),children:[F&&t("img",{src:F,alt:N,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),P&&t("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:s("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[t("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),t("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),t("span",{role:"button",onClick:()=>W(o.id),...u("delete",n+1,{title:x(g.title??N),sku:g.sku}),className:r("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",P&&"pointer-events-none opacity-0"),"aria-label":"delete",children:s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[t("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),t("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),o.productLabel&&t("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:t("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:Et(o.labelVariant,ot),children:t("div",{className:"w-full text-center",children:t(k,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:o.productLabel})})})}),o.quantity>1&&t("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:t(k,{className:"whitespace-nowrap text-sm leading-none",html:Tt(o.quantity)})}),t("div",{role:"button",onClick:()=>W(o.id),...u("delete",n+1,{title:x(g.title??N),sku:g.sku}),className:r("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",P&&"laptop:hidden",a?.gridItemOverlay),"aria-label":"Remove item",children:t(Nt,{className:"pointer-events-none size-[20px] text-white"})})]},o.id)}),et&&t("button",{onClick:()=>T?.(c),...u(y),className:r("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",a?.mobileViewMoreButton),"aria-label":y,children:t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:t("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m.length>=5&&t("button",{onClick:()=>U("right"),...u("next"),className:r("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!G&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",a?.expandButton,{"laptop:bg-container-secondary-0":e==="dark","laptop:bg-container-primary":e==="dark"&&!G}),"aria-label":"Scroll right to see more items",children:t(S,{className:"laptop:size-4 size-5"})})]}):null,b=!ct&&m.length>0,Tt=e=>L!==void 0&&e>L?`${L}+`:String(e);return t("div",{ref:v,className:r("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",h,a?.root,{"aiui-dark bg-container-primary":I==="dark"}),...J,children:s("div",{className:r("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",a?.content),children:[s("div",{className:r("relative flex shrink flex-row items-center gap-2","desktop:gap-4",l&&"laptop:pl-[104px] pl-[72px]"),children:[l&&t(At,{totalSteps:l.totalSteps,currentStep:l.currentStep,image:l.image,label:l.label,progressColor:l.progressColor,labelColor:l.labelColor,backgroundColor:l.backgroundColor,size:l.size,laptopSize:l.laptopSize,centerText:l.centerText,dimmed:l.dimmed,dimmedBadge:l.dimmedBadge,trackColor:l.trackColor,classNames:l.classNames,className:r("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",a?.circleProgress)}),s("div",{className:"laptop:flex-1 flex w-full flex-col",children:[t("div",{className:r("tablet:gap-2 flex flex-col gap-1",a?.cartInfo),children:b?s("div",{className:"flex w-full items-center gap-2",children:[t(f,{size:2,as:"h3",className:r("",a?.cartTitle),html:at.replace("{count}",`<span class="mini-cart-count text-brand-0">${B||0}</span>`)}),s(f,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?gt(!w):T?.(c)},...u(y),className:r("flex cursor-pointer items-center gap-1",a?.expandButton),children:[t(k,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:y}),t(S,{className:r("size-4 transition-transform",w?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):t(f,{as:"h3",size:2,className:r("tablet:text-2xl text-xl",a?.cartTitle),html:rt})}),z&&t(k,{size:2,className:r("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",a?.cartDescription),html:z})]})]}),b&&t("div",{className:r("laptop:block laptop:shrink",w?"block":"hidden"),children:Pt(I)}),b&&t("hr",{className:"laptop:hidden border-lines w-full border-t"}),s("div",{className:r("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",a?.priceSection),children:[s("div",{className:"flex flex-col items-end justify-center",children:[s("div",{className:"flex items-center gap-2",children:[t(f,{as:"h6",size:2,className:r("whitespace-nowrap text-nowrap",a?.totalPrice),html:nt.replace("{total}",ut)}),E&&t(f,{as:"h6",size:2,className:r("text-info-tertiary whitespace-nowrap line-through",a?.originalPrice),html:E})]}),D&&t(f,{size:2,as:"h6",className:r("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",a?.saveAmount),html:st.replace("{amount}",D)})]}),t(zt,{disabled:!b,loading:j,onClick:async()=>{if(!j){R(!0);try{await _?.(c)}finally{R(!1)}}},...u(A),className:r("mini-cart-action-button whitespace-nowrap",a?.actionButton),children:A})]})]})})});Y.displayName="MiniCart";var Xt=Y;export{Xt as default,Et as resolveCartLineLabelStyle};
@@ -1 +1 @@
1
- import{Fragment as D,jsx as t,jsxs as l}from"react/jsx-runtime";import Q,{useState as L,useEffect as Y,useRef as q}from"react";import{useMediaQuery as O}from"react-responsive";import Z from"./MultiLayoutGraphicBlockCarousel.js";import{withLayout as F}from"../../shared/Styles.js";import z from"../../components/picture.js";import R from"../../components/button.js";import{Heading as j}from"../../components/heading.js";import{VideoModal as J}from"../VideoModal/index.js";import{Grid as K,GridItem as E}from"../../components/grid.js";import W from"../Title/index.js";import{cn as P,spaceToHyphen as I,getLocalizedPath as G}from"../../helpers/utils.js";import S from"../SwiperBox/index.js";import{isVideo as H}from"../../shared/mimeType.js";import{Tabs as X,TabsList as ee,TabsTrigger as te,TabsContent as ae}from"../../components/tabs.js";import{useExposure as se}from"../../hooks/useExposure.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useAiuiContext as oe}from"../AiuiProvider/index.js";import{gaTrack as le}from"../../shared/track.js";const h="image",k="p1_banner",$=({data:b,configuration:o,jIndex:d,spanType:T,title:w,onSecondaryButtonClick:u,onPrimaryButtonClick:N})=>{const[i,M]=L(!1),m=O({query:"(max-width: 768px)"}),n=q(null),C=()=>{if(T)switch(T){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(o?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};se(n,{componentType:h,componentName:k,position:d,componentTitle:b.title,componentDescription:b.description,navigation:o?.activeTab}),Y(()=>{M(m)},[m]);const{theme:V="light",title:r,description:c,imageUrl:p,primaryButton:g,secondaryButton:s,imageMobileUrl:y,blockLink:v,video:f,youtubeId:B,isYouTube:x,id:e}=b,a="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return l("div",{className:P("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",C(),{"rounded-box":!0,"aiui-dark":V==="dark","h-[400px]":i},"text-info-primary"),ref:n,children:[(v||s.link)&&t("a",{className:"absolute inset-0 z-10",href:_(G(v||s.link||"",o?.locale||"us"),`${h}_${k}`),"data-headless-type-name":`${h}#${k}`,"data-headless-title-desc-button":`${r}#${c}`,"data-headless-nav-position":`${o?.activeTab}#${d}`,"aria-hidden":"true",tabIndex:-1}),l("div",{className:"absolute inset-0",children:[H(p?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:t("source",{src:p?.url,type:"video/mp4"})}):t(z,{source:p?.url,alt:p?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${p?.width}/${p?.height}`}}),H(y?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:t("source",{src:y?.url,type:"video/mp4"})}):t(z,{source:y?.url||p?.url,alt:y?.alt||p?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"})]}),l("div",{className:P("pointer-events-none absolute inset-0 z-20 flex flex-col",T==="full"?"laptop:justify-center justify-end":"justify-end"),children:[l("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[l("div",{className:"flex flex-col gap-1",children:[t(j,{size:3,as:"h3",className:"item-title",html:r}),t(j,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px]",html:c})]}),l("div",{className:"lg-desktop:gap-3 flex gap-2",children:[s&&s.text&&l(R,{"aria-label":r??c,className:P(a,"link-left"),variant:"secondary",as:"a","data-track":`${e}-link-left`,onClick:()=>{u?.(b)},href:_(G(s.link||"",o?.locale||"us"),`${h}_${k}`),"data-headless-type-name":`${h}#${k}`,"data-headless-title-desc-button":`${r}#${c}#${s.text}`,"data-headless-nav-position":`${o?.activeTab}#${d}`,children:[s.text,t("span",{className:"sr-only",children:r??c})]}),g&&g.text&&t(R,{"aria-label":r??c,className:P(a,"link-right"),variant:"primary","data-track":`${e}-link-right`,as:"a",onClick:()=>{N?.(b)},href:_(G(g.link||"",o?.locale||"us"),`${h}_${k}`),"data-headless-type-name":`${h}#${k}`,"data-headless-title-desc-button":`${r}#${c}#${g.text}`,"data-headless-nav-position":`${o?.activeTab}#${d}`,children:g.text})]})]}),(f?.url||B)&&t("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:t("button",{onClick:()=>{o?.onVideoPlayBtnClick?.(x&&B?B:f?.url||B,x)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},U=Q.forwardRef((b,o)=>{const{data:d,className:T,onSecondaryButtonClick:w,onPrimaryButtonClick:u,...N}=b,{sectionTitle:i,groupByTab:M=!1,items:m=[],carousel:n}=d,[C,V]=L(!1),[r,c]=L(""),[p,g]=L(""),{locale:s="us"}=oe(),y=e=>{switch(e){case"full":return 12;case"half":return 6;case"one-third":return 4}},v=m.map(e=>e.tabName).filter(Boolean).filter((e,a,A)=>A.indexOf(e)===a),f=(e,a)=>{V(!0),a?g?.(e||""):c?.(e||"")},B=(e,a)=>{switch(e){case 1:return 1;case 2:return 2;default:return a?2.3:3}},x=v.map(e=>({tabName:e,items:m.filter(a=>a.tabName===e)})).reduce((e,a)=>(e[a.tabName]=a.items,e),{});return d.mode==="carousel"&&m.length>0?t(Z,{data:d,onPrimaryButtonClick:u,onSecondaryButtonClick:w,className:T,ref:o,...N}):l("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:o,...N,className:P("multiLayoutGraphicBlock","text-info-primary",T),children:[i&&t(W,{data:{title:i},className:"section-title"}),M?l(X,{align:"left",defaultValue:I(v[0]),children:[t(ee,{children:v.map((e,a)=>t(te,{value:I(e),onClick:()=>{le({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:h,component_name:k,component_title:i,component_position:1,navigation:e,button_name:e}})},children:e},a))}),v.map((e,a)=>t(ae,{value:I(e),className:"desktop:mt-[36px] mt-[24px] w-full",children:l(D,{children:[t(S,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:x?.[e]||[],configuration:{isTab:M,activeTab:e,title:i,num:x?.[e]?.length||0,locale:s,onVideoPlayBtnClick:f,onSecondaryButtonClick:w,onPrimaryButtonClick:u}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:B(x?.[e]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:B(x?.[e]?.length||0)}}}),n&&n?.items.length>0?t(S,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:n?.items||[],configuration:{isTab:M,locale:s,onVideoPlayBtnClick:f,title:i,onSecondaryButtonClick:w,onPrimaryButtonClick:u}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},a))]}):l(D,{children:[l(K,{className:"w-full",children:[m.map((e,a)=>t(E,{span:y(e.width??"full"),className:"laptop:block hidden",children:t($,{data:e,configuration:{locale:s,onVideoPlayBtnClick:f,title:i},jIndex:a,spanType:e.width,onSecondaryButtonClick:w,onPrimaryButtonClick:u})},`${e?.title||""}${a}`)),m.map((e,a)=>t(E,{span:y("full"),className:"laptop:hidden block",children:t($,{data:e,configuration:{locale:s,onVideoPlayBtnClick:f,title:i},jIndex:a,spanType:"full",onSecondaryButtonClick:w,onPrimaryButtonClick:u})},`${e?.title||""}${a}`))]}),n&&n?.items.length>0?t(S,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:n?.items||[],configuration:{locale:s,onVideoPlayBtnClick:f,title:i,onSecondaryButtonClick:w,onPrimaryButtonClick:u}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),C&&t(J,{visible:C,youTubeId:p,videoUrl:r,onCloseModal:()=>V(!1)})]})});U.displayName="MultiLayoutGraphicBlock";var Te=F(U,{container:{desktopSpan:12,mobileSpan:12}});export{Te as default};
1
+ import{Fragment as A,jsx as t,jsxs as l}from"react/jsx-runtime";import Q,{useState as L,useEffect as Y,useRef as q}from"react";import{useMediaQuery as O}from"react-responsive";import Z from"./MultiLayoutGraphicBlockCarousel.js";import{withLayout as F}from"../../shared/Styles.js";import R from"../../components/picture.js";import j from"../../components/button.js";import{Heading as E}from"../../components/heading.js";import{VideoModal as J}from"../VideoModal/index.js";import{Grid as K,GridItem as H}from"../../components/grid.js";import W from"../Title/index.js";import{cn as P,spaceToHyphen as G,getLocalizedPath as S}from"../../helpers/utils.js";import _ from"../SwiperBox/index.js";import{isVideo as U}from"../../shared/mimeType.js";import{Tabs as X,TabsList as ee,TabsTrigger as te,TabsContent as ae}from"../../components/tabs.js";import{useExposure as se}from"../../hooks/useExposure.js";import{trackUrlRef as z}from"../../shared/trackUrlRef.js";import{useAiuiContext as oe}from"../AiuiProvider/index.js";import{gaTrack as le}from"../../shared/track.js";import{useTracking as ie}from"../../hooks/useTracking.js";const b="image",w="p1_banner",N=({data:g,configuration:s,jIndex:f,spanType:B,title:y,onSecondaryButtonClick:h,onPrimaryButtonClick:C})=>{const{buildRef:o}=ie(),[x,v]=L(!1),r=O({query:"(max-width: 768px)"}),T=q(null),$=()=>{if(B)switch(B){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(s?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};se(T,{componentType:b,componentName:w,position:f,componentTitle:g.title,componentDescription:g.description,navigation:s?.activeTab}),Y(()=>{v(r)},[r]);const{theme:I="light",title:c,description:d,imageUrl:p,primaryButton:i,secondaryButton:n,imageMobileUrl:u,blockLink:k,video:M,youtubeId:m,isYouTube:e,id:a}=g,V="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return l("div",{className:P("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",$(),{"rounded-box":!0,"aiui-dark":I==="dark","h-[400px]":x},"text-info-primary"),ref:T,children:[(k||n.link)&&t("a",{className:"absolute inset-0 z-10",href:z(S(k||n.link||"",s?.locale||"us"),o(b,w)),"data-headless-type-name":`${b}#${w}`,"data-headless-title-desc-button":`${c}#${d}`,"data-headless-nav-position":`${s?.activeTab}#${f}`,"aria-hidden":"true",tabIndex:-1}),l("div",{className:"absolute inset-0",children:[U(p?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:t("source",{src:p?.url,type:"video/mp4"})}):t(R,{source:p?.url,alt:p?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${p?.width}/${p?.height}`}}),U(u?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:t("source",{src:u?.url,type:"video/mp4"})}):t(R,{source:u?.url||p?.url,alt:u?.alt||p?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"})]}),l("div",{className:P("pointer-events-none absolute inset-0 z-20 flex flex-col",B==="full"?"laptop:justify-center justify-end":"justify-end"),children:[l("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[l("div",{className:"flex flex-col gap-1",children:[t(E,{size:3,as:"h3",className:"item-title",html:c}),t(E,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px]",html:d})]}),l("div",{className:"lg-desktop:gap-3 flex gap-2",children:[n&&n.text&&l(j,{"aria-label":c??d,className:P(V,"link-left"),variant:"secondary",as:"a","data-track":`${a}-link-left`,onClick:()=>{h?.(g)},href:z(S(n.link||"",s?.locale||"us"),o(b,w)),"data-headless-type-name":`${b}#${w}`,"data-headless-title-desc-button":`${c}#${d}#${n.text}`,"data-headless-nav-position":`${s?.activeTab}#${f}`,children:[n.text,t("span",{className:"sr-only",children:c??d})]}),i&&i.text&&t(j,{"aria-label":c??d,className:P(V,"link-right"),variant:"primary","data-track":`${a}-link-right`,as:"a",onClick:()=>{C?.(g)},href:z(S(i.link||"",s?.locale||"us"),o(b,w)),"data-headless-type-name":`${b}#${w}`,"data-headless-title-desc-button":`${c}#${d}#${i.text}`,"data-headless-nav-position":`${s?.activeTab}#${f}`,children:i.text})]})]}),(M?.url||m)&&t("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:t("button",{onClick:()=>{s?.onVideoPlayBtnClick?.(e&&m?m:M?.url||m,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},D=Q.forwardRef((g,s)=>{const{data:f,className:B,onSecondaryButtonClick:y,onPrimaryButtonClick:h,...C}=g,{sectionTitle:o,groupByTab:x=!1,items:v=[],carousel:r}=f,[T,$]=L(!1),[I,c]=L(""),[d,p]=L(""),{locale:i="us"}=oe(),n=e=>{switch(e){case"full":return 12;case"half":return 6;case"one-third":return 4}},u=v.map(e=>e.tabName).filter(Boolean).filter((e,a,V)=>V.indexOf(e)===a),k=(e,a)=>{$(!0),a?p?.(e||""):c?.(e||"")},M=(e,a)=>{switch(e){case 1:return 1;case 2:return 2;default:return a?2.3:3}},m=u.map(e=>({tabName:e,items:v.filter(a=>a.tabName===e)})).reduce((e,a)=>(e[a.tabName]=a.items,e),{});return f.mode==="carousel"&&v.length>0?t(Z,{data:f,onPrimaryButtonClick:h,onSecondaryButtonClick:y,className:B,ref:s,...C}):l("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:s,...C,className:P("multiLayoutGraphicBlock","text-info-primary",B),children:[o&&t(W,{data:{title:o},className:"section-title"}),x?l(X,{align:"left",defaultValue:G(u[0]),children:[t(ee,{children:u.map((e,a)=>t(te,{value:G(e),onClick:()=>{le({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:b,component_name:w,component_title:o,component_position:1,navigation:e,button_name:e}})},children:e},a))}),u.map((e,a)=>t(ae,{value:G(e),className:"desktop:mt-[36px] mt-[24px] w-full",children:l(A,{children:[t(_,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:m?.[e]||[],configuration:{isTab:x,activeTab:e,title:o,num:m?.[e]?.length||0,locale:i,onVideoPlayBtnClick:k,onSecondaryButtonClick:y,onPrimaryButtonClick:h}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:M(m?.[e]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:M(m?.[e]?.length||0)}}}),r&&r?.items.length>0?t(_,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:r?.items||[],configuration:{isTab:x,locale:i,onVideoPlayBtnClick:k,title:o,onSecondaryButtonClick:y,onPrimaryButtonClick:h}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},a))]}):l(A,{children:[l(K,{className:"w-full",children:[v.map((e,a)=>t(H,{span:n(e.width??"full"),className:"laptop:block hidden",children:t(N,{data:e,configuration:{locale:i,onVideoPlayBtnClick:k,title:o},jIndex:a,spanType:e.width,onSecondaryButtonClick:y,onPrimaryButtonClick:h})},`${e?.title||""}${a}`)),v.map((e,a)=>t(H,{span:n("full"),className:"laptop:hidden block",children:t(N,{data:e,configuration:{locale:i,onVideoPlayBtnClick:k,title:o},jIndex:a,spanType:"full",onSecondaryButtonClick:y,onPrimaryButtonClick:h})},`${e?.title||""}${a}`))]}),r&&r?.items.length>0?t(_,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:r?.items||[],configuration:{locale:i,onVideoPlayBtnClick:k,title:o,onSecondaryButtonClick:y,onPrimaryButtonClick:h}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),T&&t(J,{visible:T,youTubeId:d,videoUrl:I,onCloseModal:()=>$(!1)})]})});D.displayName="MultiLayoutGraphicBlock";var Pe=F(D,{container:{desktopSpan:12,mobileSpan:12}});export{Pe as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import f,{useRef as b,useImperativeHandle as x}from"react";import{Heading as p,Button as _,Picture as N,Text as k}from"../../components/index.js";import{cn as g}from"../../helpers/utils.js";import{withLayout as H}from"../../shared/Styles.js";import{useExposure as v}from"../../hooks/useExposure.js";const P="image",w="product_hero",l=f.forwardRef(({data:c,className:i},m)=>{const{title:s,subtitle:e,ctaText:a,poster:u,mobPoster:n,ctaLink:d,theme:h="light"}=c,o=b(null);return v(o,{componentType:P,componentName:w,componentTitle:s,componentDescription:e}),x(m,()=>o.current),r("section",{ref:o,"data-ui-component-id":"ProductHero",className:g("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"},i),children:[r("div",{className:"product-hero__content tablet:basis-[42%] laptop:basis-[36%] flex w-full flex-col items-start gap-[24px]",children:[r("div",{className:"product-hero__text",children:[t(p,{as:"h3",size:4,html:s,className:"product-hero__title"}),t(p,{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(k,{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"})]}),a&&t("a",{href:d,className:"product-hero__cta-link",children:t(_,{className:"product-hero__cta-button w-fit",children:a})})]}),t(N,{className:"product-hero__image tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%] rounded-box aspect-[358/360] shrink",source:`${u?.url}, ${n?.url} 768`,imgClassName:"h-full object-cover"})]})});l.displayName="ProductHero";var R=H(l);export{R as default};
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 +1 @@
1
- "use client";import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useState as F,useEffect as b,useCallback as G,forwardRef as V,useImperativeHandle as _,useRef as v}from"react";import{cn as E}from"../../helpers/utils.js";import{withLayout as $}from"../../shared/Styles.js";import{Button as C,Link as q,Text as P}from"../../components/index.js";import{useExposure as O}from"../../hooks/useExposure.js";import*as S from"@radix-ui/react-popover";const W="navigation",J="product_nav",y=c=>c.anchorId??c.id??"",K=c=>o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c,children:o("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),M=V(({className:c="",data:D,id:H,onAnchorClick:R,scrollOffsetExtra:T=0},I)=>{const{tabLinks:h=[],anchorList:s=[],textLink:l,buyBtn:p,theme:B="light"}=D||{},[z,x]=F(""),u=v(null),g=v(!1),m=v(""),f=v(null),N=v(new Map);_(I,()=>u.current),O(u,{componentType:W,componentName:J});const w=G(()=>{if(s.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;s.forEach(r=>{const n=y(r),i=document.getElementById(n);if(i){const k=i.getBoundingClientRect();t.set(n,k.top+window.scrollY)}}),N.current=t,window.scrollTo({top:e,behavior:"instant"})})},[s]);b(()=>{if(s.length===0)return;const e=setTimeout(w,100);return()=>clearTimeout(e)},[s,w]),b(()=>{if(s.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(w,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[s,w]),b(()=>{if(s.length===0)return;const e=()=>{if(g.current){f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{g.current=!1,m.current&&(x(m.current),m.current="")},100);return}const r=u.current?.offsetHeight||0,n=window.scrollY+r+T+10;let i="";const k=N.current;for(let d=s.length-1;d>=0;d--){const Y=s[d],L=y(Y),A=k.get(L);if(A!==void 0&&n>=A){i=L;break}}if(!i&&s.length>0){const d=k.get(y(s[0]));d!==void 0&&n<d&&(i="")}x(i)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),f.current&&clearTimeout(f.current)}},[s,T]),b(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(r=>{const n=r;t.push({element:n,originalPosition:n.style.position||getComputedStyle(n).position}),n.style.position="relative"}),()=>{t.forEach(({element:r,originalPosition:n})=>{r.style.position=n==="static"?"":n})}},[]);const j=(e,t)=>{e.preventDefault();const r=N.current.get(t);if(r===void 0){console.warn(`Cached position for "${t}" not found`);return}x(t),m.current=t,g.current=!0;const n=u.current?.offsetHeight||0,i=r-n-T;window.scrollTo({top:i,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return a("div",{id:H,ref:u,className:E("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":B==="dark"},c),children:[a("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[a("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:[a("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[h.map((e,t)=>a("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[o("a",{href:e.link,className:E("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!==h.length-1&&o("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||t)),h.length>1&&a(S.Root,{children:[o(S.Trigger,{asChild:!0,children:o("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:o(K,{className:"text-[#1D1D1F]"})})}),o(S.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:h.slice(1).map(e=>o("a",{href:e.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:o("span",{children:e.label})},e.link))})]})]}),a("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[l?.link&&o("a",{href:l.link,target:l.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:o(P,{size:2,className:"text-nowrap",children:l.text})}),p?.link&&o(C,{as:"a",href:p.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:p.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 r=y(e);return a("a",{href:`#${r}`,className:"product-nav-anchor-link",onClick:n=>{R?(n.preventDefault(),x(r),m.current=r,g.current=!0,R(e,t)):j(n,r)},children:[o(P,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),o("div",{className:E("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":z===r})})]},r)})})]}),a("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[l?.link&&o(q,{href:l.link,target:l.target||"_self",className:"product-nav-text-link no-underline",children:o(P,{size:2,className:"text-nowrap",children:l.text})}),p?.link&&o(C,{as:"a",href:p.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:p.text})]})]})});M.displayName="ProductNav";var te=$(M);export{te as default};
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 k=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 b=l.getBoundingClientRect();t.set(r,b.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[s]);y(()=>{if(s.length===0)return;const e=setTimeout(k,100);return()=>clearTimeout(e)},[s,k]),y(()=>{if(s.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(k,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[s,k]),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 b=S.current;for(let m=s.length-1;m>=0;m--){const V=s[m],M=P(V),H=b.get(M);if(H!==void 0&&r>=H){l=M;break}}if(!l&&s.length>0){const m=b.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 tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 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,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Media, Theme } from '../../types/props.js';
3
+ import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical';
3
4
  export interface PromotionalBarSemanticName {
4
5
  root: 'root';
5
6
  content: 'content';
@@ -27,8 +28,8 @@ export interface ResponsiveBackgroundImage {
27
28
  */
28
29
  export interface PromotionalBarData {
29
30
  theme: Theme;
30
- /** 组件内容标题 */
31
- contentTitle?: string;
31
+ /** 组件内容标题(HTML 字符串或 CMS 的 Lexical 富文本) */
32
+ contentTitle?: string | SerializedEditorState;
32
33
  /** 组件内容描述 */
33
34
  contentDesc?: string;
34
35
  /** 按钮文本 */
@@ -1 +1 @@
1
- "use client";import{jsx as l,jsxs as h}from"react/jsx-runtime";import*as g from"react";import{cn as s}from"../../helpers/index.js";import{Heading as k,Button as v,Picture as B}from"../../components/index.js";import{withLayout as P}from"../../shared/Styles.js";import{getLocalizedPath as T}from"../../helpers/index.js";import{useAiuiContext as M}from"../AiuiProvider/index.js";import{trackUrlRef as N}from"../../shared/trackUrlRef.js";const D="image",y="PromotionalBar",R=i=>{if(!i)return;const{mobile:e,tablet:m,laptop:u,desktop:d,lgDesktop:f}=i,t=[],r=b=>b?.url,o=r(f),n=r(d),a=r(u),p=r(m),c=r(e);return o?t.push(o):n?t.push(n):a?t.push(a):p?t.push(p):c&&t.push(c),n&&o&&t.push(`${n} 1920`),a&&(n||o)&&t.push(`${a} 1440`),p&&(a||n||o)&&t.push(`${p} 1024`),c&&(p||a||n||o)&&t.push(`${c} 768`),t.length>0?t.join(", "):void 0},x=g.forwardRef(({classNames:i,data:e,className:m,...u},d)=>{const{locale:f="us",pageHandle:t}=M(),{backgroundImage:r,theme:o="dark"}=e,n=g.useMemo(()=>R(r),[r]);return l("div",{ref:d,...u,className:s("laptop:h-[192px] lg-desktop:h-[240px] h-[240px] text-[#080A0F]",{"text-[#F5F6F7]":o==="dark"},i?.root,m),children:h("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[h("div",{className:s("laptop:px-8 laptop:justify-center laptop:box-content lg-desktop:max-w-[686px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",i?.content),children:[e.contentTitle&&l(k,{className:s("line-clamp-2 ",i?.title),html:e.contentTitle,size:3}),e.contentDesc&&l("p",{className:s("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] ",i?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),l("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&l(v,{as:"a",variant:"link",className:s("!p-0 text-[#F5F6F7]",{"text-[#080A0F]":o==="light"},i?.button),href:N(T(e.buttonLink||"",f),`${t}_${D}_${y}`),iconClassName:"size-4",children:e.buttonText})})]}),l(B,{source:n,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});x.displayName="PromotionalBar";var I=P(x);export{I as default};
1
+ "use client";import{jsx as a,jsxs as k}from"react/jsx-runtime";import*as m from"react";import{cn as p}from"../../helpers/index.js";import{Heading as T,Button as B,Picture as D}from"../../components/index.js";import{withLayout as P}from"../../shared/Styles.js";import{getLocalizedPath as M}from"../../helpers/index.js";import{useAiuiContext as N}from"../AiuiProvider/index.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as y}from"../../shared/track.js";import{useExposure as L}from"../../hooks/useExposure.js";import{useTracking as S}from"../../hooks/useTracking.js";const g="image",h="PromotionalBar",F=r=>{if(!r)return;const{mobile:t,tablet:u,laptop:d,desktop:f,lgDesktop:x}=r,e=[],l=v=>v?.url,n=l(x),i=l(f),o=l(d),s=l(u),c=l(t);return n?e.push(n):i?e.push(i):o?e.push(o):s?e.push(s):c&&e.push(c),i&&n&&e.push(`${i} 1920`),o&&(i||n)&&e.push(`${o} 1440`),s&&(o||i||n)&&e.push(`${s} 1024`),c&&(s||o||i||n)&&e.push(`${c} 768`),e.length>0?e.join(", "):void 0},b=m.forwardRef(({classNames:r,data:t,className:u,...d},f)=>{const{locale:x="us"}=N(),{buildRef:e}=S(),{backgroundImage:l,theme:n="dark"}=t,i=m.useMemo(()=>F(l),[l]),o=m.useRef(null);return m.useImperativeHandle(f,()=>o.current),L(o,{componentType:g,componentName:h,componentTitle:t.contentTitle,componentDescription:t.contentDesc}),a("div",{ref:o,...d,className:p("laptop:h-[192px] lg-desktop:h-[240px] h-[240px] text-[#080A0F]",{"text-[#F5F6F7]":n==="dark"},r?.root,u),children:k("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[k("div",{className:p("laptop:px-8 laptop:justify-center laptop:box-content lg-desktop:max-w-[686px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",r?.content),children:[t.contentTitle&&a(T,{className:p("line-clamp-2 ",r?.title),html:t.contentTitle,size:3}),t.contentDesc&&a("p",{className:p("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] ",r?.description),dangerouslySetInnerHTML:{__html:t.contentDesc}}),a("div",{className:"laptop:mt-4 mt-2",children:t.buttonText&&a(B,{as:"a",variant:"link",className:p("!p-0 text-[#F5F6F7]",{"text-[#080A0F]":n==="light"},r?.button),href:R(M(t.buttonLink||"",x),e(g,h)),...y({interactive:!!t.buttonLink,componentType:g,componentName:h,title:t.contentTitle,description:t.contentDesc,buttonName:t.buttonText}),iconClassName:"size-4",children:t.buttonText})})]}),a(D,{source:i,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});b.displayName="PromotionalBar";var j=P(b);export{j as default};