{"version":3,"file":"Text_size.DD4NoiMm.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/Ej2w0poWfhmyr6UFnf60/GSmNVSVv5G3QAXFYEg9r/Text_size.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";export function responsiveHeading(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const ref=useRef(null);const lastViewportWidth=useRef(0);const getBaseFontSize=useCallback(()=>{if(typeof window===\"undefined\")return 32;const vw=window.innerWidth*.11;const minSize=Math.max(window.innerWidth*.13,32);return Math.min(Math.max(vw,minSize),250);},[]);const adjustSize=useCallback(()=>{if(typeof window===\"undefined\")return;if(!ref.current)return;const el=ref.current.querySelector(\"h1, h2, h3, p, [class*='framer-text']\");if(!el)return;let currentSize=getBaseFontSize();el.style.setProperty(\"--framer-font-size\",`${Math.round(currentSize)}px`);el.style.setProperty(\"--framer-line-height\",\"90%\");const maxH=window.innerHeight*.8;while(ref.current.scrollHeight>maxH&&currentSize>32){currentSize-=2;el.style.setProperty(\"--framer-font-size\",`${currentSize}px`);}const roundedSize=Math.round(currentSize);const existingSize=Number.parseFloat(el.style.getPropertyValue(\"--framer-font-size\"));if(!Number.isFinite(existingSize)||Math.abs(existingSize-roundedSize)>=1){el.style.setProperty(\"--framer-font-size\",`${roundedSize}px`);}},[getBaseFontSize]);useEffect(()=>{if(typeof window===\"undefined\")return;lastViewportWidth.current=window.innerWidth;adjustSize();},[adjustSize]);useEffect(()=>{if(typeof window===\"undefined\")return;let frame=0;const handleResize=()=>{const viewportWidth=window.innerWidth;if(viewportWidth===lastViewportWidth.current)return;lastViewportWidth.current=viewportWidth;cancelAnimationFrame(frame);frame=requestAnimationFrame(()=>{adjustSize();});};window.addEventListener(\"resize\",handleResize);return()=>{cancelAnimationFrame(frame);window.removeEventListener(\"resize\",handleResize);};},[adjustSize]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100vw\",position:\"relative\",left:\"50%\",transform:\"translateX(-50%)\",paddingLeft:\"clamp(20px, 4vw, 60px)\",paddingRight:\"clamp(20px, 4vw, 60px)\",boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(Component,{ref:forwardedRef,...props})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"responsiveHeading\":{\"type\":\"reactHoc\",\"name\":\"responsiveHeading\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_size.map"],"mappings":"qJAAsG,SAAgB,EAAkB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAe,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAO,EAAkBA,EAAO,EAAE,CAAO,EAAgBC,MAAgB,CAAC,GAAU,IAAS,OAAY,MAAO,IAAG,IAAM,EAAG,EAAO,WAAW,IAAU,EAAQ,KAAK,IAAI,EAAO,WAAW,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,KAAK,IAAI,EAAG,EAAQ,CAAC,IAAI,EAAG,EAAE,CAAC,CAAO,EAAWA,MAAgB,CAAuC,GAA5B,IAAS,QAAsB,CAAC,EAAI,QAAQ,OAAO,IAAM,EAAG,EAAI,QAAQ,cAAc,wCAAwC,CAAC,GAAG,CAAC,EAAG,OAAO,IAAI,EAAY,GAAiB,CAAC,EAAG,MAAM,YAAY,qBAAqB,GAAG,KAAK,MAAM,EAAY,CAAC,IAAI,CAAC,EAAG,MAAM,YAAY,uBAAuB,MAAM,CAAC,IAAM,EAAK,EAAO,YAAY,GAAG,KAAM,EAAI,QAAQ,aAAa,GAAM,EAAY,IAAI,GAAa,EAAE,EAAG,MAAM,YAAY,qBAAqB,GAAG,EAAY,IAAI,CAAE,IAAM,EAAY,KAAK,MAAM,EAAY,CAAO,EAAa,OAAO,WAAW,EAAG,MAAM,iBAAiB,qBAAqB,CAAC,EAAI,CAAC,OAAO,SAAS,EAAa,EAAE,KAAK,IAAI,EAAa,EAAY,EA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