import t from"@babel/runtime/helpers/defineProperty";import{RangeSliderControl as e}from"./constants.js";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var o=function(t,e,r){return 100*(t-e)/(r-e)},i=function(t,e,r){return e+t*(r-e)/100},u=function(t){var e=t.min,r=t.step,n=t.value,o=void 0===n?0:n;return r&&r>0?e+Math.round((o-e)/r)*r:o},c=function(t){var e=t.value,r=t.step,n=t.min,o=t.minRange,i=t.to,c=u({min:n,value:e,step:r});return c<n?{from:n,to:i}:c>i-o?{from:i-o,to:i}:{from:c,to:i}},f=function(t){var e=t.value,r=t.step,n=t.min,o=t.max,i=t.from,c=t.minRange,f=u({min:n,value:e,step:r});return f>o?{from:i,to:o}:f<i+c?{from:i,to:i+c}:{from:i,to:f}},l=function(t){var e=t.isHorizontalOrientation,r=t.tooltipPosition,o=t.rail,i=o.getBoundingClientRect(),u=Math.min(o.clientWidth,o.clientHeight),c=e?{top:i.y,left:r.x-u/2,right:r.x+u/2,bottom:i.y+u}:{top:r.y-u/2,left:i.x,right:i.x+u,bottom:r.y+u/2};return{clientHeight:u,clientWidth:u,getBoundingClientRect:function(){return n(n({},c),{},{width:u,height:u,x:c.left,y:c.top,toJSON:function(){return""}})}}},a=function(t){var r=t.tooltipTitle,n=t.focusedEl,o=t.from,i=t.to;return n[e.BAR]?"":n[e.FROM]?String(o):n[e.TO]?String(i):String(r)},p=function(t,e){return String(Math.floor(t)).length+e};export{o as calculatePercentForValue,i as calculateValueFromPercent,p as getMaxValueSymbols,u as getSteppedValue,l as getTooltipAnchor,a as getTooltipTitle,c as updateFromValue,f as updateToValue};
//# sourceMappingURL=utils.js.map
