(function(g){var window=this;'use strict';var zr0=function(M){if(M instanceof g.xT)return M;if(typeof M.uL=="function")return M.uL(!1);if(g.AB(M)){var f=0,A=new g.xT;A.next=function(){for(;;){if(f>=M.length)return g.Da;if(f in M)return g.Zx(M[f++]);f++}};
return A}throw Error("Not implemented");},PG6=function(M,f,A){if(g.AB(M))g.F0(M,f,A);
else for(M=zr0(M);;){var Q=M.next();if(Q.done)break;f.call(A,Q.value,void 0,M)}},fA=function(M){g.SF(M,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.EB()).toString(36));
return M},AY=function(M,f,A){Array.isArray(A)||(A=[String(A)]);
g.kUb(M.C,f,A)},nS7=function(M,f){var A=[];
PG6(f,function(Q){try{var N=g.zi.prototype.Z.call(this,Q,!0)}catch(Y){if(Y=="Storage: Invalid value was encountered")return;throw Y;}N===void 0?A.push(Q):g.l2t(N)&&A.push(Q)},M);
return A},jbe=function(M,f){nS7(M,f).forEach(function(A){g.zi.prototype.remove.call(this,A)},M)},$4m=function(M){if(M.Fk){if(M.Fk.locationOverrideToken)return{locationOverrideToken:M.Fk.locationOverrideToken};
if(M.Fk.latitudeE7!=null&&M.Fk.longitudeE7!=null)return{latitudeE7:M.Fk.latitudeE7,longitudeE7:M.Fk.longitudeE7}}return null},FmW=function(M,f){g.V9(M,f)||M.push(f)},y37=function(M){var f=0,A;
for(A in M)f++;return f},d40=function(M,f){return g.w7(M,f)},erv=function(M){try{return g.Kb.JSON.parse(M)}catch(f){}M=String(M);
if(/^\s*$/.test(M)?0:/^[\],:{}\s\u2028\u2029]*$/.test(M.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("("+M+")")}catch(f){}throw Error("Invalid JSON string: "+M);},Q0=function(M){if(g.Kb.JSON)try{return g.Kb.JSON.parse(M)}catch(f){}return erv(M)},b4m=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/channel/opened",g.p2("channel_type"))},kRW=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/channel/closed",g.p2("channel_type"))},WmW=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/channel/message_received",g.p2("channel_type"))},O4R=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/channel/success")},XJB=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/channel/error",g.p2("channel_type"),g.p2("error_type"))},J3B=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Kmv=function(){var M=NI();
this.K=M;M.jT("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},GRR=function(M){if(M.yM&&typeof M.yM=="function")return M.yM();
if(typeof Map!=="undefined"&&M instanceof Map||typeof Set!=="undefined"&&M instanceof Set)return Array.from(M.values());if(typeof M==="string")return M.split("");if(g.AB(M)){for(var f=[],A=M.length,Q=0;Q1){if(A%2)throw Error("Uneven number of arguments");for(var Q=0;Q5&&(M=M.slice(M.length-5));
var f=g.WP(FEK(),function(Q){return Q.loungeToken}),A=g.WP(M,function(Q){return Q.loungeToken});
g.Oy(A,function(Q){return!g.V9(f,Q)})&&yI7();
g.jA("yt-remote-local-screens",M,31536E3)},LA=function(M){M||(g.FN("yt-remote-session-screen-id"),g.FN("yt-remote-session-video-id"));
jd6();M=hY();g.qm(M,Sq());PlC(M)},eG6=function(){if(!oE){var M=g.yI();
M&&(oE=new g.Zg(M))}},b06=function(){eG6();
return oE?!!oE.get("yt-remote-use-staging-server"):!1},CA=function(M,f){g.IP[M]=!0;
var A=g.NF();A&&A.publish.apply(A,arguments);g.IP[M]=!1},kA7=function(){},NI=function(){if(!UQ){UQ=new g.d1(new kA7);
var M=g.sf("client_streamz_web_flush_count",-1);M!==-1&&(UQ.j=M)}return UQ},WEm=function(){var M=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return M?parseInt(M[1],10):0},O0B=function(M){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+M)!=-1||document.currentScript.src.indexOf("&"+M)!=-1)},XaW=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},V0=function(M){M.length?JIC(M.shift(),function(){V0(M)}):KE0()},GAW=function(M){return"chrome-extension://"+M+"/cast_sender.js"},JIC=function(M,f,A){var Q=document.createElement("script");
Q.onerror=f;A&&(Q.onload=A);g.tu(Q,g.BJ(M));(document.head||document.documentElement).appendChild(Q)},waW=function(){var M=WEm(),f=[];
if(M>1){var A=M-1;f.push("//www.gstatic.com/eureka/clank/"+M+"/cast_sender.js");f.push("//www.gstatic.com/eureka/clank/"+A+"/cast_sender.js")}return f},KE0=function(){var M=XaW();
M&&M(!1,"No cast extension found")},MAc=function(){if(lfe){var M=2,f=XaW(),A=function(){M--;
M==0&&f&&f(!0)};
window.__onGCastApiAvailable=A;JIC("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",KE0,A)}},fDB=function(){MAc();
var M=waW();M.push("//www.gstatic.com/eureka/clank/cast_sender.js");V0(M)},Q0W=function(){MAc();
var M=waW();M.push.apply(M,g.c(A09.map(GAW)));M.push("//www.gstatic.com/eureka/clank/cast_sender.js");V0(M)},aE=function(M,f,A){g.y.call(this);
this.G=A!=null?(0,g.IR)(M,A):M;this.du=f;this.N=(0,g.IR)(this.qN,this);this.K=!1;this.Z=0;this.j=this.V7=null;this.C=[]},qI=function(){},N$B=function(){g.wi.call(this,"p")},Y8e=function(){g.wi.call(this,"o")},T$C=function(){return ID0=ID0||new g.Lz},Dh6=function(M){g.wi.call(this,"serverreachability",M)},HA=function(M){var f=T$C();
f.dispatchEvent(new Dh6(f,M))},EJc=function(M){g.wi.call(this,"statevent",M)},m0=function(M){var f=T$C();
f.dispatchEvent(new EJc(f,M))},tAR=function(M,f,A,Q){g.wi.call(this,"timingevent",M);
this.size=f;this.rtt=A;this.retries=Q},sQ=function(M,f){if(typeof M!=="function")throw Error("Fn must not be null and must be a function");
return g.Kb.setTimeout(function(){M()},f)},cA=function(){},RE=function(M,f,A,Q){this.j=M;
this.C=f;this.oE=A;this.wq=Q||1;this.xO=new g.Vp(this);this.l8=45E3;this.fJ=null;this.G=!1;this.B=this.Ji=this.X=this.nJ=this.jk=this.b8=this.Er=null;this.KJ=[];this.K=null;this.W=0;this.N=this.P7=null;this.Qw=-1;this.g_=!1;this.w_=0;this.YO=null;this.zt=this.ox=this.Z9=this.z0=!1;this.Z=new vJR},vJR=function(){this.j=null;
this.K="";this.Z=!1},hYK=function(M,f,A){M.nJ=1;
M.X=fA(f.clone());M.B=A;M.z0=!0;pD9(M,null)},pD9=function(M,f){M.jk=Date.now();
g_(M);M.Ji=M.X.clone();AY(M.Ji,"t",M.wq);M.W=0;var A=M.j.nJ;M.Z=new vJR;M.K=S8m(M.j,A?f:null,!M.B);M.w_>0&&(M.YO=new g.NY((0,g.IR)(M.NA,M,M.K),M.w_));M.xO.listen(M.K,"readystatechange",M.RB);f=M.fJ?g.Q1(M.fJ):{};M.B?(M.P7||(M.P7="POST"),f["Content-Type"]="application/x-www-form-urlencoded",M.K.send(M.Ji,M.P7,M.B,f)):(M.P7="GET",M.K.send(M.Ji,M.P7,null,f));HA(1)},oJw=function(M){if(!Lle(M))return g.w1(M.K);
var f=g.l4(M.K);if(f==="")return"";var A="",Q=f.length,N=g.Kz(M.K)==4;if(!M.Z.j){if(typeof TextDecoder==="undefined")return BA(M),iq(M),"";M.Z.j=new g.Kb.TextDecoder}for(var Y=0;Yf.length)return C$B;f=f.slice(Q,Q+A);M.W=Q+A;return f},g_=function(M){M.b8=Date.now()+M.l8;
aDw(M,M.l8)},aDw=function(M,f){if(M.Er!=null)throw Error("WatchDog timer not null");
M.Er=sQ((0,g.IR)(M.VE,M),f)},q8R=function(M){M.Er&&(g.Kb.clearTimeout(M.Er),M.Er=null)},iq=function(M){M.j.xZ()||M.g_||HMm(M.j,M)},BA=function(M){q8R(M);
g.hW(M.YO);M.YO=null;M.xO.removeAll();if(M.K){var f=M.K;M.K=null;f.abort();f.dispose()}},xhC=function(M,f){try{var A=M.j;
if(A.x$!=0&&(A.K==M||mhB(A.Z,M)))if(!M.ox&&mhB(A.Z,M)&&A.x$==3){try{var Q=A.SO.K.parse(f)}catch(a){Q=null}if(Array.isArray(Q)&&Q.length==3){var N=Q;if(N[0]==0)a:{if(!A.X){if(A.K)if(A.K.jk+3E30&&(A.w_=1.5*D);Q=A;var E=M.nj();if(E){var t=g.Ml(E,"X-Client-Wire-Protocol");if(t){var v=Q.Z;!v.K&&(g.aX(t,"spdy")||g.aX(t,"quic")||g.aX(t,"h2"))&&(v.C=v.N,v.K=new Set,v.Z&&(RYB(v,v.Z),v.Z=null))}if(Q.z0){var p=g.Ml(E,"X-HTTP-Session-Id");p&&(Q.gb=p,g.SF(Q.fJ,Q.z0,p))}}A.x$=3;A.N&&A.N.YE();A.MV&&(A.d2=Date.now()-M.jk);Q=A;var h=M;Q.N5=gJv(Q,Q.nJ?Q.wq:null,Q.oE);if(h.ox){B$6(Q.Z,
h);var S=h,L=Q.w_;L&&S.setTimeout(L);S.Er&&(q8R(S),g_(S));Q.K=h}else iM6(Q);A.j.length>0&&uq(A)}else Y[0]!="stop"&&Y[0]!="close"||r_(A,7);else A.x$==3&&(Y[0]=="stop"||Y[0]=="close"?Y[0]=="stop"?r_(A,7):A.disconnect():Y[0]!="noop"&&A.N&&A.N.vx(Y),A.KJ=0)}HA(4)}catch(a){}},ZM9=function(M,f){this.K=M;
this.map=f;this.context=null},r0e=function(M){this.N=M||10;
g.Kb.PerformanceNavigationTiming?(M=g.Kb.performance.getEntriesByType("navigation"),M=M.length>0&&(M[0].nextHopProtocol=="hq"||M[0].nextHopProtocol=="h2")):M=!!(g.Kb.chrome&&g.Kb.chrome.loadTimes&&g.Kb.chrome.loadTimes()&&g.Kb.chrome.loadTimes().wasFetchedViaSpdy);this.C=M?this.N:1;this.K=null;this.C>1&&(this.K=new Set);this.Z=null;this.j=[]},uNC=function(M){return M.Z?!0:M.K?M.K.size>=M.C:!1},c0C=function(M){return M.Z?1:M.K?M.K.size:0},mhB=function(M,f){return M.Z?M.Z==f:M.K?M.K.has(f):!1},RYB=
function(M,f){M.K?M.K.add(f):M.Z=f},B$6=function(M,f){M.Z&&M.Z==f?M.Z=null:M.K&&M.K.has(f)&&M.K.delete(f)},zYB=function(M){if(M.Z!=null)return M.j.concat(M.Z.KJ);
if(M.K!=null&&M.K.size!==0){var f=M.j;M=g.V(M.K.values());for(var A=M.next();!A.done;A=M.next())f=f.concat(A.value.KJ);return f}return g.sB(M.j)},P$R=function(M,f){var A=new cA;
if(g.Kb.Image){var Q=new Image;Q.onload=g.Dv(zu,A,"TestLoadImage: loaded",!0,f,Q);Q.onerror=g.Dv(zu,A,"TestLoadImage: error",!1,f,Q);Q.onabort=g.Dv(zu,A,"TestLoadImage: abort",!1,f,Q);Q.ontimeout=g.Dv(zu,A,"TestLoadImage: timeout",!1,f,Q);g.Kb.setTimeout(function(){if(Q.ontimeout)Q.ontimeout()},1E4);
Q.src=M}else f(!1)},nJB=function(M,f){var A=new cA,Q=new AbortController,N=setTimeout(function(){Q.abort();
zu(A,"TestPingServer: timeout",!1,f)},1E4);
fetch(M,{signal:Q.signal}).then(function(Y){clearTimeout(N);Y.ok?zu(A,"TestPingServer: ok",!0,f):zu(A,"TestPingServer: server error",!1,f)}).catch(function(){clearTimeout(N);
zu(A,"TestPingServer: error",!1,f)})},zu=function(M,f,A,Q,N){try{N&&(N.onload=null,N.onerror=null,N.onabort=null,N.ontimeout=null),Q(A)}catch(Y){}},j06=function(){this.K=new qI},$h0=function(M,f,A){var Q=A||"";
try{lSB(M,function(N,Y){var I=N;g.Q9(N)&&(I=g.b4(N));f.push(Q+Y+"="+encodeURIComponent(I))})}catch(N){throw f.push(Q+"type="+encodeURIComponent("_badmap")),N;
}},PA=function(M,f,A){return A&&A.yP?A.yP[M]||f:f},Fl6=function(M){this.j=[];
this.wq=this.N5=this.fJ=this.oE=this.K=this.gb=this.z0=this.g_=this.W=this.Qw=this.B=null;this.Wy=this.Ji=0;this.VU=PA("failFast",!1,M);this.ox=this.Er=this.X=this.G=this.N=null;this.Yp=!0;this.T_=this.YO=-1;this.zt=this.KJ=this.jk=0;this.qX=PA("baseRetryDelayMs",5E3,M);this.OR=PA("retryDelaySeedMs",1E4,M);this.R5=PA("forwardChannelMaxRetries",2,M);this.Uq=PA("forwardChannelRequestTimeoutMs",2E4,M);this.Fk=M&&M.g4Y||void 0;this.Yx=M&&M.Kbr||void 0;this.zj=M&&M.Pyx||!1;this.w_=void 0;this.nJ=M&&M.U$k||
!1;this.C="";this.Z=new r0e(M&&M.OZY);this.SO=new j06;this.xO=M&&M.k8u||!1;this.b8=M&&M.Dp0||!1;this.xO&&this.b8&&(this.b8=!1);this.vy=M&&M.cIY||!1;M&&M.iFk&&(this.Yp=!1);this.MV=!this.xO&&this.Yp&&M&&M.XQ8||!1;this.y7=void 0;M&&M.Qg&&M.Qg>0&&(this.y7=M.Qg);this.xp=void 0;this.d2=0;this.l8=!1;this.Z9=this.P7=null},Zh=function(M){M.K&&(y00(M),M.K.cancel(),M.K=null)},dhK=function(M){Zh(M);
M.X&&(g.Kb.clearTimeout(M.X),M.X=null);xC(M);M.Z.cancel();M.G&&(typeof M.G==="number"&&g.Kb.clearTimeout(M.G),M.G=null)},uq=function(M){uNC(M.Z)||M.G||(M.G=!0,g.cW(M.Re,M),M.jk=0)},bM7=function(M,f){if(c0C(M.Z)>=M.Z.C-(M.G?1:0))return!1;
if(M.G)return M.j=f.KJ.concat(M.j),!0;if(M.x$==1||M.x$==2||M.jk>=(M.VU?0:M.R5))return!1;M.G=sQ((0,g.IR)(M.Re,M,f),eYm(M,M.jk));M.jk++;return!0},Wlm=function(M,f){var A;
f?A=f.oE:A=M.Ji++;var Q=M.fJ.clone();g.SF(Q,"SID",M.C);g.SF(Q,"RID",A);g.SF(Q,"AID",M.YO);nA(M,Q);M.W&&M.B&&g.Uk(Q,M.W,M.B);A=new RE(M,M.C,A,M.jk+1);M.W===null&&(A.fJ=M.B);f&&(M.j=f.KJ.concat(M.j));f=kXK(M,A,1E3);A.setTimeout(Math.round(M.Uq*.5)+Math.round(M.Uq*.5*Math.random()));RYB(M.Z,A);hYK(A,Q,f)},nA=function(M,f){M.g_&&g.ew(M.g_,function(A,Q){g.SF(f,Q,A)});
M.N&&lSB({},function(A,Q){g.SF(f,Q,A)})},kXK=function(M,f,A){A=Math.min(M.j.length,A);
var Q=M.N?(0,g.IR)(M.N.Oz,M.N,M):null;a:{for(var N=M.j,Y=-1;;){var I=["count="+A];Y==-1?A>0?(Y=N[0].K,I.push("ofs="+Y)):Y=0:I.push("ofs="+Y);for(var D=!0,E=0;E=3)return!1;
M.zt++;M.X=sQ((0,g.IR)(M.Vf,M),eYm(M,M.KJ));M.KJ++;return!0},y00=function(M){M.P7!=null&&(g.Kb.clearTimeout(M.P7),M.P7=null)},OM9=function(M){M.K=new RE(M,M.C,"rpc",M.zt);
M.W===null&&(M.K.fJ=M.B);M.K.w_=0;var f=M.N5.clone();g.SF(f,"RID","rpc");g.SF(f,"SID",M.C);g.SF(f,"AID",M.YO);g.SF(f,"CI",M.ox?"0":"1");!M.ox&&M.y7&&g.SF(f,"TO",M.y7);g.SF(f,"TYPE","xmlhttp");nA(M,f);M.W&&M.B&&g.Uk(f,M.W,M.B);M.w_&&M.K.setTimeout(M.w_);var A=M.K;M=M.wq;A.nJ=1;A.X=fA(f.clone());A.B=null;A.z0=!0;pD9(A,M)},xC=function(M){M.Er!=null&&(g.Kb.clearTimeout(M.Er),M.Er=null)},HMm=function(M,f){var A=null;
if(M.K==f){xC(M);y00(M);M.K=null;var Q=2}else if(mhB(M.Z,f))A=f.KJ,B$6(M.Z,f),Q=1;else return;if(M.x$!=0)if(f.G)if(Q==1){A=f.B?f.B.length:0;f=Date.now()-f.jk;var N=M.jk;Q=T$C();Q.dispatchEvent(new tAR(Q,A,f,N));uq(M)}else iM6(M);else{var Y=f.Qw;N=f.getLastError();if(N==3||N==0&&Y>0||!(Q==1&&bM7(M,f)||Q==2&&s07(M)))switch(A&&A.length>0&&(f=M.Z,f.j=f.j.concat(A)),N){case 1:r_(M,5);break;case 4:r_(M,10);break;case 3:r_(M,6);break;default:r_(M,2)}}},eYm=function(M,f){var A=M.qX+Math.floor(Math.random()*
M.OR);
M.isActive()||(A*=2);return A*f},r_=function(M,f){if(f==2){var A=(0,g.IR)(M.oZ3,M),Q=M.Yx,N=!Q;
Q=new g.Im(Q||"//www.google.com/images/cleardot.gif");g.Kb.location&&g.Kb.location.protocol=="http"||g.T3(Q,"https");fA(Q);N?P$R(Q.toString(),A):nJB(Q.toString(),A)}else m0(2);M.x$=0;M.N&&M.N.OO(f);XDm(M);dhK(M)},XDm=function(M){M.x$=0;
M.Z9=[];if(M.N){var f=zYB(M.Z);if(f.length!=0||M.j.length!=0)g.RR(M.Z9,f),g.RR(M.Z9,M.j),M.Z.j.length=0,g.sB(M.j),M.j.length=0;M.N.Wx()}},J0R=function(M){if(M.x$==0)return M.Z9;
var f=[];g.RR(f,zYB(M.Z));g.RR(f,M.j);return f},gJv=function(M,f,A){var Q=g.Ll(A);
Q.K!=""?(f&&g.DI(Q,f+"."+Q.K),g.Ek(Q,Q.j)):(Q=g.Kb.location,Q=MCC(Q.protocol,f?f+"."+Q.hostname:Q.hostname,+Q.port,A));f=M.z0;A=M.gb;f&&A&&g.SF(Q,f,A);g.SF(Q,"VER",M.qA);nA(M,Q);return Q},S8m=function(M,f,A){if(f&&!M.nJ)throw Error("Can't create secondary domain capable XhrIo object.");
f=M.zj&&!M.Fk?new g.On(new g.AC({uF:A})):new g.On(M.Fk);f.W=M.nJ;return f},KlB=function(){},GXw=function(){},$C=function(M,f){g.Lz.call(this);
this.K=new Fl6(f);this.N=M;this.Z=f&&f.zN0||null;M=f&&f.P8r||null;f&&f.RB0&&(M?M["X-Client-Protocol"]="webchannel":M={"X-Client-Protocol":"webchannel"});this.K.B=M;M=f&&f.oVO||null;f&&f.Co&&(M?M["X-WebChannel-Content-Type"]=f.Co:M={"X-WebChannel-Content-Type":f.Co});f&&f.EB&&(M?M["X-WebChannel-Client-Profile"]=f.EB:M={"X-WebChannel-Client-Profile":f.EB});this.K.Qw=M;(M=f&&f.mjJ)&&!g.V1(M)&&(this.K.W=M);this.G=f&&f.U$k||!1;this.C=f&&f.Rs8||!1;(f=f&&f.Au)&&!g.V1(f)&&(this.K.z0=f,g.GC(this.Z,f)&&(M=
this.Z,f in M&&delete M[f]));this.j=new jq(this)},wDm=function(M){N$B.call(this);
M.__headers__&&(this.headers=M.__headers__,this.statusCode=M.__status__,delete M.__headers__,delete M.__status__);var f=M.__sm__;f?this.data=(this.K=g.OB(f))?g.fx(f,this.K):f:this.data=M},lD6=function(M){Y8e.call(this);
this.status=1;this.errorCode=M},jq=function(M){this.K=M},MjK=function(M,f){this.Z=M;
this.K=f},fNe=function(M){return J0R(M.K).map(function(f){var A=M.Z;
f=f.map;"__data__"in f?(f=f.__data__,A=A.C?erv(f):f):A=f;return A})},FW=function(M,f){if(typeof M!=="function")throw Error("Fn must not be null and must be a function");
return g.Kb.setTimeout(function(){M()},f)},d_=function(M){y0.dispatchEvent(new AOc(y0,M))},AOc=function(M){g.wi.call(this,"statevent",M)},eq=function(M,f,A,Q){this.K=M;
this.C=f;this.W=A;this.G=Q||1;this.Z=45E3;this.j=new g.Vp(this);this.N=new g.$M;this.N.setInterval(250)},NX0=function(M,f,A){M.Zm=1;
M.wv=fA(f.clone());M.U1=A;M.z0=!0;Qu9(M,null)},YL9=function(M,f,A,Q,N){M.Zm=1;
M.wv=fA(f.clone());M.U1=null;M.z0=A;N&&(M.o7=!1);Qu9(M,Q)},Qu9=function(M,f){M.JZ=Date.now();
INW(M);M.Kg=M.wv.clone();AY(M.Kg,"t",M.G);M.tB=0;M.fK=M.K.AQ(M.K.XT()?f:null);M.pN>0&&(M.EM=new g.NY((0,g.IR)(M.MA,M,M.fK),M.pN));M.j.listen(M.fK,"readystatechange",M.wZ);f=M.An?g.Q1(M.An):{};M.U1?(M.IV="POST",f["Content-Type"]="application/x-www-form-urlencoded",M.fK.send(M.Kg,M.IV,M.U1,f)):(M.IV="GET",M.o7&&!g.Kg&&(f.Connection="close"),M.fK.send(M.Kg,M.IV,null,f));M.K.s2(1)},Ekm=function(M,f){var A=M.tB,Q=f.indexOf("\n",A);
if(Q==-1)return TXc;A=Number(f.substring(A,Q));if(isNaN(A))return DrK;Q+=1;if(Q+A>f.length)return TXc;f=f.slice(Q,Q+A);M.tB=Q+A;return f},INW=function(M){M.Sn=Date.now()+M.Z;
tjw(M,M.Z)},tjw=function(M,f){if(M.gw!=null)throw Error("WatchDog timer not null");
M.gw=FW((0,g.IR)(M.vL,M),f)},vkB=function(M){M.gw&&(g.Kb.clearTimeout(M.gw),M.gw=null)},pYK=function(M){M.K.xZ()||M.Y0||M.K.Uh(M)},bq=function(M){vkB(M);
g.hW(M.EM);M.EM=null;M.N.stop();M.j.removeAll();if(M.fK){var f=M.fK;M.fK=null;f.abort();f.dispose()}M.RT&&(M.RT=null)},h59=function(M,f){try{M.K.Jp(M,f),M.K.s2(4)}catch(A){}},LH7=function(M,f,A,Q,N){if(Q==0)A(!1);
else{var Y=N||0;Q--;SL9(M,f,function(I){I?A(!0):g.Kb.setTimeout(function(){LH7(M,f,A,Q,Y)},Y)})}},SL9=function(M,f,A){var Q=new Image;
Q.onload=function(){try{kC(Q),A(!0)}catch(N){}};
Q.onerror=function(){try{kC(Q),A(!1)}catch(N){}};
Q.onabort=function(){try{kC(Q),A(!1)}catch(N){}};
Q.ontimeout=function(){try{kC(Q),A(!1)}catch(N){}};
g.Kb.setTimeout(function(){if(Q.ontimeout)Q.ontimeout()},f);
Q.src=M},kC=function(M){M.onload=null;
M.onerror=null;M.onabort=null;M.ontimeout=null},oke=function(M){this.K=M;
this.Z=new qI},CVK=function(M){var f=WA(M.K,M.WD,"/mail/images/cleardot.gif");
fA(f);LH7(f.toString(),5E3,(0,g.IR)(M.m8,M),3,2E3);M.s2(1)},UrB=function(M){var f=M.K.G;
f!=null?(d_(5),f?(d_(11),OQ(M.K,M,!1)):(d_(12),OQ(M.K,M,!0))):(M.Ik=new eq(M),M.Ik.An=M.fN,f=M.K,f=WA(f,f.XT()?M.uP:null,M.g0),d_(5),AY(f,"TYPE","xmlhttp"),YL9(M.Ik,f,!1,M.uP,!1))},Vjm=function(M,f,A){this.K=1;
this.Z=[];this.j=[];this.N=new qI;this.B=M||null;this.G=f!=null?f:null;this.X=A||!1},aNK=function(M,f){this.K=M;
this.map=f;this.context=null},qLB=function(M,f,A,Q){g.wi.call(this,"timingevent",M);
this.size=f;this.rtt=A;this.retries=Q},HHC=function(M){g.wi.call(this,"serverreachability",M)},suR=function(M){M.Ys(1,0);
M.kq=WA(M,null,M.nN);mr9(M)},cOB=function(M){M.iy&&(M.iy.abort(),M.iy=null);
M.k$&&(M.k$.cancel(),M.k$=null);M.jh&&(g.Kb.clearTimeout(M.jh),M.jh=null);XW(M);M.AT&&(M.AT.cancel(),M.AT=null);M.L_&&(g.Kb.clearTimeout(M.L_),M.L_=null)},R59=function(M,f){if(M.K==0)throw Error("Invalid operation: sending map when state is closed");
M.Z.push(new aNK(M.MN++,f));M.K!=2&&M.K!=3||mr9(M)},gkc=function(M){var f=0;
M.k$&&f++;M.AT&&f++;return f},mr9=function(M){M.AT||M.L_||(M.L_=FW((0,g.IR)(M.lW,M),0),M.y9=0)},xrm=function(M,f){if(M.K==1){if(!f){M.hZ=Math.floor(Math.random()*1E5);
f=M.hZ++;var A=new eq(M,"",f);A.An=M.E5;var Q=BXm(M),N=M.kq.clone();g.SF(N,"RID",f);g.SF(N,"CVER","1");JY(M,N);NX0(A,N,Q);M.AT=A;M.K=2}}else M.K==3&&(f?iHB(M,f):M.Z.length==0||M.AT||iHB(M))},iHB=function(M,f){if(f)if(M.g9>6){M.Z=M.j.concat(M.Z);
M.j.length=0;var A=M.hZ-1;f=BXm(M)}else A=f.W,f=f.U1;else A=M.hZ++,f=BXm(M);var Q=M.kq.clone();g.SF(Q,"SID",M.C);g.SF(Q,"RID",A);g.SF(Q,"AID",M.nu);JY(M,Q);A=new eq(M,M.C,A,M.y9+1);A.An=M.E5;A.setTimeout(1E4+Math.round(1E4*Math.random()));M.AT=A;NX0(A,Q,f)},JY=function(M,f){M.BK&&(M=M.BK.xE())&&g.ew(M,function(A,Q){g.SF(f,Q,A)})},BXm=function(M){var f=Math.min(M.Z.length,1E3),A=["count="+f];
if(M.g9>6&&f>0){var Q=M.Z[0].K;A.push("ofs="+Q)}else Q=0;for(var N={},Y=0;Y=3)return!1;
M.W++;M.jh=FW((0,g.IR)(M.hp,M),rO0(M,M.e7));M.e7++;return!0},OQ=function(M,f,A){M.bQ=M.G==null?A:!M.G;
M.cQ=f.kV;M.X||suR(M)},XW=function(M){M.eL!=null&&(g.Kb.clearTimeout(M.eL),M.eL=null)},rO0=function(M,f){var A=5E3+Math.floor(Math.random()*1E4);
M.isActive()||(A*=2);return A*f},KA=function(M,f){if(f==2||f==9){var A=null;
M.BK&&(A=null);var Q=(0,g.IR)(M.m$$,M);A||(A=new g.Im("//www.google.com/images/cleardot.gif"),fA(A));SL9(A.toString(),1E4,Q)}else d_(2);z5e(M,f)},z5e=function(M,f){M.K=0;
M.BK&&M.BK.LB(f);PVB(M);cOB(M)},PVB=function(M){M.K=0;
M.cQ=-1;if(M.BK)if(M.j.length==0&&M.Z.length==0)M.BK.cF();else{var f=g.sB(M.j),A=g.sB(M.Z);M.j.length=0;M.Z.length=0;M.BK.cF(f,A)}},WA=function(M,f,A){var Q=g.Ll(A);
if(Q.K!="")f&&g.DI(Q,f+"."+Q.K),g.Ek(Q,Q.j);else{var N=window.location;Q=MCC(N.protocol,f?f+"."+N.hostname:N.hostname,+N.port,A)}M.TK&&g.ew(M.TK,function(Y,I){g.SF(Q,I,Y)});
g.SF(Q,"VER",M.g9);JY(M,Q);return Q},nk7=function(){},juW=function(){this.K=[];
this.Z=[]},$rc=function(M){g.wi.call(this,"channelMessage");
this.message=M},FHB=function(M){g.wi.call(this,"channelError");
this.error=M},yOK=function(M,f){this.action=M;
this.params=f||{}},Gu=function(M,f){g.y.call(this);
this.K=new g.MY(this.zZY,0,this);g.d(this,this.K);this.du=5E3;this.Z=0;if(typeof M==="function")f&&(M=(0,g.IR)(M,f));else if(M&&typeof M.handleEvent==="function")M=(0,g.IR)(M.handleEvent,M);else throw Error("Invalid listener argument");this.j=M},drc=function(M,f,A,Q,N,Y,I,D,E,t,v,p,h,S){A=A===void 0?!1:A;
Q=Q===void 0?function(){return""}:Q;
N=N===void 0?!1:N;Y=Y===void 0?!1:Y;I=I===void 0?!1:I;D=D===void 0?function(){return g.u4({})}:D;
E=E===void 0?!1:E;v=v===void 0?!1:v;p=p===void 0?!1:p;h=h===void 0?!1:h;S=S===void 0?!1:S;this.nJ=M;this.Er=f;this.G=new g.x2;this.Z=new Gu(this.VO_,this);this.K=null;this.W=!1;this.B=null;this.jk="";this.KJ=this.X=0;this.j=[];this.zt=A;this.z0=Q;this.N=Y;this.fJ=D;this.g_=t;this.wq=I;this.P7=null;this.C=g.u4();this.oE=N;this.Z9=E;this.xO=v;this.b8=p;this.Yp=h;this.Qw=S;this.w_=new b4m;this.ox=new kRW;this.l8=new O4R;this.Ji=new WmW;this.YO=new XJB;this.MV=new J3B;this.xp=new Kmv},kfB=function(M,
f,A,Q,N){e5R(M);
if(M.K){var Y=g.GR("ID_TOKEN"),I=M.K.E5||{};Y?I["x-youtube-identity-token"]=Y:delete I["x-youtube-identity-token"];M.K.E5=I}bHB(M);Q?(Q.getState()!=3&&gkc(Q)==0||Q.getState(),M.K.connect(f,A,M.Er,Q.C,Q.nu)):N?M.K.connect(f,A,M.Er,N.sessionId,N.arrayId):M.K.connect(f,A,M.Er)},JOB=function(M,f){return M.Yp?!0:M.b8?Object.values(WHW).includes(f):M.xO?!Object.values(OHB).includes(f):M.Qw?Object.values(XY0).includes(f):!1},wYK=function(M){var f,A;
g.n(function(Q){if(Q.Z==1)return g.s0(Q,2),g.r(Q,KHW(M),2);g.ZU(Q);f=M.j;M.j=[];A=f.length;Gfw(M,f,A);w_(M);return g.ud(Q,0)})},Gfw=function(M,f,A){for(var Q=0;Q0?A=Object.assign({},A,f):delete A.Authorization;M.K.E5=A}},bHB=function(M){M.g_&&!M.N&&Mtv(M,M.g_())},lq=function(M){this.scheme="https";
this.port=this.domain="";this.K="/api/lounge";this.Z=!0;M=M||document.location.href;var f=Number(g.cP(M)[4]||null)||"";f&&(this.port=":"+f);this.domain=g.RH(M)||"";M=g.ge();M.search("MSIE")>=0&&(M=M.match(/MSIE ([\d.]+)/)[1],g.RX(M,"10.0")<0&&(this.Z=!1))},MA=function(M,f){var A=M.K;
M.Z&&(A=M.scheme+"://"+M.domain+M.port+M.K);return g.uj(A+f,{})},f_6=function(M,f){g.Lz.call(this);
var A=this;this.DK=M();this.DK.subscribe("handlerOpened",this.XL,this);this.DK.subscribe("handlerClosed",this.onClosed,this);this.DK.subscribe("handlerError",function(Q,N){A.onError(N)});
this.DK.subscribe("handlerMessage",this.onMessage,this);this.K=f},ALR=function(M,f,A){var Q=this;
A=A===void 0?function(){return""}:A;
var N=N===void 0?new GXw:N;var Y=Y===void 0?new g.x2:Y;this.pathPrefix=M;this.K=f;this.jk=A;this.N=Y;this.X=null;this.B=this.W=0;this.channel=null;this.G=0;this.j=new Gu(function(){Q.j.isActive();var I;((I=Q.channel)==null?void 0:c0C((new MjK(I,I.K)).K.Z))===0&&Q.connect(Q.X,Q.W)});
this.C={};this.Z={};this.Er=!1;this.logger=null;this.KJ=[];this.R9=void 0;this.fJ=new b4m;this.P7=new kRW;this.g_=new WmW;this.z0=new XJB},QV0=function(M){g.IQ(M.channel,"m",function(){M.G=3;
M.j.reset();M.X=null;M.W=0;for(var f=g.V(M.KJ),A=f.next();!A.done;A=f.next())A=A.value,M.channel&&M.channel.send(A);M.KJ=[];M.publish("webChannelOpened");M.fJ.JX("WEB_CHANNEL")});
g.IQ(M.channel,"n",function(){M.G=0;M.j.isActive()||M.publish("webChannelClosed");var f,A=(f=M.channel)==null?void 0:fNe(new MjK(f,f.K));A&&(M.KJ=[].concat(g.c(A)));M.P7.JX("WEB_CHANNEL")});
g.IQ(M.channel,"p",function(f){var A=f.data;A[0]==="gracefulReconnect"?(M.j.start(),M.channel&&M.channel.close()):M.publish("webChannelMessage",new yOK(A[0],A[1]));M.R9=f.statusCode;M.g_.JX("WEB_CHANNEL")});
g.IQ(M.channel,"o",function(){M.R9===401||M.j.start();M.publish("webChannelError");M.z0.JX("WEB_CHANNEL","")})},NQB=function(M){var f=M.jk();
f?M.C["x-youtube-lounge-xsrf-token"]=f:delete M.C["x-youtube-lounge-xsrf-token"]},Yx7=function(M){g.Lz.call(this);
this.K=M();this.K.subscribe("webChannelOpened",this.Te,this);this.K.subscribe("webChannelClosed",this.onClosed,this);this.K.subscribe("webChannelError",this.onError,this);this.K.subscribe("webChannelMessage",this.onMessage,this)},I_B=function(M,f,A,Q,N){function Y(){return new drc(MA(M,"/bc"),f,!1,A,Q)}
A=A===void 0?function(){return""}:A;
return g.mE("enable_mdx_web_channel_desktop")?new Yx7(function(){return new ALR(MA(M,"/wc"),f,A)}):new f_6(Y,N)},ttB=function(){var M=TQc;
Dnc();fI.push(M);EH0()},Ac=function(M,f){Dnc();
var A=vHC(M,String(f));fI.length==0?pym(A):(EH0(),g.F0(fI,function(Q){Q(A)}))},QN=function(M){Ac("CP",M)},Dnc=function(){fI||(fI=g.wD("yt.mdx.remote.debug.handlers_")||[],g.Gz("yt.mdx.remote.debug.handlers_",fI))},pym=function(M){var f=(NA+1)%50;
NA=f;Yg[f]=M;IT||(IT=f==49)},EH0=function(){var M=fI;
if(Yg[0]){var f=IT?NA:-1,A={};do A={xf:void 0},f=(f+1)%50,A.xf=Yg[f],g.F0(M,function(Q){return function(N){N(Q.xf)}}(A));
while(f!=NA);Yg=Array(50);NA=-1;IT=!1}},vHC=function(M,f){var A=(Date.now()-huB)/1E3;
A.toFixed&&(A=A.toFixed(3));var Q=[];Q.push("[",A+"s","] ");Q.push("[","yt.mdx.remote","] ");Q.push(M+": "+f,"\n");return Q.join("")},TI=function(M){g.pi.call(this);
this.G=M;this.screens=[]},Sxm=function(M,f){var A=M.get(f.uuid)||M.get(f.id);
if(A)return M=A.name,A.id=f.id||A.id,A.name=f.name,A.token=f.token,A.uuid=f.uuid||A.uuid,A.name!=M;M.screens.push(f);return!0},LV0=function(M,f){var A=M.screens.length!=f.length;
M.screens=g.Pw(M.screens,function(Y){return!!rIv(f,Y)});
for(var Q=f.length,N=0;N0&&M.C0&&aT(M,A)},function(f){M.N=function(){};
M.J$(f)})},k8m=function(M){var f={};
f.pairingCode=M.P7;f.theme=M.nJ;b06()&&(f.env_useStageMdx=1);return g.r4(f)},WV7=function(M){return new Promise(function(f){M.P7=xRW();
if(M.fJ){var A=new chrome.cast.DialLaunchResponse(!0,k8m(M));f(A);brc(M)}else M.Er=function(){g.ad(M.B);M.Er=function(){};
M.B=NaN;var Q=new chrome.cast.DialLaunchResponse(!0,k8m(M));f(Q);brc(M)},M.B=g.Uf(function(){M.Er()},100)})},Xyw=function(M,f,A){M.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(f));
var Q=new EQ(f);return(new Promise(function(N){Or6(M,Q,function(Y){Y?(M.KJ=!0,hc(M.C,Q),LI(M,Q),aT(M,A)):g.MR(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(f)+" is not online."));N(Y)},5)})).then(function(N){return N?new chrome.cast.DialLaunchResponse(!1):WV7(M)})},JLB=function(M,f){var A=M.X.receiver.label,Q=M.Z.friendlyName;
return(new Promise(function(N){gHm(M.C,A,f,Q,function(Y){Y&&Y.token&&LI(M,Y);N(Y)},function(Y){oT(M,"Failed to get DIAL screen: "+Y);
N(null)})})).then(function(N){return N&&N.token?new chrome.cast.DialLaunchResponse(!1):WV7(M)})},Or6=function(M,f,A,Q){g.ad(M.G);
M.G=0;irw(M.C,f,function(N){N||Q<0?A(N):M.G=g.Uf(function(){Or6(M,f,A,Q-1)},300)})},aT=function(M,f){M.info("getDialAppInfoWithTimeout_ "+f);
VN(M)&&(g.ad(M.W),M.W=0,f==0?KV9(M):M.W=g.Uf(function(){KV9(M)},f))},KV9=function(M){VN(M)&&M.j.getDialAppInfo(function(f){M.info("getDialAppInfo dialLaunchData: "+JSON.stringify(f));
f=f.extraData||{};var A=null;if(f.loungeToken){var Q;((Q=M.K)==null?void 0:Q.token)==f.loungeToken&&(A="staleLoungeToken")}else A="missingLoungeToken";A?(M.jk=A,aT(M,3E4)):(M.KJ=!1,M.jk="unknown",uOe(M,f.loungeToken),aT(M,f.loungeTokenRefreshIntervalMs))},function(f){M.info("getDialAppInfo error: "+f);
M.jk="noLoungeTokenResponse";aT(M,3E4)})},G80=function(M){g.ad(M.G);
M.G=0;g.ad(M.W);M.W=0;M.N();M.N=function(){};
g.ad(M.B)},qA=function(M,f){Ss.call(this,M,f,"ManualSession");
this.j=g.Uf((0,g.IR)(this.As,this,null),150)},HF=function(M,f){g.pi.call(this);
this.config_=f;this.Z=M;this.X=f.appId||"233637DE";this.C=f.theme||"cl";this.B=f.disableCastApi||!1;this.G=f.forceMirroring||!1;this.K=null;this.W=!1;this.j=[];this.N=(0,g.IR)(this.qdx,this)},wy0=function(M,f){return f?g.oR(M.j,function(A){return tY(f,A.label)},M):null},md=function(M){Ac("Controller",M)},TQc=function(M){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(M)},se=function(M){return M.W||!!M.j.length||!!M.K},cF=function(M,f,A){f!=M.K&&(g.hW(M.K),(M.K=f)?(A?M.publish("yt-remote-cast2-receiver-resumed",
f.Z):M.publish("yt-remote-cast2-receiver-selected",f.Z),f.subscribe("sessionScreen",(0,g.IR)(M.zr,M,f)),f.subscribe("sessionFailed",function(){return l_K(M,f)}),f.K?M.publish("yt-remote-cast2-session-change",f.K):A&&M.K.As(null)):M.publish("yt-remote-cast2-session-change",null))},l_K=function(M,f){M.K==f&&M.publish("yt-remote-cast2-session-failed")},MSc=function(M){var f=M.Z.Bx(),A=M.K&&M.K.Z;
M=g.WP(f,function(Q){A&&tY(Q,A.label)&&(A=null);var N=Q.uuid?Q.uuid:Q.id,Y=wy0(this,Q);Y?(Y.label=N,Y.friendlyName=Q.name):(Y=new chrome.cast.Receiver(N,Q.name),Y.receiverType=chrome.cast.ReceiverType.CUSTOM);return Y},M);
A&&(A.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(A=new chrome.cast.Receiver(A.label,A.friendlyName),A.receiverType=chrome.cast.ReceiverType.CUSTOM),M.push(A));return M},TkB=function(M,f,A,Q){Q.disableCastApi?RT("Cannot initialize because disabled by Mdx config."):fyw()?AJB(f,Q)&&(QPW(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?NkW(M,A):(window.__onGCastApiAvailable=function(N,Y){N?NkW(M,A):(g6("Failed to load cast API: "+Y),YCB(!1),QPW(!1),g.FN("yt-remote-cast-available"),g.FN("yt-remote-cast-receiver"),
IyB(),A(!1))},Q.loadCastApiSetupScript?g.vU("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?WEm()>=60&&fDB():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?KE0():WEm()>=89?Q0W():(MAc(),V0(A09.map(GAW))))):RT("Cannot initialize because not running Chrome")},IyB=function(){RT("dispose");
var M=BF();M&&M.dispose();g.Gz("yt.mdx.remote.cloudview.instance_",null);DF6(!1);g.EC(ErB);ErB.length=0},i_=function(){return!!g.$J("yt-remote-cast-installed")},tSe=function(){var M=g.$J("yt-remote-cast-receiver");
return M?M.friendlyName:null},vrW=function(){RT("clearCurrentReceiver");
g.FN("yt-remote-cast-receiver")},pU9=function(){return i_()?BF()?BF().getCastSession():(g6("getCastSelector: Cast is not initialized."),null):(g6("getCastSelector: Cast API is not installed!"),null)},hsB=function(){i_()?BF()?xg()?(RT("Requesting cast selector."),BF().requestSession()):(RT("Wait for cast API to be ready to request the session."),ErB.push(g.Dy("yt-remote-cast2-api-ready",hsB))):g6("requestCastSelector: Cast is not initialized."):g6("requestCastSelector: Cast API is not installed!")},
ZM=function(M,f){xg()?BF().setConnectedScreenStatus(M,f):g6("setConnectedScreenStatus called before ready.")},fyw=function(){var M=g.ge().search(/ (CrMo|Chrome|CriOS)\//)>=0;
return g.nU||M},SCw=function(M,f){BF().init(M,f)},AJB=function(M,f){var A=!1;
BF()||(M=new HF(M,f),M.subscribe("yt-remote-cast2-availability-change",function(Q){g.jA("yt-remote-cast-available",Q);CA("yt-remote-cast2-availability-change",Q)}),M.subscribe("yt-remote-cast2-receiver-selected",function(Q){RT("onReceiverSelected: "+Q.friendlyName);
g.jA("yt-remote-cast-receiver",Q);CA("yt-remote-cast2-receiver-selected",Q)}),M.subscribe("yt-remote-cast2-receiver-resumed",function(Q){RT("onReceiverResumed: "+Q.friendlyName);
g.jA("yt-remote-cast-receiver",Q);CA("yt-remote-cast2-receiver-resumed",Q)}),M.subscribe("yt-remote-cast2-session-change",function(Q){RT("onSessionChange: "+vA(Q));
Q||g.FN("yt-remote-cast-receiver");CA("yt-remote-cast2-session-change",Q)}),g.Gz("yt.mdx.remote.cloudview.instance_",M),A=!0);
RT("cloudview.createSingleton_: "+A);return A},BF=function(){return g.wD("yt.mdx.remote.cloudview.instance_")},NkW=function(M,f){YCB(!0);
QPW(!1);SCw(M,function(A){A?(DF6(!0),g.tJ("yt-remote-cast2-api-ready")):(g6("Failed to initialize cast API."),YCB(!1),g.FN("yt-remote-cast-available"),g.FN("yt-remote-cast-receiver"),IyB());f(A)})},RT=function(M){Ac("cloudview",M)},g6=function(M){Ac("cloudview",M)},YCB=function(M){RT("setCastInstalled_ "+M);
g.jA("yt-remote-cast-installed",M)},xg=function(){return!!g.wD("yt.mdx.remote.cloudview.apiReady_")},DF6=function(M){RT("setApiReady_ "+M);
g.Gz("yt.mdx.remote.cloudview.apiReady_",M)},QPW=function(M){g.Gz("yt.mdx.remote.cloudview.initializing_",M)},r6=function(M){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.G=this.W=0;this.trackData=null;this.VK=this.BQ=!1;this.X=this.N=this.K=this.C=0;this.j=NaN;this.Z=!1;this.reset(M)},Lp9=function(M){M.audioTrackId=null;
M.trackData=null;M.playerState=-1;M.BQ=!1;M.VK=!1;M.W=0;M.G=g.EB();M.C=0;M.K=0;M.N=0;M.X=0;M.j=NaN;M.Z=!1},u_=function(M){return M.isPlaying()?(g.EB()-M.G)/1E3:0},zI=function(M,f){M.W=f;
M.G=g.EB()},PF=function(M){switch(M.playerState){case 1:case 1081:return(g.EB()-M.G)/1E3+M.W;
case -1E3:return 0}return M.W},nI=function(M,f,A){var Q=M.videoId;
M.videoId=f;M.index=A;f!=Q&&Lp9(M)},or7=function(M){var f={};
f.index=M.index;f.listId=M.listId;f.videoId=M.videoId;f.playerState=M.playerState;f.volume=M.volume;f.muted=M.muted;f.audioTrackId=M.audioTrackId;f.trackData=g.NV(M.trackData);f.hasPrevious=M.BQ;f.hasNext=M.VK;f.playerTime=M.W;f.playerTimeAt=M.G;f.seekableStart=M.C;f.seekableEnd=M.K;f.duration=M.N;f.loadedTime=M.X;f.liveIngestionTime=M.j;return f},$g=function(M,f){g.pi.call(this);
var A=this;this.j=0;this.C=M;this.G=[];this.N=new juW;this.Z=this.K=null;this.B=(0,g.IR)(this.L$O,this);this.W=(0,g.IR)(this.Et,this);this.X=(0,g.IR)(this.aB$,this);this.Er=(0,g.IR)(this.F$8,this);var Q=0;M?(Q=M.getProxyState(),Q!=3&&(M.subscribe("proxyStateChange",this.xe,this),Cmm(this))):Q=3;Q!=0&&(f?this.xe(Q):g.Uf(function(){A.xe(Q)},0));
(M=pU9())&&js(this,M);this.subscribe("yt-remote-cast2-session-change",this.Er)},FM=function(M){return new r6(M.C.getPlayerContextData())},Cmm=function(M){g.F0("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(f){this.G.push(this.C.subscribe(f,g.Dv(this.oCO,f),this))},M)},UF0=function(M){g.F0(M.G,function(f){this.C.unsubscribeByKey(f)},M);
M.G.length=0},yN=function(M){return M.getState()==1},d6=function(M,f){var A=M.N;
A.K.length+A.Z.length<50&&M.N.enqueue(f)},VS0=function(M,f,A){var Q=FM(M);
zI(Q,A);Q.playerState!=-1E3&&(Q.playerState=f);es(M,Q)},b_=function(M,f,A){M.C.sendMessage(f,A)},es=function(M,f){UF0(M);
M.C.setPlayerContextData(or7(f));Cmm(M)},js=function(M,f){M.Z&&(M.Z.removeUpdateListener(M.B),M.Z.removeMediaListener(M.W),M.Et(null));
M.Z=f;M.Z&&(QN("Setting cast session: "+M.Z.sessionId),M.Z.addUpdateListener(M.B),M.Z.addMediaListener(M.W),M.Z.media.length&&M.Et(M.Z.media[0]))},ayK=function(M){var f=M.K.media,A=M.K.customData;
if(f&&A){var Q=FM(M);f.contentId!=Q.videoId&&QN("Cast changing video to: "+f.contentId);Q.videoId=f.contentId;Q.playerState=A.playerState;zI(Q,M.K.getEstimatedTime());es(M,Q)}else QN("No cast media video. Ignoring state update.")},kg=function(M,f,A){return(0,g.IR)(function(Q){this.fW("Failed to "+f+" with cast v2 channel. Error code: "+Q.code);
Q.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.fW("Retrying "+f+" using MDx browser channel."),b_(this,f,A))},M)},XM=function(M,f,A,Q){Q=Q===void 0?!1:Q;
g.pi.call(this);var N=this;this.G=NaN;this.P7=!1;this.B=this.X=this.KJ=this.jk=NaN;this.Er=[];this.N=this.W=this.C=this.K=this.Z=null;this.fJ=M;this.g_=Q;this.Er.push(g.R0(window,"beforeunload",function(){N.kH(2)}));
this.j=[];this.K=new r6;this.nJ=f.id;this.z0=f.idType;this.Z=I_B(this.fJ,A,this.KL,this.z0=="shortLived",this.nJ);this.Z.listen("channelOpened",function(){qC7(N)});
this.Z.listen("channelClosed",function(){WF("Channel closed");isNaN(N.G)?LA(!0):LA();N.dispose()});
this.Z.listen("channelError",function(Y){LA();isNaN(N.TI())?(Y==1&&N.z0=="shortLived"&&N.publish("browserChannelAuthError",Y),WF("Channel error: "+Y+" without reconnection"),N.dispose()):(N.P7=!0,WF("Channel error: "+Y+" with reconnection in "+N.TI()+" ms"),Oe(N,2))});
this.Z.listen("channelMessage",function(Y){Hn7(N,Y)});
this.Z.e1(f.token);this.subscribe("remoteQueueChange",function(){var Y=N.K.videoId;g.yi()&&g.jA("yt-remote-session-video-id",Y)})},mF7=function(M){return g.oR(M.j,function(f){return f.type=="LOUNGE_SCREEN"})},WF=function(M){Ac("conn",M)},Oe=function(M,f){M.publish("proxyStateChange",f)},sPe=function(M){M.G=g.Uf(function(){WF("Connecting timeout");
M.kH(1)},2E4)},cJK=function(M){g.ad(M.G);
M.G=NaN},Rs6=function(M){g.ad(M.jk);
M.jk=NaN},BkB=function(M){grR(M);
M.KJ=g.Uf(function(){Jc(M,"getNowPlaying")},2E4)},grR=function(M){g.ad(M.KJ);
M.KJ=NaN},qC7=function(M){WF("Channel opened");
M.P7&&(M.P7=!1,Rs6(M),M.jk=g.Uf(function(){WF("Timing out waiting for a screen.");M.kH(1)},15E3))},xF6=function(M,f){var A=null;
if(f){var Q=mF7(M);Q&&(A={clientName:Q.clientName,deviceMake:Q.brand,deviceModel:Q.model,osVersion:Q.osVersion})}g.Gz("yt.mdx.remote.remoteClient_",A);f&&(cJK(M),Rs6(M));A=M.Z.w7()&&isNaN(M.G);f==A?f&&(Oe(M,1),Jc(M,"getSubtitlesTrack")):f?(M.PR()&&M.K.reset(),Oe(M,1),Jc(M,"getNowPlaying"),inB(M)):M.kH(1)},Znm=function(M,f){var A=f.params.videoId;
delete f.params.videoId;A==M.K.videoId&&(g.MV(f.params)?M.K.trackData=null:M.K.trackData=f.params,M.publish("remotePlayerChange"))},rJC=function(M,f,A){var Q=f.params.videoId||f.params.video_id,N=parseInt(f.params.currentIndex,10);
M.K.listId=f.params.listId||M.K.listId;nI(M.K,Q,N);M.publish("remoteQueueChange",A)},zsv=function(M,f){f.params=f.params||{};
rJC(M,f,"NOW_PLAYING_MAY_CHANGE");uHc(M,f);M.publish("autoplayDismissed")},uHc=function(M,f){var A=parseInt(f.params.currentTime||f.params.current_time,10);
zI(M.K,isNaN(A)?0:A);A=parseInt(f.params.state,10);A=isNaN(A)?-1:A;A==-1&&M.K.playerState==-1E3&&(A=-1E3);M.K.playerState=A;A=Number(f.params.loadedTime);M.K.X=isNaN(A)?0:A;M.K.Xy(Number(f.params.duration));A=M.K;var Q=Number(f.params.liveIngestionTime);A.j=Q;A.Z=isNaN(Q)?!1:!0;A=M.K;Q=Number(f.params.seekableStartTime);f=Number(f.params.seekableEndTime);A.C=isNaN(Q)?0:Q;A.K=isNaN(f)?0:f;M.K.playerState==1?BkB(M):grR(M);M.publish("remotePlayerChange")},Pmw=function(M,f){if(M.K.playerState!=-1E3){var A=
1085;
switch(parseInt(f.params.adState,10)){case 1:A=1081;break;case 2:A=1084;break;case 0:A=1083}M.K.playerState=A;f=parseInt(f.params.currentTime,10);zI(M.K,isNaN(f)?0:f);M.publish("remotePlayerChange")}},nrR=function(M,f){var A=f.params.muted=="true";
M.K.volume=parseInt(f.params.volume,10);M.K.muted=A;M.publish("remotePlayerChange")},jPR=function(M,f){M.W=f.params.videoId;
M.publish("nowAutoplaying",parseInt(f.params.timeout,10))},$Fe=function(M,f){M.W=f.params.videoId||null;
M.publish("autoplayUpNext",M.W)},Fp0=function(M,f){M.N=f.params.autoplayMode;
M.publish("autoplayModeChange",M.N);M.N=="DISABLED"&&M.publish("autoplayDismissed")},yJW=function(M,f){var A=f.params.hasNext=="true";
M.K.BQ=f.params.hasPrevious=="true";M.K.VK=A;M.publish("previousNextChange")},Hn7=function(M,f){f=f.message;
f.params?WF("Received: action="+f.action+", params="+g.b4(f.params)):WF("Received: action="+f.action+" {}");switch(f.action){case "loungeStatus":f=Q0(f.params.devices);M.j=g.WP(f,function(Q){return new Dh(Q)});
f=!!g.oR(M.j,function(Q){return Q.type=="LOUNGE_SCREEN"});
xF6(M,f);f=M.U9("mlm");M.publish("multiStateLoopEnabled",f);break;case "loungeScreenDisconnected":g.HK(M.j,function(Q){return Q.type=="LOUNGE_SCREEN"});
xF6(M,!1);break;case "remoteConnected":var A=new Dh(Q0(f.params.device));g.oR(M.j,function(Q){return Q.equals(A)})||FmW(M.j,A);
break;case "remoteDisconnected":A=new Dh(Q0(f.params.device));g.HK(M.j,function(Q){return Q.equals(A)});
break;case "gracefulDisconnect":break;case "playlistModified":rJC(M,f,"QUEUE_MODIFIED");break;case "nowPlaying":zsv(M,f);break;case "onStateChange":uHc(M,f);break;case "onAdStateChange":Pmw(M,f);break;case "onVolumeChanged":nrR(M,f);break;case "onSubtitlesTrackChanged":Znm(M,f);break;case "nowAutoplaying":jPR(M,f);break;case "autoplayDismissed":M.publish("autoplayDismissed");break;case "autoplayUpNext":$Fe(M,f);break;case "onAutoplayModeChanged":Fp0(M,f);break;case "onHasPreviousNextChanged":yJW(M,
f);break;case "requestAssistedSignIn":M.publish("assistedSignInRequested",f.params.authCode);break;case "onLoopModeChanged":M.publish("loopModeChange",f.params.loopMode);break;default:WF("Unrecognized action: "+f.action)}},inB=function(M){g.ad(M.B);
M.B=g.Uf(function(){M.kH(1)},864E5)},Jc=function(M,f,A){A?WF("Sending: action="+f+", params="+g.b4(A)):WF("Sending: action="+f);
M.Z.sendMessage(f,A)},dF9=function(M){TI.call(this,"ScreenServiceProxy");
this.py=M;this.K=[];this.K.push(this.py.$_s("screenChange",(0,g.IR)(this.dg,this)));this.K.push(this.py.$_s("onlineScreenChange",(0,g.IR)(this.wXN,this)))},Onm=function(M,f){eG6();
if(!oE||!oE.get("yt-remote-disable-remote-module-for-dev")){f=g.GR("MDX_CONFIG")||f;uKB();jd6();KI||(KI=new lq(f?f.loungeApiHost:void 0),b06()&&(KI.K="/api/loungedev"));GI||(GI=g.wD("yt.mdx.remote.deferredProxies_")||[],g.Gz("yt.mdx.remote.deferredProxies_",GI));es9();var A=w6();if(!A){var Q=new pI(KI,f?f.disableAutomaticScreenCache||!1:!1);g.Gz("yt.mdx.remote.screenService_",Q);A=w6();var N={};f&&(N={appId:f.appId,disableDial:f.disableDial,theme:f.theme,loadCastApiSetupScript:f.loadCastApiSetupScript,
disableCastApi:f.disableCastApi,enableDialLoungeToken:f.enableDialLoungeToken,enableCastLoungeToken:f.enableCastLoungeToken,forceMirroring:f.forceMirroring});g.Gz("yt.mdx.remote.enableConnectWithInitialState_",f?f.enableConnectWithInitialState||!1:!1);TkB(M,Q,function(Y){Y?l_()&&ZM(l_(),"YouTube TV"):Q.subscribe("onlineScreenChange",function(){CA("yt-remote-receiver-availability-change")})},N)}f&&!g.wD("yt.mdx.remote.initialized_")&&(g.Gz("yt.mdx.remote.initialized_",!0),Mg("Initializing: "+g.b4(f)),
ff.push(g.Dy("yt-remote-cast2-api-ready",function(){CA("yt-remote-api-ready")})),ff.push(g.Dy("yt-remote-cast2-availability-change",function(){CA("yt-remote-receiver-availability-change")})),ff.push(g.Dy("yt-remote-cast2-receiver-selected",function(){As(null);
CA("yt-remote-auto-connect","cast-selector-receiver")})),ff.push(g.Dy("yt-remote-cast2-receiver-resumed",function(){CA("yt-remote-receiver-resumed","cast-selector-receiver")})),ff.push(g.Dy("yt-remote-cast2-session-change",bne)),ff.push(g.Dy("yt-remote-connection-change",function(Y){Y?ZM(l_(),"YouTube TV"):QS()||(ZM(null,null),vrW())})),ff.push(g.Dy("yt-remote-cast2-session-failed",function(){CA("yt-remote-connection-failed")})),M=km9(),f.isAuto&&(M.id+="#dial"),N=f.capabilities||[],g.mE("desktop_enable_autoplay")&&
N.push("atp"),N.length>0&&(M.capabilities=N),M.name=f.device,M.app=f.app,(f=f.theme)&&(M.theme=f),Mg(" -- with channel params: "+g.b4(M)),M?(g.jA("yt-remote-session-app",M.app),g.jA("yt-remote-session-name",M.name)):(g.FN("yt-remote-session-app"),g.FN("yt-remote-session-name")),g.Gz("yt.mdx.remote.channelParams_",M),A.start(),l_()||Wp6())}},XUW=function(){var M=w6().py.$_gos();
var f=Ng();f&&YP()&&(rIv(M,f)||M.push(f));return Z0B(M)},KpB=function(){var M=JJv();
!M&&i_()&&tSe()&&(M={key:"cast-selector-receiver",name:tSe()});return M},JJv=function(){var M=XUW(),f=Ng();
f||(f=QS());return g.oR(M,function(A){return f&&tY(f,A.key)?!0:!1})},Ng=function(){var M=l_();
if(!M)return null;var f=w6().nh();return pA(f,M)},bne=function(M){Mg("remote.onCastSessionChange_: "+vA(M));
if(M){var f=Ng();if(f&&f.id==M.id){if(ZM(f.id,"YouTube TV"),M.idType=="shortLived"&&(M=M.token))Iy&&(Iy.token=M),(f=YP())&&f.e1(M)}else f&&TT(),D3(M,1)}else YP()&&TT()},TT=function(){xg()?BF().stopSession():g6("stopSession called before API ready.");
var M=YP();M&&(M.disconnect(1),Gm9(null))},wUc=function(){var M=YP();
return!!M&&M.getProxyState()!=3},Mg=function(M){Ac("remote",M)},w6=function(){if(!lye){var M=g.wD("yt.mdx.remote.screenService_");
lye=M?new dF9(M):null}return lye},l_=function(){return g.wD("yt.mdx.remote.currentScreenId_")},MZv=function(M){g.Gz("yt.mdx.remote.currentScreenId_",M)},frR=function(){return g.wD("yt.mdx.remote.connectData_")},As=function(M){g.Gz("yt.mdx.remote.connectData_",M)},YP=function(){return g.wD("yt.mdx.remote.connection_")},Gm9=function(M){var f=YP();
As(null);M||MZv("");g.Gz("yt.mdx.remote.connection_",M);GI&&(g.F0(GI,function(A){A(M)}),GI.length=0);
f&&!M?CA("yt-remote-connection-change",!1):!f&&M&&CA("yt-remote-connection-change",!0)},QS=function(){var M=g.yi();
if(!M)return null;var f=w6();if(!f)return null;f=f.nh();return pA(f,M)},D3=function(M,f){l_();
Ng()&&Ng();if(ET)Iy=M;else{MZv(M.id);var A=g.wD("yt.mdx.remote.enableConnectWithInitialState_")||!1;M=new XM(KI,M,km9(),A);M.connect(f,frR());M.subscribe("beforeDisconnect",function(Q){CA("yt-remote-before-disconnect",Q)});
M.subscribe("beforeDispose",function(){YP()&&(YP(),Gm9(null))});
M.subscribe("browserChannelAuthError",function(){var Q=Ng();Q&&Q.idType=="shortLived"&&(xg()?BF().handleBrowserChannelAuthError():g6("refreshLoungeToken called before API ready."))});
Gm9(M)}},Wp6=function(){var M=QS();
M?(Mg("Resume connection to: "+vA(M)),D3(M,0)):(LA(),vrW(),Mg("Skipping connecting because no session screen found."))},es9=function(){var M=km9();
if(g.MV(M)){M=Sq();var f=g.$J("yt-remote-session-name")||"",A=g.$J("yt-remote-session-app")||"";M={device:"REMOTE_CONTROL",id:M,name:f,app:A,mdxVersion:3};M.authuser=String(g.GR("SESSION_INDEX","0"));(f=g.GR("DELEGATED_SESSION_ID"))&&(M.pageId=String(f));g.Gz("yt.mdx.remote.channelParams_",M)}},km9=function(){return g.wD("yt.mdx.remote.channelParams_")||{}},NZB=function(M,f,A){g.y.call(this);
var Q=this;this.K=M;this.U=f;this.td=A;this.events=new g.yK(this);this.N=!1;this.G=new g.v8(64);this.Z=new g.MY(this.Qq,500,this);this.j=new g.MY(this.Ee,1E3,this);this.X=new aE(this.FRu,0,this);this.C={};this.B=new g.MY(this.E4,1E3,this);this.W=new g.NY(this.seekTo,1E3,this);this.Er=this.events.J(this.U,"onVolumeChange",function(N){AQB(Q,N)});
g.d(this,this.events);this.events.J(f,"onCaptionsTrackListChanged",this.yPY);this.events.J(f,"captionschanged",this.lB_);this.events.J(f,"captionssettingschanged",this.Cl);this.events.J(f,"videoplayerreset",this.IP);this.events.J(f,"mdxautoplaycancel",function(){Q.td.n4()});
f.V("enable_mdx_video_play_directly")&&this.events.J(f,"videodatachange",function(){Qzv(Q.K)||ts(Q)||vN(Q,0)});
M=this.td;M.ek();M.subscribe("proxyStateChange",this.iC,this);M.subscribe("remotePlayerChange",this.i6,this);M.subscribe("remoteQueueChange",this.IP,this);M.subscribe("previousNextChange",this.tK,this);M.subscribe("nowAutoplaying",this.sX,this);M.subscribe("autoplayDismissed",this.OX,this);g.d(this,this.Z);g.d(this,this.j);g.d(this,this.X);g.d(this,this.B);g.d(this,this.W);this.Cl();this.IP();this.i6()},AQB=function(M,f){if(ts(M)){M.td.unsubscribe("remotePlayerChange",M.i6,M);
var A=Math.round(f.volume);f=!!f.muted;var Q=FM(M.td);if(A!==Q.volume||f!==Q.muted)M.td.setVolume(A,f),M.B.start();M.td.subscribe("remotePlayerChange",M.i6,M)}},Y9W=function(M){M.z_(0);
M.Z.stop();M.Q7(new g.v8(64))},IrC=function(M,f){if(ts(M)&&!M.N){var A=null;
f&&(A={style:M.U.getSubtitlesUserSettings()},Object.assign(A,f));M.td.Ek(M.U.getVideoData(1).videoId,A);M.C=g.F(FM(M.td).trackData)}},vN=function(M,f){var A=M.U.getPlaylist();
if(A==null?0:A.listId){var Q=A.index;var N=A.listId.toString()}A=M.U.getVideoData(1);M.td.playVideo(A.videoId,f,Q,N,A.playerParams,A.fJ,$4m(A));M.Q7(new g.v8(1))},TZ9=function(M,f){if(f){var A=M.U.getOption("captions","tracklist",{E9:1});
A&&A.length?(M.U.setOption("captions","track",f),M.N=!1):(M.U.loadModule("captions"),M.N=!0)}else M.U.setOption("captions","track",{})},ts=function(M){return FM(M.td).videoId===M.U.getVideoData(1).videoId},D8e=function(M,f){g.$c.call(this,M);
this.K=f},pf=function(){g.O.call(this,{S:"div",
Y:"ytp-mdx-popup-dialog",D:{role:"dialog"},L:[{S:"div",Y:"ytp-mdx-popup-dialog-inner-content",L:[{S:"div",Y:"ytp-mdx-popup-title",Ix:"You're signed out"},{S:"div",Y:"ytp-mdx-popup-description",Ix:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{S:"div",Y:"ytp-mdx-privacy-popup-buttons",L:[{S:"button",Ai:["ytp-button","ytp-mdx-privacy-popup-cancel"],Ix:"Cancel"},{S:"button",Ai:["ytp-button",
"ytp-mdx-privacy-popup-confirm"],Ix:"Confirm"}]}]}]});this.fade=new g.I1(this,250);this.cancelButton=this.H7("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.H7("ytp-mdx-privacy-popup-confirm");g.d(this,this.fade);this.J(this.cancelButton,"click",this.K);this.J(this.confirmButton,"click",this.Z)},hs=function(M){g.O.call(this,{S:"div",
Y:"ytp-remote",L:[{S:"div",Y:"ytp-remote-display-status",L:[{S:"div",Y:"ytp-remote-display-status-icon",L:[g.ok9()]},{S:"div",Y:"ytp-remote-display-status-text",Ix:"{{statustext}}"}]}]});this.api=M;this.fade=new g.I1(this,250);g.d(this,this.fade);this.J(M,"presentingplayerstatechange",this.onStateChange);this.Rt(M.getPlayerStateObject())},S5=function(M,f){g.no.call(this,"Play on",1,M,f);
this.U=M;this.VB={};this.J(M,"onMdxReceiversChange",this.C);this.J(M,"presentingplayerstatechange",this.C);this.C()},Ebe=function(M){g.CV.call(this,M);
this.CF={key:xRW(),name:"This computer"};this.k7=null;this.subscriptions=[];this.Qc=this.td=null;this.VB=[this.CF];this.C1=this.CF;this.Oq=new g.v8(64);this.Vx=0;this.P2=-1;this.mZ=!1;this.MY=this.cO=this.QT=null;if(!g.eX(this.player.T())&&!g.dA(this.player.T())){M=this.player;var f=g.al(M);f&&(f=f.cB())&&(f=new S5(M,f),g.d(this,f));f=new hs(M);g.d(this,f);g.$X(M,f.element,4);this.QT=new pf;g.d(this,this.QT);g.$X(M,this.QT.element,4);this.mZ=!!QS()}},Lf=function(M){M.cO&&(M.player.removeEventListener("presentingplayerstatechange",
M.cO),M.cO=null)},tZc=function(M,f,A){M.Oq=A;
M.player.publish("presentingplayerstatechange",new g.CJ(A,f))},oy=function(M,f){if(f.key!==M.C1.key)if(f.key===M.CF.key)TT();
else if(Qzv(M)&&vbB(M),M.C1=f,!M.player.T().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.dA(M.player.T())){var A=M.player.getPlaylistId();var Q=M.player.getVideoData(1);var N=Q.videoId;if(!A&&!N||(M.player.getAppState()===2||M.player.getAppState()===1)&&M.player.T().V("should_clear_video_data_on_player_cued_unstarted"))Q=null;else{var Y=M.player.getPlaylist();if(Y){var I=[];for(var D=0;D2*this.size&&Tu(this),!0):!1};
g.C.get=function(M,f){return YC(this.Z,M)?this.Z[M]:f};
g.C.set=function(M,f){YC(this.Z,M)||(this.size+=1,this.K.push(M),this.Ht++);this.Z[M]=f};
g.C.forEach=function(M,f){for(var A=this.Ou(),Q=0;Q=Q.K.length)return g.Da;var Y=Q.K[f++];return g.Zx(M?Y:Q.Z[Y])};
return N};
var Ifw={uV_:"atp",Y57:"ska",Kxk:"que",zyB:"mus",v7k:"sus",aQ$:"dsp",UDO:"seq",IMO:"mic",IQB:"dpa",CSY:"mlm",K2k:"dsdtr",yei:"ntb",nNO:"vsp",A$u:"scn",IHi:"rpe",sYk:"dcn",QqN:"dcp",Mv$:"pas",Em8:"drq",GHJ:"opf",S3B:"els",pUY:"isg",cC$:"svq",PSO:"mvp",PDu:"ads",aHk:"stcp",Gvk:"sads",d43:"dloc"},cI9={eYu:"u",oI8:"cl",w_N:"k",k9i:"i",lX_:"cr",pB8:"m",RGk:"g",Wf:"up"},WHW={yO:"adPlaying",ge:"onAdStateChange"},OHB={ce0:"nowPlaying",q68:"onStateChange",yO:"adPlaying",ge:"onAdStateChange",fq:"nowPlayingShorts",
eM:"onShortsStateChange"},XY0={fq:"nowPlayingShorts",eM:"onShortsStateChange"};Dh.prototype.equals=function(M){return M?this.id==M.id:!1};
var nyB="",oE=null;kA7.prototype.flush=function(M,f){M=M===void 0?[]:M;f=f===void 0?!1:f;if(g.mE("enable_client_streamz_web")){M=g.V(M);for(var A=M.next();!A.done;A=M.next())A=g.YR0(A.value),A={serializedIncrementBatch:g.An(A.Z())},g.hO("streamzIncremented",A,{sendIsolatedPayload:f})}};
var UQ,lfe=O0B("loadCastFramework")||O0B("loadCastApplicationFramework"),A09=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.pm(aE,g.y);g.C=aE.prototype;g.C.NN=function(M){this.C=arguments;this.K=!1;this.V7?this.j=g.EB()+this.du:this.V7=g.Fd(this.N,this.du)};
g.C.stop=function(){this.V7&&(g.Kb.clearTimeout(this.V7),this.V7=null);this.j=null;this.K=!1;this.C=[]};
g.C.pause=function(){++this.Z};
g.C.resume=function(){this.Z&&(--this.Z,!this.Z&&this.K&&(this.K=!1,this.G.apply(null,this.C)))};
g.C.u8=function(){this.stop();aE.kZ.u8.call(this)};
g.C.qN=function(){this.V7&&(g.Kb.clearTimeout(this.V7),this.V7=null);this.j?(this.V7=g.Fd(this.N,this.j-g.EB()),this.j=null):this.Z?this.K=!0:(this.K=!1,this.G.apply(null,this.C))};qI.prototype.stringify=function(M){return g.Kb.JSON.stringify(M,void 0)};
qI.prototype.parse=function(M){return g.Kb.JSON.parse(M,void 0)};g.pm(N$B,g.wi);g.pm(Y8e,g.wi);var ID0=null;g.pm(Dh6,g.wi);g.pm(EJc,g.wi);g.pm(tAR,g.wi);cA.prototype.debug=function(){};
cA.prototype.info=function(){};
cA.prototype.warning=function(){};var Uh9={},C$B={};g.C=RE.prototype;g.C.setTimeout=function(M){this.l8=M};
g.C.RB=function(M){M=M.target;var f=this.YO;f&&g.Kz(M)==3?f.Hc():this.NA(M)};
g.C.NA=function(M){try{if(M==this.K)a:{var f=g.Kz(this.K),A=this.K.Z,Q=this.K.getStatus();if(!(f<3)&&(f!=3||this.K&&(this.Z.Z||g.w1(this.K)||g.l4(this.K)))){this.g_||f!=4||A==7||(A==8||Q<=0?HA(3):HA(2));q8R(this);var N=this.K.getStatus();this.Qw=N;var Y=oJw(this);if(this.G=N==200){if(this.Z9&&!this.ox){b:{if(this.K){var I=g.Ml(this.K,"X-HTTP-Initial-Response");if(I&&!g.V1(I)){var D=I;break b}}D=null}if(M=D)this.ox=!0,xhC(this,M);else{this.G=!1;this.N=3;m0(12);BA(this);iq(this);break a}}if(this.z0){M=
!0;for(var E;!this.g_&&this.W0&&!this.zt&&(this.zt=!0,this.j.jq(this)):(BA(this),iq(this))}else xhC(this,Y);f==4&&BA(this);this.G&&!this.g_&&(f==4?HMm(this.j,this):(this.G=!1,g_(this)))}else g.BEz(this.K),N==400&&Y.indexOf("Unknown SID")>
0?(this.N=3,m0(12)):(this.N=0,m0(13)),BA(this),iq(this)}}}catch(t){}finally{}};
g.C.cancel=function(){this.g_=!0;BA(this)};
g.C.VE=function(){this.Er=null;var M=Date.now();M-this.b8>=0?(this.nJ!=2&&(HA(3),m0(17)),BA(this),this.N=2,iq(this)):aDw(this,this.b8-M)};
g.C.getLastError=function(){return this.N};
g.C.nj=function(){return this.K};r0e.prototype.cancel=function(){this.j=zYB(this);if(this.Z)this.Z.cancel(),this.Z=null;else if(this.K&&this.K.size!==0){for(var M=g.V(this.K.values()),f=M.next();!f.done;f=M.next())f.value.cancel();this.K.clear()}};g.C=Fl6.prototype;g.C.qA=8;g.C.x$=1;g.C.connect=function(M,f,A,Q){m0(0);this.oE=M;this.g_=f||{};A&&Q!==void 0&&(this.g_.OSID=A,this.g_.OAID=Q);this.ox=this.Yp;this.fJ=gJv(this,null,this.oE);uq(this)};
g.C.disconnect=function(){dhK(this);if(this.x$==3){var M=this.Ji++,f=this.fJ.clone();g.SF(f,"SID",this.C);g.SF(f,"RID",M);g.SF(f,"TYPE","terminate");nA(this,f);M=new RE(this,this.C,M);M.nJ=2;M.X=fA(f.clone());f=!1;if(g.Kb.navigator&&g.Kb.navigator.sendBeacon)try{f=g.Kb.navigator.sendBeacon(M.X.toString(),"")}catch(A){}!f&&g.Kb.Image&&((new Image).src=M.X,f=!0);f||(M.K=S8m(M.j,null),M.K.send(M.X));M.jk=Date.now();g_(M)}XDm(this)};
g.C.xZ=function(){return this.x$==0};
g.C.getState=function(){return this.x$};
g.C.Re=function(M){if(this.G)if(this.G=null,this.x$==1){if(!M){this.Ji=Math.floor(Math.random()*1E5);M=this.Ji++;var f=new RE(this,"",M),A=this.B;this.Qw&&(A?(A=g.Q1(A),g.Y1(A,this.Qw)):A=this.Qw);this.W!==null||this.b8||(f.fJ=A,A=null);var Q;if(this.xO)a:{for(var N=Q=0;N4096){Q=N;break a}if(Q===4096||N===this.j.length-1){Q=N+1;break a}}Q=
1E3}else Q=1E3;Q=kXK(this,f,Q);N=this.fJ.clone();g.SF(N,"RID",M);g.SF(N,"CVER",22);this.z0&&g.SF(N,"X-HTTP-Session-Id",this.z0);nA(this,N);A&&(this.b8?Q="headers="+g.o9(g.Wbe(A))+"&"+Q:this.W&&g.Uk(N,this.W,A));RYB(this.Z,f);this.vy&&g.SF(N,"TYPE","init");this.xO?(g.SF(N,"$req",Q),g.SF(N,"SID","null"),f.Z9=!0,hYK(f,N,null)):hYK(f,N,Q);this.x$=2}}else this.x$==3&&(M?Wlm(this,M):this.j.length==0||uNC(this.Z)||Wlm(this))};
g.C.Vf=function(){this.X=null;OM9(this);if(this.MV&&!(this.l8||this.K==null||this.d2<=0)){var M=2*this.d2;this.P7=sQ((0,g.IR)(this.hNJ,this),M)}};
g.C.hNJ=function(){this.P7&&(this.P7=null,this.ox=!1,this.l8=!0,m0(10),Zh(this),OM9(this))};
g.C.jq=function(M){this.K==M&&this.MV&&!this.l8&&(y00(this),this.l8=!0,m0(11))};
g.C.WL=function(){this.Er!=null&&(this.Er=null,Zh(this),s07(this),m0(19))};
g.C.oZ3=function(M){M?m0(2):m0(1)};
g.C.isActive=function(){return!!this.N&&this.N.isActive(this)};
g.C=KlB.prototype;g.C.YE=function(){};
g.C.vx=function(){};
g.C.OO=function(){};
g.C.Wx=function(){};
g.C.isActive=function(){return!0};
g.C.Oz=function(){};g.pm($C,g.Lz);$C.prototype.open=function(){this.K.N=this.j;this.G&&(this.K.nJ=!0);this.K.connect(this.N,this.Z||void 0)};
$C.prototype.close=function(){this.K.disconnect()};
$C.prototype.send=function(M){var f=this.K;if(typeof M==="string"){var A={};A.__data__=M;M=A}else this.C&&(A={},A.__data__=g.b4(M),M=A);f.j.push(new ZM9(f.Wy++,M));f.x$==3&&uq(f)};
$C.prototype.u8=function(){this.K.N=null;delete this.j;this.K.disconnect();delete this.K;$C.kZ.u8.call(this)};
g.pm(wDm,N$B);g.pm(lD6,Y8e);g.pm(jq,KlB);jq.prototype.YE=function(){this.K.dispatchEvent("m")};
jq.prototype.vx=function(M){this.K.dispatchEvent(new wDm(M))};
jq.prototype.OO=function(M){this.K.dispatchEvent(new lD6(M))};
jq.prototype.Wx=function(){this.K.dispatchEvent("n")};var y0=new g.Lz;g.U(AOc,g.wi);g.C=eq.prototype;g.C.An=null;g.C.aG=!1;g.C.gw=null;g.C.Sn=null;g.C.JZ=null;g.C.Zm=null;g.C.wv=null;g.C.Kg=null;g.C.U1=null;g.C.fK=null;g.C.tB=0;g.C.RT=null;g.C.IV=null;g.C.fH=null;g.C.Mc=-1;g.C.o7=!0;g.C.Y0=!1;g.C.pN=0;g.C.EM=null;var DrK={},TXc={};g.C=eq.prototype;g.C.setTimeout=function(M){this.Z=M};
g.C.wZ=function(M){M=M.target;var f=this.EM;f&&g.Kz(M)==3?f.Hc():this.MA(M)};
g.C.MA=function(M){try{if(M==this.fK)a:{var f=g.Kz(this.fK),A=this.fK.Z,Q=this.fK.getStatus();if(g.Kg&&!g.BB("420+")){if(f<4)break a}else if(f<3||f==3&&!g.w1(this.fK))break a;this.Y0||f!=4||A==7||(A==8||Q<=0?this.K.s2(3):this.K.s2(2));vkB(this);var N=this.fK.getStatus();this.Mc=N;var Y=g.w1(this.fK);if(this.aG=N==200){f==4&&bq(this);if(this.z0){for(M=!0;!this.Y0&&this.tB0?(this.fH=3,d_(13)):(this.fH=0,d_(14)),bq(this),pYK(this)}}catch(D){}finally{}};
g.C.cancel=function(){this.Y0=!0;bq(this)};
g.C.vL=function(){this.gw=null;var M=Date.now();M-this.Sn>=0?(this.Zm!=2&&this.K.s2(3),bq(this),this.fH=2,d_(18),pYK(this)):tjw(this,this.Sn-M)};
g.C.getLastError=function(){return this.fH};g.C=oke.prototype;g.C.fN=null;g.C.Ik=null;g.C.OE=!1;g.C.g0=null;g.C.dD=null;g.C.kV=-1;g.C.uP=null;g.C.WD=null;g.C.connect=function(M){this.g0=M;M=WA(this.K,null,this.g0);d_(3);Date.now();var f=this.K.B;f!=null?(this.uP=f[0],(this.WD=f[1])?(this.dD=1,CVK(this)):(this.dD=2,UrB(this))):(AY(M,"MODE","init"),this.Ik=new eq(this),this.Ik.An=this.fN,YL9(this.Ik,M,!1,null,!0),this.dD=0)};
g.C.m8=function(M){if(M)this.dD=2,UrB(this);else{d_(4);var f=this.K;f.cQ=f.iy.kV;KA(f,9)}M&&this.s2(2)};
g.C.AQ=function(M){return this.K.AQ(M)};
g.C.abort=function(){this.Ik&&(this.Ik.cancel(),this.Ik=null);this.kV=-1};
g.C.xZ=function(){return!1};
g.C.Jp=function(M,f){this.kV=M.Mc;if(this.dD==0)if(f){try{var A=this.Z.parse(f)}catch(Q){M=this.K;M.cQ=this.kV;KA(M,2);return}this.uP=A[0];this.WD=A[1]}else M=this.K,M.cQ=this.kV,KA(M,2);else this.dD==2&&(this.OE?(d_(7),Date.now()):f=="11111"?(d_(6),this.OE=!0,Date.now(),this.kV=200,this.Ik.cancel(),d_(12),OQ(this.K,this,!0)):(d_(8),Date.now(),this.OE=!1))};
g.C.Uh=function(){this.kV=this.Ik.Mc;if(this.Ik.aG)this.dD==0?this.WD?(this.dD=1,CVK(this)):(this.dD=2,UrB(this)):this.dD==2&&(this.OE?(d_(12),OQ(this.K,this,!0)):(d_(11),OQ(this.K,this,!1)));else{this.dD==0?d_(9):this.dD==2&&d_(10);var M=this.K;this.Ik.getLastError();M.cQ=this.kV;KA(M,2)}};
g.C.XT=function(){return this.K.XT()};
g.C.isActive=function(){return this.K.isActive()};
g.C.s2=function(M){this.K.s2(M)};g.C=Vjm.prototype;g.C.E5=null;g.C.TK=null;g.C.AT=null;g.C.k$=null;g.C.nN=null;g.C.kq=null;g.C.Xl=null;g.C.yn=null;g.C.hZ=0;g.C.MN=0;g.C.BK=null;g.C.L_=null;g.C.jh=null;g.C.eL=null;g.C.iy=null;g.C.bQ=null;g.C.nu=-1;g.C.TE=-1;g.C.cQ=-1;g.C.y9=0;g.C.e7=0;g.C.g9=8;var pfR={OK:0,iIJ:2,Bi_:4,m_i:5,gN_:6,STOP:7,AG:8,Hir:9,k7_:10,ii8:11,zr3:12};g.pm(qLB,g.wi);g.pm(HHC,g.wi);g.C=Vjm.prototype;
g.C.connect=function(M,f,A,Q,N){d_(0);this.nN=f;this.TK=A||{};Q&&N!==void 0&&(this.TK.OSID=Q,this.TK.OAID=N);this.X?(FW((0,g.IR)(this.Zb,this,M),100),suR(this)):this.Zb(M)};
g.C.disconnect=function(){cOB(this);if(this.K==3){var M=this.hZ++,f=this.kq.clone();g.SF(f,"SID",this.C);g.SF(f,"RID",M);g.SF(f,"TYPE","terminate");JY(this,f);M=new eq(this,this.C,M);M.Zm=2;M.wv=fA(f.clone());(new Image).src=M.wv.toString();M.JZ=Date.now();INW(M)}PVB(this)};
g.C.Zb=function(M){this.iy=new oke(this);this.iy.fN=this.E5;this.iy.Z=this.N;this.iy.connect(M)};
g.C.xZ=function(){return this.K==0};
g.C.getState=function(){return this.K};
g.C.lW=function(M){this.L_=null;xrm(this,M)};
g.C.hp=function(){this.jh=null;this.k$=new eq(this,this.C,"rpc",this.W);this.k$.An=this.E5;this.k$.pN=0;var M=this.Xl.clone();g.SF(M,"RID","rpc");g.SF(M,"SID",this.C);g.SF(M,"CI",this.bQ?"0":"1");g.SF(M,"AID",this.nu);JY(this,M);g.SF(M,"TYPE","xmlhttp");YL9(this.k$,M,!0,this.yn,!1)};
g.C.Jp=function(M,f){if(this.K!=0&&(this.k$==M||this.AT==M))if(this.cQ=M.Mc,this.AT==M&&this.K==3)if(this.g9>7){try{var A=this.N.parse(f)}catch(Q){A=null}if(Array.isArray(A)&&A.length==3)if(M=A,M[0]==0)a:{if(!this.jh){if(this.k$)if(this.k$.JZ+3E30)){if(Q=f==1)this.AT||this.L_||this.K==1||this.y9>=2?Q=!1:(this.L_=FW((0,g.IR)(this.lW,this,M),rO0(this,this.y9)),this.y9++,
Q=!0);Q=!(Q||f==2&&u36(this))}if(Q)switch(A){case 1:KA(this,5);break;case 4:KA(this,10);break;case 3:KA(this,6);break;case 7:KA(this,12);break;default:KA(this,2)}}};
g.C.Ys=function(M){if(!g.V9(arguments,this.K))throw Error("Unexpected channel state: "+this.K);};
g.C.m$$=function(M){M?d_(2):(d_(1),z5e(this,8))};
g.C.AQ=function(M){if(M)throw Error("Can't create secondary domain capable XhrIo object.");M=new g.On;M.W=!1;return M};
g.C.isActive=function(){return!!this.BK&&this.BK.isActive(this)};
g.C.s2=function(M){var f=y0;f.dispatchEvent(new HHC(f,M))};
g.C.XT=function(){return!1};
g.C=nk7.prototype;g.C.Fl=function(){};
g.C.bW=function(){};
g.C.Dv=function(){};
g.C.LB=function(){};
g.C.cF=function(){};
g.C.xE=function(){return{}};
g.C.isActive=function(){return!0};g.C=juW.prototype;g.C.enqueue=function(M){this.Z.push(M)};
g.C.isEmpty=function(){return this.K.length===0&&this.Z.length===0};
g.C.clear=function(){this.K=[];this.Z=[]};
g.C.contains=function(M){return g.V9(this.K,M)||g.V9(this.Z,M)};
g.C.remove=function(M){var f=this.K;var A=(0,g.mc7)(f,M);A>=0?(g.aR(f,A),f=!0):f=!1;return f||g.qm(this.Z,M)};
g.C.yM=function(){for(var M=[],f=this.K.length-1;f>=0;--f)M.push(this.K[f]);f=this.Z.length;for(var A=0;A=hR9.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(M=hR9[this.Z],this.V7=g.Uf((0,g.IR)(this.Xg,this),M),this.Z++):this.publish("pairingFailed",Error("Server error "+M.status))};
g.C.LV=function(){this.K=null;this.publish("pairingFailed",Error("Server not responding"))};
var hR9=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.pm(Ee,TI);g.C=Ee.prototype;g.C.start=function(){DM(this)&&this.publish("screenChange");!g.$J("yt-remote-lounge-token-expiration")&&Un0(this);g.ad(this.K);this.K=g.Uf((0,g.IR)(this.start,this),1E4)};
g.C.add=function(M,f){DM(this);Sxm(this,M);tc(this,!1);this.publish("screenChange");f(M);M.token||Un0(this)};
g.C.remove=function(M,f){var A=DM(this);oHK(this,M)&&(tc(this,!1),A=!0);f(M);A&&this.publish("screenChange")};
g.C.rO=function(M,f,A,Q){var N=DM(this),Y=this.get(M.id);Y?(Y.name!=f&&(Y.name=f,tc(this,!1),N=!0),A(M)):Q(Error("no such local screen."));N&&this.publish("screenChange")};
g.C.u8=function(){g.ad(this.K);Ee.kZ.u8.call(this)};
g.C.T5=function(M){DM(this);var f=this.screens.length;M=M&&M.screens||[];for(var A=M.length,Q=0;Q20)break a;D=f(Y,I)}Y=D}N.name=Y}A(hc(this,N))},this),
onError:(0,g.IR)(function(N){Q(Error("pairing request failed: "+N.status))},this),
onTimeout:(0,g.IR)(function(){Q(Error("pairing request timed out."))},this)})};
g.C.u8=function(){g.hW(this.Z);g.hW(this.K);pI.kZ.u8.call(this)};
g.C.sL=function(){xn9(this);this.publish("screenChange");this.K.update()};
pI.prototype.dispose=pI.prototype.dispose;g.pm(Ss,g.pi);g.C=Ss.prototype;g.C.J$=function(M){this.ek()||(M&&(oT(this,""+M),this.publish("sessionFailed")),this.K=null,this.publish("sessionScreen",null))};
g.C.info=function(M){Ac(this.z0,M)};
g.C.QC=function(){return null};
g.C.Lz=function(M){var f=this.Z;M?(f.displayStatus=new chrome.cast.ReceiverDisplayStatus(M,[]),f.displayStatus.showStop=!0):f.displayStatus=null;chrome.cast.setReceiverDisplayStatus(f,(0,g.IR)(function(){this.info("Updated receiver status for "+f.friendlyName+": "+M)},this),(0,g.IR)(function(){oT(this,"Failed to update receiver status for: "+f.friendlyName)},this))};
g.C.u8=function(){this.Lz("");Ss.kZ.u8.call(this)};g.U(CI,Ss);g.C=CI.prototype;g.C.rG=function(M){if(this.j){if(this.j==M)return;oT(this,"Overriding cast session with new session object");eue(this);this.jk=!1;this.B="unknown";this.j.removeUpdateListener(this.KJ);this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.P7)}this.j=M;this.j.addUpdateListener(this.KJ);this.j.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.P7);jVv(this,"getMdxSessionStatus")};
g.C.As=function(M){this.info("launchWithParams no-op for Cast: "+g.b4(M))};
g.C.stop=function(){this.j?this.j.stop((0,g.IR)(function(){this.J$()},this),(0,g.IR)(function(){this.J$(Error("Failed to stop receiver app."))},this)):this.J$(Error("Stopping cast device without session."))};
g.C.Lz=function(){};
g.C.u8=function(){this.info("disposeInternal");eue(this);this.j&&(this.j.removeUpdateListener(this.KJ),this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.P7));this.j=null;Ss.prototype.u8.call(this)};
g.C.GUB=function(M,f){if(!this.ek())if(f)if(f=Q0(f),g.Q9(f))switch(M=""+f.type,f=f.data||{},this.info("onYoutubeMessage_: "+M+" "+g.b4(f)),M){case "mdxSessionStatus":zu6(this,f);break;case "loungeToken":$nC(this,f);break;default:oT(this,"Unknown youtube message: "+M)}else oT(this,"Unable to parse message.");else oT(this,"No data in message.")};
g.C.gr=function(M,f,A,Q){g.ad(this.X);this.X=0;gHm(this.C,this.Z.label,M,this.Z.friendlyName,(0,g.IR)(function(N){N?f(N):Q>=0?(oT(this,"Screen "+M+" appears to be offline. "+Q+" retries left."),this.X=g.Uf((0,g.IR)(this.gr,this,M,f,A,Q-1),300)):A(Error("Unable to fetch screen."))},this),A)};
g.C.QC=function(){return this.j};
g.C.D2=function(M){this.ek()||M||(oT(this,"Cast session died."),this.J$())};g.U(Ue,Ss);g.C=Ue.prototype;g.C.rG=function(M){this.j=M;this.j.addUpdateListener(this.g_)};
g.C.As=function(M){this.fJ=M;this.Er()};
g.C.stop=function(){G80(this);this.j?this.j.stop((0,g.IR)(this.J$,this,null),(0,g.IR)(this.J$,this,"Failed to stop DIAL device.")):this.J$()};
g.C.u8=function(){G80(this);this.j&&this.j.removeUpdateListener(this.g_);this.j=null;Ss.prototype.u8.call(this)};
g.C.xs=function(M){this.ek()||M||(oT(this,"DIAL session died."),this.N(),this.N=function(){},this.J$())};g.U(qA,Ss);qA.prototype.stop=function(){this.J$()};
qA.prototype.rG=function(){};
qA.prototype.As=function(){g.ad(this.j);this.j=NaN;var M=pA(this.C.nh(),this.Z.label);M?LI(this,M):this.J$(Error("No such screen"))};
qA.prototype.u8=function(){g.ad(this.j);this.j=NaN;Ss.prototype.u8.call(this)};g.U(HF,g.pi);g.C=HF.prototype;
g.C.init=function(M,f){chrome.cast.timeout.requestSession=3E4;var A=new chrome.cast.SessionRequest(this.X,[chrome.cast.Capability.AUDIO_OUT]);g.mE("desktop_enable_cast_connect")&&(A.androidReceiverCompatible=!0);this.B||(A.dialRequest=new chrome.cast.DialRequest("YouTube"));var Q=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;M=M||this.G?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var N=(0,g.IR)(this.WL_,this);A=new chrome.cast.ApiConfig(A,(0,g.IR)(this.Cm,
this),N,Q,M);A.customDialLaunchCallback=(0,g.IR)(this.KnJ,this);chrome.cast.initialize(A,(0,g.IR)(function(){this.ek()||(chrome.cast.addReceiverActionListener(this.N),ttB(),this.Z.subscribe("onlineScreenChange",(0,g.IR)(this.dX,this)),this.j=MSc(this),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.IR)(function(Y){this.fW("Failed to set initial custom receivers: "+g.b4(Y))},this)),this.publish("yt-remote-cast2-availability-change",se(this)),f(!0))},this),(0,g.IR)(function(Y){this.fW("Failed to initialize API: "+
g.b4(Y));
f(!1)},this))};
g.C.hPY=function(M,f){md("Setting connected screen ID: "+M+" -> "+f);if(this.K){var A=this.K.K;if(!M||A&&A.id!=M)md("Unsetting old screen status: "+this.K.Z.friendlyName),cF(this,null)}if(M&&f){if(!this.K){M=pA(this.Z.nh(),M);if(!M){md("setConnectedScreenStatus: Unknown screen.");return}if(M.idType=="shortLived"){md("setConnectedScreenStatus: Screen with id type to be short lived.");return}A=wy0(this,M);A||(md("setConnectedScreenStatus: Connected receiver not custom..."),A=new chrome.cast.Receiver(M.uuid?
M.uuid:M.id,M.name),A.receiverType=chrome.cast.ReceiverType.CUSTOM,this.j.push(A),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.IR)(function(Q){this.fW("Failed to set initial custom receivers: "+g.b4(Q))},this)));
md("setConnectedScreenStatus: new active receiver: "+A.friendlyName);cF(this,new qA(this.Z,A),!0)}this.K.Lz(f)}else md("setConnectedScreenStatus: no screen.")};
g.C.LGB=function(M){this.ek()?this.fW("Setting connection data on disposed cast v2"):this.K?this.K.As(M):this.fW("Setting connection data without a session")};
g.C.sz=function(){this.ek()?this.fW("Stopping session on disposed cast v2"):this.K?(this.K.stop(),cF(this,null)):md("Stopping non-existing session")};
g.C.requestSession=function(){chrome.cast.requestSession((0,g.IR)(this.Cm,this),(0,g.IR)(this.d3Y,this))};
g.C.u8=function(){this.Z.unsubscribe("onlineScreenChange",(0,g.IR)(this.dX,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.N);var M=TQc,f=g.wD("yt.mdx.remote.debug.handlers_");g.qm(f||[],M);g.hW(this.K);g.pi.prototype.u8.call(this)};
g.C.fW=function(M){Ac("Controller",M)};
g.C.zr=function(M,f){this.K==M&&(f||cF(this,null),this.publish("yt-remote-cast2-session-change",f))};
g.C.qdx=function(M,f){if(!this.ek())if(M)switch(M.friendlyName=chrome.cast.unescape(M.friendlyName),md("onReceiverAction_ "+M.label+" / "+M.friendlyName+"-- "+f),f){case chrome.cast.ReceiverAction.CAST:if(this.K)if(this.K.Z.label!=M.label)md("onReceiverAction_: Stopping active receiver: "+this.K.Z.friendlyName),this.K.stop();else{md("onReceiverAction_: Casting to active receiver.");this.K.K&&this.publish("yt-remote-cast2-session-change",this.K.K);break}switch(M.receiverType){case chrome.cast.ReceiverType.CUSTOM:cF(this,
new qA(this.Z,M));break;case chrome.cast.ReceiverType.DIAL:cF(this,new Ue(this.Z,M,this.C,this.config_));break;case chrome.cast.ReceiverType.CAST:cF(this,new CI(this.Z,M,this.config_));break;default:this.fW("Unknown receiver type: "+M.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.K&&this.K.Z.label==M.label?this.K.stop():this.fW("Stopping receiver w/o session: "+M.friendlyName)}else this.fW("onReceiverAction_ called without receiver.")};
g.C.KnJ=function(M){if(this.ek())return Promise.reject(Error("disposed"));var f=M.receiver;f.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.fW("Not DIAL receiver: "+f.friendlyName),f.receiverType=chrome.cast.ReceiverType.DIAL);var A=this.K?this.K.Z:null;if(!A||A.label!=f.label)return this.fW("Receiving DIAL launch request for non-clicked DIAL receiver: "+f.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(A&&A.label==f.label&&A.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.K.K)return md("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.K.K),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.fW('Changing CAST intent from "'+A.receiverType+'" to "dial" for '+f.friendlyName);cF(this,new Ue(this.Z,f,this.C,this.config_))}f=this.K;f.X=M;f.X.appState==chrome.cast.DialAppState.RUNNING?(M=f.X.extraData||{},A=M.screenId||null,VN(f)&&M.loungeToken?M.loungeTokenRefreshIntervalMs?M=Xyw(f,{name:f.Z.friendlyName,screenId:M.screenId,loungeToken:M.loungeToken,dialId:f.X.receiver.label,
screenIdType:"shortLived"},M.loungeTokenRefreshIntervalMs):(g.MR(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(M)+".")),M=JLB(f,A)):M=JLB(f,A)):M=WV7(f);return M};
g.C.Cm=function(M){var f=this;if(!this.ek()&&!this.G){md("New cast session ID: "+M.sessionId);var A=M.receiver;if(A.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.K)if(A.receiverType==chrome.cast.ReceiverType.CAST)md("Got resumed cast session before resumed mdx connection."),A.friendlyName=chrome.cast.unescape(A.friendlyName),cF(this,new CI(this.Z,A,this.config_),!0);else{this.fW("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var Q=this.K.Z,N=pA(this.Z.nh(),
Q.label);N&&tY(N,A.label)&&Q.receiverType!=chrome.cast.ReceiverType.CAST&&A.receiverType==chrome.cast.ReceiverType.CAST&&(md("onSessionEstablished_: manual to cast session change "+A.friendlyName),g.hW(this.K),this.K=new CI(this.Z,A,this.config_),this.K.subscribe("sessionScreen",(0,g.IR)(this.zr,this,this.K)),this.K.subscribe("sessionFailed",function(){return l_K(f,f.K)}),this.K.As(null));
this.K.rG(M)}}};
g.C.BL=function(){return this.K?this.K.QC():null};
g.C.d3Y=function(M){this.ek()||(this.fW("Failed to estabilish a session: "+g.b4(M)),M.code!=chrome.cast.ErrorCode.CANCEL&&cF(this,null),this.publish("yt-remote-cast2-session-failed"))};
g.C.WL_=function(M){md("Receiver availability updated: "+M);if(!this.ek()){var f=se(this);this.W=M==chrome.cast.ReceiverAvailability.AVAILABLE;se(this)!=f&&this.publish("yt-remote-cast2-availability-change",se(this))}};
g.C.dX=function(){this.ek()||(this.j=MSc(this),md("Updating custom receivers: "+g.b4(this.j)),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.IR)(function(){this.fW("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",se(this)))};
HF.prototype.setLaunchParams=HF.prototype.LGB;HF.prototype.setConnectedScreenStatus=HF.prototype.hPY;HF.prototype.stopSession=HF.prototype.sz;HF.prototype.getCastSession=HF.prototype.BL;HF.prototype.requestSession=HF.prototype.requestSession;HF.prototype.init=HF.prototype.init;HF.prototype.dispose=HF.prototype.dispose;var ErB=[];g.C=r6.prototype;
g.C.reset=function(M){this.listId="";this.index=-1;this.videoId="";Lp9(this);this.volume=-1;this.muted=!1;M&&(this.index=M.index,this.listId=M.listId,this.videoId=M.videoId,this.playerState=M.playerState,this.volume=M.volume,this.muted=M.muted,this.audioTrackId=M.audioTrackId,this.trackData=M.trackData,this.BQ=M.hasPrevious,this.VK=M.hasNext,this.W=M.playerTime,this.G=M.playerTimeAt,this.C=M.seekableStart,this.K=M.seekableEnd,this.N=M.duration,this.X=M.loadedTime,this.j=M.liveIngestionTime,this.Z=
!isNaN(this.j))};
g.C.isPlaying=function(){return this.playerState==1};
g.C.isBuffering=function(){return this.playerState==3};
g.C.dY=function(){return this.playerState==1081};
g.C.Xy=function(M){this.N=isNaN(M)?0:M};
g.C.getDuration=function(){return this.Z?this.N+u_(this):this.N};
g.C.clone=function(){return new r6(or7(this))};g.U($g,g.pi);g.C=$g.prototype;g.C.getState=function(){return this.j};
g.C.VA=function(){return this.C.getReconnectTimeout()};
g.C.h2=function(){this.C.reconnect()};
g.C.play=function(){yN(this)?(this.K?this.K.play(null,g.L$,kg(this,"play")):b_(this,"play"),VS0(this,1,PF(FM(this))),this.publish("remotePlayerChange")):d6(this,this.play)};
g.C.pause=function(){yN(this)?(this.K?this.K.pause(null,g.L$,kg(this,"pause")):b_(this,"pause"),VS0(this,2,PF(FM(this))),this.publish("remotePlayerChange")):d6(this,this.pause)};
g.C.seekTo=function(M){if(yN(this)){if(this.K){var f=FM(this),A=new chrome.cast.media.SeekRequest;A.currentTime=M;f.isPlaying()||f.isBuffering()?A.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:A.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.K.seek(A,g.L$,kg(this,"seekTo",{newTime:M}))}else b_(this,"seekTo",{newTime:M});VS0(this,3,M);this.publish("remotePlayerChange")}else d6(this,g.Dv(this.seekTo,M))};
g.C.stop=function(){if(yN(this)){this.K?this.K.stop(null,g.L$,kg(this,"stopVideo")):b_(this,"stopVideo");var M=FM(this);M.index=-1;M.videoId="";Lp9(M);es(this,M);this.publish("remotePlayerChange")}else d6(this,this.stop)};
g.C.setVolume=function(M,f){if(yN(this)){var A=FM(this);if(this.Z){if(A.volume!=M){var Q=Math.round(M)/100;this.Z.setReceiverVolumeLevel(Q,(0,g.IR)(function(){QN("set receiver volume: "+Q)},this),(0,g.IR)(function(){this.fW("failed to set receiver volume.")},this))}A.muted!=f&&this.Z.setReceiverMuted(f,(0,g.IR)(function(){QN("set receiver muted: "+f)},this),(0,g.IR)(function(){this.fW("failed to set receiver muted.")},this))}else{var N={volume:M,
muted:f};A.volume!=-1&&(N.delta=M-A.volume);b_(this,"setVolume",N)}A.muted=f;A.volume=M;es(this,A)}else d6(this,g.Dv(this.setVolume,M,f))};
g.C.Ek=function(M,f){if(yN(this)){var A=FM(this);M={videoId:M};f&&(A.trackData={trackName:f.name,languageCode:f.languageCode,sourceLanguageCode:f.translationLanguage?f.translationLanguage.languageCode:"",languageName:f.languageName,kind:f.kind},M.style=g.b4(f.style),g.Y1(M,A.trackData));b_(this,"setSubtitlesTrack",M);es(this,A)}else d6(this,g.Dv(this.Ek,M,f))};
g.C.setAudioTrack=function(M,f){yN(this)?(f=f.getLanguageInfo().getId(),b_(this,"setAudioTrack",{videoId:M,audioTrackId:f}),M=FM(this),M.audioTrackId=f,es(this,M)):d6(this,g.Dv(this.setAudioTrack,M,f))};
g.C.playVideo=function(M,f,A,Q,N,Y,I){Q=Q===void 0?null:Q;N=N===void 0?null:N;Y=Y===void 0?null:Y;I=I===void 0?null:I;var D=FM(this),E={videoId:M};A!==void 0&&(E.currentIndex=A);nI(D,M,A||0);f!==void 0&&(zI(D,f),E.currentTime=f);Q&&(E.listId=Q);N&&(E.playerParams=N);Y&&(E.clickTrackingParams=Y);I&&(E.locationInfo=g.b4(I));b_(this,"setPlaylist",E);Q||es(this,D)};
g.C.c6=function(M,f){if(yN(this)){if(M&&f){var A=FM(this);nI(A,M,f);es(this,A)}b_(this,"previous")}else d6(this,g.Dv(this.c6,M,f))};
g.C.nextVideo=function(M,f){if(yN(this)){if(M&&f){var A=FM(this);nI(A,M,f);es(this,A)}b_(this,"next")}else d6(this,g.Dv(this.nextVideo,M,f))};
g.C.wJ=function(){if(yN(this)){b_(this,"clearPlaylist");var M=FM(this);M.reset();es(this,M);this.publish("remotePlayerChange")}else d6(this,this.wJ)};
g.C.n4=function(){yN(this)?b_(this,"dismissAutoplay"):d6(this,this.n4)};
g.C.dispose=function(){if(this.j!=3){var M=this.j;this.j=3;this.publish("proxyStateChange",M,this.j)}g.pi.prototype.dispose.call(this)};
g.C.u8=function(){UF0(this);this.C=null;this.N.clear();js(this,null);g.pi.prototype.u8.call(this)};
g.C.xe=function(M){if((M!=this.j||M==2)&&this.j!=3&&M!=0){var f=this.j;this.j=M;this.publish("proxyStateChange",f,M);if(M==1)for(;!this.N.isEmpty();)f=M=this.N,f.K.length===0&&(f.K=f.Z,f.K.reverse(),f.Z=[]),M.K.pop().apply(this);else M==3&&this.dispose()}};
g.C.oCO=function(M,f){this.publish(M,f)};
g.C.L$O=function(M){if(!M)this.Et(null),js(this,null);else if(this.Z.receiver.volume){M=this.Z.receiver.volume;var f=FM(this),A=Math.round(100*M.level||0);if(f.volume!=A||f.muted!=M.muted)QN("Cast volume update: "+M.level+(M.muted?" muted":"")),f.volume=A,f.muted=!!M.muted,es(this,f)}};
g.C.Et=function(M){QN("Cast media: "+!!M);this.K&&this.K.removeUpdateListener(this.X);if(this.K=M)this.K.addUpdateListener(this.X),ayK(this),this.publish("remotePlayerChange")};
g.C.aB$=function(M){M?(ayK(this),this.publish("remotePlayerChange")):this.Et(null)};
g.C.mI=function(){b_(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.C.F$8=function(){var M=pU9();M&&js(this,M)};
g.C.fW=function(M){Ac("CP",M)};g.U(XM,g.pi);g.C=XM.prototype;
g.C.connect=function(M,f){if(f){var A=f.listId,Q=f.videoId,N=f.videoIds,Y=f.playerParams,I=f.clickTrackingParams,D=f.index,E={videoId:Q},t=f.currentTime,v=f.locationInfo;f=f.loopMode;t!==void 0&&(E.currentTime=t<=5?0:t);Y&&(E.playerParams=Y);v&&(E.locationInfo=v);I&&(E.clickTrackingParams=I);A&&(E.listId=A);N&&N.length>0&&(E.videoIds=N.join(","));D!==void 0&&(E.currentIndex=D);this.g_&&(E.loopMode=f||"LOOP_MODE_OFF");A&&(this.K.listId=A);this.K.videoId=Q;this.K.index=D||0;this.K.state=3;zI(this.K,
t);this.N="UNSUPPORTED";A=this.g_?"setInitialState":"setPlaylist";WF("Connecting with "+A+" and params: "+g.b4(E));this.Z.connect({method:A,params:g.b4(E)},M,$RB())}else WF("Connecting without params"),this.Z.connect({},M,$RB());sPe(this)};
g.C.e1=function(M){this.Z.e1(M)};
g.C.dispose=function(){this.ek()||(g.Gz("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Oe(this,3));g.pi.prototype.dispose.call(this)};
g.C.u8=function(){cJK(this);grR(this);Rs6(this);g.ad(this.X);this.X=NaN;g.ad(this.B);this.B=NaN;this.C=null;g.g$(this.Er);this.Er.length=0;this.Z.dispose();g.pi.prototype.u8.call(this);this.N=this.W=this.j=this.K=this.Z=null};
g.C.U9=function(M){if(!this.j||this.j.length===0)return!1;for(var f=g.V(this.j),A=f.next();!A.done;A=f.next())if(!A.value.capabilities.has(M))return!1;return!0};
g.C.Si=function(){var M=3;this.ek()||(M=0,isNaN(this.TI())?this.Z.w7()&&isNaN(this.G)&&(M=1):M=2);return M};
g.C.kH=function(M){WF("Disconnecting with "+M);g.Gz("yt.mdx.remote.remoteClient_",null);cJK(this);this.publish("beforeDisconnect",M);M==1&&LA();this.Z.disconnect(M);this.dispose()};
g.C.ji=function(){var M=this.K;this.C&&(M=this.K.clone(),nI(M,this.C,M.index));return or7(M)};
g.C.DXO=function(M){var f=this,A=new r6(M);A.videoId&&A.videoId!=this.K.videoId&&(this.C=A.videoId,g.ad(this.X),this.X=g.Uf(function(){if(f.C){var N=f.C;f.C=null;f.K.videoId!=N&&Jc(f,"getNowPlaying")}},5E3));
var Q=[];this.K.listId==A.listId&&this.K.videoId==A.videoId&&this.K.index==A.index||Q.push("remoteQueueChange");this.K.playerState==A.playerState&&this.K.volume==A.volume&&this.K.muted==A.muted&&PF(this.K)==PF(A)&&g.b4(this.K.trackData)==g.b4(A.trackData)||Q.push("remotePlayerChange");this.K.reset(M);g.F0(Q,function(N){this.publish(N)},this)};
g.C.PR=function(){var M=this.Z.getDeviceId(),f=g.oR(this.j,function(A){return A.type=="REMOTE_CONTROL"&&A.id!=M});
return f?f.id:""};
g.C.TI=function(){return this.Z.VA()};
g.C.ai=function(){return this.N||"UNSUPPORTED"};
g.C.LP=function(){return this.W||""};
g.C.Qa=function(){!isNaN(this.TI())&&this.Z.h2()};
g.C.JX$=function(M,f){Jc(this,M,f);inB(this)};
g.C.KL=function(){var M=g.yn("SAPISID","")||g.yn("__Secure-1PAPISID")||"",f=g.yn("__Secure-3PAPISID","")||"";if(!M&&!f)return"";M=g.An(g.fa(M),2);f=g.An(g.fa(f),2);return g.An(g.fa(","+M+","+f),2)};
XM.prototype.subscribe=XM.prototype.subscribe;XM.prototype.unsubscribeByKey=XM.prototype.DI;XM.prototype.getProxyState=XM.prototype.Si;XM.prototype.disconnect=XM.prototype.kH;XM.prototype.getPlayerContextData=XM.prototype.ji;XM.prototype.setPlayerContextData=XM.prototype.DXO;XM.prototype.getOtherConnectedRemoteId=XM.prototype.PR;XM.prototype.getReconnectTimeout=XM.prototype.TI;XM.prototype.getAutoplayMode=XM.prototype.ai;XM.prototype.getAutoplayVideoId=XM.prototype.LP;XM.prototype.reconnect=XM.prototype.Qa;
XM.prototype.sendMessage=XM.prototype.JX$;XM.prototype.getXsrfToken=XM.prototype.KL;XM.prototype.isCapabilitySupportedOnConnectedDevices=XM.prototype.U9;g.U(dF9,TI);g.C=dF9.prototype;g.C.nh=function(M){return this.py.$_gs(M)};
g.C.contains=function(M){return!!this.py.$_c(M)};
g.C.get=function(M){return this.py.$_g(M)};
g.C.start=function(){this.py.$_st()};
g.C.add=function(M,f,A){this.py.$_a(M,f,A)};
g.C.remove=function(M,f,A){this.py.$_r(M,f,A)};
g.C.rO=function(M,f,A,Q){this.py.$_un(M,f,A,Q)};
g.C.u8=function(){for(var M=this.K.length,f=0;f1&&!this.U.getOption("remote","quickCast")?(this.VB=g.y9(M,this.K,this),this.HB(g.WP(M,this.K)),M=g.F(this.U.getOption("remote","currentReceiver")),M=this.K(M),this.options[M]&&this.QD(M),this.enable(!0)):this.enable(!1)};
S5.prototype.K=function(M){return M.key};
S5.prototype.iS=function(M){return M==="cast-selector-receiver"?"Cast...":this.VB[M].name};
S5.prototype.jV=function(M){g.no.prototype.jV.call(this,M);this.U.setOption("remote","currentReceiver",this.VB[M]);this.uI.fk()};g.U(Ebe,g.CV);g.C=Ebe.prototype;
g.C.create=function(){var M=this.player.T(),f=g.dt(M);M={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:M.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:M.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:M.V("enable_cast_short_lived_lounge_token")};Onm(f,M);this.subscriptions.push(g.Dy("yt-remote-before-disconnect",this.T_x,this));this.subscriptions.push(g.Dy("yt-remote-connection-change",this.OdB,this));this.subscriptions.push(g.Dy("yt-remote-receiver-availability-change",this.jX,
this));this.subscriptions.push(g.Dy("yt-remote-auto-connect",this.RuJ,this));this.subscriptions.push(g.Dy("yt-remote-receiver-resumed",this.VcB,this));this.subscriptions.push(g.Dy("mdx-privacy-popup-confirm",this.dXN,this));this.subscriptions.push(g.Dy("mdx-privacy-popup-cancel",this.Q5_,this));this.jX()};
g.C.load=function(){this.player.cancelPlayback();g.CV.prototype.load.call(this);this.MY=new D8e(this.player.T(),this);this.player.Ij(this.MY);this.k7=new NZB(this,this.player,this.td);var M=(M=frR())?M.currentTime:0;var f=wUc()?new $g(g.F(YP()),void 0):null;M==0&&f&&(M=PF(FM(f)));M!==0&&this.z_(M);tZc(this,this.Oq,this.Oq);this.player.OI(6)};
g.C.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.JN();this.C1=this.CF;g.Sy(this.k7,this.td);this.td=this.MY=this.k7=null;g.CV.prototype.unload.call(this);this.player.OI(5);Lf(this)};
g.C.u8=function(){g.EC(this.subscriptions);g.CV.prototype.u8.call(this)};
g.C.Yn=function(M){var f=g.jN.apply(1,arguments);this.loaded&&this.k7.Uv.apply(this.k7,[M].concat(g.c(f)))};
g.C.getAdState=function(){return this.P2};
g.C.BQ=function(){return this.td?FM(this.td).BQ:!1};
g.C.VK=function(){return this.td?FM(this.td).VK:!1};
g.C.z_=function(M,f){this.Vx=M||0;this.player.publish("progresssync",M,f);this.player.l7("onVideoProgress",M||0)};
g.C.getCurrentTime=function(){return this.Vx};
g.C.getProgressState=function(){var M=FM(this.td),f=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!M.dY()&&this.player.BP(),clipEnd:f.clipEnd,clipStart:f.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:M.getDuration(),ingestionTime:M.Z?M.j+u_(M):M.j,isAtLiveHead:(M.Z?M.K+u_(M):M.K)-this.getCurrentTime()<=1,loaded:M.X,seekableEnd:M.Z?M.K+u_(M):M.K,seekableStart:M.C>0?M.C+u_(M):M.C,offset:0,viewerLivestreamJoinMediaTime:0}};
g.C.nextVideo=function(){this.td&&this.td.nextVideo()};
g.C.c6=function(){this.td&&this.td.c6()};
g.C.T_x=function(M){M===1&&(this.Qc=this.td?FM(this.td):null)};
g.C.OdB=function(){var M=wUc()?new $g(g.F(YP()),void 0):null;if(M){var f=this.C1;this.loaded&&this.unload();this.td=M;this.Qc=null;f.key!==this.CF.key&&(this.C1=f,this.load())}else g.hW(this.td),this.td=null,this.loaded&&(this.unload(),(M=this.Qc)&&M.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(M.videoId,PF(M)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
g.C.jX=function(){var M=[this.CF],f=M.concat,A=XUW();i_()&&g.$J("yt-remote-cast-available")&&A.push({key:"cast-selector-receiver",name:"Cast..."});this.VB=f.call(M,A);M=KpB()||this.CF;oy(this,M);this.player.l7("onMdxReceiversChange")};
g.C.RuJ=function(){var M=g.F(KpB());oy(this,M)};
g.C.VcB=function(){this.C1=g.F(KpB())};
g.C.dXN=function(){this.mZ=!0;Lf(this);ET=!1;Iy&&D3(Iy,1);Iy=null};
g.C.Q5_=function(){this.mZ=!1;Lf(this);oy(this,this.CF);this.C1=this.CF;ET=!1;Iy=null;this.player.playVideo()};
g.C.dc=function(M,f){switch(M){case "casting":return this.loaded;case "receivers":return this.VB;case "currentReceiver":return f&&(f.key==="cast-selector-receiver"?hsB():oy(this,f)),this.loaded?this.C1:this.CF;case "quickCast":return this.VB.length===2&&this.VB[1].key==="cast-selector-receiver"?(f&&hsB(),!0):!1}};
g.C.mI=function(){this.td.mI()};
g.C.Tv=function(){return!1};
g.C.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
g.C.isLoggedIn=function(){var M,f;return((M=g.GR("PLAYER_CONFIG"))==null?void 0:(f=M.args)==null?void 0:f.authuser)!==void 0?!0:!(!g.GR("SESSION_INDEX")&&!g.GR("LOGGED_IN"))};g.oW("remote",Ebe);})(_yt_player);