{"version":3,"sources":["../../src/ts/errorHandling/ExceptionHandler.ts","../../src/ts/utilities/index.ts","../../src/ts/utilities/getPageUrl.ts","../../src/ts/ajax/ajax.ts","../../src/ts/utilities/focusInputElement.ts","../../src/ts/errorHandling/displayErrorInline.ts","../../src/ts/errorHandling/displayErrorModal.ts","../../src/ts/errorHandling/displayError.ts","../../src/ts/formValidations/getFormDetails.ts","../../src/ts/utilities/countString.ts","../../src/ts/formValidations/restrictInputLengthWithCounter.ts","../../src/ts/utilities/containsOnlyIntegers.ts","../../src/ts/utilities/isDate.ts","../../src/ts/utilities/isEmail.ts","../../src/ts/utilities/isURL.ts","../../src/ts/utilities/isZIP.ts","../../src/ts/formValidations/validateCheckbox.ts","../../src/ts/formValidations/validateRadio.ts","../../src/ts/formValidations/validateInput.ts","../../src/ts/formValidations/validateAllnput.ts","../../src/ts/formValidations/validateSelect.ts","../../src/ts/formValidations/validateAllSelect.ts","../../src/ts/formValidations/validateTextarea.ts","../../src/ts/formValidations/validateAllTextarea.ts","../../src/ts/formValidations/validate.ts","../../src/ts/formValidations/validateAllCheckbox.ts","../../src/ts/formValidations/validateAllRadio.ts","../../src/ts/password-handling/checkPassword.ts","../../src/ts/password-handling/hashPassword.ts","../../src/ts/password-handling/generatePassword.ts","../../src/ts/password-handling/verifyPassword.ts","../../src/ts/utilities/checkVariableType.ts","../../src/ts/utilities/isOnline.ts","../../src/ts/utilities/loading.ts","../../src/ts/utilities/redirect.ts","../../src/ts/utilities/reset.ts","../../src/ts/utilities/togglePasswordVisibility.ts","../../src/ts/utilities/togglePasswordVisibilityAll.ts","../../src/ts/nfsfu234FormValidation.ts"],"names":["LogLevelInterface","ERROR","ERROR_1","CONSOLE","THROW","WARNING","INFO","ExceptionHandler","error","level","console","warn","log","areAllElementsTrue","arr","every","element","checkVariableType","variable","HTMLElement","Array","Object","getPageUrl","window","location","href","getPageUrl_default","makeAjaxRequest","url","options","individualResponseMessage","response","responseData","fetch","ok","json","status","code","message","data","headers","statusText","prepareAjaxOptions","AJAXOptions","method","RequestMethod","RequestHeader","ignoreBodyMessage","RequestBodyIgnore","type","RequestType","body","includes","RequestBody","JSON","stringify","ajax","ajax_default","focusInputElement","inputElement","duration","focus","classList","add","setTimeout","remove","focusInputElement_default","displayErrorInline","inputField","isSuccess","errorMessageContainer","document","createElement","innerHTML","parentNode","appendChild","removeChild","displayErrorInline_default","displayErrorModal","form","errorContainerId","shouldLogToConsole","errorMessageParentContainer","getElementById","querySelectorAll","length","querySelector","setAttribute","errorMessageMessageContainer","errorMessageIconContainer","errorMessageContainerCloseBtn","addEventListener","displayErrorModal_default","displayError","details","success","style","position","displayError_default","getFormDetails","u_form","requestData","shouldContinue","forEach","input","index","attributeName","getAttribute","inputValue","value","checked","push","textarea","textareaValue","select","selectValue","getFormDetails_default","countString","str","countString_default","restrictInputLengthWithCounter","counterContainer","maxLength","parseInt","minLength","shouldButtonDisable","textLength","returnMessage","counterElement","slice","button","disabled","restrictInputLengthWithCounter_default","containsOnlyIntegers","test","containsOnlyIntegers_default","formats","time","month","day","isDate","format","regex","toLowerCase","isDate_default","isEmail","isEmail_default","isURL","isURL_default","isZIP","zipCode","toString","isZIP_default","validateCheckbox","checkboxInputField","callback","customErrorMessage","customErrorMessages","errorType","includeHTML","isRequired","hasAttribute","contains","errorMessage","checkbox","validateCheckbox_default","validateRadio","radioInputField","radioName","HTMLInputElement","radioGroup","isAnyRadioChecked","radioInput","radio","required","ignoreError","validateRadio_default","validateInput","error_type","inputType","trim","validateRadioResponse","email","zipcode","date","tel","phone","validateInput_default","validateAllInput","failureReturnMessage","allInputsInForm","validateInputResponse","proccessedResponse","validateAllnput_default","validateSelect","selectField","isErrorInline","validateSelect_default","validateAllSelect","allSelectsInForm","validateSelectResponse","validateAllSelect_default","validateTextarea","textareaField","validateTextarea_default","validateAllTextarea","allTextareasInForm","validateAllTextareaResponse","validateAllTextarea_default","validateForm","errMsg","errMsgArray","isValidateAllInputs","isValidateAllTextareas","isValidateAllSelects","msg","resMsg","inputs","textareas","selects","validate_default","validateAllCheckbox","allCheckboxesInForm","validateAllCheckbox_default","validateAllRadio","allRadiosInForm","validateAllRadio_default","checkPassword","password","includeSymbolsCheck","userSymbolRegex","uppercaseRegex","lowercaseRegex","numbersRegex","RegExp","checkPassword_default","bcrypt","hashPassword","salt","V","genSalt","hash","hashPassword_default","generatePassword","shouldHash","uppercaseLetters","lowercaseLetters","numbers","symbols","charactersAdded","randomCharType","hashedPassword","Math","floor","random","generatePassword_default","verifyPassword","stringPassword","isHashed","Q","compare","verifyPassword_default","checkVariableType_default","isOnline","navigator","onLine","isOnline_default","loading","submitBtn","btn","formElement","HTMLFormElement","HTMLDivElement","tagName","loading_default","redirect","delay","redirect_default","reset","targetForm","HTMLTextAreaElement","HTMLSelectElement","selectedIndex","reset_default","togglePasswordVisibility","showIcon","hideIcon","updateIcon","iconContainer","allTogglePasswordsButton","toggleBtn","nextElementSibling","togglePasswordVisibility_default","togglePasswordVisibilityAll","icons","uform","toggleAll","allPasswordInputs","show","hide","togglePasswordVisibilityAll_default","NFSFU234FormValidation","formDetails","e","preventDefault","AJAXResult","populateOptionsVariables","isAjax","ajaxOptions","requestMethod","toUpperCase","requestHeaders","i","attributes","attr","originalName","name","match","headerKey","keys","submit","userOptions","processedIsAjax","processedAjaxOptions","errMsgFromFunction","errMessageFromValidate","then","responseCode","errorDetails","catch","Promise","resolve","validate","getAJAXResponse","isNumber","number","isZipCode","isZip","string","generateRandomPassword","passwordStrength","getPasswordStrength","passwordMatch","validateResponse","errorLogLevel","reject","restrictInputWithCounter","getPageURL","nfsfu234FormValidation_default"],"mappings":"g9DAAA,IAAMA,EAAoB,CACtBC,MAAO,QACPC,QAAS,UACTC,QAAS,UACTC,MAAO,QACPC,QAAS,UACTC,KAAM,MACR,EAEIC,EAAmB,SAACC,OAAYC,yDAAgBT,EAAkBG,OAAA,CACpE,OAAQM,GAEN,KAAKT,EAAkBC,KAAA,CAErBS,QAAQF,KAAA,CAAM,SAAUA,GAGxB,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AJPrB,EAAO,IAAA,CAAKA,IAAA,CAOT4M,GAAM5M,EACjB,gBAMA,CAAA,CAAA,OAAOxD,iCAAP,EAAOA,OAAA,EAAW,KAEjBA,CAAAA,OAAesR,sBAAA,CAAyBA,EAAAA,EAG7C,IAAO+C,GAAQ/C,UAAAA,MAAAA,OAAAA","sourcesContent":["const LogLevelInterface = {\n    ERROR: 'error',\n    ERROR_1: 'error_1',\n    CONSOLE: 'console',\n    THROW: 'throw',\n    WARNING: 'warning',\n    INFO: 'info',\n  };\n  \nconst ExceptionHandler = (error: any, level: string = LogLevelInterface.CONSOLE) => {\n    switch (level) {\n\n      case LogLevelInterface.ERROR:\n        // You can customize error handling here\n        console.error('Error:', error);\n        // throw error;\n        // continue;\n        break;\n      \n      case LogLevelInterface.CONSOLE:\n        // You can customize error handling here\n        console.error('Error:', error);\n        break;\n\n      case LogLevelInterface.THROW:\n        throw error;\n\n      case LogLevelInterface.WARNING:\n        // You can customize warning handling here\n        console.warn('Warning:', error);\n        break;\n\n      case LogLevelInterface.INFO:\n        // You can customize info handling here\n        console.log('Info:', error);\n        break;\n\n      default:\n        // console.log(\"default\");\n        \n        // Default behavior is to treat as an error\n        console.error('Error:', error);\n        throw error;\n    }\n  };\n  \n  export { ExceptionHandler, LogLevelInterface };\n  ","/**\n * Check if All Elements are True\n *\n * This function checks if all elements in the given array are equal to true.\n *\n * @param {Array} arr - The array to be checked.\n * @returns {boolean} Returns true if all elements in the array are equal to true, otherwise false.\n */\nexport const areAllElementsTrue = (arr: Array<any>): boolean => {\n    // Use the 'every' method to check if every element in the array is equal to true\n    return arr.every(element => element === true);\n}\n\n/**\n * Count Length of Object\n *\n * This function calculates the number of properties (keys) in a given object.\n * @param {Object} object - The object for which the length is to be calculated.\n * @returns {number} Returns the number of properties (keys) in the object.\n */\nexport const countLengthOfObject = (object: object): number => {\n    // Return the number of keys in the object using Object.keys() and calculating its length\n    return Object.keys(object).length;\n}\n\n/**\n * Checks the data type of a variable and returns the corresponding type as a string.\n *\n * @param {*} variable - The variable to check the data type.\n * @returns {string} Returns the data type of the variable as a string.\n */\nexport const checkVariableType = (variable: any): string | null => {\n    // Check if the variable is a string\n    if (typeof variable === 'string') {\n        return 'string';\n    }\n    // Check if the variable is a number\n    else if (typeof variable === 'number') {\n        return 'number';\n    }\n    // Check if the variable is a boolean\n    else if (typeof variable === 'boolean') {\n        return 'boolean';\n    }\n    // Check if the variable is undefined\n    else if (typeof variable === 'undefined') {\n        return 'undefined';\n    }\n    // Check if the variable is null\n    else if (variable === null) {\n        return 'null';\n    }\n    // Check if the variable is an HTMLElement (assumes that HTMLElement is defined in the environment)\n    else if (variable instanceof HTMLElement) {\n        return 'HTML Element';\n    }\n    // Check if the variable is an array\n    else if (typeof variable === 'object' && variable instanceof Array) {\n        return 'array';\n    }\n    // Check if the variable is an object\n    else if (typeof variable === 'object' && variable instanceof Object) {\n        return 'object';\n    }\n    // Check if the variable is a function\n    else if (typeof variable === 'function') {\n        return 'function';\n    }\n    // If none of the above conditions match, the data type is unknown\n    else {\n        return null;\n    }\n}","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\n\nconst getPageUrl = ():string | boolean => {\n\n    if ( typeof window === 'undefined' )\n    {\n        ExceptionHandler('This function only works in a broswer environment...');\n        return false;\n    }\n\n    // Access the 'window' object and retrieve the current URL using 'window.location.href'.\n    // This will return the complete URL, including the protocol (http/https), domain, port, path, and query parameters.\n    return window.location.href;\n};\n\nexport default getPageUrl;","import { ExceptionHandler, LogLevelInterface } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { checkVariableType } from \"../utilities\";\nimport getPageUrl from \"../utilities/getPageUrl\";\n\nconst makeAjaxRequest = async (url:string, options:any)   => {\n    let individualResponseMessage: ErrorMessageInterface = {};\n    try {\n        console.log(\"AJAX Loading....\");\n\n\n        let response = await fetch(url, options);\n\n        // console.log(response);\n        \n\n        if (response.ok) {\n            console.log(\"AJAX Finished....\");\n            return await response.json();\n            // try {\n            //     const responseData = await response.json();\n            //     console.log(responseData);\n        \n            //     if (checkVariableType(responseData) === 'object') {\n            //         individualResponseMessage.code = response.status;\n            //         individualResponseMessage.message = responseData.message || response.statusText;\n            //         individualResponseMessage.data = responseData;\n            //     } else {\n            //         individualResponseMessage.code = 400;\n            //         individualResponseMessage.message = \"Response is not a valid JSON object.\";\n            //         throw individualResponseMessage;\n            //     }\n        \n            //     return individualResponseMessage;\n            // } catch (error) {\n            //     // console.error(error);\n        \n            //     individualResponseMessage.code = 400;\n            //     individualResponseMessage.message = \"Response is not a valid JSON object.\";\n            //     individualResponseMessage.data = null;\n        \n            //     throw individualResponseMessage;\n            // }\n        } else {\n\n            if ( response.status === 404 )\n            {\n                individualResponseMessage.code = response.status ?? 404;\n                individualResponseMessage.message = \"Resource Not Found\";\n                individualResponseMessage.data = {\n                    headers: response.headers,\n                    url: response.url,\n                    status: response.status,\n                    statusText: response.statusText,\n                    ok: response.ok\n                };\n                throw individualResponseMessage;\n\n            }\n\n            // if (response.ok) {\n                // console.log(\"AJAX Finished....\");\n                // return await response.json();\n            // } else {\n                try {\n                    const responseData = await response.json();\n                    // console.log(responseData);\n            \n                    if (checkVariableType(responseData) === 'object') {\n                        individualResponseMessage.code = response.status;\n                        individualResponseMessage.message = responseData.message || response.statusText;\n                        individualResponseMessage.data = responseData;\n                    } else {\n\n                        // if ( response.status === 404 )\n                        // {\n                        //     individualResponseMessage.code = response.status;\n                        //     individualResponseMessage.message = response.statusText;\n                        //     individualResponseMessage.data = {\n                        //         headers: response.headers,\n                        //         url: response.url,\n                        //         status: response.status,\n                        //         statusText: response.statusText,\n                        //         ok: response.ok\n                        //     };\n                        //     throw individualResponseMessage;\n                \n                        // }\n\n                        individualResponseMessage.code = 400;\n                        individualResponseMessage.message = \"Response is not a valid JSON object 2.\";\n                        throw individualResponseMessage;\n                    }\n            \n                    return individualResponseMessage;\n                } catch (error: any) {\n                    // console.error(error);\n\n                    // if ( error.status === 404 )\n                    // {\n                    //     individualResponseMessage.code = error.status;\n                    //     individualResponseMessage.message = error.statusText;\n                    //     individualResponseMessage.data = {\n                    //         headers: error.headers,\n                    //         url: error.url,\n                    //         status: error.status,\n                    //         statusText: error.statusText,\n                    //         ok: error.ok\n                    //     };\n                    //     throw individualResponseMessage;\n            \n                    // }\n            \n                    individualResponseMessage.code = 400;\n                    individualResponseMessage.message = \"Response is not a valid JSON object. 1\";\n                    individualResponseMessage.data = null;\n            \n                    throw individualResponseMessage;\n                }\n            // }\n            \n\n            // try {\n                \n            //     response = await response.json();\n\n            //     console.log(response);\n                \n    \n            //     // throw new Error(\"AJAX Failed\");\n            //     // ExceptionHandler(\"AJAX FAILED\", \"error_1\")\n    \n            //     individualResponseMessage.code = response.status\n            //     individualResponseMessage.message = response.message || response.statusText\n            //     individualResponseMessage.data = null\n    \n            //     // console.log(individualResponseMessage);\n                \n            //     // ExceptionHandler(individualResponseMessage)\n    \n            //     // return individualResponseMessage\n            //     throw individualResponseMessage;\n    \n\n            // } catch (error) {\n                \n            //     individualResponseMessage.code = 400\n            //     individualResponseMessage.message = \"Response is not a valid JSON object.\"\n            //     individualResponseMessage.data = null\n\n            //     throw individualResponseMessage;\n    \n\n            // }\n\n           \n        }\n\n    } catch (error: any) {\n\n\n        // if ( error.status === 404 )\n        // {\n        //     individualResponseMessage.code = error.status;\n        //     individualResponseMessage.message = error.statusText;\n        //     individualResponseMessage.data = {\n        //         headers: error.headers,\n        //         url: error.url,\n        //         status: error.status,\n        //         statusText: error.statusText,\n        //         ok: error.ok\n        //     };\n        //     throw individualResponseMessage;\n\n        // }\n\n        // console.error(\"AJAX Error From Main Function:\", error.message);\n        individualResponseMessage.code = error.code || 400;\n        individualResponseMessage.message = error.message || error.statusText || \"An Error Occured\";\n        individualResponseMessage.data = error.data || null;\n\n        // console.log(individualResponseMessage);\n        \n\n        // throw individualResponseMessage;\n        throw individualResponseMessage;\n    }\n};\n\nconst prepareAjaxOptions = (AJAXOptions: any) => {\n    let individualResponseMessage: ErrorMessageInterface = {};\n    const method = AJAXOptions.RequestMethod || 'GET';\n    const headers = AJAXOptions.RequestHeader || {};\n    const ignoreBodyMessage = AJAXOptions.RequestBodyIgnore || false;\n    const type = AJAXOptions.RequestType || 'json';\n\n    let body;\n    if (['POST', 'PUT', 'DELETE', 'UPDATE'].includes(method)) {\n        body = AJAXOptions.RequestBody || '';\n\n        if ( body === '' && ignoreBodyMessage !== true )\n        {\n            individualResponseMessage.code = 400\n            individualResponseMessage.message = `The body of this \"${method}\" request you made is empty. If this was intentionional, then add the RequestBodyIgnore attribute and set it to true.`;\n            throw individualResponseMessage;\n        }\n\n\n    }\n\n\n    return {\n        method,\n        headers,\n        body: JSON.stringify(body)\n    };\n};\n\nconst ajax = async (AJAXOptions: any) => {\n    let individualResponseMessage: ErrorMessageInterface = {};\n    try {\n        const url = AJAXOptions && AJAXOptions.url ? AJAXOptions.url : getPageUrl();\n        const options = prepareAjaxOptions(AJAXOptions);\n        const responseData = await makeAjaxRequest(url, options);\n\n        return responseData;\n    } catch (error:any) {\n\n        \n\n        // console.error(\"AJAX Error From Main Function:\", error);\n        individualResponseMessage.code = error.code || 400;\n        individualResponseMessage.message = error.message ||  \"An Error Occured\";\n        individualResponseMessage.data = error.data ?? null;\n\n        // console.log(individualResponseMessage);\n\n        // console.error(\"AJAX ERROR: \", error);\n        console.error(\"AJAX Failed: \", error.message);\n\n        ExceptionHandler(error.message, LogLevelInterface.THROW)\n\n        // return individualResponseMessage;\n        throw error;\n    }\n};\n\nexport default ajax;\n","const focusInputElement = (inputElement: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, duration: number = 3000) => {\n\n    // Set focus on the specified input element to bring it into focus.\n    inputElement.focus();\n\n    // Add the 'input-focus-error' CSS class to the input element to apply the temporary highlighting effect.\n    inputElement.classList.add('input-focus-error');\n\n    // After the specified duration, remove the 'input-focus-error' CSS class to revert the highlighting effect.\n    setTimeout(() => {\n        inputElement.classList.remove('input-focus-error');\n    }, duration);\n\n};\n\nexport default focusInputElement;","import focusInputElement from \"../utilities/focusInputElement\";\n\n/**\n * displayErrorInline\n * \n * This function displays an error message inline next to an input field on a login page.\n * The error message is shown for a specified duration and can also be a success message.\n * \n * @param {HTMLElement} inputField - The input field element where the error message will be displayed.\n * @param {string} message - The error message to be displayed.\n * @param {number} duration - The duration (in milliseconds) for which the error message is visible inline. Default: 3000 ms.\n * @param {boolean} isSuccess - A flag indicating if the message is a success message (true) or an error message (false). Default: false.\n */\nconst displayErrorInline = (inputField: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement, message: string, duration: number = 3000, isSuccess: boolean = false) => {\n\n    if ( ! inputField )\n    {\n        return false;\n    }\n\n    // Focus on the input field and temporarily highlight it using the _focusInputElement function.\n    focusInputElement(inputField, duration);\n\n    // Create the inline error message container element.\n    const errorMessageContainer = document.createElement('div');\n    errorMessageContainer.classList.add('js-inline-message');\n\n    // Set the error message content inside the container.\n    errorMessageContainer.innerHTML = message;\n\n    const parentNode = inputField.parentNode;\n\n    if ( ! parentNode )\n    {\n        return false;\n    }\n\n    // Append the error message container to the parent of the input tag, placing it inline next to the input field.\n    parentNode.appendChild(errorMessageContainer);\n\n    // Add the 'text-success' class to the container if it's a success message, making it visually distinct.\n    if (isSuccess) {\n        \n        errorMessageContainer.classList.add('text-success');\n    }\n\n    // After the specified duration, remove the error message container to hide the message.\n    setTimeout(() => {\n        parentNode.removeChild(errorMessageContainer);\n    }, duration);\n}\n\nexport default displayErrorInline;","/**\n * displayErrorModal\n *\n * This function displays an error message in a modal-like container for a specified duration.\n * The error message can be customized to indicate success (green color) or failure (red color).\n * If a custom error container ID is provided, the error message is appended to that container;\n * otherwise, it creates a new container and appends it to the form.\n *\n * @param {string} message - The error message to display.\n * @param {HTMLElement} form - The form element to which the error message will be added.\n * @param {string} errorContainerId - Optional. The ID of the custom error container.\n * @param {number} duration - Optional. The duration (in milliseconds) for which the error message is visible. Default: 3000 ms.\n * @param {boolean} isSuccess - Optional. If true, the message is displayed as a success message (green color). Default: false.\n * @param {boolean} shouldLogToConsole - Optional. If true, the error message is logged to the console. Default: false.\n */\nconst displayErrorModal = (message: string, form: HTMLElement | HTMLDivElement, errorContainerId: string = '', duration: number = 3000, isSuccess: boolean = false, shouldLogToConsole: boolean = false) => {\n\n    // Determine the error container based on the provided ID or create a new one if not available\n    var errorMessageParentContainer;\n\n    if (errorContainerId != '') {\n        errorMessageParentContainer = document.getElementById(errorContainerId);\n    } else if (document.querySelectorAll('#js-errorMessageContainer').length > 0) {\n        errorMessageParentContainer = form.querySelector('#js-errorMessageContainer');\n    } else {\n        errorMessageParentContainer = document.createElement('div');\n        errorMessageParentContainer.classList.add('js-errorMessageContainer');\n        errorMessageParentContainer.setAttribute('id', 'js-errorMessageContainer');\n        form.appendChild(errorMessageParentContainer);\n    }\n\n    if (! errorMessageParentContainer)\n    {\n        return false;\n    }\n\n    // Create the error message container and append it to the error container parent\n    var errorMessageContainer = document.createElement('div');\n    errorMessageContainer.classList.add('login-error-message-container', 'active');\n\n    var errorMessageMessageContainer = document.createElement('div');\n    errorMessageMessageContainer.classList.add('message', 'js-message');\n    errorMessageMessageContainer.innerHTML = message;\n\n    const errorMessageIconContainer = document.createElement('div');\n    errorMessageIconContainer.classList.add('icon', 'close', 'js-close');\n    errorMessageIconContainer.innerHTML = \"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15.71,8.29a1,1,0,0,0-1.42,0L12,10.59,9.71,8.29A1,1,0,0,0,8.29,9.71L10.59,12l-2.3,2.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l2.29,2.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L13.41,12l2.3-2.29A1,1,0,0,0,15.71,8.29Zm3.36-3.36A10,10,0,1,0,4.93,19.07,10,10,0,1,0,19.07,4.93ZM17.66,17.66A8,8,0,1,1,20,12,7.95,7.95,0,0,1,17.66,17.66Z'/></svg>\";\n\n    errorMessageContainer.appendChild(errorMessageMessageContainer);\n    errorMessageContainer.appendChild(errorMessageIconContainer);\n\n    errorMessageParentContainer.appendChild(errorMessageContainer);\n\n    // Optionally, set the success class to display the message in green color\n    if (isSuccess) {\n        errorMessageContainer.classList.add('success');\n    }\n\n    // Listens to when the user clicks on the close button of an error message container\n    const errorMessageContainerCloseBtn = errorMessageContainer.querySelector('.js-close');\n\n    if (! errorMessageContainerCloseBtn)\n    {\n        return false;\n    }\n\n    errorMessageContainerCloseBtn.addEventListener('click', () => {\n        if (errorMessageContainer && errorMessageContainer.parentNode) {\n            errorMessageContainer.parentNode.removeChild(errorMessageContainer);\n        }\n    });\n\n    // Set timeout to remove the error message container after the specified duration\n    setTimeout(() => {\n        if (errorMessageContainer && errorMessageContainer.parentNode) {\n            errorMessageContainer.parentNode.removeChild(errorMessageContainer);\n        }\n    }, duration);\n\n    // Optionally, log the error message to the console\n    if (shouldLogToConsole) {\n        console.error(message);\n    }\n}\n\n\nexport default displayErrorModal;","import displayErrorInline from \"./displayErrorInline\";\nimport displayErrorModal from \"./displayErrorModal\";\n\n/**\n * Display an error message in the specified manner.\n *\n * @param {Object} details - The details of the error message.\n * @param {string} details.type - The type of error display (either 'inline' or 'modal').\n * @param {string} details.message - The error message to be displayed.\n * @param {number} details.duration - The duration for which the error message should be visible.\n * @param {HTMLElement} details.element - The HTML element to which the error message is associated.\n * @param {boolean} [details.success=false] - A flag indicating whether the operation was successful.\n * @returns {boolean} Returns true if the error message was displayed successfully, false otherwise.\n */\nconst displayError = (details: {\n    type: string;\n    message: string;\n    duration: number;\n    element: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n    success?: boolean;\n}): boolean => {\n    // Destructure the details object\n    const { type, message, duration, element, success = false } = details;\n\n    // Check if the element is a valid HTML element\n    if (!(element instanceof HTMLElement)) {\n        console.error(\"The HTML Element you are trying to use is not found.\");\n        return false;\n    }\n\n    // Set the 'position' property of 'element' to 'relative'\n    element.style.position = 'relative';\n\n    // Determine the type of error display and invoke the appropriate function\n    if (type === 'inline') {\n        displayErrorInline(element, message, duration, success);\n    } else if (type === 'modal') {\n        displayErrorModal(message, element, '', duration, success);\n    } else {\n        // Display an error message for unsupported error display types\n        console.error(\"The type of error display you specified is not supported.\");\n        return false;\n    }\n\n    return true;\n};\n\n\nexport default displayError;","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue } from \"../utilities\";\n\n/**\n * Retrieves data from the provided form element.\n * Collects data from input fields, textareas, and select elements with the specified attribute 'data-attr-name'.\n * The collected data is stored in an object with attribute names as keys and corresponding input values as values.\n * @param {HTMLFormElement | HTMLDivElement | string} u_form - The HTML form element or its ID from which to extract data.\n * @returns {Object | boolean} - Returns an object containing form data if successful, or false if the form is not valid or no data is found.\n */\nconst getFormDetails = (u_form: HTMLFormElement | HTMLDivElement | string): Record<string, string | boolean> | boolean | ErrorMessageInterface => {\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", type: 'error', code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        return false;\n    }\n    \n\n    // Check if the form element is provided\n    if ( ! u_form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\")\n        return individualResponseMessage;\n\n    }\n\n    // Resolve form element by ID if it's a string\n    const form = typeof u_form === 'string' ? document.getElementById(u_form) : u_form;\n    \n    // Check if the form element is provided\n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\");\n        return individualResponseMessage;\n\n    }\n\n    const requestData: Record<string, string | boolean> = {}; // Initialize object to store form data\n    const shouldContinue: boolean[] = []; // Track extraction process success\n\n    // Extract data from input fields\n    const allInputsInForm = form.querySelectorAll('input');\n    allInputsInForm.forEach((input: HTMLInputElement, index: number) => {\n        const attributeName = input.getAttribute('data-attr-name') || input.getAttribute('name') || index;\n        let inputValue: string | boolean = input.value;\n\n        // Handle checkbox inputs\n        if (input.type === 'checkbox') {\n            inputValue = input.checked;\n        }\n\n        // Handle radio inputs\n        if (input.type === 'radio') {\n            if (input.checked) {\n                inputValue = true;\n            } else {\n                return; // Skip unchecked radio buttons\n            }\n        }\n\n        requestData[attributeName] = inputValue; // Store input value in requestData\n        shouldContinue.push(true);\n    });\n\n    // Extract data from textareas\n    const allTextareasInForm = form.querySelectorAll('textarea');\n    allTextareasInForm.forEach((textarea: HTMLTextAreaElement, index: number) => {\n        const attributeName = textarea.getAttribute('data-attr-name') || textarea.getAttribute('name') || index;\n        const textareaValue = textarea.value;\n\n        requestData[attributeName] = textareaValue; // Store textarea value in requestData\n        shouldContinue.push(true);\n    });\n\n    // Extract data from select elements\n    const allSelectsInForm = form.querySelectorAll('select');\n    allSelectsInForm.forEach((select: HTMLSelectElement, index: number) => {\n        const attributeName = select.getAttribute('data-attr-name') || select.getAttribute('name') || index;\n        const selectValue = select.value;\n\n        requestData[attributeName] = selectValue; // Store select value in requestData\n        shouldContinue.push(true);\n    });\n\n    // Check if all elements in the form extraction process were successful\n    if (areAllElementsTrue(shouldContinue)) {\n        return requestData; // Return the object containing the form data\n    } else {\n        return false; // Return false if any part of the form extraction process failed\n    }\n};\n\nexport default getFormDetails;\n","const countString = (str: string): number => {\n    return str.length;\n};\n\nexport default countString;","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { checkVariableType } from \"../utilities\";\nimport countString from \"../utilities/countString\";\n\n/**\n * Count input characters and restrict input while typing in a given input element.\n * @param {HTMLInputElement} inputElement - The HTML input element to count and restrict.\n * @param {HTMLElement} [counterContainer] - Optional container to display the character count. If not provided, it creates one automatically.\n * @param {Object} [options={}] - An object with the following optional properties:\n *   - maxLength {number}: Maximum allowed characters (default: 250).\n *   - minLength {number}: Minimum allowed characters (default: 0).\n *   - shouldButtonDisable {boolean}: Flag to determine whether to disable buttons on reaching maxLength (default: false).\n *   - formId {string}: The ID of the form element associated with the input.\n * @returns {boolean} Return true if the input meets the restrictions, otherwise false.\n */\nconst restrictInputLengthWithCounter = (inputElement: HTMLInputElement | HTMLTextAreaElement,  options: any = {}, counterContainer?: HTMLElement | string): any => {\n\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n\n    // Check if the input element exists.\n    if (!inputElement) {\n        // console.error(\"The input element you are trying to count and restrict is not found. Check your HTML code.\");\n        individualResponseMessage.message = \"The input element you are trying to count and restrict is not found. Check your HTML code.\"\n        ExceptionHandler(individualResponseMessage.message);\n        return individualResponseMessage;\n    }\n\n    // Extract options or set default values.\n    const maxLength = (options['maxLength'] && parseInt(options['maxLength']) && options['maxLength'] >= 1) ? options['maxLength'] : 250;\n    const minLength = (options['minLength'] && parseInt(options['minLength'])) ? options['minLength'] : 0;\n    const shouldButtonDisable = (options['shouldButtonDisable'] && options['shouldButtonDisable']) ? true : false;\n\n    let form;\n\n    if ( options.form && checkVariableType(options.form) === 'string' )\n    {\n        document.getElementById(options.form)\n    }\n    else if ( options.form && checkVariableType(options.form) === 'HTML Element' )\n    {\n        form = options.form\n    }\n    else\n    {\n\n        \n        if ( document.getElementById(\"nfsfu234_fv_form\") )\n        {\n            form = document.getElementById(\"nfsfu234_fv_form\");\n        }\n        else if ( document.getElementById(\"jsForm\") )\n        {\n            form = document.getElementById(\"jsForm\");\n        }\n        else if ( document.querySelector(\"form\") )\n        {\n            form = document.querySelector(\"form\");\n        }\n        else\n        {\n            form = undefined\n        }\n\n    }\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(individualResponseMessage.message);\n        return individualResponseMessage;\n    }\n\n    // Add an event listener to the input element for counting and restricting.\n    inputElement.addEventListener('input', () => {\n        // Count the number of characters in the input element.\n        var textLength = countString(inputElement.value);\n        var returnMessage = false;\n\n        // Check if a counter container is provided or create one if not.\n        var counterElement: any;\n\n        if ( checkVariableType(counterContainer) === 'string' )\n        {\n\n            counterElement = document.getElementById(counterContainer as string)\n\n        }\n\n        if (!counterElement) {\n            const parentNode = inputElement.parentNode;\n\n            if ( parentNode?.querySelector(\".js-counterContainer\") )\n            {\n                counterElement = parentNode.querySelector(\".js-counterContainer\")\n            }\n            else\n            {\n                counterElement = document.createElement('span');\n                counterElement.classList.add('js-counterContainer');\n                if (! parentNode)\n                {\n                    return false;\n                }\n                parentNode.appendChild(counterElement);\n            }\n\n            \n        } else {\n            counterElement = counterElement;\n        }\n\n        if ( ! counterElement )\n        {\n            individualResponseMessage.message = \"Counter Element Not Found\";\n            ExceptionHandler(individualResponseMessage.message)\n            return individualResponseMessage;\n        }\n\n        // Apply restrictions based on character count and options.\n        if (textLength > maxLength) {\n            textLength = maxLength;\n            counterElement.classList.remove('text-fail');\n            counterElement.classList.add('text-success');\n            inputElement.value = inputElement.value.slice(0, maxLength);\n\n            // Enable buttons in the associated form (if specified).\n            if (shouldButtonDisable && form) {\n                form.querySelectorAll('button').forEach((button: HTMLButtonElement) => {\n                    button.disabled = false;\n                });\n            }\n\n            returnMessage = true;\n        } else if (textLength >= maxLength) {\n            inputElement.value = inputElement.value.slice(0, maxLength);\n            counterElement.classList.remove('text-fail');\n            counterElement.classList.add('text-success');\n\n            // Enable buttons in the associated form (if specified).\n            if (shouldButtonDisable && form) {\n                form.querySelectorAll('button').forEach((button: HTMLButtonElement) => {\n                    button.disabled = false;\n                });\n            }\n\n            returnMessage = true;\n        } else if (textLength >= minLength && minLength !== 0) {\n            counterElement.classList.remove('text-fail');\n            counterElement.classList.add('text-success');\n\n            // Enable buttons in the associated form (if specified).\n            if (shouldButtonDisable && form) {\n                form.querySelectorAll('button').forEach((button: HTMLButtonElement) => {\n                    button.disabled = false;\n                });\n            }\n\n            returnMessage = true;\n        } else {\n            counterElement.classList.add('text-fail');\n\n            // Enable buttons in the associated form (if specified).\n            if (shouldButtonDisable && form) {\n                form.querySelectorAll('button').forEach((button: HTMLButtonElement) => {\n                    button.disabled = false;\n                });\n            }\n        }\n\n        // Update the counter element with the current character count.\n        counterElement.innerHTML = `${textLength}/${maxLength}`;\n\n        return returnMessage;\n    });\n\n};\n\nexport default restrictInputLengthWithCounter;","// Check if a string contains only integers.\nconst containsOnlyIntegers = (str: string | number): boolean => {\n    return /^\\d+$/.test(str as string);\n};\n\nexport default containsOnlyIntegers;","interface DateFormat {\n    [key: string]: RegExp;\n}\n\nconst formats: DateFormat = {\n    \"dd/mm/yyyy\": /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/,\n    \"yyyy-mm-dd\": /^\\d{4}-\\d{2}-\\d{2}$/,\n    \"mm/dd/yyyy\": /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/,\n    \"mm.dd.yyyy\": /^\\d{1,2}\\.\\d{1,2}\\.\\d{4}$/,\n    \"yyyy/mm/dd\": /^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$/,\n    \"yyyy.mm.dd\": /^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$/,\n    \"time\": /^(0?[1-9]|1[0-2]):[0-5][0-9] (AM|PM)$/, // 12-hour format\n    \"24-hour\": /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/, // 24-hour format\n    \"month\": /^(0?[1-9]|1[0-2])$/, // Month only\n    \"day\": /^(0?[1-9]|[1-2][0-9]|3[0-1])$/, // Day only\n    // Add more formats as needed\n};\n\nconst isDate = (value: string, format: string = \"dd/mm/yyyy\"): boolean => {\n    const regex = formats[format.toLowerCase()];\n    if (!regex) {\n        console.error(`Invalid date format: ${format}`);\n        return false;\n    }\n\n    return regex.test(value);\n};\n\n// Example usage\n// console.log(isDate(\"31/12/2022\", \"dd/mm/yyyy\")); // true\n// console.log(isDate(\"12/31/2022\", \"mm/dd/yyyy\")); // true\n// console.log(isDate(\"2022-12-31\", \"yyyy-mm-dd\")); // true\n// console.log(isDate(\"12.31.2022\", \"mm.dd.yyyy\")); // true\n// console.log(isDate(\"2022/12/31\", \"yyyy/mm/dd\")); // true\n// console.log(isDate(\"2022.12.31\", \"yyyy.mm.dd\")); // true\n// console.log(isDate(\"12:30 PM\", \"time\")); // true\n// console.log(isDate(\"23:45\", \"24-hour\")); // true\n// console.log(isDate(\"5\", \"month\")); // true\n// console.log(isDate(\"15\", \"day\")); // true\n\n\nexport default isDate;\n","// Function to validate email format\nconst isEmail = (value: string): boolean => {\n    const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n    return emailRegex.test(value);\n};\n\nexport default isEmail;","const isURL = (url:string) => {\n\n    // Regular expression to check for 'http://' or 'https://' at the beginning\n    // and support formats like https://www.domain.com/ or https://domain.com/ or https://www.domain.com/?param1=1&param2=2\n    const urlPattern = /^(https?:\\/\\/)?(www\\.)?[a-zA-Z0-9-]+\\.[a-zA-Z]{2,}(:\\d{1,5})?(\\/[^\\s]*)?(\\?.*)?$/;\n\n    // If the input is a string, test it against the regular expression.\n    return typeof url === 'string' ? urlPattern.test(url) : false;\n\n};\n\nexport default isURL;","/**\n * Checks if the provided value is a valid ZIP code.\n * @param {string | number} zipCode - The ZIP code to validate.\n * @returns {boolean} - Returns true if the ZIP code is valid, otherwise false.\n */\nconst isZIP = (zipCode: string | number): boolean => {\n    // Convert zipCode to a string if it's a number\n    if (typeof zipCode === 'number') {\n        zipCode = zipCode.toString() as string;\n    }\n\n    // Regular expression to match ZIP codes with exactly 5 or 6 digits\n    const zipCodeRegex = /^\\d{5}(?:\\d{1})?$/;\n    return zipCodeRegex.test(zipCode);\n};\n\nexport default isZIP;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport displayErrorInline from \"../errorHandling/displayErrorInline\";\nimport displayErrorModal from \"../errorHandling/displayErrorModal\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport focusInputElement from \"../utilities/focusInputElement\";\n\n/**\n * Validates a checkbox input field.\n * @param {HTMLInputElement} checkboxInputField - The checkbox input field to validate.\n * @param {object} customErrorMessage - Custom error messages for checkbox validation.\n * @param {boolean} isErrorInline - Flag indicating whether to display the error message inline or in a modal.\n * @param {HTMLFormElement} form - The form element containing the checkbox input.\n * @returns {boolean} - Returns true if the checkbox input is valid or not required, otherwise false.\n */\nfunction validateCheckbox(\n    checkboxInputField: HTMLInputElement,\n    options: any,\n    callback?: any\n): boolean  | ErrorMessageInterface {\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", type: 'error', code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n\n    const form: HTMLFormElement | HTMLDivElement | undefined = options.form || undefined;\n    const customErrorMessage: any = options.customErrorMessages || null;\n    const errorType: string = options.errorType || 'inline'\n    const includeHTML = options.includeHTML === false ? false : true;\n\n\n    const isRequired: boolean = checkboxInputField.hasAttribute('required') || checkboxInputField.classList.contains('js-required');\n\n    const errorMessage: string = (customErrorMessage && customErrorMessage['checkbox'] && customErrorMessage['checkbox'] !== '') ?\n    customErrorMessage['checkbox'] : 'You need to check this box';\n\n    // Check if the input field is a checkbox\n    if (checkboxInputField.getAttribute('type') !== 'checkbox') {\n        return false; // Not a checkbox, return false\n    }\n\n    if ( ! includeHTML )\n    {\n\n        // Perform the validation for the select field\n        if (isRequired && ! checkboxInputField.checked) {\n\n            ExceptionHandler(errorMessage)\n\n            individualResponseMessage.message = errorMessage;\n            individualResponseMessage.data = checkboxInputField\n\n            return individualResponseMessage; // Validation failed\n        }\n\n        return true;\n\n    }\n\n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist. 5765846846\")\n        return individualResponseMessage;\n\n    }\n\n    const shouldContinue: boolean[] = [];\n\n    // If the checkbox is required and not checked\n    if (isRequired && ! checkboxInputField.checked) {\n\n\n        ExceptionHandler(errorMessage)\n\n        individualResponseMessage.message = errorMessage;\n        individualResponseMessage.data = checkboxInputField\n\n        // Display the error message inline or in a modal based on the isErrorInline flag\n        if (errorType === 'inline') {\n            displayErrorInline(checkboxInputField, errorMessage, 3000);\n        } else if (errorType === 'modal') {\n            focusInputElement(checkboxInputField, 3000);\n            displayErrorModal(errorMessage, form);\n        }\n\n        // shouldContinue.push(false); // Mark the validation as unsuccessful\n        return individualResponseMessage; // Validation failed\n    } else {\n        // shouldContinue.push(true); // Mark the validation as successful\n        return true; // Checkbox is valid or not required\n    }\n\n}\n\nexport default validateCheckbox;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport displayErrorInline from \"../errorHandling/displayErrorInline\";\nimport displayErrorModal from \"../errorHandling/displayErrorModal\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport focusInputElement from \"../utilities/focusInputElement\";\n\n/**\n * Validates a single radio input or a group of radio inputs.\n * @param {HTMLInputElement | string} radioInputField - The radio input element or its name attribute.\n * @param {object} customErrorMessage - Custom error message for radio validation.\n * @returns {boolean} - Returns true if the radio input(s) are valid, otherwise false.\n */\nconst validateRadio = (\n    radioInputField: HTMLInputElement | string,  \n    options: any,\n    callback?: any\n): boolean | string | ErrorMessageInterface => {\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, it must be executed in a browser environment.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n\n    let individualResponseMessage: ErrorMessageInterface = { message: \"an error occured\", type: 'error', code : 400 };\n\n    const form: HTMLFormElement | HTMLDivElement | undefined = options.form || undefined;\n    const customErrorMessages: any = options.customErrorMessages || null;\n    let errorMessage = customErrorMessages['checkbox'] ?? 'You need to choose a value.';\n\n    \n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist. 5765846846\")\n        return individualResponseMessage;\n\n    }\n\n    let radioName: string | null = null;\n\n    // Determine the radio group name\n    if (typeof radioInputField === 'object' && radioInputField instanceof HTMLInputElement) {\n        radioName = radioInputField.getAttribute('name');\n    } else if (typeof radioInputField === 'string') {\n        radioName = radioInputField;\n    } else {\n\n        // Check if the select field is valid and exists in the DOM\n        if (!radioInputField) {\n            console.error(\"The radio element(s) to validate is(are) not found.\");\n            individualResponseMessage.message = \"The radio element(s) to validate is(are) not found.\";\n            return individualResponseMessage;\n        }\n\n    }\n\n    if ( ! radioName )\n    {\n        ExceptionHandler(\"The radio element(s) to validate is(are) not found.\");\n        individualResponseMessage.message = \"The radio element(s) to validate is(are) not found.\";\n        return individualResponseMessage;\n    }\n\n    // Get all radio inputs within the same group\n    const radioGroup: NodeListOf<HTMLInputElement> = document.querySelectorAll(`input[type=\"radio\"][name=\"${radioName}\"]`);\n    let isRequired: boolean = false;\n    let isAnyRadioChecked: boolean = false;\n    const errorType: string = options.errorType || 'inline'\n    const shouldContinue: boolean[] = [];\n    let radioInput: any  = null;\n\n    // Iterate over each radio input in the group\n    radioGroup.forEach((radio: HTMLInputElement) => {\n\n        radioInput = radio\n\n        // Check if the radio input is required or has a class \"js-required\"\n        if (radio.required || radio.classList.contains('js-required')) {\n\n            isRequired = true;\n\n            if (radio.checked) {\n\n                // isAnyRadioChecked = true;\n                shouldContinue.push(true);\n            }\n            else\n            {\n\n                shouldContinue.push(false);\n\n            }\n\n        }\n\n    });\n\n\n    // Check if all validation results are the same (either all true or all false)\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if ( checkIfAllElementsAreTrue )\n    {\n        return true;\n    }\n\n    const ignoreError = options.ignoreError && options.ignoreError === true ? true : false;\n\n    \n\n    if ( ! ignoreError )\n    {\n\n        \n\n        // Display the error message inline or in a modal based on the isErrorInline flag\n        if (errorType === 'inline') {\n            displayErrorInline(radioInput as HTMLInputElement, errorMessage, 3000);\n        } else if (errorType === 'modal') {\n            focusInputElement(radioInput  as HTMLInputElement, 3000);\n            displayErrorModal(errorMessage, form);\n        }\n\n\n    }\n\n    individualResponseMessage.message = \"You need to choose a value.\";\n    individualResponseMessage.data = radioInput\n\n    // console.error(\"luytoyfouytvctrusatdf: \", individualResponseMessage);\n    \n\n    return individualResponseMessage;\n\n};\n\nexport default validateRadio;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport displayErrorInline from \"../errorHandling/displayErrorInline\";\nimport displayErrorModal from \"../errorHandling/displayErrorModal\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { checkVariableType } from \"../utilities\";\nimport containsOnlyIntegers from \"../utilities/containsOnlyIntegers\";\nimport focusInputElement from \"../utilities/focusInputElement\";\nimport isDate from \"../utilities/isDate\";\nimport isEmail from \"../utilities/isEmail\";\nimport isURL from \"../utilities/isURL\";\nimport isZIP from \"../utilities/isZIP\";\nimport validateCheckbox from \"./validateCheckbox\";\nimport validateRadio from \"./validateRadio\";\n\n/**\n * Validate an input field.\n * @param {HTMLInputElement} inputField - The input field to validate.\n * @param {Object} customErrorMessages - Custom error messages for form validation.\n * @returns {boolean} Returns true if the input field is valid, otherwise false.\n */\nconst validateInput = (\n    inputField: HTMLInputElement, \n    options: any,\n    callback?: any\n): boolean | string | ErrorMessageInterface => {\n\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", type: 'error', data: null, code : 400 };\n\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        // let logLevel: \n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n    \n    // Check if the input field exists\n    if (!inputField) {\n        console.error(\"The input field you are trying to validate does not exist.\");\n        return false;\n    }\n\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        individualResponseMessage.message = \"options are not provided\"\n        return individualResponseMessage;\n    }\n\n    // console.log(\"Input \", inputField);\n    // console.log(\"OPtions \", options.errorType);\n    // console.log(\"Form:\", options.form);\n    \n\n    \n    \n\n    const errorType: any = options.error_type || options.errorType || 'inline'; \n    const customErrorMessages: any = options.customErrorMessages || [];\n    const form: any = options.form ?? undefined;\n    const includeHTML = options.includeHTML === false ? false : true;\n\n\n    const inputType = inputField.getAttribute(\"type\") as string;\n    const inputValue = inputField.value.trim();\n    const isRequired = inputField.required || inputField.classList.contains('js-required');\n    let errorMessage: string | undefined = undefined;\n\n\n    if (! includeHTML)\n    {\n\n        // Check if the input field is required and its value is empty\n        if (isRequired && inputValue === '') {\n            errorMessage = customErrorMessages[inputType] ?? \"This field is required.\";\n        }\n        else if (isRequired && inputType === 'radio') {\n            options.ignoreError = true;\n            const validateRadioResponse = validateRadio(inputField, options);\n    \n            if ( validateRadioResponse === true )\n            {\n                errorMessage = 'validated'\n            }\n            else\n            {\n                errorMessage = customErrorMessages[inputType] ?? validateRadioResponse.message;\n            }\n    \n        }\n        else if (isRequired && inputType === 'checkbox' && !validateCheckbox(inputField, {form: form, customErrorMessages: customErrorMessages})) {\n            errorMessage = customErrorMessages[inputType] ?? 'You need to check this box';\n        }\n        else {\n            // Perform additional validation based on the input field type\n            switch (inputType) {\n                case 'email':\n                    if (inputValue !== '' && !isEmail(inputValue)) {\n                        errorMessage = customErrorMessages.email?.format || \"Invalid email format.\";\n                    }\n                    break;\n                case 'url':\n                    if (inputValue !== '' && !isURL(inputValue)) {\n                        errorMessage = customErrorMessages.url?.format || \"Invalid URL format.\";\n                    }\n                    break;\n                case 'zipcode':\n                    if (inputValue !== '' && !isZIP(inputValue)) {\n                        errorMessage = customErrorMessages.zipcode?.format || \"Invalid ZIP code format.\";\n                    }\n                    break;\n                case 'date':\n                    if (inputValue !== '' && !isDate(inputValue)) {\n                        errorMessage = customErrorMessages.date?.format || \"Invalid date format.\";\n                    }\n                    break;\n                case 'tel':\n                    if (inputValue !== '' && !containsOnlyIntegers(inputValue)) {\n                        errorMessage = customErrorMessages.tel?.format || customErrorMessages.phone?.format || \"Invalid phone number.\";\n                    }\n                    break;\n                case 'phone':\n                    if (inputValue !== '' && !containsOnlyIntegers(inputValue)) {\n                        errorMessage = customErrorMessages.tel?.format || customErrorMessages.phone?.format || \"Invalid date format.\";\n                    }\n                    break;\n                // case 'radio':\n                //     if (inputValue !== '' && !validateRadio(inputField, options)) {\n                //         errorMessage = customErrorMessages.radio?.format || \"Invalid radio button selection.\";\n                //     }\n                // case 'checkbox':\n                //     if (inputValue !== '' && !validateCheckbox(inputField)) {\n                //         errorMessage = customErrorMessages.checkbox?.format || \"Invalid checkbox selection.\";\n                //     }\n\n                default:\n                    // No additional validation for other input types\n                    break;\n            }\n        }\n\n            // Display the error message if validation fails\n            if (errorMessage) {\n                \n                individualResponseMessage.message = errorMessage;\n                individualResponseMessage.data = inputField\n\n                // if ( errorType === 'inline' )\n                // {\n                //     displayErrorInline(inputField, errorMessage)\n        \n                // }\n                // else\n                // {\n                //     focusInputElement(inputField);\n                //     displayErrorModal(errorMessage, inputField)\n                // }\n\n                ExceptionHandler(errorMessage);\n                return individualResponseMessage;\n            }\n\n            return true;\n\n    }\n\n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\")\n        // failureReturnMessage.push(individualResponseMessage)\n        return individualResponseMessage;\n\n    }\n\n    \n\n    // Get the input field type, value, and required status\n    // const inputType = inputField.type;\n\n    // console.log(\"inputValue: \", inputValue);\n    \n    \n    // Check if the input field is required and its value is empty\n    if (isRequired && inputValue === '') {\n        errorMessage = customErrorMessages[inputType] ?? \"This field is required.\";\n    }\n    else if (isRequired && inputType === 'radio') {\n        options.ignoreError = true;\n        const validateRadioResponse = validateRadio(inputField, options);\n\n        if ( validateRadioResponse === true )\n        {\n            errorMessage = 'validated'\n        }\n        else\n        {\n            errorMessage = customErrorMessages[inputType] ?? validateRadioResponse.message;\n        }\n\n    }\n    else if (isRequired && inputType === 'checkbox' && !validateCheckbox(inputField, {form: form, customErrorMessages: customErrorMessages})) {\n        errorMessage = customErrorMessages[inputType] ?? 'You need to check this box';\n    }\n    else {\n        // Perform additional validation based on the input field type\n        switch (inputType) {\n            case 'email':\n                if (inputValue !== '' && !isEmail(inputValue)) {\n                    errorMessage = customErrorMessages.email?.format || \"Invalid email format.\";\n                }\n                break;\n            case 'url':\n                if (inputValue !== '' && !isURL(inputValue)) {\n                    errorMessage = customErrorMessages.url?.format || \"Invalid URL format.\";\n                }\n                break;\n            case 'zipcode':\n                if (inputValue !== '' && !isZIP(inputValue)) {\n                    errorMessage = customErrorMessages.zipcode?.format || \"Invalid ZIP code format.\";\n                }\n                break;\n            case 'date':\n                if (inputValue !== '' && !isDate(inputValue)) {\n                    errorMessage = customErrorMessages.date?.format || \"Invalid date format.\";\n                }\n                break;\n            case 'tel':\n                if (inputValue !== '' && !containsOnlyIntegers(inputValue)) {\n                    errorMessage = customErrorMessages.tel?.format || customErrorMessages.phone?.format || \"Invalid phone number.\";\n                }\n                break;\n            case 'phone':\n                if (inputValue !== '' && !containsOnlyIntegers(inputValue)) {\n                    errorMessage = customErrorMessages.tel?.format || customErrorMessages.phone?.format || \"Invalid date format.\";\n                }\n                break;\n            // case 'radio':\n            //     if (inputValue !== '' && !validateRadio(inputField, options)) {\n            //         errorMessage = customErrorMessages.radio?.format || \"Invalid radio button selection.\";\n            //     }\n            // case 'checkbox':\n            //     if (inputValue !== '' && !validateCheckbox(inputField)) {\n            //         errorMessage = customErrorMessages.checkbox?.format || \"Invalid checkbox selection.\";\n            //     }\n\n            // Add additional cases for other input types if needed\n            default:\n                // No additional validation for other input types\n                break;\n        }\n    }\n\n\n    // Display the error message if validation fails\n    if (errorMessage) {\n        \n\n        individualResponseMessage.message = errorMessage;\n        individualResponseMessage.data = inputField\n        \n        if ( errorType === 'inline' )\n        {\n            displayErrorInline(inputField, errorMessage)\n\n        }\n        else\n        {\n            focusInputElement(inputField);\n            displayErrorModal(errorMessage, inputField)\n        }\n\n        ExceptionHandler(errorMessage);\n        return individualResponseMessage;\n    }\n\n    individualResponseMessage.code = 200\n    individualResponseMessage.data = null\n    individualResponseMessage.message = \"success\"\n    individualResponseMessage.type = \"success\"\n\n    return true; // Input field is valid\n};\n\nexport default validateInput;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue } from \"../utilities\";\nimport validateInput from \"./validateInput\";\n\n/**\n * Validate all input fields within a form.\n * @param {HTMLFormElement | HTMLDivElement} form - The form element to validate.\n * @param {Object} customErrorMessages - Custom error messages for form validation.\n * @returns {boolean} Returns true if all input fields are valid, otherwise false.\n */\nconst validateAllInput = (form: HTMLFormElement | HTMLDivElement | string, options = {\n    customErrorMessages: [],\n    form\n}):  ErrorMessageInterface[] | boolean => {\n\n    const failureReturnMessage:ErrorMessageInterface[] = [];\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        \n        individualResponseMessage.message = \"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\"\n    \n        failureReturnMessage.push(individualResponseMessage)\n\n        return failureReturnMessage;\n    }\n\n    // Check if the form parameter is a string (ID) and convert it to a form element if necessary\n    if (typeof form === 'string') {\n        form = document.getElementById(form) as HTMLFormElement | HTMLDivElement;\n    }\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        failureReturnMessage.push(individualResponseMessage)\n        ExceptionHandler(individualResponseMessage.message);\n        return failureReturnMessage;\n    }\n\n    const shouldContinue: boolean[] = [];\n    const allInputsInForm: NodeListOf<HTMLInputElement> = form.querySelectorAll('input');\n    \n    // If there are input fields in the form\n    if (allInputsInForm.length > 0) {\n\n        allInputsInForm.forEach((input: HTMLInputElement) => {\n\n            options.form = options.form || form\n\n            // Validate each input field using the validateInput function\n            const validateInputResponse = validateInput(input, options)\n            if (validateInputResponse === true) {\n                shouldContinue.push(true);\n            } else {\n                let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 , data: null};\n\n                shouldContinue.push(false);\n\n                // console.log(validateInputResponse);\n                \n\n                let proccessedResponse: string = validateInputResponse.message as string;\n\n                individualResponseMessage.message = proccessedResponse\n                individualResponseMessage.data = input\n\n                failureReturnMessage.push(individualResponseMessage)\n\n            }\n        });\n\n    } else {\n        // If there are no input fields in the form, consider it as valid\n        shouldContinue.push(true);\n    }\n\n    // Check if all validation results are the same (either all true or all false)\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if ( checkIfAllElementsAreTrue )\n    {\n        return true;\n    }\n\n    return failureReturnMessage;\n\n};\n\nexport default validateAllInput;\n","import { checkVariableType } from \"../utilities\";\nimport displayErrorInline from \"../errorHandling/displayErrorInline\";\nimport displayErrorModal from \"../errorHandling/displayErrorModal\";\nimport focusInputElement from \"../utilities/focusInputElement\";\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\n/**\n * Validates a select field.\n * @param {HTMLSelectElement} selectField - The select element to validate.\n * @param {object} customErrorMessage - Custom error message for select validation.\n * @param {HTMLElement} form - The form element associated with the select. Default is undefined.\n * @param {boolean} isErrorInline - Whether to display error inline or in a modal. Default is false.\n * @returns {boolean} - Returns true if validation succeeds, otherwise false.\n */\nconst validateSelect = (\n    selectField: HTMLSelectElement,\n    options: any,\n    callback?: any\n): boolean | ErrorMessageInterface => {\n\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", type: 'error', code : 400 };\n\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n\n    // Check if the select field is valid and exists in the DOM\n    if (!selectField) {\n        console.error(\"The select element to validate is not found.\");\n        return false;\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        return false;\n    }\n\n    const isErrorInline: string = options.error_type || options.errorType || 'inline';\n    const customErrorMessages: any = options.customErrorMessages || [];\n    const form: HTMLFormElement | HTMLDivElement | undefined = options.form || undefined;\n    const includeHTML = options.includeHTML === false ? false : true;\n\n    // Determine if the select field is required based on the 'required' attribute\n    const isRequired: boolean = selectField.hasAttribute('required') || selectField.classList.contains('js-required');\n\n    // Check if the select field has a value selected\n    const selectValue: string = selectField.value.trim();\n\n    \n    // Determine the error message for select validation\n    let errorMessage: string = customErrorMessages?.select || \"You have to select an option.\";\n\n    if ( ! includeHTML )\n    {\n\n        // Perform the validation for the select field\n        if (isRequired && !selectValue) {\n\n            ExceptionHandler(errorMessage)\n\n            individualResponseMessage.message = errorMessage;\n            individualResponseMessage.data = selectField\n\n            return individualResponseMessage; // Validation failed\n        }\n\n        return true;\n\n    }\n\n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\")\n        return individualResponseMessage;\n\n    }\n\n\n\n\n    // Perform the validation for the select field\n    if (isRequired && !selectValue) {\n\n        ExceptionHandler(errorMessage)\n\n        individualResponseMessage.message = errorMessage;\n        individualResponseMessage.data = selectField\n\n        // If the select field is required and no value is selected, show the error message\n        if (isErrorInline) {\n            displayErrorInline(selectField, errorMessage, 3000);\n        } else {\n            focusInputElement(selectField, 3000);\n            displayErrorModal(errorMessage, form);\n        }\n        return individualResponseMessage; // Validation failed\n    }\n\n    individualResponseMessage.code = 200\n    individualResponseMessage.data = null\n    individualResponseMessage.message = \"success\"\n    individualResponseMessage.type = \"success\"\n\n    // Validation succeeded\n    return true;\n};\n\nexport default validateSelect;\n","import validateSelect from \"./validateSelect\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\n\n/**\n * Validate all select fields within a form.\n * @param {HTMLFormElement | HTMLDivElement} form - The form element to validate.\n * @param {Object} customErrorMessage - Custom error messages for form validation.\n * @returns {boolean} Returns true if all select fields are valid or not required, otherwise false.\n */\nconst validateAllSelect = (form: HTMLFormElement | HTMLDivElement | string, options: any): boolean | ErrorMessageInterface | ErrorMessageInterface[] => {\n\n    const failureReturnMessage:ErrorMessageInterface[] = [];\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        return false;\n    }\n\n    // Check if the form parameter is a string (ID) and convert it to a form element if necessary\n    if (typeof form === 'string') {\n        form = document.getElementById(form) as HTMLFormElement | HTMLDivElement;\n    }\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        failureReturnMessage.push(individualResponseMessage)\n        ExceptionHandler(individualResponseMessage.message);\n        return failureReturnMessage;\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        individualResponseMessage.message = \"options are not provided\"\n        return individualResponseMessage;\n    }\n\n    const shouldContinue: boolean[] = [];\n    const allSelectsInForm: NodeListOf<HTMLSelectElement> = form.querySelectorAll('select');\n\n    // If there are select fields in the form\n    if (allSelectsInForm.length > 0) {\n        // Iterate through all select fields in the form\n        allSelectsInForm.forEach((select: HTMLSelectElement) => {\n\n\n            options.customErrorMessages = options.customErrorMessages ?? [],\n            options.form = options.form ?? form\n\n            const validateSelectResponse = validateSelect(select, options);\n\n            if (validateSelectResponse === true) {\n                shouldContinue.push(true); // Validation succeeded for this select field\n            } else {\n                let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n                shouldContinue.push(false); // Validation failed for this select field\n                let proccessedResponse: string = validateSelectResponse as string;\n\n                individualResponseMessage.message = proccessedResponse\n                individualResponseMessage.data = select\n\n                failureReturnMessage.push(individualResponseMessage)\n\n            }\n        });\n    } else {\n        shouldContinue.push(true); // No select fields found in the form\n    }\n\n    // Check if all validation results are the same (either all true or all false)\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if ( checkIfAllElementsAreTrue )\n    {\n        return true;\n    }\n    \n    return failureReturnMessage;    \n};\n\nexport default validateAllSelect;\n","import { checkVariableType } from \"../utilities\";\nimport displayErrorInline from \"../errorHandling/displayErrorInline\";\nimport displayErrorModal from \"../errorHandling/displayErrorModal\";\nimport focusInputElement from \"../utilities/focusInputElement\";\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\n\n/**\n * Validates a textarea field.\n * @param {HTMLTextAreaElement} textareaField - The textarea element to validate.\n * @param {object} customErrorMessage - Custom error message for textarea validation.\n * @param {boolean} isErrorInline - Whether to display error inline or in a modal. Default is false.\n * @param {HTMLElement} form - The form element associated with the textarea. Default is undefined.\n * @returns {boolean} - Returns true if validation succeeds, otherwise false.\n */\nconst validateTextarea = (\n    textareaField: HTMLTextAreaElement,\n    options: any,\n    callback?: any\n): boolean | string | ErrorMessageInterface => {\n\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", type: 'error', code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, it must be executed in a browser environment.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n\n\n    // Check if the textarea element is valid and exists in the DOM\n    if ( ! textareaField )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\")\n        // failureReturnMessage.push(individualResponseMessage)\n        return individualResponseMessage;\n\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n\n        individualResponseMessage.message = \"options are not provided\";\n\n        return individualResponseMessage;\n    }\n\n    const isErrorInline: string = options.error_type || options.errorType || 'inline';\n    const customErrorMessages: any = options.customErrorMessages || [];\n    const form: HTMLFormElement | HTMLDivElement | undefined = options.form || undefined;\n    const includeHTML = options.includeHTML === false ? false : true;\n\n    // Determine if the textarea is required based on the 'required' attribute\n    const isRequired: boolean = textareaField.hasAttribute('required') || textareaField.classList.contains('js-required');\n\n    // Check if the textarea value is empty\n    const textareaValue: string = textareaField.value.trim();\n\n    // Determine the error message for textarea validation\n    let errorMessage: string = customErrorMessages?.textarea || \"Textarea cannot be left empty.\";\n\n    if ( ! includeHTML )\n    {\n\n        // Perform the validation for the select field\n        if (isRequired && ! textareaValue) {\n\n            ExceptionHandler(errorMessage)\n\n            individualResponseMessage.message = errorMessage;\n            individualResponseMessage.data = textareaField\n\n            return individualResponseMessage; // Validation failed\n        }\n\n        return true;\n\n    }\n\n    if ( ! form )\n    {\n\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        ExceptionHandler(\"The form you are trying to validate does not exist.\")\n        // failureReturnMessage.push(individualResponseMessage)\n        return individualResponseMessage;\n\n    }\n\n    // Perform the validation for the textarea\n    if (isRequired && ! textareaValue) {\n\n        ExceptionHandler(errorMessage)\n\n        individualResponseMessage.message = errorMessage;\n        individualResponseMessage.data = textareaField\n\n        // If the textarea is required and has no value, show the error message\n        if (isErrorInline === 'inline') {\n            displayErrorInline(textareaField, errorMessage, 3000);\n        } else {\n            focusInputElement(textareaField, 3000);\n            displayErrorModal(errorMessage, form);\n        }\n\n\n        return individualResponseMessage; // Validation failed\n    }\n\n    individualResponseMessage.code = 200\n    individualResponseMessage.data = null\n    individualResponseMessage.message = \"success\"\n    individualResponseMessage.type = \"success\"\n\n    // Validation succeeded\n    return true;\n};\n\nexport default validateTextarea;\n","import validateTextarea from \"./validateTextarea\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\n\n/**\n * Validate all textarea fields within a form.\n * @param {HTMLFormElement | HTMLDivElement} form - The form element to validate.\n * @param {Object} customErrorMessage - Custom error messages for form validation.\n * @returns {boolean} Returns true if all textarea fields are valid or not required, otherwise false.\n */\nconst validateAllTextarea = (form: HTMLFormElement | HTMLDivElement | string, options: any, callback?: any): ErrorMessageInterface[] | ErrorMessageInterface | boolean => {\n    const failureReturnMessage:ErrorMessageInterface[] = [];\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        individualResponseMessage.message = \"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\"\n    \n        failureReturnMessage.push(individualResponseMessage)\n\n        return failureReturnMessage;\n    }\n\n    // Check if the form parameter is a string (ID) and convert it to a form element if necessary\n    if (typeof form === 'string') {\n        form = document.getElementById(form) as HTMLFormElement | HTMLDivElement;\n    }\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        failureReturnMessage.push(individualResponseMessage)\n        ExceptionHandler(individualResponseMessage.message);\n        return failureReturnMessage;\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        individualResponseMessage.message = \"options are not provided\"\n        return individualResponseMessage;\n    }\n\n    const shouldContinue: boolean[] = [];\n    const allTextareasInForm: NodeListOf<HTMLTextAreaElement> = form.querySelectorAll('textarea');\n\n    // If there are textarea fields in the form\n    if (allTextareasInForm.length > 0) {\n\n        // Iterate through all textarea fields in the form\n        allTextareasInForm.forEach((textarea: HTMLTextAreaElement, index: number) => {\n\n            let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n            options.customErrorMessages = options.customErrorMessages ?? [] \n            options.errorType = options.errorType ??  'inline' \n            options.form = options.form ?? form\n\n            // Call the validateTextarea function for each textarea field\n            const validateAllTextareaResponse = validateTextarea(textarea,options);\n            if (validateAllTextareaResponse === true) {\n\n                shouldContinue.push(true); // Validation succeeded for this textarea field\n                \n            } else {\n\n                // console.log(validateAllTextareaResponse);\n                let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n                \n\n                shouldContinue.push(false); // Validation failed for this textarea field\n\n                let proccessedResponse: string = validateAllTextareaResponse as string;\n\n                individualResponseMessage.message = proccessedResponse\n                individualResponseMessage.data = textarea\n\n                failureReturnMessage.push(individualResponseMessage)\n\n            }\n\n        });\n    } else {\n        shouldContinue.push(true); // No textarea fields found in the form\n    }\n\n    // Check if all validation results are the same (either all true or all false)\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if ( checkIfAllElementsAreTrue )\n    {\n        return true;\n    }\n\n    // console.log(\"Error87451365: \",failureReturnMessage);\n    \n    return failureReturnMessage;\n};\n\nexport default validateAllTextarea;\n","// import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\n// import ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\n// import { areAllElementsTrue, checkVariableType } from \"../utilities\";\n// import validateAllInput from \"./validateAllnput\";\n// import validateAllSelect from \"./validateAllSelect\";\n// import validateAllTextarea from \"./validateAllTextarea\";\n\n// /**\n//  * Validate Form Inputs, Textareas, and Selects\n//  * @param {HTMLFormElement} form - The form element to validate.\n//  * @param {Object} customErrorMessages - Custom error messages for form validation (optional).\n//  * @param {boolean} isErrorInline - Whether to display error messages inline or in a modal (optional).\n//  * @returns {boolean} Returns true if form validation passes, otherwise false.\n//  */\n// const validateForm = (form: HTMLFormElement | HTMLDivElement | null, options?: any, isErrorInline?: boolean): boolean | ErrorMessageInterface | ErrorMessageInterface[] => {\n\n//     // Initialize errMsg with default values\n//     let errMsg: ErrorMessageInterface = { message: \"\", data: null, code : 400 };\n//     let errMsgArray: ErrorMessageInterface[] = [];\n\n//     // Check if the form exists; if not, log an error to the console and return false\n//     if (!form) {\n//         ExceptionHandler(\"Form element not found.\");\n\n//         errMsg.message = \"Form element not found.\";\n\n//         return errMsg;\n//     }\n\n\n//     // if ( checkVariableType(options) !== 'object' )\n//     // {\n//     //     ExceptionHandler(\"options are not provided\");\n//     //     errMsg.message = \"options are not provided\"\n//     //     errMsgArray.push(errMsg)\n//     //     return errMsgArray;\n//     // }\n\n//     // Initialize an array to track whether each validation check passes (true) or fails (false)\n//     const shouldContinue: boolean[] = [];\n\n//     // console.log(\"kytfdkftfln  \", options);\n    \n\n\n//     const isValidateAllInputs = validateAllInput(form, options);\n//     const isValidateAllTextareas = validateAllTextarea(form, options);\n//     const isValidateAllSelects = validateAllSelect(form, options);\n\n//     if (isValidateAllInputs === true) {\n//         shouldContinue.push(true);\n//     } else {\n\n//         let msg:ErrorMessageInterface = {code: 400, message: \"\"};\n//         let resMsg:ErrorMessageInterface[] = isValidateAllInputs as any;\n        \n//         msg.message = \"Inputs Validation Failed\";\n//         msg.data = resMsg\n\n//         errMsgArray.push(msg)\n\n//         // console.log(\"I AM AN ERROR: \", msg);\n//         errMsgArray['inputs'] = msg\n    \n//         shouldContinue.push(false);\n//     }\n\n//     if (isValidateAllTextareas === true) {\n//         shouldContinue.push(true);\n//     } else {\n//         shouldContinue.push(false);\n//         let msg:ErrorMessageInterface = {code: 400, message: \"\"};\n//         let resMsg:ErrorMessageInterface[] = isValidateAllTextareas as any;\n        \n//         msg.message = \"Textarea Validation Failed\";\n//         msg.data = resMsg\n\n//         errMsgArray.push(msg)\n//         errMsgArray['textareas'] = msg\n\n//     }\n\n//     if (isValidateAllSelects === true) {\n//         shouldContinue.push(true);\n//     } else {\n//         shouldContinue.push(false);\n//         let msg:ErrorMessageInterface = {code: 400, message: \"\"};\n//         let resMsg:ErrorMessageInterface[] = isValidateAllSelects as any;\n        \n//         msg.message = \"Selects Validation Failed\";\n//         msg.data = resMsg\n\n//         errMsgArray.push(msg)\n\n//         errMsgArray['selects'] = msg\n//     }\n\n    \n\n//     // Check if all elements in the shouldContinue array are equal to true\n//     const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n//     if ( checkIfAllElementsAreTrue )\n//     {\n//         return true;\n//     }\n\n//     const mainResponse:ErrorMessageInterface = {message: \"Form Validation Error\", data: errMsgArray};\n\n\n\n//     // console.log(\"MAIN RESPONSE: \", mainResponse);\n\n//     return mainResponse;\n\n// };\n\n// export default validateForm;\n\n\n\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport validateAllInput from \"./validateAllnput\";\nimport validateAllSelect from \"./validateAllSelect\";\nimport validateAllTextarea from \"./validateAllTextarea\";\n\nconst validateForm = (\n    form: HTMLFormElement | HTMLDivElement | null,\n    options?: any,\n    isErrorInline?: boolean\n): boolean | ErrorMessageInterface | { [key: string]: ErrorMessageInterface } => {\n\n    let errMsg: ErrorMessageInterface = { message: \"\", data: null, code: 400 };\n    let errMsgArray: { [key: string]: ErrorMessageInterface } = {};\n\n    if (!form) {\n        ExceptionHandler(\"Form element not found.\");\n        errMsg.message = \"Form element not found.\";\n        return errMsg;\n    }\n\n    const shouldContinue: boolean[] = [];\n\n    const isValidateAllInputs = validateAllInput(form, options);\n    const isValidateAllTextareas = validateAllTextarea(form, options);\n    const isValidateAllSelects = validateAllSelect(form, options);\n\n    if (isValidateAllInputs === true) {\n        shouldContinue.push(true);\n    } else {\n        let msg: ErrorMessageInterface = { code: 400, message: \"\" };\n        let resMsg: ErrorMessageInterface[] = isValidateAllInputs as any;\n\n        msg.message = \"Inputs Validation Failed\";\n        msg.data = resMsg;\n\n        errMsgArray['inputs'] = msg;\n        shouldContinue.push(false);\n    }\n\n    if (isValidateAllTextareas === true) {\n        shouldContinue.push(true);\n    } else {\n        shouldContinue.push(false);\n        let msg: ErrorMessageInterface = { code: 400, message: \"\" };\n        let resMsg: ErrorMessageInterface[] = isValidateAllTextareas as any;\n\n        msg.message = \"Textarea Validation Failed\";\n        msg.data = resMsg;\n\n        errMsgArray['textareas'] = msg;\n    }\n\n    if (isValidateAllSelects === true) {\n        shouldContinue.push(true);\n    } else {\n        shouldContinue.push(false);\n        let msg: ErrorMessageInterface = { code: 400, message: \"\" };\n        let resMsg: ErrorMessageInterface[] = isValidateAllSelects as any;\n\n        msg.message = \"Selects Validation Failed\";\n        msg.data = resMsg;\n\n        errMsgArray['selects'] = msg;\n    }\n\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if (checkIfAllElementsAreTrue) {\n        return true;\n    }\n\n    const mainResponse: ErrorMessageInterface = {\n        message: \"Form Validation Error\",\n        data: errMsgArray\n    };\n\n    return mainResponse;\n};\n\nexport default validateForm;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport validateCheckbox from \"./validateCheckbox\";\n\n/**\n * Validates all checkbox inputs within a form.\n * @param {HTMLFormElement} form - The form element containing the checkbox inputs.\n * @param {object} customErrorMessages - Custom error messages for checkbox validation.\n * @returns {boolean} - Returns true if all checkbox inputs are valid or not required, otherwise false.\n */\nconst validateAllCheckbox = (form: HTMLFormElement | HTMLDivElement, options: any): boolean | ErrorMessageInterface | ErrorMessageInterface[]  => {\n\n    const failureReturnMessage:ErrorMessageInterface[] = [];\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\");\n        ExceptionHandler(\"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\", 'big')\n        return false;\n    }\n\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist. 5555 0000\";\n        individualResponseMessage.data = form;\n        failureReturnMessage.push(individualResponseMessage)\n        ExceptionHandler(individualResponseMessage.message);\n        return failureReturnMessage;\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        individualResponseMessage.message = \"options are not provided\"\n        return individualResponseMessage;\n    }\n\n    // Array to track the validation results for each checkbox\n    const shouldContinue: boolean[] = [];\n    \n    // Get all checkbox inputs within the form\n    const allCheckboxesInForm: NodeListOf<HTMLInputElement> = form.querySelectorAll('input[type=\"checkbox\"]');\n\n    if (allCheckboxesInForm.length > 0) {\n        // Iterate over each checkbox input\n        allCheckboxesInForm.forEach((checkbox: HTMLInputElement) => {\n\n            options.customErrorMessages = options.customErrorMessages ?? [],\n            options.form = options.form ?? form\n\n            const validateInputResponse = validateCheckbox(checkbox, options);\n\n            // Validate each checkbox input\n            if (validateInputResponse === true) {\n                shouldContinue.push(true); // Checkbox is valid or not required\n            } else {\n                shouldContinue.push(false); // Checkbox is required and not \n                let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n                shouldContinue.push(false); // Validation failed for this select field\n                let proccessedResponse: string = validateInputResponse as string;\n\n                individualResponseMessage.message = proccessedResponse\n                individualResponseMessage.data = checkbox\n\n                failureReturnMessage.push(individualResponseMessage)\n            }\n\n        });\n    } else {\n        shouldContinue.push(true); // No checkboxes found, mark validation as successful\n    }\n\n    // Check if all validation results are the same (either all true or all false)\n    const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n    if ( checkIfAllElementsAreTrue )\n    {\n        return true;\n    }\n\n    // console.log(failureReturnMessage);\n\n    return failureReturnMessage;    \n\n};\n\nexport default validateAllCheckbox;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport { areAllElementsTrue, checkVariableType } from \"../utilities\";\nimport validateRadio from \"./validateRadio\";\n\n/**\n * Validates all radio inputs within a form.\n * @param {HTMLElement} form - The form element containing radio inputs to be validated.\n * @param {object} customErrorMessage - Custom error message for radio validation.\n * @returns {boolean} - Returns true if all radio inputs are valid, otherwise false.\n */\nconst validateAllRadio = (form: HTMLFormElement | HTMLDivElement | string, options: any): ErrorMessageInterface[] | ErrorMessageInterface | boolean => {\n\n    const failureReturnMessage:ErrorMessageInterface[] = [];\n    let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n    // Check if running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\"To access this function, it must be executed in a browser environment.\");\n        individualResponseMessage.message = \"To access this function, you will need to execute it in a browser like Google Chrome, Safari, Firefox, Microsoft Edge, etc.\"\n    \n        failureReturnMessage.push(individualResponseMessage)\n\n        return failureReturnMessage;\n        // return false;\n    }\n\n    // Check if the form parameter is a string (ID) and convert it to a form element if necessary\n    if (typeof form === 'string') {\n        form = document.getElementById(form) as HTMLFormElement | HTMLDivElement;\n    }\n\n    // Check if the form element exists\n    if (!form) {\n        individualResponseMessage.message = \"The form you are trying to validate does not exist.\";\n        failureReturnMessage.push(individualResponseMessage)\n        return failureReturnMessage;\n    }\n\n    if ( checkVariableType(options) !== 'object' )\n    {\n        ExceptionHandler(\"options are not provided\");\n        individualResponseMessage.message = \"options are not provided\"\n        return individualResponseMessage;\n    }\n\n    // Get all radio inputs within the form\n    const allRadiosInForm: NodeListOf<HTMLInputElement> = form.querySelectorAll('input[type=\"radio\"]');\n    const shouldContinue: boolean[] = [];\n\n    // Iterate through each radio input and validate\n    allRadiosInForm.forEach((radio: HTMLInputElement) => {\n\n        let individualResponseMessage: ErrorMessageInterface = { message: \"\", code : 400 };\n\n        const validateRadioResponse = validateRadio(radio, options);\n\n        if ( validateRadioResponse === true ) {\n\n            shouldContinue.push(true);\n\n        } else {\n\n            shouldContinue.push(false);\n\n            let proccessedResponse: string = validateRadioResponse.message as string;\n\n            individualResponseMessage.message = proccessedResponse\n            individualResponseMessage.data = radio\n\n            failureReturnMessage.push(individualResponseMessage)\n\n        }\n\n    });\n\n     // Check if all validation results are the same (either all true or all false)\n     const checkIfAllElementsAreTrue = areAllElementsTrue(shouldContinue);\n\n     if ( checkIfAllElementsAreTrue )\n     {\n         return true;\n     }\n \n    //  console.log(failureReturnMessage);\n     \n     return failureReturnMessage;\n};\n\nexport default validateAllRadio;\n","/**\n * Check if a given password meets specific criteria.\n * @param {string} password - The password to be checked.\n * @param {number} [minLength=8] - The minimum length required for the password (default: 8).\n * @param {number} [maxLength=20] - The maximum length allowed for the password (default: 20).\n * @param {boolean} [includeSymbolsCheck=false] - Flag to determine if symbols check is required (default: false).\n * @param {RegExp | string} [userSymbolRegex=''] - Custom regular expression or string representing symbols to check (default: '').\n * @returns {boolean | string} Returns true if the password meets the criteria; otherwise, returns an error message.\n */\nconst checkPassword = (\n    password: string,\n    includeSymbolsCheck: boolean = false,\n    minLength: number = 8,\n    maxLength: number = 20,\n    userSymbolRegex: RegExp | string = ''\n): boolean | string => {\n    // Regular expressions for checking uppercase, lowercase, and numeric characters.\n    const uppercaseRegex = /[A-Z]/;\n    const lowercaseRegex = /[a-z]/;\n    const numbersRegex = /[0-9]/;\n\n    // Check the length of the password.\n    if (password.length < minLength || password.length > maxLength) {\n        return `Make sure the length of your password ranges from ${minLength} - ${maxLength} characters`;\n    }\n\n    // Check if the password contains at least one uppercase letter.\n    if (!uppercaseRegex.test(password)) {\n        return \"Your password needs to have at least 1 uppercase (A-Z)\";\n    }\n\n    // Check if the password contains at least one lowercase letter.\n    if (!lowercaseRegex.test(password)) {\n        return \"Your password needs to have at least one lowercase (a-z)\";\n    }\n\n    // Check if the password contains at least one numeric character.\n    if (!numbersRegex.test(password)) {\n        return \"Your password needs to have at least one number (0-9)\";\n    }\n\n    // If symbols check is required, perform the check.\n    if (includeSymbolsCheck) {\n        // Define the regular expression for symbols or use the custom one provided by the user.\n        const symbolRegex = typeof userSymbolRegex === 'string' ? new RegExp(userSymbolRegex) : userSymbolRegex;\n\n        // Check if the password contains at least one symbol.\n        if (!symbolRegex.test(password)) {\n            return \"Your password needs to have one symbol e.g (!@#$%^&*())\";\n        }\n    }\n\n    // If all checks pass, return true.\n    return true;\n}\n\nexport default checkPassword;\n","import * as bcrypt from 'bcryptjs';\n\n\n/**\n * Hashes a password using bcrypt.\n * @param {string} password - The password to be hashed.\n * @returns {Promise<string>} A promise that resolves to the hashed password.\n */\nconst hashPassword = async (password: string): Promise<string> => {\n    // Generate a unique salt for each password\n    const salt = await bcrypt.genSalt(10);\n\n    // Hash the password with the generated salt using bcrypt\n    const hashedPassword = await bcrypt.hash(password, salt);\n\n    return hashedPassword;\n};\n\nexport default hashPassword;\n","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport hashPassword from \"./hashPassword\";\n\n/**\n * Generates a random password.\n * @param {number} [length] - The length of the generated password. If not provided, a random length between 8 and 18 characters will be used.\n * @param {boolean} [shouldHash=false] - A flag indicating whether the generated password should be hashed. Default is false.\n * @returns {Promise<string | [string, string]>} - A Promise that resolves to the generated password. If shouldHash is true, resolves to an array containing the plain password and the hashed password.\n */\nconst generatePassword = async (length: number = Math.floor(Math.random() * 11) + 8, shouldHash: boolean = false):  Promise<any> => {\n    // The minimum length of the generated password.\n    const minLength: number = 8;\n\n    // The maximum length of the generated password.\n    const maxLength: number = 18;\n\n    // A string containing all uppercase letters.\n    const uppercaseLetters: string = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n    // A string containing all lowercase letters.\n    const lowercaseLetters: string = \"abcdefghijklmnopqrstuvwxyz\";\n\n    // A string containing all digits (numbers).\n    const numbers: string = \"0123456789\";\n\n    // A string containing all symbols.\n    const symbols: string = \"!@#$%^&*()\";\n\n    // The generated password.\n    let password: string = \"\";\n\n    // Validate the length parameter\n    if (length < minLength || length > maxLength) {\n        ExceptionHandler(\"Password length must be between 8 and 18 characters.\", 'error_1');\n    }\n\n    // Add at least one uppercase letter to the password.\n    password += uppercaseLetters[Math.floor(Math.random() * uppercaseLetters.length)];\n\n    // Add at least one symbol to the password.\n    password += symbols[Math.floor(Math.random() * symbols.length)];\n\n    // Add at least one number to the password.\n    password += numbers[Math.floor(Math.random() * numbers.length)];\n\n    // The number of characters already added to the password.\n    let charactersAdded: number = 3;\n\n    // Add remaining characters based on the provided length.\n    while (charactersAdded < length) {\n        // Choose a random character type: 0 for uppercase letter, 1 for lowercase letter, 2 for symbol, 3 for number.\n        const randomCharType: number = Math.floor(Math.random() * 4);\n\n        if (randomCharType === 0) {\n            password += uppercaseLetters[Math.floor(Math.random() * uppercaseLetters.length)];\n        } else if (randomCharType === 1) {\n            password += lowercaseLetters[Math.floor(Math.random() * lowercaseLetters.length)];\n        } else if (randomCharType === 2) {\n            password += symbols[Math.floor(Math.random() * symbols.length)];\n        } else {\n            password += numbers[Math.floor(Math.random() * numbers.length)];\n        }\n\n        charactersAdded++;\n    }\n\n    // If shouldHash is true, hash the generated password\n    if (shouldHash) {\n        const hashedPassword = await hashPassword(password);\n        return {0:password, 1:hashedPassword, password:password, hashedPassword:hashedPassword};\n    }\n\n\n    // Return the generated password.\n    return password;\n};\n\nexport default generatePassword;\n","import * as bcrypt from 'bcryptjs';\n\n/**\n * Verify a password against a hashed password.\n * @param {string} stringPassword - The plain text password to verify.\n * @param {string} hashedPassword - The hashed password to compare against.\n * @param {boolean} [isHashed=false] - Indicates whether the provided password is already hashed. Default is false.\n * @returns {Promise<boolean>} Returns a promise that resolves to true if the passwords match, false otherwise.\n */\nconst verifyPassword = async (stringPassword: string, hashedPassword: string, isHashed: boolean = false): Promise<boolean> => {\n    try {\n        if (isHashed) {\n            // Use bcrypt.compare to compare hashed passwords.\n            const match = await bcrypt.compare(stringPassword, hashedPassword);\n            return match; // Return the result of the comparison.\n        } else {\n            // Compare plain text passwords directly.\n            return stringPassword === hashedPassword;\n        }\n    } catch (error) {\n        console.error(\"Error comparing passwords: \", error); // Log an error if bcrypt.compare encounters an issue.\n        return false; // Return false in case of an error.\n    }\n};\n\nexport default verifyPassword;\n","/**\n * Checks the type of a variable and returns a string representation of the type.\n * If the type cannot be determined, returns 'unknown'.\n *\n * @param {*} variable - The variable whose type needs to be checked.\n * @returns {string} A string representing the type of the variable, or 'unknown'.\n */\nconst checkVariableType = (variable: any): string => {\n    // Check if the variable is a string\n    if (typeof variable === 'string') {\n        return 'string';\n    }\n    // Check if the variable is a number\n    else if (typeof variable === 'number') {\n        return 'number';\n    }\n    // Check if the variable is a boolean\n    else if (typeof variable === 'boolean') {\n        return 'boolean';\n    }\n    // Check if the variable is undefined\n    else if (typeof variable === 'undefined') {\n        return 'undefined';\n    }\n    // Check if the variable is null\n    else if (variable === null) {\n        return 'null';\n    }\n    // Check if the variable is an HTMLElement (assumes that HTMLElement is defined in the environment)\n    else if (variable instanceof HTMLElement) {\n        return 'HTML Element';\n    }\n    // Check if the variable is an array\n    else if (typeof variable === 'object' && variable instanceof Array) {\n        return 'array';\n    }\n    // Check if the variable is an object\n    else if (typeof variable === 'object' && variable instanceof Object) {\n        return 'object';\n    }\n    // Check if the variable is a function\n    else if (typeof variable === 'function') {\n        return 'function';\n    }\n    // If none of the above conditions match, the data type is unknown\n    else {\n        return 'null';\n    }\n}\n\nexport default checkVariableType;","const isOnline = (): boolean => {\n    // Check if the code is running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\n            \"You need to be in a browser environment like Google Chrome, Safari, Firefox, Microsoft Edge, etc. for this function to work.\"\n        );\n        return false;\n    }\n\n    // Check if the browser reports that it is online\n    if (navigator.onLine) {\n        return true;\n    }\n\n    // Return false if the browser is not online\n    return false;\n};\n\nexport default isOnline;","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport ErrorMessageInterface from \"../interfaces/ErrorMessagesInterface\";\nimport checkVariableType from \"../utilities/checkVariableType\";\n\n/**\n * Changes the content of a button or input element to a specified message while providing loading feedback.\n * @param {string} message - The message to set as the content of the button or input element.\n * @param {string | HTMLElement | null} submitBtn - The button or input element to update.\n * @param {string | HTMLElement | null} form - The HTML form element or its ID.\n * @returns {boolean} Returns true if the operation is successful, false if the button is not found.\n */\nconst loading = (message: string, submitBtn: string | HTMLElement | null = null, form: string | HTMLElement | null = null): boolean | ErrorMessageInterface => {\n    let btn: HTMLElement | null = null; // Initialize btn to null\n    let individualResponseMessage: ErrorMessageInterface = { message: \"error\", type: 'error', code : 400 };\n\n\n    // Check the type of submitBtn and find the corresponding element\n    if (checkVariableType(submitBtn) === 'HTML Element') {\n        btn = submitBtn as HTMLElement;\n    } else if (typeof submitBtn === 'string') {\n        btn = document.getElementById(submitBtn);\n    } else if (submitBtn === null && form) {\n        // Attempt to find a suitable button element if submitBtn is null\n        const formElement = typeof form === 'string' ? document.getElementById(form) : form;\n        if (formElement instanceof HTMLFormElement || formElement instanceof HTMLDivElement) {\n            btn = formElement.querySelector('button[type=\"submit\"], input[type=\"submit\"], #jsSubmit, input[type=\"search\"], button');\n        }\n    } else {\n        // Handle the case where the button is not found\n        // console.error(\"The button element specified is not found.\");\n        individualResponseMessage.message = \"The button element specified is not found.\";\n        ExceptionHandler(individualResponseMessage.message)\n        return individualResponseMessage;\n    }\n\n    if (!btn) {\n        individualResponseMessage.message = \"The button element specified is not found.\";\n        ExceptionHandler(individualResponseMessage.message)\n        return individualResponseMessage;\n    }\n\n    // Update the content of the button with the provided message\n    if (btn) {\n        if (btn.tagName.toLowerCase() === 'input') {\n            (btn as HTMLInputElement).value = message;\n        } else {\n            btn.innerHTML = message;\n        }\n        return true;\n    }\n\n    individualResponseMessage.message = \"The button element specified is not found.\";\n    ExceptionHandler(individualResponseMessage.message)\n    return individualResponseMessage;\n};\n\nexport default loading;\n","import getPageUrl from \"./getPageUrl\";\n\n/**\n * Redirects the user to a specified URL, either immediately or after a specified delay.\n *\n * If the code is running in a browser environment, it uses window.location.href for redirection.\n * In a non-browser environment (e.g., Node.js console), it logs a message indicating the redirection.\n *\n * @param {string} [url=getPageUrl()] - An optional URL to which the user should be redirected.\n *                                           Defaults to the current page's URL if not provided.\n * @param {number} [delay=0] - An optional parameter to delay redirection in seconds.\n */\nconst redirect = (url: string | null = null , delay: number = 0) => {\n\n\n    if ( ! url )\n    {\n        url = getPageUrl() as string;\n    }\n\n    // Check if the code is running in a browser environment\n    if (typeof window !== 'undefined') {\n        // Redirect in a browser environment after the specified delay\n        setTimeout(() => {\n            window.location.href = url;\n        }, delay * 1000); // Convert seconds to milliseconds\n    } else {\n        // Running in a non-browser environment (e.g., Node.js console)\n        console.log(`Redirecting to: ${url || 'current page'} (Delayed: ${delay} seconds)`);\n    }\n\n};\n\nexport default redirect;","const reset = (form: HTMLFormElement | HTMLDivElement | string | null = null): boolean => {\n    // Check if the code is running in a browser environment\n    if (typeof window === 'undefined') {\n        console.error(\n            \"You need to be in a browser environment like Google Chrome, Safari, Firefox, Microsoft Edge, etc. for this function to work.\"\n        );\n        return false;\n    }\n\n    // Get the target form element\n    let targetForm: HTMLElement | null = null;\n    if (typeof form === 'string') {\n        // If the form parameter is a string, assume it's an ID and try to find the element\n        targetForm = document.getElementById(form);\n        if (!targetForm) {\n            console.error(`Form with ID \"${form}\" not found.`);\n            return false;\n        }\n    } else if (form instanceof HTMLFormElement || form instanceof HTMLDivElement) {\n        // If the form parameter is a valid HTMLFormElement or HTMLDivElement, use it directly\n        targetForm = form;\n    } else if (form === null) {\n        // If no form parameter is provided, default to the document's body\n        targetForm = document.body;\n    } else {\n        console.error(\"Invalid form parameter.\");\n        return false;\n    }\n\n    // Select all form elements within the target form\n    const allFormElements = targetForm.querySelectorAll<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>('input, textarea, select');\n\n    // Reset the values of input fields, textareas, and selected index of select elements\n    allFormElements.forEach((element: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement) => {\n        if (element instanceof HTMLInputElement) {\n            if (element.type === 'radio' || element.type === 'checkbox') {\n                element.checked = false;\n            } else {\n                element.value = '';\n            }\n        } else if (element instanceof HTMLTextAreaElement) {\n            element.value = '';\n        } else if (element instanceof HTMLSelectElement) {\n            element.selectedIndex = 0;\n        }\n    });\n\n    return true;\n};\n\nexport default reset;\n","import { checkVariableType } from \".\";\nimport { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\n\n/**\n * Toggles the visibility of a password input and updates the corresponding visibility icon.\n * @param {HTMLElement} input - The password input element.\n * @param {Element} [showIcon=null] - Icon for showing the password.\n * @param {Element} [hideIcon=null] - Icon for hiding the password.\n * @returns {void}\n */\nconst togglePasswordVisibility = (input: HTMLInputElement, showIcon: string | HTMLElement | null = null, hideIcon: string | HTMLElement | null = null): boolean | any => {\n\n\n    let allTogglePasswordsButton : any | undefined = document.querySelectorAll('.nfsfu234_fv_togglePassword') || document.querySelectorAll('.js-togglePassword') || undefined;\n    \n    // if ( allTogglePasswordsButton.length < 1 )\n    // {\n\n    //     allTogglePasswordsButton = document.querySelectorAll('.js-togglePassword');\n\n    // }\n    \n    // if ( allTogglePasswordsButton.length < 1 )\n    // {\n\n    //     allTogglePasswordsButton = undefined;\n\n    // }\n\n\n    if ( ! allTogglePasswordsButton )\n    {\n        ExceptionHandler(\"No Toggle Password Button was found. Check your HTML Code\", 'error_1')\n        return false;\n    }\n\n    function updateIcon(inputType:string, iconContainer:HTMLElement) {\n\n        if (showIcon === null) {\n            // iconContainer.appendChild(showIcon.cloneNode(true));\n\n            // iconContainer.innerHTML = \"\"\n\n            showIcon = \"show\"\n\n        } \n        \n        if (hideIcon === null) {\n            // iconContainer.appendChild(hideIcon.cloneNode(true));\n\n            // iconContainer.innerHTML = \"\"\n\n            hideIcon = \"hide\"\n\n        }\n\n        // Append the appropriate icon.\n        if (inputType === 'password' && showIcon !== null) {\n            // iconContainer.appendChild(showIcon.cloneNode(true));\n\n            iconContainer.innerHTML = \"\"\n\n            if ( typeof showIcon === \"string\" )\n            {\n                iconContainer.innerHTML = showIcon\n            }\n            else if ( checkVariableType(showIcon) === \"HTML Element\" )\n            {\n                iconContainer.appendChild(showIcon)\n            }\n            else\n            {\n                iconContainer.innerHTML = showIcon\n            }\n\n        } else if (inputType === 'text' && hideIcon !== null) {\n            // iconContainer.appendChild(hideIcon.cloneNode(true));\n            iconContainer.innerHTML = \"\"\n\n            if ( typeof hideIcon === \"string\" )\n            {\n                iconContainer.innerHTML = hideIcon\n            }\n            else if ( checkVariableType(hideIcon) === \"HTML Element\" )\n            {\n                iconContainer.appendChild(hideIcon)\n            }\n            else\n            {\n                iconContainer.innerHTML = showIcon\n            }\n\n        }\n\n\n    }\n\n    allTogglePasswordsButton.forEach( (toggleBtn: HTMLElement) => {\n\n        let inputType = input.type;\n        const iconContainer: HTMLElement | null = input.nextElementSibling as HTMLElement;\n\n        updateIcon(inputType, iconContainer)\n\n        toggleBtn.addEventListener('click', ()=>{\n\n            // Toggle the input type between 'password' and 'text'.\n            input.type = input.type === 'password' ? 'text' : 'password';\n\n            // Update the visibility icon based on the current input type.\n            const inputType: string = input.type;\n            if (iconContainer) {\n                // Clear existing icon content.\n                // iconContainer.textContent = '';\n\n                updateIcon(inputType, iconContainer)\n\n            }\n\n        })\n\n    } )\n\n\n\n};\n\n\nexport default togglePasswordVisibility;","import { ExceptionHandler } from \"../errorHandling/ExceptionHandler\";\nimport togglePasswordVisibility from \"./togglePasswordVisibility\";\n\n/**\n * Toggles the visibility of password inputs and updates corresponding visibility icons.\n * @param {object} [icons={}] - Object containing icons for showing and hiding the password.\n * @param {Element} [icons.show=null] - Icon for showing the password.\n * @param {Element} [icons.hide=null] - Icon for hiding the password.\n * @param {string | HTMLElement} [uform=null] - The form element or its ID.\n * @param {boolean} [toggleAll=false] - Flag indicating whether to toggle all password inputs.\n * @returns {void}\n */\nconst togglePasswordVisibilityAll = (icons: { show?: string | HTMLElement | null, hide?: string | HTMLElement | null } = {}, uform: string | HTMLFormElement | HTMLDivElement | null = null, toggleAll: boolean = false): void => {\n    // Get the form element based on the provided ID or directly.\n    const form: HTMLElement | null = typeof uform === 'string' ? document.getElementById(uform) : uform;\n\n    if (!form) {\n        console.error('Form element not found.');\n        ExceptionHandler(\"Form Element not found\");\n        return;\n    }\n\n    // Get all password inputs within the specified form.\n    const allPasswordInputs: NodeListOf<HTMLInputElement> = form.querySelectorAll('input[type=\"password\"]');\n\n    // Get the icon elements for showing and hiding the password.\n    const showIcon: string | HTMLElement | null = icons.show || null;\n    const hideIcon: string | HTMLElement | null = icons.hide || null;\n\n    if (toggleAll) {\n        // Toggle visibility for all password inputs.\n        allPasswordInputs.forEach((input: HTMLInputElement) => {\n            togglePasswordVisibility(input, showIcon, hideIcon);\n        });\n    } else {\n        // Toggle visibility for the first password input.\n        if (allPasswordInputs.length > 0) {\n            togglePasswordVisibility(allPasswordInputs[0], showIcon, hideIcon);\n        }\n    }\n};\n\n\nexport default togglePasswordVisibilityAll;","'use strict';\n\nimport ajax from \"./ajax/ajax\";\nimport ErrorHandler from \"./errorHandling\";\nimport { ExceptionHandler, LogLevelInterface } from \"./errorHandling/ExceptionHandler\";\nimport displayError from \"./errorHandling/displayError\";\nimport submitForm from \"./formSubmission/submitHandler\";\nimport getFormDetails from \"./formValidations/getFormDetails\";\nimport restrictInputLengthWithCounter from \"./formValidations/restrictInputLengthWithCounter\";\nimport validateForm from \"./formValidations/validate\";\nimport validateAllCheckbox from \"./formValidations/validateAllCheckbox\";\nimport validateAllRadio from \"./formValidations/validateAllRadio\";\nimport validateAllSelect from \"./formValidations/validateAllSelect\";\nimport validateAllTextarea from \"./formValidations/validateAllTextarea\";\nimport validateAllInput from \"./formValidations/validateAllnput\";\nimport validateCheckbox from \"./formValidations/validateCheckbox\";\nimport validateInput from \"./formValidations/validateInput\";\nimport validateRadio from \"./formValidations/validateRadio\";\nimport validateSelect from \"./formValidations/validateSelect\";\nimport validateTextarea from \"./formValidations/validateTextarea\";\nimport ErrorMessageInterface from \"./interfaces/ErrorMessagesInterface\";\nimport checkPassword from \"./password-handling/checkPassword\";\nimport generatePassword from \"./password-handling/generatePassword\";\nimport hashPassword from \"./password-handling/hashPassword\";\nimport verifyPassword from \"./password-handling/verifyPassword\";\nimport checkVariableType from \"./utilities/checkVariableType\";\nimport checkType from \"./utilities/checkVariableType\";\nimport containsOnlyIntegers from \"./utilities/containsOnlyIntegers\";\nimport countString from \"./utilities/countString\";\nimport getPageUrl from \"./utilities/getPageUrl\";\nimport isEmail from \"./utilities/isEmail\";\nimport isOnline from \"./utilities/isOnline\";\nimport isURL from \"./utilities/isURL\";\nimport isZIP from \"./utilities/isZIP\";\nimport loading from \"./utilities/loading\";\nimport redirect from \"./utilities/redirect\";\nimport reset from \"./utilities/reset\";\nimport togglePasswordVisibility from \"./utilities/togglePasswordVisibility\";\nimport togglePasswordVisibilityAll from \"./utilities/togglePasswordVisibilityAll\";\n\n\n// src/interfaces/FormValidationOptions.ts\n\n    \nclass NFSFU234FormValidation {\n    // private attributes\n    private AJAXResult: null | Promise<any>;\n\n    // public attributes\n    public form: HTMLFormElement | HTMLDivElement | undefined;\n    \n    public customErrorMessages: { [key: string]: string } = {};\n\n    constructor(formDetails?: any, AJAXOptions?: any) {\n        console.log(\"NFSFU234FormValidation is loaded....\");\n    \n        if (typeof window === 'undefined') {\n            this.form = undefined;\n        } else {\n            // Initial assignment of this.form\n            let formElement: HTMLFormElement | HTMLDivElement | undefined = undefined;\n    \n            // Check if formDetails is provided and valid\n            if (formDetails && formDetails['form']) {\n                if (typeof formDetails['form'] === 'string' && formDetails['form'] !== '') {\n                    formElement = document.getElementById(formDetails['form']) as HTMLFormElement | HTMLDivElement | undefined;\n                } else if (formDetails['form'] instanceof HTMLElement) {\n                    formElement = formDetails['form'] as HTMLFormElement | HTMLDivElement;\n                }\n            }\n    \n            // Fallback to default form selectors if formElement is not set\n            if (!formElement) {\n                formElement = document.getElementById('jsForm') as HTMLFormElement | HTMLDivElement | undefined;\n            }\n            if (!formElement) {\n                formElement = document.querySelector('form') as HTMLFormElement | HTMLDivElement | undefined;\n            }\n    \n            // Assign formElement to this.form\n            this.form = formElement;\n        }\n    \n        // If form is found and is an HTMLElement, add novalidate attribute and submit event listener\n        if (this.form && this.form instanceof HTMLElement) {\n            if (!this.form.hasAttribute('novalidate')) {\n                this.form.setAttribute('novalidate', '');\n            }\n    \n            this.form.addEventListener('submit', (e) => {\n                e.preventDefault();\n            });\n        }\n    \n        this.AJAXResult = null; // Store the result of an AJAX call.\n    }\n    \n\n    private populateOptionsVariables(options: any, formElement: HTMLFormElement | HTMLDivElement | undefined) {\n        let isAjax = false;\n        let ajaxOptions: null | {\n            url: string,\n            RequestMethod: \"GET\" | \"POST\" | \"PATCH\" | \"UPDATE\" | \"DELETE\",\n            RequestHeader?: { [key: string]: string },\n            RequestBody?: object | FormData | JSON\n        } = null;\n\n        if (typeof options === 'object' && options !== null) {\n            isAjax = options.isAjax === true || false;\n            ajaxOptions = options.ajaxOptions || null;\n        } else if (formElement) {\n            isAjax = formElement.getAttribute('isAjax')?.trim() === \"true\" || false;\n\n            const url = formElement.getAttribute('action') || '';\n            const requestMethod = (formElement.getAttribute('method') || 'GET').toUpperCase();\n\n            const requestHeaders: { [key: string]: string } = {};\n            const regex = /^nfsfu234_fv_reqheader_(.+)$/i;\n\n            for (let i = 0; i < formElement.attributes.length; i++) {\n                const attr = formElement.attributes[i];\n                const originalName = attr.name;\n                const attrName = attr.name.toLowerCase();\n                const match = attrName.match(regex);\n\n                if (match) {\n                    const headerKey = match[1];\n                    requestHeaders[headerKey] = attr.value;\n                }\n            }\n\n            ajaxOptions = {\n                url,\n                RequestMethod: requestMethod as \"GET\" | \"POST\" | \"PATCH\" | \"UPDATE\" | \"DELETE\",\n                RequestHeader: Object.keys(requestHeaders).length > 0 ? requestHeaders : undefined,\n                RequestBody: undefined\n            };\n        }\n\n        return { isAjax, ajaxOptions };\n    }\n\n    // public submit(userOptions?: HTMLFormElement | HTMLDivElement | string | { form: string | HTMLFormElement | HTMLDivElement, customErrorMessages?: { [key: string]: string } }, callback?: any): boolean | Promise<any> {\n    //     this.form = this.form || undefined;\n    //     this.customErrorMessages = this.customErrorMessages || {};\n\n    //     let formElement: HTMLFormElement | HTMLDivElement | undefined = this.form;\n    //     let options: any = this.customErrorMessages;\n\n    //     let isAjax = false;\n    //     let ajaxOptions: null | {\n    //         url: string,\n    //         RequestMethod: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"UPDATE\" | \"DELETE\",\n    //         RequestHeader?: object,\n    //         RequestBody?: object | FormData | JSON | any\n    //     } = null;\n\n    //     if (typeof userOptions === 'string') {\n    //         formElement = document.getElementById(userOptions) as HTMLFormElement | HTMLDivElement | undefined;\n    //         options.form = formElement;\n    //         options.customErrorMessages = [];\n    //     } else if (userOptions instanceof HTMLFormElement || userOptions instanceof HTMLDivElement) {\n    //         formElement = userOptions;\n    //         options.form = userOptions;\n    //         options.customErrorMessages = [];\n    //     } else if (userOptions && typeof userOptions === 'object' && 'form' in userOptions) {\n    //         if (typeof userOptions.form === 'string') {\n    //             formElement = document.getElementById(userOptions.form) as HTMLFormElement | HTMLDivElement | undefined;\n    //         } else if (userOptions.form instanceof HTMLFormElement || userOptions.form instanceof HTMLDivElement) {\n    //             formElement = userOptions.form;\n    //         }\n    //         options.form = formElement;\n    //         options.customErrorMessages = userOptions.customErrorMessages ?? [];\n    //     } else {\n    //         formElement = this.form;\n    //         options.form = this.form;\n    //         options.customErrorMessages = [];\n    //     }\n\n    //     if (formElement) {\n    //         const doesNoValidateAttrExist = formElement.getAttribute('novalidate') ? true : false;\n\n    //         if (!doesNoValidateAttrExist) {\n    //             formElement.setAttribute('novalidate', '');\n    //         }\n\n    //         formElement.addEventListener('submit', (e) => {\n    //             e.preventDefault();\n    //         });\n\n    //         const { isAjax: processedIsAjax, ajaxOptions: processedAjaxOptions } = this.populateOptionsVariables(userOptions, formElement);\n\n    //         let errMsg: ErrorMessageInterface = { message: \"\", type: \"\" };\n    //         const errMsgFromFunction = validateForm(formElement, options);\n\n    //         if (errMsgFromFunction === true) {\n    //             errMsg.message = \"success\";\n    //             errMsg.type = \"success\";\n    //             errMsg.data = null;\n    //         } else if (typeof errMsgFromFunction === 'object') {\n    //             const errMessageFromValidate = errMsgFromFunction.message || null;\n    //             errMsg.message = errMessageFromValidate || \"Error\";\n    //             errMsg.data = errMsgFromFunction;\n    //         } else {\n    //             errMsg.message = \"Error\";\n    //             errMsg.type = \"error\";\n    //         }\n\n    //         isAjax = processedIsAjax;\n    //         ajaxOptions = processedAjaxOptions;\n\n    //         if (!ajaxOptions) {\n    //             return false;\n    //         }\n\n    //         ajaxOptions.RequestBody = getFormDetails(formElement);\n\n    //         if (errMsg.message === \"success\") {\n    //             if (isAjax && ajaxOptions !== null) {\n    //                 return ajax(ajaxOptions).then(response => {\n    //                     const responseCode = response.code || response.status;\n    //                     if (responseCode >= 300 && responseCode <= 500) {\n    //                         const errorDetails = {\n    //                             type: 'modal',\n    //                             message: response.message,\n    //                             duration: 3000,\n    //                             element: formElement,\n    //                             success: false,\n    //                         };\n\n    //                         errMsg.message = response.message;\n    //                         errMsg.type = \"error\";\n    //                         errMsg.code = responseCode;\n    //                         errMsg.data = response.data;\n\n    //                         this.displayError(errorDetails);\n    //                         console.error(\"THIS IS ERR_ \", response.message);\n\n    //                         return errMsg;\n    //                     } else {\n    //                         console.log(\"Success\");\n    //                         return response;\n    //                     }\n    //                 }).catch(error => {\n    //                     console.error(\"LOLK \", error);\n    //                     return errMsg;\n    //                 });\n    //             }\n    //         }\n\n    //         if (typeof callback === 'function') {\n    //             const message = callback(errMsg);\n    //             return true;\n    //         }\n\n    //         return new Promise((resolve) => {\n    //             resolve(errMsg);\n    //         });\n    //     } else {\n    //         ExceptionHandler('Form element not found.');\n    //         return false;\n    //     }\n    // }\n\n    public submit(\n        userOptions?: HTMLFormElement | HTMLDivElement | string | { form: string | HTMLFormElement | HTMLDivElement, customErrorMessages?: { [key: string]: string } }, \n        callback?: any\n    ): boolean | Promise<any> {\n        this.form = this.form || undefined;\n        this.customErrorMessages = this.customErrorMessages || {};\n    \n        let formElement: HTMLFormElement | HTMLDivElement | undefined = this.form;\n        let options: any = this.customErrorMessages;\n    \n        let isAjax = false;\n        let ajaxOptions: null | {\n            url: string,\n            RequestMethod: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"UPDATE\" | \"DELETE\",\n            RequestHeader?: object,\n            RequestBody?: object | FormData | JSON | any\n        } = null;\n    \n        // Handle userOptions to determine formElement and options\n        if (typeof userOptions === 'string') {\n            formElement = document.getElementById(userOptions) as HTMLFormElement | HTMLDivElement | undefined;\n            options = { form: formElement, customErrorMessages: [] };\n        } else if (userOptions instanceof HTMLFormElement || userOptions instanceof HTMLDivElement) {\n            formElement = userOptions;\n            options = { form: formElement, customErrorMessages: [] };\n        } else if (userOptions && typeof userOptions === 'object' && 'form' in userOptions) {\n            if (typeof userOptions.form === 'string') {\n                formElement = document.getElementById(userOptions.form) as HTMLFormElement | HTMLDivElement | undefined;\n            } else if (userOptions.form instanceof HTMLFormElement || HTMLDivElement) {\n                formElement = userOptions.form;\n            }\n            options = { form: formElement, customErrorMessages: userOptions.customErrorMessages ?? [] };\n        }\n    \n        // Ensure formElement is available\n        if (!formElement) {\n            ExceptionHandler('Form element not found.');\n            return false;\n        }\n    \n        // Handle form's novalidate attribute\n        const doesNoValidateAttrExist = formElement.getAttribute('novalidate') !== null;\n        if (!doesNoValidateAttrExist) {\n            formElement.setAttribute('novalidate', '');\n        }\n    \n        // Prevent default form submission\n        formElement.addEventListener('submit', (e) => {\n            e.preventDefault();\n        });\n    \n        // Process options for Ajax submission\n        const { isAjax: processedIsAjax, ajaxOptions: processedAjaxOptions } = this.populateOptionsVariables(userOptions, formElement);\n        isAjax = processedIsAjax;\n        ajaxOptions = processedAjaxOptions;\n    \n        // Validate form and determine the error message\n        let errMsg: ErrorMessageInterface = { message: \"\", type: \"\" };\n        const errMsgFromFunction = validateForm(formElement, options);\n    \n        if (errMsgFromFunction === true) {\n            errMsg.message = \"success\";\n            errMsg.type = \"success\";\n            errMsg.data = null;\n        } else if (typeof errMsgFromFunction === 'object' && errMsgFromFunction !== null && 'message' in errMsgFromFunction) {\n            const errMessageFromValidate = errMsgFromFunction.message;\n            errMsg.message = (typeof errMessageFromValidate === 'string' || typeof errMessageFromValidate === 'number' || typeof errMessageFromValidate === 'boolean')\n                ? errMessageFromValidate \n                : \"Error\";\n            errMsg.type = \"error\";\n            errMsg.data = errMsgFromFunction;\n        } else {\n            errMsg.message = \"Error\";\n            errMsg.type = \"error\";\n        }\n    \n        // Handle Ajax submission if applicable\n        if (errMsg.message === \"success\" && isAjax && ajaxOptions !== null) {\n            ajaxOptions.RequestBody = getFormDetails(formElement);\n            return ajax(ajaxOptions)\n                .then(response => {\n                    const responseCode = response.code || response.status;\n                    if (responseCode >= 300 && responseCode <= 500) {\n                        const errorDetails = {\n                            type: 'modal',\n                            message: response.message,\n                            duration: 3000,\n                            element: formElement,\n                            success: false,\n                        };\n    \n                        errMsg.message = response.message;\n                        errMsg.type = \"error\";\n                        errMsg.code = responseCode;\n                        errMsg.data = response.data;\n    \n                        this.displayError(errorDetails);\n                        console.error(\"THIS IS ERR_ \", response.message);\n    \n                        return errMsg;\n                    } else {\n                        console.log(\"Success\");\n                        return response;\n                    }\n                })\n                .catch(error => {\n                    console.error(\"LOLK \", error);\n                    return errMsg;\n                });\n        }\n    \n        // Handle callback if provided\n        if (typeof callback === 'function') {\n            callback(errMsg);\n            return true;\n        }\n    \n        // Return a promise resolving to the error message\n        return new Promise((resolve) => {\n            resolve(errMsg);\n        });\n    }\n    \n    \n\n    // public validate(userOptions?: HTMLFormElement | HTMLDivElement | string | { form: HTMLFormElement | HTMLDivElement | string; customErrorMessages?: any[] }, callback?: any): boolean | Promise<any> {\n    //     let formElement: HTMLFormElement | HTMLDivElement | undefined;\n    //     let options: any = {}; // Initialize options as an empty object\n    \n    //     if (typeof userOptions === 'string') {\n    //         formElement = document.getElementById(userOptions) as HTMLFormElement | HTMLDivElement | undefined;\n    //         options.form = formElement;\n    //         options.customErrorMessages = [];\n    //     } else if (userOptions instanceof HTMLFormElement || userOptions instanceof HTMLDivElement) {\n    //         formElement = userOptions;\n    //         options.form = userOptions;\n    //         options.customErrorMessages = [];\n    //     } else if (userOptions && typeof userOptions === 'object' && 'form' in userOptions) {\n    //         if (typeof userOptions.form === 'string') {\n    //             formElement = document.getElementById(userOptions.form) as HTMLFormElement | HTMLDivElement | undefined;\n    //         } else if (userOptions.form instanceof HTMLFormElement || userOptions.form instanceof HTMLDivElement) {\n    //             formElement = userOptions.form;\n    //         }\n    //         options.form = formElement;\n    //         options.customErrorMessages = userOptions.customErrorMessages ?? [];\n    //     } else {\n    //         formElement = this.form;\n    //         options.form = this.form;\n    //         options.customErrorMessages = [];\n    //     }\n    \n    //     if (formElement) {\n    //         const doesNoValidateAttrExist = formElement.getAttribute('novalidate') ? true : false;\n    \n    //         if (!doesNoValidateAttrExist) {\n    //             formElement.setAttribute('novalidate', '');\n    //         }\n    \n    //         formElement.addEventListener('submit', (e) => {\n    //             e.preventDefault();\n    //         });\n    \n    //         // Initialize errMsg with default values\n    //         let errMsg: ErrorMessageInterface = { message: \"\", type: \"\" };\n    \n    //         // Validating the form here\n    //         const errMsgFromFunction = validateForm(formElement, options);\n    \n    //         if (errMsgFromFunction === true) {\n    //             errMsg.message = \"success\";\n    //             errMsg.type = \"success\";\n    //             errMsg.data = null;\n    //         } else if (checkVariableType(errMsgFromFunction) === 'object') {\n    //             const errMessageFromValidate = errMsgFromFunction.message || null;\n    //             errMsg.message = errMessageFromValidate || \"Error\";\n    //             errMsg.type = \"error\";\n    //             errMsg.data = errMsgFromFunction;\n    //         } else {\n    //             errMsg.message = \"Error\";\n    //             errMsg.type = \"error\";\n    //         }\n    \n    //         if (checkVariableType(callback) === 'function') {\n    //             callback(errMsg);\n    //             return true;\n    //         }\n    \n    //         return new Promise((resolve, reject) => {\n    //             resolve(errMsg);\n    //         });\n    //     } else {\n    //         ExceptionHandler('Form element not found.');\n    //         return false;\n    //     }\n    // }\n    \n    public validate(\n        userOptions?: HTMLFormElement | HTMLDivElement | string | { form: HTMLFormElement | HTMLDivElement | string; customErrorMessages?: any[] }, \n        callback?: any\n    ): boolean | Promise<any> {\n        let formElement: HTMLFormElement | HTMLDivElement | undefined;\n        let options: any = {}; // Initialize options as an empty object\n    \n        // Determine the form element and options based on userOptions\n        if (typeof userOptions === 'string') {\n            formElement = document.getElementById(userOptions) as HTMLFormElement | HTMLDivElement | undefined;\n            options = { form: formElement, customErrorMessages: [] };\n        } else if (userOptions instanceof HTMLFormElement || userOptions instanceof HTMLDivElement) {\n            formElement = userOptions;\n            options = { form: formElement, customErrorMessages: [] };\n        } else if (userOptions && typeof userOptions === 'object' && 'form' in userOptions) {\n            if (typeof userOptions.form === 'string') {\n                formElement = document.getElementById(userOptions.form) as HTMLFormElement | HTMLDivElement | undefined;\n            } else if (userOptions.form instanceof HTMLFormElement || userOptions.form instanceof HTMLDivElement) {\n                formElement = userOptions.form;\n            }\n            options = { form: formElement, customErrorMessages: userOptions.customErrorMessages ?? [] };\n        } else {\n            formElement = this.form;\n            options = { form: formElement, customErrorMessages: [] };\n        }\n    \n        // Ensure form element exists\n        if (!formElement) {\n            ExceptionHandler('Form element not found.');\n            return false;\n        }\n    \n        // Handle form's novalidate attribute\n        const doesNoValidateAttrExist = formElement.getAttribute('novalidate') !== null;\n        if (!doesNoValidateAttrExist) {\n            formElement.setAttribute('novalidate', '');\n        }\n    \n        // Prevent default form submission\n        formElement.addEventListener('submit', (e) => {\n            e.preventDefault();\n        });\n    \n        // Initialize errMsg with default values\n        let errMsg: ErrorMessageInterface = { message: \"\", type: \"\" };\n    \n        // Validate the form using the provided function\n        const errMsgFromFunction = validateForm(formElement, options);\n    \n        if (errMsgFromFunction === true) {\n            errMsg.message = \"success\";\n            errMsg.type = \"success\";\n            errMsg.data = null;\n        } else if (typeof errMsgFromFunction === 'object' && errMsgFromFunction !== null && 'message' in errMsgFromFunction) {\n            const errMessageFromValidate = errMsgFromFunction.message;\n    \n            // Ensure the message is of the correct type before assignment\n            if (typeof errMessageFromValidate === 'string' || typeof errMessageFromValidate === 'number' || typeof errMessageFromValidate === 'boolean') {\n                errMsg.message = errMessageFromValidate;\n            } else {\n                errMsg.message = \"Error\"; // Fallback to a default message if the type doesn't match\n            }\n    \n            errMsg.type = \"error\";\n            errMsg.data = errMsgFromFunction;\n        } else {\n            errMsg.message = \"Error\";\n            errMsg.type = \"error\";\n        }\n    \n        // If a callback is provided, invoke it with errMsg\n        if (typeof callback === 'function') {\n            callback(errMsg);\n            return true;\n        }\n    \n        // Return a promise resolving to the error message\n        return new Promise((resolve) => {\n            resolve(errMsg);\n        });\n    }\n    \n    \n    \n\n\n    /**\n     * ajax\n     */\n    public ajax(AJAXOptions: any) {\n        \n        // return this.AJAXResult = ajax(AJAXOptions);\n        return this.AJAXResult = ajax(AJAXOptions);\n    }\n\n    /**\n     * getAJAXResponse\n     * \n     * This function retrieves the AJAX response that was stored in the global variable `AJAXResult`.\n     * It returns the AJAX response if available or false if no response is found.\n     * \n     * @returns {Promise|boolean} - Returns the AJAX response (a Promise) if available; otherwise, returns false.\n     */\n    getAJAXResponse(): Promise<any> | boolean {\n        if (this.AJAXResult) {\n            // If `AJAXResult` contains a value (Promise), return the AJAX response\n            return this.AJAXResult;\n        } else {\n            // If `AJAXResult` is empty (null or undefined), return false\n            return false;\n        }\n    }\n    \n    getFormDetails(form: HTMLFormElement | HTMLDivElement | string)\n    {\n\n        if ( ! form )\n        {\n            form = this.form as HTMLDivElement;\n        }\n        \n        // console.log(\"hkbik\", getFormDetails(form));\n        \n\n        return getFormDetails(form);\n    }\n\n    loading(message: string, submitBtn: string | HTMLElement | null = null, form: string | HTMLElement | null | undefined = null)\n    {\n        if (form !== null) {\n            form = typeof form === 'string' ? document.getElementById(form) : form;\n            form = typeof form === 'undefined' ? this.form : form;\n        }\n\n        // Call the loading function\n        return loading(message, submitBtn, form);\n    }\n\n    displayError(details:any)\n    {\n        displayError(details);\n    }\n    \n    isEmail(email: string): boolean\n    {\n        return isEmail(email);\n    }\n\n    isURL(url: string)\n    {\n        return isURL(url);\n    }\n\n    isNumber(number: string | number): boolean\n    {\n        return checkVariableType(number) === 'number';\n    }\n\n    isZipCode(zipCode: string | number): boolean\n    {\n        return isZIP(zipCode);\n    }\n\n    isZip(zipCode: string | number): boolean\n    {\n        return isZIP(zipCode);\n    }\n\n    countString(string: string): number\n    {\n        return countString(string);\n    }\n\n    async generatePassword(length?:number, shouldHash?: boolean )\n    {\n        return await generatePassword(length, shouldHash);\n    }\n\n    async generateRandomPassword(length:number, shouldHash:boolean )\n    {\n        return await generatePassword(length, shouldHash);\n    }\n\n    passwordStrength()\n    {}\n\n    getPasswordStrength()\n    {}\n\n    checkPassword( password: string, minLength: number = 8, maxLength: number = 20, includeSymbolsCheck: boolean = false, userSymbolRegex: RegExp | string = '')\n    {\n        return checkPassword( password, includeSymbolsCheck, minLength, maxLength, userSymbolRegex );\n    }\n\n    async verifyPassword(stringPassword: string, hashedPassword: string, isHashed: boolean = false): Promise<boolean>\n    {\n        try {\n            // Call verifyPassword and return its result\n            return await verifyPassword(stringPassword, hashedPassword, isHashed);\n        } catch (error) {\n            console.error(\"Error verifying password: \", error); // Log an error if there's an issue\n            return false; // Return false in case of an error\n        }\n    }\n\n    async passwordMatch(stringPassword: string, hashedPassword: string, isHashed: boolean = false): Promise<boolean>\n    {\n        try {\n            // Call verifyPassword and return its result\n            return await verifyPassword(stringPassword, hashedPassword, isHashed);\n        } catch (error) {\n            console.error(\"Error verifying password: \", error); // Log an error if there's an issue\n            return false; // Return false in case of an error\n        }\n    }\n\n    async hashPassword(password: string)\n    {\n        try {\n            // Call hashPassword and return its result\n            return await hashPassword(password);\n        } catch (error) {\n            console.error(\"Error hashing password: \", error); // Log an error if there's an issue\n            return false; // Return false in case of an error\n        }\n    }\n\n    togglePasswordVisibility(input: HTMLInputElement, showIcon: string | HTMLElement | null = null, hideIcon: string | HTMLElement | null = null)\n    {\n        return togglePasswordVisibility(input, showIcon, hideIcon);\n    }\n\n    togglePasswordVisibilityAll(icons: { \n        show: string | HTMLElement | null, \n        hide: string | HTMLElement | null \n    } , uform: string | HTMLFormElement | HTMLDivElement | null = null, toggleAll: boolean = false)\n    {\n        return togglePasswordVisibilityAll(icons, uform, toggleAll);\n    }\n\n    validateInput(inputField: HTMLInputElement | string, options: any = {}, callback?: any)\n    {\n        let individualResponseMessage: ErrorMessageInterface | boolean = {  type: 'error', code : 400 };\n\n        if ( typeof inputField === 'string' )\n        {\n            inputField = document.getElementById(inputField) as HTMLInputElement\n        }\n\n        if ( ! inputField  )\n        {\n            let errorLogLevel = LogLevelInterface;\n\n            individualResponseMessage.message = \"The Input Feild you are trying to validate is undefined.\";\n\n            // console.log(individualResponseMessage);\n            \n            ExceptionHandler(\"The Input Feild you are trying to validate is undefined.\");\n\n            // return individualResponseMessage;\n        }        \n\n        else\n        {\n\n            options.form = options.form ?? this.form\n\n            const validateResponse: string | boolean | ErrorMessageInterface  = validateInput(inputField, options, callback);\n\n            if ( validateResponse === true )\n            {\n                return true;\n            }\n\n            individualResponseMessage = validateResponse as ErrorMessageInterface\n\n        }\n\n        // let errMsg = validateResponse.message;\n\n        if (checkVariableType(callback) === 'function') {\n            const message = callback(individualResponseMessage);\n            // return true;\n        }\n\n        return new Promise((resolve, reject)=>{\n\n            resolve(individualResponseMessage)\n\n        });\n\n        // return validateInput(inputField, options, callback);\n    }\n\n    validateAllInput(form: HTMLFormElement | HTMLDivElement | string, customErrorMessages: any)\n    {\n\n        form = form ?? this.form;\n        return validateAllInput(form, customErrorMessages);\n    }\n\n    validateRadio(radioInputField: HTMLInputElement | string, customErrorMessage?: any)\n    {\n        return validateRadio(radioInputField, customErrorMessage);\n    }\n\n    validateAllRadio(form: HTMLFormElement | HTMLDivElement, customErrorMessage: any)\n    {\n        form = form ?? this.form;\n        return validateAllRadio(form, customErrorMessage);\n    }\n\n    validateCheckbox( checkboxInputField: HTMLInputElement, options?: any )\n    {\n        return validateCheckbox(checkboxInputField, options);\n    }\n\n    validateAllCheckbox(form: HTMLFormElement | HTMLDivElement, options: any)\n    {\n\n        form = form ?? this.form;\n\n        return validateAllCheckbox(form, options);\n    }\n\n    validateSelect( selectField: HTMLSelectElement, options:any, callback: any)\n    {\n        options.form = options.form ?? this.form\n\n        return validateSelect(selectField, options, callback);\n    }\n\n    validateAllSelect(form: HTMLFormElement | HTMLDivElement, options: any)\n    {\n        return validateAllSelect(form, options);\n    }\n\n    validateTextarea(textareaField: HTMLTextAreaElement, options: any )\n    {\n        return validateTextarea(textareaField, options);\n    }\n\n    validateAllTextarea(form: HTMLFormElement | HTMLDivElement, options: any)\n    {\n        return validateAllTextarea(form, options);\n    }\n\n\n    restrictInputWithCounter(inputElement: HTMLInputElement | HTMLTextAreaElement, counterContainer: HTMLElement, options: any = {})\n    {\n        return restrictInputLengthWithCounter(inputElement, counterContainer, options);\n    }\n\n    public containsOnlyIntegers(str: string):boolean\n    {\n        return containsOnlyIntegers(str)\n    }\n\n    getPageURL()\n    {\n        return getPageUrl();\n    }\n\n    redirect(url: string | null | false | undefined = null, delay: number = 0)\n    {\n\n        if ( ! url )\n        {\n            url = this.getPageURL() as string;\n        }\n\n        redirect(url, delay);\n    }\n\n    checkVariableType(variable: any)\n    {\n        return checkVariableType(variable);\n    }\n\n    isOnline()\n    {\n        return isOnline();\n    }\n\n    reset(u_form: HTMLFormElement | HTMLDivElement | string): boolean\n    {\n\n        let form;\n\n        if ( ! u_form )\n        {\n            form = this.form;\n        }\n        else\n        {\n            form = u_form\n        }\n\n        return reset(form);\n    }\n\n    \n\n}\n\nif (typeof window !== 'undefined') {\n    // Make the library available globally\n    (window as any).NFSFU234FormValidation = NFSFU234FormValidation;\n}\n\nexport default NFSFU234FormValidation"]}