1import{j as a}from"./motion-CQbgxZqm.js";import{a as e}from"./react-XV7MRLd-.js";function p(){const[o]=e.useState(()=>{if(typeof window>"u")return!1;const t=window.matchMedia("(prefers-reduced-motion: reduce)").matches,s=navigator.connection?.saveData===!0;return!(t||s)});return o}function y({src:o,poster:t,eager:s=!1}){const l=e.useRef(null),c=e.useRef(null),n=p(),[f,i]=e.useState(!1);return e.useEffect(()=>{if(!n)return;const u=l.current,r=c.current;if(!u||!r)return;r.muted=!0;const d=new IntersectionObserver(([m])=>{m.isIntersecting?r.play().catch(()=>{}):r.pause()},{threshold:.2});return d.observe(u),()=>d.disconnect()},[n]),a.jsxs("div",{ref:l,className:"absolute inset-0 overflow-hidden",children:[a.jsx("img",{src:t,alt:"",className:"h-full w-full object-cover",loading:s?"eager":"lazy"}),n&&a.jsx("video",{ref:c,src:o,poster:t,muted:!0,loop:!0,playsInline:!0,preload:"metadata",onCanPlay:()=>i(!0),onError:()=>i(!1),className:"absolute inset-0 h-full w-full object-cover transition-opacity duration-700",style:{opacity:f?1:0}})]})}export{y as A};
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.