"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=r(require("numeral"));var a=function(t){var r=Math.pow(10,Math.floor(Math.log10(t)))/100;return t/r>=500&&(r*=5),t/r>250&&(r*=2),r>1?Math.round(r):1/Math.round(1/r)},o=function(t,r){return n(Math.round(t/r)*r)},n=function(t){if(!t)return t;var r=Math.ceil(Math.log10(Math.abs(t))),e=Math.round(Math.pow(10,15-r));return Math.round(t*e)/e};exports.calcGradientStyle=function(r){return r&&0!==r.length?t.sortBy(r,"pos").map((function(t){var r=t.color,e=t.pos;return"".concat(r," ").concat(e,"%")})).join(","):"none"},exports.getRangeStep=a,exports.getStopText=function(t,r){var n=r.fromValue,u=r.toValue;if(n===u)return String(n);var l=u-n,i=a(l),c=o(n+l*(t/100),i);if(Math.abs(i)>=1)return e.default(c).format("0,00");var f=Math.ceil(-Math.log10(i));return c.toFixed(Math.max(f,0))},exports.reasonableRealValue=n,exports.roundToStep=o;
