{"version":3,"file":"Video.D4U6bco2.mjs","names":["useState","useRef","useId"],"sources":["https:/framerusercontent.com/modules/afAuJ77Ke40vBx246LEa/KZ7SaptaOnBba3b16YM4/Video.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState,useId}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function Video(props){const[videoSrc,setVideoSrc]=useState(null);const containerStyle={height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\"};const videoRef=useRef(null);const id=useId();useEffect(()=>{if(!videoSrc)return;const videoElement=videoRef.current;const handleIntersection=entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&entry.intersectionRatio>=.8){videoElement.play();}else{videoElement.pause();}});};const observer=new IntersectionObserver(handleIntersection,{threshold:Array.from({length:101},(_,i)=>i/100)});if(videoElement){observer.observe(videoElement);}return()=>{if(videoElement){observer.unobserve(videoElement);}};},[videoSrc]);useEffect(()=>{setVideoSrc(props.file);},[props.file]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:videoSrc?/*#__PURE__*/_jsxs(\"video\",{ref:videoRef,controls:false,autoPlay:true,muted:true,loop:true,playsInline:true,style:{objectFit:\"cover\",width:\"100%\",height:\"100%\",borderRadius:props.cornerRadius},children:[/*#__PURE__*/_jsx(\"source\",{src:videoSrc,type:\"video/mp4\"}),\"Your browser does not support HTML5 video.\"]}):/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",borderRadius:props.cornerRadius,backgroundColor:\"black\"}})},id);}Video.defaultProps={cornerRadius:0,file:[]};addPropertyControls(Video,{cornerRadius:{type:ControlType.Number,title:\"Corner Radius\"},file:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Video\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"vari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