diff --git a/dist/imask.es.js b/dist/imask.es.js index e56de1d5..01ada623 100644 --- a/dist/imask.es.js +++ b/dist/imask.es.js @@ -823,225 +823,9 @@ var Masked = (_class = function () { return Masked; }(), (_applyDecoratedDescriptor(_class.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class.prototype, 'mask'), _class.prototype)), _class); -function createMask(opts) { - opts = _extends({}, opts); // clone - - var mask = opts.mask; - - if (mask instanceof IMask.Masked) { - return mask; - } - if (mask instanceof RegExp) { - opts.validate = function (value) { - return mask.test(value); - }; - return new IMask.Masked(opts); - } - if (isString(mask)) { - return new IMask.MaskedPattern(opts); - } - if (mask.prototype instanceof IMask.Masked) { - delete opts.mask; - return new mask(opts); - } - if (mask instanceof Number || typeof mask === 'number' || mask === Number) { - delete opts.mask; - return new IMask.MaskedNumber(opts); - } - if (mask instanceof Date || mask === Date) { - delete opts.mask; - if (opts.pattern) { - opts.mask = opts.pattern; - delete opts.pattern; - } - return new IMask.MaskedDate(opts); - } - if (mask instanceof Function) { - opts.validate = mask; - return new IMask.Masked(opts); - } - - console.warn('Mask not found for', opts); // eslint-disable-line no-console - return new IMask.Masked(opts); -} - -var PatternDefinition = function () { - function PatternDefinition(opts) { - classCallCheck(this, PatternDefinition); - - _extends(this, opts); - - if (this.mask) { - this._masked = createMask(opts); - } - } - - PatternDefinition.prototype.reset = function reset() { - this.isHollow = false; - if (this._masked) this._masked.reset(); - }; - - PatternDefinition.prototype.resolve = function resolve(ch) { - if (!this._masked) return false; - // TODO seems strange - this._masked.value = ch; - return this._masked.value; - }; - - createClass(PatternDefinition, [{ - key: 'isInput', - get: function get$$1() { - return this.type === PatternDefinition.TYPES.INPUT; - } - }, { - key: 'isHiddenHollow', - get: function get$$1() { - return this.isHollow && this.optional; - } - }]); - return PatternDefinition; -}(); - -PatternDefinition.DEFAULTS = { - '0': /\d/, - 'a': /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // http://stackoverflow.com/a/22075070 - '*': /./ -}; -PatternDefinition.TYPES = { - INPUT: 'input', - FIXED: 'fixed' -}; - -var PatternGroup = function () { - function PatternGroup(masked, _ref) { - var name = _ref.name, - offset = _ref.offset, - mask = _ref.mask, - validate = _ref.validate; - classCallCheck(this, PatternGroup); - - this.masked = masked; - this.name = name; - this.offset = offset; - this.mask = mask; - this.validate = validate || function () { - return true; - }; - } - - PatternGroup.prototype._validate = function _validate(soft) { - return this.validate(this.value, this, soft); - }; - - createClass(PatternGroup, [{ - key: 'value', - get: function get$$1() { - return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); - } - }, { - key: 'unmaskedValue', - get: function get$$1() { - return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); - } - }]); - return PatternGroup; -}(); - -var RangeGroup = function () { - function RangeGroup(_ref2) { - var from = _ref2[0], - to = _ref2[1]; - var maxlen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (to + '').length; - classCallCheck(this, RangeGroup); - - this._from = from; - this._to = to; - this._maxLength = maxlen; - this.validate = this.validate.bind(this); - - this._update(); - } - - RangeGroup.prototype._update = function _update() { - this._maxLength = Math.max(this._maxLength, (this.to + '').length); - this.mask = '0'.repeat(this._maxLength); - }; - - RangeGroup.prototype.validate = function validate(str) { - var minstr = ''; - var maxstr = ''; - - var _str$match = str.match(/^(\D*)(\d*)(\D*)/), - placeholder = _str$match[1], - num = _str$match[2]; - - if (num) { - minstr = '0'.repeat(placeholder.length) + num; - maxstr = '9'.repeat(placeholder.length) + num; - } - - var firstNonZero = str.search(/[^0]/); - if (firstNonZero === -1 && str.length <= this._matchFrom) return true; - - minstr = minstr.padEnd(this._maxLength, '0'); - maxstr = maxstr.padEnd(this._maxLength, '9'); - - return this.from <= Number(maxstr) && Number(minstr) <= this.to; - }; - - createClass(RangeGroup, [{ - key: 'to', - get: function get$$1() { - return this._to; - }, - set: function set$$1(to) { - this._to = to; - this._update(); - } - }, { - key: 'from', - get: function get$$1() { - return this._from; - }, - set: function set$$1(from) { - this._from = from; - this._update(); - } - }, { - key: 'maxLength', - get: function get$$1() { - return this._maxLength; - }, - set: function set$$1(maxLength) { - this._maxLength = maxLength; - this._update(); - } - }, { - key: '_matchFrom', - get: function get$$1() { - return this.maxLength - (this.from + '').length; - } - }]); - return RangeGroup; -}(); - -function EnumGroup(enums) { - return { - mask: '*'.repeat(enums[0].length), - validate: function validate(value, group) { - return enums.some(function (e) { - return e.indexOf(group.unmaskedValue) >= 0; - }); - } - }; -} - -PatternGroup.Range = RangeGroup; -PatternGroup.Enum = EnumGroup; - -var _class$1; +var _class$2; -function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) { +function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; @@ -1070,761 +854,977 @@ function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, c return desc; } -var MaskedPattern = (_class$1 = function (_Masked) { - inherits(MaskedPattern, _Masked); +var MaskedNumber = (_class$2 = function (_Masked) { + inherits(MaskedNumber, _Masked); - function MaskedPattern() { + function MaskedNumber() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - classCallCheck(this, MaskedPattern); - var definitions = opts.definitions, - placeholder = opts.placeholder, - groups = opts.groups; + classCallCheck(this, MaskedNumber); + + opts = _extends({}, MaskedNumber.DEFAULTS, opts); var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); delete _this.isInitialized; - _this.placeholder = placeholder; - _this.definitions = definitions; - _this.groups = groups; + var _opts = opts, + scale = _opts.scale, + radix = _opts.radix, + mapToRadix = _opts.mapToRadix, + min = _opts.min, + max = _opts.max, + signed = _opts.signed, + thousandsSeparator = _opts.thousandsSeparator, + postFormat = _opts.postFormat; + + + _this.min = min; + _this.max = max; + _this.scale = scale; + _this.radix = radix; + _this.mapToRadix = mapToRadix; + _this.signed = signed; + _this.thousandsSeparator = thousandsSeparator; + _this.postFormat = postFormat; + + _this._updateNumberRegExp(); _this.isInitialized = true; return _this; } - MaskedPattern.prototype._updateMask = function _updateMask() { - var _this2 = this; - - var defs = this._definitions; - this._charDefs = []; - this._groupDefs = []; + MaskedNumber.prototype._updateNumberRegExp = function _updateNumberRegExp() { + // TODO refactor? + var regExpStrSoft = '^'; + var regExpStr = '^'; - var pattern = this.mask; - if (!pattern || !defs) return; + if (this.signed) { + regExpStrSoft += '([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))'; + regExpStr += '[+|\\-]?'; + } else { + regExpStrSoft += '(0|([1-9]+\\d*))'; + } + regExpStr += '\\d*'; - var unmaskingBlock = false; - var optionalBlock = false; - var stopAlign = false; + if (this.scale) { + regExpStrSoft += '(' + this.radix + '\\d{0,' + this.scale + '})?'; + regExpStr += '(' + this.radix + '\\d{0,' + this.scale + '})?'; + } - var _loop = function _loop(_i) { - if (_this2._groups) { - var p = pattern.slice(_i); - var gNames = Object.keys(_this2._groups).filter(function (gName) { - return p.indexOf(gName) === 0; - }); - // order by key length - gNames.sort(function (a, b) { - return b.length - a.length; - }); - // use group name with max length - var gName = gNames[0]; - if (gName) { - var group = _this2._groups[gName]; - _this2._groupDefs.push(new PatternGroup(_this2, { - name: gName, - offset: _this2._charDefs.length, - mask: group.mask, - validate: group.validate - })); - pattern = pattern.replace(gName, group.mask); - } - } + regExpStrSoft += '$'; + regExpStr += '$'; - var char = pattern[_i]; - var type = !unmaskingBlock && char in defs ? PatternDefinition.TYPES.INPUT : PatternDefinition.TYPES.FIXED; - var unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock; - var optional = type === PatternDefinition.TYPES.INPUT && optionalBlock; + this._numberRegExpSoft = new RegExp(regExpStrSoft); + this._numberRegExp = new RegExp(regExpStr); + }; - if (char === MaskedPattern.STOP_CHAR) { - stopAlign = true; - return 'continue'; - } + MaskedNumber.prototype.extractTail = function extractTail() { + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - if (char === '{' || char === '}') { - unmaskingBlock = !unmaskingBlock; - return 'continue'; - } + return this._removeThousandsSeparators(_Masked.prototype.extractTail.call(this, fromPos, toPos)); + }; - if (char === '[' || char === ']') { - optionalBlock = !optionalBlock; - return 'continue'; - } + MaskedNumber.prototype._removeThousandsSeparators = function _removeThousandsSeparators(value) { + return value.replace(this._thousandsSeparatorRegExp, ''); + }; - if (char === MaskedPattern.ESCAPE_CHAR) { - ++_i; - char = pattern[_i]; - // TODO validation - if (!char) return 'break'; - type = PatternDefinition.TYPES.FIXED; - } + MaskedNumber.prototype._insertThousandsSeparators = function _insertThousandsSeparators(value) { + // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript + var parts = value.split(this.radix); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator); + return parts.join(this.radix); + }; - _this2._charDefs.push(new PatternDefinition({ - char: char, - type: type, - optional: optional, - stopAlign: stopAlign, - mask: unmasking && (type === PatternDefinition.TYPES.INPUT ? defs[char] : function (value) { - return value === char; - }) - })); + MaskedNumber.prototype._append = function _append(str, soft) { + return _Masked.prototype._append.call(this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix)), soft); + }; - stopAlign = false; - i = _i; - }; + MaskedNumber.prototype.appendWithTail = function appendWithTail(str, tail) { + var oldValueLength = this.value.length; + this._value = this._removeThousandsSeparators(this.value); + var removedSeparatorsCount = oldValueLength - this.value.length; - _loop2: for (var i = 0; i < pattern.length; ++i) { - var _ret = _loop(i); + var appended = _Masked.prototype.appendWithTail.call(this, str, tail); - switch (_ret) { - case 'continue': - continue; + this._value = this._insertThousandsSeparators(this.value); - case 'break': - break _loop2;} + var beforeTailPos = oldValueLength + appended - removedSeparatorsCount; + this._value = this._insertThousandsSeparators(this.value); + var insertedSeparatorsBeforeTailCount = 0; + for (var pos = 0; pos <= beforeTailPos; ++pos) { + if (this.value[pos] === this.thousandsSeparator) { + ++insertedSeparatorsBeforeTailCount; + ++beforeTailPos; + } } - }; - MaskedPattern.prototype._validate = function _validate(soft) { - return this._groupDefs.every(function (g) { - return g._validate(soft); - }) && _Masked.prototype._validate.call(this, soft); + return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount; }; - MaskedPattern.prototype.clone = function clone() { - var _this3 = this; + MaskedNumber.prototype.nearestInputPos = function nearestInputPos(cursorPos) { + var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; - var m = new MaskedPattern(this); - m._value = this.value; - m._charDefs.forEach(function (d, i) { - return _extends(d, _this3._charDefs[i]); - }); - m._groupDefs.forEach(function (d, i) { - return _extends(d, _this3._groupDefs[i]); - }); - return m; - }; + if (!direction) return cursorPos; - MaskedPattern.prototype.reset = function reset() { - _Masked.prototype.reset.call(this); - this._charDefs.forEach(function (d) { - delete d.isHollow; - }); + var nextPos = indexInDirection(cursorPos, direction); + if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction; + return cursorPos; }; - MaskedPattern.prototype.hiddenHollowsBefore = function hiddenHollowsBefore(defIndex) { - return this._charDefs.slice(0, defIndex).filter(function (d) { - return d.isHiddenHollow; - }).length; - }; + MaskedNumber.prototype._validate = function _validate(soft) { + var regexp = soft ? this._numberRegExpSoft : this._numberRegExp; - MaskedPattern.prototype.mapDefIndexToPos = function mapDefIndexToPos(defIndex) { - if (defIndex == null) return; - return defIndex - this.hiddenHollowsBefore(defIndex); - }; + // validate as string + var valid = regexp.test(this._removeThousandsSeparators(this.value)); - MaskedPattern.prototype.mapPosToDefIndex = function mapPosToDefIndex(pos) { - if (pos == null) return; - var defIndex = pos; - for (var di = 0; di < this._charDefs.length; ++di) { - var def = this._charDefs[di]; - if (di >= defIndex) break; - if (def.isHiddenHollow) ++defIndex; + if (valid) { + // validate as number + var number = this.number; + valid = valid && !isNaN(number) && ( + // check min bound for negative values + this.min == null || this.min >= 0 || this.min <= this.number) && ( + // check max bound for positive values + this.max == null || this.max <= 0 || this.number <= this.max); } - return defIndex; + + return valid && _Masked.prototype._validate.call(this, soft); }; - MaskedPattern.prototype._unmask = function _unmask() { - var str = this.value; - var unmasked = ''; + MaskedNumber.prototype.commit = function commit() { + var number = this.number; + var validnum = number; - for (var ci = 0, di = 0; ci < str.length && di < this._charDefs.length; ++di) { - var ch = str[ci]; - var def = this._charDefs[di]; + // check bounds + if (this.min != null) validnum = Math.max(validnum, this.min); + if (this.max != null) validnum = Math.min(validnum, this.max); - if (def.isHiddenHollow) continue; - if (def.mask && !def.isHollow) unmasked += ch; - ++ci; + if (validnum !== number) { + this.unmaskedValue = '' + validnum; } - return unmasked; - }; + var formatted = this.value; - MaskedPattern.prototype._appendTail = function _appendTail(tail) { - return (!tail || this._appendChunks(tail)) && this._appendPlaceholder(); - }; + if (this.postFormat.normalizeZeros) { + formatted = this._normalizeZeros(formatted); + } - MaskedPattern.prototype._append = function _append(str, soft) { - var oldValueLength = this.value.length; + if (this.postFormat.padFractionalZeros) { + formatted = this._padFractionalZeros(formatted); + } - for (var ci = 0, di = this.mapPosToDefIndex(this.value.length); ci < str.length;) { - var ch = str[ci]; - var def = this._charDefs[di]; + this._value = formatted; + }; - // check overflow - if (!def) return false; + MaskedNumber.prototype._normalizeZeros = function _normalizeZeros(value) { + var parts = this._removeThousandsSeparators(value).split(this.radix); - // reset - def.isHollow = false; + // remove leading zeros + parts[0] = parts[0].replace(/^(\D*)(0*)(\d*)/, function (match, sign, zeros, num) { + return sign + num; + }); + // add leading zero + if (value.length && !/\d$/.test(parts[0])) parts[0] = parts[0] + '0'; - var resolved = void 0, - skipped = void 0; - var chres = conform(def.resolve(ch), ch); + if (parts.length > 1) { + parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros + if (!parts[1].length) parts.length = 1; // remove fractional + } - if (def.type === PatternDefinition.TYPES.INPUT) { - if (chres) { - this._value += chres; - if (!this._validate()) { - chres = ''; - this._value = this.value.slice(0, -1); - } - } + return this._insertThousandsSeparators(parts.join(this.radix)); + }; - resolved = !!chres; - skipped = !chres && !def.optional; + MaskedNumber.prototype._padFractionalZeros = function _padFractionalZeros(value) { + var parts = value.split(this.radix); + if (parts.length < 2) parts.push(''); + parts[1] = parts[1].padEnd(this.scale, '0'); + return parts.join(this.radix); + }; - // if ok - next di - if (!chres) { - if (!def.optional && !soft) { - this._value += this.placeholder.char; - skipped = false; - } - if (!skipped) def.isHollow = true; - } - } else { - this._value += def.char; - resolved = chres && (def.mask || soft); - } + createClass(MaskedNumber, [{ + key: 'number', + get: function get$$1() { + var numstr = this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix, '.'); - if (!skipped) ++di; - if (resolved || skipped) ++ci; + return Number(numstr); + }, + set: function set$$1(number) { + this.unmaskedValue = '' + number; + } + }, { + key: 'min', + get: function get$$1() { + return this._min; + }, + set: function set$$1(min) { + this._min = min; + } + }, { + key: 'max', + get: function get$$1() { + return this._max; + }, + set: function set$$1(max) { + this._max = max; + } + }, { + key: 'scale', + get: function get$$1() { + return this._scale; + }, + set: function set$$1(scale) { + this._scale = scale; + } + }, { + key: 'radix', + get: function get$$1() { + return this._radix; + }, + set: function set$$1(radix) { + this._radix = radix; + this._updateNumberRegExp(); + } + }, { + key: 'signed', + get: function get$$1() { + return this._signed || this.min != null && this.min < 0 || this.max != null && this.max < 0; + }, + set: function set$$1(signed) { + this._signed = signed; + } + }, { + key: 'postFormat', + get: function get$$1() { + return this._postFormat; + }, + set: function set$$1(postFormat) { + this._postFormat = _extends({}, MaskedNumber.DEFAULTS.postFormat, postFormat); + } + }, { + key: 'mapToRadix', + get: function get$$1() { + return this._mapToRadix; + }, + set: function set$$1(mapToRadix) { + this._mapToRadix = mapToRadix; + this._mapToRadixRegExp = new RegExp('[' + mapToRadix.map(escapeRegExp).join('') + ']', 'g'); + } + }, { + key: 'thousandsSeparator', + get: function get$$1() { + return this._thousandsSeparator; + }, + set: function set$$1(thousandsSeparator) { + this._thousandsSeparator = thousandsSeparator; + this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g'); } + }]); + return MaskedNumber; +}(Masked), (_applyDecoratedDescriptor$2(_class$2.prototype, 'min', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'min'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'max', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'max'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'scale', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'scale'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'radix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'radix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'signed', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'signed'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'postFormat', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'postFormat'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'mapToRadix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'mapToRadix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'thousandsSeparator', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'thousandsSeparator'), _class$2.prototype)), _class$2); +MaskedNumber.DEFAULTS = { + radix: ',', + thousandsSeparator: '', + mapToRadix: ['.'], + scale: 2, + postFormat: { + normalizeZeros: true + } +}; - return this.value.length - oldValueLength; +function createMask(opts) { + opts = _extends({}, opts); // clone + + var mask = opts.mask; + + if (mask instanceof Masked) { + return mask; + } + if (mask instanceof RegExp) { + opts.validate = function (value) { + return mask.test(value); + }; + return new Masked(opts); + } + if (isString(mask)) { + return new IMask.MaskedPattern(opts); + } + if (mask.prototype instanceof Masked) { + delete opts.mask; + return new mask(opts); + } + if (mask instanceof Number || typeof mask === 'number' || mask === Number) { + delete opts.mask; + return new MaskedNumber(opts); + } + if (mask instanceof Date || mask === Date) { + delete opts.mask; + if (opts.pattern) { + opts.mask = opts.pattern; + delete opts.pattern; + } + return new IMask.MaskedDate(opts); + } + if (mask instanceof Function) { + opts.validate = mask; + return new Masked(opts); + } + + console.warn('Mask not found for', opts); // eslint-disable-line no-console + return new Masked(opts); +} + +var PatternDefinition = function () { + function PatternDefinition(opts) { + classCallCheck(this, PatternDefinition); + + _extends(this, opts); + + if (this.mask) { + this._masked = createMask(opts); + } + } + + PatternDefinition.prototype.reset = function reset() { + this.isHollow = false; + if (this._masked) this._masked.reset(); }; - MaskedPattern.prototype._appendChunks = function _appendChunks(chunks, soft) { - for (var ci = 0; ci < chunks.length; ++ci) { - var _chunks$ci = chunks[ci], - fromDefIndex = _chunks$ci[0], - input = _chunks$ci[1]; + PatternDefinition.prototype.resolve = function resolve(ch) { + if (!this._masked) return false; + // TODO seems strange + this._masked.value = ch; + return this._masked.value; + }; - if (fromDefIndex != null) this._appendPlaceholder(fromDefIndex); - if (this._append(input, soft) === false) return false; + createClass(PatternDefinition, [{ + key: 'isInput', + get: function get$$1() { + return this.type === PatternDefinition.TYPES.INPUT; } - return true; + }, { + key: 'isHiddenHollow', + get: function get$$1() { + return this.isHollow && this.optional; + } + }]); + return PatternDefinition; +}(); + +PatternDefinition.DEFAULTS = { + '0': /\d/, + 'a': /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // http://stackoverflow.com/a/22075070 + '*': /./ +}; +PatternDefinition.TYPES = { + INPUT: 'input', + FIXED: 'fixed' +}; + +var PatternGroup = function () { + function PatternGroup(masked, _ref) { + var name = _ref.name, + offset = _ref.offset, + mask = _ref.mask, + validate = _ref.validate; + classCallCheck(this, PatternGroup); + + this.masked = masked; + this.name = name; + this.offset = offset; + this.mask = mask; + this.validate = validate || function () { + return true; + }; + } + + PatternGroup.prototype._validate = function _validate(soft) { + return this.validate(this.value, this, soft); }; - MaskedPattern.prototype.extractTail = function extractTail(fromPos, toPos) { - return this.extractInputChunks(fromPos, toPos); + createClass(PatternGroup, [{ + key: 'value', + get: function get$$1() { + return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); + } + }, { + key: 'unmaskedValue', + get: function get$$1() { + return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); + } + }]); + return PatternGroup; +}(); + +var RangeGroup = function () { + function RangeGroup(_ref2) { + var from = _ref2[0], + to = _ref2[1]; + var maxlen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (to + '').length; + classCallCheck(this, RangeGroup); + + this._from = from; + this._to = to; + this._maxLength = maxlen; + this.validate = this.validate.bind(this); + + this._update(); + } + + RangeGroup.prototype._update = function _update() { + this._maxLength = Math.max(this._maxLength, (this.to + '').length); + this.mask = '0'.repeat(this._maxLength); + }; + + RangeGroup.prototype.validate = function validate(str) { + var minstr = ''; + var maxstr = ''; + + var _str$match = str.match(/^(\D*)(\d*)(\D*)/), + placeholder = _str$match[1], + num = _str$match[2]; + + if (num) { + minstr = '0'.repeat(placeholder.length) + num; + maxstr = '9'.repeat(placeholder.length) + num; + } + + var firstNonZero = str.search(/[^0]/); + if (firstNonZero === -1 && str.length <= this._matchFrom) return true; + + minstr = minstr.padEnd(this._maxLength, '0'); + maxstr = maxstr.padEnd(this._maxLength, '9'); + + return this.from <= Number(maxstr) && Number(minstr) <= this.to; + }; + + createClass(RangeGroup, [{ + key: 'to', + get: function get$$1() { + return this._to; + }, + set: function set$$1(to) { + this._to = to; + this._update(); + } + }, { + key: 'from', + get: function get$$1() { + return this._from; + }, + set: function set$$1(from) { + this._from = from; + this._update(); + } + }, { + key: 'maxLength', + get: function get$$1() { + return this._maxLength; + }, + set: function set$$1(maxLength) { + this._maxLength = maxLength; + this._update(); + } + }, { + key: '_matchFrom', + get: function get$$1() { + return this.maxLength - (this.from + '').length; + } + }]); + return RangeGroup; +}(); + +function EnumGroup(enums) { + return { + mask: '*'.repeat(enums[0].length), + validate: function validate(value, group) { + return enums.some(function (e) { + return e.indexOf(group.unmaskedValue) >= 0; + }); + } }; +} - MaskedPattern.prototype.extractInput = function extractInput() { - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - - // TODO fromPos === toPos - var str = this.value; - var input = ''; - - var toDefIndex = this.mapPosToDefIndex(toPos); - for (var ci = fromPos, di = this.mapPosToDefIndex(fromPos); ci < toPos && ci < str.length && di < toDefIndex; ++di) { - var ch = str[ci]; - var def = this._charDefs[di]; +PatternGroup.Range = RangeGroup; +PatternGroup.Enum = EnumGroup; - if (!def) break; - if (def.isHiddenHollow) continue; +var _class$1; - if (def.isInput && !def.isHollow) input += ch; - ++ci; - } - return input; - }; +function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; - MaskedPattern.prototype.extractInputChunks = function extractInputChunks() { - var _this4 = this; + if ('value' in desc || desc.initializer) { + desc.writable = true; + } - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); - // TODO fromPos === toPos - var fromDefIndex = this.mapPosToDefIndex(fromPos); - var toDefIndex = this.mapPosToDefIndex(toPos); - var stopDefIndices = this._charDefs.map(function (d, i) { - return [d, i]; - }).slice(fromDefIndex, toDefIndex).filter(function (_ref) { - var d = _ref[0]; - return d.stopAlign; - }).map(function (_ref2) { - var i = _ref2[1]; - return i; - }); + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } - var stops = [fromDefIndex].concat(stopDefIndices, [toDefIndex]); + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } - return stops.map(function (s, i) { - return [stopDefIndices.indexOf(s) >= 0 ? s : null, _this4.extractInput(_this4.mapDefIndexToPos(s), _this4.mapDefIndexToPos(stops[++i]))]; - }).filter(function (_ref3) { - var stop = _ref3[0], - input = _ref3[1]; - return stop != null || input; - }); - }; + return desc; +} - MaskedPattern.prototype._appendPlaceholder = function _appendPlaceholder(toDefIndex) { - var maxDefIndex = toDefIndex || this._charDefs.length; - for (var di = this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) { - var def = this._charDefs[di]; - if (def.isInput) def.isHollow = true; +var MaskedPattern = (_class$1 = function (_Masked) { + inherits(MaskedPattern, _Masked); - if (!this.placeholder.lazy || toDefIndex) { - this._value += !def.isInput ? def.char : !def.optional ? this.placeholder.char : ''; - } - } - }; + function MaskedPattern() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + classCallCheck(this, MaskedPattern); + var definitions = opts.definitions, + placeholder = opts.placeholder, + groups = opts.groups; - MaskedPattern.prototype.clear = function clear() { - var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); - this._value = this.value.slice(0, from) + this.value.slice(to); - var fromDefIndex = this.mapPosToDefIndex(from); - var toDefIndex = this.mapPosToDefIndex(to); - this._charDefs.slice(fromDefIndex, toDefIndex).forEach(function (d) { - return d.reset(); - }); - }; + delete _this.isInitialized; - MaskedPattern.prototype.nearestInputPos = function nearestInputPos(cursorPos) { - var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; + _this.placeholder = placeholder; + _this.definitions = definitions; + _this.groups = groups; - if (!direction) return cursorPos; + _this.isInitialized = true; + return _this; + } - var initialDefIndex = this.mapPosToDefIndex(cursorPos); - var di = initialDefIndex; + MaskedPattern.prototype._updateMask = function _updateMask() { + var _this2 = this; - var firstInputIndex = void 0, - firstFilledInputIndex = void 0, - firstVisibleHollowIndex = void 0, - nextdi = void 0; + var defs = this._definitions; + this._charDefs = []; + this._groupDefs = []; - // search forward - for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { - var nextDef = this._charDefs[nextdi]; - if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di; - if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di; - if (nextDef.isInput && !nextDef.isHollow) { - firstFilledInputIndex = di; - break; - } - } + var pattern = this.mask; + if (!pattern || !defs) return; - if (direction === DIRECTION.LEFT || firstInputIndex == null) { - // search backwards - direction = -direction; - var overflow = false; + var unmaskingBlock = false; + var optionalBlock = false; + var stopAlign = false; - // find hollows only before initial pos - for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { - var _nextDef = this._charDefs[nextdi]; - if (_nextDef.isInput) { - firstInputIndex = di; - if (_nextDef.isHollow && !_nextDef.isHiddenHollow) break; + var _loop = function _loop(_i) { + if (_this2._groups) { + var p = pattern.slice(_i); + var gNames = Object.keys(_this2._groups).filter(function (gName) { + return p.indexOf(gName) === 0; + }); + // order by key length + gNames.sort(function (a, b) { + return b.length - a.length; + }); + // use group name with max length + var gName = gNames[0]; + if (gName) { + var group = _this2._groups[gName]; + _this2._groupDefs.push(new PatternGroup(_this2, { + name: gName, + offset: _this2._charDefs.length, + mask: group.mask, + validate: group.validate + })); + pattern = pattern.replace(gName, group.mask); } + } - // if hollow not found before start position - set `overflow` - // and try to find just any input - if (di === initialDefIndex) overflow = true; + var char = pattern[_i]; + var type = !unmaskingBlock && char in defs ? PatternDefinition.TYPES.INPUT : PatternDefinition.TYPES.FIXED; + var unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock; + var optional = type === PatternDefinition.TYPES.INPUT && optionalBlock; - // first input found - if (overflow && firstInputIndex != null) break; + if (char === MaskedPattern.STOP_CHAR) { + stopAlign = true; + return 'continue'; } - // process overflow - overflow = overflow || nextdi >= this._charDefs.length; - if (overflow && firstInputIndex != null) di = firstInputIndex; - } else if (firstFilledInputIndex == null) { - // adjust index if delete at right and filled input not found at right - di = firstVisibleHollowIndex != null ? firstVisibleHollowIndex : firstInputIndex; - } - - return this.mapDefIndexToPos(di); - }; + if (char === '{' || char === '}') { + unmaskingBlock = !unmaskingBlock; + return 'continue'; + } - MaskedPattern.prototype.group = function group(name) { - return this.groupsByName(name)[0]; - }; + if (char === '[' || char === ']') { + optionalBlock = !optionalBlock; + return 'continue'; + } - MaskedPattern.prototype.groupsByName = function groupsByName(name) { - return this._groupDefs.filter(function (g) { - return g.name === name; - }); - }; + if (char === MaskedPattern.ESCAPE_CHAR) { + ++_i; + char = pattern[_i]; + // TODO validation + if (!char) return 'break'; + type = PatternDefinition.TYPES.FIXED; + } - createClass(MaskedPattern, [{ - key: 'placeholder', - get: function get$$1() { - return this._placeholder; - }, - set: function set$$1(ph) { - this._placeholder = _extends({}, MaskedPattern.DEFAULT_PLACEHOLDER, ph); - } - }, { - key: 'definitions', - get: function get$$1() { - return this._definitions; - }, - set: function set$$1(defs) { - defs = _extends({}, PatternDefinition.DEFAULTS, defs); + _this2._charDefs.push(new PatternDefinition({ + char: char, + type: type, + optional: optional, + stopAlign: stopAlign, + mask: unmasking && (type === PatternDefinition.TYPES.INPUT ? defs[char] : function (value) { + return value === char; + }) + })); - this._definitions = defs; - this._updateMask(); - } - }, { - key: 'mask', - get: function get$$1() { - return this._mask; - }, - set: function set$$1(mask) { - this._mask = mask; - this._updateMask(); - } - }, { - key: 'isComplete', - get: function get$$1() { - var _this5 = this; + stopAlign = false; + i = _i; + }; - return !this._charDefs.some(function (d, i) { - return d.isInput && !d.optional && (d.isHollow || !_this5.extractInput(i, i + 1)); - }); - } - }, { - key: 'groups', - get: function get$$1() { - return this._groups; - }, - set: function set$$1(groups) { - this._groups = groups; - this._updateMask(); - } - }]); - return MaskedPattern; -}(Masked), (_applyDecoratedDescriptor$1(_class$1.prototype, 'placeholder', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'placeholder'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'definitions', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'definitions'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'mask'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'groups', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'groups'), _class$1.prototype)), _class$1); -MaskedPattern.DEFAULT_PLACEHOLDER = { - lazy: true, - char: '_' -}; -MaskedPattern.STOP_CHAR = '`'; -MaskedPattern.ESCAPE_CHAR = '\\'; -MaskedPattern.Definition = PatternDefinition; -MaskedPattern.Group = PatternGroup; + _loop2: for (var i = 0; i < pattern.length; ++i) { + var _ret = _loop(i); -var _class$2; + switch (_ret) { + case 'continue': + continue; -function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; + case 'break': + break _loop2;} + } + }; - if ('value' in desc || desc.initializer) { - desc.writable = true; - } + MaskedPattern.prototype._validate = function _validate(soft) { + return this._groupDefs.every(function (g) { + return g._validate(soft); + }) && _Masked.prototype._validate.call(this, soft); + }; - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); + MaskedPattern.prototype.clone = function clone() { + var _this3 = this; - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } + var m = new MaskedPattern(this); + m._value = this.value; + m._charDefs.forEach(function (d, i) { + return _extends(d, _this3._charDefs[i]); + }); + m._groupDefs.forEach(function (d, i) { + return _extends(d, _this3._groupDefs[i]); + }); + return m; + }; - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } + MaskedPattern.prototype.reset = function reset() { + _Masked.prototype.reset.call(this); + this._charDefs.forEach(function (d) { + delete d.isHollow; + }); + }; - return desc; -} + MaskedPattern.prototype.hiddenHollowsBefore = function hiddenHollowsBefore(defIndex) { + return this._charDefs.slice(0, defIndex).filter(function (d) { + return d.isHiddenHollow; + }).length; + }; -var MaskedNumber = (_class$2 = function (_Masked) { - inherits(MaskedNumber, _Masked); + MaskedPattern.prototype.mapDefIndexToPos = function mapDefIndexToPos(defIndex) { + if (defIndex == null) return; + return defIndex - this.hiddenHollowsBefore(defIndex); + }; - function MaskedNumber() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - classCallCheck(this, MaskedNumber); + MaskedPattern.prototype.mapPosToDefIndex = function mapPosToDefIndex(pos) { + if (pos == null) return; + var defIndex = pos; + for (var di = 0; di < this._charDefs.length; ++di) { + var def = this._charDefs[di]; + if (di >= defIndex) break; + if (def.isHiddenHollow) ++defIndex; + } + return defIndex; + }; - opts = _extends({}, MaskedNumber.DEFAULTS, opts); + MaskedPattern.prototype._unmask = function _unmask() { + var str = this.value; + var unmasked = ''; - var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); + for (var ci = 0, di = 0; ci < str.length && di < this._charDefs.length; ++di) { + var ch = str[ci]; + var def = this._charDefs[di]; - delete _this.isInitialized; + if (def.isHiddenHollow) continue; + if (def.mask && !def.isHollow) unmasked += ch; + ++ci; + } - var _opts = opts, - scale = _opts.scale, - radix = _opts.radix, - mapToRadix = _opts.mapToRadix, - min = _opts.min, - max = _opts.max, - signed = _opts.signed, - thousandsSeparator = _opts.thousandsSeparator, - postFormat = _opts.postFormat; + return unmasked; + }; + MaskedPattern.prototype._appendTail = function _appendTail(tail) { + return (!tail || this._appendChunks(tail)) && this._appendPlaceholder(); + }; - _this.min = min; - _this.max = max; - _this.scale = scale; - _this.radix = radix; - _this.mapToRadix = mapToRadix; - _this.signed = signed; - _this.thousandsSeparator = thousandsSeparator; - _this.postFormat = postFormat; + MaskedPattern.prototype._append = function _append(str, soft) { + var oldValueLength = this.value.length; - _this._updateNumberRegExp(); + for (var ci = 0, di = this.mapPosToDefIndex(this.value.length); ci < str.length;) { + var ch = str[ci]; + var def = this._charDefs[di]; - _this.isInitialized = true; - return _this; - } + // check overflow + if (!def) return false; - MaskedNumber.prototype._updateNumberRegExp = function _updateNumberRegExp() { - // TODO refactor? - var regExpStrSoft = '^'; - var regExpStr = '^'; + // reset + def.isHollow = false; - if (this.signed) { - regExpStrSoft += '([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))'; - regExpStr += '[+|\\-]?'; - } else { - regExpStrSoft += '(0|([1-9]+\\d*))'; - } - regExpStr += '\\d*'; + var resolved = void 0, + skipped = void 0; + var chres = conform(def.resolve(ch), ch); - if (this.scale) { - regExpStrSoft += '(' + this.radix + '\\d{0,' + this.scale + '})?'; - regExpStr += '(' + this.radix + '\\d{0,' + this.scale + '})?'; - } + if (def.type === PatternDefinition.TYPES.INPUT) { + if (chres) { + this._value += chres; + if (!this._validate()) { + chres = ''; + this._value = this.value.slice(0, -1); + } + } - regExpStrSoft += '$'; - regExpStr += '$'; + resolved = !!chres; + skipped = !chres && !def.optional; - this._numberRegExpSoft = new RegExp(regExpStrSoft); - this._numberRegExp = new RegExp(regExpStr); - }; + // if ok - next di + if (!chres) { + if (!def.optional && !soft) { + this._value += this.placeholder.char; + skipped = false; + } + if (!skipped) def.isHollow = true; + } + } else { + this._value += def.char; + resolved = chres && (def.mask || soft); + } - MaskedNumber.prototype.extractTail = function extractTail() { - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + if (!skipped) ++di; + if (resolved || skipped) ++ci; + } - return this._removeThousandsSeparators(_Masked.prototype.extractTail.call(this, fromPos, toPos)); + return this.value.length - oldValueLength; }; - MaskedNumber.prototype._removeThousandsSeparators = function _removeThousandsSeparators(value) { - return value.replace(this._thousandsSeparatorRegExp, ''); - }; + MaskedPattern.prototype._appendChunks = function _appendChunks(chunks, soft) { + for (var ci = 0; ci < chunks.length; ++ci) { + var _chunks$ci = chunks[ci], + fromDefIndex = _chunks$ci[0], + input = _chunks$ci[1]; - MaskedNumber.prototype._insertThousandsSeparators = function _insertThousandsSeparators(value) { - // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript - var parts = value.split(this.radix); - parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator); - return parts.join(this.radix); + if (fromDefIndex != null) this._appendPlaceholder(fromDefIndex); + if (this._append(input, soft) === false) return false; + } + return true; }; - MaskedNumber.prototype._append = function _append(str, soft) { - return _Masked.prototype._append.call(this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix)), soft); + MaskedPattern.prototype.extractTail = function extractTail(fromPos, toPos) { + return this.extractInputChunks(fromPos, toPos); }; - MaskedNumber.prototype.appendWithTail = function appendWithTail(str, tail) { - var oldValueLength = this.value.length; - this._value = this._removeThousandsSeparators(this.value); - var removedSeparatorsCount = oldValueLength - this.value.length; + MaskedPattern.prototype.extractInput = function extractInput() { + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - var appended = _Masked.prototype.appendWithTail.call(this, str, tail); + // TODO fromPos === toPos + var str = this.value; + var input = ''; - this._value = this._insertThousandsSeparators(this.value); + var toDefIndex = this.mapPosToDefIndex(toPos); + for (var ci = fromPos, di = this.mapPosToDefIndex(fromPos); ci < toPos && ci < str.length && di < toDefIndex; ++di) { + var ch = str[ci]; + var def = this._charDefs[di]; - var beforeTailPos = oldValueLength + appended - removedSeparatorsCount; - this._value = this._insertThousandsSeparators(this.value); - var insertedSeparatorsBeforeTailCount = 0; - for (var pos = 0; pos <= beforeTailPos; ++pos) { - if (this.value[pos] === this.thousandsSeparator) { - ++insertedSeparatorsBeforeTailCount; - ++beforeTailPos; - } + if (!def) break; + if (def.isHiddenHollow) continue; + + if (def.isInput && !def.isHollow) input += ch; + ++ci; } - - return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount; + return input; }; - MaskedNumber.prototype.nearestInputPos = function nearestInputPos(cursorPos) { - var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; + MaskedPattern.prototype.extractInputChunks = function extractInputChunks() { + var _this4 = this; - if (!direction) return cursorPos; + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - var nextPos = indexInDirection(cursorPos, direction); - if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction; - return cursorPos; - }; + // TODO fromPos === toPos + var fromDefIndex = this.mapPosToDefIndex(fromPos); + var toDefIndex = this.mapPosToDefIndex(toPos); + var stopDefIndices = this._charDefs.map(function (d, i) { + return [d, i]; + }).slice(fromDefIndex, toDefIndex).filter(function (_ref) { + var d = _ref[0]; + return d.stopAlign; + }).map(function (_ref2) { + var i = _ref2[1]; + return i; + }); - MaskedNumber.prototype._validate = function _validate(soft) { - var regexp = soft ? this._numberRegExpSoft : this._numberRegExp; + var stops = [fromDefIndex].concat(stopDefIndices, [toDefIndex]); - // validate as string - var valid = regexp.test(this._removeThousandsSeparators(this.value)); + return stops.map(function (s, i) { + return [stopDefIndices.indexOf(s) >= 0 ? s : null, _this4.extractInput(_this4.mapDefIndexToPos(s), _this4.mapDefIndexToPos(stops[++i]))]; + }).filter(function (_ref3) { + var stop = _ref3[0], + input = _ref3[1]; + return stop != null || input; + }); + }; - if (valid) { - // validate as number - var number = this.number; - valid = valid && !isNaN(number) && ( - // check min bound for negative values - this.min == null || this.min >= 0 || this.min <= this.number) && ( - // check max bound for positive values - this.max == null || this.max <= 0 || this.number <= this.max); + MaskedPattern.prototype._appendPlaceholder = function _appendPlaceholder(toDefIndex) { + var maxDefIndex = toDefIndex || this._charDefs.length; + for (var di = this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) { + var def = this._charDefs[di]; + if (def.isInput) def.isHollow = true; + + if (!this.placeholder.lazy || toDefIndex) { + this._value += !def.isInput ? def.char : !def.optional ? this.placeholder.char : ''; + } } + }; - return valid && _Masked.prototype._validate.call(this, soft); + MaskedPattern.prototype.clear = function clear() { + var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + + this._value = this.value.slice(0, from) + this.value.slice(to); + var fromDefIndex = this.mapPosToDefIndex(from); + var toDefIndex = this.mapPosToDefIndex(to); + this._charDefs.slice(fromDefIndex, toDefIndex).forEach(function (d) { + return d.reset(); + }); }; - MaskedNumber.prototype.commit = function commit() { - var number = this.number; - var validnum = number; + MaskedPattern.prototype.nearestInputPos = function nearestInputPos(cursorPos) { + var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; - // check bounds - if (this.min != null) validnum = Math.max(validnum, this.min); - if (this.max != null) validnum = Math.min(validnum, this.max); + if (!direction) return cursorPos; - if (validnum !== number) { - this.unmaskedValue = '' + validnum; - } + var initialDefIndex = this.mapPosToDefIndex(cursorPos); + var di = initialDefIndex; - var formatted = this.value; + var firstInputIndex = void 0, + firstFilledInputIndex = void 0, + firstVisibleHollowIndex = void 0, + nextdi = void 0; - if (this.postFormat.normalizeZeros) { - formatted = this._normalizeZeros(formatted); + // search forward + for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { + var nextDef = this._charDefs[nextdi]; + if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di; + if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di; + if (nextDef.isInput && !nextDef.isHollow) { + firstFilledInputIndex = di; + break; + } } - if (this.postFormat.padFractionalZeros) { - formatted = this._padFractionalZeros(formatted); - } + if (direction === DIRECTION.LEFT || firstInputIndex == null) { + // search backwards + direction = -direction; + var overflow = false; - this._value = formatted; - }; + // find hollows only before initial pos + for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { + var _nextDef = this._charDefs[nextdi]; + if (_nextDef.isInput) { + firstInputIndex = di; + if (_nextDef.isHollow && !_nextDef.isHiddenHollow) break; + } - MaskedNumber.prototype._normalizeZeros = function _normalizeZeros(value) { - var parts = this._removeThousandsSeparators(value).split(this.radix); + // if hollow not found before start position - set `overflow` + // and try to find just any input + if (di === initialDefIndex) overflow = true; - // remove leading zeros - parts[0] = parts[0].replace(/^(\D*)(0*)(\d*)/, function (match, sign, zeros, num) { - return sign + num; - }); - // add leading zero - if (value.length && !/\d$/.test(parts[0])) parts[0] = parts[0] + '0'; + // first input found + if (overflow && firstInputIndex != null) break; + } - if (parts.length > 1) { - parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros - if (!parts[1].length) parts.length = 1; // remove fractional + // process overflow + overflow = overflow || nextdi >= this._charDefs.length; + if (overflow && firstInputIndex != null) di = firstInputIndex; + } else if (firstFilledInputIndex == null) { + // adjust index if delete at right and filled input not found at right + di = firstVisibleHollowIndex != null ? firstVisibleHollowIndex : firstInputIndex; } - return this._insertThousandsSeparators(parts.join(this.radix)); + return this.mapDefIndexToPos(di); }; - MaskedNumber.prototype._padFractionalZeros = function _padFractionalZeros(value) { - var parts = value.split(this.radix); - if (parts.length < 2) parts.push(''); - parts[1] = parts[1].padEnd(this.scale, '0'); - return parts.join(this.radix); + MaskedPattern.prototype.group = function group(name) { + return this.groupsByName(name)[0]; }; - createClass(MaskedNumber, [{ - key: 'number', - get: function get$$1() { - var numstr = this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix, '.'); + MaskedPattern.prototype.groupsByName = function groupsByName(name) { + return this._groupDefs.filter(function (g) { + return g.name === name; + }); + }; - return Number(numstr); - }, - set: function set$$1(number) { - this.unmaskedValue = '' + number; - } - }, { - key: 'min', - get: function get$$1() { - return this._min; - }, - set: function set$$1(min) { - this._min = min; - } - }, { - key: 'max', - get: function get$$1() { - return this._max; - }, - set: function set$$1(max) { - this._max = max; - } - }, { - key: 'scale', - get: function get$$1() { - return this._scale; - }, - set: function set$$1(scale) { - this._scale = scale; - } - }, { - key: 'radix', + createClass(MaskedPattern, [{ + key: 'placeholder', get: function get$$1() { - return this._radix; + return this._placeholder; }, - set: function set$$1(radix) { - this._radix = radix; - this._updateNumberRegExp(); + set: function set$$1(ph) { + this._placeholder = _extends({}, MaskedPattern.DEFAULT_PLACEHOLDER, ph); } }, { - key: 'signed', + key: 'definitions', get: function get$$1() { - return this._signed || this.min != null && this.min < 0 || this.max != null && this.max < 0; + return this._definitions; }, - set: function set$$1(signed) { - this._signed = signed; + set: function set$$1(defs) { + defs = _extends({}, PatternDefinition.DEFAULTS, defs); + + this._definitions = defs; + this._updateMask(); } }, { - key: 'postFormat', + key: 'mask', get: function get$$1() { - return this._postFormat; + return this._mask; }, - set: function set$$1(postFormat) { - this._postFormat = _extends({}, MaskedNumber.DEFAULTS.postFormat, postFormat); + set: function set$$1(mask) { + this._mask = mask; + this._updateMask(); } }, { - key: 'mapToRadix', + key: 'isComplete', get: function get$$1() { - return this._mapToRadix; - }, - set: function set$$1(mapToRadix) { - this._mapToRadix = mapToRadix; - this._mapToRadixRegExp = new RegExp('[' + mapToRadix.map(escapeRegExp).join('') + ']', 'g'); + var _this5 = this; + + return !this._charDefs.some(function (d, i) { + return d.isInput && !d.optional && (d.isHollow || !_this5.extractInput(i, i + 1)); + }); } }, { - key: 'thousandsSeparator', + key: 'groups', get: function get$$1() { - return this._thousandsSeparator; + return this._groups; }, - set: function set$$1(thousandsSeparator) { - this._thousandsSeparator = thousandsSeparator; - this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g'); + set: function set$$1(groups) { + this._groups = groups; + this._updateMask(); } }]); - return MaskedNumber; -}(Masked), (_applyDecoratedDescriptor$2(_class$2.prototype, 'min', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'min'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'max', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'max'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'scale', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'scale'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'radix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'radix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'signed', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'signed'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'postFormat', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'postFormat'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'mapToRadix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'mapToRadix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'thousandsSeparator', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'thousandsSeparator'), _class$2.prototype)), _class$2); -MaskedNumber.DEFAULTS = { - radix: ',', - thousandsSeparator: '', - mapToRadix: ['.'], - scale: 2, - postFormat: { - normalizeZeros: true - } + return MaskedPattern; +}(Masked), (_applyDecoratedDescriptor$1(_class$1.prototype, 'placeholder', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'placeholder'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'definitions', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'definitions'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'mask'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'groups', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'groups'), _class$1.prototype)), _class$1); +MaskedPattern.DEFAULT_PLACEHOLDER = { + lazy: true, + char: '_' }; +MaskedPattern.STOP_CHAR = '`'; +MaskedPattern.ESCAPE_CHAR = '\\'; +MaskedPattern.Definition = PatternDefinition; +MaskedPattern.Group = PatternGroup; var _class$3; diff --git a/dist/imask.es.js.map b/dist/imask.es.js.map index f8c08b2f..61a3e35c 100644 --- a/dist/imask.es.js.map +++ b/dist/imask.es.js.map @@ -1 +1 @@ -{"version":3,"file":"imask.es.js","sources":["../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/core/utils.js","../src/masked/base.js","../src/masked/factory.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/number.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js","../src/imask.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {isString} from '../core/utils';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof IMask.Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new IMask.Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof IMask.Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new IMask.MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new IMask.Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new IMask.Masked(opts);\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n"],"names":["isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","has","hide","global","aFunction","core","ctx","redefine","cof","defined","toInteger","uid","isArray","speciesConstructor","asc","toObject","IObject","toLength","$export","min","toIObject","toIndex","$keys","enumBugKeys","fails","repeat","$pad","isString","str","String","conform","res","fallback","DIRECTION","indexInDirection","pos","direction","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","withValueRefresh","bind","escapeRegExp","replace","Masked","mask","validate","_value","isInitialized","_validate","soft","value","clone","m","slice","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","length","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","tailAppended","_unmask","clear","from","to","fn","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","createMask","opts","babelHelpers.extends","IMask","RegExp","test","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","PatternDefinition","_masked","isHollow","resolve","type","TYPES","INPUT","optional","DEFAULTS","PatternGroup","masked","name","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","Math","max","minstr","maxstr","match","placeholder","num","firstNonZero","search","_matchFrom","padEnd","maxLength","EnumGroup","enums","group","some","e","indexOf","Range","Enum","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_groups","p","i","gNames","Object","keys","filter","gName","sort","a","b","push","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","map","stops","s","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","Definition","Group","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","split","join","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","regexp","valid","number","isNaN","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","_thousandsSeparator","format","parse","Y","getFullYear","date","isComplete","isDateExist","day","getDate","padStart","month","getMonth","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","InputMask","el","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","listeners","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange","window"],"mappings":";;;;;;AACA,IAAI,MAAM,GAAG,cAAc,GAAG,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;IAC7E,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;AAChG,GAAG,OAAO,GAAG,IAAI,QAAQ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AKD,kBADA,GAGL,KAAK9B,EAAL,CAAQ+C,YAHV;;yBAMatS,KAAK;UACd,KAAKuP,EAAL,KAAYjS,SAASiV,aAAzB,EAAwC;;WAEnChD,EAAL,CAAQiD,iBAAR,CAA0BxS,GAA1B,EAA+BA,GAA/B;WACK0P,cAAL;;;;;;ACnFJ,SAAS/L,OAAT,CAAgB4L,EAAhB,EAA6B;MAAT9L,IAAS,uEAAJ,EAAI;;;SAEpB,IAAI6L,SAAJ,CAAcC,EAAd,EAAkB9L,IAAlB,CAAP;;;AAIFE,QAAM2L,SAAN,GAAkBA,SAAlB;;AAEA3L,QAAM7C,MAAN,GAAeA,MAAf;AACA6C,QAAMG,aAAN,GAAsBA,aAAtB;AACAH,QAAMM,YAAN,GAAqBA,YAArB;AACAN,QAAMS,UAAN,GAAmBA,UAAnB;;AAEAqO,OAAO9O,KAAP,GAAeA,OAAf;;;;"} \ No newline at end of file +{"version":3,"file":"imask.es.js","sources":["../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/core/utils.js","../src/masked/base.js","../src/masked/number.js","../src/masked/factory.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js","../src/imask.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {isString} from '../core/utils';\r\nimport Masked from './base';\r\nimport MaskedNumber from './number';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new Masked(opts);\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904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0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n"],"names":["isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","has","hide","global","aFunction","core","ctx","redefine","cof","defined","toInteger","uid","isArray","speciesConstructor","asc","toObject","IObject","toLength","$export","min","toIObject","toIndex","$keys","enumBugKeys","fails","repeat","$pad","isString","str","String","conform","res","fallback","DIRECTION","indexInDirection","pos","direction","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","withValueRefresh","bind","escapeRegExp","replace","Masked","mask","validate","_value","isInitialized","_validate","soft","value","clone","m","slice","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","length","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","tailAppended","_unmask","clear","from","to","fn","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","MaskedNumber","opts","babelHelpers.extends","DEFAULTS","scale","radix","mapToRadix","max","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","RegExp","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","split","join","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","regexp","valid","test","number","isNaN","validnum","Math","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","match","sign","zeros","num","push","padEnd","numstr","Number","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","map","_thousandsSeparator","createMask","IMask","MaskedPattern","prototype","Date","pattern","MaskedDate","Function","warn","PatternDefinition","_masked","isHollow","resolve","type","TYPES","INPUT","optional","PatternGroup","masked","name","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","placeholder","firstNonZero","search","_matchFrom","maxLength","EnumGroup","enums","group","some","e","indexOf","Range","Enum","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_groups","p","i","gNames","Object","keys","filter","gName","sort","a","b","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","stops","s","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","Definition","Group","format","parse","Y","getFullYear","date","isComplete","isDateExist","day","getDate","padStart","month","getMonth","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","InputMask","el","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","listeners","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange","window"],"mappings":";;;;;;AACA,IAAI,MAAM,GAAG,cAAc,GAAG,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;IAC7E,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;AAChG,GAAG,OAAO,GAAG,IAAI,QAAQ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,kBADA,GAGL,KAAK9B,EAAL,CAAQ+C,YAHV;;yBAMatS,KAAK;UACd,KAAKuP,EAAL,KAAYjS,SAASiV,aAAzB,EAAwC;;WAEnChD,EAAL,CAAQiD,iBAAR,CAA0BxS,GAA1B,EAA+BA,GAA/B;WACK0P,cAAL;;;;;;ACnFJ,SAASxI,OAAT,CAAgBqI,EAAhB,EAA6B;MAAT9L,IAAS,uEAAJ,EAAI;;;SAEpB,IAAI6L,SAAJ,CAAcC,EAAd,EAAkB9L,IAAlB,CAAP;;;AAIFyD,QAAMoI,SAAN,GAAkBA,SAAlB;;AAEApI,QAAMpG,MAAN,GAAeA,MAAf;AACAoG,QAAMC,aAAN,GAAsBA,aAAtB;AACAD,QAAM1D,YAAN,GAAqBA,YAArB;AACA0D,QAAMK,UAAN,GAAmBA,UAAnB;;AAEAkL,OAAOvL,KAAP,GAAeA,OAAf;;;;"} \ No newline at end of file diff --git a/dist/imask.js b/dist/imask.js index 282d12d1..80b0233d 100644 --- a/dist/imask.js +++ b/dist/imask.js @@ -829,225 +829,9 @@ var Masked = (_class = function () { return Masked; }(), (_applyDecoratedDescriptor(_class.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class.prototype, 'mask'), _class.prototype)), _class); -function createMask(opts) { - opts = _extends({}, opts); // clone - - var mask = opts.mask; - - if (mask instanceof IMask.Masked) { - return mask; - } - if (mask instanceof RegExp) { - opts.validate = function (value) { - return mask.test(value); - }; - return new IMask.Masked(opts); - } - if (isString(mask)) { - return new IMask.MaskedPattern(opts); - } - if (mask.prototype instanceof IMask.Masked) { - delete opts.mask; - return new mask(opts); - } - if (mask instanceof Number || typeof mask === 'number' || mask === Number) { - delete opts.mask; - return new IMask.MaskedNumber(opts); - } - if (mask instanceof Date || mask === Date) { - delete opts.mask; - if (opts.pattern) { - opts.mask = opts.pattern; - delete opts.pattern; - } - return new IMask.MaskedDate(opts); - } - if (mask instanceof Function) { - opts.validate = mask; - return new IMask.Masked(opts); - } - - console.warn('Mask not found for', opts); // eslint-disable-line no-console - return new IMask.Masked(opts); -} - -var PatternDefinition = function () { - function PatternDefinition(opts) { - classCallCheck(this, PatternDefinition); - - _extends(this, opts); - - if (this.mask) { - this._masked = createMask(opts); - } - } - - PatternDefinition.prototype.reset = function reset() { - this.isHollow = false; - if (this._masked) this._masked.reset(); - }; - - PatternDefinition.prototype.resolve = function resolve(ch) { - if (!this._masked) return false; - // TODO seems strange - this._masked.value = ch; - return this._masked.value; - }; - - createClass(PatternDefinition, [{ - key: 'isInput', - get: function get$$1() { - return this.type === PatternDefinition.TYPES.INPUT; - } - }, { - key: 'isHiddenHollow', - get: function get$$1() { - return this.isHollow && this.optional; - } - }]); - return PatternDefinition; -}(); - -PatternDefinition.DEFAULTS = { - '0': /\d/, - 'a': /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // http://stackoverflow.com/a/22075070 - '*': /./ -}; -PatternDefinition.TYPES = { - INPUT: 'input', - FIXED: 'fixed' -}; - -var PatternGroup = function () { - function PatternGroup(masked, _ref) { - var name = _ref.name, - offset = _ref.offset, - mask = _ref.mask, - validate = _ref.validate; - classCallCheck(this, PatternGroup); - - this.masked = masked; - this.name = name; - this.offset = offset; - this.mask = mask; - this.validate = validate || function () { - return true; - }; - } - - PatternGroup.prototype._validate = function _validate(soft) { - return this.validate(this.value, this, soft); - }; - - createClass(PatternGroup, [{ - key: 'value', - get: function get$$1() { - return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); - } - }, { - key: 'unmaskedValue', - get: function get$$1() { - return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); - } - }]); - return PatternGroup; -}(); - -var RangeGroup = function () { - function RangeGroup(_ref2) { - var from = _ref2[0], - to = _ref2[1]; - var maxlen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (to + '').length; - classCallCheck(this, RangeGroup); - - this._from = from; - this._to = to; - this._maxLength = maxlen; - this.validate = this.validate.bind(this); - - this._update(); - } - - RangeGroup.prototype._update = function _update() { - this._maxLength = Math.max(this._maxLength, (this.to + '').length); - this.mask = '0'.repeat(this._maxLength); - }; - - RangeGroup.prototype.validate = function validate(str) { - var minstr = ''; - var maxstr = ''; - - var _str$match = str.match(/^(\D*)(\d*)(\D*)/), - placeholder = _str$match[1], - num = _str$match[2]; - - if (num) { - minstr = '0'.repeat(placeholder.length) + num; - maxstr = '9'.repeat(placeholder.length) + num; - } - - var firstNonZero = str.search(/[^0]/); - if (firstNonZero === -1 && str.length <= this._matchFrom) return true; - - minstr = minstr.padEnd(this._maxLength, '0'); - maxstr = maxstr.padEnd(this._maxLength, '9'); - - return this.from <= Number(maxstr) && Number(minstr) <= this.to; - }; - - createClass(RangeGroup, [{ - key: 'to', - get: function get$$1() { - return this._to; - }, - set: function set$$1(to) { - this._to = to; - this._update(); - } - }, { - key: 'from', - get: function get$$1() { - return this._from; - }, - set: function set$$1(from) { - this._from = from; - this._update(); - } - }, { - key: 'maxLength', - get: function get$$1() { - return this._maxLength; - }, - set: function set$$1(maxLength) { - this._maxLength = maxLength; - this._update(); - } - }, { - key: '_matchFrom', - get: function get$$1() { - return this.maxLength - (this.from + '').length; - } - }]); - return RangeGroup; -}(); - -function EnumGroup(enums) { - return { - mask: '*'.repeat(enums[0].length), - validate: function validate(value, group) { - return enums.some(function (e) { - return e.indexOf(group.unmaskedValue) >= 0; - }); - } - }; -} - -PatternGroup.Range = RangeGroup; -PatternGroup.Enum = EnumGroup; - -var _class$1; +var _class$2; -function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) { +function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; @@ -1076,761 +860,977 @@ function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, c return desc; } -var MaskedPattern = (_class$1 = function (_Masked) { - inherits(MaskedPattern, _Masked); +var MaskedNumber = (_class$2 = function (_Masked) { + inherits(MaskedNumber, _Masked); - function MaskedPattern() { + function MaskedNumber() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - classCallCheck(this, MaskedPattern); - var definitions = opts.definitions, - placeholder = opts.placeholder, - groups = opts.groups; + classCallCheck(this, MaskedNumber); + + opts = _extends({}, MaskedNumber.DEFAULTS, opts); var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); delete _this.isInitialized; - _this.placeholder = placeholder; - _this.definitions = definitions; - _this.groups = groups; + var _opts = opts, + scale = _opts.scale, + radix = _opts.radix, + mapToRadix = _opts.mapToRadix, + min = _opts.min, + max = _opts.max, + signed = _opts.signed, + thousandsSeparator = _opts.thousandsSeparator, + postFormat = _opts.postFormat; + + + _this.min = min; + _this.max = max; + _this.scale = scale; + _this.radix = radix; + _this.mapToRadix = mapToRadix; + _this.signed = signed; + _this.thousandsSeparator = thousandsSeparator; + _this.postFormat = postFormat; + + _this._updateNumberRegExp(); _this.isInitialized = true; return _this; } - MaskedPattern.prototype._updateMask = function _updateMask() { - var _this2 = this; - - var defs = this._definitions; - this._charDefs = []; - this._groupDefs = []; + MaskedNumber.prototype._updateNumberRegExp = function _updateNumberRegExp() { + // TODO refactor? + var regExpStrSoft = '^'; + var regExpStr = '^'; - var pattern = this.mask; - if (!pattern || !defs) return; + if (this.signed) { + regExpStrSoft += '([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))'; + regExpStr += '[+|\\-]?'; + } else { + regExpStrSoft += '(0|([1-9]+\\d*))'; + } + regExpStr += '\\d*'; - var unmaskingBlock = false; - var optionalBlock = false; - var stopAlign = false; + if (this.scale) { + regExpStrSoft += '(' + this.radix + '\\d{0,' + this.scale + '})?'; + regExpStr += '(' + this.radix + '\\d{0,' + this.scale + '})?'; + } - var _loop = function _loop(_i) { - if (_this2._groups) { - var p = pattern.slice(_i); - var gNames = Object.keys(_this2._groups).filter(function (gName) { - return p.indexOf(gName) === 0; - }); - // order by key length - gNames.sort(function (a, b) { - return b.length - a.length; - }); - // use group name with max length - var gName = gNames[0]; - if (gName) { - var group = _this2._groups[gName]; - _this2._groupDefs.push(new PatternGroup(_this2, { - name: gName, - offset: _this2._charDefs.length, - mask: group.mask, - validate: group.validate - })); - pattern = pattern.replace(gName, group.mask); - } - } + regExpStrSoft += '$'; + regExpStr += '$'; - var char = pattern[_i]; - var type = !unmaskingBlock && char in defs ? PatternDefinition.TYPES.INPUT : PatternDefinition.TYPES.FIXED; - var unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock; - var optional = type === PatternDefinition.TYPES.INPUT && optionalBlock; + this._numberRegExpSoft = new RegExp(regExpStrSoft); + this._numberRegExp = new RegExp(regExpStr); + }; - if (char === MaskedPattern.STOP_CHAR) { - stopAlign = true; - return 'continue'; - } + MaskedNumber.prototype.extractTail = function extractTail() { + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - if (char === '{' || char === '}') { - unmaskingBlock = !unmaskingBlock; - return 'continue'; - } + return this._removeThousandsSeparators(_Masked.prototype.extractTail.call(this, fromPos, toPos)); + }; - if (char === '[' || char === ']') { - optionalBlock = !optionalBlock; - return 'continue'; - } + MaskedNumber.prototype._removeThousandsSeparators = function _removeThousandsSeparators(value) { + return value.replace(this._thousandsSeparatorRegExp, ''); + }; - if (char === MaskedPattern.ESCAPE_CHAR) { - ++_i; - char = pattern[_i]; - // TODO validation - if (!char) return 'break'; - type = PatternDefinition.TYPES.FIXED; - } + MaskedNumber.prototype._insertThousandsSeparators = function _insertThousandsSeparators(value) { + // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript + var parts = value.split(this.radix); + parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator); + return parts.join(this.radix); + }; - _this2._charDefs.push(new PatternDefinition({ - char: char, - type: type, - optional: optional, - stopAlign: stopAlign, - mask: unmasking && (type === PatternDefinition.TYPES.INPUT ? defs[char] : function (value) { - return value === char; - }) - })); + MaskedNumber.prototype._append = function _append(str, soft) { + return _Masked.prototype._append.call(this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix)), soft); + }; - stopAlign = false; - i = _i; - }; + MaskedNumber.prototype.appendWithTail = function appendWithTail(str, tail) { + var oldValueLength = this.value.length; + this._value = this._removeThousandsSeparators(this.value); + var removedSeparatorsCount = oldValueLength - this.value.length; - _loop2: for (var i = 0; i < pattern.length; ++i) { - var _ret = _loop(i); + var appended = _Masked.prototype.appendWithTail.call(this, str, tail); - switch (_ret) { - case 'continue': - continue; + this._value = this._insertThousandsSeparators(this.value); - case 'break': - break _loop2;} + var beforeTailPos = oldValueLength + appended - removedSeparatorsCount; + this._value = this._insertThousandsSeparators(this.value); + var insertedSeparatorsBeforeTailCount = 0; + for (var pos = 0; pos <= beforeTailPos; ++pos) { + if (this.value[pos] === this.thousandsSeparator) { + ++insertedSeparatorsBeforeTailCount; + ++beforeTailPos; + } } - }; - MaskedPattern.prototype._validate = function _validate(soft) { - return this._groupDefs.every(function (g) { - return g._validate(soft); - }) && _Masked.prototype._validate.call(this, soft); + return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount; }; - MaskedPattern.prototype.clone = function clone() { - var _this3 = this; + MaskedNumber.prototype.nearestInputPos = function nearestInputPos(cursorPos) { + var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; - var m = new MaskedPattern(this); - m._value = this.value; - m._charDefs.forEach(function (d, i) { - return _extends(d, _this3._charDefs[i]); - }); - m._groupDefs.forEach(function (d, i) { - return _extends(d, _this3._groupDefs[i]); - }); - return m; - }; + if (!direction) return cursorPos; - MaskedPattern.prototype.reset = function reset() { - _Masked.prototype.reset.call(this); - this._charDefs.forEach(function (d) { - delete d.isHollow; - }); + var nextPos = indexInDirection(cursorPos, direction); + if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction; + return cursorPos; }; - MaskedPattern.prototype.hiddenHollowsBefore = function hiddenHollowsBefore(defIndex) { - return this._charDefs.slice(0, defIndex).filter(function (d) { - return d.isHiddenHollow; - }).length; - }; + MaskedNumber.prototype._validate = function _validate(soft) { + var regexp = soft ? this._numberRegExpSoft : this._numberRegExp; - MaskedPattern.prototype.mapDefIndexToPos = function mapDefIndexToPos(defIndex) { - if (defIndex == null) return; - return defIndex - this.hiddenHollowsBefore(defIndex); - }; + // validate as string + var valid = regexp.test(this._removeThousandsSeparators(this.value)); - MaskedPattern.prototype.mapPosToDefIndex = function mapPosToDefIndex(pos) { - if (pos == null) return; - var defIndex = pos; - for (var di = 0; di < this._charDefs.length; ++di) { - var def = this._charDefs[di]; - if (di >= defIndex) break; - if (def.isHiddenHollow) ++defIndex; + if (valid) { + // validate as number + var number = this.number; + valid = valid && !isNaN(number) && ( + // check min bound for negative values + this.min == null || this.min >= 0 || this.min <= this.number) && ( + // check max bound for positive values + this.max == null || this.max <= 0 || this.number <= this.max); } - return defIndex; + + return valid && _Masked.prototype._validate.call(this, soft); }; - MaskedPattern.prototype._unmask = function _unmask() { - var str = this.value; - var unmasked = ''; + MaskedNumber.prototype.commit = function commit() { + var number = this.number; + var validnum = number; - for (var ci = 0, di = 0; ci < str.length && di < this._charDefs.length; ++di) { - var ch = str[ci]; - var def = this._charDefs[di]; + // check bounds + if (this.min != null) validnum = Math.max(validnum, this.min); + if (this.max != null) validnum = Math.min(validnum, this.max); - if (def.isHiddenHollow) continue; - if (def.mask && !def.isHollow) unmasked += ch; - ++ci; + if (validnum !== number) { + this.unmaskedValue = '' + validnum; } - return unmasked; - }; + var formatted = this.value; - MaskedPattern.prototype._appendTail = function _appendTail(tail) { - return (!tail || this._appendChunks(tail)) && this._appendPlaceholder(); - }; + if (this.postFormat.normalizeZeros) { + formatted = this._normalizeZeros(formatted); + } - MaskedPattern.prototype._append = function _append(str, soft) { - var oldValueLength = this.value.length; + if (this.postFormat.padFractionalZeros) { + formatted = this._padFractionalZeros(formatted); + } - for (var ci = 0, di = this.mapPosToDefIndex(this.value.length); ci < str.length;) { - var ch = str[ci]; - var def = this._charDefs[di]; + this._value = formatted; + }; - // check overflow - if (!def) return false; + MaskedNumber.prototype._normalizeZeros = function _normalizeZeros(value) { + var parts = this._removeThousandsSeparators(value).split(this.radix); - // reset - def.isHollow = false; + // remove leading zeros + parts[0] = parts[0].replace(/^(\D*)(0*)(\d*)/, function (match, sign, zeros, num) { + return sign + num; + }); + // add leading zero + if (value.length && !/\d$/.test(parts[0])) parts[0] = parts[0] + '0'; - var resolved = void 0, - skipped = void 0; - var chres = conform(def.resolve(ch), ch); + if (parts.length > 1) { + parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros + if (!parts[1].length) parts.length = 1; // remove fractional + } - if (def.type === PatternDefinition.TYPES.INPUT) { - if (chres) { - this._value += chres; - if (!this._validate()) { - chres = ''; - this._value = this.value.slice(0, -1); - } - } + return this._insertThousandsSeparators(parts.join(this.radix)); + }; - resolved = !!chres; - skipped = !chres && !def.optional; + MaskedNumber.prototype._padFractionalZeros = function _padFractionalZeros(value) { + var parts = value.split(this.radix); + if (parts.length < 2) parts.push(''); + parts[1] = parts[1].padEnd(this.scale, '0'); + return parts.join(this.radix); + }; - // if ok - next di - if (!chres) { - if (!def.optional && !soft) { - this._value += this.placeholder.char; - skipped = false; - } - if (!skipped) def.isHollow = true; - } - } else { - this._value += def.char; - resolved = chres && (def.mask || soft); - } + createClass(MaskedNumber, [{ + key: 'number', + get: function get$$1() { + var numstr = this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix, '.'); - if (!skipped) ++di; - if (resolved || skipped) ++ci; + return Number(numstr); + }, + set: function set$$1(number) { + this.unmaskedValue = '' + number; + } + }, { + key: 'min', + get: function get$$1() { + return this._min; + }, + set: function set$$1(min) { + this._min = min; + } + }, { + key: 'max', + get: function get$$1() { + return this._max; + }, + set: function set$$1(max) { + this._max = max; + } + }, { + key: 'scale', + get: function get$$1() { + return this._scale; + }, + set: function set$$1(scale) { + this._scale = scale; + } + }, { + key: 'radix', + get: function get$$1() { + return this._radix; + }, + set: function set$$1(radix) { + this._radix = radix; + this._updateNumberRegExp(); + } + }, { + key: 'signed', + get: function get$$1() { + return this._signed || this.min != null && this.min < 0 || this.max != null && this.max < 0; + }, + set: function set$$1(signed) { + this._signed = signed; + } + }, { + key: 'postFormat', + get: function get$$1() { + return this._postFormat; + }, + set: function set$$1(postFormat) { + this._postFormat = _extends({}, MaskedNumber.DEFAULTS.postFormat, postFormat); + } + }, { + key: 'mapToRadix', + get: function get$$1() { + return this._mapToRadix; + }, + set: function set$$1(mapToRadix) { + this._mapToRadix = mapToRadix; + this._mapToRadixRegExp = new RegExp('[' + mapToRadix.map(escapeRegExp).join('') + ']', 'g'); + } + }, { + key: 'thousandsSeparator', + get: function get$$1() { + return this._thousandsSeparator; + }, + set: function set$$1(thousandsSeparator) { + this._thousandsSeparator = thousandsSeparator; + this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g'); } + }]); + return MaskedNumber; +}(Masked), (_applyDecoratedDescriptor$2(_class$2.prototype, 'min', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'min'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'max', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'max'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'scale', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'scale'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'radix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'radix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'signed', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'signed'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'postFormat', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'postFormat'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'mapToRadix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'mapToRadix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'thousandsSeparator', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'thousandsSeparator'), _class$2.prototype)), _class$2); +MaskedNumber.DEFAULTS = { + radix: ',', + thousandsSeparator: '', + mapToRadix: ['.'], + scale: 2, + postFormat: { + normalizeZeros: true + } +}; - return this.value.length - oldValueLength; +function createMask(opts) { + opts = _extends({}, opts); // clone + + var mask = opts.mask; + + if (mask instanceof Masked) { + return mask; + } + if (mask instanceof RegExp) { + opts.validate = function (value) { + return mask.test(value); + }; + return new Masked(opts); + } + if (isString(mask)) { + return new IMask.MaskedPattern(opts); + } + if (mask.prototype instanceof Masked) { + delete opts.mask; + return new mask(opts); + } + if (mask instanceof Number || typeof mask === 'number' || mask === Number) { + delete opts.mask; + return new MaskedNumber(opts); + } + if (mask instanceof Date || mask === Date) { + delete opts.mask; + if (opts.pattern) { + opts.mask = opts.pattern; + delete opts.pattern; + } + return new IMask.MaskedDate(opts); + } + if (mask instanceof Function) { + opts.validate = mask; + return new Masked(opts); + } + + console.warn('Mask not found for', opts); // eslint-disable-line no-console + return new Masked(opts); +} + +var PatternDefinition = function () { + function PatternDefinition(opts) { + classCallCheck(this, PatternDefinition); + + _extends(this, opts); + + if (this.mask) { + this._masked = createMask(opts); + } + } + + PatternDefinition.prototype.reset = function reset() { + this.isHollow = false; + if (this._masked) this._masked.reset(); }; - MaskedPattern.prototype._appendChunks = function _appendChunks(chunks, soft) { - for (var ci = 0; ci < chunks.length; ++ci) { - var _chunks$ci = chunks[ci], - fromDefIndex = _chunks$ci[0], - input = _chunks$ci[1]; + PatternDefinition.prototype.resolve = function resolve(ch) { + if (!this._masked) return false; + // TODO seems strange + this._masked.value = ch; + return this._masked.value; + }; - if (fromDefIndex != null) this._appendPlaceholder(fromDefIndex); - if (this._append(input, soft) === false) return false; + createClass(PatternDefinition, [{ + key: 'isInput', + get: function get$$1() { + return this.type === PatternDefinition.TYPES.INPUT; } - return true; + }, { + key: 'isHiddenHollow', + get: function get$$1() { + return this.isHollow && this.optional; + } + }]); + return PatternDefinition; +}(); + +PatternDefinition.DEFAULTS = { + '0': /\d/, + 'a': /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // http://stackoverflow.com/a/22075070 + '*': /./ +}; +PatternDefinition.TYPES = { + INPUT: 'input', + FIXED: 'fixed' +}; + +var PatternGroup = function () { + function PatternGroup(masked, _ref) { + var name = _ref.name, + offset = _ref.offset, + mask = _ref.mask, + validate = _ref.validate; + classCallCheck(this, PatternGroup); + + this.masked = masked; + this.name = name; + this.offset = offset; + this.mask = mask; + this.validate = validate || function () { + return true; + }; + } + + PatternGroup.prototype._validate = function _validate(soft) { + return this.validate(this.value, this, soft); }; - MaskedPattern.prototype.extractTail = function extractTail(fromPos, toPos) { - return this.extractInputChunks(fromPos, toPos); + createClass(PatternGroup, [{ + key: 'value', + get: function get$$1() { + return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); + } + }, { + key: 'unmaskedValue', + get: function get$$1() { + return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset), this.masked.mapDefIndexToPos(this.offset + this.mask.length)); + } + }]); + return PatternGroup; +}(); + +var RangeGroup = function () { + function RangeGroup(_ref2) { + var from = _ref2[0], + to = _ref2[1]; + var maxlen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (to + '').length; + classCallCheck(this, RangeGroup); + + this._from = from; + this._to = to; + this._maxLength = maxlen; + this.validate = this.validate.bind(this); + + this._update(); + } + + RangeGroup.prototype._update = function _update() { + this._maxLength = Math.max(this._maxLength, (this.to + '').length); + this.mask = '0'.repeat(this._maxLength); + }; + + RangeGroup.prototype.validate = function validate(str) { + var minstr = ''; + var maxstr = ''; + + var _str$match = str.match(/^(\D*)(\d*)(\D*)/), + placeholder = _str$match[1], + num = _str$match[2]; + + if (num) { + minstr = '0'.repeat(placeholder.length) + num; + maxstr = '9'.repeat(placeholder.length) + num; + } + + var firstNonZero = str.search(/[^0]/); + if (firstNonZero === -1 && str.length <= this._matchFrom) return true; + + minstr = minstr.padEnd(this._maxLength, '0'); + maxstr = maxstr.padEnd(this._maxLength, '9'); + + return this.from <= Number(maxstr) && Number(minstr) <= this.to; + }; + + createClass(RangeGroup, [{ + key: 'to', + get: function get$$1() { + return this._to; + }, + set: function set$$1(to) { + this._to = to; + this._update(); + } + }, { + key: 'from', + get: function get$$1() { + return this._from; + }, + set: function set$$1(from) { + this._from = from; + this._update(); + } + }, { + key: 'maxLength', + get: function get$$1() { + return this._maxLength; + }, + set: function set$$1(maxLength) { + this._maxLength = maxLength; + this._update(); + } + }, { + key: '_matchFrom', + get: function get$$1() { + return this.maxLength - (this.from + '').length; + } + }]); + return RangeGroup; +}(); + +function EnumGroup(enums) { + return { + mask: '*'.repeat(enums[0].length), + validate: function validate(value, group) { + return enums.some(function (e) { + return e.indexOf(group.unmaskedValue) >= 0; + }); + } }; +} - MaskedPattern.prototype.extractInput = function extractInput() { - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - - // TODO fromPos === toPos - var str = this.value; - var input = ''; - - var toDefIndex = this.mapPosToDefIndex(toPos); - for (var ci = fromPos, di = this.mapPosToDefIndex(fromPos); ci < toPos && ci < str.length && di < toDefIndex; ++di) { - var ch = str[ci]; - var def = this._charDefs[di]; +PatternGroup.Range = RangeGroup; +PatternGroup.Enum = EnumGroup; - if (!def) break; - if (def.isHiddenHollow) continue; +var _class$1; - if (def.isInput && !def.isHollow) input += ch; - ++ci; - } - return input; - }; +function _applyDecoratedDescriptor$1(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; - MaskedPattern.prototype.extractInputChunks = function extractInputChunks() { - var _this4 = this; + if ('value' in desc || desc.initializer) { + desc.writable = true; + } - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); - // TODO fromPos === toPos - var fromDefIndex = this.mapPosToDefIndex(fromPos); - var toDefIndex = this.mapPosToDefIndex(toPos); - var stopDefIndices = this._charDefs.map(function (d, i) { - return [d, i]; - }).slice(fromDefIndex, toDefIndex).filter(function (_ref) { - var d = _ref[0]; - return d.stopAlign; - }).map(function (_ref2) { - var i = _ref2[1]; - return i; - }); + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } - var stops = [fromDefIndex].concat(stopDefIndices, [toDefIndex]); + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } - return stops.map(function (s, i) { - return [stopDefIndices.indexOf(s) >= 0 ? s : null, _this4.extractInput(_this4.mapDefIndexToPos(s), _this4.mapDefIndexToPos(stops[++i]))]; - }).filter(function (_ref3) { - var stop = _ref3[0], - input = _ref3[1]; - return stop != null || input; - }); - }; + return desc; +} - MaskedPattern.prototype._appendPlaceholder = function _appendPlaceholder(toDefIndex) { - var maxDefIndex = toDefIndex || this._charDefs.length; - for (var di = this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) { - var def = this._charDefs[di]; - if (def.isInput) def.isHollow = true; +var MaskedPattern = (_class$1 = function (_Masked) { + inherits(MaskedPattern, _Masked); - if (!this.placeholder.lazy || toDefIndex) { - this._value += !def.isInput ? def.char : !def.optional ? this.placeholder.char : ''; - } - } - }; + function MaskedPattern() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + classCallCheck(this, MaskedPattern); + var definitions = opts.definitions, + placeholder = opts.placeholder, + groups = opts.groups; - MaskedPattern.prototype.clear = function clear() { - var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); - this._value = this.value.slice(0, from) + this.value.slice(to); - var fromDefIndex = this.mapPosToDefIndex(from); - var toDefIndex = this.mapPosToDefIndex(to); - this._charDefs.slice(fromDefIndex, toDefIndex).forEach(function (d) { - return d.reset(); - }); - }; + delete _this.isInitialized; - MaskedPattern.prototype.nearestInputPos = function nearestInputPos(cursorPos) { - var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; + _this.placeholder = placeholder; + _this.definitions = definitions; + _this.groups = groups; - if (!direction) return cursorPos; + _this.isInitialized = true; + return _this; + } - var initialDefIndex = this.mapPosToDefIndex(cursorPos); - var di = initialDefIndex; + MaskedPattern.prototype._updateMask = function _updateMask() { + var _this2 = this; - var firstInputIndex = void 0, - firstFilledInputIndex = void 0, - firstVisibleHollowIndex = void 0, - nextdi = void 0; + var defs = this._definitions; + this._charDefs = []; + this._groupDefs = []; - // search forward - for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { - var nextDef = this._charDefs[nextdi]; - if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di; - if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di; - if (nextDef.isInput && !nextDef.isHollow) { - firstFilledInputIndex = di; - break; - } - } + var pattern = this.mask; + if (!pattern || !defs) return; - if (direction === DIRECTION.LEFT || firstInputIndex == null) { - // search backwards - direction = -direction; - var overflow = false; + var unmaskingBlock = false; + var optionalBlock = false; + var stopAlign = false; - // find hollows only before initial pos - for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { - var _nextDef = this._charDefs[nextdi]; - if (_nextDef.isInput) { - firstInputIndex = di; - if (_nextDef.isHollow && !_nextDef.isHiddenHollow) break; + var _loop = function _loop(_i) { + if (_this2._groups) { + var p = pattern.slice(_i); + var gNames = Object.keys(_this2._groups).filter(function (gName) { + return p.indexOf(gName) === 0; + }); + // order by key length + gNames.sort(function (a, b) { + return b.length - a.length; + }); + // use group name with max length + var gName = gNames[0]; + if (gName) { + var group = _this2._groups[gName]; + _this2._groupDefs.push(new PatternGroup(_this2, { + name: gName, + offset: _this2._charDefs.length, + mask: group.mask, + validate: group.validate + })); + pattern = pattern.replace(gName, group.mask); } + } - // if hollow not found before start position - set `overflow` - // and try to find just any input - if (di === initialDefIndex) overflow = true; + var char = pattern[_i]; + var type = !unmaskingBlock && char in defs ? PatternDefinition.TYPES.INPUT : PatternDefinition.TYPES.FIXED; + var unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock; + var optional = type === PatternDefinition.TYPES.INPUT && optionalBlock; - // first input found - if (overflow && firstInputIndex != null) break; + if (char === MaskedPattern.STOP_CHAR) { + stopAlign = true; + return 'continue'; } - // process overflow - overflow = overflow || nextdi >= this._charDefs.length; - if (overflow && firstInputIndex != null) di = firstInputIndex; - } else if (firstFilledInputIndex == null) { - // adjust index if delete at right and filled input not found at right - di = firstVisibleHollowIndex != null ? firstVisibleHollowIndex : firstInputIndex; - } - - return this.mapDefIndexToPos(di); - }; + if (char === '{' || char === '}') { + unmaskingBlock = !unmaskingBlock; + return 'continue'; + } - MaskedPattern.prototype.group = function group(name) { - return this.groupsByName(name)[0]; - }; + if (char === '[' || char === ']') { + optionalBlock = !optionalBlock; + return 'continue'; + } - MaskedPattern.prototype.groupsByName = function groupsByName(name) { - return this._groupDefs.filter(function (g) { - return g.name === name; - }); - }; + if (char === MaskedPattern.ESCAPE_CHAR) { + ++_i; + char = pattern[_i]; + // TODO validation + if (!char) return 'break'; + type = PatternDefinition.TYPES.FIXED; + } - createClass(MaskedPattern, [{ - key: 'placeholder', - get: function get$$1() { - return this._placeholder; - }, - set: function set$$1(ph) { - this._placeholder = _extends({}, MaskedPattern.DEFAULT_PLACEHOLDER, ph); - } - }, { - key: 'definitions', - get: function get$$1() { - return this._definitions; - }, - set: function set$$1(defs) { - defs = _extends({}, PatternDefinition.DEFAULTS, defs); + _this2._charDefs.push(new PatternDefinition({ + char: char, + type: type, + optional: optional, + stopAlign: stopAlign, + mask: unmasking && (type === PatternDefinition.TYPES.INPUT ? defs[char] : function (value) { + return value === char; + }) + })); - this._definitions = defs; - this._updateMask(); - } - }, { - key: 'mask', - get: function get$$1() { - return this._mask; - }, - set: function set$$1(mask) { - this._mask = mask; - this._updateMask(); - } - }, { - key: 'isComplete', - get: function get$$1() { - var _this5 = this; + stopAlign = false; + i = _i; + }; - return !this._charDefs.some(function (d, i) { - return d.isInput && !d.optional && (d.isHollow || !_this5.extractInput(i, i + 1)); - }); - } - }, { - key: 'groups', - get: function get$$1() { - return this._groups; - }, - set: function set$$1(groups) { - this._groups = groups; - this._updateMask(); - } - }]); - return MaskedPattern; -}(Masked), (_applyDecoratedDescriptor$1(_class$1.prototype, 'placeholder', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'placeholder'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'definitions', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'definitions'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'mask'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'groups', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'groups'), _class$1.prototype)), _class$1); -MaskedPattern.DEFAULT_PLACEHOLDER = { - lazy: true, - char: '_' -}; -MaskedPattern.STOP_CHAR = '`'; -MaskedPattern.ESCAPE_CHAR = '\\'; -MaskedPattern.Definition = PatternDefinition; -MaskedPattern.Group = PatternGroup; + _loop2: for (var i = 0; i < pattern.length; ++i) { + var _ret = _loop(i); -var _class$2; + switch (_ret) { + case 'continue': + continue; -function _applyDecoratedDescriptor$2(target, property, decorators, descriptor, context) { - var desc = {}; - Object['ke' + 'ys'](descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; + case 'break': + break _loop2;} + } + }; - if ('value' in desc || desc.initializer) { - desc.writable = true; - } + MaskedPattern.prototype._validate = function _validate(soft) { + return this._groupDefs.every(function (g) { + return g._validate(soft); + }) && _Masked.prototype._validate.call(this, soft); + }; - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); + MaskedPattern.prototype.clone = function clone() { + var _this3 = this; - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } + var m = new MaskedPattern(this); + m._value = this.value; + m._charDefs.forEach(function (d, i) { + return _extends(d, _this3._charDefs[i]); + }); + m._groupDefs.forEach(function (d, i) { + return _extends(d, _this3._groupDefs[i]); + }); + return m; + }; - if (desc.initializer === void 0) { - Object['define' + 'Property'](target, property, desc); - desc = null; - } + MaskedPattern.prototype.reset = function reset() { + _Masked.prototype.reset.call(this); + this._charDefs.forEach(function (d) { + delete d.isHollow; + }); + }; - return desc; -} + MaskedPattern.prototype.hiddenHollowsBefore = function hiddenHollowsBefore(defIndex) { + return this._charDefs.slice(0, defIndex).filter(function (d) { + return d.isHiddenHollow; + }).length; + }; -var MaskedNumber = (_class$2 = function (_Masked) { - inherits(MaskedNumber, _Masked); + MaskedPattern.prototype.mapDefIndexToPos = function mapDefIndexToPos(defIndex) { + if (defIndex == null) return; + return defIndex - this.hiddenHollowsBefore(defIndex); + }; - function MaskedNumber() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - classCallCheck(this, MaskedNumber); + MaskedPattern.prototype.mapPosToDefIndex = function mapPosToDefIndex(pos) { + if (pos == null) return; + var defIndex = pos; + for (var di = 0; di < this._charDefs.length; ++di) { + var def = this._charDefs[di]; + if (di >= defIndex) break; + if (def.isHiddenHollow) ++defIndex; + } + return defIndex; + }; - opts = _extends({}, MaskedNumber.DEFAULTS, opts); + MaskedPattern.prototype._unmask = function _unmask() { + var str = this.value; + var unmasked = ''; - var _this = possibleConstructorReturn(this, _Masked.call(this, opts)); + for (var ci = 0, di = 0; ci < str.length && di < this._charDefs.length; ++di) { + var ch = str[ci]; + var def = this._charDefs[di]; - delete _this.isInitialized; + if (def.isHiddenHollow) continue; + if (def.mask && !def.isHollow) unmasked += ch; + ++ci; + } - var _opts = opts, - scale = _opts.scale, - radix = _opts.radix, - mapToRadix = _opts.mapToRadix, - min = _opts.min, - max = _opts.max, - signed = _opts.signed, - thousandsSeparator = _opts.thousandsSeparator, - postFormat = _opts.postFormat; + return unmasked; + }; + MaskedPattern.prototype._appendTail = function _appendTail(tail) { + return (!tail || this._appendChunks(tail)) && this._appendPlaceholder(); + }; - _this.min = min; - _this.max = max; - _this.scale = scale; - _this.radix = radix; - _this.mapToRadix = mapToRadix; - _this.signed = signed; - _this.thousandsSeparator = thousandsSeparator; - _this.postFormat = postFormat; + MaskedPattern.prototype._append = function _append(str, soft) { + var oldValueLength = this.value.length; - _this._updateNumberRegExp(); + for (var ci = 0, di = this.mapPosToDefIndex(this.value.length); ci < str.length;) { + var ch = str[ci]; + var def = this._charDefs[di]; - _this.isInitialized = true; - return _this; - } + // check overflow + if (!def) return false; - MaskedNumber.prototype._updateNumberRegExp = function _updateNumberRegExp() { - // TODO refactor? - var regExpStrSoft = '^'; - var regExpStr = '^'; + // reset + def.isHollow = false; - if (this.signed) { - regExpStrSoft += '([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))'; - regExpStr += '[+|\\-]?'; - } else { - regExpStrSoft += '(0|([1-9]+\\d*))'; - } - regExpStr += '\\d*'; + var resolved = void 0, + skipped = void 0; + var chres = conform(def.resolve(ch), ch); - if (this.scale) { - regExpStrSoft += '(' + this.radix + '\\d{0,' + this.scale + '})?'; - regExpStr += '(' + this.radix + '\\d{0,' + this.scale + '})?'; - } + if (def.type === PatternDefinition.TYPES.INPUT) { + if (chres) { + this._value += chres; + if (!this._validate()) { + chres = ''; + this._value = this.value.slice(0, -1); + } + } - regExpStrSoft += '$'; - regExpStr += '$'; + resolved = !!chres; + skipped = !chres && !def.optional; - this._numberRegExpSoft = new RegExp(regExpStrSoft); - this._numberRegExp = new RegExp(regExpStr); - }; + // if ok - next di + if (!chres) { + if (!def.optional && !soft) { + this._value += this.placeholder.char; + skipped = false; + } + if (!skipped) def.isHollow = true; + } + } else { + this._value += def.char; + resolved = chres && (def.mask || soft); + } - MaskedNumber.prototype.extractTail = function extractTail() { - var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + if (!skipped) ++di; + if (resolved || skipped) ++ci; + } - return this._removeThousandsSeparators(_Masked.prototype.extractTail.call(this, fromPos, toPos)); + return this.value.length - oldValueLength; }; - MaskedNumber.prototype._removeThousandsSeparators = function _removeThousandsSeparators(value) { - return value.replace(this._thousandsSeparatorRegExp, ''); - }; + MaskedPattern.prototype._appendChunks = function _appendChunks(chunks, soft) { + for (var ci = 0; ci < chunks.length; ++ci) { + var _chunks$ci = chunks[ci], + fromDefIndex = _chunks$ci[0], + input = _chunks$ci[1]; - MaskedNumber.prototype._insertThousandsSeparators = function _insertThousandsSeparators(value) { - // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript - var parts = value.split(this.radix); - parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator); - return parts.join(this.radix); + if (fromDefIndex != null) this._appendPlaceholder(fromDefIndex); + if (this._append(input, soft) === false) return false; + } + return true; }; - MaskedNumber.prototype._append = function _append(str, soft) { - return _Masked.prototype._append.call(this, this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix)), soft); + MaskedPattern.prototype.extractTail = function extractTail(fromPos, toPos) { + return this.extractInputChunks(fromPos, toPos); }; - MaskedNumber.prototype.appendWithTail = function appendWithTail(str, tail) { - var oldValueLength = this.value.length; - this._value = this._removeThousandsSeparators(this.value); - var removedSeparatorsCount = oldValueLength - this.value.length; + MaskedPattern.prototype.extractInput = function extractInput() { + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - var appended = _Masked.prototype.appendWithTail.call(this, str, tail); + // TODO fromPos === toPos + var str = this.value; + var input = ''; - this._value = this._insertThousandsSeparators(this.value); + var toDefIndex = this.mapPosToDefIndex(toPos); + for (var ci = fromPos, di = this.mapPosToDefIndex(fromPos); ci < toPos && ci < str.length && di < toDefIndex; ++di) { + var ch = str[ci]; + var def = this._charDefs[di]; - var beforeTailPos = oldValueLength + appended - removedSeparatorsCount; - this._value = this._insertThousandsSeparators(this.value); - var insertedSeparatorsBeforeTailCount = 0; - for (var pos = 0; pos <= beforeTailPos; ++pos) { - if (this.value[pos] === this.thousandsSeparator) { - ++insertedSeparatorsBeforeTailCount; - ++beforeTailPos; - } + if (!def) break; + if (def.isHiddenHollow) continue; + + if (def.isInput && !def.isHollow) input += ch; + ++ci; } - - return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount; + return input; }; - MaskedNumber.prototype.nearestInputPos = function nearestInputPos(cursorPos) { - var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; + MaskedPattern.prototype.extractInputChunks = function extractInputChunks() { + var _this4 = this; - if (!direction) return cursorPos; + var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; - var nextPos = indexInDirection(cursorPos, direction); - if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction; - return cursorPos; - }; + // TODO fromPos === toPos + var fromDefIndex = this.mapPosToDefIndex(fromPos); + var toDefIndex = this.mapPosToDefIndex(toPos); + var stopDefIndices = this._charDefs.map(function (d, i) { + return [d, i]; + }).slice(fromDefIndex, toDefIndex).filter(function (_ref) { + var d = _ref[0]; + return d.stopAlign; + }).map(function (_ref2) { + var i = _ref2[1]; + return i; + }); - MaskedNumber.prototype._validate = function _validate(soft) { - var regexp = soft ? this._numberRegExpSoft : this._numberRegExp; + var stops = [fromDefIndex].concat(stopDefIndices, [toDefIndex]); - // validate as string - var valid = regexp.test(this._removeThousandsSeparators(this.value)); + return stops.map(function (s, i) { + return [stopDefIndices.indexOf(s) >= 0 ? s : null, _this4.extractInput(_this4.mapDefIndexToPos(s), _this4.mapDefIndexToPos(stops[++i]))]; + }).filter(function (_ref3) { + var stop = _ref3[0], + input = _ref3[1]; + return stop != null || input; + }); + }; - if (valid) { - // validate as number - var number = this.number; - valid = valid && !isNaN(number) && ( - // check min bound for negative values - this.min == null || this.min >= 0 || this.min <= this.number) && ( - // check max bound for positive values - this.max == null || this.max <= 0 || this.number <= this.max); + MaskedPattern.prototype._appendPlaceholder = function _appendPlaceholder(toDefIndex) { + var maxDefIndex = toDefIndex || this._charDefs.length; + for (var di = this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) { + var def = this._charDefs[di]; + if (def.isInput) def.isHollow = true; + + if (!this.placeholder.lazy || toDefIndex) { + this._value += !def.isInput ? def.char : !def.optional ? this.placeholder.char : ''; + } } + }; - return valid && _Masked.prototype._validate.call(this, soft); + MaskedPattern.prototype.clear = function clear() { + var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length; + + this._value = this.value.slice(0, from) + this.value.slice(to); + var fromDefIndex = this.mapPosToDefIndex(from); + var toDefIndex = this.mapPosToDefIndex(to); + this._charDefs.slice(fromDefIndex, toDefIndex).forEach(function (d) { + return d.reset(); + }); }; - MaskedNumber.prototype.commit = function commit() { - var number = this.number; - var validnum = number; + MaskedPattern.prototype.nearestInputPos = function nearestInputPos(cursorPos) { + var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DIRECTION.LEFT; - // check bounds - if (this.min != null) validnum = Math.max(validnum, this.min); - if (this.max != null) validnum = Math.min(validnum, this.max); + if (!direction) return cursorPos; - if (validnum !== number) { - this.unmaskedValue = '' + validnum; - } + var initialDefIndex = this.mapPosToDefIndex(cursorPos); + var di = initialDefIndex; - var formatted = this.value; + var firstInputIndex = void 0, + firstFilledInputIndex = void 0, + firstVisibleHollowIndex = void 0, + nextdi = void 0; - if (this.postFormat.normalizeZeros) { - formatted = this._normalizeZeros(formatted); + // search forward + for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { + var nextDef = this._charDefs[nextdi]; + if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di; + if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di; + if (nextDef.isInput && !nextDef.isHollow) { + firstFilledInputIndex = di; + break; + } } - if (this.postFormat.padFractionalZeros) { - formatted = this._padFractionalZeros(formatted); - } + if (direction === DIRECTION.LEFT || firstInputIndex == null) { + // search backwards + direction = -direction; + var overflow = false; - this._value = formatted; - }; + // find hollows only before initial pos + for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) { + var _nextDef = this._charDefs[nextdi]; + if (_nextDef.isInput) { + firstInputIndex = di; + if (_nextDef.isHollow && !_nextDef.isHiddenHollow) break; + } - MaskedNumber.prototype._normalizeZeros = function _normalizeZeros(value) { - var parts = this._removeThousandsSeparators(value).split(this.radix); + // if hollow not found before start position - set `overflow` + // and try to find just any input + if (di === initialDefIndex) overflow = true; - // remove leading zeros - parts[0] = parts[0].replace(/^(\D*)(0*)(\d*)/, function (match, sign, zeros, num) { - return sign + num; - }); - // add leading zero - if (value.length && !/\d$/.test(parts[0])) parts[0] = parts[0] + '0'; + // first input found + if (overflow && firstInputIndex != null) break; + } - if (parts.length > 1) { - parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros - if (!parts[1].length) parts.length = 1; // remove fractional + // process overflow + overflow = overflow || nextdi >= this._charDefs.length; + if (overflow && firstInputIndex != null) di = firstInputIndex; + } else if (firstFilledInputIndex == null) { + // adjust index if delete at right and filled input not found at right + di = firstVisibleHollowIndex != null ? firstVisibleHollowIndex : firstInputIndex; } - return this._insertThousandsSeparators(parts.join(this.radix)); + return this.mapDefIndexToPos(di); }; - MaskedNumber.prototype._padFractionalZeros = function _padFractionalZeros(value) { - var parts = value.split(this.radix); - if (parts.length < 2) parts.push(''); - parts[1] = parts[1].padEnd(this.scale, '0'); - return parts.join(this.radix); + MaskedPattern.prototype.group = function group(name) { + return this.groupsByName(name)[0]; }; - createClass(MaskedNumber, [{ - key: 'number', - get: function get$$1() { - var numstr = this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix, '.'); + MaskedPattern.prototype.groupsByName = function groupsByName(name) { + return this._groupDefs.filter(function (g) { + return g.name === name; + }); + }; - return Number(numstr); - }, - set: function set$$1(number) { - this.unmaskedValue = '' + number; - } - }, { - key: 'min', - get: function get$$1() { - return this._min; - }, - set: function set$$1(min) { - this._min = min; - } - }, { - key: 'max', - get: function get$$1() { - return this._max; - }, - set: function set$$1(max) { - this._max = max; - } - }, { - key: 'scale', - get: function get$$1() { - return this._scale; - }, - set: function set$$1(scale) { - this._scale = scale; - } - }, { - key: 'radix', + createClass(MaskedPattern, [{ + key: 'placeholder', get: function get$$1() { - return this._radix; + return this._placeholder; }, - set: function set$$1(radix) { - this._radix = radix; - this._updateNumberRegExp(); + set: function set$$1(ph) { + this._placeholder = _extends({}, MaskedPattern.DEFAULT_PLACEHOLDER, ph); } }, { - key: 'signed', + key: 'definitions', get: function get$$1() { - return this._signed || this.min != null && this.min < 0 || this.max != null && this.max < 0; + return this._definitions; }, - set: function set$$1(signed) { - this._signed = signed; + set: function set$$1(defs) { + defs = _extends({}, PatternDefinition.DEFAULTS, defs); + + this._definitions = defs; + this._updateMask(); } }, { - key: 'postFormat', + key: 'mask', get: function get$$1() { - return this._postFormat; + return this._mask; }, - set: function set$$1(postFormat) { - this._postFormat = _extends({}, MaskedNumber.DEFAULTS.postFormat, postFormat); + set: function set$$1(mask) { + this._mask = mask; + this._updateMask(); } }, { - key: 'mapToRadix', + key: 'isComplete', get: function get$$1() { - return this._mapToRadix; - }, - set: function set$$1(mapToRadix) { - this._mapToRadix = mapToRadix; - this._mapToRadixRegExp = new RegExp('[' + mapToRadix.map(escapeRegExp).join('') + ']', 'g'); + var _this5 = this; + + return !this._charDefs.some(function (d, i) { + return d.isInput && !d.optional && (d.isHollow || !_this5.extractInput(i, i + 1)); + }); } }, { - key: 'thousandsSeparator', + key: 'groups', get: function get$$1() { - return this._thousandsSeparator; + return this._groups; }, - set: function set$$1(thousandsSeparator) { - this._thousandsSeparator = thousandsSeparator; - this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g'); + set: function set$$1(groups) { + this._groups = groups; + this._updateMask(); } }]); - return MaskedNumber; -}(Masked), (_applyDecoratedDescriptor$2(_class$2.prototype, 'min', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'min'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'max', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'max'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'scale', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'scale'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'radix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'radix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'signed', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'signed'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'postFormat', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'postFormat'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'mapToRadix', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'mapToRadix'), _class$2.prototype), _applyDecoratedDescriptor$2(_class$2.prototype, 'thousandsSeparator', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$2.prototype, 'thousandsSeparator'), _class$2.prototype)), _class$2); -MaskedNumber.DEFAULTS = { - radix: ',', - thousandsSeparator: '', - mapToRadix: ['.'], - scale: 2, - postFormat: { - normalizeZeros: true - } + return MaskedPattern; +}(Masked), (_applyDecoratedDescriptor$1(_class$1.prototype, 'placeholder', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'placeholder'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'definitions', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'definitions'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'mask', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'mask'), _class$1.prototype), _applyDecoratedDescriptor$1(_class$1.prototype, 'groups', [refreshValueOnSet], Object.getOwnPropertyDescriptor(_class$1.prototype, 'groups'), _class$1.prototype)), _class$1); +MaskedPattern.DEFAULT_PLACEHOLDER = { + lazy: true, + char: '_' }; +MaskedPattern.STOP_CHAR = '`'; +MaskedPattern.ESCAPE_CHAR = '\\'; +MaskedPattern.Definition = PatternDefinition; +MaskedPattern.Group = PatternGroup; var _class$3; diff --git a/dist/imask.js.map b/dist/imask.js.map index b494900b..d5441f64 100644 --- a/dist/imask.js.map +++ b/dist/imask.js.map @@ -1 +1 @@ -{"version":3,"file":"imask.js","sources":["../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/core/utils.js","../src/masked/base.js","../src/masked/factory.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/number.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js","../src/imask.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {isString} from '../core/utils';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof IMask.Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new IMask.Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof IMask.Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new IMask.MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new IMask.Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new IMask.Masked(opts);\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A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6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n"],"names":["isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","has","hide","global","aFunction","core","ctx","redefine","cof","defined","toInteger","uid","isArray","speciesConstructor","asc","toObject","IObject","toLength","$export","min","toIObject","toIndex","$keys","enumBugKeys","fails","repeat","$pad","isString","str","String","conform","res","fallback","DIRECTION","indexInDirection","pos","direction","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","withValueRefresh","bind","escapeRegExp","replace","Masked","mask","validate","_value","isInitialized","_validate","soft","value","clone","m","slice","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","length","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","tailAppended","_unmask","clear","from","to","fn","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","createMask","opts","babelHelpers.extends","IMask","RegExp","test","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","PatternDefinition","_masked","isHollow","resolve","type","TYPES","INPUT","optional","DEFAULTS","PatternGroup","masked","name","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","Math","max","minstr","maxstr","match","placeholder","num","firstNonZero","search","_matchFrom","padEnd","maxLength","EnumGroup","enums","group","some","e","indexOf","Range","Enum","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_groups","p","i","gNames","Object","keys","filter","gName","sort","a","b","push","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","map","stops","s","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","Definition","Group","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","split","join","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","regexp","valid","number","isNaN","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","_thousandsSeparator","format","parse","Y","getFullYear","date","isComplete","isDateExist","day","getDate","padStart","month","getMonth","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","InputMask","el","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","listeners","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange","window"],"mappings":";;;;;;;;;;;;AACA,IAAI,MAAM,GAAG,cAAc,GAAG,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;IAC7E,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;AAChG,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC;;;;ACHvC,IAAI,IAAI,GAAG,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC;;;ACDrC,aAAc,GAAG,SAAS,EAAE,CAAC;EAC3B,OAAO,OAAO,EAAE,KAAK,QAAQ,GAAG,EAAE,KAAK,IAAI,GAAG,OAAO,EAAE,KAAK,UAAU,CAAC;CACxE;;ACDD,aAAc,GAAG,SAAS,EAAE,CAAC;EAC3B,GAAG,CAACA,SAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,SAAS,CAAC,EAAE,GAAG,oBAAoB,CAAC,CAAC;EAC5D,OAAO,EAAE,CAAC;CACX;;ACJD,UAAc,GAAG,SAAS,IAAI,CAAC;EAC7B,IAAI;IACF,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;GACjB,CAAC,MAAM,CAAC,CAAC;IACR,OAAO,IAAI,CAAC;GACb;CACF;;ACND;AACA,gBAAc,GAAG,CAACC,MAAmB,CAA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B,MAAL,GAAc,KAAKA,MAAL,CAAY7B,aAA1B,GAA0C,IAA3D;WACK6B,MAAL,GAAczB,WAAW,EAACzC,UAAD,EAAX,CAAd;UACIoC,YAAY,IAAhB,EAAsB,KAAK8B,MAAL,CAAY7B,aAAZ,GAA4BD,QAA5B;;;;2BAGX;aACJ,KAAKlC,MAAZ;;yBAGSxB,KAAK;WACTwF,MAAL,CAAY5D,KAAZ,GAAoB5B,GAApB;WACKkR,aAAL;WACKb,YAAL;;;;2BAGmB;aACZ,KAAKL,cAAZ;;yBAGiBhQ,KAAK;WACjBwF,MAAL,CAAY7B,aAAZ,GAA4B3D,GAA5B;WACKkR,aAAL;WACKb,YAAL;;;;2BAwBoB;aACb,KAAKwB,eAAL,GACL,KAAKD,kBADA,GAGL,KAAK9B,EAAL,CAAQmB,cAHV;;;;2BAMe;aACR,KAAKY,eAAL,GACL,KAAKD,kBADA,GAGL,KAAK9B,EAAL,CAAQ+C,YAHV;;yBAMatS,KAAK;UACd,KAAKuP,EAAL,KAAYjS,SAASiV,aAAzB,EAAwC;;WAEnChD,EAAL,CAAQiD,iBAAR,CAA0BxS,GAA1B,EAA+BA,GAA/B;WACK0P,cAAL;;;;;;ACnFJ,SAAS/L,OAAT,CAAgB4L,EAAhB,EAA6B;MAAT9L,IAAS,uEAAJ,EAAI;;;SAEpB,IAAI6L,SAAJ,CAAcC,EAAd,EAAkB9L,IAAlB,CAAP;;;AAIFE,QAAM2L,SAAN,GAAkBA,SAAlB;;AAEA3L,QAAM7C,MAAN,GAAeA,MAAf;AACA6C,QAAMG,aAAN,GAAsBA,aAAtB;AACAH,QAAMM,YAAN,GAAqBA,YAArB;AACAN,QAAMS,UAAN,GAAmBA,UAAnB;;AAEAqO,OAAO9O,KAAP,GAAeA,OAAf;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"imask.js","sources":["../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/core/utils.js","../src/masked/base.js","../src/masked/number.js","../src/masked/factory.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js","../src/imask.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {isString} from '../core/utils';\r\nimport Masked from './base';\r\nimport MaskedNumber from './number';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new Masked(opts);\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n"],"names":["isObject","require$$0","document","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","has","hide","global","aFunction","core","ctx","redefine","cof","defined","toInteger","uid","isArray","speciesConstructor","asc","toObject","IObject","toLength","$export","min","toIObject","toIndex","$keys","enumBugKeys","fails","repeat","$pad","isString","str","String","conform","res","fallback","DIRECTION","indexInDirection","pos","direction","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","withValueRefresh","bind","escapeRegExp","replace","Masked","mask","validate","_value","isInitialized","_validate","soft","value","clone","m","slice","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","length","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","tailAppended","_unmask","clear","from","to","fn","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","MaskedNumber","opts","babelHelpers.extends","DEFAULTS","scale","radix","mapToRadix","max","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","RegExp","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","split","join","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","regexp","valid","test","number","isNaN","validnum","Math","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","match","sign","zeros","num","push","padEnd","numstr","Number","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","map","_thousandsSeparator","createMask","IMask","MaskedPattern","prototype","Date","pattern","MaskedDate","Function","warn","PatternDefinition","_masked","isHollow","resolve","type","TYPES","INPUT","optional","PatternGroup","masked","name","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","placeholder","firstNonZero","search","_matchFrom","maxLength","EnumGroup","enums","group","some","e","indexOf","Range","Enum","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_groups","p","i","gNames","Object","keys","filter","gName","sort","a","b","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","stops","s","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","Definition","Group","format","parse","Y","getFullYear","date","isComplete","isDateExist","day","getDate","padStart","month","getMonth","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","InputMask","el","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","listeners","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange","window"],"mappings":";;;;;;;;;;;;AACA,IAAI,MAAM,GAAG,cAAc,GAAG,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;IAC7E,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;AAChG,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC;;;;ACHvC,IAAI,IAAI,GAAG,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC;;;ACDrC,aAAc,GAAG,SAAS,EAAE,CAAC;EAC3B,OAAO,OAAO,EAAE,KAAK,QAAQ,GAAG,EAAE,KAAK,IAAI,GAAG,OAAO,EAAE,KAAK,UAAU,CAAC;CACxE;;ACDD,aAAc,GAAG,SAAS,EAAE,CAAC;EAC3B,GAAG,CAACA,SAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,SAAS,CAAC,EAAE,GAAG,oBAAoB,CAAC,CAAC;EAC5D,OAAO,EAAE,CAAC;CACX;;ACJD,UAAc,GAAG,SAAS,IAAI,CAAC;EAC7B,IAAI;IACF,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;GACjB,CAAC,MAAM,CAAC,CAAC;IACR,OAAO,IAAI,CAAC;GACb;CACF;;ACND;AACA,gBAAc,GAAG,CAACC,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2 +1,2 @@ -function createCommonjsModule(t,e){return e={exports:{}},t(e,e.exports),e.exports}function isString(t){return"string"==typeof t||t instanceof String}function conform(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return isString(t)?t:t?e:n}function indexInDirection(t,e){return e===DIRECTION.LEFT&&--t,t}function refreshValueOnSet(t,e,n){var r=n.set;n.set=function(){for(var t=arguments.length,e=Array(t),n=0;n=0})}}}function _applyDecoratedDescriptor$1(t,e,n,r,i){var u={};return Object.keys(r).forEach(function(t){u[t]=r[t]}),u.enumerable=!!u.enumerable,u.configurable=!!u.configurable,("value"in u||u.initializer)&&(u.writable=!0),u=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},u),i&&void 0!==u.initializer&&(u.value=u.initializer?u.initializer.call(i):void 0,u.initializer=void 0),void 0===u.initializer&&(Object.defineProperty(t,e,u),u=null),u}function _applyDecoratedDescriptor$2(t,e,n,r,i){var u={};return Object.keys(r).forEach(function(t){u[t]=r[t]}),u.enumerable=!!u.enumerable,u.configurable=!!u.configurable,("value"in u||u.initializer)&&(u.writable=!0),u=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},u),i&&void 0!==u.initializer&&(u.value=u.initializer?u.initializer.call(i):void 0,u.initializer=void 0),void 0===u.initializer&&(Object.defineProperty(t,e,u),u=null),u}function _applyDecoratedDescriptor$3(t,e,n,r,i){var u={};return Object.keys(r).forEach(function(t){u[t]=r[t]}),u.enumerable=!!u.enumerable,u.configurable=!!u.configurable,("value"in u||u.initializer)&&(u.writable=!0),u=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},u),i&&void 0!==u.initializer&&(u.value=u.initializer?u.initializer.call(i):void 0,u.initializer=void 0),void 0===u.initializer&&(Object.defineProperty(t,e,u),u=null),u}function IMask$1(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new InputMask(t,e)}var _global=createCommonjsModule(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),_core=createCommonjsModule(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),_isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},_anObject=function(t){if(!_isObject(t))throw TypeError(t+" is not an object!");return t},_fails=function(t){try{return!!t()}catch(t){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),document$1=_global.document,is=_isObject(document$1)&&_isObject(document$1.createElement),_domCreate=function(t){return is?document$1.createElement(t):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(t,e){if(!_isObject(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!_isObject(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!_isObject(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!_isObject(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(t,e,n){if(_anObject(t),e=_toPrimitive(e,!0),_anObject(n),_ie8DomDefine)try{return dP(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},_objectDp={f:f},_propertyDesc=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},_hide=_descriptors?function(t,e,n){return _objectDp.f(t,e,_propertyDesc(1,n))}:function(t,e,n){return t[e]=n,t},hasOwnProperty={}.hasOwnProperty,_has=function(t,e){return hasOwnProperty.call(t,e)},id=0,px=Math.random(),_uid=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++id+px).toString(36))},_redefine=createCommonjsModule(function(t){var e=_uid("src"),n=Function.toString,r=(""+n).split("toString");_core.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,i,u){var o="function"==typeof i;o&&(_has(i,"name")||_hide(i,"name",n)),t[n]!==i&&(o&&(_has(i,e)||_hide(i,e,t[n]?""+t[n]:r.join(String(n)))),t===_global?t[n]=i:u?t[n]?t[n]=i:_hide(t,n,i):(delete t[n],_hide(t,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),_aFunction=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},_ctx=function(t,e,n){if(_aFunction(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},PROTOTYPE="prototype",$export=function(t,e,n){var r,i,u,o,s=t&$export.F,a=t&$export.G,l=t&$export.S,c=t&$export.P,h=t&$export.B,p=a?_global:l?_global[e]||(_global[e]={}):(_global[e]||{})[PROTOTYPE],f=a?_core:_core[e]||(_core[e]={}),d=f[PROTOTYPE]||(f[PROTOTYPE]={});a&&(n=e);for(r in n)u=((i=!s&&p&&void 0!==p[r])?p:n)[r],o=h&&i?_ctx(u,_global):c&&"function"==typeof u?_ctx(Function.call,u):u,p&&_redefine(p,r,u,t&$export.U),f[r]!=u&&_hide(f,r,o),c&&d[r]!=u&&(d[r]=u)};_global.core=_core,$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,toString={}.toString,_cof=function(t){return toString.call(t).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==_cof(t)?t.split(""):Object(t)},_defined=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},_toObject=function(t){return Object(_defined(t))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(t){return isNaN(t=+t)?0:(t>0?floor:ceil)(t)},min=Math.min,_toLength=function(t){return t>0?min(_toInteger(t),9007199254740991):0},_isArray=Array.isArray||function(t){return"Array"==_cof(t)},SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(t){return store[t]||(store[t]={})},_wks=createCommonjsModule(function(t){var e=_shared("wks"),n=_global.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:_uid)("Symbol."+t))}).store=e}),SPECIES=_wks("species"),_arraySpeciesConstructor=function(t){var e;return _isArray(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!_isArray(e.prototype)||(e=void 0),_isObject(e)&&null===(e=e[SPECIES])&&(e=void 0)),void 0===e?Array:e},_arraySpeciesCreate=function(t,e){return new(_arraySpeciesConstructor(t))(e)},_arrayMethods=function(t,e){var n=1==t,r=2==t,i=3==t,u=4==t,o=6==t,s=5==t||o,a=e||_arraySpeciesCreate;return function(e,l,c){for(var h,p,f=_toObject(e),d=_iobject(f),_=_ctx(l,c,3),m=_toLength(d.length),v=0,g=n?a(e,m):r?a(e,0):void 0;m>v;v++)if((s||v in d)&&(h=d[v],p=_(h,v,f),t))if(n)g[v]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return v;case 2:g.push(h)}else if(u)return!1;return o?-1:i||u?u:g}},UNSCOPABLES=_wks("unscopables"),ArrayProto=Array.prototype;void 0==ArrayProto[UNSCOPABLES]&&_hide(ArrayProto,UNSCOPABLES,{});var _addToUnscopables=function(t){ArrayProto[UNSCOPABLES][t]=!0},$find=_arrayMethods(5),KEY="find",forced=!0;KEY in[]&&Array(1)[KEY](function(){forced=!1}),_export(_export.P+_export.F*forced,"Array",{find:function(t){return $find(this,t,arguments.length>1?arguments[1]:void 0)}}),_addToUnscopables(KEY);var _toIobject=function(t){return _iobject(_defined(t))},max=Math.max,min$1=Math.min,_toIndex=function(t,e){return(t=_toInteger(t))<0?max(t+e,0):min$1(t,e)},_arrayIncludes=function(t){return function(e,n,r){var i,u=_toIobject(e),o=_toLength(u.length),s=_toIndex(r,o);if(t&&n!=n){for(;o>s;)if((i=u[s++])!=i)return!0}else for(;o>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}},shared=_shared("keys"),_sharedKey=function(t){return shared[t]||(shared[t]=_uid(t))},arrayIndexOf=_arrayIncludes(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(t,e){var n,r=_toIobject(t),i=0,u=[];for(n in r)n!=IE_PROTO&&_has(r,n)&&u.push(n);for(;e.length>i;)_has(r,n=e[i++])&&(~arrayIndexOf(u,n)||u.push(n));return u},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_objectKeys=Object.keys||function(t){return _objectKeysInternal(t,_enumBugKeys)},_objectSap=function(t,e){var n=(_core.Object||{})[t]||Object[t],r={};r[t]=e(n),_export(_export.S+_export.F*_fails(function(){n(1)}),"Object",r)};_objectSap("keys",function(){return function(t){return _objectKeys(_toObject(t))}});var _stringRepeat=function(t){var e=String(_defined(this)),n="",r=_toInteger(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n};_export(_export.P,"String",{repeat:_stringRepeat});var _stringPad=function(t,e,n,r){var i=String(_defined(t)),u=i.length,o=void 0===n?" ":String(n),s=_toLength(e);if(s<=u||""==o)return i;var a=s-u,l=_stringRepeat.call(o,Math.ceil(a/o.length));return l.length>a&&(l=l.slice(0,a)),r?l+i:i+l};_export(_export.P,"String",{padStart:function(t){return _stringPad(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),_export(_export.P,"String",{padEnd:function(t){return _stringPad(this,t,arguments.length>1?arguments[1]:void 0,!1)}});var DIRECTION={NONE:0,LEFT:-1,RIGHT:1},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)},t.prototype.extractTail=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.extractInput(t,e)},t.prototype._appendTail=function(t){return!t||this._append(t)},t.prototype._append=function(t,e){for(var n=this.value.length,r=this.clone(),i=0;i0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e)},t.prototype.withValueRefresh=function(t){if(this._refreshing)return t();this._refreshing=!0;var e=this.isInitialized?this.unmaskedValue:null,n=t();return null!=e&&(this.unmaskedValue=e),delete this._refreshing,n},t.prototype.commit=function(){},createClass(t,[{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.reset(),this.appendWithTail(t),this.commit()}},{key:"unmaskedValue",get:function(){return this._unmask()},set:function(t){this.reset(),this._append(t),this.appendWithTail(""),this.commit()}},{key:"isComplete",get:function(){return!0}}]),t}(),_applyDecoratedDescriptor(_class.prototype,"mask",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class.prototype,"mask"),_class.prototype),_class),PatternDefinition=function(){function t(e){classCallCheck(this,t),_extends(this,e),this.mask&&(this._masked=createMask(e))}return t.prototype.reset=function(){this.isHollow=!1,this._masked&&this._masked.reset()},t.prototype.resolve=function(t){return!!this._masked&&(this._masked.value=t,this._masked.value)},createClass(t,[{key:"isInput",get:function(){return this.type===t.TYPES.INPUT}},{key:"isHiddenHollow",get:function(){return this.isHollow&&this.optional}}]),t}();PatternDefinition.DEFAULTS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},PatternDefinition.TYPES={INPUT:"input",FIXED:"fixed"};var PatternGroup=function(){function t(e,n){var r=n.name,i=n.offset,u=n.mask,o=n.validate;classCallCheck(this,t),this.masked=e,this.name=r,this.offset=i,this.mask=u,this.validate=o||function(){return!0}}return t.prototype._validate=function(t){return this.validate(this.value,this,t)},createClass(t,[{key:"value",get:function(){return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}},{key:"unmaskedValue",get:function(){return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}}]),t}(),RangeGroup=function(){function t(e){var n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+"").length;classCallCheck(this,t),this._from=n,this._to=r,this._maxLength=i,this.validate=this.validate.bind(this),this._update()}return t.prototype._update=function(){this._maxLength=Math.max(this._maxLength,(this.to+"").length),this.mask="0".repeat(this._maxLength)},t.prototype.validate=function(t){var e="",n="",r=t.match(/^(\D*)(\d*)(\D*)/),i=r[1],u=r[2];return u&&(e="0".repeat(i.length)+u,n="9".repeat(i.length)+u),-1===t.search(/[^0]/)&&t.length<=this._matchFrom||(e=e.padEnd(this._maxLength,"0"),n=n.padEnd(this._maxLength,"9"),this.from<=Number(n)&&Number(e)<=this.to)},createClass(t,[{key:"to",get:function(){return this._to},set:function(t){this._to=t,this._update()}},{key:"from",get:function(){return this._from},set:function(t){this._from=t,this._update()}},{key:"maxLength",get:function(){return this._maxLength},set:function(t){this._maxLength=t,this._update()}},{key:"_matchFrom",get:function(){return this.maxLength-(this.from+"").length}}]),t}();PatternGroup.Range=RangeGroup,PatternGroup.Enum=EnumGroup;var _class$1,MaskedPattern=(_class$1=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e);var r=n.definitions,i=n.placeholder,u=n.groups,o=possibleConstructorReturn(this,t.call(this,n));return delete o.isInitialized,o.placeholder=i,o.definitions=r,o.groups=u,o.isInitialized=!0,o}return inherits(e,t),e.prototype._updateMask=function(){var t=this,n=this._definitions;this._charDefs=[],this._groupDefs=[];var r=this.mask;if(r&&n){var i=!1,u=!1,o=!1;t:for(var s=0;s=e)break;r.isHiddenHollow&&++e}return e}},e.prototype._unmask=function(){for(var t=this.value,e="",n=0,r=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this.value,r="",i=this.mapPosToDefIndex(e),u=t,o=this.mapPosToDefIndex(t);u0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=this.mapPosToDefIndex(e),i=this.mapPosToDefIndex(n),u=this._charDefs.map(function(t,e){return[t,e]}).slice(r,i).filter(function(t){return t[0].stopAlign}).map(function(t){return t[1]}),o=[r].concat(u,[i]);return o.map(function(e,n){return[u.indexOf(e)>=0?e:null,t.extractInput(t.mapDefIndexToPos(e),t.mapDefIndexToPos(o[++n]))]}).filter(function(t){var e=t[0],n=t[1];return null!=e||n})},e.prototype._appendPlaceholder=function(t){for(var e=t||this._charDefs.length,n=this.mapPosToDefIndex(this.value.length);n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e);var n=this.mapPosToDefIndex(t),r=this.mapPosToDefIndex(e);this._charDefs.slice(n,r).forEach(function(t){return t.reset()})},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DIRECTION.LEFT;if(!e)return t;var n=this.mapPosToDefIndex(t),r=n,i=void 0,u=void 0,o=void 0,s=void 0;for(s=indexInDirection(r,e);0<=s&&s=this._charDefs.length)&&null!=i&&(r=i)}else null==u&&(r=null!=o?o:i);return this.mapDefIndexToPos(r)},e.prototype.group=function(t){return this.groupsByName(t)[0]},e.prototype.groupsByName=function(t){return this._groupDefs.filter(function(e){return e.name===t})},createClass(e,[{key:"placeholder",get:function(){return this._placeholder},set:function(t){this._placeholder=_extends({},e.DEFAULT_PLACEHOLDER,t)}},{key:"definitions",get:function(){return this._definitions},set:function(t){t=_extends({},PatternDefinition.DEFAULTS,t),this._definitions=t,this._updateMask()}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t,this._updateMask()}},{key:"isComplete",get:function(){var t=this;return!this._charDefs.some(function(e,n){return e.isInput&&!e.optional&&(e.isHollow||!t.extractInput(n,n+1))})}},{key:"groups",get:function(){return this._groups},set:function(t){this._groups=t,this._updateMask()}}]),e}(Masked),_applyDecoratedDescriptor$1(_class$1.prototype,"placeholder",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"placeholder"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"definitions",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"definitions"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"mask",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"mask"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"groups",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"groups"),_class$1.prototype),_class$1);MaskedPattern.DEFAULT_PLACEHOLDER={lazy:!0,char:"_"},MaskedPattern.STOP_CHAR="`",MaskedPattern.ESCAPE_CHAR="\\",MaskedPattern.Definition=PatternDefinition,MaskedPattern.Group=PatternGroup;var _class$2,MaskedNumber=(_class$2=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e),n=_extends({},e.DEFAULTS,n);var r=possibleConstructorReturn(this,t.call(this,n));delete r.isInitialized;var i=n,u=i.scale,o=i.radix,s=i.mapToRadix,a=i.min,l=i.max,c=i.signed,h=i.thousandsSeparator,p=i.postFormat;return r.min=a,r.max=l,r.scale=u,r.radix=o,r.mapToRadix=s,r.signed=c,r.thousandsSeparator=h,r.postFormat=p,r._updateNumberRegExp(),r.isInitialized=!0,r}return inherits(e,t),e.prototype._updateNumberRegExp=function(){var t="^",e="^";this.signed?(t+="([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))",e+="[+|\\-]?"):t+="(0|([1-9]+\\d*))",e+="\\d*",this.scale&&(t+="("+this.radix+"\\d{0,"+this.scale+"})?",e+="("+this.radix+"\\d{0,"+this.scale+"})?"),t+="$",e+="$",this._numberRegExpSoft=new RegExp(t),this._numberRegExp=new RegExp(e)},e.prototype.extractTail=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._removeThousandsSeparators(t.prototype.extractTail.call(this,e,n))},e.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")},e.prototype._insertThousandsSeparators=function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)},e.prototype._append=function(e,n){return t.prototype._append.call(this,this._removeThousandsSeparators(e.replace(this._mapToRadixRegExp,this.radix)),n)},e.prototype.appendWithTail=function(e,n){var r=this.value.length;this._value=this._removeThousandsSeparators(this.value);var i=r-this.value.length,u=t.prototype.appendWithTail.call(this,e,n);this._value=this._insertThousandsSeparators(this.value);var o=r+u-i;this._value=this._insertThousandsSeparators(this.value);for(var s=0,a=0;a<=o;++a)this.value[a]===this.thousandsSeparator&&(++s,++o);return u-i+s},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DIRECTION.LEFT;if(!e)return t;var n=indexInDirection(t,e);return this.value[n]===this.thousandsSeparator&&(t+=e),t},e.prototype._validate=function(e){var n=(e?this._numberRegExpSoft:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(n){var r=this.number;n=n&&!isNaN(r)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return n&&t.prototype._validate.call(this,e)},e.prototype.commit=function(){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=""+e);var n=this.value;this.postFormat.normalizeZeros&&(n=this._normalizeZeros(n)),this.postFormat.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n},e.prototype._normalizeZeros=function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,function(t,e,n,r){return e+r}),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))},e.prototype._padFractionalZeros=function(t){var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)},createClass(e,[{key:"number",get:function(){var t=this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix,".");return Number(t)},set:function(t){this.unmaskedValue=""+t}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}},{key:"scale",get:function(){return this._scale},set:function(t){this._scale=t}},{key:"radix",get:function(){return this._radix},set:function(t){this._radix=t,this._updateNumberRegExp()}},{key:"signed",get:function(){return this._signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0},set:function(t){this._signed=t}},{key:"postFormat",get:function(){return this._postFormat},set:function(t){this._postFormat=_extends({},e.DEFAULTS.postFormat,t)}},{key:"mapToRadix",get:function(){return this._mapToRadix},set:function(t){this._mapToRadix=t,this._mapToRadixRegExp=new RegExp("["+t.map(escapeRegExp).join("")+"]","g")}},{key:"thousandsSeparator",get:function(){return this._thousandsSeparator},set:function(t){this._thousandsSeparator=t,this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(t),"g")}}]),e}(Masked),_applyDecoratedDescriptor$2(_class$2.prototype,"min",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"min"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"max",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"max"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"scale",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"scale"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"radix",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"radix"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"signed",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"signed"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"postFormat",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"postFormat"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"mapToRadix",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"mapToRadix"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"thousandsSeparator",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"thousandsSeparator"),_class$2.prototype),_class$2);MaskedNumber.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,postFormat:{normalizeZeros:!0}};var _class$3,MaskedDate=(_class$3=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e);var r=n.groups,i=n=_extends({},e.DEFAULTS,n),u=i.min,o=i.max,s=i.format,a=i.parse;n.groups=_extends({},e.DEFAULTS.groups),n.groups.Y&&(u&&(n.groups.Y.from=u.getFullYear()),o&&(n.groups.Y.to=o.getFullYear())),_extends(n.groups,r);var l=possibleConstructorReturn(this,t.call(this,n));return delete l.isInitialized,l.min=u,l.max=o,l.format=s,l.parse=a,l.isInitialized=!0,l}return inherits(e,t),e.prototype._validate=function(e){var n=t.prototype._validate.call(this,e),r=this.date;return n&&(!this.isComplete||this.isDateExist(this.value)&&r&&(null==this.min||this.min<=r)&&(null==this.max||r<=this.max))},e.prototype.isDateExist=function(t){return this.format(this.parse(t))===t},createClass(e,[{key:"date",get:function(){return this.isComplete?this.parse(this.value):null},set:function(t){this.value=this.format(t)}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}}]),e}(MaskedPattern),_applyDecoratedDescriptor$3(_class$3.prototype,"min",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$3.prototype,"min"),_class$3.prototype),_applyDecoratedDescriptor$3(_class$3.prototype,"max",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$3.prototype,"max"),_class$3.prototype),_class$3);MaskedDate.DEFAULTS={mask:"d{.}`m{.}`Y",format:function(t){return[(""+t.getDate()).padStart(2,"0"),(""+(t.getMonth()+1)).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=t.split("."),n=e[0],r=e[1],i=e[2];return new Date(i,r-1,n)},groups:{d:new PatternGroup.Range([1,31]),m:new PatternGroup.Range([1,12]),Y:new PatternGroup.Range([1900,9999])}};var ActionDetails=function(){function t(e,n,r,i){classCallCheck(this,t),this.value=e,this.cursorPos=n,this.oldValue=r,this.oldSelection=i}return createClass(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return this.removedCount&&(this.oldSelection.end===this.cursorPos||this.insertedCount?DIRECTION.RIGHT:DIRECTION.LEFT)}}]),t}(),InputMask=function(){function t(e,n){classCallCheck(this,t),this.el=e,this.masked=createMask(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._alignCursor=this._alignCursor.bind(this),this._alignCursorFriendly=this._alignCursorFriendly.bind(this),this.bindEvents(),this.updateValue(),this._onChange()}return t.prototype.bindEvents=function(){this.el.addEventListener("keydown",this._saveSelection),this.el.addEventListener("input",this._onInput),this.el.addEventListener("drop",this._onDrop),this.el.addEventListener("click",this._alignCursorFriendly),this.el.addEventListener("change",this._onChange)},t.prototype.unbindEvents=function(){this.el.removeEventListener("keydown",this._saveSelection),this.el.removeEventListener("input",this._onInput),this.el.removeEventListener("drop",this._onDrop),this.el.removeEventListener("click",this._alignCursorFriendly),this.el.removeEventListener("change",this._onChange)},t.prototype.fireEvent=function(t){(this._listeners[t]||[]).forEach(function(t){return t()})},t.prototype._saveSelection=function(){this.value!==this.el.value&&console.warn("Uncontrolled input change, refresh mask manually!"),this._selection={start:this.selectionStart,end:this.cursorPos}},t.prototype.updateValue=function(){this.masked.value=this.el.value},t.prototype.updateControl=function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()},t.prototype.updateOptions=function(t){var e=this,n=t.mask;n&&(this.mask=n),this.masked.withValueRefresh(function(){for(var n in t)"mask"!==n&&(e.masked[n]=t[n])}),this.updateControl()},t.prototype.updateCursor=function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))},t.prototype._delayUpdateCursor=function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(function(){e.cursorPos=e._changingCursorPos,e._abortUpdateCursor()},10)},t.prototype._fireChangeEvents=function(){this.fireEvent("accept"),this.masked.isComplete&&this.fireEvent("complete")},t.prototype._abortUpdateCursor=function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)},t.prototype._alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos)},t.prototype._alignCursorFriendly=function(){this.selectionStart===this.cursorPos&&this._alignCursor()},t.prototype.on=function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this},t.prototype.off=function(t,e){if(this._listeners[t]){if(e){var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners.splice(n,1),this}delete this._listeners[t]}},t.prototype._onInput=function(){this._abortUpdateCursor();var t=new ActionDetails(this.el.value,this.cursorPos,this.value,this._selection),e=t.startChangePos+t.removed.length,n=this.masked.extractTail(e),r=this.masked.nearestInputPos(t.startChangePos,t.removeDirection);this.masked.clear(r);var i=this.masked.appendWithTail(t.inserted,n),u=this.masked.nearestInputPos(r+i,t.removeDirection);this.updateControl(),this.updateCursor(u)},t.prototype._onChange=function(){this.value!==this.el.value&&this.updateValue(),this.masked.commit(),this.updateControl()},t.prototype._onDrop=function(t){t.preventDefault(),t.stopPropagation()},t.prototype.destroy=function(){this.unbindEvents(),this._listeners.length=0},createClass(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if((void 0===t?"undefined":_typeof(t))!==_typeof(this.masked.mask)){var e=this.masked?this.masked.unmaskedValue:null;this.masked=createMask({mask:t}),null!=e&&(this.masked.unmaskedValue=e)}else this.masked.mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this._alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this._alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el===document.activeElement&&(this.el.setSelectionRange(t,t),this._saveSelection())}}]),t}();IMask$1.InputMask=InputMask,IMask$1.Masked=Masked,IMask$1.MaskedPattern=MaskedPattern,IMask$1.MaskedNumber=MaskedNumber,IMask$1.MaskedDate=MaskedDate,window.IMask=IMask$1;export default IMask$1; +function createCommonjsModule(t,e){return e={exports:{}},t(e,e.exports),e.exports}function isString(t){return"string"==typeof t||t instanceof String}function conform(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return isString(t)?t:t?e:n}function indexInDirection(t,e){return e===DIRECTION.LEFT&&--t,t}function refreshValueOnSet(t,e,n){var r=n.set;n.set=function(){for(var t=arguments.length,e=Array(t),n=0;n=0})}}}function _applyDecoratedDescriptor$1(t,e,n,r,i){var u={};return Object.keys(r).forEach(function(t){u[t]=r[t]}),u.enumerable=!!u.enumerable,u.configurable=!!u.configurable,("value"in u||u.initializer)&&(u.writable=!0),u=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},u),i&&void 0!==u.initializer&&(u.value=u.initializer?u.initializer.call(i):void 0,u.initializer=void 0),void 0===u.initializer&&(Object.defineProperty(t,e,u),u=null),u}function _applyDecoratedDescriptor$3(t,e,n,r,i){var u={};return Object.keys(r).forEach(function(t){u[t]=r[t]}),u.enumerable=!!u.enumerable,u.configurable=!!u.configurable,("value"in u||u.initializer)&&(u.writable=!0),u=n.slice().reverse().reduce(function(n,r){return r(t,e,n)||n},u),i&&void 0!==u.initializer&&(u.value=u.initializer?u.initializer.call(i):void 0,u.initializer=void 0),void 0===u.initializer&&(Object.defineProperty(t,e,u),u=null),u}function IMask$1(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new InputMask(t,e)}var _global=createCommonjsModule(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),_core=createCommonjsModule(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),_isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},_anObject=function(t){if(!_isObject(t))throw TypeError(t+" is not an object!");return t},_fails=function(t){try{return!!t()}catch(t){return!0}},_descriptors=!_fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),document$1=_global.document,is=_isObject(document$1)&&_isObject(document$1.createElement),_domCreate=function(t){return is?document$1.createElement(t):{}},_ie8DomDefine=!_descriptors&&!_fails(function(){return 7!=Object.defineProperty(_domCreate("div"),"a",{get:function(){return 7}}).a}),_toPrimitive=function(t,e){if(!_isObject(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!_isObject(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!_isObject(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!_isObject(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},dP=Object.defineProperty,f=_descriptors?Object.defineProperty:function(t,e,n){if(_anObject(t),e=_toPrimitive(e,!0),_anObject(n),_ie8DomDefine)try{return dP(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},_objectDp={f:f},_propertyDesc=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},_hide=_descriptors?function(t,e,n){return _objectDp.f(t,e,_propertyDesc(1,n))}:function(t,e,n){return t[e]=n,t},hasOwnProperty={}.hasOwnProperty,_has=function(t,e){return hasOwnProperty.call(t,e)},id=0,px=Math.random(),_uid=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++id+px).toString(36))},_redefine=createCommonjsModule(function(t){var e=_uid("src"),n=Function.toString,r=(""+n).split("toString");_core.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,i,u){var o="function"==typeof i;o&&(_has(i,"name")||_hide(i,"name",n)),t[n]!==i&&(o&&(_has(i,e)||_hide(i,e,t[n]?""+t[n]:r.join(String(n)))),t===_global?t[n]=i:u?t[n]?t[n]=i:_hide(t,n,i):(delete t[n],_hide(t,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),_aFunction=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},_ctx=function(t,e,n){if(_aFunction(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},PROTOTYPE="prototype",$export=function(t,e,n){var r,i,u,o,s=t&$export.F,a=t&$export.G,l=t&$export.S,c=t&$export.P,h=t&$export.B,p=a?_global:l?_global[e]||(_global[e]={}):(_global[e]||{})[PROTOTYPE],f=a?_core:_core[e]||(_core[e]={}),d=f[PROTOTYPE]||(f[PROTOTYPE]={});a&&(n=e);for(r in n)u=((i=!s&&p&&void 0!==p[r])?p:n)[r],o=h&&i?_ctx(u,_global):c&&"function"==typeof u?_ctx(Function.call,u):u,p&&_redefine(p,r,u,t&$export.U),f[r]!=u&&_hide(f,r,o),c&&d[r]!=u&&(d[r]=u)};_global.core=_core,$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,$export.U=64,$export.R=128;var _export=$export,toString={}.toString,_cof=function(t){return toString.call(t).slice(8,-1)},_iobject=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==_cof(t)?t.split(""):Object(t)},_defined=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},_toObject=function(t){return Object(_defined(t))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(t){return isNaN(t=+t)?0:(t>0?floor:ceil)(t)},min=Math.min,_toLength=function(t){return t>0?min(_toInteger(t),9007199254740991):0},_isArray=Array.isArray||function(t){return"Array"==_cof(t)},SHARED="__core-js_shared__",store=_global[SHARED]||(_global[SHARED]={}),_shared=function(t){return store[t]||(store[t]={})},_wks=createCommonjsModule(function(t){var e=_shared("wks"),n=_global.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:_uid)("Symbol."+t))}).store=e}),SPECIES=_wks("species"),_arraySpeciesConstructor=function(t){var e;return _isArray(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!_isArray(e.prototype)||(e=void 0),_isObject(e)&&null===(e=e[SPECIES])&&(e=void 0)),void 0===e?Array:e},_arraySpeciesCreate=function(t,e){return new(_arraySpeciesConstructor(t))(e)},_arrayMethods=function(t,e){var n=1==t,r=2==t,i=3==t,u=4==t,o=6==t,s=5==t||o,a=e||_arraySpeciesCreate;return function(e,l,c){for(var h,p,f=_toObject(e),d=_iobject(f),_=_ctx(l,c,3),m=_toLength(d.length),v=0,g=n?a(e,m):r?a(e,0):void 0;m>v;v++)if((s||v in d)&&(h=d[v],p=_(h,v,f),t))if(n)g[v]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return v;case 2:g.push(h)}else if(u)return!1;return o?-1:i||u?u:g}},UNSCOPABLES=_wks("unscopables"),ArrayProto=Array.prototype;void 0==ArrayProto[UNSCOPABLES]&&_hide(ArrayProto,UNSCOPABLES,{});var _addToUnscopables=function(t){ArrayProto[UNSCOPABLES][t]=!0},$find=_arrayMethods(5),KEY="find",forced=!0;KEY in[]&&Array(1)[KEY](function(){forced=!1}),_export(_export.P+_export.F*forced,"Array",{find:function(t){return $find(this,t,arguments.length>1?arguments[1]:void 0)}}),_addToUnscopables(KEY);var _toIobject=function(t){return _iobject(_defined(t))},max=Math.max,min$1=Math.min,_toIndex=function(t,e){return(t=_toInteger(t))<0?max(t+e,0):min$1(t,e)},_arrayIncludes=function(t){return function(e,n,r){var i,u=_toIobject(e),o=_toLength(u.length),s=_toIndex(r,o);if(t&&n!=n){for(;o>s;)if((i=u[s++])!=i)return!0}else for(;o>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}},shared=_shared("keys"),_sharedKey=function(t){return shared[t]||(shared[t]=_uid(t))},arrayIndexOf=_arrayIncludes(!1),IE_PROTO=_sharedKey("IE_PROTO"),_objectKeysInternal=function(t,e){var n,r=_toIobject(t),i=0,u=[];for(n in r)n!=IE_PROTO&&_has(r,n)&&u.push(n);for(;e.length>i;)_has(r,n=e[i++])&&(~arrayIndexOf(u,n)||u.push(n));return u},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),_objectKeys=Object.keys||function(t){return _objectKeysInternal(t,_enumBugKeys)},_objectSap=function(t,e){var n=(_core.Object||{})[t]||Object[t],r={};r[t]=e(n),_export(_export.S+_export.F*_fails(function(){n(1)}),"Object",r)};_objectSap("keys",function(){return function(t){return _objectKeys(_toObject(t))}});var _stringRepeat=function(t){var e=String(_defined(this)),n="",r=_toInteger(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n};_export(_export.P,"String",{repeat:_stringRepeat});var _stringPad=function(t,e,n,r){var i=String(_defined(t)),u=i.length,o=void 0===n?" ":String(n),s=_toLength(e);if(s<=u||""==o)return i;var a=s-u,l=_stringRepeat.call(o,Math.ceil(a/o.length));return l.length>a&&(l=l.slice(0,a)),r?l+i:i+l};_export(_export.P,"String",{padStart:function(t){return _stringPad(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),_export(_export.P,"String",{padEnd:function(t){return _stringPad(this,t,arguments.length>1?arguments[1]:void 0,!1)}});var DIRECTION={NONE:0,LEFT:-1,RIGHT:1},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)},t.prototype.extractTail=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.extractInput(t,e)},t.prototype._appendTail=function(t){return!t||this._append(t)},t.prototype._append=function(t,e){for(var n=this.value.length,r=this.clone(),i=0;i0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e)},t.prototype.withValueRefresh=function(t){if(this._refreshing)return t();this._refreshing=!0;var e=this.isInitialized?this.unmaskedValue:null,n=t();return null!=e&&(this.unmaskedValue=e),delete this._refreshing,n},t.prototype.commit=function(){},createClass(t,[{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.reset(),this.appendWithTail(t),this.commit()}},{key:"unmaskedValue",get:function(){return this._unmask()},set:function(t){this.reset(),this._append(t),this.appendWithTail(""),this.commit()}},{key:"isComplete",get:function(){return!0}}]),t}(),_applyDecoratedDescriptor(_class.prototype,"mask",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class.prototype,"mask"),_class.prototype),_class),_class$2,MaskedNumber=(_class$2=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e),n=_extends({},e.DEFAULTS,n);var r=possibleConstructorReturn(this,t.call(this,n));delete r.isInitialized;var i=n,u=i.scale,o=i.radix,s=i.mapToRadix,a=i.min,l=i.max,c=i.signed,h=i.thousandsSeparator,p=i.postFormat;return r.min=a,r.max=l,r.scale=u,r.radix=o,r.mapToRadix=s,r.signed=c,r.thousandsSeparator=h,r.postFormat=p,r._updateNumberRegExp(),r.isInitialized=!0,r}return inherits(e,t),e.prototype._updateNumberRegExp=function(){var t="^",e="^";this.signed?(t+="([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))",e+="[+|\\-]?"):t+="(0|([1-9]+\\d*))",e+="\\d*",this.scale&&(t+="("+this.radix+"\\d{0,"+this.scale+"})?",e+="("+this.radix+"\\d{0,"+this.scale+"})?"),t+="$",e+="$",this._numberRegExpSoft=new RegExp(t),this._numberRegExp=new RegExp(e)},e.prototype.extractTail=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._removeThousandsSeparators(t.prototype.extractTail.call(this,e,n))},e.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")},e.prototype._insertThousandsSeparators=function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)},e.prototype._append=function(e,n){return t.prototype._append.call(this,this._removeThousandsSeparators(e.replace(this._mapToRadixRegExp,this.radix)),n)},e.prototype.appendWithTail=function(e,n){var r=this.value.length;this._value=this._removeThousandsSeparators(this.value);var i=r-this.value.length,u=t.prototype.appendWithTail.call(this,e,n);this._value=this._insertThousandsSeparators(this.value);var o=r+u-i;this._value=this._insertThousandsSeparators(this.value);for(var s=0,a=0;a<=o;++a)this.value[a]===this.thousandsSeparator&&(++s,++o);return u-i+s},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DIRECTION.LEFT;if(!e)return t;var n=indexInDirection(t,e);return this.value[n]===this.thousandsSeparator&&(t+=e),t},e.prototype._validate=function(e){var n=(e?this._numberRegExpSoft:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(n){var r=this.number;n=n&&!isNaN(r)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return n&&t.prototype._validate.call(this,e)},e.prototype.commit=function(){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=""+e);var n=this.value;this.postFormat.normalizeZeros&&(n=this._normalizeZeros(n)),this.postFormat.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n},e.prototype._normalizeZeros=function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,function(t,e,n,r){return e+r}),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))},e.prototype._padFractionalZeros=function(t){var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)},createClass(e,[{key:"number",get:function(){var t=this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix,".");return Number(t)},set:function(t){this.unmaskedValue=""+t}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}},{key:"scale",get:function(){return this._scale},set:function(t){this._scale=t}},{key:"radix",get:function(){return this._radix},set:function(t){this._radix=t,this._updateNumberRegExp()}},{key:"signed",get:function(){return this._signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0},set:function(t){this._signed=t}},{key:"postFormat",get:function(){return this._postFormat},set:function(t){this._postFormat=_extends({},e.DEFAULTS.postFormat,t)}},{key:"mapToRadix",get:function(){return this._mapToRadix},set:function(t){this._mapToRadix=t,this._mapToRadixRegExp=new RegExp("["+t.map(escapeRegExp).join("")+"]","g")}},{key:"thousandsSeparator",get:function(){return this._thousandsSeparator},set:function(t){this._thousandsSeparator=t,this._thousandsSeparatorRegExp=new RegExp(escapeRegExp(t),"g")}}]),e}(Masked),_applyDecoratedDescriptor$2(_class$2.prototype,"min",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"min"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"max",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"max"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"scale",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"scale"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"radix",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"radix"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"signed",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"signed"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"postFormat",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"postFormat"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"mapToRadix",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"mapToRadix"),_class$2.prototype),_applyDecoratedDescriptor$2(_class$2.prototype,"thousandsSeparator",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$2.prototype,"thousandsSeparator"),_class$2.prototype),_class$2);MaskedNumber.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,postFormat:{normalizeZeros:!0}};var PatternDefinition=function(){function t(e){classCallCheck(this,t),_extends(this,e),this.mask&&(this._masked=createMask(e))}return t.prototype.reset=function(){this.isHollow=!1,this._masked&&this._masked.reset()},t.prototype.resolve=function(t){return!!this._masked&&(this._masked.value=t,this._masked.value)},createClass(t,[{key:"isInput",get:function(){return this.type===t.TYPES.INPUT}},{key:"isHiddenHollow",get:function(){return this.isHollow&&this.optional}}]),t}();PatternDefinition.DEFAULTS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},PatternDefinition.TYPES={INPUT:"input",FIXED:"fixed"};var PatternGroup=function(){function t(e,n){var r=n.name,i=n.offset,u=n.mask,o=n.validate;classCallCheck(this,t),this.masked=e,this.name=r,this.offset=i,this.mask=u,this.validate=o||function(){return!0}}return t.prototype._validate=function(t){return this.validate(this.value,this,t)},createClass(t,[{key:"value",get:function(){return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}},{key:"unmaskedValue",get:function(){return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}}]),t}(),RangeGroup=function(){function t(e){var n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+"").length;classCallCheck(this,t),this._from=n,this._to=r,this._maxLength=i,this.validate=this.validate.bind(this),this._update()}return t.prototype._update=function(){this._maxLength=Math.max(this._maxLength,(this.to+"").length),this.mask="0".repeat(this._maxLength)},t.prototype.validate=function(t){var e="",n="",r=t.match(/^(\D*)(\d*)(\D*)/),i=r[1],u=r[2];return u&&(e="0".repeat(i.length)+u,n="9".repeat(i.length)+u),-1===t.search(/[^0]/)&&t.length<=this._matchFrom||(e=e.padEnd(this._maxLength,"0"),n=n.padEnd(this._maxLength,"9"),this.from<=Number(n)&&Number(e)<=this.to)},createClass(t,[{key:"to",get:function(){return this._to},set:function(t){this._to=t,this._update()}},{key:"from",get:function(){return this._from},set:function(t){this._from=t,this._update()}},{key:"maxLength",get:function(){return this._maxLength},set:function(t){this._maxLength=t,this._update()}},{key:"_matchFrom",get:function(){return this.maxLength-(this.from+"").length}}]),t}();PatternGroup.Range=RangeGroup,PatternGroup.Enum=EnumGroup;var _class$1,MaskedPattern=(_class$1=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e);var r=n.definitions,i=n.placeholder,u=n.groups,o=possibleConstructorReturn(this,t.call(this,n));return delete o.isInitialized,o.placeholder=i,o.definitions=r,o.groups=u,o.isInitialized=!0,o}return inherits(e,t),e.prototype._updateMask=function(){var t=this,n=this._definitions;this._charDefs=[],this._groupDefs=[];var r=this.mask;if(r&&n){var i=!1,u=!1,o=!1;t:for(var s=0;s=e)break;r.isHiddenHollow&&++e}return e}},e.prototype._unmask=function(){for(var t=this.value,e="",n=0,r=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this.value,r="",i=this.mapPosToDefIndex(e),u=t,o=this.mapPosToDefIndex(t);u0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,r=this.mapPosToDefIndex(e),i=this.mapPosToDefIndex(n),u=this._charDefs.map(function(t,e){return[t,e]}).slice(r,i).filter(function(t){return t[0].stopAlign}).map(function(t){return t[1]}),o=[r].concat(u,[i]);return o.map(function(e,n){return[u.indexOf(e)>=0?e:null,t.extractInput(t.mapDefIndexToPos(e),t.mapDefIndexToPos(o[++n]))]}).filter(function(t){var e=t[0],n=t[1];return null!=e||n})},e.prototype._appendPlaceholder=function(t){for(var e=t||this._charDefs.length,n=this.mapPosToDefIndex(this.value.length);n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e);var n=this.mapPosToDefIndex(t),r=this.mapPosToDefIndex(e);this._charDefs.slice(n,r).forEach(function(t){return t.reset()})},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:DIRECTION.LEFT;if(!e)return t;var n=this.mapPosToDefIndex(t),r=n,i=void 0,u=void 0,o=void 0,s=void 0;for(s=indexInDirection(r,e);0<=s&&s=this._charDefs.length)&&null!=i&&(r=i)}else null==u&&(r=null!=o?o:i);return this.mapDefIndexToPos(r)},e.prototype.group=function(t){return this.groupsByName(t)[0]},e.prototype.groupsByName=function(t){return this._groupDefs.filter(function(e){return e.name===t})},createClass(e,[{key:"placeholder",get:function(){return this._placeholder},set:function(t){this._placeholder=_extends({},e.DEFAULT_PLACEHOLDER,t)}},{key:"definitions",get:function(){return this._definitions},set:function(t){t=_extends({},PatternDefinition.DEFAULTS,t),this._definitions=t,this._updateMask()}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t,this._updateMask()}},{key:"isComplete",get:function(){var t=this;return!this._charDefs.some(function(e,n){return e.isInput&&!e.optional&&(e.isHollow||!t.extractInput(n,n+1))})}},{key:"groups",get:function(){return this._groups},set:function(t){this._groups=t,this._updateMask()}}]),e}(Masked),_applyDecoratedDescriptor$1(_class$1.prototype,"placeholder",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"placeholder"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"definitions",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"definitions"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"mask",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"mask"),_class$1.prototype),_applyDecoratedDescriptor$1(_class$1.prototype,"groups",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$1.prototype,"groups"),_class$1.prototype),_class$1);MaskedPattern.DEFAULT_PLACEHOLDER={lazy:!0,char:"_"},MaskedPattern.STOP_CHAR="`",MaskedPattern.ESCAPE_CHAR="\\",MaskedPattern.Definition=PatternDefinition,MaskedPattern.Group=PatternGroup;var _class$3,MaskedDate=(_class$3=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,e);var r=n.groups,i=n=_extends({},e.DEFAULTS,n),u=i.min,o=i.max,s=i.format,a=i.parse;n.groups=_extends({},e.DEFAULTS.groups),n.groups.Y&&(u&&(n.groups.Y.from=u.getFullYear()),o&&(n.groups.Y.to=o.getFullYear())),_extends(n.groups,r);var l=possibleConstructorReturn(this,t.call(this,n));return delete l.isInitialized,l.min=u,l.max=o,l.format=s,l.parse=a,l.isInitialized=!0,l}return inherits(e,t),e.prototype._validate=function(e){var n=t.prototype._validate.call(this,e),r=this.date;return n&&(!this.isComplete||this.isDateExist(this.value)&&r&&(null==this.min||this.min<=r)&&(null==this.max||r<=this.max))},e.prototype.isDateExist=function(t){return this.format(this.parse(t))===t},createClass(e,[{key:"date",get:function(){return this.isComplete?this.parse(this.value):null},set:function(t){this.value=this.format(t)}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}}]),e}(MaskedPattern),_applyDecoratedDescriptor$3(_class$3.prototype,"min",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$3.prototype,"min"),_class$3.prototype),_applyDecoratedDescriptor$3(_class$3.prototype,"max",[refreshValueOnSet],Object.getOwnPropertyDescriptor(_class$3.prototype,"max"),_class$3.prototype),_class$3);MaskedDate.DEFAULTS={mask:"d{.}`m{.}`Y",format:function(t){return[(""+t.getDate()).padStart(2,"0"),(""+(t.getMonth()+1)).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=t.split("."),n=e[0],r=e[1],i=e[2];return new Date(i,r-1,n)},groups:{d:new PatternGroup.Range([1,31]),m:new PatternGroup.Range([1,12]),Y:new PatternGroup.Range([1900,9999])}};var ActionDetails=function(){function t(e,n,r,i){classCallCheck(this,t),this.value=e,this.cursorPos=n,this.oldValue=r,this.oldSelection=i}return createClass(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return this.removedCount&&(this.oldSelection.end===this.cursorPos||this.insertedCount?DIRECTION.RIGHT:DIRECTION.LEFT)}}]),t}(),InputMask=function(){function t(e,n){classCallCheck(this,t),this.el=e,this.masked=createMask(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._alignCursor=this._alignCursor.bind(this),this._alignCursorFriendly=this._alignCursorFriendly.bind(this),this.bindEvents(),this.updateValue(),this._onChange()}return t.prototype.bindEvents=function(){this.el.addEventListener("keydown",this._saveSelection),this.el.addEventListener("input",this._onInput),this.el.addEventListener("drop",this._onDrop),this.el.addEventListener("click",this._alignCursorFriendly),this.el.addEventListener("change",this._onChange)},t.prototype.unbindEvents=function(){this.el.removeEventListener("keydown",this._saveSelection),this.el.removeEventListener("input",this._onInput),this.el.removeEventListener("drop",this._onDrop),this.el.removeEventListener("click",this._alignCursorFriendly),this.el.removeEventListener("change",this._onChange)},t.prototype.fireEvent=function(t){(this._listeners[t]||[]).forEach(function(t){return t()})},t.prototype._saveSelection=function(){this.value!==this.el.value&&console.warn("Uncontrolled input change, refresh mask manually!"),this._selection={start:this.selectionStart,end:this.cursorPos}},t.prototype.updateValue=function(){this.masked.value=this.el.value},t.prototype.updateControl=function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()},t.prototype.updateOptions=function(t){var e=this,n=t.mask;n&&(this.mask=n),this.masked.withValueRefresh(function(){for(var n in t)"mask"!==n&&(e.masked[n]=t[n])}),this.updateControl()},t.prototype.updateCursor=function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))},t.prototype._delayUpdateCursor=function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(function(){e.cursorPos=e._changingCursorPos,e._abortUpdateCursor()},10)},t.prototype._fireChangeEvents=function(){this.fireEvent("accept"),this.masked.isComplete&&this.fireEvent("complete")},t.prototype._abortUpdateCursor=function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)},t.prototype._alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos)},t.prototype._alignCursorFriendly=function(){this.selectionStart===this.cursorPos&&this._alignCursor()},t.prototype.on=function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this},t.prototype.off=function(t,e){if(this._listeners[t]){if(e){var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners.splice(n,1),this}delete this._listeners[t]}},t.prototype._onInput=function(){this._abortUpdateCursor();var t=new ActionDetails(this.el.value,this.cursorPos,this.value,this._selection),e=t.startChangePos+t.removed.length,n=this.masked.extractTail(e),r=this.masked.nearestInputPos(t.startChangePos,t.removeDirection);this.masked.clear(r);var i=this.masked.appendWithTail(t.inserted,n),u=this.masked.nearestInputPos(r+i,t.removeDirection);this.updateControl(),this.updateCursor(u)},t.prototype._onChange=function(){this.value!==this.el.value&&this.updateValue(),this.masked.commit(),this.updateControl()},t.prototype._onDrop=function(t){t.preventDefault(),t.stopPropagation()},t.prototype.destroy=function(){this.unbindEvents(),this._listeners.length=0},createClass(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if((void 0===t?"undefined":_typeof(t))!==_typeof(this.masked.mask)){var e=this.masked?this.masked.unmaskedValue:null;this.masked=createMask({mask:t}),null!=e&&(this.masked.unmaskedValue=e)}else this.masked.mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this._alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this._alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el===document.activeElement&&(this.el.setSelectionRange(t,t),this._saveSelection())}}]),t}();IMask$1.InputMask=InputMask,IMask$1.Masked=Masked,IMask$1.MaskedPattern=MaskedPattern,IMask$1.MaskedNumber=MaskedNumber,IMask$1.MaskedDate=MaskedDate,window.IMask=IMask$1;export default IMask$1; //# sourceMappingURL=imask.min.es.js.map diff --git a/dist/imask.min.es.js.map b/dist/imask.min.es.js.map index 4856800d..829b79ea 100644 --- a/dist/imask.min.es.js.map +++ b/dist/imask.min.es.js.map @@ -1 +1 @@ -{"version":3,"file":"imask.min.es.js","sources":["../src/core/utils.js","../src/masked/factory.js","../src/masked/pattern/group.js","../src/imask.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/masked/base.js","../src/masked/pattern/definition.js","../src/masked/pattern.js","../src/masked/number.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js"],"sourcesContent":["export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {isString} from '../core/utils';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof IMask.Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new IMask.Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof IMask.Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new IMask.MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new IMask.Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new IMask.Masked(opts);\r\n}\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n"],"names":["isString","str","String","conform","res","fallback","indexInDirection","pos","direction","DIRECTION","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","this","withValueRefresh","bind","escapeRegExp","replace","createMask","opts","mask","babelHelpers.extends","IMask","Masked","RegExp","validate","value","test","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","EnumGroup","enums","repeat","length","group","some","e","indexOf","unmaskedValue","el","InputMask","global","module","window","Math","self","__g","core","version","__e","it","isObject","TypeError","exec","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","object","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","that","aFunction","b","c","apply","arguments","PROTOTYPE","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","defined","ceil","floor","isNaN","min","toInteger","Array","isArray","arg","SHARED","store","Symbol","USE_SYMBOL","uid","SPECIES","original","C","constructor","speciesConstructor","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","asc","$this","callbackfn","toObject","IObject","toLength","index","result","push","UNSCOPABLES","ArrayProto","$find","KEY","forced","find","max","IS_INCLUDES","fromIndex","toIObject","toIndex","shared","arrayIndexOf","IE_PROTO","names","i","keys","$keys","enumBugKeys","fails","count","n","Infinity","RangeError","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padStart","$pad","padEnd","_value","isInitialized","_validate","soft","clone","m","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","_unmask","clear","from","to","_refreshing","unmasked","ret","commit","_mask","PatternDefinition","_masked","isHollow","resolve","TYPES","INPUT","optional","DEFAULTS","PatternGroup","masked","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","match","placeholder","num","search","_matchFrom","Range","Enum","definitions","groups","_Masked","_this","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_this2","_groups","p","gNames","filter","gName","sort","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","_this3","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","map","stops","s","_this4","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","_this5","Definition","Group","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","valid","number","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","_thousandsSeparator","format","parse","Y","getFullYear","_MaskedPattern","date","isComplete","isDateExist","getDate","getMonth","day","month","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange"],"mappings":"kFACA,SAASA,SAAUC,SACK,iBAARA,GAAoBA,aAAeC,OAGnD,SACSC,QAASC,EAAKH,OAAKI,yDAAS,UAC5BL,SAASI,GACdA,EACAA,EACEH,EACAI,EAUN,SACSC,iBAAkBC,EAAKC,UAC1BA,IAAcC,UAAUC,QAAQH,EAC7BA,EAGT,SACSI,kBAAmBC,EAAQC,EAAKC,OACjCC,EAASD,EAAWE,MACfA,IAAM,sCAAaC,gDACrBC,KAAKC,iBAAiBJ,EAAOK,cAAKF,aAASD,MAItD,SACSI,aAAapB,UACbA,EAAIqB,QAAQ,8BAA+B,scCjCpD,SAASC,WAAYC,OAGbC,KAFCC,YAAkBF,IAEPC,YAEdA,aAAgBE,MAAMC,OACjBH,EAELA,aAAgBI,UACbC,SAAW,SAACC,UAAUN,EAAKO,KAAKD,IAC9B,IAAIJ,MAAMC,OAAOJ,IAEtBxB,SAASyB,GACJ,IAAIE,MAAMM,cAAcT,GAE7BC,EAAKS,qBAAqBP,MAAMC,eA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zY,KAAKa,QAAUb,KAAKiC,GAAGpB,YACpBiY,mBAEF9J,OAAOX,cACPkL,6BAGPb,iBAASS,KACJ4B,mBACAC,+BAGLC,wBACOjC,oBACAX,WAAW1W,OAAS,oDAlNN3B,KAAKgP,OAAOzO,mBACvBA,gBACGA,sBAAAA,cAAgBP,KAAKgP,OAAOzO,WAKjC4N,EAAWnO,KAAKgP,OAAShP,KAAKgP,OAAOhN,cAAgB,UACtDgN,OAAS3O,YAAYE,SACV,MAAZ4N,IAAkBnO,KAAKgP,OAAOhN,cAAgBmM,aAN3Ca,OAAOzO,KAAOA,uCAUdP,KAAKsM,qBAGHvN,QACJiQ,OAAOnO,MAAQ9B,OACfwa,qBACAZ,4DAIE3Y,KAAKsY,6BAGKvZ,QACZiQ,OAAOhN,cAAgBjD,OACvBwa,qBACAZ,6DAyBE3Y,KAAKka,gBACVla,KAAKia,mBAELja,KAAKiC,GAAGqX,wDAIHtZ,KAAKka,gBACVla,KAAKia,mBAELja,KAAKiC,GAAGiZ,2BAGG7b,GACTW,KAAKiC,KAAOoB,SAAS8X,qBAEpBlZ,GAAGmZ,kBAAkB/b,EAAKA,QAC1BkZ,2BrD7ET9X,QAAMyB,UAAYA,UAElBzB,QAAMC,OAASA,OACfD,QAAMM,cAAgBA,cACtBN,QAAMS,aAAeA,aACrBT,QAAMY,WAAaA,WAEnBgB,OAAO5B,MAAQA"} \ No newline at end of file +{"version":3,"file":"imask.min.es.js","sources":["../src/core/utils.js","../src/masked/factory.js","../src/masked/pattern/group.js","../src/imask.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/masked/base.js","../src/masked/number.js","../src/masked/pattern/definition.js","../src/masked/pattern.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js"],"sourcesContent":["export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {isString} from '../core/utils';\r\nimport Masked from './base';\r\nimport MaskedNumber from './number';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new Masked(opts);\r\n}\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09B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A5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n"],"names":["isString","str","String","conform","res","fallback","indexInDirection","pos","direction","DIRECTION","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","this","withValueRefresh","bind","escapeRegExp","replace","createMask","opts","mask","babelHelpers.extends","Masked","RegExp","validate","value","test","IMask","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","EnumGroup","enums","repeat","length","group","some","e","indexOf","unmaskedValue","el","InputMask","global","module","window","Math","self","__g","core","version","__e","it","isObject","TypeError","exec","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","object","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","that","aFunction","b","c","apply","arguments","PROTOTYPE","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","defined","ceil","floor","isNaN","min","toInteger","Array","isArray","arg","SHARED","store","Symbol","USE_SYMBOL","uid","SPECIES","original","C","constructor","speciesConstructor","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","asc","$this","callbackfn","toObject","IObject","toLength","index","result","push","UNSCOPABLES","ArrayProto","$find","KEY","forced","find","max","IS_INCLUDES","fromIndex","toIObject","toIndex","shared","arrayIndexOf","IE_PROTO","names","i","keys","$keys","enumBugKeys","fails","count","n","Infinity","RangeError","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padStart","$pad","padEnd","_value","isInitialized","_validate","soft","clone","m","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","_unmask","clear","from","to","_refreshing","unmasked","ret","commit","_mask","DEFAULTS","_Masked","_this","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","valid","number","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","match","sign","zeros","num","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","map","_thousandsSeparator","PatternDefinition","_masked","isHollow","resolve","TYPES","INPUT","optional","PatternGroup","masked","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","placeholder","search","_matchFrom","Range","Enum","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_this2","_groups","p","gNames","filter","gName","sort","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","_this3","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","stops","s","_this4","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","_this5","Definition","Group","format","parse","Y","getFullYear","_MaskedPattern","date","isComplete","isDateExist","getDate","getMonth","day","month","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange"],"mappings":"kFACA,SAASA,SAAUC,SACK,iBAARA,GAAoBA,aAAeC,OAGnD,SACSC,QAASC,EAAKH,OAAKI,yDAAS,UAC5BL,SAASI,GACdA,EACAA,EACEH,EACAI,EAUN,SACSC,iBAAkBC,EAAKC,UAC1BA,IAAcC,UAAUC,QAAQH,EAC7BA,EAGT,SACSI,kBAAmBC,EAAQC,EAAKC,OACjCC,EAASD,EAAWE,MACfA,IAAM,sCAAaC,gDACrBC,KAAKC,iBAAiBJ,EAAOK,cAAKF,aAASD,MAItD,SACSI,aAAapB,UACbA,EAAIqB,QAAQ,8BAA+B,s4BC/BpD,SAASC,WAAYC,OAGbC,KAFCC,YAAkBF,IAEPC,YAEdA,aAAgBE,OACXF,EAELA,aAAgBG,UACbC,SAAW,SAACC,UAAUL,EAAKM,KAAKD,IAC9B,IAAIH,OAAOH,IAEhBxB,SAASyB,GACJ,IAAIO,MAAMC,cAAcT,GAE7BC,EAAKS,qBAAqBP,eACrBH,EAAKC,KACL,IAAIA,EAAK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kL,6BAGPb,iBAASS,KACJ4B,mBACAC,+BAGLC,wBACOjC,oBACAX,WAAW1W,OAAS,oDAlNN3B,KAAK4R,OAAOrR,mBACvBA,gBACGA,sBAAAA,cAAgBP,KAAK4R,OAAOrR,WAKjC4N,EAAWnO,KAAK4R,OAAS5R,KAAK4R,OAAO5P,cAAgB,UACtD4P,OAASvR,YAAYE,SACV,MAAZ4N,IAAkBnO,KAAK4R,OAAO5P,cAAgBmM,aAN3CyD,OAAOrR,KAAOA,uCAUdP,KAAKsM,qBAGHvN,QACJ6S,OAAOhR,MAAQ7B,OACfwa,qBACAZ,4DAIE3Y,KAAKsY,6BAGKvZ,QACZ6S,OAAO5P,cAAgBjD,OACvBwa,qBACAZ,6DAyBE3Y,KAAKka,gBACVla,KAAKia,mBAELja,KAAKiC,GAAGqX,wDAIHtZ,KAAKka,gBACVla,KAAKia,mBAELja,KAAKiC,GAAGiZ,2BAGG7b,GACTW,KAAKiC,KAAOoB,SAAS8X,qBAEpBlZ,GAAGmZ,kBAAkB/b,EAAKA,QAC1BkZ,2BrD7ETzX,QAAMoB,UAAYA,UAElBpB,QAAML,OAASA,OACfK,QAAMC,cAAgBA,cACtBD,QAAMI,aAAeA,aACrBJ,QAAMO,WAAaA,WAEnBgB,OAAOvB,MAAQA"} \ No newline at end of file diff --git a/dist/imask.min.js b/dist/imask.min.js index ceb3fddf..26d942d6 100644 --- a/dist/imask.min.js +++ b/dist/imask.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.IMask=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t){return"string"==typeof t||t instanceof String}function n(t,n){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e(t)?t:t?n:u}function u(t,e){return e===mt.LEFT&&--t,t}function i(t,e,n){var u=n.set;n.set=function(){for(var t=arguments.length,e=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return new Ot(t,e)}var p=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),c=t(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),f=function(t){return"object"==typeof t?null!==t:"function"==typeof t},d=function(t){if(!f(t))throw TypeError(t+" is not an object!");return t},v=function(t){try{return!!t()}catch(t){return!0}},m=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),g=p.document,y=f(g)&&f(g.createElement),A=function(t){return y?g.createElement(t):{}},_=!m&&!v(function(){return 7!=Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a}),F=function(t,e){if(!f(t))return t;var n,u;if(e&&"function"==typeof(n=t.toString)&&!f(u=n.call(t)))return u;if("function"==typeof(n=t.valueOf)&&!f(u=n.call(t)))return u;if(!e&&"function"==typeof(n=t.toString)&&!f(u=n.call(t)))return u;throw TypeError("Can't convert object to primitive value")},D=Object.defineProperty,C={f:m?Object.defineProperty:function(t,e,n){if(d(t),e=F(e,!0),d(n),_)try{return D(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},E=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=m?function(t,e,n){return C.f(t,e,E(1,n))}:function(t,e,n){return t[e]=n,t},B={}.hasOwnProperty,b=function(t,e){return B.call(t,e)},x=0,P=Math.random(),T=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++x+P).toString(36))},w=t(function(t){var e=T("src"),n=Function.toString,u=(""+n).split("toString");c.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,i,r){var o="function"==typeof i;o&&(b(i,"name")||k(i,"name",n)),t[n]!==i&&(o&&(b(i,e)||k(i,e,t[n]?""+t[n]:u.join(String(n)))),t===p?t[n]=i:r?t[n]?t[n]=i:k(t,n,i):(delete t[n],k(t,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),S=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},I=function(t,e,n){if(S(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,u){return t.call(e,n,u)};case 3:return function(n,u,i){return t.call(e,n,u,i)}}return function(){return t.apply(e,arguments)}},O=function(t,e,n){var u,i,r,o,s=t&O.F,a=t&O.G,h=t&O.S,l=t&O.P,f=t&O.B,d=a?p:h?p[e]||(p[e]={}):(p[e]||{}).prototype,v=a?c:c[e]||(c[e]={}),m=v.prototype||(v.prototype={});a&&(n=e);for(u in n)r=((i=!s&&d&&void 0!==d[u])?d:n)[u],o=f&&i?I(r,p):l&&"function"==typeof r?I(Function.call,r):r,d&&w(d,u,r,t&O.U),v[u]!=r&&k(v,u,o),l&&m[u]!=r&&(m[u]=r)};p.core=c,O.F=1,O.G=2,O.S=4,O.P=8,O.B=16,O.W=32,O.U=64,O.R=128;var j=O,R={}.toString,M=function(t){return R.call(t).slice(8,-1)},L=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==M(t)?t.split(""):Object(t)},z=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},H=function(t){return Object(z(t))},U=Math.ceil,V=Math.floor,N=function(t){return isNaN(t=+t)?0:(t>0?V:U)(t)},Y=Math.min,Z=function(t){return t>0?Y(N(t),9007199254740991):0},W=Array.isArray||function(t){return"Array"==M(t)},$=p["__core-js_shared__"]||(p["__core-js_shared__"]={}),G=function(t){return $[t]||($[t]={})},X=t(function(t){var e=G("wks"),n=p.Symbol,u="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=u&&n[t]||(u?n:T)("Symbol."+t))}).store=e}),q=X("species"),J=function(t){var e;return W(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!W(e.prototype)||(e=void 0),f(e)&&null===(e=e[q])&&(e=void 0)),void 0===e?Array:e},K=function(t,e){return new(J(t))(e)},Q=X("unscopables"),tt=Array.prototype;void 0==tt[Q]&&k(tt,Q,{});var et=function(t,e){var n=1==t,u=2==t,i=3==t,r=4==t,o=6==t,s=5==t||o,a=e||K;return function(e,h,l){for(var p,c,f=H(e),d=L(f),v=I(h,l,3),m=Z(d.length),g=0,y=n?a(e,m):u?a(e,0):void 0;m>g;g++)if((s||g in d)&&(p=d[g],c=v(p,g,f),t))if(n)y[g]=c;else if(c)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:y.push(p)}else if(r)return!1;return o?-1:i||r?r:y}}(5),nt=!0;"find"in[]&&Array(1).find(function(){nt=!1}),j(j.P+j.F*nt,"Array",{find:function(t){return et(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){tt[Q][t]=!0}("find");var ut=function(t){return L(z(t))},it=Math.max,rt=Math.min,ot=function(t,e){return(t=N(t))<0?it(t+e,0):rt(t,e)},st=G("keys"),at=function(t){return function(e,n,u){var i,r=ut(e),o=Z(r.length),s=ot(u,o);if(t&&n!=n){for(;o>s;)if((i=r[s++])!=i)return!0}else for(;o>s;s++)if((t||s in r)&&r[s]===n)return t||s||0;return!t&&-1}}(!1),ht=function(t){return st[t]||(st[t]=T(t))}("IE_PROTO"),lt=function(t,e){var n,u=ut(t),i=0,r=[];for(n in u)n!=ht&&b(u,n)&&r.push(n);for(;e.length>i;)b(u,n=e[i++])&&(~at(r,n)||r.push(n));return r},pt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ct=Object.keys||function(t){return lt(t,pt)};!function(t,e){var n=(c.Object||{})[t]||Object[t],u={};u[t]=e(n),j(j.S+j.F*v(function(){n(1)}),"Object",u)}("keys",function(){return function(t){return ct(H(t))}});var ft=function(t){var e=String(z(this)),n="",u=N(t);if(u<0||u==1/0)throw RangeError("Count can't be negative");for(;u>0;(u>>>=1)&&(e+=e))1&u&&(n+=e);return n};j(j.P,"String",{repeat:ft});var dt=function(t,e,n,u){var i=String(z(t)),r=i.length,o=void 0===n?" ":String(n),s=Z(e);if(s<=r||""==o)return i;var a=s-r,h=ft.call(o,Math.ceil(a/o.length));return h.length>a&&(h=h.slice(0,a)),u?h+i:i+h};j(j.P,"String",{padStart:function(t){return dt(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),j(j.P,"String",{padEnd:function(t){return dt(this,t,arguments.length>1?arguments[1]:void 0,!1)}});var vt,mt={NONE:0,LEFT:-1,RIGHT:1},gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},At=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)},t.prototype.extractTail=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.extractInput(t,e)},t.prototype._appendTail=function(t){return!t||this._append(t)},t.prototype._append=function(t,e){for(var n=this.value.length,u=this.clone(),i=0;i0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e)},t.prototype.withValueRefresh=function(t){if(this._refreshing)return t();this._refreshing=!0;var e=this.isInitialized?this.unmaskedValue:null,n=t();return null!=e&&(this.unmaskedValue=e),delete this._refreshing,n},t.prototype.commit=function(){},At(t,[{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.reset(),this.appendWithTail(t),this.commit()}},{key:"unmaskedValue",get:function(){return this._unmask()},set:function(t){this.reset(),this._append(t),this.appendWithTail(""),this.commit()}},{key:"isComplete",get:function(){return!0}}]),t}(),function(t,e,n,u,i){var r={};Object.keys(u).forEach(function(t){r[t]=u[t]}),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce(function(n,u){return u(t,e,n)||n},r),i&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(i):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null)}(vt.prototype,"mask",[i],Object.getOwnPropertyDescriptor(vt.prototype,"mask"),vt.prototype),vt),Et=function(){function t(e){yt(this,t),_t(this,e),this.mask&&(this._masked=o(e))}return t.prototype.reset=function(){this.isHollow=!1,this._masked&&this._masked.reset()},t.prototype.resolve=function(t){return!!this._masked&&(this._masked.value=t,this._masked.value)},At(t,[{key:"isInput",get:function(){return this.type===t.TYPES.INPUT}},{key:"isHiddenHollow",get:function(){return this.isHollow&&this.optional}}]),t}();Et.DEFAULTS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},Et.TYPES={INPUT:"input",FIXED:"fixed"};var kt=function(){function t(e,n){var u=n.name,i=n.offset,r=n.mask,o=n.validate;yt(this,t),this.masked=e,this.name=u,this.offset=i,this.mask=r,this.validate=o||function(){return!0}}return t.prototype._validate=function(t){return this.validate(this.value,this,t)},At(t,[{key:"value",get:function(){return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}},{key:"unmaskedValue",get:function(){return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}}]),t}(),Bt=function(){function t(e){var n=e[0],u=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(u+"").length;yt(this,t),this._from=n,this._to=u,this._maxLength=i,this.validate=this.validate.bind(this),this._update()}return t.prototype._update=function(){this._maxLength=Math.max(this._maxLength,(this.to+"").length),this.mask="0".repeat(this._maxLength)},t.prototype.validate=function(t){var e="",n="",u=t.match(/^(\D*)(\d*)(\D*)/),i=u[1],r=u[2];return r&&(e="0".repeat(i.length)+r,n="9".repeat(i.length)+r),-1===t.search(/[^0]/)&&t.length<=this._matchFrom||(e=e.padEnd(this._maxLength,"0"),n=n.padEnd(this._maxLength,"9"),this.from<=Number(n)&&Number(e)<=this.to)},At(t,[{key:"to",get:function(){return this._to},set:function(t){this._to=t,this._update()}},{key:"from",get:function(){return this._from},set:function(t){this._from=t,this._update()}},{key:"maxLength",get:function(){return this._maxLength},set:function(t){this._maxLength=t,this._update()}},{key:"_matchFrom",get:function(){return this.maxLength-(this.from+"").length}}]),t}();kt.Range=Bt,kt.Enum=function(t){return{mask:"*".repeat(t[0].length),validate:function(e,n){return t.some(function(t){return t.indexOf(n.unmaskedValue)>=0})}}};var bt,xt=(bt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yt(this,e);var u=n.definitions,i=n.placeholder,r=n.groups,o=Dt(this,t.call(this,n));return delete o.isInitialized,o.placeholder=i,o.definitions=u,o.groups=r,o.isInitialized=!0,o}return Ft(e,t),e.prototype._updateMask=function(){var t=this,n=this._definitions;this._charDefs=[],this._groupDefs=[];var u=this.mask;if(u&&n){var i=!1,r=!1,o=!1;t:for(var s=0;s=e)break;u.isHiddenHollow&&++e}return e}},e.prototype._unmask=function(){for(var t=this.value,e="",n=0,u=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this.value,u="",i=this.mapPosToDefIndex(e),r=t,o=this.mapPosToDefIndex(t);r0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=this.mapPosToDefIndex(e),i=this.mapPosToDefIndex(n),r=this._charDefs.map(function(t,e){return[t,e]}).slice(u,i).filter(function(t){return t[0].stopAlign}).map(function(t){return t[1]}),o=[u].concat(r,[i]);return o.map(function(e,n){return[r.indexOf(e)>=0?e:null,t.extractInput(t.mapDefIndexToPos(e),t.mapDefIndexToPos(o[++n]))]}).filter(function(t){var e=t[0],n=t[1];return null!=e||n})},e.prototype._appendPlaceholder=function(t){for(var e=t||this._charDefs.length,n=this.mapPosToDefIndex(this.value.length);n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e);var n=this.mapPosToDefIndex(t),u=this.mapPosToDefIndex(e);this._charDefs.slice(n,u).forEach(function(t){return t.reset()})},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt.LEFT;if(!e)return t;var n=this.mapPosToDefIndex(t),i=n,r=void 0,o=void 0,s=void 0,a=void 0;for(a=u(i,e);0<=a&&a=this._charDefs.length)&&null!=r&&(i=r)}else null==o&&(i=null!=s?s:r);return this.mapDefIndexToPos(i)},e.prototype.group=function(t){return this.groupsByName(t)[0]},e.prototype.groupsByName=function(t){return this._groupDefs.filter(function(e){return e.name===t})},At(e,[{key:"placeholder",get:function(){return this._placeholder},set:function(t){this._placeholder=_t({},e.DEFAULT_PLACEHOLDER,t)}},{key:"definitions",get:function(){return this._definitions},set:function(t){t=_t({},Et.DEFAULTS,t),this._definitions=t,this._updateMask()}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t,this._updateMask()}},{key:"isComplete",get:function(){var t=this;return!this._charDefs.some(function(e,n){return e.isInput&&!e.optional&&(e.isHollow||!t.extractInput(n,n+1))})}},{key:"groups",get:function(){return this._groups},set:function(t){this._groups=t,this._updateMask()}}]),e}(Ct),s(bt.prototype,"placeholder",[i],Object.getOwnPropertyDescriptor(bt.prototype,"placeholder"),bt.prototype),s(bt.prototype,"definitions",[i],Object.getOwnPropertyDescriptor(bt.prototype,"definitions"),bt.prototype),s(bt.prototype,"mask",[i],Object.getOwnPropertyDescriptor(bt.prototype,"mask"),bt.prototype),s(bt.prototype,"groups",[i],Object.getOwnPropertyDescriptor(bt.prototype,"groups"),bt.prototype),bt);xt.DEFAULT_PLACEHOLDER={lazy:!0,char:"_"},xt.STOP_CHAR="`",xt.ESCAPE_CHAR="\\",xt.Definition=Et,xt.Group=kt;var Pt,Tt=(Pt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yt(this,e),n=_t({},e.DEFAULTS,n);var u=Dt(this,t.call(this,n));delete u.isInitialized;var i=n,r=i.scale,o=i.radix,s=i.mapToRadix,a=i.min,h=i.max,l=i.signed,p=i.thousandsSeparator,c=i.postFormat;return u.min=a,u.max=h,u.scale=r,u.radix=o,u.mapToRadix=s,u.signed=l,u.thousandsSeparator=p,u.postFormat=c,u._updateNumberRegExp(),u.isInitialized=!0,u}return Ft(e,t),e.prototype._updateNumberRegExp=function(){var t="^",e="^";this.signed?(t+="([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))",e+="[+|\\-]?"):t+="(0|([1-9]+\\d*))",e+="\\d*",this.scale&&(t+="("+this.radix+"\\d{0,"+this.scale+"})?",e+="("+this.radix+"\\d{0,"+this.scale+"})?"),t+="$",e+="$",this._numberRegExpSoft=new RegExp(t),this._numberRegExp=new RegExp(e)},e.prototype.extractTail=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._removeThousandsSeparators(t.prototype.extractTail.call(this,e,n))},e.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")},e.prototype._insertThousandsSeparators=function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)},e.prototype._append=function(e,n){return t.prototype._append.call(this,this._removeThousandsSeparators(e.replace(this._mapToRadixRegExp,this.radix)),n)},e.prototype.appendWithTail=function(e,n){var u=this.value.length;this._value=this._removeThousandsSeparators(this.value);var i=u-this.value.length,r=t.prototype.appendWithTail.call(this,e,n);this._value=this._insertThousandsSeparators(this.value);var o=u+r-i;this._value=this._insertThousandsSeparators(this.value);for(var s=0,a=0;a<=o;++a)this.value[a]===this.thousandsSeparator&&(++s,++o);return r-i+s},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mt.LEFT;if(!e)return t;var n=u(t,e);return this.value[n]===this.thousandsSeparator&&(t+=e),t},e.prototype._validate=function(e){var n=(e?this._numberRegExpSoft:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(n){var u=this.number;n=n&&!isNaN(u)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return n&&t.prototype._validate.call(this,e)},e.prototype.commit=function(){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=""+e);var n=this.value;this.postFormat.normalizeZeros&&(n=this._normalizeZeros(n)),this.postFormat.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n},e.prototype._normalizeZeros=function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,function(t,e,n,u){return e+u}),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))},e.prototype._padFractionalZeros=function(t){var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)},At(e,[{key:"number",get:function(){var t=this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix,".");return Number(t)},set:function(t){this.unmaskedValue=""+t}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}},{key:"scale",get:function(){return this._scale},set:function(t){this._scale=t}},{key:"radix",get:function(){return this._radix},set:function(t){this._radix=t,this._updateNumberRegExp()}},{key:"signed",get:function(){return this._signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0},set:function(t){this._signed=t}},{key:"postFormat",get:function(){return this._postFormat},set:function(t){this._postFormat=_t({},e.DEFAULTS.postFormat,t)}},{key:"mapToRadix",get:function(){return this._mapToRadix},set:function(t){this._mapToRadix=t,this._mapToRadixRegExp=new RegExp("["+t.map(r).join("")+"]","g")}},{key:"thousandsSeparator",get:function(){return this._thousandsSeparator},set:function(t){this._thousandsSeparator=t,this._thousandsSeparatorRegExp=new RegExp(r(t),"g")}}]),e}(Ct),a(Pt.prototype,"min",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"min"),Pt.prototype),a(Pt.prototype,"max",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"max"),Pt.prototype),a(Pt.prototype,"scale",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"scale"),Pt.prototype),a(Pt.prototype,"radix",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"radix"),Pt.prototype),a(Pt.prototype,"signed",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"signed"),Pt.prototype),a(Pt.prototype,"postFormat",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"postFormat"),Pt.prototype),a(Pt.prototype,"mapToRadix",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"mapToRadix"),Pt.prototype),a(Pt.prototype,"thousandsSeparator",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"thousandsSeparator"),Pt.prototype),Pt);Tt.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,postFormat:{normalizeZeros:!0}};var wt,St=(wt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};yt(this,e);var u=n.groups,i=n=_t({},e.DEFAULTS,n),r=i.min,o=i.max,s=i.format,a=i.parse;n.groups=_t({},e.DEFAULTS.groups),n.groups.Y&&(r&&(n.groups.Y.from=r.getFullYear()),o&&(n.groups.Y.to=o.getFullYear())),_t(n.groups,u);var h=Dt(this,t.call(this,n));return delete h.isInitialized,h.min=r,h.max=o,h.format=s,h.parse=a,h.isInitialized=!0,h}return Ft(e,t),e.prototype._validate=function(e){var n=t.prototype._validate.call(this,e),u=this.date;return n&&(!this.isComplete||this.isDateExist(this.value)&&u&&(null==this.min||this.min<=u)&&(null==this.max||u<=this.max))},e.prototype.isDateExist=function(t){return this.format(this.parse(t))===t},At(e,[{key:"date",get:function(){return this.isComplete?this.parse(this.value):null},set:function(t){this.value=this.format(t)}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}}]),e}(xt),h(wt.prototype,"min",[i],Object.getOwnPropertyDescriptor(wt.prototype,"min"),wt.prototype),h(wt.prototype,"max",[i],Object.getOwnPropertyDescriptor(wt.prototype,"max"),wt.prototype),wt);St.DEFAULTS={mask:"d{.}`m{.}`Y",format:function(t){return[(""+t.getDate()).padStart(2,"0"),(""+(t.getMonth()+1)).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=t.split("."),n=e[0],u=e[1],i=e[2];return new Date(i,u-1,n)},groups:{d:new kt.Range([1,31]),m:new kt.Range([1,12]),Y:new kt.Range([1900,9999])}};var It=function(){function t(e,n,u,i){yt(this,t),this.value=e,this.cursorPos=n,this.oldValue=u,this.oldSelection=i}return At(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return this.removedCount&&(this.oldSelection.end===this.cursorPos||this.insertedCount?mt.RIGHT:mt.LEFT)}}]),t}(),Ot=function(){function t(e,n){yt(this,t),this.el=e,this.masked=o(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._alignCursor=this._alignCursor.bind(this),this._alignCursorFriendly=this._alignCursorFriendly.bind(this),this.bindEvents(),this.updateValue(),this._onChange()}return t.prototype.bindEvents=function(){this.el.addEventListener("keydown",this._saveSelection),this.el.addEventListener("input",this._onInput),this.el.addEventListener("drop",this._onDrop),this.el.addEventListener("click",this._alignCursorFriendly),this.el.addEventListener("change",this._onChange)},t.prototype.unbindEvents=function(){this.el.removeEventListener("keydown",this._saveSelection),this.el.removeEventListener("input",this._onInput),this.el.removeEventListener("drop",this._onDrop),this.el.removeEventListener("click",this._alignCursorFriendly),this.el.removeEventListener("change",this._onChange)},t.prototype.fireEvent=function(t){(this._listeners[t]||[]).forEach(function(t){return t()})},t.prototype._saveSelection=function(){this.value!==this.el.value&&console.warn("Uncontrolled input change, refresh mask manually!"),this._selection={start:this.selectionStart,end:this.cursorPos}},t.prototype.updateValue=function(){this.masked.value=this.el.value},t.prototype.updateControl=function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()},t.prototype.updateOptions=function(t){var e=this,n=t.mask;n&&(this.mask=n),this.masked.withValueRefresh(function(){for(var n in t)"mask"!==n&&(e.masked[n]=t[n])}),this.updateControl()},t.prototype.updateCursor=function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))},t.prototype._delayUpdateCursor=function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(function(){e.cursorPos=e._changingCursorPos,e._abortUpdateCursor()},10)},t.prototype._fireChangeEvents=function(){this.fireEvent("accept"),this.masked.isComplete&&this.fireEvent("complete")},t.prototype._abortUpdateCursor=function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)},t.prototype._alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos)},t.prototype._alignCursorFriendly=function(){this.selectionStart===this.cursorPos&&this._alignCursor()},t.prototype.on=function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this},t.prototype.off=function(t,e){if(this._listeners[t]){if(e){var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners.splice(n,1),this}delete this._listeners[t]}},t.prototype._onInput=function(){this._abortUpdateCursor();var t=new It(this.el.value,this.cursorPos,this.value,this._selection),e=t.startChangePos+t.removed.length,n=this.masked.extractTail(e),u=this.masked.nearestInputPos(t.startChangePos,t.removeDirection);this.masked.clear(u);var i=this.masked.appendWithTail(t.inserted,n),r=this.masked.nearestInputPos(u+i,t.removeDirection);this.updateControl(),this.updateCursor(r)},t.prototype._onChange=function(){this.value!==this.el.value&&this.updateValue(),this.masked.commit(),this.updateControl()},t.prototype._onDrop=function(t){t.preventDefault(),t.stopPropagation()},t.prototype.destroy=function(){this.unbindEvents(),this._listeners.length=0},At(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if((void 0===t?"undefined":gt(t))!==gt(this.masked.mask)){var e=this.masked?this.masked.unmaskedValue:null;this.masked=o({mask:t}),null!=e&&(this.masked.unmaskedValue=e)}else this.masked.mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this._alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this._alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el===document.activeElement&&(this.el.setSelectionRange(t,t),this._saveSelection())}}]),t}();return l.InputMask=Ot,l.Masked=Ct,l.MaskedPattern=xt,l.MaskedNumber=Tt,l.MaskedDate=St,window.IMask=l,l}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.IMask=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t){return"string"==typeof t||t instanceof String}function n(t,n){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e(t)?t:t?n:u}function u(t,e){return e===gt.LEFT&&--t,t}function i(t,e,n){var u=n.set;n.set=function(){for(var t=arguments.length,e=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return new It(t,e)}var p=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),c=t(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),f=function(t){return"object"==typeof t?null!==t:"function"==typeof t},d=function(t){if(!f(t))throw TypeError(t+" is not an object!");return t},v=function(t){try{return!!t()}catch(t){return!0}},m=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),g=p.document,y=f(g)&&f(g.createElement),A=function(t){return y?g.createElement(t):{}},_=!m&&!v(function(){return 7!=Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a}),F=function(t,e){if(!f(t))return t;var n,u;if(e&&"function"==typeof(n=t.toString)&&!f(u=n.call(t)))return u;if("function"==typeof(n=t.valueOf)&&!f(u=n.call(t)))return u;if(!e&&"function"==typeof(n=t.toString)&&!f(u=n.call(t)))return u;throw TypeError("Can't convert object to primitive value")},D=Object.defineProperty,C={f:m?Object.defineProperty:function(t,e,n){if(d(t),e=F(e,!0),d(n),_)try{return D(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},E=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},k=m?function(t,e,n){return C.f(t,e,E(1,n))}:function(t,e,n){return t[e]=n,t},B={}.hasOwnProperty,b=function(t,e){return B.call(t,e)},x=0,P=Math.random(),T=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++x+P).toString(36))},w=t(function(t){var e=T("src"),n=Function.toString,u=(""+n).split("toString");c.inspectSource=function(t){return n.call(t)},(t.exports=function(t,n,i,r){var o="function"==typeof i;o&&(b(i,"name")||k(i,"name",n)),t[n]!==i&&(o&&(b(i,e)||k(i,e,t[n]?""+t[n]:u.join(String(n)))),t===p?t[n]=i:r?t[n]?t[n]=i:k(t,n,i):(delete t[n],k(t,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||n.call(this)})}),S=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},O=function(t,e,n){if(S(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,u){return t.call(e,n,u)};case 3:return function(n,u,i){return t.call(e,n,u,i)}}return function(){return t.apply(e,arguments)}},I=function(t,e,n){var u,i,r,o,s=t&I.F,a=t&I.G,h=t&I.S,l=t&I.P,f=t&I.B,d=a?p:h?p[e]||(p[e]={}):(p[e]||{}).prototype,v=a?c:c[e]||(c[e]={}),m=v.prototype||(v.prototype={});a&&(n=e);for(u in n)r=((i=!s&&d&&void 0!==d[u])?d:n)[u],o=f&&i?O(r,p):l&&"function"==typeof r?O(Function.call,r):r,d&&w(d,u,r,t&I.U),v[u]!=r&&k(v,u,o),l&&m[u]!=r&&(m[u]=r)};p.core=c,I.F=1,I.G=2,I.S=4,I.P=8,I.B=16,I.W=32,I.U=64,I.R=128;var j=I,R={}.toString,L=function(t){return R.call(t).slice(8,-1)},z=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==L(t)?t.split(""):Object(t)},H=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},M=function(t){return Object(H(t))},U=Math.ceil,V=Math.floor,N=function(t){return isNaN(t=+t)?0:(t>0?V:U)(t)},Y=Math.min,Z=function(t){return t>0?Y(N(t),9007199254740991):0},W=Array.isArray||function(t){return"Array"==L(t)},$=p["__core-js_shared__"]||(p["__core-js_shared__"]={}),G=function(t){return $[t]||($[t]={})},X=t(function(t){var e=G("wks"),n=p.Symbol,u="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=u&&n[t]||(u?n:T)("Symbol."+t))}).store=e}),q=X("species"),J=function(t){var e;return W(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!W(e.prototype)||(e=void 0),f(e)&&null===(e=e[q])&&(e=void 0)),void 0===e?Array:e},K=function(t,e){return new(J(t))(e)},Q=X("unscopables"),tt=Array.prototype;void 0==tt[Q]&&k(tt,Q,{});var et=function(t,e){var n=1==t,u=2==t,i=3==t,r=4==t,o=6==t,s=5==t||o,a=e||K;return function(e,h,l){for(var p,c,f=M(e),d=z(f),v=O(h,l,3),m=Z(d.length),g=0,y=n?a(e,m):u?a(e,0):void 0;m>g;g++)if((s||g in d)&&(p=d[g],c=v(p,g,f),t))if(n)y[g]=c;else if(c)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:y.push(p)}else if(r)return!1;return o?-1:i||r?r:y}}(5),nt=!0;"find"in[]&&Array(1).find(function(){nt=!1}),j(j.P+j.F*nt,"Array",{find:function(t){return et(this,t,arguments.length>1?arguments[1]:void 0)}}),function(t){tt[Q][t]=!0}("find");var ut=function(t){return z(H(t))},it=Math.max,rt=Math.min,ot=function(t,e){return(t=N(t))<0?it(t+e,0):rt(t,e)},st=G("keys"),at=function(t){return function(e,n,u){var i,r=ut(e),o=Z(r.length),s=ot(u,o);if(t&&n!=n){for(;o>s;)if((i=r[s++])!=i)return!0}else for(;o>s;s++)if((t||s in r)&&r[s]===n)return t||s||0;return!t&&-1}}(!1),ht=function(t){return st[t]||(st[t]=T(t))}("IE_PROTO"),lt=function(t,e){var n,u=ut(t),i=0,r=[];for(n in u)n!=ht&&b(u,n)&&r.push(n);for(;e.length>i;)b(u,n=e[i++])&&(~at(r,n)||r.push(n));return r},pt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ct=Object.keys||function(t){return lt(t,pt)};!function(t,e){var n=(c.Object||{})[t]||Object[t],u={};u[t]=e(n),j(j.S+j.F*v(function(){n(1)}),"Object",u)}("keys",function(){return function(t){return ct(M(t))}});var ft=function(t){var e=String(H(this)),n="",u=N(t);if(u<0||u==1/0)throw RangeError("Count can't be negative");for(;u>0;(u>>>=1)&&(e+=e))1&u&&(n+=e);return n};j(j.P,"String",{repeat:ft});var dt=function(t,e,n,u){var i=String(H(t)),r=i.length,o=void 0===n?" ":String(n),s=Z(e);if(s<=r||""==o)return i;var a=s-r,h=ft.call(o,Math.ceil(a/o.length));return h.length>a&&(h=h.slice(0,a)),u?h+i:i+h};j(j.P,"String",{padStart:function(t){return dt(this,t,arguments.length>1?arguments[1]:void 0,!0)}}),j(j.P,"String",{padEnd:function(t){return dt(this,t,arguments.length>1?arguments[1]:void 0,!1)}});var vt,mt,gt={NONE:0,LEFT:-1,RIGHT:1},yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},_t=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)},t.prototype.extractTail=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.extractInput(t,e)},t.prototype._appendTail=function(t){return!t||this._append(t)},t.prototype._append=function(t,e){for(var n=this.value.length,u=this.clone(),i=0;i0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e)},t.prototype.withValueRefresh=function(t){if(this._refreshing)return t();this._refreshing=!0;var e=this.isInitialized?this.unmaskedValue:null,n=t();return null!=e&&(this.unmaskedValue=e),delete this._refreshing,n},t.prototype.commit=function(){},_t(t,[{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.reset(),this.appendWithTail(t),this.commit()}},{key:"unmaskedValue",get:function(){return this._unmask()},set:function(t){this.reset(),this._append(t),this.appendWithTail(""),this.commit()}},{key:"isComplete",get:function(){return!0}}]),t}(),function(t,e,n,u,i){var r={};Object.keys(u).forEach(function(t){r[t]=u[t]}),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=n.slice().reverse().reduce(function(n,u){return u(t,e,n)||n},r),i&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(i):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null)}(vt.prototype,"mask",[i],Object.getOwnPropertyDescriptor(vt.prototype,"mask"),vt.prototype),vt),kt=(mt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};At(this,e),n=Ft({},e.DEFAULTS,n);var u=Ct(this,t.call(this,n));delete u.isInitialized;var i=n,r=i.scale,o=i.radix,s=i.mapToRadix,a=i.min,h=i.max,l=i.signed,p=i.thousandsSeparator,c=i.postFormat;return u.min=a,u.max=h,u.scale=r,u.radix=o,u.mapToRadix=s,u.signed=l,u.thousandsSeparator=p,u.postFormat=c,u._updateNumberRegExp(),u.isInitialized=!0,u}return Dt(e,t),e.prototype._updateNumberRegExp=function(){var t="^",e="^";this.signed?(t+="([+|\\-]?|([+|\\-]?(0|([1-9]+\\d*))))",e+="[+|\\-]?"):t+="(0|([1-9]+\\d*))",e+="\\d*",this.scale&&(t+="("+this.radix+"\\d{0,"+this.scale+"})?",e+="("+this.radix+"\\d{0,"+this.scale+"})?"),t+="$",e+="$",this._numberRegExpSoft=new RegExp(t),this._numberRegExp=new RegExp(e)},e.prototype.extractTail=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._removeThousandsSeparators(t.prototype.extractTail.call(this,e,n))},e.prototype._removeThousandsSeparators=function(t){return t.replace(this._thousandsSeparatorRegExp,"")},e.prototype._insertThousandsSeparators=function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)},e.prototype._append=function(e,n){return t.prototype._append.call(this,this._removeThousandsSeparators(e.replace(this._mapToRadixRegExp,this.radix)),n)},e.prototype.appendWithTail=function(e,n){var u=this.value.length;this._value=this._removeThousandsSeparators(this.value);var i=u-this.value.length,r=t.prototype.appendWithTail.call(this,e,n);this._value=this._insertThousandsSeparators(this.value);var o=u+r-i;this._value=this._insertThousandsSeparators(this.value);for(var s=0,a=0;a<=o;++a)this.value[a]===this.thousandsSeparator&&(++s,++o);return r-i+s},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gt.LEFT;if(!e)return t;var n=u(t,e);return this.value[n]===this.thousandsSeparator&&(t+=e),t},e.prototype._validate=function(e){var n=(e?this._numberRegExpSoft:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(n){var u=this.number;n=n&&!isNaN(u)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return n&&t.prototype._validate.call(this,e)},e.prototype.commit=function(){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=""+e);var n=this.value;this.postFormat.normalizeZeros&&(n=this._normalizeZeros(n)),this.postFormat.padFractionalZeros&&(n=this._padFractionalZeros(n)),this._value=n},e.prototype._normalizeZeros=function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,function(t,e,n,u){return e+u}),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))},e.prototype._padFractionalZeros=function(t){var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)},_t(e,[{key:"number",get:function(){var t=this._removeThousandsSeparators(this._normalizeZeros(this.unmaskedValue)).replace(this.radix,".");return Number(t)},set:function(t){this.unmaskedValue=""+t}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}},{key:"scale",get:function(){return this._scale},set:function(t){this._scale=t}},{key:"radix",get:function(){return this._radix},set:function(t){this._radix=t,this._updateNumberRegExp()}},{key:"signed",get:function(){return this._signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0},set:function(t){this._signed=t}},{key:"postFormat",get:function(){return this._postFormat},set:function(t){this._postFormat=Ft({},e.DEFAULTS.postFormat,t)}},{key:"mapToRadix",get:function(){return this._mapToRadix},set:function(t){this._mapToRadix=t,this._mapToRadixRegExp=new RegExp("["+t.map(r).join("")+"]","g")}},{key:"thousandsSeparator",get:function(){return this._thousandsSeparator},set:function(t){this._thousandsSeparator=t,this._thousandsSeparatorRegExp=new RegExp(r(t),"g")}}]),e}(Et),o(mt.prototype,"min",[i],Object.getOwnPropertyDescriptor(mt.prototype,"min"),mt.prototype),o(mt.prototype,"max",[i],Object.getOwnPropertyDescriptor(mt.prototype,"max"),mt.prototype),o(mt.prototype,"scale",[i],Object.getOwnPropertyDescriptor(mt.prototype,"scale"),mt.prototype),o(mt.prototype,"radix",[i],Object.getOwnPropertyDescriptor(mt.prototype,"radix"),mt.prototype),o(mt.prototype,"signed",[i],Object.getOwnPropertyDescriptor(mt.prototype,"signed"),mt.prototype),o(mt.prototype,"postFormat",[i],Object.getOwnPropertyDescriptor(mt.prototype,"postFormat"),mt.prototype),o(mt.prototype,"mapToRadix",[i],Object.getOwnPropertyDescriptor(mt.prototype,"mapToRadix"),mt.prototype),o(mt.prototype,"thousandsSeparator",[i],Object.getOwnPropertyDescriptor(mt.prototype,"thousandsSeparator"),mt.prototype),mt);kt.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,postFormat:{normalizeZeros:!0}};var Bt=function(){function t(e){At(this,t),Ft(this,e),this.mask&&(this._masked=s(e))}return t.prototype.reset=function(){this.isHollow=!1,this._masked&&this._masked.reset()},t.prototype.resolve=function(t){return!!this._masked&&(this._masked.value=t,this._masked.value)},_t(t,[{key:"isInput",get:function(){return this.type===t.TYPES.INPUT}},{key:"isHiddenHollow",get:function(){return this.isHollow&&this.optional}}]),t}();Bt.DEFAULTS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},Bt.TYPES={INPUT:"input",FIXED:"fixed"};var bt=function(){function t(e,n){var u=n.name,i=n.offset,r=n.mask,o=n.validate;At(this,t),this.masked=e,this.name=u,this.offset=i,this.mask=r,this.validate=o||function(){return!0}}return t.prototype._validate=function(t){return this.validate(this.value,this,t)},_t(t,[{key:"value",get:function(){return this.masked.value.slice(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}},{key:"unmaskedValue",get:function(){return this.masked.extractInput(this.masked.mapDefIndexToPos(this.offset),this.masked.mapDefIndexToPos(this.offset+this.mask.length))}}]),t}(),xt=function(){function t(e){var n=e[0],u=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(u+"").length;At(this,t),this._from=n,this._to=u,this._maxLength=i,this.validate=this.validate.bind(this),this._update()}return t.prototype._update=function(){this._maxLength=Math.max(this._maxLength,(this.to+"").length),this.mask="0".repeat(this._maxLength)},t.prototype.validate=function(t){var e="",n="",u=t.match(/^(\D*)(\d*)(\D*)/),i=u[1],r=u[2];return r&&(e="0".repeat(i.length)+r,n="9".repeat(i.length)+r),-1===t.search(/[^0]/)&&t.length<=this._matchFrom||(e=e.padEnd(this._maxLength,"0"),n=n.padEnd(this._maxLength,"9"),this.from<=Number(n)&&Number(e)<=this.to)},_t(t,[{key:"to",get:function(){return this._to},set:function(t){this._to=t,this._update()}},{key:"from",get:function(){return this._from},set:function(t){this._from=t,this._update()}},{key:"maxLength",get:function(){return this._maxLength},set:function(t){this._maxLength=t,this._update()}},{key:"_matchFrom",get:function(){return this.maxLength-(this.from+"").length}}]),t}();bt.Range=xt,bt.Enum=function(t){return{mask:"*".repeat(t[0].length),validate:function(e,n){return t.some(function(t){return t.indexOf(n.unmaskedValue)>=0})}}};var Pt,Tt=(Pt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};At(this,e);var u=n.definitions,i=n.placeholder,r=n.groups,o=Ct(this,t.call(this,n));return delete o.isInitialized,o.placeholder=i,o.definitions=u,o.groups=r,o.isInitialized=!0,o}return Dt(e,t),e.prototype._updateMask=function(){var t=this,n=this._definitions;this._charDefs=[],this._groupDefs=[];var u=this.mask;if(u&&n){var i=!1,r=!1,o=!1;t:for(var s=0;s=e)break;u.isHiddenHollow&&++e}return e}},e.prototype._unmask=function(){for(var t=this.value,e="",n=0,u=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this.value,u="",i=this.mapPosToDefIndex(e),r=t,o=this.mapPosToDefIndex(t);r0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=this.mapPosToDefIndex(e),i=this.mapPosToDefIndex(n),r=this._charDefs.map(function(t,e){return[t,e]}).slice(u,i).filter(function(t){return t[0].stopAlign}).map(function(t){return t[1]}),o=[u].concat(r,[i]);return o.map(function(e,n){return[r.indexOf(e)>=0?e:null,t.extractInput(t.mapDefIndexToPos(e),t.mapDefIndexToPos(o[++n]))]}).filter(function(t){var e=t[0],n=t[1];return null!=e||n})},e.prototype._appendPlaceholder=function(t){for(var e=t||this._charDefs.length,n=this.mapPosToDefIndex(this.value.length);n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;this._value=this.value.slice(0,t)+this.value.slice(e);var n=this.mapPosToDefIndex(t),u=this.mapPosToDefIndex(e);this._charDefs.slice(n,u).forEach(function(t){return t.reset()})},e.prototype.nearestInputPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gt.LEFT;if(!e)return t;var n=this.mapPosToDefIndex(t),i=n,r=void 0,o=void 0,s=void 0,a=void 0;for(a=u(i,e);0<=a&&a=this._charDefs.length)&&null!=r&&(i=r)}else null==o&&(i=null!=s?s:r);return this.mapDefIndexToPos(i)},e.prototype.group=function(t){return this.groupsByName(t)[0]},e.prototype.groupsByName=function(t){return this._groupDefs.filter(function(e){return e.name===t})},_t(e,[{key:"placeholder",get:function(){return this._placeholder},set:function(t){this._placeholder=Ft({},e.DEFAULT_PLACEHOLDER,t)}},{key:"definitions",get:function(){return this._definitions},set:function(t){t=Ft({},Bt.DEFAULTS,t),this._definitions=t,this._updateMask()}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask=t,this._updateMask()}},{key:"isComplete",get:function(){var t=this;return!this._charDefs.some(function(e,n){return e.isInput&&!e.optional&&(e.isHollow||!t.extractInput(n,n+1))})}},{key:"groups",get:function(){return this._groups},set:function(t){this._groups=t,this._updateMask()}}]),e}(Et),a(Pt.prototype,"placeholder",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"placeholder"),Pt.prototype),a(Pt.prototype,"definitions",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"definitions"),Pt.prototype),a(Pt.prototype,"mask",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"mask"),Pt.prototype),a(Pt.prototype,"groups",[i],Object.getOwnPropertyDescriptor(Pt.prototype,"groups"),Pt.prototype),Pt);Tt.DEFAULT_PLACEHOLDER={lazy:!0,char:"_"},Tt.STOP_CHAR="`",Tt.ESCAPE_CHAR="\\",Tt.Definition=Bt,Tt.Group=bt;var wt,St=(wt=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};At(this,e);var u=n.groups,i=n=Ft({},e.DEFAULTS,n),r=i.min,o=i.max,s=i.format,a=i.parse;n.groups=Ft({},e.DEFAULTS.groups),n.groups.Y&&(r&&(n.groups.Y.from=r.getFullYear()),o&&(n.groups.Y.to=o.getFullYear())),Ft(n.groups,u);var h=Ct(this,t.call(this,n));return delete h.isInitialized,h.min=r,h.max=o,h.format=s,h.parse=a,h.isInitialized=!0,h}return Dt(e,t),e.prototype._validate=function(e){var n=t.prototype._validate.call(this,e),u=this.date;return n&&(!this.isComplete||this.isDateExist(this.value)&&u&&(null==this.min||this.min<=u)&&(null==this.max||u<=this.max))},e.prototype.isDateExist=function(t){return this.format(this.parse(t))===t},_t(e,[{key:"date",get:function(){return this.isComplete?this.parse(this.value):null},set:function(t){this.value=this.format(t)}},{key:"min",get:function(){return this._min},set:function(t){this._min=t}},{key:"max",get:function(){return this._max},set:function(t){this._max=t}}]),e}(Tt),h(wt.prototype,"min",[i],Object.getOwnPropertyDescriptor(wt.prototype,"min"),wt.prototype),h(wt.prototype,"max",[i],Object.getOwnPropertyDescriptor(wt.prototype,"max"),wt.prototype),wt);St.DEFAULTS={mask:"d{.}`m{.}`Y",format:function(t){return[(""+t.getDate()).padStart(2,"0"),(""+(t.getMonth()+1)).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=t.split("."),n=e[0],u=e[1],i=e[2];return new Date(i,u-1,n)},groups:{d:new bt.Range([1,31]),m:new bt.Range([1,12]),Y:new bt.Range([1900,9999])}};var Ot=function(){function t(e,n,u,i){At(this,t),this.value=e,this.cursorPos=n,this.oldValue=u,this.oldSelection=i}return _t(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return this.removedCount&&(this.oldSelection.end===this.cursorPos||this.insertedCount?gt.RIGHT:gt.LEFT)}}]),t}(),It=function(){function t(e,n){At(this,t),this.el=e,this.masked=s(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._alignCursor=this._alignCursor.bind(this),this._alignCursorFriendly=this._alignCursorFriendly.bind(this),this.bindEvents(),this.updateValue(),this._onChange()}return t.prototype.bindEvents=function(){this.el.addEventListener("keydown",this._saveSelection),this.el.addEventListener("input",this._onInput),this.el.addEventListener("drop",this._onDrop),this.el.addEventListener("click",this._alignCursorFriendly),this.el.addEventListener("change",this._onChange)},t.prototype.unbindEvents=function(){this.el.removeEventListener("keydown",this._saveSelection),this.el.removeEventListener("input",this._onInput),this.el.removeEventListener("drop",this._onDrop),this.el.removeEventListener("click",this._alignCursorFriendly),this.el.removeEventListener("change",this._onChange)},t.prototype.fireEvent=function(t){(this._listeners[t]||[]).forEach(function(t){return t()})},t.prototype._saveSelection=function(){this.value!==this.el.value&&console.warn("Uncontrolled input change, refresh mask manually!"),this._selection={start:this.selectionStart,end:this.cursorPos}},t.prototype.updateValue=function(){this.masked.value=this.el.value},t.prototype.updateControl=function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()},t.prototype.updateOptions=function(t){var e=this,n=t.mask;n&&(this.mask=n),this.masked.withValueRefresh(function(){for(var n in t)"mask"!==n&&(e.masked[n]=t[n])}),this.updateControl()},t.prototype.updateCursor=function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))},t.prototype._delayUpdateCursor=function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(function(){e.cursorPos=e._changingCursorPos,e._abortUpdateCursor()},10)},t.prototype._fireChangeEvents=function(){this.fireEvent("accept"),this.masked.isComplete&&this.fireEvent("complete")},t.prototype._abortUpdateCursor=function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)},t.prototype._alignCursor=function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos)},t.prototype._alignCursorFriendly=function(){this.selectionStart===this.cursorPos&&this._alignCursor()},t.prototype.on=function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this},t.prototype.off=function(t,e){if(this._listeners[t]){if(e){var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners.splice(n,1),this}delete this._listeners[t]}},t.prototype._onInput=function(){this._abortUpdateCursor();var t=new Ot(this.el.value,this.cursorPos,this.value,this._selection),e=t.startChangePos+t.removed.length,n=this.masked.extractTail(e),u=this.masked.nearestInputPos(t.startChangePos,t.removeDirection);this.masked.clear(u);var i=this.masked.appendWithTail(t.inserted,n),r=this.masked.nearestInputPos(u+i,t.removeDirection);this.updateControl(),this.updateCursor(r)},t.prototype._onChange=function(){this.value!==this.el.value&&this.updateValue(),this.masked.commit(),this.updateControl()},t.prototype._onDrop=function(t){t.preventDefault(),t.stopPropagation()},t.prototype.destroy=function(){this.unbindEvents(),this._listeners.length=0},_t(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if((void 0===t?"undefined":yt(t))!==yt(this.masked.mask)){var e=this.masked?this.masked.unmaskedValue:null;this.masked=s({mask:t}),null!=e&&(this.masked.unmaskedValue=e)}else this.masked.mask=t}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this._alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this._alignCursor()}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el===document.activeElement&&(this.el.setSelectionRange(t,t),this._saveSelection())}}]),t}();return l.InputMask=It,l.Masked=Et,l.MaskedPattern=Tt,l.MaskedNumber=kt,l.MaskedDate=St,window.IMask=l,l}); //# sourceMappingURL=imask.min.js.map diff --git a/dist/imask.min.js.map b/dist/imask.min.js.map index 0dba649a..927693f4 100644 --- a/dist/imask.min.js.map +++ b/dist/imask.min.js.map @@ -1 +1 @@ -{"version":3,"file":"imask.min.js","sources":["../src/core/utils.js","../src/masked/factory.js","../src/imask.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/masked/base.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/number.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js"],"sourcesContent":["export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {isString} from '../core/utils';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof IMask.Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new IMask.Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof IMask.Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new IMask.MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new IMask.Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new IMask.Masked(opts);\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n"],"names":["isString","str","String","conform","res","fallback","indexInDirection","pos","direction","DIRECTION","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","this","withValueRefresh","bind","escapeRegExp","replace","createMask","opts","mask","babelHelpers.extends","IMask","Masked","RegExp","validate","value","test","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","el","InputMask","global","module","window","Math","self","__g","core","version","__e","it","isObject","TypeError","exec","e","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","object","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","that","length","aFunction","b","c","apply","arguments","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","defined","ceil","floor","isNaN","min","toInteger","Array","isArray","arg","store","Symbol","USE_SYMBOL","uid","SPECIES","original","C","constructor","speciesConstructor","UNSCOPABLES","ArrayProto","$find","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","asc","$this","callbackfn","toObject","IObject","toLength","index","result","push","forced","find","max","shared","arrayIndexOf","IS_INCLUDES","fromIndex","toIObject","toIndex","IE_PROTO","names","i","keys","$keys","enumBugKeys","KEY","fails","count","n","Infinity","RangeError","repeat","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padStart","$pad","padEnd","_value","isInitialized","_validate","soft","clone","m","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","_unmask","clear","from","to","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","PatternDefinition","_masked","isHollow","resolve","TYPES","INPUT","optional","DEFAULTS","PatternGroup","masked","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","match","placeholder","num","search","_matchFrom","Range","Enum","enums","group","some","indexOf","definitions","groups","_Masked","_this","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_this2","_groups","p","gNames","filter","gName","sort","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","_this3","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","map","stops","s","_this4","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","_this5","Definition","Group","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","valid","number","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","_thousandsSeparator","format","parse","Y","getFullYear","_MaskedPattern","date","isComplete","isDateExist","getDate","getMonth","day","month","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange"],"mappings":"gPACA,SAASA,EAAUC,SACK,iBAARA,GAAoBA,aAAeC,O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QA"} \ No newline at end of file +{"version":3,"file":"imask.min.js","sources":["../src/core/utils.js","../src/masked/factory.js","../src/imask.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-species-create.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-index.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/_string-repeat.js","../node_modules/core-js/modules/es6.string.repeat.js","../node_modules/core-js/modules/_string-pad.js","../node_modules/core-js/modules/es7.string.pad-start.js","../node_modules/core-js/modules/es7.string.pad-end.js","../src/masked/base.js","../src/masked/number.js","../src/masked/pattern/definition.js","../src/masked/pattern/group.js","../src/masked/pattern.js","../src/masked/date.js","../src/core/action-details.js","../src/controls/input.js"],"sourcesContent":["export\r\nfunction isString (str) {\r\n return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\nexport\r\nfunction conform (res, str, fallback='') {\r\n return isString(res) ?\r\n res :\r\n res ?\r\n str :\r\n fallback;\r\n}\r\n\r\nexport\r\nconst DIRECTION = {\r\n NONE: 0,\r\n LEFT: -1,\r\n RIGHT: 1\r\n}\r\n\r\nexport\r\nfunction indexInDirection (pos, direction) {\r\n if (direction === DIRECTION.LEFT) --pos;\r\n return pos;\r\n}\r\n\r\nexport\r\nfunction refreshValueOnSet (target, key, descriptor) {\r\n const method = descriptor.set;\r\n descriptor.set = function (...args) {\r\n return this.withValueRefresh(method.bind(this, ...args));\r\n };\r\n}\r\n\r\nexport\r\nfunction escapeRegExp(str) {\r\n return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n","import {isString} from '../core/utils';\r\nimport Masked from './base';\r\nimport MaskedNumber from './number';\r\n\r\n\r\nexport default\r\nfunction createMask (opts) {\r\n opts = Object.assign({}, opts); // clone\r\n\r\n const mask = opts.mask;\r\n\r\n if (mask instanceof Masked) {\r\n return mask;\r\n }\r\n if (mask instanceof RegExp) {\r\n opts.validate = (value) => mask.test(value);\r\n return new Masked(opts);\r\n }\r\n if (isString(mask)) {\r\n return new IMask.MaskedPattern(opts);\r\n }\r\n if (mask.prototype instanceof Masked) {\r\n delete opts.mask;\r\n return new mask(opts);\r\n }\r\n if (mask instanceof Number || typeof mask === 'number' || mask === Number) {\r\n delete opts.mask;\r\n return new MaskedNumber(opts);\r\n }\r\n if (mask instanceof Date || mask === Date) {\r\n delete opts.mask;\r\n if (opts.pattern) {\r\n opts.mask = opts.pattern;\r\n delete opts.pattern;\r\n }\r\n return new IMask.MaskedDate(opts);\r\n }\r\n if (mask instanceof Function){\r\n opts.validate = mask;\r\n return new Masked(opts);\r\n }\r\n\r\n console.warn('Mask not found for', opts); // eslint-disable-line no-console\r\n return new Masked(opts);\r\n}\r\n","import 'core-js/fn/array/find';\r\nimport 'core-js/fn/object/keys';\r\nimport 'core-js/fn/string/repeat';\r\nimport 'core-js/fn/string/pad-start';\r\nimport 'core-js/fn/string/pad-end';\r\n\r\n\r\nimport Masked from './masked/base';\r\nimport MaskedPattern from './masked/pattern';\r\nimport MaskedNumber from './masked/number';\r\nimport MaskedDate from './masked/date';\r\n\r\nimport InputMask from './controls/input';\r\n\r\n\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n\t// currently available only for input elements\r\n return new InputMask(el, opts);\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n\r\nIMask.Masked = Masked;\r\nIMask.MaskedPattern = MaskedPattern;\r\nIMask.MaskedNumber = MaskedNumber;\r\nIMask.MaskedDate = MaskedDate;\r\n\r\nwindow.IMask = IMask;\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var global = require('./_global')\n , hide = require('./_hide')\n , has = require('./_has')\n , SRC = require('./_uid')('src')\n , TO_STRING = 'toString'\n , $toString = Function[TO_STRING]\n , TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function(it){\n return $toString.call(it);\n};\n\n(module.exports = function(O, key, val, safe){\n var isFunction = typeof val == 'function';\n if(isFunction)has(val, 'name') || hide(val, 'name', key);\n if(O[key] === val)return;\n if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if(O === global){\n O[key] = val;\n } else {\n if(!safe){\n delete O[key];\n hide(O, key, val);\n } else {\n if(O[key])O[key] = val;\n else hide(O, key, val);\n }\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString(){\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","var global = require('./_global')\n , core = require('./_core')\n , hide = require('./_hide')\n , redefine = require('./_redefine')\n , ctx = require('./_ctx')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})\n , key, own, out, exp;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if(target)redefine(target, key, out, type & $export.U);\n // export\n if(exports[key] != out)hide(exports, key, exp);\n if(IS_PROTO && expProto[key] != out)expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg){\n return cof(arg) == 'Array';\n};","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var store = require('./_shared')('wks')\n , uid = require('./_uid')\n , Symbol = require('./_global').Symbol\n , USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function(name){\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","var isObject = require('./_is-object')\n , isArray = require('./_is-array')\n , SPECIES = require('./_wks')('species');\n\nmodule.exports = function(original){\n var C;\n if(isArray(original)){\n C = original.constructor;\n // cross-realm fallback\n if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;\n if(isObject(C)){\n C = C[SPECIES];\n if(C === null)C = undefined;\n }\n } return C === undefined ? Array : C;\n};","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function(original, length){\n return new (speciesConstructor(original))(length);\n};","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables')\n , ArrayProto = Array.prototype;\nif(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function(key){\n ArrayProto[UNSCOPABLES][key] = true;\n};","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export')\n , $find = require('./_array-methods')(5)\n , KEY = 'find'\n , forced = true;\n// Shouldn't skip holes\nif(KEY in [])Array(1)[KEY](function(){ forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn/*, that = undefined */){\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx')\n , IObject = require('./_iobject')\n , toObject = require('./_to-object')\n , toLength = require('./_to-length')\n , asc = require('./_array-species-create');\nmodule.exports = function(TYPE, $create){\n var IS_MAP = TYPE == 1\n , IS_FILTER = TYPE == 2\n , IS_SOME = TYPE == 3\n , IS_EVERY = TYPE == 4\n , IS_FIND_INDEX = TYPE == 6\n , NO_HOLES = TYPE == 5 || IS_FIND_INDEX\n , create = $create || asc;\n return function($this, callbackfn, that){\n var O = toObject($this)\n , self = IObject(O)\n , f = ctx(callbackfn, that, 3)\n , length = toLength(self.length)\n , index = 0\n , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined\n , val, res;\n for(;length > index; index++)if(NO_HOLES || index in self){\n val = self[index];\n res = f(val, index, O);\n if(TYPE){\n if(IS_MAP)result[index] = res; // map\n else if(res)switch(TYPE){\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if(IS_EVERY)return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","'use strict';\nvar toInteger = require('./_to-integer')\n , defined = require('./_defined');\n\nmodule.exports = function repeat(count){\n var str = String(defined(this))\n , res = ''\n , n = toInteger(count);\n if(n < 0 || n == Infinity)throw RangeError(\"Count can't be negative\");\n for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;\n return res;\n};","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length')\n , repeat = require('./_string-repeat')\n , defined = require('./_defined');\n\nmodule.exports = function(that, maxLength, fillString, left){\n var S = String(defined(that))\n , stringLength = S.length\n , fillStr = fillString === undefined ? ' ' : String(fillString)\n , intMaxLength = toLength(maxLength);\n if(intMaxLength <= stringLength || fillStr == '')return S;\n var fillLen = intMaxLength - stringLength\n , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padStart: function padStart(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export')\n , $pad = require('./_string-pad');\n\n$export($export.P, 'String', {\n padEnd: function padEnd(maxLength /*, fillString = ' ' */){\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});","import {refreshValueOnSet} from '../core/utils';\r\n\r\n\r\nexport default\r\nclass Masked {\r\n constructor ({mask, validate}) {\r\n this._value = '';\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n this.isInitialized = true;\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n\r\n clone () {\r\n const m = new Masked(this);\r\n m._value = this.value.slice();\r\n return m;\r\n }\r\n\r\n reset () {\r\n this._value = '';\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (value) {\r\n this.reset();\r\n this.appendWithTail(value);\r\n this.commit();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmask();\r\n }\r\n\r\n set unmaskedValue (value) {\r\n this.reset();\r\n this._append(value);\r\n this.appendWithTail(\"\");\r\n this.commit();\r\n }\r\n\r\n get isComplete () {\r\n return true;\r\n }\r\n\r\n nearestInputPos (cursorPos, /* direction */) {\r\n return cursorPos;\r\n }\r\n\r\n extractInput (fromPos=0, toPos=this.value.length) {\r\n return this.value.slice(fromPos, toPos);\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this.extractInput(fromPos, toPos);\r\n }\r\n\r\n _appendTail (tail) {\r\n return !tail || this._append(tail);\r\n }\r\n\r\n _append (str, soft) {\r\n const oldValueLength = this.value.length;\r\n let consistentValue = this.clone();\r\n\r\n for (let ci=0; ci outputRaw\r\n\r\n // TODO\r\n // insert (str, fromPos, soft)\r\n\r\n // splice (start, deleteCount, inserted, removeDirection) {\r\n // const tailPos = start + deleteCount;\r\n // const tail = this.extractTail(tailPos);\r\n\r\n // start = this.nearestInputPos(start, removeDirection);\r\n // this.clear(start);\r\n // return this.appendWithTail(inserted, tail);\r\n // }\r\n}\r\n","import {escapeRegExp, refreshValueOnSet, DIRECTION, indexInDirection} from '../core/utils';\r\nimport Masked from './base';\r\n\r\n\r\nexport default\r\nclass MaskedNumber extends Masked {\r\n constructor (opts={}) {\r\n opts = Object.assign({}, MaskedNumber.DEFAULTS, opts);\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n const {scale, radix, mapToRadix, min, max, signed, thousandsSeparator, postFormat} = opts;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.scale = scale;\r\n this.radix = radix;\r\n this.mapToRadix = mapToRadix;\r\n this.signed = signed;\r\n this.thousandsSeparator = thousandsSeparator;\r\n this.postFormat = postFormat;\r\n\r\n this._updateNumberRegExp();\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _updateNumberRegExp () {\r\n // TODO refactor?\r\n let regExpStrSoft = '^';\r\n let regExpStr = '^';\r\n\r\n if (this.signed) {\r\n regExpStrSoft += '([+|\\\\-]?|([+|\\\\-]?(0|([1-9]+\\\\d*))))';\r\n regExpStr += '[+|\\\\-]?';\r\n } else {\r\n regExpStrSoft += '(0|([1-9]+\\\\d*))';\r\n }\r\n regExpStr += '\\\\d*';\r\n\r\n if (this.scale) {\r\n regExpStrSoft += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n regExpStr += '(' + this.radix + '\\\\d{0,' + this.scale + '})?';\r\n }\r\n\r\n regExpStrSoft += '$';\r\n regExpStr += '$';\r\n\r\n this._numberRegExpSoft = new RegExp(regExpStrSoft);\r\n this._numberRegExp = new RegExp(regExpStr)\r\n }\r\n\r\n extractTail (fromPos=0, toPos=this.value.length) {\r\n return this._removeThousandsSeparators(super.extractTail(fromPos, toPos));\r\n }\r\n\r\n _removeThousandsSeparators (value) {\r\n return value.replace(this._thousandsSeparatorRegExp, '');\r\n }\r\n\r\n _insertThousandsSeparators (value) {\r\n // https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript\r\n const parts = value.split(this.radix);\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, this.thousandsSeparator);\r\n return parts.join(this.radix);\r\n }\r\n\r\n _append (str, soft) {\r\n return super._append(\r\n this._removeThousandsSeparators(\r\n str.replace(this._mapToRadixRegExp, this.radix)),\r\n soft);\r\n }\r\n\r\n appendWithTail (str, tail) {\r\n const oldValueLength = this.value.length;\r\n this._value = this._removeThousandsSeparators(this.value);\r\n let removedSeparatorsCount = oldValueLength - this.value.length;\r\n\r\n\r\n const appended = super.appendWithTail(str, tail);\r\n\r\n\r\n this._value = this._insertThousandsSeparators(this.value);\r\n\r\n let beforeTailPos = oldValueLength + appended - removedSeparatorsCount;\r\n this._value = this._insertThousandsSeparators(this.value);\r\n let insertedSeparatorsBeforeTailCount = 0;\r\n for (let pos = 0; pos <= beforeTailPos; ++pos) {\r\n if (this.value[pos] === this.thousandsSeparator) {\r\n ++insertedSeparatorsBeforeTailCount;\r\n ++beforeTailPos;\r\n }\r\n }\r\n\r\n return appended - removedSeparatorsCount + insertedSeparatorsBeforeTailCount;\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const nextPos = indexInDirection(cursorPos, direction);\r\n if (this.value[nextPos] === this.thousandsSeparator) cursorPos += direction;\r\n return cursorPos;\r\n }\r\n\r\n _validate (soft) {\r\n const regexp = soft ? this._numberRegExpSoft : this._numberRegExp;\r\n\r\n // validate as string\r\n let valid = regexp.test(this._removeThousandsSeparators(this.value));\r\n\r\n if (valid) {\r\n // validate as number\r\n const number = this.number;\r\n valid = valid && !isNaN(number) &&\r\n // check min bound for negative values\r\n (this.min == null || this.min >= 0 || this.min <= this.number) &&\r\n // check max bound for positive values\r\n (this.max == null || this.max <= 0 || this.number <= this.max);\r\n }\r\n\r\n return valid && super._validate(soft);\r\n }\r\n\r\n commit () {\r\n const number = this.number;\r\n let validnum = number;\r\n\r\n // check bounds\r\n if (this.min != null) validnum = Math.max(validnum, this.min);\r\n if (this.max != null) validnum = Math.min(validnum, this.max);\r\n\r\n if (validnum !== number) {\r\n this.unmaskedValue = '' + validnum;\r\n }\r\n\r\n let formatted = this.value;\r\n\r\n if (this.postFormat.normalizeZeros) {\r\n formatted = this._normalizeZeros(formatted);\r\n }\r\n\r\n if (this.postFormat.padFractionalZeros) {\r\n formatted = this._padFractionalZeros(formatted);\r\n }\r\n\r\n this._value = formatted;\r\n }\r\n\r\n _normalizeZeros (value) {\r\n const parts = this._removeThousandsSeparators(value).split(this.radix);\r\n\r\n // remove leading zeros\r\n parts[0] = parts[0].replace(/^(\\D*)(0*)(\\d*)/, (match, sign, zeros, num) => sign + num);\r\n // add leading zero\r\n if (value.length && !/\\d$/.test(parts[0])) parts[0] = parts[0] + '0';\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros\r\n if (!parts[1].length) parts.length = 1; // remove fractional\r\n }\r\n\r\n return this._insertThousandsSeparators(parts.join(this.radix));\r\n }\r\n\r\n _padFractionalZeros (value) {\r\n const parts = value.split(this.radix);\r\n if (parts.length < 2) parts.push('');\r\n parts[1] = parts[1].padEnd(this.scale, '0');\r\n return parts.join(this.radix);\r\n }\r\n\r\n get number () {\r\n let numstr =\r\n this._removeThousandsSeparators(\r\n this._normalizeZeros(\r\n this.unmaskedValue))\r\n .replace(this.radix, '.');\r\n\r\n return Number(numstr);\r\n }\r\n\r\n set number (number) {\r\n this.unmaskedValue = '' + number;\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n\r\n get scale () {\r\n return this._scale;\r\n }\r\n\r\n @refreshValueOnSet\r\n set scale (scale) {\r\n this._scale = scale;\r\n }\r\n\r\n get radix () {\r\n return this._radix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set radix (radix) {\r\n this._radix = radix;\r\n this._updateNumberRegExp();\r\n }\r\n\r\n get signed () {\r\n return this._signed || (this.min != null && this.min < 0) || (this.max != null && this.max < 0);\r\n }\r\n\r\n @refreshValueOnSet\r\n set signed (signed) {\r\n this._signed = signed;\r\n }\r\n\r\n get postFormat () {\r\n return this._postFormat;\r\n }\r\n\r\n @refreshValueOnSet\r\n set postFormat (postFormat) {\r\n this._postFormat = {\r\n ...MaskedNumber.DEFAULTS.postFormat,\r\n ...postFormat\r\n };\r\n }\r\n\r\n get mapToRadix () {\r\n return this._mapToRadix;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mapToRadix (mapToRadix) {\r\n this._mapToRadix = mapToRadix;\r\n this._mapToRadixRegExp = new RegExp('[' +\r\n mapToRadix.map(escapeRegExp).join('') +\r\n ']', 'g');\r\n }\r\n\r\n get thousandsSeparator () {\r\n return this._thousandsSeparator;\r\n }\r\n\r\n @refreshValueOnSet\r\n set thousandsSeparator (thousandsSeparator) {\r\n this._thousandsSeparator = thousandsSeparator;\r\n this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(thousandsSeparator), 'g');\r\n }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n radix: ',',\r\n thousandsSeparator: '',\r\n mapToRadix: ['.'],\r\n scale: 2,\r\n postFormat: {\r\n normalizeZeros: true,\r\n }\r\n};\r\n","import createMask from '../factory';\r\n\r\n\r\nexport default\r\nclass PatternDefinition {\r\n constructor(opts) {\r\n Object.assign(this, opts);\r\n\r\n if (this.mask) {\r\n this._masked = createMask(opts);\r\n }\r\n }\r\n\r\n reset () {\r\n this.isHollow = false;\r\n if (this._masked) this._masked.reset();\r\n }\r\n\r\n get isInput () {\r\n return this.type === PatternDefinition.TYPES.INPUT;\r\n }\r\n\r\n get isHiddenHollow () {\r\n return this.isHollow && this.optional;\r\n }\r\n\r\n resolve (ch) {\r\n if (!this._masked) return false;\r\n // TODO seems strange\r\n this._masked.value = ch;\r\n return this._masked.value;\r\n }\r\n}\r\n\r\nPatternDefinition.DEFAULTS = {\r\n '0': /\\d/,\r\n 'a': /[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979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0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/, // http://stackoverflow.com/a/22075070\r\n '*': /./\r\n};\r\nPatternDefinition.TYPES = {\r\n INPUT: 'input',\r\n FIXED: 'fixed'\r\n};\r\n","export default\r\nclass PatternGroup {\r\n constructor(masked, {name, offset, mask, validate}) {\r\n this.masked = masked;\r\n this.name = name;\r\n this.offset = offset;\r\n this.mask = mask;\r\n this.validate = validate || (() => true);\r\n }\r\n\r\n get value () {\r\n return this.masked.value.slice(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n get unmaskedValue () {\r\n return this.masked.extractInput(\r\n this.masked.mapDefIndexToPos(this.offset),\r\n this.masked.mapDefIndexToPos(this.offset + this.mask.length));\r\n }\r\n\r\n _validate (soft) {\r\n return this.validate(this.value, this, soft);\r\n }\r\n}\r\n\r\nexport\r\nclass RangeGroup {\r\n constructor ([from, to], maxlen=(to+'').length) {\r\n this._from = from;\r\n this._to = to;\r\n this._maxLength = maxlen;\r\n this.validate = this.validate.bind(this);\r\n\r\n this._update();\r\n }\r\n\r\n get to () {\r\n return this._to;\r\n }\r\n\r\n set to (to) {\r\n this._to = to;\r\n this._update();\r\n }\r\n\r\n get from () {\r\n return this._from;\r\n }\r\n\r\n set from (from) {\r\n this._from = from;\r\n this._update();\r\n }\r\n\r\n get maxLength () {\r\n return this._maxLength;\r\n }\r\n\r\n set maxLength (maxLength) {\r\n this._maxLength = maxLength;\r\n this._update();\r\n }\r\n\r\n get _matchFrom () {\r\n return this.maxLength - (this.from + '').length;\r\n }\r\n\r\n _update() {\r\n this._maxLength = Math.max(this._maxLength, (this.to + '').length);\r\n this.mask = '0'.repeat(this._maxLength);\r\n }\r\n\r\n validate (str) {\r\n let minstr = '';\r\n let maxstr = '';\r\n\r\n const [, placeholder, num] = str.match(/^(\\D*)(\\d*)(\\D*)/);\r\n if (num) {\r\n minstr = ('0'.repeat(placeholder.length) + num);\r\n maxstr = ('9'.repeat(placeholder.length) + num);\r\n }\r\n\r\n const firstNonZero = str.search(/[^0]/);\r\n if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n minstr = minstr.padEnd(this._maxLength, '0');\r\n maxstr = maxstr.padEnd(this._maxLength, '9');\r\n\r\n return this.from <= Number(maxstr) && Number(minstr) <= this.to;\r\n }\r\n}\r\n\r\nexport\r\nfunction EnumGroup (enums) {\r\n return {\r\n mask: '*'.repeat(enums[0].length),\r\n validate: (value, group) => enums.some(e => e.indexOf(group.unmaskedValue) >= 0)\r\n };\r\n}\r\n\r\nPatternGroup.Range = RangeGroup;\r\nPatternGroup.Enum = EnumGroup;\r\n","import {conform, DIRECTION, indexInDirection, refreshValueOnSet} from '../core/utils';\r\nimport Masked from './base';\r\nimport PatternDefinition from './pattern/definition';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedPattern extends Masked {\r\n constructor (opts={}) {\r\n const {definitions, placeholder, groups} = opts;\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.placeholder = placeholder;\r\n this.definitions = definitions;\r\n this.groups = groups;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n get placeholder () {\r\n return this._placeholder;\r\n }\r\n\r\n @refreshValueOnSet\r\n set placeholder (ph) {\r\n this._placeholder = {\r\n ...MaskedPattern.DEFAULT_PLACEHOLDER,\r\n ...ph\r\n };\r\n }\r\n\r\n get definitions () {\r\n return this._definitions;\r\n }\r\n\r\n @refreshValueOnSet\r\n set definitions (defs) {\r\n defs = {\r\n ...PatternDefinition.DEFAULTS,\r\n ...defs\r\n };\r\n\r\n this._definitions = defs;\r\n this._updateMask();\r\n }\r\n\r\n get mask () {\r\n return this._mask;\r\n }\r\n\r\n @refreshValueOnSet\r\n set mask (mask) {\r\n this._mask = mask;\r\n this._updateMask();\r\n }\r\n\r\n _updateMask () {\r\n const defs = this._definitions;\r\n this._charDefs = [];\r\n this._groupDefs = [];\r\n\r\n let pattern = this.mask;\r\n if (!pattern || !defs) return;\r\n\r\n let unmaskingBlock = false;\r\n let optionalBlock = false;\r\n let stopAlign = false;\r\n\r\n\r\n for (let i=0; i p.indexOf(gName) === 0);\r\n // order by key length\r\n gNames.sort((a, b) => b.length - a.length);\r\n // use group name with max length\r\n const gName = gNames[0];\r\n if (gName) {\r\n const group = this._groups[gName];\r\n this._groupDefs.push(new PatternGroup(this, {\r\n name: gName,\r\n offset: this._charDefs.length,\r\n mask: group.mask,\r\n validate: group.validate\r\n }));\r\n pattern = pattern.replace(gName, group.mask);\r\n }\r\n }\r\n\r\n let char = pattern[i];\r\n let type = !unmaskingBlock && char in defs ?\r\n PatternDefinition.TYPES.INPUT :\r\n PatternDefinition.TYPES.FIXED;\r\n const unmasking = type === PatternDefinition.TYPES.INPUT || unmaskingBlock;\r\n const optional = type === PatternDefinition.TYPES.INPUT && optionalBlock;\r\n\r\n if (char === MaskedPattern.STOP_CHAR) {\r\n stopAlign = true;\r\n continue;\r\n }\r\n\r\n if (char === '{' || char === '}') {\r\n unmaskingBlock = !unmaskingBlock;\r\n continue;\r\n }\r\n\r\n if (char === '[' || char === ']') {\r\n optionalBlock = !optionalBlock;\r\n continue;\r\n }\r\n\r\n if (char === MaskedPattern.ESCAPE_CHAR) {\r\n ++i;\r\n char = pattern[i];\r\n // TODO validation\r\n if (!char) break;\r\n type = PatternDefinition.TYPES.FIXED;\r\n }\r\n\r\n this._charDefs.push(new PatternDefinition({\r\n char,\r\n type,\r\n optional,\r\n stopAlign,\r\n mask: unmasking &&\r\n (type === PatternDefinition.TYPES.INPUT ?\r\n defs[char] :\r\n (value => value === char))\r\n }));\r\n\r\n stopAlign = false;\r\n }\r\n }\r\n\r\n _validate (soft) {\r\n return this._groupDefs.every(g => g._validate(soft)) && super._validate(soft);\r\n }\r\n\r\n clone () {\r\n const m = new MaskedPattern(this);\r\n m._value = this.value;\r\n m._charDefs.forEach((d, i) => Object.assign(d, this._charDefs[i]));\r\n m._groupDefs.forEach((d, i) => Object.assign(d, this._groupDefs[i]));\r\n return m;\r\n }\r\n\r\n reset () {\r\n super.reset();\r\n this._charDefs.forEach(d => {delete d.isHollow;});\r\n }\r\n\r\n get isComplete () {\r\n return !this._charDefs.some((d, i) =>\r\n d.isInput && !d.optional && (d.isHollow || !this.extractInput(i, i+1)));\r\n }\r\n\r\n hiddenHollowsBefore (defIndex) {\r\n return this._charDefs\r\n .slice(0, defIndex)\r\n .filter(d => d.isHiddenHollow)\r\n .length;\r\n }\r\n\r\n mapDefIndexToPos (defIndex) {\r\n if (defIndex == null) return;\r\n return defIndex - this.hiddenHollowsBefore(defIndex);\r\n }\r\n\r\n mapPosToDefIndex (pos) {\r\n if (pos == null) return;\r\n let defIndex = pos;\r\n for (let di=0; di= defIndex) break;\r\n if (def.isHiddenHollow) ++defIndex;\r\n }\r\n return defIndex;\r\n }\r\n\r\n _unmask () {\r\n const str = this.value;\r\n let unmasked = '';\r\n\r\n for (let ci=0, di=0; ci [d, i])\r\n .slice(fromDefIndex, toDefIndex)\r\n .filter(([d]) => d.stopAlign)\r\n .map(([, i]) => i);\r\n\r\n const stops = [\r\n fromDefIndex,\r\n ...stopDefIndices,\r\n toDefIndex\r\n ];\r\n\r\n return stops.map((s, i) => [\r\n stopDefIndices.indexOf(s) >= 0 ?\r\n s :\r\n null,\r\n\r\n this.extractInput(\r\n this.mapDefIndexToPos(s),\r\n this.mapDefIndexToPos(stops[++i]))\r\n ]).filter(([stop, input]) => stop != null || input);\r\n }\r\n\r\n _appendPlaceholder (toDefIndex) {\r\n const maxDefIndex = toDefIndex || this._charDefs.length;\r\n for (let di=this.mapPosToDefIndex(this.value.length); di < maxDefIndex; ++di) {\r\n const def = this._charDefs[di];\r\n if (def.isInput) def.isHollow = true;\r\n\r\n if (!this.placeholder.lazy || toDefIndex) {\r\n this._value += !def.isInput ?\r\n def.char :\r\n !def.optional ?\r\n this.placeholder.char :\r\n '';\r\n }\r\n }\r\n }\r\n\r\n clear (from=0, to=this.value.length) {\r\n this._value = this.value.slice(0, from) + this.value.slice(to);\r\n const fromDefIndex = this.mapPosToDefIndex(from);\r\n const toDefIndex = this.mapPosToDefIndex(to);\r\n this._charDefs\r\n .slice(fromDefIndex, toDefIndex)\r\n .forEach(d => d.reset());\r\n }\r\n\r\n nearestInputPos (cursorPos, direction=DIRECTION.LEFT) {\r\n if (!direction) return cursorPos;\r\n\r\n const initialDefIndex = this.mapPosToDefIndex(cursorPos);\r\n let di = initialDefIndex;\r\n\r\n let firstInputIndex,\r\n firstFilledInputIndex,\r\n firstVisibleHollowIndex,\r\n nextdi;\r\n\r\n // search forward\r\n for (nextdi = indexInDirection(di, direction); 0 <= nextdi && nextdi < this._charDefs.length; di += direction, nextdi += direction) {\r\n const nextDef = this._charDefs[nextdi];\r\n if (firstInputIndex == null && nextDef.isInput) firstInputIndex = di;\r\n if (firstVisibleHollowIndex == null && nextDef.isHollow && !nextDef.isHiddenHollow) firstVisibleHollowIndex = di;\r\n if (nextDef.isInput && !nextDef.isHollow) {\r\n firstFilledInputIndex = di;\r\n break;\r\n }\r\n }\r\n\r\n if (direction === DIRECTION.LEFT || firstInputIndex == null) {\r\n // search backwards\r\n direction = -direction;\r\n let overflow = false;\r\n\r\n // find hollows only before initial pos\r\n for (nextdi = indexInDirection(di, direction);\r\n 0 <= nextdi && nextdi < this._charDefs.length;\r\n di += direction, nextdi += direction)\r\n {\r\n const nextDef = this._charDefs[nextdi];\r\n if (nextDef.isInput) {\r\n firstInputIndex = di;\r\n if (nextDef.isHollow && !nextDef.isHiddenHollow) break;\r\n }\r\n\r\n // if hollow not found before start position - set `overflow`\r\n // and try to find just any input\r\n if (di === initialDefIndex) overflow = true;\r\n\r\n // first input found\r\n if (overflow && firstInputIndex != null) break;\r\n }\r\n\r\n // process overflow\r\n overflow = overflow || nextdi >= this._charDefs.length;\r\n if (overflow && firstInputIndex != null) di = firstInputIndex;\r\n } else if (firstFilledInputIndex == null) {\r\n // adjust index if delete at right and filled input not found at right\r\n di = firstVisibleHollowIndex != null ?\r\n firstVisibleHollowIndex :\r\n firstInputIndex;\r\n }\r\n\r\n return this.mapDefIndexToPos(di);\r\n }\r\n\r\n get groups () { return this._groups; }\r\n\r\n @refreshValueOnSet\r\n set groups (groups) {\r\n this._groups = groups;\r\n this._updateMask();\r\n }\r\n\r\n group (name) {\r\n return this.groupsByName(name)[0];\r\n }\r\n\r\n groupsByName (name) {\r\n return this._groupDefs.filter(g => g.name === name);\r\n }\r\n}\r\n\r\nMaskedPattern.DEFAULT_PLACEHOLDER = {\r\n lazy: true,\r\n char: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.Definition = PatternDefinition;\r\nMaskedPattern.Group = PatternGroup;\r\n","import {refreshValueOnSet} from '../core/utils';\r\nimport MaskedPattern from './pattern';\r\nimport PatternGroup from './pattern/group';\r\n\r\n\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n constructor (opts={}) {\r\n const groups = opts.groups;\r\n opts = Object.assign({}, MaskedDate.DEFAULTS, opts);\r\n const {min, max, format, parse} = opts;\r\n\r\n opts.groups = Object.assign({}, MaskedDate.DEFAULTS.groups);\r\n if (opts.groups.Y) {\r\n // adjust year group\r\n if (min) opts.groups.Y.from = min.getFullYear();\r\n if (max) opts.groups.Y.to = max.getFullYear();\r\n }\r\n\r\n Object.assign(opts.groups, groups);\r\n\r\n super(opts);\r\n delete this.isInitialized;\r\n\r\n this.min = min;\r\n this.max = max;\r\n this.format = format;\r\n this.parse = parse;\r\n\r\n this.isInitialized = true;\r\n }\r\n\r\n _validate (soft) {\r\n const valid = super._validate(soft);\r\n const date = this.date;\r\n\r\n return valid &&\r\n (!this.isComplete ||\r\n this.isDateExist(this.value) && date &&\r\n (this.min == null || this.min <= date) &&\r\n (this.max == null || date <= this.max));\r\n }\r\n\r\n isDateExist (str) {\r\n return this.format(this.parse(str)) === str;\r\n }\r\n\r\n get date () {\r\n return this.isComplete ?\r\n this.parse(this.value) :\r\n null;\r\n }\r\n\r\n set date (date) {\r\n this.value = this.format(date);\r\n }\r\n\r\n get min () {\r\n return this._min;\r\n }\r\n\r\n @refreshValueOnSet\r\n set min (min) {\r\n this._min = min;\r\n }\r\n\r\n get max () {\r\n return this._max;\r\n }\r\n\r\n @refreshValueOnSet\r\n set max (max) {\r\n this._max = max;\r\n }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n mask: 'd{.}`m{.}`Y',\r\n format: date => {\r\n const day = ('' + date.getDate()).padStart(2, '0');\r\n const month = ('' + (date.getMonth() + 1)).padStart(2, '0');\r\n const year = date.getFullYear();\r\n\r\n return [day, month, year].join('.');\r\n },\r\n parse: str => {\r\n const [day, month, year] = str.split('.');\r\n return new Date(year, month - 1, day);\r\n },\r\n groups: {\r\n d: new PatternGroup.Range([1, 31]),\r\n m: new PatternGroup.Range([1, 12]),\r\n Y: new PatternGroup.Range([1900, 9999]),\r\n },\r\n};\r\n","import {DIRECTION} from './utils';\r\n\r\n\r\nexport default\r\nclass ActionDetails {\r\n constructor (value, cursorPos, oldValue, oldSelection) {\r\n this.value = value;\r\n this.cursorPos = cursorPos;\r\n this.oldValue = oldValue;\r\n this.oldSelection = oldSelection;\r\n }\r\n\r\n get startChangePos () {\r\n return Math.min(this.cursorPos, this.oldSelection.start);\r\n }\r\n\r\n get insertedCount () {\r\n return this.cursorPos - this.startChangePos;\r\n }\r\n\r\n get inserted () {\r\n return this.value.substr(this.startChangePos, this.insertedCount);\r\n }\r\n\r\n get removedCount () {\r\n // Math.max for opposite operation\r\n return Math.max((this.oldSelection.end - this.startChangePos) ||\r\n // for Delete\r\n this.oldValue.length - this.value.length, 0);\r\n }\r\n\r\n get removed () {\r\n return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n }\r\n\r\n get head () {\r\n return this.value.substring(0, this.startChangePos);\r\n }\r\n\r\n get tail () {\r\n this.value.substring(this.startChangePos + this.insertedCount);\r\n }\r\n\r\n get removeDirection () {\r\n return this.removedCount &&\r\n ((this.oldSelection.end === this.cursorPos || this.insertedCount) ?\r\n DIRECTION.RIGHT :\r\n DIRECTION.LEFT);\r\n }\r\n}\r\n","import ActionDetails from '../core/action-details';\r\nimport createMask from '../masked/factory';\r\n\r\n\r\nexport default\r\nclass InputMask {\r\n constructor (el, opts) {\r\n this.el = el;\r\n this.masked = createMask(opts);\r\n\r\n this._listeners = {};\r\n this._value = '';\r\n this._unmaskedValue = '';\r\n\r\n this._saveSelection = this._saveSelection.bind(this);\r\n this._onInput = this._onInput.bind(this);\r\n this._onChange = this._onChange.bind(this);\r\n this._onDrop = this._onDrop.bind(this);\r\n this._alignCursor = this._alignCursor.bind(this);\r\n this._alignCursorFriendly = this._alignCursorFriendly.bind(this);\r\n\r\n this.bindEvents();\r\n\r\n // refresh\r\n this.updateValue();\r\n this._onChange();\r\n }\r\n\r\n get mask () { return this.masked.mask; }\r\n set mask (mask) {\r\n if (typeof mask === typeof this.masked.mask) {\r\n this.masked.mask = mask;\r\n return;\r\n }\r\n\r\n const unmasked = this.masked ? this.masked.unmaskedValue : null;\r\n this.masked = createMask({mask});\r\n if (unmasked != null) this.masked.unmaskedValue = unmasked;\r\n }\r\n\r\n get value () {\r\n return this._value;\r\n }\r\n\r\n set value (str) {\r\n this.masked.value = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n get unmaskedValue () {\r\n return this._unmaskedValue;\r\n }\r\n\r\n set unmaskedValue (str) {\r\n this.masked.unmaskedValue = str;\r\n this.updateControl();\r\n this._alignCursor();\r\n }\r\n\r\n bindEvents () {\r\n this.el.addEventListener('keydown', this._saveSelection);\r\n this.el.addEventListener('input', this._onInput);\r\n this.el.addEventListener('drop', this._onDrop);\r\n this.el.addEventListener('click', this._alignCursorFriendly);\r\n this.el.addEventListener('change', this._onChange);\r\n }\r\n\r\n unbindEvents () {\r\n this.el.removeEventListener('keydown', this._saveSelection);\r\n this.el.removeEventListener('input', this._onInput);\r\n this.el.removeEventListener('drop', this._onDrop);\r\n this.el.removeEventListener('click', this._alignCursorFriendly);\r\n this.el.removeEventListener('change', this._onChange);\r\n }\r\n\r\n fireEvent (ev) {\r\n const listeners = this._listeners[ev] || [];\r\n listeners.forEach(l => l());\r\n }\r\n\r\n get selectionStart () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionStart;\r\n }\r\n\r\n get cursorPos () {\r\n return this._cursorChanging ?\r\n this._changingCursorPos :\r\n\r\n this.el.selectionEnd;\r\n }\r\n\r\n set cursorPos (pos) {\r\n if (this.el !== document.activeElement) return;\r\n\r\n this.el.setSelectionRange(pos, pos);\r\n this._saveSelection();\r\n }\r\n\r\n _saveSelection (/* ev */) {\r\n if (this.value !== this.el.value) {\r\n console.warn('Uncontrolled input change, refresh mask manually!'); // eslint-disable-line no-console\r\n }\r\n this._selection = {\r\n start: this.selectionStart,\r\n end: this.cursorPos\r\n };\r\n }\r\n\r\n updateValue () {\r\n this.masked.value = this.el.value;\r\n }\r\n\r\n updateControl () {\r\n const newUnmaskedValue = this.masked.unmaskedValue;\r\n const newValue = this.masked.value;\r\n const isChanged = (this.unmaskedValue !== newUnmaskedValue ||\r\n this.value !== newValue);\r\n\r\n this._unmaskedValue = newUnmaskedValue;\r\n this._value = newValue;\r\n\r\n if (this.el.value !== newValue) this.el.value = newValue;\r\n if (isChanged) this._fireChangeEvents();\r\n }\r\n\r\n updateOptions (opts) {\r\n const mask = opts.mask;\r\n if (mask) this.mask = mask;\r\n\r\n this.masked.withValueRefresh(() => {\r\n for (const k in opts) {\r\n if (k === 'mask') continue;\r\n this.masked[k] = opts[k];\r\n }\r\n });\r\n\r\n this.updateControl();\r\n }\r\n\r\n updateCursor (cursorPos) {\r\n if (cursorPos == null) return;\r\n this.cursorPos = cursorPos;\r\n\r\n // also queue change cursor for mobile browsers\r\n this._delayUpdateCursor(cursorPos);\r\n }\r\n\r\n _delayUpdateCursor (cursorPos) {\r\n this._abortUpdateCursor();\r\n this._changingCursorPos = cursorPos;\r\n this._cursorChanging = setTimeout(() => {\r\n this.cursorPos = this._changingCursorPos;\r\n this._abortUpdateCursor();\r\n }, 10);\r\n }\r\n\r\n _fireChangeEvents () {\r\n this.fireEvent('accept');\r\n if (this.masked.isComplete) this.fireEvent('complete');\r\n }\r\n\r\n _abortUpdateCursor () {\r\n if (this._cursorChanging) {\r\n clearTimeout(this._cursorChanging);\r\n delete this._cursorChanging;\r\n }\r\n }\r\n\r\n _alignCursor () {\r\n this.cursorPos = this.masked.nearestInputPos(this.cursorPos);\r\n }\r\n\r\n _alignCursorFriendly () {\r\n if (this.selectionStart !== this.cursorPos) return;\r\n this._alignCursor();\r\n }\r\n\r\n on (ev, handler) {\r\n if (!this._listeners[ev]) this._listeners[ev] = [];\r\n this._listeners[ev].push(handler);\r\n return this;\r\n }\r\n\r\n off (ev, handler) {\r\n if (!this._listeners[ev]) return;\r\n if (!handler) {\r\n delete this._listeners[ev];\r\n return;\r\n }\r\n const hIndex = this._listeners[ev].indexOf(handler);\r\n if (hIndex >= 0) this._listeners.splice(hIndex, 1);\r\n return this;\r\n }\r\n\r\n _onInput () {\r\n this._abortUpdateCursor();\r\n\r\n const details = new ActionDetails(\r\n // new state\r\n this.el.value, this.cursorPos,\r\n // old state\r\n this.value, this._selection);\r\n\r\n const tailPos = details.startChangePos + details.removed.length;\r\n const tail = this.masked.extractTail(tailPos);\r\n\r\n const lastInputPos = this.masked.nearestInputPos(details.startChangePos, details.removeDirection);\r\n this.masked.clear(lastInputPos);\r\n const insertedCount = this.masked.appendWithTail(details.inserted, tail);\r\n\r\n\r\n const cursorPos = this.masked.nearestInputPos(\r\n lastInputPos + insertedCount,\r\n details.removeDirection);\r\n\r\n this.updateControl();\r\n this.updateCursor(cursorPos);\r\n }\r\n\r\n _onChange () {\r\n if (this.value !== this.el.value) {\r\n this.updateValue();\r\n }\r\n this.masked.commit();\r\n this.updateControl();\r\n }\r\n\r\n _onDrop (ev) {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n }\r\n\r\n destroy () {\r\n this.unbindEvents();\r\n this._listeners.length = 0;\r\n }\r\n}\r\n"],"names":["isString","str","String","conform","res","fallback","indexInDirection","pos","direction","DIRECTION","LEFT","refreshValueOnSet","target","key","descriptor","method","set","args","this","withValueRefresh","bind","escapeRegExp","replace","createMask","opts","mask","babelHelpers.extends","Masked","RegExp","validate","value","test","IMask","MaskedPattern","prototype","Number","MaskedNumber","Date","pattern","MaskedDate","Function","warn","el","InputMask","global","module","window","Math","self","__g","core","version","__e","it","isObject","TypeError","exec","e","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","object","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","that","length","aFunction","b","c","apply","arguments","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","defined","ceil","floor","isNaN","min","toInteger","Array","isArray","arg","store","Symbol","USE_SYMBOL","uid","SPECIES","original","C","constructor","speciesConstructor","UNSCOPABLES","ArrayProto","$find","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","asc","$this","callbackfn","toObject","IObject","toLength","index","result","push","forced","find","max","shared","arrayIndexOf","IS_INCLUDES","fromIndex","toIObject","toIndex","IE_PROTO","names","i","keys","$keys","enumBugKeys","KEY","fails","count","n","Infinity","RangeError","repeat","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padStart","$pad","padEnd","_value","isInitialized","_validate","soft","clone","m","reset","nearestInputPos","cursorPos","extractInput","fromPos","toPos","extractTail","_appendTail","tail","_append","oldValueLength","consistentValue","ci","appendWithTail","appendCount","consistentAppended","ch","appended","_unmask","clear","from","to","_refreshing","unmasked","unmaskedValue","ret","commit","_mask","DEFAULTS","_Masked","_this","scale","radix","mapToRadix","signed","thousandsSeparator","postFormat","_updateNumberRegExp","regExpStrSoft","regExpStr","_numberRegExpSoft","_numberRegExp","_removeThousandsSeparators","_thousandsSeparatorRegExp","_insertThousandsSeparators","parts","_mapToRadixRegExp","removedSeparatorsCount","beforeTailPos","insertedSeparatorsBeforeTailCount","nextPos","valid","number","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","match","sign","zeros","num","numstr","_min","_max","_scale","_radix","_signed","_postFormat","_mapToRadix","map","_thousandsSeparator","PatternDefinition","_masked","isHollow","resolve","TYPES","INPUT","optional","PatternGroup","masked","offset","mapDefIndexToPos","RangeGroup","maxlen","_from","_to","_maxLength","_update","minstr","maxstr","placeholder","search","_matchFrom","Range","Enum","enums","group","some","indexOf","definitions","groups","_updateMask","defs","_definitions","_charDefs","_groupDefs","unmaskingBlock","optionalBlock","stopAlign","_this2","_groups","p","gNames","filter","gName","sort","char","FIXED","unmasking","STOP_CHAR","ESCAPE_CHAR","every","g","forEach","d","_this3","hiddenHollowsBefore","defIndex","isHiddenHollow","mapPosToDefIndex","di","def","_appendChunks","_appendPlaceholder","resolved","skipped","chres","chunks","fromDefIndex","input","extractInputChunks","toDefIndex","isInput","stopDefIndices","stops","s","_this4","stop","maxDefIndex","lazy","initialDefIndex","firstInputIndex","firstFilledInputIndex","firstVisibleHollowIndex","nextdi","nextDef","overflow","groupsByName","_placeholder","ph","DEFAULT_PLACEHOLDER","_this5","Definition","Group","format","parse","Y","getFullYear","_MaskedPattern","date","isComplete","isDateExist","getDate","getMonth","day","month","year","ActionDetails","oldValue","oldSelection","start","startChangePos","substr","insertedCount","end","removedCount","substring","RIGHT","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_alignCursor","_alignCursorFriendly","bindEvents","updateValue","addEventListener","unbindEvents","removeEventListener","fireEvent","ev","l","_selection","selectionStart","updateControl","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","updateOptions","k","updateCursor","_delayUpdateCursor","_abortUpdateCursor","_changingCursorPos","_cursorChanging","setTimeout","on","handler","off","hIndex","splice","details","tailPos","removed","lastInputPos","removeDirection","inserted","preventDefault","stopPropagation","destroy","selectionEnd","activeElement","setSelectionRange"],"mappings":"gPACA,SAASA,EAAUC,SACK,iBAARA,GAAoBA,aAAeC,OAGnD,SACSC,EAASC,EAAKH,OAAKI,yDAAS,UAC5BL,EAASI,GACdA,EACAA,EACEH,EACAI,EAUN,SACSC,EAAkBC,EAAKC,UAC1BA,IAAcC,GAAUC,QAAQH,EAC7BA,EAGT,SACSI,EAAmBC,EAAQC,EAAKC,OACjCC,EAASD,EAAWE,MACfA,IAAM,sCAAaC,gDAC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pE,eAAeqN,EAAQK,SAAU/N,GAG7DN,EAAYtM,KAAKqR,OAAOhF,gBAC5BoO,EAAe5C,EACfyC,EAAQI,sBAELtB,qBACAO,aAAarN,gBAGpBgM,qBACMtY,KAAKY,QAAUZ,KAAKwB,GAAGZ,YACpB+X,mBAEFtH,OAAOvD,cACPsL,6BAGPb,iBAASS,KACJ4B,mBACAC,+BAGLC,wBACOjC,oBACAX,WAAW3S,OAAS,2CAlNNvF,KAAKqR,OAAO9Q,mBACvBA,gBACGA,iBAAAA,SAAgBP,KAAKqR,OAAO9Q,WAKjCoN,EAAW3N,KAAKqR,OAASrR,KAAKqR,OAAOzD,cAAgB,UACtDyD,OAAShR,GAAYE,SACV,MAAZoN,IAAkB3N,KAAKqR,OAAOzD,cAAgBD,aAN3C0D,OAAO9Q,KAAOA,uCAUdP,KAAK8L,qBAGH/M,QACJsS,OAAOzQ,MAAQ7B,OACfqa,qBACAZ,4DAIExY,KAAKmY,6BAGKpZ,QACZsS,OAAOzD,cAAgB7O,OACvBqa,qBACAZ,6DAyBExY,KAAK+Z,gBACV/Z,KAAK8Z,mBAEL9Z,KAAKwB,GAAG2X,wDAIHnZ,KAAK+Z,gBACV/Z,KAAK8Z,mBAEL9Z,KAAKwB,GAAGuZ,2BAGG1b,GACTW,KAAKwB,KAAOqB,SAASmY,qBAEpBxZ,GAAGyZ,kBAAkB5b,EAAKA,QAC1B+Y,kCtD7ETtX,EAAMW,UAAYA,GAElBX,EAAML,OAASA,GACfK,EAAMC,cAAgBA,GACtBD,EAAMI,aAAeA,GACrBJ,EAAMO,WAAaA,GAEnBO,OAAOd,MAAQA"} \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 267a5bf3..b443b69a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,5 @@ +var resolve = require('rollup-plugin-node-resolve'); +var commonjs = require('rollup-plugin-commonjs'); var babel = require('rollup-plugin-babel'); @@ -30,6 +32,11 @@ module.exports = function (config) { browsers: ['Chrome'], rollupPreprocessor: { plugins: [ + resolve({ + jsnext: true, + main: true + }), + commonjs(), babel({ exclude: 'node_modules/**', }) diff --git a/src/masked/factory.js b/src/masked/factory.js index a0fdea2f..a58dbaf8 100644 --- a/src/masked/factory.js +++ b/src/masked/factory.js @@ -1,4 +1,6 @@ import {isString} from '../core/utils'; +import Masked from './base'; +import MaskedNumber from './number'; export default @@ -7,23 +9,23 @@ function createMask (opts) { const mask = opts.mask; - if (mask instanceof IMask.Masked) { + if (mask instanceof Masked) { return mask; } if (mask instanceof RegExp) { opts.validate = (value) => mask.test(value); - return new IMask.Masked(opts); + return new Masked(opts); } if (isString(mask)) { return new IMask.MaskedPattern(opts); } - if (mask.prototype instanceof IMask.Masked) { + if (mask.prototype instanceof Masked) { delete opts.mask; return new mask(opts); } if (mask instanceof Number || typeof mask === 'number' || mask === Number) { delete opts.mask; - return new IMask.MaskedNumber(opts); + return new MaskedNumber(opts); } if (mask instanceof Date || mask === Date) { delete opts.mask; @@ -35,9 +37,9 @@ function createMask (opts) { } if (mask instanceof Function){ opts.validate = mask; - return new IMask.Masked(opts); + return new Masked(opts); } console.warn('Mask not found for', opts); // eslint-disable-line no-console - return new IMask.Masked(opts); + return new Masked(opts); } diff --git a/test/imask.js b/test/imask.js new file mode 100644 index 00000000..60b8b3f5 --- /dev/null +++ b/test/imask.js @@ -0,0 +1 @@ +import IMask from '../src/imask'; diff --git a/test/masked/pattern/cursor.js b/test/masked/pattern/cursor.js index 7c5f8c0d..342347d2 100644 --- a/test/masked/pattern/cursor.js +++ b/test/masked/pattern/cursor.js @@ -1,12 +1,10 @@ -import PatternMasked from '../../../src/masked/pattern'; +import MaskedPattern from '../../../src/masked/pattern'; describe('Align left', function () { - const mask = new PatternMasked({ + const mask = new MaskedPattern({ mask: '', - placeholder: { - show: 'always' - } + placeholder: {lazy: false} }); beforeEach(function () { diff --git a/test/masked/pattern/extract.js b/test/masked/pattern/extract.js index 96bfcacb..1089b33f 100644 --- a/test/masked/pattern/extract.js +++ b/test/masked/pattern/extract.js @@ -1,12 +1,10 @@ -import PatternMasked from '../../../src/masked/pattern'; +import MaskedPattern from '../../../src/masked/pattern'; describe('Extract', function () { - const mask = new PatternMasked({ + const mask = new MaskedPattern({ mask: '', - placeholder: { - show: 'always' - } + placeholder: {lazy: false} }); beforeEach(function () { diff --git a/test/masked/pattern/insert.js b/test/masked/pattern/insert.js index 8b2fd130..bf02204b 100644 --- a/test/masked/pattern/insert.js +++ b/test/masked/pattern/insert.js @@ -1,12 +1,10 @@ -import PatternMasked from '../../../src/masked/pattern'; +import MaskedPattern from '../../../src/masked/pattern'; describe('Insert', function () { - const mask = new PatternMasked({ + const mask = new MaskedPattern({ mask: '', - placeholder: { - show: 'always' - } + placeholder: {lazy: false} }); beforeEach(function () {