function Qs(){this.Init()}m("AdfSessionTimeoutHelper",Qs);m("AdfSessionTimeoutHelper",Qs);r.v(Qs);Qs.bA={NONE:0,Psb:1,tca:2};m("AdfSessionTimeoutHelper.TimeoutWindowStates",Qs.bA);Qs.prototype.Isa=function(){return this.TN};r.a("AdfSessionTimeoutHelper.prototype.getTimeoutWindowState",{Isa:Qs.prototype.Isa});Qs.prototype.Init=function(){Qs.h.Init.call(this);this.TN=Qs.bA.NONE;this.Jza="AFTimeOutGlassPane"};r.a("AdfSessionTimeoutHelper.prototype.Init",{Init:Qs.prototype.Init});
Qs.prototype.CT=function(a,b,d){wC(a);xC(this,a,b);this.Xk=a;this.Zk=b;this.m6=d;a=q.b;null==(a.tl()?a.Wu("oracle.adfinternal.view.rich.sessionKeysCleaned"):null)&&(this.tu=A.c.ta(this,this.Nab,null,6E4),a.tl()&&a.Os("oracle.adfinternal.view.rich.sessionKeysCleaned","scheduled"))};r.a("AdfSessionTimeoutHelper.prototype.__initializeSessionTimeoutTimer",{CT:Qs.prototype.CT});
Qs.prototype.iL=function(){var a=v.l;this.tu&&(A.c.ic(this.tu),a.ee(v.INFO)&&a.info("Cancelled session timeout warning dialog timer with id ",this.tu),this.tu=null);this.kj&&(A.c.ic(this.kj),a.ee(v.INFO)&&a.info("Cancelled final session timeout dialog timer with id ",this.kj),this.kj=null)};r.a("AdfSessionTimeoutHelper.prototype.__cancelSessionTimeoutTimer",{iL:Qs.prototype.iL});Qs.prototype.Rha=function(){wC(this.Xk);yC(this,this.Xk,this.Zk)};
r.a("AdfSessionTimeoutHelper.prototype.__startSessionTimeoutTimer",{Rha:Qs.prototype.Rha});Qs.prototype.WFa=function(){this.Xk=0;var a=Wj.$();if(a.fq()){var b="oracle.adfinternal.view.rich.sessionKey_"+A.c.Ay();a.PZ(b)}xC(this,this.Xk,this.Zk)};r.a("AdfSessionTimeoutHelper.prototype.__alertTimeout",{WFa:Qs.prototype.WFa});
Qs.prototype.Fha=function(a){if("click"==a.type||"keypress"==a.type){var b=Wj.$();if(b.fq()){a=new Date;wC(this.Xk);xC(this,this.Xk,this.Zk);var d="oracle.adfinternal.view.rich.userActivityKey_"+A.c.Ay();b.naa(d,a.getTime());b=v.l;b.ee(v.INFO)&&b.info("Last user activity on client for ",d," at ",a)}}};r.a("AdfSessionTimeoutHelper.prototype.__recordUserActivity",{Fha:Qs.prototype.Fha});k=Qs.prototype;
k.Nab=function(){var a=Wj.$();if(a.fq()){var b=(new Date).getTime(),d=a.Zra();v.l.info("Cleaning expired session info from web local storage");for(var e=0;e<d.length;e++)if(0==d[e].indexOf("oracle.adfinternal.view.rich.sessionKey_")){var f=a.aP(d[e]);36E4<b-f&&(a.PZ(d[e]),a.PZ("oracle.adfinternal.view.rich.userActivityKey_"+d[e].split("_")[1]))}a=q.b;a.tl()?a.Os("oracle.adfinternal.view.rich.sessionKeysCleaned","complete"):v.l.info("Could not mark that we cleaned web local storage because session storage is not enabled")}};
function yC(a,b,d){var e=(new Date).getTime(),f=v.l,g=b-d;a.TN=Qs.bA.NONE;0<g&&12E4<=d?(a.tu=A.c.ta(a,a.Smb,null,g),f.ee(v.INFO)&&f.info("Scheduled session timeout warning dialog timer with id ",a.tu," to be shown at : ",new Date(e+g))):(a.kj=A.c.ta(a,a.Nmb,null,b),f.ee(v.INFO)&&f.info("Scheduled final session timeout dialog timer with id ",a.kj," to be shown at : ",new Date(e+b)))}function xC(a,b,d){a.iL();yC(a,b,d)}
function wC(a){var b=Wj.$();if(b.fq()){a=(new Date).getTime()+a;var d="oracle.adfinternal.view.rich.sessionKey_"+A.c.Ay(),e=b.aP(d);if(null==e||e<a)b.naa(d,a),b=v.l,b.ee(v.INFO)&&b.info("Web local storage for key ",d," reset to : ",new Date(a))}}
function zC(a){var b=Wj.$();if(b.fq()){var d="oracle.adfinternal.view.rich.userActivityKey_"+A.c.Ay();if(b=b.aP(d))if(b=(new Date).getTime()-b,b<a)return d=v.l,d.ee(v.INFO)&&d.info("User activity on client ",b/1E3," seconds ago. Duration checked for activity ",a/1E3," seconds"),!0}return!1}function AC(){var a=Wj.$();if(a.fq()){var b="oracle.adfinternal.view.rich.sessionKey_"+A.c.Ay();if(a=a.aP(b))return a-(new Date).getTime()}return null}
k.Smb=function(){var a=AC();if(a&&(a<this.Zk-2E3||a>this.Zk+2E3))return xC(this,a,this.Zk),-1;if(zC(this.Xk-this.Zk))return BC(this),-1;this.tu=null;a=A.c;this.kj&&(a.ic(this.kj),this.kj=null);var b=A.c.H(),d;d=6E4<=this.Zk?b.Z("af_document.PRE_SESSION_TIMEOUT_MSG",Math.floor(this.Zk/6E4)):b.Z("af_document.PRE_SESSION_TIMEOUT_MSG_SECOND",this.Zk/1E3);b=b.Z("af_document.PRE_SESSION_TIMEOUT_CONFIRM_TITLE");null==b&&(b="Expiration Warning");var e=this.D(this.Fgb);this.TN=Qs.bA.tca;CC(this);this.kOa=
(new Date).getTime();a.ZFa(b,d,e,this.Zk,!0);return-1};k.Fgb=function(a){DC(this);this.TN=Qs.bA.NONE;a.ll()==Za.Zm?BC(this):a.ll()==Za.No&&(a=AC(),a||(a=this.Zk-((new Date).getTime()-this.kOa),this.kOa=null),xC(this,a,this.Zk))};
k.Nmb=function(){var a=AC();if(a&&0<a&&0<a)return xC(this,a,this.Zk),-1;if(zC(this.Xk))return BC(this),-1;this.kj=null;a=A.c;this.tu&&(a.ic(this.tu),this.tu=null);var b=a.H(),d=b.Z("af_document.POST_SESSION_TIMEOUT_MSG");this.m6&&(d+=" "+b.Z("af_document.POST_SESSION_TIMEOUT_MSG_CONTINUE"));b=b.Z("af_document.POST_SESSION_TIMEOUT_ALERT_TITLE");null==b&&(b="Window Expired");Re.$().mO();var e=q.b.getElementById(a.gj);C.setVisible(e,!1);e=this.D(this.cgb);CC(this);this.TN=Qs.bA.tca;a.VFa(b,d,e);return-1};
k.cgb=function(){DC(this);this.kj=null;var a=A.c;this.TN=Qs.bA.NONE;if(this.m6)a.Y().location.replace(this.m6);else{var b=a.H().Z("af_document.POST_SESSION_TIMEOUT_MSG"),d=q.b,e=a.R().createElement("div");C.setVisible(e,!1);d.bc(e,b);d.getElementById(a.gj).parentNode.appendChild(e);C.setVisible(e,!0);a.Y().setTimeout(a.D(a.gJ),1)}};
function BC(a){var b=A.c.R().location.href,b=-1==b.indexOf("?")?b+"?":b+"\x26",b=b+("_afrTS\x3d"+(new Date).getTime()),d=new If;d.tI(!1);d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(b,null);d.Kp();delete d;v.l.info("Extended session lifetime");wC(a.Xk);xC(a,a.Xk,a.Zk)}function CC(a){var b=A.c.R().getElementsByTagName("body")[0];C.w(b,a.Jza)}function DC(a){var b=A.c.R().getElementsByTagName("body")[0];C.O(b,a.Jza)};