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BnL,IAAjBoL,EACH,OAAOA,EAAa/N,QAGrB,IAAID,EAAS6N,EAAyBE,GAAY,CAGjD9N,QAAS,IAOV,OAHAgO,EAAoBF,GAAU7J,KAAKlE,EAAOC,QAASD,EAAQA,EAAOC,QAAS6N,GAGpE9N,EAAOC,QClBW6N,CAAoB,M","sources":["webpack://app-mobius-forms5/./node_modules/pristinejs/dist/pristine.js","webpack://app-mobius-forms5/./bs5/src/ts/index.ts","webpack://app-mobius-forms5/./bs5/src/ts/lib-2sxc-alerts.ts","webpack://app-mobius-forms5/./bs5/src/ts/lib-2sxc-forms.ts","webpack://app-mobius-forms5/./bs5/src/ts/lib-2sxc-tracking.ts","webpack://app-mobius-forms5/webpack/bootstrap","webpack://app-mobius-forms5/webpack/startup"],"sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Pristine = factory());\n}(this, (function () { 'use strict';\n\n var lang = {\n required: \"This field is required\",\n email: \"This field requires a valid e-mail address\",\n number: \"This field requires a number\",\n integer: \"This field requires an integer value\",\n url: \"This field requires a valid website URL\",\n tel: \"This field requires a valid telephone number\",\n maxlength: \"This fields length must be < ${1}\",\n minlength: \"This fields length must be > ${1}\",\n min: \"Minimum value for this field is ${1}\",\n max: \"Maximum value for this field is ${1}\",\n pattern: \"Please match the requested format\"\n };\n\n function findAncestor(el, cls) {\n while ((el = el.parentElement) && !el.classList.contains(cls)) {}\n return el;\n }\n\n function tmpl(o) {\n var _arguments = arguments;\n\n return this.replace(/\\${([^{}]*)}/g, function (a, b) {\n return _arguments[b];\n });\n }\n\n function groupedElemCount(input) {\n return input.pristine.self.form.querySelectorAll('input[name=\"' + input.getAttribute('name') + '\"]:checked').length;\n }\n\n function mergeConfig(obj1, obj2) {\n for (var attr in obj2) {\n if (!(attr in obj1)) {\n obj1[attr] = obj2[attr];\n }\n }\n return obj1;\n }\n\n function isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n }\n\n var defaultConfig = {\n classTo: 'form-group',\n errorClass: 'has-danger',\n successClass: 'has-success',\n errorTextParent: 'form-group',\n errorTextTag: 'div',\n errorTextClass: 'text-help'\n };\n\n var PRISTINE_ERROR = 'pristine-error';\n var SELECTOR = \"input:not([type^=hidden]):not([type^=submit]), select, textarea\";\n var ALLOWED_ATTRIBUTES = [\"required\", \"min\", \"max\", 'minlength', 'maxlength', 'pattern'];\n var EMAIL_REGEX = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\n var validators = {};\n\n var _ = function _(name, validator) {\n validator.name = name;\n if (!validator.msg) validator.msg = lang[name];\n if (validator.priority === undefined) validator.priority = 1;\n validators[name] = validator;\n };\n\n _('text', { fn: function fn(val) {\n return true;\n }, priority: 0 });\n _('required', { fn: function fn(val) {\n return this.type === 'radio' || this.type === 'checkbox' ? groupedElemCount(this) : val !== undefined && val !== '';\n }, priority: 99, halt: true });\n _('email', { fn: function fn(val) {\n return !val || EMAIL_REGEX.test(val);\n } });\n _('number', { fn: function fn(val) {\n return !val || !isNaN(parseFloat(val));\n }, priority: 2 });\n _('integer', { fn: function fn(val) {\n return !val || /^\\d+$/.test(val);\n } });\n _('minlength', { fn: function fn(val, length) {\n return !val || val.length >= parseInt(length);\n } });\n _('maxlength', { fn: function fn(val, length) {\n return !val || val.length <= parseInt(length);\n } });\n _('min', { fn: function fn(val, limit) {\n return !val || (this.type === 'checkbox' ? groupedElemCount(this) >= parseInt(limit) : parseFloat(val) >= parseFloat(limit));\n } });\n _('max', { fn: function fn(val, limit) {\n return !val || (this.type === 'checkbox' ? groupedElemCount(this) <= parseInt(limit) : parseFloat(val) <= parseFloat(limit));\n } });\n _('pattern', { fn: function fn(val, pattern) {\n var m = pattern.match(new RegExp('^/(.*?)/([gimy]*)$'));return !val || new RegExp(m[1], m[2]).test(val);\n } });\n\n function Pristine(form, config, live) {\n\n var self = this;\n\n init(form, config, live);\n\n function init(form, config, live) {\n\n form.setAttribute(\"novalidate\", \"true\");\n\n self.form = form;\n self.config = mergeConfig(config || {}, defaultConfig);\n self.live = !(live === false);\n self.fields = Array.from(form.querySelectorAll(SELECTOR)).map(function (input) {\n\n var fns = [];\n var params = {};\n var messages = {};\n\n [].forEach.call(input.attributes, function (attr) {\n if (/^data-pristine-/.test(attr.name)) {\n var name = attr.name.substr(14);\n if (name.endsWith('-message')) {\n messages[name.slice(0, name.length - 8)] = attr.value;\n return;\n }\n if (name === 'type') name = attr.value;\n _addValidatorToField(fns, params, name, attr.value);\n } else if (~ALLOWED_ATTRIBUTES.indexOf(attr.name)) {\n _addValidatorToField(fns, params, attr.name, attr.value);\n } else if (attr.name === 'type') {\n _addValidatorToField(fns, params, attr.value);\n }\n });\n\n fns.sort(function (a, b) {\n return b.priority - a.priority;\n });\n\n self.live && input.addEventListener(!~['radio', 'checkbox'].indexOf(input.getAttribute('type')) ? 'input' : 'change', function (e) {\n self.validate(e.target);\n }.bind(self));\n\n return input.pristine = { input: input, validators: fns, params: params, messages: messages, self: self };\n }.bind(self));\n }\n\n function _addValidatorToField(fns, params, name, value) {\n var validator = validators[name];\n if (validator) {\n fns.push(validator);\n if (value) {\n var valueParams = value.split(',');\n valueParams.unshift(null); // placeholder for input's value\n params[name] = valueParams;\n }\n }\n }\n\n /***\n * Checks whether the form/input elements are valid\n * @param input => input element(s) or a jquery selector, null for full form validation\n * @param silent => do not show error messages, just return true/false\n * @returns {boolean} return true when valid false otherwise\n */\n self.validate = function (input, silent) {\n silent = input && silent === true || input === true;\n var fields = self.fields;\n if (input !== true && input !== false) {\n if (input instanceof HTMLElement) {\n fields = [input.pristine];\n } else if (input instanceof NodeList || input instanceof (window.$ || Array) || input instanceof Array) {\n fields = Array.from(input).map(function (el) {\n return el.pristine;\n });\n }\n }\n\n var valid = true;\n\n for (var i = 0; fields[i]; i++) {\n var field = fields[i];\n if (_validateField(field)) {\n !silent && _showSuccess(field);\n } else {\n valid = false;\n !silent && _showError(field);\n }\n }\n return valid;\n };\n\n /***\n * Get errors of a specific field or the whole form\n * @param input\n * @returns {Array|*}\n */\n self.getErrors = function (input) {\n if (!input) {\n var erroneousFields = [];\n for (var i = 0; i < self.fields.length; i++) {\n var field = self.fields[i];\n if (field.errors.length) {\n erroneousFields.push({ input: field.input, errors: field.errors });\n }\n }\n return erroneousFields;\n }\n if (input.tagName && input.tagName.toLowerCase() === \"select\") {\n return input.pristine.errors;\n }\n return input.length ? input[0].pristine.errors : input.pristine.errors;\n };\n\n /***\n * Validates a single field, all validator functions are called and error messages are generated\n * when a validator fails\n * @param field\n * @returns {boolean}\n * @private\n */\n function _validateField(field) {\n var errors = [];\n var valid = true;\n for (var i = 0; field.validators[i]; i++) {\n var validator = field.validators[i];\n var params = field.params[validator.name] ? field.params[validator.name] : [];\n params[0] = field.input.value;\n if (!validator.fn.apply(field.input, params)) {\n valid = false;\n\n if (isFunction(validator.msg)) {\n errors.push(validator.msg(field.input.value, params));\n } else {\n var error = field.messages[validator.name] || validator.msg;\n errors.push(tmpl.apply(error, params));\n }\n\n if (validator.halt === true) {\n break;\n }\n }\n }\n field.errors = errors;\n return valid;\n }\n\n /***\n *\n * @param elem => The dom element where the validator is applied to\n * @param fn => validator function\n * @param msg => message to show when validation fails. Supports templating. ${0} for the input's value, ${1} and\n * so on are for the attribute values\n * @param priority => priority of the validator function, higher valued function gets called first.\n * @param halt => whether validation should stop for this field after current validation function\n */\n self.addValidator = function (elem, fn, msg, priority, halt) {\n if (elem instanceof HTMLElement) {\n elem.pristine.validators.push({ fn: fn, msg: msg, priority: priority, halt: halt });\n elem.pristine.validators.sort(function (a, b) {\n return b.priority - a.priority;\n });\n } else {\n console.warn(\"The parameter elem must be a dom element\");\n }\n };\n\n /***\n * An utility function that returns a 2-element array, first one is the element where error/success class is\n * applied. 2nd one is the element where error message is displayed. 2nd element is created if doesn't exist and cached.\n * @param field\n * @returns {*}\n * @private\n */\n function _getErrorElements(field) {\n if (field.errorElements) {\n return field.errorElements;\n }\n var errorClassElement = findAncestor(field.input, self.config.classTo);\n var errorTextParent = null,\n errorTextElement = null;\n if (self.config.classTo === self.config.errorTextParent) {\n errorTextParent = errorClassElement;\n } else {\n errorTextParent = errorClassElement.querySelector('.' + self.config.errorTextParent);\n }\n if (errorTextParent) {\n errorTextElement = errorTextParent.querySelector('.' + PRISTINE_ERROR);\n if (!errorTextElement) {\n errorTextElement = document.createElement(self.config.errorTextTag);\n errorTextElement.className = PRISTINE_ERROR + ' ' + self.config.errorTextClass;\n errorTextParent.appendChild(errorTextElement);\n errorTextElement.pristineDisplay = errorTextElement.style.display;\n }\n }\n return field.errorElements = [errorClassElement, errorTextElement];\n }\n\n function _showError(field) {\n var errorElements = _getErrorElements(field);\n var errorClassElement = errorElements[0],\n errorTextElement = errorElements[1];\n\n if (errorClassElement) {\n errorClassElement.classList.remove(self.config.successClass);\n errorClassElement.classList.add(self.config.errorClass);\n }\n if (errorTextElement) {\n errorTextElement.innerHTML = field.errors.join('
');\n errorTextElement.style.display = errorTextElement.pristineDisplay || '';\n }\n }\n\n /***\n * Adds error to a specific field\n * @param input\n * @param error\n */\n self.addError = function (input, error) {\n input = input.length ? input[0] : input;\n input.pristine.errors.push(error);\n _showError(input.pristine);\n };\n\n function _removeError(field) {\n var errorElements = _getErrorElements(field);\n var errorClassElement = errorElements[0],\n errorTextElement = errorElements[1];\n if (errorClassElement) {\n // IE > 9 doesn't support multiple class removal\n errorClassElement.classList.remove(self.config.errorClass);\n errorClassElement.classList.remove(self.config.successClass);\n }\n if (errorTextElement) {\n errorTextElement.innerHTML = '';\n errorTextElement.style.display = 'none';\n }\n return errorElements;\n }\n\n function _showSuccess(field) {\n var errorClassElement = _removeError(field)[0];\n errorClassElement && errorClassElement.classList.add(self.config.successClass);\n }\n\n /***\n * Resets the errors\n */\n self.reset = function () {\n for (var i = 0; self.fields[i]; i++) {\n self.fields[i].errorElements = null;\n }\n Array.from(self.form.querySelectorAll('.' + PRISTINE_ERROR)).map(function (elem) {\n elem.parentNode.removeChild(elem);\n });\n Array.from(self.form.querySelectorAll('.' + self.config.classTo)).map(function (elem) {\n elem.classList.remove(self.config.successClass);\n elem.classList.remove(self.config.errorClass);\n });\n };\n\n /***\n * Resets the errors and deletes all pristine fields\n */\n self.destroy = function () {\n self.reset();\n self.fields.forEach(function (field) {\n delete field.input.pristine;\n });\n self.fields = [];\n };\n\n self.setGlobalConfig = function (config) {\n defaultConfig = config;\n };\n\n return self;\n }\n\n /***\n *\n * @param name => Name of the global validator\n * @param fn => validator function\n * @param msg => message to show when validation fails. Supports templating. ${0} for the input's value, ${1} and\n * so on are for the attribute values\n * @param priority => priority of the validator function, higher valued function gets called first.\n * @param halt => whether validation should stop for this field after current validation function\n */\n Pristine.addValidator = function (name, fn, msg, priority, halt) {\n _(name, { fn: fn, msg: msg, priority: priority, halt: halt });\n };\n\n return Pristine;\n\n})));\n","import { showAlert } from './lib-2sxc-alerts';\r\nimport { disableInputs, enableInputs, getFormValues, sendForm, validateForm } from './lib-2sxc-forms';\r\nimport { getRecaptchaToken, requiresRecaptcha } from './lib-2sxc-recaptcha';\r\nimport { addTrackingEvent } from './lib-2sxc-tracking';\r\n\r\nconst debug = true;\r\n//window.debugTurnOn = true;\r\nvar winAny = window as any;\r\nwinAny.appMobius5 ??= {};\r\nwinAny.appMobius5.init ??= initAppMobius5;\r\n\r\nfunction initAppMobius5({ domAttribute } : { domAttribute: string }) {\r\n if (document.getElementsByTagName('form').length) document.getElementsByTagName('form')[0].setAttribute('novalidate', '');\r\n if (debug) console.log(\"Mobius5 loading, debug is enabled\");\r\n\r\n const mobiusWrapper = document.querySelectorAll(`[${domAttribute}]`)[0];\r\n //The promise will be resolved after 5seconds = 5000ms\r\n if (!mobiusWrapper) return\r\n let isDone: boolean = false;\r\n let sendFormResponse = (event:Event, formValues: any) => {\r\n return new Promise((resolve, reject) => {\r\n //#region request handling\r\n let endpoint = (mobiusWrapper as HTMLElement).dataset.webservice // (should be \"Form/ProcessForm\" or a custom override)\r\n //let endpoint = \"app/auto/api/Enquiry/ProcessForm?workflowId=Default\";\r\n let strJson = JSON.stringify(formValues);\r\n //endpoint = endpoint.replace('/api/2sxc/','')\r\n sendForm(formValues, submitButtom, endpoint)\r\n .then((result: any) => {\r\n // error\r\n if (result.ok) {\r\n // success\r\n if (debug) console.log('success', result)\r\n submitButtom.setAttribute(\"disabled\", \"\")\r\n\r\n showAlert(mobiusWrapper, 'msgOk')\r\n disableInputs(mobiusWrapper, false)\r\n\r\n addTrackingEvent('trackMobiusForm', 'mobius-form', submitButtom.innerText)\r\n //submitButtom.click();\r\n resolve(true);\r\n } else {\r\n if (debug) console.log('error', result.status);\r\n\r\n showAlert(mobiusWrapper, 'msgError')\r\n enableInputs(mobiusWrapper)\r\n\r\n addTrackingEvent('trackMobiusForm', 'mobius-form', submitButtom.innerText)\r\n reject(false)\r\n }\r\n })\r\n //resolve(true);\r\n });\r\n };\r\n\t//#region \r\n const submitButtom = (mobiusWrapper.querySelectorAll('[app-mobius5-send]')[0] as HTMLButtonElement)\r\n submitButtom.addEventListener('click', async (event: Event) => {\r\n if (!isDone) {\r\n event.preventDefault();\r\n\r\n const formValues = await getFormValues(mobiusWrapper)\r\n const eventBtn = event.currentTarget as HTMLElement;\r\n addTrackingEvent('trackMobiusForm', 'mobius-form', eventBtn.innerText)\r\n var valid = validateForm(mobiusWrapper)\r\n if (!valid) {\r\n showAlert(mobiusWrapper, 'msgIncomplete')\r\n return;\r\n }\r\n\r\n // imply that message is sending by ui modifications \r\n disableInputs(mobiusWrapper, true)\r\n showAlert(mobiusWrapper, 'msgSending')\r\n isDone = await sendFormResponse(event, formValues).then((data: boolean) => {\r\n return data;\r\n });\r\n //event.returnValue = true;\r\n submitButtom.click();\r\n //Log something to make sure it is async\r\n console.log(\"I'm the first one to get called!\");\r\n } else {\r\n isDone = false;\r\n }\r\n }) \r\n //#endregion \r\n}\r\n","/*\r\n This is a shared code used in various 2sxc apps. Make sure that they are in sync, so if you improve it, improve all 2sxc apps which use this. \r\n ATM they are:\r\n - EventsAndCourses6\r\n - MobiusForms5\r\n The master with the newest / best version must always be the Gallery7, the others should then get a fresh copy.\r\n Because this is shared, all parameters like DOM-IDs etc. must be provided in the Init-call that it can work across apps\r\n*/ \r\n\r\n// .alert class needs to be included in alert message\r\nexport function showAlert(wrapper: Element, responseMessageElement: string) {\r\n wrapper.querySelectorAll('.alert').forEach((elem: HTMLElement) => elem.style.display = 'none');\r\n if (responseMessageElement !== '') (wrapper.querySelector(`#${responseMessageElement}`) as HTMLElement).style.display = 'block';\r\n}","import { CommandNames } from '@2sic.com/2sxc-typings';\r\nlet Pristine = require('../../../node_modules/pristinejs')\r\ndeclare let $2sxc: any\r\n\r\n/*\r\n This is a shared code used in various 2sxc apps. Make sure that they are in sync, so if you improve it, improve all 2sxc apps which use this. \r\n ATM they are:\r\n - EventsAndCourses6\r\n - MobiusForms5\r\n The master with the newest / best version must always be the Gallery7, the others should then get a fresh copy.\r\n Because this is shared, all parameters like DOM-IDs etc. must be provided in the Init-call that it can work across apps\r\n*/\r\n\r\nconst promiseFileMap = (file: { Encoded: Promise}) => {\r\n if (!file.Encoded) return file\r\n return new Promise((resolve) => {\r\n file.Encoded.then((result) => resolve({...file, Encoded: result}))\r\n })\r\n};\r\n\r\n// automatically build the send-object with all properties, \r\n// based on all form-fields which have a item-property=\"\"\r\nexport async function getFormValues(formWrapper: Element): Promise {\r\n let data: any = {\r\n Files: []\r\n };\r\n\r\n const fields = formWrapper.querySelectorAll('input,textarea,select');\r\n fields.forEach((formField: HTMLInputElement) => {\r\n const fieldKey = getFieldKey(formField)\r\n if (!fieldKey || !formField.value) return\r\n if (formField.getAttribute('type') && formField.getAttribute('type').toLowerCase() == 'file') {\r\n data['Files'].push(\r\n {\r\n ...getFieldValue(formField) as object,\r\n Field: fieldKey\r\n }\r\n )\r\n return\r\n }\r\n data[fieldKey] = getFieldValue(formField)\r\n })\r\n\r\n return Promise.all(data.Files.map(promiseFileMap)).then(loadedFiles => {\r\n return { ...data, Files: loadedFiles }\r\n })\r\n}\r\n\r\nfunction getFieldKey(formField: HTMLInputElement): string {\r\n // get the property name from special-attribut, name OR id\r\n return formField.getAttribute('name') || formField.getAttribute('id');\r\n}\r\n\r\nfunction getFieldValue(formField: HTMLInputElement): { Encoded: Promise, Name: string } | unknown {\r\n // extract data from file fields\r\n if (!formField.getAttribute('type')) return formField.value\r\n switch (formField.getAttribute('type').toLowerCase()) {\r\n case 'file':\r\n const file = formField.files[0];\r\n if (!file) return;\r\n return {\r\n Name: file.name,\r\n Encoded: new Promise((resolve) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = (e) => { resolve(e.target.result) };\r\n })\r\n }\r\n case 'radio': return formField.value\r\n case 'checkbox': return formField.checked ? \"True\" : \"False\"\r\n default: return formField.value\r\n }\r\n}\r\n\r\nexport function validateForm(formWrapper: Element): boolean {\r\n const pristine = new Pristine(formWrapper);\r\n return pristine.validate();\r\n}\r\n\r\nexport function sendForm(formData: any, submitButtom: HTMLButtonElement, endpoint: string = \"Form/ProcessForm\"): Promise {\r\n const sxc = $2sxc(submitButtom);\r\n return sxc.webApi.fetchRaw(endpoint, formData)\r\n}\r\n\r\nexport function disableInputs(wrapper: Element, state: boolean) {\r\n wrapper.classList.toggle('disable', state)\r\n wrapper.querySelectorAll('input,textarea,select').forEach((elem: HTMLElement) => elem.setAttribute('disabled', 'true'));\r\n}\r\n\r\nexport function enableInputs(wrapper: Element) {\r\n wrapper.classList.remove('disable')\r\n wrapper.querySelectorAll('input,textarea,select').forEach((elem: HTMLElement) => elem.setAttribute('disabled', 'false'));\r\n}","/*\r\n This is a shared code used in various 2sxc apps. Make sure that they are in sync, so if you improve it, improve all 2sxc apps which use this. \r\n ATM they are:\r\n - EventsAndCourses6\r\n - MobiusForms5\r\n The master with the newest / best version must always be the Gallery7, the others should then get a fresh copy.\r\n Because this is shared, all parameters like DOM-IDs etc. must be provided in the Init-call that it can work across apps\r\n*/ \r\n\r\nexport function addTrackingEvent(trackingEventName: string, trackingCategory: string, trackingLabel: string) {\r\n const trackingEvent = new CustomEvent(trackingEventName, { detail: { category: trackingCategory, action: 'submit', label: trackingLabel } });\r\n document.dispatchEvent(trackingEvent);\r\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(886);\n"],"names":["module","exports","lang","required","email","number","integer","url","tel","maxlength","minlength","min","max","pattern","tmpl","o","_arguments","arguments","this","replace","a","b","groupedElemCount","input","pristine","self","form","querySelectorAll","getAttribute","length","defaultConfig","classTo","errorClass","successClass","errorTextParent","errorTextTag","errorTextClass","ALLOWED_ATTRIBUTES","EMAIL_REGEX","validators","_","name","validator","msg","undefined","priority","Pristine","config","live","_addValidatorToField","fns","params","value","push","valueParams","split","unshift","_validateField","field","errors","valid","i","fn","apply","obj","constructor","call","error","messages","halt","_getErrorElements","errorElements","errorClassElement","el","cls","parentElement","classList","contains","findAncestor","errorTextElement","querySelector","document","createElement","className","PRISTINE_ERROR","appendChild","pristineDisplay","style","display","_showError","remove","add","innerHTML","join","_showSuccess","_removeError","setAttribute","obj1","obj2","attr","mergeConfig","fields","Array","from","map","forEach","attributes","test","substr","endsWith","slice","indexOf","sort","addEventListener","e","validate","target","bind","init","silent","HTMLElement","NodeList","window","$","getErrors","erroneousFields","tagName","toLowerCase","addValidator","elem","console","warn","addError","reset","parentNode","removeChild","destroy","setGlobalConfig","val","type","isNaN","parseFloat","parseInt","limit","m","match","RegExp","factory","winAny","appMobius5","domAttribute","getElementsByTagName","log","mobiusWrapper","isDone","sendFormResponse","event","formValues","Promise","resolve","reject","endpoint","dataset","webservice","JSON","stringify","sendForm","submitButtom","then","result","ok","showAlert","disableInputs","addTrackingEvent","innerText","status","enableInputs","preventDefault","getFormValues","eventBtn","currentTarget","validateForm","data","click","wrapper","responseMessageElement","promiseFileMap","file","Encoded","getFieldValue","formField","files","Name","reader","FileReader","readAsDataURL","onload","checked","formWrapper","Files","fieldKey","getFieldKey","Field","all","loadedFiles","formData","$2sxc","webApi","fetchRaw","state","toggle","trackingEventName","trackingCategory","trackingLabel","trackingEvent","CustomEvent","detail","category","action","label","dispatchEvent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}