{"version":3,"sources":["webpack:///./LeLab.Web/src/js/form-validation.entry.js","webpack:///./node_modules/aspnet-validation/dist/aspnet-validation.js"],"names":["BarbaValidationService","ValidationService","constructor","super","this","addMvcProviders","beforeEnter","bind","afterLeave","PageHooks","data","current","elementUIDs","forEach","node","uid","container","contains","removeUID","scanMessages","scanInputs","elementByUID","nodeName","removeEventListener","elementEvents","messageFor","name","uidIndex","map","o","indexOf","splice","formInputs","summary","validators","renderSummary","factory","window","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","getter","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","n","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","MvcValidationProviders","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","length","push","getRelativeFormElement","elementName","selector","realSelector","substr","dotLocation","lastIndexOf","relativeElementName","relativeElement","document","getElementsByName","required","element","params","Boolean","stringLength","min","parseInt","max","compare","other","otherElement","range","val","parseFloat","isNaN","regex","pattern","RegExp","test","email","creditcard","cDigit","nCheck","nDigit","bEven","replace","charAt","url","phone","remote","fieldSelectors","additionalfields","split","fields","_i","fieldSelectors_1","fieldSelector","fieldName","fieldElement","encodedParams","encodedParam","encodeURIComponent","payload","join","ok","request","XMLHttpRequest","type","postData","FormData","append","open","setRequestHeader","send","onload","status","JSON","parse","responseText","statusText","onerror","providers","debounce","addProvider","callback","mvc","validationMessageElements","querySelectorAll","name_1","getAttribute","parseDirectives","attributes","directives","validationAtributes","cut","a","_loop_1","parameters","keys","filter","Q","directive","error","pcut","pvalue","pkey","guid4","Math","random","toString","getElementUID","x","getFormValidationTask","formUID","formInputUIDs","formValidators","inputUID","tasks","all","every","trackFormInput","form","_this","cb","validate","preventDefault","success","submit","catch","console","log","addEventListener","uids_1","input","classList","remove","spans","innerHTML","addInput","createValidator","delay","clearTimeout","setTimeout","tagName","toLowerCase","inputs","createSummaryDOM","ul","createElement","li","appendChild","summaryElements","shadow","stringify","sort","renderedSummaryJSON","className","cloneNode","addError","message","add","removeError","_a","_b","provider","valid","resolution","_c","bootstrap","event"],"mappings":"4FAAA,0BAKA,MAAMA,UAA+BC,oBACjCC,cACIC,QAEAC,KAAKC,kBAEL,MAAMC,EAAcF,KAAKE,YAAYC,KAAKH,MACpCI,EAAaJ,KAAKI,WAAWD,KAAKH,MAExC,IAAI,cAAcK,IACdH,YAAYI,GACRJ,EAAYI,GAEhBF,WAAWE,GACPF,EAAWE,KAIvBF,YAAW,QAAEG,IACT,IAAIP,KAAKQ,aAAaC,QAAQ,EAAGC,OAAMC,UAC/BJ,EAAQK,UAAUC,SAASH,IAC3BV,KAAKc,UAAUH,KAI3BT,cACIF,KAAKe,eACLf,KAAKgB,aAETF,UAAUH,GACN,MAAMD,EAAOV,KAAKiB,aAAaN,GAG/B,OAAQD,EAAKQ,UACT,IAAK,OACDR,EAAKS,oBAAoB,SAAUnB,KAAKoB,cAAcT,IAGtD,MACJ,IAAK,SACDD,EAAKS,oBAAoB,SAAUnB,KAAKoB,cAAcT,IACtD,MACJ,QACID,EAAKS,oBAAoB,QAASnB,KAAKoB,cAAcT,IAIxC,SAAlBD,EAAKQ,iBACGlB,KAAKqB,WAAWX,EAAKY,MAIhC,MAAMC,EAAWvB,KAAKQ,YAAYgB,IAAIC,GAAKA,EAAEd,KAAKe,QAAQf,GAC1DX,KAAKQ,YAAYmB,OAAOJ,EAAU,UAG3BvB,KAAKiB,aAAaN,UAClBX,KAAKoB,cAAcT,UACnBX,KAAK4B,WAAWjB,UAChBX,KAAK6B,QAAQlB,UACbX,KAAK8B,WAAWnB,GAGvBX,KAAK+B,iBAIb,IAAInC,G,mBCxEJ,IAAiDoC,EAS9CC,OAT8CD,EAStC,WACX,OAAgB,SAAUE,GAEhB,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiB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OD,QAAUN,M","file":"form-validation.js","sourcesContent":["// NOTE: on assume qu'un Promise polyfill est déjà loadé dans IE\r\n\r\nimport { PageHooks } from \"barba\"\r\nimport { ValidationService } from \"aspnet-validation\"\r\n\r\nclass BarbaValidationService extends ValidationService {\r\n constructor() {\r\n super()\r\n\r\n this.addMvcProviders()\r\n\r\n const beforeEnter = this.beforeEnter.bind(this)\r\n const afterLeave = this.afterLeave.bind(this)\r\n\r\n new class extends PageHooks {\r\n beforeEnter(data) {\r\n beforeEnter(data)\r\n }\r\n afterLeave(data) {\r\n afterLeave(data)\r\n }\r\n }\r\n }\r\n afterLeave({ current }) {\r\n [...this.elementUIDs].forEach(({ node, uid }) => {\r\n if (current.container.contains(node)) {\r\n this.removeUID(uid)\r\n }\r\n })\r\n }\r\n beforeEnter() {\r\n this.scanMessages()\r\n this.scanInputs()\r\n }\r\n removeUID(uid) {\r\n const node = this.elementByUID[uid]\r\n\r\n // Remove listener\r\n switch (node.nodeName) {\r\n case 'FORM':\r\n node.removeEventListener(\"submit\", this.elementEvents[uid])\r\n // Note : It's impossible to remove form \"reset\" listener\r\n // because of anonymous function.\r\n break\r\n case 'SELECT':\r\n node.removeEventListener(\"change\", this.elementEvents[uid])\r\n break\r\n default:\r\n node.removeEventListener(\"input\", this.elementEvents[uid])\r\n }\r\n\r\n // Remove messages\r\n if(node.nodeName !== \"FORM\") {\r\n delete this.messageFor[node.name]\r\n }\r\n\r\n // Remove from elementUIDs array\r\n const uidIndex = this.elementUIDs.map(o => o.uid).indexOf(uid)\r\n this.elementUIDs.splice(uidIndex, 1);\r\n\r\n // Delete properties\r\n delete this.elementByUID[uid]\r\n delete this.elementEvents[uid]\r\n delete this.formInputs[uid]\r\n delete this.summary[uid]\r\n delete this.validators[uid]\r\n\r\n // Update summary render\r\n this.renderSummary()\r\n }\r\n}\r\n\r\nnew BarbaValidationService()\r\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"aspnetValidation\"] = factory();\n\telse\n\t\troot[\"aspnetValidation\"] = factory();\n})(window, function() {\nreturn /******/ (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, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\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 = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/index.ts\":\n/*!**********************!*\\\n !*** ./src/index.ts ***!\n \\**********************/\n/*! exports provided: MvcValidationProviders, ValidationService */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MvcValidationProviders\", function() { return MvcValidationProviders; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ValidationService\", function() { return ValidationService; });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\n/**\r\n * Resolves and returns the element referred by original element using ASP.NET selector logic.\r\n * @param elementName\r\n */\r\nfunction getRelativeFormElement(elementName, selector) {\r\n // example elementName: Form.PasswordConfirm, Form.Email\r\n // example selector (dafuq): *.Password, *.__RequestVerificationToken\r\n // example result element name: Form.Password, __RequestVerificationToken\r\n var realSelector = selector.substr(2); // Password, __RequestVerificationToken\r\n var objectName = '';\r\n var dotLocation = elementName.lastIndexOf('.');\r\n if (dotLocation > -1) {\r\n // Form\r\n objectName = elementName.substr(0, dotLocation);\r\n // Form.Password\r\n var relativeElementName = objectName + '.' + realSelector;\r\n var relativeElement = document.getElementsByName(relativeElementName)[0];\r\n if (relativeElement) {\r\n return relativeElement;\r\n }\r\n }\r\n // __RequestVerificationToken\r\n return document.getElementsByName(realSelector)[0];\r\n}\r\n/**\r\n * Contains default implementations for ASP.NET Core MVC validation attributes.\r\n */\r\nvar MvcValidationProviders = /** @class */ (function () {\r\n function MvcValidationProviders() {\r\n /**\r\n * Validates whether the input has a value.\r\n */\r\n this.required = function (value, element, params) {\r\n return Boolean(value);\r\n };\r\n /**\r\n * Validates whether the input value satisfies the length contstraint.\r\n */\r\n this.stringLength = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n if (params.min) {\r\n var min = parseInt(params.min);\r\n if (value.length < min) {\r\n return false;\r\n }\r\n }\r\n if (params.max) {\r\n var max = parseInt(params.max);\r\n if (value.length > max) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Validates whether the input value is equal to another input value.\r\n */\r\n this.compare = function (value, element, params) {\r\n if (!params.other) {\r\n return true;\r\n }\r\n var otherElement = getRelativeFormElement(element.name, params.other);\r\n if (!otherElement) {\r\n return true;\r\n }\r\n return (otherElement.value === value);\r\n };\r\n /**\r\n * Validates whether the input value is a number within a given range.\r\n */\r\n this.range = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n var val = parseFloat(value);\r\n if (isNaN(val)) {\r\n return false;\r\n }\r\n if (params.min) {\r\n var min = parseFloat(params.min);\r\n if (val < min) {\r\n return false;\r\n }\r\n }\r\n if (params.max) {\r\n var max = parseFloat(params.max);\r\n if (val > max) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Validates whether the input value satisfies a regular expression pattern.\r\n */\r\n this.regex = function (value, element, params) {\r\n if (!value || !params.pattern) {\r\n return true;\r\n }\r\n var r = new RegExp(params.pattern);\r\n return r.test(value);\r\n };\r\n /**\r\n * Validates whether the input value is an email in accordance to RFC822 specification, with a top level domain.\r\n */\r\n this.email = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // RFC822 email address with .TLD validation\r\n // (c) Richard Willis, Chris Ferdinandi, MIT Licensed\r\n // https://gist.github.com/badsyntax/719800\r\n // https://gist.github.com/cferdinandi/d04aad4ce064b8da3edf21e26f8944c4\r\n var r = /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*(\\.\\w{2,})+$/;\r\n return r.test(value);\r\n };\r\n /**\r\n * Validates whether the input value is a credit card number, with Luhn's Algorithm.\r\n */\r\n this.creditcard = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // (c) jquery-validation, MIT Licensed\r\n // https://github.com/jquery-validation/jquery-validation/blob/master/src/additional/creditcard.js\r\n // based on https://en.wikipedia.org/wiki/Luhn_algorithm\r\n // Accept only spaces, digits and dashes\r\n if (/[^0-9 \\-]+/.test(value)) {\r\n return false;\r\n }\r\n var nCheck = 0, nDigit = 0, bEven = false, n, cDigit;\r\n value = value.replace(/\\D/g, \"\");\r\n // Basing min and max length on https://developer.ean.com/general_info/Valid_Credit_Card_Types\r\n if (value.length < 13 || value.length > 19) {\r\n return false;\r\n }\r\n for (n = value.length - 1; n >= 0; n--) {\r\n cDigit = value.charAt(n);\r\n nDigit = parseInt(cDigit, 10);\r\n if (bEven) {\r\n if ((nDigit *= 2) > 9) {\r\n nDigit -= 9;\r\n }\r\n }\r\n nCheck += nDigit;\r\n bEven = !bEven;\r\n }\r\n return (nCheck % 10) === 0;\r\n };\r\n /**\r\n * Validates whether the input value is a URL.\r\n */\r\n this.url = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // (c) Diego Perini, MIT Licensed\r\n // https://gist.github.com/dperini/729294\r\n var r = new RegExp(\"^\" +\r\n // protocol identifier\r\n \"(?:(?:https?|ftp)://)\" +\r\n // user:pass authentication\r\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\r\n \"(?:\" +\r\n // IP address exclusion\r\n // private & local networks\r\n \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" +\r\n \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" +\r\n \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" +\r\n // IP address dotted notation octets\r\n // excludes loopback network 0.0.0.0\r\n // excludes reserved space >= 224.0.0.0\r\n // excludes network & broacast addresses\r\n // (first & last IP address of each class)\r\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\r\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\r\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\r\n \"|\" +\r\n // host name\r\n \"(?:(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)\" +\r\n // domain name\r\n \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*\" +\r\n // TLD identifier\r\n \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,}))\" +\r\n // TLD may end with dot\r\n \"\\\\.?\" +\r\n \")\" +\r\n // port number\r\n \"(?::\\\\d{2,5})?\" +\r\n // resource path\r\n \"(?:[/?#]\\\\S*)?\" +\r\n \"$\", \"i\");\r\n return r.test(value);\r\n };\r\n /**\r\n * Validates whether the input value is a phone number.\r\n */\r\n this.phone = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // Allows whitespace or dash as number separator because some people like to do that...\r\n var consecutiveSeparator = /[\\+\\-\\s][\\-\\s]/g;\r\n if (consecutiveSeparator.test(value)) {\r\n return false;\r\n }\r\n var r = /^\\+?[0-9\\-\\s]+$/;\r\n return r.test(value);\r\n };\r\n /**\r\n * Asynchronously validates the input value to a JSON GET API endpoint.\r\n */\r\n this.remote = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // params.additionalfields: *.Email,*.Username\r\n var fieldSelectors = params.additionalfields.split(',');\r\n var fields = {};\r\n for (var _i = 0, fieldSelectors_1 = fieldSelectors; _i < fieldSelectors_1.length; _i++) {\r\n var fieldSelector = fieldSelectors_1[_i];\r\n var fieldName = fieldSelector.substr(2);\r\n var fieldElement = getRelativeFormElement(element.name, fieldSelector);\r\n var hasValue = Boolean(fieldElement && fieldElement.value);\r\n if (!hasValue) {\r\n continue;\r\n }\r\n fields[fieldName] = fieldElement.value;\r\n }\r\n var url = params['url'];\r\n // console.log(fields);\r\n var encodedParams = [];\r\n for (var fieldName in fields) {\r\n var encodedParam = encodeURIComponent(fieldName) + '=' + encodeURIComponent(fields[fieldName]);\r\n encodedParams.push(encodedParam);\r\n }\r\n var payload = encodedParams.join('&');\r\n // console.log(payload);\r\n return new Promise(function (ok, reject) {\r\n var request = new XMLHttpRequest();\r\n if (params.type === 'Post') {\r\n var postData = new FormData();\r\n for (var fieldName in fields) {\r\n postData.append(fieldName, fields[fieldName]);\r\n }\r\n request.open('post', url);\r\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n request.send(payload);\r\n }\r\n else {\r\n request.open('get', url + '?' + payload);\r\n request.send();\r\n }\r\n request.onload = function (e) {\r\n if (request.status >= 200 && request.status < 300) {\r\n var data = JSON.parse(request.responseText);\r\n ok(data);\r\n }\r\n else {\r\n reject({\r\n status: request.status,\r\n statusText: request.statusText,\r\n data: request.responseText\r\n });\r\n }\r\n };\r\n request.onerror = function (e) {\r\n reject({\r\n status: request.status,\r\n statusText: request.statusText,\r\n data: request.responseText\r\n });\r\n };\r\n });\r\n };\r\n }\r\n return MvcValidationProviders;\r\n}());\r\n\r\n/**\r\n * Responsibles for managing the DOM elements and running the validation providers.\r\n */\r\nvar ValidationService = /** @class */ (function () {\r\n function ValidationService() {\r\n /**\r\n * A key-value collection of loaded validation plugins.\r\n */\r\n this.providers = {};\r\n /**\r\n * A key-value collection of elements for displaying validation messages for an input (by DOM ID).\r\n */\r\n this.messageFor = {};\r\n /**\r\n * A list of managed elements, each having a randomly assigned unique identifier (UID).\r\n */\r\n this.elementUIDs = [];\r\n /**\r\n * A key-value collection of UID to Element for quick lookup.\r\n */\r\n this.elementByUID = {};\r\n /**\r\n * A key-value collection of input UIDs for a
UID.\r\n */\r\n this.formInputs = {};\r\n /**\r\n * A key-value map for input UID to its validator factory.\r\n */\r\n this.validators = {};\r\n /**\r\n * A key-value map for element UID to its trigger element (submit event for , input event for