{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{aZ9c:function(t,e,r){\"use strict\";var n=r(\"q1tI\"),o=r.n(n);var a=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\";function i(){}function s(){}s.resetWarningCache=i;var u=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){t.exports=function(){function t(t,e,r,n,o,i){if(i!==a){var s=new Error(\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\");throw s.name=\"Invariant Violation\",s}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:i};return r.PropTypes=r,r}()}));function p(){}function l(t){return!!(t||\"\").match(/\\d/)}function f(t){return null===t||void 0===t}function c(t){return t.replace(/[-[\\]/{}()*+?.\\\\^$|]/g,\"\\\\$&\")}function h(t,e){void 0===e&&(e=!0);var r=\"-\"===t[0],n=r&&e,o=(t=t.replace(\"-\",\"\")).split(\".\");return{beforeDecimal:o[0],afterDecimal:o[1]||\"\",hasNagation:r,addNegation:n}}function g(t,e,r){for(var n=\"\",o=r?\"0\":\"\",a=0;a<=e-1;a++)n+=t[a]||o;return n}function m(t,e){return Array(e+1).join(t)}function d(t){var e=\"-\"===(t+=\"\")[0]?\"-\":\"\";e&&(t=t.substring(1));var r=t.split(/[eE]/g),n=r[0],o=r[1];if(!(o=Number(o)))return e+n;var a=1+o,i=(n=n.replace(\".\",\"\")).length;return a<0?n=\"0.\"+m(\"0\",Math.abs(a))+n:a>=i?n+=m(\"0\",a-i):n=(n.substring(0,a)||\"0\")+\".\"+n.substring(a),e+n}function v(t,e){if(t.value=t.value,null!==t){if(t.createTextRange){var r=t.createTextRange();return r.move(\"character\",e),r.select(),!0}return t.selectionStart||0===t.selectionStart?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}function y(t,e,r){return Math.min(Math.max(t,e),r)}function S(t){return Math.max(t.selectionStart,t.selectionEnd)}var b={thousandSeparator:u.oneOfType([u.string,u.oneOf([!0])]),decimalSeparator:u.string,allowedDecimalSeparators:u.arrayOf(u.string),thousandsGroupStyle:u.oneOf([\"thousand\",\"lakh\",\"wan\"]),decimalScale:u.number,fixedDecimalScale:u.bool,displayType:u.oneOf([\"input\",\"text\"]),prefix:u.string,suffix:u.string,format:u.oneOfType([u.string,u.func]),removeFormatting:u.func,mask:u.oneOfType([u.string,u.arrayOf(u.string)]),value:u.oneOfType([u.number,u.string]),defaultValue:u.oneOfType([u.number,u.string]),isNumericString:u.bool,customInput:u.elementType,allowNegative:u.bool,allowEmptyFormatting:u.bool,allowLeadingZeros:u.bool,onValueChange:u.func,onKeyDown:u.func,onMouseUp:u.func,onChange:u.func,onFocus:u.func,onBlur:u.func,type:u.oneOf([\"text\",\"tel\",\"password\"]),isAllowed:u.func,renderText:u.func,getInputRef:u.oneOfType([u.func,u.shape({current:u.any})])},x={displayType:\"input\",decimalSeparator:\".\",thousandsGroupStyle:\"thousand\",fixedDecimalScale:!1,prefix:\"\",suffix:\"\",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:\"text\",onValueChange:p,onChange:p,onKeyDown:p,onMouseUp:p,onFocus:p,onBlur:p,isAllowed:function(){return!0}},w=function(t){function e(e){t.call(this,e);var r=e.defaultValue;this.validateProps();var n=this.formatValueProp(r);this.state={value:n,numAsString:this.removeFormatting(n),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.componentDidMount=function(){this.setState({mounted:!0})},e.prototype.componentDidUpdate=function(t){this.updateValueIfRequired(t)},e.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout)},e.prototype.updateValueIfRequired=function(t){var e=this.props,r=this.state,n=this.focusedElm,o=r.value,a=r.numAsString;if(void 0===a&&(a=\"\"),t!==e){this.validateProps();var i=this.formatNumString(a),s=f(e.value)?i:this.formatValueProp(),u=this.removeFormatting(s),p=parseFloat(u),l=parseFloat(a);(isNaN(p)&&isNaN(l)||p===l)&&i===o&&(null!==n||s===o)||this.updateValue({formattedValue:s,numAsString:u,input:n})}},e.prototype.getFloatString=function(t){void 0===t&&(t=\"\");var e=this.props.decimalScale,r=this.getSeparators().decimalSeparator,n=this.getNumberRegex(!0),o=\"-\"===t[0];o&&(t=t.replace(\"-\",\"\")),r&&0===e&&(t=t.split(r)[0]);var a=(t=(t.match(n)||[]).join(\"\").replace(r,\".\")).indexOf(\".\");return-1!==a&&(t=t.substring(0,a)+\".\"+t.substring(a+1,t.length).replace(new RegExp(c(r),\"g\"),\"\")),o&&(t=\"-\"+t),t},e.prototype.getNumberRegex=function(t,e){var r=this.props,n=r.format,o=r.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp(\"\\\\d\"+(!a||0===o||e||n?\"\":\"|\"+c(a)),t?\"g\":void 0)},e.prototype.getSeparators=function(){var t=this.props.decimalSeparator,e=this.props,r=e.thousandSeparator,n=e.allowedDecimalSeparators;return!0===r&&(r=\",\"),n||(n=[t,\".\"]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}},e.prototype.getMaskAtIndex=function(t){var e=this.props.mask;return void 0===e&&(e=\" \"),\"string\"===typeof e?e:e[t]||\" \"},e.prototype.getValueObject=function(t,e){var r=parseFloat(e);return{formattedValue:t,value:e,floatValue:isNaN(r)?void 0:r}},e.prototype.validateProps=function(){var t=this.props.mask,e=this.getSeparators(),r=e.decimalSeparator,n=e.thousandSeparator;if(r===n)throw new Error(\"\\n Decimal separator can't be same as thousand separator.\\n thousandSeparator: \"+n+' (thousandSeparator = {true} is same as thousandSeparator = \",\")\\n decimalSeparator: '+r+\" (default value for decimalSeparator is .)\\n \");if(t&&(\"string\"===t?t:t.toString()).match(/\\d/g))throw new Error(\"\\n Mask \"+t+\" should not contain numeric character;\\n \")},e.prototype.setPatchedCaretPosition=function(t,e,r){v(t,e),setTimeout((function(){t.value===r&&v(t,e)}),0)},e.prototype.correctCaretPosition=function(t,e,r){var n=this.props,o=n.prefix,a=n.suffix,i=n.format;if(\"\"===t)return 0;if(e=y(e,0,t.length),!i){var s=\"-\"===t[0];return y(e,o.length+(s?1:0),t.length-a.length)}if(\"function\"===typeof i)return e;if(\"#\"===i[e]&&l(t[e]))return e;if(\"#\"===i[e-1]&&l(t[e-1]))return e;var u=i.indexOf(\"#\");e=y(e,u,i.lastIndexOf(\"#\")+1);for(var p=i.substring(e,i.length).indexOf(\"#\"),f=e,c=e+(-1===p?0:p);f>u&&(\"#\"!==i[f]||!l(t[f]));)f-=1;return!l(t[c])||\"left\"===r&&e!==u||e-fr?(Number(t[0])+Number(e)).toString()+t.substring(1,t.length):e+t}),p[0])+(n?\".\":\"\")+g(p[1]||\"\",Math.min(e,i.length),r)}(s,n,o)),u?this.formatNumString(s):this.formatInput(s))},e.prototype.formatNegation=function(t){void 0===t&&(t=\"\");var e=this.props.allowNegative,r=new RegExp(\"(-)\"),n=new RegExp(\"(-)(.)*(-)\"),o=r.test(t),a=n.test(t);return t=t.replace(/-/g,\"\"),o&&!a&&e&&(t=\"-\"+t),t},e.prototype.formatInput=function(t){return void 0===t&&(t=\"\"),this.props.format||(t=this.removePrefixAndSuffix(t),t=this.formatNegation(t)),t=this.removeFormatting(t),this.formatNumString(t)},e.prototype.isCharacterAFormat=function(t,e){var r=this.props,n=r.format,o=r.prefix,a=r.suffix,i=r.decimalScale,s=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return\"string\"===typeof n&&\"#\"!==n[t]||!(n||!(t=e.length-a.length||i&&s&&e[t]===u))},e.prototype.correctInputValue=function(t,e,r){var n=this,o=this.props,a=o.format,i=o.allowNegative,s=o.prefix,u=o.suffix,p=o.decimalScale,l=this.getSeparators(),f=l.allowedDecimalSeparators,c=l.decimalSeparator,g=this.state.numAsString||\"\",m=this.selectionBeforeInput,d=m.selectionStart,v=m.selectionEnd,y=function(t,e){for(var r=0,n=0,o=t.length,a=e.length;t[r]===e[r]&&rr&&o-n>r;)n++;return{start:r,end:o-n}}(e,r),S=y.start,b=y.end;if(!a&&S===b&&-1!==f.indexOf(r[d])){var x=0===p?\"\":c;return r.substr(0,d)+x+r.substr(d+1,r.length)}var w=a?0:s.length,P=e.length-(a?0:u.length);if(r.length>e.length||!r.length||S===b||0===d&&v===e.length||0===S&&b===e.length||d===w&&v===P)return r;var O=e.substr(S,b-S);if(!![].concat(O).find((function(t,r){return n.isCharacterAFormat(r+S,e)}))){var N=e.substr(S),F={},C=[];[].concat(N).forEach((function(t,r){n.isCharacterAFormat(r+S,e)?F[r]=t:r>O.length-1&&C.push(t)})),Object.keys(F).forEach((function(t){C.length>t?C.splice(t,0,F[t]):C.push(F[t])})),r=e.substr(0,S)+C.join(\"\")}if(!a){var D=this.removeFormatting(r),E=h(D,i),T=E.beforeDecimal,V=E.afterDecimal,A=E.addNegation,I=tS;)y--;y=this.correctCaretPosition(i,y,\"left\")}}else for(;!m.test(i[y])&&yb)&&(t.preventDefault(),this.setPatchedCaretPosition(r,y,i)),t.isUnitTestRun&&this.setPatchedCaretPosition(r,y,i),h(t)}else h(t)},e.prototype.onMouseUp=function(t){var e=t.target,r=e.selectionStart,n=e.selectionEnd,o=e.value;if(void 0===o&&(o=\"\"),r===n){var a=this.correctCaretPosition(o,r);a!==r&&this.setPatchedCaretPosition(e,a,o)}this.props.onMouseUp(t)},e.prototype.onFocus=function(t){var e=this;t.persist(),this.focusedElm=t.target,this.focusTimeout=setTimeout((function(){var r=t.target,n=r.selectionStart,o=r.selectionEnd,a=r.value;void 0===a&&(a=\"\");var i=e.correctCaretPosition(a,n);i===n||0===n&&o===a.length||e.setPatchedCaretPosition(r,i,a),e.props.onFocus(t)}),0)},e.prototype.render=function(){var t=this.props,e=t.type,r=t.displayType,n=t.customInput,a=t.renderText,i=t.getInputRef,s=t.format,u=this.state,p=u.value,l=u.mounted,f=function(t,e){var r={};return Object.keys(t).forEach((function(n){e[n]||(r[n]=t[n])})),r}(this.props,b),c=l&&function(t){return t||!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?\"numeric\":void 0,h=Object.assign({inputMode:c},f,{type:e,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(\"text\"===r)return a?a(p,f)||null:o.a.createElement(\"span\",Object.assign({},f,{ref:i}),p);if(n){var g=n;return o.a.createElement(g,Object.assign({},h,{ref:i}))}return o.a.createElement(\"input\",Object.assign({},h,{ref:i}))},e}(o.a.Component);w.propTypes=b,w.defaultProps=x,e.a=w}}]);","extractedComments":[]}