{"version":3,"file":"Form_test_1.CS83SL3R.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/cUiXkDF35njG34tzrRbR/sjuEie9SnvJEqScqbuGi/Form_test_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";function TallyForm(){const[currentPageUrl,setCurrentPageUrl]=useState(\"\");useEffect(()=>{// Ensure window object is available\nif(typeof window!==\"undefined\"){// Now we are safe to use window.location.href\nconst pageUrl=window.location.href;// Extract the last part of the URL\nconst lastSegment=pageUrl.split(\"/\").pop();// Replace dashes with spaces and capitalize words as before\nlet jobTitle=lastSegment.replace(/-/g,\" \").split(\" \").map(word=>word.length>=3?word.charAt(0).toUpperCase()+word.slice(1):word).join(\" \");setCurrentPageUrl(encodeURIComponent(jobTitle));}const scriptUrl=\"https://tally.so/widgets/embed.js\";const loadTallyScript=()=>{if(typeof Tally!==\"undefined\"){Tally.loadEmbeds();}else if(!document.querySelector(`script[src=\"${scriptUrl}\"]`)){const script=document.createElement(\"script\");script.src=scriptUrl;script.onload=()=>{if(typeof Tally!==\"undefined\"){Tally.loadEmbeds();}};script.onerror=()=>{console.error(\"Failed to load the Tally script.\");};document.body.appendChild(script);}};loadTallyScript();return()=>{const script=document.querySelector(`script[src=\"${scriptUrl}\"]`);if(script){document.body.removeChild(script);}};},[]);// Use currentPageUrl state in your iframe src\nconst tallySrc=`https://tally.so/embed/wLaDYj?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1&jobTitle=${currentPageUrl}`;return /*#__PURE__*/_jsx(\"iframe\",{src:tallySrc,loading:\"lazy\",width:\"100%\",height:\"500\"// Adjust based on your Tally form's needs\n,frameBorder:\"0\",marginHeight:\"0\",marginWidth:\"0\",title:\"Apply to this job\"});}function App(){return /*#__PURE__*/_jsx(TallyForm,{});}export default App;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"App\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Form_test_1.map"],"mappings":"kIAAiF,SAAS,GAAW,CAAC,GAAK,CAAC,EAAe,GAAmBA,EAAS,GAAG,CAKhB,OALiB,MAAc,CACzK,GAAU,IAAS,OAAY,CAG/B,IAAI,EAFU,EAAO,SAAS,KACJ,MAAM,IAAI,CAAC,KAAK,CACjB,QAAQ,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,GAAM,EAAK,QAAQ,EAAE,EAAK,OAAO,EAAE,CAAC,aAAa,CAAC,EAAK,MAAM,EAAE,CAAC,EAAK,CAAC,KAAK,IAAI,CAAC,EAAkB,mBAAmB,EAAS,CAAC,CAAE,IAAM,EAAU,oCAA2b,WAA7X,CAAC,GAAG,OAAO,MAAQ,IAAa,MAAM,YAAY,SAAU,CAAC,SAAS,cAAc,eAAe,EAAU,IAAI,CAAC,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,IAAI,EAAU,EAAO,WAAW,CAAI,OAAO,MAAQ,KAAa,MAAM,YAAY,EAAI,EAAO,YAAY,CAAC,QAAQ,MAAM,mCAAmC,EAAG,SAAS,KAAK,YAAY,EAAO,KAAqB,KAAW,CAAC,IAAM,EAAO,SAAS,cAAc,eAAe,EAAU,IAAI,CAAI,GAAQ,SAAS,KAAK,YAAY,EAAO,GAAM,EAAE,CAAC,CAC1mB,EAAK,SAAS,CAAC,IAA9J,0GAA0G,IAAiE,QAAQ,OAAO,MAAM,OAAO,OAAO,MAC5N,YAAY,IAAI,aAAa,IAAI,YAAY,IAAI,MAAM,oBAAoB,CAAC,CAAE,SAAS,GAAK,CAAC,OAAoB,EAAK,EAAU,EAAE,CAAC,wBANzF,IAAsC,GAMoE"}