{"version":3,"file":"imask.min.js","sources":["../../../node_modules/core-js/internals/global.js","../../../node_modules/core-js/internals/fails.js","../../../node_modules/core-js/internals/descriptors.js","../../../node_modules/core-js/internals/object-property-is-enumerable.js","../../../node_modules/core-js/internals/create-property-descriptor.js","../../../node_modules/core-js/internals/classof-raw.js","../../../node_modules/core-js/internals/indexed-object.js","../../../node_modules/core-js/internals/require-object-coercible.js","../../../node_modules/core-js/internals/to-indexed-object.js","../../../node_modules/core-js/internals/is-object.js","../../../node_modules/core-js/internals/to-primitive.js","../../../node_modules/core-js/internals/has.js","../../../node_modules/core-js/internals/document-create-element.js","../../../node_modules/core-js/internals/ie8-dom-define.js","../../../node_modules/core-js/internals/object-get-own-property-descriptor.js","../../../node_modules/core-js/internals/an-object.js","../../../node_modules/core-js/internals/object-define-property.js","../../../node_modules/core-js/internals/create-non-enumerable-property.js","../../../node_modules/core-js/internals/set-global.js","../../../node_modules/core-js/internals/shared-store.js","../../../node_modules/core-js/internals/inspect-source.js","../../../node_modules/core-js/internals/internal-state.js","../../../node_modules/core-js/internals/shared-key.js","../../../node_modules/core-js/internals/native-weak-map.js","../../../node_modules/core-js/internals/shared.js","../../../node_modules/core-js/internals/uid.js","../../../node_modules/core-js/internals/hidden-keys.js","../../../node_modules/core-js/internals/redefine.js","../../../node_modules/core-js/internals/path.js","../../../node_modules/core-js/internals/get-built-in.js","../../../node_modules/core-js/internals/to-integer.js","../../../node_modules/core-js/internals/to-length.js","../../../node_modules/core-js/internals/to-absolute-index.js","../../../node_modules/core-js/internals/array-includes.js","../../../node_modules/core-js/internals/object-keys-internal.js","../../../node_modules/core-js/internals/enum-bug-keys.js","../../../node_modules/core-js/internals/object-get-own-property-names.js","../../../node_modules/core-js/internals/object-get-own-property-symbols.js","../../../node_modules/core-js/internals/own-keys.js","../../../node_modules/core-js/internals/copy-constructor-properties.js","../../../node_modules/core-js/internals/is-forced.js","../../../node_modules/core-js/internals/export.js","../../../node_modules/core-js/internals/object-keys.js","../../../node_modules/core-js/internals/to-object.js","../../../node_modules/core-js/internals/object-assign.js","../../../node_modules/core-js/modules/es.object.assign.js","../../../node_modules/core-js/internals/string-repeat.js","../../../node_modules/core-js/internals/string-pad.js","../../../node_modules/core-js/internals/engine-user-agent.js","../../../node_modules/core-js/internals/string-pad-webkit-bug.js","../../../node_modules/core-js/modules/es.string.pad-end.js","../../../node_modules/core-js/modules/es.string.pad-start.js","../src/core/utils.js","../../../node_modules/core-js/modules/es.string.repeat.js","../../../node_modules/core-js/modules/es.global-this.js","../src/core/action-details.js","../src/core/change-details.js","../src/core/continuous-tail-details.js","../src/core/holder.js","../src/masked/base.js","../src/masked/factory.js","../src/masked/pattern/input-definition.js","../src/masked/pattern/fixed-definition.js","../src/masked/pattern/chunk-tail-details.js","../src/masked/regexp.js","../src/masked/pattern.js","../src/masked/range.js","../src/masked/date.js","../src/controls/mask-element.js","../src/controls/html-mask-element.js","../src/controls/html-contenteditable-mask-element.js","../src/controls/input.js","../src/masked/enum.js","../src/masked/number.js","../src/masked/function.js","../src/masked/dynamic.js","../src/masked/pipe.js"],"sourcesContent":["var check = function (it) {\n  return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n  // eslint-disable-next-line no-undef\n  check(typeof globalThis == 'object' && globalThis) ||\n  check(typeof window == 'object' && window) ||\n  check(typeof self == 'object' && self) ||\n  check(typeof global == 'object' && global) ||\n  // eslint-disable-next-line no-new-func\n  (function () { return this; })() || Function('return this')();\n","module.exports = function (exec) {\n  try {\n    return !!exec();\n  } catch (error) {\n    return true;\n  }\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","'use strict';\nvar nativePropertyIsEnumerable = {}.propertyIsEnumerable;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n  var descriptor = getOwnPropertyDescriptor(this, V);\n  return !!descriptor && descriptor.enumerable;\n} : nativePropertyIsEnumerable;\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};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n  return toString.call(it).slice(8, -1);\n};\n","var fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar split = ''.split;\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n  // eslint-disable-next-line no-prototype-builtins\n  return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n  return classof(it) == 'String' ? split.call(it, '') : Object(it);\n} : Object;\n","// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n  if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n  return it;\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n  return IndexedObject(requireObjectCoercible(it));\n};\n","module.exports = function (it) {\n  return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('../internals/is-object');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\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 (input, PREFERRED_STRING) {\n  if (!isObject(input)) return input;\n  var fn, val;\n  if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n  if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n  if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n  throw TypeError(\"Can't convert object to primitive value\");\n};\n","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n  return hasOwnProperty.call(it, key);\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n  return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n  return Object.defineProperty(createElement('div'), 'a', {\n    get: function () { return 7; }\n  }).a != 7;\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPrimitive = require('../internals/to-primitive');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\nvar nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n  O = toIndexedObject(O);\n  P = toPrimitive(P, true);\n  if (IE8_DOM_DEFINE) try {\n    return nativeGetOwnPropertyDescriptor(O, P);\n  } catch (error) { /* empty */ }\n  if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);\n};\n","var isObject = require('../internals/is-object');\n\nmodule.exports = function (it) {\n  if (!isObject(it)) {\n    throw TypeError(String(it) + ' is not an object');\n  } return it;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar anObject = require('../internals/an-object');\nvar toPrimitive = require('../internals/to-primitive');\n\nvar nativeDefineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {\n  anObject(O);\n  P = toPrimitive(P, true);\n  anObject(Attributes);\n  if (IE8_DOM_DEFINE) try {\n    return nativeDefineProperty(O, P, Attributes);\n  } catch (error) { /* 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};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n  return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n  object[key] = value;\n  return object;\n};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nmodule.exports = function (key, value) {\n  try {\n    createNonEnumerableProperty(global, key, value);\n  } catch (error) {\n    global[key] = value;\n  } return value;\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper\nif (typeof store.inspectSource != 'function') {\n  store.inspectSource = function (it) {\n    return functionToString.call(it);\n  };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar objectHas = require('../internals/has');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n  return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n  return function (it) {\n    var state;\n    if (!isObject(it) || (state = get(it)).type !== TYPE) {\n      throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n    } return state;\n  };\n};\n\nif (NATIVE_WEAK_MAP) {\n  var store = shared.state || (shared.state = new WeakMap());\n  var wmget = store.get;\n  var wmhas = store.has;\n  var wmset = store.set;\n  set = function (it, metadata) {\n    metadata.facade = it;\n    wmset.call(store, it, metadata);\n    return metadata;\n  };\n  get = function (it) {\n    return wmget.call(store, it) || {};\n  };\n  has = function (it) {\n    return wmhas.call(store, it);\n  };\n} else {\n  var STATE = sharedKey('state');\n  hiddenKeys[STATE] = true;\n  set = function (it, metadata) {\n    metadata.facade = it;\n    createNonEnumerableProperty(it, STATE, metadata);\n    return metadata;\n  };\n  get = function (it) {\n    return objectHas(it, STATE) ? it[STATE] : {};\n  };\n  has = function (it) {\n    return objectHas(it, STATE);\n  };\n}\n\nmodule.exports = {\n  set: set,\n  get: get,\n  has: has,\n  enforce: enforce,\n  getterFor: getterFor\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n  return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n  return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n  version: '3.8.3',\n  mode: IS_PURE ? 'pure' : 'global',\n  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar postfix = Math.random();\n\nmodule.exports = function (key) {\n  return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n};\n","module.exports = {};\n","var global = require('../internals/global');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar has = require('../internals/has');\nvar setGlobal = require('../internals/set-global');\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar getInternalState = InternalStateModule.get;\nvar enforceInternalState = InternalStateModule.enforce;\nvar TEMPLATE = String(String).split('String');\n\n(module.exports = function (O, key, value, options) {\n  var unsafe = options ? !!options.unsafe : false;\n  var simple = options ? !!options.enumerable : false;\n  var noTargetGet = options ? !!options.noTargetGet : false;\n  var state;\n  if (typeof value == 'function') {\n    if (typeof key == 'string' && !has(value, 'name')) {\n      createNonEnumerableProperty(value, 'name', key);\n    }\n    state = enforceInternalState(value);\n    if (!state.source) {\n      state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n    }\n  }\n  if (O === global) {\n    if (simple) O[key] = value;\n    else setGlobal(key, value);\n    return;\n  } else if (!unsafe) {\n    delete O[key];\n  } else if (!noTargetGet && O[key]) {\n    simple = true;\n  }\n  if (simple) O[key] = value;\n  else createNonEnumerableProperty(O, key, value);\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, 'toString', function toString() {\n  return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n});\n","var global = require('../internals/global');\n\nmodule.exports = global;\n","var path = require('../internals/path');\nvar global = require('../internals/global');\n\nvar aFunction = function (variable) {\n  return typeof variable == 'function' ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n  return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n    : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.es/ecma262/#sec-tointeger\nmodule.exports = function (argument) {\n  return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);\n};\n","var toInteger = require('../internals/to-integer');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n  return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toInteger = require('../internals/to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n  var integer = toInteger(index);\n  return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n  return function ($this, el, fromIndex) {\n    var O = toIndexedObject($this);\n    var length = toLength(O.length);\n    var index = toAbsoluteIndex(fromIndex, length);\n    var value;\n    // Array#includes uses SameValueZero equality algorithm\n    // eslint-disable-next-line no-self-compare\n    if (IS_INCLUDES && el != el) while (length > index) {\n      value = O[index++];\n      // eslint-disable-next-line no-self-compare\n      if (value != value) return true;\n    // Array#indexOf ignores holes, Array#includes - not\n    } else for (;length > index; index++) {\n      if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n    } return !IS_INCLUDES && -1;\n  };\n};\n\nmodule.exports = {\n  // `Array.prototype.includes` method\n  // https://tc39.es/ecma262/#sec-array.prototype.includes\n  includes: createMethod(true),\n  // `Array.prototype.indexOf` method\n  // https://tc39.es/ecma262/#sec-array.prototype.indexof\n  indexOf: createMethod(false)\n};\n","var has = require('../internals/has');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nmodule.exports = function (object, names) {\n  var O = toIndexedObject(object);\n  var i = 0;\n  var result = [];\n  var key;\n  for (key in O) !has(hiddenKeys, key) && 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    ~indexOf(result, key) || result.push(key);\n  }\n  return result;\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n  'constructor',\n  'hasOwnProperty',\n  'isPrototypeOf',\n  'propertyIsEnumerable',\n  'toLocaleString',\n  'toString',\n  'valueOf'\n];\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n  return internalObjectKeys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","var getBuiltIn = require('../internals/get-built-in');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n  var keys = getOwnPropertyNamesModule.f(anObject(it));\n  var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n  return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n};\n","var has = require('../internals/has');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source) {\n  var keys = ownKeys(source);\n  var defineProperty = definePropertyModule.f;\n  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n  }\n};\n","var fails = require('../internals/fails');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n  var value = data[normalize(feature)];\n  return value == POLYFILL ? true\n    : value == NATIVE ? false\n    : typeof detection == 'function' ? fails(detection)\n    : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n  return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar redefine = require('../internals/redefine');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n  options.target      - name of the target object\n  options.global      - target is the global object\n  options.stat        - export as static methods of target\n  options.proto       - export as prototype methods of target\n  options.real        - real prototype method for the `pure` version\n  options.forced      - export even if the native feature is available\n  options.bind        - bind methods to the target, required for the `pure` version\n  options.wrap        - wrap constructors to preventing global pollution, required for the `pure` version\n  options.unsafe      - use the simple assignment of property instead of delete + defineProperty\n  options.sham        - add a flag to not completely full polyfills\n  options.enumerable  - export as enumerable property\n  options.noTargetGet - prevent calling a getter on target\n*/\nmodule.exports = function (options, source) {\n  var TARGET = options.target;\n  var GLOBAL = options.global;\n  var STATIC = options.stat;\n  var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n  if (GLOBAL) {\n    target = global;\n  } else if (STATIC) {\n    target = global[TARGET] || setGlobal(TARGET, {});\n  } else {\n    target = (global[TARGET] || {}).prototype;\n  }\n  if (target) for (key in source) {\n    sourceProperty = source[key];\n    if (options.noTargetGet) {\n      descriptor = getOwnPropertyDescriptor(target, key);\n      targetProperty = descriptor && descriptor.value;\n    } else targetProperty = target[key];\n    FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n    // contained in target\n    if (!FORCED && targetProperty !== undefined) {\n      if (typeof sourceProperty === typeof targetProperty) continue;\n      copyConstructorProperties(sourceProperty, targetProperty);\n    }\n    // add a flag to not completely full polyfills\n    if (options.sham || (targetProperty && targetProperty.sham)) {\n      createNonEnumerableProperty(sourceProperty, 'sham', true);\n    }\n    // extend global\n    redefine(target, key, sourceProperty, options);\n  }\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\nmodule.exports = Object.keys || function keys(O) {\n  return internalObjectKeys(O, enumBugKeys);\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n  return Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\n\nvar nativeAssign = Object.assign;\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !nativeAssign || fails(function () {\n  // should have correct order of operations (Edge bug)\n  if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {\n    enumerable: true,\n    get: function () {\n      defineProperty(this, 'b', {\n        value: 3,\n        enumerable: false\n      });\n    }\n  }), { b: 2 })).b !== 1) return true;\n  // should work with symbols and should have deterministic property order (V8 bug)\n  var A = {};\n  var B = {};\n  // eslint-disable-next-line no-undef\n  var symbol = Symbol();\n  var alphabet = 'abcdefghijklmnopqrst';\n  A[symbol] = 7;\n  alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n  return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n  var T = toObject(target);\n  var argumentsLength = arguments.length;\n  var index = 1;\n  var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n  var propertyIsEnumerable = propertyIsEnumerableModule.f;\n  while (argumentsLength > index) {\n    var S = IndexedObject(arguments[index++]);\n    var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n    var length = keys.length;\n    var j = 0;\n    var key;\n    while (length > j) {\n      key = keys[j++];\n      if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n    }\n  } return T;\n} : nativeAssign;\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\n$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {\n  assign: assign\n});\n","'use strict';\nvar toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = ''.repeat || function repeat(count) {\n  var str = String(requireObjectCoercible(this));\n  var result = '';\n  var n = toInteger(count);\n  if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');\n  for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n  return result;\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('../internals/to-length');\nvar repeat = require('../internals/string-repeat');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar ceil = Math.ceil;\n\n// `String.prototype.{ padStart, padEnd }` methods implementation\nvar createMethod = function (IS_END) {\n  return function ($this, maxLength, fillString) {\n    var S = String(requireObjectCoercible($this));\n    var stringLength = S.length;\n    var fillStr = fillString === undefined ? ' ' : String(fillString);\n    var intMaxLength = toLength(maxLength);\n    var fillLen, stringFiller;\n    if (intMaxLength <= stringLength || fillStr == '') return S;\n    fillLen = intMaxLength - stringLength;\n    stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));\n    if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n    return IS_END ? S + stringFiller : stringFiller + S;\n  };\n};\n\nmodule.exports = {\n  // `String.prototype.padStart` method\n  // https://tc39.es/ecma262/#sec-string.prototype.padstart\n  start: createMethod(false),\n  // `String.prototype.padEnd` method\n  // https://tc39.es/ecma262/#sec-string.prototype.padend\n  end: createMethod(true)\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","// https://github.com/zloirock/core-js/issues/280\nvar userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line unicorn/no-unsafe-regex\nmodule.exports = /Version\\/10\\.\\d+(\\.\\d+)?( Mobile\\/\\w+)? Safari\\//.test(userAgent);\n","'use strict';\nvar $ = require('../internals/export');\nvar $padEnd = require('../internals/string-pad').end;\nvar WEBKIT_BUG = require('../internals/string-pad-webkit-bug');\n\n// `String.prototype.padEnd` method\n// https://tc39.es/ecma262/#sec-string.prototype.padend\n$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {\n  padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n    return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);\n  }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $padStart = require('../internals/string-pad').start;\nvar WEBKIT_BUG = require('../internals/string-pad-webkit-bug');\n\n// `String.prototype.padStart` method\n// https://tc39.es/ecma262/#sec-string.prototype.padstart\n$({ target: 'String', proto: true, forced: WEBKIT_BUG }, {\n  padStart: function padStart(maxLength /* , fillString = ' ' */) {\n    return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);\n  }\n});\n","// @flow\r\n\r\n\r\n/** Checks if value is string */\r\nexport\r\nfunction isString (str: mixed): boolean %checks {\r\n  return typeof str === 'string' || str instanceof String;\r\n}\r\n\r\n/**\r\n  Direction\r\n  @prop {string} NONE\r\n  @prop {string} LEFT\r\n  @prop {string} FORCE_LEFT\r\n  @prop {string} RIGHT\r\n  @prop {string} FORCE_RIGHT\r\n*/\r\nexport\r\nconst DIRECTION = {\r\n  NONE: 'NONE',\r\n  LEFT: 'LEFT',\r\n  FORCE_LEFT: 'FORCE_LEFT',\r\n  RIGHT: 'RIGHT',\r\n  FORCE_RIGHT: 'FORCE_RIGHT',\r\n}\r\n/**\r\n  Direction\r\n  @enum {string}\r\n*/\r\nexport\r\ntype Direction = $Values<typeof DIRECTION>;\r\n\r\n/** Returns next char index in direction */\r\nexport\r\nfunction indexInDirection (pos: number, direction: Direction): number {\r\n  if (direction === DIRECTION.LEFT) --pos;\r\n  return pos;\r\n}\r\n\r\n/** Returns next char position in direction */\r\nexport\r\nfunction posInDirection (pos: number, direction: Direction): number {\r\n  switch (direction) {\r\n    case DIRECTION.LEFT:\r\n    case DIRECTION.FORCE_LEFT:\r\n      return --pos;\r\n    case DIRECTION.RIGHT:\r\n    case DIRECTION.FORCE_RIGHT:\r\n      return ++pos;\r\n    default:\r\n      return pos;\r\n  }\r\n}\r\n\r\n/** */\r\nexport\r\nfunction forceDirection (direction: Direction): Direction {\r\n  switch (direction) {\r\n    case DIRECTION.LEFT:\r\n      return DIRECTION.FORCE_LEFT;\r\n    case DIRECTION.RIGHT:\r\n      return DIRECTION.FORCE_RIGHT;\r\n    default:\r\n      return direction;\r\n  }\r\n}\r\n\r\n/** Escapes regular expression control chars */\r\nexport\r\nfunction escapeRegExp (str: string): string {\r\n  return str.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\r\n}\r\n\r\n\r\n// cloned from https://github.com/epoberezkin/fast-deep-equal with small changes\r\nexport\r\nfunction objectIncludes (b: any, a: any): boolean {\r\n  if (a === b) return true;\r\n\r\n  var arrA = Array.isArray(a)\r\n    , arrB = Array.isArray(b)\r\n    , i;\r\n\r\n  if (arrA && arrB) {\r\n    if (a.length != b.length) return false;\r\n    for (i = 0; i < a.length; i++)\r\n      if (!objectIncludes(a[i], b[i])) return false;\r\n    return true;\r\n  }\r\n\r\n  if (arrA != arrB) return false;\r\n\r\n  if (a && b && typeof a === 'object' && typeof b === 'object') {\r\n    var dateA = a instanceof Date\r\n      , dateB = b instanceof Date;\r\n    if (dateA && dateB) return a.getTime() == b.getTime();\r\n    if (dateA != dateB) return false;\r\n\r\n    var regexpA = a instanceof RegExp\r\n      , regexpB = b instanceof RegExp;\r\n    if (regexpA && regexpB) return a.toString() == b.toString();\r\n    if (regexpA != regexpB) return false;\r\n\r\n    var keys = Object.keys(a);\r\n    // if (keys.length !== Object.keys(b).length) return false;\r\n\r\n    for (i = 0; i < keys.length; i++)\r\n      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\r\n\r\n    for (i = 0; i < keys.length; i++)\r\n      if(!objectIncludes(b[keys[i]], a[keys[i]])) return false;\r\n\r\n    return true;\r\n  } else if (a && b && typeof a === 'function' && typeof b === 'function') {\r\n      return a.toString() === b.toString()\r\n  }\r\n\r\n  return false;\r\n}\r\n\r\n/** Selection range */\r\nexport\r\ntype Selection = {\r\n  start: number;\r\n  end: number;\r\n};\r\n","var $ = require('../internals/export');\nvar repeat = require('../internals/string-repeat');\n\n// `String.prototype.repeat` method\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\n$({ target: 'String', proto: true }, {\n  repeat: repeat\n});\n","var $ = require('../internals/export');\nvar global = require('../internals/global');\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true }, {\n  globalThis: global\n});\n","// @flow\r\nimport {type Direction, type Selection, DIRECTION} from './utils.js';\r\n\r\n\r\n/** Provides details of changing input */\r\nexport default\r\nclass ActionDetails {\r\n  /** Current input value */\r\n  value: string;\r\n  /** Current cursor position */\r\n  cursorPos: number;\r\n  /** Old input value */\r\n  oldValue: string;\r\n  /** Old selection */\r\n  oldSelection: Selection;\r\n\r\n  constructor (\r\n    value: string,\r\n    cursorPos: number,\r\n    oldValue: string,\r\n    oldSelection: Selection\r\n  ) {\r\n    this.value = value;\r\n    this.cursorPos = cursorPos;\r\n    this.oldValue = oldValue;\r\n    this.oldSelection = oldSelection;\r\n\r\n    // double check if left part was changed (autofilling, other non-standard input triggers)\r\n    while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {\r\n      --this.oldSelection.start;\r\n    }\r\n  }\r\n\r\n  /**\r\n    Start changing position\r\n    @readonly\r\n  */\r\n  get startChangePos (): number {\r\n    return Math.min(this.cursorPos, this.oldSelection.start);\r\n  }\r\n\r\n  /**\r\n    Inserted symbols count\r\n    @readonly\r\n  */\r\n  get insertedCount (): number {\r\n    return this.cursorPos - this.startChangePos;\r\n  }\r\n\r\n  /**\r\n    Inserted symbols\r\n    @readonly\r\n  */\r\n  get inserted (): string {\r\n    return this.value.substr(this.startChangePos, this.insertedCount);\r\n  }\r\n\r\n  /**\r\n    Removed symbols count\r\n    @readonly\r\n  */\r\n  get removedCount (): number {\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  /**\r\n    Removed symbols\r\n    @readonly\r\n  */\r\n  get removed (): string {\r\n    return this.oldValue.substr(this.startChangePos, this.removedCount);\r\n  }\r\n\r\n  /**\r\n    Unchanged head symbols\r\n    @readonly\r\n  */\r\n  get head (): string {\r\n    return this.value.substring(0, this.startChangePos);\r\n  }\r\n\r\n  /**\r\n    Unchanged tail symbols\r\n    @readonly\r\n  */\r\n  get tail (): string {\r\n    return this.value.substring(this.startChangePos + this.insertedCount);\r\n  }\r\n\r\n  /**\r\n    Remove direction\r\n    @readonly\r\n  */\r\n  get removeDirection (): Direction {\r\n    if (!this.removedCount || this.insertedCount) return DIRECTION.NONE;\r\n\r\n    // align right if delete at right or if range removed (event with backspace)\r\n    return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) ?\r\n      DIRECTION.RIGHT :\r\n      DIRECTION.LEFT;\r\n  }\r\n}\r\n","// @flow\r\n\r\n\r\n/**\r\n  Provides details of changing model value\r\n  @param {Object} [details]\r\n  @param {string} [details.inserted] - Inserted symbols\r\n  @param {boolean} [details.skip] - Can skip chars\r\n  @param {number} [details.removeCount] - Removed symbols count\r\n  @param {number} [details.tailShift] - Additional offset if any changes occurred before tail\r\n*/\r\nexport default\r\nclass ChangeDetails {\r\n  /** Inserted symbols */\r\n  inserted: string;\r\n  /** Can skip chars */\r\n  skip: boolean;\r\n  /** Additional offset if any changes occurred before tail */\r\n  tailShift: number;\r\n  /** Raw inserted is used by dynamic mask */\r\n  rawInserted: string;\r\n\r\n  constructor (details?: {\r\n    inserted?: $PropertyType<ChangeDetails, 'inserted'>,\r\n    rawInserted?: $PropertyType<ChangeDetails, 'rawInserted'>,\r\n    skip?: $PropertyType<ChangeDetails, 'skip'>,\r\n    tailShift?: $PropertyType<ChangeDetails, 'tailShift'>,\r\n  }) {\r\n    Object.assign(this, {\r\n      inserted: '',\r\n      rawInserted: '',\r\n      skip: false,\r\n      tailShift: 0,\r\n    }, details);\r\n  }\r\n\r\n  /**\r\n    Aggregate changes\r\n    @returns {ChangeDetails} `this`\r\n  */\r\n  aggregate (details: ChangeDetails): ChangeDetails {\r\n    this.rawInserted += details.rawInserted;\r\n    this.skip = this.skip || details.skip;\r\n    this.inserted += details.inserted;\r\n    this.tailShift += details.tailShift;\r\n    return this;\r\n  }\r\n\r\n  /** Total offset considering all changes */\r\n  get offset (): number {\r\n    return this.tailShift + this.inserted.length;\r\n  }\r\n}\r\n","// @flow\r\nimport type { TailDetails, AppendTail } from './tail-details.js';\r\nimport type ChangeDetails from './change-details.js';\r\n\r\n\r\ntype ContinuousTailState = {\r\n  value: $PropertyType<ContinuousTailDetails, 'value'>,\r\n  from: $PropertyType<ContinuousTailDetails, 'from'>,\r\n  stop?: $PropertyType<ContinuousTailDetails, 'stop'>,\r\n};\r\n\r\n/** Provides details of continuous extracted tail */\r\nexport default\r\nclass ContinuousTailDetails implements TailDetails {\r\n  /** Tail value as string */\r\n  value: string;\r\n  /** Tail start position */\r\n  from: number;\r\n  /** Start position */\r\n  stop: ?number;\r\n\r\n  constructor (value?: string='', from?: number=0, stop?: number) {\r\n    this.value = value;\r\n    this.from = from;\r\n    this.stop = stop;\r\n  }\r\n\r\n  toString (): string { return this.value; }\r\n\r\n  extend (tail: string | TailDetails): void {\r\n    this.value += String(tail);\r\n  }\r\n\r\n  appendTo (masked: AppendTail): ChangeDetails {\r\n    return masked.append(this.toString(), { tail: true })\r\n      .aggregate(masked._appendPlaceholder());\r\n  }\r\n\r\n  get state (): ContinuousTailState {\r\n    return {\r\n      value: this.value,\r\n      from: this.from,\r\n      stop: this.stop,\r\n    };\r\n  }\r\n\r\n  set state (state: ContinuousTailState) {\r\n    Object.assign(this, state);\r\n  }\r\n\r\n  shiftBefore (pos: number): string {\r\n    if (this.from >= pos || !this.value.length) return '';\r\n\r\n    const shiftChar = this.value[0];\r\n    this.value = this.value.slice(1);\r\n    return shiftChar;\r\n  }\r\n}\r\n","/**\r\n * Applies mask on element.\r\n * @constructor\r\n * @param {HTMLInputElement|HTMLTextAreaElement|MaskElement} el - Element to apply mask\r\n * @param {Object} opts - Custom mask options\r\n * @return {InputMask}\r\n */\r\nexport default\r\nfunction IMask (el, opts={}) {\r\n  // currently available only for input-like elements\r\n  return new IMask.InputMask(el, opts);\r\n}\r\n","// @flow\r\nimport ChangeDetails from '../core/change-details.js';\r\nimport ContinuousTailDetails from '../core/continuous-tail-details.js';\r\nimport { type Direction, DIRECTION, isString } from '../core/utils.js';\r\nimport { type TailDetails } from '../core/tail-details.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Supported mask type */\r\nexport\r\ntype Mask =\r\n  string |\r\n  String |\r\n  RegExp |\r\n  Class<Number> |\r\n  Class<Date> |\r\n  Array<any> |\r\n  $PropertyType<Masked<*>, 'validate'> |\r\n  Masked<*> |\r\n  Class<Masked<*>>;\r\n\r\nexport\r\ntype MaskedState = {|\r\n  _value: string,\r\n|};\r\n\r\n/** Append flags */\r\nexport\r\ntype AppendFlags = {\r\n  input?: boolean,\r\n  tail?: boolean,\r\n  raw?: boolean,\r\n  _beforeTailState?: any,  // TODO types...\r\n};\r\n\r\n/** Extract flags */\r\nexport\r\ntype ExtractFlags = {\r\n  raw?: boolean\r\n};\r\n\r\nexport\r\ntype MaskedOptions<MaskType> = {\r\n  mask: $PropertyType<Masked<MaskType>, 'mask'>,\r\n  parent?: $PropertyType<Masked<*>, 'parent'>,\r\n  prepare?: $PropertyType<Masked<MaskType>, 'prepare'>,\r\n  validate?: $PropertyType<Masked<MaskType>, 'validate'>,\r\n  commit?: $PropertyType<Masked<MaskType>, 'commit'>,\r\n  overwrite?: $PropertyType<Masked<MaskType>, 'overwrite'>,\r\n  format?: $PropertyType<Masked<MaskType>, 'format'>,\r\n  parse?: $PropertyType<Masked<MaskType>, 'parse'>,\r\n};\r\n\r\n\r\n/** Provides common masking stuff */\r\nexport default\r\nclass Masked<MaskType> {\r\n  static DEFAULTS: any; // $Shape<MaskedOptions>; TODO after fix https://github.com/facebook/flow/issues/4773\r\n\r\n  /** @type {Mask} */\r\n  mask: MaskType;\r\n  /** */ // $FlowFixMe no ideas\r\n  parent: ?Masked<*>;\r\n  /** Transforms value before mask processing */\r\n  prepare: (string, Masked<MaskType>, AppendFlags) => string;\r\n  /** Validates if value is acceptable */\r\n  validate: (string, Masked<MaskType>, AppendFlags) => boolean;\r\n  /** Does additional processing in the end of editing */\r\n  commit: (string, Masked<MaskType>) => void;\r\n  /** Format typed value to string */\r\n  format: (any, Masked<MaskType>) => string;\r\n  /** Parse strgin to get typed value */\r\n  parse: (string, Masked<MaskType>) => any;\r\n  /** Enable characters overwriting */\r\n  overwrite: ?boolean;\r\n  /** */\r\n  isInitialized: boolean;\r\n  _value: string;\r\n  _refreshing: ?boolean;\r\n  _isolated: ?boolean;\r\n\r\n  constructor (opts: {[string]: any}) {\r\n    this._value = '';\r\n    this._update({\r\n      ...Masked.DEFAULTS,\r\n      ...opts,\r\n    });\r\n    this.isInitialized = true;\r\n  }\r\n\r\n  /** Sets and applies new options */\r\n  updateOptions (opts: {[string]: any}) {\r\n    if (!Object.keys(opts).length) return;\r\n    this.withValueRefresh(this._update.bind(this, opts));\r\n  }\r\n\r\n  /**\r\n    Sets new options\r\n    @protected\r\n  */\r\n  _update (opts: {[string]: any}) {\r\n    Object.assign(this, opts);\r\n  }\r\n\r\n  /** Mask state */\r\n  get state (): any {\r\n    return {\r\n      _value: this.value,\r\n    };\r\n  }\r\n\r\n  set state (state: any) {\r\n    this._value = state._value;\r\n  }\r\n\r\n  /** Resets value */\r\n  reset () {\r\n    this._value = '';\r\n  }\r\n\r\n  /** */\r\n  get value (): string {\r\n    return this._value;\r\n  }\r\n\r\n  set value (value: string) {\r\n    this.resolve(value);\r\n  }\r\n\r\n  /** Resolve new value */\r\n  resolve (value: string): string {\r\n    this.reset();\r\n    this.append(value, {input: true}, '');\r\n    this.doCommit();\r\n    return this.value;\r\n  }\r\n\r\n  /** */\r\n  get unmaskedValue (): string {\r\n    return this.value;\r\n  }\r\n\r\n  set unmaskedValue (value: string) {\r\n    this.reset();\r\n    this.append(value, {}, '');\r\n    this.doCommit();\r\n  }\r\n\r\n  /** */\r\n  get typedValue (): any {\r\n    return this.doParse(this.value);\r\n  }\r\n\r\n  set typedValue (value: any) {\r\n    this.value = this.doFormat(value);\r\n  }\r\n\r\n  /** Value that includes raw user input */\r\n  get rawInputValue (): string {\r\n    return this.extractInput(0, this.value.length, {raw: true});\r\n  }\r\n\r\n  set rawInputValue (value: string) {\r\n    this.reset();\r\n    this.append(value, {raw: true}, '');\r\n    this.doCommit();\r\n  }\r\n\r\n  /** */\r\n  get isComplete (): boolean {\r\n    return true;\r\n  }\r\n\r\n  /** Finds nearest input position in direction */\r\n  nearestInputPos (cursorPos: number, direction?: Direction): number {\r\n    return cursorPos;\r\n  }\r\n\r\n  /** Extracts value in range considering flags */\r\n  extractInput (fromPos?: number=0, toPos?: number=this.value.length, flags?: ExtractFlags): string {\r\n    return this.value.slice(fromPos, toPos);\r\n  }\r\n\r\n  /** Extracts tail in range */\r\n  extractTail (fromPos?: number=0, toPos?: number=this.value.length): TailDetails {\r\n    return new ContinuousTailDetails(this.extractInput(fromPos, toPos), fromPos);\r\n  }\r\n\r\n  /** Appends tail */\r\n  // $FlowFixMe no ideas\r\n  appendTail (tail: string | String | TailDetails): ChangeDetails {\r\n    if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\r\n\r\n    return tail.appendTo(this);\r\n  }\r\n\r\n  /** Appends char */\r\n  _appendCharRaw (ch: string, flags: AppendFlags={}): ChangeDetails {\r\n    if (!ch) return new ChangeDetails();\r\n\r\n    this._value += ch;\r\n    return new ChangeDetails({\r\n      inserted: ch,\r\n      rawInserted: ch,\r\n    });\r\n  }\r\n\r\n  /** Appends char */\r\n  _appendChar (ch: string, flags: AppendFlags={}, checkTail?: TailDetails): ChangeDetails {\r\n    const consistentState: MaskedState = this.state;\r\n    let details: ChangeDetails = this._appendCharRaw(this.doPrepare(ch, flags), flags);\r\n\r\n    if (details.inserted) {\r\n      let consistentTail;\r\n      let appended = this.doValidate(flags) !== false;\r\n\r\n      if (appended && checkTail != null) {\r\n        // validation ok, check tail\r\n        const beforeTailState = this.state;\r\n        if (this.overwrite) {\r\n          consistentTail = checkTail.state;\r\n          checkTail.shiftBefore(this.value.length);\r\n        }\r\n\r\n        const tailDetails = this.appendTail(checkTail);\r\n\r\n        appended = tailDetails.rawInserted === checkTail.toString();\r\n\r\n        // if ok, rollback state after tail\r\n        if (appended && tailDetails.inserted) this.state = beforeTailState;\r\n      }\r\n\r\n      // revert all if something went wrong\r\n      if (!appended) {\r\n        details = new ChangeDetails();\r\n        this.state = consistentState;\r\n        if (checkTail && consistentTail) checkTail.state = consistentTail;\r\n      }\r\n    }\r\n    return details;\r\n  }\r\n\r\n  /** Appends optional placeholder at end */\r\n  _appendPlaceholder (): ChangeDetails {\r\n    return new ChangeDetails();\r\n  }\r\n\r\n  /** Appends symbols considering flags */\r\n  // $FlowFixMe no ideas\r\n  append (str: string, flags?: AppendFlags, tail?: string | String | TailDetails): ChangeDetails {\r\n    if (!isString(str)) throw new Error('value should be string');\r\n    const details = new ChangeDetails();\r\n    const checkTail = isString(tail) ? new ContinuousTailDetails(String(tail)) : tail;\r\n    if (flags && flags.tail) flags._beforeTailState = this.state;\r\n\r\n    for (let ci=0; ci<str.length; ++ci) {\r\n      details.aggregate(this._appendChar(str[ci], flags, checkTail));\r\n    }\r\n\r\n    // append tail but aggregate only tailShift\r\n    if (checkTail != null) {\r\n      details.tailShift += this.appendTail(checkTail).tailShift;\r\n      // TODO it's a good idea to clear state after appending ends\r\n      // but it causes bugs when one append calls another (when dynamic dispatch set rawInputValue)\r\n      // this._resetBeforeTailState();\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  /** */\r\n  remove (fromPos?: number=0, toPos?: number=this.value.length): ChangeDetails {\r\n    this._value = this.value.slice(0, fromPos) + this.value.slice(toPos);\r\n    return new ChangeDetails();\r\n  }\r\n\r\n  /** Calls function and reapplies current value */\r\n  withValueRefresh<T>(fn: () => T): T {\r\n    if (this._refreshing || !this.isInitialized) return fn();\r\n    this._refreshing = true;\r\n\r\n    const rawInput = this.rawInputValue;\r\n    const value = this.value;\r\n\r\n    const ret = fn();\r\n\r\n    this.rawInputValue = rawInput;\r\n    // append lost trailing chars at end\r\n    if (this.value && this.value !== value && value.indexOf(this.value) === 0) {\r\n      this.append(value.slice(this.value.length), {}, '');\r\n    }\r\n\r\n    delete this._refreshing;\r\n    return ret;\r\n  }\r\n\r\n  /** */\r\n  runIsolated<T>(fn: (masked: any) => T): T {\r\n    if (this._isolated || !this.isInitialized) return fn(this);\r\n    this._isolated = true;\r\n    const state = this.state;\r\n\r\n    const ret = fn(this);\r\n\r\n    this.state = state;\r\n    delete this._isolated;\r\n\r\n    return ret;\r\n  }\r\n\r\n  /**\r\n    Prepares string before mask processing\r\n    @protected\r\n  */\r\n  doPrepare (str: string, flags: AppendFlags={}): string {\r\n    return this.prepare ?\r\n      this.prepare(str, this, flags) :\r\n      str;\r\n  }\r\n\r\n  /**\r\n    Validates if value is acceptable\r\n    @protected\r\n  */\r\n  doValidate (flags: AppendFlags): boolean {\r\n    return (!this.validate || this.validate(this.value, this, flags)) &&\r\n      (!this.parent || this.parent.doValidate(flags));\r\n  }\r\n\r\n  /**\r\n    Does additional processing in the end of editing\r\n    @protected\r\n  */\r\n  doCommit () {\r\n    if (this.commit) this.commit(this.value, this);\r\n  }\r\n\r\n  /** */\r\n  doFormat (value: any): string {\r\n    return this.format ? this.format(value, this) : value;\r\n  }\r\n\r\n  /** */\r\n  doParse (str: string): string {\r\n    return this.parse ? this.parse(str, this) : str;\r\n  }\r\n\r\n  /** */\r\n  splice (start: number, deleteCount: number, inserted: string, removeDirection: Direction): ChangeDetails {\r\n    const tailPos: number = start + deleteCount;\r\n    const tail: TailDetails = this.extractTail(tailPos);\r\n\r\n    let startChangePos: number = this.nearestInputPos(start, removeDirection);\r\n    const changeDetails: ChangeDetails = new ChangeDetails({\r\n      tailShift: startChangePos - start  // adjust tailShift if start was aligned\r\n    }).aggregate(this.remove(startChangePos))\r\n      .aggregate(this.append(inserted, {input: true}, tail));\r\n\r\n    return changeDetails;\r\n  }\r\n}\r\nMasked.DEFAULTS = {\r\n  format: v => v,\r\n  parse: v => v,\r\n};\r\n\r\n\r\nIMask.Masked = Masked;\r\n","// @flow\r\nimport { isString } from '../core/utils.js';\r\nimport type Masked from './base.js';\r\nimport { type Mask } from './base.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Get Masked class by mask type */\r\nexport\r\nfunction maskedClass (mask: Mask): Class<Masked<*>> {\r\n  if (mask == null) {\r\n    throw new Error('mask property should be defined');\r\n  }\r\n\r\n  // $FlowFixMe\r\n  if (mask instanceof RegExp) return IMask.MaskedRegExp;\r\n  // $FlowFixMe\r\n  if (isString(mask)) return IMask.MaskedPattern;\r\n  // $FlowFixMe\r\n  if (mask instanceof Date || mask === Date) return IMask.MaskedDate;\r\n  // $FlowFixMe\r\n  if (mask instanceof Number || typeof mask === 'number' || mask === Number) return IMask.MaskedNumber;\r\n  // $FlowFixMe\r\n  if (Array.isArray(mask) || mask === Array) return IMask.MaskedDynamic;\r\n  // $FlowFixMe\r\n  if (IMask.Masked && mask.prototype instanceof IMask.Masked) return mask;\r\n  // $FlowFixMe\r\n  if (mask instanceof Function) return IMask.MaskedFunction;\r\n  // $FlowFixMe\r\n  if (mask instanceof IMask.Masked) return mask.constructor;\r\n\r\n  console.warn('Mask not found for mask', mask);  // eslint-disable-line no-console\r\n  // $FlowFixMe\r\n  return IMask.Masked;\r\n}\r\n\r\n/** Creates new {@link Masked} depending on mask type */\r\nexport default\r\nfunction createMask (opts: {mask: Mask} | Masked<*>): Masked<*> {\r\n  // $FlowFixMe\r\n  if (IMask.Masked && (opts instanceof IMask.Masked)) return opts;\r\n\r\n  opts = {...opts};\r\n  const mask = opts.mask;\r\n\r\n  // $FlowFixMe\r\n  if (IMask.Masked && (mask instanceof IMask.Masked)) return mask;\r\n\r\n  const MaskedClass = maskedClass(mask);\r\n  if (!MaskedClass) throw new Error('Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.');\r\n  return new MaskedClass(opts);\r\n}\r\n\r\n\r\nIMask.createMask = createMask;\r\n","// @flow\r\nimport createMask from '../factory.js';\r\nimport type Masked from '../base.js';\r\nimport type MaskedPattern from '../pattern.js';\r\nimport {type TailDetails} from '../../core/tail-details.js';\r\nimport {type Mask, type ExtractFlags, type AppendFlags} from '../base.js';\r\nimport ChangeDetails from '../../core/change-details.js';\r\nimport {DIRECTION, type Direction} from '../../core/utils.js';\r\nimport {type PatternBlock} from './block.js';\r\n\r\n\r\nexport\r\ntype Definitions = {[string]: Mask};\r\n\r\n/** */\r\ntype PatternInputDefinitionOptions = {\r\n  parent: $PropertyType<PatternInputDefinition, 'parent'>,\r\n  mask: Mask,\r\n  isOptional: $PropertyType<PatternInputDefinition, 'isOptional'>,\r\n  lazy: $PropertyType<PatternInputDefinition, 'lazy'>,\r\n  placeholderChar: $PropertyType<PatternInputDefinition, 'placeholderChar'>,\r\n};\r\n\r\ntype PatternInputDefinitionState = {\r\n  masked: *,\r\n  _isFilled: boolean,\r\n};\r\n\r\nexport\r\nconst DEFAULT_INPUT_DEFINITIONS: { [string]: RegExp } = {\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-\\u0A0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BD\\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\n\r\n\r\n/** */\r\nexport default\r\nclass PatternInputDefinition implements PatternBlock {\r\n  /** */\r\n  +masked: Masked<*>;\r\n  /** */\r\n  parent: Masked<*>;\r\n  /** */\r\n  isOptional: boolean;\r\n  /** */\r\n  _isFilled: boolean;\r\n  /** */\r\n  lazy: $PropertyType<MaskedPattern, 'lazy'>;\r\n  /** */\r\n  placeholderChar: $PropertyType<MaskedPattern, 'placeholderChar'>;\r\n\r\n\r\n  constructor(opts: PatternInputDefinitionOptions) {\r\n    const {mask, ...blockOpts} = opts;\r\n\r\n    this.masked = createMask({mask});\r\n    Object.assign(this, blockOpts);\r\n  }\r\n\r\n  reset () {\r\n    this._isFilled = false;\r\n    this.masked.reset();\r\n  }\r\n\r\n  remove (fromPos?: number=0, toPos?: number=this.value.length): ChangeDetails {\r\n    if (fromPos === 0 && toPos >= 1) {\r\n      this._isFilled = false;\r\n      return this.masked.remove(fromPos, toPos);\r\n    }\r\n\r\n    return new ChangeDetails();\r\n  }\r\n\r\n  get value (): string {\r\n    return this.masked.value ||\r\n      (this._isFilled && !this.isOptional ?\r\n        this.placeholderChar :\r\n        '');\r\n  }\r\n\r\n  get unmaskedValue (): string {\r\n    return this.masked.unmaskedValue;\r\n  }\r\n\r\n  get isComplete (): boolean {\r\n    return Boolean(this.masked.value) || this.isOptional;\r\n  }\r\n\r\n  _appendChar (str: string, flags: AppendFlags={}): ChangeDetails {\r\n    if (this._isFilled) return new ChangeDetails();\r\n\r\n    const state = this.masked.state;\r\n    // simulate input\r\n    const details = this.masked._appendChar(str, flags);\r\n\r\n    if (details.inserted && this.doValidate(flags) === false) {\r\n      details.inserted = details.rawInserted = '';\r\n      this.masked.state = state;\r\n    }\r\n\r\n    if (!details.inserted && !this.isOptional && !this.lazy && !flags.input) {\r\n      details.inserted = this.placeholderChar;\r\n    }\r\n    details.skip = !details.inserted && !this.isOptional;\r\n    this._isFilled = Boolean(details.inserted);\r\n\r\n    return details;\r\n  }\r\n\r\n  append (...args: *): ChangeDetails {\r\n    return this.masked.append(...args);\r\n  }\r\n\r\n  _appendPlaceholder (): ChangeDetails {\r\n    const details = new ChangeDetails();\r\n\r\n    if (this._isFilled || this.isOptional) return details;\r\n\r\n    this._isFilled = true;\r\n    details.inserted = this.placeholderChar;\r\n    return details;\r\n  }\r\n\r\n  extractTail (...args: *): TailDetails {\r\n    return this.masked.extractTail(...args);\r\n  }\r\n\r\n  appendTail (...args: *): ChangeDetails {\r\n    return this.masked.appendTail(...args);\r\n  }\r\n\r\n  extractInput (fromPos?: number=0, toPos?: number=this.value.length, flags?: ExtractFlags): string {\r\n    return this.masked.extractInput(fromPos, toPos, flags);\r\n  }\r\n\r\n  nearestInputPos (cursorPos: number, direction: Direction=DIRECTION.NONE): number {\r\n    const minPos = 0;\r\n    const maxPos = this.value.length;\r\n    const boundPos = Math.min(Math.max(cursorPos, minPos), maxPos);\r\n\r\n    switch (direction) {\r\n      case DIRECTION.LEFT:\r\n      case DIRECTION.FORCE_LEFT:\r\n        return this.isComplete ? boundPos : minPos;\r\n      case DIRECTION.RIGHT:\r\n      case DIRECTION.FORCE_RIGHT:\r\n        return this.isComplete ? boundPos : maxPos;\r\n      case DIRECTION.NONE:\r\n      default: return boundPos;\r\n    }\r\n  }\r\n\r\n  doValidate (...args: *): boolean {\r\n    return this.masked.doValidate(...args) && (\r\n      !this.parent || this.parent.doValidate(...args));\r\n  }\r\n\r\n  doCommit () {\r\n    this.masked.doCommit();\r\n  }\r\n\r\n  get state (): PatternInputDefinitionState {\r\n    return {\r\n      masked: this.masked.state,\r\n      _isFilled: this._isFilled,\r\n    };\r\n  }\r\n\r\n  set state (state: PatternInputDefinitionState) {\r\n    this.masked.state = state.masked;\r\n    this._isFilled = state._isFilled;\r\n  }\r\n}\r\n","// @flow\r\nimport ChangeDetails from '../../core/change-details.js';\r\nimport { DIRECTION, type Direction, isString } from '../../core/utils.js';\r\nimport { type TailDetails } from '../../core/tail-details.js';\r\nimport ContinuousTailDetails from '../../core/continuous-tail-details.js';\r\nimport { type ExtractFlags, type AppendFlags, type MaskedState } from '../base.js';\r\nimport { type PatternBlock } from './block.js';\r\n\r\n\r\n/** */\r\ntype PatternFixedDefinitionOptions = {\r\n  char: $PropertyType<PatternFixedDefinition, 'char'>,\r\n  isUnmasking?: $PropertyType<PatternFixedDefinition, 'isUnmasking'>,\r\n};\r\n\r\ntype PatternFixedDefinitionState = {|\r\n  ...MaskedState,\r\n  _isRawInput: ?boolean,\r\n|};\r\n\r\nexport default\r\nclass PatternFixedDefinition implements PatternBlock {\r\n  /** */\r\n  _value: string;\r\n  /** */\r\n  char: string;\r\n  /** */\r\n  isUnmasking: ?boolean;\r\n  /** */\r\n  _isRawInput: ?boolean;\r\n\r\n  constructor(opts: PatternFixedDefinitionOptions) {\r\n    Object.assign(this, opts);\r\n    this._value = '';\r\n  }\r\n\r\n  get value (): string {\r\n    return this._value;\r\n  }\r\n\r\n  get unmaskedValue (): string {\r\n    return this.isUnmasking ? this.value : '';\r\n  }\r\n\r\n  reset () {\r\n    this._isRawInput = false;\r\n    this._value = '';\r\n  }\r\n\r\n  remove (fromPos?: number=0, toPos?: number=this._value.length): ChangeDetails {\r\n    this._value = this._value.slice(0, fromPos) + this._value.slice(toPos);\r\n    if (!this._value) this._isRawInput = false;\r\n\r\n    return new ChangeDetails();\r\n  }\r\n\r\n  nearestInputPos (cursorPos: number, direction: Direction=DIRECTION.NONE): number {\r\n    const minPos = 0;\r\n    const maxPos = this._value.length;\r\n\r\n    switch (direction) {\r\n      case DIRECTION.LEFT:\r\n      case DIRECTION.FORCE_LEFT:\r\n        return minPos;\r\n      case DIRECTION.NONE:\r\n      case DIRECTION.RIGHT:\r\n      case DIRECTION.FORCE_RIGHT:\r\n      default: return maxPos;\r\n    }\r\n  }\r\n\r\n  extractInput (fromPos?: number=0, toPos?: number=this._value.length, flags?: ExtractFlags={}): string {\r\n    return flags.raw && this._isRawInput && this._value.slice(fromPos, toPos) || '';\r\n  }\r\n\r\n  get isComplete (): boolean {\r\n    return true;\r\n  }\r\n\r\n  _appendChar (str: string, flags?: AppendFlags={}): ChangeDetails {\r\n    const details = new ChangeDetails();\r\n\r\n    if (this._value) return details;\r\n\r\n    const appended = this.char === str[0];\r\n    const isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && !flags.tail;\r\n    if (isResolved) details.rawInserted = this.char;\r\n    this._value = details.inserted = this.char;\r\n    this._isRawInput = isResolved && (flags.raw || flags.input);\r\n\r\n    return details;\r\n  }\r\n\r\n  _appendPlaceholder (): ChangeDetails {\r\n    const details = new ChangeDetails();\r\n    if (this._value) return details;\r\n\r\n    this._value = details.inserted = this.char;\r\n    return details;\r\n  }\r\n\r\n  extractTail (fromPos?: number=0, toPos?: number=this.value.length): TailDetails {\r\n    return new ContinuousTailDetails('');\r\n  }\r\n\r\n  // $FlowFixMe no ideas\r\n  appendTail (tail: string | String | TailDetails): ChangeDetails {\r\n    if (isString(tail)) tail = new ContinuousTailDetails(String(tail));\r\n\r\n    return tail.appendTo(this);\r\n  }\r\n\r\n  append (str: string, flags?: AppendFlags, tail?: TailDetails): ChangeDetails {\r\n    const details = this._appendChar(str, flags);\r\n\r\n    if (tail != null) {\r\n      details.tailShift += this.appendTail(tail).tailShift;\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  doCommit () {}\r\n\r\n  get state (): PatternFixedDefinitionState {\r\n    return {\r\n      _value: this._value,\r\n      _isRawInput: this._isRawInput,\r\n    };\r\n  }\r\n\r\n  set state (state: PatternFixedDefinitionState) {\r\n    Object.assign(this, state);\r\n  }\r\n}\r\n","// @flow\r\nimport type { TailDetails, AppendTail } from '../../core/tail-details.js';\r\nimport ChangeDetails from '../../core/change-details.js';\r\nimport { isString } from '../../core/utils.js';\r\nimport ContinuousTailDetails from '../../core/continuous-tail-details.js';\r\nimport IMask from '../../core/holder.js';\r\n\r\n\r\ntype ChunksTailState = {\r\n  chunks: $PropertyType<ChunksTailDetails, 'chunks'>,\r\n  from: $PropertyType<ChunksTailDetails, 'from'>,\r\n  stop?: $PropertyType<ChunksTailDetails, 'stop'>,\r\n  blockIndex?: $PropertyType<ChunksTailDetails, 'blockIndex'>,\r\n};\r\n\r\nexport default\r\nclass ChunksTailDetails implements TailDetails {\r\n  chunks: Array<TailDetails>;\r\n  from: number;\r\n  stop: ?number;\r\n  /** */\r\n  blockIndex: ?number;\r\n\r\n  constructor (chunks?: Array<TailDetails>=[], from?: number=0) {\r\n    this.chunks = chunks;\r\n    this.from = from;\r\n  }\r\n\r\n  toString (): string {\r\n    return this.chunks.map(String).join('');\r\n  }\r\n\r\n  // $FlowFixMe no ideas\r\n  extend (tailChunk: string | String | TailDetails): void {\r\n    if (!String(tailChunk)) return;\r\n    if (isString(tailChunk)) tailChunk = new ContinuousTailDetails(String(tailChunk));\r\n\r\n    const lastChunk = this.chunks[this.chunks.length-1];\r\n    const extendLast = lastChunk &&\r\n      // if stops are same or tail has no stop\r\n      (lastChunk.stop === tailChunk.stop || tailChunk.stop == null) &&\r\n      // if tail chunk goes just after last chunk\r\n      tailChunk.from === (lastChunk.from + lastChunk.toString().length);\r\n\r\n    if (tailChunk instanceof ContinuousTailDetails) {\r\n      // check the ability to extend previous chunk\r\n      if (extendLast) {\r\n        // extend previous chunk\r\n        lastChunk.extend(tailChunk.toString());\r\n      } else {\r\n        // append new chunk\r\n        this.chunks.push(tailChunk);\r\n      }\r\n    } else if (tailChunk instanceof ChunksTailDetails) {\r\n      if (tailChunk.stop == null) {\r\n        // unwrap floating chunks to parent, keeping `from` pos\r\n        let firstTailChunk;\r\n        while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {\r\n          firstTailChunk = tailChunk.chunks.shift();\r\n          firstTailChunk.from += tailChunk.from;\r\n          this.extend(firstTailChunk);\r\n        }\r\n      }\r\n\r\n      // if tail chunk still has value\r\n      if (tailChunk.toString()) {\r\n        // if chunks contains stops, then popup stop to container\r\n        tailChunk.stop = tailChunk.blockIndex;\r\n        this.chunks.push(tailChunk);\r\n      }\r\n    }\r\n  }\r\n\r\n  appendTo (masked: AppendTail): ChangeDetails {\r\n    // $FlowFixMe\r\n    if (!(masked instanceof IMask.MaskedPattern)) {\r\n      const tail = new ContinuousTailDetails(this.toString());\r\n      return tail.appendTo(masked);\r\n    }\r\n\r\n    const details = new ChangeDetails();\r\n\r\n    for (let ci=0; ci < this.chunks.length && !details.skip; ++ci) {\r\n      const chunk = this.chunks[ci];\r\n\r\n      const lastBlockIter = masked._mapPosToBlock(masked.value.length);\r\n      const stop = chunk.stop;\r\n      let chunkBlock;\r\n      if (stop != null &&\r\n        // if block not found or stop is behind lastBlock\r\n        (!lastBlockIter || lastBlockIter.index <= stop)\r\n      ) {\r\n        if (\r\n          chunk instanceof ChunksTailDetails ||\r\n          // for continuous block also check if stop is exist\r\n          masked._stops.indexOf(stop) >= 0\r\n        ) {\r\n          details.aggregate(masked._appendPlaceholder(stop));\r\n        }\r\n        chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop];\r\n      }\r\n\r\n      if (chunkBlock) {\r\n        const tailDetails = chunkBlock.appendTail(chunk);\r\n        tailDetails.skip = false; // always ignore skip, it will be set on last\r\n        details.aggregate(tailDetails);\r\n        masked._value += tailDetails.inserted;\r\n\r\n        // get not inserted chars\r\n        const remainChars = chunk.toString().slice(tailDetails.rawInserted.length);\r\n        if (remainChars) details.aggregate(masked.append(remainChars, { tail: true }));\r\n      } else {\r\n        details.aggregate(masked.append(chunk.toString(), { tail: true }));\r\n      }\r\n    };\r\n\r\n    return details;\r\n  }\r\n\r\n  get state (): ChunksTailState {\r\n    return {\r\n      chunks: this.chunks.map(c => c.state),\r\n      from: this.from,\r\n      stop: this.stop,\r\n      blockIndex: this.blockIndex,\r\n    };\r\n  }\r\n\r\n  set state (state: ChunksTailState) {\r\n    const { chunks, ...props } = state;\r\n    Object.assign(this, props);\r\n    this.chunks = chunks.map(cstate => {\r\n      const chunk = \"chunks\" in cstate ?\r\n        new ChunksTailDetails() :\r\n        new ContinuousTailDetails();\r\n      // $FlowFixMe already checked above\r\n      chunk.state = cstate;\r\n      return chunk;\r\n    });\r\n  }\r\n\r\n  shiftBefore (pos: number): string {\r\n    if (this.from >= pos || !this.chunks.length) return '';\r\n\r\n    const chunkShiftPos = pos - this.from;\r\n    let ci=0;\r\n    while (ci < this.chunks.length) {\r\n      const chunk = this.chunks[ci];\r\n      const shiftChar = chunk.shiftBefore(chunkShiftPos);\r\n\r\n      if (chunk.toString()) {\r\n        // chunk still contains value\r\n        // but not shifted - means no more available chars to shift\r\n        if (!shiftChar) break;\r\n        ++ci;\r\n      } else {\r\n        // clean if chunk has no value\r\n        this.chunks.splice(ci, 1);\r\n      }\r\n\r\n      if (shiftChar) return shiftChar;\r\n    }\r\n\r\n    return '';\r\n  }\r\n}\r\n","// @flow\r\nimport Masked, {type MaskedOptions} from './base.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Masking by RegExp */\r\nexport default\r\nclass MaskedRegExp extends Masked<RegExp> {\r\n  /**\r\n    @override\r\n    @param {Object} opts\r\n  */\r\n  _update (opts: $Shape<MaskedOptions<RegExp>>) {\r\n    if (opts.mask) opts.validate = (value) => value.search(opts.mask) >= 0;\r\n    super._update(opts);\r\n  }\r\n}\r\n\r\n\r\nIMask.MaskedRegExp = MaskedRegExp;\r\n","// @flow\r\nimport {DIRECTION, type Direction, forceDirection} from '../core/utils.js';\r\nimport ChangeDetails from '../core/change-details.js';\r\nimport Masked, {type AppendFlags, type ExtractFlags, type MaskedOptions, type MaskedState} from './base.js';\r\nimport PatternInputDefinition, {DEFAULT_INPUT_DEFINITIONS, type Definitions} from './pattern/input-definition.js';\r\nimport PatternFixedDefinition from './pattern/fixed-definition.js';\r\nimport { type TailDetails } from '../core/tail-details.js';\r\nimport ChunksTailDetails from './pattern/chunk-tail-details.js';\r\nimport ContinuousTailDetails from '../core/continuous-tail-details.js';\r\nimport {type PatternBlock} from './pattern/block.js';\r\nimport createMask from './factory.js';\r\nimport IMask from '../core/holder.js';\r\nimport './regexp.js';  // support for default definitions which are regexp's\r\n\r\n\r\ntype MaskedPatternOptions = {\r\n  ...MaskedOptions<string>,\r\n  definitions?: $PropertyType<MaskedPattern, 'definitions'>,\r\n  blocks?: $PropertyType<MaskedPattern, 'blocks'>,\r\n  placeholderChar?: $PropertyType<MaskedPattern, 'placeholderChar'>,\r\n  lazy?: $PropertyType<MaskedPattern, 'lazy'>,\r\n};\r\n\r\ntype MaskedPatternState = {|\r\n  ...MaskedState,\r\n  _blocks: Array<*>,\r\n|};\r\n\r\ntype BlockPosData = {\r\n  index: number,\r\n  offset: number,\r\n};\r\n\r\n/**\r\n  Pattern mask\r\n  @param {Object} opts\r\n  @param {Object} opts.blocks\r\n  @param {Object} opts.definitions\r\n  @param {string} opts.placeholderChar\r\n  @param {boolean} opts.lazy\r\n*/\r\nexport default\r\nclass MaskedPattern extends Masked<string> {\r\n  static DEFAULTS: any;\r\n  static STOP_CHAR: string;\r\n  static ESCAPE_CHAR: string;\r\n  static InputDefinition: Class<PatternInputDefinition>;\r\n  static FixedDefinition: Class<PatternFixedDefinition>;\r\n\r\n  /** */\r\n  blocks: {[string]: MaskedOptions<any>};\r\n  /** */\r\n  definitions: Definitions;\r\n  /** Single char for empty input */\r\n  placeholderChar: string;\r\n  /** Show placeholder only when needed */\r\n  lazy: boolean;\r\n  _blocks: Array<PatternBlock>;\r\n  _maskedBlocks: {[string]: Array<number>};\r\n  _stops: Array<number>;\r\n\r\n  constructor (opts: any={}) {  // TODO type $Shape<MaskedPatternOptions>={} does not work\r\n    opts.definitions = Object.assign({}, DEFAULT_INPUT_DEFINITIONS, opts.definitions);\r\n    super({\r\n      ...MaskedPattern.DEFAULTS,\r\n      ...opts,\r\n    });\r\n  }\r\n\r\n  /**\r\n    @override\r\n    @param {Object} opts\r\n  */\r\n  _update (opts: $Shape<MaskedPatternOptions>={}) {\r\n    opts.definitions = Object.assign({}, this.definitions, opts.definitions);\r\n    super._update(opts);\r\n    this._rebuildMask();\r\n  }\r\n\r\n  /** */\r\n  _rebuildMask () {\r\n    const defs = this.definitions;\r\n    this._blocks = [];\r\n    this._stops = [];\r\n    this._maskedBlocks = {};\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\r\n    for (let i=0; i<pattern.length; ++i) {\r\n      if (this.blocks) {\r\n        const p = pattern.slice(i);\r\n        const bNames = Object.keys(this.blocks).filter(bName => p.indexOf(bName) === 0);\r\n        // order by key length\r\n        bNames.sort((a, b) => b.length - a.length);\r\n        // use block name with max length\r\n        const bName = bNames[0];\r\n        if (bName) {\r\n          // $FlowFixMe no ideas\r\n          const maskedBlock = createMask({\r\n            parent: this,\r\n            lazy: this.lazy,\r\n            placeholderChar: this.placeholderChar,\r\n            overwrite: this.overwrite,\r\n            ...this.blocks[bName],\r\n          });\r\n\r\n          if (maskedBlock) {\r\n            this._blocks.push(maskedBlock);\r\n\r\n            // store block index\r\n            if (!this._maskedBlocks[bName]) this._maskedBlocks[bName] = [];\r\n            this._maskedBlocks[bName].push(this._blocks.length - 1);\r\n          }\r\n\r\n          i += bName.length - 1;\r\n          continue;\r\n        }\r\n      }\r\n\r\n      let char = pattern[i];\r\n      let isInput = char in defs;\r\n\r\n      if (char === MaskedPattern.STOP_CHAR) {\r\n        this._stops.push(this._blocks.length);\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        if (!char) break;\r\n        isInput = false;\r\n      }\r\n\r\n      const def = isInput ?\r\n        new PatternInputDefinition({\r\n          parent: this,\r\n          lazy: this.lazy,\r\n          placeholderChar: this.placeholderChar,\r\n          mask: defs[char],\r\n          isOptional: optionalBlock,\r\n        }) :\r\n        new PatternFixedDefinition({\r\n          char,\r\n          isUnmasking: unmaskingBlock,\r\n        });\r\n\r\n      this._blocks.push(def);\r\n    }\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get state (): MaskedPatternState {\r\n    return {\r\n      ...super.state,\r\n      _blocks: this._blocks.map(b => b.state),\r\n    };\r\n  }\r\n\r\n  set state (state: MaskedPatternState) {\r\n    const {_blocks, ...maskedState} = state;\r\n    this._blocks.forEach((b, bi) => b.state = _blocks[bi]);\r\n    super.state = maskedState;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  reset () {\r\n    super.reset();\r\n    this._blocks.forEach(b => b.reset());\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get isComplete (): boolean {\r\n    return this._blocks.every(b => b.isComplete);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doCommit () {\r\n    this._blocks.forEach(b => b.doCommit());\r\n    super.doCommit();\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get unmaskedValue (): string {\r\n    return this._blocks.reduce((str, b) => str += b.unmaskedValue, '');\r\n  }\r\n\r\n  set unmaskedValue (unmaskedValue: string) {\r\n    super.unmaskedValue = unmaskedValue;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get value (): string {\r\n    // TODO return _value when not in change?\r\n    return this._blocks.reduce((str, b) => str += b.value, '');\r\n  }\r\n\r\n  set value (value: string) {\r\n    super.value = value;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  appendTail (tail: string | String | TailDetails): ChangeDetails {\r\n    return super.appendTail(tail).aggregate(this._appendPlaceholder());\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _appendCharRaw (ch: string, flags: AppendFlags={}): ChangeDetails {\r\n    const blockIter = this._mapPosToBlock(this.value.length);\r\n    const details = new ChangeDetails();\r\n    if (!blockIter) return details;\r\n\r\n    for (let bi=blockIter.index; ; ++bi) {\r\n      const block = this._blocks[bi];\r\n      if (!block) break;\r\n\r\n      const blockDetails = block._appendChar(ch, flags);\r\n\r\n      const skip = blockDetails.skip;\r\n      details.aggregate(blockDetails);\r\n\r\n      if (skip || blockDetails.rawInserted) break; // go next char\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  extractTail (fromPos?: number=0, toPos?: number=this.value.length): ChunksTailDetails {\r\n    const chunkTail = new ChunksTailDetails();\r\n    if (fromPos === toPos) return chunkTail;\r\n\r\n    this._forEachBlocksInRange(fromPos, toPos, (b, bi, bFromPos, bToPos) => {\r\n      const blockChunk = b.extractTail(bFromPos, bToPos);\r\n      blockChunk.stop = this._findStopBefore(bi);\r\n      blockChunk.from = this._blockStartPos(bi);\r\n      if (blockChunk instanceof ChunksTailDetails) blockChunk.blockIndex = bi;\r\n\r\n      chunkTail.extend(blockChunk);\r\n    });\r\n\r\n    return chunkTail;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  extractInput (fromPos?: number=0, toPos?: number=this.value.length, flags: ExtractFlags={}): string {\r\n    if (fromPos === toPos) return '';\r\n\r\n    let input = '';\r\n\r\n    this._forEachBlocksInRange(fromPos, toPos, (b, _, fromPos, toPos) => {\r\n      input += b.extractInput(fromPos, toPos, flags);\r\n    });\r\n\r\n    return input;\r\n  }\r\n\r\n  _findStopBefore (blockIndex: number): ?number {\r\n    let stopBefore;\r\n    for (let si=0; si<this._stops.length; ++si) {\r\n      const stop = this._stops[si];\r\n      if (stop <= blockIndex) stopBefore = stop;\r\n      else break;\r\n    }\r\n    return stopBefore;\r\n  }\r\n\r\n  /** Appends placeholder depending on laziness */\r\n  _appendPlaceholder (toBlockIndex: ?number): ChangeDetails {\r\n    const details = new ChangeDetails();\r\n    if (this.lazy && toBlockIndex == null) return details;\r\n\r\n    const startBlockIter = this._mapPosToBlock(this.value.length);\r\n    if (!startBlockIter) return details;\r\n\r\n    const startBlockIndex = startBlockIter.index;\r\n    const endBlockIndex = toBlockIndex != null ? toBlockIndex : this._blocks.length;\r\n\r\n    this._blocks.slice(startBlockIndex, endBlockIndex)\r\n      .forEach(b => {\r\n        if (!b.lazy || toBlockIndex != null) {\r\n          // $FlowFixMe `_blocks` may not be present\r\n          const args = b._blocks != null ? [b._blocks.length] : [];\r\n          const bDetails = b._appendPlaceholder(...args);\r\n          this._value += bDetails.inserted;\r\n          details.aggregate(bDetails);\r\n        }\r\n      });\r\n\r\n    return details;\r\n  }\r\n\r\n  /** Finds block in pos */\r\n  _mapPosToBlock (pos: number): ?BlockPosData {\r\n    let accVal = '';\r\n    for (let bi=0; bi<this._blocks.length; ++bi) {\r\n      const block = this._blocks[bi];\r\n      const blockStartPos = accVal.length;\r\n\r\n      accVal += block.value;\r\n\r\n      if (pos <= accVal.length) {\r\n        return {\r\n          index: bi,\r\n          offset: pos - blockStartPos,\r\n        };\r\n      }\r\n    }\r\n  }\r\n\r\n  /** */\r\n  _blockStartPos (blockIndex: number): number {\r\n    return this._blocks\r\n      .slice(0, blockIndex)\r\n      .reduce((pos, b) => pos += b.value.length, 0);\r\n  }\r\n\r\n  /** */\r\n  _forEachBlocksInRange (fromPos: number, toPos: number=this.value.length, fn: (block: PatternBlock, blockIndex: number, fromPos: number, toPos: number) => void) {\r\n    const fromBlockIter = this._mapPosToBlock(fromPos);\r\n\r\n    if (fromBlockIter) {\r\n      const toBlockIter = this._mapPosToBlock(toPos);\r\n      // process first block\r\n      const isSameBlock = toBlockIter && fromBlockIter.index === toBlockIter.index;\r\n      const fromBlockStartPos = fromBlockIter.offset;\r\n      const fromBlockEndPos = toBlockIter && isSameBlock ?\r\n        toBlockIter.offset :\r\n        this._blocks[fromBlockIter.index].value.length;\r\n      fn(this._blocks[fromBlockIter.index], fromBlockIter.index, fromBlockStartPos, fromBlockEndPos);\r\n\r\n      if (toBlockIter && !isSameBlock) {\r\n        // process intermediate blocks\r\n        for (let bi=fromBlockIter.index+1; bi<toBlockIter.index; ++bi) {\r\n          fn(this._blocks[bi], bi, 0, this._blocks[bi].value.length);\r\n        }\r\n\r\n        // process last block\r\n        fn(this._blocks[toBlockIter.index], toBlockIter.index, 0, toBlockIter.offset);\r\n      }\r\n    }\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  remove (fromPos: number=0, toPos: number=this.value.length): ChangeDetails {\r\n    const removeDetails = super.remove(fromPos, toPos);\r\n    this._forEachBlocksInRange(fromPos, toPos, (b, _, bFromPos, bToPos) => {\r\n      removeDetails.aggregate(b.remove(bFromPos, bToPos));\r\n    });\r\n    return removeDetails;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  nearestInputPos (cursorPos: number, direction: Direction=DIRECTION.NONE): number {\r\n    // TODO refactor - extract alignblock\r\n\r\n    const beginBlockData = this._mapPosToBlock(cursorPos) || {index: 0, offset: 0};\r\n    const {\r\n      offset: beginBlockOffset,\r\n      index: beginBlockIndex,\r\n    } = beginBlockData;\r\n    const beginBlock = this._blocks[beginBlockIndex];\r\n\r\n    if (!beginBlock) return cursorPos;\r\n\r\n    let beginBlockCursorPos = beginBlockOffset;\r\n    // if position inside block - try to adjust it\r\n    if (beginBlockCursorPos !== 0 && beginBlockCursorPos < beginBlock.value.length) {\r\n      beginBlockCursorPos = beginBlock.nearestInputPos(beginBlockOffset, forceDirection(direction));\r\n    }\r\n\r\n    const cursorAtRight = beginBlockCursorPos === beginBlock.value.length;\r\n    const cursorAtLeft = beginBlockCursorPos === 0;\r\n\r\n    //  cursor is INSIDE first block (not at bounds)\r\n    if (!cursorAtLeft && !cursorAtRight) return this._blockStartPos(beginBlockIndex) + beginBlockCursorPos;\r\n\r\n    const searchBlockIndex = cursorAtRight ? beginBlockIndex + 1 : beginBlockIndex;\r\n\r\n    if (direction === DIRECTION.NONE) {\r\n      // NONE direction used to calculate start input position if no chars were removed\r\n      // FOR NONE:\r\n      // -\r\n      // input|any\r\n      // ->\r\n      //  any|input\r\n      // <-\r\n      //  filled-input|any\r\n\r\n      // check if first block at left is input\r\n      if (searchBlockIndex > 0) {\r\n        const blockIndexAtLeft = searchBlockIndex-1;\r\n        const blockAtLeft = this._blocks[blockIndexAtLeft];\r\n        const blockInputPos = blockAtLeft.nearestInputPos(0, DIRECTION.NONE);\r\n        // is input\r\n        if (!blockAtLeft.value.length || blockInputPos !== blockAtLeft.value.length) {\r\n          return this._blockStartPos(searchBlockIndex);\r\n        }\r\n      }\r\n\r\n      // ->\r\n      let firstInputAtRight = searchBlockIndex;\r\n      for (let bi=firstInputAtRight; bi < this._blocks.length; ++bi) {\r\n        const blockAtRight = this._blocks[bi];\r\n        const blockInputPos = blockAtRight.nearestInputPos(0, DIRECTION.NONE);\r\n        if (!blockAtRight.value.length || blockInputPos !== blockAtRight.value.length) {\r\n          return this._blockStartPos(bi) + blockInputPos;\r\n        }\r\n      }\r\n\r\n      // <-\r\n      // find first non-fixed symbol\r\n      for (let bi=searchBlockIndex-1; bi >= 0; --bi) {\r\n        const block = this._blocks[bi];\r\n        const blockInputPos = block.nearestInputPos(0, DIRECTION.NONE);\r\n        // is input\r\n        if (!block.value.length || blockInputPos !== block.value.length) {\r\n          return this._blockStartPos(bi) + block.value.length;\r\n        }\r\n      }\r\n\r\n      return cursorPos;\r\n    }\r\n\r\n    if (direction === DIRECTION.LEFT || direction === DIRECTION.FORCE_LEFT) {\r\n      // -\r\n      //  any|filled-input\r\n      // <-\r\n      //  any|first not empty is not-len-aligned\r\n      //  not-0-aligned|any\r\n      // ->\r\n      //  any|not-len-aligned or end\r\n\r\n      // check if first block at right is filled input\r\n      let firstFilledBlockIndexAtRight;\r\n      for (let bi=searchBlockIndex; bi < this._blocks.length; ++bi) {\r\n        if (this._blocks[bi].value) {\r\n          firstFilledBlockIndexAtRight = bi;\r\n          break;\r\n        }\r\n      }\r\n      if (firstFilledBlockIndexAtRight != null) {\r\n        const filledBlock = this._blocks[firstFilledBlockIndexAtRight];\r\n        const blockInputPos = filledBlock.nearestInputPos(0, DIRECTION.RIGHT);\r\n        if (blockInputPos === 0 && filledBlock.unmaskedValue.length) {\r\n          // filled block is input\r\n          return this._blockStartPos(firstFilledBlockIndexAtRight) + blockInputPos;\r\n        }\r\n      }\r\n\r\n      // <-\r\n      // find this vars\r\n      let firstFilledInputBlockIndex = -1;\r\n      let firstEmptyInputBlockIndex;  // TODO consider nested empty inputs\r\n      for (let bi=searchBlockIndex-1; bi >= 0; --bi) {\r\n        const block = this._blocks[bi];\r\n        const blockInputPos = block.nearestInputPos(block.value.length, DIRECTION.FORCE_LEFT);\r\n        if (!block.value || blockInputPos !== 0) firstEmptyInputBlockIndex = bi;\r\n        if (blockInputPos !== 0) {\r\n          if (blockInputPos !== block.value.length) {\r\n            // aligned inside block - return immediately\r\n            return this._blockStartPos(bi) + blockInputPos;\r\n          } else {\r\n            // found filled\r\n            firstFilledInputBlockIndex = bi;\r\n            break;\r\n          }\r\n        }\r\n      }\r\n\r\n      if (direction === DIRECTION.LEFT) {\r\n        // try find first empty input before start searching position only when not forced\r\n        for (let bi=firstFilledInputBlockIndex+1; bi <= Math.min(searchBlockIndex, this._blocks.length-1); ++bi) {\r\n          const block = this._blocks[bi];\r\n          const blockInputPos = block.nearestInputPos(0, DIRECTION.NONE);\r\n          const blockAlignedPos = this._blockStartPos(bi) + blockInputPos;\r\n\r\n          if (blockAlignedPos > cursorPos) break;\r\n          // if block is not lazy input\r\n          if (blockInputPos !== block.value.length) return blockAlignedPos;\r\n        }\r\n      }\r\n\r\n      // process overflow\r\n      if (firstFilledInputBlockIndex >= 0) {\r\n        return this._blockStartPos(firstFilledInputBlockIndex) + this._blocks[firstFilledInputBlockIndex].value.length;\r\n      }\r\n\r\n      // for lazy if has aligned left inside fixed and has came to the start - use start position\r\n      if (\r\n        direction === DIRECTION.FORCE_LEFT ||\r\n        this.lazy && !this.extractInput() && !isInput(this._blocks[searchBlockIndex])\r\n      ) {\r\n        return 0;\r\n      }\r\n\r\n      if (firstEmptyInputBlockIndex != null) {\r\n        return this._blockStartPos(firstEmptyInputBlockIndex);\r\n      }\r\n\r\n      // find first input\r\n      for (let bi=searchBlockIndex; bi < this._blocks.length; ++bi) {\r\n        const block = this._blocks[bi];\r\n        const blockInputPos = block.nearestInputPos(0, DIRECTION.NONE);\r\n        // is input\r\n        if (!block.value.length || blockInputPos !== block.value.length) {\r\n          return this._blockStartPos(bi) + blockInputPos;\r\n        }\r\n      }\r\n\r\n      return 0;\r\n    }\r\n\r\n    if (direction === DIRECTION.RIGHT || direction === DIRECTION.FORCE_RIGHT) {\r\n      // ->\r\n      //  any|not-len-aligned and filled\r\n      //  any|not-len-aligned\r\n      // <-\r\n      //  not-0-aligned or start|any\r\n      let firstInputBlockAlignedIndex: ?number;\r\n      let firstInputBlockAlignedPos: ?number;\r\n      for (let bi=searchBlockIndex; bi < this._blocks.length; ++bi) {\r\n        const block = this._blocks[bi];\r\n        const blockInputPos = block.nearestInputPos(0, DIRECTION.NONE);\r\n        if (blockInputPos !== block.value.length) {\r\n          firstInputBlockAlignedPos = this._blockStartPos(bi) + blockInputPos;\r\n          firstInputBlockAlignedIndex = bi;\r\n          break;\r\n        }\r\n      }\r\n\r\n      if (firstInputBlockAlignedIndex != null && firstInputBlockAlignedPos != null) {\r\n        for (let bi=firstInputBlockAlignedIndex; bi < this._blocks.length; ++bi) {\r\n          const block = this._blocks[bi];\r\n          const blockInputPos = block.nearestInputPos(0, DIRECTION.FORCE_RIGHT);\r\n          if (blockInputPos !== block.value.length) {\r\n            return this._blockStartPos(bi) + blockInputPos;\r\n          }\r\n        }\r\n        return direction === DIRECTION.FORCE_RIGHT ?\r\n          this.value.length :\r\n          firstInputBlockAlignedPos;\r\n      }\r\n\r\n      for (let bi=Math.min(searchBlockIndex, this._blocks.length-1); bi >= 0; --bi) {\r\n        const block = this._blocks[bi];\r\n        const blockInputPos = block.nearestInputPos(block.value.length, DIRECTION.LEFT);\r\n        if (blockInputPos !== 0) {\r\n          const alignedPos = this._blockStartPos(bi) + blockInputPos;\r\n          if (alignedPos >= cursorPos) return alignedPos;\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    return cursorPos;\r\n  }\r\n\r\n  /** Get block by name */\r\n  maskedBlock (name: string): ?PatternBlock {\r\n    return this.maskedBlocks(name)[0];\r\n  }\r\n\r\n  /** Get all blocks by name */\r\n  maskedBlocks (name: string): Array<PatternBlock> {\r\n    const indices = this._maskedBlocks[name];\r\n    if (!indices) return [];\r\n    return indices.map(gi => this._blocks[gi]);\r\n  }\r\n}\r\nMaskedPattern.DEFAULTS = {\r\n  lazy: true,\r\n  placeholderChar: '_'\r\n};\r\nMaskedPattern.STOP_CHAR = '`';\r\nMaskedPattern.ESCAPE_CHAR = '\\\\';\r\nMaskedPattern.InputDefinition = PatternInputDefinition;\r\nMaskedPattern.FixedDefinition = PatternFixedDefinition;\r\n\r\nfunction isInput (block: PatternBlock): boolean {\r\n  if (!block) return false;\r\n\r\n  const value = block.value;\r\n  return !value || block.nearestInputPos(0, DIRECTION.NONE) !== value.length;\r\n}\r\n\r\n\r\nIMask.MaskedPattern = MaskedPattern;\r\n","// @flow\r\nimport MaskedPattern from './pattern.js';\r\nimport { type AppendFlags } from './base.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Pattern which accepts ranges */\r\nexport default\r\nclass MaskedRange extends MaskedPattern {\r\n  /**\r\n    Optionally sets max length of pattern.\r\n    Used when pattern length is longer then `to` param length. Pads zeros at start in this case.\r\n  */\r\n  maxLength: number;\r\n  /** Min bound */\r\n  from: number;\r\n  /** Max bound */\r\n  to: number;\r\n  /** */\r\n  autofix: boolean;\r\n\r\n  get _matchFrom (): number {\r\n    return this.maxLength - String(this.from).length;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _update (opts: any) {  // TODO type\r\n    opts = {\r\n      to: this.to || 0,\r\n      from: this.from || 0,\r\n      ...opts,\r\n    };\r\n\r\n    let maxLength = String(opts.to).length;\r\n    if (opts.maxLength != null) maxLength = Math.max(maxLength, opts.maxLength);\r\n    opts.maxLength = maxLength;\r\n\r\n    const fromStr = String(opts.from).padStart(maxLength, '0');\r\n    const toStr = String(opts.to).padStart(maxLength, '0');\r\n    let sameCharsCount = 0;\r\n    while (sameCharsCount < toStr.length && toStr[sameCharsCount] === fromStr[sameCharsCount]) ++sameCharsCount;\r\n    opts.mask = toStr.slice(0, sameCharsCount).replace(/0/g, '\\\\0') + '0'.repeat(maxLength - sameCharsCount);\r\n\r\n    super._update(opts);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get isComplete (): boolean {\r\n    return super.isComplete && Boolean(this.value);\r\n  }\r\n\r\n  boundaries (str: string): [string, string] {\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    minstr = minstr.padEnd(this.maxLength, '0');\r\n    maxstr = maxstr.padEnd(this.maxLength, '9');\r\n\r\n    return [minstr, maxstr];\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doPrepare (str: string, flags: AppendFlags={}): string {\r\n    str = super.doPrepare(str, flags).replace(/\\D/g, '');\r\n    if (!this.autofix) return str;\r\n\r\n    const fromStr = String(this.from).padStart(this.maxLength, '0');\r\n    const toStr = String(this.to).padStart(this.maxLength, '0');\r\n\r\n    const val = this.value;\r\n    let prepStr = '';\r\n    for (let ci=0; ci<str.length; ++ci) {\r\n      const nextVal = val + prepStr + str[ci];\r\n      const [minstr, maxstr] = this.boundaries(nextVal);\r\n\r\n      if (Number(maxstr) < this.from) prepStr += fromStr[nextVal.length - 1];\r\n      else if (Number(minstr) > this.to) prepStr += toStr[nextVal.length - 1];\r\n      else prepStr += str[ci];\r\n    }\r\n\r\n    return prepStr;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doValidate (...args: *): boolean {\r\n    const str = this.value;\r\n\r\n    const firstNonZero = str.search(/[^0]/);\r\n    if (firstNonZero === -1 && str.length <= this._matchFrom) return true;\r\n\r\n    const [minstr, maxstr] = this.boundaries(str);\r\n\r\n    return this.from <= Number(maxstr) && Number(minstr) <= this.to &&\r\n      super.doValidate(...args);\r\n  }\r\n}\r\n\r\n\r\nIMask.MaskedRange = MaskedRange;\r\n","// @flow\r\nimport MaskedPattern from './pattern.js';\r\nimport MaskedRange from './range.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Date mask */\r\nexport default\r\nclass MaskedDate extends MaskedPattern {\r\n  static GET_DEFAULT_BLOCKS: () => {[string]: any};\r\n  static DEFAULTS: any;\r\n\r\n  /** Pattern mask for date according to {@link MaskedDate#format} */\r\n  pattern: string;\r\n  /** Start date */\r\n  min: ?Date;\r\n  /** End date */\r\n  max: ?Date;\r\n  /** */\r\n  autofix: boolean;\r\n\r\n  /**\r\n    @param {Object} opts\r\n  */\r\n  constructor (opts: any) {\r\n    super({\r\n      ...MaskedDate.DEFAULTS,\r\n      ...opts\r\n    });\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _update (opts: any) {\r\n    if (opts.mask === Date) delete opts.mask;\r\n    if (opts.pattern) opts.mask = opts.pattern;\r\n\r\n    const blocks = opts.blocks;\r\n    opts.blocks = Object.assign({}, MaskedDate.GET_DEFAULT_BLOCKS());\r\n    // adjust year block\r\n    if (opts.min) opts.blocks.Y.from = opts.min.getFullYear();\r\n    if (opts.max) opts.blocks.Y.to = opts.max.getFullYear();\r\n    if (opts.min && opts.max && opts.blocks.Y.from === opts.blocks.Y.to\r\n    ) {\r\n      opts.blocks.m.from = opts.min.getMonth() + 1;\r\n      opts.blocks.m.to = opts.max.getMonth() + 1;\r\n\r\n      if (opts.blocks.m.from === opts.blocks.m.to) {\r\n        opts.blocks.d.from = opts.min.getDate();\r\n        opts.blocks.d.to = opts.max.getDate();\r\n      }\r\n    }\r\n    Object.assign(opts.blocks, blocks);\r\n\r\n    // add autofix\r\n    Object.keys(opts.blocks).forEach(bk => {\r\n      const b = opts.blocks[bk];\r\n      if (!('autofix' in b)) b.autofix = opts.autofix;\r\n    });\r\n\r\n    super._update(opts);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doValidate (...args: *): boolean {\r\n    const date = this.date;\r\n\r\n    return super.doValidate(...args) &&\r\n      (!this.isComplete ||\r\n        this.isDateExist(this.value) && date != null &&\r\n        (this.min == null || this.min <= date) &&\r\n        (this.max == null || date <= this.max));\r\n  }\r\n\r\n  /** Checks if date is exists */\r\n  isDateExist (str: string): boolean {\r\n    return this.format(this.parse(str, this), this).indexOf(str) >= 0;\r\n  }\r\n\r\n  /** Parsed Date */\r\n  get date (): ?Date {\r\n    return this.typedValue;\r\n  }\r\n  set date (date: Date) {\r\n    this.typedValue = date;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get typedValue (): ?Date {\r\n    return this.isComplete ? super.typedValue : null;\r\n  }\r\n  set typedValue (value: Date) {\r\n    super.typedValue = value;\r\n  }\r\n}\r\nMaskedDate.DEFAULTS = {\r\n  pattern: 'd{.}`m{.}`Y',\r\n  format: date => {\r\n    const day = String(date.getDate()).padStart(2, '0');\r\n    const month = String(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};\r\nMaskedDate.GET_DEFAULT_BLOCKS = () => ({\r\n  d: {\r\n    mask: MaskedRange,\r\n    from: 1,\r\n    to: 31,\r\n    maxLength: 2,\r\n  },\r\n  m: {\r\n    mask: MaskedRange,\r\n    from: 1,\r\n    to: 12,\r\n    maxLength: 2,\r\n  },\r\n  Y: {\r\n    mask: MaskedRange,\r\n    from: 1900,\r\n    to: 9999,\r\n  }\r\n});\r\n\r\n\r\nIMask.MaskedDate = MaskedDate;\r\n","// @flow\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\nexport\r\ntype ElementEvent =\r\n  'selectionChange' |\r\n  'input' |\r\n  'drop' |\r\n  'click' |\r\n  'focus' |\r\n  'commit';\r\n\r\n/**\r\n  Generic element API to use with mask\r\n  @interface\r\n*/\r\nexport default\r\nclass MaskElement {\r\n  /** */\r\n  +_unsafeSelectionStart: number;\r\n  /** */\r\n  +_unsafeSelectionEnd: number;\r\n  /** */\r\n  value: string;\r\n\r\n  /** Safely returns selection start */\r\n  get selectionStart (): number {\r\n    let start;\r\n    try {\r\n      start = this._unsafeSelectionStart;\r\n    } catch (e) {}\r\n\r\n    return start != null ?\r\n      start :\r\n      this.value.length;\r\n  }\r\n\r\n  /** Safely returns selection end */\r\n  get selectionEnd (): number {\r\n    let end;\r\n    try {\r\n      end = this._unsafeSelectionEnd;\r\n    } catch (e) {}\r\n\r\n    return end != null ?\r\n      end :\r\n      this.value.length;\r\n  }\r\n\r\n  /** Safely sets element selection */\r\n  select (start: number, end: number) {\r\n    if (start == null || end == null ||\r\n      start === this.selectionStart && end === this.selectionEnd) return;\r\n\r\n    try {\r\n      this._unsafeSelect(start, end);\r\n    } catch (e) {}\r\n  }\r\n\r\n  /** Should be overriden in subclasses */\r\n  _unsafeSelect (start: number, end: number): void {}\r\n  /** Should be overriden in subclasses */\r\n  get isActive (): boolean { return false; }\r\n  /** Should be overriden in subclasses */\r\n  bindEvents (handlers: {[ElementEvent]: Function}) {}\r\n  /** Should be overriden in subclasses */\r\n  unbindEvents (): void {}\r\n}\r\n\r\n\r\nIMask.MaskElement = MaskElement;\r\n","// @flow\r\nimport MaskElement, {type ElementEvent} from './mask-element.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Bridge between HTMLElement and {@link Masked} */\r\nexport default\r\nclass HTMLMaskElement extends MaskElement {\r\n  /** Mapping between HTMLElement events and mask internal events */\r\n  static EVENTS_MAP: {[ElementEvent]: string};\r\n  /** HTMLElement to use mask on */\r\n  input: HTMLTextAreaElement | HTMLInputElement;\r\n  _handlers: {[string]: Function};\r\n\r\n  /**\r\n    @param {HTMLInputElement|HTMLTextAreaElement} input\r\n  */\r\n  constructor (input: HTMLTextAreaElement | HTMLInputElement) {\r\n    super();\r\n    this.input = input;\r\n    this._handlers = {};\r\n  }\r\n\r\n  /** */\r\n  // $FlowFixMe https://github.com/facebook/flow/issues/2839\r\n  get rootElement (): HTMLDocument {\r\n    return this.input.getRootNode\r\n      ? this.input.getRootNode()\r\n      : document;\r\n  }\r\n\r\n  /**\r\n    Is element in focus\r\n    @readonly\r\n  */\r\n  get isActive (): boolean {\r\n    //$FlowFixMe\r\n    return this.input === this.rootElement.activeElement;\r\n  }\r\n\r\n  /**\r\n    Returns HTMLElement selection start\r\n    @override\r\n  */\r\n  get _unsafeSelectionStart (): number {\r\n    return this.input.selectionStart;\r\n  }\r\n\r\n  /**\r\n    Returns HTMLElement selection end\r\n    @override\r\n  */\r\n  get _unsafeSelectionEnd (): number {\r\n    return this.input.selectionEnd;\r\n  }\r\n\r\n  /**\r\n    Sets HTMLElement selection\r\n    @override\r\n  */\r\n  _unsafeSelect (start: number, end: number) {\r\n    this.input.setSelectionRange(start, end);\r\n  }\r\n\r\n  /**\r\n    HTMLElement value\r\n    @override\r\n  */\r\n  get value (): string {\r\n    return this.input.value;\r\n  }\r\n  set value (value: string) {\r\n    this.input.value = value;\r\n  }\r\n\r\n  /**\r\n    Binds HTMLElement events to mask internal events\r\n    @override\r\n  */\r\n  bindEvents (handlers: {[ElementEvent]: Function}) {\r\n    Object.keys(handlers)\r\n      .forEach(event => this._toggleEventHandler(HTMLMaskElement.EVENTS_MAP[event], handlers[event]));\r\n  }\r\n\r\n  /**\r\n    Unbinds HTMLElement events to mask internal events\r\n    @override\r\n  */\r\n  unbindEvents () {\r\n    Object.keys(this._handlers)\r\n      .forEach(event => this._toggleEventHandler(event));\r\n  }\r\n\r\n  /** */\r\n  _toggleEventHandler (event: string, handler?: Function): void {\r\n    if (this._handlers[event]) {\r\n      this.input.removeEventListener(event, this._handlers[event]);\r\n      delete this._handlers[event];\r\n    }\r\n\r\n    if (handler) {\r\n      this.input.addEventListener(event, handler);\r\n      this._handlers[event] = handler;\r\n    }\r\n  }\r\n}\r\nHTMLMaskElement.EVENTS_MAP = {\r\n  selectionChange: 'keydown',\r\n  input: 'input',\r\n  drop: 'drop',\r\n  click: 'click',\r\n  focus: 'focus',\r\n  commit: 'blur',\r\n};\r\n\r\n\r\nIMask.HTMLMaskElement = HTMLMaskElement;\r\n","// @flow\r\nimport HTMLMaskElement from './html-mask-element.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\nexport default\r\nclass HTMLContenteditableMaskElement extends HTMLMaskElement {\r\n  /**\r\n    Returns HTMLElement selection start\r\n    @override\r\n  */\r\n  get _unsafeSelectionStart (): number {\r\n    const root = this.rootElement;\r\n    const selection = root.getSelection && root.getSelection();\r\n    return selection && selection.anchorOffset;\r\n  }\r\n\r\n  /**\r\n    Returns HTMLElement selection end\r\n    @override\r\n  */\r\n  get _unsafeSelectionEnd (): number {\r\n    const root = this.rootElement;\r\n    const selection = root.getSelection && root.getSelection();\r\n    return selection && (this._unsafeSelectionStart + String(selection).length);\r\n  }\r\n\r\n  /**\r\n    Sets HTMLElement selection\r\n    @override\r\n  */\r\n  _unsafeSelect (start: number, end: number) {\r\n    if (!this.rootElement.createRange) return;\r\n\r\n    const range = this.rootElement.createRange();\r\n    range.setStart(this.input.firstChild || this.input, start);\r\n    range.setEnd(this.input.lastChild || this.input, end);\r\n    const root = this.rootElement;\r\n    const selection = root.getSelection && root.getSelection();\r\n    if (selection) {\r\n      selection.removeAllRanges();\r\n      selection.addRange(range);\r\n    }\r\n  }\r\n\r\n  /**\r\n    HTMLElement value\r\n    @override\r\n  */\r\n  get value (): string {\r\n    // $FlowFixMe\r\n    return this.input.textContent;\r\n  }\r\n  set value (value: string) {\r\n    this.input.textContent = value;\r\n  }\r\n}\r\n\r\n\r\nIMask.HTMLContenteditableMaskElement = HTMLContenteditableMaskElement;\r\n","// @flow\r\nimport {objectIncludes, DIRECTION, type Selection} from '../core/utils.js';\r\nimport ActionDetails from '../core/action-details.js';\r\nimport MaskedDate from '../masked/date.js';\r\nimport createMask, {maskedClass} from '../masked/factory.js';\r\nimport type Masked from '../masked/base.js';\r\nimport {type Mask} from '../masked/base.js';\r\nimport MaskElement from './mask-element.js';\r\nimport HTMLMaskElement from './html-mask-element.js';\r\nimport HTMLContenteditableMaskElement from './html-contenteditable-mask-element.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Listens to element events and controls changes between element and {@link Masked} */\r\nexport default\r\nclass InputMask {\r\n  /**\r\n    View element\r\n    @readonly\r\n  */\r\n  el: MaskElement;\r\n\r\n  /**\r\n    Internal {@link Masked} model\r\n    @readonly\r\n  */\r\n  masked: Masked<*>;\r\n  alignCursor: () => void;\r\n  alignCursorFriendly: () => void;\r\n\r\n  _listeners: {[string]: Array<Function>};\r\n  _value: string;\r\n  _changingCursorPos: number;\r\n  _unmaskedValue: string;\r\n  _saveSelection: (?Event) => void;\r\n  _selection: Selection;\r\n  _onInput: () => void;\r\n  _onChange: () => void;\r\n  _onDrop: (Event) => void;\r\n  _onFocus: (Event) => void;\r\n  _onClick: (Event) => void;\r\n  _cursorChanging: ?TimeoutID;\r\n  _inputEvent: ?InputEvent;\r\n\r\n  /**\r\n    @param {MaskElement|HTMLInputElement|HTMLTextAreaElement} el\r\n    @param {Object} opts\r\n  */\r\n  constructor (el: MaskElement | HTMLTextAreaElement | HTMLInputElement, opts: {[string]: any}) {\r\n    this.el =\r\n      (el instanceof MaskElement) ? el :\r\n      (el.isContentEditable && el.tagName !== 'INPUT' && el.tagName !== 'TEXTAREA') ? new HTMLContenteditableMaskElement(el) :\r\n      new HTMLMaskElement(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._onFocus = this._onFocus.bind(this);\r\n    this._onClick = this._onClick.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  /** Read or update mask */\r\n  get mask (): Mask {\r\n    return this.masked.mask;\r\n  }\r\n\r\n  maskEquals (mask: Mask): boolean {\r\n    return mask == null ||\r\n      mask === this.masked.mask ||\r\n      mask === Date && this.masked instanceof MaskedDate;\r\n  }\r\n\r\n  set mask (mask: Mask) {\r\n    if (this.maskEquals(mask)) return;\r\n\r\n    if (!(mask instanceof IMask.Masked) && this.masked.constructor === maskedClass(mask)) {\r\n      this.masked.updateOptions({mask});\r\n      return;\r\n    }\r\n\r\n    const masked = createMask({mask});\r\n    masked.unmaskedValue = this.masked.unmaskedValue;\r\n    this.masked = masked;\r\n  }\r\n\r\n  /** Raw value */\r\n  get value (): string {\r\n    return this._value;\r\n  }\r\n\r\n  set value (str: string) {\r\n    this.masked.value = str;\r\n    this.updateControl();\r\n    this.alignCursor();\r\n  }\r\n\r\n  /** Unmasked value */\r\n  get unmaskedValue (): string {\r\n    return this._unmaskedValue;\r\n  }\r\n\r\n  set unmaskedValue (str: string) {\r\n    this.masked.unmaskedValue = str;\r\n    this.updateControl();\r\n    this.alignCursor();\r\n  }\r\n\r\n  /** Typed unmasked value */\r\n  get typedValue (): any {\r\n    return this.masked.typedValue;\r\n  }\r\n\r\n  set typedValue (val: any) {\r\n    this.masked.typedValue = val;\r\n    this.updateControl();\r\n    this.alignCursor();\r\n  }\r\n\r\n  /**\r\n    Starts listening to element events\r\n    @protected\r\n  */\r\n  _bindEvents () {\r\n    this.el.bindEvents({\r\n      selectionChange: this._saveSelection,\r\n      input: this._onInput,\r\n      drop: this._onDrop,\r\n      click: this._onClick,\r\n      focus: this._onFocus,\r\n      commit: this._onChange,\r\n    });\r\n  }\r\n\r\n  /**\r\n    Stops listening to element events\r\n    @protected\r\n   */\r\n  _unbindEvents () {\r\n    if (this.el) this.el.unbindEvents();\r\n  }\r\n\r\n  /**\r\n    Fires custom event\r\n    @protected\r\n   */\r\n  _fireEvent (ev: string, ...args: *) {\r\n    const listeners = this._listeners[ev];\r\n    if (!listeners) return;\r\n\r\n    listeners.forEach(l => l(...args));\r\n  }\r\n\r\n  /**\r\n    Current selection start\r\n    @readonly\r\n  */\r\n  get selectionStart (): number {\r\n    return this._cursorChanging ?\r\n      this._changingCursorPos :\r\n\r\n      this.el.selectionStart;\r\n  }\r\n\r\n  /** Current cursor position */\r\n  get cursorPos (): number {\r\n    return this._cursorChanging ?\r\n      this._changingCursorPos :\r\n\r\n      this.el.selectionEnd;\r\n  }\r\n  set cursorPos (pos: number) {\r\n    if (!this.el || !this.el.isActive) return;\r\n\r\n    this.el.select(pos, pos);\r\n    this._saveSelection();\r\n  }\r\n\r\n  /**\r\n    Stores current selection\r\n    @protected\r\n  */\r\n  _saveSelection (/* ev */) {\r\n    if (this.value !== this.el.value) {\r\n      console.warn('Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.'); // 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  /** Syncronizes model value from view */\r\n  updateValue () {\r\n    this.masked.value = this.el.value;\r\n    this._value = this.masked.value;\r\n  }\r\n\r\n  /** Syncronizes view from model value, fires change events */\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  /** Updates options with deep equal check, recreates @{link Masked} model if mask type changes */\r\n  updateOptions (opts: {[string]: any}) {\r\n    const { mask, ...restOpts } = opts;\r\n\r\n    const updateMask = !this.maskEquals(mask);\r\n    const updateOpts = !objectIncludes(this.masked, restOpts);\r\n\r\n    if (updateMask) this.mask = mask;\r\n    if (updateOpts) this.masked.updateOptions(restOpts);\r\n\r\n    if (updateMask || updateOpts) this.updateControl();\r\n  }\r\n\r\n  /** Updates cursor */\r\n  updateCursor (cursorPos: number) {\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  /**\r\n    Delays cursor update to support mobile browsers\r\n    @private\r\n  */\r\n  _delayUpdateCursor (cursorPos: number) {\r\n    this._abortUpdateCursor();\r\n    this._changingCursorPos = cursorPos;\r\n    this._cursorChanging = setTimeout(() => {\r\n      if (!this.el) return; // if was destroyed\r\n      this.cursorPos = this._changingCursorPos;\r\n      this._abortUpdateCursor();\r\n    }, 10);\r\n  }\r\n\r\n  /**\r\n    Fires custom events\r\n    @protected\r\n  */\r\n  _fireChangeEvents () {\r\n    this._fireEvent('accept', this._inputEvent);\r\n    if (this.masked.isComplete) this._fireEvent('complete', this._inputEvent);\r\n  }\r\n\r\n  /**\r\n    Aborts delayed cursor update\r\n    @private\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  /** Aligns cursor to nearest available position */\r\n  alignCursor () {\r\n    this.cursorPos = this.masked.nearestInputPos(this.cursorPos, DIRECTION.LEFT);\r\n  }\r\n\r\n  /** Aligns cursor only if selection is empty */\r\n  alignCursorFriendly () {\r\n    if (this.selectionStart !== this.cursorPos) return;  // skip if range is selected\r\n    this.alignCursor();\r\n  }\r\n\r\n  /** Adds listener on custom event */\r\n  on (ev: string, handler: Function): this {\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  /** Removes custom event listener */\r\n  off (ev: string, handler: Function): this {\r\n    if (!this._listeners[ev]) return this;\r\n    if (!handler) {\r\n      delete this._listeners[ev];\r\n      return this;\r\n    }\r\n    const hIndex = this._listeners[ev].indexOf(handler);\r\n    if (hIndex >= 0) this._listeners[ev].splice(hIndex, 1);\r\n    return this;\r\n  }\r\n\r\n  /** Handles view input event */\r\n  _onInput (e: InputEvent): void {\r\n    this._inputEvent = e;\r\n    this._abortUpdateCursor();\r\n\r\n    // fix strange IE behavior\r\n    if (!this._selection) return this.updateValue();\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 oldRawValue = this.masked.rawInputValue;\r\n\r\n    const offset = this.masked.splice(\r\n      details.startChangePos,\r\n      details.removed.length,\r\n      details.inserted,\r\n      details.removeDirection).offset;\r\n\r\n    // force align in remove direction only if no input chars were removed\r\n    // otherwise we still need to align with NONE (to get out from fixed symbols for instance)\r\n    const removeDirection = oldRawValue === this.masked.rawInputValue ?\r\n      details.removeDirection :\r\n      DIRECTION.NONE;\r\n\r\n    const cursorPos = this.masked.nearestInputPos(\r\n      details.startChangePos + offset,\r\n      removeDirection,\r\n    );\r\n\r\n    this.updateControl();\r\n    this.updateCursor(cursorPos);\r\n    delete this._inputEvent;\r\n  }\r\n\r\n  /** Handles view change event and commits model value */\r\n  _onChange () {\r\n    if (this.value !== this.el.value) {\r\n      this.updateValue();\r\n    }\r\n    this.masked.doCommit();\r\n    this.updateControl();\r\n    this._saveSelection();\r\n  }\r\n\r\n  /** Handles view drop event, prevents by default */\r\n  _onDrop (ev: Event) {\r\n    ev.preventDefault();\r\n    ev.stopPropagation();\r\n  }\r\n\r\n  /** Restore last selection on focus */\r\n  _onFocus (ev: Event) {\r\n    this.alignCursorFriendly();\r\n  }\r\n\r\n  /** Restore last selection on focus */\r\n  _onClick (ev: Event) {\r\n    this.alignCursorFriendly();\r\n  }\r\n\r\n  /** Unbind view events and removes element reference */\r\n  destroy () {\r\n    this._unbindEvents();\r\n    // $FlowFixMe why not do so?\r\n    this._listeners.length = 0;\r\n    // $FlowFixMe\r\n    delete this.el;\r\n  }\r\n}\r\n\r\n\r\nIMask.InputMask = InputMask;\r\n","// @flow\r\nimport MaskedPattern from './pattern.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Pattern which validates enum values */\r\nexport default\r\nclass MaskedEnum extends MaskedPattern {\r\n  enum: Array<string>;\r\n\r\n  /**\r\n    @override\r\n    @param {Object} opts\r\n  */\r\n  _update (opts: any) {  // TODO type\r\n    if (opts.enum) opts.mask = '*'.repeat(opts.enum[0].length);\r\n\r\n    super._update(opts);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doValidate (...args: *): boolean {\r\n    return this.enum.some(e => e.indexOf(this.unmaskedValue) >= 0) &&\r\n      super.doValidate(...args);\r\n  }\r\n}\r\n\r\n\r\nIMask.MaskedEnum = MaskedEnum;\r\n","// @flow\r\nimport {escapeRegExp, indexInDirection, posInDirection, type Direction, DIRECTION} from '../core/utils.js';\r\nimport ChangeDetails from '../core/change-details.js';\r\n\r\nimport Masked, {type MaskedOptions, type ExtractFlags, type AppendFlags} from './base.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\ntype MaskedNumberOptions = {\r\n  ...MaskedOptions<Class<Number>>,\r\n  radix: $PropertyType<MaskedNumber, 'radix'>,\r\n  thousandsSeparator: $PropertyType<MaskedNumber, 'thousandsSeparator'>,\r\n  mapToRadix: $PropertyType<MaskedNumber, 'mapToRadix'>,\r\n  scale: $PropertyType<MaskedNumber, 'scale'>,\r\n  signed: $PropertyType<MaskedNumber, 'signed'>,\r\n  normalizeZeros: $PropertyType<MaskedNumber, 'normalizeZeros'>,\r\n  padFractionalZeros: $PropertyType<MaskedNumber, 'padFractionalZeros'>,\r\n};\r\n\r\n/**\r\n  Number mask\r\n  @param {Object} opts\r\n  @param {string} opts.radix - Single char\r\n  @param {string} opts.thousandsSeparator - Single char\r\n  @param {Array<string>} opts.mapToRadix - Array of single chars\r\n  @param {number} opts.min\r\n  @param {number} opts.max\r\n  @param {number} opts.scale - Digits after point\r\n  @param {boolean} opts.signed - Allow negative\r\n  @param {boolean} opts.normalizeZeros - Flag to remove leading and trailing zeros in the end of editing\r\n  @param {boolean} opts.padFractionalZeros - Flag to pad trailing zeros after point in the end of editing\r\n*/\r\nexport default\r\nclass MaskedNumber extends Masked<Class<Number>> {\r\n  static DEFAULTS: $Shape<MaskedNumberOptions>;\r\n\r\n  /** Single char */\r\n  radix: string;\r\n  /** Single char */\r\n  thousandsSeparator: string;\r\n  /** Array of single chars */\r\n  mapToRadix: Array<string>;\r\n  /** */\r\n  min: number;\r\n  /** */\r\n  max: number;\r\n  /** Digits after point */\r\n  scale: number;\r\n  /** */\r\n  signed: boolean;\r\n  /** Flag to remove leading and trailing zeros in the end of editing */\r\n  normalizeZeros: boolean;\r\n  /** Flag to pad trailing zeros after point in the end of editing */\r\n  padFractionalZeros: boolean;\r\n\r\n  _numberRegExp: RegExp;\r\n  _numberRegExpInput: RegExp;\r\n  _thousandsSeparatorRegExp: RegExp;\r\n  _mapToRadixRegExp: RegExp;\r\n  _separatorsProcessed: boolean;\r\n\r\n  constructor (opts: $Shape<MaskedNumberOptions>) {\r\n    super({\r\n      ...MaskedNumber.DEFAULTS,\r\n      ...opts\r\n    });\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _update (opts: MaskedNumberOptions) {\r\n    super._update(opts);\r\n    this._updateRegExps();\r\n  }\r\n\r\n  /** */\r\n  _updateRegExps () {\r\n    // use different regexp to process user input (more strict, input suffix) and tail shifting\r\n    let start = '^' + (this.allowNegative ? '[+|\\\\-]?' : '');\r\n    let midInput = '(0|([1-9]+\\\\d*))?';\r\n    let mid = '\\\\d*';\r\n\r\n    let end = (this.scale ?\r\n      '(' + escapeRegExp(this.radix) + '\\\\d{0,' + this.scale + '})?' :\r\n      '') + '$';\r\n\r\n    this._numberRegExpInput = new RegExp(start + midInput + end);\r\n    this._numberRegExp = new RegExp(start + mid + end);\r\n    this._mapToRadixRegExp = new RegExp('[' +\r\n      this.mapToRadix.map(escapeRegExp).join('') +\r\n    ']', 'g');\r\n    this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(this.thousandsSeparator), 'g');\r\n  }\r\n\r\n  /** */\r\n  _removeThousandsSeparators (value: string): string {\r\n    return value.replace(this._thousandsSeparatorRegExp, '');\r\n  }\r\n\r\n  /** */\r\n  _insertThousandsSeparators (value: string): string {\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  /**\r\n    @override\r\n  */\r\n  doPrepare (str: string, ...args: *): string {\r\n    return super.doPrepare(this._removeThousandsSeparators(str.replace(this._mapToRadixRegExp, this.radix)), ...args);\r\n  }\r\n\r\n  /** */\r\n  _separatorsCount (to: number, extendOnSeparators: boolean=false): number {\r\n    let count = 0;\r\n\r\n    for (let pos = 0; pos < to; ++pos) {\r\n      if (this._value.indexOf(this.thousandsSeparator, pos) === pos) {\r\n        ++count;\r\n        if (extendOnSeparators) to += this.thousandsSeparator.length;\r\n      }\r\n    }\r\n\r\n    return count;\r\n  }\r\n\r\n  /** */\r\n  _separatorsCountFromSlice (slice: string=this._value): number {\r\n    return this._separatorsCount(this._removeThousandsSeparators(slice).length, true);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  extractInput (fromPos?: number=0, toPos?: number=this.value.length, flags?: ExtractFlags): string {\r\n    [fromPos, toPos] = this._adjustRangeWithSeparators(fromPos, toPos);\r\n\r\n    return this._removeThousandsSeparators(super.extractInput(fromPos, toPos, flags));\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _appendCharRaw (ch: string, flags: AppendFlags={}): ChangeDetails {\r\n    if (!this.thousandsSeparator) return super._appendCharRaw(ch, flags);\r\n\r\n    const prevBeforeTailValue = flags.tail && flags._beforeTailState ?\r\n      flags._beforeTailState._value :\r\n      this._value;\r\n    const prevBeforeTailSeparatorsCount = this._separatorsCountFromSlice(prevBeforeTailValue);\r\n    this._value = this._removeThousandsSeparators(this.value);\r\n\r\n    const appendDetails = super._appendCharRaw(ch, flags);\r\n\r\n    this._value = this._insertThousandsSeparators(this._value);\r\n    const beforeTailValue = flags.tail && flags._beforeTailState ?\r\n      flags._beforeTailState._value :\r\n      this._value;\r\n    const beforeTailSeparatorsCount = this._separatorsCountFromSlice(beforeTailValue);\r\n\r\n    appendDetails.tailShift += (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length;\r\n    appendDetails.skip = !appendDetails.rawInserted && ch === this.thousandsSeparator;\r\n    return appendDetails;\r\n  }\r\n\r\n  /** */\r\n  _findSeparatorAround (pos: number): number {\r\n    if (this.thousandsSeparator) {\r\n      const searchFrom = pos - this.thousandsSeparator.length + 1;\r\n      const separatorPos = this.value.indexOf(this.thousandsSeparator, searchFrom);\r\n      if (separatorPos <= pos) return separatorPos;\r\n    }\r\n\r\n    return -1;\r\n  }\r\n\r\n  _adjustRangeWithSeparators (from: number, to: number): [number, number] {\r\n    const separatorAroundFromPos = this._findSeparatorAround(from);\r\n    if (separatorAroundFromPos >= 0) from = separatorAroundFromPos;\r\n\r\n    const separatorAroundToPos = this._findSeparatorAround(to);\r\n    if (separatorAroundToPos >= 0) to = separatorAroundToPos + this.thousandsSeparator.length;\r\n    return [from, to];\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  remove (fromPos?: number=0, toPos?: number=this.value.length): ChangeDetails {\r\n    [fromPos, toPos] = this._adjustRangeWithSeparators(fromPos, toPos);\r\n\r\n    const valueBeforePos = this.value.slice(0, fromPos);\r\n    const valueAfterPos = this.value.slice(toPos);\r\n\r\n    const prevBeforeTailSeparatorsCount = this._separatorsCount(valueBeforePos.length);\r\n    this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(valueBeforePos + valueAfterPos));\r\n    const beforeTailSeparatorsCount = this._separatorsCountFromSlice(valueBeforePos);\r\n\r\n    return new ChangeDetails({\r\n      tailShift: (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length,\r\n    });\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  nearestInputPos (cursorPos: number, direction?: Direction): number {\r\n    if (!this.thousandsSeparator) return cursorPos;\r\n\r\n    switch (direction) {\r\n      case DIRECTION.NONE:\r\n      case DIRECTION.LEFT:\r\n      case DIRECTION.FORCE_LEFT: {\r\n        const separatorAtLeftPos = this._findSeparatorAround(cursorPos - 1);\r\n        if (separatorAtLeftPos >= 0) {\r\n          const separatorAtLeftEndPos = separatorAtLeftPos + this.thousandsSeparator.length;\r\n          if (cursorPos < separatorAtLeftEndPos ||\r\n            this.value.length <= separatorAtLeftEndPos ||\r\n            direction === DIRECTION.FORCE_LEFT\r\n          ) {\r\n            return separatorAtLeftPos;\r\n          }\r\n        }\r\n        break;\r\n      }\r\n      case DIRECTION.RIGHT:\r\n      case DIRECTION.FORCE_RIGHT: {\r\n        const separatorAtRightPos = this._findSeparatorAround(cursorPos);\r\n        if (separatorAtRightPos >= 0) {\r\n          return separatorAtRightPos + this.thousandsSeparator.length;\r\n        }\r\n      }\r\n    }\r\n\r\n    return cursorPos;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doValidate (flags: AppendFlags): boolean {\r\n    const regexp = flags.input ? this._numberRegExpInput : 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.doValidate(flags);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doCommit () {\r\n    if (this.value) {\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) this.unmaskedValue = String(validnum);\r\n\r\n      let formatted = this.value;\r\n\r\n      if (this.normalizeZeros) formatted = this._normalizeZeros(formatted);\r\n      if (this.padFractionalZeros) formatted = this._padFractionalZeros(formatted);\r\n\r\n      this._value = formatted;\r\n    }\r\n\r\n    super.doCommit();\r\n  }\r\n\r\n  /** */\r\n  _normalizeZeros (value: string): string {\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  /** */\r\n  _padFractionalZeros (value: string): string {\r\n    if (!value) return value;\r\n\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  /**\r\n    @override\r\n  */\r\n  get unmaskedValue (): string {\r\n    return this._removeThousandsSeparators(\r\n      this._normalizeZeros(\r\n        this.value))\r\n      .replace(this.radix, '.');\r\n  }\r\n\r\n  set unmaskedValue (unmaskedValue: string) {\r\n    super.unmaskedValue = unmaskedValue.replace('.', this.radix);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get typedValue (): number {\r\n    return Number(this.unmaskedValue);\r\n  }\r\n\r\n  set typedValue (n: number) {\r\n    super.unmaskedValue = String(n);\r\n  }\r\n\r\n  /** Parsed Number */\r\n  get number (): number {\r\n    return this.typedValue;\r\n  }\r\n\r\n  set number (number: number) {\r\n    this.typedValue = number;\r\n  }\r\n\r\n  /**\r\n    Is negative allowed\r\n    @readonly\r\n  */\r\n  get allowNegative (): boolean {\r\n    return this.signed ||\r\n      (this.min != null && this.min < 0) ||\r\n      (this.max != null && this.max < 0);\r\n  }\r\n}\r\nMaskedNumber.DEFAULTS = {\r\n  radix: ',',\r\n  thousandsSeparator: '',\r\n  mapToRadix: ['.'],\r\n  scale: 2,\r\n  signed: false,\r\n  normalizeZeros: true,\r\n  padFractionalZeros: false,\r\n};\r\n\r\n\r\nIMask.MaskedNumber = MaskedNumber;\r\n","// @flow\r\nimport Masked, {type MaskedOptions} from './base.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Masking by custom Function */\r\nexport default\r\nclass MaskedFunction extends Masked<Function> {\r\n  /**\r\n    @override\r\n    @param {Object} opts\r\n  */\r\n  _update (opts: MaskedOptions<Function>) {\r\n    if (opts.mask) opts.validate = opts.mask;\r\n    super._update(opts);\r\n  }\r\n}\r\n\r\n\r\nIMask.MaskedFunction = MaskedFunction;\r\n","// @flow\r\nimport ChangeDetails from '../core/change-details.js';\r\nimport createMask from './factory.js';\r\nimport Masked, {type AppendFlags, type MaskedState} from './base.js';\r\nimport { type TailDetails } from '../core/tail-details.js';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\ntype MaskedDynamicState = {|\r\n  ...MaskedState,\r\n  _rawInputValue: string,\r\n  compiledMasks: Array<*>,\r\n  currentMaskRef: ?Masked<*>,\r\n  currentMask: *,\r\n|};\r\n\r\ntype DynamicMaskType = Array<{[string]: any}>;\r\n/** Dynamic mask for choosing apropriate mask in run-time */\r\nexport default\r\nclass MaskedDynamic extends Masked<DynamicMaskType> {\r\n  /** Currently chosen mask */\r\n  currentMask: ?Masked<*>;\r\n  /** Compliled {@link Masked} options */\r\n  compiledMasks: Array<Masked<*>>;\r\n  /** Chooses {@link Masked} depending on input value */\r\n  dispatch: (string, Masked<*>, AppendFlags) => Masked<*>;\r\n\r\n  /**\r\n    @param {Object} opts\r\n  */\r\n  constructor (opts: any) {\r\n    super({\r\n      ...MaskedDynamic.DEFAULTS,\r\n      ...opts\r\n    });\r\n\r\n    this.currentMask = null;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _update (opts: any) {\r\n    super._update(opts);\r\n    if ('mask' in opts) {\r\n      // mask could be totally dynamic with only `dispatch` option\r\n      this.compiledMasks = Array.isArray(opts.mask) ?\r\n        opts.mask.map(m => createMask(m)) :\r\n        [];\r\n    }\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  _appendCharRaw (ch: string, flags: AppendFlags={}): ChangeDetails {\r\n    const details = this._applyDispatch(ch, flags);\r\n\r\n    if (this.currentMask) {\r\n      details.aggregate(this.currentMask._appendChar(ch, flags));\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  _applyDispatch (appended: string='', flags: AppendFlags={}): ChangeDetails {\r\n    const prevValueBeforeTail = flags.tail && flags._beforeTailState != null ?\r\n      flags._beforeTailState._value :\r\n      this.value;\r\n    const inputValue = this.rawInputValue;\r\n    const insertValue = flags.tail && flags._beforeTailState != null ?\r\n      // $FlowFixMe - tired to fight with type system\r\n      flags._beforeTailState._rawInputValue :\r\n      inputValue;\r\n    const tailValue = inputValue.slice(insertValue.length);\r\n    const prevMask = this.currentMask;\r\n    const details = new ChangeDetails();\r\n\r\n    const prevMaskState = prevMask && prevMask.state;\r\n\r\n    // clone flags to prevent overwriting `_beforeTailState`\r\n    this.currentMask = this.doDispatch(appended, { ...flags });\r\n\r\n    // restore state after dispatch\r\n    if (this.currentMask) {\r\n      if (this.currentMask !== prevMask) {\r\n        // if mask changed reapply input\r\n        this.currentMask.reset();\r\n\r\n        if (insertValue) {\r\n          // $FlowFixMe - it's ok, we don't change current mask above\r\n          const d = this.currentMask.append(insertValue, {raw: true});\r\n          details.tailShift = d.inserted.length - prevValueBeforeTail.length;\r\n        }\r\n\r\n        if (tailValue) {\r\n          // $FlowFixMe - it's ok, we don't change current mask above\r\n          details.tailShift += this.currentMask.append(tailValue, {raw: true, tail: true}).tailShift;\r\n        }\r\n      } else {\r\n        // Dispatch can do something bad with state, so\r\n        // restore prev mask state\r\n        this.currentMask.state = prevMaskState;\r\n      }\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  _appendPlaceholder (...args: *): ChangeDetails {\r\n    const details = this._applyDispatch(...args);\r\n\r\n    if (this.currentMask) {\r\n      details.aggregate(this.currentMask._appendPlaceholder());\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doDispatch(appended: string, flags: AppendFlags={}): ?Masked<*> {\r\n    return this.dispatch(appended, this, flags);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doValidate (...args: *): boolean {\r\n    return super.doValidate(...args) && (\r\n      !this.currentMask || this.currentMask.doValidate(...args));\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  reset () {\r\n    if (this.currentMask) this.currentMask.reset();\r\n    this.compiledMasks.forEach(m => m.reset());\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get value (): string {\r\n    return this.currentMask ? this.currentMask.value : '';\r\n  }\r\n\r\n  set value (value: string) {\r\n    super.value = value;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get unmaskedValue (): string {\r\n    return this.currentMask ? this.currentMask.unmaskedValue : '';\r\n  }\r\n\r\n  set unmaskedValue (unmaskedValue: string) {\r\n    super.unmaskedValue = unmaskedValue;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get typedValue (): any {\r\n    return this.currentMask ? this.currentMask.typedValue : '';\r\n  }\r\n\r\n  // probably typedValue should not be used with dynamic\r\n  set typedValue (value: any) {\r\n    let unmaskedValue = String(value);\r\n\r\n    // double check it\r\n    if (this.currentMask) {\r\n      this.currentMask.typedValue = value;\r\n      unmaskedValue = this.currentMask.unmaskedValue;\r\n    }\r\n    this.unmaskedValue = unmaskedValue;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get isComplete (): boolean {\r\n    return !!this.currentMask && this.currentMask.isComplete;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  remove (...args: *): ChangeDetails {\r\n    const details: ChangeDetails = new ChangeDetails();\r\n    if (this.currentMask) {\r\n      details.aggregate(this.currentMask.remove(...args))\r\n        // update with dispatch\r\n        .aggregate(this._applyDispatch());\r\n    }\r\n\r\n    return details;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  get state (): MaskedDynamicState {\r\n    return {\r\n      ...super.state,\r\n      _rawInputValue: this.rawInputValue,\r\n      compiledMasks: this.compiledMasks.map(m => m.state),\r\n      currentMaskRef: this.currentMask,\r\n      currentMask: this.currentMask && this.currentMask.state,\r\n    };\r\n  }\r\n\r\n  set state (state: MaskedDynamicState) {\r\n    const {compiledMasks, currentMaskRef, currentMask, ...maskedState} = state;\r\n    this.compiledMasks.forEach((m, mi) => m.state = compiledMasks[mi]);\r\n    if (currentMaskRef != null) {\r\n      this.currentMask = currentMaskRef;\r\n      this.currentMask.state = currentMask;\r\n    }\r\n    super.state = maskedState;\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  extractInput (...args: *): string {\r\n    return this.currentMask ?\r\n      this.currentMask.extractInput(...args) :\r\n      '';\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  extractTail (...args: *): TailDetails {\r\n    return this.currentMask ?\r\n      this.currentMask.extractTail(...args) :\r\n      super.extractTail(...args);\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  doCommit () {\r\n    if (this.currentMask) this.currentMask.doCommit();\r\n    super.doCommit();\r\n  }\r\n\r\n  /**\r\n    @override\r\n  */\r\n  nearestInputPos(...args: *): number {\r\n    return this.currentMask ?\r\n      this.currentMask.nearestInputPos(...args) :\r\n      super.nearestInputPos(...args);\r\n  }\r\n\r\n  get overwrite (): ?boolean {\r\n    return this.currentMask ?\r\n      this.currentMask.overwrite :\r\n      super.overwrite;\r\n  }\r\n\r\n  set overwrite (overwrite: *) {\r\n    console.warn('\"overwrite\" option is not available in dynamic mask, use this option in siblings');\r\n  }\r\n}\r\n\r\nMaskedDynamic.DEFAULTS = {\r\n  dispatch: (appended, masked, flags) => {\r\n    if (!masked.compiledMasks.length) return;\r\n\r\n    const inputValue = masked.rawInputValue;\r\n\r\n    // simulate input\r\n    const inputs = masked.compiledMasks.map((m, index) => {\r\n      m.reset();\r\n      m.append(inputValue, { raw: true });\r\n      m.append(appended, flags);\r\n      const weight = m.rawInputValue.length;\r\n\r\n      return {weight, index};\r\n    });\r\n\r\n    // pop masks with longer values first\r\n    inputs.sort((i1, i2) => i2.weight - i1.weight);\r\n\r\n    return masked.compiledMasks[inputs[0].index];\r\n  }\r\n};\r\n\r\n\r\nIMask.MaskedDynamic = MaskedDynamic;\r\n","import createMask from './factory';\r\nimport IMask from '../core/holder.js';\r\n\r\n\r\n/** Mask pipe source and destination types */\r\nexport\r\nconst PIPE_TYPE = {\r\n  MASKED: 'value',\r\n  UNMASKED: 'unmaskedValue',\r\n  TYPED: 'typedValue',\r\n};\r\n\r\n/** Creates new pipe function depending on mask type, source and destination options */\r\nexport\r\nfunction createPipe (mask, from=PIPE_TYPE.MASKED, to=PIPE_TYPE.MASKED) {\r\n  const masked = createMask(mask);\r\n  return (value) => masked.runIsolated(m => {\r\n    m[from] = value;\r\n    return m[to];\r\n  });\r\n}\r\n\r\n/** Pipes value through mask depending on mask type, source and destination options */\r\nexport\r\nfunction pipe (value, ...pipeArgs) {\r\n  return createPipe(...pipeArgs)(value);\r\n}\r\n\r\n\r\nIMask.PIPE_TYPE = PIPE_TYPE;\r\nIMask.createPipe = createPipe;\r\nIMask.pipe = pipe;\r\n"],"names":["check","it","Math","globalThis","window","self","global","this","Function","exec","error","fails","Object","defineProperty","get","nativePropertyIsEnumerable","propertyIsEnumerable","getOwnPropertyDescriptor","call","V","descriptor","enumerable","bitmap","value","configurable","writable","toString","split","slice","classof","undefined","TypeError","IndexedObject","requireObjectCoercible","input","PREFERRED_STRING","isObject","fn","val","valueOf","hasOwnProperty","key","document","EXISTS","createElement","DESCRIPTORS","a","nativeGetOwnPropertyDescriptor","O","P","toIndexedObject","toPrimitive","IE8_DOM_DEFINE","has","createPropertyDescriptor","propertyIsEnumerableModule","f","String","nativeDefineProperty","Attributes","anObject","object","definePropertyModule","createNonEnumerableProperty","SHARED","setGlobal","functionToString","store","inspectSource","module","set","WeakMap","test","push","version","mode","copyright","id","postfix","random","keys","shared","NATIVE_WEAK_MAP","state","wmget","wmhas","wmset","metadata","facade","STATE","uid","hiddenKeys","objectHas","enforce","getterFor","TYPE","type","getInternalState","InternalStateModule","enforceInternalState","TEMPLATE","options","unsafe","simple","noTargetGet","source","join","prototype","aFunction","variable","namespace","method","arguments","length","path","ceil","floor","argument","isNaN","min","toInteger","max","createMethod","IS_INCLUDES","$this","el","fromIndex","toLength","index","integer","toAbsoluteIndex","indexOf","includes","names","i","result","enumBugKeys","concat","getOwnPropertyNames","internalObjectKeys","getOwnPropertySymbols","getBuiltIn","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","target","ownKeys","getOwnPropertyDescriptorModule","replacement","isForced","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","require","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","forced","copyConstructorProperties","sham","redefine","nativeAssign","assign","b","A","B","symbol","Symbol","alphabet","forEach","chr","objectKeys","T","toObject","argumentsLength","S","j","repeat","count","str","n","Infinity","RangeError","IS_END","maxLength","fillString","fillLen","stringFiller","stringLength","fillStr","intMaxLength","start","end","userAgent","$padEnd","proto","WEBKIT_BUG","padEnd","$padStart","isString","padStart","DIRECTION","forceDirection","direction","escapeRegExp","objectIncludes","arrA","Array","isArray","arrB","_typeof","dateA","Date","dateB","getTime","regexpA","RegExp","regexpB","ActionDetails","cursorPos","oldValue","oldSelection","startChangePos","substr","insertedCount","removedCount","substring","ChangeDetails","details","inserted","rawInserted","skip","tailShift","ContinuousTailDetails","from","stop","tail","masked","append","aggregate","_appendPlaceholder","pos","shiftChar","IMask","opts","InputMask","Masked","_value","_update","DEFAULTS","isInitialized","withValueRefresh","bind","resolve","reset","doCommit","doParse","doFormat","extractInput","raw","fromPos","toPos","appendTo","ch","flags","checkTail","consistentState","_appendCharRaw","doPrepare","consistentTail","appended","doValidate","beforeTailState","overwrite","shiftBefore","tailDetails","appendTail","Error","_beforeTailState","ci","_appendChar","_refreshing","rawInput","rawInputValue","ret","_isolated","prepare","validate","parent","commit","format","parse","deleteCount","removeDirection","tailPos","extractTail","nearestInputPos","remove","maskedClass","mask","MaskedRegExp","MaskedPattern","MaskedDate","Number","MaskedNumber","MaskedDynamic","MaskedFunction","constructor","console","warn","createMask","MaskedClass","v","DEFAULT_INPUT_DEFINITIONS","PatternInputDefinition","blockOpts","_isFilled","isOptional","placeholderChar","unmaskedValue","Boolean","lazy","minPos","maxPos","boundPos","isComplete","PatternFixedDefinition","isUnmasking","_isRawInput","char","isResolved","ChunksTailDetails","chunks","map","tailChunk","lastChunk","extendLast","extend","firstTailChunk","shift","blockIndex","chunk","lastBlockIter","_mapPosToBlock","chunkBlock","_stops","_blocks","remainChars","c","props","cstate","chunkShiftPos","splice","search","definitions","_rebuildMask","defs","_maskedBlocks","pattern","unmaskingBlock","optionalBlock","blocks","p","bNames","_this","filter","bName","sort","maskedBlock","isInput","STOP_CHAR","ESCAPE_CHAR","def","maskedState","bi","every","reduce","_get","blockIter","block","blockDetails","chunkTail","_forEachBlocksInRange","bFromPos","bToPos","blockChunk","_this2","_findStopBefore","_blockStartPos","_","stopBefore","si","toBlockIndex","startBlockIter","startBlockIndex","endBlockIndex","args","bDetails","_this3","accVal","blockStartPos","offset","fromBlockIter","toBlockIter","isSameBlock","fromBlockStartPos","fromBlockEndPos","removeDetails","beginBlockData","beginBlockOffset","beginBlockIndex","beginBlock","beginBlockCursorPos","cursorAtRight","cursorAtLeft","searchBlockIndex","blockIndexAtLeft","blockAtLeft","blockInputPos","firstInputAtRight","blockAtRight","firstFilledBlockIndexAtRight","filledBlock","firstEmptyInputBlockIndex","firstFilledInputBlockIndex","blockAlignedPos","firstInputBlockAlignedIndex","firstInputBlockAlignedPos","alignedPos","name","maskedBlocks","indices","gi","_this4","InputDefinition","FixedDefinition","MaskedRange","to","fromStr","toStr","sameCharsCount","minstr","maxstr","match","placeholder","num","autofix","prepStr","nextVal","boundaries","firstNonZero","_matchFrom","GET_DEFAULT_BLOCKS","Y","getFullYear","m","getMonth","d","getDate","bk","date","isDateExist","typedValue","day","month","year","MaskElement","_unsafeSelectionStart","e","_unsafeSelectionEnd","selectionStart","selectionEnd","_unsafeSelect","handlers","HTMLMaskElement","_handlers","getRootNode","rootElement","activeElement","setSelectionRange","event","_toggleEventHandler","EVENTS_MAP","handler","removeEventListener","addEventListener","selectionChange","drop","click","focus","HTMLContenteditableMaskElement","root","selection","getSelection","anchorOffset","createRange","range","setStart","firstChild","setEnd","lastChild","removeAllRanges","addRange","textContent","isContentEditable","tagName","_listeners","_unmaskedValue","_saveSelection","_onInput","_onChange","_onDrop","_onFocus","_onClick","alignCursor","alignCursorFriendly","_bindEvents","updateValue","maskEquals","updateOptions","updateControl","bindEvents","unbindEvents","ev","listeners","l","_cursorChanging","_changingCursorPos","isActive","select","_selection","newUnmaskedValue","newValue","isChanged","_fireChangeEvents","restOpts","updateMask","updateOpts","_delayUpdateCursor","_abortUpdateCursor","setTimeout","_fireEvent","_inputEvent","clearTimeout","hIndex","oldRawValue","removed","updateCursor","preventDefault","stopPropagation","_unbindEvents","MaskedEnum","enum","some","_updateRegExps","allowNegative","scale","radix","_numberRegExpInput","_numberRegExp","_mapToRadixRegExp","mapToRadix","_thousandsSeparatorRegExp","thousandsSeparator","parts","_removeThousandsSeparators","extendOnSeparators","_separatorsCount","_adjustRangeWithSeparators","prevBeforeTailValue","prevBeforeTailSeparatorsCount","_separatorsCountFromSlice","appendDetails","_insertThousandsSeparators","beforeTailValue","beforeTailSeparatorsCount","searchFrom","separatorPos","separatorAroundFromPos","_findSeparatorAround","separatorAroundToPos","valueBeforePos","valueAfterPos","separatorAtLeftPos","separatorAtLeftEndPos","separatorAtRightPos","valid","number","validnum","formatted","normalizeZeros","_normalizeZeros","padFractionalZeros","_padFractionalZeros","sign","zeros","signed","currentMask","compiledMasks","_applyDispatch","prevValueBeforeTail","inputValue","insertValue","_rawInputValue","tailValue","prevMask","prevMaskState","doDispatch","dispatch","currentMaskRef","mi","inputs","weight","i1","i2","PIPE_TYPE","MASKED","UNMASKED","TYPED","createPipe","runIsolated","pipe","pipeArgs"],"mappings":"mcAAA,IAAIA,EAAQ,S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