(function(g){var window=this;'use strict';var bO=function(v){g.Un(v,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.$X()).toString(36));return v},jF=function(v,J,G){Array.isArray(G)||(G=[String(G)]); g.NAs(v.L,J,G)},U4U=function(v){if(v instanceof g.K9)return v; if(typeof v.zg=="function")return v.zg(!1);if(g.HF(v)){var J=0,G=new g.K9;G.next=function(){for(;;){if(J>=v.length)return g.Jl;if(J in v)return g.VP(v[J++]);J++}}; return G}throw Error("Not implemented");},x4Y=function(v,J,G){if(g.HF(v))g.PW(v,J,G); else for(v=U4U(v);;){var K=v.next();if(K.done)break;J.call(G,K.value,void 0,v)}},m4N=function(v,J){var G=[]; x4Y(J,function(K){try{var V=g.U3.prototype.X.call(this,K,!0)}catch(Y){if(Y=="Storage: Invalid value was encountered")return;throw Y;}V===void 0?G.push(K):g.FjB(V)&&G.push(K)},v); return G},SE8=function(v,J){m4N(v,J).forEach(function(G){g.U3.prototype.remove.call(this,G)},v)},fmU=function(v){if(v.oY){if(v.oY.locationOverrideToken)return{locationOverrideToken:v.oY.locationOverrideToken}; if(v.oY.latitudeE7!=null&&v.oY.longitudeE7!=null)return{latitudeE7:v.oY.latitudeE7,longitudeE7:v.oY.longitudeE7}}return null},Z4U=function(v,J){g.WN(v,J)||v.push(J)},u4A=function(v){var J=0,G; for(G in v)J++;return J},g58=function(v,J){return g.uA(v,J)},X$X=function(v){try{return g.X2.JSON.parse(v)}catch(J){}v=String(v); if(/^\s*$/.test(v)?0:/^[\],:{}\s\u2028\u2029]*$/.test(v.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("("+v+")")}catch(J){}throw Error("Invalid JSON string: "+v);},iY=function(v){if(g.X2.JSON)try{return g.X2.JSON.parse(v)}catch(J){}return X$X(v)},kmY=function(v){if(v.uj&&typeof v.uj=="function")return v.uj(); if(typeof Map!=="undefined"&&v instanceof Map||typeof Set!=="undefined"&&v instanceof Set)return Array.from(v.values());if(typeof v==="string")return v.split("");if(g.HF(v)){for(var J=[],G=v.length,K=0;K1){if(G%2)throw Error("Uneven number of arguments");for(var K=0;K5&&(v=v.slice(v.length-5)); var J=g.yn(ZE_(),function(K){return K.loungeToken}),G=g.yn(v,function(K){return K.loungeToken}); g.wn(G,function(K){return!g.WN(J,K)})&&uXA(); g.SW("yt-remote-local-screens",v,31536E3)},eF=function(v){v||(g.Zg("yt-remote-session-screen-id"),g.Zg("yt-remote-session-video-id")); Si8();v=qt();g.j5(v,Es());xAo(v)},Xym=function(){if(!P3){var v=g.u6(); v&&(P3=new g.yj(v))}},keU=function(){Xym(); return P3?!!P3.get("yt-remote-use-staging-server"):!1},DV=function(v,J){g.GI[v]=!0; var G=g.vo();G&&G.publish.apply(G,arguments);g.GI[v]=!1},cho=function(){},$9=function(){if(!tg){tg=new g.kb(new cho); var v=g.si("client_streamz_web_flush_count",-1);v!==-1&&(tg.Z=v)}return tg},NxU=function(){var v=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return v?parseInt(v[1],10):0},a8X=function(v){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+v)!=-1||document.currentScript.src.indexOf("&"+v)!=-1)},AhY=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},B3=function(v){v.length?Fa6(v.shift(),function(){B3(v)}):HEY()},Mk6=function(v){return"chrome-extension://"+v+"/cast_sender.js"},Fa6=function(v,J,G){var K=document.createElement("script"); K.onerror=J;G&&(K.onload=G);g.jK(K,g.Tm(v));(document.head||document.documentElement).appendChild(K)},QSU=function(){var v=NxU(),J=[]; if(v>1){var G=v-1;J.push("//www.gstatic.com/eureka/clank/"+v+"/cast_sender.js");J.push("//www.gstatic.com/eureka/clank/"+G+"/cast_sender.js")}return J},HEY=function(){var v=AhY(); v&&v(!1,"No cast extension found")},CRo=function(){if(Wa8){var v=2,J=AhY(),G=function(){v--; v==0&&J&&J(!0)}; window.__onGCastApiAvailable=G;Fa6("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",HEY,G)}},bE_=function(){CRo(); var v=QSU();v.push("//www.gstatic.com/eureka/clank/cast_sender.js");B3(v)},iqG=function(){CRo(); var v=QSU();v.push.apply(v,g.l(jPL.map(Mk6)));v.push("//www.gstatic.com/eureka/clank/cast_sender.js");B3(v)},IH=function(v,J,G){g.X.call(this); this.j=G!=null?(0,g.bj)(v,G):v;this.LZ=J;this.J=(0,g.bj)(this.q4,this);this.T=!1;this.X=0;this.Z=this.PO=null;this.L=[]},hg=function(){},$kA=function(){g.FM.call(this,"p")},vLF=function(){g.FM.call(this,"o")},GZU=function(){return JDm=JDm||new g.EF},oLL=function(v){g.FM.call(this,"serverreachability",v)},zr=function(v){var J=GZU(); J.dispatchEvent(new oLL(J,v))},Km_=function(v){g.FM.call(this,"statevent",v)},ng=function(v){var J=GZU(); J.dispatchEvent(new Km_(J,v))},VWU=function(v,J,G,K){g.FM.call(this,"timingevent",v); this.size=J;this.rtt=G;this.retries=K},db=function(v,J){if(typeof v!=="function")throw Error("Fn must not be null and must be a function"); return g.X2.setTimeout(function(){v()},J)},RH=function(){},lY=function(v,J,G,K){this.Z=v; this.L=J;this.R$=G;this.UR=K||1;this.wh=new g.ZZ(this);this.WH=45E3;this.YB=null;this.j=!1;this.N=this.xB=this.U=this.jl=this.dh=this.Nr=this.oY=null;this.Ti=[];this.T=null;this.K=0;this.J=this.Ze=null;this.o$=-1;this.qr=!1;this.BH=0;this.RY=null;this.g_=this.Gi=this.d_=this.Mr=!1;this.X=new Y9F},Y9F=function(){this.Z=null; this.T="";this.X=!1},q9_=function(v,J,G){v.jl=1; v.U=bO(J.clone());v.N=G;v.Mr=!0;rDN(v,null)},rDN=function(v,J){v.dh=Date.now(); Tr(v);v.xB=v.U.clone();jF(v.xB,"t",v.UR);v.K=0;var G=v.Z.jl;v.X=new Y9F;v.T=EL8(v.Z,G?J:null,!v.N);v.BH>0&&(v.RY=new g.jj((0,g.bj)(v.Ol,v,v.T),v.BH));v.wh.listen(v.T,"readystatechange",v.Fr);J=v.YB?g.Ni(v.YB):{};v.N?(v.Ze||(v.Ze="POST"),J["Content-Type"]="application/x-www-form-urlencoded",v.T.send(v.xB,v.Ze,v.N,J)):(v.Ze="GET",v.T.send(v.xB,v.Ze,null,J));zr(1)},P$L=function(v){if(!eOT(v))return g.EZ(v.T); var J=g.e7(v.T);if(J==="")return"";var G="",K=J.length,V=g.r5(v.T)==4;if(!v.X.Z){if(typeof TextDecoder==="undefined")return pg(v),Lg(v),"";v.X.Z=new g.X2.TextDecoder}for(var Y=0;YJ.length)return DkN;J=J.slice(K,K+G);v.K=K+G;return J},Tr=function(v){v.Nr=Date.now()+v.WH; Ig_(v,v.WH)},Ig_=function(v,J){if(v.oY!=null)throw Error("WatchDog timer not null"); v.oY=db((0,g.bj)(v.SI,v),J)},hOG=function(v){v.oY&&(g.X2.clearTimeout(v.oY),v.oY=null)},Lg=function(v){v.Z.v8()||v.qr||zO8(v.Z,v)},pg=function(v){hOG(v); g.rT(v.RY);v.RY=null;v.wh.removeAll();if(v.T){var J=v.T;v.T=null;J.abort();J.dispose()}},Lm6=function(v,J){try{var G=v.Z; if(G.YP!=0&&(G.T==v||nLo(G.X,v)))if(!v.Gi&&nLo(G.X,v)&&G.YP==3){try{var K=G.G4.T.parse(J)}catch(R){K=null}if(Array.isArray(K)&&K.length==3){var V=K;if(V[0]==0)a:{if(!G.U){if(G.T)if(G.T.dh+3E30&&(G.BH=1.5*E);K=G;var e=v.FN();if(e){var P=g.Pt(e,"X-Client-Wire-Protocol");if(P){var D=K.X;!D.T&&(g.lU(P,"spdy")||g.lU(P,"quic")||g.lU(P,"h2"))&&(D.L=D.J,D.T=new Set,D.X&&(RO_(D,D.X),D.X=null))}if(K.Mr){var t=g.Pt(e,"X-HTTP-Session-Id");t&&(K.Mj=t,g.Un(K.YB,K.Mr,t))}}G.YP=3;G.J&&G.J.wY();G.a$&&(G.yy=Date.now()-v.dh);K=G;var B=v;K.BO=lgA(K,K.jl?K.UR:null,K.R$);if(B.Gi){TsG(K.X, B);var I=B,h=K.BH;h&&I.setTimeout(h);I.oY&&(hOG(I),Tr(I));K.T=B}else p88(K);G.Z.length>0&&Us(G)}else Y[0]!="stop"&&Y[0]!="close"||Os(G,7);else G.YP==3&&(Y[0]=="stop"||Y[0]=="close"?Y[0]=="stop"?Os(G,7):G.disconnect():Y[0]!="noop"&&G.J&&G.J.Nv(Y),G.Ti=0)}zr(4)}catch(R){}},yDG=function(v,J){this.T=v; this.map=J;this.context=null},w8L=function(v){this.J=v||10; g.X2.PerformanceNavigationTiming?(v=g.X2.performance.getEntriesByType("navigation"),v=v.length>0&&(v[0].nextHopProtocol=="hq"||v[0].nextHopProtocol=="h2")):v=!!(g.X2.chrome&&g.X2.chrome.loadTimes&&g.X2.chrome.loadTimes()&&g.X2.chrome.loadTimes().wasFetchedViaSpdy);this.L=v?this.J:1;this.T=null;this.L>1&&(this.T=new Set);this.X=null;this.Z=[]},OqU=function(v){return v.X?!0:v.T?v.T.size>=v.L:!1},sPX=function(v){return v.X?1:v.T?v.T.size:0},nLo=function(v,J){return v.X?v.X==J:v.T?v.T.has(J):!1},RO_= function(v,J){v.T?v.T.add(J):v.X=J},TsG=function(v,J){v.X&&v.X==J?v.X=null:v.T&&v.T.has(J)&&v.T.delete(J)},UkT=function(v){if(v.X!=null)return v.Z.concat(v.X.Ti); if(v.T!=null&&v.T.size!==0){var J=v.Z;v=g.n(v.T.values());for(var G=v.next();!G.done;G=v.next())J=J.concat(G.value.Ti);return J}return g.vW(v.Z)},xkG=function(v,J){var G=new RH; if(g.X2.Image){var K=new Image;K.onload=g.jm(x9,G,"TestLoadImage: loaded",!0,J,K);K.onerror=g.jm(x9,G,"TestLoadImage: error",!1,J,K);K.onabort=g.jm(x9,G,"TestLoadImage: abort",!1,J,K);K.ontimeout=g.jm(x9,G,"TestLoadImage: timeout",!1,J,K);g.X2.setTimeout(function(){if(K.ontimeout)K.ontimeout()},1E4); K.src=v}else J(!1)},mk8=function(v,J){var G=new RH,K=new AbortController,V=setTimeout(function(){K.abort(); x9(G,"TestPingServer: timeout",!1,J)},1E4); fetch(v,{signal:K.signal}).then(function(Y){clearTimeout(V);Y.ok?x9(G,"TestPingServer: ok",!0,J):x9(G,"TestPingServer: server error",!1,J)}).catch(function(){clearTimeout(V); x9(G,"TestPingServer: error",!1,J)})},x9=function(v,J,G,K,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),K(G)}catch(Y){}},S9A=function(){this.T=new hg},fgN=function(v,J,G){var K=G||""; try{N_8(v,function(V,Y){var r=V;g.ML(V)&&(r=g.NC(V));J.push(K+Y+"="+encodeURIComponent(r))})}catch(V){throw J.push(K+"type="+encodeURIComponent("_badmap")),V; }},mE=function(v,J,G){return G&&G.ae4?G.ae4[v]||J:J},ZqF=function(v){this.Z=[]; this.UR=this.BO=this.YB=this.R$=this.T=this.Mj=this.Mr=this.qr=this.K=this.o$=this.N=null;this.Bv=this.xB=0;this.jK=mE("failFast",!1,v);this.Gi=this.oY=this.U=this.j=this.J=null;this.OR=!0;this.Vy=this.RY=-1;this.g_=this.Ti=this.dh=0;this.F5=mE("baseRetryDelayMs",5E3,v);this.rJ=mE("retryDelaySeedMs",1E4,v);this.IR=mE("forwardChannelMaxRetries",2,v);this.qj=mE("forwardChannelRequestTimeoutMs",2E4,v);this.Xm=v&&v.RqB||void 0;this.HG=v&&v.FLl||void 0;this.Hv=v&&v.Kvw||!1;this.BH=void 0;this.jl=v&&v.lIi|| !1;this.L="";this.X=new w8L(v&&v.bOY);this.G4=new S9A;this.wh=v&&v.mO7||!1;this.Nr=v&&v.YFl||!1;this.wh&&this.Nr&&(this.Nr=!1);this.E9=v&&v.wai||!1;v&&v.R7l&&(this.OR=!1);this.a$=!this.wh&&this.OR&&v&&v.ghH||!1;this.KK=void 0;v&&v.I_&&v.I_>0&&(this.KK=v.I_);this.Vn=void 0;this.yy=0;this.WH=!1;this.d_=this.Ze=null},wb=function(v){v.T&&(uJT(v),v.T.cancel(),v.T=null)},gLN=function(v){wb(v); v.U&&(g.X2.clearTimeout(v.U),v.U=null);yO(v);v.X.cancel();v.j&&(typeof v.j==="number"&&g.X2.clearTimeout(v.j),v.j=null)},Us=function(v){OqU(v.X)||v.j||(v.j=!0,g.dQ(v.aV,v),v.dh=0)},kZY=function(v,J){if(sPX(v.X)>=v.X.L-(v.j?1:0))return!1; if(v.j)return v.Z=J.Ti.concat(v.Z),!0;if(v.YP==1||v.YP==2||v.dh>=(v.jK?0:v.IR))return!1;v.j=db((0,g.bj)(v.aV,v,J),X8X(v,v.dh));v.dh++;return!0},NsA=function(v,J){var G; J?G=J.R$:G=v.xB++;var K=v.YB.clone();g.Un(K,"SID",v.L);g.Un(K,"RID",G);g.Un(K,"AID",v.RY);SF(v,K);v.K&&v.N&&g.fu(K,v.K,v.N);G=new lY(v,v.L,G,v.dh+1);v.K===null&&(G.YB=v.N);J&&(v.Z=J.Ti.concat(v.Z));J=cD8(v,G,1E3);G.setTimeout(Math.round(v.qj*.5)+Math.round(v.qj*.5*Math.random()));RO_(v.X,G);q9_(G,K,J)},SF=function(v,J){v.qr&&g.y2(v.qr,function(G,K){g.Un(J,K,G)}); v.J&&N_8({},function(G,K){g.Un(J,K,G)})},cD8=function(v,J,G){G=Math.min(v.Z.length,G); var K=v.J?(0,g.bj)(v.J.JK,v.J,v):null;a:{for(var V=v.Z,Y=-1;;){var r=["count="+G];Y==-1?G>0?(Y=V[0].T,r.push("ofs="+Y)):Y=0:r.push("ofs="+Y);for(var E=!0,e=0;e=3)return!1; v.g_++;v.U=db((0,g.bj)(v.lE,v),X8X(v,v.Ti));v.Ti++;return!0},uJT=function(v){v.Ze!=null&&(g.X2.clearTimeout(v.Ze),v.Ze=null)},agX=function(v){v.T=new lY(v,v.L,"rpc",v.g_); v.K===null&&(v.T.YB=v.N);v.T.BH=0;var J=v.BO.clone();g.Un(J,"RID","rpc");g.Un(J,"SID",v.L);g.Un(J,"AID",v.RY);g.Un(J,"CI",v.Gi?"0":"1");!v.Gi&&v.KK&&g.Un(J,"TO",v.KK);g.Un(J,"TYPE","xmlhttp");SF(v,J);v.K&&v.N&&g.fu(J,v.K,v.N);v.BH&&v.T.setTimeout(v.BH);var G=v.T;v=v.UR;G.jl=1;G.U=bO(J.clone());G.N=null;G.Mr=!0;rDN(G,v)},yO=function(v){v.oY!=null&&(g.X2.clearTimeout(v.oY),v.oY=null)},zO8=function(v,J){var G=null; if(v.T==J){yO(v);uJT(v);v.T=null;var K=2}else if(nLo(v.X,J))G=J.Ti,TsG(v.X,J),K=1;else return;if(v.YP!=0)if(J.j)if(K==1){G=J.N?J.N.length:0;J=Date.now()-J.dh;var V=v.dh;K=GZU();K.dispatchEvent(new VWU(K,G,J,V));Us(v)}else p88(v);else{var Y=J.o$;V=J.getLastError();if(V==3||V==0&&Y>0||!(K==1&&kZY(v,J)||K==2&&dkG(v)))switch(G&&G.length>0&&(J=v.X,J.Z=J.Z.concat(G)),V){case 1:Os(v,5);break;case 4:Os(v,10);break;case 3:Os(v,6);break;default:Os(v,2)}}},X8X=function(v,J){var G=v.F5+Math.floor(Math.random()* v.rJ); v.isActive()||(G*=2);return G*J},Os=function(v,J){if(J==2){var G=(0,g.bj)(v.EPY,v),K=v.HG,V=!K; K=new g.RW(K||"//www.google.com/images/cleardot.gif");g.X2.location&&g.X2.location.protocol=="http"||g.lL(K,"https");bO(K);V?xkG(K.toString(),G):mk8(K.toString(),G)}else ng(2);v.YP=0;v.J&&v.J.h9(J);ADL(v);gLN(v)},ADL=function(v){v.YP=0; v.d_=[];if(v.J){var J=UkT(v.X);if(J.length!=0||v.Z.length!=0)g.JE(v.d_,J),g.JE(v.d_,v.Z),v.X.Z.length=0,g.vW(v.Z),v.Z.length=0;v.J.Vx()}},FmF=function(v){if(v.YP==0)return v.d_; var J=[];g.JE(J,UkT(v.X));g.JE(J,v.Z);return J},lgA=function(v,J,G){var K=g.xa(G); K.T!=""?(J&&g.TO(K,J+"."+K.T),g.pu(K,K.Z)):(K=g.X2.location,K=amT(K.protocol,J?J+"."+K.hostname:K.hostname,+K.port,G));J=v.Mr;G=v.Mj;J&&G&&g.Un(K,J,G);g.Un(K,"VER",v.Wk);SF(v,K);return K},EL8=function(v,J,G){if(J&&!v.jl)throw Error("Can't create secondary domain capable XhrIo object."); J=v.Hv&&!v.Xm?new g.K2(new g.zO({rk:G})):new g.K2(v.Xm);J.K=v.jl;return J},Hq8=function(){},MW8=function(){},ZV=function(v,J){g.EF.call(this); this.T=new ZqF(J);this.J=v;this.X=J&&J.zwU||null;v=J&&J.UiB||null;J&&J.tOH&&(v?v["X-Client-Protocol"]="webchannel":v={"X-Client-Protocol":"webchannel"});this.T.N=v;v=J&&J.HHi||null;J&&J.hq&&(v?v["X-WebChannel-Content-Type"]=J.hq:v={"X-WebChannel-Content-Type":J.hq});J&&J.JO&&(v?v["X-WebChannel-Client-Profile"]=J.JO:v={"X-WebChannel-Client-Profile":J.JO});this.T.o$=v;(v=J&&J.ECw)&&!g.s8(v)&&(this.T.K=v);this.j=J&&J.lIi||!1;this.L=J&&J.hkB||!1;(J=J&&J.i7Y)&&!g.s8(J)&&(this.T.Mr=J,g.Zp(this.X,J)&&(v= this.X,J in v&&delete v[J]));this.Z=new fg(this)},QPF=function(v){$kA.call(this); v.__headers__&&(this.headers=v.__headers__,this.statusCode=v.__status__,delete v.__headers__,delete v.__status__);var J=v.__sm__;J?this.data=(this.T=g.mx(J))?g.ky(J,this.T):J:this.data=v},WmF=function(v){vLF.call(this); this.status=1;this.errorCode=v},fg=function(v){this.T=v},C$8=function(v,J){this.X=v; this.T=J},bqm=function(v){return FmF(v.T).map(function(J){var G=v.X; J=J.map;"__data__"in J?(J=J.__data__,G=G.L?X$X(J):J):G=J;return G})},uY=function(v,J){if(typeof v!=="function")throw Error("Fn must not be null and must be a function"); return g.X2.setTimeout(function(){v()},J)},XA=function(v){gb.dispatchEvent(new j2N(gb,v))},j2N=function(v){g.FM.call(this,"statevent",v)},k9=function(v,J,G,K){this.T=v; this.L=J;this.K=G;this.j=K||1;this.X=45E3;this.Z=new g.ZZ(this);this.J=new g.ui;this.J.setInterval(250)},$lY=function(v,J,G){v.t6=1; v.j0=bO(J.clone());v.fB=G;v.Mr=!0;iPF(v,null)},vqG=function(v,J,G,K,V){v.t6=1; v.j0=bO(J.clone());v.fB=null;v.Mr=G;V&&(v.XA=!1);iPF(v,K)},iPF=function(v,J){v.kf=Date.now(); JP6(v);v.Qr=v.j0.clone();jF(v.Qr,"t",v.j);v.A6=0;v.mJ=v.T.qg(v.T.KN()?J:null);v.YQ>0&&(v.Tf=new g.jj((0,g.bj)(v.Ew,v,v.mJ),v.YQ));v.Z.listen(v.mJ,"readystatechange",v.k8);J=v.ax?g.Ni(v.ax):{};v.fB?(v.b$="POST",J["Content-Type"]="application/x-www-form-urlencoded",v.mJ.send(v.Qr,v.b$,v.fB,J)):(v.b$="GET",v.XA&&!g.KI&&(J.Connection="close"),v.mJ.send(v.Qr,v.b$,null,J));v.T.Ie(1)},KgU=function(v,J){var G=v.A6,K=J.indexOf("\n",G); if(K==-1)return GBA;G=Number(J.substring(G,K));if(isNaN(G))return oq_;K+=1;if(K+G>J.length)return GBA;J=J.slice(K,K+G);v.A6=K+G;return J},JP6=function(v){v.yq=Date.now()+v.X; VQN(v,v.X)},VQN=function(v,J){if(v.s3!=null)throw Error("WatchDog timer not null"); v.s3=uY((0,g.bj)(v.CP,v),J)},YTm=function(v){v.s3&&(g.X2.clearTimeout(v.s3),v.s3=null)},rP8=function(v){v.T.v8()||v.J4||v.T.Fd(v)},c3=function(v){YTm(v); g.rT(v.Tf);v.Tf=null;v.J.stop();v.Z.removeAll();if(v.mJ){var J=v.mJ;v.mJ=null;J.abort();J.dispose()}v.cI&&(v.cI=null)},qTF=function(v,J){try{v.T.Hm(v,J),v.T.Ie(4)}catch(G){}},eDA=function(v,J,G,K,V){if(K==0)G(!1); else{var Y=V||0;K--;Eq8(v,J,function(r){r?G(!0):g.X2.setTimeout(function(){eDA(v,J,G,K,Y)},Y)})}},Eq8=function(v,J,G){var K=new Image; K.onload=function(){try{Nt(K),G(!0)}catch(V){}}; K.onerror=function(){try{Nt(K),G(!1)}catch(V){}}; K.onabort=function(){try{Nt(K),G(!1)}catch(V){}}; K.ontimeout=function(){try{Nt(K),G(!1)}catch(V){}}; g.X2.setTimeout(function(){if(K.ontimeout)K.ontimeout()},J); K.src=v},Nt=function(v){v.onload=null; v.onerror=null;v.onabort=null;v.ontimeout=null},PKX=function(v){this.T=v; this.X=new hg},Dlm=function(v){var J=aH(v.T,v.B9,"/mail/images/cleardot.gif"); bO(J);eDA(J.toString(),5E3,(0,g.bj)(v.HS,v),3,2E3);v.Ie(1)},tQo=function(v){var J=v.T.j; J!=null?(XA(5),J?(XA(11),Ag(v.T,v,!1)):(XA(12),Ag(v.T,v,!0))):(v.Gk=new k9(v),v.Gk.ax=v.SL,J=v.T,J=aH(J,J.KN()?v.Xi:null,v.jL),XA(5),jF(J,"TYPE","xmlhttp"),vqG(v.Gk,J,!1,v.Xi,!1))},BIY=function(v,J,G){this.T=1; this.X=[];this.Z=[];this.J=new hg;this.N=v||null;this.j=J!=null?J:null;this.U=G||!1},IuL=function(v,J){this.T=v; this.map=J;this.context=null},hD_=function(v,J,G,K){g.FM.call(this,"timingevent",v); this.size=J;this.rtt=G;this.retries=K},zDN=function(v){g.FM.call(this,"serverreachability",v)},dlN=function(v){v.KP(1,0); v.cZ=aH(v,null,v.C_);nq6(v)},s28=function(v){v.rg&&(v.rg.abort(),v.rg=null); v.FF&&(v.FF.cancel(),v.FF=null);v.hN&&(g.X2.clearTimeout(v.hN),v.hN=null);FA(v);v.PC&&(v.PC.cancel(),v.PC=null);v.FD&&(g.X2.clearTimeout(v.FD),v.FD=null)},RDY=function(v,J){if(v.T==0)throw Error("Invalid operation: sending map when state is closed"); v.X.push(new IuL(v.DN++,J));v.T!=2&&v.T!=3||nq6(v)},lu_=function(v){var J=0; v.FF&&J++;v.PC&&J++;return J},nq6=function(v){v.PC||v.FD||(v.FD=uY((0,g.bj)(v.QQ,v),0),v.n4=0)},Lg8=function(v,J){if(v.T==1){if(!J){v.mI=Math.floor(Math.random()*1E5); J=v.mI++;var G=new k9(v,"",J);G.ax=v.D7;var K=TI8(v),V=v.cZ.clone();g.Un(V,"RID",J);g.Un(V,"CVER","1");H3(v,V);$lY(G,V,K);v.PC=G;v.T=2}}else v.T==3&&(J?p9U(v,J):v.X.length==0||v.PC||p9U(v))},p9U=function(v,J){if(J)if(v.hZ>6){v.X=v.Z.concat(v.X); v.Z.length=0;var G=v.mI-1;J=TI8(v)}else G=J.K,J=J.fB;else G=v.mI++,J=TI8(v);var K=v.cZ.clone();g.Un(K,"SID",v.L);g.Un(K,"RID",G);g.Un(K,"AID",v.Yx);H3(v,K);G=new k9(v,v.L,G,v.n4+1);G.ax=v.D7;G.setTimeout(1E4+Math.round(1E4*Math.random()));v.PC=G;$lY(G,K,J)},H3=function(v,J){v.y$&&(v=v.y$.pL())&&g.y2(v,function(G,K){g.Un(J,K,G)})},TI8=function(v){var J=Math.min(v.X.length,1E3),G=["count="+J]; if(v.hZ>6&&J>0){var K=v.X[0].T;G.push("ofs="+K)}else K=0;for(var V={},Y=0;Y=3)return!1; v.K++;v.hN=uY((0,g.bj)(v.TU,v),w9Y(v,v.L4));v.L4++;return!0},Ag=function(v,J,G){v.Nf=v.j==null?G:!v.j; v.bf=J.fO;v.U||dlN(v)},FA=function(v){v.Np!=null&&(g.X2.clearTimeout(v.Np),v.Np=null)},w9Y=function(v,J){var G=5E3+Math.floor(Math.random()*1E4); v.isActive()||(G*=2);return G*J},Mt=function(v,J){if(J==2||J==9){var G=null; v.y$&&(G=null);var K=(0,g.bj)(v.w8Y,v);G||(G=new g.RW("//www.google.com/images/cleardot.gif"),bO(G));Eq8(G.toString(),1E4,K)}else XA(2);UlL(v,J)},UlL=function(v,J){v.T=0; v.y$&&v.y$.bP(J);xl6(v);s28(v)},xl6=function(v){v.T=0; v.bf=-1;if(v.y$)if(v.Z.length==0&&v.X.length==0)v.y$.kQ();else{var J=g.vW(v.Z),G=g.vW(v.X);v.Z.length=0;v.X.length=0;v.y$.kQ(J,G)}},aH=function(v,J,G){var K=g.xa(G); if(K.T!="")J&&g.TO(K,J+"."+K.T),g.pu(K,K.Z);else{var V=window.location;K=amT(V.protocol,J?J+"."+V.hostname:V.hostname,+V.port,G)}v.DY&&g.y2(v.DY,function(Y,r){g.Un(K,r,Y)}); g.Un(K,"VER",v.hZ);H3(v,K);return K},mlS=function(){},STT=function(){this.T=[]; this.X=[]},fuX=function(v){g.FM.call(this,"channelMessage"); this.message=v},ZPY=function(v){g.FM.call(this,"channelError"); this.error=v},usF=function(v,J){this.action=v; this.params=J||{}},QO=function(v,J){g.X.call(this); this.T=new g.Qq(this.RIU,0,this);g.k(this,this.T);this.LZ=5E3;this.X=0;if(typeof v==="function")J&&(v=(0,g.bj)(v,J));else if(v&&typeof v.handleEvent==="function")v=(0,g.bj)(v.handleEvent,v);else throw Error("Invalid listener argument");this.Z=v},gqN=function(v,J,G,K,V,Y,r,E,e,P,D,t,B,I){G=G===void 0?!1:G; K=K===void 0?function(){return""}:K; V=V===void 0?!1:V;Y=Y===void 0?!1:Y;r=r===void 0?!1:r;E=E===void 0?function(){return g.OF({})}:E; e=e===void 0?!1:e;D=D===void 0?!1:D;t=t===void 0?!1:t;B=B===void 0?!1:B;I=I===void 0?!1:I;this.jl=v;this.oY=J;this.j=new g.L7;this.X=new QO(this.wGe,this);this.T=null;this.K=!1;this.N=null;this.dh="";this.Ti=this.U=0;this.Z=[];this.g_=G;this.Mr=K;this.J=Y;this.YB=E;this.qr=P;this.UR=r;this.Ze=null;this.L=g.OF();this.R$=V;this.d_=e;this.wh=D;this.Nr=t;this.OR=B;this.o$=I;this.BH=new AvY;this.Gi=new FOG;this.WH=new Mw8;this.xB=new H4G;this.RY=new Qym;this.a$=new WO6;this.Vn=new C9U},cPA=function(v, J,G,K,V){X9m(v); if(v.T){var Y=g.H$("ID_TOKEN"),r=v.T.D7||{};Y?r["x-youtube-identity-token"]=Y:delete r["x-youtube-identity-token"];v.T.D7=r}kB8(v);K?(K.getState()!=3&&lu_(K)==0||K.getState(),v.T.connect(J,G,v.oY,K.L,K.Yx)):V?v.T.connect(J,G,v.oY,V.sessionId,V.arrayId):v.T.connect(J,G,v.oY)},FgA=function(v,J){return v.OR?!0:v.Nr?Object.values(NIY).includes(J):v.wh?!Object.values(aum).includes(J):v.o$?Object.values(APX).includes(J):!1},Q2o=function(v){var J,G; g.m(function(K){if(K.T==1)return g.sm(K,2),g.U(K,HPA(v),2);g.TX(K);J=v.Z;v.Z=[];G=J.length;MQ8(v,J,G);W3(v);return g.Lf(K,0)})},MQ8=function(v,J,G){for(var K=0;K0?G=Object.assign({},G,J):delete G.Authorization;v.T.D7=G}},kB8=function(v){v.qr&&!v.J&&CKm(v,v.qr())},Cg=function(v){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.X=!0;v=v||document.location.href;var J=Number(g.Qr(4,v))||"";J&&(this.port=":"+J);this.domain=g.Wp(v)||"";v=g.wT();v.search("MSIE")>=0&&(v=v.match(/MSIE ([\d.]+)/)[1],g.yY(v,"10.0")<0&&(this.X=!1))},bY=function(v,J){var G=v.T; v.X&&(G=v.scheme+"://"+v.domain+v.port+v.T);return g.vt(G+J,{})},bPF=function(v,J){g.EF.call(this); var G=this;this.e3=v();this.e3.subscribe("handlerOpened",this.Gj,this);this.e3.subscribe("handlerClosed",this.onClosed,this);this.e3.subscribe("handlerError",function(K,V){G.onError(V)}); this.e3.subscribe("handlerMessage",this.onMessage,this);this.T=J},jk8=function(v,J,G){var K=this; G=G===void 0?function(){return""}:G; var V=V===void 0?new MW8:V;var Y=Y===void 0?new g.L7:Y;this.pathPrefix=v;this.T=J;this.dh=G;this.J=Y;this.U=null;this.N=this.K=0;this.channel=null;this.j=0;this.Z=new QO(function(){K.Z.isActive();var r;((r=K.channel)==null?void 0:sPX((new C$8(r,r.T)).T.X))===0&&K.connect(K.U,K.K)}); this.L={};this.X={};this.oY=!1;this.logger=null;this.Ti=[];this.PG=void 0;this.YB=new AvY;this.Ze=new FOG;this.qr=new H4G;this.Mr=new Qym},ieS=function(v){g.JG(v.channel,"m",function(){v.j=3; v.Z.reset();v.U=null;v.K=0;for(var J=g.n(v.Ti),G=J.next();!G.done;G=J.next())G=G.value,v.channel&&v.channel.send(G);v.Ti=[];v.publish("webChannelOpened");v.YB.Wv("WEB_CHANNEL")}); g.JG(v.channel,"n",function(){v.j=0;v.Z.isActive()||v.publish("webChannelClosed");var J,G=(J=v.channel)==null?void 0:bqm(new C$8(J,J.T));G&&(v.Ti=[].concat(g.l(G)));v.Ze.Wv("WEB_CHANNEL")}); g.JG(v.channel,"p",function(J){var G=J.data;G[0]==="gracefulReconnect"?(v.Z.start(),v.channel&&v.channel.close()):v.publish("webChannelMessage",new usF(G[0],G[1]));v.PG=J.statusCode;v.qr.Wv("WEB_CHANNEL")}); g.JG(v.channel,"o",function(){v.PG===401||v.Z.start();v.publish("webChannelError");v.Mr.Wv("WEB_CHANNEL")})},$2o=function(v){var J=v.dh(); J?v.L["x-youtube-lounge-xsrf-token"]=J:delete v.L["x-youtube-lounge-xsrf-token"]},vE8=function(v){g.EF.call(this); this.T=v();this.T.subscribe("webChannelOpened",this.RN,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},J$m=function(v,J,G,K,V){function Y(){return new gqN(bY(v,"/bc"),J,!1,G,K)} G=G===void 0?function(){return""}:G; return g.dx("enable_mdx_web_channel_desktop")?new vE8(function(){return new jk8(bY(v,"/wc"),J,G)}):new bPF(Y,V)},VgS=function(){var v=Gwm; oEo();jB.push(v);KzL()},iV=function(v,J){oEo(); var G=Yam(v,String(J));jB.length==0?r$U(G):(KzL(),g.PW(jB,function(K){K(G)}))},$B=function(v){iV("CP",v)},oEo=function(){jB||(jB=g.NL("yt.mdx.remote.debug.handlers_")||[],g.ks("yt.mdx.remote.debug.handlers_",jB))},r$U=function(v){var J=(vc+1)%50; vc=J;J7[J]=v;GJ||(GJ=J==49)},KzL=function(){var v=jB; if(J7[0]){var J=GJ?vc:-1,G={};do G={UT:void 0},J=(J+1)%50,G.UT=J7[J],g.PW(v,function(K){return function(V){V(K.UT)}}(G)); while(J!=vc);J7=Array(50);vc=-1;GJ=!1}},Yam=function(v,J){var G=(Date.now()-qam)/1E3; G.toFixed&&(G=G.toFixed(3));var K=[];K.push("[",G+"s","] ");K.push("[","yt.mdx.remote","] ");K.push(v+": "+J,"\n");return K.join("")},o0=function(v){g.qU.call(this); this.j=v;this.screens=[]},EEN=function(v,J){var G=v.get(J.uuid)||v.get(J.id); if(G)return v=G.name,G.id=J.id||G.id,G.name=J.name,G.token=J.token,G.uuid=J.uuid||G.uuid,G.name!=v;v.screens.push(J);return!0},eT8=function(v,J){var G=v.screens.length!=J.length; v.screens=g.E_(v.screens,function(Y){return!!wy8(J,Y)}); for(var K=J.length,V=0;V0&&v.L0&&h7(v,G)},function(J){v.J=function(){}; v.TH(J)})},c$G=function(v){var J={}; J.pairingCode=v.Ze;J.theme=v.jl;keU()&&(J.env_useStageMdx=1);return g.$l(J)},NeX=function(v){return new Promise(function(J){v.Ze=LaU(); if(v.YB){var G=new chrome.cast.DialLaunchResponse(!0,c$G(v));J(G);kw8(v)}else v.oY=function(){g.hh(v.N);v.oY=function(){}; v.N=NaN;var K=new chrome.cast.DialLaunchResponse(!0,c$G(v));J(K);kw8(v)},v.N=g.By(function(){v.oY()},100)})},A$S=function(v,J,G){v.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(J)); var K=new Kg(J);return(new Promise(function(V){aU6(v,K,function(Y){Y?(v.Ti=!0,EV(v.L,K),Pc(v,K),h7(v,G)):g.b9(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(J)+" is not online."));V(Y)},5)})).then(function(V){return V?new chrome.cast.DialLaunchResponse(!1):NeX(v)})},FzT=function(v,J){var G=v.U.receiver.label,K=v.X.friendlyName; return(new Promise(function(V){lUT(v.L,G,J,K,function(Y){Y&&Y.token&&Pc(v,Y);V(Y)},function(Y){DO(v,"Failed to get DIAL screen: "+Y); V(null)})})).then(function(V){return V&&V.token?new chrome.cast.DialLaunchResponse(!1):NeX(v)})},aU6=function(v,J,G,K){g.hh(v.j); v.j=0;pOS(v.L,J,function(V){V||K<0?G(V):v.j=g.By(function(){aU6(v,J,G,K-1)},300)})},h7=function(v,J){v.info("getDialAppInfoWithTimeout_ "+J); I0(v)&&(g.hh(v.K),v.K=0,J==0?Hem(v):v.K=g.By(function(){Hem(v)},J))},Hem=function(v){I0(v)&&v.Z.getDialAppInfo(function(J){v.info("getDialAppInfo dialLaunchData: "+JSON.stringify(J)); J=J.extraData||{};var G=null;if(J.loungeToken){var K;((K=v.T)==null?void 0:K.token)==J.loungeToken&&(G="staleLoungeToken")}else G="missingLoungeToken";G?(v.dh=G,h7(v,3E4)):(v.Ti=!1,v.dh="unknown",OeS(v,J.loungeToken),h7(v,J.loungeTokenRefreshIntervalMs))},function(J){v.info("getDialAppInfo error: "+J); v.dh="noLoungeTokenResponse";h7(v,3E4)})},Mg6=function(v){g.hh(v.j); v.j=0;g.hh(v.K);v.K=0;v.J();v.J=function(){}; g.hh(v.N)},zJ=function(v,J){eB.call(this,v,J,"ManualSession"); this.Z=g.By((0,g.bj)(this.M8,this,null),150)},nA=function(v,J){g.qU.call(this); this.config_=J;this.X=v;this.U=J.appId||"233637DE";this.L=J.theme||"cl";this.N=J.disableCastApi||!1;this.j=J.forceMirroring||!1;this.T=null;this.K=!1;this.Z=[];this.J=(0,g.bj)(this.NB4,this)},QkA=function(v,J){return J?g.MS(v.Z,function(G){return VO(J,G.label)},v):null},dN=function(v){iV("Controller",v)},Gwm=function(v){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(v)},sV=function(v){return v.K||!!v.Z.length||!!v.T},R0=function(v,J,G){J!=v.T&&(g.rT(v.T),(v.T=J)?(G?v.publish("yt-remote-cast2-receiver-resumed", J.X):v.publish("yt-remote-cast2-receiver-selected",J.X),J.subscribe("sessionScreen",(0,g.bj)(v.Vz,v,J)),J.subscribe("sessionFailed",function(){return WzA(v,J)}),J.T?v.publish("yt-remote-cast2-session-change",J.T):G&&v.T.M8(null)):v.publish("yt-remote-cast2-session-change",null))},WzA=function(v,J){v.T==J&&v.publish("yt-remote-cast2-session-failed")},C5T=function(v){var J=v.X.ZP(),G=v.T&&v.T.X; v=g.yn(J,function(K){G&&VO(K,G.label)&&(G=null);var V=K.uuid?K.uuid:K.id,Y=QkA(this,K);Y?(Y.label=V,Y.friendlyName=K.name):(Y=new chrome.cast.Receiver(V,K.name),Y.receiverType=chrome.cast.ReceiverType.CUSTOM);return Y},v); G&&(G.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(G=new chrome.cast.Receiver(G.label,G.friendlyName),G.receiverType=chrome.cast.ReceiverType.CUSTOM),v.push(G));return v},GIL=function(v,J,G,K){K.disableCastApi?lV("Cannot initialize because disabled by Mdx config."):beT()?jbX(J,K)&&(irm(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?$oG(v,G):(window.__onGCastApiAvailable=function(V,Y){V?$oG(v,G):(TJ("Failed to load cast API: "+Y),vZ6(!1),irm(!1),g.Zg("yt-remote-cast-available"),g.Zg("yt-remote-cast-receiver"), J0L(),G(!1))},K.loadCastApiSetupScript?g.rg("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?NxU()>=60&&bE_():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?HEY():NxU()>=89?iqG():(CRo(),B3(jPL.map(Mk6))))):lV("Cannot initialize because not running Chrome")},J0L=function(){lV("dispose"); var v=pA();v&&v.dispose();g.ks("yt.mdx.remote.cloudview.instance_",null);oZ8(!1);g.Vy(KZ8);KZ8.length=0},LA=function(){return!!g.fq("yt-remote-cast-installed")},V3Y=function(){var v=g.fq("yt-remote-cast-receiver"); return v?v.friendlyName:null},Y0m=function(){lV("clearCurrentReceiver"); g.Zg("yt-remote-cast-receiver")},r0X=function(){return LA()?pA()?pA().getCastSession():(TJ("getCastSelector: Cast is not initialized."),null):(TJ("getCastSelector: Cast API is not installed!"),null)},q0A=function(){LA()?pA()?yk()?(lV("Requesting cast selector."),pA().requestSession()):(lV("Wait for cast API to be ready to request the session."),KZ8.push(g.Kr("yt-remote-cast2-api-ready",q0A))):TJ("requestCastSelector: Cast is not initialized."):TJ("requestCastSelector: Cast API is not installed!")}, wN=function(v,J){yk()?pA().setConnectedScreenStatus(v,J):TJ("setConnectedScreenStatus called before ready.")},beT=function(){var v=g.wT().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.x4||v},EZY=function(v,J){pA().init(v,J)},jbX=function(v,J){var G=!1; pA()||(v=new nA(v,J),v.subscribe("yt-remote-cast2-availability-change",function(K){g.SW("yt-remote-cast-available",K);DV("yt-remote-cast2-availability-change",K)}),v.subscribe("yt-remote-cast2-receiver-selected",function(K){lV("onReceiverSelected: "+K.friendlyName); g.SW("yt-remote-cast-receiver",K);DV("yt-remote-cast2-receiver-selected",K)}),v.subscribe("yt-remote-cast2-receiver-resumed",function(K){lV("onReceiverResumed: "+K.friendlyName); g.SW("yt-remote-cast-receiver",K);DV("yt-remote-cast2-receiver-resumed",K)}),v.subscribe("yt-remote-cast2-session-change",function(K){lV("onSessionChange: "+Y9(K)); K||g.Zg("yt-remote-cast-receiver");DV("yt-remote-cast2-session-change",K)}),g.ks("yt.mdx.remote.cloudview.instance_",v),G=!0); lV("cloudview.createSingleton_: "+G);return G},pA=function(){return g.NL("yt.mdx.remote.cloudview.instance_")},$oG=function(v,J){vZ6(!0); irm(!1);EZY(v,function(G){G?(oZ8(!0),g.YZ("yt-remote-cast2-api-ready")):(TJ("Failed to initialize cast API."),vZ6(!1),g.Zg("yt-remote-cast-available"),g.Zg("yt-remote-cast-receiver"),J0L());J(G)})},lV=function(v){iV("cloudview",v)},TJ=function(v){iV("cloudview",v)},vZ6=function(v){lV("setCastInstalled_ "+v); g.SW("yt-remote-cast-installed",v)},yk=function(){return!!g.NL("yt.mdx.remote.cloudview.apiReady_")},oZ8=function(v){lV("setApiReady_ "+v); g.ks("yt.mdx.remote.cloudview.apiReady_",v)},irm=function(v){g.ks("yt.mdx.remote.cloudview.initializing_",v)},OV=function(v){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.j=this.K=0;this.trackData=null;this.tS=this.z_=!1;this.U=this.J=this.T=this.L=0;this.Z=NaN;this.X=!1;this.reset(v)},eQY=function(v){v.audioTrackId=null; v.trackData=null;v.playerState=-1;v.z_=!1;v.tS=!1;v.K=0;v.j=g.$X();v.L=0;v.T=0;v.J=0;v.U=0;v.Z=NaN;v.X=!1},UV=function(v){return v.isPlaying()?(g.$X()-v.j)/1E3:0},xB=function(v,J){v.K=J; v.j=g.$X()},mn=function(v){switch(v.playerState){case 1:case 1081:return(g.$X()-v.j)/1E3+v.K; case -1E3:return 0}return v.K},SB=function(v,J,G){var K=v.videoId; v.videoId=J;v.index=G;J!=K&&eQY(v)},PNm=function(v){var J={}; J.index=v.index;J.listId=v.listId;J.videoId=v.videoId;J.playerState=v.playerState;J.volume=v.volume;J.muted=v.muted;J.audioTrackId=v.audioTrackId;J.trackData=g.a7(v.trackData);J.hasPrevious=v.z_;J.hasNext=v.tS;J.playerTime=v.K;J.playerTimeAt=v.j;J.seekableStart=v.L;J.seekableEnd=v.T;J.duration=v.J;J.loadedTime=v.U;J.liveIngestionTime=v.Z;return J},ZO=function(v,J){g.qU.call(this); var G=this;this.Z=0;this.L=v;this.j=[];this.J=new STT;this.X=this.T=null;this.N=(0,g.bj)(this.ZKH,this);this.K=(0,g.bj)(this.H0,this);this.U=(0,g.bj)(this.pOr,this);this.oY=(0,g.bj)(this.vLi,this);var K=0;v?(K=v.getProxyState(),K!=3&&(v.subscribe("proxyStateChange",this.er,this),DoX(this))):K=3;K!=0&&(J?this.er(K):g.By(function(){G.er(K)},0)); (v=r0X())&&fA(this,v);this.subscribe("yt-remote-cast2-session-change",this.oY)},uV=function(v){return new OV(v.L.getPlayerContextData())},DoX=function(v){g.PW("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(J){this.j.push(this.L.subscribe(J,g.jm(this.V3b,J),this))},v)},t3L=function(v){g.PW(v.j,function(J){this.L.unsubscribeByKey(J)},v); v.j.length=0},gN=function(v){return v.getState()==1},XC=function(v,J){var G=v.J; G.T.length+G.X.length<50&&v.J.enqueue(J)},BgT=function(v,J,G){var K=uV(v); xB(K,G);K.playerState!=-1E3&&(K.playerState=J);kB(v,K)},cc=function(v,J,G){v.L.sendMessage(J,G)},kB=function(v,J){t3L(v); v.L.setPlayerContextData(PNm(J));DoX(v)},fA=function(v,J){v.X&&(v.X.removeUpdateListener(v.N),v.X.removeMediaListener(v.K),v.H0(null)); v.X=J;v.X&&($B("Setting cast session: "+v.X.sessionId),v.X.addUpdateListener(v.N),v.X.addMediaListener(v.K),v.X.media.length&&v.H0(v.X.media[0]))},IE6=function(v){var J=v.T.media,G=v.T.customData; if(J&&G){var K=uV(v);J.contentId!=K.videoId&&$B("Cast changing video to: "+J.contentId);K.videoId=J.contentId;K.playerState=G.playerState;xB(K,v.T.getEstimatedTime());kB(v,K)}else $B("No cast media video. Ignoring state update.")},Nz=function(v,J,G){return(0,g.bj)(function(K){this.mT("Failed to "+J+" with cast v2 channel. Error code: "+K.code); K.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.mT("Retrying "+J+" using MDx browser channel."),cc(this,J,G))},v)},FC=function(v,J,G,K){K=K===void 0?!1:K; g.qU.call(this);var V=this;this.j=NaN;this.Ze=!1;this.N=this.U=this.Ti=this.dh=NaN;this.oY=[];this.J=this.K=this.L=this.T=this.X=null;this.YB=v;this.qr=K;this.oY.push(g.RP(window,"beforeunload",function(){V.eq(2)})); this.Z=[];this.T=new OV;this.jl=J.id;this.Mr=J.idType;this.X=J$m(this.YB,G,this.yQ,this.Mr=="shortLived",this.jl);this.X.listen("channelOpened",function(){hQU(V)}); this.X.listen("channelClosed",function(){a0("Channel closed");isNaN(V.j)?eF(!0):eF();V.dispose()}); this.X.listen("channelError",function(Y){eF();isNaN(V.l6())?(Y==1&&V.Mr=="shortLived"&&V.publish("browserChannelAuthError",Y),a0("Channel error: "+Y+" without reconnection"),V.dispose()):(V.Ze=!0,a0("Channel error: "+Y+" with reconnection in "+V.l6()+" ms"),A7(V,2))}); this.X.listen("channelMessage",function(Y){zQF(V,Y)}); this.X.b8(J.token);this.subscribe("remoteQueueChange",function(){var Y=V.T.videoId;g.u$()&&g.SW("yt-remote-session-video-id",Y)})},nZ8=function(v){return g.MS(v.Z,function(J){return J.type=="LOUNGE_SCREEN"})},a0=function(v){iV("conn",v)},A7=function(v,J){v.publish("proxyStateChange",J)},doA=function(v){v.j=g.By(function(){a0("Connecting timeout"); v.eq(1)},2E4)},sbT=function(v){g.hh(v.j); v.j=NaN},RQm=function(v){g.hh(v.dh); v.dh=NaN},Tgo=function(v){lEA(v); v.Ti=g.By(function(){Hc(v,"getNowPlaying")},2E4)},lEA=function(v){g.hh(v.Ti); v.Ti=NaN},hQU=function(v){a0("Channel opened"); v.Ze&&(v.Ze=!1,RQm(v),v.dh=g.By(function(){a0("Timing out waiting for a screen.");v.eq(1)},15E3))},LZA=function(v,J){var G=null; if(J){var K=nZ8(v);K&&(G={clientName:K.clientName,deviceMake:K.brand,deviceModel:K.model,osVersion:K.osVersion})}g.ks("yt.mdx.remote.remoteClient_",G);J&&(sbT(v),RQm(v));G=v.X.sZ()&&isNaN(v.j);J==G?J&&(A7(v,1),Hc(v,"getSubtitlesTrack")):J?(v.Ws()&&v.T.reset(),A7(v,1),Hc(v,"getNowPlaying"),poS(v)):v.eq(1)},y08=function(v,J){var G=J.params.videoId; delete J.params.videoId;G==v.T.videoId&&(g.Xb(J.params)?v.T.trackData=null:v.T.trackData=J.params,v.publish("remotePlayerChange"))},woT=function(v,J,G){var K=J.params.videoId||J.params.video_id,V=parseInt(J.params.currentIndex,10); v.T.listId=J.params.listId||v.T.listId;SB(v.T,K,V);v.publish("remoteQueueChange",G)},UoS=function(v,J){J.params=J.params||{}; woT(v,J,"NOW_PLAYING_MAY_CHANGE");OrU(v,J);v.publish("autoplayDismissed")},OrU=function(v,J){var G=parseInt(J.params.currentTime||J.params.current_time,10); xB(v.T,isNaN(G)?0:G);G=parseInt(J.params.state,10);G=isNaN(G)?-1:G;G==-1&&v.T.playerState==-1E3&&(G=-1E3);v.T.playerState=G;G=Number(J.params.loadedTime);v.T.U=isNaN(G)?0:G;v.T.y_(Number(J.params.duration));G=v.T;var K=Number(J.params.liveIngestionTime);G.Z=K;G.X=isNaN(K)?!1:!0;G=v.T;K=Number(J.params.seekableStartTime);J=Number(J.params.seekableEndTime);G.L=isNaN(K)?0:K;G.T=isNaN(J)?0:J;v.T.playerState==1?Tgo(v):lEA(v);v.publish("remotePlayerChange")},xoF=function(v,J){if(v.T.playerState!=-1E3){var G= 1085; switch(parseInt(J.params.adState,10)){case 1:G=1081;break;case 2:G=1084;break;case 0:G=1083}v.T.playerState=G;J=parseInt(J.params.currentTime,10);xB(v.T,isNaN(J)?0:J);v.publish("remotePlayerChange")}},moL=function(v,J){var G=J.params.muted=="true"; v.T.volume=parseInt(J.params.volume,10);v.T.muted=G;v.publish("remotePlayerChange")},S08=function(v,J){v.K=J.params.videoId; v.publish("nowAutoplaying",parseInt(J.params.timeout,10))},fEF=function(v,J){v.K=J.params.videoId||null; v.publish("autoplayUpNext",v.K)},ZrF=function(v,J){v.J=J.params.autoplayMode; v.publish("autoplayModeChange",v.J);v.J=="DISABLED"&&v.publish("autoplayDismissed")},uv6=function(v,J){var G=J.params.hasNext=="true"; v.T.z_=J.params.hasPrevious=="true";v.T.tS=G;v.publish("previousNextChange")},zQF=function(v,J){J=J.message; J.params?a0("Received: action="+J.action+", params="+g.NC(J.params)):a0("Received: action="+J.action+" {}");switch(J.action){case "loungeStatus":J=iY(J.params.devices);v.Z=g.yn(J,function(K){return new oH(K)}); J=!!g.MS(v.Z,function(K){return K.type=="LOUNGE_SCREEN"}); LZA(v,J);J=v.wV("mlm");v.publish("multiStateLoopEnabled",J);break;case "loungeScreenDisconnected":g.il(v.Z,function(K){return K.type=="LOUNGE_SCREEN"}); LZA(v,!1);break;case "remoteConnected":var G=new oH(iY(J.params.device));g.MS(v.Z,function(K){return K.Rt(G)})||Z4U(v.Z,G); break;case "remoteDisconnected":G=new oH(iY(J.params.device));g.il(v.Z,function(K){return K.Rt(G)}); break;case "gracefulDisconnect":break;case "playlistModified":woT(v,J,"QUEUE_MODIFIED");break;case "nowPlaying":UoS(v,J);break;case "onStateChange":OrU(v,J);break;case "onAdStateChange":xoF(v,J);break;case "onVolumeChanged":moL(v,J);break;case "onSubtitlesTrackChanged":y08(v,J);break;case "nowAutoplaying":S08(v,J);break;case "autoplayDismissed":v.publish("autoplayDismissed");break;case "autoplayUpNext":fEF(v,J);break;case "onAutoplayModeChanged":ZrF(v,J);break;case "onHasPreviousNextChanged":uv6(v, J);break;case "requestAssistedSignIn":v.publish("assistedSignInRequested",J.params.authCode);break;case "onLoopModeChanged":v.publish("loopModeChange",J.params.loopMode);break;default:a0("Unrecognized action: "+J.action)}},poS=function(v){g.hh(v.N); v.N=g.By(function(){v.eq(1)},864E5)},Hc=function(v,J,G){G?a0("Sending: action="+J+", params="+g.NC(G)):a0("Sending: action="+J); v.X.sendMessage(J,G)},gZT=function(v){o0.call(this,"ScreenServiceProxy"); this.IK=v;this.T=[];this.T.push(this.IK.$_s("screenChange",(0,g.bj)(this.lW,this)));this.T.push(this.IK.$_s("onlineScreenChange",(0,g.bj)(this.QAl,this)))},aE8=function(v,J){Xym(); if(!P3||!P3.get("yt-remote-disable-remote-module-for-dev")){J=g.H$("MDX_CONFIG")||J;OET();Si8();Mz||(Mz=new Cg(J?J.loungeApiHost:void 0),keU()&&(Mz.T="/api/loungedev"));Qk||(Qk=g.NL("yt.mdx.remote.deferredProxies_")||[],g.ks("yt.mdx.remote.deferredProxies_",Qk));XoA();var G=Wc();if(!G){var K=new qz(Mz,J?J.disableAutomaticScreenCache||!1:!1);g.ks("yt.mdx.remote.screenService_",K);G=Wc();var V={};J&&(V={appId:J.appId,disableDial:J.disableDial,theme:J.theme,loadCastApiSetupScript:J.loadCastApiSetupScript, disableCastApi:J.disableCastApi,enableDialLoungeToken:J.enableDialLoungeToken,enableCastLoungeToken:J.enableCastLoungeToken,forceMirroring:J.forceMirroring});g.ks("yt.mdx.remote.enableConnectWithInitialState_",J?J.enableConnectWithInitialState||!1:!1);GIL(v,K,function(Y){Y?CA()&&wN(CA(),"YouTube TV"):K.subscribe("onlineScreenChange",function(){DV("yt-remote-receiver-availability-change")})},V)}J&&!g.NL("yt.mdx.remote.initialized_")&&(g.ks("yt.mdx.remote.initialized_",!0),bV("Initializing: "+g.NC(J)), jS.push(g.Kr("yt-remote-cast2-api-ready",function(){DV("yt-remote-api-ready")})),jS.push(g.Kr("yt-remote-cast2-availability-change",function(){DV("yt-remote-receiver-availability-change")})),jS.push(g.Kr("yt-remote-cast2-receiver-selected",function(){iC(null); DV("yt-remote-auto-connect","cast-selector-receiver")})),jS.push(g.Kr("yt-remote-cast2-receiver-resumed",function(){DV("yt-remote-receiver-resumed","cast-selector-receiver")})),jS.push(g.Kr("yt-remote-cast2-session-change",kIG)),jS.push(g.Kr("yt-remote-connection-change",function(Y){Y?wN(CA(),"YouTube TV"):$i()||(wN(null,null),Y0m())})),jS.push(g.Kr("yt-remote-cast2-session-failed",function(){DV("yt-remote-connection-failed")})),v=c0A(),J.isAuto&&(v.id+="#dial"),V=J.capabilities||[],g.dx("desktop_enable_autoplay")&& V.push("atp"),V.length>0&&(v.capabilities=V),v.name=J.device,v.app=J.app,(J=J.theme)&&(v.theme=J),bV(" -- with channel params: "+g.NC(v)),v?(g.SW("yt-remote-session-app",v.app),g.SW("yt-remote-session-name",v.name)):(g.Zg("yt-remote-session-app"),g.Zg("yt-remote-session-name")),g.ks("yt.mdx.remote.channelParams_",v),G.start(),CA()||Ng8())}},A0Y=function(){var v=Wc().IK.$_gos(); var J=vS();J&&JR()&&(wy8(v,J)||v.push(J));return yho(v)},HrY=function(){var v=FZ_(); !v&&LA()&&V3Y()&&(v={key:"cast-selector-receiver",name:V3Y()});return v},FZ_=function(){var v=A0Y(),J=vS(); J||(J=$i());return g.MS(v,function(G){return J&&VO(J,G.key)?!0:!1})},vS=function(){var v=CA(); if(!v)return null;var J=Wc().oo();return rb(J,v)},kIG=function(v){bV("remote.onCastSessionChange_: "+Y9(v)); if(v){var J=vS();if(J&&J.id==v.id){if(wN(J.id,"YouTube TV"),v.idType=="shortLived"&&(v=v.token))GF&&(GF.token=v),(J=JR())&&J.b8(v)}else J&&ot(),KU(v,1)}else JR()&&ot()},ot=function(){yk()?pA().stopSession():TJ("stopSession called before API ready."); var v=JR();v&&(v.disconnect(1),M3U(null))},Qb8=function(){var v=JR(); return!!v&&v.getProxyState()!=3},bV=function(v){iV("remote",v)},Wc=function(){if(!WZ6){var v=g.NL("yt.mdx.remote.screenService_"); WZ6=v?new gZT(v):null}return WZ6},CA=function(){return g.NL("yt.mdx.remote.currentScreenId_")},CNU=function(v){g.ks("yt.mdx.remote.currentScreenId_",v)},br6=function(){return g.NL("yt.mdx.remote.connectData_")},iC=function(v){g.ks("yt.mdx.remote.connectData_",v)},JR=function(){return g.NL("yt.mdx.remote.connection_")},M3U=function(v){var J=JR(); iC(null);v||CNU("");g.ks("yt.mdx.remote.connection_",v);Qk&&(g.PW(Qk,function(G){G(v)}),Qk.length=0); J&&!v?DV("yt-remote-connection-change",!1):!J&&v&&DV("yt-remote-connection-change",!0)},$i=function(){var v=g.u$(); if(!v)return null;var J=Wc();if(!J)return null;J=J.oo();return rb(J,v)},KU=function(v,J){CA(); vS()&&vS();if(V6)GF=v;else{CNU(v.id);var G=g.NL("yt.mdx.remote.enableConnectWithInitialState_")||!1;v=new FC(Mz,v,c0A(),G);v.connect(J,br6());v.subscribe("beforeDisconnect",function(K){DV("yt-remote-before-disconnect",K)}); v.subscribe("beforeDispose",function(){JR()&&(JR(),M3U(null))}); v.subscribe("browserChannelAuthError",function(){var K=vS();K&&K.idType=="shortLived"&&(yk()?pA().handleBrowserChannelAuthError():TJ("refreshLoungeToken called before API ready."))}); M3U(v)}},Ng8=function(){var v=$i(); v?(bV("Resume connection to: "+Y9(v)),KU(v,0)):(eF(),Y0m(),bV("Skipping connecting because no session screen found."))},XoA=function(){var v=c0A(); if(g.Xb(v)){v=Es();var J=g.fq("yt-remote-session-name")||"",G=g.fq("yt-remote-session-app")||"";v={device:"REMOTE_CONTROL",id:v,name:J,app:G,mdxVersion:3};v.authuser=String(g.H$("SESSION_INDEX","0"));(J=g.H$("DELEGATED_SESSION_ID"))&&(v.pageId=String(J));g.ks("yt.mdx.remote.channelParams_",v)}},c0A=function(){return g.NL("yt.mdx.remote.channelParams_")||{}},$TA=function(v,J,G){g.X.call(this); var K=this;this.module=v;this.S=J;this.LK=G;this.events=new g.Zs(this);this.L=!1;this.J=new g.JZ(64);this.T=new g.Qq(this.UW,500,this);this.X=new g.Qq(this.z8,1E3,this);this.K=new IH(this.YJi,0,this);this.Z={};this.U=new g.Qq(this.Di,1E3,this);this.j=new g.jj(this.seekTo,1E3,this);this.N=this.events.G(this.S,"onVolumeChange",function(V){j5S(K,V)}); g.k(this,this.events);this.events.G(J,"onCaptionsTrackListChanged",this.OK7);this.events.G(J,"captionschanged",this.dXU);this.events.G(J,"captionssettingschanged",this.Wj);this.events.G(J,"videoplayerreset",this.hx);this.events.G(J,"mdxautoplaycancel",function(){K.LK.Vp()}); J.C("enable_mdx_video_play_directly")&&this.events.G(J,"videodatachange",function(){iWF(K.module)||Yi(K)||ro(K,0)}); v=this.LK;v.Sl();v.subscribe("proxyStateChange",this.Ou,this);v.subscribe("remotePlayerChange",this.AA,this);v.subscribe("remoteQueueChange",this.hx,this);v.subscribe("previousNextChange",this.B6,this);v.subscribe("nowAutoplaying",this.m8,this);v.subscribe("autoplayDismissed",this.v6,this);g.k(this,this.T);g.k(this,this.X);g.k(this,this.K);g.k(this,this.U);g.k(this,this.j);this.Wj();this.hx();this.AA()},j5S=function(v,J){if(Yi(v)){v.LK.unsubscribe("remotePlayerChange",v.AA,v); var G=Math.round(J.volume);J=!!J.muted;var K=uV(v.LK);if(G!==K.volume||J!==K.muted)v.LK.setVolume(G,J),v.U.start();v.LK.subscribe("remotePlayerChange",v.AA,v)}},vmo=function(v){v.kL(0); v.T.stop();v.Zv(new g.JZ(64))},JtY=function(v,J){if(Yi(v)&&!v.L){var G=null; J&&(G={style:v.S.getSubtitlesUserSettings()},Object.assign(G,J));v.LK.Yo(v.S.getVideoData(1).videoId,G);v.Z=uV(v.LK).trackData}},ro=function(v,J){var G=v.S.getPlaylist(); if(G==null?0:G.listId){var K=G.index;var V=G.listId.toString()}G=v.S.getVideoData(1);v.LK.playVideo(G.videoId,J,K,V,G.playerParams,G.Mr,fmU(G));v.Zv(new g.JZ(1))},G98=function(v,J){if(J){var G=v.S.getOption("captions","tracklist",{zp:1}); G&&G.length?(v.S.setOption("captions","track",J),v.L=!1):(v.S.loadModule("captions"),v.L=!0)}else v.S.setOption("captions","track",{})},Yi=function(v){return uV(v.LK).videoId===v.S.getVideoData(1).videoId},om6=function(v){this.T=v},qO=function(){g.F.call(this,{Y:"div", D:"ytp-mdx-popup-dialog",V:{role:"dialog"},W:[{Y:"div",D:"ytp-mdx-popup-dialog-inner-content",W:[{Y:"div",D:"ytp-mdx-popup-title",At:"You're signed out"},{Y:"div",D:"ytp-mdx-popup-description",At:"Videos that 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."},{Y:"div",D:"ytp-mdx-privacy-popup-buttons",W:[{Y:"button",n7:["ytp-button","ytp-mdx-privacy-popup-cancel"],At:"Cancel"},{Y:"button",n7:["ytp-button", "ytp-mdx-privacy-popup-confirm"],At:"Confirm"}]}]}]});this.fade=new g.Jk(this,250);this.cancelButton=this.p7("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.p7("ytp-mdx-privacy-popup-confirm");g.k(this,this.fade);this.G(this.cancelButton,"click",this.T);this.G(this.confirmButton,"click",this.X)},E$=function(v){g.F.call(this,{Y:"div", D:"ytp-remote",W:[{Y:"div",D:"ytp-remote-display-status",W:[{Y:"div",D:"ytp-remote-display-status-icon",W:[g.qTU()]},{Y:"div",D:"ytp-remote-display-status-text",At:"{{statustext}}"}]}]});this.api=v;this.fade=new g.Jk(this,250);g.k(this,this.fade);this.G(v,"presentingplayerstatechange",this.onStateChange);this.l9(v.getPlayerStateObject())},eS=function(v,J){g.Uq.call(this,"Play on",1,v,J); this.S=v;this.QF={};this.G(v,"onMdxReceiversChange",this.L);this.G(v,"presentingplayerstatechange",this.L);this.L()},KsA=function(v){g.YQ.call(this,v); this.EF={key:LaU(),name:"This computer"};this.Io=null;this.subscriptions=[];this.YX=this.LK=null;this.QF=[this.EF];this.i8=this.EF;this.Gr=new g.JZ(64);this.dn=0;this.UJ=-1;this.j7=!1;this.tV=this.Fh=this.bq=null;if(!g.uh(this.player.B())&&!g.gy(this.player.B())){v=this.player;var J=g.zT(v);J&&(J=J.HV())&&(J=new eS(v,J),g.k(this,J));J=new E$(v);g.k(this,J);g.gr(v,J.element,4);this.bq=new qO;g.k(this,this.bq);g.gr(v,this.bq.element,4);this.j7=!!$i()}},PS=function(v){v.Fh&&(v.player.removeEventListener("presentingplayerstatechange", v.Fh),v.Fh=null)},VD6=function(v,J,G){v.Gr=G; v.player.publish("presentingplayerstatechange",new g.Dz(G,J))},Di=function(v,J){if(J.key!==v.i8.key)if(J.key===v.EF.key)ot(); else if(iWF(v)&&Y2F(v),v.i8=J,!v.player.B().C("disable_mdx_connection_in_mdx_module_for_music_web")||!g.gy(v.player.B())){var G=v.player.getPlaylistId();var K=v.player.getVideoData(1);var V=K.videoId;if(!G&&!V||(v.player.getAppState()===2||v.player.getAppState()===1)&&v.player.B().C("should_clear_video_data_on_player_cued_unstarted"))K=null;else{var Y=v.player.getPlaylist();if(Y){var r=[];for(var E=0;E2*this.size&&Gr(this),!0):!1}; g.q.get=function(v,J){return v3(this.X,v)?this.X[v]:J}; g.q.set=function(v,J){v3(this.X,v)||(this.size+=1,this.T.push(v),this.zN++);this.X[v]=J}; g.q.forEach=function(v,J){for(var G=this.dH(),K=0;K=K.T.length)return g.Jl;var Y=K.T[J++];return g.VP(v?Y:K.X[Y])}; return V}; var JhT={m5b:"atp",gK7:"ska",Gx7:"que",xZb:"mus",eGw:"sus",M4i:"dsp",f8Y:"seq",DZY:"mic",kHh:"dpa",rhU:"cds",BWb:"mlm",JFH:"dsdtr",VRb:"ntb",wUU:"vsp",ijY:"scn",Un4:"rpe",q6w:"dcn",S6l:"dcp",Zdh:"pas",jvU:"drq",ufU:"opf",xmB:"els",rF7:"isg",HQB:"svq",rS4:"mvp",r3H:"ads",Gkr:"iat",YVi:"stcp",THe:"sads",Fci:"dloc"},GeX={hGB:"u",h6w:"cl",Xit:"k",Rrt:"i",gvB:"cr",iDi:"m",ouB:"g",Sj:"up"},NIY={QZ:"adPlaying",g$:"onAdStateChange"},aum={NW4:"nowPlaying",QEB:"onStateChange",QZ:"adPlaying",g$:"onAdStateChange"}, APX={wiB:"nowPlayingShorts",TFh:"onShortsStateChange"};oH.prototype.Rt=function(v){return v?this.id==v.id:!1}; var mAF="",P3=null;cho.prototype.flush=function(v,J){v=v===void 0?[]:v;J=J===void 0?!1:J;if(g.dx("enable_client_streamz_web")){v=g.n(v);for(var G=v.next();!G.done;G=v.next())G=g.EO2(G.value),G={serializedIncrementBatch:g.hE(G.X())},g.ql("streamzIncremented",G,{sendIsolatedPayload:J})}}; var tg,Wa8=a8X("loadCastFramework")||a8X("loadCastApplicationFramework"),jPL=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Jo(IH,g.X);g.q=IH.prototype;g.q.ym=function(v){this.L=arguments;this.T=!1;this.PO?this.Z=g.$X()+this.LZ:this.PO=g.gQ(this.J,this.LZ)}; g.q.stop=function(){this.PO&&(g.X2.clearTimeout(this.PO),this.PO=null);this.Z=null;this.T=!1;this.L=[]}; g.q.pause=function(){++this.X}; g.q.resume=function(){this.X&&(--this.X,!this.X&&this.T&&(this.T=!1,this.j.apply(null,this.L)))}; g.q.X4=function(){this.stop();IH.Yr.X4.call(this)}; g.q.q4=function(){this.PO&&(g.X2.clearTimeout(this.PO),this.PO=null);this.Z?(this.PO=g.gQ(this.J,this.Z-g.$X()),this.Z=null):this.X?this.T=!0:(this.T=!1,this.j.apply(null,this.L))};hg.prototype.stringify=function(v){return g.X2.JSON.stringify(v,void 0)}; hg.prototype.parse=function(v){return g.X2.JSON.parse(v,void 0)};g.Jo($kA,g.FM);g.Jo(vLF,g.FM);var JDm=null;g.Jo(oLL,g.FM);g.Jo(Km_,g.FM);g.Jo(VWU,g.FM);RH.prototype.debug=function(){}; RH.prototype.info=function(){}; RH.prototype.warning=function(){};var tW8={},DkN={};g.q=lY.prototype;g.q.setTimeout=function(v){this.WH=v}; g.q.Fr=function(v){v=v.target;var J=this.RY;J&&g.r5(v)==3?J.gD():this.Ol(v)}; g.q.Ol=function(v){try{if(v==this.T)a:{var J=g.r5(this.T),G=this.T.X,K=this.T.getStatus();if(!(J<3)&&(J!=3||this.T&&(this.X.X||g.EZ(this.T)||g.e7(this.T)))){this.qr||J!=4||G==7||(G==8||K<=0?zr(3):zr(2));hOG(this);var V=this.T.getStatus();this.o$=V;var Y=P$L(this);if(this.j=V==200){if(this.d_&&!this.Gi){b:{if(this.T){var r=g.Pt(this.T,"X-HTTP-Initial-Response");if(r&&!g.s8(r)){var E=r;break b}}E=null}if(v=E)this.Gi=!0,Lm6(this,v);else{this.j=!1;this.J=3;ng(12);pg(this);Lg(this);break a}}if(this.Mr){v= !0;for(var e;!this.qr&&this.K0&&!this.g_&&(this.g_=!0,this.Z.yH(this)):(pg(this),Lg(this))}else Lm6(this,Y);J==4&&pg(this);this.j&&!this.qr&&(J==4?zO8(this.Z,this):(this.j=!1,Tr(this)))}else g.wRt(this.T),V==400&&Y.indexOf("Unknown SID")> 0?(this.J=3,ng(12)):(this.J=0,ng(13)),pg(this),Lg(this)}}}catch(P){}finally{}}; g.q.cancel=function(){this.qr=!0;pg(this)}; g.q.SI=function(){this.oY=null;var v=Date.now();v-this.Nr>=0?(this.jl!=2&&(zr(3),ng(17)),pg(this),this.J=2,Lg(this)):Ig_(this,this.Nr-v)}; g.q.getLastError=function(){return this.J}; g.q.FN=function(){return this.T};w8L.prototype.cancel=function(){this.Z=UkT(this);if(this.X)this.X.cancel(),this.X=null;else if(this.T&&this.T.size!==0){for(var v=g.n(this.T.values()),J=v.next();!J.done;J=v.next())J.value.cancel();this.T.clear()}};g.q=ZqF.prototype;g.q.Wk=8;g.q.YP=1;g.q.connect=function(v,J,G,K){ng(0);this.R$=v;this.qr=J||{};G&&K!==void 0&&(this.qr.OSID=G,this.qr.OAID=K);this.Gi=this.OR;this.YB=lgA(this,null,this.R$);Us(this)}; g.q.disconnect=function(){gLN(this);if(this.YP==3){var v=this.xB++,J=this.YB.clone();g.Un(J,"SID",this.L);g.Un(J,"RID",v);g.Un(J,"TYPE","terminate");SF(this,J);v=new lY(this,this.L,v);v.jl=2;v.U=bO(J.clone());J=!1;if(g.X2.navigator&&g.X2.navigator.sendBeacon)try{J=g.X2.navigator.sendBeacon(v.U.toString(),"")}catch(G){}!J&&g.X2.Image&&((new Image).src=v.U,J=!0);J||(v.T=EL8(v.Z,null),v.T.send(v.U));v.dh=Date.now();Tr(v)}ADL(this)}; g.q.v8=function(){return this.YP==0}; g.q.getState=function(){return this.YP}; g.q.aV=function(v){if(this.j)if(this.j=null,this.YP==1){if(!v){this.xB=Math.floor(Math.random()*1E5);v=this.xB++;var J=new lY(this,"",v),G=this.N;this.o$&&(G?(G=g.Ni(G),g.HR(G,this.o$)):G=this.o$);this.K!==null||this.Nr||(J.YB=G,G=null);var K;if(this.wh)a:{for(var V=K=0;V4096){K=V;break a}if(K===4096||V===this.Z.length-1){K=V+1;break a}}K= 1E3}else K=1E3;K=cD8(this,J,K);V=this.YB.clone();g.Un(V,"RID",v);g.Un(V,"CVER",22);this.Mr&&g.Un(V,"X-HTTP-Session-Id",this.Mr);SF(this,V);G&&(this.Nr?K="headers="+g.o7(g.ayF(G))+"&"+K:this.K&&g.fu(V,this.K,G));RO_(this.X,J);this.E9&&g.Un(V,"TYPE","init");this.wh?(g.Un(V,"$req",K),g.Un(V,"SID","null"),J.d_=!0,q9_(J,V,null)):q9_(J,V,K);this.YP=2}}else this.YP==3&&(v?NsA(this,v):this.Z.length==0||OqU(this.X)||NsA(this))}; g.q.lE=function(){this.U=null;agX(this);if(this.a$&&!(this.WH||this.T==null||this.yy<=0)){var v=2*this.yy;this.Ze=db((0,g.bj)(this.e4B,this),v)}}; g.q.e4B=function(){this.Ze&&(this.Ze=null,this.Gi=!1,this.WH=!0,ng(10),wb(this),agX(this))}; g.q.yH=function(v){this.T==v&&this.a$&&!this.WH&&(uJT(this),this.WH=!0,ng(11))}; g.q.jI=function(){this.oY!=null&&(this.oY=null,wb(this),dkG(this),ng(19))}; g.q.EPY=function(v){v?ng(2):ng(1)}; g.q.isActive=function(){return!!this.J&&this.J.isActive(this)}; g.q=Hq8.prototype;g.q.wY=function(){}; g.q.Nv=function(){}; g.q.h9=function(){}; g.q.Vx=function(){}; g.q.isActive=function(){return!0}; g.q.JK=function(){};g.Jo(ZV,g.EF);ZV.prototype.open=function(){this.T.J=this.Z;this.j&&(this.T.jl=!0);this.T.connect(this.J,this.X||void 0)}; ZV.prototype.close=function(){this.T.disconnect()}; ZV.prototype.send=function(v){var J=this.T;if(typeof v==="string"){var G={};G.__data__=v;v=G}else this.L&&(G={},G.__data__=g.NC(v),v=G);J.Z.push(new yDG(J.Bv++,v));J.YP==3&&Us(J)}; ZV.prototype.X4=function(){this.T.J=null;delete this.Z;this.T.disconnect();delete this.T;ZV.Yr.X4.call(this)}; g.Jo(QPF,$kA);g.Jo(WmF,vLF);g.Jo(fg,Hq8);fg.prototype.wY=function(){this.T.dispatchEvent("m")}; fg.prototype.Nv=function(v){this.T.dispatchEvent(new QPF(v))}; fg.prototype.h9=function(v){this.T.dispatchEvent(new WmF(v))}; fg.prototype.Vx=function(){this.T.dispatchEvent("n")};var gb=new g.EF;g.z(j2N,g.FM);g.q=k9.prototype;g.q.ax=null;g.q.SQ=!1;g.q.s3=null;g.q.yq=null;g.q.kf=null;g.q.t6=null;g.q.j0=null;g.q.Qr=null;g.q.fB=null;g.q.mJ=null;g.q.A6=0;g.q.cI=null;g.q.b$=null;g.q.VF=null;g.q.CN=-1;g.q.XA=!0;g.q.J4=!1;g.q.YQ=0;g.q.Tf=null;var oq_={},GBA={};g.q=k9.prototype;g.q.setTimeout=function(v){this.X=v}; g.q.k8=function(v){v=v.target;var J=this.Tf;J&&g.r5(v)==3?J.gD():this.Ew(v)}; g.q.Ew=function(v){try{if(v==this.mJ)a:{var J=g.r5(this.mJ),G=this.mJ.X,K=this.mJ.getStatus();if(g.KI&&!g.II("420+")){if(J<4)break a}else if(J<3||J==3&&!g.EZ(this.mJ))break a;this.J4||J!=4||G==7||(G==8||K<=0?this.T.Ie(3):this.T.Ie(2));YTm(this);var V=this.mJ.getStatus();this.CN=V;var Y=g.EZ(this.mJ);if(this.SQ=V==200){J==4&&c3(this);if(this.Mr){for(v=!0;!this.J4&&this.A60?(this.VF=3,XA(13)):(this.VF=0,XA(14)),c3(this),rP8(this)}}catch(E){}finally{}}; g.q.cancel=function(){this.J4=!0;c3(this)}; g.q.CP=function(){this.s3=null;var v=Date.now();v-this.yq>=0?(this.t6!=2&&this.T.Ie(3),c3(this),this.VF=2,XA(18),rP8(this)):VQN(this,this.yq-v)}; g.q.getLastError=function(){return this.VF};g.q=PKX.prototype;g.q.SL=null;g.q.Gk=null;g.q.CE=!1;g.q.jL=null;g.q.KD=null;g.q.fO=-1;g.q.Xi=null;g.q.B9=null;g.q.connect=function(v){this.jL=v;v=aH(this.T,null,this.jL);XA(3);Date.now();var J=this.T.N;J!=null?(this.Xi=J[0],(this.B9=J[1])?(this.KD=1,Dlm(this)):(this.KD=2,tQo(this))):(jF(v,"MODE","init"),this.Gk=new k9(this),this.Gk.ax=this.SL,vqG(this.Gk,v,!1,null,!0),this.KD=0)}; g.q.HS=function(v){if(v)this.KD=2,tQo(this);else{XA(4);var J=this.T;J.bf=J.rg.fO;Mt(J,9)}v&&this.Ie(2)}; g.q.qg=function(v){return this.T.qg(v)}; g.q.abort=function(){this.Gk&&(this.Gk.cancel(),this.Gk=null);this.fO=-1}; g.q.v8=function(){return!1}; g.q.Hm=function(v,J){this.fO=v.CN;if(this.KD==0)if(J){try{var G=this.X.parse(J)}catch(K){v=this.T;v.bf=this.fO;Mt(v,2);return}this.Xi=G[0];this.B9=G[1]}else v=this.T,v.bf=this.fO,Mt(v,2);else this.KD==2&&(this.CE?(XA(7),Date.now()):J=="11111"?(XA(6),this.CE=!0,Date.now(),this.fO=200,this.Gk.cancel(),XA(12),Ag(this.T,this,!0)):(XA(8),Date.now(),this.CE=!1))}; g.q.Fd=function(){this.fO=this.Gk.CN;if(this.Gk.SQ)this.KD==0?this.B9?(this.KD=1,Dlm(this)):(this.KD=2,tQo(this)):this.KD==2&&(this.CE?(XA(12),Ag(this.T,this,!0)):(XA(11),Ag(this.T,this,!1)));else{this.KD==0?XA(9):this.KD==2&&XA(10);var v=this.T;this.Gk.getLastError();v.bf=this.fO;Mt(v,2)}}; g.q.KN=function(){return this.T.KN()}; g.q.isActive=function(){return this.T.isActive()}; g.q.Ie=function(v){this.T.Ie(v)};g.q=BIY.prototype;g.q.D7=null;g.q.DY=null;g.q.PC=null;g.q.FF=null;g.q.C_=null;g.q.cZ=null;g.q.uP=null;g.q.JE=null;g.q.mI=0;g.q.DN=0;g.q.y$=null;g.q.FD=null;g.q.hN=null;g.q.Np=null;g.q.rg=null;g.q.Nf=null;g.q.Yx=-1;g.q.oP=-1;g.q.bf=-1;g.q.n4=0;g.q.L4=0;g.q.hZ=8;g.Jo(hD_,g.FM);g.Jo(zDN,g.FM);g.q=BIY.prototype;g.q.connect=function(v,J,G,K,V){XA(0);this.C_=J;this.DY=G||{};K&&V!==void 0&&(this.DY.OSID=K,this.DY.OAID=V);this.U?(uY((0,g.bj)(this.Kr,this,v),100),dlN(this)):this.Kr(v)}; g.q.disconnect=function(){s28(this);if(this.T==3){var v=this.mI++,J=this.cZ.clone();g.Un(J,"SID",this.L);g.Un(J,"RID",v);g.Un(J,"TYPE","terminate");H3(this,J);v=new k9(this,this.L,v);v.t6=2;v.j0=bO(J.clone());(new Image).src=v.j0.toString();v.kf=Date.now();JP6(v)}xl6(this)}; g.q.Kr=function(v){this.rg=new PKX(this);this.rg.SL=this.D7;this.rg.X=this.J;this.rg.connect(v)}; g.q.v8=function(){return this.T==0}; g.q.getState=function(){return this.T}; g.q.QQ=function(v){this.FD=null;Lg8(this,v)}; g.q.TU=function(){this.hN=null;this.FF=new k9(this,this.L,"rpc",this.K);this.FF.ax=this.D7;this.FF.YQ=0;var v=this.uP.clone();g.Un(v,"RID","rpc");g.Un(v,"SID",this.L);g.Un(v,"CI",this.Nf?"0":"1");g.Un(v,"AID",this.Yx);H3(this,v);g.Un(v,"TYPE","xmlhttp");vqG(this.FF,v,!0,this.JE,!1)}; g.q.Hm=function(v,J){if(this.T!=0&&(this.FF==v||this.PC==v))if(this.bf=v.CN,this.PC==v&&this.T==3)if(this.hZ>7){try{var G=this.J.parse(J)}catch(K){G=null}if(Array.isArray(G)&&G.length==3)if(v=G,v[0]==0)a:{if(!this.hN){if(this.FF)if(this.FF.kf+3E30)){if(K=J==1)this.PC||this.FD||this.T==1||this.n4>=2?K=!1:(this.FD=uY((0,g.bj)(this.QQ,this,v),w9Y(this,this.n4)),this.n4++, K=!0);K=!(K||J==2&&OPX(this))}if(K)switch(G){case 1:Mt(this,5);break;case 4:Mt(this,10);break;case 3:Mt(this,6);break;case 7:Mt(this,12);break;default:Mt(this,2)}}}; g.q.KP=function(v){if(!g.WN(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.q.w8Y=function(v){v?XA(2):(XA(1),UlL(this,8))}; g.q.qg=function(v){if(v)throw Error("Can't create secondary domain capable XhrIo object.");v=new g.K2;v.K=!1;return v}; g.q.isActive=function(){return!!this.y$&&this.y$.isActive(this)}; g.q.Ie=function(v){var J=gb;J.dispatchEvent(new zDN(J,v))}; g.q.KN=function(){return!1}; g.q=mlS.prototype;g.q.X2=function(){}; g.q.Ar=function(){}; g.q.dl=function(){}; g.q.bP=function(){}; g.q.kQ=function(){}; g.q.pL=function(){return{}}; g.q.isActive=function(){return!0};g.q=STT.prototype;g.q.enqueue=function(v){this.X.push(v)}; g.q.isEmpty=function(){return this.T.length===0&&this.X.length===0}; g.q.clear=function(){this.T=[];this.X=[]}; g.q.contains=function(v){return g.WN(this.T,v)||g.WN(this.X,v)}; g.q.remove=function(v){var J=this.T;var G=(0,g.OfG)(J,v);G>=0?(g.bU(J,G),J=!0):J=!1;return J||g.j5(this.X,v)}; g.q.uj=function(){for(var v=[],J=this.T.length-1;J>=0;--J)v.push(this.T[J]);J=this.X.length;for(var G=0;G=rtm.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(v=rtm[this.X],this.PO=g.By((0,g.bj)(this.SP,this),v),this.X++):this.publish("pairingFailed",Error("Server error "+v.status))}; g.q.IN=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var rtm=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Jo(Vk,o0);g.q=Vk.prototype;g.q.start=function(){KA(this)&&this.publish("screenChange");!g.fq("yt-remote-lounge-token-expiration")&&tg8(this);g.hh(this.T);this.T=g.By((0,g.bj)(this.start,this),1E4)}; g.q.add=function(v,J){KA(this);EEN(this,v);YB(this,!1);this.publish("screenChange");J(v);v.token||tg8(this)}; g.q.remove=function(v,J){var G=KA(this);P5U(this,v)&&(YB(this,!1),G=!0);J(v);G&&this.publish("screenChange")}; g.q.f9=function(v,J,G,K){var V=KA(this),Y=this.get(v.id);Y?(Y.name!=J&&(Y.name=J,YB(this,!1),V=!0),G(v)):K(Error("no such local screen."));V&&this.publish("screenChange")}; g.q.X4=function(){g.hh(this.T);Vk.Yr.X4.call(this)}; g.q.Z7l=function(v){KA(this);var J=this.screens.length;v=v&&v.screens||[];for(var G=v.length,K=0;K20)break a;E=J(Y,r)}Y=E}V.name=Y}G(EV(this,V))},this), onError:(0,g.bj)(function(V){K(Error("pairing request failed: "+V.status))},this), onTimeout:(0,g.bj)(function(){K(Error("pairing request timed out."))},this)})}; g.q.X4=function(){g.rT(this.X);g.rT(this.T);qz.Yr.X4.call(this)}; g.q.Fib=function(){LzS(this);this.publish("screenChange");this.T.update()}; qz.prototype.dispose=qz.prototype.dispose;g.Jo(eB,g.qU);g.q=eB.prototype;g.q.TH=function(v){this.Sl()||(v&&(DO(this,""+v),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.q.info=function(v){iV(this.Mr,v)}; g.q.LL=function(){return null}; g.q.Q2=function(v){var J=this.X;v?(J.displayStatus=new chrome.cast.ReceiverDisplayStatus(v,[]),J.displayStatus.showStop=!0):J.displayStatus=null;chrome.cast.setReceiverDisplayStatus(J,(0,g.bj)(function(){this.info("Updated receiver status for "+J.friendlyName+": "+v)},this),(0,g.bj)(function(){DO(this,"Failed to update receiver status for: "+J.friendlyName)},this))}; g.q.X4=function(){this.Q2("");eB.Yr.X4.call(this)};g.z(t7,eB);g.q=t7.prototype;g.q.oZ=function(v){if(this.Z){if(this.Z==v)return;DO(this,"Overriding cast session with new session object");XOA(this);this.dh=!1;this.N="unknown";this.Z.removeUpdateListener(this.Ti);this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ze)}this.Z=v;this.Z.addUpdateListener(this.Ti);this.Z.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ze);Sa6(this,"getMdxSessionStatus")}; g.q.M8=function(v){this.info("launchWithParams no-op for Cast: "+g.NC(v))}; g.q.stop=function(){this.Z?this.Z.stop((0,g.bj)(function(){this.TH()},this),(0,g.bj)(function(){this.TH(Error("Failed to stop receiver app."))},this)):this.TH(Error("Stopping cast device without session."))}; g.q.Q2=function(){}; g.q.X4=function(){this.info("disposeInternal");XOA(this);this.Z&&(this.Z.removeUpdateListener(this.Ti),this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ze));this.Z=null;eB.prototype.X4.call(this)}; g.q.VKh=function(v,J){if(!this.Sl())if(J)if(J=iY(J),g.ML(J))switch(v=""+J.type,J=J.data||{},this.info("onYoutubeMessage_: "+v+" "+g.NC(J)),v){case "mdxSessionStatus":U2S(this,J);break;case "loungeToken":fUA(this,J);break;default:DO(this,"Unknown youtube message: "+v)}else DO(this,"Unable to parse message.");else DO(this,"No data in message.")}; g.q.wc=function(v,J,G,K){g.hh(this.U);this.U=0;lUT(this.L,this.X.label,v,this.X.friendlyName,(0,g.bj)(function(V){V?J(V):K>=0?(DO(this,"Screen "+v+" appears to be offline. "+K+" retries left."),this.U=g.By((0,g.bj)(this.wc,this,v,J,G,K-1),300)):G(Error("Unable to fetch screen."))},this),G)}; g.q.LL=function(){return this.Z}; g.q.x8=function(v){this.Sl()||v||(DO(this,"Cast session died."),this.TH())};g.z(Bc,eB);g.q=Bc.prototype;g.q.oZ=function(v){this.Z=v;this.Z.addUpdateListener(this.qr)}; g.q.M8=function(v){this.YB=v;this.oY()}; g.q.stop=function(){Mg6(this);this.Z?this.Z.stop((0,g.bj)(this.TH,this,null),(0,g.bj)(this.TH,this,"Failed to stop DIAL device.")):this.TH()}; g.q.X4=function(){Mg6(this);this.Z&&this.Z.removeUpdateListener(this.qr);this.Z=null;eB.prototype.X4.call(this)}; g.q.iW=function(v){this.Sl()||v||(DO(this,"DIAL session died."),this.J(),this.J=function(){},this.TH())};g.z(zJ,eB);zJ.prototype.stop=function(){this.TH()}; zJ.prototype.oZ=function(){}; zJ.prototype.M8=function(){g.hh(this.Z);this.Z=NaN;var v=rb(this.L.oo(),this.X.label);v?Pc(this,v):this.TH(Error("No such screen"))}; zJ.prototype.X4=function(){g.hh(this.Z);this.Z=NaN;eB.prototype.X4.call(this)};g.z(nA,g.qU);g.q=nA.prototype; g.q.init=function(v,J){chrome.cast.timeout.requestSession=3E4;var G=new chrome.cast.SessionRequest(this.U,[chrome.cast.Capability.AUDIO_OUT]);g.dx("desktop_enable_cast_connect")&&(G.androidReceiverCompatible=!0);this.N||(G.dialRequest=new chrome.cast.DialRequest("YouTube"));var K=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;v=v||this.j?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var V=(0,g.bj)(this.HiB,this);G=new chrome.cast.ApiConfig(G,(0,g.bj)(this.lI, this),V,K,v);G.customDialLaunchCallback=(0,g.bj)(this.Fs4,this);chrome.cast.initialize(G,(0,g.bj)(function(){this.Sl()||(chrome.cast.addReceiverActionListener(this.J),VgS(),this.X.subscribe("onlineScreenChange",(0,g.bj)(this.nL,this)),this.Z=C5T(this),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bj)(function(Y){this.mT("Failed to set initial custom receivers: "+g.NC(Y))},this)),this.publish("yt-remote-cast2-availability-change",sV(this)),J(!0))},this),(0,g.bj)(function(Y){this.mT("Failed to initialize API: "+ g.NC(Y)); J(!1)},this))}; g.q.eZ7=function(v,J){dN("Setting connected screen ID: "+v+" -> "+J);if(this.T){var G=this.T.T;if(!v||G&&G.id!=v)dN("Unsetting old screen status: "+this.T.X.friendlyName),R0(this,null)}if(v&&J){if(!this.T){v=rb(this.X.oo(),v);if(!v){dN("setConnectedScreenStatus: Unknown screen.");return}if(v.idType=="shortLived"){dN("setConnectedScreenStatus: Screen with id type to be short lived.");return}G=QkA(this,v);G||(dN("setConnectedScreenStatus: Connected receiver not custom..."),G=new chrome.cast.Receiver(v.uuid? v.uuid:v.id,v.name),G.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Z.push(G),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bj)(function(K){this.mT("Failed to set initial custom receivers: "+g.NC(K))},this))); dN("setConnectedScreenStatus: new active receiver: "+G.friendlyName);R0(this,new zJ(this.X,G),!0)}this.T.Q2(J)}else dN("setConnectedScreenStatus: no screen.")}; g.q.Zsh=function(v){this.Sl()?this.mT("Setting connection data on disposed cast v2"):this.T?this.T.M8(v):this.mT("Setting connection data without a session")}; g.q.Og=function(){this.Sl()?this.mT("Stopping session on disposed cast v2"):this.T?(this.T.stop(),R0(this,null)):dN("Stopping non-existing session")}; g.q.requestSession=function(){chrome.cast.requestSession((0,g.bj)(this.lI,this),(0,g.bj)(this.YNH,this))}; g.q.X4=function(){this.X.unsubscribe("onlineScreenChange",(0,g.bj)(this.nL,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.J);var v=Gwm,J=g.NL("yt.mdx.remote.debug.handlers_");g.j5(J||[],v);g.rT(this.T);g.qU.prototype.X4.call(this)}; g.q.mT=function(v){iV("Controller",v)}; g.q.Vz=function(v,J){this.T==v&&(J||R0(this,null),this.publish("yt-remote-cast2-session-change",J))}; g.q.NB4=function(v,J){if(!this.Sl())if(v)switch(v.friendlyName=chrome.cast.unescape(v.friendlyName),dN("onReceiverAction_ "+v.label+" / "+v.friendlyName+"-- "+J),J){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.X.label!=v.label)dN("onReceiverAction_: Stopping active receiver: "+this.T.X.friendlyName),this.T.stop();else{dN("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(v.receiverType){case chrome.cast.ReceiverType.CUSTOM:R0(this, new zJ(this.X,v));break;case chrome.cast.ReceiverType.DIAL:R0(this,new Bc(this.X,v,this.L,this.config_));break;case chrome.cast.ReceiverType.CAST:R0(this,new t7(this.X,v,this.config_));break;default:this.mT("Unknown receiver type: "+v.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.X.label==v.label?this.T.stop():this.mT("Stopping receiver w/o session: "+v.friendlyName)}else this.mT("onReceiverAction_ called without receiver.")}; g.q.Fs4=function(v){if(this.Sl())return Promise.reject(Error("disposed"));var J=v.receiver;J.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.mT("Not DIAL receiver: "+J.friendlyName),J.receiverType=chrome.cast.ReceiverType.DIAL);var G=this.T?this.T.X:null;if(!G||G.label!=J.label)return this.mT("Receiving DIAL launch request for non-clicked DIAL receiver: "+J.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(G&&G.label==J.label&&G.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return dN("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.mT('Changing CAST intent from "'+G.receiverType+'" to "dial" for '+J.friendlyName);R0(this,new Bc(this.X,J,this.L,this.config_))}J=this.T;J.U=v;J.U.appState==chrome.cast.DialAppState.RUNNING?(v=J.U.extraData||{},G=v.screenId||null,I0(J)&&v.loungeToken?v.loungeTokenRefreshIntervalMs?v=A$S(J,{name:J.X.friendlyName,screenId:v.screenId,loungeToken:v.loungeToken,dialId:J.U.receiver.label, screenIdType:"shortLived"},v.loungeTokenRefreshIntervalMs):(g.b9(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(v)+".")),v=FzT(J,G)):v=FzT(J,G)):v=NeX(J);return v}; g.q.lI=function(v){var J=this;if(!this.Sl()&&!this.j){dN("New cast session ID: "+v.sessionId);var G=v.receiver;if(G.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(G.receiverType==chrome.cast.ReceiverType.CAST)dN("Got resumed cast session before resumed mdx connection."),G.friendlyName=chrome.cast.unescape(G.friendlyName),R0(this,new t7(this.X,G,this.config_),!0);else{this.mT("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var K=this.T.X,V=rb(this.X.oo(), K.label);V&&VO(V,G.label)&&K.receiverType!=chrome.cast.ReceiverType.CAST&&G.receiverType==chrome.cast.ReceiverType.CAST&&(dN("onSessionEstablished_: manual to cast session change "+G.friendlyName),g.rT(this.T),this.T=new t7(this.X,G,this.config_),this.T.subscribe("sessionScreen",(0,g.bj)(this.Vz,this,this.T)),this.T.subscribe("sessionFailed",function(){return WzA(J,J.T)}),this.T.M8(null)); this.T.oZ(v)}}}; g.q.Pb=function(){return this.T?this.T.LL():null}; g.q.YNH=function(v){this.Sl()||(this.mT("Failed to estabilish a session: "+g.NC(v)),v.code!=chrome.cast.ErrorCode.CANCEL&&R0(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.q.HiB=function(v){dN("Receiver availability updated: "+v);if(!this.Sl()){var J=sV(this);this.K=v==chrome.cast.ReceiverAvailability.AVAILABLE;sV(this)!=J&&this.publish("yt-remote-cast2-availability-change",sV(this))}}; g.q.nL=function(){this.Sl()||(this.Z=C5T(this),dN("Updating custom receivers: "+g.NC(this.Z)),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.bj)(function(){this.mT("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",sV(this)))}; nA.prototype.setLaunchParams=nA.prototype.Zsh;nA.prototype.setConnectedScreenStatus=nA.prototype.eZ7;nA.prototype.stopSession=nA.prototype.Og;nA.prototype.getCastSession=nA.prototype.Pb;nA.prototype.requestSession=nA.prototype.requestSession;nA.prototype.init=nA.prototype.init;nA.prototype.dispose=nA.prototype.dispose;var KZ8=[];g.q=OV.prototype; g.q.reset=function(v){this.listId="";this.index=-1;this.videoId="";eQY(this);this.volume=-1;this.muted=!1;v&&(this.index=v.index,this.listId=v.listId,this.videoId=v.videoId,this.playerState=v.playerState,this.volume=v.volume,this.muted=v.muted,this.audioTrackId=v.audioTrackId,this.trackData=v.trackData,this.z_=v.hasPrevious,this.tS=v.hasNext,this.K=v.playerTime,this.j=v.playerTimeAt,this.L=v.seekableStart,this.T=v.seekableEnd,this.J=v.duration,this.U=v.loadedTime,this.Z=v.liveIngestionTime,this.X= !isNaN(this.Z))}; g.q.isPlaying=function(){return this.playerState==1}; g.q.isBuffering=function(){return this.playerState==3}; g.q.b2=function(){return this.playerState==1081}; g.q.y_=function(v){this.J=isNaN(v)?0:v}; g.q.getDuration=function(){return this.X?this.J+UV(this):this.J}; g.q.clone=function(){return new OV(PNm(this))};g.z(ZO,g.qU);g.q=ZO.prototype;g.q.getState=function(){return this.Z}; g.q.Ad=function(){return this.L.getReconnectTimeout()}; g.q.qF=function(){this.L.reconnect()}; g.q.play=function(){gN(this)?(this.T?this.T.play(null,g.Rp,Nz(this,"play")):cc(this,"play"),BgT(this,1,mn(uV(this))),this.publish("remotePlayerChange")):XC(this,this.play)}; g.q.pause=function(){gN(this)?(this.T?this.T.pause(null,g.Rp,Nz(this,"pause")):cc(this,"pause"),BgT(this,2,mn(uV(this))),this.publish("remotePlayerChange")):XC(this,this.pause)}; g.q.seekTo=function(v){if(gN(this)){if(this.T){var J=uV(this),G=new chrome.cast.media.SeekRequest;G.currentTime=v;J.isPlaying()||J.isBuffering()?G.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:G.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(G,g.Rp,Nz(this,"seekTo",{newTime:v}))}else cc(this,"seekTo",{newTime:v});BgT(this,3,v);this.publish("remotePlayerChange")}else XC(this,g.jm(this.seekTo,v))}; g.q.stop=function(){if(gN(this)){this.T?this.T.stop(null,g.Rp,Nz(this,"stopVideo")):cc(this,"stopVideo");var v=uV(this);v.index=-1;v.videoId="";eQY(v);kB(this,v);this.publish("remotePlayerChange")}else XC(this,this.stop)}; g.q.setVolume=function(v,J){if(gN(this)){var G=uV(this);if(this.X){if(G.volume!=v){var K=Math.round(v)/100;this.X.setReceiverVolumeLevel(K,(0,g.bj)(function(){$B("set receiver volume: "+K)},this),(0,g.bj)(function(){this.mT("failed to set receiver volume.")},this))}G.muted!=J&&this.X.setReceiverMuted(J,(0,g.bj)(function(){$B("set receiver muted: "+J)},this),(0,g.bj)(function(){this.mT("failed to set receiver muted.")},this))}else{var V={volume:v, muted:J};G.volume!=-1&&(V.delta=v-G.volume);cc(this,"setVolume",V)}G.muted=J;G.volume=v;kB(this,G)}else XC(this,g.jm(this.setVolume,v,J))}; g.q.Yo=function(v,J){if(gN(this)){var G=uV(this);v={videoId:v};J&&(G.trackData={trackName:J.name,languageCode:J.languageCode,sourceLanguageCode:J.translationLanguage?J.translationLanguage.languageCode:"",languageName:J.languageName,kind:J.kind},v.style=g.NC(J.style),g.HR(v,G.trackData));cc(this,"setSubtitlesTrack",v);kB(this,G)}else XC(this,g.jm(this.Yo,v,J))}; g.q.setAudioTrack=function(v,J){gN(this)?(J=J.getLanguageInfo().getId(),cc(this,"setAudioTrack",{videoId:v,audioTrackId:J}),v=uV(this),v.audioTrackId=J,kB(this,v)):XC(this,g.jm(this.setAudioTrack,v,J))}; g.q.playVideo=function(v,J,G,K,V,Y,r){K=K===void 0?null:K;V=V===void 0?null:V;Y=Y===void 0?null:Y;r=r===void 0?null:r;var E=uV(this),e={videoId:v};G!==void 0&&(e.currentIndex=G);SB(E,v,G||0);J!==void 0&&(xB(E,J),e.currentTime=J);K&&(e.listId=K);V&&(e.playerParams=V);Y&&(e.clickTrackingParams=Y);r&&(e.locationInfo=g.NC(r));cc(this,"setPlaylist",e);K||kB(this,E)}; g.q.Y1=function(v,J){if(gN(this)){if(v&&J){var G=uV(this);SB(G,v,J);kB(this,G)}cc(this,"previous")}else XC(this,g.jm(this.Y1,v,J))}; g.q.nextVideo=function(v,J){if(gN(this)){if(v&&J){var G=uV(this);SB(G,v,J);kB(this,G)}cc(this,"next")}else XC(this,g.jm(this.nextVideo,v,J))}; g.q.xw=function(){if(gN(this)){cc(this,"clearPlaylist");var v=uV(this);v.reset();kB(this,v);this.publish("remotePlayerChange")}else XC(this,this.xw)}; g.q.Vp=function(){gN(this)?cc(this,"dismissAutoplay"):XC(this,this.Vp)}; g.q.dispose=function(){if(this.Z!=3){var v=this.Z;this.Z=3;this.publish("proxyStateChange",v,this.Z)}g.qU.prototype.dispose.call(this)}; g.q.X4=function(){t3L(this);this.L=null;this.J.clear();fA(this,null);g.qU.prototype.X4.call(this)}; g.q.er=function(v){if((v!=this.Z||v==2)&&this.Z!=3&&v!=0){var J=this.Z;this.Z=v;this.publish("proxyStateChange",J,v);if(v==1)for(;!this.J.isEmpty();)J=v=this.J,J.T.length===0&&(J.T=J.X,J.T.reverse(),J.X=[]),v.T.pop().apply(this);else v==3&&this.dispose()}}; g.q.V3b=function(v,J){this.publish(v,J)}; g.q.ZKH=function(v){if(!v)this.H0(null),fA(this,null);else if(this.X.receiver.volume){v=this.X.receiver.volume;var J=uV(this),G=Math.round(100*v.level||0);if(J.volume!=G||J.muted!=v.muted)$B("Cast volume update: "+v.level+(v.muted?" muted":"")),J.volume=G,J.muted=!!v.muted,kB(this,J)}}; g.q.H0=function(v){$B("Cast media: "+!!v);this.T&&this.T.removeUpdateListener(this.U);if(this.T=v)this.T.addUpdateListener(this.U),IE6(this),this.publish("remotePlayerChange")}; g.q.pOr=function(v){v?(IE6(this),this.publish("remotePlayerChange")):this.H0(null)}; g.q.lc=function(){cc(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.q.vLi=function(){var v=r0X();v&&fA(this,v)}; g.q.mT=function(v){iV("CP",v)};g.z(FC,g.qU);g.q=FC.prototype; g.q.connect=function(v,J){if(J){var G=J.listId,K=J.videoId,V=J.videoIds,Y=J.playerParams,r=J.clickTrackingParams,E=J.index,e={videoId:K},P=J.currentTime,D=J.locationInfo;J=J.loopMode;P!==void 0&&(e.currentTime=P<=5?0:P);Y&&(e.playerParams=Y);D&&(e.locationInfo=D);r&&(e.clickTrackingParams=r);G&&(e.listId=G);V&&V.length>0&&(e.videoIds=V.join(","));E!==void 0&&(e.currentIndex=E);this.qr&&(e.loopMode=J||"LOOP_MODE_OFF");G&&(this.T.listId=G);this.T.videoId=K;this.T.index=E||0;this.T.state=3;xB(this.T, P);this.J="UNSUPPORTED";G=this.qr?"setInitialState":"setPlaylist";a0("Connecting with "+G+" and params: "+g.NC(e));this.X.connect({method:G,params:g.NC(e)},v,f8L())}else a0("Connecting without params"),this.X.connect({},v,f8L());doA(this)}; g.q.b8=function(v){this.X.b8(v)}; g.q.dispose=function(){this.Sl()||(g.ks("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),A7(this,3));g.qU.prototype.dispose.call(this)}; g.q.X4=function(){sbT(this);lEA(this);RQm(this);g.hh(this.U);this.U=NaN;g.hh(this.N);this.N=NaN;this.L=null;g.l$(this.oY);this.oY.length=0;this.X.dispose();g.qU.prototype.X4.call(this);this.J=this.K=this.Z=this.T=this.X=null}; g.q.wV=function(v){if(!this.Z||this.Z.length===0)return!1;for(var J=g.n(this.Z),G=J.next();!G.done;G=J.next())if(!G.value.capabilities.has(v))return!1;return!0}; g.q.fv=function(){var v=3;this.Sl()||(v=0,isNaN(this.l6())?this.X.sZ()&&isNaN(this.j)&&(v=1):v=2);return v}; g.q.eq=function(v){a0("Disconnecting with "+v);g.ks("yt.mdx.remote.remoteClient_",null);sbT(this);this.publish("beforeDisconnect",v);v==1&&eF();this.X.disconnect(v);this.dispose()}; g.q.PF=function(){var v=this.T;this.L&&(v=this.T.clone(),SB(v,this.L,v.index));return PNm(v)}; g.q.sKt=function(v){var J=this,G=new OV(v);G.videoId&&G.videoId!=this.T.videoId&&(this.L=G.videoId,g.hh(this.U),this.U=g.By(function(){if(J.L){var V=J.L;J.L=null;J.T.videoId!=V&&Hc(J,"getNowPlaying")}},5E3)); var K=[];this.T.listId==G.listId&&this.T.videoId==G.videoId&&this.T.index==G.index||K.push("remoteQueueChange");this.T.playerState==G.playerState&&this.T.volume==G.volume&&this.T.muted==G.muted&&mn(this.T)==mn(G)&&g.NC(this.T.trackData)==g.NC(G.trackData)||K.push("remotePlayerChange");this.T.reset(v);g.PW(K,function(V){this.publish(V)},this)}; g.q.Ws=function(){var v=this.X.getDeviceId(),J=g.MS(this.Z,function(G){return G.type=="REMOTE_CONTROL"&&G.id!=v}); return J?J.id:""}; g.q.l6=function(){return this.X.Ad()}; g.q.jz=function(){return this.J||"UNSUPPORTED"}; g.q.J8=function(){return this.K||""}; g.q.Wb=function(){!isNaN(this.l6())&&this.X.qF()}; g.q.Am7=function(v,J){Hc(this,v,J);poS(this)}; g.q.yQ=function(){var v=g.uR("SAPISID","")||g.uR("__Secure-1PAPISID")||"",J=g.uR("__Secure-3PAPISID","")||"";if(!v&&!J)return"";v=g.hE(g.nG(v),2);J=g.hE(g.nG(J),2);return g.hE(g.nG(","+v+","+J),2)}; FC.prototype.subscribe=FC.prototype.subscribe;FC.prototype.unsubscribeByKey=FC.prototype.nJ;FC.prototype.getProxyState=FC.prototype.fv;FC.prototype.disconnect=FC.prototype.eq;FC.prototype.getPlayerContextData=FC.prototype.PF;FC.prototype.setPlayerContextData=FC.prototype.sKt;FC.prototype.getOtherConnectedRemoteId=FC.prototype.Ws;FC.prototype.getReconnectTimeout=FC.prototype.l6;FC.prototype.getAutoplayMode=FC.prototype.jz;FC.prototype.getAutoplayVideoId=FC.prototype.J8;FC.prototype.reconnect=FC.prototype.Wb; FC.prototype.sendMessage=FC.prototype.Am7;FC.prototype.getXsrfToken=FC.prototype.yQ;FC.prototype.isCapabilitySupportedOnConnectedDevices=FC.prototype.wV;g.z(gZT,o0);g.q=gZT.prototype;g.q.oo=function(v){return this.IK.$_gs(v)}; g.q.contains=function(v){return!!this.IK.$_c(v)}; g.q.get=function(v){return this.IK.$_g(v)}; g.q.start=function(){this.IK.$_st()}; g.q.add=function(v,J,G){this.IK.$_a(v,J,G)}; g.q.remove=function(v,J,G){this.IK.$_r(v,J,G)}; g.q.f9=function(v,J,G,K){this.IK.$_un(v,J,G,K)}; g.q.X4=function(){for(var v=this.T.length,J=0;J1&&!this.S.getOption("remote","quickCast")?(this.QF=g.D6(v,this.T,this),this.zk(g.yn(v,this.T)),v=this.S.getOption("remote","currentReceiver"),v=this.T(v),this.options[v]&&this.SJ(v),this.enable(!0)):this.enable(!1)}; eS.prototype.T=function(v){return v.key}; eS.prototype.UA=function(v){return v==="cast-selector-receiver"?"Cast...":this.QF[v].name}; eS.prototype.jf=function(v){g.Uq.prototype.jf.call(this,v);this.S.setOption("remote","currentReceiver",this.QF[v]);this.Mi.FO()};g.z(KsA,g.YQ);g.q=KsA.prototype; g.q.create=function(){var v=this.player.B(),J=g.ZR(v);v={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:v.C("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:v.C("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:v.C("enable_cast_short_lived_lounge_token")};aE8(J,v);this.subscriptions.push(g.Kr("yt-remote-before-disconnect",this.cPi,this));this.subscriptions.push(g.Kr("yt-remote-connection-change",this.u57,this));this.subscriptions.push(g.Kr("yt-remote-receiver-availability-change",this.P6, this));this.subscriptions.push(g.Kr("yt-remote-auto-connect",this.E2l,this));this.subscriptions.push(g.Kr("yt-remote-receiver-resumed",this.w1i,this));this.subscriptions.push(g.Kr("mdx-privacy-popup-confirm",this.nrY,this));this.subscriptions.push(g.Kr("mdx-privacy-popup-cancel",this.LTi,this));this.P6()}; g.q.load=function(){this.player.cancelPlayback();g.YQ.prototype.load.call(this);this.tV=new om6(this);this.player.Ap(this.tV);this.Io=new $TA(this,this.player,this.LK);var v=(v=br6())?v.currentTime:0;var J=Qb8()?new ZO(JR(),void 0):null;v==0&&J&&(v=mn(uV(J)));v!==0&&this.kL(v);VD6(this,this.Gr,this.Gr);this.player.Yh(6)}; g.q.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.iy();this.i8=this.EF;g.qS(this.Io,this.LK);this.LK=this.tV=this.Io=null;g.YQ.prototype.unload.call(this);this.player.Yh(5);PS(this)}; g.q.X4=function(){g.Vy(this.subscriptions);g.YQ.prototype.X4.call(this)}; g.q.m9=function(v){var J=g.Om.apply(1,arguments);this.loaded&&this.Io.Vt.apply(this.Io,[v].concat(g.l(J)))}; g.q.getAdState=function(){return this.UJ}; g.q.z_=function(){return this.LK?uV(this.LK).z_:!1}; g.q.tS=function(){return this.LK?uV(this.LK).tS:!1}; g.q.kL=function(v,J){this.dn=v||0;this.player.publish("progresssync",v,J);this.player.Tr("onVideoProgress",v||0)}; g.q.getCurrentTime=function(){return this.dn}; g.q.getProgressState=function(){var v=uV(this.LK),J=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!v.b2()&&this.player.rK(),clipEnd:J.clipEnd,clipStart:J.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:v.getDuration(),ingestionTime:v.X?v.Z+UV(v):v.Z,isAtLiveHead:(v.X?v.T+UV(v):v.T)-this.getCurrentTime()<=1,loaded:v.U,seekableEnd:v.X?v.T+UV(v):v.T,seekableStart:v.L>0?v.L+UV(v):v.L,offset:0,viewerLivestreamJoinMediaTime:0}}; g.q.nextVideo=function(){this.LK&&this.LK.nextVideo()}; g.q.Y1=function(){this.LK&&this.LK.Y1()}; g.q.cPi=function(v){v===1&&(this.YX=this.LK?uV(this.LK):null)}; g.q.u57=function(){var v=Qb8()?new ZO(JR(),void 0):null;if(v){var J=this.i8;this.loaded&&this.unload();this.LK=v;this.YX=null;J.key!==this.EF.key&&(this.i8=J,this.load())}else g.rT(this.LK),this.LK=null,this.loaded&&(this.unload(),(v=this.YX)&&v.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(v.videoId,mn(v)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.q.P6=function(){var v=[this.EF],J=v.concat,G=A0Y();LA()&&g.fq("yt-remote-cast-available")&&G.push({key:"cast-selector-receiver",name:"Cast..."});this.QF=J.call(v,G);v=HrY()||this.EF;Di(this,v);this.player.Tr("onMdxReceiversChange")}; g.q.E2l=function(){var v=HrY();Di(this,v)}; g.q.w1i=function(){this.i8=HrY()}; g.q.nrY=function(){this.j7=!0;PS(this);V6=!1;GF&&KU(GF,1);GF=null}; g.q.LTi=function(){this.j7=!1;PS(this);Di(this,this.EF);this.i8=this.EF;V6=!1;GF=null;this.player.playVideo()}; g.q.jJ=function(v,J){switch(v){case "casting":return this.loaded;case "receivers":return this.QF;case "currentReceiver":return J&&(J.key==="cast-selector-receiver"?q0A():Di(this,J)),this.loaded?this.i8:this.EF;case "quickCast":return this.QF.length===2&&this.QF[1].key==="cast-selector-receiver"?(J&&q0A(),!0):!1}}; g.q.lc=function(){this.LK.lc()}; g.q.Ff=function(){return!1}; g.q.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.q.isLoggedIn=function(){var v,J;return((v=g.H$("PLAYER_CONFIG"))==null?void 0:(J=v.args)==null?void 0:J.authuser)!==void 0?!0:!(!g.H$("SESSION_INDEX")&&!g.H$("LOGGED_IN"))};g.Vp("remote",KsA);})(_yt_player);