{"version":3,"file":"GuideVideoPlayer.DXQDGj8e.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/DCkfEt5SQvkNBvD3Yyoi/Mqj6k4p0bubHpjzTCzrF/GuideVideoPlayer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 1280\n * @framerIntrinsicHeight 744\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function GuideVideoPlayer({videoFile=\"\",poster,background=\"#FFF1E3\",accent=\"#FFC38A\",title=\"guide video\",style}){const video=React.useRef(null);const[started,setStarted]=React.useState(false);const[error,setError]=React.useState(\"\");React.useEffect(()=>{setStarted(false);setError(\"\");},[videoFile]);const play=()=>{if(!video.current||!videoFile)return;setError(\"\");const result=video.current.play();if(result)result.catch(()=>{setStarted(false);setError(\"Unable to play this video. Please try again.\");});};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background,borderRadius:\"inherit\"},children:[/*#__PURE__*/_jsx(\"style\",{children:\".wl-guide-play:focus-visible{outline:3px solid #202020;outline-offset:-6px}.wl-guide-play:not(:disabled):hover span{transform:scale(1.06)}@media(prefers-reduced-motion:reduce){.wl-guide-play span{transition:none!important}}\"}),videoFile&&/*#__PURE__*/_jsx(\"video\",{ref:video,src:videoFile,preload:\"none\",playsInline:true,controls:started,autoPlay:false,\"aria-label\":title,onPlay:()=>setStarted(true),onEnded:()=>setStarted(false),onError:()=>{setStarted(false);setError(\"Unable to load this video. Please try again later.\");},style:{display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"contain\",background:\"#000\",opacity:started?1:0}},videoFile),!started&&/*#__PURE__*/_jsx(\"button\",{className:\"wl-guide-play\",type:\"button\",disabled:!videoFile,\"aria-label\":videoFile?\"Play \"+title:\"Video not available\",onClick:play,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0,padding:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background,backgroundImage:poster?.src?\"url(\"+JSON.stringify(poster.src)+\")\":undefined,backgroundPosition:\"center\",backgroundSize:\"cover\",cursor:videoFile?\"pointer\":\"default\"},children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"clamp(64px, 8vw, 100px)\",height:\"clamp(64px, 8vw, 100px)\",borderRadius:\"50%\",background:accent,transition:\"transform 150ms ease\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 48 48\",width:\"48%\",height:\"48%\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 7 Q12 5 12 10 V38 Q12 43 16 40 L42 25 Q46 22 42 19 Z\",fill:background})})})}),error&&/*#__PURE__*/_jsx(\"p\",{role:\"alert\",style:{position:\"absolute\",bottom:16,left:16,right:16,margin:0,padding:\"12px 16px\",background:\"white\",color:\"#202020\",fontFamily:\"sans-serif\",fontSize:14,textAlign:\"center\"},children:error})]});}addPropertyControls(GuideVideoPlayer,{videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},poster:{type:ControlType.ResponsiveImage,title:\"Cover Image\"},title:{type:ControlType.String,title:\"Video Title\",defaultValue:\"guide video\"},background:{type:ControlType.Color,title:\"Cover Colour\",defaultValue:\"#FFF1E3\"},accent:{type:ControlType.Color,title:\"Play Colour\",defaultValue:\"#FFC38A\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GuideVideoPlayer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1280\",\"framerIntrinsicHeight\":\"744\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GuideVide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