1import{r as h,j as t}from"./vendor-EiF2_rkB-chunk.js";import{S as T,W as U}from"../index.BTIofEqN.js";import{B as q}from"./BreakPointHooks-CE6K3e8_-chunk.js";import"./virtual_tailwind-screens-CDzlv0Qh-chunk.js";const{useGreater:A}=q(),Z=({mobileXCoordinate:v,mobileYCoordinate:C,desktopXCoordinate:$,desktopYCoordinate:N,productItemViewModel:l,productItem:B,mediaRef:p})=>{var k,y,H,S,D;const d=A("lg"),[r,c]=h.useState(!1),o=(k=l==null?void 0:l.priceVM)==null?void 0:k.campaignPrice,s=(y=l==null?void 0:l.priceVM)==null?void 0:y.clubPrice,e=(H=l==null?void 0:l.priceVM)==null?void 0:H.basePrice,n=(S=l==null?void 0:l.priceVM)==null?void 0:S.buyXCampaignPrice,f=(D=l==null?void 0:l.priceVM)==null?void 0:D.buyXCampaignPricePerUnitText,i=h.useRef(null),[m,F]=h.useState({height:0,width:0}),[L,G]=h.useState({left:0,top:0}),a=24;return h.useEffect(()=>{const E=()=>{if(i.current&&p.current){const W=p.current.offsetHeight,g=p.current.offsetWidth,j=i.current.offsetHeight,x=i.current.offsetWidth;F({height:j,width:x});const R=d?W*(N/100):g*(C/100),z=d?W*($/100):g*(v/100);G({left:z<x/2?0:g-z<x/2?-x+a:-x/2+a/2,top:R<j?-j+a:0})}};window.addEventListener("resize",E),E()},[d]),l&&t.jsxs("button",{className:"absolute bottom-[var(--mobile-bottom)] left-[var(--mobile-left)] rounded-2xl bg-white lg:bottom-[var(--desktop-bottom)] lg:left-[var(--desktop-left)]",style:{height:`${a}px`,width:`${a}px`,"--mobile-left":`calc(${v}% - ${a/2}px)`,"--mobile-bottom":`calc(${C}% - ${a/2}px)`,"--desktop-left":`calc(${$}% - ${a/2}px)`,"--desktop-bottom":`calc(${N}% - ${a/2}px)`},onMouseEnter:()=>c(!r),onMouseLeave:()=>c(!r),onClick:()=>c(!r),children:[t.jsx(T,{className:`absolute left-1.5 top-1.5 h-3 w-3 rotate-45 transition-all duration-100 ${r?"z-0 opacity-0":"z-[1] opacity-100 delay-200"}`}),t.jsxs("a",{title:l.name,className:`absolute origin-top overflow-hidden bg-white transition-all duration-300 ${r?"left-[var(--left)] top-[var(--top)] h-[var(--height)] w-[var(--width)]":"pointer-events-none left-0 top-0 h-6 w-6 rounded-2xl"}`,style:{"--left":`${L.left}px`,"--top":`${L.top}px`,"--starting-left":`${a/2}px`,"--starting-top":`${a/2}px`,"--height":`${m.height}px`,"--width":`${m.width}px`},href:l.url,onClick:()=>{U(B.trackingData)},children:[t.jsxs("div",{className:`flex flex-col px-3 py-2 transition-all duration-[150ms] ${r?"opacity-1 delay-200":"opacity-0 delay-0"}`,style:{height:`${m.height}px`,width:`${m.width}px`},children:[t.jsx("p",{className:"whitespace-nowrap text-left font-roboto text-sm font-light text-black lg:text-base",children:l.name}),t.jsxs("ul",{className:"flex flex-col whitespace-nowrap",children:[(s==null?void 0:s.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":s==null?void 0:s.priceListColorCode},className:"text-left font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[s==null?void 0:s.name,": "]}),s==null?void 0:s.formattedPrice]}),(o==null?void 0:o.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":o==null?void 0:o.priceListColorCode},className:"text-left font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[o==null?void 0:o.name,": "]}),o==null?void 0:o.formattedPrice]}),(n==null?void 0:n.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":n==null?void 0:n.priceListColorCode},className:"text-left font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[n==null?void 0:n.name,": "]}),t.jsxs("span",{children:[n==null?void 0:n.formattedPrice," "]}),f&&f]}),(e==null?void 0:e.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":e==null?void 0:e.priceListColorCode},className:"text-left font-roboto text-sm font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[e==null?void 0:e.name,": "]}),e==null?void 0:e.formattedPrice]})]})]}),t.jsxs("div",{ref:i,className:"pointer-events-none invisible absolute flex flex-col px-3 py-2 opacity-0",children:[t.jsx("p",{className:"whitespace-nowrap font-roboto text-sm font-light text-black lg:text-base",children:l.name}),t.jsxs("ul",{className:"flex flex-col whitespace-nowrap",children:[(s==null?void 0:s.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":s==null?void 0:s.priceListColorCode},className:"font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[s==null?void 0:s.name,": "]}),s==null?void 0:s.formattedPrice]}),(o==null?void 0:o.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":o==null?void 0:o.priceListColorCode},className:"font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[o==null?void 0:o.name,": "]}),o==null?void 0:o.formattedPrice]}),(n==null?void 0:n.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":n==null?void 0:n.priceListColorCode},className:"font-roboto text-base font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[n==null?void 0:n.name,": "]}),t.jsxs("span",{children:[n==null?void 0:n.formattedPrice," "]}),f&&f]}),(e==null?void 0:e.formattedPrice.length)>0&&t.jsxs("li",{style:{"--hex-text-color":e==null?void 0:e.priceListColorCode},className:"font-roboto text-sm font-normal leading-normal text-[var(--hex-text-color)] lg:text-sm",children:[t.jsxs("span",{children:[e==null?void 0:e.name,": "]}),e==null?void 0:e.formattedPrice]})]})]})]})]})};export{Z as default}; 2//# sourceMappingURL=ProductHotspot-C1r4RIk7-chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.