{"version":3,"file":"Highlighted.DmpaedKS.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/bLB9ebehAmotIKq9Rx4v/6lSlfBfX51YliAGDdWs5/Highlighted.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withHighlightColor1(Component){return props=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{const elements=document.querySelectorAll(`.${props.className} [style*=\"--framer-text-decoration\"]`);elements.forEach(element=>{const depth=getNestedDepth(element);element.style.removeProperty(\"--framer-text-decoration\");const markElement=document.createElement(\"mark\");const spanElement=document.createElement(\"span\");element.parentNode.insertBefore(markElement,element);markElement.appendChild(element);while(element.firstChild){spanElement.appendChild(element.firstChild);}element.appendChild(spanElement);markElement.setAttribute(\"data-depth\",depth.toString());setIsVisible(true);});const handle=entries=>{entries.forEach(entry=>{const markElement=entry.target;markElement.style.setProperty(\"--highlighted\",entry.isIntersecting?\"1\":\"0\");});};const observer=new IntersectionObserver(handle,{threshold:1});elements.forEach(M=>observer.observe(M));},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.${props.className} mark {\n    --highlighted: 0;\n    background: transparent;\n}\n\n.${props.className} mark span {\n    background: linear-gradient(90deg, rgba(248, 254, 3, 1) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;\n    background-position: calc((1 - var(--highlighted)) * 120%) 0;\n    transition: background-position 0.7s;\n    color: black;\n}\n`}),/*#__PURE__*/_jsx(Component,{...props,style:!isVisible?{opacity:0}:{}})]});};}export function withHighlightColor2(Component){return props=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{const elements=document.querySelectorAll(`.${props.className} [style*=\"--framer-text-decoration\"]`);elements.forEach(element=>{const depth=getNestedDepth(element);element.style.removeProperty(\"--framer-text-decoration\");const markElement=document.createElement(\"mark\");const spanElement=document.createElement(\"span\");element.parentNode.insertBefore(markElement,element);markElement.appendChild(element);while(element.firstChild){spanElement.appendChild(element.firstChild);}element.appendChild(spanElement);markElement.setAttribute(\"data-depth\",depth.toString());setIsVisible(true);});const handle=entries=>{entries.forEach(entry=>{const markElement=entry.target;markElement.style.setProperty(\"--highlighted\",entry.isIntersecting?\"1\":\"0\");});};const observer=new IntersectionObserver(handle,{threshold:1});elements.forEach(M=>observer.observe(M));},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.${props.className} mark {\n    --highlighted: 0;\n    background: transparent;\n}\n\n.${props.className} mark span {\n    background: linear-gradient(90deg, rgb(239 68 68) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;\n    background-position: calc((1 - var(--highlighted)) * 120%) 0;\n    transition: background-position 0.7s;\n    color: black;\n}\n`}),/*#__PURE__*/_jsx(Component,{...props,style:!isVisible?{opacity:0}:{}})]});};}function getNestedDepth(element){let depth=0;let parent=element.parentElement;while(parent&&parent.closest(`.${element.className}`)){depth++;parent=parent.parentElement;}return depth;}\nexport const __FramerMetadata__ = {\"exports\":{\"withHighlightColor2\":{\"type\":\"reactHoc\",\"name\":\"withHighlightColor2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHighlightColor1\":{\"type\":\"reactHoc\",\"name\":\"withHighlightColor1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Highlighted.map"],"mappings":"iLAAqH,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAM,CAA22B,OAA12B,MAAc,CAAC,IAAM,EAAS,SAAS,iBAAiB,IAAI,EAAM,UAAU,sCAAsC,CAAC,EAAS,QAAQ,GAAS,CAAC,IAAM,EAAM,EAAe,EAAQ,CAAC,EAAQ,MAAM,eAAe,2BAA2B,CAAC,IAAM,EAAY,SAAS,cAAc,OAAO,CAAO,EAAY,SAAS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