{"version":3,"file":"number-BotLupdZ.js","sources":["../../../node_modules/@chakra-ui/utils/dist/esm/number.mjs"],"sourcesContent":["function toNumber(value) {\n const num = parseFloat(value);\n return typeof num !== \"number\" || Number.isNaN(num) ? 0 : num;\n}\nfunction toPrecision(value, precision) {\n let nextValue = toNumber(value);\n const scaleFactor = 10 ** (precision ?? 10);\n nextValue = Math.round(nextValue * scaleFactor) / scaleFactor;\n return precision ? nextValue.toFixed(precision) : nextValue.toString();\n}\nfunction countDecimalPlaces(value) {\n if (!Number.isFinite(value))\n return 0;\n let e = 1;\n let p = 0;\n while (Math.round(value * e) / e !== value) {\n e *= 10;\n p += 1;\n }\n return p;\n}\nfunction valueToPercent(value, min, max) {\n return (value - min) * 100 / (max - min);\n}\nfunction percentToValue(percent, min, max) {\n return (max - min) * percent + min;\n}\nfunction roundValueToStep(value, from, step) {\n const nextValue = Math.round((value - from) / step) * step + from;\n const precision = countDecimalPlaces(step);\n return toPrecision(nextValue, precision);\n}\nfunction clampValue(value, min, max) {\n if (value == null)\n return value;\n if (max < min) {\n console.warn(\"clamp: max cannot be less than min\");\n }\n return Math.min(Math.max(value, min), max);\n}\n\nexport { clampValue, countDecimalPlaces, percentToValue, roundValueToStep, toPrecision, valueToPercent };\n"],"names":["toNumber","value","num","toPrecision","precision","nextValue","scaleFactor","countDecimalPlaces","e","p","valueToPercent","min","max","percentToValue","percent","roundValueToStep","from","step","clampValue"],"mappings":"CAAA,UAAA,CAAA,GAAA,CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,OAAA,OAAA,OAAA,IAAA,OAAA,OAAA,WAAA,IAAA,WAAA,OAAA,KAAA,IAAA,KAAA,CAAA,EAAA,EAAA,IAAA,EAAA,QAAA,MAAA,IAAA,EAAA,gBAAA,EAAA,iBAAA,CAAA,EAAA,EAAA,gBAAA,CAAA,EAAA,uCAAA,EAAA,yBAAA,mDAAA,MAAA,CAAA,CAAA,GAAA,EAAA,SAASA,EAASC,EAAO,CACvB,MAAMC,EAAM,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