1import{i18n}from '/js/i18n.min.dc5b2125176f11a29246d1f3b2d0127c70067e2321a002a9273768e6bf57b619.js';let inputList;let houseKeeping=new Map();export function isEmptyField(str){return str.length;} 2export function isEmailValid(str){return /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(str);} 3export function isEmailAddressValid(str){const fieldNameKey='emailAddress';if(!str){return `${i18n(fieldNameKey)} ${i18n('isRequired')}`;}else if(!isEmailValid(str)){return `${i18n('pleaseEnterAValidEmailAddress')}`;} 4return null;} 5export function isZipValid(str){return /^(\d{5}(-\d{4})?|[A-Z]\d[A-Z] *\d[A-Z]\d)$/.test(str);} 6export function isPasswordValid(str){return /^(?=.*?[a-zA-Z])(?=.*?[0-9])[a-zA-Z0-9[!@#$%^&*()\-_=+,./?[\]\\{}|]{8,30}$/.test(str);} 7export function isNewPasswordValid(str){return /^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#$%^&*()\-_=+,./?[\]\\{}|])[a-zA-Z0-9[!@#$%^&*()\-_=+,./?[\]\\{}|]{8,30}$/.test(str);} 8export function isConfirmPasswordValid(confirmPass,pass){return pass===confirmPass;} 9export function isAccountNumberValid(str){return /^[0-9]{5,15}$/.test(str);} 10export function isPersonNameValid(str){return /^[a-zA-Z\d\s!@#\$%\^\&\~*\(\),._-]+$/i.test(str);} 11export function isNameValid(str){return str.length>2;} 12export function isPhoneValid(str){return str.length>9;} 13export function isPostCodeValid(str){return /^\d{5}$/.test(str);} 14export function isAlphaNumeric(str){return /^[a-z0-9]+$/i.test(str);} 15export function isAlphaNumericWithSpaces(str){return /^[a-z0-9' ']+$/i.test(str);} 16export function isNumeric(str){return /^[0-9]+$/.test(str);} 17export function isSecurityNumber(str){return str.length>5&&/^[0-9]+$/.test(str);} 18export function isAlphaWithMinXCharacters(str,minLength){return str.trim().length>=minLength&&/^[a-z' ']+$/i.test(str);} 19export function isEmptyFieldWithoutSpaces(str){return str.trim().length;} 20export function isPhoneNumeric(str){return str.length>9&&/^[0-9]+$/i.test(str);} 21export function setValidation(element,check,msg,param=element){element.addEventListener('input',ev=>{let flag=check(ev.target.value,param.value)&&!BadEntry.check(element);let eventValid=new CustomEvent('valid',{detail:{flag}});checkValidation(element,flag,msg);element.dispatchEvent(eventValid);});element.addEventListener('blur',ev=>{checkValidation(element,check(ev.target.value,param.value)&&!BadEntry.check(element),msg);});} 22export function setBlankValidation(element,msg,multi=false){element.addEventListener('input',ev=>{let flag=isEmptyField(ev.target.value);let eventValid=new CustomEvent('valid',{detail:{flag}});if(ev.target.value.length==0||!multi)checkValidation(element,flag,msg);if(!multi)element.dispatchEvent(eventValid);});element.addEventListener('blur',ev=>{let flag=isEmptyField(ev.target.value);let eventValid=new CustomEvent('valid',{detail:{flag}});if(ev.target.value.length==0||!multi)checkValidation(element,isEmptyField(ev.target.value),msg);if(!multi)element.dispatchEvent(eventValid);});} 23export function checkValidation(element,flag,msg,noSuccessIcon){if(BadEntry.check(element)){flag=false;msg=BadEntry.getMessage();} 24if(flag){element.parentElement.classList.remove('errorredLabel');element.parentElement.classList.add('success');element.parentElement.querySelector('.errMessage').innerHTML='';}else{element.parentElement.classList.add('errorredLabel');element.parentElement.classList.remove('success');element.parentElement.querySelector('.errMessage').innerHTML=msg;} 25if(noSuccessIcon){element.parentElement.classList.remove('success');}} 26export function errMsg(el,msg){let err={};let div=document.createElement('div');div.classList.add('errMessage');div.innerHTML=msg;err['div']=div;err.show=function(){if(!document.contains(div))el.parentNode.appendChild(div);};err.hide=function(){if(document.contains(div))el.parentNode.removeChild(div);};return err;} 27function applyHasValueClass(element){const inputValue=element.value;if(inputValue.length>0){element.classList.remove('no-value');element.classList.add('has-value');}else{element.classList.remove('has-value');element.classList.add('no-value');}} 28function checkInputForValue(event){const inputElement=event.target;applyHasValueClass(inputElement);} 29function getAllInputs(){return document.querySelectorAll('input, select');} 30function attachGesture(element,eventName,callback){if(!houseKeeping.has([element,eventName,callback])){houseKeeping.set([element,eventName,callback],true);element.addEventListener(eventName,callback);}} 31function checkModalInputs(){const modals=document.querySelectorAll('.modal');
31modals.forEach(modal=>modal.addEventListener('DOMNodeInserted',function(){checkAllInputsForValue();}));} 32export function checkAllInputsForValue(){if(inputList&&inputList.length>0){inputList.forEach(inputElement=>applyHasValueClass(inputElement));}} 33export function addInputEventListener(){if(inputList&&inputList.length>0){let inputListNew=getAllInputs();if(inputList.length!==inputListNew.length){inputList=inputListNew;}}else{inputList=getAllInputs();} 34inputList.forEach(inputElement=>attachGesture(inputElement,'change',checkInputForValue));} 35export function initFormListeners(){addInputEventListener();setTimeout(function(){checkAllInputsForValue();},700);checkModalInputs();} 36export function checkOneUppercase(val){if(!val||!val.length)return false;if(/[A-Z]/.test(val))return true;return false;} 37export function checkOneLowercase(val){if(!val||!val.length)return false;if(/[a-z]/.test(val))return true;return false;} 38export function checkOneNumber(val){if(!val||!val.length)return false;if(/[0-9]/.test(val))return true;return false;} 39export function checkOneSpecialCharacter(val){if(!val||!val.length)return false;if(/[!@#$%^&*()\-_=+,./?[\]\\{}|]/.test(val))return true;return false;} 40export function checkSpace(val){if(!val||!val.length)return false;if(/\s/g.test(val))return true;return false;} 41export function checkMin8Char(val){if(val&&val.length>=8)return true;return false;} 42export function checkMax30Char(val){if(val&&val.length<=30)return true;return false;} 43export const BadEntry=(()=>{let _field=null;let _value='';let _message='';return{getMessage:()=>_message,set:(field,message)=>{_field=field;_value=field.value;_message=message;checkValidation(field,false,message);},check:field=>field===_field&&field.value===_value,};})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.