(function(){function e(e,t){try{const s=window.webkit;delete window["webkit"];window.webkit.messageHandlers[e].postMessage(t);window.webkit=s}catch(e){}}function t(){const e=new Uint32Array(4);window.crypto.getRandomValues(e);return e.reduce(((e="",t)=>e+t.toString(16).padStart(8,"0")),"")}class s{registeredApis={};frameId=t();registerApi(e,t){if(this.registeredApis[e]!==undefined){throw new Error(`API ${e} already registered.`)}this.registeredApis[e]=t}getRegisteredApi(e){return this.registeredApis[e]}getFrameId(){if(!this.frameId){this.frameId=t()}return this.frameId}registerFrame(){e("FrameBecameAvailable",{crwFrameId:this.getFrameId()})}}if(!window.__gCrWeb){window.__gCrWeb=new s}const a=window.__gCrWeb;class i{name="DataCloneError";code=25;message="Cyclic structures are not supported."}class r{queuedMessages=[];sendQueuedMessages(){while(this.queuedMessages.length>0){try{e("NavigationEventMessage",this.queuedMessages[0]);this.queuedMessages.shift()}catch(e){break}}}queueNavigationEventMessage(e){this.queuedMessages.push(e);this.sendQueuedMessages()}}const n=new r;const o=JSON.stringify;const d=window.history.pushState;const g=window.history.replaceState;History.prototype.pushState=function(e,t,s){n.queueNavigationEventMessage({command:"willChangeState",frame_id:a.getFrameId()});let r="";try{if(typeof e!=="undefined"){r=o(e)}}catch(e){throw new i}s=s||window.location.href;d.call(history,e,t,s);n.queueNavigationEventMessage({command:"didPushState",stateObject:r,baseUrl:document.baseURI,pageUrl:s.toString(),frame_id:a.getFrameId()})};History.prototype.replaceState=function(e,t,s){n.queueNavigationEventMessage({command:"willChangeState",frame_id:a.getFrameId()});let r="";try{if(typeof e!=="undefined"){r=o(e)}}catch(e){throw new i}s=s||window.location.href;g.call(history,e,t,s);n.queueNavigationEventMessage({command:"didReplaceState",stateObject:r,baseUrl:document.baseURI,pageUrl:s.toString(),frame_id:a.getFrameId()})}})();