{"version":3,"file":"Embed3.BNvSkDL8.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/W0HDkPA3NuO7pd4MT9gF/c63ECLsZyO8WVVAg9Udq/Embed3.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth fill\n * @framerSupportedLayoutHeight fill\n */export default function Embed(props){const containerRef=useRef(null);useEffect(()=>{if(containerRef.current){// Clear any previous content\ncontainerRef.current.innerHTML=\"\";const isContactPage=window.location.href.includes(\"/contact-us\")||document.body.classList.contains(\"contact-page\")||document.querySelector(\"h1\")?.textContent.includes(\"Contact\");// Build the base form URL\nlet formUrl=\"https://form.jotform.com/251391353870054\";// Only add course parameter if NOT on contact page\nif(!isContactPage){const courseTitle=getCourseTitle(props);if(courseTitle&&courseTitle!==\"Let's get in touch!\"){formUrl+=`?course=${encodeURIComponent(courseTitle)}`;}}const iframe=document.createElement(\"iframe\");// Set the iframe styles to ensure it fits the container\niframe.src=formUrl;iframe.style.width=\"100%\";iframe.style.height=\"100%\";iframe.style.border=\"none\";iframe.style.flex=\"1\";// Append the iframe to the container div\ncontainerRef.current.appendChild(iframe);}},[props.document?.title,props.content?.title])// Watch for title changes\n;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:containerStyle});}// Helper function to get the course title\nfunction getCourseTitle(props){// Method 1: From direct CMS props\nif(props.document?.title)return props.document.title;if(props.content?.title)return props.content.title;// Method 2: From specific page elements\nconst courseTitleElement=document.querySelector(\"[data-course-title]\")||document.querySelector(\".course-title\")||document.querySelector(\"h1:not(nav h1)\");return courseTitleElement?.innerText||\"Course Registration\";}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\",backgroundColor:\"#ffffff\",position:\"relative\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fill\",\"framerSupportedLayoutHeight\":\"fill\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embed3.map"],"mappings":"2MAQG,SAAwB,EAAM,EAAM,CAAC,IAAM,EAAaA,EAAO,MAMjE,OANuE,MAAc,CAAC,GAAG,EAAa,QAAQ,CAC/G,EAAa,QAAQ,UAAU,GAAG,IAAM,EAAc,EAAO,SAAS,KAAK,SAAS,gBAAgB,SAAS,KAAK,UAAU,SAAS,iBAAiB,SAAS,cAAc,OAAO,YAAY,SAAS,WACrM,EAAQ,2CACZ,GAAG,CAAC,EAAc,CAAC,IAAM,EAAY,EAAe,GAAU,GAAa,IAAc,wBAAuB,GAAS,WAAW,mBAAmB,KAAiB,KAAM,EAAO,SAAS,cAAc,UAC5M,EAAO,IAAI,EAAQ,EAAO,MAAM,MAAM,OAAO,EAAO,MAAM,OAAO,OAAO,EAAO,MAAM,OAAO,OAAO,EAAO,MAAM,KAAK,IACrH,EAAa,QAAQ,YAAY,EAAS,CAAC,EAAC,CAAC,EAAM,UAAU,MAAM,EAAM,SAAS,MAAM,EACnE,EAAK,MAAM,CAAC,IAAI,EAAa,MAAM,EAAe,CAAG,CAC1E,SAAS,EAAe,EAAM,CAC9B,GAAG,EAAM,UAAU,MAAM,OAAO,EAAM,SAAS,MAAM,GAAG,EAAM,SAAS,MAAM,OAAO,EAAM,QAAQ,MAClG,IAAM,EAAmB,SAAS,cAAc,wBAAwB,SAAS,cAAc,kBAAkB,SAAS,cAAc,kBAAkB,OAAO,GAAoB,WAAW,qBAAuB,6BAEjN,EAAe,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,SAAS,gBAAgB,UAAU,SAAS,WAAW"}