{"version":3,"file":"TableOfContents.aEWA58UX.mjs","names":[],"sources":["https:/framerusercontent.com/modules/xKEdCtUgx6JlkIG5emeQ/q8TrPTU6giJXE1kYHtEE/TableOfContents.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{cloneElement}from\"react\";const headingLinkOffset=-24;const headingIdPrefix=\"\";const headingTypes=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"];export function TableOfContentsOverride(Component){return props=>{var _props_children_props,_props_children;const children=props===null||props===void 0?void 0:(_props_children=props.children)===null||_props_children===void 0?void 0:(_props_children_props=_props_children.props)===null||_props_children_props===void 0?void 0:_props_children_props.children;if(children){const newChildren=[];const headings=[];const ids=[];let i=0;while(i<children.length){var _child_props;const child=children[i];const text=child===null||child===void 0?void 0:(_child_props=child.props)===null||_child_props===void 0?void 0:_child_props.children;if(typeof text==\"string\"&&headingTypes.includes(child.type)){let id=headingIdPrefix+text.toLowerCase().trim().replace(/[^a-z0-9\\s]/g,\"\").replace(/\\s+/g,\"-\").replace(/-+/g,\"-\");if(ids.includes(id)){for(let j=2;j<100;j++){if(!ids.includes(`${id}-${j}`)){id=`${id}-${j}`;break;}}}headings.push(text);ids.push(id);newChildren.push(/*#__PURE__*/cloneElement(child,{style:{...child.props.style,position:\"relative\"}},/*#__PURE__*/_jsx(\"div\",{id:id,style:{position:\"absolute\",pointerEvents:\"none\",top:headingLinkOffset}}),child.props.children));}else if(child.type===\"img\"){// Add lazy loading to images\nnewChildren.push(/*#__PURE__*/cloneElement(child,{loading:\"lazy\"}));}else{newChildren.push(child);}i++;}const component=/*#__PURE__*/_jsx(Component,{...props});return /*#__PURE__*/cloneElement(component,{\"data-framestack-heading-titles\":JSON.stringify(headings),\"data-framestack-heading-ids\":JSON.stringify(ids),children:{...component.props.children,props:{...component.props.children.props,children:newChildren}}});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"TableOfContentsOverride\":{\"type\":\"reactHo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