{"version":3,"file":"Slideshow.e2gTdbEY.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/2SOTqAzQxkEWKXGAAHo1/FzX3jUBD7n6pXegx0Ioq/Slideshow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";// Slideshow for the experience photos.\n// Image One stays underneath. Image Two (slideTwo) and Image Three (slideThree)\n// sit on top and fade in/out. Only photos that actually exist are part of the\n// loop, so an entry with 1 photo stays still, 2 photos alternates, 3 cycles.\nconst INTERVAL_MS=4e3;const FADE=\"opacity 0.8s ease-in-out\";function hasImage(el){const img=el.querySelector(\"img\");if(!img)return false;const src=img.getAttribute(\"src\")||img.currentSrc||\"\";return src.length>0&&!src.startsWith(\"data:image/svg\");}function setRef(ref,value){if(typeof ref===\"function\")ref(value);else if(ref)ref.current=value;}function makeSlide(slot,controller){return Component=>/*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);useEffect(()=>{const el=local.current;if(!controller||!el||!el.parentElement)return;const parent=el.parentElement;const reduce=typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;let index=0;const update=advance=>{const overlays=Array.from(parent.querySelectorAll(\":scope > [data-exp-slide]\")).sort((a,b)=>Number(a.dataset.expSlide)-Number(b.dataset.expSlide));const present=overlays.filter(hasImage);overlays.forEach(o=>{if(!present.includes(o)){o.style.visibility=\"hidden\";o.style.opacity=\"0\";}else{o.style.visibility=\"visible\";}});const count=1+present.length;if(reduce||count===1)index=0;else if(advance)index=(index+1)%count;else if(index>=count)index=0;present.forEach((o,i)=>{o.style.opacity=index===i+1?\"1\":\"0\";});};update(false);const id=window.setInterval(()=>update(true),INTERVAL_MS);return()=>window.clearInterval(id);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{local.current=node;if(node)node.dataset.expSlide=slot;setRef(ref,node);},style:{...props.style,opacity:0,transition:FADE}});});}export function slideTwo(Component){return makeSlide(\"2\",true)(Component);}export function slideThree(Component){return makeSlide(\"3\",false)(Component);}// Video: plays only once the whole video is on screen, pauses once it has\n// completely left the screen. If the video is taller than the window, it\n// plays as soon as it fills as much of the window as it can.\nconst STEPS=Array.from({length:21},(_,i)=>i/20);export function playWhenFullyVisible(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);useEffect(()=>{const el=local.current;if(!el||typeof IntersectionObserver===\"undefined\")return;const getVideo=()=>el.querySelector(\"video\");let first=true;const io=new IntersectionObserver(entries=>{for(const e of entries){const v=getVideo();if(!v)continue;const h=e.boundingClientRect.height||1;const need=Math.min(.97,window.innerHeight/h*.97);if(e.intersectionRatio>=need){v.play().catch(()=>{// Browser blocked sound: start muted instead\nv.muted=true;v.play().catch(()=>{});});}else if(!e.isIntersecting||first){v.pause();}}first=false;},{threshold:STEPS});io.observe(el);return()=>io.disconnect();},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{local.current=node;setRef(ref,node);}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"slideThree\":{\"type\":\"reactHoc\",\"name\":\"slideThree\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"playWhenFullyVisible\":{\"type\":\"reactHoc\",\"name\":\"playWhenFullyVisible\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"slideTwo\":{\"type\":\"reactHoc\",\"name\":\"slideTwo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Slideshow.map"],"mappings":"8IAI4D,SAAS,EAAS,EAAG,CAAC,IAAM,EAAI,EAAG,cAAc,KAAK,EAAE,GAAG,CAAC,EAAI,MAAO,GAAM,IAAM,EAAI,EAAI,aAAa,KAAK,GAAG,EAAI,YAAY,GAAG,OAAO,EAAI,OAAO,GAAG,CAAC,EAAI,WAAW,gBAAgB,CAAE,CAAC,SAAS,EAAO,EAAI,EAAM,CAAI,OAAO,GAAM,WAAW,EAAI,CAAK,EAAU,IAAI,EAAI,Q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