{"version":3,"file":"js/contact.js","mappings":";;;;;;;;;;;;;;AAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;UCpBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;ACN0D;;AAE1D;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA,EAAE,yEAAuB,SAAS,gBAAgB;AAClD,EAAE;AACF;;AAEA","sources":["webpack://client-vacancy/./scripts/captcha-handler.js","webpack://client-vacancy/webpack/bootstrap","webpack://client-vacancy/webpack/runtime/define property getters","webpack://client-vacancy/webpack/runtime/hasOwnProperty shorthand","webpack://client-vacancy/webpack/runtime/make namespace object","webpack://client-vacancy/./scripts/contact.js"],"sourcesContent":["export const executeOnCaptchaSuccess = (callback) => {\n\t// Execute the captcha\n\t// The user might need to do a manual check\n\tconst executeCaptcha = new CustomEvent(\"executeCaptcha\");\n\tdocument.dispatchEvent(executeCaptcha);\n\n\tconst sendAlertHandler = async () => {\n\t\t// Call the callback\n\t\tcallback();\n\n\t\t// Reset the captcha\n\t\tconst resetCaptcha = new CustomEvent(\"resetCaptcha\");\n\t\tdocument.dispatchEvent(resetCaptcha);\n\n\t\t// Remove the event handler to execute when the captcha is done\n\t\tdocument.removeEventListener(\"captchaDone\", sendAlertHandler);\n\t};\n\n\t// Add the event handler to execute when the captcha is done\n\tdocument.addEventListener(\"captchaDone\", sendAlertHandler);\n}\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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {executeOnCaptchaSuccess} from \"./captcha-handler\";\n\nconst init = () => {\n\tconst errorMessages = document.querySelectorAll(\".field-validation-error\");\n\n\terrorMessages.forEach(error => {\n\t\tconst controlId = error.attributes[\"data-valmsg-for\"].value;\n\t\tconst inputError = document.getElementById(controlId);\n\n\t\tif(inputError)\n\t\t\tinputError.classList.add(\"error\");\n\t});\n\n\tconst submitButton = document.getElementById(\"contact-form-submit\");\n\tsubmitButton.addEventListener(\"click\", (e) => {\n\t\tconst form = e.target.closest(\"form\");\n\n\t\texecuteOnCaptchaSuccess(() => { form.submit(); });\n\t});\n}\n\ninit();\n"],"names":[],"sourceRoot":""}