{"version":3,"file":"FormPopup.BwrCUtXw.mjs","names":["React.useState","React.useRef","React.useId","React.useCallback","_Fragment","__esmMin","ie","init_ssg_sandbox_shims","ne","window","_e","Ha","de","init_npm_react_dom_18_3_1","c","p","init_npm_react_18_3_1","ce","addPropertyControls","useIsStaticRenderer","ControlType","init_framer_Bf4_tcb2","FormPopup","props","isStatic","open","setOpen","returnFocus","closeRef","linkRef","cls","safeUrl","url","cleanHash","hash","family","fontFamily","openIt","closeIt","back","onClick","event","target","link","href","onHash","previous","onKey","items","active","index","item","timer","css","ink","surface","line","style","muted","buttonLabel","modal","title","radius","init_FormPopup","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/s7hnw2jNjcEXfdYCWaIl/UABEXcNnWLeYJlWx66N6/FormPopup.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";// @ts-ignore react-dom ships with Framer at runtime; the editor type checker has no declarations for it\nimport{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function FormPopup(props){const{url=\"\",title=\"Request a call\",hash=\"request-a-call\",buttonLabel=\"\",surface=\"#FBFAF8\",ink=\"#161514\",muted=\"#686560\",line=\"rgba(22, 21, 20, 0.14)\",radius=24,fontFamily=\"Plus Jakarta Sans\",style}=props;const isStatic=useIsStaticRenderer();const[open,setOpen]=React.useState(false);const returnFocus=React.useRef(null);const closeRef=React.useRef(null);const linkRef=React.useRef(null);const uid=React.useId().replace(/[^a-zA-Z0-9]/g,\"\");const cls=`dnfp${uid}`;const safeUrl=/^https:\\/\\//i.test(String(url||\"\").trim())?String(url).trim():\"\";const cleanHash=String(hash||\"request-a-call\").replace(/^#/,\"\");const family=`\"${fontFamily}\", \"Plus Jakarta Sans\", system-ui, sans-serif`;const openIt=React.useCallback(()=>{if(typeof document!==\"undefined\")returnFocus.current=document.activeElement;setOpen(true);},[]);const closeIt=React.useCallback(()=>{setOpen(false);if(typeof window!==\"undefined\"&&window.location.hash===`#${cleanHash}`){try{window.history.replaceState(null,\"\",window.location.pathname+window.location.search);}catch(error){}}const back=returnFocus.current;if(back&&typeof back.focus===\"function\")setTimeout(()=>back.focus(),0);},[cleanHash]);// Links to #request-a-call, and the address hash, open the window.\nReact.useEffect(()=>{if(typeof window===\"undefined\"||!safeUrl)return;const onClick=event=>{if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;const target=event.target;const link=target&&typeof target.closest===\"function\"?target.closest(\"a[href]\"):null;if(!link)return;const href=link.getAttribute(\"href\")||\"\";if(href===`#${cleanHash}`||href.endsWith(`#${cleanHash}`)){event.preventDefault();event.stopPropagation();openIt();}};const onHash=()=>{if(window.location.hash===`#${cleanHash}`)openIt();};document.addEventListener(\"click\",onClick,true);window.addEventListener(\"hashchange\",onHash);onHash();return()=>{document.removeEventListener(\"click\",onClick,true);window.removeEventListener(\"hashchange\",onHash);};},[safeUrl,cleanHash,openIt]);// While open: lock page scroll, close on Escape, keep Tab inside the window, focus the close button.\nReact.useEffect(()=>{if(!open||typeof document===\"undefined\")return;const previous=document.body.style.overflow;document.body.style.overflow=\"hidden\";const onKey=event=>{if(event.key===\"Escape\"){closeIt();return;}if(event.key!==\"Tab\")return;const items=[closeRef.current,linkRef.current].filter(Boolean);if(items.length===0)return;const active=document.activeElement;const index=items.findIndex(item=>item===active);if(event.shiftKey&&index<=0){event.preventDefault();items[items.length-1].focus();}else if(!event.shiftKey&&index===items.length-1){event.preventDefault();items[0].focus();}};window.addEventListener(\"keydown\",onKey);const timer=setTimeout(()=>closeRef.current&&closeRef.current.focus(),30);return()=>{clearTimeout(timer);document.body.style.overflow=previous;window.removeEventListener(\"keydown\",onKey);};},[open,closeIt]);const css=`\n.${cls}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 28px;border-radius:999px;border:1px solid ${ink};background:transparent;color:${ink};font:inherit;font-size:16px;font-weight:600;letter-spacing:-0.01em;cursor:pointer;width:max-content;transition:background .18s ease,color .18s ease}\n.${cls}.btn:hover{background:${ink};color:${surface}}\n.${cls}.btn:focus-visible,.${cls} :focus-visible{outline:2px solid ${ink};outline-offset:2px}\n.${cls}.overlay .lnk{font-size:14px;font-weight:600;color:${ink};text-decoration:none;border-bottom:1px solid ${line};padding-bottom:2px}\n.${cls}.overlay .lnk:hover{border-bottom-color:${ink}}\n@media (max-width: 640px){\n.${cls}.overlay{padding:0 !important}\n.${cls}.overlay .panel{width:100% !important;height:100% !important;border-radius:0 !important}\n}`;if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"10px 14px\",minWidth:220,border:`1px dashed ${line}`,borderRadius:12,fontFamily:family,fontSize:13,color:muted},children:buttonLabel?`${buttonLabel} (opens the form)`:`Form window: opens from links to #${cleanHash}`});}const modal=open&&safeUrl&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{className:`${cls} overlay`,\"data-lenis-prevent\":\"\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":title,onClick:event=>{if(event.target===event.currentTarget)closeIt();},style:{position:\"fixed\",inset:0,zIndex:2147483e3,background:\"rgba(22, 21, 20, 0.56)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:16,fontFamily:family,color:ink},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsxs(\"div\",{className:\"panel\",style:{width:\"min(760px, 100%)\",height:\"min(880px, 100%)\",background:surface,borderRadius:radius,overflow:\"hidden\",display:\"flex\",flexDirection:\"column\",boxShadow:\"0 40px 80px -20px rgba(0, 0, 0, 0.5)\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,padding:\"14px 18px\",borderBottom:`1px solid ${line}`},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:15,fontWeight:600,letterSpacing:\"-0.01em\"},children:title}),/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",alignItems:\"center\",gap:16},children:[/*#__PURE__*/_jsx(\"a\",{ref:linkRef,className:\"lnk\",href:safeUrl,target:\"_blank\",rel:\"noopener\",children:\"Open in a new tab\"}),/*#__PURE__*/_jsx(\"button\",{ref:closeRef,type:\"button\",\"aria-label\":\"Close\",onClick:closeIt,style:{width:36,height:36,borderRadius:999,border:`1px solid ${line}`,background:surface,color:ink,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:20,lineHeight:1,cursor:\"pointer\"},children:\"\\xd7\"})]})]}),/*#__PURE__*/_jsx(\"iframe\",{src:safeUrl,title:title,style:{flex:1,width:\"100%\",border:0,background:\"#FFFFFF\"}})]})]}),document.body):null;return /*#__PURE__*/_jsxs(_Fragment,{children:[buttonLabel&&safeUrl?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:`${cls} btn`,\"aria-haspopup\":\"dialog\",onClick:openIt,style:{...style,fontFamily:family},children:buttonLabel})]}):/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{...style,display:\"block\",width:0,height:0}}),modal]});}addPropertyControls(FormPopup,{url:{type:ControlType.Link,title:\"Form link\"},title:{type:ControlType.String,title:\"Window title\",defaultValue:\"Request a call\"},hash:{type:ControlType.String,title:\"Opens from\",defaultValue:\"request-a-call\",description:\"Links to this address hash open the window, for example #request-a-call.\"},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"\",description:\"Leave empty to show no button here; links to the hash still open the window.\"},surface:{type:ControlType.Color,title:\"Window\",defaultValue:\"#FBFAF8\"},ink:{type:ControlType.Color,title:\"Text\",defaultValue:\"#161514\"},muted:{type:ControlType.Color,title:\"Muted text\",defaultValue:\"#686560\"},line:{type:ControlType.Color,title:\"Lines\",defaultValue:\"rgba(22, 21, 20, 0.14)\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:24,min:0,max:48,step:1},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Plus Jakarta Sans\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormPopup\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormPopup.map"],"mappings":"A,8OAIG,SAAwBsB,EAAU,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,QAAM,iBAAiB,OAAK,iBAAiB,cAAY,GAAG,UAAQ,UAAU,MAAI,UAAU,QAAM,UAAU,OAAK,yBAAyB,SAAO,GAAG,aAAW,oBAAoB,SAAOC,EAAYC,EAASL,EAAoB,EAAO,CAACM,EAAKC,GAAS1B,EAAe,EAAK,EAAQ2B,EAAY1B,EAAa,IAAI,EAAQ2B,EAAS3B,EAAa,IAAI,EAAQ4B,EAAQ5B,EAAa,IAAI,EAA4D6B,EAAI,OAApD5B,EAAY,CAAC,CAAC,QAAQ,gBAAgB,EAAuB,IAAU6B,EAAQ,eAAe,KAAK,OAAOC,GAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,OAAOA,CAAG,CAAC,CAAC,KAAK,EAAE,GAASC,EAAU,OAAOC,GAAM,gBAAgB,CAAC,CAAC,QAAQ,KAAK,EAAE,EAAQC,EAAO,IAAIC,EAAW,+CAAqDC,EAAOlC,MAAsB,CAAI,OAAO,SAAW,MAAY,EAAY,QAAQ,SAAS,eAAcuB,EAAQ,EAAI,CAAE,EAAE,CAAC,CAAC,EAAQY,EAAQnC,MAAsB,CAAgB,GAAfuB,EAAQ,EAAK,EAAYjB,IAAS,QAAaA,EAAO,SAAS,OAAO,IAAIwB,IAAa,GAAG,CAACxB,EAAO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