(function(g){var window=this;'use strict';var mXv=function(Y){if(Y instanceof g.v_)return Y;if(typeof Y.Pa=="function")return Y.Pa(!1);if(g.Ho(Y)){var V=0,C=new g.v_;C.next=function(){for(;;){if(V>=Y.length)return g.yP;if(V in Y)return g.ww(Y[V++]);V++}}; return C}throw Error("Not implemented");},jY8=function(Y,V,C){if(g.Ho(Y))g.Tv(Y,V,C); else for(Y=mXv(Y);;){var U=Y.next();if(U.done)break;V.call(C,U.value,void 0,Y)}},o_=function(Y){g.D1(Y,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.bb()).toString(36)); return Y},Vh=function(Y,V,C){Array.isArray(C)||(C=[String(C)]); g.Iuv(Y.W,V,C)},tyL=function(Y,V){var C=[]; jY8(V,function(U){try{var n=g.lp.prototype.J.call(this,U,!0)}catch(b){if(b=="Storage: Invalid value was encountered")return;throw b;}n===void 0?C.push(U):g.F$Z(n)&&C.push(U)},Y); return C},esr=function(Y,V){tyL(Y,V).forEach(function(C){g.lp.prototype.remove.call(this,C)},Y)},rLS=function(Y){if(Y.jp){if(Y.jp.locationOverrideToken)return{locationOverrideToken:Y.jp.locationOverrideToken}; if(Y.jp.latitudeE7!=null&&Y.jp.longitudeE7!=null)return{latitudeE7:Y.jp.latitudeE7,longitudeE7:Y.jp.longitudeE7}}return null},FEv=function(Y,V){g.Bv(Y,V)||Y.push(V)},g_L=function(Y){var V=0,C; for(C in Y)V++;return V},KEL=function(Y,V){return g.rR(Y,V)},H_J=function(Y){try{return g.tx.JSON.parse(Y)}catch(V){}Y=String(Y); if(/^\s*$/.test(Y)?0:/^[\],:{}\s\u2028\u2029]*$/.test(Y.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("("+Y+")")}catch(V){}throw Error("Invalid JSON string: "+Y);},Cb=function(Y){if(g.tx.JSON)try{return g.tx.JSON.parse(Y)}catch(V){}return H_J(Y)},YGL=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/channel/opened",g.Du("channel_type"))},ocJ=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/channel/closed",g.Du("channel_type"))},VPJ=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Du("channel_type"))},CBD=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/channel/success")},Uyv=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/channel/error",g.Du("channel_type"),g.Du("error_type"))},ncr=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},bZS=function(){var Y=Uq(); this.Y=Y;Y.yl("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},EcD=function(Y){if(Y.WJ&&typeof Y.WJ=="function")return Y.WJ(); if(typeof Map!=="undefined"&&Y instanceof Map||typeof Set!=="undefined"&&Y instanceof Set)return Array.from(Y.values());if(typeof Y==="string")return Y.split("");if(g.Ho(Y)){for(var V=[],C=Y.length,U=0;U1){if(C%2)throw Error("Uneven number of arguments");for(var U=0;U5&&(Y=Y.slice(Y.length-5)); var V=g.KU(F1S(),function(U){return U.loungeToken}),C=g.KU(Y,function(U){return U.loungeToken}); g.Hf(C,function(U){return!g.Bv(V,U)})&&gcN(); g.$d("yt-remote-local-screens",Y,31536E3)},uD=function(Y){Y||(g.an("yt-remote-session-screen-id"),g.an("yt-remote-session-video-id")); etL();Y=Zn();g.AT(Y,Dn());jjb(Y)},HZL=function(){if(!BA){var Y=g.Iz(); Y&&(BA=new g.fj(Y))}},YXD=function(){HZL(); return BA?!!BA.get("yt-remote-use-staging-server"):!1},sq=function(Y,V){g.bS[Y]=!0; var C=g.Uk();C&&C.publish.apply(C,arguments);g.bS[Y]=!1},odv=function(){},Uq=function(){if(!AW){AW=new g.QZ(new odv); var Y=g.dN("client_streamz_web_flush_count",-1);Y!==-1&&(AW.S=Y)}return AW},VtA=function(){var Y=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return Y?parseInt(Y[1],10):0},CcL=function(Y){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+Y)!=-1||document.currentScript.src.indexOf("&"+Y)!=-1)},UMS=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},R_=function(Y){Y.length?ndD(Y.shift(),function(){R_(Y)}):bHT()},EdT=function(Y){return"chrome-extension://"+Y+"/cast_sender.js"},ndD=function(Y,V,C){var U=document.createElement("script"); U.onerror=V;C&&(U.onload=C);g.zI(U,g.cp(Y));(document.head||document.documentElement).appendChild(U)},z8L=function(){var Y=VtA(),V=[]; if(Y>1){var C=Y-1;V.push("//www.gstatic.com/eureka/clank/"+Y+"/cast_sender.js");V.push("//www.gstatic.com/eureka/clank/"+C+"/cast_sender.js")}return V},bHT=function(){var Y=UMS(); Y&&Y(!1,"No cast extension found")},yjr=function(){if(iHT){var Y=2,V=UMS(),C=function(){Y--; Y==0&&V&&V(!0)}; window.__onGCastApiAvailable=C;ndD("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",bHT,C)}},X8L=function(){yjr(); var Y=z8L();Y.push("//www.gstatic.com/eureka/clank/cast_sender.js");R_(Y)},ZHv=function(){yjr(); var Y=z8L();Y.push.apply(Y,g.P(GEL.map(EdT)));Y.push("//www.gstatic.com/eureka/clank/cast_sender.js");R_(Y)},WA=function(Y,V,C){g.T.call(this); this.D=C!=null?(0,g.CN)(Y,C):Y;this.Ah=V;this.V=(0,g.CN)(this.oM,this);this.Y=!1;this.J=0;this.S=this.xX=null;this.W=[]},Nn=function(){},DMR=function(){g.HN.call(this,"p")},unJ=function(){g.HN.call(this,"o")},snW=function(){return B1L=B1L||new g.Dk},AjD=function(Y){g.HN.call(this,"serverreachability",Y)},Oq=function(Y){var V=snW(); V.dispatchEvent(new AjD(V,Y))},R8W=function(Y){g.HN.call(this,"statevent",Y)},kY=function(Y){var V=snW(); V.dispatchEvent(new R8W(V,Y))},WaS=function(Y,V,C,U){g.HN.call(this,"timingevent",Y); this.size=V;this.rtt=C;this.retries=U},JW=function(Y,V){if(typeof Y!=="function")throw Error("Fn must not be null and must be a function"); return g.tx.setTimeout(function(){Y()},V)},dh=function(){},qn=function(Y,V,C,U){this.S=Y; this.W=V;this.Zx=C;this.rg=U||1;this.tf=new g.R5(this);this.m8=45E3;this.eL=null;this.D=!1;this.L=this.wT=this.X=this.Cb=this.jL=this.z5=this.sE=null;this.Jn=[];this.Y=null;this.C=0;this.V=this.dT=null;this.Jf=-1;this.F8=!1;this.Hx=0;this.UE=null;this.oy=this.Ty=this.Ry=this.vx=!1;this.J=new N1v},N1v=function(){this.S=null; this.Y="";this.J=!1},kET=function(Y,V,C){Y.Cb=1; Y.X=o_(V.clone());Y.L=C;Y.vx=!0;OHS(Y,null)},OHS=function(Y,V){Y.jL=Date.now(); PA(Y);Y.wT=Y.X.clone();Vh(Y.wT,"t",Y.rg);Y.C=0;var C=Y.S.Cb;Y.J=new N1v;Y.Y=JjL(Y.S,C?V:null,!Y.L);Y.Hx>0&&(Y.UE=new g.U5((0,g.CN)(Y.a9,Y,Y.Y),Y.Hx));Y.tf.listen(Y.Y,"readystatechange",Y.VK);V=Y.eL?g.YV(Y.eL):{};Y.L?(Y.dT||(Y.dT="POST"),V["Content-Type"]="application/x-www-form-urlencoded",Y.Y.send(Y.wT,Y.dT,Y.L,V)):(Y.dT="GET",Y.Y.send(Y.wT,Y.dT,null,V));Oq(1)},qXD=function(Y){if(!dMN(Y))return g.Hr(Y.Y); var V=g.YZ(Y.Y);if(V==="")return"";var C="",U=V.length,n=g.gr(Y.Y)==4;if(!Y.J.S){if(typeof TextDecoder==="undefined")return xY(Y),cA(Y),"";Y.J.S=new g.tx.TextDecoder}for(var b=0;bV.length)return PcR;V=V.slice(U,U+C);Y.C=U+C;return V},PA=function(Y){Y.z5=Date.now()+Y.m8; h8D(Y,Y.m8)},h8D=function(Y,V){if(Y.sE!=null)throw Error("WatchDog timer not null"); Y.sE=JW((0,g.CN)(Y.EC,Y),V)},fWD=function(Y){Y.sE&&(g.tx.clearTimeout(Y.sE),Y.sE=null)},cA=function(Y){Y.S.PD()||Y.F8||vdv(Y.S,Y)},xY=function(Y){fWD(Y); g.uE(Y.UE);Y.UE=null;Y.tf.removeAll();if(Y.Y){var V=Y.Y;Y.Y=null;V.abort();V.dispose()}},IW8=function(Y,V){try{var C=Y.S; if(C.bI!=0&&(C.Y==Y||w8W(C.J,Y)))if(!Y.Ty&&w8W(C.J,Y)&&C.bI==3){try{var U=C.jp.Y.parse(V)}catch(O){U=null}if(Array.isArray(U)&&U.length==3){var n=U;if(n[0]==0)a:{if(!C.X){if(C.Y)if(C.Y.jL+3E30&&(C.Hx=1.5*y);U=C;var X=Y.YG();if(X){var G=g.o9(X,"X-Client-Wire-Protocol");if(G){var Z=U.J;!Z.Y&&(g.sB(G,"spdy")||g.sB(G,"quic")||g.sB(G,"h2"))&&(Z.W=Z.V,Z.Y=new Set,Z.J&&(T1v(Z,Z.J),Z.J=null))}if(U.vx){var D=g.o9(X,"X-HTTP-Session-Id");D&&(U.wH=D,g.D1(U.eL,U.vx,D))}}C.bI=3;C.V&&C.V.Vj();C.Uc&&(C.R2=Date.now()-Y.jL);U=C;var u=Y;U.HC=$Mv(U,U.Cb?U.rg:null,U.Zx);if(u.Ty){Mt8(U.J, u);var B=u,A=U.Hx;A&&B.setTimeout(A);B.sE&&(fWD(B),PA(B));U.Y=u}else aWR(U);C.S.length>0&&wh(C)}else b[0]!="stop"&&b[0]!="close"||vA(C,7);else C.bI==3&&(b[0]=="stop"||b[0]=="close"?b[0]=="stop"?vA(C,7):C.disconnect():b[0]!="noop"&&C.V&&C.V.Ej(b),C.Jn=0)}Oq(4)}catch(O){}},Lab=function(Y,V){this.Y=Y; this.map=V;this.context=null},QnL=function(Y){this.V=Y||10; g.tx.PerformanceNavigationTiming?(Y=g.tx.performance.getEntriesByType("navigation"),Y=Y.length>0&&(Y[0].nextHopProtocol=="hq"||Y[0].nextHopProtocol=="h2")):Y=!!(g.tx.chrome&&g.tx.chrome.loadTimes&&g.tx.chrome.loadTimes()&&g.tx.chrome.loadTimes().wasFetchedViaSpdy);this.W=Y?this.V:1;this.Y=null;this.W>1&&(this.Y=new Set);this.J=null;this.S=[]},SXS=function(Y){return Y.J?!0:Y.Y?Y.Y.size>=Y.W:!1},p8S=function(Y){return Y.J?1:Y.Y?Y.Y.size:0},w8W=function(Y,V){return Y.J?Y.J==V:Y.Y?Y.Y.has(V):!1},T1v= function(Y,V){Y.Y?Y.Y.add(V):Y.J=V},Mt8=function(Y,V){Y.J&&Y.J==V?Y.J=null:Y.Y&&Y.Y.has(V)&&Y.Y.delete(V)},mMT=function(Y){if(Y.J!=null)return Y.S.concat(Y.J.Jn); if(Y.Y!=null&&Y.Y.size!==0){var V=Y.S;Y=g.N(Y.Y.values());for(var C=Y.next();!C.done;C=Y.next())V=V.concat(C.value.Jn);return V}return g.OS(Y.S)},jnR=function(Y,V){var C=new dh; if(g.tx.Image){var U=new Image;U.onload=g.nN(lD,C,"TestLoadImage: loaded",!0,V,U);U.onerror=g.nN(lD,C,"TestLoadImage: error",!1,V,U);U.onabort=g.nN(lD,C,"TestLoadImage: abort",!1,V,U);U.ontimeout=g.nN(lD,C,"TestLoadImage: timeout",!1,V,U);g.tx.setTimeout(function(){if(U.ontimeout)U.ontimeout()},1E4); U.src=Y}else V(!1)},ttS=function(Y,V){var C=new dh,U=new AbortController,n=setTimeout(function(){U.abort(); lD(C,"TestPingServer: timeout",!1,V)},1E4); fetch(Y,{signal:U.signal}).then(function(b){clearTimeout(n);b.ok?lD(C,"TestPingServer: ok",!0,V):lD(C,"TestPingServer: server error",!1,V)}).catch(function(){clearTimeout(n); lD(C,"TestPingServer: error",!1,V)})},lD=function(Y,V,C,U,n){try{n&&(n.onload=null,n.onerror=null,n.onabort=null,n.ontimeout=null),U(C)}catch(b){}},e8S=function(){this.Y=new Nn},rjr=function(Y,V,C){var U=C||""; try{iZb(Y,function(n,b){var E=n;g.YL(n)&&(E=g.m$(n));V.push(U+b+"="+encodeURIComponent(E))})}catch(n){throw V.push(U+"type="+encodeURIComponent("_badmap")),n; }},pb=function(Y,V,C){return C&&C.h9?C.h9[Y]||V:V},FaD=function(Y){this.S=[]; this.rg=this.HC=this.eL=this.Zx=this.Y=this.wH=this.vx=this.F8=this.C=this.Jf=this.L=null;this.fm=this.wT=0;this.cj=pb("failFast",!1,Y);this.Ty=this.sE=this.X=this.D=this.V=null;this.qJ=!0;this.pM=this.UE=-1;this.oy=this.Jn=this.jL=0;this.Km=pb("baseRetryDelayMs",5E3,Y);this.Mw=pb("retryDelaySeedMs",1E4,Y);this.Cm=pb("forwardChannelMaxRetries",2,Y);this.bd=pb("forwardChannelRequestTimeoutMs",2E4,Y);this.Mv=Y&&Y.VTc||void 0;this.TH=Y&&Y.RSc||void 0;this.Nv=Y&&Y.kFE||!1;this.Hx=void 0;this.Cb=Y&&Y.hsE|| !1;this.W="";this.J=new QnL(Y&&Y.q61);this.jp=new e8S;this.tf=Y&&Y.diL||!1;this.z5=Y&&Y.Y4c||!1;this.tf&&this.z5&&(this.z5=!1);this.QE=Y&&Y.f3E||!1;Y&&Y.a5T&&(this.qJ=!1);this.Uc=!this.tf&&this.qJ&&Y&&Y.rmt||!1;this.zO=void 0;Y&&Y.zS&&Y.zS>0&&(this.zO=Y.zS);this.mZ=void 0;this.R2=0;this.m8=!1;this.Ry=this.dT=null},fb=function(Y){Y.Y&&(gdN(Y),Y.Y.cancel(),Y.Y=null)},KaL=function(Y){fb(Y); Y.X&&(g.tx.clearTimeout(Y.X),Y.X=null);hW(Y);Y.J.cancel();Y.D&&(typeof Y.D==="number"&&g.tx.clearTimeout(Y.D),Y.D=null)},wh=function(Y){SXS(Y.J)||Y.D||(Y.D=!0,g.qo(Y.Dw,Y),Y.jL=0)},YWW=function(Y,V){if(p8S(Y.J)>=Y.J.W-(Y.D?1:0))return!1; if(Y.D)return Y.S=V.Jn.concat(Y.S),!0;if(Y.bI==1||Y.bI==2||Y.jL>=(Y.cj?0:Y.Cm))return!1;Y.D=JW((0,g.CN)(Y.Dw,Y,V),HHv(Y,Y.jL));Y.jL++;return!0},VTW=function(Y,V){var C; V?C=V.Zx:C=Y.wT++;var U=Y.eL.clone();g.D1(U,"SID",Y.W);g.D1(U,"RID",C);g.D1(U,"AID",Y.UE);T$(Y,U);Y.C&&Y.L&&g.A4(U,Y.C,Y.L);C=new qn(Y,Y.W,C,Y.jL+1);Y.C===null&&(C.eL=Y.L);V&&(Y.S=V.Jn.concat(Y.S));V=oQL(Y,C,1E3);C.setTimeout(Math.round(Y.bd*.5)+Math.round(Y.bd*.5*Math.random()));T1v(Y.J,C);kET(C,U,V)},T$=function(Y,V){Y.F8&&g.aW(Y.F8,function(C,U){g.D1(V,U,C)}); Y.V&&iZb({},function(C,U){g.D1(V,U,C)})},oQL=function(Y,V,C){C=Math.min(Y.S.length,C); var U=Y.V?(0,g.CN)(Y.V.F7,Y.V,Y):null;a:{for(var n=Y.S,b=-1;;){var E=["count="+C];b==-1?C>0?(b=n[0].Y,E.push("ofs="+b)):b=0:E.push("ofs="+b);for(var y=!0,X=0;X=3)return!1; Y.oy++;Y.X=JW((0,g.CN)(Y.kC,Y),HHv(Y,Y.Jn));Y.Jn++;return!0},gdN=function(Y){Y.dT!=null&&(g.tx.clearTimeout(Y.dT),Y.dT=null)},CIv=function(Y){Y.Y=new qn(Y,Y.W,"rpc",Y.oy); Y.C===null&&(Y.Y.eL=Y.L);Y.Y.Hx=0;var V=Y.HC.clone();g.D1(V,"RID","rpc");g.D1(V,"SID",Y.W);g.D1(V,"AID",Y.UE);g.D1(V,"CI",Y.Ty?"0":"1");!Y.Ty&&Y.zO&&g.D1(V,"TO",Y.zO);g.D1(V,"TYPE","xmlhttp");T$(Y,V);Y.C&&Y.L&&g.A4(V,Y.C,Y.L);Y.Hx&&Y.Y.setTimeout(Y.Hx);var C=Y.Y;Y=Y.rg;C.Cb=1;C.X=o_(V.clone());C.L=null;C.vx=!0;OHS(C,Y)},hW=function(Y){Y.sE!=null&&(g.tx.clearTimeout(Y.sE),Y.sE=null)},vdv=function(Y,V){var C=null; if(Y.Y==V){hW(Y);gdN(Y);Y.Y=null;var U=2}else if(w8W(Y.J,V))C=V.Jn,Mt8(Y.J,V),U=1;else return;if(Y.bI!=0)if(V.D)if(U==1){C=V.L?V.L.length:0;V=Date.now()-V.jL;var n=Y.jL;U=snW();U.dispatchEvent(new WaS(U,C,V,n));wh(Y)}else aWR(Y);else{var b=V.Jf;n=V.getLastError();if(n==3||n==0&&b>0||!(U==1&&YWW(Y,V)||U==2&&lWN(Y)))switch(C&&C.length>0&&(V=Y.J,V.S=V.S.concat(C)),n){case 1:vA(Y,5);break;case 4:vA(Y,10);break;case 3:vA(Y,6);break;default:vA(Y,2)}}},HHv=function(Y,V){var C=Y.Km+Math.floor(Math.random()* Y.Mw); Y.isActive()||(C*=2);return C*V},vA=function(Y,V){if(V==2){var C=(0,g.CN)(Y.VH1,Y),U=Y.TH,n=!U; U=new g.b4(U||"//www.google.com/images/cleardot.gif");g.tx.location&&g.tx.location.protocol=="http"||g.Ey(U,"https");o_(U);n?jnR(U.toString(),C):ttS(U.toString(),C)}else kY(2);Y.bI=0;Y.V&&Y.V.o9(V);UKb(Y);KaL(Y)},UKb=function(Y){Y.bI=0; Y.Ry=[];if(Y.V){var V=mMT(Y.J);if(V.length!=0||Y.S.length!=0)g.JT(Y.Ry,V),g.JT(Y.Ry,Y.S),Y.J.S.length=0,g.OS(Y.S),Y.S.length=0;Y.V.nu()}},nQS=function(Y){if(Y.bI==0)return Y.Ry; var V=[];g.JT(V,mMT(Y.J));g.JT(V,Y.S);return V},$Mv=function(Y,V,C){var U=g.u4(C); U.Y!=""?(V&&g.zn(U,V+"."+U.Y),g.i4(U,U.S)):(U=g.tx.location,U=ynR(U.protocol,V?V+"."+U.hostname:U.hostname,+U.port,C));V=Y.vx;C=Y.wH;V&&C&&g.D1(U,V,C);g.D1(U,"VER",Y.hq);T$(Y,U);return U},JjL=function(Y,V,C){if(V&&!Y.Cb)throw Error("Can't create secondary domain capable XhrIo object."); V=Y.Nv&&!Y.Mv?new g.e_(new g.Vf({Ny:C})):new g.e_(Y.Mv);V.C=Y.Cb;return V},bwW=function(){},EQD=function(){},Mn=function(Y,V){g.Dk.call(this); this.Y=new FaD(V);this.V=Y;this.J=V&&V.Rt8||null;Y=V&&V.jcn||null;V&&V.xzT&&(Y?Y["X-Client-Protocol"]="webchannel":Y={"X-Client-Protocol":"webchannel"});this.Y.L=Y;Y=V&&V.Tds||null;V&&V.Ri&&(Y?Y["X-WebChannel-Content-Type"]=V.Ri:Y={"X-WebChannel-Content-Type":V.Ri});V&&V.zV&&(Y?Y["X-WebChannel-Client-Profile"]=V.zV:Y={"X-WebChannel-Client-Profile":V.zV});this.Y.Jf=Y;(Y=V&&V.QlE)&&!g.Bu(Y)&&(this.Y.C=Y);this.D=V&&V.hsE||!1;this.W=V&&V.qVx||!1;(V=V&&V.j4)&&!g.Bu(V)&&(this.Y.vx=V,g.eJ(this.J,V)&&(Y= this.J,V in Y&&delete Y[V]));this.S=new $Y(this)},zzT=function(Y){DMR.call(this); Y.__headers__&&(this.headers=Y.__headers__,this.statusCode=Y.__status__,delete Y.__headers__,delete Y.__status__);var V=Y.__sm__;V?this.data=(this.Y=g.SJ(V))?g.KN(V,this.Y):V:this.data=Y},iwD=function(Y){unJ.call(this); this.status=1;this.errorCode=Y},$Y=function(Y){this.Y=Y},yOv=function(Y,V){this.J=Y; this.Y=V},Xer=function(Y){return nQS(Y.Y).map(function(V){var C=Y.J; V=V.map;"__data__"in V?(V=V.__data__,C=C.W?H_J(V):V):C=V;return C})},a_=function(Y,V){if(typeof Y!=="function")throw Error("Fn must not be null and must be a function"); return g.tx.setTimeout(function(){Y()},V)},Lb=function(Y){I_.dispatchEvent(new GeL(I_,Y))},GeL=function(Y){g.HN.call(this,"statevent",Y)},Qh=function(Y,V,C,U){this.Y=Y; this.W=V;this.C=C;this.D=U||1;this.J=45E3;this.S=new g.R5(this);this.V=new g.aA;this.V.setInterval(250)},DKr=function(Y,V,C){Y.PB=1; Y.nQ=o_(V.clone());Y.So=C;Y.vx=!0;Zwv(Y,null)},u4v=function(Y,V,C,U,n){Y.PB=1; Y.nQ=o_(V.clone());Y.So=null;Y.vx=C;n&&(Y.nV=!1);Zwv(Y,U)},Zwv=function(Y,V){Y.Vq=Date.now(); BKW(Y);Y.rP=Y.nQ.clone();Vh(Y.rP,"t",Y.D);Y.yh=0;Y.ub=Y.Y.I4(Y.Y.iG()?V:null);Y.Jj>0&&(Y.AC=new g.U5((0,g.CN)(Y.i4,Y,Y.ub),Y.Jj));Y.S.listen(Y.ub,"readystatechange",Y.Ch);V=Y.YL?g.YV(Y.YL):{};Y.So?(Y.Gk="POST",V["Content-Type"]="application/x-www-form-urlencoded",Y.ub.send(Y.rP,Y.Gk,Y.So,V)):(Y.Gk="GET",Y.nV&&!g.rC&&(V.Connection="close"),Y.ub.send(Y.rP,Y.Gk,null,V));Y.Y.Gz(1)},RzS=function(Y,V){var C=Y.yh,U=V.indexOf("\n",C); if(U==-1)return s3N;C=Number(V.substring(C,U));if(isNaN(C))return AOD;U+=1;if(U+C>V.length)return s3N;V=V.slice(U,U+C);Y.yh=U+C;return V},BKW=function(Y){Y.SO=Date.now()+Y.J; WPW(Y,Y.J)},WPW=function(Y,V){if(Y.DL!=null)throw Error("WatchDog timer not null"); Y.DL=a_((0,g.CN)(Y.Kh,Y),V)},NKb=function(Y){Y.DL&&(g.tx.clearTimeout(Y.DL),Y.DL=null)},OwR=function(Y){Y.Y.PD()||Y.oT||Y.Y.u_(Y)},S6=function(Y){NKb(Y); g.uE(Y.AC);Y.AC=null;Y.V.stop();Y.S.removeAll();if(Y.ub){var V=Y.ub;Y.ub=null;V.abort();V.dispose()}Y.Fq&&(Y.Fq=null)},keb=function(Y,V){try{Y.Y.FL(Y,V),Y.Y.Gz(4)}catch(C){}},dKv=function(Y,V,C,U,n){if(U==0)C(!1); else{var b=n||0;U--;JOS(Y,V,function(E){E?C(!0):g.tx.setTimeout(function(){dKv(Y,V,C,U,b)},b)})}},JOS=function(Y,V,C){var U=new Image; U.onload=function(){try{m_(U),C(!0)}catch(n){}}; U.onerror=function(){try{m_(U),C(!1)}catch(n){}}; U.onabort=function(){try{m_(U),C(!1)}catch(n){}}; U.ontimeout=function(){try{m_(U),C(!1)}catch(n){}}; g.tx.setTimeout(function(){if(U.ontimeout)U.ontimeout()},V); U.src=Y},m_=function(Y){Y.onload=null; Y.onerror=null;Y.onabort=null;Y.ontimeout=null},qWJ=function(Y){this.Y=Y; this.J=new Nn},PIW=function(Y){var V=j6(Y.Y,Y.De,"/mail/images/cleardot.gif"); o_(V);dKv(V.toString(),5E3,(0,g.CN)(Y.B6,Y),3,2E3);Y.Gz(1)},xK8=function(Y){var V=Y.Y.D; V!=null?(Lb(5),V?(Lb(11),tW(Y.Y,Y,!1)):(Lb(12),tW(Y.Y,Y,!0))):(Y.by=new Qh(Y),Y.by.YL=Y.pE,V=Y.Y,V=j6(V,V.iG()?Y.LZ:null,Y.Wg),Lb(5),Vh(V,"TYPE","xmlhttp"),u4v(Y.by,V,!1,Y.LZ,!1))},cOS=function(Y,V,C){this.Y=1; this.J=[];this.S=[];this.V=new Nn;this.L=Y||null;this.D=V!=null?V:null;this.X=C||!1},hzr=function(Y,V){this.Y=Y; this.map=V;this.context=null},fXL=function(Y,V,C,U){g.HN.call(this,"timingevent",Y); this.size=V;this.rtt=C;this.retries=U},vQW=function(Y){g.HN.call(this,"serverreachability",Y)},lXR=function(Y){Y.fh(1,0); Y.zj=j6(Y,null,Y.R4);weJ(Y)},peJ=function(Y){Y.N1&&(Y.N1.abort(),Y.N1=null); Y.S0&&(Y.S0.cancel(),Y.S0=null);Y.Il&&(g.tx.clearTimeout(Y.Il),Y.Il=null);e6(Y);Y.IY&&(Y.IY.cancel(),Y.IY=null);Y.gi&&(g.tx.clearTimeout(Y.gi),Y.gi=null)},TKS=function(Y,V){if(Y.Y==0)throw Error("Invalid operation: sending map when state is closed"); Y.J.push(new hzr(Y.MW++,V));Y.Y!=2&&Y.Y!=3||weJ(Y)},$KL=function(Y){var V=0; Y.S0&&V++;Y.IY&&V++;return V},weJ=function(Y){Y.IY||Y.gi||(Y.gi=a_((0,g.CN)(Y.fu,Y),0),Y.ov=0)},IX8=function(Y,V){if(Y.Y==1){if(!V){Y.KQ=Math.floor(Math.random()*1E5); V=Y.KQ++;var C=new Qh(Y,"",V);C.YL=Y.X9;var U=MTb(Y),n=Y.zj.clone();g.D1(n,"RID",V);g.D1(n,"CVER","1");rh(Y,n);DKr(C,n,U);Y.IY=C;Y.Y=2}}else Y.Y==3&&(V?aXW(Y,V):Y.J.length==0||Y.IY||aXW(Y))},aXW=function(Y,V){if(V)if(Y.Ir>6){Y.J=Y.S.concat(Y.J); Y.S.length=0;var C=Y.KQ-1;V=MTb(Y)}else C=V.C,V=V.So;else C=Y.KQ++,V=MTb(Y);var U=Y.zj.clone();g.D1(U,"SID",Y.W);g.D1(U,"RID",C);g.D1(U,"AID",Y.E_);rh(Y,U);C=new Qh(Y,Y.W,C,Y.ov+1);C.YL=Y.X9;C.setTimeout(1E4+Math.round(1E4*Math.random()));Y.IY=C;DKr(C,U,V)},rh=function(Y,V){Y.wV&&(Y=Y.wV.l4())&&g.aW(Y,function(C,U){g.D1(V,U,C)})},MTb=function(Y){var V=Math.min(Y.J.length,1E3),C=["count="+V]; if(Y.Ir>6&&V>0){var U=Y.J[0].Y;C.push("ofs="+U)}else U=0;for(var n={},b=0;b=3)return!1; Y.C++;Y.Il=a_((0,g.CN)(Y.Cu,Y),Q38(Y,Y.nI));Y.nI++;return!0},tW=function(Y,V,C){Y.XH=Y.D==null?C:!Y.D; Y.aN=V.Sr;Y.X||lXR(Y)},e6=function(Y){Y.p5!=null&&(g.tx.clearTimeout(Y.p5),Y.p5=null)},Q38=function(Y,V){var C=5E3+Math.floor(Math.random()*1E4); Y.isActive()||(C*=2);return C*V},FY=function(Y,V){if(V==2||V==9){var C=null; Y.wV&&(C=null);var U=(0,g.CN)(Y.EYv,Y);C||(C=new g.b4("//www.google.com/images/cleardot.gif"),o_(C));JOS(C.toString(),1E4,U)}else Lb(2);mKD(Y,V)},mKD=function(Y,V){Y.Y=0; Y.wV&&Y.wV.MY(V);j3R(Y);peJ(Y)},j3R=function(Y){Y.Y=0; Y.aN=-1;if(Y.wV)if(Y.S.length==0&&Y.J.length==0)Y.wV.Bg();else{var V=g.OS(Y.S),C=g.OS(Y.J);Y.S.length=0;Y.J.length=0;Y.wV.Bg(V,C)}},j6=function(Y,V,C){var U=g.u4(C); if(U.Y!="")V&&g.zn(U,V+"."+U.Y),g.i4(U,U.S);else{var n=window.location;U=ynR(n.protocol,V?V+"."+n.hostname:n.hostname,+n.port,C)}Y.F4&&g.aW(Y.F4,function(b,E){g.D1(U,E,b)}); g.D1(U,"VER",Y.Ir);rh(Y,U);return U},tTS=function(){},ezS=function(){this.Y=[]; this.J=[]},rOL=function(Y){g.HN.call(this,"channelMessage"); this.message=Y},FPv=function(Y){g.HN.call(this,"channelError"); this.error=Y},gQS=function(Y,V){this.action=Y; this.params=V||{}},gh=function(Y,V){g.T.call(this); this.Y=new g.KK(this.B88,0,this);g.M(this,this.Y);this.Ah=5E3;this.J=0;if(typeof Y==="function")V&&(Y=(0,g.CN)(Y,V));else if(Y&&typeof Y.handleEvent==="function")Y=(0,g.CN)(Y.handleEvent,Y);else throw Error("Invalid listener argument");this.S=Y},KPS=function(Y,V,C,U,n,b,E,y,X,G,Z,D,u,B){C=C===void 0?!1:C; U=U===void 0?function(){return""}:U; n=n===void 0?!1:n;b=b===void 0?!1:b;E=E===void 0?!1:E;y=y===void 0?function(){return g.hA({})}:y; X=X===void 0?!1:X;Z=Z===void 0?!1:Z;D=D===void 0?!1:D;u=u===void 0?!1:u;B=B===void 0?!1:B;this.Cb=Y;this.sE=V;this.D=new g.hF;this.J=new gh(this.cY8,this);this.Y=null;this.C=!1;this.L=null;this.jL="";this.Jn=this.X=0;this.S=[];this.oy=C;this.vx=U;this.V=b;this.eL=y;this.F8=G;this.rg=E;this.dT=null;this.W=g.hA();this.Zx=n;this.Ry=X;this.tf=Z;this.z5=D;this.qJ=u;this.Jf=B;this.Hx=new YGL;this.Ty=new ocJ;this.m8=new CBD;this.wT=new VPJ;this.UE=new Uyv;this.Uc=new ncr;this.mZ=new bZS},orR=function(Y, V,C,U,n){Hwv(Y); if(Y.Y){var b=g.Fh("ID_TOKEN"),E=Y.Y.X9||{};b?E["x-youtube-identity-token"]=b:delete E["x-youtube-identity-token"];Y.Y.X9=E}Yc8(Y);U?(U.getState()!=3&&$KL(U)==0||U.getState(),Y.Y.connect(V,C,Y.sE,U.W,U.E_)):n?Y.Y.connect(V,C,Y.sE,n.sessionId,n.arrayId):Y.Y.connect(V,C,Y.sE)},nrW=function(Y,V){return Y.qJ?!0:Y.z5?Object.values(VFD).includes(V):Y.tf?!Object.values(CGv).includes(V):Y.Jf?Object.values(Uwv).includes(V):!1},z7J=function(Y){var V,C; g.l(function(U){if(U.J==1)return g.OP(U,2),g.v(U,bIJ(Y),2);g.co(U);V=Y.S;Y.S=[];C=V.length;ErT(Y,V,C);Kb(Y);return g.f0(U,0)})},ErT=function(Y,V,C){for(var U=0;U0?C=Object.assign({},C,V):delete C.Authorization;Y.Y.X9=C}},Yc8=function(Y){Y.F8&&!Y.V&&ycL(Y,Y.F8())},HA=function(Y){this.scheme="https"; this.port=this.domain="";this.Y="/api/lounge";this.J=!0;Y=Y||document.location.href;var V=Number(g.kK(Y)[4]||null)||"";V&&(this.port=":"+V);this.domain=g.Jm(Y)||"";Y=g.JH();Y.search("MSIE")>=0&&(Y=Y.match(/MSIE ([\d.]+)/)[1],g.kV(Y,"10.0")<0&&(this.J=!1))},Y6=function(Y,V){var C=Y.Y; Y.J&&(C=Y.scheme+"://"+Y.domain+Y.port+Y.Y);return g.fL(C+V,{})},XCD=function(Y,V){g.Dk.call(this); var C=this;this.YP=Y();this.YP.subscribe("handlerOpened",this.T1,this);this.YP.subscribe("handlerClosed",this.onClosed,this);this.YP.subscribe("handlerError",function(U,n){C.onError(n)}); this.YP.subscribe("handlerMessage",this.onMessage,this);this.Y=V},G_R=function(Y,V,C){var U=this; C=C===void 0?function(){return""}:C; var n=n===void 0?new EQD:n;var b=b===void 0?new g.hF:b;this.pathPrefix=Y;this.Y=V;this.jL=C;this.V=b;this.X=null;this.L=this.C=0;this.channel=null;this.D=0;this.S=new gh(function(){U.S.isActive();var E;((E=U.channel)==null?void 0:p8S((new yOv(E,E.Y)).Y.J))===0&&U.connect(U.X,U.C)}); this.W={};this.J={};this.sE=!1;this.logger=null;this.Jn=[];this.K$=void 0;this.eL=new YGL;this.dT=new ocJ;this.F8=new VPJ;this.vx=new Uyv},ZIv=function(Y){g.E6(Y.channel,"m",function(){Y.D=3; Y.S.reset();Y.X=null;Y.C=0;for(var V=g.N(Y.Jn),C=V.next();!C.done;C=V.next())C=C.value,Y.channel&&Y.channel.send(C);Y.Jn=[];Y.publish("webChannelOpened");Y.eL.gH("WEB_CHANNEL")}); g.E6(Y.channel,"n",function(){Y.D=0;Y.S.isActive()||Y.publish("webChannelClosed");var V,C=(V=Y.channel)==null?void 0:Xer(new yOv(V,V.Y));C&&(Y.Jn=[].concat(g.P(C)));Y.dT.gH("WEB_CHANNEL")}); g.E6(Y.channel,"p",function(V){var C=V.data;C[0]==="gracefulReconnect"?(Y.S.start(),Y.channel&&Y.channel.close()):Y.publish("webChannelMessage",new gQS(C[0],C[1]));Y.K$=V.statusCode;Y.F8.gH("WEB_CHANNEL")}); g.E6(Y.channel,"o",function(){Y.K$===401||Y.S.start();Y.publish("webChannelError");Y.vx.gH("WEB_CHANNEL","")})},DwJ=function(Y){var V=Y.jL(); V?Y.W["x-youtube-lounge-xsrf-token"]=V:delete Y.W["x-youtube-lounge-xsrf-token"]},ukL=function(Y){g.Dk.call(this); this.Y=Y();this.Y.subscribe("webChannelOpened",this.ZF,this);this.Y.subscribe("webChannelClosed",this.onClosed,this);this.Y.subscribe("webChannelError",this.onError,this);this.Y.subscribe("webChannelMessage",this.onMessage,this)},BvN=function(Y,V,C,U,n){function b(){return new KPS(Y6(Y,"/bc"),V,!1,C,U)} C=C===void 0?function(){return""}:C; return g.Jn("enable_mdx_web_channel_desktop")?new ukL(function(){return new G_R(Y6(Y,"/wc"),V,C)}):new XCD(b,n)},W9v=function(){var Y=sUD; Acv();oq.push(Y);R7J()},VX=function(Y,V){Acv(); var C=Nv8(Y,String(V));oq.length==0?OIr(C):(R7J(),g.Tv(oq,function(U){U(C)}))},CR=function(Y){VX("CP",Y)},Acv=function(){oq||(oq=g.rH("yt.mdx.remote.debug.handlers_")||[],g.e2("yt.mdx.remote.debug.handlers_",oq))},OIr=function(Y){var V=(U2+1)%50; U2=V;nR[V]=Y;bF||(bF=V==49)},R7J=function(){var Y=oq; if(nR[0]){var V=bF?U2:-1,C={};do C={Gw:void 0},V=(V+1)%50,C.Gw=nR[V],g.Tv(Y,function(U){return function(n){n(U.Gw)}}(C)); while(V!=U2);nR=Array(50);U2=-1;bF=!1}},Nv8=function(Y,V){var C=(Date.now()-k_T)/1E3; C.toFixed&&(C=C.toFixed(3));var U=[];U.push("[",C+"s","] ");U.push("[","yt.mdx.remote","] ");U.push(Y+": "+V,"\n");return U.join("")},E2=function(Y){g.D$.call(this); this.D=Y;this.screens=[]},Jcv=function(Y,V){var C=Y.get(V.uuid)||Y.get(V.id); if(C)return Y=C.name,C.id=V.id||C.id,C.name=V.name,C.token=V.token,C.uuid=V.uuid||C.uuid,C.name!=Y;Y.screens.push(V);return!0},dwN=function(Y,V){var C=Y.screens.length!=V.length; Y.screens=g.$C(Y.screens,function(b){return!!Qjv(V,b)}); for(var U=V.length,n=0;n0&&Y.W0&&WL(Y,C)},function(V){Y.V=function(){}; Y.KR(V)})},o0T=function(Y){var V={}; V.pairingCode=Y.dT;V.theme=Y.Cb;YXD()&&(V.env_useStageMdx=1);return g.hm(V)},V4A=function(Y){return new Promise(function(V){Y.dT=IGS(); if(Y.eL){var C=new chrome.cast.DialLaunchResponse(!0,o0T(Y));V(C);YkD(Y)}else Y.sE=function(){g.Ny(Y.L);Y.sE=function(){}; Y.L=NaN;var U=new chrome.cast.DialLaunchResponse(!0,o0T(Y));V(U);YkD(Y)},Y.L=g.Rj(function(){Y.sE()},100)})},UPv=function(Y,V,C){Y.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(V)); var U=new iD(V);return(new Promise(function(n){CSr(Y,U,function(b){b?(Y.Jn=!0,ZE(Y.W,U),uF(Y,U),WL(Y,C)):g.oj(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(V)+" is not online."));n(b)},5)})).then(function(n){return n?new chrome.cast.DialLaunchResponse(!1):V4A(Y)})},n0b=function(Y,V){var C=Y.X.receiver.label,U=Y.J.friendlyName; return(new Promise(function(n){$wr(Y.W,C,V,U,function(b){b&&b.token&&uF(Y,b);n(b)},function(b){BL(Y,"Failed to get DIAL screen: "+b); n(null)})})).then(function(n){return n&&n.token?new chrome.cast.DialLaunchResponse(!1):V4A(Y)})},CSr=function(Y,V,C,U){g.Ny(Y.D); Y.D=0;ahL(Y.W,V,function(n){n||U<0?C(n):Y.D=g.Rj(function(){CSr(Y,V,C,U-1)},300)})},WL=function(Y,V){Y.info("getDialAppInfoWithTimeout_ "+V); Rq(Y)&&(g.Ny(Y.C),Y.C=0,V==0?b4N(Y):Y.C=g.Rj(function(){b4N(Y)},V))},b4N=function(Y){Rq(Y)&&Y.S.getDialAppInfo(function(V){Y.info("getDialAppInfo dialLaunchData: "+JSON.stringify(V)); V=V.extraData||{};var C=null;if(V.loungeToken){var U;((U=Y.Y)==null?void 0:U.token)==V.loungeToken&&(C="staleLoungeToken")}else C="missingLoungeToken";C?(Y.jL=C,WL(Y,3E4)):(Y.Jn=!1,Y.jL="unknown",ScN(Y,V.loungeToken),WL(Y,V.loungeTokenRefreshIntervalMs))},function(V){Y.info("getDialAppInfo error: "+V); Y.jL="noLoungeTokenResponse";WL(Y,3E4)})},E0L=function(Y){g.Ny(Y.D); Y.D=0;g.Ny(Y.C);Y.C=0;Y.V();Y.V=function(){}; g.Ny(Y.L)},NC=function(Y,V){DE.call(this,Y,V,"ManualSession"); this.S=g.Rj((0,g.CN)(this.dQ,this,null),150)},O2=function(Y,V){g.D$.call(this); this.config_=V;this.J=Y;this.X=V.appId||"233637DE";this.W=V.theme||"cl";this.L=V.disableCastApi||!1;this.D=V.forceMirroring||!1;this.Y=null;this.C=!1;this.S=[];this.V=(0,g.CN)(this.KXx,this)},zub=function(Y,V){return V?g.D8(Y.S,function(C){return yh(V,C.label)},Y):null},k6=function(Y){VX("Controller",Y)},sUD=function(Y){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(Y)},Jd=function(Y){return Y.C||!!Y.S.length||!!Y.Y},du=function(Y,V,C){V!=Y.Y&&(g.uE(Y.Y),(Y.Y=V)?(C?Y.publish("yt-remote-cast2-receiver-resumed", V.J):Y.publish("yt-remote-cast2-receiver-selected",V.J),V.subscribe("sessionScreen",(0,g.CN)(Y.OJ,Y,V)),V.subscribe("sessionFailed",function(){return i4J(Y,V)}),V.Y?Y.publish("yt-remote-cast2-session-change",V.Y):C&&Y.Y.dQ(null)):Y.publish("yt-remote-cast2-session-change",null))},i4J=function(Y,V){Y.Y==V&&Y.publish("yt-remote-cast2-session-failed")},ygS=function(Y){var V=Y.J.xC(),C=Y.Y&&Y.Y.J; Y=g.KU(V,function(U){C&&yh(U,C.label)&&(C=null);var n=U.uuid?U.uuid:U.id,b=zub(this,U);b?(b.label=n,b.friendlyName=U.name):(b=new chrome.cast.Receiver(n,U.name),b.receiverType=chrome.cast.ReceiverType.CUSTOM);return b},Y); C&&(C.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(C=new chrome.cast.Receiver(C.label,C.friendlyName),C.receiverType=chrome.cast.ReceiverType.CUSTOM),Y.push(C));return Y},sKT=function(Y,V,C,U){U.disableCastApi?qC("Cannot initialize because disabled by Mdx config."):X1A()?Gpv(V,U)&&(Z4b(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?DP8(Y,C):(window.__onGCastApiAvailable=function(n,b){n?DP8(Y,C):(PL("Failed to load cast API: "+b),ufD(!1),Z4b(!1),g.an("yt-remote-cast-available"),g.an("yt-remote-cast-receiver"), BOR(),C(!1))},U.loadCastApiSetupScript?g.Xf("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?VtA()>=60&&X8L():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?bHT():VtA()>=89?ZHv():(yjr(),R_(GEL.map(EdT))))):qC("Cannot initialize because not running Chrome")},BOR=function(){qC("dispose"); var Y=x6();Y&&Y.dispose();g.e2("yt.mdx.remote.cloudview.instance_",null);AgW(!1);g.iS(RuN);RuN.length=0},cL=function(){return!!g.MM("yt-remote-cast-installed")},WVR=function(){var Y=g.MM("yt-remote-cast-receiver"); return Y?Y.friendlyName:null},NOL=function(){qC("clearCurrentReceiver"); g.an("yt-remote-cast-receiver")},O4W=function(){return cL()?x6()?x6().getCastSession():(PL("getCastSelector: Cast is not initialized."),null):(PL("getCastSelector: Cast API is not installed!"),null)},kpA=function(){cL()?x6()?hd()?(qC("Requesting cast selector."),x6().requestSession()):(qC("Wait for cast API to be ready to request the session."),RuN.push(g.zp("yt-remote-cast2-api-ready",kpA))):PL("requestCastSelector: Cast is not initialized."):PL("requestCastSelector: Cast API is not installed!")}, fR=function(Y,V){hd()?x6().setConnectedScreenStatus(Y,V):PL("setConnectedScreenStatus called before ready.")},X1A=function(){var Y=g.JH().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.M9||Y},JgS=function(Y,V){x6().init(Y,V)},Gpv=function(Y,V){var C=!1; x6()||(Y=new O2(Y,V),Y.subscribe("yt-remote-cast2-availability-change",function(U){g.$d("yt-remote-cast-available",U);sq("yt-remote-cast2-availability-change",U)}),Y.subscribe("yt-remote-cast2-receiver-selected",function(U){qC("onReceiverSelected: "+U.friendlyName); g.$d("yt-remote-cast-receiver",U);sq("yt-remote-cast2-receiver-selected",U)}),Y.subscribe("yt-remote-cast2-receiver-resumed",function(U){qC("onReceiverResumed: "+U.friendlyName); g.$d("yt-remote-cast-receiver",U);sq("yt-remote-cast2-receiver-resumed",U)}),Y.subscribe("yt-remote-cast2-session-change",function(U){qC("onSessionChange: "+XY(U)); U||g.an("yt-remote-cast-receiver");sq("yt-remote-cast2-session-change",U)}),g.e2("yt.mdx.remote.cloudview.instance_",Y),C=!0); qC("cloudview.createSingleton_: "+C);return C},x6=function(){return g.rH("yt.mdx.remote.cloudview.instance_")},DP8=function(Y,V){ufD(!0); Z4b(!1);JgS(Y,function(C){C?(AgW(!0),g.yq("yt-remote-cast2-api-ready")):(PL("Failed to initialize cast API."),ufD(!1),g.an("yt-remote-cast-available"),g.an("yt-remote-cast-receiver"),BOR());V(C)})},qC=function(Y){VX("cloudview",Y)},PL=function(Y){VX("cloudview",Y)},ufD=function(Y){qC("setCastInstalled_ "+Y); g.$d("yt-remote-cast-installed",Y)},hd=function(){return!!g.rH("yt.mdx.remote.cloudview.apiReady_")},AgW=function(Y){qC("setApiReady_ "+Y); g.e2("yt.mdx.remote.cloudview.apiReady_",Y)},Z4b=function(Y){g.e2("yt.mdx.remote.cloudview.initializing_",Y)},vL=function(Y){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.V=this.D=0;this.trackData=null;this.ju=this.ww=!1;this.X=this.S=this.C=this.J=0;this.Y=NaN;this.W=!1;this.reset(Y)},dPb=function(Y){Y.audioTrackId=null; Y.trackData=null;Y.playerState=-1;Y.ww=!1;Y.ju=!1;Y.D=0;Y.V=g.bb();Y.J=0;Y.C=0;Y.S=0;Y.X=0;Y.Y=NaN;Y.W=!1},wu=function(Y){return Y.isPlaying()?(g.bb()-Y.V)/1E3:0},lF=function(Y,V){Y.D=V; Y.V=g.bb()},pR=function(Y){switch(Y.playerState){case 1:case 1081:return(g.bb()-Y.V)/1E3+Y.D; case -1E3:return 0}return Y.D},qkR=function(Y){return Y.W?Y.C+wu(Y):Y.C},TB=function(Y,V,C){var U=Y.videoId; Y.videoId=V;Y.index=C;V!=U&&dPb(Y)},PSL=function(Y){var V={}; V.index=Y.index;V.listId=Y.listId;V.videoId=Y.videoId;V.playerState=Y.playerState;V.volume=Y.volume;V.muted=Y.muted;V.audioTrackId=Y.audioTrackId;V.trackData=g.oG(Y.trackData);V.hasPrevious=Y.ww;V.hasNext=Y.ju;V.playerTime=Y.D;V.playerTimeAt=Y.V;V.seekableStart=Y.J;V.seekableEnd=Y.C;V.duration=Y.S;V.loadedTime=Y.X;V.liveIngestionTime=Y.Y;return V},MC=function(Y,V){g.D$.call(this); var C=this;this.S=0;this.W=Y;this.D=[];this.V=new ezS;this.J=this.Y=null;this.L=(0,g.CN)(this.bbx,this);this.C=(0,g.CN)(this.g5,this);this.X=(0,g.CN)(this.Hb8,this);this.sE=(0,g.CN)(this.Ans,this);var U=0;Y?(U=Y.getProxyState(),U!=3&&(Y.subscribe("proxyStateChange",this.xZ,this),xPL(this))):U=3;U!=0&&(V?this.xZ(U):g.Rj(function(){C.xZ(U)},0)); (Y=O4W())&&$6(this,Y);this.subscribe("yt-remote-cast2-session-change",this.sE)},aq=function(Y){return new vL(Y.W.getPlayerContextData())},xPL=function(Y){g.Tv("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(V){this.D.push(this.W.subscribe(V,g.nN(this.Vxy,V),this))},Y)},cgL=function(Y){g.Tv(Y.D,function(V){this.W.unsubscribeByKey(V)},Y); Y.D.length=0},Iq=function(Y){return Y.getState()==1},LR=function(Y,V){var C=Y.V; C.Y.length+C.J.length<50&&Y.V.enqueue(V)},huS=function(Y,V,C){var U=aq(Y); lF(U,C);U.playerState!=-1E3&&(U.playerState=V);QX(Y,U)},SE=function(Y,V,C){Y.W.sendMessage(V,C)},QX=function(Y,V){cgL(Y); Y.W.setPlayerContextData(PSL(V));xPL(Y)},$6=function(Y,V){Y.J&&(Y.J.removeUpdateListener(Y.L),Y.J.removeMediaListener(Y.C),Y.g5(null)); Y.J=V;Y.J&&(CR("Setting cast session: "+Y.J.sessionId),Y.J.addUpdateListener(Y.L),Y.J.addMediaListener(Y.C),Y.J.media.length&&Y.g5(Y.J.media[0]))},f7b=function(Y){var V=Y.Y.media,C=Y.Y.customData; if(V&&C){var U=aq(Y);V.contentId!=U.videoId&&CR("Cast changing video to: "+V.contentId);U.videoId=V.contentId;U.playerState=C.playerState;lF(U,Y.Y.getEstimatedTime());QX(Y,U)}else CR("No cast media video. Ignoring state update.")},mz=function(Y,V,C){return(0,g.CN)(function(U){this.dF("Failed to "+V+" with cast v2 channel. Error code: "+U.code); U.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.dF("Retrying "+V+" using MDx browser channel."),SE(this,V,C))},Y)},eE=function(Y,V,C,U){U=U===void 0?!1:U; g.D$.call(this);var n=this;this.D=NaN;this.dT=!1;this.L=this.X=this.Jn=this.jL=NaN;this.sE=[];this.V=this.C=this.W=this.Y=this.J=null;this.eL=Y;this.F8=U;this.sE.push(g.qM(window,"beforeunload",function(){n.We(2)})); this.S=[];this.Y=new vL;this.Cb=V.id;this.vx=V.idType;this.J=BvN(this.eL,C,this.b4,this.vx=="shortLived",this.Cb);this.J.listen("channelOpened",function(){v08(n)}); this.J.listen("channelClosed",function(){jE("Channel closed");isNaN(n.D)?uD(!0):uD();n.dispose()}); this.J.listen("channelError",function(b){uD();isNaN(n.KL())?(b==1&&n.vx=="shortLived"&&n.publish("browserChannelAuthError",b),jE("Channel error: "+b+" without reconnection"),n.dispose()):(n.dT=!0,jE("Channel error: "+b+" with reconnection in "+n.KL()+" ms"),td(n,2))}); this.J.listen("channelMessage",function(b){w1D(n,b)}); this.J.DS(V.token);this.subscribe("remoteQueueChange",function(){var b=n.Y.videoId;g.In()&&g.$d("yt-remote-session-video-id",b)})},l7R=function(Y){return g.D8(Y.S,function(V){return V.type=="LOUNGE_SCREEN"})},jE=function(Y){VX("conn",Y)},td=function(Y,V){Y.publish("proxyStateChange",V)},p1A=function(Y){Y.D=g.Rj(function(){jE("Connecting timeout"); Y.We(1)},2E4)},TOS=function(Y){g.Ny(Y.D); Y.D=NaN},$PR=function(Y){g.Ny(Y.jL); Y.jL=NaN},a7N=function(Y){M4D(Y); Y.Jn=g.Rj(function(){ru(Y,"getNowPlaying")},2E4)},M4D=function(Y){g.Ny(Y.Jn); Y.Jn=NaN},v08=function(Y){jE("Channel opened"); Y.dT&&(Y.dT=!1,$PR(Y),Y.jL=g.Rj(function(){jE("Timing out waiting for a screen.");Y.We(1)},15E3))},LVL=function(Y,V){var C=null; if(V){var U=l7R(Y);U&&(C={clientName:U.clientName,deviceMake:U.brand,deviceModel:U.model,osVersion:U.osVersion})}g.e2("yt.mdx.remote.remoteClient_",C);V&&(TOS(Y),$PR(Y));C=Y.J.Mf()&&isNaN(Y.D);V==C?V&&(td(Y,1),ru(Y,"getSubtitlesTrack")):V?(Y.aO()&&Y.Y.reset(),td(Y,1),ru(Y,"getNowPlaying"),I7L(Y)):Y.We(1)},QKb=function(Y,V){var C=V.params.videoId; delete V.params.videoId;C==Y.Y.videoId&&(g.gR(V.params)?Y.Y.trackData=null:Y.Y.trackData=V.params,Y.publish("remotePlayerChange"))},SkN=function(Y,V,C){var U=V.params.videoId||V.params.video_id,n=parseInt(V.params.currentIndex,10); Y.Y.listId=V.params.listId||Y.Y.listId;TB(Y.Y,U,n);Y.publish("remoteQueueChange",C)},jK8=function(Y,V){V.params=V.params||{}; SkN(Y,V,"NOW_PLAYING_MAY_CHANGE");mPL(Y,V);Y.publish("autoplayDismissed")},mPL=function(Y,V){var C=parseInt(V.params.currentTime||V.params.current_time,10); lF(Y.Y,isNaN(C)?0:C);C=parseInt(V.params.state,10);C=isNaN(C)?-1:C;C==-1&&Y.Y.playerState==-1E3&&(C=-1E3);Y.Y.playerState=C;C=Number(V.params.loadedTime);Y.Y.X=isNaN(C)?0:C;Y.Y.f9(Number(V.params.duration));C=Y.Y;var U=Number(V.params.liveIngestionTime);C.Y=U;C.W=isNaN(U)?!1:!0;C=Y.Y;U=Number(V.params.seekableStartTime);V=Number(V.params.seekableEndTime);C.J=isNaN(U)?0:U;C.C=isNaN(V)?0:V;Y.Y.playerState==1?a7N(Y):M4D(Y);Y.publish("remotePlayerChange")},t4D=function(Y,V){if(Y.Y.playerState!=-1E3){var C= 1085; switch(parseInt(V.params.adState,10)){case 1:C=1081;break;case 2:C=1084;break;case 0:C=1083}Y.Y.playerState=C;V=parseInt(V.params.currentTime,10);lF(Y.Y,isNaN(V)?0:V);Y.publish("remotePlayerChange")}},euL=function(Y,V){var C=V.params.muted=="true"; Y.Y.volume=parseInt(V.params.volume,10);Y.Y.muted=C;Y.publish("remotePlayerChange")},rgJ=function(Y,V){Y.C=V.params.videoId; Y.publish("nowAutoplaying",parseInt(V.params.timeout,10))},FVJ=function(Y,V){Y.C=V.params.videoId||null; Y.publish("autoplayUpNext",Y.C)},g0L=function(Y,V){Y.V=V.params.autoplayMode; Y.publish("autoplayModeChange",Y.V);Y.V=="DISABLED"&&Y.publish("autoplayDismissed")},KVr=function(Y,V){var C=V.params.hasNext=="true"; Y.Y.ww=V.params.hasPrevious=="true";Y.Y.ju=C;Y.publish("previousNextChange")},w1D=function(Y,V){V=V.message; V.params?jE("Received: action="+V.action+", params="+g.m$(V.params)):jE("Received: action="+V.action+" {}");switch(V.action){case "loungeStatus":V=Cb(V.params.devices);Y.S=g.KU(V,function(U){return new z$(U)}); V=!!g.D8(Y.S,function(U){return U.type=="LOUNGE_SCREEN"}); LVL(Y,V);V=Y.oh("mlm");Y.publish("multiStateLoopEnabled",V);break;case "loungeScreenDisconnected":g.RW(Y.S,function(U){return U.type=="LOUNGE_SCREEN"}); LVL(Y,!1);break;case "remoteConnected":var C=new z$(Cb(V.params.device));g.D8(Y.S,function(U){return U.equals(C)})||FEv(Y.S,C); break;case "remoteDisconnected":C=new z$(Cb(V.params.device));g.RW(Y.S,function(U){return U.equals(C)}); break;case "gracefulDisconnect":break;case "playlistModified":SkN(Y,V,"QUEUE_MODIFIED");break;case "nowPlaying":jK8(Y,V);break;case "onStateChange":mPL(Y,V);break;case "onAdStateChange":t4D(Y,V);break;case "onVolumeChanged":euL(Y,V);break;case "onSubtitlesTrackChanged":QKb(Y,V);break;case "nowAutoplaying":rgJ(Y,V);break;case "autoplayDismissed":Y.publish("autoplayDismissed");break;case "autoplayUpNext":FVJ(Y,V);break;case "onAutoplayModeChanged":g0L(Y,V);break;case "onHasPreviousNextChanged":KVr(Y, V);break;case "requestAssistedSignIn":Y.publish("assistedSignInRequested",V.params.authCode);break;case "onLoopModeChanged":Y.publish("loopModeChange",V.params.loopMode);break;default:jE("Unrecognized action: "+V.action)}},I7L=function(Y){g.Ny(Y.L); Y.L=g.Rj(function(){Y.We(1)},864E5)},ru=function(Y,V,C){C?jE("Sending: action="+V+", params="+g.m$(C)):jE("Sending: action="+V); Y.J.sendMessage(V,C)},H4N=function(Y){E2.call(this,"ScreenServiceProxy"); this.BF=Y;this.Y=[];this.Y.push(this.BF.$_s("screenChange",(0,g.CN)(this.AQ,this)));this.Y.push(this.BF.$_s("onlineScreenChange",(0,g.CN)(this.QyL,this)))},URv=function(Y,V){HZL(); if(!BA||!BA.get("yt-remote-disable-remote-module-for-dev")){V=g.Fh("MDX_CONFIG")||V;SG8();etL();Fo||(Fo=new HA(V?V.loungeApiHost:void 0),YXD()&&(Fo.Y="/api/loungedev"));gu||(gu=g.rH("yt.mdx.remote.deferredProxies_")||[],g.e2("yt.mdx.remote.deferredProxies_",gu));YA8();var C=KR();if(!C){var U=new GB(Fo,V?V.disableAutomaticScreenCache||!1:!1);g.e2("yt.mdx.remote.screenService_",U);C=KR();var n={};V&&(n={appId:V.appId,disableDial:V.disableDial,theme:V.theme,loadCastApiSetupScript:V.loadCastApiSetupScript, disableCastApi:V.disableCastApi,enableDialLoungeToken:V.enableDialLoungeToken,enableCastLoungeToken:V.enableCastLoungeToken,forceMirroring:V.forceMirroring});g.e2("yt.mdx.remote.enableConnectWithInitialState_",V?V.enableConnectWithInitialState||!1:!1);sKT(Y,U,function(b){b?HL()&&fR(HL(),"YouTube TV"):U.subscribe("onlineScreenChange",function(){sq("yt-remote-receiver-availability-change")})},n)}V&&!g.rH("yt.mdx.remote.initialized_")&&(g.e2("yt.mdx.remote.initialized_",!0),Yh("Initializing: "+g.m$(V)), or.push(g.zp("yt-remote-cast2-api-ready",function(){sq("yt-remote-api-ready")})),or.push(g.zp("yt-remote-cast2-availability-change",function(){sq("yt-remote-receiver-availability-change")})),or.push(g.zp("yt-remote-cast2-receiver-selected",function(){VS(null); sq("yt-remote-auto-connect","cast-selector-receiver")})),or.push(g.zp("yt-remote-cast2-receiver-resumed",function(){sq("yt-remote-receiver-resumed","cast-selector-receiver")})),or.push(g.zp("yt-remote-cast2-session-change",oyL)),or.push(g.zp("yt-remote-connection-change",function(b){b?fR(HL(),"YouTube TV"):Cd()||(fR(null,null),NOL())})),or.push(g.zp("yt-remote-cast2-session-failed",function(){sq("yt-remote-connection-failed")})),Y=VIr(),V.isAuto&&(Y.id+="#dial"),n=V.capabilities||[],n.length>0&&(Y.capabilities= n),Y.name=V.device,Y.app=V.app,(V=V.theme)&&(Y.theme=V),Yh(" -- with channel params: "+g.m$(Y)),Y?(g.$d("yt-remote-session-app",Y.app),g.$d("yt-remote-session-name",Y.name)):(g.an("yt-remote-session-app"),g.an("yt-remote-session-name")),g.e2("yt.mdx.remote.channelParams_",Y),C.start(),HL()||C5R())}},nyS=function(){var Y=KR().BF.$_gos(); var V=Ub();V&&nd()&&(Qjv(Y,V)||Y.push(V));return L1v(Y)},EyL=function(){var Y=bYR(); !Y&&cL()&&WVR()&&(Y={key:"cast-selector-receiver",name:WVR()});return Y},bYR=function(){var Y=nyS(),V=Ub(); V||(V=Cd());return g.D8(Y,function(C){return V&&yh(V,C.key)?!0:!1})},Ub=function(){var Y=HL(); if(!Y)return null;var V=KR().Su();return G$(V,Y)},oyL=function(Y){Yh("remote.onCastSessionChange_: "+XY(Y)); if(Y){var V=Ub();if(V&&V.id==Y.id){if(fR(V.id,"YouTube TV"),Y.idType=="shortLived"&&(Y=Y.token))bM&&(bM.token=Y),(V=nd())&&V.DS(Y)}else V&&Eb(),zf(Y,1)}else nd()&&Eb()},Eb=function(){hd()?x6().stopSession():PL("stopSession called before API ready."); var Y=nd();Y&&(Y.disconnect(1),zYT(null))},iYv=function(){var Y=nd(); return!!Y&&Y.getProxyState()!=3},Yh=function(Y){VX("remote",Y)},KR=function(){if(!yY8){var Y=g.rH("yt.mdx.remote.screenService_"); yY8=Y?new H4N(Y):null}return yY8},HL=function(){return g.rH("yt.mdx.remote.currentScreenId_")},XlS=function(Y){g.e2("yt.mdx.remote.currentScreenId_",Y)},GtA=function(){return g.rH("yt.mdx.remote.connectData_")},VS=function(Y){g.e2("yt.mdx.remote.connectData_",Y)},nd=function(){return g.rH("yt.mdx.remote.connection_")},zYT=function(Y){var V=nd(); VS(null);Y||XlS("");g.e2("yt.mdx.remote.connection_",Y);gu&&(g.Tv(gu,function(C){C(Y)}),gu.length=0); V&&!Y?sq("yt-remote-connection-change",!1):!V&&Y&&sq("yt-remote-connection-change",!0)},Cd=function(){var Y=g.In(); if(!Y)return null;var V=KR();if(!V)return null;V=V.Su();return G$(V,Y)},zf=function(Y,V){HL(); Ub()&&Ub();if(iM)bM=Y;else{XlS(Y.id);var C=g.rH("yt.mdx.remote.enableConnectWithInitialState_")||!1;Y=new eE(Fo,Y,VIr(),C);Y.connect(V,GtA());Y.subscribe("beforeDisconnect",function(U){sq("yt-remote-before-disconnect",U)}); Y.subscribe("beforeDispose",function(){nd()&&(nd(),zYT(null))}); Y.subscribe("browserChannelAuthError",function(){var U=Ub();U&&U.idType=="shortLived"&&(hd()?x6().handleBrowserChannelAuthError():PL("refreshLoungeToken called before API ready."))}); zYT(Y)}},C5R=function(){var Y=Cd(); Y?(Yh("Resume connection to: "+XY(Y)),zf(Y,0)):(uD(),NOL(),Yh("Skipping connecting because no session screen found."))},YA8=function(){var Y=VIr(); if(g.gR(Y)){Y=Dn();var V=g.MM("yt-remote-session-name")||"",C=g.MM("yt-remote-session-app")||"";Y={device:"REMOTE_CONTROL",id:Y,name:V,app:C,mdxVersion:3};Y.authuser=String(g.Fh("SESSION_INDEX","0"));(V=g.Fh("DELEGATED_SESSION_ID"))&&(Y.pageId=String(V));g.e2("yt.mdx.remote.channelParams_",Y)}},VIr=function(){return g.rH("yt.mdx.remote.channelParams_")||{}},ujb=function(Y,V,C){g.T.call(this); var U=this;this.Y=Y;this.B=V;this.zv=C;this.events=new g.QI(this);this.V=!1;this.D=new g.GG(64);this.J=new g.KK(this.wL,500,this);this.S=new g.KK(this.At,1E3,this);this.X=new WA(this.rBT,0,this);this.W={};this.L=new g.KK(this.Gg,1E3,this);this.C=new g.U5(this.seekTo,1E3,this);this.sE=this.events.Z(this.B,"onVolumeChange",function(n){ZYW(U,n)}); g.M(this,this.events);this.events.Z(V,"onCaptionsTrackListChanged",this.DJE);this.events.Z(V,"captionschanged",this.qE1);this.events.Z(V,"captionssettingschanged",this.Ss);this.events.Z(V,"videoplayerreset",this.yY);this.events.Z(V,"mdxautoplaycancel",function(){U.zv.ix()}); V.K("enable_mdx_video_play_directly")&&this.events.Z(V,"videodatachange",function(){DRv(U.Y)||yS(U)||Xm(U,0)}); Y=this.zv;Y.Vs();Y.subscribe("proxyStateChange",this.W3,this);Y.subscribe("remotePlayerChange",this.w5,this);Y.subscribe("remoteQueueChange",this.yY,this);Y.subscribe("previousNextChange",this.SE,this);Y.subscribe("nowAutoplaying",this.Ln,this);Y.subscribe("autoplayDismissed",this.QS,this);g.M(this,this.J);g.M(this,this.S);g.M(this,this.X);g.M(this,this.L);g.M(this,this.C);this.Ss();this.yY();this.w5()},ZYW=function(Y,V){if(yS(Y)){Y.zv.unsubscribe("remotePlayerChange",Y.w5,Y); var C=Math.round(V.volume);V=!!V.muted;var U=aq(Y.zv);if(C!==U.volume||V!==U.muted)Y.zv.setVolume(C,V),Y.L.start();Y.zv.subscribe("remotePlayerChange",Y.w5,Y)}},BS8=function(Y){Y.KW(0); Y.J.stop();Y.jx(new g.GG(64))},skS=function(Y,V){if(yS(Y)&&!Y.V){var C=null; V&&(C={style:Y.B.getSubtitlesUserSettings()},Object.assign(C,V));Y.zv.Hq(Y.B.getVideoData(1).videoId,C);Y.W=aq(Y.zv).trackData}},Xm=function(Y,V){var C=Y.B.getPlaylist(); if(C==null?0:C.listId){var U=C.index;var n=C.listId.toString()}C=Y.B.getVideoData(1);Y.zv.playVideo(C.videoId,V,U,n,C.playerParams,C.eL,rLS(C));Y.jx(new g.GG(1))},AYb=function(Y,V){if(V){var C=Y.B.getOption("captions","tracklist",{Ih:1}); C&&C.length?(Y.B.setOption("captions","track",V),Y.V=!1):(Y.B.loadModule("captions"),Y.V=!0)}else Y.B.setOption("captions","track",{})},yS=function(Y){return aq(Y.zv).videoId===Y.B.getVideoData(1).videoId},RYS=function(Y,V){g.Qx.call(this,Y); this.Y=V},Gf=function(){g.m.call(this,{j:"div", T:"ytp-mdx-popup-dialog",G:{role:"dialog"},N:[{j:"div",T:"ytp-mdx-popup-dialog-inner-content",N:[{j:"div",T:"ytp-mdx-popup-title",Ic:"You're signed out"},{j:"div",T:"ytp-mdx-popup-description",Ic:"Videos that you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{j:"div",T:"ytp-mdx-privacy-popup-buttons",N:[{j:"button",Dv:["ytp-button","ytp-mdx-privacy-popup-cancel"],Ic:"Cancel"},{j:"button",Dv:["ytp-button", "ytp-mdx-privacy-popup-confirm"],Ic:"Confirm"}]}]}]});this.fade=new g.ia(this,250);this.cancelButton=this.Bx("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Bx("ytp-mdx-privacy-popup-confirm");g.M(this,this.fade);this.Z(this.cancelButton,"click",this.Y);this.Z(this.confirmButton,"click",this.J)},ZP=function(Y){g.m.call(this,{j:"div", T:"ytp-remote",N:[{j:"div",T:"ytp-remote-display-status",N:[{j:"div",T:"ytp-remote-display-status-icon",N:[g.u4T()]},{j:"div",T:"ytp-remote-display-status-text",Ic:"{{statustext}}"}]}]});this.api=Y;this.fade=new g.ia(this,250);g.M(this,this.fade);this.Z(Y,"presentingplayerstatechange",this.onStateChange);this.XJ(Y.getPlayerStateObject())},DP=function(Y,V){g.aa.call(this,"Play on",1,Y,V); this.B=Y;this.DP={};this.Z(Y,"onMdxReceiversChange",this.W);this.Z(Y,"presentingplayerstatechange",this.W);this.W()},Wuv=function(Y){g.NG.call(this,Y); this.IQ={key:IGS(),name:"This computer"};this.Gr=null;this.subscriptions=[];this.qx=this.zv=null;this.DP=[this.IQ];this.zF=this.IQ;this.g8=new g.GG(64);this.Q7=0;this.pT=-1;this.uM=!1;this.Wb=this.Ij=this.Np=null;if(!g.Sb(this.player.U())&&!g.m3(this.player.U())){Y=this.player;var V=g.OR(Y);V&&(V=V.j9())&&(V=new DP(Y,V),g.M(this,V));V=new ZP(Y);g.M(this,V);g.Ip(Y,V.element,4);this.Np=new Gf;g.M(this,this.Np);g.Ip(Y,this.Np.element,4);this.uM=!!Cd()}},uM=function(Y){Y.Ij&&(Y.player.removeEventListener("presentingplayerstatechange", Y.Ij),Y.Ij=null)},NSD=function(Y,V,C){Y.g8=C; Y.player.publish("presentingplayerstatechange",new g.W3(C,V))},B9=function(Y,V){if(V.key!==Y.zF.key)if(V.key===Y.IQ.key)Eb(); else if(DRv(Y)&&OYr(Y),Y.zF=V,!Y.player.U().K("disable_mdx_connection_in_mdx_module_for_music_web")||!g.m3(Y.player.U())){var C=Y.player.getPlaylistId();var U=Y.player.getVideoData(1);var n=U.videoId;if(!C&&!n||(Y.player.getAppState()===2||Y.player.getAppState()===1)&&Y.player.U().K("should_clear_video_data_on_player_cued_unstarted"))U=null;else{var b=Y.player.getPlaylist();if(b){var E=[];for(var y=0;y2*this.size&&Eq(this),!0):!1}; g.R.get=function(Y,V){return nb(this.J,Y)?this.J[Y]:V}; g.R.set=function(Y,V){nb(this.J,Y)||(this.size+=1,this.Y.push(Y),this.NI++);this.J[Y]=V}; g.R.forEach=function(Y,V){for(var C=this.Eo(),U=0;U=U.Y.length)return g.yP;var b=U.Y[V++];return g.ww(Y?b:U.J[b])}; return n}; var BNv={uQ8:"atp",b9i:"ska",pJy:"que",hLx:"mus",U_1:"sus",PbL:"dsp",i91:"seq",u9L:"mic",pZE:"dpa",vmn:"mlm",SN1:"dsdtr",FKc:"ntb",Czx:"vsp",ejE:"scn",WIt:"rpe",twt:"dcn",YNx:"dcp",HtL:"pas",JOE:"drq",Muc:"opf",DRx:"els",kTy:"isg",fbE:"svq",aDL:"mvp",dFs:"ads",Nps:"stcp",Tpy:"sads",sSE:"dloc",WBs:"dcw"},sjD={KGb:"u",CX8:"cl",XY8:"k",RV8:"i",rht:"cr",krx:"m",ZR1:"g",Fm:"up"},VFD={k_:"adPlaying",OL:"onAdStateChange"},CGv={cz1:"nowPlaying",TJy:"onStateChange",k_:"adPlaying",OL:"onAdStateChange",R$:"nowPlayingShorts", dl:"onShortsStateChange"},Uwv={R$:"nowPlayingShorts",dl:"onShortsStateChange"};z$.prototype.equals=function(Y){return Y?this.id==Y.id:!1}; var tPJ="",BA=null;odv.prototype.flush=function(Y,V){Y=Y===void 0?[]:Y;V=V===void 0?!1:V;if(g.Jn("enable_client_streamz_web")){Y=g.N(Y);for(var C=Y.next();!C.done;C=Y.next())C=g.HLP(C.value),C={serializedIncrementBatch:g.EZ(C.S())},g.ZX("streamzIncremented",C,{sendIsolatedPayload:V})}}; var AW,iHT=CcL("loadCastFramework")||CcL("loadCastApplicationFramework"),GEL=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.ib(WA,g.T);g.R=WA.prototype;g.R.nh=function(Y){this.W=arguments;this.Y=!1;this.xX?this.S=g.bb()+this.Ah:this.xX=g.IA(this.V,this.Ah)}; g.R.stop=function(){this.xX&&(g.tx.clearTimeout(this.xX),this.xX=null);this.S=null;this.Y=!1;this.W=[]}; g.R.pause=function(){++this.J}; g.R.resume=function(){this.J&&(--this.J,!this.J&&this.Y&&(this.Y=!1,this.D.apply(null,this.W)))}; g.R.u1=function(){this.stop();WA.JB.u1.call(this)}; g.R.oM=function(){this.xX&&(g.tx.clearTimeout(this.xX),this.xX=null);this.S?(this.xX=g.IA(this.V,this.S-g.bb()),this.S=null):this.J?this.Y=!0:(this.Y=!1,this.D.apply(null,this.W))};Nn.prototype.stringify=function(Y){return g.tx.JSON.stringify(Y,void 0)}; Nn.prototype.parse=function(Y){return g.tx.JSON.parse(Y,void 0)};g.ib(DMR,g.HN);g.ib(unJ,g.HN);var B1L=null;g.ib(AjD,g.HN);g.ib(R8W,g.HN);g.ib(WaS,g.HN);dh.prototype.debug=function(){}; dh.prototype.info=function(){}; dh.prototype.warning=function(){};var xMJ={},PcR={};g.R=qn.prototype;g.R.setTimeout=function(Y){this.m8=Y}; g.R.VK=function(Y){Y=Y.target;var V=this.UE;V&&g.gr(Y)==3?V.sI():this.a9(Y)}; g.R.a9=function(Y){try{if(Y==this.Y)a:{var V=g.gr(this.Y),C=this.Y.J,U=this.Y.getStatus();if(!(V<3)&&(V!=3||this.Y&&(this.J.J||g.Hr(this.Y)||g.YZ(this.Y)))){this.F8||V!=4||C==7||(C==8||U<=0?Oq(3):Oq(2));fWD(this);var n=this.Y.getStatus();this.Jf=n;var b=qXD(this);if(this.D=n==200){if(this.Ry&&!this.Ty){b:{if(this.Y){var E=g.o9(this.Y,"X-HTTP-Initial-Response");if(E&&!g.Bu(E)){var y=E;break b}}y=null}if(Y=y)this.Ty=!0,IW8(this,Y);else{this.D=!1;this.V=3;kY(12);xY(this);cA(this);break a}}if(this.vx){Y= !0;for(var X;!this.F8&&this.C0&&!this.oy&&(this.oy=!0,this.S.b3(this)):(xY(this),cA(this))}else IW8(this,b);V==4&&xY(this);this.D&&!this.F8&&(V==4?vdv(this.S,this):(this.D=!1,PA(this)))}else g.OEH(this.Y),n==400&&b.indexOf("Unknown SID")> 0?(this.V=3,kY(12)):(this.V=0,kY(13)),xY(this),cA(this)}}}catch(G){}finally{}}; g.R.cancel=function(){this.F8=!0;xY(this)}; g.R.EC=function(){this.sE=null;var Y=Date.now();Y-this.z5>=0?(this.Cb!=2&&(Oq(3),kY(17)),xY(this),this.V=2,cA(this)):h8D(this,this.z5-Y)}; g.R.getLastError=function(){return this.V}; g.R.YG=function(){return this.Y};QnL.prototype.cancel=function(){this.S=mMT(this);if(this.J)this.J.cancel(),this.J=null;else if(this.Y&&this.Y.size!==0){for(var Y=g.N(this.Y.values()),V=Y.next();!V.done;V=Y.next())V.value.cancel();this.Y.clear()}};g.R=FaD.prototype;g.R.hq=8;g.R.bI=1;g.R.connect=function(Y,V,C,U){kY(0);this.Zx=Y;this.F8=V||{};C&&U!==void 0&&(this.F8.OSID=C,this.F8.OAID=U);this.Ty=this.qJ;this.eL=$Mv(this,null,this.Zx);wh(this)}; g.R.disconnect=function(){KaL(this);if(this.bI==3){var Y=this.wT++,V=this.eL.clone();g.D1(V,"SID",this.W);g.D1(V,"RID",Y);g.D1(V,"TYPE","terminate");T$(this,V);Y=new qn(this,this.W,Y);Y.Cb=2;Y.X=o_(V.clone());V=!1;if(g.tx.navigator&&g.tx.navigator.sendBeacon)try{V=g.tx.navigator.sendBeacon(Y.X.toString(),"")}catch(C){}!V&&g.tx.Image&&((new Image).src=Y.X,V=!0);V||(Y.Y=JjL(Y.S,null),Y.Y.send(Y.X));Y.jL=Date.now();PA(Y)}UKb(this)}; g.R.PD=function(){return this.bI==0}; g.R.getState=function(){return this.bI}; g.R.Dw=function(Y){if(this.D)if(this.D=null,this.bI==1){if(!Y){this.wT=Math.floor(Math.random()*1E5);Y=this.wT++;var V=new qn(this,"",Y),C=this.L;this.Jf&&(C?(C=g.YV(C),g.VQ(C,this.Jf)):C=this.Jf);this.C!==null||this.z5||(V.eL=C,C=null);var U;if(this.tf)a:{for(var n=U=0;n4096){U=n;break a}if(U===4096||n===this.S.length-1){U=n+1;break a}}U= 1E3}else U=1E3;U=oQL(this,V,U);n=this.eL.clone();g.D1(n,"RID",Y);g.D1(n,"CVER",22);this.vx&&g.D1(n,"X-HTTP-Session-Id",this.vx);T$(this,n);C&&(this.z5?U="headers="+g.Dj(g.LoJ(C))+"&"+U:this.C&&g.A4(n,this.C,C));T1v(this.J,V);this.QE&&g.D1(n,"TYPE","init");this.tf?(g.D1(n,"$req",U),g.D1(n,"SID","null"),V.Ry=!0,kET(V,n,null)):kET(V,n,U);this.bI=2}}else this.bI==3&&(Y?VTW(this,Y):this.S.length==0||SXS(this.J)||VTW(this))}; g.R.kC=function(){this.X=null;CIv(this);if(this.Uc&&!(this.m8||this.Y==null||this.R2<=0)){var Y=2*this.R2;this.dT=JW((0,g.CN)(this.Xxb,this),Y)}}; g.R.Xxb=function(){this.dT&&(this.dT=null,this.Ty=!1,this.m8=!0,kY(10),fb(this),CIv(this))}; g.R.b3=function(Y){this.Y==Y&&this.Uc&&!this.m8&&(gdN(this),this.m8=!0,kY(11))}; g.R.iR=function(){this.sE!=null&&(this.sE=null,fb(this),lWN(this),kY(19))}; g.R.VH1=function(Y){Y?kY(2):kY(1)}; g.R.isActive=function(){return!!this.V&&this.V.isActive(this)}; g.R=bwW.prototype;g.R.Vj=function(){}; g.R.Ej=function(){}; g.R.o9=function(){}; g.R.nu=function(){}; g.R.isActive=function(){return!0}; g.R.F7=function(){};g.ib(Mn,g.Dk);Mn.prototype.open=function(){this.Y.V=this.S;this.D&&(this.Y.Cb=!0);this.Y.connect(this.V,this.J||void 0)}; Mn.prototype.close=function(){this.Y.disconnect()}; Mn.prototype.send=function(Y){var V=this.Y;if(typeof Y==="string"){var C={};C.__data__=Y;Y=C}else this.W&&(C={},C.__data__=g.m$(Y),Y=C);V.S.push(new Lab(V.fm++,Y));V.bI==3&&wh(V)}; Mn.prototype.u1=function(){this.Y.V=null;delete this.S;this.Y.disconnect();delete this.Y;Mn.JB.u1.call(this)}; g.ib(zzT,DMR);g.ib(iwD,unJ);g.ib($Y,bwW);$Y.prototype.Vj=function(){this.Y.dispatchEvent("m")}; $Y.prototype.Ej=function(Y){this.Y.dispatchEvent(new zzT(Y))}; $Y.prototype.o9=function(Y){this.Y.dispatchEvent(new iwD(Y))}; $Y.prototype.nu=function(){this.Y.dispatchEvent("n")};var I_=new g.Dk;g.W(GeL,g.HN);g.R=Qh.prototype;g.R.YL=null;g.R.lD=!1;g.R.DL=null;g.R.SO=null;g.R.Vq=null;g.R.PB=null;g.R.nQ=null;g.R.rP=null;g.R.So=null;g.R.ub=null;g.R.yh=0;g.R.Fq=null;g.R.Gk=null;g.R.J0=null;g.R.E0=-1;g.R.nV=!0;g.R.oT=!1;g.R.Jj=0;g.R.AC=null;var AOD={},s3N={};g.R=Qh.prototype;g.R.setTimeout=function(Y){this.J=Y}; g.R.Ch=function(Y){Y=Y.target;var V=this.AC;V&&g.gr(Y)==3?V.sI():this.i4(Y)}; g.R.i4=function(Y){try{if(Y==this.ub)a:{var V=g.gr(this.ub),C=this.ub.J,U=this.ub.getStatus();if(g.rC&&!g.qf("420+")){if(V<4)break a}else if(V<3||V==3&&!g.Hr(this.ub))break a;this.oT||V!=4||C==7||(C==8||U<=0?this.Y.Gz(3):this.Y.Gz(2));NKb(this);var n=this.ub.getStatus();this.E0=n;var b=g.Hr(this.ub);if(this.lD=n==200){V==4&&S6(this);if(this.vx){for(Y=!0;!this.oT&&this.yh0?(this.J0=3,Lb(13)):(this.J0=0,Lb(14)),S6(this),OwR(this)}}catch(y){}finally{}}; g.R.cancel=function(){this.oT=!0;S6(this)}; g.R.Kh=function(){this.DL=null;var Y=Date.now();Y-this.SO>=0?(this.PB!=2&&this.Y.Gz(3),S6(this),this.J0=2,Lb(18),OwR(this)):WPW(this,this.SO-Y)}; g.R.getLastError=function(){return this.J0};g.R=qWJ.prototype;g.R.pE=null;g.R.by=null;g.R.oZ=!1;g.R.Wg=null;g.R.xm=null;g.R.Sr=-1;g.R.LZ=null;g.R.De=null;g.R.connect=function(Y){this.Wg=Y;Y=j6(this.Y,null,this.Wg);Lb(3);Date.now();var V=this.Y.L;V!=null?(this.LZ=V[0],(this.De=V[1])?(this.xm=1,PIW(this)):(this.xm=2,xK8(this))):(Vh(Y,"MODE","init"),this.by=new Qh(this),this.by.YL=this.pE,u4v(this.by,Y,!1,null,!0),this.xm=0)}; g.R.B6=function(Y){if(Y)this.xm=2,xK8(this);else{Lb(4);var V=this.Y;V.aN=V.N1.Sr;FY(V,9)}Y&&this.Gz(2)}; g.R.I4=function(Y){return this.Y.I4(Y)}; g.R.abort=function(){this.by&&(this.by.cancel(),this.by=null);this.Sr=-1}; g.R.PD=function(){return!1}; g.R.FL=function(Y,V){this.Sr=Y.E0;if(this.xm==0)if(V){try{var C=this.J.parse(V)}catch(U){Y=this.Y;Y.aN=this.Sr;FY(Y,2);return}this.LZ=C[0];this.De=C[1]}else Y=this.Y,Y.aN=this.Sr,FY(Y,2);else this.xm==2&&(this.oZ?(Lb(7),Date.now()):V=="11111"?(Lb(6),this.oZ=!0,Date.now(),this.Sr=200,this.by.cancel(),Lb(12),tW(this.Y,this,!0)):(Lb(8),Date.now(),this.oZ=!1))}; g.R.u_=function(){this.Sr=this.by.E0;if(this.by.lD)this.xm==0?this.De?(this.xm=1,PIW(this)):(this.xm=2,xK8(this)):this.xm==2&&(this.oZ?(Lb(12),tW(this.Y,this,!0)):(Lb(11),tW(this.Y,this,!1)));else{this.xm==0?Lb(9):this.xm==2&&Lb(10);var Y=this.Y;this.by.getLastError();Y.aN=this.Sr;FY(Y,2)}}; g.R.iG=function(){return this.Y.iG()}; g.R.isActive=function(){return this.Y.isActive()}; g.R.Gz=function(Y){this.Y.Gz(Y)};g.R=cOS.prototype;g.R.X9=null;g.R.F4=null;g.R.IY=null;g.R.S0=null;g.R.R4=null;g.R.zj=null;g.R.Ku=null;g.R.jO=null;g.R.KQ=0;g.R.MW=0;g.R.wV=null;g.R.gi=null;g.R.Il=null;g.R.p5=null;g.R.N1=null;g.R.XH=null;g.R.E_=-1;g.R.cq=-1;g.R.aN=-1;g.R.ov=0;g.R.nI=0;g.R.Ir=8;var ktJ={OK:0,d_t:2,tuv:4,CN1:5,FG1:6,STOP:7,jB:8,BIs:9,Wr8:10,Rnn:11,vyt:12};g.ib(fXL,g.HN);g.ib(vQW,g.HN);g.R=cOS.prototype; g.R.connect=function(Y,V,C,U,n){Lb(0);this.R4=V;this.F4=C||{};U&&n!==void 0&&(this.F4.OSID=U,this.F4.OAID=n);this.X?(a_((0,g.CN)(this.Jx,this,Y),100),lXR(this)):this.Jx(Y)}; g.R.disconnect=function(){peJ(this);if(this.Y==3){var Y=this.KQ++,V=this.zj.clone();g.D1(V,"SID",this.W);g.D1(V,"RID",Y);g.D1(V,"TYPE","terminate");rh(this,V);Y=new Qh(this,this.W,Y);Y.PB=2;Y.nQ=o_(V.clone());(new Image).src=Y.nQ.toString();Y.Vq=Date.now();BKW(Y)}j3R(this)}; g.R.Jx=function(Y){this.N1=new qWJ(this);this.N1.pE=this.X9;this.N1.J=this.V;this.N1.connect(Y)}; g.R.PD=function(){return this.Y==0}; g.R.getState=function(){return this.Y}; g.R.fu=function(Y){this.gi=null;IX8(this,Y)}; g.R.Cu=function(){this.Il=null;this.S0=new Qh(this,this.W,"rpc",this.C);this.S0.YL=this.X9;this.S0.Jj=0;var Y=this.Ku.clone();g.D1(Y,"RID","rpc");g.D1(Y,"SID",this.W);g.D1(Y,"CI",this.XH?"0":"1");g.D1(Y,"AID",this.E_);rh(this,Y);g.D1(Y,"TYPE","xmlhttp");u4v(this.S0,Y,!0,this.jO,!1)}; g.R.FL=function(Y,V){if(this.Y!=0&&(this.S0==Y||this.IY==Y))if(this.aN=Y.E0,this.IY==Y&&this.Y==3)if(this.Ir>7){try{var C=this.V.parse(V)}catch(U){C=null}if(Array.isArray(C)&&C.length==3)if(Y=C,Y[0]==0)a:{if(!this.Il){if(this.S0)if(this.S0.Vq+3E30)){if(U=V==1)this.IY||this.gi||this.Y==1||this.ov>=2?U=!1:(this.gi=a_((0,g.CN)(this.fu,this,Y),Q38(this,this.ov)),this.ov++, U=!0);U=!(U||V==2&&SWL(this))}if(U)switch(C){case 1:FY(this,5);break;case 4:FY(this,10);break;case 3:FY(this,6);break;case 7:FY(this,12);break;default:FY(this,2)}}}; g.R.fh=function(Y){if(!g.Bv(arguments,this.Y))throw Error("Unexpected channel state: "+this.Y);}; g.R.EYv=function(Y){Y?Lb(2):(Lb(1),mKD(this,8))}; g.R.I4=function(Y){if(Y)throw Error("Can't create secondary domain capable XhrIo object.");Y=new g.e_;Y.C=!1;return Y}; g.R.isActive=function(){return!!this.wV&&this.wV.isActive(this)}; g.R.Gz=function(Y){var V=I_;V.dispatchEvent(new vQW(V,Y))}; g.R.iG=function(){return!1}; g.R=tTS.prototype;g.R.TK=function(){}; g.R.Qj=function(){}; g.R.Zw=function(){}; g.R.MY=function(){}; g.R.Bg=function(){}; g.R.l4=function(){return{}}; g.R.isActive=function(){return!0};g.R=ezS.prototype;g.R.enqueue=function(Y){this.J.push(Y)}; g.R.isEmpty=function(){return this.Y.length===0&&this.J.length===0}; g.R.clear=function(){this.Y=[];this.J=[]}; g.R.contains=function(Y){return g.Bv(this.Y,Y)||g.Bv(this.J,Y)}; g.R.remove=function(Y){var V=this.Y;var C=(0,g.vEL)(V,Y);C>=0?(g.sS(V,C),V=!0):V=!1;return V||g.AT(this.J,Y)}; g.R.WJ=function(){for(var Y=[],V=this.Y.length-1;V>=0;--V)Y.push(this.Y[V]);V=this.J.length;for(var C=0;C=JYv.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(Y=JYv[this.J],this.xX=g.Rj((0,g.CN)(this.qA,this),Y),this.J++):this.publish("pairingFailed",Error("Server error "+Y.status))}; g.R.xW=function(){this.Y=null;this.publish("pairingFailed",Error("Server not responding"))}; var JYv=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.ib(iF,E2);g.R=iF.prototype;g.R.start=function(){zB(this)&&this.publish("screenChange");!g.MM("yt-remote-lounge-token-expiration")&&xwL(this);g.Ny(this.Y);this.Y=g.Rj((0,g.CN)(this.start,this),1E4)}; g.R.add=function(Y,V){zB(this);Jcv(this,Y);yX(this,!1);this.publish("screenChange");V(Y);Y.token||xwL(this)}; g.R.remove=function(Y,V){var C=zB(this);qcJ(this,Y)&&(yX(this,!1),C=!0);V(Y);C&&this.publish("screenChange")}; g.R.l6=function(Y,V,C,U){var n=zB(this),b=this.get(Y.id);b?(b.name!=V&&(b.name=V,yX(this,!1),n=!0),C(Y)):U(Error("no such local screen."));n&&this.publish("screenChange")}; g.R.u1=function(){g.Ny(this.Y);iF.JB.u1.call(this)}; g.R.ZW=function(Y){zB(this);var V=this.screens.length;Y=Y&&Y.screens||[];for(var C=Y.length,U=0;U20)break a;y=V(b,E)}b=y}n.name=b}C(ZE(this,n))},this), onError:(0,g.CN)(function(n){U(Error("pairing request failed: "+n.status))},this), onTimeout:(0,g.CN)(function(){U(Error("pairing request timed out."))},this)})}; g.R.u1=function(){g.uE(this.J);g.uE(this.Y);GB.JB.u1.call(this)}; g.R.Av=function(){IhD(this);this.publish("screenChange");this.Y.update()}; GB.prototype.dispose=GB.prototype.dispose;g.ib(DE,g.D$);g.R=DE.prototype;g.R.KR=function(Y){this.Vs()||(Y&&(BL(this,""+Y),this.publish("sessionFailed")),this.Y=null,this.publish("sessionScreen",null))}; g.R.info=function(Y){VX(this.vx,Y)}; g.R.qY=function(){return null}; g.R.Ta=function(Y){var V=this.J;Y?(V.displayStatus=new chrome.cast.ReceiverDisplayStatus(Y,[]),V.displayStatus.showStop=!0):V.displayStatus=null;chrome.cast.setReceiverDisplayStatus(V,(0,g.CN)(function(){this.info("Updated receiver status for "+V.friendlyName+": "+Y)},this),(0,g.CN)(function(){BL(this,"Failed to update receiver status for: "+V.friendlyName)},this))}; g.R.u1=function(){this.Ta("");DE.JB.u1.call(this)};g.W(s2,DE);g.R=s2.prototype;g.R.M5=function(Y){if(this.S){if(this.S==Y)return;BL(this,"Overriding cast session with new session object");HID(this);this.jL=!1;this.L="unknown";this.S.removeUpdateListener(this.Jn);this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.dT)}this.S=Y;this.S.addUpdateListener(this.Jn);this.S.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.dT);e7v(this,"getMdxSessionStatus")}; g.R.dQ=function(Y){this.info("launchWithParams no-op for Cast: "+g.m$(Y))}; g.R.stop=function(){this.S?this.S.stop((0,g.CN)(function(){this.KR()},this),(0,g.CN)(function(){this.KR(Error("Failed to stop receiver app."))},this)):this.KR(Error("Stopping cast device without session."))}; g.R.Ta=function(){}; g.R.u1=function(){this.info("disposeInternal");HID(this);this.S&&(this.S.removeUpdateListener(this.Jn),this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.dT));this.S=null;DE.prototype.u1.call(this)}; g.R.iM1=function(Y,V){if(!this.Vs())if(V)if(V=Cb(V),g.YL(V))switch(Y=""+V.type,V=V.data||{},this.info("onYoutubeMessage_: "+Y+" "+g.m$(V)),Y){case "mdxSessionStatus":mwR(this,V);break;case "loungeToken":rcL(this,V);break;default:BL(this,"Unknown youtube message: "+Y)}else BL(this,"Unable to parse message.");else BL(this,"No data in message.")}; g.R.oO=function(Y,V,C,U){g.Ny(this.X);this.X=0;$wr(this.W,this.J.label,Y,this.J.friendlyName,(0,g.CN)(function(n){n?V(n):U>=0?(BL(this,"Screen "+Y+" appears to be offline. "+U+" retries left."),this.X=g.Rj((0,g.CN)(this.oO,this,Y,V,C,U-1),300)):C(Error("Unable to fetch screen."))},this),C)}; g.R.qY=function(){return this.S}; g.R.qW=function(Y){this.Vs()||Y||(BL(this,"Cast session died."),this.KR())};g.W(Ad,DE);g.R=Ad.prototype;g.R.M5=function(Y){this.S=Y;this.S.addUpdateListener(this.F8)}; g.R.dQ=function(Y){this.eL=Y;this.sE()}; g.R.stop=function(){E0L(this);this.S?this.S.stop((0,g.CN)(this.KR,this,null),(0,g.CN)(this.KR,this,"Failed to stop DIAL device.")):this.KR()}; g.R.u1=function(){E0L(this);this.S&&this.S.removeUpdateListener(this.F8);this.S=null;DE.prototype.u1.call(this)}; g.R.UC=function(Y){this.Vs()||Y||(BL(this,"DIAL session died."),this.V(),this.V=function(){},this.KR())};g.W(NC,DE);NC.prototype.stop=function(){this.KR()}; NC.prototype.M5=function(){}; NC.prototype.dQ=function(){g.Ny(this.S);this.S=NaN;var Y=G$(this.W.Su(),this.J.label);Y?uF(this,Y):this.KR(Error("No such screen"))}; NC.prototype.u1=function(){g.Ny(this.S);this.S=NaN;DE.prototype.u1.call(this)};g.W(O2,g.D$);g.R=O2.prototype; g.R.init=function(Y,V){chrome.cast.timeout.requestSession=3E4;var C=new chrome.cast.SessionRequest(this.X,[chrome.cast.Capability.AUDIO_OUT]);g.Jn("desktop_enable_cast_connect")&&(C.androidReceiverCompatible=!0);this.L||(C.dialRequest=new chrome.cast.DialRequest("YouTube"));var U=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;Y=Y||this.D?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var n=(0,g.CN)(this.Mx8,this);C=new chrome.cast.ApiConfig(C,(0,g.CN)(this.Rf, this),n,U,Y);C.customDialLaunchCallback=(0,g.CN)(this.zdL,this);chrome.cast.initialize(C,(0,g.CN)(function(){this.Vs()||(chrome.cast.addReceiverActionListener(this.V),W9v(),this.J.subscribe("onlineScreenChange",(0,g.CN)(this.Uj,this)),this.S=ygS(this),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.CN)(function(b){this.dF("Failed to set initial custom receivers: "+g.m$(b))},this)),this.publish("yt-remote-cast2-availability-change",Jd(this)),V(!0))},this),(0,g.CN)(function(b){this.dF("Failed to initialize API: "+ g.m$(b)); V(!1)},this))}; g.R.qF8=function(Y,V){k6("Setting connected screen ID: "+Y+" -> "+V);if(this.Y){var C=this.Y.Y;if(!Y||C&&C.id!=Y)k6("Unsetting old screen status: "+this.Y.J.friendlyName),du(this,null)}if(Y&&V){if(!this.Y){Y=G$(this.J.Su(),Y);if(!Y){k6("setConnectedScreenStatus: Unknown screen.");return}if(Y.idType=="shortLived"){k6("setConnectedScreenStatus: Screen with id type to be short lived.");return}C=zub(this,Y);C||(k6("setConnectedScreenStatus: Connected receiver not custom..."),C=new chrome.cast.Receiver(Y.uuid? Y.uuid:Y.id,Y.name),C.receiverType=chrome.cast.ReceiverType.CUSTOM,this.S.push(C),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.CN)(function(U){this.dF("Failed to set initial custom receivers: "+g.m$(U))},this))); k6("setConnectedScreenStatus: new active receiver: "+C.friendlyName);du(this,new NC(this.J,C),!0)}this.Y.Ta(V)}else k6("setConnectedScreenStatus: no screen.")}; g.R.wjt=function(Y){this.Vs()?this.dF("Setting connection data on disposed cast v2"):this.Y?this.Y.dQ(Y):this.dF("Setting connection data without a session")}; g.R.bR=function(){this.Vs()?this.dF("Stopping session on disposed cast v2"):this.Y?(this.Y.stop(),du(this,null)):k6("Stopping non-existing session")}; g.R.requestSession=function(){chrome.cast.requestSession((0,g.CN)(this.Rf,this),(0,g.CN)(this.zct,this))}; g.R.u1=function(){this.J.unsubscribe("onlineScreenChange",(0,g.CN)(this.Uj,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.V);var Y=sUD,V=g.rH("yt.mdx.remote.debug.handlers_");g.AT(V||[],Y);g.uE(this.Y);g.D$.prototype.u1.call(this)}; g.R.dF=function(Y){VX("Controller",Y)}; g.R.OJ=function(Y,V){this.Y==Y&&(V||du(this,null),this.publish("yt-remote-cast2-session-change",V))}; g.R.KXx=function(Y,V){if(!this.Vs())if(Y)switch(Y.friendlyName=chrome.cast.unescape(Y.friendlyName),k6("onReceiverAction_ "+Y.label+" / "+Y.friendlyName+"-- "+V),V){case chrome.cast.ReceiverAction.CAST:if(this.Y)if(this.Y.J.label!=Y.label)k6("onReceiverAction_: Stopping active receiver: "+this.Y.J.friendlyName),this.Y.stop();else{k6("onReceiverAction_: Casting to active receiver.");this.Y.Y&&this.publish("yt-remote-cast2-session-change",this.Y.Y);break}switch(Y.receiverType){case chrome.cast.ReceiverType.CUSTOM:du(this, new NC(this.J,Y));break;case chrome.cast.ReceiverType.DIAL:du(this,new Ad(this.J,Y,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:du(this,new s2(this.J,Y,this.config_));break;default:this.dF("Unknown receiver type: "+Y.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Y&&this.Y.J.label==Y.label?this.Y.stop():this.dF("Stopping receiver w/o session: "+Y.friendlyName)}else this.dF("onReceiverAction_ called without receiver.")}; g.R.zdL=function(Y){if(this.Vs())return Promise.reject(Error("disposed"));var V=Y.receiver;V.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dF("Not DIAL receiver: "+V.friendlyName),V.receiverType=chrome.cast.ReceiverType.DIAL);var C=this.Y?this.Y.J:null;if(!C||C.label!=V.label)return this.dF("Receiving DIAL launch request for non-clicked DIAL receiver: "+V.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(C&&C.label==V.label&&C.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Y.Y)return k6("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Y.Y),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dF('Changing CAST intent from "'+C.receiverType+'" to "dial" for '+V.friendlyName);du(this,new Ad(this.J,V,this.W,this.config_))}V=this.Y;V.X=Y;V.X.appState==chrome.cast.DialAppState.RUNNING?(Y=V.X.extraData||{},C=Y.screenId||null,Rq(V)&&Y.loungeToken?Y.loungeTokenRefreshIntervalMs?Y=UPv(V,{name:V.J.friendlyName,screenId:Y.screenId,loungeToken:Y.loungeToken,dialId:V.X.receiver.label, screenIdType:"shortLived"},Y.loungeTokenRefreshIntervalMs):(g.oj(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(Y)+".")),Y=n0b(V,C)):Y=n0b(V,C)):Y=V4A(V);return Y}; g.R.Rf=function(Y){var V=this;if(!this.Vs()&&!this.D){k6("New cast session ID: "+Y.sessionId);var C=Y.receiver;if(C.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Y)if(C.receiverType==chrome.cast.ReceiverType.CAST)k6("Got resumed cast session before resumed mdx connection."),C.friendlyName=chrome.cast.unescape(C.friendlyName),du(this,new s2(this.J,C,this.config_),!0);else{this.dF("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var U=this.Y.J,n=G$(this.J.Su(), U.label);n&&yh(n,C.label)&&U.receiverType!=chrome.cast.ReceiverType.CAST&&C.receiverType==chrome.cast.ReceiverType.CAST&&(k6("onSessionEstablished_: manual to cast session change "+C.friendlyName),g.uE(this.Y),this.Y=new s2(this.J,C,this.config_),this.Y.subscribe("sessionScreen",(0,g.CN)(this.OJ,this,this.Y)),this.Y.subscribe("sessionFailed",function(){return i4J(V,V.Y)}),this.Y.dQ(null)); this.Y.M5(Y)}}}; g.R.Hh=function(){return this.Y?this.Y.qY():null}; g.R.zct=function(Y){this.Vs()||(this.dF("Failed to estabilish a session: "+g.m$(Y)),Y.code!=chrome.cast.ErrorCode.CANCEL&&du(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.R.Mx8=function(Y){k6("Receiver availability updated: "+Y);if(!this.Vs()){var V=Jd(this);this.C=Y==chrome.cast.ReceiverAvailability.AVAILABLE;Jd(this)!=V&&this.publish("yt-remote-cast2-availability-change",Jd(this))}}; g.R.Uj=function(){this.Vs()||(this.S=ygS(this),k6("Updating custom receivers: "+g.m$(this.S)),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.CN)(function(){this.dF("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Jd(this)))}; O2.prototype.setLaunchParams=O2.prototype.wjt;O2.prototype.setConnectedScreenStatus=O2.prototype.qF8;O2.prototype.stopSession=O2.prototype.bR;O2.prototype.getCastSession=O2.prototype.Hh;O2.prototype.requestSession=O2.prototype.requestSession;O2.prototype.init=O2.prototype.init;O2.prototype.dispose=O2.prototype.dispose;var RuN=[];g.R=vL.prototype; g.R.reset=function(Y){this.listId="";this.index=-1;this.videoId="";dPb(this);this.volume=-1;this.muted=!1;Y&&(this.index=Y.index,this.listId=Y.listId,this.videoId=Y.videoId,this.playerState=Y.playerState,this.volume=Y.volume,this.muted=Y.muted,this.audioTrackId=Y.audioTrackId,this.trackData=Y.trackData,this.ww=Y.hasPrevious,this.ju=Y.hasNext,this.D=Y.playerTime,this.V=Y.playerTimeAt,this.J=Y.seekableStart,this.C=Y.seekableEnd,this.S=Y.duration,this.X=Y.loadedTime,this.Y=Y.liveIngestionTime,this.W= !isNaN(this.Y))}; g.R.isPlaying=function(){return this.playerState==1}; g.R.isBuffering=function(){return this.playerState==3}; g.R.zs=function(){return this.playerState==1081}; g.R.f9=function(Y){this.S=isNaN(Y)?0:Y}; g.R.getDuration=function(){return this.W?this.S+wu(this):this.S}; g.R.clone=function(){return new vL(PSL(this))};g.W(MC,g.D$);g.R=MC.prototype;g.R.getState=function(){return this.S}; g.R.k$=function(){return this.W.getReconnectTimeout()}; g.R.TJ=function(){this.W.reconnect()}; g.R.play=function(){Iq(this)?(this.Y?this.Y.play(null,g.DI,mz(this,"play")):SE(this,"play"),huS(this,1,pR(aq(this))),this.publish("remotePlayerChange")):LR(this,this.play)}; g.R.pause=function(){Iq(this)?(this.Y?this.Y.pause(null,g.DI,mz(this,"pause")):SE(this,"pause"),huS(this,2,pR(aq(this))),this.publish("remotePlayerChange")):LR(this,this.pause)}; g.R.seekTo=function(Y){if(Iq(this)){if(this.Y){var V=aq(this),C=new chrome.cast.media.SeekRequest;C.currentTime=Y;V.isPlaying()||V.isBuffering()?C.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:C.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Y.seek(C,g.DI,mz(this,"seekTo",{newTime:Y}))}else SE(this,"seekTo",{newTime:Y});huS(this,3,Y);this.publish("remotePlayerChange")}else LR(this,g.nN(this.seekTo,Y))}; g.R.stop=function(){if(Iq(this)){this.Y?this.Y.stop(null,g.DI,mz(this,"stopVideo")):SE(this,"stopVideo");var Y=aq(this);Y.index=-1;Y.videoId="";dPb(Y);QX(this,Y);this.publish("remotePlayerChange")}else LR(this,this.stop)}; g.R.setVolume=function(Y,V){if(Iq(this)){var C=aq(this);if(this.J){if(C.volume!=Y){var U=Math.round(Y)/100;this.J.setReceiverVolumeLevel(U,(0,g.CN)(function(){CR("set receiver volume: "+U)},this),(0,g.CN)(function(){this.dF("failed to set receiver volume.")},this))}C.muted!=V&&this.J.setReceiverMuted(V,(0,g.CN)(function(){CR("set receiver muted: "+V)},this),(0,g.CN)(function(){this.dF("failed to set receiver muted.")},this))}else{var n={volume:Y, muted:V};C.volume!=-1&&(n.delta=Y-C.volume);SE(this,"setVolume",n)}C.muted=V;C.volume=Y;QX(this,C)}else LR(this,g.nN(this.setVolume,Y,V))}; g.R.Hq=function(Y,V){if(Iq(this)){var C=aq(this);Y={videoId:Y};V&&(C.trackData={trackName:V.name,languageCode:V.languageCode,sourceLanguageCode:V.translationLanguage?V.translationLanguage.languageCode:"",languageName:V.languageName,kind:V.kind},Y.style=g.m$(V.style),g.VQ(Y,C.trackData));SE(this,"setSubtitlesTrack",Y);QX(this,C)}else LR(this,g.nN(this.Hq,Y,V))}; g.R.setAudioTrack=function(Y,V){Iq(this)?(V=V.getLanguageInfo().getId(),SE(this,"setAudioTrack",{videoId:Y,audioTrackId:V}),Y=aq(this),Y.audioTrackId=V,QX(this,Y)):LR(this,g.nN(this.setAudioTrack,Y,V))}; g.R.playVideo=function(Y,V,C,U,n,b,E){U=U===void 0?null:U;n=n===void 0?null:n;b=b===void 0?null:b;E=E===void 0?null:E;var y=aq(this),X={videoId:Y};C!==void 0&&(X.currentIndex=C);TB(y,Y,C||0);V!==void 0&&(lF(y,V),X.currentTime=V);U&&(X.listId=U);n&&(X.playerParams=n);b&&(X.clickTrackingParams=b);E&&(X.locationInfo=g.m$(E));SE(this,"setPlaylist",X);U||QX(this,y)}; g.R.v4=function(Y,V){if(Iq(this)){if(Y&&V){var C=aq(this);TB(C,Y,V);QX(this,C)}SE(this,"previous")}else LR(this,g.nN(this.v4,Y,V))}; g.R.nextVideo=function(Y,V){if(Iq(this)){if(Y&&V){var C=aq(this);TB(C,Y,V);QX(this,C)}SE(this,"next")}else LR(this,g.nN(this.nextVideo,Y,V))}; g.R.k6=function(){if(Iq(this)){SE(this,"clearPlaylist");var Y=aq(this);Y.reset();QX(this,Y);this.publish("remotePlayerChange")}else LR(this,this.k6)}; g.R.ix=function(){Iq(this)?SE(this,"dismissAutoplay"):LR(this,this.ix)}; g.R.dispose=function(){if(this.S!=3){var Y=this.S;this.S=3;this.publish("proxyStateChange",Y,this.S)}g.D$.prototype.dispose.call(this)}; g.R.u1=function(){cgL(this);this.W=null;this.V.clear();$6(this,null);g.D$.prototype.u1.call(this)}; g.R.xZ=function(Y){if((Y!=this.S||Y==2)&&this.S!=3&&Y!=0){var V=this.S;this.S=Y;this.publish("proxyStateChange",V,Y);if(Y==1)for(;!this.V.isEmpty();)V=Y=this.V,V.Y.length===0&&(V.Y=V.J,V.Y.reverse(),V.J=[]),Y.Y.pop().apply(this);else Y==3&&this.dispose()}}; g.R.Vxy=function(Y,V){this.publish(Y,V)}; g.R.bbx=function(Y){if(!Y)this.g5(null),$6(this,null);else if(this.J.receiver.volume){Y=this.J.receiver.volume;var V=aq(this),C=Math.round(100*Y.level||0);if(V.volume!=C||V.muted!=Y.muted)CR("Cast volume update: "+Y.level+(Y.muted?" muted":"")),V.volume=C,V.muted=!!Y.muted,QX(this,V)}}; g.R.g5=function(Y){CR("Cast media: "+!!Y);this.Y&&this.Y.removeUpdateListener(this.X);if(this.Y=Y)this.Y.addUpdateListener(this.X),f7b(this),this.publish("remotePlayerChange")}; g.R.Hb8=function(Y){Y?(f7b(this),this.publish("remotePlayerChange")):this.g5(null)}; g.R.Ow=function(){SE(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.R.Ans=function(){var Y=O4W();Y&&$6(this,Y)}; g.R.dF=function(Y){VX("CP",Y)};g.W(eE,g.D$);g.R=eE.prototype; g.R.connect=function(Y,V){if(V){var C=V.listId,U=V.videoId,n=V.videoIds,b=V.playerParams,E=V.clickTrackingParams,y=V.index,X={videoId:U},G=V.currentTime,Z=V.locationInfo;V=V.loopMode;G!==void 0&&(X.currentTime=G<=5?0:G);b&&(X.playerParams=b);Z&&(X.locationInfo=Z);E&&(X.clickTrackingParams=E);C&&(X.listId=C);n&&n.length>0&&(X.videoIds=n.join(","));y!==void 0&&(X.currentIndex=y);this.F8&&(X.loopMode=V||"LOOP_MODE_OFF");C&&(this.Y.listId=C);this.Y.videoId=U;this.Y.index=y||0;this.Y.state=3;lF(this.Y, G);this.V="UNSUPPORTED";C=this.F8?"setInitialState":"setPlaylist";jE("Connecting with "+C+" and params: "+g.m$(X));this.J.connect({method:C,params:g.m$(X)},Y,rnS())}else jE("Connecting without params"),this.J.connect({},Y,rnS());p1A(this)}; g.R.DS=function(Y){this.J.DS(Y)}; g.R.dispose=function(){this.Vs()||(g.e2("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),td(this,3));g.D$.prototype.dispose.call(this)}; g.R.u1=function(){TOS(this);M4D(this);$PR(this);g.Ny(this.X);this.X=NaN;g.Ny(this.L);this.L=NaN;this.W=null;g.P8(this.sE);this.sE.length=0;this.J.dispose();g.D$.prototype.u1.call(this);this.V=this.C=this.S=this.Y=this.J=null}; g.R.oh=function(Y){if(!this.S||this.S.length===0)return!1;for(var V=g.N(this.S),C=V.next();!C.done;C=V.next())if(!C.value.capabilities.has(Y))return!1;return!0}; g.R.Bc=function(){var Y=3;this.Vs()||(Y=0,isNaN(this.KL())?this.J.Mf()&&isNaN(this.D)&&(Y=1):Y=2);return Y}; g.R.We=function(Y){jE("Disconnecting with "+Y);g.e2("yt.mdx.remote.remoteClient_",null);TOS(this);this.publish("beforeDisconnect",Y);Y==1&&uD();this.J.disconnect(Y);this.dispose()}; g.R.Sq=function(){var Y=this.Y;this.W&&(Y=this.Y.clone(),TB(Y,this.W,Y.index));return PSL(Y)}; g.R.mwT=function(Y){var V=this,C=new vL(Y);C.videoId&&C.videoId!=this.Y.videoId&&(this.W=C.videoId,g.Ny(this.X),this.X=g.Rj(function(){if(V.W){var n=V.W;V.W=null;V.Y.videoId!=n&&ru(V,"getNowPlaying")}},5E3)); var U=[];this.Y.listId==C.listId&&this.Y.videoId==C.videoId&&this.Y.index==C.index||U.push("remoteQueueChange");this.Y.playerState==C.playerState&&this.Y.volume==C.volume&&this.Y.muted==C.muted&&pR(this.Y)==pR(C)&&g.m$(this.Y.trackData)==g.m$(C.trackData)||U.push("remotePlayerChange");this.Y.reset(Y);g.Tv(U,function(n){this.publish(n)},this)}; g.R.aO=function(){var Y=this.J.getDeviceId(),V=g.D8(this.S,function(C){return C.type=="REMOTE_CONTROL"&&C.id!=Y}); return V?V.id:""}; g.R.KL=function(){return this.J.k$()}; g.R.qg=function(){return this.V||"UNSUPPORTED"}; g.R.UD=function(){return this.C||""}; g.R.wf=function(){!isNaN(this.KL())&&this.J.TJ()}; g.R.gV8=function(Y,V){ru(this,Y,V);I7L(this)}; g.R.b4=function(){var Y=g.Ij("SAPISID","")||g.Ij("__Secure-1PAPISID")||"",V=g.Ij("__Secure-3PAPISID","")||"";if(!Y&&!V)return"";Y=g.EZ(g.bh(Y),2);V=g.EZ(g.bh(V),2);return g.EZ(g.bh(","+Y+","+V),2)}; eE.prototype.subscribe=eE.prototype.subscribe;eE.prototype.unsubscribeByKey=eE.prototype.HF;eE.prototype.getProxyState=eE.prototype.Bc;eE.prototype.disconnect=eE.prototype.We;eE.prototype.getPlayerContextData=eE.prototype.Sq;eE.prototype.setPlayerContextData=eE.prototype.mwT;eE.prototype.getOtherConnectedRemoteId=eE.prototype.aO;eE.prototype.getReconnectTimeout=eE.prototype.KL;eE.prototype.getAutoplayMode=eE.prototype.qg;eE.prototype.getAutoplayVideoId=eE.prototype.UD;eE.prototype.reconnect=eE.prototype.wf; eE.prototype.sendMessage=eE.prototype.gV8;eE.prototype.getXsrfToken=eE.prototype.b4;eE.prototype.isCapabilitySupportedOnConnectedDevices=eE.prototype.oh;g.W(H4N,E2);g.R=H4N.prototype;g.R.Su=function(Y){return this.BF.$_gs(Y)}; g.R.contains=function(Y){return!!this.BF.$_c(Y)}; g.R.get=function(Y){return this.BF.$_g(Y)}; g.R.start=function(){this.BF.$_st()}; g.R.add=function(Y,V,C){this.BF.$_a(Y,V,C)}; g.R.remove=function(Y,V,C){this.BF.$_r(Y,V,C)}; g.R.l6=function(Y,V,C,U){this.BF.$_un(Y,V,C,U)}; g.R.u1=function(){for(var Y=this.Y.length,V=0;V1&&!this.B.getOption("remote","quickCast")?(this.DP=g.$L(Y,this.Y,this),this.rh(g.KU(Y,this.Y)),Y=this.B.getOption("remote","currentReceiver"),Y=this.Y(Y),this.options[Y]&&this.rV(Y),this.enable(!0)):this.enable(!1)}; DP.prototype.Y=function(Y){return Y.key}; DP.prototype.AR=function(Y){return Y==="cast-selector-receiver"?"Cast...":this.DP[Y].name}; DP.prototype.IH=function(Y){g.aa.prototype.IH.call(this,Y);this.B.setOption("remote","currentReceiver",this.DP[Y]);this.jf.Fa()};g.W(Wuv,g.NG);g.R=Wuv.prototype; g.R.create=function(){var Y=this.player.U(),V=g.Qs(Y);Y={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:Y.K("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:Y.K("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:Y.K("enable_cast_short_lived_lounge_token")};URv(V,Y);this.subscriptions.push(g.zp("yt-remote-before-disconnect",this.x8s,this));this.subscriptions.push(g.zp("yt-remote-connection-change",this.Q2n,this));this.subscriptions.push(g.zp("yt-remote-receiver-availability-change",this.uV, this));this.subscriptions.push(g.zp("yt-remote-auto-connect",this.Cds,this));this.subscriptions.push(g.zp("yt-remote-receiver-resumed",this.ccx,this));this.subscriptions.push(g.zp("mdx-privacy-popup-confirm",this.LiL,this));this.subscriptions.push(g.zp("mdx-privacy-popup-cancel",this.N8x,this));this.uV()}; g.R.load=function(){this.player.cancelPlayback();g.NG.prototype.load.call(this);this.Wb=new RYS(this.player.U(),this);this.player.GD(this.Wb);this.Gr=new ujb(this,this.player,this.zv);var Y=(Y=GtA())?Y.currentTime:0;var V=iYv()?new MC(nd(),void 0):null;Y==0&&V&&(Y=pR(aq(V)));Y!==0&&this.KW(Y);NSD(this,this.g8,this.g8);this.player.Fy(6)}; g.R.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.V0();this.zF=this.IQ;g.B_(this.Gr,this.zv);this.zv=this.Wb=this.Gr=null;g.NG.prototype.unload.call(this);this.player.Fy(5);uM(this)}; g.R.u1=function(){g.iS(this.subscriptions);g.NG.prototype.u1.call(this)}; g.R.fS=function(Y){var V=g.TT.apply(1,arguments);this.loaded&&this.Gr.BY.apply(this.Gr,[Y].concat(g.P(V)))}; g.R.getAdState=function(){return this.pT}; g.R.ww=function(){return this.zv?aq(this.zv).ww:!1}; g.R.ju=function(){return this.zv?aq(this.zv).ju:!1}; g.R.KW=function(Y,V){this.Q7=Y||0;this.player.publish("progresssync",Y,V);this.player.yw("onVideoProgress",Y||0)}; g.R.getCurrentTime=function(){return this.Q7}; g.R.getDuration=function(){return aq(this.zv).getDuration()||0}; g.R.j2=function(){var Y=aq(this.zv);return Y.W?Y.Y+wu(Y):Y.Y}; g.R.WY=function(){return aq(this.zv).X}; g.R.aS=function(){return qkR(aq(this.zv))}; g.R.En=function(){var Y=aq(this.zv);return Y.J>0?Y.J+wu(Y):Y.J}; g.R.getProgressState=function(){var Y=aq(this.zv),V=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!Y.zs()&&this.player.Gm(),clipEnd:V.clipEnd,clipStart:V.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.j2(),isAtLiveHead:this.isAtLiveHead(),loaded:this.WY(),seekableEnd:this.aS(),seekableStart:this.En(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.R.isAtLiveHead=function(){return qkR(aq(this.zv))-this.getCurrentTime()<=1}; g.R.nextVideo=function(){this.zv&&this.zv.nextVideo()}; g.R.v4=function(){this.zv&&this.zv.v4()}; g.R.x8s=function(Y){Y===1&&(this.qx=this.zv?aq(this.zv):null)}; g.R.Q2n=function(){var Y=iYv()?new MC(nd(),void 0):null;if(Y){var V=this.zF;this.loaded&&this.unload();this.zv=Y;this.qx=null;V.key!==this.IQ.key&&(this.zF=V,this.load())}else g.uE(this.zv),this.zv=null,this.loaded&&(this.unload(),(Y=this.qx)&&Y.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(Y.videoId,pR(Y)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.R.uV=function(){var Y=[this.IQ],V=Y.concat,C=nyS();cL()&&g.MM("yt-remote-cast-available")&&C.push({key:"cast-selector-receiver",name:"Cast..."});this.DP=V.call(Y,C);Y=EyL()||this.IQ;B9(this,Y);this.player.yw("onMdxReceiversChange")}; g.R.Cds=function(){var Y=EyL();B9(this,Y)}; g.R.ccx=function(){this.zF=EyL()}; g.R.LiL=function(){this.uM=!0;uM(this);iM=!1;bM&&zf(bM,1);bM=null}; g.R.N8x=function(){this.uM=!1;uM(this);B9(this,this.IQ);this.zF=this.IQ;iM=!1;bM=null;this.player.playVideo()}; g.R.mS=function(Y,V){switch(Y){case "casting":return this.loaded;case "receivers":return this.DP;case "currentReceiver":return V&&(V.key==="cast-selector-receiver"?kpA():B9(this,V)),this.loaded?this.zF:this.IQ;case "quickCast":return this.DP.length===2&&this.DP[1].key==="cast-selector-receiver"?(V&&kpA(),!0):!1}}; g.R.Ow=function(){this.zv.Ow()}; g.R.M_=function(){return!1}; g.R.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.R.isLoggedIn=function(){var Y,V;return((Y=g.Fh("PLAYER_CONFIG"))==null?void 0:(V=Y.args)==null?void 0:V.authuser)!==void 0?!0:!(!g.Fh("SESSION_INDEX")&&!g.Fh("LOGGED_IN"))};g.WU("remote",Wuv);})(_yt_player);