"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[2061,4442],{82061:(e,t,a)=>{a.d(t,{A_:()=>K,Ay:()=>K});var n,o=a(58168),s=a(80045),l=a(96540),i=a(32485),r=a.n(i),c=a(73620),d=a(8494),u=a(28596),m=a(21979),p=a(39830),h=a(25925),f=a(3959),g=a(98662),x=a(34715),v=a(89379),A=(a(48226),a(30974),a(81639)),C=a(89692),b=a.n(C),_=a(31206),w=a(83611),H={module:"@andes/textfield",locale:"en-US",translations:{"andes-textfield{0} caracteres restantes":[null,"{0} remaining characters"],"andes-textfieldMaximo {0} caracteres":[null,"Maximum of {0} characters"],"andes-textfieldCampo de texto valido":[null,"Valid text field"],"andes-textfieldCampo de texto procesando":[null,"Text field processing"],"andes-textfieldBorrar":[null,"Remove"],"andes-textfieldDígito {0}":[null,"Digit {0}"],"andes-textfieldMostrar contraseña":[null,"Show Password"]}},N={module:"@andes/textfield",locale:"es-AR",translations:{"andes-textfield{0} caracteres restantes":[null,"{0} caracteres restantes"],"andes-textfieldMaximo {0} caracteres":[null,"Máximo {0} caracteres"],"andes-textfieldCampo de texto valido":[null,"Campo de texto valido"],"andes-textfieldCampo de texto procesando":[null,"Campo de texto procesando"],"andes-textfieldBorrar":[null,"Borrar"],"andes-textfieldDígito {0}":[null,"Dígito {0}"],"andes-textfieldMostrar contraseña":[null,"Mostrar Contraseña"]}},F={module:"@andes/textfield",locale:"pt-BR",translations:{"andes-textfield{0} caracteres restantes":[null,"{0} caracteres restantes"],"andes-textfieldMaximo {0} caracteres":[null,"Máximo de {0} caracteres"],"andes-textfieldCampo de texto valido":[null,"Campo de texto válido"],"andes-textfieldCampo de texto procesando":[null,"Processamento de campo de texto"],"andes-textfieldBorrar":[null,"Excluir"],"andes-textfieldDígito {0}":[null,"Dígito {0}"],"andes-textfieldMostrar contraseña":[null,"Mostrar Senha"]}};var S=e=>{let{namespace:t}=e;return(0,c.A)("span",{className:"".concat(t,"__error-icon"),"aria-hidden":!0},void 0,n||(n=(0,c.A)(p.A,{color:"white"})))};const y="andes-form-control",B=("".concat(y,"__split-button"),"andes-textfield");var D,R;var L=e=>{let{notificationsLabel:t,size:a="large"}=e;const n=(0,h.A)();return(0,c.A)("span",{role:"status","aria-live":"polite"},void 0,(0,c.A)(f.s6,{},void 0,n&&t),(0,c.A)("span",{className:"".concat(y,"__validated-icon")},void 0,"large"===a?D||(D=(0,c.A)(x.A,{color:"currentColor"})):R||(R=(0,c.A)(g.A,{color:"currentColor"}))))};var M=e=>{let{message:t,messageAction:a,messageActionOnClick:n,messageShow:o,helper:s}=e;return{helper:t||s,action:a,onActionClick:n,show:!1!==o}};l.Component;var O,k;var E=e=>{let{namespace:t,onClick:a,"aria-label":n="",size:o="large"}=e;return(0,c.A)("button",{"aria-label":n,className:"".concat(t,"__clear-icon"),onClick:a,onMouseDown:e=>e.preventDefault(),type:"button"},void 0,"large"===o?O||(O=(0,c.A)(w.A,{color:"currentColor"})):k||(k=(0,c.A)(_.A,{color:"currentColor"})))};const I=["centered","children","className","clear","countdown","disabled","defaultValue","embeddedChildren","focus","id","innerRef","inputProps","label","labelSrOnly","maxLength","message","messageAction","messageActionOnClick","messageShow","modifier","multiline","numeric","onChange","placeholder","prefix","rows","select","setField","size","split","srLabel","suffix","value","autoFocus"];var z;const U={target:{value:""}};class V extends l.Component{constructor(e){super(e);const t=String(e.defaultValue||e.value||"");this.state={height:"auto",countdown:t.length,focused:e.autoFocus||!1},this.isUncontrolledValue=void 0===e.value,this.setField=this.setField.bind(this),this.setRef=this.setRef.bind(this),this.onBlurHandler=this.onBlurHandler.bind(this),this.onFocusHandler=this.onFocusHandler.bind(this),this.onInputHandler=this.onInputHandler.bind(this),this.onChangeHandler=this.onChangeHandler.bind(this),this.onClearHandler=this.onClearHandler.bind(this)}componentDidMount(){const{multiline:e=!1,focus:t=!1,select:a=!1,autoFocus:n=!1}=this.props,{field:o}=this;e&&o&&b()(o),(t||n)&&(0,m.w)(o),a&&(null==o||o.select())}UNSAFE_componentWillReceiveProps(e){const{multiline:t}=this.props,{field:a}=this,{value:n,focus:o,select:s,countdown:l}=e;t&&a&&b().update(a),o&&(null==a||a.focus()),s&&(null==a||a.select()),l&&n!==(null==a?void 0:a.value)&&this.setState({countdown:String(n).length})}onBlurHandler(e){const{onBlur:t}=this.props;this.setState({focused:!1}),t&&t(e)}onFocusHandler(e){const{onFocus:t}=this.props;this.setState({focused:!0}),t&&t(e)}onInputHandler(e){const{onInput:t}=this.props,{target:{value:a}}=e;this.setState({countdown:a.length}),"function"==typeof t&&t(e)}onChangeHandler(e){const{onChange:t}=this.props;"function"==typeof t&&t(e)}onClearHandler(){const{onChange:e}=this.props,{field:t,isUncontrolledValue:a,onInputHandler:n,onChangeHandler:o}=this;a&&(t.value=""),n(U),e&&o(U)}setField(e){const{setField:t}=this.props;t&&t(e),this.field=e}setRef(e){const{innerRef:t}=this.props;if("function"==typeof t)return t(e);t&&(t.current=e)}get helperConfig(){const{message:e,messageAction:t,messageActionOnClick:a,messageShow:n,helper:o}=this.props;return M({message:e,messageAction:t,messageActionOnClick:a,messageShow:n,helper:o})}renderChildren(){const{children:e,embeddedChildren:t=!0}=this.props;return t?(0,c.A)("div",{className:"".concat(y,"__embedded")},void 0,e):e}renderlabel(){const{label:e,labelSrOnly:t}=this.props;return t?(0,c.A)(f.s6,{},void 0,e):(0,c.A)("span",{className:"".concat(y,"__label")},void 0,e)}renderHelper(){const{modifier:e,numeric:t=!1,id:a}=this.props,{helper:n,show:o,action:s,onActionClick:i}=this.helperConfig,r=("error"===e||"warning"===e)&&n&&!t&&(z||(z=(0,c.A)(S,{namespace:y})));return l.createElement(l.Fragment,null,r,o&&(n||s)&&(0,c.A)("span",{id:"".concat(a,"-message"),className:"".concat(y,"__message")},void 0,n,i&&s&&(0,c.A)("span",{onClick:i,className:"".concat(y,"__message-action")},void 0,s)))}render(){var e,t;const a=this.props,{centered:n=!1,children:i,className:m,clear:p=!1,countdown:h=!1,disabled:g=!1,defaultValue:x,embeddedChildren:C,focus:b,id:_,innerRef:w,inputProps:S={},label:D,labelSrOnly:R,maxLength:M=120,message:O,messageAction:k,messageActionOnClick:z,messageShow:U,modifier:V,multiline:P=!1,numeric:T=!1,onChange:K,placeholder:W,prefix:j="",rows:q=1,select:G,setField:J,size:Q="large",split:X=!1,srLabel:Y,suffix:Z="",value:$,autoFocus:ee}=a,te=(0,s.A)(a,I),{focused:ae,height:ne,countdown:oe}=this.state,{helper:se,action:le}=this.helperConfig,ie=!T&&!X&&(h||se||le),re=r()(y,"".concat(y,"--textfield"),m,{["".concat(y,"--multiline")]:P,["".concat(y,"--countdown")]:h,["".concat(y,"--centered")]:n,["".concat(y,"--focused")]:ae,["".concat(y,"--").concat(V)]:V,["".concat(y,"--disabled")]:g,["".concat(y,"--medium")]:"medium"===Q}),ce=r()("".concat(y,"__suffix")),de=r()("".concat(y,"__prefix")),ue=r()("".concat(y,"__field"),{["".concat(y,"__field--multiline")]:P,["".concat(y,"--medium")]:"medium"===Q}),me=r()("".concat(y,"__bottom"),{["".concat(y,"--medium")]:"medium"===Q}),pe=(0,v.A)((0,v.A)((0,v.A)({},te),S),{},{id:_,defaultValue:x,value:$,className:ue,disabled:g||"readonly"===V,maxLength:M,style:P?{height:ne}:{},placeholder:W,onBlur:this.onBlurHandler,onFocus:this.onFocusHandler,onChange:this.onChangeHandler,ref:this.setField,"aria-invalid":"error"===V||"warning"===V||(null==S?void 0:S["aria-invalid"])||te["aria-invalid"],"aria-label":Y,"aria-describedby":(()=>{const{"aria-describedby":e}=S;return X?e:(se||le)&&h?"".concat(_,"-message ").concat(_,"-count"):h?"".concat(_,"-count"):se||le?"".concat(_,"-message"):void 0})(),rows:q,autoFocus:b||ee}),he=P?"textarea":"input";return(0,c.A)(u.Ri.Consumer,{},void 0,(a=>{const n=(0,u.UO)(a,H,N,F);return l.createElement("div",{className:re,ref:this.setRef},D&&(0,c.A)("label",{htmlFor:_},void 0,this.renderlabel()),(0,c.A)(d.v,{within:!0,isTextInput:!0,focusRingClass:ae?"visible-focused":""},void 0,(0,c.A)("div",{className:"".concat(y,"__control")},void 0,j&&(e||(e=(0,c.A)("span",{className:de},void 0,j))),l.createElement(he,(0,o.A)({key:"field"},pe,{onInput:this.onInputHandler})),Z&&(t||(t=(0,c.A)("span",{className:ce},void 0,Z))),"completed"===V&&(0,c.A)(L,{notificationsLabel:n.pgettext(B,"Campo de texto valido"),size:Q}),"indeterminate"===V&&(0,c.A)(A.A,{className:"".concat(y,"--textfield-progress"),size:"xsmall",srAnnouncement:n.pgettext(B,"Campo de texto procesando"),srLabel:n.pgettext(B,"Campo de texto procesando")}),p&&(0,c.A)(E,{"aria-label":n.pgettext(B,"Borrar"),namespace:y,onClick:this.onClearHandler,size:Q}),i&&this.renderChildren())),ie&&(0,c.A)("div",{className:me},void 0,this.renderHelper(),h&&l.createElement(l.Fragment,null,(0,c.A)("span",{id:"".concat(_,"-countdown-progress"),className:"".concat(y,"__countdown"),role:"progressbar","aria-valuenow":oe,"aria-valuemin":0,"aria-valuemax":Number(M),"aria-label":n.pgettext(B,"Maximo {0} caracteres",M)},void 0,"".concat(oe," / ").concat(M)),(0,c.A)(f.s6,{id:"".concat(_,"-count"),"aria-live":"polite","aria-atomic":"true"},void 0,n.pgettext(B,"{0} caracteres restantes",Number(M)-oe)))))}))}}V.displayName="TextField";var P=V;const T=["id"];var K=function(){const e=(0,l.forwardRef)(((e,t)=>{const{id:a}=e,n=(0,s.A)(e,T),i=(0,u.Bi)(a);return l.createElement(P,(0,o.A)({innerRef:t},n,{id:i}))}));return e.displayName="TextfieldContainer",e}()}}]); //# sourceMappingURL=4442.ac46d08e.js.map