{"version":3,"file":"ToC_1.DMnFEbNi.mjs","names":["useRef","useState","ScrollToPlugin","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","p","_e","de","addPropertyControls","ControlType","init_framer_Bf4_tcb2","i","init_ScrollToPlugin","init_npm_gsap_3_12_5","T","withFullWidthFramerImage","ref","Component","props","init_Blog_FullSizeImage","TableOfContents","tocItems","setTocItems","activeSectionId","setActiveSectionId","headings","items","id","heading","index","onScroll","found","bounding","item","handleScrollToSection","init_ToC_1"],"sources":["https:/framerusercontent.com/modules/Fi583J1raHRpqZaeMhU3/BBaKAiJZOFgIK2dkpx7T/Blog_FullSizeImage.js","https:/framerusercontent.com/modules/AyKZ0pHt0QgqpXsSW94B/TlAspEd6oBYOs3johqlh/ToC_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function withFullWidthFramerImage(Component){return props=>{const ref=useRef(null);useEffect(()=>{if(ref.current){const images=ref.current.querySelectorAll(\".framer-image\");images.forEach(img=>{img.style.display=\"block\";img.style.marginLeft=\"auto\";img.style.marginRight=\"auto\";img.style.width=\"100%\";img.style.height=\"auto\"// Maintains aspect ratio\n;});}},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFullWidthFramerImage\":{\"type\":\"reactHoc\",\"name\":\"withFullWidthFramerImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog_FullSizeImage.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{gsap}from\"gsap\";import{ScrollToPlugin}from\"gsap/ScrollToPlugin\";// For this to work properly you need to\n// Set the table of contents target to have a class of toc-target\ngsap.registerPlugin(ScrollToPlugin);export default function TableOfContents(props){const[tocItems,setTocItems]=useState([]);const[activeSectionId,setActiveSectionId]=useState(\"\");useEffect(()=>{const headings=document.querySelectorAll(\".toc-target h2, .toc-target h3, .toc-target h4, .toc-target h5, .toc-target h6\");const items=Array.from(headings).map((heading,index)=>{const id=heading.id||`toc-target-heading-${index}`;heading.id=id;return{id,title:heading.textContent||\"Untitled\",level:parseInt(heading.tagName.substring(1),10)-1};});setTocItems(items);const onScroll=()=>{let found=false;items.forEach(item=>{const element=document.getElementById(item.id);const bounding=element.getBoundingClientRect();if(bounding.top<window.innerHeight&&bounding.bottom>=0&&!found){setActiveSectionId(item.id);found=true;}});if(!found)setActiveSectionId(\"\");};window.addEventListener(\"scroll\",onScroll);onScroll()// Initial check\n;return()=>window.removeEventListener(\"scroll\",onScroll);},[]);const handleScrollToSection=id=>{gsap.to(window,{duration:1,ease:\"power2.inOut\",scrollTo:{y:`#${id}`,offsetY:props.scrollOffset}});};if(tocItems.length===0){return null// Do not render anything if there are no TOC items\n;}return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .toc-container {\n                    z-index: 1;\n                }\n                .toc-link {\n                    cursor: pointer;\n                    color: ${props.enabledColor};\n                    text-decoration: ${props.textDecoration};\n                    font-family: ${props.fontName};\n                    font-size: ${props.fontSize};\n                    line-height: ${props.lineHeight};\n                    margin: ${props.margins};\n                    width: 100%;\n                    transition: all 0.3s ease-in-out;\n                    padding-left: 0px;\n                    border-left: 2px solid transparent;\n                }\n                .toc-link.active {\n                    color: ${props.hoverColor};\n                    border-left: 2px solid ${props.highlightColor};\n                    padding-left: 8px;\n                }\n                .toc-link:hover {\n                    color: ${props.hoverColor};\n                }\n            `}),/*#__PURE__*/_jsx(\"ul\",{style:{listStyleType:\"none\",padding:0,margin:0},className:\"toc-container\",children:tocItems.map(item=>/*#__PURE__*/_jsx(\"li\",{style:{marginLeft:`${(item.level-1)*props.listMarginLeft}px`},children:/*#__PURE__*/_jsx(\"div\",{className:`toc-link ${activeSectionId===item.id?\"active\":\"\"}`,onClick:()=>handleScrollToSection(item.id),children:item.title})},item.id))})]});}TableOfContents.defaultProps={fontName:\"Inter\",fontSize:\"16px\",lineHeight:\"24px\",listMarginLeft:16,textDecoration:\"None\",enabledColor:\"#000000\",hoverColor:\"#0000FF\",highlightColor:\"#182FFF\",margins:\"4px 0px\",scrollOffset:80};addPropertyControls(TableOfContents,{fontName:{title:\"Font Name\",type:ControlType.String,defaultValue:\"Inter\"},fontSize:{title:\"Font Size\",type:ControlType.String,defaultValue:\"16px\"},lineHeight:{title:\"Line Height\",type:ControlType.String,defaultValue:\"16px\"},textDecoration:{title:\"Text Decoration\",type:ControlType.String,defaultValue:\"None\"},margins:{title:\"Margin\",type:ControlType.String,defaultValue:\"4px 0px\"},enabledColor:{title:\"Enabled Color\",type:ControlType.Color,defaultValue:\"#000000\"},hoverColor:{title:\"Hover Color\",type:ControlType.Color,defaultValue:\"#FF0000\"},highlightColor:{title:\"Highlight Color\",type:ControlType.Color,defaultValue:\"#FF0000\"},listMarginLeft:{title:\"Indentation per level\",description:\"in pixels\",type:ControlType.Number,defaultValue:16},scrollOffset:{title:\"Scroll Offset\",description:\"Use this if you have a sticky nav.\",type:ControlType.Number,defaultValue:80}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TableOfContents\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToC_1.map"],"mappings":"A,gRAA+E,SAAgBoB,EAAyB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAMC,EAAIrB,EAAO,IAAI,EAC5J,OAD8JO,MAAc,CAAIc,EAAI,SAAoEA,EAA1C,QAAQ,iBAAiB,eAAsB,CAAC,CAAC,QAAQ,GAAK,CAAC,EAAI,MAAM,QAAQ,QAAQ,EAAI,MAAM,WAAW,OAAO,EAAI,MAAM,YAAY,OAAO,EAAI,MAAM,MAAM,OAAO,EAAI,MAAM,OAAO,M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