1import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{$t as t,R as n,at as r,ot as i}from"./strap-content-CtESSVAe.js";import{t as a}from"./PriceVatNote-B9PGq72l.js";var o=e(t(),1);function s({title:e,image:t,options:s,activeId:c,onSelect:l,busy:u,onAdd:d,watchId:f,ctaLabel:p}){let m=n(),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=()=>g(window.scrollY>420);return e(),window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)},[]),(0,o.useEffect)(()=>{let e=document.getElementById(f);if(!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>v(e.some(e=>e.isIntersecting)),{rootMargin:`-80px 0px -120px 0px`});return t.observe(e),()=>t.disconnect()},[f]);let y=s.find(e=>e.id===c)??s[0];if(!y)return null;let b=h&&!_;return r(`div`,{className:`st-sticky-buy${b?` is-visible`:``}`,"aria-hidden":!b,children:i(`div`,{className:`st-sticky-buy-inner`,children:[t?r(`img`,{className:`st-sticky-buy-image`,src:t,alt:``,loading:`lazy`,decoding:`async`}):null,i(`div`,{className:`st-sticky-buy-copy`,children:[r(`span`,{className:`st-sticky-buy-title`,children:e}),r(`strong`,{children:y.price}),y.compareAt?r(`s`,{className:`st-sticky-buy-compare`,children:y.compareAt}):null,r(a,{})]}),s.length>1?r(`select`,{className:`st-sticky-buy-select`,value:y.id,"aria-label":m.selectModel,onChange:e=>l(e.target.value),children:s.map(e=>i(`option`,{value:e.id,disabled:!e.available,children:[e.title,e.available?``:` â ${m.soldOut}`]},e.id))}):null,r(`button`,{className:`st-primary-button`,type:`button`,disabled:!y.available||u,onClick:d,tabIndex:b?0:-1,children:y.available?p??m.addToCart:m.soldOut})]})})}export{s as t};
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.