{"version":3,"file":"TextFormat.DhsRtO7s.mjs","names":[],"sources":["https:/framerusercontent.com/modules/pcmlqCuYb5oXgZVZROln/zq8qI3DhtraYf2nYj7d1/TextFormat.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import React from\"react\";/**\n * Override that formats scientific notation in text within paragraph elements\n */export function withScientificNotation(Component){return props=>{// Clone props to avoid modifying the original\nconst newProps={...props};// Process children to find and modify paragraph elements\nif(newProps.children){// Function to process paragraph elements\nconst processChildren=children=>{// If children is a React element\nif(/*#__PURE__*/React.isValidElement(children)){const element=children;// Check if it's a paragraph, heading, or span element\nif(element.type===\"p\"||element.type===\"h1\"||element.type===\"h2\"||element.type===\"h3\"||element.type===\"h4\"||element.type===\"h5\"||element.type===\"h6\"||element.type===\"span\"){// Format text content if it's a string\nif(typeof element.props.children===\"string\"){const formattedText=formatScientificNotation(element.props.children);// Clone the element with formatted text\nreturn /*#__PURE__*/React.cloneElement(element,{...element.props,children:formattedText,\"data-formatted\":\"true\"});}}// Process children of this element if any\nif(element.props.children){return /*#__PURE__*/React.cloneElement(element,{...element.props,children:processChildren(element.props.children)});}// Return element as is if no changes needed\nreturn children;}// If children is an array, process each item\nif(Array.isArray(children)){return children.map(child=>processChildren(child));}// If children is a string, format it directly\nif(typeof children===\"string\"&&children.includes(\"m2\")){return formatScientificNotation(children);}// Otherwise return as is\nreturn children;};// Update children with processed version\nnewProps.children=processChildren(newProps.children);}// Make sure the element is visible and positioned correctly\nconst style={...props.style,opacity:1,transform:\"translateY(0px)\"};// Return the component with processed children\nreturn /*#__PURE__*/_jsx(Component,{...newProps,style:style});};}/**\n * Helper function to format scientific notation in text\n */function formatScientificNotation(text){if(!text)return text;const replacements={m2:\"m\\xb2\",m3:\"m\\xb3\",km2:\"km\\xb2\",km3:\"km\\xb3\",cm2:\"cm\\xb2\",cm3:\"cm\\xb3\",mm2:\"mm\\xb2\",mm3:\"mm\\xb3\",ft2:\"ft\\xb2\",ft3:\"ft\\xb3\",in2:\"in\\xb2\",in3:\"in\\xb3\",yd2:\"yd\\xb2\",yd3:\"yd\\xb3\",CO2:\"CO₂\",H2O:\"H₂O\",H2:\"H₂\",O2:\"O₂\",N2:\"N₂\",CH4:\"CH₄\",NH3:\"NH₃\",SO2:\"SO₂\",NO2:\"NO₂\"};let formattedText=text;Object.entries(replacements).forEach(([pattern,replacement])=>{const regex=new RegExp(pattern,\"g\");formattedText=formattedText.replace(regex,replacement);});return formattedText;}\nexport const __FramerMetadata__ = {\"exports\":{\"withScientificNotation\":{\"type\":\"reactHoc\",\"name\":\"withScientificNotation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextFormat.map"],"mappings":"kHAEG,SAAgB,EAAuB,EAAU,CAAC,MAAO,IAAO,CACnE,IAAM,EAAS,CAAC,GAAG,CAAK,EACxB,GAAG,EAAS,SAAS,CACrB,IAAM,EAAgB,GAAU,CAChC,GAAgB,EAAM,eAAe,CAAQ,EAAE,CAAC,IAAM,EAAQ,EAC9D,IAAG,EAAQ,OAAO,KAAK,EAAQ,OAAO,MAAM,EAAQ,OAAO,MAAM,EAAQ,OAAO,MAAM,EAAQ,OAAO,MAAM,EAAQ,OAAO,MAAM,EAAQ,OAAO,MAAM,EAAQ,OAAO,SACjK,OAAO,EAAQ,MAAM,UAAW,SAAS,CAAC,IAAM,EAAc,EAAyB,EAAQ,MAAM,QAAQ,EAChH,OAAoB,EAAM,aAAa,EAAQ,CAAC,GAAG,EAAQ,MAAM,SAAS,EAAc,iBAAiB,MAAM,CAAC,CAAE,CAElH,OADG,EAAQ,MAAM,SAA8B,EAAM,aAAa,EAAQ,CAAC,GAAG,EAAQ,MAAM,SAAS,EAAgB,EAAQ,MAAM,QAAQ,CAAC,CAAC,EACtI,CAAS,CAGhB,OAFG,MAAM,QAAQ,CAAQ,EAAU,EAAS,IAAI,GAAO,EAAgB,CAAK,CAAC,EAC1E,OAAO,GAAW,UAAU,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