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,UAAU,IACnB,eAAS,gFAAA2F,cAAc,IAEvB,Q","sources":["webpack://OCA/./wwwroot/src/js/site/recaptcha.ts","webpack://OCA/external var \"jQuery\"","webpack://OCA/./wwwroot/src/js/site/facilitylink.ts","webpack://OCA/./wwwroot/src/js/site/formhelper.ts","webpack://OCA/./wwwroot/src/js/site/timezone.ts","webpack://OCA/webpack/bootstrap","webpack://OCA/./wwwroot/src/js/site.ts"],"sourcesContent":["import { FormHelper } from \"./formhelper\";\n\ndeclare var grecaptcha: any;\n\nconst RECAPTCHAKEY = \"6LeAyVMqAAAAABlsoKnYUVGTH7RUt2a5Mw-gToGe\";\n\n// Encapsulates the recaptcha functionality\nexport function setupRecaptcha(\n buttonId: string,\n fieldId: string,\n formhelper: FormHelper,\n) {\n grecaptcha.enterprise.ready(function () {\n const button = document.getElementById(buttonId);\n if (!button) {\n console.error(\"Could not find button with id\", buttonId);\n return;\n }\n button.addEventListener(\"click\", function (event) {\n event.preventDefault(); // Prevent the form from submitting immediately\n formhelper.setSubmitDisabled(true);\n grecaptcha.enterprise.execute(RECAPTCHAKEY, { action: \"submit\" })\n .then(function (token) {\n //console.log(\"recaptcha token\", token);\n // Add the token to the hidden input field\n const field = document.getElementById(\n fieldId,\n ) as HTMLInputElement;\n field.value = token;\n // manually submit the form\n formhelper.submitManual();\n });\n });\n });\n}\n","module.exports = jQuery;","import * as $ from \"jquery\";\n\n$(function () {\n $(\".facility-link\").on(\"click\", function () {\n // Get the data-facility attribute value\n const facilityUrl = $(this).data(\"facility\");\n\n // Check if the data-facility attribute exists and is not empty\n if (facilityUrl) {\n // Redirect to the URL contained in the data-facility attribute\n window.location.href = facilityUrl;\n }\n });\n});\n","/*!\n * Copyright (c) 2024 Brett Kelts - 2025-01-26\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nexport interface IFormHelper {\n // you can pass in a selector or the actual elements\n form: string | HTMLFormElement;\n submitButton?: string | HTMLInputElement | HTMLButtonElement;\n}\n\n// valid elements\ntype FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\ninterface IValidationElement {\n field: FieldElement;\n messageField?: Element;\n requiredMessage?: string;\n phoneMessage?: string;\n emailMessage?: string;\n creditcardMessage?: string; // this currently doesn't do anything!\n regexMessage?: string;\n maxlengthMessage?: string;\n minlengthMessage?: string;\n}\n\ntype doFixup = (validElement: IValidationElement, attrval: string) => void;\n\nconst fixups: { [attrkey: string]: doFixup } = {\n \"data-val-required\": (validElement, attrval) => {\n validElement.requiredMessage = attrval;\n validElement.field.setAttribute(\"required\", \"\");\n },\n \"data-val-email\": (validElement, attrval) => {\n validElement.emailMessage = attrval;\n },\n \"data-val-phone\": (validElement, attrval) => {\n validElement.phoneMessage = attrval;\n },\n \"data-val-creditcard\": (validElement, attrval) => {\n validElement.creditcardMessage = attrval;\n },\n \"data-val-maxlength\": (validElement, attrval) => {\n validElement.maxlengthMessage = attrval;\n },\n \"data-val-maxlength-max\": (validElement, attrval) => {\n validElement.field.setAttribute(\"maxlength\", attrval);\n },\n \"data-val-minlength\": (validElement, attrval) => {\n validElement.minlengthMessage = attrval;\n },\n \"data-val-minlength-min\": (validElement, attrval) => {\n validElement.field.setAttribute(\"minlength\", attrval);\n },\n \"data-val-regex\": (validElement, attrval) => {\n validElement.regexMessage = attrval;\n },\n \"data-val-regex-pattern\": (validElement, attrval) => {\n validElement.field.setAttribute(\"pattern\", attrval);\n },\n};\n\nconst DEFAULTINVALIDMESSAGE = \"Field is not valid\";\n\n// Includes various functions to make forms more user friendly\n// 100% javascript... no jquery\n// related topics:\n// https://www.falldowngoboone.com/blog/native-form-validation-with-javascript/\n// https://developer.mozilla.org/en-US/docs/Web/API/Constraint_validation\nexport class FormHelper {\n submitMessage: string;\n form: HTMLFormElement;\n submitButtons: (HTMLInputElement | HTMLButtonElement)[];\n isSubmitted: boolean;\n checkDoubleSubmit: boolean;\n checkValid: boolean;\n validationElements: Map;\n submitConfirmWarning?: string;\n\n constructor(setup: IFormHelper) {\n const self = this;\n if (typeof setup.form === \"string\") {\n const form = document.querySelector(setup.form);\n if (!form || !(form instanceof HTMLFormElement)) {\n throw new Error(\n \"FormHelper: form element not found or is not a valid form.\",\n );\n } else {\n this.form = form;\n }\n } else {\n this.form = setup.form;\n }\n if (this.form) {\n if (setup.submitButton) {\n if (typeof setup.submitButton === \"string\") {\n this.submitButtons = FormHelper.getValidButtons(\n document.querySelectorAll(setup.submitButton),\n );\n } else {\n this.submitButtons = [setup.submitButton];\n }\n } else {\n const buttons = this.form.querySelectorAll(\n 'input[type=\"submit\"],button',\n );\n this.submitButtons = FormHelper.getValidButtons(buttons);\n }\n } else {\n if (setup.submitButton) {\n if (typeof setup.submitButton === \"string\") {\n this.submitButtons = FormHelper.getValidButtons(\n document.querySelectorAll(setup.submitButton),\n );\n } else {\n this.submitButtons = [setup.submitButton];\n }\n }\n }\n\n this.submitMessage = \"(processing)\";\n this.checkDoubleSubmit = false;\n this.isSubmitted = false;\n this.checkValid = false;\n this.validationElements = new Map();\n // this.submitConfirmWarning = undefined;\n\n if (this.form) {\n this.form.addEventListener(\"submit\", (e) => {\n self.submit(e);\n });\n } else {\n console.warn(\"FormHelper: form element not found.\");\n }\n }\n\n // Prevent double-submission\n public preventDoubleSubmit() {\n this.checkDoubleSubmit = true;\n }\n\n // Add a confirmation popup to verify that you want to submit\n // the form?\n public addSubmitConfirmWarning(warning: string) {\n this.submitConfirmWarning = warning;\n }\n\n // Add the HTML required attribute to fields which have unobtrusive required validation\n // setup\n public addRequiredAttributes() {\n const allfields = this.form.elements;\n for (var idxEl = 0; idxEl < allfields.length; ++idxEl) {\n const field = allfields[idxEl];\n const valrequired = field.getAttribute(\"data-val-required\");\n if (valrequired) {\n field.setAttribute(\"required\", \"\");\n }\n }\n }\n\n // Check all elements for unobtrusive elements\n // and try to add our equivalents\n public addUnobtrusiveAttributes() {\n this.form.noValidate = true;\n this.checkValid = true;\n const allfields = this.form.elements;\n\n for (var idxEl = 0; idxEl < allfields.length; ++idxEl) {\n const field = allfields[idxEl];\n this.addUnobtrusiveField( field);\n }\n }\n\n // Called when the form is submitted via actual submission\n private submit(e: SubmitEvent) {\n // we're handling validity checks\n const submitSuccess = this.submitInternal();\n if (!submitSuccess) {\n e.preventDefault();\n }\n }\n\n // Manual submission. not caused by submit event.\n public submitManual() {\n const submitSuccess = this.submitInternal();\n if (submitSuccess) {\n this.form.submit();\n }\n }\n\n // Handle the submission. Returns true if successful\n private submitInternal(): boolean {\n // we're handling validity checks\n if (this.checkValid) {\n const isValid = this.form.reportValidity();\n if (!isValid) {\n this.setSubmitDisabled(false);\n return false;\n }\n }\n\n if (this.submitConfirmWarning) {\n if (!window.confirm(this.submitConfirmWarning)) {\n this.setSubmitDisabled(false);\n return false;\n }\n }\n\n if (this.checkDoubleSubmit) {\n if (this.isSubmitted) {\n // Previously submitted - don't submit again\n this.setSubmitDisabled(false);\n return false;\n } else {\n // Mark it so that the next submit can be ignored\n this.isSubmitted = true;\n this.showSubmitted();\n return true;\n }\n }\n\n return true;\n }\n\n private showSubmitted() {\n this.setSubmitDisabled(true);\n if (this.submitMessage) {\n this.submitButtons.forEach((button) => {\n if (button.nodeName.toLowerCase() === \"button\") {\n button.innerHTML = this.submitMessage;\n } else {\n button.value = this.submitMessage;\n }\n });\n }\n }\n\n public setSubmitDisabled(isDisabled: boolean) {\n if (isDisabled) {\n this.submitButtons.forEach((button) =>\n button.setAttribute(\"disabled\", \"\")\n );\n } else {\n this.submitButtons.forEach((button) =>\n button.removeAttribute(\"disabled\")\n );\n }\n }\n\n private addUnobtrusiveField(field: FieldElement) {\n if (!FormHelper.isFieldElement(field)) {\n return;\n }\n const self = this;\n\n const validElement: IValidationElement = {\n field: field,\n };\n\n field.addEventListener(\"invalid\", function handleInvalidField(event) {\n self.handleInvalid(field, event);\n });\n\n field.addEventListener(\"blur\", function handleFieldBlur() {\n const validEl = self.validationElements.get(field);\n if (validEl) {\n self.clearErrorMessage(validEl);\n field.checkValidity();\n }\n });\n\n // is there a related field that gets any messages that we have?\n if (field.name) {\n const messageField = this.form.querySelector(\n '[data-valmsg-for=\"' + field.name + '\"]',\n );\n if (messageField) {\n validElement.messageField = messageField;\n }\n }\n\n var attributes = field.getAttributeNames();\n for (const attrkey of attributes) {\n const fixfunc = fixups[attrkey];\n if (fixfunc) {\n const attr = field.getAttribute(attrkey);\n if (attr) {\n fixfunc(validElement, attr);\n }\n }\n }\n\n this.validationElements.set(field, validElement);\n }\n\n private handleInvalid(field: FieldElement, event: Event) {\n // find the validElement\n event.preventDefault(); // suppress browser error\n const validElement = this.validationElements.get(field);\n if (!validElement) {\n return;\n }\n\n const validity = field.validity;\n if (!validity) {\n this.setErrorMessage(validElement, undefined);\n return;\n }\n\n // check for missing\n if (validity.valueMissing && validElement.requiredMessage) {\n this.setErrorMessage(validElement, validElement.requiredMessage);\n return;\n }\n if (validity.typeMismatch) {\n if (validElement.emailMessage) {\n this.setErrorMessage(validElement, validElement.emailMessage);\n return;\n }\n if (validElement.creditcardMessage) {\n this.setErrorMessage(\n validElement,\n validElement.creditcardMessage,\n );\n return;\n }\n if (validElement.phoneMessage) {\n this.setErrorMessage(validElement, validElement.phoneMessage);\n return;\n }\n }\n if (validity.tooLong) {\n this.setErrorMessage(validElement, validElement.maxlengthMessage);\n return;\n }\n if (validity.tooShort) {\n this.setErrorMessage(validElement, validElement.minlengthMessage);\n return;\n }\n if (validity.patternMismatch && validElement.regexMessage) {\n this.setErrorMessage(validElement, validElement.regexMessage);\n return;\n }\n\n // default...fall throught\n this.setErrorMessage(validElement, undefined);\n }\n\n private setErrorMessage(\n validElement: IValidationElement,\n message?: string,\n ) {\n validElement.field.setAttribute(\"aria-invalid\", \"true\");\n validElement.field.classList.add(\"input-validation-error\");\n if (validElement.messageField) {\n validElement.messageField.innerHTML = message\n ? message\n : DEFAULTINVALIDMESSAGE;\n validElement.messageField.classList.remove(\n \"field-validation-valid\",\n );\n validElement.messageField.classList.add(\"field-validation-error\");\n }\n }\n\n private clearErrorMessage(validElement: IValidationElement) {\n validElement.field.removeAttribute(\"aria-invalid\");\n validElement.field.classList.remove(\"input-validation-error\");\n\n if (validElement.messageField) {\n validElement.messageField.innerHTML = \"\";\n validElement.messageField.classList.add(\"field-validation-valid\");\n validElement.messageField.classList.remove(\n \"field-validation-error\",\n );\n }\n }\n\n // Get the validity attribute. This probably isn't necessary, but just to\n // be safe\n private static isFieldElement(field: Element): boolean {\n if (\n field instanceof HTMLInputElement ||\n field instanceof HTMLSelectElement ||\n field instanceof HTMLTextAreaElement\n ) {\n return true;\n }\n return false;\n }\n\n private static getValidButtons(\n buttons: NodeListOf,\n ): (HTMLInputElement | HTMLButtonElement)[] {\n return Array.from(buttons).filter(\n (btn): btn is HTMLInputElement | HTMLButtonElement =>\n btn instanceof HTMLInputElement ||\n btn instanceof HTMLButtonElement,\n );\n }\n}\n","// Default timezone to use if browser's timezone cannot be determined\nconst ZONEDEFAULT = \"America/New_York\";\n\n// Calculate the current timezone\nexport function getTimeZone(): string {\n try {\n // Get the browser's timezone using Intl.DateTimeFormat API\n const browserTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // If the browser's timezone is available, return it\n if (browserTZ) {\n return browserTZ;\n }\n } catch (error) {\n // If an error occurs, fall back to the default timezone\n }\n // Return the default timezone if browser's timezone is not available or an error occurs\n return ZONEDEFAULT;\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","export { getTimeZone } from \"./site/timezone\";\nexport { FormHelper } from \"./site/formhelper\";\nexport { setupRecaptcha } from \"./site/recaptcha\";\n\nimport \"./site/facilitylink\";\n"],"names":["buttonId","fieldId","formhelper","grecaptcha","enterprise","ready","button","document","getElementById","addEventListener","event","preventDefault","setSubmitDisabled","execute","RECAPTCHAKEY","action","then","token","value","submitManual","console","error","module","exports","jQuery","$","on","facilityUrl","this","data","window","location","href","fixups","validElement","attrval","requiredMessage","field","setAttribute","emailMessage","phoneMessage","creditcardMessage","maxlengthMessage","minlengthMessage","regexMessage","FormHelper","constructor","setup","self","form","querySelector","HTMLFormElement","Error","submitButton","submitButtons","getValidButtons","querySelectorAll","buttons","submitMessage","checkDoubleSubmit","isSubmitted","checkValid","validationElements","Map","e","submit","warn","preventDoubleSubmit","addSubmitConfirmWarning","warning","submitConfirmWarning","addRequiredAttributes","allfields","elements","idxEl","length","getAttribute","addUnobtrusiveAttributes","noValidate","addUnobtrusiveField","submitInternal","reportValidity","confirm","showSubmitted","forEach","nodeName","toLowerCase","innerHTML","isDisabled","removeAttribute","isFieldElement","handleInvalid","validEl","get","clearErrorMessage","checkValidity","name","messageField","attributes","getAttributeNames","attrkey","fixfunc","attr","set","validity","valueMissing","setErrorMessage","typeMismatch","tooLong","tooShort","patternMismatch","undefined","message","classList","add","remove","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","Array","from","filter","btn","HTMLButtonElement","browserTZ","Intl","DateTimeFormat","resolvedOptions","timeZone","ZONEDEFAULT","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getTimeZone","setupRecaptcha"],"sourceRoot":""}