{"version":3,"file":"ReelAutoplay.B-2YxS3D.mjs","names":["React.useRef","__esmMin","window","init_ssg_sandbox_shims","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","addPropertyControls","init_framer_BpuvUAiZ","ControlType","ReelAutoplay","props","ref","src","video","videoUrl","el","io","entry","reelUrl","style","radius","poster","showLabel","label","init_ReelAutoplay"],"sources":["https:/framerusercontent.com/modules/RRSYR6d8uzguqKgZ3UDE/a3N5SKRWd67mim6cb4cI/ReelAutoplay.js"],"sourcesContent":["// Muted, looping reel preview for service pages.\n// Plays silently while on screen (pauses when scrolled away), click opens the reel on Instagram.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ReelAutoplay(props){const{video,videoUrl,poster,reelUrl,label,showLabel,radius,style}=props;const ref=React.useRef(null);const src=video||videoUrl;React.useEffect(()=>{const el=ref.current;if(!el)return;el.muted=true;if(typeof IntersectionObserver===\"undefined\"){el.play().catch(()=>{});return;}const io=new IntersectionObserver(([entry])=>{if(entry.isIntersecting)el.play().catch(()=>{});else el.pause();},{threshold:.15});io.observe(el);return()=>io.disconnect();},[src]);const open=()=>{if(reelUrl)window.open(reelUrl,\"_blank\",\"noopener,noreferrer\");};return /*#__PURE__*/_jsxs(\"div\",{onClick:open,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,background:\"#111\",cursor:reelUrl?\"pointer\":\"default\"},children:[src?/*#__PURE__*/_jsx(\"video\",{ref:ref,src:src,poster:poster||undefined,muted:true,loop:true,playsInline:true,autoPlay:true,preload:\"metadata\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}):poster?/*#__PURE__*/_jsx(\"img\",{src:poster,alt:\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}):null,showLabel&&label?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:0,padding:\"40px 16px 14px\",background:\"linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0))\",color:\"#fff\",fontFamily:\"Inter, system-ui, sans-serif\",fontSize:14,fontWeight:500,pointerEvents:\"none\"},children:label}):null]});}ReelAutoplay.displayName=\"Reel Autoplay\";ReelAutoplay.defaultProps={video:\"\",videoUrl:\"\",poster:\"\",reelUrl:\"\",label:\"Watch on Instagram\",showLabel:true,radius:14};addPropertyControls(ReelAutoplay,{video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},videoUrl:{type:ControlType.String,title:\"Video URL\"},poster:{type:ControlType.Image,title:\"Poster\"},reelUrl:{type:ControlType.String,title:\"Reel Link\"},label:{type:ControlType.String,title:\"Label\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:60,defaultValue:14}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReelAutoplay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ReelAutoplay.map"],"mappings":"A,sMAKG,SAAwBa,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,WAAS,SAAO,UAAQ,QAAM,YAAU,SAAO,SAAOC,EAAYC,EAAIf,EAAa,IAAI,EAAQgB,EAAIC,GAAOC,EAAia,OAAxZX,MAAoB,CAAC,IAAMY,EAAGJ,EAAI,QAAQ,GAAG,CAACI,EAAG,OAAqB,GAAd,EAAG,MAAM,GAAQ,OAAO,qBAAuB,IAAY,CAACA,EAAG,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,MAAO,CAAC,I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