{"version":3,"sources":["webpack:///./node_modules/inputmask/dist/inputmask/global/window.js","webpack:///./node_modules/inputmask/index.js","webpack:///./node_modules/inputmask/dist/inputmask/inputmask.extensions.js","webpack:///./node_modules/vue-inputmask/dist/vue-inputmask.js","webpack:///./src/components/InformationBlock/InformationBlock.vue?32e1","webpack:///./src/components/InformationBlock/InformationBlock.ts","webpack:///./src/components/InformationBlock/InformationBlock.ts?726d","webpack:///./src/components/InformationBlock/InformationBlock.vue","webpack:///./node_modules/inputmask/dist/inputmask/inputmask.js","webpack:///./node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js","webpack:///./node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js","webpack:///./src/components/InformationBlock/InformationBlock.scss?1114","webpack:///./src/components/inputs/InputMaskedText/InputMaskedText.vue?83a5","webpack:///./src/components/inputs/InputMaskedText/InputMaskedText.ts","webpack:///./src/components/inputs/InputMaskedText/InputMaskedText.ts?82b9","webpack:///./src/components/inputs/InputMaskedText/InputMaskedText.vue","webpack:///./node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js"],"names":["window","eval","module","exports","factory","Inputmask","extendDefinitions","A","validator","casing","extendAliases","cssunit","regex","url","autoUnmask","ip","mask","definitions","i","chrs","maskset","pos","strict","opts","buffer","RegExp","test","onUnMask","maskedValue","unmaskedValue","inputmode","email","greedy","onBeforePaste","pastedValue","toLowerCase","replace","mac","vin","V","clearIncomplete","modules","installedModules","__webpack_require__","moduleId","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","render","_vm","this","_h","$createElement","_c","_self","isContentEmpty","_e","staticClass","domProps","_s","$t","contentKey","_v","staticRenderFns","InformationBlock","_Vue","_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","apply","arguments","_inherits","_createClass","key","translation","toString","Vue","__decorate","Prop","default","required","Component","component","$","undefined","document","ua","navigator","userAgent","ie","indexOf","mobile","isInputEventSupported","iemobile","iphone","alias","options","internal","el","events","refreshValue","isPlainObject","extend","defaults","noMasksCache","userOptions","isRTL","numericInput","resolveAlias","aliasStr","aliasDefinition","aliases","generateMaskSet","nocache","generateMask","metadata","regexMask","length","repeat","placeholder","repeatStart","groupmarker","quantifiermarker","masksetDefinition","maskdefKey","split","reverse","join","masksCache","maskToken","analyseMask","validPositions","_buffer","tests","excludes","maskLength","jitOffset","ms","isFunction","isArray","keepStatic","charAt","altMask","each","ndx","msk","alternatormarker","pop","eventName","createElement","evName","isSupported","setAttribute","maskScope","actionObj","undoValue","$el","maxLength","colorMask","originalPlaceholder","inputmask","skipKeyPressEvent","skipInputEvent","ignorable","mouseEnter","getMaskTemplate","baseOnInput","minimalPos","includeMode","noJit","clearOptionalTail","ndxIntlzr","testPos","maskTemplate","getLastValidPosition","getMaskSet","match","optionality","generatedInput","input","skipOptionalPartCharacter","determineTestTemplate","getTests","locator","slice","push","nativeDef","getPlaceholder","getTestTemplate","jitMasking","jit","isFinite","newBlockMarker","fn","def","resetMaskSet","soft","closestTo","before","after","valids","posNdx","psNdx","parseInt","getDecisionTaker","tst","decisionTaker","alternation","getLocator","align","mloc","tstLocator","closest","bestMatch","altTest","getTest","targetLocator","distance","Math","abs","optionalQuantifier","tstPs","positionCanMatchDefinition","valid","tndx","latestMatch","maskTokens","ndxInitializer","matches","insertStop","cacheDependency","resolveTestFromToken","loopNdx","quantifierRecurse","handleMatch","isFirstMatch","tokenGroup","firstMatch","inArray","isQuantifier","resolveNdxInitializer","alternateNdx","targetAlternation","indexPos","lmnt","ndxPos","bestMatchAltIndex","isSubsetOf","source","target","expand","pattern","start","end","expanded","charCodeAt","String","fromCharCode","staticCanMatchDefinition","sloc","tloc","canMatch","setMergeLocators","targetMatch","altMatch","locNdx","keys","cd","isGroup","isOptional","optionalToken","mtch","isAlternator","maltMatches","alternateToken","malternateMatches","currentMatches","loopNdxCnt","altIndex","shift","amndx","currentPos","ndxInitializerClone","altIndexArr","altIndexArrClone","splice","unMatchedAlternation","concat","ndx1","dropMatch","ndx2","altMatch2","qt","qndx","isNaN","quantifier","max","min","mergeLocators","previousPos","mtndx","getBufferTemplate","getBuffer","noCache","refreshFromBuffer","valResult","isValid","caret","elem","toUpperCase","posBefore","keyCode","SPACE","args","Array","checkAlternationMatch","altArr1","altArr2","na","naNdx","altArrC","isMatch","naArr","alndx","alternate","fromSetValid","rAltPos","lastAlt","altPos","prevAltPos","validPos","decisionPos","validPsClone","isValidRslt","lAltPos","validInputsClone","staticInputsBeforePos","posOffset","validInputs","targetLvp","fromAlternate","validateOnly","isSelection","posObj","begin","maskPos","_isValid","position","rslt","validatedPos","remove","sort","a","b","revalidateMask","insert","result","positionsClone","preValidation","trackbackPositions","currentPosValid","insertMode","seekNext","isMask","nPos","snPos","isComplete","postValidation","postResult","refresh","originalPos","newPos","fillOnly","ps","vp","cvpInput","validTest","IsEnclosedStatic","selection","posMatch","radixPoint","prevMatch","nextMatch","lvp","isNegative","j","needsValidation","t","shiftPositions","newBlock","seekPrevious","writeBuffer","caretPos","event","triggerEvents","onBeforeWrite","_valueSet","type","renderColorMask","$input","nptVal","_valueGet","trigger","setTimeout","returnPL","prevTest","staticAlternations","HandleNativePlaceholder","npt","value","nptValue","removeAttribute","valueBuffer","EventRuler","on","eventHandler","ev","e","that","nodeName","imOpts","data","off","disabled","readOnly","ctrlKey","tabThrough","TAB","preventDefault","returnVal","stopPropagation","form","evArr","EventHandlers","keydownEvent","k","BACKSPACE","DELETE","BACKSPACE_SAFARI","X","handleRemove","END","PAGE_DOWN","shiftKey","HOME","PAGE_UP","undoOnEscape","ESCAPE","altKey","checkVal","INSERT","onKeyDown","ignorables","keypressEvent","checkval","writeOut","which","charCode","metaKey","ENTER","forwardPosition","offset","_radixDance","writeOutBuffer","onKeyValidation","pasteEvent","tempValue","originalEvent","inputValue","valueBeforeCaret","substr","valueAfterCaret","clipboardData","getData","pasteValue","inputFallBackEvent","radixPointHandler","ieMobileHandler","inputChar","iv","frontPart","backPart","frontBufferPart","backBufferPart","entries","isEntry","fpl","entry","keypress","Event","keydown","beforeInputEvent","cancelable","inputType","setValueEvent","detail","onBeforeMask","clearMaskOnLostFocus","focusEvent","showMaskOnFocus","positionCaretOnTab","clickEvent","mouseleaveEvent","activeElement","tabbed","doRadixFocus","clickPos","vps","radixPos","selectedCaret","positionCaretOnClick","clickPosition","lvclickPosition","lastPosition","tt","cutEvent","clipData","setData","execCommand","blurEvent","mouseenterEvent","showMaskOnHover","submitEvent","removeMaskOnSubmit","unmaskedvalue","resetEvent","nptvl","initiatingEvent","charCodes","initialNdx","isTemplateMatch","charCodeNdx","staticInput","escapeRegex","umValue","pndx","bufferValue","notranslate","translatePosition","range","selectionStart","selectionEnd","getSelection","getRangeAt","commonAncestorContainer","parentNode","startOffset","endOffset","createRange","duplicate","moveStart","text","scrollCalc","ownerDocument","defaultView","getComputedStyle","currentStyle","fontSize","scrollLeft","scrollWidth","firstChild","textNode","createTextNode","appendChild","setStart","setEnd","collapse","sel","removeAllRanges","addRange","createTextRange","moveEnd","select","determineLastRequiredPosition","returnDefinition","bl","positions","lvTest","lvTestAlt","template","complete","lrp","aml","fromIsValid","pend","groupSeparator","initializeColorMask","computedStyle","findCaretPos","clientx","style","textTransform","letterSpacing","height","width","visibility","whiteSpace","body","itl","inputText","previousWidth","innerHTML","offsetWidth","offset1","offset2","removeChild","textAlign","className","insertBefore","left","offsetLeft","clientX","clear","isStatic","setEntry","mtl","setCaret","getElementsByTagName","positionColorMask","isElementTypeSupported","patchValueProperty","valueGet","valueSet","patchValhook","valHooks","inputmaskpatch","valhookGet","valhookSet","set","nullable","$elem","setter","installNativeValueSetFallback","__valueGet","noValuePatching","getOwnPropertyDescriptor","getPrototypeOf","__proto__","constructor","valueProperty","tagName","textContent","__lookupGetter__","__lookupSetter__","__defineGetter__","__defineSetter__","__valueSet","overruleRTL","elementType","getAttribute","supportsInputType","isContentEditable","disablePredictiveText","autocorrect","oncomplete","onincomplete","oncleared","inputEventOnly","initialValue","action","rl","lmib","maskTarget","mtdt","dataAttribute","optionalmarker","escapeChar","noop","rightAlign","staticDefinitionSymbol","importDataAttributes","9","definitionSymbol","elems","importAttributeOptions","option","dataoptions","optionData","attrOptions","importOption","JSON","parse","dir","getElementById","querySelectorAll","scopedOpts","noremask","getemptymask","hasMaskedValue","getmetadata","format","setValue","openingToken","currentOpeningToken","alternator","lastMatch","tokenizer","regexTokenizer","escaped","currentToken","MaskToken","openenings","openGroup","alternatorGroup","insertTestDefinition","mtoken","element","maskdef","verifyGroupMarker","token","nextToken","defaultCase","mndx","reverseTokens","reverseStatic","st","intMatch","groupify","groupToken","exec","mqj","mq","mq0","mq1","tmpMatch","groupQuantifier","subToken","extendDefaults","definition","unmask","str","specials","DOWN","LEFT","RIGHT","UP","CONTROL","dependencyLib","autoEscape","txt","escapedTxt","alignDigits","digits","radixPosition","numeric","integerDigits","autoGroup","groupSize","seps","floor","mod","integerOptional","digitsOptional","decimalProtect","prefix","radixDef","dq","suffix","enforceDigitsOnBlur","allowMinus","negationSymbol","front","back","step","unmaskAsNumber","dopost","currentResult","buildPostMask","postMask","radixSplit","charAtPos","processValue","rpb","addRadix","cardinality","newCaretPos","parseMinMaxOptions","parseFloat","NaN","Number","MIN_VALUE","MAX_VALUE","unmasked","integerPart","emptyCheck","integerNPart","pvRadixSplit","bufferTemplate","radix","valueParts","decimalPart","digitsFactor","pow","round","substring","val","currency","decimal","integer","percentage","list","len","isWindow","obj","isArraylike","ltype","nodeType","isValidElement","Element","DependencyLib","querySelector","eventRegistry","handler","addEvent","namespace","addEventListener","attachEvent","_events","endx","nsEvent","removeEvent","removeEventListener","detachEvent","nmsp","resolveNamespace","hndx","hndL","evts","evNdx","offEvents","offEventsL","evnt","params","bubbles","createEvent","CustomEvent","initCustomEvent","dispatchEvent","createEventObject","eventType","fireEvent","arr","src","copy","copyIsArray","clone","deep","callback","owner","__data","evt","class","label","attrs","randomId","readonly","directives","rawName","expression","$event","$emit","onFocus","onBlur","maskCheck","VueInputMask","require","use","InputMaskedText","_InputBase","_this","field","oldValue","maskConfig","InputBase","formatCode","Date","setDate","getDate","dd","pad","ddd","dddd","setMonth","getMonth","mm","mmm","mmmm","yy","setFullYear","getFullYear","yyyy","h","setHours","getHours","hh","hhh","H","HH","HHH","M","setMinutes","getMinutes","MM","ss","setSeconds","getSeconds","setMilliseconds","getMilliseconds","L","T","TT","Z","S","formatAlias","isoDate","isoTime","isoDateTime","isoUtcDateTime","getTokenizer","tokens","isValidDate","dateParts","rawday","day","rawyear","date","rawmonth","month","isDateInRange","rawYear","minYear","year","getTime","dateObjValue","raw","getFn","maskString","targetProp","dateOperation","dateObj","extendProperty","correctedValue","enteredPart","datetime","i18n","ordinalSuffix","inputFormat","displayFormat","outputFormat","dayNames","monthNames","today","getYear"],"mappings":"gIAAA;;;;;;;EAQgD,yCAC5C,MAAyB,qBAAXA,OAAyBA,OAAS,IAAKC,KAAK,0BAAV,CAAqC,IAAID,QAC5F,yI,uBCVD,EAAQ,QACR,EAAQ,QACR,EAAQ,QAERE,EAAOC,QAAU,EAAQ,S,uBCJzB;;;;;;;GAQA,SAAUC,GAEF,EAAO,CAAE,WAAiB,EAAF,EAAS,kEAFzC,EAQG,SAASC,GA+ER,OA9EAA,EAAUC,kBAAkB,CACxBC,EAAG,CACCC,UAAW,oBACXC,OAAQ,SAEZ,IAAK,CACDD,UAAW,uBACXC,OAAQ,SAEZ,IAAK,CACDD,UAAW,cACXC,OAAQ,WAGhBJ,EAAUK,cAAc,CACpBC,QAAS,CACLC,MAAO,2DAEXC,IAAK,CACDD,MAAO,mBACPE,YAAY,GAEhBC,GAAI,CACAC,KAAM,kCACNC,YAAa,CACTC,EAAG,CACCV,UAAW,SAASW,EAAMC,EAASC,EAAKC,EAAQC,GAO5C,OANIF,EAAM,GAAK,GAAiC,MAA5BD,EAAQI,OAAOH,EAAM,IACrCF,EAAOC,EAAQI,OAAOH,EAAM,GAAKF,EAE7BA,EADAE,EAAM,GAAK,GAAiC,MAA5BD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AvB2D,EAAM,GAAGnC,OAAO,GACvBgxB,GAAQ9C,EAAIwE,EAAMpE,WAAa,EAAGnsB,EAAM,GAAG3D,QACvB,SAAb2D,EAAM,GACb6uB,GAAQ0B,EAAM9D,cAAc9yB,WACE,MAAvBqG,EAAM,GAAGnC,OAAO,KACvBgxB,GAAQ9C,EAAIwE,EAAMC,UAAWxwB,EAAM,GAAG3D,SAG9C8D,EAAMnB,UAAU4O,UAAUihB,GAC1B10B,EAAEgG,GAAO+N,QAAQ,cAGzB1Y,SAAU,SAASC,EAAaC,EAAeN,GAC3C,OAAOqqB,EAAMrqB,EAAKg7B,aAAclzB,EAAYzH,EAAaL,EAAK86B,YAAa96B,GAAOA,GAAM,IAE5Fd,OAAQ,SAAS8T,EAAM7S,EAAML,EAAKiI,GAC9B,OAAsC,GAAlC5H,EAAKmL,UAAUhG,QAAQ,QAAqB0N,EAAKpS,cACf,GAAlCT,EAAKmL,UAAUhG,QAAQ,QAAqB0N,EAAKC,cAC9CD,GAEXqD,YAAY,EACZ2B,gBAAgB,KAGjBlZ","file":"js/chunk-958ef440.js","sourcesContent":["/*!\n* global/window.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\nif (typeof define === \"function\" && define.amd) define(function() {\n return typeof window !== \"undefined\" ? window : new (eval(\"require('jsdom').JSDOM\"))(\"\").window;\n}); else if (typeof exports === \"object\") module.exports = typeof window !== \"undefined\" ? window : new (eval(\"require('jsdom').JSDOM\"))(\"\").window;","require(\"./dist/inputmask/inputmask.extensions\");\r\nrequire(\"./dist/inputmask/inputmask.date.extensions\");\r\nrequire(\"./dist/inputmask/inputmask.numeric.extensions\");\r\n\r\nmodule.exports = require(\"./dist/inputmask/inputmask.js\");\r\n","/*!\n* inputmask.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (typeof define === \"function\" && define.amd) {\n define([ \"./inputmask\" ], factory);\n } else if (typeof exports === \"object\") {\n module.exports = factory(require(\"./inputmask\"));\n } else {\n factory(window.Inputmask);\n }\n})(function(Inputmask) {\n Inputmask.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n Inputmask.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)//.*\",\n autoUnmask: false\n },\n ip: {\n mask: \"i[i[i]].i[i[i]].i[i[i]].i[i[i]]\",\n definitions: {\n i: {\n validator: function(chrs, maskset, pos, strict, opts) {\n if (pos - 1 > -1 && maskset.buffer[pos - 1] !== \".\") {\n chrs = maskset.buffer[pos - 1] + chrs;\n if (pos - 2 > -1 && maskset.buffer[pos - 2] !== \".\") {\n chrs = maskset.buffer[pos - 2] + chrs;\n } else chrs = \"0\" + chrs;\n } else chrs = \"00\" + chrs;\n return new RegExp(\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\").test(chrs);\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"numeric\"\n },\n email: {\n mask: \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\",\n greedy: false,\n casing: \"lower\",\n onBeforePaste: function(pastedValue, opts) {\n pastedValue = pastedValue.toLowerCase();\n return pastedValue.replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: true,\n autoUnmask: true\n }\n });\n return Inputmask;\n});","/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* dependencyLibs/inputmask.dependencyLib.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"../global/window\\\"), require(\\\"../global/document\\\")) : window.dependencyLib = factory(window, document);\\n}(function(window, document) {\\n function indexOf(list, elem) {\\n for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;\\n return -1;\\n }\\n function type(obj) {\\n return null == obj ? obj + \\\"\\\" : \\\"object\\\" == typeof obj || \\\"function\\\" == typeof obj ? class2type[class2type.toString.call(obj)] || \\\"object\\\" : typeof obj;\\n }\\n function isWindow(obj) {\\n return null != obj && obj === obj.window;\\n }\\n function isArraylike(obj) {\\n var length = \\\"length\\\" in obj && obj.length, ltype = type(obj);\\n return \\\"function\\\" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || (\\\"array\\\" === ltype || 0 === length || \\\"number\\\" == typeof length && length > 0 && length - 1 in obj));\\n }\\n function isValidElement(elem) {\\n return elem instanceof Element;\\n }\\n function DependencyLib(elem) {\\n return elem instanceof DependencyLib ? elem : this instanceof DependencyLib ? void (void 0 !== elem && null !== elem && elem !== window && (this[0] = elem.nodeName ? elem : void 0 !== elem[0] && elem[0].nodeName ? elem[0] : document.querySelector(elem), \\n void 0 !== this[0] && null !== this[0] && (this[0].eventRegistry = this[0].eventRegistry || {}))) : new DependencyLib(elem);\\n }\\n for (var class2type = {}, classTypes = \\\"Boolean Number String Function Array Date RegExp Object Error\\\".split(\\\" \\\"), nameNdx = 0; nameNdx < classTypes.length; nameNdx++) class2type[\\\"[object \\\" + classTypes[nameNdx] + \\\"]\\\"] = classTypes[nameNdx].toLowerCase();\\n return DependencyLib.prototype = {\\n on: function(events, handler) {\\n if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = events.split(\\\" \\\"), endx = 0; endx < _events.length; endx++) {\\n var nsEvent = _events[endx].split(\\\".\\\"), ev = nsEvent[0], namespace = nsEvent[1] || \\\"global\\\";\\n !function(ev, namespace) {\\n elem.addEventListener ? elem.addEventListener(ev, handler, !1) : elem.attachEvent && elem.attachEvent(\\\"on\\\" + ev, handler), \\n eventRegistry[ev] = eventRegistry[ev] || {}, eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [], \\n eventRegistry[ev][namespace].push(handler);\\n }(ev, namespace);\\n }\\n return this;\\n },\\n off: function(events, handler) {\\n if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = events.split(\\\" \\\"), endx = 0; endx < _events.length; endx++) for (var nsEvent = _events[endx].split(\\\".\\\"), offEvents = function(ev, namespace) {\\n var hndx, hndL, evts = [];\\n if (ev.length > 0) if (void 0 === handler) for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) evts.push({\\n ev: ev,\\n namespace: namespace && namespace.length > 0 ? namespace : \\\"global\\\",\\n handler: eventRegistry[ev][namespace][hndx]\\n }); else evts.push({\\n ev: ev,\\n namespace: namespace && namespace.length > 0 ? namespace : \\\"global\\\",\\n handler: handler\\n }); else if (namespace.length > 0) for (var evNdx in eventRegistry) for (var nmsp in eventRegistry[evNdx]) if (nmsp === namespace) if (void 0 === handler) for (hndx = 0, \\n hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) evts.push({\\n ev: evNdx,\\n namespace: nmsp,\\n handler: eventRegistry[evNdx][nmsp][hndx]\\n }); else evts.push({\\n ev: evNdx,\\n namespace: nmsp,\\n handler: handler\\n });\\n return evts;\\n }(nsEvent[0], nsEvent[1]), i = 0, offEventsL = offEvents.length; i < offEventsL; i++) !function(ev, namespace, handler) {\\n if (ev in eventRegistry == 1) if (elem.removeEventListener ? elem.removeEventListener(ev, handler, !1) : elem.detachEvent && elem.detachEvent(\\\"on\\\" + ev, handler), \\n \\\"global\\\" === namespace) for (var nmsp in eventRegistry[ev]) eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1); else eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);\\n }(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);\\n return this;\\n },\\n trigger: function(events) {\\n if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = \\\"string\\\" == typeof events ? events.split(\\\" \\\") : [ events.type ], endx = 0; endx < _events.length; endx++) {\\n var nsEvent = _events[endx].split(\\\".\\\"), ev = nsEvent[0], namespace = nsEvent[1] || \\\"global\\\";\\n if (void 0 !== document && \\\"global\\\" === namespace) {\\n var evnt, i, params = {\\n bubbles: !0,\\n cancelable: !0,\\n detail: Array.prototype.slice.call(arguments, 1)\\n };\\n if (document.createEvent) {\\n try {\\n evnt = new CustomEvent(ev, params);\\n } catch (e) {\\n evnt = document.createEvent(\\\"CustomEvent\\\"), evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);\\n }\\n events.type && DependencyLib.extend(evnt, events), elem.dispatchEvent(evnt);\\n } else evnt = document.createEventObject(), evnt.eventType = ev, events.type && DependencyLib.extend(evnt, events), \\n elem.fireEvent(\\\"on\\\" + evnt.eventType, evnt);\\n } else if (void 0 !== eventRegistry[ev]) if (arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]), \\n \\\"global\\\" === namespace) for (var nmsp in eventRegistry[ev]) for (i = 0; i < eventRegistry[ev][nmsp].length; i++) eventRegistry[ev][nmsp][i].apply(elem, arguments); else for (i = 0; i < eventRegistry[ev][namespace].length; i++) eventRegistry[ev][namespace][i].apply(elem, arguments);\\n }\\n return this;\\n }\\n }, DependencyLib.isFunction = function(obj) {\\n return \\\"function\\\" === type(obj);\\n }, DependencyLib.noop = function() {}, DependencyLib.isArray = Array.isArray, DependencyLib.inArray = function(elem, arr, i) {\\n return null == arr ? -1 : indexOf(arr, elem);\\n }, DependencyLib.valHooks = void 0, DependencyLib.isPlainObject = function(obj) {\\n return \\\"object\\\" === type(obj) && !obj.nodeType && !isWindow(obj) && !(obj.constructor && !class2type.hasOwnProperty.call(obj.constructor.prototype, \\\"isPrototypeOf\\\"));\\n }, DependencyLib.extend = function() {\\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1;\\n for (\\\"boolean\\\" == typeof target && (deep = target, target = arguments[i] || {}, \\n i++), \\\"object\\\" == typeof target || DependencyLib.isFunction(target) || (target = {}), \\n i === length && (target = this, i--); i < length; i++) if (null != (options = arguments[i])) for (name in options) src = target[name], \\n copy = options[name], target !== copy && (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, \\n clone = src && DependencyLib.isArray(src) ? src : []) : clone = src && DependencyLib.isPlainObject(src) ? src : {}, \\n target[name] = DependencyLib.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy));\\n return target;\\n }, DependencyLib.each = function(obj, callback) {\\n var i = 0;\\n if (isArraylike(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;\\n return obj;\\n }, DependencyLib.map = function(elems, callback) {\\n var value, i = 0, length = elems.length, isArray = isArraylike(elems), ret = [];\\n if (isArray) for (;i < length; i++) null != (value = callback(elems[i], i)) && ret.push(value); else for (i in elems) null != (value = callback(elems[i], i)) && ret.push(value);\\n return [].concat(ret);\\n }, DependencyLib.data = function(owner, key, value) {\\n if (void 0 === value) return owner.__data ? owner.__data[key] : null;\\n owner.__data = owner.__data || {}, owner.__data[key] = value;\\n }, \\\"function\\\" == typeof window.CustomEvent ? DependencyLib.Event = window.CustomEvent : (DependencyLib.Event = function(event, params) {\\n params = params || {\\n bubbles: !1,\\n cancelable: !1,\\n detail: void 0\\n };\\n var evt = document.createEvent(\\\"CustomEvent\\\");\\n return evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail), \\n evt;\\n }, DependencyLib.Event.prototype = window.Event.prototype), DependencyLib;\\n});\\n//# sourceMappingURL=data:application/json;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ICAgICAgZXY6IGV2LFxuICAgICAgICAgICAgICAgICAgICBuYW1lc3BhY2U6IG5hbWVzcGFjZSAmJiBuYW1lc3BhY2UubGVuZ3RoID4gMCA/IG5hbWVzcGFjZSA6IFwiZ2xvYmFsXCIsXG4gICAgICAgICAgICAgICAgICAgIGhhbmRsZXI6IGV2ZW50UmVnaXN0cnlbZXZdW25hbWVzcGFjZV1baG5keF1cbiAgICAgICAgICAgICAgICB9KTsgZWxzZSBldnRzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBldjogZXYsXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzcGFjZTogbmFtZXNwYWNlICYmIG5hbWVzcGFjZS5sZW5ndGggPiAwID8gbmFtZXNwYWNlIDogXCJnbG9iYWxcIixcbiAgICAgICAgICAgICAgICAgICAgaGFuZGxlcjogaGFuZGxlclxuICAgICAgICAgICAgICAgIH0pOyBlbHNlIGlmIChuYW1lc3BhY2UubGVuZ3RoID4gMCkgZm9yICh2YXIgZXZOZHggaW4gZXZlbnRSZWdpc3RyeSkgZm9yICh2YXIgbm1zcCBpbiBldmVudFJlZ2lzdHJ5W2V2TmR4XSkgaWYgKG5tc3AgPT09IG5hbWVzcGFjZSkgaWYgKHZvaWQgMCA9PT0gaGFuZGxlcikgZm9yIChobmR4ID0gMCwgXG4gICAgICAgICAgICAgICAgaG5kTCA9IGV2ZW50UmVnaXN0cnlbZXZOZHhdW25tc3BdLmxlbmd0aDsgaG5keCA8IGhuZEw7IGhuZHgrKykgZXZ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgZXY6IGV2TmR4LFxuICAgICAgICAgICAgICAgICAgICBuYW1lc3BhY2U6IG5tc3AsXG4gICAgICAgICAgICAgICAgICAgIGhhbmRsZXI6IGV2ZW50UmVnaXN0cnlbZXZOZHhdW25tc3BdW2huZHhdXG4gICAgICAgICAgICAgICAgfSk7IGVsc2UgZXZ0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgZXY6IGV2Tm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iBmdW5jdGlvbihldmVudHMpIHtcbiAgICAgICAgICAgIGlmIChpc1ZhbGlkRWxlbWVudCh0aGlzWzBdKSkgZm9yICh2YXIgZXZlbnRSZWdpc3RyeSA9IHRoaXNbMF0uZXZlbnRSZWdpc3RyeSwgZWxlbSA9IHRoaXNbMF0sIF9ldmVudHMgPSBcInN0cmluZ1wiID09IHR5cGVvZiBldmVudHMgPyBldmVudHMuc3BsaXQoXCIgXCIpIDogWyBldmVudHMudHlwZSBdLCBlbmR4ID0gMDsgZW5keCA8IF9ldmVudHMubGVuZ3RoOyBlbmR4KyspIHtcbiAgICAgICAgICAgICAgICB2YXIgbnNFdmVudCA9IF9ldmVudHNbZW5keF0uc3BsaXQoXCIuXCIpLCBldiA9IG5zRXZlbnRbMF0sIG5hbWVzcGFjZSA9IG5zRXZlbnRbMV0gfHwgXCJnbG9iYWxcIjtcbiAgICAgICAgICAgICAgICBpZiAodm9pZCAwICE9PSBkb2N1bWVudCAmJiBcImdsb2JhbFwiID09PSBuYW1lc3BhY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV2bnQsIGksIHBhcmFtcyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ1YmJsZXM6ICEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FuY2VsYWJsZTogITAsXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXRhaWw6IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMSlcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvY3VtZW50LmNyZWF0ZUV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2bnQgPSBuZXcgQ3VzdG9tRXZlbnQoZXYsIHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICA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Hx8IHt9LCBvd25lci5fX2RhdGFba2V5XSA9IHZhbHVlO1xuICAgIH0sIFwiZnVuY3Rpb25cIiA9PSB0eXBlb2Ygd2luZG93LkN1c3RvbUV2ZW50ID8gRGVwZW5kZW5jeUxpYi5FdmVudCA9IHdpbmRvdy5DdXN0b21FdmVudCA6IChEZXBlbmRlbmN5TGliLkV2ZW50ID0gZnVuY3Rpb24oZXZlbnQsIHBhcmFtcykge1xuICAgICAgICBwYXJhbXMgPSBwYXJhbXMgfHwge1xuICAgICAgICAgICAgYnViYmxlczogITEsXG4gICAgICAgICAgICBjYW5jZWxhYmxlOiAhMSxcbiAgICAgICAgICAgIGRldGFpbDogdm9pZCAwXG4gICAgICAgIH07XG4gICAgICAgIHZhciBldnQgPSBkb2N1bWVudC5jcmVhdGVFdmVudChcIkN1c3RvbUV2ZW50XCIpO1xuICAgICAgICByZXR1cm4gZXZ0LmluaXRDdXN0b21FdmVudChldmVudCwgcGFyYW1zLmJ1YmJsZXMsIHBhcmFtcy5jYW5jZWxhYmxlLCBwYXJhbXMuZGV0YWlsKSwgXG4gICAgICAgIGV2dDtcbiAgICB9LCBEZXBlbmRlbmN5TGliLkV2ZW50LnByb3RvdHlwZSA9IHdpbmRvdy5FdmVudC5wcm90b3R5cGUpLCBEZXBlbmRlbmN5TGliO1xufSk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2RlcGVuZGVuY3lMaWJzL2lucHV0bWFzay5kZXBlbmRlbmN5TGliLmpzXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0=\\n//# sourceURL=webpack-internal:///0\\n\");\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* inputmask.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(2), __webpack_require__(3) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"./dependencyLibs/inputmask.dependencyLib\\\"), require(\\\"./global/window\\\"), require(\\\"./global/document\\\")) : window.Inputmask = factory(window.dependencyLib || jQuery, window, document);\\n}(function($, window, document, undefined) {\\n function Inputmask(alias, options, internal) {\\n if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);\\n this.el = undefined, this.events = {}, this.maskset = undefined, this.refreshValue = !1, \\n !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {}, \\n options.alias = alias), this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && options.definitions !== undefined, \\n this.userOptions = options || {}, this.isRTL = this.opts.numericInput, resolveAlias(this.opts.alias, options, this.opts));\\n }\\n function resolveAlias(aliasStr, options, opts) {\\n var aliasDefinition = Inputmask.prototype.aliases[aliasStr];\\n return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, undefined, opts), \\n $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr), \\n !1);\\n }\\n function generateMaskSet(opts, nocache) {\\n function generateMask(mask, metadata, opts) {\\n var regexMask = !1;\\n if (null !== mask && \\\"\\\" !== mask || (regexMask = null !== opts.regex, regexMask ? (mask = opts.regex, \\n mask = mask.replace(/^(\\\\^)(.*)(\\\\$)$/, \\\"$2\\\")) : (regexMask = !0, mask = \\\".*\\\")), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = \\\"\\\"), \\n opts.repeat > 0 || \\\"*\\\" === opts.repeat || \\\"+\\\" === opts.repeat) {\\n var repeatStart = \\\"*\\\" === opts.repeat ? 0 : \\\"+\\\" === opts.repeat ? 1 : opts.repeat;\\n mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + \\\",\\\" + opts.repeat + opts.quantifiermarker.end;\\n }\\n var masksetDefinition, maskdefKey = regexMask ? \\\"regex_\\\" + opts.regex : opts.numericInput ? mask.split(\\\"\\\").reverse().join(\\\"\\\") : mask;\\n return Inputmask.prototype.masksCache[maskdefKey] === undefined || !0 === nocache ? (masksetDefinition = {\\n mask: mask,\\n maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),\\n validPositions: {},\\n _buffer: undefined,\\n buffer: undefined,\\n tests: {},\\n metadata: metadata,\\n maskLength: undefined\\n }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition, \\n masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]), \\n masksetDefinition;\\n }\\n if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) {\\n if (opts.mask.length > 1) {\\n opts.keepStatic = null === opts.keepStatic || opts.keepStatic;\\n var altMask = opts.groupmarker.start;\\n return $.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {\\n altMask.length > 1 && (altMask += opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start), \\n msk.mask === undefined || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask;\\n }), altMask += opts.groupmarker.end, generateMask(altMask, opts.mask, opts);\\n }\\n opts.mask = opts.mask.pop();\\n }\\n return opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts);\\n }\\n function maskScope(actionObj, maskset, opts) {\\n function getMaskTemplate(baseOnInput, minimalPos, includeMode) {\\n minimalPos = minimalPos || 0;\\n var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0, lvp = getLastValidPosition();\\n do {\\n !0 === baseOnInput && getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos], \\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), \\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || \\\"number\\\" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))), \\n pos++;\\n } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || \\\"\\\" !== test.def) || minimalPos > pos);\\n return \\\"\\\" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), getMaskSet().maskLength = pos + 1, \\n maskTemplate;\\n }\\n function getMaskSet() {\\n return maskset;\\n }\\n function resetMaskSet(soft) {\\n var maskset = getMaskSet();\\n maskset.buffer = undefined, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0);\\n }\\n function getLastValidPosition(closestTo, strict, validPositions) {\\n var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;\\n closestTo === undefined && (closestTo = -1);\\n for (var posNdx in valids) {\\n var psNdx = parseInt(posNdx);\\n valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx), \\n psNdx >= closestTo && (after = psNdx));\\n }\\n return -1 !== before && closestTo - before > 1 || after < closestTo ? before : after;\\n }\\n function stripValidPositions(start, end, nocheck, strict) {\\n var i, startPos = start, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), needsValidation = !1;\\n for (getMaskSet().p = start, i = end - 1; i >= startPos; i--) getMaskSet().validPositions[i] !== undefined && (!0 !== nocheck && (!getMaskSet().validPositions[i].match.optionality && function(pos) {\\n var posMatch = getMaskSet().validPositions[pos];\\n if (posMatch !== undefined && null === posMatch.match.fn) {\\n var prevMatch = getMaskSet().validPositions[pos - 1], nextMatch = getMaskSet().validPositions[pos + 1];\\n return prevMatch !== undefined && nextMatch !== undefined;\\n }\\n return !1;\\n }(i) || !1 === opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) || delete getMaskSet().validPositions[i]);\\n for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {\\n for (;getMaskSet().validPositions[startPos] !== undefined; ) startPos++;\\n if (i < startPos && (i = startPos + 1), getMaskSet().validPositions[i] === undefined && isMask(i)) i++; else {\\n var t = getTestTemplate(i);\\n !1 === needsValidation && positionsClone[startPos] && positionsClone[startPos].match.def === t.match.def ? (getMaskSet().validPositions[startPos] = $.extend(!0, {}, positionsClone[startPos]), \\n getMaskSet().validPositions[startPos].input = t.input, delete getMaskSet().validPositions[i], \\n i++) : positionCanMatchDefinition(startPos, t.match.def) ? !1 !== isValid(startPos, t.input || getPlaceholder(i), !0) && (delete getMaskSet().validPositions[i], \\n i++, needsValidation = !0) : isMask(i) || (i++, startPos--), startPos++;\\n }\\n }\\n resetMaskSet(!0);\\n }\\n function determineTestTemplate(tests, guessNextBest) {\\n for (var testPos, testPositions = tests, lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation].toString().split(\\\",\\\") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx], \\n !(testPos.match && (opts.greedy && !0 !== testPos.match.optionalQuantifier || (!1 === testPos.match.optionality || !1 === testPos.match.newBlockMarker) && !0 !== testPos.match.optionalQuantifier) && (lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation || testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\\\",\\\"), lvTestAltArr))) || !0 === guessNextBest && (null !== testPos.match.fn || /[0-9a-bA-Z]/.test(testPos.match.def))); ndx++) ;\\n return testPos;\\n }\\n function getTestTemplate(pos, ndxIntlzr, tstPs) {\\n return getMaskSet().validPositions[pos] || determineTestTemplate(getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));\\n }\\n function getTest(pos) {\\n return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos] : getTests(pos)[0];\\n }\\n function positionCanMatchDefinition(pos, def) {\\n for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def === def) {\\n valid = !0;\\n break;\\n }\\n return valid;\\n }\\n function getTests(pos, ndxIntlzr, tstPs) {\\n function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {\\n function handleMatch(match, loopNdx, quantifierRecurse) {\\n function isFirstMatch(latestMatch, tokenGroup) {\\n var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches);\\n return firstMatch || $.each(tokenGroup.matches, function(ndx, match) {\\n if (!0 === match.isQuantifier && (firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]))) return !1;\\n }), firstMatch;\\n }\\n function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {\\n var bestMatch, indexPos;\\n if (getMaskSet().validPositions[pos - 1] && targetAlternation && getMaskSet().tests[pos]) for (var vpAlternation = getMaskSet().validPositions[pos - 1].locator, tpAlternation = getMaskSet().tests[pos][0].locator, i = 0; i < targetAlternation; i++) if (vpAlternation[i] !== tpAlternation[i]) return vpAlternation.slice(targetAlternation + 1);\\n return (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) && $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {\\n var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;\\n (indexPos === undefined || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt, \\n indexPos = ndxPos);\\n }), bestMatch ? bestMatch.locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1) : targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;\\n }\\n if (testPos > 1e4) 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;\\n if (testPos === pos && match.matches === undefined) return matches.push({\\n match: match,\\n locator: loopNdx.reverse(),\\n cd: cacheDependency\\n }), !0;\\n if (match.matches !== undefined) {\\n if (match.isGroup && quantifierRecurse !== match) {\\n if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx)) return !0;\\n } else if (match.isOptional) {\\n var optionalToken = match;\\n if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) {\\n if (latestMatch = matches[matches.length - 1].match, !isFirstMatch(latestMatch, optionalToken)) return !0;\\n insertStop = !0, testPos = pos;\\n }\\n } else if (match.isAlternator) {\\n var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\\n if (-1 === altIndex || \\\"string\\\" == typeof altIndex) {\\n var amndx, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [];\\n if (\\\"string\\\" == typeof altIndex) altIndexArr = altIndex.split(\\\",\\\"); else for (amndx = 0; amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx);\\n for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\\n if (amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(), \\n !0 !== (match = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match) && match !== undefined && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {\\n var ntndx = $.inArray(match, maskToken.matches) + 1;\\n maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse)) && (altIndexArr.push(ntndx.toString()), \\n $.each(matches, function(ndx, lmnt) {\\n lmnt.alternation = loopNdx.length - 1;\\n }));\\n }\\n maltMatches = matches.slice(), testPos = currentPos, matches = [];\\n for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\\n var altMatch = maltMatches[ndx1], dropMatch = !1;\\n altMatch.alternation = altMatch.alternation || loopNdxCnt;\\n for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\\n var altMatch2 = malternateMatches[ndx2];\\n if (\\\"string\\\" != typeof altIndex || -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) {\\n if (function(source, target) {\\n return source.match.nativeDef === target.match.nativeDef || source.match.def === target.match.nativeDef || source.match.nativeDef === target.match.def;\\n }(altMatch, altMatch2)) {\\n dropMatch = !0, altMatch.alternation === altMatch2.alternation && -1 === altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) && (altMatch2.locator[altMatch2.alternation] = altMatch2.locator[altMatch2.alternation] + \\\",\\\" + altMatch.locator[altMatch.alternation], \\n altMatch2.alternation = altMatch.alternation), altMatch.match.nativeDef === altMatch2.match.def && (altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation], \\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 1, altMatch));\\n break;\\n }\\n if (altMatch.match.def === altMatch2.match.def) {\\n dropMatch = !1;\\n break;\\n }\\n if (function(source, target) {\\n return null === source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def, getMaskSet(), pos, !1, opts, !1);\\n }(altMatch, altMatch2) || function(source, target) {\\n return null !== source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def.replace(/[\\\\[\\\\]]/g, \\\"\\\"), getMaskSet(), pos, !1, opts, !1);\\n }(altMatch, altMatch2)) {\\n altMatch.alternation === altMatch2.alternation && -1 === altMatch.locator[altMatch.alternation].toString().indexOf(altMatch2.locator[altMatch2.alternation].toString().split(\\\"\\\")[0]) && (altMatch.na = altMatch.na || altMatch.locator[altMatch.alternation].toString(), \\n -1 === altMatch.na.indexOf(altMatch.locator[altMatch.alternation].toString().split(\\\"\\\")[0]) && (altMatch.na = altMatch.na + \\\",\\\" + altMatch.locator[altMatch2.alternation].toString().split(\\\"\\\")[0]), \\n dropMatch = !0, altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation].toString().split(\\\"\\\")[0] + \\\",\\\" + altMatch.locator[altMatch.alternation], \\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch));\\n break;\\n }\\n }\\n }\\n dropMatch || malternateMatches.push(altMatch);\\n }\\n }\\n \\\"string\\\" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) {\\n if (isFinite(ndx)) {\\n var alternation = lmnt.alternation, altLocArr = lmnt.locator[alternation].toString().split(\\\",\\\");\\n lmnt.locator[alternation] = undefined, lmnt.alternation = undefined;\\n for (var alndx = 0; alndx < altLocArr.length; alndx++) -1 !== $.inArray(altLocArr[alndx], altIndexArr) && (lmnt.locator[alternation] !== undefined ? (lmnt.locator[alternation] += \\\",\\\", \\n lmnt.locator[alternation] += altLocArr[alndx]) : lmnt.locator[alternation] = parseInt(altLocArr[alndx]), \\n lmnt.alternation = alternation);\\n if (lmnt.locator[alternation] !== undefined) return lmnt;\\n }\\n })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0, \\n match = malternateMatches.length > 0, ndxInitializer = ndxInitializerClone.slice();\\n } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);\\n if (match) return !0;\\n } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {\\n var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\\n if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup)) {\\n if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1, \\n isFirstMatch(latestMatch, tokenGroup)) {\\n if (qndx > qt.quantifier.min - 1) {\\n insertStop = !0, testPos = pos;\\n break;\\n }\\n return !0;\\n }\\n return !0;\\n }\\n } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0;\\n } else testPos++;\\n }\\n for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) {\\n var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);\\n if (match && testPos === pos) return match;\\n if (testPos > pos) break;\\n }\\n }\\n function filterTests(tests) {\\n if (opts.keepStatic && pos > 0 && tests.length > 1 + (\\\"\\\" === tests[tests.length - 1].match.def ? 1 : 0) && !0 !== tests[0].match.optionality && !0 !== tests[0].match.optionalQuantifier && null === tests[0].match.fn && !/[0-9a-bA-Z]/.test(tests[0].match.def)) {\\n if (getMaskSet().validPositions[pos - 1] === undefined) return [ determineTestTemplate(tests) ];\\n if (getMaskSet().validPositions[pos - 1].alternation === tests[0].alternation) return [ determineTestTemplate(tests) ];\\n if (getMaskSet().validPositions[pos - 1]) return [ determineTestTemplate(tests) ];\\n }\\n return tests;\\n }\\n var latestMatch, maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, cacheDependency = ndxIntlzr ? ndxIntlzr.join(\\\"\\\") : \\\"\\\";\\n if (pos > -1) {\\n if (ndxIntlzr === undefined) {\\n for (var test, previousPos = pos - 1; (test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1; ) previousPos--;\\n test !== undefined && previousPos > -1 && (ndxInitializer = function(tests) {\\n var locator = [];\\n return $.isArray(tests) || (tests = [ tests ]), tests.length > 0 && (tests[0].alternation === undefined ? (locator = determineTestTemplate(tests.slice()).locator.slice(), \\n 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) {\\n if (\\\"\\\" !== tst.def) if (0 === locator.length) locator = tst.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += \\\",\\\" + tst.locator[i]);\\n })), locator;\\n }(test), cacheDependency = ndxInitializer.join(\\\"\\\"), testPos = previousPos);\\n }\\n if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) return filterTests(getMaskSet().tests[pos]);\\n for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {\\n if (resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]) && testPos === pos || testPos > pos) break;\\n }\\n }\\n return (0 === matches.length || insertStop) && matches.push({\\n match: {\\n fn: null,\\n cardinality: 0,\\n optionality: !0,\\n casing: null,\\n def: \\\"\\\",\\n placeholder: \\\"\\\"\\n },\\n locator: [],\\n cd: cacheDependency\\n }), ndxIntlzr !== undefined && getMaskSet().tests[pos] ? filterTests($.extend(!0, [], matches)) : (getMaskSet().tests[pos] = $.extend(!0, [], matches), \\n filterTests(getMaskSet().tests[pos]));\\n }\\n function getBufferTemplate() {\\n return getMaskSet()._buffer === undefined && (getMaskSet()._buffer = getMaskTemplate(!1, 1), \\n getMaskSet().buffer === undefined && (getMaskSet().buffer = getMaskSet()._buffer.slice())), \\n getMaskSet()._buffer;\\n }\\n function getBuffer(noCache) {\\n return getMaskSet().buffer !== undefined && !0 !== noCache || (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)), \\n getMaskSet().buffer;\\n }\\n function refreshFromBuffer(start, end, buffer) {\\n var i, p;\\n if (!0 === start) resetMaskSet(), start = 0, end = buffer.length; else for (i = start; i < end; i++) delete getMaskSet().validPositions[i];\\n for (p = start, i = start; i < end; i++) if (resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter) {\\n var valResult = isValid(p, buffer[i], !0, !0);\\n !1 !== valResult && (resetMaskSet(!0), p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1);\\n }\\n }\\n function casing(elem, test, pos) {\\n switch (opts.casing || test.casing) {\\n case \\\"upper\\\":\\n elem = elem.toUpperCase();\\n break;\\n\\n case \\\"lower\\\":\\n elem = elem.toLowerCase();\\n break;\\n\\n case \\\"title\\\":\\n var posBefore = getMaskSet().validPositions[pos - 1];\\n elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase();\\n break;\\n\\n default:\\n if ($.isFunction(opts.casing)) {\\n var args = Array.prototype.slice.call(arguments);\\n args.push(getMaskSet().validPositions), elem = opts.casing.apply(this, args);\\n }\\n }\\n return elem;\\n }\\n function checkAlternationMatch(altArr1, altArr2, na) {\\n for (var naNdx, altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = na !== undefined ? na.split(\\\",\\\") : [], i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1);\\n for (var alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {\\n isMatch = !0;\\n break;\\n }\\n return isMatch;\\n }\\n function isValid(pos, c, strict, fromSetValid, fromAlternate, validateOnly) {\\n function isSelection(posObj) {\\n var selection = isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end == 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin == 1;\\n return selection && 0 === posObj.begin && posObj.end === getMaskSet().maskLength ? \\\"full\\\" : selection;\\n }\\n function _isValid(position, c, strict) {\\n var rslt = !1;\\n return $.each(getTests(position), function(ndx, tst) {\\n for (var test = tst.match, loopend = c ? 1 : 0, chrs = \\\"\\\", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));\\n if (c && (chrs += c), getBuffer(!0), !1 !== (rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && \\\"\\\" !== test.def && {\\n c: getPlaceholder(position, test, !0) || test.def,\\n pos: position\\n })) {\\n var elem = rslt.c !== undefined ? rslt.c : c;\\n elem = elem === opts.skipOptionalPartCharacter && null === test.fn ? getPlaceholder(position, test, !0) || test.def : elem;\\n var validatedPos = position, possibleModifiedBuffer = getBuffer();\\n if (rslt.remove !== undefined && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]), \\n $.each(rslt.remove.sort(function(a, b) {\\n return b - a;\\n }), function(ndx, lmnt) {\\n stripValidPositions(lmnt, lmnt + 1, !0);\\n })), rslt.insert !== undefined && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]), \\n $.each(rslt.insert.sort(function(a, b) {\\n return a - b;\\n }), function(ndx, lmnt) {\\n isValid(lmnt.pos, lmnt.c, !0, fromSetValid);\\n })), rslt.refreshFromBuffer) {\\n var refresh = rslt.refreshFromBuffer;\\n if (refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, possibleModifiedBuffer), \\n rslt.pos === undefined && rslt.c === undefined) return rslt.pos = getLastValidPosition(), \\n !1;\\n if ((validatedPos = rslt.pos !== undefined ? rslt.pos : position) !== position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0, fromSetValid)), \\n !1;\\n } else if (!0 !== rslt && rslt.pos !== undefined && rslt.pos !== position && (validatedPos = rslt.pos, \\n refreshFromBuffer(position, validatedPos, getBuffer().slice()), validatedPos !== position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), \\n !1;\\n return (!0 === rslt || rslt.pos !== undefined || rslt.c !== undefined) && (ndx > 0 && resetMaskSet(!0), \\n setValidPosition(validatedPos, $.extend({}, tst, {\\n input: casing(elem, test, validatedPos)\\n }), fromSetValid, isSelection(pos)) || (rslt = !1), !1);\\n }\\n }), rslt;\\n }\\n function setValidPosition(pos, validTest, fromSetValid, isSelection) {\\n if (isSelection || opts.insertMode && getMaskSet().validPositions[pos] !== undefined && fromSetValid === undefined) {\\n var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, !0);\\n for (i = pos; i <= lvp; i++) delete getMaskSet().validPositions[i];\\n getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);\\n var j, valid = !0, vps = getMaskSet().validPositions, needsValidation = !1, initialLength = getMaskSet().maskLength;\\n for (i = j = pos; i <= lvp; i++) {\\n var t = positionsClone[i];\\n if (t !== undefined) for (var posMatch = j; posMatch < getMaskSet().maskLength && (null === t.match.fn && vps[i] && (!0 === vps[i].match.optionalQuantifier || !0 === vps[i].match.optionality) || null != t.match.fn); ) {\\n if (posMatch++, !1 === needsValidation && positionsClone[posMatch] && positionsClone[posMatch].match.def === t.match.def) getMaskSet().validPositions[posMatch] = $.extend(!0, {}, positionsClone[posMatch]), \\n getMaskSet().validPositions[posMatch].input = t.input, fillMissingNonMask(posMatch), \\n j = posMatch, valid = !0; else if (positionCanMatchDefinition(posMatch, t.match.def)) {\\n var result = isValid(posMatch, t.input, !0, !0);\\n valid = !1 !== result, j = result.caret || result.insert ? getLastValidPosition() : posMatch, \\n needsValidation = !0;\\n } else if (!(valid = !0 === t.generatedInput) && posMatch >= getMaskSet().maskLength - 1) break;\\n if (getMaskSet().maskLength < initialLength && (getMaskSet().maskLength = initialLength), \\n valid) break;\\n }\\n if (!valid) break;\\n }\\n if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone), \\n resetMaskSet(!0), !1;\\n } else getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);\\n return resetMaskSet(!0), !0;\\n }\\n function fillMissingNonMask(maskPos) {\\n for (var pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;\\n var testTemplate, testsFromPos;\\n for (pndx++; pndx < maskPos; pndx++) getMaskSet().validPositions[pndx] === undefined && (!1 === opts.jitMasking || opts.jitMasking > pndx) && (testsFromPos = getTests(pndx, getTestTemplate(pndx - 1).locator, pndx - 1).slice(), \\n \\\"\\\" === testsFromPos[testsFromPos.length - 1].match.def && testsFromPos.pop(), (testTemplate = determineTestTemplate(testsFromPos)) && (testTemplate.match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && !1 !== (result = _isValid(pndx, getPlaceholder(pndx, testTemplate.match, !0) || (null == testTemplate.match.fn ? testTemplate.match.def : \\\"\\\" !== getPlaceholder(pndx) ? getPlaceholder(pndx) : getBuffer()[pndx]), !0)) && (getMaskSet().validPositions[result.pos || pndx].generatedInput = !0));\\n }\\n strict = !0 === strict;\\n var maskPos = pos;\\n pos.begin !== undefined && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);\\n var result = !0, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);\\n if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && !0 !== validateOnly && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)), \\n !0 === result) {\\n if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos, !0, !0), \\n maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict), \\n (!strict || !0 === fromSetValid) && !1 === result && !0 !== validateOnly)) {\\n var currentPosValid = getMaskSet().validPositions[maskPos];\\n if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {\\n if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && !isMask(maskPos, !0)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (!1 !== (result = _isValid(nPos, c, strict))) {\\n !function(originalPos, newPos) {\\n var vp = getMaskSet().validPositions[newPos];\\n if (vp) for (var targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; ps < newPos; ps++) if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, !0)) {\\n var tests = getTests(ps).slice(), bestMatch = determineTestTemplate(tests, !0), equality = -1;\\n \\\"\\\" === tests[tests.length - 1].match.def && tests.pop(), $.each(tests, function(ndx, tst) {\\n for (var i = 0; i < tll; i++) {\\n if (tst.locator[i] === undefined || !checkAlternationMatch(tst.locator[i].toString().split(\\\",\\\"), targetLocator[i].toString().split(\\\",\\\"), tst.na)) {\\n var targetAI = targetLocator[i], bestMatchAI = bestMatch.locator[i], tstAI = tst.locator[i];\\n targetAI - bestMatchAI > Math.abs(targetAI - tstAI) && (bestMatch = tst);\\n break;\\n }\\n equality < i && (equality = i, bestMatch = tst);\\n }\\n }), bestMatch = $.extend({}, bestMatch, {\\n input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def\\n }), bestMatch.generatedInput = !0, setValidPosition(ps, bestMatch, !0), getMaskSet().validPositions[newPos] = undefined, \\n _isValid(newPos, vp.input, !0);\\n }\\n }(maskPos, result.pos !== undefined ? result.pos : nPos), maskPos = nPos;\\n break;\\n }\\n } else result = {\\n caret: seekNext(maskPos)\\n };\\n }\\n !1 === result && opts.keepStatic && !strict && !0 !== fromAlternate && (result = function(pos, c, strict) {\\n var lastAlt, alternation, altPos, prevAltPos, i, validPos, altNdxs, decisionPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions), isValidRslt = !1, lAltPos = getLastValidPosition();\\n for (prevAltPos = getMaskSet().validPositions[lAltPos]; lAltPos >= 0; lAltPos--) if ((altPos = getMaskSet().validPositions[lAltPos]) && altPos.alternation !== undefined) {\\n if (lastAlt = lAltPos, alternation = getMaskSet().validPositions[lastAlt].alternation, \\n prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break;\\n prevAltPos = altPos;\\n }\\n if (alternation !== undefined) {\\n decisionPos = parseInt(lastAlt);\\n var decisionTaker = prevAltPos.locator[prevAltPos.alternation || alternation] !== undefined ? prevAltPos.locator[prevAltPos.alternation || alternation] : altNdxs[0];\\n decisionTaker.length > 0 && (decisionTaker = decisionTaker.split(\\\",\\\")[0]);\\n var possibilityPos = getMaskSet().validPositions[decisionPos], prevPos = getMaskSet().validPositions[decisionPos - 1];\\n $.each(getTests(decisionPos, prevPos ? prevPos.locator : undefined, decisionPos - 1), function(ndx, test) {\\n altNdxs = test.locator[alternation] ? test.locator[alternation].toString().split(\\\",\\\") : [];\\n for (var mndx = 0; mndx < altNdxs.length; mndx++) {\\n var validInputs = [], staticInputsBeforePos = 0, staticInputsBeforePosAlternate = 0, verifyValidInput = !1;\\n if (decisionTaker < altNdxs[mndx] && (test.na === undefined || -1 === $.inArray(altNdxs[mndx], test.na.split(\\\",\\\")) || -1 === $.inArray(decisionTaker.toString(), altNdxs))) {\\n getMaskSet().validPositions[decisionPos] = $.extend(!0, {}, test);\\n var possibilities = getMaskSet().validPositions[decisionPos].locator;\\n for (getMaskSet().validPositions[decisionPos].locator[alternation] = parseInt(altNdxs[mndx]), \\n null == test.match.fn ? (possibilityPos.input !== test.match.def && (verifyValidInput = !0, \\n !0 !== possibilityPos.generatedInput && validInputs.push(possibilityPos.input)), \\n staticInputsBeforePosAlternate++, getMaskSet().validPositions[decisionPos].generatedInput = !/[0-9a-bA-Z]/.test(test.match.def), \\n getMaskSet().validPositions[decisionPos].input = test.match.def) : getMaskSet().validPositions[decisionPos].input = possibilityPos.input, \\n i = decisionPos + 1; i < getLastValidPosition(undefined, !0) + 1; i++) validPos = getMaskSet().validPositions[i], \\n validPos && !0 !== validPos.generatedInput && /[0-9a-bA-Z]/.test(validPos.input) ? validInputs.push(validPos.input) : i < pos && staticInputsBeforePos++, \\n delete getMaskSet().validPositions[i];\\n for (verifyValidInput && validInputs[0] === test.match.def && validInputs.shift(), \\n resetMaskSet(!0), isValidRslt = !0; validInputs.length > 0; ) {\\n var input = validInputs.shift();\\n if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;\\n }\\n if (isValidRslt) {\\n getMaskSet().validPositions[decisionPos].locator = possibilities;\\n var targetLvp = getLastValidPosition(pos) + 1;\\n for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) ((validPos = getMaskSet().validPositions[i]) === undefined || null == validPos.match.fn) && i < pos + (staticInputsBeforePosAlternate - staticInputsBeforePos) && staticInputsBeforePosAlternate++;\\n pos += staticInputsBeforePosAlternate - staticInputsBeforePos, isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, !0);\\n }\\n if (isValidRslt) return !1;\\n resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone);\\n }\\n }\\n });\\n }\\n return isValidRslt;\\n }(maskPos, c, strict)), !0 === result && (result = {\\n pos: maskPos\\n });\\n }\\n if ($.isFunction(opts.postValidation) && !1 !== result && !strict && !0 !== fromSetValid && !0 !== validateOnly) {\\n var postResult = opts.postValidation(getBuffer(!0), result, opts);\\n if (postResult.refreshFromBuffer && postResult.buffer) {\\n var refresh = postResult.refreshFromBuffer;\\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, postResult.buffer);\\n }\\n result = !0 === postResult ? result : postResult;\\n }\\n return result && result.pos === undefined && (result.pos = maskPos), !1 !== result && !0 !== validateOnly || (resetMaskSet(!0), \\n getMaskSet().validPositions = $.extend(!0, {}, positionsClone)), result;\\n }\\n function isMask(pos, strict) {\\n var test = getTestTemplate(pos).match;\\n if (\\\"\\\" === test.def && (test = getTest(pos).match), null != test.fn) return test.fn;\\n if (!0 !== strict && pos > -1) {\\n var tests = getTests(pos);\\n return tests.length > 1 + (\\\"\\\" === tests[tests.length - 1].match.def ? 1 : 0);\\n }\\n return !1;\\n }\\n function seekNext(pos, newBlock) {\\n var maskL = getMaskSet().maskLength;\\n if (pos >= maskL) return maskL;\\n var position = pos;\\n for (getTests(maskL + 1).length > 1 && (getMaskTemplate(!0, maskL + 1, !0), maskL = getMaskSet().maskLength); ++position < maskL && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position)) || !0 !== newBlock && !isMask(position)); ) ;\\n return position;\\n }\\n function seekPrevious(pos, newBlock) {\\n var tests, position = pos;\\n if (position <= 0) return 0;\\n for (;--position > 0 && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position) && (tests = getTests(position), \\n tests.length < 2 || 2 === tests.length && \\\"\\\" === tests[1].match.def)); ) ;\\n return position;\\n }\\n function getBufferElement(position) {\\n return getMaskSet().validPositions[position] === undefined ? getPlaceholder(position) : getMaskSet().validPositions[position].input;\\n }\\n function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) {\\n if (event && $.isFunction(opts.onBeforeWrite)) {\\n var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);\\n if (result) {\\n if (result.refreshFromBuffer) {\\n var refresh = result.refreshFromBuffer;\\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer), \\n buffer = getBuffer(!0);\\n }\\n caretPos !== undefined && (caretPos = result.caret !== undefined ? result.caret : caretPos);\\n }\\n }\\n input !== undefined && (input.inputmask._valueSet(buffer.join(\\\"\\\")), caretPos === undefined || event !== undefined && \\\"blur\\\" === event.type ? renderColorMask(input, caretPos, 0 === buffer.length) : android && event && \\\"input\\\" === event.type ? setTimeout(function() {\\n caret(input, caretPos);\\n }, 0) : caret(input, caretPos), !0 === triggerInputEvent && (skipInputEvent = !0, \\n $(input).trigger(\\\"input\\\")));\\n }\\n function getPlaceholder(pos, test, returnPL) {\\n if (test = test || getTest(pos).match, test.placeholder !== undefined || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;\\n if (null === test.fn) {\\n if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {\\n var prevTest, tests = getTests(pos), staticAlternations = [];\\n if (tests.length > 1 + (\\\"\\\" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if (!0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (null === tests[i].match.fn || prevTest === undefined || !1 !== tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, !0, opts)) && (staticAlternations.push(tests[i]), \\n null === tests[i].match.fn && (prevTest = tests[i]), staticAlternations.length > 1 && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length);\\n }\\n return test.def;\\n }\\n return opts.placeholder.charAt(pos % opts.placeholder.length);\\n }\\n function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {\\n function isTemplateMatch(ndx, charCodes) {\\n return -1 !== getBufferTemplate().slice(ndx, seekNext(ndx)).join(\\\"\\\").indexOf(charCodes) && !isMask(ndx) && getTest(ndx).match.nativeDef === charCodes.charAt(charCodes.length - 1);\\n }\\n var inputValue = nptvl.slice(), charCodes = \\\"\\\", initialNdx = -1, result = undefined;\\n if (resetMaskSet(), strict || !0 === opts.autoUnmask) initialNdx = seekNext(initialNdx); else {\\n var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(\\\"\\\"), matches = inputValue.join(\\\"\\\").match(new RegExp(\\\"^\\\" + Inputmask.escapeRegex(staticInput), \\\"g\\\"));\\n matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length), \\n initialNdx = seekNext(initialNdx));\\n }\\n if (-1 === initialNdx ? (getMaskSet().p = seekNext(initialNdx), initialNdx = 0) : getMaskSet().p = initialNdx, \\n $.each(inputValue, function(ndx, charCode) {\\n if (charCode !== undefined) if (getMaskSet().validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, !0) && !1 === isValid(ndx, inputValue[ndx], !0, undefined, undefined, !0)) getMaskSet().p++; else {\\n var keypress = new $.Event(\\\"_checkval\\\");\\n keypress.which = charCode.charCodeAt(0), charCodes += charCode;\\n var lvp = getLastValidPosition(undefined, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : undefined, lvp);\\n if (!isTemplateMatch(initialNdx, charCodes) || strict || opts.autoUnmask) {\\n var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p;\\n result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, pos), \\n initialNdx = pos + 1, charCodes = \\\"\\\";\\n } else result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1);\\n if (!1 !== result && !strict && $.isFunction(opts.onBeforeWrite)) {\\n var origResult = result;\\n if (result = opts.onBeforeWrite.call(inputmask, keypress, getBuffer(), result.forwardPosition, opts), \\n (result = $.extend(origResult, result)) && result.refreshFromBuffer) {\\n var refresh = result.refreshFromBuffer;\\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer), \\n resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret, result.forwardPosition = result.caret);\\n }\\n }\\n }\\n }), writeOut) {\\n var caretPos = undefined;\\n document.activeElement === input && result && (caretPos = opts.numericInput ? seekPrevious(result.forwardPosition) : result.forwardPosition), \\n writeBuffer(input, getBuffer(), caretPos, initiatingEvent || new $.Event(\\\"checkval\\\"), initiatingEvent && \\\"input\\\" === initiatingEvent.type);\\n }\\n }\\n function unmaskedvalue(input) {\\n if (input) {\\n if (input.inputmask === undefined) return input.value;\\n input.inputmask && input.inputmask.refreshValue && EventHandlers.setValueEvent.call(input);\\n }\\n var umValue = [], vps = getMaskSet().validPositions;\\n for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input);\\n var unmaskedValue = 0 === umValue.length ? \\\"\\\" : (isRTL ? umValue.reverse() : umValue).join(\\\"\\\");\\n if ($.isFunction(opts.onUnMask)) {\\n var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\\\"\\\");\\n unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);\\n }\\n return unmaskedValue;\\n }\\n function caret(input, begin, end, notranslate) {\\n function translatePosition(pos) {\\n if (!0 !== notranslate && isRTL && \\\"number\\\" == typeof pos && (!opts.greedy || \\\"\\\" !== opts.placeholder)) {\\n pos = getBuffer().join(\\\"\\\").length - pos;\\n }\\n return pos;\\n }\\n var range;\\n if (begin === undefined) return input.setSelectionRange ? (begin = input.selectionStart, \\n end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0), \\n range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset, \\n end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(), \\n begin = 0 - range.duplicate().moveStart(\\\"character\\\", -input.inputmask._valueGet().length), \\n end = begin + range.text.length), {\\n begin: translatePosition(begin),\\n end: translatePosition(end)\\n };\\n if (begin.begin !== undefined && (end = begin.end, begin = begin.begin), \\\"number\\\" == typeof begin) {\\n begin = translatePosition(begin), end = translatePosition(end), end = \\\"number\\\" == typeof end ? end : begin;\\n var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;\\n if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, mobile || !1 !== opts.insertMode || begin !== end || end++, \\n input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {\\n if (range = document.createRange(), input.firstChild === undefined || null === input.firstChild) {\\n var textNode = document.createTextNode(\\\"\\\");\\n input.appendChild(textNode);\\n }\\n range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length), \\n range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length), \\n range.collapse(!0);\\n var sel = window.getSelection();\\n sel.removeAllRanges(), sel.addRange(range);\\n } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0), \\n range.moveEnd(\\\"character\\\", end), range.moveStart(\\\"character\\\", begin), range.select());\\n renderColorMask(input, {\\n begin: begin,\\n end: end\\n });\\n }\\n }\\n function determineLastRequiredPosition(returnDefinition) {\\n var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined;\\n for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), \\n ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);\\n var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;\\n for (pos = bl - 1; pos > lvp && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && null != testPos.match.fn || null === testPos.match.fn && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\\\",\\\"), lvTestAlt.toString().split(\\\",\\\")) && \\\"\\\" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;\\n return returnDefinition ? {\\n l: bl,\\n def: positions[bl] ? positions[bl].match : undefined\\n } : bl;\\n }\\n function clearOptionalTail(buffer) {\\n for (var validPos, rl = determineLastRequiredPosition(), bl = buffer.length, lv = getMaskSet().validPositions[getLastValidPosition()]; rl < bl && !isMask(rl, !0) && (validPos = lv !== undefined ? getTestTemplate(rl, lv.locator.slice(\\\"\\\"), lv) : getTest(rl)) && !0 !== validPos.match.optionality && (!0 !== validPos.match.optionalQuantifier && !0 !== validPos.match.newBlockMarker || rl + 1 === bl && \\\"\\\" === (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(\\\"\\\"), lv) : getTest(rl + 1)).match.def); ) rl++;\\n for (;(validPos = getMaskSet().validPositions[rl - 1]) && validPos && validPos.match.optionality && validPos.input === opts.skipOptionalPartCharacter; ) rl--;\\n return buffer.splice(rl), buffer;\\n }\\n function isComplete(buffer) {\\n if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);\\n if (\\\"*\\\" === opts.repeat) return undefined;\\n var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);\\n if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {\\n complete = !0;\\n for (var i = 0; i <= aml; i++) {\\n var test = getTestTemplate(i).match;\\n if (null !== test.fn && getMaskSet().validPositions[i] === undefined && !0 !== test.optionality && !0 !== test.optionalQuantifier || null === test.fn && buffer[i] !== getPlaceholder(i, test)) {\\n complete = !1;\\n break;\\n }\\n }\\n }\\n return complete;\\n }\\n function handleRemove(input, k, pos, strict, fromIsValid) {\\n if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE), \\n isRTL)) {\\n var pend = pos.end;\\n pos.end = pos.begin, pos.begin = pend;\\n }\\n k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || !1 === opts.insertMode) ? (pos.begin = seekPrevious(pos.begin), \\n getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.begin--) : k === Inputmask.keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0) && getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint ? pos.end + 1 : seekNext(pos.end) + 1, \\n getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.end++), \\n stripValidPositions(pos.begin, pos.end, !1, strict), !0 !== strict && function() {\\n if (opts.keepStatic) {\\n for (var validInputs = [], lastAlt = getLastValidPosition(-1, !0), positionsClone = $.extend(!0, {}, getMaskSet().validPositions), prevAltPos = getMaskSet().validPositions[lastAlt]; lastAlt >= 0; lastAlt--) {\\n var altPos = getMaskSet().validPositions[lastAlt];\\n if (altPos) {\\n if (!0 !== altPos.generatedInput && /[0-9a-bA-Z]/.test(altPos.input) && validInputs.push(altPos.input), \\n delete getMaskSet().validPositions[lastAlt], altPos.alternation !== undefined && altPos.locator[altPos.alternation] !== prevAltPos.locator[altPos.alternation]) break;\\n prevAltPos = altPos;\\n }\\n }\\n if (lastAlt > -1) for (getMaskSet().p = seekNext(getLastValidPosition(-1, !0)); validInputs.length > 0; ) {\\n var keypress = new $.Event(\\\"keypress\\\");\\n keypress.which = validInputs.pop().charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);\\n } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);\\n }\\n }();\\n var lvp = getLastValidPosition(pos.begin, !0);\\n if (lvp < pos.begin) getMaskSet().p = seekNext(lvp); else if (!0 !== strict && (getMaskSet().p = pos.begin, \\n !0 !== fromIsValid)) for (;getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined; ) getMaskSet().p++;\\n }\\n function initializeColorMask(input) {\\n function findCaretPos(clientx) {\\n var caretPos, e = document.createElement(\\\"span\\\");\\n for (var style in computedStyle) isNaN(style) && -1 !== style.indexOf(\\\"font\\\") && (e.style[style] = computedStyle[style]);\\n e.style.textTransform = computedStyle.textTransform, e.style.letterSpacing = computedStyle.letterSpacing, \\n e.style.position = \\\"absolute\\\", e.style.height = \\\"auto\\\", e.style.width = \\\"auto\\\", \\n e.style.visibility = \\\"hidden\\\", e.style.whiteSpace = \\\"nowrap\\\", document.body.appendChild(e);\\n var itl, inputText = input.inputmask._valueGet(), previousWidth = 0;\\n for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {\\n if (e.innerHTML += inputText.charAt(caretPos) || \\\"_\\\", e.offsetWidth >= clientx) {\\n var offset1 = clientx - previousWidth, offset2 = e.offsetWidth - clientx;\\n e.innerHTML = inputText.charAt(caretPos), offset1 -= e.offsetWidth / 3, caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;\\n break;\\n }\\n previousWidth = e.offsetWidth;\\n }\\n return document.body.removeChild(e), caretPos;\\n }\\n var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null), template = document.createElement(\\\"div\\\");\\n template.style.width = computedStyle.width, template.style.textAlign = computedStyle.textAlign, \\n colorMask = document.createElement(\\\"div\\\"), colorMask.className = \\\"im-colormask\\\", \\n input.parentNode.insertBefore(colorMask, input), input.parentNode.removeChild(input), \\n colorMask.appendChild(template), colorMask.appendChild(input), input.style.left = template.offsetLeft + \\\"px\\\", \\n $(input).on(\\\"click\\\", function(e) {\\n return caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(input, [ e ]);\\n }), $(input).on(\\\"keydown\\\", function(e) {\\n e.shiftKey || !1 === opts.insertMode || setTimeout(function() {\\n renderColorMask(input);\\n }, 0);\\n });\\n }\\n function renderColorMask(input, caretPos, clear) {\\n function handleStatic() {\\n isStatic || null !== test.fn && testPos.input !== undefined ? isStatic && (null !== test.fn && testPos.input !== undefined || \\\"\\\" === test.def) && (isStatic = !1, \\n maskTemplate += \\\"\\\") : (isStatic = !0, maskTemplate += \\\"\\\");\\n }\\n function handleCaret(force) {\\n !0 !== force && pos !== caretPos.begin || document.activeElement !== input || (maskTemplate += \\\"\\\");\\n }\\n var test, testPos, ndxIntlzr, maskTemplate = \\\"\\\", isStatic = !1, pos = 0;\\n if (colorMask !== undefined) {\\n var buffer = getBuffer();\\n if (caretPos === undefined ? caretPos = caret(input) : caretPos.begin === undefined && (caretPos = {\\n begin: caretPos,\\n end: caretPos\\n }), !0 !== clear) {\\n var lvp = getLastValidPosition();\\n do {\\n handleCaret(), getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos], \\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), handleStatic(), maskTemplate += buffer[pos]) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), \\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || \\\"number\\\" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && (handleStatic(), \\n maskTemplate += getPlaceholder(pos, test))), pos++;\\n } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || \\\"\\\" !== test.def) || lvp > pos || isStatic);\\n -1 === maskTemplate.indexOf(\\\"im-caret\\\") && handleCaret(!0), isStatic && handleStatic();\\n }\\n var template = colorMask.getElementsByTagName(\\\"div\\\")[0];\\n template.innerHTML = maskTemplate, input.inputmask.positionColorMask(input, template);\\n }\\n }\\n maskset = maskset || this.maskset, opts = opts || this.opts;\\n var undoValue, $el, maxLength, colorMask, inputmask = this, el = this.el, isRTL = this.isRTL, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1, EventRuler = {\\n on: function(input, eventName, eventHandler) {\\n var ev = function(e) {\\n if (this.inputmask === undefined && \\\"FORM\\\" !== this.nodeName) {\\n var imOpts = $.data(this, \\\"_inputmask_opts\\\");\\n imOpts ? new Inputmask(imOpts).mask(this) : EventRuler.off(this);\\n } else {\\n if (\\\"setvalue\\\" === e.type || \\\"FORM\\\" === this.nodeName || !(this.disabled || this.readOnly && !(\\\"keydown\\\" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === Inputmask.keyCode.TAB))) {\\n switch (e.type) {\\n case \\\"input\\\":\\n if (!0 === skipInputEvent) return skipInputEvent = !1, e.preventDefault();\\n break;\\n\\n case \\\"keydown\\\":\\n skipKeyPressEvent = !1, skipInputEvent = !1;\\n break;\\n\\n case \\\"keypress\\\":\\n if (!0 === skipKeyPressEvent) return e.preventDefault();\\n skipKeyPressEvent = !0;\\n break;\\n\\n case \\\"click\\\":\\n if (iemobile || iphone) {\\n var that = this, args = arguments;\\n return setTimeout(function() {\\n eventHandler.apply(that, args);\\n }, 0), !1;\\n }\\n }\\n var returnVal = eventHandler.apply(this, arguments);\\n return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal;\\n }\\n e.preventDefault();\\n }\\n };\\n input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev), \\n -1 !== $.inArray(eventName, [ \\\"submit\\\", \\\"reset\\\" ]) ? null !== input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev);\\n },\\n off: function(input, event) {\\n if (input.inputmask && input.inputmask.events) {\\n var events;\\n event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events, \\n $.each(events, function(eventName, evArr) {\\n for (;evArr.length > 0; ) {\\n var ev = evArr.pop();\\n -1 !== $.inArray(eventName, [ \\\"submit\\\", \\\"reset\\\" ]) ? null !== input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev);\\n }\\n delete input.inputmask.events[eventName];\\n });\\n }\\n }\\n }, EventHandlers = {\\n keydownEvent: function(e) {\\n var input = this, $input = $(input), k = e.keyCode, pos = caret(input);\\n if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !function(eventName) {\\n var el = document.createElement(\\\"input\\\"), evName = \\\"on\\\" + eventName, isSupported = evName in el;\\n return isSupported || (el.setAttribute(evName, \\\"return;\\\"), isSupported = \\\"function\\\" == typeof el[evName]), \\n el = null, isSupported;\\n }(\\\"cut\\\")) e.preventDefault(), handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(\\\"\\\")), \\n input.inputmask._valueGet() === getBufferTemplate().join(\\\"\\\") ? $input.trigger(\\\"cleared\\\") : !0 === isComplete(getBuffer()) && $input.trigger(\\\"complete\\\"); else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {\\n e.preventDefault();\\n var caretPos = seekNext(getLastValidPosition());\\n opts.insertMode || caretPos !== getMaskSet().maskLength || e.shiftKey || caretPos--, \\n caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0);\\n } else k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? (e.preventDefault(), \\n caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, undoValue.split(\\\"\\\")), \\n $input.trigger(\\\"click\\\")) : k !== Inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? !0 === opts.tabThrough && k === Inputmask.keyCode.TAB ? (!0 === e.shiftKey ? (null === getTest(pos.begin).match.fn && (pos.begin = seekNext(pos.begin)), \\n pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0), \\n pos.end = seekNext(pos.begin, !0), pos.end < getMaskSet().maskLength && pos.end--), \\n pos.begin < getMaskSet().maskLength && (e.preventDefault(), caret(input, pos.begin, pos.end))) : e.shiftKey || !1 === opts.insertMode && (k === Inputmask.keyCode.RIGHT ? setTimeout(function() {\\n var caretPos = caret(input);\\n caret(input, caretPos.begin);\\n }, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {\\n var caretPos = caret(input);\\n caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);\\n }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));\\n opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);\\n },\\n keypressEvent: function(e, checkval, writeOut, strict, ndx) {\\n var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;\\n if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join(\\\"\\\") && (undoValue = getBuffer().join(\\\"\\\"), \\n setTimeout(function() {\\n $input.trigger(\\\"change\\\");\\n }, 0)), !0;\\n if (k) {\\n 46 === k && !1 === e.shiftKey && \\\"\\\" !== opts.radixPoint && (k = opts.radixPoint.charCodeAt(0));\\n var forwardPosition, pos = checkval ? {\\n begin: ndx,\\n end: ndx\\n } : caret(input), c = String.fromCharCode(k);\\n getMaskSet().writeOutBuffer = !0;\\n var valResult = isValid(pos, c, strict);\\n if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = valResult.caret !== undefined ? valResult.caret : checkval ? valResult.pos + 1 : seekNext(valResult.pos), \\n getMaskSet().p = forwardPosition), !1 !== writeOut && (setTimeout(function() {\\n opts.onKeyValidation.call(input, k, valResult, opts);\\n }, 0), getMaskSet().writeOutBuffer && !1 !== valResult)) {\\n var buffer = getBuffer();\\n writeBuffer(input, buffer, opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition, e, !0 !== checkval), \\n !0 !== checkval && setTimeout(function() {\\n !0 === isComplete(buffer) && $input.trigger(\\\"complete\\\");\\n }, 0);\\n }\\n if (e.preventDefault(), checkval) return !1 !== valResult && (valResult.forwardPosition = forwardPosition), \\n valResult;\\n }\\n },\\n pasteEvent: function(e) {\\n var tempValue, input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);\\n isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue);\\n var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);\\n if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join(\\\"\\\") && (valueBeforeCaret = \\\"\\\"), \\n valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join(\\\"\\\") && (valueAfterCaret = \\\"\\\"), \\n isRTL && (tempValue = valueBeforeCaret, valueBeforeCaret = valueAfterCaret, valueAfterCaret = tempValue), \\n window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData(\\\"Text\\\") + valueAfterCaret; else {\\n if (!ev.clipboardData || !ev.clipboardData.getData) return !0;\\n inputValue = valueBeforeCaret + ev.clipboardData.getData(\\\"text/plain\\\") + valueAfterCaret;\\n }\\n var pasteValue = inputValue;\\n if ($.isFunction(opts.onBeforePaste)) {\\n if (!1 === (pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts))) return e.preventDefault();\\n pasteValue || (pasteValue = inputValue);\\n }\\n return checkVal(input, !1, !1, isRTL ? pasteValue.split(\\\"\\\").reverse() : pasteValue.toString().split(\\\"\\\")), \\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(\\\"\\\")), \\n !0 === isComplete(getBuffer()) && $input.trigger(\\\"complete\\\"), e.preventDefault();\\n },\\n inputFallBackEvent: function(e) {\\n var input = this, inputValue = input.inputmask._valueGet();\\n if (getBuffer().join(\\\"\\\") !== inputValue) {\\n var caretPos = caret(input);\\n if (!1 === function(input, inputValue, caretPos) {\\n if (\\\".\\\" === inputValue.charAt(caretPos.begin - 1) && \\\"\\\" !== opts.radixPoint && (inputValue = inputValue.split(\\\"\\\"), \\n inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0), inputValue = inputValue.join(\\\"\\\")), \\n inputValue.charAt(caretPos.begin - 1) === opts.radixPoint && inputValue.length > getBuffer().length) {\\n var keypress = new $.Event(\\\"keypress\\\");\\n return keypress.which = opts.radixPoint.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, caretPos.begin - 1), \\n !1;\\n }\\n }(input, inputValue, caretPos)) return !1;\\n if (inputValue = inputValue.replace(new RegExp(\\\"(\\\" + Inputmask.escapeRegex(getBufferTemplate().join(\\\"\\\")) + \\\")*\\\"), \\\"\\\"), \\n !1 === function(input, inputValue, caretPos) {\\n if (iemobile) {\\n var inputChar = inputValue.replace(getBuffer().join(\\\"\\\"), \\\"\\\");\\n if (1 === inputChar.length) {\\n var keypress = new $.Event(\\\"keypress\\\");\\n return keypress.which = inputChar.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, getMaskSet().validPositions[caretPos.begin - 1] ? caretPos.begin : caretPos.begin - 1), \\n !1;\\n }\\n }\\n }(input, inputValue, caretPos)) return !1;\\n caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input));\\n var buffer = getBuffer().join(\\\"\\\"), frontPart = inputValue.substr(0, caretPos.begin), backPart = inputValue.substr(caretPos.begin), frontBufferPart = buffer.substr(0, caretPos.begin), backBufferPart = buffer.substr(caretPos.begin), selection = caretPos, entries = \\\"\\\", isEntry = !1;\\n if (frontPart !== frontBufferPart) {\\n selection.begin = 0;\\n for (var fpl = (isEntry = frontPart.length >= frontBufferPart.length) ? frontPart.length : frontBufferPart.length, i = 0; frontPart.charAt(i) === frontBufferPart.charAt(i) && i < fpl; i++) selection.begin++;\\n isEntry && (entries += frontPart.slice(selection.begin, selection.end));\\n }\\n backPart !== backBufferPart && (backPart.length > backBufferPart.length ? isEntry && (selection.end = selection.begin) : backPart.length < backBufferPart.length ? selection.end += backBufferPart.length - backPart.length : backPart.charAt(0) !== backBufferPart.charAt(0) && selection.end++), \\n writeBuffer(input, getBuffer(), selection), entries.length > 0 ? $.each(entries.split(\\\"\\\"), function(ndx, entry) {\\n var keypress = new $.Event(\\\"keypress\\\");\\n keypress.which = entry.charCodeAt(0), ignorable = !1, EventHandlers.keypressEvent.call(input, keypress);\\n }) : (selection.begin === selection.end - 1 && caret(input, seekPrevious(selection.begin + 1), selection.end), \\n e.keyCode = Inputmask.keyCode.DELETE, EventHandlers.keydownEvent.call(input, e)), \\n e.preventDefault();\\n }\\n },\\n setValueEvent: function(e) {\\n this.inputmask.refreshValue = !1;\\n var input = this, value = input.inputmask._valueGet(!0);\\n $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask.call(inputmask, value, opts) || value), \\n value = value.split(\\\"\\\"), checkVal(input, !0, !1, isRTL ? value.reverse() : value), \\n undoValue = getBuffer().join(\\\"\\\"), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join(\\\"\\\") && input.inputmask._valueSet(\\\"\\\");\\n },\\n focusEvent: function(e) {\\n var input = this, nptValue = input.inputmask._valueGet();\\n opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && \\\"\\\" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join(\\\"\\\") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))), \\n !0 === opts.positionCaretOnTab && !1 === mouseEnter && \\\"\\\" !== nptValue && (writeBuffer(input, getBuffer(), caret(input)), \\n EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join(\\\"\\\");\\n },\\n mouseleaveEvent: function(e) {\\n var input = this;\\n if (mouseEnter = !1, opts.clearMaskOnLostFocus && document.activeElement !== input) {\\n var buffer = getBuffer().slice(), nptValue = input.inputmask._valueGet();\\n nptValue !== input.getAttribute(\\\"placeholder\\\") && \\\"\\\" !== nptValue && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join(\\\"\\\") ? buffer = [] : clearOptionalTail(buffer), \\n writeBuffer(input, buffer));\\n }\\n },\\n clickEvent: function(e, tabbed) {\\n function doRadixFocus(clickPos) {\\n if (\\\"\\\" !== opts.radixPoint) {\\n var vps = getMaskSet().validPositions;\\n if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {\\n if (clickPos < seekNext(-1)) return !0;\\n var radixPos = $.inArray(opts.radixPoint, getBuffer());\\n if (-1 !== radixPos) {\\n for (var vp in vps) if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1;\\n return !0;\\n }\\n }\\n }\\n return !1;\\n }\\n var input = this;\\n setTimeout(function() {\\n if (document.activeElement === input) {\\n var selectedCaret = caret(input);\\n if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end), \\n selectedCaret.begin === selectedCaret.end) switch (opts.positionCaretOnClick) {\\n case \\\"none\\\":\\n break;\\n\\n case \\\"radixFocus\\\":\\n if (doRadixFocus(selectedCaret.begin)) {\\n var radixPos = getBuffer().join(\\\"\\\").indexOf(opts.radixPoint);\\n caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);\\n break;\\n }\\n\\n default:\\n var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(lvclickPosition);\\n if (clickPosition < lastPosition) caret(input, isMask(clickPosition, !0) || isMask(clickPosition - 1, !0) ? clickPosition : seekNext(clickPosition)); else {\\n var lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp), placeholder = getPlaceholder(lastPosition, tt.match);\\n if (\\\"\\\" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== tt.match.optionalQuantifier && !0 !== tt.match.newBlockMarker || !isMask(lastPosition, !0) && tt.match.def === placeholder) {\\n var newPos = seekNext(lastPosition);\\n (clickPosition >= newPos || clickPosition === lastPosition) && (lastPosition = newPos);\\n }\\n caret(input, lastPosition);\\n }\\n }\\n }\\n }, 0);\\n },\\n dblclickEvent: function(e) {\\n var input = this;\\n setTimeout(function() {\\n caret(input, 0, seekNext(getLastValidPosition()));\\n }, 0);\\n },\\n cutEvent: function(e) {\\n var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e, clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);\\n clipboardData.setData(\\\"text\\\", isRTL ? clipData.reverse().join(\\\"\\\") : clipData.join(\\\"\\\")), \\n document.execCommand && document.execCommand(\\\"copy\\\"), handleRemove(input, Inputmask.keyCode.DELETE, pos), \\n writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(\\\"\\\")), \\n input.inputmask._valueGet() === getBufferTemplate().join(\\\"\\\") && $input.trigger(\\\"cleared\\\");\\n },\\n blurEvent: function(e) {\\n var $input = $(this), input = this;\\n if (input.inputmask) {\\n var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();\\n \\\"\\\" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join(\\\"\\\") ? buffer = [] : clearOptionalTail(buffer)), \\n !1 === isComplete(buffer) && (setTimeout(function() {\\n $input.trigger(\\\"incomplete\\\");\\n }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())), \\n writeBuffer(input, buffer, undefined, e)), undoValue !== getBuffer().join(\\\"\\\") && (undoValue = buffer.join(\\\"\\\"), \\n $input.trigger(\\\"change\\\"));\\n }\\n },\\n mouseenterEvent: function(e) {\\n var input = this;\\n mouseEnter = !0, document.activeElement !== input && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join(\\\"\\\") && writeBuffer(input, getBuffer());\\n },\\n submitEvent: function(e) {\\n undoValue !== getBuffer().join(\\\"\\\") && $el.trigger(\\\"change\\\"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join(\\\"\\\") && el.inputmask._valueSet(\\\"\\\"), \\n opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0), \\n setTimeout(function() {\\n writeBuffer(el, getBuffer());\\n }, 0));\\n },\\n resetEvent: function(e) {\\n el.inputmask.refreshValue = !0, setTimeout(function() {\\n $el.trigger(\\\"setvalue\\\");\\n }, 0);\\n }\\n };\\n Inputmask.prototype.positionColorMask = function(input, template) {\\n input.style.left = template.offsetLeft + \\\"px\\\";\\n };\\n var valueBuffer;\\n if (actionObj !== undefined) switch (actionObj.action) {\\n case \\\"isComplete\\\":\\n return el = actionObj.el, isComplete(getBuffer());\\n\\n case \\\"unmaskedvalue\\\":\\n return el !== undefined && actionObj.value === undefined || (valueBuffer = actionObj.value, \\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer : valueBuffer).split(\\\"\\\"), \\n checkVal(undefined, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(inputmask, undefined, getBuffer(), 0, opts)), \\n unmaskedvalue(el);\\n\\n case \\\"mask\\\":\\n !function(elem) {\\n EventRuler.off(elem);\\n var isSupported = function(input, opts) {\\n var elementType = input.getAttribute(\\\"type\\\"), isSupported = \\\"INPUT\\\" === input.tagName && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || \\\"TEXTAREA\\\" === input.tagName;\\n if (!isSupported) if (\\\"INPUT\\\" === input.tagName) {\\n var el = document.createElement(\\\"input\\\");\\n el.setAttribute(\\\"type\\\", elementType), isSupported = \\\"text\\\" === el.type, el = null;\\n } else isSupported = \\\"partial\\\";\\n return !1 !== isSupported ? function(npt) {\\n function getter() {\\n return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join(\\\"\\\") : valueGet.call(this) : \\\"\\\" : valueGet.call(this);\\n }\\n function setter(value) {\\n valueSet.call(this, value), this.inputmask && $(this).trigger(\\\"setvalue\\\");\\n }\\n var valueGet, valueSet;\\n if (!npt.inputmask.__valueGet) {\\n if (!0 !== opts.noValuePatching) {\\n if (Object.getOwnPropertyDescriptor) {\\n \\\"function\\\" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = \\\"object\\\" == typeof \\\"test\\\".__proto__ ? function(object) {\\n return object.__proto__;\\n } : function(object) {\\n return object.constructor.prototype;\\n });\\n var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), \\\"value\\\") : undefined;\\n valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get, \\n valueSet = valueProperty.set, Object.defineProperty(npt, \\\"value\\\", {\\n get: getter,\\n set: setter,\\n configurable: !0\\n })) : \\\"INPUT\\\" !== npt.tagName && (valueGet = function() {\\n return this.textContent;\\n }, valueSet = function(value) {\\n this.textContent = value;\\n }, Object.defineProperty(npt, \\\"value\\\", {\\n get: getter,\\n set: setter,\\n configurable: !0\\n }));\\n } else document.__lookupGetter__ && npt.__lookupGetter__(\\\"value\\\") && (valueGet = npt.__lookupGetter__(\\\"value\\\"), \\n valueSet = npt.__lookupSetter__(\\\"value\\\"), npt.__defineGetter__(\\\"value\\\", getter), \\n npt.__defineSetter__(\\\"value\\\", setter));\\n npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet;\\n }\\n npt.inputmask._valueGet = function(overruleRTL) {\\n return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split(\\\"\\\").reverse().join(\\\"\\\") : valueGet.call(this.el);\\n }, npt.inputmask._valueSet = function(value, overruleRTL) {\\n valueSet.call(this.el, null === value || value === undefined ? \\\"\\\" : !0 !== overruleRTL && isRTL ? value.split(\\\"\\\").reverse().join(\\\"\\\") : value);\\n }, valueGet === undefined && (valueGet = function() {\\n return this.value;\\n }, valueSet = function(value) {\\n this.value = value;\\n }, function(type) {\\n if ($.valHooks && ($.valHooks[type] === undefined || !0 !== $.valHooks[type].inputmaskpatch)) {\\n var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {\\n return elem.value;\\n }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {\\n return elem.value = value, elem;\\n };\\n $.valHooks[type] = {\\n get: function(elem) {\\n if (elem.inputmask) {\\n if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();\\n var result = valhookGet(elem);\\n return -1 !== getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : \\\"\\\";\\n }\\n return valhookGet(elem);\\n },\\n set: function(elem, value) {\\n var result, $elem = $(elem);\\n return result = valhookSet(elem, value), elem.inputmask && $elem.trigger(\\\"setvalue\\\"), \\n result;\\n },\\n inputmaskpatch: !0\\n };\\n }\\n }(npt.type), function(npt) {\\n EventRuler.on(npt, \\\"mouseenter\\\", function(event) {\\n var $input = $(this);\\n this.inputmask._valueGet() !== getBuffer().join(\\\"\\\") && $input.trigger(\\\"setvalue\\\");\\n });\\n }(npt));\\n }\\n }(input) : input.inputmask = undefined, isSupported;\\n }(elem, opts);\\n if (!1 !== isSupported && (el = elem, $el = $(el), maxLength = el !== undefined ? el.maxLength : undefined, \\n -1 === maxLength && (maxLength = undefined), !0 === opts.colorMask && initializeColorMask(el), \\n android && (el.hasOwnProperty(\\\"inputmode\\\") && (el.inputmode = opts.inputmode, el.setAttribute(\\\"inputmode\\\", opts.inputmode)), \\n \\\"rtfm\\\" === opts.androidHack && (!0 !== opts.colorMask && initializeColorMask(el), \\n el.type = \\\"password\\\")), !0 === isSupported && (EventRuler.on(el, \\\"submit\\\", EventHandlers.submitEvent), \\n EventRuler.on(el, \\\"reset\\\", EventHandlers.resetEvent), EventRuler.on(el, \\\"mouseenter\\\", EventHandlers.mouseenterEvent), \\n EventRuler.on(el, \\\"blur\\\", EventHandlers.blurEvent), EventRuler.on(el, \\\"focus\\\", EventHandlers.focusEvent), \\n EventRuler.on(el, \\\"mouseleave\\\", EventHandlers.mouseleaveEvent), !0 !== opts.colorMask && EventRuler.on(el, \\\"click\\\", EventHandlers.clickEvent), \\n EventRuler.on(el, \\\"dblclick\\\", EventHandlers.dblclickEvent), EventRuler.on(el, \\\"paste\\\", EventHandlers.pasteEvent), \\n EventRuler.on(el, \\\"dragdrop\\\", EventHandlers.pasteEvent), EventRuler.on(el, \\\"drop\\\", EventHandlers.pasteEvent), \\n EventRuler.on(el, \\\"cut\\\", EventHandlers.cutEvent), EventRuler.on(el, \\\"complete\\\", opts.oncomplete), \\n EventRuler.on(el, \\\"incomplete\\\", opts.onincomplete), EventRuler.on(el, \\\"cleared\\\", opts.oncleared), \\n android || !0 === opts.inputEventOnly ? el.removeAttribute(\\\"maxLength\\\") : (EventRuler.on(el, \\\"keydown\\\", EventHandlers.keydownEvent), \\n EventRuler.on(el, \\\"keypress\\\", EventHandlers.keypressEvent)), EventRuler.on(el, \\\"compositionstart\\\", $.noop), \\n EventRuler.on(el, \\\"compositionupdate\\\", $.noop), EventRuler.on(el, \\\"compositionend\\\", $.noop), \\n EventRuler.on(el, \\\"keyup\\\", $.noop), EventRuler.on(el, \\\"input\\\", EventHandlers.inputFallBackEvent), \\n EventRuler.on(el, \\\"beforeinput\\\", $.noop)), EventRuler.on(el, \\\"setvalue\\\", EventHandlers.setValueEvent), \\n undoValue = getBufferTemplate().join(\\\"\\\"), \\\"\\\" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || document.activeElement === el)) {\\n var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, el.inputmask._valueGet(!0), opts) || el.inputmask._valueGet(!0) : el.inputmask._valueGet(!0);\\n \\\"\\\" !== initialValue && checkVal(el, !0, !1, isRTL ? initialValue.split(\\\"\\\").reverse() : initialValue.split(\\\"\\\"));\\n var buffer = getBuffer().slice();\\n undoValue = buffer.join(\\\"\\\"), !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(), \\n opts.clearMaskOnLostFocus && document.activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)), \\n writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));\\n }\\n }(el);\\n break;\\n\\n case \\\"format\\\":\\n return valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value : actionObj.value).split(\\\"\\\"), \\n checkVal(undefined, !0, !1, isRTL ? valueBuffer.reverse() : valueBuffer), actionObj.metadata ? {\\n value: isRTL ? getBuffer().slice().reverse().join(\\\"\\\") : getBuffer().join(\\\"\\\"),\\n metadata: maskScope.call(this, {\\n action: \\\"getmetadata\\\"\\n }, maskset, opts)\\n } : isRTL ? getBuffer().slice().reverse().join(\\\"\\\") : getBuffer().join(\\\"\\\");\\n\\n case \\\"isValid\\\":\\n actionObj.value ? (valueBuffer = actionObj.value.split(\\\"\\\"), checkVal(undefined, !0, !0, isRTL ? valueBuffer.reverse() : valueBuffer)) : actionObj.value = getBuffer().join(\\\"\\\");\\n for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;\\n return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === getBuffer().join(\\\"\\\");\\n\\n case \\\"getemptymask\\\":\\n return getBufferTemplate().join(\\\"\\\");\\n\\n case \\\"remove\\\":\\n if (el && el.inputmask) {\\n $el = $(el), el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(!0)), \\n EventRuler.off(el);\\n Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), \\\"value\\\") && el.inputmask.__valueGet && Object.defineProperty(el, \\\"value\\\", {\\n get: el.inputmask.__valueGet,\\n set: el.inputmask.__valueSet,\\n configurable: !0\\n }) : document.__lookupGetter__ && el.__lookupGetter__(\\\"value\\\") && el.inputmask.__valueGet && (el.__defineGetter__(\\\"value\\\", el.inputmask.__valueGet), \\n el.__defineSetter__(\\\"value\\\", el.inputmask.__valueSet)), el.inputmask = undefined;\\n }\\n return el;\\n\\n case \\\"getmetadata\\\":\\n if ($.isArray(maskset.metadata)) {\\n var maskTarget = getMaskTemplate(!0, 0, !1).join(\\\"\\\");\\n return $.each(maskset.metadata, function(ndx, mtdt) {\\n if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;\\n }), maskTarget;\\n }\\n return maskset.metadata;\\n }\\n }\\n var ua = navigator.userAgent, mobile = /mobile/i.test(ua), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, android = /android/i.test(ua) && !iemobile;\\n return Inputmask.prototype = {\\n dataAttribute: \\\"data-inputmask\\\",\\n defaults: {\\n placeholder: \\\"_\\\",\\n optionalmarker: {\\n start: \\\"[\\\",\\n end: \\\"]\\\"\\n },\\n quantifiermarker: {\\n start: \\\"{\\\",\\n end: \\\"}\\\"\\n },\\n groupmarker: {\\n start: \\\"(\\\",\\n end: \\\")\\\"\\n },\\n alternatormarker: \\\"|\\\",\\n escapeChar: \\\"\\\\\\\\\\\",\\n mask: null,\\n regex: null,\\n oncomplete: $.noop,\\n onincomplete: $.noop,\\n oncleared: $.noop,\\n repeat: 0,\\n greedy: !0,\\n autoUnmask: !1,\\n removeMaskOnSubmit: !1,\\n clearMaskOnLostFocus: !0,\\n insertMode: !0,\\n clearIncomplete: !1,\\n alias: null,\\n onKeyDown: $.noop,\\n onBeforeMask: null,\\n onBeforePaste: function(pastedValue, opts) {\\n return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;\\n },\\n onBeforeWrite: null,\\n onUnMask: null,\\n showMaskOnFocus: !0,\\n showMaskOnHover: !0,\\n onKeyValidation: $.noop,\\n skipOptionalPartCharacter: \\\" \\\",\\n numericInput: !1,\\n rightAlign: !1,\\n undoOnEscape: !0,\\n radixPoint: \\\"\\\",\\n radixPointDefinitionSymbol: undefined,\\n groupSeparator: \\\"\\\",\\n keepStatic: null,\\n positionCaretOnTab: !0,\\n tabThrough: !1,\\n supportsInputType: [ \\\"text\\\", \\\"tel\\\", \\\"password\\\" ],\\n 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 ],\\n isComplete: null,\\n canClearPosition: $.noop,\\n preValidation: null,\\n postValidation: null,\\n staticDefinitionSymbol: undefined,\\n jitMasking: !1,\\n nullable: !0,\\n inputEventOnly: !1,\\n noValuePatching: !1,\\n positionCaretOnClick: \\\"lvp\\\",\\n casing: null,\\n inputmode: \\\"verbatim\\\",\\n colorMask: !1,\\n androidHack: !1,\\n importDataAttributes: !0\\n },\\n definitions: {\\n \\\"9\\\": {\\n validator: \\\"[0-9\\\\uff11-\\\\uff19]\\\",\\n cardinality: 1,\\n definitionSymbol: \\\"*\\\"\\n },\\n a: {\\n validator: \\\"[A-Za-z\\\\u0410-\\\\u044f\\\\u0401\\\\u0451\\\\xc0-\\\\xff\\\\xb5]\\\",\\n cardinality: 1,\\n definitionSymbol: \\\"*\\\"\\n },\\n \\\"*\\\": {\\n validator: \\\"[0-9\\\\uff11-\\\\uff19A-Za-z\\\\u0410-\\\\u044f\\\\u0401\\\\u0451\\\\xc0-\\\\xff\\\\xb5]\\\",\\n cardinality: 1\\n }\\n },\\n aliases: {},\\n masksCache: {},\\n mask: function(elems) {\\n function importAttributeOptions(npt, opts, userOptions, dataAttribute) {\\n function importOption(option, optionData) {\\n null !== (optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + \\\"-\\\" + option)) && (\\\"string\\\" == typeof optionData && (0 === option.indexOf(\\\"on\\\") ? optionData = window[optionData] : \\\"false\\\" === optionData ? optionData = !1 : \\\"true\\\" === optionData && (optionData = !0)), \\n userOptions[option] = optionData);\\n }\\n if (!0 === opts.importDataAttributes) {\\n var option, dataoptions, optionData, p, attrOptions = npt.getAttribute(dataAttribute);\\n if (attrOptions && \\\"\\\" !== attrOptions && (attrOptions = attrOptions.replace(new RegExp(\\\"'\\\", \\\"g\\\"), '\\\"'), \\n dataoptions = JSON.parse(\\\"{\\\" + attrOptions + \\\"}\\\")), dataoptions) {\\n optionData = undefined;\\n for (p in dataoptions) if (\\\"alias\\\" === p.toLowerCase()) {\\n optionData = dataoptions[p];\\n break;\\n }\\n }\\n importOption(\\\"alias\\\", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts);\\n for (option in opts) {\\n if (dataoptions) {\\n optionData = undefined;\\n for (p in dataoptions) if (p.toLowerCase() === option.toLowerCase()) {\\n optionData = dataoptions[p];\\n break;\\n }\\n }\\n importOption(option, optionData);\\n }\\n }\\n return $.extend(!0, opts, userOptions), (\\\"rtl\\\" === npt.dir || opts.rightAlign) && (npt.style.textAlign = \\\"right\\\"), \\n (\\\"rtl\\\" === npt.dir || opts.numericInput) && (npt.dir = \\\"ltr\\\", npt.removeAttribute(\\\"dir\\\"), \\n opts.isRTL = !0), opts;\\n }\\n var that = this;\\n return \\\"string\\\" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)), \\n elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {\\n var scopedOpts = $.extend(!0, {}, that.opts);\\n importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute);\\n var maskset = generateMaskSet(scopedOpts, that.noMasksCache);\\n maskset !== undefined && (el.inputmask !== undefined && (el.inputmask.opts.autoUnmask = !0, \\n el.inputmask.remove()), el.inputmask = new Inputmask(undefined, undefined, !0), \\n el.inputmask.opts = scopedOpts, el.inputmask.noMasksCache = that.noMasksCache, el.inputmask.userOptions = $.extend(!0, {}, that.userOptions), \\n el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput, el.inputmask.el = el, \\n el.inputmask.maskset = maskset, $.data(el, \\\"_inputmask_opts\\\", scopedOpts), maskScope.call(el.inputmask, {\\n action: \\\"mask\\\"\\n }));\\n }), elems && elems[0] ? elems[0].inputmask || this : this;\\n },\\n option: function(options, noremask) {\\n return \\\"string\\\" == typeof options ? this.opts[options] : \\\"object\\\" == typeof options ? ($.extend(this.userOptions, options), \\n this.el && !0 !== noremask && this.mask(this.el), this) : void 0;\\n },\\n unmaskedvalue: function(value) {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"unmaskedvalue\\\",\\n value: value\\n });\\n },\\n remove: function() {\\n return maskScope.call(this, {\\n action: \\\"remove\\\"\\n });\\n },\\n getemptymask: function() {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"getemptymask\\\"\\n });\\n },\\n hasMaskedValue: function() {\\n return !this.opts.autoUnmask;\\n },\\n isComplete: function() {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"isComplete\\\"\\n });\\n },\\n getmetadata: function() {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"getmetadata\\\"\\n });\\n },\\n isValid: function(value) {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"isValid\\\",\\n value: value\\n });\\n },\\n format: function(value, metadata) {\\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache), \\n maskScope.call(this, {\\n action: \\\"format\\\",\\n value: value,\\n metadata: metadata\\n });\\n },\\n analyseMask: function(mask, regexMask, opts) {\\n function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {\\n this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1, \\n this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1, \\n this.quantifier = {\\n min: 1,\\n max: 1\\n };\\n }\\n function insertTestDefinition(mtoken, element, position) {\\n position = position !== undefined ? position : mtoken.matches.length;\\n var prevMatch = mtoken.matches[position - 1];\\n if (regexMask) 0 === element.indexOf(\\\"[\\\") || escaped && /\\\\\\\\d|\\\\\\\\s|\\\\\\\\w]/i.test(element) || \\\".\\\" === element ? mtoken.matches.splice(position++, 0, {\\n fn: new RegExp(element, opts.casing ? \\\"i\\\" : \\\"\\\"),\\n cardinality: 1,\\n optionality: mtoken.isOptional,\\n newBlockMarker: prevMatch === undefined || prevMatch.def !== element,\\n casing: null,\\n def: element,\\n placeholder: undefined,\\n nativeDef: element\\n }) : (escaped && (element = element[element.length - 1]), $.each(element.split(\\\"\\\"), function(ndx, lmnt) {\\n prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, {\\n fn: null,\\n cardinality: 0,\\n optionality: mtoken.isOptional,\\n newBlockMarker: prevMatch === undefined || prevMatch.def !== lmnt && null !== prevMatch.fn,\\n casing: null,\\n def: opts.staticDefinitionSymbol || lmnt,\\n placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,\\n nativeDef: lmnt\\n });\\n })), escaped = !1; else {\\n var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];\\n if (maskdef && !escaped) {\\n for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) {\\n var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality;\\n mtoken.matches.splice(position++, 0, {\\n fn: validator ? \\\"string\\\" == typeof validator ? new RegExp(validator, opts.casing ? \\\"i\\\" : \\\"\\\") : new function() {\\n this.test = validator;\\n }() : new RegExp(\\\".\\\"),\\n cardinality: cardinality || 1,\\n optionality: mtoken.isOptional,\\n newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),\\n casing: maskdef.casing,\\n def: maskdef.definitionSymbol || element,\\n placeholder: maskdef.placeholder,\\n nativeDef: element\\n }), prevMatch = mtoken.matches[position - 1];\\n }\\n mtoken.matches.splice(position++, 0, {\\n fn: maskdef.validator ? \\\"string\\\" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? \\\"i\\\" : \\\"\\\") : new function() {\\n this.test = maskdef.validator;\\n }() : new RegExp(\\\".\\\"),\\n cardinality: maskdef.cardinality,\\n optionality: mtoken.isOptional,\\n newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),\\n casing: maskdef.casing,\\n def: maskdef.definitionSymbol || element,\\n placeholder: maskdef.placeholder,\\n nativeDef: element\\n });\\n } else mtoken.matches.splice(position++, 0, {\\n fn: null,\\n cardinality: 0,\\n optionality: mtoken.isOptional,\\n newBlockMarker: prevMatch === undefined || prevMatch.def !== element && null !== prevMatch.fn,\\n casing: null,\\n def: opts.staticDefinitionSymbol || element,\\n placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,\\n nativeDef: element\\n }), escaped = !1;\\n }\\n }\\n function verifyGroupMarker(maskToken) {\\n maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) {\\n var nextToken = maskToken.matches[ndx + 1];\\n (nextToken === undefined || nextToken.matches === undefined || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1, \\n regexMask || (insertTestDefinition(token, opts.groupmarker.start, 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker.end))), \\n verifyGroupMarker(token);\\n });\\n }\\n function defaultCase() {\\n if (openenings.length > 0) {\\n if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m), \\n currentOpeningToken.isAlternator) {\\n alternator = openenings.pop();\\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;\\n openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], \\n currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);\\n }\\n } else insertTestDefinition(currentToken, m);\\n }\\n function reverseTokens(maskToken) {\\n maskToken.matches = maskToken.matches.reverse();\\n for (var match in maskToken.matches) if (maskToken.matches.hasOwnProperty(match)) {\\n var intMatch = parseInt(match);\\n if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {\\n var qt = maskToken.matches[match];\\n maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);\\n }\\n maskToken.matches[match].matches !== undefined ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = function(st) {\\n return st === opts.optionalmarker.start ? st = opts.optionalmarker.end : st === opts.optionalmarker.end ? st = opts.optionalmarker.start : st === opts.groupmarker.start ? st = opts.groupmarker.end : st === opts.groupmarker.end && (st = opts.groupmarker.start), \\n st;\\n }(maskToken.matches[match]);\\n }\\n return maskToken;\\n }\\n var match, m, openingToken, currentOpeningToken, alternator, lastMatch, groupToken, tokenizer = /(?:[?*+]|\\\\{[0-9\\\\+\\\\*]+(?:,[0-9\\\\+\\\\*]*)?\\\\})|[^.?*+^${[]()|\\\\\\\\]+|./g, regexTokenizer = /\\\\[\\\\^?]?(?:[^\\\\\\\\\\\\]]+|\\\\\\\\[\\\\S\\\\s]?)*]?|\\\\\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\\\S\\\\s]?)|\\\\((?:\\\\?[:=!]?)?|(?:[?*+]|\\\\{[0-9]+(?:,[0-9]*)?\\\\})\\\\??|[^.?*+^${[()|\\\\\\\\]+|./g, escaped = !1, currentToken = new MaskToken(), openenings = [], maskTokens = [];\\n for (regexMask && (opts.optionalmarker.start = undefined, opts.optionalmarker.end = undefined); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) {\\n if (m = match[0], regexMask) switch (m.charAt(0)) {\\n case \\\"?\\\":\\n m = \\\"{0,1}\\\";\\n break;\\n\\n case \\\"+\\\":\\n case \\\"*\\\":\\n m = \\\"{\\\" + m + \\\"}\\\";\\n }\\n if (escaped) defaultCase(); else switch (m.charAt(0)) {\\n case opts.escapeChar:\\n escaped = !0, regexMask && defaultCase();\\n break;\\n\\n case opts.optionalmarker.end:\\n case opts.groupmarker.end:\\n if (openingToken = openenings.pop(), openingToken.openGroup = !1, openingToken !== undefined) if (openenings.length > 0) {\\n if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken), \\n currentOpeningToken.isAlternator) {\\n alternator = openenings.pop();\\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1, \\n alternator.matches[mndx].alternatorGroup = !1;\\n openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], \\n currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);\\n }\\n } else currentToken.matches.push(openingToken); else defaultCase();\\n break;\\n\\n case opts.optionalmarker.start:\\n openenings.push(new MaskToken(!1, !0));\\n break;\\n\\n case opts.groupmarker.start:\\n openenings.push(new MaskToken(!0));\\n break;\\n\\n case opts.quantifiermarker.start:\\n var quantifier = new MaskToken(!1, !1, !0);\\n m = m.replace(/[{}]/g, \\\"\\\");\\n var mq = m.split(\\\",\\\"), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);\\n if (\\\"*\\\" !== mq1 && \\\"+\\\" !== mq1 || (mq0 = \\\"*\\\" === mq1 ? 0 : 1), quantifier.quantifier = {\\n min: mq0,\\n max: mq1\\n }, openenings.length > 0) {\\n var matches = openenings[openenings.length - 1].matches;\\n match = matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), groupToken.matches.push(match), \\n match = groupToken), matches.push(match), matches.push(quantifier);\\n } else match = currentToken.matches.pop(), match.isGroup || (regexMask && null === match.fn && \\\".\\\" === match.def && (match.fn = new RegExp(match.def, opts.casing ? \\\"i\\\" : \\\"\\\")), \\n groupToken = new MaskToken(!0), groupToken.matches.push(match), match = groupToken), \\n currentToken.matches.push(match), currentToken.matches.push(quantifier);\\n break;\\n\\n case opts.alternatormarker:\\n if (openenings.length > 0) {\\n currentOpeningToken = openenings[openenings.length - 1];\\n var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];\\n lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();\\n } else lastMatch = currentToken.matches.pop();\\n if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(), \\n lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch), \\n openenings.push(alternator), lastMatch.openGroup) {\\n lastMatch.openGroup = !1;\\n var alternatorGroup = new MaskToken(!0);\\n alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup);\\n }\\n break;\\n\\n default:\\n defaultCase();\\n }\\n }\\n for (;openenings.length > 0; ) openingToken = openenings.pop(), currentToken.matches.push(openingToken);\\n return currentToken.matches.length > 0 && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)), \\n (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens;\\n }\\n }, Inputmask.extendDefaults = function(options) {\\n $.extend(!0, Inputmask.prototype.defaults, options);\\n }, Inputmask.extendDefinitions = function(definition) {\\n $.extend(!0, Inputmask.prototype.definitions, definition);\\n }, Inputmask.extendAliases = function(alias) {\\n $.extend(!0, Inputmask.prototype.aliases, alias);\\n }, Inputmask.format = function(value, options, metadata) {\\n return Inputmask(options).format(value, metadata);\\n }, Inputmask.unmask = function(value, options) {\\n return Inputmask(options).unmaskedvalue(value);\\n }, Inputmask.isValid = function(value, options) {\\n return Inputmask(options).isValid(value);\\n }, Inputmask.remove = function(elems) {\\n $.each(elems, function(ndx, el) {\\n el.inputmask && el.inputmask.remove();\\n });\\n }, Inputmask.escapeRegex = function(str) {\\n var specials = [ \\\"/\\\", \\\".\\\", \\\"*\\\", \\\"+\\\", \\\"?\\\", \\\"|\\\", \\\"(\\\", \\\")\\\", \\\"[\\\", \\\"]\\\", \\\"{\\\", \\\"}\\\", \\\"\\\\\\\\\\\", \\\"$\\\", \\\"^\\\" ];\\n return str.replace(new RegExp(\\\"(\\\\\\\\\\\" + specials.join(\\\"|\\\\\\\\\\\") + \\\")\\\", \\\"gim\\\"), \\\"\\\\\\\\$1\\\");\\n }, Inputmask.keyCode = {\\n ALT: 18,\\n BACKSPACE: 8,\\n BACKSPACE_SAFARI: 127,\\n CAPS_LOCK: 20,\\n COMMA: 188,\\n COMMAND: 91,\\n COMMAND_LEFT: 91,\\n COMMAND_RIGHT: 93,\\n CONTROL: 17,\\n DELETE: 46,\\n DOWN: 40,\\n END: 35,\\n ENTER: 13,\\n ESCAPE: 27,\\n HOME: 36,\\n INSERT: 45,\\n LEFT: 37,\\n MENU: 93,\\n NUMPAD_ADD: 107,\\n NUMPAD_DECIMAL: 110,\\n NUMPAD_DIVIDE: 111,\\n NUMPAD_ENTER: 108,\\n NUMPAD_MULTIPLY: 106,\\n NUMPAD_SUBTRACT: 109,\\n PAGE_DOWN: 34,\\n PAGE_UP: 33,\\n PERIOD: 190,\\n RIGHT: 39,\\n SHIFT: 16,\\n S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tUb2tlbjogSW5wdXRtYXNrLnByb3RvdHlwZS5hbmFseXNlTWFzayhtYXNrLCByZWdleE1hc2ssIG9wdHMpLFxuICAgICAgICAgICAgICAgIHZhbGlkUG9zaXRpb25zOiB7fSxcbiAgICAgICAgICAgICAgICBfYnVmZmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgYnVmZmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgdGVzdHM6IHt9LFxuICAgICAgICAgICAgICAgIG1ldGFkYXRhOiBtZXRhZGF0YSxcbiAgICAgICAgICAgICAgICBtYXNrTGVuZ3RoOiB1bmRlZmluZWRcbiAgICAgICAgICAgIH0sICEwICE9PSBub2NhY2hlICYmIChJbnB1dG1hc2sucHJvdG90eXBlLm1hc2tzQ2FjaGVbbWFza2RlZktleV0gPSBtYXNrc2V0RGVmaW5pdGlvbiwgXG4gICAgICAgICAgICBtYXNrc2V0RGVmaW5pdGlvbiA9ICQuZXh0ZW5kKCEwLCB7fSwgSW5wdXRtYXNrLnByb3RvdHlwZS5tYXNrc0NhY2hlW21hc2tkZWZLZXldKSkpIDogbWFza3NldERlZmluaXRpb24gPSAkLmV4dGVuZCghMCwge30sIElucHV0bWFzay5wcm90b3R5cGUubWFza3NDYWNoZVttYXNrZGVmS2V5XSksIFxuICAgICAgICAgICAgbWFza3NldERlZmluaXRpb247XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCQuaXNGdW5jdGlvbihvcHRzLm1hc2spICYmIChvcHRzLm1hc2sgPSBvcHRzLm1hc2sob3B0cykpLCAkLmlzQXJyYXkob3B0cy5tYXNrKSkge1xuICAgICAgICAgICAgaWYgKG9wdHMubWFzay5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgb3B0cy5rZWVwU3RhdGljID0gbnVsbCA9PT0gb3B0cy5rZWVwU3RhdGljIHx8IG9wdHMua2VlcFN0YXRpYztcbiAgICAgICAgICAgICAgICB2YXIgYWx0TWFzayA9IG9wdHMuZ3Jv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senIsIHRzdFBzKSB7XG4gICAgICAgICAgICBmdW5jdGlvbiByZXNvbHZlVGVzdEZyb21Ub2tlbihtYXNrVG9rZW4sIG5keEluaXRpYWxpemVyLCBsb29wTmR4LCBxdWFudGlmaWVyUmVjdXJzZSkge1xuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhhbmRsZU1hdGNoKG1hdGNoLCBsb29wTmR4LCBxdWFudGlmaWVyUmVjdXJzZSkge1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpc0ZpcnN0TWF0Y2gobGF0ZXN0TWF0Y2gsIHRva2VuR3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmaXJzdE1hdGNoID0gMCA9PT0gJC5pbkFycmF5KGxhdGVzdE1hdGNoLCB0b2tlbkdyb3VwLm1hdGNoZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpcnN0TWF0Y2ggfHwgJC5lYWNoKHRva2VuR3JvdXAubWF0Y2hlcywgZnVuY3Rpb24obmR4LCBtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghMCA9PT0gbWF0Y2guaXNRdWFudGlmaWVyICYmIChmaXJzdE1hdGNoID0gaXNGaXJzdE1hdGNoKGxhdGVzdE1hdGNoLCB0b2tlbkdyb3VwLm1hdGNoZXNbbmR4IC0gMV0pKSkgcmV0dXJuICExO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSksIGZpcnN0TWF0Y2g7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gcmVzb2x2ZU5keEluaXRpYWxpemVyKHBvcywgYWx0ZXJuYXRlTmR4LCB0YXJnZXRBbHRlcm5hdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJlc3RNYXRjaCwgaW5kZXhQb3M7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TWFza1NldCgpLnZhbGlkUG9z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mIChtYXRjaC5tYXRjaGVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5pc0dyb3VwICYmIHF1YW50aWZpZXJSZWN1cnNlICE9PSBtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaCA9IGhhbmRsZU1hdGNoKG1hc2tUb2tlbi5tYXRjaGVzWyQuaW5BcnJheShtYXRjaCwgbWFza1Rva2VuLm1hdGNoZXMpICsgMV0sIGxvb3BOZHgpKSByZXR1cm4gITA7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoLmlzT3B0aW9uYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0aW9uYWxUb2tlbiA9IG1hdGNoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaCA9IHJlc29sdmVUZXN0RnJvbVRva2VuKG1hdGNoLCBuZHhJbml0aWFsaXplciwgbG9vcE5keCwgcXVhbnRpZmllclJlY3Vyc2UpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYXRlc3RNYXRjaCA9IG1hdGNoZXNbbWF0Y2hlcy5sZW5ndGggLSAxXS5tYXRjaCwgIWlzRmlyc3RNYXRjaChsYXRlc3RNYXRjaCwgb3B0aW9uYWxUb2tlbikpIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zZXJ0U3RvcCA9ICEwLCB0ZXN0UG9zID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2guaXNBbHRlcm5hdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hbHRNYXRjaGVzLCBhbHRlcm5hdGVUb2tlbiA9IG1hdGNoLCBtYWx0ZXJuYXRlTWF0Y2hlcyA9IFtdLCBjdXJyZW50TWF0Y2hlcyA9IG1hdGNoZXMuc2xpY2UoKSwgbG9vcE5keENudCA9IGxvb3BOZHgubGVuZ3RoLCBhbHRJbmRleCA9IG5keEluaXRpYWxpemVyLmxlbmd0aCA+IDAgPyBuZHhJbml0aWFsaXplci5zaGlmdCgpIDogLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC0xID09PSBhbHRJbmRleCB8fCBcInN0cmluZ1wiID09IHR5cGVvZiBhbHRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYW1uZHgsIGN1cnJlbnRQb3MgPSB0ZXN0UG9zLCBuZHhJbml0aWFsaXplckNsb25lID0gbmR4SW5pdGlhbGl6ZXIuc2xpY2UoKSwgYWx0SW5kZXhBcnIgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFwic3RyaW5nXCIgPT0gdHlwZW9mIGFsdEluZGV4KSBhbHRJbmRleEFyciA9IGFsdEluZGV4LnNwbGl0KFwiLFwiKTsgZWxzZSBmb3IgKGFtbmR4ID0gMDsgYW1uZHggPCBhbHRlcm5hdGVUb2tlbi5tYXRjaGVzLmxlbmd0aDsgYW1uZHgrKykgYWx0SW5kZXhBcnIucHVzaChhbW5keCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIG5keCA9IDA7IG5keCA8IGFsdEluZGV4QXJyLmxlbmd0aDsgbmR4KyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbW5keCA9IHBhcnNlSW50KGFsdEluZGV4QXJyW25keF0pLCBtYXRjaGVzID0gW10sIG5keEluaXRpYWxpemVyID0gcmVzb2x2ZU5keEluaXRpYWxpemVyKHRlc3RQb3MsIGFtbmR4LCBsb29wTmR4Q250KSB8fCBuZHhJbml0aWFsaXplckNsb25lLnNsaWNlKCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgITAgIT09IChtYXRjaCA9IGhhbmRsZU1hdGNoKGFsdGVybmF0ZVRva2VuLm1hdGNoZXNbYW1uZHhdIHx8IG1hc2tUb2tlbi5tYXRjaGVzW2FtbmR4XSwgWyBhbW5keCBdLmNvbmNhdChsb29wTmR4KSwgcXVhbnRpZmllclJlY3Vyc2UpIHx8IG1hdGNoKSAmJiBtYXRjaCAhPT0gdW5kZWZpbmVkICYmIGFsdEluZGV4QXJyW2FsdEluZGV4QXJyLmxlbmd0aCAtIDFdIDwgYWx0ZXJuYXRlVG9rZW4ubWF0Y2hlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbnRuZHggPSAkLmluQXJyYXkobWF0Y2gsIG1hc2tUb2tlbi5tYXRjaGVzKSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFza1Rva2VuLm1hdGNoZXMubGVuZ3RoID4gbnRuZHggJiYgKG1hdGNoID0gaGFuZGxlTWF0Y2gobWFza1Rva2VuLm1hdGNoZXNbbnRuZHhdLCBbIG50bmR4IF0uY29uY2F0KGxvb3BOZHguc2xpY2UoMSwgbG9vcE5keC5sZW5ndGgpKSwgcXVhbnRpZmllclJlY3Vyc2UpKSAmJiAoYWx0SW5kZXhBcnIucHVzaChudG5keC50b1N0cmluZygpKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5lYWNoKG1hdGNoZXMsIGZ1bmN0aW9uKG5keCwgbG1udCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsbW50LmFsdGVybmF0aW9uID0gbG9vcE5keC5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hbHRNYXRjaGVzID0gbWF0Y2hlcy5zbGljZSgpLCB0ZXN0UG9zID0gY3VycmVudFBvcywgbWF0Y2hlcyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgbmR4MSA9IDA7IG5keDEgPCBtYWx0TWF0Y2hlcy5sZW5ndGg7IG5keDErKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhbHRNYXRjaCA9IG1hbHRNYXRjaGVzW25keDFdLCBkcm9wTWF0Y2ggPSAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHRNYXRjaC5hbHRlcm5hdGlvbiA9IGFsdE1hdGNoLmFsdGVybmF0aW9uIHx8IGxvb3BOZHhDbnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgbmR4MiA9IDA7IG5keDIgPCBtYWx0ZXJuYXRlTWF0Y2hlcy5sZW5ndGg7IG5keDIrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWx0TWF0Y2gyID0gbWFsdGVybmF0ZU1hdGNoZXNbbmR4Ml07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcInN0cmluZ1wiICE9IHR5cGVvZiBhbHRJbmRleCB8fCAtMSAhPT0gJC5pbkFycmF5KGFsdE1hdGNoLmxvY2F0b3JbYWx0TWF0Y2guYWx0ZXJuYXRpb25dLnRvU3RyaW5nKCksIGFsdEluZGV4QXJyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uKHNvdXJjZSwgdGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJjZS5tYXRjaC5uYXRpdmV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gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFsdGVybmF0ZU1hdGNoZXMuc3BsaWNlKG1hbHRlcm5hdGVNYXRjaGVzLmluZGV4T2YoYWx0TWF0Y2gyKSwgMSwgYWx0TWF0Y2gpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbHRNYXRjaC5tYXRjaC5kZWYgPT09IGFsdE1hdGNoMi5tYXRjaC5kZWYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcm9wTWF0Y2ggPSAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmdW5jdGlvbihzb3VyY2UsIHRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsID09PSBzb3VyY2UubWF0Y2guZm4gJiYgbnVsbCAhPT0gdGFyZ2V0Lm1hdGNoLmZuICYmIHRhcmdldC5tYXRjaC5mbi50ZXN0KHNvdXJjZS5tYXRjaC5kZWYsIGdldE1hc2tTZXQoKSwgcG9zLCAhMSwgb3B0cywgITEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfShhbHRNYXRjaCwgYWx0TWF0Y2gyKSB8fCBmdW5jdGlvbihzb3VyY2UsIHRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3BNYXRjaCA9ICEwLCBhbHRNYXRjaC5sb2NhdG9yW2FsdE1hdGNoLmFsdGVybmF0aW9uXSA9IGFsdE1hdGNoMi5sb2NhdG9yW2FsdE1hdGNoMi5hbHRlcm5hdGlvbl0udG9TdHJpbmcoKS5zcGxpdChcIlwiKVswXSArIFwiLFwiICsgYWx0TWF0Y2gubG9jYXRvclthbHRNYXRjaC5hbHRlcm5hdGlvbl0sIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hbHRlcm5hdGVNYXRjaGVzLnNwbGljZShtYWx0ZXJuYXRlTWF0Y2hlcy5pbmRleE9mKGFsdE1hdGNoMiksIDAsIGFsdE1hdGNoKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcE1hdGNoIHx8IG1hbHRlcm5hdGVNYXRjaGVzLnB1c2goYWx0TWF0Y2gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwic3RyaW5nXCIgPT0gdHlwZW9mIGFsdEluZGV4ICYmIChtYWx0ZXJuYXRlTWF0Y2hlcyA9ICQubWFwKG1hbHRlcm5hdGVNYXRjaGVzLCBmdW5jdGlvbihsbW50LCBuZHgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0Zpbml0ZShuZHgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFsdGVybmF0aW9uID0gbG1udC5hbHRlcm5hdGlvbiwgYWx0TG9jQXJyID0gbG1udC5sb2NhdG9yW2FsdGVybmF0aW9uXS50b1N0cmluZygpLnNwbGl0KFwiLFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsbW50LmxvY2F0b3JbYWx0ZXJuYXRpb25dID0gdW5kZWZpbmVkLCBsbW50LmFsdGVybmF0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGFsbmR4ID0gMDsgYWxuZHggPCBhbHRMb2NBcnIubGVuZ3RoOyBhbG5keCsrKSAtMSAhPT0gJC5pbkFycmF5KGFsdExvY0FyclthbG5keF0sIGFsdEluZGV4QXJyKSAmJiAobG1udC5sb2NhdG9yW2FsdGVybmF0aW9uXSAhPT0gdW5kZWZpbmVkID8gKGxtbnQubG9jYXRvclthbHRlcm5hdGlvbl0gKz0gXCIsXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxtbnQubG9jYXRvclthbHRlcm5hdGlvbl0gKz0gYWx0TG9jQXJyW2FsbmR4XSkgOiBsbW50LmxvY2F0b3JbYWx0ZXJuYXRpb25dID0gcGFyc2VJbnQoYWx0TG9jQXJyW2FsbmR4XSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxtbnQuYWx0ZXJuYXRpb24gPSBhbHRlcm5hdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxtbnQubG9jYXRvclthbHRlcm5hdGlvbl0gIT09IHVuZGVmaW5lZCkgcmV0dXJuIGxtbnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC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oZXNbJC5pbkFycmF5KHF0LCBtYXNrVG9rZW4ubWF0Y2hlcykgLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2ggPSBoYW5kbGVNYXRjaCh0b2tlbkdyb3VwLCBbIHFuZHggXS5jb25jYXQobG9vcE5keCksIHRva2VuR3JvdXApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYXRlc3RNYXRjaCA9IG1hdGNoZXNbbWF0Y2hlcy5sZW5ndGggLSAxXS5tYXRjaCwgbGF0ZXN0TWF0Y2gub3B0aW9uYWxRdWFudGlmaWVyID0gcW5keCA+IHF0LnF1YW50aWZpZXIubWluIC0gMSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRmlyc3RNYXRjaChsYXRlc3RNYXRjaCwgdG9rZW5Hcm91cCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChxbmR4ID4gcXQucXVhbnRpZmllci5taW4gLSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zZXJ0U3RvcCA9ICEwLCB0ZXN0UG9zID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoID0gcmVzb2x2ZVRlc3RGcm9tVG9rZW4obWF0Y2gsIG5keEluaXRpYWxpemVyLCBsb29wTmR4LCBxdWFudGlmaWVyUmVjdXJzZSkpIHJldHV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iAgICAgICAgICAgICAgICAgICAgICAgIH0pKSwgbG9jYXRvcjtcbiAgICAgICAgICAgICAgICAgICAgfSh0ZXN0KSwgY2FjaGVEZXBlbmRlbmN5ID0gbmR4SW5pdGlhbGl6ZXIuam9pbihcIlwiKSwgdGVzdFBvcyA9IHByZXZpb3VzUG9zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGdldE1hc2tTZXQoKS50ZXN0c1twb3NdICYmIGdldE1hc2tTZXQoKS50ZXN0c1twb3NdWzBdLmNkID09PSBjYWNoZURlcGVuZGVuY3kpIHJldHVybiBmaWx0ZXJUZXN0cyhnZXRNYXNrU2V0KCkudGVzdHNbcG9zXSk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgbXRuZHggPSBuZHhJbml0aWFsaXplci5zaGlmdCgpOyBtdG5keCA8IG1hc2tUb2tlbnMubGVuZ3RoOyBtdG5keCsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXNvbHZlVGVzdEZyb21Ub2tlbihtYXNrVG9rZW5zW210bmR4XSwgbmR4SW5pdGlhbGl6ZXIsIFsgbXRuZHggXSkgJiYgdGVzdFBvcyA9PT0gcG9zIHx8IHRlc3RQb3MgPiBwb3MpIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAoMCA9PT0gbWF0Y2hlcy5sZW5ndGggfHwgaW5zZXJ0U3RvcCkgJiYgbWF0Y2hlcy5wdXNoKHtcbiAgICAgICAgICAgICAgICBtYXRjaDoge1xuICAgICAgICAgICAgICAgICAgICBmbjogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDAsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsaXR5OiAhMCxcbiAgICAgICAgICAgICAgICAgICAgY2FzaW5nOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICBkZWY6IFwiXCIsXG4gICAgICAgICAg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gICAgICAgICAgICAgY2FzZSBcImxvd2VyXCI6XG4gICAgICAgICAgICAgICAgZWxlbSA9IGVsZW0udG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICBjYXNlIFwidGl0bGVcIjpcbiAgICAgICAgICAgICAgICB2YXIgcG9zQmVmb3JlID0gZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW3BvcyAtIDFdO1xuICAgICAgICAgICAgICAgIGVsZW0gPSAwID09PSBwb3MgfHwgcG9zQmVmb3JlICYmIHBvc0JlZm9yZS5pbnB1dCA9PT0gU3RyaW5nLmZyb21DaGFyQ29kZShJbnB1dG1hc2sua2V5Q29kZS5TUEFDRSkgPyBlbGVtLnRvVXBwZXJDYXNlKCkgOiBlbGVtLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBpZiAoJC5pc0Z1bmN0aW9uKG9wdHMuY2FzaW5nKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYXJncyA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cyk7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3MucHVzaChnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnMpLCBlbGVtID0gb3B0cy5jYXNpbmcuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGVsZW07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gY2hlY2tBbHRlcm5hdGlvbk1hdGNoKGFsdEFycjEsIGFsdEFycjIsIG5hKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBuYU5keCwgYWx0QXJyQyA9IG9wdHMuZ3JlZWR5ID8gYWx0QXJyMiA6IGFsdEFycjIuc2xpY2UoMCwgMSksIGl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0aW9uYWxQYXJ0Q2hhcmFjdGVyICYmIG51bGwgPT09IHRlc3QuZm4gPyBnZXRQbGFjZWhvbGRlcihwb3NpdGlvbiwgdGVzdCwgITApIHx8IHRlc3QuZGVmIDogZWxlbTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWxpZGF0ZWRQb3MgPSBwb3NpdGlvbiwgcG9zc2libGVNb2RpZmllZEJ1ZmZlciA9IGdldEJ1ZmZlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJzbHQucmVtb3ZlICE9PSB1bmRlZmluZWQgJiYgKCQuaXNBcnJheShyc2x0LnJlbW92ZSkgfHwgKHJzbHQucmVtb3ZlID0gWyByc2x0LnJlbW92ZSBdKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAkLmVhY2gocnNsdC5yZW1vdmUuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGIgLSBhO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSksIGZ1bmN0aW9uKG5keCwgbG1udCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmlwVmFsaWRQb3NpdGlvbnMobG1udCwgbG1udCArIDEsICEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKSwgcnNsdC5pbnNlcnQgIT09IHVuZGVmaW5lZCAmJiAoJC5pc0FycmF5KHJzbHQuaW5zZXJ0KSB8fCAocnNsdC5pbnNlcnQgPSBbIHJzbHQuaW5zZXJ0IF0pLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICQuZWFjaChyc2x0Lmluc2VydC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYSAtIGI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KSwgZnVuY3Rpb24obmR4LCBsbW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNWYWxpZChsbW50LnBvcywgbG1udC5jLCAhMCwgZnJvbVNldFZhbGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKSwgcnNsdC5yZWZyZXNoRnJvbUJ1ZmZlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWZyZXNoID0gcnNsdC5yZWZyZXNoRnJvbUJ1ZmZlcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVmcmVzaEZyb21CdWZmZXIoITAgPT09IHJlZnJlc2ggPyByZWZyZXNoIDogcmVmcmVzaC5zdGFydCwgcmVmcmVzaC5lbmQsIHBvc3NpYmxlTW9kaWZpZWRCdWZmZXIpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByc2x0LnBvcyA9PT0gdW5kZWZpbmVkICYmIHJzbHQuYyA9PT0gdW5kZWZpbmVkKSByZXR1cm4gcnNsdC5wb3MgPSBnZXRMYXN0VmFsaWRQb3NpdGlvbigpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHZhbGlkYXRlZFBvcyA9IHJzbHQucG9zICE9PSB1bmRlZmluZWQgPyByc2x0LnBvcyA6IHBvc2l0aW9uKSAhPT0gcG9zaXRpb24pIHJldHVybiByc2x0ID0gJC5leHRlbmQocnNsdCwgaXNWYWxpZCh2YWxpZGF0ZWRQb3MsIGVsZW0sICEwLCBmcm9tU2V0VmFsaWQpKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgITE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCEwICE9PSByc2x0ICYmIHJzbHQucG9zICE9PSB1bmRlZmluZWQgJiYgcnNsdC5wb3MgIT09IHBvc2l0aW9uICYmICh2YWxpZGF0ZWRQb3MgPSByc2x0LnBvcywgXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoRnJvbUJ1ZmZlcihwb3NpdGlvbiwgdmFsaWRhdGVkUG9zLCBnZXRCdWZmZXIoKS5zbGljZSgpKSwgdmFsaWRhdGVkUG9zICE9PSBwb3NpdGlvbikpIHJldHVybiByc2x0ID0gJC5leHRlbmQocnNsdCwgaXNWYWxpZCh2YWxpZGF0ZWRQb3MsIGVsZW0sICEwKSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgITE7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCEwID09PSByc2x0IHx8IHJzbHQucG9zICE9PSB1bmRlZmluZWQgfHwgcnNsdC5jICE9PSB1bmRlZmluZWQpICYmIChuZHggPiAwICYmIHJlc2V0TWFza1NldCghMCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0VmFsaWRQb3NpdGlvbih2YWxpZGF0ZWRQb3MsICQuZXh0ZW5kKHt9LCB0c3QsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dDogY2FzaW5nKGVsZW0sIHRlc3QsIHZhbGlkYXRlZFBvcylcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLCBmcm9tU2V0VmFsaWQsIGlzU2VsZWN0aW9uKHBvcykpIHx8IChyc2x0ID0gITEpLCAhMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KSwgcnNsdDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZ1bmN0aW9uIHNldFZhbGlkUG9zaXRpb24ocG9zLCB2YWxpZFRlc3QsIGZyb21TZXRWYWxpZCwgaXNTZWxlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNTZWxlY3Rpb24gfHwgb3B0cy5pbnNlcnRNb2RlICYmIGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1twb3NdICE9PSB1bmRlZmluZWQgJiYgZnJvbVNldFZhbGlkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGksIHBvc2l0aW9uc0Nsb25lID0gJC5leHRlbmQoITAsIHt9LCBnZXRNY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U2V0KCkubWFza0xlbmd0aCA9IGluaXRpYWxMZW5ndGgpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZCkgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbGlkKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbGlkKSByZXR1cm4gZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zID0gJC5leHRlbmQoITAsIHt9LCBwb3NpdGlvbnNDbG9uZSksIFxuICAgICAgICAgICAgICAgICAgICByZXNldE1hc2tTZXQoITApLCAhMTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW3Bvc10gPSAkLmV4dGVuZCghMCwge30sIHZhbGlkVGVzdCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc2V0TWFza1NldCghMCksICEwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gZmlsbE1pc3NpbmdOb25NYXNrKG1hc2tQb3MpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBwbmR4ID0gbWFza1BvcyAtIDE7IHBuZHggPiAtMSAmJiAhZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW3BuZHhdOyBwbmR4LS0pIDtcbiAgICAgICAgICAgICAgICB2YXIgdGVzdFRlbXBsYXRlLCB0ZXN0c0Zyb21Qb3M7XG4gICAgICAgICAgICAgICAgZm9yIChwbmR4Kys7IHBuZHggPCBtYXNrUG9zOyBwbmR4KyspIGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1twbmR4XSA9PT0gdW5kZWZpbmVkICYmICghMSA9PT0gb3B0cy5qaXRNYXNraW5nIHx8IG9wdHMuaml0TWFza2luZyA+IHBuZHgpICYmICh0ZXN0c0Zyb21Qb3MgPSBnZXRUZXN0c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25zW3BzXSA9PT0gdW5kZWZpbmVkICYmICFpc01hc2socHMsICEwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlc3RzID0gZ2V0VGVzdHMocHMpLnNsaWNlKCksIGJlc3RNYXRjaCA9IGRldGVybWluZVRlc3RUZW1wbGF0ZSh0ZXN0cywgITApLCBlcXVhbGl0eSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJcIiA9PT0gdGVzdHNbdGVzdHMubGVuZ3RoIC0gMV0ubWF0Y2guZGVmICYmIHRlc3RzLnBvcCgpLCAkLmVhY2godGVzdHMsIGZ1bmN0aW9uKG5keCwgdHN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0bGw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHN0LmxvY2F0b3JbaV0gPT09IHVuZGVmaW5lZCB8fCAhY2hlY2tBbHRlcm5hdGlvbk1hdGNoKHRzdC5sb2NhdG9yW2ldLnRvU3RyaW5nKCkuc3BsaXQoXCIsXCIpLCB0YXJnZXRMb2NhdG9yW2ldLnRvU3RyaW5nKCkuc3BsaXQoXCIsXCIpLCB0c3QubmEpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0QUkgPSB0YXJnZXRMb2NhdG9yW2ldLCBiZXN0TWF0Y2hBSSA9IGJlc3RNYXRjaC5sb2NhdG9yW2ldLCB0c3RBSSA9IHRzdC5sb2NhdG9yW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0QUkgLSBiZXN0TWF0Y2hBSSA+IE1hdGguYWJzKHRhcmdldEFJIC0gdHN0QUkpICYmIChiZXN0TWF0Y2ggPSB0c3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXF1YWxpdHkgPCBpICYmIChlcXVhbGl0eSA9IGksIGJlc3RNYXRjaCA9IHRzdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksIGJlc3RNYXRjaCA9ICQuZXh0ZW5kKHt9LCBiZXN0TWF0Y2gsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dDogZ2V0UGxhY2Vob2xkZXIocHMsIGJlc3RNYXRjaC5tYXRjaCwgITApIHx8IGJlc3RNYXRjaC5tYXRjaC5kZWZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCBiZXN0TWF0Y2guZ2VuZXJhdGVkSW5wdXQgPSAhMCwgc2V0VmFsaWRQb3NpdGlvbihwcywgYmVzdE1hdGNoLCAhMCksIGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1tuZXdQb3NdID0gdW5kZWZpbmVkLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9pc1ZhbGlkKG5ld1BvcywgdnAuaW5wdXQsICEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0obWFza1BvcywgcmVzdWx0LnBvcyAhPT0gdW5kZWZpbmVkID8gcmVzdWx0LnBvcyA6IG5Qb3MpLCBtYXNrUG9zID0gblBvcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHJlc3VsdCA9IHt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HRlcm5hdGlvbl0pIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJldkFsdFBvcyA9IGFsdFBvcztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoYWx0ZXJuYXRpb24gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVjaXNpb25Qb3MgPSBwYXJzZUludChsYXN0QWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWNpc2lvblRha2VyID0gcHJldkFsdFBvcy5sb2NhdG9yW3ByZXZBbHRQb3MuYWx0ZXJuYXRpb24gfHwgYWx0ZXJuYXRpb25dICE9PSB1bmRlZmluZWQgPyBwcmV2QWx0UG9zLmxvY2F0b3JbcHJldkFsdFBvcy5hbHRlcm5hdGlvbiB8fCBhbHRlcm5hdGlvbl0gOiBhbHROZHhzWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVjaXNpb25UYWtlci5sZW5ndGggPiAwICYmIChkZWNpc2lvblRha2VyID0gZGVjaXNpb25UYWtlci5zcGxpdChcIixcIilbMF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBvc3NpYmlsaXR5UG9zID0gZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW2RlY2lzaW9uUG9zXSwgcHJldlBvcyA9IGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1tkZWNpc2lvblBvcyAtIDFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgJC5lYWNoKGdldFRlc3RzKGRlY2lzaW9uUG9zLCBwcmV2UG9zID8gcHJldlBvcy5sb2NhdG9yIDogdW5kZWZpbmVkLCBkZWNpc2lvblBvcyAtIDEpLCBmdW5jdGlvbihuZHgsIHRlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHROZHhzID0gdGVzdC5sb2NhdG9yW2FsdGVybmF0aW9uXSA/IHRlc3QubG9jYXRvclthbHRlcm5hdGlvbl0udG9TdHJpbmcoKS5zcGxpdChcIixcIikgOiBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBtbmR4ID0gMDsgbW5keCA8IGFsdE5keHMubGVuZ3RoOyBtbmR4KyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbGlkSW5wdXRzID0gW10sIHN0YXRpY0lucHV0c0JlZm9yZVBvcyA9IDAsIHN0YXRpY0lucHV0c0JlZm9yZVBvc0FsdGVybmF0ZSA9IDAsIHZlcmlmeVZhbGlkSW5wdXQgPSAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlY2lzaW9uVGFrZXIgPCBhbHROZHhzW21uZHhdICYmICh0ZXN0Lm5hID09PSB1bmRlZmluZWQgfHwgLTEgPT09ICQuaW5BcnJheShhbHROZHhzW21uZHhdLCB0ZXN0Lm5hLnNwbGl0KFwiLFwiKSkgfHwgLTEgPT09ICQuaW5BcnJheShkZWNpc2lvblRha2VyLnRvU3RyaW5nKCksIGFsdE5keHMpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW2RlY2lzaW9uUG9zXSA9ICQuZXh0ZW5kKCEwLCB7fSwgdGVzdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9zc2liaWxpdGllcyA9IGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1tkZWNpc2lvblBvc10ubG9jYXRvcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW2RlY2lzaW9uUG9zXS5sb2NhdG9yW2FsdGVybmF0aW9uXSA9IHBhcnNlSW50KGFsdE5keHNbbW5keF0pLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwgPT0g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ucHVzaCh2YWxpZFBvcy5pbnB1dCkgOiBpIDwgcG9zICYmIHN0YXRpY0lucHV0c0JlZm9yZVBvcysrLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZlcmlmeVZhbGlkSW5wdXQgJiYgdmFsaWRJbnB1dHNbMF0gPT09IHRlc3QubWF0Y2guZGVmICYmIHZhbGlkSW5wdXRzLnNoaWZ0KCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzZXRNYXNrU2V0KCEwKSwgaXNWYWxpZFJzbHQgPSAhMDsgdmFsaWRJbnB1dHMubGVuZ3RoID4gMDsgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlucHV0ID0gdmFsaWRJbnB1dHMuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT09IG9wdHMuc2tpcE9wdGlvbmFsUGFydENoYXJhY3RlciAmJiAhKGlzVmFsaWRSc2x0ID0gaXNWYWxpZChnZXRMYXN0VmFsaWRQb3NpdGlvbih1bmRlZmluZWQsICEwKSArIDEsIGlucHV0LCAhMSwgZnJvbVNldFZhbGlkLCAhMCkpKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1ZhbGlkUnNsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1tkZWNpc2lvblBvc10ubG9jYXRvciA9IHBvc3NpYmlsaXRpZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRhcmdldEx2cCA9IGdldExhc3RWYWxpZFBvc2l0aW9uKHBvcykgKyAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IGRlY2lzaW9uUG9zICsgMTsgaSA8IGdldExhc3RWYWxpZFBvc2l0aW9uKCkgKyAxOyBpKyspICgodmFsaWRQb3MgPSBnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnNbaV0pID09PSB1bmRlZmluZWQgfHwgbnVsbCA9PSB2YWxpZFBvcy5tYXRjaC5mbikgJiYgaSA8IHBvcyArIChzdGF0aWNJbnB1dHNCZWZvcmVQb3NBbHRlcm5hdGUgLSBzdGF0aWNJbnB1dHNCZWZvcmVQb3MpICYmIHN0YXRpY0lucHV0c0JlZm9yZVBvc0FsdGVybmF0ZSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcyArPSBzdGF0aWNJbnB1dHNCZWZvcmVQb3NBbHRlcm5hdGUgLSBzdGF0aWNJbnB1dHNCZWZvcmVQb3MsIGlzVmFsaWRSc2x0ID0gaXNWYWxpZChwb3MgPiB0YXJnZXRMdnAgPyB0YXJnZXRMdnAgOiBwb3MsIGMsIHN0cmljdCwgZnJvbVNldFZhbGlkLCAhMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNWYWxpZFJzbHQpIHJldHVybiAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0TWFza1NldCgpLCBnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnMgPSAkLmV4dGVuZCghMCwge30sIHZhbGlkUHNDbG9uZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNWYWxpZFJzbHQ7XG4gICAgICAgICAgICAgICAgfShtYXNrUG9zLCBjLCBzdHJpY3QpKSwgITAgPT09IHJlc3VsdCAmJiAocmVzdWx0ID0ge1xuICAgICAgICAgICAgICAgICAgICBwb3M6IG1hc2tQb3NcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgkLmlzRnVuY3Rpb24ob3B0cy5wb3N0VmFsaWRhdGlvbikgJiYgITEgIT09IHJlc3VsdCAmJiAhc3RyaWN0ICYmICEwICE9PSBmcm9tU2V0VmFsaWQgJiYgITAgIT09IHZhbGlkYXRlT25seSkge1xuICAgICAgICAgICAgICAgIHZhciBwb3N0UmVzdWx0ID0gb3B0cy5wb3N0VmFsaWRhdGlvbihnZXRCdWZmZXIoITApLCByZXN1bHQsIG9wdHMpO1xuICAgICAgICAgICAgICAgIGlmIChwb3N0UmVzdWx0LnJlZnJlc2hGcm9tQnVmZmVyICYmIHBvc3RSZXN1bHQuYnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZWZyZXNoID0gcG9zdFJlc3VsdC5yZWZyZXNoRnJvbUJ1ZmZlcjtcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaEZyb21CdWZmZXIoITAgPT09IHJlZnJlc2ggPyByZWZyZXNoIDogcmVmcmVzaC5zdGFydCwgcmVmcmVzaC5lbmQsIHBvc3RSZXN1bHQuYnVmZmVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gITAgPT09IHBvc3RSZXN1bHQgPyByZXN1bHQgOiBwb3N0UmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCAmJiByZXN1bHQucG9zID09PSB1bmRlZmluZWQgJiYgKHJlc3VsdC5wb3MgPSBtYXNrUG9zKSwgITEgIT09IHJlc3Vs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Qb3NpdGlvbnNbcG9zaXRpb25dLmlucHV0O1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHdyaXRlQnVmZmVyKGlucHV0LCBidWZmZXIsIGNhcmV0UG9zLCBldmVudCwgdHJpZ2dlcklucHV0RXZlbnQpIHtcbiAgICAgICAgICAgIGlmIChldmVudCAmJiAkLmlzRnVuY3Rpb24ob3B0cy5vbkJlZm9yZVdyaXRlKSkge1xuICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBvcHRzLm9uQmVmb3JlV3JpdGUuY2FsbChpbnB1dG1hc2ssIGV2ZW50LCBidWZmZXIsIGNhcmV0UG9zLCBvcHRzKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQucmVmcmVzaEZyb21CdWZmZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWZyZXNoID0gcmVzdWx0LnJlZnJlc2hGcm9tQnVmZmVyO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaEZyb21CdWZmZXIoITAgPT09IHJlZnJlc2ggPyByZWZyZXNoIDogcmVmcmVzaC5zdGFydCwgcmVmcmVzaC5lbmQsIHJlc3VsdC5idWZmZXIgfHwgYnVmZmVyKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIgPSBnZXRCdWZmZXIoITApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNhcmV0UG9zICE9PSB1bmRlZmluZWQgJiYgKGNhcmV0UG9zID0gcmVzdWx0LmNhcmV0ICE9PSB1bmRlZmluZWQgPyByZXN1bHQuY2FyZXQgOiBjYXJldFBvcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaW5wdXQgIT09IHVuZGVmaW5lZCAmJiAoaW5wdXQuaW5wdXRtYXNrLl92YWx1ZVNldChidWZmZXIuam9pbihcIlwiKSks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AgICAgICAgICAgICAgICBpZiAobnVsbCAhPT0gdGVzdC5mbiAmJiBnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnNbaV0gPT09IHVuZGVmaW5lZCAmJiAhMCAhPT0gdGVzdC5vcHRpb25hbGl0eSAmJiAhMCAhPT0gdGVzdC5vcHRpb25hbFF1YW50aWZpZXIgfHwgbnVsbCA9PT0gdGVzdC5mbiAmJiBidWZmZXJbaV0gIT09IGdldFBsYWNlaG9sZGVyKGksIHRlc3QpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZSA9ICExO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY29tcGxldGU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gaGFuZGxlUmVtb3ZlKGlucHV0LCBrLCBwb3MsIHN0cmljdCwgZnJvbUlzVmFsaWQpIHtcbiAgICAgICAgICAgIGlmICgob3B0cy5udW1lcmljSW5wdXQgfHwgaXNSVEwpICYmIChrID09PSBJbnB1dG1hc2sua2V5Q29kZS5CQUNLU1BBQ0UgPyBrID0gSW5wdXRtYXNrLmtleUNvZGUuREVMRVRFIDogayA9PT0gSW5wdXRtYXNrLmtleUNvZGUuREVMRVRFICYmIChrID0gSW5wdXRtYXNrLmtleUNvZGUuQkFDS1NQQUNFKSwgXG4gICAgICAgICAgICBpc1JUTCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgcGVuZCA9IHBvcy5lbmQ7XG4gICAgICAgICAgICAgICAgcG9zLmVuZCA9IHBvcy5iZWdpbiwgcG9zLmJlZ2luID0gcGVuZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGsgPT09IElucHV0bWFzay5rZXlDb2RlLkJBQ0tTUEFDRSAmJiAocG9zLmVuZCAtIHBvcy5iZWdpbiA8IDEgfHwgITEg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W5wdXRtYXNrKGltT3B0cykubWFzayh0aGlzKSA6IEV2ZW50UnVsZXIub2ZmKHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFwic2V0dmFsdWVcIiA9PT0gZS50eXBlIHx8IFwiRk9STVwiID09PSB0aGlzLm5vZGVOYW1lIHx8ICEodGhpcy5kaXNhYmxlZCB8fCB0aGlzLnJlYWRPbmx5ICYmICEoXCJrZXlkb3duXCIgPT09IGUudHlwZSAmJiBlLmN0cmxLZXkgJiYgNjcgPT09IGUua2V5Q29kZSB8fCAhMSA9PT0gb3B0cy50YWJUaHJvdWdoICYmIGUua2V5Q29kZSA9PT0gSW5wdXRtYXNrLmtleUNvZGUuVEFCKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUudHlwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcImlucHV0XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghMCA9PT0gc2tpcElucHV0RXZlbnQpIHJldHVybiBza2lwSW5wdXRFdmVudCA9ICExLCBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwia2V5ZG93blwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2lwS2V5UHJlc3NFdmVudCA9ICExLCBza2lwSW5wdXRFdmVudCA9ICExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcImtleXByZXNzXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghMCA9PT0gc2tpcEtleVByZXNzRXZlbnQpIHJldHVybiBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNraXBLZXlQcmVzc0V2ZW50ID0gITA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiY2xpY2tcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGllbW9iaWxlIHx8IGlwaG9uZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRoYXQgPSB0aGlzLCBhcmdzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRIYW5kbGVyLmFwcGx5KHRoYXQsIGFyZ3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMCksICExO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXR1cm5WYWwgPSBldmVudEhhbmRsZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gITEgPT09IHJldHVyblZhbCAmJiAoZS5wcmV2ZW50RGVmYXVsdCgpLCBlLnN0b3BQcm9wYWdhdGlvbigpKSwgcmV0dXJuVmFsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpbnB1dC5pbnB1dG1hc2suZXZlbnRzW2V2ZW50TmFtZV0gPSBpbnB1dC5pbnB1dG1hc2suZXZlbnRzW2V2ZW50TmFtZV0gfHwgW10sIGlucHV0LmlucHV0bWFzay5ldmVudHNbZXZlbnROYW1lXS5wdXNoKGV2KSwgXG4gICAgICAgICAgICAgICAgLTEgIT09ICQuaW5BcnJheShldmVudE5hbWUsIFsgXCJzdWJtaXRcIiwgXCJyZXNldFwiIF0pID8gbnVsbCAhPT0gaW5wdXQuZm9ybSAmJiAkKGlucHV0LmZvcm0pLm9uKGV2ZW50TmFtZSwgZXYpIDogJChpbnB1dCkub24oZXZlbnROYW1lLCBldik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb2ZmOiBmdW5jdGlvbihpbnB1dCwgZXZlbnQpIHtcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5wdXRtYXNrICYmIGlucHV0LmlucHV0bWFzay5ldmVudHMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV2ZW50cztcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQgPyAoZXZlbnRzID0gW10sIGV2ZW50c1tldmVudF0gPSBpbnB1dC5pbnB1dG1hc2suZXZlbnRzW2V2ZW50XSkgOiBldmVudHMgPSBpbnB1dC5pbnB1dG1hc2suZXZlbnRzLCBcbiAgICAgICAgICAgICAgICAgICAgJC5lYWNoKGV2ZW50cywgZnVuY3Rpb24oZXZlbnROYW1lLCBldkFycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7ZXZBcnIubGVuZ3RoID4gMDsgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV2ID0gZXZBcnIucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEgIT09ICQuaW5BcnJheShldmVudE5hbWUsIFsgXCJzdWJtaXRcIiwgXCJyZXNldFwiIF0pID8gbnVsbCAhPT0gaW5wdXQuZm9ybSAmJiAkKGlucHV0LmZvcm0pLm9mZihldmVudE5hbWUsIGV2KSA6ICQoaW5wdXQpLm9mZihldmVudE5hbWUsIGV2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBpbnB1dC5pbnB1dG1hc2suZXZlbnRzW2V2ZW50TmFtZV07XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwgRXZlbnRIYW5kbGVycyA9IHtcbiAgICAgICAgICAgIGtleWRvd25FdmVudDogZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICAgIHZhciBpbnB1dCA9IHRoaXMsICRpbnB1dCA9ICQoaW5wdXQpLCBrID0gZS5rZXlDb2RlLCBwb3MgPSBjYXJldChpbnB1dCk7XG4gICAgICAgICAgICAgICAgaWYgKGsgPT09IElucHV0bWFzay5rZXlDb2RlLkJBQ0tTUEFDRSB8fCBrID09PSBJbnB1dG1hc2sua2V5Q29kZS5ERUxFVEUgfHwgaXBob25lICYmIGsgPT09IElucHV0bWFzay5rZXlDb2RlLkJBQ0tTUEFDRV9TQUZBUkkgfHwgZS5jdHJsS2V5ICYmIGsgPT09IElucHV0bWFzay5rZXlDb2RlLlggJiYgIWZ1bmN0aW9uKGV2ZW50TmFtZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KFwiaW5wdXRcIiksIGV2TmFtZSA9IFwib25cIiArIGV2ZW50TmFtZSwgaXNTdXBwb3J0ZWQgPSBldk5hbWUgaW4gZWw7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpc1N1cHBvcnRlZCB8fCAoZWwuc2V0QXR0cmlidXRlKGV2TmFtZSwgXCJyZXR1cm47XCIpLCBpc1N1cHBvcnRlZCA9IFwiZnVuY3Rpb25cIiA9PSB0eXBlb2YgZWxbZXZOYW1lXSksIFxuICAgICAgICAgICAgICAgICAgICBlbCA9IG51bGwsIGlzU3VwcG9ydGVkO1xuICAgICAgICAgICAgICAgIH0oXCJjdXRcIikpIGUuc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HRoaXMsICRpbnB1dCA9ICQoaW5wdXQpLCBrID0gZS53aGljaCB8fCBlLmNoYXJDb2RlIHx8IGUua2V5Q29kZTtcbiAgICAgICAgICAgICAgICBpZiAoISghMCA9PT0gY2hlY2t2YWwgfHwgZS5jdHJsS2V5ICYmIGUuYWx0S2V5KSAmJiAoZS5jdHJsS2V5IHx8IGUubWV0YUtleSB8fCBpZ25vcmFibGUpKSByZXR1cm4gayA9PT0gSW5wdXRtYXNrLmtleUNvZGUuRU5URVIgJiYgdW5kb1ZhbHVlICE9PSBnZXRCdWZmZXIoKS5qb2luKFwiXCIpICYmICh1bmRvVmFsdWUgPSBnZXRCdWZmZXIoKS5qb2luKFwiXCIpLCBcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAkaW5wdXQudHJpZ2dlcihcImNoYW5nZVwiKTtcbiAgICAgICAgICAgICAgICB9LCAwKSksICEwO1xuICAgICAgICAgICAgICAgIGlmIChrKSB7XG4gICAgICAgICAgICAgICAgICAgIDQ2ID09PSBrICYmICExID09PSBlLnNoaWZ0S2V5ICYmIFwiXCIgIT09IG9wdHMucmFkaXhQb2ludCAmJiAoayA9IG9wdHMucmFkaXhQb2ludC5jaGFyQ29kZUF0KDApKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZvcndhcmRQb3NpdGlvbiwgcG9zID0gY2hlY2t2YWwgPyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiZWdpbjogbmR4LFxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kOiBuZHhcbiAgICAgICAgICAgICAgICAgICAgfSA6IGNhcmV0KGlucHV0KSwgYyA9IFN0cmluZy5mcm9tQ2hhckNvZGUoayk7XG4gICAgICAgICAgICAgICAgICAgIGdldE1hc2tTZXQoKS53cml0ZU91dEJ1ZmZlciA9ICEwO1xuICAgICAgICAgICAgICAgICAgICB2YXIgdmFsUmVzdWx0ID0gaXNWYWxpZChwb3MsIGMsIHN0cmljdCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghMSAhPT0gdmFsUmVzdWx0ICYmIChyZXNldE1hc2tTZXQoITApLCBmb3J3YXJkUG9zaXRpb24gPSB2YWxSZXN1bHQuY2FyZXQgIT09IHVuZGVmaW5lZCA/IHZhbFJlc3VsdC5jYXJldCA6IGNoZWNrdmFsID8gdmFsUmVzdWx0LnBvcyArIDEgOiBzZWVrTmV4dCh2YWxSZXN1bHQucG9zKSwgXG4gICAgICAgICAgICAgICAgICAgIGdldE1hc2tTZXQoKS5wID0gZm9yd2FyZFBvc2l0aW9uKSwgITEgIT09IHdyaXRlT3V0ICYmIChzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0cy5vbktleVZhbGlkYXRpb24uY2FsbChpbnB1dCwgaywgdmFsUmVzdWx0LCBvcHRzKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgMCksIGdldE1hc2tTZXQoKS53cml0ZU91dEJ1ZmZlciAmJiAhMSAhPT0gdmFsUmVzdWx0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJ1ZmZlciA9IGdldEJ1ZmZlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVCdWZmZXIoaW5wdXQsIGJ1ZmZlciwgb3B0cy5udW1lcmljSW5wdXQgJiYgdmFsUmVzdWx0LmNhcmV0ID09PSB1bmRlZmluZWQgPyBzZWVrUHJldmlvdXMoZm9yd2FyZFBvc2l0aW9uKSA6IGZvcndhcmRQb3NpdGlvbiwgZSwgITAgIT09IGNoZWNrdmFsKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAhMCAhPT0gY2hlY2t2YWwgJiYgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhMCA9PT0gaXNDb21wbGV0ZShidWZmZXIpICYmICRpbnB1dC50cmlnZ2VyKFwiY29tcGxldGVcIik7X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gICAgICAgICAgICAgaWYgKCExID09PSBmdW5jdGlvbihpbnB1dCwgaW5wdXRWYWx1ZSwgY2FyZXRQb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcIi5cIiA9PT0gaW5wdXRWYWx1ZS5jaGFyQXQoY2FyZXRQb3MuYmVnaW4gLSAxKSAmJiBcIlwiICE9PSBvcHRzLnJhZGl4UG9pbnQgJiYgKGlucHV0VmFsdWUgPSBpbnB1dFZhbHVlLnNwbGl0KFwiXCIpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0VmFsdWVbY2FyZXRQb3MuYmVnaW4gLSAxXSA9IG9wdHMucmFkaXhQb2ludC5jaGFyQXQoMCksIGlucHV0VmFsdWUgPSBpbnB1dFZhbHVlLmpvaW4oXCJcIikpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0VmFsdWUuY2hhckF0KGNhcmV0UG9zLmJlZ2luIC0gMSkgPT09IG9wdHMucmFkaXhQb2ludCAmJiBpbnB1dFZhbHVlLmxlbmd0aCA+IGdldEJ1ZmZlcigpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXlwcmVzcyA9IG5ldyAkLkV2ZW50KFwia2V5cHJlc3NcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGtleXByZXNzLndoaWNoID0gb3B0cy5yYWRpeFBvaW50LmNoYXJDb2RlQXQoMCksIEV2ZW50SGFuZGxlcnMua2V5cHJlc3NFdmVudC5jYWxsKGlucHV0LCBrZXlwcmVzcywgITAsICEwLCAhMSwgY2FyZXRQb3MuYmVnaW4gLSAxKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgITE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0oaW5wdXQsIGlucHV0VmFsdWUsIGNhcmV0UG9zKSkgcmV0dXJuICExO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXRWYWx1ZSA9IGlucHV0VmFsdWUucmVwbGFjZShuZXcgUmVnRXhwKFwiKFwiICsgSW5wdXRtYXNrLmVzY2FwZVJlZ2V4KGdldEJ1ZmZlclRlbXBsYXRlKCkuam9pbihcIlwiKSkgKyBcIikqXCIpLCBcIlwiKSwgXG4gICAgICAgICAgICAgICAgICAgICExID09PSBmdW5jdGlvbihpbnB1dCwgaW5wdXRWYWx1ZSwgY2FyZXRQb3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZW1vYmlsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnB1dENoYXIgPSBpbnB1dFZhbHVlLnJlcGxhY2UoZ2V0QnVmZmVyKCkuam9pbihcIlwiKSwgXCJcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKDEgPT09IGlucHV0Q2hhci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleXByZXNzID0gbmV3ICQuRXZlbnQoXCJrZXlwcmVzc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGtleXByZXNzLndoaWNoID0gaW5wdXRDaGFyLmNoYXJDb2RlQXQoMCksIEV2ZW50SGFuZGxlcnMua2V5cHJlc3NFdmVudC5jYWxsKGlucHV0LCBrZXlwcmVzcywgITAsICEwLCAhMSwgZ2V0TWFza1NldCgpLnZhbGlkUG9zaXRpb25zW2NhcmV0UG9zLmJlZ2luIC0gMV0gPyBjYXJldFBvcy5iZWdpbiA6IGNhcmV0UG9zLmJlZ2luIC0gMSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0oaW5wdXQsIGlucHV0VmFsdWUsIGNhcmV0UG9zKSkgcmV0dXJuICExO1xuICAgICAgIC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ICAgICAgICAgICAgICAgICB2YXIgYnVmZmVyID0gZ2V0QnVmZmVyKCkuc2xpY2UoKSwgbnB0VmFsdWUgPSBpbnB1dC5pbnB1dG1hc2suX3ZhbHVlR2V0KCk7XG4gICAgICAgICAgICAgICAgICAgIG5wdFZhbHVlICE9PSBpbnB1dC5nZXRBdHRyaWJ1dGUoXCJwbGFjZWhvbGRlclwiKSAmJiBcIlwiICE9PSBucHRWYWx1ZSAmJiAoLTEgPT09IGdldExhc3RWYWxpZFBvc2l0aW9uKCkgJiYgbnB0VmFsdWUgPT09IGdldEJ1ZmZlclRlbXBsYXRlKCkuam9pbihcIlwiKSA/IGJ1ZmZlciA9IFtdIDogY2xlYXJPcHRpb25hbFRhaWwoYnVmZmVyKSwgXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlQnVmZmVyKGlucHV0LCBidWZmZXIpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY2xpY2tFdmVudDogZnVuY3Rpb24oZSwgdGFiYmVkKSB7XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZG9SYWRpeEZvY3VzKGNsaWNrUG9zKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChcIlwiICE9PSBvcHRzLnJhZGl4UG9pbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2cHMgPSBnZXRNYXNrU2V0KCkudmFsaWRQb3NpdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodnBzW2NsaWNrUG9zXSA9PT0gdW5kZWZpbmVkIHx8IHZwc1tjbGlja1Bvc10uaW5wdXQgPT09IGdldFBsYWNlaG9sZGVyKGNsaWNrUG9zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbGlja1BvcyA8IHNlZWtOZXh0KC0xKSkgcmV0dXJuICEwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByYWRpeFBvcyA9ICQuaW5BcnJheShvcHRzLnJhZGl4UG9pbnQsIGdldEJ1ZmZlcigpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoLTEgIT09IHJhZGl4UG9zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHZwIGluIHZwcykgaWYgKHJhZGl4UG9zIDwgdnAgJiYgdnBzW3ZwXS5pbnB1dCAhPT0gZ2V0UGxhY2Vob2xkZXIodnApKSByZXR1cm4gITE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAhMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICExO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgaW5wdXQgPSB0aGlzO1xuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5hY3RpdmVFbGVtZW50ID09PSBpbnB1dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkQ2FyZXQgPSBjYXJldChpbnB1dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFiYmVkICYmIChpc1JUTCA/IHNlbGVjdGVkQ2FyZXQuZW5kID0gc2VsZWN0ZWRDYXJldC5iZWdpbiA6IHNlbGVjdGVkQ2FyZXQuYmVnaW4gPSBzZWxlY3RlZENhcmV0LmVuZCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRDYXJldC5iZWdpbiA9PT0gc2VsZWN0ZWRDYXJldC5lbmQpIHN3aXRjaCAob3B0cy5wb3NpdGlvbkNhcmV0T25DbGljaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwibm9uZVwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJyYWRpeEZvY3VzXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvUmFkaXhGb2N1cyhzZWxlY3RlZENhcmV0LmJlZ2luKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmFkaXhQb3MgPSBnZXRCdWZmZXIoKS5qb2luKFwiXCIpLmluZGV4T2Yob3B0cy5yYWRpeFBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZXQoaW5wdXQsIG9wdHMubnVtZXJpY0lucHV0ID8gc2Vla05leHQocmFkaXhQb3MpIDogcmFkaXhQb3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xpY2tQb3NpdGlvbiA9IHNlbGVjdGVkQ2FyZXQuYmVnaW4sIGx2Y2xpY2tQb3NpdGlvbiA9IGdldExhc3RWYWxpZFBvc2l0aW9uKGNsaWNrUG9zaXRpb24sICEwKSwgbGFzdFBvc2l0aW9uID0gc2Vla05leHQobHZjbGlja1Bvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2xpY2tQb3NpdGlvbiA8IGxhc3RQb3NpdGlvbikgY2FyZXQoaW5wdXQsIGlzTWFzayhjbGlja1Bvc2l0aW9uLCAhMCkgfHwgaXNNYXNrKGNsaWNrUG9zaXRpb24gLSAxLCAhMCkgPyBjbGlja1Bvc2l0aW9uIDogc2Vla05leHQoY2xpY2tQb3NpdGlvbikpOyBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGx2cCA9IGdldE1hc2tTZXQoKS52YWxpZFBvc2l0aW9uc1tsdmNsaWNrUG9zaXRpb25dLCB0dCA9IGdldFRlc3RUZW1wbGF0ZShsYXN0UG9zaXRpb24sIGx2cCA/IGx2cC5tYXRjaC5sb2NhdG9yIDogdW5kZWZpbmVkLCBsdnApLCBwbGFjZWhvbGRlciA9IGdldFBsYWNlaG9sZGVyKGxhc3RQb3NpdGlvbiwgdHQubWF0Y2gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXCJcIiAhPT0gcGxhY2Vob2xkZXIgJiYgZ2V0QnVmZmVyKClbbGFzdFBvc2l0aW9uXSAhPT0gcGxhY2Vob2xkZXIgJiYgITAgIT09IHR0Lm1hdGNoLm9wdGlvbmFsUXVhbnRpZmllciAmJiAhMCAhPT0gdHQubWF0Y2gubmV3QmxvY2tNYXJrZXIgfHwgIWlzTWFzayhsYXN0UG9zaXRpb24sICEwKSAmJiB0dC5tYXRjaC5kZWYgPT09IHBsYWNlaG9sZGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3UG9zID0gc2Vla05leHQobGFzdFBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGlja1Bvc2l0aW9uID49IG5ld1BvcyB8fCBjbGlja1Bvc2l0aW9uID09PSBsYXN0UG9zaXRpb24pICYmIChsYXN0UG9zaXRpb24gPSBuZXdQb3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmV0KGlucHV0LCBsYXN0UG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGRibGNsaWNrRXZlbnQ6IGZ1bmN0aW9uKGUpIHtcbiAgICAgICAg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gICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXR0ZXIodmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVNldC5jYWxsKHRoaXMsIHZhbHVlKSwgdGhpcy5pbnB1dG1hc2sgJiYgJCh0aGlzKS50cmlnZ2VyKFwic2V0dmFsdWVcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWVHZXQsIHZhbHVlU2V0O1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFucHQuaW5wdXRtYXNrLl9fdmFsdWVHZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoITAgIT09IG9wdHMubm9WYWx1ZVBhdGNoaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImZ1bmN0aW9uXCIgIT0gdHlwZW9mIE9iamVjdC5nZXRQcm90b3R5cGVPZiAmJiAoT2JqZWN0LmdldFByb3RvdHlwZU9mID0gXCJvYmplY3RcIiA9PSB0eXBlb2YgXCJ0ZXN0XCIuX19wcm90b19fID8gZnVuY3Rpb24ob2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdC5fX3Byb3RvX187XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IDogZnVuY3Rpb24ob2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdC5jb25zdHJ1Y3Rvci5wcm90b3R5cGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZVByb3BlcnR5ID0gT2JqZWN0LmdldFByb3RvdHlwZU9mID8gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPYmplY3QuZ2V0UHJvdG90eXBlT2YobnB0KSwgXCJ2YWx1ZVwiKSA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlUHJvcGVydHkgJiYgdmFsdWVQcm9wZXJ0eS5nZXQgJiYgdmFsdWVQcm9wZXJ0eS5zZXQgPyAodmFsdWVHZXQgPSB2YWx1ZVByb3BlcnR5LmdldCwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVNldCA9IHZhbHVlUHJvcGVydHkuc2V0LCBPYmplY3QuZGVmaW5lUHJvcGVydHkobnB0LCBcInZhbHVlXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGdldHRlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IHNldHRlcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6ICEwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkgOiBcIklOUFVUXCIgIT09IG5wdC50YWdOYW1lICYmICh2YWx1ZUdldCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHRDb250ZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdmFsdWVTZXQgPSBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGV4dENvbnRlbnQgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShucHQsIFwidmFsdWVcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldDogZ2V0dGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldDogc2V0dGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogITBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGRvY3VtZW50Ll9fbG9va3VwR2V0dGVyX18gJiYgbnB0Ll9fbG9va3VwR2V0dGVyX18oXCJ2YWx1ZVwiKSAmJiAodmFsdWVHZXQgPSBucHQuX19sb29rdXBHZXR0ZXJfXyhcInZhbHVlXCIpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVTZXQgPSBucHQuX19sb29rdXBTZXR0ZXJfXyhcInZhbHVlXCIpLCBucHQuX19kZWZpbmVHZXR0ZXJfXyhcInZhbHVlXCIsIGdldHRlciksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucHQuX19kZWZpbmVTZXR0ZXJfXyhcInZhbHVlXCIsIHNldHRlcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucHQuaW5wdXRtYXNrLl9fdmFsdWVHZXQgPSB2YWx1ZUdldCwgbnB0LmlucHV0bWFzay5fX3ZhbHVlU2V0ID0gdmFsdWVTZXQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5wdC5pbnB1dG1hc2suX3ZhbHVlR2V0ID0gZnVuY3Rpb24ob3ZlcnJ1bGVSVEwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlzUlRMICYmICEwICE9PSBvdmVycnVsZVJUTCA/IHZhbHVlR2V0LmNhbGwodGhpcy5lbCkuc3BsaXQoXCJcIikucmV2ZXJzZSgpLmpvaW4oXCJcIikgOiB2YWx1ZUdldC5jYWxsKHRoaXMuZWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG5wdC5pbnB1dG1hc2suX3ZhbHVlU2V0ID0gZnVuY3Rpb24odmFsdWUsIG92ZXJydWxlUlRMKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlU2V0LmNhbGwodGhpcy5lbCwgbnVsbCA9PT0gdmFsdWUgfHwgdmFsdWUgPT09IHVuZGVmaW5lZCA/IFwiXCIgOiAhMCAhPT0gb3ZlcnJ1bGVSVEwgJiYgaXNSVEwgPyB2YWx1ZS5zcGxpdChcIlwiKS5yZXZlcnNlKCkuam9pbihcIlwiKSA6IHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB2YWx1ZUdldCA9PT0gdW5kZWZpbmVkICYmICh2YWx1ZUdldCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB2YWx1ZVNldCA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbih0eXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkLnZhbEhvb2tzICYmICgkLnZhbEhvb2tzW3R5cGVdID09PSB1bmRlZmluZWQgfHwgITAgIT09ICQudmFsSG9va3NbdHlwZV0uaW5wdXRtYXNrcGF0Y2gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsaG9va0dldCA9ICQudmFsSG9va3NbdHlwZV0gJiYgJC52YWxIb29rc1t0eXBlXS5nZXQgPyAkLnZhbEhvb2tzW3R5cGVdLmdldCA6IGZ1bmN0aW9uKGVsZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWxlbS52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHZhbGhvb2tTZXQgPSAkLnZhbEhvb2tzW3R5cGVdICYmICQudmFsSG9va3NbdHlwZV0uc2V0ID8gJC52YWxIb29rc1t0eXBlXS5zZXQgOiBmdW5jdGlvbihlbGVtLCB2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbGVtLnZhbHVlID0gdmFsdWUsIGVsZW07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJC52YWxIb29rc1t0eXBlXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uKGVsZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0uaW5wdXRtYXNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5pbnB1dG1hc2sub3B0cy5hdXRvVW5tYXNrKSByZXR1cm4gZWxlbS5pbnB1dG1hc2sudW5tYXNrZWR2YWx1ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHZhbGhvb2tHZXQoZWxlbSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTEgIT09IGdldExhc3RWYWxpZFBvc2l0aW9uKHVuZGVmaW5lZCwgdW5kZWZpbmVkLCBlbGVtLmlucHV0bWFzay5tYXNrc2V0LnZhbGlkUG9zaXRpb25zKSB8fCAhMCAhPT0gb3B0cy5udWxsYWJsZSA/IHJlc3VsdCA6IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbGhvb2tHZXQoZWxlbSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uKGVsZW0sIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQsICRlbGVtID0gJChlbGVtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCA9IHZhbGhvb2tTZXQoZWxlbSwgdmFsdWUpLCBlbGVtLmlucHV0bWFzayAmJiAkZWxlbS50cmlnZ2VyKFwic2V0dmFsdWVcIiksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dG1hc2twYXRjaDogITBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KG5wdC50eXBlKSwgZnVuY3Rpb24obnB0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50UnVsZXIub24obnB0LCBcIm1vdXNlZW50ZXJcIiwgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciAkaW5wdXQgPSAkKHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dG1hc2suX3ZhbHVlR2V0KCkgIT09IGdldEJ1ZmZlcigpLmpvaW4oXCJcIikgJiYgJGlucHV0LnRyaWdnZXIoXCJzZXR2YWx1ZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfShucHQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfShpbnB1dCkgOiBpbnB1dC5pbnB1dG1hc2sgPSB1bmRlZmluZWQsIGlzU3VwcG9ydGVkO1xuICAgICAgICAgICAgICAgIH0oZWxlbSwgb3B0cyk7XG4gICAgICAgICAgICAgICAgaWYgKCExICE9PSBpc1N1cHBvcnRlZCAmJiAoZWwgPSBlbGVtLCAkZWwgPSAkKGVsKSwgbWF4TGVuZ3RoID0gZWwgIT09IHVuZGVmaW5lZCA/IGVsLm1heExlbmd0aCA6IHVuZGVmaW5lZCwgXG4gICAgICAgICAgICAgICAgLTEgPT09IG1heExlbmd0aCAmJiAobWF4TGVuZ3RoID0gdW5kZWZpbmVkKSwgITAgPT09IG9wdHMuY29sb3JNYXNrICYmIGluaXRpYWxpemVDb2xvck1hc2soZWwpLCBcbiAgICAgICAgICAgICAgICBhbmRyb2lkICYmIChlbC5oYXNPd25Qcm9wZXJ0eShcImlucHV0bW9kZVwiKSAmJiAoZWwuaW5wdXRtb2RlID0gb3B0cy5pbnB1dG1vZGUsIGVsLnNldEF0dHJpYnV0ZShcImlucHV0bW9kZVwiLCBvcHRzLmlucHV0bW9kZSkpLCBcbiAgICAgICAgICAgICAgICBcInJ0Zm1cIiA9PT0gb3B0cy5hbmRyb2lkSGFjayAmJiAoITAgIT09IG9wdHMuY29sb3JNYXNrICYmIGluaXRpYWxpemVDb2xvck1hc2soZWwpLCBcbiAgICAgICAgICAgICAgICBlbC50eXBlID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kuam9pbihcIlwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5lYWNoKG1hc2tzZXQubWV0YWRhdGEsIGZ1bmN0aW9uKG5keCwgbXRkdCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobXRkdC5tYXNrID09PSBtYXNrVGFyZ2V0KSByZXR1cm4gbWFza1RhcmdldCA9IG10ZHQsICExO1xuICAgICAgICAgICAgICAgIH0pLCBtYXNrVGFyZ2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG1hc2tzZXQubWV0YWRhdGE7XG4gICAgICAgIH1cbiAgICB9XG4gICAgdmFyIHVhID0gbmF2aWdhdG9yLnVzZXJBZ2VudCwgbW9iaWxlID0gL21vYmlsZS9pLnRlc3QodWEpLCBpZW1vYmlsZSA9IC9pZW1vYmlsZS9pLnRlc3QodWEpLCBpcGhvbmUgPSAvaXBob25lL2kudGVzdCh1YSkgJiYgIWllbW9iaWxlLCBhbmRyb2lkID0gL2FuZHJvaWQvaS50ZXN0KHVhKSAmJiAhaWVtb2JpbGU7XG4gICAgcmV0dXJuIElucHV0bWFzay5wcm90b3R5cGUgPSB7XG4gICAgICAgIGRhdGFBdHRyaWJ1dGU6IFwiZGF0YS1pbnB1dG1hc2tcIixcbiAgICAgICAgZGVmYXVsdHM6IHtcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIl9cIixcbiAgICAgICAgICAgIG9wdGlvbmFsbWFya2VyOiB7XG4gICAgICAgICAgICAgICAgc3RhcnQ6IFwiW1wiLFxuICAgICAgICAgICAgICAgIGVuZDogXCJdXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBxdWFudGlmaWVybWFya2VyOiB7XG4gICAgICAgICAgICAgICAgc3RhcnQ6IFwie1wiLFxuICAgICAgICAgICAgICAgIGVuZDogXCJ9XCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBncm91cG1hcmtlcjoge1xuICAgICAgICAgICAgICAgIHN0YXJ0OiBcIihcIixcbiAgICAgICAgICAgICAgICBlbmQ6IFwiKVwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWx0ZXJuYXRvcm1hcmtlcjogXCJ8XCIsXG4gICAgICAgICAgICBlc2NhcGVDaGFyOiBcIlxcXFxcIixcbiAgICAgICAgICAgIG1hc2s6IG51bGwsXG4gICAgICAgICAgICByZWdleDogbnVsbCxcbiAgICAgICAgICAgIG9uY29tcGxldGU6ICQubm9vcCxcbiAgICAgICAgICAgIG9uaW5jb21wbGV0ZTogJC5ub29wLFxuICAgICAgICAgICAgb25jbGVhcmVkOiAkLm5vb3AsXG4gICAgICAgICAgICByZXBlYXQ6IDAsXG4gICAgICAgICAgICBncmVlZHk6ICEwLFxuICAgICAgICAgICAgYXV0b1VubWFzazogITEsXG4gICAgICAgICAgICByZW1vdmVNYXNrT25TdWJtaXQ6ICExLFxuICAgICAgICAgICAgY2xlYXJNYXNrT25Mb3N0Rm9jdXM6ICEwLFxuICAgICAgICAgICAgaW5zZXJ0TW9kZTogITAsXG4gICAgICAgICAgICBjbGVhckluY29tcGxldGU6ICExLFxuICAgICAgICAgICAgYWxpYXM6IG51bGwsXG4gICAgICAgICAgICBvbktleURvd246ICQubm9vcCxcbiAgICAgICAgICAgIG9uQmVmb3JlTWFzazogbnVsbCxcbiAgICAgICAgICAgIG9uQmVmb3JlUGFzdGU6IGZ1bmN0aW9uKHBhc3RlZFZhbHVlLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICQuaXNGdW5jdGlvbihvcHRzLm9uQmVmb3JlTWFzaykgPyBvcHRzLm9uQmVmb3JlTWFzay5jYWxsKHRoaXMsIHBhc3RlZFZhbHVlLCBvcHRzKSA6IHBhc3RlZFZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9uQmVmb3JlV3JpdGU6IG51bGwsXG4gICAgICAgICAgICBvblVuTWFzazogbnVsbCxcbiAgICAgICAgICAgIHNob3dNYXNrT25Gb2N1czogITAsXG4gICAgICAgICAgICBzaG93TWFza09uSG92ZXI6ICEwLFxuICAgICAgICAgICAgb25LZXlWYWxpZGF0aW9uOiAkLm5vb3AsXG4gICAgICAgICAgICBza2lwT3B0aW9uYWxQYXJ0Q2hhcmFjdGVyOiBcIiBcIixcbiAgICAgICAgICAgIG51bWVyaWNJbnB1dDogITEsXG4gICAgICAgICAgICByaWdodEFsaWduOiAhMSxcbiAgICAgICAgICAgIHVuZG9PbkVzY2FwZTogITAsXG4gICAgICAgICAgICByYWRpeFBvaW50OiBcIlwiLFxuICAgICAgICAgICAgcmFkaXhQb2ludERlZmluaXRpb25TeW1ib2w6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdyb3VwU2VwYXJhdG9yOiBcIlwiLFxuICAgICAgICAgICAga2VlcFN0YXRpYzogbnVsbCxcbiAgICAgICAgICAgIHBvc2l0aW9uQ2FyZXRPblRhYjogITAsXG4gICAgICAgICAgICB0YWJUaHJvdWdoOiAhMSxcbiAgICAgICAgICAgIHN1cHBvcnRzSW5wdXRUeXBlOiBbIFwidGV4dFwiLCBcInRlbFwiLCBcInBhc3N3b3JkXCIgXSxcbiAgICAgICAgICAgIGlnbm9yYWJsZXM6IFsgOCwgOSwgMTMsIDE5LCAyNywgMzMsIDM0LCAzNSwgMzYsIDM3LCAzOCwgMzksIDQwLCA0NSwgNDYsIDkzLCAxMTIsIDExMywgMTE0LCAxMTUsIDExNiwgMTE3LCAxMTgsIDExOSwgMTIwLCAxMjEsIDEyMiwgMTIzLCAwLCAyMjkgXSxcbiAgICAgICAgICAgIGlzQ29tcGxldGU6IG51bGwsXG4gICAgICAgICAgICBjYW5DbGVhclBvc2l0aW9uOiAkLm5vb3AsXG4gICAgICAgICAgICBwcmVWYWxpZGF0aW9uOiBudWxsLFxuICAgICAgICAgICAgcG9zdFZhbGlkYXRpb246IG51bGwsXG4gICAgICAgICAgICBzdGF0aWNEZWZpbml0aW9uU3ltYm9sOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBqaXRNYXNraW5nOiAhMSxcbiAgICAgICAgICAgIG51bGxhYmxlOiAhMCxcbiAgICAgICAgICAgIGlucHV0RXZlbnRPbmx5OiAhMSxcbiAgICAgICAgICAgIG5vVmFsdWVQYXRjaGluZzogITEsXG4gICAgICAgICAgICBwb3NpdGlvbkNhcmV0T25DbGljazogXCJsdnBcIixcbiAgICAgICAgICAgIGNhc2luZzogbnVsbCxcbiAgICAgICAgICAgIGlucHV0bW9kZTogXCJ2ZXJiYXRpbVwiLFxuICAgICAgICAgICAgY29sb3JNYXNrOiAhMSxcbiAgICAgICAgICAgIGFuZHJvaWRIYWNrOiAhMSxcbiAgICAgICAgICAgIGltcG9ydERhdGFBdHRyaWJ1dGVzOiAhMFxuICAgICAgICB9LFxuICAgICAgICBkZWZpbml0aW9uczoge1xuICAgICAgICAgICAgXCI5XCI6IHtcbiAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IFwiWzAtOVxcdWZmMTEtXFx1ZmYxOV1cIixcbiAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMSxcbiAgICAgICAgICAgICAgICBkZWZpbml0aW9uU3ltYm9sOiBcIipcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGE6IHtcbiAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IFwiW0EtWmEtelxcdTA0MTAtXFx1MDQ0ZlxcdTA0MDFcXHUwNDUxXFx4YzAtXFx4ZmZcXHhiNV1cIixcbiAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMSxcbiAgICAgICAgICAgICAgICBkZWZpbml0aW9uU3ltYm9sOiBcIipcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIFwiKlwiOiB7XG4gICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBcIlswLTlcXHVmZjExLVxcdWZmMTlBLVphLXpcXHUwNDEwLVxcdTA0NGZcXHUwNDAxXFx1MDQ1MVxceGMwLVxceGZmXFx4YjVdXCIsXG4gICAgICAgICAgICAg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k7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhdHRyT3B0aW9ucyAmJiBcIlwiICE9PSBhdHRyT3B0aW9ucyAmJiAoYXR0ck9wdGlvbnMgPSBhdHRyT3B0aW9ucy5yZXBsYWNlKG5ldyBSZWdFeHAoXCInXCIsIFwiZ1wiKSwgJ1wiJyksIFxuICAgICAgICAgICAgICAgICAgICBkYXRhb3B0aW9ucyA9IEpTT04ucGFyc2UoXCJ7XCIgKyBhdHRyT3B0aW9ucyArIFwifVwiKSksIGRhdGFvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25EYXRhID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwIGluIGRhdGFvcHRpb25zKSBpZiAoXCJhbGlhc1wiID09PSBwLnRvTG93ZXJDYXNlKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25EYXRhID0gZGF0YW9wdGlvbnNbcF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaW1wb3J0T3B0aW9uKFwiYWxpYXNcIiwgb3B0aW9uRGF0YSksIHVzZXJPcHRpb25zLmFsaWFzICYmIHJlc29sdmVBbGlhcyh1c2VyT3B0aW9ucy5hbGlhcywgdXNlck9wdGlvbnMsIG9wdHMpO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKG9wdGlvbiBpbiBvcHRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YW9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25EYXRhID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAocCBpbiBkYXRhb3B0aW9ucykgaWYgKHAudG9Mb3dlckNhc2UoKSA9PT0gb3B0aW9uLnRvTG93ZXJDYXNlKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uRGF0YSA9IGRhdGFvcHRpb25zW3BdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpbXBvcnRPcHRpb24ob3B0aW9uLCBvcHRpb25EYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gJC5leHRlbmQoITAsIG9wdHMsIHVzZXJPcHRpb25zKSwgKFwicnRsXCIgPT09IG5wdC5kaXIgfHwgb3B0cy5yaWdodEFsaWduKSAmJiAobnB0LnN0eWxlLnRleHRBbGlnbiA9IFwicmlnaHRcIiksIFxuICAgICAgICAgICAgICAgIChcInJ0bFwiID09PSBucHQuZGlyIHx8IG9wdHMubnVtZXJpY0lucHV0KSAmJiAobnB0LmRpciA9IFwibHRyXCIsIG5wdC5yZW1vdmVBdHRyaWJ1dGUoXCJkaXJcIiksIFxuICAgICAgICAgICAgICAgIG9wdHMuaXNSVEwgPSAhMCksIG9wdHM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdGhhdCA9IHRoaXM7XG4gICAgICAgICAgICByZXR1cm4gXCJzdHJpbmdcIiA9PSB0eXBlb2YgZWxlbXMgJiYgKGVsZW1zID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZWxlbXMpIHx8IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoZWxlbXMpKSwgXG4gICAgICAgICAgICBlbGVtcyA9IGVsZW1zLm5vZGVOYW1lID8gWyBlbGVtcyBdIDogZWxlbXMsICQuZWFjaChlbGVtcywgZnVuY3Rpb24obmR4LCBlbCkge1xuICAgICAgICAgICAgICAgIHZhciBzY29wZWRPcHRzID0g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B7XG4gICAgICAgICAgICAgICAgICAgIGFjdGlvbjogXCJtYXNrXCJcbiAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICB9KSwgZWxlbXMgJiYgZWxlbXNbMF0gPyBlbGVtc1swXS5pbnB1dG1hc2sgfHwgdGhpcyA6IHRoaXM7XG4gICAgICAgIH0sXG4gICAgICAgIG9wdGlvbjogZnVuY3Rpb24ob3B0aW9ucywgbm9yZW1hc2spIHtcbiAgICAgICAgICAgIHJldHVybiBcInN0cmluZ1wiID09IHR5cGVvZiBvcHRpb25zID8gdGhpcy5vcHRzW29wdGlvbnNdIDogXCJvYmplY3RcIiA9PSB0eXBlb2Ygb3B0aW9ucyA/ICgkLmV4dGVuZCh0aGlzLnVzZXJPcHRpb25zLCBvcHRpb25zKSwgXG4gICAgICAgICAgICB0aGlzLmVsICYmICEwICE9PSBub3JlbWFzayAmJiB0aGlzLm1hc2sodGhpcy5lbCksIHRoaXMpIDogdm9pZCAwO1xuICAgICAgICB9LFxuICAgICAgICB1bm1hc2tlZHZhbHVlOiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFza3NldCA9IHRoaXMubWFza3NldCB8fCBnZW5lcmF0ZU1hc2tTZXQodGhpcy5vcHRzLCB0aGlzLm5vTWFza3NDYWNoZSksIFxuICAgICAgICAgICAgbWFza1Njb3BlLmNhbGwodGhpcywge1xuICAgICAgICAgICAgICAgIGFjdGlvbjogXCJ1bm1hc2tlZHZhbHVlXCIsXG4gICAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXNrU2NvcGUuY2FsbCh0aGlzLCB7XG4gICAgICAgICAgICAgICAgYWN0aW9uOiBcInJlbW92ZVwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAg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uYWwgPSBpc09wdGlvbmFsIHx8ICExLCB0aGlzLmlzUXVhbnRpZmllciA9IGlzUXVhbnRpZmllciB8fCAhMSwgdGhpcy5pc0FsdGVybmF0b3IgPSBpc0FsdGVybmF0b3IgfHwgITEsIFxuICAgICAgICAgICAgICAgIHRoaXMucXVhbnRpZmllciA9IHtcbiAgICAgICAgICAgICAgICAgICAgbWluOiAxLFxuICAgICAgICAgICAgICAgICAgICBtYXg6IDFcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZnVuY3Rpb24gaW5zZXJ0VGVzdERlZmluaXRpb24obXRva2VuLCBlbGVtZW50LCBwb3NpdGlvbikge1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcG9zaXRpb24gIT09IHVuZGVmaW5lZCA/IHBvc2l0aW9uIDogbXRva2VuLm1hdGNoZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgIHZhciBwcmV2TWF0Y2ggPSBtdG9rZW4ubWF0Y2hlc1twb3NpdGlvbiAtIDFdO1xuICAgICAgICAgICAgICAgIGlmIChyZWdleE1hc2spIDAgPT09IGVsZW1lbnQuaW5kZXhPZihcIltcIikgfHwgZXNjYXBlZCAmJiAvXFxcXGR8XFxcXHN8XFxcXHddL2kudGVzdChlbGVtZW50KSB8fCBcIi5cIiA9PT0gZWxlbWVudCA/IG10b2tlbi5tYXRjaGVzLnNwbGljZShwb3NpdGlvbisrLCAwLCB7XG4gICAgICAgICAgICAgICAgICAgIGZuOiBuZXcgUmVnRXhwKGVsZW1lbnQsIG9wdHMuY2FzaW5nID8gXCJpXCIgOiBcIlwiKSxcbiAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDEsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsaXR5OiBtdG9rZW4uaXNPcHRpb25hbCxcbiAgICAgICAgICAgICAgICAgICAgbmV3QmxvY2tNYXJrZXI6IHByZXZNYXRjaCA9PT0gdW5kZWZpbmVkIHx8IHByZXZNYXRjaC5kZWYgIT09IGVsZW1lbnQsXG4gICAgICAgICAgICAgICAgICAgIGNhc2luZzogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgZGVmOiBlbGVtZW50LFxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWY6IGVsZW1lbnRcbiAgICAgICAgICAgICAgICB9KSA6IChlc2NhcGVkICYmIChlbGVtZW50ID0gZWxlbWVudFtlbGVtZW50Lmxlbmd0aCAtIDFdKSwgJC5lYWNoKGVsZW1lbnQuc3BsaXQoXCJcIiksIGZ1bmN0aW9uKG5keCwgbG1udCkge1xuICAgICAgICAgICAgICAgICAgICBwcmV2TWF0Y2ggPSBtdG9rZW4ubWF0Y2hlc1twb3NpdGlvbiAtIDFdLCBtdG9rZW4ubWF0Y2hlcy5zcGxpY2UocG9zaXRpb24rKywgMCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgZm46IG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsaXR5OiBtdG9rZW4uaXNPcHRpb25hbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0Jsb2NrTWFya2VyOiBwcmV2TWF0Y2ggPT09IHVuZGVmaW5lZCB8fCBwcmV2TWF0Y2guZGVmICE9PSBsbW50ICYmIG51bGwgIT09IHByZXZNYXRjaC5mbixcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2luZzogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZjogb3B0cy5zdGF0aWNEZWZpbml0aW9uU3ltYm9sIHx8IGxtbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogb3B0cy5zdGF0aWNEZWZpbml0aW9uU3ltYm9sICE9PSB1bmRlZmluZWQgPyBsbW50IDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlRGVmOiBsbW50XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pKSwgZXNjYXBlZCA9ICExOyBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1hc2tkZWYgPSAob3B0cy5kZWZpbml0aW9ucyA/IG9wdHMuZGVmaW5pdGlvbnNbZWxlbWVudF0gOiB1bmRlZmluZWQpIHx8IElucHV0bWFzay5wcm90b3R5cGUuZGVmaW5pdGlvbnNbZWxlbWVudF07XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXNrZGVmICYmICFlc2NhcGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBwcmV2YWxpZGF0b3JzID0gbWFza2RlZi5wcmV2YWxpZGF0b3IsIHByZXZhbGlkYXRvcnNMID0gcHJldmFsaWRhdG9ycyA/IHByZXZhbGlkYXRvcnMubGVuZ3RoIDogMCwgaSA9IDE7IGkgPCBtYXNrZGVmLmNhcmRpbmFsaXR5OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJldmFsaWRhdG9yID0gcHJldmFsaWRhdG9yc0wgPj0gaSA/IHByZXZhbGlkYXRvcnNbaSAtIDFdIDogW10sIHZhbGlkYXRvciA9IHByZXZhbGlkYXRvci52YWxpZGF0b3IsIGNhcmRpbmFsaXR5ID0gcHJldmFsaWRhdG9yLmNhcmRpbmFsaXR5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10b2tlbi5tYXRjaGVzLnNwbGljZShwb3NpdGlvbisrLCAwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZuOiB2YWxpZGF0b3IgPyBcInN0cmluZ1wiID09IHR5cGVvZiB2YWxpZGF0b3IgPyBuZXcgUmVnRXhwKHZhbGlkYXRvciwgb3B0cy5jYXNpbmcgPyBcImlcIiA6IFwiXCIpIDogbmV3IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50ZXN0ID0gdmFsaWRhdG9yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KCkgOiBuZXcgUmVnRXhwKFwiLlwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IGNhcmRpbmFsaXR5IHx8IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsaXR5OiBtdG9rZW4uaXNPcHRpb25hbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3QmxvY2tNYXJrZXI6IHByZXZNYXRjaCA9PT0gdW5kZWZpbmVkIHx8IHByZXZNYXRjaC5kZWYgIT09IChtYXNrZGVmLmRlZmluaXRpb25TeW1ib2wgfHwgZWxlbWVudCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2luZzogbWFza2RlZi5jYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZjogbWFza2RlZi5kZWZpbml0aW9uU3ltYm9sIHx8IGVsZW1lbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBtYXNrZGVmLnBsYWNlaG9sZGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWY6IGVsZW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSwgcHJldk1hdGNoID0gbXRva2VuLm1hdGNoZXNbcG9zaXRpb24gLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIG10b2tlbi5tYXRjaGVzLnNwbGljZShwb3NpdGlvbisrLCAwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm46IG1hc2tkZWYudmFsaWRhdG9yID8gXCJzdHJpbmdcIiA9PSB0eXBlb2YgbWFza2RlZi52YWxpZGF0b3IgPyBuZXcgUmVnRXhwKG1hc2tkZWYudmFsaWRhdG9yLCBvcHRzLmNhc2luZyA/IFwiaVwiIDogXCJcIikgOiBuZXcgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGVzdCA9IG1hc2tkZWYudmFsaWRhdG9yO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0oKSA6IG5ldyBSZWdFeHAoXCIuXCIpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiBtYXNrZGVmLmNhcmRpbmFsaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbmFsaXR5OiBtdG9rZW4uaXNPcHRpb25hbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdCbG9ja01hcmtlcjogcHJldk1hdGNoID09PSB1bmRlZmluZWQgfHwgcHJldk1hdGNoLmRlZiAhPT0gKG1hc2tkZWYuZGVmaW5pdGlvblN5bWJvbCB8fCBlbGVtZW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNpbmc6IG1hc2tkZWYuY2FzaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZjogbWFza2RlZi5kZWZpbml0aW9uU3ltYm9sIHx8IGVsZW1lbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI6IG1hc2tkZWYucGxhY2Vob2xkZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlRGVmOiBlbGVtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIG10b2tlbi5tYXRjaGVzLnNwbGljZShwb3NpdGlvbisrLCAwLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmbjogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uYWxpdHk6IG10b2tlbi5pc09wdGlvbmFsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3QmxvY2tNYXJrZXI6IHByZXZNYXRjaCA9PT0gdW5kZWZpbmVkIHx8IHByZXZNYXRjaC5kZWYgIT09IGVsZW1lbnQgJiYgbnVsbCAhPT0gcHJldk1hdGNoLmZuLFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzaW5nOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmOiBvcHRzLnN0YXRpY0RlZmluaXRpb25TeW1ib2wgfHwgZWxlbWVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBvcHRzLnN0YXRpY0RlZmluaXRpb25TeW1ib2wgIT09IHVuZGVmaW5lZCA/IGVsZW1lbnQgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVEZWY6IGVsZW1lbnRcbiAgICAgICAgICAgICAgICAgICAgfSksIGVzY2FwZWQgPSAhMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiB2ZXJpZnlHcm91cE1hcmtlcihtYXNrVG9rZW4pIHtcbiAgICAgICAgICAgICAgICBtYXNrVG9rZW4gJiYgbWFza1Rva2VuLm1hdGNoZXMgJiYgJC5lYWNoKG1hc2tUb2tlbi5tYXRjaGVzLCBmdW5jdGlvbihuZHgsIHRva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXh0VG9rZW4gPSBtYXNrVG9rZW4ubWF0Y2hlc1tuZHggKyAxXTtcbiAgICAgICAgICAgICAgICAgICAgKG5leHRUb2tlbiA9PT0gdW5kZWZpbmVkIHx8IG5leHRUb2tlbi5tYXRjaGVzID09PSB1bmRlZmluZWQgfHwgITEgPT09IG5leHRUb2tlbi5pc1F1YW50aWZpZXIpICYmIHRva2VuICYmIHR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ndGggLSAxXSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50T3BlbmluZ1Rva2VuLm1hdGNoZXMucHVzaChhbHRlcm5hdG9yKSkgOiBjdXJyZW50VG9rZW4ubWF0Y2hlcy5wdXNoKGFsdGVybmF0b3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGluc2VydFRlc3REZWZpbml0aW9uKGN1cnJlbnRUb2tlbiwgbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmdW5jdGlvbiByZXZlcnNlVG9rZW5zKG1hc2tUb2tlbikge1xuICAgICAgICAgICAgICAgIG1hc2tUb2tlbi5tYXRjaGVzID0gbWFza1Rva2VuLm1hdGNoZXMucmV2ZXJzZSgpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIG1hdGNoIGluIG1hc2tUb2tlbi5tYXRjaGVzKSBpZiAobWFza1Rva2VuLm1hdGNoZXMuaGFzT3duUHJvcGVydHkobWF0Y2gpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRNYXRjaCA9IHBhcnNlSW50KG1hdGNoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hc2tUb2tlbi5tYXRjaGVzW21hdGNoXS5pc1F1YW50aWZpZXIgJiYgbWFza1Rva2VuLm1hdGNoZXNbaW50TWF0Y2ggKyAxXSAmJiBtYXNrVG9rZW4ubWF0Y2hlc1tpbnRNYXRjaCArIDFdLmlzR3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBxdCA9IG1hc2tUb2tlbi5tYXRjaGVzW21hdGNoXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hc2tUb2tlbi5tYXRjaGVzLnNwbGljZShtYXRjaCwgMSksIG1hc2tUb2tlbi5tYXRjaGVzLnNwbGljZShpbnRNYXRjaCArIDEsIDAsIHF0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBtYXN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XFNcXHNdPykqXT98XFxcXCg/OjAoPzpbMC0zXVswLTddezAsMn18WzQtN11bMC03XT8pP3xbMS05XVswLTldKnx4WzAtOUEtRmEtZl17Mn18dVswLTlBLUZhLWZdezR9fGNbQS1aYS16XXxbXFxTXFxzXT8pfFxcKCg/OlxcP1s6PSFdPyk/fCg/Ols/KitdfFxce1swLTldKyg/OixbMC05XSopP1xcfSlcXD8/fFteLj8qK14ke1soKXxcXFxcXSt8Li9nLCBlc2NhcGVkID0gITEsIGN1cnJlbnRUb2tlbiA9IG5ldyBNYXNrVG9rZW4oKSwgb3BlbmVuaW5ncyA9IFtdLCBtYXNrVG9rZW5zID0gW107XG4gICAgICAgICAgICBmb3IgKHJlZ2V4TWFzayAmJiAob3B0cy5vcHRpb25hbG1hcmtlci5zdGFydCA9IHVuZGVmaW5lZCwgb3B0cy5vcHRpb25hbG1hcmtlci5lbmQgPSB1bmRlZmluZWQpOyBtYXRjaCA9IHJlZ2V4TWFzayA/IHJlZ2V4VG9rZW5pemVyLmV4ZWMobWFzaykgOiB0b2tlbml6ZXIuZXhlYyhtYXNrKTsgKSB7XG4gICAgICAgICAgICAgICAgaWYgKG0gPSBtYXRjaFswXSwgcmVnZXhNYXNrKSBzd2l0Y2ggKG0uY2hhckF0KDApKSB7XG4gICAgICAgICAgICAgICAgICBjYXNlIFwiP1wiOlxuICAgICAgICAgICAgICAgICAgICBtID0gXCJ7MCwxfVwiO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgY2FzZSBcIitcIjpcbiAgICAgICAgICAgICAgICAgIGNhc2UgXCIqXCI6XG4gICAgICAgICAgICAgICAgICAgIG0gPSBcIntcIiArIG0gKyBcIn1cIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGVzY2FwZWQpIGRlZmF1bHRDYXNlKCk7IGVsc2Ugc3dpdGNoIChtLmNoYXJBdCgwKSkge1xuICAgICAgICAgICAgICAgICAgY2FzZSBvcHRzLmVzY2FwZUNoYXI6XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZWQgPSAhMCwgcmVnZXhNYXNrICYmIGRlZmF1bHRDYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICBjYXNlIG9wdHMub3B0aW9uYWxtYXJrZXIuZW5kOlxuICAgICAgICAgICAgICAgICAgY2FzZSBvcHRzLmdyb3VwbWFya2VyLmVuZDpcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wZW5pbmdUb2tlbiA9IG9wZW5lbmluZ3MucG9wKCksIG9wZW5pbmdUb2tlbi5vcGVuR3JvdXAgPSAhMSwgb3BlbmluZ1Rva2VuICE9PSB1bmRlZmluZWQpIGlmIChvcGVuZW5pbmdzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50T3BlbmluZ1Rva2VuID0gb3BlbmVuaW5nc1tvcGVuZW5pbmdzLmxlbmd0aCAtIDFdLCBjdXJyZW50T3BlbmluZ1Rva2VuLm1hdGNoZXMucHVzaChvcGVuaW5nVG9rZW4pLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRPcGVuaW5nVG9rZW4uaXNBbHRlcm5hdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWx0ZXJuYXRvciA9IG9wZW5lbmluZ3MucG9wKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgbW5keCA9IDA7IG1uZHggPCBhbHRlcm5hdG9yLm1hdGNoZXMubGVuZ3RoOyBtbmR4KyspIGFsdGVybmF0b3IubWF0Y2hlc1ttbmR4XS5pc0dyb3VwID0gITEsIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGVybmF0b3IubWF0Y2hlc1ttbmR4XS5hbHRlcm5hdG9yR3JvdXAgPSAhMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuZW5pbmdzLmxlbmd0aCA+IDAgPyAoY3VycmVudE9wZW5pbmdUb2tlbiA9IG9wZW5lbmluZ3Nbb3BlbmVuaW5ncy5sZW5ndGggLSAxXSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE9wZW5pbmdUb2tlbi5tYXRjaGVzLnB1c2goYWx0ZXJuYXRvcikpIDogY3VycmVudFRva2VuLm1hdGNoZXMucHVzaChhbHRlcm5hdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGN1cnJlbnRUb2tlbi5tYXRjaGVzLnB1c2gob3BlbmluZ1Rva2VuKTsgZWxzZSBkZWZhdWx0Q2FzZSgpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgY2FzZSBvcHRzLm9wdGlvbmFsbWFya2VyLnN0YXJ0OlxuICAgICAgICAgICAgICAgICAgICBvcGVuZW5pbmdzLnB1c2gobmV3IE1hc2tUb2tlbighMSwgITApKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgIGNhc2Ugb3B0cy5ncm91cG1hcmtlci5zdGFydDpcbiAgICAgICAgICAgICAgICAgICAgb3BlbmVuaW5ncy5wdXNoKG5ldyBNYXNrVG9rZW4oITApKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgIGNhc2Ugb3B0cy5xdWFudGlmaWVybWFya2VyLnN0YXJ0OlxuICAgICAgICAgICAgICAgICAgICB2YXIgcXVhbnRpZmllciA9IG5ldyBNYXNrVG9rZW4oITEsICExLCAhMCk7XG4gICAgICAgICAgICAgICAgICAgIG0gPSBtLnJlcGxhY2UoL1t7fV0vZywgXCJcIik7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtcSA9IG0uc3BsaXQoXCIsXCIpLCBtcTAgPSBpc05hTihtcVswXSkgPyBtcVswXSA6IH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x0ZXJuYXRvcikgb3BlbmVuaW5ncy5wdXNoKGxhc3RNYXRjaCk7IGVsc2UgaWYgKGxhc3RNYXRjaC5hbHRlcm5hdG9yR3JvdXAgPyAoYWx0ZXJuYXRvciA9IG9wZW5lbmluZ3MucG9wKCksIFxuICAgICAgICAgICAgICAgICAgICBsYXN0TWF0Y2guYWx0ZXJuYXRvckdyb3VwID0gITEpIDogYWx0ZXJuYXRvciA9IG5ldyBNYXNrVG9rZW4oITEsICExLCAhMSwgITApLCBhbHRlcm5hdG9yLm1hdGNoZXMucHVzaChsYXN0TWF0Y2gpLCBcbiAgICAgICAgICAgICAgICAgICAgb3BlbmVuaW5ncy5wdXNoKGFsdGVybmF0b3IpLCBsYXN0TWF0Y2gub3Blbkdyb3VwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0TWF0Y2gub3Blbkdyb3VwID0gITE7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWx0ZXJuYXRvckdyb3VwID0gbmV3IE1hc2tUb2tlbighMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbHRlcm5hdG9yR3JvdXAuYWx0ZXJuYXRvckdyb3VwID0gITAsIG9wZW5lbmluZ3MucHVzaChhbHRlcm5hdG9yR3JvdXApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Q2FzZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoO29wZW5lbmluZ3MubGVuZ3RoID4gMDsgKSBvcGVuaW5nVG9rZW4gPSBvcGVuZW5pbmdzLnBvcCgpLCBjdXJyZW50VG9rZW4ubWF0Y2hlcy5wdXNoKG9wZW5pbmdUb2tlbik7XG4gICAgICAgICAgICByZXR1cm4gY3VycmVudFRva2VuLm1hdGNoZXMubGVuZ3RoID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FU0NBUEU6IDI3LFxuICAgICAgICBIT01FOiAzNixcbiAgICAgICAgSU5TRVJUOiA0NSxcbiAgICAgICAgTEVGVDogMzcsXG4gICAgICAgIE1FTlU6IDkzLFxuICAgICAgICBOVU1QQURfQUREOiAxMDcsXG4gICAgICAgIE5VTVBBRF9ERUNJTUFMOiAxMTAsXG4gICAgICAgIE5VTVBBRF9ESVZJREU6IDExMSxcbiAgICAgICAgTlVNUEFEX0VOVEVSOiAxMDgsXG4gICAgICAgIE5VTVBBRF9NVUxUSVBMWTogMTA2LFxuICAgICAgICBOVU1QQURfU1VCVFJBQ1Q6IDEwOSxcbiAgICAgICAgUEFHRV9ET1dOOiAzNCxcbiAgICAgICAgUEFHRV9VUDogMzMsXG4gICAgICAgIFBFUklPRDogMTkwLFxuICAgICAgICBSSUdIVDogMzksXG4gICAgICAgIFNISUZUOiAxNixcbiAgICAgICAgU1BBQ0U6IDMyLFxuICAgICAgICBUQUI6IDksXG4gICAgICAgIFVQOiAzOCxcbiAgICAgICAgV0lORE9XUzogOTEsXG4gICAgICAgIFg6IDg4XG4gICAgfSwgSW5wdXRtYXNrO1xufSk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwic291cmNlUm9vdCI6IiJ9\\n//# sourceURL=webpack-internal:///1\\n\");\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* global/window.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\\n return window;\\n}.call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports && (module.exports = window);\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2dsb2JhbC93aW5kb3cuanM/YTUyZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsQ0FBQztBQUFBIiwiZmlsZSI6IjIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiFcbiogZ2xvYmFsL3dpbmRvdy5qc1xuKiBodHRwczovL2dpdGh1Yi5jb20vUm9iaW5IZXJib3RzL0lucHV0bWFza1xuKiBDb3B5cmlnaHQgKGMpIDIwMTAgLSAyMDE3IFJvYmluIEhlcmJvdHNcbiogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlIChodHRwOi8vd3d3Lm9wZW5zb3VyY2Uub3JnL2xpY2Vuc2VzL21pdC1saWNlbnNlLnBocClcbiogVmVyc2lvbjogMy4zLjhcbiovXG5cblwiZnVuY3Rpb25cIiA9PSB0eXBlb2YgZGVmaW5lICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIHdpbmRvdztcbn0pIDogXCJvYmplY3RcIiA9PSB0eXBlb2YgZXhwb3J0cyAmJiAobW9kdWxlLmV4cG9ydHMgPSB3aW5kb3cpO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2lucHV0bWFzay9kaXN0L2lucHV0bWFzay9nbG9iYWwvd2luZG93LmpzXG4vLyBtb2R1bGUgaWQgPSAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0=\\n//# sourceURL=webpack-internal:///2\\n\");\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* global/document.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\\n return document;\\n}.call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports && (module.exports = document);\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2dsb2JhbC9kb2N1bWVudC5qcz80ZGY3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxDQUFDO0FBQUEiLCJmaWxlIjoiMy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIVxuKiBnbG9iYWwvZG9jdW1lbnQuanNcbiogaHR0cHM6Ly9naXRodWIuY29tL1JvYmluSGVyYm90cy9JbnB1dG1hc2tcbiogQ29weXJpZ2h0IChjKSAyMDEwIC0gMjAxNyBSb2JpbiBIZXJib3RzXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBNSVQgbGljZW5zZSAoaHR0cDovL3d3dy5vcGVuc291cmNlLm9yZy9saWNlbnNlcy9taXQtbGljZW5zZS5waHApXG4qIFZlcnNpb246IDMuMy44XG4qL1xuXG5cImZ1bmN0aW9uXCIgPT0gdHlwZW9mIGRlZmluZSAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiBkb2N1bWVudDtcbn0pIDogXCJvYmplY3RcIiA9PSB0eXBlb2YgZXhwb3J0cyAmJiAobW9kdWxlLmV4cG9ydHMgPSBkb2N1bWVudCk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2dsb2JhbC9kb2N1bWVudC5qc1xuLy8gbW9kdWxlIGlkID0gM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwic291cmNlUm9vdCI6IiJ9\\n//# sourceURL=webpack-internal:///3\\n\");\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\neval(\"Object.defineProperty(__webpack_exports__, \\\"__esModule\\\", { value: true });\\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_inputmask__ = __webpack_require__(5);\\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_inputmask___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_inputmask__);\\n/*\\n * vue-inputmask\\n *\\n * (C) 2016 Simon Clériot\\n * MIT LICENCE\\n *\\n */\\n\\n\\nvar inputmaskPlugin = {\\n install: function (Vue, options) {\\n Vue.directive('mask', {\\n bind: function (el, binding) {\\n __WEBPACK_IMPORTED_MODULE_0_inputmask___default()(binding.value).mask(el);\\n }\\n });\\n }\\n};\\n\\nexports.default = inputmaskPlugin;\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndl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FzayhlbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbn07XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGlucHV0bWFza1BsdWdpblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL3NyYy92dWUtaW5wdXRtYXNrLmpzIl0sInNvdXJjZVJvb3QiOiIifQ==\\n//# sourceURL=webpack-internal:///4\\n\");\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"__webpack_require__(6);\\r\\n__webpack_require__(7);\\r\\n__webpack_require__(8);\\r\\n__webpack_require__(9);\\r\\n\\r\\n// require(\\\"./dist/inputmask/phone-codes/phone-be\\\");\\r\\n// require(\\\"./dist/inputmask/phone-codes/phone-nl\\\");\\r\\n// require(\\\"./dist/inputmask/phone-codes/phone-ru\\\");\\r\\n// require(\\\"./dist/inputmask/phone-codes/phone-uk\\\");\\r\\n// require(\\\"./dist/inputmask/phone-codes/phone\\\");\\r\\n\\r\\nmodule.exports = __webpack_require__(1);\\r\\n\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2luZGV4LmpzP2VlNjIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiI1LmpzIiwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZShcIi4vZGlzdC9pbnB1dG1hc2svaW5wdXRtYXNrLmRhdGUuZXh0ZW5zaW9uc1wiKTtcclxucmVxdWlyZShcIi4vZGlzdC9pbnB1dG1hc2svaW5wdXRtYXNrLmV4dGVuc2lvbnNcIik7XHJcbnJlcXVpcmUoXCIuL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5udW1lcmljLmV4dGVuc2lvbnNcIik7XHJcbnJlcXVpcmUoXCIuL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5waG9uZS5leHRlbnNpb25zXCIpO1xyXG5cclxuLy8gcmVxdWlyZShcIi4vZGlzdC9pbnB1dG1hc2svcGhvbmUtY29kZXMvcGhvbmUtYmVcIik7XHJcbi8vIHJlcXVpcmUoXCIuL2Rpc3QvaW5wdXRtYXNrL3Bob25lLWNvZGVzL3Bob25lLW5sXCIpO1xyXG4vLyByZXF1aXJlKFwiLi9kaXN0L2lucHV0bWFzay9waG9uZS1jb2Rlcy9waG9uZS1ydVwiKTtcclxuLy8gcmVxdWlyZShcIi4vZGlzdC9pbnB1dG1hc2svcGhvbmUtY29kZXMvcGhvbmUtdWtcIik7XHJcbi8vIHJlcXVpcmUoXCIuL2Rpc3QvaW5wdXRtYXNrL3Bob25lLWNvZGVzL3Bob25lXCIpO1xyXG5cclxubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKFwiLi9kaXN0L2lucHV0bWFzay9pbnB1dG1hc2suanNcIik7XHJcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2lucHV0bWFzay9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwic291cmNlUm9vdCI6IiJ9\\n//# sourceURL=webpack-internal:///5\\n\");\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* inputmask.date.extensions.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"./dependencyLibs/inputmask.dependencyLib\\\"), require(\\\"./inputmask\\\")) : factory(window.dependencyLib || jQuery, window.Inputmask);\\n}(function($, Inputmask) {\\n function isLeapYear(year) {\\n return isNaN(year) || 29 === new Date(year, 2, 0).getDate();\\n }\\n return Inputmask.extendAliases({\\n \\\"dd/mm/yyyy\\\": {\\n mask: \\\"1/2/y\\\",\\n placeholder: \\\"dd/mm/yyyy\\\",\\n regex: {\\n val1pre: new RegExp(\\\"[0-3]\\\"),\\n val1: new RegExp(\\\"0[1-9]|[12][0-9]|3[01]\\\"),\\n val2pre: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|[12][0-9]|3[01])\\\" + escapedSeparator + \\\"[01])\\\");\\n },\\n val2: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|[12][0-9])\\\" + escapedSeparator + \\\"(0[1-9]|1[012]))|(30\\\" + escapedSeparator + \\\"(0[13-9]|1[012]))|(31\\\" + escapedSeparator + \\\"(0[13578]|1[02]))\\\");\\n }\\n },\\n leapday: \\\"29/02/\\\",\\n separator: \\\"/\\\",\\n yearrange: {\\n minyear: 1900,\\n maxyear: 2099\\n },\\n isInYearRange: function(chrs, minyear, maxyear) {\\n if (isNaN(chrs)) return !1;\\n var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))), enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));\\n return !isNaN(enteredyear) && (minyear <= enteredyear && enteredyear <= maxyear) || !isNaN(enteredyear2) && (minyear <= enteredyear2 && enteredyear2 <= maxyear);\\n },\\n determinebaseyear: function(minyear, maxyear, hint) {\\n var currentyear = new Date().getFullYear();\\n if (minyear > currentyear) return minyear;\\n if (maxyear < currentyear) {\\n for (var maxYearPrefix = maxyear.toString().slice(0, 2), maxYearPostfix = maxyear.toString().slice(2, 4); maxyear < maxYearPrefix + hint; ) maxYearPrefix--;\\n var maxxYear = maxYearPrefix + maxYearPostfix;\\n return minyear > maxxYear ? minyear : maxxYear;\\n }\\n if (minyear <= currentyear && currentyear <= maxyear) {\\n for (var currentYearPrefix = currentyear.toString().slice(0, 2); maxyear < currentYearPrefix + hint; ) currentYearPrefix--;\\n var currentYearAndHint = currentYearPrefix + hint;\\n return currentYearAndHint < minyear ? minyear : currentYearAndHint;\\n }\\n return currentyear;\\n },\\n onKeyDown: function(e, buffer, caretPos, opts) {\\n var $input = $(this);\\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\\n var today = new Date();\\n $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()), \\n $input.trigger(\\\"setvalue\\\");\\n }\\n },\\n getFrontValue: function(mask, buffer, opts) {\\n for (var start = 0, length = 0, i = 0; i < mask.length && \\\"2\\\" !== mask.charAt(i); i++) {\\n var definition = opts.definitions[mask.charAt(i)];\\n definition ? (start += length, length = definition.cardinality) : length++;\\n }\\n return buffer.join(\\\"\\\").substr(start, length);\\n },\\n postValidation: function(buffer, currentResult, opts) {\\n var dayMonthValue, year, bufferStr = buffer.join(\\\"\\\");\\n return 0 === opts.mask.indexOf(\\\"y\\\") ? (year = bufferStr.substr(0, 4), dayMonthValue = bufferStr.substring(4, 10)) : (year = bufferStr.substring(6, 10), \\n dayMonthValue = bufferStr.substr(0, 6)), currentResult && (dayMonthValue !== opts.leapday || isLeapYear(year));\\n },\\n definitions: {\\n \\\"1\\\": {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n if (\\\"3\\\" == chrs.charAt(0)) {\\n if (new RegExp(\\\"[2-9]\\\").test(chrs.charAt(1))) return chrs = \\\"30\\\", maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n };\\n }\\n var isValid = opts.regex.val1.test(chrs);\\n return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === \\\"-./\\\".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val1.test(\\\"0\\\" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = \\\"0\\\", \\n {\\n refreshFromBuffer: {\\n start: pos - 1,\\n end: pos\\n },\\n pos: pos,\\n c: chrs.charAt(0)\\n });\\n },\\n cardinality: 2,\\n prevalidator: [ {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var pchrs = chrs;\\n isNaN(maskset.buffer[pos + 1]) || (pchrs += maskset.buffer[pos + 1]);\\n var isValid = 1 === pchrs.length ? opts.regex.val1pre.test(pchrs) : opts.regex.val1.test(pchrs);\\n if (!strict && !isValid) {\\n if (isValid = opts.regex.val1.test(chrs + \\\"0\\\")) return maskset.buffer[pos] = chrs, \\n maskset.buffer[++pos] = \\\"0\\\", {\\n pos: pos,\\n c: \\\"0\\\"\\n };\\n if (isValid = opts.regex.val1.test(\\\"0\\\" + chrs)) return maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n };\\n }\\n return isValid;\\n },\\n cardinality: 1\\n } ]\\n },\\n \\\"2\\\": {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);\\n if (-1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = \\\"01\\\" + opts.separator), \\n \\\"1\\\" == chrs.charAt(0)) {\\n if (new RegExp(\\\"[3-9]\\\").test(chrs.charAt(1))) return chrs = \\\"10\\\", maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n };\\n }\\n var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);\\n return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === \\\"-./\\\".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val2(opts.separator).test(frontValue + \\\"0\\\" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = \\\"0\\\", \\n {\\n refreshFromBuffer: {\\n start: pos - 1,\\n end: pos\\n },\\n pos: pos,\\n c: chrs.charAt(0)\\n });\\n },\\n cardinality: 2,\\n prevalidator: [ {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n isNaN(maskset.buffer[pos + 1]) || (chrs += maskset.buffer[pos + 1]);\\n var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);\\n -1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = \\\"01\\\" + opts.separator);\\n var isValid = 1 === chrs.length ? opts.regex.val2pre(opts.separator).test(frontValue + chrs) : opts.regex.val2(opts.separator).test(frontValue + chrs);\\n return strict || isValid || !(isValid = opts.regex.val2(opts.separator).test(frontValue + \\\"0\\\" + chrs)) ? isValid : (maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n });\\n },\\n cardinality: 1\\n } ]\\n },\\n y: {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);\\n },\\n cardinality: 4,\\n prevalidator: [ {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);\\n if (!strict && !isValid) {\\n var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + \\\"0\\\").toString().slice(0, 1);\\n if (isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0), \\n {\\n pos: pos\\n };\\n if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + \\\"0\\\").toString().slice(0, 2), \\n isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0), \\n maskset.buffer[pos++] = yearPrefix.charAt(1), {\\n pos: pos\\n };\\n }\\n return isValid;\\n },\\n cardinality: 1\\n }, {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);\\n if (!strict && !isValid) {\\n var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);\\n if (isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(1), \\n {\\n pos: pos\\n };\\n if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2), \\n isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos - 1] = yearPrefix.charAt(0), \\n maskset.buffer[pos++] = yearPrefix.charAt(1), maskset.buffer[pos++] = chrs.charAt(0), \\n {\\n refreshFromBuffer: {\\n start: pos - 3,\\n end: pos\\n },\\n pos: pos\\n };\\n }\\n return isValid;\\n },\\n cardinality: 2\\n }, {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);\\n },\\n cardinality: 3\\n } ]\\n }\\n },\\n insertMode: !1,\\n autoUnmask: !1\\n },\\n \\\"mm/dd/yyyy\\\": {\\n placeholder: \\\"mm/dd/yyyy\\\",\\n alias: \\\"dd/mm/yyyy\\\",\\n regex: {\\n val2pre: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[13-9]|1[012])\\\" + escapedSeparator + \\\"[0-3])|(02\\\" + escapedSeparator + \\\"[0-2])\\\");\\n },\\n val2: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|1[012])\\\" + escapedSeparator + \\\"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])\\\" + escapedSeparator + \\\"30)|((0[13578]|1[02])\\\" + escapedSeparator + \\\"31)\\\");\\n },\\n val1pre: new RegExp(\\\"[01]\\\"),\\n val1: new RegExp(\\\"0[1-9]|1[012]\\\")\\n },\\n leapday: \\\"02/29/\\\",\\n onKeyDown: function(e, buffer, caretPos, opts) {\\n var $input = $(this);\\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\\n var today = new Date();\\n $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()), \\n $input.trigger(\\\"setvalue\\\");\\n }\\n }\\n },\\n \\\"yyyy/mm/dd\\\": {\\n mask: \\\"y/1/2\\\",\\n placeholder: \\\"yyyy/mm/dd\\\",\\n alias: \\\"mm/dd/yyyy\\\",\\n leapday: \\\"/02/29\\\",\\n onKeyDown: function(e, buffer, caretPos, opts) {\\n var $input = $(this);\\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\\n var today = new Date();\\n $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()), \\n $input.trigger(\\\"setvalue\\\");\\n }\\n }\\n },\\n \\\"dd.mm.yyyy\\\": {\\n mask: \\\"1.2.y\\\",\\n placeholder: \\\"dd.mm.yyyy\\\",\\n leapday: \\\"29.02.\\\",\\n separator: \\\".\\\",\\n alias: \\\"dd/mm/yyyy\\\"\\n },\\n \\\"dd-mm-yyyy\\\": {\\n mask: \\\"1-2-y\\\",\\n placeholder: \\\"dd-mm-yyyy\\\",\\n leapday: \\\"29-02-\\\",\\n separator: \\\"-\\\",\\n alias: \\\"dd/mm/yyyy\\\"\\n },\\n \\\"mm.dd.yyyy\\\": {\\n mask: \\\"1.2.y\\\",\\n placeholder: \\\"mm.dd.yyyy\\\",\\n leapday: \\\"02.29.\\\",\\n separator: \\\".\\\",\\n alias: \\\"mm/dd/yyyy\\\"\\n },\\n \\\"mm-dd-yyyy\\\": {\\n mask: \\\"1-2-y\\\",\\n placeholder: \\\"mm-dd-yyyy\\\",\\n leapday: \\\"02-29-\\\",\\n separator: \\\"-\\\",\\n alias: \\\"mm/dd/yyyy\\\"\\n },\\n \\\"yyyy.mm.dd\\\": {\\n mask: \\\"y.1.2\\\",\\n placeholder: \\\"yyyy.mm.dd\\\",\\n leapday: \\\".02.29\\\",\\n separator: \\\".\\\",\\n alias: \\\"yyyy/mm/dd\\\"\\n },\\n \\\"yyyy-mm-dd\\\": {\\n mask: \\\"y-1-2\\\",\\n placeholder: \\\"yyyy-mm-dd\\\",\\n leapday: \\\"-02-29\\\",\\n separator: \\\"-\\\",\\n alias: \\\"yyyy/mm/dd\\\"\\n },\\n datetime: {\\n mask: \\\"1/2/y h:s\\\",\\n placeholder: \\\"dd/mm/yyyy hh:mm\\\",\\n alias: \\\"dd/mm/yyyy\\\",\\n regex: {\\n hrspre: new RegExp(\\\"[012]\\\"),\\n hrs24: new RegExp(\\\"2[0-4]|1[3-9]\\\"),\\n hrs: new RegExp(\\\"[01][0-9]|2[0-4]\\\"),\\n ampm: new RegExp(\\\"^[a|p|A|P][m|M]\\\"),\\n mspre: new RegExp(\\\"[0-5]\\\"),\\n ms: new RegExp(\\\"[0-5][0-9]\\\")\\n },\\n timeseparator: \\\":\\\",\\n hourFormat: \\\"24\\\",\\n definitions: {\\n h: {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n if (\\\"24\\\" === opts.hourFormat && 24 === parseInt(chrs, 10)) return maskset.buffer[pos - 1] = \\\"0\\\", \\n maskset.buffer[pos] = \\\"0\\\", {\\n refreshFromBuffer: {\\n start: pos - 1,\\n end: pos\\n },\\n c: \\\"0\\\"\\n };\\n var isValid = opts.regex.hrs.test(chrs);\\n if (!strict && !isValid && (chrs.charAt(1) === opts.timeseparator || -1 !== \\\"-.:\\\".indexOf(chrs.charAt(1))) && (isValid = opts.regex.hrs.test(\\\"0\\\" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = \\\"0\\\", \\n maskset.buffer[pos] = chrs.charAt(0), pos++, {\\n refreshFromBuffer: {\\n start: pos - 2,\\n end: pos\\n },\\n pos: pos,\\n c: opts.timeseparator\\n };\\n if (isValid && \\\"24\\\" !== opts.hourFormat && opts.regex.hrs24.test(chrs)) {\\n var tmp = parseInt(chrs, 10);\\n return 24 === tmp ? (maskset.buffer[pos + 5] = \\\"a\\\", maskset.buffer[pos + 6] = \\\"m\\\") : (maskset.buffer[pos + 5] = \\\"p\\\", \\n maskset.buffer[pos + 6] = \\\"m\\\"), tmp -= 12, tmp < 10 ? (maskset.buffer[pos] = tmp.toString(), \\n maskset.buffer[pos - 1] = \\\"0\\\") : (maskset.buffer[pos] = tmp.toString().charAt(1), \\n maskset.buffer[pos - 1] = tmp.toString().charAt(0)), {\\n refreshFromBuffer: {\\n start: pos - 1,\\n end: pos + 6\\n },\\n c: maskset.buffer[pos]\\n };\\n }\\n return isValid;\\n },\\n cardinality: 2,\\n prevalidator: [ {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var isValid = opts.regex.hrspre.test(chrs);\\n return strict || isValid || !(isValid = opts.regex.hrs.test(\\\"0\\\" + chrs)) ? isValid : (maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n });\\n },\\n cardinality: 1\\n } ]\\n },\\n s: {\\n validator: \\\"[0-5][0-9]\\\",\\n cardinality: 2,\\n prevalidator: [ {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var isValid = opts.regex.mspre.test(chrs);\\n return strict || isValid || !(isValid = opts.regex.ms.test(\\\"0\\\" + chrs)) ? isValid : (maskset.buffer[pos] = \\\"0\\\", \\n pos++, {\\n pos: pos\\n });\\n },\\n cardinality: 1\\n } ]\\n },\\n t: {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return opts.regex.ampm.test(chrs + \\\"m\\\");\\n },\\n casing: \\\"lower\\\",\\n cardinality: 1\\n }\\n },\\n insertMode: !1,\\n autoUnmask: !1\\n },\\n datetime12: {\\n mask: \\\"1/2/y h:s t\\\\\\\\m\\\",\\n placeholder: \\\"dd/mm/yyyy hh:mm xm\\\",\\n alias: \\\"datetime\\\",\\n hourFormat: \\\"12\\\"\\n },\\n \\\"mm/dd/yyyy hh:mm xm\\\": {\\n mask: \\\"1/2/y h:s t\\\\\\\\m\\\",\\n placeholder: \\\"mm/dd/yyyy hh:mm xm\\\",\\n alias: \\\"datetime12\\\",\\n regex: {\\n val2pre: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[13-9]|1[012])\\\" + escapedSeparator + \\\"[0-3])|(02\\\" + escapedSeparator + \\\"[0-2])\\\");\\n },\\n val2: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|1[012])\\\" + escapedSeparator + \\\"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])\\\" + escapedSeparator + \\\"30)|((0[13578]|1[02])\\\" + escapedSeparator + \\\"31)\\\");\\n },\\n val1pre: new RegExp(\\\"[01]\\\"),\\n val1: new RegExp(\\\"0[1-9]|1[012]\\\")\\n },\\n leapday: \\\"02/29/\\\",\\n onKeyDown: function(e, buffer, caretPos, opts) {\\n var $input = $(this);\\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\\n var today = new Date();\\n $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()), \\n $input.trigger(\\\"setvalue\\\");\\n }\\n }\\n },\\n \\\"hh:mm t\\\": {\\n mask: \\\"h:s t\\\\\\\\m\\\",\\n placeholder: \\\"hh:mm xm\\\",\\n alias: \\\"datetime\\\",\\n hourFormat: \\\"12\\\"\\n },\\n \\\"h:s t\\\": {\\n mask: \\\"h:s t\\\\\\\\m\\\",\\n placeholder: \\\"hh:mm xm\\\",\\n alias: \\\"datetime\\\",\\n hourFormat: \\\"12\\\"\\n },\\n \\\"hh:mm:ss\\\": {\\n mask: \\\"h:s:s\\\",\\n placeholder: \\\"hh:mm:ss\\\",\\n alias: \\\"datetime\\\",\\n autoUnmask: !1\\n },\\n \\\"hh:mm\\\": {\\n mask: \\\"h:s\\\",\\n placeholder: \\\"hh:mm\\\",\\n alias: \\\"datetime\\\",\\n autoUnmask: !1\\n },\\n date: {\\n alias: \\\"dd/mm/yyyy\\\"\\n },\\n \\\"mm/yyyy\\\": {\\n mask: \\\"1/y\\\",\\n placeholder: \\\"mm/yyyy\\\",\\n leapday: \\\"donotuse\\\",\\n separator: \\\"/\\\",\\n alias: \\\"mm/dd/yyyy\\\"\\n },\\n shamsi: {\\n regex: {\\n val2pre: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|1[012])\\\" + escapedSeparator + \\\"[0-3])\\\");\\n },\\n val2: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|1[012])\\\" + escapedSeparator + \\\"(0[1-9]|[12][0-9]))|((0[1-9]|1[012])\\\" + escapedSeparator + \\\"30)|((0[1-6])\\\" + escapedSeparator + \\\"31)\\\");\\n },\\n val1pre: new RegExp(\\\"[01]\\\"),\\n val1: new RegExp(\\\"0[1-9]|1[012]\\\")\\n },\\n yearrange: {\\n minyear: 1300,\\n maxyear: 1499\\n },\\n mask: \\\"y/1/2\\\",\\n leapday: \\\"/12/30\\\",\\n placeholder: \\\"yyyy/mm/dd\\\",\\n alias: \\\"mm/dd/yyyy\\\",\\n clearIncomplete: !0\\n },\\n \\\"yyyy-mm-dd hh:mm:ss\\\": {\\n mask: \\\"y-1-2 h:s:s\\\",\\n placeholder: \\\"yyyy-mm-dd hh:mm:ss\\\",\\n alias: \\\"datetime\\\",\\n separator: \\\"-\\\",\\n leapday: \\\"-02-29\\\",\\n regex: {\\n val2pre: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[13-9]|1[012])\\\" + escapedSeparator + \\\"[0-3])|(02\\\" + escapedSeparator + \\\"[0-2])\\\");\\n },\\n val2: function(separator) {\\n var escapedSeparator = Inputmask.escapeRegex.call(this, separator);\\n return new RegExp(\\\"((0[1-9]|1[012])\\\" + escapedSeparator + \\\"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])\\\" + escapedSeparator + \\\"30)|((0[13578]|1[02])\\\" + escapedSeparator + \\\"31)\\\");\\n },\\n val1pre: new RegExp(\\\"[01]\\\"),\\n val1: new RegExp(\\\"0[1-9]|1[012]\\\")\\n },\\n onKeyDown: function(e, buffer, caretPos, opts) {}\\n }\\n }), Inputmask;\\n});\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5kYXRlLmV4dGVuc2lvbnMuanM/ZTgyNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQ0EsQ0FBQztBQUNEO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsYUFBYTtBQUNiO0FBQ0E7QUFDQTtBQUNBO0FBQ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AgICAgICAgICAgICAgdmFsMTogbmV3IFJlZ0V4cChcIjBbMS05XXxbMTJdWzAtOV18M1swMV1cIiksXG4gICAgICAgICAgICAgICAgdmFsMnByZTogZnVuY3Rpb24oc2VwYXJhdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBlc2NhcGVkU2VwYXJhdG9yID0gSW5wdXRtYXNrLmVzY2FwZVJlZ2V4LmNhbGwodGhpcywgc2VwYXJhdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBSZWdFeHAoXCIoKDBbMS05XXxbMTJdWzAtOV18M1swMV0pXCIgKyBlc2NhcGVkU2VwYXJhdG9yICsgXCJbMDFdKVwiKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHZhbDI6IGZ1bmN0aW9uKHNlcGFyYXRvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXNjYXBlZFNlcGFyYXRvciA9IElucHV0bWFzay5lc2NhcGVSZWdleC5jYWxsKHRoaXMsIHNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKFwiKCgwWzEtOV18WzEyXVswLTldKVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiKDBbMS05XXwxWzAxMl0pKXwoMzBcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIigwWzEzLTldfDFbMDEyXSkpfCgzMVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiKDBbMTM1NzhdfDFbMDJdKSlcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxlYXBkYXk6IFwiMjkvMDIvXCIsXG4gICAgICAgICAgICBzZXBhcmF0b3I6IFwiL1wiLFxuICAgICAgICAgICAgeWVhcnJhbmdlOiB7XG4gICAgICAgICAgICAgICAgbWlueWVhcjogMTkwMCxcbiAgICAgICAgICAgICAgICBtYXh5ZWFyOiAyMDk5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNJblllYXJSYW5nZTogZnVuY3Rpb24oY2hycywgbWlueWVhciwgbWF4eWVhcikge1xuICAgICAgICAgICAgICAgIGlmIChpc05hTihjaHJzKSkgcmV0dXJuICExO1xuICAgICAgICAgICAgICAgIHZhciBlbnRlcmVkeWVhciA9IHBhcnNlSW50KGNocnMuY29uY2F0KG1pbnllYXIudG9TdHJpbmcoKS5zbGljZShjaHJzLmxlbmd0aCkpKSwgZW50ZXJlZHllYXIyID0gcGFyc2VJbnQoY2hycy5jb25jYXQobWF4eWVhci50b1N0cmluZygpLnNsaWNlKGNocnMubGVuZ3RoKSkpO1xuICAgICAgICAgICAgICAgIHJldHVybiAhaXNOYU4oZW50ZXJlZHllYXIpICYmIChtaW55ZWFyIDw9IGVudGVyZWR5ZWFyICYmIGVudGVyZWR5ZWFyIDw9IG1heHllYXIpIHx8ICFpc05hTihlbnRlcmVkeWVhcjIpICYmIChtaW55ZWFyIDw9IGVudGVyZWR5ZWFyMiAmJiBlbnRlcmVkeWVhcjIgPD0gbWF4eWVhcik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGV0ZXJtaW5lYmFzZXllYXI6IGZ1bmN0aW9uKG1pbnllYXIsIG1heHllYXIsIGhpbnQpIHtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudHllYXIgPSBuZXcgRGF0ZSgpLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICAgICAgaWYgKG1pbnllYXIgPiBjdXJyZW50eWVhcikgcmV0dXJuIG1pbnllYXI7XG4gICAgICAgICAgICAgICAgaWYgKG1heHllYXIgPCBjdXJyZW50eWVhcikge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBtYXhZZWFyUHJlZml4ID0gbWF4eWVhci50b1N0cmluZygpLnNsaWNlKDAsIDIpLCBtYXhZZWFyUG9zdGZpeCA9IG1heHllYXIudG9TdHJpbmcoKS5zbGljZSgyLCA0KTsgbWF4eWVhciA8IG1heFllYXJQcmVmaXggKyBoaW50OyApIG1heFllYXJQcmVmaXgtLTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1heHhZZWFyID0gbWF4WWVhclByZWZpeCArIG1heFllYXJQb3N0Zml4O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWlueWVhciA+IG1heHhZZWFyID8gbWlueWVhciA6IG1heHhZZWFyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobWlueWVhciA8PSBjdXJyZW50eWVhciAmJiBjdXJyZW50eWVhciA8PSBtYXh5ZWFyKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGN1cnJlbnRZZWFyUHJlZml4ID0gY3VycmVudHllYXIudG9TdHJpbmcoKS5zbGljZSgwLCAyKTsgbWF4eWVhciA8IGN1cnJlbnRZZWFyUHJlZml4ICsgaGludDsgKSBjdXJyZW50WWVhclByZWZpeC0tO1xuICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudFllYXJBbmRIaW50ID0gY3VycmVudFllYXJQcmVmaXggKyBoaW50O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3VycmVudFllYXJBbmRIaW50IDwgbWlueWVhciA/IG1pbnllYXIgOiBjdXJyZW50WWVhckFuZEhpbnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50eWVhcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvbktleURvd246IGZ1bmN0aW9uKGUsIGJ1ZmZlciwgY2FyZXRQb3MsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgJGlucHV0ID0gJCh0aGlzKTtcbiAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5ICYmIGUua2V5Q29kZSA9PT0gSW5wdXRtYXNrLmtleUNvZGUuUklHSFQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRvZGF5ID0gbmV3IERhdGUoKTtcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnZhbCh0b2RheS5nZXREYXRlKCkudG9TdHJpbmcoKSArICh0b2RheS5nZXRNb250aCgpICsgMSkudG9TdHJpbmcoKSArIHRvZGF5LmdldEZ1bGxZZWFyKCkudG9TdHJpbmcoKSksIFxuICAgICAgICAgICAgICAgICAgICAkaW5wdXQudHJpZ2dlcihcInNldHZhbHVlXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRGcm9udFZhbHVlOiBmdW5jdGlvbihtYXNrLCBidWZmZXIsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBzdGFydCA9IDAsIGxlbmd0aCA9IDAsIGkgPSAwOyBpIDwgbWFzay5sZW5ndGggJiYgXCIyXCIgIT09IG1hc2suY2hhckF0KGkpOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmluaXRpb24gPSBvcHRzLmRlZmluaXRpb25zW21hc2suY2hhckF0KGkpXTtcbiAgICAgICAgICAgICAgICAgICAgZGVmaW5pdGlvbiA/IChzdGFydCArPSBsZW5ndGgsIGxlbmd0aCA9IGRlZmluaXRpb24uY2FyZGluYWxpdHkpIDogbGVuZ3RoKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBidWZmZXIuam9pbihcIlwiKS5zdWJzdHIoc3RhcnQsIGxlbmd0aCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcG9zdFZhbGlkYXRpb246IGZ1bmN0aW9uKGJ1ZmZlciwgY3VycmVudFJlc3VsdCwgb3B0cykge1xuICAgICAgICAgICAgICAgIHZhciBkYXlNb250aFZhbHVlLCB5ZWFyLCBidWZmZXJTdHIgPSBidWZmZXIuam9pbihcIlwiKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gMCA9PT0gb3B0cy5tYXNrLmluZGV4T2YoXCJ5XCIpID8gKHllYXIgPSBidWZmZXJTdHIuc3Vic3RyKDAsIDQpLCBkYXlNb250aFZhbHVlID0gYnVmZmVyU3RyLnN1YnN0cmluZyg0LCAxMCkpIDogKHllYXIgPSBidWZmZXJTdHIuc3Vic3RyaW5nKDYsIDEwKSwgXG4gICAgICAgICAgICAgICAgZGF5TW9udGhWYWx1ZSA9IGJ1ZmZlclN0ci5zdWJzdHIoMCwgNikpLCBjdXJyZW50UmVzdWx0ICYmIChkYXlNb250aFZhbHVlICE9PSBvcHRzLmxlYXBkYXkgfHwgaXNMZWFwWWVhcih5ZWFyKSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVmaW5pdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBcIjFcIjoge1xuICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IGZ1bmN0aW9uKGNocnMsIG1hc2tzZXQsIHBvcywgc3RyaWN0LCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXCIzXCIgPT0gY2hycy5jaGFyQXQoMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3IFJlZ0V4cChcIlsyLTldXCIpLnRlc3QoY2hycy5jaGFyQXQoMSkpKSByZXR1cm4gY2hycyA9IFwiMzBcIiwgbWFza3NldC5idWZmZXJbcG9zXSA9IFwiMFwiLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3MrKywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3M6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNWYWxpZCA9IG9wdHMucmVnZXgudmFsMS50ZXN0KGNocnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmljdCB8fCBpc1ZhbGlkIHx8IGNocnMuY2hhckF0KDEpICE9PSBvcHRzLnNlcGFyYXRvciAmJiAtMSA9PT0gXCItLi9cIi5pbmRleE9mKGNocnMuY2hhckF0KDEpKSB8fCAhKGlzVmFsaWQgPSBvcHRzLnJlZ2V4LnZhbDEudGVzdChcIjBcIiArIGNocnMuY2hhckF0KDApKSkgPyBpc1ZhbGlkIDogKG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hGcm9tQnVmZmVyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBwb3MgLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogY2hycy5jaGFyQXQoMClcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMixcbiAgICAgICAgICAgICAgICAgICAgcHJldmFsaWRhdG9yOiBbIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogZnVuY3Rpb24oY2hycywgbWFza3NldCwgcG9zLCBzdHJpY3QsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGNocnMgPSBjaHJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTmFOKG1hc2tzZXQuYnVmZmVyW3BvcyArIDFdKSB8fCAocGNocnMgKz0gbWFza3NldC5idWZmZXJbcG9zICsgMV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1ZhbGlkID0gMSA9PT0gcGNocnMubGVuZ3RoID8gb3B0cy5yZWdleC52YWwxcHJlLnRlc3QocGNocnMpIDogb3B0cy5yZWdleC52YWwxLnRlc3QocGNocnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RyaWN0ICYmICFpc1ZhbGlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1ZhbGlkID0gb3B0cy5yZWdleC52YWwxLnRlc3QoY2hycyArIFwiMFwiKSkgcmV0dXJuIG1hc2tzZXQuYnVmZmVyW3Bvc10gPSBjaHJzLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFza3NldC5idWZmZXJbKytwb3NdID0gXCIwXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvczogcG9zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogXCIwXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzVmFsaWQgPSBvcHRzLnJlZ2V4LnZhbDEudGVzdChcIjBcIiArIGNocnMpKSByZXR1cm4gbWFza3NldC5idWZmZXJbcG9zXSA9IFwiMFwiLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zKyssIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvczogcG9zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpc1ZhbGlkO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxXG4gICAgICAgICAgICAgICAgICAgIH0gXVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCIyXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb250VmFsdWUgPSBvcHRzLmdldEZyb250VmFsdWUobWFza3NldC5tYXNrLCBtYXNrc2V0LmJ1ZmZlciwgb3B0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoLTEgIT09IGZyb250VmFsdWUuaW5kZXhPZihvcHRzLnBsYWNlaG9sZGVyWzBdKSAmJiAoZnJvbnRWYWx1ZSA9IFwiMDFcIiArIG9wdHMuc2VwYXJhdG9yKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBcIjFcIiA9PSBjaHJzLmNoYXJBdCgwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXcgUmVnRXhwKFwiWzMtOV1cIikudGVzdChjaHJzLmNoYXJBdCgxKSkpIHJldHVybiBjaHJzID0gXCIxMFwiLCBtYXNrc2V0LmJ1ZmZlcltwb3NdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcysrLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvczogcG9zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1ZhbGlkID0gb3B0cy5yZWdleC52YWwyKG9wdHMuc2VwYXJhdG9yKS50ZXN0KGZyb250VmFsdWUgKyBjaHJzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpY3QgfHwgaXNWYWxpZCB8fCBjaHJzLmNoYXJBdCgxKSAhPT0gb3B0cy5zZXBhcmF0b3IgJiYgLTEgPT09IFwiLS4vXCIuaW5kZXhPZihjaHJzLmNoYXJBdCgxKSkgfHwgIShpc1ZhbGlkID0gb3B0cy5yZWdleC52YWwyKG9wdHMuc2VwYXJhdG9yKS50ZXN0KGZyb250VmFsdWUgKyBcIjBcIiArIGNocnMuY2hhckF0KDApKSkgPyBpc1ZhbGlkIDogKG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hGcm9tQnVmZmVyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBwb3MgLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogY2hycy5jaGFyQXQoMClcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMixcbiAgICAgICAgICAgICAgICAgICAgcHJldmFsaWRhdG9yOiBbIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogZnVuY3Rpb24oY2hycywgbWFza3NldCwgcG9zLCBzdHJpY3QsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc05hTihtYXNrc2V0LmJ1ZmZlcltwb3MgKyAxXSkgfHwgKGNocnMgKz0gbWFza3NldC5idWZmZXJbcG9zICsgMV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9udFZhbHVlID0gb3B0cy5nZXRGcm9udFZhbHVlKG1hc2tzZXQubWFzaywgbWFza3NldC5idWZmZXIsIG9wdHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xICE9PSBmcm9udFZhbHVlLmluZGV4T2Yob3B0cy5wbGFjZWhvbGRlclswXSkgJiYgKGZyb250VmFsdWUgPSBcIjAxXCIgKyBvcHRzLnNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzVmFsaWQgPSAxID09PSBjaHJzLmxlbmd0aCA/IG9wdHMucmVnZXgudmFsMnByZShvcHRzLnNlcGFyYXRvcikudGVzdChmcm9udFZhbHVlICsgY2hycykgOiBvcHRzLnJlZ2V4LnZhbDIob3B0cy5zZXBhcmF0b3IpLnRlc3QoZnJvbnRWYWx1ZSArIGNocnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpY3QgfHwgaXNWYWxpZCB8fCAhKGlzVmFsaWQgPSBvcHRzLnJlZ2V4LnZhbDIob3B0cy5zZXBhcmF0b3IpLnRlc3QoZnJvbnRWYWx1ZSArIFwiMFwiICsgY2hycykpID8gaXNWYWxpZCA6IChtYXNrc2V0LmJ1ZmZlcltwb3NdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcysrLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvczogcG9zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDFcbiAgICAgICAgICAgICAgICAgICAgfSBdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB5OiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogZnVuY3Rpb24oY2hycywgbWFza3NldCwgcG9zLCBzdHJpY3QsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcHRzLmlzSW5ZZWFyUmFuZ2UoY2hycywgb3B0cy55ZWFycmFuZ2UubWlueWVhciwgb3B0cy55ZWFycmFuZ2UubWF4eWVhcik7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiA0LFxuICAgICAgICAgICAgICAgICAgICBwcmV2YWxpZGF0b3I6IFsge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1ZhbGlkID0gb3B0cy5pc0luWWVhclJhbmdlKGNocnMsIG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RyaWN0ICYmICFpc1ZhbGlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5ZWFyUHJlZml4ID0gb3B0cy5kZXRlcm1pbmViYXNleWVhcihvcHRzLnllYXJyYW5nZS5taW55ZWFyLCBvcHRzLnllYXJyYW5nZS5tYXh5ZWFyLCBjaHJzICsgXCIwXCIpLnRvU3RyaW5nKCkuc2xpY2UoMCwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1ZhbGlkID0gb3B0cy5pc0luWWVhclJhbmdlKHllYXJQcmVmaXggKyBjaHJzLCBvcHRzLnllYXJyYW5nZS5taW55ZWFyLCBvcHRzLnllYXJyYW5nZS5tYXh5ZWFyKSkgcmV0dXJuIG1hc2tzZXQuYnVmZmVyW3BvcysrXSA9IHllYXJQcmVmaXguY2hhckF0KDApLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHllYXJQcmVmaXggPSBvcHRzLmRldGVybWluZWJhc2V5ZWFyKG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIsIGNocnMgKyBcIjBcIikudG9TdHJpbmcoKS5zbGljZSgwLCAyKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQgPSBvcHRzLmlzSW5ZZWFyUmFuZ2UoeWVhclByZWZpeCArIGNocnMsIG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIpKSByZXR1cm4gbWFza3NldC5idWZmZXJbcG9zKytdID0geWVhclByZWZpeC5jaGFyQXQoMCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXNrc2V0LmJ1ZmZlcltwb3MrK10gPSB5ZWFyUHJlZml4LmNoYXJBdCgxKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlzVmFsaWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDFcbiAgICAgICAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1ZhbGlkID0gb3B0cy5pc0luWWVhclJhbmdlKGNocnMsIG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RyaWN0ICYmICFpc1ZhbGlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5ZWFyUHJlZml4ID0gb3B0cy5kZXRlcm1pbmViYXNleWVhcihvcHRzLnllYXJyYW5nZS5taW55ZWFyLCBvcHRzLnllYXJyYW5nZS5tYXh5ZWFyLCBjaHJzKS50b1N0cmluZygpLnNsaWNlKDAsIDIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNWYWxpZCA9IG9wdHMuaXNJblllYXJSYW5nZShjaHJzWzBdICsgeWVhclByZWZpeFsxXSArIGNocnNbMV0sIG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIpKSByZXR1cm4gbWFza3NldC5idWZmZXJbcG9zKytdID0geWVhclByZWZpeC5jaGFyQXQoMSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3M6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeWVhclByZWZpeCA9IG9wdHMuZGV0ZXJtaW5lYmFzZXllYXIob3B0cy55ZWFycmFuZ2UubWlueWVhciwgb3B0cy55ZWFycmFuZ2UubWF4eWVhciwgY2hycykudG9TdHJpbmcoKS5zbGljZSgwLCAyKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQgPSBvcHRzLmlzSW5ZZWFyUmFuZ2UoeWVhclByZWZpeCArIGNocnMsIG9wdHMueWVhcnJhbmdlLm1pbnllYXIsIG9wdHMueWVhcnJhbmdlLm1heHllYXIpKSByZXR1cm4gbWFza3NldC5idWZmZXJbcG9zIC0gMV0gPSB5ZWFyUHJlZml4LmNoYXJBdCgwKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hc2tzZXQuYnVmZmVyW3BvcysrXSA9IHllYXJQcmVmaXguY2hhckF0KDEpLCBtYXNrc2V0LmJ1ZmZlcltwb3MrK10gPSBjaHJzLmNoYXJBdCgwKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hGcm9tQnVmZmVyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IHBvcyAtIDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kOiBwb3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3M6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNWYWxpZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMlxuICAgICAgICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IGZ1bmN0aW9uKGNocnMsIG1hc2tzZXQsIHBvcywgc3RyaWN0LCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdHMuaXNJblllYXJSYW5nZShjaHJzLCBvcHRzLnllYXJyYW5nZS5taW55ZWFyLCBvcHRzLnllYXJyYW5nZS5tYXh5ZWFyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogM1xuICAgICAgICAgICAgICAgICAgICB9IF1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW5zZXJ0TW9kZTogITEsXG4gICAgICAgICAgICBhdXRvVW5tYXNrOiAhMVxuICAgICAgICB9LFxuICAgICAgICBcIm1tL2RkL3l5eXlcIjoge1xuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwibW0vZGQveXl5eVwiLFxuICAgICAgICAgICAgYWxpYXM6IFwiZGQvbW0veXl5eVwiLFxuICAgICAgICAgICAgcmVnZXg6IHtcbiAgICAgICAgICAgICAgICB2YWwycHJlOiBmdW5jdGlvbihzZXBhcmF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVzY2FwZWRTZXBhcmF0b3IgPSBJbnB1dG1hc2suZXNjYXBlUmVnZXguY2FsbCh0aGlzLCBzZXBhcmF0b3IpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFJlZ0V4cChcIigoMFsxMy05XXwxWzAxMl0pXCIgKyBlc2NhcGVkU2VwYXJhdG9yICsgXCJbMC0zXSl8KDAyXCIgKyBlc2NhcGVkU2VwYXJhdG9yICsgXCJbMC0yXSlcIik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB2YWwyOiBmdW5jdGlvbihzZXBhcmF0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVzY2FwZWRTZXBhcmF0b3IgPSBJbnB1dG1hc2suZXNjYXBlUmVnZXguY2FsbCh0aGlzLCBzZXBhcmF0b3IpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFJlZ0V4cChcIigoMFsxLTldfDFbMDEyXSlcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIigwWzEtOV18WzEyXVswLTldKSl8KCgwWzEzLTldfDFbMDEyXSlcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIjMwKXwoKDBbMTM1NzhdfDFbMDJdKVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiMzEpXCIpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdmFsMXByZTogbmV3IFJlZ0V4cChcIlswMV1cIiksXG4gICAgICAgICAgICAgICAgdmFsMTogbmV3IFJlZ0V4cChcIjBbMS05XXwxWzAxMl1cIilcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsZWFwZGF5OiBcIjAyLzI5L1wiLFxuICAgICAgICAgICAgb25LZXlEb3duOiBmdW5jdGlvbihlLCBidWZmZXIsIGNhcmV0UG9zLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgdmFyICRpbnB1dCA9ICQodGhpcyk7XG4gICAgICAgICAgICAgICAgaWYgKGUuY3RybEtleSAmJiBlLmtleUNvZGUgPT09IElucHV0bWFzay5rZXlDb2RlLlJJR0hUKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0b2RheSA9IG5ldyBEYXRlKCk7XG4gICAgICAgICAgICAgICAgICAgICRpbnB1dC52YWwoKHRvZGF5LmdldE1vbnRoKCkgKyAxKS50b1N0cmluZygpICsgdG9kYXkuZ2V0RGF0ZSgpLnRvU3RyaW5nKCkgKyB0b2RheS5nZXRGdWxsWWVhcigpLnRvU3RyaW5nKCkpLCBcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnRyaWdnZXIoXCJzZXR2YWx1ZVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwieXl5eS9tbS9kZFwiOiB7XG4gICAgICAgICAgICBtYXNrOiBcInkvMS8yXCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJ5eXl5L21tL2RkXCIsXG4gICAgICAgICAgICBhbGlhczogXCJtbS9kZC95eXl5XCIsXG4gICAgICAgICAgICBsZWFwZGF5OiBcIi8wMi8yOVwiLFxuICAgICAgICAgICAgb25LZXlEb3duOiBmdW5jdGlvbihlLCBidWZmZXIsIGNhcmV0UG9zLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgdmFyICRpbnB1dCA9ICQodGhpcyk7XG4gICAgICAgICAgICAgICAgaWYgKGUuY3RybEtleSAmJiBlLmtleUNvZGUgPT09IElucHV0bWFzay5rZXlDb2RlLlJJR0hUKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0b2RheSA9IG5ldyBEYXRlKCk7XG4gICAgICAgICAgICAgICAgICAgICRpbnB1dC52YWwodG9kYXkuZ2V0RnVsbFllYXIoKS50b1N0cmluZygpICsgKHRvZGF5LmdldE1vbnRoKCkgKyAxKS50b1N0cmluZygpICsgdG9kYXkuZ2V0RGF0ZSgpLnRvU3RyaW5nKCkpLCBcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnRyaWdnZXIoXCJzZXR2YWx1ZVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIFwiZGQubW0ueXl5eVwiOiB7XG4gICAgICAgICAgICBtYXNrOiBcIjEuMi55XCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJkZC5tbS55eXl5XCIsXG4gICAgICAgICAgICBsZWFwZGF5OiBcIjI5LjAyLlwiLFxuICAgICAgICAgICAgc2VwYXJhdG9yOiBcIi5cIixcbiAgICAgICAgICAgIGFsaWFzOiBcImRkL21tL3l5eXlcIlxuICAgICAgICB9LFxuICAgICAgICBcImRkLW1tLXl5eXlcIjoge1xuICAgICAgICAgICAgbWFzazogXCIxLTIteVwiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwiZGQtbW0teXl5eVwiLFxuICAgICAgICAgICAgbGVhcGRheTogXCIyOS0wMi1cIixcbiAgICAgICAgICAgIHNlcGFyYXRvcjogXCItXCIsXG4gICAgICAgICAgICBhbGlhczogXCJkZC9tbS95eXl5XCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJtbS5kZC55eXl5XCI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiMS4yLnlcIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIm1tLmRkLnl5eXlcIixcbiAgICAgICAgICAgIGxlYXBkYXk6IFwiMDIuMjkuXCIsXG4gICAgICAgICAgICBzZXBhcmF0b3I6IFwiLlwiLFxuICAgICAgICAgICAgYWxpYXM6IFwibW0vZGQveXl5eVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibW0tZGQteXl5eVwiOiB7XG4gICAgICAgICAgICBtYXNrOiBcIjEtMi15XCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJtbS1kZC15eXl5XCIsXG4gICAgICAgICAgICBsZWFwZGF5OiBcIjAyLTI5LVwiLFxuICAgICAgICAgICAgc2VwYXJhdG9yOiBcIi1cIixcbiAgICAgICAgICAgIGFsaWFzOiBcIm1tL2RkL3l5eXlcIlxuICAgICAgICB9LFxuICAgICAgICBcInl5eXkubW0uZGRcIjoge1xuICAgICAgICAgICAgbWFzazogXCJ5LjEuMlwiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwieXl5eS5tbS5kZFwiLFxuICAgICAgICAgICAgbGVhcGRheTogXCIuMDIuMjlcIixcbiAgICAgICAgICAgIHNlcGFyYXRvcjogXCIuXCIsXG4gICAgICAgICAgICBhbGlhczogXCJ5eXl5L21tL2RkXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJ5eXl5LW1tLWRkXCI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwieS0xLTJcIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcInl5eXktbW0tZGRcIixcbiAgICAgICAgICAgIGxlYXBkYXk6IFwiLTAyLTI5XCIsXG4gICAgICAgICAgICBzZXBhcmF0b3I6IFwiLVwiLFxuICAgICAgICAgICAgYWxpYXM6IFwieXl5eS9tbS9kZFwiXG4gICAgICAgIH0sXG4gICAgICAgIGRhdGV0aW1lOiB7XG4gICAgICAgICAgICBtYXNrOiBcIjEvMi95IGg6c1wiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwiZGQvbW0veXl5eSBoaDptbVwiLFxuICAgICAgICAgICAgYWxpYXM6IFwiZGQvbW0veXl5eVwiLFxuICAgICAgICAgICAgcmVnZXg6IHtcbiAgICAgICAgICAgICAgICBocnNwcmU6IG5ldyBSZWdFeHAoXCJbMDEyXVwiKSxcbiAgICAgICAgICAgICAgICBocnMyNDogbmV3IFJlZ0V4cChcIjJbMC00XXwxWzMtOV1cIiksXG4gICAgICAgICAgICAgICAgaHJzOiBuZXcgUmVnRXhwKFwiWzAxXVswLTldfDJbMC00XVwiKSxcbiAgICAgICAgICAgICAgICBhbXBtOiBuZXcgUmVnRXhwKFwiXlthfHB8QXxQXVttfE1dXCIpLFxuICAgICAgICAgICAgICAgIG1zcHJlOiBuZXcgUmVnRXhwKFwiWzAtNV1cIiksXG4gICAgICAgICAgICAgICAgbXM6IG5ldyBSZWdFeHAoXCJbMC01XVswLTldXCIpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdGltZXNlcGFyYXRvcjogXCI6XCIsXG4gICAgICAgICAgICBob3VyRm9ybWF0OiBcIjI0XCIsXG4gICAgICAgICAgICBkZWZpbml0aW9uczoge1xuICAgICAgICAgICAgICAgIGg6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFwiMjRcIiA9PT0gb3B0cy5ob3VyRm9ybWF0ICYmIDI0ID09PSBwYXJzZUludChjaHJzLCAxMCkpIHJldHVybiBtYXNrc2V0LmJ1ZmZlcltwb3MgLSAxXSA9IFwiMFwiLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hc2tzZXQuYnVmZmVyW3Bvc10gPSBcIjBcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hGcm9tQnVmZmVyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBwb3MgLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogXCIwXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNWYWxpZCA9IG9wdHMucmVnZXguaHJzLnRlc3QoY2hycyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN0cmljdCAmJiAhaXNWYWxpZCAmJiAoY2hycy5jaGFyQXQoMSkgPT09IG9wdHMudGltZXNlcGFyYXRvciB8fCAtMSAhPT0gXCItLjpcIi5pbmRleE9mKGNocnMuY2hhckF0KDEpKSkgJiYgKGlzVmFsaWQgPSBvcHRzLnJlZ2V4Lmhycy50ZXN0KFwiMFwiICsgY2hycy5jaGFyQXQoMCkpKSkgcmV0dXJuIG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAgbWFza3NldC5idWZmZXJbcG9zXSA9IGNocnMuY2hhckF0KDApLCBwb3MrKywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hGcm9tQnVmZmVyOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBwb3MgLSAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogb3B0cy50aW1lc2VwYXJhdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzVmFsaWQgJiYgXCIyNFwiICE9PSBvcHRzLmhvdXJGb3JtYXQgJiYgb3B0cy5yZWdleC5ocnMyNC50ZXN0KGNocnMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtcCA9IHBhcnNlSW50KGNocnMsIDEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjQgPT09IHRtcCA/IChtYXNrc2V0LmJ1ZmZlcltwb3MgKyA1XSA9IFwiYVwiLCBtYXNrc2V0LmJ1ZmZlcltwb3MgKyA2XSA9IFwibVwiKSA6IChtYXNrc2V0LmJ1ZmZlcltwb3MgKyA1XSA9IFwicFwiLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXNrc2V0LmJ1ZmZlcltwb3MgKyA2XSA9IFwibVwiKSwgdG1wIC09IDEyLCB0bXAgPCAxMCA/IChtYXNrc2V0LmJ1ZmZlcltwb3NdID0gdG1wLnRvU3RyaW5nKCksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID0gXCIwXCIpIDogKG1hc2tzZXQuYnVmZmVyW3Bvc10gPSB0bXAudG9TdHJpbmcoKS5jaGFyQXQoMSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID0gdG1wLnRvU3RyaW5nKCkuY2hhckF0KDApKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoRnJvbUJ1ZmZlcjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IHBvcyAtIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IHBvcyArIDZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzogbWFza3NldC5idWZmZXJbcG9zXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNWYWxpZDtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDIsXG4gICAgICAgICAgICAgICAgICAgIHByZXZhbGlkYXRvcjogWyB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IGZ1bmN0aW9uKGNocnMsIG1hc2tzZXQsIHBvcywgc3RyaWN0LCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzVmFsaWQgPSBvcHRzLnJlZ2V4Lmhyc3ByZS50ZXN0KGNocnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpY3QgfHwgaXNWYWxpZCB8fCAhKGlzVmFsaWQgPSBvcHRzLnJlZ2V4Lmhycy50ZXN0KFwiMFwiICsgY2hycykpID8gaXNWYWxpZCA6IChtYXNrc2V0LmJ1ZmZlcltwb3NdID0gXCIwXCIsIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcysrLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvczogcG9zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDFcbiAgICAgICAgICAgICAgICAgICAgfSBdXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBzOiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogXCJbMC01XVswLTldXCIsXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAyLFxuICAgICAgICAgICAgICAgICAgICBwcmV2YWxpZGF0b3I6IFsge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1ZhbGlkID0gb3B0cy5yZWdleC5tc3ByZS50ZXN0KGNocnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpY3QgfHwgaXNWYWxpZCB8fCAhKGlzVmFsaWQgPSBvcHRzLnJlZ2V4Lm1zLnRlc3QoXCIwXCIgKyBjaHJzKSkgPyBpc1ZhbGlkIDogKG1hc2tzZXQuYnVmZmVyW3Bvc10gPSBcIjBcIiwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zKyssIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMVxuICAgICAgICAgICAgICAgICAgICB9IF1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdHMucmVnZXguYW1wbS50ZXN0KGNocnMgKyBcIm1cIik7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNhc2luZzogXCJsb3dlclwiLFxuICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBpbnNlcnRNb2RlOiAhMSxcbiAgICAgICAgICAgIGF1dG9Vbm1hc2s6ICExXG4gICAgICAgIH0sXG4gICAgICAgIGRhdGV0aW1lMTI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiMS8yL3kgaDpzIHRcXFxcbVwiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwiZGQvbW0veXl5eSBoaDptbSB4bVwiLFxuICAgICAgICAgICAgYWxpYXM6IFwiZGF0ZXRpbWVcIixcbiAgICAgICAgICAgIGhvdXJGb3JtYXQ6IFwiMTJcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1tL2RkL3l5eXkgaGg6bW0geG1cIjoge1xuICAgICAgICAgICAgbWFzazogXCIxLzIveSBoOnMgdFxcXFxtXCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJtbS9kZC95eXl5IGhoOm1tIHhtXCIsXG4gICAgICAgICAgICBhbGlhczogXCJkYXRldGltZTEyXCIsXG4gICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgIHZhbDJwcmU6IGZ1bmN0aW9uKHNlcGFyYXRvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXNjYXBlZFNlcGFyYXRvciA9IElucHV0bWFzay5lc2NhcGVSZWdleC5jYWxsKHRoaXMsIHNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKFwiKCgwWzEzLTldfDFbMDEyXSlcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIlswLTNdKXwoMDJcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIlswLTJdKVwiKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHZhbDI6IGZ1bmN0aW9uKHNlcGFyYXRvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXNjYXBlZFNlcGFyYXRvciA9IElucHV0bWFzay5lc2NhcGVSZWdleC5jYWxsKHRoaXMsIHNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKFwiKCgwWzEtOV18MVswMTJdKVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiKDBbMS05XXxbMTJdWzAtOV0pKXwoKDBbMTMtOV18MVswMTJdKVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiMzApfCgoMFsxMzU3OF18MVswMl0pXCIgKyBlc2NhcGVkU2VwYXJhdG9yICsgXCIzMSlcIik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB2YWwxcHJlOiBuZXcgUmVnRXhwKFwiWzAxXVwiKSxcbiAgICAgICAgICAgICAgICB2YWwxOiBuZXcgUmVnRXhwKFwiMFsxLTldfDFbMDEyXVwiKVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxlYXBkYXk6IFwiMDIvMjkvXCIsXG4gICAgICAgICAgICBvbktleURvd246IGZ1bmN0aW9uKGUsIGJ1ZmZlciwgY2FyZXRQb3MsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgJGlucHV0ID0gJCh0aGlzKTtcbiAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5ICYmIGUua2V5Q29kZSA9PT0gSW5wdXRtYXNrLmtleUNvZGUuUklHSFQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRvZGF5ID0gbmV3IERhdGUoKTtcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnZhbCgodG9kYXkuZ2V0TW9udGgoKSArIDEpLnRvU3RyaW5nKCkgKyB0b2RheS5nZXREYXRlKCkudG9TdHJpbmcoKSArIHRvZGF5LmdldEZ1bGxZZWFyKCkudG9TdHJpbmcoKSksIFxuICAgICAgICAgICAgICAgICAgICAkaW5wdXQudHJpZ2dlcihcInNldHZhbHVlXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgXCJoaDptbSB0XCI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiaDpzIHRcXFxcbVwiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwiaGg6bW0geG1cIixcbiAgICAgICAgICAgIGFsaWFzOiBcImRhdGV0aW1lXCIsXG4gICAgICAgICAgICBob3VyRm9ybWF0OiBcIjEyXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJoOnMgdFwiOiB7XG4gICAgICAgICAgICBtYXNrOiBcImg6cyB0XFxcXG1cIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcImhoOm1tIHhtXCIsXG4gICAgICAgICAgICBhbGlhczogXCJkYXRldGltZVwiLFxuICAgICAgICAgICAgaG91ckZvcm1hdDogXCIxMlwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiaGg6bW06c3NcIjoge1xuICAgICAgICAgICAgbWFzazogXCJoOnM6c1wiLFxuICAgICAgICAgICAgcGxhY2Vob2xkZXI6IFwiaGg6bW06c3NcIixcbiAgICAgICAgICAgIGFsaWFzOiBcImRhdGV0aW1lXCIsXG4gICAgICAgICAgICBhdXRvVW5tYXNrOiAhMVxuICAgICAgICB9LFxuICAgICAgICBcImhoOm1tXCI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiaDpzXCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJoaDptbVwiLFxuICAgICAgICAgICAgYWxpYXM6IFwiZGF0ZXRpbWVcIixcbiAgICAgICAgICAgIGF1dG9Vbm1hc2s6ICExXG4gICAgICAgIH0sXG4gICAgICAgIGRhdGU6IHtcbiAgICAgICAgICAgIGFsaWFzOiBcImRkL21tL3l5eXlcIlxuICAgICAgICB9LFxuICAgICAgICBcIm1tL3l5eXlcIjoge1xuICAgICAgICAgICAgbWFzazogXCIxL3lcIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIm1tL3l5eXlcIixcbiAgICAgICAgICAgIGxlYXBkYXk6IFwiZG9ub3R1c2VcIixcbiAgICAgICAgICAgIHNlcGFyYXRvcjogXCIvXCIsXG4gICAgICAgICAgICBhbGlhczogXCJtbS9kZC95eXl5XCJcbiAgICAgICAgfSxcbiAgICAgICAgc2hhbXNpOiB7XG4gICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgIHZhbDJwcmU6IGZ1bmN0aW9uKHNlcGFyYXRvcikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXNjYXBlZFNlcGFyYXRvciA9IElucHV0bWFzay5lc2NhcGVSZWdleC5jYWxsKHRoaXMsIHNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKFwiKCgwWzEtOV18MVswMTJdKVwiICsgZXNjYXBlZFNlcGFyYXRvciArIFwiWzAtM10pXCIpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdmFsMjogZnVuY3Rpb24oc2VwYXJhdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBlc2NhcGVkU2VwYXJhdG9yID0gSW5wdXRtYXNrLmVzY2FwZVJlZ2V4LmNhbGwodGhpcywgc2VwYXJhdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBSZWdFeHAoXCIoKDBbMS05XXwxWzAxMl0pXCIgKyBlc2NhcGVkU2VwYXJhdG9yICsgXCIoMFsxLTldfFsxMl1bMC05XSkpfCgoMFsxLTldfDFbMDEyXSlcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIjMwKXwoKDBbMS02XSlcIiArIGVzY2FwZWRTZXBhcmF0b3IgKyBcIjMxKVwiKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHZhbDFwcmU6IG5ldyBSZWdFeHAoXCJbMDFdXCIpLFxuICAgICAgICAgICAgICAgIHZhbDE6IG5ldyBSZWdFeHAoXCIwWzEtOV18MVswMTJdXCIpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeWVhcnJhbmdlOiB7XG4gICAgICAgICAgICAgICAgbWlueWVhcjogMTMwMCxcbiAgICAgICAgICAgICAgICBtYXh5ZWFyOiAxNDk5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbWFzazogXCJ5LzEvMlwiLFxuICAgICAgICAgICAgbGVhcGRheTogXCIvMTIvMzBcIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcInl5eXkvbW0vZGRcIixcbiAgICAgICAgICAgIGFsaWFzOiBcIm1tL2RkL3l5eXlcIixcbiAgICAgICAgICAgIGNsZWFySW5jb21wbGV0ZTogITBcbiAgICAgICAgfSxcbiAgICAgICAgXCJ5eXl5LW1tLWRkIGhoOm1tOnNzXCI6IHtcbiAgICAgICAgICAgIG1hc2s6IFwieS0xLTIgaDpzOnNcIixcb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yBSZWdFeHAoXCJbMDFdXCIpLFxuICAgICAgICAgICAgICAgIHZhbDE6IG5ldyBSZWdFeHAoXCIwWzEtOV18MVswMTJdXCIpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb25LZXlEb3duOiBmdW5jdGlvbihlLCBidWZmZXIsIGNhcmV0UG9zLCBvcHRzKSB7fVxuICAgICAgICB9XG4gICAgfSksIElucHV0bWFzaztcbn0pO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2lucHV0bWFzay9kaXN0L2lucHV0bWFzay9pbnB1dG1hc2suZGF0ZS5leHRlbnNpb25zLmpzXG4vLyBtb2R1bGUgaWQgPSA2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0=\\n//# sourceURL=webpack-internal:///6\\n\");\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* inputmask.extensions.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"./dependencyLibs/inputmask.dependencyLib\\\"), require(\\\"./inputmask\\\")) : factory(window.dependencyLib || jQuery, window.Inputmask);\\n}(function($, Inputmask) {\\n return Inputmask.extendDefinitions({\\n A: {\\n validator: \\\"[A-Za-z\\\\u0410-\\\\u044f\\\\u0401\\\\u0451\\\\xc0-\\\\xff\\\\xb5]\\\",\\n cardinality: 1,\\n casing: \\\"upper\\\"\\n },\\n \\\"&\\\": {\\n validator: \\\"[0-9A-Za-z\\\\u0410-\\\\u044f\\\\u0401\\\\u0451\\\\xc0-\\\\xff\\\\xb5]\\\",\\n cardinality: 1,\\n casing: \\\"upper\\\"\\n },\\n \\\"#\\\": {\\n validator: \\\"[0-9A-Fa-f]\\\",\\n cardinality: 1,\\n casing: \\\"upper\\\"\\n }\\n }), Inputmask.extendAliases({\\n url: {\\n definitions: {\\n i: {\\n validator: \\\".\\\",\\n cardinality: 1\\n }\\n },\\n mask: \\\"(\\\\\\\\http://)|(\\\\\\\\http\\\\\\\\s://)|(ftp://)|(ftp\\\\\\\\s://)i{+}\\\",\\n insertMode: !1,\\n autoUnmask: !1,\\n inputmode: \\\"url\\\"\\n },\\n ip: {\\n mask: \\\"i[i[i]].i[i[i]].i[i[i]].i[i[i]]\\\",\\n definitions: {\\n i: {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return pos - 1 > -1 && \\\".\\\" !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs, \\n chrs = pos - 2 > -1 && \\\".\\\" !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : \\\"0\\\" + chrs) : chrs = \\\"00\\\" + chrs, \\n new RegExp(\\\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\\\").test(chrs);\\n },\\n cardinality: 1\\n }\\n },\\n onUnMask: function(maskedValue, unmaskedValue, opts) {\\n return maskedValue;\\n },\\n inputmode: \\\"numeric\\\"\\n },\\n email: {\\n mask: \\\"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\\\",\\n greedy: !1,\\n onBeforePaste: function(pastedValue, opts) {\\n return pastedValue = pastedValue.toLowerCase(), pastedValue.replace(\\\"mailto:\\\", \\\"\\\");\\n },\\n definitions: {\\n \\\"*\\\": {\\n validator: \\\"[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]\\\",\\n cardinality: 1,\\n casing: \\\"lower\\\"\\n },\\n \\\"-\\\": {\\n validator: \\\"[0-9A-Za-z-]\\\",\\n cardinality: 1,\\n casing: \\\"lower\\\"\\n }\\n },\\n onUnMask: function(maskedValue, unmaskedValue, opts) {\\n return maskedValue;\\n },\\n inputmode: \\\"email\\\"\\n },\\n mac: {\\n mask: \\\"##:##:##:##:##:##\\\"\\n },\\n vin: {\\n mask: \\\"V{13}9{4}\\\",\\n definitions: {\\n V: {\\n validator: \\\"[A-HJ-NPR-Za-hj-npr-z\\\\\\\\d]\\\",\\n cardinality: 1,\\n casing: \\\"upper\\\"\\n }\\n },\\n clearIncomplete: !0,\\n autoUnmask: !0\\n }\\n }), Inputmask;\\n});\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5leHRlbnNpb25zLmpzPzY5NWEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUFBO0FBQUE7QUFBQTtBQUNBLENBQUM7QUFDRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQ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AgICAgIGNhc2luZzogXCJ1cHBlclwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiI1wiOiB7XG4gICAgICAgICAgICB2YWxpZGF0b3I6IFwiWzAtOUEtRmEtZl1cIixcbiAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgY2FzaW5nOiBcInVwcGVyXCJcbiAgICAgICAgfVxuICAgIH0pLCBJbnB1dG1hc2suZXh0ZW5kQWxpYXNlcyh7XG4gICAgICAgIHVybDoge1xuICAgICAgICAgICAgZGVmaW5pdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBpOiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogXCIuXCIsXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG1hc2s6IFwiKFxcXFxodHRwOi8vKXwoXFxcXGh0dHBcXFxcczovLyl8KGZ0cDovLyl8KGZ0cFxcXFxzOi8vKWl7K31cIixcbiAgICAgICAgICAgIGluc2VydE1vZGU6ICExLFxuICAgICAgICAgICAgYXV0b1VubWFzazogITEsXG4gICAgICAgICAgICBpbnB1dG1vZGU6IFwidXJsXCJcbiAgICAgICAgfSxcbiAgICAgICAgaXA6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiaVtpW2ldXS5pW2lbaV1dLmlbaVtpXV0uaVtpW2ldXVwiLFxuICAgICAgICAgICAgZGVmaW5pdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBpOiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkYXRvcjogZnVuY3Rpb24oY2hycywgbWFza3NldCwgcG9zLCBzdHJpY3QsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwb3MgLSAxID4gLTEgJiYgXCIuXCIgIT09IG1hc2tzZXQuYnVmZmVyW3BvcyAtIDFdID8gKGNocnMgPSBtYXNrc2V0LmJ1ZmZlcltwb3MgLSAxXSArIGNocnMsIFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hycyA9IHBvcyAtIDIgPiAtMSAmJiBcIi5cIiAhPT0gbWFza3NldC5idWZmZXJbcG9zIC0gMl0gPyBtYXNrc2V0LmJ1ZmZlcltwb3MgLSAyXSArIGNocnMgOiBcIjBcIiArIGNocnMpIDogY2hycyA9IFwiMDBcIiArIGNocnMsIFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFJlZ0V4cChcIjI1WzAtNV18MlswLTRdWzAtOV18WzAxXVswLTldWzAtOV1cIikudGVzdChjaHJzKTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDFcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb25Vbk1hc2s6IGZ1bmN0aW9uKG1hc2tlZFZhbHVlLCB1bm1hc2tlZFZhbHVlLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hc2tlZFZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlucHV0bW9kZTogXCJudW1lcmljXCJcbiAgICAgICAgfSxcbiAgICAgICAgZW1haWw6IHtcbiAgICAgICAgICAgIG1hc2s6IFwiKnsxLDY0fVsuKnsxLDY0fV1bLip7MSw2NH1dWy4qezEsNjN9XUAtezEsNjN9Li17MSw2M31bLi17MSw2M31dWy4tezEsNjN9XVwiLFxuICAgICAgICAgICAgZ3JlZWR5OiAhMSxcbiAgICAgICAgICAgIG9uQmVmb3JlUGFzdGU6IGZ1bmN0aW9uKHBhc3RlZFZhbHVlLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhc3RlZFZhbHVlID0gcGFzdGVkVmFsdWUudG9Mb3dlckNhc2UoKSwgcGFzdGVkVmFsdWUucmVwbGFjZShcIm1haWx0bzpcIiwgXCJcIik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVmaW5pdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBcIipcIjoge1xuICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IFwiWzAtOUEtWmEteiEjJCUmJyorLz0/Xl9ge3x9fi1dXCIsXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgICAgICAgICBjYXNpbmc6IFwibG93ZXJcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCItXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBcIlswLTlBLVphLXotXVwiLFxuICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMSxcbiAgICAgICAgICAgICAgICAgICAgY2FzaW5nOiBcImxvd2VyXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb25Vbk1hc2s6IGZ1bmN0aW9uKG1hc2tlZFZhbHVlLCB1bm1hc2tlZFZhbHVlLCBvcHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hc2tlZFZhbHVlO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlucHV0bW9kZTogXCJlbWFpbFwiXG4gICAgICAgIH0sXG4gICAgICAgIG1hYzoge1xuICAgICAgICAgICAgbWFzazogXCIjIzojIzojIzojIzojIzojI1wiXG4gICAgICAgIH0sXG4gICAgICAgIHZpbjoge1xuICAgICAgICAgICAgbWFzazogXCJWezEzfTl7NH1cIixcbiAgICAgICAgICAgIGRlZmluaXRpb25zOiB7XG4gICAgICAgICAgICAgICAgVjoge1xuICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IFwiW0EtSEotTlBSLVphLWhqLW5wci16XFxcXGRdXCIsXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgICAgICAgICBjYXNpbmc6IFwidXBwZXJcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjbGVhckluY29tcGxldGU6ICEwLFxuICAgICAgICAgICAgYXV0b1VubWFzazogITBcbiAgICAgICAgfVxuICAgIH0pLCBJbnB1dG1hc2s7XG59KTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9pbnB1dG1hc2svZGlzdC9pbnB1dG1hc2svaW5wdXRtYXNrLmV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ==\\n//# sourceURL=webpack-internal:///7\\n\");\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* inputmask.numeric.extensions.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"./dependencyLibs/inputmask.dependencyLib\\\"), require(\\\"./inputmask\\\")) : factory(window.dependencyLib || jQuery, window.Inputmask);\\n}(function($, Inputmask, undefined) {\\n function autoEscape(txt, opts) {\\n for (var escapedTxt = \\\"\\\", i = 0; i < txt.length; i++) 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) ? escapedTxt += \\\"\\\\\\\\\\\" + txt.charAt(i) : escapedTxt += txt.charAt(i);\\n return escapedTxt;\\n }\\n return Inputmask.extendAliases({\\n numeric: {\\n mask: function(opts) {\\n if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat), \\n opts.repeat = 0, opts.groupSeparator === opts.radixPoint && (\\\".\\\" === opts.radixPoint ? opts.groupSeparator = \\\",\\\" : \\\",\\\" === opts.radixPoint ? opts.groupSeparator = \\\".\\\" : opts.groupSeparator = \\\"\\\"), \\n \\\" \\\" === opts.groupSeparator && (opts.skipOptionalPartCharacter = undefined), opts.autoGroup = opts.autoGroup && \\\"\\\" !== opts.groupSeparator, \\n opts.autoGroup && (\\\"string\\\" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)), \\n isFinite(opts.integerDigits))) {\\n var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;\\n opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps), \\n opts.integerDigits < 1 && (opts.integerDigits = \\\"*\\\");\\n }\\n opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)), \\n \\\"radixFocus\\\" === opts.positionCaretOnClick && \\\"\\\" === opts.placeholder && !1 === opts.integerOptional && (opts.positionCaretOnClick = \\\"lvp\\\"), \\n opts.definitions[\\\";\\\"] = opts.definitions[\\\"~\\\"], opts.definitions[\\\";\\\"].definitionSymbol = \\\"~\\\", \\n !0 === opts.numericInput && (opts.positionCaretOnClick = \\\"radixFocus\\\" === opts.positionCaretOnClick ? \\\"lvp\\\" : opts.positionCaretOnClick, \\n opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);\\n var mask = \\\"[+]\\\";\\n if (mask += autoEscape(opts.prefix, opts), !0 === opts.integerOptional ? mask += \\\"~{1,\\\" + opts.integerDigits + \\\"}\\\" : mask += \\\"~{\\\" + opts.integerDigits + \\\"}\\\", \\n opts.digits !== undefined) {\\n opts.radixPointDefinitionSymbol = opts.decimalProtect ? \\\":\\\" : opts.radixPoint;\\n var dq = opts.digits.toString().split(\\\",\\\");\\n isFinite(dq[0] && dq[1] && isFinite(dq[1])) ? mask += opts.radixPointDefinitionSymbol + \\\";{\\\" + opts.digits + \\\"}\\\" : (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (opts.digitsOptional ? mask += \\\"[\\\" + opts.radixPointDefinitionSymbol + \\\";{1,\\\" + opts.digits + \\\"}]\\\" : mask += opts.radixPointDefinitionSymbol + \\\";{\\\" + opts.digits + \\\"}\\\");\\n }\\n return mask += autoEscape(opts.suffix, opts), mask += \\\"[-]\\\", opts.greedy = !1, mask;\\n },\\n placeholder: \\\"\\\",\\n greedy: !1,\\n digits: \\\"*\\\",\\n digitsOptional: !0,\\n enforceDigitsOnBlur: !1,\\n radixPoint: \\\".\\\",\\n positionCaretOnClick: \\\"radixFocus\\\",\\n groupSize: 3,\\n groupSeparator: \\\"\\\",\\n autoGroup: !1,\\n allowMinus: !0,\\n negationSymbol: {\\n front: \\\"-\\\",\\n back: \\\"\\\"\\n },\\n integerDigits: \\\"+\\\",\\n integerOptional: !0,\\n prefix: \\\"\\\",\\n suffix: \\\"\\\",\\n rightAlign: !0,\\n decimalProtect: !0,\\n min: null,\\n max: null,\\n step: 1,\\n insertMode: !0,\\n autoUnmask: !1,\\n unmaskAsNumber: !1,\\n inputmode: \\\"numeric\\\",\\n preValidation: function(buffer, pos, c, isSelection, opts) {\\n if (\\\"-\\\" === c || c === opts.negationSymbol.front) return !0 === opts.allowMinus && (opts.isNegative = opts.isNegative === undefined || !opts.isNegative, \\n \\\"\\\" === buffer.join(\\\"\\\") || {\\n caret: pos,\\n dopost: !0\\n });\\n if (!1 === isSelection && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {\\n var radixPos = $.inArray(opts.radixPoint, buffer);\\n if (-1 !== radixPos) return !0 === opts.numericInput ? pos === radixPos : {\\n caret: radixPos + 1\\n };\\n }\\n return !0;\\n },\\n postValidation: function(buffer, currentResult, opts) {\\n var suffix = opts.suffix.split(\\\"\\\"), prefix = opts.prefix.split(\\\"\\\");\\n if (currentResult.pos === undefined && currentResult.caret !== undefined && !0 !== currentResult.dopost) return currentResult;\\n var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos, maskedValue = buffer.slice();\\n opts.numericInput && (caretPos = maskedValue.length - caretPos - 1, maskedValue = maskedValue.reverse());\\n var charAtPos = maskedValue[caretPos];\\n if (charAtPos === opts.groupSeparator && (caretPos += 1, charAtPos = maskedValue[caretPos]), \\n caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;\\n charAtPos !== undefined && charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back && (maskedValue[caretPos] = \\\"?\\\", \\n opts.prefix.length > 0 && caretPos >= (!1 === opts.isNegative ? 1 : 0) && caretPos < opts.prefix.length - 1 + (!1 === opts.isNegative ? 1 : 0) ? prefix[caretPos - (!1 === opts.isNegative ? 1 : 0)] = \\\"?\\\" : opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0) && (suffix[caretPos - (maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0))] = \\\"?\\\")), \\n prefix = prefix.join(\\\"\\\"), suffix = suffix.join(\\\"\\\");\\n var processValue = maskedValue.join(\\\"\\\").replace(prefix, \\\"\\\");\\n if (processValue = processValue.replace(suffix, \\\"\\\"), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n processValue = processValue.replace(new RegExp(\\\"[-\\\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \\\"]\\\", \\\"g\\\"), \\\"\\\"), \\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \\\"$\\\"), \\\"\\\"), \\n isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), \\\"g\\\"), \\\"\\\")), \\n processValue.length > 1 && 1 !== processValue.indexOf(opts.radixPoint) && (\\\"0\\\" === charAtPos && (processValue = processValue.replace(/^\\\\?/g, \\\"\\\")), \\n processValue = processValue.replace(/^0/g, \\\"\\\")), processValue.charAt(0) === opts.radixPoint && \\\"\\\" !== opts.radixPoint && !0 !== opts.numericInput && (processValue = \\\"0\\\" + processValue), \\n \\\"\\\" !== processValue) {\\n if (processValue = processValue.split(\\\"\\\"), (!opts.digitsOptional || opts.enforceDigitsOnBlur && \\\"blur\\\" === currentResult.event) && isFinite(opts.digits)) {\\n var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);\\n -1 === radixPosition && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);\\n for (var i = 1; i <= opts.digits; i++) opts.digitsOptional && (!opts.enforceDigitsOnBlur || \\\"blur\\\" !== currentResult.event) || processValue[radixPosition + i] !== undefined && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? -1 !== rpb && maskedValue[rpb + i] !== undefined && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);\\n }\\n if (!0 !== opts.autoGroup || \\\"\\\" === opts.groupSeparator || charAtPos === opts.radixPoint && currentResult.pos === undefined && !currentResult.dopost) processValue = processValue.join(\\\"\\\"); else {\\n var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;\\n processValue = Inputmask(function(buffer, opts) {\\n var postMask = \\\"\\\";\\n if (postMask += \\\"(\\\" + opts.groupSeparator + \\\"*{\\\" + opts.groupSize + \\\"}){*}\\\", \\\"\\\" !== opts.radixPoint) {\\n var radixSplit = buffer.join(\\\"\\\").split(opts.radixPoint);\\n radixSplit[1] && (postMask += opts.radixPoint + \\\"*{\\\" + radixSplit[1].match(/^\\\\d*\\\\??\\\\d*/)[0].length + \\\"}\\\");\\n }\\n return postMask;\\n }(processValue, opts), {\\n numericInput: !0,\\n jitMasking: !0,\\n definitions: {\\n \\\"*\\\": {\\n validator: \\\"[0-9?]\\\",\\n cardinality: 1\\n }\\n }\\n }).format(processValue.join(\\\"\\\")), addRadix && (processValue += opts.radixPoint), \\n processValue.charAt(0) === opts.groupSeparator && processValue.substr(1);\\n }\\n }\\n if (opts.isNegative && \\\"blur\\\" === currentResult.event && (opts.isNegative = \\\"0\\\" !== processValue), \\n processValue = prefix + processValue, processValue += suffix, opts.isNegative && (processValue = opts.negationSymbol.front + processValue, \\n processValue += opts.negationSymbol.back), processValue = processValue.split(\\\"\\\"), \\n charAtPos !== undefined) if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) caretPos = $.inArray(\\\"?\\\", processValue), \\n caretPos > -1 ? processValue[caretPos] = charAtPos : caretPos = currentResult.caret || 0; else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {\\n var newCaretPos = $.inArray(charAtPos, processValue);\\n -1 !== newCaretPos && (caretPos = newCaretPos);\\n }\\n opts.numericInput && (caretPos = processValue.length - caretPos - 1, processValue = processValue.reverse());\\n var rslt = {\\n caret: charAtPos === undefined || currentResult.pos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,\\n buffer: processValue,\\n refreshFromBuffer: currentResult.dopost || buffer.join(\\\"\\\") !== processValue.join(\\\"\\\")\\n };\\n return rslt.refreshFromBuffer ? rslt : currentResult;\\n },\\n onBeforeWrite: function(e, buffer, caretPos, opts) {\\n if (e) switch (e.type) {\\n case \\\"keydown\\\":\\n return opts.postValidation(buffer, {\\n caret: caretPos,\\n dopost: !0\\n }, opts);\\n\\n case \\\"blur\\\":\\n case \\\"checkval\\\":\\n var unmasked;\\n if (function(opts) {\\n opts.parseMinMaxOptions === undefined && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n \\\",\\\" === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, \\\".\\\")), \\n opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)), \\n null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n \\\",\\\" === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, \\\".\\\")), \\n opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)), \\n opts.parseMinMaxOptions = \\\"done\\\");\\n }(opts), null !== opts.min || null !== opts.max) {\\n if (unmasked = opts.onUnMask(buffer.join(\\\"\\\"), undefined, $.extend({}, opts, {\\n unmaskAsNumber: !0\\n })), null !== opts.min && unmasked < opts.min) return opts.isNegative = opts.min < 0, \\n opts.postValidation(opts.min.toString().replace(\\\".\\\", opts.radixPoint).split(\\\"\\\"), {\\n caret: caretPos,\\n dopost: !0,\\n placeholder: \\\"0\\\"\\n }, opts);\\n if (null !== opts.max && unmasked > opts.max) return opts.isNegative = opts.max < 0, \\n opts.postValidation(opts.max.toString().replace(\\\".\\\", opts.radixPoint).split(\\\"\\\"), {\\n caret: caretPos,\\n dopost: !0,\\n placeholder: \\\"0\\\"\\n }, opts);\\n }\\n return opts.postValidation(buffer, {\\n caret: caretPos,\\n placeholder: \\\"0\\\",\\n event: \\\"blur\\\"\\n }, opts);\\n\\n case \\\"_checkval\\\":\\n return {\\n caret: caretPos\\n };\\n }\\n },\\n regex: {\\n integerPart: function(opts, emptyCheck) {\\n return emptyCheck ? new RegExp(\\\"[\\\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \\\"+]?\\\") : new RegExp(\\\"[\\\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \\\"+]?\\\\\\\\d+\\\");\\n },\\n integerNPart: function(opts) {\\n return new RegExp(\\\"[\\\\\\\\d\\\" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + \\\"]+\\\");\\n }\\n },\\n definitions: {\\n \\\"~\\\": {\\n validator: function(chrs, maskset, pos, strict, opts, isSelection) {\\n var isValid = strict ? new RegExp(\\\"[0-9\\\" + Inputmask.escapeRegex(opts.groupSeparator) + \\\"]\\\").test(chrs) : new RegExp(\\\"[0-9]\\\").test(chrs);\\n if (!0 === isValid) {\\n if (!0 !== opts.numericInput && maskset.validPositions[pos] !== undefined && \\\"~\\\" === maskset.validPositions[pos].match.def && !isSelection) {\\n var processValue = maskset.buffer.join(\\\"\\\");\\n processValue = processValue.replace(new RegExp(\\\"[-\\\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \\\"]\\\", \\\"g\\\"), \\\"\\\"), \\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \\\"$\\\"), \\\"\\\");\\n var pvRadixSplit = processValue.split(opts.radixPoint);\\n pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0))), \\n \\\"0\\\" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0))), \\n processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || \\\"\\\";\\n var bufferTemplate = maskset._buffer.join(\\\"\\\");\\n for (processValue === opts.radixPoint && (processValue = bufferTemplate); null === processValue.match(Inputmask.escapeRegex(bufferTemplate) + \\\"$\\\"); ) bufferTemplate = bufferTemplate.slice(1);\\n processValue = processValue.replace(bufferTemplate, \\\"\\\"), processValue = processValue.split(\\\"\\\"), \\n isValid = processValue[pos] === undefined ? {\\n pos: pos,\\n remove: pos\\n } : {\\n pos: pos\\n };\\n }\\n } else strict || chrs !== opts.radixPoint || maskset.validPositions[pos - 1] !== undefined || (maskset.buffer[pos] = \\\"0\\\", \\n isValid = {\\n pos: pos + 1\\n });\\n return isValid;\\n },\\n cardinality: 1\\n },\\n \\\"+\\\": {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return opts.allowMinus && (\\\"-\\\" === chrs || chrs === opts.negationSymbol.front);\\n },\\n cardinality: 1,\\n placeholder: \\\"\\\"\\n },\\n \\\"-\\\": {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n return opts.allowMinus && chrs === opts.negationSymbol.back;\\n },\\n cardinality: 1,\\n placeholder: \\\"\\\"\\n },\\n \\\":\\\": {\\n validator: function(chrs, maskset, pos, strict, opts) {\\n var radix = \\\"[\\\" + Inputmask.escapeRegex(opts.radixPoint) + \\\"]\\\", isValid = new RegExp(radix).test(chrs);\\n return isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {\\n caret: pos + 1\\n }), isValid;\\n },\\n cardinality: 1,\\n placeholder: function(opts) {\\n return opts.radixPoint;\\n }\\n }\\n },\\n onUnMask: function(maskedValue, unmaskedValue, opts) {\\n if (\\\"\\\" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;\\n var processValue = maskedValue.replace(opts.prefix, \\\"\\\");\\n return processValue = processValue.replace(opts.suffix, \\\"\\\"), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n \\\"\\\" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), \\\"g\\\"), \\\"0\\\")), \\n opts.unmaskAsNumber ? (\\\"\\\" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), \\\".\\\")), \\n processValue = processValue.replace(new RegExp(\\\"^\\\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \\\"-\\\"), \\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \\\"$\\\"), \\\"\\\"), \\n Number(processValue)) : processValue;\\n },\\n isComplete: function(buffer, opts) {\\n var maskedValue = buffer.join(\\\"\\\");\\n if (buffer.slice().join(\\\"\\\") !== maskedValue) return !1;\\n var processValue = maskedValue.replace(opts.prefix, \\\"\\\");\\n return processValue = processValue.replace(opts.suffix, \\\"\\\"), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n \\\",\\\" === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), \\\".\\\")), \\n isFinite(processValue);\\n },\\n onBeforeMask: function(initialValue, opts) {\\n if (opts.isNegative = undefined, initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(), \\n \\\"\\\" !== opts.radixPoint && isFinite(initialValue)) {\\n var vs = initialValue.split(\\\".\\\"), groupSize = \\\"\\\" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;\\n 2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize || vs[0].length <= groupSize && vs[1].length < groupSize) && (initialValue = initialValue.replace(\\\".\\\", opts.radixPoint));\\n }\\n var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\\\\./g);\\n if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\\\\./g, \\\"\\\"), \\n initialValue = initialValue.replace(\\\",\\\", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, \\\"\\\"), \\n initialValue = initialValue.replace(\\\".\\\", opts.radixPoint)) : initialValue = initialValue.indexOf(\\\".\\\") < initialValue.indexOf(\\\",\\\") ? initialValue.replace(/\\\\./g, \\\"\\\") : initialValue.replace(/,/g, \\\"\\\") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \\\"g\\\"), \\\"\\\"), \\n 0 === opts.digits && (-1 !== initialValue.indexOf(\\\".\\\") ? initialValue = initialValue.substring(0, initialValue.indexOf(\\\".\\\")) : -1 !== initialValue.indexOf(\\\",\\\") && (initialValue = initialValue.substring(0, initialValue.indexOf(\\\",\\\")))), \\n \\\"\\\" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {\\n var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp(\\\"\\\\\\\\d*\\\"))[0];\\n if (parseInt(opts.digits) < decPart.toString().length) {\\n var digitsFactor = Math.pow(10, parseInt(opts.digits));\\n initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), \\\".\\\"), \\n initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor, \\n initialValue = initialValue.toString().replace(\\\".\\\", opts.radixPoint);\\n }\\n }\\n return initialValue;\\n },\\n canClearPosition: function(maskset, position, lvp, strict, opts) {\\n var vp = maskset.validPositions[position], canClear = vp.input !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && !1 === opts.decimalProtect || vp.input === opts.radixPoint && maskset.validPositions[position + 1] && null === maskset.validPositions[position + 1].match.fn || isFinite(vp.input) || position === lvp || vp.input === opts.groupSeparator || vp.input === opts.negationSymbol.front || vp.input === opts.negationSymbol.back;\\n return !canClear || \\\"+\\\" !== vp.match.nativeDef && \\\"-\\\" !== vp.match.nativeDef || (opts.isNegative = !1), \\n canClear;\\n },\\n onKeyDown: function(e, buffer, caretPos, opts) {\\n var $input = $(this);\\n if (e.ctrlKey) switch (e.keyCode) {\\n case Inputmask.keyCode.UP:\\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger(\\\"setvalue\\\");\\n break;\\n\\n case Inputmask.keyCode.DOWN:\\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger(\\\"setvalue\\\");\\n }\\n }\\n },\\n currency: {\\n prefix: \\\"$ \\\",\\n groupSeparator: \\\",\\\",\\n alias: \\\"numeric\\\",\\n placeholder: \\\"0\\\",\\n autoGroup: !0,\\n digits: 2,\\n digitsOptional: !1,\\n clearMaskOnLostFocus: !1\\n },\\n decimal: {\\n alias: \\\"numeric\\\"\\n },\\n integer: {\\n alias: \\\"numeric\\\",\\n digits: 0,\\n radixPoint: \\\"\\\"\\n },\\n percentage: {\\n alias: \\\"numeric\\\",\\n digits: 2,\\n digitsOptional: !0,\\n radixPoint: \\\".\\\",\\n placeholder: \\\"0\\\",\\n autoGroup: !1,\\n min: 0,\\n max: 100,\\n suffix: \\\" %\\\",\\n allowMinus: !1\\n }\\n }), Inputmask;\\n});\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5udW1lcmljLmV4dGVuc2lvbnMuanM/ZTAyOSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQ0EsQ0FBQztBQUNEO0FBQ0Esd0NBQXdDLGdCQUF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AgICAgICAgICBhdXRvR3JvdXA6ICExLFxuICAgICAgICAgICAgYWxsb3dNaW51czogITAsXG4gICAgICAgICAgICBuZWdhdGlvblN5bWJvbDoge1xuICAgICAgICAgICAgICAgIGZyb250OiBcIi1cIixcbiAgICAgICAgICAgICAgICBiYWNrOiBcIlwiXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaW50ZWdlckRpZ2l0czogXCIrXCIsXG4gICAgICAgICAgICBpbnRlZ2VyT3B0aW9uYWw6ICEwLFxuICAgICAgICAgICAgcHJlZml4OiBcIlwiLFxuICAgICAgICAgICAgc3VmZml4OiBcIlwiLFxuICAgICAgICAgICAgcmlnaHRBbGlnbjogITAsXG4gICAgICAgICAgICBkZWNpbWFsUHJvdGVjdDogITAsXG4gICAgICAgICAgICBtaW46IG51bGwsXG4gICAgICAgICAgICBtYXg6IG51bGwsXG4gICAgICAgICAgICBzdGVwOiAxLFxuICAgICAgICAgICAgaW5zZXJ0TW9kZTogITAsXG4gICAgICAgICAgICBhdXRvVW5tYXNrOiAhMSxcbiAgICAgICAgICAgIHVubWFza0FzTnVtYmVyOiAhMSxcbiAgICAgICAgICAgIGlucHV0bW9kZTogXCJudW1lcmljXCIsXG4gICAgICAgICAgICBwcmVWYWxpZGF0aW9uOiBmdW5jdGlvbihidWZmZXIsIHBvcywgYywgaXNTZWxlY3Rpb24sIG9wdHMpIHtcbiAgICAgICAgICAgICAgICBpZiAoXCItXCIgPT09IGMgfHwgYyA9PT0gb3B0cy5uZWdhdGlvblN5bWJvbC5mcm9udCkgcmV0dXJuICEwID09PSBvcHRzLmFsbG93TWludXMgJiYgKG9wdHMuaXNOZWdhdGl2ZSA9IG9wdHMuaXNOZWdhdGl2ZSA9PT0gdW5kZWZpbmVkIHx8ICFvcHRzLmlzTmVnYXRpdmUsIFxuICAgICAgICAgICAgICAgIFwiXCIgPT09IGJ1ZmZlci5qb2luKFwiXCIpIHx8IHtcbiAgICAgICAgICAgICAgICAgICAgY2FyZXQ6IHBvcyxcbiAgICAgICAgICAgICAgICAgICAgZG9wb3N0OiAhMFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGlmICghMSA9PT0gaXNTZWxlY3Rpb24gJiYgYyA9PT0gb3B0cy5yYWRpeFBvaW50ICYmIG9wdHMuZGlnaXRzICE9PSB1bmRlZmluZWQgJiYgKGlzTmFOKG9wdHMuZGlnaXRzKSB8fCBwYXJzZUludChvcHRzLmRpZ2l0cykgPiAwKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmFkaXhQb3MgPSAkLmluQXJyYXkob3B0cy5yYWRpeFBvaW50LCBidWZmZXIpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoLTEgIT09IHJhZGl4UG9zKSByZXR1cm4gITAgPT09IG9wdHMubnVtZXJpY0lucHV0ID8gcG9zID09PSByYWRpeFBvcyA6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhcmV0OiByYWRpeFBvcyArIDFcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICEwO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBvc3RWYWxpZGF0aW9uOiBmdW5jdGlvbihidWZmZXIsIGN1cnJlbnRSZXN1bHQsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gb3B0cy5zdWZmaXguc3BsaXQoXCJcIiksIHByZWZpeCA9IG9wdHMucHJlZml4LnNwbGl0KFwiXCIpO1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW50UmVzdWx0LnBvcyA9PT0gdW5kZWZpbmVkICYmIGN1cnJlbnRSZXN1bHQuY2FyZXQgIT09IHVuZGVmaW5lZCAmJiAhMCAhPT0gY3VycmVudFJlc3VsdC5kb3Bvc3QpIHJldHVybiBjdXJyZW50UmVzdWx0O1xuICAgICAgICAgICAgICAgIHZhciBjYXJldFBvcyA9IGN1cnJlbnRSZXN1bHQuY2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50ICsgXCIqe1wiICsgcmFkaXhTcGxpdFsxXS5tYXRjaCgvXlxcZCpcXD8/XFxkKi8pWzBdLmxlbmd0aCArIFwifVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBvc3RNYXNrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfShwcm9jZXNzVmFsdWUsIG9wdHMpLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtZXJpY0lucHV0OiAhMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaXRNYXNraW5nOiAhMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZpbml0aW9uczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIipcIjoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBcIlswLTk/XVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZGluYWxpdHk6IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLmZvcm1hdChwcm9jZXNzVmFsdWUuam9pbihcIlwiKSksIGFkZFJhZGl4ICYmIChwcm9jZXNzVmFsdWUgKz0gb3B0cy5yYWRpeFBvaW50KSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzVmFsdWUuY2hhckF0KDApID09PSBvcHRzLmdyb3VwU2VwYXJhdG9yICYmIHByb2Nlc3NWYWx1ZS5zdWJzdHIoMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG9wdHMuaXNOZWdhdGl2ZSAmJiBcImJsdXJcIiA9PT0gY3VycmVudFJlc3VsdC5ldmVudCAmJiAob3B0cy5pc05lZ2F0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yLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJldDogY2FyZXRQb3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBkb3Bvc3Q6ICEwXG4gICAgICAgICAgICAgICAgICAgIH0sIG9wdHMpO1xuXG4gICAgICAgICAgICAgICAgICBjYXNlIFwiYmx1clwiOlxuICAgICAgICAgICAgICAgICAgY2FzZSBcImNoZWNrdmFsXCI6XG4gICAgICAgICAgICAgICAgICAgIHZhciB1bm1hc2tlZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uKG9wdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdHMucGFyc2VNaW5NYXhPcHRpb25zID09PSB1bmRlZmluZWQgJiYgKG51bGwgIT09IG9wdHMubWluICYmIChvcHRzLm1pbiA9IG9wdHMubWluLnRvU3RyaW5nKCkucmVwbGFjZShuZXcgUmVnRXhwKElucHV0bWFzay5lc2NhcGVSZWdleChvcHRzLmdyb3VwU2VwYXJhdG9yKSwgXCJnXCIpLCBcIlwiKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBcIixcIiA9PT0gb3B0cy5yYWRpeFBvaW50ICYmIChvcHRzLm1pbiA9IG9wdHMubWluLnJlcGxhY2Uob3B0cy5yYWRpeFBvaW50LCBcIi5cIikpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdHMubWluID0gaXNGaW5pdGUob3B0cy5taW4pID8gcGFyc2VGbG9hdChvcHRzLm1pbikgOiBOYU4sIGlzTmFOKG9wdHMubWluKSAmJiAob3B0cy5taW4gPSBOdW1iZXIuTUlOX1ZBTFVFKSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCAhPT0gb3B0cy5tYXggJiYgKG9wdHMubWF4ID0gb3B0cy5tYXgudG9TdHJpbmcoKS5yZXBsYWNlKG5ldyBSZWdFeHAoSW5wdXRtYXNrLmVzY2FwZVJlZ2V4KG9wdHMuZ3JvdXBTZXBhcmF0b3IpLCBcImdcIiksIFwiXCIpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiLFwiID09PSBvcHRzLnJhZGl4UG9pbnQgJiYgKG9wdHMubWF4ID0gb3B0cy5tYXgucmVwbGFjZShvcHRzLnJhZGl4UG9pbnQsIFwiLlwiKSksIFxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0cy5tYXggPSBpc0Zpbml0ZShvcHRzLm1heCkgPyBwYXJzZUZsb2F0KG9wdHMubWF4KSA6IE5hTiwgaXNOYU4ob3B0cy5tYXgpICYmIChvcHRzLm1heCA9IE51bWJlci5NQVhfVkFMVUUpKSwgXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRzLnBhcnNlTWluTWF4T3B0aW9ucyA9IFwiZG9uZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgfShvcHRzKSwgbnVsbCAhPT0gb3B0cy5taW4gfHwgbnVsbCAhPT0gb3B0cy5tYXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1bm1hc2tlZCA9IG9wdHMub25Vbk1hc2soYnVmZmVyLmpvaW4oXCJcIiksIHVuZGVmaW5lZCwgJC5leHRlbmQoe30sIG9wdHMsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bm1hc2tBc051bWJlcjogITBcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKSwgbnVsbCAhPT0gb3B0cy5taW4gJiYgdW5tYXNrZWQgPCBvcHRzLm1pbikgcmV0dXJuIG9wdHMuaXNOZWdhdGl2ZSA9IG9wdHMubWluIDwgMCwgXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRzLnBvc3RWYWxpZGF0aW9uKG9wdHMubWluLnRvU3RyaW5nKCkucmVwbGFjZShcIi5cIiwgb3B0cy5yYWRpeFBvaW50KS5zcGxpdChcIlwiKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmV0OiBjYXJldFBvcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3Bvc3Q6ICEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIjBcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0cyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVsbCAhPT0gb3B0cy5tYXggJiYgdW5tYXNrZWQgPiBvcHRzLm1heCkgcmV0dXJuIG9wdHMuaXNOZWdhdGl2ZSA9IG9wdHMubWF4IDwgMCwgXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRzLnBvc3RWYWxpZGF0aW9uKG9wdHMubWF4LnRvU3RyaW5nKCkucmVwbGFjZShcIi5cIiwgb3B0cy5yYWRpeFBvaW50KS5zcGxpdChcIlwiKSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmV0OiBjYXJldFBvcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3Bvc3Q6ICEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIjBcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0cyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdHMucG9zdFZhbGlkYXRpb24oYnVmZmVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXJldDogY2FyZXRQb3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogXCIwXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudDogXCJibHVyXCJcbiAgICAgICAgICAgICAgICAgICAgfSwgb3B0cyk7XG5cbiAgICAgICAgICAgICAgICAgIGNhc2UgXCJfY2hlY2t2YWxcIjpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhcmV0OiBjYXJldFBvc1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICByZWdleDoge1xuICAgICAgICAgICAgICAgIGludGVnZXJQYXJ0OiBmdW5jdGlvbihvcHRzLCBlbXB0eUNoZWNrKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eUNoZWNrID8gbmV3IFJlZ0V4cChcIltcIiArIElucHV0bWFzay5lc2NhcGVSZWdleChvcHRzLm5lZ2F0aW9uU3ltYm9sLmZyb250KSArIFwiK10/XCIpIDogbmV3IFJlZ0V4cChcIltcIiArIElucHV0bWFzay5lc2NhcGVSZWdleChvcHRzLm5lZ2F0aW9uU3ltYm9sLmZyb250KSArIFwiK10/XFxcXGQrXCIpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgaW50ZWdlck5QYXJ0OiBmdW5jdGlvbihvcHRzKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKFwiW1xcXFxkXCIgKyBJbnB1dG1hc2suZXNjYXBlUmVnZXgob3B0cy5ncm91cFNlcGFyYXRvcikgKyBJbnB1dG1hc2suZXNjYXBlUmVnZXgob3B0cy5wbGFjZWhvbGRlci5jaGFyQXQoMCkpICsgXCJdK1wiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZGVmaW5pdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBcIn5cIjoge1xuICAgICAgICAgICAgICAgICAgICB2YWxpZGF0b3I6IGZ1bmN0aW9uKGNocnMsIG1hc2tzZXQsIHBvcywgc3RyaWN0LCBvcHRzLCBpc1NlbGVjdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzVmFsaWQgPSBzdHJpY3QgPyBuZXcgUmVnRXhwKFwiWzAtOVwiICsgSW5wdXRtYXNrLmVzY2FwZVJlZ2V4KG9wdHMuZ3JvdXBTZXBhcmF0b3IpICsgXCJdXCIpLnRlc3QoY2hycykgOiBuZXcgUmVnRXhwKFwiWzAtOV1cIikudGVzdChjaHJzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghMCA9PT0gaXNWYWxpZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghMCAhPT0gb3B0cy5udW1lcmljSW5wdXQgJiYgbWFza3NldC52YWxpZFBvc2l0aW9uc1twb3NdICE9PSB1bmRlZmluZWQgJiYgXCJ+XCIgPT09IG1hc2tzZXQudmFsaWRQb3NpdGlvbnNbcG9zXS5tYXRjaC5kZWYgJiYgIWlzU2VsZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm9jZXNzVmFsdWUgPSBtYXNrc2V0LmJ1ZmZlci5qb2luKFwiXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzVmFsdWUgPSBwcm9jZXNzVmFsdWUucmVwbGFjZShuZXcgUmVnRXhwKFwiWy1cIiArIElucHV0bWFzay5lc2NhcGVSZWdleChvcHRzLm5lZ2F0aW9uU3ltYm9sLmZyb250KSArIFwiXVwiLCBcImdcIiksIFwiXCIpLCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc1ZhbHVlID0gcHJvY2Vzc1ZhbHVlLnJlcGxhY2UobmV3IFJlZ0V4cChJbnB1dG1hc2suZXNjYXBlUmVnZXgob3B0cy5uZWdhdGlvblN5bWJvbC5iYWNrKSArIFwiJFwiKSwgXCJcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdlJhZGl4U3BsaXQgPSBwcm9jZXNzVmFsdWUuc3BsaXQob3B0cy5yYWRpeFBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZSYWRpeFNwbGl0Lmxlbmd0aCA+IDEgJiYgKHB2UmFkaXhTcGxpdFsxXSA9IHB2UmFkaXhTcGxpdFsxXS5yZXBsYWNlKC8wL2csIG9wdHMucGxhY2Vob2xkZXIuY2hhckF0KDApKSksIFx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gICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZTogcG9zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3M6IHBvc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBzdHJpY3QgfHwgY2hycyAhPT0gb3B0cy5yYWRpeFBvaW50IHx8IG1hc2tzZXQudmFsaWRQb3NpdGlvbnNbcG9zIC0gMV0gIT09IHVuZGVmaW5lZCB8fCAobWFza3NldC5idWZmZXJbcG9zXSA9IFwiMFwiLCBcbiAgICAgICAgICAgICAgICAgICAgICAgIGlzVmFsaWQgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zOiBwb3MgKyAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpc1ZhbGlkO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjYXJkaW5hbGl0eTogMVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCIrXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdHMuYWxsb3dNaW51cyAmJiAoXCItXCIgPT09IGNocnMgfHwgY2hycyA9PT0gb3B0cy5uZWdhdGlvblN5bWJvbC5mcm9udCk7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCItXCI6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdHMuYWxsb3dNaW51cyAmJiBjaHJzID09PSBvcHRzLm5lZ2F0aW9uU3ltYm9sLmJhY2s7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogXCJcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgXCI6XCI6IHtcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdG9yOiBmdW5jdGlvbihjaHJzLCBtYXNrc2V0LCBwb3MsIHN0cmljdCwgb3B0cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJhZGl4ID0gXCJbXCIgKyBJbnB1dG1hc2suZXNjYXBlUmVnZXgob3B0cy5yYWRpeFBvaW50KSArIFwiXVwiLCBpc1ZhbGlkID0gbmV3IFJlZ0V4cChyYWRpeCkudGVzdChjaHJzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpc1ZhbGlkICYmIG1hc2tzZXQudmFsaWRQb3NpdGlvbnNbcG9zXSAmJiBtYXNrc2V0LnZhbGlkUG9zaXRpb25zW3Bvc10ubWF0Y2gucGxhY2Vob2xkZXIgPT09IG9wdHMucmFkaXhQb2ludCAmJiAoaXNWYWxpZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJldDogcG9zICsgMVxuICAgICAgICAgICAgICAgICAgICAgICAgfSksIGlzVmFsaWQ7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNhcmRpbmFsaXR5OiAxLFxuICAgICAgICAgICAgICAgICAgICBwb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nYXRpb25TeW1ib2wuZnJvbnQgfHwgdnAuaW5wdXQgPT09IG9wdHMubmVnYXRpb25TeW1ib2wuYmFjaztcbiAgICAgICAgICAgICAgICByZXR1cm4gIWNhbkNsZWFyIHx8IFwiK1wiICE9PSB2cC5tYXRjaC5uYXRpdmVEZWYgJiYgXCItXCIgIT09IHZwLm1hdGNoLm5hdGl2ZURlZiB8fCAob3B0cy5pc05lZ2F0aXZlID0gITEpLCBcbiAgICAgICAgICAgICAgICBjYW5DbGVhcjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvbktleURvd246IGZ1bmN0aW9uKGUsIGJ1ZmZlciwgY2FyZXRQb3MsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgJGlucHV0ID0gJCh0aGlzKTtcbiAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5KSBzd2l0Y2ggKGUua2V5Q29kZSkge1xuICAgICAgICAgICAgICAgICAgY2FzZSBJbnB1dG1hc2sua2V5Q29kZS5VUDpcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnZhbChwYXJzZUZsb2F0KHRoaXMuaW5wdXRtYXNrLnVubWFza2VkdmFsdWUoKSkgKyBwYXJzZUludChvcHRzLnN0ZXApKSwgJGlucHV0LnRyaWdnZXIoXCJzZXR2YWx1ZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgIGNhc2UgSW5wdXRtYXNrLmtleUNvZGUuRE9XTjpcbiAgICAgICAgICAgICAgICAgICAgJGlucHV0LnZhbChwYXJzZUZsb2F0KHRoaXMuaW5wdXRtYXNrLnVubWFza2VkdmFsdWUoKSkgLSBwYXJzZUludChvcHRzLnN0ZXApKSwgJGlucHV0LnRyaWdnZXIoXCJzZXR2YWx1ZVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGN1cnJlbmN5OiB7XG4gICAgICAgICAgICBwcmVmaXg6IFwiJCBcIixcbiAgICAgICAgICAgIGdyb3VwU2VwYXJhdG9yOiBcIixcIixcbiAgICAgICAgICAgIGFsaWFzOiBcIm51bWVyaWNcIixcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyOiBcIjBcIixcbiAgICAgICAgICAgIGF1dG9Hcm91cDogITAsXG4gICAgICAgICAgICBkaWdpdHM6IDIsXG4gICAgICAgICAgICBkaWdpdHNPcHRpb25hbDogITEsXG4gICAgICAgICAgICBjbGVhck1hc2tPbkxvc3RGb2N1czogITFcbiAgICAgICAgfSxcbiAgICAgICAgZGVjaW1hbDoge1xuICAgICAgICAgICAgYWxpYXM6IFwibnVtZXJpY1wiXG4gICAgICAgIH0sXG4gICAgICAgIGludGVnZXI6IHtcbiAgICAgICAgICAgIGFsaWFzOiBcIm51bWVyaWNcIixcbiAgICAgICAgICAgIGRpZ2l0czogMCxcbiAgICAgICAgICAgIHJhZGl4UG9pbnQ6IFwiXCJcbiAgICAgICAgfSxcbiAgICAgICAgcGVyY2VudGFnZToge1xuICAgICAgICAgICAgYWxpYXM6IFwibnVtZXJpY1wiLFxuICAgICAgICAgICAgZGlnaXRzOiAyLFxuICAgICAgICAgICAgZGlnaXRzT3B0aW9uYWw6ICEwLFxuICAgICAgICAgICAgcmFkaXhQb2ludDogXCIuXCIsXG4gICAgICAgICAgICBwbGFjZWhvbGRlcjogXCIwXCIsXG4gICAgICAgICAgICBhdXRvR3JvdXA6ICExLFxuICAgICAgICAgICAgbWluOiAwLFxuICAgICAgICAgICAgbWF4OiAxMDAsXG4gICAgICAgICAgICBzdWZmaXg6IFwiICVcIixcbiAgICAgICAgICAgIGFsbG93TWludXM6ICExXG4gICAgICAgIH1cbiAgICB9KSwgSW5wdXRtYXNrO1xufSk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5udW1lcmljLmV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ==\\n//# sourceURL=webpack-internal:///8\\n\");\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\\n* inputmask.phone.extensions.js\\n* https://github.com/RobinHerbots/Inputmask\\n* Copyright (c) 2010 - 2017 Robin Herbots\\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\\n* Version: 3.3.8\\n*/\\n\\n!function(factory) {\\n true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\\n\\t\\t\\t\\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \\\"object\\\" == typeof exports ? module.exports = factory(require(\\\"./dependencyLibs/inputmask.dependencyLib\\\"), require(\\\"./inputmask\\\")) : factory(window.dependencyLib || jQuery, window.Inputmask);\\n}(function($, Inputmask) {\\n function maskSort(a, b) {\\n var maska = (a.mask || a).replace(/#/g, \\\"9\\\").replace(/\\\\)/, \\\"9\\\").replace(/[+()#-]/g, \\\"\\\"), maskb = (b.mask || b).replace(/#/g, \\\"9\\\").replace(/\\\\)/, \\\"9\\\").replace(/[+()#-]/g, \\\"\\\"), maskas = (a.mask || a).split(\\\"#\\\")[0], maskbs = (b.mask || b).split(\\\"#\\\")[0];\\n return 0 === maskbs.indexOf(maskas) ? -1 : 0 === maskas.indexOf(maskbs) ? 1 : maska.localeCompare(maskb);\\n }\\n var analyseMaskBase = Inputmask.prototype.analyseMask;\\n return Inputmask.prototype.analyseMask = function(mask, regexMask, opts) {\\n function reduceVariations(masks, previousVariation, previousmaskGroup) {\\n previousVariation = previousVariation || \\\"\\\", previousmaskGroup = previousmaskGroup || maskGroups, \\n \\\"\\\" !== previousVariation && (previousmaskGroup[previousVariation] = {});\\n for (var variation = \\\"\\\", maskGroup = previousmaskGroup[previousVariation] || previousmaskGroup, i = masks.length - 1; i >= 0; i--) mask = masks[i].mask || masks[i], \\n variation = mask.substr(0, 1), maskGroup[variation] = maskGroup[variation] || [], \\n maskGroup[variation].unshift(mask.substr(1)), masks.splice(i, 1);\\n for (var ndx in maskGroup) maskGroup[ndx].length > 500 && reduceVariations(maskGroup[ndx].slice(), ndx, maskGroup);\\n }\\n function rebuild(maskGroup) {\\n var mask = \\\"\\\", submasks = [];\\n for (var ndx in maskGroup) $.isArray(maskGroup[ndx]) ? 1 === maskGroup[ndx].length ? submasks.push(ndx + maskGroup[ndx]) : submasks.push(ndx + opts.groupmarker.start + maskGroup[ndx].join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end) : submasks.push(ndx + rebuild(maskGroup[ndx]));\\n return 1 === submasks.length ? mask += submasks[0] : mask += opts.groupmarker.start + submasks.join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end, \\n mask;\\n }\\n var maskGroups = {};\\n return opts.phoneCodes && (opts.phoneCodes && opts.phoneCodes.length > 1e3 && (mask = mask.substr(1, mask.length - 2), \\n reduceVariations(mask.split(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start)), \\n mask = rebuild(maskGroups)), mask = mask.replace(/9/g, \\\"\\\\\\\\9\\\")), analyseMaskBase.call(this, mask, regexMask, opts);\\n }, Inputmask.extendAliases({\\n abstractphone: {\\n groupmarker: {\\n start: \\\"<\\\",\\n end: \\\">\\\"\\n },\\n countrycode: \\\"\\\",\\n phoneCodes: [],\\n mask: function(opts) {\\n return opts.definitions = {\\n \\\"#\\\": Inputmask.prototype.definitions[9]\\n }, opts.phoneCodes.sort(maskSort);\\n },\\n keepStatic: !0,\\n onBeforeMask: function(value, opts) {\\n var processedValue = value.replace(/^0{1,2}/, \\\"\\\").replace(/[\\\\s]/g, \\\"\\\");\\n return (processedValue.indexOf(opts.countrycode) > 1 || -1 === processedValue.indexOf(opts.countrycode)) && (processedValue = \\\"+\\\" + opts.countrycode + processedValue), \\n processedValue;\\n },\\n onUnMask: function(maskedValue, unmaskedValue, opts) {\\n return maskedValue.replace(/[()#-]/g, \\\"\\\");\\n },\\n inputmode: \\\"tel\\\"\\n }\\n }), Inputmask;\\n});\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvaW5wdXRtYXNrL2Rpc3QvaW5wdXRtYXNrL2lucHV0bWFzay5waG9uZS5leHRlbnNpb25zLmpzP2ZhYTIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUFBO0FBQUE7QUFBQTtBQUNBLENBQUM7QUFDRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esa0ZBQWtGO0FBQ2xGLGlJQUFpSSxRQUFRO0FBQ3pJO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQSxhQUFhO0FBQ2I7QUFDQT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AgIGdyb3VwbWFya2VyOiB7XG4gICAgICAgICAgICAgICAgc3RhcnQ6IFwiPFwiLFxuICAgICAgICAgICAgICAgIGVuZDogXCI+XCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb3VudHJ5Y29kZTogXCJcIixcbiAgICAgICAgICAgIHBob25lQ29kZXM6IFtdLFxuICAgICAgICAgICAgbWFzazogZnVuY3Rpb24ob3B0cykge1xuICAgICAgICAgICAgICAgIHJldHVybiBvcHRzLmRlZmluaXRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICBcIiNcIjogSW5wdXRtYXNrLnByb3RvdHlwZS5kZWZpbml0aW9uc1s5XVxuICAgICAgICAgICAgICAgIH0sIG9wdHMucGhvbmVDb2Rlcy5zb3J0KG1hc2tTb3J0KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBrZWVwU3RhdGljOiAhMCxcbiAgICAgICAgICAgIG9uQmVmb3JlTWFzazogZnVuY3Rpb24odmFsdWUsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJvY2Vzc2VkVmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9eMHsxLDJ9LywgXCJcIikucmVwbGFjZSgvW1xcc10vZywgXCJcIik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChwcm9jZXNzZWRWYWx1ZS5pbmRleE9mKG9wdHMuY291bnRyeWNvZGUpID4gMSB8fCAtMSA9PT0gcHJvY2Vzc2VkVmFsdWUuaW5kZXhPZihvcHRzLmNvdW50cnljb2RlKSkgJiYgKHByb2Nlc3NlZFZhbHVlID0gXCIrXCIgKyBvcHRzLmNvdW50cnljb2RlICsgcHJvY2Vzc2VkVmFsdWUpLCBcbiAgICAgICAgICAgICAgICBwcm9jZXNzZWRWYWx1ZTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvblVuTWFzazogZnVuY3Rpb24obWFza2VkVmFsdWUsIHVubWFza2VkVmFsdWUsIG9wdHMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbWFza2VkVmFsdWUucmVwbGFjZSgvWygpIy1dL2csIFwiXCIpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlucHV0bW9kZTogXCJ0ZWxcIlxuICAgICAgICB9XG4gICAgfSksIElucHV0bWFzaztcbn0pO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2lucHV0bWFzay9kaXN0L2lucHV0bWFzay9pbnB1dG1hc2sucGhvbmUuZXh0ZW5zaW9ucy5qc1xuLy8gbW9kdWxlIGlkID0gOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwic291cmNlUm9vdCI6IiJ9\\n//# sourceURL=webpack-internal:///9\\n\");\n\n/***/ })\n/******/ ]);","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isContentEmpty)?_c('div',[(_vm.isHtml)?_c('div',{staticClass:\"information-label\"},[_c('div',{domProps:{\"innerHTML\":_vm._s(_vm.$t(_vm.contentKey))}})]):_c('div',{staticClass:\"information-label\"},[_c('p',[_vm._v(_vm._s(_vm.$t(_vm.contentKey)))])])]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Component, Prop, Vue } from 'vue-property-decorator';\r\n\r\n@Component\r\nexport default class InformationBlock extends Vue {\r\n @Prop({ default: false }) public isHtml?: boolean;\r\n @Prop({ required: true }) public contentKey!: string;\r\n\r\n public get isContentEmpty(): boolean {\r\n const translation = this.$t(this.contentKey).toString();\r\n return (translation === '' || translation === this.contentKey) ? true : false;\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!./InformationBlock.ts?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!./InformationBlock.ts?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./InformationBlock.vue?vue&type=template&id=270beb42&scoped=true&\"\nimport script from \"./InformationBlock.ts?vue&type=script&lang=ts&\"\nexport * from \"./InformationBlock.ts?vue&type=script&lang=ts&\"\nimport style0 from \"./InformationBlock.scss?vue&type=style&index=0&id=270beb42&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"270beb42\",\n null\n \n)\n\nexport default component.exports","/*!\n* inputmask.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (typeof define === \"function\" && define.amd) {\n define([ \"./dependencyLibs/inputmask.dependencyLib\", \"./global/window\" ], factory);\n } else if (typeof exports === \"object\") {\n module.exports = factory(require(\"./dependencyLibs/inputmask.dependencyLib\"), require(\"./global/window\"));\n } else {\n window.Inputmask = factory(window.dependencyLib || jQuery, window);\n }\n})(function($, window, undefined) {\n 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;\n function Inputmask(alias, options, internal) {\n if (!(this instanceof Inputmask)) {\n return new Inputmask(alias, options, internal);\n }\n this.el = undefined;\n this.events = {};\n this.maskset = undefined;\n this.refreshValue = false;\n if (internal !== true) {\n if ($.isPlainObject(alias)) {\n options = alias;\n } else {\n options = options || {};\n if (alias) options.alias = alias;\n }\n this.opts = $.extend(true, {}, this.defaults, options);\n this.noMasksCache = options && options.definitions !== undefined;\n this.userOptions = options || {};\n this.isRTL = this.opts.numericInput;\n resolveAlias(this.opts.alias, options, this.opts);\n }\n }\n Inputmask.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: {\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: $.noop,\n onincomplete: $.noop,\n oncleared: $.noop,\n repeat: 0,\n greedy: false,\n autoUnmask: false,\n removeMaskOnSubmit: false,\n clearMaskOnLostFocus: true,\n insertMode: true,\n clearIncomplete: false,\n alias: null,\n onKeyDown: $.noop,\n onBeforeMask: null,\n onBeforePaste: function(pastedValue, opts) {\n return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: true,\n showMaskOnHover: true,\n onKeyValidation: $.noop,\n skipOptionalPartCharacter: \" \",\n numericInput: false,\n rightAlign: false,\n undoOnEscape: true,\n radixPoint: \"\",\n _radixDance: false,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: true,\n tabThrough: false,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n 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 ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: undefined,\n jitMasking: false,\n nullable: true,\n inputEventOnly: false,\n noValuePatching: false,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"verbatim\",\n colorMask: false,\n disablePredictiveText: false,\n importDataAttributes: true,\n shiftPositions: true\n },\n definitions: {\n 9: {\n validator: \"[0-9\\uff11-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n },\n aliases: {},\n masksCache: {},\n mask: function(elems) {\n var that = this;\n function importAttributeOptions(npt, opts, userOptions, dataAttribute) {\n if (opts.importDataAttributes === true) {\n var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;\n var importOption = function(option, optionData) {\n optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + \"-\" + option);\n if (optionData !== null) {\n if (typeof optionData === \"string\") {\n if (option.indexOf(\"on\") === 0) optionData = window[optionData]; else if (optionData === \"false\") optionData = false; else if (optionData === \"true\") optionData = true;\n }\n userOptions[option] = optionData;\n }\n };\n if (attrOptions && attrOptions !== \"\") {\n attrOptions = attrOptions.replace(/'/g, '\"');\n dataoptions = JSON.parse(\"{\" + attrOptions + \"}\");\n }\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === \"alias\") {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(\"alias\", optionData);\n if (userOptions.alias) {\n resolveAlias(userOptions.alias, userOptions, opts);\n }\n for (option in opts) {\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === option.toLowerCase()) {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(option, optionData);\n }\n }\n $.extend(true, opts, userOptions);\n if (npt.dir === \"rtl\" || opts.rightAlign) {\n npt.style.textAlign = \"right\";\n }\n if (npt.dir === \"rtl\" || opts.numericInput) {\n npt.dir = \"ltr\";\n npt.removeAttribute(\"dir\");\n opts.isRTL = true;\n }\n return Object.keys(userOptions).length;\n }\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n var scopedOpts = $.extend(true, {}, that.opts);\n if (importAttributeOptions(el, scopedOpts, $.extend(true, {}, that.userOptions), that.dataAttribute)) {\n var maskset = generateMaskSet(scopedOpts, that.noMasksCache);\n if (maskset !== undefined) {\n if (el.inputmask !== undefined) {\n el.inputmask.opts.autoUnmask = true;\n el.inputmask.remove();\n }\n el.inputmask = new Inputmask(undefined, undefined, true);\n el.inputmask.opts = scopedOpts;\n el.inputmask.noMasksCache = that.noMasksCache;\n el.inputmask.userOptions = $.extend(true, {}, that.userOptions);\n el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput;\n el.inputmask.el = el;\n el.inputmask.maskset = maskset;\n $.data(el, \"_inputmask_opts\", scopedOpts);\n maskScope.call(el.inputmask, {\n action: \"mask\"\n });\n }\n }\n });\n return elems && elems[0] ? elems[0].inputmask || this : this;\n },\n option: function(options, noremask) {\n if (typeof options === \"string\") {\n return this.opts[options];\n } else if (typeof options === \"object\") {\n $.extend(this.userOptions, options);\n if (this.el && noremask !== true) {\n this.mask(this.el);\n }\n return this;\n }\n },\n unmaskedvalue: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"unmaskedvalue\",\n value: value\n });\n },\n remove: function() {\n return maskScope.call(this, {\n action: \"remove\"\n });\n },\n getemptymask: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getemptymask\"\n });\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isComplete\"\n });\n },\n getmetadata: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getmetadata\"\n });\n },\n isValid: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isValid\",\n value: value\n });\n },\n format: function(value, metadata) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"format\",\n value: value,\n metadata: metadata\n });\n },\n setValue: function(value) {\n if (this.el) {\n $(this.el).trigger(\"setvalue\", [ value ]);\n }\n },\n analyseMask: function(mask, regexMask, opts) {\n 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;\n function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {\n this.matches = [];\n this.openGroup = isGroup || false;\n this.alternatorGroup = false;\n this.isGroup = isGroup || false;\n this.isOptional = isOptional || false;\n this.isQuantifier = isQuantifier || false;\n this.isAlternator = isAlternator || false;\n this.quantifier = {\n min: 1,\n max: 1\n };\n }\n function insertTestDefinition(mtoken, element, position) {\n position = position !== undefined ? position : mtoken.matches.length;\n var prevMatch = mtoken.matches[position - 1];\n if (regexMask) {\n if (element.indexOf(\"[\") === 0 || escaped && /\\\\d|\\\\s|\\\\w]/i.test(element) || element === \".\") {\n mtoken.matches.splice(position++, 0, {\n fn: new RegExp(element, opts.casing ? \"i\" : \"\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element,\n casing: null,\n def: element,\n placeholder: undefined,\n nativeDef: element\n });\n } else {\n if (escaped) element = element[element.length - 1];\n $.each(element.split(\"\"), function(ndx, lmnt) {\n prevMatch = mtoken.matches[position - 1];\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== lmnt && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || lmnt,\n placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + lmnt\n });\n });\n }\n escaped = false;\n } else {\n var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];\n if (maskdef && !escaped) {\n mtoken.matches.splice(position++, 0, {\n fn: maskdef.validator ? typeof maskdef.validator == \"string\" ? new RegExp(maskdef.validator, opts.casing ? \"i\" : \"\") : new function() {\n this.test = maskdef.validator;\n }() : new RegExp(\".\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== (maskdef.definitionSymbol || element),\n casing: maskdef.casing,\n def: maskdef.definitionSymbol || element,\n placeholder: maskdef.placeholder,\n nativeDef: element\n });\n } else {\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || element,\n placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + element\n });\n escaped = false;\n }\n }\n }\n function verifyGroupMarker(maskToken) {\n if (maskToken && maskToken.matches) {\n $.each(maskToken.matches, function(ndx, token) {\n var nextToken = maskToken.matches[ndx + 1];\n if ((nextToken === undefined || (nextToken.matches === undefined || nextToken.isQuantifier === false)) && token && token.isGroup) {\n token.isGroup = false;\n if (!regexMask) {\n insertTestDefinition(token, opts.groupmarker[0], 0);\n if (token.openGroup !== true) {\n insertTestDefinition(token, opts.groupmarker[1]);\n }\n }\n }\n verifyGroupMarker(token);\n });\n }\n }\n function defaultCase() {\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n insertTestDefinition(currentOpeningToken, m);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n if (alternator.matches[mndx].isGroup) alternator.matches[mndx].isGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n insertTestDefinition(currentToken, m);\n }\n }\n function reverseTokens(maskToken) {\n function reverseStatic(st) {\n 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];\n return st;\n }\n maskToken.matches = maskToken.matches.reverse();\n for (var match in maskToken.matches) {\n if (maskToken.matches.hasOwnProperty(match)) {\n var intMatch = parseInt(match);\n if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {\n var qt = maskToken.matches[match];\n maskToken.matches.splice(match, 1);\n maskToken.matches.splice(intMatch + 1, 0, qt);\n }\n if (maskToken.matches[match].matches !== undefined) {\n maskToken.matches[match] = reverseTokens(maskToken.matches[match]);\n } else {\n maskToken.matches[match] = reverseStatic(maskToken.matches[match]);\n }\n }\n }\n return maskToken;\n }\n function groupify(matches) {\n var groupToken = new MaskToken(true);\n groupToken.openGroup = false;\n groupToken.matches = matches;\n return groupToken;\n }\n if (regexMask) {\n opts.optionalmarker[0] = undefined;\n opts.optionalmarker[1] = undefined;\n }\n while (match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask)) {\n m = match[0];\n if (regexMask) {\n switch (m.charAt(0)) {\n case \"?\":\n m = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n m = \"{\" + m + \"}\";\n break;\n }\n }\n if (escaped) {\n defaultCase();\n continue;\n }\n switch (m.charAt(0)) {\n case \"(?=\":\n break;\n\n case \"(?!\":\n break;\n\n case \"(?<=\":\n break;\n\n case \"(? 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(openingToken);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n alternator.matches[mndx].isGroup = false;\n alternator.matches[mndx].alternatorGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n currentToken.matches.push(openingToken);\n }\n } else defaultCase();\n break;\n\n case opts.optionalmarker[0]:\n openenings.push(new MaskToken(false, true));\n break;\n\n case opts.groupmarker[0]:\n openenings.push(new MaskToken(true));\n break;\n\n case opts.quantifiermarker[0]:\n var quantifier = new MaskToken(false, false, true);\n m = m.replace(/[{}]/g, \"\");\n 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]);\n if (mq0 === \"*\" || mq0 === \"+\") {\n mq0 = mq1 === \"*\" ? 0 : 1;\n }\n quantifier.quantifier = {\n min: mq0,\n max: mq1,\n jit: mqj[1]\n };\n var matches = openenings.length > 0 ? openenings[openenings.length - 1].matches : currentToken.matches;\n match = matches.pop();\n if (match.isAlternator) {\n matches.push(match);\n matches = match.matches;\n var groupToken = new MaskToken(true);\n var tmpMatch = matches.pop();\n matches.push(groupToken);\n matches = groupToken.matches;\n match = tmpMatch;\n }\n if (!match.isGroup) {\n match = groupify([ match ]);\n }\n matches.push(match);\n matches.push(quantifier);\n break;\n\n case opts.alternatormarker:\n var groupQuantifier = function(matches) {\n var lastMatch = matches.pop();\n if (lastMatch.isQuantifier) {\n lastMatch = groupify([ matches.pop(), lastMatch ]);\n }\n return lastMatch;\n };\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];\n if (currentOpeningToken.openGroup && (subToken.matches === undefined || subToken.isGroup === false && subToken.isAlternator === false)) {\n lastMatch = openenings.pop();\n } else {\n lastMatch = groupQuantifier(currentOpeningToken.matches);\n }\n } else {\n lastMatch = groupQuantifier(currentToken.matches);\n }\n if (lastMatch.isAlternator) {\n openenings.push(lastMatch);\n } else {\n if (lastMatch.alternatorGroup) {\n alternator = openenings.pop();\n lastMatch.alternatorGroup = false;\n } else {\n alternator = new MaskToken(false, false, false, true);\n }\n alternator.matches.push(lastMatch);\n openenings.push(alternator);\n if (lastMatch.openGroup) {\n lastMatch.openGroup = false;\n var alternatorGroup = new MaskToken(true);\n alternatorGroup.alternatorGroup = true;\n openenings.push(alternatorGroup);\n }\n }\n break;\n\n default:\n defaultCase();\n }\n }\n while (openenings.length > 0) {\n openingToken = openenings.pop();\n currentToken.matches.push(openingToken);\n }\n if (currentToken.matches.length > 0) {\n verifyGroupMarker(currentToken);\n maskTokens.push(currentToken);\n }\n if (opts.numericInput || opts.isRTL) {\n reverseTokens(maskTokens[0]);\n }\n return maskTokens;\n },\n positionColorMask: function(input, template) {\n input.style.left = template.offsetLeft + \"px\";\n }\n };\n Inputmask.extendDefaults = function(options) {\n $.extend(true, Inputmask.prototype.defaults, options);\n };\n Inputmask.extendDefinitions = function(definition) {\n $.extend(true, Inputmask.prototype.definitions, definition);\n };\n Inputmask.extendAliases = function(alias) {\n $.extend(true, Inputmask.prototype.aliases, alias);\n };\n Inputmask.format = function(value, options, metadata) {\n return Inputmask(options).format(value, metadata);\n };\n Inputmask.unmask = function(value, options) {\n return Inputmask(options).unmaskedvalue(value);\n };\n Inputmask.isValid = function(value, options) {\n return Inputmask(options).isValid(value);\n };\n Inputmask.remove = function(elems) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.remove();\n });\n };\n Inputmask.setValue = function(elems, value) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.setValue(value); else $(el).trigger(\"setvalue\", [ value ]);\n });\n };\n Inputmask.escapeRegex = function(str) {\n var specials = [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ];\n return str.replace(new RegExp(\"(\\\\\" + specials.join(\"|\\\\\") + \")\", \"gim\"), \"\\\\$1\");\n };\n Inputmask.keyCode = {\n BACKSPACE: 8,\n BACKSPACE_SAFARI: 127,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n INSERT: 45,\n LEFT: 37,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n X: 88,\n CONTROL: 17\n };\n Inputmask.dependencyLib = $;\n function resolveAlias(aliasStr, options, opts) {\n var aliasDefinition = Inputmask.prototype.aliases[aliasStr];\n if (aliasDefinition) {\n if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts);\n $.extend(true, opts, aliasDefinition);\n $.extend(true, opts, options);\n return true;\n } else if (opts.mask === null) {\n opts.mask = aliasStr;\n }\n return false;\n }\n function generateMaskSet(opts, nocache) {\n function generateMask(mask, metadata, opts) {\n var regexMask = false;\n if (mask === null || mask === \"\") {\n regexMask = opts.regex !== null;\n if (regexMask) {\n mask = opts.regex;\n mask = mask.replace(/^(\\^)(.*)(\\$)$/, \"$2\");\n } else {\n regexMask = true;\n mask = \".*\";\n }\n }\n if (mask.length === 1 && opts.greedy === false && opts.repeat !== 0) {\n opts.placeholder = \"\";\n }\n if (opts.repeat > 0 || opts.repeat === \"*\" || opts.repeat === \"+\") {\n var repeatStart = opts.repeat === \"*\" ? 0 : opts.repeat === \"+\" ? 1 : opts.repeat;\n mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + \",\" + opts.repeat + opts.quantifiermarker[1];\n }\n var masksetDefinition, maskdefKey = regexMask ? \"regex_\" + opts.regex : opts.numericInput ? mask.split(\"\").reverse().join(\"\") : mask;\n if (Inputmask.prototype.masksCache[maskdefKey] === undefined || nocache === true) {\n masksetDefinition = {\n mask: mask,\n maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),\n validPositions: {},\n _buffer: undefined,\n buffer: undefined,\n tests: {},\n excludes: {},\n metadata: metadata,\n maskLength: undefined,\n jitOffset: {}\n };\n if (nocache !== true) {\n Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition;\n masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n }\n } else masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n return masksetDefinition;\n }\n var ms;\n if ($.isFunction(opts.mask)) {\n opts.mask = opts.mask(opts);\n }\n if ($.isArray(opts.mask)) {\n if (opts.mask.length > 1) {\n if (opts.keepStatic === null) {\n opts.keepStatic = \"auto\";\n for (var i = 0; i < opts.mask.length; i++) {\n if (opts.mask[i].charAt(0) !== opts.mask[0].charAt(0)) {\n opts.keepStatic = true;\n break;\n }\n }\n }\n var altMask = opts.groupmarker[0];\n $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) {\n if (altMask.length > 1) {\n altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0];\n }\n if (msk.mask !== undefined && !$.isFunction(msk.mask)) {\n altMask += msk.mask;\n } else {\n altMask += msk;\n }\n });\n altMask += opts.groupmarker[1];\n return generateMask(altMask, opts.mask, opts);\n } else opts.mask = opts.mask.pop();\n }\n if (opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask)) {\n ms = generateMask(opts.mask.mask, opts.mask, opts);\n } else {\n ms = generateMask(opts.mask, opts.mask, opts);\n }\n return ms;\n }\n function isInputEventSupported(eventName) {\n var el = document.createElement(\"input\"), evName = \"on\" + eventName, isSupported = evName in el;\n if (!isSupported) {\n el.setAttribute(evName, \"return;\");\n isSupported = typeof el[evName] === \"function\";\n }\n el = null;\n return isSupported;\n }\n function maskScope(actionObj, maskset, opts) {\n maskset = maskset || this.maskset;\n opts = opts || this.opts;\n var inputmask = this, el = this.el, isRTL = this.isRTL, undoValue, $el, skipKeyPressEvent = false, skipInputEvent = false, ignorable = false, maxLength, mouseEnter = false, colorMask, originalPlaceholder;\n var getMaskTemplate = function(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {\n var greedy = opts.greedy;\n if (clearOptionalTail) opts.greedy = false;\n minimalPos = minimalPos || 0;\n var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, lvp = getLastValidPosition();\n do {\n if (baseOnInput === true && getMaskSet().validPositions[pos]) {\n 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];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n maskTemplate.push(includeMode === true ? testPos.input : includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n var jitMasking = noJit === true ? false : opts.jitMasking !== false ? opts.jitMasking : test.jit;\n if (jitMasking === false || jitMasking === undefined || typeof jitMasking === \"number\" && isFinite(jitMasking) && jitMasking > pos) {\n maskTemplate.push(includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n }\n }\n if (opts.keepStatic === \"auto\") {\n if (test.newBlockMarker && test.fn !== null) {\n opts.keepStatic = pos - 1;\n }\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || minimalPos > pos);\n if (maskTemplate[maskTemplate.length - 1] === \"\") {\n maskTemplate.pop();\n }\n if (includeMode !== false || getMaskSet().maskLength === undefined) getMaskSet().maskLength = pos - 1;\n opts.greedy = greedy;\n return maskTemplate;\n };\n function getMaskSet() {\n return maskset;\n }\n function resetMaskSet(soft) {\n var maskset = getMaskSet();\n maskset.buffer = undefined;\n if (soft !== true) {\n maskset.validPositions = {};\n maskset.p = 0;\n }\n }\n function getLastValidPosition(closestTo, strict, validPositions) {\n var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;\n if (closestTo === undefined) closestTo = -1;\n for (var posNdx in valids) {\n var psNdx = parseInt(posNdx);\n if (valids[psNdx] && (strict || valids[psNdx].generatedInput !== true)) {\n if (psNdx <= closestTo) before = psNdx;\n if (psNdx >= closestTo) after = psNdx;\n }\n }\n return before === -1 || before == closestTo ? after : after == -1 ? before : closestTo - before < after - closestTo ? before : after;\n }\n function getDecisionTaker(tst) {\n var decisionTaker = tst.locator[tst.alternation];\n if (typeof decisionTaker == \"string\" && decisionTaker.length > 0) {\n decisionTaker = decisionTaker.split(\",\")[0];\n }\n return decisionTaker !== undefined ? decisionTaker.toString() : \"\";\n }\n function getLocator(tst, align) {\n var locator = (tst.alternation != undefined ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join(\"\");\n if (locator !== \"\") while (locator.length < align) locator += \"0\";\n return locator;\n }\n function determineTestTemplate(pos, tests) {\n pos = pos > 0 ? pos - 1 : 0;\n var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch;\n for (var ndx = 0; ndx < tests.length; ndx++) {\n var tst = tests[ndx];\n tstLocator = getLocator(tst, targetLocator.length);\n var distance = Math.abs(tstLocator - targetLocator);\n 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) {\n closest = distance;\n bestMatch = tst;\n }\n }\n return bestMatch;\n }\n function getTestTemplate(pos, ndxIntlzr, tstPs) {\n return getMaskSet().validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));\n }\n function getTest(pos, tests) {\n if (getMaskSet().validPositions[pos]) {\n return getMaskSet().validPositions[pos];\n }\n return (tests || getTests(pos))[0];\n }\n function positionCanMatchDefinition(pos, def) {\n var valid = false, tests = getTests(pos);\n for (var tndx = 0; tndx < tests.length; tndx++) {\n if (tests[tndx].match && tests[tndx].match.def === def) {\n valid = true;\n break;\n }\n }\n return valid;\n }\n function getTests(pos, ndxIntlzr, tstPs) {\n var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = false, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join(\"\") : \"\";\n function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {\n function handleMatch(match, loopNdx, quantifierRecurse) {\n function isFirstMatch(latestMatch, tokenGroup) {\n var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;\n if (!firstMatch) {\n $.each(tokenGroup.matches, function(ndx, match) {\n if (match.isQuantifier === true) firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]); else if (match.hasOwnProperty(\"matches\")) firstMatch = isFirstMatch(latestMatch, match);\n if (firstMatch) return false;\n });\n }\n return firstMatch;\n }\n function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {\n var bestMatch, indexPos;\n if (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) {\n $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {\n if (lmnt.mloc[alternateNdx]) {\n bestMatch = lmnt;\n return false;\n }\n var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;\n if ((indexPos === undefined || ndxPos < indexPos) && ndxPos !== -1) {\n bestMatch = lmnt;\n indexPos = ndxPos;\n }\n });\n }\n if (bestMatch) {\n var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation];\n var locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator;\n return locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1);\n } else {\n return targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;\n }\n }\n function isSubsetOf(source, target) {\n function expand(pattern) {\n var expanded = [], start, end;\n for (var i = 0, l = pattern.length; i < l; i++) {\n if (pattern.charAt(i) === \"-\") {\n end = pattern.charCodeAt(i + 1);\n while (++start < end) expanded.push(String.fromCharCode(start));\n } else {\n start = pattern.charCodeAt(i);\n expanded.push(pattern.charAt(i));\n }\n }\n return expanded.join(\"\");\n }\n if (opts.regex && source.match.fn !== null && target.match.fn !== null) {\n return expand(target.match.def.replace(/[\\[\\]]/g, \"\")).indexOf(expand(source.match.def.replace(/[\\[\\]]/g, \"\"))) !== -1;\n }\n return source.match.def === target.match.nativeDef;\n }\n function staticCanMatchDefinition(source, target) {\n var sloc = source.locator.slice(source.alternation).join(\"\"), tloc = target.locator.slice(target.alternation).join(\"\"), canMatch = sloc == tloc;\n canMatch = canMatch && source.match.fn === null && target.match.fn !== null ? target.match.fn.test(source.match.def, getMaskSet(), pos, false, opts, false) : false;\n return canMatch;\n }\n function setMergeLocators(targetMatch, altMatch) {\n if (altMatch === undefined || targetMatch.alternation === altMatch.alternation && targetMatch.locator[targetMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {\n targetMatch.mloc = targetMatch.mloc || {};\n var locNdx = targetMatch.locator[targetMatch.alternation];\n if (locNdx === undefined) targetMatch.alternation = undefined; else {\n if (typeof locNdx === \"string\") locNdx = locNdx.split(\",\")[0];\n if (targetMatch.mloc[locNdx] === undefined) targetMatch.mloc[locNdx] = targetMatch.locator.slice();\n if (altMatch !== undefined) {\n for (var ndx in altMatch.mloc) {\n if (typeof ndx === \"string\") ndx = ndx.split(\",\")[0];\n if (targetMatch.mloc[ndx] === undefined) targetMatch.mloc[ndx] = altMatch.mloc[ndx];\n }\n targetMatch.locator[targetMatch.alternation] = Object.keys(targetMatch.mloc).join(\",\");\n }\n return true;\n }\n }\n return false;\n }\n if (testPos > 500 && quantifierRecurse !== undefined) {\n 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;\n }\n if (testPos === pos && match.matches === undefined) {\n matches.push({\n match: match,\n locator: loopNdx.reverse(),\n cd: cacheDependency,\n mloc: {}\n });\n return true;\n } else if (match.matches !== undefined) {\n if (match.isGroup && quantifierRecurse !== match) {\n match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);\n if (match) return true;\n } else if (match.isOptional) {\n var optionalToken = match;\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) {\n $.each(matches, function(ndx, mtch) {\n mtch.match.optionality = true;\n });\n latestMatch = matches[matches.length - 1].match;\n if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) {\n insertStop = true;\n testPos = pos;\n } else return true;\n }\n } else if (match.isAlternator) {\n var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length;\n var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n if (altIndex === -1 || typeof altIndex === \"string\") {\n var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx;\n if (typeof altIndex == \"string\") {\n altIndexArr = altIndex.split(\",\");\n } else {\n for (amndx = 0; amndx < alternateToken.matches.length; amndx++) {\n altIndexArr.push(amndx.toString());\n }\n }\n if (getMaskSet().excludes[pos]) {\n var altIndexArrClone = altIndexArr.slice();\n for (var i = 0, el = getMaskSet().excludes[pos].length; i < el; i++) {\n altIndexArr.splice(altIndexArr.indexOf(getMaskSet().excludes[pos][i].toString()), 1);\n }\n if (altIndexArr.length === 0) {\n getMaskSet().excludes[pos] = undefined;\n altIndexArr = altIndexArrClone;\n }\n }\n if (opts.keepStatic === true || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) altIndexArr = altIndexArr.slice(0, 1);\n var unMatchedAlternation = false;\n for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n amndx = parseInt(altIndexArr[ndx]);\n matches = [];\n ndxInitializer = typeof altIndex === \"string\" ? resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice() : ndxInitializerClone.slice();\n if (alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse)) match = true; else if (ndx === 0) {\n unMatchedAlternation = true;\n }\n maltMatches = matches.slice();\n testPos = currentPos;\n matches = [];\n for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n var altMatch = maltMatches[ndx1], dropMatch = false;\n altMatch.match.jit = altMatch.match.jit || unMatchedAlternation;\n altMatch.alternation = altMatch.alternation || loopNdxCnt;\n setMergeLocators(altMatch);\n for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n var altMatch2 = malternateMatches[ndx2];\n if (typeof altIndex !== \"string\" || altMatch.alternation !== undefined && $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1) {\n if (altMatch.match.nativeDef === altMatch2.match.nativeDef) {\n dropMatch = true;\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (isSubsetOf(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n } else if (isSubsetOf(altMatch2, altMatch)) {\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (staticCanMatchDefinition(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n }\n }\n }\n if (!dropMatch) {\n malternateMatches.push(altMatch);\n }\n }\n }\n matches = currentMatches.concat(malternateMatches);\n testPos = pos;\n insertStop = matches.length > 0;\n match = malternateMatches.length > 0;\n ndxInitializer = ndxInitializerClone.slice();\n } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);\n if (match) return true;\n } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {\n var qt = match;\n for (var qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {\n var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup);\n if (match) {\n latestMatch = matches[matches.length - 1].match;\n latestMatch.optionalQuantifier = qndx >= qt.quantifier.min;\n latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit;\n if (latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) {\n insertStop = true;\n testPos = pos;\n break;\n }\n if (latestMatch.jit) {\n getMaskSet().jitOffset[pos] = tokenGroup.matches.indexOf(latestMatch);\n }\n return true;\n }\n }\n } else {\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) return true;\n }\n } else {\n testPos++;\n }\n }\n for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) {\n if (maskToken.matches[tndx].isQuantifier !== true) {\n var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);\n if (match && testPos === pos) {\n return match;\n } else if (testPos > pos) {\n break;\n }\n }\n }\n }\n function mergeLocators(pos, tests) {\n var locator = [];\n if (!$.isArray(tests)) tests = [ tests ];\n if (tests.length > 0) {\n if (tests[0].alternation === undefined) {\n locator = determineTestTemplate(pos, tests.slice()).locator.slice();\n if (locator.length === 0) locator = tests[0].locator.slice();\n } else {\n $.each(tests, function(ndx, tst) {\n if (tst.def !== \"\") {\n if (locator.length === 0) locator = tst.locator.slice(); else {\n for (var i = 0; i < locator.length; i++) {\n if (tst.locator[i] && locator[i].toString().indexOf(tst.locator[i]) === -1) {\n locator[i] += \",\" + tst.locator[i];\n }\n }\n }\n }\n });\n }\n }\n return locator;\n }\n if (pos > -1) {\n if (ndxIntlzr === undefined) {\n var previousPos = pos - 1, test;\n while ((test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1) {\n previousPos--;\n }\n if (test !== undefined && previousPos > -1) {\n ndxInitializer = mergeLocators(previousPos, test);\n cacheDependency = ndxInitializer.join(\"\");\n testPos = previousPos;\n }\n }\n if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) {\n return getMaskSet().tests[pos];\n }\n for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {\n var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);\n if (match && testPos === pos || testPos > pos) {\n break;\n }\n }\n }\n if (matches.length === 0 || insertStop) {\n matches.push({\n match: {\n fn: null,\n optionality: false,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n mloc: {},\n cd: cacheDependency\n });\n }\n if (ndxIntlzr !== undefined && getMaskSet().tests[pos]) {\n return $.extend(true, [], matches);\n }\n getMaskSet().tests[pos] = $.extend(true, [], matches);\n return getMaskSet().tests[pos];\n }\n function getBufferTemplate() {\n if (getMaskSet()._buffer === undefined) {\n getMaskSet()._buffer = getMaskTemplate(false, 1);\n if (getMaskSet().buffer === undefined) getMaskSet().buffer = getMaskSet()._buffer.slice();\n }\n return getMaskSet()._buffer;\n }\n function getBuffer(noCache) {\n if (getMaskSet().buffer === undefined || noCache === true) {\n getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);\n if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();\n }\n return getMaskSet().buffer;\n }\n function refreshFromBuffer(start, end, buffer) {\n var i, p;\n if (start === true) {\n resetMaskSet();\n start = 0;\n end = buffer.length;\n } else {\n for (i = start; i < end; i++) {\n delete getMaskSet().validPositions[i];\n }\n }\n p = start;\n for (i = start; i < end; i++) {\n resetMaskSet(true);\n if (buffer[i] !== opts.skipOptionalPartCharacter) {\n var valResult = isValid(p, buffer[i], true, true);\n if (valResult !== false) {\n resetMaskSet(true);\n p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1;\n }\n }\n }\n }\n function casing(elem, test, pos) {\n switch (opts.casing || test.casing) {\n case \"upper\":\n elem = elem.toUpperCase();\n break;\n\n case \"lower\":\n elem = elem.toLowerCase();\n break;\n\n case \"title\":\n var posBefore = getMaskSet().validPositions[pos - 1];\n if (pos === 0 || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE)) {\n elem = elem.toUpperCase();\n } else {\n elem = elem.toLowerCase();\n }\n break;\n\n default:\n if ($.isFunction(opts.casing)) {\n var args = Array.prototype.slice.call(arguments);\n args.push(getMaskSet().validPositions);\n elem = opts.casing.apply(this, args);\n }\n }\n return elem;\n }\n function checkAlternationMatch(altArr1, altArr2, na) {\n var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = false, naArr = na !== undefined ? na.split(\",\") : [], naNdx;\n for (var i = 0; i < naArr.length; i++) {\n if ((naNdx = altArr1.indexOf(naArr[i])) !== -1) {\n altArr1.splice(naNdx, 1);\n }\n }\n for (var alndx = 0; alndx < altArr1.length; alndx++) {\n if ($.inArray(altArr1[alndx], altArrC) !== -1) {\n isMatch = true;\n break;\n }\n }\n return isMatch;\n }\n function alternate(pos, c, strict, fromSetValid, rAltPos) {\n var validPsClone = $.extend(true, {}, getMaskSet().validPositions), lastAlt, alternation, isValidRslt = false, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = rAltPos !== undefined ? rAltPos : getLastValidPosition();\n if (lAltPos === -1 && rAltPos === undefined) {\n lastAlt = 0;\n prevAltPos = getTest(lastAlt);\n alternation = prevAltPos.alternation;\n } else {\n for (;lAltPos >= 0; lAltPos--) {\n altPos = getMaskSet().validPositions[lAltPos];\n if (altPos && altPos.alternation !== undefined) {\n if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) {\n break;\n }\n lastAlt = lAltPos;\n alternation = getMaskSet().validPositions[lastAlt].alternation;\n prevAltPos = altPos;\n }\n }\n }\n if (alternation !== undefined) {\n decisionPos = parseInt(lastAlt);\n getMaskSet().excludes[decisionPos] = getMaskSet().excludes[decisionPos] || [];\n if (pos !== true) {\n getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));\n }\n var validInputsClone = [], staticInputsBeforePos = 0;\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if (validPos && validPos.generatedInput !== true) {\n validInputsClone.push(validPos.input);\n } else if (i < pos) staticInputsBeforePos++;\n delete getMaskSet().validPositions[i];\n }\n while (getMaskSet().excludes[decisionPos] && getMaskSet().excludes[decisionPos].length < 10) {\n var posOffset = staticInputsBeforePos * -1, validInputs = validInputsClone.slice();\n getMaskSet().tests[decisionPos] = undefined;\n resetMaskSet(true);\n isValidRslt = true;\n while (validInputs.length > 0) {\n var input = validInputs.shift();\n if (!(isValidRslt = isValid(getLastValidPosition(undefined, true) + 1, input, false, fromSetValid, true))) {\n break;\n }\n }\n if (isValidRslt && c !== undefined) {\n var targetLvp = getLastValidPosition(pos) + 1;\n for (i = decisionPos; i < getLastValidPosition() + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if ((validPos === undefined || validPos.match.fn == null) && i < pos + posOffset) {\n posOffset++;\n }\n }\n pos = pos + posOffset;\n isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, true);\n }\n if (!isValidRslt) {\n resetMaskSet();\n prevAltPos = getTest(decisionPos);\n getMaskSet().validPositions = $.extend(true, {}, validPsClone);\n if (getMaskSet().excludes[decisionPos]) {\n var decisionTaker = getDecisionTaker(prevAltPos);\n if (getMaskSet().excludes[decisionPos].indexOf(decisionTaker) !== -1) {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n getMaskSet().excludes[decisionPos].push(decisionTaker);\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) delete getMaskSet().validPositions[i];\n } else {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n } else break;\n }\n }\n getMaskSet().excludes[decisionPos] = undefined;\n return isValidRslt;\n }\n function isValid(pos, c, strict, fromSetValid, fromAlternate, validateOnly) {\n function isSelection(posObj) {\n return isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end === 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin === 1;\n }\n strict = strict === true;\n var maskPos = pos;\n if (pos.begin !== undefined) {\n maskPos = isRTL ? pos.end : pos.begin;\n }\n function _isValid(position, c, strict) {\n var rslt = false;\n $.each(getTests(position), function(ndx, tst) {\n var test = tst.match;\n getBuffer(true);\n rslt = test.fn != null ? test.fn.test(c, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== \"\" ? {\n c: getPlaceholder(position, test, true) || test.def,\n pos: position\n } : false;\n if (rslt !== false) {\n var elem = rslt.c !== undefined ? rslt.c : c, validatedPos = position;\n elem = elem === opts.skipOptionalPartCharacter && test.fn === null ? getPlaceholder(position, test, true) || test.def : elem;\n if (rslt.remove !== undefined) {\n if (!$.isArray(rslt.remove)) rslt.remove = [ rslt.remove ];\n $.each(rslt.remove.sort(function(a, b) {\n return b - a;\n }), function(ndx, lmnt) {\n revalidateMask({\n begin: lmnt,\n end: lmnt + 1\n });\n });\n }\n if (rslt.insert !== undefined) {\n if (!$.isArray(rslt.insert)) rslt.insert = [ rslt.insert ];\n $.each(rslt.insert.sort(function(a, b) {\n return a - b;\n }), function(ndx, lmnt) {\n isValid(lmnt.pos, lmnt.c, true, fromSetValid);\n });\n }\n if (rslt !== true && rslt.pos !== undefined && rslt.pos !== position) {\n validatedPos = rslt.pos;\n }\n if (rslt !== true && rslt.pos === undefined && rslt.c === undefined) {\n return false;\n }\n if (!revalidateMask(pos, $.extend({}, tst, {\n input: casing(elem, test, validatedPos)\n }), fromSetValid, validatedPos)) {\n rslt = false;\n }\n return false;\n }\n });\n return rslt;\n }\n var result = true, positionsClone = $.extend(true, {}, getMaskSet().validPositions);\n if ($.isFunction(opts.preValidation) && !strict && fromSetValid !== true && validateOnly !== true) {\n result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts, getMaskSet());\n }\n if (result === true) {\n trackbackPositions(undefined, maskPos, true);\n if (maxLength === undefined || maskPos < maxLength) {\n result = _isValid(maskPos, c, strict);\n if ((!strict || fromSetValid === true) && result === false && validateOnly !== true) {\n var currentPosValid = getMaskSet().validPositions[maskPos];\n if (currentPosValid && currentPosValid.match.fn === null && (currentPosValid.match.def === c || c === opts.skipOptionalPartCharacter)) {\n result = {\n caret: seekNext(maskPos)\n };\n } else {\n if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && (!isMask(maskPos, true) || getMaskSet().jitOffset[maskPos])) {\n if (getMaskSet().jitOffset[maskPos] && getMaskSet().validPositions[seekNext(maskPos)] === undefined) {\n result = isValid(maskPos + getMaskSet().jitOffset[maskPos], c, strict);\n if (result !== false) result.caret = maskPos;\n } else for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) {\n result = _isValid(nPos, c, strict);\n if (result !== false) {\n result = trackbackPositions(maskPos, result.pos !== undefined ? result.pos : nPos) || result;\n maskPos = nPos;\n break;\n }\n }\n }\n }\n }\n }\n if (result === false && opts.keepStatic !== false && (opts.regex == null || isComplete(getBuffer())) && !strict && fromAlternate !== true) {\n result = alternate(maskPos, c, strict, fromSetValid);\n }\n if (result === true) {\n result = {\n pos: maskPos\n };\n }\n }\n if ($.isFunction(opts.postValidation) && result !== false && !strict && fromSetValid !== true && validateOnly !== true) {\n var postResult = opts.postValidation(getBuffer(true), pos.begin !== undefined ? isRTL ? pos.end : pos.begin : pos, result, opts);\n if (postResult !== undefined) {\n if (postResult.refreshFromBuffer && postResult.buffer) {\n var refresh = postResult.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, postResult.buffer);\n }\n result = postResult === true ? result : postResult;\n }\n }\n if (result && result.pos === undefined) {\n result.pos = maskPos;\n }\n if (result === false || validateOnly === true) {\n resetMaskSet(true);\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n }\n return result;\n }\n function trackbackPositions(originalPos, newPos, fillOnly) {\n var result;\n if (originalPos === undefined) {\n for (originalPos = newPos - 1; originalPos > 0; originalPos--) {\n if (getMaskSet().validPositions[originalPos]) break;\n }\n }\n for (var ps = originalPos; ps < newPos; ps++) {\n if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n var vp = ps == 0 ? getTest(ps) : getMaskSet().validPositions[ps - 1];\n if (vp) {\n var tests = getTests(ps).slice();\n if (tests[tests.length - 1].match.def === \"\") tests.pop();\n var bestMatch = determineTestTemplate(ps, tests);\n bestMatch = $.extend({}, bestMatch, {\n input: getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def\n });\n bestMatch.generatedInput = true;\n revalidateMask(ps, bestMatch, true);\n if (fillOnly !== true) {\n var cvpInput = getMaskSet().validPositions[newPos].input;\n getMaskSet().validPositions[newPos] = undefined;\n result = isValid(newPos, cvpInput, true, true);\n }\n }\n }\n }\n return result;\n }\n function revalidateMask(pos, validTest, fromSetValid, validatedPos) {\n function IsEnclosedStatic(pos, valids, selection) {\n var posMatch = valids[pos];\n if (posMatch !== undefined && (posMatch.match.fn === null && posMatch.match.optionality !== true || posMatch.input === opts.radixPoint)) {\n 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];\n return prevMatch && nextMatch;\n }\n return false;\n }\n var begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos;\n if (pos.begin > pos.end) {\n begin = pos.end;\n end = pos.begin;\n }\n validatedPos = validatedPos !== undefined ? validatedPos : begin;\n if (begin !== end || opts.insertMode && getMaskSet().validPositions[validatedPos] !== undefined && fromSetValid === undefined) {\n var positionsClone = $.extend(true, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, true), i;\n getMaskSet().p = begin;\n for (i = lvp; i >= begin; i--) {\n if (getMaskSet().validPositions[i] && getMaskSet().validPositions[i].match.nativeDef === \"+\") {\n opts.isNegative = false;\n }\n delete getMaskSet().validPositions[i];\n }\n var valid = true, j = validatedPos, vps = getMaskSet().validPositions, needsValidation = false, posMatch = j, i = j;\n if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n posMatch++;\n j++;\n if (begin < end) i++;\n }\n for (;i <= lvp; i++) {\n var t = positionsClone[i];\n if (t !== undefined && (i >= end || i >= begin && t.generatedInput !== true && IsEnclosedStatic(i, positionsClone, {\n begin: begin,\n end: end\n }))) {\n while (getTest(posMatch).match.def !== \"\") {\n if (needsValidation === false && positionsClone[posMatch] && positionsClone[posMatch].match.nativeDef === t.match.nativeDef) {\n getMaskSet().validPositions[posMatch] = $.extend(true, {}, positionsClone[posMatch]);\n getMaskSet().validPositions[posMatch].input = t.input;\n trackbackPositions(undefined, posMatch, true);\n j = posMatch + 1;\n valid = true;\n } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {\n var result = isValid(posMatch, t.input, true, true);\n valid = result !== false;\n j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;\n needsValidation = true;\n } else {\n valid = t.generatedInput === true || t.input === opts.radixPoint && opts.numericInput === true;\n }\n if (valid) break;\n if (!valid && posMatch > end && isMask(posMatch, true) && (t.match.fn !== null || posMatch > getMaskSet().maskLength)) {\n break;\n }\n posMatch++;\n }\n if (getTest(posMatch).match.def == \"\") valid = false;\n posMatch = j;\n }\n if (!valid) break;\n }\n if (!valid) {\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n resetMaskSet(true);\n return false;\n }\n } else if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n }\n resetMaskSet(true);\n return true;\n }\n function isMask(pos, strict) {\n var test = getTestTemplate(pos).match;\n if (test.def === \"\") test = getTest(pos).match;\n if (test.fn != null) {\n return test.fn;\n }\n if (strict !== true && pos > -1) {\n var tests = getTests(pos);\n return tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0);\n }\n return false;\n }\n function seekNext(pos, newBlock) {\n var position = pos + 1;\n while (getTest(position).match.def !== \"\" && (newBlock === true && (getTest(position).match.newBlockMarker !== true || !isMask(position)) || newBlock !== true && !isMask(position))) {\n position++;\n }\n return position;\n }\n function seekPrevious(pos, newBlock) {\n var position = pos, tests;\n if (position <= 0) return 0;\n while (--position > 0 && (newBlock === true && getTest(position).match.newBlockMarker !== true || newBlock !== true && !isMask(position) && (tests = getTests(position), \n tests.length < 2 || tests.length === 2 && tests[1].match.def === \"\"))) {}\n return position;\n }\n function writeBuffer(input, buffer, caretPos, event, triggerEvents) {\n if (event && $.isFunction(opts.onBeforeWrite)) {\n var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);\n if (result) {\n if (result.refreshFromBuffer) {\n var refresh = result.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, result.buffer || buffer);\n buffer = getBuffer(true);\n }\n if (caretPos !== undefined) caretPos = result.caret !== undefined ? result.caret : caretPos;\n }\n }\n if (input !== undefined) {\n input.inputmask._valueSet(buffer.join(\"\"));\n if (caretPos !== undefined && (event === undefined || event.type !== \"blur\")) {\n caret(input, caretPos);\n } else renderColorMask(input, caretPos, buffer.length === 0);\n if (triggerEvents === true) {\n var $input = $(input), nptVal = input.inputmask._valueGet();\n skipInputEvent = true;\n $input.trigger(\"input\");\n setTimeout(function() {\n if (nptVal === getBufferTemplate().join(\"\")) {\n $input.trigger(\"cleared\");\n } else if (isComplete(buffer) === true) {\n $input.trigger(\"complete\");\n }\n }, 0);\n }\n }\n }\n function getPlaceholder(pos, test, returnPL) {\n test = test || getTest(pos).match;\n if (test.placeholder !== undefined || returnPL === true) {\n return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;\n } else if (test.fn === null) {\n if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {\n var tests = getTests(pos), staticAlternations = [], prevTest;\n if (tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0)) {\n for (var i = 0; i < tests.length; i++) {\n 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))) {\n staticAlternations.push(tests[i]);\n if (tests[i].match.fn === null) prevTest = tests[i];\n if (staticAlternations.length > 1) {\n if (/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)) {\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n }\n }\n }\n }\n }\n return test.def;\n }\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n function HandleNativePlaceholder(npt, value) {\n if (ie) {\n if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || npt.placeholder === \"\")) {\n var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet();\n if (nptValue !== value) {\n var lvp = getLastValidPosition();\n if (lvp === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else if (lvp !== -1) {\n clearOptionalTail(buffer);\n }\n writeBuffer(npt, buffer);\n }\n }\n } else if (npt.placeholder !== value) {\n npt.placeholder = value;\n if (npt.placeholder === \"\") npt.removeAttribute(\"placeholder\");\n }\n }\n var EventRuler = {\n on: function(input, eventName, eventHandler) {\n var ev = function(e) {\n var that = this;\n if (that.inputmask === undefined && this.nodeName !== \"FORM\") {\n var imOpts = $.data(that, \"_inputmask_opts\");\n if (imOpts) new Inputmask(imOpts).mask(that); else EventRuler.off(that);\n } 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))) {\n e.preventDefault();\n } else {\n switch (e.type) {\n case \"input\":\n if (skipInputEvent === true) {\n skipInputEvent = false;\n return e.preventDefault();\n }\n if (mobile) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n caret(that, that.inputmask.caretPos, undefined, true);\n }, 0);\n return false;\n }\n break;\n\n case \"keydown\":\n skipKeyPressEvent = false;\n skipInputEvent = false;\n break;\n\n case \"keypress\":\n if (skipKeyPressEvent === true) {\n return e.preventDefault();\n }\n skipKeyPressEvent = true;\n break;\n\n case \"click\":\n if (iemobile || iphone) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n }, 0);\n return false;\n }\n break;\n }\n var returnVal = eventHandler.apply(that, arguments);\n if (returnVal === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n return returnVal;\n }\n };\n input.inputmask.events[eventName] = input.inputmask.events[eventName] || [];\n input.inputmask.events[eventName].push(ev);\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).on(eventName, ev);\n } else {\n $(input).on(eventName, ev);\n }\n },\n off: function(input, event) {\n if (input.inputmask && input.inputmask.events) {\n var events;\n if (event) {\n events = [];\n events[event] = input.inputmask.events[event];\n } else {\n events = input.inputmask.events;\n }\n $.each(events, function(eventName, evArr) {\n while (evArr.length > 0) {\n var ev = evArr.pop();\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).off(eventName, ev);\n } else {\n $(input).off(eventName, ev);\n }\n }\n delete input.inputmask.events[eventName];\n });\n }\n }\n };\n var EventHandlers = {\n keydownEvent: function(e) {\n var input = this, $input = $(input), k = e.keyCode, pos = caret(input);\n if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !isInputEventSupported(\"cut\")) {\n e.preventDefault();\n handleRemove(input, k, pos);\n writeBuffer(input, getBuffer(true), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(\"\"));\n } else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {\n e.preventDefault();\n var caretPos = seekNext(getLastValidPosition());\n caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, true);\n } else if (k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP) {\n e.preventDefault();\n caret(input, 0, e.shiftKey ? pos.begin : 0, true);\n } else if ((opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || k === 90 && e.ctrlKey) && e.altKey !== true) {\n checkVal(input, true, false, undoValue.split(\"\"));\n $input.trigger(\"click\");\n } else if (k === Inputmask.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) {\n opts.insertMode = !opts.insertMode;\n input.setAttribute(\"im-insert\", opts.insertMode);\n } else if (opts.tabThrough === true && k === Inputmask.keyCode.TAB) {\n if (e.shiftKey === true) {\n if (getTest(pos.begin).match.fn === null) {\n pos.begin = seekNext(pos.begin);\n }\n pos.end = seekPrevious(pos.begin, true);\n pos.begin = seekPrevious(pos.end, true);\n } else {\n pos.begin = seekNext(pos.begin, true);\n pos.end = seekNext(pos.begin, true);\n if (pos.end < getMaskSet().maskLength) pos.end--;\n }\n if (pos.begin < getMaskSet().maskLength) {\n e.preventDefault();\n caret(input, pos.begin, pos.end);\n }\n }\n opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts);\n ignorable = $.inArray(k, opts.ignorables) !== -1;\n },\n keypressEvent: function(e, checkval, writeOut, strict, ndx) {\n var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;\n if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) {\n if (k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join(\"\")) {\n undoValue = getBuffer().join(\"\");\n setTimeout(function() {\n $input.trigger(\"change\");\n }, 0);\n }\n return true;\n } else {\n if (k) {\n if (k === 46 && e.shiftKey === false && opts.radixPoint !== \"\") k = opts.radixPoint.charCodeAt(0);\n var pos = checkval ? {\n begin: ndx,\n end: ndx\n } : caret(input), forwardPosition, c = String.fromCharCode(k), offset = 0;\n if (opts._radixDance && opts.numericInput) {\n var caretPos = getBuffer().indexOf(opts.radixPoint.charAt(0)) + 1;\n if (pos.begin <= caretPos) {\n if (k === opts.radixPoint.charCodeAt(0)) offset = 1;\n pos.begin -= 1;\n pos.end -= 1;\n }\n }\n getMaskSet().writeOutBuffer = true;\n var valResult = isValid(pos, c, strict);\n if (valResult !== false) {\n resetMaskSet(true);\n forwardPosition = valResult.caret !== undefined ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos);\n getMaskSet().p = forwardPosition;\n }\n forwardPosition = (opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition) + offset;\n if (writeOut !== false) {\n setTimeout(function() {\n opts.onKeyValidation.call(input, k, valResult, opts);\n }, 0);\n if (getMaskSet().writeOutBuffer && valResult !== false) {\n var buffer = getBuffer();\n writeBuffer(input, buffer, forwardPosition, e, checkval !== true);\n }\n }\n e.preventDefault();\n if (checkval) {\n if (valResult !== false) valResult.forwardPosition = forwardPosition;\n return valResult;\n }\n }\n }\n },\n pasteEvent: function(e) {\n var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(true), caretPos = caret(input), tempValue;\n if (isRTL) {\n tempValue = caretPos.end;\n caretPos.end = caretPos.begin;\n caretPos.begin = tempValue;\n }\n var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);\n if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join(\"\")) valueBeforeCaret = \"\";\n if (valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join(\"\")) valueAfterCaret = \"\";\n if (window.clipboardData && window.clipboardData.getData) {\n inputValue = valueBeforeCaret + window.clipboardData.getData(\"Text\") + valueAfterCaret;\n } else if (ev.clipboardData && ev.clipboardData.getData) {\n inputValue = valueBeforeCaret + ev.clipboardData.getData(\"text/plain\") + valueAfterCaret;\n } else return true;\n var pasteValue = inputValue;\n if ($.isFunction(opts.onBeforePaste)) {\n pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts);\n if (pasteValue === false) {\n return e.preventDefault();\n }\n if (!pasteValue) {\n pasteValue = inputValue;\n }\n }\n checkVal(input, false, false, pasteValue.toString().split(\"\"));\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(\"\"));\n return e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n function radixPointHandler(input, inputValue, caretPos) {\n if (inputValue.charAt(caretPos.begin - 1) === \".\" && opts.radixPoint !== \"\") {\n inputValue = inputValue.split(\"\");\n inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0);\n inputValue = inputValue.join(\"\");\n }\n return inputValue;\n }\n function ieMobileHandler(input, inputValue, caretPos) {\n if (iemobile) {\n var inputChar = inputValue.replace(getBuffer().join(\"\"), \"\");\n if (inputChar.length === 1) {\n var iv = inputValue.split(\"\");\n iv.splice(caretPos.begin, 0, inputChar);\n inputValue = iv.join(\"\");\n }\n }\n return inputValue;\n }\n var input = this, inputValue = input.inputmask._valueGet();\n if (getBuffer().join(\"\") !== inputValue) {\n var caretPos = caret(input);\n inputValue = radixPointHandler(input, inputValue, caretPos);\n inputValue = ieMobileHandler(input, inputValue, caretPos);\n if (getBuffer().join(\"\") !== inputValue) {\n 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);\n var selection = caretPos, entries = \"\", isEntry = false;\n if (frontPart !== frontBufferPart) {\n var fpl = (isEntry = frontPart.length >= frontBufferPart.length) ? frontPart.length : frontBufferPart.length, i;\n for (i = 0; frontPart.charAt(i) === frontBufferPart.charAt(i) && i < fpl; i++) ;\n if (isEntry) {\n selection.begin = i - offset;\n entries += frontPart.slice(i, selection.end);\n }\n }\n if (backPart !== backBufferPart) {\n if (backPart.length > backBufferPart.length) {\n entries += backPart.slice(0, 1);\n } else {\n if (backPart.length < backBufferPart.length) {\n selection.end += backBufferPart.length - backPart.length;\n if (!isEntry && opts.radixPoint !== \"\" && backPart === \"\" && frontPart.charAt(selection.begin + offset - 1) === opts.radixPoint) {\n selection.begin--;\n entries = opts.radixPoint;\n }\n }\n }\n }\n writeBuffer(input, getBuffer(), {\n begin: selection.begin + offset,\n end: selection.end + offset\n });\n if (entries.length > 0) {\n $.each(entries.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n } else {\n if (selection.begin === selection.end - 1) {\n selection.begin = seekPrevious(selection.begin + 1);\n if (selection.begin === selection.end - 1) {\n caret(input, selection.begin);\n } else {\n caret(input, selection.begin, selection.end);\n }\n }\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = opts.numericInput ? Inputmask.keyCode.BACKSPACE : Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n }\n e.preventDefault();\n }\n }\n },\n beforeInputEvent: function(e) {\n if (e.cancelable) {\n var input = this;\n switch (e.inputType) {\n case \"insertText\":\n $.each(e.data.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n return e.preventDefault();\n\n case \"deleteContentBackward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.BACKSPACE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n\n case \"deleteContentForward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n }\n }\n },\n setValueEvent: function(e) {\n this.inputmask.refreshValue = false;\n var input = this, value = e && e.detail ? e.detail[0] : arguments[1], value = value || input.inputmask._valueGet(true);\n if ($.isFunction(opts.onBeforeMask)) value = opts.onBeforeMask.call(inputmask, value, opts) || value;\n value = value.toString().split(\"\");\n checkVal(input, true, false, value);\n undoValue = getBuffer().join(\"\");\n if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n input.inputmask._valueSet(\"\");\n }\n },\n focusEvent: function(e) {\n var input = this, nptValue = input.inputmask._valueGet();\n if (opts.showMaskOnFocus) {\n if (nptValue !== getBuffer().join(\"\")) {\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));\n } else if (mouseEnter === false) {\n caret(input, seekNext(getLastValidPosition()));\n }\n }\n if (opts.positionCaretOnTab === true && mouseEnter === false) {\n EventHandlers.clickEvent.apply(input, [ e, true ]);\n }\n undoValue = getBuffer().join(\"\");\n },\n mouseleaveEvent: function(e) {\n var input = this;\n mouseEnter = false;\n if (opts.clearMaskOnLostFocus && document.activeElement !== input) {\n HandleNativePlaceholder(input, originalPlaceholder);\n }\n },\n clickEvent: function(e, tabbed) {\n function doRadixFocus(clickPos) {\n if (opts.radixPoint !== \"\") {\n var vps = getMaskSet().validPositions;\n if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {\n if (clickPos < seekNext(-1)) return true;\n var radixPos = $.inArray(opts.radixPoint, getBuffer());\n if (radixPos !== -1) {\n for (var vp in vps) {\n if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) {\n return false;\n }\n }\n return true;\n }\n }\n }\n return false;\n }\n var input = this;\n setTimeout(function() {\n if (document.activeElement === input) {\n var selectedCaret = caret(input);\n if (tabbed) {\n if (isRTL) {\n selectedCaret.end = selectedCaret.begin;\n } else {\n selectedCaret.begin = selectedCaret.end;\n }\n }\n if (selectedCaret.begin === selectedCaret.end) {\n switch (opts.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n caret(input, 0, getBuffer().length);\n break;\n\n case \"ignore\":\n caret(input, seekNext(getLastValidPosition()));\n break;\n\n case \"radixFocus\":\n if (doRadixFocus(selectedCaret.begin)) {\n var radixPos = getBuffer().join(\"\").indexOf(opts.radixPoint);\n caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);\n break;\n }\n\n default:\n var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, true), lastPosition = seekNext(lvclickPosition);\n if (clickPosition < lastPosition) {\n caret(input, !isMask(clickPosition, true) && !isMask(clickPosition - 1, true) ? seekNext(clickPosition) : clickPosition);\n } else {\n var lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp), placeholder = getPlaceholder(lastPosition, tt.match);\n if (placeholder !== \"\" && getBuffer()[lastPosition] !== placeholder && tt.match.optionalQuantifier !== true && tt.match.newBlockMarker !== true || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) {\n var newPos = seekNext(lastPosition);\n if (clickPosition >= newPos || clickPosition === lastPosition) {\n lastPosition = newPos;\n }\n }\n caret(input, lastPosition);\n }\n break;\n }\n }\n }\n }, 0);\n },\n cutEvent: function(e) {\n var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;\n var clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);\n clipboardData.setData(\"text\", isRTL ? clipData.reverse().join(\"\") : clipData.join(\"\"));\n if (document.execCommand) document.execCommand(\"copy\");\n handleRemove(input, Inputmask.keyCode.DELETE, pos);\n writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(\"\"));\n },\n blurEvent: function(e) {\n var $input = $(this), input = this;\n if (input.inputmask) {\n HandleNativePlaceholder(input, originalPlaceholder);\n var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();\n if (nptValue !== \"\" || colorMask !== undefined) {\n if (opts.clearMaskOnLostFocus) {\n if (getLastValidPosition() === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (isComplete(buffer) === false) {\n setTimeout(function() {\n $input.trigger(\"incomplete\");\n }, 0);\n if (opts.clearIncomplete) {\n resetMaskSet();\n if (opts.clearMaskOnLostFocus) {\n buffer = [];\n } else {\n buffer = getBufferTemplate().slice();\n }\n }\n }\n writeBuffer(input, buffer, undefined, e);\n }\n if (undoValue !== getBuffer().join(\"\")) {\n undoValue = buffer.join(\"\");\n $input.trigger(\"change\");\n }\n }\n },\n mouseenterEvent: function(e) {\n var input = this;\n mouseEnter = true;\n if (document.activeElement !== input && opts.showMaskOnHover) {\n HandleNativePlaceholder(input, (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\"));\n }\n },\n submitEvent: function(e) {\n if (undoValue !== getBuffer().join(\"\")) {\n $el.trigger(\"change\");\n }\n if (opts.clearMaskOnLostFocus && getLastValidPosition() === -1 && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.clearIncomplete && isComplete(getBuffer()) === false) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.removeMaskOnSubmit) {\n el.inputmask._valueSet(el.inputmask.unmaskedvalue(), true);\n setTimeout(function() {\n writeBuffer(el, getBuffer());\n }, 0);\n }\n },\n resetEvent: function(e) {\n el.inputmask.refreshValue = true;\n setTimeout(function() {\n $el.trigger(\"setvalue\");\n }, 0);\n }\n };\n function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {\n var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = \"\", initialNdx = -1, result = undefined;\n function isTemplateMatch(ndx, charCodes) {\n var charCodeNdx = getMaskTemplate(true, 0, false).slice(ndx, seekNext(ndx)).join(\"\").replace(/'/g, \"\").indexOf(charCodes);\n 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)));\n }\n resetMaskSet();\n if (!strict && opts.autoUnmask !== true) {\n var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(\"\"), matches = inputValue.join(\"\").match(new RegExp(\"^\" + Inputmask.escapeRegex(staticInput), \"g\"));\n if (matches && matches.length > 0) {\n inputValue.splice(0, matches.length * staticInput.length);\n initialNdx = seekNext(initialNdx);\n }\n } else {\n initialNdx = seekNext(initialNdx);\n }\n if (initialNdx === -1) {\n getMaskSet().p = seekNext(initialNdx);\n initialNdx = 0;\n } else getMaskSet().p = initialNdx;\n inputmask.caretPos = {\n begin: initialNdx\n };\n $.each(inputValue, function(ndx, charCode) {\n if (charCode !== undefined) {\n if (getMaskSet().validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, true) && isValid(ndx, inputValue[ndx], true, undefined, undefined, true) === false) {\n getMaskSet().p++;\n } else {\n var keypress = new $.Event(\"_checkval\");\n keypress.which = charCode.charCodeAt(0);\n charCodes += charCode;\n var lvp = getLastValidPosition(undefined, true);\n if (!isTemplateMatch(initialNdx, charCodes)) {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, inputmask.caretPos.begin);\n if (result) {\n initialNdx = inputmask.caretPos.begin + 1;\n charCodes = \"\";\n }\n } else {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, lvp + 1);\n }\n if (result) {\n writeBuffer(undefined, getBuffer(), result.forwardPosition, keypress, false);\n inputmask.caretPos = {\n begin: result.forwardPosition,\n end: result.forwardPosition\n };\n }\n }\n }\n });\n if (writeOut) writeBuffer(input, getBuffer(), result ? result.forwardPosition : undefined, initiatingEvent || new $.Event(\"checkval\"), initiatingEvent && initiatingEvent.type === \"input\");\n }\n function unmaskedvalue(input) {\n if (input) {\n if (input.inputmask === undefined) {\n return input.value;\n }\n if (input.inputmask && input.inputmask.refreshValue) {\n EventHandlers.setValueEvent.call(input);\n }\n }\n var umValue = [], vps = getMaskSet().validPositions;\n for (var pndx in vps) {\n if (vps[pndx].match && vps[pndx].match.fn != null) {\n umValue.push(vps[pndx].input);\n }\n }\n var unmaskedValue = umValue.length === 0 ? \"\" : (isRTL ? umValue.reverse() : umValue).join(\"\");\n if ($.isFunction(opts.onUnMask)) {\n var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\");\n unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);\n }\n return unmaskedValue;\n }\n function caret(input, begin, end, notranslate) {\n function translatePosition(pos) {\n if (isRTL && typeof pos === \"number\" && (!opts.greedy || opts.placeholder !== \"\") && el) {\n pos = el.inputmask._valueGet().length - pos;\n }\n return pos;\n }\n var range;\n if (begin !== undefined) {\n if ($.isArray(begin)) {\n end = isRTL ? begin[0] : begin[1];\n begin = isRTL ? begin[1] : begin[0];\n }\n if (begin.begin !== undefined) {\n end = isRTL ? begin.begin : begin.end;\n begin = isRTL ? begin.end : begin.begin;\n }\n if (typeof begin === \"number\") {\n begin = notranslate ? begin : translatePosition(begin);\n end = notranslate ? end : translatePosition(end);\n end = typeof end == \"number\" ? end : begin;\n var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;\n input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;\n input.inputmask.caretPos = {\n begin: begin,\n end: end\n };\n if (input === document.activeElement) {\n if (\"selectionStart\" in input) {\n input.selectionStart = begin;\n input.selectionEnd = end;\n } else if (window.getSelection) {\n range = document.createRange();\n if (input.firstChild === undefined || input.firstChild === null) {\n var textNode = document.createTextNode(\"\");\n input.appendChild(textNode);\n }\n range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length);\n range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length);\n range.collapse(true);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n } else if (input.createTextRange) {\n range = input.createTextRange();\n range.collapse(true);\n range.moveEnd(\"character\", end);\n range.moveStart(\"character\", begin);\n range.select();\n }\n renderColorMask(input, {\n begin: begin,\n end: end\n });\n }\n }\n } else {\n if (\"selectionStart\" in input) {\n begin = input.selectionStart;\n end = input.selectionEnd;\n } else if (window.getSelection) {\n range = window.getSelection().getRangeAt(0);\n if (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) {\n begin = range.startOffset;\n end = range.endOffset;\n }\n } else if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n begin = 0 - range.duplicate().moveStart(\"character\", -input.inputmask._valueGet().length);\n end = begin + range.text.length;\n }\n return {\n begin: notranslate ? begin : translatePosition(begin),\n end: notranslate ? end : translatePosition(end)\n };\n }\n }\n function determineLastRequiredPosition(returnDefinition) {\n 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;\n for (pos = lvp + 1; pos < buffer.length; pos++) {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n ndxIntlzr = testPos.locator.slice();\n positions[pos] = $.extend(true, {}, testPos);\n }\n var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;\n for (pos = bl - 1; pos > lvp; pos--) {\n testPos = positions[pos];\n 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)) {\n bl--;\n } else break;\n }\n return returnDefinition ? {\n l: bl,\n def: positions[bl] ? positions[bl].match : undefined\n } : bl;\n }\n function clearOptionalTail(buffer) {\n buffer.length = 0;\n var template = getMaskTemplate(true, 0, true, undefined, true), lmnt, validPos;\n while (lmnt = template.shift(), lmnt !== undefined) buffer.push(lmnt);\n return buffer;\n }\n function isComplete(buffer) {\n if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);\n if (opts.repeat === \"*\") return undefined;\n var complete = false, lrp = determineLastRequiredPosition(true), aml = seekPrevious(lrp.l);\n if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {\n complete = true;\n for (var i = 0; i <= aml; i++) {\n var test = getTestTemplate(i).match;\n if (test.fn !== null && getMaskSet().validPositions[i] === undefined && test.optionality !== true && test.optionalQuantifier !== true || test.fn === null && buffer[i] !== getPlaceholder(i, test)) {\n complete = false;\n break;\n }\n }\n }\n return complete;\n }\n function handleRemove(input, k, pos, strict, fromIsValid) {\n if (opts.numericInput || isRTL) {\n if (k === Inputmask.keyCode.BACKSPACE) {\n k = Inputmask.keyCode.DELETE;\n } else if (k === Inputmask.keyCode.DELETE) {\n k = Inputmask.keyCode.BACKSPACE;\n }\n if (isRTL) {\n var pend = pos.end;\n pos.end = pos.begin;\n pos.begin = pend;\n }\n }\n if (k === Inputmask.keyCode.BACKSPACE && pos.end - pos.begin < 1) {\n pos.begin = seekPrevious(pos.begin);\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.begin--;\n }\n } else if (k === Inputmask.keyCode.DELETE && pos.begin === pos.end) {\n pos.end = isMask(pos.end, true) && (getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint) ? pos.end + 1 : seekNext(pos.end) + 1;\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.end++;\n }\n }\n revalidateMask(pos);\n if (strict !== true && opts.keepStatic !== false || opts.regex !== null) {\n var result = alternate(true);\n if (result) {\n var newPos = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, true);\n if (k !== Inputmask.keyCode.DELETE || pos.begin > newPos) {\n pos.begin == newPos;\n }\n }\n }\n var lvp = getLastValidPosition(pos.begin, true);\n if (lvp < pos.begin || pos.begin === -1) {\n getMaskSet().p = seekNext(lvp);\n } else if (strict !== true) {\n getMaskSet().p = pos.begin;\n if (fromIsValid !== true) {\n while (getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined) {\n getMaskSet().p++;\n }\n }\n }\n }\n function initializeColorMask(input) {\n var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);\n function findCaretPos(clientx) {\n var e = document.createElement(\"span\"), caretPos;\n for (var style in computedStyle) {\n if (isNaN(style) && style.indexOf(\"font\") !== -1) {\n e.style[style] = computedStyle[style];\n }\n }\n e.style.textTransform = computedStyle.textTransform;\n e.style.letterSpacing = computedStyle.letterSpacing;\n e.style.position = \"absolute\";\n e.style.height = \"auto\";\n e.style.width = \"auto\";\n e.style.visibility = \"hidden\";\n e.style.whiteSpace = \"nowrap\";\n document.body.appendChild(e);\n var inputText = input.inputmask._valueGet(), previousWidth = 0, itl;\n for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {\n e.innerHTML += inputText.charAt(caretPos) || \"_\";\n if (e.offsetWidth >= clientx) {\n var offset1 = clientx - previousWidth;\n var offset2 = e.offsetWidth - clientx;\n e.innerHTML = inputText.charAt(caretPos);\n offset1 -= e.offsetWidth / 3;\n caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;\n break;\n }\n previousWidth = e.offsetWidth;\n }\n document.body.removeChild(e);\n return caretPos;\n }\n var template = document.createElement(\"div\");\n template.style.width = computedStyle.width;\n template.style.textAlign = computedStyle.textAlign;\n colorMask = document.createElement(\"div\");\n input.inputmask.colorMask = colorMask;\n colorMask.className = \"im-colormask\";\n input.parentNode.insertBefore(colorMask, input);\n input.parentNode.removeChild(input);\n colorMask.appendChild(input);\n colorMask.appendChild(template);\n input.style.left = template.offsetLeft + \"px\";\n $(colorMask).on(\"mouseleave\", function(e) {\n return EventHandlers.mouseleaveEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"mouseenter\", function(e) {\n return EventHandlers.mouseenterEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"click\", function(e) {\n caret(input, findCaretPos(e.clientX));\n return EventHandlers.clickEvent.call(input, [ e ]);\n });\n }\n function renderColorMask(input, caretPos, clear) {\n var maskTemplate = [], isStatic = false, test, testPos, ndxIntlzr, pos = 0;\n function setEntry(entry) {\n if (entry === undefined) entry = \"\";\n if (!isStatic && (test.fn === null || testPos.input === undefined)) {\n isStatic = true;\n maskTemplate.push(\"\" + entry);\n } else if (isStatic && (test.fn !== null && testPos.input !== undefined || test.def === \"\")) {\n isStatic = false;\n var mtl = maskTemplate.length;\n maskTemplate[mtl - 1] = maskTemplate[mtl - 1] + \"\";\n maskTemplate.push(entry);\n } else maskTemplate.push(entry);\n }\n function setCaret() {\n if (document.activeElement === input) {\n maskTemplate.splice(caretPos.begin, 0, caretPos.begin === caretPos.end || caretPos.end > getMaskSet().maskLength ? '' : '');\n maskTemplate.splice(caretPos.end + 1, 0, \"\");\n }\n }\n if (colorMask !== undefined) {\n var buffer = getBuffer();\n if (caretPos === undefined) {\n caretPos = caret(input);\n } else if (caretPos.begin === undefined) {\n caretPos = {\n begin: caretPos,\n end: caretPos\n };\n }\n if (clear !== true) {\n var lvp = getLastValidPosition();\n do {\n if (getMaskSet().validPositions[pos]) {\n testPos = getMaskSet().validPositions[pos];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n setEntry(buffer[pos]);\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n if (opts.jitMasking === false || pos < lvp || typeof opts.jitMasking === \"number\" && isFinite(opts.jitMasking) && opts.jitMasking > pos) {\n setEntry(getPlaceholder(pos, test));\n } else isStatic = false;\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || lvp > pos || isStatic);\n if (isStatic) setEntry();\n setCaret();\n }\n var template = colorMask.getElementsByTagName(\"div\")[0];\n template.innerHTML = maskTemplate.join(\"\");\n input.inputmask.positionColorMask(input, template);\n }\n }\n function mask(elem) {\n function isElementTypeSupported(input, opts) {\n function patchValueProperty(npt) {\n var valueGet;\n var valueSet;\n function patchValhook(type) {\n if ($.valHooks && ($.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true)) {\n var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {\n return elem.value;\n };\n var valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {\n elem.value = value;\n return elem;\n };\n $.valHooks[type] = {\n get: function(elem) {\n if (elem.inputmask) {\n if (elem.inputmask.opts.autoUnmask) {\n return elem.inputmask.unmaskedvalue();\n } else {\n var result = valhookGet(elem);\n return getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) !== -1 || opts.nullable !== true ? result : \"\";\n }\n } else return valhookGet(elem);\n },\n set: function(elem, value) {\n var $elem = $(elem), result;\n result = valhookSet(elem, value);\n if (elem.inputmask) {\n $elem.trigger(\"setvalue\", [ value ]);\n }\n return result;\n },\n inputmaskpatch: true\n };\n }\n }\n function getter() {\n if (this.inputmask) {\n 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) : \"\";\n } else return valueGet.call(this);\n }\n function setter(value) {\n valueSet.call(this, value);\n if (this.inputmask) {\n $(this).trigger(\"setvalue\", [ value ]);\n }\n }\n function installNativeValueSetFallback(npt) {\n EventRuler.on(npt, \"mouseenter\", function(event) {\n var $input = $(this), input = this, value = input.inputmask._valueGet();\n if (value !== getBuffer().join(\"\")) {\n $input.trigger(\"setvalue\");\n }\n });\n }\n if (!npt.inputmask.__valueGet) {\n if (opts.noValuePatching !== true) {\n if (Object.getOwnPropertyDescriptor) {\n if (typeof Object.getPrototypeOf !== \"function\") {\n Object.getPrototypeOf = typeof \"test\".__proto__ === \"object\" ? function(object) {\n return object.__proto__;\n } : function(object) {\n return object.constructor.prototype;\n };\n }\n var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), \"value\") : undefined;\n if (valueProperty && valueProperty.get && valueProperty.set) {\n valueGet = valueProperty.get;\n valueSet = valueProperty.set;\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n } else if (npt.tagName !== \"INPUT\") {\n valueGet = function() {\n return this.textContent;\n };\n valueSet = function(value) {\n this.textContent = value;\n };\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n }\n } else if (document.__lookupGetter__ && npt.__lookupGetter__(\"value\")) {\n valueGet = npt.__lookupGetter__(\"value\");\n valueSet = npt.__lookupSetter__(\"value\");\n npt.__defineGetter__(\"value\", getter);\n npt.__defineSetter__(\"value\", setter);\n }\n npt.inputmask.__valueGet = valueGet;\n npt.inputmask.__valueSet = valueSet;\n }\n npt.inputmask._valueGet = function(overruleRTL) {\n return isRTL && overruleRTL !== true ? valueGet.call(this.el).split(\"\").reverse().join(\"\") : valueGet.call(this.el);\n };\n npt.inputmask._valueSet = function(value, overruleRTL) {\n valueSet.call(this.el, value === null || value === undefined ? \"\" : overruleRTL !== true && isRTL ? value.split(\"\").reverse().join(\"\") : value);\n };\n if (valueGet === undefined) {\n valueGet = function() {\n return this.value;\n };\n valueSet = function(value) {\n this.value = value;\n };\n patchValhook(npt.type);\n installNativeValueSetFallback(npt);\n }\n }\n }\n var elementType = input.getAttribute(\"type\");\n var isSupported = input.tagName === \"INPUT\" && $.inArray(elementType, opts.supportsInputType) !== -1 || input.isContentEditable || input.tagName === \"TEXTAREA\";\n if (!isSupported) {\n if (input.tagName === \"INPUT\") {\n var el = document.createElement(\"input\");\n el.setAttribute(\"type\", elementType);\n isSupported = el.type === \"text\";\n el = null;\n } else isSupported = \"partial\";\n }\n if (isSupported !== false) {\n patchValueProperty(input);\n } else input.inputmask = undefined;\n return isSupported;\n }\n EventRuler.off(elem);\n var isSupported = isElementTypeSupported(elem, opts);\n if (isSupported !== false) {\n el = elem;\n $el = $(el);\n originalPlaceholder = el.placeholder;\n maxLength = el !== undefined ? el.maxLength : undefined;\n if (maxLength === -1) maxLength = undefined;\n if (opts.colorMask === true) {\n initializeColorMask(el);\n }\n if (mobile) {\n if (\"inputMode\" in el) {\n el.inputmode = opts.inputmode;\n el.setAttribute(\"inputmode\", opts.inputmode);\n }\n if (opts.disablePredictiveText === true) {\n if (\"autocorrect\" in el) {\n el.autocorrect = false;\n } else {\n if (opts.colorMask !== true) {\n initializeColorMask(el);\n }\n el.type = \"password\";\n }\n }\n }\n if (isSupported === true) {\n el.setAttribute(\"im-insert\", opts.insertMode);\n EventRuler.on(el, \"submit\", EventHandlers.submitEvent);\n EventRuler.on(el, \"reset\", EventHandlers.resetEvent);\n EventRuler.on(el, \"blur\", EventHandlers.blurEvent);\n EventRuler.on(el, \"focus\", EventHandlers.focusEvent);\n if (opts.colorMask !== true) {\n EventRuler.on(el, \"click\", EventHandlers.clickEvent);\n EventRuler.on(el, \"mouseleave\", EventHandlers.mouseleaveEvent);\n EventRuler.on(el, \"mouseenter\", EventHandlers.mouseenterEvent);\n }\n EventRuler.on(el, \"paste\", EventHandlers.pasteEvent);\n EventRuler.on(el, \"cut\", EventHandlers.cutEvent);\n EventRuler.on(el, \"complete\", opts.oncomplete);\n EventRuler.on(el, \"incomplete\", opts.onincomplete);\n EventRuler.on(el, \"cleared\", opts.oncleared);\n if (!mobile && opts.inputEventOnly !== true) {\n EventRuler.on(el, \"keydown\", EventHandlers.keydownEvent);\n EventRuler.on(el, \"keypress\", EventHandlers.keypressEvent);\n } else {\n el.removeAttribute(\"maxLength\");\n }\n EventRuler.on(el, \"input\", EventHandlers.inputFallBackEvent);\n EventRuler.on(el, \"beforeinput\", EventHandlers.beforeInputEvent);\n }\n EventRuler.on(el, \"setvalue\", EventHandlers.setValueEvent);\n undoValue = getBufferTemplate().join(\"\");\n if (el.inputmask._valueGet(true) !== \"\" || opts.clearMaskOnLostFocus === false || document.activeElement === el) {\n var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, el.inputmask._valueGet(true), opts) || el.inputmask._valueGet(true) : el.inputmask._valueGet(true);\n if (initialValue !== \"\") checkVal(el, true, false, initialValue.split(\"\"));\n var buffer = getBuffer().slice();\n undoValue = buffer.join(\"\");\n if (isComplete(buffer) === false) {\n if (opts.clearIncomplete) {\n resetMaskSet();\n }\n }\n if (opts.clearMaskOnLostFocus && document.activeElement !== el) {\n if (getLastValidPosition() === -1) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (opts.clearMaskOnLostFocus === false || opts.showMaskOnFocus && document.activeElement === el || el.inputmask._valueGet(true) !== \"\") writeBuffer(el, buffer);\n if (document.activeElement === el) {\n caret(el, seekNext(getLastValidPosition()));\n }\n }\n }\n }\n var valueBuffer;\n if (actionObj !== undefined) {\n switch (actionObj.action) {\n case \"isComplete\":\n el = actionObj.el;\n return isComplete(getBuffer());\n\n case \"unmaskedvalue\":\n if (el === undefined || actionObj.value !== undefined) {\n valueBuffer = actionObj.value;\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer : valueBuffer).split(\"\");\n checkVal.call(this, undefined, false, false, valueBuffer);\n if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(inputmask, undefined, getBuffer(), 0, opts);\n }\n return unmaskedvalue(el);\n\n case \"mask\":\n mask(el);\n break;\n\n case \"format\":\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value : actionObj.value).split(\"\");\n checkVal.call(this, undefined, true, false, valueBuffer);\n if (actionObj.metadata) {\n return {\n value: isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\"),\n metadata: maskScope.call(this, {\n action: \"getmetadata\"\n }, maskset, opts)\n };\n }\n return isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\");\n\n case \"isValid\":\n if (actionObj.value) {\n valueBuffer = actionObj.value.split(\"\");\n checkVal.call(this, undefined, true, true, valueBuffer);\n } else {\n actionObj.value = getBuffer().join(\"\");\n }\n var buffer = getBuffer();\n var rl = determineLastRequiredPosition(), lmib = buffer.length - 1;\n for (;lmib > rl; lmib--) {\n if (isMask(lmib)) break;\n }\n buffer.splice(rl, lmib + 1 - rl);\n return isComplete(buffer) && actionObj.value === getBuffer().join(\"\");\n\n case \"getemptymask\":\n return getBufferTemplate().join(\"\");\n\n case \"remove\":\n if (el && el.inputmask) {\n $.data(el, \"_inputmask_opts\", null);\n $el = $(el);\n el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(true));\n EventRuler.off(el);\n if (el.inputmask.colorMask) {\n colorMask = el.inputmask.colorMask;\n colorMask.removeChild(el);\n colorMask.parentNode.insertBefore(el, colorMask);\n colorMask.parentNode.removeChild(colorMask);\n }\n var valueProperty;\n if (Object.getOwnPropertyDescriptor && Object.getPrototypeOf) {\n valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), \"value\");\n if (valueProperty) {\n if (el.inputmask.__valueGet) {\n Object.defineProperty(el, \"value\", {\n get: el.inputmask.__valueGet,\n set: el.inputmask.__valueSet,\n configurable: true\n });\n }\n }\n } else if (document.__lookupGetter__ && el.__lookupGetter__(\"value\")) {\n if (el.inputmask.__valueGet) {\n el.__defineGetter__(\"value\", el.inputmask.__valueGet);\n el.__defineSetter__(\"value\", el.inputmask.__valueSet);\n }\n }\n el.inputmask = undefined;\n }\n return el;\n break;\n\n case \"getmetadata\":\n if ($.isArray(maskset.metadata)) {\n var maskTarget = getMaskTemplate(true, 0, false).join(\"\");\n $.each(maskset.metadata, function(ndx, mtdt) {\n if (mtdt.mask === maskTarget) {\n maskTarget = mtdt;\n return false;\n }\n });\n return maskTarget;\n }\n return maskset.metadata;\n }\n }\n }\n return Inputmask;\n});","/*!\n* inputmask.numeric.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (typeof define === \"function\" && define.amd) {\n define([ \"./inputmask\" ], factory);\n } else if (typeof exports === \"object\") {\n module.exports = factory(require(\"./inputmask\"));\n } else {\n factory(window.Inputmask);\n }\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n function autoEscape(txt, opts) {\n var escapedTxt = \"\";\n for (var i = 0; i < txt.length; i++) {\n 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)) {\n escapedTxt += \"\\\\\" + txt.charAt(i);\n } else escapedTxt += txt.charAt(i);\n }\n return escapedTxt;\n }\n function alignDigits(buffer, digits, opts) {\n if (digits > 0) {\n var radixPosition = $.inArray(opts.radixPoint, buffer);\n if (radixPosition === -1) {\n buffer.push(opts.radixPoint);\n radixPosition = buffer.length - 1;\n }\n for (var i = 1; i <= digits; i++) {\n buffer[radixPosition + i] = buffer[radixPosition + i] || \"0\";\n }\n }\n return buffer;\n }\n Inputmask.extendAliases({\n numeric: {\n mask: function(opts) {\n if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {\n opts.integerDigits = opts.repeat;\n }\n opts.repeat = 0;\n if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== \"0\") {\n if (opts.radixPoint === \".\") {\n opts.groupSeparator = \",\";\n } else if (opts.radixPoint === \",\") {\n opts.groupSeparator = \".\";\n } else opts.groupSeparator = \"\";\n }\n if (opts.groupSeparator === \" \") {\n opts.skipOptionalPartCharacter = undefined;\n }\n opts.autoGroup = opts.autoGroup && opts.groupSeparator !== \"\";\n if (opts.autoGroup) {\n if (typeof opts.groupSize == \"string\" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);\n if (isFinite(opts.integerDigits)) {\n var seps = Math.floor(opts.integerDigits / opts.groupSize);\n var mod = opts.integerDigits % opts.groupSize;\n opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);\n if (opts.integerDigits < 1) {\n opts.integerDigits = \"*\";\n }\n }\n }\n if (opts.placeholder.length > 1) {\n opts.placeholder = opts.placeholder.charAt(0);\n }\n if (opts.positionCaretOnClick === \"radixFocus\" && (opts.placeholder === \"\" && opts.integerOptional === false)) {\n opts.positionCaretOnClick = \"lvp\";\n }\n opts.definitions[\";\"] = opts.definitions[\"~\"];\n opts.definitions[\";\"].definitionSymbol = \"~\";\n if (opts.numericInput === true) {\n opts.positionCaretOnClick = opts.positionCaretOnClick === \"radixFocus\" ? \"lvp\" : opts.positionCaretOnClick;\n opts.digitsOptional = false;\n if (isNaN(opts.digits)) opts.digits = 2;\n opts.decimalProtect = false;\n }\n var mask = \"[+]\";\n mask += autoEscape(opts.prefix, opts);\n if (opts.integerOptional === true) {\n mask += \"~{1,\" + opts.integerDigits + \"}\";\n } else mask += \"~{\" + opts.integerDigits + \"}\";\n if (opts.digits !== undefined) {\n var radixDef = opts.decimalProtect ? \":\" : opts.radixPoint;\n var dq = opts.digits.toString().split(\",\");\n if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {\n mask += radixDef + \";{\" + opts.digits + \"}\";\n } else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {\n if (opts.digitsOptional) {\n mask += \"[\" + radixDef + \";{1,\" + opts.digits + \"}]\";\n } else mask += radixDef + \";{\" + opts.digits + \"}\";\n }\n }\n mask += autoEscape(opts.suffix, opts);\n mask += \"[-]\";\n opts.greedy = false;\n return mask;\n },\n placeholder: \"\",\n greedy: false,\n digits: \"*\",\n digitsOptional: true,\n enforceDigitsOnBlur: false,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n groupSize: 3,\n groupSeparator: \"\",\n autoGroup: false,\n allowMinus: true,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n integerDigits: \"+\",\n integerOptional: true,\n prefix: \"\",\n suffix: \"\",\n rightAlign: true,\n decimalProtect: true,\n min: null,\n max: null,\n step: 1,\n insertMode: true,\n autoUnmask: false,\n unmaskAsNumber: false,\n inputType: \"text\",\n inputmode: \"numeric\",\n preValidation: function(buffer, pos, c, isSelection, opts, maskset) {\n if (c === \"-\" || c === opts.negationSymbol.front) {\n if (opts.allowMinus !== true) return false;\n opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;\n if (buffer.join(\"\") === \"\") return true;\n return {\n caret: maskset.validPositions[pos] ? pos : undefined,\n dopost: true\n };\n }\n if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {\n var radixPos = $.inArray(opts.radixPoint, buffer);\n if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {\n if (opts.numericInput === true) {\n return pos === radixPos;\n }\n return {\n caret: radixPos + 1\n };\n }\n }\n return true;\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n function buildPostMask(buffer, opts) {\n var postMask = \"\";\n postMask += \"(\" + opts.groupSeparator + \"*{\" + opts.groupSize + \"}){*}\";\n if (opts.radixPoint !== \"\") {\n var radixSplit = buffer.join(\"\").split(opts.radixPoint);\n if (radixSplit[1]) {\n postMask += opts.radixPoint + \"*{\" + radixSplit[1].match(/^\\d*\\??\\d*/)[0].length + \"}\";\n }\n }\n return postMask;\n }\n var suffix = opts.suffix.split(\"\"), prefix = opts.prefix.split(\"\");\n if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;\n var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;\n var maskedValue = buffer.slice();\n if (opts.numericInput) {\n caretPos = maskedValue.length - caretPos - 1;\n maskedValue = maskedValue.reverse();\n }\n var charAtPos = maskedValue[caretPos];\n if (charAtPos === opts.groupSeparator) {\n caretPos += 1;\n charAtPos = maskedValue[caretPos];\n }\n if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n maskedValue[caretPos] = \"?\";\n if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {\n prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = \"?\";\n } else if (opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0)) {\n suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = \"?\";\n }\n }\n }\n prefix = prefix.join(\"\");\n suffix = suffix.join(\"\");\n var processValue = maskedValue.join(\"\").replace(prefix, \"\");\n processValue = processValue.replace(suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n if (isNaN(opts.placeholder)) {\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), \"g\"), \"\");\n }\n if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {\n if (charAtPos === \"0\") {\n processValue = processValue.replace(/^\\?/g, \"\");\n }\n processValue = processValue.replace(/^0/g, \"\");\n }\n if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== \"\" && opts.numericInput !== true) {\n processValue = \"0\" + processValue;\n }\n if (processValue !== \"\") {\n processValue = processValue.split(\"\");\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && isFinite(opts.digits)) {\n var radixPosition = $.inArray(opts.radixPoint, processValue);\n var rpb = $.inArray(opts.radixPoint, maskedValue);\n if (radixPosition === -1) {\n processValue.push(opts.radixPoint);\n radixPosition = processValue.length - 1;\n }\n for (var i = 1; i <= opts.digits; i++) {\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {\n processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);\n } else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {\n processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];\n }\n }\n }\n if (opts.autoGroup === true && opts.groupSeparator !== \"\" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {\n var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;\n processValue = Inputmask(buildPostMask(processValue, opts), {\n numericInput: true,\n jitMasking: true,\n definitions: {\n \"*\": {\n validator: \"[0-9?]\",\n cardinality: 1\n }\n }\n }).format(processValue.join(\"\"));\n if (addRadix) processValue += opts.radixPoint;\n if (processValue.charAt(0) === opts.groupSeparator) {\n processValue.substr(1);\n }\n } else processValue = processValue.join(\"\");\n }\n if (opts.isNegative && currentResult.event === \"blur\") {\n opts.isNegative = processValue !== \"0\";\n }\n processValue = prefix + processValue;\n processValue += suffix;\n if (opts.isNegative) {\n processValue = opts.negationSymbol.front + processValue;\n processValue += opts.negationSymbol.back;\n }\n processValue = processValue.split(\"\");\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n caretPos = $.inArray(\"?\", processValue);\n if (caretPos > -1) {\n processValue[caretPos] = charAtPos;\n } else caretPos = currentResult.caret || 0;\n } else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {\n var newCaretPos = $.inArray(charAtPos, processValue);\n if (newCaretPos !== -1) caretPos = newCaretPos;\n }\n }\n if (opts.numericInput) {\n caretPos = processValue.length - caretPos - 1;\n processValue = processValue.reverse();\n }\n var rslt = {\n caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,\n buffer: processValue,\n refreshFromBuffer: currentResult.dopost || buffer.join(\"\") !== processValue.join(\"\")\n };\n return rslt.refreshFromBuffer ? rslt : currentResult;\n },\n onBeforeWrite: function(e, buffer, caretPos, opts) {\n function parseMinMaxOptions(opts) {\n if (opts.parseMinMaxOptions === undefined) {\n if (opts.min !== null) {\n opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.min = opts.min.replace(opts.radixPoint, \".\");\n opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;\n if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;\n }\n if (opts.max !== null) {\n opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.max = opts.max.replace(opts.radixPoint, \".\");\n opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;\n if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;\n }\n opts.parseMinMaxOptions = \"done\";\n }\n }\n if (e) {\n switch (e.type) {\n case \"keydown\":\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n dopost: true\n }, opts);\n\n case \"blur\":\n case \"checkval\":\n var unmasked;\n parseMinMaxOptions(opts);\n if (opts.min !== null || opts.max !== null) {\n unmasked = opts.onUnMask(buffer.join(\"\"), undefined, $.extend({}, opts, {\n unmaskAsNumber: true\n }));\n if (opts.min !== null && unmasked < opts.min) {\n opts.isNegative = opts.min < 0;\n return opts.postValidation(opts.min.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n } else if (opts.max !== null && unmasked > opts.max) {\n opts.isNegative = opts.max < 0;\n return opts.postValidation(opts.max.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n }\n }\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n placeholder: \"0\",\n event: \"blur\"\n }, opts);\n\n case \"_checkval\":\n return {\n caret: caretPos\n };\n\n default:\n break;\n }\n }\n },\n regex: {\n integerPart: function(opts, emptyCheck) {\n return emptyCheck ? new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\") : new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\\\\d+\");\n },\n integerNPart: function(opts) {\n return new RegExp(\"[\\\\d\" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + \"]+\");\n }\n },\n definitions: {\n \"~\": {\n validator: function(chrs, maskset, pos, strict, opts, isSelection) {\n var isValid, l;\n if (chrs === \"k\" || chrs === \"m\") {\n isValid = {\n insert: [],\n c: 0\n };\n for (var i = 0, l = chrs === \"k\" ? 2 : 5; i < l; i++) {\n isValid.insert.push({\n pos: pos + i,\n c: 0\n });\n }\n isValid.pos = pos + l;\n return isValid;\n }\n isValid = strict ? new RegExp(\"[0-9\" + Inputmask.escapeRegex(opts.groupSeparator) + \"]\").test(chrs) : new RegExp(\"[0-9]\").test(chrs);\n if (isValid === true) {\n if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === \"~\" && !isSelection) {\n var processValue = maskset.buffer.join(\"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n var pvRadixSplit = processValue.split(opts.radixPoint);\n if (pvRadixSplit.length > 1) {\n pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));\n }\n if (pvRadixSplit[0] === \"0\") {\n pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));\n }\n processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || \"\";\n var bufferTemplate = maskset._buffer.join(\"\");\n if (processValue === opts.radixPoint) {\n processValue = bufferTemplate;\n }\n while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + \"$\") === null) {\n bufferTemplate = bufferTemplate.slice(1);\n }\n processValue = processValue.replace(bufferTemplate, \"\");\n processValue = processValue.split(\"\");\n if (processValue[pos] === undefined) {\n isValid = {\n pos: pos,\n remove: pos\n };\n } else {\n isValid = {\n pos: pos\n };\n }\n }\n } else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {\n isValid = {\n insert: {\n pos: pos,\n c: 0\n },\n pos: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1\n },\n \"+\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && (chrs === \"-\" || chrs === opts.negationSymbol.front);\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \"-\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && chrs === opts.negationSymbol.back;\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \":\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n var radix = \"[\" + Inputmask.escapeRegex(opts.radixPoint) + \"]\";\n var isValid = new RegExp(radix).test(chrs);\n if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {\n isValid = {\n caret: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1,\n placeholder: function(opts) {\n return opts.radixPoint;\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n if (unmaskedValue === \"\" && opts.nullable === true) {\n return unmaskedValue;\n }\n var processValue = maskedValue.replace(opts.prefix, \"\");\n processValue = processValue.replace(opts.suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.placeholder.charAt(0) !== \"\") {\n processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), \"g\"), \"0\");\n }\n if (opts.unmaskAsNumber) {\n if (opts.radixPoint !== \"\" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), \".\");\n processValue = processValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n return Number(processValue);\n }\n return processValue;\n },\n isComplete: function(buffer, opts) {\n var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join(\"\");\n maskedValue = maskedValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n maskedValue = maskedValue.replace(opts.prefix, \"\");\n maskedValue = maskedValue.replace(opts.suffix, \"\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\");\n if (opts.radixPoint === \",\") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), \".\");\n return isFinite(maskedValue);\n },\n onBeforeMask: function(initialValue, opts) {\n opts.isNegative = undefined;\n var radixPoint = opts.radixPoint || \",\";\n if ((typeof initialValue == \"number\" || opts.inputType === \"number\") && radixPoint !== \"\") {\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\\-0-9]/g, \"\"), decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, \"\") : \"\";\n initialValue = integerPart + (decimalPart !== \"\" ? radixPoint + decimalPart : decimalPart);\n var digits = 0;\n if (radixPoint !== \"\") {\n digits = decimalPart.length;\n if (decimalPart !== \"\") {\n var digitsFactor = Math.pow(10, digits || 1);\n if (isFinite(opts.digits)) {\n digits = parseInt(opts.digits);\n digitsFactor = Math.pow(10, digits);\n }\n initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), \".\");\n if (isFinite(initialValue)) initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n }\n if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {\n initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));\n }\n return alignDigits(initialValue.toString().split(\"\"), digits, opts).join(\"\");\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var $input = $(this);\n if (e.ctrlKey) {\n switch (e.keyCode) {\n case Inputmask.keyCode.UP:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n\n case Inputmask.keyCode.DOWN:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n }\n }\n }\n },\n currency: {\n prefix: \"$ \",\n groupSeparator: \",\",\n alias: \"numeric\",\n placeholder: \"0\",\n autoGroup: true,\n digits: 2,\n digitsOptional: false,\n clearMaskOnLostFocus: false\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n digits: 0,\n radixPoint: \"\"\n },\n percentage: {\n alias: \"numeric\",\n digits: 2,\n digitsOptional: true,\n radixPoint: \".\",\n placeholder: \"0\",\n autoGroup: false,\n min: 0,\n max: 100,\n suffix: \" %\",\n allowMinus: false\n }\n });\n return Inputmask;\n});","/*!\n* dependencyLibs/inputmask.dependencyLib.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (typeof define === \"function\" && define.amd) {\n define([ \"../global/window\" ], factory);\n } else if (typeof exports === \"object\") {\n module.exports = factory(require(\"../global/window\"));\n } else {\n window.dependencyLib = factory(window);\n }\n})(function(window) {\n var document = window.document;\n function indexOf(list, elem) {\n var i = 0, len = list.length;\n for (;i < len; i++) {\n if (list[i] === elem) {\n return i;\n }\n }\n return -1;\n }\n function isWindow(obj) {\n return obj != null && obj === obj.window;\n }\n function isArraylike(obj) {\n var length = \"length\" in obj && obj.length, ltype = typeof obj;\n if (ltype === \"function\" || isWindow(obj)) {\n return false;\n }\n if (obj.nodeType === 1 && length) {\n return true;\n }\n return ltype === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n function isValidElement(elem) {\n return elem instanceof Element;\n }\n function DependencyLib(elem) {\n if (elem instanceof DependencyLib) {\n return elem;\n }\n if (!(this instanceof DependencyLib)) {\n return new DependencyLib(elem);\n }\n if (elem !== undefined && elem !== null && elem !== window) {\n this[0] = elem.nodeName ? elem : elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem);\n if (this[0] !== undefined && this[0] !== null) {\n this[0].eventRegistry = this[0].eventRegistry || {};\n }\n }\n }\n function getWindow(elem) {\n return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;\n }\n DependencyLib.prototype = {\n on: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var addEvent = function(ev, namespace) {\n if (elem.addEventListener) {\n elem.addEventListener(ev, handler, false);\n } else if (elem.attachEvent) {\n elem.attachEvent(\"on\" + ev, handler);\n }\n eventRegistry[ev] = eventRegistry[ev] || {};\n eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];\n eventRegistry[ev][namespace].push(handler);\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n addEvent(ev, namespace);\n }\n }\n return this;\n },\n off: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var removeEvent = function(ev, namespace, handler) {\n if (ev in eventRegistry === true) {\n if (elem.removeEventListener) {\n elem.removeEventListener(ev, handler, false);\n } else if (elem.detachEvent) {\n elem.detachEvent(\"on\" + ev, handler);\n }\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);\n }\n } else {\n eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);\n }\n }\n };\n var resolveNamespace = function(ev, namespace) {\n var evts = [], hndx, hndL;\n if (ev.length > 0) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: eventRegistry[ev][namespace][hndx]\n });\n }\n } else {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: handler\n });\n }\n } else if (namespace.length > 0) {\n for (var evNdx in eventRegistry) {\n for (var nmsp in eventRegistry[evNdx]) {\n if (nmsp === namespace) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: eventRegistry[evNdx][nmsp][hndx]\n });\n }\n } else {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: handler\n });\n }\n }\n }\n }\n }\n return evts;\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);\n for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {\n removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);\n }\n }\n }\n return this;\n },\n trigger: function(events) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var _events = typeof events === \"string\" ? events.split(\" \") : [ events.type ];\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n if (document !== undefined && namespace === \"global\") {\n var evnt, i, params = {\n bubbles: true,\n cancelable: true,\n detail: arguments[1]\n };\n if (document.createEvent) {\n try {\n evnt = new CustomEvent(ev, params);\n } catch (e) {\n evnt = document.createEvent(\"CustomEvent\");\n evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);\n }\n if (events.type) DependencyLib.extend(evnt, events);\n elem.dispatchEvent(evnt);\n } else {\n evnt = document.createEventObject();\n evnt.eventType = ev;\n evnt.detail = arguments[1];\n if (events.type) DependencyLib.extend(evnt, events);\n elem.fireEvent(\"on\" + evnt.eventType, evnt);\n }\n } else if (eventRegistry[ev] !== undefined) {\n arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {\n eventRegistry[ev][nmsp][i].apply(elem, arguments);\n }\n }\n } else {\n for (i = 0; i < eventRegistry[ev][namespace].length; i++) {\n eventRegistry[ev][namespace][i].apply(elem, arguments);\n }\n }\n }\n }\n }\n return this;\n }\n };\n DependencyLib.isFunction = function(obj) {\n return typeof obj === \"function\";\n };\n DependencyLib.noop = function() {};\n DependencyLib.isArray = Array.isArray;\n DependencyLib.inArray = function(elem, arr, i) {\n return arr == null ? -1 : indexOf(arr, elem, i);\n };\n DependencyLib.valHooks = undefined;\n DependencyLib.isPlainObject = function(obj) {\n if (typeof obj !== \"object\" || obj.nodeType || isWindow(obj)) {\n return false;\n }\n if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, \"isPrototypeOf\")) {\n return false;\n }\n return true;\n };\n DependencyLib.extend = function() {\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[i] || {};\n i++;\n }\n if (typeof target !== \"object\" && !DependencyLib.isFunction(target)) {\n target = {};\n }\n if (i === length) {\n target = this;\n i--;\n }\n for (;i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n if (target === copy) {\n continue;\n }\n if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && DependencyLib.isArray(src) ? src : [];\n } else {\n clone = src && DependencyLib.isPlainObject(src) ? src : {};\n }\n target[name] = DependencyLib.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n };\n DependencyLib.each = function(obj, callback) {\n var value, i = 0;\n if (isArraylike(obj)) {\n for (var length = obj.length; i < length; i++) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n }\n return obj;\n };\n DependencyLib.data = function(owner, key, value) {\n if (value === undefined) {\n return owner.__data ? owner.__data[key] : null;\n } else {\n owner.__data = owner.__data || {};\n owner.__data[key] = value;\n }\n };\n if (typeof window.CustomEvent === \"function\") {\n DependencyLib.Event = window.CustomEvent;\n } else {\n DependencyLib.Event = function(event, params) {\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n DependencyLib.Event.prototype = window.Event.prototype;\n }\n return DependencyLib;\n});","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./InformationBlock.scss?vue&type=style&index=0&id=270beb42&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!./InformationBlock.scss?vue&type=style&index=0&id=270beb42&scoped=true&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"input-base\",class:[ _vm.required === false ? '' : 'input-required']},[(_vm.label && _vm.label.length > 0)?_c('label',{attrs:{\"for\":_vm.randomId}},[_vm._v(_vm._s(_vm.$t(_vm.label)))]):_vm._e(),_c('div',[(_vm.readonly)?_c('span',{attrs:{\"name\":_vm.name}},[_vm._v(_vm._s(_vm.value))]):_vm._e(),(!_vm.readonly)?_c('input',{directives:[{name:\"mask\",rawName:\"v-mask\",value:(_vm.maskConfig),expression:\"maskConfig\"}],attrs:{\"type\":_vm.inputType,\"name\":_vm.name,\"id\":_vm.randomId,\"required\":_vm.required,\"disabled\":_vm.disabled,\"placeholder\":_vm.placeholder,\"initialValue\":_vm.initialValue},domProps:{\"value\":_vm.value},on:{\"input\":function($event){return _vm.$emit('input', $event.target.value)},\"focus\":_vm.onFocus,\"blur\":_vm.onBlur,\"change\":_vm.maskCheck}}):_vm._e(),_c('span',{staticClass:\"validity\"})])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import Vue, { WatchOptions } from 'vue';\r\nimport { Component, Prop, Watch } from 'vue-property-decorator';\r\nimport InputBase from '@/components/inputs/base/InputBase';\r\n// tslint:disable-next-line: no-var-requires\r\nconst VueInputMask = require('vue-inputmask').default;\r\n// tslint:disable-next-line: no-var-requires\r\nconst Inputmask = require('inputmask');\r\n\r\nVue.use(VueInputMask);\r\n\r\n@Component\r\nexport default class InputMaskedText extends InputBase {\r\n\r\n /**\r\n * Complete list of mask config can be found here:\r\n * https://github.com/RobinHerbots/Inputmask/blob/5.x/lib/inputmask.js\r\n */\r\n @Prop() public maskConfig?: object;\r\n @Prop() public initialValue?: string;\r\n @Prop() public option?: string;\r\n protected isComplete: boolean = false;\r\n\r\n protected mounted() {\r\n this.inputType = 'text';\r\n this.isComplete = false;\r\n }\r\n\r\n protected maskCheck(field: any): void {\r\n this.isComplete = field.target.inputmask.isComplete();\r\n this.$emit('input-masked-is-valid', this.isComplete);\r\n }\r\n\r\n /**\r\n * Override onValueChanged from InputBase\r\n */\r\n protected onValueChanged(value: string, oldValue: string) {\r\n if (oldValue !== value && value !== undefined) {\r\n const isValid = Inputmask(this.maskConfig).isValid(value);\r\n if (isValid) {\r\n this.isComplete = true;\r\n this.$emit('input-masked-is-valid', this.isComplete);\r\n }\r\n }\r\n }\r\n\r\n protected onFocus() {\r\n if (!this.value) {\r\n this.$emit('input', this.initialValue);\r\n }\r\n }\r\n protected onBlur() {\r\n if (this.value === this.initialValue) {\r\n this.$emit('input', '');\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!./InputMaskedText.ts?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!./InputMaskedText.ts?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./InputMaskedText.vue?vue&type=template&id=e366abf2&\"\nimport script from \"./InputMaskedText.ts?vue&type=script&lang=ts&\"\nexport * from \"./InputMaskedText.ts?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/*!\n* inputmask.date.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (typeof define === \"function\" && define.amd) {\n define([ \"./inputmask\" ], factory);\n } else if (typeof exports === \"object\") {\n module.exports = factory(require(\"./inputmask\"));\n } else {\n factory(window.Inputmask);\n }\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n var formatCode = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return pad(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return pad(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ \"\" ],\n mmmm: [ \"\" ],\n yy: [ \"[0-9]{2}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 2);\n } ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 4);\n } ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n hhh: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n HHH: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return pad(Date.prototype.getMinutes.call(this), 2);\n } ],\n ss: [ \"[0-5][0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return pad(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 3);\n } ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 2);\n } ],\n t: [ \"[ap]\" ],\n tt: [ \"[ap]m\" ],\n T: [ \"[AP]\" ],\n TT: [ \"[AP]M\" ],\n Z: [ \"\" ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, formatAlias = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function getTokenizer(opts) {\n if (!opts.tokenizer) {\n var tokens = [];\n for (var ndx in formatCode) {\n if (tokens.indexOf(ndx[0]) === -1) tokens.push(ndx[0]);\n }\n opts.tokenizer = \"(\" + tokens.join(\"+|\") + \")+?|.\";\n opts.tokenizer = new RegExp(opts.tokenizer, \"g\");\n }\n return opts.tokenizer;\n }\n function isValidDate(dateParts, currentResult) {\n 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;\n }\n function isDateInRange(dateParts, opts) {\n var result = true;\n if (opts.min) {\n if (dateParts[\"rawyear\"]) {\n var rawYear = dateParts[\"rawyear\"].replace(/[^0-9]/g, \"\"), minYear = opts.min.year.substr(0, rawYear.length);\n result = minYear <= rawYear;\n }\n if (dateParts[\"year\"] === dateParts[\"rawyear\"]) {\n if (opts.min.date.getTime() === opts.min.date.getTime()) {\n result = opts.min.date.getTime() <= dateParts.date.getTime();\n }\n }\n }\n if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {\n result = opts.max.date.getTime() >= dateParts.date.getTime();\n }\n return result;\n }\n function parse(format, dateObjValue, opts, raw) {\n var mask = \"\", match;\n while (match = getTokenizer(opts).exec(format)) {\n if (dateObjValue === undefined) {\n if (formatCode[match[0]]) {\n mask += \"(\" + formatCode[match[0]][0] + \")\";\n } else {\n switch (match[0]) {\n case \"[\":\n mask += \"(\";\n break;\n\n case \"]\":\n mask += \")?\";\n break;\n\n default:\n mask += Inputmask.escapeRegex(match[0]);\n }\n }\n } else {\n if (formatCode[match[0]]) {\n if (raw !== true && formatCode[match[0]][3]) {\n var getFn = formatCode[match[0]][3];\n mask += getFn.call(dateObjValue.date);\n } else if (formatCode[match[0]][2]) mask += dateObjValue[\"raw\" + formatCode[match[0]][2]]; else mask += match[0];\n } else mask += match[0];\n }\n }\n return mask;\n }\n function pad(val, len) {\n val = String(val);\n len = len || 2;\n while (val.length < len) val = \"0\" + val;\n return val;\n }\n function analyseMask(maskString, format, opts) {\n var dateObj = {\n date: new Date(1, 0, 1)\n }, targetProp, mask = maskString, match, dateOperation, targetValidator;\n function extendProperty(value) {\n var correctedValue = value.replace(/[^0-9]/g, \"0\");\n if (correctedValue != value) {\n var enteredPart = value.replace(/[^0-9]/g, \"\"), min = (opts.min && opts.min[targetProp] || value).toString(), max = (opts.max && opts.max[targetProp] || value).toString();\n 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));\n }\n return correctedValue;\n }\n function setValue(dateObj, value, opts) {\n dateObj[targetProp] = extendProperty(value);\n dateObj[\"raw\" + targetProp] = value;\n if (dateOperation !== undefined) dateOperation.call(dateObj.date, targetProp == \"month\" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);\n }\n if (typeof mask === \"string\") {\n while (match = getTokenizer(opts).exec(format)) {\n var value = mask.slice(0, match[0].length);\n if (formatCode.hasOwnProperty(match[0])) {\n targetValidator = formatCode[match[0]][0];\n targetProp = formatCode[match[0]][2];\n dateOperation = formatCode[match[0]][1];\n setValue(dateObj, value, opts);\n }\n mask = mask.slice(value.length);\n }\n return dateObj;\n } else if (mask && typeof mask === \"object\" && mask.hasOwnProperty(\"date\")) {\n return mask;\n }\n return undefined;\n }\n Inputmask.extendAliases({\n datetime: {\n mask: function(opts) {\n formatCode.S = opts.i18n.ordinalSuffix.join(\"|\");\n opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat;\n opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat;\n opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat;\n opts.placeholder = opts.placeholder !== \"\" ? opts.placeholder : opts.inputFormat.replace(/[\\[\\]]/, \"\");\n opts.regex = parse(opts.inputFormat, undefined, opts);\n return null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: undefined,\n outputFormat: undefined,\n min: null,\n max: null,\n i18n: {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n opts.min = analyseMask(opts.min, opts.inputFormat, opts);\n opts.max = analyseMask(opts.max, opts.inputFormat, opts);\n var result = currentResult, dateParts = analyseMask(buffer.join(\"\"), opts.inputFormat, opts);\n if (result && dateParts.date.getTime() === dateParts.date.getTime()) {\n result = isValidDate(dateParts, result);\n result = result && isDateInRange(dateParts, opts);\n }\n if (pos && result && currentResult.pos !== pos) {\n return {\n buffer: parse(opts.inputFormat, dateParts, opts),\n refreshFromBuffer: {\n start: pos,\n end: currentResult.pos\n }\n };\n }\n return result;\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var input = this;\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\n var today = new Date(), match, date = \"\";\n while (match = getTokenizer(opts).exec(opts.inputFormat)) {\n if (match[0].charAt(0) === \"d\") {\n date += pad(today.getDate(), match[0].length);\n } else if (match[0].charAt(0) === \"m\") {\n date += pad(today.getMonth() + 1, match[0].length);\n } else if (match[0] === \"yyyy\") {\n date += today.getFullYear().toString();\n } else if (match[0].charAt(0) === \"y\") {\n date += pad(today.getYear(), match[0].length);\n }\n }\n input.inputmask._valueSet(date);\n $(input).trigger(\"setvalue\");\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);\n },\n casing: function(elem, test, pos, validPositions) {\n if (test.nativeDef.indexOf(\"[ap]\") == 0) return elem.toLowerCase();\n if (test.nativeDef.indexOf(\"[AP]\") == 0) return elem.toUpperCase();\n return elem;\n },\n insertMode: false,\n shiftPositions: false\n }\n });\n return Inputmask;\n});"],"sourceRoot":""}