{"version":3,"file":"BackgroundVideo.BXOGTpXM.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","p","ce","de","init_framer_BisrWwwE","addPropertyControls","ControlType","BackgroundVideo","props","posterUrl","poster","phonePosterUrl","phonePoster","ref","v","start","c","phoneSrc","PHONE","src","fill","init_BackgroundVideo","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/ZcH5KRSg4ygb1Fnrm7PB/d7Vi7ZoDftbUL8ofVAFy/BackgroundVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Background video for hero sections. The poster is a real <img> so it is the\n// page's LCP image and paints before any JS. The video gets no src until the\n// page has finished loading, so it never competes with the first paint; phones\n// (≤809px, the site's Phone breakpoint) get the short portrait loop instead.\n// Reduced-motion, Data Saver and slow-connection visitors keep the still.\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n * @framerDisableUnlink\n */const PHONE=\"(max-width: 809.98px)\";export default function BackgroundVideo(props){const{src=\"\",phoneSrc=\"\",poster,phonePoster}=props;const posterUrl=typeof poster===\"string\"?poster:poster?.src;const phonePosterUrl=typeof phonePoster===\"string\"?phonePoster:phonePoster?.src;const ref=useRef(null);useEffect(()=>{const v=ref.current;if(!v)return;const start=()=>{if(!v.getClientRects().length)return;// hidden breakpoint copy\nif(matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;// Slow connection: keep the still. Chrome/Android report the link\n// speed; Safari doesn't, so a page that took 8s+ to load counts too.\nconst c=navigator.connection;if(c?.saveData||/2g|3g/.test(c?.effectiveType??\"\")||c?.downlink<2)return;const nav=performance.getEntriesByType(\"navigation\")[0];if(nav?.loadEventStart>8e3)return;v.src=phoneSrc&&matchMedia(PHONE).matches&&phoneSrc||src;v.play().catch(()=>{});};if(document.readyState===\"complete\")start();else{window.addEventListener(\"load\",start,{once:true});return()=>window.removeEventListener(\"load\",start);}},[src,phoneSrc]);if(!src)return null;const fill={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"50% 50%\",display:\"block\",pointerEvents:\"none\"};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[posterUrl&&/*#__PURE__*/_jsxs(\"picture\",{children:[phonePosterUrl&&/*#__PURE__*/_jsx(\"source\",{media:PHONE,srcSet:phonePosterUrl}),/*#__PURE__*/_jsx(\"img\",{src:posterUrl,alt:\"\",decoding:\"async\",...{fetchpriority:\"high\"},style:fill})]}),/*#__PURE__*/_jsx(\"video\",{ref:ref,autoPlay:true,loop:true,muted:true,playsInline:true,preload:\"none\",\"aria-hidden\":\"true\",onPlaying:e=>e.currentTarget.style.opacity=\"1\",style:{...fill,opacity:0,transition:\"opacity 0.6s ease\"}})]});}addPropertyControls(BackgroundVideo,{src:{type:ControlType.String,title:\"Src\",defaultValue:\"\"},phoneSrc:{type:ControlType.String,title:\"Phone Src\"},poster:{type:ControlType.Image,title:\"Poster\"},phonePoster:{type:ControlType.Image,title:\"Phone Poster\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackgroundVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackgroundVideo.map"],"mappings":"A,mMAWuC,SAAwBY,EAAgB,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,WAAS,GAAG,SAAO,eAAaC,EAAYC,EAAU,OAAOC,GAAS,SAASA,EAAOA,GAAQ,IAAUC,EAAe,OAAOC,GAAc,SAASA,EAAYA,GAAa,IAAUC,EAAIlB,EAAO,IAAI,EAGiJ,GAH/IO,MAAc,CAAC,IAAMY,EAAED,EAAI,QAAQ,GAAG,CAACC,EAAE,OAAO,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