(function(n){"use strict";function t(){function i(){let t=new URL(n.location.href),r=t.pathname.split("/").includes("apply"),u=t.pathname.endsWith("/");const i=t.href.indexOf("?");i!==-1&&(t=t.href.slice(0,i));u&&(t.pathname=t.pathname.slice(0,-1));n.location.href=r?t:t+"/apply"}function t(t){const e=new URL(n.location.href),i=new URL(e),u=i.pathname.split("/"),f=u.indexOf("apply");let r;if(f!==-1){const n=u.slice(0,f);i.pathname=n.join("/");r=i.origin+i.pathname}else r=i.toString();t?n.open(r+"?isViewJobDetails=true","_blank"):n.location.href=r}var r=$("#apply-button"),u=$("#apply-button-footer"),f=$("#close-redesign"),e=$("#close-jobboard-redesign");r.on("click",function(){i()});u.on("click",function(){i()});e.on("click",function(){t()});f.on("click",function(){$("#onlineapp-loading-spinner").css("display")!="none"?t():OnlineApp.Services.authenticationService.isLoggedIn().done(function(n){if(n){var i=OnlineApp&&OnlineApp.ViewModels&&OnlineApp.ViewModels.applicationViewModel&&(OnlineApp.ViewModels.applicationViewModel.alreadyApplied()||OnlineApp.ViewModels.applicationViewModel.jobExpired()||OnlineApp.ViewModels.applicationViewModel.applicationSubmitted());i?t():$(document).trigger(Events.CommonEventsNames.ShowConfirmDialog,{additionalCssClassName:"leave-incomplete-app-popup",header:"You are leaving the application process.",subHeader:"Do you want to proceed?",confirmButtonText:"Leave Application",cancelButtonText:"Don't leave",confirmClick:function(){t()}})}else t()})});$(".job-details-link-container").click(function(n){t(!0);n.preventDefault()})}namespace("gJobs").JobApplication=t;var i=new gJobs.JobApplication;$(document).ready(function(){gJobs.focusService.enableFocusForBrowserControls();let t=new URL(n.location.href),f=t.searchParams,i=f.get("isViewJobDetails");i&&i=="true"&&($(".button-parent").hide(),$(".apply-button-container").hide(),$(".footer-apply-button-container").hide());const r=t.pathname.split("/").includes("apply"),u=t.pathname.split("/")[2];r&&u&&increaseClickCount(!0,u);r&&($("#header").css("display","none"),$(".footer-container").css("display","none"),$(".container").css("border-top","none"),$("#content").css("padding-top","0px"),$("#main-content-container").css("padding-top","0px"),$(".respect-sticky-header").css("min-height","570px"),$("#onlineapp-loading-spinner").css("position","absolute"),$(".job-page").css("background-color","white"),$("#applying-username-verbiage-redesign").hide(),$("#delimiter-redesign").hide(),$(".frame-group-apply").find(".popover-trigger").popover(),gJobs.jobsDetails.loadOnlineApplication(function(){return!0}),$(".agency-logo").filter(function(){var n=this;return n.complete?typeof n.naturalWidth!="undefined"&&n.naturalWidth==0?!0:!1:!0}).addClass("missing-image"))})})(window)