function yd(){this.Init()}m("AdfHtml5NavigationHistoryAgent",yd);r.v(yd,zd);yd.ga=function(){this.CDa="popstate";this.RBa="hashchange"};m("AdfHtml5NavigationHistoryAgent.InitClass",yd.ga);yd.prototype.ac=function(){this.Uib&&(q.b.xa(this.zd(),yd.CDa,yd.Sl),q.b.xa(this.zd(),yd.RBa,yd.Sl))};r.a("AdfHtml5NavigationHistoryAgent.prototype.dispose",{ac:yd.prototype.ac});
yd.prototype.wt=function(a,b,d,e,f){a=Bd(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",{wt:yd.prototype.wt});
yd.prototype.Je=function(a){this.bO=-1;if(this.My()){var b=this.zd().location.href,d=this.$ba();this.bO=null==d||""===d?b.lastIndexOf("/"):b.indexOf(d)+d.length;u.assert(0<=this.bO)}yd.h.Je.call(this,a);a=q.b;a.ba(this.zd(),yd.CDa,yd.Sl);a.ba(this.zd(),yd.RBa,yd.Sl);this.Uib=!0};r.a("AdfHtml5NavigationHistoryAgent.prototype.StartTrackingUriImpl",{Je:yd.prototype.Je});
yd.prototype.Ss=function(a,b){var d=this.Cj();b="?"==b?null:b;if(d.id!=a||d.zs!=b)d=Bd(this,d.id,a,b,!1),this.zd().history.pushState(null,null,d)};r.a("AdfHtml5NavigationHistoryAgent.prototype.AddHistoryEntry",{Ss:yd.prototype.Ss});
yd.prototype.Cj=function(){var a=yd.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.H9a)}a.id=a.zs=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.zs=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:yd.prototype.Cj});
yd.prototype.vK=function(a,b,d,e){if(this.My()){var f=this.Cj();b=Bd(this,f.id,b,d,!1)}else b=this.zd().location.href;Ed(this,b,a,e)};r.a("AdfHtml5NavigationHistoryAgent.prototype.UpdateInitialValues",{vK:yd.prototype.vK});yd.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.Haa||null==a.dI||this.zw(a.dI,void 0,void 0,b,!0);null!=f&&e.history.replaceState(f,null)};
r.a("AdfHtml5NavigationHistoryAgent.prototype.NavigateToSavedAnchorImpl",{aE:yd.prototype.aE});yd.prototype.hK=function(a,b,d,e){b=this.zd().location.href;Ed(this,b,a,e)};r.a("AdfHtml5NavigationHistoryAgent.prototype.RestoreValuesAfterAnchorNavigation",{hK:yd.prototype.hK});yd.prototype.mE=function(){return!1};r.a("AdfHtml5NavigationHistoryAgent.prototype.UsesHashForTrackingNavigation",{mE:yd.prototype.mE});
function Ed(a,b,d,e){var f=b.indexOf("#");0<=f&&(b=b.substring(0,f));f=null;null!=d&&(f={},f.H9a=d);var g=a.zd().history;g.replaceState(f,null,b);null!=d&&null==g.state?a.zw(d,void 0,void 0,e,!0):null!=e&&g.replaceState(f,null,b+"#"+encodeURIComponent(e))}
function Bd(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}yd.Sl=function(){zd.$().Wq()};