function Uc(a,b){this.Init(a,b)}m("AdfIndexedDbLogWriter",Uc);r.v(Uc,Lc);
Uc.prototype.Init=function(a,b){u.s(b,qa);Uc.h.Init.call(this,a,b);this.sW=a.localStorage;this.Hc=q.b.R();var d=this.EJ().indexedDB;if(!Uc.Ox&&d){var e=this,d=d.open("oracle.adf.view.rich.adfRcProfilerDb",1);d.onupgradeneeded=function(a){a.target.result.createObjectStore("records",{autoIncrement:!0}).createIndex("logDate","logDate",{unique:!1})};d.onsuccess=function(a){a=a.target.result;Uc.Ox?a.close():Uc.Ox=a;Vc(e)};d.onerror=function(a){e.Nq("Error opening IndexedDB: "+a.target.error)}}};
r.a("AdfIndexedDbLogWriter.prototype.Init",{Init:Uc.prototype.Init});Uc.prototype.close=function(){this.Lp(!0);this.a4=!0};r.a("AdfIndexedDbLogWriter.prototype.close",{close:Uc.prototype.close});
Uc.prototype.Lp=function(a){if(Uc.Ox){this.ug();var b=this.HH();if(b&&0<b.length)if(b={brb:b[0][Mc.dn].getTime(),Ksb:Date.now(),vpb:M.y1,page:this.Hc.title,path:this.EJ().location.pathname,Qy:b},!a)Vc(this),Wc(this,b);else if(this.sW)try{this.sW.setItem(Uc.Dga,JSON.stringify(b))}catch(d){this.Nq("Error setting localStorage: "+d)}}else this.Nq("IndexedDB is not available.");this.kD()};r.a("AdfIndexedDbLogWriter.prototype.closeRecord",{Lp:Uc.prototype.Lp});
function Wc(a,b){var d=Uc.Ox.transaction("records","readwrite");d.onerror=function(){a.Nq("Error: "+d.error)};var e=d.objectStore("records");e.add(b);e.count().onsuccess=Uc.dcb}Uc.dcb=function(a){var b=a.target.result-Uc.n2a;0<b&&(a.target.source.index("logDate").openCursor().onsuccess=function(a){b--;if(a=a.target.result)if(a["delete"](),0<b)a["continue"]()})};
function Vc(a){if(a.sW)try{var b=a.sW.getItem(Uc.Dga);if(b){a.sW.removeItem(Uc.Dga);for(var b=JSON.parse(b),d=0;d<b.Qy.length;d++)b.Qy[d][Mc.dn]&&(b.Qy[d][Mc.dn]=new Date(b.Qy[d][Mc.dn]));Wc(a,b)}}catch(e){a.Nq("Error processing localStorage value: "+e)}}
function Xc(a,b,d){var e="";b||(b=Uc.NIa);if(Uc.Ox){var f=function(d){d=d.target;d.error&&(a.Nq("Error: "+d.error),e="\x3cerror\x3e"+d.error+"\x3c/error\x3e\n"+e);b(e)};try{var g=Uc.Ox.transaction("records","readwrite");g.onerror=f;g.onabort=f;g.oncomplete=f;d||(e=a.$_());g.objectStore("records").index("logDate").openCursor().onsuccess=function(b){if(b=b.target.result){var f=b.value;e+=a.a0(new Date(f.Ksb),f.vpb,f.page,f.path,f.Qy);b["delete"]();b["continue"]()}else d||(e+=Lc.T_)}}catch(h){b("\x3cerror\x3e"+
h+"\x3c/error\x3e")}}else b(e)}function Yc(a,b){if(Uc.Ox){b||(b=Number.MAX_VALUE);var d=Uc.Ox.transaction("records","readwrite");d.onerror=function(){a.Nq("Error: "+d.error)};d.objectStore("records").openCursor().onsuccess=function(a){if(a=a.target.result){if(a.value.brb<b)a["delete"]();a["continue"]()}}}}Uc.Ox=null;Uc.n2a=100;Uc.Dga="oracle.adf.view.rich.adfRcProfilerKey";Uc.vka=function(){var a=null;v.Zc&&(a=v.Zc.ek(),Uc.prototype.isPrototypeOf(a)||(a=null));return a};Uc.NIa=function(a){console.log(a)};
Uc.eqb=function(a,b){a||(a=Uc.NIa);try{var d=Uc.vka();d?Xc(d,a,b):a("\x3cAdfIndexedDbLogWriterNotFound/\x3e")}catch(e){a("\x3cerror\x3e"+e+"\x3c/error\x3e")}};m("AdfIndexedDbLogWriter.getLogData",Uc.eqb);Uc.qpb=function(a){var b=Uc.vka();b&&Yc(b,a)};m("AdfIndexedDbLogWriter.deleteLogData",Uc.qpb);Uc.isEnabled=function(){return null!=Uc.vka()};m("AdfIndexedDbLogWriter.isEnabled",Uc.isEnabled);