{"version":3,"file":"MasterclassOverlay.DGXCPJyu.mjs","names":["useState","useRef","useCallback","useEffect","startTransition","useMemo","_jsx","_jsxs","__esmMin","window","pe","te","init_ssg_sandbox_shims","init_npm_react_18_3_1","ce","init_jsx_runtime","ne","c","_e","de","MasterclassOverlay","props","overlayBackground","bottomBackground","copyColor","copyText","isVisible","setIsVisible","iframeHeight","setIframeHeight","videoRef","iframeRef","shouldShowFromUrl","search","hash","updateVisibility","video","handler","nextHeight","closeOverlay","url","params","nextUrl","overlayStyle","videoStyle","contentStyle","bottomSectionStyle","copyStyle","formContainerWrapStyle","closeButtonStyle","p","event","init_MasterclassOverlay"],"sources":["https:/framerusercontent.com/modules/B1hZaHi8H5KYC33SRyNv/Av5DosaZttAY0SvcJAXc/MasterclassOverlay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MasterclassOverlay(props){const{overlayBackground=\"rgba(0, 0, 0, 0.8)\",bottomBackground=\"rgb(39, 80, 69)\",copyColor=\"#FFFFFF\",copyText=\"Leave your email and get access to the next masterclass now!\"}=props;const[isVisible,setIsVisible]=useState(false);const[iframeHeight,setIframeHeight]=useState(\"200px\");const videoRef=useRef(null);const iframeRef=useRef(null);const shouldShowFromUrl=useCallback(()=>{if(typeof window!==\"undefined\"){const{search,hash}=window.location;const params=new URLSearchParams(search);return params.get(\"play\")===\"masterclass\"||hash===\"#watch-masterclass\";}return false;},[]);useEffect(()=>{const updateVisibility=()=>{startTransition(()=>setIsVisible(shouldShowFromUrl()));};if(typeof window!==\"undefined\"){updateVisibility();window.addEventListener(\"popstate\",updateVisibility);window.addEventListener(\"hashchange\",updateVisibility);return()=>{window.removeEventListener(\"popstate\",updateVisibility);window.removeEventListener(\"hashchange\",updateVisibility);};}return undefined;},[shouldShowFromUrl]);useEffect(()=>{if(!isVisible)return;const video=videoRef.current;if(!video)return;void video.play().catch(()=>{});},[isVisible]);useEffect(()=>{if(typeof window===\"undefined\")return;const handler=e=>{if(e.data?.type===\"hsFormHeight\"){const nextHeight=`${e.data.height+20}px`;startTransition(()=>setIframeHeight(nextHeight));}};window.addEventListener(\"message\",handler);return()=>window.removeEventListener(\"message\",handler);},[]);const closeOverlay=useCallback(()=>{if(typeof window!==\"undefined\"){const url=new URL(window.location.href);const params=new URLSearchParams(url.search);if(params.get(\"play\")===\"masterclass\"){params.delete(\"play\");}if(url.hash===\"#watch-masterclass\"){url.hash=\"\";}const search=params.toString();const nextUrl=`${url.pathname}${search?`?${search}`:\"\"}${url.hash}`;window.history.pushState({},\"\",nextUrl);}startTransition(()=>setIsVisible(false));},[]);const overlayStyle=useMemo(()=>({position:\"fixed\",inset:0,zIndex:9999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:overlayBackground}),[overlayBackground]);const videoStyle=useMemo(()=>({width:\"60%\",maxWidth:\"900px\",height:\"auto\",aspectRatio:\"16 / 9\",display:\"block\",borderRadius:\"6px\"}),[]);const contentStyle=useMemo(()=>({width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:\"24px\"}),[]);const bottomSectionStyle=useMemo(()=>({width:\"100%\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"space-between\",gap:\"48px\",padding:\"16px 112px\",background:bottomBackground,boxSizing:\"border-box\"}),[bottomBackground]);const copyStyle=useMemo(()=>({color:copyColor,fontSize:\"20px\",fontFamily:\"Gilroy-SemiBold\",lineHeight:1.44,margin:0,flex:\"0 1 auto\"}),[copyColor]);const formContainerWrapStyle=useMemo(()=>({width:\"100%\",maxWidth:\"560px\",minWidth:0,flex:\"1 1 auto\"}),[]);const closeButtonStyle=useMemo(()=>({position:\"absolute\",top:\"20px\",right:\"24px\",background:\"transparent\",border:\"none\",color:\"#FFFFFF\",fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',fontSize:\"32px\",lineHeight:1,cursor:\"pointer\",padding:0}),[]);if(!isVisible)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{style:overlayStyle,onClick:closeOverlay,role:\"dialog\",\"aria-modal\":\"true\",children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Close masterclass video\",style:closeButtonStyle,onClick:closeOverlay,children:\"\\xd7\"}),/*#__PURE__*/_jsxs(\"div\",{onClick:event=>event.stopPropagation(),style:contentStyle,children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:\"https://framerusercontent.com/assets/jKpis5XsNeRxbivBlRS1Yc4ZKNY.mp4\",autoPlay:true,controls:true,muted:true,playsInline:true,style:videoStyle}),/*#__PURE__*/_jsxs(\"div\",{style:bottomSectionStyle,children:[/*#__PURE__*/_jsx(\"p\",{style:copyStyle,children:copyText}),/*#__PURE__*/_jsx(\"div\",{style:formContainerWrapStyle,children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,srcDoc:`<!DOCTYPE html>\n<html>\n<head>\n<style>\n  body { margin: 0; padding: 0; background: transparent; font-family: Gilroy-SemiBold, sans-serif; }\n  .hs-form-field label { color: white; font-size: 14px; }\n  .hs-form-field input { background: white; color: #111; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px; padding: 10px 14px; font-size: 15px; width: 100%; box-sizing: border-box; }\n  .hs-button { background: #111111; color: white; border: none; border-radius: 6px; padding: 10px 20px; font-size: 15px; cursor: pointer; width: 100%; margin-top: 8px; }\n  .hs-error-msgs label { color: #ff6b6b; }\n  * { color: white; }\n</style>\n</head>\n<body>\n<script charset=\"utf-8\" type=\"text/javascript\" src=\"//js.hsforms.net/forms/embed/v2.js\"></script>\n<script>\n  hbspt.forms.create({ region: \"eu1\", portalId: \"144557791\", formId: \"c7f50ab1-4b46-478b-82a9-431512c0b361\" });\n  function sendHeight() {\n    window.parent.postMessage({ type: 'hsFormHeight', height: document.body.scrollHeight }, '*');\n  }\n  // Send after form renders\n  setTimeout(sendHeight, 800);\n  // Also send on any DOM changes\n  new MutationObserver(sendHeight).observe(document.body, { childList: true, subtree: true });\n</script>\n</body>\n</html>`,style:{width:\"100%\",height:iframeHeight,border:\"none\",background:\"transparent\"},title:\"Masterclass signup form\"})})]})]})]})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MasterclassOverlay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MasterclassOverlay.map"],"mappings":"A,qKAGG,SAAwBoB,EAAmBC,EAAM,CAAC,GAAK,CAACC,oBAAkB,qBAAqBC,mBAAiB,kBAAkBC,YAAU,UAAUC,WAAS,gEAAgEJ,EAAW,CAACK,EAAUC,GAAc3B,EAAS,EAAK,EAAO,CAAC4B,EAAaC,GAAiB7B,EAAS,OAAO,EAAQ8B,EAAS7B,EAAO,IAAI,EAAQ8B,EAAU9B,EAAO,IAAI,EAAQ+B,EAAkB9B,MAAgB,CAAC,GAAUO,IAAS,OAAY,CAAC,GAAK,CAACwB,SAAOC,QAAMzB,EAAO,SAAkD,OAAO,IAA/B,gBAAgBwB,CAAoB,CAAC,CAAC,IAAI,MAAM,IAAI,eAAeC,IAAO,oBAAqB,CAAC,MAAO,EAAM,EAAE,CAAC,CAAC,EAAE/B,MAAc,CAAC,IAAMgC,MAAqB,CAAC/B,MAAoBuB,EAAaK,EAAkB,CAAC,CAAC,CAAE,EAAE,GAAUvB,IAAS,OAA4I,OAA/H0B,EAAiB,EAAE1B,EAAO,iBAAiB,WAAW0B,CAAgB,EAAE1B,EAAO,iBAAiB,aAAa0B,CAAgB,MAAY,CAAC1B,EAAO,oBAAoB,WAAW0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