(function(g){var window=this;'use strict';var TbP=function(N){if(N instanceof g.UJ)return N;if(typeof N.O5=="function")return N.O5(!1);if(g.z1(N)){var z=0,v=new g.UJ;v.next=function(){for(;;){if(z>=N.length)return g.aT;if(z in N)return g.BT(N[z++]);z++}}; return v}throw Error("Not implemented");},F1Z=function(N,z,v){if(g.z1(N))g.h8(N,z,v); else for(N=TbP(N);;){var R=N.next();if(R.done)break;z.call(v,R.value,void 0,N)}},zD=function(N){g.Kj(N,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.jV()).toString(36)); return N},vQ=function(N,z,v){Array.isArray(v)||(v=[String(v)]); g.Hkv(N.N,z,v)},nW5=function(N,z){var v=[]; F1Z(z,function(R){try{var C=g.A7.prototype.W.call(this,R,!0)}catch(Z){if(Z=="Storage: Invalid value was encountered")return;throw Z;}C===void 0?v.push(R):g.tGO(C)&&v.push(R)},N); return v},mV7=function(N,z){nW5(N,z).forEach(function(v){g.A7.prototype.remove.call(this,v)},N)},$V9=function(N){if(N.Bc){if(N.Bc.locationOverrideToken)return{locationOverrideToken:N.Bc.locationOverrideToken}; if(N.Bc.latitudeE7!=null&&N.Bc.longitudeE7!=null)return{latitudeE7:N.Bc.latitudeE7,longitudeE7:N.Bc.longitudeE7}}return null},UVw=function(N,z){g.J8(N,z)||N.push(z)},Bbr=function(N){var z=0,v; for(v in N)z++;return z},AB1=function(N,z){return g.qP(N,z)},gWm=function(N){try{return g.u7.JSON.parse(N)}catch(z){}N=String(N); if(/^\s*$/.test(N)?0:/^[\],:{}\s\u2028\u2029]*$/.test(N.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+N+")")}catch(z){}throw Error("Invalid JSON string: "+N);},RM=function(N){if(g.u7.JSON)try{return g.u7.JSON.parse(N)}catch(z){}return gWm(N)},p69=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/channel/opened",g.Qs("channel_type"))},kAE=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/channel/closed",g.Qs("channel_type"))},P1W=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Qs("channel_type"))},V1V=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/channel/success")},STE=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/channel/error",g.Qs("channel_type"),g.Qs("error_type"))},EW$=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},hg7=function(){var N=Ca(); this.V=N;N.zF("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},HiZ=function(N){if(N.IU&&typeof N.IU=="function")return N.IU(); if(typeof Map!=="undefined"&&N instanceof Map||typeof Set!=="undefined"&&N instanceof Set)return Array.from(N.values());if(typeof N==="string")return N.split("");if(g.z1(N)){for(var z=[],v=N.length,R=0;R1){if(v%2)throw Error("Uneven number of arguments");for(var R=0;R5&&(N=N.slice(N.length-5)); var z=g.OL(UL5(),function(R){return R.loungeToken}),v=g.OL(N,function(R){return R.loungeToken}); g.Iz(v,function(R){return!g.J8(z,R)})&&BmU(); g.ka("yt-remote-local-screens",N,31536E3)},GD=function(N){N||(g.VJ("yt-remote-session-screen-id"),g.VJ("yt-remote-session-video-id")); mL5();N=lg();g.fm(N,WQ());F41(N)},gAP=function(){if(!x$){var N=g.SW(); N&&(x$=new g.$e(N))}},p9W=function(){gAP(); return x$?!!x$.get("yt-remote-use-staging-server"):!1},el=function(N,z){g.va[N]=!0; var v=g.Nq();v&&v.publish.apply(v,arguments);g.va[N]=!1},kU8=function(){},Ca=function(){if(!Jg){Jg=new g.oZ(new kU8); var N=g.fX("client_streamz_web_flush_count",-1);N!==-1&&(Jg.Z=N)}return Jg},PQE=function(){var N=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return N?parseInt(N[1],10):0},V5r=function(N){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+N)!=-1||document.currentScript.src.indexOf("&"+N)!=-1)},SFl=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},yD=function(N){N.length?EAw(N.shift(),function(){yD(N)}):hXZ()},HX5=function(N){return"chrome-extension://"+N+"/cast_sender.js"},EAw=function(N,z,v){var R=document.createElement("script"); R.onerror=z;v&&(R.onload=v);g.aI(R,g.FI(N));(document.head||document.documentElement).appendChild(R)},oAm=function(){var N=PQE(),z=[]; if(N>1){var v=N-1;z.push("//www.gstatic.com/eureka/clank/"+N+"/cast_sender.js");z.push("//www.gstatic.com/eureka/clank/"+v+"/cast_sender.js")}return z},hXZ=function(){var N=SFl(); N&&N(!1,"No cast extension found")},bXm=function(){if(DL1){var N=2,z=SFl(),v=function(){N--; N==0&&z&&z(!0)}; window.__onGCastApiAvailable=v;EAw("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",hXZ,v)}},t5P=function(){bXm(); var N=oAm();N.push("//www.gstatic.com/eureka/clank/cast_sender.js");yD(N)},Iz1=function(){bXm(); var N=oAm();N.push.apply(N,g.U(OX5.map(HX5)));N.push("//www.gstatic.com/eureka/clank/cast_sender.js");yD(N)},fa=function(N,z,v){g.H.call(this); this.G=v!=null?(0,g.Zl)(N,v):N;this.fO=z;this.B=(0,g.Zl)(this.I1,this);this.V=!1;this.W=0;this.Z=this.SK=null;this.N=[]},du=function(){},X9V=function(){g.q_.call(this,"p")},rr$=function(){g.q_.call(this,"o")},crr=function(){return ub8=ub8||new g.Ws},qFP=function(N){g.q_.call(this,"serverreachability",N)},s7=function(N){var z=crr(); z.dispatchEvent(new qFP(z,N))},M5P=function(N){g.q_.call(this,"statevent",N)},TD=function(N){var z=crr(); z.dispatchEvent(new M5P(z,N))},w9U=function(N,z,v,R){g.q_.call(this,"timingevent",N); this.size=z;this.rtt=v;this.retries=R},FA=function(N,z){if(typeof N!=="function")throw Error("Fn must not be null and must be a function"); return g.u7.setTimeout(function(){N()},z)},na=function(){},m8=function(N,z,v,R){this.Z=N; this.N=z;this.UR=v;this.YJ=R||1;this.gW=new g.ej(this);this.ET=45E3;this.tO=null;this.G=!1;this.J=this.vL=this.Y=this.BL=this.PL=this.kJ=this.qd=null;this.Vp=[];this.V=null;this.L=0;this.B=this.K0=null;this.A0=-1;this.Id=!1;this.xT=0;this.S8=null;this.CV=this.UT=this.zE=this.Rd=!1;this.W=new NY5},NY5=function(){this.Z=null; this.V="";this.W=!1},va5=function(N,z,v){N.BL=1; N.Y=zD(z.clone());N.J=v;N.Rd=!0;ztW(N,null)},ztW=function(N,z){N.PL=Date.now(); $$(N);N.vL=N.Y.clone();vQ(N.vL,"t",N.YJ);N.L=0;var v=N.Z.BL;N.W=new NY5;N.V=Rtr(N.Z,v?z:null,!N.J);N.xT>0&&(N.S8=new g.N4((0,g.Zl)(N.jO,N,N.V),N.xT));N.gW.listen(N.V,"readystatechange",N.Ho);z=N.tO?g.vZ(N.tO):{};N.J?(N.K0||(N.K0="POST"),z["Content-Type"]="application/x-www-form-urlencoded",N.V.send(N.vL,N.K0,N.J,z)):(N.K0="GET",N.V.send(N.vL,N.K0,null,z));s7(1)},ZH1=function(N){if(!Cy$(N))return g.qn(N.V); var z=g.Mn(N.V);if(z==="")return"";var v="",R=z.length,C=g.uX(N.V)==4;if(!N.W.Z){if(typeof TextDecoder==="undefined")return U7(N),BQ(N),"";N.W.Z=new g.u7.TextDecoder}for(var Z=0;Zz.length)return Yvm;z=z.slice(R,R+v);N.L=R+v;return z},$$=function(N){N.kJ=Date.now()+N.ET; a_U(N,N.ET)},a_U=function(N,z){if(N.qd!=null)throw Error("WatchDog timer not null"); N.qd=FA((0,g.Zl)(N.pT,N),z)},Qs7=function(N){N.qd&&(g.u7.clearTimeout(N.qd),N.qd=null)},BQ=function(N){N.Z.QX()||N.Id||L69(N.Z,N)},U7=function(N){Qs7(N); g.Lc(N.S8);N.S8=null;N.gW.removeAll();if(N.V){var z=N.V;N.V=null;z.abort();z.dispose()}},yVm=function(N,z){try{var v=N.Z; if(v.fu!=0&&(v.V==N||K6r(v.W,N)))if(!N.UT&&K6r(v.W,N)&&v.fu==3){try{var R=v.ZT.V.parse(z)}catch(d){R=null}if(Array.isArray(R)&&R.length==3){var C=R;if(C[0]==0)a:{if(!v.Y){if(v.V)if(v.V.PL+3E30&&(v.xT=1.5*Q);R=v;var L=N.Uy();if(L){var K=g.wH(L,"X-Client-Wire-Protocol");if(K){var l=R.W;!l.V&&(g.yg(K,"spdy")||g.yg(K,"quic")||g.yg(K,"h2"))&&(l.N=l.B,l.V=new Set,l.W&&(G65(l,l.W),l.W=null))}if(R.Rd){var W=g.wH(L,"X-HTTP-Session-Id");W&&(R.Bc=W,g.Kj(R.tO,R.Rd,W))}}v.fu=3;v.B&&v.B.JL();v.Dx&&(v.Ui=Date.now()-N.PL);R=v;var G=N;R.Fy=x0w(R,R.BL?R.YJ:null,R.UR);if(G.UT){et5(R.W, G);var x=G,e=R.xT;e&&x.setTimeout(e);x.qd&&(Qs7(x),$$(x));R.V=G}else JVZ(R);v.Z.length>0&&k$(v)}else Z[0]!="stop"&&Z[0]!="close"||pa(v,7);else v.fu==3&&(Z[0]=="stop"||Z[0]=="close"?Z[0]=="stop"?pa(v,7):v.disconnect():Z[0]!="noop"&&v.B&&v.B.Tk(Z),v.Vp=0)}s7(4)}catch(d){}},f_W=function(N,z){this.V=N; this.map=z;this.context=null},d01=function(N){this.B=N||10; g.u7.PerformanceNavigationTiming?(N=g.u7.performance.getEntriesByType("navigation"),N=N.length>0&&(N[0].nextHopProtocol=="hq"||N[0].nextHopProtocol=="h2")):N=!!(g.u7.chrome&&g.u7.chrome.loadTimes&&g.u7.chrome.loadTimes()&&g.u7.chrome.loadTimes().wasFetchedViaSpdy);this.N=N?this.B:1;this.V=null;this.N>1&&(this.V=new Set);this.W=null;this.Z=[]},ssw=function(N){return N.W?!0:N.V?N.V.size>=N.N:!1},W6m=function(N){return N.W?1:N.V?N.V.size:0},K6r=function(N,z){return N.W?N.W==z:N.V?N.V.has(z):!1},G65= function(N,z){N.V?N.V.add(z):N.W=z},et5=function(N,z){N.W&&N.W==z?N.W=null:N.V&&N.V.has(z)&&N.V.delete(z)},TY8=function(N){if(N.W!=null)return N.Z.concat(N.W.Vp); if(N.V!=null&&N.V.size!==0){var z=N.Z;N=g.f(N.V.values());for(var v=N.next();!v.done;v=N.next())z=z.concat(v.value.Vp);return z}return g.T1(N.Z)},F6r=function(N,z){var v=new na; if(g.u7.Image){var R=new Image;R.onload=g.iW(PQ,v,"TestLoadImage: loaded",!0,z,R);R.onerror=g.iW(PQ,v,"TestLoadImage: error",!1,z,R);R.onabort=g.iW(PQ,v,"TestLoadImage: abort",!1,z,R);R.ontimeout=g.iW(PQ,v,"TestLoadImage: timeout",!1,z,R);g.u7.setTimeout(function(){if(R.ontimeout)R.ontimeout()},1E4); R.src=N}else z(!1)},naU=function(N,z){var v=new na,R=new AbortController,C=setTimeout(function(){R.abort(); PQ(v,"TestPingServer: timeout",!1,z)},1E4); fetch(N,{signal:R.signal}).then(function(Z){clearTimeout(C);Z.ok?PQ(v,"TestPingServer: ok",!0,z):PQ(v,"TestPingServer: server error",!1,z)}).catch(function(){clearTimeout(C); PQ(v,"TestPingServer: error",!1,z)})},PQ=function(N,z,v,R,C){try{C&&(C.onload=null,C.onerror=null,C.onabort=null,C.ontimeout=null),R(v)}catch(Z){}},m09=function(){this.V=new du},$01=function(N,z,v){var R=v||""; try{DVP(N,function(C,Z){var Y=C;g.v$(C)&&(Y=g.bX(C));z.push(R+Z+"="+encodeURIComponent(Y))})}catch(C){throw z.push(R+"type="+encodeURIComponent("_badmap")),C; }},VD=function(N,z,v){return v&&v.RV?v.RV[N]||z:z},U0$=function(N){this.Z=[]; this.YJ=this.Fy=this.tO=this.UR=this.V=this.Bc=this.Rd=this.Id=this.L=this.A0=this.J=null;this.BH=this.vL=0;this.HH=VD("failFast",!1,N);this.UT=this.qd=this.Y=this.G=this.B=null;this.yh=!0;this.RP=this.S8=-1;this.CV=this.Vp=this.PL=0;this.p5=VD("baseRetryDelayMs",5E3,N);this.MF=VD("retryDelaySeedMs",1E4,N);this.s9=VD("forwardChannelMaxRetries",2,N);this.xH=VD("forwardChannelRequestTimeoutMs",2E4,N);this.gx=N&&N.XTT||void 0;this.L5=N&&N.b9T||void 0;this.er=N&&N.cG1||!1;this.xT=void 0;this.BL=N&&N.Ru0|| !1;this.N="";this.W=new d01(N&&N.fXT);this.ZT=new m09;this.gW=N&&N.NKS||!1;this.kJ=N&&N.gaT||!1;this.gW&&this.kJ&&(this.kJ=!1);this.X6=N&&N.LsW||!1;N&&N.R90&&(this.yh=!1);this.Dx=!this.gW&&this.yh&&N&&N.wg1||!1;this.c5=void 0;N&&N.rU&&N.rU>0&&(this.c5=N.rU);this.J0=void 0;this.Ui=0;this.ET=!1;this.zE=this.K0=null},gu=function(N){N.V&&(BYP(N),N.V.cancel(),N.V=null)},AV1=function(N){gu(N); N.Y&&(g.u7.clearTimeout(N.Y),N.Y=null);Ag(N);N.W.cancel();N.G&&(typeof N.G==="number"&&g.u7.clearTimeout(N.G),N.G=null)},k$=function(N){ssw(N.W)||N.G||(N.G=!0,g.Fp(N.w3,N),N.PL=0)},peV=function(N,z){if(W6m(N.W)>=N.W.N-(N.G?1:0))return!1; if(N.G)return N.Z=z.Vp.concat(N.Z),!0;if(N.fu==1||N.fu==2||N.PL>=(N.HH?0:N.s9))return!1;N.G=FA((0,g.Zl)(N.w3,N,z),ga5(N,N.PL));N.PL++;return!0},Pyw=function(N,z){var v; z?v=z.UR:v=N.vL++;var R=N.tO.clone();g.Kj(R,"SID",N.N);g.Kj(R,"RID",v);g.Kj(R,"AID",N.S8);Sl(N,R);N.L&&N.J&&g.xZ(R,N.L,N.J);v=new m8(N,N.N,v,N.PL+1);N.L===null&&(v.tO=N.J);z&&(N.Z=z.Vp.concat(N.Z));z=k6Z(N,v,1E3);v.setTimeout(Math.round(N.xH*.5)+Math.round(N.xH*.5*Math.random()));G65(N.W,v);va5(v,R,z)},Sl=function(N,z){N.Id&&g.Dl(N.Id,function(v,R){g.Kj(z,R,v)}); N.B&&DVP({},function(v,R){g.Kj(z,R,v)})},k6Z=function(N,z,v){v=Math.min(N.Z.length,v); var R=N.B?(0,g.Zl)(N.B.Mn,N.B,N):null;a:{for(var C=N.Z,Z=-1;;){var Y=["count="+v];Z==-1?v>0?(Z=C[0].V,Y.push("ofs="+Z)):Z=0:Y.push("ofs="+Z);for(var Q=!0,L=0;L=3)return!1; N.CV++;N.Y=FA((0,g.Zl)(N.QZ,N),ga5(N,N.Vp));N.Vp++;return!0},BYP=function(N){N.K0!=null&&(g.u7.clearTimeout(N.K0),N.K0=null)},Vcl=function(N){N.V=new m8(N,N.N,"rpc",N.CV); N.L===null&&(N.V.tO=N.J);N.V.xT=0;var z=N.Fy.clone();g.Kj(z,"RID","rpc");g.Kj(z,"SID",N.N);g.Kj(z,"AID",N.S8);g.Kj(z,"CI",N.UT?"0":"1");!N.UT&&N.c5&&g.Kj(z,"TO",N.c5);g.Kj(z,"TYPE","xmlhttp");Sl(N,z);N.L&&N.J&&g.xZ(z,N.L,N.J);N.xT&&N.V.setTimeout(N.xT);var v=N.V;N=N.YJ;v.BL=1;v.Y=zD(z.clone());v.J=null;v.Rd=!0;ztW(v,N)},Ag=function(N){N.qd!=null&&(g.u7.clearTimeout(N.qd),N.qd=null)},L69=function(N,z){var v=null; if(N.V==z){Ag(N);BYP(N);N.V=null;var R=2}else if(K6r(N.W,z))v=z.Vp,et5(N.W,z),R=1;else return;if(N.fu!=0)if(z.G)if(R==1){v=z.J?z.J.length:0;z=Date.now()-z.PL;var C=N.PL;R=crr();R.dispatchEvent(new w9U(R,v,z,C));k$(N)}else JVZ(N);else{var Z=z.A0;C=z.getLastError();if(C==3||C==0&&Z>0||!(R==1&&peV(N,z)||R==2&&l_$(N)))switch(v&&v.length>0&&(z=N.W,z.Z=z.Z.concat(v)),C){case 1:pa(N,5);break;case 4:pa(N,10);break;case 3:pa(N,6);break;default:pa(N,2)}}},ga5=function(N,z){var v=N.p5+Math.floor(Math.random()* N.MF); N.isActive()||(v*=2);return v*z},pa=function(N,z){if(z==2){var v=(0,g.Zl)(N.pDp,N),R=N.L5,C=!R; R=new g.Cj(R||"//www.google.com/images/cleardot.gif");g.u7.location&&g.u7.location.protocol=="http"||g.ZF(R,"https");zD(R);C?F6r(R.toString(),v):naU(R.toString(),v)}else TD(2);N.fu=0;N.B&&N.B.vI(z);Sv$(N);AV1(N)},Sv$=function(N){N.fu=0; N.zE=[];if(N.B){var z=TY8(N.W);if(z.length!=0||N.Z.length!=0)g.nm(N.zE,z),g.nm(N.zE,N.Z),N.W.Z.length=0,g.T1(N.Z),N.Z.length=0;N.B.En()}},Eam=function(N){if(N.fu==0)return N.zE; var z=[];g.nm(z,TY8(N.W));g.nm(z,N.Z);return z},x0w=function(N,z,v){var R=g.lk(v); R.V!=""?(z&&g.YZ(R,z+"."+R.V),g.ik(R,R.Z)):(R=g.u7.location,R=biV(R.protocol,z?z+"."+R.hostname:R.hostname,+R.port,v));z=N.Rd;v=N.Bc;z&&v&&g.Kj(R,z,v);g.Kj(R,"VER",N.mB);Sl(N,R);return R},Rtr=function(N,z,v){if(z&&!N.BL)throw Error("Can't create secondary domain capable XhrIo object."); z=N.er&&!N.gx?new g.IZ(new g.Nv({zv:v})):new g.IZ(N.gx);z.L=N.BL;return z},ht8=function(){},HH1=function(){},hg=function(N,z){g.Ws.call(this); this.V=new U0$(z);this.B=N;this.W=z&&z.PST||null;N=z&&z.z10||null;z&&z.yuO&&(N?N["X-Client-Protocol"]="webchannel":N={"X-Client-Protocol":"webchannel"});this.V.J=N;N=z&&z.ln0||null;z&&z.c6&&(N?N["X-WebChannel-Content-Type"]=z.c6:N={"X-WebChannel-Content-Type":z.c6});z&&z.Cw&&(N?N["X-WebChannel-Client-Profile"]=z.Cw:N={"X-WebChannel-Client-Profile":z.Cw});this.V.A0=N;(N=z&&z.SOT)&&!g.ez(N)&&(this.V.L=N);this.G=z&&z.Ru0||!1;this.N=z&&z.YQp||!1;(z=z&&z.bZ)&&!g.ez(z)&&(this.V.Rd=z,g.c$(this.W,z)&&(N= this.W,z in N&&delete N[z]));this.Z=new E7(this)},oam=function(N){X9V.call(this); N.__headers__&&(this.headers=N.__headers__,this.statusCode=N.__status__,delete N.__headers__,delete N.__status__);var z=N.__sm__;z?this.data=(this.V=g.Iw(z))?g.N8(z,this.V):z:this.data=N},D0E=function(N){rr$.call(this); this.status=1;this.errorCode=N},E7=function(N){this.V=N},bH8=function(N,z){this.W=N; this.V=z},tc8=function(N){return Eam(N.V).map(function(z){var v=N.W; z=z.map;"__data__"in z?(z=z.__data__,v=v.N?gWm(z):z):v=z;return v})},HQ=function(N,z){if(typeof N!=="function")throw Error("Fn must not be null and must be a function"); return g.u7.setTimeout(function(){N()},z)},DG=function(N){oM.dispatchEvent(new OHZ(oM,N))},OHZ=function(N){g.q_.call(this,"statevent",N)},bg=function(N,z,v,R){this.V=N; this.N=z;this.L=v;this.G=R||1;this.W=45E3;this.Z=new g.ej(this);this.B=new g.El;this.B.setInterval(250)},XeU=function(N,z,v){N.ZK=1; N.Eq=zD(z.clone());N.FF=v;N.Rd=!0;I_Z(N,null)},rVZ=function(N,z,v,R,C){N.ZK=1; N.Eq=zD(z.clone());N.FF=null;N.Rd=v;C&&(N.XN=!1);I_Z(N,R)},I_Z=function(N,z){N.nJ=Date.now(); uSm(N);N.ev=N.Eq.clone();vQ(N.ev,"t",N.G);N.KA=0;N.qa=N.V.sB(N.V.oS()?z:null);N.pR>0&&(N.b2=new g.N4((0,g.Zl)(N.n$,N,N.qa),N.pR));N.Z.listen(N.qa,"readystatechange",N.LT);z=N.Ls?g.vZ(N.Ls):{};N.FF?(N.Ns="POST",z["Content-Type"]="application/x-www-form-urlencoded",N.qa.send(N.ev,N.Ns,N.FF,z)):(N.Ns="GET",N.XN&&!g.uU&&(z.Connection="close"),N.qa.send(N.ev,N.Ns,null,z));N.V.eW(1)},Mcw=function(N,z){var v=N.KA,R=z.indexOf("\n",v); if(R==-1)return cVE;v=Number(z.substring(v,R));if(isNaN(v))return qvw;R+=1;if(R+v>z.length)return cVE;z=z.slice(R,R+v);N.KA=R+v;return z},uSm=function(N){N.He=Date.now()+N.W; weV(N,N.W)},weV=function(N,z){if(N.x6!=null)throw Error("WatchDog timer not null"); N.x6=HQ((0,g.Zl)(N.Xf,N),z)},N8$=function(N){N.x6&&(g.u7.clearTimeout(N.x6),N.x6=null)},z6Z=function(N){N.V.QX()||N.TO||N.V.Mh(N)},tg=function(N){N8$(N); g.Lc(N.b2);N.b2=null;N.B.stop();N.Z.removeAll();if(N.qa){var z=N.qa;N.qa=null;z.abort();z.dispose()}N.Uh&&(N.Uh=null)},vpU=function(N,z){try{N.V.iX(N,z),N.V.eW(4)}catch(v){}},CR8=function(N,z,v,R,C){if(R==0)v(!1); else{var Z=C||0;R--;R6W(N,z,function(Y){Y?v(!0):g.u7.setTimeout(function(){CR8(N,z,v,R,Z)},Z)})}},R6W=function(N,z,v){var R=new Image; R.onload=function(){try{O7(R),v(!0)}catch(C){}}; R.onerror=function(){try{O7(R),v(!1)}catch(C){}}; R.onabort=function(){try{O7(R),v(!1)}catch(C){}}; R.ontimeout=function(){try{O7(R),v(!1)}catch(C){}}; g.u7.setTimeout(function(){if(R.ontimeout)R.ontimeout()},z); R.src=N},O7=function(N){N.onload=null; N.onerror=null;N.onabort=null;N.ontimeout=null},ZJP=function(N){this.V=N; this.W=new du},Y5$=function(N){var z=IM(N.V,N.m0,"/mail/images/cleardot.gif"); zD(z);CR8(z.toString(),5E3,(0,g.Zl)(N.Px,N),3,2E3);N.eW(1)},iJw=function(N){var z=N.V.G; z!=null?(DG(5),z?(DG(11),XA(N.V,N,!1)):(DG(12),XA(N.V,N,!0))):(N.q4=new bg(N),N.q4.Ls=N.Be,z=N.V,z=IM(z,z.oS()?N.RO:null,N.X_),DG(5),vQ(z,"TYPE","xmlhttp"),rVZ(N.q4,z,!1,N.RO,!1))},jXw=function(N,z,v){this.V=1; this.W=[];this.Z=[];this.B=new du;this.J=N||null;this.G=z!=null?z:null;this.Y=v||!1},a4U=function(N,z){this.V=N; this.map=z;this.context=null},QX7=function(N,z,v,R){g.q_.call(this,"timingevent",N); this.size=z;this.rtt=v;this.retries=R},LeV=function(N){g.q_.call(this,"serverreachability",N)},l4U=function(N){N.Ul(1,0); N.CA=IM(N,null,N.UB);Kew(N)},Wel=function(N){N.cT&&(N.cT.abort(),N.cT=null); N.o_&&(N.o_.cancel(),N.o_=null);N.Hm&&(g.u7.clearTimeout(N.Hm),N.Hm=null);ru(N);N.z0&&(N.z0.cancel(),N.z0=null);N.V7&&(g.u7.clearTimeout(N.V7),N.V7=null)},GJP=function(N,z){if(N.V==0)throw Error("Invalid operation: sending map when state is closed"); N.W.push(new a4U(N.Ff++,z));N.V!=2&&N.V!=3||Kew(N)},xpZ=function(N){var z=0; N.o_&&z++;N.z0&&z++;return z},Kew=function(N){N.z0||N.V7||(N.V7=HQ((0,g.Zl)(N.Vx,N),0),N.Y6=0)},y6$=function(N,z){if(N.V==1){if(!z){N.gR=Math.floor(Math.random()*1E5); z=N.gR++;var v=new bg(N,"",z);v.Ls=N.oU;var R=e6P(N),C=N.CA.clone();g.Kj(C,"RID",z);g.Kj(C,"CVER","1");ug(N,C);XeU(v,C,R);N.z0=v;N.V=2}}else N.V==3&&(z?J6E(N,z):N.W.length==0||N.z0||J6E(N))},J6E=function(N,z){if(z)if(N.uH>6){N.W=N.Z.concat(N.W); N.Z.length=0;var v=N.gR-1;z=e6P(N)}else v=z.L,z=z.FF;else v=N.gR++,z=e6P(N);var R=N.CA.clone();g.Kj(R,"SID",N.N);g.Kj(R,"RID",v);g.Kj(R,"AID",N.Dv);ug(N,R);v=new bg(N,N.N,v,N.Y6+1);v.Ls=N.oU;v.setTimeout(1E4+Math.round(1E4*Math.random()));N.z0=v;XeU(v,R,z)},ug=function(N,z){N.YB&&(N=N.YB.Ps())&&g.Dl(N,function(v,R){g.Kj(z,R,v)})},e6P=function(N){var z=Math.min(N.W.length,1E3),v=["count="+z]; if(N.uH>6&&z>0){var R=N.W[0].V;v.push("ofs="+R)}else R=0;for(var C={},Z=0;Z=3)return!1; N.L++;N.Hm=HQ((0,g.Zl)(N.qt,N),dpU(N,N.fC));N.fC++;return!0},XA=function(N,z,v){N.gw=N.G==null?v:!N.G; N.Bg=z.p7;N.Y||l4U(N)},ru=function(N){N.Sq!=null&&(g.u7.clearTimeout(N.Sq),N.Sq=null)},dpU=function(N,z){var v=5E3+Math.floor(Math.random()*1E4); N.isActive()||(v*=2);return v*z},cQ=function(N,z){if(z==2||z==9){var v=null; N.YB&&(v=null);var R=(0,g.Zl)(N.If8,N);v||(v=new g.Cj("//www.google.com/images/cleardot.gif"),zD(v));R6W(v.toString(),1E4,R)}else DG(2);T8r(N,z)},T8r=function(N,z){N.V=0; N.YB&&N.YB.Ws(z);FeW(N);Wel(N)},FeW=function(N){N.V=0; N.Bg=-1;if(N.YB)if(N.Z.length==0&&N.W.length==0)N.YB.F_();else{var z=g.T1(N.Z),v=g.T1(N.W);N.Z.length=0;N.W.length=0;N.YB.F_(z,v)}},IM=function(N,z,v){var R=g.lk(v); if(R.V!="")z&&g.YZ(R,z+"."+R.V),g.ik(R,R.Z);else{var C=window.location;R=biV(C.protocol,z?z+"."+C.hostname:C.hostname,+C.port,v)}N.kL&&g.Dl(N.kL,function(Z,Y){g.Kj(R,Y,Z)}); g.Kj(R,"VER",N.uH);ug(N,R);return R},np5=function(){},mpU=function(){this.V=[]; this.W=[]},$pW=function(N){g.q_.call(this,"channelMessage"); this.message=N},Up$=function(N){g.q_.call(this,"channelError"); this.error=N},B8P=function(N,z){this.action=N; this.params=z||{}},qR=function(N,z){g.H.call(this); this.V=new g.cn(this.PO0,0,this);g.b(this,this.V);this.fO=5E3;this.W=0;if(typeof N==="function")z&&(N=(0,g.Zl)(N,z));else if(N&&typeof N.handleEvent==="function")N=(0,g.Zl)(N.handleEvent,N);else throw Error("Invalid listener argument");this.Z=N},A6U=function(N,z,v,R,C,Z,Y,Q,L,K,l,W,G,x){v=v===void 0?!1:v; R=R===void 0?function(){return""}:R; C=C===void 0?!1:C;Z=Z===void 0?!1:Z;Y=Y===void 0?!1:Y;Q=Q===void 0?function(){return g.px({})}:Q; L=L===void 0?!1:L;l=l===void 0?!1:l;W=W===void 0?!1:W;G=G===void 0?!1:G;x=x===void 0?!1:x;this.BL=N;this.qd=z;this.G=new g.mN;this.W=new qR(this.H5S,this);this.V=null;this.L=!1;this.J=null;this.PL="";this.Vp=this.Y=0;this.Z=[];this.CV=v;this.Rd=R;this.B=Z;this.tO=Q;this.Id=K;this.YJ=Y;this.K0=null;this.N=g.px();this.UR=C;this.zE=L;this.gW=l;this.kJ=W;this.yh=G;this.A0=x;this.xT=new p69;this.UT=new kAE;this.ET=new V1V;this.vL=new P1W;this.S8=new STE;this.Dx=new EW$;this.J0=new hg7},kJP=function(N, z,v,R,C){gpZ(N); if(N.V){var Z=g.XI("ID_TOKEN"),Y=N.V.oU||{};Z?Y["x-youtube-identity-token"]=Z:delete Y["x-youtube-identity-token"];N.V.oU=Y}pzr(N);R?(R.getState()!=3&&xpZ(R)==0||R.getState(),N.V.connect(z,v,N.qd,R.N,R.Dv)):C?N.V.connect(z,v,N.qd,C.sessionId,C.arrayId):N.V.connect(z,v,N.qd)},Ep9=function(N,z){return N.yh?!0:N.kJ?Object.values(PR1).includes(z):N.gW?!Object.values(VtP).includes(z):N.A0?Object.values(S55).includes(z):!1},opV=function(N){var z,v; g.S(function(R){if(R.W==1)return g.Tu(R,2),g.k(R,h6W(N),2);g.Ab(R);z=N.Z;N.Z=[];v=z.length;HJ$(N,z,v);MR(N);return g.pO(R,0)})},HJ$=function(N,z,v){for(var R=0;R0?v=Object.assign({},v,z):delete v.Authorization;N.V.oU=v}},pzr=function(N){N.Id&&!N.B&&bJU(N,N.Id())},wu=function(N){this.scheme="https"; this.port=this.domain="";this.V="/api/lounge";this.W=!0;N=N||document.location.href;var z=Number(g.Fd(N)[4]||null)||"";z&&(this.port=":"+z);this.domain=g.nt(N)||"";N=g.mU();N.search("MSIE")>=0&&(N=N.match(/MSIE ([\d.]+)/)[1],g.nI(N,"10.0")<0&&(this.W=!1))},N5=function(N,z){var v=N.V; N.W&&(v=N.scheme+"://"+N.domain+N.port+N.V);return g.kS(v+z,{})},ttZ=function(N,z){g.Ws.call(this); var v=this;this.JI=N();this.JI.subscribe("handlerOpened",this.SJ,this);this.JI.subscribe("handlerClosed",this.onClosed,this);this.JI.subscribe("handlerError",function(R,C){v.onError(C)}); this.JI.subscribe("handlerMessage",this.onMessage,this);this.V=z},OJ5=function(N,z,v){var R=this; v=v===void 0?function(){return""}:v; var C=C===void 0?new HH1:C;var Z=Z===void 0?new g.mN:Z;this.pathPrefix=N;this.V=z;this.PL=v;this.B=Z;this.Y=null;this.J=this.L=0;this.channel=null;this.G=0;this.Z=new qR(function(){R.Z.isActive();var Y;((Y=R.channel)==null?void 0:W6m((new bH8(Y,Y.V)).V.W))===0&&R.connect(R.Y,R.L)}); this.N={};this.W={};this.qd=!1;this.logger=null;this.Vp=[];this.pU=void 0;this.tO=new p69;this.K0=new kAE;this.Id=new P1W;this.Rd=new STE},I47=function(N){g.ZI(N.channel,"m",function(){N.G=3; N.Z.reset();N.Y=null;N.L=0;for(var z=g.f(N.Vp),v=z.next();!v.done;v=z.next())v=v.value,N.channel&&N.channel.send(v);N.Vp=[];N.publish("webChannelOpened");N.tO.Sr("WEB_CHANNEL")}); g.ZI(N.channel,"n",function(){N.G=0;N.Z.isActive()||N.publish("webChannelClosed");var z,v=(z=N.channel)==null?void 0:tc8(new bH8(z,z.V));v&&(N.Vp=[].concat(g.U(v)));N.K0.Sr("WEB_CHANNEL")}); g.ZI(N.channel,"p",function(z){var v=z.data;v[0]==="gracefulReconnect"?(N.Z.start(),N.channel&&N.channel.close()):N.publish("webChannelMessage",new B8P(v[0],v[1]));N.pU=z.statusCode;N.Id.Sr("WEB_CHANNEL")}); g.ZI(N.channel,"o",function(){N.pU===401||N.Z.start();N.publish("webChannelError");N.Rd.Sr("WEB_CHANNEL","")})},Xzr=function(N){var z=N.PL(); z?N.N["x-youtube-lounge-xsrf-token"]=z:delete N.N["x-youtube-lounge-xsrf-token"]},r6Z=function(N){g.Ws.call(this); this.V=N();this.V.subscribe("webChannelOpened",this.hC,this);this.V.subscribe("webChannelClosed",this.onClosed,this);this.V.subscribe("webChannelError",this.onError,this);this.V.subscribe("webChannelMessage",this.onMessage,this)},uiU=function(N,z,v,R,C){function Z(){return new A6U(N5(N,"/bc"),z,!1,v,R)} v=v===void 0?function(){return""}:v; return g.yj("enable_mdx_web_channel_desktop")?new r6Z(function(){return new OJ5(N5(N,"/wc"),z,v)}):new ttZ(Z,C)},wzE=function(){var N=c6$; q5l();zH.push(N);Mtl()},vu=function(N,z){q5l(); var v=N5w(N,String(z));zH.length==0?za8(v):(Mtl(),g.h8(zH,function(R){R(v)}))},RE=function(N){vu("CP",N)},q5l=function(){zH||(zH=g.qx("yt.mdx.remote.debug.handlers_")||[],g.cU("yt.mdx.remote.debug.handlers_",zH))},za8=function(N){var z=(CB+1)%50; CB=z;Z1[z]=N;YO||(YO=z==49)},Mtl=function(){var N=zH; if(Z1[0]){var z=YO?CB:-1,v={};do v={V0:void 0},z=(z+1)%50,v.V0=Z1[z],g.h8(N,function(R){return function(C){C(R.V0)}}(v)); while(z!=CB);Z1=Array(50);CB=-1;YO=!1}},N5w=function(N,z){var v=(Date.now()-vH1)/1E3; v.toFixed&&(v=v.toFixed(3));var R=[];R.push("[",v+"s","] ");R.push("[","yt.mdx.remote","] ");R.push(N+": "+z,"\n");return R.join("")},il=function(N){g.jJ.call(this); this.G=N;this.screens=[]},Ra7=function(N,z){var v=N.get(z.uuid)||N.get(z.id); if(v)return N=v.name,v.id=z.id||v.id,v.name=z.name,v.token=z.token,v.uuid=z.uuid||v.uuid,v.name!=N;N.screens.push(z);return!0},C$Z=function(N,z){var v=N.screens.length!=z.length; N.screens=g.kK(N.screens,function(Z){return!!dL8(z,Z)}); for(var R=z.length,C=0;C0&&N.N0&&fB(N,v)},function(z){N.B=function(){}; N.B1(z)})},kR7=function(N){var z={}; z.pairingCode=N.K0;z.theme=N.BL;p9W()&&(z.env_useStageMdx=1);return g.pt(z)},P$w=function(N){return new Promise(function(z){N.K0=yrr(); if(N.tO){var v=new chrome.cast.DialLaunchResponse(!0,kR7(N));z(v);pdZ(N)}else N.qd=function(){g.xA(N.J);N.qd=function(){}; N.J=NaN;var R=new chrome.cast.DialLaunchResponse(!0,kR7(N));z(R);pdZ(N)},N.J=g.W9(function(){N.qd()},100)})},S19=function(N,z,v){N.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(z)); var R=new aM(z);return(new Promise(function(C){Vbr(N,R,function(Z){Z?(N.Vp=!0,ll(N.N,R),GH(N,R),fB(N,v)):g.c6(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(z)+" is not online."));C(Z)},5)})).then(function(C){return C?new chrome.cast.DialLaunchResponse(!1):P$w(N)})},EHr=function(N,z){var v=N.Y.receiver.label,R=N.W.friendlyName; return(new Promise(function(C){xf7(N.N,v,z,R,function(Z){Z&&Z.token&&GH(N,Z);C(Z)},function(Z){xO(N,"Failed to get DIAL screen: "+Z); C(null)})})).then(function(C){return C&&C.token?new chrome.cast.DialLaunchResponse(!1):P$w(N)})},Vbr=function(N,z,v,R){g.xA(N.G); N.G=0;Jq$(N.N,z,function(C){C||R<0?v(C):N.G=g.W9(function(){Vbr(N,z,v,R-1)},300)})},fB=function(N,z){N.info("getDialAppInfoWithTimeout_ "+z); y7(N)&&(g.xA(N.L),N.L=0,z==0?haZ(N):N.L=g.W9(function(){haZ(N)},z))},haZ=function(N){y7(N)&&N.Z.getDialAppInfo(function(z){N.info("getDialAppInfo dialLaunchData: "+JSON.stringify(z)); z=z.extraData||{};var v=null;if(z.loungeToken){var R;((R=N.V)==null?void 0:R.token)==z.loungeToken&&(v="staleLoungeToken")}else v="missingLoungeToken";v?(N.PL=v,fB(N,3E4)):(N.Vp=!1,N.PL="unknown",sqV(N,z.loungeToken),fB(N,z.loungeTokenRefreshIntervalMs))},function(z){N.info("getDialAppInfo error: "+z); N.PL="noLoungeTokenResponse";fB(N,3E4)})},HGm=function(N){g.xA(N.G); N.G=0;g.xA(N.L);N.L=0;N.B();N.B=function(){}; g.xA(N.J)},dn=function(N,z){Wu.call(this,N,z,"ManualSession"); this.Z=g.W9((0,g.Zl)(this.Us,this,null),150)},sS=function(N,z){g.jJ.call(this); this.config_=z;this.W=N;this.Y=z.appId||"233637DE";this.N=z.theme||"cl";this.J=z.disableCastApi||!1;this.G=z.forceMirroring||!1;this.V=null;this.L=!1;this.Z=[];this.B=(0,g.Zl)(this.sud,this)},oH$=function(N,z){return z?g.G1(N.Z,function(v){return QD(z,v.label)},N):null},TH=function(N){vu("Controller",N)},c6$=function(N){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(N)},F0=function(N){return N.L||!!N.Z.length||!!N.V},nB=function(N,z,v){z!=N.V&&(g.Lc(N.V),(N.V=z)?(v?N.publish("yt-remote-cast2-receiver-resumed", z.W):N.publish("yt-remote-cast2-receiver-selected",z.W),z.subscribe("sessionScreen",(0,g.Zl)(N.G2,N,z)),z.subscribe("sessionFailed",function(){return Df7(N,z)}),z.V?N.publish("yt-remote-cast2-session-change",z.V):v&&N.V.Us(null)):N.publish("yt-remote-cast2-session-change",null))},Df7=function(N,z){N.V==z&&N.publish("yt-remote-cast2-session-failed")},bGw=function(N){var z=N.W.bX(),v=N.V&&N.V.W; N=g.OL(z,function(R){v&&QD(R,v.label)&&(v=null);var C=R.uuid?R.uuid:R.id,Z=oH$(this,R);Z?(Z.label=C,Z.friendlyName=R.name):(Z=new chrome.cast.Receiver(C,R.name),Z.receiverType=chrome.cast.ReceiverType.CUSTOM);return Z},N); v&&(v.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(v=new chrome.cast.Receiver(v.label,v.friendlyName),v.receiverType=chrome.cast.ReceiverType.CUSTOM),N.push(v));return N},cqW=function(N,z,v,R){R.disableCastApi?mt("Cannot initialize because disabled by Mdx config."):tb$()?OGW(z,R)&&(IY8(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Xd5(N,v):(window.__onGCastApiAvailable=function(C,Z){C?Xd5(N,v):($O("Failed to load cast API: "+Z),rq$(!1),IY8(!1),g.VJ("yt-remote-cast-available"),g.VJ("yt-remote-cast-receiver"), uC7(),v(!1))},R.loadCastApiSetupScript?g.iD("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?PQE()>=60&&t5P():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?hXZ():PQE()>=89?Iz1():(bXm(),yD(OX5.map(HX5))))):mt("Cannot initialize because not running Chrome")},uC7=function(){mt("dispose"); var N=US();N&&N.dispose();g.cU("yt.mdx.remote.cloudview.instance_",null);q1V(!1);g.ZK(MbV);MbV.length=0},Bu=function(){return!!g.Pe("yt-remote-cast-installed")},wdl=function(){var N=g.Pe("yt-remote-cast-receiver"); return N?N.friendlyName:null},N3w=function(){mt("clearCurrentReceiver"); g.VJ("yt-remote-cast-receiver")},zF8=function(){return Bu()?US()?US().getCastSession():($O("getCastSelector: Cast is not initialized."),null):($O("getCastSelector: Cast API is not installed!"),null)},vL7=function(){Bu()?US()?Al()?(mt("Requesting cast selector."),US().requestSession()):(mt("Wait for cast API to be ready to request the session."),MbV.push(g.C1("yt-remote-cast2-api-ready",vL7))):$O("requestCastSelector: Cast is not initialized."):$O("requestCastSelector: Cast API is not installed!")}, gn=function(N,z){Al()?US().setConnectedScreenStatus(N,z):$O("setConnectedScreenStatus called before ready.")},tb$=function(){var N=g.mU().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.gp||N},RF9=function(N,z){US().init(N,z)},OGW=function(N,z){var v=!1; US()||(N=new sS(N,z),N.subscribe("yt-remote-cast2-availability-change",function(R){g.ka("yt-remote-cast-available",R);el("yt-remote-cast2-availability-change",R)}),N.subscribe("yt-remote-cast2-receiver-selected",function(R){mt("onReceiverSelected: "+R.friendlyName); g.ka("yt-remote-cast-receiver",R);el("yt-remote-cast2-receiver-selected",R)}),N.subscribe("yt-remote-cast2-receiver-resumed",function(R){mt("onReceiverResumed: "+R.friendlyName); g.ka("yt-remote-cast-receiver",R);el("yt-remote-cast2-receiver-resumed",R)}),N.subscribe("yt-remote-cast2-session-change",function(R){mt("onSessionChange: "+La(R)); R||g.VJ("yt-remote-cast-receiver");el("yt-remote-cast2-session-change",R)}),g.cU("yt.mdx.remote.cloudview.instance_",N),v=!0); mt("cloudview.createSingleton_: "+v);return v},US=function(){return g.qx("yt.mdx.remote.cloudview.instance_")},Xd5=function(N,z){rq$(!0); IY8(!1);RF9(N,function(v){v?(q1V(!0),g.YL("yt-remote-cast2-api-ready")):($O("Failed to initialize cast API."),rq$(!1),g.VJ("yt-remote-cast-available"),g.VJ("yt-remote-cast-receiver"),uC7());z(v)})},mt=function(N){vu("cloudview",N)},$O=function(N){vu("cloudview",N)},rq$=function(N){mt("setCastInstalled_ "+N); g.ka("yt-remote-cast-installed",N)},Al=function(){return!!g.qx("yt.mdx.remote.cloudview.apiReady_")},q1V=function(N){mt("setApiReady_ "+N); g.cU("yt.mdx.remote.cloudview.apiReady_",N)},IY8=function(N){g.cU("yt.mdx.remote.cloudview.initializing_",N)},pB=function(N){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.G=this.L=0;this.trackData=null;this.sA=this.Ab=!1;this.Y=this.B=this.V=this.N=0;this.Z=NaN;this.W=!1;this.reset(N)},CDE=function(N){N.audioTrackId=null; N.trackData=null;N.playerState=-1;N.Ab=!1;N.sA=!1;N.L=0;N.G=g.jV();N.N=0;N.V=0;N.B=0;N.Y=0;N.Z=NaN;N.W=!1},kO=function(N){return N.isPlaying()?(g.jV()-N.G)/1E3:0},Pu=function(N,z){N.L=z; N.G=g.jV()},V7=function(N){switch(N.playerState){case 1:case 1081:return(g.jV()-N.G)/1E3+N.L; case -1E3:return 0}return N.L},SE=function(N,z,v){var R=N.videoId; N.videoId=z;N.index=v;z!=R&&CDE(N)},Z1U=function(N){var z={}; z.index=N.index;z.listId=N.listId;z.videoId=N.videoId;z.playerState=N.playerState;z.volume=N.volume;z.muted=N.muted;z.audioTrackId=N.audioTrackId;z.trackData=g.RP(N.trackData);z.hasPrevious=N.Ab;z.hasNext=N.sA;z.playerTime=N.L;z.playerTimeAt=N.G;z.seekableStart=N.N;z.seekableEnd=N.V;z.duration=N.B;z.loadedTime=N.Y;z.liveIngestionTime=N.Z;return z},hl=function(N,z){g.jJ.call(this); var v=this;this.Z=0;this.N=N;this.G=[];this.B=new mpU;this.W=this.V=null;this.J=(0,g.Zl)(this.Ddl,this);this.L=(0,g.Zl)(this.rI,this);this.Y=(0,g.Zl)(this.YT8,this);this.qd=(0,g.Zl)(this.mdT,this);var R=0;N?(R=N.getProxyState(),R!=3&&(N.subscribe("proxyStateChange",this.ew,this),YD$(this))):R=3;R!=0&&(z?this.ew(R):g.W9(function(){v.ew(R)},0)); (N=zF8())&&ES(this,N);this.subscribe("yt-remote-cast2-session-change",this.qd)},Hu=function(N){return new pB(N.N.getPlayerContextData())},YD$=function(N){g.h8("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(z){this.G.push(this.N.subscribe(z,g.iW(this.IVT,z),this))},N)},i18=function(N){g.h8(N.G,function(z){this.N.unsubscribeByKey(z)},N); N.G.length=0},oE=function(N){return N.getState()==1},D1=function(N,z){var v=N.B; v.V.length+v.W.length<50&&N.B.enqueue(z)},jA7=function(N,z,v){var R=Hu(N); Pu(R,v);R.playerState!=-1E3&&(R.playerState=z);bl(N,R)},tl=function(N,z,v){N.N.sendMessage(z,v)},bl=function(N,z){i18(N); N.N.setPlayerContextData(Z1U(z));YD$(N)},ES=function(N,z){N.W&&(N.W.removeUpdateListener(N.J),N.W.removeMediaListener(N.L),N.rI(null)); N.W=z;N.W&&(RE("Setting cast session: "+N.W.sessionId),N.W.addUpdateListener(N.J),N.W.addMediaListener(N.L),N.W.media.length&&N.rI(N.W.media[0]))},aKV=function(N){var z=N.V.media,v=N.V.customData; if(z&&v){var R=Hu(N);z.contentId!=R.videoId&&RE("Cast changing video to: "+z.contentId);R.videoId=z.contentId;R.playerState=v.playerState;Pu(R,N.V.getEstimatedTime());bl(N,R)}else RE("No cast media video. Ignoring state update.")},OS=function(N,z,v){return(0,g.Zl)(function(R){this.ri("Failed to "+z+" with cast v2 channel. Error code: "+R.code); R.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.ri("Retrying "+z+" using MDx browser channel."),tl(this,z,v))},N)},rn=function(N,z,v,R){R=R===void 0?!1:R; g.jJ.call(this);var C=this;this.G=NaN;this.K0=!1;this.J=this.Y=this.Vp=this.PL=NaN;this.qd=[];this.B=this.L=this.N=this.V=this.W=null;this.tO=N;this.Id=R;this.qd.push(g.dY(window,"beforeunload",function(){C.pF(2)})); this.Z=[];this.V=new pB;this.BL=z.id;this.Rd=z.idType;this.W=uiU(this.tO,v,this.RW,this.Rd=="shortLived",this.BL);this.W.listen("channelOpened",function(){QAV(C)}); this.W.listen("channelClosed",function(){IE("Channel closed");isNaN(C.G)?GD(!0):GD();C.dispose()}); this.W.listen("channelError",function(Z){GD();isNaN(C.Jp())?(Z==1&&C.Rd=="shortLived"&&C.publish("browserChannelAuthError",Z),IE("Channel error: "+Z+" without reconnection"),C.dispose()):(C.K0=!0,IE("Channel error: "+Z+" with reconnection in "+C.Jp()+" ms"),X0(C,2))}); this.W.listen("channelMessage",function(Z){LBV(C,Z)}); this.W.h9(z.token);this.subscribe("remoteQueueChange",function(){var Z=C.V.videoId;g.Sc()&&g.ka("yt-remote-session-video-id",Z)})},KB9=function(N){return g.G1(N.Z,function(z){return z.type=="LOUNGE_SCREEN"})},IE=function(N){vu("conn",N)},X0=function(N,z){N.publish("proxyStateChange",z)},lKE=function(N){N.G=g.W9(function(){IE("Connecting timeout"); N.pF(1)},2E4)},WBU=function(N){g.xA(N.G); N.G=NaN},GFw=function(N){g.xA(N.PL); N.PL=NaN},eFV=function(N){xq8(N); N.Vp=g.W9(function(){ul(N,"getNowPlaying")},2E4)},xq8=function(N){g.xA(N.Vp); N.Vp=NaN},QAV=function(N){IE("Channel opened"); N.K0&&(N.K0=!1,GFw(N),N.PL=g.W9(function(){IE("Timing out waiting for a screen.");N.pF(1)},15E3))},yim=function(N,z){var v=null; if(z){var R=KB9(N);R&&(v={clientName:R.clientName,deviceMake:R.brand,deviceModel:R.model,osVersion:R.osVersion})}g.cU("yt.mdx.remote.remoteClient_",v);z&&(WBU(N),GFw(N));v=N.W.ov()&&isNaN(N.G);z==v?z&&(X0(N,1),ul(N,"getSubtitlesTrack")):z?(N.B_()&&N.V.reset(),X0(N,1),ul(N,"getNowPlaying"),Ji$(N)):N.pF(1)},fKP=function(N,z){var v=z.params.videoId; delete z.params.videoId;v==N.V.videoId&&(g.wE(z.params)?N.V.trackData=null:N.V.trackData=z.params,N.publish("remotePlayerChange"))},dqm=function(N,z,v){var R=z.params.videoId||z.params.video_id,C=parseInt(z.params.currentIndex,10); N.V.listId=z.params.listId||N.V.listId;SE(N.V,R,C);N.publish("remoteQueueChange",v)},T3r=function(N,z){z.params=z.params||{}; dqm(N,z,"NOW_PLAYING_MAY_CHANGE");sAl(N,z);N.publish("autoplayDismissed")},sAl=function(N,z){var v=parseInt(z.params.currentTime||z.params.current_time,10); Pu(N.V,isNaN(v)?0:v);v=parseInt(z.params.state,10);v=isNaN(v)?-1:v;v==-1&&N.V.playerState==-1E3&&(v=-1E3);N.V.playerState=v;v=Number(z.params.loadedTime);N.V.Y=isNaN(v)?0:v;N.V.wK(Number(z.params.duration));v=N.V;var R=Number(z.params.liveIngestionTime);v.Z=R;v.W=isNaN(R)?!1:!0;v=N.V;R=Number(z.params.seekableStartTime);z=Number(z.params.seekableEndTime);v.N=isNaN(R)?0:R;v.V=isNaN(z)?0:z;N.V.playerState==1?eFV(N):xq8(N);N.publish("remotePlayerChange")},FBV=function(N,z){if(N.V.playerState!=-1E3){var v= 1085; switch(parseInt(z.params.adState,10)){case 1:v=1081;break;case 2:v=1084;break;case 0:v=1083}N.V.playerState=v;z=parseInt(z.params.currentTime,10);Pu(N.V,isNaN(z)?0:z);N.publish("remotePlayerChange")}},nL8=function(N,z){var v=z.params.muted=="true"; N.V.volume=parseInt(z.params.volume,10);N.V.muted=v;N.publish("remotePlayerChange")},mq5=function(N,z){N.L=z.params.videoId; N.publish("nowAutoplaying",parseInt(z.params.timeout,10))},$qV=function(N,z){N.L=z.params.videoId||null; N.publish("autoplayUpNext",N.L)},Uq8=function(N,z){N.B=z.params.autoplayMode; N.publish("autoplayModeChange",N.B);N.B=="DISABLED"&&N.publish("autoplayDismissed")},B3W=function(N,z){var v=z.params.hasNext=="true"; N.V.Ab=z.params.hasPrevious=="true";N.V.sA=v;N.publish("previousNextChange")},LBV=function(N,z){z=z.message; z.params?IE("Received: action="+z.action+", params="+g.bX(z.params)):IE("Received: action="+z.action+" {}");switch(z.action){case "loungeStatus":z=RM(z.params.devices);N.Z=g.OL(z,function(R){return new jl(R)}); z=!!g.G1(N.Z,function(R){return R.type=="LOUNGE_SCREEN"}); yim(N,z);z=N.UY("mlm");N.publish("multiStateLoopEnabled",z);break;case "loungeScreenDisconnected":g.dE(N.Z,function(R){return R.type=="LOUNGE_SCREEN"}); yim(N,!1);break;case "remoteConnected":var v=new jl(RM(z.params.device));g.G1(N.Z,function(R){return R.equals(v)})||UVw(N.Z,v); break;case "remoteDisconnected":v=new jl(RM(z.params.device));g.dE(N.Z,function(R){return R.equals(v)}); break;case "gracefulDisconnect":break;case "playlistModified":dqm(N,z,"QUEUE_MODIFIED");break;case "nowPlaying":T3r(N,z);break;case "onStateChange":sAl(N,z);break;case "onAdStateChange":FBV(N,z);break;case "onVolumeChanged":nL8(N,z);break;case "onSubtitlesTrackChanged":fKP(N,z);break;case "nowAutoplaying":mq5(N,z);break;case "autoplayDismissed":N.publish("autoplayDismissed");break;case "autoplayUpNext":$qV(N,z);break;case "onAutoplayModeChanged":Uq8(N,z);break;case "onHasPreviousNextChanged":B3W(N, z);break;case "requestAssistedSignIn":N.publish("assistedSignInRequested",z.params.authCode);break;case "onLoopModeChanged":N.publish("loopModeChange",z.params.loopMode);break;default:IE("Unrecognized action: "+z.action)}},Ji$=function(N){g.xA(N.J); N.J=g.W9(function(){N.pF(1)},864E5)},ul=function(N,z,v){v?IE("Sending: action="+z+", params="+g.bX(v)):IE("Sending: action="+z); N.W.sendMessage(z,v)},AiE=function(N){il.call(this,"ScreenServiceProxy"); this.zl=N;this.V=[];this.V.push(this.zl.$_s("screenChange",(0,g.Zl)(this.El,this)));this.V.push(this.zl.$_s("onlineScreenChange",(0,g.Zl)(this.um0,this)))},VD9=function(N,z){gAP(); if(!x$||!x$.get("yt-remote-disable-remote-module-for-dev")){z=g.XI("MDX_CONFIG")||z;s0E();mL5();cu||(cu=new wu(z?z.loungeApiHost:void 0),p9W()&&(cu.V="/api/loungedev"));q5||(q5=g.qx("yt.mdx.remote.deferredProxies_")||[],g.cU("yt.mdx.remote.deferredProxies_",q5));gL$();var v=M5();if(!v){var R=new KB(cu,z?z.disableAutomaticScreenCache||!1:!1);g.cU("yt.mdx.remote.screenService_",R);v=M5();var C={};z&&(C={appId:z.appId,disableDial:z.disableDial,theme:z.theme,loadCastApiSetupScript:z.loadCastApiSetupScript, disableCastApi:z.disableCastApi,enableDialLoungeToken:z.enableDialLoungeToken,enableCastLoungeToken:z.enableCastLoungeToken,forceMirroring:z.forceMirroring});g.cU("yt.mdx.remote.enableConnectWithInitialState_",z?z.enableConnectWithInitialState||!1:!1);cqW(N,R,function(Z){Z?wn()&&gn(wn(),"YouTube TV"):R.subscribe("onlineScreenChange",function(){el("yt-remote-receiver-availability-change")})},C)}z&&!g.qx("yt.mdx.remote.initialized_")&&(g.cU("yt.mdx.remote.initialized_",!0),N6("Initializing: "+g.bX(z)), zv.push(g.C1("yt-remote-cast2-api-ready",function(){el("yt-remote-api-ready")})),zv.push(g.C1("yt-remote-cast2-availability-change",function(){el("yt-remote-receiver-availability-change")})),zv.push(g.C1("yt-remote-cast2-receiver-selected",function(){vY(null); el("yt-remote-auto-connect","cast-selector-receiver")})),zv.push(g.C1("yt-remote-cast2-receiver-resumed",function(){el("yt-remote-receiver-resumed","cast-selector-receiver")})),zv.push(g.C1("yt-remote-cast2-session-change",pa9)),zv.push(g.C1("yt-remote-connection-change",function(Z){Z?gn(wn(),"YouTube TV"):Rb()||(gn(null,null),N3w())})),zv.push(g.C1("yt-remote-cast2-session-failed",function(){el("yt-remote-connection-failed")})),N=kFZ(),z.isAuto&&(N.id+="#dial"),C=z.capabilities||[],g.yj("desktop_enable_autoplay")&& C.push("atp"),C.length>0&&(N.capabilities=C),N.name=z.device,N.app=z.app,(z=z.theme)&&(N.theme=z),N6(" -- with channel params: "+g.bX(N)),N?(g.ka("yt-remote-session-app",N.app),g.ka("yt-remote-session-name",N.name)):(g.VJ("yt-remote-session-app"),g.VJ("yt-remote-session-name")),g.cU("yt.mdx.remote.channelParams_",N),v.start(),wn()||PDP())}},SD7=function(){var N=M5().zl.$_gos(); var z=CE();z&&Ze()&&(dL8(N,z)||N.push(z));return fzw(N)},hFU=function(){var N=ELr(); !N&&Bu()&&wdl()&&(N={key:"cast-selector-receiver",name:wdl()});return N},ELr=function(){var N=SD7(),z=CE(); z||(z=Rb());return g.G1(N,function(v){return z&&QD(z,v.key)?!0:!1})},CE=function(){var N=wn(); if(!N)return null;var z=M5().tR();return Ka(z,N)},pa9=function(N){N6("remote.onCastSessionChange_: "+La(N)); if(N){var z=CE();if(z&&z.id==N.id){if(gn(z.id,"YouTube TV"),N.idType=="shortLived"&&(N=N.token))Yq&&(Yq.token=N),(z=Ze())&&z.h9(N)}else z&&iS(),jX(N,1)}else Ze()&&iS()},iS=function(){Al()?US().stopSession():$O("stopSession called before API ready."); var N=Ze();N&&(N.disconnect(1),H1w(null))},oLw=function(){var N=Ze(); return!!N&&N.getProxyState()!=3},N6=function(N){vu("remote",N)},M5=function(){if(!Dqw){var N=g.qx("yt.mdx.remote.screenService_"); Dqw=N?new AiE(N):null}return Dqw},wn=function(){return g.qx("yt.mdx.remote.currentScreenId_")},b11=function(N){g.cU("yt.mdx.remote.currentScreenId_",N)},tD9=function(){return g.qx("yt.mdx.remote.connectData_")},vY=function(N){g.cU("yt.mdx.remote.connectData_",N)},Ze=function(){return g.qx("yt.mdx.remote.connection_")},H1w=function(N){var z=Ze(); vY(null);N||b11("");g.cU("yt.mdx.remote.connection_",N);q5&&(g.h8(q5,function(v){v(N)}),q5.length=0); z&&!N?el("yt-remote-connection-change",!1):!z&&N&&el("yt-remote-connection-change",!0)},Rb=function(){var N=g.Sc(); if(!N)return null;var z=M5();if(!z)return null;z=z.tR();return Ka(z,N)},jX=function(N,z){wn(); CE()&&CE();if(ab)Yq=N;else{b11(N.id);var v=g.qx("yt.mdx.remote.enableConnectWithInitialState_")||!1;N=new rn(cu,N,kFZ(),v);N.connect(z,tD9());N.subscribe("beforeDisconnect",function(R){el("yt-remote-before-disconnect",R)}); N.subscribe("beforeDispose",function(){Ze()&&(Ze(),H1w(null))}); N.subscribe("browserChannelAuthError",function(){var R=CE();R&&R.idType=="shortLived"&&(Al()?US().handleBrowserChannelAuthError():$O("refreshLoungeToken called before API ready."))}); H1w(N)}},PDP=function(){var N=Rb(); N?(N6("Resume connection to: "+La(N)),jX(N,0)):(GD(),N3w(),N6("Skipping connecting because no session screen found."))},gL$=function(){var N=kFZ(); if(g.wE(N)){N=WQ();var z=g.Pe("yt-remote-session-name")||"",v=g.Pe("yt-remote-session-app")||"";N={device:"REMOTE_CONTROL",id:N,name:z,app:v,mdxVersion:3};N.authuser=String(g.XI("SESSION_INDEX","0"));(z=g.XI("DELEGATED_SESSION_ID"))&&(N.pageId=String(z));g.cU("yt.mdx.remote.channelParams_",N)}},kFZ=function(){return g.qx("yt.mdx.remote.channelParams_")||{}},Xa7=function(N,z,v){g.H.call(this); var R=this;this.V=N;this.C=z;this.rH=v;this.events=new g.VV(this);this.B=!1;this.G=new g.Ro(64);this.W=new g.cn(this.gp,500,this);this.Z=new g.cn(this.q5,1E3,this);this.Y=new fa(this.wDd,0,this);this.N={};this.J=new g.cn(this.nQ,1E3,this);this.L=new g.N4(this.seekTo,1E3,this);this.qd=this.events.S(this.C,"onVolumeChange",function(C){O18(R,C)}); g.b(this,this.events);this.events.S(z,"onCaptionsTrackListChanged",this.C$T);this.events.S(z,"captionschanged",this.xdW);this.events.S(z,"captionssettingschanged",this.Zd);this.events.S(z,"videoplayerreset",this.zN);this.events.S(z,"mdxautoplaycancel",function(){R.rH.y9()}); z.X("enable_mdx_video_play_directly")&&this.events.S(z,"videodatachange",function(){IK5(R.V)||QB(R)||LE(R,0)}); N=this.rH;N.HL();N.subscribe("proxyStateChange",this.Nf,this);N.subscribe("remotePlayerChange",this.C2,this);N.subscribe("remoteQueueChange",this.zN,this);N.subscribe("previousNextChange",this.P7,this);N.subscribe("nowAutoplaying",this.qf,this);N.subscribe("autoplayDismissed",this.Yg,this);g.b(this,this.W);g.b(this,this.Z);g.b(this,this.Y);g.b(this,this.J);g.b(this,this.L);this.Zd();this.zN();this.C2()},O18=function(N,z){if(QB(N)){N.rH.unsubscribe("remotePlayerChange",N.C2,N); var v=Math.round(z.volume);z=!!z.muted;var R=Hu(N.rH);if(v!==R.volume||z!==R.muted)N.rH.setVolume(v,z),N.J.start();N.rH.subscribe("remotePlayerChange",N.C2,N)}},ri1=function(N){N.G4(0); N.W.stop();N.W5(new g.Ro(64))},uX1=function(N,z){if(QB(N)&&!N.B){var v=null; z&&(v={style:N.C.getSubtitlesUserSettings()},Object.assign(v,z));N.rH.Kn(N.C.getVideoData(1).videoId,v);N.N=g.h(Hu(N.rH).trackData)}},LE=function(N,z){var v=N.C.getPlaylist(); if(v==null?0:v.listId){var R=v.index;var C=v.listId.toString()}v=N.C.getVideoData(1);N.rH.playVideo(v.videoId,z,R,C,v.playerParams,v.BL,$V9(v));N.W5(new g.Ro(1))},ciV=function(N,z){if(z){var v=N.C.getOption("captions","tracklist",{Nm:1}); v&&v.length?(N.C.setOption("captions","track",z),N.B=!1):(N.C.loadModule("captions"),N.B=!0)}else N.C.setOption("captions","track",{})},QB=function(N){return Hu(N.rH).videoId===N.C.getVideoData(1).videoId},qD7=function(N,z){g.E4.call(this,N); this.V=z},KE=function(){g.X.call(this,{K:"div", U:"ytp-mdx-popup-dialog",T:{role:"dialog"},j:[{K:"div",U:"ytp-mdx-popup-dialog-inner-content",j:[{K:"div",U:"ytp-mdx-popup-title",OT:"No has iniciado sesi\u00f3n"},{K:"div",U:"ytp-mdx-popup-description",OT:"Los v\u00eddeos que veas podr\u00edan aparecer en el historial de reproducciones de la TV e influir en las recomendaciones. Puedes evitarlo si cancelas e inicias sesi\u00f3n en YouTube desde tu ordenador."},{K:"div",U:"ytp-mdx-privacy-popup-buttons",j:[{K:"button",GU:["ytp-button","ytp-mdx-privacy-popup-cancel"], OT:"Cancelar"},{K:"button",GU:["ytp-button","ytp-mdx-privacy-popup-confirm"],OT:"Confirmar"}]}]}]});this.fade=new g.zX(this,250);this.cancelButton=this.e8("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.e8("ytp-mdx-privacy-popup-confirm");g.b(this,this.fade);this.S(this.cancelButton,"click",this.V);this.S(this.confirmButton,"click",this.W)},lS=function(N){g.X.call(this,{K:"div", U:"ytp-remote",j:[{K:"div",U:"ytp-remote-display-status",j:[{K:"div",U:"ytp-remote-display-status-icon",j:[g.iJv()]},{K:"div",U:"ytp-remote-display-status-text",OT:"{{statustext}}"}]}]});this.api=N;this.fade=new g.zX(this,250);g.b(this,this.fade);this.S(N,"presentingplayerstatechange",this.onStateChange);this.lF(N.getPlayerStateObject())},WY=function(N,z){g.Ph.call(this,"Reproducir en",1,N,z); this.C=N;this.jE={};this.S(N,"onMdxReceiversChange",this.N);this.S(N,"presentingplayerstatechange",this.N);this.N()},MDU=function(N){g.GI.call(this,N); this.tb={key:yrr(),name:"Este ordenador"};this.Ak=null;this.subscriptions=[];this.KB=this.rH=null;this.jE=[this.tb];this.pE=this.tb;this.Hc=new g.Ro(64);this.Dq=0;this.a4=-1;this.h_=!1;this.cK=this.l8=this.RL=null;if(!g.V1(this.player.D())&&!g.S0(this.player.D())){N=this.player;var z=g.G8(N);z&&(z=z.cW())&&(z=new WY(N,z),g.b(this,z));z=new lS(N);g.b(this,z);g.PX(N,z.element,4);this.RL=new KE;g.b(this,this.RL);g.PX(N,this.RL.element,4);this.h_=!!Rb()}},Gv=function(N){N.l8&&(N.player.removeEventListener("presentingplayerstatechange", N.l8),N.l8=null)},wa7=function(N,z,v){N.Hc=v; N.player.publish("presentingplayerstatechange",new g.KZ(v,z))},xq=function(N,z){if(z.key!==N.pE.key)if(z.key===N.tb.key)iS(); else if(IK5(N)&&N07(N),N.pE=z,!N.player.D().X("disable_mdx_connection_in_mdx_module_for_music_web")||!g.S0(N.player.D())){var v=N.player.getPlaylistId();var R=N.player.getVideoData(1);var C=R.videoId;if(!v&&!C||(N.player.getAppState()===2||N.player.getAppState()===1)&&N.player.D().X("should_clear_video_data_on_player_cued_unstarted"))R=null;else{var Z=N.player.getPlaylist();if(Z){var Y=[];for(var Q=0;Q2*this.size&&ig(this),!0):!1}; g.J.get=function(N,z){return ZG(this.W,N)?this.W[N]:z}; g.J.set=function(N,z){ZG(this.W,N)||(this.size+=1,this.V.push(N),this.GX++);this.W[N]=z}; g.J.forEach=function(N,z){for(var v=this.S7(),R=0;R=R.V.length)return g.aT;var Z=R.V[z++];return g.BT(N?Z:R.W[Z])}; return C}; var uIr={PLo:"atp",jU8:"ska",zo8:"que",d4W:"mus",Y5L:"sus",nKd:"dsp",H40:"seq",rRO:"mic",riU:"dpa",toL:"cds",Cp1:"mlm",zWp:"dsdtr",M$L:"ntb",XpW:"vsp",Itd:"scn",rkp:"rpe",VMS:"dcn",Wyp:"dcp",m4L:"pas",Aio:"drq",uBO:"opf",ci8:"els",tMW:"isg",L3S:"svq",GDU:"mvp",KAd:"ads",nvT:"stcp",uzS:"sads",OrS:"dloc"},W4V={BQT:"u",Uod:"cl",DES:"k",ZeT:"i",TDp:"cr",t$U:"m",yi0:"g",sE:"up"},PR1={Kz:"adPlaying",b7:"onAdStateChange"},VtP={L5l:"nowPlaying",lGT:"onStateChange",Kz:"adPlaying",b7:"onAdStateChange",P0:"nowPlayingShorts", Zm:"onShortsStateChange"},S55={P0:"nowPlayingShorts",Zm:"onShortsStateChange"};jl.prototype.equals=function(N){return N?this.id==N.id:!1}; var nAW="",x$=null;kU8.prototype.flush=function(N,z){N=N===void 0?[]:N;z=z===void 0?!1:z;if(g.yj("enable_client_streamz_web")){N=g.f(N);for(var v=N.next();!v.done;v=N.next())v=g.NPm(v.value),v={serializedIncrementBatch:g.zV(v.W())},g.aX("streamzIncremented",v,{sendIsolatedPayload:z})}}; var Jg,DL1=V5r("loadCastFramework")||V5r("loadCastApplicationFramework"),OX5=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Lm(fa,g.H);g.J=fa.prototype;g.J.tC=function(N){this.N=arguments;this.V=!1;this.SK?this.Z=g.jV()+this.fO:this.SK=g.hL(this.B,this.fO)}; g.J.stop=function(){this.SK&&(g.u7.clearTimeout(this.SK),this.SK=null);this.Z=null;this.V=!1;this.N=[]}; g.J.pause=function(){++this.W}; g.J.resume=function(){this.W&&(--this.W,!this.W&&this.V&&(this.V=!1,this.G.apply(null,this.N)))}; g.J.AO=function(){this.stop();fa.gi.AO.call(this)}; g.J.I1=function(){this.SK&&(g.u7.clearTimeout(this.SK),this.SK=null);this.Z?(this.SK=g.hL(this.B,this.Z-g.jV()),this.Z=null):this.W?this.V=!0:(this.V=!1,this.G.apply(null,this.N))};du.prototype.stringify=function(N){return g.u7.JSON.stringify(N,void 0)}; du.prototype.parse=function(N){return g.u7.JSON.parse(N,void 0)};g.Lm(X9V,g.q_);g.Lm(rr$,g.q_);var ub8=null;g.Lm(qFP,g.q_);g.Lm(M5P,g.q_);g.Lm(w9U,g.q_);na.prototype.debug=function(){}; na.prototype.info=function(){}; na.prototype.warning=function(){};var iH8={},Yvm={};g.J=m8.prototype;g.J.setTimeout=function(N){this.ET=N}; g.J.Ho=function(N){N=N.target;var z=this.S8;z&&g.uX(N)==3?z.tj():this.jO(N)}; g.J.jO=function(N){try{if(N==this.V)a:{var z=g.uX(this.V),v=this.V.W,R=this.V.getStatus();if(!(z<3)&&(z!=3||this.V&&(this.W.W||g.qn(this.V)||g.Mn(this.V)))){this.Id||z!=4||v==7||(v==8||R<=0?s7(3):s7(2));Qs7(this);var C=this.V.getStatus();this.A0=C;var Z=ZH1(this);if(this.G=C==200){if(this.zE&&!this.UT){b:{if(this.V){var Y=g.wH(this.V,"X-HTTP-Initial-Response");if(Y&&!g.ez(Y)){var Q=Y;break b}}Q=null}if(N=Q)this.UT=!0,yVm(this,N);else{this.G=!1;this.B=3;TD(12);U7(this);BQ(this);break a}}if(this.Rd){N= !0;for(var L;!this.Id&&this.L0&&!this.CV&&(this.CV=!0,this.Z.tF(this)):(U7(this),BQ(this))}else yVm(this,Z);z==4&&U7(this);this.G&&!this.Id&&(z==4?L69(this.Z,this):(this.G=!1,$$(this)))}else g.Ty2(this.V),C==400&&Z.indexOf("Unknown SID")> 0?(this.B=3,TD(12)):(this.B=0,TD(13)),U7(this),BQ(this)}}}catch(K){}finally{}}; g.J.cancel=function(){this.Id=!0;U7(this)}; g.J.pT=function(){this.qd=null;var N=Date.now();N-this.kJ>=0?(this.BL!=2&&(s7(3),TD(17)),U7(this),this.B=2,BQ(this)):a_U(this,this.kJ-N)}; g.J.getLastError=function(){return this.B}; g.J.Uy=function(){return this.V};d01.prototype.cancel=function(){this.Z=TY8(this);if(this.W)this.W.cancel(),this.W=null;else if(this.V&&this.V.size!==0){for(var N=g.f(this.V.values()),z=N.next();!z.done;z=N.next())z.value.cancel();this.V.clear()}};g.J=U0$.prototype;g.J.mB=8;g.J.fu=1;g.J.connect=function(N,z,v,R){TD(0);this.UR=N;this.Id=z||{};v&&R!==void 0&&(this.Id.OSID=v,this.Id.OAID=R);this.UT=this.yh;this.tO=x0w(this,null,this.UR);k$(this)}; g.J.disconnect=function(){AV1(this);if(this.fu==3){var N=this.vL++,z=this.tO.clone();g.Kj(z,"SID",this.N);g.Kj(z,"RID",N);g.Kj(z,"TYPE","terminate");Sl(this,z);N=new m8(this,this.N,N);N.BL=2;N.Y=zD(z.clone());z=!1;if(g.u7.navigator&&g.u7.navigator.sendBeacon)try{z=g.u7.navigator.sendBeacon(N.Y.toString(),"")}catch(v){}!z&&g.u7.Image&&((new Image).src=N.Y,z=!0);z||(N.V=Rtr(N.Z,null),N.V.send(N.Y));N.PL=Date.now();$$(N)}Sv$(this)}; g.J.QX=function(){return this.fu==0}; g.J.getState=function(){return this.fu}; g.J.w3=function(N){if(this.G)if(this.G=null,this.fu==1){if(!N){this.vL=Math.floor(Math.random()*1E5);N=this.vL++;var z=new m8(this,"",N),v=this.J;this.A0&&(v?(v=g.vZ(v),g.CI(v,this.A0)):v=this.A0);this.L!==null||this.kJ||(z.tO=v,v=null);var R;if(this.gW)a:{for(var C=R=0;C4096){R=C;break a}if(R===4096||C===this.Z.length-1){R=C+1;break a}}R= 1E3}else R=1E3;R=k6Z(this,z,R);C=this.tO.clone();g.Kj(C,"RID",N);g.Kj(C,"CVER",22);this.Rd&&g.Kj(C,"X-HTTP-Session-Id",this.Rd);Sl(this,C);v&&(this.kJ?R="headers="+g.G3(g.oj2(v))+"&"+R:this.L&&g.xZ(C,this.L,v));G65(this.W,z);this.X6&&g.Kj(C,"TYPE","init");this.gW?(g.Kj(C,"$req",R),g.Kj(C,"SID","null"),z.zE=!0,va5(z,C,null)):va5(z,C,R);this.fu=2}}else this.fu==3&&(N?Pyw(this,N):this.Z.length==0||ssw(this.W)||Pyw(this))}; g.J.QZ=function(){this.Y=null;Vcl(this);if(this.Dx&&!(this.ET||this.V==null||this.Ui<=0)){var N=2*this.Ui;this.K0=FA((0,g.Zl)(this.yOL,this),N)}}; g.J.yOL=function(){this.K0&&(this.K0=null,this.UT=!1,this.ET=!0,TD(10),gu(this),Vcl(this))}; g.J.tF=function(N){this.V==N&&this.Dx&&!this.ET&&(BYP(this),this.ET=!0,TD(11))}; g.J.Bo=function(){this.qd!=null&&(this.qd=null,gu(this),l_$(this),TD(19))}; g.J.pDp=function(N){N?TD(2):TD(1)}; g.J.isActive=function(){return!!this.B&&this.B.isActive(this)}; g.J=ht8.prototype;g.J.JL=function(){}; g.J.Tk=function(){}; g.J.vI=function(){}; g.J.En=function(){}; g.J.isActive=function(){return!0}; g.J.Mn=function(){};g.Lm(hg,g.Ws);hg.prototype.open=function(){this.V.B=this.Z;this.G&&(this.V.BL=!0);this.V.connect(this.B,this.W||void 0)}; hg.prototype.close=function(){this.V.disconnect()}; hg.prototype.send=function(N){var z=this.V;if(typeof N==="string"){var v={};v.__data__=N;N=v}else this.N&&(v={},v.__data__=g.bX(N),N=v);z.Z.push(new f_W(z.BH++,N));z.fu==3&&k$(z)}; hg.prototype.AO=function(){this.V.B=null;delete this.Z;this.V.disconnect();delete this.V;hg.gi.AO.call(this)}; g.Lm(oam,X9V);g.Lm(D0E,rr$);g.Lm(E7,ht8);E7.prototype.JL=function(){this.V.dispatchEvent("m")}; E7.prototype.Tk=function(N){this.V.dispatchEvent(new oam(N))}; E7.prototype.vI=function(N){this.V.dispatchEvent(new D0E(N))}; E7.prototype.En=function(){this.V.dispatchEvent("n")};var oM=new g.Ws;g.y(OHZ,g.q_);g.J=bg.prototype;g.J.Ls=null;g.J.qX=!1;g.J.x6=null;g.J.He=null;g.J.nJ=null;g.J.ZK=null;g.J.Eq=null;g.J.ev=null;g.J.FF=null;g.J.qa=null;g.J.KA=0;g.J.Uh=null;g.J.Ns=null;g.J.Uv=null;g.J.J5=-1;g.J.XN=!0;g.J.TO=!1;g.J.pR=0;g.J.b2=null;var qvw={},cVE={};g.J=bg.prototype;g.J.setTimeout=function(N){this.W=N}; g.J.LT=function(N){N=N.target;var z=this.b2;z&&g.uX(N)==3?z.tj():this.n$(N)}; g.J.n$=function(N){try{if(N==this.qa)a:{var z=g.uX(this.qa),v=this.qa.W,R=this.qa.getStatus();if(g.uU&&!g.$Q("420+")){if(z<4)break a}else if(z<3||z==3&&!g.qn(this.qa))break a;this.TO||z!=4||v==7||(v==8||R<=0?this.V.eW(3):this.V.eW(2));N8$(this);var C=this.qa.getStatus();this.J5=C;var Z=g.qn(this.qa);if(this.qX=C==200){z==4&&tg(this);if(this.Rd){for(N=!0;!this.TO&&this.KA0?(this.Uv=3,DG(13)):(this.Uv=0,DG(14)),tg(this),z6Z(this)}}catch(Q){}finally{}}; g.J.cancel=function(){this.TO=!0;tg(this)}; g.J.Xf=function(){this.x6=null;var N=Date.now();N-this.He>=0?(this.ZK!=2&&this.V.eW(3),tg(this),this.Uv=2,DG(18),z6Z(this)):weV(this,this.He-N)}; g.J.getLastError=function(){return this.Uv};g.J=ZJP.prototype;g.J.Be=null;g.J.q4=null;g.J.yN=!1;g.J.X_=null;g.J.n8=null;g.J.p7=-1;g.J.RO=null;g.J.m0=null;g.J.connect=function(N){this.X_=N;N=IM(this.V,null,this.X_);DG(3);Date.now();var z=this.V.J;z!=null?(this.RO=z[0],(this.m0=z[1])?(this.n8=1,Y5$(this)):(this.n8=2,iJw(this))):(vQ(N,"MODE","init"),this.q4=new bg(this),this.q4.Ls=this.Be,rVZ(this.q4,N,!1,null,!0),this.n8=0)}; g.J.Px=function(N){if(N)this.n8=2,iJw(this);else{DG(4);var z=this.V;z.Bg=z.cT.p7;cQ(z,9)}N&&this.eW(2)}; g.J.sB=function(N){return this.V.sB(N)}; g.J.abort=function(){this.q4&&(this.q4.cancel(),this.q4=null);this.p7=-1}; g.J.QX=function(){return!1}; g.J.iX=function(N,z){this.p7=N.J5;if(this.n8==0)if(z){try{var v=this.W.parse(z)}catch(R){N=this.V;N.Bg=this.p7;cQ(N,2);return}this.RO=v[0];this.m0=v[1]}else N=this.V,N.Bg=this.p7,cQ(N,2);else this.n8==2&&(this.yN?(DG(7),Date.now()):z=="11111"?(DG(6),this.yN=!0,Date.now(),this.p7=200,this.q4.cancel(),DG(12),XA(this.V,this,!0)):(DG(8),Date.now(),this.yN=!1))}; g.J.Mh=function(){this.p7=this.q4.J5;if(this.q4.qX)this.n8==0?this.m0?(this.n8=1,Y5$(this)):(this.n8=2,iJw(this)):this.n8==2&&(this.yN?(DG(12),XA(this.V,this,!0)):(DG(11),XA(this.V,this,!1)));else{this.n8==0?DG(9):this.n8==2&&DG(10);var N=this.V;this.q4.getLastError();N.Bg=this.p7;cQ(N,2)}}; g.J.oS=function(){return this.V.oS()}; g.J.isActive=function(){return this.V.isActive()}; g.J.eW=function(N){this.V.eW(N)};g.J=jXw.prototype;g.J.oU=null;g.J.kL=null;g.J.z0=null;g.J.o_=null;g.J.UB=null;g.J.CA=null;g.J.oW=null;g.J.LR=null;g.J.gR=0;g.J.Ff=0;g.J.YB=null;g.J.V7=null;g.J.Hm=null;g.J.Sq=null;g.J.cT=null;g.J.gw=null;g.J.Dv=-1;g.J.aW=-1;g.J.Bg=-1;g.J.Y6=0;g.J.fC=0;g.J.uH=8;var zCZ={OK:0,K38:2,qA0:4,U4S:5,sMT:6,STOP:7,zr:8,NDl:9,bOd:10,ZOp:11,RTW:12};g.Lm(QX7,g.q_);g.Lm(LeV,g.q_);g.J=jXw.prototype; g.J.connect=function(N,z,v,R,C){DG(0);this.UB=z;this.kL=v||{};R&&C!==void 0&&(this.kL.OSID=R,this.kL.OAID=C);this.Y?(HQ((0,g.Zl)(this.dS,this,N),100),l4U(this)):this.dS(N)}; g.J.disconnect=function(){Wel(this);if(this.V==3){var N=this.gR++,z=this.CA.clone();g.Kj(z,"SID",this.N);g.Kj(z,"RID",N);g.Kj(z,"TYPE","terminate");ug(this,z);N=new bg(this,this.N,N);N.ZK=2;N.Eq=zD(z.clone());(new Image).src=N.Eq.toString();N.nJ=Date.now();uSm(N)}FeW(this)}; g.J.dS=function(N){this.cT=new ZJP(this);this.cT.Be=this.oU;this.cT.W=this.B;this.cT.connect(N)}; g.J.QX=function(){return this.V==0}; g.J.getState=function(){return this.V}; g.J.Vx=function(N){this.V7=null;y6$(this,N)}; g.J.qt=function(){this.Hm=null;this.o_=new bg(this,this.N,"rpc",this.L);this.o_.Ls=this.oU;this.o_.pR=0;var N=this.oW.clone();g.Kj(N,"RID","rpc");g.Kj(N,"SID",this.N);g.Kj(N,"CI",this.gw?"0":"1");g.Kj(N,"AID",this.Dv);ug(this,N);g.Kj(N,"TYPE","xmlhttp");rVZ(this.o_,N,!0,this.LR,!1)}; g.J.iX=function(N,z){if(this.V!=0&&(this.o_==N||this.z0==N))if(this.Bg=N.J5,this.z0==N&&this.V==3)if(this.uH>7){try{var v=this.B.parse(z)}catch(R){v=null}if(Array.isArray(v)&&v.length==3)if(N=v,N[0]==0)a:{if(!this.Hm){if(this.o_)if(this.o_.nJ+3E30)){if(R=z==1)this.z0||this.V7||this.V==1||this.Y6>=2?R=!1:(this.V7=HQ((0,g.Zl)(this.Vx,this,N),dpU(this,this.Y6)),this.Y6++, R=!0);R=!(R||z==2&&sXZ(this))}if(R)switch(v){case 1:cQ(this,5);break;case 4:cQ(this,10);break;case 3:cQ(this,6);break;case 7:cQ(this,12);break;default:cQ(this,2)}}}; g.J.Ul=function(N){if(!g.J8(arguments,this.V))throw Error("Unexpected channel state: "+this.V);}; g.J.If8=function(N){N?DG(2):(DG(1),T8r(this,8))}; g.J.sB=function(N){if(N)throw Error("Can't create secondary domain capable XhrIo object.");N=new g.IZ;N.L=!1;return N}; g.J.isActive=function(){return!!this.YB&&this.YB.isActive(this)}; g.J.eW=function(N){var z=oM;z.dispatchEvent(new LeV(z,N))}; g.J.oS=function(){return!1}; g.J=np5.prototype;g.J.A8=function(){}; g.J.O8=function(){}; g.J.zj=function(){}; g.J.Ws=function(){}; g.J.F_=function(){}; g.J.Ps=function(){return{}}; g.J.isActive=function(){return!0};g.J=mpU.prototype;g.J.enqueue=function(N){this.W.push(N)}; g.J.isEmpty=function(){return this.V.length===0&&this.W.length===0}; g.J.clear=function(){this.V=[];this.W=[]}; g.J.contains=function(N){return g.J8(this.V,N)||g.J8(this.W,N)}; g.J.remove=function(N){var z=this.V;var v=(0,g.Gu$)(z,N);v>=0?(g.yU(z,v),z=!0):z=!1;return z||g.fm(this.W,N)}; g.J.IU=function(){for(var N=[],z=this.V.length-1;z>=0;--z)N.push(this.V[z]);z=this.W.length;for(var v=0;v=vEr.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(N=vEr[this.W],this.SK=g.W9((0,g.Zl)(this.w0,this),N),this.W++):this.publish("pairingFailed",Error("Server error "+N.status))}; g.J.fT=function(){this.V=null;this.publish("pairingFailed",Error("Server not responding"))}; var vEr=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Lm(aE,il);g.J=aE.prototype;g.J.start=function(){jE(this)&&this.publish("screenChange");!g.Pe("yt-remote-lounge-token-expiration")&&iGU(this);g.xA(this.V);this.V=g.W9((0,g.Zl)(this.start,this),1E4)}; g.J.add=function(N,z){jE(this);Ra7(this,N);Q7(this,!1);this.publish("screenChange");z(N);N.token||iGU(this)}; g.J.remove=function(N,z){var v=jE(this);ZG$(this,N)&&(Q7(this,!1),v=!0);z(N);v&&this.publish("screenChange")}; g.J.oJ=function(N,z,v,R){var C=jE(this),Z=this.get(N.id);Z?(Z.name!=z&&(Z.name=z,Q7(this,!1),C=!0),v(N)):R(Error("no such local screen."));C&&this.publish("screenChange")}; g.J.AO=function(){g.xA(this.V);aE.gi.AO.call(this)}; g.J.xt=function(N){jE(this);var z=this.screens.length;N=N&&N.screens||[];for(var v=N.length,R=0;R20)break a;Q=z(Z,Y)}Z=Q}C.name=Z}v(ll(this,C))},this), onError:(0,g.Zl)(function(C){R(Error("pairing request failed: "+C.status))},this), onTimeout:(0,g.Zl)(function(){R(Error("pairing request timed out."))},this)})}; g.J.AO=function(){g.Lc(this.W);g.Lc(this.V);KB.gi.AO.call(this)}; g.J.TZ=function(){yql(this);this.publish("screenChange");this.V.update()}; KB.prototype.dispose=KB.prototype.dispose;g.Lm(Wu,g.jJ);g.J=Wu.prototype;g.J.B1=function(N){this.HL()||(N&&(xO(this,""+N),this.publish("sessionFailed")),this.V=null,this.publish("sessionScreen",null))}; g.J.info=function(N){vu(this.Rd,N)}; g.J.ZD=function(){return null}; g.J.zG=function(N){var z=this.W;N?(z.displayStatus=new chrome.cast.ReceiverDisplayStatus(N,[]),z.displayStatus.showStop=!0):z.displayStatus=null;chrome.cast.setReceiverDisplayStatus(z,(0,g.Zl)(function(){this.info("Updated receiver status for "+z.friendlyName+": "+N)},this),(0,g.Zl)(function(){xO(this,"Failed to update receiver status for: "+z.friendlyName)},this))}; g.J.AO=function(){this.zG("");Wu.gi.AO.call(this)};g.y(eE,Wu);g.J=eE.prototype;g.J.Oj=function(N){if(this.Z){if(this.Z==N)return;xO(this,"Overriding cast session with new session object");gHm(this);this.PL=!1;this.J="unknown";this.Z.removeUpdateListener(this.Vp);this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.K0)}this.Z=N;this.Z.addUpdateListener(this.Vp);this.Z.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.K0);mf7(this,"getMdxSessionStatus")}; g.J.Us=function(N){this.info("launchWithParams no-op for Cast: "+g.bX(N))}; g.J.stop=function(){this.Z?this.Z.stop((0,g.Zl)(function(){this.B1()},this),(0,g.Zl)(function(){this.B1(Error("Failed to stop receiver app."))},this)):this.B1(Error("Stopping cast device without session."))}; g.J.zG=function(){}; g.J.AO=function(){this.info("disposeInternal");gHm(this);this.Z&&(this.Z.removeUpdateListener(this.Vp),this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.K0));this.Z=null;Wu.prototype.AO.call(this)}; g.J.ICW=function(N,z){if(!this.HL())if(z)if(z=RM(z),g.v$(z))switch(N=""+z.type,z=z.data||{},this.info("onYoutubeMessage_: "+N+" "+g.bX(z)),N){case "mdxSessionStatus":T5U(this,z);break;case "loungeToken":$f8(this,z);break;default:xO(this,"Unknown youtube message: "+N)}else xO(this,"Unable to parse message.");else xO(this,"No data in message.")}; g.J.FD=function(N,z,v,R){g.xA(this.Y);this.Y=0;xf7(this.N,this.W.label,N,this.W.friendlyName,(0,g.Zl)(function(C){C?z(C):R>=0?(xO(this,"Screen "+N+" appears to be offline. "+R+" retries left."),this.Y=g.W9((0,g.Zl)(this.FD,this,N,z,v,R-1),300)):v(Error("Unable to fetch screen."))},this),v)}; g.J.ZD=function(){return this.Z}; g.J.D3=function(N){this.HL()||N||(xO(this,"Cast session died."),this.B1())};g.y(Jl,Wu);g.J=Jl.prototype;g.J.Oj=function(N){this.Z=N;this.Z.addUpdateListener(this.Id)}; g.J.Us=function(N){this.tO=N;this.qd()}; g.J.stop=function(){HGm(this);this.Z?this.Z.stop((0,g.Zl)(this.B1,this,null),(0,g.Zl)(this.B1,this,"Failed to stop DIAL device.")):this.B1()}; g.J.AO=function(){HGm(this);this.Z&&this.Z.removeUpdateListener(this.Id);this.Z=null;Wu.prototype.AO.call(this)}; g.J.jJ=function(N){this.HL()||N||(xO(this,"DIAL session died."),this.B(),this.B=function(){},this.B1())};g.y(dn,Wu);dn.prototype.stop=function(){this.B1()}; dn.prototype.Oj=function(){}; dn.prototype.Us=function(){g.xA(this.Z);this.Z=NaN;var N=Ka(this.N.tR(),this.W.label);N?GH(this,N):this.B1(Error("No such screen"))}; dn.prototype.AO=function(){g.xA(this.Z);this.Z=NaN;Wu.prototype.AO.call(this)};g.y(sS,g.jJ);g.J=sS.prototype; g.J.init=function(N,z){chrome.cast.timeout.requestSession=3E4;var v=new chrome.cast.SessionRequest(this.Y,[chrome.cast.Capability.AUDIO_OUT]);g.yj("desktop_enable_cast_connect")&&(v.androidReceiverCompatible=!0);this.J||(v.dialRequest=new chrome.cast.DialRequest("YouTube"));var R=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;N=N||this.G?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var C=(0,g.Zl)(this.X5W,this);v=new chrome.cast.ApiConfig(v,(0,g.Zl)(this.Rb, this),C,R,N);v.customDialLaunchCallback=(0,g.Zl)(this.iVT,this);chrome.cast.initialize(v,(0,g.Zl)(function(){this.HL()||(chrome.cast.addReceiverActionListener(this.B),wzE(),this.W.subscribe("onlineScreenChange",(0,g.Zl)(this.Nt,this)),this.Z=bGw(this),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Zl)(function(Z){this.ri("Failed to set initial custom receivers: "+g.bX(Z))},this)),this.publish("yt-remote-cast2-availability-change",F0(this)),z(!0))},this),(0,g.Zl)(function(Z){this.ri("Failed to initialize API: "+ g.bX(Z)); z(!1)},this))}; g.J.hVd=function(N,z){TH("Setting connected screen ID: "+N+" -> "+z);if(this.V){var v=this.V.V;if(!N||v&&v.id!=N)TH("Unsetting old screen status: "+this.V.W.friendlyName),nB(this,null)}if(N&&z){if(!this.V){N=Ka(this.W.tR(),N);if(!N){TH("setConnectedScreenStatus: Unknown screen.");return}if(N.idType=="shortLived"){TH("setConnectedScreenStatus: Screen with id type to be short lived.");return}v=oH$(this,N);v||(TH("setConnectedScreenStatus: Connected receiver not custom..."),v=new chrome.cast.Receiver(N.uuid? N.uuid:N.id,N.name),v.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Z.push(v),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Zl)(function(R){this.ri("Failed to set initial custom receivers: "+g.bX(R))},this))); TH("setConnectedScreenStatus: new active receiver: "+v.friendlyName);nB(this,new dn(this.W,v),!0)}this.V.zG(z)}else TH("setConnectedScreenStatus: no screen.")}; g.J.Y9l=function(N){this.HL()?this.ri("Setting connection data on disposed cast v2"):this.V?this.V.Us(N):this.ri("Setting connection data without a session")}; g.J.Qu=function(){this.HL()?this.ri("Stopping session on disposed cast v2"):this.V?(this.V.stop(),nB(this,null)):TH("Stopping non-existing session")}; g.J.requestSession=function(){chrome.cast.requestSession((0,g.Zl)(this.Rb,this),(0,g.Zl)(this.JIU,this))}; g.J.AO=function(){this.W.unsubscribe("onlineScreenChange",(0,g.Zl)(this.Nt,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.B);var N=c6$,z=g.qx("yt.mdx.remote.debug.handlers_");g.fm(z||[],N);g.Lc(this.V);g.jJ.prototype.AO.call(this)}; g.J.ri=function(N){vu("Controller",N)}; g.J.G2=function(N,z){this.V==N&&(z||nB(this,null),this.publish("yt-remote-cast2-session-change",z))}; g.J.sud=function(N,z){if(!this.HL())if(N)switch(N.friendlyName=chrome.cast.unescape(N.friendlyName),TH("onReceiverAction_ "+N.label+" / "+N.friendlyName+"-- "+z),z){case chrome.cast.ReceiverAction.CAST:if(this.V)if(this.V.W.label!=N.label)TH("onReceiverAction_: Stopping active receiver: "+this.V.W.friendlyName),this.V.stop();else{TH("onReceiverAction_: Casting to active receiver.");this.V.V&&this.publish("yt-remote-cast2-session-change",this.V.V);break}switch(N.receiverType){case chrome.cast.ReceiverType.CUSTOM:nB(this, new dn(this.W,N));break;case chrome.cast.ReceiverType.DIAL:nB(this,new Jl(this.W,N,this.N,this.config_));break;case chrome.cast.ReceiverType.CAST:nB(this,new eE(this.W,N,this.config_));break;default:this.ri("Unknown receiver type: "+N.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.V&&this.V.W.label==N.label?this.V.stop():this.ri("Stopping receiver w/o session: "+N.friendlyName)}else this.ri("onReceiverAction_ called without receiver.")}; g.J.iVT=function(N){if(this.HL())return Promise.reject(Error("disposed"));var z=N.receiver;z.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.ri("Not DIAL receiver: "+z.friendlyName),z.receiverType=chrome.cast.ReceiverType.DIAL);var v=this.V?this.V.W:null;if(!v||v.label!=z.label)return this.ri("Receiving DIAL launch request for non-clicked DIAL receiver: "+z.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(v&&v.label==z.label&&v.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.V.V)return TH("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.V.V),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.ri('Changing CAST intent from "'+v.receiverType+'" to "dial" for '+z.friendlyName);nB(this,new Jl(this.W,z,this.N,this.config_))}z=this.V;z.Y=N;z.Y.appState==chrome.cast.DialAppState.RUNNING?(N=z.Y.extraData||{},v=N.screenId||null,y7(z)&&N.loungeToken?N.loungeTokenRefreshIntervalMs?N=S19(z,{name:z.W.friendlyName,screenId:N.screenId,loungeToken:N.loungeToken,dialId:z.Y.receiver.label, screenIdType:"shortLived"},N.loungeTokenRefreshIntervalMs):(g.c6(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(N)+".")),N=EHr(z,v)):N=EHr(z,v)):N=P$w(z);return N}; g.J.Rb=function(N){var z=this;if(!this.HL()&&!this.G){TH("New cast session ID: "+N.sessionId);var v=N.receiver;if(v.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.V)if(v.receiverType==chrome.cast.ReceiverType.CAST)TH("Got resumed cast session before resumed mdx connection."),v.friendlyName=chrome.cast.unescape(v.friendlyName),nB(this,new eE(this.W,v,this.config_),!0);else{this.ri("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var R=this.V.W,C=Ka(this.W.tR(), R.label);C&&QD(C,v.label)&&R.receiverType!=chrome.cast.ReceiverType.CAST&&v.receiverType==chrome.cast.ReceiverType.CAST&&(TH("onSessionEstablished_: manual to cast session change "+v.friendlyName),g.Lc(this.V),this.V=new eE(this.W,v,this.config_),this.V.subscribe("sessionScreen",(0,g.Zl)(this.G2,this,this.V)),this.V.subscribe("sessionFailed",function(){return Df7(z,z.V)}),this.V.Us(null)); this.V.Oj(N)}}}; g.J.mM=function(){return this.V?this.V.ZD():null}; g.J.JIU=function(N){this.HL()||(this.ri("Failed to estabilish a session: "+g.bX(N)),N.code!=chrome.cast.ErrorCode.CANCEL&&nB(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.J.X5W=function(N){TH("Receiver availability updated: "+N);if(!this.HL()){var z=F0(this);this.L=N==chrome.cast.ReceiverAvailability.AVAILABLE;F0(this)!=z&&this.publish("yt-remote-cast2-availability-change",F0(this))}}; g.J.Nt=function(){this.HL()||(this.Z=bGw(this),TH("Updating custom receivers: "+g.bX(this.Z)),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Zl)(function(){this.ri("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",F0(this)))}; sS.prototype.setLaunchParams=sS.prototype.Y9l;sS.prototype.setConnectedScreenStatus=sS.prototype.hVd;sS.prototype.stopSession=sS.prototype.Qu;sS.prototype.getCastSession=sS.prototype.mM;sS.prototype.requestSession=sS.prototype.requestSession;sS.prototype.init=sS.prototype.init;sS.prototype.dispose=sS.prototype.dispose;var MbV=[];g.J=pB.prototype; g.J.reset=function(N){this.listId="";this.index=-1;this.videoId="";CDE(this);this.volume=-1;this.muted=!1;N&&(this.index=N.index,this.listId=N.listId,this.videoId=N.videoId,this.playerState=N.playerState,this.volume=N.volume,this.muted=N.muted,this.audioTrackId=N.audioTrackId,this.trackData=N.trackData,this.Ab=N.hasPrevious,this.sA=N.hasNext,this.L=N.playerTime,this.G=N.playerTimeAt,this.N=N.seekableStart,this.V=N.seekableEnd,this.B=N.duration,this.Y=N.loadedTime,this.Z=N.liveIngestionTime,this.W= !isNaN(this.Z))}; g.J.isPlaying=function(){return this.playerState==1}; g.J.isBuffering=function(){return this.playerState==3}; g.J.Km=function(){return this.playerState==1081}; g.J.wK=function(N){this.B=isNaN(N)?0:N}; g.J.getDuration=function(){return this.W?this.B+kO(this):this.B}; g.J.clone=function(){return new pB(Z1U(this))};g.y(hl,g.jJ);g.J=hl.prototype;g.J.getState=function(){return this.Z}; g.J.j0=function(){return this.N.getReconnectTimeout()}; g.J.VL=function(){this.N.reconnect()}; g.J.play=function(){oE(this)?(this.V?this.V.play(null,g.WV,OS(this,"play")):tl(this,"play"),jA7(this,1,V7(Hu(this))),this.publish("remotePlayerChange")):D1(this,this.play)}; g.J.pause=function(){oE(this)?(this.V?this.V.pause(null,g.WV,OS(this,"pause")):tl(this,"pause"),jA7(this,2,V7(Hu(this))),this.publish("remotePlayerChange")):D1(this,this.pause)}; g.J.seekTo=function(N){if(oE(this)){if(this.V){var z=Hu(this),v=new chrome.cast.media.SeekRequest;v.currentTime=N;z.isPlaying()||z.isBuffering()?v.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:v.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.V.seek(v,g.WV,OS(this,"seekTo",{newTime:N}))}else tl(this,"seekTo",{newTime:N});jA7(this,3,N);this.publish("remotePlayerChange")}else D1(this,g.iW(this.seekTo,N))}; g.J.stop=function(){if(oE(this)){this.V?this.V.stop(null,g.WV,OS(this,"stopVideo")):tl(this,"stopVideo");var N=Hu(this);N.index=-1;N.videoId="";CDE(N);bl(this,N);this.publish("remotePlayerChange")}else D1(this,this.stop)}; g.J.setVolume=function(N,z){if(oE(this)){var v=Hu(this);if(this.W){if(v.volume!=N){var R=Math.round(N)/100;this.W.setReceiverVolumeLevel(R,(0,g.Zl)(function(){RE("set receiver volume: "+R)},this),(0,g.Zl)(function(){this.ri("failed to set receiver volume.")},this))}v.muted!=z&&this.W.setReceiverMuted(z,(0,g.Zl)(function(){RE("set receiver muted: "+z)},this),(0,g.Zl)(function(){this.ri("failed to set receiver muted.")},this))}else{var C={volume:N, muted:z};v.volume!=-1&&(C.delta=N-v.volume);tl(this,"setVolume",C)}v.muted=z;v.volume=N;bl(this,v)}else D1(this,g.iW(this.setVolume,N,z))}; g.J.Kn=function(N,z){if(oE(this)){var v=Hu(this);N={videoId:N};z&&(v.trackData={trackName:z.name,languageCode:z.languageCode,sourceLanguageCode:z.translationLanguage?z.translationLanguage.languageCode:"",languageName:z.languageName,kind:z.kind},N.style=g.bX(z.style),g.CI(N,v.trackData));tl(this,"setSubtitlesTrack",N);bl(this,v)}else D1(this,g.iW(this.Kn,N,z))}; g.J.setAudioTrack=function(N,z){oE(this)?(z=z.getLanguageInfo().getId(),tl(this,"setAudioTrack",{videoId:N,audioTrackId:z}),N=Hu(this),N.audioTrackId=z,bl(this,N)):D1(this,g.iW(this.setAudioTrack,N,z))}; g.J.playVideo=function(N,z,v,R,C,Z,Y){R=R===void 0?null:R;C=C===void 0?null:C;Z=Z===void 0?null:Z;Y=Y===void 0?null:Y;var Q=Hu(this),L={videoId:N};v!==void 0&&(L.currentIndex=v);SE(Q,N,v||0);z!==void 0&&(Pu(Q,z),L.currentTime=z);R&&(L.listId=R);C&&(L.playerParams=C);Z&&(L.clickTrackingParams=Z);Y&&(L.locationInfo=g.bX(Y));tl(this,"setPlaylist",L);R||bl(this,Q)}; g.J.Lo=function(N,z){if(oE(this)){if(N&&z){var v=Hu(this);SE(v,N,z);bl(this,v)}tl(this,"previous")}else D1(this,g.iW(this.Lo,N,z))}; g.J.nextVideo=function(N,z){if(oE(this)){if(N&&z){var v=Hu(this);SE(v,N,z);bl(this,v)}tl(this,"next")}else D1(this,g.iW(this.nextVideo,N,z))}; g.J.D0=function(){if(oE(this)){tl(this,"clearPlaylist");var N=Hu(this);N.reset();bl(this,N);this.publish("remotePlayerChange")}else D1(this,this.D0)}; g.J.y9=function(){oE(this)?tl(this,"dismissAutoplay"):D1(this,this.y9)}; g.J.dispose=function(){if(this.Z!=3){var N=this.Z;this.Z=3;this.publish("proxyStateChange",N,this.Z)}g.jJ.prototype.dispose.call(this)}; g.J.AO=function(){i18(this);this.N=null;this.B.clear();ES(this,null);g.jJ.prototype.AO.call(this)}; g.J.ew=function(N){if((N!=this.Z||N==2)&&this.Z!=3&&N!=0){var z=this.Z;this.Z=N;this.publish("proxyStateChange",z,N);if(N==1)for(;!this.B.isEmpty();)z=N=this.B,z.V.length===0&&(z.V=z.W,z.V.reverse(),z.W=[]),N.V.pop().apply(this);else N==3&&this.dispose()}}; g.J.IVT=function(N,z){this.publish(N,z)}; g.J.Ddl=function(N){if(!N)this.rI(null),ES(this,null);else if(this.W.receiver.volume){N=this.W.receiver.volume;var z=Hu(this),v=Math.round(100*N.level||0);if(z.volume!=v||z.muted!=N.muted)RE("Cast volume update: "+N.level+(N.muted?" muted":"")),z.volume=v,z.muted=!!N.muted,bl(this,z)}}; g.J.rI=function(N){RE("Cast media: "+!!N);this.V&&this.V.removeUpdateListener(this.Y);if(this.V=N)this.V.addUpdateListener(this.Y),aKV(this),this.publish("remotePlayerChange")}; g.J.YT8=function(N){N?(aKV(this),this.publish("remotePlayerChange")):this.rI(null)}; g.J.Dk=function(){tl(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.J.mdT=function(){var N=zF8();N&&ES(this,N)}; g.J.ri=function(N){vu("CP",N)};g.y(rn,g.jJ);g.J=rn.prototype; g.J.connect=function(N,z){if(z){var v=z.listId,R=z.videoId,C=z.videoIds,Z=z.playerParams,Y=z.clickTrackingParams,Q=z.index,L={videoId:R},K=z.currentTime,l=z.locationInfo;z=z.loopMode;K!==void 0&&(L.currentTime=K<=5?0:K);Z&&(L.playerParams=Z);l&&(L.locationInfo=l);Y&&(L.clickTrackingParams=Y);v&&(L.listId=v);C&&C.length>0&&(L.videoIds=C.join(","));Q!==void 0&&(L.currentIndex=Q);this.Id&&(L.loopMode=z||"LOOP_MODE_OFF");v&&(this.V.listId=v);this.V.videoId=R;this.V.index=Q||0;this.V.state=3;Pu(this.V, K);this.B="UNSUPPORTED";v=this.Id?"setInitialState":"setPlaylist";IE("Connecting with "+v+" and params: "+g.bX(L));this.W.connect({method:v,params:g.bX(L)},N,$Lw())}else IE("Connecting without params"),this.W.connect({},N,$Lw());lKE(this)}; g.J.h9=function(N){this.W.h9(N)}; g.J.dispose=function(){this.HL()||(g.cU("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),X0(this,3));g.jJ.prototype.dispose.call(this)}; g.J.AO=function(){WBU(this);xq8(this);GFw(this);g.xA(this.Y);this.Y=NaN;g.xA(this.J);this.J=NaN;this.N=null;g.T6(this.qd);this.qd.length=0;this.W.dispose();g.jJ.prototype.AO.call(this);this.B=this.L=this.Z=this.V=this.W=null}; g.J.UY=function(N){if(!this.Z||this.Z.length===0)return!1;for(var z=g.f(this.Z),v=z.next();!v.done;v=z.next())if(!v.value.capabilities.has(N))return!1;return!0}; g.J.KY=function(){var N=3;this.HL()||(N=0,isNaN(this.Jp())?this.W.ov()&&isNaN(this.G)&&(N=1):N=2);return N}; g.J.pF=function(N){IE("Disconnecting with "+N);g.cU("yt.mdx.remote.remoteClient_",null);WBU(this);this.publish("beforeDisconnect",N);N==1&&GD();this.W.disconnect(N);this.dispose()}; g.J.zZ=function(){var N=this.V;this.N&&(N=this.V.clone(),SE(N,this.N,N.index));return Z1U(N)}; g.J.mFo=function(N){var z=this,v=new pB(N);v.videoId&&v.videoId!=this.V.videoId&&(this.N=v.videoId,g.xA(this.Y),this.Y=g.W9(function(){if(z.N){var C=z.N;z.N=null;z.V.videoId!=C&&ul(z,"getNowPlaying")}},5E3)); var R=[];this.V.listId==v.listId&&this.V.videoId==v.videoId&&this.V.index==v.index||R.push("remoteQueueChange");this.V.playerState==v.playerState&&this.V.volume==v.volume&&this.V.muted==v.muted&&V7(this.V)==V7(v)&&g.bX(this.V.trackData)==g.bX(v.trackData)||R.push("remotePlayerChange");this.V.reset(N);g.h8(R,function(C){this.publish(C)},this)}; g.J.B_=function(){var N=this.W.getDeviceId(),z=g.G1(this.Z,function(v){return v.type=="REMOTE_CONTROL"&&v.id!=N}); return z?z.id:""}; g.J.Jp=function(){return this.W.j0()}; g.J.De=function(){return this.B||"UNSUPPORTED"}; g.J.je=function(){return this.L||""}; g.J.w2=function(){!isNaN(this.Jp())&&this.W.VL()}; g.J.u6l=function(N,z){ul(this,N,z);Ji$(this)}; g.J.RW=function(){var N=g.Vj("SAPISID","")||g.Vj("__Secure-1PAPISID")||"",z=g.Vj("__Secure-3PAPISID","")||"";if(!N&&!z)return"";N=g.zV(g.NG(N),2);z=g.zV(g.NG(z),2);return g.zV(g.NG(","+N+","+z),2)}; rn.prototype.subscribe=rn.prototype.subscribe;rn.prototype.unsubscribeByKey=rn.prototype.xB;rn.prototype.getProxyState=rn.prototype.KY;rn.prototype.disconnect=rn.prototype.pF;rn.prototype.getPlayerContextData=rn.prototype.zZ;rn.prototype.setPlayerContextData=rn.prototype.mFo;rn.prototype.getOtherConnectedRemoteId=rn.prototype.B_;rn.prototype.getReconnectTimeout=rn.prototype.Jp;rn.prototype.getAutoplayMode=rn.prototype.De;rn.prototype.getAutoplayVideoId=rn.prototype.je;rn.prototype.reconnect=rn.prototype.w2; rn.prototype.sendMessage=rn.prototype.u6l;rn.prototype.getXsrfToken=rn.prototype.RW;rn.prototype.isCapabilitySupportedOnConnectedDevices=rn.prototype.UY;g.y(AiE,il);g.J=AiE.prototype;g.J.tR=function(N){return this.zl.$_gs(N)}; g.J.contains=function(N){return!!this.zl.$_c(N)}; g.J.get=function(N){return this.zl.$_g(N)}; g.J.start=function(){this.zl.$_st()}; g.J.add=function(N,z,v){this.zl.$_a(N,z,v)}; g.J.remove=function(N,z,v){this.zl.$_r(N,z,v)}; g.J.oJ=function(N,z,v,R){this.zl.$_un(N,z,v,R)}; g.J.AO=function(){for(var N=this.V.length,z=0;z1&&!this.C.getOption("remote","quickCast")?(this.jE=g.H$(N,this.V,this),this.OA(g.OL(N,this.V)),N=g.h(this.C.getOption("remote","currentReceiver")),N=this.V(N),this.options[N]&&this.jI(N),this.enable(!0)):this.enable(!1)}; WY.prototype.V=function(N){return N.key}; WY.prototype.WW=function(N){return N==="cast-selector-receiver"?"Enviar...":this.jE[N].name}; WY.prototype.kB=function(N){g.Ph.prototype.kB.call(this,N);this.C.setOption("remote","currentReceiver",this.jE[N]);this.b$.pV()};g.y(MDU,g.GI);g.J=MDU.prototype; g.J.create=function(){var N=this.player.D(),z=g.Pi(N);N={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:N.X("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:N.X("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:N.X("enable_cast_short_lived_lounge_token")};VD9(z,N);this.subscriptions.push(g.C1("yt-remote-before-disconnect",this.h1S,this));this.subscriptions.push(g.C1("yt-remote-connection-change",this.L4L,this));this.subscriptions.push(g.C1("yt-remote-receiver-availability-change",this.ZM, this));this.subscriptions.push(g.C1("yt-remote-auto-connect",this.MKp,this));this.subscriptions.push(g.C1("yt-remote-receiver-resumed",this.BHW,this));this.subscriptions.push(g.C1("mdx-privacy-popup-confirm",this.JTS,this));this.subscriptions.push(g.C1("mdx-privacy-popup-cancel",this.Tx0,this));this.ZM()}; g.J.load=function(){this.player.cancelPlayback();g.GI.prototype.load.call(this);this.cK=new qD7(this.player.D(),this);this.player.Gy(this.cK);this.Ak=new Xa7(this,this.player,this.rH);var N=(N=tD9())?N.currentTime:0;var z=oLw()?new hl(g.h(Ze()),void 0):null;N==0&&z&&(N=V7(Hu(z)));N!==0&&this.G4(N);wa7(this,this.Hc,this.Hc);this.player.Qv(6)}; g.J.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.n2();this.pE=this.tb;g.Kc(this.Ak,this.rH);this.rH=this.cK=this.Ak=null;g.GI.prototype.unload.call(this);this.player.Qv(5);Gv(this)}; g.J.AO=function(){g.ZK(this.subscriptions);g.GI.prototype.AO.call(this)}; g.J.j6=function(N){var z=g.SI.apply(1,arguments);this.loaded&&this.Ak.rG.apply(this.Ak,[N].concat(g.U(z)))}; g.J.getAdState=function(){return this.a4}; g.J.Ab=function(){return this.rH?Hu(this.rH).Ab:!1}; g.J.sA=function(){return this.rH?Hu(this.rH).sA:!1}; g.J.G4=function(N,z){this.Dq=N||0;this.player.publish("progresssync",N,z);this.player.wH("onVideoProgress",N||0)}; g.J.getCurrentTime=function(){return this.Dq}; g.J.getProgressState=function(){var N=Hu(this.rH),z=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!N.Km()&&this.player.wi(),clipEnd:z.clipEnd,clipStart:z.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:N.getDuration(),ingestionTime:N.W?N.Z+kO(N):N.Z,isAtLiveHead:(N.W?N.V+kO(N):N.V)-this.getCurrentTime()<=1,loaded:N.Y,seekableEnd:N.W?N.V+kO(N):N.V,seekableStart:N.N>0?N.N+kO(N):N.N,offset:0,viewerLivestreamJoinMediaTime:0}}; g.J.nextVideo=function(){this.rH&&this.rH.nextVideo()}; g.J.Lo=function(){this.rH&&this.rH.Lo()}; g.J.h1S=function(N){N===1&&(this.KB=this.rH?Hu(this.rH):null)}; g.J.L4L=function(){var N=oLw()?new hl(g.h(Ze()),void 0):null;if(N){var z=this.pE;this.loaded&&this.unload();this.rH=N;this.KB=null;z.key!==this.tb.key&&(this.pE=z,this.load())}else g.Lc(this.rH),this.rH=null,this.loaded&&(this.unload(),(N=this.KB)&&N.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(N.videoId,V7(N)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.J.ZM=function(){var N=[this.tb],z=N.concat,v=SD7();Bu()&&g.Pe("yt-remote-cast-available")&&v.push({key:"cast-selector-receiver",name:"Cast..."});this.jE=z.call(N,v);N=hFU()||this.tb;xq(this,N);this.player.wH("onMdxReceiversChange")}; g.J.MKp=function(){var N=g.h(hFU());xq(this,N)}; g.J.BHW=function(){this.pE=g.h(hFU())}; g.J.JTS=function(){this.h_=!0;Gv(this);ab=!1;Yq&&jX(Yq,1);Yq=null}; g.J.Tx0=function(){this.h_=!1;Gv(this);xq(this,this.tb);this.pE=this.tb;ab=!1;Yq=null;this.player.playVideo()}; g.J.mA=function(N,z){switch(N){case "casting":return this.loaded;case "receivers":return this.jE;case "currentReceiver":return z&&(z.key==="cast-selector-receiver"?vL7():xq(this,z)),this.loaded?this.pE:this.tb;case "quickCast":return this.jE.length===2&&this.jE[1].key==="cast-selector-receiver"?(z&&vL7(),!0):!1}}; g.J.Dk=function(){this.rH.Dk()}; g.J.Do=function(){return!1}; g.J.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.J.isLoggedIn=function(){var N,z;return((N=g.XI("PLAYER_CONFIG"))==null?void 0:(z=N.args)==null?void 0:z.authuser)!==void 0?!0:!(!g.XI("SESSION_INDEX")&&!g.XI("LOGGED_IN"))};g.Wb("remote",MDU);})(_yt_player);