{"version":3,"file":"Rep.D_B2ue0S.mjs","names":["React.useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/OdaZbkhhoJKHq9iLScXH/u2275hRmvVb5NGIoNrXb/Rep.js"],"sourcesContent":["// import { Override } from \"framer\"\n// import * as React from \"react\"\n// type FSRefs = {\n//     overlay: HTMLDivElement | null\n//     fsVideo: HTMLVideoElement | null\n//     isOpen: boolean\n//     lastClosedAt: number\n// }\n// const fs: FSRefs = {\n//     overlay: null,\n//     fsVideo: null,\n//     isOpen: false,\n//     lastClosedAt: 0,\n// }\n// const TAP_MOVE_THRESHOLD = 10\n// const TAP_TIME_THRESHOLD = 300\n// const REOPEN_COOLDOWN = 400\n// const VISIBILITY_THRESHOLD = 0.35\n// const isMobile = () =>\n//     /Android|iPhone|iPad|iPod/i.test(navigator.userAgent || navigator.vendor)\n// export function PlayFullscreenWithClose(): Override {\n//     const scopeRef = React.useRef<HTMLElement | null>(null)\n//     const heroVideoRef = React.useRef<HTMLVideoElement | null>(null)\n//     // tap detection\n//     const startX = React.useRef(0)\n//     const startY = React.useRef(0)\n//     const startT = React.useRef(0)\n//     const setScope = (el: HTMLElement | null) => (scopeRef.current = el)\n//     React.useEffect(() => {\n//         const root = scopeRef.current ?? document.body\n//         const el = root.querySelector(\"video\")\n//         if (el && el instanceof HTMLVideoElement) {\n//             heroVideoRef.current = el\n//             el.muted = true\n//             ;(el as any).playsInline = true\n//             el.play().catch(() => {})\n//         }\n//         const onKey = (e: KeyboardEvent) => {\n//             if (e.key === \"Escape\" && fs.isOpen) closeOverlay()\n//         }\n//         window.addEventListener(\"keydown\", onKey)\n//         return () => window.removeEventListener(\"keydown\", onKey)\n//     }, [])\n//     const elementIsVisibleEnough = () => {\n//         const el = scopeRef.current\n//         if (!el) return false\n//         const r = el.getBoundingClientRect()\n//         const viewportH =\n//             window.innerHeight || document.documentElement.clientHeight\n//         if (viewportH <= 0) return false\n//         const visible = Math.max(\n//             0,\n//             Math.min(r.bottom, viewportH) - Math.max(r.top, 0)\n//         )\n//         const ratio = visible / Math.max(1, r.height)\n//         return ratio >= VISIBILITY_THRESHOLD\n//     }\n//     const ensureOverlay = () => {\n//         if (fs.overlay && document.body.contains(fs.overlay)) return fs.overlay\n//         const overlay = document.createElement(\"div\")\n//         Object.assign(overlay.style, {\n//             position: \"fixed\",\n//             inset: \"0\",\n//             background: \"black\",\n//             zIndex: \"2147483646\",\n//             display: \"grid\",\n//             placeItems: \"center\",\n//             pointerEvents: \"auto\",\n//             touchAction: \"none\",\n//         } as CSSStyleDeclaration)\n//         // backdrop click to close\n//         overlay.addEventListener(\"click\", (e) => {\n//             if (e.target === overlay) closeOverlay()\n//         })\n//         // Close button\n//         const btn = document.createElement(\"button\")\n//         btn.textContent = \"Close ✕\"\n//         btn.setAttribute(\"aria-label\", \"Close video\")\n//         Object.assign(btn.style, {\n//             position: \"absolute\",\n//             top: \"16px\",\n//             right: \"16px\",\n//             padding: \"10px 14px\",\n//             border: \"none\",\n//             borderRadius: \"9999px\",\n//             fontWeight: \"600\",\n//             background: \"rgba(255,255,255,0.14)\",\n//             color: \"#fff\",\n//             backdropFilter: \"saturate(1.2) blur(6px)\",\n//             boxShadow: \"0 8px 24px rgba(0,0,0,0.35)\",\n//             cursor: \"pointer\",\n//             zIndex: \"3\",\n//             WebkitTapHighlightColor: \"transparent\",\n//         } as unknown as CSSStyleDeclaration)\n//         btn.addEventListener(\"click\", (e) => {\n//             e.stopPropagation()\n//             closeOverlay()\n//         })\n//         document.body.appendChild(overlay)\n//         overlay.appendChild(btn)\n//         fs.overlay = overlay\n//         return overlay\n//     }\n//     const openOverlay = () => {\n//         const now = Date.now()\n//         if (now - fs.lastClosedAt < REOPEN_COOLDOWN) return\n//         if (!elementIsVisibleEnough()) return\n//         const hero = heroVideoRef.current\n//         if (!hero) return\n//         const overlay = ensureOverlay()\n//         if (!overlay) return\n//         // Create a separate fullscreen video (do NOT move the hero)\n//         const fsVideo = document.createElement(\"video\")\n//         fsVideo.src = hero.currentSrc || hero.src\n//         fsVideo.playsInline = true\n//         fsVideo.preload = \"auto\"\n//         fsVideo.loop = hero.loop\n//         fsVideo.muted = false\n//         fsVideo.autoplay = true\n//         fsVideo.controls = false\n//         // Desktop: cover (edge-to-edge). Mobile: contain (no stretching/cropping).\n//         const desktopStyles: Partial<CSSStyleDeclaration> = {\n//             objectFit: \"cover\",\n//         }\n//         const mobileStyles: Partial<CSSStyleDeclaration> = {\n//             objectFit: \"contain\",\n//         }\n//         Object.assign(fsVideo.style, {\n//             position: \"absolute\",\n//             inset: \"0\",\n//             width: \"100vw\",\n//             height: \"100vh\",\n//             background: \"black\",\n//             zIndex: \"2\",\n//             pointerEvents: \"auto\",\n//             WebkitTapHighlightColor: \"transparent\",\n//             touchAction: \"none\",\n//             ...(isMobile() ? mobileStyles : desktopStyles),\n//         } as CSSStyleDeclaration)\n//         // Start from 0 with sound\n//         fsVideo.currentTime = 0\n//         fsVideo.play().catch(() => {})\n//         // Pause hero while overlay plays\n//         hero.pause()\n//         overlay.appendChild(fsVideo)\n//         fs.fsVideo = fsVideo\n//         fs.isOpen = true\n//     }\n//     const closeOverlay = () => {\n//         const hero = heroVideoRef.current\n//         const { overlay, fsVideo } = fs\n//         if (fsVideo) {\n//             try {\n//                 fsVideo.pause()\n//             } catch {}\n//             if (fsVideo.parentNode) fsVideo.parentNode.removeChild(fsVideo)\n//         }\n//         if (overlay && overlay.parentNode)\n//             overlay.parentNode.removeChild(overlay)\n//         if (hero) {\n//             hero.muted = true\n//             hero.play().catch(() => {})\n//         }\n//         fs.overlay = null\n//         fs.fsVideo = null\n//         fs.isOpen = false\n//         fs.lastClosedAt = Date.now()\n//     }\n//     // Tap detection — avoids opening during scroll\n//     const onPointerDown: React.PointerEventHandler = (e) => {\n//         startX.current = e.clientX\n//         startY.current = e.clientY\n//         startT.current = Date.now()\n//     }\n//     const onPointerUp: React.PointerEventHandler = (e) => {\n//         const dx = Math.abs(e.clientX - startX.current)\n//         const dy = Math.abs(e.clientY - startY.current)\n//         const dt = Date.now() - startT.current\n//         const isTap =\n//             dt <= TAP_TIME_THRESHOLD &&\n//             dx <= TAP_MOVE_THRESHOLD &&\n//             dy <= TAP_MOVE_THRESHOLD\n//         if (isTap) openOverlay()\n//     }\n//     return {\n//         ref: setScope,\n//         onPointerDown,\n//         onPointerUp,\n//         style: {\n//             cursor: \"none\",\n//             WebkitTapHighlightColor: \"transparent\",\n//             touchAction: \"manipulation\",\n//         },\n//     }\n// }\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";const fs={overlay:null,fsVideo:null,isOpen:false,lastClosedAt:0};const TAP_MOVE_THRESHOLD=10;const TAP_TIME_THRESHOLD=300;const REOPEN_COOLDOWN=400;const VISIBILITY_THRESHOLD=.35;const isMobile=()=>/Android|iPhone|iPad|iPod/i.test(navigator.userAgent||navigator.vendor);// 👇 helper to choose the proper src for the fullscreen video\nconst pickFullscreenSrc=hero=>{const mobileAttr=hero.getAttribute(\"data-mobile-src\")||\"\";const desktopAttr=hero.getAttribute(\"data-desktop-src\")||\"\";if(isMobile()&&mobileAttr)return mobileAttr;if(!isMobile()&&desktopAttr)return desktopAttr;// fallback to whatever the hero is already using\nreturn hero.currentSrc||hero.src;};export function PlayFullscreenWithClose(){const scopeRef=React.useRef(null);const heroVideoRef=React.useRef(null);// tap detection\nconst startX=React.useRef(0);const startY=React.useRef(0);const startT=React.useRef(0);const setScope=el=>scopeRef.current=el;React.useEffect(()=>{const root=scopeRef.current??document.body;const el=root.querySelector(\"video\");if(el&&el instanceof HTMLVideoElement){heroVideoRef.current=el;el.muted=true;el.playsInline=true;el.play().catch(()=>{});}const onKey=e=>{if(e.key===\"Escape\"&&fs.isOpen)closeOverlay();};window.addEventListener(\"keydown\",onKey);return()=>window.removeEventListener(\"keydown\",onKey);},[]);const elementIsVisibleEnough=()=>{const el=scopeRef.current;if(!el)return false;const r=el.getBoundingClientRect();const viewportH=window.innerHeight||document.documentElement.clientHeight;if(viewportH<=0)return false;const visible=Math.max(0,Math.min(r.bottom,viewportH)-Math.max(r.top,0));const ratio=visible/Math.max(1,r.height);return ratio>=VISIBILITY_THRESHOLD;};const ensureOverlay=()=>{if(fs.overlay&&document.body.contains(fs.overlay))return fs.overlay;const overlay=document.createElement(\"div\");Object.assign(overlay.style,{position:\"fixed\",inset:\"0\",background:\"black\",zIndex:\"2147483646\",display:\"grid\",placeItems:\"center\",pointerEvents:\"auto\",touchAction:\"none\"});// backdrop click to close\noverlay.addEventListener(\"click\",e=>{if(e.target===overlay)closeOverlay();});// Close button\nconst btn=document.createElement(\"button\");btn.textContent=\"Close ✕\";btn.setAttribute(\"aria-label\",\"Close video\");Object.assign(btn.style,{position:\"absolute\",top:\"16px\",right:\"16px\",padding:\"10px 14px\",border:\"none\",borderRadius:\"9999px\",fontWeight:\"600\",background:\"rgba(255,255,255,0.14)\",color:\"#fff\",backdropFilter:\"saturate(1.2) blur(6px)\",boxShadow:\"0 8px 24px rgba(0,0,0,0.35)\",cursor:\"pointer\",zIndex:\"3\",WebkitTapHighlightColor:\"transparent\"});btn.addEventListener(\"click\",e=>{e.stopPropagation();closeOverlay();});document.body.appendChild(overlay);overlay.appendChild(btn);fs.overlay=overlay;return overlay;};const openOverlay=()=>{const now=Date.now();if(now-fs.lastClosedAt<REOPEN_COOLDOWN)return;if(!elementIsVisibleEnough())return;const hero=heroVideoRef.current;if(!hero)return;const overlay=ensureOverlay();if(!overlay)return;// Create a separate fullscreen video (do NOT move the hero)\nconst fsVideo=document.createElement(\"video\");// 👇 choose source per device\nfsVideo.src=pickFullscreenSrc(hero);fsVideo.playsInline=true;fsVideo.preload=\"auto\";fsVideo.loop=hero.loop;fsVideo.muted=false;fsVideo.autoplay=true;fsVideo.controls=false;const desktopStyles={objectFit:\"cover\"};const mobileStyles={objectFit:\"contain\"};Object.assign(fsVideo.style,{position:\"absolute\",inset:\"0\",width:\"100vw\",height:\"100vh\",background:\"black\",zIndex:\"2\",pointerEvents:\"auto\",WebkitTapHighlightColor:\"transparent\",touchAction:\"none\",...isMobile()?mobileStyles:desktopStyles});// Start from 0 with sound (tap already happened, so iOS will allow it)\nfsVideo.currentTime=0;fsVideo.play().catch(()=>{});// Pause hero while overlay plays\nhero.pause();overlay.appendChild(fsVideo);fs.fsVideo=fsVideo;fs.isOpen=true;};const closeOverlay=()=>{const hero=heroVideoRef.current;const{overlay,fsVideo}=fs;if(fsVideo){try{fsVideo.pause();}catch{}if(fsVideo.parentNode)fsVideo.parentNode.removeChild(fsVideo);}if(overlay&&overlay.parentNode)overlay.parentNode.removeChild(overlay);if(hero){hero.muted=true;hero.play().catch(()=>{});}fs.overlay=null;fs.fsVideo=null;fs.isOpen=false;fs.lastClosedAt=Date.now();};// Tap detection — avoids opening during scroll\nconst onPointerDown=e=>{startX.current=e.clientX;startY.current=e.clientY;startT.current=Date.now();};const onPointerUp=e=>{const dx=Math.abs(e.clientX-startX.current);const dy=Math.abs(e.clientY-startY.current);const dt=Date.now()-startT.current;const isTap=dt<=TAP_TIME_THRESHOLD&&dx<=TAP_MOVE_THRESHOLD&&dy<=TAP_MOVE_THRESHOLD;if(isTap)openOverlay();};return{ref:setScope,onPointerDown,onPointerUp,style:{cursor:\"none\",WebkitTapHighlightColor:\"transparent\",touchAction:\"manipulation\"}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withPlayFullscreenWithClose(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PlayFullscreenWithClose(props)});};}withPlayFullscreenWithClose.displayName=\"PlayFullscreenWithClose\";\nexport const __FramerMetadata__ = {\"exports\":{\"withPlayFullscreenWithClose\":{\"type\":\"reactHoc\",\"name\":\"withPlayFullscreenWithClose\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PlayFullscreenWithClose\":{\"type\":\"override\",\"name\":\"PlayFullscreenWithClose\",\"annotations\":{\"framerContractVersion\":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