import{__rest as t,__assign as n}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as o}from"react/jsx-runtime";import{makeStyles as r,TextField as e,InputAdornment as i}from"@material-ui/core";import{useCustomShrink as a}from"./effects/index.js";import s from"../../config/theme/palette.mjs.js";var u=r((function(t){return{textField:{marginTop:16,marginBottom:8,"& .MuiFormLabel-root":{marginLeft:function(t){return t.startLabelOffset?"".concat(t.startLabelOffset+8,"px"):0},marginRight:function(t){return t.endLabelOffset?"".concat(t.endLabelOffset+8,"px"):0}},"&:hover":{"&.MuiTextField-root .MuiInput-root":{"& .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:s.primary.contrastText}}},"&.MuiTextField-root .MuiInput-root":{"& .MuiInputAdornment-root svg.MuiSvgIcon-root":{width:16,height:16,fontSize:16,fill:"#DADADA"},"&.Mui-error .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:"".concat(t.palette.error.main," !important")}},"& .Mui-focused .MuiInputAdornment-root svg.MuiSvgIcon-root":{fill:"".concat(t.palette.primary.main," !important")}},shrunkLabel:{"&.MuiInputLabel-shrink.MuiFormLabel-root":{marginLeft:0}}}})),l=function(r){var s=r.startIcon,l=r.endIcon,f=r.onFocus,m=r.onBlur,p=r.InputProps,d=r.value,c=void 0===d?"":d,I=r.startAdornment,v=r.endAdornment,b=t(r,["startIcon","endIcon","onFocus","onBlur","InputProps","value","startAdornment","endAdornment"]),L=a({startIcon:s,endIcon:l,onFocus:f,onBlur:m,value:c,InputProps:p}),M=L.shrink,g=L.onInputFocus,A=L.onInputBlur,h=L.startLabelOffset,F=L.endLabelOffset,x=L.startAdornmentRef,O=L.endAdornmentRef,P=u({startLabelOffset:h,endLabelOffset:F});return o(e,n({},b,{variant:b.variant,onFocus:g,onBlur:A,value:c,classes:{root:P.textField},InputLabelProps:n({shrink:M,classes:{shrink:P.shrunkLabel}},r.InputLabelProps),InputProps:n({startAdornment:s?o(i,{position:"start",ref:x,children:s}):I,endAdornment:l?o(i,{position:"end",ref:O,children:l}):v},r.InputProps)}))};export{l as default};
