import{slicedToArray as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import{useMemo as t}from"react";import{debounce as o}from"lodash-es";import n from"../TextField/TextField.js";import{useSliderSelection as a,useSliderActions as i}from"./SliderContext.js";import s from"classnames";import{InfixKind as l}from"./SliderConstants.js";import"./Slider.scss.js";var m=function(m){var u=m.kind,c=void 0===u?l.POSTFIX||l.TEXTFIX:u,f=m.textSize,d=m.className,p=c===l.POSTFIX,T=c===l.TEXTFIX,x=a(),v=function(e,r,t,o,n){return t?e?[o[1],n[1]]:[o[0],n[0]]:[o,n]}(p,0,x.ranged,x.value,x.valueText),S=e(v,2)[1],g=i().changeThumbValue,j=t((function(){return o((function(e){var r=function(e){return e.replace(/\D/g,"")}(e);g(r,(p?1:0)&&(T?1:0),!0)}),300)}),[g,p,T]),F=t((function(){return s("sliderText","sliderText--textSize-".concat(f),d)}),[f,d]);return r(n,T?{className:F,onChange:j,value:S+""}:{onChange:j,value:S+""})};export{m as default};
