﻿/*! Copyright (c) Epic Systems Corporation 2011 - 2019 */
"undefined"==typeof WP&&(WP={}),void 0===WP.Comm&&(WP.Comm={}),WP.Comm.RESPONSETYPE_COMPLETE=2,WP.Comm.RESPONSETYPE_CONTENTONLY=1,WP.Comm.logOut=function(e,o,t,n,i){o=!0===o,n=!0===n,i=!0===i,$$WP.CommunityUtilities.isNotDotNetMode()&&(t=t||"bye.asp"),"function"==typeof e||o||WP.Comm.clearLoggedInStorage();var l,m,a,u=makeLink("Home/LogOut?doRedirect="+(o?"true":"false")+"&logoutPage="+(t||"")+"&isTimeout="+(i?"true":"false"));return n&&"function"==typeof WP.Events.cancelBeforeUnload&&WP.Events.cancelBeforeUnload(),"function"==typeof closeAllWindows&&closeAllWindows(),o?a=function WP$Comm$logout$executeLogout(){WP.Comm.delayKeepAliveForLogout(),window.location=u,"function"==typeof e&&e(),WP.Comm.postLogoutOperations()}:(WP.Comm.logOut.count=0,l="function"!=typeof e?WP.Comm.postLogoutOperations:function WP$Comm$logOut$internalAfterExecute(o){var t=2;if($$WP.CommunityUtilities.isNotDotNetMode()){var n,i=o.indexOf('http-equiv="refresh"');i>-1&&(n=o.indexOf("url=",i)+4,"."===(m=o.substring(n,o.indexOf('"',n))).substr(0,1)&&(m=m.substr(2)),m=HTMLUnencode(m))}else t=1,o.indexOf("|")>-1&&(m=o.substring(o.indexOf("|")+1)),"."===m.substr(0,1)&&(m=m.substr(2));++WP.Comm.logOut.count===t&&(delete WP.Comm.logOut.count,e(m||"")),WP.Comm.postLogoutOperations()},a=function WP$Comm$logout$executeLogout(){WP.Comm.delayKeepAliveForLogout(),$.ajax({url:u,method:"GET",success:l}),$$WP.CommunityUtilities.isNotDotNetMode()&&$.ajax({url:makeLink(t),method:"GET",success:l})}),$$WP.IsPendingAJAXRequests?($$WP.PendingAJAXCallBack=a,window.setTimeout((function WP$Comm$logout$failSafeLogout(){null!==$$WP.PendingAJAXCallBack&&"function"==typeof $$WP.PendingAJAXCallBack&&($$WP.PendingAJAXCallBack(),$$WP.PendingAJAXCallBack=null)}),6e3)):a(),!1},WP.Comm.logOut.numExecutions=0,WP.CH5=String.fromCharCode(5),WP.Comm.clearLoggedInStorage=function(){var e=$$WPUtil.isLocalStorageAvailable()&&void 0!==window.localStorage;if(e)var o=localStorage.getItem("OSApptCount"),t=localStorage.getItem("OSApptCountDte"),n=localStorage.getItem("OSScheduledCSNs");WP.Comm.clearStorage(),e&&(localStorage.setItem("OSApptCount",o),localStorage.setItem("OSApptCountDte",t),localStorage.setItem("OSScheduledCSNs",n))},WP.Comm.clearStorage=function(){sessionStorage.clear()},WP.Comm.postLogoutOperations=function(){var e="true"===sessionStorage.IEHyperspaceLaunch;WP.Comm.clearLoggedInStorage(),e&&window.open("","_self").close()},WP.Comm.startKeepAlive=function(){window.setTimeout(WP.Comm.keepAlive,3e4)},WP.Comm.delayKeepAliveForLogout=function(){WP.Comm.keepAlive.delayForLogout=2},WP.Comm.keepAlive=function(){var e=0,keepAliveInternalFun=function(o){"0"===o?logOut(null,!1,!0):2==++e&&WP.Comm.startKeepAlive()};if(-1===window.location.href.indexOf("publicforms.asp")){if(WP.Comm.keepAlive.delayForLogout>0)return--WP.Comm.keepAlive.delayForLogout,void WP.Comm.startKeepAlive();++WP.Comm.keepAlive.counter,"function"==typeof intKeepalive&&intKeepalive(),!$$WPUtil.IsNullOrEmpty($$WP.Settings.DotNetOnly)&&$$WP.Settings.DotNetOnly||$.ajax({url:makeLink("keepalive.asp?cnt="+WP.Comm.keepAlive.counter),success:keepAliveInternalFun,method:"GET",global:!1}),-1===window.location.href.indexOf("termpage.asp")&&-1===window.location.href.indexOf("oeinside.asp")&&$.ajax({url:makeLink("Home/KeepAlive?cnt="+WP.Comm.keepAlive.counter),success:keepAliveInternalFun,method:"GET",global:!1})}},WP.Comm.keepAlive.counter=0,WP.Comm.keepAlive.delayForLogout=0;