{"version":3,"file":"VideoButton.CFzgE2tD.mjs","names":["useState","_Fragment","__esmMin","te","_e","init_npm_react_dom_18_3_1","l","Ha","p","c","init_jsx_runtime","init_npm_react_18_3_1","RenderTarget","init_framer_CaDWdxiz","addPropertyControls","ControlType","VideoButton","props","isOpen","setIsOpen","isHovered","setIsHovered","embedUrl","urlObj","url","videoId","youTubeURL","isCanvas","handleOpen","handleClose","hasHoverColor","hoverBackground","hoverTextColor","hoverPlayIconColor","currentBackground","enableHover","showBackground","backgroundColor","currentTextColor","textColor","currentPlayIconColor","playIconColor","isFixedWidth","style","isFixedHeight","canUsePortal","overlay","overlayBackground","videoWidth","iconTextGap","glassBorderWidth","glassBorderColor","glassBlur","paddingVertical","paddingHorizontal","buttonFont","buttonText","showPlayIcon","playIconSize","showText","init_VideoButton"],"sources":["https:/framerusercontent.com/modules/geOg5zgoNX0LrPYYROEf/BGjd9i1OgEAWmPNZhVaP/VideoButton.js"],"sourcesContent":["// Button with YouTube video overlay - fully customizable button that opens a video overlay on click\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Video Button with YouTube Overlay\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 80\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoButton(props){const{buttonText=\"Watch Video\",showText=true,youTubeURL,showBackground=true,backgroundColor=\"#1F2937\",textColor=\"#FFFFFF\",buttonFont,borderRadius=8,showPlayIcon=true,playIconColor=\"#FFFFFF\",glassBlur=0,glassBorderColor=\"rgba(255, 255, 255, 0.4)\",glassBorderWidth=0,hoverBackground,hoverTextColor,hoverPlayIconColor,enableHover=true,overlayBackground=\"rgba(0, 0, 0, 0.9)\",videoWidth=80,videoHeight=60,paddingVertical=20,paddingHorizontal=40,playIconSize=32,iconTextGap=16,style}=props;const[isOpen,setIsOpen]=useState(false);const[isHovered,setIsHovered]=useState(false);const getYouTubeEmbedUrl=url=>{try{const urlObj=new URL(url);let videoId=\"\";if(urlObj.hostname.includes(\"youtube.com\")){videoId=urlObj.searchParams.get(\"v\")||\"\";}else if(urlObj.hostname.includes(\"youtu.be\")){videoId=urlObj.pathname.slice(1);}return videoId?`https://www.youtube.com/embed/${videoId}?autoplay=1&rel=0`:\"\";}catch{return\"\";}};const embedUrl=getYouTubeEmbedUrl(youTubeURL??\"\");// No playable URL means no button. This component sits on slides whose URL is\n// variable- or CMS-bound, so an unwired slide would otherwise render an affordance\n// that cannot do anything. Kept visible on the canvas so it stays selectable and\n// the missing URL is obvious to whoever is editing.\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;const handleOpen=()=>{if(!embedUrl)return;startTransition(()=>setIsOpen(true));};const handleClose=()=>{startTransition(()=>setIsOpen(false));};// When no hover colour is configured, fall back to the original\n// scale + fade hover. Dimming an explicitly chosen hover colour would\n// muddy it, so opacity is left alone once any hover colour is set.\nconst hasHoverColor=Boolean(hoverBackground||hoverTextColor||hoverPlayIconColor);const restBackground=showBackground?backgroundColor:\"transparent\";const currentBackground=enableHover&&isHovered&&hoverBackground?hoverBackground:restBackground;const currentTextColor=enableHover&&isHovered&&hoverTextColor?hoverTextColor:textColor;const currentPlayIconColor=enableHover&&isHovered&&hoverPlayIconColor?hoverPlayIconColor:playIconColor;const isFixedWidth=style?.width===\"100%\";const isFixedHeight=style?.height===\"100%\";const canUsePortal=typeof document!==\"undefined\";const overlay=isOpen?/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:overlayBackground,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:2147483647,padding:20},onClick:handleClose,role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":\"Video overlay\",children:[/*#__PURE__*/_jsx(\"button\",{onClick:handleClose,style:{position:\"fixed\",top:20,right:20,background:\"transparent\",border:\"none\",color:\"#FFFFFF\",fontSize:40,cursor:\"pointer\",padding:8,lineHeight:1,zIndex:2147483647},\"aria-label\":\"Close video\",children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:`${videoWidth}%`,maxWidth:\"1200px\",aspectRatio:\"16/9\"},onClick:e=>e.stopPropagation(),children:embedUrl?/*#__PURE__*/_jsx(\"iframe\",{src:embedUrl,style:{width:\"100%\",height:\"100%\",border:\"none\",borderRadius:0},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true,title:\"YouTube video player\"}):/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"#1F2937\",borderRadius:8,color:\"#FFFFFF\",fontSize:18},children:\"Invalid YouTube URL\"})})]}):null;if(!embedUrl&&!isCanvas)return null;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"button\",{onClick:handleOpen,style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:iconTextGap,backgroundColor:currentBackground,color:currentTextColor,border:glassBorderWidth&&glassBorderColor?`${glassBorderWidth}px solid ${glassBorderColor}`:\"none\",backdropFilter:glassBlur?`blur(${glassBlur}px)`:undefined,WebkitBackdropFilter:glassBlur?`blur(${glassBlur}px)`:undefined,borderRadius,cursor:\"pointer\",padding:`${paddingVertical}px ${paddingHorizontal}px`,transform:enableHover&&isHovered?\"scale(1.02)\":\"scale(1)\",opacity:enableHover&&isHovered&&!hasHoverColor?.9:1,transition:\"transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease\",...isFixedWidth?{}:{minWidth:\"max-content\"},...isFixedHeight?{}:{minHeight:\"max-content\"},...buttonFont},onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),\"aria-label\":buttonText?`Open video: ${buttonText}`:\"Play video\",children:[showPlayIcon&&/*#__PURE__*/_jsx(\"svg\",{width:playIconSize,height:playIconSize,viewBox:\"0 0 32 32\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",style:{marginLeft:!showText?playIconSize*.08:0},children:/*#__PURE__*/_jsx(\"path\",{d:\"M10 8L24 16L10 24V8Z\",fill:currentPlayIconColor,style:{transition:\"fill 0.2s ease\"}})}),showText&&buttonText?/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"nowrap\"},children:buttonText}):null]}),canUsePortal?/*#__PURE__*/createPortal(overlay,document.body):overlay]});}addPropertyControls(VideoButton,{buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Watch Video\",hidden:({showText})=>!showText},showText:{type:ControlType.Boolean,title:\"Show Text\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},youTubeURL:{type:ControlType.String,title:\"YouTube URL\",placeholder:\"https://www.youtube.com/watch?v=...\"},showBackground:{type:ControlType.Boolean,title:\"Show Background\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#1F2937\",hidden:({showBackground})=>!showBackground},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"24px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},showPlayIcon:{type:ControlType.Boolean,title:\"Show Play Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},playIconColor:{type:ControlType.Color,title:\"Play Icon Color\",defaultValue:\"#FFFFFF\",hidden:({showPlayIcon})=>!showPlayIcon},glassBlur:{type:ControlType.Number,title:\"Glass Blur\",defaultValue:0,min:0,max:40,step:1,unit:\"px\"},glassBorderColor:{type:ControlType.Color,title:\"Glass Border\",defaultValue:\"rgba(255, 255, 255, 0.4)\"},glassBorderWidth:{type:ControlType.Number,title:\"Glass Border Width\",defaultValue:0,min:0,max:8,step:1,unit:\"px\"},enableHover:{type:ControlType.Boolean,title:\"Enable Hover\",defaultValue:true},hoverBackground:{type:ControlType.Color,title:\"Hover Background\",optional:true},hoverTextColor:{type:ControlType.Color,title:\"Hover Text Color\",optional:true},hoverPlayIconColor:{type:ControlType.Color,title:\"Hover Play Icon Color\",optional:true,hidden:({showPlayIcon})=>!showPlayIcon},overlayBackground:{type:ControlType.Color,title:\"Overlay Background\",defaultValue:\"rgba(0, 0, 0, 0.9)\"},videoWidth:{type:ControlType.Number,title:\"Video Width\",defaultValue:80,min:50,max:100,step:5,unit:\"%\"},videoHeight:{type:ControlType.Number,title:\"Video Height\",defaultValue:60,min:40,max:100,step:5,unit:\"%\"},paddingVertical:{type:ControlType.Number,title:\"Padding Vertical\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},paddingHorizontal:{type:ControlType.Number,title:\"Padding Horizontal\",defaultValue:40,min:0,max:100,step:1,unit:\"px\"},playIconSize:{type:ControlType.Number,title:\"Play Icon Size\",defaultValue:32,min:16,max:64,step:2,unit:\"px\",hidden:({showPlayIcon})=>!showPlayIcon},iconTextGap:{type:ControlType.Number,title:\"Icon Text Gap\",defaultValue:16,min:0,max:50,step:1,unit:\"px\",hidden:({showPlayIcon})=>!showPlayIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"300\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"80\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoButton.map"],"mappings":"A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