{"version":3,"names":[],"mappings":"","sources":["consumer-request.js"],"sourcesContent":["const StateProvinces = [\r\n {\r\n Id: 1,\r\n Code: \"AL\",\r\n Name: \"Alabama\"\r\n },\r\n {\r\n Id: 2,\r\n Code: \"AK\",\r\n Name: \"Alaska\"\r\n },\r\n {\r\n Id: 4,\r\n Code: \"AZ\",\r\n Name: \"Arizona\"\r\n },\r\n {\r\n Id: 5,\r\n Code: \"AR\",\r\n Name: \"Arkansas\"\r\n },\r\n {\r\n Id: 7,\r\n Code: \"CA\",\r\n Name: \"California\"\r\n },\r\n {\r\n Id: 8,\r\n Code: \"CO\",\r\n Name: \"Colorado\"\r\n },\r\n {\r\n Id: 9,\r\n Code: \"CT\",\r\n Name: \"Connecticut\"\r\n },\r\n {\r\n Id: 10,\r\n Code: \"DE\",\r\n Name: \"Delaware\"\r\n },\r\n {\r\n Id: 11,\r\n Code: \"DC\",\r\n Name: \"District of Columbia\"\r\n },\r\n {\r\n Id: 13,\r\n Code: \"FL\",\r\n Name: \"Florida\"\r\n },\r\n {\r\n Id: 15,\r\n Code: \"GA\",\r\n Name: \"Georgia\"\r\n },\r\n {\r\n Id: 16,\r\n Code: \"HI\",\r\n Name: \"Hawaii\"\r\n },\r\n {\r\n Id: 17,\r\n Code: \"ID\",\r\n Name: \"Idaho\"\r\n },\r\n {\r\n Id: 18,\r\n Code: \"IL\",\r\n Name: \"Illinois\"\r\n },\r\n {\r\n Id: 19,\r\n Code: \"IN\",\r\n Name: \"Indiana\"\r\n },\r\n {\r\n Id: 20,\r\n Code: \"IA\",\r\n Name: \"Iowa\"\r\n },\r\n {\r\n Id: 21,\r\n Code: \"KS\",\r\n Name: \"Kansas\"\r\n },\r\n {\r\n Id: 23,\r\n Code: \"KY\",\r\n Name: \"Kentucky\"\r\n },\r\n {\r\n Id: 24,\r\n Code: \"LA\",\r\n Name: \"Louisiana\"\r\n },\r\n {\r\n Id: 25,\r\n Code: \"ME\",\r\n Name: \"Maine\"\r\n },\r\n {\r\n Id: 27,\r\n Code: \"MD\",\r\n Name: \"Maryland\"\r\n },\r\n {\r\n Id: 28,\r\n Code: \"MA\",\r\n Name: \"Massachusetts\"\r\n },\r\n {\r\n Id: 29,\r\n Code: \"MI\",\r\n Name: \"Michigan\"\r\n },\r\n {\r\n Id: 30,\r\n Code: \"MN\",\r\n Name: \"Minnesota\"\r\n },\r\n {\r\n Id: 31,\r\n Code: \"MS\",\r\n Name: \"Mississippi\"\r\n },\r\n {\r\n Id: 32,\r\n Code: \"MO\",\r\n Name: \"Missouri\"\r\n },\r\n {\r\n Id: 33,\r\n Code: \"MT\",\r\n Name: \"Montana\"\r\n },\r\n {\r\n Id: 34,\r\n Code: \"NE\",\r\n Name: \"Nebraska\"\r\n },\r\n {\r\n Id: 35,\r\n Code: \"NV\",\r\n Name: \"Nevada\"\r\n },\r\n {\r\n Id: 37,\r\n Code: \"NH\",\r\n Name: \"New Hampshire\"\r\n },\r\n {\r\n Id: 38,\r\n Code: \"NJ\",\r\n Name: \"New Jersey\"\r\n },\r\n {\r\n Id: 39,\r\n Code: \"NM\",\r\n Name: \"New Mexico\"\r\n },\r\n {\r\n Id: 40,\r\n Code: \"NY\",\r\n Name: \"New York\"\r\n },\r\n {\r\n Id: 42,\r\n Code: \"NC\",\r\n Name: \"North Carolina\"\r\n },\r\n {\r\n Id: 43,\r\n Code: \"ND\",\r\n Name: \"North Dakota\"\r\n },\r\n {\r\n Id: 47,\r\n Code: \"OH\",\r\n Name: \"Ohio\"\r\n },\r\n {\r\n Id: 48,\r\n Code: \"OK\",\r\n Name: \"Oklahoma\"\r\n },\r\n {\r\n Id: 50,\r\n Code: \"OR\",\r\n Name: \"Oregon\"\r\n },\r\n {\r\n Id: 52,\r\n Code: \"PA\",\r\n Name: \"Pennsylvania\"\r\n },\r\n {\r\n Id: 54,\r\n Code: \"PR\",\r\n Name: \"Puerto Rico\"\r\n },\r\n {\r\n Id: 56,\r\n Code: \"RI\",\r\n Name: \"Rhode Island\"\r\n },\r\n {\r\n Id: 59,\r\n Code: \"SC\",\r\n Name: \"South Carolina\"\r\n },\r\n {\r\n Id: 60,\r\n Code: \"SD\",\r\n Name: \"South Dakota\"\r\n },\r\n {\r\n Id: 61,\r\n Code: \"TN\",\r\n Name: \"Tennessee\"\r\n },\r\n {\r\n Id: 62,\r\n Code: \"TX\",\r\n Name: \"Texas\"\r\n },\r\n {\r\n Id: 63,\r\n Code: \"UT\",\r\n Name: \"Utah\"\r\n },\r\n {\r\n Id: 64,\r\n Code: \"VT\",\r\n Name: \"Vermont\"\r\n },\r\n {\r\n Id: 65,\r\n Code: \"VA\",\r\n Name: \"Virginia\"\r\n },\r\n {\r\n Id: 67,\r\n Code: \"WA\",\r\n Name: \"Washington\"\r\n },\r\n {\r\n Id: 68,\r\n Code: \"WV\",\r\n Name: \"West Virginia\"\r\n },\r\n {\r\n Id: 69,\r\n Code: \"WI\",\r\n Name: \"Wisconsin\"\r\n },\r\n {\r\n Id: 70,\r\n Code: \"WY\",\r\n Name: \"Wyoming\"\r\n }\r\n]\r\nconst ccpaStates = ['CA']\r\nlet html = ''\r\nlet apiUrl = ''\r\n\r\nif (window.location.hostname.includes(\"local\") || window.location.hostname.includes(\"dev2\")) {\r\n apiUrl = 'https://dev2.api.employeeworkplace.com/web-forms/'\r\n} else if (window.location.hostname.includes(\"uat2\")) {\r\n apiUrl = 'https://uat2.api.employeeworkplace.com/web-forms/'\r\n} else {\r\n apiUrl = 'https://api.employeeworkplace.com/web-forms/'\r\n}\r\nlet publicKey\r\nlet encryptedFile\r\nlet uploadedFileName = null\r\nlet uploadedFileMimeType = null\r\nlet fileStoreId = 0\r\nwindow.onload = function () {\r\n // window.disableSubmitButton = disableSubmitButton\r\n const uploadSection = $('#file-upload')\r\n uploadSection.hide()\r\n const cancelBtn = document.querySelector('.fileinput-cancel-button')\r\n console.log('cancel btn')\r\n console.log(cancelBtn)\r\n cancelBtn.remove()\r\n const removeBtn = document.querySelector('.fileinput-remove-button')\r\n removeBtn.remove()\r\n const uploadBtn = document.querySelector('.fileinput-upload-button')\r\n uploadBtn.remove()\r\n // document.querySelector('.fileinput-new').show()\r\n var todaysDate = new Date();\r\n var newDateOptions = {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\"\r\n }\r\n todaysDate = todaysDate.toLocaleString('en-US',newDateOptions)\r\n\r\n function getUserOriginData() {\r\n let VisitorAPI = function (t, e, a) {\r\n var s = new XMLHttpRequest;\r\n s.onreadystatechange = function () {\r\n var t;\r\n s.readyState === XMLHttpRequest.DONE && (200 === (t = JSON.parse(s.responseText)).status ? e(t.data) : a(t.status, t.result))\r\n }, s.open(\"GET\", \"https://api.visitorapi.com/api/?pid=\" + t), s.send(null)\r\n };\r\n\r\n VisitorAPI(\r\n \"trppJDiR1VD9epeGa43i\",\r\n function (data) {\r\n sessionStorage.setItem('userOriginData', JSON.stringify(data, null, 2));\r\n },\r\n function (errorCode, errorMessage) {\r\n console.log(errorCode, errorMessage)\r\n }\r\n );\r\n return\r\n }\r\n\r\n getUserOriginData();\r\n\r\n\r\n const displayVisitDateTime = document.getElementById(\"signatureDate\")\r\n displayVisitDateTime.outerText = \"Date: \" + todaysDate\r\n\r\n const statesDropDown = document.getElementById('stateProvince')\r\n StateProvinces.map(stateProvince => {\r\n const option = document.createElement('option')\r\n option.text = stateProvince.Name\r\n option.value = stateProvince.Code\r\n statesDropDown.options.add(option)\r\n })\r\n\r\n $('#phoneNumber').keyup(function (event) {\r\n formatPhone(event.currentTarget.value)\r\n });\r\n\r\n function formatPhone(phone) {\r\n if (event.keyCode !== 8) {\r\n var curchr = phone.length;\r\n var curval = phone;\r\n if (curchr === 3) {\r\n $('#phoneNumber').val(\"(\" + curval + \")\" + \" \");\r\n } else if (curchr === 9) {\r\n $('#phoneNumber').val(curval + \"-\");\r\n } else if (curchr === 10 && !curval.includes('(')) {\r\n const areaCode = curval.substring(0, 3)\r\n const phonePart1 = curval.substring(3, 6)\r\n const phonePart2 = curval.substring(6, 10)\r\n $('#phoneNumber').val(\"(\" + areaCode + \")\" + \" \" + phonePart1 + '-' + phonePart2)\r\n } else if (curchr >= 14 && !curval.includes('(')) {\r\n const areaCode = curval.substring(0, 3)\r\n const phonePart1 = curval.substring(4, 7)\r\n const phonePart2 = curval.substring(8, 12)\r\n $('#phoneNumber').val(\"(\" + areaCode + \")\" + \" \" + phonePart1 + '-' + phonePart2)\r\n }\r\n }\r\n }\r\n\r\n $('#emailAddress').change(function () {\r\n const re = /\\S+@\\S+\\.\\S+/\r\n let match = false\r\n match = re.test($('#emailAddress').val())\r\n if (!match) {\r\n $('#emailAddress').css('background-color', 'pink')\r\n } else {\r\n $('#emailAddress').css('background-color', 'white')\r\n }\r\n })\r\n\r\n $('#submitBtn').click(function (event) {\r\n 'use strict'\r\n let submitForm = false;\r\n // Fetch all the forms we want to apply custom Bootstrap validation styles to\r\n let forms = document.querySelectorAll('.needs-validation')\r\n // check that at least 1 request box is checked\r\n let requestBoxChecked = false;\r\n if($('#confirmDelete').is(':checked') || $('#confirmCategories').is(':checked') || $('#confirmCollected').is(':checked') || $('#confirmCollected').is(':checked')){\r\n requestBoxChecked = true;\r\n $('#request-box-not-checked')[0].setAttribute('style', 'display: none')\r\n $('#request-checkboxes').css('border',0)\r\n } else {\r\n event.preventDefault()\r\n console.log('request box not checked')\r\n $('#request-box-not-checked')[0].setAttribute('style', 'display: block')\r\n $('#request-checkboxes').css('border','2px solid red')\r\n }\r\n if(requestBoxChecked){\r\n // Loop over them and prevent submission\r\n Array.prototype.slice.call(forms)\r\n .forEach(function (form) {\r\n if (!form.checkValidity()) {\r\n event.preventDefault()\r\n event.stopPropagation()\r\n let firstInvalid;\r\n let errorCheckbox = document.querySelectorAll(\"input.form-check-input:invalid\");\r\n let errorOthers = document.querySelectorAll(\"input.form-control:invalid\");\r\n if (errorCheckbox.length > 0)\r\n firstInvalid = $(form).find(\".form-check-input:invalid\").first()\r\n else if (errorOthers.length > 0)\r\n firstInvalid = $(form).find(\".form-control:invalid\").first()\r\n\r\n window.scrollTo({\r\n behavior: 'instant'\r\n });\r\n firstInvalid.focus();\r\n\r\n } else {\r\n submitForm = true;\r\n }\r\n form.classList.add('was-validated')\r\n })\r\n }\r\n\r\n // Get user stateProvince\r\n let selectedStateProvince = document.getElementById(\"stateProvince\").value;\r\n console.log(selectedStateProvince);\r\n\r\n let stateFound = ccpaStates.find((state) => state == selectedStateProvince);\r\n\r\n console.log(stateFound);\r\n console.log(submitForm);\r\n\r\n if (submitForm) {\r\n if (!stateFound) {\r\n event.preventDefault()\r\n let modal = new bootstrap.Modal(document.getElementById('notApplicableModal'));\r\n modal.show();\r\n document.getElementById(\"notApplicableModal\").classList.add(\"show\");\r\n } else {\r\n event.preventDefault()\r\n $('#confirmation')[0].setAttribute('style', 'display: block')\r\n }\r\n }\r\n })\r\n\r\n\r\n $('#denied').click(function () {\r\n $('#confirmation')[0].setAttribute('style', 'display: none')\r\n })\r\n\r\n $('#accepted').click(function () {\r\n event.preventDefault()\r\n submitRequest()\r\n })\r\n\r\n function reloadPage() {\r\n location.reload();\r\n }\r\n function setHtmlValue() {\r\n\r\n html = '' +\r\n '' +\r\n ' ' +\r\n ' ' +\r\n ' Web Forms' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n\r\n '
' +\r\n\r\n '
' +\r\n '
' +\r\n ' \"\"' +\r\n '
' +\r\n '
' +\r\n\r\n '
' +\r\n '
' +\r\n '

' +\r\n ' CCPA Consumer Request Form

' +\r\n\r\n '
' +\r\n '

If you are a California resident, the California Consumer Privacy Act (CCPA) permits California consumers' +\r\n ' (\"you\") to request the personal information held, the categories of personal information held, to delete or' +\r\n ' correct personal information.' +\r\n ' Please provide the following information so that we may process your request.' +\r\n ' If you would like to submit a request in an alternative format, you may also call: (866) 765-7544 or email' +\r\n ' AskPrivacy@staffmarkgroup.com.' +\r\n '

' +\r\n '

' +\r\n ' Your requests may be subject to exemptions or other legal requirements.' +\r\n ' For a more detailed explanation of your rights please visit our Privacy Policy. If you have any questions,' +\r\n ' you may also contact us at (866) 765-7544.' +\r\n '

' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '

' +\r\n ' Request by Authorized Agent' +\r\n '

' +\r\n '
' +\r\n '

' +\r\n ' If you are an agent completing on behalf of a consumer, please click' +\r\n ' here to download the request form and' +\r\n ' submit the request to AskPrivacy@Staffmarkgroup.com.' +\r\n '

' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '

' +\r\n ' Requests by Consumers' +\r\n '

' +\r\n '
' +\r\n '

' +\r\n ' In order to complete your request, please supply all information requested below. We need this information' +\r\n ' to verify your identity and to make sure we are deleting the appropriate personal information from our' +\r\n ' records. Once you have submitted the requested information, your submission serves as your authorization to' +\r\n ' complete your request. Depending on the nature of your request, we may request additional information to' +\r\n ' verify your identity or document' +\r\n ' your requested correction. If we are unable to verify your identity with the' +\r\n ' information provided your request may be denied.' +\r\n '

' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' I wish to have my personal information deleted' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' I request to know the categories of personal information,' +\r\n ' the sources of that information or the third parties to whom the information was disclosed. (Please specify' +\r\n ' what information you would to know about in the notes section of the form)' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' I request to know the specific personal information' +\r\n ' collected in the preceding twelve months.' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' I request to have information corrected. (Please specify' +\r\n ' the information you would like corrected and please upload documentation establishing the inaccuracy of the' +\r\n ' information held).' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n '
';\r\n html +=\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' Email Address:' +\r\n '
' +\r\n '
' +\r\n $('#emailAddress').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' First Name:' +\r\n '
' +\r\n '
' +\r\n $('#firstName').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' Last Name:' +\r\n '
' +\r\n '
' +\r\n $('#lastName').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' Phone Number:' +\r\n '
' +\r\n '
' +\r\n $('#phoneNumber').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' City:' +\r\n '
' +\r\n '
' +\r\n $('#city').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' State:' +\r\n '
' +\r\n '
' +\r\n $('#stateProvince').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' Notes:' +\r\n '
' +\r\n '
' +\r\n $('#notes').val() +\r\n '
' +\r\n '
' +\r\n '
' +\r\n\r\n '
' +\r\n\r\n '
' +\r\n '
' +\r\n ' By signing below, I am giving my permission to process this request.' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' Consumer Signature (type full name)' +\r\n '
' +\r\n '
' +\r\n ' Date' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n $('#signature').val() +\r\n '
' +\r\n '
' +\r\n todaysDate +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n '';\r\n }\r\n\r\n $('#uploadBtn').change(function () {\r\n $('#uploadFile').val(this.value.replace(/^.*\\\\/, \"\"))\r\n $('#uploadFileBtn').prop('disabled', false)\r\n console.log('uploadBtn')\r\n console.log($('#uploadBtn'))\r\n let allowedUploadTypes = []\r\n allowedUploadTypes.push('application/pdf')\r\n allowedUploadTypes.push('image/jpeg')\r\n allowedUploadTypes.push('image/png')\r\n if($(this)[0].files.length > 0){\r\n let uploadType = $(this)[0].files[0].type\r\n if (allowedUploadTypes.indexOf(uploadType) < 0) {\r\n $('#uploadFile').css('background-color', 'pink')\r\n $(this).val('')\r\n $('.file-caption-name').val('')\r\n $('#invalid-filetype').show()\r\n console.log($('#uploadBtn'))\r\n } else {\r\n $('#uploadFile').css('background-color', 'white')\r\n $('#invalid-filetype').hide()\r\n }\r\n\r\n } else {\r\n\r\n }\r\n/*\r\n const file = $(this)[0].files[0];\r\n const reader = new FileReader();\r\n reader.onload = function() {\r\n // console.log('reader.result')\r\n // console.log(reader.result)\r\n uploadedFileMimeType = reader.result.split(',')[0].split(';')[0].replace('data:','');\r\n uploadedFileName = file.name;\r\n console.log('uploadedFileMimeType ' +uploadedFileMimeType)\r\n console.log('uploadedFileName ' +uploadedFileName)\r\n let base64File = reader.result.split(',')[1];\r\n getEncryptKey(base64File)\r\n publicKey = null\r\n };\r\n reader.readAsDataURL(file)\r\n*/\r\n })\r\n\r\n function submitRequest() {\r\n $('#submitBtn').prop('disabled', true)\r\n $('#accepted').prop('disabled', true)\r\n $('#denied').prop('disabled', true)\r\n setHtmlValue()\r\n const consumerRequestForm = {\r\n content: html,\r\n data: {\r\n confirmDelete: $('#confirmDelete')[0].checked,\r\n emailAddress: $('#emailAddress').val(),\r\n fullName: $('#firstName').val() + \" \" + $('#lastName').val(),\r\n phoneNumber: $('#phoneNumber').val(),\r\n city: $('#city').val(),\r\n stateProvince: $('#stateProvince').val(),\r\n signature: $('#signature').val(),\r\n },\r\n type: 'ConsumerRequest',\r\n additionalFileStoreId: 0,\r\n userOriginData: sessionStorage.getItem(\"userOriginData\")\r\n }\r\n console.log('consumerRequestForm')\r\n // console.log(consumerRequestForm)\r\n console.log('uploadFile')\r\n // console.log($('#uploadFile'))\r\n if ($('#uploadBtn')[0].files.length == 0) {\r\n submitForm(consumerRequestForm)\r\n } else {\r\n processFileSubmitForm(consumerRequestForm)\r\n }\r\n\r\n }\r\n\r\n async function processFileSubmitForm(consumerRequestForm){\r\n console.log('upload file')\r\n const file = $('#uploadBtn')[0].files[0];\r\n const reader = new FileReader();\r\n reader.onload = function() {\r\n // console.log('reader.result')\r\n // console.log(reader.result)\r\n uploadedFileMimeType = reader.result.split(',')[0].split(';')[0].replace('data:','');\r\n uploadedFileName = file.name;\r\n // console.log('uploadedFileMimeType ' +uploadedFileMimeType)\r\n // console.log('uploadedFileName ' +uploadedFileName)\r\n let readFile = reader.result.split(',')[1];\r\n $.ajax({\r\n url: apiUrl + 'webForm/GetWebFormKey',\r\n type: 'get',\r\n contentType: false,\r\n processData: false,\r\n success: function (response) {\r\n // console.log('key response')\r\n publicKey = response\r\n encryptedFile = encryptUploadFile(readFile,consumerRequestForm)\r\n },\r\n error: function (textStatus, errorThrown) {\r\n console.log(errorThrown)\r\n }\r\n })\r\n };\r\n reader.readAsDataURL(file)\r\n }\r\n\r\n async function encryptUploadFile(base64File,consumerRequestForm){\r\n // console.log('publicKey')\r\n // console.log(publicKey)\r\n // console.log('base64File')\r\n // console.log(base64File)\r\n let keyObj = await openpgp.readKey({armoredKey: publicKey})\r\n encryptedFile = await openpgp.encrypt({\r\n message: await openpgp.createMessage({ text: base64File }),\r\n encryptionKeys: keyObj,\r\n format: 'armored'\r\n });\r\n // console.log('encryptedFile')\r\n // console.log(encryptedFile)\r\n\r\n const fd = new FormData();\r\n // console.log('encrypted file')\r\n // console.log(encryptedFile)\r\n fd.append('EncryptedFile', encryptedFile);\r\n fd.append('FileName', uploadedFileName);\r\n fd.append('MimeType', uploadedFileMimeType);\r\n console.log(fd)\r\n $.ajax({\r\n url: apiUrl + 'webForm/UploadWebFormFile',\r\n type: 'post',\r\n data: fd,\r\n contentType: false,\r\n processData: false,\r\n success: function (response) {\r\n console.log('file uploaded')\r\n // console.log(response)\r\n fileStoreId = response.fileStoreId\r\n consumerRequestForm.additionalFileStoreId = fileStoreId\r\n submitForm(consumerRequestForm)\r\n },\r\n error: function (textStatus, errorThrown) {\r\n console.log(errorThrown)\r\n }\r\n })\r\n publicKey = null\r\n }\r\n\r\n\r\n function disableSubmitButton() {\r\n if ($('#emailAddress').val() !== '' && $('#firstName').val() !== '' &&\r\n $('#lastName').val() !== '' && $('#phoneNumber').val() !== '' && $('#city').val() !== ''\r\n && $('#stateProvince').val() !== '' && $('#signature').val() !== '' && $('#confirmDelete')[0].checked) {\r\n $('#submitBtn').prop('disabled', false)\r\n }\r\n }\r\n // url: apiUrl + 'webForm',\r\n\r\n function submitForm(consumerRequestForm) {\r\n $.ajax({\r\n type: 'post',\r\n url: apiUrl + 'webForm',\r\n contentType: 'application/json',\r\n dataType: 'json',\r\n data: JSON.stringify(consumerRequestForm),\r\n success: function (data) {\r\n if (data.message === 'Web form has been processed.') {\r\n $('#confirmDelete')[0].checked = false\r\n $('#emailAddress')[0].value = ''\r\n $('#firstName')[0].value = ''\r\n $('#lastName')[0].value = ''\r\n $('#phoneNumber').value = ''\r\n $('#city').value = ''\r\n $('#stateProvince').value = ''\r\n $('#signature').value = ''\r\n\r\n\r\n\r\n const modal = document.getElementById('confirmation');\r\n // const markup = '
' +\r\n // '
' +\r\n // '
' +\r\n // // '' +\r\n // '
' +\r\n // '
' +\r\n // '
\\n' +\r\n // '

Your request has been successfully submitted!

\\n' +\r\n // '
\\n' +\r\n // '
' +\r\n // '
';\r\n //\r\n // $('#mainForm').html(markup);\r\n if(!window.location.origin.includes('local')){\r\n window.location.href = window.location.origin + '/web-forms/thank-you.html';\r\n }else{\r\n window.location.href = window.location.origin + '/thank-you.html';\r\n }\r\n // setTimeout( () => {\r\n // this.prompted = !this.prompted;\r\n // location.reload();\r\n // }, 5000);\r\n } else {\r\n const modal = document.getElementById('confirmation');\r\n modal.innerHTML = '
' +\r\n '
' +\r\n '
' +\r\n '' +\r\n '
' +\r\n '
' +\r\n '
\\n' +\r\n '

An error has occurred. Please try again later.

\\n' +\r\n '
\\n' +\r\n '
' +\r\n '
';\r\n\r\n this.consumerRequestForm.reset();\r\n // setTimeout( () => {\r\n // this.prompted = !this.prompted;\r\n // location.reload();\r\n // }, 5000);\r\n console.error(error);\r\n }\r\n }\r\n })\r\n }\r\n}\r\n"],"file":"consumer-request.js"}