(function(g){var window=this;'use strict';var V8h=function(D){if(D instanceof g.Vj)return D;if(typeof D.d3=="function")return D.d3(!1);if(g.WP(D)){var Q=0,m=new g.Vj;m.next=function(){for(;;){if(Q>=D.length)return g.tS;if(Q in D)return g.Nd(D[Q++]);Q++}};
return m}throw Error("Not implemented");},NjV=function(D,Q,m){if(g.WP(D))g.S2(D,Q,m);
else for(D=V8h(D);;){var P=D.next();if(P.done)break;Q.call(m,P.value,void 0,D)}},Dm=function(D){g.tN(D,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.bv()).toString(36));
return D},QY=function(D,Q,m){Array.isArray(m)||(m=[String(m)]);
g.jTj(D.B,Q,m)},ylM=function(D,Q){var m=[];
NjV(Q,function(P){try{var W=g.g2.prototype.C.call(this,P,!0)}catch(L){if(L=="Storage: Invalid value was encountered")return;throw L;}W===void 0?m.push(P):g.Abj(W)&&m.push(P)},D);
return m},ZpV=function(D,Q){ylM(D,Q).forEach(function(m){g.g2.prototype.remove.call(this,m)},D)},F6K=function(D){if(D.g2){if(D.g2.locationOverrideToken)return{locationOverrideToken:D.g2.locationOverrideToken};
if(D.g2.latitudeE7!=null&&D.g2.longitudeE7!=null)return{latitudeE7:D.g2.latitudeE7,longitudeE7:D.g2.longitudeE7}}return null},Tj4=function(D,Q){g.FK(D,Q)||D.push(Q)},hEh=function(D){var Q=0,m;
for(m in D)Q++;return Q},nyU=function(D,Q){return g.t6(D,Q)},Eyk=function(D){try{return g.Mu.JSON.parse(D)}catch(Q){}D=String(D);
if(/^\s*$/.test(D)?0:/^[\],:{}\s\u2028\u2029]*$/.test(D.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("("+D+")")}catch(Q){}throw Error("Invalid JSON string: "+D);},mT=function(D){if(g.Mu.JSON)try{return g.Mu.JSON.parse(D)}catch(Q){}return Eyk(D)},gyN=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/channel/opened",g.Qy("channel_type"))},Bj2=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/channel/closed",g.Qy("channel_type"))},wdN=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Qy("channel_type"))},kXP=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/channel/success")},Jl4=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/channel/error",g.Qy("channel_type"),g.Qy("error_type"))},lGU=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},IGU=function(){var D=Pr();
this.S=D;D.hp("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},REM=function(D,Q,m,P){var W=new g.Qc(null);
D&&g.mq(W,D);Q&&g.PV(W,Q);m&&g.WV(W,m);P&&(W.C=P);return W},Uvk=function(D,Q){return new g.Mp(D,Q)},Wr=function(D,Q){return Object.prototype.hasOwnProperty.call(D,Q)},HpM=function(D,Q){return D===Q},iy=function(D,Q){this.C={};
this.S=[];this.Cb=this.size=0;var m=arguments.length;if(m>1){if(m%2)throw Error("Uneven number of arguments");for(var P=0;P<m;P+=2)this.set(arguments[P],arguments[P+1])}else if(D)if(D instanceof iy)for(m=D.G8(),P=0;P<m.length;P++)this.set(m[P],D.get(m[P]));else for(P in D)this.set(P,D[P])},sQ=function(D){if(D.size!=D.S.length){for(var Q=0,m=0;Q<D.S.length;){var P=D.S[Q];
Wr(D.C,P)&&(D.S[m++]=P);Q++}D.S.length=m}if(D.size!=D.S.length){Q={};for(P=m=0;m<D.S.length;){var W=D.S[m];Wr(Q,W)||(D.S[P++]=W,Q[W]=1);m++}D.S.length=P}},L0=function(D){this.name=this.id="";
this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.ownerObfuscatedGaiaId=this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new iy;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";D&&(this.id=D.id||D.name,this.name=D.name,this.clientName=D.clientName?D.clientName.toUpperCase():"UNKNOWN_INTERFACE",
this.app=D.app,this.type=D.type||"REMOTE_CONTROL",this.username=D.user||"",this.avatar=D.userAvatarUri||"",this.obfuscatedGaiaId=D.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=D.ownerObfuscatedGaiaId||"",this.theme=D.theme||"u",K6K(this,D.capabilities||""),ji2(this,D.compatibleSenderThemes||""),$vN(this,D.experiments||""),this.brand=D.brand||"",this.model=D.model||"",this.year=D.year||0,this.os=D.os||"",this.osVersion=D.osVersion||"",this.chipset=D.chipset||"",this.mdxDialServerType=D.mdxDialServerType||
"MDX_DIAL_SERVER_TYPE_UNKNOWN",D=D.deviceInfo)&&(D=JSON.parse(D),this.brand=D.brand||"",this.model=D.model||"",this.year=D.year||0,this.os=D.os||"",this.osVersion=D.osVersion||"",this.chipset=D.chipset||"",this.clientName=D.clientName?D.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=D.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},K6K=function(D,Q){D.capabilities.clear();
g.g0(Q.split(","),g.zT(nyU,eEQ)).forEach(function(m){D.capabilities.add(m)})},ji2=function(D,Q){D.compatibleSenderThemes.clear();
g.g0(Q.split(","),g.zT(nyU,vyV)).forEach(function(m){D.compatibleSenderThemes.add(m)})},$vN=function(D,Q){D.experiments.clear();
Q.split(",").forEach(function(m){D.experiments.add(m)})},uy=function(D){D=D||{};
this.name=D.name||"";this.id=D.id||D.screenId||"";this.token=D.token||D.loungeToken||"";this.uuid=D.uuid||D.dialId||"";this.idType=D.screenIdType||"normal"},dp=function(D,Q){return!!Q&&(D.id==Q||D.uuid==Q)},OpQ=function(D){return{name:D.name,
screenId:D.id,loungeToken:D.token,dialId:D.uuid,screenIdType:D.idType}},Y2h=function(D){return new uy(D)},u7V=function(D){return Array.isArray(D)?g.fk(D,Y2h):[]},tT=function(D){return D?'{name:"'+D.name+'",id:'+D.id.substr(0,6)+"..,token:"+((D.token?".."+D.token.slice(-6):"-")+",uuid:"+(D.uuid?".."+D.uuid.slice(-6):"-")+",idType:"+D.idType+"}"):"null"},dZN=function(D){return Array.isArray(D)?"["+g.fk(D,tT).join(",")+"]":"null"},t0h=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(D){var Q=Math.random()*16|0;
return(D=="x"?Q:Q&3|8).toString(16)})},zWN=function(D){return g.fk(D,function(Q){return{key:Q.id,
name:Q.name}})},bU2=function(D,Q){return g.y4(D,function(m){return m||Q?!m!=!Q?!1:m.id==Q.id:!0})},zh=function(D,Q){return g.y4(D,function(m){return dp(m,Q)})},qIU=function(){var D=(0,g.gb)();
D&&ZpV(D,D.S.d3(!0))},by=function(){var D=g.kt("yt-remote-connected-devices")||[];
g.pV(D);return D},CzP=function(D){if(D.length==0)return[];
var Q=D[0].indexOf("#"),m=Q==-1?D[0]:D[0].substring(0,Q);return g.fk(D,function(P,W){return W==0?P:P.substring(m.length)})},otV=function(D){g.wb("yt-remote-connected-devices",D,86400)},qs=function(){if(f5v)return f5v;
var D=g.kt("yt-remote-device-id");D||(D=t0h(),g.wb("yt-remote-device-id",D,31536E3));for(var Q=by(),m=1,P=D;g.FK(Q,P);)m++,P=D+"#"+m;return f5v=P},V02=function(){var D=by(),Q=qs();
g.lz()&&g.XK(D,Q);D=CzP(D);if(D.length==0)try{g.Ii("remote_sid")}catch(m){}else try{g.Jl("remote_sid",D.join(","),-1)}catch(m){}},NbT=function(){return g.kt("yt-remote-session-browser-channel")},yJh=function(){return g.kt("yt-remote-local-screens")||[]},ZU$=function(){g.wb("yt-remote-lounge-token-expiration",!0,86400)},F92=function(D){D.length>5&&(D=D.slice(D.length-5));
var Q=g.fk(yJh(),function(P){return P.loungeToken}),m=g.fk(D,function(P){return P.loungeToken});
g.VT(m,function(P){return!g.FK(Q,P)})&&ZU$();
g.wb("yt-remote-local-screens",D,31536E3)},C0=function(D){D||(g.JJ("yt-remote-session-screen-id"),g.JJ("yt-remote-session-video-id"));
V02();D=by();g.hM(D,qs());otV(D)},TbQ=function(){if(!oB){var D=g.Ig();
D&&(oB=new g.hv(D))}},hWT=function(){TbQ();
return oB?!!oB.get("yt-remote-use-staging-server"):!1},f0=function(D,Q){g.G0[D]=!0;
var m=g.SI();m&&m.publish.apply(m,arguments);g.G0[D]=!1},ntk=function(){},Pr=function(){if(!VY){VY=new g.j6(new ntk);
var D=g.fp("client_streamz_web_flush_count",-1);D!==-1&&(VY.T=D)}return VY},Et4=function(){var D=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return D?parseInt(D[1],10):0},gt4=function(D){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+D)!=-1||document.currentScript.src.indexOf("&"+D)!=-1)},BbK=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},Ns=function(D){D.length?w5h(D.shift(),function(){Ns(D)}):kP$()},JJN=function(D){return"chrome-extension://"+D+"/cast_sender.js"},w5h=function(D,Q,m){var P=document.createElement("script");
P.onerror=Q;m&&(P.onload=m);g.yf(P,g.ZU(D));(document.head||document.documentElement).appendChild(P)},l52=function(){var D=Et4(),Q=[];
if(D>1){var m=D-1;Q.push("//www.gstatic.com/eureka/clank/"+D+"/cast_sender.js");Q.push("//www.gstatic.com/eureka/clank/"+m+"/cast_sender.js")}return Q},kP$=function(){var D=BbK();
D&&D(!1,"No cast extension found")},RW$=function(){if(I5k){var D=2,Q=BbK(),m=function(){D--;
D==0&&Q&&Q(!0)};
window.__onGCastApiAvailable=m;w5h("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",kP$,m)}},UZ4=function(){RW$();
var D=l52();D.push("//www.gstatic.com/eureka/clank/cast_sender.js");Ns(D)},K9$=function(){RW$();
var D=l52();D.push.apply(D,g.on(HUM.map(JJN)));D.push("//www.gstatic.com/eureka/clank/cast_sender.js");Ns(D)},yY=function(D,Q,m){g.v.call(this);
this.N=m!=null?(0,g.d$)(D,m):D;this.S6=Q;this.J=(0,g.d$)(this.C5,this);this.S=!1;this.C=0;this.T=this.Gc=null;this.B=[]},Zm=function(){},jSP=function(){g.Ab.call(this,"p")},$ZV=function(){g.Ab.call(this,"o")},vt4=function(){return eWU=eWU||new g.zt},OUK=function(D){g.Ab.call(this,"serverreachability",D)},Fk=function(D){var Q=vt4();
Q.dispatchEvent(new OUK(Q,D))},YIN=function(D){g.Ab.call(this,"statevent",D)},Th=function(D){var Q=vt4();
Q.dispatchEvent(new YIN(Q,D))},a5$=function(D,Q,m,P){g.Ab.call(this,"timingevent",D);
this.size=Q;this.rtt=m;this.retries=P},hT=function(D,Q){if(typeof D!=="function")throw Error("Fn must not be null and must be a function");
return g.Mu.setTimeout(function(){D()},Q)},n0=function(){},EQ=function(D,Q,m,P){this.T=D;
this.B=Q;this.Lj=m;this.cY=P||1;this.jD=new g.oO(this);this.XT=45E3;this.u0=null;this.N=!1;this.j=this.GO=this.Z=this.x9=this.Kh=this.oy=this.TO=null;this.Iy=[];this.S=null;this.U=0;this.J=this.QF=null;this.gB=-1;this.wc=!1;this.l0=0;this.Y9=null;this.Kj=this.k9=this.hU=this.t0=!1;this.C=new AJM},AJM=function(){this.C=null;
this.S="";this.T=!1},xZ4=function(D,Q,m){D.x9=1;
D.Z=Dm(Q.clone());D.j=m;D.t0=!0;p5U(D,null)},p5U=function(D,Q){D.Kh=Date.now();
gp(D);D.GO=D.Z.clone();QY(D.GO,"t",D.cY);D.U=0;var m=D.T.x9;D.C=new AJM;D.S=X5K(D.T,m?Q:null,!D.j);D.l0>0&&(D.Y9=new g.rt((0,g.d$)(D.GD,D,D.S),D.l0));D.jD.listen(D.S,"readystatechange",D.dD);Q=D.u0?g.o2(D.u0):{};D.j?(D.QF||(D.QF="POST"),Q["Content-Type"]="application/x-www-form-urlencoded",D.S.send(D.GO,D.QF,D.j,Q)):(D.QF="GET",D.S.send(D.GO,D.QF,null,Q));Fk(1)},rJT=function(D){if(!SIP(D))return g.Xd(D.S);
var Q=g.S6(D.S);if(Q==="")return"";var m="",P=Q.length,W=g.po(D.S)==4;if(!D.C.C){if(typeof TextDecoder==="undefined")return Br(D),wp(D),"";D.C.C=new g.Mu.TextDecoder}for(var L=0;L<P;L++)D.C.T=!0,m+=D.C.C.decode(Q[L],{stream:!(W&&L==P-1)});Q.length=0;D.C.S+=m;D.U=0;return D.C.S},SIP=function(D){return D.S?D.QF=="GET"&&D.x9!=2&&D.T.gi:!1},cJP=function(D,Q){var m=D.U,P=Q.indexOf("\n",m);
if(P==-1)return GPV;m=Number(Q.substring(m,P));if(isNaN(m))return M0N;P+=1;if(P+m>Q.length)return GPV;Q=Q.slice(P,P+m);D.U=P+m;return Q},gp=function(D){D.oy=Date.now()+D.XT;
DTk(D,D.XT)},DTk=function(D,Q){if(D.TO!=null)throw Error("WatchDog timer not null");
D.TO=hT((0,g.d$)(D.Tn,D),Q)},QWV=function(D){D.TO&&(g.Mu.clearTimeout(D.TO),D.TO=null)},wp=function(D){D.T.TE()||D.wc||mT4(D.T,D)},Br=function(D){QWV(D);
g.Dp(D.Y9);D.Y9=null;D.jD.removeAll();if(D.S){var Q=D.S;D.S=null;Q.abort();Q.dispose()}},ta4=function(D,Q){try{var m=D.T;
if(m.CI!=0&&(m.S==D||P8U(m.C,D)))if(!D.k9&&P8U(m.C,D)&&m.CI==3){try{var P=m.h8.S.parse(Q)}catch(h){P=null}if(Array.isArray(P)&&P.length==3){var W=P;if(W[0]==0)a:{if(!m.Z){if(m.S)if(m.S.Kh+3E3<D.Kh)k9(m),JT(m);else break a;WD4(m);Th(18)}}else m.g2=W[1],0<m.g2-m.Y9&&W[2]<37500&&m.k9&&m.Iy==0&&!m.TO&&(m.TO=hT((0,g.d$)(m.Is,m),6E3));if(ir2(m.C)<=1&&m.gB){try{m.gB()}catch(h){}m.gB=void 0}}else ly(m,11)}else if((D.k9||m.S==D)&&k9(m),!g.J6(Q))for(W=m.h8.S.parse(Q),Q=0;Q<W.length;Q++){var L=W[Q];m.Y9=L[0];
L=L[1];if(m.CI==2)if(L[0]=="c"){m.B=L[1];m.Lj=L[2];var u=L[3];u!=null&&(m.XL=u);var t=L[5];t!=null&&typeof t==="number"&&t>0&&(m.l0=1.5*t);P=m;var z=D.tS();if(z){var b=g.rW(z,"X-Client-Wire-Protocol");if(b){var q=P.C;!q.S&&(g.l7(b,"spdy")||g.l7(b,"quic")||g.l7(b,"h2"))&&(q.B=q.J,q.S=new Set,q.C&&(sWT(q,q.C),q.C=null))}if(P.t0){var C=g.rW(z,"X-HTTP-Session-Id");C&&(P.zY=C,g.tN(P.u0,P.t0,C))}}m.CI=3;m.J&&m.J.y$();m.dn&&(m.kJ=Date.now()-D.Kh);P=m;var f=D;P.Xw=LDP(P,P.x9?P.Lj:null,P.PY);if(f.k9){uqV(P.C,
f);var V=f,N=P.l0;N&&V.setTimeout(N);V.TO&&(QWV(V),gp(V));P.S=f}else dTv(P);m.T.length>0&&IB(m)}else L[0]!="stop"&&L[0]!="close"||ly(m,7);else m.CI==3&&(L[0]=="stop"||L[0]=="close"?L[0]=="stop"?ly(m,7):m.disconnect():L[0]!="noop"&&m.J&&m.J.ox(L),m.Iy=0)}Fk(4)}catch(h){}},zd2=function(D,Q){this.S=D;
this.map=Q;this.context=null},brV=function(D){this.J=D||10;
g.Mu.PerformanceNavigationTiming?(D=g.Mu.performance.getEntriesByType("navigation"),D=D.length>0&&(D[0].nextHopProtocol=="hq"||D[0].nextHopProtocol=="h2")):D=!!(g.Mu.chrome&&g.Mu.chrome.loadTimes&&g.Mu.chrome.loadTimes()&&g.Mu.chrome.loadTimes().wasFetchedViaSpdy);this.B=D?this.J:1;this.S=null;this.B>1&&(this.S=new Set);this.C=null;this.T=[]},q4$=function(D){return D.C?!0:D.S?D.S.size>=D.B:!1},ir2=function(D){return D.C?1:D.S?D.S.size:0},P8U=function(D,Q){return D.C?D.C==Q:D.S?D.S.has(Q):!1},sWT=
function(D,Q){D.S?D.S.add(Q):D.C=Q},uqV=function(D,Q){D.C&&D.C==Q?D.C=null:D.S&&D.S.has(Q)&&D.S.delete(Q)},C8T=function(D){if(D.C!=null)return D.T.concat(D.C.Iy);
if(D.S!=null&&D.S.size!==0){var Q=D.T;D=g.T(D.S.values());for(var m=D.next();!m.done;m=D.next())Q=Q.concat(m.value.Iy);return Q}return g.JM(D.T)},oDT=function(D,Q){var m=new n0;
if(g.Mu.Image){var P=new Image;P.onload=g.zT(RB,m,"TestLoadImage: loaded",!0,Q,P);P.onerror=g.zT(RB,m,"TestLoadImage: error",!1,Q,P);P.onabort=g.zT(RB,m,"TestLoadImage: abort",!1,Q,P);P.ontimeout=g.zT(RB,m,"TestLoadImage: timeout",!1,Q,P);g.Mu.setTimeout(function(){if(P.ontimeout)P.ontimeout()},1E4);
P.src=D}else Q(!1)},fHT=function(D,Q){var m=new n0,P=new AbortController,W=setTimeout(function(){P.abort();
RB(m,"TestPingServer: timeout",!1,Q)},1E4);
fetch(D,{signal:P.signal}).then(function(L){clearTimeout(W);L.ok?RB(m,"TestPingServer: ok",!0,Q):RB(m,"TestPingServer: server error",!1,Q)}).catch(function(){clearTimeout(W);
RB(m,"TestPingServer: error",!1,Q)})},RB=function(D,Q,m,P,W){try{W&&(W.onload=null,W.onerror=null,W.onabort=null,W.ontimeout=null),P(m)}catch(L){}},Vav=function(){this.S=new Zm},UQ=function(D,Q,m){return m&&m.eO?m.eO[D]||Q:Q},NVN=function(D){this.T=[];
this.Lj=this.Xw=this.u0=this.PY=this.S=this.zY=this.t0=this.wc=this.U=this.hU=this.j=null;this.F2=this.GO=0;this.A8=UQ("failFast",!1,D);this.k9=this.TO=this.Z=this.N=this.J=null;this.pj=!0;this.g2=this.Y9=-1;this.cY=this.Iy=this.Kh=0;this.HO=UQ("baseRetryDelayMs",5E3,D);this.ZD=UQ("retryDelaySeedMs",1E4,D);this.WO=UQ("forwardChannelMaxRetries",2,D);this.yn=UQ("forwardChannelRequestTimeoutMs",2E4,D);this.kB=D&&D.iqh||void 0;this.aF=D&&D.rEc||void 0;this.gi=D&&D.moy||!1;this.l0=void 0;this.x9=D&&D.rN0||
!1;this.B="";this.C=new brV(D&&D.hDx);this.h8=new Vav;this.jD=D&&D.WEv||!1;this.oy=D&&D.wjz||!1;this.jD&&this.oy&&(this.oy=!1);this.PO=D&&D.yPF||!1;D&&D.PMF&&(this.pj=!1);this.dn=!this.jD&&this.pj&&D&&D.nID||!1;this.Ze=void 0;D&&D.Uu&&D.Uu>0&&(this.Ze=D.Uu);this.gB=void 0;this.kJ=0;this.XT=!1;this.Kj=this.QF=null},JT=function(D){D.S&&(yk$(D),D.S.cancel(),D.S=null)},Zrh=function(D){JT(D);
D.Z&&(g.Mu.clearTimeout(D.Z),D.Z=null);k9(D);D.C.cancel();D.N&&(typeof D.N==="number"&&g.Mu.clearTimeout(D.N),D.N=null)},IB=function(D){q4$(D.C)||D.N||(D.N=!0,g.Fd(D.Ep,D),D.Kh=0)},TVK=function(D,Q){if(ir2(D.C)>=D.C.B-(D.N?1:0))return!1;
if(D.N)return D.T=Q.Iy.concat(D.T),!0;if(D.CI==1||D.CI==2||D.Kh>=(D.A8?0:D.WO))return!1;D.N=hT((0,g.d$)(D.Ep,D,Q),FDT(D,D.Kh));D.Kh++;return!0},nD4=function(D,Q){var m;
Q?m=Q.Lj:m=D.GO++;var P=D.u0.clone();g.tN(P,"SID",D.B);g.tN(P,"RID",m);g.tN(P,"AID",D.Y9);Hr(D,P);D.U&&D.j&&g.CJ(P,D.U,D.j);m=new EQ(D,D.B,m,D.Kh+1);D.U===null&&(m.u0=D.j);Q&&(D.T=Q.Iy.concat(D.T));Q=hdN(D,m,1E3);m.setTimeout(Math.round(D.yn*.5)+Math.round(D.yn*.5*Math.random()));sWT(D.C,m);xZ4(m,P,Q)},Hr=function(D,Q){D.wc&&g.MQ(D.wc,function(m,P){g.tN(Q,P,m)});
D.J&&g.MQ({},function(m,P){g.tN(Q,P,m)})},hdN=function(D,Q,m){m=Math.min(D.T.length,m);
var P=D.J?(0,g.d$)(D.J.gD,D.J,D):null;a:{for(var W=D.T,L=-1;;){var u=["count="+m];L==-1?m>0?(L=W[0].S,u.push("ofs="+L)):L=0:u.push("ofs="+L);for(var t=!0,z=0;z<m;z++){var b=W[z].S,q=W[z].map;b-=L;if(b<0)L=Math.max(0,W[z].S-100),t=!1;else try{b="req"+b+"_"||"";try{var C=q instanceof Map?q:Object.entries(q);for(var f=g.T(C),V=f.next();!V.done;V=f.next()){var N=g.T(V.value),h=N.next().value,B=N.next().value,J=B;g.iv(B)&&(J=g.e6(B));u.push(b+h+"="+encodeURIComponent(J))}}catch(k){throw u.push(b+"type="+
encodeURIComponent("_badmap")),k;}}catch(k){P&&P(q)}}if(t){C=u.join("&");break a}}C=void 0}D=D.T.splice(0,m);Q.Iy=D;return C},dTv=function(D){D.S||D.Z||(D.cY=1,g.Fd(D.MD,D),D.Iy=0)},WD4=function(D){if(D.S||D.Z||D.Iy>=3)return!1;
D.cY++;D.Z=hT((0,g.d$)(D.MD,D),FDT(D,D.Iy));D.Iy++;return!0},yk$=function(D){D.QF!=null&&(g.Mu.clearTimeout(D.QF),D.QF=null)},ED4=function(D){D.S=new EQ(D,D.B,"rpc",D.cY);
D.U===null&&(D.S.u0=D.j);D.S.l0=0;var Q=D.Xw.clone();g.tN(Q,"RID","rpc");g.tN(Q,"SID",D.B);g.tN(Q,"AID",D.Y9);g.tN(Q,"CI",D.k9?"0":"1");!D.k9&&D.Ze&&g.tN(Q,"TO",D.Ze);g.tN(Q,"TYPE","xmlhttp");Hr(D,Q);D.U&&D.j&&g.CJ(Q,D.U,D.j);D.l0&&D.S.setTimeout(D.l0);var m=D.S;D=D.Lj;m.x9=1;m.Z=Dm(Q.clone());m.j=null;m.t0=!0;p5U(m,D)},k9=function(D){D.TO!=null&&(g.Mu.clearTimeout(D.TO),D.TO=null)},mT4=function(D,Q){var m=null;
if(D.S==Q){k9(D);yk$(D);D.S=null;var P=2}else if(P8U(D.C,Q))m=Q.Iy,uqV(D.C,Q),P=1;else return;if(D.CI!=0)if(Q.N)if(P==1){m=Q.j?Q.j.length:0;Q=Date.now()-Q.Kh;var W=D.Kh;P=vt4();P.dispatchEvent(new a5$(P,m,Q,W));IB(D)}else dTv(D);else{var L=Q.gB;W=Q.getLastError();if(W==3||W==0&&L>0||!(P==1&&TVK(D,Q)||P==2&&WD4(D)))switch(m&&m.length>0&&(Q=D.C,Q.T=Q.T.concat(m)),W){case 1:ly(D,5);break;case 4:ly(D,10);break;case 3:ly(D,6);break;default:ly(D,2)}}},FDT=function(D,Q){var m=D.HO+Math.floor(Math.random()*
D.ZD);
D.isActive()||(m*=2);return m*Q},ly=function(D,Q){if(Q==2){var m=(0,g.d$)(D.lQT,D),P=D.aF,W=!P;
P=new g.Qc(P||"//www.google.com/images/cleardot.gif");g.Mu.location&&g.Mu.location.protocol=="http"||g.mq(P,"https");Dm(P);W?oDT(P.toString(),m):fHT(P.toString(),m)}else Th(2);D.CI=0;D.J&&D.J.FL(Q);gDv(D);Zrh(D)},gDv=function(D){D.CI=0;
D.Kj=[];if(D.J){var Q=C8T(D.C);if(Q.length!=0||D.T.length!=0)g.lv(D.Kj,Q),g.lv(D.Kj,D.T),D.C.T.length=0,g.JM(D.T),D.T.length=0;D.J.f9()}},BV2=function(D){if(D.CI==0)return D.Kj;
var Q=[];g.lv(Q,C8T(D.C));g.lv(Q,D.T);return Q},LDP=function(D,Q,m){var P=g.zp(m);
P.S!=""?(Q&&g.PV(P,Q+"."+P.S),g.WV(P,P.T)):(P=g.Mu.location,P=REM(P.protocol,Q?Q+"."+P.hostname:P.hostname,+P.port,m));Q=D.t0;m=D.zY;Q&&m&&g.tN(P,Q,m);g.tN(P,"VER",D.XL);Hr(D,P);return P},X5K=function(D,Q,m){if(Q&&!D.x9)throw Error("Can't create secondary domain capable XhrIo object.");
Q=D.gi&&!D.kB?new g.Y7(new g.Gz({x3:m})):new g.Y7(D.kB);Q.U=D.x9;return Q},wDQ=function(){},k3$=function(){},j_=function(D,Q){g.zt.call(this);
this.S=new NVN(Q);this.J=D;this.C=Q&&Q.J0y||null;D=Q&&Q.uT0||null;Q&&Q.gI9&&(D?D["X-Client-Protocol"]="webchannel":D={"X-Client-Protocol":"webchannel"});this.S.j=D;D=Q&&Q.TMy||null;Q&&Q.aN&&(D?D["X-WebChannel-Content-Type"]=Q.aN:D={"X-WebChannel-Content-Type":Q.aN});Q&&Q.e4&&(D?D["X-WebChannel-Client-Profile"]=Q.e4:D={"X-WebChannel-Client-Profile":Q.e4});this.S.hU=D;(D=Q&&Q.CR0)&&!g.J6(D)&&(this.S.U=D);this.N=Q&&Q.rN0||!1;this.B=Q&&Q.CaD||!1;(Q=Q&&Q.QU)&&!g.J6(Q)&&(this.S.t0=Q,g.dC(this.C,Q)&&(D=
this.C,Q in D&&delete D[Q]));this.T=new K0(this)},Jk4=function(D){jSP.call(this);
D.__headers__&&(this.headers=D.__headers__,this.statusCode=D.__status__,delete D.__headers__,delete D.__status__);var Q=D.__sm__;Q?this.data=(this.S=g.mx(Q))?g.qD(Q,this.S):Q:this.data=D},lHK=function(D){$ZV.call(this);
this.status=1;this.errorCode=D},K0=function(D){this.S=D},IHM=function(D,Q){this.C=D;
this.S=Q},RdT=function(D){return BV2(D.S).map(function(Q){var m=D.C;
Q=Q.map;"__data__"in Q?(Q=Q.__data__,m=m.B?Eyk(Q):Q):m=Q;return m})},$9=function(D,Q){if(typeof D!=="function")throw Error("Fn must not be null and must be a function");
return g.Mu.setTimeout(function(){D()},Q)},vr=function(D){e_.dispatchEvent(new UTU(e_,D))},UTU=function(D){g.Ab.call(this,"statevent",D)},OQ=function(D,Q,m,P){this.S=D;
this.B=Q;this.U=m;this.N=P||1;this.C=45E3;this.T=new g.oO(this);this.J=new g.Ur;this.J.setInterval(250)},KDN=function(D,Q,m){D.fg=1;
D.U0=Dm(Q.clone());D.Nh=m;D.t0=!0;Hr4(D,null)},jWh=function(D,Q,m,P,W){D.fg=1;
D.U0=Dm(Q.clone());D.Nh=null;D.t0=m;W&&(D.sE=!1);Hr4(D,P)},Hr4=function(D,Q){D.rp=Date.now();
$TT(D);D.Eb=D.U0.clone();QY(D.Eb,"t",D.N);D.oX=0;D.uK=D.S.vM(D.S.zp()?Q:null);D.Ot>0&&(D.Mi=new g.rt((0,g.d$)(D.Sf,D,D.uK),D.Ot));D.T.listen(D.uK,"readystatechange",D.BK);Q=D.Kb?g.o2(D.Kb):{};D.Nh?(D.Fx="POST",Q["Content-Type"]="application/x-www-form-urlencoded",D.uK.send(D.Eb,D.Fx,D.Nh,Q)):(D.Fx="GET",D.sE&&!g.d9&&(Q.Connection="close"),D.uK.send(D.Eb,D.Fx,null,Q));D.S.ob(1)},Orv=function(D,Q){var m=D.oX,P=Q.indexOf("\n",m);
if(P==-1)return edh;m=Number(Q.substring(m,P));if(isNaN(m))return vDN;P+=1;if(P+m>Q.length)return edh;Q=Q.slice(P,P+m);D.oX=P+m;return Q},$TT=function(D){D.JV=Date.now()+D.C;
Y44(D,D.C)},Y44=function(D,Q){if(D.i8!=null)throw Error("WatchDog timer not null");
D.i8=$9((0,g.d$)(D.h4,D),Q)},aH2=function(D){D.i8&&(g.Mu.clearTimeout(D.i8),D.i8=null)},AkV=function(D){D.S.TE()||D.q9||D.S.VE(D)},Y9=function(D){aH2(D);
g.Dp(D.Mi);D.Mi=null;D.J.stop();D.T.removeAll();if(D.uK){var Q=D.uK;D.uK=null;Q.abort();Q.dispose()}D.fS&&(D.fS=null)},pD4=function(D,Q){try{D.S.Ce(D,Q),D.S.ob(4)}catch(m){}},XDQ=function(D,Q,m,P,W){if(P==0)m(!1);
else{var L=W||0;P--;xT$(D,Q,function(u){u?m(!0):g.Mu.setTimeout(function(){XDQ(D,Q,m,P,L)},L)})}},xT$=function(D,Q,m){var P=new Image;
P.onload=function(){try{aB(P),m(!0)}catch(W){}};
P.onerror=function(){try{aB(P),m(!1)}catch(W){}};
P.onabort=function(){try{aB(P),m(!1)}catch(W){}};
P.ontimeout=function(){try{aB(P),m(!1)}catch(W){}};
g.Mu.setTimeout(function(){if(P.ontimeout)P.ontimeout()},Q);
P.src=D},aB=function(D){D.onload=null;
D.onerror=null;D.onabort=null;D.ontimeout=null},S44=function(D){this.S=D;
this.C=new Zm},rk4=function(D){var Q=AT(D.S,D.u4,"/mail/images/cleardot.gif");
Dm(Q);XDQ(Q.toString(),5E3,(0,g.d$)(D.u3,D),3,2E3);D.ob(1)},G34=function(D){var Q=D.S.N;
Q!=null?(vr(5),Q?(vr(11),p0(D.S,D,!1)):(vr(12),p0(D.S,D,!0))):(D.hT=new OQ(D),D.hT.Kb=D.eG,Q=D.S,Q=AT(Q,Q.zp()?D.yc:null,D.wE),vr(5),QY(Q,"TYPE","xmlhttp"),jWh(D.hT,Q,!1,D.yc,!1))},MaU=function(D,Q,m){this.S=1;
this.C=[];this.T=[];this.J=new Zm;this.j=D||null;this.N=Q!=null?Q:null;this.Z=m||!1},ck4=function(D,Q){this.S=D;
this.map=Q;this.context=null},DRP=function(D,Q,m,P){g.Ab.call(this,"timingevent",D);
this.size=Q;this.rtt=m;this.retries=P},QoV=function(D){g.Ab.call(this,"serverreachability",D)},PI4=function(D){D.Rs(1,0);
D.jQ=AT(D,null,D.Ut);mR$(D)},WV$=function(D){D.dh&&(D.dh.abort(),D.dh=null);
D.n6&&(D.n6.cancel(),D.n6=null);D.hZ&&(g.Mu.clearTimeout(D.hZ),D.hZ=null);x9(D);D.uW&&(D.uW.cancel(),D.uW=null);D.aG&&(g.Mu.clearTimeout(D.aG),D.aG=null)},iRP=function(D,Q){if(D.S==0)throw Error("Invalid operation: sending map when state is closed");
D.C.push(new ck4(D.K5++,Q));D.S!=2&&D.S!=3||mR$(D)},soT=function(D){var Q=0;
D.n6&&Q++;D.uW&&Q++;return Q},mR$=function(D){D.uW||D.aG||(D.aG=$9((0,g.d$)(D.gA,D),0),D.P5=0)},dR4=function(D,Q){if(D.S==1){if(!Q){D.ma=Math.floor(Math.random()*1E5);
Q=D.ma++;var m=new OQ(D,"",Q);m.Kb=D.Ff;var P=LVK(D),W=D.jQ.clone();g.tN(W,"RID",Q);g.tN(W,"CVER","1");Xk(D,W);KDN(m,W,P);D.uW=m;D.S=2}}else D.S==3&&(Q?uMP(D,Q):D.C.length==0||D.uW||uMP(D))},uMP=function(D,Q){if(Q)if(D.tH>6){D.C=D.T.concat(D.C);
D.T.length=0;var m=D.ma-1;Q=LVK(D)}else m=Q.U,Q=Q.Nh;else m=D.ma++,Q=LVK(D);var P=D.jQ.clone();g.tN(P,"SID",D.B);g.tN(P,"RID",m);g.tN(P,"AID",D.aC);Xk(D,P);m=new OQ(D,D.B,m,D.P5+1);m.Kb=D.Ff;m.setTimeout(1E4+Math.round(1E4*Math.random()));D.uW=m;KDN(m,P,Q)},Xk=function(D,Q){D.Tm&&(D=D.Tm.D3())&&g.MQ(D,function(m,P){g.tN(Q,P,m)})},LVK=function(D){var Q=Math.min(D.C.length,1E3),m=["count="+Q];
if(D.tH>6&&Q>0){var P=D.C[0].S;m.push("ofs="+P)}else P=0;for(var W={},L=0;L<Q;W={VY:void 0},L++){W.VY=D.C[L].S;var u=D.C[L].map;W.VY=D.tH<=6?L:W.VY-P;try{g.MQ(u,function(t){return function(z,b){m.push("req"+t.VY+"_"+b+"="+encodeURIComponent(z))}}(W))}catch(t){m.push("req"+W.VY+"_type="+encodeURIComponent("_badmap"))}}D.T=D.T.concat(D.C.splice(0,Q));
return m.join("&")},tIV=function(D){D.n6||D.hZ||(D.U=1,D.hZ=$9((0,g.d$)(D.IV,D),0),D.ZP=0)},bRU=function(D){if(D.n6||D.hZ||D.ZP>=3)return!1;
D.U++;D.hZ=$9((0,g.d$)(D.IV,D),zm$(D,D.ZP));D.ZP++;return!0},p0=function(D,Q,m){D.o6=D.N==null?m:!D.N;
D.Hy=Q.gm;D.Z||PI4(D)},x9=function(D){D.bk!=null&&(g.Mu.clearTimeout(D.bk),D.bk=null)},zm$=function(D,Q){var m=5E3+Math.floor(Math.random()*1E4);
D.isActive()||(m*=2);return m*Q},S_=function(D,Q){if(Q==2||Q==9){var m=null;
D.Tm&&(m=null);var P=(0,g.d$)(D.WoT,D);m||(m=new g.Qc("//www.google.com/images/cleardot.gif"),Dm(m));xT$(m.toString(),1E4,P)}else vr(2);qiv(D,Q)},qiv=function(D,Q){D.S=0;
D.Tm&&D.Tm.hh(Q);CIP(D);WV$(D)},CIP=function(D){D.S=0;
D.Hy=-1;if(D.Tm)if(D.T.length==0&&D.C.length==0)D.Tm.qq();else{var Q=g.JM(D.T),m=g.JM(D.C);D.T.length=0;D.C.length=0;D.Tm.qq(Q,m)}},AT=function(D,Q,m){var P=g.zp(m);
if(P.S!="")Q&&g.PV(P,Q+"."+P.S),g.WV(P,P.T);else{var W=window.location;P=REM(W.protocol,Q?Q+"."+W.hostname:W.hostname,+W.port,m)}D.L4&&g.MQ(D.L4,function(L,u){g.tN(P,u,L)});
g.tN(P,"VER",D.tH);Xk(D,P);return P},oT4=function(){},fhP=function(){this.S=[];
this.C=[]},VI4=function(D){g.Ab.call(this,"channelMessage");
this.message=D},Nkh=function(D){g.Ab.call(this,"channelError");
this.error=D},yEk=function(D,Q){this.action=D;
this.params=Q||{}},rp=function(D,Q){g.v.call(this);
this.S=new g.pJ(this.vB9,0,this);g.O(this,this.S);this.S6=5E3;this.C=0;if(typeof D==="function")Q&&(D=(0,g.d$)(D,Q));else if(D&&typeof D.handleEvent==="function")D=(0,g.d$)(D.handleEvent,D);else throw Error("Invalid listener argument");this.T=D},ZRv=function(D,Q,m,P,W,L,u,t,z,b,q,C,f,V){m=m===void 0?!1:m;
P=P===void 0?function(){return""}:P;
W=W===void 0?!1:W;L=L===void 0?!1:L;u=u===void 0?!1:u;t=t===void 0?function(){return g.k7({})}:t;
z=z===void 0?!1:z;q=q===void 0?!1:q;C=C===void 0?!1:C;f=f===void 0?!1:f;V=V===void 0?!1:V;this.x9=D;this.TO=Q;this.N=new g.TY;this.C=new rp(this.aDD,this);this.S=null;this.U=!1;this.j=null;this.Kh="";this.Iy=this.Z=0;this.T=[];this.Kj=m;this.t0=P;this.J=L;this.u0=t;this.wc=b;this.cY=u;this.QF=null;this.B=g.k7();this.Lj=W;this.hU=z;this.jD=q;this.oy=C;this.PY=f;this.gB=V;this.l0=new gyN;this.k9=new Bj2;this.XT=new kXP;this.GO=new wdN;this.Y9=new Jl4;this.pj=new lGU;this.dn=new IGU},hmh=function(D,
Q,m,P,W){FV2(D);
if(D.S){var L=g.YK("ID_TOKEN"),u=D.S.Ff||{};L?u["x-youtube-identity-token"]=L:delete u["x-youtube-identity-token"];D.S.Ff=u}TkU(D);P?(P.getState()!=3&&soT(P)==0||P.getState(),D.S.connect(Q,m,D.TO,P.B,P.aC)):W?D.S.connect(Q,m,D.TO,W.sessionId,W.arrayId):D.S.connect(Q,m,D.TO)},BkU=function(D,Q){return D.PY?!0:D.oy?Object.values(nTU).includes(Q):D.jD?!Object.values(ET4).includes(Q):D.gB?Object.values(gT4).includes(Q):!1},JET=function(D){var Q,m;
g.U(function(P){if(P.C==1)return g.n9(P,2),g.I(P,wfk(D),2);g.Rn(P);Q=D.T;D.T=[];m=Q.length;k04(D,Q,m);Gh(D);return g.Hh(P,0)})},k04=function(D,Q,m){for(var P=0;P<m;++P)iRP(D.S,Q[P]);
Gh(D)},Gh=function(D){D.publish("handlerOpened");
D.l0.Gi("BROWSER_CHANNEL")},FV2=function(D){if(D.S){var Q=D.t0(),m=D.S.Ff||{};
Q?m["x-youtube-lounge-xsrf-token"]=Q:delete m["x-youtube-lounge-xsrf-token"];D.S.Ff=m}},wfk=function(D){if(D.hU)return g.k7();
if(!D.cY)return lh$(D);D.QF===null&&(D.QF=lh$(D));return D.QF},lh$=function(D){return g.Is(D.u0().then(function(Q){Ihh(D,Q)}).Fn(function(){}),function(){D.QF=null})},Ihh=function(D,Q){if(D.S){var m=D.S.Ff||{};
Q&&Object.keys(Q).length>0?m=Object.assign({},m,Q):delete m.Authorization;D.S.Ff=m}},TkU=function(D){D.wc&&!D.J&&Ihh(D,D.wc())},Ms=function(D){this.scheme="https";
this.port=this.domain="";this.S="/api/lounge";this.C=!0;D=D||document.location.href;var Q=Number(g.LG(D)[4]||null)||"";Q&&(this.port=":"+Q);this.domain=g.uY(D)||"";D=g.Kg();D.search("MSIE")>=0&&(D=D.match(/MSIE ([\d.]+)/)[1],g.HK(D,"10.0")<0&&(this.C=!1))},cr=function(D,Q){var m=D.S;
D.C&&(m=D.scheme+"://"+D.domain+D.port+D.S);return g.oz(m+Q,{})},Rm4=function(D,Q){g.zt.call(this);
var m=this;this.handler=D();this.handler.subscribe("handlerOpened",this.n5,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(P,W){m.onError(W)});
this.handler.subscribe("handlerMessage",this.onMessage,this);this.S=Q},URP=function(D,Q,m){var P=this;
m=m===void 0?function(){return""}:m;
var W=W===void 0?new k3$:W;var L=L===void 0?new g.TY:L;this.pathPrefix=D;this.S=Q;this.Kh=m;this.J=L;this.Z=null;this.j=this.U=0;this.channel=null;this.N=0;this.T=new rp(function(){P.T.isActive();var u;((u=P.channel)==null?void 0:ir2((new IHM(u,u.S)).S.C))===0&&P.connect(P.Z,P.U)});
this.B={};this.C={};this.TO=!1;this.logger=null;this.Iy=[];this.al=void 0;this.u0=new gyN;this.QF=new Bj2;this.wc=new wdN;this.t0=new Jl4},HR$=function(D){g.cT(D.channel,"m",function(){D.N=3;
D.T.reset();D.Z=null;D.U=0;for(var Q=g.T(D.Iy),m=Q.next();!m.done;m=Q.next())m=m.value,D.channel&&D.channel.send(m);D.Iy=[];D.publish("webChannelOpened");D.u0.Gi("WEB_CHANNEL")});
g.cT(D.channel,"n",function(){D.N=0;D.T.isActive()||D.publish("webChannelClosed");var Q,m=(Q=D.channel)==null?void 0:RdT(new IHM(Q,Q.S));m&&(D.Iy=[].concat(g.on(m)));D.QF.Gi("WEB_CHANNEL")});
g.cT(D.channel,"p",function(Q){var m=Q.data;m[0]==="gracefulReconnect"?(D.T.start(),D.channel&&D.channel.close()):D.publish("webChannelMessage",new yEk(m[0],m[1]));D.al=Q.statusCode;D.wc.Gi("WEB_CHANNEL")});
g.cT(D.channel,"o",function(){D.al===401||D.T.start();D.publish("webChannelError");D.t0.Gi("WEB_CHANNEL","")})},KV4=function(D){var Q=D.Kh();
Q?D.B["x-youtube-lounge-xsrf-token"]=Q:delete D.B["x-youtube-lounge-xsrf-token"]},joM=function(D){g.zt.call(this);
this.S=D();this.S.subscribe("webChannelOpened",this.NZ,this);this.S.subscribe("webChannelClosed",this.onClosed,this);this.S.subscribe("webChannelError",this.onError,this);this.S.subscribe("webChannelMessage",this.onMessage,this)},$RM=function(D,Q,m,P,W){function L(){return new ZRv(cr(D,"/bc"),Q,!1,m,P)}
m=m===void 0?function(){return""}:m;
return g.oi("enable_mdx_web_channel_desktop")?new joM(function(){return new URP(cr(D,"/wc"),Q,m)}):new Rm4(L,W)},Yi4=function(){var D=emh;
vTP();DS.push(D);OR2()},QZ=function(D,Q){vTP();
var m=ahk(D,String(Q));DS.length==0?AEQ(m):(OR2(),g.S2(DS,function(P){P(m)}))},mC=function(D){QZ("CP",D)},vTP=function(){DS||(DS=g.Q4("yt.mdx.remote.debug.handlers_")||[],g.ch("yt.mdx.remote.debug.handlers_",DS))},AEQ=function(D){var Q=(PY+1)%50;
PY=Q;WY[Q]=D;iW||(iW=Q==49)},OR2=function(){var D=DS;
if(WY[0]){var Q=iW?PY:-1,m={};do m={Hu:void 0},Q=(Q+1)%50,m.Hu=WY[Q],g.S2(D,function(P){return function(W){W(P.Hu)}}(m));
while(Q!=PY);WY=Array(50);PY=-1;iW=!1}},ahk=function(D,Q){var m=(Date.now()-pf4)/1E3;
m.toFixed&&(m=m.toFixed(3));var P=[];P.push("[",m+"s","] ");P.push("[","yt.mdx.remote","] ");P.push(D+": "+Q,"\n");return P.join("")},sp=function(D){g.iR.call(this);
this.N=D;this.screens=[]},xRh=function(D,Q){var m=D.get(Q.uuid)||D.get(Q.id);
if(m)return D=m.name,m.id=Q.id||m.id,m.name=Q.name,m.token=Q.token,m.uuid=Q.uuid||m.uuid,m.name!=D;D.screens.push(Q);return!0},Xfh=function(D,Q){var m=D.screens.length!=Q.length;
D.screens=g.g0(D.screens,function(L){return!!bU2(Q,L)});
for(var P=Q.length,W=0;W<P;W++)m=xRh(D,Q[W])||m;return m},SiK=function(D,Q){var m=D.screens.length;
D.screens=g.g0(D.screens,function(P){return!(P||Q?!P!=!Q?0:P.id==Q.id:1)});
return D.screens.length<m},rEh=function(D,Q,m,P,W){g.iR.call(this);
this.T=D;this.U=Q;this.B=m;this.N=P;this.J=W;this.C=0;this.S=null;this.Gc=NaN},uW=function(D){sp.call(this,"LocalScreenService");
this.C=D;this.S=NaN;LQ(this);this.info("Initializing with "+dZN(this.screens))},G04=function(D){if(D.screens.length){var Q=g.fk(D.screens,function(P){return P.id}),m=cr(D.C,"/pairing/get_lounge_token_batch");
D.C.sendRequest("POST",m,{screen_ids:Q.join(",")},(0,g.d$)(D.Z4,D),(0,g.d$)(D.ij,D))}},LQ=function(D){if(g.oi("deprecate_pair_servlet_enabled"))return Xfh(D,[]);
var Q=u7V(yJh());Q=g.g0(Q,function(m){return!m.uuid});
return Xfh(D,Q)},dZ=function(D,Q){F92(g.fk(D.screens,OpQ));
Q&&ZU$()},cE$=function(D,Q){g.iR.call(this);
this.N=Q;Q=(Q=g.kt("yt-remote-online-screen-ids")||"")?Q.split(","):[];for(var m={},P=this.N(),W=P.length,L=0;L<W;++L){var u=P[L].id;m[u]=g.FK(Q,u)}this.S=m;this.J=D;this.T=this.B=NaN;this.C=null;MIv("Initialized with "+g.e6(this.S))},DFv=function(D,Q,m){var P=cr(D.J,"/pairing/get_screen_availability");
D.J.sendRequest("POST",P,{lounge_token:Q.token},(0,g.d$)(function(W){W=W.screens||[];for(var L=W.length,u=0;u<L;++u)if(W[u].loungeToken==Q.token){m(W[u].status=="online");return}m(!1)},D),(0,g.d$)(function(){m(!1)},D))},mF$=function(D,Q){a:if(hEh(Q)!=hEh(D.S))var m=!1;
else{m=g.i7(Q);for(var P=m.length,W=0;W<P;++W)if(!D.S[m[W]]){m=!1;break a}m=!0}m||(MIv("Updated online screens: "+g.e6(D.S)),D.S=Q,D.publish("screenChange"));QlU(D)},te=function(D){isNaN(D.T)||g.bS(D.T);
D.T=g.tl((0,g.d$)(D.bI,D),D.B>0&&D.B<g.bv()?2E4:1E4)},MIv=function(D){QZ("OnlineScreenService",D)},PEV=function(D){var Q={};
g.S2(D.N(),function(m){m.token?Q[m.token]=m.id:this.eb("Requesting availability of screen w/o lounge token.")});
return Q},QlU=function(D){D=g.i7(g.cP(D.S,function(Q){return Q}));
g.pV(D);D.length?g.wb("yt-remote-online-screen-ids",D.join(","),60):g.JJ("yt-remote-online-screen-ids")},zm=function(D,Q){Q=Q===void 0?!1:Q;
sp.call(this,"ScreenService");this.B=D;this.U=Q;this.S=this.C=null;this.T=[];this.J={};WN2(this)},slk=function(D,Q,m,P,W,L){D.info("getAutomaticScreenByIds "+m+" / "+Q);
m||(m=D.J[Q]);var u=D.JT(),t=m?zh(u,m):null;m&&(D.U||t)||(t=zh(u,Q));if(t){t.uuid=Q;var z=bW(D,t);DFv(D.S,z,function(b){W(b?z:null)})}else m?iPh(D,m,(0,g.d$)(function(b){var q=bW(this,new uy({name:P,
screenId:m,loungeToken:b,dialId:Q||""}));DFv(this.S,q,function(C){W(C?q:null)})},D),L):W(null)},LN4=function(D,Q){for(var m=D.screens.length,P=0;P<m;++P)if(D.screens[P].name==Q)return D.screens[P];
return null},uEU=function(D,Q,m){DFv(D.S,Q,m)},iPh=function(D,Q,m,P){D.info("requestLoungeToken_ for "+Q);
var W={postParams:{screen_ids:Q},method:"POST",context:D,onSuccess:function(L,u){L=u&&u.screens||[];L[0]&&L[0].screenId==Q?m(L[0].loungeToken):P(Error("Missing lounge token in token response"))},
onError:function(){P(Error("Request screen lounge token failed"))}};
g.ZG(cr(D.B,"/pairing/get_lounge_token_batch"),W)},dF4=function(D){D.screens=D.C.JT();
var Q=D.J,m={},P;for(P in Q)m[Q[P]]=P;Q=D.screens.length;for(P=0;P<Q;++P){var W=D.screens[P];W.uuid=m[W.id]||""}D.info("Updated manual screens: "+dZN(D.screens))},WN2=function(D){tFv(D);
D.C=new uW(D.B);D.C.subscribe("screenChange",(0,g.d$)(D.oB,D));dF4(D);D.U||(D.T=u7V(g.kt("yt-remote-automatic-screen-cache")||[]));tFv(D);D.info("Initializing automatic screens: "+dZN(D.T));D.S=new cE$(D.B,(0,g.d$)(D.JT,D,!0));D.S.subscribe("screenChange",(0,g.d$)(function(){this.publish("onlineScreenChange")},D))},bW=function(D,Q){var m=D.get(Q.id);
m?(m.uuid=Q.uuid,Q=m):((m=zh(D.T,Q.uuid))?(m.id=Q.id,m.token=Q.token,Q=m):D.T.push(Q),D.U||zOU(D));tFv(D);D.J[Q.uuid]=Q.id;g.wb("yt-remote-device-id-map",D.J,31536E3);return Q},zOU=function(D){D=g.g0(D.T,function(Q){return Q.idType!="shortLived"});
g.wb("yt-remote-automatic-screen-cache",g.fk(D,OpQ))},tFv=function(D){D.J=g.kt("yt-remote-device-id-map")||{}},qE=function(D,Q,m){g.iR.call(this);
this.t0=m;this.B=D;this.C=Q;this.S=null},CQ=function(D,Q){D.S=Q;
D.publish("sessionScreen",D.S)},bPh=function(D,Q){D.S&&(D.S.token=Q,bW(D.B,D.S));
D.publish("sessionScreen",D.S)},om=function(D,Q){QZ(D.t0,Q)},fQ=function(D,Q,m){qE.call(this,D,Q,"CastSession");
var P=this;this.config_=m;this.T=null;this.Iy=(0,g.d$)(this.J4,this);this.QF=(0,g.d$)(this.ADy,this);this.TO=g.tl(function(){qk$(P,null)},12E4);
this.U=this.J=this.N=this.Z=0;this.Kh=!1;this.j="unknown"},ojU=function(D,Q){g.bS(D.U);
D.U=0;Q==0?CEV(D):D.U=g.tl(function(){CEV(D)},Q)},CEV=function(D){fy2(D,"getLoungeToken");
g.bS(D.J);D.J=g.tl(function(){VFh(D,null)},3E4)},fy2=function(D,Q){D.info("sendYoutubeMessage_: "+Q+" "+g.e6());
var m={};m.type=Q;D.T?D.T.sendMessage("urn:x-cast:com.google.youtube.mdx",m,function(){},(0,g.d$)(function(){om(this,"Failed to send message: "+Q+".")},D)):om(D,"Sending yt message without session: "+g.e6(m))},NAk=function(D,Q){Q?(D.info("onConnectedScreenId_: Received screenId: "+Q),D.S&&D.S.id==Q||D.yl(Q,function(m){CQ(D,m)},function(){return D.Z_()},5)):D.Z_(Error("Waiting for session status timed out."))},ZP4=function(D,Q,m){D.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(Q));
var P=new uy(Q);yj4(D,P,function(W){W?(D.Kh=!0,bW(D.B,P),CQ(D,P),D.j="unknown",ojU(D,m)):(g.p4(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(Q)+" is not online.")),D.Z_())},5)},qk$=function(D,Q){g.bS(D.TO);
D.TO=0;Q?D.config_.enableCastLoungeToken&&Q.loungeToken?Q.deviceId?D.S&&D.S.uuid==Q.deviceId||(Q.loungeTokenRefreshIntervalMs?ZP4(D,{name:D.C.friendlyName,screenId:Q.screenId,loungeToken:Q.loungeToken,dialId:Q.deviceId,screenIdType:"shortLived"},Q.loungeTokenRefreshIntervalMs):(g.p4(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(Q)+".")),NAk(D,Q.screenId))):(g.p4(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(Q)+".")),NAk(D,Q.screenId)):
NAk(D,Q.screenId):D.Z_(Error("Waiting for session status timed out."))},VFh=function(D,Q){g.bS(D.J);
D.J=0;var m=null;if(Q)if(Q.loungeToken){var P;((P=D.S)==null?void 0:P.token)==Q.loungeToken&&(m="staleLoungeToken")}else m="missingLoungeToken";else m="noLoungeTokenResponse";m?(D.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(Q)+", error: "+m)),D.j=m,ojU(D,3E4)):(bPh(D,Q.loungeToken),D.Kh=!1,D.j="unknown",ojU(D,Q.loungeTokenRefreshIntervalMs))},yj4=function(D,Q,m,P){g.bS(D.N);
D.N=0;uEU(D.B,Q,function(W){W||P<0?m(W):D.N=g.tl(function(){yj4(D,Q,m,P-1)},300)})},FNv=function(D){g.bS(D.Z);
D.Z=0;g.bS(D.N);D.N=0;g.bS(D.TO);D.TO=0;g.bS(D.J);D.J=0;g.bS(D.U);D.U=0},VZ=function(D,Q,m,P){qE.call(this,D,Q,"DialSession");
this.config_=P;this.T=this.Z=null;this.QF="";this.x9=m;this.u0=null;this.TO=function(){};
this.j=NaN;this.wc=(0,g.d$)(this.vK,this);this.J=function(){};
this.U=this.N=0;this.Iy=!1;this.Kh="unknown"},NE=function(D){var Q;
return!!(D.config_.enableDialLoungeToken&&((Q=D.T)==null?0:Q.getDialAppInfo))},TAN=function(D){D.J=D.B.bN(D.QF,D.C.label,D.C.friendlyName,NE(D),function(Q,m){D.J=function(){};
D.Iy=!0;CQ(D,Q);Q.idType=="shortLived"&&m>0&&yZ(D,m)},function(Q){D.J=function(){};
D.Z_(Q)})},hOV=function(D){var Q={};
Q.pairingCode=D.QF;Q.theme=D.x9;hWT()&&(Q.env_useStageMdx=1);return g.CG(Q)},njN=function(D){return new Promise(function(Q){D.QF=t0h();
if(D.u0){var m=new chrome.cast.DialLaunchResponse(!0,hOV(D));Q(m);TAN(D)}else D.TO=function(){g.bS(D.j);D.TO=function(){};
D.j=NaN;var P=new chrome.cast.DialLaunchResponse(!0,hOV(D));Q(P);TAN(D)},D.j=g.tl(function(){D.TO()},100)})},gjN=function(D,Q,m){D.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(Q));
var P=new uy(Q);return(new Promise(function(W){EjP(D,P,function(L){L?(D.Iy=!0,bW(D.B,P),CQ(D,P),yZ(D,m)):g.p4(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(Q)+" is not online."));W(L)},5)})).then(function(W){return W?new chrome.cast.DialLaunchResponse(!1):njN(D)})},BA2=function(D,Q){var m=D.Z.receiver.label,P=D.C.friendlyName;
return(new Promise(function(W){slk(D.B,m,Q,P,function(L){L&&L.token&&CQ(D,L);W(L)},function(L){om(D,"Failed to get DIAL screen: "+L);
W(null)})})).then(function(W){return W&&W.token?new chrome.cast.DialLaunchResponse(!1):njN(D)})},EjP=function(D,Q,m,P){g.bS(D.N);
D.N=0;uEU(D.B,Q,function(W){W||P<0?m(W):D.N=g.tl(function(){EjP(D,Q,m,P-1)},300)})},yZ=function(D,Q){D.info("getDialAppInfoWithTimeout_ "+Q);
NE(D)&&(g.bS(D.U),D.U=0,Q==0?wqv(D):D.U=g.tl(function(){wqv(D)},Q))},wqv=function(D){NE(D)&&D.T.getDialAppInfo(function(Q){D.info("getDialAppInfo dialLaunchData: "+JSON.stringify(Q));
Q=Q.extraData||{};var m=null;if(Q.loungeToken){var P;((P=D.S)==null?void 0:P.token)==Q.loungeToken&&(m="staleLoungeToken")}else m="missingLoungeToken";m?(D.Kh=m,yZ(D,3E4)):(D.Iy=!1,D.Kh="unknown",bPh(D,Q.loungeToken),yZ(D,Q.loungeTokenRefreshIntervalMs))},function(Q){D.info("getDialAppInfo error: "+Q);
D.Kh="noLoungeTokenResponse";yZ(D,3E4)})},kcK=function(D){g.bS(D.N);
D.N=0;g.bS(D.U);D.U=0;D.J();D.J=function(){};
g.bS(D.j)},ZS=function(D,Q){qE.call(this,D,Q,"ManualSession");
this.T=g.tl((0,g.d$)(this.eU,this,null),150)},Fm=function(D,Q){g.iR.call(this);
this.config_=Q;this.C=D;this.Z=Q.appId||"233637DE";this.B=Q.theme||"cl";this.j=Q.disableCastApi||!1;this.N=Q.forceMirroring||!1;this.S=null;this.U=!1;this.T=[];this.J=(0,g.d$)(this.iM0,this)},Jjk=function(D,Q){return Q?g.y4(D.T,function(m){return dp(Q,m.label)},D):null},Tm=function(D){QZ("Controller",D)},emh=function(D){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(D)},he=function(D){return D.U||!!D.T.length||!!D.S},nQ=function(D,Q,m){Q!=D.S&&(g.Dp(D.S),(D.S=Q)?(m?D.publish("yt-remote-cast2-receiver-resumed",
Q.C):D.publish("yt-remote-cast2-receiver-selected",Q.C),Q.subscribe("sessionScreen",(0,g.d$)(D.lC,D,Q)),Q.subscribe("sessionFailed",function(){return lyk(D,Q)}),Q.S?D.publish("yt-remote-cast2-session-change",Q.S):m&&D.S.eU(null)):D.publish("yt-remote-cast2-session-change",null))},lyk=function(D,Q){D.S==Q&&D.publish("yt-remote-cast2-session-failed")},IyU=function(D){var Q=D.C.N2(),m=D.S&&D.S.C;
D=g.fk(Q,function(P){m&&dp(P,m.label)&&(m=null);var W=P.uuid?P.uuid:P.id,L=Jjk(this,P);L?(L.label=W,L.friendlyName=P.name):(L=new chrome.cast.Receiver(W,P.name),L.receiverType=chrome.cast.ReceiverType.CUSTOM);return L},D);
m&&(m.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(m=new chrome.cast.Receiver(m.label,m.friendlyName),m.receiverType=chrome.cast.ReceiverType.CUSTOM),D.push(m));return D},vjU=function(D,Q,m,P){P.disableCastApi?Ep("Cannot initialize because disabled by Mdx config."):RON()?UFK(Q,P)&&(HPT(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?KNV(D,m):(window.__onGCastApiAvailable=function(W,L){W?KNV(D,m):(gZ("Failed to load cast API: "+L),jlV(!1),HPT(!1),g.JJ("yt-remote-cast-available"),g.JJ("yt-remote-cast-receiver"),
$Fk(),m(!1))},P.loadCastApiSetupScript?g.mN(eO$):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?Et4()>=60&&UZ4():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?kP$():Et4()>=89?K9$():(RW$(),Ns(HUM.map(JJN))))):Ep("Cannot initialize because not running Chrome")},$Fk=function(){Ep("dispose");
var D=BY();D&&D.dispose();g.ch("yt.mdx.remote.cloudview.instance_",null);OPk(!1);g.Dy(Ykh);Ykh.length=0},wZ=function(){return!!g.kt("yt-remote-cast-installed")},ayP=function(){var D=g.kt("yt-remote-cast-receiver");
return D?D.friendlyName:null},AjV=function(){Ep("clearCurrentReceiver");
g.JJ("yt-remote-cast-receiver")},pqV=function(){return wZ()?BY()?BY().getCastSession():(gZ("getCastSelector: Cast is not initialized."),null):(gZ("getCastSelector: Cast API is not installed!"),null)},xFv=function(){wZ()?BY()?kM()?(Ep("Requesting cast selector."),BY().requestSession()):(Ep("Wait for cast API to be ready to request the session."),Ykh.push(g.cf("yt-remote-cast2-api-ready",xFv))):gZ("requestCastSelector: Cast is not initialized."):gZ("requestCastSelector: Cast API is not installed!")},
Je=function(D,Q){kM()?BY().setConnectedScreenStatus(D,Q):gZ("setConnectedScreenStatus called before ready.")},RON=function(){var D=g.Kg().search(/ (CrMo|Chrome|CriOS)\//)>=0;
return g.Ta||D},Xqk=function(D,Q){BY().init(D,Q)},UFK=function(D,Q){var m=!1;
BY()||(D=new Fm(D,Q),D.subscribe("yt-remote-cast2-availability-change",function(P){g.wb("yt-remote-cast-available",P);f0("yt-remote-cast2-availability-change",P)}),D.subscribe("yt-remote-cast2-receiver-selected",function(P){Ep("onReceiverSelected: "+P.friendlyName);
g.wb("yt-remote-cast-receiver",P);f0("yt-remote-cast2-receiver-selected",P)}),D.subscribe("yt-remote-cast2-receiver-resumed",function(P){Ep("onReceiverResumed: "+P.friendlyName);
g.wb("yt-remote-cast-receiver",P);f0("yt-remote-cast2-receiver-resumed",P)}),D.subscribe("yt-remote-cast2-session-change",function(P){Ep("onSessionChange: "+tT(P));
P||g.JJ("yt-remote-cast-receiver");f0("yt-remote-cast2-session-change",P)}),g.ch("yt.mdx.remote.cloudview.instance_",D),m=!0);
Ep("cloudview.createSingleton_: "+m);return m},BY=function(){return g.Q4("yt.mdx.remote.cloudview.instance_")},KNV=function(D,Q){jlV(!0);
HPT(!1);Xqk(D,function(m){m?(OPk(!0),g.Q$("yt-remote-cast2-api-ready")):(gZ("Failed to initialize cast API."),jlV(!1),g.JJ("yt-remote-cast-available"),g.JJ("yt-remote-cast-receiver"),$Fk());Q(m)})},Ep=function(D){QZ("cloudview",D)},gZ=function(D){QZ("cloudview",D)},jlV=function(D){Ep("setCastInstalled_ "+D);
g.wb("yt-remote-cast-installed",D)},kM=function(){return!!g.Q4("yt.mdx.remote.cloudview.apiReady_")},OPk=function(D){Ep("setApiReady_ "+D);
g.ch("yt.mdx.remote.cloudview.apiReady_",D)},HPT=function(D){g.ch("yt.mdx.remote.cloudview.initializing_",D)},lW=function(D){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.J=this.N=0;this.trackData=null;this.wF=this.j9=!1;this.Z=this.T=this.U=this.C=0;this.S=NaN;this.B=!1;this.reset(D)},SkV=function(D){D.audioTrackId=null;
D.trackData=null;D.playerState=-1;D.j9=!1;D.wF=!1;D.N=0;D.J=g.bv();D.C=0;D.U=0;D.T=0;D.Z=0;D.S=NaN;D.B=!1},Im=function(D){return D.isPlaying()?(g.bv()-D.J)/1E3:0},Rm=function(D,Q){D.N=Q;
D.J=g.bv()},Up=function(D){switch(D.playerState){case 1:case 1081:return(g.bv()-D.J)/1E3+D.N;
case -1E3:return 0}return D.N},rj4=function(D){return D.B?D.U+Im(D):D.U},HY=function(D,Q,m){var P=D.videoId;
D.videoId=Q;D.index=m;Q!=P&&SkV(D)},Gc4=function(D){var Q={};
Q.index=D.index;Q.listId=D.listId;Q.videoId=D.videoId;Q.playerState=D.playerState;Q.volume=D.volume;Q.muted=D.muted;Q.audioTrackId=D.audioTrackId;Q.trackData=g.fg(D.trackData);Q.hasPrevious=D.j9;Q.hasNext=D.wF;Q.playerTime=D.N;Q.playerTimeAt=D.J;Q.seekableStart=D.C;Q.seekableEnd=D.U;Q.duration=D.T;Q.loadedTime=D.Z;Q.liveIngestionTime=D.S;return Q},jn=function(D,Q){g.iR.call(this);
var m=this;this.T=0;this.B=D;this.N=[];this.J=new fhP;this.C=this.S=null;this.j=(0,g.d$)(this.y0T,this);this.U=(0,g.d$)(this.aQ,this);this.Z=(0,g.d$)(this.o9F,this);this.TO=(0,g.d$)(this.Src,this);var P=0;D?(P=D.getProxyState(),P!=3&&(D.subscribe("proxyStateChange",this.s8,this),MFv(this))):P=3;P!=0&&(Q?this.s8(P):g.tl(function(){m.s8(P)},0));
(D=pqV())&&KQ(this,D);this.subscribe("yt-remote-cast2-session-change",this.TO)},$M=function(D){return new lW(D.B.getPlayerContextData())},MFv=function(D){g.S2("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(Q){this.N.push(this.B.subscribe(Q,g.zT(this.AxD,Q),this))},D)},cjv=function(D){g.S2(D.N,function(Q){this.B.unsubscribeByKey(Q)},D);
D.N.length=0},en=function(D){return D.getState()==1},vY=function(D,Q){var m=D.J;
m.S.length+m.C.length<50&&D.J.enqueue(Q)},DJU=function(D,Q,m){var P=$M(D);
Rm(P,m);P.playerState!=-1E3&&(P.playerState=Q);Op(D,P)},YM=function(D,Q,m){D.B.sendMessage(Q,m)},Op=function(D,Q){cjv(D);
D.B.setPlayerContextData(Gc4(Q));MFv(D)},KQ=function(D,Q){D.C&&(D.C.removeUpdateListener(D.j),D.C.removeMediaListener(D.U),D.aQ(null));
D.C=Q;D.C&&(mC("Setting cast session: "+D.C.sessionId),D.C.addUpdateListener(D.j),D.C.addMediaListener(D.U),D.C.media.length&&D.aQ(D.C.media[0]))},QCQ=function(D){var Q=D.S.media,m=D.S.customData;
if(Q&&m){var P=$M(D);Q.contentId!=P.videoId&&mC("Cast changing video to: "+Q.contentId);P.videoId=Q.contentId;P.playerState=m.playerState;Rm(P,D.S.getEstimatedTime());Op(D,P)}else mC("No cast media video. Ignoring state update.")},am=function(D,Q,m){return(0,g.d$)(function(P){this.eb("Failed to "+Q+" with cast v2 channel. Error code: "+P.code);
P.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.eb("Retrying "+Q+" using MDx browser channel."),YM(this,Q,m))},D)},xM=function(D,Q,m,P){P=P===void 0?!1:P;
g.iR.call(this);var W=this;this.N=NaN;this.QF=!1;this.j=this.Z=this.Iy=this.Kh=NaN;this.TO=[];this.J=this.U=this.B=this.S=this.C=null;this.u0=D;this.wc=P;this.TO.push(g.NZ(window,"beforeunload",function(){W.H3(2)}));
this.T=[];this.S=new lW;this.x9=Q.id;this.t0=Q.idType;this.C=$RM(this.u0,m,this.uN,this.t0=="shortLived",this.x9);this.C.listen("channelOpened",function(){mJT(W)});
this.C.listen("channelClosed",function(){Ae("Channel closed");isNaN(W.N)?C0(!0):C0();W.dispose()});
this.C.listen("channelError",function(L){C0();isNaN(W.qa())?(L==1&&W.t0=="shortLived"&&W.publish("browserChannelAuthError",L),Ae("Channel error: "+L+" without reconnection"),W.dispose()):(W.QF=!0,Ae("Channel error: "+L+" with reconnection in "+W.qa()+" ms"),pQ(W,2))});
this.C.listen("channelMessage",function(L){P4V(W,L)});
this.C.vp(Q.token);this.subscribe("remoteQueueChange",function(){var L=W.S.videoId;g.lz()&&g.wb("yt-remote-session-video-id",L)})},W0N=function(D){return g.y4(D.T,function(Q){return Q.type=="LOUNGE_SCREEN"})},Ae=function(D){QZ("conn",D)},pQ=function(D,Q){D.publish("proxyStateChange",Q)},ib2=function(D){D.N=g.tl(function(){Ae("Connecting timeout");
D.H3(1)},2E4)},sCK=function(D){g.bS(D.N);
D.N=NaN},L0M=function(D){g.bS(D.Kh);
D.Kh=NaN},dJ2=function(D){uzv(D);
D.Iy=g.tl(function(){Xm(D,"getNowPlaying")},2E4)},uzv=function(D){g.bS(D.Iy);
D.Iy=NaN},mJT=function(D){Ae("Channel opened");
D.QF&&(D.QF=!1,L0M(D),D.Kh=g.tl(function(){Ae("Timing out waiting for a screen.");D.H3(1)},15E3))},zzM=function(D,Q){var m=null;
if(Q){var P=W0N(D);P&&(m={clientName:P.clientName,deviceMake:P.brand,deviceModel:P.model,osVersion:P.osVersion})}g.ch("yt.mdx.remote.remoteClient_",m);Q&&(sCK(D),L0M(D));m=D.C.GH()&&isNaN(D.N);Q==m?Q&&(pQ(D,1),Xm(D,"getSubtitlesTrack")):Q?(D.G5()&&D.S.reset(),pQ(D,1),Xm(D,"getNowPlaying"),tX2(D)):D.H3(1)},bbP=function(D,Q){var m=Q.params.videoId;
delete Q.params.videoId;m==D.S.videoId&&(g.b7(Q.params)?D.S.trackData=null:D.S.trackData=Q.params,D.publish("remotePlayerChange"))},qzK=function(D,Q,m){var P=Q.params.videoId||Q.params.video_id,W=parseInt(Q.params.currentIndex,10);
D.S.listId=Q.params.listId||D.S.listId;HY(D.S,P,W);D.publish("remoteQueueChange",m)},oOv=function(D,Q){Q.params=Q.params||{};
qzK(D,Q,"NOW_PLAYING_MAY_CHANGE");C4U(D,Q);D.publish("autoplayDismissed")},C4U=function(D,Q){var m=parseInt(Q.params.currentTime||Q.params.current_time,10);
Rm(D.S,isNaN(m)?0:m);m=parseInt(Q.params.state,10);m=isNaN(m)?-1:m;m==-1&&D.S.playerState==-1E3&&(m=-1E3);D.S.playerState=m;m=Number(Q.params.loadedTime);D.S.Z=isNaN(m)?0:m;D.S.Pk(Number(Q.params.duration));m=D.S;var P=Number(Q.params.liveIngestionTime);m.S=P;m.B=isNaN(P)?!1:!0;m=D.S;P=Number(Q.params.seekableStartTime);Q=Number(Q.params.seekableEndTime);m.C=isNaN(P)?0:P;m.U=isNaN(Q)?0:Q;D.S.playerState==1?dJ2(D):uzv(D);D.publish("remotePlayerChange")},fl4=function(D,Q){if(D.S.playerState!=-1E3){var m=
1085;
switch(parseInt(Q.params.adState,10)){case 1:m=1081;break;case 2:m=1084;break;case 0:m=1083}D.S.playerState=m;Q=parseInt(Q.params.currentTime,10);Rm(D.S,isNaN(Q)?0:Q);D.publish("remotePlayerChange")}},VXk=function(D,Q){var m=Q.params.muted=="true";
D.S.volume=parseInt(Q.params.volume,10);D.S.muted=m;D.publish("remotePlayerChange")},No4=function(D,Q){D.U=Q.params.videoId;
D.publish("nowAutoplaying",parseInt(Q.params.timeout,10))},yG4=function(D,Q){D.U=Q.params.videoId||null;
D.publish("autoplayUpNext",D.U)},ZbK=function(D,Q){D.J=Q.params.autoplayMode;
D.publish("autoplayModeChange",D.J);D.J=="DISABLED"&&D.publish("autoplayDismissed")},F0V=function(D,Q){var m=Q.params.hasNext=="true";
D.S.j9=Q.params.hasPrevious=="true";D.S.wF=m;D.publish("previousNextChange")},P4V=function(D,Q){Q=Q.message;
Q.params?Ae("Received: action="+Q.action+", params="+g.e6(Q.params)):Ae("Received: action="+Q.action+" {}");switch(Q.action){case "loungeStatus":Q=mT(Q.params.devices);D.T=g.fk(Q,function(P){return new L0(P)});
Q=!!g.y4(D.T,function(P){return P.type=="LOUNGE_SCREEN"});
zzM(D,Q);Q=D.G_("mlm");D.publish("multiStateLoopEnabled",Q);break;case "loungeScreenDisconnected":g.w$(D.T,function(P){return P.type=="LOUNGE_SCREEN"});
zzM(D,!1);break;case "remoteConnected":var m=new L0(mT(Q.params.device));g.y4(D.T,function(P){return P.equals(m)})||Tj4(D.T,m);
break;case "remoteDisconnected":m=new L0(mT(Q.params.device));g.w$(D.T,function(P){return P.equals(m)});
break;case "gracefulDisconnect":break;case "playlistModified":qzK(D,Q,"QUEUE_MODIFIED");break;case "nowPlaying":oOv(D,Q);break;case "onStateChange":C4U(D,Q);break;case "onAdStateChange":fl4(D,Q);break;case "onVolumeChanged":VXk(D,Q);break;case "onSubtitlesTrackChanged":bbP(D,Q);break;case "nowAutoplaying":No4(D,Q);break;case "autoplayDismissed":D.publish("autoplayDismissed");break;case "autoplayUpNext":yG4(D,Q);break;case "onAutoplayModeChanged":ZbK(D,Q);break;case "onHasPreviousNextChanged":F0V(D,
Q);break;case "requestAssistedSignIn":D.publish("assistedSignInRequested",Q.params.authCode);break;case "onLoopModeChanged":D.publish("loopModeChange",Q.params.loopMode);break;default:Ae("Unrecognized action: "+Q.action)}},tX2=function(D){g.bS(D.j);
D.j=g.tl(function(){D.H3(1)},864E5)},Xm=function(D,Q,m){m?Ae("Sending: action="+Q+", params="+g.e6(m)):Ae("Sending: action="+Q);
D.C.sendMessage(Q,m)},ToM=function(D){sp.call(this,"ScreenServiceProxy");
this.VP=D;this.S=[];this.S.push(this.VP.$_s("screenChange",(0,g.d$)(this.xL,this)));this.S.push(this.VP.$_s("onlineScreenChange",(0,g.d$)(this.Yrc,this)))},BoV=function(D,Q){TbQ();
if(!oB||!oB.get("yt-remote-disable-remote-module-for-dev")){Q=g.YK("MDX_CONFIG")||Q;qIU();V02();Sn||(Sn=new Ms(Q?Q.loungeApiHost:void 0),hWT()&&(Sn.S="/api/loungedev"));rZ||(rZ=g.Q4("yt.mdx.remote.deferredProxies_")||[],g.ch("yt.mdx.remote.deferredProxies_",rZ));hz4();var m=Gm();if(!m){var P=new zm(Sn,Q?Q.disableAutomaticScreenCache||!1:!1);g.ch("yt.mdx.remote.screenService_",P);m=Gm();var W={};Q&&(W={appId:Q.appId,disableDial:Q.disableDial,theme:Q.theme,loadCastApiSetupScript:Q.loadCastApiSetupScript,
disableCastApi:Q.disableCastApi,enableDialLoungeToken:Q.enableDialLoungeToken,enableCastLoungeToken:Q.enableCastLoungeToken,forceMirroring:Q.forceMirroring});g.ch("yt.mdx.remote.enableConnectWithInitialState_",Q?Q.enableConnectWithInitialState||!1:!1);vjU(D,P,function(L){L?ME()&&Je(ME(),"YouTube TV"):P.subscribe("onlineScreenChange",function(){f0("yt-remote-receiver-availability-change")})},W)}Q&&!g.Q4("yt.mdx.remote.initialized_")&&(g.ch("yt.mdx.remote.initialized_",!0),cY("Initializing: "+g.e6(Q)),
D6.push(g.cf("yt-remote-cast2-api-ready",function(){f0("yt-remote-api-ready")})),D6.push(g.cf("yt-remote-cast2-availability-change",function(){f0("yt-remote-receiver-availability-change")})),D6.push(g.cf("yt-remote-cast2-receiver-selected",function(){QH(null);
f0("yt-remote-auto-connect","cast-selector-receiver")})),D6.push(g.cf("yt-remote-cast2-receiver-resumed",function(){f0("yt-remote-receiver-resumed","cast-selector-receiver")})),D6.push(g.cf("yt-remote-cast2-session-change",nOV)),D6.push(g.cf("yt-remote-connection-change",function(L){L?Je(ME(),"YouTube TV"):mf()||(Je(null,null),AjV())})),D6.push(g.cf("yt-remote-cast2-session-failed",function(){f0("yt-remote-connection-failed")})),D=EOK(),Q.isAuto&&(D.id+="#dial"),W=Q.capabilities||[],W.length>0&&(D.capabilities=
W),D.name=Q.device,D.app=Q.app,(Q=Q.theme)&&(D.theme=Q),cY(" -- with channel params: "+g.e6(D)),D?(g.wb("yt-remote-session-app",D.app),g.wb("yt-remote-session-name",D.name)):(g.JJ("yt-remote-session-app"),g.JJ("yt-remote-session-name")),g.ch("yt.mdx.remote.channelParams_",D),m.start(),ME()||gO4())}},wik=function(){var D=Gm().VP.$_gos();
var Q=Pn();Q&&Wn()&&(bU2(D,Q)||D.push(Q));return zWN(D)},JGv=function(){var D=kqV();
!D&&wZ()&&ayP()&&(D={key:"cast-selector-receiver",name:ayP()});return D},kqV=function(){var D=wik(),Q=Pn();
Q||(Q=mf());return g.y4(D,function(m){return Q&&dp(Q,m.key)?!0:!1})},Pn=function(){var D=ME();
if(!D)return null;var Q=Gm().JT();return zh(Q,D)},nOV=function(D){cY("remote.onCastSessionChange_: "+tT(D));
if(D){var Q=Pn();if(Q&&Q.id==D.id){if(Je(Q.id,"YouTube TV"),D.idType=="shortLived"&&(D=D.token))i$&&(i$.token=D),(Q=Wn())&&Q.vp(D)}else Q&&sV(),LT(D,1)}else Wn()&&sV()},sV=function(){kM()?BY().stopSession():gZ("stopSession called before API ready.");
var D=Wn();D&&(D.disconnect(1),ll$(null))},Il4=function(){var D=Wn();
return!!D&&D.getProxyState()!=3},cY=function(D){QZ("remote",D)},Gm=function(){if(!RzU){var D=g.Q4("yt.mdx.remote.screenService_");
RzU=D?new ToM(D):null}return RzU},ME=function(){return g.Q4("yt.mdx.remote.currentScreenId_")},UJQ=function(D){g.ch("yt.mdx.remote.currentScreenId_",D)},Hbh=function(){return g.Q4("yt.mdx.remote.connectData_")},QH=function(D){g.ch("yt.mdx.remote.connectData_",D)},Wn=function(){return g.Q4("yt.mdx.remote.connection_")},ll$=function(D){var Q=Wn();
QH(null);D||UJQ("");g.ch("yt.mdx.remote.connection_",D);rZ&&(g.S2(rZ,function(m){m(D)}),rZ.length=0);
Q&&!D?f0("yt-remote-connection-change",!1):!Q&&D&&f0("yt-remote-connection-change",!0)},mf=function(){var D=g.lz();
if(!D)return null;var Q=Gm();if(!Q)return null;Q=Q.JT();return zh(Q,D)},LT=function(D,Q){ME();
Pn()&&Pn();if(u$)i$=D;else{UJQ(D.id);var m=g.Q4("yt.mdx.remote.enableConnectWithInitialState_")||!1;D=new xM(Sn,D,EOK(),m);D.connect(Q,Hbh());D.subscribe("beforeDisconnect",function(P){f0("yt-remote-before-disconnect",P)});
D.subscribe("beforeDispose",function(){Wn()&&(Wn(),ll$(null))});
D.subscribe("browserChannelAuthError",function(){var P=Pn();P&&P.idType=="shortLived"&&(kM()?BY().handleBrowserChannelAuthError():gZ("refreshLoungeToken called before API ready."))});
ll$(D)}},gO4=function(){var D=mf();
D?(cY("Resume connection to: "+tT(D)),LT(D,0)):(C0(),AjV(),cY("Skipping connecting because no session screen found."))},hz4=function(){var D=EOK();
if(g.b7(D)){D=qs();var Q=g.kt("yt-remote-session-name")||"",m=g.kt("yt-remote-session-app")||"";D={device:"REMOTE_CONTROL",id:D,name:Q,app:m,mdxVersion:3};D.authuser=String(g.YK("SESSION_INDEX","0"));(Q=g.YK("DELEGATED_SESSION_ID"))&&(D.pageId=String(Q));g.ch("yt.mdx.remote.channelParams_",D)}},EOK=function(){return g.Q4("yt.mdx.remote.channelParams_")||{}},$JM=function(D,Q,m){g.v.call(this);
var P=this;this.S=D;this.D=Q;this.jJ=m;this.events=new g.gO(this);this.J=!1;this.N=new g.HE(64);this.C=new g.pJ(this.Ha,500,this);this.T=new g.pJ(this.O7,1E3,this);this.Z=new yY(this.h$c,0,this);this.B={};this.j=new g.pJ(this.O6,1E3,this);this.U=new g.rt(this.seekTo,1E3,this);this.TO=this.events.W(this.D,"onVolumeChange",function(W){K0$(P,W)});
g.O(this,this.events);this.events.W(Q,"onCaptionsTrackListChanged",this.koc);this.events.W(Q,"captionschanged",this.fxT);this.events.W(Q,"captionssettingschanged",this.LS);this.events.W(Q,"videoplayerreset",this.gO);this.events.W(Q,"mdxautoplaycancel",function(){P.jJ.yD()});
Q.V("enable_mdx_video_play_directly")&&this.events.W(Q,"videodatachange",function(){jCK(P.S)||dc(P)||tq(P,0)});
D=this.jJ;D.VF();D.subscribe("proxyStateChange",this.m9,this);D.subscribe("remotePlayerChange",this.Mw,this);D.subscribe("remoteQueueChange",this.gO,this);D.subscribe("previousNextChange",this.kq,this);D.subscribe("nowAutoplaying",this.eL,this);D.subscribe("autoplayDismissed",this.gJ,this);g.O(this,this.C);g.O(this,this.T);g.O(this,this.Z);g.O(this,this.j);g.O(this,this.U);this.LS();this.gO();this.Mw()},K0$=function(D,Q){if(dc(D)){D.jJ.unsubscribe("remotePlayerChange",D.Mw,D);
var m=Math.round(Q.volume);Q=!!Q.muted;var P=$M(D.jJ);if(m!==P.volume||Q!==P.muted)D.jJ.setVolume(m,Q),D.j.start();D.jJ.subscribe("remotePlayerChange",D.Mw,D)}},ezU=function(D){D.mu(0);
D.C.stop();D.Bn(new g.HE(64))},vOk=function(D,Q){if(dc(D)&&!D.J){var m=null;
Q&&(m={style:D.D.getSubtitlesUserSettings()},Object.assign(m,Q));D.jJ.Og(D.D.getVideoData(1).videoId,m);D.B=$M(D.jJ).trackData}},tq=function(D,Q){var m=D.D.getPlaylist();
if(m==null?0:m.listId){var P=m.index;var W=m.listId.toString()}m=D.D.getVideoData(1);D.jJ.playVideo(m.videoId,Q,P,W,m.playerParams,m.u0,F6K(m));D.Bn(new g.HE(1))},ObN=function(D,Q){if(Q){var m=D.D.getOption("captions","tracklist",{mC:1});
m&&m.length?(D.D.setOption("captions","track",Q),D.J=!1):(D.D.loadModule("captions"),D.J=!0)}else D.D.setOption("captions","track",{})},dc=function(D){return $M(D.jJ).videoId===D.D.getVideoData(1).videoId},YzQ=function(D,Q){g.x6.call(this,D);
this.S=Q},zU=function(){g.p.call(this,{K:"div",
L:"ytp-mdx-popup-dialog",Y:{role:"dialog"},X:[{K:"div",L:"ytp-mdx-popup-dialog-inner-content",X:[{K:"div",L:"ytp-mdx-popup-title",h0:"You're signed out"},{K:"div",L:"ytp-mdx-popup-description",h0:"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."},{K:"div",L:"ytp-mdx-privacy-popup-buttons",X:[{K:"button",OW:["ytp-button","ytp-mdx-privacy-popup-cancel"],h0:"Cancel"},{K:"button",OW:["ytp-button",
"ytp-mdx-privacy-popup-confirm"],h0:"Confirm"}]}]}]});this.fade=new g.mF(this,250);this.cancelButton=this.Dx("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Dx("ytp-mdx-privacy-popup-confirm");g.O(this,this.fade);this.W(this.cancelButton,"click",this.S);this.W(this.confirmButton,"click",this.C)},b$=function(D){g.p.call(this,{K:"div",
L:"ytp-remote",X:[{K:"div",L:"ytp-remote-display-status",X:[{K:"div",L:"ytp-remote-display-status-icon",X:[g.t0j()]},{K:"div",L:"ytp-remote-display-status-text",h0:"{{statustext}}"}]}]});this.api=D;this.fade=new g.mF(this,250);g.O(this,this.fade);this.W(D,"presentingplayerstatechange",this.onStateChange);this.pM(D.getPlayerStateObject())},q1=function(D,Q){g.jK.call(this,"Play on",1,D,Q);
this.D=D;this.xX={};this.W(D,"onMdxReceiversChange",this.C);this.W(D,"presentingplayerstatechange",this.C);this.C()},alv=function(D){g.nW.call(this,D);
this.bM={key:t0h(),name:"This computer"};this.g3=null;this.subscriptions=[];this.Ei=this.jJ=null;this.xX=[this.bM];this.gh=this.bM;this.fn=new g.HE(64);this.Sq=0;this.Jf=-1;this.Dn=!1;this.Vy=this.KT=this.n$=null;if(!g.zs(this.player.G())&&!g.jY(this.player.G())){D=this.player;var Q=g.jh(D);Q&&(Q=Q.jc())&&(Q=new q1(D,Q),g.O(this,Q));Q=new b$(D);g.O(this,Q);g.Q3(D,Q.element,4);this.n$=new zU;g.O(this,this.n$);g.Q3(D,this.n$.element,4);this.Dn=!!mf()}},CT=function(D){D.KT&&(D.player.removeEventListener("presentingplayerstatechange",
D.KT),D.KT=null)},AGK=function(D,Q,m){D.fn=m;
D.player.publish("presentingplayerstatechange",new g.qW(m,Q))},ok=function(D,Q){if(Q.key!==D.gh.key)if(Q.key===D.bM.key)sV();
else if(jCK(D)&&piP(D),D.gh=Q,!D.player.G().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.jY(D.player.G())){var m=D.player.getPlaylistId();var P=D.player.getVideoData(1);var W=P.videoId;if(!m&&!W||(D.player.getAppState()===2||D.player.getAppState()===1)&&D.player.G().V("should_clear_video_data_on_player_cued_unstarted"))P=null;else{var L=D.player.getPlaylist();if(L){var u=[];for(var t=0;t<L.length;t++)u[t]=g.Fe(L,t).videoId}else u=[W];L=D.player.getCurrentTime(1);D={videoIds:u,listId:m,
videoId:W,playerParams:P.playerParams,clickTrackingParams:P.u0,index:Math.max(D.player.getPlaylistIndex(),0),currentTime:L===0?void 0:L};(P=F6K(P))&&(D.locationInfo=P);P=D}cY("Connecting to: "+g.e6(Q));Q.key=="cast-selector-receiver"?(QH(P||null),Q=P||null,kM()?BY().setLaunchParams(Q):gZ("setLaunchParams called before ready.")):!P&&Il4()&&ME()==Q.key?f0("yt-remote-connection-change",!0):(sV(),QH(P||null),P=Gm().JT(),(Q=zh(P,Q.key))&&LT(Q,1))}},jCK=function(D){var Q=D.player.G();
return!Q.V("mdx_enable_privacy_disclosure_ui")||D.isLoggedIn()||D.Dn||!D.n$?!1:g.EO(Q)||g.wv(Q)},piP=function(D){D.player.getPlayerStateObject().isPlaying()?D.player.pauseVideo():(D.KT=function(Q){!D.Dn&&g.oD(Q,8)&&(D.player.pauseVideo(),CT(D))},D.player.addEventListener("presentingplayerstatechange",D.KT));
D.n$&&D.n$.YJ();Wn()||(u$=!0)};
g.xl.prototype.kW=g.Wh(49,function(){this.app.yy().kW()});
g.MY.prototype.kW=g.Wh(48,function(){this.Vy=null});
g.xl.prototype.FF=g.Wh(47,function(D){this.app.yy().FF(D)});
g.MY.prototype.FF=g.Wh(46,function(D){this.Vy=D});
gyN.prototype.Gi=function(D){this.S.jg("/client_streamz/youtube/living_room/mdx/channel/opened",D)};
Bj2.prototype.Gi=function(D){this.S.jg("/client_streamz/youtube/living_room/mdx/channel/closed",D)};
wdN.prototype.Gi=function(D){this.S.jg("/client_streamz/youtube/living_room/mdx/channel/message_received",D)};
kXP.prototype.Gi=function(){this.S.jg("/client_streamz/youtube/living_room/mdx/channel/success")};
Jl4.prototype.Gi=function(D,Q){this.S.jg("/client_streamz/youtube/living_room/mdx/channel/error",D,Q)};
lGU.prototype.Gi=function(){this.S.jg("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")};
IGU.prototype.Gi=function(){this.S.jg("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")};
g.y=iy.prototype;g.y.Jp=function(){sQ(this);for(var D=[],Q=0;Q<this.S.length;Q++)D.push(this.C[this.S[Q]]);return D};
g.y.G8=function(){sQ(this);return this.S.concat()};
g.y.has=function(D){return Wr(this.C,D)};
g.y.equals=function(D,Q){if(this===D)return!0;if(this.size!=D.size)return!1;Q=Q||HpM;sQ(this);for(var m,P=0;m=this.S[P];P++)if(!Q(this.get(m),D.get(m)))return!1;return!0};
g.y.isEmpty=function(){return this.size==0};
g.y.clear=function(){this.C={};this.Cb=this.size=this.S.length=0};
g.y.remove=function(D){return this.delete(D)};
g.y.delete=function(D){return Wr(this.C,D)?(delete this.C[D],--this.size,this.Cb++,this.S.length>2*this.size&&sQ(this),!0):!1};
g.y.get=function(D,Q){return Wr(this.C,D)?this.C[D]:Q};
g.y.set=function(D,Q){Wr(this.C,D)||(this.size+=1,this.S.push(D),this.Cb++);this.C[D]=Q};
g.y.forEach=function(D,Q){for(var m=this.G8(),P=0;P<m.length;P++){var W=m[P],L=this.get(W);D.call(Q,L,W,this)}};
g.y.clone=function(){return new iy(this)};
g.y.keys=function(){return g.fn(this.d3(!0)).S()};
g.y.values=function(){return g.fn(this.d3(!1)).S()};
g.y.entries=function(){var D=this;return Uvk(this.keys(),function(Q){return[Q,D.get(Q)]})};
g.y.d3=function(D){sQ(this);var Q=0,m=this.Cb,P=this,W=new g.Vj;W.next=function(){if(m!=P.Cb)throw Error("The map has changed since the iterator was created");if(Q>=P.S.length)return g.tS;var L=P.S[Q++];return g.Nd(D?L:P.C[L])};
return W};
var eEQ={mbz:"atp",nux:"ska",LZO:"que",piq:"mus",Kv0:"sus",OFy:"dsp",E5D:"seq",m4q:"mic",zA9:"dpa",P6c:"mlm",kMz:"dsdtr",FFv:"ntb",yl0:"vsp",GMh:"scn",cph:"rpe",wcy:"dcn",xLh:"dcp",n5F:"pas",qYc:"drq",CGO:"opf",YYc:"els",pcc:"isg",jzq:"svq",ajz:"mvp",mJO:"ads",Jly:"stcp",Txh:"sads",UL9:"dloc",mL9:"dcw",AY0:"asw",cYv:"apw",qTc:"pcw",Ij0:"ipv"},vyV={Fv0:"u",j4q:"cl",KFc:"k",AdD:"i",QcO:"cr",Y1D:"m",IZO:"g",ZH:"up"},nTU={Pt:"adPlaying",qn:"onAdStateChange"},ET4={yT9:"nowPlaying",dKO:"onStateChange",
Pt:"adPlaying",qn:"onAdStateChange",xA:"nowPlayingShorts",kA:"onShortsStateChange"},gT4={xA:"nowPlayingShorts",kA:"onShortsStateChange"};L0.prototype.equals=function(D){return D?this.id==D.id:!1};
var f5v="",oB=null;g.Z(ntk,g.eY);var VY,I5k=gt4("loadCastFramework")||gt4("loadCastApplicationFramework"),HUM=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.CV(yY,g.v);g.y=yY.prototype;g.y.SX=function(D){this.B=arguments;this.S=!1;this.Gc?this.T=g.bv()+this.S6:this.Gc=g.HN(this.J,this.S6)};
g.y.stop=function(){this.Gc&&(g.Mu.clearTimeout(this.Gc),this.Gc=null);this.T=null;this.S=!1;this.B=[]};
g.y.pause=function(){++this.C};
g.y.resume=function(){this.C&&(--this.C,!this.C&&this.S&&(this.S=!1,this.N.apply(null,this.B)))};
g.y.Bq=function(){this.stop();yY.Rl.Bq.call(this)};
g.y.C5=function(){this.Gc&&(g.Mu.clearTimeout(this.Gc),this.Gc=null);this.T?(this.Gc=g.HN(this.J,this.T-g.bv()),this.T=null):this.C?this.S=!0:(this.S=!1,this.N.apply(null,this.B))};Zm.prototype.stringify=function(D){return g.Mu.JSON.stringify(D,void 0)};
Zm.prototype.parse=function(D){return g.Mu.JSON.parse(D,void 0)};g.CV(jSP,g.Ab);g.CV($ZV,g.Ab);var eWU=null;g.CV(OUK,g.Ab);g.CV(YIN,g.Ab);g.CV(a5$,g.Ab);n0.prototype.debug=function(){};
n0.prototype.info=function(){};
n0.prototype.warning=function(){};var M0N={},GPV={};g.y=EQ.prototype;g.y.setTimeout=function(D){this.XT=D};
g.y.dD=function(D){D=D.target;var Q=this.Y9;Q&&g.po(D)==3?Q.T1():this.GD(D)};
g.y.GD=function(D){try{if(D==this.S)a:{var Q=g.po(this.S),m=this.S.C,P=this.S.getStatus();if(!(Q<3)&&(Q!=3||this.S&&(this.C.T||g.Xd(this.S)||g.S6(this.S)))){this.wc||Q!=4||m==7||(m==8||P<=0?Fk(3):Fk(2));QWV(this);var W=this.S.getStatus();this.gB=W;var L=rJT(this);if(this.N=W==200){if(this.hU&&!this.k9){b:{if(this.S){var u=g.rW(this.S,"X-HTTP-Initial-Response");if(u&&!g.J6(u)){var t=u;break b}}t=null}if(D=t)this.k9=!0,ta4(this,D);else{this.N=!1;this.J=3;Th(12);Br(this);wp(this);break a}}if(this.t0){D=
!0;for(var z;!this.wc&&this.U<L.length;)if(z=cJP(this,L),z==GPV){Q==4&&(this.J=4,Th(14),D=!1);break}else if(z==M0N){this.J=4;Th(15);D=!1;break}else ta4(this,z);SIP(this)&&this.U!=0&&(this.C.S=this.C.S.slice(this.U),this.U=0);Q!=4||L.length!=0||this.C.T||(this.J=1,Th(16),D=!1);this.N=this.N&&D;D?L.length>0&&!this.Kj&&(this.Kj=!0,this.T.CQ(this)):(Br(this),wp(this))}else ta4(this,L);Q==4&&Br(this);this.N&&!this.wc&&(Q==4?mT4(this.T,this):(this.N=!1,gp(this)))}else g.N0j(this.S),W==400&&L.indexOf("Unknown SID")>
0?(this.J=3,Th(12)):(this.J=0,Th(13)),Br(this),wp(this)}}}catch(b){}finally{}};
g.y.cancel=function(){this.wc=!0;Br(this)};
g.y.Tn=function(){this.TO=null;var D=Date.now();D-this.oy>=0?(this.x9!=2&&(Fk(3),Th(17)),Br(this),this.J=2,wp(this)):DTk(this,this.oy-D)};
g.y.getLastError=function(){return this.J};
g.y.tS=function(){return this.S};brV.prototype.cancel=function(){this.T=C8T(this);if(this.C)this.C.cancel(),this.C=null;else if(this.S&&this.S.size!==0){for(var D=g.T(this.S.values()),Q=D.next();!Q.done;Q=D.next())Q.value.cancel();this.S.clear()}};g.y=NVN.prototype;g.y.XL=8;g.y.CI=1;g.y.connect=function(D,Q,m,P){Th(0);this.PY=D;this.wc=Q||{};m&&P!==void 0&&(this.wc.OSID=m,this.wc.OAID=P);this.k9=this.pj;this.u0=LDP(this,null,this.PY);IB(this)};
g.y.disconnect=function(){Zrh(this);if(this.CI==3){var D=this.GO++,Q=this.u0.clone();g.tN(Q,"SID",this.B);g.tN(Q,"RID",D);g.tN(Q,"TYPE","terminate");Hr(this,Q);D=new EQ(this,this.B,D);D.x9=2;D.Z=Dm(Q.clone());Q=!1;if(g.Mu.navigator&&g.Mu.navigator.sendBeacon)try{Q=g.Mu.navigator.sendBeacon(D.Z.toString(),"")}catch(m){}!Q&&g.Mu.Image&&((new Image).src=D.Z,Q=!0);Q||(D.S=X5K(D.T,null),D.S.send(D.Z));D.Kh=Date.now();gp(D)}gDv(this)};
g.y.TE=function(){return this.CI==0};
g.y.getState=function(){return this.CI};
g.y.Ep=function(D){if(this.N)if(this.N=null,this.CI==1){if(!D){this.GO=Math.floor(Math.random()*1E5);D=this.GO++;var Q=new EQ(this,"",D),m=this.j;this.hU&&(m?(m=g.o2(m),g.VP(m,this.hU)):m=this.hU);this.U!==null||this.oy||(Q.u0=m,m=null);var P;if(this.jD)a:{for(var W=P=0;W<this.T.length;W++){b:{var L=this.T[W];if("__data__"in L.map&&(L=L.map.__data__,typeof L==="string")){L=L.length;break b}L=void 0}if(L===void 0)break;P+=L;if(P>4096){P=W;break a}if(P===4096||W===this.T.length-1){P=W+1;break a}}P=
1E3}else P=1E3;P=hdN(this,Q,P);W=this.u0.clone();g.tN(W,"RID",D);g.tN(W,"CVER",22);this.t0&&g.tN(W,"X-HTTP-Session-Id",this.t0);Hr(this,W);m&&(this.oy?P="headers="+g.gh(g.$86(m))+"&"+P:this.U&&g.CJ(W,this.U,m));sWT(this.C,Q);this.PO&&g.tN(W,"TYPE","init");this.jD?(g.tN(W,"$req",P),g.tN(W,"SID","null"),Q.hU=!0,xZ4(Q,W,null)):xZ4(Q,W,P);this.CI=2}}else this.CI==3&&(D?nD4(this,D):this.T.length==0||q4$(this.C)||nD4(this))};
g.y.MD=function(){this.Z=null;ED4(this);if(this.dn&&!(this.XT||this.S==null||this.kJ<=0)){var D=4*this.kJ;this.QF=hT((0,g.d$)(this.E9O,this),D)}};
g.y.E9O=function(){this.QF&&(this.QF=null,this.k9=!1,this.XT=!0,Th(10),JT(this),ED4(this))};
g.y.CQ=function(D){this.S==D&&this.dn&&!this.XT&&(yk$(this),this.XT=!0,Th(11))};
g.y.Is=function(){this.TO!=null&&(this.TO=null,JT(this),WD4(this),Th(19))};
g.y.lQT=function(D){D?Th(2):Th(1)};
g.y.isActive=function(){return!!this.J&&this.J.isActive(this)};
g.y=wDQ.prototype;g.y.y$=function(){};
g.y.ox=function(){};
g.y.FL=function(){};
g.y.f9=function(){};
g.y.isActive=function(){return!0};
g.y.gD=function(){};g.CV(j_,g.zt);j_.prototype.open=function(){this.S.J=this.T;this.N&&(this.S.x9=!0);this.S.connect(this.J,this.C||void 0)};
j_.prototype.close=function(){this.S.disconnect()};
j_.prototype.send=function(D){var Q=this.S;if(typeof D==="string"){var m={};m.__data__=D;D=m}else this.B&&(m={},m.__data__=g.e6(D),D=m);Q.T.push(new zd2(Q.F2++,D));Q.CI==3&&IB(Q)};
j_.prototype.Bq=function(){this.S.J=null;delete this.T;this.S.disconnect();delete this.S;j_.Rl.Bq.call(this)};
g.CV(Jk4,jSP);g.CV(lHK,$ZV);g.CV(K0,wDQ);K0.prototype.y$=function(){this.S.dispatchEvent("m")};
K0.prototype.ox=function(D){this.S.dispatchEvent(new Jk4(D))};
K0.prototype.FL=function(D){this.S.dispatchEvent(new lHK(D))};
K0.prototype.f9=function(){this.S.dispatchEvent("n")};
IHM.prototype.commit=function(D){this.S.gB=D};var e_=new g.zt;g.Z(UTU,g.Ab);g.y=OQ.prototype;g.y.Kb=null;g.y.Pp=!1;g.y.i8=null;g.y.JV=null;g.y.rp=null;g.y.fg=null;g.y.U0=null;g.y.Eb=null;g.y.Nh=null;g.y.uK=null;g.y.oX=0;g.y.fS=null;g.y.Fx=null;g.y.Dd=null;g.y.kx=-1;g.y.sE=!0;g.y.q9=!1;g.y.Ot=0;g.y.Mi=null;var vDN={},edh={};g.y=OQ.prototype;g.y.setTimeout=function(D){this.C=D};
g.y.BK=function(D){D=D.target;var Q=this.Mi;Q&&g.po(D)==3?Q.T1():this.Sf(D)};
g.y.Sf=function(D){try{if(D==this.uK)a:{var Q=g.po(this.uK),m=this.uK.C,P=this.uK.getStatus();if(g.d9&&!g.$q("420+")){if(Q<4)break a}else if(Q<3||Q==3&&!g.Xd(this.uK))break a;this.q9||Q!=4||m==7||(m==8||P<=0?this.S.ob(3):this.S.ob(2));aH2(this);var W=this.uK.getStatus();this.kx=W;var L=g.Xd(this.uK);if(this.Pp=W==200){Q==4&&Y9(this);if(this.t0){for(D=!0;!this.q9&&this.oX<L.length;){var u=Orv(this,L);if(u==edh){Q==4&&(this.Dd=4,vr(15),D=!1);break}else if(u==vDN){this.Dd=4;vr(16);D=!1;break}else pD4(this,
u)}Q==4&&L.length==0&&(this.Dd=1,vr(17),D=!1);this.Pp=this.Pp&&D;D||(Y9(this),AkV(this))}else pD4(this,L);this.Pp&&!this.q9&&(Q==4?this.S.VE(this):(this.Pp=!1,$TT(this)))}else W==400&&L.indexOf("Unknown SID")>0?(this.Dd=3,vr(13)):(this.Dd=0,vr(14)),Y9(this),AkV(this)}}catch(t){}finally{}};
g.y.cancel=function(){this.q9=!0;Y9(this)};
g.y.h4=function(){this.i8=null;var D=Date.now();D-this.JV>=0?(this.fg!=2&&this.S.ob(3),Y9(this),this.Dd=2,vr(18),AkV(this)):Y44(this,this.JV-D)};
g.y.getLastError=function(){return this.Dd};g.y=S44.prototype;g.y.eG=null;g.y.hT=null;g.y.a9=!1;g.y.wE=null;g.y.fZ=null;g.y.gm=-1;g.y.yc=null;g.y.u4=null;g.y.connect=function(D){this.wE=D;D=AT(this.S,null,this.wE);vr(3);Date.now();var Q=this.S.j;Q!=null?(this.yc=Q[0],(this.u4=Q[1])?(this.fZ=1,rk4(this)):(this.fZ=2,G34(this))):(QY(D,"MODE","init"),this.hT=new OQ(this),this.hT.Kb=this.eG,jWh(this.hT,D,!1,null,!0),this.fZ=0)};
g.y.u3=function(D){if(D)this.fZ=2,G34(this);else{vr(4);var Q=this.S;Q.Hy=Q.dh.gm;S_(Q,9)}D&&this.ob(2)};
g.y.vM=function(D){return this.S.vM(D)};
g.y.abort=function(){this.hT&&(this.hT.cancel(),this.hT=null);this.gm=-1};
g.y.TE=function(){return!1};
g.y.Ce=function(D,Q){this.gm=D.kx;if(this.fZ==0)if(Q){try{var m=this.C.parse(Q)}catch(P){D=this.S;D.Hy=this.gm;S_(D,2);return}this.yc=m[0];this.u4=m[1]}else D=this.S,D.Hy=this.gm,S_(D,2);else this.fZ==2&&(this.a9?(vr(7),Date.now()):Q=="11111"?(vr(6),this.a9=!0,Date.now(),this.gm=200,this.hT.cancel(),vr(12),p0(this.S,this,!0)):(vr(8),Date.now(),this.a9=!1))};
g.y.VE=function(){this.gm=this.hT.kx;if(this.hT.Pp)this.fZ==0?this.u4?(this.fZ=1,rk4(this)):(this.fZ=2,G34(this)):this.fZ==2&&(this.a9?(vr(12),p0(this.S,this,!0)):(vr(11),p0(this.S,this,!1)));else{this.fZ==0?vr(9):this.fZ==2&&vr(10);var D=this.S;this.hT.getLastError();D.Hy=this.gm;S_(D,2)}};
g.y.zp=function(){return this.S.zp()};
g.y.isActive=function(){return this.S.isActive()};
g.y.ob=function(D){this.S.ob(D)};g.y=MaU.prototype;g.y.Ff=null;g.y.L4=null;g.y.uW=null;g.y.n6=null;g.y.Ut=null;g.y.jQ=null;g.y.TL=null;g.y.xe=null;g.y.ma=0;g.y.K5=0;g.y.Tm=null;g.y.aG=null;g.y.hZ=null;g.y.bk=null;g.y.dh=null;g.y.o6=null;g.y.aC=-1;g.y.dA=-1;g.y.Hy=-1;g.y.P5=0;g.y.ZP=0;g.y.tH=8;var xJT={OK:0,ZoT:2,x4F:4,jgT:5,fR9:6,STOP:7,wR:8,lr9:9,cfy:10,Wlh:11,WDy:12};g.CV(DRP,g.Ab);g.CV(QoV,g.Ab);g.y=MaU.prototype;
g.y.connect=function(D,Q,m,P,W){vr(0);this.Ut=Q;this.L4=m||{};P&&W!==void 0&&(this.L4.OSID=P,this.L4.OAID=W);this.Z?($9((0,g.d$)(this.U9,this,D),100),PI4(this)):this.U9(D)};
g.y.disconnect=function(){WV$(this);if(this.S==3){var D=this.ma++,Q=this.jQ.clone();g.tN(Q,"SID",this.B);g.tN(Q,"RID",D);g.tN(Q,"TYPE","terminate");Xk(this,Q);D=new OQ(this,this.B,D);D.fg=2;D.U0=Dm(Q.clone());(new Image).src=D.U0.toString();D.rp=Date.now();$TT(D)}CIP(this)};
g.y.U9=function(D){this.dh=new S44(this);this.dh.eG=this.Ff;this.dh.C=this.J;this.dh.connect(D)};
g.y.TE=function(){return this.S==0};
g.y.getState=function(){return this.S};
g.y.gA=function(D){this.aG=null;dR4(this,D)};
g.y.IV=function(){this.hZ=null;this.n6=new OQ(this,this.B,"rpc",this.U);this.n6.Kb=this.Ff;this.n6.Ot=0;var D=this.TL.clone();g.tN(D,"RID","rpc");g.tN(D,"SID",this.B);g.tN(D,"CI",this.o6?"0":"1");g.tN(D,"AID",this.aC);Xk(this,D);g.tN(D,"TYPE","xmlhttp");jWh(this.n6,D,!0,this.xe,!1)};
g.y.Ce=function(D,Q){if(this.S!=0&&(this.n6==D||this.uW==D))if(this.Hy=D.kx,this.uW==D&&this.S==3)if(this.tH>7){try{var m=this.J.parse(Q)}catch(P){m=null}if(Array.isArray(m)&&m.length==3)if(D=m,D[0]==0)a:{if(!this.hZ){if(this.n6)if(this.n6.rp+3E3<this.uW.rp)x9(this),this.n6.cancel(),this.n6=null;else break a;bRU(this);vr(19)}}else this.dA=D[1],0<this.dA-this.aC&&D[2]<37500&&this.o6&&this.ZP==0&&!this.bk&&(this.bk=$9((0,g.d$)(this.DJ,this),6E3));else S_(this,11)}else Q!="y2f%"&&S_(this,11);else if(this.n6==
D&&x9(this),!g.J6(Q))for(D=this.J.parse(Q),Q=0;Q<D.length;Q++)m=D[Q],this.aC=m[0],m=m[1],this.S==2?m[0]=="c"?(this.B=m[1],this.xe=m[2],m=m[3],m!=null?this.tH=m:this.tH=6,this.S=3,this.Tm&&this.Tm.RV(),this.TL=AT(this,this.zp()?this.xe:null,this.Ut),tIV(this)):m[0]=="stop"&&S_(this,7):this.S==3&&(m[0]=="stop"?S_(this,7):m[0]!="noop"&&this.Tm&&this.Tm.BP(m),this.ZP=0)};
g.y.DJ=function(){this.bk!=null&&(this.bk=null,this.n6.cancel(),this.n6=null,bRU(this),vr(20))};
g.y.VE=function(D){if(this.n6==D){x9(this);this.n6=null;var Q=2}else if(this.uW==D)this.uW=null,Q=1;else return;this.Hy=D.kx;if(this.S!=0)if(D.Pp)if(Q==1){Q=D.Nh?D.Nh.length:0;D=Date.now()-D.rp;var m=e_;m.dispatchEvent(new DRP(m,Q,D,this.P5));mR$(this);this.Tm&&this.Tm.Ke(this,this.T);this.T.length=0}else tIV(this);else{m=D.getLastError();var P;if(!(P=m==3||m==7||m==0&&this.Hy>0)){if(P=Q==1)this.uW||this.aG||this.S==1||this.P5>=2?P=!1:(this.aG=$9((0,g.d$)(this.gA,this,D),zm$(this,this.P5)),this.P5++,
P=!0);P=!(P||Q==2&&bRU(this))}if(P)switch(m){case 1:S_(this,5);break;case 4:S_(this,10);break;case 3:S_(this,6);break;case 7:S_(this,12);break;default:S_(this,2)}}};
g.y.Rs=function(D){if(!g.FK(arguments,this.S))throw Error("Unexpected channel state: "+this.S);};
g.y.WoT=function(D){D?vr(2):(vr(1),qiv(this,8))};
g.y.vM=function(D){if(D)throw Error("Can't create secondary domain capable XhrIo object.");D=new g.Y7;D.U=!1;return D};
g.y.isActive=function(){return!!this.Tm&&this.Tm.isActive(this)};
g.y.ob=function(D){var Q=e_;Q.dispatchEvent(new QoV(Q,D))};
g.y.zp=function(){return!1};
g.y=oT4.prototype;g.y.RV=function(){};
g.y.BP=function(){};
g.y.Ke=function(){};
g.y.hh=function(){};
g.y.qq=function(){};
g.y.D3=function(){return{}};
g.y.isActive=function(){return!0};g.y=fhP.prototype;g.y.enqueue=function(D){this.C.push(D)};
g.y.isEmpty=function(){return this.S.length===0&&this.C.length===0};
g.y.clear=function(){this.S=[];this.C=[]};
g.y.contains=function(D){return g.FK(this.S,D)||g.FK(this.C,D)};
g.y.remove=function(D){var Q=this.S;var m=(0,g.xQU)(Q,D);m>=0?(g.TT(Q,m),Q=!0):Q=!1;return Q||g.hM(this.C,D)};
g.y.Jp=function(){for(var D=[],Q=this.S.length-1;Q>=0;--Q)D.push(this.S[Q]);Q=this.C.length;for(var m=0;m<Q;++m)D.push(this.C[m]);return D};g.Z(VI4,g.Ab);g.Z(Nkh,g.Ab);g.CV(rp,g.v);g.y=rp.prototype;g.y.vB9=function(){this.S6=Math.min(3E5,this.S6*2);this.T();this.C&&this.start()};
g.y.start=function(){var D=this.S6+15E3*Math.random();g.xG(this.S,D);this.C=Date.now()+D};
g.y.stop=function(){this.S.stop();this.C=0};
g.y.isActive=function(){return this.S.isActive()};
g.y.reset=function(){this.S.stop();this.S6=5E3};g.CV(ZRv,oT4);g.y=ZRv.prototype;g.y.subscribe=function(D,Q,m){return this.N.subscribe(D,Q,m)};
g.y.unsubscribe=function(D,Q,m){return this.N.unsubscribe(D,Q,m)};
g.y.Sc=function(D){return this.N.Sc(D)};
g.y.publish=function(D,Q){return this.N.publish.apply(this.N,arguments)};
g.y.dispose=function(){this.U||(this.U=!0,g.Dp(this.N),this.disconnect(),g.Dp(this.C),this.C=null,this.t0=function(){return""},this.u0=function(){return g.k7({})})};
g.y.VF=function(){return this.U};
g.y.connect=function(D,Q,m){var P=this,W,L,u,t;return g.U(function(z){if(z.C==1)return g.n9(z,2),P.J?g.I(z,P.B,2):z.Nv(2);g.Rn(z);if(P.U||P.S&&P.S.getState()==2)return z.return();P.Kh="";P.C.stop();P.j=D||null;P.Z=Q||0;W=P.x9+"/test";L=P.x9+"/bind";u=new MaU(m?m.firstTestResults:null,m?m.secondTestResults:null,P.Kj);if(t=P.S)t.Tm=null;u.Tm=P;P.S=u;if(P.J)return P.B=wfk(P).then(function(){return hmh(P,W,L,t,m)}),z.return(P.B.then(function(){P.B=g.k7()}));
hmh(P,W,L,t,m);return g.Hh(z,0)})};
g.y.disconnect=function(D){try{this.J&&(this.B.cancel(),this.B=g.k7())}finally{this.Iy=D||0,this.C&&this.C.stop(),FV2(this),this.S&&(this.S.getState()==3&&dR4(this.S),this.S.disconnect()),this.Iy=0}};
g.y.sendMessage=function(D,Q){var m=this,P;return g.U(function(W){switch(W.C){case 1:g.n9(W,2);if(!m.J){W.Nv(2);break}return g.I(W,m.B,2);case 2:g.Rn(W);if(m.U)return W.return();P={_sc:D};Q&&g.VP(P,Q);if(m.C.isActive()||(m.S?m.S.getState():0)==2){m.T.push(P);W.Nv(6);break}if(!m.GH()){W.Nv(6);break}g.n9(W,8);if(!m.J||BkU(m,D)){W.Nv(8);break}return g.I(W,wfk(m),8);case 8:g.Rn(W,0,0,1);m.GH()&&(BkU(m,D)||TkU(m),FV2(m),iRP(m.S,P));g.Hh(W,6,1);break;case 6:g.Hh(W,0)}})};
g.y.RV=function(){this.C.reset();this.j=null;this.Z=0;if(this.T.length)if(this.J)JET(this);else{var D=this.T;this.T=[];var Q=D.length;TkU(this);k04(this,D,Q);Gh(this)}else Gh(this)};
g.y.hh=function(D){var Q=D==2&&this.S.Hy==401;D==4||Q||this.C.start();this.publish("handlerError",D,Q);Q=Object.keys(xJT).find(function(m){return xJT[m]===D});
this.Y9.Gi("BROWSER_CHANNEL",Q!=null?Q:"UNKNOWN")};
g.y.qq=function(D,Q){if(!this.C.isActive())this.publish("handlerClosed");else if(Q)for(var m=Q.length,P=0;P<m;++P){var W=Q[P].map;W&&this.T.push(W)}this.k9.Gi("BROWSER_CHANNEL");D&&this.pj.S.rE("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",D.length);Q&&this.dn.S.rE("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",Q.length)};
g.y.Ke=function(D,Q){Q!=null&&D!=null&&this.XT.Gi()};
g.y.D3=function(){var D={v:2};this.Kh&&(D.gsessionid=this.Kh);this.Z!=0&&(D.ui=""+this.Z);this.Iy!=0&&(D.ui=""+this.Iy);this.j&&g.VP(D,this.j);return D};
g.y.BP=function(D){D[0]=="S"?this.Kh=D[1]:D[0]=="gracefulReconnect"?(this.C.start(),this.S.disconnect()):this.publish("handlerMessage",new yEk(D[0],D[1]));this.GO.Gi("BROWSER_CHANNEL")};
g.y.GH=function(){return!!this.S&&this.S.getState()==3};
g.y.vp=function(D){(this.TO.loungeIdToken=D)||this.C.stop();if(this.Lj&&this.S){var Q=this.S.Ff||{};D?Q["X-YouTube-LoungeId-Token"]=D:delete Q["X-YouTube-LoungeId-Token"];this.S.Ff=Q}};
g.y.getDeviceId=function(){return this.TO.id};
g.y.UD=function(){return this.C.isActive()?this.C.C-Date.now():NaN};
g.y.o1=function(){var D=this.C;g.XY(D.S);D.start()};
g.y.aDD=function(){this.C.isActive();soT(this.S)==0&&this.connect(this.j,this.Z)};Ms.prototype.sendRequest=function(D,Q,m,P,W,L,u){D={format:L?"RAW":"JSON",method:D,context:this,timeout:5E3,withCredentials:!!u,onSuccess:g.zT(this.B,P,!L),onError:g.zT(this.T,W),onTimeout:g.zT(this.J,W)};m&&(D.postParams=m,D.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.ZG(Q,D)};
Ms.prototype.B=function(D,Q,m,P){Q?D(P):D({text:m.responseText})};
Ms.prototype.T=function(D,Q){D(Error("Request error: "+Q.status))};
Ms.prototype.J=function(D){D(Error("request timed out"))};g.Z(Rm4,g.zt);g.y=Rm4.prototype;g.y.connect=function(D,Q,m){this.handler.connect(D,Q,m)};
g.y.disconnect=function(D){this.handler.disconnect(D)};
g.y.o1=function(){this.handler.o1()};
g.y.getDeviceId=function(){return this.handler.getDeviceId()};
g.y.UD=function(){return this.handler.UD()};
g.y.GH=function(){return this.handler.GH()};
g.y.n5=function(){this.dispatchEvent("channelOpened");var D=this.handler,Q=this.S;g.wb("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!D.S.o6,sessionId:D.S.B,arrayId:D.S.aC});g.wb("yt-remote-session-screen-id",Q);D=by();Q=qs();g.FK(D,Q)||D.push(Q);otV(D);V02()};
g.y.onClosed=function(){this.dispatchEvent("channelClosed")};
g.y.onMessage=function(D){this.dispatchEvent(new VI4(D))};
g.y.onError=function(D){this.dispatchEvent(new Nkh(D?1:0))};
g.y.sendMessage=function(D,Q){this.handler.sendMessage(D,Q)};
g.y.vp=function(D){this.handler.vp(D)};
g.y.dispose=function(){this.handler.dispose()};g.y=URP.prototype;
g.y.connect=function(D,Q){D=D===void 0?{}:D;Q=Q===void 0?0:Q;this.N!==2&&(this.T.stop(),this.Z=D,this.U=Q,KV4(this),(D=g.YK("ID_TOKEN"))?this.B["x-youtube-identity-token"]=D:delete this.B["x-youtube-identity-token"],this.S&&(this.C.device=this.S.device,this.C.name=this.S.name,this.C.app=this.S.app,this.C.id=this.S.id,this.S.bhx&&(this.C.mdxVersion=""+this.S.bhx),this.S.theme&&(this.C.theme=this.S.theme),this.S.capabilities&&(this.C.capabilities=this.S.capabilities),this.S.Zp&&(this.C.cst=this.S.Zp),
this.S.authuser&&(this.C.authuser=this.S.authuser),this.S.pageId&&(this.C.pageId=this.S.pageId)),this.U!==0?this.C.ui=""+this.U:delete this.C.ui,Object.assign(this.C,this.Z),this.channel=new j_(this.pathPrefix,{QU:"gsessionid",uT0:this.B,J0y:this.C}),this.channel.open(),this.N=2,HR$(this))};
g.y.disconnect=function(D){this.j=D===void 0?0:D;this.T.stop();KV4(this);this.channel&&(this.j!==0?this.C.ui=""+this.j:delete this.C.ui,this.channel.close());this.j=0};
g.y.UD=function(){return this.T.isActive()?this.T.C-Date.now():NaN};
g.y.o1=function(){var D=this.T;g.XY(D.S);D.start()};
g.y.sendMessage=function(D,Q){this.channel&&(KV4(this),D=Object.assign({},{_sc:D},Q),this.channel.send(D))};
g.y.vp=function(D){D||this.T.stop();D?this.B["X-YouTube-LoungeId-Token"]=D:delete this.B["X-YouTube-LoungeId-Token"]};
g.y.getDeviceId=function(){return this.S?this.S.id:""};
g.y.publish=function(D){return this.J.publish.apply(this.J,[D].concat(g.on(g.e$.apply(1,arguments))))};
g.y.subscribe=function(D,Q,m){return this.J.subscribe(D,Q,m)};
g.y.unsubscribe=function(D,Q,m){return this.J.unsubscribe(D,Q,m)};
g.y.Sc=function(D){return this.J.Sc(D)};
g.y.dispose=function(){this.TO||(this.TO=!0,g.Dp(this.J),this.disconnect(),g.Dp(this.T),this.Kh=function(){return""})};
g.y.VF=function(){return this.TO};g.Z(joM,g.zt);g.y=joM.prototype;g.y.connect=function(D,Q){this.S.connect(D,Q)};
g.y.disconnect=function(D){this.S.disconnect(D)};
g.y.o1=function(){this.S.o1()};
g.y.getDeviceId=function(){return this.S.getDeviceId()};
g.y.UD=function(){return this.S.UD()};
g.y.GH=function(){return this.S.N===3};
g.y.NZ=function(){this.dispatchEvent("channelOpened")};
g.y.onClosed=function(){this.dispatchEvent("channelClosed")};
g.y.onMessage=function(D){this.dispatchEvent(new VI4(D))};
g.y.onError=function(){this.dispatchEvent(new Nkh(this.S.al===401?1:0))};
g.y.sendMessage=function(D,Q){this.S.sendMessage(D,Q)};
g.y.vp=function(D){this.S.vp(D)};
g.y.dispose=function(){this.S.dispose()};var pf4=Date.now(),DS=null,WY=Array(50),PY=-1,iW=!1;g.CV(sp,g.iR);sp.prototype.JT=function(){return this.screens};
sp.prototype.contains=function(D){return!!bU2(this.screens,D)};
sp.prototype.get=function(D){return D?zh(this.screens,D):null};
sp.prototype.info=function(D){QZ(this.N,D)};g.Z(rEh,g.iR);g.y=rEh.prototype;g.y.start=function(){!this.S&&isNaN(this.Gc)&&this.Bu()};
g.y.stop=function(){this.S&&(this.S.abort(),this.S=null);isNaN(this.Gc)||(g.bS(this.Gc),this.Gc=NaN)};
g.y.Bq=function(){this.stop();g.iR.prototype.Bq.call(this)};
g.y.Bu=function(){this.Gc=NaN;this.S=g.ZG(cr(this.T,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.U},timeout:5E3,onSuccess:(0,g.d$)(this.Q2,this),onError:(0,g.d$)(this.t4,this),onTimeout:(0,g.d$)(this.HK,this)})};
g.y.Q2=function(D,Q){this.S=null;D=Q.screen||{};D.dialId=this.B;D.name=this.N;Q=-1;this.J&&D.shortLivedLoungeToken&&D.shortLivedLoungeToken.value&&D.shortLivedLoungeToken.refreshIntervalMs&&(D.screenIdType="shortLived",D.loungeToken=D.shortLivedLoungeToken.value,Q=D.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new uy(D),Q)};
g.y.t4=function(D){this.S=null;D.status&&D.status==404?this.C>=XiM.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(D=XiM[this.C],this.Gc=g.tl((0,g.d$)(this.Bu,this),D),this.C++):this.publish("pairingFailed",Error("Server error "+D.status))};
g.y.HK=function(){this.S=null;this.publish("pairingFailed",Error("Server not responding"))};
var XiM=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.CV(uW,sp);g.y=uW.prototype;g.y.start=function(){LQ(this)&&this.publish("screenChange");!g.kt("yt-remote-lounge-token-expiration")&&G04(this);g.bS(this.S);this.S=g.tl((0,g.d$)(this.start,this),1E4)};
g.y.add=function(D,Q){LQ(this);xRh(this,D);dZ(this,!1);this.publish("screenChange");Q(D);D.token||G04(this)};
g.y.remove=function(D,Q){var m=LQ(this);SiK(this,D)&&(dZ(this,!1),m=!0);Q(D);m&&this.publish("screenChange")};
g.y.fL=function(D,Q,m,P){var W=LQ(this),L=this.get(D.id);L?(L.name!=Q&&(L.name=Q,dZ(this,!1),W=!0),m(D)):P(Error("no such local screen."));W&&this.publish("screenChange")};
g.y.Bq=function(){g.bS(this.S);uW.Rl.Bq.call(this)};
g.y.Z4=function(D){LQ(this);var Q=this.screens.length;D=D&&D.screens||[];for(var m=D.length,P=0;P<m;++P){var W=D[P],L=this.get(W.screenId);L&&(L.token=W.loungeToken,--Q)}dZ(this,!Q);Q&&QZ(this.N,"Missed "+Q+" lounge tokens.")};
g.y.ij=function(D){QZ(this.N,"Requesting lounge tokens failed: "+D)};g.Z(cE$,g.iR);g.y=cE$.prototype;g.y.start=function(){var D=parseInt(g.kt("yt-remote-fast-check-period")||"0",10);(this.B=g.bv()-144E5<D?0:D)?te(this):(this.B=g.bv()+3E5,g.wb("yt-remote-fast-check-period",this.B),this.bI())};
g.y.isEmpty=function(){return g.b7(this.S)};
g.y.update=function(){MIv("Updating availability on schedule.");var D=this.N(),Q=g.cP(this.S,function(m,P){return m&&!!zh(D,P)},this);
mF$(this,Q)};
g.y.Bq=function(){g.bS(this.T);this.T=NaN;this.C&&(this.C.abort(),this.C=null);g.iR.prototype.Bq.call(this)};
g.y.bI=function(){g.bS(this.T);this.T=NaN;this.C&&this.C.abort();var D=PEV(this);if(hEh(D)){var Q=cr(this.J,"/pairing/get_screen_availability");this.C=this.J.sendRequest("POST",Q,{lounge_token:g.i7(D).join(",")},(0,g.d$)(this.hHc,this,D),(0,g.d$)(this.gBc,this))}else mF$(this,{}),te(this)};
g.y.hHc=function(D,Q){this.C=null;var m=g.i7(PEV(this));if(g.xk(m,g.i7(D))){Q=Q.screens||[];m={};for(var P=Q.length,W=0;W<P;++W)m[D[Q[W].loungeToken]]=Q[W].status=="online";mF$(this,m);te(this)}else this.eb("Changing Screen set during request."),this.bI()};
g.y.gBc=function(D){this.eb("Screen availability failed: "+D);this.C=null;te(this)};
g.y.eb=function(D){QZ("OnlineScreenService",D)};g.CV(zm,sp);g.y=zm.prototype;g.y.start=function(){this.C.start();this.S.start();this.screens.length&&(this.publish("screenChange"),this.S.isEmpty()||this.publish("onlineScreenChange"))};
g.y.add=function(D,Q,m){this.C.add(D,Q,m)};
g.y.remove=function(D,Q,m){this.C.remove(D,Q,m);this.S.update()};
g.y.fL=function(D,Q,m,P){this.C.contains(D)?this.C.fL(D,Q,m,P):(D="Updating name of unknown screen: "+D.name,QZ(this.N,D),P(Error(D)))};
g.y.JT=function(D){return D?this.screens:g.kk(this.screens,g.g0(this.T,function(Q){return!this.contains(Q)},this))};
g.y.N2=function(){return g.g0(this.JT(!0),function(D){return!!this.S.S[D.id]},this)};
g.y.bN=function(D,Q,m,P,W,L){var u=this;this.info("getDialScreenByPairingCode "+D+" / "+Q);var t=new rEh(this.B,D,Q,m,P);t.subscribe("pairingComplete",function(z,b){g.Dp(t);W(bW(u,z),b)});
t.subscribe("pairingFailed",function(z){g.Dp(t);L(z)});
t.start();return(0,g.d$)(t.stop,t)};
g.y.ue=function(D,Q,m,P){g.ZG(cr(this.B,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:D},timeout:5E3,onSuccess:(0,g.d$)(function(W,L){W=new uy(L.screen||{});if(!W.name||LN4(this,W.name)){a:{L=W.name;for(var u=2,t=Q(L,u);LN4(this,t);){u++;if(u>20)break a;t=Q(L,u)}L=t}W.name=L}m(bW(this,W))},this),
onError:(0,g.d$)(function(W){P(Error("pairing request failed: "+W.status))},this),
onTimeout:(0,g.d$)(function(){P(Error("pairing request timed out."))},this)})};
g.y.Bq=function(){g.Dp(this.C);g.Dp(this.S);zm.Rl.Bq.call(this)};
g.y.oB=function(){dF4(this);this.publish("screenChange");this.S.update()};
zm.prototype.dispose=zm.prototype.dispose;g.CV(qE,g.iR);g.y=qE.prototype;g.y.Z_=function(D){this.VF()||(D&&(om(this,""+D),this.publish("sessionFailed")),this.S=null,this.publish("sessionScreen",null))};
g.y.info=function(D){QZ(this.t0,D)};
g.y.Qm=function(){return null};
g.y.P_=function(D){var Q=this.C;D?(Q.displayStatus=new chrome.cast.ReceiverDisplayStatus(D,[]),Q.displayStatus.showStop=!0):Q.displayStatus=null;chrome.cast.setReceiverDisplayStatus(Q,(0,g.d$)(function(){this.info("Updated receiver status for "+Q.friendlyName+": "+D)},this),(0,g.d$)(function(){om(this,"Failed to update receiver status for: "+Q.friendlyName)},this))};
g.y.Bq=function(){this.P_("");qE.Rl.Bq.call(this)};g.Z(fQ,qE);g.y=fQ.prototype;g.y.iI=function(D){if(this.T){if(this.T==D)return;om(this,"Overriding cast session with new session object");FNv(this);this.Kh=!1;this.j="unknown";this.T.removeUpdateListener(this.Iy);this.T.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.QF)}this.T=D;this.T.addUpdateListener(this.Iy);this.T.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.QF);fy2(this,"getMdxSessionStatus")};
g.y.eU=function(D){this.info("launchWithParams no-op for Cast: "+g.e6(D))};
g.y.stop=function(){this.T?this.T.stop((0,g.d$)(function(){this.Z_()},this),(0,g.d$)(function(){this.Z_(Error("Failed to stop receiver app."))},this)):this.Z_(Error("Stopping cast device without session."))};
g.y.P_=function(){};
g.y.Bq=function(){this.info("disposeInternal");FNv(this);this.T&&(this.T.removeUpdateListener(this.Iy),this.T.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.QF));this.T=null;qE.prototype.Bq.call(this)};
g.y.ADy=function(D,Q){if(!this.VF())if(Q)if(Q=mT(Q),g.iv(Q))switch(D=""+Q.type,Q=Q.data||{},this.info("onYoutubeMessage_: "+D+" "+g.e6(Q)),D){case "mdxSessionStatus":qk$(this,Q);break;case "loungeToken":VFh(this,Q);break;default:om(this,"Unknown youtube message: "+D)}else om(this,"Unable to parse message.");else om(this,"No data in message.")};
g.y.yl=function(D,Q,m,P){g.bS(this.Z);this.Z=0;slk(this.B,this.C.label,D,this.C.friendlyName,(0,g.d$)(function(W){W?Q(W):P>=0?(om(this,"Screen "+D+" appears to be offline. "+P+" retries left."),this.Z=g.tl((0,g.d$)(this.yl,this,D,Q,m,P-1),300)):m(Error("Unable to fetch screen."))},this),m)};
g.y.Qm=function(){return this.T};
g.y.J4=function(D){this.VF()||D||(om(this,"Cast session died."),this.Z_())};g.Z(VZ,qE);g.y=VZ.prototype;g.y.iI=function(D){this.T=D;this.T.addUpdateListener(this.wc)};
g.y.eU=function(D){this.u0=D;this.TO()};
g.y.stop=function(){kcK(this);this.T?this.T.stop((0,g.d$)(this.Z_,this,null),(0,g.d$)(this.Z_,this,"Failed to stop DIAL device.")):this.Z_()};
g.y.Bq=function(){kcK(this);this.T&&this.T.removeUpdateListener(this.wc);this.T=null;qE.prototype.Bq.call(this)};
g.y.vK=function(D){this.VF()||D||(om(this,"DIAL session died."),this.J(),this.J=function(){},this.Z_())};g.Z(ZS,qE);ZS.prototype.stop=function(){this.Z_()};
ZS.prototype.iI=function(){};
ZS.prototype.eU=function(){g.bS(this.T);this.T=NaN;var D=zh(this.B.JT(),this.C.label);D?CQ(this,D):this.Z_(Error("No such screen"))};
ZS.prototype.Bq=function(){g.bS(this.T);this.T=NaN;qE.prototype.Bq.call(this)};g.Z(Fm,g.iR);g.y=Fm.prototype;
g.y.init=function(D,Q){chrome.cast.timeout.requestSession=3E4;var m=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);g.oi("desktop_enable_cast_connect")&&(m.androidReceiverCompatible=!0);this.j||(m.dialRequest=new chrome.cast.DialRequest("YouTube"));var P=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;D=D||this.N?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var W=(0,g.d$)(this.aeT,this);m=new chrome.cast.ApiConfig(m,(0,g.d$)(this.Am,
this),W,P,D);m.customDialLaunchCallback=(0,g.d$)(this.RCD,this);chrome.cast.initialize(m,(0,g.d$)(function(){this.VF()||(chrome.cast.addReceiverActionListener(this.J),Yi4(),this.C.subscribe("onlineScreenChange",(0,g.d$)(this.HP,this)),this.T=IyU(this),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.d$)(function(L){this.eb("Failed to set initial custom receivers: "+g.e6(L))},this)),this.publish("yt-remote-cast2-availability-change",he(this)),Q(!0))},this),(0,g.d$)(function(L){this.eb("Failed to initialize API: "+
g.e6(L));
Q(!1)},this))};
g.y.jFz=function(D,Q){Tm("Setting connected screen ID: "+D+" -> "+Q);if(this.S){var m=this.S.S;if(!D||m&&m.id!=D)Tm("Unsetting old screen status: "+this.S.C.friendlyName),nQ(this,null)}if(D&&Q){if(!this.S){D=zh(this.C.JT(),D);if(!D){Tm("setConnectedScreenStatus: Unknown screen.");return}if(D.idType=="shortLived"){Tm("setConnectedScreenStatus: Screen with id type to be short lived.");return}m=Jjk(this,D);m||(Tm("setConnectedScreenStatus: Connected receiver not custom..."),m=new chrome.cast.Receiver(D.uuid?
D.uuid:D.id,D.name),m.receiverType=chrome.cast.ReceiverType.CUSTOM,this.T.push(m),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.d$)(function(P){this.eb("Failed to set initial custom receivers: "+g.e6(P))},this)));
Tm("setConnectedScreenStatus: new active receiver: "+m.friendlyName);nQ(this,new ZS(this.C,m),!0)}this.S.P_(Q)}else Tm("setConnectedScreenStatus: no screen.")};
g.y.dpF=function(D){this.VF()?this.eb("Setting connection data on disposed cast v2"):this.S?this.S.eU(D):this.eb("Setting connection data without a session")};
g.y.V2=function(){this.VF()?this.eb("Stopping session on disposed cast v2"):this.S?(this.S.stop(),nQ(this,null)):Tm("Stopping non-existing session")};
g.y.requestSession=function(){chrome.cast.requestSession((0,g.d$)(this.Am,this),(0,g.d$)(this.RH0,this))};
g.y.Bq=function(){this.C.unsubscribe("onlineScreenChange",(0,g.d$)(this.HP,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.J);var D=emh,Q=g.Q4("yt.mdx.remote.debug.handlers_");g.hM(Q||[],D);g.Dp(this.S);g.iR.prototype.Bq.call(this)};
g.y.eb=function(D){QZ("Controller",D)};
g.y.lC=function(D,Q){this.S==D&&(Q||nQ(this,null),this.publish("yt-remote-cast2-session-change",Q))};
g.y.iM0=function(D,Q){if(!this.VF())if(D)switch(D.friendlyName=chrome.cast.unescape(D.friendlyName),Tm("onReceiverAction_ "+D.label+" / "+D.friendlyName+"-- "+Q),Q){case chrome.cast.ReceiverAction.CAST:if(this.S)if(this.S.C.label!=D.label)Tm("onReceiverAction_: Stopping active receiver: "+this.S.C.friendlyName),this.S.stop();else{Tm("onReceiverAction_: Casting to active receiver.");this.S.S&&this.publish("yt-remote-cast2-session-change",this.S.S);break}switch(D.receiverType){case chrome.cast.ReceiverType.CUSTOM:nQ(this,
new ZS(this.C,D));break;case chrome.cast.ReceiverType.DIAL:nQ(this,new VZ(this.C,D,this.B,this.config_));break;case chrome.cast.ReceiverType.CAST:nQ(this,new fQ(this.C,D,this.config_));break;default:this.eb("Unknown receiver type: "+D.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.S&&this.S.C.label==D.label?this.S.stop():this.eb("Stopping receiver w/o session: "+D.friendlyName)}else this.eb("onReceiverAction_ called without receiver.")};
g.y.RCD=function(D){if(this.VF())return Promise.reject(Error("disposed"));var Q=D.receiver;Q.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.eb("Not DIAL receiver: "+Q.friendlyName),Q.receiverType=chrome.cast.ReceiverType.DIAL);var m=this.S?this.S.C:null;if(!m||m.label!=Q.label)return this.eb("Receiving DIAL launch request for non-clicked DIAL receiver: "+Q.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(m&&m.label==Q.label&&m.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.S.S)return Tm("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.S.S),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.eb('Changing CAST intent from "'+m.receiverType+'" to "dial" for '+Q.friendlyName);nQ(this,new VZ(this.C,Q,this.B,this.config_))}Q=this.S;Q.Z=D;Q.Z.appState==chrome.cast.DialAppState.RUNNING?(D=Q.Z.extraData||{},m=D.screenId||null,NE(Q)&&D.loungeToken?D.loungeTokenRefreshIntervalMs?D=gjN(Q,{name:Q.C.friendlyName,screenId:D.screenId,loungeToken:D.loungeToken,dialId:Q.Z.receiver.label,
screenIdType:"shortLived"},D.loungeTokenRefreshIntervalMs):(g.p4(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(D)+".")),D=BA2(Q,m)):D=BA2(Q,m)):D=njN(Q);return D};
g.y.Am=function(D){var Q=this;if(!this.VF()&&!this.N){Tm("New cast session ID: "+D.sessionId);var m=D.receiver;if(m.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.S)if(m.receiverType==chrome.cast.ReceiverType.CAST)Tm("Got resumed cast session before resumed mdx connection."),m.friendlyName=chrome.cast.unescape(m.friendlyName),nQ(this,new fQ(this.C,m,this.config_),!0);else{this.eb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var P=this.S.C,W=zh(this.C.JT(),
P.label);W&&dp(W,m.label)&&P.receiverType!=chrome.cast.ReceiverType.CAST&&m.receiverType==chrome.cast.ReceiverType.CAST&&(Tm("onSessionEstablished_: manual to cast session change "+m.friendlyName),g.Dp(this.S),this.S=new fQ(this.C,m,this.config_),this.S.subscribe("sessionScreen",(0,g.d$)(this.lC,this,this.S)),this.S.subscribe("sessionFailed",function(){return lyk(Q,Q.S)}),this.S.eU(null));
this.S.iI(D)}}};
g.y.eX=function(){return this.S?this.S.Qm():null};
g.y.RH0=function(D){this.VF()||(this.eb("Failed to estabilish a session: "+g.e6(D)),D.code!=chrome.cast.ErrorCode.CANCEL&&nQ(this,null),this.publish("yt-remote-cast2-session-failed"))};
g.y.aeT=function(D){Tm("Receiver availability updated: "+D);if(!this.VF()){var Q=he(this);this.U=D==chrome.cast.ReceiverAvailability.AVAILABLE;he(this)!=Q&&this.publish("yt-remote-cast2-availability-change",he(this))}};
g.y.HP=function(){this.VF()||(this.T=IyU(this),Tm("Updating custom receivers: "+g.e6(this.T)),chrome.cast.setCustomReceivers(this.T,function(){},(0,g.d$)(function(){this.eb("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",he(this)))};
Fm.prototype.setLaunchParams=Fm.prototype.dpF;Fm.prototype.setConnectedScreenStatus=Fm.prototype.jFz;Fm.prototype.stopSession=Fm.prototype.V2;Fm.prototype.getCastSession=Fm.prototype.eX;Fm.prototype.requestSession=Fm.prototype.requestSession;Fm.prototype.init=Fm.prototype.init;Fm.prototype.dispose=Fm.prototype.dispose;var SzV=g.f9(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),Ykh=[],eO$=g.G4(SzV);g.y=lW.prototype;
g.y.reset=function(D){this.listId="";this.index=-1;this.videoId="";SkV(this);this.volume=-1;this.muted=!1;D&&(this.index=D.index,this.listId=D.listId,this.videoId=D.videoId,this.playerState=D.playerState,this.volume=D.volume,this.muted=D.muted,this.audioTrackId=D.audioTrackId,this.trackData=D.trackData,this.j9=D.hasPrevious,this.wF=D.hasNext,this.N=D.playerTime,this.J=D.playerTimeAt,this.C=D.seekableStart,this.U=D.seekableEnd,this.T=D.duration,this.Z=D.loadedTime,this.S=D.liveIngestionTime,this.B=
!isNaN(this.S))};
g.y.isPlaying=function(){return this.playerState==1};
g.y.isBuffering=function(){return this.playerState==3};
g.y.Pk=function(D){this.T=isNaN(D)?0:D};
g.y.getDuration=function(){return this.B?this.T+Im(this):this.T};
g.y.clone=function(){return new lW(Gc4(this))};g.Z(jn,g.iR);g.y=jn.prototype;g.y.getState=function(){return this.T};
g.y.UD=function(){return this.B.getReconnectTimeout()};
g.y.o1=function(){this.B.reconnect()};
g.y.play=function(){en(this)?(this.S?this.S.play(null,g.lX,am(this,"play")):YM(this,"play"),DJU(this,1,Up($M(this))),this.publish("remotePlayerChange")):vY(this,this.play)};
g.y.pause=function(){en(this)?(this.S?this.S.pause(null,g.lX,am(this,"pause")):YM(this,"pause"),DJU(this,2,Up($M(this))),this.publish("remotePlayerChange")):vY(this,this.pause)};
g.y.seekTo=function(D){if(en(this)){if(this.S){var Q=$M(this),m=new chrome.cast.media.SeekRequest;m.currentTime=D;Q.isPlaying()||Q.isBuffering()?m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.S.seek(m,g.lX,am(this,"seekTo",{newTime:D}))}else YM(this,"seekTo",{newTime:D});DJU(this,3,D);this.publish("remotePlayerChange")}else vY(this,g.zT(this.seekTo,D))};
g.y.stop=function(){if(en(this)){this.S?this.S.stop(null,g.lX,am(this,"stopVideo")):YM(this,"stopVideo");var D=$M(this);D.index=-1;D.videoId="";SkV(D);Op(this,D);this.publish("remotePlayerChange")}else vY(this,this.stop)};
g.y.setVolume=function(D,Q){if(en(this)){var m=$M(this);if(this.C){if(m.volume!=D){var P=Math.round(D)/100;this.C.setReceiverVolumeLevel(P,(0,g.d$)(function(){mC("set receiver volume: "+P)},this),(0,g.d$)(function(){this.eb("failed to set receiver volume.")},this))}m.muted!=Q&&this.C.setReceiverMuted(Q,(0,g.d$)(function(){mC("set receiver muted: "+Q)},this),(0,g.d$)(function(){this.eb("failed to set receiver muted.")},this))}else{var W={volume:D,
muted:Q};m.volume!=-1&&(W.delta=D-m.volume);YM(this,"setVolume",W)}m.muted=Q;m.volume=D;Op(this,m)}else vY(this,g.zT(this.setVolume,D,Q))};
g.y.Og=function(D,Q){if(en(this)){var m=$M(this);D={videoId:D};Q&&(m.trackData={trackName:Q.name,languageCode:Q.languageCode,sourceLanguageCode:Q.translationLanguage?Q.translationLanguage.languageCode:"",languageName:Q.languageName,kind:Q.kind},D.style=g.e6(Q.style),g.VP(D,m.trackData));YM(this,"setSubtitlesTrack",D);Op(this,m)}else vY(this,g.zT(this.Og,D,Q))};
g.y.setAudioTrack=function(D,Q){en(this)?(Q=Q.getLanguageInfo().getId(),YM(this,"setAudioTrack",{videoId:D,audioTrackId:Q}),D=$M(this),D.audioTrackId=Q,Op(this,D)):vY(this,g.zT(this.setAudioTrack,D,Q))};
g.y.playVideo=function(D,Q,m,P,W,L,u){P=P===void 0?null:P;W=W===void 0?null:W;L=L===void 0?null:L;u=u===void 0?null:u;var t=$M(this),z={videoId:D};m!==void 0&&(z.currentIndex=m);HY(t,D,m||0);Q!==void 0&&(Rm(t,Q),z.currentTime=Q);P&&(z.listId=P);W&&(z.playerParams=W);L&&(z.clickTrackingParams=L);u&&(z.locationInfo=g.e6(u));YM(this,"setPlaylist",z);P||Op(this,t)};
g.y.rO=function(D,Q){if(en(this)){if(D&&Q){var m=$M(this);HY(m,D,Q);Op(this,m)}YM(this,"previous")}else vY(this,g.zT(this.rO,D,Q))};
g.y.nextVideo=function(D,Q){if(en(this)){if(D&&Q){var m=$M(this);HY(m,D,Q);Op(this,m)}YM(this,"next")}else vY(this,g.zT(this.nextVideo,D,Q))};
g.y.iD=function(){if(en(this)){YM(this,"clearPlaylist");var D=$M(this);D.reset();Op(this,D);this.publish("remotePlayerChange")}else vY(this,this.iD)};
g.y.yD=function(){en(this)?YM(this,"dismissAutoplay"):vY(this,this.yD)};
g.y.dispose=function(){if(this.T!=3){var D=this.T;this.T=3;this.publish("proxyStateChange",D,this.T)}g.iR.prototype.dispose.call(this)};
g.y.Bq=function(){cjv(this);this.B=null;this.J.clear();KQ(this,null);g.iR.prototype.Bq.call(this)};
g.y.s8=function(D){if((D!=this.T||D==2)&&this.T!=3&&D!=0){var Q=this.T;this.T=D;this.publish("proxyStateChange",Q,D);if(D==1)for(;!this.J.isEmpty();)Q=D=this.J,Q.S.length===0&&(Q.S=Q.C,Q.S.reverse(),Q.C=[]),D.S.pop().apply(this);else D==3&&this.dispose()}};
g.y.AxD=function(D,Q){this.publish(D,Q)};
g.y.y0T=function(D){if(!D)this.aQ(null),KQ(this,null);else if(this.C.receiver.volume){D=this.C.receiver.volume;var Q=$M(this),m=Math.round(100*D.level||0);if(Q.volume!=m||Q.muted!=D.muted)mC("Cast volume update: "+D.level+(D.muted?" muted":"")),Q.volume=m,Q.muted=!!D.muted,Op(this,Q)}};
g.y.aQ=function(D){mC("Cast media: "+!!D);this.S&&this.S.removeUpdateListener(this.Z);if(this.S=D)this.S.addUpdateListener(this.Z),QCQ(this),this.publish("remotePlayerChange")};
g.y.o9F=function(D){D?(QCQ(this),this.publish("remotePlayerChange")):this.aQ(null)};
g.y.x4=function(){YM(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.y.Src=function(){var D=pqV();D&&KQ(this,D)};
g.y.eb=function(D){QZ("CP",D)};g.Z(xM,g.iR);g.y=xM.prototype;
g.y.connect=function(D,Q){if(Q){var m=Q.listId,P=Q.videoId,W=Q.videoIds,L=Q.playerParams,u=Q.clickTrackingParams,t=Q.index,z={videoId:P},b=Q.currentTime,q=Q.locationInfo;Q=Q.loopMode;b!==void 0&&(z.currentTime=b<=5?0:b);L&&(z.playerParams=L);q&&(z.locationInfo=q);u&&(z.clickTrackingParams=u);m&&(z.listId=m);W&&W.length>0&&(z.videoIds=W.join(","));t!==void 0&&(z.currentIndex=t);this.wc&&(z.loopMode=Q||"LOOP_MODE_OFF");m&&(this.S.listId=m);this.S.videoId=P;this.S.index=t||0;this.S.state=3;Rm(this.S,
b);this.J="UNSUPPORTED";m=this.wc?"setInitialState":"setPlaylist";Ae("Connecting with "+m+" and params: "+g.e6(z));this.C.connect({method:m,params:g.e6(z)},D,NbT())}else Ae("Connecting without params"),this.C.connect({},D,NbT());ib2(this)};
g.y.vp=function(D){this.C.vp(D)};
g.y.dispose=function(){this.VF()||(g.ch("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),pQ(this,3));g.iR.prototype.dispose.call(this)};
g.y.Bq=function(){sCK(this);uzv(this);L0M(this);g.bS(this.Z);this.Z=NaN;g.bS(this.j);this.j=NaN;this.B=null;g.yx(this.TO);this.TO.length=0;this.C.dispose();g.iR.prototype.Bq.call(this);this.J=this.U=this.T=this.S=this.C=null};
g.y.G_=function(D){if(!this.T||this.T.length===0)return!1;for(var Q=g.T(this.T),m=Q.next();!m.done;m=Q.next())if(!m.value.capabilities.has(D))return!1;return!0};
g.y.tR=function(){var D=3;this.VF()||(D=0,isNaN(this.qa())?this.C.GH()&&isNaN(this.N)&&(D=1):D=2);return D};
g.y.H3=function(D){Ae("Disconnecting with "+D);g.ch("yt.mdx.remote.remoteClient_",null);sCK(this);this.publish("beforeDisconnect",D);D==1&&C0();this.C.disconnect(D);this.dispose()};
g.y.Bz=function(){var D=this.S;this.B&&(D=this.S.clone(),HY(D,this.B,D.index));return Gc4(D)};
g.y.h60=function(D){var Q=this,m=new lW(D);m.videoId&&m.videoId!=this.S.videoId&&(this.B=m.videoId,g.bS(this.Z),this.Z=g.tl(function(){if(Q.B){var W=Q.B;Q.B=null;Q.S.videoId!=W&&Xm(Q,"getNowPlaying")}},5E3));
var P=[];this.S.listId==m.listId&&this.S.videoId==m.videoId&&this.S.index==m.index||P.push("remoteQueueChange");this.S.playerState==m.playerState&&this.S.volume==m.volume&&this.S.muted==m.muted&&Up(this.S)==Up(m)&&g.e6(this.S.trackData)==g.e6(m.trackData)||P.push("remotePlayerChange");this.S.reset(D);g.S2(P,function(W){this.publish(W)},this)};
g.y.G5=function(){var D=this.C.getDeviceId(),Q=g.y4(this.T,function(m){return m.type=="REMOTE_CONTROL"&&m.id!=D});
return Q?Q.id:""};
g.y.qa=function(){return this.C.UD()};
g.y.pR=function(){return this.J||"UNSUPPORTED"};
g.y.Y7=function(){return this.U||""};
g.y.wD=function(){!isNaN(this.qa())&&this.C.o1()};
g.y.fDW=function(D,Q){Xm(this,D,Q);tX2(this)};
g.y.uN=function(){var D=g.lS("SAPISID","")||g.lS("__Secure-1PAPISID")||"",Q=g.lS("__Secure-3PAPISID","")||"";if(!D&&!Q)return"";D=g.EG(g.nk(D),2);Q=g.EG(g.nk(Q),2);return g.EG(g.nk(","+D+","+Q),2)};
xM.prototype.subscribe=xM.prototype.subscribe;xM.prototype.unsubscribeByKey=xM.prototype.Sc;xM.prototype.getProxyState=xM.prototype.tR;xM.prototype.disconnect=xM.prototype.H3;xM.prototype.getPlayerContextData=xM.prototype.Bz;xM.prototype.setPlayerContextData=xM.prototype.h60;xM.prototype.getOtherConnectedRemoteId=xM.prototype.G5;xM.prototype.getReconnectTimeout=xM.prototype.qa;xM.prototype.getAutoplayMode=xM.prototype.pR;xM.prototype.getAutoplayVideoId=xM.prototype.Y7;xM.prototype.reconnect=xM.prototype.wD;
xM.prototype.sendMessage=xM.prototype.fDW;xM.prototype.getXsrfToken=xM.prototype.uN;xM.prototype.isCapabilitySupportedOnConnectedDevices=xM.prototype.G_;g.Z(ToM,sp);g.y=ToM.prototype;g.y.JT=function(D){return this.VP.$_gs(D)};
g.y.contains=function(D){return!!this.VP.$_c(D)};
g.y.get=function(D){return this.VP.$_g(D)};
g.y.start=function(){this.VP.$_st()};
g.y.add=function(D,Q,m){this.VP.$_a(D,Q,m)};
g.y.remove=function(D,Q,m){this.VP.$_r(D,Q,m)};
g.y.fL=function(D,Q,m,P){this.VP.$_un(D,Q,m,P)};
g.y.Bq=function(){for(var D=this.S.length,Q=0;Q<D;++Q)this.VP.$_ubk(this.S[Q]);this.S.length=0;this.VP=null;sp.prototype.Bq.call(this)};
g.y.xL=function(){this.publish("screenChange")};
g.y.Yrc=function(){this.publish("onlineScreenChange")};
zm.prototype.$_st=zm.prototype.start;zm.prototype.$_gspc=zm.prototype.ue;zm.prototype.$_gsppc=zm.prototype.bN;zm.prototype.$_c=zm.prototype.contains;zm.prototype.$_g=zm.prototype.get;zm.prototype.$_a=zm.prototype.add;zm.prototype.$_un=zm.prototype.fL;zm.prototype.$_r=zm.prototype.remove;zm.prototype.$_gs=zm.prototype.JT;zm.prototype.$_gos=zm.prototype.N2;zm.prototype.$_s=zm.prototype.subscribe;zm.prototype.$_ubk=zm.prototype.Sc;var i$=null,u$=!1,Sn=null,rZ=null,RzU=null,D6=[];g.Z($JM,g.v);g.y=$JM.prototype;g.y.Bq=function(){g.v.prototype.Bq.call(this);this.C.stop();this.T.stop();this.Z.stop();var D=this.jJ;D.unsubscribe("proxyStateChange",this.m9,this);D.unsubscribe("remotePlayerChange",this.Mw,this);D.unsubscribe("remoteQueueChange",this.gO,this);D.unsubscribe("previousNextChange",this.kq,this);D.unsubscribe("nowAutoplaying",this.eL,this);D.unsubscribe("autoplayDismissed",this.gJ,this);this.jJ=this.S=null};
g.y.xN=function(D){var Q=g.e$.apply(1,arguments);if(this.jJ.T!=2)if(dc(this)){if($M(this.jJ).playerState!=1081||D!=="control_seek")switch(D){case "control_toggle_play_pause":$M(this.jJ).isPlaying()?this.jJ.pause():this.jJ.play();break;case "control_play":this.jJ.play();break;case "control_pause":this.jJ.pause();break;case "control_seek":this.U.T1(Q[0],Q[1]);break;case "control_subtitles_set_track":vOk(this,Q[0]);break;case "control_set_audio_track":this.setAudioTrack(Q[0])}}else switch(D){case "control_toggle_play_pause":case "control_play":case "control_pause":Q=
this.D.getCurrentTime();tq(this,Q===0?void 0:Q);break;case "control_seek":tq(this,Q[0]);break;case "control_subtitles_set_track":vOk(this,Q[0]);break;case "control_set_audio_track":this.setAudioTrack(Q[0])}};
g.y.fxT=function(D){this.Z.SX(D)};
g.y.h$c=function(D){this.xN("control_subtitles_set_track",g.b7(D)?null:D)};
g.y.LS=function(){var D=this.D.getOption("captions","track");g.b7(D)||vOk(this,D)};
g.y.mu=function(D){this.S.mu(D,this.D.getVideoData().lengthSeconds)};
g.y.koc=function(){g.b7(this.B)||ObN(this,this.B);this.J=!1};
g.y.m9=function(D,Q){this.T.stop();Q===2&&this.O7()};
g.y.Mw=function(){if(dc(this)){this.C.stop();var D=$M(this.jJ);switch(D.playerState){case 1080:case 1081:case 1084:case 1085:this.S.Jf=1;break;case 1082:case 1083:this.S.Jf=0;break;default:this.S.Jf=-1}switch(D.playerState){case 1081:case 1:this.Bn(new g.HE(8));this.Ha();break;case 1085:case 3:this.Bn(new g.HE(9));break;case 1083:case 0:this.Bn(new g.HE(2));this.U.stop();this.mu(this.D.getVideoData().lengthSeconds);break;case 1084:this.Bn(new g.HE(4));break;case 2:this.Bn(new g.HE(4));this.mu(Up(D));
break;case -1:this.Bn(new g.HE(64));break;case -1E3:this.Bn(new g.HE(128,{errorCode:"mdx.remoteerror",errorMessage:"This video is not available for remote playback.",Wl:2}))}D=$M(this.jJ).trackData;var Q=this.B;(D||Q?D&&Q&&D.trackName==Q.trackName&&D.languageCode==Q.languageCode&&D.languageName==Q.languageName&&D.kind==Q.kind:1)||(this.B=D,ObN(this,D));D=$M(this.jJ);D.volume===-1||Math.round(this.D.getVolume())===D.volume&&this.D.isMuted()===D.muted||this.j.isActive()||this.O6()}else ezU(this)};
g.y.kq=function(){this.D.publish("mdxpreviousnextchange")};
g.y.gO=function(){dc(this)||ezU(this)};
g.y.eL=function(D){isNaN(D)||this.D.publish("mdxnowautoplaying",D)};
g.y.gJ=function(){this.D.publish("mdxautoplaycanceled")};
g.y.setAudioTrack=function(D){dc(this)&&this.jJ.setAudioTrack(this.D.getVideoData(1).videoId,D)};
g.y.seekTo=function(D,Q){$M(this.jJ).playerState===-1?tq(this,D):Q&&this.jJ.seekTo(D)};
g.y.O6=function(){var D=this;if(dc(this)){var Q=$M(this.jJ);this.events.qY(this.TO);Q.muted?this.D.mute():this.D.unMute();this.D.setVolume(Q.volume);this.TO=this.events.W(this.D,"onVolumeChange",function(m){K0$(D,m)})}};
g.y.Ha=function(){this.C.stop();if(!this.jJ.VF()){var D=$M(this.jJ);D.isPlaying()&&this.Bn(new g.HE(8));this.mu(Up(D));this.C.start()}};
g.y.O7=function(){this.T.stop();this.C.stop();var D=this.jJ.UD();this.jJ.T==2&&!isNaN(D)&&this.T.start()};
g.y.Bn=function(D){this.T.stop();var Q=this.N;if(!g.Os(Q,D)){var m=g.X(D,2);m!==g.X(this.N,2)&&this.D.L$(m);this.N=D;AGK(this.S,Q,D)}};g.Z(YzQ,g.x6);g.y=YzQ.prototype;g.y.getCurrentTime=function(){return this.S.getCurrentTime()};
g.y.getDuration=function(){return this.S.getDuration()};
g.y.hD=function(){return this.S.hD()};
g.y.vF=function(){return this.S.vF()};
g.y.qL=function(){return this.S.qL()};
g.y.eh=function(){return this.S.eh()};
g.y.getPlayerState=function(){return this.S.fn};
g.y.isAtLiveHead=function(){return this.S.isAtLiveHead()};
g.y.pauseVideo=function(){this.S.Yk("control_pause")};
g.y.playVideo=function(){var D=this;return g.U(function(Q){D.S.Yk("control_play");return Q.return()})};
g.y.seekTo=function(D,Q){this.S.Yk("control_seek",D,!(Q==null?0:Q.EP))};
g.y.v5=function(D){this.S.Yk("control_set_audio_track",D);return!0};g.Z(zU,g.p);zU.prototype.YJ=function(){this.fade.show()};
zU.prototype.eJ=function(){this.fade.hide()};
zU.prototype.S=function(){f0("mdx-privacy-popup-cancel");this.eJ()};
zU.prototype.C=function(){f0("mdx-privacy-popup-confirm");this.eJ()};g.Z(b$,g.p);b$.prototype.onStateChange=function(D){this.pM(D.state)};
b$.prototype.pM=function(D){if(this.api.getPresentingPlayerType()===3){var Q={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};D=g.X(D,128)?g.LZ("Error on $RECEIVER_NAME",Q):D.isPlaying()||D.isPaused()?g.LZ("Playing on $RECEIVER_NAME",Q):g.LZ("Connected to $RECEIVER_NAME",Q);this.updateValue("statustext",D);this.fade.show()}else this.fade.hide()};g.Z(q1,g.jK);q1.prototype.C=function(){var D=this.D.getOption("remote","receivers");D&&D.length>1&&!this.D.getOption("remote","quickCast")?(this.xX=g.r$(D,this.S,this),this.Rg(g.fk(D,this.S)),D=this.D.getOption("remote","currentReceiver"),D=this.S(D),this.options[D]&&this.I4(D),this.enable(!0)):this.enable(!1)};
q1.prototype.S=function(D){return D.key};
q1.prototype.BF=function(D){return D==="cast-selector-receiver"?"Cast...":this.xX[D].name};
q1.prototype.NJ=function(D){g.jK.prototype.NJ.call(this,D);this.D.setOption("remote","currentReceiver",this.xX[D]);this.Cj.eJ()};g.Z(alv,g.nW);g.y=alv.prototype;
g.y.create=function(){var D=this.player.G(),Q=g.tf(D);D={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:D.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:D.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:D.V("enable_cast_short_lived_lounge_token")};BoV(Q,D);this.subscriptions.push(g.cf("yt-remote-before-disconnect",this.MDF,this));this.subscriptions.push(g.cf("yt-remote-connection-change",this.pn0,this));this.subscriptions.push(g.cf("yt-remote-receiver-availability-change",this.Ll,
this));this.subscriptions.push(g.cf("yt-remote-auto-connect",this.PEh,this));this.subscriptions.push(g.cf("yt-remote-receiver-resumed",this.ZMF,this));this.subscriptions.push(g.cf("mdx-privacy-popup-confirm",this.KOq,this));this.subscriptions.push(g.cf("mdx-privacy-popup-cancel",this.RmF,this));this.Ll()};
g.y.load=function(){this.player.cancelPlayback();g.nW.prototype.load.call(this);this.Vy=new YzQ(this.player.G(),this);this.player.FF(this.Vy);this.g3=new $JM(this,this.player,this.jJ);var D=(D=Hbh())?D.currentTime:0;var Q=Il4()?new jn(Wn(),void 0):null;D==0&&Q&&(D=Up($M(Q)));D!==0&&this.mu(D);AGK(this,this.fn,this.fn);this.player.Ar(6)};
g.y.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.kW();this.gh=this.bM;g.Qj(this.g3,this.jJ);this.jJ=this.Vy=this.g3=null;g.nW.prototype.unload.call(this);this.player.Ar(5);CT(this)};
g.y.Bq=function(){g.Dy(this.subscriptions);g.nW.prototype.Bq.call(this)};
g.y.Yk=function(D){var Q=g.e$.apply(1,arguments);this.loaded&&this.g3.xN.apply(this.g3,[D].concat(g.on(Q)))};
g.y.getAdState=function(){return this.Jf};
g.y.j9=function(){return this.jJ?$M(this.jJ).j9:!1};
g.y.wF=function(){return this.jJ?$M(this.jJ).wF:!1};
g.y.mu=function(D,Q){this.Sq=D||0;this.player.publish("progresssync",D,Q);this.player.Q0("onVideoProgress",D||0)};
g.y.getCurrentTime=function(){return this.Sq};
g.y.getDuration=function(){return $M(this.jJ).getDuration()||0};
g.y.hD=function(){var D=$M(this.jJ);return D.B?D.S+Im(D):D.S};
g.y.vF=function(){return $M(this.jJ).Z};
g.y.qL=function(){return rj4($M(this.jJ))};
g.y.eh=function(){var D=$M(this.jJ);return D.C>0?D.C+Im(D):D.C};
g.y.getProgressState=function(){var D=$M(this.jJ),Q=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:D.playerState!=1081&&this.player.I_(),clipEnd:Q.clipEnd,clipStart:Q.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.hD(),isAtLiveHead:this.isAtLiveHead(),loaded:this.vF(),seekableEnd:this.qL(),seekableStart:this.eh(),offset:0,viewerLivestreamJoinMediaTime:0}};
g.y.isAtLiveHead=function(){return rj4($M(this.jJ))-this.getCurrentTime()<=1};
g.y.nextVideo=function(){this.jJ&&this.jJ.nextVideo()};
g.y.rO=function(){this.jJ&&this.jJ.rO()};
g.y.MDF=function(D){D===1&&(this.Ei=this.jJ?$M(this.jJ):null)};
g.y.pn0=function(){var D=Il4()?new jn(Wn(),void 0):null;if(D){var Q=this.gh;this.loaded&&this.unload();this.jJ=D;this.Ei=null;Q.key!==this.bM.key&&(this.gh=Q,this.load())}else g.Dp(this.jJ),this.jJ=null,this.loaded&&(this.unload(),(D=this.Ei)&&D.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(D.videoId,Up(D)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
g.y.Ll=function(){var D=[this.bM],Q=D.concat,m=wik();wZ()&&g.kt("yt-remote-cast-available")&&m.push({key:"cast-selector-receiver",name:"Cast..."});this.xX=Q.call(D,m);D=JGv()||this.bM;ok(this,D);this.player.Q0("onMdxReceiversChange")};
g.y.PEh=function(){var D=JGv();ok(this,D)};
g.y.ZMF=function(){this.gh=JGv()};
g.y.KOq=function(){this.Dn=!0;CT(this);u$=!1;i$&&LT(i$,1);i$=null};
g.y.RmF=function(){this.Dn=!1;CT(this);ok(this,this.bM);this.gh=this.bM;u$=!1;i$=null;this.player.playVideo()};
g.y.hf=function(D,Q){switch(D){case "casting":return this.loaded;case "receivers":return this.xX;case "currentReceiver":return Q&&(Q.key==="cast-selector-receiver"?xFv():ok(this,Q)),this.loaded?this.gh:this.bM;case "quickCast":return this.xX.length===2&&this.xX[1].key==="cast-selector-receiver"?(Q&&xFv(),!0):!1}};
g.y.x4=function(){this.jJ.x4()};
g.y.po=function(){return!1};
g.y.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
g.y.isLoggedIn=function(){var D,Q;return((D=g.YK("PLAYER_CONFIG"))==null?void 0:(Q=D.args)==null?void 0:Q.authuser)!==void 0?!0:!(!g.YK("SESSION_INDEX")&&!g.YK("LOGGED_IN"))};g.hD("remote",alv);})(_yt_player);
