{"version":3,"file":"CmsRichTextSpacing.D4dzCyWD.mjs","names":[],"sources":["https:/framerusercontent.com/modules/j1iQQpTkGI7W5JrAtnXm/dr3v9tzAXJuHG5SvzgU9/CmsRichTextSpacing.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";const CLASS_NAME=\"cms-rich-text-spacing\";const STYLE_ID=\"cms-rich-text-spacing-styles\";const HEADING_OFFSET=100;function injectStyles(){if(typeof document===\"undefined\")return;if(document.getElementById(STYLE_ID))return;const style=document.createElement(\"style\");style.id=STYLE_ID;style.textContent=`\n.${CLASS_NAME} ul,\n.${CLASS_NAME} ol {\n    margin-bottom: 24px !important;\n    padding-left: 1.45rem !important;\n}\n\n.${CLASS_NAME} li + li {\n    margin-top: 10px !important;\n}\n\n.${CLASS_NAME} li > p {\n    margin: 0 !important;\n}\n\n@media (max-width: 479px) {\n    .${CLASS_NAME} ul,\n    .${CLASS_NAME} ol {\n        margin-bottom: 22px !important;\n        padding-left: 1.35rem !important;\n    }\n\n    .${CLASS_NAME} li + li {\n        margin-top: 9px !important;\n    }\n}\n\n.${CLASS_NAME} :is(h1, h2, h3, h4) {\n    position: relative;\n}\n\n.cl-h-anchor {\n    position: absolute;\n    left: -1.15em;\n    top: 0;\n    display: inline-flex;\n    align-items: center;\n    height: 1em;\n    padding-top: 0.14em;\n    opacity: 0;\n    transition: opacity 120ms ease, color 120ms ease;\n    text-decoration: none;\n    color: #a1a1aa;\n    font-weight: 600;\n    cursor: pointer;\n    user-select: none;\n}\n\n.${CLASS_NAME} :is(h1, h2, h3, h4):hover .cl-h-anchor,\n.cl-h-anchor:focus-visible {\n    opacity: 1;\n}\n\n.cl-h-anchor:hover {\n    color: #18181b;\n}\n\n.cl-h-anchor[data-copied] {\n    opacity: 1;\n    color: #16a34a;\n}\n\n@media (max-width: 767px) {\n    .cl-h-anchor {\n        position: static;\n        left: auto;\n        opacity: 0.45;\n        margin-right: 6px;\n        padding-top: 0;\n        height: auto;\n    }\n}\n`;document.head.appendChild(style);}function slugify(text){return String(text||\"\").toLowerCase().trim().replace(/[^\\w\\s-]/g,\"\").replace(/[\\s_]+/g,\"-\").replace(/-+/g,\"-\").replace(/^-+|-+$/g,\"\");}function enhanceHeadings(container){const used={};const headings=container.querySelectorAll(\"h1, h2, h3, h4\");headings.forEach(node=>{const el=node;if(el.dataset.clAnchored===\"1\")return;const base=slugify(el.textContent||\"\");if(!base)return;let id=base;if(used[base]){used[base]+=1;id=base+\"-\"+used[base];}else{used[base]=1;}while(document.getElementById(id)&&document.getElementById(id)!==el){used[base]+=1;id=base+\"-\"+used[base];}el.id=id;el.style.scrollMarginTop=HEADING_OFFSET+\"px\";const a=document.createElement(\"a\");a.className=\"cl-h-anchor\";a.href=\"#\"+id;a.textContent=\"#\";a.setAttribute(\"aria-label\",\"Copy link to this section\");a.setAttribute(\"title\",\"Copy link to this section\");a.addEventListener(\"click\",e=>{e.preventDefault();const url=window.location.origin+window.location.pathname+\"#\"+id;try{window.history.replaceState(null,\"\",\"#\"+id);}catch{}if(navigator.clipboard){navigator.clipboard.writeText(url).catch(()=>{});}a.textContent=\"✓\";a.setAttribute(\"data-copied\",\"1\");window.setTimeout(()=>{a.textContent=\"#\";a.removeAttribute(\"data-copied\");},1500);});el.appendChild(a);el.dataset.clAnchored=\"1\";});}function handleHashScroll(){if(typeof window===\"undefined\")return;const hash=decodeURIComponent(window.location.hash.replace(/^#/,\"\"));if(!hash)return;const el=document.getElementById(hash);if(el)el.scrollIntoView({block:\"start\"});}export function withCmsRichTextSpacing(Component){return props=>{useEffect(()=>{injectStyles();const run=()=>document.querySelectorAll(\".\"+CLASS_NAME).forEach(enhanceHeadings);const t1=window.setTimeout(()=>{run();handleHashScroll();},200);const t2=window.setTimeout(()=>{run();handleHashScroll();},800);window.addEventListener(\"hashchange\",handleHashScroll);return()=>{window.clearTimeout(t1);window.clearTimeout(t2);window.removeEventListener(\"hashchange\",handleHashScroll);};},[]);const className=[props.className,CLASS_NAME].filter(Boolean).join(\" \");return /*#__PURE__*/_jsx(Component,{...props,className:className});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCmsRichTextSpacing\":{\"type\":\"reactHoc\",\"name\":\"withCmsRichTextSpacing\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CmsRichTextSpacing.map"],"mappings":"kIAAwL,SAAS,GAAc,CAAyC,GAArC,OAAO,SAAW,KAAsB,SAAS,eAAe,EAAS,CAAC,OAAO,IAAM,EAAM,SAAS,cAAc,QAAQ,CAAC,EAAM,GAAG,EAAS,EAAM,YAAY;GACjX,EAAW;GACX,EAAW;;;;;GAKX,EAAW;;;;GAIX,EAAW;;;;;OAKP,EAAW;OACX,EAAW;;;;;OAKX,EAAW;;;;;GAKf,EAAW;;;;;;;;;;;;;;;;;;;;;GAqBX,EAAW;;;;;;;;;;;;;;;;;;;;;;;;EAwBZ,SAAS,KAAK,YAAY,EAAM,CAAE,SAAS,EAAQ,EAAK,CAAC,OAAO,OAAO,GAAM,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,YAAY,GAAG,CAAC,QAAQ,UAAU,IAAI,CAAC,QAAQ,MAAM,IAAI,CAAC,QAAQ,WAAW,GAAG,CAAE,SAAS,EAAgB,EAAU,CAAC,IAAM,EAAK,EAAE,CAAgB,EAAU,iBAAiB,iBAAiB,CAAU,QAAQ,GAAM,CAAC,IAAM,EAAG,EAAK,GAAG,EAAG,QAAQ,aAAa,IAAI,OAAO,IAAM,EAAK,EAAQ,EAAG,aAAa,GAAG,CAAC,GAAG,CAAC,EAAK,OAAO,IAAI,EAAG,EAA6E,IAArE,EAAK,IAAO,EAAK,IAAO,EAAE,EAAG,EAAK,IAAI,EAAK,IAAY,EAAK,GAAM,EAAS,SAAS,eAAe,EAAG,EAAE,SAAS,eAAe,EAAG,GAAG,GAAI,EAAK,IAAO,EAAE,EAAG,EAAK,IAAI,EAAK,GAAO,EA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