{"version":3,"file":"Blog.CU52cRXH.mjs","names":["useCallback","id"],"sources":["https:/framerusercontent.com/modules/vAWw0NC0Nax8WElX2ReY/10VaOI3iISSeRByTswj0/Blog.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback}from\"react\";export function addTags(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const combinedRef=useCallback(node=>{if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;if(!node)return;// Add id to the root element\nnode.id=\"blog-content\";// Process headings inside this component\nconst headings=node.querySelectorAll(\"h2, h3, h4, h5, h6\");headings.forEach(heading=>{if(!heading.id){const text=heading.textContent||\"\";heading.id=slugify(text);}heading.style.scrollMarginTop=\"60px\";});//const links = node.querySelectorAll(\"a[href^='./#']\")\n// Matches all hash links, not just starting with './#'\nconst links=node.querySelectorAll(\"a[href*='#']\");links.forEach(link=>{const href=link.getAttribute(\"href\");if(!href)return;// CASE 1: Same-page anchor\nif(href?.startsWith(\"../#\")){const id=href.replace(/^(#|\\.{2}\\/#)/,\"\");link.setAttribute(\"href\",`#${id}`);link.addEventListener(\"click\",e=>{e.preventDefault();e.stopPropagation();//const id = href.replace(\"../#\", \"\")\nconst id=href.replace(/^(#|\\.{2}\\/#)/,\"\");const scrollToTarget=()=>{const target=document.getElementById(id);if(!target)return;target.scrollIntoView({behavior:\"smooth\",block:\"start\"});//history.replaceState(null, \"\", `#${id}`)\nhistory.pushState(null,null,\"\",`#${id}`);};// If the target already exists (likely), scroll now on next frame\nif(document.getElementById(id)){requestAnimationFrame(scrollToTarget);return;}// If not, wait for DOM updates using MutationObserver\nconst observer=new MutationObserver(()=>{const target=document.getElementById(id);if(target){observer.disconnect();requestAnimationFrame(scrollToTarget);}});observer.observe(document.body,{childList:true,subtree:true});});}else if(href.includes(\"#\")&&!href.startsWith(\"#\")&&// not a raw fragment\n!href.startsWith(\"./#\")&&// not legacy pattern\n!href.startsWith(\"../#\")&&// not same-page anchor\nhref.startsWith(\"/\")// internal link only\n){// Add click handler to allow Framer navigation to work\nlink.addEventListener(\"click\",e=>{e.preventDefault();e.stopPropagation();// Manually trigger navigation so Framer doesn't block it\nwindow.location.href=href;});}// End case 2\n});},[ref]);return /*#__PURE__*/_jsx(Component,{ref:combinedRef,...props});});}// Utility: generate a clean, anchor-safe ID from heading text\nfunction slugify(text){let slug=text.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\").replace(/[^a-z0-9\\s-]/g,\"\").trim().replace(/\\s+/g,\"-\").replace(/-+/g,\"-\");// IDs must not start with a digit\nif(/^\\d/.test(slug)){slug=\"section-\"+slug;}return slug;}\nexport const __FramerMetadata__ = {\"exports\":{\"addTags\":{\"type\":\"reactHoc\",\"name\":\"addTags\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog.map"],"mappings":"0MAAqF,SAAgB,EAAQ,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAYA,EAAY,GAAM,CAAI,OAAO,GAAM,WAAW,EAAI,EAAK,CAAS,IAAI,EAAI,QAAQ,GAAS,IAChR,EAAK,GAAG,eACO,EAAK,iBAAiB,qBAAqB,CAAU,QAAQ,GAAS,CAAC,GAAG,CAAC,EAAQ,GAAG,CAAC,IAAM,EAAK,EAAQ,aAAa,GAAG,EAAQ,GAAG,EAAQ,EAAK,CAAE,EAAQ,MAAM,gBAAgB,QAAS,CAE9L,EAAK,iBAAiB,eAAe,CAAO,QAAQ,GAAM,CAAC,IAAM,EAAK,EAAK,aAAa,OAAO,CAAK,KAChH,GAAG,GAAM,WAAW,OAAO,CAAC,CAAC,IAAM,EAAG,EAAK,QAAQ,gBAAgB,GAAG,CAAC,EAAK,aAAa,OAAO,IAAI,IAAK,CAAC,EAAK,iBAAiB,QAAQ,GAAG,CAAC,EAAE,gBAAgB,CAAC,EAAE,iBAAiB,CAClL,IAAMC,EAAG,EAAK,QAAQ,gB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