{"version":3,"file":"WatchDemoButton.DBmJD1tX.mjs","names":["React.useState","p"],"sources":["https:/framerusercontent.com/modules/5Ou5wQHXfh9SxRnmiJTs/ICMcNcKFVBrQ6LF74aDy/WatchDemoButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import*as ReactDOM from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Watch Demo button that opens a fullscreen modal video on click.\n * Supports Wistia, YouTube, Loom, Vimeo, or direct video file URLs.\n *\n * The modal is rendered in a portal attached to document.body so that\n * `position: fixed` always anchors to the viewport, regardless of any\n * ancestor transforms / filters applied by Framer's wrappers.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 448\n * @framerIntrinsicHeight 56\n */export default function WatchDemoButton(props){const{label=\"Watch demo\",videoUrl=\"https://august-law.wistia.com/medias/mfue3vi0w8\",buttonBackground=\"rgba(0, 0, 0, 0.12)\",buttonHoverBackground=\"rgba(0, 0, 0, 0.2)\",textColor=\"#FFFFFF\",modalBackground=\"rgba(255, 255, 255, 0.2)\",modalBlur=20,font,borderRadius=90,modalMaxWidth=880,videoAspect=\"16 / 9\"}=props;const[phase,setPhase]=React.useState(\"closed\");const[hover,setHover]=React.useState(false);const ENTER_MS=520;const EXIT_MS=380;const setOpen=v=>{if(v){setPhase(\"opening\");}else{setPhase(p=>{if(p===\"opening\"){window.setTimeout(()=>{setPhase(cur=>cur===\"closing\"?\"closed\":cur);},EXIT_MS);return\"closing\";}return p;});}};React.useEffect(()=>{if(phase===\"closed\")return;const onKey=e=>{if(e.key===\"Escape\")setOpen(false);};const prevOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";window.addEventListener(\"keydown\",onKey);return()=>{window.removeEventListener(\"keydown\",onKey);document.body.style.overflow=prevOverflow;};},[phase]);const resolved=resolveVideo(videoUrl);const playerStyle={width:\"100%\",height:\"100%\",display:\"block\",border:\"0\",outline:\"none\",background:\"transparent\",boxShadow:\"none\",colorScheme:\"normal\"};const easing=\"cubic-bezier(0.22, 1, 0.36, 1)\";const easeIn=\"cubic-bezier(0.4, 0, 0.6, 1)\";// Only access document on the client\nconst portalTarget=typeof document!==\"undefined\"?document.body:null;const modal=phase!==\"closed\"&&portalTarget?/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",onClick:()=>setOpen(false),style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,width:\"100vw\",height:\"100vh\",background:modalBackground,zIndex:2147483647,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",padding:24,gap:12,backdropFilter:`blur(${modalBlur}px)`,WebkitBackdropFilter:`blur(${modalBlur}px)`,animation:phase===\"opening\"?`wdb-overlay-in ${ENTER_MS}ms ${easing} both`:`wdb-overlay-out ${EXIT_MS}ms ${easeIn} both`},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setOpen(false),\"aria-label\":\"Close\",style:{alignSelf:\"flex-end\",width:32,height:32,borderRadius:\"50%\",border:\"none\",cursor:\"pointer\",background:\"rgba(0,0,0,0.55)\",color:\"#fff\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:18,lineHeight:1,marginRight:\"max(0px, calc((100vw - 48px - \"+modalMaxWidth+\"px) / 2))\",animation:phase===\"opening\"?`wdb-close-in ${ENTER_MS}ms ${easing} both`:`wdb-close-out ${EXIT_MS}ms ${easeIn} both`},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"div\",{onClick:e=>e.stopPropagation(),style:{position:\"relative\",width:`min(${modalMaxWidth}px, 100%)`,maxHeight:\"calc(100vh - 120px)\",aspectRatio:videoAspect,background:\"transparent\",borderRadius:0,overflow:\"visible\",boxShadow:\"none\",border:\"0\",transformOrigin:\"center center\",willChange:\"transform, opacity\",animation:phase===\"opening\"?`wdb-card-in ${ENTER_MS}ms ${easing} both`:`wdb-card-out ${EXIT_MS}ms ${easeIn} both`},children:resolved.kind===\"iframe\"?/*#__PURE__*/_jsx(\"iframe\",{src:resolved.url,title:label,allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,frameBorder:0,style:playerStyle}):/*#__PURE__*/_jsx(\"video\",{src:resolved.url,controls:true,autoPlay:true,playsInline:true,style:{...playerStyle,objectFit:\"contain\"}})}),/*#__PURE__*/_jsx(\"style\",{children:`\n                          @keyframes wdb-overlay-in {\n                              from { opacity: 0; }\n                              to   { opacity: 1; }\n                          }\n                          @keyframes wdb-overlay-out {\n                              from { opacity: 1; }\n                              to   { opacity: 0; }\n                          }\n                          @keyframes wdb-card-in {\n                              from {\n                                  opacity: 0;\n                                  transform: translateY(28px) scale(0.94);\n                                  filter: blur(6px);\n                              }\n                              60% {\n                                  opacity: 1;\n                                  filter: blur(0);\n                              }\n                              to {\n                                  opacity: 1;\n                                  transform: translateY(0) scale(1);\n                                  filter: blur(0);\n                              }\n                          }\n                          @keyframes wdb-card-out {\n                              from {\n                                  opacity: 1;\n                                  transform: translateY(0) scale(1);\n                                  filter: blur(0);\n                              }\n                              to {\n                                  opacity: 0;\n                                  transform: translateY(20px) scale(0.96);\n                                  filter: blur(4px);\n                              }\n                          }\n                          @keyframes wdb-close-in {\n                              from { opacity: 0; transform: translateY(-10px); }\n                              40%  { opacity: 0; transform: translateY(-10px); }\n                              to   { opacity: 1; transform: translateY(0); }\n                          }\n                          @keyframes wdb-close-out {\n                              from { opacity: 1; transform: translateY(0); }\n                              to   { opacity: 0; transform: translateY(-8px); }\n                          }\n                      `})]}),portalTarget):null;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:()=>setOpen(true),onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),style:{appearance:\"none\",border:\"none\",cursor:\"pointer\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:10,padding:0,background:hover?buttonHoverBackground:buttonBackground,borderRadius,transition:\"background 160ms ease\",fontFamily:font?.fontFamily,fontSize:font?.fontSize,fontWeight:font?.fontWeight,fontStyle:font?.fontStyle,letterSpacing:font?.letterSpacing,lineHeight:font?.lineHeight,color:textColor},\"aria-label\":label,children:[/*#__PURE__*/_jsx(\"svg\",{width:\"14\",height:\"14\",viewBox:\"0 0 14 14\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3 1.5L12 7L3 12.5V1.5Z\",fill:textColor})}),/*#__PURE__*/_jsx(\"span\",{children:label})]}),modal]});}function resolveVideo(input){if(!input)return{kind:\"file\",url:\"\"};const url=String(input).trim();const wistia=url.match(/wistia\\.com\\/medias\\/([A-Za-z0-9]+)/);if(wistia){const id=wistia[1];return{kind:\"iframe\",url:`https://fast.wistia.net/embed/iframe/${id}?autoPlay=true&playerColor=000000&playbar=true&videoFoam=true&fitStrategy=contain`};}if(/fast\\.wistia\\.net\\/embed\\/iframe\\//.test(url)){return{kind:\"iframe\",url};}const ytWatch=url.match(/youtube\\.com\\/watch\\?v=([A-Za-z0-9_-]+)/);const ytShort=url.match(/youtu\\.be\\/([A-Za-z0-9_-]+)/);const ytId=ytWatch?.[1]||ytShort?.[1];if(ytId){return{kind:\"iframe\",url:`https://www.youtube.com/embed/${ytId}?autoplay=1&rel=0`};}if(/youtube\\.com\\/embed\\//.test(url)){return{kind:\"iframe\",url};}const vimeo=url.match(/vimeo\\.com\\/(\\d+)/);if(vimeo){return{kind:\"iframe\",url:`https://player.vimeo.com/video/${vimeo[1]}?autoplay=1`};}if(/player\\.vimeo\\.com\\/video\\//.test(url)){return{kind:\"iframe\",url};}const loom=url.match(/loom\\.com\\/(?:share|embed)\\/([A-Za-z0-9]+)/);if(loom){return{kind:\"iframe\",url:`https://www.loom.com/embed/${loom[1]}?autoplay=true`};}if(/\\.(mp4|webm|mov|m4v|ogg)(\\?|$)/i.test(url)){return{kind:\"file\",url};}return{kind:\"iframe\",url};}addPropertyControls(WatchDemoButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Watch demo\"},videoUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"https://august-law.wistia.com/medias/mfue3vi0w8\",placeholder:\"Wistia, YouTube, Loom, Vimeo, or .mp4 URL\"},buttonBackground:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"rgba(0, 0, 0, 0.12)\"},buttonHoverBackground:{type:ControlType.Color,title:\"Hover BG\",defaultValue:\"rgba(0, 0, 0, 0.2)\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},modalBackground:{type:ControlType.Color,title:\"Modal BG\",defaultValue:\"rgba(255, 255, 255, 0.2)\"},modalBlur:{type:ControlType.Number,title:\"Modal Blur\",defaultValue:20,min:0,max:60,step:1,unit:\"px\"},modalMaxWidth:{type:ControlType.Number,title:\"Modal Width\",defaultValue:880,min:320,max:1600,step:10,unit:\"px\"},videoAspect:{type:ControlType.String,title:\"Aspect\",defaultValue:\"16 / 9\",placeholder:'\"16 / 9\", \"4 / 3\", \"1 / 1\"'},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:90,min:0,max:200,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WatchDemoButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"56\",\"framerIntrinsicWidth\":\"448\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./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