(function(g){var window=this;'use strict';var b7v=function(K,W){if(U_(K)&&!K.U){var U=null;W&&(U={style:K.D.getSubtitlesUserSettings()},Object.assign(U,W));K.fg.Im(K.D.getVideoData(1).videoId,U);K.W=h$(K.fg).trackData}},m4=function(K,W){return g.dG(K,function(U){return j4(U,W)})},S4=function(){return g.vB("yt.mdx.remote.connection_")},j4=function(K,W){return!!W&&(K.id==W||K.uuid==W)},VFj=function(K){var W={}; W.pairingCode=K.DA;W.theme=K.tK;sP4()&&(W.env_useStageMdx=1);return g.NH(W)},va4=function(){var K=fK(),W=t$(); g.tA()&&g.qP(K,W);K=XrF(K);if(K.length==0)try{g.S2("remote_sid")}catch(U){}else try{g.AQ("remote_sid",K.join(","),-1)}catch(U){}},hNZ=function(K,W){var U=null; if(K.j==W){GH(K);q0n(K);K.j=null;var h=2}else if(xjb(K.X,W))U=W.uX,CEO(K.X,W),h=1;else return;if(K.p_!=0)if(W.G)if(h==1){U=W.jV?W.jV.length:0;W=Date.now()-W.Ns;var m=K.Ns;h=l6F();h.dispatchEvent(new Ld3(h,U,W,m));I7(K)}else K0t(K);else{var S=W.Qg;m=W.getLastError();if(m==3||m==0&&S>0||!(h==1&&W0H(K,W)||h==2&&UqI(K)))switch(U&&U.length>0&&(W=K.X,W.N=W.N.concat(U)),m){case 1:d7(K,5);break;case 4:d7(K,10);break;case 3:d7(K,6);break;default:d7(K,2)}}},j1I=function(K){g.qE(K.jV); K.jV=g.FE(function(){K.z3(1)},864E5)},mq4=function(K){J$(K); K.J&&(g.qs.clearTimeout(K.J),K.J=null);GH(K);K.X.cancel();K.G&&(typeof K.G==="number"&&g.qs.clearTimeout(K.G),K.G=null)},SKF=function(K,W){return g.dG(K,function(U){return U||W?!U!=!W?!1:U.id==W.id:!0})},fbW=function(K){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(K)},tE3=function(K){g.SI("yt-remote-connected-devices",K,86400)},IbZ=function(){var K=g.Dk.wK(); K&&GoO(K,K.D1.Cv(!0))},dqZ=function(K){if(K.X!=null)return K.N.concat(K.X.uX); if(K.j!=null&&K.j.size!==0){var W=K.N;K=g.z(K.j.values());for(var U=K.next();!U.done;U=K.next())W=W.concat(U.value.uX);return W}return g.k4(K.N)},EEh=function(K,W){K.compatibleSenderThemes.clear(); g.yb(W.split(","),g.jt(J6t,eNZ)).forEach(function(U){K.compatibleSenderThemes.add(U)})},BlH=function(){},TlI=function(K,W){var U=null; if(W){var h=DqF(K);h&&(U={clientName:h.clientName,deviceMake:h.brand,deviceModel:h.model,osVersion:h.osVersion})}g.Vk("yt.mdx.remote.remoteClient_",U);W&&(HX4(K),r6W(K));U=K.X.Kj()&&isNaN(K.G);W==U?W&&(e4(K,1),E_(K,"getSubtitlesTrack")):W?(K.IV()&&K.j.reset(),e4(K,1),E_(K,"getNowPlaying"),j1I(K)):K.z3(1)},waj=function(K){g.wP.call(this,K); this.bA={key:abj(),name:"This computer"};this.gX=null;this.subscriptions=[];this.GW=this.fg=null;this.sS=[this.bA];this.UO=this.bA;this.RR=new g.Kw(64);this.Wc=0;this.n_=-1;this.Kd=!1;this.zz=this.En=this.We=null;if(!g.r8(this.player.V())&&!g.l1(this.player.V())){K=this.player;var W=g.dK(K);W&&(W=W.Es())&&(W=new B0(K,W),g.k(this,W));W=new Dw(K);g.k(this,W);g.HW(K,W.element,4);this.We=new H0;g.k(this,this.We);g.HW(K,this.We.element,4);this.Kd=!!r7()}},e4=function(K,W){K.publish("proxyStateChange", W)},r7=function(){var K=g.tA(); if(!K)return null;var W=TH();if(!W)return null;W=W.Ha();return m4(W,K)},$qf=function(K){return Array.isArray(K)?g.CB(K,Q1W):[]},YKb=function(K,W){var U=new a7; if(g.qs.Image){var h=new Image;h.onload=g.jt(w7,U,"TestLoadImage: loaded",!0,W,h);h.onerror=g.jt(w7,U,"TestLoadImage: error",!1,W,h);h.onabort=g.jt(w7,U,"TestLoadImage: abort",!1,W,h);h.ontimeout=g.jt(w7,U,"TestLoadImage: timeout",!1,W,h);g.qs.setTimeout(function(){if(h.ontimeout)h.ontimeout()},1E4); h.src=K}else W(!1)},GoO=function(K,W){OX4(K,W).forEach(function(U){g.mI.prototype.remove.call(this,U)},K)},c6h=function(K){return"chrome-extension://"+K+"/cast_sender.js"},nEW=function(K,W){return new g.eF(K,W)},gEW=function(K,W,U){var h=new Image; h.onload=function(){try{Q9(h),U(!0)}catch(m){}}; h.onerror=function(){try{Q9(h),U(!1)}catch(m){}}; h.onabort=function(){try{Q9(h),U(!1)}catch(m){}}; h.ontimeout=function(){try{Q9(h),U(!1)}catch(m){}}; g.qs.setTimeout(function(){if(h.ontimeout)h.ontimeout()},W); h.src=K},$O=function(K,W){var U=K.j; K.X&&(U=K.scheme+"://"+K.domain+K.port+K.j);return g.sL(U+W,{})},O_=function(K){if(K.size!=K.j.length){for(var W=0,U=0;W=K.length)return g.dg;if(W in K)return g.JN(K[W++]);W++}}; return U}throw Error("Not implemented");},Fv=function(K){K||(g.HX("yt-remote-session-screen-id"),g.HX("yt-remote-session-video-id")); va4();K=fK();g.sS(K,t$());tE3(K)},CEO=function(K,W){K.X&&K.X==W?K.X=null:K.j&&K.j.has(W)&&K.j.delete(W)},uA=function(K,W){g.p.call(this); this.j=new g.QC(this.bCs,0,this);g.k(this,this.j);this.y6=5E3;this.QE=0;if(typeof K==="function")W&&(K=(0,g.wr)(K,W));else if(K&&typeof K.handleEvent==="function")K=(0,g.wr)(K.handleEvent,K);else throw Error("Invalid listener argument");this.X=K},oEI=function(K){return g.CB(K,function(W){return{key:W.id, name:W.name}})},kO=function(K){return K?'{name:"'+K.name+'",id:'+K.id.substr(0,6)+"..,token:"+((K.token?".."+K.token.slice(-6):"-")+",uuid:"+(K.uuid?".."+K.uuid.slice(-6):"-")+",idType:"+K.idType+",secret:")+((K.secret?".."+K.secret.slice(-6):"-")+"}"):"null"},iA=function(K){if(g.qs.JSON)try{return g.qs.JSON.parse(K)}catch(W){}return ZXN(K)},zH=function(K,W,U){return U&&U.ige?U.ige[K]||W:W},bXZ=function(){return g.vB("yt.mdx.remote.channelParams_")||{}},s1t=function(K,W){for(var U=K.screens.length, h=0;h=K.W:!1},lbj=function(K,W,U){if(g.y3(K))g.tD(K,W,U); else for(K=paO(K);;){var h=K.next();if(h.done)break;W.call(U,h.value,void 0,K)}},pK=function(K,W){L0I(g.CB(K.screens,K1f)); W&&vEN()},W1I=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/channel/closed",g.Mk("channel_type"))},Zw=function(K,W){K.eV&&g.hI(K.eV,function(U,h){g.aT(W,h,U)}); K.U&&g.hI({},function(U,h){g.aT(W,h,U)})},jhO=function(K,W){if(W)if(K.K4>6){K.X=K.N.concat(K.X); K.N.length=0;var U=K.F2-1;W=U1v(K)}else U=W.Y,W=W.E2;else U=K.F2++,W=U1v(K);var h=K.fQ.clone();g.aT(h,"SID",K.W);g.aT(h,"RID",U);g.aT(h,"AID",K.RE);A$(K,h);U=new bA(K,K.W,U,K.IE+1);U.w2=K.Pa;U.setTimeout(1E4+Math.round(1E4*Math.random()));K.BS=U;hr4(U,h,W)},I7=function(K){C03(K.X)||K.G||(K.G=!0,g.kK(K.Dm,K),K.Ns=0)},TH=function(){if(!m1f){var K=g.vB("yt.mdx.remote.screenService_"); m1f=K?new SDj(K):null}return m1f},tDO=function(K){s_(K)&&K.N.getDialAppInfo(function(W){K.info("getDialAppInfo dialLaunchData: "+JSON.stringify(W)); W=W.extraData||{};var U=null;if(W.loungeToken){var h;((h=K.j)==null?void 0:h.token)==W.loungeToken&&(U="staleLoungeToken")}else U="missingLoungeToken";U?(K.Ns=U,V9(K,3E4)):(K.uX=!1,K.Ns="unknown",flb(K,W.loungeToken),V9(K,W.loungeTokenRefreshIntervalMs))},function(W){K.info("getDialAppInfo error: "+W); K.Ns="noLoungeTokenResponse";V9(K,3E4)})},GWn=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Ilb=function(K,W){return K===W},Xv=function(K){K.publish("handlerOpened"); K.Ik.Vh("BROWSER_CHANNEL")},QhW=function(K,W){W=W.message; W.params?v0("Received: action="+W.action+", params="+g.rc(W.params)):v0("Received: action="+W.action+" {}");switch(W.action){case "loungeStatus":W=iA(W.params.devices);K.N=g.CB(W,function(h){return new qA(h)}); W=!!g.dG(K.N,function(h){return h.type=="LOUNGE_SCREEN"}); TlI(K,W);W=K.l8("mlm");K.publish("multiStateLoopEnabled",W);break;case "loungeScreenDisconnected":g.Br(K.N,function(h){return h.type=="LOUNGE_SCREEN"}); TlI(K,!1);break;case "remoteConnected":var U=new qA(iA(W.params.device));g.dG(K.N,function(h){return h.equals(U)})||d14(K.N,U); break;case "remoteDisconnected":U=new qA(iA(W.params.device));g.Br(K.N,function(h){return h.equals(U)}); break;case "gracefulDisconnect":break;case "playlistModified":JM4(K,W,"QUEUE_MODIFIED");break;case "nowPlaying":erH(K,W);break;case "onStateChange":E2f(K,W);break;case "onAdStateChange":BvZ(K,W);break;case "onVolumeChanged":D1Z(K,W);break;case "onSubtitlesTrackChanged":HGZ(K,W);break;case "nowAutoplaying":rMH(K,W);break;case "autoplayDismissed":K.publish("autoplayDismissed");break;case "autoplayUpNext":Tv3(K,W);break;case "onAutoplayModeChanged":al3(K,W);break;case "onHasPreviousNextChanged":wN4(K, W);break;case "requestAssistedSignIn":K.publish("assistedSignInRequested",W.params.authCode);break;case "onLoopModeChanged":K.publish("loopModeChange",W.params.loopMode);break;default:v0("Unrecognized action: "+W.action)}},xO=function(K){K.length?y6h(K.shift(),function(){xO(K)}):MEW()},$1F=function(K){g.nO.call(this,"statevent",K)},VE4=function(K,W,U,h){var m=new g.FS(null); K&&g.WS(m,K);W&&g.Ld(m,W);U&&g.T7(m,U);h&&(m.X=h);return m},YDh=function(K,W){K.j?K.j.add(W):K.X=W},Q9=function(K){K.onload=null; K.onerror=null;K.onabort=null;K.ontimeout=null},d7=function(K,W){if(W==2){var U=(0,g.wr)(K.nqU,K),h=K.Dp,m=!h; h=new g.FS(h||"//www.google.com/images/cleardot.gif");g.qs.location&&g.qs.location.protocol=="http"||g.WS(h,"https");g7(h);m?YKb(h.toString(),U):OG3(h.toString(),U)}else CK(2);K.p_=0;K.U&&K.U.Lb(W);cMH(K);mq4(K)},lA=function(K){var W=l6F(); W.dispatchEvent(new n2W(W,K))},GH=function(K){K.Ms!=null&&(g.qs.clearTimeout(K.Ms),K.Ms=null)},g2b=function(K){K.audioTrackId=null; K.trackData=null;K.playerState=-1;K.cM=!1;K.zP=!1;K.G=0;K.U=g.hi();K.X=0;K.Y=0;K.N=0;K.J=0;K.j=NaN;K.W=!1},a7=function(){},kWH=function(){var K=F1W(); !K&&LK()&&u33()&&(K={key:"cast-selector-receiver",name:u33()});return K},bA=function(K,W,U,h){this.j=K; this.W=W;this.Y=U;this.G=h||1;this.X=45E3;this.N=new g.wv(this);this.U=new g.j8;this.U.setInterval(250)},YO=function(K,W){return Object.prototype.hasOwnProperty.call(K,W)},NvH=function(){P0("dispose"); var K=Ks();K&&K.dispose();g.Vk("yt.mdx.remote.cloudview.instance_",null);iGb(!1);g.Df(zrN);zrN.length=0},W9=function(K,W){g.kh[K]=!0; var U=g.Rz();U&&U.publish.apply(U,arguments);g.kh[K]=!1},UO=function(K,W,U,h){c0.call(this,K,W,"DialSession"); this.config_=h;this.N=this.J=null;this.DA="";this.tK=U;this.Le=null;this.Ms=function(){}; this.jV=NaN;this.eV=(0,g.wr)(this.xb,this);this.U=function(){}; this.Y=this.G=0;this.uX=!1;this.Ns="unknown"},AM3=function(){g.nO.call(this,"p")},RrI=function(K){return K.X?1:K.j?K.j.size:0},l6F=function(){return yMj=yMj||new g.Uj},MDb=function(){var K=r7(); K?(hz("Resume connection to: "+kO(K)),jM(K,0)):(Fv(),xqI(),hz("Skipping connecting because no session screen found."))},SM=function(K){m_("cloudview",K)},v0=function(K){m_("conn",K)},RNn=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},K1f=function(K){return{name:K.name, screenId:K.id,loungeToken:K.token,dialId:K.uuid,screenIdType:K.idType,screenIdSecret:K.secret}},U1v=function(K){var W=Math.min(K.X.length,1E3),U=["count="+W]; if(K.K4>6&&W>0){var h=K.X[0].j;U.push("ofs="+h)}else h=0;for(var m={},S=0;S0?(S=m[0].j,f.push("ofs="+S)):S=0:f.push("ofs="+S);for(var G=!0,I=0;I0&&V9(K,U)},function(W){K.U=function(){}; K.uK(W)})},jHI=function(K){K.aA&&(K.aA.abort(),K.aA=null); K.NZ&&(K.NZ.cancel(),K.NZ=null);K.cg&&(g.qs.clearTimeout(K.cg),K.cg=null);EO(K);K.BS&&(K.BS.cancel(),K.BS=null);K.F4&&(g.qs.clearTimeout(K.F4),K.F4=null)},mJn=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Sjf=function(K){g.Vk("yt.mdx.remote.currentScreenId_",K)},fgh=function(K){g.tD("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(W){this.G.push(this.W.subscribe(W,g.jt(this.DbH,W),this))},K)},t8N=function(){var K=S4(); return!!K&&K.getProxyState()!=3},B9=function(K,W,U){c0.call(this,K,W,"CastSession"); var h=this;this.config_=U;this.N=null;this.uX=(0,g.wr)(this.Pk,this);this.DA=(0,g.wr)(this.HCx,this);this.Ms=g.FE(function(){G$b(h,null)},12E4); this.Y=this.U=this.G=this.J=0;this.Ns=!1;this.jV="unknown"},e_W=function(K,W,U,h,m){IgH(K); if(K.j){var S=g.TA("ID_TOKEN"),f=K.j.Pa||{};S?f["x-youtube-identity-token"]=S:delete f["x-youtube-identity-token"];K.j.Pa=f}dJf(K);h?(h.getState()!=3&&Jih(h)==0||h.getState(),K.j.connect(W,U,K.Ms,h.W,h.RE)):m?K.j.connect(W,U,K.Ms,m.sessionId,m.arrayId):K.j.connect(W,U,K.Ms)},ERj=function(K,W,U){var h=g.uF(U); h.j!=""?(W&&g.Ld(h,W+"."+h.j),g.T7(h,h.N)):(h=g.qs.location,h=VE4(h.protocol,W?W+"."+h.hostname:h.hostname,+h.port,U));W=K.hK;U=K.bG;W&&U&&g.aT(h,W,U);g.aT(h,"VER",K.Ud);Zw(K,h);return h},Bn4=function(K){var W=K.player.V(); return!W.L("mdx_enable_privacy_disclosure_ui")||K.isLoggedIn()||K.Kd||!K.We?!1:g.YC(W)||g.Hh(W)},rin=function(){P0Z(); var K=DJW();K.push.apply(K,g.z4(Htf.map(c6h)));K.push("//www.gstatic.com/eureka/clank/cast_sender.js");xO(K)},Tnv=function(K,W){if(K.Ka!=null)throw Error("WatchDog timer not null"); K.Ka=DZ((0,g.wr)(K.Bk,K),W)},ag4=function(){var K=TH().di.$_gos(); var W=H9();W&&S4()&&(SKF(K,W)||K.push(W));return oEI(K)},XrF=function(K){if(K.length==0)return[]; var W=K[0].indexOf("#"),U=W==-1?K[0]:K[0].substring(0,W);return g.CB(K,function(h,m){return m==0?h:h.substring(U.length)})},wyN=function(K,W){this.action=K; this.params=W||{}},$JI=function(K){g.p4(K.channel,"m",function(){K.G=3; K.N.reset();K.J=null;K.Y=0;for(var W=g.z(K.uX),U=W.next();!U.done;U=W.next())U=U.value,K.channel&&K.channel.send(U);K.uX=[];K.publish("webChannelOpened");K.Le.Vh("WEB_CHANNEL")}); g.p4(K.channel,"n",function(){K.G=0;K.N.isActive()||K.publish("webChannelClosed");var W,U=(W=K.channel)==null?void 0:QHN(new x1f(W,W.j));U&&(K.uX=[].concat(g.z4(U)));K.DA.Vh("WEB_CHANNEL")}); g.p4(K.channel,"p",function(W){var U=W.data;U[0]==="gracefulReconnect"?(K.N.start(),K.channel&&K.channel.close()):K.publish("webChannelMessage",new wyN(U[0],U[1]));K.Bo=W.statusCode;K.eV.Vh("WEB_CHANNEL")}); g.p4(K.channel,"o",function(){K.Bo===401||K.N.start();K.publish("webChannelError");K.hK.Vh("WEB_CHANNEL","")})},Yjh=function(K){var W=S4(); rm(null);K||Sjf("");g.Vk("yt.mdx.remote.connection_",K);Tu&&(g.tD(Tu,function(U){U(K)}),Tu.length=0); W&&!K?W9("yt-remote-connection-change",!1):!W&&K&&W9("yt-remote-connection-change",!0)},Otv=function(K){K.Ms&&(g.qs.clearTimeout(K.Ms),K.Ms=null)},al3=function(K,W){K.U=W.params.autoplayMode; K.publish("autoplayModeChange",K.U);K.U=="DISABLED"&&K.publish("autoplayDismissed")},aB=function(K,W){var U=K.U; U.j.length+U.X.length<50&&K.U.enqueue(W)},Q0=function(K,W){wm()?Ks().setConnectedScreenStatus(K,W):SM("setConnectedScreenStatus called before ready.")},cif=function(K){g.qE(K.uX); K.uX=NaN},nRZ=function(K,W,U,h,m){if(h==0)U(!1); else{var S=m||0;h--;gEW(K,W,function(f){f?U(!0):g.qs.setTimeout(function(){nRZ(K,W,U,h,S)},S)})}},gRn=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/channel/success")},FAW=function(K,W){try{K.j.qT(K,W),K.j.Cn(4)}catch(U){}},uIN=function(K){g.nO.call(this,"channelMessage"); this.message=K},Yt=function(K,W){g.Uj.call(this); this.j=new k$n(W);this.U=K;this.X=W&&W.c7k||null;K=W&&W.fOx||null;W&&W.Ur5&&(K?K["X-Client-Protocol"]="webchannel":K={"X-Client-Protocol":"webchannel"});this.j.jV=K;K=W&&W.Uos||null;W&&W.R_&&(K?K["X-WebChannel-Content-Type"]=W.R_:K={"X-WebChannel-Content-Type":W.R_});W&&W.kp&&(K?K["X-WebChannel-Client-Profile"]=W.kp:K={"X-WebChannel-Client-Profile":W.kp});this.j.W3=K;(K=W&&W.hRH)&&!g.YD(K)&&(this.j.Y=K);this.G=W&&W.O_k||!1;this.W=W&&W.dIX||!1;(W=W&&W.fAe)&&!g.YD(W)&&(this.j.hK=W,g.r5(this.X,W)&&(K= this.X,W in K&&delete K[W]));this.N=new $t(this)},it3=function(K,W){if(K.Ms!=null)throw Error("WatchDog timer not null"); K.Ms=OO((0,g.wr)(K.Yb,K),W)},R_O=function(K,W,U,h,m){function S(){return new z_Z($O(K,"/bc"),W,!1,U,h)} U=U===void 0?function(){return""}:U; return g.hc("enable_mdx_web_channel_desktop")?new NnI(function(){return new KAv($O(K,"/wc"),W,U)}):new Ait(S,m)},yiZ=function(){P0Z(); var K=DJW();K.push("//www.gstatic.com/eureka/clank/cast_sender.js");xO(K)},JM4=function(K,W,U){var h=W.params.videoId||W.params.video_id,m=parseInt(W.params.currentIndex,10); K.j.listId=W.params.listId||K.j.listId;c9(K.j,h,m);K.publish("remoteQueueChange",U)},Jz=function(){},n2W=function(K){g.nO.call(this,"serverreachability",K)},ZXN=function(K){try{return g.qs.JSON.parse(K)}catch(W){}K=String(K); if(/^\s*$/.test(K)?0:/^[\],:{}\s\u2028\u2029]*$/.test(K.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("("+K+")")}catch(W){}throw Error("Invalid JSON string: "+K);},wN4=function(K,W){var U=W.params.hasNext=="true"; K.j.cM=W.params.hasPrevious=="true";K.j.zP=U;K.publish("previousNextChange")},abj=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(K){var W=Math.random()*16|0; return(K=="x"?W:W&3|8).toString(16)})},pyZ=function(K,W){var U=K.Rs,h=W.indexOf("\n",U); if(h==-1)return M8W;U=Number(W.substring(U,h));if(isNaN(U))return PVW;h+=1;if(h+U>W.length)return M8W;W=W.slice(h,h+U);K.Rs=h+U;return W},kot=function(K,W){var U=K.get(W.uuid)||K.get(W.id); if(U)return K=U.name,U.id=W.id||U.id,U.name=W.name,U.token=W.token,U.uuid=W.uuid||U.uuid,U.name!=K;K.screens.push(W);return!0},oRZ=function(K){K.j=new ns(K,K.W,"rpc",K.q5); K.Y===null&&(K.j.Le=K.jV);K.j.Pp=0;var W=K.Ea.clone();g.aT(W,"RID","rpc");g.aT(W,"SID",K.W);g.aT(W,"AID",K.tK);g.aT(W,"CI",K.Bp?"0":"1");!K.Bp&&K.AS&&g.aT(W,"TO",K.AS);g.aT(W,"TYPE","xmlhttp");Zw(K,W);K.Y&&K.jV&&g.w_(W,K.Y,K.jV);K.Pp&&K.j.setTimeout(K.Pp);var U=K.j;K=K.Cg;U.tK=1;U.J=g7(W.clone());U.jV=null;U.hK=!0;F0O(U,K)},H9=function(){var K=gm(); if(!K)return null;var W=TH().Ha();return m4(W,K)},A$=function(K,W){K.rj&&(K=K.rj.VW())&&g.hI(K,function(U,h){g.aT(W,h,U)})},Zth=function(K){K.j.CC()||K.Jo||K.j.ma(K)},hz=function(K){m_("remote",K)},sHN=function(K){if(K.NZ||K.cg||K.FZ>=3)return!1; K.Y++;K.cg=DZ((0,g.wr)(K.Zm,K),btj(K,K.FZ));K.FZ++;return!0},F6=function(K,W){K.G=W; K.U=g.hi()},Xyf=function(K,W){K.w8=Date.now(); V8j(K);K.KQ=K.By.clone();uM(K.KQ,"t",K.G);K.Rs=0;K.BN=K.j.nI(K.j.Eg()?W:null);K.DK>0&&(K.E$=new g.VF((0,g.wr)(K.kf,K,K.BN),K.DK));K.N.listen(K.BN,"readystatechange",K.J4);W=K.w2?g.Ni(K.w2):{};K.E2?(K.Is="POST",W["Content-Type"]="application/x-www-form-urlencoded",K.BN.send(K.KQ,K.Is,K.E2,W)):(K.Is="GET",K.i6&&!g.$U&&(W.Connection="close"),K.BN.send(K.KQ,K.Is,null,W));K.j.Cn(1)},vRW=function(K,W,U,h,m){K.F3=1; K.By=g7(W.clone());K.E2=null;K.hK=U;m&&(K.i6=!1);Xyf(K,h)},kt=function(K){return K.isPlaying()?(g.hi()-K.U)/1E3:0},IgH=function(K){if(K.j){var W=K.eV(),U=K.j.Pa||{}; W?U["x-youtube-lounge-xsrf-token"]=W:delete U["x-youtube-lounge-xsrf-token"];K.j.Pa=U}},qjN=function(K,W){g.S$.call(this,K); this.j=W},iM=function(K,W,U){W!=K.j&&(g.vZ(K.j),(K.j=W)?(U?K.publish("yt-remote-cast2-receiver-resumed",W.X):K.publish("yt-remote-cast2-receiver-selected",W.X),W.subscribe("sessionScreen",(0,g.wr)(K.fD,K,W)),W.subscribe("sessionFailed",function(){return xJn(K,W)}),W.j?K.publish("yt-remote-cast2-session-change",W.j):U&&K.j.Zz(null)):K.publish("yt-remote-cast2-session-change",null))},cMH=function(K){K.p_=0; K.DO=[];if(K.U){var W=dqZ(K.X);if(W.length!=0||K.N.length!=0)g.Ms(K.DO,W),g.Ms(K.DO,K.N),K.X.N.length=0,g.k4(K.N),K.N.length=0;K.U.Hw()}},CVh=function(K,W){var U; W?U=W.Cg:U=K.JK++;var h=K.Le.clone();g.aT(h,"SID",K.W);g.aT(h,"RID",U);g.aT(h,"AID",K.tK);Zw(K,h);K.Y&&K.jV&&g.w_(h,K.Y,K.jV);U=new ns(K,K.W,U,K.Ns+1);K.Y===null&&(U.Le=K.jV);W&&(K.N=W.uX.concat(K.N));W=WAn(K,U,1E3);U.setTimeout(Math.round(K.Iu*.5)+Math.round(K.Iu*.5*Math.random()));YDh(K.X,U);uJt(U,h,W)},XNI=function(K,W){if(K.j){var U=K.j.Pa||{}; W&&Object.keys(W).length>0?U=Object.assign({},U,W):delete U.Authorization;K.j.Pa=U}},lgn=function(K,W,U){var h=h$(K); F6(h,U);h.playerState!=-1E3&&(h.playerState=W);zu(K,h)},HGZ=function(K,W){var U=W.params.videoId; delete W.params.videoId;U==K.j.videoId&&(g.Tb(W.params)?K.j.trackData=null:K.j.trackData=W.params,K.publish("remotePlayerChange"))},LAh=function(){this.N=null; this.j="";this.X=!1},Nu=function(K){m_("CP",K)},UtO=function(K,W,U,h,m,S){K.info("getAutomaticScreenByIds "+U+" / "+W); U||(U=K.U[W]);var f=K.Ha(),G=U?m4(f,U):null;U&&(K.Y||G)||(G=m4(f,W));if(G){G.uuid=W;var I=Az(K,G);K9t(K.j,I,function(d){m(d?I:null)})}else U?W9h(K,U,(0,g.wr)(function(d){var J=Az(this,new tz({name:h, screenId:U,loungeToken:d,dialId:W||""}));K9t(this.j,J,function(e){m(e?J:null)})},K),S):m(null)},hgj=function(K,W){var U=K.Ev+Math.floor(Math.random()*K.rS); K.isActive()||(U*=2);return U*W},mt3=function(K,W,U){g.p.call(this); var h=this;this.j=K;this.D=W;this.fg=U;this.events=new g.Te(this);this.U=!1;this.G=new g.Kw(64);this.X=new g.QC(this.qx,500,this);this.N=new g.QC(this.tb,1E3,this);this.J=new RB(this.fce,0,this);this.W={};this.jV=new g.QC(this.Zn,1E3,this);this.Y=new g.VF(this.seekTo,1E3,this);this.Ms=this.events.S(this.D,"onVolumeChange",function(m){jyn(h,m)}); g.k(this,this.events);this.events.S(W,"onCaptionsTrackListChanged",this.W1K);this.events.S(W,"captionschanged",this.eAp);this.events.S(W,"captionssettingschanged",this.sI);this.events.S(W,"videoplayerreset",this.xQ);this.events.S(W,"mdxautoplaycancel",function(){h.fg.CL()}); W.L("enable_mdx_video_play_directly")&&this.events.S(W,"videodatachange",function(){Bn4(h.j)||U_(h)||y0(h,0)}); K=this.fg;K.qs();K.subscribe("proxyStateChange",this.Il,this);K.subscribe("remotePlayerChange",this.dw,this);K.subscribe("remoteQueueChange",this.xQ,this);K.subscribe("previousNextChange",this.w7,this);K.subscribe("nowAutoplaying",this.v6,this);K.subscribe("autoplayDismissed",this.hN,this);g.k(this,this.X);g.k(this,this.N);g.k(this,this.J);g.k(this,this.jV);g.k(this,this.Y);this.sI();this.xQ();this.dw()},xJn=function(K,W){K.j==W&&K.publish("yt-remote-cast2-session-failed")},S2n=function(){var K=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return K?parseInt(K[1],10):0},Mu=function(K,W){W=W===void 0?!1:W; IB.call(this,"ScreenService");this.W=K;this.Y=W;this.j=this.X=null;this.N=[];this.U={};VDO(this)},fWO=function(K){K.Ka&&(g.qs.clearTimeout(K.Ka),K.Ka=null)},jM=function(K,W){gm(); H9()&&H9();if(P9)ps=K;else{Sjf(K.id);var U=g.vB("yt.mdx.remote.enableConnectWithInitialState_")||!1;K=new oB(ZZ,K,bXZ(),U);K.connect(W,tS4());K.subscribe("beforeDisconnect",function(h){W9("yt-remote-before-disconnect",h)}); K.subscribe("beforeDispose",function(){S4()&&(S4(),Yjh(null))}); K.subscribe("browserChannelAuthError",function(){var h=H9();h&&h.idType=="shortLived"&&(wm()?Ks().handleBrowserChannelAuthError():SM("refreshLoungeToken called before API ready."))}); Yjh(K)}},qDj=function(){},G7f=function(K,W){var U=!1; Ks()||(K=new bM(K,W),K.subscribe("yt-remote-cast2-availability-change",function(h){g.SI("yt-remote-cast-available",h);W9("yt-remote-cast2-availability-change",h)}),K.subscribe("yt-remote-cast2-receiver-selected",function(h){P0("onReceiverSelected: "+h.friendlyName); g.SI("yt-remote-cast-receiver",h);W9("yt-remote-cast2-receiver-selected",h)}),K.subscribe("yt-remote-cast2-receiver-resumed",function(h){P0("onReceiverResumed: "+h.friendlyName); g.SI("yt-remote-cast-receiver",h);W9("yt-remote-cast2-receiver-resumed",h)}),K.subscribe("yt-remote-cast2-session-change",function(h){P0("onSessionChange: "+kO(h)); h||g.HX("yt-remote-cast-receiver");W9("yt-remote-cast2-session-change",h)}),g.Vk("yt.mdx.remote.cloudview.instance_",K),U=!0); P0("cloudview.createSingleton_: "+U);return U},D1Z=function(K,W){var U=W.params.muted=="true"; K.j.volume=parseInt(W.params.volume,10);K.j.muted=U;K.publish("remotePlayerChange")},c0=function(K,W,U){g.GP.call(this); this.hK=U;this.W=K;this.X=W;this.j=null},y0=function(K,W){var U=K.D.getPlaylist(); if(U==null?0:U.listId){var h=U.index;var m=U.listId.toString()}U=K.D.getVideoData(1);K.fg.playVideo(U.videoId,W,h,m,U.playerParams,U.Ms,IWH(U));K.uY(new g.Kw(1))},erH=function(K,W){W.params=W.params||{}; JM4(K,W,"NOW_PLAYING_MAY_CHANGE");E2f(K,W);K.publish("autoplayDismissed")},EO=function(K){K.Fq!=null&&(g.qs.clearTimeout(K.Fq),K.Fq=null)},dtH=function(K,W,U,h,m){g.GP.call(this); this.N=K;this.Y=W;this.W=U;this.G=h;this.U=m;this.X=0;this.j=null;this.In=NaN},q0n=function(K){K.DA!=null&&(g.qs.clearTimeout(K.DA),K.DA=null)},qKW=function(K,W){K.j=0; K.rj&&K.rj.Su(W);J7v(K);jHI(K)},z_Z=function(K,W,U,h,m,S,f,G,I,d,J,e,E,B,D){var a=this; U=U===void 0?!1:U;h=h===void 0?function(){return""}:h; m=m===void 0?!1:m;S=S===void 0?!1:S;f=f===void 0?!1:f;G=G===void 0?function(){return g.EC({})}:G; I=I===void 0?!1:I;J=J===void 0?!1:J;e=e===void 0?!1:e;E=E===void 0?!1:E;B=B===void 0?!1:B;this.vp=K;this.Ms=W;this.G=new g.fj;this.X=(this.hK=!!D)?D(function(){a.O6()}):new uA(this.O6,this); this.j=null;this.Y=!1;this.jV=null;this.Ns="";this.uX=this.J=0;this.N=[];this.q5=U;this.eV=h;this.U=S;this.tK=G;this.Le=d;this.Cg=f;this.DA=null;this.W=g.EC();this.Ez=m;this.DO=I;this.Qg=J;this.M5=e;this.XI=E;this.W3=B;this.Ik=new CpO;this.Bp=new W1I;this.gk=new gRn;this.Pp=new llt;this.JK=new L1n;this.oW=new mJn;this.Ny=new GWn},EQO=function(K,W){g.qE(K.U); K.U=0;var U=null;if(W)if(W.loungeToken){var h;((h=K.j)==null?void 0:h.token)==W.loungeToken&&(U="staleLoungeToken")}else U="missingLoungeToken";else U="noLoungeTokenResponse";U?(K.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(W)+", error: "+U)),K.jV=U,egH(K,3E4)):(flb(K,W.loungeToken),K.Ns=!1,K.jV="unknown",egH(K,W.loungeTokenRefreshIntervalMs))},BcH=function(K,W){if(K.j==1){if(!W){K.F2=Math.floor(Math.random()*1E5); W=K.F2++;var U=new bA(K,"",W);U.w2=K.Pa;var h=U1v(K),m=K.fQ.clone();g.aT(m,"RID",W);g.aT(m,"CVER","1");A$(K,m);hr4(U,m,h);K.BS=U;K.j=2}}else K.j==3&&(W?jhO(K,W):K.X.length==0||K.BS||jhO(K))},rMH=function(K,W){K.Y=W.params.videoId; K.publish("nowAutoplaying",parseInt(W.params.timeout,10))},DtF=function(){var K=sO; if(V0[0]){var W=X6?v9:-1,U={};do U={v5:void 0},W=(W+1)%50,U.v5=V0[W],g.tD(K,function(h){return function(m){m(h.v5)}}(U)); while(W!=v9);V0=Array(50);v9=-1;X6=!1}},DZ=function(K,W){if(typeof K!=="function")throw Error("Fn must not be null and must be a function"); return g.qs.setTimeout(function(){K()},W)},t$=function(){if(HSF)return HSF; var K=g.SZ("yt-remote-device-id");K||(K=abj(),g.SI("yt-remote-device-id",K,31536E3));for(var W=fK(),U=1,h=K;g.BX(W,h);)U++,h=K+"#"+U;return HSF=h},IB=function(K){g.GP.call(this); this.G=K;this.screens=[]},r7N=function(){return g.SZ("yt-remote-session-browser-channel")},o7=function(){if(!qu){qu=new g.n4(new BlH); var K=g.Cz("client_streamz_web_flush_count",-1);K!==-1&&(qu.N=K)}return qu},TcI=function(){g.nO.call(this,"o")},jyn=function(K,W){if(U_(K)){K.fg.unsubscribe("remotePlayerChange",K.dw,K); var U=Math.round(W.volume);W=!!W.muted;var h=h$(K.fg);if(U!==h.volume||W!==h.muted)K.fg.setVolume(U,W),K.jV.start();K.fg.subscribe("remotePlayerChange",K.dw,K)}},aWt=function(K,W,U){K9t(K.j,W,U)},fK=function(){var K=g.SZ("yt-remote-connected-devices")||[]; g.OM(K);return K},wYh=function(K){g.tD(K.G,function(W){this.W.unsubscribeByKey(W)},K); K.G.length=0},DJW=function(){var K=S2n(),W=[]; if(K>1){var U=K-1;W.push("//www.gstatic.com/eureka/clank/"+K+"/cast_sender.js");W.push("//www.gstatic.com/eureka/clank/"+U+"/cast_sender.js")}return W},K9t=function(K,W,U){var h=$O(K.U,"/pairing/get_screen_availability"); K.U.sendRequest("POST",h,{lounge_token:W.token},(0,g.wr)(function(m){m=m.screens||[];for(var S=m.length,f=0;f0&&(this.AS=K.Sf);this.Qg=void 0;this.Ny=0;this.Ik=!1;this.DO=this.DA=null},c7t=function(){},Dw=function(K){g.y.call(this,{T:"div", Z:"ytp-remote",K:[{T:"div",Z:"ytp-remote-display-status",K:[{T:"div",Z:"ytp-remote-display-status-icon",K:[g.CED()]},{T:"div",Z:"ytp-remote-display-status-text",bX:"{{statustext}}"}]}]});this.api=K;this.fade=new g.Wr(this,250);g.k(this,this.fade);this.S(K,"presentingplayerstatechange",this.onStateChange);this.Bl(K.getPlayerStateObject())},ZGh=function(K){K.screens=K.X.Ha(); var W=K.U,U={},h;for(h in W)U[W[h]]=h;W=K.screens.length;for(h=0;h=3)return!1; K.q5++;K.J=OO((0,g.wr)(K.du,K),hgj(K,K.uX));K.uX++;return!0},bGF=function(K){return Array.isArray(K)?"["+g.CB(K,kO).join(",")+"]":"null"},gQW=function(K){K.player.getPlayerStateObject().isPlaying()?K.player.pauseVideo():(K.En=function(W){!K.Kd&&g.M9(W,8)&&(K.player.pauseVideo(),Cs(K))},K.player.addEventListener("presentingplayerstatechange",K.En)); K.We&&K.We.Kr();S4()||(P9=!0)},ubI=function(K,W){if(K.j==0)throw Error("Invalid operation: sending map when state is closed"); K.X.push(new F9f(K.wb++,W));K.j!=2&&K.j!=3||Qyf(K)},k7t=function(K){hz("remote.onCastSessionChange_: "+kO(K)); if(K){var W=H9();if(W&&W.id==K.id){if(Q0(W.id,"YouTube TV"),K.idType=="shortLived"&&(K=K.token))ps&&(ps.token=K),(W=S4())&&W.mq(K)}else W&&lM(),jM(K,1)}else S4()&&lM()},Ls=function(K){fWO(K); g.vZ(K.E$);K.E$=null;K.U.stop();K.N.removeAll();if(K.BN){var W=K.BN;K.BN=null;W.abort();W.dispose()}K.Q5&&(K.Q5=null)},iSI=function(K){g.qE(K.J); K.J=0;g.qE(K.G);K.G=0;g.qE(K.Ms);K.Ms=0;g.qE(K.U);K.U=0;g.qE(K.Y);K.Y=0},Kb=function(K){K.gk=Date.now()+K.Ik; it3(K,K.Ik)},WU=function(K){m_("Controller",K)},zg4=function(K,W,U,h){g.qE(K.G); K.G=0;aWt(K.W,W,function(m){m||h<0?U(m):K.G=g.FE(function(){zg4(K,W,U,h-1)},300)})},qA=function(K){this.name=this.id=""; this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.ownerObfuscatedGaiaId=this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new Ue;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";K&&(this.id=K.id||K.name,this.name=K.name,this.clientName=K.clientName?K.clientName.toUpperCase():"UNKNOWN_INTERFACE", this.app=K.app,this.type=K.type||"REMOTE_CONTROL",this.username=K.user||"",this.avatar=K.userAvatarUri||"",this.obfuscatedGaiaId=K.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=K.ownerObfuscatedGaiaId||"",this.theme=K.theme||"u",NcO(this,K.capabilities||""),EEh(this,K.compatibleSenderThemes||""),zNn(this,K.experiments||""),this.brand=K.brand||"",this.model=K.model||"",this.year=K.year||0,this.os=K.os||"",this.osVersion=K.osVersion||"",this.chipset=K.chipset||"",this.mdxDialServerType=K.mdxDialServerType|| "MDX_DIAL_SERVER_TYPE_UNKNOWN",K=K.deviceInfo)&&(K=JSON.parse(K),this.brand=K.brand||"",this.model=K.model||"",this.year=K.year||0,this.os=K.os||"",this.osVersion=K.osVersion||"",this.chipset=K.chipset||"",this.clientName=K.clientName?K.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=K.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},A73=function(K,W,U){if(W&&!K.vp)throw Error("Can't create secondary domain capable XhrIo object."); W=K.QX&&!K.QA?new g.DK(new g.jW({Ab:U})):new g.DK(K.QA);W.Y=K.vp;return W},Rgf=function(K,W,U,h){g.qE(K.G); K.G=0;aWt(K.W,W,function(m){m||h<0?U(m):K.G=g.FE(function(){Rgf(K,W,U,h-1)},300)})},y7I=function(){var K=bXZ(); if(g.Tb(K)){K=t$();var W=g.SZ("yt-remote-session-name")||"",U=g.SZ("yt-remote-session-app")||"";K={device:"REMOTE_CONTROL",id:K,name:W,app:U,mdxVersion:3};K.authuser=String(g.TA("SESSION_INDEX","0"));(W=g.TA("DELEGATED_SESSION_ID"))&&(K.pageId=String(W));g.Vk("yt.mdx.remote.channelParams_",K)}},MSO=function(K){v0("Channel opened"); K.DA&&(K.DA=!1,r6W(K),K.Ns=g.FE(function(){v0("Timing out waiting for a screen.");K.z3(1)},15E3))},PPH=function(K,W,U){for(var h=0;h0&&(K.Bp=new g.VF((0,g.wr)(K.hX,K,K.j),K.Pp));K.M5.listen(K.j,"readystatechange",K.vk);W=K.Le?g.Ni(K.Le):{};K.jV?(K.DA||(K.DA="POST"),W["Content-Type"]="application/x-www-form-urlencoded",K.j.send(K.JK,K.DA,K.jV,W)):(K.DA="GET",K.j.send(K.JK,K.DA,null,W));lA(1)},NcO=function(K,W){K.capabilities.clear(); g.yb(W.split(","),g.jt(J6t,syt)).forEach(function(U){K.capabilities.add(U)})},gm=function(){return g.vB("yt.mdx.remote.currentScreenId_")},NnI=function(K){g.Uj.call(this); this.j=K();this.j.subscribe("webChannelOpened",this.Ki,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},eM=function(K,W){K.j=W; K.publish("sessionScreen",K.j)},VSN=function(K,W){if(W){var U=K.D.getOption("captions","tracklist",{B4:1}); U&&U.length?(K.D.setOption("captions","track",W),K.U=!1):(K.D.loadModule("captions"),K.U=!0)}else K.D.setOption("captions","track",{})},Qyf=function(K){K.BS||K.F4||(K.F4=DZ((0,g.wr)(K.Yf,K),0),K.IE=0)},fb=function(K){isNaN(K.N)||g.qE(K.N); K.N=g.FE((0,g.wr)(K.i4,K),K.W>0&&K.W0&&(K.capabilities= m),K.name=W.device,K.app=W.app,(W=W.theme)&&(K.theme=W),hz(" -- with channel params: "+g.rc(K)),K?(g.SI("yt-remote-session-app",K.app),g.SI("yt-remote-session-name",K.name)):(g.HX("yt-remote-session-app"),g.HX("yt-remote-session-name")),g.Vk("yt.mdx.remote.channelParams_",K),U.start(),gm()||MDb())}},lWZ=function(K){K.Ym(0); K.X.stop();K.uY(new g.Kw(64))},xtO=function(K,W,U,h){h.disableCastApi?P0("Cannot initialize because disabled by Mdx config."):L93()?G7f(W,h)&&(KFt(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?WFj(K,U):(window.__onGCastApiAvailable=function(m,S){m?WFj(K,U):(SM("Failed to load cast API: "+S),U0h(!1),KFt(!1),g.HX("yt-remote-cast-available"),g.HX("yt-remote-cast-receiver"),NvH(),U(!1))},h.loadCastApiSetupScript?g.Vlp(hmj):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>= 0&&window.navigator.presentation?S2n()>=60&&yiZ():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?MEW():S2n()>=89?rin():(P0Z(),xO(Htf.map(c6h))))):P0("Cannot initialize because not running Chrome")},xjb=function(K,W){return K.X?K.X==W:K.j?K.j.has(W):!1},SIh=function(K,W){var U=K.Y,h=W.indexOf("\n",U); if(h==-1)return jtv;U=Number(W.substring(U,h));if(isNaN(U))return m0O;h+=1;if(h+U>W.length)return jtv;W=W.slice(h,h+U);K.Y=h+U;return W},fUn=function(K){K.NZ||K.cg||(K.Y=1,K.cg=DZ((0,g.wr)(K.Zm,K),0),K.FZ=0)},tRn=function(K){if(!bSj(K))return g.FU(K.j); var W=g.VS(K.j);if(W==="")return"";var U="",h=W.length,m=g.ez(K.j)==4;if(!K.X.N){if(typeof TextDecoder==="undefined")return dC(K),NA(K),"";K.X.N=new g.qs.TextDecoder}for(var S=0;S1){if(U%2)throw Error("Uneven number of arguments");for(var h=0;h=0&&(K=K.match(/MSIE ([\d.]+)/)[1],g.Il(K,"10.0")<0&&(this.X=!1))},s_=function(K){var W; return!!(K.config_.enableDialLoungeToken&&((W=K.N)==null?0:W.getDialAppInfo))},HzI=function(K){var W=K.X.wu(),U=K.j&&K.j.X; K=g.CB(W,function(h){U&&j4(h,U.label)&&(U=null);var m=h.uuid?h.uuid:h.id,S=ZSn(this,h);S?(S.label=m,S.friendlyName=h.name):(S=new chrome.cast.Receiver(m,h.name),S.receiverType=chrome.cast.ReceiverType.CUSTOM);return S},K); U&&(U.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(U=new chrome.cast.Receiver(U.label,U.friendlyName),U.receiverType=chrome.cast.ReceiverType.CUSTOM),K.push(U));return K},H0=function(){g.y.call(this,{T:"div", Z:"ytp-mdx-popup-dialog",B:{role:"dialog"},K:[{T:"div",Z:"ytp-mdx-popup-dialog-inner-content",K:[{T:"div",Z:"ytp-mdx-popup-title",bX:"You're signed out"},{T:"div",Z:"ytp-mdx-popup-description",bX:"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."},{T:"div",Z:"ytp-mdx-privacy-popup-buttons",K:[{T:"button",Hp:["ytp-button","ytp-mdx-privacy-popup-cancel"],bX:"Cancel"},{T:"button",Hp:["ytp-button", "ytp-mdx-privacy-popup-confirm"],bX:"Confirm"}]}]}]});this.fade=new g.Wr(this,250);this.cancelButton=this.yH("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.yH("ytp-mdx-privacy-popup-confirm");g.k(this,this.fade);this.S(this.cancelButton,"click",this.j);this.S(this.confirmButton,"click",this.X)},xt=function(K,W){m_(K.hK,W)},rCj=function(K){var W,U; g.r(function(h){if(h.j==1)return g.bE(h,2),g.T(h,oQ4(K),2);g.VY(h);W=K.N;K.N=[];U=W.length;PPH(K,W,U);Xv(K);return g.vr(h,0)})},GE4=function(K){g.nO.call(this,"statevent",K)},L1n=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/channel/error",g.Mk("channel_type"),g.Mk("error_type"))},SDj=function(K){IB.call(this,"ScreenServiceProxy"); this.di=K;this.j=[];this.j.push(this.di.$_s("screenChange",(0,g.wr)(this.jp,this)));this.j.push(this.di.$_s("onlineScreenChange",(0,g.wr)(this.qvk,this)))},pYh=function(K){m_("OnlineScreenService",K)},TVN=function(K,W,U){K.RR=U; K.player.publish("presentingplayerstatechange",new g.e0(U,W))},ns=function(K,W,U,h){this.N=K; this.W=W;this.Cg=U;this.q5=h||1;this.M5=new g.wv(this);this.Ik=45E3;this.Le=null;this.G=!1;this.jV=this.JK=this.J=this.tK=this.Ns=this.gk=this.Ms=null;this.uX=[];this.j=null;this.Y=0;this.U=this.DA=null;this.Qg=-1;this.eV=!1;this.Pp=0;this.Bp=null;this.DO=this.vp=this.W3=this.hK=!1;this.X=new LAh},aUO=function(K){var W={}; g.tD(K.G(),function(U){U.token?W[U.token]=U.id:this.dS("Requesting availability of screen w/o lounge token.")}); return W},WFj=function(K,W){U0h(!0); KFt(!1);wRO(K,function(U){U?(iGb(!0),g.KH("yt-remote-cast2-api-ready")):(SM("Failed to initialize cast API."),U0h(!1),g.HX("yt-remote-cast-available"),g.HX("yt-remote-cast-receiver"),NvH());W(U)})},Qtn=function(K,W,U,h){g.nO.call(this,"timingevent",K); this.size=W;this.rtt=U;this.retries=h},J7v=function(K){K.j=0; K.df=-1;if(K.rj)if(K.N.length==0&&K.X.length==0)K.rj.t5();else{var W=g.k4(K.N),U=g.k4(K.X);K.N.length=0;K.X.length=0;K.rj.t5(W,U)}},egH=function(K,W){g.qE(K.Y); K.Y=0;W==0?$0n(K):K.Y=g.FE(function(){$0n(K)},W)},U0h=function(K){P0("setCastInstalled_ "+K); g.SI("yt-remote-cast-installed",K)},emj=function(K){K=g.N$(g.d6(K.j,function(W){return W})); g.OM(K);K.length?g.SI("yt-remote-online-screen-ids",K.join(","),60):g.HX("yt-remote-online-screen-ids")},YIH=function(K){g.qE(K.G); K.G=0;g.qE(K.Y);K.Y=0;K.U();K.U=function(){}; g.qE(K.jV)},OzI=function(K){g.nO.call(this,"channelError"); this.error=K},OSW=function(){this.j=new Jz},cCj=function(K){AM3.call(this); K.__headers__&&(this.headers=K.__headers__,this.statusCode=K.__status__,delete K.__headers__,delete K.__status__);var W=K.__sm__;W?this.data=(this.j=g.qB(W))?g.Ug(W,this.j):W:this.data=K},n$O=function(K){if(K.screens.length){var W=g.CB(K.screens,function(h){return h.id}),U=$O(K.X,"/pairing/get_lounge_token_batch"); K.X.sendRequest("POST",U,{screen_ids:W.join(",")},(0,g.wr)(K.LrA,K),(0,g.wr)(K.nxs,K))}},btj=function(K,W){var U=5E3+Math.floor(Math.random()*1E4); K.isActive()||(U*=2);return U*W},dC=function(K){Otv(K); g.vZ(K.Bp);K.Bp=null;K.M5.removeAll();if(K.j){var W=K.j;K.j=null;W.abort();W.dispose()}},Ks=function(){return g.vB("yt.mdx.remote.cloudview.instance_")},g$j=function(K,W){var U=K.screens.length; K.screens=g.yb(K.screens,function(h){return!(h||W?!h!=!W?0:h.id==W.id:1)}); return K.screens.length0&&(K[0].nextHopProtocol=="hq"||K[0].nextHopProtocol=="h2")):K=!!(g.qs.chrome&&g.qs.chrome.loadTimes&&g.qs.chrome.loadTimes()&&g.qs.chrome.loadTimes().wasFetchedViaSpdy);this.W=K?this.U:1;this.j=null;this.W>1&&(this.j=new Set);this.X=null;this.N=[]},uxF=function(K,W){try{var U=K.N; if(U.p_!=0&&(U.j==K||xjb(U.X,K)))if(!K.vp&&xjb(U.X,K)&&U.p_==3){try{var h=U.ZX.j.parse(W)}catch(Q){h=null}if(Array.isArray(h)&&h.length==3){var m=h;if(m[0]==0)a:{if(!U.J){if(U.j)if(U.j.Ns+3E30&&(U.Pp=1.5*I);h=U;var d=K.RO();if(d){var J=g.i1(d,"X-Client-Wire-Protocol");if(J){var e=h.X;!e.j&&(g.so(J,"spdy")||g.so(J,"quic")||g.so(J,"h2"))&&(e.W=e.U,e.j=new Set,e.X&&(YDh(e,e.X),e.X=null))}if(h.hK){var E=g.i1(d,"X-HTTP-Session-Id");E&&(h.bG=E,g.aT(h.Le,h.hK,E))}}U.p_=3;U.U&&U.U.zU();U.oW&&(U.Ny=Date.now()-K.Ns);h=U;var B=K;h.Ea=ERj(h,h.vp?h.Cg:null,h.Ez); if(B.vp){CEO(h.X,B);var D=B,a=h.Pp;a&&D.setTimeout(a);D.Ms&&(Otv(D),Kb(D));h.j=B}else K0t(h);U.N.length>0&&I7(U)}else S[0]!="stop"&&S[0]!="close"||d7(U,7);else U.p_==3&&(S[0]=="stop"||S[0]=="close"?S[0]=="stop"?d7(U,7):U.disconnect():S[0]!="noop"&&U.U&&U.U.m2(S),U.uX=0)}lA(4)}catch(Q){}},kEI=function(K,W,U){this.j=1; this.X=[];this.N=[];this.U=new Jz;this.jV=K||null;this.G=W!=null?W:null;this.J=U||!1},OG3=function(K,W){var U=new a7,h=new AbortController,m=setTimeout(function(){h.abort(); w7(U,"TestPingServer: timeout",!1,W)},1E4); fetch(K,{signal:h.signal}).then(function(S){clearTimeout(m);S.ok?w7(U,"TestPingServer: ok",!0,W):w7(U,"TestPingServer: server error",!1,W)}).catch(function(){clearTimeout(m); w7(U,"TestPingServer: error",!1,W)})},x1f=function(K,W){this.X=K; this.j=W},izj=function(){sO||(sO=g.vB("yt.mdx.remote.debug.handlers_")||[],g.Vk("yt.mdx.remote.debug.handlers_",sO))},Rmb=function(K,W){return K.XI?!0:K.M5?Object.values(zmt).includes(W):K.Qg?!Object.values(NVH).includes(W):K.W3?Object.values(ACf).includes(W):!1},F9f=function(K,W){this.j=K; this.map=W;this.context=null},yCN=function(K){return K.W?K.Y+kt(K):K.Y},MRZ=function(K){var W={}; W.index=K.index;W.listId=K.listId;W.videoId=K.videoId;W.playerState=K.playerState;W.volume=K.volume;W.muted=K.muted;W.audioTrackId=K.audioTrackId;W.trackData=g.Dh(K.trackData);W.hasPrevious=K.cM;W.hasNext=K.zP;W.playerTime=K.G;W.playerTimeAt=K.U;W.seekableStart=K.X;W.seekableEnd=K.Y;W.duration=K.N;W.loadedTime=K.J;W.liveIngestionTime=K.j;return W},MEW=function(){var K=RNn(); K&&K(!1,"No cast extension found")},PyF=function(K){TcI.call(this); this.status=1;this.errorCode=K},pRZ=function(){LK()?Ks()?wm()?(P0("Requesting cast selector."),Ks().requestSession()):(P0("Wait for cast API to be ready to request the session."),zrN.push(g.BV("yt-remote-cast2-api-ready",pRZ))):SM("requestCastSelector: Cast is not initialized."):SM("requestCastSelector: Cast API is not installed!")},o$f=function(K){var W=(v9+1)%50; v9=W;V0[W]=K;X6||(X6=W==49)},Jih=function(K){var W=0; K.NZ&&W++;K.BS&&W++;return W},JCN=function(K){var W=0,U; for(U in K)W++;return W},L0I=function(K){K.length>5&&(K=K.slice(K.length-5)); var W=g.CB(Xaj(),function(h){return h.loungeToken}),U=g.CB(K,function(h){return h.loungeToken}); g.X9(U,function(h){return!g.BX(W,h)})&&vEN(); g.SI("yt-remote-local-screens",K,31536E3)},W0H=function(K,W){if(RrI(K.X)>=K.X.W-(K.G?1:0))return!1; if(K.G)return K.N=W.uX.concat(K.N),!0;if(K.p_==1||K.p_==2||K.Ns>=(K.qb?0:K.M9))return!1;K.G=OO((0,g.wr)(K.Dm,K,W),hgj(K,K.Ns));K.Ns++;return!0},F1W=function(){var K=ag4(),W=H9(); W||(W=r7());return g.dG(K,function(U){return W&&j4(W,U.key)?!0:!1})},c9=function(K,W,U){var h=K.videoId; K.videoId=W;K.index=U;W!=h&&g2b(K)},m_=function(K,W){izj(); var U=Zzv(K,String(W));sO.length==0?o$f(U):(DtF(),g.tD(sO,function(h){h(U)}))},$0n=function(K){$tO(K,"getLoungeToken"); g.qE(K.U);K.U=g.FE(function(){EQO(K,null)},3E4)},BU=function(K,W,U){K.W.sendMessage(W,U)},KFt=function(K){g.Vk("yt.mdx.remote.cloudview.initializing_",K)},P0=function(K){m_("cloudview",K)},bzZ=function(K){if(K.p_==0)return K.DO; var W=[];g.Ms(W,dqZ(K.X));g.Ms(W,K.N);return W},wm=function(){return!!g.vB("yt.mdx.remote.cloudview.apiReady_")},RB=function(K,W,U){g.p.call(this); this.G=U!=null?(0,g.wr)(K,U):K;this.y6=W;this.U=(0,g.wr)(this.Z8,this);this.j=!1;this.X=0;this.N=this.In=null;this.W=[]},st3=function(K){g.nO.call(this,"serverreachability",K)},Cs=function(K){K.En&&(K.player.removeEventListener("presentingplayerstatechange",K.En),K.En=null)},uM=function(K,W,U){Array.isArray(U)||(U=[String(U)]); g.gRe(K.W,W,U)},K0t=function(K){K.j||K.J||(K.q5=1,g.kK(K.du,K),K.uX=0)},tS4=function(){return g.vB("yt.mdx.remote.connectData_")},BVf=function(K,W){W?(K.info("onConnectedScreenId_: Received screenId: "+W),K.j&&K.j.id==W||K.lJ(W,function(U){eM(K,U)},function(){return K.uK()},5)):K.uK(Error("Waiting for session status timed out."))},IWH=function(K){if(K.M5){if(K.M5.locationOverrideToken)return{locationOverrideToken:K.M5.locationOverrideToken}; if(K.M5.latitudeE7!=null&&K.M5.longitudeE7!=null)return{latitudeE7:K.M5.latitudeE7,longitudeE7:K.M5.longitudeE7}}return null},VRb=function(K){cif(K); K.uX=g.FE(function(){E_(K,"getNowPlaying")},2E4)},QHN=function(K){return bzZ(K.j).map(function(W){var U=K.X; W=W.map;"__data__"in W?(W=W.__data__,U=U.W?ZXN(W):W):U=W;return U})},rm=function(K){g.Vk("yt.mdx.remote.connectData_",K)},XRj=function(){var K=fbW; izj();sO.push(K);DtF()},E_=function(K,W,U){U?v0("Sending: action="+W+", params="+g.rc(U)):v0("Sending: action="+W); K.X.sendMessage(W,U)},Zzv=function(K,W){var U=(Date.now()-v$N)/1E3; U.toFixed&&(U=U.toFixed(3));var h=[];h.push("[",U+"s","] ");h.push("[","yt.mdx.remote","] ");h.push(K+": "+W,"\n");return h.join("")},D0t=function(K,W,U){K.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(W)); var h=new tz(W);Rgf(K,h,function(m){m?(K.Ns=!0,Az(K.W,h),eM(K,h),K.jV="unknown",egH(K,U)):(g.aH(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(W)+" is not online.")),K.uK())},5)},qIW=function(){},Ait=function(K,W){g.Uj.call(this); var U=this;this.handler=K();this.handler.subscribe("handlerOpened",this.EE,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(h,m){U.onError(m)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.j=W},CK=function(K){var W=l6F(); W.dispatchEvent(new $1F(W,K))},y6h=function(K,W,U){var h=document.createElement("script"); h.onerror=W;U&&(h.onload=U);g.sq(h,g.o4(K));(document.head||document.documentElement).appendChild(h)},sP4=function(){q2F(); return tn?!!tn.get("yt-remote-use-staging-server"):!1},d14=function(K,W){g.BX(K,W)||K.push(W)},LK=function(){return!!g.SZ("yt-remote-cast-installed")},zu=function(K,W){wYh(K); K.W.setPlayerContextData(MRZ(W));fgh(K)},oB=function(K,W,U,h){h=h===void 0?!1:h; g.GP.call(this);var m=this;this.G=NaN;this.DA=!1;this.jV=this.J=this.uX=this.Ns=NaN;this.Ms=[];this.U=this.Y=this.W=this.j=this.X=null;this.Le=K;this.eV=h;this.Ms.push(g.JD(window,"beforeunload",function(){m.z3(2)})); this.N=[];this.j=new Ee;this.tK=W.id;this.hK=W.idType;this.X=R_O(this.Le,U,this.Rm,this.hK=="shortLived",this.tK);this.X.listen("channelOpened",function(){MSO(m)}); this.X.listen("channelClosed",function(){v0("Channel closed");isNaN(m.G)?Fv(!0):Fv();m.dispose()}); this.X.listen("channelError",function(S){Fv();isNaN(m.I2())?(S==1&&m.hK=="shortLived"&&m.publish("browserChannelAuthError",S),v0("Channel error: "+S+" without reconnection"),m.dispose()):(m.DA=!0,v0("Channel error: "+S+" with reconnection in "+m.I2()+" ms"),e4(m,2))}); this.X.listen("channelMessage",function(S){QhW(m,S)}); this.X.mq(W.token);this.subscribe("remoteQueueChange",function(){var S=m.j.videoId;g.tA()&&g.SI("yt-remote-session-video-id",S)})},J6t=function(K,W){return g.yT(K,W)},bM=function(K,W){g.GP.call(this); this.config_=W;this.X=K;this.J=W.appId||"233637DE";this.W=W.theme||"cl";this.jV=W.disableCastApi||!1;this.G=W.forceMirroring||!1;this.j=null;this.Y=!1;this.N=[];this.U=(0,g.wr)(this.LGA,this)},D_=function(K,W,U){return(0,g.wr)(function(h){this.dS("Failed to "+W+" with cast v2 channel. Error code: "+h.code); h.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.dS("Retrying "+W+" using MDx browser channel."),BU(this,W,U))},K)},hr4=function(K,W,U){K.F3=1; K.By=g7(W.clone());K.E2=U;K.hK=!0;Xyf(K,null)},x0F=function(K,W,U){K.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(W)); var h=new tz(W);return(new Promise(function(m){zg4(K,h,function(S){S?(K.uX=!0,Az(K.W,h),eM(K,h),V9(K,U)):g.aH(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(W)+" is not online."));m(S)},5)})).then(function(m){return m?new chrome.cast.DialLaunchResponse(!1):XYN(K)})},Cyh=function(K){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+K)!=-1||document.currentScript.src.indexOf("&"+K)!=-1)},V9=function(K,W){K.info("getDialAppInfoWithTimeout_ "+W); s_(K)&&(g.qE(K.Y),K.Y=0,W==0?tDO(K):K.Y=g.FE(function(){tDO(K)},W))},lUt=function(K){var W=K.j.G; W!=null?(y9(5),W?(y9(11),fs(K.j,K,!1)):(y9(12),fs(K.j,K,!0))):(K.N4=new bA(K),K.N4.w2=K.LI,W=K.j,W=R7(W,W.Eg()?K.PV:null,K.zn),y9(5),uM(W,"TYPE","xmlhttp"),vRW(K.N4,W,!1,K.PV,!1))},LFv=function(K){var W=K.Ns(); W?K.W["x-youtube-lounge-xsrf-token"]=W:delete K.W["x-youtube-lounge-xsrf-token"]},wRO=function(K,W){Ks().init(K,W)},w7=function(K,W,U,h,m){try{m&&(m.onload=null,m.onerror=null,m.onabort=null,m.ontimeout=null),h(U)}catch(S){}},XYN=function(K){return new Promise(function(W){K.DA=abj(); if(K.Le){var U=new chrome.cast.DialLaunchResponse(!0,VFj(K));W(U);h_3(K)}else K.Ms=function(){g.qE(K.jV);K.Ms=function(){}; K.jV=NaN;var h=new chrome.cast.DialLaunchResponse(!0,VFj(K));W(h);h_3(K)},K.jV=g.FE(function(){K.Ms()},100)})},E2f=function(K,W){var U=parseInt(W.params.currentTime||W.params.current_time,10); F6(K.j,isNaN(U)?0:U);U=parseInt(W.params.state,10);U=isNaN(U)?-1:U;U==-1&&K.j.playerState==-1E3&&(U=-1E3);K.j.playerState=U;U=Number(W.params.loadedTime);K.j.J=isNaN(U)?0:U;K.j.BY(Number(W.params.duration));U=K.j;var h=Number(W.params.liveIngestionTime);U.j=h;U.W=isNaN(h)?!1:!0;U=K.j;h=Number(W.params.seekableStartTime);W=Number(W.params.seekableEndTime);U.X=isNaN(h)?0:h;U.Y=isNaN(W)?0:W;K.j.playerState==1?VRb(K):cif(K);K.publish("remotePlayerChange")},d0n=function(K){K=g.yb(K.N,function(W){return W.idType!= "shortLived"}); g.SI("yt-remote-automatic-screen-cache",g.CB(K,K1f))},Kub=function(K){var W=K.j.media,U=K.j.customData; if(W&&U){var h=h$(K);W.contentId!=h.videoId&&Nu("Cast changing video to: "+W.contentId);h.videoId=W.contentId;h.playerState=U.playerState;F6(h,K.j.getEstimatedTime());zu(K,h)}else Nu("No cast media video. Ignoring state update.")},B0=function(K,W){g.It.call(this,"Play on",1,K,W); this.D=K;this.sS={};this.S(K,"onMdxReceiversChange",this.X);this.S(K,"presentingplayerstatechange",this.X);this.X()},L93=function(){var K=g.i5().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.Nl||K},HU=function(K){switch(K.playerState){case 1:case 1081:return(g.hi()-K.U)/1E3+K.G; case -1E3:return 0}return K.G},CpO=function(){var K=o7(); this.j=K;K.jD("/client_streamz/youtube/living_room/mdx/channel/opened",g.Mk("channel_type"))},HX4=function(K){g.qE(K.G); K.G=NaN}; g.jL.prototype.Xb=g.on(49,function(){this.app.FK().Xb()}); g.Nz.prototype.Xb=g.on(48,function(){this.zz=null}); g.jL.prototype.vJ=g.on(47,function(K){this.app.FK().vJ(K)}); g.Nz.prototype.vJ=g.on(46,function(K){this.zz=K}); CpO.prototype.Vh=function(K){this.j.xF("/client_streamz/youtube/living_room/mdx/channel/opened",K)}; W1I.prototype.Vh=function(K){this.j.xF("/client_streamz/youtube/living_room/mdx/channel/closed",K)}; llt.prototype.Vh=function(K){this.j.xF("/client_streamz/youtube/living_room/mdx/channel/message_received",K)}; gRn.prototype.Vh=function(){this.j.xF("/client_streamz/youtube/living_room/mdx/channel/success")}; L1n.prototype.Vh=function(K,W){this.j.xF("/client_streamz/youtube/living_room/mdx/channel/error",K,W)}; mJn.prototype.Vh=function(){this.j.xF("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")}; GWn.prototype.Vh=function(){this.j.xF("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")}; g.H=Ue.prototype;g.H.hC=function(){O_(this);for(var K=[],W=0;W2*this.size&&O_(this),!0):!1}; g.H.get=function(K,W){return YO(this.X,K)?this.X[K]:W}; g.H.set=function(K,W){YO(this.X,K)||(this.size+=1,this.j.push(K),this.Gk++);this.X[K]=W}; g.H.forEach=function(K,W){for(var U=this.FA(),h=0;h=h.j.length)return g.dg;var S=h.j[W++];return g.JN(K?S:h.X[S])}; return m}; var syt={DNA:"atp",mRk:"ska",FuU:"que",vVx:"mus",nok:"sus",QCs:"dsp",u5e:"seq",m35:"mic",d4x:"dpa",ZlK:"mlm",hpr:"dsdtr",EVm:"ntb",NPx:"vsp",YC5:"scn",Rdm:"rpe",WyH:"dcn",TXU:"dcp",pMX:"pas",aaX:"drq",Plm:"opf",Zvx:"els",GPU:"isg",yfe:"svq",YYk:"mvp",HfX:"ads",Yws:"stcp",Owk:"sads",OvH:"dloc",HvA:"dcw",Lt5:"asw",nM5:"apw",m$r:"wrc",DXx:"pcw",fUm:"ipv",RhU:"ndt",xNe:"ctops"},eNZ={Qes:"u",som:"cl",grk:"k",zaK:"i",paU:"cr",SY5:"m",PTX:"g",L$:"up"},zmt={R4:"adPlaying",rV:"onAdStateChange"},NVH={FRs:"nowPlaying", cFp:"onStateChange",R4:"adPlaying",rV:"onAdStateChange",jP:"nowPlayingShorts",bz:"onShortsStateChange"},ACf={jP:"nowPlayingShorts",bz:"onShortsStateChange"};qA.prototype.equals=function(K){return K?this.id==K.id:!1}; var HSF="",tn=null;g.V(BlH,g.WH);var qu,A6b=Cyh("loadCastFramework")||Cyh("loadCastApplicationFramework"),Htf=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.sJ(RB,g.p);g.H=RB.prototype;g.H.GF=function(K){this.W=arguments;this.j=!1;this.In?this.N=g.hi()+this.y6:this.In=g.GB(this.U,this.y6)}; g.H.stop=function(){this.In&&(g.qs.clearTimeout(this.In),this.In=null);this.N=null;this.j=!1;this.W=[]}; g.H.pause=function(){++this.X}; g.H.resume=function(){this.X&&(--this.X,!this.X&&this.j&&(this.j=!1,this.G.apply(null,this.W)))}; g.H.QH=function(){this.stop();RB.j7.QH.call(this)}; g.H.Z8=function(){this.In&&(g.qs.clearTimeout(this.In),this.In=null);this.N?(this.In=g.GB(this.U,this.N-g.hi()),this.N=null):this.X?this.j=!0:(this.j=!1,this.G.apply(null,this.W))};Jz.prototype.stringify=function(K){return g.qs.JSON.stringify(K,void 0)}; Jz.prototype.parse=function(K){return g.qs.JSON.parse(K,void 0)};g.sJ(AM3,g.nO);g.sJ(TcI,g.nO);var yMj=null;g.sJ(n2W,g.nO);g.sJ($1F,g.nO);g.sJ(Ld3,g.nO);a7.prototype.debug=function(){}; a7.prototype.info=function(){}; a7.prototype.warning=function(){};var m0O={},jtv={};g.H=ns.prototype;g.H.setTimeout=function(K){this.Ik=K}; g.H.vk=function(K){K=K.target;var W=this.Bp;W&&g.ez(K)==3?W.CQ():this.hX(K)}; g.H.hX=function(K){try{if(K==this.j)a:{var W=g.ez(this.j),U=this.j.X,h=this.j.getStatus();if(!(W<3)&&(W!=3||this.j&&(this.X.X||g.FU(this.j)||g.VS(this.j)))){this.eV||W!=4||U==7||(U==8||h<=0?lA(3):lA(2));Otv(this);var m=this.j.getStatus();this.Qg=m;var S=tRn(this);if(this.G=m==200){if(this.W3&&!this.vp){b:{if(this.j){var f=g.i1(this.j,"X-HTTP-Initial-Response");if(f&&!g.YD(f)){var G=f;break b}}G=null}if(K=G)this.vp=!0,uxF(this,K);else{this.G=!1;this.U=3;CK(12);dC(this);NA(this);break a}}if(this.hK){K= !0;for(var I;!this.eV&&this.Y0&&!this.DO&&(this.DO=!0,this.N.Jk(this)):(dC(this),NA(this))}else uxF(this,S);W==4&&dC(this);this.G&&!this.eV&&(W==4?hNZ(this.N,this):(this.G=!1,Kb(this)))}else g.MEY(this.j),m==400&&S.indexOf("Unknown SID")> 0?(this.U=3,CK(12)):(this.U=0,CK(13)),dC(this),NA(this)}}}catch(d){}finally{}}; g.H.cancel=function(){this.eV=!0;dC(this)}; g.H.Yb=function(){this.Ms=null;var K=Date.now();K-this.gk>=0?(this.tK!=2&&(lA(3),CK(17)),dC(this),this.U=2,NA(this)):it3(this,this.gk-K)}; g.H.getLastError=function(){return this.U}; g.H.RO=function(){return this.j};Y2j.prototype.cancel=function(){this.N=dqZ(this);if(this.X)this.X.cancel(),this.X=null;else if(this.j&&this.j.size!==0){for(var K=g.z(this.j.values()),W=K.next();!W.done;W=K.next())W.value.cancel();this.j.clear()}};g.H=k$n.prototype;g.H.Ud=8;g.H.p_=1;g.H.connect=function(K,W,U,h){CK(0);this.Ez=K;this.eV=W||{};U&&h!==void 0&&(this.eV.OSID=U,this.eV.OAID=h);this.Bp=this.XI;this.Le=ERj(this,null,this.Ez);I7(this)}; g.H.disconnect=function(){mq4(this);if(this.p_==3){var K=this.JK++,W=this.Le.clone();g.aT(W,"SID",this.W);g.aT(W,"RID",K);g.aT(W,"TYPE","terminate");Zw(this,W);K=new ns(this,this.W,K);K.tK=2;K.J=g7(W.clone());W=!1;if(g.qs.navigator&&g.qs.navigator.sendBeacon)try{W=g.qs.navigator.sendBeacon(K.J.toString(),"")}catch(U){}!W&&g.qs.Image&&((new Image).src=K.J,W=!0);W||(K.j=A73(K.N,null),K.j.send(K.J));K.Ns=Date.now();Kb(K)}cMH(this)}; g.H.CC=function(){return this.p_==0}; g.H.getState=function(){return this.p_}; g.H.Dm=function(K){if(this.G)if(this.G=null,this.p_==1){if(!K){this.JK=Math.floor(Math.random()*1E5);K=this.JK++;var W=new ns(this,"",K),U=this.jV;this.W3&&(U?(U=g.Ni(U),g.Zc(U,this.W3)):U=this.W3);this.Y!==null||this.gk||(W.Le=U,U=null);var h;if(this.M5)a:{for(var m=h=0;m4096){h=m;break a}if(h===4096||m===this.N.length-1){h=m+1;break a}}h= 1E3}else h=1E3;h=WAn(this,W,h);m=this.Le.clone();g.aT(m,"RID",K);g.aT(m,"CVER",22);this.hK&&g.aT(m,"X-HTTP-Session-Id",this.hK);Zw(this,m);U&&(this.gk?h="headers="+g.kH(g.mKD(U))+"&"+h:this.Y&&g.w_(m,this.Y,U));YDh(this.X,W);this.u5&&g.aT(m,"TYPE","init");this.M5?(g.aT(m,"$req",h),g.aT(m,"SID","null"),W.W3=!0,uJt(W,m,null)):uJt(W,m,h);this.p_=2}}else this.p_==3&&(K?CVh(this,K):this.N.length==0||C03(this.X)||CVh(this))}; g.H.du=function(){this.J=null;oRZ(this);if(this.oW&&!(this.Ik||this.j==null||this.Ny<=0)){var K=4*this.Ny;this.DA=OO((0,g.wr)(this.qaV,this),K)}}; g.H.qaV=function(){this.DA&&(this.DA=null,this.Bp=!1,this.Ik=!0,CK(10),J$(this),oRZ(this))}; g.H.Jk=function(K){this.j==K&&this.oW&&!this.Ik&&(q0n(this),this.Ik=!0,CK(11))}; g.H.SS=function(){this.Ms!=null&&(this.Ms=null,J$(this),UqI(this),CK(19))}; g.H.nqU=function(K){K?CK(2):CK(1)}; g.H.isActive=function(){return!!this.U&&this.U.isActive(this)}; g.H=qIW.prototype;g.H.zU=function(){}; g.H.m2=function(){}; g.H.Lb=function(){}; g.H.Hw=function(){}; g.H.isActive=function(){return!0}; g.H.A4=function(){};g.sJ(Yt,g.Uj);Yt.prototype.open=function(){this.j.U=this.N;this.G&&(this.j.vp=!0);this.j.connect(this.U,this.X||void 0)}; Yt.prototype.close=function(){this.j.disconnect()}; Yt.prototype.send=function(K){var W=this.j;if(typeof K==="string"){var U={};U.__data__=K;K=U}else this.W&&(U={},U.__data__=g.rc(K),K=U);W.N.push(new NlN(W.pC++,K));W.p_==3&&I7(W)}; Yt.prototype.QH=function(){this.j.U=null;delete this.N;this.j.disconnect();delete this.j;Yt.j7.QH.call(this)}; g.sJ(cCj,AM3);g.sJ(PyF,TcI);g.sJ($t,qIW);$t.prototype.zU=function(){this.j.dispatchEvent("m")}; $t.prototype.m2=function(K){this.j.dispatchEvent(new cCj(K))}; $t.prototype.Lb=function(K){this.j.dispatchEvent(new PyF(K))}; $t.prototype.Hw=function(){this.j.dispatchEvent("n")}; x1f.prototype.commit=function(K){this.j.Qg=K};var Jn=new g.Uj;g.V(GE4,g.nO);g.H=bA.prototype;g.H.w2=null;g.H.KM=!1;g.H.Ka=null;g.H.Hq=null;g.H.w8=null;g.H.F3=null;g.H.By=null;g.H.KQ=null;g.H.E2=null;g.H.BN=null;g.H.Rs=0;g.H.Q5=null;g.H.Is=null;g.H.s2=null;g.H.VG=-1;g.H.i6=!0;g.H.Jo=!1;g.H.DK=0;g.H.E$=null;var PVW={},M8W={};g.H=bA.prototype;g.H.setTimeout=function(K){this.X=K}; g.H.J4=function(K){K=K.target;var W=this.E$;W&&g.ez(K)==3?W.CQ():this.kf(K)}; g.H.kf=function(K){try{if(K==this.BN)a:{var W=g.ez(this.BN),U=this.BN.X,h=this.BN.getStatus();if(g.$U&&!g.rs("420+")){if(W<4)break a}else if(W<3||W==3&&!g.FU(this.BN))break a;this.Jo||W!=4||U==7||(U==8||h<=0?this.j.Cn(3):this.j.Cn(2));fWO(this);var m=this.BN.getStatus();this.VG=m;var S=g.FU(this.BN);if(this.KM=m==200){W==4&&Ls(this);if(this.hK){for(K=!0;!this.Jo&&this.Rs0?(this.s2=3,y9(13)):(this.s2=0,y9(14)),Ls(this),Zth(this)}}catch(G){}finally{}}; g.H.cancel=function(){this.Jo=!0;Ls(this)}; g.H.Bk=function(){this.Ka=null;var K=Date.now();K-this.Hq>=0?(this.F3!=2&&this.j.Cn(3),Ls(this),this.s2=2,y9(18),Zth(this)):Tnv(this,this.Hq-K)}; g.H.getLastError=function(){return this.s2};g.H=UJv.prototype;g.H.LI=null;g.H.N4=null;g.H.vj=!1;g.H.zn=null;g.H.o5=null;g.H.Pg=-1;g.H.PV=null;g.H.vT=null;g.H.connect=function(K){this.zn=K;K=R7(this.j,null,this.zn);y9(3);Date.now();var W=this.j.jV;W!=null?(this.PV=W[0],(this.vT=W[1])?(this.o5=1,FFv(this)):(this.o5=2,lUt(this))):(uM(K,"MODE","init"),this.N4=new bA(this),this.N4.w2=this.LI,vRW(this.N4,K,!1,null,!0),this.o5=0)}; g.H.Qf=function(K){if(K)this.o5=2,lUt(this);else{y9(4);var W=this.j;W.df=W.aA.Pg;MA(W,9)}K&&this.Cn(2)}; g.H.nI=function(K){return this.j.nI(K)}; g.H.abort=function(){this.N4&&(this.N4.cancel(),this.N4=null);this.Pg=-1}; g.H.CC=function(){return!1}; g.H.qT=function(K,W){this.Pg=K.VG;if(this.o5==0)if(W){try{var U=this.X.parse(W)}catch(h){K=this.j;K.df=this.Pg;MA(K,2);return}this.PV=U[0];this.vT=U[1]}else K=this.j,K.df=this.Pg,MA(K,2);else this.o5==2&&(this.vj?(y9(7),Date.now()):W=="11111"?(y9(6),this.vj=!0,Date.now(),this.Pg=200,this.N4.cancel(),y9(12),fs(this.j,this,!0)):(y9(8),Date.now(),this.vj=!1))}; g.H.ma=function(){this.Pg=this.N4.VG;if(this.N4.KM)this.o5==0?this.vT?(this.o5=1,FFv(this)):(this.o5=2,lUt(this)):this.o5==2&&(this.vj?(y9(12),fs(this.j,this,!0)):(y9(11),fs(this.j,this,!1)));else{this.o5==0?y9(9):this.o5==2&&y9(10);var K=this.j;this.N4.getLastError();K.df=this.Pg;MA(K,2)}}; g.H.Eg=function(){return this.j.Eg()}; g.H.isActive=function(){return this.j.isActive()}; g.H.Cn=function(K){this.j.Cn(K)};g.H=kEI.prototype;g.H.Pa=null;g.H.KS=null;g.H.BS=null;g.H.NZ=null;g.H.eb=null;g.H.fQ=null;g.H.tX=null;g.H.qO=null;g.H.F2=0;g.H.wb=0;g.H.rj=null;g.H.F4=null;g.H.cg=null;g.H.Fq=null;g.H.aA=null;g.H.EN=null;g.H.RE=-1;g.H.GU=-1;g.H.df=-1;g.H.IE=0;g.H.FZ=0;g.H.K4=8;var Wuh={OK:0,xXk:2,hhm:4,IF5:5,bnx:6,STOP:7,iz:8,zFK:9,nT5:10,mNk:11,zQr:12};g.sJ(Qtn,g.nO);g.sJ(st3,g.nO);g.H=kEI.prototype; g.H.connect=function(K,W,U,h,m){y9(0);this.eb=W;this.KS=U||{};h&&m!==void 0&&(this.KS.OSID=h,this.KS.OAID=m);this.J?(DZ((0,g.wr)(this.Zy,this,K),100),PpH(this)):this.Zy(K)}; g.H.disconnect=function(){jHI(this);if(this.j==3){var K=this.F2++,W=this.fQ.clone();g.aT(W,"SID",this.W);g.aT(W,"RID",K);g.aT(W,"TYPE","terminate");A$(this,W);K=new bA(this,this.W,K);K.F3=2;K.By=g7(W.clone());(new Image).src=K.By.toString();K.w8=Date.now();V8j(K)}J7v(this)}; g.H.Zy=function(K){this.aA=new UJv(this);this.aA.LI=this.Pa;this.aA.X=this.U;this.aA.connect(K)}; g.H.CC=function(){return this.j==0}; g.H.getState=function(){return this.j}; g.H.Yf=function(K){this.F4=null;BcH(this,K)}; g.H.Zm=function(){this.cg=null;this.NZ=new bA(this,this.W,"rpc",this.Y);this.NZ.w2=this.Pa;this.NZ.DK=0;var K=this.tX.clone();g.aT(K,"RID","rpc");g.aT(K,"SID",this.W);g.aT(K,"CI",this.EN?"0":"1");g.aT(K,"AID",this.RE);A$(this,K);g.aT(K,"TYPE","xmlhttp");vRW(this.NZ,K,!0,this.qO,!1)}; g.H.qT=function(K,W){if(this.j!=0&&(this.NZ==K||this.BS==K))if(this.df=K.VG,this.BS==K&&this.j==3)if(this.K4>7){try{var U=this.U.parse(W)}catch(h){U=null}if(Array.isArray(U)&&U.length==3)if(K=U,K[0]==0)a:{if(!this.cg){if(this.NZ)if(this.NZ.w8+3E30)){if(h=W==1)this.BS||this.F4||this.j==1||this.IE>=2?h=!1:(this.F4=DZ((0,g.wr)(this.Yf,this,K),btj(this,this.IE)),this.IE++, h=!0);h=!(h||W==2&&sHN(this))}if(h)switch(U){case 1:MA(this,5);break;case 4:MA(this,10);break;case 3:MA(this,6);break;case 7:MA(this,12);break;default:MA(this,2)}}}; g.H.VI=function(K){if(!g.BX(arguments,this.j))throw Error("Unexpected channel state: "+this.j);}; g.H.H_V=function(K){K?y9(2):(y9(1),qKW(this,8))}; g.H.nI=function(K){if(K)throw Error("Can't create secondary domain capable XhrIo object.");K=new g.DK;K.Y=!1;return K}; g.H.isActive=function(){return!!this.rj&&this.rj.isActive(this)}; g.H.Cn=function(K){var W=Jn;W.dispatchEvent(new st3(W,K))}; g.H.Eg=function(){return!1}; g.H=c7t.prototype;g.H.Bw=function(){}; g.H.AX=function(){}; g.H.JX=function(){}; g.H.Su=function(){}; g.H.t5=function(){}; g.H.VW=function(){return{}}; g.H.isActive=function(){return!0};g.H=nQW.prototype;g.H.enqueue=function(K){this.X.push(K)}; g.H.isEmpty=function(){return this.j.length===0&&this.X.length===0}; g.H.clear=function(){this.j=[];this.X=[]}; g.H.contains=function(K){return g.BX(this.j,K)||g.BX(this.X,K)}; g.H.remove=function(K){var W=this.j;var U=(0,g.HsL)(W,K);U>=0?(g.wd(W,U),W=!0):W=!1;return W||g.sS(this.X,K)}; g.H.hC=function(){for(var K=[],W=this.j.length-1;W>=0;--W)K.push(this.j[W]);W=this.X.length;for(var U=0;U=Uxb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(K=Uxb[this.X],this.In=g.FE((0,g.wr)(this.mV,this),K),this.X++):this.publish("pairingFailed",Error("Server error "+K.status))}; g.H.R3=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))}; var Uxb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.sJ(Gu,IB);g.H=Gu.prototype;g.H.start=function(){dm(this)&&this.publish("screenChange");!g.SZ("yt-remote-lounge-token-expiration")&&n$O(this);g.qE(this.j);this.j=g.FE((0,g.wr)(this.start,this),1E4)}; g.H.add=function(K,W){dm(this);kot(this,K);pK(this,!1);this.publish("screenChange");W(K);K.token||n$O(this)}; g.H.remove=function(K,W){var U=dm(this);g$j(this,K)&&(pK(this,!1),U=!0);W(K);U&&this.publish("screenChange")}; g.H.w3=function(K,W,U,h){var m=dm(this),S=this.get(K.id);S?(S.name!=W&&(S.name=W,pK(this,!1),m=!0),U(K)):h(Error("no such local screen."));m&&this.publish("screenChange")}; g.H.QH=function(){g.qE(this.j);Gu.j7.QH.call(this)}; g.H.LrA=function(K){dm(this);var W=this.screens.length;K=K&&K.screens||[];for(var U=K.length,h=0;h20)break a;G=W(S,f)}S=G}m.name=S}U(Az(this,m))},this), onError:(0,g.wr)(function(m){h(Error("pairing request failed: "+m.status))},this), onTimeout:(0,g.wr)(function(){h(Error("pairing request timed out."))},this)})}; g.H.QH=function(){g.vZ(this.X);g.vZ(this.j);Mu.j7.QH.call(this)}; g.H.Y5p=function(){ZGh(this);this.publish("screenChange");this.j.update()}; Mu.prototype.dispose=Mu.prototype.dispose;g.sJ(c0,g.GP);g.H=c0.prototype;g.H.uK=function(K){this.qs()||(K&&(xt(this,""+K),this.publish("sessionFailed")),this.j=null,this.publish("sessionScreen",null))}; g.H.info=function(K){m_(this.hK,K)}; g.H.Kb=function(){return null}; g.H.k7=function(K){var W=this.X;K?(W.displayStatus=new chrome.cast.ReceiverDisplayStatus(K,[]),W.displayStatus.showStop=!0):W.displayStatus=null;chrome.cast.setReceiverDisplayStatus(W,(0,g.wr)(function(){this.info("Updated receiver status for "+W.friendlyName+": "+K)},this),(0,g.wr)(function(){xt(this,"Failed to update receiver status for: "+W.friendlyName)},this))}; g.H.QH=function(){this.k7("");c0.j7.QH.call(this)};g.V(B9,c0);g.H=B9.prototype;g.H.mL=function(K){if(this.N){if(this.N==K)return;xt(this,"Overriding cast session with new session object");iSI(this);this.Ns=!1;this.jV="unknown";this.N.removeUpdateListener(this.uX);this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DA)}this.N=K;this.N.addUpdateListener(this.uX);this.N.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.DA);$tO(this,"getMdxSessionStatus")}; g.H.Zz=function(K){this.info("launchWithParams no-op for Cast: "+g.rc(K))}; g.H.stop=function(){this.N?this.N.stop((0,g.wr)(function(){this.uK()},this),(0,g.wr)(function(){this.uK(Error("Failed to stop receiver app."))},this)):this.uK(Error("Stopping cast device without session."))}; g.H.k7=function(){}; g.H.QH=function(){this.info("disposeInternal");iSI(this);this.N&&(this.N.removeUpdateListener(this.uX),this.N.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DA));this.N=null;c0.prototype.QH.call(this)}; g.H.HCx=function(K,W){if(!this.qs())if(W)if(W=iA(W),g.SG(W))switch(K=""+W.type,W=W.data||{},this.info("onYoutubeMessage_: "+K+" "+g.rc(W)),K){case "mdxSessionStatus":G$b(this,W);break;case "loungeToken":EQO(this,W);break;default:xt(this,"Unknown youtube message: "+K)}else xt(this,"Unable to parse message.");else xt(this,"No data in message.")}; g.H.lJ=function(K,W,U,h){g.qE(this.J);this.J=0;UtO(this.W,this.X.label,K,this.X.friendlyName,(0,g.wr)(function(m){m?W(m):h>=0?(xt(this,"Screen "+K+" appears to be offline. "+h+" retries left."),this.J=g.FE((0,g.wr)(this.lJ,this,K,W,U,h-1),300)):U(Error("Unable to fetch screen."))},this),U)}; g.H.Kb=function(){return this.N}; g.H.Pk=function(K){this.qs()||K||(xt(this,"Cast session died."),this.uK())};g.V(UO,c0);g.H=UO.prototype;g.H.mL=function(K){this.N=K;this.N.addUpdateListener(this.eV)}; g.H.Zz=function(K){this.Le=K;this.Ms()}; g.H.stop=function(){YIH(this);this.N?this.N.stop((0,g.wr)(this.uK,this,null),(0,g.wr)(this.uK,this,"Failed to stop DIAL device.")):this.uK()}; g.H.QH=function(){YIH(this);this.N&&this.N.removeUpdateListener(this.eV);this.N=null;c0.prototype.QH.call(this)}; g.H.xb=function(K){this.qs()||K||(xt(this,"DIAL session died."),this.U(),this.U=function(){},this.uK())};g.V(nK,c0);nK.prototype.stop=function(){this.uK()}; nK.prototype.mL=function(){}; nK.prototype.Zz=function(){g.qE(this.N);this.N=NaN;var K=m4(this.W.Ha(),this.X.label);K?eM(this,K):this.uK(Error("No such screen"))}; nK.prototype.QH=function(){g.qE(this.N);this.N=NaN;c0.prototype.QH.call(this)};g.V(bM,g.GP);g.H=bM.prototype; g.H.init=function(K,W){chrome.cast.timeout.requestSession=3E4;var U=new chrome.cast.SessionRequest(this.J,[chrome.cast.Capability.AUDIO_OUT]);g.hc("desktop_enable_cast_connect")&&(U.androidReceiverCompatible=!0);this.jV||(U.dialRequest=new chrome.cast.DialRequest("YouTube"));var h=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;K=K||this.G?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var m=(0,g.wr)(this.k7k,this);U=new chrome.cast.ApiConfig(U,(0,g.wr)(this.ol, this),m,h,K);U.customDialLaunchCallback=(0,g.wr)(this.K6x,this);chrome.cast.initialize(U,(0,g.wr)(function(){this.qs()||(chrome.cast.addReceiverActionListener(this.U),XRj(),this.X.subscribe("onlineScreenChange",(0,g.wr)(this.FU,this)),this.N=HzI(this),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.wr)(function(S){this.dS("Failed to set initial custom receivers: "+g.rc(S))},this)),this.publish("yt-remote-cast2-availability-change",m3(this)),W(!0))},this),(0,g.wr)(function(S){this.dS("Failed to initialize API: "+ g.rc(S)); W(!1)},this))}; g.H.J3K=function(K,W){WU("Setting connected screen ID: "+K+" -> "+W);if(this.j){var U=this.j.j;if(!K||U&&U.id!=K)WU("Unsetting old screen status: "+this.j.X.friendlyName),iM(this,null)}if(K&&W){if(!this.j){K=m4(this.X.Ha(),K);if(!K){WU("setConnectedScreenStatus: Unknown screen.");return}if(K.idType=="shortLived"){WU("setConnectedScreenStatus: Screen with id type to be short lived.");return}U=ZSn(this,K);U||(WU("setConnectedScreenStatus: Connected receiver not custom..."),U=new chrome.cast.Receiver(K.uuid? K.uuid:K.id,K.name),U.receiverType=chrome.cast.ReceiverType.CUSTOM,this.N.push(U),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.wr)(function(h){this.dS("Failed to set initial custom receivers: "+g.rc(h))},this))); WU("setConnectedScreenStatus: new active receiver: "+U.friendlyName);iM(this,new nK(this.X,U),!0)}this.j.k7(W)}else WU("setConnectedScreenStatus: no screen.")}; g.H.ELx=function(K){this.qs()?this.dS("Setting connection data on disposed cast v2"):this.j?this.j.Zz(K):this.dS("Setting connection data without a session")}; g.H.Ci=function(){this.qs()?this.dS("Stopping session on disposed cast v2"):this.j?(this.j.stop(),iM(this,null)):WU("Stopping non-existing session")}; g.H.requestSession=function(){chrome.cast.requestSession((0,g.wr)(this.ol,this),(0,g.wr)(this.PBr,this))}; g.H.QH=function(){this.X.unsubscribe("onlineScreenChange",(0,g.wr)(this.FU,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.U);var K=fbW,W=g.vB("yt.mdx.remote.debug.handlers_");g.sS(W||[],K);g.vZ(this.j);g.GP.prototype.QH.call(this)}; g.H.dS=function(K){m_("Controller",K)}; g.H.fD=function(K,W){this.j==K&&(W||iM(this,null),this.publish("yt-remote-cast2-session-change",W))}; g.H.LGA=function(K,W){if(!this.qs())if(K)switch(K.friendlyName=chrome.cast.unescape(K.friendlyName),WU("onReceiverAction_ "+K.label+" / "+K.friendlyName+"-- "+W),W){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.X.label!=K.label)WU("onReceiverAction_: Stopping active receiver: "+this.j.X.friendlyName),this.j.stop();else{WU("onReceiverAction_: Casting to active receiver.");this.j.j&&this.publish("yt-remote-cast2-session-change",this.j.j);break}switch(K.receiverType){case chrome.cast.ReceiverType.CUSTOM:iM(this, new nK(this.X,K));break;case chrome.cast.ReceiverType.DIAL:iM(this,new UO(this.X,K,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:iM(this,new B9(this.X,K,this.config_));break;default:this.dS("Unknown receiver type: "+K.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.X.label==K.label?this.j.stop():this.dS("Stopping receiver w/o session: "+K.friendlyName)}else this.dS("onReceiverAction_ called without receiver.")}; g.H.K6x=function(K){if(this.qs())return Promise.reject(Error("disposed"));var W=K.receiver;W.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dS("Not DIAL receiver: "+W.friendlyName),W.receiverType=chrome.cast.ReceiverType.DIAL);var U=this.j?this.j.X:null;if(!U||U.label!=W.label)return this.dS("Receiving DIAL launch request for non-clicked DIAL receiver: "+W.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(U&&U.label==W.label&&U.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.j)return WU("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.j.j),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dS('Changing CAST intent from "'+U.receiverType+'" to "dial" for '+W.friendlyName);iM(this,new UO(this.X,W,this.W,this.config_))}W=this.j;W.J=K;W.J.appState==chrome.cast.DialAppState.RUNNING?(K=W.J.extraData||{},U=K.screenId||null,s_(W)&&K.loungeToken?K.loungeTokenRefreshIntervalMs?K=x0F(W,{name:W.X.friendlyName,screenId:K.screenId,loungeToken:K.loungeToken,dialId:W.J.receiver.label, screenIdType:"shortLived"},K.loungeTokenRefreshIntervalMs):(g.aH(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(K)+".")),K=vQF(W,U)):K=vQF(W,U)):K=XYN(W);return K}; g.H.ol=function(K){var W=this;if(!this.qs()&&!this.G){WU("New cast session ID: "+K.sessionId);var U=K.receiver;if(U.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(U.receiverType==chrome.cast.ReceiverType.CAST)WU("Got resumed cast session before resumed mdx connection."),U.friendlyName=chrome.cast.unescape(U.friendlyName),iM(this,new B9(this.X,U,this.config_),!0);else{this.dS("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var h=this.j.X,m=m4(this.X.Ha(), h.label);m&&j4(m,U.label)&&h.receiverType!=chrome.cast.ReceiverType.CAST&&U.receiverType==chrome.cast.ReceiverType.CAST&&(WU("onSessionEstablished_: manual to cast session change "+U.friendlyName),g.vZ(this.j),this.j=new B9(this.X,U,this.config_),this.j.subscribe("sessionScreen",(0,g.wr)(this.fD,this,this.j)),this.j.subscribe("sessionFailed",function(){return xJn(W,W.j)}),this.j.Zz(null)); this.j.mL(K)}}}; g.H.lD=function(){return this.j?this.j.Kb():null}; g.H.PBr=function(K){this.qs()||(this.dS("Failed to estabilish a session: "+g.rc(K)),K.code!=chrome.cast.ErrorCode.CANCEL&&iM(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.H.k7k=function(K){WU("Receiver availability updated: "+K);if(!this.qs()){var W=m3(this);this.Y=K==chrome.cast.ReceiverAvailability.AVAILABLE;m3(this)!=W&&this.publish("yt-remote-cast2-availability-change",m3(this))}}; g.H.FU=function(){this.qs()||(this.N=HzI(this),WU("Updating custom receivers: "+g.rc(this.N)),chrome.cast.setCustomReceivers(this.N,function(){},(0,g.wr)(function(){this.dS("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",m3(this)))}; bM.prototype.setLaunchParams=bM.prototype.ELx;bM.prototype.setConnectedScreenStatus=bM.prototype.J3K;bM.prototype.stopSession=bM.prototype.Ci;bM.prototype.getCastSession=bM.prototype.lD;bM.prototype.requestSession=bM.prototype.requestSession;bM.prototype.init=bM.prototype.init;bM.prototype.dispose=bM.prototype.dispose;var hC3=g.Le(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),zrN=[],hmj=g.qi(hC3);g.H=Ee.prototype; g.H.reset=function(K){this.listId="";this.index=-1;this.videoId="";g2b(this);this.volume=-1;this.muted=!1;K&&(this.index=K.index,this.listId=K.listId,this.videoId=K.videoId,this.playerState=K.playerState,this.volume=K.volume,this.muted=K.muted,this.audioTrackId=K.audioTrackId,this.trackData=K.trackData,this.cM=K.hasPrevious,this.zP=K.hasNext,this.G=K.playerTime,this.U=K.playerTimeAt,this.X=K.seekableStart,this.Y=K.seekableEnd,this.N=K.duration,this.J=K.loadedTime,this.j=K.liveIngestionTime,this.W= !isNaN(this.j))}; g.H.isPlaying=function(){return this.playerState==1}; g.H.isBuffering=function(){return this.playerState==3}; g.H.BY=function(K){this.N=isNaN(K)?0:K}; g.H.getDuration=function(){return this.W?this.N+kt(this):this.N}; g.H.clone=function(){return new Ee(MRZ(this))};g.V(es,g.GP);g.H=es.prototype;g.H.getState=function(){return this.N}; g.H.JV=function(){return this.W.getReconnectTimeout()}; g.H.fZ=function(){this.W.reconnect()}; g.H.play=function(){js(this)?(this.j?this.j.play(null,g.Ac,D_(this,"play")):BU(this,"play"),lgn(this,1,HU(h$(this))),this.publish("remotePlayerChange")):aB(this,this.play)}; g.H.pause=function(){js(this)?(this.j?this.j.pause(null,g.Ac,D_(this,"pause")):BU(this,"pause"),lgn(this,2,HU(h$(this))),this.publish("remotePlayerChange")):aB(this,this.pause)}; g.H.seekTo=function(K){if(js(this)){if(this.j){var W=h$(this),U=new chrome.cast.media.SeekRequest;U.currentTime=K;W.isPlaying()||W.isBuffering()?U.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:U.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(U,g.Ac,D_(this,"seekTo",{newTime:K}))}else BU(this,"seekTo",{newTime:K});lgn(this,3,K);this.publish("remotePlayerChange")}else aB(this,g.jt(this.seekTo,K))}; g.H.stop=function(){if(js(this)){this.j?this.j.stop(null,g.Ac,D_(this,"stopVideo")):BU(this,"stopVideo");var K=h$(this);K.index=-1;K.videoId="";g2b(K);zu(this,K);this.publish("remotePlayerChange")}else aB(this,this.stop)}; g.H.setVolume=function(K,W){if(js(this)){var U=h$(this);if(this.X){if(U.volume!=K){var h=Math.round(K)/100;this.X.setReceiverVolumeLevel(h,(0,g.wr)(function(){Nu("set receiver volume: "+h)},this),(0,g.wr)(function(){this.dS("failed to set receiver volume.")},this))}U.muted!=W&&this.X.setReceiverMuted(W,(0,g.wr)(function(){Nu("set receiver muted: "+W)},this),(0,g.wr)(function(){this.dS("failed to set receiver muted.")},this))}else{var m={volume:K, muted:W};U.volume!=-1&&(m.delta=K-U.volume);BU(this,"setVolume",m)}U.muted=W;U.volume=K;zu(this,U)}else aB(this,g.jt(this.setVolume,K,W))}; g.H.Im=function(K,W){if(js(this)){var U=h$(this);K={videoId:K};W&&(U.trackData={trackName:W.name,languageCode:W.languageCode,sourceLanguageCode:W.translationLanguage?W.translationLanguage.languageCode:"",languageName:W.languageName,kind:W.kind},K.style=g.rc(W.style),g.Zc(K,U.trackData));BU(this,"setSubtitlesTrack",K);zu(this,U)}else aB(this,g.jt(this.Im,K,W))}; g.H.setAudioTrack=function(K,W){js(this)?(W=W.getLanguageInfo().getId(),BU(this,"setAudioTrack",{videoId:K,audioTrackId:W}),K=h$(this),K.audioTrackId=W,zu(this,K)):aB(this,g.jt(this.setAudioTrack,K,W))}; g.H.playVideo=function(K,W,U,h,m,S,f){h=h===void 0?null:h;m=m===void 0?null:m;S=S===void 0?null:S;f=f===void 0?null:f;var G=h$(this),I={videoId:K};U!==void 0&&(I.currentIndex=U);c9(G,K,U||0);W!==void 0&&(F6(G,W),I.currentTime=W);h&&(I.listId=h);m&&(I.playerParams=m);S&&(I.clickTrackingParams=S);f&&(I.locationInfo=g.rc(f));BU(this,"setPlaylist",I);h||zu(this,G)}; g.H.Lq=function(K,W){if(js(this)){if(K&&W){var U=h$(this);c9(U,K,W);zu(this,U)}BU(this,"previous")}else aB(this,g.jt(this.Lq,K,W))}; g.H.nextVideo=function(K,W){if(js(this)){if(K&&W){var U=h$(this);c9(U,K,W);zu(this,U)}BU(this,"next")}else aB(this,g.jt(this.nextVideo,K,W))}; g.H.Er=function(){if(js(this)){BU(this,"clearPlaylist");var K=h$(this);K.reset();zu(this,K);this.publish("remotePlayerChange")}else aB(this,this.Er)}; g.H.CL=function(){js(this)?BU(this,"dismissAutoplay"):aB(this,this.CL)}; g.H.dispose=function(){if(this.N!=3){var K=this.N;this.N=3;this.publish("proxyStateChange",K,this.N)}g.GP.prototype.dispose.call(this)}; g.H.QH=function(){wYh(this);this.W=null;this.U.clear();hn(this,null);g.GP.prototype.QH.call(this)}; g.H.GQ=function(K){if((K!=this.N||K==2)&&this.N!=3&&K!=0){var W=this.N;this.N=K;this.publish("proxyStateChange",W,K);if(K==1)for(;!this.U.isEmpty();)W=K=this.U,W.j.length===0&&(W.j=W.X,W.j.reverse(),W.X=[]),K.j.pop().apply(this);else K==3&&this.dispose()}}; g.H.DbH=function(K,W){this.publish(K,W)}; g.H.Zrr=function(K){if(!K)this.Tr(null),hn(this,null);else if(this.X.receiver.volume){K=this.X.receiver.volume;var W=h$(this),U=Math.round(100*K.level||0);if(W.volume!=U||W.muted!=K.muted)Nu("Cast volume update: "+K.level+(K.muted?" muted":"")),W.volume=U,W.muted=!!K.muted,zu(this,W)}}; g.H.Tr=function(K){Nu("Cast media: "+!!K);this.j&&this.j.removeUpdateListener(this.J);if(this.j=K)this.j.addUpdateListener(this.J),Kub(this),this.publish("remotePlayerChange")}; g.H.GKe=function(K){K?(Kub(this),this.publish("remotePlayerChange")):this.Tr(null)}; g.H.Qs=function(){BU(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.H.vmK=function(){var K=IUW();K&&hn(this,K)}; g.H.dS=function(K){m_("CP",K)};g.V(oB,g.GP);g.H=oB.prototype; g.H.connect=function(K,W){if(W){var U=W.listId,h=W.videoId,m=W.videoIds,S=W.playerParams,f=W.clickTrackingParams,G=W.index,I={videoId:h},d=W.currentTime,J=W.locationInfo;W=W.loopMode;d!==void 0&&(I.currentTime=d<=5?0:d);S&&(I.playerParams=S);J&&(I.locationInfo=J);f&&(I.clickTrackingParams=f);U&&(I.listId=U);m&&m.length>0&&(I.videoIds=m.join(","));G!==void 0&&(I.currentIndex=G);this.eV&&(I.loopMode=W||"LOOP_MODE_OFF");U&&(this.j.listId=U);this.j.videoId=h;this.j.index=G||0;this.j.state=3;F6(this.j, d);this.U="UNSUPPORTED";U=this.eV?"setInitialState":"setPlaylist";v0("Connecting with "+U+" and params: "+g.rc(I));this.X.connect({method:U,params:g.rc(I)},K,r7N())}else v0("Connecting without params"),this.X.connect({},K,r7N());pNZ(this)}; g.H.mq=function(K){this.X.mq(K)}; g.H.dispose=function(){this.qs()||(g.Vk("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),e4(this,3));g.GP.prototype.dispose.call(this)}; g.H.QH=function(){HX4(this);cif(this);r6W(this);g.qE(this.J);this.J=NaN;g.qE(this.jV);this.jV=NaN;this.W=null;g.d9(this.Ms);this.Ms.length=0;this.X.dispose();g.GP.prototype.QH.call(this);this.U=this.Y=this.N=this.j=this.X=null}; g.H.l8=function(K){if(!this.N||this.N.length===0)return!1;for(var W=g.z(this.N),U=W.next();!U.done;U=W.next())if(!U.value.capabilities.has(K))return!1;return!0}; g.H.ies=function(){var K=3;this.qs()||(K=0,isNaN(this.I2())?this.X.Kj()&&isNaN(this.G)&&(K=1):K=2);return K}; g.H.z3=function(K){v0("Disconnecting with "+K);g.Vk("yt.mdx.remote.remoteClient_",null);HX4(this);this.publish("beforeDisconnect",K);K==1&&Fv();this.X.disconnect(K);this.dispose()}; g.H.PG=function(){var K=this.j;this.W&&(K=this.j.clone(),c9(K,this.W,K.index));return MRZ(K)}; g.H.IwX=function(K){var W=this,U=new Ee(K);U.videoId&&U.videoId!=this.j.videoId&&(this.W=U.videoId,g.qE(this.J),this.J=g.FE(function(){if(W.W){var m=W.W;W.W=null;W.j.videoId!=m&&E_(W,"getNowPlaying")}},5E3)); var h=[];this.j.listId==U.listId&&this.j.videoId==U.videoId&&this.j.index==U.index||h.push("remoteQueueChange");this.j.playerState==U.playerState&&this.j.volume==U.volume&&this.j.muted==U.muted&&HU(this.j)==HU(U)&&g.rc(this.j.trackData)==g.rc(U.trackData)||h.push("remotePlayerChange");this.j.reset(K);g.tD(h,function(m){this.publish(m)},this)}; g.H.IV=function(){var K=this.X.getDeviceId(),W=g.dG(this.N,function(U){return U.type=="REMOTE_CONTROL"&&U.id!=K}); return W?W.id:""}; g.H.I2=function(){return this.X.JV()}; g.H.Z9=function(){return this.U||"UNSUPPORTED"}; g.H.Ye=function(){return this.Y||""}; g.H.gb=function(){!isNaN(this.I2())&&this.X.fZ()}; g.H.vLr=function(K,W){E_(this,K,W);j1I(this)}; g.H.Rm=function(){var K=g.LY("SAPISID","")||g.LY("__Secure-1PAPISID")||"",W=g.LY("__Secure-3PAPISID","")||"";if(!K&&!W)return"";K=g.o0(g.Zv(K),2);W=g.o0(g.Zv(W),2);return g.o0(g.Zv(","+K+","+W),2)}; oB.prototype.subscribe=oB.prototype.subscribe;oB.prototype.unsubscribeByKey=oB.prototype.M2;oB.prototype.getProxyState=oB.prototype.ies;oB.prototype.disconnect=oB.prototype.z3;oB.prototype.getPlayerContextData=oB.prototype.PG;oB.prototype.setPlayerContextData=oB.prototype.IwX;oB.prototype.getOtherConnectedRemoteId=oB.prototype.IV;oB.prototype.getReconnectTimeout=oB.prototype.I2;oB.prototype.getAutoplayMode=oB.prototype.Z9;oB.prototype.getAutoplayVideoId=oB.prototype.Ye;oB.prototype.reconnect=oB.prototype.gb; oB.prototype.sendMessage=oB.prototype.vLr;oB.prototype.getXsrfToken=oB.prototype.Rm;oB.prototype.isCapabilitySupportedOnConnectedDevices=oB.prototype.l8;g.V(SDj,IB);g.H=SDj.prototype;g.H.Ha=function(K){return this.di.$_gs(K)}; g.H.contains=function(K){return!!this.di.$_c(K)}; g.H.get=function(K){return this.di.$_g(K)}; g.H.start=function(){this.di.$_st()}; g.H.add=function(K,W,U){this.di.$_a(K,W,U)}; g.H.remove=function(K,W,U){this.di.$_r(K,W,U)}; g.H.w3=function(K,W,U,h){this.di.$_un(K,W,U,h)}; g.H.QH=function(){for(var K=this.j.length,W=0;W1&&!this.D.getOption("remote","quickCast")?(this.sS=g.GG(K,this.j,this),this.Wa(g.CB(K,this.j)),K=this.D.getOption("remote","currentReceiver"),K=this.j(K),this.options[K]&&this.b$(K),this.enable(!0)):this.enable(!1)}; B0.prototype.j=function(K){return K.key}; B0.prototype.mZ=function(K){return K==="cast-selector-receiver"?"Cast...":this.sS[K].name}; B0.prototype.yv=function(K){g.It.prototype.yv.call(this,K);this.D.setOption("remote","currentReceiver",this.sS[K]);this.pg.z9()};g.V(waj,g.wP);g.H=waj.prototype; g.H.create=function(){var K=this.player.V(),W=g.EZ(K);K={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:K.L("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:K.L("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:K.L("enable_cast_short_lived_lounge_token")};CPW(W,K);this.subscriptions.push(g.BV("yt-remote-before-disconnect",this.kKX,this));this.subscriptions.push(g.BV("yt-remote-connection-change",this.q_x,this));this.subscriptions.push(g.BV("yt-remote-receiver-availability-change",this.F9, this));this.subscriptions.push(g.BV("yt-remote-auto-connect",this.z9x,this));this.subscriptions.push(g.BV("yt-remote-receiver-resumed",this.mbU,this));this.subscriptions.push(g.BV("mdx-privacy-popup-confirm",this.cO5,this));this.subscriptions.push(g.BV("mdx-privacy-popup-cancel",this.fpK,this));this.F9()}; g.H.load=function(){this.player.cancelPlayback();g.wP.prototype.load.call(this);this.zz=new qjN(this.player.V(),this);this.player.vJ(this.zz);this.gX=new mt3(this,this.player,this.fg);var K=(K=tS4())?K.currentTime:0;var W=t8N()?new es(S4(),void 0):null;K==0&&W&&(K=HU(h$(W)));K!==0&&this.Ym(K);TVN(this,this.RR,this.RR);this.player.ZC(6)}; g.H.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Xb();this.UO=this.bA;g.Pz(this.gX,this.fg);this.fg=this.zz=this.gX=null;g.wP.prototype.unload.call(this);this.player.ZC(5);Cs(this)}; g.H.QH=function(){g.Df(this.subscriptions);g.wP.prototype.QH.call(this)}; g.H.SJ=function(K){var W=g.Xl.apply(1,arguments);this.loaded&&this.gX.w_.apply(this.gX,[K].concat(g.z4(W)))}; g.H.getAdState=function(){return this.n_}; g.H.cM=function(){return this.fg?h$(this.fg).cM:!1}; g.H.zP=function(){return this.fg?h$(this.fg).zP:!1}; g.H.Ym=function(K,W){this.Wc=K||0;this.player.publish("progresssync",K,W);this.player.Ov("onVideoProgress",K||0)}; g.H.getCurrentTime=function(){return this.Wc}; g.H.getDuration=function(){return h$(this.fg).getDuration()||0}; g.H.hv=function(){var K=h$(this.fg);return K.W?K.j+kt(K):K.j}; g.H.V1=function(){return h$(this.fg).J}; g.H.Id=function(){return yCN(h$(this.fg))}; g.H.Ln=function(){var K=h$(this.fg);return K.X>0?K.X+kt(K):K.X}; g.H.getProgressState=function(){var K=h$(this.fg),W=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:K.playerState!=1081&&this.player.gS(),clipEnd:W.clipEnd,clipStart:W.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.hv(),isAtLiveHead:this.isAtLiveHead(),loaded:this.V1(),seekableEnd:this.Id(),seekableStart:this.Ln(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.H.isAtLiveHead=function(){return yCN(h$(this.fg))-this.getCurrentTime()<=1}; g.H.nextVideo=function(){this.fg&&this.fg.nextVideo()}; g.H.Lq=function(){this.fg&&this.fg.Lq()}; g.H.kKX=function(K){K===1&&(this.GW=this.fg?h$(this.fg):null)}; g.H.q_x=function(){var K=t8N()?new es(S4(),void 0):null;if(K){var W=this.UO;this.loaded&&this.unload();this.fg=K;this.GW=null;W.key!==this.bA.key&&(this.UO=W,this.load())}else g.vZ(this.fg),this.fg=null,this.loaded&&(this.unload(),(K=this.GW)&&K.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(K.videoId,HU(K)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.H.F9=function(){var K=[this.bA],W=K.concat,U=ag4();LK()&&g.SZ("yt-remote-cast-available")&&U.push({key:"cast-selector-receiver",name:"Cast..."});this.sS=W.call(K,U);K=kWH()||this.bA;Ss(this,K);this.player.Ov("onMdxReceiversChange")}; g.H.z9x=function(){var K=kWH();Ss(this,K)}; g.H.mbU=function(){this.UO=kWH()}; g.H.cO5=function(){this.Kd=!0;Cs(this);P9=!1;ps&&jM(ps,1);ps=null}; g.H.fpK=function(){this.Kd=!1;Cs(this);Ss(this,this.bA);this.UO=this.bA;P9=!1;ps=null;this.player.playVideo()}; g.H.yA=function(K,W){switch(K){case "casting":return this.loaded;case "receivers":return this.sS;case "currentReceiver":return W&&(W.key==="cast-selector-receiver"?pRZ():Ss(this,W)),this.loaded?this.UO:this.bA;case "quickCast":return this.sS.length===2&&this.sS[1].key==="cast-selector-receiver"?(W&&pRZ(),!0):!1}}; g.H.Qs=function(){this.fg.Qs()}; g.H.tZ=function(){return!1}; g.H.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.H.isLoggedIn=function(){var K,W;return((K=g.TA("PLAYER_CONFIG"))==null?void 0:(W=K.args)==null?void 0:W.authuser)!==void 0?!0:!(!g.TA("SESSION_INDEX")&&!g.TA("LOGGED_IN"))};g.Q5("remote",waj);})(_yt_player);