{"version":3,"file":"LoopVideo.trlHJ3um.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_D6uXRwWs","ControlType","LoopVideo","props","ref","video","observer","entry","src","radius","label","fit","init_LoopVideo"],"sources":["https:/framerusercontent.com/modules/uLBV0Zbq7UUkmSQ2vfeJ/6k5ERHiVgkYApwd7nykI/LoopVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * Silent looping clip (autoplay, muted, inline). Pauses while off screen.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LoopVideo(props){const{src,fit=\"contain\",background=\"#F4EFE8\",radius=0,label=\"\"}=props;const ref=useRef(null);useEffect(()=>{const video=ref.current;if(!video||typeof IntersectionObserver===\"undefined\")return;const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting)video.play().catch(()=>{});else video.pause();});observer.observe(video);return()=>observer.disconnect();},[src]);return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background,borderRadius:radius},children:src&&/*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,autoPlay:true,muted:true,loop:true,playsInline:true,preload:\"auto\",\"aria-label\":label||undefined,\"aria-hidden\":label?undefined:true,style:{width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"}})});}addPropertyControls(LoopVideo,{src:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"contain\",\"cover\"],optionTitles:[\"Fit\",\"Fill\"],defaultValue:\"contain\",displaySegmentedControl:true},background:{type:ControlType.Color,title:\"Achtergrond\",defaultValue:\"#F4EFE8\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:40,unit:\"px\"},label:{type:ControlType.String,title:\"Beschrijving\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoopVideo.map"],"mappings":"A,iLAKG,SAAwBU,EAAU,EAAM,CAAC,GAAK,CAAC,MAAI,MAAI,UAAU,aAAW,UAAU,SAAO,EAAE,QAAM,IAAIC,EAAYC,EAAIZ,EAAO,IAAI,EAAmS,OAAjSK,MAAc,CAAC,IAAMQ,EAAMD,EAAI,QAAQ,GAAG,CAACC,GAAO,OAAO,qBAAuB,IAAY,OAAO,IAAMC,EAAS,IAAI,sBAAsB,CAACC,KAAS,CAAIA,EAAM,eAAeF,EAAM,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,EAAOA,EAAM,MAAM,CAAE,CAAC,EAA0B,OAAxBC,EAAS,QAAQD,CAAK,MAAYC,EAAS,WAAW,CAAE,EAAE,CAACE,CAAG,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,GAAGL,EAAM,MAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,aAAW,aAAaM,CAAM,EAAE,SAASD,GAAkB,gBAAK,QAAQ,CAAK,MAAQ,MAAI,SAAS,GAAK,MAAM,GAAK,KAAK,GAAK,YAAY,GAAK,QAAQ,OAAO,aAAaE,GAAO,IAAA,GAAU,cAAc,IAAM,IAAA,GAAe,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,UAAUC,EAAI,QAAQ,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,C,0CAACZ,EAAoBG,EAAU,CAAC,IAAI,CAAC,KAAKD,EAAY,KAAK,MAAM,QAAQ,iBAAiB,CAAC,MAAM,OAAO,KAAK,C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