{"version":3,"file":"DutchNumber.Di3WPqhu.mjs","names":["useRef","__esmMin","le","c","J","init_jsx_runtime","init_npm_react_18_3_1","de","relabel","root","walker","node","text","DECIMAL","withDutchDecimalComma","own","observer","Component","props","init_DutchNumber"],"sources":["https:/framerusercontent.com/modules/xolUXXUHtLBnxkXm1Ddq/movn9sUbGNkI7gOA2wOp/DutchNumber.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useLayoutEffect,useRef}from\"react\";// Framer formats CMS numbers in the site language (still English), e.g. \"47.5 m²\".\n// This override shows decimal numbers in this text with a Dutch comma (\"47,5 m²\"); the CMS value is unchanged.\nconst DECIMAL=/(\\d)\\.(\\d)/g;function relabel(root){if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);for(let node=walker.nextNode();node;node=walker.nextNode()){const text=node.nodeValue||\"\";if(DECIMAL.test(text))node.nodeValue=text.replace(DECIMAL,\"$1,$2\");DECIMAL.lastIndex=0;}}export function withDutchDecimalComma(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const own=useRef(null);useLayoutEffect(()=>{const root=own.current;relabel(root);if(!root)return;// Framer may re-render the text (e.g. on CMS changes); keep the comma.\nconst observer=new MutationObserver(()=>relabel(root));observer.observe(root,{subtree:true,childList:true,characterData:true});return()=>observer.disconnect();},[]);return /*#__PURE__*/_jsx(\"div\",{ref:own,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props,ref:ref})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withDutchDecimalComma\":{\"type\":\"reactHoc\",\"name\":\"withDutchDecimalComma\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DutchNumber.map"],"mappings":"A,gIAE4B,SAASQ,EAAQ,EAAK,CAAC,GAAG,CAACC,EAAK,OAAO,IAAMC,EAAO,SAAS,iBAAiBD,EAAK,WAAW,SAAS,EAAE,IAAI,IAAIE,EAAKD,EAAO,SAAS,EAAEC,EAAK,EAAKD,EAAO,SAAS,EAAE,CAAC,IAAME,EAAKD,EAAK,WAAW,GAAME,EAAQ,KAAKD,CAAI,IAAE,EAAK,UAAUA,EAAK,QAAQC,EAAQ,OAAO,GAAE,EAAQ,UAAU,CAAE,CAAC,CAAC,SAAgBC,EAAsB,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,IAAMC,EAAIf,EAAO,IAAI,EACtQ,OADwQE,MAAoB,CAAC,IAAMO,EAAKM,EAAI,QAAsB,GAAdP,EAAQC,CAAI,EAAK,CAACA,EAAK,OAChf,IAAMO,EAAS,IAAI,qBAAqBR,EAAQC,CAAI,CAAC,EAA0E,OAAxEO,EAAS,QAAQP,EAAK,CAAC,QAAQ,GAAK,UAAU,GAAK,cAAc,EAAI,CAAC,MAAYO,EAAS,WAAW,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAK,MAAM,CAAC,IAAID,EAAI,MAAM,CAAC,QAAQ,UAAU,EAAE,SAAsB,gBAAKE,EAAU,CAAC,GAAGC,EAAU,KAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAE,C,4CADhS,EAAQ,a"}