(function(g){var window=this;'use strict';var uBO=function(G){if(G instanceof g.u_)return G;if(typeof G.Kg=="function")return G.Kg(!1);if(g.ZV(G)){var X=0,Q=new g.u_;Q.next=function(){for(;;){if(X>=G.length)return g.ZF;if(X in G)return g.PY(G[X++]);X++}}; return Q}throw Error("Not implemented");},PXv=function(G,X,Q){if(g.ZV(G))g.vn(G,X,Q); else for(G=uBO(G);;){var R=G.next();if(R.done)break;X.call(Q,R.value,void 0,G)}},iy=function(G){g.qO(G,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.jZ()).toString(36)); return G},GL=function(G,X,Q){Array.isArray(Q)||(Q=[String(Q)]); g.VDU(G.V,X,Q)},smL=function(G,X){var Q=[]; PXv(X,function(R){try{var S=g.at.prototype.W.call(this,R,!0)}catch(Z){if(Z=="Storage: Invalid value was encountered")return;throw Z;}S===void 0?Q.push(R):g.DvG(S)&&Q.push(R)},G); return Q},Tp3=function(G,X){smL(G,X).forEach(function(Q){g.at.prototype.remove.call(this,Q)},G)},KWZ=function(G){if(G.Xq){if(G.Xq.locationOverrideToken)return{locationOverrideToken:G.Xq.locationOverrideToken}; if(G.Xq.latitudeE7!=null&&G.Xq.longitudeE7!=null)return{latitudeE7:G.Xq.latitudeE7,longitudeE7:G.Xq.longitudeE7}}return null},eTG=function(G,X){g.rH(G,X)||G.push(X)},r8a=function(G){var X=0,Q; for(Q in G)X++;return X},azd=function(G,X){return g.Y7(G,X)},EDH=function(G){try{return g.i7.JSON.parse(G)}catch(X){}G=String(G); if(/^\s*$/.test(G)?0:/^[\],:{}\s\u2028\u2029]*$/.test(G.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("("+G+")")}catch(X){}throw Error("Invalid JSON string: "+G);},Qv=function(G){if(g.i7.JSON)try{return g.i7.JSON.parse(G)}catch(X){}return EDH(G)},xNa=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/channel/opened",g.XJ("channel_type"))},OiL=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/channel/closed",g.XJ("channel_type"))},zTH=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/channel/message_received",g.XJ("channel_type"))},c8o=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/channel/success")},gDL=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/channel/error",g.XJ("channel_type"),g.XJ("error_type"))},UNG=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},lz3=function(){var G=RO(); this.N=G;G.fg("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Bpa=function(G,X,Q,R){var S=new g.iw(null); G&&g.Gq(S,G);X&&g.Xt(S,X);Q&&g.QK(S,Q);R&&(S.W=R);return S},FWn=function(G,X){return new g.bv(G,X)},SB=function(G,X){return Object.prototype.hasOwnProperty.call(G,X)},CXG=function(G,X){return G===X},Zq=function(G,X){this.W={}; this.N=[];this.bq=this.size=0;var Q=arguments.length;if(Q>1){if(Q%2)throw Error("Uneven number of arguments");for(var R=0;R5&&(G=G.slice(G.length-5)); var X=g.P1(scH(),function(R){return R.loungeToken}),Q=g.P1(G,function(R){return R.loungeToken}); g.so(Q,function(R){return!g.rH(X,R)})&&ToO(); g.E5("yt-remote-local-screens",G,31536E3)},MC=function(G){G||(g.O5("yt-remote-session-screen-id"),g.O5("yt-remote-session-video-id")); u1H();G=YO();g.Ev(G,jB());mMO(G)},eNa=function(){if(!mh){var G=g.gC(); G&&(mh=new g.Kd(G))}},r7G=function(){eNa(); return mh?!!mh.get("yt-remote-use-staging-server"):!1},oO=function(G,X){g.As[G]=!0; var Q=g.D3();Q&&Q.publish.apply(Q,arguments);g.As[G]=!1},a$S=function(){},RO=function(){if(!ut){ut=new g.C4(new a$S); var G=g.MN("client_streamz_web_flush_count",-1);G!==-1&&(ut.Y=G)}return ut},ELG=function(){var G=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return G?parseInt(G[1],10):0},xMZ=function(G){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+G)!=-1||document.currentScript.src.indexOf("&"+G)!=-1)},OZH=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},Pu=function(G){G.length?zN3(G.shift(),function(){Pu(G)}):c7H()},gLn=function(G){return"chrome-extension://"+G+"/cast_sender.js"},zN3=function(G,X,Q){var R=document.createElement("script"); R.onerror=X;Q&&(R.onload=Q);g.KT(R,g.PO(G));(document.head||document.documentElement).appendChild(R)},UMv=function(){var G=ELG(),X=[]; if(G>1){var Q=G-1;X.push("//www.gstatic.com/eureka/clank/"+G+"/cast_sender.js");X.push("//www.gstatic.com/eureka/clank/"+Q+"/cast_sender.js")}return X},c7H=function(){var G=OZH(); G&&G(!1,"No cast extension found")},Boa=function(){if(l$Z){var G=2,X=OZH(),Q=function(){G--; G==0&&X&&X(!0)}; window.__onGCastApiAvailable=Q;zN3("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",c7H,Q)}},FX4=function(){Boa(); var G=UMv();G.push("//www.gstatic.com/eureka/clank/cast_sender.js");Pu(G)},t8G=function(){Boa(); var G=UMv();G.push.apply(G,g.o0(CaZ.map(gLn)));G.push("//www.gstatic.com/eureka/clank/cast_sender.js");Pu(G)},sb=function(G,X,Q){g.I.call(this); this.S=Q!=null?(0,g.La)(G,Q):G;this.BK=X;this.C=(0,g.La)(this.zo,this);this.N=!1;this.W=0;this.Y=this.G1=null;this.V=[]},TL=function(){},V8o=function(){g.y3.call(this,"p")},I$v=function(){g.y3.call(this,"o")},WXG=function(){return dMa=dMa||new g.hJ},pAa=function(G){g.y3.call(this,"serverreachability",G)},Kx=function(G){var X=WXG(); X.dispatchEvent(new pAa(X,G))},y7O=function(G){g.y3.call(this,"statevent",G)},eB=function(G){var X=WXG(); X.dispatchEvent(new y7O(X,G))},f$H=function(G,X,Q,R){g.y3.call(this,"timingevent",G); this.size=X;this.rtt=Q;this.retries=R},rm=function(G,X){if(typeof G!=="function")throw Error("Fn must not be null and must be a function"); return g.i7.setTimeout(function(){G()},X)},aO=function(){},Eb=function(G,X,Q,R){this.Y=G; this.V=X;this.C7=Q;this.Ps=R||1;this.bB=new g.Yx(this);this.BM=45E3;this.IU=null;this.S=!1;this.j=this.Xm=this.T=this.SA=this.Yc=this.KO=this.AT=null;this.yH=[];this.N=null;this.J=0;this.C=this.DC=null;this.As=-1;this.QH=!1;this.cM=0;this.wb=null;this.Hs=this.CO=this.N9=this.Mi=!1;this.W=new DMH},DMH=function(){this.W=null; this.N="";this.Y=!1},A7L=function(G,X,Q){G.SA=1; G.T=iy(X.clone());G.j=Q;G.Mi=!0;Nod(G,null)},Nod=function(G,X){G.Yc=Date.now(); xO(G);G.Xm=G.T.clone();GL(G.Xm,"t",G.Ps);G.J=0;var Q=G.Y.SA;G.W=new DMH;G.N=nLO(G.Y,Q?X:null,!G.j);G.cM>0&&(G.wb=new g.nU((0,g.La)(G.fN,G,G.N),G.cM));G.bB.listen(G.N,"readystatechange",G.Yz);X=G.IU?g.uY(G.IU):{};G.j?(G.DC||(G.DC="POST"),X["Content-Type"]="application/x-www-form-urlencoded",G.N.send(G.Xm,G.DC,G.j,X)):(G.DC="GET",G.N.send(G.Xm,G.DC,null,X));Kx(1)},bZv=function(G){if(!$M3(G))return g.NJ(G.N); var X=g.AJ(G.N);if(X==="")return"";var Q="",R=X.length,S=g.f4(G.N)==4;if(!G.W.W){if(typeof TextDecoder==="undefined")return Ob(G),zL(G),"";G.W.W=new g.i7.TextDecoder}for(var Z=0;ZX.length)return vLo;X=X.slice(R,R+Q);G.J=R+Q;return X},xO=function(G){G.KO=Date.now()+G.BM; GB3(G,G.BM)},GB3=function(G,X){if(G.AT!=null)throw Error("WatchDog timer not null"); G.AT=rm((0,g.La)(G.HY,G),X)},XIn=function(G){G.AT&&(g.i7.clearTimeout(G.AT),G.AT=null)},zL=function(G){G.Y.Bz()||G.QH||Qqk(G.Y,G)},Ob=function(G){XIn(G); g.Xh(G.wb);G.wb=null;G.bB.removeAll();if(G.N){var X=G.N;G.N=null;X.abort();X.dispose()}},L$4=function(G,X){try{var Q=G.Y; if(Q.BF!=0&&(Q.N==G||R_k(Q.W,G)))if(!G.CO&&R_k(Q.W,G)&&Q.BF==3){try{var R=Q.fd.N.parse(X)}catch(r){R=null}if(Array.isArray(R)&&R.length==3){var S=R;if(S[0]==0)a:{if(!Q.T){if(Q.N)if(Q.N.Yc+3E30&&(Q.cM=1.5*w);R=Q;var h=G.nT();if(h){var L=g.n4(h,"X-Client-Wire-Protocol");if(L){var k=R.W;!k.N&&(g.B$(L,"spdy")||g.B$(L,"quic")||g.B$(L,"h2"))&&(k.V=k.C,k.N=new Set,k.W&&(Hld(k,k.W),k.W=null))}if(R.Mi){var Y=g.n4(h,"X-HTTP-Session-Id");Y&&(R.Mj=Y,g.qO(R.IU,R.Mi,Y))}}Q.BF=3;Q.C&&Q.C.yf();Q.f7&&(Q.R6=Date.now()-G.Yc);R=Q;var M=G;R.kS=qeS(R,R.SA?R.C7:null,R.Js);if(M.CO){wIV(R.W, M);var m=M,u=R.cM;u&&m.setTimeout(u);m.AT&&(XIn(m),xO(m));R.N=M}else h_L(R);Q.Y.length>0&<(Q)}else Z[0]!="stop"&&Z[0]!="close"||Ub(Q,7);else Q.BF==3&&(Z[0]=="stop"||Z[0]=="close"?Z[0]=="stop"?Ub(Q,7):Q.disconnect():Z[0]!="noop"&&Q.C&&Q.C.N2(Z),Q.yH=0)}Kx(4)}catch(r){}},kBG=function(G,X){this.N=G; this.map=X;this.context=null},YeO=function(G){this.C=G||10; g.i7.PerformanceNavigationTiming?(G=g.i7.performance.getEntriesByType("navigation"),G=G.length>0&&(G[0].nextHopProtocol=="hq"||G[0].nextHopProtocol=="h2")):G=!!(g.i7.chrome&&g.i7.chrome.loadTimes&&g.i7.chrome.loadTimes()&&g.i7.chrome.loadTimes().wasFetchedViaSpdy);this.V=G?this.C:1;this.N=null;this.V>1&&(this.N=new Set);this.W=null;this.Y=[]},jqn=function(G){return G.W?!0:G.N?G.N.size>=G.V:!1},ZlO=function(G){return G.W?1:G.N?G.N.size:0},R_k=function(G,X){return G.W?G.W==X:G.N?G.N.has(X):!1},Hld= function(G,X){G.N?G.N.add(X):G.W=X},wIV=function(G,X){G.W&&G.W==X?G.W=null:G.N&&G.N.has(X)&&G.N.delete(X)},MUS=function(G){if(G.W!=null)return G.Y.concat(G.W.yH); if(G.N!=null&&G.N.size!==0){var X=G.Y;G=g.e(G.N.values());for(var Q=G.next();!Q.done;Q=G.next())X=X.concat(Q.value.yH);return X}return g.lL(G.Y)},mTd=function(G,X){var Q=new aO; if(g.i7.Image){var R=new Image;R.onload=g.k4(Bu,Q,"TestLoadImage: loaded",!0,X,R);R.onerror=g.k4(Bu,Q,"TestLoadImage: error",!1,X,R);R.onabort=g.k4(Bu,Q,"TestLoadImage: abort",!1,X,R);R.ontimeout=g.k4(Bu,Q,"TestLoadImage: timeout",!1,X,R);g.i7.setTimeout(function(){if(R.ontimeout)R.ontimeout()},1E4); R.src=G}else X(!1)},o_G=function(G,X){var Q=new aO,R=new AbortController,S=setTimeout(function(){R.abort(); Bu(Q,"TestPingServer: timeout",!1,X)},1E4); fetch(G,{signal:R.signal}).then(function(Z){clearTimeout(S);Z.ok?Bu(Q,"TestPingServer: ok",!0,X):Bu(Q,"TestPingServer: server error",!1,X)}).catch(function(){clearTimeout(S); Bu(Q,"TestPingServer: error",!1,X)})},Bu=function(G,X,Q,R,S){try{S&&(S.onload=null,S.onerror=null,S.onabort=null,S.ontimeout=null),R(Q)}catch(Z){}},uEv=function(){this.N=new TL},FR=function(G,X,Q){return Q&&Q.lx?Q.lx[G]||X:X},PqG=function(G){this.Y=[]; this.C7=this.kS=this.IU=this.Js=this.N=this.Mj=this.Mi=this.QH=this.J=this.N9=this.j=null;this.eI=this.Xm=0;this.lL=FR("failFast",!1,G);this.CO=this.AT=this.T=this.S=this.C=null;this.F7=!0;this.Xq=this.wb=-1;this.Ps=this.yH=this.Yc=0;this.ze=FR("baseRetryDelayMs",5E3,G);this.qd=FR("retryDelaySeedMs",1E4,G);this.Co=FR("forwardChannelMaxRetries",2,G);this.Fq=FR("forwardChannelRequestTimeoutMs",2E4,G);this.hS=G&&G.eDT||void 0;this.Ge=G&&G.qHC||void 0;this.bf=G&&G.GS_||!1;this.cM=void 0;this.SA=G&&G.PTB|| !1;this.V="";this.W=new YeO(G&&G.W9M);this.fd=new uEv;this.bB=G&&G.czB||!1;this.KO=G&&G.QLT||!1;this.bB&&this.KO&&(this.KO=!1);this.PR=G&&G.gv_||!1;G&&G.wfc&&(this.F7=!1);this.f7=!this.bB&&this.F7&&G&&G.xwc||!1;this.l9=void 0;G&&G.CB&&G.CB>0&&(this.l9=G.CB);this.As=void 0;this.R6=0;this.BM=!1;this.Hs=this.DC=null},gm=function(G){G.N&&(sqZ(G),G.N.cancel(),G.N=null)},TbS=function(G){gm(G); G.T&&(g.i7.clearTimeout(G.T),G.T=null);cu(G);G.W.cancel();G.S&&(typeof G.S==="number"&&g.i7.clearTimeout(G.S),G.S=null)},lt=function(G){jqn(G.W)||G.S||(G.S=!0,g.sy(G.du,G),G.Yc=0)},e_v=function(G,X){if(ZlO(G.W)>=G.W.V-(G.S?1:0))return!1; if(G.S)return G.Y=X.yH.concat(G.Y),!0;if(G.BF==1||G.BF==2||G.Yc>=(G.lL?0:G.Co))return!1;G.S=rm((0,g.La)(G.du,G,X),K$H(G,G.Yc));G.Yc++;return!0},a6v=function(G,X){var Q; X?Q=X.C7:Q=G.Xm++;var R=G.IU.clone();g.qO(R,"SID",G.V);g.qO(R,"RID",Q);g.qO(R,"AID",G.wb);Cx(G,R);G.J&&G.j&&g.kx(R,G.J,G.j);Q=new Eb(G,G.V,Q,G.Yc+1);G.J===null&&(Q.IU=G.j);X&&(G.Y=X.yH.concat(G.Y));X=r$L(G,Q,1E3);Q.setTimeout(Math.round(G.Fq*.5)+Math.round(G.Fq*.5*Math.random()));Hld(G.W,Q);A7L(Q,R,X)},Cx=function(G,X){G.QH&&g.Gn(G.QH,function(Q,R){g.qO(X,R,Q)}); G.C&&g.Gn({},function(Q,R){g.qO(X,R,Q)})},r$L=function(G,X,Q){Q=Math.min(G.Y.length,Q); var R=G.C?(0,g.La)(G.C.xz,G.C,G):null;a:{for(var S=G.Y,Z=-1;;){var H=["count="+Q];Z==-1?Q>0?(Z=S[0].N,H.push("ofs="+Z)):Z=0:H.push("ofs="+Z);for(var w=!0,h=0;h=3)return!1; G.Ps++;G.T=rm((0,g.La)(G.r5,G),K$H(G,G.yH));G.yH++;return!0},sqZ=function(G){G.DC!=null&&(g.i7.clearTimeout(G.DC),G.DC=null)},E_Z=function(G){G.N=new Eb(G,G.V,"rpc",G.Ps); G.J===null&&(G.N.IU=G.j);G.N.cM=0;var X=G.kS.clone();g.qO(X,"RID","rpc");g.qO(X,"SID",G.V);g.qO(X,"AID",G.wb);g.qO(X,"CI",G.CO?"0":"1");!G.CO&&G.l9&&g.qO(X,"TO",G.l9);g.qO(X,"TYPE","xmlhttp");Cx(G,X);G.J&&G.j&&g.kx(X,G.J,G.j);G.cM&&G.N.setTimeout(G.cM);var Q=G.N;G=G.C7;Q.SA=1;Q.T=iy(X.clone());Q.j=null;Q.Mi=!0;Nod(Q,G)},cu=function(G){G.AT!=null&&(g.i7.clearTimeout(G.AT),G.AT=null)},Qqk=function(G,X){var Q=null; if(G.N==X){cu(G);sqZ(G);G.N=null;var R=2}else if(R_k(G.W,X))Q=X.yH,wIV(G.W,X),R=1;else return;if(G.BF!=0)if(X.S)if(R==1){Q=X.j?X.j.length:0;X=Date.now()-X.Yc;var S=G.Yc;R=WXG();R.dispatchEvent(new f$H(R,Q,X,S));lt(G)}else h_L(G);else{var Z=X.As;S=X.getLastError();if(S==3||S==0&&Z>0||!(R==1&&e_v(G,X)||R==2&&SeV(G)))switch(Q&&Q.length>0&&(X=G.W,X.Y=X.Y.concat(Q)),S){case 1:Ub(G,5);break;case 4:Ub(G,10);break;case 3:Ub(G,6);break;default:Ub(G,2)}}},K$H=function(G,X){var Q=G.ze+Math.floor(Math.random()* G.qd); G.isActive()||(Q*=2);return Q*X},Ub=function(G,X){if(X==2){var Q=(0,g.La)(G.FDT,G),R=G.Ge,S=!R; R=new g.iw(R||"//www.google.com/images/cleardot.gif");g.i7.location&&g.i7.location.protocol=="http"||g.Gq(R,"https");iy(R);S?mTd(R.toString(),Q):o_G(R.toString(),Q)}else eB(2);G.BF=0;G.C&&G.C.Au(X);xTH(G);TbS(G)},xTH=function(G){G.BF=0; G.Hs=[];if(G.C){var X=MUS(G.W);if(X.length!=0||G.Y.length!=0)g.Bn(G.Hs,X),g.Bn(G.Hs,G.Y),G.W.Y.length=0,g.lL(G.Y),G.Y.length=0;G.C.uK()}},Olk=function(G){if(G.BF==0)return G.Hs; var X=[];g.Bn(X,MUS(G.W));g.Bn(X,G.Y);return X},qeS=function(G,X,Q){var R=g.wv(Q); R.N!=""?(X&&g.Xt(R,X+"."+R.N),g.QK(R,R.Y)):(R=g.i7.location,R=Bpa(R.protocol,X?X+"."+R.hostname:R.hostname,+R.port,Q));X=G.Mi;Q=G.Mj;X&&Q&&g.qO(R,X,Q);g.qO(R,"VER",G.g5);Cx(G,R);return R},nLO=function(G,X,Q){if(X&&!G.SA)throw Error("Can't create secondary domain capable XhrIo object."); X=G.bf&&!G.hS?new g.Wp(new g.$$({Si:Q})):new g.Wp(G.hS);X.J=G.SA;return X},z_a=function(){},c$a=function(){},Vv=function(G,X){g.hJ.call(this); this.N=new PqG(X);this.C=G;this.W=X&&X.ncH||null;G=X&&X.ocA||null;X&&X.yzT&&(G?G["X-Client-Protocol"]="webchannel":G={"X-Client-Protocol":"webchannel"});this.N.j=G;G=X&&X.uoM||null;X&&X.EC&&(G?G["X-WebChannel-Content-Type"]=X.EC:G={"X-WebChannel-Content-Type":X.EC});X&&X.Pv&&(G?G["X-WebChannel-Client-Profile"]=X.Pv:G={"X-WebChannel-Client-Profile":X.Pv});this.N.N9=G;(G=X&&X.toM)&&!g.lY(G)&&(this.N.J=G);this.S=X&&X.PTB||!1;this.V=X&&X.tOM||!1;(X=X&&X.oe)&&!g.lY(X)&&(this.N.Mi=X,g.k7(this.W,X)&&(G= this.W,X in G&&delete G[X]));this.Y=new t9(this)},g_G=function(G){V8o.call(this); G.__headers__&&(this.headers=G.__headers__,this.statusCode=G.__status__,delete G.__headers__,delete G.__status__);var X=G.__sm__;X?this.data=(this.N=g.SG(X))?g.mF(X,this.N):X:this.data=G},UTv=function(G){I$v.call(this); this.status=1;this.errorCode=G},t9=function(G){this.N=G},l6d=function(G,X){this.W=G; this.N=X},BbG=function(G){return Olk(G.N).map(function(X){var Q=G.W; X=X.map;"__data__"in X?(X=X.__data__,Q=Q.V?EDH(X):X):Q=X;return Q})},IO=function(G,X){if(typeof G!=="function")throw Error("Fn must not be null and must be a function"); return g.i7.setTimeout(function(){G()},X)},Wu=function(G){dm.dispatchEvent(new F$L(dm,G))},F$L=function(G){g.y3.call(this,"statevent",G)},px=function(G,X,Q,R){this.N=G; this.V=X;this.J=Q;this.S=R||1;this.W=45E3;this.Y=new g.Yx(this);this.C=new g.lD;this.C.setInterval(250)},tUG=function(G,X,Q){G.Ns=1; G.Cz=iy(X.clone());G.Ho=Q;G.Mi=!0;CqG(G,null)},VUo=function(G,X,Q,R,S){G.Ns=1; G.Cz=iy(X.clone());G.Ho=null;G.Mi=Q;S&&(G.KX=!1);CqG(G,R)},CqG=function(G,X){G.Gp=Date.now(); I6n(G);G.A$=G.Cz.clone();GL(G.A$,"t",G.S);G.zf=0;G.HI=G.N.SE(G.N.k7()?X:null);G.U3>0&&(G.uO=new g.nU((0,g.La)(G.WN,G,G.HI),G.U3));G.Y.listen(G.HI,"readystatechange",G.Mq);X=G.Wo?g.uY(G.Wo):{};G.Ho?(G.ym="POST",X["Content-Type"]="application/x-www-form-urlencoded",G.HI.send(G.A$,G.ym,G.Ho,X)):(G.ym="GET",G.KX&&!g.kh&&(X.Connection="close"),G.HI.send(G.A$,G.ym,null,X));G.N.Z3(1)},pI4=function(G,X){var Q=G.zf,R=X.indexOf("\n",Q); if(R==-1)return dTL;Q=Number(X.substring(Q,R));if(isNaN(Q))return W$H;R+=1;if(R+Q>X.length)return dTL;X=X.slice(R,R+Q);G.zf=R+Q;return X},I6n=function(G){G.Qz=Date.now()+G.W; y$H(G,G.W)},y$H=function(G,X){if(G.X4!=null)throw Error("WatchDog timer not null"); G.X4=IO((0,g.La)(G.h5,G),X)},f6G=function(G){G.X4&&(g.i7.clearTimeout(G.X4),G.X4=null)},DT4=function(G){G.N.Bz()||G.qT||G.N.l0(G)},yv=function(G){f6G(G); g.Xh(G.uO);G.uO=null;G.C.stop();G.Y.removeAll();if(G.HI){var X=G.HI;G.HI=null;X.abort();X.dispose()}G.ji&&(G.ji=null)},Nb3=function(G,X){try{G.N.zv(G,X),G.N.Z3(4)}catch(Q){}},n_H=function(G,X,Q,R,S){if(R==0)Q(!1); else{var Z=S||0;R--;A$S(G,X,function(H){H?Q(!0):g.i7.setTimeout(function(){n_H(G,X,Q,R,Z)},Z)})}},A$S=function(G,X,Q){var R=new Image; R.onload=function(){try{fx(R),Q(!0)}catch(S){}}; R.onerror=function(){try{fx(R),Q(!1)}catch(S){}}; R.onabort=function(){try{fx(R),Q(!1)}catch(S){}}; R.ontimeout=function(){try{fx(R),Q(!1)}catch(S){}}; g.i7.setTimeout(function(){if(R.ontimeout)R.ontimeout()},X); R.src=G},fx=function(G){G.onload=null; G.onerror=null;G.onabort=null;G.ontimeout=null},$T3=function(G){this.N=G; this.W=new TL},bln=function(G){var X=Dq(G.N,G.Uy,"/mail/images/cleardot.gif"); iy(X);n_H(X.toString(),5E3,(0,g.La)(G.qH,G),3,2E3);G.Z3(1)},v_V=function(G){var X=G.N.S; X!=null?(Wu(5),X?(Wu(11),NC(G.N,G,!1)):(Wu(12),NC(G.N,G,!0))):(G.b8=new px(G),G.b8.Wo=G.vG,X=G.N,X=Dq(X,X.k7()?G.HT:null,G.Cw),Wu(5),GL(X,"TYPE","xmlhttp"),VUo(G.b8,X,!1,G.HT,!1))},J$Z=function(G,X,Q){this.N=1; this.W=[];this.Y=[];this.C=new TL;this.j=G||null;this.S=X!=null?X:null;this.T=Q||!1},ilO=function(G,X){this.N=G; this.map=X;this.context=null},GwZ=function(G,X,Q,R){g.y3.call(this,"timingevent",G); this.size=X;this.rtt=Q;this.retries=R},XeH=function(G){g.y3.call(this,"serverreachability",G)},RIk=function(G){G.sD(1,0); G.Y8=Dq(G,null,G.PG);Qso(G)},S3V=function(G){G.y3&&(G.y3.abort(),G.y3=null); G.bT&&(G.bT.cancel(),G.bT=null);G.fD&&(g.i7.clearTimeout(G.fD),G.fD=null);A9(G);G.zi&&(G.zi.cancel(),G.zi=null);G.Xo&&(g.i7.clearTimeout(G.Xo),G.Xo=null)},ZH3=function(G,X){if(G.N==0)throw Error("Invalid operation: sending map when state is closed"); G.W.push(new ilO(G.DH++,X));G.N!=2&&G.N!=3||Qso(G)},HH3=function(G){var X=0; G.bT&&X++;G.zi&&X++;return X},Qso=function(G){G.zi||G.Xo||(G.Xo=IO((0,g.La)(G.xK,G),0),G.B5=0)},hIL=function(G,X){if(G.N==1){if(!X){G.Jd=Math.floor(Math.random()*1E5); X=G.Jd++;var Q=new px(G,"",X);Q.Wo=G.X6;var R=q3n(G),S=G.Y8.clone();g.qO(S,"RID",X);g.qO(S,"CVER","1");nx(G,S);tUG(Q,S,R);G.zi=Q;G.N=2}}else G.N==3&&(X?weZ(G,X):G.W.length==0||G.zi||weZ(G))},weZ=function(G,X){if(X)if(G.Ym>6){G.W=G.Y.concat(G.W); G.Y.length=0;var Q=G.Jd-1;X=q3n(G)}else Q=X.J,X=X.Ho;else Q=G.Jd++,X=q3n(G);var R=G.Y8.clone();g.qO(R,"SID",G.V);g.qO(R,"RID",Q);g.qO(R,"AID",G.T4);nx(G,R);Q=new px(G,G.V,Q,G.B5+1);Q.Wo=G.X6;Q.setTimeout(1E4+Math.round(1E4*Math.random()));G.zi=Q;tUG(Q,R,X)},nx=function(G,X){G.Tj&&(G=G.Tj.Iw())&&g.Gn(G,function(Q,R){g.qO(X,R,Q)})},q3n=function(G){var X=Math.min(G.W.length,1E3),Q=["count="+X]; if(G.Ym>6&&X>0){var R=G.W[0].N;Q.push("ofs="+R)}else R=0;for(var S={},Z=0;Z=3)return!1; G.J++;G.fD=IO((0,g.La)(G.Vf,G),kwv(G,G.EF));G.EF++;return!0},NC=function(G,X,Q){G.tB=G.S==null?Q:!G.S; G.zq=X.by;G.T||RIk(G)},A9=function(G){G.VV!=null&&(g.i7.clearTimeout(G.VV),G.VV=null)},kwv=function(G,X){var Q=5E3+Math.floor(Math.random()*1E4); G.isActive()||(Q*=2);return Q*X},$O=function(G,X){if(X==2||X==9){var Q=null; G.Tj&&(Q=null);var R=(0,g.La)(G.eFA,G);Q||(Q=new g.iw("//www.google.com/images/cleardot.gif"),iy(Q));A$S(Q.toString(),1E4,R)}else Wu(2);jsn(G,X)},jsn=function(G,X){G.N=0; G.Tj&&G.Tj.M2(X);MiS(G);S3V(G)},MiS=function(G){G.N=0; G.zq=-1;if(G.Tj)if(G.Y.length==0&&G.W.length==0)G.Tj.GU();else{var X=g.lL(G.Y),Q=g.lL(G.W);G.Y.length=0;G.W.length=0;G.Tj.GU(X,Q)}},Dq=function(G,X,Q){var R=g.wv(Q); if(R.N!="")X&&g.Xt(R,X+"."+R.N),g.QK(R,R.Y);else{var S=window.location;R=Bpa(S.protocol,X?X+"."+S.hostname:S.hostname,+S.port,Q)}G.ib&&g.Gn(G.ib,function(Z,H){g.qO(R,H,Z)}); g.qO(R,"VER",G.Ym);nx(G,R);return R},m4n=function(){},oQ4=function(){this.N=[]; this.W=[]},uQG=function(G){g.y3.call(this,"channelMessage"); this.message=G},PC4=function(G){g.y3.call(this,"channelError"); this.error=G},ssd=function(G,X){this.action=G; this.params=X||{}},bt=function(G,X){g.I.call(this); this.N=new g.fU(this.Uj_,0,this);g.d(this,this.N);this.BK=5E3;this.W=0;if(typeof G==="function")X&&(G=(0,g.La)(G,X));else if(G&&typeof G.handleEvent==="function")G=(0,g.La)(G.handleEvent,G);else throw Error("Invalid listener argument");this.Y=G},TW4=function(G,X,Q,R,S,Z,H,w,h,L,k,Y,M,m){Q=Q===void 0?!1:Q; R=R===void 0?function(){return""}:R; S=S===void 0?!1:S;Z=Z===void 0?!1:Z;H=H===void 0?!1:H;w=w===void 0?function(){return g.Oy({})}:w; h=h===void 0?!1:h;k=k===void 0?!1:k;Y=Y===void 0?!1:Y;M=M===void 0?!1:M;m=m===void 0?!1:m;this.SA=G;this.AT=X;this.S=new g.Tk;this.W=new bt(this.EOm,this);this.N=null;this.J=!1;this.j=null;this.Yc="";this.yH=this.T=0;this.Y=[];this.Hs=Q;this.Mi=R;this.C=Z;this.IU=w;this.QH=L;this.Ps=H;this.DC=null;this.V=g.Oy();this.C7=S;this.N9=h;this.bB=k;this.KO=Y;this.Js=M;this.As=m;this.cM=new xNa;this.CO=new OiL;this.BM=new c8o;this.Xm=new zTH;this.wb=new gDL;this.F7=new UNG;this.f7=new lz3},rsv=function(G, X,Q,R,S){Ks3(G); if(G.N){var Z=g.WO("ID_TOKEN"),H=G.N.X6||{};Z?H["x-youtube-identity-token"]=Z:delete H["x-youtube-identity-token"];G.N.X6=H}eIa(G);R?(R.getState()!=3&&HH3(R)==0||R.getState(),G.N.connect(X,Q,G.AT,R.V,R.T4)):S?G.N.connect(X,Q,G.AT,S.sessionId,S.arrayId):G.N.connect(X,Q,G.AT)},OHv=function(G,X){return G.Js?!0:G.KO?Object.values(a3v).includes(X):G.bB?!Object.values(EQk).includes(X):G.As?Object.values(x4H).includes(X):!1},gQv=function(G){var X,Q; g.F(function(R){if(R.W==1)return g.EC(R,2),g.l(R,zIS(G),2);g.FS(R);X=G.Y;G.Y=[];Q=X.length;csH(G,X,Q);vu(G);return g.tG(R,0)})},csH=function(G,X,Q){for(var R=0;R0?Q=Object.assign({},Q,X):delete Q.Authorization;G.N.X6=Q}},eIa=function(G){G.QH&&!G.C&&l34(G,G.QH())},J9=function(G){this.scheme="https"; this.port=this.domain="";this.N="/api/lounge";this.W=!0;G=G||document.location.href;var X=Number(g.we(G)[4]||null)||"";X&&(this.port=":"+X);this.domain=g.hN(G)||"";G=g.IB();G.search("MSIE")>=0&&(G=G.match(/MSIE ([\d.]+)/)[1],g.V2(G,"10.0")<0&&(this.W=!1))},Gm=function(G,X){var Q=G.N; G.W&&(Q=G.scheme+"://"+G.domain+G.port+G.N);return g.on(Q+X,{})},BWH=function(G,X){g.hJ.call(this); var Q=this;this.handler=G();this.handler.subscribe("handlerOpened",this.aj,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(R,S){Q.onError(S)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.N=X},FsG=function(G,X,Q){var R=this; Q=Q===void 0?function(){return""}:Q; var S=S===void 0?new c$a:S;var Z=Z===void 0?new g.Tk:Z;this.pathPrefix=G;this.N=X;this.Yc=Q;this.C=Z;this.T=null;this.j=this.J=0;this.channel=null;this.S=0;this.Y=new bt(function(){R.Y.isActive();var H;((H=R.channel)==null?void 0:ZlO((new l6d(H,H.N)).N.W))===0&&R.connect(R.T,R.J)}); this.V={};this.W={};this.AT=!1;this.logger=null;this.yH=[];this.CL=void 0;this.IU=new xNa;this.DC=new OiL;this.QH=new zTH;this.Mi=new gDL},CCk=function(G){g.vs(G.channel,"m",function(){G.S=3; G.Y.reset();G.T=null;G.J=0;for(var X=g.e(G.yH),Q=X.next();!Q.done;Q=X.next())Q=Q.value,G.channel&&G.channel.send(Q);G.yH=[];G.publish("webChannelOpened");G.IU.J1("WEB_CHANNEL")}); g.vs(G.channel,"n",function(){G.S=0;G.Y.isActive()||G.publish("webChannelClosed");var X,Q=(X=G.channel)==null?void 0:BbG(new l6d(X,X.N));Q&&(G.yH=[].concat(g.o0(Q)));G.DC.J1("WEB_CHANNEL")}); g.vs(G.channel,"p",function(X){var Q=X.data;Q[0]==="gracefulReconnect"?(G.Y.start(),G.channel&&G.channel.close()):G.publish("webChannelMessage",new ssd(Q[0],Q[1]));G.CL=X.statusCode;G.QH.J1("WEB_CHANNEL")}); g.vs(G.channel,"o",function(){G.CL===401||G.Y.start();G.publish("webChannelError");G.Mi.J1("WEB_CHANNEL","")})},tio=function(G){var X=G.Yc(); X?G.V["x-youtube-lounge-xsrf-token"]=X:delete G.V["x-youtube-lounge-xsrf-token"]},Vi3=function(G){g.hJ.call(this); this.N=G();this.N.subscribe("webChannelOpened",this.Ij,this);this.N.subscribe("webChannelClosed",this.onClosed,this);this.N.subscribe("webChannelError",this.onError,this);this.N.subscribe("webChannelMessage",this.onMessage,this)},I3H=function(G,X,Q,R,S){function Z(){return new TW4(Gm(G,"/bc"),X,!1,Q,R)} Q=Q===void 0?function(){return""}:Q; return g.jg("enable_mdx_web_channel_desktop")?new Vi3(function(){return new FsG(Gm(G,"/wc"),X,Q)}):new BWH(Z,S)},ysL=function(){var G=d4G; Wso();Xg.push(G);peZ()},QN=function(G,X){Wso(); var Q=f3v(G,String(X));Xg.length==0?D4O(Q):(peZ(),g.vn(Xg,function(R){R(Q)}))},RH=function(G){QN("CP",G)},Wso=function(){Xg||(Xg=g.QH("yt.mdx.remote.debug.handlers_")||[],g.G3("yt.mdx.remote.debug.handlers_",Xg))},D4O=function(G){var X=(Sm+1)%50; Sm=X;Zj[X]=G;HU||(HU=X==49)},peZ=function(){var G=Xg; if(Zj[0]){var X=HU?Sm:-1,Q={};do Q={Qi:void 0},X=(X+1)%50,Q.Qi=Zj[X],g.vn(G,function(R){return function(S){S(R.Qi)}}(Q)); while(X!=Sm);Zj=Array(50);Sm=-1;HU=!1}},f3v=function(G,X){var Q=(Date.now()-NWG)/1E3; Q.toFixed&&(Q=Q.toFixed(3));var R=[];R.push("[",Q+"s","] ");R.push("[","yt.mdx.remote","] ");R.push(G+": "+X,"\n");return R.join("")},qw=function(G){g.ic.call(this); this.S=G;this.screens=[]},AsZ=function(G,X){var Q=G.get(X.uuid)||G.get(X.id); if(Q)return G=Q.name,Q.id=X.id||Q.id,Q.name=X.name,Q.token=X.token,Q.uuid=X.uuid||Q.uuid,Q.name!=G;G.screens.push(X);return!0},nQv=function(G,X){var Q=G.screens.length!=X.length; G.screens=g.xo(G.screens,function(Z){return!!Y5n(X,Z)}); for(var R=X.length,S=0;S0&&G.V0&&Tm(G,Q)},function(X){G.C=function(){}; G.C2(X)})},rgZ=function(G){var X={}; X.pairingCode=G.DC;X.theme=G.SA;r7G()&&(X.env_useStageMdx=1);return g.mN(X)},aDZ=function(G){return new Promise(function(X){G.DC=LXH(); if(G.IU){var Q=new chrome.cast.DialLaunchResponse(!0,rgZ(G));X(Q);e$L(G)}else G.AT=function(){g.Li(G.j);G.AT=function(){}; G.j=NaN;var R=new chrome.cast.DialLaunchResponse(!0,rgZ(G));X(R);e$L(G)},G.j=g.wp(function(){G.AT()},100)})},xtk=function(G,X,Q){G.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(X)); var R=new wm(X);return(new Promise(function(S){EGd(G,R,function(Z){Z?(G.yH=!0,jm(G.V,R),mQ(G,R),Tm(G,Q)):g.fc(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(X)+" is not online."));S(Z)},5)})).then(function(S){return S?new chrome.cast.DialLaunchResponse(!1):aDZ(G)})},O7V=function(G,X){var Q=G.T.receiver.label,R=G.W.friendlyName; return(new Promise(function(S){H7H(G.V,Q,X,R,function(Z){Z&&Z.token&&mQ(G,Z);S(Z)},function(Z){oH(G,"Failed to get DIAL screen: "+Z); S(null)})})).then(function(S){return S&&S.token?new chrome.cast.DialLaunchResponse(!1):aDZ(G)})},EGd=function(G,X,Q,R){g.Li(G.S); G.S=0;wRk(G.V,X,function(S){S||R<0?Q(S):G.S=g.wp(function(){EGd(G,X,Q,R-1)},300)})},Tm=function(G,X){G.info("getDialAppInfoWithTimeout_ "+X); sV(G)&&(g.Li(G.J),G.J=0,X==0?z$o(G):G.J=g.wp(function(){z$o(G)},X))},z$o=function(G){sV(G)&&G.Y.getDialAppInfo(function(X){G.info("getDialAppInfo dialLaunchData: "+JSON.stringify(X)); X=X.extraData||{};var Q=null;if(X.loungeToken){var R;((R=G.N)==null?void 0:R.token)==X.loungeToken&&(Q="staleLoungeToken")}else Q="missingLoungeToken";Q?(G.Yc=Q,Tm(G,3E4)):(G.yH=!1,G.Yc="unknown",YTZ(G,X.loungeToken),Tm(G,X.loungeTokenRefreshIntervalMs))},function(X){G.info("getDialAppInfo error: "+X); G.Yc="noLoungeTokenResponse";Tm(G,3E4)})},cgG=function(G){g.Li(G.S); G.S=0;g.Li(G.J);G.J=0;G.C();G.C=function(){}; g.Li(G.j)},Kk=function(G,X){Mw.call(this,G,X,"ManualSession"); this.Y=g.wp((0,g.La)(this.q_,this,null),150)},em=function(G,X){g.ic.call(this); this.config_=X;this.W=G;this.T=X.appId||"233637DE";this.V=X.theme||"cl";this.j=X.disableCastApi||!1;this.S=X.forceMirroring||!1;this.N=null;this.J=!1;this.Y=[];this.C=(0,g.La)(this.wnc,this)},gGH=function(G,X){return X?g.Ka(G.Y,function(Q){return h9(X,Q.label)},G):null},rj=function(G){QN("Controller",G)},d4G=function(G){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(G)},aH=function(G){return G.J||!!G.Y.length||!!G.N},EV=function(G,X,Q){X!=G.N&&(g.Xh(G.N),(G.N=X)?(Q?G.publish("yt-remote-cast2-receiver-resumed", X.W):G.publish("yt-remote-cast2-receiver-selected",X.W),X.subscribe("sessionScreen",(0,g.La)(G.Br,G,X)),X.subscribe("sessionFailed",function(){return Utk(G,X)}),X.N?G.publish("yt-remote-cast2-session-change",X.N):Q&&G.N.q_(null)):G.publish("yt-remote-cast2-session-change",null))},Utk=function(G,X){G.N==X&&G.publish("yt-remote-cast2-session-failed")},lDL=function(G){var X=G.W.ow(),Q=G.N&&G.N.W; G=g.P1(X,function(R){Q&&h9(R,Q.label)&&(Q=null);var S=R.uuid?R.uuid:R.id,Z=gGH(this,R);Z?(Z.label=S,Z.friendlyName=R.name):(Z=new chrome.cast.Receiver(S,R.name),Z.receiverType=chrome.cast.ReceiverType.CUSTOM);return Z},G); Q&&(Q.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(Q=new chrome.cast.Receiver(Q.label,Q.friendlyName),Q.receiverType=chrome.cast.ReceiverType.CUSTOM),G.push(Q));return G},W5V=function(G,X,Q,R){R.disableCastApi?xt("Cannot initialize because disabled by Mdx config."):BE3()?F5O(X,R)&&(C6Z(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?thk(G,Q):(window.__onGCastApiAvailable=function(S,Z){S?thk(G,Q):(OV("Failed to load cast API: "+Z),VhZ(!1),C6Z(!1),g.O5("yt-remote-cast-available"),g.O5("yt-remote-cast-receiver"), IDG(),Q(!1))},R.loadCastApiSetupScript?g.Js(dtV):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?ELG()>=60&&FX4():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?c7H():ELG()>=89?t8G():(Boa(),Pu(CaZ.map(gLn))))):xt("Cannot initialize because not running Chrome")},IDG=function(){xt("dispose"); var G=zm();G&&G.dispose();g.G3("yt.mdx.remote.cloudview.instance_",null);pRa(!1);g.bC(ygv);ygv.length=0},cU=function(){return!!g.xL("yt-remote-cast-installed")},fDv=function(){var G=g.xL("yt-remote-cast-receiver"); return G?G.friendlyName:null},Dtd=function(){xt("clearCurrentReceiver"); g.O5("yt-remote-cast-receiver")},NEH=function(){return cU()?zm()?zm().getCastSession():(OV("getCastSelector: Cast is not initialized."),null):(OV("getCastSelector: Cast API is not installed!"),null)},Agd=function(){cU()?zm()?gj()?(xt("Requesting cast selector."),zm().requestSession()):(xt("Wait for cast API to be ready to request the session."),ygv.push(g.$Q("yt-remote-cast2-api-ready",Agd))):OV("requestCastSelector: Cast is not initialized."):OV("requestCastSelector: Cast API is not installed!")}, UV=function(G,X){gj()?zm().setConnectedScreenStatus(G,X):OV("setConnectedScreenStatus called before ready.")},BE3=function(){var G=g.IB().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.un||G},nGo=function(G,X){zm().init(G,X)},F5O=function(G,X){var Q=!1; zm()||(G=new em(G,X),G.subscribe("yt-remote-cast2-availability-change",function(R){g.E5("yt-remote-cast-available",R);oO("yt-remote-cast2-availability-change",R)}),G.subscribe("yt-remote-cast2-receiver-selected",function(R){xt("onReceiverSelected: "+R.friendlyName); g.E5("yt-remote-cast-receiver",R);oO("yt-remote-cast2-receiver-selected",R)}),G.subscribe("yt-remote-cast2-receiver-resumed",function(R){xt("onReceiverResumed: "+R.friendlyName); g.E5("yt-remote-cast-receiver",R);oO("yt-remote-cast2-receiver-resumed",R)}),G.subscribe("yt-remote-cast2-session-change",function(R){xt("onSessionChange: "+Lx(R)); R||g.O5("yt-remote-cast-receiver");oO("yt-remote-cast2-session-change",R)}),g.G3("yt.mdx.remote.cloudview.instance_",G),Q=!0); xt("cloudview.createSingleton_: "+Q);return Q},zm=function(){return g.QH("yt.mdx.remote.cloudview.instance_")},thk=function(G,X){VhZ(!0); C6Z(!1);nGo(G,function(Q){Q?(pRa(!0),g.ve("yt-remote-cast2-api-ready")):(OV("Failed to initialize cast API."),VhZ(!1),g.O5("yt-remote-cast-available"),g.O5("yt-remote-cast-receiver"),IDG());X(Q)})},xt=function(G){QN("cloudview",G)},OV=function(G){QN("cloudview",G)},VhZ=function(G){xt("setCastInstalled_ "+G); g.E5("yt-remote-cast-installed",G)},gj=function(){return!!g.QH("yt.mdx.remote.cloudview.apiReady_")},pRa=function(G){xt("setApiReady_ "+G); g.G3("yt.mdx.remote.cloudview.apiReady_",G)},C6Z=function(G){g.G3("yt.mdx.remote.cloudview.initializing_",G)},l4=function(G){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.S=0;this.trackData=null;this.MW=this.EW=!1;this.T=this.Y=this.J=this.W=0;this.N=NaN;this.V=!1;this.reset(G)},$tk=function(G){G.audioTrackId=null; G.trackData=null;G.playerState=-1;G.EW=!1;G.MW=!1;G.S=0;G.C=g.jZ();G.W=0;G.J=0;G.Y=0;G.T=0;G.N=NaN;G.V=!1},BU=function(G){return G.isPlaying()?(g.jZ()-G.C)/1E3:0},Fg=function(G,X){G.S=X; G.C=g.jZ()},Ck=function(G){switch(G.playerState){case 1:case 1081:return(g.jZ()-G.C)/1E3+G.S; case -1E3:return 0}return G.S},b7S=function(G){return G.V?G.J+BU(G):G.J},tU=function(G,X,Q){var R=G.videoId; G.videoId=X;G.index=Q;X!=R&&$tk(G)},vGZ=function(G){var X={}; X.index=G.index;X.listId=G.listId;X.videoId=G.videoId;X.playerState=G.playerState;X.volume=G.volume;X.muted=G.muted;X.audioTrackId=G.audioTrackId;X.trackData=g.P$(G.trackData);X.hasPrevious=G.EW;X.hasNext=G.MW;X.playerTime=G.S;X.playerTimeAt=G.C;X.seekableStart=G.W;X.seekableEnd=G.J;X.duration=G.Y;X.loadedTime=G.T;X.liveIngestionTime=G.N;return X},IH=function(G,X){g.ic.call(this); var Q=this;this.Y=0;this.V=G;this.S=[];this.C=new oQ4;this.W=this.N=null;this.j=(0,g.La)(this.rTH,this);this.J=(0,g.La)(this.JJ,this);this.T=(0,g.La)(this.gcO,this);this.AT=(0,g.La)(this.tjA,this);var R=0;G?(R=G.getProxyState(),R!=3&&(G.subscribe("proxyStateChange",this.yx,this),Jgv(this))):R=3;R!=0&&(X?this.yx(R):g.wp(function(){Q.yx(R)},0)); (G=NEH())&&VN(this,G);this.subscribe("yt-remote-cast2-session-change",this.AT)},dj=function(G){return new l4(G.V.getPlayerContextData())},Jgv=function(G){g.vn("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(X){this.S.push(this.V.subscribe(X,g.k4(this.eGB,X),this))},G)},i7d=function(G){g.vn(G.S,function(X){this.V.unsubscribeByKey(X)},G); G.S.length=0},WU=function(G){return G.getState()==1},pk=function(G,X){var Q=G.C; Q.N.length+Q.W.length<50&&G.C.enqueue(X)},Ge4=function(G,X,Q){var R=dj(G); Fg(R,Q);R.playerState!=-1E3&&(R.playerState=X);yN(G,R)},fk=function(G,X,Q){G.V.sendMessage(X,Q)},yN=function(G,X){i7d(G); G.V.setPlayerContextData(vGZ(X));Jgv(G)},VN=function(G,X){G.W&&(G.W.removeUpdateListener(G.j),G.W.removeMediaListener(G.J),G.JJ(null)); G.W=X;G.W&&(RH("Setting cast session: "+G.W.sessionId),G.W.addUpdateListener(G.j),G.W.addMediaListener(G.J),G.W.media.length&&G.JJ(G.W.media[0]))},X84=function(G){var X=G.N.media,Q=G.N.customData; if(X&&Q){var R=dj(G);X.contentId!=R.videoId&&RH("Cast changing video to: "+X.contentId);R.videoId=X.contentId;R.playerState=Q.playerState;Fg(R,G.N.getEstimatedTime());yN(G,R)}else RH("No cast media video. Ignoring state update.")},Dj=function(G,X,Q){return(0,g.La)(function(R){this.xF("Failed to "+X+" with cast v2 channel. Error code: "+R.code); R.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.xF("Retrying "+X+" using MDx browser channel."),fk(this,X,Q))},G)},nk=function(G,X,Q,R){R=R===void 0?!1:R; g.ic.call(this);var S=this;this.S=NaN;this.DC=!1;this.j=this.T=this.yH=this.Yc=NaN;this.AT=[];this.C=this.J=this.V=this.N=this.W=null;this.IU=G;this.QH=R;this.AT.push(g.mX(window,"beforeunload",function(){S.o8(2)})); this.Y=[];this.N=new l4;this.SA=X.id;this.Mi=X.idType;this.W=I3H(this.IU,Q,this.lK,this.Mi=="shortLived",this.SA);this.W.listen("channelOpened",function(){QUn(S)}); this.W.listen("channelClosed",function(){Nw("Channel closed");isNaN(S.S)?MC(!0):MC();S.dispose()}); this.W.listen("channelError",function(Z){MC();isNaN(S.SL())?(Z==1&&S.Mi=="shortLived"&&S.publish("browserChannelAuthError",Z),Nw("Channel error: "+Z+" without reconnection"),S.dispose()):(S.DC=!0,Nw("Channel error: "+Z+" with reconnection in "+S.SL()+" ms"),AU(S,2))}); this.W.listen("channelMessage",function(Z){RcO(S,Z)}); this.W.I5(X.token);this.subscribe("remoteQueueChange",function(){var Z=S.N.videoId;g.zJ()&&g.E5("yt-remote-session-video-id",Z)})},SLH=function(G){return g.Ka(G.Y,function(X){return X.type=="LOUNGE_SCREEN"})},Nw=function(G){QN("conn",G)},AU=function(G,X){G.publish("proxyStateChange",X)},Zpa=function(G){G.S=g.wp(function(){Nw("Connecting timeout"); G.o8(1)},2E4)},HpO=function(G){g.Li(G.S); G.S=NaN},qLv=function(G){g.Li(G.Yc); G.Yc=NaN},hc3=function(G){w8d(G); G.yH=g.wp(function(){$t(G,"getNowPlaying")},2E4)},w8d=function(G){g.Li(G.yH); G.yH=NaN},QUn=function(G){Nw("Channel opened"); G.DC&&(G.DC=!1,qLv(G),G.Yc=g.wp(function(){Nw("Timing out waiting for a screen.");G.o8(1)},15E3))},keL=function(G,X){var Q=null; if(X){var R=SLH(G);R&&(Q={clientName:R.clientName,deviceMake:R.brand,deviceModel:R.model,osVersion:R.osVersion})}g.G3("yt.mdx.remote.remoteClient_",Q);X&&(HpO(G),qLv(G));Q=G.W.X5()&&isNaN(G.S);X==Q?X&&(AU(G,1),$t(G,"getSubtitlesTrack")):X?(G.gW()&&G.N.reset(),AU(G,1),$t(G,"getNowPlaying"),LeZ(G)):G.o8(1)},YLH=function(G,X){var Q=X.params.videoId; delete X.params.videoId;Q==G.N.videoId&&(g.Mn(X.params)?G.N.trackData=null:G.N.trackData=X.params,G.publish("remotePlayerChange"))},jUZ=function(G,X,Q){var R=X.params.videoId||X.params.video_id,S=parseInt(X.params.currentIndex,10); G.N.listId=X.params.listId||G.N.listId;tU(G.N,R,S);G.publish("remoteQueueChange",Q)},mDG=function(G,X){X.params=X.params||{}; jUZ(G,X,"NOW_PLAYING_MAY_CHANGE");Mkk(G,X);G.publish("autoplayDismissed")},Mkk=function(G,X){var Q=parseInt(X.params.currentTime||X.params.current_time,10); Fg(G.N,isNaN(Q)?0:Q);Q=parseInt(X.params.state,10);Q=isNaN(Q)?-1:Q;Q==-1&&G.N.playerState==-1E3&&(Q=-1E3);G.N.playerState=Q;Q=Number(X.params.loadedTime);G.N.T=isNaN(Q)?0:Q;G.N.GJ(Number(X.params.duration));Q=G.N;var R=Number(X.params.liveIngestionTime);Q.N=R;Q.V=isNaN(R)?!1:!0;Q=G.N;R=Number(X.params.seekableStartTime);X=Number(X.params.seekableEndTime);Q.W=isNaN(R)?0:R;Q.J=isNaN(X)?0:X;G.N.playerState==1?hc3(G):w8d(G);G.publish("remotePlayerChange")},oBH=function(G,X){if(G.N.playerState!=-1E3){var Q= 1085; switch(parseInt(X.params.adState,10)){case 1:Q=1081;break;case 2:Q=1084;break;case 0:Q=1083}G.N.playerState=Q;X=parseInt(X.params.currentTime,10);Fg(G.N,isNaN(X)?0:X);G.publish("remotePlayerChange")}},uYL=function(G,X){var Q=X.params.muted=="true"; G.N.volume=parseInt(X.params.volume,10);G.N.muted=Q;G.publish("remotePlayerChange")},PcH=function(G,X){G.J=X.params.videoId; G.publish("nowAutoplaying",parseInt(X.params.timeout,10))},sUo=function(G,X){G.J=X.params.videoId||null; G.publish("autoplayUpNext",G.J)},TVG=function(G,X){G.C=X.params.autoplayMode; G.publish("autoplayModeChange",G.C);G.C=="DISABLED"&&G.publish("autoplayDismissed")},Ked=function(G,X){var Q=X.params.hasNext=="true"; G.N.EW=X.params.hasPrevious=="true";G.N.MW=Q;G.publish("previousNextChange")},RcO=function(G,X){X=X.message; X.params?Nw("Received: action="+X.action+", params="+g.VW(X.params)):Nw("Received: action="+X.action+" {}");switch(X.action){case "loungeStatus":X=Qv(X.params.devices);G.Y=g.P1(X,function(R){return new qC(R)}); X=!!g.Ka(G.Y,function(R){return R.type=="LOUNGE_SCREEN"}); keL(G,X);X=G.fU("mlm");G.publish("multiStateLoopEnabled",X);break;case "loungeScreenDisconnected":g.gH(G.Y,function(R){return R.type=="LOUNGE_SCREEN"}); keL(G,!1);break;case "remoteConnected":var Q=new qC(Qv(X.params.device));g.Ka(G.Y,function(R){return R.equals(Q)})||eTG(G.Y,Q); break;case "remoteDisconnected":Q=new qC(Qv(X.params.device));g.gH(G.Y,function(R){return R.equals(Q)}); break;case "gracefulDisconnect":break;case "playlistModified":jUZ(G,X,"QUEUE_MODIFIED");break;case "nowPlaying":mDG(G,X);break;case "onStateChange":Mkk(G,X);break;case "onAdStateChange":oBH(G,X);break;case "onVolumeChanged":uYL(G,X);break;case "onSubtitlesTrackChanged":YLH(G,X);break;case "nowAutoplaying":PcH(G,X);break;case "autoplayDismissed":G.publish("autoplayDismissed");break;case "autoplayUpNext":sUo(G,X);break;case "onAutoplayModeChanged":TVG(G,X);break;case "onHasPreviousNextChanged":Ked(G, X);break;case "requestAssistedSignIn":G.publish("assistedSignInRequested",X.params.authCode);break;case "onLoopModeChanged":G.publish("loopModeChange",X.params.loopMode);break;default:Nw("Unrecognized action: "+X.action)}},LeZ=function(G){g.Li(G.j); G.j=g.wp(function(){G.o8(1)},864E5)},$t=function(G,X,Q){Q?Nw("Sending: action="+X+", params="+g.VW(Q)):Nw("Sending: action="+X); G.W.sendMessage(X,Q)},ecH=function(G){qw.call(this,"ScreenServiceProxy"); this.zj=G;this.N=[];this.N.push(this.zj.$_s("screenChange",(0,g.La)(this.Go,this)));this.N.push(this.zj.$_s("onlineScreenChange",(0,g.La)(this.LyT,this)))},OpS=function(G,X){eNa(); if(!mh||!mh.get("yt-remote-disable-remote-module-for-dev")){X=g.WO("MDX_CONFIG")||X;jcO();u1H();b4||(b4=new J9(X?X.loungeApiHost:void 0),r7G()&&(b4.N="/api/loungedev"));vU||(vU=g.QH("yt.mdx.remote.deferredProxies_")||[],g.G3("yt.mdx.remote.deferredProxies_",vU));rfL();var Q=JU();if(!Q){var R=new Yt(b4,X?X.disableAutomaticScreenCache||!1:!1);g.G3("yt.mdx.remote.screenService_",R);Q=JU();var S={};X&&(S={appId:X.appId,disableDial:X.disableDial,theme:X.theme,loadCastApiSetupScript:X.loadCastApiSetupScript, disableCastApi:X.disableCastApi,enableDialLoungeToken:X.enableDialLoungeToken,enableCastLoungeToken:X.enableCastLoungeToken,forceMirroring:X.forceMirroring});g.G3("yt.mdx.remote.enableConnectWithInitialState_",X?X.enableConnectWithInitialState||!1:!1);W5V(G,R,function(Z){Z?i4()&&UV(i4(),"YouTube TV"):R.subscribe("onlineScreenChange",function(){oO("yt-remote-receiver-availability-change")})},S)}X&&!g.QH("yt.mdx.remote.initialized_")&&(g.G3("yt.mdx.remote.initialized_",!0),Gr("Initializing: "+g.VW(X)), X_.push(g.$Q("yt-remote-cast2-api-ready",function(){oO("yt-remote-api-ready")})),X_.push(g.$Q("yt-remote-cast2-availability-change",function(){oO("yt-remote-receiver-availability-change")})),X_.push(g.$Q("yt-remote-cast2-receiver-selected",function(){Q4(null); oO("yt-remote-auto-connect","cast-selector-receiver")})),X_.push(g.$Q("yt-remote-cast2-receiver-resumed",function(){oO("yt-remote-receiver-resumed","cast-selector-receiver")})),X_.push(g.$Q("yt-remote-cast2-session-change",acd)),X_.push(g.$Q("yt-remote-connection-change",function(Z){Z?UV(i4(),"YouTube TV"):R9()||(UV(null,null),Dtd())})),X_.push(g.$Q("yt-remote-cast2-session-failed",function(){oO("yt-remote-connection-failed")})),G=EBd(),X.isAuto&&(G.id+="#dial"),S=X.capabilities||[],S.length>0&&(G.capabilities= S),G.name=X.device,G.app=X.app,(X=X.theme)&&(G.theme=X),Gr(" -- with channel params: "+g.VW(G)),G?(g.E5("yt-remote-session-app",G.app),g.E5("yt-remote-session-name",G.name)):(g.O5("yt-remote-session-app"),g.O5("yt-remote-session-name")),g.G3("yt.mdx.remote.channelParams_",G),Q.start(),i4()||xDn())}},zck=function(){var G=JU().zj.$_gos(); var X=Sw();X&&Z7()&&(Y5n(G,X)||G.push(X));return kJS(G)},gBH=function(){var G=cfd(); !G&&cU()&&fDv()&&(G={key:"cast-selector-receiver",name:fDv()});return G},cfd=function(){var G=zck(),X=Sw(); X||(X=R9());return g.Ka(G,function(Q){return X&&h9(X,Q.key)?!0:!1})},Sw=function(){var G=i4(); if(!G)return null;var X=JU().Y2();return kO(X,G)},acd=function(G){Gr("remote.onCastSessionChange_: "+Lx(G)); if(G){var X=Sw();if(X&&X.id==G.id){if(UV(X.id,"YouTube TV"),G.idType=="shortLived"&&(G=G.token))HC&&(HC.token=G),(X=Z7())&&X.I5(G)}else X&&qX(),wT(G,1)}else Z7()&&qX()},qX=function(){gj()?zm().stopSession():OV("stopSession called before API ready."); var G=Z7();G&&(G.disconnect(1),UD4(null))},lcH=function(){var G=Z7(); return!!G&&G.getProxyState()!=3},Gr=function(G){QN("remote",G)},JU=function(){if(!BVZ){var G=g.QH("yt.mdx.remote.screenService_"); BVZ=G?new ecH(G):null}return BVZ},i4=function(){return g.QH("yt.mdx.remote.currentScreenId_")},FeL=function(G){g.G3("yt.mdx.remote.currentScreenId_",G)},CcG=function(){return g.QH("yt.mdx.remote.connectData_")},Q4=function(G){g.G3("yt.mdx.remote.connectData_",G)},Z7=function(){return g.QH("yt.mdx.remote.connection_")},UD4=function(G){var X=Z7(); Q4(null);G||FeL("");g.G3("yt.mdx.remote.connection_",G);vU&&(g.vn(vU,function(Q){Q(G)}),vU.length=0); X&&!G?oO("yt-remote-connection-change",!1):!X&&G&&oO("yt-remote-connection-change",!0)},R9=function(){var G=g.zJ(); if(!G)return null;var X=JU();if(!X)return null;X=X.Y2();return kO(X,G)},wT=function(G,X){i4(); Sw()&&Sw();if(hI)HC=G;else{FeL(G.id);var Q=g.QH("yt.mdx.remote.enableConnectWithInitialState_")||!1;G=new nk(b4,G,EBd(),Q);G.connect(X,CcG());G.subscribe("beforeDisconnect",function(R){oO("yt-remote-before-disconnect",R)}); G.subscribe("beforeDispose",function(){Z7()&&(Z7(),UD4(null))}); G.subscribe("browserChannelAuthError",function(){var R=Sw();R&&R.idType=="shortLived"&&(gj()?zm().handleBrowserChannelAuthError():OV("refreshLoungeToken called before API ready."))}); UD4(G)}},xDn=function(){var G=R9(); G?(Gr("Resume connection to: "+Lx(G)),wT(G,0)):(MC(),Dtd(),Gr("Skipping connecting because no session screen found."))},rfL=function(){var G=EBd(); if(g.Mn(G)){G=jB();var X=g.xL("yt-remote-session-name")||"",Q=g.xL("yt-remote-session-app")||"";G={device:"REMOTE_CONTROL",id:G,name:X,app:Q,mdxVersion:3};G.authuser=String(g.WO("SESSION_INDEX","0"));(X=g.WO("DELEGATED_SESSION_ID"))&&(G.pageId=String(X));g.G3("yt.mdx.remote.channelParams_",G)}},EBd=function(){return g.QH("yt.mdx.remote.channelParams_")||{}},IcO=function(G,X,Q){g.I.call(this); var R=this;this.N=G;this.U=X;this.ZW=Q;this.events=new g.KP(this);this.C=!1;this.S=new g.gO(64);this.W=new g.fU(this.RF,500,this);this.Y=new g.fU(this.aF,1E3,this);this.T=new sb(this.zzT,0,this);this.V={};this.j=new g.fU(this.IK,1E3,this);this.J=new g.nU(this.seekTo,1E3,this);this.AT=this.events.B(this.U,"onVolumeChange",function(S){tkV(R,S)}); g.d(this,this.events);this.events.B(X,"onCaptionsTrackListChanged",this.qMd);this.events.B(X,"captionschanged",this.bOU);this.events.B(X,"captionssettingschanged",this.Pa);this.events.B(X,"videoplayerreset",this.Vn);this.events.B(X,"mdxautoplaycancel",function(){R.ZW.NF()}); X.G("enable_mdx_video_play_directly")&&this.events.B(X,"videodatachange",function(){Vkv(R.N)||LX(R)||kI(R,0)}); G=this.ZW;G.U_();G.subscribe("proxyStateChange",this.Oq,this);G.subscribe("remotePlayerChange",this.XD,this);G.subscribe("remoteQueueChange",this.Vn,this);G.subscribe("previousNextChange",this.kT,this);G.subscribe("nowAutoplaying",this.vr,this);G.subscribe("autoplayDismissed",this.z$,this);g.d(this,this.W);g.d(this,this.Y);g.d(this,this.T);g.d(this,this.j);g.d(this,this.J);this.Pa();this.Vn();this.XD()},tkV=function(G,X){if(LX(G)){G.ZW.unsubscribe("remotePlayerChange",G.XD,G); var Q=Math.round(X.volume);X=!!X.muted;var R=dj(G.ZW);if(Q!==R.volume||X!==R.muted)G.ZW.setVolume(Q,X),G.j.start();G.ZW.subscribe("remotePlayerChange",G.XD,G)}},dD3=function(G){G.o6(0); G.W.stop();G.dM(new g.gO(64))},WeV=function(G,X){if(LX(G)&&!G.C){var Q=null; X&&(Q={style:G.U.getSubtitlesUserSettings()},Object.assign(Q,X));G.ZW.vN(G.U.getVideoData(1).videoId,Q);G.V=dj(G.ZW).trackData}},kI=function(G,X){var Q=G.U.getPlaylist(); if(Q==null?0:Q.listId){var R=Q.index;var S=Q.listId.toString()}Q=G.U.getVideoData(1);G.ZW.playVideo(Q.videoId,X,R,S,Q.playerParams,Q.IU,KWZ(Q));G.dM(new g.gO(1))},p8v=function(G,X){if(X){var Q=G.U.getOption("captions","tracklist",{XQ:1}); Q&&Q.length?(G.U.setOption("captions","track",X),G.C=!1):(G.U.loadModule("captions"),G.C=!0)}else G.U.setOption("captions","track",{})},LX=function(G){return dj(G.ZW).videoId===G.U.getVideoData(1).videoId},yfa=function(G,X){g.Ww.call(this,G); this.N=X},YI=function(){g.f.call(this,{D:"div", X:"ytp-mdx-popup-dialog",L:{role:"dialog"},K:[{D:"div",X:"ytp-mdx-popup-dialog-inner-content",K:[{D:"div",X:"ytp-mdx-popup-title",WM:"You're signed out"},{D:"div",X:"ytp-mdx-popup-description",WM:"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."},{D:"div",X:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",aU:["ytp-button","ytp-mdx-privacy-popup-cancel"],WM:"Cancel"},{D:"button",aU:["ytp-button", "ytp-mdx-privacy-popup-confirm"],WM:"Confirm"}]}]}]});this.fade=new g.v5(this,250);this.cancelButton=this.VH("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.VH("ytp-mdx-privacy-popup-confirm");g.d(this,this.fade);this.B(this.cancelButton,"click",this.N);this.B(this.confirmButton,"click",this.W)},jw=function(G){g.f.call(this,{D:"div", X:"ytp-remote",K:[{D:"div",X:"ytp-remote-display-status",K:[{D:"div",X:"ytp-remote-display-status-icon",K:[g.LXX()]},{D:"div",X:"ytp-remote-display-status-text",WM:"{{statustext}}"}]}]});this.api=G;this.fade=new g.v5(this,250);g.d(this,this.fade);this.B(G,"presentingplayerstatechange",this.onStateChange);this.qx(G.getPlayerStateObject())},MX=function(G,X){g.U8.call(this,"Play on",1,G,X); this.U=G;this.ac={};this.B(G,"onMdxReceiversChange",this.W);this.B(G,"presentingplayerstatechange",this.W);this.W()},fca=function(G){g.P6.call(this,G); this.Az={key:LXH(),name:"This computer"};this.bH=null;this.subscriptions=[];this.zX=this.ZW=null;this.ac=[this.Az];this.zS=this.Az;this.FG=new g.gO(64);this.Wk=0;this.zR=-1;this.z2=!1;this.Y_=this.WA=this.sZ=null;if(!g.ZK(this.player.Z())&&!g.lP(this.player.Z())){G=this.player;var X=g.Ua(G);X&&(X=X.Eb())&&(X=new MX(G,X),g.d(this,X));X=new jw(G);g.d(this,X);g.$6(G,X.element,4);this.sZ=new YI;g.d(this,this.sZ);g.$6(G,this.sZ.element,4);this.z2=!!R9()}},mx=function(G){G.WA&&(G.player.removeEventListener("presentingplayerstatechange", G.WA),G.WA=null)},DDn=function(G,X,Q){G.FG=Q; G.player.publish("presentingplayerstatechange",new g.wA(Q,X))},o9=function(G,X){if(X.key!==G.zS.key)if(X.key===G.Az.key)qX(); else if(Vkv(G)&&NVV(G),G.zS=X,!G.player.Z().G("disable_mdx_connection_in_mdx_module_for_music_web")||!g.lP(G.player.Z())){var Q=G.player.getPlaylistId();var R=G.player.getVideoData(1);var S=R.videoId;if(!Q&&!S||(G.player.getAppState()===2||G.player.getAppState()===1)&&G.player.Z().G("should_clear_video_data_on_player_cued_unstarted"))R=null;else{var Z=G.player.getPlaylist();if(Z){var H=[];for(var w=0;w2*this.size&&Hu(this),!0):!1}; g.P.get=function(G,X){return SB(this.W,G)?this.W[G]:X}; g.P.set=function(G,X){SB(this.W,G)||(this.size+=1,this.N.push(G),this.bq++);this.W[G]=X}; g.P.forEach=function(G,X){for(var Q=this.iD(),R=0;R=R.N.length)return g.ZF;var Z=R.N[X++];return g.PY(G?Z:R.W[Z])}; return S}; var dNG={ivC:"atp",xXU:"ska",GJi:"que",E2A:"mus",Yum:"sus",RrT:"dsp",KZ_:"seq",kxm:"mic",Pcb:"dpa",wOM:"mlm",Ccm:"dsdtr",bgi:"ntb",gfM:"vsp",T$T:"scn",iQc:"rpe",QuH:"dcn",SGC:"dcp",xop:"pas",l5A:"drq",tsd:"opf",B$B:"els",EUp:"isg",rwU:"svq",XOT:"mvp",i4A:"ads",IO_:"stcp",ueU:"sads",vUC:"dloc",kZH:"dcw",coM:"asw",JoC:"apw",lzT:"pcw",NVC:"ipv"},WWH={bjb:"u",rRT:"cl",YfT:"k",JXp:"i",suU:"cr",BVA:"m",NJT:"g",fZ:"up"},a3v={FO:"adPlaying",wE:"onAdStateChange"},EQk={g2H:"nowPlaying",AwA:"onStateChange", FO:"adPlaying",wE:"onAdStateChange",F2:"nowPlayingShorts",X2:"onShortsStateChange"},x4H={F2:"nowPlayingShorts",X2:"onShortsStateChange"};qC.prototype.equals=function(G){return G?this.id==G.id:!1}; var oLd="",mh=null;g.T(a$S,g.Fw);var ut,l$Z=xMZ("loadCastFramework")||xMZ("loadCastApplicationFramework"),CaZ=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.mo(sb,g.I);g.P=sb.prototype;g.P.WY=function(G){this.V=arguments;this.N=!1;this.G1?this.Y=g.jZ()+this.BK:this.G1=g.Bp(this.C,this.BK)}; g.P.stop=function(){this.G1&&(g.i7.clearTimeout(this.G1),this.G1=null);this.Y=null;this.N=!1;this.V=[]}; g.P.pause=function(){++this.W}; g.P.resume=function(){this.W&&(--this.W,!this.W&&this.N&&(this.N=!1,this.S.apply(null,this.V)))}; g.P.zT=function(){this.stop();sb.gS.zT.call(this)}; g.P.zo=function(){this.G1&&(g.i7.clearTimeout(this.G1),this.G1=null);this.Y?(this.G1=g.Bp(this.C,this.Y-g.jZ()),this.Y=null):this.W?this.N=!0:(this.N=!1,this.S.apply(null,this.V))};TL.prototype.stringify=function(G){return g.i7.JSON.stringify(G,void 0)}; TL.prototype.parse=function(G){return g.i7.JSON.parse(G,void 0)};g.mo(V8o,g.y3);g.mo(I$v,g.y3);var dMa=null;g.mo(pAa,g.y3);g.mo(y7O,g.y3);g.mo(f$H,g.y3);aO.prototype.debug=function(){}; aO.prototype.info=function(){}; aO.prototype.warning=function(){};var J7S={},vLo={};g.P=Eb.prototype;g.P.setTimeout=function(G){this.BM=G}; g.P.Yz=function(G){G=G.target;var X=this.wb;X&&g.f4(G)==3?X.h$():this.fN(G)}; g.P.fN=function(G){try{if(G==this.N)a:{var X=g.f4(this.N),Q=this.N.W,R=this.N.getStatus();if(!(X<3)&&(X!=3||this.N&&(this.W.Y||g.NJ(this.N)||g.AJ(this.N)))){this.QH||X!=4||Q==7||(Q==8||R<=0?Kx(3):Kx(2));XIn(this);var S=this.N.getStatus();this.As=S;var Z=bZv(this);if(this.S=S==200){if(this.N9&&!this.CO){b:{if(this.N){var H=g.n4(this.N,"X-HTTP-Initial-Response");if(H&&!g.lY(H)){var w=H;break b}}w=null}if(G=w)this.CO=!0,L$4(this,G);else{this.S=!1;this.C=3;eB(12);Ob(this);zL(this);break a}}if(this.Mi){G= !0;for(var h;!this.QH&&this.J0&&!this.Hs&&(this.Hs=!0,this.Y.a7(this)):(Ob(this),zL(this))}else L$4(this,Z);X==4&&Ob(this);this.S&&!this.QH&&(X==4?Qqk(this.Y,this):(this.S=!1,xO(this)))}else g.P_G(this.N),S==400&&Z.indexOf("Unknown SID")> 0?(this.C=3,eB(12)):(this.C=0,eB(13)),Ob(this),zL(this)}}}catch(L){}finally{}}; g.P.cancel=function(){this.QH=!0;Ob(this)}; g.P.HY=function(){this.AT=null;var G=Date.now();G-this.KO>=0?(this.SA!=2&&(Kx(3),eB(17)),Ob(this),this.C=2,zL(this)):GB3(this,this.KO-G)}; g.P.getLastError=function(){return this.C}; g.P.nT=function(){return this.N};YeO.prototype.cancel=function(){this.Y=MUS(this);if(this.W)this.W.cancel(),this.W=null;else if(this.N&&this.N.size!==0){for(var G=g.e(this.N.values()),X=G.next();!X.done;X=G.next())X.value.cancel();this.N.clear()}};g.P=PqG.prototype;g.P.g5=8;g.P.BF=1;g.P.connect=function(G,X,Q,R){eB(0);this.Js=G;this.QH=X||{};Q&&R!==void 0&&(this.QH.OSID=Q,this.QH.OAID=R);this.CO=this.F7;this.IU=qeS(this,null,this.Js);lt(this)}; g.P.disconnect=function(){TbS(this);if(this.BF==3){var G=this.Xm++,X=this.IU.clone();g.qO(X,"SID",this.V);g.qO(X,"RID",G);g.qO(X,"TYPE","terminate");Cx(this,X);G=new Eb(this,this.V,G);G.SA=2;G.T=iy(X.clone());X=!1;if(g.i7.navigator&&g.i7.navigator.sendBeacon)try{X=g.i7.navigator.sendBeacon(G.T.toString(),"")}catch(Q){}!X&&g.i7.Image&&((new Image).src=G.T,X=!0);X||(G.N=nLO(G.Y,null),G.N.send(G.T));G.Yc=Date.now();xO(G)}xTH(this)}; g.P.Bz=function(){return this.BF==0}; g.P.getState=function(){return this.BF}; g.P.du=function(G){if(this.S)if(this.S=null,this.BF==1){if(!G){this.Xm=Math.floor(Math.random()*1E5);G=this.Xm++;var X=new Eb(this,"",G),Q=this.j;this.N9&&(Q?(Q=g.uY(Q),g.sl(Q,this.N9)):Q=this.N9);this.J!==null||this.KO||(X.IU=Q,Q=null);var R;if(this.bB)a:{for(var S=R=0;S4096){R=S;break a}if(R===4096||S===this.Y.length-1){R=S+1;break a}}R= 1E3}else R=1E3;R=r$L(this,X,R);S=this.IU.clone();g.qO(S,"RID",G);g.qO(S,"CVER",22);this.Mi&&g.qO(S,"X-HTTP-Session-Id",this.Mi);Cx(this,S);Q&&(this.KO?R="headers="+g.z9(g.Iii(Q))+"&"+R:this.J&&g.kx(S,this.J,Q));Hld(this.W,X);this.PR&&g.qO(S,"TYPE","init");this.bB?(g.qO(S,"$req",R),g.qO(S,"SID","null"),X.N9=!0,A7L(X,S,null)):A7L(X,S,R);this.BF=2}}else this.BF==3&&(G?a6v(this,G):this.Y.length==0||jqn(this.W)||a6v(this))}; g.P.r5=function(){this.T=null;E_Z(this);if(this.f7&&!(this.BM||this.N==null||this.R6<=0)){var G=4*this.R6;this.DC=rm((0,g.La)(this.jUA,this),G)}}; g.P.jUA=function(){this.DC&&(this.DC=null,this.CO=!1,this.BM=!0,eB(10),gm(this),E_Z(this))}; g.P.a7=function(G){this.N==G&&this.f7&&!this.BM&&(sqZ(this),this.BM=!0,eB(11))}; g.P.Vv=function(){this.AT!=null&&(this.AT=null,gm(this),SeV(this),eB(19))}; g.P.FDT=function(G){G?eB(2):eB(1)}; g.P.isActive=function(){return!!this.C&&this.C.isActive(this)}; g.P=z_a.prototype;g.P.yf=function(){}; g.P.N2=function(){}; g.P.Au=function(){}; g.P.uK=function(){}; g.P.isActive=function(){return!0}; g.P.xz=function(){};g.mo(Vv,g.hJ);Vv.prototype.open=function(){this.N.C=this.Y;this.S&&(this.N.SA=!0);this.N.connect(this.C,this.W||void 0)}; Vv.prototype.close=function(){this.N.disconnect()}; Vv.prototype.send=function(G){var X=this.N;if(typeof G==="string"){var Q={};Q.__data__=G;G=Q}else this.V&&(Q={},Q.__data__=g.VW(G),G=Q);X.Y.push(new kBG(X.eI++,G));X.BF==3&<(X)}; Vv.prototype.zT=function(){this.N.C=null;delete this.Y;this.N.disconnect();delete this.N;Vv.gS.zT.call(this)}; g.mo(g_G,V8o);g.mo(UTv,I$v);g.mo(t9,z_a);t9.prototype.yf=function(){this.N.dispatchEvent("m")}; t9.prototype.N2=function(G){this.N.dispatchEvent(new g_G(G))}; t9.prototype.Au=function(G){this.N.dispatchEvent(new UTv(G))}; t9.prototype.uK=function(){this.N.dispatchEvent("n")}; l6d.prototype.commit=function(G){this.N.As=G};var dm=new g.hJ;g.T(F$L,g.y3);g.P=px.prototype;g.P.Wo=null;g.P.wk=!1;g.P.X4=null;g.P.Qz=null;g.P.Gp=null;g.P.Ns=null;g.P.Cz=null;g.P.A$=null;g.P.Ho=null;g.P.HI=null;g.P.zf=0;g.P.ji=null;g.P.ym=null;g.P.zV=null;g.P.PP=-1;g.P.KX=!0;g.P.qT=!1;g.P.U3=0;g.P.uO=null;var W$H={},dTL={};g.P=px.prototype;g.P.setTimeout=function(G){this.W=G}; g.P.Mq=function(G){G=G.target;var X=this.uO;X&&g.f4(G)==3?X.h$():this.WN(G)}; g.P.WN=function(G){try{if(G==this.HI)a:{var X=g.f4(this.HI),Q=this.HI.W,R=this.HI.getStatus();if(g.kh&&!g.Wo("420+")){if(X<4)break a}else if(X<3||X==3&&!g.NJ(this.HI))break a;this.qT||X!=4||Q==7||(Q==8||R<=0?this.N.Z3(3):this.N.Z3(2));f6G(this);var S=this.HI.getStatus();this.PP=S;var Z=g.NJ(this.HI);if(this.wk=S==200){X==4&&yv(this);if(this.Mi){for(G=!0;!this.qT&&this.zf0?(this.zV=3,Wu(13)):(this.zV=0,Wu(14)),yv(this),DT4(this)}}catch(w){}finally{}}; g.P.cancel=function(){this.qT=!0;yv(this)}; g.P.h5=function(){this.X4=null;var G=Date.now();G-this.Qz>=0?(this.Ns!=2&&this.N.Z3(3),yv(this),this.zV=2,Wu(18),DT4(this)):y$H(this,this.Qz-G)}; g.P.getLastError=function(){return this.zV};g.P=$T3.prototype;g.P.vG=null;g.P.b8=null;g.P.E4=!1;g.P.Cw=null;g.P.wV=null;g.P.by=-1;g.P.HT=null;g.P.Uy=null;g.P.connect=function(G){this.Cw=G;G=Dq(this.N,null,this.Cw);Wu(3);Date.now();var X=this.N.j;X!=null?(this.HT=X[0],(this.Uy=X[1])?(this.wV=1,bln(this)):(this.wV=2,v_V(this))):(GL(G,"MODE","init"),this.b8=new px(this),this.b8.Wo=this.vG,VUo(this.b8,G,!1,null,!0),this.wV=0)}; g.P.qH=function(G){if(G)this.wV=2,v_V(this);else{Wu(4);var X=this.N;X.zq=X.y3.by;$O(X,9)}G&&this.Z3(2)}; g.P.SE=function(G){return this.N.SE(G)}; g.P.abort=function(){this.b8&&(this.b8.cancel(),this.b8=null);this.by=-1}; g.P.Bz=function(){return!1}; g.P.zv=function(G,X){this.by=G.PP;if(this.wV==0)if(X){try{var Q=this.W.parse(X)}catch(R){G=this.N;G.zq=this.by;$O(G,2);return}this.HT=Q[0];this.Uy=Q[1]}else G=this.N,G.zq=this.by,$O(G,2);else this.wV==2&&(this.E4?(Wu(7),Date.now()):X=="11111"?(Wu(6),this.E4=!0,Date.now(),this.by=200,this.b8.cancel(),Wu(12),NC(this.N,this,!0)):(Wu(8),Date.now(),this.E4=!1))}; g.P.l0=function(){this.by=this.b8.PP;if(this.b8.wk)this.wV==0?this.Uy?(this.wV=1,bln(this)):(this.wV=2,v_V(this)):this.wV==2&&(this.E4?(Wu(12),NC(this.N,this,!0)):(Wu(11),NC(this.N,this,!1)));else{this.wV==0?Wu(9):this.wV==2&&Wu(10);var G=this.N;this.b8.getLastError();G.zq=this.by;$O(G,2)}}; g.P.k7=function(){return this.N.k7()}; g.P.isActive=function(){return this.N.isActive()}; g.P.Z3=function(G){this.N.Z3(G)};g.P=J$Z.prototype;g.P.X6=null;g.P.ib=null;g.P.zi=null;g.P.bT=null;g.P.PG=null;g.P.Y8=null;g.P.HN=null;g.P.q$=null;g.P.Jd=0;g.P.DH=0;g.P.Tj=null;g.P.Xo=null;g.P.fD=null;g.P.VV=null;g.P.y3=null;g.P.tB=null;g.P.T4=-1;g.P.YK=-1;g.P.zq=-1;g.P.B5=0;g.P.EF=0;g.P.Ym=8;var Afo={OK:0,OQU:2,SfH:4,rCp:5,j4M:6,STOP:7,JI:8,FBA:9,JRC:10,evO:11,ez_:12};g.mo(GwZ,g.y3);g.mo(XeH,g.y3);g.P=J$Z.prototype; g.P.connect=function(G,X,Q,R,S){Wu(0);this.PG=X;this.ib=Q||{};R&&S!==void 0&&(this.ib.OSID=R,this.ib.OAID=S);this.T?(IO((0,g.La)(this.eQ,this,G),100),RIk(this)):this.eQ(G)}; g.P.disconnect=function(){S3V(this);if(this.N==3){var G=this.Jd++,X=this.Y8.clone();g.qO(X,"SID",this.V);g.qO(X,"RID",G);g.qO(X,"TYPE","terminate");nx(this,X);G=new px(this,this.V,G);G.Ns=2;G.Cz=iy(X.clone());(new Image).src=G.Cz.toString();G.Gp=Date.now();I6n(G)}MiS(this)}; g.P.eQ=function(G){this.y3=new $T3(this);this.y3.vG=this.X6;this.y3.W=this.C;this.y3.connect(G)}; g.P.Bz=function(){return this.N==0}; g.P.getState=function(){return this.N}; g.P.xK=function(G){this.Xo=null;hIL(this,G)}; g.P.Vf=function(){this.fD=null;this.bT=new px(this,this.V,"rpc",this.J);this.bT.Wo=this.X6;this.bT.U3=0;var G=this.HN.clone();g.qO(G,"RID","rpc");g.qO(G,"SID",this.V);g.qO(G,"CI",this.tB?"0":"1");g.qO(G,"AID",this.T4);nx(this,G);g.qO(G,"TYPE","xmlhttp");VUo(this.bT,G,!0,this.q$,!1)}; g.P.zv=function(G,X){if(this.N!=0&&(this.bT==G||this.zi==G))if(this.zq=G.PP,this.zi==G&&this.N==3)if(this.Ym>7){try{var Q=this.C.parse(X)}catch(R){Q=null}if(Array.isArray(Q)&&Q.length==3)if(G=Q,G[0]==0)a:{if(!this.fD){if(this.bT)if(this.bT.Gp+3E30)){if(R=X==1)this.zi||this.Xo||this.N==1||this.B5>=2?R=!1:(this.Xo=IO((0,g.La)(this.xK,this,G),kwv(this,this.B5)),this.B5++, R=!0);R=!(R||X==2&&Y3d(this))}if(R)switch(Q){case 1:$O(this,5);break;case 4:$O(this,10);break;case 3:$O(this,6);break;case 7:$O(this,12);break;default:$O(this,2)}}}; g.P.sD=function(G){if(!g.rH(arguments,this.N))throw Error("Unexpected channel state: "+this.N);}; g.P.eFA=function(G){G?Wu(2):(Wu(1),jsn(this,8))}; g.P.SE=function(G){if(G)throw Error("Can't create secondary domain capable XhrIo object.");G=new g.Wp;G.J=!1;return G}; g.P.isActive=function(){return!!this.Tj&&this.Tj.isActive(this)}; g.P.Z3=function(G){var X=dm;X.dispatchEvent(new XeH(X,G))}; g.P.k7=function(){return!1}; g.P=m4n.prototype;g.P.DE=function(){}; g.P.sx=function(){}; g.P.Rw=function(){}; g.P.M2=function(){}; g.P.GU=function(){}; g.P.Iw=function(){return{}}; g.P.isActive=function(){return!0};g.P=oQ4.prototype;g.P.enqueue=function(G){this.W.push(G)}; g.P.isEmpty=function(){return this.N.length===0&&this.W.length===0}; g.P.clear=function(){this.N=[];this.W=[]}; g.P.contains=function(G){return g.rH(this.N,G)||g.rH(this.W,G)}; g.P.remove=function(G){var X=this.N;var Q=(0,g.AOk)(X,G);Q>=0?(g.ad(X,Q),X=!0):X=!1;return X||g.Ev(this.W,G)}; g.P.xw=function(){for(var G=[],X=this.N.length-1;X>=0;--X)G.push(this.N[X]);X=this.W.length;for(var Q=0;Q=nBd.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(G=nBd[this.W],this.G1=g.wp((0,g.La)(this.pX,this),G),this.W++):this.publish("pairingFailed",Error("Server error "+G.status))}; g.P.Qv=function(){this.N=null;this.publish("pairingFailed",Error("Server not responding"))}; var nBd=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.mo(hU,qw);g.P=hU.prototype;g.P.start=function(){wj(this)&&this.publish("screenChange");!g.xL("yt-remote-lounge-token-expiration")&&vQd(this);g.Li(this.N);this.N=g.wp((0,g.La)(this.start,this),1E4)}; g.P.add=function(G,X){wj(this);AsZ(this,G);Lk(this,!1);this.publish("screenChange");X(G);G.token||vQd(this)}; g.P.remove=function(G,X){var Q=wj(this);$4S(this,G)&&(Lk(this,!1),Q=!0);X(G);Q&&this.publish("screenChange")}; g.P.rF=function(G,X,Q,R){var S=wj(this),Z=this.get(G.id);Z?(Z.name!=X&&(Z.name=X,Lk(this,!1),S=!0),Q(G)):R(Error("no such local screen."));S&&this.publish("screenChange")}; g.P.zT=function(){g.Li(this.N);hU.gS.zT.call(this)}; g.P.mz=function(G){wj(this);var X=this.screens.length;G=G&&G.screens||[];for(var Q=G.length,R=0;R20)break a;w=X(Z,H)}Z=w}S.name=Z}Q(jm(this,S))},this), onError:(0,g.La)(function(S){R(Error("pairing request failed: "+S.status))},this), onTimeout:(0,g.La)(function(){R(Error("pairing request timed out."))},this)})}; g.P.zT=function(){g.Xh(this.W);g.Xh(this.N);Yt.gS.zT.call(this)}; g.P.A6=function(){h$o(this);this.publish("screenChange");this.N.update()}; Yt.prototype.dispose=Yt.prototype.dispose;g.mo(Mw,g.ic);g.P=Mw.prototype;g.P.C2=function(G){this.U_()||(G&&(oH(this,""+G),this.publish("sessionFailed")),this.N=null,this.publish("sessionScreen",null))}; g.P.info=function(G){QN(this.Mi,G)}; g.P.Qf=function(){return null}; g.P.tj=function(G){var X=this.W;G?(X.displayStatus=new chrome.cast.ReceiverDisplayStatus(G,[]),X.displayStatus.showStop=!0):X.displayStatus=null;chrome.cast.setReceiverDisplayStatus(X,(0,g.La)(function(){this.info("Updated receiver status for "+X.friendlyName+": "+G)},this),(0,g.La)(function(){oH(this,"Failed to update receiver status for: "+X.friendlyName)},this))}; g.P.zT=function(){this.tj("");Mw.gS.zT.call(this)};g.T(u4,Mw);g.P=u4.prototype;g.P.r3=function(G){if(this.Y){if(this.Y==G)return;oH(this,"Overriding cast session with new session object");K5Z(this);this.Yc=!1;this.j="unknown";this.Y.removeUpdateListener(this.yH);this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DC)}this.Y=G;this.Y.addUpdateListener(this.yH);this.Y.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.DC);oGv(this,"getMdxSessionStatus")}; g.P.q_=function(G){this.info("launchWithParams no-op for Cast: "+g.VW(G))}; g.P.stop=function(){this.Y?this.Y.stop((0,g.La)(function(){this.C2()},this),(0,g.La)(function(){this.C2(Error("Failed to stop receiver app."))},this)):this.C2(Error("Stopping cast device without session."))}; g.P.tj=function(){}; g.P.zT=function(){this.info("disposeInternal");K5Z(this);this.Y&&(this.Y.removeUpdateListener(this.yH),this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DC));this.Y=null;Mw.prototype.zT.call(this)}; g.P.eYi=function(G,X){if(!this.U_())if(X)if(X=Qv(X),g.Hn(X))switch(G=""+X.type,X=X.data||{},this.info("onYoutubeMessage_: "+G+" "+g.VW(X)),G){case "mdxSessionStatus":jfv(this,X);break;case "loungeToken":uVH(this,X);break;default:oH(this,"Unknown youtube message: "+G)}else oH(this,"Unable to parse message.");else oH(this,"No data in message.")}; g.P.Wy=function(G,X,Q,R){g.Li(this.T);this.T=0;H7H(this.V,this.W.label,G,this.W.friendlyName,(0,g.La)(function(S){S?X(S):R>=0?(oH(this,"Screen "+G+" appears to be offline. "+R+" retries left."),this.T=g.wp((0,g.La)(this.Wy,this,G,X,Q,R-1),300)):Q(Error("Unable to fetch screen."))},this),Q)}; g.P.Qf=function(){return this.Y}; g.P.vY=function(G){this.U_()||G||(oH(this,"Cast session died."),this.C2())};g.T(PU,Mw);g.P=PU.prototype;g.P.r3=function(G){this.Y=G;this.Y.addUpdateListener(this.QH)}; g.P.q_=function(G){this.IU=G;this.AT()}; g.P.stop=function(){cgG(this);this.Y?this.Y.stop((0,g.La)(this.C2,this,null),(0,g.La)(this.C2,this,"Failed to stop DIAL device.")):this.C2()}; g.P.zT=function(){cgG(this);this.Y&&this.Y.removeUpdateListener(this.QH);this.Y=null;Mw.prototype.zT.call(this)}; g.P.lN=function(G){this.U_()||G||(oH(this,"DIAL session died."),this.C(),this.C=function(){},this.C2())};g.T(Kk,Mw);Kk.prototype.stop=function(){this.C2()}; Kk.prototype.r3=function(){}; Kk.prototype.q_=function(){g.Li(this.Y);this.Y=NaN;var G=kO(this.V.Y2(),this.W.label);G?mQ(this,G):this.C2(Error("No such screen"))}; Kk.prototype.zT=function(){g.Li(this.Y);this.Y=NaN;Mw.prototype.zT.call(this)};g.T(em,g.ic);g.P=em.prototype; g.P.init=function(G,X){chrome.cast.timeout.requestSession=3E4;var Q=new chrome.cast.SessionRequest(this.T,[chrome.cast.Capability.AUDIO_OUT]);g.jg("desktop_enable_cast_connect")&&(Q.androidReceiverCompatible=!0);this.j||(Q.dialRequest=new chrome.cast.DialRequest("YouTube"));var R=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;G=G||this.S?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var S=(0,g.La)(this.BMM,this);Q=new chrome.cast.ApiConfig(Q,(0,g.La)(this.XF, this),S,R,G);Q.customDialLaunchCallback=(0,g.La)(this.YMB,this);chrome.cast.initialize(Q,(0,g.La)(function(){this.U_()||(chrome.cast.addReceiverActionListener(this.C),ysL(),this.W.subscribe("onlineScreenChange",(0,g.La)(this.SM,this)),this.Y=lDL(this),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.La)(function(Z){this.xF("Failed to set initial custom receivers: "+g.VW(Z))},this)),this.publish("yt-remote-cast2-availability-change",aH(this)),X(!0))},this),(0,g.La)(function(Z){this.xF("Failed to initialize API: "+ g.VW(Z)); X(!1)},this))}; g.P.dcO=function(G,X){rj("Setting connected screen ID: "+G+" -> "+X);if(this.N){var Q=this.N.N;if(!G||Q&&Q.id!=G)rj("Unsetting old screen status: "+this.N.W.friendlyName),EV(this,null)}if(G&&X){if(!this.N){G=kO(this.W.Y2(),G);if(!G){rj("setConnectedScreenStatus: Unknown screen.");return}if(G.idType=="shortLived"){rj("setConnectedScreenStatus: Screen with id type to be short lived.");return}Q=gGH(this,G);Q||(rj("setConnectedScreenStatus: Connected receiver not custom..."),Q=new chrome.cast.Receiver(G.uuid? G.uuid:G.id,G.name),Q.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Y.push(Q),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.La)(function(R){this.xF("Failed to set initial custom receivers: "+g.VW(R))},this))); rj("setConnectedScreenStatus: new active receiver: "+Q.friendlyName);EV(this,new Kk(this.W,Q),!0)}this.N.tj(X)}else rj("setConnectedScreenStatus: no screen.")}; g.P.NLO=function(G){this.U_()?this.xF("Setting connection data on disposed cast v2"):this.N?this.N.q_(G):this.xF("Setting connection data without a session")}; g.P.qq=function(){this.U_()?this.xF("Stopping session on disposed cast v2"):this.N?(this.N.stop(),EV(this,null)):rj("Stopping non-existing session")}; g.P.requestSession=function(){chrome.cast.requestSession((0,g.La)(this.XF,this),(0,g.La)(this.VGm,this))}; g.P.zT=function(){this.W.unsubscribe("onlineScreenChange",(0,g.La)(this.SM,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var G=d4G,X=g.QH("yt.mdx.remote.debug.handlers_");g.Ev(X||[],G);g.Xh(this.N);g.ic.prototype.zT.call(this)}; g.P.xF=function(G){QN("Controller",G)}; g.P.Br=function(G,X){this.N==G&&(X||EV(this,null),this.publish("yt-remote-cast2-session-change",X))}; g.P.wnc=function(G,X){if(!this.U_())if(G)switch(G.friendlyName=chrome.cast.unescape(G.friendlyName),rj("onReceiverAction_ "+G.label+" / "+G.friendlyName+"-- "+X),X){case chrome.cast.ReceiverAction.CAST:if(this.N)if(this.N.W.label!=G.label)rj("onReceiverAction_: Stopping active receiver: "+this.N.W.friendlyName),this.N.stop();else{rj("onReceiverAction_: Casting to active receiver.");this.N.N&&this.publish("yt-remote-cast2-session-change",this.N.N);break}switch(G.receiverType){case chrome.cast.ReceiverType.CUSTOM:EV(this, new Kk(this.W,G));break;case chrome.cast.ReceiverType.DIAL:EV(this,new PU(this.W,G,this.V,this.config_));break;case chrome.cast.ReceiverType.CAST:EV(this,new u4(this.W,G,this.config_));break;default:this.xF("Unknown receiver type: "+G.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.N&&this.N.W.label==G.label?this.N.stop():this.xF("Stopping receiver w/o session: "+G.friendlyName)}else this.xF("onReceiverAction_ called without receiver.")}; g.P.YMB=function(G){if(this.U_())return Promise.reject(Error("disposed"));var X=G.receiver;X.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.xF("Not DIAL receiver: "+X.friendlyName),X.receiverType=chrome.cast.ReceiverType.DIAL);var Q=this.N?this.N.W:null;if(!Q||Q.label!=X.label)return this.xF("Receiving DIAL launch request for non-clicked DIAL receiver: "+X.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(Q&&Q.label==X.label&&Q.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.N.N)return rj("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.N.N),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.xF('Changing CAST intent from "'+Q.receiverType+'" to "dial" for '+X.friendlyName);EV(this,new PU(this.W,X,this.V,this.config_))}X=this.N;X.T=G;X.T.appState==chrome.cast.DialAppState.RUNNING?(G=X.T.extraData||{},Q=G.screenId||null,sV(X)&&G.loungeToken?G.loungeTokenRefreshIntervalMs?G=xtk(X,{name:X.W.friendlyName,screenId:G.screenId,loungeToken:G.loungeToken,dialId:X.T.receiver.label, screenIdType:"shortLived"},G.loungeTokenRefreshIntervalMs):(g.fc(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(G)+".")),G=O7V(X,Q)):G=O7V(X,Q)):G=aDZ(X);return G}; g.P.XF=function(G){var X=this;if(!this.U_()&&!this.S){rj("New cast session ID: "+G.sessionId);var Q=G.receiver;if(Q.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.N)if(Q.receiverType==chrome.cast.ReceiverType.CAST)rj("Got resumed cast session before resumed mdx connection."),Q.friendlyName=chrome.cast.unescape(Q.friendlyName),EV(this,new u4(this.W,Q,this.config_),!0);else{this.xF("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var R=this.N.W,S=kO(this.W.Y2(), R.label);S&&h9(S,Q.label)&&R.receiverType!=chrome.cast.ReceiverType.CAST&&Q.receiverType==chrome.cast.ReceiverType.CAST&&(rj("onSessionEstablished_: manual to cast session change "+Q.friendlyName),g.Xh(this.N),this.N=new u4(this.W,Q,this.config_),this.N.subscribe("sessionScreen",(0,g.La)(this.Br,this,this.N)),this.N.subscribe("sessionFailed",function(){return Utk(X,X.N)}),this.N.q_(null)); this.N.r3(G)}}}; g.P.Ct=function(){return this.N?this.N.Qf():null}; g.P.VGm=function(G){this.U_()||(this.xF("Failed to estabilish a session: "+g.VW(G)),G.code!=chrome.cast.ErrorCode.CANCEL&&EV(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.P.BMM=function(G){rj("Receiver availability updated: "+G);if(!this.U_()){var X=aH(this);this.J=G==chrome.cast.ReceiverAvailability.AVAILABLE;aH(this)!=X&&this.publish("yt-remote-cast2-availability-change",aH(this))}}; g.P.SM=function(){this.U_()||(this.Y=lDL(this),rj("Updating custom receivers: "+g.VW(this.Y)),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.La)(function(){this.xF("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",aH(this)))}; em.prototype.setLaunchParams=em.prototype.NLO;em.prototype.setConnectedScreenStatus=em.prototype.dcO;em.prototype.stopSession=em.prototype.qq;em.prototype.getCastSession=em.prototype.Ct;em.prototype.requestSession=em.prototype.requestSession;em.prototype.init=em.prototype.init;em.prototype.dispose=em.prototype.dispose;var $DV=g.u7(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),ygv=[],dtV=g.iA($DV);g.P=l4.prototype; g.P.reset=function(G){this.listId="";this.index=-1;this.videoId="";$tk(this);this.volume=-1;this.muted=!1;G&&(this.index=G.index,this.listId=G.listId,this.videoId=G.videoId,this.playerState=G.playerState,this.volume=G.volume,this.muted=G.muted,this.audioTrackId=G.audioTrackId,this.trackData=G.trackData,this.EW=G.hasPrevious,this.MW=G.hasNext,this.S=G.playerTime,this.C=G.playerTimeAt,this.W=G.seekableStart,this.J=G.seekableEnd,this.Y=G.duration,this.T=G.loadedTime,this.N=G.liveIngestionTime,this.V= !isNaN(this.N))}; g.P.isPlaying=function(){return this.playerState==1}; g.P.isBuffering=function(){return this.playerState==3}; g.P.GJ=function(G){this.Y=isNaN(G)?0:G}; g.P.getDuration=function(){return this.V?this.Y+BU(this):this.Y}; g.P.clone=function(){return new l4(vGZ(this))};g.T(IH,g.ic);g.P=IH.prototype;g.P.getState=function(){return this.Y}; g.P.U9=function(){return this.V.getReconnectTimeout()}; g.P.jZ=function(){this.V.reconnect()}; g.P.play=function(){WU(this)?(this.N?this.N.play(null,g.Bq,Dj(this,"play")):fk(this,"play"),Ge4(this,1,Ck(dj(this))),this.publish("remotePlayerChange")):pk(this,this.play)}; g.P.pause=function(){WU(this)?(this.N?this.N.pause(null,g.Bq,Dj(this,"pause")):fk(this,"pause"),Ge4(this,2,Ck(dj(this))),this.publish("remotePlayerChange")):pk(this,this.pause)}; g.P.seekTo=function(G){if(WU(this)){if(this.N){var X=dj(this),Q=new chrome.cast.media.SeekRequest;Q.currentTime=G;X.isPlaying()||X.isBuffering()?Q.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:Q.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.N.seek(Q,g.Bq,Dj(this,"seekTo",{newTime:G}))}else fk(this,"seekTo",{newTime:G});Ge4(this,3,G);this.publish("remotePlayerChange")}else pk(this,g.k4(this.seekTo,G))}; g.P.stop=function(){if(WU(this)){this.N?this.N.stop(null,g.Bq,Dj(this,"stopVideo")):fk(this,"stopVideo");var G=dj(this);G.index=-1;G.videoId="";$tk(G);yN(this,G);this.publish("remotePlayerChange")}else pk(this,this.stop)}; g.P.setVolume=function(G,X){if(WU(this)){var Q=dj(this);if(this.W){if(Q.volume!=G){var R=Math.round(G)/100;this.W.setReceiverVolumeLevel(R,(0,g.La)(function(){RH("set receiver volume: "+R)},this),(0,g.La)(function(){this.xF("failed to set receiver volume.")},this))}Q.muted!=X&&this.W.setReceiverMuted(X,(0,g.La)(function(){RH("set receiver muted: "+X)},this),(0,g.La)(function(){this.xF("failed to set receiver muted.")},this))}else{var S={volume:G, muted:X};Q.volume!=-1&&(S.delta=G-Q.volume);fk(this,"setVolume",S)}Q.muted=X;Q.volume=G;yN(this,Q)}else pk(this,g.k4(this.setVolume,G,X))}; g.P.vN=function(G,X){if(WU(this)){var Q=dj(this);G={videoId:G};X&&(Q.trackData={trackName:X.name,languageCode:X.languageCode,sourceLanguageCode:X.translationLanguage?X.translationLanguage.languageCode:"",languageName:X.languageName,kind:X.kind},G.style=g.VW(X.style),g.sl(G,Q.trackData));fk(this,"setSubtitlesTrack",G);yN(this,Q)}else pk(this,g.k4(this.vN,G,X))}; g.P.setAudioTrack=function(G,X){WU(this)?(X=X.getLanguageInfo().getId(),fk(this,"setAudioTrack",{videoId:G,audioTrackId:X}),G=dj(this),G.audioTrackId=X,yN(this,G)):pk(this,g.k4(this.setAudioTrack,G,X))}; g.P.playVideo=function(G,X,Q,R,S,Z,H){R=R===void 0?null:R;S=S===void 0?null:S;Z=Z===void 0?null:Z;H=H===void 0?null:H;var w=dj(this),h={videoId:G};Q!==void 0&&(h.currentIndex=Q);tU(w,G,Q||0);X!==void 0&&(Fg(w,X),h.currentTime=X);R&&(h.listId=R);S&&(h.playerParams=S);Z&&(h.clickTrackingParams=Z);H&&(h.locationInfo=g.VW(H));fk(this,"setPlaylist",h);R||yN(this,w)}; g.P.iI=function(G,X){if(WU(this)){if(G&&X){var Q=dj(this);tU(Q,G,X);yN(this,Q)}fk(this,"previous")}else pk(this,g.k4(this.iI,G,X))}; g.P.nextVideo=function(G,X){if(WU(this)){if(G&&X){var Q=dj(this);tU(Q,G,X);yN(this,Q)}fk(this,"next")}else pk(this,g.k4(this.nextVideo,G,X))}; g.P.wU=function(){if(WU(this)){fk(this,"clearPlaylist");var G=dj(this);G.reset();yN(this,G);this.publish("remotePlayerChange")}else pk(this,this.wU)}; g.P.NF=function(){WU(this)?fk(this,"dismissAutoplay"):pk(this,this.NF)}; g.P.dispose=function(){if(this.Y!=3){var G=this.Y;this.Y=3;this.publish("proxyStateChange",G,this.Y)}g.ic.prototype.dispose.call(this)}; g.P.zT=function(){i7d(this);this.V=null;this.C.clear();VN(this,null);g.ic.prototype.zT.call(this)}; g.P.yx=function(G){if((G!=this.Y||G==2)&&this.Y!=3&&G!=0){var X=this.Y;this.Y=G;this.publish("proxyStateChange",X,G);if(G==1)for(;!this.C.isEmpty();)X=G=this.C,X.N.length===0&&(X.N=X.W,X.N.reverse(),X.W=[]),G.N.pop().apply(this);else G==3&&this.dispose()}}; g.P.eGB=function(G,X){this.publish(G,X)}; g.P.rTH=function(G){if(!G)this.JJ(null),VN(this,null);else if(this.W.receiver.volume){G=this.W.receiver.volume;var X=dj(this),Q=Math.round(100*G.level||0);if(X.volume!=Q||X.muted!=G.muted)RH("Cast volume update: "+G.level+(G.muted?" muted":"")),X.volume=Q,X.muted=!!G.muted,yN(this,X)}}; g.P.JJ=function(G){RH("Cast media: "+!!G);this.N&&this.N.removeUpdateListener(this.T);if(this.N=G)this.N.addUpdateListener(this.T),X84(this),this.publish("remotePlayerChange")}; g.P.gcO=function(G){G?(X84(this),this.publish("remotePlayerChange")):this.JJ(null)}; g.P.Xi=function(){fk(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.P.tjA=function(){var G=NEH();G&&VN(this,G)}; g.P.xF=function(G){QN("CP",G)};g.T(nk,g.ic);g.P=nk.prototype; g.P.connect=function(G,X){if(X){var Q=X.listId,R=X.videoId,S=X.videoIds,Z=X.playerParams,H=X.clickTrackingParams,w=X.index,h={videoId:R},L=X.currentTime,k=X.locationInfo;X=X.loopMode;L!==void 0&&(h.currentTime=L<=5?0:L);Z&&(h.playerParams=Z);k&&(h.locationInfo=k);H&&(h.clickTrackingParams=H);Q&&(h.listId=Q);S&&S.length>0&&(h.videoIds=S.join(","));w!==void 0&&(h.currentIndex=w);this.QH&&(h.loopMode=X||"LOOP_MODE_OFF");Q&&(this.N.listId=Q);this.N.videoId=R;this.N.index=w||0;this.N.state=3;Fg(this.N, L);this.C="UNSUPPORTED";Q=this.QH?"setInitialState":"setPlaylist";Nw("Connecting with "+Q+" and params: "+g.VW(h));this.W.connect({method:Q,params:g.VW(h)},G,PaL())}else Nw("Connecting without params"),this.W.connect({},G,PaL());Zpa(this)}; g.P.I5=function(G){this.W.I5(G)}; g.P.dispose=function(){this.U_()||(g.G3("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),AU(this,3));g.ic.prototype.dispose.call(this)}; g.P.zT=function(){HpO(this);w8d(this);qLv(this);g.Li(this.T);this.T=NaN;g.Li(this.j);this.j=NaN;this.V=null;g.oc(this.AT);this.AT.length=0;this.W.dispose();g.ic.prototype.zT.call(this);this.C=this.J=this.Y=this.N=this.W=null}; g.P.fU=function(G){if(!this.Y||this.Y.length===0)return!1;for(var X=g.e(this.Y),Q=X.next();!Q.done;Q=X.next())if(!Q.value.capabilities.has(G))return!1;return!0}; g.P.UN=function(){var G=3;this.U_()||(G=0,isNaN(this.SL())?this.W.X5()&&isNaN(this.S)&&(G=1):G=2);return G}; g.P.o8=function(G){Nw("Disconnecting with "+G);g.G3("yt.mdx.remote.remoteClient_",null);HpO(this);this.publish("beforeDisconnect",G);G==1&&MC();this.W.disconnect(G);this.dispose()}; g.P.p$=function(){var G=this.N;this.V&&(G=this.N.clone(),tU(G,this.V,G.index));return vGZ(G)}; g.P.zFT=function(G){var X=this,Q=new l4(G);Q.videoId&&Q.videoId!=this.N.videoId&&(this.V=Q.videoId,g.Li(this.T),this.T=g.wp(function(){if(X.V){var S=X.V;X.V=null;X.N.videoId!=S&&$t(X,"getNowPlaying")}},5E3)); var R=[];this.N.listId==Q.listId&&this.N.videoId==Q.videoId&&this.N.index==Q.index||R.push("remoteQueueChange");this.N.playerState==Q.playerState&&this.N.volume==Q.volume&&this.N.muted==Q.muted&&Ck(this.N)==Ck(Q)&&g.VW(this.N.trackData)==g.VW(Q.trackData)||R.push("remotePlayerChange");this.N.reset(G);g.vn(R,function(S){this.publish(S)},this)}; g.P.gW=function(){var G=this.W.getDeviceId(),X=g.Ka(this.Y,function(Q){return Q.type=="REMOTE_CONTROL"&&Q.id!=G}); return X?X.id:""}; g.P.SL=function(){return this.W.U9()}; g.P.g6=function(){return this.C||"UNSUPPORTED"}; g.P.r6=function(){return this.J||""}; g.P.PY=function(){!isNaN(this.SL())&&this.W.jZ()}; g.P.bom=function(G,X){$t(this,G,X);LeZ(this)}; g.P.lK=function(){var G=g.cT("SAPISID","")||g.cT("__Secure-1PAPISID")||"",X=g.cT("__Secure-3PAPISID","")||"";if(!G&&!X)return"";G=g.Oo(g.xN(G),2);X=g.Oo(g.xN(X),2);return g.Oo(g.xN(","+G+","+X),2)}; nk.prototype.subscribe=nk.prototype.subscribe;nk.prototype.unsubscribeByKey=nk.prototype.Ed;nk.prototype.getProxyState=nk.prototype.UN;nk.prototype.disconnect=nk.prototype.o8;nk.prototype.getPlayerContextData=nk.prototype.p$;nk.prototype.setPlayerContextData=nk.prototype.zFT;nk.prototype.getOtherConnectedRemoteId=nk.prototype.gW;nk.prototype.getReconnectTimeout=nk.prototype.SL;nk.prototype.getAutoplayMode=nk.prototype.g6;nk.prototype.getAutoplayVideoId=nk.prototype.r6;nk.prototype.reconnect=nk.prototype.PY; nk.prototype.sendMessage=nk.prototype.bom;nk.prototype.getXsrfToken=nk.prototype.lK;nk.prototype.isCapabilitySupportedOnConnectedDevices=nk.prototype.fU;g.T(ecH,qw);g.P=ecH.prototype;g.P.Y2=function(G){return this.zj.$_gs(G)}; g.P.contains=function(G){return!!this.zj.$_c(G)}; g.P.get=function(G){return this.zj.$_g(G)}; g.P.start=function(){this.zj.$_st()}; g.P.add=function(G,X,Q){this.zj.$_a(G,X,Q)}; g.P.remove=function(G,X,Q){this.zj.$_r(G,X,Q)}; g.P.rF=function(G,X,Q,R){this.zj.$_un(G,X,Q,R)}; g.P.zT=function(){for(var G=this.N.length,X=0;X1&&!this.U.getOption("remote","quickCast")?(this.ac=g.JO(G,this.N,this),this.gJ(g.P1(G,this.N)),G=this.U.getOption("remote","currentReceiver"),G=this.N(G),this.options[G]&&this.mI(G),this.enable(!0)):this.enable(!1)}; MX.prototype.N=function(G){return G.key}; MX.prototype.jN=function(G){return G==="cast-selector-receiver"?"Cast...":this.ac[G].name}; MX.prototype.fL=function(G){g.U8.prototype.fL.call(this,G);this.U.setOption("remote","currentReceiver",this.ac[G]);this.gb.aW()};g.T(fca,g.P6);g.P=fca.prototype; g.P.create=function(){var G=this.player.Z(),X=g.Sb(G);G={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:G.G("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:G.G("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:G.G("enable_cast_short_lived_lounge_token")};OpS(X,G);this.subscriptions.push(g.$Q("yt-remote-before-disconnect",this.KpT,this));this.subscriptions.push(g.$Q("yt-remote-connection-change",this.TMU,this));this.subscriptions.push(g.$Q("yt-remote-receiver-availability-change",this.FF, this));this.subscriptions.push(g.$Q("yt-remote-auto-connect",this.ESH,this));this.subscriptions.push(g.$Q("yt-remote-receiver-resumed",this.XnU,this));this.subscriptions.push(g.$Q("mdx-privacy-popup-confirm",this.xdm,this));this.subscriptions.push(g.$Q("mdx-privacy-popup-cancel",this.VxT,this));this.FF()}; g.P.load=function(){this.player.cancelPlayback();g.P6.prototype.load.call(this);this.Y_=new yfa(this.player.Z(),this);this.player.gI(this.Y_);this.bH=new IcO(this,this.player,this.ZW);var G=(G=CcG())?G.currentTime:0;var X=lcH()?new IH(Z7(),void 0):null;G==0&&X&&(G=Ck(dj(X)));G!==0&&this.o6(G);DDn(this,this.FG,this.FG);this.player.SC(6)}; g.P.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Cf();this.zS=this.Az;g.Q0(this.bH,this.ZW);this.ZW=this.Y_=this.bH=null;g.P6.prototype.unload.call(this);this.player.SC(5);mx(this)}; g.P.zT=function(){g.bC(this.subscriptions);g.P6.prototype.zT.call(this)}; g.P.mH=function(G){var X=g.Wl.apply(1,arguments);this.loaded&&this.bH.hX.apply(this.bH,[G].concat(g.o0(X)))}; g.P.getAdState=function(){return this.zR}; g.P.EW=function(){return this.ZW?dj(this.ZW).EW:!1}; g.P.MW=function(){return this.ZW?dj(this.ZW).MW:!1}; g.P.o6=function(G,X){this.Wk=G||0;this.player.publish("progresssync",G,X);this.player.tS("onVideoProgress",G||0)}; g.P.getCurrentTime=function(){return this.Wk}; g.P.getDuration=function(){return dj(this.ZW).getDuration()||0}; g.P.mY=function(){var G=dj(this.ZW);return G.V?G.N+BU(G):G.N}; g.P.Yg=function(){return dj(this.ZW).T}; g.P.Ru=function(){return b7S(dj(this.ZW))}; g.P.Rd=function(){var G=dj(this.ZW);return G.W>0?G.W+BU(G):G.W}; g.P.getProgressState=function(){var G=dj(this.ZW),X=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:G.playerState!=1081&&this.player.Tg(),clipEnd:X.clipEnd,clipStart:X.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.mY(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Yg(),seekableEnd:this.Ru(),seekableStart:this.Rd(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.P.isAtLiveHead=function(){return b7S(dj(this.ZW))-this.getCurrentTime()<=1}; g.P.nextVideo=function(){this.ZW&&this.ZW.nextVideo()}; g.P.iI=function(){this.ZW&&this.ZW.iI()}; g.P.KpT=function(G){G===1&&(this.zX=this.ZW?dj(this.ZW):null)}; g.P.TMU=function(){var G=lcH()?new IH(Z7(),void 0):null;if(G){var X=this.zS;this.loaded&&this.unload();this.ZW=G;this.zX=null;X.key!==this.Az.key&&(this.zS=X,this.load())}else g.Xh(this.ZW),this.ZW=null,this.loaded&&(this.unload(),(G=this.zX)&&G.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(G.videoId,Ck(G)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.P.FF=function(){var G=[this.Az],X=G.concat,Q=zck();cU()&&g.xL("yt-remote-cast-available")&&Q.push({key:"cast-selector-receiver",name:"Cast..."});this.ac=X.call(G,Q);G=gBH()||this.Az;o9(this,G);this.player.tS("onMdxReceiversChange")}; g.P.ESH=function(){var G=gBH();o9(this,G)}; g.P.XnU=function(){this.zS=gBH()}; g.P.xdm=function(){this.z2=!0;mx(this);hI=!1;HC&&wT(HC,1);HC=null}; g.P.VxT=function(){this.z2=!1;mx(this);o9(this,this.Az);this.zS=this.Az;hI=!1;HC=null;this.player.playVideo()}; g.P.Zk=function(G,X){switch(G){case "casting":return this.loaded;case "receivers":return this.ac;case "currentReceiver":return X&&(X.key==="cast-selector-receiver"?Agd():o9(this,X)),this.loaded?this.zS:this.Az;case "quickCast":return this.ac.length===2&&this.ac[1].key==="cast-selector-receiver"?(X&&Agd(),!0):!1}}; g.P.Xi=function(){this.ZW.Xi()}; g.P.iZ=function(){return!1}; g.P.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.P.isLoggedIn=function(){var G,X;return((G=g.WO("PLAYER_CONFIG"))==null?void 0:(X=G.args)==null?void 0:X.authuser)!==void 0?!0:!(!g.WO("SESSION_INDEX")&&!g.WO("LOGGED_IN"))};g.ud("remote",fca);})(_yt_player);