{"version":3,"file":"RawHTML.BoaKQnMr.mjs","names":["useRef","__esmMin","de","init_jsx_runtime","c","init_npm_react_18_3_1","ce","init_framer_D1IzEvwH","addPropertyControls","ControlType","RawHTML","props","ref","container","newScript","oldScript","attr","stickyEl","intersectionObserver","resizeObserver","rafId","placeholder","isHostHidden","isIntersecting","applyVisibility","checkHostHidden","hidden","entries","entry","stopped","poll","html","init_RawHTML"],"sources":["https:/framerusercontent.com/modules/Y6IlPyd6vH9fcSBzyu4k/RULZsMeEVTVC8cK2ciex/RawHTML.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Renders raw HTML directly in the page DOM (no iframe), so it sizes\n * naturally with the surrounding layout and scrolls with the page.\n * Re-executes any <script> tags in the HTML after mount, since scripts\n * inserted via innerHTML do not run automatically.\n *\n * Also handles an optional element marked [data-sticky-bottom] inside the\n * HTML: it is moved to a real position:fixed placement on document.body\n * (bypassing any transformed ancestor in the published site that would\n * otherwise silently break position:sticky/fixed). Visibility is driven by\n * two independent, redundant checks so it can never get stuck visible once\n * this component's content is hidden by an ancestor (e.g. a parent whose\n * `visible` binding turned false): an IntersectionObserver (for the normal\n * scroll-past-the-section release) and a ResizeObserver plus rAF poll that\n * force it hidden the instant the container collapses to a zero-size /\n * display:none box, regardless of what caused that.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RawHTML(props){const{html}=props;const ref=useRef(null);useEffect(()=>{const container=ref.current;if(!container)return;const scripts=Array.from(container.querySelectorAll(\"script\"));scripts.forEach(oldScript=>{const newScript=document.createElement(\"script\");Array.from(oldScript.attributes).forEach(attr=>{newScript.setAttribute(attr.name,attr.value);});newScript.textContent=oldScript.textContent;if(oldScript.parentNode){oldScript.parentNode.replaceChild(newScript,oldScript);}});const stickyEl=container.querySelector(\"[data-sticky-bottom]\");let intersectionObserver=null;let resizeObserver=null;let rafId=null;let placeholder=null;if(stickyEl){placeholder=document.createElement(\"div\");placeholder.style.display=\"none\";stickyEl.parentNode?.insertBefore(placeholder,stickyEl);stickyEl.style.position=\"fixed\";stickyEl.style.left=\"0\";stickyEl.style.right=\"0\";stickyEl.style.bottom=\"0\";stickyEl.style.width=\"100%\";stickyEl.style.zIndex=\"9999\";stickyEl.style.display=\"none\";document.body.appendChild(stickyEl);let isHostHidden=false;let isIntersecting=false;const applyVisibility=()=>{stickyEl.style.display=!isHostHidden&&isIntersecting?\"flex\":\"none\";};const checkHostHidden=()=>{const hidden=container.offsetParent===null&&getComputedStyle(container).position!==\"fixed\";if(hidden!==isHostHidden){isHostHidden=hidden;applyVisibility();}};intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{isIntersecting=entry.isIntersecting;applyVisibility();});},{threshold:0});intersectionObserver.observe(container);resizeObserver=new ResizeObserver(()=>{checkHostHidden();});resizeObserver.observe(container);// Belt-and-suspenders: a lightweight rAF poll catches an\n// ancestor's display:none toggling even in the rare case\n// neither observer fires for it, and stops itself on unmount.\nlet stopped=false;const poll=()=>{if(stopped)return;checkHostHidden();rafId=requestAnimationFrame(poll);};rafId=requestAnimationFrame(poll);return()=>{stopped=true;if(rafId!==null)cancelAnimationFrame(rafId);intersectionObserver?.disconnect();resizeObserver?.disconnect();if(stickyEl&&placeholder&&placeholder.parentNode){placeholder.parentNode.replaceChild(stickyEl,placeholder);stickyEl.style.position=\"\";stickyEl.style.left=\"\";stickyEl.style.right=\"\";stickyEl.style.bottom=\"\";stickyEl.style.width=\"\";stickyEl.style.zIndex=\"\";stickyEl.style.display=\"\";}};}return undefined;},[html]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",position:\"relative\"},dangerouslySetInnerHTML:{__html:html||\"\"}});}addPropertyControls(RawHTML,{html:{type:ControlType.String,displayTextArea:true,defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RawHTML\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RawHTML.map"],"mappings":"A,iLAmBG,SAAwBU,EAAQ,EAAM,CAAC,GAAK,CAAC,QAAMC,EAAYC,EAAIZ,EAAO,IAAI,EAGwf,OAHtfM,MAAc,CAAC,IAAMO,EAAUD,EAAI,QAAQ,GAAG,CAACC,EAAU,OAAsE,MAA3C,KAAKA,EAAU,iBAAiB,QAAQ,CAAS,CAAC,CAAC,QAAQ,GAAW,CAAC,IAAMC,EAAU,SAAS,cAAc,QAAQ,EAAE,MAAM,KAAKC,EAAU,UAAU,CAAC,CAAC,QAAQ,GAAM,CAACD,EAAU,aAAaE,EAAK,KAAKA,EAAK,KAAK,CAAE,CAAC,EAAE,EAAU,YAAYD,EAAU,YAAeA,EAAU,YAAYA,EAAU,WAAW,aAAaD,EAAUC,CAAS,CAAG,CAAC,EAAE,IAAME,EAASJ,EAAU,cAAc,sBAAsB,EAAMK,EAAqB,KAASC,EAAe,KAASC,EAAM,KAASC,EAAY,KAAK,GAAGJ,EAAS,CAAC,EAAY,SAAS,cAAc,KAAK,EAAE,EAAY,MAAM,QAAQ,OAAOA,EAAS,YAAY,aAAaI,EAAYJ,CAAQ,EAAE,EAAS,MAAM,SAAS,QAAQ,EAAS,MAAM,KAAK,IAAI,EAAS,MAAM,MAAM,IAAI,EAAS,MAAM,OAAO,IAAI,EAAS,MAAM,MAAM,OAAO,EAAS,MAAM,OAAO,OAAO,EAAS,MAAM,QAAQ,OAAO,SAAS,KAAK,YAAYA,CAAQ,EAAE,IAAIK,EAAa,GAAUC,EAAe,GAAYC,MAAoB,CAAC,EAAS,MAAM,QAAQ,CAACF,GAAcC,EAAe,OAAO,MAAO,EAAQE,MAAoB,CAAC,IAAMC,EAAOb,EAAU,eAAe,M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