{"version":3,"file":"TrainingCenterOverride.CS327mlS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/oDFwNpHmQwcEdLmMlOPM/SglvhHKGTL7XjBcRkQ7z/TrainingCenterOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/**\n * Training Centre / Course Template Page → Contact form preshot.\n *\n * SETUP\n *   - Course CMS template page: pick the Text element bound to the CMS\n *     Title field and, in its right-panel attributes, set ID = \"course-title\".\n *     Apply this override on the Contact CTA button.\n *   - Training Centre landing page: same override on the CTA, no id needed.\n *     URL will arrive without courseName and the dropdown stays empty.\n *\n * Preserves the Framer-localized link href (e.g. /de/kontakt, /es/contacto)\n * and appends:\n *   - dept = other-topics\n *   - topic = Training Centre\n *   - courseName = [scanned from DOM]\n */function extractCourseTitleFromDOM(){if(typeof document===\"undefined\")return\"\";// Strict: only explicit IDs. No generic fallbacks like #title or <h1>\n// because those exist on non-course pages too and would inject the\n// wrong value (e.g. the landing page's \"Training Centre\" heading).\nconst ids=[\"course-title\",\"course-name\"];for(const id of ids){const el=document.getElementById(id);if(el){const raw=(el.textContent||\"\").trim();return raw.replace(/^\\s*(course\\s*title|course\\s*name)\\s*[:\\-]?\\s*/i,\"\").trim();}}return\"\";}export function withTrainingCentreContactLink(Component){return props=>{const handleClick=e=>{const link=e.target.closest(\"a\");if(!link?.href)return;const courseName=extractCourseTitleFromDOM();const params=new URLSearchParams;params.set(\"dept\",\"other-topics\");params.set(\"topic\",\"Training Centre\");if(courseName)params.set(\"courseName\",courseName);const target=new URL(link.href,window.location.href);target.search=params.toString();target.hash=\"connect-with-us\";e.preventDefault();e.stopPropagation();window.location.href=target.toString();};return /*#__PURE__*/_jsx(\"div\",{onClickCapture:handleClick,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withTrainingCentreContactLink\":{\"type\":\"reactHoc\",\"name\":\"withTrainingCentreContactLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrainingCenterOverride.map"],"mappings":"kHAeG,SAAS,GAA2B,CAAC,GAAG,OAAO,SAAW,IAAY,MAAM,GAGtC,IAAI,IAAM,IAAM,CAA9C,eAAe,aAAiC,EAAE,CAAC,IAAM,EAAG,SAAS,eAAe,CAAE,EAAE,GAAG,EAA0C,OAA3B,EAAG,aAAa,GAAA,CAAI,KAAgB,CAAC,CAAC,QAAQ,kDAAkD,EAAE,CAAC,CAAC,KAAK,CAAG,CAAC,MAAM,EAAG,CAAC,SAAgB,EAA8B,EAAU,CAAC,MAAO,IAAof,EAAK,MAAM,CAAC,eAAte,GAAG,CAAC,IAAM,EAAK,EAAE,OAAO,QAAQ,GAAG,EAAE,GAAG,CAAC,GAAM,KAAK,OAAO,IAAM,EAAW,EAA0B,EAAQ,EAAO,IAAI,gBAAgB,EAAO,IAAI,OAAO,cAAc,EAAE,EAAO,IAAI,QAAQ,iBAAiB,EAAK,GAAW,EAAO,IAAI,aAAa,CAAU,EAAE,IAAM,EAAO,IAAI,IAAI,EAAK,KAAK,EAAO,SAAS,IAAI,EAAE,EAAO,OAAO,EAAO,SAAS,EAAE,EAAO,KAAK,kBAAkB,EAAE,eAAe,EAAE,EAAE,gBAAgB,EAAE,EAAO,SAAS,KAAK,EAAO,SAAS,CAAE,EAA6D,MAAM,CAAC,QAAQ,UAAU,EAAE,SAAsB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,CAAC,CAAC,CAAI,qBAlB72B"}