PageSourceSearch

https://dashboard.cybersecurity-help.cz/assets/plugins/general/inputmask/dist/jquery.inputmask.bundle.js

js cybersecurity-help.cz collected 2026-10-02 16:22:45 UTC 220,965 bytes, 3,867 lines download raw bytes

1/*!
2* jquery.inputmask.bundle.js
3* https://github.com/RobinHerbots/Inputmask
4* Copyright (c) 2010 - 2019 Robin Herbots
5* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
6* Version: 4.0.8
7*/
8
9(function(modules) {
10    var installedModules = {};
11    function __webpack_require__(moduleId) {
12        if (installedModules[moduleId]) {
13            return installedModules[moduleId].exports;
14        }
15        var module = installedModules[moduleId] = {
16            i: moduleId,
17            l: false,
18            exports: {}
19        };
20        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21        module.l = true;
22        return module.exports;
23    }
24    __webpack_require__.m = modules;
25    __webpack_require__.c = installedModules;
26    __webpack_require__.d = function(exports, name, getter) {
27        if (!__webpack_require__.o(exports, name)) {
28            Object.defineProperty(exports, name, {
29                enumerable: true,
30                get: getter
31            });
32        }
33    };
34    __webpack_require__.r = function(exports) {
35        if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
36            Object.defineProperty(exports, Symbol.toStringTag, {
37                value: "Module"
38            });
39        }
40        Object.defineProperty(exports, "__esModule", {
41            value: true
42        });
43    };
44    __webpack_require__.t = function(value, mode) {
45        if (mode & 1) value = __webpack_require__(value);
46        if (mode & 8) return value;
47        if (mode & 4 && typeof value === "object" && value && value.__esModule) return value;
48        var ns = Object.create(null);
49        __webpack_require__.r(ns);
50        Object.defineProperty(ns, "default", {
51            enumerable: true,
52            value: value
53        });
54        if (mode & 2 && typeof value != "string") for (var key in value) __webpack_require__.d(ns, key, function(key) {
55            return value[key];
56        }.bind(null, key));
57        return ns;
58    };
59    __webpack_require__.n = function(module) {
60        var getter = module && module.__esModule ? function getDefault() {
61            return module["default"];
62        } : function getModuleExports() {
63            return module;
64        };
65        __webpack_require__.d(getter, "a", getter);
66        return getter;
67    };
68    __webpack_require__.o = function(object, property) {
69        return Object.prototype.hasOwnProperty.call(object, property);
70    };
71    __webpack_require__.p = "";
72    return __webpack_require__(__webpack_require__.s = 0);
73})([ function(module, exports, __webpack_require__) {
74    "use strict";
75    __webpack_require__(1);
76    __webpack_require__(6);
77    __webpack_require__(7);
78    var _inputmask = __webpack_require__(2);
79    var _inputmask2 = _interopRequireDefault(_inputmask);
80    var _inputmask3 = __webpack_require__(3);
81    var _inputmask4 = _interopRequireDefault(_inputmask3);
82    var _jquery = __webpack_require__(4);
83    var _jquery2 = _interopRequireDefault(_jquery);
84    function _interopRequireDefault(obj) {
85        return obj && obj.__esModule ? obj : {
86            default: obj
87        };
88    }
89    if (_inputmask4.default === _jquery2.default) {
90        __webpack_require__(8);
91    }
92    window.Inputmask = _inputmask2.default;
93}, function(module, exports, __webpack_require__) {
94    "use strict";
95    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
96    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
97        return typeof obj;
98    } : function(obj) {
99        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
100    };
101    (function(factory) {
102        if (true) {
103            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
104            __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
105            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
106        } else {}
107    })(function(Inputmask) {
108        Inputmask.extendDefinitions({
109            A: {
110                validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
111                casing: "upper"
112            },
113            "&": {
114                validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
115                casing: "upper"
116            },
117            "#": {
118                validator: "[0-9A-Fa-f]",
119                casing: "upper"
120            }
121        });
122        Inputmask.extendAliases({
123            cssunit: {
124                regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"
125            },
126            url: {
127                regex: "(https?|ftp)//.*",
128                autoUnmask: false
129            },
130            ip: {
131                mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
132                definitions: {
133                    i: {
134                        validator: function validator(chrs, maskset, pos, strict, opts) {
135                            if (pos - 1 > -1 && maskset.buffer[pos - 1] !== ".") {
136                                chrs = maskset.buffer[pos - 1] + chrs;
137                                if (pos - 2 > -1 && maskset.buffer[pos - 2] !== ".") {
138                                    chrs = maskset.buffer[pos - 2] + chrs;
139                                } else chrs = "0" + chrs;
140                            } else chrs = "00" + chrs;
141                            return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
142                        }
143                    }
144                },
145                onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
146                    return maskedValue;
147                },
148                inputmode: "numeric"
149            },
150            email: {
151                mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
152                greedy: false,
153                casing: "lower",
154                onBeforePaste: function onBeforePaste(pastedValue, opts) {
155                    pastedValue = pastedValue.toLowerCase();
156                    return pastedValue.replace("mailto:", "");
157                },
158                definitions: {
159                    "*": {
160                        validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]"
161                    },
162                    "-": {
163                        validator: "[0-9A-Za-z-]"
164                    }
165                },
166                onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
167                    return maskedValue;
168                },
169                inputmode: "email"
170            },
171            mac: {
172                mask: "##:##:##:##:##:##"
173            },
174            vin: {
175                mask: "V{13}9{4}",
176                definitions: {
177                    V: {
178                        validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
179                        casing: "upper"
180                    }
181                },
182                clearIncomplete: true,
183                autoUnmask: true
184            }
185        });
186        return Inputmask;
187    });
188}, function(module, exports, __webpack_require__) {
189    "use strict";
190    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
191    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
192        return typeof obj;
193    } : function(obj) {
194        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
195    };
196    (function(factory) {
197        if (true) {
198            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(3), __webpack_require__(5) ], 
199            __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
200            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
201        } else {}
202    })(function($, window, undefined) {
203        var document = window.document, ua = navigator.userAgent, ie = ua.indexOf("MSIE ") > 0 || ua.indexOf("Trident/") > 0, mobile = isInputEventSupported("touchstart"), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile;
204        function Inputmask(alias, options, internal) {
205            if (!(this instanceof Inputmask)) {
206                return new Inputmask(alias, options, internal);
207            }
208            this.el = undefined;
209            this.events = {};
210            this.maskset = undefined;
211            this.refreshValue = false;
212            if (internal !== true) {
213                if ($.isPlainObject(alias)) {
214                    options = alias;
215                } else {
216                    options = options || {};
217                    if (alias) options.alias = alias;
218                }
219                this.opts = $.extend(true, {}, this.defaults, options);
220                this.noMasksCache = options && options.definitions !== undefined;
221                this.userOptions = options || {};
222                this.isRTL = this.opts.numericInput;
223                resolveAlias(this.opts.alias, options, this.opts);
224            }
225        }
226        Inputmask.prototype = {
227            dataAttribute: "data-inputmask",
228            defaults: {
229                placeholder: "_",
230                optionalmarker: [ "[", "]" ],
231                quantifiermarker: [ "{", "}" ],
232                groupmarker: [ "(", ")" ],
233                alternatormarker: "|",
234                escapeChar: "\\",
235                mask: null,
236                regex: null,
237                oncomplete: $.noop,
238                onincomplete: $.noop,
239                oncleared: $.noop,
240                repeat: 0,
241                greedy: false,
242                autoUnmask: false,
243                removeMaskOnSubmit: false,
244                clearMaskOnLostFocus: true,
245                insertMode: true,
246                clearIncomplete: false,
247                alias: null,
248                onKeyDown: $.noop,
249                onBeforeMask: null,
250                onBeforePaste: function onBeforePaste(pastedValue, opts) {
251                    return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;
252                },
253                onBeforeWrite: null,
254                onUnMask: null,
255                showMaskOnFocus: true,
256                showMaskOnHover: true,
257                onKeyValidation: $.noop,
258                skipOptionalPartCharacter: " ",
259                numericInput: false,
260                rightAlign: false,
261                undoOnEscape: true,
262                radixPoint: "",
263                _radixDance: false,
264                groupSeparator: "",
265                keepStatic: null,
266                positionCaretOnTab: true,
267                tabThrough: false,
268                supportsInputType: [ "text", "tel", "url", "password", "search" ],
269                ignorables: [ 8, 9, 13, 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 ],
270                isComplete: null,
271                preValidation: null,
272                postValidation: null,
273                staticDefinitionSymbol: undefined,
274                jitMasking: false,
275                nullable: true,
276                inputEventOnly: false,
277                noValuePatching: false,
278                positionCaretOnClick: "lvp",
279                casing: null,
280                inputmode: "verbatim",
281                colorMask: false,
282                disablePredictiveText: false,
283                importDataAttributes: true,
284                shiftPositions: true
285            },
286            definitions: {
287                9: {
288                    validator: "[0-9\uff11-\uff19]",
289                    definitionSymbol: "*"
290                },
291                a: {
292                    validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
293                    definitionSymbol: "*"
294                },
295                "*": {
296                    validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]"
297                }
298            },
299            aliases: {},
300            masksCache: {},
301            mask: function mask(elems) {
302                var that = this;
303                function importAttributeOptions(npt, opts, userOptions, dataAttribute) {
304                    if (opts.importDataAttributes === true) {
305                        var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;
306                        var importOption = function importOption(option, optionData) {
307                            optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + "-" + option);
308                            if (optionData !== null) {
309                                if (typeof optionData === "string") {
310                                    if (option.indexOf("on") === 0) optionData = window[optionData];
310 else if (optionData === "false") optionData = false; else if (optionData === "true") optionData = true;
311                                }
312                                userOptions[option] = optionData;
313                            }
314                        };
315                        if (attrOptions && attrOptions !== "") {
316                            attrOptions = attrOptions.replace(/'/g, '"');
317                            dataoptions = JSON.parse("{" + attrOptions + "}");
318                        }
319                        if (dataoptions) {
320                            optionData = undefined;
321                            for (p in dataoptions) {
322                                if (p.toLowerCase() === "alias") {
323                                    optionData = dataoptions[p];
324                                    break;
325                                }
326                            }
327                        }
328                        importOption("alias", optionData);
329                        if (userOptions.alias) {
330                            resolveAlias(userOptions.alias, userOptions, opts);
331                        }
332                        for (option in opts) {
333                            if (dataoptions) {
334                                optionData = undefined;
335                                for (p in dataoptions) {
336                                    if (p.toLowerCase() === option.toLowerCase()) {
337                                        optionData = dataoptions[p];
338                                        break;
339                                    }
340                                }
341                            }
342                            importOption(option, optionData);
343                        }
344                    }
345                    $.extend(true, opts, userOptions);
346                    if (npt.dir === "rtl" || opts.rightAlign) {
347                        npt.style.textAlign = "right";
348                    }
349                    if (npt.dir === "rtl" || opts.numericInput) {
350                        npt.dir = "ltr";
351                        npt.removeAttribute("dir");
352                        opts.isRTL = true;
353                    }
354                    return Object.keys(userOptions).length;
355                }
356                if (typeof elems === "string") {
357                    elems = document.getElementById(elems) || document.querySelectorAll(elems);
358                }
359                elems = elems.nodeName ? [ elems ] : elems;
360                $.each(elems, function(ndx, el) {
361                    var scopedOpts = $.extend(true, {}, that.opts);
362                    if (importAttributeOptions(el, scopedOpts, $.extend(true, {}, that.userOptions), that.dataAttribute)) {
363                        var maskset = generateMaskSet(scopedOpts, that.noMasksCache);
364                        if (maskset !== undefined) {
365                            if (el.inputmask !== undefined) {
366                                el.inputmask.opts.autoUnmask = true;
367                                el.inputmask.remove();
368                            }
369                            el.inputmask = new Inputmask(undefined, undefined, true);
370                            el.inputmask.opts = scopedOpts;
371                            el.inputmask.noMasksCache = that.noMasksCache;
372                            el.inputmask.userOptions = $.extend(true, {}, that.userOptions);
373                            el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput;
374                            el.inputmask.el = el;
375                            el.inputmask.maskset = maskset;
376                            $.data(el, "_inputmask_opts", scopedOpts);
377                            maskScope.call(el.inputmask, {
378                                action: "mask"
379                            });
380                        }
381                    }
382                });
383                return elems && elems[0] ? elems[0].inputmask || this : this;
384            },
385            option: function option(options, noremask) {
386                if (typeof options === "string") {
387                    return this.opts[options];
388                } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === "object") {
389                    $.extend(this.userOptions, options);
390                    if (this.el && noremask !== true) {
391                        this.mask(this.el);
392                    }
393                    return this;
394                }
395            },
396            unmaskedvalue: function unmaskedvalue(value) {
397                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
398                return maskScope.call(this, {
399                    action: "unmaskedvalue",
400                    value: value
401                });
402            },
403            remove: function remove() {
404                return maskScope.call(this, {
405                    action: "remove"
406                });
407            },
408            getemptymask: function getemptymask() {
409                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
410                return maskScope.call(this, {
411                    action: "getemptymask"
412                });
413            },
414            hasMaskedValue: function hasMaskedValue() {
415                return !this.opts.autoUnmask;
416            },
417            isComplete: function isComplete() {
418                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
419                return maskScope.call(this, {
420                    action: "isComplete"
421                });
422            },
423            getmetadata: function getmetadata() {
424                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
425                return maskScope.call(this, {
426                    action: "getmetadata"
427                });
428            },
429            isValid: function isValid(value) {
430                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
431                return maskScope.call(this, {
432                    action: "isValid",
433                    value: value
434                });
435            },
436            format: function format(value, metadata) {
437                this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);
438                return maskScope.call(this, {
439                    action: "format",
440                    value: value,
441                    metadata: metadata
442                });
443            },
444            setValue: function setValue(value) {
445                if (this.el) {
446                    $(this.el).trigger("setvalue", [ value ]);
447                }
448            },
449            analyseMask: function analyseMask(mask, regexMask, opts) {
450                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 = false, currentToken = new MaskToken(), match, m, openenings = [], maskTokens = [], openingToken, currentOpeningToken, alternator, lastMatch, groupToken;
451                function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {
452                    this.matches = [];
453                    this.openGroup = isGroup || false;
454                    this.alternatorGroup = false;
455                    this.isGroup = isGroup || false;
456                    this.isOptional = isOptional || false;
457                    this.isQuantifier = isQuantifier || false;
458                    this.isAlternator = isAlternator || false;
459                    this.quantifier = {
460                        min: 1,
461                        max: 1
462                    };
463                }
464                function insertTestDefinition(mtoken, element, position) {
465                    position = position !== undefined ? position : mtoken.matches.length;
466                    var prevMatch = mtoken.matches[position - 1];
467                    if (regexMask) {
468                        if (element.indexOf("[") === 0 || escaped && /\\d|\\s|\\w]/i.test(element) || element === ".") {
469                            mtoken.matches.splice(position++, 0, {
470                                fn: new RegExp(element, opts.casing ? "i" : ""),
471                                optionality: false,
472                                newBlockMarker: prevMatch === undefined ? "master" : prevMatch.def !== element,
473                                casing: null,
474                                def: element,
475                                placeholder: undefined,
476                                nativeDef: element
477                            });
478                        } else {
479                            if (escaped) element = element[element.length - 1];
480                            $.each(element.split(""), function(ndx, lmnt) {
481                                prevMatch = mtoken.matches[position - 1];
482                                mtoken.matches.splice(position++, 0, {
483                                    fn: null,
484                                    optionality: false,
485                                    newBlockMarker: prevMatch === undefined ? "master" : prevMatch.def !== lmnt && prevMatch.fn !== null,
486                                    casing: null,
487                                    def: opts.staticDefinitionSymbol || lmnt,
488                                    placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,
489                                    nativeDef: (escaped ? "'" : "") + lmnt
490                                });
491                            });
492                        }
493                        escaped = false;
494                    } else {
495                        var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];
496                        if (maskdef && !escaped) {
497                            mtoken.matches.splice(position++, 0, {
498                                fn: maskdef.validator ? typeof maskdef.validator == "string" ? new RegExp(maskdef.validator, opts.casing ? "i" : "") : new function() {
499                                    this.test = maskdef.validator;
500                                }() : new RegExp("."),
501                                optionality: false,
502                                newBlockMarker: prevMatch === undefined ? "master" : prevMatch.def !== (maskdef.definitionSymbol || element),
503                                casing: maskdef.casing,
504                                def: maskdef.definitionSymbol || element,
505                                placeholder: maskdef.placeholder,
506                                nativeDef: element
507                            });
508                        } else {
509                            mtoken.matches.splice(position++, 0, {
510                                fn: null,
511                                optionality: false,
512                                newBlockMarker: prevMatch === undefined ? "master" : prevMatch.def !== element && prevMatch.fn !== null,
513                                casing: null,
514                                def: opts.staticDefinitionSymbol || element,
515                                placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,
516                                nativeDef: (escaped ? "'" : "") + element
517                            });
518                            escaped = false;
vendor: 5,552 bytes, lines 519-633
519                        }
520                    }
521                }
522                function verifyGroupMarker(maskToken) {
523                    if (maskToken && maskToken.matches) {
524                        $.each(maskToken.matches, function(ndx, token) {
525                            var nextToken = maskToken.matches[ndx + 1];
526                            if ((nextToken === undefined || nextToken.matches === undefined || nextToken.isQuantifier === false) && token && token.isGroup) {
527                                token.isGroup = false;
528                                if (!regexMask) {
529                                    insertTestDefinition(token, opts.groupmarker[0], 0);
530                                    if (token.openGroup !== true) {
531                                        insertTestDefinition(token, opts.groupmarker[1]);
532                                    }
533                                }
534                            }
535                            verifyGroupMarker(token);
536                        });
537                    }
538                }
539                function defaultCase() {
540                    if (openenings.length > 0) {
541                        currentOpeningToken = openenings[openenings.length - 1];
542                        insertTestDefinition(currentOpeningToken, m);
543                        if (currentOpeningToken.isAlternator) {
544                            alternator = openenings.pop();
545                            for (var mndx = 0; mndx < alternator.matches.length; mndx++) {
546                                if (alternator.matches[mndx].isGroup) alternator.matches[mndx].isGroup = false;
547                            }
548                            if (openenings.length > 0) {
549                                currentOpeningToken = openenings[openenings.length - 1];
550                                currentOpeningToken.matches.push(alternator);
551                            } else {
552                                currentToken.matches.push(alternator);
553                            }
554                        }
555                    } else {
556                        insertTestDefinition(currentToken, m);
557                    }
558                }
559                function reverseTokens(maskToken) {
560                    function reverseStatic(st) {
561                        if (st === opts.optionalmarker[0]) st = opts.optionalmarker[1]; else if (st === opts.optionalmarker[1]) st = opts.optionalmarker[0]; else if (st === opts.groupmarker[0]) st = opts.groupmarker[1]; else if (st === opts.groupmarker[1]) st = opts.groupmarker[0];
562                        return st;
563                    }
564                    maskToken.matches = maskToken.matches.reverse();
565                    for (var match in maskToken.matches) {
566                        if (maskToken.matches.hasOwnProperty(match)) {
567                            var intMatch = parseInt(match);
568                            if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {
569                                var qt = maskToken.matches[match];
570                                maskToken.matches.splice(match, 1);
571                                maskToken.matches.splice(intMatch + 1, 0, qt);
572                            }
573                            if (maskToken.matches[match].matches !== undefined) {
574                                maskToken.matches[match] = reverseTokens(maskToken.matches[match]);
575                            } else {
576                                maskToken.matches[match] = reverseStatic(maskToken.matches[match]);
577                            }
578                        }
579                    }
580                    return maskToken;
581                }
582                function groupify(matches) {
583                    var groupToken = new MaskToken(true);
584                    groupToken.openGroup = false;
585                    groupToken.matches = matches;
586                    return groupToken;
587                }
588                if (regexMask) {
589                    opts.optionalmarker[0] = undefined;
590                    opts.optionalmarker[1] = undefined;
591                }
592                while (match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask)) {
593                    m = match[0];
594                    if (regexMask) {
595                        switch (m.charAt(0)) {
596                          case "?":
597                            m = "{0,1}";
598                            break;
599
600                          case "+":
601                          case "*":
602                            m = "{" + m + "}";
603                            break;
604                        }
605                    }
606                    if (escaped) {
607                        defaultCase();
608                        continue;
609                    }
610                    switch (m.charAt(0)) {
611                      case "(?=":
612                        break;
613
614                      case "(?!":
615                        break;
616
617                      case "(?<=":
618                        break;
619
620                      case "(?<!":
621                        break;
622
623                      case opts.escapeChar:
624                        escaped = true;
625                        if (regexMask) {
626                            defaultCase();
627                        }
628                        break;
629
630                      case opts.optionalmarker[1]:
631                      case opts.groupmarker[1]:
632                        openingToken = openenings.pop();
633                        openingToken.openGroup = false;
634                        if (openingToken !== undefined) {
635                            if (openenings.length > 0) {
636                                currentOpeningToken = openenings[openenings.length - 1];
637                                currentOpeningToken.matches.push(openingToken);
638                                if (currentOpeningToken.isAlternator) {
639                                    alternator = openenings.pop();
640                                    for (var mndx = 0; mndx < alternator.matches.length; mndx++) {
641                                        alternator.matches[mndx].isGroup = false;
642                                        alternator.matches[mndx].alternatorGroup = false;
643                                    }
644                                    if (openenings.length > 0) {
645                                        currentOpeningToken = openenings[openenings.length - 1];
646                                        currentOpeningToken.matches.push(alternator);
647                                    } else {
648                                        currentToken.matches.push(alternator);
649                                    }
650                                }
651                            } else {
652                                currentToken.matches.push(openingToken);
653                            }
654                        } else defaultCase();
655                        break;
656
657                      case opts.optionalmarker[0]:
658                        openenings.push(new MaskToken(false, true));
659                        break;
660
661                      case opts.groupmarker[0]:
662                        openenings.push(new MaskToken(true));
663                        break;
664
665                      case opts.quantifiermarker[0]:
666                        var quantifier = new MaskToken(false, false, true);
667                        m = m.replace(/[{}]/g, "");
668                        var mqj = m.split("|"), mq = mqj[0].split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = mq.length === 1 ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
669                        if (mq0 === "*" || mq0 === "+") {
670                            mq0 = mq1 === "*" ? 0 : 1;
671                        }
672                        quantifier.quantifier = {
673                            min: mq0,
674                            max: mq1,
675                            jit: mqj[1]
676                        };
677                        var matches = openenings.length > 0 ? openenings[openenings.length - 1].matches : currentToken.matches;
678                        match = matches.pop();
679                        if (match.isAlternator) {
680                            matches.push(match);
681                            matches = match.matches;
682                            var groupToken = new MaskToken(true);
683                            var tmpMatch = matches.pop();
684                            matches.push(groupToken);
685                            matches = groupToken.matches;
686                            match = tmpMatch;
687                        }
688                        if (!match.isGroup) {
689                            match = groupify([ match ]);
690                        }
691                        matches.push(match);
692                        matches.push(quantifier);
693                        break;
694
695                      case opts.alternatormarker:
696                        var groupQuantifier = function groupQuantifier(matches) {
697                            var lastMatch = matches.pop();
698                            if (lastMatch.isQuantifier) {
699                                lastMatch = groupify([ matches.pop(), lastMatch ]);
700                            }
701                            return lastMatch;
702                        };
703                        if (openenings.length > 0) {
704                            currentOpeningToken = openenings[openenings.length - 1];
705                            var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
706                            if (currentOpeningToken.openGroup && (subToken.matches === undefined || subToken.isGroup === false && subToken.isAlternator === false)) {
707                                lastMatch = openenings.pop();
708                            } else {
709                                lastMatch = groupQuantifier(currentOpeningToken.matches);
710                            }
711                        } else {
712                            lastMatch = groupQuantifier(currentToken.matches);
713                        }
714                        if (lastMatch.isAlternator) {
715                            openenings.push(lastMatch);
716                        } else {
717                            if (lastMatch.alternatorGroup) {
718                                alternator = openenings.pop();
719                                lastMatch.alternatorGroup = false;
720                            } else {
721                                alternator = new MaskToken(false, false, false, true);
722                            }
723                            alternator.matches.push(lastMatch);
724                            openenings.push(alternator);
725                            if (lastMatch.openGroup) {
726                                lastMatch.openGroup = false;
727                                var alternatorGroup = new MaskToken(true);
728                                alternatorGroup.alternatorGroup = true;
729                                openenings.push(alternatorGroup);
730                            }
731                        }
732                        break;
733
734                      default:
735                        defaultCase();
736                    }
737                }
738                while (openenings.length > 0) {
739                    openingToken = openenings.pop();
740                    currentToken.matches.push(openingToken);
741                }
742                if (currentToken.matches.length > 0) {
743                    verifyGroupMarker(currentToken);
744                    maskTokens.push(currentToken);
745                }
746                if (opts.numericInput || opts.isRTL) {
747                    reverseTokens(maskTokens[0]);
748                }
749                return maskTokens;
750            },
751            positionColorMask: function positionColorMask(input, template) {
752                input.style.left = template.offsetLeft + "px";
753            }
754        };
755        Inputmask.extendDefaults = function(options) {
756            $.extend(true, Inputmask.prototype.defaults, options);
757        };
758        Inputmask.extendDefinitions = function(definition) {
759            $.extend(true, Inputmask.prototype.definitions, definition);
760        };
761        Inputmask.extendAliases = function(alias) {
762            $.extend(true, Inputmask.prototype.aliases, alias);
763        };
764        Inputmask.format = function(value, options, metadata) {
765            return Inputmask(options).format(value, metadata);
766        };
767        Inputmask.unmask = function(value, options) {
768            return Inputmask(options).unmaskedvalue(value);
769        };
770        Inputmask.isValid = function(value, options) {
771            return Inputmask(options).isValid(value);
772        };
773        Inputmask.remove = function(elems) {
774            if (typeof elems === "string") {
775                elems = document.getElementById(elems) || document.querySelectorAll(elems);
776            }
777            elems = elems.nodeName ? [ elems ] : elems;
778            $.each(elems, function(ndx, el) {
779                if (el.inputmask) el.inputmask.remove();
780            });
781        };
782        Inputmask.setValue = function(elems, value) {
783            if (typeof elems === "string") {
784                elems = document.getElementById(elems) || document.querySelectorAll(elems);
785            }
786            elems = elems.nodeName ? [ elems ] : elems;
787            $.each(elems, function(ndx, el) {
788                if (el.inputmask) el.inputmask.setValue(value); else $(el).trigger("setvalue", [ value ]);
789            });
790        };
791        Inputmask.escapeRegex = function(str) {
792            var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
793            return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
794        };
795        Inputmask.keyCode = {
796            BACKSPACE: 8,
797            BACKSPACE_SAFARI: 127,
798            DELETE: 46,
799            DOWN: 40,
800            END: 35,
801            ENTER: 13,
802            ESCAPE: 27,
803            HOME: 36,
804            INSERT: 45,
805            LEFT: 37,
806            PAGE_DOWN: 34,
807            PAGE_UP: 33,
808            RIGHT: 39,
809            SPACE: 32,
810            TAB: 9,
811            UP: 38,
812            X: 88,
813            CONTROL: 17
814        };
815        Inputmask.dependencyLib = $;
816        function resolveAlias(aliasStr, options, opts) {
817            var aliasDefinition = Inputmask.prototype.aliases[aliasStr];
818            if (aliasDefinition) {
819                if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts);
820                $.extend(true, opts, aliasDefinition);
821                $.extend(true, opts, options);
822                return true;
823            } else if (opts.mask === null) {
824                opts.mask = aliasStr;
825            }
826            return false;
827        }
828        function generateMaskSet(opts, nocache) {
829            function generateMask(mask, metadata, opts) {
830                var regexMask = false;
831                if (mask === null || mask === "") {
832                    regexMask = opts.regex !== null;
833                    if (regexMask) {
834                        mask = opts.regex;
835                        mask = mask.replace(/^(\^)(.*)(\$)$/, "$2");
836                    } else {
837                        regexMask = true;
838                        mask = ".*";
839                    }
840                }
841                if (mask.length === 1 && opts.greedy === false && opts.repeat !== 0) {
842                    opts.placeholder = "";
843                }
844                if (opts.repeat > 0 || opts.repeat === "*" || opts.repeat === "+") {
845                    var repeatStart = opts.repeat === "*" ? 0 : opts.repeat === "+" ? 1 : opts.repeat;
846                    mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + "," + opts.repeat + opts.quantifiermarker[1];
847                }
848                var masksetDefinition, maskdefKey = regexMask ? "regex_" + opts.regex : opts.numericInput ? mask.split("").reverse().join("") : mask;
849                if (Inputmask.prototype.masksCache[maskdefKey] === undefined || nocache === true) {
850                    masksetDefinition = {
851                        mask: mask,
852                        maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),
853                        validPositions: {},
854                        _buffer: undefined,
855                        buffer: undefined,
856                        tests: {},
857                        excludes: {},
858                        metadata: metadata,
859                        maskLength: undefined,
860                        jitOffset: {}
861                    };
862                    if (nocache !== true) {
863                        Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition;
864                        masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);
865                    }
866                } else masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);
867                return masksetDefinition;
868            }
869            var ms;
870            if ($.isFunction(opts.mask)) {
871                opts.mask = opts.mask(opts);
872            }
873            if ($.isArray(opts.mask)) {
874                if (opts.mask.length > 1) {
875                    if (opts.keepStatic === null) {
876                        opts.keepStatic = "auto";
877                        for (var i = 0; i < opts.mask.length; i++) {
878                            if (opts.mask[i].charAt(0) !== opts.mask[0].charAt(0)) {
879                                opts.keepStatic = true;
880                                break;
881                            }
882                        }
883                    }
884                    var altMask = opts.groupmarker[0];
885                    $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
886                        if (altMask.length > 1) {
887                            altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0];
888                        }
889                        if (msk.mask !== undefined && !$.isFunction(msk.mask)) {
890                            altMask += msk.mask;
891                        } else {
892                            altMask += msk;
893                        }
894                    });
895                    altMask += opts.groupmarker[1];
896                    return generateMask(altMask, opts.mask, opts);
897                } else opts.mask = opts.mask.pop();
898            }
899            if (opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask)) {
900                ms = generateMask(opts.mask.mask, opts.mask, opts);
901            } else {
902                ms = generateMask(opts.mask, opts.mask, opts);
903            }
904            return ms;
905        }
906        function isInputEventSupported(eventName) {
907            var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el;
908            if (!isSupported) {
909                el.setAttribute(evName, "return;");
910                isSupported = typeof el[evName] === "function";
911            }
912            el = null;
913            return isSupported;
914        }
915        function maskScope(actionObj, maskset, opts) {
916            maskset = maskset || this.maskset;
917            opts = opts || this.opts;
918            var inputmask = this, el = this.el, isRTL = this.isRTL, undoValue, $el, skipKeyPressEvent = false, skipInputEvent = false, ignorable = false, maxLength, mouseEnter = false, colorMask, originalPlaceholder;
919            var getMaskTemplate = function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {
920                var greedy = opts.greedy;
921                if (clearOptionalTail) opts.greedy = false;
922                minimalPos = minimalPos || 0;
923                var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, lvp = getLastValidPosition();
924                do {
925                    if (baseOnInput === true && getMaskSet().validPositions[pos]) {
926                        testPos = clearOptionalTail && getMaskSet().validPositions[pos].match.optionality === true && getMaskSet().validPositions[pos + 1] === undefined && (getMaskSet().validPositions[pos].generatedInput === true || getMaskSet().validPositions[pos].input == opts.skipOptionalPartCharacter && pos > 0) ? determineTestTemplate(pos, getTests(pos, ndxIntlzr, pos - 1)) : getMaskSet().validPositions[pos];
927                        test = testPos.match;
928                        ndxIntlzr = testPos.locator.slice();
929                        maskTemplate.push(includeMode === true ? testPos.input : includeMode === false ? test.nativeDef : getPlaceholder(pos, test));
930                    } else {
931                        testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);
932                        test = testPos.match;
933                        ndxIntlzr = testPos.locator.slice();
934                        var jitMasking = noJit === true ? false : opts.jitMasking !== false ? opts.jitMasking : test.jit;
935                        if (jitMasking === false || jitMasking === undefined || typeof jitMasking === "number" && isFinite(jitMasking) && jitMasking > pos) {
936                            maskTemplate.push(includeMode === false ? test.nativeDef : getPlaceholder(pos, test));
937                        }
938                    }
939                    if (opts.keepStatic === "auto") {
940                        if (test.newBlockMarker && test.fn !== null) {
941                            opts.keepStatic = pos - 1;
942                        }
943                    }
944                    pos++;
945                } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== "") || minimalPos > pos);
946                if (maskTemplate[maskTemplate.length - 1] === "") {
947                    maskTemplate.pop();
948                }
949                if (includeMode !== false || getMaskSet().maskLength === undefined) getMaskSet().maskLength = pos - 1;
950                opts.greedy = greedy;
951                return maskTemplate;
952            };
953            function getMaskSet() {
954                return maskset;
955            }
956            function resetMaskSet(soft) {
957                var maskset = getMaskSet();
958                maskset.buffer = undefined;
959                if (soft !== true) {
960                    maskset.validPositions = {};
961                    maskset.p = 0;
962                }
963            }
964            function getLastValidPosition(closestTo, strict, validPositions) {
965                var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;
966                if (closestTo === undefined) closestTo = -1;
967                for (var posNdx in valids) {
968                    var psNdx = parseInt(posNdx);
969                    if (valids[psNdx] && (strict || valids[psNdx].generatedInput !== true)) {
970                        if (psNdx <= closestTo) before = psNdx;
971                        if (psNdx >= closestTo) after = psNdx;
972                    }
973                }
974                return before === -1 || before == closestTo ? after : after == -1 ? before : closestTo - before < after - closestTo ? before : after;
975            }
976            function getDecisionTaker(tst) {
977                var decisionTaker = tst.locator[tst.alternation];
978                if (typeof decisionTaker == "string" && decisionTaker.length > 0) {
979                    decisionTaker = decisionTaker.split(",")[0];
980                }
981                return decisionTaker !== undefined ? decisionTaker.toString() : "";
982            }
983            function getLocator(tst, align) {
984                var locator = (tst.alternation != undefined ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join("");
985                if (locator !== "") while (locator.length < align) {
986                    locator += "0";
987                }
988                return locator;
989            }
990            function determineTestTemplate(pos, tests) {
991                pos = pos > 0 ? pos - 1 : 0;
992                var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch;
993                for (var ndx = 0; ndx < tests.length; ndx++) {
994                    var tst = tests[ndx];
995                    tstLocator = getLocator(tst, targetLocator.length);
996                    var distance = Math.abs(tstLocator - targetLocator);
997                    if (closest === undefined || tstLocator !== "" && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && bestMatch.match.newBlockMarker === "master" && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) {
998                        closest = distance;
999                        bestMatch = tst;
1000                    }
1001                }
1002                return bestMatch;
1003            }
1004            function getTestTemplate(pos, ndxIntlzr, tstPs) {
1005                return getMaskSet().validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));
1006            }
1007            function getTest(pos, tests) {
1008                if (getMaskSet().validPositions[pos]) {
1009                    return getMaskSet().validPositions[pos];
1010                }
1011                return (tests || getTests(pos))[0];
1012            }
1013            function positionCanMatchDefinition(pos, def) {
1014                var valid = false, tests = getTests(pos);
1015                for (var tndx = 0; tndx < tests.length; tndx++) {
1016                    if (tests[tndx].match && tests[tndx].match.def === def) {
1017                        valid = true;
1018                        break;
1019                    }
1020                }
1021                return valid;
1022            }
1023            function getTests(pos, ndxIntlzr, tstPs) {
1024                var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = false, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join("") : "";
1025                function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
1026                    function handleMatch(match, loopNdx, quantifierRecurse) {
1027                        function isFirstMatch(latestMatch, tokenGroup) {
1028                            var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;
1029                            if (!firstMatch) {
1030                                $.each(tokenGroup.matches, function(ndx, match) {
1031                                    if (match.isQuantifier === true) firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]); else if (match.hasOwnProperty("matches")) firstMatch = isFirstMatch(latestMatch, match);
1032                                    if (firstMatch) return false;
1033                                });
1034                            }
1035                            return firstMatch;
1036                        }
1037                        function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
1038                            var bestMatch, indexPos;
1039                            if (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) {
1040                                $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {
1041                                    if (lmnt.mloc[alternateNdx]) {
1042                                        bestMatch = lmnt;
1043                                        return false;
1044                                    }
1045                                    var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;
1046                                    if ((indexPos === undefined || ndxPos < indexPos) && ndxPos !== -1) {
1047                                        bestMatch = lmnt;
1048                                        indexPos = ndxPos;
1049                                    }
1050                                });
1051                            }
1052                            if (bestMatch) {
1053                                var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation];
1054                                var locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator;
1055                                return locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1);
1056                            } else {
1057                                return targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;
1058                            }
1059                        }
1060                        function isSubsetOf(source, target) {
1061                            function expand(pattern) {
1062                                var expanded = [], start, end;
1063                                for (var i = 0, l = pattern.length; i < l; i++) {
1064                                    if (pattern.charAt(i) === "-") {
1065                                        end = pattern.charCodeAt(i + 1);
1066                                        while (++start < end) {
1067                                            expanded.push(String.fromCharCode(start));
1068                                        }
1069                                    } else {
1070                                        start = pattern.charCodeAt(i);
1071                                        expanded.push(pattern.charAt(i));
1072                                    }
1073                                }
1074                                return expanded.join("");
1075                            }
1076                            if (opts.regex && source.match.fn !== null && target.match.fn !== null) {
1077                                return expand(target.match.def.replace(/[\[\]]/g, "")).indexOf(expand(source.match.def.replace(/[\[\]]/g, ""))) !== -1;
1078                            }
1079                            return source.match.def === target.match.nativeDef;
1080                        }
1081                        function staticCanMatchDefinition(source, target) {
1082                            var sloc = source.locator.slice(source.alternation).join(""), tloc = target.locator.slice(target.alternation).join(""), canMatch = sloc == tloc;
1083                            canMatch = canMatch && source.match.fn === null && target.match.fn !== null ? target.match.fn.test(source.match.def, getMaskSet(), pos, false, opts, false) : false;
1084                            return canMatch;
1085                        }
1086                        function setMergeLocators(targetMatch, altMatch) {
1087                            if (altMatch === undefined || targetMatch.alternation === altMatch.alternation && targetMatch.locator[targetMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {
1088                                targetMatch.mloc = targetMatch.mloc || {};
1089                                var locNdx = targetMatch.locator[targetMatch.alternation];
1090                                if (locNdx === undefined) targetMatch.alternation = undefined; else {
1091                                    if (typeof locNdx === "string") locNdx = locNdx.split(",")[0];
1092                                    if (targetMatch.mloc[locNdx] === undefined) targetMatch.mloc[locNdx] = targetMatch.locator.slice();
1093                                    if (altMatch !== undefined) {
1094                                        for (var ndx in altMatch.mloc) {
1095                                            if (typeof ndx === "string") ndx = ndx.split(",")[0];
1096                                            if (targetMatch.mloc[ndx] === undefined) targetMatch.mloc[ndx] = altMatch.mloc[ndx];
1097                                        }
1098                                        targetMatch.locator[targetMatch.alternation] = Object.keys(targetMatch.mloc).join(",");
1099                                    }
1100                                    return true;
1101                                }
1102                            }
1103                            return false;
1104                        }
1105                        if (testPos > 500 && quantifierRecurse !== undefined) {
1106                            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. " + getMaskSet().mask;
1107                        }
1108                        if (testPos === pos && match.matches === undefined) {
1109                            matches.push({
1110                                match: match,
1111                                locator: loopNdx.reverse(),
1112                                cd: cacheDependency,
1113                                mloc: {}
1114                            });
1115                            return true;
1116                        } else if (match.matches !== undefined) {
1117                            if (match.isGroup && quantifierRecurse !== match) {
1118                                match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);
1119                                if (match) return true;
1120                            } else if (match.isOptional) {
1121                                var optionalToken = match;
1122                                match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);
1123                                if (match) {
1124                                    $.each(matches, function(ndx, mtch) {
1125                                        mtch.match.optionality = true;
1126                                    });
1127                                    latestMatch = matches[matches.length - 1].match;
1128                                    if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) {
1129                                        insertStop = true;
1130                                        testPos = pos;
1131                                    } else return true;
1132                                }
1133                            } else if (match.isAlternator) {
1134                                var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length;
1135                                var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;
1136                                if (altIndex === -1 || typeof altIndex === "string") {
1137                                    var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx;
1138                                    if (typeof altIndex == "string") {
1139                                        altIndexArr = altIndex.split(",");
1140                                    } else {
1141                                        for (amndx = 0;
1141 amndx < alternateToken.matches.length; amndx++) {
1142                                            altIndexArr.push(amndx.toString());
1143                                        }
1144                                    }
1145                                    if (getMaskSet().excludes[pos]) {
1146                                        var altIndexArrClone = altIndexArr.slice();
1147                                        for (var i = 0, el = getMaskSet().excludes[pos].length; i < el; i++) {
1148                                            altIndexArr.splice(altIndexArr.indexOf(getMaskSet().excludes[pos][i].toString()), 1);
1149                                        }
1150                                        if (altIndexArr.length === 0) {
1151                                            getMaskSet().excludes[pos] = undefined;
1152                                            altIndexArr = altIndexArrClone;
1153                                        }
1154                                    }
1155                                    if (opts.keepStatic === true || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) altIndexArr = altIndexArr.slice(0, 1);
1156                                    var unMatchedAlternation = false;
1157                                    for (var ndx = 0; ndx < altIndexArr.length; ndx++) {
1158                                        amndx = parseInt(altIndexArr[ndx]);
1159                                        matches = [];
1160                                        ndxInitializer = typeof altIndex === "string" ? resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice() : ndxInitializerClone.slice();
1161                                        if (alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse)) match = true; else if (ndx === 0) {
1162                                            unMatchedAlternation = true;
1163                                        }
1164                                        maltMatches = matches.slice();
1165                                        testPos = currentPos;
1166                                        matches = [];
1167                                        for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
1168                                            var altMatch = maltMatches[ndx1], dropMatch = false;
1169                                            altMatch.match.jit = altMatch.match.jit || unMatchedAlternation;
1170                                            altMatch.alternation = altMatch.alternation || loopNdxCnt;
1171                                            setMergeLocators(altMatch);
1172                                            for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
1173                                                var altMatch2 = malternateMatches[ndx2];
1174                                                if (typeof altIndex !== "string" || altMatch.alternation !== undefined && $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1) {
1175                                                    if (altMatch.match.nativeDef === altMatch2.match.nativeDef) {
1176                                                        dropMatch = true;
1177                                                        setMergeLocators(altMatch2, altMatch);
1178                                                        break;
1179                                                    } else if (isSubsetOf(altMatch, altMatch2)) {
1180                                                        if (setMergeLocators(altMatch, altMatch2)) {
1181                                                            dropMatch = true;
1182                                                            malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);
1183                                                        }
1184                                                        break;
1185                                                    } else if (isSubsetOf(altMatch2, altMatch)) {
1186                                                        setMergeLocators(altMatch2, altMatch);
1187                                                        break;
1188                                                    } else if (staticCanMatchDefinition(altMatch, altMatch2)) {
1189                                                        if (setMergeLocators(altMatch, altMatch2)) {
1190                                                            dropMatch = true;
1191                                                            malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);
1192                                                        }
1193                                                        break;
1194                                                    }
1195                                                }
1196                                            }
1197                                            if (!dropMatch) {
1198                                                malternateMatches.push(altMatch);
1199                                            }
1200                                        }
1201                                    }
1202                                    matches = currentMatches.concat(malternateMatches);
1203                                    testPos = pos;
1204                                    insertStop = matches.length > 0;
1205                                    match = malternateMatches.length > 0;
1206                                    ndxInitializer = ndxInitializerClone.slice();
1207                                } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);
1208                                if (match) return true;
1209                            } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {
1210                                var qt = match;
1211                                for (var qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {
1212                                    var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];
1213                                    match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup);
1214                                    if (match) {
1215                                        latestMatch = matches[matches.length - 1].match;
1216                                        latestMatch.optionalQuantifier = qndx >= qt.quantifier.min;
1217                                        latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit;
1218                                        if (latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) {
1219                                            insertStop = true;
1220                                            testPos = pos;
1221                                            break;
1222                                        }
1223                                        if (latestMatch.jit) {
1224                                            getMaskSet().jitOffset[pos] = tokenGroup.matches.indexOf(latestMatch);
1225                                        }
1226                                        return true;
1227                                    }
1228                                }
1229                            } else {
1230                                match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);
1231                                if (match) return true;
1232                            }
1233                        } else {
1234                            testPos++;
1235                        }
1236                    }
1237                    for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) {
1238                        if (maskToken.matches[tndx].isQuantifier !== true) {
1239                            var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);
1240                            if (match && testPos === pos) {
1241                                return match;
1242                            } else if (testPos > pos) {
1243                                break;
1244                            }
1245                        }
1246                    }
1247                }
1248                function mergeLocators(pos, tests) {
1249                    var locator = [];
1250                    if (!$.isArray(tests)) tests = [ tests ];
1251                    if (tests.length > 0) {
1252                        if (tests[0].alternation === undefined) {
1253                            locator = determineTestTemplate(pos, tests.slice()).locator.slice();
1254                            if (locator.length === 0) locator = tests[0].locator.slice();
1255                        } else {
1256                            $.each(tests, function(ndx, tst) {
1257                                if (tst.def !== "") {
1258                                    if (locator.length === 0) locator = t
1258st.locator.slice(); else {
1259                                        for (var i = 0; i < locator.length; i++) {
1260                                            if (tst.locator[i] && locator[i].toString().indexOf(tst.locator[i]) === -1) {
1261                                                locator[i] += "," + tst.locator[i];
1262                                            }
1263                                        }
1264                                    }
1265                                }
1266                            });
1267                        }
1268                    }
1269                    return locator;
1270                }
1271                if (pos > -1) {
1272                    if (ndxIntlzr === undefined) {
1273                        var previousPos = pos - 1, test;
1274                        while ((test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1) {
1275                            previousPos--;
1276                        }
1277                        if (test !== undefined && previousPos > -1) {
1278                            ndxInitializer = mergeLocators(previousPos, test);
1279                            cacheDependency = ndxInitializer.join("");
1280                            testPos = previousPos;
1281                        }
1282                    }
1283                    if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) {
1284                        return getMaskSet().tests[pos];
1285                    }
1286                    for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
1287                        var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);
1288                        if (match && testPos === pos || testPos > pos) {
1289                            break;
1290                        }
1291                    }
1292                }
1293                if (matches.length === 0 || insertStop) {
1294                    matches.push({
1295                        match: {
1296                            fn: null,
1297                            optionality: false,
1298                            casing: null,
1299                            def: "",
1300                            placeholder: ""
1301                        },
1302                        locator: [],
1303                        mloc: {},
1304                        cd: cacheDependency
1305                    });
1306                }
1307                if (ndxIntlzr !== undefined && getMaskSet().tests[pos]) {
1308                    return $.extend(true, [], matches);
1309                }
1310                getMaskSet().tests[pos] = $.extend(true, [], matches);
1311                return getMaskSet().tests[pos];
1312            }
1313            function getBufferTemplate() {
1314                if (getMaskSet()._buffer === undefined) {
1315                    getMaskSet()._buffer = getMaskTemplate(false, 1);
1316                    if (getMaskSet().buffer === undefined) getMaskSet().buffer = getMaskSet()._buffer.slice();
1317                }
1318                return getMaskSet()._buffer;
1319            }
1320            function getBuffer(noCache) {
1321                if (getMaskSet().buffer === undefined || noCache === true) {
1322                    getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);
1323                    if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();
1324                }
1325                return getMaskSet().buffer;
1326            }
1327            function refreshFromBuffer(start, end, buffer) {
1328                var i, p;
1329                if (start === true) {
1330                    resetMaskSet();
1331                    start = 0;
1332                    end = buffer.length;
1333                } else {
1334                    for (i = start; i < end; i++) {
1335                        delete getMaskSet().validPositions[i];
1336                    }
1337                }
1338                p = start;
1339                for (i = start; i < end; i++) {
1340                    resetMaskSet(true);
1341                    if (buffer[i] !== opts.skipOptionalPartCharacter) {
1342                        var valResult = isValid(p, buffer[i], true, true);
1343                        if (valResult !== false) {
1344                            resetMaskSet(true);
1345                            p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1;
1346                        }
1347                    }
1348                }
1349            }
1350            function casing(elem, test, pos) {
1351                switch (opts.casing || test.casing) {
1352                  case "upper":
1353                    elem = elem.toUpperCase();
1354                    break;
1355
1356                  case "lower":
1357                    elem = elem.toLowerCase();
1358                    break;
1359
1360                  case "title":
1361                    var posBefore = getMaskSet().validPositions[pos - 1];
1362                    if (pos === 0 || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE)) {
1363                        elem = elem.toUpperCase();
1364                    } else {
1365                        elem = elem.toLowerCase();
1366                    }
1367                    break;
1368
1369                  default:
1370                    if ($.isFunction(opts.casing)) {
1371                        var args = Array.prototype.slice.call(arguments);
1372                        args.push(getMaskSet().validPositions);
1373                        elem = opts.casing.apply(this, args);
1374                    }
1375                }
1376                return elem;
1377            }
1378            function checkAlternationMatch(altArr1, altArr2, na) {
1379                var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = false, naArr = na !== undefined ? na.split(",") : [], naNdx;
1380                for (var i = 0; i < naArr.length; i++) {
1381                    if ((naNdx = altArr1.indexOf(naArr[i])) !== -1) {
1382                        altArr1.splice(naNdx, 1);
1383                    }
1384                }
1385                for (var alndx = 0; alndx < altArr1.length; alndx++) {
1386                    if ($.inArray(altArr1[alndx], altArrC) !== -1) {
1387                        isMatch = true;
1388                        break;
1389                    }
1390                }
1391                return isMatch;
1392            }
1393            function alternate(pos, c, strict, fromSetValid, rAltPos) {
1394                var validPsClone = $.extend(true, {}, getMaskSet().validPositions), lastAlt, alternation, isValidRslt = false, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = rAltPos !== undefined ? rAltPos : getLastValidPosition();
1395                if (lAltPos === -1 && rAltPos === undefined) {
1396                    lastAlt = 0;
1397                    prevAltPos = getTest(lastAlt);
1398                    alternation = prevAltPos.alternation;
1399                } else {
1400                    for (;lAltPos >= 0; lAltPos--) {
1401                        altPos = getMaskSet().validPositions[lAltPos];
1402                        if (altPos && altPos.alternation !== undefined) {
1403                            if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) {
1404                                break;
1405                            }
1406                            lastAlt = lAltPos;
1407                            alternation = getMaskSet().validPositions[lastAlt].alternation;
1408                            prevAltPos = altPos;
1409                        }
1410                    }
1411                }
1412                if (alternation !== undefined) {
1413                    decisionPos = parseInt(lastAlt);
1414                    getMaskSet().excludes[decisionPos] = getMaskSet().excludes[decisionPos] || [];
1415                    if (pos !== true) {
1416                        getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));
1417                    }
1418                    var validInputsClone = [], staticInputsBeforePos = 0;
1419                    for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) {
1420                        validPos = getMaskSet().validPositions[i];
1421                        if (validPos && validPos.generatedInput !== true) {
1422                            validInputsClone.push(validPos.input);
1423                        } else if (i < pos) staticInputsBeforePos++;
1424                        delete getMaskSet().validPositions[i];
1425                    }
1426                    while (getMaskSet().excludes[decisionPos] && getMaskSet().excludes[decisionPos].length < 10) {
1427                        var posOffset = staticInputsBeforePos * -1, validInputs = validInputsClone.slice();
1428                        getMaskSet().tests[decisionPos] = undefined;
1429                        resetMaskSet(true);
1430                        isValidRslt = true;
1431                        while (validInputs.length > 0) {
1432                            var input = validInputs.shift();
1433                            if (!(isValidRslt = isValid(getLastValidPosition(undefined, true) + 1, input, false, fromSetValid, true))) {
1434                                break;
1435                            }
1436                        }
1437                        if (isValidRslt && c !== undefined) {
1438                            var targetLvp = getLastValidPosition(pos) + 1;
1439                            for (i = decisionPos; i < getLastValidPosition() + 1; i++) {
1440                                validPos = getMaskSet().validPositions[i];
1441                                if ((validPos === undefined || validPos.match.fn == null) && i < pos + posOffset) {
1442                                    posOffset++;
1443                                }
1444                            }
1445                            pos = pos + posOffset;
1446                            isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, true);
1447                        }
1448                        if (!isValidRslt) {
1449                            resetMaskSet();
1450                            prevAltPos = getTest(decisionPos);
1451                            getMaskSet().validPositions = $.extend(true, {}, validPsClone);
1452                            if (getMaskSet().excludes[decisionPos]) {
1453                                var decisionTaker = getDecisionTaker(prevAltPos);
1454                                if (getMaskSet().excludes[decisionPos].indexOf(decisionTaker) !== -1) {
1455                                    isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);
1456                                    break;
1457                                }
1458                                getMaskSet().excludes[decisionPos].push(decisionTaker);
1459                                for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) {
1460                                    delete getMaskSet().validPositions[i];
1461                                }
1462                            } else {
1463                                isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);
1464                                break;
1465                            }
1466                        } else break;
1467                    }
1468                }
1469                getMaskSet().excludes[decisionPos] = undefined;
1470                return isValidRslt;
1471            }
1472            function isValid(pos, c, strict, fromSetValid, fromAlternate, validateOnly) {
1473                function isSelection(posObj) {
1474                    return isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end === 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin === 1;
1475                }
1476                strict = strict === true;
1477                var maskPos = pos;
1478                if (pos.begin !== undefined) {
1479                    maskPos = isRTL ? pos.end : pos.begin;
1480                }
1481                function _isValid(position, c, strict) {
1482                    var rslt = false;
1483                    $.each(getTests(position), function(ndx, tst) {
1484                        var test = tst.match;
1485                        getBuffer(true);
1486                        rslt = test.fn != null ? test.fn.test(c, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== "" ? {
1487                            c: getPlaceholder(position, test, true) || test.def,
1488                            pos: position
1489                        } : false;
1490                        if (rslt !== false) {
1491                            var elem = rslt.c !== undefined ? rslt.c : c, validatedPos = position;
1492                            elem = elem === opts.skipOptionalPartCharacter && test.fn === null ? getPlaceholder(position, test, true) || test.def : elem;
1493                            if (rslt.remove !== undefined) {
1494                                if (!$.isArray(rslt.remove)) rslt.remove = [ rslt.remove ];
1495                                $.each(rslt.remove.sort(function(a, b) {
1496                                    return b - a;
1497                                }), function(ndx, lmnt) {
1498                                    revalidateMask({
1499                                        begin: lmnt,
1500                                        end: lmnt + 1
1501                                    });
1502                                });
1503                            }
1504                            if (rslt.insert !== undefined) {
1505                                if (!$.isArray(rslt.insert)) rslt.insert = [ rslt.insert ];
1506                                $.each(rslt.insert.sort(function(a, b) {
1507                                    return a - b;
1508                                }), function(ndx, lmnt) {
1509                                    isValid(lmnt.pos, lmnt.c, true, fromSetValid);
1510                                });
1511                            }
1512                            if (rslt !== true && rslt.pos !== undefined && rslt.pos !== position) {
1513                                validatedPos = rslt.pos;
1514                            }
1515                            if (rslt !== true && rslt.pos === undefined && rslt.c === undefined) {
1516                                return false;
1517                            }
1518                            if (!revalidateMask(pos, $.extend({}, tst, {
1519                                input: casing(elem, test, validatedPos)
1520                            }), fromSetValid, validatedPos)) {
1521                                rslt = false;
1522                            }
1523                            return false;
1524                        }
1525                    });
1526                    return rslt;
1527                }
1528                var result = true, positionsClone = $.extend(true, {}, getMaskSet().validPositions);
1529                if ($.isFunction(opts.preValidation) && !strict && fromSetValid !== true && validateOnly !== true) {
1530                    result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts, getMaskSet());
1531                }
1532                if (result === true) {
1533                    trackbackPositions(undefined, maskPos, true);
1534                    if (maxLength === undefined || maskPos < maxLength) {
1535                        result = _isValid(maskPos, c, strict);
1536                        if ((!strict || fromSetValid === true) && result === false && validateOnly !== true) {
1537                            var currentPosValid = getMaskSet().validPositions[maskPos];
1538                            if (currentPosValid && currentPosValid.match.fn === null && (currentPosValid.match.def === c || c === opts.skipOptionalPartCharacter)) {
1539                                result = {
1540                                    caret: seekNext(maskPos)
1541                                };
1542                            } else {
1543                                if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && (!isMask(maskPos, true) || getMaskSet().jitOffset[maskPos])) {
1544                                    if (getMaskSet().jitOffset[maskPos] && getMaskSet().validPositions[seekNext(maskPos)] === undefined) {
1545                                        result = isValid(maskPos + getMaskSet().jitOffset[maskPos], c, strict);
1546                                        if (result !== false) result.caret = maskPos;
1547                                    } else for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) {
1548                                        result = _isValid(nPos, c, strict);
1549                                        if (result !== false) {
1550                                            result = trackbackPositions(maskPos, result.pos !== undefined ? result.pos : nPos) || result;
1551                                            maskPos = nPos;
1552                                            break;
1553                                        }
1554                                    }
1555                                }
1556                            }
1557                        }
1558                    }
1559                    if (result === false && opts.keepStatic !== false && (opts.regex == null || isComplete(getBuffer())) && !strict && fromAlternate !== true) {
1560                        result = alternate(maskPos, c, strict, fromSetValid);
1561                    }
1562                    if (result === true) {
1563                        result = {
1564                            pos: maskPos
1565                        };
1566                    }
1567                }
1568                if ($.isFunction(opts.postValidation) && result !== false && !strict && fromSetValid !== true && validateOnly !== true) {
1569                    var postResult = opts.postValidation(getBuffer(true), pos.begin !== undefined ? isRTL ? pos.end : pos.begin : pos, result, opts);
1570                    if (postResult !== undefined) {
1571                        if (postResult.refreshFromBuffer && postResult.buffer) {
1572                            var refresh = postResult.refreshFromBuffer;
1573                            refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, postResult.buffer);
1574                        }
1575                        result = postResult === true ? result : postResult;
1576                    }
1577                }
1578                if (result && result.pos === undefined) {
1579                    result.pos = maskPos;
1580                }
1581                if (result === false || validateOnly === true) {
1582                    resetMaskSet(true);
1583                    getMaskSet().validPositions = $.extend(true, {}, positionsClone);
1584                }
1585                return result;
1586            }
1587            function trackbackPositions(originalPos, newPos, fillOnly) {
1588                var result;
1589                if (originalPos === undefined) {
1590                    for (originalPos = newPos - 1; originalPos > 0; originalPos--) {
1591                        if (getMaskSet().validPositions[originalPos]) break;
1592                    }
1593                }
1594                for (var ps = originalPos; ps < newPos; ps++) {
1595                    if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {
1596                        var vp = ps == 0 ? getTest(ps) : getMaskSet().validPositions[ps - 1];
1597                        if (vp) {
1598                            var tests = getTests(ps).slice();
1599                            if (tests[tests.length - 1].match.def === "") tests.pop();
1600                            var bestMatch = determineTestTemplate(ps, tests);
1601                            bestMatch = $.extend({}, bestMatch, {
1602                                input: getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def
1603                            });
1604                            bestMatch.generatedInput = true;
1605                            revalidateMask(ps, bestMatch, true);
1606                            if (fillOnly !== true) {
1607                                var cvpInput = getMaskSet().validPositions[newPos].input;
1608                                getMaskSet().validPositions[newPos] = undefined;
1609                                result = isValid(newPos, cvpInput, true, true);
1610                            }
1611                        }
1612                    }
1613                }
1614                return result;
1615            }
1616            function revalidateMask(pos, validTest, fromSetValid, validatedPos) {
1617                function IsEnclosedStatic(pos, valids, selection) {
1618                    var posMatch = valids[pos];
1619                    if (posMatch !== undefined && (posMatch.match.fn === null && posMatch.match.optionality !== true || posMatch.input === opts.radixPoint)) {
1620                        var prevMatch = selection.begin <= pos - 1 ? valids[pos - 1] && valids[pos - 1].match.fn === null && valids[pos - 1] : valids[pos - 1], nextMatch = selection.end > pos + 1 ? valids[pos + 1] && valids[pos + 1].match.fn === null && valids[pos + 1] : valids[pos + 1];
1621                        return prevMatch && nextMatch;
1622                    }
1623                    return false;
1624                }
1625                var begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos;
1626                if (pos.begin > pos.end) {
1627                    begin = pos.end;
1628                    end = pos.begin;
1629                }
1630                validatedPos = validatedPos !== undefined ? validatedPos : begin;
1631                if (begin !== end || opts.insertMode && getMaskSet().validPositions[validatedPos] !== undefined && fromSetValid === undefined) {
1632                    var positionsClone = $.extend(true, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, true), i;
1633                    getMaskSet().p = begin;
1634                    for (i = lvp; i >= begin; i--) {
1635                        if (getMaskSet().validPositions[i] && getMaskSet().validPositions[i].match.nativeDef === "+") {
1636                            opts.isNegative = false;
1637                        }
1638                        delete getMaskSet().validPositions[i];
1639                    }
1640                    var valid = true, j = validatedPos, vps = getMaskSet().validPositions, needsValidation = false, posMatch = j, i = j;
1641                    if (validTest) {
1642                        getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);
1643                        posMatch++;
1644                        j++;
1645                        if (begin < end) i++;
1646                    }
1647                    for (;i <= lvp; i++) {
1648                        var t = positionsClone[i];
1649                        if (t !== undefined && (i >= end || i >= begin && t.generatedInput !== true && IsEnclosedStatic(i, positionsClone, {
1650                            begin: begin,
1651                            end: end
1652                        }))) {
1653                            while (getTest(posMatch).match.def !== "") {
1654                                if (needsValidation === false && positionsClone[posMatch] && positionsClone[posMatch].match.nativeDef === t.match.nativeDef) {
1655                                    getMaskSet().validPositions[posMatch] = $.extend(true, {}, positionsClone[posMatch]);
1656                                    getMaskSet().validPositions[posMatch].input = t.input;
1657                                    trackbackPositions(undefined, posMatch, true);
1658                                    j = posMatch + 1;
1659                                    valid = true;
1660                                } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {
1661                                    var result = isValid(posMatch, t.input, true, true);
1662                                    valid = result !== false;
1663                                    j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;
1664                                    needsValidation = true;
1665                                } else {
1666                                    valid = t.generatedInput === true || t.input === opts.radixPoint && opts.numericInput === true;
1667                                }
1668                                if (valid) break;
1669                                if (!valid && posMatch > end && isMask(posMatch, true) && (t.match.fn !== null || posMatch > getMaskSet().maskLength)) {
1670                                    break;
1671                                }
1672                                posMatch++;
1673                            }
1674                            if (getTest(posMatch).match.def == "") valid = false;
1675                            posMatch = j;
1676                        }
1677                        if (!valid) break;
1678                    }
1679                    if (!valid) {
1680                        getMaskSet().validPositions = $.extend(true, {}, positionsClone);
1681                        resetMaskSet(true);
1682                        return false;
1683                    }
1684                } else if (validTest) {
1685                    getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);
1686                }
1687                resetMaskSet(true);
1688                return true;
1689            }
1690            function isMask(pos, strict) {
1691                var test = getTestTemplate(pos).match;
1692                if (test.def === "") test = getTest(pos).match;
1693                if (test.fn != null) {
1694                    return test.fn;
1695                }
1696                if (strict !== true && pos > -1) {
1697                    var tests = getTests(pos);
1698                    return tests.length > 1 + (tests[tests.length - 1].match.def === "" ? 1 : 0);
1699                }
1700                return false;
1701            }
1702            function seekNext(pos, newBlock) {
1703                var position = pos + 1;
1704                while (getTest(position).match.def !== "" && (newBlock === true && (getTest(position).match.newBlockMarker !== true || !isMask(position)) || newBlock !== true && !isMask(position))) {
1705                    position++;
1706                }
1707                return position;
1708            }
1709            function seekPrevious(pos, newBlock) {
1710                var position = pos, tests;
1711                if (position <= 0) return 0;
1712                while (--position > 0 && (newBlock === true && getTest(position).match.newBlockMarker !== true || newBlock !== true && !isMask(position) && (tests = getTests(position), 
1713                tests.length < 2 || tests.length === 2 && tests[1].match.def === ""))) {}
1714                return position;
1715            }
1716            function writeBuffer(input, buffer, caretPos, event, triggerEvents) {
1717                if (event && $.isFunction(opts.onBeforeWrite)) {
1718                    var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);
1719                    if (result) {
1720                        if (result.refreshFromBuffer) {
1721                            var refresh = result.refreshFromBuffer;
1722                            refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, result.buffer || buffer);
1723                            buffer = getBuffer(true);
1724                        }
1725                        if (caretPos !== undefined) caretPos = result.caret !== undefined ? result.caret : caretPos;
1726                    }
1727                }
1728                if (input !== undefined) {
1729                    input.inputmask._valueSet(buffer.join(""));
1730                    if (caretPos !== undefined && (event === undefined || event.type !== "blur")) {
1731                        caret(input, caretPos);
1732                    } else renderColorMask(input, caretPos, buffer.length === 0);
1733                    if (triggerEvents === true) {
1734                        var $input = $(input), nptVal = input.inputmask._valueGet();
1735                        skipInputEvent = true;
1736                        $input.trigger("input");
1737                        setTimeout(function() {
1738                            if (nptVal === getBufferTemplate().join("")) {
1739                                $input.trigger("cleared");
1740                            } else if (isComplete(buffer) === true) {
1741                                $input.trigger("complete");
1742                            }
1743                        }, 0);
1744                    }
1745                }
1746            }
1747            function getPlaceholder(pos, test, returnPL) {
1748                test = test || getTest(pos).match;
1749                if (test.placeholder !== undefined || returnPL === true) {
1750                    return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;
1751                } else if (test.fn === null) {
1752                    if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {
1753                        var tests = getTests(pos), staticAlternations = [], prevTest;
1754                        if (tests.length > 1 + (tests[tests.length - 1].match.def === "" ? 1 : 0)) {
1755                            for (var i = 0; i < tests.length; i++) {
1756                                if (tests[i].match.optionality !== true && tests[i].match.optionalQuantifier !== true && (tests[i].match.fn === null || prevTest === undefined || tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, true, opts) !== false)) {
1757                                    staticAlternations.push(tests[i]);
1758                                    if (tests[i].match.fn === null) prevTest = tests[i];
1759                                    if (staticAlternations.length > 1) {
1760                                        if (/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)) {
1761                                            return opts.placeholder.charAt(pos % opts.placeholder.length);
1762                                        }
1763                                    }
1764                                }
1765                            }
1766                        }
1767                    }
1768                    return test.def;
1769                }
1770                return opts.placeholder.charAt(pos % opts.placeholder.length);
1771            }
1772            function HandleNativePlaceholder(npt, value) {
1773                if (ie) {
1774                    if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || npt.placeholder === "")) {
1775                        var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet();
1776                        if (nptValue !== value) {
1777                            var lvp = getLastValidPosition();
1778                            if (lvp === -1 && nptValue === getBufferTemplate().join("")) {
1779                                buffer = [];
1780                            } else if (lvp !== -1) {
1781                                clearOptionalTail(buffer);
1782                            }
1783                            writeBuffer(npt, buffer);
1784                        }
1785                    }
1786                } else if (npt.placeholder !== value) {
1787                    npt.placeholder = value;
1788                    if (npt.placeholder === "") npt.removeAttribute("placeholder");
1789                }
1790            }
1791            var EventRuler = {
1792                on: function on(input, eventName, eventHandler) {
1793                    var ev = function ev(e) {
1794                        var that = this;
1795                        if (that.inputmask === undefined && this.nodeName !== "FORM") {
1796                            var imOpts = $.data(that, "_inputmask_opts");
1797                            if (imOpts) new Inputmask(imOpts).mask(that); else EventRuler.off(that);
1798                        } else if (e.type !== "setvalue" && this.nodeName !== "FORM" && (that.disabled || that.readOnly && !(e.type === "keydown" && e.ctrlKey && e.keyCode === 67 || opts.tabThrough === false && e.keyCode === Inputmask.keyCode.TAB))) {
1799                            e.preventDefault();
1800                        } else {
1801                            switch (e.type) {
1802                              case "input":
1803                                if (skipInputEvent === true) {
1804                                    skipInputEvent = false;
1805                                    return e.preventDefault();
1806                                }
1807                                if (mobile) {
1808                                    var args = arguments;
1809                                    setTimeout(function() {
1810                                        eventHandler.apply(that, args);
1811                                        caret(that, that.inputmask.caretPos, undefined, true);
1812                                    }, 0);
1813                                    return false;
1814                                }
1815                                break;
1816
1817                              case "keydown":
1818                                skipKeyPressEvent = false;
1819                                skipInputEvent = false;
1820                                break;
1821
1822                              case "keypress":
1823                                if (skipKeyPressEvent === true) {
1824                                    return e.preventDefault();
1825                                }
1826                                skipKeyPressEvent = true;
1827                                break;
1828
1829                              case "click":
1830                                if (iemobile || iphone) {
1831                                    var args = arguments;
1832                                    setTimeout(function() {
1833                                        eventHandler.apply(that, args);
1834                                    }, 0);
1835                                    return false;
1836                                }
1837                                break;
1838                            }
1839                            var returnVal = eventHandler.apply(that, arguments);
1840                            if (returnVal === false) {
1841                                e.preventDefault();
1842                                e.stopPropagation();
1843                            }
1844                            return returnVal;
1845                        }
1846                    };
1847                    input.inputmask.events[eventName] = input.inputmask.events[eventName] || [];
1848                    input.inputmask.events[eventName].push(ev);
1849                    if ($.inArray(eventName, [ "submit", "reset" ]) !== -1) {
1850                        if (input.form !== null) $(input.form).on(eventName, ev);
1851                    } else {
1852                        $(input).on(eventName, ev);
1853                    }
1854                },
1855                off: function off(input, event) {
1856                    if (input.inputmask && input.inputmask.events) {
1857                        var events;
1858                        if (event) {
1859                            events = [];
1860                            events[event] = input.inputmask.events[event];
1861                        } else {
1862                            events = input.inputmask.events;
1863                        }
1864                        $.each(events, function(eventName, evArr) {
1865                            while (evArr.length > 0) {
1866                                var ev = evArr.pop();
1867                                if ($.inArray(eventName, [ "submit", "reset" ]) !== -1) {
1868                                    if (input.form !== null) $(input.form).off(eventName, ev);
1869                                } else {
1870                                    $(input).off(eventName, ev);
1871                                }
1872                            }
1873                            delete input.inputmask.events[eventName];
1874                        });
1875                    }
1876                }
1877            };
1878            var EventHandlers = {
1879                keydownEvent: function keydownEvent(e) {
1880                    var input = this, $input = $(input), k = e.keyCode, pos = caret(input);
1881                    if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !isInputEventSupported("cut")) {
1882                        e.preventDefault();
1883                        handleRemove(input, k, pos);
1884                        writeBuffer(input, getBuffer(true), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(""));
1885                    } else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {
1886                        e.preventDefault();
1887                        var caretPos = seekNext(getLastValidPosition());
1888                        caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, true);
1889                    } else if (k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP) {
1890                        e.preventDefault();
1891                        caret(input, 0, e.shiftKey ? pos.begin : 0, true);
1892                    } else if ((opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || k === 90 && e.ctrlKey) && e.altKey !== true) {
1893                        checkVal(input, true, false, undoValue.split(""));
1894                        $input.trigger("click");
1895                    } else if (k === Inputmask.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) {
1896                        opts.insertMode = !opts.insertMode;
1897                        input.setAttribute("im-insert", opts.insertMode);
1898                    } else if (opts.tabThrough === true && k === Inputmask.keyCode.TAB) {
1899                        if (e.shiftKey === true) {
1900                            if (getTest(pos.begin).match.fn === null) {
1901                                pos.begin = seekNext(pos.begin);
1902                            }
1903                            pos.end = seekPrevious(pos.begin, true);
1904                            pos.begin = seekPrevious(pos.end, true);
1905                        } else {
1906                            pos.begin = seekNext(pos.begin, true);
1907                            pos.end = seekNext(pos.begin, true);
1908                            if (pos.end < getMaskSet().maskLength) pos.end--;
1909                        }
1910                        if (pos.begin < getMaskSet().maskLength) {
1911                            e.preventDefault();
1912                            caret(input, pos.begin, pos.end);
1913                        }
1914                    }
1915                    opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts);
1916                    ignorable = $.inArray(k, opts.ignorables) !== -1;
1917                },
1918                keypressEvent: function keypressEvent(e, checkval, writeOut, strict, ndx) {
1919                    var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
1920                    if (checkval !== true && !(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) {
1921                        if (k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join("")) {
1922                            undoValue = getBuffer().join("");
1923                            setTimeout(function() {
1924                                $input.trigger("change");
1925                            }, 0);
1926                        }
1927                        return true;
1928                    } else {
1929                        if (k) {
1930                            if (k === 46 && e.shiftKey === false && opts.radixPoint !== "") k = opts.radixPoint.charCodeAt(0);
1931                            var pos = checkval ? {
1932                                begin: ndx,
1933                                end: ndx
1934                            } : caret(input), forwardPosition, c = String.fromCharCode(k), offset = 0;
1935                            if (opts._radixDance && opts.numericInput) {
1936                                var caretPos = getBuffer().indexOf(opts.radixPoint.charAt(0)) + 1;
1937                                if (pos.begin <= caretPos) {
1938                                    if (k === opts.radixPoint.charCodeAt(0)) offset = 1;
1939                                    pos.begin -= 1;
1940                                    pos.end -= 1;
1941                                }
1942                            }
1943                            getMaskSet().writeOutBuffer = true;
1944                            var valResult = isValid(pos, c, strict);
1945                            if (valResult !== false) {
1946                                resetMaskSet(true);
1947                                forwardPosition = valResult.caret !== undefined ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos);
1948                                getMaskSet().p = forwardPosition;
1949                            }
1950                            forwardPosition = (opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition) + offset;
1951                            if (writeOut !== false) {
1952                                setTimeout(function() {
1953                                    opts.onKeyValidation.call(input, k, valResult, opts);
1954                                }, 0);
1955                                if (getMaskSet().writeOutBuffer && valResult !== false) {
1956                                    var buffer = getBuffer();
1957                                    writeBuffer(input, buffer, forwardPosition, e, checkval !== true);
1958                                }
1959                            }
1960                            e.preventDefault();
1961                            if (checkval) {
1962                                if (valResult !== false) valResult.forwardPosition = forwardPosition;
1963                                return valResult;
1964                            }
1965                        }
1966                    }
1967                },
1968                pasteEvent: function pasteEvent(e) {
1969                    var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(true), caretPos = caret(input), tempValue;
1970                    if (isRTL) {
1971                        tempValue = caretPos.end;
1972                        caretPos.end = caretPos.begin;
1973                        caretPos.begin = tempValue;
1974                    }
1975                    var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
1976                    if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join("")) valueBeforeCaret = "";
1977                    if (valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join("")) valueAfterCaret = "";
1978                    if (window.clipboardData && window.clipboardData.getData) {
1979                        inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret;
1980                    } else if (ev.clipboardData && ev.clipboardData.getData) {
1981                        inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret;
1982                    } else return true;
1983                    var pasteValue = inputValue;
1984                    if ($.isFunction(opts.onBeforePaste)) {
1985                        pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts);
1986                        if (pasteValue === false) {
1987                            return e.preventDefault();
1988                        }
1989                        if (!pasteValue) {
1990                            pasteValue = inputValue;
1991                        }
1992                    }
1993                    checkVal(input, false, false, pasteValue.toString().split(""));
1994                    writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(""));
1995                    return e.preventDefault();
1996                },
1997                inputFallBackEvent: function inputFallBackEvent(e) {
1998                    function radixPointHandler(input, inputValue, caretPos) {
1999                        if (inputValue.charAt(caretPos.begin - 1) === "." && opts.radixPoint !== "") {
2000                            inputValue = inputValue.split("");
2001                            inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0);
2002                            inputValue = inputValue.join("");
2003                        }
2004                        return inputValue;
2005                    }
2006                    function ieMobileHandler(input, inputValue, caretPos) {
2007                        if (iemobile) {
2008                            var inputChar = inputValue.replace(getBuffer().join(""), "");
2009                            if (inputChar.length === 1) {
2010                                var iv = inputValue.split("");
2011                                iv.splice(caretPos.begin, 0, inputChar);
2012                                inputValue = iv.join("");
2013                            }
2014                        }
2015                        return inputValue;
2016                    }
2017                    var input = this, inputValue = input.inputmask._valueGet();
2018                    if (getBuffer().join("") !== inputValue) {
2019                        var caretPos = caret(input);
2020                        inputValue = radixPointHandler(input, inputValue, caretPos);
2021                        inputValue = ieMobileHandler(input, inputValue, caretPos);
2022                        if (getBuffer().join("") !== inputValue) {
2023                            var buffer = getBuffer().join(""), offset = !opts.numericInput && inputValue.length > buffer.length ? -1 : 0, frontPart = inputValue.substr(0, caretPos.begin), backPart = inputValue.substr(caretPos.begin), frontBufferPart = buffer.substr(0, caretPos.begin + offset), backBufferPart = buffer.substr(caretPos.begin + offset);
2024                            var selection = caretPos, entries = "", isEntry = false;
2025                            if (frontPart !== frontBufferPart) {
2026                                var fpl = (isEntry = frontPart.length >= frontBufferPart.length) ? frontPart.length : frontBufferPart.length, i;
2027                                for (i = 0; frontPart.charAt(i) === frontBufferPart.charAt(i) && i < fpl; i++) {}
2028                                if (isEntry) {
2029                                    selection.begin = i - offset;
2030                                    entries += frontPart.slice(i, selection.end);
2031                                }
2032                            }
2033                            if (backPart !== backBufferPart) {
2034                                if (backPart.length > backBufferPart.length) {
2035                                    entries += backPart.slice(0, 1);
2036                                } else {
2037                                    if (backPart.length < backBufferPart.length) {
2038                                        selection.end += backBufferPart.length - backPart.length;
2039                                        if (!isEntry && opts.radixPoint !== "" && backPart === "" && frontPart.charAt(selection.begin + offset - 1) === opts.radixPoint) {
2040                                            selection.begin--;
2041                                            entries = opts.radixPoint;
2042                                        }
2043                                    }
2044                                }
2045                            }
2046                            writeBuffer(input, getBuffer(), {
2047                                begin: selection.begin + offset,
2048                                end: selection.end + offset
2049                            });
2050                            if (entries.length > 0) {
2051                                $.each(entries.split(""), function(ndx, entry) {
2052                                    var keypress = new $.Event("keypress");
2053                                    keypress.which = entry.charCodeAt(0);
2054                                    ignorable = false;
2055                                    EventHandlers.keypressEvent.call(input, keypress);
2056                                });
2057                            } else {
2058                                if (selection.begin === selection.end - 1) {
2059                                    selection.begin = seekPrevious(selection.begin + 1);
2060                                    if (selection.begin === selection.end - 1) {
2061                                        caret(input, selection.begin);
2062                                    } else {
2063                                        caret(input, selection.begin, selection.end);
2064                                    }
2065                                }
2066                                var keydown = new $.Event("keydown");
2067                                keydown.keyCode = opts.numericInput ? Inputmask.keyCode.BACKSPACE : Inputmask.keyCode.DELETE;
2068                                EventHandlers.keydownEvent.call(input, keydown);
2069                            }
2070                            e.preventDefault();
2071                        }
2072                    }
2073                },
2074                beforeInputEvent: function beforeInputEvent(e) {
2075                    if (e.cancelable) {
2076                        var input = this;
2077                        switch (e.inputType) {
2078                          case "insertText":
2079                            $.each(e.data.split(""), function(ndx, entry) {
2080                                var keypress = new $.Event("keypress");
2081                                keypress.which = entry.charCodeAt(0);
2082                                ignorable = false;
2083                                EventHandlers.keypressEvent.call(input, keypress);
2084                            });
2085                            return e.preventDefault();
2086
2087                          case "deleteContentBackward":
2088                            var keydown = new $.Event("keydown");
2089                            keydown.keyCode = Inputmask.keyCode.BACKSPACE;
2090                            EventHandlers.keydownEvent.call(input, keydown);
2091                            return e.preventDefault();
2092
2093                          case "deleteContentForward":
2094                            var keydown = new $.Event("keydown");
2095                            keydown.keyCode = Inputmask.keyCode.DELETE;
2096                            EventHandlers.keydownEvent.call(input, keydown);
2097                            return e.preventDefault();
2098                        }
2099                    }
2100                },
2101                setValueEvent: function setValueEvent(e) {
2102                    this.inputmask.refreshValue = false;
2103                    var input = this, value = e && e.detail ? e.detail[0] : arguments[1], value = value || input.inputmask._valueGet(true);
2104                    if ($.isFunction(opts.onBeforeMask)) value = opts.onBeforeMask.call(inputmask, value, opts) || value;
2105                    value = value.toString().split("");
2106                    checkVal(input, true, false, value);
2107                    undoValue = getBuffer().join("");
2108                    if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("")) {
2109                        input.inputmask._valueSet("");
2110                    }
2111                },
2112                focusEvent: function focusEvent(e) {
2113                    var input = this, nptValue = input.inputmask._valueGet();
2114                    if (opts.showMaskOnFocus) {
2115                        if (nptValue !== getBuffer().join("")) {
2116                            writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));
2117                        } else if (mouseEnter === false) {
2118                            caret(input, seekNext(getLastValidPosition()));
2119                        }
2120                    }
2121                    if (opts.positionCaretOnTab === true && mouseEnter === false) {
2122                        EventHandlers.clickEvent.apply(input, [ e, true ]);
2123                    }
2124                    undoValue = getBuffer().join("");
2125                },
2126                mouseleaveEvent: function mouseleaveEvent(e) {
2127                    var input = this;
2128                    mouseEnter = false;
2129                    if (opts.clearMaskOnLostFocus && document.activeElement !== input) {
2130                        HandleNativePlaceholder(input, originalPlaceholder);
2131                    }
2132                },
2133                clickEvent: function clickEvent(e, tabbed) {
2134                    function doRadixFocus(clickPos) {
2135                        if (opts.radixPoint !== "") {
2136                            var vps = getMaskSet().validPositions;
2137                            if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {
2138                                if (clickPos < seekNext(-1)) return true;
2139                                var radixPos = $.inArray(opts.radixPoint, getBuffer());
2140                                if (radixPos !== -1) {
2141                                    for (var vp in vps) {
2142                                        if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) {
2143                                            return false;
2144                                        }
2145                                    }
2146                                    return true;
2147                                }
2148                            }
2149                        }
2150                        return false;
2151                    }
2152                    var input = this;
2153                    setTimeout(function() {
2154                        if (document.activeElement === input) {
2155                            var selectedCaret = caret(input);
2156                            if (tabbed) {
2157                                if (isRTL) {
2158                                    selectedCaret.end = selectedCaret.begin;
2159                                } else {
2160                                    selectedCaret.begin = selectedCaret.end;
2161                                }
2162                            }
2163                            if (selectedCaret.begin === selectedCaret.end) {
2164                                switch (opts.positionCaretOnClick) {
2165                                  case "none":
2166                                    break;
2167
2168                                  case "select":
2169                                    caret(input, 0, getBuffer().length);
2170                                    break;
2171
2172                                  case "ignore":
2173                                    caret(input, seekNext(getLastValidPosition()));
2174                                    break;
2175
2176                                  case "radixFocus":
2177                                    if (doRadixFocus(selectedCaret.begin)) {
2178                                        var radixPos = getBuffer().join("").indexOf(opts.radixPoint);
2179                                        caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);
2180                                        break;
2181                                    }
2182
2183                                  default:
2184                                    var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, true), lastPosition = seekNext(lvclickPosition);
2185                                    if (clickPosition < lastPosition) {
2186                                        caret(input, !isMask(clickPosition, true) && !isMask(clickPosition - 1, true) ? seekNext(clickPosition) : clickPosition);
2187                                    } else {
2188                                        var lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp), placeholder = getPlaceholder(lastPosition, tt.match);
2189                                        if (placeholder !== "" && getBuffer()[lastPosition] !== placeholder && tt.match.optionalQuantifier !== true && tt.match.newBlockMarker !== true || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) {
2190                                            var newPos = seekNext(lastPosition);
2191                                            if (clickPosition >= newPos || clickPosition === lastPosition) {
2192                                                lastPosition = newPos;
2193                                            }
2194                                        }
2195                                        caret(input, lastPosition);
2196                                    }
2197                                    break;
2198                                }
2199                            }
2200                        }
2201                    }, 0);
2202                },
2203                cutEvent: function cutEvent(e) {
2204                    var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;
2205                    var clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);
2206                    clipboardData.setData("text", isRTL ? clipData.reverse().join("") : clip
2206Data.join(""));
2207                    if (document.execCommand) document.execCommand("copy");
2208                    handleRemove(input, Inputmask.keyCode.DELETE, pos);
2209                    writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(""));
2210                },
2211                blurEvent: function blurEvent(e) {
2212                    var $input = $(this), input = this;
2213                    if (input.inputmask) {
2214                        HandleNativePlaceholder(input, originalPlaceholder);
2215                        var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
2216                        if (nptValue !== "" || colorMask !== undefined) {
2217                            if (opts.clearMaskOnLostFocus) {
2218                                if (getLastValidPosition() === -1 && nptValue === getBufferTemplate().join("")) {
2219                                    buffer = [];
2220                                } else {
2221                                    clearOptionalTail(buffer);
2222                                }
2223                            }
2224                            if (isComplete(buffer) === false) {
2225                                setTimeout(function() {
2226                                    $input.trigger("incomplete");
2227                                }, 0);
2228                                if (opts.clearIncomplete) {
2229                                    resetMaskSet();
2230                                    if (opts.clearMaskOnLostFocus) {
2231                                        buffer = [];
2232                                    } else {
2233                                        buffer = getBufferTemplate().slice();
2234                                    }
2235                                }
2236                            }
2237                            writeBuffer(input, buffer, undefined, e);
2238                        }
2239                        if (undoValue !== getBuffer().join("")) {
2240                            undoValue = buffer.join("");
2241                            $input.trigger("change");
2242                        }
2243                    }
2244                },
2245                mouseenterEvent: function mouseenterEvent(e) {
2246                    var input = this;
2247                    mouseEnter = true;
2248                    if (document.activeElement !== input && opts.showMaskOnHover) {
2249                        HandleNativePlaceholder(input, (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""));
2250                    }
2251                },
2252                submitEvent: function submitEvent(e) {
2253                    if (undoValue !== getBuffer().join("")) {
2254                        $el.trigger("change");
2255                    }
2256                    if (opts.clearMaskOnLostFocus && getLastValidPosition() === -1 && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("")) {
2257                        el.inputmask._valueSet("");
2258                    }
2259                    if (opts.clearIncomplete && isComplete(getBuffer()) === false) {
2260                        el.inputmask._valueSet("");
2261                    }
2262                    if (opts.removeMaskOnSubmit) {
2263                        el.inputmask._valueSet(el.inputmask.unmaskedvalue(), true);
2264                        setTimeout(function() {
2265                            writeBuffer(el, getBuffer());
2266                        }, 0);
2267                    }
2268                },
2269                resetEvent: function resetEvent(e) {
2270                    el.inputmask.refreshValue = true;
2271                    setTimeout(function() {
2272                        $el.trigger("setvalue");
2273                    }, 0);
2274                }
2275            };
2276            function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
2277                var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = "", initialNdx = -1, result = undefined;
2278                function isTemplateMatch(ndx, charCodes) {
2279                    var charCodeNdx = getMaskTemplate(true, 0, false).slice(ndx, seekNext(ndx)).join("").replace(/'/g, "").indexOf(charCodes);
2280                    return charCodeNdx !== -1 && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || getTest(ndx).match.fn === null && getTest(ndx).match.nativeDef === "'" + charCodes.charAt(0) || getTest(ndx).match.nativeDef === " " && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || getTest(ndx + 1).match.fn === null && getTest(ndx + 1).match.nativeDef === "'" + charCodes.charAt(0)));
2281                }
2282                resetMaskSet();
2283                if (!strict && opts.autoUnmask !== true) {
2284                    var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp("^" + Inputmask.escapeRegex(staticInput), "g"));
2285                    if (matches && matches.length > 0) {
2286                        inputValue.splice(0, matches.length * staticInput.length);
2287                        initialNdx = seekNext(initialNdx);
2288                    }
2289                } else {
2290                    initialNdx = seekNext(initialNdx);
2291                }
2292                if (initialNdx === -1) {
2293                    getMaskSet().p = seekNext(initialNdx);
2294                    initialNdx = 0;
2295                } else getMaskSet().p = initialNdx;
2296                inputmask.caretPos = {
2297                    begin: initialNdx
2298                };
2299                $.each(inputValue, function(ndx, charCode) {
2300                    if (charCode !== undefined) {
2301                        if (getMaskSet().validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, true) && isValid(ndx, inputValue[ndx], true, undefined, undefined, true) === false) {
2302                            getMaskSet().p++;
2303                        } else {
2304                            var keypress = new $.Event("_checkval");
2305                            keypress.which = charCode.charCodeAt(0);
2306                            charCodes += charCode;
2307                            var lvp = getLastValidPosition(undefined, true);
2308                            if (!isTemplateMatch(initialNdx, charCodes)) {
2309                                result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, inputmask.caretPos.begin);
2310                                if (result) {
2311                                    initialNdx = inputmask.caretPos.begin + 1;
2312                                    charCodes = "";
2313                                }
2314                            } else {
2315                                result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, lvp + 1);
2316                            }
2317                            if (result) {
2318                                writeBuffer(undefined, getBuffer(), result.forwardPosition, keypress, false);
2319                                inputmask.caretPos = {
2320                                    begin: result.forwardPosition,
2321                                    end: result.forwardPosition
2322                                };
2323                            }
2324                        }
2325                    }
2326                });
2327                if (writeOut) writeBuffer(input, getBuffer(), result ? result.forwardPosition : undefined, initiatingEvent || new $.Event("checkval"), initiatingEvent && initiatingEvent.type === "input");
2328            }
2329            function unmaskedvalue(input) {
2330                if (input) {
2331                    if (input.inputmask === undefined) {
2332                        return input.value;
2333                    }
2334                    if (input.inputmask && input.inputmask.refreshValue) {
2335                        EventHandlers.setValueEvent.call(input);
2336                    }
2337                }
2338                var umValue = [], vps = getMaskSet().validPositions;
2339                for (var pndx in vps) {
2340                    if (vps[pndx].match && vps[pndx].match.fn != null) {
2341                        umValue.push(vps[pndx].input);
2342                    }
2343                }
2344                var unmaskedValue = umValue.length === 0 ? "" : (isRTL ? umValue.reverse() : umValue).join("");
2345                if ($.isFunction(opts.onUnMask)) {
2346                    var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
2347                    unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);
2348                }
2349                return unmaskedValue;
2350            }
2351            function caret(input, begin, end, notranslate) {
2352                function translatePosition(pos) {
2353                    if (isRTL && typeof pos === "number" && (!opts.greedy || opts.placeholder !== "") && el) {
2354                        pos = el.inputmask._valueGet().length - pos;
2355                    }
2356                    return pos;
2357                }
2358                var range;
2359                if (begin !== undefined) {
2360                    if ($.isArray(begin)) {
2361                        end = isRTL ? begin[0] : begin[1];
2362                        begin = isRTL ? begin[1] : begin[0];
2363                    }
2364                    if (begin.begin !== undefined) {
2365                        end = isRTL ? begin.begin : begin.end;
2366                        begin = isRTL ? begin.end : begin.begin;
2367                    }
2368                    if (typeof begin === "number") {
2369                        begin = notranslate ? begin : translatePosition(begin);
2370                        end = notranslate ? end : translatePosition(end);
2371                        end = typeof end == "number" ? end : begin;
2372                        var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
2373                        input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;
2374                        input.inputmask.caretPos = {
2375                            begin: begin,
2376                            end: end
2377                        };
2378                        if (input === document.activeElement) {
2379                            if ("selectionStart" in input) {
2380                                input.selectionStart = begin;
2381                                input.selectionEnd = end;
2382                            } else if (window.getSelection) {
2383                                range = document.createRange();
2384                                if (input.firstChild === undefined || input.firstChild === null) {
2385                                    var textNode = document.createTextNode("");
2386                                    input.appendChild(textNode);
2387                                }
2388                                range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length);
2389                                range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length);
2390                                range.collapse(true);
2391                                var sel = window.getSelection();
2392                                sel.removeAllRanges();
2393                                sel.addRange(range);
2394                            } else if (input.createTextRange) {
2395                                range = input.createTextRange();
2396                                range.collapse(true);
2397                                range.moveEnd("character", end);
2398                                range.moveStart("character", begin);
2399                                range.select();
2400                            }
2401                            renderColorMask(input, {
2402                                begin: begin,
2403                                end: end
2404                            });
2405                        }
2406                    }
2407                } else {
2408                    if ("selectionStart" in input) {
2409                        begin = input.selectionStart;
2410                        end = input.selectionEnd;
2411                    } else if (window.getSelection) {
2412                        range = window.getSelection().getRangeAt(0);
2413                        if (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) {
2414                            begin = range.startOffset;
2415                            end = range.endOffset;
2416                        }
2417                    } else if (document.selection && document.selection.createRange) {
2418                        range = document.selection.createRange();
2419                        begin = 0 - range.duplicate().moveStart("character", -input.inputmask._valueGet().length);
2420                        end = begin + range.text.length;
2421                    }
2422                    return {
2423                        begin: notranslate ? begin : translatePosition(begin),
2424                        end: notranslate ? end : translatePosition(en
2424d)
2425                    };
2426                }
2427            }
2428            function determineLastRequiredPosition(returnDefinition) {
2429                var buffer = getMaskTemplate(true, getLastValidPosition(), true, true), bl = buffer.length, pos, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined, testPos;
2430                for (pos = lvp + 1; pos < buffer.length; pos++) {
2431                    testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);
2432                    ndxIntlzr = testPos.locator.slice();
2433                    positions[pos] = $.extend(true, {}, testPos);
2434                }
2435                var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;
2436                for (pos = bl - 1; pos > lvp; pos--) {
2437                    testPos = positions[pos];
2438                    if ((testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && testPos.match.fn != null || testPos.match.fn === null && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && getTests(pos)[0].def !== "")) && buffer[pos] === getPlaceholder(pos, testPos.match)) {
2439                        bl--;
2440                    } else break;
2441                }
2442                return returnDefinition ? {
2443                    l: bl,
2444                    def: positions[bl] ? positions[bl].match : undefined
2445                } : bl;
2446            }
2447            function clearOptionalTail(buffer) {
2448                buffer.length = 0;
2449                var template = getMaskTemplate(true, 0, true, undefined, true), lmnt, validPos;
2450                while (lmnt = template.shift(), lmnt !== undefined) {
2451                    buffer.push(lmnt);
2452                }
2453                return buffer;
2454            }
2455            function isComplete(buffer) {
2456                if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);
2457                if (opts.repeat === "*") return undefined;
2458                var complete = false, lrp = determineLastRequiredPosition(true), aml = seekPrevious(lrp.l);
2459                if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {
2460                    complete = true;
2461                    for (var i = 0; i <= aml; i++) {
2462                        var test = getTestTemplate(i).match;
2463                        if (test.fn !== null && getMaskSet().validPositions[i] === undefined && test.optionality !== true && test.optionalQuantifier !== true || test.fn === null && buffer[i] !== getPlaceholder(i, test)) {
2464                            complete = false;
2465                            break;
2466                        }
2467                    }
2468                }
2469                return complete;
2470            }
2471            function handleRemove(input, k, pos, strict, fromIsValid) {
2472                if (opts.numericInput || isRTL) {
2473                    if (k === Inputmask.keyCode.BACKSPACE) {
2474                        k = Inputmask.keyCode.DELETE;
2475                    } else if (k === Inputmask.keyCode.DELETE) {
2476                        k = Inputmask.keyCode.BACKSPACE;
2477                    }
2478                    if (isRTL) {
2479                        var pend = pos.end;
2480                        pos.end = pos.begin;
2481                        pos.begin = pend;
2482                    }
2483                }
2484                if (k === Inputmask.keyCode.BACKSPACE && pos.end - pos.begin < 1) {
2485                    pos.begin = seekPrevious(pos.begin);
2486                    if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {
2487                        pos.begin--;
2488                    }
2489                } else if (k === Inputmask.keyCode.DELETE && pos.begin === pos.end) {
2490                    pos.end = isMask(pos.end, true) && getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint ? pos.end + 1 : seekNext(pos.end) + 1;
2491                    if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {
2492                        pos.end++;
2493                    }
2494                }
2495                revalidateMask(pos);
2496                if (strict !== true && opts.keepStatic !== false || opts.regex !== null) {
2497                    var result = alternate(true);
2498                    if (result) {
2499                        var newPos = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, true);
2500                        if (k !== Inputmask.keyCode.DELETE || pos.begin > newPos) {
2501                            pos.begin == newPos;
2502                        }
2503                    }
2504                }
2505                var lvp = getLastValidPosition(pos.begin, true);
2506                if (lvp < pos.begin || pos.begin === -1) {
2507                    getMaskSet().p = seekNext(lvp);
2508                } else if (strict !== true) {
2509                    getMaskSet().p = pos.begin;
2510                    if (fromIsValid !== true) {
2511                        while (getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined) {
2512                            getMaskSet().p++;
2513                        }
2514                    }
2515                }
2516            }
2517            function initializeColorMask(input) {
2518                var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);
2519                function findCaretPos(clientx) {
2520                    var e = document.createElement("span"), caretPos;
2521                    for (var style in computedStyle) {
2522                        if (isNaN(style) && style.indexOf("font") !== -1) {
2523                            e.style[style] = computedStyle[style];
2524                        }
2525                    }
2526                    e.style.textTransform = computedStyle.textTransform;
2527                    e.style.letterSpacing = computedStyle.letterSpacing;
2528                    e.style.position = "absolute";
2529                    e.style.height = "auto";
2530                    e.style.width = "auto";
2531                    e.style.visibility = "hidden";
2532                    e.style.whiteSpace = "nowrap";
2533                    document.body.appendChild(e);
2534                    var inputText = input.inputmask._valueGet(), previousWidth = 0, itl;
2535                    for (caretPos = 0, itl = inputText.length; caretPos <= itl;
2535 caretPos++) {
2536                        e.innerHTML += inputText.charAt(caretPos) || "_";
2537                        if (e.offsetWidth >= clientx) {
2538                            var offset1 = clientx - previousWidth;
2539                            var offset2 = e.offsetWidth - clientx;
2540                            e.innerHTML = inputText.charAt(caretPos);
2541                            offset1 -= e.offsetWidth / 3;
2542                            caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;
2543                            break;
2544                        }
2545                        previousWidth = e.offsetWidth;
2546                    }
2547                    document.body.removeChild(e);
2548                    return caretPos;
2549                }
2550                var template = document.createElement("div");
2551                template.style.width = computedStyle.width;
2552                template.style.textAlign = computedStyle.textAlign;
2553                colorMask = document.createElement("div");
2554                input.inputmask.colorMask = colorMask;
2555                colorMask.className = "im-colormask";
2556                input.parentNode.insertBefore(colorMask, input);
2557                input.parentNode.removeChild(input);
2558                colorMask.appendChild(input);
2559                colorMask.appendChild(template);
2560                input.style.left = template.offsetLeft + "px";
2561                $(colorMask).on("mouseleave", function(e) {
2562                    return EventHandlers.mouseleaveEvent.call(input, [ e ]);
2563                });
2564                $(colorMask).on("mouseenter", function(e) {
2565                    return EventHandlers.mouseenterEvent.call(input, [ e ]);
2566                });
2567                $(colorMask).on("click", function(e) {
2568                    caret(input, findCaretPos(e.clientX));
2569                    return EventHandlers.clickEvent.call(input, [ e ]);
2570                });
2571            }
2572            function renderColorMask(input, caretPos, clear) {
2573                var maskTemplate = [], isStatic = false, test, testPos, ndxIntlzr, pos = 0;
2574                function setEntry(entry) {
2575                    if (entry === undefined) entry = "";
2576                    if (!isStatic && (test.fn === null || testPos.input === undefined)) {
2577                        isStatic = true;
2578                        maskTemplate.push("<span class='im-static'>" + entry);
2579                    } else if (isStatic && (test.fn !== null && testPos.input !== undefined || test.def === "")) {
2580                        isStatic = false;
2581                        var mtl = maskTemplate.length;
2582                        maskTemplate[mtl - 1] = maskTemplate[mtl - 1] + "</span>";
2583                        maskTemplate.push(entry);
2584                    } else maskTemplate.push(entry);
2585                }
2586                function setCaret() {
2587                    if (document.activeElement === input) {
2588                        maskTemplate.splice(caretPos.begin, 0, caretPos.begin === caretPos.end || caretPos.end > getMaskSet().maskLength ? '<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">' : '<mark class="im-caret-select">');
2589                        maskTemplate.splice(caretPos.end + 1, 0, "</mark>");
2590                    }
2591                }
2592                if (colorMask !== undefined) {
2593                    var buffer = getBuffer();
2594                    if (caretPos === undefined) {
2595                        caretPos = caret(input);
2596                    } else if (caretPos.begin === undefined) {
2597                        caretPos = {
2598                            begin: caretPos,
2599                            end: caretPos
2600                        };
2601                    }
2602                    if (clear !== true) {
2603                        var lvp = getLastValidPosition();
2604                        do {
2605                            if (getMaskSet().validPositions[pos]) {
2606                                testPos = getMaskSet().validPositions[pos];
2607                                test = testPos.match;
2608                                ndxIntlzr = testPos.locator.slice();
2609                                setEntry(buffer[pos]);
2610                            } else {
2611                                testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);
2612                                test = testPos.match;
2613                                ndxIntlzr = testPos.locator.slice();
2614                                if (opts.jitMasking === false || pos < lvp || typeof opts.jitMasking === "number" && isFinite(opts.jitMasking) && opts.jitMasking > pos) {
2615                                    setEntry(getPlaceholder(pos, test));
2616                                } else isStatic = false;
2617                            }
2618                            pos++;
2619                        } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== "") || lvp > pos || isStatic);
2620                        if (isStatic) setEntry();
2621                        setCaret();
2622                    }
2623                    var template = colorMask.getElementsByTagName("div")[0];
2624                    template.innerHTML = maskTemplate.join("");
2625                    input.inputmask.positionColorMask(input, template);
2626                }
2627            }
2628            function mask(elem) {
2629                function isElementTypeSupported(input, opts) {
2630                    function patchValueProperty(npt) {
2631                        var valueGet;
2632                        var valueSet;
2633                        function patchValhook(type) {
2634                            if ($.valHooks && ($.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true)) {
2635                                var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
2636                                    return elem.value;
2637                                };
2638                                var valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
2639                                    elem.value = value;
2640                                    return elem;
2641                                };
2642                                $.valHooks[type] = {
2643                                    get: function get(elem) {
2644                                        if (elem.inputmask) {
2645                                            if (elem.inputmask.opts.autoUnmask) {
2646                                                return elem.inputmask.unmaskedvalue();
2647                                            } else {
2648                                                var result = valhookGet(elem);
2649                                                return getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) !== -1 || opts.nullable !== true ? result : "";
2650                                            }
2651                                        } else return valhookGet(elem);
2652                                    },
2653                                    set: function set(elem, value) {
2654                                        var $elem = $(elem), result;
2655                                        result = valhookSet(elem, value);
2656                                        if (elem.inputmask) {
2657                                            $elem.trigger("setvalue", [ value ]);
2658                                        }
2659                                        return result;
2660                                    },
2661                                    inputmaskpatch: true
2662                                };
2663                            }
2664                        }
2665                        function getter() {
2666                            if (this.inputmask) {
2667                                return this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : getLastValidPosition() !== -1 || opts.nullable !== true ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join("") : valueGet.call(this) : "";
2668                            } else return valueGet.call(this);
2669                        }
2670                        function setter(value) {
2671                            valueSet.call(this, value);
2672                            if (this.inputmask) {
2673                                $(this).trigger("setvalue", [ value ]);
2674                            }
2675                        }
2676                        function installNativeValueSetFallback(npt) {
2677                            EventRuler.on(npt, "mouseenter", function(event) {
2678                                var $input = $(this), input = this, value = input.inputmask._valueGet();
2679                                if (value !== getBuffer().join("")) {
2680                                    $input.trigger("setvalue");
2681                                }
2682                            });
2683                        }
2684                        if (!npt.inputmask.__valueGet) {
2685                            if (opts.noValuePatching !== true) {
2686                                if (Object.getOwnPropertyDescriptor) {
2687                                    if (typeof Object.getPrototypeOf 
2687!== "function") {
2688                                        Object.getPrototypeOf = _typeof("test".__proto__) === "object" ? function(object) {
2689                                            return object.__proto__;
2690                                        } : function(object) {
2691                                            return object.constructor.prototype;
2692                                        };
2693                                    }
2694                                    var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), "value") : undefined;
2695                                    if (valueProperty && valueProperty.get && valueProperty.set) {
2696                                        valueGet = valueProperty.get;
2697                                        valueSet = valueProperty.set;
2698                                        Object.defineProperty(npt, "value", {
2699                                            get: getter,
2700                                            set: setter,
2701                                            configurable: true
2702                                        });
2703                                    } else if (npt.tagName !== "INPUT") {
2704                                        valueGet = function valueGet() {
2705                                            return this.textContent;
2706                                        };
2707                                        valueSet = function valueSet(value) {
2708                                            this.textContent = value;
2709                                        };
2710                                        Object.defineProperty(npt, "value", {
2711                                            get: getter,
2712                                            set: setter,
2713                                            configurable: true
2714                                        });
2715                                    }
2716                                } else if (document.__lookupGetter__ && npt.__lookupGetter__("value")) {
2717                                    valueGet = npt.__lookupGetter__("value");
2718                                    valueSet = npt.__lookupSetter__("value");
2719                                    npt.__defineGetter__("value", getter);
2720                                    npt.__defineSetter__("value", setter);
2721                                }
2722                                npt.inputmask.__valueGet = valueGet;
2723                                npt.inputmask.__valueSet = valueSet;
2724                            }
2725                            npt.inputmask._valueGet = function(overruleRTL) {
2726                                return isRTL && overruleRTL !== true ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
2727                            };
2728                            npt.inputmask._valueSet = function(value, overruleRTL) {
2729                                valueSet.call(this.el, value === null || value === undefined ? "" : overruleRTL !== true && isRTL ? value.split("").reverse().join("") : value);
2730                            };
2731                            if (valueGet === undefined) {
2732                                valueGet = function valueGet() {
2733                                    return this.value;
2734                                };
2735                                valueSet = function valueSet(value) {
2736                                    this.value = value;
2737                                };
2738                                patchValhook(npt.type);
2739                                installNativeValueSetFallback(npt);
2740                            }
2741                        }
2742                    }
2743                    var elementType = input.getAttribute("type");
2744                    var isSupported = input.tagName === "INPUT" && $.inArray(elementType, opts.supportsInputType) !== -1 || input.isContentEditable || input.tagName === "TEXTAREA";
2745                    if (!isSupported) {
2746                        if (input.tagName === "INPUT") {
2747                            var el = document.createElement("input");
2748                            el.setAttribute("type", elementType);
2749                            isSupported = el.type === "text";
2750                            el = null;
2751                        } else isSupported = "partial";
2752                    }
2753                    if (isSupported !== false) {
2754                        patchValueProperty(input);
2755                    } else input.inputmask = undefined;
2756                    return isSupported;
2757                }
2758                EventRuler.off(elem);
2759                var isSupported = isElementTypeSupported(elem, opts);
2760                if (isSupported !== false) {
2761                    el = elem;
2762                    $el = $(el);
2763                    originalPlaceholder = el.placeholder;
2764                    maxLength = el !== undefined ? el.maxLength : undefined;
2765                    if (maxLength === -1) maxLength = undefined;
2766                    if (opts.colorMask === true) {
2767                        initializeColorMask(el);
2768                    }
2769                    if (mobile) {
2770                        if ("inputmode" in el) {
2771                            el.inputmode = opts.inputmode;
2772                            el.setAttribute("inputmode", opts.inputmode);
2773                        }
2774                        if (opts.disablePredictiveText === true) {
2775                            if ("autocorrect" in el) {
2776                                el.autocorrect = false;
2777                            } else {
2778                                if (opts.colorMask !== true) {
2779                                    initializeColorMask(el);
2780                                }
2781                                el.type = "password";
2782                            }
2783                        }
2784                    }
2785                    if (isSupported === true) {
2786                        el.setAttribute("im-insert", opts.insertMode);
2787                        EventRuler.on(el, "submit", EventHandlers.submitEvent);
2788                        EventRuler.on(el, "reset", EventHandlers.resetEvent);
2789                        EventRuler.on(el, "blur", EventHandlers.blurEvent);
2790                        EventRuler.on(el, "focus", EventHandlers.focusEvent);
2791                        if (opts.colorMask !== true) {
2792                            EventRuler.on(el, "click", EventHandlers.clickEvent);
2793                            EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent);
2794                            EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent);
2795                        }
2796                        EventRuler.on(el, "paste", EventHandlers.pasteEvent);
2797                        EventRuler.on(el, "cut", EventHandlers.cutEvent);
2798                        EventRuler.on(el, "complete", opts.oncomplete);
2799                        EventRuler.on(el, "incomplete", opts.onincomplete);
2800                        EventRuler.on(el, "cleared", opts.oncleared);
2801                        if (!mobile && opts.inputEventOnly !== true) {
2802                            EventRuler.on(el, "keydown", EventHandlers.keydownEvent);
2803                            EventRuler.on(el, "keypress", EventHandlers.keypressEvent);
2804                        } else {
2805                            el.removeAttribute("maxLength");
2806                        }
2807                        EventRuler.on(el, "input", EventHandlers.inputFallBackEvent);
2808                        EventRuler.on(el, "beforeinput", EventHandlers.beforeInputEvent);
2809                    }
2810                    EventRuler.on(el, "setvalue", EventHandlers.setValueEvent);
2811                    undoValue = getBufferTemplate().join("");
2812                    if (el.inputmask._valueGet(true) !== "" || opts.clearMaskOnLostFocus === false || document.activeElement === el) {
2813                        var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, el.inputmask._valueGet(true), opts) || el.inputmask._valueGet(true) : el.inputmask._valueGet(true);
2814                        if (initialValue !== "") checkVal(el, true, false, initialValue.split(""));
2815                        var buffer = getBuffer().slice();
2816                        undoValue = buffer.join("");
2817                        if (isComplete(buffer) === false) {
2818                            if (opts.clearIncomplete) {
2819                                resetMaskSet();
2820                            }
2821                        }
2822                        if (opts.clearMaskOnLostFocus && document.activeElement !== el) {
2823                            if (getLastValidPosition() === -1) {
2824                                buffer = [];
2825                            } else {
2826                                clearOptionalTail(buffer);
2827                            }
2828                        }
2829                        if (opts.clearMaskOnLostFocus === false || opts.showMaskOnFocus && document.activeElement === el || el.inputmask._valueGet(true) !== "") writeBuffer(el, buffer);
2830                        if (document.activeElement === el) {
2831                            caret(el, seekNext(getLastValidPosition()));
2832                        }
2833                    }
2834                }
2835            }
2836            var valueBuffer;
2837            if (actionObj !== undefined) {
2838                switch (actionObj.action) {
2839                  case "isComplete":
2840                    el = actionObj.el;
2841                    return isComplete(getBuffer());
2842
2843                  case "unmaskedvalue":
2844                    if (el === undefined || actionObj.value !== undefined) {
2845                        valueBuffer = actionObj.value;
2846                        valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer : valueBuffer).split("");
2847                        checkVal.call(this, undefined, false, false, valueBuffer);
2848                        if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(inputmask, undefined, getBuffer(), 0, opts);
2849                    }
2850                    return unmaskedvalue(el);
2851
2852                  case "mask":
2853                    mask(el);
2854                    break;
2855
2856                  case "format":
2857                    valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value : actionObj.value).split("");
2858                    checkVal.call(this, undefined, true, false, valueBuffer);
2859                    if (actionObj.metadata) {
2860                        return {
2861                            value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
2862                            metadata: maskScope.call(this, {
2863                                action: "getmetadata"
2864                            }, maskset, opts)
2865                        };
2866                    }
2867                    return isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");
2868
2869                  case "isValid":
2870                    if (actionObj.value) {
2871                        valueBuffer = actionObj.value.split("");
2872                        checkVal.call(this, undefined, true, true, valueBuffer);
2873                    } else {
2874                        actionObj.value = getBuffer().join("");
2875                    }
2876                    var buffer = getBuffer();
2877                    var rl = determineLastRequiredPosition(), lmib = buffer.length - 1;
2878                    for (;lmib > rl; lmib--) {
2879                        if (isMask(lmib)) break;
2880                    }
2881                    buffer.splice(rl, lmib + 1 - rl);
2882                    return isComplete(buffer) && actionObj.value === getBuffer().join("");
2883
2884                  case "getemptymask":
2885                    return getBufferTemplate().join("");
2886
2887                  case "remove":
2888                    if (el && el.inputmask) {
2889                        $.data(el, "_inputmask_opts", null);
2890                        $el = $(el);
2891                        el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(true));
2892                        EventRuler.off(el);
2893                        if (el.inputmask.colorMask) {
2894                            colorMask = el.inputmask.colorMask;
2895                            colorMask.removeChild(el);
2896                            colorMask.parentNode.insertBefore(el, colorMask);
2897                            colorMask.parentNode.removeChild(colorMask);
2898                        }
2899                        var valueProperty;
2900                        if (Object.getOwnPropertyDescriptor && Ob
2900ject.getPrototypeOf) {
2901                            valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value");
2902                            if (valueProperty) {
2903                                if (el.inputmask.__valueGet) {
2904                                    Object.defineProperty(el, "value", {
2905                                        get: el.inputmask.__valueGet,
2906                                        set: el.inputmask.__valueSet,
2907                                        configurable: true
2908                                    });
2909                                }
2910                            }
2911                        } else if (document.__lookupGetter__ && el.__lookupGetter__("value")) {
2912                            if (el.inputmask.__valueGet) {
2913                                el.__defineGetter__("value", el.inputmask.__valueGet);
2914                                el.__defineSetter__("value", el.inputmask.__valueSet);
2915                            }
2916                        }
2917                        el.inputmask = undefined;
2918                    }
2919                    return el;
2920                    break;
2921
2922                  case "getmetadata":
2923                    if ($.isArray(maskset.metadata)) {
2924                        var maskTarget = getMaskTemplate(true, 0, false).join("");
2925                        $.each(maskset.metadata, function(ndx, mtdt) {
2926                            if (mtdt.mask === maskTarget) {
2927                                maskTarget = mtdt;
2928                                return false;
2929                            }
2930                        });
2931                        return maskTarget;
2932                    }
2933                    return maskset.metadata;
2934                }
2935            }
2936        }
2937        return Inputmask;
2938    });
2939}, function(module, exports, __webpack_require__) {
2940    "use strict";
2941    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
2942    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
2943        return typeof obj;
2944    } : function(obj) {
2945        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2946    };
2947    (function(factory) {
2948        if (true) {
2949            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(4) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
2950            __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
2951            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
2952        } else {}
2953    })(function($) {
2954        return $;
2955    });
2956}, function(module, exports) {
2957    module.exports = jQuery;
2958}, function(module, exports, __webpack_require__) {
2959    "use strict";
2960    var __WEBPACK_AMD_DEFINE_RESULT__;
2961    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
2962        return typeof obj;
2963    } : function(obj) {
2964        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2965    };
2966    if (true) !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
2967        return typeof window !== "undefined" ? window : new (eval("require('jsdom').JSDOM"))("").window;
2968    }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); else {}
2969}, function(module, exports, __webpack_require__) {
2970    "use strict";
2971    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
2972    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
2973        return typeof obj;
2974    } : function(obj) {
2975        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2976    };
2977    (function(factory) {
2978        if (true) {
2979            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
2980            __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
2981            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
2982        } else {}
2983    })(function(Inputmask) {
2984        var $ = Inputmask.dependencyLib;
2985        var formatCode = {
2986            d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ],
2987            dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
2988                return pad(Date.prototype.getDate.call(this), 2);
2989            } ],
2990            ddd: [ "" ],
2991            dddd: [ "" ],
2992            m: [ "[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
2993                return Date.prototype.getMonth.call(this) + 1;
2994            } ],
2995            mm: [ "0[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
2996                return pad(Date.prototype.getMonth.call(this) + 1, 2);
2997            } ],
2998            mmm: [ "" ],
2999            mmmm: [ "" ],
3000            yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() {
3001                return pad(Date.prototype.getFullYear.call(this), 2);
3002            } ],
3003            yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() {
3004                return pad(Date.prototype.getFullYear.call(this), 4);
3005            } ],
3006            h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
3007            hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() {
3008                return pad(Date.prototype.getHours.call(this), 2);
3009            } ],
3010            hhh: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
3011            H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
3012            HH: [ "0[0-9]|1[0-9]|2[0-3]", Date.prototype.setHours, "hours", function() {
3013                return pad(Date.prototype.getHours.call(this), 2);
3014            } ],
3015            HHH: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
3016            M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ],
3017            MM: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setMinutes, "minutes", function() {
3018                return pad(Date.prototype.getMinutes.call(this), 2);
3019            } ],
3020            ss: [ "[0-5][0-9]", Date.prototype.setSeconds, "seconds", function() {
3021                return pad(Date.prototype.getSeconds.call(this), 2);
3022            } ],
3023            l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() {
3024                return pad(Date.prototype.getMilliseconds.call(this), 3);
3025            } ],
3026            L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() {
3027                return pad(Date.prototype.getMilliseconds.call(this), 2);
3028            } ],
3029            t: [ "[ap]" ],
3030            tt: [ "[ap]m" ],
3031            T: [ "[AP]" ],
3032            TT: [ "[AP]M" ],
3033            Z: [ "" ],
3034            o: [ "" ],
3035            S: [ "" ]
3036        }, formatAlias = {
3037            isoDate: "yyyy-mm-dd",
3038            isoTime: "HH:MM:ss",
3039            isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
3040            isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
3041        };
3042        function getTokenizer(opts) {
3043            if (!opts.tokenizer) {
3044                var tokens = [];
3045                for (var ndx in formatCode) {
3046                    if (tokens.indexOf(ndx[0]) === -1) tokens.push(ndx[0]);
3047                }
3048                opts.tokenizer = "(" + tokens.join("+|") + ")+?|.";
3049                opts.tokenizer = new RegExp(opts.tokenizer, "g");
3050            }
3051            return opts.tokenizer;
3052        }
3053        function isValidDate(dateParts, currentResult) {
3054            return !isFinite(dateParts.rawday) || dateParts.day == "29" && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day ? currentResult : false;
3055        }
3056        function isDateInRange(dateParts, opts) {
3057            var result = true;
3058            if (opts.min) {
3059                if (dateParts["rawyear"]) {
3060                    var rawYear = dateParts["rawyear"].replace(/[^0-9]/g, ""), minYear = opts.min.year.substr(0, rawYear.length);
3061                    result = minYear <= rawYear;
3062                }
3063                if (dateParts["year"] === dateParts["rawyear"]) {
3064                    if (opts.min.date.getTime() === opts.min.date.getTime()) {
3065                        result = opts.min.date.getTime() <= dateParts.date.getTime();
3066                    }
3067                }
3068            }
3069            if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {
3070                result = opts.max.date.getTime() >= dateParts.date.getTime();
3071            }
3072            return result;
3073        }
3074        function parse(format, dateObjValue, opts, raw) {
3075            var mask = "", match;
3076            while (match = getTokenizer(opts).exec(format)) {
3077                if (dateObjValue === undefined) {
3078                    if (formatCode[match[0]]) {
3079                        mask += "(" + formatCode[match[0]][0] + ")";
3080                    } else {
3081                        switch (match[0]) {
3082                          case "[":
3083                            mask += "(";
3084                            break;
3085
3086                          case "]":
3087                            mask += ")?";
3088                            break;
3089
3090                          default:
3091                            mask += Inputmask.escapeRegex(match[0]);
3092                        }
3093                    }
3094                } else {
3095                    if (formatCode[match[0]]) {
3096                        if (raw !== true && formatCode[match[0]][3]) {
3097                            var getFn = formatCode[match[0]][3];
3098                            mask += getFn.call(dateObjValue.date);
3099                        } else if (formatCode[match[0]][2]) mask += dateObjValue["raw" + formatCode[match[0]][2]]; else mask += match[0];
3100                    } else mask += match[0];
3101                }
3102            }
3103            return mask;
3104        }
3105        function pad(val, len) {
3106            val = String(val);
3107            len = len || 2;
3108            while (val.length < len) {
3109                val = "0" + val;
3110            }
3111            return val;
3112        }
3113        function analyseMask(maskString, format, opts) {
3114            var dateObj = {
3115                date: new Date(1, 0, 1)
3116            }, targetProp, mask = maskString, match, dateOperation, targetValidator;
3117            function extendProperty(value) {
3118                var correctedValue = value.replace(/[^0-9]/g, "0");
3119                if (correctedValue != value) {
3120                    var enteredPart = value.replace(/[^0-9]/g, ""), min = (opts.min && opts.min[targetProp] || value).toString(), max = (opts.max && opts.max[targetProp] || value).toString();
3121                    correctedValue = enteredPart + (enteredPart < min.slice(0, enteredPart.length) ? min.slice(enteredPart.length) : enteredPart > max.slice(0, enteredPart.length) ? max.slice(enteredPart.length) : correctedValue.toString().slice(enteredPart.length));
3122                }
3123                return correctedValue;
3124            }
3125            function setValue(dateObj, value, opts) {
3126                dateObj[targetProp] = extendProperty(value);
3127                dateObj["raw" + targetProp] = value;
3128                if (dateOperation !== undefined) dateOperation.call(dateObj.date, targetProp == "month" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
3129            }
3130            if (typeof mask === "string") {
3131                while (match = getTokenizer(opts).exec(format)) {
3132                    var value = mask.slice(0, match[0].length);
3133                    if (formatCode.hasOwnProperty(match[0])) {
3134                        targetValidator = formatCode[match[0]][0];
3135                        targetProp = formatCode[match[0]][2];
3136                        dateOperation = formatCode[match[0]][1];
3137                        setValue(dateObj, value, opts);
3138                    }
3139                    mask = mask.slice(value.length);
3140                }
3141                return dateObj;
3142            } else if (mask && (typeof mask === "undefined" ? "undefined" : _typeof(mask)) === "object" && mask.hasOwnProperty("date")) {
3143                return mask;
3144            }
3145            return undefined;
3146        }
3147        Inputmask.extendAliases({
3148            datetime: {
3149                mask: function mask(opts) {
3150                    formatCode.S = opts.i18n.ordinalSuffix.join("|");
3151                    opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat;
3152                    opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat;
3153                    opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat;
3154                    opts.placeholder = opts.placeholder !== "" ? opts.placeholder : opts.inputFormat.replace(/[\[\]]/, "");
3155                    opts.regex = parse(opts.inputFormat, undefined, opts);
3156                    return null;
3157                },
3158                placeholder: "",
3159                inputFormat: "isoDateTime",
3160                displayFormat: undefined,
3161                outputFormat: undefined,
3162                min: null,
3163                max: null,
3164                i18n: {
3165                    dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],
3166                    monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
3166November", "December" ],
3167                    ordinalSuffix: [ "st", "nd", "rd", "th" ]
3168                },
3169                postValidation: function postValidation(buffer, pos, currentResult, opts) {
3170                    opts.min = analyseMask(opts.min, opts.inputFormat, opts);
3171                    opts.max = analyseMask(opts.max, opts.inputFormat, opts);
3172                    var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts);
3173                    if (result && dateParts.date.getTime() === dateParts.date.getTime()) {
3174                        result = isValidDate(dateParts, result);
3175                        result = result && isDateInRange(dateParts, opts);
3176                    }
3177                    if (pos && result && currentResult.pos !== pos) {
3178                        return {
3179                            buffer: parse(opts.inputFormat, dateParts, opts),
3180                            refreshFromBuffer: {
3181                                start: pos,
3182                                end: currentResult.pos
3183                            }
3184                        };
3185                    }
3186                    return result;
3187                },
3188                onKeyDown: function onKeyDown(e, buffer, caretPos, opts) {
3189                    var input = this;
3190                    if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
3191                        var today = new Date(), match, date = "";
3192                        while (match = getTokenizer(opts).exec(opts.inputFormat)) {
3193                            if (match[0].charAt(0) === "d") {
3194                                date += pad(today.getDate(), match[0].length);
3195                            } else if (match[0].charAt(0) === "m") {
3196                                date += pad(today.getMonth() + 1, match[0].length);
3197                            } else if (match[0] === "yyyy") {
3198                                date += today.getFullYear().toString();
3199                            } else if (match[0].charAt(0) === "y") {
3200                                date += pad(today.getYear(), match[0].length);
3201                            }
3202                        }
3203                        input.inputmask._valueSet(date);
3204                        $(input).trigger("setvalue");
3205                    }
3206                },
3207                onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
3208                    return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);
3209                },
3210                casing: function casing(elem, test, pos, validPositions) {
3211                    if (test.nativeDef.indexOf("[ap]") == 0) return elem.toLowerCase();
3212                    if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
3213                    return elem;
3214                },
3215                insertMode: false,
3216                shiftPositions: false
3217            }
3218        });
3219        return Inputmask;
3220    });
3221}, function(module, exports, __webpack_require__) {
3222    "use strict";
3223    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
3224    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
3225        return typeof obj;
3226    } : function(obj) {
3227        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3228    };
3229    (function(factory) {
3230        if (true) {
3231            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
3232            __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
3233            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3234        } else {}
3235    })(function(Inputmask) {
3236        var $ = Inputmask.dependencyLib;
3237        function autoEscape(txt, opts) {
3238            var escapedTxt = "";
3239            for (var i = 0; i < txt.length; i++) {
3240                if (Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i)) {
3241                    escapedTxt += "\\" + txt.charAt(i);
3242                } else escapedTxt += txt.charAt(i);
3243            }
3244            return escapedTxt;
3245        }
3246        function alignDigits(buffer, digits, opts) {
3247            if (digits > 0) {
3248                var radixPosition = $.inArray(opts.radixPoint, buffer);
3249                if (radixPosition === -1) {
3250                    buffer.push(opts.radixPoint);
3251                    radixPosition = buffer.length - 1;
3252                }
3253                for (var i = 1; i <= digits; i++) {
3254                    buffer[radixPosition + i] = buffer[radixPosition + i] || "0";
3255                }
3256            }
3257            return buffer;
3258        }
3259        Inputmask.extendAliases({
3260            numeric: {
3261                mask: function mask(opts) {
3262                    if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {
3263                        opts.integerDigits = opts.repeat;
3264                    }
3265                    opts.repeat = 0;
3266                    if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== "0") {
3267                        if (opts.radixPoint === ".") {
3268                            opts.groupSeparator = ",";
3269                        } else if (opts.radixPoint === ",") {
3270                            opts.groupSeparator = ".";
3271                        } else opts.groupSeparator = "";
3272                    }
3273                    if (opts.groupSeparator === " ") {
3274                        opts.skipOptionalPartCharacter = undefined;
3275                    }
3276                    opts.autoGroup = opts.autoGroup && opts.groupSeparator !== "";
3277                    if (opts.autoGroup) {
3278                        if (typeof opts.groupSize == "string" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);
3279                        if (isFinite(opts.integerDigits)) {
3280                            var seps = Math.floor(opts.integerDigits / opts.groupSize);
3281                            var mod = opts.integerDigits % opts.groupSize;
3282                            opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);
3283                            if (opts.integerDigits < 1) {
3284                                opts.integerDigits = "*";
3285                            }
3286                        }
3287                    }
3288                    if (opts.placeholder.length > 1) {
3289                        opts.placeholder = opts.placeholder.charAt(0);
3290                    }
3291                    if (opts.positionCaretOnClick === "radixFocus" && opts.placeholder === "" && opts.integerOptional === false) {
3292                        opts.positionCaretOnClick = "lvp";
3293                    }
3294                    opts.definitions[";"] = opts.definitions["~"];
3295                    opts.definitions[";"].definitionSymbol = "~";
3296                    if (opts.numericInput === true) {
3297                        opts.positionCaretOnClick = opts.positionCaretOnClick === "radixFocus" ? "lvp" : opts.positionCaretOnClick;
3298                        opts.digitsOptional = false;
3299                        if (isNaN(opts.digits)) opts.digits = 2;
3300                        opts.decimalProtect = false;
3301                    }
3302                    var mask = "[+]";
3303                    mask += autoEscape(opts.prefix, opts);
3304                    if (opts.integerOptional === true) {
3305                        mask += "~{1," + opts.integerDigits + "}";
3306                    } else mask += "~{" + opts.integerDigits + "}";
3307                    if (opts.digits !== undefined) {
3308                        var radixDef = opts.decimalProtect ? ":" : opts.radixPoint;
3309                        var dq = opts.digits.toString().split(",");
3310                        if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {
3311                            mask += radixDef + ";{" + opts.digits + "}";
3312                        } else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {
3313                            if (opts.digitsOptional) {
3314                                mask += "[" + radixDef + ";{1," + opts.digits + "}]";
3315                            } else mask += radixDef + ";{" + opts.digits + "}";
3316                        }
3317                    }
3318                    mask += autoEscape(opts.suffix, opts);
3319                    mask += "[-]";
3320                    opts.greedy = false;
3321                    return mask;
3322                },
3323                placeholder: "",
3324                greedy: false,
3325                digits: "*",
3326                digitsOptional: true,
3327                enforceDigitsOnBlur: false,
3328                radixPoint: ".",
3329                positionCaretOnClick: "radixFocus",
3330                groupSize: 3,
3331                groupSeparator: "",
3332                autoGroup: false,
3333                allowMinus: true,
3334                negationSymbol: {
3335                    front: "-",
3336                    back: ""
3337                },
3338                integerDigits: "+",
3339                integerOptional: true,
3340                prefix: "",
3341                suffix: "",
3342                rightAlign: true,
3343                decimalProtect: true,
3344                min: null,
3345                max: null,
3346                step: 1,
3347                insertMode: true,
3348                autoUnmask: false,
3349                unmaskAsNumber: false,
3350                inputType: "text",
3351                inputmode: "numeric",
3352                preValidation: function preValidation(buffer, pos, c, isSelection, opts, maskset) {
3353                    if (c === "-" || c === opts.negationSymbol.front) {
3354                        if (opts.allowMinus !== true) return false;
3355                        opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;
3356                        if (buffer.join("") === "") return true;
3357                        return {
3358                            caret: maskset.validPositions[pos] ? pos : undefined,
3359                            dopost: true
3360                        };
3361                    }
3362                    if (isSelection === false && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
3363                        var radixPos = $.inArray(opts.radixPoint, buffer);
3364                        if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {
3365                            if (opts.numericInput === true) {
3366                                return pos === radixPos;
3367                            }
3368                            return {
3369                                caret: radixPos + 1
3370                            };
3371                        }
3372                    }
3373                    return true;
3374                },
3375                postValidation: function postValidation(buffer, pos, currentResult, opts) {
3376                    function buildPostMask(buffer, opts) {
3377                        var postMask = "";
3378                        postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}";
3379                        if (opts.radixPoint !== "") {
3380                            var radixSplit = buffer.join("").split(opts.radixPoint);
3381                            if (radixSplit[1]) {
3382                                postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}";
3383                            }
3384                        }
3385                        return postMask;
3386                    }
3387                    var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
3388                    if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;
3389                    var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;
3390                    var maskedValue = buffer.slice();
3391                    if (opts.numericInput) {
3392                        caretPos = maskedValue.length - caretPos - 1;
3393                        maskedValue = maskedValue.reverse();
3394                    }
3395                    var charAtPos = maskedValue[caretPos];
3396                    if (charAtPos === opts.groupSeparator) {
3397                        caretPos += 1;
3398                        charAtPos = maskedValue[caretPos];
3399                    }
3400                    if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
3401                    if (charAtPos !== undefined) {
3402                        if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
3403                            maskedValue[caretPos] = "?";
3404                            if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {
3405                                prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = "?";
3406                            } else if (opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0)) {
3407                                suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = "?";
3408                            }
3409                        }
3410                    }
3411                    prefix = prefix.join("");
3412                    suffix = suffix.join("");
3413                    var processValue = maskedValue.join("").replace(prefix, "");
3414                    processValue = processValue.replace(suffix, "");
3415                    processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
3416                    processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
3417                    processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
3418                    if (isNaN(opts.placeholder)) {
3419                        processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "");
3420                    }
3421                    if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {
3422                        if (charAtPos === "0") {
3423                            processValue = processValue.replace(/^\?/g, "");
3424                        }
3425                        processValue = processValue.replace(/^0/g, "");
3426                    }
3427                    if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== "" && opts.numericInput !== true) {
3428                        processValue = "0" + processValue;
3429                    }
3430                    if (processValue !== "") {
3431                        processValue = processValue.split("");
3432                        if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === "blur") && isFinite(opts.digits)) {
3433                            var radixPosition = $.inArray(opts.radixPoint, processValue);
3434                            var rpb = $.inArray(opts.radixPoint, maskedValue);
3435                            if (radixPosition === -1) {
3436                                processValue.push(opts.radixPoint);
3437                                radixPosition = processValue.length - 1;
3438                            }
3439                            for (var i = 1; i <= opts.digits; i++) {
3440                                if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === "blur") && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {
3441                                    processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
3442                                } else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {
3443                                    processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];
3444                                }
3445                            }
3446                        }
3447                        if (opts.autoGroup === true && opts.groupSeparator !== "" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {
3448                            var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;
3449                            processValue = Inputmask(buildPostMask(processValue, opts), {
3450                                numericInput: true,
3451                                jitMasking: true,
3452                                definitions: {
3453                                    "*": {
3454                                        validator: "[0-9?]",
3455                                        cardinality: 1
3456                                    }
3457                                }
3458                            }).format(processValue.join(""));
3459                            if (addRadix) processValue += opts.radixPoint;
3460                            if (processValue.charAt(0) === opts.groupSeparator) {
3461                                processValue.substr(1);
3462                            }
3463                        } else processValue = processValue.join("");
3464                    }
3465                    if (opts.isNegative && currentResult.event === "blur") {
3466                        opts.isNegative = processValue !== "0";
3467                    }
3468                    processValue = prefix + processValue;
3469                    processValue += suffix;
3470                    if (opts.isNegative) {
3471                        processValue = opts.negationSymbol.front + processValue;
3472                        processValue += opts.negationSymbol.back;
3473                    }
3474                    processValue = processValue.split("");
3475                    if (charAtPos !== undefined) {
3476                        if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
3477                            caretPos = $.inArray("?", processValue);
3478                            if (caretPos > -1) {
3479                                processValue[caretPos] = charAtPos;
3480                            } else caretPos = currentResult.caret || 0;
3481                        } else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {
3482                            var newCaretPos = $.inArray(charAtPos, processValue);
3483                            if (newCaretPos !== -1) caretPos = newCaretPos;
3484                        }
3485                    }
3486                    if (opts.numericInput) {
3487                        caretPos = processValue.length - caretPos - 1;
3488                        processValue = processValue.reverse();
3489                    }
3490                    var rslt = {
3491                        caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
3492                        buffer: processValue,
3493                        refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
3494                    };
3495                    return rslt.refreshFromBuffer ? rslt : currentResult;
3496                },
3497                onBeforeWrite: function onBeforeWrite(e, buffer, caretPos, opts) {
3498                    function parseMinMaxOptions(opts) {
3499                        if (opts.parseMinMaxOptions === undefined) {
3500                            if (opts.min !== null) {
3501                                opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
3502                                if (opts.radixPoint === ",") opts.min = opts.min.replace(opts.radixPoint, ".");
3503                                opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;
3504                                if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;
3505                            }
3506                            if (opts.max !== null) {
3507                                opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
3508                                if (opts.radixPoint === ",") opts.max = opts.max.replace(opts.radixPoint, ".");
3509                                opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;
3510                                if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;
3511                            }
3512                            opts.parseMinMaxOptions = "done";
3513                        }
3514                    }
3515                    if (e) {
3516                        switch (e.type) {
3517                          case "keydown":
3518                            return opts.postValidation(buffer, caretPos, {
3519                                caret: caretPos,
3520                                dopost: true
3521                            }, opts);
3522
3523                          case "blur":
3524                          case "checkval":
3525                            var unmasked;
3526                            parseMinMaxOptions(opts);
3527                            if (opts.min !== null || opts.max !== null) {
3528                                unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
3529                                    unmaskAsNumber: true
3530                                }));
3531                                if (opts.min !== null && unmasked < opts.min) {
3532                                    opts.isNegative = opts.min < 0;
3533                                    return opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), caretPos, {
3534                                        caret: caretPos,
3535                                        dopost: true,
3536                                        placeholder: "0"
3537                                    }, opts);
3538                                } else if (opts.max !== null && unmasked > opts.max) {
3539                                    opts.isNegative = opts.max < 0;
3540                                    return opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), caretPos, {
3541                                        caret: caretPos,
3542                                        dopost: true,
3543                                        placeholder: "0"
3544                                    }, opts);
3545                                }
3546                            }
3547                            return opts.postValidation(buffer, caretPos, {
3548                                caret: caretPos,
3549                                placeholder: "0",
3550                                event: "blur"
3551                            }, opts);
3552
3553                          case "_checkval":
3554                            return {
3555                                caret: caretPos
3556                            };
3557
3558                          default:
3559                            break;
3560                        }
3561                    }
3562                },
3563                regex: {
3564                    integerPart: function integerPart(opts, emptyCheck) {
3565                        return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
3566                    },
3567                    integerNPart: function integerNPart(opts) {
3568                        return new RegExp("[\\d" + Inputmask.escapeRegex(opts.
3568groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
3569                    }
3570                },
3571                definitions: {
3572                    "~": {
3573                        validator: function validator(chrs, maskset, pos, strict, opts, isSelection) {
3574                            var isValid, l;
3575                            if (chrs === "k" || chrs === "m") {
3576                                isValid = {
3577                                    insert: [],
3578                                    c: 0
3579                                };
3580                                for (var i = 0, l = chrs === "k" ? 2 : 5; i < l; i++) {
3581                                    isValid.insert.push({
3582                                        pos: pos + i,
3583                                        c: 0
3584                                    });
3585                                }
3586                                isValid.pos = pos + l;
3587                                return isValid;
3588                            }
3589                            isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
3590                            if (isValid === true) {
3591                                if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === "~" && !isSelection) {
3592                                    var processValue = maskset.buffer.join("");
3593                                    processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
3594                                    processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
3595                                    var pvRadixSplit = processValue.split(opts.radixPoint);
3596                                    if (pvRadixSplit.length > 1) {
3597                                        pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));
3598                                    }
3599                                    if (pvRadixSplit[0] === "0") {
3600                                        pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));
3601                                    }
3602                                    processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
3603                                    var bufferTemplate = maskset._buffer.join("");
3604                                    if (processValue === opts.radixPoint) {
3605                                        processValue = bufferTemplate;
3606                                    }
3607                                    while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$") === null) {
3608                                        bufferTemplate = bufferTemplate.slice(1);
3609                                    }
3610                                    processValue = processValue.replace(bufferTemplate, "");
3611                                    processValue = processValue.split("");
3612                                    if (processValue[pos] === undefined) {
3613                                        isValid = {
3614                                            pos: pos,
3615                                            remove: pos
3616                                        };
3617                                    } else {
3618                                        isValid = {
3619                                            pos: pos
3620                                        };
3621                                    }
3622                                }
3623                            } else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {
3624                                isValid = {
3625                                    insert: {
3626                                        pos: pos,
3627                                        c: 0
3628                                    },
3629                                    pos: pos + 1
3630                                };
3631                            }
3632                            return isValid;
3633                        },
3634                        cardinality: 1
3635                    },
3636                    "+": {
3637                        validator: function validator(chrs, maskset, pos, strict, opts) {
3638                            return opts.allowMinus && (chrs === "-" || chrs === opts.negationSymbol.front);
3639                        },
3640                        cardinality: 1,
3641                        placeholder: ""
3642                    },
3643                    "-": {
3644                        validator: function validator(chrs, maskset, pos, strict, opts) {
3645                            return opts.allowMinus && chrs === opts.negationSymbol.back;
3646                        },
3647                        cardinality: 1,
3648                        placeholder: ""
3649                    },
3650                    ":": {
3651                        validator: function validator(chrs, maskset, pos, strict, opts) {
3652                            var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
3653                            var isValid = new RegExp(radix).test(chrs);
3654                            if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {
3655                                isValid = {
3656                                    caret: pos + 1
3657                                };
3658                            }
3659                            return isValid;
3660                        },
3661                        cardinality: 1,
3662                        placeholder: function placeholder(opts) {
3663                            return opts.radixPoint;
3664                        }
3665                    }
3666                },
3667                onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
3668                    if (unmaskedValue === "" && opts.nullable === true) {
3669                        return unmaskedValue;
3670                    }
3671                    var processValue = maskedValue.replace(opts.prefix, "");
3672                    processValue = processValue.replace(opts.suffix, "");
3673                    processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
3674                    if (opts.placeholder.charAt(0) !== "") {
3675                        processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0");
3676                    }
3677                    if (opts.unmaskAsNumber) {
3678                        if (opts.radixPoint !== "" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".");
3679                        processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
3680                        processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
3681                        return Number(processValue);
3682                    }
3683                    return processValue;
3684                },
3685                isComplete: function isComplete(buffer, opts) {
3686                    var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join("");
3687                    maskedValue = maskedValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-");
3688                    maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
3689                    maskedValue = maskedValue.replace(opts.prefix, "");
3690                    maskedValue = maskedValue.replace(opts.suffix, "");
3691                    maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1");
3692                    if (opts.radixPoint === ",") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".");
3693                    return isFinite(maskedValue);
3694                },
3695                onBeforeMask: function onBeforeMask(initialValue, opts) {
3696                    opts.isNegative = undefined;
3697                    var radixPoint = opts.radixPoint || ",";
3698                    if ((typeof initialValue == "number" || opts.inputType === "number") && radixPoint !== "") {
3699                        initialValue = initialValue.toString().replace(".", radixPoint);
3700                    }
3701                    var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\-0-9]/g, ""), decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, "") : "";
3702                    initialValue = integerPart + (decimalPart !== "" ? radixPoint + decimalPart : decimalPart);
3703                    var digits = 0;
3704                    if (radixPoint !== "") {
3705                        digits = decimalPart.length;
3706                        if (decimalPart !== "") {
3707                            var digitsFactor = Math.pow(10, digits || 1);
3708                            if (isFinite(opts.digits)) {
3709                                digits = parseInt(opts.digits);
3710                                digitsFactor = Math.pow(10, digits);
3711                            }
3712                            initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), ".");
3713                            if (isFinite(initialValue)) initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;
3714                            initialValue = initialValue.toString().replace(".", radixPoint);
3715                        }
3716                    }
3717                    if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {
3718                        initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));
3719                    }
3720                    return alignDigits(initialValue.toString().split(""), digits, opts).join("");
3721                },
3722                onKeyDown: function onKeyDown(e, buffer, caretPos, opts) {
3723                    var $input = $(this);
3724                    if (e.ctrlKey) {
3725                        switch (e.keyCode) {
3726                          case Inputmask.keyCode.UP:
3727                            $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));
3728                            $input.trigger("setvalue");
3729                            break;
3730
3731                          case Inputmask.keyCode.DOWN:
3732                            $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));
3733                            $input.trigger("setvalue");
3734                            break;
3735                        }
3736                    }
3737                }
3738            },
3739            currency: {
3740                prefix: "$ ",
3741                groupSeparator: ",",
3742                alias: "numeric",
3743                placeholder: "0",
3744                autoGroup: true,
3745                digits: 2,
3746                digitsOptional: false,
3747                clearMaskOnLostFocus: false
3748            },
3749            decimal: {
3750                alias: "numeric"
3751            },
3752            integer: {
3753                alias: "numeric",
3754                digits: 0,
3755                radixPoint: ""
3756            },
3757            percentage: {
3758                alias: "numeric",
3759                digits: 2,
3760                digitsOptional: true,
3761                radixPoint: ".",
3762                placeholder: "0",
3763                autoGroup: false,
3764                min: 0,
3765                max: 100,
3766                suffix: " %",
3767                allowMinus: false
3768            }
3769        });
3770        return Inputmask;
3771    });
3772}, function(module, exports, __webpack_require__) {
3773    "use strict";
3774    var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
3775    var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
3776        return typeof obj;
3777    } : function(obj) {
3778        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
3779    };
3780    (function(factory) {
3781        if (true) {
3782            !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(4), __webpack_require__(2) ], 
3783            __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
3784            __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
3785        } else {}
3786    })(function($, Inputmask) {
3787        if ($.fn.inputmask === undefined) {
3788            $.fn.inputmask = function(fn, options) {
3789                var nptmask, input = this[0];
3790                if (options === undefined) options = {};
3791                if (typeof fn === "string") {
3792                    switch (fn) {
3793                      case "unmaskedvalue":
3794                        return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
3795
3796                      case "remove":
3797                        return this.each(function() {
3798                            if (this.inputmask) this.inputmask.remove();
3799                        });
3800
3801                      case "getemptymask":
3802                        return input && input.inputmask ? input.inputmask.getemptymask() : "";
3803
3804                      case "hasMaskedValue":
3805                        return input && input.inputmask ? input.inputmask.hasMaskedValue() : false;
3806
3807                      case "isComplete":
3808                        return input && input.inputmask ? input.inputmask.isComplete() : true;
3809
3810                      case "getmetadata":
3811                        return input && input.inputmask ? input.inputmask.getmetadata() : undefined;
3812
3813                      case "setvalue":
3814                        Inputmask.setValue(input, options);
3815                        break;
3816
3817                      case "option":
3818                        if (typeof options === "string") {
3819                            if (input && input.inputmask !== undefined) {
3820                                return input.inputmask.option(options);
3821                            }
3822                        } else {
3823                            return this.each(function() {
3824                                if (this.inputmask !== undefined) {
3825                                    return this.inputmask.option(options);
3826                                }
3827                            });
3828                        }
3829                        break;
3830
3831                      default:
3832                        options.alias = fn;
3833                        nptmask = new Inputmask(options);
3834                        return this.each(function() {
3835                            nptmask.mask(this);
3836                        });
3837                    }
3838                } else if (Array.isArray(fn)) {
3839                    options.alias = fn;
3840                    nptmask = new Inputmask(options);
3841                    return this.each(function() {
3842                        nptmask.mask(this);
3843                    });
3844                } else if ((typeof fn === "undefined" ? "undefined" : _typeof(fn)) == "object") {
3845                    nptmask = new Inputmask(fn);
3846                    if (fn.mask === undefined && fn.alias === undefined) {
3847                        return this.each(function() {
3848                            if (this.inputmask !== undefined) {
3849                                return this.inputmask.option(fn);
3850                            } else nptmask.mask(this);
3851                        });
3852                    } else {
3853                        return this.each(function() {
3854                            nptmask.mask(this);
3855                        });
3856                    }
3857                } else if (fn === undefined) {
3858                    return this.each(function() {
3859                        nptmask = new Inputmask(options);
3860                        nptmask.mask(this);
3861                    });
3862                }
3863            };
3864        }
3865        return $.fn.inputmask;
3866    });
3867} ]);

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.