1/*! 2 * dist/jquery.inputmask 3 * https://github.com/RobinHerbots/Inputmask 4 * Copyright (c) 2010 - 2020 Robin Herbots 5 * Licensed under the MIT license 6 * Version: 5.0.4-beta.7 7 */ 8!function webpackUniversalModuleDefinition(root, factory) { 9 if ("object" == typeof exports && "object" == typeof module) module.exports = factory(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], factory); else { 10 var a = "object" == typeof exports ? factory(require("jquery")) : factory(root.jQuery); 11 for (var i in a) ("object" == typeof exports ? exports : root)[i] = a[i]; 12 } 13}(window, function(__WEBPACK_EXTERNAL_MODULE__3__) { 14 return modules = [ function(module) { 15 module.exports = JSON.parse('{"BACKSPACE":8,"BACKSPACE_SAFARI":127,"DELETE":46,"DOWN":40,"END":35,"ENTER":13,"ESCAPE":27,"HOME":36,"INSERT":45,"LEFT":37,"PAGE_DOWN":34,"PAGE_UP":33,"RIGHT":39,"SPACE":32,"TAB":9,"UP":38,"X":88,"CONTROL":17}'); 16 }, function(module, exports, __webpack_require__) { 17 "use strict"; 18 function _typeof(obj) { 19 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 20 return typeof obj; 21 } : function _typeof(obj) { 22 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 23 }, _typeof(obj); 24 } 25 var $ = __webpack_require__(2), window = __webpack_require__(4), document = window.document, generateMaskSet = __webpack_require__(5).generateMaskSet, analyseMask = __webpack_require__(5).analyseMask, maskScope = __webpack_require__(8); 26 function Inputmask(alias, options, internal) { 27 if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal); 28 this.el = void 0, this.events = {}, this.maskset = void 0, !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {}, 29 alias && (options.alias = alias)), this.opts = $.extend(!0, {}, this.defaults, options), 30 this.noMasksCache = options && void 0 !== options.definitions, this.userOptions = options || {}, 31 resolveAlias(this.opts.alias, options, this.opts), this.isRTL = this.opts.numericInput), 32 this.refreshValue = !1, this.undoValue = void 0, this.$el = void 0, this.skipKeyPressEvent = !1, 33 this.skipInputEvent = !1, this.validationEvent = !1, this.ignorable = !1, this.maxLength, 34 this.mouseEnter = !1, this.originalPlaceholder = void 0; 35 } 36 function resolveAlias(aliasStr, options, opts) { 37 var aliasDefinition = Inputmask.prototype.aliases[aliasStr]; 38 return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts), 39 $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr), 40 !1); 41 } 42 function importAttributeOptions(npt, opts, userOptions, dataAttribute) { 43 function importOption(option, optionData) { 44 var attrOption = "" === dataAttribute ? option : dataAttribute + "-" + option; 45 optionData = void 0 !== optionData ? optionData : npt.getAttribute(attrOption), 46 null !== optionData && ("string" == typeof optionData && (0 === option.indexOf("on") ? optionData = window[optionData] : "false" === optionData ? optionData = !1 : "true" === optionData && (optionData = !0)), 47 userOptions[option] = optionData); 48 } 49 if (!0 === opts.importDataAttributes) { 50 var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p; 51 if (attrOptions && "" !== attrOptions && (attrOptions = attrOptions.replace(/'/g, '"'), 52 dataoptions = JSON.parse("{" + attrOptions + "}")), dataoptions) for (p in optionData = void 0, 53 dataoptions) if ("alias" === p.toLowerCase()) { 54 optionData = dataoptions[p]; 55 break; 56 } 57 for (option in importOption("alias", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts), 58 opts) { 59 if (dataoptions) for (p in optionData = void 0, dataoptions) if (p.toLowerCase() === option.toLowerCase()) { 60 optionData = dataoptions[p]; 61 break; 62 } 63 importOption(option, optionData); 64 } 65 } 66 return $.extend(!0, opts, userOptions), "rtl" !== npt.dir && !opts.rightAlign || (npt.style.textAlign = "right"), 67 "rtl" !== npt.dir && !opts.numericInput || (npt.dir = "ltr", npt.removeAttribute("dir"), 68 opts.isRTL = !0), Object.keys(userOptions).length; 69 } 70 Inputmask.prototype = { 71 dataAttribute: "data-inputmask", 72 defaults: { 73 _maxTestPos: 500, 74 placeholder: "_", 75 optionalmarker: [ "[", "]" ], 76 quantifiermarker: [ "{", "}" ], 77 groupmarker: [ "(", ")" ], 78 alternatormarker: "|", 79 escapeChar: "\\", 80 mask: null, 81 regex: null, 82 oncomplete: $.noop, 83 onincomplete: $.noop, 84 oncleared: $.noop, 85 repeat: 0, 86 greedy: !1, 87 autoUnmask: !1, 88 removeMaskOnSubmit: !1, 89 clearMaskOnLostFocus: !0, 90 insertMode: !0, 91 insertModeVisual: !0, 92 clearIncomplete: !1, 93 alias: null, 94 onKeyDown: $.noop, 95 onBeforeMask: null, 96 onBeforePaste: function onBeforePaste(pastedValue, opts) { 97 return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue; 98 }, 99 onBeforeWrite: null, 100 onUnMask: null, 101 showMaskOnFocus: !0, 102 showMaskOnHover: !0, 103 onKeyValidation: $.noop, 104 skipOptionalPartCharacter: " ", 105 numericInput: !1, 106 rightAlign: !1, 107 undoOnEscape: !0, 108 radixPoint: "", 109 _radixDance: !1, 110 groupSeparator: "", 111 keepStatic: null, 112 positionCaretOnTab: !0, 113 tabThrough: !1, 114 supportsInputType: [ "text", "tel", "url", "password", "search" ], 115 ignorables: [ 8, 9, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ], 116 isComplete: null, 117 preValidation: null, 118 postValidation: null, 119 staticDefinitionSymbol: void 0, 120 jitMasking: !1, 121 nullable: !0, 122 inputEventOnly: !1, 123 noValuePatching: !1, 124 positionCaretOnClick: "lvp", 125 casing: null, 126 inputmode: "text", 127 importDataAttributes: !0, 128 shiftPositions: !0 129 }, 130 definitions: { 131 9: { 132 validator: "[0-9\uff11-\uff19]", 133 definitionSymbol: "*" 134 }, 135 a: { 136 validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 137 definitionSymbol: "*" 138 }, 139 "*": { 140 validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]" 141 } 142 }, 143 aliases: {}, 144 masksCache: {}, 145 mask: function mask(elems) { 146 var that = this; 147 return "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)), 148 elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) { 149 var scopedOpts = $.extend(!0, {}, that.opts); 150 if (importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute)) { 151 var maskset = generateMaskSet(scopedOpts, that.noMasksCache); 152 void 0 !== maskset && (void 0 !== el.inputmask && (el.inputmask.opts.autoUnmask = !0, 153 el.inputmask.remove()), el.inputmask = new Inputmask(void 0, void 0, !0), el.inputmask.opts = scopedOpts, 154 el.inputmask.noMasksCache = that.noMasksCache, el.
154inputmask.userOptions = $.extend(!0, {}, that.userOptions), 155 el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput, el.inputmask.el = el, 156 el.inputmask.$el = $(el), el.inputmask.maskset = maskset, $.data(el, "_inputmask_opts", scopedOpts), 157 maskScope.call(el.inputmask, { 158 action: "mask" 159 })); 160 } 161 }), elems && elems[0] && elems[0].inputmask || this; 162 }, 163 option: function option(options, noremask) { 164 return "string" == typeof options ? this.opts[options] : "object" === _typeof(options) ? ($.extend(this.userOptions, options), 165 this.el && !0 !== noremask && this.mask(this.el), this) : void 0; 166 }, 167 unmaskedvalue: function unmaskedvalue(value) { 168 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 169 maskScope.call(this, { 170 action: "unmaskedvalue", 171 value: value 172 }); 173 }, 174 remove: function remove() { 175 return maskScope.call(this, { 176 action: "remove" 177 }); 178 }, 179 getemptymask: function getemptymask() { 180 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 181 maskScope.call(this, { 182 action: "getemptymask" 183 }); 184 }, 185 hasMaskedValue: function hasMaskedValue() { 186 return !this.opts.autoUnmask; 187 }, 188 isComplete: function isComplete() { 189 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 190 maskScope.call(this, { 191 action: "isComplete" 192 }); 193 }, 194 getmetadata: function getmetadata() { 195 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 196 maskScope.call(this, { 197 action: "getmetadata" 198 }); 199 }, 200 isValid: function isValid(value) { 201 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 202 maskScope.call(this, { 203 action: "isValid", 204 value: value 205 }); 206 }, 207 format: function format(value, metadata) { 208 return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), 209 maskScope.call(this, { 210 action: "format", 211 value: value, 212 metadata: metadata 213 }); 214 }, 215 setValue: function setValue(value) { 216 this.el && $(this.el).trigger("setvalue", [ value ]); 217 }, 218 analyseMask: analyseMask 219 }, Inputmask.extendDefaults = function(options) { 220 $.extend(!0, Inputmask.prototype.defaults, options); 221 }, Inputmask.extendDefinitions = function(definition) { 222 $.extend(!0, Inputmask.prototype.definitions, definition); 223 }, Inputmask.extendAliases = function(alias) { 224 $.extend(!0, Inputmask.prototype.aliases, alias); 225 }, Inputmask.format = function(value, options, metadata) { 226 return Inputmask(options).format(value, metadata); 227 }, Inputmask.unmask = function(value, options) { 228 return Inputmask(options).unmaskedvalue(value); 229 }, Inputmask.isValid = function(value, options) { 230 return Inputmask(options).isValid(value); 231 }, Inputmask.remove = function(elems) { 232 "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)), 233 elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) { 234 el.inputmask && el.inputmask.remove(); 235 }); 236 }, Inputmask.setValue = function(elems, value) { 237 "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)), 238 elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) { 239 el.inputmask ? el.inputmask.setValue(value) : $(el).trigger("setvalue", [ value ]); 240 }); 241 }; 242 var escapeRegexRegex = new RegExp("(\\" + [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ].join("|\\") + ")", "gim"); 243 Inputmask.escapeRegex = function(str) { 244 return str.replace(escapeRegexRegex, "\\$1"); 245 }, Inputmask.dependencyLib = $, window.Inputmask = Inputmask, module.exports = Inputmask; 246 }, function(module, exports, __webpack_require__) { 247 "use strict"; 248 var jquery = __webpack_require__(3); 249 if (void 0 === jquery) throw "jQuery not loaded!"; 250 module.exports = jquery; 251 }
251, function(module, exports) { 252 module.exports = __WEBPACK_EXTERNAL_MODULE__3__; 253 }, function(module, exports, __webpack_require__) { 254 "use strict"; 255 var __WEBPACK_AMD_DEFINE_RESULT__; 256 function _typeof(obj) { 257 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 258 return typeof obj; 259 } : function _typeof(obj) { 260 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 261 }, _typeof(obj); 262 } 263 __WEBPACK_AMD_DEFINE_RESULT__ = function() { 264 return "undefined" != typeof window ? window : new (eval("require('jsdom').JSDOM"))("").window; 265 }.call(exports, __webpack_require__, exports, module), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); 266 }, function(module, exports, __webpack_require__) { 267 "use strict"; 268 var $ = __webpack_require__(2); 269 function generateMaskSet(opts, nocache) { 270 var ms; 271 function generateMask(mask, metadata, opts) { 272 var regexMask = !1, masksetDefinition, maskdefKey; 273 if (null !== mask && "" !== mask || (regexMask = null !== opts.regex, mask = regexMask ? (mask = opts.regex, 274 mask.replace(/^(\^)(.*)(\$)$/, "$2")) : (regexMask = !0, ".*")), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = ""), 275 0 < opts.repeat || "*" === opts.repeat || "+" === opts.repeat) { 276 var repeatStart = "*" === opts.repeat ? 0 : "+" === opts.repeat ? 1 : opts.repeat; 277 mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + "," + opts.repeat + opts.quantifiermarker[1]; 278 } 279 return maskdefKey = regexMask ? "regex_" + opts.regex : opts.numericInput ? mask.split("").reverse().join("") : mask, 280 !1 !== opts.keepStatic && (maskdefKey = "ks_" + maskdefKey), void 0 === Inputmask.prototype.masksCache[maskdefKey] || !0 === nocache ? (masksetDefinition = { 281 mask: mask, 282 maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts), 283 validPositions: {}, 284 _buffer: void 0, 285 buffer: void 0, 286 tests: {}, 287 excludes: {}, 288 metadata: metadata, 289 maskLength: void 0, 290 jitOffset: {} 291 }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition, 292 masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]), 293 masksetDefinition; 294 } 295 if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) { 296 if (1 < opts.mask.length) { 297 null === opts.keepStatic && (opts.keepStatic = !0); 298 var altMask = opts.groupmarker[0]; 299 return $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) { 300 1 < altMask.length && (altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0]), 301 void 0 === msk.mask || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask; 302 }), altMask += opts.groupmarker[1], generateMask(altMask, opts.mask, opts); 303 } 304 opts.mask = opts.mask.pop(); 305 } 306 return null === opts.keepStatic && (opts.keepStatic = !1), ms = opts.mask && void 0 !== opts.mask.mask && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts), 307 ms; 308 } 309 function analyseMask(mask, regexMask, opts) { 310 var tokenizer = /(?:[?*+]|\{[0-9+*]+(?:,[0-9+*]*)?(?:\|[0-9+*]*)?\})|[^.?*+^${[]()|\\]+|./g, regexTokenizer = /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, escaped = !1, currentToken = new MaskToken(), match, m, openenings = [], maskTokens = [], openingToken, currentOpeningToken, alternator, lastMatch, closeRegexGroup = !1; 311 function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) { 312 this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1, 313 this.isOptional = isOptional || !1, this.isQuantifier = is
vendor: 13,294 bytes, lines 313-540
313Quantifier || !1, this.isAlternator = isAlternator || !1, 314 this.quantifier = { 315 min: 1, 316 max: 1 317 }; 318 } 319 function insertTestDefinition(mtoken, element, position) { 320 position = void 0 !== position ? position : mtoken.matches.length; 321 var prevMatch = mtoken.matches[position - 1]; 322 if (regexMask) 0 === element.indexOf("[") || escaped && /\\d|\\s|\\w]/i.test(element) || "." === element ? mtoken.matches.splice(position++, 0, { 323 fn: new RegExp(element, opts.casing ? "i" : ""), 324 static: !1, 325 optionality: !1, 326 newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== element, 327 casing: null, 328 def: element, 329 placeholder: void 0, 330 nativeDef: element 331 }) : (escaped && (element = element[element.length - 1]), $.each(element.split(""), function(ndx, lmnt) { 332 prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, { 333 fn: /[a-z]/i.test(opts.staticDefinitionSymbol || lmnt) ? new RegExp("[" + (opts.staticDefinitionSymbol || lmnt) + "]", opts.casing ? "i" : "") : null, 334 static: !0, 335 optionality: !1, 336 newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== lmnt && !0 !== prevMatch.static, 337 casing: null, 338 def: opts.staticDefinitionSymbol || lmnt, 339 placeholder: void 0 !== opts.staticDefinitionSymbol ? lmnt : void 0, 340 nativeDef: (escaped ? "'" : "") + lmnt 341 }); 342 })), escaped = !1; else { 343 var maskdef = (opts.definitions ? opts.definitions[element] : void 0) || Inputmask.prototype.definitions[element]; 344 maskdef && !escaped ? mtoken.matches.splice(position++, 0, { 345 fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? "i" : "") : new function() { 346 this.test = maskdef.validator; 347 }() : new RegExp("."), 348 static: maskdef.static || !1, 349 optionality: !1, 350 newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== (maskdef.definitionSymbol || element), 351 casing: maskdef.casing, 352 def: maskdef.definitionSymbol || element, 353 placeholder: maskdef.placeholder, 354 nativeDef: element, 355 generated: maskdef.generated 356 }) : (mtoken.matches.splice(position++, 0, { 357 fn: /[a-z]/i.test(opts.staticDefinitionSymbol || element) ? new RegExp("[" + (opts.staticDefinitionSymbol || element) + "]", opts.casing ? "i" : "") : null, 358 static: !0, 359 optionality: !1, 360 newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== element && !0 !== prevMatch.static, 361 casing: null, 362 def: opts.staticDefinitionSymbol || element, 363 placeholder: void 0 !== opts.staticDefinitionSymbol ? element : void 0, 364 nativeDef: (escaped ? "'" : "") + element 365 }), escaped = !1); 366 } 367 } 368 function verifyGroupMarker(maskToken) { 369 maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) { 370 var nextToken = maskToken.matches[ndx + 1]; 371 (void 0 === nextToken || void 0 === nextToken.matches || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1, 372 regexMask || (insertTestDefinition(token, opts.groupmarker[0], 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker[1]))), 373 verifyGroupMarker(token); 374 }); 375 } 376 function defaultCase() { 377 if (0 < openenings.length) { 378 if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m), 379 currentOpeningToken.isAlternator) { 380 alternator = openenings.pop(); 381 for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup && (alternator.matches[mndx].isGroup = !1); 382 0 < openenings.length ? (currentOpeningToken = openenings[openenings.length - 1], 383 currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); 384 } 385 } else insertTestDefinition(currentToken, m); 386 } 387 function reverseTokens(maskToken) { 388 function reverseStatic(st) { 389 return st === opts.optionalmarker[0] ? st = opts.optionalmarker[1] : st === opts.optionalmarker[1] ? st = opts.optionalmarker[0] : st === opts.groupmarker[0] ? st = opts.groupmarker[1] : st === opts.groupmarker[1] && (st = opts.groupmarker[0]), 390 st; 391 } 392 for (var match in maskToken.matches = maskToken.matches.reverse(), maskToken.matches) if (Object.prototype.hasOwnProperty.call(maskToken.matches, match)) { 393 var intMatch = parseInt(match); 394 if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) { 395 var qt = maskToken.matches[match]; 396 maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt); 397 } 398 void 0 !== maskToken.matches[match].matches ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = reverseStatic(maskToken.matches[match]); 399 } 400 return maskToken; 401 } 402 function groupify(matches) { 403 var groupToken = new MaskToken(!0); 404 return groupToken.openGroup = !1, groupToken.matches = matches, groupToken; 405 } 406 function closeGroup() { 407 if (openingToken = openenings.pop(), openingToken.openGroup = !1, void 0 !== openingToken) if (0 < openenings.length) { 408 if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken), 409 currentOpeningToken.isAlternator) { 410 alternator = openenings.pop(); 411 for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1, 412 alternator.matches[mndx].alternatorGroup = !1; 413 0 < openenings.length ? (currentOpeningToken = openenings[openenings.length - 1], 414 currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); 415 } 416 } else currentToken.matches.push(openingToken); else defaultCase(); 417 } 418 function groupQuantifier(matches) { 419 var lastMatch = matches.pop(); 420 return lastMatch.isQuantifier && (lastMatch = groupify([ matches.pop(), lastMatch ])), 421 lastMatch; 422 } 423 for (regexMask && (opts.optionalmarker[0] = void 0, opts.optionalmarker[1] = void 0); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) { 424 if (m = match[0], regexMask) switch (m.charAt(0)) { 425 case "?": 426 m = "{0,1}"; 427 break; 428 429 case "+": 430 case "*": 431 m = "{" + m + "}"; 432 break; 433 434 case "|": 435 if (0 === openenings.length) { 436 var altRegexGroup = groupify(currentToken.matches); 437 altRegexGroup.openGroup = !0, openenings.push(altRegexGroup), currentToken.matches = [], 438 closeRegexGroup = !0; 439 } 440 break; 441 } 442 if (escaped) defaultCase(); else switch (m.charAt(0)) { 443 case "(?=": 444 break; 445 446 case "(?!": 447 break; 448 449 case "(?<=": 450 break; 451 452 case "(?<!": 453 break; 454 455 case opts.escapeChar: 456 escaped = !0, regexMask && defaultCase(); 457 break; 458 459 case opts.optionalmarker[1]: 460 case opts.groupmarker[1]: 461 closeGroup(); 462 break; 463 464 case opts.optionalmarker[0]: 465 openenings.push(new MaskToken(!1, !0)); 466 break; 467 468 case opts.groupmarker[0]: 469 openenings.push(new MaskToken(!0)); 470 break; 471 472 case opts.quantifiermarker[0]: 473 var quantifier = new MaskToken(!1, !1, !0); 474 m = m.replace(/[{}]/g, ""); 475 var mqj = m.split("|"), mq = mqj[0].split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]); 476 "*" !== mq0 && "+" !== mq0 || (mq0 = "*" === mq1 ? 0 : 1), quantifier.quantifier = { 477 min: mq0, 478 max: mq1, 479 jit: mqj[1] 480 }; 481 var matches = 0 < openenings.length ? openenings[openenings.length - 1].matches : currentToken.matches; 482 if (match = matches.pop(), match.isAlternator) { 483 matches.push(match), matches = match.matches; 484 var groupToken = new MaskToken(!0), tmpMatch = matches.pop(); 485 matches.push(groupToken), matches = groupToken.matches, match = tmpMatch; 486 } 487 match.isGroup || (match = groupify([ match ])), matches.push(match), matches.push(quantifier); 488 break; 489 490 case opts.alternatormarker: 491 if (0 < openenings.length) { 492 currentOpeningToken = openenings[openenings.length - 1]; 493 var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1]; 494 lastMatch = currentOpeningToken.openGroup && (void 0 === subToken.matches || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : groupQuantifier(currentOpeningToken.matches); 495 } else lastMatch = groupQuantifier(currentToken.matches); 496 if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), 497 lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch), 498 openenings.push(alternator), lastMatch.openGroup) { 499 lastMatch.openGroup = !1; 500 var alternatorGroup = new MaskToken(!0); 501 alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup); 502 } 503 break; 504 505 default: 506 defaultCase(); 507 } 508 } 509 for (closeRegexGroup && closeGroup(); 0 < openenings.length; ) openingToken = openenings.pop(), 510 currentToken.matches.push(openingToken); 511 return 0 < currentToken.matches.length && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)), 512 (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens; 513 } 514 module.exports = { 515 generateMaskSet: generateMaskSet, 516 analyseMask: analyseMask 517 }; 518 }, function(module, exports, __webpack_require__) { 519 "use strict"; 520 __webpack_require__(7), __webpack_require__(10), __webpack_require__(11), __webpack_require__(12), 521 module.exports = __webpack_require__(1); 522 }, function(module, exports, __webpack_require__) { 523 "use strict"; 524 var Inputmask = __webpack_require__(1); 525 Inputmask.extendDefinitions({ 526 A: { 527 validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 528 casing: "upper" 529 }, 530 "&": { 531 validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 532 casing: "upper" 533 }, 534 "#": { 535 validator: "[0-9A-Fa-f]", 536 casing: "upper" 537 } 538 }); 539 var ipValidatorRegex = new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]"); 540 function ipValidator(chrs, maskset, pos, strict, opts) {
541 return chrs = -1 < pos - 1 && "." !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs, 542 -1 < pos - 2 && "." !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : "00" + chrs, 543 ipValidatorRegex.test(chrs); 544 } 545 Inputmask.extendAliases({ 546 cssunit: { 547 regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)" 548 }, 549 url: { 550 regex: "(https?|ftp)//.*", 551 autoUnmask: !1 552 }, 553 ip: { 554 mask: "i[i[i]].j[j[j]].k[k[k]].l[l[l]]", 555 definitions: { 556 i: { 557 validator: ipValidator 558 }, 559 j: { 560 validator: ipValidator 561 }, 562 k: { 563 validator: ipValidator 564 }, 565 l: { 566 validator: ipValidator 567 } 568 }, 569 onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) { 570 return maskedValue; 571 }, 572 inputmode: "numeric" 573 }, 574 email: { 575 mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]", 576 greedy: !1, 577 casing: "lower", 578 onBeforePaste: function onBeforePaste(pastedValue, opts) { 579 return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", ""); 580 }, 581 definitions: { 582 "*": { 583 validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]" 584 }, 585 "-": { 586 validator: "[0-9A-Za-z-]" 587 } 588 }, 589 onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) { 590 return maskedValue; 591 }, 592 inputmode: "email" 593 }, 594 mac: { 595 mask: "##:##:##:##:##:##" 596 }, 597 vin: { 598 mask: "V{13}9{4}", 599 definitions: { 600 V: { 601 validator: "[A-HJ-NPR-Za-hj-npr-z\\d]", 602 casing: "upper" 603 } 604 }, 605 clearIncomplete: !0, 606 autoUnmask: !0 607 }, 608 ssn: { 609 mask: "999-99-9999", 610 postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) { 611 return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(buffer.join("")); 612 } 613 } 614 }), module.exports = Inputmask; 615 }, function(module, exports, __webpack_require__) { 616 "use strict"; 617 __webpack_require__(9); 618 var $ = __webpack_require__(2), window = __webpack_require__(4), document = window.document, ua = window.navigator && window.navigator.userAgent || "", ie = 0 < ua.indexOf("MSIE ") || 0 < ua.indexOf("Trident/"), mobile = "ontouchstart" in window, iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, keyCode = __webpack_require__(0); 619 module.exports = function maskScope(actionObj) { 620 var inputmask = this, maskset = inputmask.maskset, opts = inputmask.opts, el = inputmask.el, isRTL = inputmask.isRTL || (inputmask.isRTL = opts.numericInput); 621 function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) { 622 var greedy = opts.greedy; 623 clearOptionalTail && (opts.greedy = !1), minimalPos = minimalPos || 0; 624 var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, jitRenderStatic; 625 do { 626 if (!0 === baseOnInput && maskset.validPositions[pos]) testPos = clearOptionalTail && !0 === maskset.validPositions[pos].match.optionality && void 0 === maskset.validPositions[pos + 1] && (!0 === maskset.validPositions[pos].generatedInput || maskset.validPositions[pos].input == opts.skipOptionalPartCharacter && 0 < pos) ? determineTestTemplate(pos, getTests(pos, ndxIntlzr, pos - 1)) : maskset.validPositions[pos], 627 test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)); else { 628 testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, ndxIntlzr = testPos.locator.slice(); 629 var jitMasking = !0 !== noJit && (!1 !== opts.jitMasking ? opts.jitMasking : test.jit); 630 jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn, 631 jitRenderStatic || !1 === jitMasking || void 0 === jitMasking || "number" == typeof jitMasking && isFinite(jitMasking) && pos < jitMasking ? maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)) : jitRenderStatic = !1; 632 } 633 pos++; 634 } while ((void 0 === inputmask.maxLength || pos < inputmask.maxLength) && (!0 !== test.static || "" !== test.def) || pos < minimalPos); 635 return "" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), !1 === includeMode && void 0 !== maskset.maskLength || (maskset.maskLength = pos - 1), 636 opts.greedy = greedy, maskTemplate; 637 } 638 function resetMaskSet(soft) { 639 maskset.buffer = void 0, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0); 640 } 641 function getLastValidPosition(closestTo, strict, validPositions) { 642 var before = -1, after = -1, valids = validPositions || maskset.validPositions; 643 for (var posNdx in void 0 === closestTo && (closestTo = -1), valids) { 644 var psNdx = parseInt(posNdx); 645 valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx), 646 closestTo <= psNdx && (after = psNdx)); 647 } 648 return -1 === before || before == closestTo ? after : -1 == after ? before : closestTo - before < after - closestTo ? before : after; 649 } 650 function getDecisionTaker(tst) { 651 var decisionTaker = tst.locator[tst.alternation]; 652 return "string" == typeof decisionTaker && 0 < decisionTaker.length && (decisionTaker = decisionTaker.split(",")[0]), 653 void 0 !== decisionTaker ? decisionTaker.toString() : ""; 654 } 655 function getLocator(tst, align) { 656 var locator = (null != tst.alternation ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join(""); 657 if ("" !== locator) for (;locator.length < align; ) locator += "0"; 658 return locator; 659 } 660 function determineTestTemplate(pos, tests) { 661 pos = 0 < pos ? pos - 1 : 0;
662 for (var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch, ndx = 0; ndx < tests.length; ndx++) { 663 var tst = tests[ndx]; 664 tstLocator = getLocator(tst, targetLocator.length); 665 var distance = Math.abs(tstLocator - targetLocator); 666 (void 0 === closest || "" !== tstLocator && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && "master" === bestMatch.match.newBlockMarker && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) && (closest = distance, 667 bestMatch = tst); 668 } 669 return bestMatch; 670 } 671 function getTestTemplate(pos, ndxIntlzr, tstPs) { 672 return maskset.validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs)); 673 } 674 function getTest(pos, tests) { 675 return maskset.validPositions[pos] ? maskset.validPositions[pos] : (tests || getTests(pos))[0]; 676 } 677 function positionCanMatchDefinition(pos, testDefinition, opts) { 678 for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) { 679 if (tests[tndx].match && (!(tests[tndx].match.nativeDef !== testDefinition.match[opts.shiftPositions ? "def" : "nativeDef"] || opts.shiftPositions && testDefinition.match.static) || tests[tndx].match.nativeDef === testDefinition.match.nativeDef)) { 680 valid = !0; 681 break; 682 } 683 if (tests[tndx].match && tests[tndx].match.def === testDefinition.match.nativeDef) { 684 valid = void 0; 685 break; 686 } 687 } 688 return !1 === valid && void 0 !== maskset.jitOffset[pos] && (valid = positionCanMatchDefinition(pos + maskset.jitOffset[pos], testDefinition, opts)), 689 valid; 690 } 691 function getTests(pos, ndxIntlzr, tstPs) { 692 var maskTokens = maskset.maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join("") : ""; 693 function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) { 694 function handleMatch(match, loopNdx, quantifierRecurse) { 695 function isFirstMatch(latestMatch, tokenGroup) { 696 var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches); 697 return firstMatch || $.each(tokenGroup.matches, function(ndx, match) { 698 if (!0 === match.isQuantifier ? firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]) : Object.prototype.hasOwnProperty.call(match, "matches") && (firstMatch = isFirstMatch(latestMatch, match)), 699 firstMatch) return !1; 700 }), firstMatch; 701 } 702 function resolveNdxInitializer(pos, alternateNdx, targetAlternation) { 703 var bestMatch, indexPos; 704 if ((maskset.tests[pos] || maskset.validPositions[pos]) && $.each(maskset.tests[pos] || [ maskset.validPositions[pos] ], function(ndx, lmnt) { 705 if (lmnt.mloc[alternateNdx]) return bestMatch = lmnt, !1; 706 var alternation = void 0 !== targetAlternation ? targetAlternation : lmnt.alternation, ndxPos = void 0 !== lmnt.locator[alternation] ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1; 707 (void 0 === indexPos || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt, 708 indexPos = ndxPos); 709 }), bestMatch) { 710 var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation], locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator; 711 return locator.slice((void 0 !== targetAlternation ? targetAlternation : bestMatch.alternation) + 1); 712 } 713 return void 0 !== targetAlternation ? resolveNdxInitializer(pos, alternateNdx) : void 0; 714 } 715 function isSubsetOf(source, target) { 716 function expand(pattern) { 717 for (var expanded = [], start = -1, end, i = 0, l = pattern.length; i < l;
717 i++) if ("-" === pattern.charAt(i)) for (end = pattern.charCodeAt(i + 1); ++start < end; ) expanded.push(String.fromCharCode(start)); else start = pattern.charCodeAt(i), 718 expanded.push(pattern.charAt(i)); 719 return expanded.join(""); 720 } 721 return source.match.def === target.match.nativeDef || !(!(opts.regex || source.match.fn instanceof RegExp && target.match.fn instanceof RegExp) || !0 === source.match.static || !0 === target.match.static) && -1 !== expand(target.match.fn.toString().replace(/[[\]/]/g, "")).indexOf(expand(source.match.fn.toString().replace(/[[\]/]/g, ""))); 722 } 723 function staticCanMatchDefinition(source, target) { 724 return !0 === source.match.static && !0 !== target.match.static && target.match.fn.test(source.match.def, maskset, pos, !1, opts, !1); 725 } 726 function setMergeLocators(targetMatch, altMatch) { 727 var alternationNdx = targetMatch.alternation, shouldMerge = void 0 === altMatch || alternationNdx === altMatch.alternation && -1 === targetMatch.locator[alternationNdx].toString().indexOf(altMatch.locator[alternationNdx]); 728 if (!shouldMerge && alternationNdx > altMatch.alternation) for (var i = altMatch.alternation; i < alternationNdx; i++) if (targetMatch.locator[i] !== altMatch.locator[i]) { 729 alternationNdx = i, shouldMerge = !0; 730 break; 731 } 732 if (shouldMerge) { 733 targetMatch.mloc = targetMatch.mloc || {}; 734 var locNdx = targetMatch.locator[alternationNdx]; 735 if (void 0 !== locNdx) { 736 if ("string" == typeof locNdx && (locNdx = locNdx.split(",")[0]), void 0 === targetMatch.mloc[locNdx] && (targetMatch.mloc[locNdx] = targetMatch.locator.slice()), 737 void 0 !== altMatch) { 738 for (var ndx in altMatch.mloc) "string" == typeof ndx && (ndx = ndx.split(",")[0]), 739 void 0 === targetMatch.mloc[ndx] && (targetMatch.mloc[ndx] = altMatch.mloc[ndx]); 740 targetMatch.locator[alternationNdx] = Object.keys(targetMatch.mloc).join(","); 741 } 742 return !0; 743 } 744 targetMatch.alternation = void 0; 745 } 746 return !1; 747 } 748 function isSameLevel(targetMatch, altMatch) { 749 if (targetMatch.locator.length !== altMatch.locator.length) return !1; 750 for (var locNdx = targetMatch.alternation + 1; locNdx < targetMatch.locator.length; locNdx++) if (targetMatch.locator[locNdx] !== altMatch.locator[locNdx]) return !1; 751 return !0; 752 } 753 if (testPos > opts._maxTestPos && void 0 !== quantifierRecurse) throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + maskset.mask; 754 if (testPos === pos && void 0 === match.matches) return matches.push({ 755 match: match, 756 locator: loopNdx.reverse(), 757 cd: cacheDependency, 758 mloc: {} 759 }), !0; 760 if (void 0 !== match.matches) { 761 if (match.isGroup && quantifierRecurse !== match) { 762 if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse), 763 match) return !0; 764 } else if (match.isOptional) { 765 var optionalToken = match, mtchsNdx = matches.length; 766 if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse), 767 match) { 768 if ($.each(matches, function(ndx, mtch) { 769 mtchsNdx <= ndx && (mtch.match.optionality = !0); 770 }), latestMatch = matches[matches.length - 1].match, void 0 !== quantifierRecurse || !isFirstMatch(latestMatch, optionalToken)) return !0; 771 insertStop = !0, testPos = pos; 772 } 773 } else if (match.isAlternator) { 774 var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = 0 < ndxInitializer.length ? ndxInitializer.shift() : -1; 775 if (-1 === altIndex || "string" == typeof altIndex) { 776 var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx; 777 if ("string" == typeof altIndex) altIndexArr = altIndex.split(","); else for (amndx = 0;
777 amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx.toString()); 778 if (void 0 !== maskset.excludes[pos]) { 779 for (var altIndexArrClone = altIndexArr.slice(), i = 0, exl = maskset.excludes[pos].length; i < exl; i++) { 780 var excludeSet = maskset.excludes[pos][i].toString().split(":"); 781 loopNdx.length == excludeSet[1] && altIndexArr.splice(altIndexArr.indexOf(excludeSet[0]), 1); 782 } 783 0 === altIndexArr.length && (delete maskset.excludes[pos], altIndexArr = altIndexArrClone); 784 } 785 (!0 === opts.keepStatic || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) && (altIndexArr = altIndexArr.slice(0, 1)); 786 for (var unMatchedAlternation = !1, ndx = 0; ndx < altIndexArr.length; ndx++) { 787 amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = "string" == typeof altIndex && resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(), 788 alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) ? match = !0 : 0 === ndx && (unMatchedAlternation = !0), 789 maltMatches = matches.slice(), testPos = currentPos, matches = []; 790 for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) { 791 var altMatch = maltMatches[ndx1], dropMatch = !1; 792 altMatch.match.jit = altMatch.match.jit || unMatchedAlternation, altMatch.alternation = altMatch.alternation || loopNdxCnt, 793 setMergeLocators(altMatch); 794 for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) { 795 var altMatch2 = malternateMatches[ndx2]; 796 if ("string" != typeof altIndex || void 0 !== altMatch.alternation && -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) { 797 if (altMatch.match.nativeDef === altMatch2.match.nativeDef) { 798 dropMatch = !0, setMergeLocators(altMatch2, altMatch); 799 break; 800 } 801 if (isSubsetOf(altMatch, altMatch2)) { 802 setMergeLocators(altMatch, altMatch2) && (dropMatch = !0, malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch)); 803 break; 804 } 805 if (isSubsetOf(altMatch2, altMatch)) { 806 setMergeLocators(altMatch2, altMatch); 807 break; 808 } 809 if (staticCanMatchDefinition(altMatch, altMatch2)) { 810 isSameLevel(altMatch, altMatch2) || void 0 !== el.inputmask.userOptions.keepStatic ? setMergeLocators(altMatch, altMatch2) && (dropMatch = !0, 811 malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch)) : opts.keepStatic = !0; 812 break; 813 } 814 } 815 } 816 dropMatch || malternateMatches.push(altMatch); 817 } 818 } 819 matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = 0 < matches.length, 820 match = 0 < malternateMatches.length, ndxInitializer = ndxInitializerClone.slice(); 821 } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse); 822 if (match) return !0; 823 } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = 0 < ndxInitializer.length ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) { 824 var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1]; 825 if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup), match) { 826 if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx >= qt.quantifier.min, 827 latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit, 828 latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) { 829 insertStop = !0, testPos = pos; 830 break; 831 } 832 return latestMatch.jit && (maskset.jitOffset[pos] = tokenGroup.matches.length - tokenGroup.matches.indexOf(latestMatch)), 833 !0; 834 } 835 } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse), 836 match) return !0; 837 } else testPos++; 838 } 839 for (var tndx = 0 < ndxInitializer.length ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) { 840 var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse); 841 if (match && testPos === pos) return match; 842 if (pos < testPos) break; 843 } 844 } 845 function mergeLocators(pos, tests) { 846 var locator = []; 847 return $.isArray(tests) || (tests = [ tests ]), 0 < tests.length && (void 0 === tests[0].alternation || !0 === opts.keepStatic ? (locator = determineTestTemplate(pos, tests.slice()).locator.slice(), 848 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) { 849 if ("" !== tst.def) if (0 === locator.length) locator = t
849st.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += "," + tst.locator[i]); 850 })), locator; 851 } 852 if (-1 < pos && (void 0 === inputmask.maxLength || pos < inputmask.maxLength)) { 853 if (void 0 === ndxIntlzr) { 854 for (var previousPos = pos - 1, test; void 0 === (test = maskset.validPositions[previousPos] || maskset.tests[previousPos]) && -1 < previousPos; ) previousPos--; 855 void 0 !== test && -1 < previousPos && (ndxInitializer = mergeLocators(previousPos, test), 856 cacheDependency = ndxInitializer.join(""), testPos = previousPos); 857 } 858 if (maskset.tests[pos] && maskset.tests[pos][0].cd === cacheDependency) return maskset.tests[pos]; 859 for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) { 860 var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]); 861 if (match && testPos === pos || pos < testPos) break; 862 } 863 } 864 return 0 !== matches.length && !insertStop || matches.push({ 865 match: { 866 fn: null, 867 static: !0, 868 optionality: !1, 869 casing: null, 870 def: "", 871 placeholder: "" 872 }, 873 locator: [], 874 mloc: {}, 875 cd: cacheDependency 876 }), void 0 !== ndxIntlzr && maskset.tests[pos] ? $.extend(!0, [], matches) : (maskset.tests[pos] = $.extend(!0, [], matches), 877 maskset.tests[pos]); 878 } 879 function getBufferTemplate() { 880 return void 0 === maskset._buffer && (maskset._buffer = getMaskTemplate(!1, 1), 881 void 0 === maskset.buffer && (maskset.buffer = maskset._buffer.slice())), maskset._buffer; 882 } 883 function getBuffer(noCache) { 884 return void 0 !== maskset.buffer && !0 !== noCache || (maskset.buffer = getMaskTemplate(!0, getLastValidPosition(), !0), 885 void 0 === maskset._buffer && (maskset._buffer = maskset.buffer.slice())), maskset.buffer; 886 } 887 function refreshFromBuffer(start, end, buffer) { 888 var i, p, skipOptionalPartCharacter = opts.skipOptionalPartCharacter, bffr = isRTL ? buffer.slice().reverse() : buffer; 889 if (opts.skipOptionalPartCharacter = "", !0 === start) resetMaskSet(), maskset.tests = {}, 890 start = 0, end = buffer.length, p = determineNewCaretPosition({ 891 begin: 0, 892 end: 0 893 }, !1).begin; else { 894 for (i = start; i < end; i++) delete maskset.validPositions[i]; 895 p = start; 896 } 897 var keypress = new $.Event("keypress"); 898 for (i = start; i < end; i++) { 899 keypress.which = bffr[i].toString().charCodeAt(0), inputmask.ignorable = !1; 900 var valResult = EventHandlers.keypressEvent.call(el, keypress, !0, !1, !1, p); 901 !1 !== valResult && (p = valResult.forwardPosition); 902 } 903 opts.skipOptionalPartCharacter = skipOptionalPartCharacter; 904 } 905 function casing(elem, test, pos) { 906 switch (opts.casing || test.casing) { 907 case "upper": 908 elem = elem.toUpperCase(); 909 break; 910 911 case "lower": 912 elem = elem.toLowerCase(); 913 break; 914 915 case "title": 916 var posBefore = maskset.validPositions[pos - 1]; 917 elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase(); 918 break; 919 920 default: 921 if ($.isFunction(opts.casing)) { 922 var args = Array.prototype.slice.call(arguments); 923 args.push(maskset.validPositions), elem = opts.casing.apply(this, args); 924 } 925 } 926 return elem; 927 } 928 function checkAlternationMatch(altArr1, altArr2, na) { 929 for (var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = void 0 !== na ? na.split(",") : [], naNdx, i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1); 930 for (var alndx = 0; alndx < altArr1.length;
930 alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) { 931 isMatch = !0; 932 break; 933 } 934 return isMatch; 935 } 936 function alternate(maskPos, c, strict, fromIsValid, rAltPos, selection) { 937 var validPsClone = $.extend(!0, {}, maskset.validPositions), tstClone = $.extend(!0, {}, maskset.tests), lastAlt, alternation, isValidRslt = !1, returnRslt = !1, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = void 0 !== rAltPos ? rAltPos : getLastValidPosition(), nextPos, input, begin, end; 938 if (selection && (begin = selection.begin, end = selection.end, selection.begin > selection.end && (begin = selection.end, 939 end = selection.begin)), -1 === lAltPos && void 0 === rAltPos) lastAlt = 0, prevAltPos = getTest(lastAlt), 940 alternation = prevAltPos.alternation; else for (;0 <= lAltPos; lAltPos--) if (altPos = maskset.validPositions[lAltPos], 941 altPos && void 0 !== altPos.alternation) { 942 if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break; 943 lastAlt = lAltPos, alternation = maskset.validPositions[lastAlt].alternation, prevAltPos = altPos; 944 } 945 if (void 0 !== alternation) { 946 decisionPos = parseInt(lastAlt), maskset.excludes[decisionPos] = maskset.excludes[decisionPos] || [], 947 !0 !== maskPos && maskset.excludes[decisionPos].push(getDecisionTaker(prevAltPos) + ":" + prevAltPos.alternation); 948 var validInputs = [], resultPos = -1; 949 for (i = decisionPos; i < getLastValidPosition(void 0, !0) + 1; i++) -1 === resultPos && maskPos <= i && void 0 !== c && (validInputs.push(c), 950 resultPos = validInputs.length - 1), validPos = maskset.validPositions[i], validPos && !0 !== validPos.generatedInput && (void 0 === selection || i < begin || end <= i) && validInputs.push(validPos.input), 951 delete maskset.validPositions[i]; 952 for (-1 === resultPos && void 0 !== c && (validInputs.push(c), resultPos = validInputs.length - 1); void 0 !== maskset.excludes[decisionPos] && maskset.excludes[decisionPos].length < 10; ) { 953 for (maskset.tests = {}, resetMaskSet(!0), isValidRslt = !0, i = 0; i < validInputs.length && (nextPos = isValidRslt.caret || getLastValidPosition(void 0, !0) + 1, 954 input = validInputs[i], isValidRslt = isValid(nextPos, input, !1, fromIsValid, !0)); i++) i === resultPos && (returnRslt = isValidRslt), 955 1 == maskPos && isValidRslt && (returnRslt = { 956 caretPos: i 957 }); 958 if (isValidRslt) break; 959 if (resetMaskSet(), prevAltPos = getTest(decisionPos), maskset.validPositions = $.extend(!0, {}, validPsClone), 960 maskset.tests = $.extend(!0, {}, tstClone), !maskset.excludes[decisionPos]) { 961 returnRslt = alternate(maskPos, c, strict, fromIsValid, decisionPos - 1, selection); 962 break; 963 } 964 var decisionTaker = getDecisionTaker(prevAltPos); 965 if (-1 !== maskset.excludes[decisionPos].indexOf(decisionTaker + ":" + prevAltPos.alternation)) { 966 returnRslt = alternate(maskPos, c, strict, fromIsValid, decisionPos - 1, selection); 967 break; 968 } 969 for (maskset.excludes[decisionPos].push(decisionTaker + ":" + prevAltPos.alternation), 970 i = decisionPos; i < getLastValidPosition(void 0, !0) + 1; i++) delete maskset.validPositions[i]; 971 } 972 } 973 return returnRslt && !1 === opts.keepStatic || delete maskset.excludes[decisionPos], 974 returnRslt; 975 } 976 function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly) { 977 function isSelection(posObj) { 978 return isRTL ? 1 < posObj.begin - posObj.end || posObj.begin - posObj.end == 1 : 1 < posObj.end - posObj.begin || posObj.end - posObj.begin == 1; 979 }
980 strict = !0 === strict; 981 var maskPos = pos; 982 function processCommandObject(commandObj) { 983 if (void 0 !== commandObj) { 984 if (void 0 !== commandObj.remove && ($.isArray(commandObj.remove) || (commandObj.remove = [ commandObj.remove ]), 985 $.each(commandObj.remove.sort(function(a, b) { 986 return b.pos - a.pos; 987 }), function(ndx, lmnt) { 988 revalidateMask({ 989 begin: lmnt, 990 end: lmnt + 1 991 }); 992 }), commandObj.remove = void 0), void 0 !== commandObj.insert && ($.isArray(commandObj.insert) || (commandObj.insert = [ commandObj.insert ]), 993 $.each(commandObj.insert.sort(function(a, b) { 994 return a.pos - b.pos; 995 }), function(ndx, lmnt) { 996 "" !== lmnt.c && isValid(lmnt.pos, lmnt.c, void 0 === lmnt.strict || lmnt.strict, void 0 !== lmnt.fromIsValid ? lmnt.fromIsValid : fromIsValid); 997 }), commandObj.insert = void 0), commandObj.refreshFromBuffer && commandObj.buffer) { 998 var refresh = commandObj.refreshFromBuffer; 999 refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, commandObj.buffer), 1000 commandObj.refreshFromBuffer = void 0; 1001 } 1002 void 0 !== commandObj.rewritePosition && (maskPos = commandObj.rewritePosition, 1003 commandObj = !0); 1004 } 1005 return commandObj; 1006 } 1007 function _isValid(position, c, strict) { 1008 var rslt = !1; 1009 return $.each(getTests(position), function(ndx, tst) { 1010 var test = tst.match; 1011 if (getBuffer(!0), rslt = null != test.fn ? test.fn.test(c, maskset, position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && "" !== test.def && { 1012 c: getPlaceholder(position, test, !0) || test.def, 1013 pos: position 1014 }, !1 !== rslt) { 1015 var elem = void 0 !== rslt.c ? rslt.c : c, validatedPos = position; 1016 return elem = elem === opts.skipOptionalPartCharacter && !0 === test.static ? getPlaceholder(position, test, !0) || test.def : elem, 1017 rslt = processCommandObject(rslt), !0 !== rslt && void 0 !== rslt.pos && rslt.pos !== position && (validatedPos = rslt.pos), 1018 !0 !== rslt && void 0 === rslt.pos && void 0 === rslt.c ? !1 : (!1 === revalidateMask(pos, $.extend({}, tst, { 1019 input: casing(elem, test, validatedPos) 1020 }), fromIsValid, validatedPos) && (rslt = !1), !1); 1021 } 1022 }), rslt; 1023 } 1024 void 0 !== pos.begin && (maskPos = isRTL ? pos.end : pos.begin); 1025 var result = !0, positionsClone = $.extend(!0, {}, maskset.validPositions); 1026 if (!1 === opts.keepStatic && void 0 !== maskset.excludes[maskPos] && !0 !== fromAlternate && !0 !== fromIsValid) for (var i = maskPos; i < (isRTL ? pos.begin : pos.end); i++) void 0 !== maskset.excludes[i] && (maskset.excludes[i] = void 0, 1027 delete maskset.tests[i]); 1028 if ($.isFunction(opts.preValidation) && !0 !== fromIsValid && !0 !== validateOnly && (result = opts.preValidation.call(el, getBuffer(), maskPos, c, isSelection(pos), opts, maskset, pos, strict || fromAlternate), 1029 result = processCommandObject(result)), !0 === result) { 1030 if (void 0 === inputmask.maxLength || maskPos < inputmask.maxLength) { 1031 if (result = _isValid(maskPos, c, strict), (!strict || !0 === fromIsValid) && !1 === result && !0 !== validateOnly) { 1032 var currentPosValid = maskset.validPositions[maskPos]; 1033 if (!currentPosValid || !0 !== currentPosValid.match.static || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) { 1034 if (opts.insertMode || void 0 === maskset.validPositions[seekNext(maskPos)] || pos.end > maskPos) { 1035 var skip = !1; 1036 if (maskset.jitOffset[maskPos] && void 0 === maskset.validPositions[seekNext(maskPos)] && (result = isValid(maskPos + maskset.jitOffset[maskPos], c, !0), 1037 !1 !== result && (!0 !== fromAlternate && (result.caret = maskPos), skip = !0)), 1038 pos.end > maskPos && (maskset.validPositions[maskPos] = void 0), !skip && !isMask(maskPos, opts.keepStatic)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (result = _isValid(nPos, c, strict), 1039 !1 !== result) { 1040 result = trackbackPositions(maskPos, void 0 !== result.pos ? result.pos : nPos) || result, 1041 maskPos = nPos; 1042 break; 1043 } 1044 } 1045 } else result = { 1046 caret: seekNext(maskPos) 1047 }; 1048 } 1049 } else result = !1; 1050 !1 !== result || !opts.keepStatic || !isComplete(getBuffer()) && 0 !== maskPos || str
1050ict || !0 === fromAlternate ? isSelection(pos) && maskset.tests[maskPos] && 1 < maskset.tests[maskPos].length && opts.keepStatic && !strict && !0 !== fromAlternate && (result = alternate(!0)) : result = alternate(maskPos, c, strict, fromIsValid, void 0, pos), 1051 !0 === result && (result = { 1052 pos: maskPos 1053 }); 1054 } 1055 if ($.isFunction(opts.postValidation) && !0 !== fromIsValid && !0 !== validateOnly) { 1056 var postResult = opts.postValidation.call(el, getBuffer(!0), void 0 !== pos.begin ? isRTL ? pos.end : pos.begin : pos, c, result, opts, maskset, strict); 1057 void 0 !== postResult && (result = !0 === postResult ? result : postResult); 1058 } 1059 result && void 0 === result.pos && (result.pos = maskPos), !1 === result || !0 === validateOnly ? (resetMaskSet(!0), 1060 maskset.validPositions = $.extend(!0, {}, positionsClone)) : trackbackPositions(void 0, maskPos, !0); 1061 var endResult = processCommandObject(result); 1062 return endResult; 1063 } 1064 function trackbackPositions(originalPos, newPos, fillOnly) { 1065 if (void 0 === originalPos) for (originalPos = newPos - 1; 0 < originalPos && !maskset.validPositions[originalPos]; originalPos--) ; 1066 for (var ps = originalPos; ps < newPos; ps++) if (void 0 === maskset.validPositions[ps] && !isMask(ps, !0)) { 1067 var vp = 0 == ps ? getTest(ps) : maskset.validPositions[ps - 1]; 1068 if (vp) { 1069 var tests = getTests(ps).slice(); 1070 "" === tests[tests.length - 1].match.def && tests.pop(); 1071 var bestMatch = determineTestTemplate(ps, tests), np; 1072 if (bestMatch && (!0 !== bestMatch.match.jit || "master" === bestMatch.match.newBlockMarker && (np = maskset.validPositions[ps + 1]) && !0 === np.match.optionalQuantifier) && (bestMatch = $.extend({}, bestMatch, { 1073 input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def 1074 }), bestMatch.generatedInput = !0, revalidateMask(ps, bestMatch, !0), !0 !== fillOnly)) { 1075 var cvpInput = maskset.validPositions[newPos].input; 1076 return maskset.validPositions[newPos] = void 0, isValid(newPos, cvpInput, !0, !0); 1077 } 1078 } 1079 } 1080 } 1081 function revalidateMask(pos, validTest, fromIsValid, validatedPos) { 1082 function IsEnclosedStatic(pos, valids, selection) { 1083 var posMatch = valids[pos]; 1084 if (void 0 === posMatch || !0 !== posMatch.match.static || !0 === posMatch.match.optionality || void 0 !== valids[0] && void 0 !== valids[0].alternation) return !1; 1085 var prevMatch = selection.begin <= pos - 1 ? valids[pos - 1] && !0 === valids[pos - 1].match.static && valids[pos - 1] : valids[pos - 1], nextMatch = selection.end > pos + 1 ? valids[pos + 1] && !0 === valids[pos + 1].match.static && valids[pos + 1] : valids[pos + 1]; 1086 return prevMatch && nextMatch; 1087 } 1088 var offset = 0, begin = void 0 !== pos.begin ? pos.begin : pos, end = void 0 !== pos.end ? pos.end : pos; 1089 if (pos.begin > pos.end && (begin = pos.end, end = pos.begin), validatedPos = void 0 !== validatedPos ? validatedPos : begin, 1090 begin !== end || opts.insertMode && void 0 !== maskset.validPositions[validatedPos] && void 0 === fromIsValid || void 0 === validTest) { 1091 var positionsClone = $.extend(!0, {}, maskset.validPositions), lvp = getLastValidPosition(void 0, !0), i; 1092 for (maskset.p = begin, i = lvp; begin <= i; i--) delete maskset.validPositions[i], 1093 void 0 === validTest && delete maskset.tests[i + 1]; 1094 var valid = !0, j = validatedPos, posMatch = j, t, canMatch; 1095 for (validTest && (maskset.validPositions[validatedPos] = $.extend(!0, {}, validTest), 1096 posMatch++, j++), i = validTest ? end : end - 1; i <= lvp; i++) {
1097 if (void 0 !== (t = positionsClone[i]) && !0 !== t.generatedInput && (end <= i || begin <= i && IsEnclosedStatic(i, positionsClone, { 1098 begin: begin, 1099 end: end 1100 }))) { 1101 for (;"" !== getTest(posMatch).match.def; ) { 1102 if (!1 !== (canMatch = positionCanMatchDefinition(posMatch, t, opts)) || "+" === t.match.def) { 1103 "+" === t.match.def && getBuffer(!0); 1104 var result = isValid(posMatch, t.input, "+" !== t.match.def, "+" !== t.match.def); 1105 if (valid = !1 !== result, j = (result.pos || posMatch) + 1, !valid && canMatch) break; 1106 } else valid = !1; 1107 if (valid) { 1108 void 0 === validTest && t.match.static && i === pos.begin && offset++; 1109 break; 1110 } 1111 if (!valid && posMatch > maskset.maskLength) break; 1112 posMatch++; 1113 } 1114 "" == getTest(posMatch).match.def && (valid = !1), posMatch = j; 1115 } 1116 if (!valid) break; 1117 } 1118 if (!valid) return maskset.validPositions = $.extend(!0, {}, positionsClone), resetMaskSet(!0), 1119 !1; 1120 } else validTest && getTest(validatedPos).match.cd === validTest.match.cd && (maskset.validPositions[validatedPos] = $.extend(!0, {}, validTest)); 1121 return resetMaskSet(!0), offset; 1122 } 1123 function isMask(pos, strict, fuzzy) { 1124 var test = getTestTemplate(pos).match; 1125 if ("" === test.def && (test = getTest(pos).match), !0 !== test.static) return test.fn; 1126 if (!0 === fuzzy && void 0 !== maskset.validPositions[pos] && !0 !== maskset.validPositions[pos].generatedInput) return !0; 1127 if (!0 !== strict && -1 < pos) { 1128 if (fuzzy) { 1129 var tests = getTests(pos); 1130 return tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0); 1131 } 1132 var testTemplate = determineTestTemplate(pos, getTests(pos)), testPlaceHolder = getPlaceholder(pos, testTemplate.match); 1133 return testTemplate.match.def !== testPlaceHolder; 1134 } 1135 return !1; 1136 } 1137 function seekNext(pos, newBlock, fuzzy) { 1138 void 0 === fuzzy && (fuzzy = !0); 1139 for (var position = pos + 1; "" !== getTest(position).match.def && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position, void 0, !0)) || !0 !== newBlock && !isMask(position, void 0, fuzzy)); ) position++; 1140 return position; 1141 } 1142 function seekPrevious(pos, newBlock) { 1143 var position = pos, tests; 1144 if (position <= 0) return 0; 1145 for (;0 < --position && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position, void 0, !0) && (tests = getTests(position), 1146 tests.length < 2 || 2 === tests.length && "" === tests[1].match.def)); ) ; 1147 return position; 1148 } 1149 function writeBuffer(input, buffer, caretPos, event, triggerEvents) { 1150 if (event && $.isFunction(opts.onBeforeWrite)) { 1151 var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts); 1152 if (result) { 1153 if (result.refreshFromBuffer) { 1154 var refresh = result.refreshFromBuffer; 1155 refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer), 1156 buffer = getBuffer(!0); 1157 } 1158 void 0 !== caretPos && (caretPos = void 0 !== result.caret ? result.caret : caretPos); 1159 } 1160 } 1161 if (void 0 !== input && (input.inputmask._valueSet(buffer.join("")), void 0 === caretPos || void 0 !== event && "blur" === event.type || caret(input, caretPos, void 0, void 0, void 0 !== event && "ke
1161ydown" === event.type && (event.keyCode === keyCode.DELETE || event.keyCode === keyCode.BACKSPACE)), 1162 !0 === triggerEvents)) { 1163 var $input = $(input), nptVal = input.inputmask._valueGet(); 1164 input.inputmask.skipInputEvent = !0, $input.trigger("input"), setTimeout(function() { 1165 nptVal === getBufferTemplate().join("") ? $input.trigger("cleared") : !0 === isComplete(buffer) && $input.trigger("complete"); 1166 }, 0); 1167 } 1168 } 1169 function getPlaceholder(pos, test, returnPL) { 1170 if (test = test || getTest(pos).match, void 0 !== test.placeholder || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder; 1171 if (!0 !== test.static) return opts.placeholder.charAt(pos % opts.placeholder.length); 1172 if (-1 < pos && void 0 === maskset.validPositions[pos]) { 1173 var tests = getTests(pos), staticAlternations = [], prevTest; 1174 if (tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if ("" !== tests[i].match.def && !0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (!0 === tests[i].match.static || void 0 === prevTest || !1 !== tests[i].match.fn.test(prevTest.match.def, maskset, pos, !0, opts)) && (staticAlternations.push(tests[i]), 1175 !0 === tests[i].match.static && (prevTest = tests[i]), 1 < staticAlternations.length && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length); 1176 } 1177 return test.def; 1178 } 1179 function HandleNativePlaceholder(npt, value) { 1180 if (ie) { 1181 if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || "" === npt.placeholder)) { 1182 var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet(); 1183 if (nptValue !== value) { 1184 var lvp = getLastValidPosition(); 1185 -1 === lvp && nptValue === getBufferTemplate().join("") ? buffer = [] : -1 !== lvp && clearOptionalTail(buffer), 1186 writeBuffer(npt, buffer); 1187 } 1188 } 1189 } else npt.placeholder !== value && (npt.placeholder = value, "" === npt.placeholder && npt.removeAttribute("placeholder")); 1190 } 1191 function determineNewCaretPosition(selectedCaret, tabbed) { 1192 function doRadixFocus(clickPos) { 1193 if ("" !== opts.radixPoint && 0 !== opts.digits) { 1194 var vps = maskset.validPositions; 1195 if (void 0 === vps[clickPos] || vps[clickPos].input === getPlaceholder(clickPos)) { 1196 if (clickPos < seekNext(-1)) return !0; 1197 var radixPos = $.inArray(opts.radixPoint, getBuffer()); 1198 if (-1 !== radixPos) { 1199 for (var vp in vps) if (vps[vp] && radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1; 1200 return !0; 1201 } 1202 } 1203 } 1204 return !1; 1205 } 1206 if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end), 1207 selectedCaret.begin === selectedCaret.end) { 1208 switch (opts.positionCaretOnClick) { 1209 case "none": 1210 break; 1211 1212 case "select": 1213 selectedCaret = { 1214 begin: 0, 1215 end: getBuffer().length 1216 }; 1217 break; 1218 1219 case "ignore": 1220 selectedCaret.end = selectedCaret.begin = seekNext(getLastValidPosition()); 1221 break; 1222 1223 case "radixFocus": 1224 if (doRadixFocus(selectedCaret.begin)) { 1225 var radixPos = getBuffer().join("").indexOf(opts.radixPoint); 1226 selectedCaret.end = selectedCaret.begin = opts.numericInput ? seekNext(radixPos) : radixPos; 1227 break; 1228 } 1229 1230 default: 1231 var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(-1 !== lvclickPosition || isMask(0) ? lvclickPosition : 0); 1232 if (clickPosition < lastPosition) selectedCaret.end = selectedCaret.begin = isMask(clickPosition, !0) || isMask(clickPosition - 1, !0) ? clickPosition : seekNext(clickPosition); else { 1233 var lvp = maskset.validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : void 0, lvp), placeholder = getPlaceholder(lastPosition, tt.match); 1234 if ("" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== tt.match.optionalQuantifier && !0 !== tt.match.newBlockMarker || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) { 1235 var newPos = seekNext(lastPosition); 1236 (newPos <= clickPosition || clickPosition === lastPosition) && (lastPosition = newPos); 1237 } 1238 selectedCaret.end = selectedCaret.begin = lastPosition; 1239 } 1240 } 1241 return selectedCaret; 1242 } 1243 } 1244 var EventRuler = { 1245 on: function on(input, eventName, eventHandler) { 1246 var ev = function ev(e) { 1247 e.originalEvent && (e = e.originalEvent || e, arguments[0] = e); 1248 var that = this, args, inputmask = that.inputmask; 1249 if (void 0 === inputmask && "FORM" !== this.nodeName) { 1250 var imOpts = $.data(that, "_inputmask_opts"); 1251 imOpts ? new Inputmask(imOpts).mask(that) : EventRuler.off(that); 1252 } else { 1253 if ("setvalue" === e.type || "FORM" === this.nodeName || !(that.disabled || that.readOnly && !("keydown" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === keyCode.TAB))) { 1254 switch (e.type) { 1255 case "input": 1256 if (!0 === inputmask.skipInputEvent || e.inputType && "insertCompositionText" === e.inputType) return inputmask.skipInputEvent = !1, 1257 e.preventDefault(); 1258 break; 1259 1260 case "keydown": 1261 inputmask.skipKeyPressEvent = !1, inputmask.skipInputEvent = !1; 1262 break; 1263 1264 case "keypress": 1265 if (!0 === inputmask.skipKeyPressEvent) return e.preventDefault(); 1266 inputmask.skipKeyPressEvent = !0; 1267 break; 1268 1269 case "click": 1270 case "focus": 1271 return inputmask.validationEvent ? (inputmask.validationEvent = !1, input.blur(), 1272 HandleNativePlaceholder(input, (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).join("")), 1273 setTimeout(function() { 1274 input.focus(); 1275 }, 3e3)) : (args = arguments, setTimeout(function() { 1276 input.inputmask && eventHandler.apply(that, args); 1277 }, 0)), !1; 1278 } 1279 var returnVal = eventHandler.apply(that, arguments); 1280 return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal; 1281 } 1282 e.preventDefault(); 1283 } 1284 }; 1285 input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev), 1286 -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null !== input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev); 1287 }, 1288 off: function off(input, event) { 1289 var events; 1290 input.inputmask && input.inputmask.events && (event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events, 1291 $.each(events, function(eventName, evArr) { 1292 for (;0 < evArr.length; ) { 1293 var ev = evArr.pop(); 1294 -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null !== input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev); 1295 } 1296 delete input.inputmask.events[eventName]; 1297 })); 1298 } 1299 }, EventHandlers = { 1300 keydownEvent: function keydownEvent(e) { 1301 var input = this, $input = $(input), k = e.keyCode, pos = caret(input), kdResult = opts.onKeyDown.call(this, e, getBuffer(), pos, opts); 1302 if (void 0 !== kdResult) return kdResult; 1303 if (k === keyCode.BACKSPACE || k === keyCode.DELETE || iphone && k === keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === keyCode.X && !("oncut" in input)) e.preventDefault(), 1304 handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), maskset.p, e, input.inputmask._valueGet() !== getBuffer().join("")); else if (k === keyCode.END || k === keyCode.PAGE_DOWN) { 1305 e.preventDefault(); 1306 var caretPos = seekNext(getLastValidPosition()); 1307 caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0); 1308 } else k === keyCode.HOME && !e.shiftKey || k === keyCode.PAGE_UP ? (e.preventDefault(), 1309 caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, inputmask.undoValue.split("")), 1310 $input.trigger("click")) : !0 === opts.tabThrough && k === keyCode.TAB ? (!0 === e.shiftKey ? (!0 === getTest(pos.begin).match.static && (pos.begin = seekNext(pos.begin)), 1311 pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0), 1312 pos.end = seekNext(pos.begin, !0), pos.end < maskset.maskLength && pos.end--), pos.begin < maskset.maskLength && (e.preventDefault(), 1313 caret(input, pos.begin, pos.end))) : e.shiftKey || opts.insertModeVisual && !1 === opts.insertMode && (k === keyCode.RIGHT ? setTimeout(function() { 1314 var caretPos = caret(input); 1315 caret(input, caretPos.begin); 1316 }, 0) : k === keyCode.LEFT && setTimeout(function() { 1317 var caretPos_begin = translatePosition(input.inputmask.caretPos.begin), caretPos_end = translatePosition(input.inputmask.caretPos.end); 1318 caret(input, isRTL ? caretPos_begin + (caretPos_begin === maskset.maskLength ? 0 : 1) : caretPos_begin - (0 === caretPos_begin ? 0 : 1)); 1319 }, 0)); 1320 inputmask.ignorable = -1 !== $.inArray(k, opts.ignorables); 1321 }, 1322 keypressEvent: function keypressEvent(e, checkval, writeOut, strict, ndx) { 1323 var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode; 1324 if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || inputmask.ignorable)) return k === keyCode.ENTER && inputmask.undoValue !== getBuffer().join("") && (inputmask.undoValue = getBuffer().join(""), 1325 setTimeout(function() { 1326 $input.trigger("change"); 1327 }, 0)), inputmask.skipInputEvent = !0, !0; 1328 if (k) { 1329 44 !== k && 46 !== k || 3 !== e.location || "" === opts.radixPoint || (k = opts.radixPoint.charCodeAt(0)); 1330 var pos = checkval ? { 1331 begin: ndx, 1332 end: ndx 1333 } : caret(input), forwardPosition, c = String.fromCharCode(k); 1334 maskset.writeOutBuffer = !0; 1335 var valResult = isValid(pos, c, strict); 1336 if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = void 0 !== valResult.caret ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos), 1337 maskset.p = forwardPosition), forwardPosition = opts.numericInput && void 0 === valResult.caret ? seekPrevious(forwardPosition) : forwardPosition, 1338 !1 !== writeOut && (setTimeout(function() { 1339 opts.onKeyValidation.call(input, k, valResult); 1340 }, 0), maskset.writeOutBuffer && !1 !== valResult)) { 1341 var buffer = getBuffer(); 1342 writeBuffer(input, buffer, forwardPosition, e, !0 !== checkval); 1343 } 1344 if (e.preventDefault(), checkval) return !1 !== valResult && (valResult.forwardPosition = forwardPosition), 1345 valResult; 1346 } 1347 }, 1348 pasteEvent: function pasteEvent(e) { 1349 var input = this, inputValue = this.inputmask._valueGet(!0), caretPos = caret(this), tempValue; 1350 isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue); 1351 var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length); 1352 if (valueBeforeCaret == (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), 1353 valueAfterCaret == (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).slice(caretPos.end).join("") && (valueAfterCaret = ""), 1354 window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret; else { 1355 if (!e.clipboardData || !e.clipboardData.getData) return !0; 1356 inputValue = valueBeforeCaret + e.clipboardData.getData("text/plain") + valueAfterCaret; 1357 } 1358 var pasteValue = inputValue; 1359 if ($.isFunction(opts.onBeforePaste)) { 1360 if (pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts), !1 === pasteValue) return e.preventDefault(); 1361 pasteValue = pasteValue || inputValue; 1362 } 1363 return checkVal(this, !0, !1, pasteValue.toString().split(""), e), e.preventDefault(); 1364 }, 1365 inputFallBackEvent: function inputFallBackEvent(e) { 1366 function ieMobileHandler(input, inputValue, caretPos) { 1367 if (iemobile) { 1368 var inputChar = inputValue.replace(getBuffer().join(""), ""); 1369 if (1 === inputChar.length) { 1370 var iv = inputValue.split(""); 1371 iv.splice(caretPos.begin, 0, inputChar), inputValue = iv.join(""); 1372 } 1373 } 1374
1374 return inputValue; 1375 } 1376 function analyseChanges(inputValue, buffer, caretPos) { 1377 for (var frontPart = inputValue.substr(0, caretPos.begin).split(""), backPart = inputValue.substr(caretPos.begin).split(""), frontBufferPart = buffer.substr(0, caretPos.begin).split(""), backBufferPart = buffer.substr(caretPos.begin).split(""), fpl = frontPart.length >= frontBufferPart.length ? frontPart.length : frontBufferPart.length, bpl = backPart.length >= backBufferPart.length ? backPart.length : backBufferPart.length, bl, i, action = "", data = [], marker = "~", placeholder; frontPart.length < fpl; ) frontPart.push("~"); 1378 for (;frontBufferPart.length < fpl; ) frontBufferPart.push("~"); 1379 for (;backPart.length < bpl; ) backPart.unshift("~"); 1380 for (;backBufferPart.length < bpl; ) backBufferPart.unshift("~"); 1381 var newBuffer = frontPart.concat(backPart), oldBuffer = frontBufferPart.concat(backBufferPart); 1382 for (i = 0, bl = newBuffer.length; i < bl; i++) switch (placeholder = getPlaceholder(translatePosition(i)), 1383 action) { 1384 case "insertText": 1385 oldBuffer[i - 1] === newBuffer[i] && caretPos.begin == newBuffer.length - 1 && data.push(newBuffer[i]), 1386 i = bl; 1387 break; 1388 1389 case "insertReplacementText": 1390 "~" === newBuffer[i] ? caretPos.end++ : i = bl; 1391 break; 1392 1393 case "deleteContentBackward": 1394 "~" === newBuffer[i] ? caretPos.end++ : i = bl; 1395 break; 1396 1397 default: 1398 newBuffer[i] !== oldBuffer[i] && ("~" !== newBuffer[i + 1] && newBuffer[i + 1] !== placeholder && void 0 !== newBuffer[i + 1] || (oldBuffer[i] !== placeholder || "~" !== oldBuffer[i + 1]) && "~" !== oldBuffer[i] ? "~" === oldBuffer[i + 1] && oldBuffer[i] === newBuffer[i + 1] ? (action = "insertText", 1399 data.push(newBuffer[i]), caretPos.begin--, caretPos.end--) : newBuffer[i] !== placeholder && "~" !== newBuffer[i] && ("~" === newBuffer[i + 1] || oldBuffer[i] !== newBuffer[i] && oldBuffer[i + 1] === newBuffer[i + 1]) ? (action = "insertReplacementText", 1400 data.push(newBuffer[i]), caretPos.begin--) : "~" === newBuffer[i] ? (action = "deleteContentBackward", 1401 !isMask(translatePosition(i), !0) && oldBuffer[i] !== opts.radixPoint || caretPos.end++) : i = bl : (action = "insertText", 1402 data.push(newBuffer[i]), caretPos.begin--, caretPos.end--)); 1403 break; 1404 } 1405 return { 1406 action: action, 1407 data: data, 1408 caret: caretPos 1409 }; 1410 } 1411 var input = this, inputValue = input.inputmask._valueGet(!0), buffer = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""), caretPos = caret(input, void 0, void 0, !0); 1412 if (buffer !== inputValue) { 1413 inputValue = ieMobileHandler(input, inputValue, caretPos); 1414 var changes = analyseChanges(inputValue, buffer, caretPos); 1415 switch ((input.inputmask.shadowRoot || document).activeElement !== input && input.focus(), 1416 writeBuffer(input, getBuffer()), caret(input, caretPos.begin, caretPos.end, !0), 1417 changes.action) { 1418 case "insertText": 1419 case "insertReplacementText": 1420 $.each(changes.data, function(ndx, entry) { 1421 var keypress = new $.Event("keypress");
1422 keypress.which = entry.charCodeAt(0), inputmask.ignorable = !1, EventHandlers.keypressEvent.call(input, keypress); 1423 }), setTimeout(function() { 1424 inputmask.$el.trigger("keyup"); 1425 }, 0); 1426 break; 1427 1428 case "deleteContentBackward": 1429 var keydown = new $.Event("keydown"); 1430 keydown.keyCode = keyCode.BACKSPACE, EventHandlers.keydownEvent.call(input, keydown); 1431 break; 1432 1433 default: 1434 applyInputValue(input, inputValue); 1435 break; 1436 } 1437 e.preventDefault(); 1438 } 1439 }, 1440 compositionendEvent: function compositionendEvent(e) { 1441 inputmask.$el.trigger("input"); 1442 }, 1443 setValueEvent: function setValueEvent(e, argument_1, argument_2) { 1444 var input = this, value = e && e.detail ? e.detail[0] : argument_1; 1445 void 0 === value && (value = this.inputmask._valueGet(!0)), applyInputValue(this, value), 1446 (e.detail && void 0 !== e.detail[1] || void 0 !== argument_2) && caret(this, e.detail ? e.detail[1] : argument_2); 1447 }, 1448 focusEvent: function focusEvent(e) { 1449 var input = this, nptValue = this.inputmask._valueGet(); 1450 opts.showMaskOnFocus && nptValue !== getBuffer().join("") && writeBuffer(this, getBuffer(), seekNext(getLastValidPosition())), 1451 !0 !== opts.positionCaretOnTab || !1 !== inputmask.mouseEnter || isComplete(getBuffer()) && -1 !== getLastValidPosition() || EventHandlers.clickEvent.apply(this, [ e, !0 ]), 1452 inputmask.undoValue = getBuffer().join(""); 1453 },
1454 invalidEvent: function invalidEvent(e) { 1455 inputmask.validationEvent = !0; 1456 }, 1457 mouseleaveEvent: function mouseleaveEvent() { 1458 var input = this; 1459 inputmask.mouseEnter = !1, opts.clearMaskOnLostFocus && (this.inputmask.shadowRoot || document).activeElement !== this && HandleNativePlaceholder(this, inputmask.originalPlaceholder); 1460 }, 1461 clickEvent: function clickEvent(e, tabbed) { 1462 var input = this; 1463 if ((this.inputmask.shadowRoot || document).activeElement === this) { 1464 var newCaretPosition = determineNewCaretPosition(caret(this), tabbed); 1465 void 0 !== newCaretPosition && caret(this, newCaretPosition); 1466 } 1467 }, 1468 cutEvent: function cutEvent(e) { 1469 var input = this, pos = caret(this), clipboardData = window.clipboardData || e.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end); 1470 clipboardData.setData("text", isRTL ? clipData.reverse().join("") : clipData.join("")), 1471 document.execCommand && document.execCommand("copy"), handleRemove(this, keyCode.DELETE, pos), 1472 writeBuffer(this, getBuffer(), maskset.p, e, inputmask.undoValue !== getBuffer().join("")); 1473 }, 1474 blurEvent: function blurEvent(e) { 1475 var $input = $(this), input = this; 1476 if (this.inputmask) { 1477 HandleNativePlaceholder(this, inputmask.originalPlaceholder); 1478 var nptValue = this.inputmask._valueGet(), buffer = getBuffer().slice(); 1479 "" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), 1480 !1 === isComplete(buffer) && (setTimeout(function() { 1481 $input.trigger("incomplete"); 1482 }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())), 1483 writeBuffer(this, buffer, void 0, e)), inputmask.undoValue !== getBuffer().join("") && (inputmask.undoValue = getBuffer().join(""), 1484 $input.trigger("change")); 1485 } 1486 }, 1487 mouseenterEvent: function mouseenterEvent() { 1488 var input = this; 1489 inputmask.mouseEnter = !0, (this.inputmask.shadowRoot || document).activeElement !== this && (null == inputmask.originalPlaceholder && this.placeholder !== inputmask.originalPlaceholder && (inputmask.originalPlaceholder = this.placeholder), 1490 opts.showMaskOnHover && HandleNativePlaceholder(this, (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).join(""))); 1491 }, 1492 submitEvent: function submitEvent() { 1493 inputmask.undoValue !== getBuffer().join("") && inputmask.$el.trigger("change"), 1494 opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("") && el.inputmask._valueSet(""), 1495 opts.clearIncomplete && !1 === isComplete(getBuffer()) && el.inputmask._valueSet(""), 1496 opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0), 1497 setTimeout(function() { 1498 writeBuffer(el, getBuffer()); 1499 }, 0)); 1500 }, 1501 resetEvent: function resetEvent() { 1502 el.inputmask.refreshValue = !0, setTimeout(function() { 1503 applyInputValue(el, el.inputmask._valueGet(!0)); 1504 }, 0); 1505 } 1506 }, valueBuffer; 1507 function checkVal(input, writeOut, strict, nptvl, initiatingEvent) { 1508 var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCo
1508des = "", initialNdx = -1, result = void 0; 1509 function isTemplateMatch(ndx, charCodes) { 1510 for (var targetTemplate = getMaskTemplate(!0, 0).slice(ndx, seekNext(ndx)).join("").replace(/'/g, ""), charCodeNdx = targetTemplate.indexOf(charCodes); 0 < charCodeNdx && " " === targetTemplate[charCodeNdx - 1]; ) charCodeNdx--; 1511 var match = 0 === charCodeNdx && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || !0 === getTest(ndx).match.static && getTest(ndx).match.nativeDef === "'" + charCodes.charAt(0) || " " === getTest(ndx).match.nativeDef && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || !0 === getTest(ndx + 1).match.static && getTest(ndx + 1).match.nativeDef === "'" + charCodes.charAt(0))); 1512 if (!match && 0 < charCodeNdx && !isMask(ndx, !1, !0)) { 1513 var nextPos = seekNext(ndx); 1514 inputmask.caretPos.begin < nextPos && (inputmask.caretPos = { 1515 begin: nextPos 1516 }); 1517 } 1518 return match; 1519 } 1520 resetMaskSet(), maskset.tests = {}, initialNdx = opts.radixPoint ? determineNewCaretPosition({ 1521 begin: 0, 1522 end: 0 1523 }).begin : 0, maskset.p = initialNdx, inputmask.caretPos = { 1524 begin: initialNdx 1525 }; 1526 var staticMatches = [], prevCaretPos = inputmask.caretPos; 1527 if ($.each(inputValue, function(ndx, charCode) { 1528 if (void 0 !== charCode) if (void 0 === maskset.validPositions[ndx] && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, !0) && !1 === isValid(ndx, inputValue[ndx], !0, void 0, void 0, !0)) maskset.p++; else { 1529 var keypress = new $.Event("_checkval"); 1530 keypress.which = charCode.toString().charCodeAt(0), charCodes += charCode; 1531 var lvp = getLastValidPosition(void 0, !0); 1532 isTemplateMatch(initialNdx, charCodes) ? result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, lvp + 1) : (result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, inputmask.caretPos.begin), 1533 result && (initialNdx = inputmask.caretPos.begin + 1, charCodes = "")), result ? (void 0 !== result.pos && maskset.validPositions[result.pos] && !0 === maskset.validPositions[result.pos].match.static && void 0 === maskset.validPositions[result.pos].alternation && (staticMatches.push(result.pos), 1534 isRTL || (result.forwardPosition = result.pos + 1)), writeBuffer(void 0, getBuffer(), result.forwardPosition, keypress, !1), 1535 inputmask.caretPos = { 1536 begin: result.forwardPosition, 1537 end: result.forwardPosition 1538 }, prevCaretPos = inputmask.caretPos) : inputmask.caretPos = prevCaretPos; 1539 } 1540 }), 0 < staticMatches.length) { 1541 var sndx, validPos, nextValid = seekNext(-1, void 0, !1); 1542 if (!isComplete(getBuffer()) && staticMatches.length <= nextValid || isComplete(getBuffer()) && 0 < staticMatches.length && staticMatches.length !== nextValid && 0 === staticMatches[0]) for (var nextSndx = nextValid; void 0 !== (sndx = staticMatches.shift()); ) { 1543 var keypress = new $.Event("_checkval"); 1544 if (validPos = maskset.validPositions[sndx], validPos.generatedInput = !0, keypress.which = validPos.input.charCodeAt(0), 1545 result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, nextSndx), 1546 result && void 0 !== result.pos && result.pos !== sndx && maskset.validPositions[result.pos] && !0 === maskset.validPositions[result.pos].match.static) staticMatches.push(result.pos); else if (!result) break; 1547 nextSndx++; 1548 } else for (;sndx = staticMatches.pop(); ) validPos = maskset.validPositions[sndx], 1549 validPos && (validPos.generatedInput = !0); 1550 } 1551 if (writeOut) for (var vndx in writeBuffer(input, getBuffer(), result ? result.forwardPosition : void 0, initiatingEvent || new $.Event("checkval"), initiatingEvent && "input" === initiatingEvent.type && inputmask.undoValue !== getBuffer().join("")), 1552 maskset.validPositions) !0 !== maskset.validPositions[vndx].match.generated && delete maskset.validPositions[vndx].generatedInput; 1553 } 1554 function unmaskedvalue(input) { 1555 if (input) { 1556 if (void 0 === input.inputmask) return input.value; 1557 input.inputmask && input.inputmask.refreshValue && applyInputValue(input, input.inputmask._valueGet(!0)); 1558 } 1559 var umValue = [], vps = maskset.validPositions; 1560 for (var pndx in vps) vps[pndx] && vps[pndx].match && (1 != vps[pndx].match.static || !0 !== vps[pndx].generatedInput) && umValue.push(vps[pndx].input); 1561 var unmaskedValue = 0 === umValue.length ? "" : (isRTL ? umValue.reverse() : umValue).join(""); 1562 if ($.isFunction(opts.onUnMask)) { 1563 var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""); 1564 unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts); 1565 } 1566 return unmaskedValue; 1567 } 1568 function translatePosition(pos) { 1569 return !isRTL || "number" != typeof pos || opts.greedy && "" === opts.placeholder || !el || (pos = el.inputmask._valueGet().length - pos), 1570 pos; 1571 } 1572 function caret(input, begin, end, notranslate, isDelete) { 1573 var range; 1574 if (void 0 === begin) return "selectionStart" in input && "selectionEnd" in input ? (begin = input.selectionStart, 1575 end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0), 1576 range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset, 1577 end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(), 1578 begin = 0 - range.duplicate().moveStart("character", -input.inputmask._valueGet().length), 1579 end = begin + range.text.length), { 1580 begin: notranslate ? begin : translatePosition(begin), 1581 end: notranslate ? end : translatePosition(en
1581d) 1582 }; 1583 if ($.isArray(begin) && (end = isRTL ? begin[0] : begin[1], begin = isRTL ? begin[1] : begin[0]), 1584 void 0 !== begin.begin && (end = isRTL ? begin.begin : begin.end, begin = isRTL ? begin.end : begin.begin), 1585 "number" == typeof begin) { 1586 begin = notranslate ? begin : translatePosition(begin), end = notranslate ? end : translatePosition(end), 1587 end = "number" == typeof end ? end : begin; 1588 var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end; 1589 if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, input.inputmask.caretPos = { 1590 begin: begin, 1591 end: end 1592 }, opts.insertModeVisual && !1 === opts.insertMode && begin === end && (isDelete || end++), 1593 input === (input.inputmask.shadowRoot || document).activeElement) if ("setSelectionRange" in input) input.setSelectionRange(begin, end); else if (window.getSelection) { 1594 if (range = document.createRange(), void 0 === input.firstChild || null === input.firstChild) { 1595 var textNode = document.createTextNode(""); 1596 input.appendChild(textNode); 1597 } 1598 range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length), 1599 range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length), 1600 range.collapse(!0); 1601 var sel = window.getSelection(); 1602 sel.removeAllRanges(), sel.addRange(range); 1603 } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0), 1604 range.moveEnd("character", end), range.moveStart("character", begin), range.select()); 1605 } 1606 } 1607 function determineLastRequiredPosition(returnDefinition) { 1608 var buffer = getMaskTemplate(!0, getLastValidPosition(), !0, !0), bl = buffer.length, pos, lvp = getLastValidPosition(), positions = {}, lvTest = maskset.validPositions[lvp], ndxIntlzr = void 0 !== lvTest ? lvTest.locator.slice() : void 0, testPos; 1609 for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), 1610 ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos); 1611 var lvTestAlt = lvTest && void 0 !== lvTest.alternation ? lvTest.locator[lvTest.alternation] : void 0; 1612 for (pos = bl - 1; lvp < pos && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && 1 != testPos.match.static || !0 === testPos.match.static && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && "" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--; 1613 return returnDefinition ? { 1614 l: bl, 1615 def: positions[bl] ? positions[bl].match : void 0 1616 } : bl; 1617 } 1618 function clearOptionalTail(buffer) { 1619 buffer.length = 0; 1620 for (var template = getMaskTemplate(!0, 0, !0, void 0, !0), lmnt; void 0 !== (lmnt = template.shift()); ) buffer.push(lmnt); 1621 return buffer; 1622 } 1623 function isComplete(buffer) { 1624 if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts); 1625 if ("*" !== opts.repeat) { 1626 var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l); 1627 if (void 0 === lrp.def || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) { 1628 complete = !0; 1629 for (var i = 0; i <= aml; i++) { 1630 var test = getTestTemplate(i).match; 1631 if (!0 !== test.static && void 0 === maskset.validPositions[i] && !0 !== test.optionality && !0 !== test.optionalQuantifier || !0 === test.static && buffer[i] !== getPlaceholder(i, test)) { 1632 complete = !1; 1633 break; 1634 } 1635 } 1636 } 1637 return complete; 1638 } 1639 } 1640 function handleRemove(input, k, pos, strict, fromIsValid) { 1641 if ((opts.numericInput || isRTL) && (k === keyCode.BACKSPACE ? k = keyCode.DELETE : k === keyCode.DELETE && (k = keyCode.BACKSPACE), 1642 isRTL)) { 1643 var pend = pos.end; 1644 pos.end = pos.begin, pos.begin = pend; 1645 } 1646 var lvp = getLastValidPosition(void 0, !0), offset; 1647 if (pos.end >= getBuffer().length && lvp >= pos.end && (pos.end = lvp + 1), k === keyCode.BACKSPACE ? pos.end - pos.begin < 1 && (pos.begin = seekPrevious(pos.begin)) : k === keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0, !0) ? pos.end + 1 : seekNext(pos.end) + 1), 1648 !1 !== (offset = revalidateMask(pos))) { 1649 if (!0 !== strict && !1 !== opts.keepStatic || null !== opts.regex && -1 !== getTest(pos.begin).match.def.indexOf("|")) { 1650 var result = alternate(!0); 1651 if (result) { 1652 var newPos = void 0 !== result.caret ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, !0); 1653 (k !== keyCode.DELETE || pos.begin > newPos) && pos.begin; 1654 } 1655 } 1656 !0 !== strict && (maskset.p = k === keyCode.DELETE ? pos.begin + offset : pos.begin); 1657 } 1658 } 1659 function applyInputValue(input, value) { 1660 input.inputmask.refreshValue = !1, $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask.call(inputmask, value, opts) || value), 1661 value = value.toString().split(""), checkVal(input, !0, !1, value), inputmask.undoValue = getBuffer().join(""), 1662 (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("") && -1 === getLastValidPosition() && input.inputmask._valueSet(""); 1663 } 1664 function mask() { 1665 function isElementTypeSupported(input, opts) { 1666 function patchValueProperty(npt) { 1667 var valueGet, valueSet; 1668 function patchValhook(type) { 1669 if ($.valHooks && (void 0 === $.valHooks[type] || !0 !== $.valHooks[type].inputmaskpatch)) { 1670 var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) { 1671 return elem.value; 1672 }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) { 1673 return elem.value = value, elem; 1674 }; 1675 $.valHooks[type] = { 1676 get: function get(elem) { 1677 if (elem.inputmask) { 1678 if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue(); 1679 var result = valhookGet(elem); 1680 return -1 !== getLastValidPosition(void 0, void 0, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : ""; 1681 } 1682 return valhookGet(elem); 1683 }, 1684 set: function set(elem, value) { 1685 var result = valhookSet(elem, value); 1686 return elem.inputmask && applyInputValue(elem, value), result; 1687 }, 1688 inputmaskpatch: !0 1689 }; 1690 } 1691 } 1692 function getter() { 1693 return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? (this.inputmask.shadowRoot || document.activeElement) === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join("") : valueGet.call(this) : "" : valueGet.call(this); 1694 } 1695 function setter(value) { 1696 valueSet.call(this, value), this.inputmask && applyInputValue(this, value); 1697 } 1698 function installNativeValueSetFallback(npt) { 1699 EventRuler.on(npt, "mouseenter", function() { 1700 var input = this, value = this.inputmask._valueGet(!0); 1701 value !== (isRTL ? getBuffer().reverse() : getBuffer()).join("") && applyInputValue(this, value); 1702 }); 1703 } 1704 if (!npt.inputmask.__valueGet) { 1705 if (!0 !== opts.noValuePatching) { 1706 if (Object.getOwnPropertyDescriptor) { 1707 var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), "value") : void 0; 1708 valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get, 1709 valueSet = valueProperty.set, Object.defineProperty(npt, "value", { 1710 get: getter, 1711 set: setter, 1712 configurable: !0 1713 })) : "input" !== npt.tagName.toLowerCase() && (valueGet = function valueGet() { 1714 return this.textContent; 1715 }, valueSet = function valueSet(value) { 1716 this.textContent = value; 1717 }, Object.defineProperty(npt, "value", { 1718 get: getter, 1719 set: setter, 1720 configurable: !0 1721 })); 1722 } else document.__lookupGetter__ && npt.__lookupGetter__("value") && (valueGet = npt.__lookupGetter__("value"), 1723 valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 1724 npt.__defineSetter__("value", setter)); 1725 npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet; 1726 } 1727 npt.inputmask._valueGet = function(overruleRTL) { 1728 return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el); 1729 }, npt.inputmask._valueSet = function(value, overruleRTL) { 1730 valueSet.call(this.el, null == value ? "" : !0 !== overruleRTL && isRTL ? value.split("").reverse().join("") : value); 1731 }, void 0 === valueGet && (valueGet = function valueGet() { 1732 return this.value; 1733 }, valueSet = function valueSet(value) { 1734 this.value = value; 1735 }, patchValhook(npt.type), installNativeValueSetFallback(npt)); 1736 } 1737 } 1738 "textarea" !== input.tagName.toLowerCase() && opts.ignorables.push(keyCode.ENTER); 1739 var elementType = input.getAttribute("type"), isSupported = "input" === input.tagName.toLowerCase() && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || "textarea" === input.tagName.toLowerCase(); 1740 if (!isSupported) if ("input" === input.tagName.toLowerCase()) { 1741 var el = document.createElement("input"); 1742 el.setAttribute("type", elementType), isSupported = "text" === el.type, el = null; 1743 } else isSupported = "partial"; 1744 return !1 !== isSupported ? patchValueProperty(input) : input.inputmask = void 0, 1745 isSupported; 1746 } 1747 EventRuler.off(el); 1748 var isSupported = isElementTypeSupported(el, opts); 1749 if (!1 !== isSupported) { 1750 inputmask.originalPlaceholder = el.placeholder, inputmask.maxLength = void 0 !== el ? el.maxLength : void 0, 1751 -1 === inputmask.maxLength && (inputmask.maxLength = void 0), "inputMode" in el && null === el.getAttribute("inputmode") && (el.inputMode = opts.inputmode, 1752 el.setAttribute("inputmode", opts.inputmode)), !0 === isSupported && (
1752opts.showMaskOnFocus = opts.showMaskOnFocus && -1 === [ "cc-number", "cc-exp" ].indexOf(el.autocomplete), 1753 iphone && (opts.insertModeVisual = !1), EventRuler.on(el, "submit", EventHandlers.submitEvent), 1754 EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "blur", EventHandlers.blurEvent), 1755 EventRuler.on(el, "focus", EventHandlers.focusEvent), EventRuler.on(el, "invalid", EventHandlers.invalidEvent), 1756 EventRuler.on(el, "click", EventHandlers.clickEvent), EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent), 1757 EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent), EventRuler.on(el, "paste", EventHandlers.pasteEvent), 1758 EventRuler.on(el, "cut", EventHandlers.cutEvent), EventRuler.on(el, "complete", opts.oncomplete), 1759 EventRuler.on(el, "incomplete", opts.onincomplete), EventRuler.on(el, "cleared", opts.oncleared), 1760 mobile || !0 === opts.inputEventOnly ? el.removeAttribute("maxLength") : (EventRuler.on(el, "keydown", EventHandlers.keydownEvent), 1761 EventRuler.on(el, "keypress", EventHandlers.keypressEvent)), EventRuler.on(el, "input", EventHandlers.inputFallBackEvent), 1762 EventRuler.on(el, "compositionend", EventHandlers.compositionendEvent)), EventRuler.on(el, "setvalue", EventHandlers.setValueEvent), 1763 inputmask.undoValue = getBufferTemplate().join(""); 1764 var activeElement = (el.inputmask.shadowRoot || document).activeElement; 1765 if ("" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || activeElement === el) { 1766 applyInputValue(el, el.inputmask._valueGet(!0), opts); 1767 var buffer = getBuffer().slice(); 1768 !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)), 1769 (!1 === opts.clearMaskOnLostFocus || opts.showMaskOnFocus && activeElement === el || "" !== el.inputmask._valueGet(!0)) && writeBuffer(el, buffer), 1770 activeElement === el && caret(el, seekNext(getLastValidPosition())); 1771 } 1772 } 1773 } 1774 if (void 0 !== actionObj) switch (actionObj.action) { 1775 case "isComplete": 1776 return el = actionObj.el, isComplete(getBuffer()); 1777 1778 case "unmaskedvalue": 1779 return void 0 !== el && void 0 === actionObj.value || (valueBuffer = actionObj.value, 1780 valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer).split(""), 1781 checkVal.call(this, void 0, !1, !1, valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(inputmask, void 0, getBuffer(), 0, opts)), 1782 unmaskedvalue(el); 1783 1784 case "mask": 1785 mask(); 1786 break; 1787 1788 case "format": 1789 return valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value).split(""), 1790 checkVal.call(this, void 0, !0, !1, valueBuffer), actionObj.metadata ? { 1791 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""), 1792 metadata: maskScope.call(this, { 1793 action: "getmetadata" 1794 }, maskset, opts) 1795 } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""); 1796 1797 case "isValid": 1798 actionObj.value ? (valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value).split(""), 1799 checkVal.call(this, void 0, !0, !1, valueBuffer)) : actionObj.value = isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""); 1800 for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; rl < lmib && !isMask(lmib); lmib--) ; 1801 return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === (isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("")); 1802 1803 case "getemptymask": 1804 return getBufferTemplate().join(""); 1805 1806 case "remove": 1807 if (el && el.inputmask) { 1808 $.data(el, "_inputmask_opts", null); 1809 var cv = opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(opts.autoUnmask), valueProperty; 1810 cv !== getBufferTemplate().join("") ? el.inputmask._valueSet(cv, opts.autoUnmask) : el.inputmask._valueSet(""), 1811 EventRuler.off(el), Object.getOwnPropertyDescriptor && Ob
1811ject.getPrototypeOf ? (valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value"), 1812 valueProperty && el.inputmask.__valueGet && Object.defineProperty(el, "value", { 1813 get: el.inputmask.__valueGet, 1814 set: el.inputmask.__valueSet, 1815 configurable: !0 1816 })) : document.__lookupGetter__ && el.__lookupGetter__("value") && el.inputmask.__valueGet && (el.__defineGetter__("value", el.inputmask.__valueGet), 1817 el.__defineSetter__("value", el.inputmask.__valueSet)), el.inputmask = void 0; 1818 } 1819 return el; 1820 1821 case "getmetadata": 1822 if ($.isArray(maskset.metadata)) { 1823 var maskTarget = getMaskTemplate(!0, 0, !1).join(""); 1824 return $.each(maskset.metadata, function(ndx, mtdt) { 1825 if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1; 1826 }), maskTarget; 1827 } 1828 return maskset.metadata; 1829 } 1830 }; 1831 }, function(module, exports, __webpack_require__) { 1832 "use strict"; 1833 function _typeof(obj) { 1834 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 1835 return typeof obj; 1836 } : function _typeof(obj) { 1837 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 1838 }, _typeof(obj); 1839 } 1840 "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === _typeof("test".__proto__) ? function(object) { 1841 return object.__proto__; 1842 } : function(object) { 1843 return object.constructor.prototype; 1844 }); 1845 }, function(module, exports, __webpack_require__) { 1846 "use strict"; 1847 function _typeof(obj) { 1848 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 1849 return typeof obj; 1850 } : function _typeof(obj) { 1851 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 1852 }, _typeof(obj); 1853 } 1854 var Inputmask = __webpack_require__(1), $ = Inputmask.dependencyLib, keyCode = __webpack_require__(0), formatCode = { 1855 d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ], 1856 dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() { 1857 return pad(Date.prototype.getDate.call(this), 2); 1858 } ], 1859 ddd: [ "" ], 1860 dddd: [ "" ], 1861 m: [ "[1-9]|1[012]", Date.prototype.setMonth, "month", function() { 1862 return Date.prototype.getMonth.call(this) + 1; 1863 } ], 1864 mm: [ "0[1-9]|1[012]", Date.prototype.setMonth, "month", function() { 1865 return pad(Date.prototype.getMonth.call(this) + 1, 2); 1866 } ], 1867 mmm: [ "" ], 1868 mmmm: [ "" ], 1869 yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() { 1870 return pad(Date.prototype.getFullYear.call(this), 2); 1871 } ], 1872 yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() { 1873 return pad(Date.prototype.getFullYear.call(this), 4); 1874 } ], 1875 h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ], 1876 hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() { 1877 return pad(Date.prototype.getHours.call(this), 2); 1878 } ], 1879 hx: [ function(x) { 1880 return "[0-9]{".concat(x, "}"); 1881 }, Date.prototype.setHours, "hours", function(x) { 1882 return Date.prototype.getHours; 1883 } ], 1884 H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ], 1885 HH: [ "0[0-9]|1[0-9]|2[0-3]", Date.prototype.setHours, "hours", function() { 1886 return pad(Date.prototype.getHours.call(this), 2); 1887 } ], 1888 Hx: [ function(x) { 1889 return "[0-9]{".concat(x, "}"); 1890 }, Date.prototype.setHours, "hours", function(x) { 1891 return function() { 1892 return pad(Date.prototype.getHours.call(this), x); 1893 }; 1894 } ], 1895 M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ], 1896 MM: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setMinutes, "minutes", function() { 1897 return pad(Date.prototype.getMinutes.call(this), 2); 1898 } ], 1899 s: [ "[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds ], 1900 ss: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setSeconds, "seconds", function() { 1901 return pad(Date.prototype.getSeconds.call(this), 2); 1902 } ], 1903 l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() { 1904 return pad(Date.prototype.getMilliseconds.call(this), 3); 1905 } ], 1906 L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() { 1907 return pad(Date.prototype.getMilliseconds.call(this), 2); 1908 } ], 1909 t: [ "[ap]" ], 1910 tt: [ "[ap]m" ], 1911 T: [ "[AP]" ], 1912 TT: [ "[AP]M" ], 1913 Z: [ "" ], 1914 o: [ "" ], 1915 S: [ "" ] 1916 }, formatAlias = { 1917 isoDate: "yyyy-mm-dd", 1918 isoTime: "HH:MM:ss", 1919 isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", 1920 isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" 1921 }; 1922 function formatcode(match) { 1923 var dynMatches = new RegExp("\\d+$").exec(match[0]); 1924 if (dynMatches && void 0 !== dynMatches[0]) { 1925 var fcode = formatCode[match[0][0] + "x"].slice(""); 1926 return fcode[0] = fcode[0](dynMatches[0]), fcode[3] = fcode[3](dynMatches[0]), fcode; 1927 } 1928 if (formatCode[match[0]]) return formatCode[match[0]]; 1929 } 1930 function getTokenizer(opts) { 1931 if (!opts.tokenizer) { 1932 var tokens = [], dyntokens = []; 1933 for (var ndx in formatCode) if (/\.*x$/.test(ndx)) { 1934 var dynToken = ndx[0] + "\\d+"; 1935 -1 === dyntokens.indexOf(dynToken) && dyntokens.push(dynToken); 1936 } else -1 === tokens.indexOf(ndx[0]) && tokens.push(ndx[0]); 1937 opts.tokenizer = "(" + (0 < dyntokens.length ? dyntokens.join("|") + "|" : "") + tokens.join("+|") + ")+?|.", 1938 opts.tokenizer = new RegExp(opts.tokenizer, "g"); 1939 } 1940 return opts.tokenizer; 1941 } 1942 function prefillYear(dateParts, currentResult, opts) { 1943 if (dateParts.year !== dateParts.rawyear) { 1944 var currentYear = new Date().getFullYear().toString(), enteredPart = dateParts.rawyear.replace(/[^0-9]/g, ""), currentYearPart = currentYear.slice(0, enteredPart.length), currentYearNextPart = currentYear.slice(enteredPart.length); 1945 2 === enteredPart.length && enteredPart === currentYearPart && (!opts.max || opts.max.year >= currentYear) && (dateParts.date.setFullYear(currentYear), 1946 dateParts.year = currentYear, currentResult.insert = [ { 1947 pos: currentResult.pos + 1, 1948 c: currentYearNextPart[0] 1949 }, { 1950 pos: currentResult.pos + 2, 1951 c: currentYearNextPart[1] 1952 } ]); 1953 } 1954 return currentResult; 1955 } 1956 function isValidDate(dateParts, currentResult) { 1957 return (!isFinite(dateParts.rawday) || "29" == dateParts.day && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day) && currentResult; 1958 } 1959 function isDateInRange(dateParts, opts) { 1960 var result = !0; 1961 if (opts.min) { 1962 if (dateParts.rawyear) { 1963 var rawYear = dateParts.rawyear.replace(/[^0-9]/g, ""), minYear = opts.min.year.substr(0, rawYear.length); 1964 result = minYear <= rawYear; 1965 } 1966 dateParts.year === dateParts.rawyear && opts.min.date.getTime() == opts.min.date.getTime() && (result = opts.min.date.getTime() <= dateParts.date.getTime()); 1967 } 1968 return result && opts.max && opts.max.date.getTime() == opts.max.date.getTime() && (result = opts.max.date.getTime() >= dateParts.date.getTime()), 1969 result; 1970 } 1971 function parse(format, dateObjValue, opts, raw) { 1972 var mask = "", match, fcode; 1973 for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(format); ) if (void 0 === dateObjValue) if (fcode = formatcode(match)) mask += "(" + fcode[0] + ")"; else switch (match[0]) { 1974 case "[": 1975 mask += "("; 1976 break; 1977 1978 case "]": 1979 mask += ")?"; 1980 break; 1981 1982 default: 1983 mask += Inputmask.escapeRegex(match[0]); 1984 } else if (fcode = formatcode(match)) if (!0 !== raw && fcode[3]) { 1985 var getFn = fcode[3]; 1986 mask += getFn.call(dateObjValue.date); 1987 } else fcode[2] ? mask += dateObjValue["raw" + fcode[2]] : mask += match[0]; else mask += match[0]; 1988 return mask; 1989 } 1990 function pad(val, len) { 1991 for (val = String(val), len = len || 2; val.length < len; ) val = "0" + val; 1992 return val; 1993 } 1994 function analyseMask(maskString, format, opts) { 1995 var dateObj = { 1996 date: new Date(1, 0, 1) 1997 }, targetProp, mask = maskString, match, dateOperation; 1998 function setValue(dateObj, value, opts) { 1999 dateObj[targetProp] = value.replace(/[^0-9]/g, "0"), dateObj["raw" + targetProp] = value,
2000 void 0 !== dateOperation && dateOperation.call(dateObj.date, "month" == targetProp ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]); 2001 } 2002 if ("string" == typeof mask) { 2003 for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(format); ) { 2004 var value = mask.slice(0, match[0].length); 2005 Object.prototype.hasOwnProperty.call(formatCode, match[0]) && (targetProp = formatCode[match[0]][2], 2006 dateOperation = formatCode[match[0]][1], setValue(dateObj, value, opts)), mask = mask.slice(value.length); 2007 } 2008 return dateObj; 2009 } 2010 if (mask && "object" === _typeof(mask) && Object.prototype.hasOwnProperty.call(mask, "date")) return mask; 2011 } 2012 function importDate(dateObj, opts) { 2013 var match, date = ""; 2014 for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(opts.inputFormat); ) "d" === match[0].charAt(0) ? date += pad(dateObj.getDate(), match[0].length) : "m" === match[0].charAt(0) ? date += pad(dateObj.getMonth() + 1, match[0].length) : "yyyy" === match[0] ? date += dateObj.getFullYear().toString() : "y" === match[0].charAt(0) && (date += pad(dateObj.getYear(), match[0].length)); 2015 return date; 2016 } 2017 function getTokenMatch(pos, opts) { 2018 var calcPos = 0, targetMatch, match, matchLength = 0; 2019 for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(opts.inputFormat); ) { 2020 var dynMatches = new RegExp("\\d+$").exec(match[0]); 2021 if (matchLength = dynMatches ? parseInt(dynMatches[0]) : match[0].length, calcPos += matchLength, 2022 pos <= calcPos) { 2023 targetMatch = match, match = getTokenizer(opts).exec(opts.inputFormat); 2024 break; 2025 } 2026 } 2027 return { 2028 targetMatchIndex: calcPos - matchLength,
vendor: 1,620 bytes, lines 2029-2052
2029 nextMatch: match, 2030 targetMatch: targetMatch 2031 }; 2032 } 2033 Inputmask.extendAliases({ 2034 datetime: { 2035 mask: function mask(opts) { 2036 return opts.numericInput = !1, formatCode.S = opts.i18n.ordinalSuffix.join("|"), 2037 opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat, opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat, 2038 opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat, 2039 opts.placeholder = "" !== opts.placeholder ? opts.placeholder : opts.inputFormat.replace(/[[\]]/, ""), 2040 opts.regex = parse(opts.inputFormat, void 0, opts), opts.min = analyseMask(opts.min, opts.inputFormat, opts), 2041 opts.max = analyseMask(opts.max, opts.inputFormat, opts), null; 2042 }, 2043 placeholder: "", 2044 inputFormat: "isoDateTime", 2045 displayFormat: void 0, 2046 outputFormat: void 0, 2047 min: null, 2048 max: null, 2049 skipOptionalPartCharacter: "", 2050 i18n: { 2051 dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ], 2052 monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2052November", "December" ], 2053 ordinalSuffix: [ "st", "nd", "rd", "th" ] 2054 }, 2055 preValidation: function preValidation(buffer, pos, c, isSelection, opts, maskset, caretPos, strict) { 2056 if (strict) return !0; 2057 if (isNaN(c) && buffer[pos] !== c) { 2058 var tokenMatch = getTokenMatch(pos, opts); 2059 if (tokenMatch.nextMatch && tokenMatch.nextMatch[0] === c && 1 < tokenMatch.targetMatch[0].length) { 2060 var validator = formatCode[tokenMatch.targetMatch[0]][0]; 2061 if (new RegExp(validator).test("0" + buffer[pos - 1])) return buffer[pos] = buffer[pos - 1], 2062 buffer[pos - 1] = "0", { 2063 fuzzy: !0, 2064 buffer: buffer, 2065 refreshFromBuffer: { 2066 start: pos - 1, 2067 end: pos + 1 2068 }, 2069 pos: pos + 1 2070 }; 2071 } 2072 } 2073 return !0; 2074 }, 2075 postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) { 2076 if (strict) return !0; 2077 var tokenMatch, validator; 2078 if (!1 === currentResult) return tokenMatch = getTokenMatch(pos + 1, opts), tokenMatch.targetMatch && tokenMatch.targetMatchIndex === pos && 1 < tokenMatch.targetMatch[0].length && void 0 !== formatCode[tokenMatch.targetMatch[0]] && (validator = formatCode[tokenMatch.targetMatch[0]][0], 2079 new RegExp(validator).test("0" + c)) ? { 2080 insert: [ { 2081 pos: pos, 2082 c: "0" 2083 }, { 2084 pos: pos + 1, 2085 c: c 2086 } ], 2087 pos: pos + 1 2088 } : currentResult; 2089 if (currentResult.fuzzy && (buffer = currentResult.buffer, pos = currentResult.pos), 2090 tokenMatch = getTokenMatch(pos, opts), tokenMatch.targetMatch && tokenMatch.targetMatch[0] && void 0 !== formatCode[tokenMatch.targetMatch[0]]) { 2091 validator = formatCode[tokenMatch.targetMatch[0]][0]; 2092 var part = buffer.slice(tokenMatch.targetMatchIndex, tokenMatch.targetMatchIndex + tokenMatch.targetMatch[0].length); 2093 !1 === new RegExp(validator).test(part.join("")) && 2 === tokenMatch.targetMatch[0].length && maskset.validPositions[tokenMatch.targetMatchIndex] && maskset.validPositions[tokenMatch.targetMatchIndex + 1] && (maskset.validPositions[tokenMatch.targetMatchIndex + 1].input = "0"); 2094 } 2095 var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts); 2096 return result && dateParts.date.getTime() == dateParts.date.getTime() && (result = prefillYear(dateParts, result, opts), 2097 result = isValidDate(dateParts, result), result = result && isDateInRange(dateParts, opts)), 2098 pos && result && currentResult.pos !== pos ? { 2099 buffer: parse(opts.inputFormat, dateParts, opts).split(""), 2100 refreshFromBuffer: { 2101 start: pos, 2102 end: currentResult.pos 2103 } 2104 } : result; 2105 }, 2106 onKeyDown: function onKeyDown(e, buffer, caretPos, opts) { 2107 var input = this; 2108 e.ctrlKey && e.keyCode === keyCode.RIGHT && (this.inputmask._valueSet(importDate(new Date(), opts)), 2109 $(this).trigger("setvalue")); 2110 }, 2111 onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) { 2112 return unmaskedValue ? parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, !0) : unmaskedValue; 2113 },
2114 casing: function casing(elem, test, pos, validPositions) { 2115 return 0 == test.nativeDef.indexOf("[ap]") ? elem.toLowerCase() : 0 == test.nativeDef.indexOf("[AP]") ? elem.toUpperCase() : elem; 2116 }, 2117 onBeforeMask: function onBeforeMask(initialValue, opts) { 2118 return "[object Date]" === Object.prototype.toString.call(initialValue) && (initialValue = importDate(initialValue, opts)), 2119 initialValue; 2120 }, 2121 insertMode: !1, 2122 shiftPositions: !1, 2123 keepStatic: !1, 2124 inputmode: "numeric" 2125 } 2126 }), module.exports = Inputmask; 2127 }, function(module, exports, __webpack_require__) { 2128 "use strict"; 2129 var Inputmask = __webpack_require__(1), $ = Inputmask.dependencyLib, keyCode = __webpack_require__(0); 2130 function autoEscape(txt, opts) { 2131 for (var escapedTxt = "", i = 0; i < txt.length; i++) Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker[0] === txt.charAt(i) || opts.optionalmarker[1] === txt.charAt(i) || opts.quantifiermarker[0] === txt.charAt(i) || opts.quantifiermarker[1] === txt.charAt(i) || opts.groupmarker[0] === txt.charAt(i) || opts.groupmarker[1] === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? escapedTxt += "\\" + txt.charAt(i) : escapedTxt += txt.charAt(i); 2132 return escapedTxt; 2133 } 2134 function alignDigits(buffer, digits, opts, force) { 2135 if (0 < buffer.length && 0 < digits && (!opts.digitsOptional || force)) { 2136 var radixPosition = $.inArray(opts.radixPoint, buffer); 2137 -1 === radixPosition && (buffer.push(opts.radixPoint), radixPosition = buffer.length - 1); 2138 for (var i = 1; i <= digits; i++) isFinite(buffer[radixPosition + i]) || (buffer[radixPosition + i] = "0"); 2139 } 2140 return buffer; 2141 } 2142 function findValidator(symbol, maskset) { 2143 var posNdx = 0; 2144 if ("+" === symbol) { 2145 for (posNdx in maskset.validPositions) ;
vendor: 8,103 bytes, lines 2146-2264
2146 posNdx = parseInt(posNdx); 2147 } 2148 for (var tstNdx in maskset.tests) if (tstNdx = parseInt(tstNdx), posNdx <= tstNdx) for (var ndx = 0, ndxl = maskset.tests[tstNdx].length; ndx < ndxl; ndx++) if ((void 0 === maskset.validPositions[tstNdx] || "-" === symbol) && maskset.tests[tstNdx][ndx].match.def === symbol) return tstNdx + (void 0 !== maskset.validPositions[tstNdx] && "-" !== symbol ? 1 : 0); 2149 return posNdx; 2150 } 2151 function findValid(symbol, maskset) { 2152 var ret = -1; 2153 return $.each(maskset.validPositions, function(ndx, tst) { 2154 if (tst && tst.match.def === symbol) return ret = parseInt(ndx), !1; 2155 }), ret; 2156 } 2157 function parseMinMaxOptions(opts) { 2158 void 0 === opts.parseMinMaxOptions && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 2159 "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, ".")), 2160 opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)), 2161 null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 2162 "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, ".")), 2163 opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)), 2164 opts.parseMinMaxOptions = "done"); 2165 } 2166 function genMask(opts) { 2167 opts.repeat = 0, opts.groupSeparator === opts.radixPoint && opts.digits && "0" !== opts.digits && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""), 2168 " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = void 0), 1 < opts.placeholder.length && (opts.placeholder = opts.placeholder.charAt(0)), 2169 "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && (opts.positionCaretOnClick = "lvp"); 2170 var decimalDef = "0", radixPointDef = opts.radixPoint; 2171 !0 === opts.numericInput && void 0 === opts.__financeInput ? (decimalDef = "1", 2172 opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick, 2173 opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts._radixDance = !1, 2174 radixPointDef = "," === opts.radixPoint ? "?" : "!", "" !== opts.radixPoint && void 0 === opts.definitions[radixPointDef] && (opts.definitions[radixPointDef] = {}, 2175 opts.definitions[radixPointDef].validator = "[" + opts.radixPoint + "]", opts.definitions[radixPointDef].placeholder = opts.radixPoint, 2176 opts.definitions[radixPointDef].static = !0, opts.definitions[radixPointDef].generated = !0)) : (opts.__financeInput = !1, 2177 opts.numericInput = !0); 2178 var mask = "[+]", altMask; 2179 if (mask += autoEscape(opts.prefix, opts), "" !== opts.groupSeparator ? (void 0 === opts.definitions[opts.groupSeparator] && (opts.definitions[opts.groupSeparator] = {}, 2180 opts.definitions[opts.groupSeparator].validator = "[" + opts.groupSeparator + "]", 2181 opts.definitions[opts.groupSeparator].placeholder = opts.groupSeparator, opts.definitions[opts.groupSeparator].static = !0, 2182 opts.definitions[opts.groupSeparator].generated = !0), mask += opts._mask(opts)) : mask += "9{+}", 2183 void 0 !== opts.digits && 0 !== opts.digits) { 2184 var dq = opts.digits.toString().split(","); 2185 isFinite(dq[0]) && dq[1] && isFinite(dq[1]) ? mask += radixPointDef + decimalDef + "{" + opts.digits + "}" : (isNaN(opts.digits) || 0 < parseInt(opts.digits)) && (opts.digitsOptional ? (altMask = mask + radixPointDef + decimalDef + "{0," + opts.digits + "}", 2186 opts.keepStatic = !0) : mask += radixPointDef + decimalDef + "{" + opts.digits + "}"); 2187 } 2188 return mask += autoEscape(opts.suffix, opts), mask += "[-]", altMask && (mask = [ altMask + autoEscape(opts.suffix, opts) + "[-]", mask ]), 2189 opts.greedy = !1, parseMinMaxOptions(opts), mask; 2190 } 2191 function hanndleRadixDance(pos, c, radixPos, maskset, opts) { 2192 return opts._radixDance && opts.numericInput && c !== opts.negationSymbol.back && pos <= radixPos && (0 < radixPos || c == opts.radixPoint) && (void 0 === maskset.validPositions[pos - 1] || maskset.validPositions[pos - 1].input !== opts.negationSymbol.back) && (pos -= 1), 2193 pos; 2194 } 2195 function decimalValidator(chrs, maskset, pos, strict, opts) { 2196 var radixPos = maskset.buffer ? maskset.buffer.indexOf(opts.radixPoint) : -1, result = -1 !== radixPos && new RegExp("[0-9\uff11-\uff19]").test(chrs); 2197 return opts._radixDance && result && null == maskset.validPositions[radixPos] ? { 2198 insert: { 2199 pos: radixPos === pos ? radixPos + 1 : radixPos, 2200 c: opts.radixPoint 2201 }, 2202 pos: pos 2203 } : result; 2204 } 2205 function checkForLeadingZeroes(buffer, opts) { 2206 var numberMatches = new RegExp("(^" + ("" !== opts.negationSymbol.front ? Inputmask.escapeRegex(opts.negationSymbol.front) + "?" : "") + Inputmask.escapeRegex(opts.prefix) + ")(.*)(" + Inputmask.escapeRegex(opts.suffix) + ("" != opts.negationSymbol.back ? Inputmask.escapeRegex(opts.negationSymbol.back) + "?" : "") + "$)").exec(buffer.slice().reverse().join("")), number = numberMatches ? numberMatches[2] : "", leadingzeroes = !1; 2207 return number && (number = number.split(opts.radixPoint.charAt(0))[0], leadingzeroes = new RegExp("^[0" + opts.groupSeparator + "]*").exec(number)), 2208 !(!leadingzeroes || !(1 < leadingzeroes[0].length || 0 < leadingzeroes[0].length && leadingzeroes[0].length < number.length)) && leadingzeroes; 2209 } 2210 Inputmask.extendAliases({ 2211 numeric: { 2212 mask: genMask, 2213 _mask: function _mask(opts) { 2214 return "(" + opts.groupSeparator + "999){+|1}"; 2215 }, 2216 digits: "*", 2217 digitsOptional: !0, 2218 enforceDigitsOnBlur: !1, 2219 radixPoint: ".", 2220 positionCaretOnClick: "radixFocus", 2221 _radixDance: !0, 2222 groupSeparator: "", 2223 allowMinus: !0, 2224 negationSymbol: { 2225 front: "-", 2226 back: "" 2227 }, 2228 prefix: "", 2229 suffix: "", 2230 min: null, 2231 max: null, 2232 step: 1, 2233 unmaskAsNumber: !1, 2234 roundingFN: Math.round, 2235 inputmode: "numeric", 2236 shortcuts: { 2237 k: "000", 2238 m: "000000" 2239 }, 2240 placeholder: "0", 2241 greedy: !1, 2242 rightAlign: !0, 2243 insertMode: !0, 2244 autoUnmask: !1, 2245 skipOptionalPartCharacter: "", 2246 definitions: { 2247 0: { 2248 validator: decimalValidator 2249 }, 2250 1: { 2251 validator: decimalValidator, 2252 definitionSymbol: "9" 2253 }, 2254 "+": { 2255 validator: function validator(chrs, maskset, pos, strict, opts) { 2256 return opts.allowMinus && ("-" === chrs || chrs === opts.negationSymbol.front); 2257 } 2258 }, 2259 "-": { 2260 validator: function validator(chrs, maskset, pos, strict, opts) { 2261 return opts.allowMinus && chrs === opts.negationSymbol.back; 2262 } 2263 } 2264 },
2265 preValidation: function preValidation(buffer, pos, c, isSelection, opts, maskset, caretPos, strict) { 2266 if (!1 !== opts.__financeInput && c === opts.radixPoint) return !1; 2267 var pattern; 2268 if (pattern = opts.shortcuts && opts.shortcuts[c]) { 2269 if (1 < pattern.length) for (var inserts = [], i = 0; i < pattern.length; i++) inserts.push({ 2270 pos: pos + i, 2271 c: pattern[i], 2272 strict: !1 2273 }); 2274 return { 2275 insert: inserts 2276 }; 2277 } 2278 var radixPos = $.inArray(opts.radixPoint, buffer), initPos = pos; 2279 if (pos = hanndleRadixDance(pos, c, radixPos, maskset, opts), "-" === c || c === opts.negationSymbol.front) { 2280 if (!0 !== opts.allowMinus) return !1; 2281 var isNegative = !1, front = findValid("+", maskset), back = findValid("-", maskset); 2282 return -1 !== front && (isNegative = [ front, back ]), !1 !== isNegative ? { 2283 remove: isNegative, 2284 caret: initPos 2285 } : { 2286 insert: [ { 2287 pos: findValidator("+", maskset), 2288 c: opts.negationSymbol.front, 2289 fromIsValid: !0 2290 }, { 2291 pos: findValidator("-", maskset), 2292 c: opts.negationSymbol.back, 2293 fromIsValid: void 0 2294 } ], 2295 caret: initPos + opts.negationSymbol.back.length 2296 }; 2297 } 2298 if (strict) return !0; 2299 if (-1 !== radixPos && !0 === opts._radixDance && !1 === isSelection && c === opts.radixPoint && void 0 !== opts.digits && (isNaN(opts.digits) || 0 < parseInt(opts.digits)) && radixPos !== pos) return { 2300 caret: opts._radixDance && pos === radixPos - 1 ? radixPos + 1 : radixPos 2301 }; 2302 if (!1 === opts.__financeInput) if (isSelection) { 2303 if (opts.digitsOptional) return { 2304 rewritePosition: caretPos.end 2305 }; 2306 if (!opts.digitsOptional) { 2307 if (caretPos.begin > radixPos && caretPos.end <= radixPos) return c === opts.radixPoint ? { 2308 insert: { 2309 pos: radixPos + 1, 2310 c: "0", 2311 fromIsValid: !0 2312 }, 2313 rewritePosition: radixPos 2314 } : { 2315 rewritePosition: radixPos + 1 2316 }; 2317 if (caretPos.begin < radixPos) return { 2318 rewritePosition: caretPos.begin - 1 2319 }; 2320 } 2321 } else if (!opts.showMaskOnHover && !opts.showMaskOnFocus && !opts.digitsOptional && 0 < opts.digits && "" === this.inputmask.__valueGet.call(this)) return { 2322 rewritePosition: radixPos 2323 }; 2324 return { 2325 rewritePosition: pos 2326 }; 2327 }, 2328 postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) { 2329 if (!1 === currentResult) return currentResult; 2330 if (strict) return !0; 2331 if (null !== opts.min || null !== opts.max) { 2332 var unmasked = opts.onUnMask(buffer.slice().reverse().join(""), void 0, $.extend({}, opts, { 2333 unmaskAsNumber: !0 2334 })); 2335 if (null !== opts.min && unmasked < opts.min && (unmasked.toString().length >= opts.min.toString().length || unmasked < 0)) return !1; 2336 if (null !== opts.max && unmasked > opts.max) return !1; 2337 } 2338 return currentResult; 2339 }, 2340 onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) { 2341 if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue; 2342 var processValue = maskedValue.replace(opts.prefix, ""); 2343 return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 2344 "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")), 2345 opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")), 2346 processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"), 2347 processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 2348 Number(processValue)) : processValue; 2349 }, 2350 isComplete: function isComplete(buffer, opts) { 2351 var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join(""); 2352 return maskedValue = maskedValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"), 2353 maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 2354 maskedValue = maskedValue.replace(opts.prefix, ""), maskedValue = maskedValue.replace(opts.suffix, ""), 2355 maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1"), 2356 "," === opts.radixPoint && (maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")), 2357 isFinite(maskedValue); 2358 }, 2359 onBeforeMask: function onBeforeMask(initialValue, opts) { 2360 var radixPoint = opts.radixPoint || ","; 2361 isFinite(opts.digits) && (opts.digits = parseInt(opts.digits)), "number" != typeof initialValue && "number" !== opts.inputType || "" === radixPoint || (initialValue = initialValue.toString().replace(".", radixPoint)); 2362 var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\-0-9]/g, ""), decimalPart = 1 < valueParts.length ? valueParts[1].replace(/[^0-9]/g, "") : "", forceDigits = 1 < valueParts.length; 2363 initialValue = integerPart + ("" !== decimalPart ? radixPoint + decimalPart : decimalPart); 2364 var digits = 0; 2365 if ("" !== radixPoint && (digits = opts.digitsOptional ? opts.digits < decimalPart.length ? opts.digits : decimalPart.length : opts.digits, 2366 "" !== decimalPart || !opts.digitsOptional)) { 2367 var digitsFactor = Math.pow(10, digits || 1); 2368 initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), "."), isNaN(parseFloat(initialValue)) || (initialValue = (opts.roun
2368dingFN(parseFloat(initialValue) * digitsFactor) / digitsFactor).toFixed(digits)), 2369 initialValue = initialValue.toString().replace(".", radixPoint); 2370 } 2371 if (0 === opts.digits && -1 !== initialValue.indexOf(radixPoint) && (initialValue = initialValue.substring(0, initialValue.indexOf(radixPoint))), 2372 null !== opts.min || null !== opts.max) { 2373 var numberValue = initialValue.toString().replace(radixPoint, "."); 2374 null !== opts.min && numberValue < opts.min ? initialValue = opts.min.toString().replace(".", radixPoint) : null !== opts.max && numberValue > opts.max && (initialValue = opts.max.toString().replace(".", radixPoint)); 2375 } 2376 return alignDigits(initialValue.toString().split(""), digits, opts, forceDigits).join(""); 2377 }, 2378 onBeforeWrite: function onBeforeWrite(e, buffer, caretPos, opts) { 2379 function stripBuffer(buffer, stripRadix) { 2380 if (!1 !== opts.__financeInput || stripRadix) { 2381 var position = $.inArray(opts.radixPoint, buffer); 2382 -1 !== position && buffer.splice(position, 1); 2383 } 2384 if ("" !== opts.groupSeparator) for (;-1 !== (position = buffer.indexOf(opts.groupSeparator)); ) buffer.splice(position, 1); 2385 return buffer; 2386 } 2387 var result, leadingzeroes = checkForLeadingZeroes(buffer, opts); 2388 if (leadingzeroes) { 2389 var buf = buffer.slice().reverse(), caretNdx = buf.join("").indexOf(leadingzeroes[0]); 2390 buf.splice(caretNdx, leadingzeroes[0].length); 2391 var newCaretPos = buf.length - caretNdx; 2392 stripBuffer(buf), result = { 2393 refreshFromBuffer: !0, 2394 buffer: buf.reverse(), 2395 caret: caretPos < newCaretPos ? caretPos : newCaretPos 2396 }; 2397 } 2398 if (e) switch (e.type) { 2399 case "blur": 2400 case "checkval": 2401 if (null !== opts.min) { 2402 var unmasked = opts.onUnMask(buffer.slice().reverse().join(""), void 0, $.extend({}, opts, { 2403 unmaskAsNumber: !0 2404 })); 2405 if (null !== opts.min && unmasked < opts.min) return { 2406 refreshFromBuffer: !0, 2407 buffer: alignDigits(opts.min.toString().replace(".", opts.radixPoint).split(""), opts.digits, opts).reverse() 2408 }; 2409 } 2410 if (buffer[buffer.length - 1] === opts.negationSymbol.front) { 2411 var nmbrMtchs = new RegExp("(^" + ("" != opts.negationSymbol.front ? Inputmask.escapeRegex(opts.negationSymbol.front) + "?" : "") + Inputmask.escapeRegex(opts.prefix) + ")(.*)(" + Inputmask.escapeRegex(opts.suffix) + ("" != opts.negationSymbol.back ? Inputmask.escapeRegex(opts.negationSymbol.back) + "?" : "") + "$)").exec(stripBuffer(buffer.slice(), !0).reverse().join("")), number = nmbrMtchs ? nmbrMtchs[2] : ""; 2412 0 == number && (result = { 2413 refreshFromBuffer: !0, 2414 buffer: [ 0 ] 2415 }); 2416 } else "" !== opts.radixPoint && buffer[0] === opts.radixPoint && (result && result.buffer ? result.buffer.shift() : (buffer.shift(), 2417 result = { 2418 refreshFromBuffer: !0, 2419 buffer: stripBuffer(buffer) 2420 })); 2421 if (opts.enforceDigitsOnBlur) { 2422 result = result || {}; 2423 var bffr = result && result.buffer || buffer.slice().reverse(); 2424 result.refreshFromBuffer = !0, result.buffer = alignDigits(bffr, opts.digits, opts, !0).reverse(); 2425 } 2426 } 2427 return result; 2428 }, 2429 onKeyDown: function onKeyDown(e, buffer, caretPos, opts) { 2430 var $input = $(this), bffr; 2431 if (e.ctrlKey) switch (e.keyCode) { 2432 case keyCode.UP: 2433 return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), 2434 $input.trigger("setvalue"), !1; 2435 2436 case keyCode.DOWN: 2437 return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), 2438 $input.trigger("setvalue"), !1; 2439 } 2440 if (!e.shiftKey && (e.keyCode === keyCode.DELETE || e.keyCode === keyCode.BACKSPACE || e.keyCode === keyCode.BACKSPACE_SAFARI) && caretPos.begin !== buffer.length) { 2441 if (buffer[e.keyCode === keyCode.DELETE ? caretPos.begin - 1 : caretPos.end] === opts.negationSymbol.front) return bffr = buffer.slice().reverse(), 2442 "" !== opts.negationSymbol.front && bffr.shift(), "" !== opts.negationSymbol.back && bffr.pop(), 2443 $input.trigger("setvalue", [ bffr.join(""), caretPos.begin ]), !1; 2444 if (!0 === opts._radixDance) { 2445 var radixPos = $.inArray(opts.radixPoint, buffer); 2446 if (opts.digitsOptional) { 2447 if (0 === radixPos) return bffr = buffer.slice().reverse(), bffr.pop(), $input.trigger("setvalue", [ bffr.join(""), caretPos.begin >= bffr.length ? bffr.length : caretPos.begin ]), 2448 !1; 2449 } else if (-1 !== radixPos && (caretPos.begin < radixPos || caretPos.end < radixPos || e.keyCode === keyCode.DELETE && c
2449aretPos.begin === radixPos)) return caretPos.begin !== caretPos.end || e.keyCode !== keyCode.BACKSPACE && e.keyCode !== keyCode.BACKSPACE_SAFARI || caretPos.begin++, 2450 bffr = buffer.slice().reverse(), bffr.splice(bffr.length - caretPos.begin, caretPos.begin - caretPos.end + 1), 2451 bffr = alignDigits(bffr, opts.digits, opts).join(""), $input.trigger("setvalue", [ bffr, caretPos.begin >= bffr.length ? radixPos + 1 : caretPos.begin ]), 2452 !1; 2453 } 2454 } 2455 } 2456 }, 2457 currency: { 2458 prefix: "", 2459 groupSeparator: ",", 2460 alias: "numeric", 2461 digits: 2, 2462 digitsOptional: !1 2463 }, 2464 decimal: { 2465 alias: "numeric" 2466 }, 2467 integer: { 2468 alias: "numeric", 2469 digits: 0 2470 }, 2471 percentage: { 2472 alias: "numeric", 2473 min: 0, 2474 max: 100, 2475 suffix: " %", 2476 digits: 0, 2477 allowMinus: !1 2478 }, 2479 indianns: { 2480 alias: "numeric", 2481 _mask: function _mask(opts) { 2482 return "(" + opts.groupSeparator + "99){*|1}(" + opts.groupSeparator + "999){1|1}"; 2483 }, 2484 groupSeparator: ",", 2485 radixPoint: ".", 2486 placeholder: "0", 2487 digits: 2, 2488 digitsOptional: !1 2489 } 2490 }), module.exports = Inputmask; 2491 }, function(module, exports, __webpack_require__) { 2492 "use strict"; 2493 var _inputmask = _interopRequireDefault(__webpack_require__(1)); 2494 function _typeof(obj) { 2495 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 2496 return typeof obj; 2497 } : function _typeof(obj) { 2498 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2499 }, _typeof(obj); 2500 } 2501 function _classCallCheck(instance, Constructor) { 2502 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 2503 } 2504 function _possibleConstructorReturn(self, call) { 2505 return !call || "object" !== _typeof(call) && "function" != typeof call ? _assertThisInitialized(self) : call; 2506 } 2507 function _assertThisInitialized(self) { 2508 if (void 0 === self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 2509 return self; 2510 } 2511 function _inherits(subClass, superClass) { 2512 if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function"); 2513 subClass.prototype = Object.create(superClass && superClass.prototype, { 2514 constructor: { 2515 value: subClass, 2516 writable: !0, 2517 configurable: !0 2518 } 2519 }), superClass && _setPrototypeOf(subClass, superClass); 2520 } 2521 function _wrapNativeSuper(Class) { 2522 var _cache = "function" == typeof Map ? new Map() : void 0; 2523 return _wrapNativeSuper = function _wrapNativeSuper(Class) { 2524 if (null === Class || !_isNativeFunction(Class)) return Class; 2525 if ("function" != typeof Class) throw new TypeError("Super expression must either be null or a function"); 2526 if ("undefined" != typeof _cache) { 2527 if (_cache.has(Class)) return _cache.get(Class); 2528 _cache.set(Class, Wrapper); 2529 } 2530 function Wrapper() { 2531 return _construct(Class, arguments, _getPrototypeOf(this).constructor); 2532 } 2533 return Wrapper.prototype = Object.create(Class.prototype, { 2534 constructor: { 2535 value: Wrapper, 2536 enumerable: !1, 2537 writable: !0, 2538 configurable: !0 2539 } 2540 }), _setPrototypeOf(Wrapper, Class); 2541 }, _wrapNativeSuper(Class); 2542 } 2543 function isNativeReflectConstruct() { 2544 if ("undefined" == typeof Reflect || !Reflect.construct) return !1; 2545 if (Reflect.construct.sham) return !1; 2546 if ("function" == typeof Proxy) return !0; 2547 try { 2548 return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), 2549 !0; 2550 } catch (e) { 2551 return !1; 2552 } 2553 } 2554 function _construct(Parent, args, Class) { 2555 return _construct = isNativeReflectConstruct() ? Reflect.construct : function _construct(Parent, args, Class) { 2556 var a = [ null ]; 2557 a.push.apply(a, args); 2558 var Constructor = Function.bind.apply(Parent, a), instance = new Constructor(); 2559 return Class && _setPrototypeOf(instance, Class.prototype), instance; 2560 }, _construct.apply(null, arguments); 2561 } 2562 function _isNativeFunction(fn) { 2563 return -1 !== Function.toString.call(fn).indexOf("[native code]"); 2564 } 2565 function _setPrototypeOf(o, p) { 2566 return _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 2567 return o.__proto__ = p, o; 2568 }, _setPrototypeOf(o, p); 2569 }
2570 function _getPrototypeOf(o) { 2571 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 2572 return o.__proto__ || Object.getPrototypeOf(o); 2573 }, _getPrototypeOf(o); 2574 } 2575 function _interopRequireDefault(obj) { 2576 return obj && obj.__esModule ? obj : { 2577 default: obj 2578 }; 2579 } 2580 if (document.head.createShadowRoot || document.head.attachShadow) { 2581 var InputmaskElement = function(_HTMLElement) { 2582 function InputmaskElement() { 2583 var _this; 2584 _classCallCheck(this, InputmaskElement), _this = _possibleConstructorReturn(this, _getPrototypeOf(InputmaskElement).call(this)); 2585 var attributeNames = _this.getAttributeNames(), shadow = _this.attachShadow({ 2586 mode: "closed" 2587 }), input = document.createElement("input"); 2588 for (var attr in input.type = "text", shadow.appendChild(input), attributeNames) Object.prototype.hasOwnProperty.call(attributeNames, attr) && input.setAttribute(attributeNames[attr], _this.getAttribute(attributeNames[attr])); 2589 var im = new _inputmask.default(); 2590 return im.dataAttribute = "", im.mask(input), input.inputmask.shadowRoot = shadow, 2591 _this; 2592 } 2593 return _inherits(InputmaskElement, _HTMLElement), InputmaskElement; 2594 }(_wrapNativeSuper(HTMLElement)); 2595 customElements.define("input-mask", InputmaskElement); 2596 } 2597 }, function(module, exports, __webpack_require__) { 2598 "use strict"; 2599 function _typeof(obj) { 2600 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) { 2601 return typeof obj; 2602 } : function _typeof(obj) { 2603 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2604 }, _typeof(obj); 2605 } 2606 var $ = __webpack_require__(3), Inputmask = __webpack_require__(1); 2607 void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) { 2608 var nptmask, input = this[0]; 2609 if (void 0 === options && (options = {}), "string" == typeof fn) switch (fn) { 2610 case "unmaskedvalue": 2611 return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val(); 2612 2613 case "remove": 2614 return this.each(function() { 2615 this.inputmask && this.inputmask.remove(); 2616 }); 2617 2618 case "getemptymask": 2619 return input && input.inputmask ? input.inputmask.getemptymask() : ""; 2620 2621 case "hasMaskedValue": 2622 return !(!input || !input.inputmask) && input.inputmask.hasMaskedValue(); 2623 2624 case "isComplete": 2625 return !input || !input.inputmask || input.inputmask.isComplete(); 2626 2627 case "getmetadata": 2628 return input && input.inputmask ? input.inputmask.getmetadata() : void 0; 2629 2630 case "setvalue": 2631 Inputmask.setValue(input, options); 2632 break; 2633 2634 case "option": 2635 if ("string" != typeof options) return this.each(function() { 2636 if (void 0 !== this.inputmask) return this.inputmask.option(options); 2637 }); 2638 if (input && void 0 !== input.inputmask) return input.inputmask.option(options); 2639 break; 2640 2641 default: 2642 return options.alias = fn, nptmask = new Inputmask(options), this.each(function() { 2643 nptmask.mask(this); 2644 }); 2645 } else { 2646 if (Array.isArray(fn)) return options.alias = fn, nptmask = new Inputmask(options), 2647 this.each(function() { 2648 nptmask.mask(this); 2649 }); 2650 if ("object" == _typeof(fn)) return nptmask = new Inputmask(fn), void 0 === fn.mask && void 0 === fn.alias ? this.each(function() { 2651 if (void 0 !== this.inputmask) return this.inputmask.option(fn); 2652 nptmask.mask(this); 2653 }) : this.each(function() { 2654 nptmask.mask(this); 2655 }); 2656 if (void 0 === fn) return this.each(function() { 2657 nptmask = new Inputmask(options), nptmask.mask(this); 2658 }); 2659 } 2660 }); 2661 }, function(module, exports, __webpack_require__) { 2662 "use strict"; 2663 var im = __webpack_require__(6), jQuery = __webpack_require__(3);
2664 im.dependencyLib === jQuery && __webpack_require__(13), module.exports = im; 2665 } ], installedModules = {}, __webpack_require__.m = modules, __webpack_require__.c = installedModules, 2666 __webpack_require__.d = function(exports, name, getter) { 2667 __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, { 2668 enumerable: !0, 2669 get: getter 2670 }); 2671 }, __webpack_require__.r = function(exports) { 2672 "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, { 2673 value: "Module" 2674 }), Object.defineProperty(exports, "__esModule", { 2675 value: !0 2676 }); 2677 }, __webpack_require__.t = function(value, mode) { 2678 if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value; 2679 if (4 & mode && "object" == typeof value && value && value.__esModule) return value; 2680 var ns = Object.create(null); 2681 if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", { 2682 enumerable: !0, 2683 value: value 2684 }), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) { 2685 return value[key]; 2686 }.bind(null, key)); 2687 return ns; 2688 }, __webpack_require__.n = function(module) { 2689 var getter = module && module.__esModule ? function getDefault() { 2690 return module.default; 2691 } : function getModuleExports() { 2692 return module; 2693 }; 2694 return __webpack_require__.d(getter, "a", getter), getter; 2695 }, __webpack_require__.o = function(object, property) { 2696 return Object.prototype.hasOwnProperty.call(object, property); 2697 }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 14); 2698 function __webpack_require__(moduleId) { 2699 if (installedModules[moduleId]) return installedModules[moduleId].exports; 2700 var module = installedModules[moduleId] = { 2701 i: moduleId, 2702 l: !1, 2703 exports: {} 2704 }; 2705 return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), 2706 module.l = !0, module.exports; 2707 } 2708 var modules, installedModules; 2709});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.