{ "version": 3, "sources": ["../../UI/Scripts/Plugins/wNumb.js", "../../node_modules/aspnet-client-validation/dist/aspnet-validation.js", "../../node_modules/tiny-slider/src/helpers/raf.js", "../../node_modules/tiny-slider/src/helpers/caf.js", "../../node_modules/tiny-slider/src/helpers/extend.js", "../../node_modules/tiny-slider/src/helpers/checkStorageValue.js", "../../node_modules/tiny-slider/src/helpers/setLocalStorage.js", "../../node_modules/tiny-slider/src/helpers/getSlideId.js", "../../node_modules/tiny-slider/src/helpers/getBody.js", "../../node_modules/tiny-slider/src/helpers/docElement.js", "../../node_modules/tiny-slider/src/helpers/setFakeBody.js", "../../node_modules/tiny-slider/src/helpers/resetFakeBody.js", "../../node_modules/tiny-slider/src/helpers/calc.js", "../../node_modules/tiny-slider/src/helpers/percentageLayout.js", "../../node_modules/tiny-slider/src/helpers/mediaquerySupport.js", "../../node_modules/tiny-slider/src/helpers/createStyleSheet.js", "../../node_modules/tiny-slider/src/helpers/addCSSRule.js", "../../node_modules/tiny-slider/src/helpers/removeCSSRule.js", "../../node_modules/tiny-slider/src/helpers/getCssRulesLength.js", "../../node_modules/tiny-slider/src/helpers/toDegree.js", "../../node_modules/tiny-slider/src/helpers/getTouchDirection.js", "../../node_modules/tiny-slider/src/helpers/forEach.js", "../../node_modules/tiny-slider/src/helpers/classListSupport.js", "../../node_modules/tiny-slider/src/helpers/hasClass.js", "../../node_modules/tiny-slider/src/helpers/addClass.js", "../../node_modules/tiny-slider/src/helpers/removeClass.js", "../../node_modules/tiny-slider/src/helpers/hasAttr.js", "../../node_modules/tiny-slider/src/helpers/getAttr.js", "../../node_modules/tiny-slider/src/helpers/isNodeList.js", "../../node_modules/tiny-slider/src/helpers/setAttrs.js", "../../node_modules/tiny-slider/src/helpers/removeAttrs.js", "../../node_modules/tiny-slider/src/helpers/arrayFromNodeList.js", "../../node_modules/tiny-slider/src/helpers/hideElement.js", "../../node_modules/tiny-slider/src/helpers/showElement.js", "../../node_modules/tiny-slider/src/helpers/isVisible.js", "../../node_modules/tiny-slider/src/helpers/whichProperty.js", "../../node_modules/tiny-slider/src/helpers/has3DTransforms.js", "../../node_modules/tiny-slider/src/helpers/getEndProperty.js", "../../node_modules/tiny-slider/src/helpers/passiveOption.js", "../../node_modules/tiny-slider/src/helpers/addEvents.js", "../../node_modules/tiny-slider/src/helpers/removeEvents.js", "../../node_modules/tiny-slider/src/helpers/events.js", "../../node_modules/tiny-slider/src/helpers/jsTransform.js", "../../node_modules/tiny-slider/src/tiny-slider.js", "../../node_modules/nouislider/dist/nouislider.mjs", "../../UI/Scripts/main.js", "../../node_modules/js-cookie/dist/js.cookie.mjs", "../../node_modules/@ryangjchandler/alpine-tooltip/dist/module.esm.js", "../../UI/Scripts/Plugins/validation.js"], "sourcesContent": ["\uFEFF!function (e) { \"function\" == typeof define && define.amd ? define([], e) : \"object\" == typeof exports ? module.exports = e() : window.wNumb = e() }(function () { \"use strict\"; var o = [\"decimals\", \"thousand\", \"mark\", \"prefix\", \"suffix\", \"encoder\", \"decoder\", \"negativeBefore\", \"negative\", \"edit\", \"undo\"]; function w(e) { return e.split(\"\").reverse().join(\"\") } function h(e, t) { return e.substring(0, t.length) === t } function f(e, t, n) { if ((e[t] || e[n]) && e[t] === e[n]) throw new Error(t) } function x(e) { return \"number\" == typeof e && isFinite(e) } function n(e, t, n, r, i, o, f, u, s, c, a, p) { var d, l, h, g = p, v = \"\", m = \"\"; return o && (p = o(p)), !!x(p) && (!1 !== e && 0 === parseFloat(p.toFixed(e)) && (p = 0), p < 0 && (d = !0, p = Math.abs(p)), !1 !== e && (p = function (e, t) { return e = e.toString().split(\"e\"), (+((e = (e = Math.round(+(e[0] + \"e\" + (e[1] ? +e[1] + t : t)))).toString().split(\"e\"))[0] + \"e\" + (e[1] ? e[1] - t : -t))).toFixed(t) }(p, e)), -1 !== (p = p.toString()).indexOf(\".\") ? (h = (l = p.split(\".\"))[0], n && (v = n + l[1])) : h = p, t && (h = w((h = w(h).match(/.{1,3}/g)).join(w(t)))), d && u && (m += u), r && (m += r), d && s && (m += s), m += h, m += v, i && (m += i), c && (m = c(m, g)), m) } function r(e, t, n, r, i, o, f, u, s, c, a, p) { var d, l = \"\"; return a && (p = a(p)), !(!p || \"string\" != typeof p) && (u && h(p, u) && (p = p.replace(u, \"\"), d = !0), r && h(p, r) && (p = p.replace(r, \"\")), s && h(p, s) && (p = p.replace(s, \"\"), d = !0), i && function (e, t) { return e.slice(-1 * t.length) === t }(p, i) && (p = p.slice(0, -1 * i.length)), t && (p = p.split(t).join(\"\")), n && (p = p.replace(n, \".\")), d && (l += \"-\"), \"\" !== (l = (l += p).replace(/[^0-9\\.\\-.]/g, \"\")) && (l = Number(l), f && (l = f(l)), !!x(l) && l)) } function i(e, t, n) { var r, i = []; for (r = 0; r < o.length; r += 1)i.push(e[o[r]]); return i.push(n), t.apply(\"\", i) } return function e(t) { if (!(this instanceof e)) return new e(t); \"object\" == typeof t && (t = function (e) { var t, n, r, i = {}; for (void 0 === e.suffix && (e.suffix = e.postfix), t = 0; t < o.length; t += 1)if (void 0 === (r = e[n = o[t]])) \"negative\" !== n || i.negativeBefore ? \"mark\" === n && \".\" !== i.thousand ? i[n] = \".\" : i[n] = !1 : i[n] = \"-\"; else if (\"decimals\" === n) { if (!(0 <= r && r < 8)) throw new Error(n); i[n] = r } else if (\"encoder\" === n || \"decoder\" === n || \"edit\" === n || \"undo\" === n) { if (\"function\" != typeof r) throw new Error(n); i[n] = r } else { if (\"string\" != typeof r) throw new Error(n); i[n] = r } return f(i, \"mark\", \"thousand\"), f(i, \"prefix\", \"negative\"), f(i, \"prefix\", \"negativeBefore\"), i }(t), this.to = function (e) { return i(t, n, e) }, this.from = function (e) { return i(t, r, e) }) } });", "(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: isValidatable, 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__, \"isValidatable\", function() { return isValidatable; });\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) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar nullLogger = new (/** @class */ (function () {\n function class_1() {\n this.warn = globalThis.console.warn;\n }\n class_1.prototype.log = function (_) {\n var _args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n _args[_i - 1] = arguments[_i];\n }\n };\n return class_1;\n}()))();\n/**\n * Checks if `element` is validatable (`input`, `select`, `textarea`).\n * @param element The element to check.\n * @returns `true` if validatable, otherwise `false`.\n */\nvar isValidatable = function (element) {\n return element instanceof HTMLInputElement\n || element instanceof HTMLSelectElement\n || element instanceof HTMLTextAreaElement;\n};\nvar validatableElementTypes = ['input', 'select', 'textarea'];\n/**\n * Generates a selector to match validatable elements (`input`, `select`, `textarea`).\n * @param selector An optional selector to apply to the valid input types, e.g. `[data-val=\"true\"]`.\n * @returns The validatable elements.\n */\nvar validatableSelector = function (selector) {\n return validatableElementTypes.map(function (t) { return \"\".concat(t).concat(selector || ''); }).join(',');\n};\n/**\n * Resolves and returns the element referred by original element using ASP.NET selector logic.\n * @param element - The input to validate\n * @param selector - Used to find the field. Ex. *.Password where * replaces whatever prefixes asp.net might add.\n */\nfunction getRelativeFormElement(element, selector) {\n // example elementName: Form.PasswordConfirm, Form.Email\n // example selector (dafuq): *.Password, *.__RequestVerificationToken\n // example result element name: Form.Password, __RequestVerificationToken\n var elementName = element.name;\n var selectedName = selector.substring(2); // Password, __RequestVerificationToken\n var objectName = '';\n var dotLocation = elementName.lastIndexOf('.');\n if (dotLocation > -1) {\n // Form\n objectName = elementName.substring(0, dotLocation);\n // Form.Password\n var relativeElementName = objectName + '.' + selectedName;\n var relativeElement = document.getElementsByName(relativeElementName)[0];\n if (isValidatable(relativeElement)) {\n return relativeElement;\n }\n }\n // __RequestVerificationToken\n return element.form.querySelector(validatableSelector(\"[name=\".concat(selectedName, \"]\")));\n}\n/**\n * Contains default implementations for ASP.NET Core MVC validation attributes.\n */\nvar MvcValidationProviders = /** @class */ (function () {\n function MvcValidationProviders() {\n /**\n * Validates whether the input has a value.\n */\n this.required = function (value, element, params) {\n // Handle single and multiple checkboxes/radio buttons.\n var elementType = element.type.toLowerCase();\n if (elementType === \"checkbox\" || elementType === \"radio\") {\n var allElementsOfThisName = Array.from(element.form.querySelectorAll(validatableSelector(\"[name='\".concat(element.name, \"'][type='\").concat(elementType, \"']\"))));\n for (var _i = 0, allElementsOfThisName_1 = allElementsOfThisName; _i < allElementsOfThisName_1.length; _i++) {\n var element_1 = allElementsOfThisName_1[_i];\n if (element_1 instanceof HTMLInputElement && element_1.checked === true) {\n return true;\n }\n }\n // Checkboxes do not submit a value when unchecked. To work around this, platforms such as ASP.NET render a\n // hidden input with the same name as the checkbox so that a value (\"false\") is still submitted even when\n // the checkbox is not checked. We check this special case here.\n if (elementType === \"checkbox\") {\n var checkboxHiddenInput = element.form.querySelector(\"input[name='\".concat(element.name, \"'][type='hidden']\"));\n if (checkboxHiddenInput instanceof HTMLInputElement && checkboxHiddenInput.value === \"false\") {\n return true;\n }\n }\n return false;\n }\n // Default behavior otherwise.\n return Boolean(value);\n };\n /**\n * Validates whether the input value satisfies the length contstraint.\n */\n this.stringLength = function (value, element, params) {\n if (!value) {\n return true;\n }\n if (params.min) {\n var min = parseInt(params.min);\n if (value.length < min) {\n return false;\n }\n }\n if (params.max) {\n var max = parseInt(params.max);\n if (value.length > max) {\n return false;\n }\n }\n return true;\n };\n /**\n * Validates whether the input value is equal to another input value.\n */\n this.compare = function (value, element, params) {\n if (!params.other) {\n return true;\n }\n var otherElement = getRelativeFormElement(element, params.other);\n if (!otherElement) {\n return true;\n }\n return (otherElement.value === value);\n };\n /**\n * Validates whether the input value is a number within a given range.\n */\n this.range = function (value, element, params) {\n if (!value) {\n return true;\n }\n var val = parseFloat(value);\n if (isNaN(val)) {\n return false;\n }\n if (params.min) {\n var min = parseFloat(params.min);\n if (val < min) {\n return false;\n }\n }\n if (params.max) {\n var max = parseFloat(params.max);\n if (val > max) {\n return false;\n }\n }\n return true;\n };\n /**\n * Validates whether the input value satisfies a regular expression pattern.\n */\n this.regex = function (value, element, params) {\n if (!value || !params.pattern) {\n return true;\n }\n var r = new RegExp(params.pattern);\n return r.test(value);\n };\n /**\n * Validates whether the input value is an email in accordance to RFC822 specification, with a top level domain.\n */\n this.email = function (value, element, params) {\n if (!value) {\n return true;\n }\n // RFC822 email address with .TLD validation\n // (c) Richard Willis, Chris Ferdinandi, MIT Licensed\n // https://gist.github.com/badsyntax/719800\n // https://gist.github.com/cferdinandi/d04aad4ce064b8da3edf21e26f8944c4\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,})+$/;\n return r.test(value);\n };\n /**\n * Validates whether the input value is a credit card number, with Luhn's Algorithm.\n */\n this.creditcard = function (value, element, params) {\n if (!value) {\n return true;\n }\n // (c) jquery-validation, MIT Licensed\n // https://github.com/jquery-validation/jquery-validation/blob/master/src/additional/creditcard.js\n // based on https://en.wikipedia.org/wiki/Luhn_algorithm\n // Accept only spaces, digits and dashes\n if (/[^0-9 \\-]+/.test(value)) {\n return false;\n }\n var nCheck = 0, nDigit = 0, bEven = false, n, cDigit;\n value = value.replace(/\\D/g, \"\");\n // Basing min and max length on https://developer.ean.com/general_info/Valid_Credit_Card_Types\n if (value.length < 13 || value.length > 19) {\n return false;\n }\n for (n = value.length - 1; n >= 0; n--) {\n cDigit = value.charAt(n);\n nDigit = parseInt(cDigit, 10);\n if (bEven) {\n if ((nDigit *= 2) > 9) {\n nDigit -= 9;\n }\n }\n nCheck += nDigit;\n bEven = !bEven;\n }\n return (nCheck % 10) === 0;\n };\n /**\n * Validates whether the input value is a URL.\n */\n this.url = function (value, element, params) {\n if (!value) {\n return true;\n }\n var lowerCaseValue = value.toLowerCase();\n // Match the logic in `UrlAttribute`\n return lowerCaseValue.indexOf('http://') > -1\n || lowerCaseValue.indexOf('https://') > -1\n || lowerCaseValue.indexOf('ftp://') > -1;\n };\n /**\n * Validates whether the input value is a phone number.\n */\n this.phone = function (value, element, params) {\n if (!value) {\n return true;\n }\n // Allows whitespace or dash as number separator because some people like to do that...\n var consecutiveSeparator = /[\\+\\-\\s][\\-\\s]/g;\n if (consecutiveSeparator.test(value)) {\n return false;\n }\n var r = /^\\+?[0-9\\-\\s]+$/;\n return r.test(value);\n };\n /**\n * Asynchronously validates the input value to a JSON GET API endpoint.\n */\n this.remote = function (value, element, params) {\n if (!value) {\n return true;\n }\n // params.additionalfields: *.Email,*.Username\n var fieldSelectors = params.additionalfields.split(',');\n var fields = {};\n for (var _i = 0, fieldSelectors_1 = fieldSelectors; _i < fieldSelectors_1.length; _i++) {\n var fieldSelector = fieldSelectors_1[_i];\n var fieldName = fieldSelector.substr(2);\n var fieldElement = getRelativeFormElement(element, fieldSelector);\n var hasValue = Boolean(fieldElement && fieldElement.value);\n if (!hasValue) {\n continue;\n }\n if (fieldElement instanceof HTMLInputElement &&\n (fieldElement.type === 'checkbox' || fieldElement.type === 'radio')) {\n fields[fieldName] = fieldElement.checked ? fieldElement.value : '';\n }\n else {\n fields[fieldName] = fieldElement.value;\n }\n }\n var url = params['url'];\n var encodedParams = [];\n for (var fieldName in fields) {\n var encodedParam = encodeURIComponent(fieldName) + '=' + encodeURIComponent(fields[fieldName]);\n encodedParams.push(encodedParam);\n }\n var payload = encodedParams.join('&');\n return new Promise(function (ok, reject) {\n var request = new XMLHttpRequest();\n if (params.type && params.type.toLowerCase() === 'post') {\n var postData = new FormData();\n for (var fieldName in fields) {\n postData.append(fieldName, fields[fieldName]);\n }\n request.open('post', url);\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n request.send(payload);\n }\n else {\n request.open('get', url + '?' + payload);\n request.send();\n }\n request.onload = function (e) {\n if (request.status >= 200 && request.status < 300) {\n var data = JSON.parse(request.responseText);\n ok(data);\n }\n else {\n reject({\n status: request.status,\n statusText: request.statusText,\n data: request.responseText\n });\n }\n };\n request.onerror = function (e) {\n reject({\n status: request.status,\n statusText: request.statusText,\n data: request.responseText\n });\n };\n });\n };\n }\n return MvcValidationProviders;\n}());\n\n/**\n * Responsible for managing the DOM elements and running the validation providers.\n */\nvar ValidationService = /** @class */ (function () {\n function ValidationService(logger) {\n var _this = this;\n /**\n * A key-value collection of loaded validation plugins.\n */\n this.providers = {};\n /**\n * A key-value collection of elements for displaying validation messages for an input (by DOM ID).\n */\n this.messageFor = {};\n /**\n * A list of managed elements, each having a randomly assigned unique identifier (UID).\n */\n this.elementUIDs = [];\n /**\n * A key-value collection of UID to Element for quick lookup.\n */\n this.elementByUID = {};\n /**\n * A key-value collection of input UIDs for a
UID.\n */\n this.formInputs = {};\n /**\n * A key-value map for input UID to its validator factory.\n */\n this.validators = {};\n /**\n * A key-value map for form UID to its trigger element (submit event for ).\n */\n this.formEvents = {};\n /**\n * A key-value map for element UID to its trigger element (input event for