(function(g){var window=this;'use strict';var So1=function(M){if(M instanceof g.KQ)return M;if(typeof M.lq=="function")return M.lq(!1);if(g.I1(M)){var O=0,c=new g.KQ;c.next=function(){for(;;){if(O>=M.length)return g.jE;if(O in M)return g.gs(M[O++]);O++}}; return c}throw Error("Not implemented");},Pu1=function(M,O,c){if(g.I1(M))g.qu(M,O,c); else for(M=So1(M);;){var k=M.next();if(k.done)break;O.call(c,k.value,void 0,M)}},OQ=function(M){g.Iu(M,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.j1()).toString(36)); return M},cI=function(M,O,c){Array.isArray(c)||(c=[String(c)]); g.T88(M.L,O,c)},ojk=function(M,O){var c=[]; Pu1(O,function(k){try{var I=g.r4.prototype.X.call(this,k,!0)}catch(b){if(b=="Storage: Invalid value was encountered")return;throw b;}I===void 0?c.push(k):g.Yu8(I)&&c.push(k)},M); return c},Ej4=function(M,O){ojk(M,O).forEach(function(c){g.r4.prototype.remove.call(this,c)},M)},yw1=function(M){if(M.dZ){if(M.dZ.locationOverrideToken)return{locationOverrideToken:M.dZ.locationOverrideToken}; if(M.dZ.latitudeE7!=null&&M.dZ.longitudeE7!=null)return{latitudeE7:M.dZ.latitudeE7,longitudeE7:M.dZ.longitudeE7}}return null},QSD=function(M,O){g.rK(M,O)||M.push(O)},dZz=function(M){var O=0,c; for(c in M)O++;return O},Cuk=function(M,O){return g.Gk(M,O)},DZ1=function(M){try{return g.Yl.JSON.parse(M)}catch(O){}M=String(M); if(/^\s*$/.test(M)?0:/^[\],:{}\s\u2028\u2029]*$/.test(M.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+M+")")}catch(O){}throw Error("Invalid JSON string: "+M);},kg=function(M){if(g.Yl.JSON)try{return g.Yl.JSON.parse(M)}catch(O){}return DZ1(M)},$ZK=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/channel/opened",g.Mk("channel_type"))},V01=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/channel/closed",g.Mk("channel_type"))},Tj1=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Mk("channel_type"))},fVK=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/channel/success")},mZD=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/channel/error",g.Mk("channel_type"),g.Mk("error_type"))},i81=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Aw1=function(){var M=IB(); this.S=M;M.f0("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},qoe=function(M,O,c,k){var I=new g.x0(null); M&&g.hF(I,M);O&&g.Lq(I,O);c&&g.Y0(I,c);k&&(I.X=k);return I},xZ0=function(M,O){return new g.AJ(M,O)},b5=function(M,O){return Object.prototype.hasOwnProperty.call(M,O)},hR0=function(M,O){return M===O},vI=function(M,O){this.X={}; this.S=[];this.iK=this.size=0;var c=arguments.length;if(c>1){if(c%2)throw Error("Uneven number of arguments");for(var k=0;k5&&(M=M.slice(M.length-5)); var O=g.Fh(oEA(),function(k){return k.loungeToken}),c=g.Fh(M,function(k){return k.loungeToken}); g.pe(c,function(k){return!g.rK(O,k)})&&EE4(); g.H3("yt-remote-local-screens",M,31536E3)},px=function(M){M||(g.B3("yt-remote-session-screen-id"),g.B3("yt-remote-session-video-id")); SiL();M=l5();g.JA(M,Fr());zOk(M)},Qwu=function(){if(!Kx){var M=g.B_(); M&&(Kx=new g.nR(M))}},d8A=function(){Qwu(); return Kx?!!Kx.get("yt-remote-use-staging-server"):!1},gz=function(M,O){g.AC[M]=!0; var c=g.mH();c&&c.publish.apply(c,arguments);g.AC[M]=!1},CbJ=function(){},IB=function(){if(!wz){wz=new g.P2(new CbJ); var M=g.pF("client_streamz_web_flush_count",-1);M!==-1&&(wz.Y=M)}return wz},D8e=function(){var M=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return M?parseInt(M[1],10):0},$8D=function(M){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+M)!=-1||document.currentScript.src.indexOf("&"+M)!=-1)},VvJ=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},nx=function(M){M.length?TWe(M.shift(),function(){nx(M)}):f81()},m8J=function(M){return"chrome-extension://"+M+"/cast_sender.js"},TWe=function(M,O,c){var k=document.createElement("script"); k.onerror=O;c&&(k.onload=c);g.nr(k,g.gj(M));(document.head||document.documentElement).appendChild(k)},iF1=function(){var M=D8e(),O=[]; if(M>1){var c=M-1;O.push("//www.gstatic.com/eureka/clank/"+M+"/cast_sender.js");O.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}return O},f81=function(){var M=VvJ(); M&&M(!1,"No cast extension found")},qiD=function(){if(AL1){var M=2,O=VvJ(),c=function(){M--; M==0&&O&&O(!0)}; window.__onGCastApiAvailable=c;TWe("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",f81,c)}},x80=function(){qiD(); var M=iF1();M.push("//www.gstatic.com/eureka/clank/cast_sender.js");nx(M)},LfD=function(){qiD(); var M=iF1();M.push.apply(M,g.p2(hOJ.map(m8J)));M.push("//www.gstatic.com/eureka/clank/cast_sender.js");nx(M)},RB=function(M,O,c){g.d.call(this); this.U=c!=null?(0,g.uD)(M,c):M;this.lU=O;this.J=(0,g.uD)(this.ou,this);this.S=!1;this.X=0;this.Y=this.Kw=null;this.L=[]},aB=function(){},Yi0=function(){g.V6.call(this,"p")},M41=function(){g.V6.call(this,"o")},c41=function(){return OwK=OwK||new g.UF},kuD=function(M){g.V6.call(this,"serverreachability",M)},rz=function(M){var O=c41(); O.dispatchEvent(new kuD(O,M))},Iyk=function(M){g.V6.call(this,"statevent",M)},N5=function(M){var O=c41(); O.dispatchEvent(new Iyk(O,M))},bw1=function(M,O,c,k){g.V6.call(this,"timingevent",M); this.size=O;this.rtt=c;this.retries=k},Jc=function(M,O){if(typeof M!=="function")throw Error("Fn must not be null and must be a function"); return g.Yl.setTimeout(function(){M()},O)},WI=function(){},sQ=function(M,O,c,k){this.Y=M; this.L=O;this.Hd=c;this.zU=k||1;this.SL=new g.tJ(this);this.Au=45E3;this.pB=null;this.U=!1;this.T=this.vQ=this.K=this.Mo=this.Y2=this.a5=this.Sc=null;this.s2=[];this.S=null;this.W=0;this.J=this.oO=null;this.Xv=-1;this.wy=!1;this.Zd=0;this.cQ=null;this.kc=this.HQ=this.l5=this.jc=!1;this.X=new v9e},v9e=function(){this.X=null; this.S="";this.Y=!1},uTA=function(M,O,c){M.Mo=1; M.K=OQ(O.clone());M.T=c;M.jc=!0;UAL(M,null)},UAL=function(M,O){M.Y2=Date.now(); HI(M);M.vQ=M.K.clone();cI(M.vQ,"t",M.zU);M.W=0;var c=M.Y.Mo;M.X=new v9e;M.S=t4K(M.Y,c?O:null,!M.T);M.Zd>0&&(M.cQ=new g.mK((0,g.uD)(M.Mq,M,M.S),M.Zd));M.SL.listen(M.S,"readystatechange",M.kt);O=M.pB?g.pc(M.pB):{};M.T?(M.oO||(M.oO="POST"),O["Content-Type"]="application/x-www-form-urlencoded",M.S.send(M.vQ,M.oO,M.T,O)):(M.oO="GET",M.S.send(M.vQ,M.oO,null,O));rz(1)},jFK=function(M){if(!Gu4(M))return g.TC(M.S); var O=g.f7(M.S);if(O==="")return"";var c="",k=O.length,I=g.$s(M.S)==4;if(!M.X.X){if(typeof TextDecoder==="undefined")return eO(M),BI(M),"";M.X.X=new g.Yl.TextDecoder}for(var b=0;bO.length)return X31;O=O.slice(k,k+c);M.W=k+c;return O},HI=function(M){M.a5=Date.now()+M.Au; p3K(M,M.Au)},p3K=function(M,O){if(M.Sc!=null)throw Error("WatchDog timer not null"); M.Sc=Jc((0,g.uD)(M.UN,M),O)},KAu=function(M){M.Sc&&(g.Yl.clearTimeout(M.Sc),M.Sc=null)},BI=function(M){M.Y.Qc()||M.wy||g9A(M.Y,M)},eO=function(M){KAu(M); g.Y$(M.cQ);M.cQ=null;M.SL.removeAll();if(M.S){var O=M.S;M.S=null;O.abort();O.dispose()}},WAD=function(M,O){try{var c=M.Y; if(c.fW!=0&&(c.S==M||w3u(c.X,M)))if(!M.HQ&&w3u(c.X,M)&&c.fW==3){try{var k=c.wB.S.parse(O)}catch(r){k=null}if(Array.isArray(k)&&k.length==3){var I=k;if(I[0]==0)a:{if(!c.K){if(c.S)if(c.S.Y2+3E30&&(c.Zd=1.5*u);k=c;var t=M.hj();if(t){var G=g.mi(t,"X-Client-Wire-Protocol");if(G){var X=k.X;!X.S&&(g.zk(G,"spdy")||g.zk(G,"quic")||g.zk(G,"h2"))&&(X.L=X.J,X.S=new Set,X.X&&(ay4(X,X.X),X.X=null))}if(k.jc){var l=g.mi(t,"X-HTTP-Session-Id");l&&(k.mP=l,g.Iu(k.pB,k.jc,l))}}c.fW=3;c.J&&c.J.u3();c.m0&&(c.wG=Date.now()-M.Y2);k=c;var F=M;k.TP=r4e(k,k.Mo?k.zU:null,k.Hd);if(F.HQ){Nhz(k.X, F);var p=F,K=k.Zd;K&&p.setTimeout(K);p.Sc&&(KAu(p),HI(p));k.S=F}else J4K(k);c.Y.length>0&&PI(c)}else b[0]!="stop"&&b[0]!="close"||SO(c,7);else c.fW==3&&(b[0]=="stop"||b[0]=="close"?b[0]=="stop"?SO(c,7):c.disconnect():b[0]!="noop"&&c.J&&c.J.IZ(b),c.s2=0)}rz(4)}catch(r){}},sFK=function(M,O){this.S=M; this.map=O;this.context=null},HwD=function(M){this.J=M||10; g.Yl.PerformanceNavigationTiming?(M=g.Yl.performance.getEntriesByType("navigation"),M=M.length>0&&(M[0].nextHopProtocol=="hq"||M[0].nextHopProtocol=="h2")):M=!!(g.Yl.chrome&&g.Yl.chrome.loadTimes&&g.Yl.chrome.loadTimes()&&g.Yl.chrome.loadTimes().wasFetchedViaSpdy);this.L=M?this.J:1;this.S=null;this.L>1&&(this.S=new Set);this.X=null;this.Y=[]},eS0=function(M){return M.X?!0:M.S?M.S.size>=M.L:!1},RS1=function(M){return M.X?1:M.S?M.S.size:0},w3u=function(M,O){return M.X?M.X==O:M.S?M.S.has(O):!1},ay4= function(M,O){M.S?M.S.add(O):M.X=O},Nhz=function(M,O){M.X&&M.X==O?M.X=null:M.S&&M.S.has(O)&&M.S.delete(O)},BhL=function(M){if(M.X!=null)return M.Y.concat(M.X.s2); if(M.S!=null&&M.S.size!==0){var O=M.Y;M=g.a(M.S.values());for(var c=M.next();!c.done;c=M.next())O=O.concat(c.value.s2);return O}return g.Zz(M.Y)},zSe=function(M,O){var c=new WI; if(g.Yl.Image){var k=new Image;k.onload=g.tA(oB,c,"TestLoadImage: loaded",!0,O,k);k.onerror=g.tA(oB,c,"TestLoadImage: error",!1,O,k);k.onabort=g.tA(oB,c,"TestLoadImage: abort",!1,O,k);k.ontimeout=g.tA(oB,c,"TestLoadImage: timeout",!1,O,k);g.Yl.setTimeout(function(){if(k.ontimeout)k.ontimeout()},1E4); k.src=M}else O(!1)},ZwD=function(M,O){var c=new WI,k=new AbortController,I=setTimeout(function(){k.abort(); oB(c,"TestPingServer: timeout",!1,O)},1E4); fetch(M,{signal:k.signal}).then(function(b){clearTimeout(I);b.ok?oB(c,"TestPingServer: ok",!0,O):oB(c,"TestPingServer: server error",!1,O)}).catch(function(){clearTimeout(I); oB(c,"TestPingServer: error",!1,O)})},oB=function(M,O,c,k,I){try{I&&(I.onload=null,I.onerror=null,I.onabort=null,I.ontimeout=null),k(c)}catch(b){}},Sj1=function(){this.S=new aB},EQ=function(M,O,c){return c&&c.t_?c.t_[M]||O:O},Ph0=function(M){this.Y=[]; this.zU=this.TP=this.pB=this.Hd=this.S=this.mP=this.jc=this.wy=this.W=this.Xv=this.T=null;this.ac=this.vQ=0;this.gB=EQ("failFast",!1,M);this.HQ=this.Sc=this.K=this.U=this.J=null;this.nA=!0;this.Q7=this.cQ=-1;this.kc=this.s2=this.Y2=0;this.IN=EQ("baseRetryDelayMs",5E3,M);this.n2=EQ("retryDelaySeedMs",1E4,M);this.uA=EQ("forwardChannelMaxRetries",2,M);this.iZ=EQ("forwardChannelRequestTimeoutMs",2E4,M);this.dZ=M&&M.Yxy||void 0;this.mX=M&&M.ipy||void 0;this.lA=M&&M.eUc||!1;this.Zd=void 0;this.Mo=M&&M.ssO|| !1;this.L="";this.X=new HwD(M&&M.MmO);this.wB=new Sj1;this.SL=M&&M.tN2||!1;this.a5=M&&M.KUO||!1;this.SL&&this.a5&&(this.a5=!1);this.WC=M&&M.Jff||!1;M&&M.syy&&(this.nA=!1);this.m0=!this.SL&&this.nA&&M&&M.zhu||!1;this.Zc=void 0;M&&M.Dr&&M.Dr>0&&(this.Zc=M.Dr);this.pw=void 0;this.wG=0;this.Au=!1;this.l5=this.oO=null},Z9=function(M){M.S&&(o90(M),M.S.cancel(),M.S=null)},E9D=function(M){Z9(M); M.K&&(g.Yl.clearTimeout(M.K),M.K=null);z7(M);M.X.cancel();M.U&&(typeof M.U==="number"&&g.Yl.clearTimeout(M.U),M.U=null)},PI=function(M){eS0(M.X)||M.U||(M.U=!0,g.gQ(M.H0,M),M.Y2=0)},QFk=function(M,O){if(RS1(M.X)>=M.X.L-(M.U?1:0))return!1; if(M.U)return M.Y=O.s2.concat(M.Y),!0;if(M.fW==1||M.fW==2||M.Y2>=(M.gB?0:M.uA))return!1;M.U=Jc((0,g.uD)(M.H0,M,O),y4e(M,M.Y2));M.Y2++;return!0},Chz=function(M,O){var c; O?c=O.Hd:c=M.vQ++;var k=M.pB.clone();g.Iu(k,"SID",M.L);g.Iu(k,"RID",c);g.Iu(k,"AID",M.cQ);yQ(M,k);M.W&&M.T&&g.uW(k,M.W,M.T);c=new sQ(M,M.L,c,M.Y2+1);M.W===null&&(c.pB=M.T);O&&(M.Y=O.s2.concat(M.Y));O=dAL(M,c,1E3);c.setTimeout(Math.round(M.iZ*.5)+Math.round(M.iZ*.5*Math.random()));ay4(M.X,c);uTA(c,k,O)},yQ=function(M,O){M.wy&&g.Ye(M.wy,function(c,k){g.Iu(O,k,c)}); M.J&&g.Ye({},function(c,k){g.Iu(O,k,c)})},dAL=function(M,O,c){c=Math.min(M.Y.length,c); var k=M.J?(0,g.uD)(M.J.d4,M.J,M):null;a:{for(var I=M.Y,b=-1;;){var v=["count="+c];b==-1?c>0?(b=I[0].S,v.push("ofs="+b)):b=0:v.push("ofs="+b);for(var u=!0,t=0;t=3)return!1; M.kc++;M.K=Jc((0,g.uD)(M.E_,M),y4e(M,M.s2));M.s2++;return!0},o90=function(M){M.oO!=null&&(g.Yl.clearTimeout(M.oO),M.oO=null)},DAz=function(M){M.S=new sQ(M,M.L,"rpc",M.kc); M.W===null&&(M.S.pB=M.T);M.S.Zd=0;var O=M.TP.clone();g.Iu(O,"RID","rpc");g.Iu(O,"SID",M.L);g.Iu(O,"AID",M.cQ);g.Iu(O,"CI",M.HQ?"0":"1");!M.HQ&&M.Zc&&g.Iu(O,"TO",M.Zc);g.Iu(O,"TYPE","xmlhttp");yQ(M,O);M.W&&M.T&&g.uW(O,M.W,M.T);M.Zd&&M.S.setTimeout(M.Zd);var c=M.S;M=M.zU;c.Mo=1;c.K=OQ(O.clone());c.T=null;c.jc=!0;UAL(c,M)},z7=function(M){M.Sc!=null&&(g.Yl.clearTimeout(M.Sc),M.Sc=null)},g9A=function(M,O){var c=null; if(M.S==O){z7(M);o90(M);M.S=null;var k=2}else if(w3u(M.X,O))c=O.s2,Nhz(M.X,O),k=1;else return;if(M.fW!=0)if(O.U)if(k==1){c=O.T?O.T.length:0;O=Date.now()-O.Y2;var I=M.Y2;k=c41();k.dispatchEvent(new bw1(k,c,O,I));PI(M)}else J4K(M);else{var b=O.Xv;I=O.getLastError();if(I==3||I==0&&b>0||!(k==1&&QFk(M,O)||k==2&&n9k(M)))switch(c&&c.length>0&&(O=M.X,O.Y=O.Y.concat(c)),I){case 1:SO(M,5);break;case 4:SO(M,10);break;case 3:SO(M,6);break;default:SO(M,2)}}},y4e=function(M,O){var c=M.IN+Math.floor(Math.random()* M.n2); M.isActive()||(c*=2);return c*O},SO=function(M,O){if(O==2){var c=(0,g.uD)(M.FM2,M),k=M.mX,I=!k; k=new g.x0(k||"//www.google.com/images/cleardot.gif");g.Yl.location&&g.Yl.location.protocol=="http"||g.hF(k,"https");OQ(k);I?zSe(k.toString(),c):ZwD(k.toString(),c)}else N5(2);M.fW=0;M.J&&M.J.zy(O);$AJ(M);E9D(M)},$AJ=function(M){M.fW=0; M.l5=[];if(M.J){var O=BhL(M.X);if(O.length!=0||M.Y.length!=0)g.S1(M.l5,O),g.S1(M.l5,M.Y),M.X.Y.length=0,g.Zz(M.Y),M.Y.length=0;M.J.P0()}},V4u=function(M){if(M.fW==0)return M.l5; var O=[];g.S1(O,BhL(M.X));g.S1(O,M.Y);return O},r4e=function(M,O,c){var k=g.bW(c); k.S!=""?(O&&g.Lq(k,O+"."+k.S),g.Y0(k,k.Y)):(k=g.Yl.location,k=qoe(k.protocol,O?O+"."+k.hostname:k.hostname,+k.port,c));O=M.jc;c=M.mP;O&&c&&g.Iu(k,O,c);g.Iu(k,"VER",M.O_);yQ(M,k);return k},t4K=function(M,O,c){if(O&&!M.Mo)throw Error("Can't create secondary domain capable XhrIo object."); O=M.lA&&!M.dZ?new g.dQ(new g.mj({v1:c})):new g.dQ(M.dZ);O.W=M.Mo;return O},ThA=function(){},fy1=function(){},dz=function(M,O){g.UF.call(this); this.S=new Ph0(O);this.J=M;this.X=O&&O.CU||null;M=O&&O.A_||null;O&&O.BNf&&(M?M["X-Client-Protocol"]="webchannel":M={"X-Client-Protocol":"webchannel"});this.S.T=M;M=O&&O.REu||null;O&&O.X9&&(M?M["X-WebChannel-Content-Type"]=O.X9:M={"X-WebChannel-Content-Type":O.X9});O&&O.tW&&(M?M["X-WebChannel-Client-Profile"]=O.tW:M={"X-WebChannel-Client-Profile":O.tW});this.S.Xv=M;(M=O&&O.dMB)&&!g.BD(M)&&(this.S.W=M);this.U=O&&O.ssO||!1;this.L=O&&O.MJo||!1;(O=O&&O.A7)&&!g.BD(O)&&(this.S.jc=O,g.t7(this.X,O)&&(M=this.X, O in M&&delete M[O]));this.Y=new QQ(this)},mA1=function(M){Yi0.call(this); M.__headers__&&(this.headers=M.__headers__,this.statusCode=M.__status__,delete M.__headers__,delete M.__status__);var O=M.__sm__;O?this.data=(this.S=g.b1(O))?g.l1(O,this.S):O:this.data=M},iw1=function(M){M41.call(this); this.status=1;this.errorCode=M},QQ=function(M){this.S=M},A4D=function(M,O){this.X=M; this.S=O},qjL=function(M){return V4u(M.S).map(function(O){var c=M.X; O=O.map;"__data__"in O?(O=O.__data__,c=c.L?DZ1(O):O):c=O;return c})},Cx=function(M,O){if(typeof M!=="function")throw Error("Fn must not be null and must be a function"); return g.Yl.setTimeout(function(){M()},O)},$g=function(M){D9.dispatchEvent(new xAA(D9,M))},xAA=function(M){g.V6.call(this,"statevent",M)},VQ=function(M,O,c,k){this.S=M; this.L=O;this.W=c;this.U=k||1;this.X=45E3;this.Y=new g.tJ(this);this.J=new g.zC;this.J.setInterval(250)},LA4=function(M,O,c){M.CC=1; M.FQ=OQ(O.clone());M.QW=c;M.jc=!0;hSz(M,null)},Yj4=function(M,O,c,k,I){M.CC=1; M.FQ=OQ(O.clone());M.QW=null;M.jc=c;I&&(M.L$=!1);hSz(M,k)},hSz=function(M,O){M.oY=Date.now(); Mru(M);M.Ag=M.FQ.clone();cI(M.Ag,"t",M.U);M.rI=0;M.BP=M.S.rV(M.S.UK()?O:null);M.iW>0&&(M.NL=new g.mK((0,g.uD)(M.nF,M,M.BP),M.iW));M.Y.listen(M.BP,"readystatechange",M.q3);O=M.XL?g.pc(M.XL):{};M.QW?(M.TC="POST",O["Content-Type"]="application/x-www-form-urlencoded",M.BP.send(M.Ag,M.TC,M.QW,O)):(M.TC="GET",M.L$&&!g.u9&&(O.Connection="close"),M.BP.send(M.Ag,M.TC,null,O));M.S.iJ(1)},kOu=function(M,O){var c=M.rI,k=O.indexOf("\n",c); if(k==-1)return Oy4;c=Number(O.substring(c,k));if(isNaN(c))return c11;k+=1;if(k+c>O.length)return Oy4;O=O.slice(k,k+c);M.rI=k+c;return O},Mru=function(M){M.al=Date.now()+M.X; IAL(M,M.X)},IAL=function(M,O){if(M.bL!=null)throw Error("WatchDog timer not null"); M.bL=Cx((0,g.uD)(M.Ru,M),O)},by4=function(M){M.bL&&(g.Yl.clearTimeout(M.bL),M.bL=null)},vJ1=function(M){M.S.Qc()||M.G7||M.S.SF(M)},T7=function(M){by4(M); g.Y$(M.NL);M.NL=null;M.J.stop();M.Y.removeAll();if(M.BP){var O=M.BP;M.BP=null;O.abort();O.dispose()}M.k5&&(M.k5=null)},UOA=function(M,O){try{M.S.W0(M,O),M.S.iJ(4)}catch(c){}},tr1=function(M,O,c,k,I){if(k==0)c(!1); else{var b=I||0;k--;u7J(M,O,function(v){v?c(!0):g.Yl.setTimeout(function(){tr1(M,O,c,k,b)},b)})}},u7J=function(M,O,c){var k=new Image; k.onload=function(){try{fx(k),c(!0)}catch(I){}}; k.onerror=function(){try{fx(k),c(!1)}catch(I){}}; k.onabort=function(){try{fx(k),c(!1)}catch(I){}}; k.ontimeout=function(){try{fx(k),c(!1)}catch(I){}}; g.Yl.setTimeout(function(){if(k.ontimeout)k.ontimeout()},O); k.src=M},fx=function(M){M.onload=null; M.onerror=null;M.onabort=null;M.ontimeout=null},GOD=function(M){this.S=M; this.X=new aB},jlJ=function(M){var O=mq(M.S,M.o2,"/mail/images/cleardot.gif"); OQ(O);tr1(O.toString(),5E3,(0,g.uD)(M.i$,M),3,2E3);M.iJ(1)},XoD=function(M){var O=M.S.U; O!=null?($g(5),O?($g(11),i5(M.S,M,!1)):($g(12),i5(M.S,M,!0))):(M.LS=new VQ(M),M.LS.XL=M.t6,O=M.S,O=mq(O,O.UK()?M.td:null,M.h6),$g(5),cI(O,"TYPE","xmlhttp"),Yj4(M.LS,O,!1,M.td,!1))},lAJ=function(M,O,c){this.S=1; this.X=[];this.Y=[];this.J=new aB;this.T=M||null;this.U=O!=null?O:null;this.K=c||!1},FMk=function(M,O){this.S=M; this.map=O;this.context=null},pou=function(M,O,c,k){g.V6.call(this,"timingevent",M); this.size=O;this.rtt=c;this.retries=k},KMk=function(M){g.V6.call(this,"serverreachability",M)},woK=function(M){M.bI(1,0); M.Sa=mq(M,null,M.sX);gJz(M)},nJA=function(M){M.hO&&(M.hO.abort(),M.hO=null); M.UZ&&(M.UZ.cancel(),M.UZ=null);M.f5&&(g.Yl.clearTimeout(M.f5),M.f5=null);Ac(M);M.qX&&(M.qX.cancel(),M.qX=null);M.V0&&(g.Yl.clearTimeout(M.V0),M.V0=null)},ReL=function(M,O){if(M.S==0)throw Error("Invalid operation: sending map when state is closed"); M.X.push(new FMk(M.w4++,O));M.S!=2&&M.S!=3||gJz(M)},aAk=function(M){var O=0; M.UZ&&O++;M.qX&&O++;return O},gJz=function(M){M.qX||M.V0||(M.V0=Cx((0,g.uD)(M.Z5,M),0),M.Bx=0)},J14=function(M,O){if(M.S==1){if(!O){M.JL=Math.floor(Math.random()*1E5); O=M.JL++;var c=new VQ(M,"",O);c.XL=M.SA;var k=r1K(M),I=M.Sa.clone();g.Iu(I,"RID",O);g.Iu(I,"CVER","1");q5(M,I);LA4(c,I,k);M.qX=c;M.S=2}}else M.S==3&&(O?NRz(M,O):M.X.length==0||M.qX||NRz(M))},NRz=function(M,O){if(O)if(M.YB>6){M.X=M.Y.concat(M.X); M.Y.length=0;var c=M.JL-1;O=r1K(M)}else c=O.W,O=O.QW;else c=M.JL++,O=r1K(M);var k=M.Sa.clone();g.Iu(k,"SID",M.L);g.Iu(k,"RID",c);g.Iu(k,"AID",M.MG);q5(M,k);c=new VQ(M,M.L,c,M.Bx+1);c.XL=M.SA;c.setTimeout(1E4+Math.round(1E4*Math.random()));M.qX=c;LA4(c,k,O)},q5=function(M,O){M.YN&&(M=M.YN.Nq())&&g.Ye(M,function(c,k){g.Iu(O,k,c)})},r1K=function(M){var O=Math.min(M.X.length,1E3),c=["count="+O]; if(M.YB>6&&O>0){var k=M.X[0].S;c.push("ofs="+k)}else k=0;for(var I={},b=0;b=3)return!1; M.W++;M.f5=Cx((0,g.uD)(M.Vf,M),sle(M,M.wv));M.wv++;return!0},i5=function(M,O,c){M.Ij=M.U==null?c:!M.U; M.RP=O.Q5;M.K||woK(M)},Ac=function(M){M.La!=null&&(g.Yl.clearTimeout(M.La),M.La=null)},sle=function(M,O){var c=5E3+Math.floor(Math.random()*1E4); M.isActive()||(c*=2);return c*O},xg=function(M,O){if(O==2||O==9){var c=null; M.YN&&(c=null);var k=(0,g.uD)(M.LM2,M);c||(c=new g.x0("//www.google.com/images/cleardot.gif"),OQ(c));u7J(c.toString(),1E4,k)}else $g(2);ee1(M,O)},ee1=function(M,O){M.S=0; M.YN&&M.YN.yf(O);BRu(M);nJA(M)},BRu=function(M){M.S=0; M.RP=-1;if(M.YN)if(M.Y.length==0&&M.X.length==0)M.YN.Xs();else{var O=g.Zz(M.Y),c=g.Zz(M.X);M.Y.length=0;M.X.length=0;M.YN.Xs(O,c)}},mq=function(M,O,c){var k=g.bW(c); if(k.S!="")O&&g.Lq(k,O+"."+k.S),g.Y0(k,k.Y);else{var I=window.location;k=qoe(I.protocol,O?O+"."+I.hostname:I.hostname,+I.port,c)}M.kh&&g.Ye(M.kh,function(b,v){g.Iu(k,v,b)}); g.Iu(k,"VER",M.YB);q5(M,k);return k},zeD=function(){},Zy1=function(){this.S=[]; this.X=[]},SND=function(M){g.V6.call(this,"channelMessage"); this.message=M},Pfe=function(M){g.V6.call(this,"channelError"); this.error=M},oJ1=function(M,O){this.action=M; this.params=O||{}},hc=function(M,O){g.d.call(this); this.S=new g.$q(this.TGb,0,this);g.C(this,this.S);this.lU=5E3;this.X=0;if(typeof M==="function")O&&(M=(0,g.uD)(M,O));else if(M&&typeof M.handleEvent==="function")M=(0,g.uD)(M.handleEvent,M);else throw Error("Invalid listener argument");this.Y=M},EJK=function(M,O,c,k,I,b,v,u,t,G,X,l,F,p){c=c===void 0?!1:c; k=k===void 0?function(){return""}:k; I=I===void 0?!1:I;b=b===void 0?!1:b;v=v===void 0?!1:v;u=u===void 0?function(){return g.W2({})}:u; t=t===void 0?!1:t;X=X===void 0?!1:X;l=l===void 0?!1:l;F=F===void 0?!1:F;p=p===void 0?!1:p;this.Mo=M;this.Sc=O;this.U=new g.w4;this.X=new hc(this.jN2,this);this.S=null;this.W=!1;this.T=null;this.Y2="";this.s2=this.K=0;this.Y=[];this.kc=c;this.jc=k;this.J=b;this.pB=u;this.wy=G;this.zU=v;this.oO=null;this.L=g.W2();this.Hd=I;this.l5=t;this.SL=X;this.a5=l;this.nA=F;this.Xv=p;this.Zd=new $ZK;this.HQ=new V01;this.Au=new fVK;this.vQ=new Tj1;this.cQ=new mZD;this.m0=new i81;this.pw=new Aw1},dO0=function(M, O,c,k,I){y1L(M); if(M.S){var b=g.Q5("ID_TOKEN"),v=M.S.SA||{};b?v["x-youtube-identity-token"]=b:delete v["x-youtube-identity-token"];M.S.SA=v}Qlk(M);k?(k.getState()!=3&&aAk(k)==0||k.getState(),M.S.connect(O,c,M.Sc,k.L,k.MG)):I?M.S.connect(O,c,M.Sc,I.sessionId,I.arrayId):M.S.connect(O,c,M.Sc)},Vr1=function(M,O){return M.nA?!0:M.a5?Object.values(Cfz).includes(O):M.SL?!Object.values(DOu).includes(O):M.Xv?Object.values($O4).includes(O):!1},mOJ=function(M){var O,c; g.P(function(k){if(k.X==1)return g.Wk(k,2),g.Z(k,TRJ(M),2);g.Pk(k);O=M.Y;M.Y=[];c=O.length;fAJ(M,O,c);Lx(M);return g.oG(k,0)})},fAJ=function(M,O,c){for(var k=0;k0?c=Object.assign({},c,O):delete c.Authorization;M.S.SA=c}},Qlk=function(M){M.wy&&!M.J&&A1z(M,M.wy())},Yg=function(M){this.scheme="https"; this.port=this.domain="";this.S="/api/lounge";this.X=!0;M=M||document.location.href;var O=Number(g.k$(M)[4]||null)||"";O&&(this.port=":"+O);this.domain=g.Iy(M)||"";M=g.E4();M.search("MSIE")>=0&&(M=M.match(/MSIE ([\d.]+)/)[1],g.oJ(M,"10.0")<0&&(this.X=!1))},M_=function(M,O){var c=M.S; M.X&&(c=M.scheme+"://"+M.domain+M.port+M.S);return g.js(c+O,{})},qN4=function(M,O){g.UF.call(this); var c=this;this.eq=M();this.eq.subscribe("handlerOpened",this.M3,this);this.eq.subscribe("handlerClosed",this.onClosed,this);this.eq.subscribe("handlerError",function(k,I){c.onError(I)}); this.eq.subscribe("handlerMessage",this.onMessage,this);this.S=O},xOA=function(M,O,c){var k=this; c=c===void 0?function(){return""}:c; var I=I===void 0?new fy1:I;var b=b===void 0?new g.w4:b;this.pathPrefix=M;this.S=O;this.Y2=c;this.J=b;this.K=null;this.T=this.W=0;this.channel=null;this.U=0;this.Y=new hc(function(){k.Y.isActive();var v;((v=k.channel)==null?void 0:RS1((new A4D(v,v.S)).S.X))===0&&k.connect(k.K,k.W)}); this.L={};this.X={};this.Sc=!1;this.logger=null;this.s2=[];this.xM=void 0;this.pB=new $ZK;this.oO=new V01;this.wy=new Tj1;this.jc=new mZD},he1=function(M){g.L0(M.channel,"m",function(){M.U=3; M.Y.reset();M.K=null;M.W=0;for(var O=g.a(M.s2),c=O.next();!c.done;c=O.next())c=c.value,M.channel&&M.channel.send(c);M.s2=[];M.publish("webChannelOpened");M.pB.ZX("WEB_CHANNEL")}); g.L0(M.channel,"n",function(){M.U=0;M.Y.isActive()||M.publish("webChannelClosed");var O,c=(O=M.channel)==null?void 0:qjL(new A4D(O,O.S));c&&(M.s2=[].concat(g.p2(c)));M.oO.ZX("WEB_CHANNEL")}); g.L0(M.channel,"p",function(O){var c=O.data;c[0]==="gracefulReconnect"?(M.Y.start(),M.channel&&M.channel.close()):M.publish("webChannelMessage",new oJ1(c[0],c[1]));M.xM=O.statusCode;M.wy.ZX("WEB_CHANNEL")}); g.L0(M.channel,"o",function(){M.xM===401||M.Y.start();M.publish("webChannelError");M.jc.ZX("WEB_CHANNEL","")})},LMk=function(M){var O=M.Y2(); O?M.L["x-youtube-lounge-xsrf-token"]=O:delete M.L["x-youtube-lounge-xsrf-token"]},YN4=function(M){g.UF.call(this); this.S=M();this.S.subscribe("webChannelOpened",this.EN,this);this.S.subscribe("webChannelClosed",this.onClosed,this);this.S.subscribe("webChannelError",this.onError,this);this.S.subscribe("webChannelMessage",this.onMessage,this)},M$4=function(M,O,c,k,I){function b(){return new EJK(M_(M,"/bc"),O,!1,c,k)} c=c===void 0?function(){return""}:c; return g.Ft("enable_mdx_web_channel_desktop")?new YN4(function(){return new xOA(M_(M,"/wc"),O,c)}):new qN4(b,I)},Ide=function(){var M=OLJ; cC1();OK.push(M);kZ0()},cB=function(M,O){cC1(); var c=bL1(M,String(O));OK.length==0?vHD(c):(kZ0(),g.qu(OK,function(k){k(c)}))},ka=function(M){cB("CP",M)},cC1=function(){OK||(OK=g.c4("yt.mdx.remote.debug.handlers_")||[],g.Ok("yt.mdx.remote.debug.handlers_",OK))},vHD=function(M){var O=(I$+1)%50; I$=O;bJ[O]=M;vB||(vB=O==49)},kZ0=function(){var M=OK; if(bJ[0]){var O=vB?I$:-1,c={};do c={ZU:void 0},O=(O+1)%50,c.ZU=bJ[O],g.qu(M,function(k){return function(I){I(k.ZU)}}(c)); while(O!=I$);bJ=Array(50);I$=-1;vB=!1}},bL1=function(M,O){var c=(Date.now()-UG1)/1E3; c.toFixed&&(c=c.toFixed(3));var k=[];k.push("[",c+"s","] ");k.push("[","yt.mdx.remote","] ");k.push(M+": "+O,"\n");return k.join("")},UK=function(M){g.MN.call(this); this.U=M;this.screens=[]},ud4=function(M,O){var c=M.get(O.uuid)||M.get(O.id); if(c)return M=c.name,c.id=O.id||c.id,c.name=O.name,c.token=O.token,c.uuid=O.uuid||c.uuid,c.name!=M;M.screens.push(O);return!0},t$D=function(M,O){var c=M.screens.length!=O.length; M.screens=g.aq(M.screens,function(b){return!!HF4(O,b)}); for(var k=O.length,I=0;I0&&M.L0&&R$(M,c)},function(O){M.J=function(){}; M.vP(O)})},dGJ=function(M){var O={}; O.pairingCode=M.oO;O.theme=M.Mo;d8A()&&(O.env_useStageMdx=1);return g.GM(O)},C_z=function(M){return new Promise(function(O){M.oO=Wf1(); if(M.pB){var c=new chrome.cast.DialLaunchResponse(!0,dGJ(M));O(c);Q5K(M)}else M.Sc=function(){g.jv(M.T);M.Sc=function(){}; M.T=NaN;var k=new chrome.cast.DialLaunchResponse(!0,dGJ(M));O(k);Q5K(M)},M.T=g.tL(function(){M.Sc()},100)})},$Gz=function(M,O,c){M.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(O)); var k=new tc(O);return(new Promise(function(I){DG1(M,k,function(b){b?(M.s2=!0,lJ(M.L,k),p4(M,k),R$(M,c)):g.f8(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(O)+" is not online."));I(b)},5)})).then(function(I){return I?new chrome.cast.DialLaunchResponse(!1):C_z(M)})},V$0=function(M,O){var c=M.K.receiver.label,k=M.X.friendlyName; return(new Promise(function(I){adz(M.L,c,O,k,function(b){b&&b.token&&p4(M,b);I(b)},function(b){K4(M,"Failed to get DIAL screen: "+b); I(null)})})).then(function(I){return I&&I.token?new chrome.cast.DialLaunchResponse(!1):C_z(M)})},DG1=function(M,O,c,k){g.jv(M.U); M.U=0;N01(M.L,O,function(I){I||k<0?c(I):M.U=g.tL(function(){DG1(M,O,c,k-1)},300)})},R$=function(M,O){M.info("getDialAppInfoWithTimeout_ "+O); n4(M)&&(g.jv(M.W),M.W=0,O==0?T01(M):M.W=g.tL(function(){T01(M)},O))},T01=function(M){n4(M)&&M.Y.getDialAppInfo(function(O){M.info("getDialAppInfo dialLaunchData: "+JSON.stringify(O)); O=O.extraData||{};var c=null;if(O.loungeToken){var k;((k=M.S)==null?void 0:k.token)==O.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(M.Y2=c,R$(M,3E4)):(M.s2=!1,M.Y2="unknown",HLk(M,O.loungeToken),R$(M,O.loungeTokenRefreshIntervalMs))},function(O){M.info("getDialAppInfo error: "+O); M.Y2="noLoungeTokenResponse";R$(M,3E4)})},fdD=function(M){g.jv(M.U); M.U=0;g.jv(M.W);M.W=0;M.J();M.J=function(){}; g.jv(M.T)},a$=function(M,O){FU.call(this,M,O,"ManualSession"); this.Y=g.tL((0,g.uD)(this.Qh,this,null),150)},re=function(M,O){g.MN.call(this); this.config_=O;this.X=M;this.K=O.appId||"233637DE";this.L=O.theme||"cl";this.T=O.disableCastApi||!1;this.U=O.forceMirroring||!1;this.S=null;this.W=!1;this.Y=[];this.J=(0,g.uD)(this.GPY,this)},mG4=function(M,O){return O?g.R1(M.Y,function(c){return G7(O,c.label)},M):null},N_=function(M){cB("Controller",M)},OLJ=function(M){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(M)},J3=function(M){return M.W||!!M.Y.length||!!M.S},WB=function(M,O,c){O!=M.S&&(g.Y$(M.S),(M.S=O)?(c?M.publish("yt-remote-cast2-receiver-resumed", O.X):M.publish("yt-remote-cast2-receiver-selected",O.X),O.subscribe("sessionScreen",(0,g.uD)(M.Qj,M,O)),O.subscribe("sessionFailed",function(){return iLD(M,O)}),O.S?M.publish("yt-remote-cast2-session-change",O.S):c&&M.S.Qh(null)):M.publish("yt-remote-cast2-session-change",null))},iLD=function(M,O){M.S==O&&M.publish("yt-remote-cast2-session-failed")},AC1=function(M){var O=M.X.Ae(),c=M.S&&M.S.X; M=g.Fh(O,function(k){c&&G7(k,c.label)&&(c=null);var I=k.uuid?k.uuid:k.id,b=mG4(this,k);b?(b.label=I,b.friendlyName=k.name):(b=new chrome.cast.Receiver(I,k.name),b.receiverType=chrome.cast.ReceiverType.CUSTOM);return b},M); c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),M.push(c));return M},O5J=function(M,O,c,k){k.disableCastApi?sK("Cannot initialize because disabled by Mdx config."):qeu()?xG0(O,k)&&(hAu(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?LHK(M,c):(window.__onGCastApiAvailable=function(I,b){I?LHK(M,c):(HB("Failed to load cast API: "+b),YeA(!1),hAu(!1),g.B3("yt-remote-cast-available"),g.B3("yt-remote-cast-receiver"), MgK(),c(!1))},k.loadCastApiSetupScript?g.YH("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?D8e()>=60&&x80():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?f81():D8e()>=89?LfD():(qiD(),nx(hOJ.map(m8J))))):sK("Cannot initialize because not running Chrome")},MgK=function(){sK("dispose"); var M=em();M&&M.dispose();g.Ok("yt.mdx.remote.cloudview.instance_",null);cxK(!1);g.hC(k8u);k8u.length=0},BB=function(){return!!g.e4("yt-remote-cast-installed")},IUk=function(){var M=g.e4("yt-remote-cast-receiver"); return M?M.friendlyName:null},b5J=function(){sK("clearCurrentReceiver"); g.B3("yt-remote-cast-receiver")},vkk=function(){return BB()?em()?em().getCastSession():(HB("getCastSelector: Cast is not initialized."),null):(HB("getCastSelector: Cast API is not installed!"),null)},U3J=function(){BB()?em()?zs()?(sK("Requesting cast selector."),em().requestSession()):(sK("Wait for cast API to be ready to request the session."),k8u.push(g.xH("yt-remote-cast2-api-ready",U3J))):HB("requestCastSelector: Cast is not initialized."):HB("requestCastSelector: Cast API is not installed!")}, ZJ=function(M,O){zs()?em().setConnectedScreenStatus(M,O):HB("setConnectedScreenStatus called before ready.")},qeu=function(){var M=g.E4().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.K1||M},u_J=function(M,O){em().init(M,O)},xG0=function(M,O){var c=!1; em()||(M=new re(M,O),M.subscribe("yt-remote-cast2-availability-change",function(k){g.H3("yt-remote-cast-available",k);gz("yt-remote-cast2-availability-change",k)}),M.subscribe("yt-remote-cast2-receiver-selected",function(k){sK("onReceiverSelected: "+k.friendlyName); g.H3("yt-remote-cast-receiver",k);gz("yt-remote-cast2-receiver-selected",k)}),M.subscribe("yt-remote-cast2-receiver-resumed",function(k){sK("onReceiverResumed: "+k.friendlyName); g.H3("yt-remote-cast-receiver",k);gz("yt-remote-cast2-receiver-resumed",k)}),M.subscribe("yt-remote-cast2-session-change",function(k){sK("onSessionChange: "+jO(k)); k||g.B3("yt-remote-cast-receiver");gz("yt-remote-cast2-session-change",k)}),g.Ok("yt.mdx.remote.cloudview.instance_",M),c=!0); sK("cloudview.createSingleton_: "+c);return c},em=function(){return g.c4("yt.mdx.remote.cloudview.instance_")},LHK=function(M,O){YeA(!0); hAu(!1);u_J(M,function(c){c?(cxK(!0),g.LL("yt-remote-cast2-api-ready")):(HB("Failed to initialize cast API."),YeA(!1),g.B3("yt-remote-cast-available"),g.B3("yt-remote-cast-receiver"),MgK());O(c)})},sK=function(M){cB("cloudview",M)},HB=function(M){cB("cloudview",M)},YeA=function(M){sK("setCastInstalled_ "+M); g.H3("yt-remote-cast-installed",M)},zs=function(){return!!g.c4("yt.mdx.remote.cloudview.apiReady_")},cxK=function(M){sK("setApiReady_ "+M); g.Ok("yt.mdx.remote.cloudview.apiReady_",M)},hAu=function(M){g.Ok("yt.mdx.remote.cloudview.initializing_",M)},Sm=function(M){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.J=this.U=0;this.trackData=null;this.EE=this.tF=!1;this.K=this.Y=this.W=this.X=0;this.S=NaN;this.L=!1;this.reset(M)},tgL=function(M){M.audioTrackId=null; M.trackData=null;M.playerState=-1;M.tF=!1;M.EE=!1;M.U=0;M.J=g.j1();M.X=0;M.W=0;M.Y=0;M.K=0;M.S=NaN;M.L=!1},PB=function(M){return M.isPlaying()?(g.j1()-M.J)/1E3:0},o$=function(M,O){M.U=O; M.J=g.j1()},EK=function(M){switch(M.playerState){case 1:case 1081:return(g.j1()-M.J)/1E3+M.U; case -1E3:return 0}return M.U},G8L=function(M){return M.L?M.W+PB(M):M.W},yX=function(M,O,c){var k=M.videoId; M.videoId=O;M.index=c;O!=k&&tgL(M)},jDe=function(M){var O={}; O.index=M.index;O.listId=M.listId;O.videoId=M.videoId;O.playerState=M.playerState;O.volume=M.volume;O.muted=M.muted;O.audioTrackId=M.audioTrackId;O.trackData=g.Kc(M.trackData);O.hasPrevious=M.tF;O.hasNext=M.EE;O.playerTime=M.U;O.playerTimeAt=M.J;O.seekableStart=M.X;O.seekableEnd=M.W;O.duration=M.Y;O.loadedTime=M.K;O.liveIngestionTime=M.S;return O},de=function(M,O){g.MN.call(this); var c=this;this.Y=0;this.L=M;this.U=[];this.J=new Zy1;this.X=this.S=null;this.T=(0,g.uD)(this.OBY,this);this.W=(0,g.uD)(this.gX,this);this.K=(0,g.uD)(this.McO,this);this.Sc=(0,g.uD)(this.HB2,this);var k=0;M?(k=M.getProxyState(),k!=3&&(M.subscribe("proxyStateChange",this.gA,this),XmJ(this))):k=3;k!=0&&(O?this.gA(k):g.tL(function(){c.gA(k)},0)); (M=vkk())&&QX(this,M);this.subscribe("yt-remote-cast2-session-change",this.Sc)},C4=function(M){return new Sm(M.L.getPlayerContextData())},XmJ=function(M){g.qu("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(O){this.U.push(this.L.subscribe(O,g.tA(this.Yg2,O),this))},M)},lUK=function(M){g.qu(M.U,function(O){this.L.unsubscribeByKey(O)},M); M.U.length=0},DJ=function(M){return M.getState()==1},$a=function(M,O){var c=M.J; c.S.length+c.X.length<50&&M.J.enqueue(O)},FpL=function(M,O,c){var k=C4(M); o$(k,c);k.playerState!=-1E3&&(k.playerState=O);VX(M,k)},Ts=function(M,O,c){M.L.sendMessage(O,c)},VX=function(M,O){lUK(M); M.L.setPlayerContextData(jDe(O));XmJ(M)},QX=function(M,O){M.X&&(M.X.removeUpdateListener(M.T),M.X.removeMediaListener(M.W),M.gX(null)); M.X=O;M.X&&(ka("Setting cast session: "+M.X.sessionId),M.X.addUpdateListener(M.T),M.X.addMediaListener(M.W),M.X.media.length&&M.gX(M.X.media[0]))},pmL=function(M){var O=M.S.media,c=M.S.customData; if(O&&c){var k=C4(M);O.contentId!=k.videoId&&ka("Cast changing video to: "+O.contentId);k.videoId=O.contentId;k.playerState=c.playerState;o$(k,M.S.getEstimatedTime());VX(M,k)}else ka("No cast media video. Ignoring state update.")},f4=function(M,O,c){return(0,g.uD)(function(k){this.d9("Failed to "+O+" with cast v2 channel. Error code: "+k.code); k.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.d9("Retrying "+O+" using MDx browser channel."),Ts(this,O,c))},M)},A3=function(M,O,c,k){k=k===void 0?!1:k; g.MN.call(this);var I=this;this.U=NaN;this.oO=!1;this.T=this.K=this.s2=this.Y2=NaN;this.Sc=[];this.J=this.W=this.L=this.S=this.X=null;this.pB=M;this.wy=k;this.Sc.push(g.gh(window,"beforeunload",function(){I.sf(2)})); this.Y=[];this.S=new Sm;this.Mo=O.id;this.jc=O.idType;this.X=M$4(this.pB,c,this.SZ,this.jc=="shortLived",this.Mo);this.X.listen("channelOpened",function(){KpA(I)}); this.X.listen("channelClosed",function(){mJ("Channel closed");isNaN(I.U)?px(!0):px();I.dispose()}); this.X.listen("channelError",function(b){px();isNaN(I.b0())?(b==1&&I.jc=="shortLived"&&I.publish("browserChannelAuthError",b),mJ("Channel error: "+b+" without reconnection"),I.dispose()):(I.oO=!0,mJ("Channel error: "+b+" with reconnection in "+I.b0()+" ms"),iJ(I,2))}); this.X.listen("channelMessage",function(b){gkK(I,b)}); this.X.Rb(O.token);this.subscribe("remoteQueueChange",function(){var b=I.S.videoId;g.zu()&&g.H3("yt-remote-session-video-id",b)})},wmK=function(M){return g.R1(M.Y,function(O){return O.type=="LOUNGE_SCREEN"})},mJ=function(M){cB("conn",M)},iJ=function(M,O){M.publish("proxyStateChange",O)},nkK=function(M){M.U=g.tL(function(){mJ("Connecting timeout"); M.sf(1)},2E4)},R0u=function(M){g.jv(M.U); M.U=NaN},aUK=function(M){g.jv(M.Y2); M.Y2=NaN},N$k=function(M){rxe(M); M.s2=g.tL(function(){q_(M,"getNowPlaying")},2E4)},rxe=function(M){g.jv(M.s2); M.s2=NaN},KpA=function(M){mJ("Channel opened"); M.oO&&(M.oO=!1,aUK(M),M.Y2=g.tL(function(){mJ("Timing out waiting for a screen.");M.sf(1)},15E3))},WpD=function(M,O){var c=null; if(O){var k=wmK(M);k&&(c={clientName:k.clientName,deviceMake:k.brand,deviceModel:k.model,osVersion:k.osVersion})}g.Ok("yt.mdx.remote.remoteClient_",c);O&&(R0u(M),aUK(M));c=M.X.IW()&&isNaN(M.U);O==c?O&&(iJ(M,1),q_(M,"getSubtitlesTrack")):O?(M.FK()&&M.S.reset(),iJ(M,1),q_(M,"getNowPlaying"),JxD(M)):M.sf(1)},sDA=function(M,O){var c=O.params.videoId; delete O.params.videoId;c==M.S.videoId&&(g.XI(O.params)?M.S.trackData=null:M.S.trackData=O.params,M.publish("remotePlayerChange"))},H5D=function(M,O,c){var k=O.params.videoId||O.params.video_id,I=parseInt(O.params.currentIndex,10); M.S.listId=O.params.listId||M.S.listId;yX(M.S,k,I);M.publish("remoteQueueChange",c)},B$D=function(M,O){O.params=O.params||{}; H5D(M,O,"NOW_PLAYING_MAY_CHANGE");e01(M,O);M.publish("autoplayDismissed")},e01=function(M,O){var c=parseInt(O.params.currentTime||O.params.current_time,10); o$(M.S,isNaN(c)?0:c);c=parseInt(O.params.state,10);c=isNaN(c)?-1:c;c==-1&&M.S.playerState==-1E3&&(c=-1E3);M.S.playerState=c;c=Number(O.params.loadedTime);M.S.K=isNaN(c)?0:c;M.S.vv(Number(O.params.duration));c=M.S;var k=Number(O.params.liveIngestionTime);c.S=k;c.L=isNaN(k)?!1:!0;c=M.S;k=Number(O.params.seekableStartTime);O=Number(O.params.seekableEndTime);c.X=isNaN(k)?0:k;c.W=isNaN(O)?0:O;M.S.playerState==1?N$k(M):rxe(M);M.publish("remotePlayerChange")},z0u=function(M,O){if(M.S.playerState!=-1E3){var c= 1085; switch(parseInt(O.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}M.S.playerState=c;O=parseInt(O.params.currentTime,10);o$(M.S,isNaN(O)?0:O);M.publish("remotePlayerChange")}},Z51=function(M,O){var c=O.params.muted=="true"; M.S.volume=parseInt(O.params.volume,10);M.S.muted=c;M.publish("remotePlayerChange")},Sf0=function(M,O){M.W=O.params.videoId; M.publish("nowAutoplaying",parseInt(O.params.timeout,10))},PqL=function(M,O){M.W=O.params.videoId||null; M.publish("autoplayUpNext",M.W)},oke=function(M,O){M.J=O.params.autoplayMode; M.publish("autoplayModeChange",M.J);M.J=="DISABLED"&&M.publish("autoplayDismissed")},EkJ=function(M,O){var c=O.params.hasNext=="true"; M.S.tF=O.params.hasPrevious=="true";M.S.EE=c;M.publish("previousNextChange")},gkK=function(M,O){O=O.message; O.params?mJ("Received: action="+O.action+", params="+g.EF(O.params)):mJ("Received: action="+O.action+" {}");switch(O.action){case "loungeStatus":O=kg(O.params.devices);M.Y=g.Fh(O,function(k){return new u5(k)}); O=!!g.R1(M.Y,function(k){return k.type=="LOUNGE_SCREEN"}); WpD(M,O);O=M.FJ("mlm");M.publish("multiStateLoopEnabled",O);break;case "loungeScreenDisconnected":g.B4(M.Y,function(k){return k.type=="LOUNGE_SCREEN"}); WpD(M,!1);break;case "remoteConnected":var c=new u5(kg(O.params.device));g.R1(M.Y,function(k){return k.equals(c)})||QSD(M.Y,c); break;case "remoteDisconnected":c=new u5(kg(O.params.device));g.B4(M.Y,function(k){return k.equals(c)}); break;case "gracefulDisconnect":break;case "playlistModified":H5D(M,O,"QUEUE_MODIFIED");break;case "nowPlaying":B$D(M,O);break;case "onStateChange":e01(M,O);break;case "onAdStateChange":z0u(M,O);break;case "onVolumeChanged":Z51(M,O);break;case "onSubtitlesTrackChanged":sDA(M,O);break;case "nowAutoplaying":Sf0(M,O);break;case "autoplayDismissed":M.publish("autoplayDismissed");break;case "autoplayUpNext":PqL(M,O);break;case "onAutoplayModeChanged":oke(M,O);break;case "onHasPreviousNextChanged":EkJ(M, O);break;case "requestAssistedSignIn":M.publish("assistedSignInRequested",O.params.authCode);break;case "onLoopModeChanged":M.publish("loopModeChange",O.params.loopMode);break;default:mJ("Unrecognized action: "+O.action)}},JxD=function(M){g.jv(M.T); M.T=g.tL(function(){M.sf(1)},864E5)},q_=function(M,O,c){c?mJ("Sending: action="+O+", params="+g.EF(c)):mJ("Sending: action="+O); M.X.sendMessage(O,c)},yxL=function(M){UK.call(this,"ScreenServiceProxy"); this.OZ=M;this.S=[];this.S.push(this.OZ.$_s("screenChange",(0,g.uD)(this.xt,this)));this.S.push(this.OZ.$_s("onlineScreenChange",(0,g.uD)(this.J$c,this)))},$3D=function(M,O){Qwu(); if(!Kx||!Kx.get("yt-remote-disable-remote-module-for-dev")){O=g.Q5("MDX_CONFIG")||O;eOK();SiL();xa||(xa=new Yg(O?O.loungeApiHost:void 0),d8A()&&(xa.S="/api/loungedev"));h3||(h3=g.c4("yt.mdx.remote.deferredProxies_")||[],g.Ok("yt.mdx.remote.deferredProxies_",h3));QD1();var c=L4();if(!c){var k=new XU(xa,O?O.disableAutomaticScreenCache||!1:!1);g.Ok("yt.mdx.remote.screenService_",k);c=L4();var I={};O&&(I={appId:O.appId,disableDial:O.disableDial,theme:O.theme,loadCastApiSetupScript:O.loadCastApiSetupScript, disableCastApi:O.disableCastApi,enableDialLoungeToken:O.enableDialLoungeToken,enableCastLoungeToken:O.enableCastLoungeToken,forceMirroring:O.forceMirroring});g.Ok("yt.mdx.remote.enableConnectWithInitialState_",O?O.enableConnectWithInitialState||!1:!1);O5J(M,k,function(b){b?Ya()&&ZJ(Ya(),"YouTube TV"):k.subscribe("onlineScreenChange",function(){gz("yt-remote-receiver-availability-change")})},I)}O&&!g.c4("yt.mdx.remote.initialized_")&&(g.Ok("yt.mdx.remote.initialized_",!0),My("Initializing: "+g.EF(O)), OP.push(g.xH("yt-remote-cast2-api-ready",function(){gz("yt-remote-api-ready")})),OP.push(g.xH("yt-remote-cast2-availability-change",function(){gz("yt-remote-receiver-availability-change")})),OP.push(g.xH("yt-remote-cast2-receiver-selected",function(){cq(null); gz("yt-remote-auto-connect","cast-selector-receiver")})),OP.push(g.xH("yt-remote-cast2-receiver-resumed",function(){gz("yt-remote-receiver-resumed","cast-selector-receiver")})),OP.push(g.xH("yt-remote-cast2-session-change",d30)),OP.push(g.xH("yt-remote-connection-change",function(b){b?ZJ(Ya(),"YouTube TV"):kQ()||(ZJ(null,null),b5J())})),OP.push(g.xH("yt-remote-cast2-session-failed",function(){gz("yt-remote-connection-failed")})),M=CqL(),O.isAuto&&(M.id+="#dial"),I=O.capabilities||[],I.length>0&&(M.capabilities= I),M.name=O.device,M.app=O.app,(O=O.theme)&&(M.theme=O),My(" -- with channel params: "+g.EF(M)),M?(g.H3("yt-remote-session-app",M.app),g.H3("yt-remote-session-name",M.name)):(g.B3("yt-remote-session-app"),g.B3("yt-remote-session-name")),g.Ok("yt.mdx.remote.channelParams_",M),c.start(),Ya()||D3z())}},Vgu=function(){var M=L4().OZ.$_gos(); var O=IV();O&&bG()&&(HF4(M,O)||M.push(O));return swu(M)},fUD=function(){var M=T$D(); !M&&BB()&&IUk()&&(M={key:"cast-selector-receiver",name:IUk()});return M},T$D=function(){var M=Vgu(),O=IV(); O||(O=kQ());return g.R1(M,function(c){return O&&G7(O,c.key)?!0:!1})},IV=function(){var M=Ya(); if(!M)return null;var O=L4().B8();return Xr(O,M)},d30=function(M){My("remote.onCastSessionChange_: "+jO(M)); if(M){var O=IV();if(O&&O.id==M.id){if(ZJ(O.id,"YouTube TV"),M.idType=="shortLived"&&(M=M.token))vq&&(vq.token=M),(O=bG())&&O.Rb(M)}else O&&UP(),uG(M,1)}else bG()&&UP()},UP=function(){zs()?em().stopSession():HB("stopSession called before API ready."); var M=bG();M&&(M.disconnect(1),m3k(null))},i5L=function(){var M=bG(); return!!M&&M.getProxyState()!=3},My=function(M){cB("remote",M)},L4=function(){if(!Ax1){var M=g.c4("yt.mdx.remote.screenService_"); Ax1=M?new yxL(M):null}return Ax1},Ya=function(){return g.c4("yt.mdx.remote.currentScreenId_")},qf1=function(M){g.Ok("yt.mdx.remote.currentScreenId_",M)},x3D=function(){return g.c4("yt.mdx.remote.connectData_")},cq=function(M){g.Ok("yt.mdx.remote.connectData_",M)},bG=function(){return g.c4("yt.mdx.remote.connection_")},m3k=function(M){var O=bG(); cq(null);M||qf1("");g.Ok("yt.mdx.remote.connection_",M);h3&&(g.qu(h3,function(c){c(M)}),h3.length=0); O&&!M?gz("yt-remote-connection-change",!1):!O&&M&&gz("yt-remote-connection-change",!0)},kQ=function(){var M=g.zu(); if(!M)return null;var O=L4();if(!O)return null;O=O.B8();return Xr(O,M)},uG=function(M,O){Ya(); IV()&&IV();if(tk)vq=M;else{qf1(M.id);var c=g.c4("yt.mdx.remote.enableConnectWithInitialState_")||!1;M=new A3(xa,M,CqL(),c);M.connect(O,x3D());M.subscribe("beforeDisconnect",function(k){gz("yt-remote-before-disconnect",k)}); M.subscribe("beforeDispose",function(){bG()&&(bG(),m3k(null))}); M.subscribe("browserChannelAuthError",function(){var k=IV();k&&k.idType=="shortLived"&&(zs()?em().handleBrowserChannelAuthError():HB("refreshLoungeToken called before API ready."))}); m3k(M)}},D3z=function(){var M=kQ(); M?(My("Resume connection to: "+jO(M)),uG(M,0)):(px(),b5J(),My("Skipping connecting because no session screen found."))},QD1=function(){var M=CqL(); if(g.XI(M)){M=Fr();var O=g.e4("yt-remote-session-name")||"",c=g.e4("yt-remote-session-app")||"";M={device:"REMOTE_CONTROL",id:M,name:O,app:c,mdxVersion:3};M.authuser=String(g.Q5("SESSION_INDEX","0"));(O=g.Q5("DELEGATED_SESSION_ID"))&&(M.pageId=String(O));g.Ok("yt.mdx.remote.channelParams_",M)}},CqL=function(){return g.c4("yt.mdx.remote.channelParams_")||{}},YfA=function(M,O,c){g.d.call(this); var k=this;this.S=M;this.j=O;this.CA=c;this.events=new g.Rs(this);this.J=!1;this.U=new g.g7(64);this.X=new g.$q(this.n$,500,this);this.Y=new g.$q(this.W1,1E3,this);this.K=new RB(this.uoQ,0,this);this.L={};this.T=new g.$q(this.cw,1E3,this);this.W=new g.mK(this.seekTo,1E3,this);this.Sc=this.events.Z(this.j,"onVolumeChange",function(I){h04(k,I)}); g.C(this,this.events);this.events.Z(O,"onCaptionsTrackListChanged",this.eKY);this.events.Z(O,"captionschanged",this.wQy);this.events.Z(O,"captionssettingschanged",this.Tx);this.events.Z(O,"videoplayerreset",this.sB);this.events.Z(O,"mdxautoplaycancel",function(){k.CA.pk()}); O.B("enable_mdx_video_play_directly")&&this.events.Z(O,"videodatachange",function(){Lp0(k.S)||GG(k)||j3(k,0)}); M=this.CA;M.BQ();M.subscribe("proxyStateChange",this.e7,this);M.subscribe("remotePlayerChange",this.Vw,this);M.subscribe("remoteQueueChange",this.sB,this);M.subscribe("previousNextChange",this.iT,this);M.subscribe("nowAutoplaying",this.v6,this);M.subscribe("autoplayDismissed",this.Ea,this);g.C(this,this.X);g.C(this,this.Y);g.C(this,this.K);g.C(this,this.T);g.C(this,this.W);this.Tx();this.sB();this.Vw()},h04=function(M,O){if(GG(M)){M.CA.unsubscribe("remotePlayerChange",M.Vw,M); var c=Math.round(O.volume);O=!!O.muted;var k=C4(M.CA);if(c!==k.volume||O!==k.muted)M.CA.setVolume(c,O),M.T.start();M.CA.subscribe("remotePlayerChange",M.Vw,M)}},MkK=function(M){M.Og(0); M.X.stop();M.SD(new g.g7(64))},O_K=function(M,O){if(GG(M)&&!M.J){var c=null; O&&(c={style:M.j.getSubtitlesUserSettings()},Object.assign(c,O));M.CA.ai(M.j.getVideoData(1).videoId,c);M.L=C4(M.CA).trackData}},j3=function(M,O){var c=M.j.getPlaylist(); if(c==null?0:c.listId){var k=c.index;var I=c.listId.toString()}c=M.j.getVideoData(1);M.CA.playVideo(c.videoId,O,k,I,c.playerParams,c.pB,yw1(c));M.SD(new g.g7(1))},cUD=function(M,O){if(O){var c=M.j.getOption("captions","tracklist",{SB:1}); c&&c.length?(M.j.setOption("captions","track",O),M.J=!1):(M.j.loadModule("captions"),M.J=!0)}else M.j.setOption("captions","track",{})},GG=function(M){return C4(M.CA).videoId===M.j.getVideoData(1).videoId},kfk=function(M,O){g.qV.call(this,M); this.S=O},Xw=function(){g.f.call(this,{G:"div", V:"ytp-mdx-popup-dialog",D:{role:"dialog"},C:[{G:"div",V:"ytp-mdx-popup-dialog-inner-content",C:[{G:"div",V:"ytp-mdx-popup-title",l4:"You're signed out"},{G:"div",V:"ytp-mdx-popup-description",l4:"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."},{G:"div",V:"ytp-mdx-privacy-popup-buttons",C:[{G:"button",RO:["ytp-button","ytp-mdx-privacy-popup-cancel"],l4:"Cancel"},{G:"button",RO:["ytp-button", "ytp-mdx-privacy-popup-confirm"],l4:"Confirm"}]}]}]});this.fade=new g.qN(this,250);this.cancelButton=this.LB("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.LB("ytp-mdx-privacy-popup-confirm");g.C(this,this.fade);this.Z(this.cancelButton,"click",this.S);this.Z(this.confirmButton,"click",this.X)},lG=function(M){g.f.call(this,{G:"div", V:"ytp-remote",C:[{G:"div",V:"ytp-remote-display-status",C:[{G:"div",V:"ytp-remote-display-status-icon",C:[g.p3M()]},{G:"div",V:"ytp-remote-display-status-text",l4:"{{statustext}}"}]}]});this.api=M;this.fade=new g.qN(this,250);g.C(this,this.fade);this.Z(M,"presentingplayerstatechange",this.onStateChange);this.VM(M.getPlayerStateObject())},Fw=function(M,O){g.QZ.call(this,"Play on",1,M,O); this.j=M;this.ke={};this.Z(M,"onMdxReceiversChange",this.L);this.Z(M,"presentingplayerstatechange",this.L);this.L()},IjA=function(M){g.H0.call(this,M); this.oy={key:Wf1(),name:"This computer"};this.QD=null;this.subscriptions=[];this.nN=this.CA=null;this.ke=[this.oy];this.sx=this.oy;this.Du=new g.g7(64);this.bE=0;this.OY=-1;this.lj=!1;this.Ht=this.XC=this.c7=null;if(!g.kI(this.player.N())&&!g.zd(this.player.N())){M=this.player;var O=g.ZH(M);O&&(O=O.B_())&&(O=new Fw(M,O),g.C(this,O));O=new lG(M);g.C(this,O);g.xL(M,O.element,4);this.c7=new Xw;g.C(this,this.c7);g.xL(M,this.c7.element,4);this.lj=!!kQ()}},pm=function(M){M.XC&&(M.player.removeEventListener("presentingplayerstatechange", M.XC),M.XC=null)},b_1=function(M,O,c){M.Du=c; M.player.publish("presentingplayerstatechange",new g.vR(c,O))},Km=function(M,O){if(O.key!==M.sx.key)if(O.key===M.oy.key)UP(); else if(Lp0(M)&&vX0(M),M.sx=O,!M.player.N().B("disable_mdx_connection_in_mdx_module_for_music_web")||!g.zd(M.player.N())){var c=M.player.getPlaylistId();var k=M.player.getVideoData(1);var I=k.videoId;if(!c&&!I||(M.player.getAppState()===2||M.player.getAppState()===1)&&M.player.N().B("should_clear_video_data_on_player_cued_unstarted"))k=null;else{var b=M.player.getPlaylist();if(b){var v=[];for(var u=0;u2*this.size&&UQ(this),!0):!1}; g.w.get=function(M,O){return b5(this.X,M)?this.X[M]:O}; g.w.set=function(M,O){b5(this.X,M)||(this.size+=1,this.S.push(M),this.iK++);this.X[M]=O}; g.w.forEach=function(M,O){for(var c=this.vL(),k=0;k=k.S.length)return g.jE;var b=k.S[O++];return g.gs(M?b:k.X[b])}; return I}; var OF1={rc2:"atp",H0u:"ska",CzQ:"que",l22:"mus",O0u:"sus",mZf:"dsp",FaY:"seq",iSu:"mic",TW2:"dpa",sVQ:"mlm",AcQ:"dsdtr",oHQ:"ntb",UOu:"vsp",YFc:"scn",i0f:"rpe",ccQ:"dcn",vNB:"dcp",Pzh:"pas",NWb:"drq",RVh:"opf",fl2:"els",QK4:"isg",kbB:"svq",X82:"mvp",hw2:"ads",mHd:"stcp",RIY:"sads",D$y:"dloc",al4:"dcw",sc2:"asw",ewB:"apw"},cLu={jqQ:"u",d$h:"cl",EAO:"k",tMb:"i",nN2:"cr",QVb:"m",wPd:"g",kW:"up"},Cfz={L6:"adPlaying",XA:"onAdStateChange"},DOu={k5Q:"nowPlaying",qE4:"onStateChange",L6:"adPlaying",XA:"onAdStateChange", SV:"nowPlayingShorts",lQ:"onShortsStateChange"},$O4={SV:"nowPlayingShorts",lQ:"onShortsStateChange"};u5.prototype.equals=function(M){return M?this.id==M.id:!1}; var ZFJ="",Kx=null;g.n(CbJ,g.Sq);var wz,AL1=$8D("loadCastFramework")||$8D("loadCastApplicationFramework"),hOJ=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.lD(RB,g.d);g.w=RB.prototype;g.w.jo=function(M){this.L=arguments;this.S=!1;this.Kw?this.Y=g.j1()+this.lU:this.Kw=g.ZR(this.J,this.lU)}; g.w.stop=function(){this.Kw&&(g.Yl.clearTimeout(this.Kw),this.Kw=null);this.Y=null;this.S=!1;this.L=[]}; g.w.pause=function(){++this.X}; g.w.resume=function(){this.X&&(--this.X,!this.X&&this.S&&(this.S=!1,this.U.apply(null,this.L)))}; g.w.Q2=function(){this.stop();RB.fl.Q2.call(this)}; g.w.ou=function(){this.Kw&&(g.Yl.clearTimeout(this.Kw),this.Kw=null);this.Y?(this.Kw=g.ZR(this.J,this.Y-g.j1()),this.Y=null):this.X?this.S=!0:(this.S=!1,this.U.apply(null,this.L))};aB.prototype.stringify=function(M){return g.Yl.JSON.stringify(M,void 0)}; aB.prototype.parse=function(M){return g.Yl.JSON.parse(M,void 0)};g.lD(Yi0,g.V6);g.lD(M41,g.V6);var OwK=null;g.lD(kuD,g.V6);g.lD(Iyk,g.V6);g.lD(bw1,g.V6);WI.prototype.debug=function(){}; WI.prototype.info=function(){}; WI.prototype.warning=function(){};var lye={},X31={};g.w=sQ.prototype;g.w.setTimeout=function(M){this.Au=M}; g.w.kt=function(M){M=M.target;var O=this.cQ;O&&g.$s(M)==3?O.X5():this.Mq(M)}; g.w.Mq=function(M){try{if(M==this.S)a:{var O=g.$s(this.S),c=this.S.X,k=this.S.getStatus();if(!(O<3)&&(O!=3||this.S&&(this.X.Y||g.TC(this.S)||g.f7(this.S)))){this.wy||O!=4||c==7||(c==8||k<=0?rz(3):rz(2));KAu(this);var I=this.S.getStatus();this.Xv=I;var b=jFK(this);if(this.U=I==200){if(this.l5&&!this.HQ){b:{if(this.S){var v=g.mi(this.S,"X-HTTP-Initial-Response");if(v&&!g.BD(v)){var u=v;break b}}u=null}if(M=u)this.HQ=!0,WAD(this,M);else{this.U=!1;this.J=3;N5(12);eO(this);BI(this);break a}}if(this.jc){M= !0;for(var t;!this.wy&&this.W0&&!this.kc&&(this.kc=!0,this.Y.yb(this)):(eO(this),BI(this))}else WAD(this,b);O==4&&eO(this);this.U&&!this.wy&&(O==4?g9A(this.Y,this):(this.U=!1,HI(this)))}else g.rDk(this.S),I==400&&b.indexOf("Unknown SID")> 0?(this.J=3,N5(12)):(this.J=0,N5(13)),eO(this),BI(this)}}}catch(G){}finally{}}; g.w.cancel=function(){this.wy=!0;eO(this)}; g.w.UN=function(){this.Sc=null;var M=Date.now();M-this.a5>=0?(this.Mo!=2&&(rz(3),N5(17)),eO(this),this.J=2,BI(this)):p3K(this,this.a5-M)}; g.w.getLastError=function(){return this.J}; g.w.hj=function(){return this.S};HwD.prototype.cancel=function(){this.Y=BhL(this);if(this.X)this.X.cancel(),this.X=null;else if(this.S&&this.S.size!==0){for(var M=g.a(this.S.values()),O=M.next();!O.done;O=M.next())O.value.cancel();this.S.clear()}};g.w=Ph0.prototype;g.w.O_=8;g.w.fW=1;g.w.connect=function(M,O,c,k){N5(0);this.Hd=M;this.wy=O||{};c&&k!==void 0&&(this.wy.OSID=c,this.wy.OAID=k);this.HQ=this.nA;this.pB=r4e(this,null,this.Hd);PI(this)}; g.w.disconnect=function(){E9D(this);if(this.fW==3){var M=this.vQ++,O=this.pB.clone();g.Iu(O,"SID",this.L);g.Iu(O,"RID",M);g.Iu(O,"TYPE","terminate");yQ(this,O);M=new sQ(this,this.L,M);M.Mo=2;M.K=OQ(O.clone());O=!1;if(g.Yl.navigator&&g.Yl.navigator.sendBeacon)try{O=g.Yl.navigator.sendBeacon(M.K.toString(),"")}catch(c){}!O&&g.Yl.Image&&((new Image).src=M.K,O=!0);O||(M.S=t4K(M.Y,null),M.S.send(M.K));M.Y2=Date.now();HI(M)}$AJ(this)}; g.w.Qc=function(){return this.fW==0}; g.w.getState=function(){return this.fW}; g.w.H0=function(M){if(this.U)if(this.U=null,this.fW==1){if(!M){this.vQ=Math.floor(Math.random()*1E5);M=this.vQ++;var O=new sQ(this,"",M),c=this.T;this.Xv&&(c?(c=g.pc(c),g.gi(c,this.Xv)):c=this.Xv);this.W!==null||this.a5||(O.pB=c,c=null);var k;if(this.SL)a:{for(var I=k=0;I4096){k=I;break a}if(k===4096||I===this.Y.length-1){k=I+1;break a}}k= 1E3}else k=1E3;k=dAL(this,O,k);I=this.pB.clone();g.Iu(I,"RID",M);g.Iu(I,"CVER",22);this.jc&&g.Iu(I,"X-HTTP-Session-Id",this.jc);yQ(this,I);c&&(this.a5?k="headers="+g.sm(g.fNl(c))+"&"+k:this.W&&g.uW(I,this.W,c));ay4(this.X,O);this.WC&&g.Iu(I,"TYPE","init");this.SL?(g.Iu(I,"$req",k),g.Iu(I,"SID","null"),O.l5=!0,uTA(O,I,null)):uTA(O,I,k);this.fW=2}}else this.fW==3&&(M?Chz(this,M):this.Y.length==0||eS0(this.X)||Chz(this))}; g.w.E_=function(){this.K=null;DAz(this);if(this.m0&&!(this.Au||this.S==null||this.wG<=0)){var M=2*this.wG;this.oO=Jc((0,g.uD)(this.bB4,this),M)}}; g.w.bB4=function(){this.oO&&(this.oO=null,this.HQ=!1,this.Au=!0,N5(10),Z9(this),DAz(this))}; g.w.yb=function(M){this.S==M&&this.m0&&!this.Au&&(o90(this),this.Au=!0,N5(11))}; g.w.J2=function(){this.Sc!=null&&(this.Sc=null,Z9(this),n9k(this),N5(19))}; g.w.FM2=function(M){M?N5(2):N5(1)}; g.w.isActive=function(){return!!this.J&&this.J.isActive(this)}; g.w=ThA.prototype;g.w.u3=function(){}; g.w.IZ=function(){}; g.w.zy=function(){}; g.w.P0=function(){}; g.w.isActive=function(){return!0}; g.w.d4=function(){};g.lD(dz,g.UF);dz.prototype.open=function(){this.S.J=this.Y;this.U&&(this.S.Mo=!0);this.S.connect(this.J,this.X||void 0)}; dz.prototype.close=function(){this.S.disconnect()}; dz.prototype.send=function(M){var O=this.S;if(typeof M==="string"){var c={};c.__data__=M;M=c}else this.L&&(c={},c.__data__=g.EF(M),M=c);O.Y.push(new sFK(O.ac++,M));O.fW==3&&PI(O)}; dz.prototype.Q2=function(){this.S.J=null;delete this.Y;this.S.disconnect();delete this.S;dz.fl.Q2.call(this)}; g.lD(mA1,Yi0);g.lD(iw1,M41);g.lD(QQ,ThA);QQ.prototype.u3=function(){this.S.dispatchEvent("m")}; QQ.prototype.IZ=function(M){this.S.dispatchEvent(new mA1(M))}; QQ.prototype.zy=function(M){this.S.dispatchEvent(new iw1(M))}; QQ.prototype.P0=function(){this.S.dispatchEvent("n")};var D9=new g.UF;g.n(xAA,g.V6);g.w=VQ.prototype;g.w.XL=null;g.w.xf=!1;g.w.bL=null;g.w.al=null;g.w.oY=null;g.w.CC=null;g.w.FQ=null;g.w.Ag=null;g.w.QW=null;g.w.BP=null;g.w.rI=0;g.w.k5=null;g.w.TC=null;g.w.lK=null;g.w.jE=-1;g.w.L$=!0;g.w.G7=!1;g.w.iW=0;g.w.NL=null;var c11={},Oy4={};g.w=VQ.prototype;g.w.setTimeout=function(M){this.X=M}; g.w.q3=function(M){M=M.target;var O=this.NL;O&&g.$s(M)==3?O.X5():this.nF(M)}; g.w.nF=function(M){try{if(M==this.BP)a:{var O=g.$s(this.BP),c=this.BP.X,k=this.BP.getStatus();if(g.u9&&!g.Cr("420+")){if(O<4)break a}else if(O<3||O==3&&!g.TC(this.BP))break a;this.G7||O!=4||c==7||(c==8||k<=0?this.S.iJ(3):this.S.iJ(2));by4(this);var I=this.BP.getStatus();this.jE=I;var b=g.TC(this.BP);if(this.xf=I==200){O==4&&T7(this);if(this.jc){for(M=!0;!this.G7&&this.rI0?(this.lK=3,$g(13)):(this.lK=0,$g(14)),T7(this),vJ1(this)}}catch(u){}finally{}}; g.w.cancel=function(){this.G7=!0;T7(this)}; g.w.Ru=function(){this.bL=null;var M=Date.now();M-this.al>=0?(this.CC!=2&&this.S.iJ(3),T7(this),this.lK=2,$g(18),vJ1(this)):IAL(this,this.al-M)}; g.w.getLastError=function(){return this.lK};g.w=GOD.prototype;g.w.t6=null;g.w.LS=null;g.w.PO=!1;g.w.h6=null;g.w.ao=null;g.w.Q5=-1;g.w.td=null;g.w.o2=null;g.w.connect=function(M){this.h6=M;M=mq(this.S,null,this.h6);$g(3);Date.now();var O=this.S.T;O!=null?(this.td=O[0],(this.o2=O[1])?(this.ao=1,jlJ(this)):(this.ao=2,XoD(this))):(cI(M,"MODE","init"),this.LS=new VQ(this),this.LS.XL=this.t6,Yj4(this.LS,M,!1,null,!0),this.ao=0)}; g.w.i$=function(M){if(M)this.ao=2,XoD(this);else{$g(4);var O=this.S;O.RP=O.hO.Q5;xg(O,9)}M&&this.iJ(2)}; g.w.rV=function(M){return this.S.rV(M)}; g.w.abort=function(){this.LS&&(this.LS.cancel(),this.LS=null);this.Q5=-1}; g.w.Qc=function(){return!1}; g.w.W0=function(M,O){this.Q5=M.jE;if(this.ao==0)if(O){try{var c=this.X.parse(O)}catch(k){M=this.S;M.RP=this.Q5;xg(M,2);return}this.td=c[0];this.o2=c[1]}else M=this.S,M.RP=this.Q5,xg(M,2);else this.ao==2&&(this.PO?($g(7),Date.now()):O=="11111"?($g(6),this.PO=!0,Date.now(),this.Q5=200,this.LS.cancel(),$g(12),i5(this.S,this,!0)):($g(8),Date.now(),this.PO=!1))}; g.w.SF=function(){this.Q5=this.LS.jE;if(this.LS.xf)this.ao==0?this.o2?(this.ao=1,jlJ(this)):(this.ao=2,XoD(this)):this.ao==2&&(this.PO?($g(12),i5(this.S,this,!0)):($g(11),i5(this.S,this,!1)));else{this.ao==0?$g(9):this.ao==2&&$g(10);var M=this.S;this.LS.getLastError();M.RP=this.Q5;xg(M,2)}}; g.w.UK=function(){return this.S.UK()}; g.w.isActive=function(){return this.S.isActive()}; g.w.iJ=function(M){this.S.iJ(M)};g.w=lAJ.prototype;g.w.SA=null;g.w.kh=null;g.w.qX=null;g.w.UZ=null;g.w.sX=null;g.w.Sa=null;g.w.mz=null;g.w.eF=null;g.w.JL=0;g.w.w4=0;g.w.YN=null;g.w.V0=null;g.w.f5=null;g.w.La=null;g.w.hO=null;g.w.Ij=null;g.w.MG=-1;g.w.xJ=-1;g.w.RP=-1;g.w.Bx=0;g.w.wv=0;g.w.YB=8;var UBD={OK:0,hI4:2,cRf:4,Js2:5,GgY:6,STOP:7,ri:8,eeO:9,tx2:10,heO:11,Xj4:12};g.lD(pou,g.V6);g.lD(KMk,g.V6);g.w=lAJ.prototype; g.w.connect=function(M,O,c,k,I){$g(0);this.sX=O;this.kh=c||{};k&&I!==void 0&&(this.kh.OSID=k,this.kh.OAID=I);this.K?(Cx((0,g.uD)(this.hW,this,M),100),woK(this)):this.hW(M)}; g.w.disconnect=function(){nJA(this);if(this.S==3){var M=this.JL++,O=this.Sa.clone();g.Iu(O,"SID",this.L);g.Iu(O,"RID",M);g.Iu(O,"TYPE","terminate");q5(this,O);M=new VQ(this,this.L,M);M.CC=2;M.FQ=OQ(O.clone());(new Image).src=M.FQ.toString();M.oY=Date.now();Mru(M)}BRu(this)}; g.w.hW=function(M){this.hO=new GOD(this);this.hO.t6=this.SA;this.hO.X=this.J;this.hO.connect(M)}; g.w.Qc=function(){return this.S==0}; g.w.getState=function(){return this.S}; g.w.Z5=function(M){this.V0=null;J14(this,M)}; g.w.Vf=function(){this.f5=null;this.UZ=new VQ(this,this.L,"rpc",this.W);this.UZ.XL=this.SA;this.UZ.iW=0;var M=this.mz.clone();g.Iu(M,"RID","rpc");g.Iu(M,"SID",this.L);g.Iu(M,"CI",this.Ij?"0":"1");g.Iu(M,"AID",this.MG);q5(this,M);g.Iu(M,"TYPE","xmlhttp");Yj4(this.UZ,M,!0,this.eF,!1)}; g.w.W0=function(M,O){if(this.S!=0&&(this.UZ==M||this.qX==M))if(this.RP=M.jE,this.qX==M&&this.S==3)if(this.YB>7){try{var c=this.J.parse(O)}catch(k){c=null}if(Array.isArray(c)&&c.length==3)if(M=c,M[0]==0)a:{if(!this.f5){if(this.UZ)if(this.UZ.oY+3E30)){if(k=O==1)this.qX||this.V0||this.S==1||this.Bx>=2?k=!1:(this.V0=Cx((0,g.uD)(this.Z5,this,M),sle(this,this.Bx)),this.Bx++, k=!0);k=!(k||O==2&&Hy1(this))}if(k)switch(c){case 1:xg(this,5);break;case 4:xg(this,10);break;case 3:xg(this,6);break;case 7:xg(this,12);break;default:xg(this,2)}}}; g.w.bI=function(M){if(!g.rK(arguments,this.S))throw Error("Unexpected channel state: "+this.S);}; g.w.LM2=function(M){M?$g(2):($g(1),ee1(this,8))}; g.w.rV=function(M){if(M)throw Error("Can't create secondary domain capable XhrIo object.");M=new g.dQ;M.W=!1;return M}; g.w.isActive=function(){return!!this.YN&&this.YN.isActive(this)}; g.w.iJ=function(M){var O=D9;O.dispatchEvent(new KMk(O,M))}; g.w.UK=function(){return!1}; g.w=zeD.prototype;g.w.v0=function(){}; g.w.KF=function(){}; g.w.D5=function(){}; g.w.yf=function(){}; g.w.Xs=function(){}; g.w.Nq=function(){return{}}; g.w.isActive=function(){return!0};g.w=Zy1.prototype;g.w.enqueue=function(M){this.X.push(M)}; g.w.isEmpty=function(){return this.S.length===0&&this.X.length===0}; g.w.clear=function(){this.S=[];this.X=[]}; g.w.contains=function(M){return g.rK(this.S,M)||g.rK(this.X,M)}; g.w.remove=function(M){var O=this.S;var c=(0,g.t11)(O,M);c>=0?(g.Nu(O,c),O=!0):O=!1;return O||g.JA(this.X,M)}; g.w.wm=function(){for(var M=[],O=this.S.length-1;O>=0;--O)M.push(this.S[O]);O=this.X.length;for(var c=0;c=u91.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(M=u91[this.X],this.Kw=g.tL((0,g.uD)(this.HU,this),M),this.X++):this.publish("pairingFailed",Error("Server error "+M.status))}; g.w.zr=function(){this.S=null;this.publish("pairingFailed",Error("Server not responding"))}; var u91=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.lD(t3,UK);g.w=t3.prototype;g.w.start=function(){uJ(this)&&this.publish("screenChange");!g.e4("yt-remote-lounge-token-expiration")&&XTe(this);g.jv(this.S);this.S=g.tL((0,g.uD)(this.start,this),1E4)}; g.w.add=function(M,O){uJ(this);ud4(this,M);Gs(this,!1);this.publish("screenChange");O(M);M.token||XTe(this)}; g.w.remove=function(M,O){var c=uJ(this);GZD(this,M)&&(Gs(this,!1),c=!0);O(M);c&&this.publish("screenChange")}; g.w.PG=function(M,O,c,k){var I=uJ(this),b=this.get(M.id);b?(b.name!=O&&(b.name=O,Gs(this,!1),I=!0),c(M)):k(Error("no such local screen."));I&&this.publish("screenChange")}; g.w.Q2=function(){g.jv(this.S);t3.fl.Q2.call(this)}; g.w.J7=function(M){uJ(this);var O=this.screens.length;M=M&&M.screens||[];for(var c=M.length,k=0;k20)break a;u=O(b,v)}b=u}I.name=b}c(lJ(this,I))},this), onError:(0,g.uD)(function(I){k(Error("pairing request failed: "+I.status))},this), onTimeout:(0,g.uD)(function(){k(Error("pairing request timed out."))},this)})}; g.w.Q2=function(){g.Y$(this.X);g.Y$(this.S);XU.fl.Q2.call(this)}; g.w.HD=function(){JCL(this);this.publish("screenChange");this.S.update()}; XU.prototype.dispose=XU.prototype.dispose;g.lD(FU,g.MN);g.w=FU.prototype;g.w.vP=function(M){this.BQ()||(M&&(K4(this,""+M),this.publish("sessionFailed")),this.S=null,this.publish("sessionScreen",null))}; g.w.info=function(M){cB(this.jc,M)}; g.w.Ty=function(){return null}; g.w.HS=function(M){var O=this.X;M?(O.displayStatus=new chrome.cast.ReceiverDisplayStatus(M,[]),O.displayStatus.showStop=!0):O.displayStatus=null;chrome.cast.setReceiverDisplayStatus(O,(0,g.uD)(function(){this.info("Updated receiver status for "+O.friendlyName+": "+M)},this),(0,g.uD)(function(){K4(this,"Failed to update receiver status for: "+O.friendlyName)},this))}; g.w.Q2=function(){this.HS("");FU.fl.Q2.call(this)};g.n(ge,FU);g.w=ge.prototype;g.w.Oz=function(M){if(this.Y){if(this.Y==M)return;K4(this,"Overriding cast session with new session object");yCL(this);this.Y2=!1;this.T="unknown";this.Y.removeUpdateListener(this.s2);this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.oO)}this.Y=M;this.Y.addUpdateListener(this.s2);this.Y.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.oO);ZLK(this,"getMdxSessionStatus")}; g.w.Qh=function(M){this.info("launchWithParams no-op for Cast: "+g.EF(M))}; g.w.stop=function(){this.Y?this.Y.stop((0,g.uD)(function(){this.vP()},this),(0,g.uD)(function(){this.vP(Error("Failed to stop receiver app."))},this)):this.vP(Error("Stopping cast device without session."))}; g.w.HS=function(){}; g.w.Q2=function(){this.info("disposeInternal");yCL(this);this.Y&&(this.Y.removeUpdateListener(this.s2),this.Y.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.oO));this.Y=null;FU.prototype.Q2.call(this)}; g.w.YL2=function(M,O){if(!this.BQ())if(O)if(O=kg(O),g.bD(O))switch(M=""+O.type,O=O.data||{},this.info("onYoutubeMessage_: "+M+" "+g.EF(O)),M){case "mdxSessionStatus":eA4(this,O);break;case "loungeToken":Sez(this,O);break;default:K4(this,"Unknown youtube message: "+M)}else K4(this,"Unable to parse message.");else K4(this,"No data in message.")}; g.w.pQ=function(M,O,c,k){g.jv(this.K);this.K=0;adz(this.L,this.X.label,M,this.X.friendlyName,(0,g.uD)(function(I){I?O(I):k>=0?(K4(this,"Screen "+M+" appears to be offline. "+k+" retries left."),this.K=g.tL((0,g.uD)(this.pQ,this,M,O,c,k-1),300)):c(Error("Unable to fetch screen."))},this),c)}; g.w.Ty=function(){return this.Y}; g.w.g4=function(M){this.BQ()||M||(K4(this,"Cast session died."),this.vP())};g.n(we,FU);g.w=we.prototype;g.w.Oz=function(M){this.Y=M;this.Y.addUpdateListener(this.wy)}; g.w.Qh=function(M){this.pB=M;this.Sc()}; g.w.stop=function(){fdD(this);this.Y?this.Y.stop((0,g.uD)(this.vP,this,null),(0,g.uD)(this.vP,this,"Failed to stop DIAL device.")):this.vP()}; g.w.Q2=function(){fdD(this);this.Y&&this.Y.removeUpdateListener(this.wy);this.Y=null;FU.prototype.Q2.call(this)}; g.w.uI=function(M){this.BQ()||M||(K4(this,"DIAL session died."),this.J(),this.J=function(){},this.vP())};g.n(a$,FU);a$.prototype.stop=function(){this.vP()}; a$.prototype.Oz=function(){}; a$.prototype.Qh=function(){g.jv(this.Y);this.Y=NaN;var M=Xr(this.L.B8(),this.X.label);M?p4(this,M):this.vP(Error("No such screen"))}; a$.prototype.Q2=function(){g.jv(this.Y);this.Y=NaN;FU.prototype.Q2.call(this)};g.n(re,g.MN);g.w=re.prototype; g.w.init=function(M,O){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.K,[chrome.cast.Capability.AUDIO_OUT]);g.Ft("desktop_enable_cast_connect")&&(c.androidReceiverCompatible=!0);this.T||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var k=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;M=M||this.U?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var I=(0,g.uD)(this.Uub,this);c=new chrome.cast.ApiConfig(c,(0,g.uD)(this.Xi, this),I,k,M);c.customDialLaunchCallback=(0,g.uD)(this.moO,this);chrome.cast.initialize(c,(0,g.uD)(function(){this.BQ()||(chrome.cast.addReceiverActionListener(this.J),Ide(),this.X.subscribe("onlineScreenChange",(0,g.uD)(this.i6,this)),this.Y=AC1(this),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.uD)(function(b){this.d9("Failed to set initial custom receivers: "+g.EF(b))},this)),this.publish("yt-remote-cast2-availability-change",J3(this)),O(!0))},this),(0,g.uD)(function(b){this.d9("Failed to initialize API: "+ g.EF(b)); O(!1)},this))}; g.w.MpO=function(M,O){N_("Setting connected screen ID: "+M+" -> "+O);if(this.S){var c=this.S.S;if(!M||c&&c.id!=M)N_("Unsetting old screen status: "+this.S.X.friendlyName),WB(this,null)}if(M&&O){if(!this.S){M=Xr(this.X.B8(),M);if(!M){N_("setConnectedScreenStatus: Unknown screen.");return}if(M.idType=="shortLived"){N_("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=mG4(this,M);c||(N_("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(M.uuid? M.uuid:M.id,M.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Y.push(c),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.uD)(function(k){this.d9("Failed to set initial custom receivers: "+g.EF(k))},this))); N_("setConnectedScreenStatus: new active receiver: "+c.friendlyName);WB(this,new a$(this.X,c),!0)}this.S.HS(O)}else N_("setConnectedScreenStatus: no screen.")}; g.w.PAY=function(M){this.BQ()?this.d9("Setting connection data on disposed cast v2"):this.S?this.S.Qh(M):this.d9("Setting connection data without a session")}; g.w.Wp=function(){this.BQ()?this.d9("Stopping session on disposed cast v2"):this.S?(this.S.stop(),WB(this,null)):N_("Stopping non-existing session")}; g.w.requestSession=function(){chrome.cast.requestSession((0,g.uD)(this.Xi,this),(0,g.uD)(this.muO,this))}; g.w.Q2=function(){this.X.unsubscribe("onlineScreenChange",(0,g.uD)(this.i6,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.J);var M=OLJ,O=g.c4("yt.mdx.remote.debug.handlers_");g.JA(O||[],M);g.Y$(this.S);g.MN.prototype.Q2.call(this)}; g.w.d9=function(M){cB("Controller",M)}; g.w.Qj=function(M,O){this.S==M&&(O||WB(this,null),this.publish("yt-remote-cast2-session-change",O))}; g.w.GPY=function(M,O){if(!this.BQ())if(M)switch(M.friendlyName=chrome.cast.unescape(M.friendlyName),N_("onReceiverAction_ "+M.label+" / "+M.friendlyName+"-- "+O),O){case chrome.cast.ReceiverAction.CAST:if(this.S)if(this.S.X.label!=M.label)N_("onReceiverAction_: Stopping active receiver: "+this.S.X.friendlyName),this.S.stop();else{N_("onReceiverAction_: Casting to active receiver.");this.S.S&&this.publish("yt-remote-cast2-session-change",this.S.S);break}switch(M.receiverType){case chrome.cast.ReceiverType.CUSTOM:WB(this, new a$(this.X,M));break;case chrome.cast.ReceiverType.DIAL:WB(this,new we(this.X,M,this.L,this.config_));break;case chrome.cast.ReceiverType.CAST:WB(this,new ge(this.X,M,this.config_));break;default:this.d9("Unknown receiver type: "+M.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.S&&this.S.X.label==M.label?this.S.stop():this.d9("Stopping receiver w/o session: "+M.friendlyName)}else this.d9("onReceiverAction_ called without receiver.")}; g.w.moO=function(M){if(this.BQ())return Promise.reject(Error("disposed"));var O=M.receiver;O.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.d9("Not DIAL receiver: "+O.friendlyName),O.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.S?this.S.X:null;if(!c||c.label!=O.label)return this.d9("Receiving DIAL launch request for non-clicked DIAL receiver: "+O.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==O.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.S.S)return N_("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.S.S),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.d9('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+O.friendlyName);WB(this,new we(this.X,O,this.L,this.config_))}O=this.S;O.K=M;O.K.appState==chrome.cast.DialAppState.RUNNING?(M=O.K.extraData||{},c=M.screenId||null,n4(O)&&M.loungeToken?M.loungeTokenRefreshIntervalMs?M=$Gz(O,{name:O.X.friendlyName,screenId:M.screenId,loungeToken:M.loungeToken,dialId:O.K.receiver.label, screenIdType:"shortLived"},M.loungeTokenRefreshIntervalMs):(g.f8(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(M)+".")),M=V$0(O,c)):M=V$0(O,c)):M=C_z(O);return M}; g.w.Xi=function(M){var O=this;if(!this.BQ()&&!this.U){N_("New cast session ID: "+M.sessionId);var c=M.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.S)if(c.receiverType==chrome.cast.ReceiverType.CAST)N_("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),WB(this,new ge(this.X,c,this.config_),!0);else{this.d9("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var k=this.S.X,I=Xr(this.X.B8(), k.label);I&&G7(I,c.label)&&k.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(N_("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.Y$(this.S),this.S=new ge(this.X,c,this.config_),this.S.subscribe("sessionScreen",(0,g.uD)(this.Qj,this,this.S)),this.S.subscribe("sessionFailed",function(){return iLD(O,O.S)}),this.S.Qh(null)); this.S.Oz(M)}}}; g.w.nt=function(){return this.S?this.S.Ty():null}; g.w.muO=function(M){this.BQ()||(this.d9("Failed to estabilish a session: "+g.EF(M)),M.code!=chrome.cast.ErrorCode.CANCEL&&WB(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.w.Uub=function(M){N_("Receiver availability updated: "+M);if(!this.BQ()){var O=J3(this);this.W=M==chrome.cast.ReceiverAvailability.AVAILABLE;J3(this)!=O&&this.publish("yt-remote-cast2-availability-change",J3(this))}}; g.w.i6=function(){this.BQ()||(this.Y=AC1(this),N_("Updating custom receivers: "+g.EF(this.Y)),chrome.cast.setCustomReceivers(this.Y,function(){},(0,g.uD)(function(){this.d9("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",J3(this)))}; re.prototype.setLaunchParams=re.prototype.PAY;re.prototype.setConnectedScreenStatus=re.prototype.MpO;re.prototype.stopSession=re.prototype.Wp;re.prototype.getCastSession=re.prototype.nt;re.prototype.requestSession=re.prototype.requestSession;re.prototype.init=re.prototype.init;re.prototype.dispose=re.prototype.dispose;var k8u=[];g.w=Sm.prototype; g.w.reset=function(M){this.listId="";this.index=-1;this.videoId="";tgL(this);this.volume=-1;this.muted=!1;M&&(this.index=M.index,this.listId=M.listId,this.videoId=M.videoId,this.playerState=M.playerState,this.volume=M.volume,this.muted=M.muted,this.audioTrackId=M.audioTrackId,this.trackData=M.trackData,this.tF=M.hasPrevious,this.EE=M.hasNext,this.U=M.playerTime,this.J=M.playerTimeAt,this.X=M.seekableStart,this.W=M.seekableEnd,this.Y=M.duration,this.K=M.loadedTime,this.S=M.liveIngestionTime,this.L= !isNaN(this.S))}; g.w.isPlaying=function(){return this.playerState==1}; g.w.isBuffering=function(){return this.playerState==3}; g.w.vv=function(M){this.Y=isNaN(M)?0:M}; g.w.getDuration=function(){return this.L?this.Y+PB(this):this.Y}; g.w.clone=function(){return new Sm(jDe(this))};g.n(de,g.MN);g.w=de.prototype;g.w.getState=function(){return this.Y}; g.w.q0=function(){return this.L.getReconnectTimeout()}; g.w.Ze=function(){this.L.reconnect()}; g.w.play=function(){DJ(this)?(this.S?this.S.play(null,g.BN,f4(this,"play")):Ts(this,"play"),FpL(this,1,EK(C4(this))),this.publish("remotePlayerChange")):$a(this,this.play)}; g.w.pause=function(){DJ(this)?(this.S?this.S.pause(null,g.BN,f4(this,"pause")):Ts(this,"pause"),FpL(this,2,EK(C4(this))),this.publish("remotePlayerChange")):$a(this,this.pause)}; g.w.seekTo=function(M){if(DJ(this)){if(this.S){var O=C4(this),c=new chrome.cast.media.SeekRequest;c.currentTime=M;O.isPlaying()||O.isBuffering()?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.S.seek(c,g.BN,f4(this,"seekTo",{newTime:M}))}else Ts(this,"seekTo",{newTime:M});FpL(this,3,M);this.publish("remotePlayerChange")}else $a(this,g.tA(this.seekTo,M))}; g.w.stop=function(){if(DJ(this)){this.S?this.S.stop(null,g.BN,f4(this,"stopVideo")):Ts(this,"stopVideo");var M=C4(this);M.index=-1;M.videoId="";tgL(M);VX(this,M);this.publish("remotePlayerChange")}else $a(this,this.stop)}; g.w.setVolume=function(M,O){if(DJ(this)){var c=C4(this);if(this.X){if(c.volume!=M){var k=Math.round(M)/100;this.X.setReceiverVolumeLevel(k,(0,g.uD)(function(){ka("set receiver volume: "+k)},this),(0,g.uD)(function(){this.d9("failed to set receiver volume.")},this))}c.muted!=O&&this.X.setReceiverMuted(O,(0,g.uD)(function(){ka("set receiver muted: "+O)},this),(0,g.uD)(function(){this.d9("failed to set receiver muted.")},this))}else{var I={volume:M, muted:O};c.volume!=-1&&(I.delta=M-c.volume);Ts(this,"setVolume",I)}c.muted=O;c.volume=M;VX(this,c)}else $a(this,g.tA(this.setVolume,M,O))}; g.w.ai=function(M,O){if(DJ(this)){var c=C4(this);M={videoId:M};O&&(c.trackData={trackName:O.name,languageCode:O.languageCode,sourceLanguageCode:O.translationLanguage?O.translationLanguage.languageCode:"",languageName:O.languageName,kind:O.kind},M.style=g.EF(O.style),g.gi(M,c.trackData));Ts(this,"setSubtitlesTrack",M);VX(this,c)}else $a(this,g.tA(this.ai,M,O))}; g.w.setAudioTrack=function(M,O){DJ(this)?(O=O.getLanguageInfo().getId(),Ts(this,"setAudioTrack",{videoId:M,audioTrackId:O}),M=C4(this),M.audioTrackId=O,VX(this,M)):$a(this,g.tA(this.setAudioTrack,M,O))}; g.w.playVideo=function(M,O,c,k,I,b,v){k=k===void 0?null:k;I=I===void 0?null:I;b=b===void 0?null:b;v=v===void 0?null:v;var u=C4(this),t={videoId:M};c!==void 0&&(t.currentIndex=c);yX(u,M,c||0);O!==void 0&&(o$(u,O),t.currentTime=O);k&&(t.listId=k);I&&(t.playerParams=I);b&&(t.clickTrackingParams=b);v&&(t.locationInfo=g.EF(v));Ts(this,"setPlaylist",t);k||VX(this,u)}; g.w.wO=function(M,O){if(DJ(this)){if(M&&O){var c=C4(this);yX(c,M,O);VX(this,c)}Ts(this,"previous")}else $a(this,g.tA(this.wO,M,O))}; g.w.nextVideo=function(M,O){if(DJ(this)){if(M&&O){var c=C4(this);yX(c,M,O);VX(this,c)}Ts(this,"next")}else $a(this,g.tA(this.nextVideo,M,O))}; g.w.Fp=function(){if(DJ(this)){Ts(this,"clearPlaylist");var M=C4(this);M.reset();VX(this,M);this.publish("remotePlayerChange")}else $a(this,this.Fp)}; g.w.pk=function(){DJ(this)?Ts(this,"dismissAutoplay"):$a(this,this.pk)}; g.w.dispose=function(){if(this.Y!=3){var M=this.Y;this.Y=3;this.publish("proxyStateChange",M,this.Y)}g.MN.prototype.dispose.call(this)}; g.w.Q2=function(){lUK(this);this.L=null;this.J.clear();QX(this,null);g.MN.prototype.Q2.call(this)}; g.w.gA=function(M){if((M!=this.Y||M==2)&&this.Y!=3&&M!=0){var O=this.Y;this.Y=M;this.publish("proxyStateChange",O,M);if(M==1)for(;!this.J.isEmpty();)O=M=this.J,O.S.length===0&&(O.S=O.X,O.S.reverse(),O.X=[]),M.S.pop().apply(this);else M==3&&this.dispose()}}; g.w.Yg2=function(M,O){this.publish(M,O)}; g.w.OBY=function(M){if(!M)this.gX(null),QX(this,null);else if(this.X.receiver.volume){M=this.X.receiver.volume;var O=C4(this),c=Math.round(100*M.level||0);if(O.volume!=c||O.muted!=M.muted)ka("Cast volume update: "+M.level+(M.muted?" muted":"")),O.volume=c,O.muted=!!M.muted,VX(this,O)}}; g.w.gX=function(M){ka("Cast media: "+!!M);this.S&&this.S.removeUpdateListener(this.K);if(this.S=M)this.S.addUpdateListener(this.K),pmL(this),this.publish("remotePlayerChange")}; g.w.McO=function(M){M?(pmL(this),this.publish("remotePlayerChange")):this.gX(null)}; g.w.jb=function(){Ts(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.w.HB2=function(){var M=vkk();M&&QX(this,M)}; g.w.d9=function(M){cB("CP",M)};g.n(A3,g.MN);g.w=A3.prototype; g.w.connect=function(M,O){if(O){var c=O.listId,k=O.videoId,I=O.videoIds,b=O.playerParams,v=O.clickTrackingParams,u=O.index,t={videoId:k},G=O.currentTime,X=O.locationInfo;O=O.loopMode;G!==void 0&&(t.currentTime=G<=5?0:G);b&&(t.playerParams=b);X&&(t.locationInfo=X);v&&(t.clickTrackingParams=v);c&&(t.listId=c);I&&I.length>0&&(t.videoIds=I.join(","));u!==void 0&&(t.currentIndex=u);this.wy&&(t.loopMode=O||"LOOP_MODE_OFF");c&&(this.S.listId=c);this.S.videoId=k;this.S.index=u||0;this.S.state=3;o$(this.S, G);this.J="UNSUPPORTED";c=this.wy?"setInitialState":"setPlaylist";mJ("Connecting with "+c+" and params: "+g.EF(t));this.X.connect({method:c,params:g.EF(t)},M,Pb1())}else mJ("Connecting without params"),this.X.connect({},M,Pb1());nkK(this)}; g.w.Rb=function(M){this.X.Rb(M)}; g.w.dispose=function(){this.BQ()||(g.Ok("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),iJ(this,3));g.MN.prototype.dispose.call(this)}; g.w.Q2=function(){R0u(this);rxe(this);aUK(this);g.jv(this.K);this.K=NaN;g.jv(this.T);this.T=NaN;this.L=null;g.wh(this.Sc);this.Sc.length=0;this.X.dispose();g.MN.prototype.Q2.call(this);this.J=this.W=this.Y=this.S=this.X=null}; g.w.FJ=function(M){if(!this.Y||this.Y.length===0)return!1;for(var O=g.a(this.Y),c=O.next();!c.done;c=O.next())if(!c.value.capabilities.has(M))return!1;return!0}; g.w.Cd=function(){var M=3;this.BQ()||(M=0,isNaN(this.b0())?this.X.IW()&&isNaN(this.U)&&(M=1):M=2);return M}; g.w.sf=function(M){mJ("Disconnecting with "+M);g.Ok("yt.mdx.remote.remoteClient_",null);R0u(this);this.publish("beforeDisconnect",M);M==1&&px();this.X.disconnect(M);this.dispose()}; g.w.Kd=function(){var M=this.S;this.L&&(M=this.S.clone(),yX(M,this.L,M.index));return jDe(M)}; g.w.gnQ=function(M){var O=this,c=new Sm(M);c.videoId&&c.videoId!=this.S.videoId&&(this.L=c.videoId,g.jv(this.K),this.K=g.tL(function(){if(O.L){var I=O.L;O.L=null;O.S.videoId!=I&&q_(O,"getNowPlaying")}},5E3)); var k=[];this.S.listId==c.listId&&this.S.videoId==c.videoId&&this.S.index==c.index||k.push("remoteQueueChange");this.S.playerState==c.playerState&&this.S.volume==c.volume&&this.S.muted==c.muted&&EK(this.S)==EK(c)&&g.EF(this.S.trackData)==g.EF(c.trackData)||k.push("remotePlayerChange");this.S.reset(M);g.qu(k,function(I){this.publish(I)},this)}; g.w.FK=function(){var M=this.X.getDeviceId(),O=g.R1(this.Y,function(c){return c.type=="REMOTE_CONTROL"&&c.id!=M}); return O?O.id:""}; g.w.b0=function(){return this.X.q0()}; g.w.w2=function(){return this.J||"UNSUPPORTED"}; g.w.BI=function(){return this.W||""}; g.w.mf=function(){!isNaN(this.b0())&&this.X.Ze()}; g.w.qdO=function(M,O){q_(this,M,O);JxD(this)}; g.w.SZ=function(){var M=g.Z8("SAPISID","")||g.Z8("__Secure-1PAPISID")||"",O=g.Z8("__Secure-3PAPISID","")||"";if(!M&&!O)return"";M=g.Nw(g.rd(M),2);O=g.Nw(g.rd(O),2);return g.Nw(g.rd(","+M+","+O),2)}; A3.prototype.subscribe=A3.prototype.subscribe;A3.prototype.unsubscribeByKey=A3.prototype.Qi;A3.prototype.getProxyState=A3.prototype.Cd;A3.prototype.disconnect=A3.prototype.sf;A3.prototype.getPlayerContextData=A3.prototype.Kd;A3.prototype.setPlayerContextData=A3.prototype.gnQ;A3.prototype.getOtherConnectedRemoteId=A3.prototype.FK;A3.prototype.getReconnectTimeout=A3.prototype.b0;A3.prototype.getAutoplayMode=A3.prototype.w2;A3.prototype.getAutoplayVideoId=A3.prototype.BI;A3.prototype.reconnect=A3.prototype.mf; A3.prototype.sendMessage=A3.prototype.qdO;A3.prototype.getXsrfToken=A3.prototype.SZ;A3.prototype.isCapabilitySupportedOnConnectedDevices=A3.prototype.FJ;g.n(yxL,UK);g.w=yxL.prototype;g.w.B8=function(M){return this.OZ.$_gs(M)}; g.w.contains=function(M){return!!this.OZ.$_c(M)}; g.w.get=function(M){return this.OZ.$_g(M)}; g.w.start=function(){this.OZ.$_st()}; g.w.add=function(M,O,c){this.OZ.$_a(M,O,c)}; g.w.remove=function(M,O,c){this.OZ.$_r(M,O,c)}; g.w.PG=function(M,O,c,k){this.OZ.$_un(M,O,c,k)}; g.w.Q2=function(){for(var M=this.S.length,O=0;O1&&!this.j.getOption("remote","quickCast")?(this.ke=g.xe(M,this.S,this),this.jH(g.Fh(M,this.S)),M=this.j.getOption("remote","currentReceiver"),M=this.S(M),this.options[M]&&this.FN(M),this.enable(!0)):this.enable(!1)}; Fw.prototype.S=function(M){return M.key}; Fw.prototype.G5=function(M){return M==="cast-selector-receiver"?"Cast...":this.ke[M].name}; Fw.prototype.JD=function(M){g.QZ.prototype.JD.call(this,M);this.j.setOption("remote","currentReceiver",this.ke[M]);this.LA.qW()};g.n(IjA,g.H0);g.w=IjA.prototype; g.w.create=function(){var M=this.player.N(),O=g.c6(M);M={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:M.B("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:M.B("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:M.B("enable_cast_short_lived_lounge_token")};$3D(O,M);this.subscriptions.push(g.xH("yt-remote-before-disconnect",this.q2O,this));this.subscriptions.push(g.xH("yt-remote-connection-change",this.kPy,this));this.subscriptions.push(g.xH("yt-remote-receiver-availability-change",this.hn, this));this.subscriptions.push(g.xH("yt-remote-auto-connect",this.oC2,this));this.subscriptions.push(g.xH("yt-remote-receiver-resumed",this.jGQ,this));this.subscriptions.push(g.xH("mdx-privacy-popup-confirm",this.mmc,this));this.subscriptions.push(g.xH("mdx-privacy-popup-cancel",this.WPO,this));this.hn()}; g.w.load=function(){this.player.cancelPlayback();g.H0.prototype.load.call(this);this.Ht=new kfk(this.player.N(),this);this.player.SQ(this.Ht);this.QD=new YfA(this,this.player,this.CA);var M=(M=x3D())?M.currentTime:0;var O=i5L()?new de(bG(),void 0):null;M==0&&O&&(M=EK(C4(O)));M!==0&&this.Og(M);b_1(this,this.Du,this.Du);this.player.n7(6)}; g.w.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Hy();this.sx=this.oy;g.M7(this.QD,this.CA);this.CA=this.Ht=this.QD=null;g.H0.prototype.unload.call(this);this.player.n7(5);pm(this)}; g.w.Q2=function(){g.hC(this.subscriptions);g.H0.prototype.Q2.call(this)}; g.w.xp=function(M){var O=g.C2.apply(1,arguments);this.loaded&&this.QD.O0.apply(this.QD,[M].concat(g.p2(O)))}; g.w.getAdState=function(){return this.OY}; g.w.tF=function(){return this.CA?C4(this.CA).tF:!1}; g.w.EE=function(){return this.CA?C4(this.CA).EE:!1}; g.w.Og=function(M,O){this.bE=M||0;this.player.publish("progresssync",M,O);this.player.GE("onVideoProgress",M||0)}; g.w.getCurrentTime=function(){return this.bE}; g.w.getDuration=function(){return C4(this.CA).getDuration()||0}; g.w.Lb=function(){var M=C4(this.CA);return M.L?M.S+PB(M):M.S}; g.w.wU=function(){return C4(this.CA).K}; g.w.gT=function(){return G8L(C4(this.CA))}; g.w.wJ=function(){var M=C4(this.CA);return M.X>0?M.X+PB(M):M.X}; g.w.getProgressState=function(){var M=C4(this.CA),O=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:M.playerState!=1081&&this.player.fI(),clipEnd:O.clipEnd,clipStart:O.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.Lb(),isAtLiveHead:this.isAtLiveHead(),loaded:this.wU(),seekableEnd:this.gT(),seekableStart:this.wJ(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.w.isAtLiveHead=function(){return G8L(C4(this.CA))-this.getCurrentTime()<=1}; g.w.nextVideo=function(){this.CA&&this.CA.nextVideo()}; g.w.wO=function(){this.CA&&this.CA.wO()}; g.w.q2O=function(M){M===1&&(this.nN=this.CA?C4(this.CA):null)}; g.w.kPy=function(){var M=i5L()?new de(bG(),void 0):null;if(M){var O=this.sx;this.loaded&&this.unload();this.CA=M;this.nN=null;O.key!==this.oy.key&&(this.sx=O,this.load())}else g.Y$(this.CA),this.CA=null,this.loaded&&(this.unload(),(M=this.nN)&&M.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(M.videoId,EK(M)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.w.hn=function(){var M=[this.oy],O=M.concat,c=Vgu();BB()&&g.e4("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.ke=O.call(M,c);M=fUD()||this.oy;Km(this,M);this.player.GE("onMdxReceiversChange")}; g.w.oC2=function(){var M=fUD();Km(this,M)}; g.w.jGQ=function(){this.sx=fUD()}; g.w.mmc=function(){this.lj=!0;pm(this);tk=!1;vq&&uG(vq,1);vq=null}; g.w.WPO=function(){this.lj=!1;pm(this);Km(this,this.oy);this.sx=this.oy;tk=!1;vq=null;this.player.playVideo()}; g.w.Gp=function(M,O){switch(M){case "casting":return this.loaded;case "receivers":return this.ke;case "currentReceiver":return O&&(O.key==="cast-selector-receiver"?U3J():Km(this,O)),this.loaded?this.sx:this.oy;case "quickCast":return this.ke.length===2&&this.ke[1].key==="cast-selector-receiver"?(O&&U3J(),!0):!1}}; g.w.jb=function(){this.CA.jb()}; g.w.Td=function(){return!1}; g.w.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.w.isLoggedIn=function(){var M,O;return((M=g.Q5("PLAYER_CONFIG"))==null?void 0:(O=M.args)==null?void 0:O.authuser)!==void 0?!0:!(!g.Q5("SESSION_INDEX")&&!g.Q5("LOGGED_IN"))};g.W0("remote",IjA);})(_yt_player);