{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/DtD6eL1AT7OLibo9V3id/lUdIIENl5KVE5kIIzAKe/ParagraphAdjustments.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import styled from\"styled-components\";/**\n * Configuration options for the heading links functionality.\n */const CONFIG={scrollOffset:0,linkSymbol:\"#\",copySuccessSymbol:\"\u2713\"};/**\n * Styled component that applies bold link styling to all anchor tags within it.\n * Uses Framer's CSS variables for consistent theming.\n */const BoldLinkWrapper=styled.div`\n    a {\n        font-family: \"Degular Text Semibold\", -apple-system, system-ui, sans-serif !important;\n        white-space: nowrap;\n        border-bottom: 2px var(--framer-text-color) solid;\n        text-decoration: none !important;\n        color: var(--framer-text-color) !important;\n\n        &:hover,\n        &:active,\n        &:focus {\n            color: var(--framer-link-current-text-color) !important;\n            border-color: var(--framer-link-current-text-color);\n        }\n    }\n`;/**\n * AnchorBubble styled component.\n * It is positioned to the left of the heading text.\n * By default, it shows the link symbol (#). On hover, it applies bubble styling.\n */const AnchorBubble=styled.a`\n    position: absolute;\n    left: -30px;\n    top: 50%;\n    transform: translateY(-50%);\n    padding: 0 0.5rem;\n    font-family: \"Source Sans Pro\", sans-serif;\n    font-size: 10pt;\n    text-decoration: none;\n    line-height: 1.4em;\n    color: var(--framer-text-color);\n    background-color: transparent;\n    cursor: pointer;\n    opacity: 0; /* initially hidden */\n    border: 3px transparent solid !important;\n    border-radius: 9999px;\n\n    &:hover {\n        background-color: rgba(128, 128, 128, 0.5);\n        color: var(--background-color, #fff) !important;\n        opacity: 1;\n    }\n`;/**\n * HeadingWrapper styled component that positions the AnchorBubble relative to the heading.\n * It ensures that the AnchorBubble is displayed when either the heading or the bubble is hovered.\n */const HeadingWrapper=styled.div`\n    position: relative;\n    display: block;\n\n    &:hover ${AnchorBubble},\n    ${AnchorBubble}:hover {\n        display: inline-block;\n        opacity: 1;\n    }\n`;/**\n * Checks if the given child element is a heading (h1, h2, or h3).\n * @param child - The child element to check.\n * @returns True if the element is a heading.\n */const isHeading=child=>{const type=child?.type;return type===\"h1\"||type===\"h2\"||type===\"h3\";};/**\n * Generates a URL-friendly slug from a text string.\n * @param text - The text to convert into a slug.\n * @returns A URL-friendly slug.\n */const generateSlug=text=>{return text.toLowerCase().replace(/[^a-z0-9]+/g,\"-\")// Replace non-alphanumeric chars with hyphens\n.replace(/^-|-$/g,\"\")// Remove leading/trailing hyphens\n;};/**\n * Higher-order component that adds bold styling to all links within a component.\n * @param Component - The component to wrap.\n * @returns A wrapped component with bold link styling.\n */export const WithBoldLinks=Component=>{const WithBoldLinksComponent=props=>/*#__PURE__*/_jsx(BoldLinkWrapper,{children:/*#__PURE__*/_jsx(Component,{...props})});return WithBoldLinksComponent;};/**\n * Higher-order component that adds anchor links to headings with URL updating and clipboard copy functionality.\n * Scrolling features have been removed.\n *\n * When the \"#\" bubble is clicked, the URL hash is updated and copied to the clipboard.\n * The bubble content changes to a check mark (\"\u2713\") for 1 second before reverting.\n *\n * Additionally, to avoid a flash of unstyled content, the anchor links are hidden until the\n * component is mounted.\n *\n * @param Component - The component to wrap.\n * @returns A wrapped component with heading link functionality.\n */export function withHeadingLinks(Component){return props=>{// State to track whether the component has mounted.\nconst[mounted,setMounted]=React.useState(false);// copiedSlug stores the slug for which the copy was successful.\nconst[copiedSlug,setCopiedSlug]=React.useState(null);// Set mounted to true after the first render.\nReact.useEffect(()=>{setMounted(true);},[]);/**\n         * Handles click events on the heading anchor bubble.\n         * Updates the URL hash and copies it to the clipboard.\n         *\n         * @param headingText - The text content of the heading.\n         * @param e - The mouse event.\n         */const handleClick=(headingText,e)=>{e.preventDefault();const slug=generateSlug(headingText);// Update the URL hash.\nconst newUrl=new URL(window.location.href);newUrl.hash=slug;window.history.pushState({},\"\",newUrl.toString());// Copy the URL to the clipboard.\nnavigator.clipboard.writeText(newUrl.toString()).then(()=>{// Change the bubble content to a check mark.\nsetCopiedSlug(slug);// Revert after 1 second.\nsetTimeout(()=>setCopiedSlug(null),1e3);}).catch(err=>console.error(\"Failed to copy URL:\",err));};/**\n         * Recursively processes children to add anchor links to headings.\n         *\n         * @param children - Child elements to process.\n         * @returns Modified children with anchor links.\n         */const modifyChildren=children=>{if(!children)return children;const childrenArray=Array.isArray(children)?children:[children];return childrenArray.map(child=>{if(!child||typeof child!==\"object\")return child;if(isHeading(child)){const headingText=child.props.children;const slug=generateSlug(headingText);return /*#__PURE__*/React.cloneElement(child,{...child.props,id:slug,children:/*#__PURE__*/_jsxs(HeadingWrapper,{children:[mounted&&/*#__PURE__*/_jsx(AnchorBubble,{href:`#${slug}`,onClick:e=>handleClick(headingText,e),\"aria-hidden\":\"true\",tabIndex:-1,children:copiedSlug===slug?CONFIG.copySuccessSymbol:CONFIG.linkSymbol},\"link\"),/*#__PURE__*/_jsx(\"span\",{children:headingText})]})});}if(child.props?.children){return /*#__PURE__*/React.cloneElement(child,{...child.props,children:modifyChildren(child.props.children)});}return child;});};// If there are no children to process, return the component as is.\nif(!props.children?.props?.children){return /*#__PURE__*/_jsx(Component,{...props});}// Process children and apply modifications.\nconst newChildren=/*#__PURE__*/React.cloneElement(props.children,{...props.children.props,children:modifyChildren(props.children.props.children)});return /*#__PURE__*/_jsx(Component,{...props,children:newChildren});};}/**\n * Combined higher-order component that applies both bold links and heading links.\n *\n * @param Component - The component to wrap.\n * @returns A wrapped component with both link enhancements.\n */export const withBoldAndHeadingLinks=Component=>{return withHeadingLinks(WithBoldLinks(Component));};\nexport const __FramerMetadata__ = {\"exports\":{\"withHeadingLinks\":{\"type\":\"reactHoc\",\"name\":\"withHeadingLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"WithBoldLinks\":{\"type\":\"reactHoc\",\"name\":\"WithBoldLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBoldAndHeadingLinks\":{\"type\":\"reactHoc\",\"name\":\"withBoldAndHeadingLinks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata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AAE,CAAE,CAK/M,IAAMC,EAAwBvB,GAAmBG,EAAiBJ,EAAcC,CAAS,CAAC",
  "names": ["CONFIG", "BoldLinkWrapper", "He", "AnchorBubble", "HeadingWrapper", "isHeading", "child", "type", "generateSlug", "text", "WithBoldLinks", "Component", "props", "p", "withHeadingLinks", "mounted", "setMounted", "ye", "copiedSlug", "setCopiedSlug", "ue", "handleClick", "headingText", "e", "slug", "newUrl", "window", "navigator", "err", "modifyChildren", "children", "q", "u", "newChildren", "withBoldAndHeadingLinks"]
}
