(function(g){var window=this;'use strict';var jw8=function(m){if(m instanceof g.SO)return m;if(typeof m.cM=="function")return m.cM(!1);if(g.xe(m)){var F=0,L=new g.SO;L.next=function(){for(;;){if(F>=m.length)return g.ld;if(F in m)return g.om(m[F++]);F++}}; return L}throw Error("Not implemented");},Il8=function(m,F,L){if(g.xe(m))g.eq(m,F,L); else for(m=jw8(m);;){var u=m.next();if(u.done)break;F.call(L,u.value,void 0,m)}},Hi=function(m){g.VP(m,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.ke()).toString(36)); return m},J6=function(m,F,L){Array.isArray(L)||(L=[String(L)]); g.rtu(m.V,F,L)},RgC=function(m,F){var L=[]; Il8(F,function(u){try{var q=g.x9.prototype.RE.call(this,u,!0)}catch(A){if(A=="Storage: Invalid value was encountered")return;throw A;}q===void 0?L.push(u):g.DdB(q)&&L.push(u)},m); return L},$cq=function(m,F){RgC(m,F).forEach(function(L){g.x9.prototype.remove.call(this,L)},m)},egC=function(m){if(m.HR){if(m.HR.locationOverrideToken)return{locationOverrideToken:m.HR.locationOverrideToken}; if(m.HR.latitudeE7!=null&&m.HR.longitudeE7!=null)return{latitudeE7:m.HR.latitudeE7,longitudeE7:m.HR.longitudeE7}}return null},PnC=function(m,F){g.nc(m,F)||m.push(F)},iBC=function(m){var F=0,L; for(L in m)F++;return F},gU6=function(m,F){return g.NT(m,F)},zge=function(m){try{return g.DC.JSON.parse(m)}catch(F){}m=String(m); if(/^\s*$/.test(m)?0:/^[\],:{}\s\u2028\u2029]*$/.test(m.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+m+")")}catch(F){}throw Error("Invalid JSON string: "+m);},CO=function(m){if(g.DC.JSON)try{return g.DC.JSON.parse(m)}catch(F){}return zge(m)},YSt=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/channel/opened",g.j6("channel_type"))},alq=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/channel/closed",g.j6("channel_type"))},DcC=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/channel/message_received",g.j6("channel_type"))},TJt=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/channel/success")},NJf=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/channel/error",g.j6("channel_type"),g.j6("error_type"))},pkZ=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Khe=function(){var m=g.hj(); this.X=m;m.d3("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},fl8=function(m,F,L,u){var q=new g.PN(null); m&&g.rJ(q,m);F&&g.iy(q,F);L&&g.yP(q,L);u&&(q.B=u);return q},xct=function(m,F){return new g.L3(m,F)},m9=function(m,F){return Object.prototype.hasOwnProperty.call(m,F)},M4C=function(m,F){return m===F},FI=function(m,F){this.B={}; this.X=[];this.Ey=this.size=0;var L=arguments.length;if(L>1){if(L%2)throw Error("Uneven number of arguments");for(var u=0;u5&&(m=m.slice(m.length-5)); var F=g.xZ(HBR(),function(u){return u.loungeToken}),L=g.xZ(m,function(u){return u.loungeToken}); g.Mr(L,function(u){return!g.nc(F,u)})&&JRC(); g.oh("yt-remote-local-screens",m,31536E3)},lp=function(m){m||(g.tS("yt-remote-session-screen-id"),g.tS("yt-remote-session-video-id")); nUR();m=GS();g.Fd(m,vx());cRt(m)},m58=function(){if(!wS){var m=g.t4(); m&&(wS=new g.p3(m))}},FVC=function(){m58(); return wS?!!wS.get("yt-remote-use-staging-server"):!1},VI=function(m,F){g.BS[m]=!0; var L=g.dt();L&&L.publish.apply(L,arguments);g.BS[m]=!1},LVZ=function(){var m=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return m?parseInt(m[1],10):0},uCC=function(m){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+m)!=-1||document.currentScript.src.indexOf("&"+m)!=-1)},qfC=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},jW=function(m){m.length?A4q(m.shift(),function(){jW(m)}):r4e()},y4e=function(m){return"chrome-extension://"+m+"/cast_sender.js"},A4q=function(m,F,L){var u=document.createElement("script"); u.onerror=F;L&&(u.onload=L);g.Eb(u,g.fd(m));(document.head||document.documentElement).appendChild(u)},GEe=function(){var m=LVZ(),F=[]; if(m>1){var L=m-1;F.push("//www.gstatic.com/eureka/clank/"+m+"/cast_sender.js");F.push("//www.gstatic.com/eureka/clank/"+L+"/cast_sender.js")}return F},r4e=function(){var m=qfC(); m&&m(!1,"No cast extension found")},lfe=function(){if(v9e){var m=2,F=qfC(),L=function(){m--; m==0&&F&&F(!0)}; window.__onGCastApiAvailable=L;A4q("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",r4e,L)}},wqq=function(){lfe(); var m=GEe();m.push("//www.gstatic.com/eureka/clank/cast_sender.js");jW(m)},jPG=function(){lfe(); var m=GEe();m.push.apply(m,g.X(VAC.map(y4e)));m.push("//www.gstatic.com/eureka/clank/cast_sender.js");jW(m)},I7=function(m,F,L){g.O.call(this); this.L=L!=null?(0,g.ER)(m,L):m;this.R6=F;this.Y=(0,g.ER)(this.jh,this);this.X=!1;this.B=0;this.G=this.oH=null;this.V=[]},R7=function(){this.X=g.ke()},IfC=function(){$T||($T=new R7)},R_m=function(){$T||($T=new R7)},eW=function(){},$56=function(){g.L4.call(this,"p")},e_R=function(){g.L4.call(this,"o")},i32=function(){return PTq=PTq||new g.eT},g9f=function(m){g.L4.call(this,"serverreachability",m)},Px=function(m){var F=i32(); F.dispatchEvent(new g9f(F,m))},z_c=function(m){g.L4.call(this,"statevent",m)},ip=function(m){var F=i32(); F.dispatchEvent(new z_c(F,m))},Yff=function(m,F,L,u){g.L4.call(this,"timingevent",m); this.size=F;this.rtt=L;this.retries=u},gS=function(m,F){if(typeof m!=="function")throw Error("Fn must not be null and must be a function"); return g.DC.setTimeout(function(){m()},F)},zS=function(){},a7=function(m,F,L,u){this.G=m; this.V=F;this.nI=L;this.LI=u||1;this.SY=new g.$U(this);this.RW=45E3;this.xC=null;this.L=!1;this.hF=this.Cu=this.W=this.Lu=this.Hb=this.q0=this.Bb=null;this.b9=[];this.X=null;this.Z=0;this.Y=this.ER=null;this.BR=-1;this.jY=!1;this.aW=0;this.AF=null;this.Eu=this.w8=this.HR=this.Qc=!1;this.B=new afc},afc=function(){this.G=null; this.X="";this.B=!1},Tm6=function(m,F,L){m.Lu=1; m.W=Hi(F.clone());m.hF=L;m.Qc=!0;D5C(m,null)},D5C=function(m,F){m.Hb=Date.now(); DK(m);m.Cu=m.W.clone();J6(m.Cu,"t",m.LI);m.Z=0;var L=m.G.w8;m.B=new afc;m.X=Nmc(m.G,L?F:null,!m.hF);m.aW>0&&(m.AF=new g.mV((0,g.ER)(m.HT,m,m.X),m.aW));m.SY.listen(m.X,"readystatechange",m.Lk);F=m.xC?g.Sq(m.xC):{};m.hF?(m.ER||(m.ER="POST"),F["Content-Type"]="application/x-www-form-urlencoded",m.X.send(m.Cu,m.ER,m.hF,F)):(m.ER="GET",m.X.send(m.Cu,m.ER,null,F));Px(1)},KV8=function(m){if(!pqc(m))return g.BV(m.X); var F=g.HV(m.X);if(F==="")return"";var L="",u=F.length,q=g.dE(m.X)==4;if(!m.B.G){if(typeof TextDecoder==="undefined")return TS(m),Nj(m),"";m.B.G=new g.DC.TextDecoder}for(var A=0;AF.length)return ffC;F=F.slice(u,u+L);m.Z=u+L;return F},DK=function(m){m.q0=Date.now()+m.RW; Z3f(m,m.RW)},Z3f=function(m,F){if(m.Bb!=null)throw Error("WatchDog timer not null"); m.Bb=gS((0,g.ER)(m.NA,m),F)},Sf8=function(m){m.Bb&&(g.DC.clearTimeout(m.Bb),m.Bb=null)},Nj=function(m){m.G.ju()||m.jY||o98(m.G,m)},TS=function(m){Sf8(m); g.eO(m.AF);m.AF=null;m.SY.removeAll();if(m.X){var F=m.X;m.X=null;F.abort();F.dispose()}},O3m=function(m,F){try{var L=m.G; if(L.o9!=0&&(L.X==m||Xqe(L.B,m)))if(!m.w8&&Xqe(L.B,m)&&L.o9==3){try{var u=L.K0.X.parse(F)}catch(T){u=null}if(Array.isArray(u)&&u.length==3){var q=u;if(q[0]==0)a:{if(!L.W){if(L.X)if(L.X.Hb+3E30&&(L.aW=1.5*v);u=L;var l=m.s0();if(l){var w=g.JI(l,"X-Client-Wire-Protocol");if(w){var V=u.B;!V.X&&(g.C0(w,"spdy")||g.C0(w,"quic")||g.C0(w,"h2"))&&(V.V=V.Y,V.X=new Set,V.B&&(U52(V,V.B),V.B=null))}if(u.Qc){var I=g.JI(l,"X-HTTP-Session-Id");I&&(u.QV=I,g.VP(u.xC,u.Qc,I))}}L.o9=3;L.Y&&L.Y.e6();L.Th&&(L.Xt=Date.now()-m.Hb);u=L;var R=m;u.pA=kEf(u,u.w8?u.nI:null,u.GY); if(R.w8){h_q(u.B,R);var e=R,a=u.aW;a&&e.setTimeout(a);e.Bb&&(Sf8(e),DK(e));u.X=R}else WV6(u);L.G.length>0&&xT(L)}else A[0]!="stop"&&A[0]!="close"||fj(L,7);else L.o9==3&&(A[0]=="stop"||A[0]=="close"?A[0]=="stop"?fj(L,7):L.disconnect():A[0]!="noop"&&L.Y&&L.Y.Eo(A),L.b9=0)}Px(4)}catch(T){}},QPC=function(m,F){this.X=m; this.map=F;this.context=null},sPe=function(m){this.Y=m||10; g.DC.PerformanceNavigationTiming?(m=g.DC.performance.getEntriesByType("navigation"),m=m.length>0&&(m[0].nextHopProtocol=="hq"||m[0].nextHopProtocol=="h2")):m=!!(g.DC.chrome&&g.DC.chrome.loadTimes&&g.DC.chrome.loadTimes()&&g.DC.chrome.loadTimes().wasFetchedViaSpdy);this.V=m?this.Y:1;this.X=null;this.V>1&&(this.X=new Set);this.B=null;this.G=[]},b3m=function(m){return m.B?!0:m.X?m.X.size>=m.V:!1},E9t=function(m){return m.B?1:m.X?m.X.size:0},Xqe=function(m,F){return m.B?m.B==F:m.X?m.X.has(F):!1},U52= function(m,F){m.X?m.X.add(F):m.B=F},h_q=function(m,F){m.B&&m.B==F?m.B=null:m.X&&m.X.has(F)&&m.X.delete(F)},c4C=function(m){if(m.B!=null)return m.G.concat(m.B.b9); if(m.X!=null&&m.X.size!==0){var F=m.G;m=g.Z(m.X.values());for(var L=m.next();!L.done;L=m.next())F=F.concat(L.value.b9);return F}return g.qT(m.G)},d5R=function(m,F){var L=new zS; if(g.DC.Image){var u=new Image;u.onload=g.UR(Mj,L,"TestLoadImage: loaded",!0,F,u);u.onerror=g.UR(Mj,L,"TestLoadImage: error",!1,F,u);u.onabort=g.UR(Mj,L,"TestLoadImage: abort",!1,F,u);u.ontimeout=g.UR(Mj,L,"TestLoadImage: timeout",!1,F,u);g.DC.setTimeout(function(){if(u.ontimeout)u.ontimeout()},1E4); u.src=m}else F(!1)},n9R=function(m,F){var L=new zS,u=new AbortController,q=setTimeout(function(){u.abort(); Mj(L,"TestPingServer: timeout",!1,F)},1E4); fetch(m,{signal:u.signal}).then(function(A){clearTimeout(q);A.ok?Mj(L,"TestPingServer: ok",!0,F):Mj(L,"TestPingServer: server error",!1,F)}).catch(function(){clearTimeout(q); Mj(L,"TestPingServer: error",!1,F)})},Mj=function(m,F,L,u,q){try{q&&(q.onload=null,q.onerror=null,q.onabort=null,q.ontimeout=null),u(L)}catch(A){}},Bm8=function(){this.X=new eW},ZK=function(m,F,L){return L&&L.qR8?L.qR8[m]||F:F},H3G=function(m){this.G=[]; this.nI=this.pA=this.xC=this.GY=this.X=this.QV=this.Qc=this.jY=this.Z=this.HR=this.hF=null;this.oR=this.Cu=0;this.IR=ZK("failFast",!1,m);this.AF=this.Bb=this.W=this.L=this.Y=null;this.fI=!0;this.rJ=this.Lu=-1;this.LI=this.b9=this.Hb=0;this.rF=ZK("baseRetryDelayMs",5E3,m);this.Av=ZK("retryDelaySeedMs",1E4,m);this.iD=ZK("forwardChannelMaxRetries",2,m);this.Wh=ZK("forwardChannelRequestTimeoutMs",2E4,m);this.zL=m&&m.y$c||void 0;this.Cw=m&&m.f$8||void 0;this.Cj=m&&m.qyc||!1;this.aW=void 0;this.w8=m&&m.vjR|| !1;this.V="";this.B=new sPe(m&&m.HCC);this.YW=Math.min(m&&m.p_8||1E3,1E3);this.K0=new Bm8;this.SY=m&&m.WdF||!1;this.q0=m&&m.wm8||!1;this.SY&&this.q0&&(this.q0=!1);this.Kw=m&&m.SWN||!1;m&&m.aW8&&(this.fI=!1);this.Th=!this.SY&&this.fI&&m&&m.tiP||!1;this.xW=void 0;m&&m.Yd&&m.Yd>0&&(this.xW=m.Yd);this.BR=void 0;this.Xt=0;this.RW=!1;this.Eu=this.ER=null},Kj=function(m){m.X&&(J46(m),m.X.cancel(),m.X=null)},CTR=function(m){Kj(m); m.W&&(g.DC.clearTimeout(m.W),m.W=null);pj(m);m.B.cancel();m.L&&(typeof m.L==="number"&&g.DC.clearTimeout(m.L),m.L=null)},xT=function(m){b3m(m.B)||m.L||(m.L=!0,g.p4(m.Mt,m),m.Hb=0)},F1R=function(m,F){if(E9t(m.B)>=m.B.V-(m.L?1:0))return!1; if(m.L)return m.G=F.b9.concat(m.G),!0;if(m.o9==1||m.o9==2||m.Hb>=(m.IR?0:m.iD))return!1;m.L=gS((0,g.ER)(m.Mt,m,F),mkZ(m,m.Hb));m.Hb++;return!0},uKf=function(m,F){var L; F?L=F.nI:L=m.Cu++;var u=m.xC.clone();g.VP(u,"SID",m.V);g.VP(u,"RID",L);g.VP(u,"AID",m.Lu);SW(m,u);m.Z&&m.hF&&g.Rw(u,m.Z,m.hF);L=new a7(m,m.V,L,m.Hb+1);m.Z===null&&(L.xC=m.hF);F&&(m.G=F.b9.concat(m.G));F=L1t(m,L,m.YW);L.setTimeout(Math.round(m.Wh*.5)+Math.round(m.Wh*.5*Math.random()));U52(m.B,L);Tm6(L,u,F)},SW=function(m,F){m.jY&&g.aZ(m.jY,function(L,u){g.VP(F,u,L)}); m.Y&&g.aZ({},function(L,u){g.VP(F,u,L)})},L1t=function(m,F,L){L=Math.min(m.G.length,L); var u=m.Y?(0,g.ER)(m.Y.Zy,m.Y,m):null;a:{for(var q=m.G,A=-1;;){var r=["count="+L];A==-1?L>0?(A=q[0].X,r.push("ofs="+A)):A=0:r.push("ofs="+A);for(var G=!0,v=0;v=3)return!1; m.LI++;m.W=gS((0,g.ER)(m.vT,m),mkZ(m,m.b9));m.b9++;return!0},J46=function(m){m.ER!=null&&(g.DC.clearTimeout(m.ER),m.ER=null)},qLR=function(m){m.X=new a7(m,m.V,"rpc",m.LI); m.Z===null&&(m.X.xC=m.hF);m.X.aW=0;var F=m.pA.clone();g.VP(F,"RID","rpc");g.VP(F,"SID",m.V);g.VP(F,"AID",m.Lu);g.VP(F,"CI",m.AF?"0":"1");!m.AF&&m.xW&&g.VP(F,"TO",m.xW);g.VP(F,"TYPE","xmlhttp");SW(m,F);m.Z&&m.hF&&g.Rw(F,m.Z,m.hF);m.aW&&m.X.setTimeout(m.aW);var L=m.X;m=m.nI;L.Lu=1;L.W=Hi(F.clone());L.hF=null;L.Qc=!0;D5C(L,m)},pj=function(m){m.Bb!=null&&(g.DC.clearTimeout(m.Bb),m.Bb=null)},o98=function(m,F){var L=null; if(m.X==F){pj(m);J46(m);m.X=null;var u=2}else if(Xqe(m.B,F))L=F.b9,h_q(m.B,F),u=1;else return;if(m.o9!=0)if(F.L)if(u==1){L=F.hF?F.hF.length:0;F=Date.now()-F.Hb;var q=m.Hb;u=i32();u.dispatchEvent(new Yff(u,L,F,q));xT(m)}else WV6(m);else{var A=F.BR;q=F.getLastError();if(q==3||q==0&&A>0||!(u==1&&F1R(m,F)||u==2&&tAG(m)))switch(L&&L.length>0&&(F=m.B,F.G=F.G.concat(L)),q){case 1:fj(m,5);break;case 4:fj(m,10);break;case 3:fj(m,6);break;default:fj(m,2)}}},mkZ=function(m,F){var L=m.rF+Math.floor(Math.random()* m.Av); m.isActive()||(L*=2);return L*F},fj=function(m,F){if(F==2){var L=(0,g.ER)(m.tbb,m),u=m.Cw,q=!u; u=new g.PN(u||"//www.google.com/images/cleardot.gif");g.DC.location&&g.DC.location.protocol=="http"||g.rJ(u,"https");Hi(u);q?d5R(u.toString(),L):n9R(u.toString(),L)}else ip(2);m.o9=0;m.Y&&m.Y.QR(F);A26(m);CTR(m)},A26=function(m){m.o9=0; m.Eu=[];if(m.Y){var F=c4C(m.B);if(F.length!=0||m.G.length!=0)g.ya(m.Eu,F),g.ya(m.Eu,m.G),m.B.G.length=0,g.qT(m.G),m.G.length=0;m.Y.Oo()}},r2q=function(m){if(m.o9==0)return m.Eu; var F=[];g.ya(F,c4C(m.B));g.ya(F,m.G);return F},kEf=function(m,F,L){var u=g.XM(L); u.X!=""?(F&&g.iy(u,F+"."+u.X),g.yP(u,u.G)):(u=g.DC.location,u=fl8(u.protocol,F?F+"."+u.hostname:u.hostname,+u.port,L));F=m.Qc;L=m.QV;F&&L&&g.VP(u,F,L);g.VP(u,"VER",m.VR);SW(m,u);return u},Nmc=function(m,F,L){if(F&&!m.w8)throw Error("Can't create secondary domain capable XhrIo object."); F=m.Cj&&!m.zL?new g.sg(new g.F7({Fz:L})):new g.sg(m.zL);F.Z=m.w8;return F},y2t=function(){},GTC=function(){},XI=function(m,F){g.eT.call(this); this.X=new H3G(F);this.Y=m;this.B=F&&F.fcu||null;m=F&&F.Rd0||null;F&&F.IWC&&(m?m["X-Client-Protocol"]="webchannel":m={"X-Client-Protocol":"webchannel"});this.X.hF=m;m=F&&F.OLu||null;F&&F.Ah&&(m?m["X-WebChannel-Content-Type"]=F.Ah:m={"X-WebChannel-Content-Type":F.Ah});F&&F.Qy&&(m?m["X-WebChannel-Client-Profile"]=F.Qy:m={"X-WebChannel-Client-Profile":F.Qy});this.X.HR=m;(m=F&&F.k5b)&&!g.J9(m)&&(this.X.Z=m);this.L=F&&F.vjR||!1;this.V=F&&F.tR0||!1;(F=F&&F.fCR)&&!g.J9(F)&&(this.X.Qc=F,g.Tb(this.B,F)&&(m= this.B,F in m&&delete m[F]));this.G=new o7(this)},vtG=function(m){$56.call(this); m.__headers__&&(this.headers=m.__headers__,this.statusCode=m.__status__,delete m.__headers__,delete m.__status__);var F=m.__sm__;F?this.data=(this.X=g.YX(F))?g.MT(F,this.X):F:this.data=m},lAc=function(m){e_R.call(this); this.status=1;this.errorCode=m},o7=function(m){this.X=m},wQ6=function(m,F){this.B=m; this.X=F},VhC=function(m){return r2q(m.X).map(function(F){var L=m.B; F=F.map;"__data__"in F?(F=F.__data__,L=L.V?zge(F):F):L=F;return L})},tm=function(m,F){if(typeof m!=="function")throw Error("Fn must not be null and must be a function"); return g.DC.setTimeout(function(){m()},F)},UV=function(m){EV.dispatchEvent(new jMZ(EV,m))},jMZ=function(m){g.L4.call(this,"statevent",m)},kT=function(m,F,L,u){this.X=m; this.V=F;this.Z=L;this.L=u||1;this.B=45E3;this.G=new g.$U(this);this.Y=new g.tI;this.Y.setInterval(250)},RMt=function(m,F,L){m.sY=1; m.Es=Hi(F.clone());m.oo=L;m.Qc=!0;IAZ(m,null)},$kt=function(m,F,L,u,q){m.sY=1; m.Es=Hi(F.clone());m.oo=null;m.Qc=L;q&&(m.qM=!1);IAZ(m,u)},IAZ=function(m,F){m.xB=Date.now(); eM6(m);m.x$=m.Es.clone();J6(m.x$,"t",m.L);m.j5=0;m.vW=m.X.MF(m.X.YB()?F:null);m.lR>0&&(m.UY=new g.mV((0,g.ER)(m.Uo,m,m.vW),m.lR));m.G.listen(m.vW,"readystatechange",m.Fp);F=m.wS?g.Sq(m.wS):{};m.oo?(m.Y$="POST",F["Content-Type"]="application/x-www-form-urlencoded",m.vW.send(m.x$,m.Y$,m.oo,F)):(m.Y$="GET",m.qM&&!g.T0&&(F.Connection="close"),m.vW.send(m.x$,m.Y$,null,F));m.X.Dd(1)},gt8=function(m,F){var L=m.j5,u=F.indexOf("\n",L); if(u==-1)return PKe;L=Number(F.substring(L,u));if(isNaN(L))return idc;u+=1;if(u+L>F.length)return PKe;F=F.slice(u,u+L);m.j5=u+L;return F},eM6=function(m){m.kt=Date.now()+m.B; zMe(m,m.B)},zMe=function(m,F){if(m.L1!=null)throw Error("WatchDog timer not null"); m.L1=tm((0,g.ER)(m.w7,m),F)},YL8=function(m){m.L1&&(g.DC.clearTimeout(m.L1),m.L1=null)},aAR=function(m){m.X.ju()||m.e7||m.X.tL(m)},hm=function(m){YL8(m); g.eO(m.UY);m.UY=null;m.Y.stop();m.G.removeAll();if(m.vW){var F=m.vW;m.vW=null;F.abort();F.dispose()}m.zJ&&(m.zJ=null)},Dk2=function(m,F){try{m.X.Yy(m,F),m.X.Dd(4)}catch(L){}},N1t=function(m,F,L,u,q){if(u==0)L(!1); else{var A=q||0;u--;T12(m,F,function(r){r?L(!0):g.DC.setTimeout(function(){N1t(m,F,L,u,A)},A)})}},T12=function(m,F,L){var u=new Image; u.onload=function(){try{Wx(u),L(!0)}catch(q){}}; u.onerror=function(){try{Wx(u),L(!1)}catch(q){}}; u.onabort=function(){try{Wx(u),L(!1)}catch(q){}}; u.ontimeout=function(){try{Wx(u),L(!1)}catch(q){}}; g.DC.setTimeout(function(){if(u.ontimeout)u.ontimeout()},F); u.src=m},Wx=function(m){m.onload=null; m.onerror=null;m.onabort=null;m.ontimeout=null},pQ8=function(m){this.X=m; this.B=new eW},K1C=function(m){var F=OV(m.X,m.HK,"/mail/images/cleardot.gif"); Hi(F);N1t(F.toString(),5E3,(0,g.ER)(m.PB,m),3,2E3);m.Dd(1)},fAc=function(m){var F=m.X.L; F!=null?(UV(5),F?(UV(11),QI(m.X,m,!1)):(UV(12),QI(m.X,m,!0))):(m.r3=new kT(m),m.r3.wS=m.Qi,F=m.X,F=OV(F,F.YB()?m.Nk:null,m.EN),UV(5),J6(F,"TYPE","xmlhttp"),$kt(m.r3,F,!1,m.Nk,!1))},xkc=function(m,F,L){this.X=1; this.B=[];this.G=[];this.Y=new eW;this.hF=m||null;this.L=F!=null?F:null;this.W=L||!1},MhG=function(m,F){this.X=m; this.map=F;this.context=null},Zd6=function(m,F,L,u){g.L4.call(this,"timingevent",m); this.size=F;this.rtt=L;this.retries=u},SL8=function(m){g.L4.call(this,"serverreachability",m)},XQq=function(m){m.AA(1,0); m.LU=OV(m,null,m.UN);otc(m)},thm=function(m){m.Gj&&(m.Gj.abort(),m.Gj=null); m.DI&&(m.DI.cancel(),m.DI=null);m.r_&&(g.DC.clearTimeout(m.r_),m.r_=null);sV(m);m.H1&&(m.H1.cancel(),m.H1=null);m.KC&&(g.DC.clearTimeout(m.KC),m.KC=null)},Et8=function(m,F){if(m.X==0)throw Error("Invalid operation: sending map when state is closed"); m.B.push(new MhG(m.Kk++,F));m.X!=2&&m.X!=3||otc(m)},Uk6=function(m){var F=0; m.DI&&F++;m.H1&&F++;return F},otc=function(m){m.H1||m.KC||(m.KC=tm((0,g.ER)(m.Jw,m),0),m.Zj=0)},W1f=function(m,F){if(m.X==1){if(!F){m.Nq=Math.floor(Math.random()*1E5); F=m.Nq++;var L=new kT(m,"",F);L.wS=m.Kn;var u=kTt(m),q=m.LU.clone();g.VP(q,"RID",F);g.VP(q,"CVER","1");bp(m,q);RMt(L,q,u);m.H1=L;m.X=2}}else m.X==3&&(F?hMN(m,F):m.B.length==0||m.H1||hMN(m))},hMN=function(m,F){if(F)if(m.A$>6){m.B=m.G.concat(m.B); m.G.length=0;var L=m.Nq-1;F=kTt(m)}else L=F.Z,F=F.oo;else L=m.Nq++,F=kTt(m);var u=m.LU.clone();g.VP(u,"SID",m.V);g.VP(u,"RID",L);g.VP(u,"AID",m.F7);bp(m,u);L=new kT(m,m.V,L,m.Zj+1);L.wS=m.Kn;L.setTimeout(1E4+Math.round(1E4*Math.random()));m.H1=L;RMt(L,u,F)},bp=function(m,F){m.AK&&(m=m.AK.Aw())&&g.aZ(m,function(L,u){g.VP(F,u,L)})},kTt=function(m){var F=Math.min(m.B.length,1E3),L=["count="+F]; if(m.A$>6&&F>0){var u=m.B[0].X;L.push("ofs="+u)}else u=0;for(var q={},A=0;A=3)return!1; m.Z++;m.r_=tm((0,g.ER)(m.La,m),QMC(m,m.JG));m.JG++;return!0},QI=function(m,F,L){m.FR=m.L==null?L:!m.L; m.Gz=F.nP;m.W||XQq(m)},sV=function(m){m.KQ!=null&&(g.DC.clearTimeout(m.KQ),m.KQ=null)},QMC=function(m,F){var L=5E3+Math.floor(Math.random()*1E4); m.isActive()||(L*=2);return L*F},cx=function(m,F){if(F==2||F==9){var L=null; m.AK&&(L=null);var u=(0,g.ER)(m.Q6P,m);L||(L=new g.PN("//www.google.com/images/cleardot.gif"),Hi(L));T12(L.toString(),1E4,u)}else UV(2);bd8(m,F)},bd8=function(m,F){m.X=0; m.AK&&m.AK.ZE(F);c2C(m);thm(m)},c2C=function(m){m.X=0; m.Gz=-1;if(m.AK)if(m.G.length==0&&m.B.length==0)m.AK.xt();else{var F=g.qT(m.G),L=g.qT(m.B);m.G.length=0;m.B.length=0;m.AK.xt(F,L)}},OV=function(m,F,L){var u=g.XM(L); if(u.X!="")F&&g.iy(u,F+"."+u.X),g.yP(u,u.G);else{var q=window.location;u=fl8(q.protocol,F?F+"."+q.hostname:q.hostname,+q.port,L)}m.j7&&g.aZ(m.j7,function(A,r){g.VP(u,r,A)}); g.VP(u,"VER",m.A$);bp(m,u);return u},dkc=function(){},nte=function(){this.X=[]; this.B=[]},B1e=function(m){g.L4.call(this,"channelMessage"); this.message=m},Hdq=function(m){g.L4.call(this,"channelError"); this.error=m},J2R=function(m,F){this.action=m; this.params=F||{}},dS=function(m,F){g.O.call(this); this.X=new g.Bk(this.XhP,0,this);g.Q(this,this.X);this.R6=5E3;this.retryCount=this.KG=0;if(typeof m==="function")F&&(m=(0,g.ER)(m,F));else if(m&&typeof m.handleEvent==="function")m=(0,g.ER)(m.handleEvent,m);else throw Error("Invalid listener argument");this.B=m},CKC=function(m,F,L,u,q,A,r,G,v,l,w,V,I,R,e){var a=this; L=L===void 0?!1:L;u=u===void 0?function(){return""}:u; q=q===void 0?!1:q;A=A===void 0?!1:A;r=r===void 0?!1:r;G=G===void 0?function(){return g.Mx({})}:G; l=l===void 0?!1:l;w=w===void 0?!1:w;V=V===void 0?!1:V;I=I===void 0?!1:I;this.AF=m;this.Hb=F;this.W=new g.N5;this.L=e;this.B=(this.G=!!R)?R(function(){a.Cb()}):new dS(this.Cb,this); this.X=null;this.hF=!1;this.b9=null;this.Qc="";this.ER=this.Bb=0;this.V=[];this.LI=L;this.xC=u;this.Z=A;this.w8=G;this.Lu=v;this.nI=r;this.jY=null;this.Y=g.Mx();this.GY=q;this.HR=l;this.BR=w;this.fI=V;this.Eu=I;this.q0=new YSt;this.Cu=new alq;this.SY=new TJt;this.RW=new DcC;this.aW=new NJf;this.Th=new pkZ;this.Xt=new Khe},LIG=function(m,F,L,u,q){mfC(m); if(m.X){var A=g.HQ("ID_TOKEN"),r=m.X.Kn||{};A?r["x-youtube-identity-token"]=A:delete r["x-youtube-identity-token"];m.X.Kn=r}FIC(m);u?(u.getState()!=3&&Uk6(u)==0||u.getState(),m.X.connect(F,L,m.Hb,u.V,u.F7)):q?m.X.connect(F,L,m.Hb,q.sessionId,q.arrayId):m.X.connect(F,L,m.Hb);m.G&&!m.B.isActive()&&m.B.start();m.L&&m.L.nk8()},r$q=function(m,F){return m.fI?!0:m.BR?Object.values(usC).includes(F):m.HR?!Object.values(qcC).includes(F):m.Eu?Object.values(A$N).includes(F):!1},vQG=function(m){var F,L; g.h(function(u){if(u.X==1)return g.Gt(u,2),g.k(u,y$8(m),2);g.w6(u);F=m.V;m.V=[];L=F.length;GRG(m,F,L);nj(m);return g.V8(u,0)})},GRG=function(m,F,L){for(var u=0;u0?L=Object.assign({},L,F):delete L.Authorization;m.X.Kn=L}},FIC=function(m){m.Lu&&!m.Z&&wne(m,m.Lu())},Jm=function(m){this.scheme="https"; this.port=this.domain="";this.X="/api/lounge";this.B=!0;m=m||document.location.href;var F=Number(g.ae(m)[4]||null)||"";F&&(this.port=":"+F);this.domain=g.DI(m)||"";m=g.qi();m.search("MSIE")>=0&&(m=m.match(/MSIE ([\d.]+)/)[1],g.ui(m,"10.0")<0&&(this.B=!1))},Cj=function(m,F){var L=m.X; m.B&&(L=m.scheme+"://"+m.domain+m.port+m.X);return g.MO(L+F,{})},VI8=function(m,F){g.eT.call(this); var L=this;this.handler=m();this.handler.subscribe("handlerOpened",this.pk,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(u,q){L.onError(q)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.X=F},jdq=function(m,F,L){var u=this; L=L===void 0?function(){return""}:L; var q=q===void 0?new GTC:q;var A=A===void 0?new g.N5:A;this.pathPrefix=m;this.X=F;this.Hb=L;this.Y=A;this.W=null;this.hF=this.Z=0;this.channel=null;this.L=0;this.G=new dS(function(){u.G.isActive();var r;((r=u.channel)==null?void 0:E9t((new wQ6(r,r.X)).X.B))===0&&u.connect(u.W,u.Z)}); this.V={};this.B={};this.Bb=!1;this.logger=null;this.b9=[];this.k5=void 0;this.xC=new YSt;this.ER=new alq;this.jY=new DcC;this.Qc=new NJf},IPe=function(m){g.lo(m.channel,"m",function(){m.L=3; m.G.reset();m.W=null;m.Z=0;for(var F=g.Z(m.b9),L=F.next();!L.done;L=F.next())L=L.value,m.channel&&m.channel.send(L);m.b9=[];m.publish("webChannelOpened");m.xC.e_("WEB_CHANNEL")}); g.lo(m.channel,"n",function(){m.L=0;m.G.isActive()||m.publish("webChannelClosed");var F,L=(F=m.channel)==null?void 0:VhC(new wQ6(F,F.X));L&&(m.b9=[].concat(g.X(L)));m.ER.e_("WEB_CHANNEL")}); g.lo(m.channel,"p",function(F){var L=F.data;L[0]==="gracefulReconnect"?(m.G.start(),m.channel&&m.channel.close()):m.publish("webChannelMessage",new J2R(L[0],L[1]));m.k5=F.statusCode;m.jY.e_("WEB_CHANNEL")}); g.lo(m.channel,"o",function(){m.k5===401||m.G.start();m.publish("webChannelError");m.Qc.e_("WEB_CHANNEL","")})},Rv2=function(m){var F=m.Hb(); F?m.V["x-youtube-lounge-xsrf-token"]=F:delete m.V["x-youtube-lounge-xsrf-token"]},$ff=function(m){g.eT.call(this); this.X=m();this.X.subscribe("webChannelOpened",this.Dy,this);this.X.subscribe("webChannelClosed",this.onClosed,this);this.X.subscribe("webChannelError",this.onError,this);this.X.subscribe("webChannelMessage",this.onMessage,this)},evc=function(m,F,L,u,q){function A(){return new CKC(Cj(m,"/bc"),F,!1,L,u)} L=L===void 0?function(){return""}:L; return g.YQ("enable_mdx_web_channel_desktop")?new $ff(function(){return new jdq(Cj(m,"/wc"),F,L)}):new VI8(A,q)},zve=function(){var m=Pem; iAR();mF.push(m);gQR()},Fi=function(m,F){iAR(); var L=YcC(m,String(F));mF.length==0?aPf(L):(gQR(),g.eq(mF,function(u){u(L)}))},Lf=function(m){Fi("CP",m)},iAR=function(){mF||(mF=g.NN("yt.mdx.remote.debug.handlers_")||[],g.Tt("yt.mdx.remote.debug.handlers_",mF))},aPf=function(m){var F=(u9+1)%50; u9=F;qS[F]=m;AT||(AT=F==49)},gQR=function(){var m=mF; if(qS[0]){var F=AT?u9:-1,L={};do L={Uc:void 0},F=(F+1)%50,L.Uc=qS[F],g.eq(m,function(u){return function(q){q(u.Uc)}}(L)); while(F!=u9);qS=Array(50);u9=-1;AT=!1}},YcC=function(m,F){var L=(Date.now()-DfC)/1E3; L.toFixed&&(L=L.toFixed(3));var u=[];u.push("[",L+"s","] ");u.push("[","yt.mdx.remote","] ");u.push(m+": "+F,"\n");return u.join("")},ry=function(m){g.LT.call(this); this.L=m;this.screens=[]},Td8=function(m,F){var L=m.get(F.uuid)||m.get(F.id); if(L)return m=L.name,L.id=F.id||L.id,L.name=F.name,L.token=F.token,L.uuid=F.uuid||L.uuid,L.name!=m;m.screens.push(F);return!0},NdC=function(m,F){var L=m.screens.length!=F.length; m.screens=g.U6(m.screens,function(A){return!!QwN(F,A)}); for(var u=F.length,q=0;q0&&m.V0&&i9(m,L)},function(F){m.Y=function(){}; m.Cf(F)})},Lcc=function(m){var F={}; F.pairingCode=m.ER;F.theme=m.Lu;FVC()&&(F.env_useStageMdx=1);return g.xB(F)},uxG=function(m){return new Promise(function(F){m.ER=Wh2(); if(m.xC){var L=new chrome.cast.DialLaunchResponse(!0,Lcc(m));F(L);Fct(m)}else m.Bb=function(){g.ie(m.hF);m.Bb=function(){}; m.hF=NaN;var u=new chrome.cast.DialLaunchResponse(!0,Lcc(m));F(u);Fct(m)},m.hF=g.eI(function(){m.Bb()},100)})},ASq=function(m,F,L){m.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(F)); var u=new qj(F);return(new Promise(function(q){qaC(m,u,function(A){A?(m.b9=!0,Vy(m.V,u),Ix(m,u),i9(m,L)):g.mI(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(F)+" is not online."));q(A)},5)})).then(function(q){return q?new chrome.cast.DialLaunchResponse(!1):uxG(m)})},rSZ=function(m,F){var L=m.W.receiver.label,u=m.B.friendlyName; return(new Promise(function(q){Uf2(m.V,L,F,u,function(A){A&&A.token&&Ix(m,A);q(A)},function(A){Rx(m,"Failed to get DIAL screen: "+A); q(null)})})).then(function(q){return q&&q.token?new chrome.cast.DialLaunchResponse(!1):uxG(m)})},qaC=function(m,F,L,u){g.ie(m.L); m.L=0;hv6(m.V,F,function(q){q||u<0?L(q):m.L=g.eI(function(){qaC(m,F,L,u-1)},300)})},i9=function(m,F){m.info("getDialAppInfoWithTimeout_ "+F); P7(m)&&(g.ie(m.Z),m.Z=0,F==0?ySZ(m):m.Z=g.eI(function(){ySZ(m)},F))},ySZ=function(m){P7(m)&&m.G.getDialAppInfo(function(F){m.info("getDialAppInfo dialLaunchData: "+JSON.stringify(F)); F=F.extraData||{};var L=null;if(F.loungeToken){var u;((u=m.X)==null?void 0:u.token)==F.loungeToken&&(L="staleLoungeToken")}else L="missingLoungeToken";L?(m.Hb=L,i9(m,3E4)):(m.b9=!1,m.Hb="unknown",sdf(m,F.loungeToken),i9(m,F.loungeTokenRefreshIntervalMs))},function(F){m.info("getDialAppInfo error: "+F); m.Hb="noLoungeTokenResponse";i9(m,3E4)})},GLc=function(m){g.ie(m.L); m.L=0;g.ie(m.Z);m.Z=0;m.Y();m.Y=function(){}; g.ie(m.hF)},gy=function(m,F){jD.call(this,m,F,"ManualSession"); this.G=g.eI((0,g.ER)(this.xG,this,null),150)},z3=function(m,F){g.LT.call(this); this.config_=F;this.B=m;this.W=F.appId||"233637DE";this.V=F.theme||"cl";this.hF=F.disableCastApi||!1;this.L=F.forceMirroring||!1;this.X=null;this.Z=!1;this.G=[];this.Y=(0,g.ER)(this.tUN,this)},vgR=function(m,F){return F?g.c2(m.G,function(L){return Am(F,L.label)},m):null},YL=function(m){Fi("Controller",m)},Pem=function(m){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(m)},ax=function(m){return m.Z||!!m.G.length||!!m.X},Ds=function(m,F,L){F!=m.X&&(g.eO(m.X),(m.X=F)?(L?m.publish("yt-remote-cast2-receiver-resumed", F.B):m.publish("yt-remote-cast2-receiver-selected",F.B),F.subscribe("sessionScreen",(0,g.ER)(m.Kl,m,F)),F.subscribe("sessionFailed",function(){return lNq(m,F)}),F.X?m.publish("yt-remote-cast2-session-change",F.X):L&&m.X.xG(null)):m.publish("yt-remote-cast2-session-change",null))},lNq=function(m,F){m.X==F&&m.publish("yt-remote-cast2-session-failed")},wtt=function(m){var F=m.B.Ka(),L=m.X&&m.X.B; m=g.xZ(F,function(u){L&&Am(u,L.label)&&(L=null);var q=u.uuid?u.uuid:u.id,A=vgR(this,u);A?(A.label=q,A.friendlyName=u.name):(A=new chrome.cast.Receiver(q,u.name),A.receiverType=chrome.cast.ReceiverType.CUSTOM);return A},m); L&&(L.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(L=new chrome.cast.Receiver(L.label,L.friendlyName),L.receiverType=chrome.cast.ReceiverType.CUSTOM),m.push(L));return m},i7G=function(m,F,L,u){u.disableCastApi?T3("Cannot initialize because disabled by Mdx config."):VQ2()?jhm(F,u)&&(INC(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?R4N(m,L):(window.__onGCastApiAvailable=function(q,A){q?R4N(m,L):(NS("Failed to load cast API: "+A),$Y8(!1),INC(!1),g.tS("yt-remote-cast-available"),g.tS("yt-remote-cast-receiver"), e4R(),L(!1))},u.loadCastApiSetupScript?g.Fa(Psm):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?LVZ()>=60&&wqq():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?r4e():LVZ()>=89?jPG():(lfe(),jW(VAC.map(y4e))))):T3("Cannot initialize because not running Chrome")},e4R=function(){T3("dispose"); var m=pf();m&&m.dispose();g.Tt("yt.mdx.remote.cloudview.instance_",null);ggC(!1);g.Cz(z4R);z4R.length=0},Kf=function(){return!!g.Xx("yt-remote-cast-installed")},YaC=function(){var m=g.Xx("yt-remote-cast-receiver"); return m?m.friendlyName:null},aN2=function(){T3("clearCurrentReceiver"); g.tS("yt-remote-cast-receiver")},DY6=function(){return Kf()?pf()?pf().getCastSession():(NS("getCastSelector: Cast is not initialized."),null):(NS("getCastSelector: Cast API is not installed!"),null)},TT6=function(){Kf()?pf()?ff()?(T3("Requesting cast selector."),pf().requestSession()):(T3("Wait for cast API to be ready to request the session."),z4R.push(g.J5("yt-remote-cast2-api-ready",TT6))):NS("requestCastSelector: Cast is not initialized."):NS("requestCastSelector: Cast API is not installed!")}, xL=function(m,F){ff()?pf().setConnectedScreenStatus(m,F):NS("setConnectedScreenStatus called before ready.")},VQ2=function(){var m=g.qi().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.vm||m},NTc=function(m,F){pf().init(m,F)},jhm=function(m,F){var L=!1; pf()||(m=new z3(m,F),m.subscribe("yt-remote-cast2-availability-change",function(u){g.oh("yt-remote-cast-available",u);VI("yt-remote-cast2-availability-change",u)}),m.subscribe("yt-remote-cast2-receiver-selected",function(u){T3("onReceiverSelected: "+u.friendlyName); g.oh("yt-remote-cast-receiver",u);VI("yt-remote-cast2-receiver-selected",u)}),m.subscribe("yt-remote-cast2-receiver-resumed",function(u){T3("onReceiverResumed: "+u.friendlyName); g.oh("yt-remote-cast-receiver",u);VI("yt-remote-cast2-receiver-resumed",u)}),m.subscribe("yt-remote-cast2-session-change",function(u){T3("onSessionChange: "+rS(u)); u||g.tS("yt-remote-cast-receiver");VI("yt-remote-cast2-session-change",u)}),g.Tt("yt.mdx.remote.cloudview.instance_",m),L=!0); T3("cloudview.createSingleton_: "+L);return L},pf=function(){return g.NN("yt.mdx.remote.cloudview.instance_")},R4N=function(m,F){$Y8(!0); INC(!1);NTc(m,function(L){L?(ggC(!0),g.mH("yt-remote-cast2-api-ready")):(NS("Failed to initialize cast API."),$Y8(!1),g.tS("yt-remote-cast-available"),g.tS("yt-remote-cast-receiver"),e4R());F(L)})},T3=function(m){Fi("cloudview",m)},NS=function(m){Fi("cloudview",m)},$Y8=function(m){T3("setCastInstalled_ "+m); g.oh("yt-remote-cast-installed",m)},ff=function(){return!!g.NN("yt.mdx.remote.cloudview.apiReady_")},ggC=function(m){T3("setApiReady_ "+m); g.Tt("yt.mdx.remote.cloudview.apiReady_",m)},INC=function(m){g.Tt("yt.mdx.remote.cloudview.initializing_",m)},MS=function(m){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.Y=this.L=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.G=this.Z=this.B=0;this.X=NaN;this.V=!1;this.reset(m)},pte=function(m){m.audioTrackId=null; m.trackData=null;m.playerState=-1;m.hasPrevious=!1;m.hasNext=!1;m.L=0;m.Y=g.ke();m.B=0;m.Z=0;m.G=0;m.loadedTime=0;m.X=NaN;m.V=!1},Zs=function(m){return m.isPlaying()?(g.ke()-m.Y)/1E3:0},SD=function(m,F){m.L=F; m.Y=g.ke()},ox=function(m){switch(m.playerState){case 1:case 1081:return(g.ke()-m.Y)/1E3+m.L; case -1E3:return 0}return m.L},KcZ=function(m){return m.V?m.Z+Zs(m):m.Z},Xi=function(m,F,L){var u=m.videoId; m.videoId=F;m.index=L;F!=u&&pte(m)},fNe=function(m){var F={}; F.index=m.index;F.listId=m.listId;F.videoId=m.videoId;F.playerState=m.playerState;F.volume=m.volume;F.muted=m.muted;F.audioTrackId=m.audioTrackId;F.trackData=g.Xd(m.trackData);F.hasPrevious=m.hasPrevious;F.hasNext=m.hasNext;F.playerTime=m.L;F.playerTimeAt=m.Y;F.seekableStart=m.B;F.seekableEnd=m.Z;F.duration=m.G;F.loadedTime=m.loadedTime;F.liveIngestionTime=m.X;return F},EB=function(m,F){g.LT.call(this); var L=this;this.G=0;this.V=m;this.L=[];this.Y=new nte;this.B=this.X=null;this.hF=(0,g.ER)(this.NJF,this);this.Z=(0,g.ER)(this.r0,this);this.W=(0,g.ER)(this.jHF,this);this.Bb=(0,g.ER)(this.ZAN,this);var u=0;m?(u=m.getProxyState(),u!=3&&(m.subscribe("proxyStateChange",this.wZ,this),xYt(this))):u=3;u!=0&&(F?this.wZ(u):g.eI(function(){L.wZ(u)},0)); (m=DY6())&&tT(this,m);this.subscribe("yt-remote-cast2-session-change",this.Bb)},UB=function(m){return new MS(m.V.getPlayerContextData())},xYt=function(m){g.eq("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(F){this.L.push(this.V.subscribe(F,g.UR(this.MU0,F),this))},m)},MQR=function(m){g.eq(m.L,function(F){this.V.unsubscribeByKey(F)},m); m.L.length=0},kL=function(m){return m.getState()==1},hT=function(m,F){var L=m.Y; L.X.length+L.B.length<50&&m.Y.enqueue(F)},Z7C=function(m,F,L){var u=UB(m); SD(u,L);u.playerState!=-1E3&&(u.playerState=F);W7(m,u)},OB=function(m,F,L){m.V.sendMessage(F,L)},W7=function(m,F){MQR(m); m.V.setPlayerContextData(fNe(F));xYt(m)},tT=function(m,F){m.B&&(m.B.removeUpdateListener(m.hF),m.B.removeMediaListener(m.Z),m.r0(null)); m.B=F;m.B&&(Lf("Setting cast session: "+m.B.sessionId),m.B.addUpdateListener(m.hF),m.B.addMediaListener(m.Z),m.B.media.length&&m.r0(m.B.media[0]))},Sam=function(m){var F=m.X.media,L=m.X.customData; if(F&&L){var u=UB(m);F.contentId!=u.videoId&&Lf("Cast changing video to: "+F.contentId);u.videoId=F.contentId;u.playerState=L.playerState;SD(u,m.X.getEstimatedTime());W7(m,u)}else Lf("No cast media video. Ignoring state update.")},Qy=function(m,F,L){return(0,g.ER)(function(u){this.Ty("Failed to "+F+" with cast v2 channel. Error code: "+u.code); u.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Ty("Retrying "+F+" using MDx browser channel."),OB(this,F,L))},m)},c7=function(m,F,L,u){u=u===void 0?!1:u; g.LT.call(this);var q=this;this.L=NaN;this.ER=!1;this.hF=this.W=this.b9=this.Hb=NaN;this.Bb=[];this.Y=this.Z=this.V=this.X=this.B=null;this.xC=m;this.jY=u;this.Bb.push(g.TL(window,"beforeunload",function(){q.vc(2)})); this.G=[];this.X=new MS;this.Lu=F.id;this.Qc=F.idType;this.B=evc(this.xC,L,this.Rq,this.Qc=="shortLived",this.Lu);this.B.listen("channelOpened",function(){oge(q)}); this.B.listen("channelClosed",function(){sB("Channel closed");isNaN(q.L)?lp(!0):lp();q.dispose()}); this.B.listen("channelError",function(A){lp();isNaN(q.UI())?(A==1&&q.Qc=="shortLived"&&q.publish("browserChannelAuthError",A),sB("Channel error: "+A+" without reconnection"),q.dispose()):(q.ER=!0,sB("Channel error: "+A+" with reconnection in "+q.UI()+" ms"),b9(q,2))}); this.B.listen("channelMessage",function(A){XtC(q,A)}); this.B.kz(F.token);this.subscribe("remoteQueueChange",function(){var A=q.X.videoId;g.Ea()&&g.oh("yt-remote-session-video-id",A)})},tQf=function(m){return g.c2(m.G,function(F){return F.type=="LOUNGE_SCREEN"})},sB=function(m){Fi("conn",m)},b9=function(m,F){m.publish("proxyStateChange",F)},Egt=function(m){m.L=g.eI(function(){sB("Connecting timeout"); m.vc(1)},2E4)},UYZ=function(m){g.ie(m.L); m.L=NaN},kLG=function(m){g.ie(m.Hb); m.Hb=NaN},Wc6=function(m){h48(m); m.b9=g.eI(function(){dy(m,"getNowPlaying")},2E4)},h48=function(m){g.ie(m.b9); m.b9=NaN},oge=function(m){sB("Channel opened"); m.ER&&(m.ER=!1,kLG(m),m.Hb=g.eI(function(){sB("Timing out waiting for a screen.");m.vc(1)},15E3))},QhR=function(m,F){var L=null; if(F){var u=tQf(m);u&&(L={clientName:u.clientName,deviceMake:u.brand,deviceModel:u.model,osVersion:u.osVersion})}g.Tt("yt.mdx.remote.remoteClient_",L);F&&(UYZ(m),kLG(m));L=m.B.Kd()&&isNaN(m.L);F==L?F&&(b9(m,1),dy(m,"getSubtitlesTrack")):F?(m.RD()&&m.X.reset(),b9(m,1),dy(m,"getNowPlaying"),O7C(m)):m.vc(1)},sh2=function(m,F){var L=F.params.videoId; delete F.params.videoId;L==m.X.videoId&&(g.K0(F.params)?m.X.trackData=null:m.X.trackData=F.params,m.publish("remotePlayerChange"))},b7N=function(m,F,L){var u=F.params.videoId||F.params.video_id,q=parseInt(F.params.currentIndex,10); m.X.listId=F.params.listId||m.X.listId;Xi(m.X,u,q);m.publish("remoteQueueChange",L)},dYm=function(m,F){F.params=F.params||{}; b7N(m,F,"NOW_PLAYING_MAY_CHANGE");cSe(m,F);m.publish("autoplayDismissed")},cSe=function(m,F){var L=parseInt(F.params.currentTime||F.params.current_time,10); SD(m.X,isNaN(L)?0:L);L=parseInt(F.params.state,10);L=isNaN(L)?-1:L;L==-1&&m.X.playerState==-1E3&&(L=-1E3);m.X.playerState=L;L=Number(F.params.loadedTime);m.X.loadedTime=isNaN(L)?0:L;m.X.xE(Number(F.params.duration));L=m.X;var u=Number(F.params.liveIngestionTime);L.X=u;L.V=isNaN(u)?!1:!0;L=m.X;u=Number(F.params.seekableStartTime);F=Number(F.params.seekableEndTime);L.B=isNaN(u)?0:u;L.Z=isNaN(F)?0:F;m.X.playerState==1?Wc6(m):h48(m);m.publish("remotePlayerChange")},ngZ=function(m,F){if(m.X.playerState!= -1E3){var L=1085; switch(parseInt(F.params.adState,10)){case 1:L=1081;break;case 2:L=1084;break;case 0:L=1083}m.X.playerState=L;F=parseInt(F.params.currentTime,10);SD(m.X,isNaN(F)?0:F);m.publish("remotePlayerChange")}},BTc=function(m,F){var L=F.params.muted=="true"; m.X.volume=parseInt(F.params.volume,10);m.X.muted=L;m.publish("remotePlayerChange")},H78=function(m,F){m.Z=F.params.videoId; m.publish("nowAutoplaying",parseInt(F.params.timeout,10))},JS6=function(m,F){m.Z=F.params.videoId||null; m.publish("autoplayUpNext",m.Z)},CsG=function(m,F){m.Y=F.params.autoplayMode; m.publish("autoplayModeChange",m.Y);m.Y=="DISABLED"&&m.publish("autoplayDismissed")},m9q=function(m,F){var L=F.params.hasNext=="true"; m.X.hasPrevious=F.params.hasPrevious=="true";m.X.hasNext=L;m.publish("previousNextChange")},XtC=function(m,F){F=F.message; F.params?sB("Received: action="+F.action+", params="+g.WV(F.params)):sB("Received: action="+F.action+" {}");switch(F.action){case "loungeStatus":F=CO(F.params.devices);m.G=g.xZ(F,function(u){return new up(u)}); F=!!g.c2(m.G,function(u){return u.type=="LOUNGE_SCREEN"}); QhR(m,F);F=m.Rv("mlm");m.publish("multiStateLoopEnabled",F);break;case "loungeScreenDisconnected":g.L0(m.G,function(u){return u.type=="LOUNGE_SCREEN"}); QhR(m,!1);break;case "remoteConnected":var L=new up(CO(F.params.device));g.c2(m.G,function(u){return u.equals(L)})||PnC(m.G,L); break;case "remoteDisconnected":L=new up(CO(F.params.device));g.L0(m.G,function(u){return u.equals(L)}); break;case "gracefulDisconnect":break;case "playlistModified":b7N(m,F,"QUEUE_MODIFIED");break;case "nowPlaying":dYm(m,F);break;case "onStateChange":cSe(m,F);break;case "onAdStateChange":ngZ(m,F);break;case "onVolumeChanged":BTc(m,F);break;case "onSubtitlesTrackChanged":sh2(m,F);break;case "nowAutoplaying":H78(m,F);break;case "autoplayDismissed":m.publish("autoplayDismissed");break;case "autoplayUpNext":JS6(m,F);break;case "onAutoplayModeChanged":CsG(m,F);break;case "onHasPreviousNextChanged":m9q(m, F);break;case "requestAssistedSignIn":m.publish("assistedSignInRequested",F.params.authCode);break;case "onLoopModeChanged":m.publish("loopModeChange",F.params.loopMode);break;default:sB("Unrecognized action: "+F.action)}},O7C=function(m){g.ie(m.hF); m.hF=g.eI(function(){m.vc(1)},864E5)},dy=function(m,F,L){L?sB("Sending: action="+F+", params="+g.WV(L)):sB("Sending: action="+F); m.B.sendMessage(F,L)},FyZ=function(m){ry.call(this,"ScreenServiceProxy"); this.us=m;this.X=[];this.X.push(this.us.$_s("screenChange",(0,g.ER)(this.qA,this)));this.X.push(this.us.$_s("onlineScreenChange",(0,g.ER)(this.eHN,this)))},rwG=function(m,F){m58(); if(!wS||!wS.get("yt-remote-disable-remote-module-for-dev")){F=g.HQ("MDX_CONFIG")||F;swN();nUR();nf||(nf=new Jm(F?F.loungeApiHost:void 0),FVC()&&(nf.X="/api/loungedev"));B7||(B7=g.NN("yt.mdx.remote.deferredProxies_")||[],g.Tt("yt.mdx.remote.deferredProxies_",B7));Lyf();var L=H7();if(!L){var u=new wy(nf,F?F.disableAutomaticScreenCache||!1:!1);g.Tt("yt.mdx.remote.screenService_",u);L=H7();var q={};F&&(q={appId:F.appId,disableDial:F.disableDial,theme:F.theme,loadCastApiSetupScript:F.loadCastApiSetupScript, disableCastApi:F.disableCastApi,enableDialLoungeToken:F.enableDialLoungeToken,enableCastLoungeToken:F.enableCastLoungeToken,forceMirroring:F.forceMirroring});g.Tt("yt.mdx.remote.enableConnectWithInitialState_",F?F.enableConnectWithInitialState||!1:!1);i7G(m,u,function(A){A?JT()&&xL(JT(),"YouTube TV"):u.subscribe("onlineScreenChange",function(){VI("yt-remote-receiver-availability-change")})},q)}F&&!g.NN("yt.mdx.remote.initialized_")&&(g.Tt("yt.mdx.remote.initialized_",!0),Cf("Initializing: "+g.WV(F)), mE.push(g.J5("yt-remote-cast2-api-ready",function(){VI("yt-remote-api-ready")})),mE.push(g.J5("yt-remote-cast2-availability-change",function(){VI("yt-remote-receiver-availability-change")})),mE.push(g.J5("yt-remote-cast2-receiver-selected",function(){F4(null); VI("yt-remote-auto-connect","cast-selector-receiver")})),mE.push(g.J5("yt-remote-cast2-receiver-resumed",function(){VI("yt-remote-receiver-resumed","cast-selector-receiver")})),mE.push(g.J5("yt-remote-cast2-session-change",umc)),mE.push(g.J5("yt-remote-connection-change",function(A){A?xL(JT(),"YouTube TV"):LL()||(xL(null,null),aN2())})),mE.push(g.J5("yt-remote-cast2-session-failed",function(){VI("yt-remote-connection-failed")})),m=qwc(),F.isAuto&&(m.id+="#dial"),q=F.capabilities||[],q.length>0&&(m.capabilities= q),m.name=F.device,m.app=F.app,(F=F.theme)&&(m.theme=F),Cf(" -- with channel params: "+g.WV(m)),m?(g.oh("yt-remote-session-app",m.app),g.oh("yt-remote-session-name",m.name)):(g.tS("yt-remote-session-app"),g.tS("yt-remote-session-name")),g.Tt("yt.mdx.remote.channelParams_",m),L.start(),JT()||AwC())}},ywC=function(){var m=H7().us.$_gos(); var F=uY();F&&qG()&&(QwN(m,F)||m.push(F));return OBm(m)},v1C=function(){var m=GWt(); !m&&Kf()&&YaC()&&(m={key:"cast-selector-receiver",name:YaC()});return m},GWt=function(){var m=ywC(),F=uY(); F||(F=LL());return g.c2(m,function(L){return F&&Am(F,L.key)?!0:!1})},uY=function(){var m=JT(); if(!m)return null;var F=H7().ST();return yI(F,m)},umc=function(m){Cf("remote.onCastSessionChange_: "+rS(m)); if(m){var F=uY();if(F&&F.id==m.id){if(xL(F.id,"YouTube TV"),m.idType=="shortLived"&&(m=m.token))A8&&(A8.token=m),(F=qG())&&F.kz(m)}else F&&rX(),yd(m,1)}else qG()&&rX()},rX=function(){ff()?pf().stopSession():NS("stopSession called before API ready."); var m=qG();m&&(m.disconnect(1),lpe(null))},wTq=function(){var m=qG(); return!!m&&m.getProxyState()!=3},Cf=function(m){Fi("remote",m)},H7=function(){if(!Vit){var m=g.NN("yt.mdx.remote.screenService_"); Vit=m?new FyZ(m):null}return Vit},JT=function(){return g.NN("yt.mdx.remote.currentScreenId_")},j9G=function(m){g.Tt("yt.mdx.remote.currentScreenId_",m)},IpG=function(){return g.NN("yt.mdx.remote.connectData_")},F4=function(m){g.Tt("yt.mdx.remote.connectData_",m)},qG=function(){return g.NN("yt.mdx.remote.connection_")},lpe=function(m){var F=qG(); F4(null);m||j9G("");g.Tt("yt.mdx.remote.connection_",m);B7&&(g.eq(B7,function(L){L(m)}),B7.length=0); F&&!m?VI("yt-remote-connection-change",!1):!F&&m&&VI("yt-remote-connection-change",!0)},LL=function(){var m=g.Ea(); if(!m)return null;var F=H7();if(!F)return null;F=F.ST();return yI(F,m)},yd=function(m,F){JT(); uY()&&uY();if(GY)A8=m;else{j9G(m.id);var L=g.NN("yt.mdx.remote.enableConnectWithInitialState_")||!1;m=new c7(nf,m,qwc(),L);m.connect(F,IpG());m.subscribe("beforeDisconnect",function(u){VI("yt-remote-before-disconnect",u)}); m.subscribe("beforeDispose",function(){qG()&&(qG(),lpe(null))}); m.subscribe("browserChannelAuthError",function(){var u=uY();u&&u.idType=="shortLived"&&(ff()?pf().handleBrowserChannelAuthError():NS("refreshLoungeToken called before API ready."))}); lpe(m)}},AwC=function(){var m=LL(); m?(Cf("Resume connection to: "+rS(m)),yd(m,0)):(lp(),aN2(),Cf("Skipping connecting because no session screen found."))},Lyf=function(){var m=qwc(); if(g.K0(m)){m=vx();var F=g.Xx("yt-remote-session-name")||"",L=g.Xx("yt-remote-session-app")||"";m={device:"REMOTE_CONTROL",id:m,name:F,app:L,mdxVersion:3};m.authuser=String(g.HQ("SESSION_INDEX","0"));(F=g.HQ("DELEGATED_SESSION_ID"))&&(m.pageId=String(F));g.Tt("yt.mdx.remote.channelParams_",m)}},qwc=function(){return g.NN("yt.mdx.remote.channelParams_")||{}},eQ8=function(m,F,L){g.O.call(this); var u=this;this.X=m;this.j=F;this.PR=L;this.events=new g.j7(this);this.Y=!1;this.L=new g.aQ(64);this.B=new g.Bk(this.YN,500,this);this.G=new g.Bk(this.jX,1E3,this);this.W=new I7(this.W88,0,this);this.V={};this.hF=new g.Bk(this.Ja,1E3,this);this.Z=new g.mV(this.seekTo,1E3,this);this.Bb=this.events.K(this.j,"onVolumeChange",function(q){RQC(u,q)}); g.Q(this,this.events);this.events.K(F,"onCaptionsTrackListChanged",this.BFu);this.events.K(F,"captionschanged",this.sHN);this.events.K(F,"captionssettingschanged",this.C3);this.events.K(F,"videoplayerreset",this.iO);this.events.K(F,"mdxautoplaycancel",function(){u.PR.m$()}); F.N("enable_mdx_video_play_directly")&&this.events.K(F,"videodatachange",function(){$98(u.X)||vA(u)||lY(u,0)}); m=this.PR;m.sR();m.subscribe("proxyStateChange",this.wz,this);m.subscribe("remotePlayerChange",this.d0,this);m.subscribe("remoteQueueChange",this.iO,this);m.subscribe("previousNextChange",this.NL,this);m.subscribe("nowAutoplaying",this.Er,this);m.subscribe("autoplayDismissed",this.uy,this);g.Q(this,this.B);g.Q(this,this.G);g.Q(this,this.W);g.Q(this,this.hF);g.Q(this,this.Z);this.C3();this.iO();this.d0()},RQC=function(m,F){if(vA(m)){m.PR.unsubscribe("remotePlayerChange",m.d0,m); var L=Math.round(F.volume);F=!!F.muted;var u=UB(m.PR);if(L!==u.volume||F!==u.muted)m.PR.setVolume(L,F),m.hF.start();m.PR.subscribe("remotePlayerChange",m.d0,m)}},POc=function(m){m.ev(0); m.B.stop();m.gY(new g.aQ(64))},iom=function(m,F){if(vA(m)&&!m.Y){var L=null; F&&(L={style:m.j.getSubtitlesUserSettings()},Object.assign(L,F));m.PR.rl(wX(m).videoId,L);m.V=UB(m.PR).trackData}},lY=function(m,F){var L=m.j.getPlaylist(); if(L==null?0:L.listId){var u=L.index;var q=L.listId.toString()}L=wX(m);m.PR.playVideo(L.videoId,F,u,q,L.playerParams,L.Bb,egC(L));m.gY(new g.aQ(1))},g1C=function(m,F){if(F){var L=m.j.getOption("captions","tracklist",{i8:1}); L&&L.length?(m.j.setOption("captions","track",F),m.Y=!1):(m.j.loadModule("captions"),m.Y=!0)}else m.j.setOption("captions","track",{})},vA=function(m){return UB(m.PR).videoId===wX(m).videoId},wX=function(m){return m.j.getVideoData({playerType:1})},zQC=function(m,F){g.Ux.call(this,m); this.X=F},Vd=function(){g.d.call(this,{U:"div", J:"ytp-mdx-popup-dialog",D:{role:"dialog"},T:[{U:"div",J:"ytp-mdx-popup-dialog-inner-content",T:[{U:"div",J:"ytp-mdx-popup-title",G0:"You're signed out"},{U:"div",J:"ytp-mdx-popup-description",G0:"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."},{U:"div",J:"ytp-mdx-privacy-popup-buttons",T:[{U:"button",UR:["ytp-button","ytp-mdx-privacy-popup-cancel"],G0:"Cancel"},{U:"button",UR:["ytp-button", "ytp-mdx-privacy-popup-confirm"],G0:"Confirm"}]}]}]});this.fade=new g.Jd(this,250);this.cancelButton=this.Vc("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Vc("ytp-mdx-privacy-popup-confirm");g.Q(this,this.fade);this.K(this.cancelButton,"click",this.X);this.K(this.confirmButton,"click",this.B)},jN=function(m){g.d.call(this,{U:"div", J:"ytp-remote",T:[{U:"div",J:"ytp-remote-display-status",T:[{U:"div",J:"ytp-remote-display-status-icon",T:[g.kRB()]},{U:"div",J:"ytp-remote-display-status-text",G0:"{{statustext}}"}]}]});this.api=m;this.fade=new g.Jd(this,250);g.Q(this,this.fade);this.K(m,"presentingplayerstatechange",this.onStateChange);this.UM(m.getPlayerStateObject())},In=function(m,F){g.p9.call(this,"Play on",1,m,F); this.j=m;this.Al={};this.K(m,"onMdxReceiversChange",this.B);this.K(m,"presentingplayerstatechange",this.B);this.B()},YwN=function(m){g.$G.call(this,m); this.yP={key:Wh2(),name:"This computer"};this.r9=null;this.subscriptions=[];this.YJ=this.PR=null;this.Al=[this.yP];this.HC=this.yP;this.wF=new g.aQ(64);this.u8=0;this.yg=-1;this.v3=!1;this.gs=this.VS=this.Bx=null;if(!g.Hs(this.player.C())&&!g.Z9(this.player.C())){m=this.player;var F=g.x5(m);F&&(F=F.eb())&&(F=new In(m,F),g.Q(this,F));F=new jN(m);g.Q(this,F);g.Jb(m,F.element,4);this.Bx=new Vd;g.Q(this,this.Bx);g.Jb(m,this.Bx.element,4);this.v3=!!LL()}},Rn=function(m){m.VS&&(m.player.removeEventListener("presentingplayerstatechange", m.VS),m.VS=null)},apq=function(m,F,L){m.wF=L; m.player.publish("presentingplayerstatechange",new g.ys(L,F))},$O=function(m,F){if(F.key!==m.HC.key)if(F.key===m.yP.key)rX(); else if($98(m)&&D9R(m),m.HC=F,!g.Z9(m.player.C())){var L=m.player.getPlaylistId();var u=m.player.getVideoData({playerType:1});var q=u.videoId;if(!L&&!q||(m.player.getAppState()===2||m.player.getAppState()===1)&&m.player.C().N("should_clear_video_data_on_player_cued_unstarted"))u=null;else{var A=m.player.getPlaylist();if(A){var r=[];for(var G=0;G2*this.size&&Lj(this),!0):!1}; g.P.get=function(m,F){return m9(this.B,m)?this.B[m]:F}; g.P.set=function(m,F){m9(this.B,m)||(this.size+=1,this.X.push(m),this.Ey++);this.B[m]=F}; g.P.forEach=function(m,F){for(var L=this.qe(),u=0;u=u.X.length)return g.ld;var A=u.X[F++];return g.om(m?A:u.B[A])}; return q}; var Xkt={Ii0:"atp",vFz:"ska",F2b:"que",sMC:"mus",HP0:"sus",you:"dsp",muW:"seq",kD0:"mic",I7C:"dpa",Uz9:"mlm",bnC:"dsdtr",FR0:"ntb",Sqz:"vsp",suW:"scn",oh0:"rpe",z3u:"dcn",h3c:"dcp",mz0:"pas",B90:"drq",pyu:"opf",xe8:"els",Uec:"isg",Snc:"svq",xz8:"mvp",VcC:"ads",ecc:"stcp",zcz:"sads",XMF:"dloc",VsW:"dcw",l90:"asw",v1P:"apw",kiR:"wrc",Hx8:"pcw",cOR:"ipv",KRW:"ndt",n_c:"ctops",f79:"gsrm"},t4m={qqb:"u",w1P:"cl",ReN:"k",MGP:"i",mPC:"cr",Y9P:"m",pM9:"g",HB:"up"},usC={PV:"adPlaying",aS:"onAdStateChange"}, qcC={oqC:"nowPlaying",DzC:"onStateChange",PV:"adPlaying",aS:"onAdStateChange",RS:"nowPlayingShorts",di:"onShortsStateChange"},A$N={RS:"nowPlayingShorts",di:"onShortsStateChange"};up.prototype.equals=function(m){return m?this.id==m.id:!1}; var dcc="",wS=null,v9e=uCC("loadCastFramework")||uCC("loadCastApplicationFramework"),VAC=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.W2(I7,g.O);g.P=I7.prototype;g.P.Yx=function(m){this.V=arguments;this.X=!1;this.oH?this.G=g.ke()+this.R6:this.oH=g.Eg(this.Y,this.R6)}; g.P.stop=function(){this.oH&&(g.DC.clearTimeout(this.oH),this.oH=null);this.G=null;this.X=!1;this.V=[]}; g.P.pause=function(){++this.B}; g.P.resume=function(){this.B&&(--this.B,!this.B&&this.X&&(this.X=!1,this.L.apply(null,this.V)))}; g.P.IW=function(){this.stop();I7.FF.IW.call(this)}; g.P.jh=function(){this.oH&&(g.DC.clearTimeout(this.oH),this.oH=null);this.G?(this.oH=g.Eg(this.Y,this.G-g.ke()),this.G=null):this.B?this.X=!0:(this.X=!1,this.L.apply(null,this.V))};var $T=null;R7.prototype.set=function(m){this.X=m}; R7.prototype.reset=function(){this.set(g.ke())}; R7.prototype.get=function(){return this.X};g.W2(R_m,IfC);eW.prototype.stringify=function(m){return g.DC.JSON.stringify(m,void 0)}; eW.prototype.parse=function(m){return g.DC.JSON.parse(m,void 0)};g.W2($56,g.L4);g.W2(e_R,g.L4);var PTq=null;g.W2(g9f,g.L4);g.W2(z_c,g.L4);g.W2(Yff,g.L4);zS.prototype.debug=function(){}; zS.prototype.info=function(){}; zS.prototype.warning=function(){};var x56={},ffC={};g.P=a7.prototype;g.P.setTimeout=function(m){this.RW=m}; g.P.Lk=function(m){m=m.target;var F=this.AF;F&&g.dE(m)==3?F.w1():this.HT(m)}; g.P.HT=function(m){try{if(m==this.X)a:{var F=g.dE(this.X),L=this.X.B,u=this.X.getStatus();if(!(F<3)&&(F!=3||this.X&&(this.B.B||g.BV(this.X)||g.HV(this.X)))){this.jY||F!=4||L==7||(L==8||u<=0?Px(3):Px(2));Sf8(this);var q=this.X.getStatus();this.BR=q;var A=KV8(this);if(this.L=q==200){if(this.HR&&!this.w8){b:{if(this.X){var r=g.JI(this.X,"X-HTTP-Initial-Response");if(r&&!g.J9(r)){var G=r;break b}}G=null}if(m=G)this.w8=!0,O3m(this,m);else{this.L=!1;this.Y=3;ip(12);TS(this);Nj(this);break a}}if(this.Qc){m= !0;for(var v;!this.jY&&this.Z0&&!this.Eu&&(this.Eu=!0,this.G.Lq(this)):(TS(this),Nj(this))}else O3m(this,A);F==4&&TS(this);this.L&&!this.jY&&(F==4?o98(this.G,this):(this.L=!1,DK(this)))}else g.EBZ(this.X),q==400&&A.indexOf("Unknown SID")> 0?(this.Y=3,ip(12)):(this.Y=0,ip(13)),TS(this),Nj(this)}}}catch(l){}finally{}}; g.P.cancel=function(){this.jY=!0;TS(this)}; g.P.NA=function(){this.Bb=null;var m=Date.now();m-this.q0>=0?(this.Lu!=2&&(Px(3),ip(17)),TS(this),this.Y=2,Nj(this)):Z3f(this,this.q0-m)}; g.P.getLastError=function(){return this.Y}; g.P.s0=function(){return this.X};sPe.prototype.cancel=function(){this.G=c4C(this);if(this.B)this.B.cancel(),this.B=null;else if(this.X&&this.X.size!==0){for(var m=g.Z(this.X.values()),F=m.next();!F.done;F=m.next())F.value.cancel();this.X.clear()}};g.P=H3G.prototype;g.P.VR=8;g.P.o9=1;g.P.connect=function(m,F,L,u){ip(0);this.GY=m;this.jY=F||{};L&&u!==void 0&&(this.jY.OSID=L,this.jY.OAID=u);this.AF=this.fI;this.xC=kEf(this,null,this.GY);xT(this)}; g.P.disconnect=function(){CTR(this);if(this.o9==3){var m=this.Cu++,F=this.xC.clone();g.VP(F,"SID",this.V);g.VP(F,"RID",m);g.VP(F,"TYPE","terminate");SW(this,F);m=new a7(this,this.V,m);m.Lu=2;m.W=Hi(F.clone());F=!1;if(g.DC.navigator&&g.DC.navigator.sendBeacon)try{F=g.DC.navigator.sendBeacon(m.W.toString(),"")}catch(L){}!F&&g.DC.Image&&((new Image).src=m.W,F=!0);F||(m.X=Nmc(m.G,null),m.X.send(m.W));m.Hb=Date.now();DK(m)}A26(this)}; g.P.ju=function(){return this.o9==0}; g.P.getState=function(){return this.o9}; g.P.Mt=function(m){if(this.L)if(this.L=null,this.o9==1){if(!m){this.Cu=Math.floor(Math.random()*1E5);m=this.Cu++;var F=new a7(this,"",m),L=this.hF;this.HR&&(L?(L=g.Sq(L),g.t9(L,this.HR)):L=this.HR);this.Z!==null||this.q0||(F.xC=L,L=null);var u;if(this.SY)a:{for(var q=u=0;q4096){u=q;break a}if(u===4096||q===this.G.length-1){u=q+1;break a}}u= this.YW}else u=this.YW;u=L1t(this,F,u);q=this.xC.clone();g.VP(q,"RID",m);g.VP(q,"CVER",22);this.Qc&&g.VP(q,"X-HTTP-Session-Id",this.Qc);SW(this,q);L&&(this.q0?u="headers="+g.QK(g.ytM(L))+"&"+u:this.Z&&g.Rw(q,this.Z,L));U52(this.B,F);this.Kw&&g.VP(q,"TYPE","init");this.SY?(g.VP(q,"$req",u),g.VP(q,"SID","null"),F.HR=!0,Tm6(F,q,null)):Tm6(F,q,u);this.o9=2}}else this.o9==3&&(m?uKf(this,m):this.G.length==0||b3m(this.B)||uKf(this))}; g.P.vT=function(){this.W=null;qLR(this);if(this.Th&&!(this.RW||this.X==null||this.Xt<=0)){var m=4*this.Xt;this.ER=gS((0,g.ER)(this.xmC,this),m)}}; g.P.xmC=function(){this.ER&&(this.ER=null,this.AF=!1,this.RW=!0,ip(10),Kj(this),qLR(this))}; g.P.Lq=function(m){this.X==m&&this.Th&&!this.RW&&(J46(this),this.RW=!0,ip(11))}; g.P.JA=function(){this.Bb!=null&&(this.Bb=null,Kj(this),tAG(this),ip(19))}; g.P.tbb=function(m){m?ip(2):ip(1)}; g.P.isActive=function(){return!!this.Y&&this.Y.isActive(this)}; g.P=y2t.prototype;g.P.e6=function(){}; g.P.Eo=function(){}; g.P.QR=function(){}; g.P.Oo=function(){}; g.P.isActive=function(){return!0}; g.P.Zy=function(){};g.W2(XI,g.eT);XI.prototype.open=function(){this.X.Y=this.G;this.L&&(this.X.w8=!0);this.X.connect(this.Y,this.B||void 0)}; XI.prototype.close=function(){this.X.disconnect()}; XI.prototype.send=function(m){var F=this.X;if(typeof m==="string"){var L={};L.__data__=m;m=L}else this.V&&(L={},L.__data__=g.WV(m),m=L);F.G.push(new QPC(F.oR++,m));F.o9==3&&xT(F)}; XI.prototype.IW=function(){this.X.Y=null;delete this.G;this.X.disconnect();delete this.X;XI.FF.IW.call(this)}; g.W2(vtG,$56);g.W2(lAc,e_R);g.W2(o7,y2t);o7.prototype.e6=function(){this.X.dispatchEvent("m")}; o7.prototype.Eo=function(m){this.X.dispatchEvent(new vtG(m))}; o7.prototype.QR=function(m){this.X.dispatchEvent(new lAc(m))}; o7.prototype.Oo=function(){this.X.dispatchEvent("n")}; wQ6.prototype.commit=function(m){this.X.BR=m};var EV=new g.eT;g.Y(jMZ,g.L4);g.P=kT.prototype;g.P.wS=null;g.P.Au=!1;g.P.L1=null;g.P.kt=null;g.P.xB=null;g.P.sY=null;g.P.Es=null;g.P.x$=null;g.P.oo=null;g.P.vW=null;g.P.j5=0;g.P.zJ=null;g.P.Y$=null;g.P.FX=null;g.P.Us=-1;g.P.qM=!0;g.P.e7=!1;g.P.lR=0;g.P.UY=null;var idc={},PKe={};g.P=kT.prototype;g.P.setTimeout=function(m){this.B=m}; g.P.Fp=function(m){m=m.target;var F=this.UY;F&&g.dE(m)==3?F.w1():this.Uo(m)}; g.P.Uo=function(m){try{if(m==this.vW)a:{var F=g.dE(this.vW),L=this.vW.B,u=this.vW.getStatus();if(g.T0&&!g.Fl("420+")){if(F<4)break a}else if(F<3||F==3&&!g.BV(this.vW))break a;this.e7||F!=4||L==7||(L==8||u<=0?this.X.Dd(3):this.X.Dd(2));YL8(this);var q=this.vW.getStatus();this.Us=q;var A=g.BV(this.vW);if(this.Au=q==200){F==4&&hm(this);if(this.Qc){for(m=!0;!this.e7&&this.j50?(this.FX=3,UV(13)):(this.FX=0,UV(14)),hm(this),aAR(this)}}catch(G){}finally{}}; g.P.cancel=function(){this.e7=!0;hm(this)}; g.P.w7=function(){this.L1=null;var m=Date.now();m-this.kt>=0?(this.sY!=2&&this.X.Dd(3),hm(this),this.FX=2,UV(18),aAR(this)):zMe(this,this.kt-m)}; g.P.getLastError=function(){return this.FX};g.P=pQ8.prototype;g.P.Qi=null;g.P.r3=null;g.P.ED=!1;g.P.EN=null;g.P.Ao=null;g.P.nP=-1;g.P.Nk=null;g.P.HK=null;g.P.connect=function(m){this.EN=m;m=OV(this.X,null,this.EN);UV(3);Date.now();var F=this.X.hF;F!=null?(this.Nk=F[0],(this.HK=F[1])?(this.Ao=1,K1C(this)):(this.Ao=2,fAc(this))):(J6(m,"MODE","init"),this.r3=new kT(this),this.r3.wS=this.Qi,$kt(this.r3,m,!1,null,!0),this.Ao=0)}; g.P.PB=function(m){if(m)this.Ao=2,fAc(this);else{UV(4);var F=this.X;F.Gz=F.Gj.nP;cx(F,9)}m&&this.Dd(2)}; g.P.MF=function(m){return this.X.MF(m)}; g.P.abort=function(){this.r3&&(this.r3.cancel(),this.r3=null);this.nP=-1}; g.P.ju=function(){return!1}; g.P.Yy=function(m,F){this.nP=m.Us;if(this.Ao==0)if(F){try{var L=this.B.parse(F)}catch(u){m=this.X;m.Gz=this.nP;cx(m,2);return}this.Nk=L[0];this.HK=L[1]}else m=this.X,m.Gz=this.nP,cx(m,2);else this.Ao==2&&(this.ED?(UV(7),Date.now()):F=="11111"?(UV(6),this.ED=!0,Date.now(),this.nP=200,this.r3.cancel(),UV(12),QI(this.X,this,!0)):(UV(8),Date.now(),this.ED=!1))}; g.P.tL=function(){this.nP=this.r3.Us;if(this.r3.Au)this.Ao==0?this.HK?(this.Ao=1,K1C(this)):(this.Ao=2,fAc(this)):this.Ao==2&&(this.ED?(UV(12),QI(this.X,this,!0)):(UV(11),QI(this.X,this,!1)));else{this.Ao==0?UV(9):this.Ao==2&&UV(10);var m=this.X;this.r3.getLastError();m.Gz=this.nP;cx(m,2)}}; g.P.YB=function(){return this.X.YB()}; g.P.isActive=function(){return this.X.isActive()}; g.P.Dd=function(m){this.X.Dd(m)};g.P=xkc.prototype;g.P.Kn=null;g.P.j7=null;g.P.H1=null;g.P.DI=null;g.P.UN=null;g.P.LU=null;g.P.j6=null;g.P.er=null;g.P.Nq=0;g.P.Kk=0;g.P.AK=null;g.P.KC=null;g.P.r_=null;g.P.KQ=null;g.P.Gj=null;g.P.FR=null;g.P.F7=-1;g.P.Nt=-1;g.P.Gz=-1;g.P.Zj=0;g.P.JG=0;g.P.A$=8;var Tz6={OK:0,cJb:2,bTR:4,A28:5,T_W:6,STOP:7,W5:8,kNc:9,VTW:10,lib:11,McW:12};g.W2(Zd6,g.L4);g.W2(SL8,g.L4);g.P=xkc.prototype; g.P.connect=function(m,F,L,u,q){UV(0);this.UN=F;this.j7=L||{};u&&q!==void 0&&(this.j7.OSID=u,this.j7.OAID=q);this.W?(tm((0,g.ER)(this.Ya,this,m),100),XQq(this)):this.Ya(m)}; g.P.disconnect=function(){thm(this);if(this.X==3){var m=this.Nq++,F=this.LU.clone();g.VP(F,"SID",this.V);g.VP(F,"RID",m);g.VP(F,"TYPE","terminate");bp(this,F);m=new kT(this,this.V,m);m.sY=2;m.Es=Hi(F.clone());(new Image).src=m.Es.toString();m.xB=Date.now();eM6(m)}c2C(this)}; g.P.Ya=function(m){this.Gj=new pQ8(this);this.Gj.Qi=this.Kn;this.Gj.B=this.Y;this.Gj.connect(m)}; g.P.ju=function(){return this.X==0}; g.P.getState=function(){return this.X}; g.P.Jw=function(m){this.KC=null;W1f(this,m)}; g.P.La=function(){this.r_=null;this.DI=new kT(this,this.V,"rpc",this.Z);this.DI.wS=this.Kn;this.DI.lR=0;var m=this.j6.clone();g.VP(m,"RID","rpc");g.VP(m,"SID",this.V);g.VP(m,"CI",this.FR?"0":"1");g.VP(m,"AID",this.F7);bp(this,m);g.VP(m,"TYPE","xmlhttp");$kt(this.DI,m,!0,this.er,!1)}; g.P.Yy=function(m,F){if(this.X!=0&&(this.DI==m||this.H1==m))if(this.Gz=m.Us,this.H1==m&&this.X==3)if(this.A$>7){try{var L=this.Y.parse(F)}catch(u){L=null}if(Array.isArray(L)&&L.length==3)if(m=L,m[0]==0)a:{if(!this.r_){if(this.DI)if(this.DI.xB+3E30)){if(u=F==1)this.H1||this.KC||this.X==1||this.Zj>=2?u=!1:(this.KC=tm((0,g.ER)(this.Jw,this,m),QMC(this,this.Zj)),this.Zj++, u=!0);u=!(u||F==2&&sMe(this))}if(u)switch(L){case 1:cx(this,5);break;case 4:cx(this,10);break;case 3:cx(this,6);break;case 7:cx(this,12);break;default:cx(this,2)}}}; g.P.AA=function(m){if(!g.nc(arguments,this.X))throw Error("Unexpected channel state: "+this.X);}; g.P.Q6P=function(m){m?UV(2):(UV(1),bd8(this,8))}; g.P.MF=function(m){if(m)throw Error("Can't create secondary domain capable XhrIo object.");m=new g.sg;m.Z=!1;return m}; g.P.isActive=function(){return!!this.AK&&this.AK.isActive(this)}; g.P.Dd=function(m){var F=EV;F.dispatchEvent(new SL8(F,m))}; g.P.YB=function(){return!1}; new R_m;g.P=dkc.prototype;g.P.Fn=function(){}; g.P.wl=function(){}; g.P.ih=function(){}; g.P.ZE=function(){}; g.P.xt=function(){}; g.P.Aw=function(){return{}}; g.P.isActive=function(){return!0};g.P=nte.prototype;g.P.enqueue=function(m){this.B.push(m)}; g.P.isEmpty=function(){return this.X.length===0&&this.B.length===0}; g.P.clear=function(){this.X=[];this.B=[]}; g.P.contains=function(m){return g.nc(this.X,m)||g.nc(this.B,m)}; g.P.remove=function(m){var F=this.X;var L=(0,g.oLZ)(F,m);L>=0?(g.Cc(F,L),F=!0):F=!1;return F||g.Fd(this.B,m)}; g.P.hO=function(){for(var m=[],F=this.X.length-1;F>=0;--F)m.push(this.X[F]);F=this.B.length;for(var L=0;L0&&(this.L.Alb(this.B.C2(),this.G,!0),this.L.KIC());this.L&&this.L.zDb();this.G?(this.B.stop(),g.eO(this.B),this.B=new dS(this.Cb,this),this.G=!1):this.B.reset();this.b9=null;this.Bb=0;if(this.V.length)if(this.Z)vQG(this);else{var m=this.V;this.V=[];var F=m.length;FIC(this);GRG(this,m,F);nj(this)}else nj(this)}; g.P.ZE=function(m){var F=m==2&&this.X.Gz==401;m==4||F||(this.G&&!this.B.isActive()&&(g.eO(this.B),this.B=new dS(this.Cb,this),this.G=!1),this.B.start());this.publish("handlerError",m,F);F=Object.keys(Tz6).find(function(L){return Tz6[L]===m}); this.aW.e_("BROWSER_CHANNEL",F!=null?F:"UNKNOWN")}; g.P.xt=function(m,F){if(!this.B.isActive())this.publish("handlerClosed");else if(F)for(var L=F.length,u=0;u=Nz6.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(m=Nz6[this.B],this.oH=g.eI((0,g.ER)(this.Id,this),m),this.B++):this.publish("pairingFailed",Error("Server error "+m.status))}; g.P.Wk=function(){this.X=null;this.publish("pairingFailed",Error("Server not responding"))}; var Nz6=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.W2(G3,ry);g.P=G3.prototype;g.P.start=function(){yy(this)&&this.publish("screenChange");!g.Xx("yt-remote-lounge-token-expiration")&&fPm(this);g.ie(this.X);this.X=g.eI((0,g.ER)(this.start,this),1E4)}; g.P.add=function(m,F){yy(this);Td8(this,m);v7(this,!1);this.publish("screenChange");F(m);m.token||fPm(this)}; g.P.remove=function(m,F){var L=yy(this);pnq(this,m)&&(v7(this,!1),L=!0);F(m);L&&this.publish("screenChange")}; g.P.Zz=function(m,F,L,u){var q=yy(this),A=this.get(m.id);A?(A.name!=F&&(A.name=F,v7(this,!1),q=!0),L(m)):u(Error("no such local screen."));q&&this.publish("screenChange")}; g.P.IW=function(){g.ie(this.X);G3.FF.IW.call(this)}; g.P.ezR=function(m){yy(this);var F=this.screens.length;m=m&&m.screens||[];for(var L=m.length,u=0;u20)break a;G=F(A,r)}A=G}q.name=A}L(Vy(this,q))},this), onError:(0,g.ER)(function(q){u(Error("pairing request failed: "+q.status))},this), onTimeout:(0,g.ER)(function(){u(Error("pairing request timed out."))},this)})}; g.P.IW=function(){g.eO(this.B);g.eO(this.X);wy.FF.IW.call(this)}; g.P.JFb=function(){WIm(this);this.publish("screenChange");this.X.update()}; wy.prototype.dispose=wy.prototype.dispose;g.W2(jD,g.LT);g.P=jD.prototype;g.P.Cf=function(m){this.sR()||(m&&(Rx(this,""+m),this.publish("sessionFailed")),this.X=null,this.publish("sessionScreen",null))}; g.P.info=function(m){Fi(this.Qc,m)}; g.P.cT=function(){return null}; g.P.j$=function(m){var F=this.B;m?(F.displayStatus=new chrome.cast.ReceiverDisplayStatus(m,[]),F.displayStatus.showStop=!0):F.displayStatus=null;chrome.cast.setReceiverDisplayStatus(F,(0,g.ER)(function(){this.info("Updated receiver status for "+F.friendlyName+": "+m)},this),(0,g.ER)(function(){Rx(this,"Failed to update receiver status for: "+F.friendlyName)},this))}; g.P.IW=function(){this.j$("");jD.FF.IW.call(this)};g.Y($L,jD);g.P=$L.prototype;g.P.sG=function(m){if(this.G){if(this.G==m)return;Rx(this,"Overriding cast session with new session object");mYR(this);this.Hb=!1;this.hF="unknown";this.G.removeUpdateListener(this.b9);this.G.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.ER)}this.G=m;this.G.addUpdateListener(this.b9);this.G.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.ER);nQR(this,"getMdxSessionStatus")}; g.P.xG=function(m){this.info("launchWithParams no-op for Cast: "+g.WV(m))}; g.P.stop=function(){this.G?this.G.stop((0,g.ER)(function(){this.Cf()},this),(0,g.ER)(function(){this.Cf(Error("Failed to stop receiver app."))},this)):this.Cf(Error("Stopping cast device without session."))}; g.P.j$=function(){}; g.P.IW=function(){this.info("disposeInternal");mYR(this);this.G&&(this.G.removeUpdateListener(this.b9),this.G.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.ER));this.G=null;jD.prototype.IW.call(this)}; g.P.eSc=function(m,F){if(!this.sR())if(F)if(F=CO(F),g.MN(F))switch(m=""+F.type,F=F.data||{},this.info("onYoutubeMessage_: "+m+" "+g.WV(F)),m){case "mdxSessionStatus":bAG(this,F);break;case "loungeToken":Bdc(this,F);break;default:Rx(this,"Unknown youtube message: "+m)}else Rx(this,"Unable to parse message.");else Rx(this,"No data in message.")}; g.P.T$=function(m,F,L,u){g.ie(this.W);this.W=0;Uf2(this.V,this.B.label,m,this.B.friendlyName,(0,g.ER)(function(q){q?F(q):u>=0?(Rx(this,"Screen "+m+" appears to be offline. "+u+" retries left."),this.W=g.eI((0,g.ER)(this.T$,this,m,F,L,u-1),300)):L(Error("Unable to fetch screen."))},this),L)}; g.P.cT=function(){return this.G}; g.P.fk=function(m){this.sR()||m||(Rx(this,"Cast session died."),this.Cf())};g.Y(eD,jD);g.P=eD.prototype;g.P.sG=function(m){this.G=m;this.G.addUpdateListener(this.jY)}; g.P.xG=function(m){this.xC=m;this.Bb()}; g.P.stop=function(){GLc(this);this.G?this.G.stop((0,g.ER)(this.Cf,this,null),(0,g.ER)(this.Cf,this,"Failed to stop DIAL device.")):this.Cf()}; g.P.IW=function(){GLc(this);this.G&&this.G.removeUpdateListener(this.jY);this.G=null;jD.prototype.IW.call(this)}; g.P.d7=function(m){this.sR()||m||(Rx(this,"DIAL session died."),this.Y(),this.Y=function(){},this.Cf())};g.Y(gy,jD);gy.prototype.stop=function(){this.Cf()}; gy.prototype.sG=function(){}; gy.prototype.xG=function(){g.ie(this.G);this.G=NaN;var m=yI(this.V.ST(),this.B.label);m?Ix(this,m):this.Cf(Error("No such screen"))}; gy.prototype.IW=function(){g.ie(this.G);this.G=NaN;jD.prototype.IW.call(this)};g.Y(z3,g.LT);g.P=z3.prototype; g.P.init=function(m,F){chrome.cast.timeout.requestSession=3E4;var L=new chrome.cast.SessionRequest(this.W,[chrome.cast.Capability.AUDIO_OUT]);g.YQ("desktop_enable_cast_connect")&&(L.androidReceiverCompatible=!0);this.hF||(L.dialRequest=new chrome.cast.DialRequest("YouTube"));var u=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;m=m||this.L?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var q=(0,g.ER)(this.UHz,this);L=new chrome.cast.ApiConfig(L,(0,g.ER)(this.o5, this),q,u,m);L.customDialLaunchCallback=(0,g.ER)(this.pPc,this);chrome.cast.initialize(L,(0,g.ER)(function(){this.sR()||(chrome.cast.addReceiverActionListener(this.Y),zve(),this.B.subscribe("onlineScreenChange",(0,g.ER)(this.DE,this)),this.G=wtt(this),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.ER)(function(A){this.Ty("Failed to set initial custom receivers: "+g.WV(A))},this)),this.publish("yt-remote-cast2-availability-change",ax(this)),F(!0))},this),(0,g.ER)(function(A){this.Ty("Failed to initialize API: "+ g.WV(A)); F(!1)},this))}; g.P.K70=function(m,F){YL("Setting connected screen ID: "+m+" -> "+F);if(this.X){var L=this.X.X;if(!m||L&&L.id!=m)YL("Unsetting old screen status: "+this.X.B.friendlyName),Ds(this,null)}if(m&&F){if(!this.X){m=yI(this.B.ST(),m);if(!m){YL("setConnectedScreenStatus: Unknown screen.");return}if(m.idType=="shortLived"){YL("setConnectedScreenStatus: Screen with id type to be short lived.");return}L=vgR(this,m);L||(YL("setConnectedScreenStatus: Connected receiver not custom..."),L=new chrome.cast.Receiver(m.uuid? m.uuid:m.id,m.name),L.receiverType=chrome.cast.ReceiverType.CUSTOM,this.G.push(L),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.ER)(function(u){this.Ty("Failed to set initial custom receivers: "+g.WV(u))},this))); YL("setConnectedScreenStatus: new active receiver: "+L.friendlyName);Ds(this,new gy(this.B,L),!0)}this.X.j$(F)}else YL("setConnectedScreenStatus: no screen.")}; g.P.D5Y=function(m){this.sR()?this.Ty("Setting connection data on disposed cast v2"):this.X?this.X.xG(m):this.Ty("Setting connection data without a session")}; g.P.Pk=function(){this.sR()?this.Ty("Stopping session on disposed cast v2"):this.X?(this.X.stop(),Ds(this,null)):YL("Stopping non-existing session")}; g.P.requestSession=function(){chrome.cast.requestSession((0,g.ER)(this.o5,this),(0,g.ER)(this.WA0,this))}; g.P.IW=function(){this.B.unsubscribe("onlineScreenChange",(0,g.ER)(this.DE,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.Y);var m=Pem,F=g.NN("yt.mdx.remote.debug.handlers_");g.Fd(F||[],m);g.eO(this.X);g.LT.prototype.IW.call(this)}; g.P.Ty=function(m){Fi("Controller",m)}; g.P.Kl=function(m,F){this.X==m&&(F||Ds(this,null),this.publish("yt-remote-cast2-session-change",F))}; g.P.tUN=function(m,F){if(!this.sR())if(m)switch(m.friendlyName=chrome.cast.unescape(m.friendlyName),YL("onReceiverAction_ "+m.label+" / "+m.friendlyName+"-- "+F),F){case chrome.cast.ReceiverAction.CAST:if(this.X)if(this.X.B.label!=m.label)YL("onReceiverAction_: Stopping active receiver: "+this.X.B.friendlyName),this.X.stop();else{YL("onReceiverAction_: Casting to active receiver.");this.X.X&&this.publish("yt-remote-cast2-session-change",this.X.X);break}switch(m.receiverType){case chrome.cast.ReceiverType.CUSTOM:Ds(this, new gy(this.B,m));break;case chrome.cast.ReceiverType.DIAL:Ds(this,new eD(this.B,m,this.V,this.config_));break;case chrome.cast.ReceiverType.CAST:Ds(this,new $L(this.B,m,this.config_));break;default:this.Ty("Unknown receiver type: "+m.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.X&&this.X.B.label==m.label?this.X.stop():this.Ty("Stopping receiver w/o session: "+m.friendlyName)}else this.Ty("onReceiverAction_ called without receiver.")}; g.P.pPc=function(m){if(this.sR())return Promise.reject(Error("disposed"));var F=m.receiver;F.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Ty("Not DIAL receiver: "+F.friendlyName),F.receiverType=chrome.cast.ReceiverType.DIAL);var L=this.X?this.X.B:null;if(!L||L.label!=F.label)return this.Ty("Receiving DIAL launch request for non-clicked DIAL receiver: "+F.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(L&&L.label==F.label&&L.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.X.X)return YL("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.X.X),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Ty('Changing CAST intent from "'+L.receiverType+'" to "dial" for '+F.friendlyName);Ds(this,new eD(this.B,F,this.V,this.config_))}F=this.X;F.W=m;F.W.appState==chrome.cast.DialAppState.RUNNING?(m=F.W.extraData||{},L=m.screenId||null,P7(F)&&m.loungeToken?m.loungeTokenRefreshIntervalMs?m=ASq(F,{name:F.B.friendlyName,screenId:m.screenId,loungeToken:m.loungeToken,dialId:F.W.receiver.label, screenIdType:"shortLived"},m.loungeTokenRefreshIntervalMs):(g.mI(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(m)+".")),m=rSZ(F,L)):m=rSZ(F,L)):m=uxG(F);return m}; g.P.o5=function(m){var F=this;if(!this.sR()&&!this.L){YL("New cast session ID: "+m.sessionId);var L=m.receiver;if(L.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.X)if(L.receiverType==chrome.cast.ReceiverType.CAST)YL("Got resumed cast session before resumed mdx connection."),L.friendlyName=chrome.cast.unescape(L.friendlyName),Ds(this,new $L(this.B,L,this.config_),!0);else{this.Ty("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var u=this.X.B,q=yI(this.B.ST(), u.label);q&&Am(q,L.label)&&u.receiverType!=chrome.cast.ReceiverType.CAST&&L.receiverType==chrome.cast.ReceiverType.CAST&&(YL("onSessionEstablished_: manual to cast session change "+L.friendlyName),g.eO(this.X),this.X=new $L(this.B,L,this.config_),this.X.subscribe("sessionScreen",(0,g.ER)(this.Kl,this,this.X)),this.X.subscribe("sessionFailed",function(){return lNq(F,F.X)}),this.X.xG(null)); this.X.sG(m)}}}; g.P.mZ=function(){return this.X?this.X.cT():null}; g.P.WA0=function(m){this.sR()||(this.Ty("Failed to estabilish a session: "+g.WV(m)),m.code!=chrome.cast.ErrorCode.CANCEL&&Ds(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.P.UHz=function(m){YL("Receiver availability updated: "+m);if(!this.sR()){var F=ax(this);this.Z=m==chrome.cast.ReceiverAvailability.AVAILABLE;ax(this)!=F&&this.publish("yt-remote-cast2-availability-change",ax(this))}}; g.P.DE=function(){this.sR()||(this.G=wtt(this),YL("Updating custom receivers: "+g.WV(this.G)),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.ER)(function(){this.Ty("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",ax(this)))}; z3.prototype.setLaunchParams=z3.prototype.D5Y;z3.prototype.setConnectedScreenStatus=z3.prototype.K70;z3.prototype.stopSession=z3.prototype.Pk;z3.prototype.getCastSession=z3.prototype.mZ;z3.prototype.requestSession=z3.prototype.requestSession;z3.prototype.init=z3.prototype.init;z3.prototype.dispose=z3.prototype.dispose;var pTZ=g.cN(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),z4R=[],Psm=g.j3(pTZ);g.P=MS.prototype; g.P.reset=function(m){this.listId="";this.index=-1;this.videoId="";pte(this);this.volume=-1;this.muted=!1;m&&(this.index=m.index,this.listId=m.listId,this.videoId=m.videoId,this.playerState=m.playerState,this.volume=m.volume,this.muted=m.muted,this.audioTrackId=m.audioTrackId,this.trackData=m.trackData,this.hasPrevious=m.hasPrevious,this.hasNext=m.hasNext,this.L=m.playerTime,this.Y=m.playerTimeAt,this.B=m.seekableStart,this.Z=m.seekableEnd,this.G=m.duration,this.loadedTime=m.loadedTime,this.X=m.liveIngestionTime, this.V=!isNaN(this.X))}; g.P.isPlaying=function(){return this.playerState==1}; g.P.isBuffering=function(){return this.playerState==3}; g.P.xE=function(m){this.G=isNaN(m)?0:m}; g.P.getDuration=function(){return this.V?this.G+Zs(this):this.G}; g.P.clone=function(){return new MS(fNe(this))};g.Y(EB,g.LT);g.P=EB.prototype;g.P.getState=function(){return this.G}; g.P.Zl=function(){return this.V.getReconnectTimeout()}; g.P.cU=function(){this.V.reconnect()}; g.P.play=function(){kL(this)?(this.X?this.X.play(null,g.bI,Qy(this,"play")):OB(this,"play"),Z7C(this,1,ox(UB(this))),this.publish("remotePlayerChange")):hT(this,this.play)}; g.P.pause=function(){kL(this)?(this.X?this.X.pause(null,g.bI,Qy(this,"pause")):OB(this,"pause"),Z7C(this,2,ox(UB(this))),this.publish("remotePlayerChange")):hT(this,this.pause)}; g.P.seekTo=function(m){if(kL(this)){if(this.X){var F=UB(this),L=new chrome.cast.media.SeekRequest;L.currentTime=m;F.isPlaying()||F.isBuffering()?L.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:L.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.X.seek(L,g.bI,Qy(this,"seekTo",{newTime:m}))}else OB(this,"seekTo",{newTime:m});Z7C(this,3,m);this.publish("remotePlayerChange")}else hT(this,g.UR(this.seekTo,m))}; g.P.stop=function(){if(kL(this)){this.X?this.X.stop(null,g.bI,Qy(this,"stopVideo")):OB(this,"stopVideo");var m=UB(this);m.index=-1;m.videoId="";pte(m);W7(this,m);this.publish("remotePlayerChange")}else hT(this,this.stop)}; g.P.setVolume=function(m,F){if(kL(this)){var L=UB(this);if(this.B){if(L.volume!=m){var u=Math.round(m)/100;this.B.setReceiverVolumeLevel(u,(0,g.ER)(function(){Lf("set receiver volume: "+u)},this),(0,g.ER)(function(){this.Ty("failed to set receiver volume.")},this))}L.muted!=F&&this.B.setReceiverMuted(F,(0,g.ER)(function(){Lf("set receiver muted: "+F)},this),(0,g.ER)(function(){this.Ty("failed to set receiver muted.")},this))}else{var q={volume:m, muted:F};L.volume!=-1&&(q.delta=m-L.volume);OB(this,"setVolume",q)}L.muted=F;L.volume=m;W7(this,L)}else hT(this,g.UR(this.setVolume,m,F))}; g.P.rl=function(m,F){if(kL(this)){var L=UB(this);m={videoId:m};F&&(L.trackData={trackName:F.name,languageCode:F.languageCode,sourceLanguageCode:F.translationLanguage?F.translationLanguage.languageCode:"",languageName:F.languageName,kind:F.kind},m.style=g.WV(F.style),g.t9(m,L.trackData));OB(this,"setSubtitlesTrack",m);W7(this,L)}else hT(this,g.UR(this.rl,m,F))}; g.P.setAudioTrack=function(m,F){kL(this)?(F=F.getLanguageInfo().getId(),OB(this,"setAudioTrack",{videoId:m,audioTrackId:F}),m=UB(this),m.audioTrackId=F,W7(this,m)):hT(this,g.UR(this.setAudioTrack,m,F))}; g.P.playVideo=function(m,F,L,u,q,A,r){u=u===void 0?null:u;q=q===void 0?null:q;A=A===void 0?null:A;r=r===void 0?null:r;var G=UB(this),v={videoId:m};L!==void 0&&(v.currentIndex=L);Xi(G,m,L||0);F!==void 0&&(SD(G,F),v.currentTime=F);u&&(v.listId=u);q&&(v.playerParams=q);A&&(v.clickTrackingParams=A);r&&(v.locationInfo=g.WV(r));OB(this,"setPlaylist",v);u||W7(this,G)}; g.P.Gc=function(m,F){if(kL(this)){if(m&&F){var L=UB(this);Xi(L,m,F);W7(this,L)}OB(this,"previous")}else hT(this,g.UR(this.Gc,m,F))}; g.P.nextVideo=function(m,F){if(kL(this)){if(m&&F){var L=UB(this);Xi(L,m,F);W7(this,L)}OB(this,"next")}else hT(this,g.UR(this.nextVideo,m,F))}; g.P.FH=function(){if(kL(this)){OB(this,"clearPlaylist");var m=UB(this);m.reset();W7(this,m);this.publish("remotePlayerChange")}else hT(this,this.FH)}; g.P.m$=function(){kL(this)?OB(this,"dismissAutoplay"):hT(this,this.m$)}; g.P.dispose=function(){if(this.G!=3){var m=this.G;this.G=3;this.publish("proxyStateChange",m,this.G)}g.LT.prototype.dispose.call(this)}; g.P.IW=function(){MQR(this);this.V=null;this.Y.clear();tT(this,null);g.LT.prototype.IW.call(this)}; g.P.wZ=function(m){if((m!=this.G||m==2)&&this.G!=3&&m!=0){var F=this.G;this.G=m;this.publish("proxyStateChange",F,m);if(m==1)for(;!this.Y.isEmpty();)F=m=this.Y,F.X.length===0&&(F.X=F.B,F.X.reverse(),F.B=[]),m.X.pop().apply(this);else m==3&&this.dispose()}}; g.P.MU0=function(m,F){this.publish(m,F)}; g.P.NJF=function(m){if(!m)this.r0(null),tT(this,null);else if(this.B.receiver.volume){m=this.B.receiver.volume;var F=UB(this),L=Math.round(100*m.level||0);if(F.volume!=L||F.muted!=m.muted)Lf("Cast volume update: "+m.level+(m.muted?" muted":"")),F.volume=L,F.muted=!!m.muted,W7(this,F)}}; g.P.r0=function(m){Lf("Cast media: "+!!m);this.X&&this.X.removeUpdateListener(this.W);if(this.X=m)this.X.addUpdateListener(this.W),Sam(this),this.publish("remotePlayerChange")}; g.P.jHF=function(m){m?(Sam(this),this.publish("remotePlayerChange")):this.r0(null)}; g.P.BS=function(){OB(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.P.ZAN=function(){var m=DY6();m&&tT(this,m)}; g.P.Ty=function(m){Fi("CP",m)};g.Y(c7,g.LT);g.P=c7.prototype; g.P.connect=function(m,F){if(F){var L=F.listId,u=F.videoId,q=F.videoIds,A=F.playerParams,r=F.clickTrackingParams,G=F.index,v={videoId:u},l=F.currentTime,w=F.locationInfo;F=F.loopMode;l!==void 0&&(v.currentTime=l<=5?0:l);A&&(v.playerParams=A);w&&(v.locationInfo=w);r&&(v.clickTrackingParams=r);L&&(v.listId=L);q&&q.length>0&&(v.videoIds=q.join(","));G!==void 0&&(v.currentIndex=G);this.jY&&(v.loopMode=F||"LOOP_MODE_OFF");L&&(this.X.listId=L);this.X.videoId=u;this.X.index=G||0;this.X.state=3;SD(this.X, l);this.Y="UNSUPPORTED";L=this.jY?"setInitialState":"setPlaylist";sB("Connecting with "+L+" and params: "+g.WV(v));this.B.connect({method:L,params:g.WV(v)},m,BJc())}else sB("Connecting without params"),this.B.connect({},m,BJc());Egt(this)}; g.P.kz=function(m){this.B.kz(m)}; g.P.dispose=function(){this.sR()||(g.Tt("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),b9(this,3));g.LT.prototype.dispose.call(this)}; g.P.IW=function(){UYZ(this);h48(this);kLG(this);g.ie(this.W);this.W=NaN;g.ie(this.hF);this.hF=NaN;this.V=null;g.NY(this.Bb);this.Bb.length=0;this.B.dispose();g.LT.prototype.IW.call(this);this.Y=this.Z=this.G=this.X=this.B=null}; g.P.Rv=function(m){if(!this.G||this.G.length===0)return!1;for(var F=g.Z(this.G),L=F.next();!L.done;L=F.next())if(!L.value.capabilities.has(m))return!1;return!0}; g.P.qU=function(){var m=3;this.sR()||(m=0,isNaN(this.UI())?this.B.Kd()&&isNaN(this.L)&&(m=1):m=2);return m}; g.P.vc=function(m){sB("Disconnecting with "+m);g.Tt("yt.mdx.remote.remoteClient_",null);UYZ(this);this.publish("beforeDisconnect",m);m==1&&lp();this.B.disconnect(m);this.dispose()}; g.P.RF=function(){var m=this.X;this.V&&(m=this.X.clone(),Xi(m,this.V,m.index));return fNe(m)}; g.P.W7Y=function(m){var F=this,L=new MS(m);L.videoId&&L.videoId!=this.X.videoId&&(this.V=L.videoId,g.ie(this.W),this.W=g.eI(function(){if(F.V){var q=F.V;F.V=null;F.X.videoId!=q&&dy(F,"getNowPlaying")}},5E3)); var u=[];this.X.listId==L.listId&&this.X.videoId==L.videoId&&this.X.index==L.index||u.push("remoteQueueChange");this.X.playerState==L.playerState&&this.X.volume==L.volume&&this.X.muted==L.muted&&ox(this.X)==ox(L)&&g.WV(this.X.trackData)==g.WV(L.trackData)||u.push("remotePlayerChange");this.X.reset(m);g.eq(u,function(q){this.publish(q)},this)}; g.P.RD=function(){var m=this.B.getDeviceId(),F=g.c2(this.G,function(L){return L.type=="REMOTE_CONTROL"&&L.id!=m}); return F?F.id:""}; g.P.UI=function(){return this.B.Zl()}; g.P.Jz=function(){return this.Y||"UNSUPPORTED"}; g.P.ZU=function(){return this.Z||""}; g.P.T_=function(){!isNaN(this.UI())&&this.B.cU()}; g.P.F70=function(m,F){dy(this,m,F);O7C(this)}; g.P.Rq=function(){var m=g.Uc("SAPISID","")||g.Uc("__Secure-1PAPISID")||"",F=g.Uc("__Secure-3PAPISID","")||"";if(!m&&!F)return"";m=g.hP(g.kZ(m),2);F=g.hP(g.kZ(F),2);return g.hP(g.kZ(","+m+","+F),2)}; c7.prototype.subscribe=c7.prototype.subscribe;c7.prototype.unsubscribeByKey=c7.prototype.iU;c7.prototype.getProxyState=c7.prototype.qU;c7.prototype.disconnect=c7.prototype.vc;c7.prototype.getPlayerContextData=c7.prototype.RF;c7.prototype.setPlayerContextData=c7.prototype.W7Y;c7.prototype.getOtherConnectedRemoteId=c7.prototype.RD;c7.prototype.getReconnectTimeout=c7.prototype.UI;c7.prototype.getAutoplayMode=c7.prototype.Jz;c7.prototype.getAutoplayVideoId=c7.prototype.ZU;c7.prototype.reconnect=c7.prototype.T_; c7.prototype.sendMessage=c7.prototype.F70;c7.prototype.getXsrfToken=c7.prototype.Rq;c7.prototype.isCapabilitySupportedOnConnectedDevices=c7.prototype.Rv;g.Y(FyZ,ry);g.P=FyZ.prototype;g.P.ST=function(m){return this.us.$_gs(m)}; g.P.contains=function(m){return!!this.us.$_c(m)}; g.P.get=function(m){return this.us.$_g(m)}; g.P.start=function(){this.us.$_st()}; g.P.add=function(m,F,L){this.us.$_a(m,F,L)}; g.P.remove=function(m,F,L){this.us.$_r(m,F,L)}; g.P.Zz=function(m,F,L,u){this.us.$_un(m,F,L,u)}; g.P.IW=function(){for(var m=this.X.length,F=0;F1&&!this.j.getOption("remote","quickCast")?(this.Al=g.P5(m,this.X,this),this.fK(g.xZ(m,this.X)),m=this.j.getOption("remote","currentReceiver"),m=this.X(m),this.options[m]&&this.Kj(m),this.enable(!0)):this.enable(!1)}; In.prototype.X=function(m){return m.key}; In.prototype.Om=function(m){return m==="cast-selector-receiver"?"Cast...":this.Al[m].name}; In.prototype.rb=function(m){g.p9.prototype.rb.call(this,m);this.j.setOption("remote","currentReceiver",this.Al[m]);this.hW.Ns()};g.Y(YwN,g.$G);g.P=YwN.prototype; g.P.create=function(){var m=this.player.C(),F=g.Bs(m);m={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:m.N("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:m.N("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:m.N("enable_cast_short_lived_lounge_token")};rwG(F,m);this.subscriptions.push(g.J5("yt-remote-before-disconnect",this.Um9,this));this.subscriptions.push(g.J5("yt-remote-connection-change",this.xHz,this));this.subscriptions.push(g.J5("yt-remote-receiver-availability-change",this.Z8, this));this.subscriptions.push(g.J5("yt-remote-auto-connect",this.erC,this));this.subscriptions.push(g.J5("yt-remote-receiver-resumed",this.ErF,this));this.subscriptions.push(g.J5("mdx-privacy-popup-confirm",this.Psz,this));this.subscriptions.push(g.J5("mdx-privacy-popup-cancel",this.mw8,this));this.Z8()}; g.P.load=function(){this.player.cancelPlayback();g.$G.prototype.load.call(this);this.gs=new zQC(this.player.C(),this);this.player.Xr(this.gs);this.r9=new eQ8(this,this.player,this.PR);var m=(m=IpG())?m.currentTime:0;var F=wTq()?new EB(qG(),void 0):null;m==0&&F&&(m=ox(UB(F)));m!==0&&this.ev(m);apq(this,this.wF,this.wF);this.player.YF(6)}; g.P.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.AQ();this.HC=this.yP;g.PM(this.r9,this.PR);this.PR=this.gs=this.r9=null;g.$G.prototype.unload.call(this);this.player.YF(5);Rn(this)}; g.P.IW=function(){g.Cz(this.subscriptions);g.$G.prototype.IW.call(this)}; g.P.Oj=function(m){var F=g.eC.apply(1,arguments);this.loaded&&this.r9.Bu.apply(this.r9,[m].concat(g.X(F)))}; g.P.getAdState=function(){return this.yg}; g.P.hasPrevious=function(){return this.PR?UB(this.PR).hasPrevious:!1}; g.P.hasNext=function(){return this.PR?UB(this.PR).hasNext:!1}; g.P.ev=function(m,F){this.u8=m||0;this.player.publish("progresssync",m,F);this.player.TY("onVideoProgress",m||0)}; g.P.getCurrentTime=function(){return this.u8}; g.P.getDuration=function(){return UB(this.PR).getDuration()||0}; g.P.Bn=function(){var m=UB(this.PR);return m.V?m.X+Zs(m):m.X}; g.P.qP=function(){return UB(this.PR).loadedTime}; g.P.VZ=function(){return KcZ(UB(this.PR))}; g.P.Yp=function(){var m=UB(this.PR);return m.B>0?m.B+Zs(m):m.B}; g.P.getProgressState=function(){var m=UB(this.PR),F=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:m.playerState!=1081&&this.player.Nw(),clipEnd:F.clipEnd,clipStart:F.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.Bn(),isAtLiveHead:this.isAtLiveHead(),loaded:this.qP(),seekableEnd:this.VZ(),seekableStart:this.Yp(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.P.isAtLiveHead=function(){return KcZ(UB(this.PR))-this.getCurrentTime()<=1}; g.P.nextVideo=function(){this.PR&&this.PR.nextVideo()}; g.P.Gc=function(){this.PR&&this.PR.Gc()}; g.P.Um9=function(m){m===1&&(this.YJ=this.PR?UB(this.PR):null)}; g.P.xHz=function(){var m=wTq()?new EB(qG(),void 0):null;if(m){var F=this.HC;this.loaded&&this.unload();this.PR=m;this.YJ=null;F.key!==this.yP.key&&(this.HC=F,this.load())}else g.eO(this.PR),this.PR=null,this.loaded&&(this.unload(),(m=this.YJ)&&m.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(m.videoId,ox(m)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.P.Z8=function(){var m=[this.yP],F=m.concat,L=ywC();Kf()&&g.Xx("yt-remote-cast-available")&&L.push({key:"cast-selector-receiver",name:"Cast..."});this.Al=F.call(m,L);m=v1C()||this.yP;$O(this,m);this.player.TY("onMdxReceiversChange")}; g.P.erC=function(){var m=v1C();$O(this,m)}; g.P.ErF=function(){this.HC=v1C()}; g.P.Psz=function(){this.v3=!0;Rn(this);GY=!1;A8&&yd(A8,1);A8=null}; g.P.mw8=function(){this.v3=!1;Rn(this);$O(this,this.yP);this.HC=this.yP;GY=!1;A8=null;this.player.playVideo()}; g.P.DB=function(m,F){switch(m){case "casting":return this.loaded;case "receivers":return this.Al;case "currentReceiver":return F&&(F.key==="cast-selector-receiver"?TT6():$O(this,F)),this.loaded?this.HC:this.yP;case "quickCast":return this.Al.length===2&&this.Al[1].key==="cast-selector-receiver"?(F&&TT6(),!0):!1}}; g.P.BS=function(){this.PR.BS()}; g.P.Eg=function(){return!1}; g.P.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.P.isLoggedIn=function(){var m,F;return((m=g.HQ("PLAYER_CONFIG"))==null?void 0:(F=m.args)==null?void 0:F.authuser)!==void 0?!0:!(!g.HQ("SESSION_INDEX")&&!g.HQ("LOGGED_IN"))};g.R3("remote",YwN);})(_yt_player);