(function(g){var window=this;'use strict';var EAZ=function(S){if(S instanceof g.xq)return S;if(typeof S.Ky=="function")return S.Ky(!1);if(g.Mx(S)){var W=0,m=new g.xq;m.next=function(){for(;;){if(W>=S.length)return g.G2;if(W in S)return g.i9(S[W++]);W++}}; return m}throw Error("Not implemented");},zew=function(S,W,m){if(g.Mx(S))g.V3(S,W,m); else for(S=EAZ(S);;){var a=S.next();if(a.done)break;W.call(m,a.value,void 0,S)}},DS=function(S){g.Te(S,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.P9()).toString(36)); return S},ww=function(S,W,m){Array.isArray(m)||(m=[String(m)]); g.TMK(S.j,W,m)},y69=function(S,W){var m=[]; zew(W,function(a){try{var J=g.LE.prototype.U0.call(this,a,!0)}catch(B){if(B=="Storage: Invalid value was encountered")return;throw B;}J===void 0?m.push(a):g.L4_(J)&&m.push(a)},S); return m},YGp=function(S,W){y69(S,W).forEach(function(m){g.LE.prototype.remove.call(this,m)},S)},Gep=function(S){if(S.IL){if(S.IL.locationOverrideToken)return{locationOverrideToken:S.IL.locationOverrideToken}; if(S.IL.latitudeE7!=null&&S.IL.longitudeE7!=null)return{latitudeE7:S.IL.latitudeE7,longitudeE7:S.IL.longitudeE7}}return null},KuH=function(S,W){g.oZ(S,W)||S.push(W)},TjZ=function(S){var W=0,m; for(m in S)W++;return W},qG$=function(S,W){return g.lH(S,W)},pPH=function(S){try{return g.OQ.JSON.parse(S)}catch(W){}S=String(S); if(/^\s*$/.test(S)?0:/^[\],:{}\s\u2028\u2029]*$/.test(S.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("("+S+")")}catch(W){}throw Error("Invalid JSON string: "+S);},Sk=function(S){if(g.OQ.JSON)try{return g.OQ.JSON.parse(S)}catch(W){}return pPH(S)},Fuv=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/channel/opened",g.qr("channel_type"))},V6N=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/channel/closed",g.qr("channel_type"))},nAw=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/channel/message_received",g.qr("channel_type"))},sGN=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/channel/success")},ucZ=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/channel/error",g.qr("channel_type"),g.qr("error_type"))},gAx=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},OuN=function(){var S=g.$Z(); this.C=S;S.dj("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},jG9=function(S,W,m,a){var J=new g.Xl(null); S&&g.EG(J,S);W&&g.v_(J,W);m&&g.ze(J,m);a&&(J.N=a);return J},QG9=function(S,W){return new g.Wn(S,W)},Wy=function(S,W){return Object.prototype.hasOwnProperty.call(S,W)},XPN=function(S,W){return S===W},mi=function(S,W){this.N={}; this.C=[];this.yE=this.size=0;var m=arguments.length;if(m>1){if(m%2)throw Error("Uneven number of arguments");for(var a=0;a5&&(S=S.slice(S.length-5)); var W=g.MU(A6H(),function(a){return a.loungeToken}),m=g.MU(S,function(a){return a.loungeToken}); g.UM(m,function(a){return!g.oZ(W,a)})&&Zun(); g.i7("yt-remote-local-screens",S,31536E3)},Kr=function(S){S||(g.Ix("yt-remote-session-screen-id"),g.Ix("yt-remote-session-video-id")); heZ();S=Yh();g.Sm(S,G0());kew(S)},buH=function(){if(!T0){var S=g.Ia(); S&&(T0=new g.l6(S))}},oAn=function(){buH(); return T0?!!T0.get("yt-remote-use-staging-server"):!1},q0=function(S,W){g.DL[S]=!0; var m=g.Cm();m&&m.publish.apply(m,arguments);g.DL[S]=!1},r6Q=function(){var S=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return S?parseInt(S[1],10):0},Ce$=function(S){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+S)!=-1||document.currentScript.src.indexOf("&"+S)!=-1)},c69=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},pr=function(S){S.length?DG8(S.shift(),function(){pr(S)}):wPZ()},So8=function(S){return"chrome-extension://"+S+"/cast_sender.js"},DG8=function(S,W,m){var a=document.createElement("script"); a.onerror=W;m&&(a.onload=m);g.db(a,g.LK(S));(document.head||document.documentElement).appendChild(a)},W2Q=function(){var S=r6Q(),W=[]; if(S>1){var m=S-1;W.push("//www.gstatic.com/eureka/clank/"+S+"/cast_sender.js");W.push("//www.gstatic.com/eureka/clank/"+m+"/cast_sender.js")}return W},wPZ=function(){var S=c69(); S&&S(!1,"No cast extension found")},aVv=function(){if(mcN){var S=2,W=c69(),m=function(){S--; S==0&&W&&W(!0)}; window.__onGCastApiAvailable=m;DG8("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",wPZ,m)}},JUv=function(){aVv(); var S=W2Q();S.push("//www.gstatic.com/eureka/clank/cast_sender.js");pr(S)},ECw=function(){aVv(); var S=W2Q();S.push.apply(S,g.x(Btx.map(So8)));S.push("//www.gstatic.com/eureka/clank/cast_sender.js");pr(S)},FI=function(S,W,m){g.A.call(this); this.V=m!=null?(0,g.dN)(S,m):S;this.eS=W;this.X=(0,g.dN)(this.JK,this);this.C=!1;this.N=0;this.B=this.SD=null;this.j=[]},Va=function(){this.C=g.P9()},z8p=function(){nr||(nr=new Va)},yUg=function(){nr||(nr=new Va)},sD=function(){},YoZ=function(){g.mA.call(this,"p")},GDg=function(){g.mA.call(this,"o")},TtN=function(){return K2$=K2$||new g.ng},qop=function(S){g.mA.call(this,"serverreachability",S)},uC=function(S){var W=TtN(); W.dispatchEvent(new qop(W,S))},pnw=function(S){g.mA.call(this,"statevent",S)},gQ=function(S){var W=TtN(); W.dispatchEvent(new pnw(W,S))},F29=function(S,W,m,a){g.mA.call(this,"timingevent",S); this.size=W;this.rtt=m;this.retries=a},OD=function(S,W){if(typeof S!=="function")throw Error("Fn must not be null and must be a function"); return g.OQ.setTimeout(function(){S()},W)},jk=function(){},Qa=function(S,W,m,a){this.B=S; this.j=W;this.lr=m;this.EV=a||1;this.M2=new g.V1(this);this.d2=45E3;this.Hn=null;this.V=!1;this.bY=this.hX=this.S=this.O9=this.q2=this.uY=this.N2=null;this.vn=[];this.C=null;this.Z=0;this.X=this.Xn=null;this.vv=-1;this.s9=!1;this.Y6=0;this.zN=null;this.Wv=this.g2=this.IL=this.Pn=!1;this.N=new Vy$},Vy$=function(){this.B=null; this.C="";this.N=!1},saN=function(S,W,m){S.O9=1; S.S=DS(W.clone());S.bY=m;S.Pn=!0;nCQ(S,null)},nCQ=function(S,W){S.q2=Date.now(); XI(S);S.hX=S.S.clone();ww(S.hX,"t",S.EV);S.Z=0;var m=S.B.g2;S.N=new Vy$;S.C=uNg(S.B,m?W:null,!S.bY);S.Y6>0&&(S.zN=new g.wj((0,g.dN)(S.NA,S,S.C),S.Y6));S.M2.listen(S.C,"readystatechange",S.F_);W=S.Hn?g.em(S.Hn):{};S.bY?(S.Xn||(S.Xn="POST"),W["Content-Type"]="application/x-www-form-urlencoded",S.C.send(S.hX,S.Xn,S.bY,W)):(S.Xn="GET",S.C.send(S.hX,S.Xn,null,W));uC(1)},OEN=function(S){if(!gCN(S))return g.Cg(S.C); var W=g.cQ(S.C);if(W==="")return"";var m="",a=W.length,J=g.oz(S.C)==4;if(!S.N.B){if(typeof TextDecoder==="undefined")return vy(S),Hy(S),"";S.N.B=new g.OQ.TextDecoder}for(var B=0;BW.length)return jaZ;W=W.slice(a,a+m);S.Z=a+m;return W},XI=function(S){S.uY=Date.now()+S.d2; vC8(S,S.d2)},vC8=function(S,W){if(S.N2!=null)throw Error("WatchDog timer not null"); S.N2=OD((0,g.dN)(S.zn,S),W)},HEH=function(S){S.N2&&(g.OQ.clearTimeout(S.N2),S.N2=null)},Hy=function(S){S.B.U2()||S.s9||lVQ(S.B,S)},vy=function(S){HEH(S); g.nL(S.zN);S.zN=null;S.M2.removeAll();if(S.C){var W=S.C;S.C=null;W.abort();W.dispose()}},dcn=function(S,W){try{var m=S.B; if(m.lK!=0&&(m.C==S||Myw(m.N,S)))if(!S.g2&&Myw(m.N,S)&&m.lK==3){try{var a=m.mQ.C.parse(W)}catch(X){a=null}if(Array.isArray(a)&&a.length==3){var J=a;if(J[0]==0)a:{if(!m.S){if(m.C)if(m.C.q2+3E30&&(m.Y6=1.5*Y);a=m;var G=S.gW();if(G){var K=g.DM(G,"X-Client-Wire-Protocol");if(K){var T=a.N;!T.C&&(g.cF(K,"spdy")||g.cF(K,"quic")||g.cF(K,"h2"))&&(T.j=T.X,T.C=new Set,T.N&&(R8Z(T,T.N),T.N=null))}if(a.Pn){var p=g.DM(G,"X-HTTP-Session-Id");p&&(a.Od=p,g.Te(a.Hn,a.Pn,p))}}m.lK=3;m.X&&m.X.wK();m.Cn&&(m.qd=Date.now()-S.q2);a=m;var q=S;a.dA=e8Q(a,a.g2?a.lr:null,a.yT); if(q.g2){xcg(a.N,q);var F=q,O=a.Y6;O&&F.setTimeout(O);F.N2&&(HEH(F),XI(F));a.C=q}else iEZ(a);m.B.length>0&&Lr(m)}else B[0]!="stop"&&B[0]!="close"||UD(m,7);else m.lK==3&&(B[0]=="stop"||B[0]=="close"?B[0]=="stop"?UD(m,7):m.disconnect():B[0]!="noop"&&m.X&&m.X.yK(B),m.vn=0)}uC(4)}catch(X){}},IVQ=function(S,W){this.C=S; this.map=W;this.context=null},P68=function(S){this.X=S||10; g.OQ.PerformanceNavigationTiming?(S=g.OQ.performance.getEntriesByType("navigation"),S=S.length>0&&(S[0].nextHopProtocol=="hq"||S[0].nextHopProtocol=="h2")):S=!!(g.OQ.chrome&&g.OQ.chrome.loadTimes&&g.OQ.chrome.loadTimes()&&g.OQ.chrome.loadTimes().wasFetchedViaSpdy);this.j=S?this.X:1;this.C=null;this.j>1&&(this.C=new Set);this.N=null;this.B=[]},fVv=function(S){return S.N?!0:S.C?S.C.size>=S.j:!1},L2v=function(S){return S.N?1:S.C?S.C.size:0},Myw=function(S,W){return S.N?S.N==W:S.C?S.C.has(W):!1},R8Z= function(S,W){S.C?S.C.add(W):S.N=W},xcg=function(S,W){S.N&&S.N==W?S.N=null:S.C&&S.C.has(W)&&S.C.delete(W)},kDx=function(S){if(S.N!=null)return S.B.concat(S.N.vn); if(S.C!=null&&S.C.size!==0){var W=S.B;S=g.R(S.C.values());for(var m=S.next();!m.done;m=S.next())W=W.concat(m.value.vn);return W}return g.aS(S.B)},$cw=function(S,W){var m=new jk; if(g.OQ.Image){var a=new Image;a.onload=g.IZ(RO,m,"TestLoadImage: loaded",!0,W,a);a.onerror=g.IZ(RO,m,"TestLoadImage: error",!1,W,a);a.onabort=g.IZ(RO,m,"TestLoadImage: abort",!1,W,a);a.ontimeout=g.IZ(RO,m,"TestLoadImage: timeout",!1,W,a);g.OQ.setTimeout(function(){if(a.ontimeout)a.ontimeout()},1E4); a.src=S}else W(!1)},h8v=function(S,W){var m=new jk,a=new AbortController,J=setTimeout(function(){a.abort(); RO(m,"TestPingServer: timeout",!1,W)},1E4); fetch(S,{signal:a.signal}).then(function(B){clearTimeout(J);B.ok?RO(m,"TestPingServer: ok",!0,W):RO(m,"TestPingServer: server error",!1,W)}).catch(function(){clearTimeout(J); RO(m,"TestPingServer: error",!1,W)})},RO=function(S,W,m,a,J){try{J&&(J.onload=null,J.onerror=null,J.onabort=null,J.ontimeout=null),a(m)}catch(B){}},typ=function(){this.C=new sD},ek=function(S,W,m){return m&&m.jLD?m.jLD[S]||W:W},AUp=function(S){this.B=[]; this.lr=this.dA=this.Hn=this.yT=this.C=this.Od=this.Pn=this.s9=this.Z=this.IL=this.bY=null;this.Mi=this.hX=0;this.H1=ek("failFast",!1,S);this.zN=this.N2=this.S=this.V=this.X=null;this.eg=!0;this.o6=this.O9=-1;this.EV=this.vn=this.q2=0;this.xP=ek("baseRetryDelayMs",5E3,S);this.ov=ek("retryDelaySeedMs",1E4,S);this.xK=ek("forwardChannelMaxRetries",2,S);this.CJ=ek("forwardChannelRequestTimeoutMs",2E4,S);this.aY=S&&S.wWD||void 0;this.bJ=S&&S.brq||void 0;this.Ys=S&&S.ydN||!1;this.Y6=void 0;this.g2=S&&S.tS6|| !1;this.j="";this.N=new P68(S&&S.Wxn);this.Kn=Math.min(S&&S.Qqq||1E3,1E3);this.mQ=new typ;this.M2=S&&S.x_2||!1;this.uY=S&&S.U_Y||!1;this.M2&&this.uY&&(this.uY=!1);this.CC=S&&S.aIn||!1;S&&S.CFn&&(this.eg=!1);this.Cn=!this.M2&&this.eg&&S&&S.ENY||!1;this.VT=void 0;S&&S.OT&&S.OT>0&&(this.VT=S.OT);this.vv=void 0;this.qd=0;this.d2=!1;this.Wv=this.Xn=null},M0=function(S){S.C&&(ZEZ(S),S.C.cancel(),S.C=null)},Ntv=function(S){M0(S); S.S&&(g.OQ.clearTimeout(S.S),S.S=null);lC(S);S.N.cancel();S.V&&(typeof S.V==="number"&&g.OQ.clearTimeout(S.V),S.V=null)},Lr=function(S){fVv(S.N)||S.V||(S.V=!0,g.lm(S.qA,S),S.q2=0)},oCp=function(S,W){if(L2v(S.N)>=S.N.j-(S.V?1:0))return!1; if(S.V)return S.B=W.vn.concat(S.B),!0;if(S.lK==1||S.lK==2||S.q2>=(S.H1?0:S.xK))return!1;S.V=OD((0,g.dN)(S.qA,S,W),bEZ(S,S.q2));S.q2++;return!0},C6$=function(S,W){var m; W?m=W.lr:m=S.hX++;var a=S.Hn.clone();g.Te(a,"SID",S.j);g.Te(a,"RID",m);g.Te(a,"AID",S.O9);xh(S,a);S.Z&&S.bY&&g.Fc(a,S.Z,S.bY);m=new Qa(S,S.j,m,S.q2+1);S.Z===null&&(m.Hn=S.bY);W&&(S.B=W.vn.concat(S.B));W=rUw(S,m,S.Kn);m.setTimeout(Math.round(S.CJ*.5)+Math.round(S.CJ*.5*Math.random()));R8Z(S.N,m);saN(m,a,W)},xh=function(S,W){S.s9&&g.ic(S.s9,function(m,a){g.Te(W,a,m)}); S.X&&g.ic({},function(m,a){g.Te(W,a,m)})},rUw=function(S,W,m){m=Math.min(S.B.length,m); var a=S.X?(0,g.dN)(S.X.D3,S.X,S):null;a:{for(var J=S.B,B=-1;;){var E=["count="+m];B==-1?m>0?(B=J[0].C,E.push("ofs="+B)):B=0:E.push("ofs="+B);for(var y=!0,Y=0;Y=3)return!1; S.EV++;S.S=OD((0,g.dN)(S.jG,S),bEZ(S,S.vn));S.vn++;return!0},ZEZ=function(S){S.Xn!=null&&(g.OQ.clearTimeout(S.Xn),S.Xn=null)},cUg=function(S){S.C=new Qa(S,S.j,"rpc",S.EV); S.Z===null&&(S.C.Hn=S.bY);S.C.Y6=0;var W=S.dA.clone();g.Te(W,"RID","rpc");g.Te(W,"SID",S.j);g.Te(W,"AID",S.O9);g.Te(W,"CI",S.zN?"0":"1");!S.zN&&S.VT&&g.Te(W,"TO",S.VT);g.Te(W,"TYPE","xmlhttp");xh(S,W);S.Z&&S.bY&&g.Fc(W,S.Z,S.bY);S.Y6&&S.C.setTimeout(S.Y6);var m=S.C;S=S.lr;m.O9=1;m.S=DS(W.clone());m.bY=null;m.Pn=!0;nCQ(m,S)},lC=function(S){S.N2!=null&&(g.OQ.clearTimeout(S.N2),S.N2=null)},lVQ=function(S,W){var m=null; if(S.C==W){lC(S);ZEZ(S);S.C=null;var a=2}else if(Myw(S.N,W))m=W.vn,xcg(S.N,W),a=1;else return;if(S.lK!=0)if(W.V)if(a==1){m=W.bY?W.bY.length:0;W=Date.now()-W.q2;var J=S.q2;a=TtN();a.dispatchEvent(new F29(a,m,W,J));Lr(S)}else iEZ(S);else{var B=W.vv;J=W.getLastError();if(J==3||J==0&&B>0||!(a==1&&oCp(S,W)||a==2&&UcN(S)))switch(m&&m.length>0&&(W=S.N,W.B=W.B.concat(m)),J){case 1:UD(S,5);break;case 4:UD(S,10);break;case 3:UD(S,6);break;default:UD(S,2)}}},bEZ=function(S,W){var m=S.xP+Math.floor(Math.random()* S.ov); S.isActive()||(m*=2);return m*W},UD=function(S,W){if(W==2){var m=(0,g.dN)(S.VSn,S),a=S.bJ,J=!a; a=new g.Xl(a||"//www.google.com/images/cleardot.gif");g.OQ.location&&g.OQ.location.protocol=="http"||g.EG(a,"https");DS(a);J?$cw(a.toString(),m):h8v(a.toString(),m)}else gQ(2);S.lK=0;S.X&&S.X.aj(W);DcZ(S);Ntv(S)},DcZ=function(S){S.lK=0; S.Wv=[];if(S.X){var W=kDx(S.N);if(W.length!=0||S.B.length!=0)g.BF(S.Wv,W),g.BF(S.Wv,S.B),S.N.B.length=0,g.aS(S.B),S.B.length=0;S.X.Ij()}},wnp=function(S){if(S.lK==0)return S.Wv; var W=[];g.BF(W,kDx(S.N));g.BF(W,S.B);return W},e8Q=function(S,W,m){var a=g.g7(m); a.C!=""?(W&&g.v_(a,W+"."+a.C),g.ze(a,a.B)):(a=g.OQ.location,a=jG9(a.protocol,W?W+"."+a.hostname:a.hostname,+a.port,m));W=S.Pn;m=S.Od;W&&m&&g.Te(a,W,m);g.Te(a,"VER",S.Be);xh(S,a);return a},uNg=function(S,W,m){if(W&&!S.g2)throw Error("Can't create secondary domain capable XhrIo object."); W=S.Ys&&!S.aY?new g.ZM(new g.S6({rI:m})):new g.ZM(S.aY);W.Z=S.g2;return W},Sw9=function(){},WtN=function(){},dQ=function(S,W){g.ng.call(this); this.C=new AUp(W);this.X=S;this.N=W&&W.CP9||null;S=W&&W.obY||null;W&&W.tOn&&(S?S["X-Client-Protocol"]="webchannel":S={"X-Client-Protocol":"webchannel"});this.C.bY=S;S=W&&W.OjX||null;W&&W.DK&&(S?S["X-WebChannel-Content-Type"]=W.DK:S={"X-WebChannel-Content-Type":W.DK});W&&W.vg&&(S?S["X-WebChannel-Client-Profile"]=W.vg:S={"X-WebChannel-Client-Profile":W.vg});this.C.IL=S;(S=W&&W.nU9)&&!g.C$(S)&&(this.C.Z=S);this.V=W&&W.tS6||!1;this.j=W&&W.Lmq||!1;(W=W&&W.CrN)&&!g.C$(W)&&(this.C.Pn=W,g.HF(this.N,W)&&(S= this.N,W in S&&delete S[W]));this.B=new iC(this)},mBg=function(S){YoZ.call(this); S.__headers__&&(this.headers=S.__headers__,this.statusCode=S.__status__,delete S.__headers__,delete S.__status__);var W=S.__sm__;W?this.data=(this.C=g.jm(W))?g.L$(W,this.C):W:this.data=S},a4H=function(S){GDg.call(this); this.status=1;this.errorCode=S},iC=function(S){this.C=S},J2Q=function(S,W){this.N=S; this.C=W},Br9=function(S){return wnp(S.C).map(function(W){var m=S.N; W=W.map;"__data__"in W?(W=W.__data__,m=m.j?pPH(W):W):m=W;return m})},IO=function(S,W){if(typeof S!=="function")throw Error("Fn must not be null and must be a function"); return g.OQ.setTimeout(function(){S()},W)},fr=function(S){Py.dispatchEvent(new Enp(Py,S))},Enp=function(S){g.mA.call(this,"statevent",S)},ha=function(S,W,m,a){this.C=S; this.j=W;this.Z=m;this.V=a||1;this.N=45E3;this.B=new g.V1(this);this.X=new g.Iz;this.X.setInterval(250)},y2g=function(S,W,m){S.gh=1; S.tG=DS(W.clone());S.Ej=m;S.Pn=!0;zk$(S,null)},Ywx=function(S,W,m,a,J){S.gh=1; S.tG=DS(W.clone());S.Ej=null;S.Pn=m;J&&(S.u5=!1);zk$(S,a)},zk$=function(S,W){S.T9=Date.now(); Gz9(S);S.E6=S.tG.clone();ww(S.E6,"t",S.V);S.K2=0;S.GB=S.C.gF(S.C.sA()?W:null);S.Za>0&&(S.Zk=new g.wj((0,g.dN)(S.Aq,S,S.GB),S.Za));S.B.listen(S.GB,"readystatechange",S.UW);W=S.Oj?g.em(S.Oj):{};S.Ej?(S.L2="POST",W["Content-Type"]="application/x-www-form-urlencoded",S.GB.send(S.E6,S.L2,S.Ej,W)):(S.L2="GET",S.u5&&!g.ju&&(W.Connection="close"),S.GB.send(S.E6,S.L2,null,W));S.C.Fa(1)},qwn=function(S,W){var m=S.K2,a=W.indexOf("\n",m); if(a==-1)return Ktw;m=Number(W.substring(m,a));if(isNaN(m))return TrQ;a+=1;if(a+m>W.length)return Ktw;W=W.slice(a,a+m);S.K2=a+m;return W},Gz9=function(S){S.E8=Date.now()+S.N; p6v(S,S.N)},p6v=function(S,W){if(S.O4!=null)throw Error("WatchDog timer not null"); S.O4=IO((0,g.dN)(S.Sj,S),W)},Ft9=function(S){S.O4&&(g.OQ.clearTimeout(S.O4),S.O4=null)},VCp=function(S){S.C.U2()||S.Wj||S.C.KN(S)},ta=function(S){Ft9(S); g.nL(S.Zk);S.Zk=null;S.X.stop();S.B.removeAll();if(S.GB){var W=S.GB;S.GB=null;W.abort();W.dispose()}S.bv&&(S.bv=null)},nnZ=function(S,W){try{S.C.Pe(S,W),S.C.Fa(4)}catch(m){}},uC8=function(S,W,m,a,J){if(a==0)m(!1); else{var B=J||0;a--;s2Q(S,W,function(E){E?m(!0):g.OQ.setTimeout(function(){uC8(S,W,m,a,B)},B)})}},s2Q=function(S,W,m){var a=new Image; a.onload=function(){try{Aa(a),m(!0)}catch(J){}}; a.onerror=function(){try{Aa(a),m(!1)}catch(J){}}; a.onabort=function(){try{Aa(a),m(!1)}catch(J){}}; a.ontimeout=function(){try{Aa(a),m(!1)}catch(J){}}; g.OQ.setTimeout(function(){if(a.ontimeout)a.ontimeout()},W); a.src=S},Aa=function(S){S.onload=null; S.onerror=null;S.onabort=null;S.ontimeout=null},gn9=function(S){this.C=S; this.N=new sD},OKn=function(S){var W=ZG(S.C,S.wM,"/mail/images/cleardot.gif"); DS(W);uC8(W.toString(),5E3,(0,g.dN)(S.qL,S),3,2E3);S.Fa(1)},j29=function(S){var W=S.C.V; W!=null?(fr(5),W?(fr(11),N0(S.C,S,!1)):(fr(12),N0(S.C,S,!0))):(S.Uq=new ha(S),S.Uq.Oj=S.LN,W=S.C,W=ZG(W,W.sA()?S.rh:null,S.rF),fr(5),ww(W,"TYPE","xmlhttp"),Ywx(S.Uq,W,!1,S.rh,!1))},Q2N=function(S,W,m){this.C=1; this.N=[];this.B=[];this.X=new sD;this.bY=S||null;this.V=W!=null?W:null;this.S=m||!1},X6v=function(S,W){this.C=S; this.map=W;this.context=null},vnv=function(S,W,m,a){g.mA.call(this,"timingevent",S); this.size=W;this.rtt=m;this.retries=a},HKN=function(S){g.mA.call(this,"serverreachability",S)},MCg=function(S){S.lG(1,0); S.Jk=ZG(S,null,S.zl);l4H(S)},UBg=function(S){S.Cm&&(S.Cm.abort(),S.Cm=null); S.xt&&(S.xt.cancel(),S.xt=null);S.rQ&&(g.OQ.clearTimeout(S.rQ),S.rQ=null);bC(S);S.Io&&(S.Io.cancel(),S.Io=null);S.Lu&&(g.OQ.clearTimeout(S.Lu),S.Lu=null)},LtQ=function(S,W){if(S.C==0)throw Error("Invalid operation: sending map when state is closed"); S.N.push(new X6v(S.dO++,W));S.C!=2&&S.C!=3||l4H(S)},Rk9=function(S){var W=0; S.xt&&W++;S.Io&&W++;return W},l4H=function(S){S.Io||S.Lu||(S.Lu=IO((0,g.dN)(S.We,S),0),S.E4=0)},iK$=function(S,W){if(S.C==1){if(!W){S.OA=Math.floor(Math.random()*1E5); W=S.OA++;var m=new ha(S,"",W);m.Oj=S.gZ;var a=ekn(S),J=S.Jk.clone();g.Te(J,"RID",W);g.Te(J,"CVER","1");oO(S,J);y2g(m,J,a);S.Io=m;S.C=2}}else S.C==3&&(W?xB9(S,W):S.N.length==0||S.Io||xB9(S))},xB9=function(S,W){if(W)if(S.g_>6){S.N=S.B.concat(S.N); S.B.length=0;var m=S.OA-1;W=ekn(S)}else m=W.Z,W=W.Ej;else m=S.OA++,W=ekn(S);var a=S.Jk.clone();g.Te(a,"SID",S.j);g.Te(a,"RID",m);g.Te(a,"AID",S.gY);oO(S,a);m=new ha(S,S.j,m,S.E4+1);m.Oj=S.gZ;m.setTimeout(1E4+Math.round(1E4*Math.random()));S.Io=m;y2g(m,a,W)},oO=function(S,W){S.fJ&&(S=S.fJ.VK())&&g.ic(S,function(m,a){g.Te(W,a,m)})},ekn=function(S){var W=Math.min(S.N.length,1E3),m=["count="+W]; if(S.g_>6&&W>0){var a=S.N[0].C;m.push("ofs="+a)}else a=0;for(var J={},B=0;B=3)return!1; S.Z++;S.rQ=IO((0,g.dN)(S.tq,S),I48(S,S.ZS));S.ZS++;return!0},N0=function(S,W,m){S.dT=S.V==null?m:!S.V; S.Mz=W.KU;S.S||MCg(S)},bC=function(S){S.Lr!=null&&(g.OQ.clearTimeout(S.Lr),S.Lr=null)},I48=function(S,W){var m=5E3+Math.floor(Math.random()*1E4); S.isActive()||(m*=2);return m*W},rQ=function(S,W){if(W==2||W==9){var m=null; S.fJ&&(m=null);var a=(0,g.dN)(S.nB2,S);m||(m=new g.Xl("//www.google.com/images/cleardot.gif"),DS(m));s2Q(m.toString(),1E4,a)}else fr(2);f4p(S,W)},f4p=function(S,W){S.C=0; S.fJ&&S.fJ.He(W);kzN(S);UBg(S)},kzN=function(S){S.C=0; S.Mz=-1;if(S.fJ)if(S.B.length==0&&S.N.length==0)S.fJ.F6();else{var W=g.aS(S.B),m=g.aS(S.N);S.B.length=0;S.N.length=0;S.fJ.F6(W,m)}},ZG=function(S,W,m){var a=g.g7(m); if(a.C!="")W&&g.v_(a,W+"."+a.C),g.ze(a,a.B);else{var J=window.location;a=jG9(J.protocol,W?W+"."+J.hostname:J.hostname,+J.port,m)}S.Va&&g.ic(S.Va,function(B,E){g.Te(a,E,B)}); g.Te(a,"VER",S.g_);oO(S,a);return a},$BN=function(){},hkp=function(){this.C=[]; this.N=[]},tC9=function(S){g.mA.call(this,"channelMessage"); this.message=S},A2N=function(S){g.mA.call(this,"channelError"); this.error=S},ZK9=function(S,W){this.action=S; this.params=W||{}},Cr=function(S,W){g.A.call(this); this.C=new g.rj(this.wD2,0,this);g.Z(this,this.C);this.eS=5E3;this.retryCount=this.p$=0;if(typeof S==="function")W&&(S=(0,g.dN)(S,W));else if(S&&typeof S.handleEvent==="function")S=(0,g.dN)(S.handleEvent,S);else throw Error("Invalid listener argument");this.N=S},Nr9=function(S,W,m,a,J,B,E,y,Y,G,K,T,p,q,F,O){var X=this; m=m===void 0?!1:m;a=a===void 0?function(){return""}:a; J=J===void 0?!1:J;B=B===void 0?!1:B;E=E===void 0?!1:E;y=y===void 0?function(){return g.Rz({})}:y; Y=Y===void 0?!1:Y;K=K===void 0?!1:K;T=T===void 0?!1:T;p=p===void 0?!1:p;q=q===void 0?!1:q;this.zN=S;this.q2=W;this.S=new g.Hn;this.V=O;this.N=(this.B=!!F)?F(function(){X.Yv()}):new Cr(this.Yv,this); this.C=null;this.bY=!1;this.vn=null;this.Pn="";this.Xn=this.N2=0;this.j=[];this.lr=m;this.Hn=a;this.Z=B;this.g2=y;this.O9=G;this.yT=E;this.s9=null;this.X=g.Rz();this.eg=J;this.EV=Y;this.IL=K;this.vv=T;this.Cn=p;this.Wv=q;this.uY=new Fuv;this.hX=new V6N;this.M2=new sGN;this.d2=new nAw;this.Y6=new ucZ;this.qd=new gAx;this.VT=new OuN},r2w=function(S,W,m,a,J){bK9(S); if(S.C){var B=g.D4("ID_TOKEN"),E=S.C.gZ||{};B?E["x-youtube-identity-token"]=B:delete E["x-youtube-identity-token"];S.C.gZ=E}onN(S);a?(a.getState()!=3&&Rk9(a)==0||a.getState(),S.C.connect(W,m,S.q2,a.j,a.gY)):J?S.C.connect(W,m,S.q2,J.sessionId,J.arrayId):S.C.connect(W,m,S.q2);S.B&&!S.N.isActive()&&S.N.start();S.V&&S.V.MtQ()},w6n=function(S,W){return S.Cn?!0:S.vv?Object.values(Cjp).includes(W):S.IL?!Object.values(c2$).includes(W):S.Wv?Object.values(DBx).includes(W):!1},miZ=function(S){var W,m; g.k(function(a){if(a.C==1)return g.yH(a,2),g.P(a,S7H(S),2);g.Kn(a);W=S.j;S.j=[];m=W.length;WyH(S,W,m);cy(S);return g.Tg(a,0)})},WyH=function(S,W,m){for(var a=0;a0?m=Object.assign({},m,W):delete m.Authorization;S.C.gZ=m}},onN=function(S){S.O9&&!S.Z&&J$$(S,S.O9())},DG=function(S){this.scheme="https"; this.port=this.domain="";this.C="/api/lounge";this.N=!0;S=S||document.location.href;var W=Number(g.Xd(S)[4]||null)||"";W&&(this.port=":"+W);this.domain=g.vj(S)||"";S=g.mW();S.search("MSIE")>=0&&(S=S.match(/MSIE ([\d.]+)/)[1],g.W$(S,"10.0")<0&&(this.N=!1))},wQ=function(S,W){var m=S.C; S.N&&(m=S.scheme+"://"+S.domain+S.port+S.C);return g.ex(m+W,{})},BuH=function(S,W){g.ng.call(this); var m=this;this.handler=S();this.handler.subscribe("handlerOpened",this.Yn,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(a,J){m.onError(J)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.C=W},E09=function(S,W,m){var a=this; m=m===void 0?function(){return""}:m; var J=J===void 0?new WtN:J;var B=B===void 0?new g.Hn:B;this.pathPrefix=S;this.C=W;this.q2=m;this.X=B;this.S=null;this.bY=this.Z=0;this.channel=null;this.V=0;this.B=new Cr(function(){a.B.isActive();var E;((E=a.channel)==null?void 0:L2v((new J2Q(E,E.C)).C.N))===0&&a.connect(a.S,a.Z)}); this.j={};this.N={};this.N2=!1;this.logger=null;this.vn=[];this.gr=void 0;this.Hn=new Fuv;this.Xn=new V6N;this.s9=new nAw;this.Pn=new ucZ},zpN=function(S){g.GU(S.channel,"m",function(){S.V=3; S.B.reset();S.S=null;S.Z=0;for(var W=g.R(S.vn),m=W.next();!m.done;m=W.next())m=m.value,S.channel&&S.channel.send(m);S.vn=[];S.publish("webChannelOpened");S.Hn.WG("WEB_CHANNEL")}); g.GU(S.channel,"n",function(){S.V=0;S.B.isActive()||S.publish("webChannelClosed");var W,m=(W=S.channel)==null?void 0:Br9(new J2Q(W,W.C));m&&(S.vn=[].concat(g.x(m)));S.Xn.WG("WEB_CHANNEL")}); g.GU(S.channel,"p",function(W){var m=W.data;m[0]==="gracefulReconnect"?(S.B.start(),S.channel&&S.channel.close()):S.publish("webChannelMessage",new ZK9(m[0],m[1]));S.gr=W.statusCode;S.s9.WG("WEB_CHANNEL")}); g.GU(S.channel,"o",function(){S.gr===401||S.B.start();S.publish("webChannelError");S.Pn.WG("WEB_CHANNEL","")})},y$H=function(S){var W=S.q2(); W?S.j["x-youtube-lounge-xsrf-token"]=W:delete S.j["x-youtube-lounge-xsrf-token"]},Y7x=function(S){g.ng.call(this); this.C=S();this.C.subscribe("webChannelOpened",this.RQ,this);this.C.subscribe("webChannelClosed",this.onClosed,this);this.C.subscribe("webChannelError",this.onError,this);this.C.subscribe("webChannelMessage",this.onMessage,this)},GcZ=function(S,W,m,a,J){function B(){return new Nr9(wQ(S,"/bc"),W,!1,m,a)} m=m===void 0?function(){return""}:m; return g.Qi("enable_mdx_web_channel_desktop")?new Y7x(function(){return new E09(wQ(S,"/wc"),W,m)}):new BuH(B,J)},pLH=function(){var S=KyN; TuZ();Sc.push(S);q7g()},Ww=function(S,W){TuZ(); var m=Fy9(S,String(W));Sc.length==0?Vo8(m):(q7g(),g.V3(Sc,function(a){a(m)}))},mf=function(S){Ww("CP",S)},TuZ=function(){Sc||(Sc=g.v9("yt.mdx.remote.debug.handlers_")||[],g.j$("yt.mdx.remote.debug.handlers_",Sc))},Vo8=function(S){var W=(aq+1)%50; aq=W;J7[W]=S;Bw||(Bw=W==49)},q7g=function(){var S=Sc; if(J7[0]){var W=Bw?aq:-1,m={};do m={Ou:void 0},W=(W+1)%50,m.Ou=J7[W],g.V3(S,function(a){return function(J){J(a.Ou)}}(m)); while(W!=aq);J7=Array(50);aq=-1;Bw=!1}},Fy9=function(S,W){var m=(Date.now()-n0w)/1E3; m.toFixed&&(m=m.toFixed(3));var a=[];a.push("[",m+"s","] ");a.push("[","yt.mdx.remote","] ");a.push(S+": "+W,"\n");return a.join("")},ES=function(S){g.au.call(this); this.V=S;this.screens=[]},skQ=function(S,W){var m=S.get(W.uuid)||S.get(W.id); if(m)return S=m.name,m.id=W.id||m.id,m.name=W.name,m.token=W.token,m.uuid=W.uuid||m.uuid,m.name!=S;S.screens.push(W);return!0},us8=function(S,W){var m=S.screens.length!=W.length; S.screens=g.fL(S.screens,function(B){return!!Ih8(W,B)}); for(var a=W.length,J=0;J0&&S.j0&&ub(S,m)},function(W){S.X=function(){}; S.hY(W)})},r$w=function(S){var W={}; W.pairingCode=S.Xn;W.theme=S.O9;oAn()&&(W.env_useStageMdx=1);return g.Rv(W)},COH=function(S){return new Promise(function(W){S.Xn=iug(); if(S.Hn){var m=new chrome.cast.DialLaunchResponse(!0,r$w(S));W(m);o0N(S)}else S.N2=function(){g.gu(S.bY);S.N2=function(){}; S.bY=NaN;var a=new chrome.cast.DialLaunchResponse(!0,r$w(S));W(a);o0N(S)},S.bY=g.s7(function(){S.N2()},100)})},Diw=function(S,W,m){S.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(W)); var a=new By(W);return(new Promise(function(J){c$n(S,a,function(B){B?(S.vn=!0,TT(S.j,a),pH(S,a),ub(S,m)):g.WL(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(W)+" is not online."));J(B)},5)})).then(function(J){return J?new chrome.cast.DialLaunchResponse(!1):COH(S)})},wL$=function(S,W){var m=S.S.receiver.label,a=S.N.friendlyName; return(new Promise(function(J){Rp$(S.j,m,W,a,function(B){B&&B.token&&pH(S,B);J(B)},function(B){F7(S,"Failed to get DIAL screen: "+B); J(null)})})).then(function(J){return J&&J.token?new chrome.cast.DialLaunchResponse(!1):COH(S)})},c$n=function(S,W,m,a){g.gu(S.V); S.V=0;xiv(S.j,W,function(J){J||a<0?m(J):S.V=g.s7(function(){c$n(S,W,m,a-1)},300)})},ub=function(S,W){S.info("getDialAppInfoWithTimeout_ "+W); sS(S)&&(g.gu(S.Z),S.Z=0,W==0?S2g(S):S.Z=g.s7(function(){S2g(S)},W))},S2g=function(S){sS(S)&&S.B.getDialAppInfo(function(W){S.info("getDialAppInfo dialLaunchData: "+JSON.stringify(W)); W=W.extraData||{};var m=null;if(W.loungeToken){var a;((a=S.C)==null?void 0:a.token)==W.loungeToken&&(m="staleLoungeToken")}else m="missingLoungeToken";m?(S.q2=m,ub(S,3E4)):(S.vn=!1,S.q2="unknown",POn(S,W.loungeToken),ub(S,W.loungeTokenRefreshIntervalMs))},function(W){S.info("getDialAppInfo error: "+W); S.q2="noLoungeTokenResponse";ub(S,3E4)})},Wm8=function(S){g.gu(S.V); S.V=0;g.gu(S.Z);S.Z=0;S.X();S.X=function(){}; g.gu(S.bY)},gV=function(S,W){qh.call(this,S,W,"ManualSession"); this.B=g.s7((0,g.dN)(this.Wl,this,null),150)},OS=function(S,W){g.au.call(this); this.config_=W;this.N=S;this.S=W.appId||"233637DE";this.j=W.theme||"cl";this.bY=W.disableCastApi||!1;this.V=W.forceMirroring||!1;this.C=null;this.Z=!1;this.B=[];this.X=(0,g.dN)(this.Za2,this)},m5H=function(S,W){return W?g.Nx(S.B,function(m){return ED(W,m.label)},S):null},jc=function(S){Ww("Controller",S)},KyN=function(S){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(S)},Q5=function(S){return S.Z||!!S.B.length||!!S.C},X7=function(S,W,m){W!=S.C&&(g.nL(S.C),(S.C=W)?(m?S.publish("yt-remote-cast2-receiver-resumed", W.N):S.publish("yt-remote-cast2-receiver-selected",W.N),W.subscribe("sessionScreen",(0,g.dN)(S.S3,S,W)),W.subscribe("sessionFailed",function(){return apw(S,W)}),W.C?S.publish("yt-remote-cast2-session-change",W.C):m&&S.C.Wl(null)):S.publish("yt-remote-cast2-session-change",null))},apw=function(S,W){S.C==W&&S.publish("yt-remote-cast2-session-failed")},JOQ=function(S){var W=S.N.OM(),m=S.C&&S.C.N; S=g.MU(W,function(a){m&&ED(a,m.label)&&(m=null);var J=a.uuid?a.uuid:a.id,B=m5H(this,a);B?(B.label=J,B.friendlyName=a.name):(B=new chrome.cast.Receiver(J,a.name),B.receiverType=chrome.cast.ReceiverType.CUSTOM);return B},S); m&&(m.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(m=new chrome.cast.Receiver(m.label,m.friendlyName),m.receiverType=chrome.cast.ReceiverType.CUSTOM),S.push(m));return S},TU$=function(S,W,m,a){a.disableCastApi?vw("Cannot initialize because disabled by Mdx config."):BUN()?ER8(W,a)&&(zSp(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?yO9(S,m):(window.__onGCastApiAvailable=function(J,B){J?yO9(S,m):(Hw("Failed to load cast API: "+B),Y28(!1),zSp(!1),g.Ix("yt-remote-cast-available"),g.Ix("yt-remote-cast-receiver"), G18(),m(!1))},a.loadCastApiSetupScript?g.a_(KmZ):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?r6Q()>=60&&JUv():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?wPZ():r6Q()>=89?ECw():(aVv(),pr(Btx.map(So8))))):vw("Cannot initialize because not running Chrome")},G18=function(){vw("dispose"); var S=lb();S&&S.dispose();g.j$("yt.mdx.remote.cloudview.instance_",null);q2Z(!1);g.Wp(pXN);pXN.length=0},Mh=function(){return!!g.dU("yt-remote-cast-installed")},Fm8=function(){var S=g.dU("yt-remote-cast-receiver"); return S?S.friendlyName:null},VYw=function(){vw("clearCurrentReceiver"); g.Ix("yt-remote-cast-receiver")},nRn=function(){return Mh()?lb()?lb().getCastSession():(Hw("getCastSelector: Cast is not initialized."),null):(Hw("getCastSelector: Cast API is not installed!"),null)},sxN=function(){Mh()?lb()?US()?(vw("Requesting cast selector."),lb().requestSession()):(vw("Wait for cast API to be ready to request the session."),pXN.push(g.S0("yt-remote-cast2-api-ready",sxN))):Hw("requestCastSelector: Cast is not initialized."):Hw("requestCastSelector: Cast API is not installed!")}, LH=function(S,W){US()?lb().setConnectedScreenStatus(S,W):Hw("setConnectedScreenStatus called before ready.")},BUN=function(){var S=g.mW().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.y0||S},uYw=function(S,W){lb().init(S,W)},ER8=function(S,W){var m=!1; lb()||(S=new OS(S,W),S.subscribe("yt-remote-cast2-availability-change",function(a){g.i7("yt-remote-cast-available",a);q0("yt-remote-cast2-availability-change",a)}),S.subscribe("yt-remote-cast2-receiver-selected",function(a){vw("onReceiverSelected: "+a.friendlyName); g.i7("yt-remote-cast-receiver",a);q0("yt-remote-cast2-receiver-selected",a)}),S.subscribe("yt-remote-cast2-receiver-resumed",function(a){vw("onReceiverResumed: "+a.friendlyName); g.i7("yt-remote-cast-receiver",a);q0("yt-remote-cast2-receiver-resumed",a)}),S.subscribe("yt-remote-cast2-session-change",function(a){vw("onSessionChange: "+z0(a)); a||g.Ix("yt-remote-cast-receiver");q0("yt-remote-cast2-session-change",a)}),g.j$("yt.mdx.remote.cloudview.instance_",S),m=!0); vw("cloudview.createSingleton_: "+m);return m},lb=function(){return g.v9("yt.mdx.remote.cloudview.instance_")},yO9=function(S,W){Y28(!0); zSp(!1);uYw(S,function(m){m?(q2Z(!0),g.mj("yt-remote-cast2-api-ready")):(Hw("Failed to initialize cast API."),Y28(!1),g.Ix("yt-remote-cast-available"),g.Ix("yt-remote-cast-receiver"),G18());W(m)})},vw=function(S){Ww("cloudview",S)},Hw=function(S){Ww("cloudview",S)},Y28=function(S){vw("setCastInstalled_ "+S); g.i7("yt-remote-cast-installed",S)},US=function(){return!!g.v9("yt.mdx.remote.cloudview.apiReady_")},q2Z=function(S){vw("setApiReady_ "+S); g.j$("yt.mdx.remote.cloudview.apiReady_",S)},zSp=function(S){g.j$("yt.mdx.remote.cloudview.initializing_",S)},Rq=function(S){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.X=this.V=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.B=this.Z=this.N=0;this.C=NaN;this.j=!1;this.reset(S)},gRg=function(S){S.audioTrackId=null; S.trackData=null;S.playerState=-1;S.hasPrevious=!1;S.hasNext=!1;S.V=0;S.X=g.P9();S.N=0;S.Z=0;S.B=0;S.loadedTime=0;S.C=NaN;S.j=!1},ec=function(S){return S.isPlaying()?(g.P9()-S.X)/1E3:0},x4=function(S,W){S.V=W; S.X=g.P9()},ib=function(S){switch(S.playerState){case 1:case 1081:return(g.P9()-S.X)/1E3+S.V; case -1E3:return 0}return S.V},O5n=function(S){return S.j?S.Z+ec(S):S.Z},dV=function(S,W,m){var a=S.videoId; S.videoId=W;S.index=m;W!=a&&gRg(S)},jx8=function(S){var W={}; W.index=S.index;W.listId=S.listId;W.videoId=S.videoId;W.playerState=S.playerState;W.volume=S.volume;W.muted=S.muted;W.audioTrackId=S.audioTrackId;W.trackData=g.xl(S.trackData);W.hasPrevious=S.hasPrevious;W.hasNext=S.hasNext;W.playerTime=S.V;W.playerTimeAt=S.X;W.seekableStart=S.N;W.seekableEnd=S.Z;W.duration=S.B;W.loadedTime=S.loadedTime;W.liveIngestionTime=S.C;return W},Pw=function(S,W){g.au.call(this); var m=this;this.B=0;this.j=S;this.V=[];this.X=new hkp;this.N=this.C=null;this.bY=(0,g.dN)(this.hWN,this);this.Z=(0,g.dN)(this.oE,this);this.S=(0,g.dN)(this.Fyn,this);this.N2=(0,g.dN)(this.Ud2,this);var a=0;S?(a=S.getProxyState(),a!=3&&(S.subscribe("proxyStateChange",this.nf,this),Qxv(this))):a=3;a!=0&&(W?this.nf(a):g.s7(function(){m.nf(a)},0)); (S=nRn())&&Iq(this,S);this.subscribe("yt-remote-cast2-session-change",this.N2)},fH=function(S){return new Rq(S.j.getPlayerContextData())},Qxv=function(S){g.V3("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(W){this.V.push(this.j.subscribe(W,g.IZ(this.nK2,W),this))},S)},XX9=function(S){g.V3(S.V,function(W){this.j.unsubscribeByKey(W)},S); S.V.length=0},k4=function(S){return S.getState()==1},$4=function(S,W){var m=S.X; m.C.length+m.N.length<50&&S.X.enqueue(W)},vRQ=function(S,W,m){var a=fH(S); x4(a,m);a.playerState!=-1E3&&(a.playerState=W);h7(S,a)},t7=function(S,W,m){S.j.sendMessage(W,m)},h7=function(S,W){XX9(S); S.j.setPlayerContextData(jx8(W));Qxv(S)},Iq=function(S,W){S.N&&(S.N.removeUpdateListener(S.bY),S.N.removeMediaListener(S.Z),S.oE(null)); S.N=W;S.N&&(mf("Setting cast session: "+S.N.sessionId),S.N.addUpdateListener(S.bY),S.N.addMediaListener(S.Z),S.N.media.length&&S.oE(S.N.media[0]))},H5w=function(S){var W=S.C.media,m=S.C.customData; if(W&&m){var a=fH(S);W.contentId!=a.videoId&&mf("Cast changing video to: "+W.contentId);a.videoId=W.contentId;a.playerState=m.playerState;x4(a,S.C.getEstimatedTime());h7(S,a)}else mf("No cast media video. Ignoring state update.")},A7=function(S,W,m){return(0,g.dN)(function(a){this.AO("Failed to "+W+" with cast v2 channel. Error code: "+a.code); a.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.AO("Retrying "+W+" using MDx browser channel."),t7(this,W,m))},S)},bb=function(S,W,m,a){a=a===void 0?!1:a; g.au.call(this);var J=this;this.V=NaN;this.Xn=!1;this.bY=this.S=this.vn=this.q2=NaN;this.N2=[];this.X=this.Z=this.j=this.C=this.N=null;this.Hn=S;this.s9=a;this.N2.push(g.vX(window,"beforeunload",function(){J.I7(2)})); this.B=[];this.C=new Rq;this.O9=W.id;this.Pn=W.idType;this.N=GcZ(this.Hn,m,this.KF,this.Pn=="shortLived",this.O9);this.N.listen("channelOpened",function(){lpp(J)}); this.N.listen("channelClosed",function(){Zv("Channel closed");isNaN(J.V)?Kr(!0):Kr();J.dispose()}); this.N.listen("channelError",function(B){Kr();isNaN(J.Es())?(B==1&&J.Pn=="shortLived"&&J.publish("browserChannelAuthError",B),Zv("Channel error: "+B+" without reconnection"),J.dispose()):(J.Xn=!0,Zv("Channel error: "+B+" with reconnection in "+J.Es()+" ms"),Nh(J,2))}); this.N.listen("channelMessage",function(B){MYv(J,B)}); this.N.vJ(W.token);this.subscribe("remoteQueueChange",function(){var B=J.C.videoId;g.PX()&&g.i7("yt-remote-session-video-id",B)})},U59=function(S){return g.Nx(S.B,function(W){return W.type=="LOUNGE_SCREEN"})},Zv=function(S){Ww("conn",S)},Nh=function(S,W){S.publish("proxyStateChange",W)},Lmv=function(S){S.V=g.s7(function(){Zv("Connecting timeout"); S.I7(1)},2E4)},RSZ=function(S){g.gu(S.V); S.V=NaN},eSH=function(S){g.gu(S.q2); S.q2=NaN},i59=function(S){x5N(S); S.vn=g.s7(function(){oq(S,"getNowPlaying")},2E4)},x5N=function(S){g.gu(S.vn); S.vn=NaN},lpp=function(S){Zv("Channel opened"); S.Xn&&(S.Xn=!1,eSH(S),S.q2=g.s7(function(){Zv("Timing out waiting for a screen.");S.I7(1)},15E3))},IpZ=function(S,W){var m=null; if(W){var a=U59(S);a&&(m={clientName:a.clientName,deviceMake:a.brand,deviceModel:a.model,osVersion:a.osVersion})}g.j$("yt.mdx.remote.remoteClient_",m);W&&(RSZ(S),eSH(S));m=S.N.Jd()&&isNaN(S.V);W==m?W&&(Nh(S,1),oq(S,"getSubtitlesTrack")):W?(S.zX()&&S.C.reset(),Nh(S,1),oq(S,"getNowPlaying"),d5Q(S)):S.I7(1)},P7Q=function(S,W){var m=W.params.videoId; delete W.params.videoId;m==S.C.videoId&&(g.UC(W.params)?S.C.trackData=null:S.C.trackData=W.params,S.publish("remotePlayerChange"))},fpN=function(S,W,m){var a=W.params.videoId||W.params.video_id,J=parseInt(W.params.currentIndex,10); S.C.listId=W.params.listId||S.C.listId;dV(S.C,a,J);S.publish("remoteQueueChange",m)},$5N=function(S,W){W.params=W.params||{}; fpN(S,W,"NOW_PLAYING_MAY_CHANGE");k1N(S,W);S.publish("autoplayDismissed")},k1N=function(S,W){var m=parseInt(W.params.currentTime||W.params.current_time,10); x4(S.C,isNaN(m)?0:m);m=parseInt(W.params.state,10);m=isNaN(m)?-1:m;m==-1&&S.C.playerState==-1E3&&(m=-1E3);S.C.playerState=m;m=Number(W.params.loadedTime);S.C.loadedTime=isNaN(m)?0:m;S.C.Ab(Number(W.params.duration));m=S.C;var a=Number(W.params.liveIngestionTime);m.C=a;m.j=isNaN(a)?!1:!0;m=S.C;a=Number(W.params.seekableStartTime);W=Number(W.params.seekableEndTime);m.N=isNaN(a)?0:a;m.Z=isNaN(W)?0:W;S.C.playerState==1?i59(S):x5N(S);S.publish("remotePlayerChange")},hSZ=function(S,W){if(S.C.playerState!= -1E3){var m=1085; switch(parseInt(W.params.adState,10)){case 1:m=1081;break;case 2:m=1084;break;case 0:m=1083}S.C.playerState=m;W=parseInt(W.params.currentTime,10);x4(S.C,isNaN(W)?0:W);S.publish("remotePlayerChange")}},tYN=function(S,W){var m=W.params.muted=="true"; S.C.volume=parseInt(W.params.volume,10);S.C.muted=m;S.publish("remotePlayerChange")},AOv=function(S,W){S.Z=W.params.videoId; S.publish("nowAutoplaying",parseInt(W.params.timeout,10))},Z5Z=function(S,W){S.Z=W.params.videoId||null; S.publish("autoplayUpNext",S.Z)},NU$=function(S,W){S.X=W.params.autoplayMode; S.publish("autoplayModeChange",S.X);S.X=="DISABLED"&&S.publish("autoplayDismissed")},b5n=function(S,W){var m=W.params.hasNext=="true"; S.C.hasPrevious=W.params.hasPrevious=="true";S.C.hasNext=m;S.publish("previousNextChange")},MYv=function(S,W){W=W.message; W.params?Zv("Received: action="+W.action+", params="+g.hs(W.params)):Zv("Received: action="+W.action+" {}");switch(W.action){case "loungeStatus":W=Sk(W.params.devices);S.B=g.MU(W,function(a){return new Ja(a)}); W=!!g.Nx(S.B,function(a){return a.type=="LOUNGE_SCREEN"}); IpZ(S,W);W=S.Uv("mlm");S.publish("multiStateLoopEnabled",W);break;case "loungeScreenDisconnected":g.WF(S.B,function(a){return a.type=="LOUNGE_SCREEN"}); IpZ(S,!1);break;case "remoteConnected":var m=new Ja(Sk(W.params.device));g.Nx(S.B,function(a){return a.equals(m)})||KuH(S.B,m); break;case "remoteDisconnected":m=new Ja(Sk(W.params.device));g.WF(S.B,function(a){return a.equals(m)}); break;case "gracefulDisconnect":break;case "playlistModified":fpN(S,W,"QUEUE_MODIFIED");break;case "nowPlaying":$5N(S,W);break;case "onStateChange":k1N(S,W);break;case "onAdStateChange":hSZ(S,W);break;case "onVolumeChanged":tYN(S,W);break;case "onSubtitlesTrackChanged":P7Q(S,W);break;case "nowAutoplaying":AOv(S,W);break;case "autoplayDismissed":S.publish("autoplayDismissed");break;case "autoplayUpNext":Z5Z(S,W);break;case "onAutoplayModeChanged":NU$(S,W);break;case "onHasPreviousNextChanged":b5n(S, W);break;case "requestAssistedSignIn":S.publish("assistedSignInRequested",W.params.authCode);break;case "onLoopModeChanged":S.publish("loopModeChange",W.params.loopMode);break;default:Zv("Unrecognized action: "+W.action)}},d5Q=function(S){g.gu(S.bY); S.bY=g.s7(function(){S.I7(1)},864E5)},oq=function(S,W,m){m?Zv("Sending: action="+W+", params="+g.hs(m)):Zv("Sending: action="+W); S.N.sendMessage(W,m)},oRn=function(S){ES.call(this,"ScreenServiceProxy"); this.IU=S;this.C=[];this.C.push(this.IU.$_s("screenChange",(0,g.dN)(this.NK,this)));this.C.push(this.IU.$_s("onlineScreenChange",(0,g.dN)(this.LQ6,this)))},wXv=function(S,W){buH(); if(!T0||!T0.get("yt-remote-disable-remote-module-for-dev")){W=g.D4("MDX_CONFIG")||W;Pev();heZ();rV||(rV=new DG(W?W.loungeApiHost:void 0),oAn()&&(rV.C="/api/loungedev"));CH||(CH=g.v9("yt.mdx.remote.deferredProxies_")||[],g.j$("yt.mdx.remote.deferredProxies_",CH));rO9();var m=cw();if(!m){var a=new KH(rV,W?W.disableAutomaticScreenCache||!1:!1);g.j$("yt.mdx.remote.screenService_",a);m=cw();var J={};W&&(J={appId:W.appId,disableDial:W.disableDial,theme:W.theme,loadCastApiSetupScript:W.loadCastApiSetupScript, disableCastApi:W.disableCastApi,enableDialLoungeToken:W.enableDialLoungeToken,enableCastLoungeToken:W.enableCastLoungeToken,forceMirroring:W.forceMirroring});g.j$("yt.mdx.remote.enableConnectWithInitialState_",W?W.enableConnectWithInitialState||!1:!1);TU$(S,a,function(B){B?Dv()&&LH(Dv(),"YouTube TV"):a.subscribe("onlineScreenChange",function(){q0("yt-remote-receiver-availability-change")})},J)}W&&!g.v9("yt.mdx.remote.initialized_")&&(g.j$("yt.mdx.remote.initialized_",!0),wV("Initializing: "+g.hs(W)), Sf.push(g.S0("yt-remote-cast2-api-ready",function(){q0("yt-remote-api-ready")})),Sf.push(g.S0("yt-remote-cast2-availability-change",function(){q0("yt-remote-receiver-availability-change")})),Sf.push(g.S0("yt-remote-cast2-receiver-selected",function(){WJ(null); q0("yt-remote-auto-connect","cast-selector-receiver")})),Sf.push(g.S0("yt-remote-cast2-receiver-resumed",function(){q0("yt-remote-receiver-resumed","cast-selector-receiver")})),Sf.push(g.S0("yt-remote-cast2-session-change",C7v)),Sf.push(g.S0("yt-remote-connection-change",function(B){B?LH(Dv(),"YouTube TV"):mc()||(LH(null,null),VYw())})),Sf.push(g.S0("yt-remote-cast2-session-failed",function(){q0("yt-remote-connection-failed")})),S=cOQ(),W.isAuto&&(S.id+="#dial"),J=W.capabilities||[],J.length>0&&(S.capabilities= J),S.name=W.device,S.app=W.app,(W=W.theme)&&(S.theme=W),wV(" -- with channel params: "+g.hs(S)),S?(g.i7("yt-remote-session-app",S.app),g.i7("yt-remote-session-name",S.name)):(g.Ix("yt-remote-session-app"),g.Ix("yt-remote-session-name")),g.j$("yt.mdx.remote.channelParams_",S),m.start(),Dv()||D5$())}},Sj$=function(){var S=cw().IU.$_gos(); var W=a7();W&&JM()&&(Ih8(S,W)||S.push(W));return dGn(S)},mD9=function(){var S=WU9(); !S&&Mh()&&Fm8()&&(S={key:"cast-selector-receiver",name:Fm8()});return S},WU9=function(){var S=Sj$(),W=a7(); W||(W=mc());return g.Nx(S,function(m){return W&&ED(W,m.key)?!0:!1})},a7=function(){var S=Dv(); if(!S)return null;var W=cw().Qm();return ya(W,S)},C7v=function(S){wV("remote.onCastSessionChange_: "+z0(S)); if(S){var W=a7();if(W&&W.id==S.id){if(LH(W.id,"YouTube TV"),S.idType=="shortLived"&&(S=S.token))BJ&&(BJ.token=S),(W=JM())&&W.vJ(S)}else W&&Eu(),zy(S,1)}else JM()&&Eu()},Eu=function(){US()?lb().stopSession():Hw("stopSession called before API ready."); var S=JM();S&&(S.disconnect(1),afn(null))},Jn8=function(){var S=JM(); return!!S&&S.getProxyState()!=3},wV=function(S){Ww("remote",S)},cw=function(){if(!Bax){var S=g.v9("yt.mdx.remote.screenService_"); Bax=S?new oRn(S):null}return Bax},Dv=function(){return g.v9("yt.mdx.remote.currentScreenId_")},Eox=function(S){g.j$("yt.mdx.remote.currentScreenId_",S)},zZH=function(){return g.v9("yt.mdx.remote.connectData_")},WJ=function(S){g.j$("yt.mdx.remote.connectData_",S)},JM=function(){return g.v9("yt.mdx.remote.connection_")},afn=function(S){var W=JM(); WJ(null);S||Eox("");g.j$("yt.mdx.remote.connection_",S);CH&&(g.V3(CH,function(m){m(S)}),CH.length=0); W&&!S?q0("yt-remote-connection-change",!1):!W&&S&&q0("yt-remote-connection-change",!0)},mc=function(){var S=g.PX(); if(!S)return null;var W=cw();if(!W)return null;W=W.Qm();return ya(W,S)},zy=function(S,W){Dv(); a7()&&a7();if(yo)BJ=S;else{Eox(S.id);var m=g.v9("yt.mdx.remote.enableConnectWithInitialState_")||!1;S=new bb(rV,S,cOQ(),m);S.connect(W,zZH());S.subscribe("beforeDisconnect",function(a){q0("yt-remote-before-disconnect",a)}); S.subscribe("beforeDispose",function(){JM()&&(JM(),afn(null))}); S.subscribe("browserChannelAuthError",function(){var a=a7();a&&a.idType=="shortLived"&&(US()?lb().handleBrowserChannelAuthError():Hw("refreshLoungeToken called before API ready."))}); afn(S)}},D5$=function(){var S=mc(); S?(wV("Resume connection to: "+z0(S)),zy(S,0)):(Kr(),VYw(),wV("Skipping connecting because no session screen found."))},rO9=function(){var S=cOQ(); if(g.UC(S)){S=G0();var W=g.dU("yt-remote-session-name")||"",m=g.dU("yt-remote-session-app")||"";S={device:"REMOTE_CONTROL",id:S,name:W,app:m,mdxVersion:3};S.authuser=String(g.D4("SESSION_INDEX","0"));(W=g.D4("DELEGATED_SESSION_ID"))&&(S.pageId=String(W));g.j$("yt.mdx.remote.channelParams_",S)}},cOQ=function(){return g.v9("yt.mdx.remote.channelParams_")||{}},GHn=function(S,W,m){g.A.call(this); var a=this;this.C=S;this.W=W;this.oL=m;this.events=new g.Tx(this);this.X=!1;this.V=new g.uV(64);this.N=new g.rj(this.V7,500,this);this.B=new g.rj(this.Oh,1E3,this);this.S=new FI(this.xp9,0,this);this.j={};this.bY=new g.rj(this.Ls,1E3,this);this.Z=new g.wj(this.seekTo,1E3,this);this.N2=this.events.K(this.W,"onVolumeChange",function(J){ynN(a,J)}); g.Z(this,this.events);this.events.K(W,"onCaptionsTrackListChanged",this.P$2);this.events.K(W,"captionschanged",this.Jw2);this.events.K(W,"captionssettingschanged",this.DA);this.events.K(W,"videoplayerreset",this.pQ);this.events.K(W,"mdxautoplaycancel",function(){a.oL.Lb()}); W.T("enable_mdx_video_play_directly")&&this.events.K(W,"videodatachange",function(){Yj9(a.C)||Yc(a)||Gy(a,0)}); S=this.oL;S.TN();S.subscribe("proxyStateChange",this.rH,this);S.subscribe("remotePlayerChange",this.v8,this);S.subscribe("remoteQueueChange",this.pQ,this);S.subscribe("previousNextChange",this.ED,this);S.subscribe("nowAutoplaying",this.TM,this);S.subscribe("autoplayDismissed",this.B$,this);g.Z(this,this.N);g.Z(this,this.B);g.Z(this,this.S);g.Z(this,this.bY);g.Z(this,this.Z);this.DA();this.pQ();this.v8()},ynN=function(S,W){if(Yc(S)){S.oL.unsubscribe("remotePlayerChange",S.v8,S); var m=Math.round(W.volume);W=!!W.muted;var a=fH(S.oL);if(m!==a.volume||W!==a.muted)S.oL.setVolume(m,W),S.bY.start();S.oL.subscribe("remotePlayerChange",S.v8,S)}},KUZ=function(S){S.Zb(0); S.N.stop();S.vU(new g.uV(64))},Taw=function(S,W){if(Yc(S)&&!S.X){var m=null; W&&(m={style:S.W.getSubtitlesUserSettings()},Object.assign(m,W));S.oL.LF(S.W.getVideoData(1).videoId,m);S.j=fH(S.oL).trackData}},Gy=function(S,W){var m=S.W.getPlaylist(); if(m==null?0:m.listId){var a=m.index;var J=m.listId.toString()}m=S.W.getVideoData(1);S.oL.playVideo(m.videoId,W,a,J,m.playerParams,m.N2,Gep(m));S.vU(new g.uV(1))},qj9=function(S,W){if(W){var m=S.W.getOption("captions","tracklist",{Z1:1}); m&&m.length?(S.W.setOption("captions","track",W),S.X=!1):(S.W.loadModule("captions"),S.X=!0)}else S.W.setOption("captions","track",{})},Yc=function(S){return fH(S.oL).videoId===S.W.getVideoData(1).videoId},pqn=function(S,W){g.hE.call(this,S); this.C=W},KJ=function(){g.b.call(this,{G:"div", L:"ytp-mdx-popup-dialog",D:{role:"dialog"},U:[{G:"div",L:"ytp-mdx-popup-dialog-inner-content",U:[{G:"div",L:"ytp-mdx-popup-title",Bn:"You're signed out"},{G:"div",L:"ytp-mdx-popup-description",Bn:"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."},{G:"div",L:"ytp-mdx-privacy-popup-buttons",U:[{G:"button",Wn:["ytp-button","ytp-mdx-privacy-popup-cancel"],Bn:"Cancel"},{G:"button",Wn:["ytp-button", "ytp-mdx-privacy-popup-confirm"],Bn:"Confirm"}]}]}]});this.fade=new g.mo(this,250);this.cancelButton=this.I2("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.I2("ytp-mdx-privacy-popup-confirm");g.Z(this,this.fade);this.K(this.cancelButton,"click",this.C);this.K(this.confirmButton,"click",this.N)},Ty=function(S){g.b.call(this,{G:"div", L:"ytp-remote",U:[{G:"div",L:"ytp-remote-display-status",U:[{G:"div",L:"ytp-remote-display-status-icon",U:[g.Z0P()]},{G:"div",L:"ytp-remote-display-status-text",Bn:"{{statustext}}"}]}]});this.api=S;this.fade=new g.mo(this,250);g.Z(this,this.fade);this.K(S,"presentingplayerstatechange",this.onStateChange);this.gA(S.getPlayerStateObject())},q3=function(S,W){g.M7.call(this,"Play on",1,S,W); this.W=S;this.gD={};this.K(S,"onMdxReceiversChange",this.N);this.K(S,"presentingplayerstatechange",this.N);this.N()},FUH=function(S){g.VT.call(this,S); this.Y0={key:iug(),name:"This computer"};this.Jm=null;this.subscriptions=[];this.WP=this.oL=null;this.gD=[this.Y0];this.iF=this.Y0;this.Ud=new g.uV(64);this.MR=0;this.B4=-1;this.Om=!1;this.qp=this.V5=this.CD=null;if(!g.NT(this.player.J())&&!g.IL(this.player.J())){S=this.player;var W=g.Ok(S);W&&(W=W.gE())&&(W=new q3(S,W),g.Z(this,W));W=new Ty(S);g.Z(this,W);g.tc(S,W.element,4);this.CD=new KJ;g.Z(this,this.CD);g.tc(S,this.CD.element,4);this.Om=!!mc()}},pJ=function(S){S.V5&&(S.player.removeEventListener("presentingplayerstatechange", S.V5),S.V5=null)},VF8=function(S,W,m){S.Ud=m; S.player.publish("presentingplayerstatechange",new g.KZ(m,W))},Fn=function(S,W){if(W.key!==S.iF.key)if(W.key===S.Y0.key)Eu(); else if(Yj9(S)&&noN(S),S.iF=W,!g.IL(S.player.J())){var m=S.player.getPlaylistId();var a=S.player.getVideoData(1);var J=a.videoId;if(!m&&!J||(S.player.getAppState()===2||S.player.getAppState()===1)&&S.player.J().T("should_clear_video_data_on_player_cued_unstarted"))a=null;else{var B=S.player.getPlaylist();if(B){var E=[];for(var y=0;y2*this.size&&aO(this),!0):!1}; g.V.get=function(S,W){return Wy(this.N,S)?this.N[S]:W}; g.V.set=function(S,W){Wy(this.N,S)||(this.size+=1,this.C.push(S),this.yE++);this.N[S]=W}; g.V.forEach=function(S,W){for(var m=this.gq(),a=0;a=a.C.length)return g.G2;var B=a.C[W++];return g.i9(S?B:a.N[B])}; return J}; var M6$={Xm_:"atp",TQq:"ska",fWq:"que",JeQ:"mus",WP2:"sus",qa9:"dsp",NQX:"seq",nT9:"mic",tQX:"dpa",KsN:"mlm",Gzn:"dsdtr",f2D:"ntb",IoN:"vsp",JmY:"scn",m0q:"rpe",wk_:"dcn",Am_:"dcp",Nq2:"pas",PV9:"drq",RcX:"opf",rmq:"els",KpX:"isg",IV9:"svq",reU:"mvp",t19:"ads",LPn:"stcp",wOn:"sads",cmN:"dloc",Hy9:"dcw",Hk2:"asw",Wv2:"apw",Ti6:"wrc",WV2:"pcw",QTn:"ipv",pTn:"ndt",epn:"ctops",CHn:"gsrm"},UGZ={jdY:"u",Unn:"cl",oMn:"k",VID:"i",NZX:"cr",zcq:"m",Rf2:"g",Tu:"up"},Cjp={xZ:"adPlaying",BH:"onAdStateChange"}, c2$={mzN:"nowPlaying",ecD:"onStateChange",xZ:"adPlaying",BH:"onAdStateChange",NF:"nowPlayingShorts",jK:"onShortsStateChange"},DBx={NF:"nowPlayingShorts",jK:"onShortsStateChange"};Ja.prototype.equals=function(S){return S?this.id==S.id:!1}; var $GZ="",T0=null,mcN=Ce$("loadCastFramework")||Ce$("loadCastApplicationFramework"),Btx=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.$p(FI,g.A);g.V=FI.prototype;g.V.rO=function(S){this.j=arguments;this.C=!1;this.SD?this.B=g.P9()+this.eS:this.SD=g.PQ(this.X,this.eS)}; g.V.stop=function(){this.SD&&(g.OQ.clearTimeout(this.SD),this.SD=null);this.B=null;this.C=!1;this.j=[]}; g.V.pause=function(){++this.N}; g.V.resume=function(){this.N&&(--this.N,!this.N&&this.C&&(this.C=!1,this.V.apply(null,this.j)))}; g.V.j9=function(){this.stop();FI.uQ.j9.call(this)}; g.V.JK=function(){this.SD&&(g.OQ.clearTimeout(this.SD),this.SD=null);this.B?(this.SD=g.PQ(this.X,this.B-g.P9()),this.B=null):this.N?this.C=!0:(this.C=!1,this.V.apply(null,this.j))};var nr=null;Va.prototype.set=function(S){this.C=S}; Va.prototype.reset=function(){this.set(g.P9())}; Va.prototype.get=function(){return this.C};g.$p(yUg,z8p);sD.prototype.stringify=function(S){return g.OQ.JSON.stringify(S,void 0)}; sD.prototype.parse=function(S){return g.OQ.JSON.parse(S,void 0)};g.$p(YoZ,g.mA);g.$p(GDg,g.mA);var K2$=null;g.$p(qop,g.mA);g.$p(pnw,g.mA);g.$p(F29,g.mA);jk.prototype.debug=function(){}; jk.prototype.info=function(){}; jk.prototype.warning=function(){};var Qaw={},jaZ={};g.V=Qa.prototype;g.V.setTimeout=function(S){this.d2=S}; g.V.F_=function(S){S=S.target;var W=this.zN;W&&g.oz(S)==3?W.hk():this.NA(S)}; g.V.NA=function(S){try{if(S==this.C)a:{var W=g.oz(this.C),m=this.C.N,a=this.C.getStatus();if(!(W<3)&&(W!=3||this.C&&(this.N.N||g.Cg(this.C)||g.cQ(this.C)))){this.s9||W!=4||m==7||(m==8||a<=0?uC(3):uC(2));HEH(this);var J=this.C.getStatus();this.vv=J;var B=OEN(this);if(this.V=J==200){if(this.IL&&!this.g2){b:{if(this.C){var E=g.DM(this.C,"X-HTTP-Initial-Response");if(E&&!g.C$(E)){var y=E;break b}}y=null}if(S=y)this.g2=!0,dcn(this,S);else{this.V=!1;this.X=3;gQ(12);vy(this);Hy(this);break a}}if(this.Pn){S= !0;for(var Y;!this.s9&&this.Z0&&!this.Wv&&(this.Wv=!0,this.B.ZO(this)):(vy(this),Hy(this))}else dcn(this,B);W==4&&vy(this);this.V&&!this.s9&&(W==4?lVQ(this.B,this):(this.V=!1,XI(this)))}else g.A0P(this.C),J==400&&B.indexOf("Unknown SID")> 0?(this.X=3,gQ(12)):(this.X=0,gQ(13)),vy(this),Hy(this)}}}catch(G){}finally{}}; g.V.cancel=function(){this.s9=!0;vy(this)}; g.V.zn=function(){this.N2=null;var S=Date.now();S-this.uY>=0?(this.O9!=2&&(uC(3),gQ(17)),vy(this),this.X=2,Hy(this)):vC8(this,this.uY-S)}; g.V.getLastError=function(){return this.X}; g.V.gW=function(){return this.C};P68.prototype.cancel=function(){this.B=kDx(this);if(this.N)this.N.cancel(),this.N=null;else if(this.C&&this.C.size!==0){for(var S=g.R(this.C.values()),W=S.next();!W.done;W=S.next())W.value.cancel();this.C.clear()}};g.V=AUp.prototype;g.V.Be=8;g.V.lK=1;g.V.connect=function(S,W,m,a){gQ(0);this.yT=S;this.s9=W||{};m&&a!==void 0&&(this.s9.OSID=m,this.s9.OAID=a);this.zN=this.eg;this.Hn=e8Q(this,null,this.yT);Lr(this)}; g.V.disconnect=function(){Ntv(this);if(this.lK==3){var S=this.hX++,W=this.Hn.clone();g.Te(W,"SID",this.j);g.Te(W,"RID",S);g.Te(W,"TYPE","terminate");xh(this,W);S=new Qa(this,this.j,S);S.O9=2;S.S=DS(W.clone());W=!1;if(g.OQ.navigator&&g.OQ.navigator.sendBeacon)try{W=g.OQ.navigator.sendBeacon(S.S.toString(),"")}catch(m){}!W&&g.OQ.Image&&((new Image).src=S.S,W=!0);W||(S.C=uNg(S.B,null),S.C.send(S.S));S.q2=Date.now();XI(S)}DcZ(this)}; g.V.U2=function(){return this.lK==0}; g.V.getState=function(){return this.lK}; g.V.qA=function(S){if(this.V)if(this.V=null,this.lK==1){if(!S){this.hX=Math.floor(Math.random()*1E5);S=this.hX++;var W=new Qa(this,"",S),m=this.bY;this.IL&&(m?(m=g.em(m),g.iH(m,this.IL)):m=this.IL);this.Z!==null||this.uY||(W.Hn=m,m=null);var a;if(this.M2)a:{for(var J=a=0;J4096){a=J;break a}if(a===4096||J===this.B.length-1){a=J+1;break a}}a= this.Kn}else a=this.Kn;a=rUw(this,W,a);J=this.Hn.clone();g.Te(J,"RID",S);g.Te(J,"CVER",22);this.Pn&&g.Te(J,"X-HTTP-Session-Id",this.Pn);xh(this,J);m&&(this.uY?a="headers="+g.hx(g.qXD(m))+"&"+a:this.Z&&g.Fc(J,this.Z,m));R8Z(this.N,W);this.CC&&g.Te(J,"TYPE","init");this.M2?(g.Te(J,"$req",a),g.Te(J,"SID","null"),W.IL=!0,saN(W,J,null)):saN(W,J,a);this.lK=2}}else this.lK==3&&(S?C6$(this,S):this.B.length==0||fVv(this.N)||C6$(this))}; g.V.jG=function(){this.S=null;cUg(this);if(this.Cn&&!(this.d2||this.C==null||this.qd<=0)){var S=4*this.qd;this.Xn=OD((0,g.dN)(this.rw2,this),S)}}; g.V.rw2=function(){this.Xn&&(this.Xn=null,this.zN=!1,this.d2=!0,gQ(10),M0(this),cUg(this))}; g.V.ZO=function(S){this.C==S&&this.Cn&&!this.d2&&(ZEZ(this),this.d2=!0,gQ(11))}; g.V.hK=function(){this.N2!=null&&(this.N2=null,M0(this),UcN(this),gQ(19))}; g.V.VSn=function(S){S?gQ(2):gQ(1)}; g.V.isActive=function(){return!!this.X&&this.X.isActive(this)}; g.V=Sw9.prototype;g.V.wK=function(){}; g.V.yK=function(){}; g.V.aj=function(){}; g.V.Ij=function(){}; g.V.isActive=function(){return!0}; g.V.D3=function(){};g.$p(dQ,g.ng);dQ.prototype.open=function(){this.C.X=this.B;this.V&&(this.C.g2=!0);this.C.connect(this.X,this.N||void 0)}; dQ.prototype.close=function(){this.C.disconnect()}; dQ.prototype.send=function(S){var W=this.C;if(typeof S==="string"){var m={};m.__data__=S;S=m}else this.j&&(m={},m.__data__=g.hs(S),S=m);W.B.push(new IVQ(W.Mi++,S));W.lK==3&&Lr(W)}; dQ.prototype.j9=function(){this.C.X=null;delete this.B;this.C.disconnect();delete this.C;dQ.uQ.j9.call(this)}; g.$p(mBg,YoZ);g.$p(a4H,GDg);g.$p(iC,Sw9);iC.prototype.wK=function(){this.C.dispatchEvent("m")}; iC.prototype.yK=function(S){this.C.dispatchEvent(new mBg(S))}; iC.prototype.aj=function(S){this.C.dispatchEvent(new a4H(S))}; iC.prototype.Ij=function(){this.C.dispatchEvent("n")}; J2Q.prototype.commit=function(S){this.C.vv=S};var Py=new g.ng;g.u(Enp,g.mA);g.V=ha.prototype;g.V.Oj=null;g.V.Ep=!1;g.V.O4=null;g.V.E8=null;g.V.T9=null;g.V.gh=null;g.V.tG=null;g.V.E6=null;g.V.Ej=null;g.V.GB=null;g.V.K2=0;g.V.bv=null;g.V.L2=null;g.V.Z5=null;g.V.Hj=-1;g.V.u5=!0;g.V.Wj=!1;g.V.Za=0;g.V.Zk=null;var TrQ={},Ktw={};g.V=ha.prototype;g.V.setTimeout=function(S){this.N=S}; g.V.UW=function(S){S=S.target;var W=this.Zk;W&&g.oz(S)==3?W.hk():this.Aq(S)}; g.V.Aq=function(S){try{if(S==this.GB)a:{var W=g.oz(this.GB),m=this.GB.N,a=this.GB.getStatus();if(g.ju&&!g.wb("420+")){if(W<4)break a}else if(W<3||W==3&&!g.Cg(this.GB))break a;this.Wj||W!=4||m==7||(m==8||a<=0?this.C.Fa(3):this.C.Fa(2));Ft9(this);var J=this.GB.getStatus();this.Hj=J;var B=g.Cg(this.GB);if(this.Ep=J==200){W==4&&ta(this);if(this.Pn){for(S=!0;!this.Wj&&this.K20?(this.Z5=3,fr(13)):(this.Z5=0,fr(14)),ta(this),VCp(this)}}catch(y){}finally{}}; g.V.cancel=function(){this.Wj=!0;ta(this)}; g.V.Sj=function(){this.O4=null;var S=Date.now();S-this.E8>=0?(this.gh!=2&&this.C.Fa(3),ta(this),this.Z5=2,fr(18),VCp(this)):p6v(this,this.E8-S)}; g.V.getLastError=function(){return this.Z5};g.V=gn9.prototype;g.V.LN=null;g.V.Uq=null;g.V.Er=!1;g.V.rF=null;g.V.E3=null;g.V.KU=-1;g.V.rh=null;g.V.wM=null;g.V.connect=function(S){this.rF=S;S=ZG(this.C,null,this.rF);fr(3);Date.now();var W=this.C.bY;W!=null?(this.rh=W[0],(this.wM=W[1])?(this.E3=1,OKn(this)):(this.E3=2,j29(this))):(ww(S,"MODE","init"),this.Uq=new ha(this),this.Uq.Oj=this.LN,Ywx(this.Uq,S,!1,null,!0),this.E3=0)}; g.V.qL=function(S){if(S)this.E3=2,j29(this);else{fr(4);var W=this.C;W.Mz=W.Cm.KU;rQ(W,9)}S&&this.Fa(2)}; g.V.gF=function(S){return this.C.gF(S)}; g.V.abort=function(){this.Uq&&(this.Uq.cancel(),this.Uq=null);this.KU=-1}; g.V.U2=function(){return!1}; g.V.Pe=function(S,W){this.KU=S.Hj;if(this.E3==0)if(W){try{var m=this.N.parse(W)}catch(a){S=this.C;S.Mz=this.KU;rQ(S,2);return}this.rh=m[0];this.wM=m[1]}else S=this.C,S.Mz=this.KU,rQ(S,2);else this.E3==2&&(this.Er?(fr(7),Date.now()):W=="11111"?(fr(6),this.Er=!0,Date.now(),this.KU=200,this.Uq.cancel(),fr(12),N0(this.C,this,!0)):(fr(8),Date.now(),this.Er=!1))}; g.V.KN=function(){this.KU=this.Uq.Hj;if(this.Uq.Ep)this.E3==0?this.wM?(this.E3=1,OKn(this)):(this.E3=2,j29(this)):this.E3==2&&(this.Er?(fr(12),N0(this.C,this,!0)):(fr(11),N0(this.C,this,!1)));else{this.E3==0?fr(9):this.E3==2&&fr(10);var S=this.C;this.Uq.getLastError();S.Mz=this.KU;rQ(S,2)}}; g.V.sA=function(){return this.C.sA()}; g.V.isActive=function(){return this.C.isActive()}; g.V.Fa=function(S){this.C.Fa(S)};g.V=Q2N.prototype;g.V.gZ=null;g.V.Va=null;g.V.Io=null;g.V.xt=null;g.V.zl=null;g.V.Jk=null;g.V.GI=null;g.V.J6=null;g.V.OA=0;g.V.dO=0;g.V.fJ=null;g.V.Lu=null;g.V.rQ=null;g.V.Lr=null;g.V.Cm=null;g.V.dT=null;g.V.gY=-1;g.V.XH=-1;g.V.Mz=-1;g.V.E4=0;g.V.ZS=0;g.V.g_=8;var s6p={OK:0,Qi6:2,GTU:4,Y_2:5,BeU:6,STOP:7,bf:8,soN:9,WYn:10,Tj2:11,n86:12};g.$p(vnv,g.mA);g.$p(HKN,g.mA);g.V=Q2N.prototype; g.V.connect=function(S,W,m,a,J){fr(0);this.zl=W;this.Va=m||{};a&&J!==void 0&&(this.Va.OSID=a,this.Va.OAID=J);this.S?(IO((0,g.dN)(this.yF,this,S),100),MCg(this)):this.yF(S)}; g.V.disconnect=function(){UBg(this);if(this.C==3){var S=this.OA++,W=this.Jk.clone();g.Te(W,"SID",this.j);g.Te(W,"RID",S);g.Te(W,"TYPE","terminate");oO(this,W);S=new ha(this,this.j,S);S.gh=2;S.tG=DS(W.clone());(new Image).src=S.tG.toString();S.T9=Date.now();Gz9(S)}kzN(this)}; g.V.yF=function(S){this.Cm=new gn9(this);this.Cm.LN=this.gZ;this.Cm.N=this.X;this.Cm.connect(S)}; g.V.U2=function(){return this.C==0}; g.V.getState=function(){return this.C}; g.V.We=function(S){this.Lu=null;iK$(this,S)}; g.V.tq=function(){this.rQ=null;this.xt=new ha(this,this.j,"rpc",this.Z);this.xt.Oj=this.gZ;this.xt.Za=0;var S=this.GI.clone();g.Te(S,"RID","rpc");g.Te(S,"SID",this.j);g.Te(S,"CI",this.dT?"0":"1");g.Te(S,"AID",this.gY);oO(this,S);g.Te(S,"TYPE","xmlhttp");Ywx(this.xt,S,!0,this.J6,!1)}; g.V.Pe=function(S,W){if(this.C!=0&&(this.xt==S||this.Io==S))if(this.Mz=S.Hj,this.Io==S&&this.C==3)if(this.g_>7){try{var m=this.X.parse(W)}catch(a){m=null}if(Array.isArray(m)&&m.length==3)if(S=m,S[0]==0)a:{if(!this.rQ){if(this.xt)if(this.xt.T9+3E30)){if(a=W==1)this.Io||this.Lu||this.C==1||this.E4>=2?a=!1:(this.Lu=IO((0,g.dN)(this.We,this,S),I48(this,this.E4)),this.E4++, a=!0);a=!(a||W==2&&Pj$(this))}if(a)switch(m){case 1:rQ(this,5);break;case 4:rQ(this,10);break;case 3:rQ(this,6);break;case 7:rQ(this,12);break;default:rQ(this,2)}}}; g.V.lG=function(S){if(!g.oZ(arguments,this.C))throw Error("Unexpected channel state: "+this.C);}; g.V.nB2=function(S){S?fr(2):(fr(1),f4p(this,8))}; g.V.gF=function(S){if(S)throw Error("Can't create secondary domain capable XhrIo object.");S=new g.ZM;S.Z=!1;return S}; g.V.isActive=function(){return!!this.fJ&&this.fJ.isActive(this)}; g.V.Fa=function(S){var W=Py;W.dispatchEvent(new HKN(W,S))}; g.V.sA=function(){return!1}; new yUg;g.V=$BN.prototype;g.V.sM=function(){}; g.V.TI=function(){}; g.V.nF=function(){}; g.V.He=function(){}; g.V.F6=function(){}; g.V.VK=function(){return{}}; g.V.isActive=function(){return!0};g.V=hkp.prototype;g.V.enqueue=function(S){this.N.push(S)}; g.V.isEmpty=function(){return this.C.length===0&&this.N.length===0}; g.V.clear=function(){this.C=[];this.N=[]}; g.V.contains=function(S){return g.oZ(this.C,S)||g.oZ(this.N,S)}; g.V.remove=function(S){var W=this.C;var m=(0,g.McK)(W,S);m>=0?(g.c9(W,m),W=!0):W=!1;return W||g.Sm(this.N,S)}; g.V.eQ=function(){for(var S=[],W=this.C.length-1;W>=0;--W)S.push(this.C[W]);W=this.N.length;for(var m=0;m0&&(this.V.YR9(this.N.F3(),this.B,!0),this.V.pZ9());this.V&&this.V.ARq();this.B?(this.N.stop(),g.nL(this.N),this.N=new Cr(this.Yv,this),this.B=!1):this.N.reset();this.vn=null;this.N2=0;if(this.j.length)if(this.Z)miZ(this);else{var S=this.j;this.j=[];var W=S.length;onN(this);WyH(this,S,W);cy(this)}else cy(this)}; g.V.He=function(S){var W=S==2&&this.C.Mz==401;S==4||W||(this.B&&!this.N.isActive()&&(g.nL(this.N),this.N=new Cr(this.Yv,this),this.B=!1),this.N.start());this.publish("handlerError",S,W);W=Object.keys(s6p).find(function(m){return s6p[m]===S}); this.Y6.WG("BROWSER_CHANNEL",W!=null?W:"UNKNOWN")}; g.V.F6=function(S,W){if(!this.N.isActive())this.publish("handlerClosed");else if(W)for(var m=W.length,a=0;a=u1N.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(S=u1N[this.N],this.SD=g.s7((0,g.dN)(this.w8,this),S),this.N++):this.publish("pairingFailed",Error("Server error "+S.status))}; g.V.uG=function(){this.C=null;this.publish("pairingFailed",Error("Server not responding"))}; var u1N=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.$p(y5,ES);g.V=y5.prototype;g.V.start=function(){zT(this)&&this.publish("screenChange");!g.dU("yt-remote-lounge-token-expiration")&&jk9(this);g.gu(this.C);this.C=g.s7((0,g.dN)(this.start,this),1E4)}; g.V.add=function(S,W){zT(this);skQ(this,S);Y4(this,!1);this.publish("screenChange");W(S);S.token||jk9(this)}; g.V.remove=function(S,W){var m=zT(this);g09(this,S)&&(Y4(this,!1),m=!0);W(S);m&&this.publish("screenChange")}; g.V.S6=function(S,W,m,a){var J=zT(this),B=this.get(S.id);B?(B.name!=W&&(B.name=W,Y4(this,!1),J=!0),m(S)):a(Error("no such local screen."));J&&this.publish("screenChange")}; g.V.j9=function(){g.gu(this.C);y5.uQ.j9.call(this)}; g.V.g69=function(S){zT(this);var W=this.screens.length;S=S&&S.screens||[];for(var m=S.length,a=0;a20)break a;y=W(B,E)}B=y}J.name=B}m(TT(this,J))},this), onError:(0,g.dN)(function(J){a(Error("pairing request failed: "+J.status))},this), onTimeout:(0,g.dN)(function(){a(Error("pairing request timed out."))},this)})}; g.V.j9=function(){g.nL(this.N);g.nL(this.C);KH.uQ.j9.call(this)}; g.V.D2n=function(){i0g(this);this.publish("screenChange");this.C.update()}; KH.prototype.dispose=KH.prototype.dispose;g.$p(qh,g.au);g.V=qh.prototype;g.V.hY=function(S){this.TN()||(S&&(F7(this,""+S),this.publish("sessionFailed")),this.C=null,this.publish("sessionScreen",null))}; g.V.info=function(S){Ww(this.Pn,S)}; g.V.EM=function(){return null}; g.V.tC=function(S){var W=this.N;S?(W.displayStatus=new chrome.cast.ReceiverDisplayStatus(S,[]),W.displayStatus.showStop=!0):W.displayStatus=null;chrome.cast.setReceiverDisplayStatus(W,(0,g.dN)(function(){this.info("Updated receiver status for "+W.friendlyName+": "+S)},this),(0,g.dN)(function(){F7(this,"Failed to update receiver status for: "+W.friendlyName)},this))}; g.V.j9=function(){this.tC("");qh.uQ.j9.call(this)};g.u(V5,qh);g.V=V5.prototype;g.V.Xc=function(S){if(this.B){if(this.B==S)return;F7(this,"Overriding cast session with new session object");b0w(this);this.q2=!1;this.bY="unknown";this.B.removeUpdateListener(this.vn);this.B.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xn)}this.B=S;this.B.addUpdateListener(this.vn);this.B.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xn);hp8(this,"getMdxSessionStatus")}; g.V.Wl=function(S){this.info("launchWithParams no-op for Cast: "+g.hs(S))}; g.V.stop=function(){this.B?this.B.stop((0,g.dN)(function(){this.hY()},this),(0,g.dN)(function(){this.hY(Error("Failed to stop receiver app."))},this)):this.hY(Error("Stopping cast device without session."))}; g.V.tC=function(){}; g.V.j9=function(){this.info("disposeInternal");b0w(this);this.B&&(this.B.removeUpdateListener(this.vn),this.B.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xn));this.B=null;qh.prototype.j9.call(this)}; g.V.ZC9=function(S,W){if(!this.TN())if(W)if(W=Sk(W),g.Ln(W))switch(S=""+W.type,W=W.data||{},this.info("onYoutubeMessage_: "+S+" "+g.hs(W)),S){case "mdxSessionStatus":fmw(this,W);break;case "loungeToken":to9(this,W);break;default:F7(this,"Unknown youtube message: "+S)}else F7(this,"Unable to parse message.");else F7(this,"No data in message.")}; g.V.m1=function(S,W,m,a){g.gu(this.S);this.S=0;Rp$(this.j,this.N.label,S,this.N.friendlyName,(0,g.dN)(function(J){J?W(J):a>=0?(F7(this,"Screen "+S+" appears to be offline. "+a+" retries left."),this.S=g.s7((0,g.dN)(this.m1,this,S,W,m,a-1),300)):m(Error("Unable to fetch screen."))},this),m)}; g.V.EM=function(){return this.B}; g.V.MB=function(S){this.TN()||S||(F7(this,"Cast session died."),this.hY())};g.u(nH,qh);g.V=nH.prototype;g.V.Xc=function(S){this.B=S;this.B.addUpdateListener(this.s9)}; g.V.Wl=function(S){this.Hn=S;this.N2()}; g.V.stop=function(){Wm8(this);this.B?this.B.stop((0,g.dN)(this.hY,this,null),(0,g.dN)(this.hY,this,"Failed to stop DIAL device.")):this.hY()}; g.V.j9=function(){Wm8(this);this.B&&this.B.removeUpdateListener(this.s9);this.B=null;qh.prototype.j9.call(this)}; g.V.oQ=function(S){this.TN()||S||(F7(this,"DIAL session died."),this.X(),this.X=function(){},this.hY())};g.u(gV,qh);gV.prototype.stop=function(){this.hY()}; gV.prototype.Xc=function(){}; gV.prototype.Wl=function(){g.gu(this.B);this.B=NaN;var S=ya(this.j.Qm(),this.N.label);S?pH(this,S):this.hY(Error("No such screen"))}; gV.prototype.j9=function(){g.gu(this.B);this.B=NaN;qh.prototype.j9.call(this)};g.u(OS,g.au);g.V=OS.prototype; g.V.init=function(S,W){chrome.cast.timeout.requestSession=3E4;var m=new chrome.cast.SessionRequest(this.S,[chrome.cast.Capability.AUDIO_OUT]);g.Qi("desktop_enable_cast_connect")&&(m.androidReceiverCompatible=!0);this.bY||(m.dialRequest=new chrome.cast.DialRequest("YouTube"));var a=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;S=S||this.V?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var J=(0,g.dN)(this.LI2,this);m=new chrome.cast.ApiConfig(m,(0,g.dN)(this.hP, this),J,a,S);m.customDialLaunchCallback=(0,g.dN)(this.RW2,this);chrome.cast.initialize(m,(0,g.dN)(function(){this.TN()||(chrome.cast.addReceiverActionListener(this.X),pLH(),this.N.subscribe("onlineScreenChange",(0,g.dN)(this.gK,this)),this.B=JOQ(this),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.dN)(function(B){this.AO("Failed to set initial custom receivers: "+g.hs(B))},this)),this.publish("yt-remote-cast2-availability-change",Q5(this)),W(!0))},this),(0,g.dN)(function(B){this.AO("Failed to initialize API: "+ g.hs(B)); W(!1)},this))}; g.V.dPY=function(S,W){jc("Setting connected screen ID: "+S+" -> "+W);if(this.C){var m=this.C.C;if(!S||m&&m.id!=S)jc("Unsetting old screen status: "+this.C.N.friendlyName),X7(this,null)}if(S&&W){if(!this.C){S=ya(this.N.Qm(),S);if(!S){jc("setConnectedScreenStatus: Unknown screen.");return}if(S.idType=="shortLived"){jc("setConnectedScreenStatus: Screen with id type to be short lived.");return}m=m5H(this,S);m||(jc("setConnectedScreenStatus: Connected receiver not custom..."),m=new chrome.cast.Receiver(S.uuid? S.uuid:S.id,S.name),m.receiverType=chrome.cast.ReceiverType.CUSTOM,this.B.push(m),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.dN)(function(a){this.AO("Failed to set initial custom receivers: "+g.hs(a))},this))); jc("setConnectedScreenStatus: new active receiver: "+m.friendlyName);X7(this,new gV(this.N,m),!0)}this.C.tC(W)}else jc("setConnectedScreenStatus: no screen.")}; g.V.kO2=function(S){this.TN()?this.AO("Setting connection data on disposed cast v2"):this.C?this.C.Wl(S):this.AO("Setting connection data without a session")}; g.V.bq=function(){this.TN()?this.AO("Stopping session on disposed cast v2"):this.C?(this.C.stop(),X7(this,null)):jc("Stopping non-existing session")}; g.V.requestSession=function(){chrome.cast.requestSession((0,g.dN)(this.hP,this),(0,g.dN)(this.uGN,this))}; g.V.j9=function(){this.N.unsubscribe("onlineScreenChange",(0,g.dN)(this.gK,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.X);var S=KyN,W=g.v9("yt.mdx.remote.debug.handlers_");g.Sm(W||[],S);g.nL(this.C);g.au.prototype.j9.call(this)}; g.V.AO=function(S){Ww("Controller",S)}; g.V.S3=function(S,W){this.C==S&&(W||X7(this,null),this.publish("yt-remote-cast2-session-change",W))}; g.V.Za2=function(S,W){if(!this.TN())if(S)switch(S.friendlyName=chrome.cast.unescape(S.friendlyName),jc("onReceiverAction_ "+S.label+" / "+S.friendlyName+"-- "+W),W){case chrome.cast.ReceiverAction.CAST:if(this.C)if(this.C.N.label!=S.label)jc("onReceiverAction_: Stopping active receiver: "+this.C.N.friendlyName),this.C.stop();else{jc("onReceiverAction_: Casting to active receiver.");this.C.C&&this.publish("yt-remote-cast2-session-change",this.C.C);break}switch(S.receiverType){case chrome.cast.ReceiverType.CUSTOM:X7(this, new gV(this.N,S));break;case chrome.cast.ReceiverType.DIAL:X7(this,new nH(this.N,S,this.j,this.config_));break;case chrome.cast.ReceiverType.CAST:X7(this,new V5(this.N,S,this.config_));break;default:this.AO("Unknown receiver type: "+S.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.C&&this.C.N.label==S.label?this.C.stop():this.AO("Stopping receiver w/o session: "+S.friendlyName)}else this.AO("onReceiverAction_ called without receiver.")}; g.V.RW2=function(S){if(this.TN())return Promise.reject(Error("disposed"));var W=S.receiver;W.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.AO("Not DIAL receiver: "+W.friendlyName),W.receiverType=chrome.cast.ReceiverType.DIAL);var m=this.C?this.C.N:null;if(!m||m.label!=W.label)return this.AO("Receiving DIAL launch request for non-clicked DIAL receiver: "+W.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(m&&m.label==W.label&&m.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.C.C)return jc("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.C.C),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.AO('Changing CAST intent from "'+m.receiverType+'" to "dial" for '+W.friendlyName);X7(this,new nH(this.N,W,this.j,this.config_))}W=this.C;W.S=S;W.S.appState==chrome.cast.DialAppState.RUNNING?(S=W.S.extraData||{},m=S.screenId||null,sS(W)&&S.loungeToken?S.loungeTokenRefreshIntervalMs?S=Diw(W,{name:W.N.friendlyName,screenId:S.screenId,loungeToken:S.loungeToken,dialId:W.S.receiver.label, screenIdType:"shortLived"},S.loungeTokenRefreshIntervalMs):(g.WL(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(S)+".")),S=wL$(W,m)):S=wL$(W,m)):S=COH(W);return S}; g.V.hP=function(S){var W=this;if(!this.TN()&&!this.V){jc("New cast session ID: "+S.sessionId);var m=S.receiver;if(m.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.C)if(m.receiverType==chrome.cast.ReceiverType.CAST)jc("Got resumed cast session before resumed mdx connection."),m.friendlyName=chrome.cast.unescape(m.friendlyName),X7(this,new V5(this.N,m,this.config_),!0);else{this.AO("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var a=this.C.N,J=ya(this.N.Qm(), a.label);J&&ED(J,m.label)&&a.receiverType!=chrome.cast.ReceiverType.CAST&&m.receiverType==chrome.cast.ReceiverType.CAST&&(jc("onSessionEstablished_: manual to cast session change "+m.friendlyName),g.nL(this.C),this.C=new V5(this.N,m,this.config_),this.C.subscribe("sessionScreen",(0,g.dN)(this.S3,this,this.C)),this.C.subscribe("sessionFailed",function(){return apw(W,W.C)}),this.C.Wl(null)); this.C.Xc(S)}}}; g.V.Cx=function(){return this.C?this.C.EM():null}; g.V.uGN=function(S){this.TN()||(this.AO("Failed to estabilish a session: "+g.hs(S)),S.code!=chrome.cast.ErrorCode.CANCEL&&X7(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.V.LI2=function(S){jc("Receiver availability updated: "+S);if(!this.TN()){var W=Q5(this);this.Z=S==chrome.cast.ReceiverAvailability.AVAILABLE;Q5(this)!=W&&this.publish("yt-remote-cast2-availability-change",Q5(this))}}; g.V.gK=function(){this.TN()||(this.B=JOQ(this),jc("Updating custom receivers: "+g.hs(this.B)),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.dN)(function(){this.AO("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Q5(this)))}; OS.prototype.setLaunchParams=OS.prototype.kO2;OS.prototype.setConnectedScreenStatus=OS.prototype.dPY;OS.prototype.stopSession=OS.prototype.bq;OS.prototype.getCastSession=OS.prototype.Cx;OS.prototype.requestSession=OS.prototype.requestSession;OS.prototype.init=OS.prototype.init;OS.prototype.dispose=OS.prototype.dispose;var go9=g.oK(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),pXN=[],KmZ=g.KX(go9);g.V=Rq.prototype; g.V.reset=function(S){this.listId="";this.index=-1;this.videoId="";gRg(this);this.volume=-1;this.muted=!1;S&&(this.index=S.index,this.listId=S.listId,this.videoId=S.videoId,this.playerState=S.playerState,this.volume=S.volume,this.muted=S.muted,this.audioTrackId=S.audioTrackId,this.trackData=S.trackData,this.hasPrevious=S.hasPrevious,this.hasNext=S.hasNext,this.V=S.playerTime,this.X=S.playerTimeAt,this.N=S.seekableStart,this.Z=S.seekableEnd,this.B=S.duration,this.loadedTime=S.loadedTime,this.C=S.liveIngestionTime, this.j=!isNaN(this.C))}; g.V.isPlaying=function(){return this.playerState==1}; g.V.isBuffering=function(){return this.playerState==3}; g.V.Ab=function(S){this.B=isNaN(S)?0:S}; g.V.getDuration=function(){return this.j?this.B+ec(this):this.B}; g.V.clone=function(){return new Rq(jx8(this))};g.u(Pw,g.au);g.V=Pw.prototype;g.V.getState=function(){return this.B}; g.V.Td=function(){return this.j.getReconnectTimeout()}; g.V.zL=function(){this.j.reconnect()}; g.V.play=function(){k4(this)?(this.C?this.C.play(null,g.Zt,A7(this,"play")):t7(this,"play"),vRQ(this,1,ib(fH(this))),this.publish("remotePlayerChange")):$4(this,this.play)}; g.V.pause=function(){k4(this)?(this.C?this.C.pause(null,g.Zt,A7(this,"pause")):t7(this,"pause"),vRQ(this,2,ib(fH(this))),this.publish("remotePlayerChange")):$4(this,this.pause)}; g.V.seekTo=function(S){if(k4(this)){if(this.C){var W=fH(this),m=new chrome.cast.media.SeekRequest;m.currentTime=S;W.isPlaying()||W.isBuffering()?m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.C.seek(m,g.Zt,A7(this,"seekTo",{newTime:S}))}else t7(this,"seekTo",{newTime:S});vRQ(this,3,S);this.publish("remotePlayerChange")}else $4(this,g.IZ(this.seekTo,S))}; g.V.stop=function(){if(k4(this)){this.C?this.C.stop(null,g.Zt,A7(this,"stopVideo")):t7(this,"stopVideo");var S=fH(this);S.index=-1;S.videoId="";gRg(S);h7(this,S);this.publish("remotePlayerChange")}else $4(this,this.stop)}; g.V.setVolume=function(S,W){if(k4(this)){var m=fH(this);if(this.N){if(m.volume!=S){var a=Math.round(S)/100;this.N.setReceiverVolumeLevel(a,(0,g.dN)(function(){mf("set receiver volume: "+a)},this),(0,g.dN)(function(){this.AO("failed to set receiver volume.")},this))}m.muted!=W&&this.N.setReceiverMuted(W,(0,g.dN)(function(){mf("set receiver muted: "+W)},this),(0,g.dN)(function(){this.AO("failed to set receiver muted.")},this))}else{var J={volume:S, muted:W};m.volume!=-1&&(J.delta=S-m.volume);t7(this,"setVolume",J)}m.muted=W;m.volume=S;h7(this,m)}else $4(this,g.IZ(this.setVolume,S,W))}; g.V.LF=function(S,W){if(k4(this)){var m=fH(this);S={videoId:S};W&&(m.trackData={trackName:W.name,languageCode:W.languageCode,sourceLanguageCode:W.translationLanguage?W.translationLanguage.languageCode:"",languageName:W.languageName,kind:W.kind},S.style=g.hs(W.style),g.iH(S,m.trackData));t7(this,"setSubtitlesTrack",S);h7(this,m)}else $4(this,g.IZ(this.LF,S,W))}; g.V.setAudioTrack=function(S,W){k4(this)?(W=W.getLanguageInfo().getId(),t7(this,"setAudioTrack",{videoId:S,audioTrackId:W}),S=fH(this),S.audioTrackId=W,h7(this,S)):$4(this,g.IZ(this.setAudioTrack,S,W))}; g.V.playVideo=function(S,W,m,a,J,B,E){a=a===void 0?null:a;J=J===void 0?null:J;B=B===void 0?null:B;E=E===void 0?null:E;var y=fH(this),Y={videoId:S};m!==void 0&&(Y.currentIndex=m);dV(y,S,m||0);W!==void 0&&(x4(y,W),Y.currentTime=W);a&&(Y.listId=a);J&&(Y.playerParams=J);B&&(Y.clickTrackingParams=B);E&&(Y.locationInfo=g.hs(E));t7(this,"setPlaylist",Y);a||h7(this,y)}; g.V.PE=function(S,W){if(k4(this)){if(S&&W){var m=fH(this);dV(m,S,W);h7(this,m)}t7(this,"previous")}else $4(this,g.IZ(this.PE,S,W))}; g.V.nextVideo=function(S,W){if(k4(this)){if(S&&W){var m=fH(this);dV(m,S,W);h7(this,m)}t7(this,"next")}else $4(this,g.IZ(this.nextVideo,S,W))}; g.V.Yy=function(){if(k4(this)){t7(this,"clearPlaylist");var S=fH(this);S.reset();h7(this,S);this.publish("remotePlayerChange")}else $4(this,this.Yy)}; g.V.Lb=function(){k4(this)?t7(this,"dismissAutoplay"):$4(this,this.Lb)}; g.V.dispose=function(){if(this.B!=3){var S=this.B;this.B=3;this.publish("proxyStateChange",S,this.B)}g.au.prototype.dispose.call(this)}; g.V.j9=function(){XX9(this);this.j=null;this.X.clear();Iq(this,null);g.au.prototype.j9.call(this)}; g.V.nf=function(S){if((S!=this.B||S==2)&&this.B!=3&&S!=0){var W=this.B;this.B=S;this.publish("proxyStateChange",W,S);if(S==1)for(;!this.X.isEmpty();)W=S=this.X,W.C.length===0&&(W.C=W.N,W.C.reverse(),W.N=[]),S.C.pop().apply(this);else S==3&&this.dispose()}}; g.V.nK2=function(S,W){this.publish(S,W)}; g.V.hWN=function(S){if(!S)this.oE(null),Iq(this,null);else if(this.N.receiver.volume){S=this.N.receiver.volume;var W=fH(this),m=Math.round(100*S.level||0);if(W.volume!=m||W.muted!=S.muted)mf("Cast volume update: "+S.level+(S.muted?" muted":"")),W.volume=m,W.muted=!!S.muted,h7(this,W)}}; g.V.oE=function(S){mf("Cast media: "+!!S);this.C&&this.C.removeUpdateListener(this.S);if(this.C=S)this.C.addUpdateListener(this.S),H5w(this),this.publish("remotePlayerChange")}; g.V.Fyn=function(S){S?(H5w(this),this.publish("remotePlayerChange")):this.oE(null)}; g.V.N7=function(){t7(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.V.Ud2=function(){var S=nRn();S&&Iq(this,S)}; g.V.AO=function(S){Ww("CP",S)};g.u(bb,g.au);g.V=bb.prototype; g.V.connect=function(S,W){if(W){var m=W.listId,a=W.videoId,J=W.videoIds,B=W.playerParams,E=W.clickTrackingParams,y=W.index,Y={videoId:a},G=W.currentTime,K=W.locationInfo;W=W.loopMode;G!==void 0&&(Y.currentTime=G<=5?0:G);B&&(Y.playerParams=B);K&&(Y.locationInfo=K);E&&(Y.clickTrackingParams=E);m&&(Y.listId=m);J&&J.length>0&&(Y.videoIds=J.join(","));y!==void 0&&(Y.currentIndex=y);this.s9&&(Y.loopMode=W||"LOOP_MODE_OFF");m&&(this.C.listId=m);this.C.videoId=a;this.C.index=y||0;this.C.state=3;x4(this.C, G);this.X="UNSUPPORTED";m=this.s9?"setInitialState":"setPlaylist";Zv("Connecting with "+m+" and params: "+g.hs(Y));this.N.connect({method:m,params:g.hs(Y)},S,t6Z())}else Zv("Connecting without params"),this.N.connect({},S,t6Z());Lmv(this)}; g.V.vJ=function(S){this.N.vJ(S)}; g.V.dispose=function(){this.TN()||(g.j$("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Nh(this,3));g.au.prototype.dispose.call(this)}; g.V.j9=function(){RSZ(this);x5N(this);eSH(this);g.gu(this.S);this.S=NaN;g.gu(this.bY);this.bY=NaN;this.j=null;g.HX(this.N2);this.N2.length=0;this.N.dispose();g.au.prototype.j9.call(this);this.X=this.Z=this.B=this.C=this.N=null}; g.V.Uv=function(S){if(!this.B||this.B.length===0)return!1;for(var W=g.R(this.B),m=W.next();!m.done;m=W.next())if(!m.value.capabilities.has(S))return!1;return!0}; g.V.j2n=function(){var S=3;this.TN()||(S=0,isNaN(this.Es())?this.N.Jd()&&isNaN(this.V)&&(S=1):S=2);return S}; g.V.I7=function(S){Zv("Disconnecting with "+S);g.j$("yt.mdx.remote.remoteClient_",null);RSZ(this);this.publish("beforeDisconnect",S);S==1&&Kr();this.N.disconnect(S);this.dispose()}; g.V.CYX=function(){var S=this.C;this.j&&(S=this.C.clone(),dV(S,this.j,S.index));return jx8(S)}; g.V.ea9=function(S){var W=this,m=new Rq(S);m.videoId&&m.videoId!=this.C.videoId&&(this.j=m.videoId,g.gu(this.S),this.S=g.s7(function(){if(W.j){var J=W.j;W.j=null;W.C.videoId!=J&&oq(W,"getNowPlaying")}},5E3)); var a=[];this.C.listId==m.listId&&this.C.videoId==m.videoId&&this.C.index==m.index||a.push("remoteQueueChange");this.C.playerState==m.playerState&&this.C.volume==m.volume&&this.C.muted==m.muted&&ib(this.C)==ib(m)&&g.hs(this.C.trackData)==g.hs(m.trackData)||a.push("remotePlayerChange");this.C.reset(S);g.V3(a,function(J){this.publish(J)},this)}; g.V.zX=function(){var S=this.N.getDeviceId(),W=g.Nx(this.B,function(m){return m.type=="REMOTE_CONTROL"&&m.id!=S}); return W?W.id:""}; g.V.Es=function(){return this.N.Td()}; g.V.US=function(){return this.X||"UNSUPPORTED"}; g.V.lc=function(){return this.Z||""}; g.V.iq=function(){!isNaN(this.Es())&&this.N.zL()}; g.V.SfD=function(S,W){oq(this,S,W);d5Q(this)}; g.V.KF=function(){var S=g.k0("SAPISID","")||g.k0("__Secure-1PAPISID")||"",W=g.k0("__Secure-3PAPISID","")||"";if(!S&&!W)return"";S=g.fh(g.Pr(S),2);W=g.fh(g.Pr(W),2);return g.fh(g.Pr(","+S+","+W),2)}; bb.prototype.subscribe=bb.prototype.subscribe;bb.prototype.unsubscribeByKey=bb.prototype.Uf;bb.prototype.getProxyState=bb.prototype.j2n;bb.prototype.disconnect=bb.prototype.I7;bb.prototype.getPlayerContextData=bb.prototype.CYX;bb.prototype.setPlayerContextData=bb.prototype.ea9;bb.prototype.getOtherConnectedRemoteId=bb.prototype.zX;bb.prototype.getReconnectTimeout=bb.prototype.Es;bb.prototype.getAutoplayMode=bb.prototype.US;bb.prototype.getAutoplayVideoId=bb.prototype.lc;bb.prototype.reconnect=bb.prototype.iq; bb.prototype.sendMessage=bb.prototype.SfD;bb.prototype.getXsrfToken=bb.prototype.KF;bb.prototype.isCapabilitySupportedOnConnectedDevices=bb.prototype.Uv;g.u(oRn,ES);g.V=oRn.prototype;g.V.Qm=function(S){return this.IU.$_gs(S)}; g.V.contains=function(S){return!!this.IU.$_c(S)}; g.V.get=function(S){return this.IU.$_g(S)}; g.V.start=function(){this.IU.$_st()}; g.V.add=function(S,W,m){this.IU.$_a(S,W,m)}; g.V.remove=function(S,W,m){this.IU.$_r(S,W,m)}; g.V.S6=function(S,W,m,a){this.IU.$_un(S,W,m,a)}; g.V.j9=function(){for(var S=this.C.length,W=0;W1&&!this.W.getOption("remote","quickCast")?(this.gD=g.n$(S,this.C,this),this.f1(g.MU(S,this.C)),S=this.W.getOption("remote","currentReceiver"),S=this.C(S),this.options[S]&&this.mT(S),this.enable(!0)):this.enable(!1)}; q3.prototype.C=function(S){return S.key}; q3.prototype.tY=function(S){return S==="cast-selector-receiver"?"Cast...":this.gD[S].name}; q3.prototype.M6=function(S){g.M7.prototype.M6.call(this,S);this.W.setOption("remote","currentReceiver",this.gD[S]);this.C3.OV()};g.u(FUH,g.VT);g.V=FUH.prototype; g.V.create=function(){var S=this.player.J(),W=g.ZI(S);S={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:S.T("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:S.T("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:S.T("enable_cast_short_lived_lounge_token")};wXv(W,S);this.subscriptions.push(g.S0("yt-remote-before-disconnect",this.Ky2,this));this.subscriptions.push(g.S0("yt-remote-connection-change",this.KIQ,this));this.subscriptions.push(g.S0("yt-remote-receiver-availability-change",this.KS, this));this.subscriptions.push(g.S0("yt-remote-auto-connect",this.gK_,this));this.subscriptions.push(g.S0("yt-remote-receiver-resumed",this.EK2,this));this.subscriptions.push(g.S0("mdx-privacy-popup-confirm",this.bJD,this));this.subscriptions.push(g.S0("mdx-privacy-popup-cancel",this.CK9,this));this.KS()}; g.V.load=function(){this.player.cancelPlayback();g.VT.prototype.load.call(this);this.qp=new pqn(this.player.J(),this);this.player.Hi(this.qp);this.Jm=new GHn(this,this.player,this.oL);var S=(S=zZH())?S.currentTime:0;var W=Jn8()?new Pw(JM(),void 0):null;S==0&&W&&(S=ib(fH(W)));S!==0&&this.Zb(S);VF8(this,this.Ud,this.Ud);this.player.AN(6)}; g.V.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.RV();this.iF=this.Y0;g.sH(this.Jm,this.oL);this.oL=this.qp=this.Jm=null;g.VT.prototype.unload.call(this);this.player.AN(5);pJ(this)}; g.V.j9=function(){g.Wp(this.subscriptions);g.VT.prototype.j9.call(this)}; g.V.EO=function(S){var W=g.VH.apply(1,arguments);this.loaded&&this.Jm.xV.apply(this.Jm,[S].concat(g.x(W)))}; g.V.getAdState=function(){return this.B4}; g.V.hasPrevious=function(){return this.oL?fH(this.oL).hasPrevious:!1}; g.V.hasNext=function(){return this.oL?fH(this.oL).hasNext:!1}; g.V.Zb=function(S,W){this.MR=S||0;this.player.publish("progresssync",S,W);this.player.NE("onVideoProgress",S||0)}; g.V.getCurrentTime=function(){return this.MR}; g.V.getDuration=function(){return fH(this.oL).getDuration()||0}; g.V.A1=function(){var S=fH(this.oL);return S.j?S.C+ec(S):S.C}; g.V.Ze=function(){return fH(this.oL).loadedTime}; g.V.ao=function(){return O5n(fH(this.oL))}; g.V.tj=function(){var S=fH(this.oL);return S.N>0?S.N+ec(S):S.N}; g.V.getProgressState=function(){var S=fH(this.oL),W=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:S.playerState!=1081&&this.player.lJ(),clipEnd:W.clipEnd,clipStart:W.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.A1(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Ze(),seekableEnd:this.ao(),seekableStart:this.tj(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.V.isAtLiveHead=function(){return O5n(fH(this.oL))-this.getCurrentTime()<=1}; g.V.nextVideo=function(){this.oL&&this.oL.nextVideo()}; g.V.PE=function(){this.oL&&this.oL.PE()}; g.V.Ky2=function(S){S===1&&(this.WP=this.oL?fH(this.oL):null)}; g.V.KIQ=function(){var S=Jn8()?new Pw(JM(),void 0):null;if(S){var W=this.iF;this.loaded&&this.unload();this.oL=S;this.WP=null;W.key!==this.Y0.key&&(this.iF=W,this.load())}else g.nL(this.oL),this.oL=null,this.loaded&&(this.unload(),(S=this.WP)&&S.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(S.videoId,ib(S)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.V.KS=function(){var S=[this.Y0],W=S.concat,m=Sj$();Mh()&&g.dU("yt-remote-cast-available")&&m.push({key:"cast-selector-receiver",name:"Cast..."});this.gD=W.call(S,m);S=mD9()||this.Y0;Fn(this,S);this.player.NE("onMdxReceiversChange")}; g.V.gK_=function(){var S=mD9();Fn(this,S)}; g.V.EK2=function(){this.iF=mD9()}; g.V.bJD=function(){this.Om=!0;pJ(this);yo=!1;BJ&&zy(BJ,1);BJ=null}; g.V.CK9=function(){this.Om=!1;pJ(this);Fn(this,this.Y0);this.iF=this.Y0;yo=!1;BJ=null;this.player.playVideo()}; g.V.uK=function(S,W){switch(S){case "casting":return this.loaded;case "receivers":return this.gD;case "currentReceiver":return W&&(W.key==="cast-selector-receiver"?sxN():Fn(this,W)),this.loaded?this.iF:this.Y0;case "quickCast":return this.gD.length===2&&this.gD[1].key==="cast-selector-receiver"?(W&&sxN(),!0):!1}}; g.V.N7=function(){this.oL.N7()}; g.V.a$=function(){return!1}; g.V.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.V.isLoggedIn=function(){var S,W;return((S=g.D4("PLAYER_CONFIG"))==null?void 0:(W=S.args)==null?void 0:W.authuser)!==void 0?!0:!(!g.D4("SESSION_INDEX")&&!g.D4("LOGGED_IN"))};g.Fi("remote",FUH);})(_yt_player);