function vd(){this.Init()}m("AdfHtml5NavigationHistoryAgent",vd);r.v(vd,xd);vd.ga=function(){this.yDa="popstate";this.NBa="hashchange"};m("AdfHtml5NavigationHistoryAgent.InitClass",vd.ga);vd.prototype.ac=function(){this.Tib&&(q.b.xa(this.zd(),vd.yDa,vd.Sl),q.b.xa(this.zd(),vd.NBa,vd.Sl))};r.a("AdfHtml5NavigationHistoryAgent.prototype.dispose",{ac:vd.prototype.ac});
vd.prototype.vt=function(a,b,d,e,f){a=yd(this,null,null,d,f);b=this.zd().history;f?b.replaceState(b.state,null,a):b.pushState(null,null,a)};r.a("AdfHtml5NavigationHistoryAgent.prototype.SetQueryStringImpl",{vt:vd.prototype.vt});
vd.prototype.Ie=function(a){this.bO=-1;if(this.My()){var b=this.zd().location.href,d=this.Yba();this.bO=null==d||""===d?b.lastIndexOf("/"):b.indexOf(d)+d.length;u.assert(0<=this.bO)}vd.h.Ie.call(this,a);a=q.b;a.ba(this.zd(),vd.yDa,vd.Sl);a.ba(this.zd(),vd.NBa,vd.Sl);this.Tib=!0};r.a("AdfHtml5NavigationHistoryAgent.prototype.StartTrackingUriImpl",{Ie:vd.prototype.Ie});
vd.prototype.Rs=function(a,b){var d=this.Cj();b="?"==b?null:b;if(d.id!=a||d.ys!=b)d=yd(this,d.id,a,b,!1),this.zd().history.pushState(null,null,d)};r.a("AdfHtml5NavigationHistoryAgent.prototype.AddHistoryEntry",{Rs:vd.prototype.Rs});
vd.prototype.Cj=function(){var a=vd.h.Cj.call(this),b=this.zd();if(void 0===a.dI){var d=null;try{d=b.history.state}catch(f){}null!=d&&(a.dI=d.E9a)}a.id=a.ys=void 0;if(this.My()){b=b.location.href;d=b.indexOf("#");0<=d&&(b=b.substring(0,d));var d=b.indexOf("?"),e="";0<=d?(e=b.substring(d),1<e.length&&(a.ys=e),b=b.substring(this.bO,d)):b=b.substring(this.bO);d=b.indexOf(";");a.id=0<=d?b.substring(0,d):b}return a};r.a("AdfHtml5NavigationHistoryAgent.prototype.GetViewInfoFromBrowserURI",{Cj:vd.prototype.Cj});
vd.prototype.vK=function(a,b,d,e){if(this.My()){var f=this.Cj();b=yd(this,f.id,b,d,!1)}else b=this.zd().location.href;zd(this,b,a,e)};r.a("AdfHtml5NavigationHistoryAgent.prototype.UpdateInitialValues",{vK:vd.prototype.vK});vd.prototype.aE=function(a,b){var d="#";null!=b&&(d+=encodeURIComponent(b));var e=this.zd(),f=e.history.state;e.location.replace(d);a.Faa||null==a.dI||this.yw(a.dI,void 0,void 0,b,!0);null!=f&&e.history.replaceState(f,null)};
r.a("AdfHtml5NavigationHistoryAgent.prototype.NavigateToSavedAnchorImpl",{aE:vd.prototype.aE});vd.prototype.hK=function(a,b,d,e){b=this.zd().location.href;zd(this,b,a,e)};r.a("AdfHtml5NavigationHistoryAgent.prototype.RestoreValuesAfterAnchorNavigation",{hK:vd.prototype.hK});vd.prototype.mE=function(){return!1};r.a("AdfHtml5NavigationHistoryAgent.prototype.UsesHashForTrackingNavigation",{mE:vd.prototype.mE});
function zd(a,b,d,e){var f=b.indexOf("#");0<=f&&(b=b.substring(0,f));f=null;null!=d&&(f={},f.E9a=d);var g=a.zd().history;g.replaceState(f,null,b);null!=d&&null==g.state?a.yw(d,void 0,void 0,e,!0):null!=e&&g.replaceState(f,null,b+"#"+encodeURIComponent(e))}
function yd(a,b,d,e,f){var g=a.zd().location.href,h="",l=g.indexOf("#");0<=l&&(h=g.substring(l),g=g.substring(0,l));l=g.indexOf("?");0<=l&&(g=g.substring(0,l));null!=d&&b!==d&&(g=g.substring(0,a.bO)+d+g.substring(a.bO+b.length));null!=e&&"?"!=e&&(g+=e);f&&(g+=h);return g}vd.Sl=function(){xd.$().Vq()};