{"version":3,"file":"ProjectCardMedia.AVn7P6nO.mjs","names":["useRef","useState","useMemo","useCallback","__esmMin","init_ssg_sandbox_shims","te","ne","_e","de","pe","p","init_jsx_runtime","init_npm_react_18_3_1","ce","window","addPropertyControls","init_framer_D1IzEvwH","ControlType","ProjectCardMedia","props","rootRef","videoRef","isActive","setIsActive","isHovered","setIsHovered","prefersReducedMotion","isTouchDevice","imageSrc","coverImage","mediaStyle","objectPosition","continuousPlay","pauseOnHover","v","handleMouseEnter","ambientPulse","handleMouseLeave","handleFocus","handleBlur","rootEl","findHoverHost","interactive","startEl","current","style","hoverHost","effectiveHover","mediaBrightness","hoverBrightness","filterTransition","shouldRenderScrim","scrimOpacity","scrimVisibleOpacity","scrimTransition","styleId","videoUrl","HOVER_IN_MS","HOVER_OUT_MS","init_ProjectCardMedia"],"sources":["https:/framerusercontent.com/modules/wfXd5DBE87g5f4xZoLiU/aHLlweOkdtvjPpfXAR2O/ProjectCardMedia.js"],"sourcesContent":["// ProjectCardMedia.tsx\n// Request: add a pauseOnHover boolean control that forces autoplay/loop and pauses on hover, while preserving existing behavior when pauseOnHover is false.\n// Replaces the Image layer inside Project Card - Simple 2.\n// Renders a static poster image when videoUrl is empty/absent,\n// adds hover-play / focus-play video behavior when videoUrl is populated,\n// continuous loop when continuousPlay is checked,\n// and a slow ambient background pulse (grey -> white -> grey) when ambientPulse is checked.\n//\n// ARCHITECTURAL NOTE — IntersectionObserver:\n// Preloading video via IntersectionObserver was considered and deferred.\n// At the current six-card scope, preload=\"none\" (load-on-play) is sufficient.\n// If homepage card count grows beyond ~12 entries, revisit IntersectionObserver-\n// based preloading to avoid first-hover latency at scale.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useState,useEffect,useMemo,useCallback,startTransition}from\"react\";const HOVER_IN_MS=350;const HOVER_OUT_MS=600;/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ProjectCardMedia(props){const{coverImage,coverImageAlt,videoUrl,continuousPlay,pauseOnHover,ambientPulse,objectPosition,hoverBrightness,scrimOpacity}=props;const rootRef=useRef(null);const videoRef=useRef(null);const[isActive,setIsActive]=useState(false);const[isHovered,setIsHovered]=useState(false);// Check prefers-reduced-motion once at mount\nconst prefersReducedMotion=useMemo(()=>{if(typeof window===\"undefined\")return false;return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;},[]);// Check touch device once at mount\nconst isTouchDevice=useMemo(()=>{if(typeof window===\"undefined\")return false;return window.matchMedia(\"(hover: none)\").matches;},[]);const imageSrc=typeof coverImage===\"object\"&&coverImage?.src?coverImage.src:coverImage||\"\";const focalPoint=objectPosition||\"50% 50%\";const mediaStyle={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:focalPoint};// Continuous-play cards (e.g. NBW), or pause-on-hover cards:\n// autoplay-loop from mount unless the user prefers reduced motion.\nuseEffect(()=>{// Continuous-play loops ignore Reduce Motion (Jordan, 2026-11-08: News/Ecosystem heroes must loop on the iPad).\nif(!continuousPlay&&(!pauseOnHover||prefersReducedMotion))return;startTransition(()=>setIsActive(true));const v=videoRef.current;if(v){const p=v.play();if(p&&typeof p.catch===\"function\")p.catch(()=>{});}},[continuousPlay,pauseOnHover,prefersReducedMotion]);const handleMouseEnter=useCallback(()=>{if(!prefersReducedMotion&&!isTouchDevice&&!ambientPulse){startTransition(()=>setIsHovered(true));}if(pauseOnHover){if(prefersReducedMotion||isTouchDevice)return;if(videoRef.current)videoRef.current.pause();return;}if(prefersReducedMotion||isTouchDevice||continuousPlay||ambientPulse)return;startTransition(()=>setIsActive(true));if(videoRef.current){videoRef.current.currentTime=0;videoRef.current.play();}},[continuousPlay,pauseOnHover,prefersReducedMotion,isTouchDevice,ambientPulse]);const handleMouseLeave=useCallback(()=>{startTransition(()=>setIsHovered(false));if(pauseOnHover){if(prefersReducedMotion||isTouchDevice)return;if(videoRef.current){const p=videoRef.current.play();if(p&&typeof p.catch===\"function\")p.catch(()=>{});}return;}if(prefersReducedMotion||isTouchDevice||continuousPlay||ambientPulse)return;startTransition(()=>setIsActive(false));if(videoRef.current){videoRef.current.pause();}},[continuousPlay,pauseOnHover,prefersReducedMotion,isTouchDevice,ambientPulse]);function handleFocus(){handleMouseEnter();}function handleBlur(){handleMouseLeave();}useEffect(()=>{if(typeof window===\"undefined\")return;const rootEl=rootRef.current;if(!rootEl)return;function findHoverHost(startEl){const interactive=startEl.closest(\"a, button, [role='link']\");if(interactive)return interactive;let current=startEl.parentElement;while(current){const style=window.getComputedStyle(current);if(style.pointerEvents!==\"none\"&&style.position===\"relative\"){return current;}current=current.parentElement;}return startEl;}const hoverHost=findHoverHost(rootEl);if(!hoverHost)return;hoverHost.addEventListener(\"mouseenter\",handleMouseEnter);hoverHost.addEventListener(\"mouseleave\",handleMouseLeave);return()=>{hoverHost.removeEventListener(\"mouseenter\",handleMouseEnter);hoverHost.removeEventListener(\"mouseleave\",handleMouseLeave);};},[handleMouseEnter,handleMouseLeave]);const isInteractive=!prefersReducedMotion&&!isTouchDevice&&!ambientPulse;const effectiveHover=isInteractive&&isHovered;const shouldBrighten=!prefersReducedMotion&&!isTouchDevice&&!ambientPulse;const mediaBrightness=shouldBrighten&&effectiveHover?hoverBrightness:1;const filterTransition=prefersReducedMotion?undefined:\"filter 500ms ease-out\";const shouldRenderScrim=scrimOpacity>0;const scrimVisibleOpacity=prefersReducedMotion||continuousPlay?1:effectiveHover?0:1;const scrimTransition=prefersReducedMotion?undefined:\"opacity 600ms ease-out\";// Ambient pulse keyframe injection\nuseEffect(()=>{if(!ambientPulse||prefersReducedMotion)return;const styleId=\"pcm-ambient-pulse-keyframes\";if(!document.getElementById(styleId)){const style=document.createElement(\"style\");style.id=styleId;style.textContent=`\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                       @keyframes pcm-pulse {\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           0%   { background-color: #888888; }\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               50%  { background-color: #ffffff; }\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   100% { background-color: #888888; }\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               `;document.head.appendChild(style);}},[ambientPulse,prefersReducedMotion]);// State 1: Ambient pulse — portrait sits over a pulsing background\nif(ambientPulse&&!prefersReducedMotion){return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onFocus:handleFocus,onBlur:handleBlur,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,animation:\"pcm-pulse 5s ease-in-out infinite\",zIndex:1}}),/*#__PURE__*/_jsx(\"img\",{src:imageSrc,alt:\"\",style:{...mediaStyle,zIndex:2}})]});}// State 2: Static only (no video, or reduced motion, or a touch device on a hover-play card). A continuous-play\n// card loops on touch too (Jordan, 2026-10-26, Home phone: \"make each box autoplay\"): muted + playsInline.\nif(!videoUrl||prefersReducedMotion&&!continuousPlay||isTouchDevice&&!continuousPlay){return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"img\",{src:imageSrc,alt:\"\",style:{...mediaStyle,opacity:1,filter:`brightness(${mediaBrightness})`,transition:filterTransition,zIndex:1}}),shouldRenderScrim?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\",background:`linear-gradient(0deg, rgba(0,0,0,${scrimOpacity}) 0%, rgba(0,0,0,0) 100%)`,opacity:scrimVisibleOpacity,transition:scrimTransition,zIndex:3}}):null]});}// States 3 & 4: Hover-play or continuous loop (video present)\nreturn /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,onFocus:handleFocus,onBlur:handleBlur,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"img\",{src:imageSrc,alt:\"\",style:{...mediaStyle,opacity:isActive?0:1,filter:`brightness(${mediaBrightness})`,transition:`${isActive?`opacity ${HOVER_IN_MS}ms ease`:`opacity ${HOVER_OUT_MS}ms ease-out`}${prefersReducedMotion?\"\":\", filter 500ms ease-out\"}`,zIndex:1}}),/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoUrl,muted:true,playsInline:true,loop:true,preload:continuousPlay||pauseOnHover?\"auto\":\"none\",\"aria-hidden\":\"true\",tabIndex:-1,style:{...mediaStyle,opacity:isActive?1:0,filter:`brightness(${mediaBrightness})`,transition:`${isActive?`opacity ${HOVER_IN_MS}ms ease`:`opacity ${HOVER_OUT_MS}ms ease-out`}${prefersReducedMotion?\"\":\", filter 500ms ease-out\"}`,zIndex:2,pointerEvents:\"none\"}}),shouldRenderScrim?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\",background:`linear-gradient(0deg, rgba(0,0,0,${scrimOpacity}) 0%, rgba(0,0,0,0) 100%)`,opacity:scrimVisibleOpacity,transition:scrimTransition,zIndex:3}}):null]});}addPropertyControls(ProjectCardMedia,{coverImage:{title:\"Cover Image\",type:ControlType.ResponsiveImage},coverImageAlt:{title:\"Alt Text\",type:ControlType.String,defaultValue:\"\",placeholder:\"Ecosystem title for screen readers\"},videoUrl:{title:\"Video URL\",type:ControlType.File,allowedFileTypes:[\"mp4\"]},continuousPlay:{title:\"Continuous Play\",type:ControlType.Boolean,defaultValue:false},pauseOnHover:{title:\"Pause on Hover\",type:ControlType.Boolean,defaultValue:false},ambientPulse:{title:\"Ambient Pulse\",type:ControlType.Boolean,defaultValue:false},objectPosition:{title:\"Focal Point\",type:ControlType.String,defaultValue:\"50% 50%\",placeholder:\"e.g. 50% 17%\"},hoverBrightness:{title:\"Hover Brightness\",type:ControlType.Number,defaultValue:1.12,min:1,max:1.4,step:.01},scrimOpacity:{title:\"Scrim Opacity\",type:ControlType.Number,defaultValue:0,min:0,max:.9,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProjectCardMedia\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProjectCardMedia.map"],"mappings":"A,kOAgBG,SAAwBmB,EAAiB,EAAM,CAAC,GAAK,CAAC,aAAW,gBAAc,WAAS,iBAAe,eAAa,eAAa,iBAAe,kBAAgB,gBAAcC,EAAYC,EAAQrB,EAAO,IAAI,EAAQsB,EAAStB,EAAO,IAAI,EAAO,CAACuB,EAASC,GAAavB,EAAS,EAAK,EAAO,CAACwB,EAAUC,GAAczB,EAAS,EAAK,EAChU0B,EAAqBzB,MAAuBa,IAAS,QAAgCA,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAU,CAAC,CAAC,EACvJa,EAAc1B,MAAuBa,IAAS,QAAgCA,EAAO,WAAW,eAAe,CAAC,CAAC,QAAU,CAAC,CAAC,EAAQc,EAAS,OAAOC,GAAa,UAAUA,GAAY,IAAIA,EAAW,IAAIA,GAAY,GAAoDC,EAAW,CAAC,SAAS,WAAW,MAAM,EAAE,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,eAArHC,GAAgB,SAA8H,EAE/XlB,MAAc,CACd,GAAG,CAACmB,IAAiB,CAACC,GAAcP,GAAsB,OAAOrB,MAAoBkB,EAAY,EAAI,CAAC,EAAE,IAAMW,EAAEb,EAAS,QAAQ,GAAGa,EAAE,CAAC,IAAMxB,EAAEwB,EAAE,KAAK,EAAKxB,GAAG,OAAOA,EAAE,OAAQ,YAAWA,EAAE,UAAU,CAAC,CAAC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