{"version":3,"file":"VideoWithMute.o9blYZP9.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/Q3ySvMFb8XqXn75Takxk/Y2xg3CErmNj9EpAPYYAc/VideoWithMute.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef,useEffect}from\"react\";export default function VideoMute({src,borderRadius=0,startDelay=0}){const videoRef=useRef(null);const[muted,setMuted]=useState(true);const toggleMute=()=>{const video=videoRef.current;if(!video)return;video.muted=!video.muted;setMuted(video.muted);};useEffect(()=>{const video=videoRef.current;if(!video)return;video.pause();const timer=setTimeout(()=>{video.play();},startDelay*1e3);return()=>clearTimeout(timer);},[startDelay]);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,autoPlay:startDelay===0,loop:true,muted:true,playsInline:true,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius,display:\"block\"}}),/*#__PURE__*/_jsx(\"button\",{onClick:toggleMute,style:{position:\"absolute\",bottom:16,right:16,background:\"rgba(0,0,0,0.5)\",border:\"none\",borderRadius:\"50%\",width:30,height:30,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"white\",fontSize:16},children:muted?/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"23\",y1:\"9\",x2:\"17\",y2:\"15\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"17\",y1:\"9\",x2:\"23\",y2:\"15\"})]}):/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"polygon\",{points:\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"})]})})]});}addPropertyControls(VideoMute,{src:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"webm\",\"mov\"],title:\"Video\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:100,unit:\"px\"},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:0,min:0,max:30,step:.5,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoMute\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoWithMute.map"],"mappings":"+LAA0J,SAAwB,EAAU,CAAC,MAAI,eAAa,EAAE,aAAW,GAAG,CAAC,IAAM,EAASA,EAAO,KAAK,CAAM,CAAC,EAAM,GAAUC,EAAS,GAAK,CAA0S,OAApL,MAAc,CAAC,IAAM,EAAM,EAAS,QAAQ,GAAG,CAAC,EAAM,OAAO,EAAM,OAAO,CAAC,IAAM,EAAM,eAAe,CAAC,EAAM,MAAM,EAAG,EAAW,IAAI,CAAC,UAAU,aAAa,EAAM,EAAG,CAAC,EAAW,CAAC,CAAqB,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,IAAI,EAAa,MAAI,SAAS,IAAa,EAAE,KAAK,GAAK,MAAM,GAAK,YAAY,GAAK,MAAM,CAA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