import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as i}from"react";import t from"prop-types";import{makeStyles as o,Tooltip as a,TextField as l}from"@material-ui/core";import{debounce as n}from"lodash";import{jsx as u}from"react/jsx-runtime";var s=o({formControl:{width:function(e){return e.isTablet?"200px":"150px"}}}),m=n((function(e){e()}),1500);function c(t){var o=t.radius,n=t.editable,c=t.onChange,d=t.isTablet,p=s({isTablet:d}),b=r(o),f=e(b,2),h=f[0],T=f[1],v=r(null),x=e(v,2),C=x[0],R=x[1];i((function(){T(o)}),[o]);return u(a,{title:n?"":"To make radius active select Subject Well.",children:u(l,{type:"number",label:"Radius (miles)",value:h,disabled:!n,onChange:function(e){var r=e.target.value;!Number.isFinite(+r)||+r<0?R("Incorrect radius"):(R(null),m((function(){c(+r)}))),T(r)},error:!!C,helperText:C,className:p.formControl})})}c.propTypes={radius:t.number.isRequired,editable:t.bool.isRequired,onChange:t.func.isRequired,isTablet:t.bool.isRequired};export{c as default};
//# sourceMappingURL=RadiusInput.js.map
