{"version":3,"file":"TextReveal_GSAP.3UO9r1vM.mjs","names":["React.useRef","SplitType","gsap","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/8Dz89gf7vKYQdezuic2P/ZrzTcIHm45CbSi7vhBEk/TextReveal_GSAP.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import gsap from\"gsap\";import{ScrollTrigger}from\"gsap/ScrollTrigger\";import SplitType from\"split-type\";gsap.registerPlugin(ScrollTrigger);export function withTextReveal(Component){return /*#__PURE__*/React.forwardRef((props,ref)=>{const localRef=React.useRef(null);React.useEffect(()=>{const el=localRef.current;if(!el)return;const paragraphs=el.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p\");if(!paragraphs.length)return;const split=new SplitType(paragraphs,{types:\"words\",tagName:\"span\"});const words=split.words?.filter(word=>word.textContent?.trim()!==\"\");if(!words?.length)return;gsap.set(words,{color:\"rgb(72, 55, 255, 0.22)\",display:\"inline-block\",whiteSpace:\"pre\",marginRight:\"0\",willChange:\"color\"});const tween=gsap.fromTo(words,{color:\"rgb(191, 191, 191)\"},{color:\"#000000\",ease:\"none\",stagger:{each:.08},scrollTrigger:{trigger:el,start:\"top 80%\",end:\"bottom -90%\",scrub:1,markers:false}});return()=>{tween.scrollTrigger?.kill();tween.kill();split.revert();};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{localRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withTextReveal\":{\"type\":\"reactHoc\",\"name\":\"withTextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextReveal_GSAP.map"],"mappings":"2MAAiN,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAkB,EAAM,IAAM,CAAC,IAAM,EAASA,EAAa,IAAI,EAAwsB,OAAtsB,MAAoB,CAAC,IAAM,EAAG,EAAS,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAW,EAAG,iBAAiB,2BAA2B,EAAE,GAAG,CAAC,EAAW,OAAO,OAAO,IAAM,EAAM,IAAIC,EAAU,EAAW,CAAC,MAAM,QAAQ,QAAQ,MAAM,CAAC,EAAQ,EAAM,EAAM,OAAO,OAAO,GAAM,EAAK,aAAa,KAAK,IAAI,EAAE,EAAE,GAAG,CAAC,GAAO,OAAO,OAAO,EAAK,IAAI,EAAM,CAAC,MAAM,yBAAyB,QAAQ,eAAe,WAAW,MAAM,YAAY,IAAI,WAAW,OAAO,CAAC,EAAE,IAAM,EAAMC,EAAK,OAAO,EAAM,CAAC,MAAM,oBAAoB,EAAE,CAAC,MAAM,UAAU,KAAK,OAAO,QAAQ,CAAC,KAAK,GAAG,EAAE,cAAc,CAAC,QAAQ,EAAG,MAAM,UAAU,IAAI,cAAc,MAAM,EAAE,QAAQ,EAAK,CAAC,CAAC,EAAE,UAAU,CAAC,EAAM,eAAe,KAAK,EAAE,EAAM,KAAK,EAAE,EAAM,OAAO,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,GAAM,CAAC,EAAS,QAAQ,EAAQ,OAAO,GAAM,WAAY,EAAI,CAAI,EAAW,IAAK,EAAI,QAAQ,EAAM,CAAC,CAAC,CAAE,CAAC,CAAE,iBAAvoC,IAA4B,IAAuB,IAA8C,IAAkC,EAAC,EAAK,eAAeC,CAAa"}