{"version":3,"file":"FormPrefill.DVBkSBG_.mjs","names":["useRef","__esmMin","init_ssg_sandbox_shims","window","c","J","init_jsx_runtime","ce","init_npm_react_18_3_1","de","apply","root","key","value","MAP","select","withInterestFromLink","local","onHash","Component","props","el","ref","init_FormPrefill","\"partnership\""],"sources":["https:/framerusercontent.com/modules/HbmuFlJL2zeGU85wFd99/mdzaRiy4p4gSqmhqwJio/FormPrefill.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";const MAP={\"one-off\":\"A one-off case study\",\"partnership\":\"A partnership\"};function apply(root){if(typeof window===\"undefined\"||!root)return;const key=window.location.hash.replace(\"#\",\"\");const value=MAP[key];if(!value)return;const select=root.tagName===\"SELECT\"?root:root.querySelector(\"select\");if(!select)return;select.value=value;select.dispatchEvent(new Event(\"change\",{bubbles:true}));}/** Pre-selects the enquiry type when someone arrives via #one-off or #partnership. */export function withInterestFromLink(Component){return /*#__PURE__*/forwardRef(function InterestFromLink(props,ref){const local=useRef(null);useEffect(()=>{apply(local.current);const onHash=()=>setTimeout(()=>apply(local.current),50);window.addEventListener(\"hashchange\",onHash);return()=>window.removeEventListener(\"hashchange\",onHash);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:el=>{local.current=el;if(typeof ref===\"function\")ref(el);else if(ref)ref.current=el;}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withInterestFromLink\":{\"type\":\"reactHoc\",\"name\":\"withInterestFromLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormPrefill.map"],"mappings":"A,8IAAqK,SAASU,EAAM,EAAK,CAAC,GAAUP,IAAS,QAAa,CAACQ,EAAK,OAAO,IAAMC,EAAIT,EAAO,SAAS,KAAK,QAAQ,IAAI,EAAE,EAAQU,EAAMC,EAAIF,GAAK,GAAG,CAACC,EAAM,OAAO,IAAME,EAAOJ,EAAK,UAAU,SAASA,EAAKA,EAAK,cAAc,QAAQ,EAAMI,IAAc,EAAO,MAAMF,EAAME,EAAO,cAAc,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAI,CAAC,CAAC,EAAE,CAAuF,SAAgBC,EAAqB,EAAU,CAAC,MAAoB,gBAAW,SAA0B,EAAM,EAAI,CAAC,IAAMC,EAAMjB,EAAO,IAAI,EAA4M,OAA1MO,MAAc,CAACG,EAAMO,EAAM,OAAO,EAAE,IAAMC,MAAW,eAAeR,EAAMO,EAAM,OAAO,EAAE,EAAE,EAA+C,OAA7Cd,EAAO,iBAAiB,aAAae,CAAM,MAAYf,EAAO,oBAAoB,aAAae,CAAM,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAKC,EAAU,CAAC,GAAGC,EAAM,IAAI,GAAI,CAAC,EAAM,QAAQC,EAAM,OAAOC,GAAM,WAAWA,EAAID,CAAE,EAAUC,IAAI,EAAI,QAAQD,EAAG,CAAC,CAAC,CAAE,CAAC,CAAE,C,gDAA37B,EAAI,CAAC,UAAU,uBAAuBG,YAAc,eAAe,C"}