{"version":3,"file":"CaseVideo.DdRVvp45.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/vwdtM4kcm3kR6LtN0fvh/RY4jyareKqAPJLU8K1NQ/CaseVideo.js"],"sourcesContent":["// CaseVideo: poster-first case footage (06-motion-spec.md 1.5.11, V2-VID-01..04). Level N1.\n// Poster is always rendered (SSR, reduced motion, phone, Save-Data, editor canvas).\n// The video source is only attached near the viewport, plays at 50% visibility and only\n// for the top-most visible instance (last in DOM order), pauses when covered, offscreen\n// or when the tab is hidden. WCAG 2.2.2: click/tap on the video pauses/resumes; a visually hidden\n// button (aria-label Pause video / Play video, aria-pressed) appears only on keyboard :focus-visible.\n// Optional props (2026-09-17, APHIS gallery lead, Diego's conditions): sizes, nearMargin (px, attaches the\n// source only within that distance of the viewport; -1 keeps the original one-viewport margin), visibleToggle\n// (always-visible pause/play, WCAG 2.2.2). Save-Data and 2G connections get the poster only (3G dropped 2026-09-17: Chrome reports 3g on normal high-latency desktop links).\n// Source rules: no JSX, no less-than character, no template literals (Framer exec hook).\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{createElement as h,useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useReducedMotion}from\"framer-motion\";const registry=new Set;const DEFAULT_SIZES=\"(max-width: 809.98px) calc(100vw - 40px), (max-width: 1199.98px) 60vw, 820px\";const SLOW_NETWORKS=[\"slow-2g\",\"2g\"];function electPlayer(){let top=null;registry.forEach(function(e){if(!e.visible)return;if(!top||top.el.compareDocumentPosition(e.el)&4)top=e;});registry.forEach(function(e){e.set(e===top);});}/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 400\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CaseVideo(props){const poster=props.poster||{};const reduce=useReducedMotion();const isStatic=useIsStaticRenderer();const rootRef=useRef(null);const videoRef=useRef(null);const posterRef=useRef(null);const[eligible,setEligible]=useState(false);const[near,setNear]=useState(false);const[shown,setShown]=useState(false);const[userPaused,setUserPaused]=useState(false);const pausedRef=useRef(false);const nm=typeof props.nearMargin===\"number\"?props.nearMargin:-1;const nearMarginValue=nm===-1?\"100% 0px 100% 0px\":String(Math.max(0,nm))+\"px 0px \"+String(Math.max(0,nm))+\"px 0px\";useEffect(function(){if(isStatic||reduce||props.allowVideo===false||!props.video)return;const phone=window.matchMedia(\"(max-width: 809.98px)\").matches;const conn=navigator.connection;if(phone||conn&&conn.saveData)return;if(conn&&SLOW_NETWORKS.indexOf(String(conn.effectiveType||\"\"))!==-1)return;setEligible(true);},[isStatic,reduce,props.allowVideo,props.video]);useEffect(function(){if(!eligible)return;const el=rootRef.current;if(!el)return;const entry={el:el,visible:false,set:function(play){const v=videoRef.current;if(!v)return;if(play&&!pausedRef.current&&document.visibilityState===\"visible\"){const p=v.play();if(p&&p.catch)p.catch(function(){});}else if(!v.paused)v.pause();}};registry.add(entry);const nearIo=new IntersectionObserver(function(es){if(es[es.length-1].isIntersecting)setNear(true);},{rootMargin:nearMarginValue});const playIo=new IntersectionObserver(function(es){const last=es[es.length-1];entry.visible=last.isIntersecting&&last.intersectionRatio>=.5;electPlayer();},{threshold:[0,.5,1]});const onVis=function(){electPlayer();};nearIo.observe(el);playIo.observe(el);document.addEventListener(\"visibilitychange\",onVis);return function(){registry.delete(entry);nearIo.disconnect();playIo.disconnect();document.removeEventListener(\"visibilitychange\",onVis);electPlayer();};},[eligible,nearMarginValue]);useEffect(function(){if(near)electPlayer();},[near]);useEffect(function(){const span=posterRef.current;if(!span)return;const img=span.querySelector(\"img[data-cv-src]\");if(!img)return;const load=function(){if(img.getAttribute(\"src\"))return;const set=img.getAttribute(\"data-cv-srcset\");if(set)img.setAttribute(\"srcset\",set);img.setAttribute(\"src\",img.getAttribute(\"data-cv-src\"));};if(!(\"IntersectionObserver\"in window))return load();const io=new IntersectionObserver(function(es){if(es[es.length-1].isIntersecting){load();io.disconnect();}},{rootMargin:\"1250px 0px\"});io.observe(span);return function(){io.disconnect();};},[poster.src]);const toggle=function(){const next=!userPaused;pausedRef.current=next;setUserPaused(next);electPlayer();};const fill={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:props.position||\"50% 50%\",display:\"block\"};const children=[];if(poster.src){// Poster loading (Diego, 09a2f46fb): an IntersectionObserver (rootMargin 1250px) assigns src/srcset, because native\n// lazy loading widens to ~3000 px on slow or unknown connections. <noscript> keeps the SSR image for no-JS.\n// The markup is an identical innerHTML string on server and client, so React never re-creates the <img>.\n// sizes is written straight into the string (Framer's wrapped sizes made the browser pick the 1600 px file).\nconst esc=function(s){return String(s==null?\"\":s).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\");};const sizes=props.sizes?String(props.sizes):DEFAULT_SIZES;const imgStyle=\"position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:\"+esc(props.position||\"50% 50%\")+\";display:block\";const altAttr=' alt=\"'+esc(props.alt||poster.alt||\"\")+'\"';const posterHtml='<img data-cv-src=\"'+esc(poster.src)+'\"'+(poster.srcSet?' data-cv-srcset=\"'+esc(poster.srcSet)+'\"':\"\")+' sizes=\"'+esc(sizes)+'\"'+altAttr+' decoding=\"async\" style=\"'+imgStyle+'\">'+'<noscript><img src=\"'+esc(poster.src)+'\"'+(poster.srcSet?' srcset=\"'+esc(poster.srcSet)+'\"':\"\")+' sizes=\"'+esc(sizes)+'\"'+altAttr+' loading=\"lazy\" decoding=\"async\" style=\"'+imgStyle+'\"></noscript>';children.push(/*#__PURE__*/h(\"span\",{key:\"p\",ref:posterRef,style:{position:\"absolute\",inset:0,display:\"block\"},dangerouslySetInnerHTML:{__html:posterHtml},suppressHydrationWarning:true}));}if(eligible&&near){children.push(/*#__PURE__*/h(\"video\",{key:\"v\",ref:videoRef,src:props.video,muted:true,loop:true,playsInline:true,preload:\"none\",\"aria-hidden\":\"true\",onPlaying:function(){setShown(true);},style:Object.assign({},fill,{opacity:shown?1:0,transition:\"opacity 250ms cubic-bezier(0.23, 1, 0.32, 1)\"})}));if(props.showToggle!==false){children.push(/*#__PURE__*/h(\"button\",{key:\"t\",type:\"button\",onClick:function(e){// Veto A11y-1: never let the toggle trigger the card link\ne.preventDefault();e.stopPropagation();toggle();},\"aria-label\":userPaused?\"Play video\":\"Pause video\",\"aria-pressed\":userPaused,className:props.visibleToggle?\"cv-toggle cv-visible\":\"cv-toggle\"},/*#__PURE__*/h(\"style\",{key:\"s\",dangerouslySetInnerHTML:{__html:\".cv-toggle { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; background: #1A1918; color: #F4F3EF; }\"+\" .cv-toggle.cv-visible { right: 12px; bottom: 12px; width: 44px; height: 44px; margin: 0; overflow: visible; clip-path: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }\"+\" .cv-toggle:focus-visible { right: 12px; bottom: 12px; width: 44px; height: 44px; margin: 0; overflow: visible; clip-path: none; display: flex; align-items: center; justify-content: center; cursor: pointer; outline: 2px solid #1A1918 !important; outline-offset: 2px !important; box-shadow: 0 0 0 2px #F4F3EF !important; }\"}}),userPaused?/*#__PURE__*/h(\"svg\",{key:\"i\",width:16,height:16,viewBox:\"0 0 16 16\",\"aria-hidden\":\"true\",focusable:\"false\"},/*#__PURE__*/h(\"path\",{d:\"M4 2.5v11l9-5.5z\",fill:\"currentColor\"})):/*#__PURE__*/h(\"svg\",{key:\"i\",width:16,height:16,viewBox:\"0 0 16 16\",\"aria-hidden\":\"true\",focusable:\"false\"},/*#__PURE__*/h(\"path\",{d:\"M4 2.5h3v11H4zM9 2.5h3v11H9z\",fill:\"currentColor\"}))));}}// JSX root: Framer only detects component exports in files that contain JSX\nconst onRootClick=eligible&&near&&props.showToggle!==false?function(e){// the card link lives on \"View case\" (outside this component), so nothing here navigates\nif(e.target&&e.target.closest&&e.target.closest(\"button\"))return;e.preventDefault();e.stopPropagation();toggle();}:undefined;return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,onClick:onRootClick,style:Object.assign({position:\"relative\",overflow:\"hidden\",background:props.background||\"#201E1C\"},props.style),children:children});}CaseVideo.displayName=\"CaseVideo\";addPropertyControls(CaseVideo,{video:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\"},poster:{type:ControlType.ResponsiveImage,title:\"Poster\"},alt:{type:ControlType.String,title:\"Alt\",defaultValue:\"\"},allowVideo:{type:ControlType.Boolean,title:\"Play Video\",defaultValue:true},showToggle:{type:ControlType.Boolean,title:\"Pause Button\",defaultValue:true},background:{type:ControlType.Color,title:\"Mat\",defaultValue:\"#201E1C\"},position:{type:ControlType.String,title:\"Focal Point\",description:\"CSS object-position, e.g. 50% 35%\",defaultValue:\"50% 50%\"},sizes:{type:ControlType.String,title:\"Sizes\",description:\"Poster sizes attribute. Empty keeps the Case Stack value.\",defaultValue:\"\"},nearMargin:{type:ControlType.Number,title:\"Near Margin\",description:\"px from the viewport to attach the video. -1 = one viewport (default).\",defaultValue:-1,min:-1,max:2e3,step:50,displayStepper:true},visibleToggle:{type:ControlType.Boolean,title:\"Visible Toggle\",description:\"Always show the pause/play button (WCAG 2.2.2).\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CaseVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 640\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CaseVideo.map"],"mappings":"6QAU8X,SAAS,GAAa,CAAC,IAAI,EAAI,KAAK,EAAS,QAAQ,SAAS,EAAE,CAAK,EAAE,UAAkB,CAAC,GAAK,EAAI,GAAG,wBAAwB,EAAE,EAAE,EAAE,KAAE,EAAI,EAAE,CAAC,EAAE,EAAS,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