{"version":3,"file":"VimeoEmbed.B806DRk6.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/rgfT92PEmX1ScLUV1F4i/5dIORnCh0JIDqHHrDqLz/VimeoEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState,startTransition}from\"react\";/**\n * Full screen Vimeo video embed with autoplay and autoloop, no controls\n *\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 360\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VimeoEmbed(props){const{videoId=\"76979871\",videoFill=\"cover\"}=props;const iframeRef=useRef(null);const[isReady,setIsReady]=useState(false);const containerRef=useRef(null);const[dimensions,setDimensions]=useState({width:0,height:0});useEffect(()=>{if(typeof window===\"undefined\"||!containerRef.current)return;const updateDimensions=()=>{if(containerRef.current){const{offsetWidth,offsetHeight}=containerRef.current;startTransition(()=>setDimensions({width:offsetWidth,height:offsetHeight}));}};updateDimensions();window.addEventListener(\"resize\",updateDimensions);return()=>window.removeEventListener(\"resize\",updateDimensions);},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const handleMessage=event=>{if(event.origin!==\"https://player.vimeo.com\")return;try{const data=JSON.parse(event.data);if(data.event===\"ready\"){startTransition(()=>setIsReady(true));}}catch(e){// Ignore parsing errors\n}};window.addEventListener(\"message\",handleMessage);return()=>window.removeEventListener(\"message\",handleMessage);},[]);const vimeoUrl=`https://player.vimeo.com/video/${videoId}?autoplay=1&loop=1&autopause=0&muted=1&controls=0&title=0&byline=0&portrait=0&background=1`;// Calculate iframe dimensions based on videoFill mode\nconst getIframeStyle=()=>{if(videoFill===\"cover\"){// Assume 16:9 aspect ratio for Vimeo videos\nconst videoAspect=16/9;const containerAspect=dimensions.width/dimensions.height;let width,height;if(containerAspect>videoAspect){// Container is wider than video - fit to width\nwidth=dimensions.width;height=dimensions.width/videoAspect;}else{// Container is taller than video - fit to height\nheight=dimensions.height;width=dimensions.height*videoAspect;}return{position:\"absolute\",top:\"50%\",left:\"50%\",width:`${width}px`,height:`${height}px`,transform:\"translate(-50%, -50%)\",border:\"none\"};}else if(videoFill===\"fill\"){return{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"};}else{// contain mode\nreturn{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",border:\"none\"};}};return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor:\"#000\"},children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:vimeoUrl,style:getIframeStyle(),allow:\"autoplay; fullscreen\",allowFullScreen:true,title:\"Vimeo video player\"})});}addPropertyControls(VimeoEmbed,{videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"76979871\",placeholder:\"Enter Vimeo video ID\"},videoFill:{type:ControlType.Enum,title:\"Video Fill\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover (No Borders)\",\"Contain (Show All)\",\"Fill (Stretch)\"],defaultValue:\"cover\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VimeoEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"360\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"640\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VimeoEmbed.map"],"mappings":"6MAQG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,WAAW,YAAU,SAAS,EAAY,EAAUA,EAAO,KAAK,CAAM,CAAC,EAAQ,GAAYC,EAAS,GAAM,CAAO,EAAaD,EAAO,KAAK,CAAM,CAAC,EAAW,GAAeC,EAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,C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