(window.webpackJsonp=window.webpackJsonp||[]).push([[134],{309:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(51),a=n(0),r=function(e){function t(t){var n;return(n=e.call(this,t)||this)._state=null,n._del=!1,n._handleChange=function(e){var t=n.state.value,o=e.target.value,a=e.target,r=o.length>t.length,s=n._del,i=t===n.props.format(o);n.setState({value:o,local:!0},(function(){var e=a.selectionStart,l=n.props.refuse||/[^\d]+/g,u=o.substr(0,e).replace(l,"");if(n._state={input:a,before:u,op:r,di:s&&i,del:s},n.props.replace&&n.props.replace(t)&&r&&!i){for(var p=-1,c=0;c!==u.length;++c)p=Math.max(p,o.toLowerCase().indexOf(u[c].toLowerCase(),p+1));var d=o.substr(p+1).replace(l,"")[0];p=o.indexOf(d,p+1),o=""+o.substr(0,p)+o.substr(p+1)}var h=n.props.format(o);t===h?n.setState({value:o}):n.props.onChange(h)}))},n._hKD=function(e){"Delete"===e.code&&(n._del=!0)},n._hKU=function(e){"Delete"===e.code&&(n._del=!1)},n.state={value:t.value,local:!0},n}Object(o.a)(t,e),t.getDerivedStateFromProps=function(e,t){return{value:t.local?t.value:e.value,local:!1}};var n=t.prototype;return n.render=function(){var e=this._handleChange,t=this.state.value;return(0,this.props.children)({value:t,onChange:e})},n.componentWillUnmount=function(){document.removeEventListener("keydown",this._hKD),document.removeEventListener("keyup",this._hKU)},n.componentDidMount=function(){document.addEventListener("keydown",this._hKD),document.addEventListener("keyup",this._hKU)},n.componentDidUpdate=function(){var e=this._state;if(e){for(var t=this.state.value,n=-1,o=0;o!==e.before.length;++o)n=Math.max(n,t.toLowerCase().indexOf(e.before[o].toLowerCase(),n+1));if(this.props.replace&&(e.op||e.del&&!e.di))for(;t[n+1]&&(this.props.refuse||/[^\d]+/).test(t[n+1]);)n+=1;e.input.selectionStart=e.input.selectionEnd=n+1+(e.di?1:0)}this._state=null},t}(a.Component)}}]);