(function(g){var window=this;'use strict';var aes=function(z){z=g.V8(g.p3(z.Y,function(W){return W})); g.cb(z);z.length?g.CI("yt-remote-online-screen-ids",z.join(","),60):g.ov("yt-remote-online-screen-ids")},ZpR=function(z){z.yy||z.G3||(z.G3=K2((0,g.xo)(z.u0,z),0),z.o$=0)},oMs=function(z){var W=0,K; for(K in z)W++;return W},P0R=function(z){if(z instanceof g.K7)return z; if(typeof z.lE=="function")return z.lE(!1);if(g.cs(z)){var W=0,K=new g.K7;K.next=function(){for(;;){if(W>=z.length)return g.rc;if(W in z)return g.wM(z[W++]);W++}}; return K}throw Error("Not implemented");},FZ=function(){BH()?cH().stopSession():L2("stopSession called before API ready."); var z=i3();z&&(z.disconnect(1),OpG(null))},r3=function(z){this.Y=z},vM9=function(z,W,K,B){var c=new g.sF(null); z&&g.jq(c,z);W&&g.eR(c,W);K&&g.mN(c,K);B&&(c.U=B);return c},ACL=function(z,W){W.params=W.params||{}; le9(z,W,"NOW_PLAYING_MAY_CHANGE");nMQ(z,W);z.publish("autoplayDismissed")},xkR=function(z){g.qC(z.J); z.J=0;g.qC(z.Z);z.Z=0;g.qC(z.cX);z.cX=0;g.qC(z.K);z.K=0;g.qC(z.W);z.W=0},VR7=function(z){var W=z.U.X3(),K=z.Y&&z.Y.U; z=g.OQ(W,function(B){K&&XZ(B,K.label)&&(K=null);var c=B.uuid?B.uuid:B.id,L=$k_(this,B);L?(L.label=c,L.friendlyName=B.name):(L=new chrome.cast.Receiver(c,B.name),L.receiverType=chrome.cast.ReceiverType.CUSTOM);return L},z); K&&(K.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(K=new chrome.cast.Receiver(K.label,K.friendlyName),K.receiverType=chrome.cast.ReceiverType.CUSTOM),z.push(K));return z},SG=function(z,W){W=W===void 0?!1:W; QN.call(this,"ScreenService");this.L=z;this.W=W;this.Y=this.U=null;this.V=[];this.K={};pD7(this)},DX=function(z){if(z.size!=z.Y.length){for(var W=0,K=0;W1){var K=z-1;W.push("//www.gstatic.com/eureka/clank/"+z+"/cast_sender.js");W.push("//www.gstatic.com/eureka/clank/"+K+"/cast_sender.js")}return W},Wm9=function(z,W){var K=null; if(W){var B=GPH(z);B&&(K={clientName:B.clientName,deviceMake:B.brand,deviceModel:B.model,osVersion:B.osVersion})}g.DW("yt.mdx.remote.remoteClient_",K);W&&(wDG(z),zG0(z));K=z.U.lV()&&isNaN(z.Z);W==K?W&&(mD(z,1),qV(z,"getSubtitlesTrack")):W?(z.DS()&&z.Y.reset(),mD(z,1),qV(z,"getNowPlaying"),yCs(z)):z.yR(1)},BFR=function(){KmN(); var z=YFL();z.push("//www.gstatic.com/eureka/clank/cast_sender.js");UV(z)},cW7=function(z){return{name:z.name, screenId:z.id,loungeToken:z.token,dialId:z.uuid,screenIdType:z.idType,screenIdSecret:z.secret}},kq=function(z){C2("remote",z)},LmH=function(z,W){this.Y=z; this.map=W;this.context=null},Fm9=function(){var z=g.nV.sE(); z&&iG7(z,z.ZT.lE(!0))},jG=function(z){z=z||{}; this.name=z.name||"";this.id=z.id||z.screenId||"";this.token=z.token||z.loungeToken||"";this.uuid=z.uuid||z.dialId||"";this.idType=z.screenIdType||"normal";this.secret=z.screenIdSecret||""},KmN=function(){if(rW9){var z=2,W=Xu7(),K=function(){z--; z==0&&W&&W(!0)}; window.__onGCastApiAvailable=K;QmH("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",SJ0,K)}},ab=function(z){C2("conn",z)},IPj=function(z){g.j$.call(this,"statevent",z)},JWG=function(){var z=Df9(),W=ZX(); W||(W=ob());return g.Ap(z,function(K){return W&&XZ(W,K.key)?!0:!1})},PH=function(z,W,K){W!=z.Y&&(g.iP(z.Y),(z.Y=W)?(K?z.publish("yt-remote-cast2-receiver-resumed",W.U):z.publish("yt-remote-cast2-receiver-selected",W.U),W.subscribe("sessionScreen",(0,g.xo)(z.v1,z,W)),W.subscribe("sessionFailed",function(){return HGR(z,W)}),W.Y?z.publish("yt-remote-cast2-session-change",W.Y):K&&z.Y.kt(null)):z.publish("yt-remote-cast2-session-change",null))},hGQ=function(z,W){z.compatibleSenderThemes.clear(); g.z0(W.split(","),g.h_(smH,eGH)).forEach(function(K){z.compatibleSenderThemes.add(K)})},mf9=function(z,W,K,B){g.qC(z.Z); z.Z=0;TFn(z.L,W,function(c){c||B<0?K(c):z.Z=g.OT(function(){mf9(z,W,K,B-1)},300)})},qJj=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/channel/success")},CV0=function(z,W,K){z.ZY=1; z.W4=vH(W.clone());z.qR=K;z.dV=!0;Uf0(z,null)},smH=function(z,W){return g.Ip(z,W)},km7=function(){var z=i3(); return!!z&&z.getProxyState()!=3},jms=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/channel/error",g.e3("channel_type"),g.e3("error_type"))},AM=function(z){z||(g.ov("yt-remote-session-screen-id"),g.ov("yt-remote-session-video-id")); aPY();z=l3();g.lu(z,n2());ZG0(z)},xq=function(z){osY(z); g.iP(z.x6);z.x6=null;z.K.stop();z.V.removeAll();if(z.ys){var W=z.ys;z.ys=null;W.abort();W.dispose()}z.V9&&(z.V9=null)},$q=function(z){var W=PVQ(); W.dispatchEvent(new OGH(W,z))},vs7=function(){return g.v0("yt.mdx.remote.connectData_")},pD7=function(z){lPy(z); z.U=new VN(z.L);z.U.subscribe("screenChange",(0,g.xo)(z.XX4,z));ns_(z);z.W||(z.V=AWs(g.VO("yt-remote-automatic-screen-cache")||[]));lPy(z);z.info("Initializing automatic screens: "+xf9(z.V));z.Y=new $fY(z.L,(0,g.xo)(z.n0,z,!0));z.Y.subscribe("screenChange",(0,g.xo)(function(){this.publish("onlineScreenChange")},z))},VQ0=function(z,W){this.U=z; this.Y=W},pu7=function(z,W,K){var B=hM(z); p2(B,K);B.playerState!=-1E3&&(B.playerState=W);NV(z,B)},fPH=function(z,W){g.qC(z.K); z.K=0;var K=null;if(W)if(W.loungeToken){var B;((B=z.Y)==null?void 0:B.token)==W.loungeToken&&(K="staleLoungeToken")}else K="missingLoungeToken";else K="noLoungeTokenResponse";K?(z.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(W)+", error: "+K)),z.oC=K,NFL(z,3E4)):(bGy(z,W.loungeToken),z.RC=!1,z.oC="unknown",NFL(z,W.loungeTokenRefreshIntervalMs))},gs9=function(z){z.length>5&&(z=z.slice(z.length-5)); var W=g.OQ(Es0(),function(B){return B.loungeToken}),K=g.OQ(z,function(B){return B.loungeToken}); g.vb(K,function(B){return!g.ht(W,B)})&&dfj(); g.CI("yt-remote-local-screens",z,31536E3)},uTY=function(z,W,K){var B=new Image; B.onload=function(){try{b3(B),K(!0)}catch(c){}}; B.onerror=function(){try{b3(B),K(!1)}catch(c){}}; B.onabort=function(){try{b3(B),K(!1)}catch(c){}}; B.ontimeout=function(){try{b3(B),K(!1)}catch(c){}}; g.bI.setTimeout(function(){if(B.ontimeout)B.ontimeout()},W); B.src=z},n2=function(){if(yWH)return yWH; var z=g.VO("yt-remote-device-id");z||(z=RGL(),g.CI("yt-remote-device-id",z,31536E3));for(var W=l3(),K=1,B=z;g.ht(W,B);)K++,B=z+"#"+K;return yWH=B},MQQ=function(z,W){z.K=W.params.autoplayMode; z.publish("autoplayModeChange",z.K);z.K=="DISABLED"&&z.publish("autoplayDismissed")},lPy=function(z){z.K=g.VO("yt-remote-device-id-map")||{}},cAL=function(z,W){try{var K=z.V; if(K.rF!=0&&(K.Y==z||tQY(K.U,z)))if(!z.X4&&tQY(K.U,z)&&K.rF==3){try{var B=K.x7.Y.parse(W)}catch(C){B=null}if(Array.isArray(B)&&B.length==3){var c=B;if(c[0]==0)a:{if(!K.J){if(K.Y)if(K.Y.RC+3E30&&(K.GT=1.5*Q);B=K;var S=z.uj();if(S){var I=g.hV(S,"X-Client-Wire-Protocol");if(I){var D=B.U;!D.Y&&(g.Q7(I,"spdy")||g.Q7(I,"quic")||g.Q7(I,"h2"))&&(D.L=D.K,D.Y=new Set,D.U&&(wuH(D,D.U),D.U=null))}if(B.dV){var J=g.hV(S,"X-HTTP-Session-Id");J&&(B.Q8=J,g.gk(B.My,B.dV,J))}}K.rF=3;K.K&&K.K.wz();K.aM&&(K.m9=Date.now()-z.RC);B=K;var H=z;B.jH=ztH(B,B.X4?B.iI:null,B.Pl); if(H.X4){WQN(B.U,H);var e=H,q=B.GT;q&&e.setTimeout(q);e.cX&&(KQj(e),u3(e));B.Y=H}else BKy(B);K.V.length>0&&yN(K)}else L[0]!="stop"&&L[0]!="close"||g3(K,7);else K.rF==3&&(L[0]=="stop"||L[0]=="close"?L[0]=="stop"?g3(K,7):K.disconnect():L[0]!="noop"&&K.K&&K.K.OQ(L),K.Ur=0)}Rb(4)}catch(C){}},MV=function(z,W){z.fn&&(z=z.fn.EQ())&&g.DN(z,function(K,B){g.gk(W,B,K)})},tM=function(){},QN=function(z){g.r6.call(this); this.Z=z;this.screens=[]},Yq=function(z){C2("Controller",z)},Gy=function(z){g.n.call(this,{B:"div", T:"ytp-remote",N:[{B:"div",T:"ytp-remote-display-status",N:[{B:"div",T:"ytp-remote-display-status-icon",N:[g.V1u()]},{B:"div",T:"ytp-remote-display-status-text",rV:"{{statustext}}"}]}]});this.api=z;this.fade=new g.M9(this,250);g.T(this,this.fade);this.C(z,"presentingplayerstatechange",this.onStateChange);this.Cx(z.getPlayerStateObject())},w3=function(z,W){z.Y=W; z.publish("sessionScreen",z.Y)},zZ=function(z,W,K){Array.isArray(K)||(K=[String(K)]); g.iWT(z.L,W,K)},LQj=function(z,W,K,B){z.info("requestLoungeToken_ for "+W); var c={postParams:{screen_ids:W},method:"POST",context:z,onSuccess:function(L,F){L=F&&F.screens||[];L[0]&&L[0].screenId==W?K(L[0].loungeToken):B(Error("Missing lounge token in token response"))}, onError:function(){B(Error("Request screen lounge token failed"))}}; g.ky(Ty(z.L,"/pairing/get_lounge_token_batch"),c)},W5=function(z,W,K){var B=z.videoId; z.videoId=W;z.index=K;W!=B&&ioH(z)},FQ_=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/channel/message_received",g.e3("channel_type"))},RGL=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(z){var W=Math.random()*16|0; return(z=="x"?W:W&3|8).toString(16)})},KN=function(z,W){return g.Ap(z,function(K){return XZ(K,W)})},B5=function(z){z.Yr!=null&&(g.bI.clearTimeout(z.Yr),z.Yr=null)},tR_=function(){var z=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return z?parseInt(z[1],10):0},rA_=function(z){try{return g.bI.JSON.parse(z)}catch(W){}z=String(z); if(/^\s*$/.test(z)?0:/^[\],:{}\s\u2028\u2029]*$/.test(z.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("("+z+")")}catch(W){}throw Error("Invalid JSON string: "+z);},X1G=function(z){if(z.U!=null)return z.V.concat(z.U.Ur); if(z.Y!=null&&z.Y.size!==0){var W=z.V;z=g.l(z.Y.values());for(var K=z.next();!K.done;K=z.next())W=W.concat(K.value.Ur);return W}return g.wg(z.V)},BH=function(){return!!g.v0("yt.mdx.remote.cloudview.apiReady_")},QHs=function(z,W){var K=new tM,B=new AbortController,c=setTimeout(function(){B.abort(); c5(K,"TestPingServer: timeout",!1,W)},1E4); fetch(z,{signal:B.signal}).then(function(L){clearTimeout(c);L.ok?c5(K,"TestPingServer: ok",!0,W):c5(K,"TestPingServer: server error",!1,W)}).catch(function(){clearTimeout(c); c5(K,"TestPingServer: error",!1,W)})},SqH=function(z){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+z)!=-1||document.currentScript.src.indexOf("&"+z)!=-1)},LN=function(z,W){g.oM.call(this); this.Y=new IWN(W);this.K=z;this.U=W&&W.GAf||null;z=W&&W.vmz||null;W&&W.zYz&&(z?z["X-Client-Protocol"]="webchannel":z={"X-Client-Protocol":"webchannel"});this.Y.oC=z;z=W&&W.fTt||null;W&&W.Pm&&(z?z["X-WebChannel-Content-Type"]=W.Pm:z={"X-WebChannel-Content-Type":W.Pm});W&&W.uX&&(z?z["X-WebChannel-Client-Profile"]=W.uX:z={"X-WebChannel-Client-Profile":W.uX});this.Y.Ac=z;(z=W&&W.r0a)&&!g.U1(z)&&(this.Y.W=z);this.Z=W&&W.QNC||!1;this.L=W&&W.rkH||!1;(W=W&&W.NVL)&&!g.U1(W)&&(this.Y.dV=W,g.bo(this.U,W)&&(z= this.U,W in z&&delete z[W]));this.V=new r3(this)},Ib=function(z,W){return Object.prototype.hasOwnProperty.call(z,W)},$k_=function(z,W){return W?g.Ap(z.V,function(K){return XZ(W,K.label)},z):null},DIN=function(z){this.K=z||10; g.bI.PerformanceNavigationTiming?(z=g.bI.performance.getEntriesByType("navigation"),z=z.length>0&&(z[0].nextHopProtocol=="hq"||z[0].nextHopProtocol=="h2")):z=!!(g.bI.chrome&&g.bI.chrome.loadTimes&&g.bI.chrome.loadTimes()&&g.bI.chrome.loadTimes().wasFetchedViaSpdy);this.L=z?this.K:1;this.Y=null;this.L>1&&(this.Y=new Set);this.U=null;this.V=[]},JAQ=function(){},yN=function(z){Ho9(z.U)||z.Z||(z.Z=!0,g.jg(z.L9,z),z.RC=0)},sHs=function(z,W){var K=W.params.muted=="true"; z.Y.volume=parseInt(W.params.volume,10);z.Y.muted=K;z.publish("remotePlayerChange")},htY=function(){etj(); return ij?!!ij.get("yt-remote-use-staging-server"):!1},mI_=function(z){TKQ(z,"getLoungeToken"); g.qC(z.K);z.K=g.OT(function(){fPH(z,null)},3E4)},le9=function(z,W,K){var B=W.params.videoId||W.params.video_id,c=parseInt(W.params.currentIndex,10); z.Y.listId=W.params.listId||z.Y.listId;W5(z.Y,B,c);z.publish("remoteQueueChange",K)},qq0=function(z){g.DW("yt.mdx.remote.currentScreenId_",z)},UI0=function(z,W,K){if(g.cs(z))g.Mt(z,W,K); else for(z=P0R(z);;){var B=z.next();if(B.done)break;W.call(K,B.value,void 0,z)}},Es0=function(){return g.VO("yt-remote-local-screens")||[]},Fk=function(z,W){g.r6.call(this); this.config_=W;this.U=z;this.J=W.appId||"233637DE";this.L=W.theme||"cl";this.oC=W.disableCastApi||!1;this.Z=W.forceMirroring||!1;this.Y=null;this.W=!1;this.V=[];this.K=(0,g.xo)(this.wia,this)},Zos=function(z,W){C9H(!0); kT_(!1);dkR(z,function(K){K?(jHY(!0),g.ul("yt-remote-cast2-api-ready")):(L2("Failed to initialize cast API."),C9H(!1),g.ov("yt-remote-cast-available"),g.ov("yt-remote-cast-receiver"),aWn());W(K)})},rf=function(z,W){g.VQ[z]=!0; var K=g.El();K&&K.publish.apply(K,arguments);g.VQ[z]=!1},OV=function(){if(!Xk){Xk=new g.Kn(new JAQ); var z=g.Tn("client_streamz_web_flush_count",-1);z!==-1&&(Xk.V=z)}return Xk},oF0=function(z){g.Sl.call(this,z); this.Is={key:RGL(),name:"Esta computadora"};this.cH=null;this.subscriptions=[];this.wj=this.cz=null;this.iB=[this.Is];this.HM=this.Is;this.DA=new g.eT(64);this.Rd=0;this.Kn=-1;this.E5=!1;this.gF=this.HE=this.BI=null;if(!g.y2(this.player.D())&&!g.LC(this.player.D())){z=this.player;var W=g.wh(z);W&&(W=W.tL())&&(W=new Qy(z,W),g.T(this,W));W=new Gy(z);g.T(this,W);g.ZN(z,W.element,4);this.BI=new S5;g.T(this,this.BI);g.ZN(z,this.BI.element,4);this.E5=!!ob()}},d3=function(z,W){if(typeof z!=="function")throw Error("Fn must not be null and must be a function"); return g.bI.setTimeout(function(){z()},W)},If=function(){},HGR=function(z,W){z.Y==W&&z.publish("yt-remote-cast2-session-failed")},P9L=function(){},EV=function(z){z.Y&&(Ooy(z),z.Y.cancel(),z.Y=null)},Vo9=function(z,W){etj(); if(!ij||!ij.get("yt-remote-disable-remote-module-for-dev")){W=g.Jt("MDX_CONFIG")||W;Fm9();aPY();Dv||(Dv=new JL(W?W.loungeApiHost:void 0),htY()&&(Dv.Y="/api/loungedev"));H5||(H5=g.v0("yt.mdx.remote.deferredProxies_")||[],g.DW("yt.mdx.remote.deferredProxies_",H5));vFH();var K=se();if(!K){var B=new SG(Dv,W?W.disableAutomaticScreenCache||!1:!1);g.DW("yt.mdx.remote.screenService_",B);K=se();var c={};W&&(c={appId:W.appId,disableDial:W.disableDial,theme:W.theme,loadCastApiSetupScript:W.loadCastApiSetupScript, disableCastApi:W.disableCastApi,enableDialLoungeToken:W.enableDialLoungeToken,enableCastLoungeToken:W.enableCastLoungeToken,forceMirroring:W.forceMirroring});g.DW("yt.mdx.remote.enableConnectWithInitialState_",W?W.enableConnectWithInitialState||!1:!1);lWR(z,B,function(L){L?e5()&&hL(e5(),"YouTube TV"):B.subscribe("onlineScreenChange",function(){rf("yt-remote-receiver-availability-change")})},c)}W&&!g.v0("yt.mdx.remote.initialized_")&&(g.DW("yt.mdx.remote.initialized_",!0),kq("Initializing: "+g.Ik(W)), TZ.push(g.dv("yt-remote-cast2-api-ready",function(){rf("yt-remote-api-ready")})),TZ.push(g.dv("yt-remote-cast2-availability-change",function(){rf("yt-remote-receiver-availability-change")})),TZ.push(g.dv("yt-remote-cast2-receiver-selected",function(){ma(null); rf("yt-remote-auto-connect","cast-selector-receiver")})),TZ.push(g.dv("yt-remote-cast2-receiver-resumed",function(){rf("yt-remote-receiver-resumed","cast-selector-receiver")})),TZ.push(g.dv("yt-remote-cast2-session-change",nF9)),TZ.push(g.dv("yt-remote-connection-change",function(L){L?hL(e5(),"YouTube TV"):ob()||(hL(null,null),AA9())})),TZ.push(g.dv("yt-remote-cast2-session-failed",function(){rf("yt-remote-connection-failed")})),z=xI0(),W.isAuto&&(z.id+="#dial"),c=W.capabilities||[],c.length>0&&(z.capabilities= c),z.name=W.device,z.app=W.app,(W=W.theme)&&(z.theme=W),kq(" -- with channel params: "+g.Ik(z)),z?(g.CI("yt-remote-session-app",z.app),g.CI("yt-remote-session-name",z.name)):(g.ov("yt-remote-session-app"),g.ov("yt-remote-session-name")),g.DW("yt.mdx.remote.channelParams_",z),K.start(),e5()||$IH())}},p1G=function(z,W){return g.Ap(z,function(K){return K||W?!K!=!W?!1:K.id==W.id:!0})},Ue=function(z,W){g.r6.call(this); var K=this;this.V=0;this.L=z;this.Z=[];this.K=new NKH;this.U=this.Y=null;this.oC=(0,g.xo)(this.Xz4,this);this.W=(0,g.xo)(this.ip,this);this.J=(0,g.xo)(this.EO4,this);this.cX=(0,g.xo)(this.x6r,this);var B=0;z?(B=z.getProxyState(),B!=3&&(z.subscribe("proxyStateChange",this.ud,this),bos(this))):B=3;B!=0&&(W?this.ud(B):g.OT(function(){K.ud(B)},0)); (z=fe_())&&q7(this,z);this.subscribe("yt-remote-cast2-session-change",this.cX)},GPH=function(z){return g.Ap(z.V,function(W){return W.type=="LOUNGE_SCREEN"})},f2=function(z){z.cX!=null&&(g.bI.clearTimeout(z.cX),z.cX=null)},af=function(z,W){e5(); ZX()&&ZX();if(CN)kJ=z;else{qq0(z.id);var K=g.v0("yt.mdx.remote.enableConnectWithInitialState_")||!1;z=new j5(Dv,z,xI0(),K);z.connect(W,vs7());z.subscribe("beforeDisconnect",function(B){rf("yt-remote-before-disconnect",B)}); z.subscribe("beforeDispose",function(){i3()&&(i3(),OpG(null))}); z.subscribe("browserChannelAuthError",function(){var B=ZX();B&&B.idType=="shortLived"&&(BH()?cH().handleBrowserChannelAuthError():L2("refreshLoungeToken called before API ready."))}); OpG(z)}},YJ_=function(z){if(z.Y||z.J||z.Ur>=3)return!1; z.Hl++;z.J=d3((0,g.xo)(z.Vw,z),fWH(z,z.Ur));z.Ur++;return!0},EF_=function(z,W){this.Y=z; this.map=W;this.context=null},dIH=function(z){g.j$.call(this,"serverreachability",z)},unL=function(z){if(z.ix||z.fR||z.qG>=3)return!1; z.W++;z.fR=K2((0,g.xo)(z.K9,z),gFN(z,z.qG));z.qG++;return!0},MoH=function(z,W){if(z.Y==1){if(!W){z.Db=Math.floor(Math.random()*1E5); W=z.Db++;var K=new Zv(z,"",W);K.Gk=z.GZ;var B=yAN(z),c=z.Cl.clone();g.gk(c,"RID",W);g.gk(c,"CVER","1");MV(z,c);CV0(K,c,B);z.yy=K;z.Y=2}}else z.Y==3&&(W?Rts(z,W):z.U.length==0||z.yy||Rts(z))},of=function(z,W,K){return K&&K.lPC?K.lPC[z]||W:W},to0=function(z){g.qC(z.Ur); z.Ur=NaN},iG7=function(z,W){Yq7(z,W).forEach(function(K){g.U8.prototype.remove.call(this,K)},z)},w19=function(z,W){z.capabilities.clear(); g.z0(W.split(","),g.h_(smH,GT9)).forEach(function(K){z.capabilities.add(K)})},Yq7=function(z,W){var K=[]; UI0(W,function(B){try{var c=g.U8.prototype.r0.call(this,B,!0)}catch(L){if(L=="Storage: Invalid value was encountered")return;throw L;}c===void 0?K.push(B):g.pyz(c)&&K.push(B)},z); return K},ma=function(z){g.DW("yt.mdx.remote.connectData_",z)},zL0=function(z){if(z.Uh){if(z.Uh.locationOverrideToken)return{locationOverrideToken:z.Uh.locationOverrideToken}; if(z.Uh.latitudeE7!=null&&z.Uh.longitudeE7!=null)return{latitudeE7:z.Uh.latitudeE7,longitudeE7:z.Uh.longitudeE7}}return null},WZH=function(z){g.Mt(z.Z,function(W){this.L.unsubscribeByKey(W)},z); z.Z.length=0},KQj=function(z){z.cX&&(g.bI.clearTimeout(z.cX),z.cX=null)},KZQ=function(){this.Y=new If},P5=function(z){return z.getState()==1},B07=function(z,W){var K=!1; cH()||(z=new Fk(z,W),z.subscribe("yt-remote-cast2-availability-change",function(B){g.CI("yt-remote-cast-available",B);rf("yt-remote-cast2-availability-change",B)}),z.subscribe("yt-remote-cast2-receiver-selected",function(B){Oe("onReceiverSelected: "+B.friendlyName); g.CI("yt-remote-cast-receiver",B);rf("yt-remote-cast2-receiver-selected",B)}),z.subscribe("yt-remote-cast2-receiver-resumed",function(B){Oe("onReceiverResumed: "+B.friendlyName); g.CI("yt-remote-cast-receiver",B);rf("yt-remote-cast2-receiver-resumed",B)}),z.subscribe("yt-remote-cast2-session-change",function(B){Oe("onSessionChange: "+HH(B)); B||g.ov("yt-remote-cast-receiver");rf("yt-remote-cast2-session-change",B)}),g.DW("yt.mdx.remote.cloudview.instance_",z),K=!0); Oe("cloudview.createSingleton_: "+K);return K},cVn=function(z,W){if(z.Y==0)throw Error("Invalid operation: sending map when state is closed"); z.U.push(new EF_(z.yj++,W));z.Y!=2&&z.Y!=3||ZpR(z)},LZ_=function(z,W){var K=W.params.videoId; delete W.params.videoId;K==z.Y.videoId&&(g.zz(W.params)?z.Y.trackData=null:z.Y.trackData=W.params,z.publish("remotePlayerChange"))},etj=function(){if(!ij){var z=g.qh(); z&&(ij=new g.$z(z))}},kT_=function(z){g.DW("yt.mdx.remote.cloudview.initializing_",z)},i6s=function(z){var W=z.RC(); W?z.L["x-youtube-lounge-xsrf-token"]=W:delete z.L["x-youtube-lounge-xsrf-token"]},UV=function(z){z.length?QmH(z.shift(),function(){UV(z)}):SJ0()},v5=function(z){return z.W||!!z.V.length||!!z.Y},Df9=function(){var z=se().AZ.$_gos(); var W=ZX();W&&i3()&&(p1G(z,W)||z.push(W));return bpH(z)},FZN=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/channel/opened",g.e3("channel_type"))},C2=function(z,W){rVQ(); var K=X39(z,String(W));lj.length==0?Qc_(K):(S_0(),g.Mt(lj,function(B){B(K)}))},JVQ=function(z,W,K){g.d.call(this); var B=this;this.Y=z;this.S=W;this.cz=K;this.events=new g.eu(this);this.K=!1;this.Z=new g.eT(64);this.U=new g.$k(this.xC,500,this);this.V=new g.$k(this.y5,1E3,this);this.J=new nN(this.FXa,0,this);this.L={};this.oC=new g.$k(this.TI,1E3,this);this.W=new g.yl(this.seekTo,1E3,this);this.cX=this.events.C(this.S,"onVolumeChange",function(c){IHY(B,c)}); g.T(this,this.events);this.events.C(W,"onCaptionsTrackListChanged",this.RKr);this.events.C(W,"captionschanged",this.bxf);this.events.C(W,"captionssettingschanged",this.Py);this.events.C(W,"videoplayerreset",this.j0);this.events.C(W,"mdxautoplaycancel",function(){B.cz.Nf()}); W.X("enable_mdx_video_play_directly")&&this.events.C(W,"videodatachange",function(){D4Y(B.Y)||eG(B)||AL(B,0)}); z=this.cz;z.Kt();z.subscribe("proxyStateChange",this.DX,this);z.subscribe("remotePlayerChange",this.Qd,this);z.subscribe("remoteQueueChange",this.j0,this);z.subscribe("previousNextChange",this.tU,this);z.subscribe("nowAutoplaying",this.xf,this);z.subscribe("autoplayDismissed",this.mQ,this);g.T(this,this.U);g.T(this,this.V);g.T(this,this.J);g.T(this,this.oC);g.T(this,this.W);this.Py();this.j0();this.Qd()},H6R=function(z){g.qC(z.Z); z.Z=0;g.qC(z.W);z.W=0;z.K();z.K=function(){}; g.qC(z.oC)},zG0=function(z){g.qC(z.RC); z.RC=NaN},sc7=function(){return g.VO("yt-remote-session-browser-channel")},NKH=function(){this.Y=[]; this.U=[]},xJ=function(z,W){var K=z.K; K.Y.length+K.U.length<50&&z.K.enqueue(W)},$J=function(z,W,K){g.r6.call(this); this.dV=K;this.L=z;this.U=W;this.Y=null},eLs=function(z){var W={}; W.index=z.index;W.listId=z.listId;W.videoId=z.videoId;W.playerState=z.playerState;W.volume=z.volume;W.muted=z.muted;W.audioTrackId=z.audioTrackId;W.trackData=g.U6(z.trackData);W.hasPrevious=z.QK;W.hasNext=z.K0;W.playerTime=z.Z;W.playerTimeAt=z.K;W.seekableStart=z.U;W.seekableEnd=z.W;W.duration=z.V;W.loadedTime=z.J;W.liveIngestionTime=z.Y;return W},hL0=function(z){z.uo&&(z.uo.abort(),z.uo=null); z.ix&&(z.ix.cancel(),z.ix=null);z.fR&&(g.bI.clearTimeout(z.fR),z.fR=null);B5(z);z.yy&&(z.yy.cancel(),z.yy=null);z.G3&&(g.bI.clearTimeout(z.G3),z.G3=null)},Vy=function(z){var W; return!!(z.config_.enableDialLoungeToken&&((W=z.V)==null?0:W.getDialAppInfo))},osY=function(z){z.GH&&(g.bI.clearTimeout(z.GH),z.GH=null)},N7=function(z){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 pN;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";z&&(this.id=z.id||z.name,this.name=z.name,this.clientName=z.clientName?z.clientName.toUpperCase():"UNKNOWN_INTERFACE", this.app=z.app,this.type=z.type||"REMOTE_CONTROL",this.username=z.user||"",this.avatar=z.userAvatarUri||"",this.obfuscatedGaiaId=z.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=z.ownerObfuscatedGaiaId||"",this.theme=z.theme||"u",w19(this,z.capabilities||""),hGQ(this,z.compatibleSenderThemes||""),T0L(this,z.experiments||""),this.brand=z.brand||"",this.model=z.model||"",this.year=z.year||0,this.os=z.os||"",this.osVersion=z.osVersion||"",this.chipset=z.chipset||"",this.mdxDialServerType=z.mdxDialServerType|| "MDX_DIAL_SERVER_TYPE_UNKNOWN",z=z.deviceInfo)&&(z=JSON.parse(z),this.brand=z.brand||"",this.model=z.model||"",this.year=z.year||0,this.os=z.os||"",this.osVersion=z.osVersion||"",this.chipset=z.chipset||"",this.clientName=z.clientName?z.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=z.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},bj=function(z){isNaN(z.V)||g.qC(z.V); z.V=g.OT((0,g.xo)(z.JS,z),z.L>0&&z.LW.length)return CkH;W=W.slice(B,B+K);z.W=B+K;return W},aHL=function(z,W){g.oM.call(this); var K=this;this.handler=z();this.handler.subscribe("handlerOpened",this.kE,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(B,c){K.onError(c)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.Y=W},Z67=function(z,W,K,B){g.qC(z.Z); z.Z=0;TFn(z.L,W,function(c){c||B<0?K(c):z.Z=g.OT(function(){Z67(z,W,K,B-1)},300)})},od0=function(z){return"chrome-extension://"+z+"/cast_sender.js"},nMQ=function(z,W){var K=parseInt(W.params.currentTime||W.params.current_time,10); p2(z.Y,isNaN(K)?0:K);K=parseInt(W.params.state,10);K=isNaN(K)?-1:K;K==-1&&z.Y.playerState==-1E3&&(K=-1E3);z.Y.playerState=K;K=Number(W.params.loadedTime);z.Y.J=isNaN(K)?0:K;z.Y.CB(Number(W.params.duration));K=z.Y;var B=Number(W.params.liveIngestionTime);K.Y=B;K.L=isNaN(B)?!1:!0;K=z.Y;B=Number(W.params.seekableStartTime);W=Number(W.params.seekableEndTime);K.U=isNaN(B)?0:B;K.W=isNaN(W)?0:W;z.Y.playerState==1?Pky(z):to0(z);z.publish("remotePlayerChange")},O6H=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},T0L=function(z,W){z.experiments.clear(); W.split(",").forEach(function(K){z.experiments.add(K)})},fN=function(z,W,K){$J.call(this,z,W,"CastSession"); var B=this;this.config_=K;this.V=null;this.Ur=(0,g.xo)(this.jJ,this);this.wV=(0,g.xo)(this.mg4,this);this.cX=g.OT(function(){vd_(B,null)},12E4); this.W=this.K=this.Z=this.J=0;this.RC=!1;this.oC="unknown"},ioH=function(z){z.audioTrackId=null; z.trackData=null;z.playerState=-1;z.QK=!1;z.K0=!1;z.Z=0;z.K=g.ZE();z.U=0;z.W=0;z.V=0;z.J=0;z.Y=NaN;z.L=!1},ndH=function(z,W){z.RC=Date.now(); u3(z);z.WX=z.J.clone();zZ(z.WX,"t",z.Hl);z.W=0;var K=z.V.X4;z.U=new lHs;z.Y=RyY(z.V,K?W:null,!z.oC);z.GT>0&&(z.TT=new g.yl((0,g.xo)(z.Rt,z,z.Y),z.GT));z.Uh.listen(z.Y,"readystatechange",z.bN);W=z.My?g.eW(z.My):{};z.oC?(z.wV||(z.wV="POST"),W["Content-Type"]="application/x-www-form-urlencoded",z.Y.send(z.WX,z.wV,z.oC,W)):(z.wV="GET",z.Y.send(z.WX,z.wV,null,W));Rb(1)},yAN=function(z){var W=Math.min(z.U.length,1E3),K=["count="+W]; if(z.l7>6&&W>0){var B=z.U[0].Y;K.push("ofs="+B)}else B=0;for(var c={},L=0;LW.length)return iIR;W=W.slice(B,B+K);z.Tg=B+K;return W},XNY=function(z,W){var K=z.get(W.uuid)||z.get(W.id); if(K)return z=K.name,K.id=W.id||K.id,K.name=W.name,K.token=W.token,K.uuid=W.uuid||K.uuid,K.name!=z;z.screens.push(W);return!0},j5=function(z,W,K,B){B=B===void 0?!1:B; g.r6.call(this);var c=this;this.Z=NaN;this.wV=!1;this.oC=this.J=this.Ur=this.RC=NaN;this.cX=[];this.K=this.W=this.L=this.Y=this.U=null;this.My=z;this.gV=B;this.cX.push(g.ji(window,"beforeunload",function(){c.yR(2)})); this.V=[];this.Y=new uj;this.SC=W.id;this.dV=W.idType;this.U=QVs(this.My,K,this.T6,this.dV=="shortLived",this.SC);this.U.listen("channelOpened",function(){S9_(c)}); this.U.listen("channelClosed",function(){ab("Channel closed");isNaN(c.Z)?AM(!0):AM();c.dispose()}); this.U.listen("channelError",function(L){AM();isNaN(c.TK())?(L==1&&c.dV=="shortLived"&&c.publish("browserChannelAuthError",L),ab("Channel error: "+L+" without reconnection"),c.dispose()):(c.wV=!0,ab("Channel error: "+L+" with reconnection in "+c.TK()+" ms"),mD(c,2))}); this.U.listen("channelMessage",function(L){I_Q(c,L)}); this.U.Xu(W.token);this.subscribe("remoteQueueChange",function(){var L=c.Y.videoId;g.K0()&&g.CI("yt-remote-session-video-id",L)})},DyY=function(z,W){W?(z.info("onConnectedScreenId_: Received screenId: "+W),z.Y&&z.Y.id==W||z.qm(W,function(K){w3(z,K)},function(){return z.le()},5)):z.le(Error("Waiting for session status timed out."))},xI0=function(){return g.v0("yt.mdx.remote.channelParams_")||{}},Jv0=function(z,W,K){z.SC=1; z.J=vH(W.clone());z.oC=K;z.dV=!0;ndH(z,null)},HI9=function(z,W){if(z.Y){var K=z.Y.GZ||{}; W&&Object.keys(W).length>0?K=Object.assign({},K,W):delete K.Authorization;z.Y.GZ=K}},wf=function(z,W){$J.call(this,z,W,"ManualSession"); this.V=g.OT((0,g.xo)(this.kt,this,null),150)},sV0=function(z,W,K){for(var B=0;B=0; return g.AD||z},SJ0=function(){var z=Xu7(); z&&z(!1,"No cast extension found")},b60=function(z,W,K,B,c){if(B==0)K(!1); else{var L=c||0;B--;uTY(z,W,function(F){F?K(!0):g.bI.setTimeout(function(){b60(z,W,K,B,L)},L)})}},T$_=function(z,W){if(Gm7(z.U)>=z.U.L-(z.Z?1:0))return!1; if(z.Z)return z.V=W.Ur.concat(z.V),!0;if(z.rF==1||z.rF==2||z.RC>=(z.Mh?0:z.o6))return!1;z.Z=d3((0,g.xo)(z.L9,z,W),fWH(z,z.RC));z.RC++;return!0},myH=function(z,W){var K=W.params.hasNext=="true"; z.Y.QK=W.params.hasPrevious=="true";z.Y.K0=K;z.publish("previousNextChange")},q9N=function(z,W){var K=z.screens.length; z.screens=g.z0(z.screens,function(B){return!(B||W?!B!=!W?0:B.id==W.id:1)}); return z.screens.length0&&(this.Wz=z.sH);this.QB=void 0;this.m9=0;this.Ny=!1;this.Bl=this.wV=null},CZs=function(z){Uy_.call(this); z.__headers__&&(this.headers=z.__headers__,this.statusCode=z.__status__,delete z.__headers__,delete z.__status__);var W=z.__sm__;W?this.data=(this.Y=g.ZY(W))?g.d1(W,this.Y):W:this.data=z},jVN=function(z){var W=z.Y.Z; W!=null?(BZ(5),W?(BZ(11),JM(z.Y,z,!1)):(BZ(12),JM(z.Y,z,!0))):(z.VC=new Zv(z),z.VC.Gk=z.O7,W=z.Y,W=M7(W,W.j_()?z.WZ:null,z.IE),BZ(5),zZ(W,"TYPE","xmlhttp"),kg_(z.VC,W,!1,z.WZ,!1))},w3G=function(z){z.rF=0; z.Bl=[];if(z.K){var W=X1G(z.U);if(W.length!=0||z.V.length!=0)g.iG(z.Bl,W),g.iG(z.Bl,z.V),z.U.V.length=0,g.wg(z.V),z.V.length=0;z.K.Aa()}},a_7=function(z,W){a:if(oMs(W)!=oMs(z.Y))var K=!1; else{K=g.V8(W);for(var B=K.length,c=0;c=z.L:!1},f_H=function(z){z.My&&!z.K&&HI9(z,z.My())},Uy_=function(){g.j$.call(this,"p")},u5R=function(z){this.Y=z; this.U=new If},cZ=function(z,W){z.info("getDialAppInfoWithTimeout_ "+W); Vy(z)&&(g.qC(z.W),z.W=0,W==0?yv9(z):z.W=g.OT(function(){yv9(z)},W))},ZG0=function(z){g.CI("yt-remote-connected-devices",z,86400)},Ooy=function(z){z.wV!=null&&(g.bI.clearTimeout(z.wV),z.wV=null)},RN_=function(z){z.K=z.L.sQ(z.wV,z.U.label,z.U.friendlyName,Vy(z),function(W,K){z.K=function(){}; z.Ur=!0;w3(z,W);W.idType=="shortLived"&&K>0&&cZ(z,K)},function(W){z.K=function(){}; z.le(W)})},bIL=function(z,W){z.Y=0; z.fn&&z.fn.gz(W);q_j(z);hL0(z)},dfj=function(){g.CI("yt-remote-lounge-token-expiration",!0,86400)},MyH=function(z){g.j$.call(this,"channelError"); this.error=z},Nk9=function(z){z.xE(1,0); z.Cl=M7(z,null,z.nI);ZpR(z)},$fY=function(z,W){g.r6.call(this); this.Z=W;W=(W=g.VO("yt-remote-online-screen-ids")||"")?W.split(","):[];for(var K={},B=this.Z(),c=B.length,L=0;L0?(L=c[0].Y,F.push("ofs="+L)):L=0:F.push("ofs="+L);for(var X=!0,Q=0;Q1){if(K%2)throw Error("Uneven number of arguments");for(var B=0;B=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?tR_()>=60&&BFR():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?SJ0():tR_()>=89?Xa9():(KmN(),UV(Qrs.map(od0))))):Oe("Cannot initialize because not running Chrome")}, hM=function(z){return new uj(z.L.getPlayerContextData())},SRR=function(z,W){z.W=W.params.videoId; z.publish("nowAutoplaying",parseInt(W.params.timeout,10))},GgH=function(z){var W={}; W.pairingCode=z.wV;W.theme=z.SC;htY()&&(W.env_useStageMdx=1);return g.pe(W)},gFN=function(z,W){var K=5E3+Math.floor(Math.random()*1E4); z.isActive()||(K*=2);return K*W},BKy=function(z){z.Y||z.J||(z.Hl=1,g.jg(z.Vw,z),z.Ur=0)},q7=function(z,W){z.U&&(z.U.removeUpdateListener(z.oC),z.U.removeMediaListener(z.W),z.ip(null)); z.U=W;z.U&&(Dd("Setting cast session: "+z.U.sessionId),z.U.addUpdateListener(z.oC),z.U.addMediaListener(z.W),z.U.media.length&&z.ip(z.U.media[0]))},I20=function(z,W){z.W=W.params.videoId||null; z.publish("autoplayUpNext",z.W)},De_=function(z,W,K){var B=this; K=K===void 0?function(){return""}:K; var c=c===void 0?new x47:c;var L=L===void 0?new g.t5:L;this.pathPrefix=z;this.Y=W;this.RC=K;this.K=L;this.J=null;this.oC=this.W=0;this.channel=null;this.Z=0;this.V=new IZ(function(){B.V.isActive();var F;((F=B.channel)==null?void 0:Gm7((new VQ0(F,F.Y)).Y.U))===0&&B.connect(B.J,B.W)}); this.L={};this.U={};this.cX=!1;this.logger=null;this.Ur=[];this.Hs=void 0;this.My=new FZN;this.wV=new tyj;this.gV=new FQ_;this.dV=new jms},l3=function(){var z=g.VO("yt-remote-connected-devices")||[]; g.cb(z);return z},Jd_=function(z){var W=z.Y.media,K=z.Y.customData; if(W&&K){var B=hM(z);W.contentId!=B.videoId&&Dd("Cast changing video to: "+W.contentId);B.videoId=W.contentId;B.playerState=K.playerState;p2(B,z.Y.getEstimatedTime());NV(z,B)}else Dd("No cast media video. Ignoring state update.")},Oe=function(z){C2("cloudview",z)},HWR=function(z){g.oM.call(this); this.Y=z();this.Y.subscribe("webChannelOpened",this.Ti,this);this.Y.subscribe("webChannelClosed",this.onClosed,this);this.Y.subscribe("webChannelError",this.onError,this);this.Y.subscribe("webChannelMessage",this.onMessage,this)},JL=function(z){this.scheme="https"; this.port=this.domain="";this.Y="/api/lounge";this.U=!0;z=z||document.location.href;var W=Number(g.kh(z)[4]||null)||"";W&&(this.port=":"+W);this.domain=g.OD(z)||"";z=g.SL();z.search("MSIE")>=0&&(z=z.match(/MSIE ([\d.]+)/)[1],g.oG(z,"10.0")<0&&(this.U=!1))},sV=function(){return!!g.VO("yt-remote-cast-installed")},Rts=function(z,W){if(W)if(z.l7>6){z.U=z.V.concat(z.U); z.V.length=0;var K=z.Db-1;W=yAN(z)}else K=W.W,W=W.qR;else K=z.Db++,W=yAN(z);var B=z.Cl.clone();g.gk(B,"SID",z.L);g.gk(B,"RID",K);g.gk(B,"AID",z.lA);MV(z,B);K=new Zv(z,z.L,K,z.o$+1);K.Gk=z.GZ;K.setTimeout(1E4+Math.round(1E4*Math.random()));z.yy=K;CV0(K,B,W)},NV=function(z,W){WZH(z); z.L.setPlayerContextData(eLs(W));bos(z)},srj=function(z){z.ix||z.fR||(z.W=1,z.fR=K2((0,g.xo)(z.K9,z),0),z.qG=0)},bos=function(z){g.Mt("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(W){this.Z.push(this.L.subscribe(W,g.h_(this.dhX,W),this))},z)},e5y=function(z,W,K,B){g.j$.call(this,"timingevent",z); this.size=W;this.rtt=K;this.retries=B},Rf=function(z,W){z.gV&&g.DN(z.gV,function(K,B){g.gk(W,B,K)}); z.K&&g.DN({},function(K,B){g.gk(W,B,K)})},h57=function(z){var W,K; g.b(function(B){if(B.Y==1)return g.EF(B,2),g.E(B,Kdj(z),2);g.vL(B);W=z.V;z.V=[];K=W.length;sV0(z,W,K);df(z);return g.ly(B,0)})},AL=function(z,W){var K=z.S.getPlaylist(); if(K==null?0:K.listId){var B=K.index;var c=K.listId.toString()}K=z.S.getVideoData(1);z.cz.playVideo(K.videoId,W,B,c,K.playerParams,K.cX,zL0(K));z.VD(new g.eT(1))},Jy=function(z,W){if(W.key!==z.HM.key)if(W.key===z.Is.key)FZ(); else if(D4Y(z)&&uM0(z),z.HM=W,!g.LC(z.player.D())){var K=z.player.getPlaylistId();var B=z.player.getVideoData(1);var c=B.videoId;if(!K&&!c||(z.player.getAppState()===2||z.player.getAppState()===1)&&z.player.D().X("should_clear_video_data_on_player_cued_unstarted"))B=null;else{var L=z.player.getPlaylist();if(L){var F=[];for(var X=0;X0&&(z.x6=new g.yl((0,g.xo)(z.It,z,z.ys),z.ek));z.V.listen(z.ys,"readystatechange",z.sR);W=z.Gk?g.eW(z.Gk):{};z.qR?(z.k6="POST",W["Content-Type"]="application/x-www-form-urlencoded",z.ys.send(z.yM,z.k6,z.qR,W)):(z.k6="GET",z.R_&&!g.e_&&(W.Connection="close"),z.ys.send(z.yM,z.k6,null,W));z.Y.z3(1)},v5G=function(z){z.Y.Ps()||z.Cv||z.Y.wu(z)},ZX=function(){var z=e5(); if(!z)return null;var W=se().n0();return KN(W,z)},xf9=function(z){return Array.isArray(z)?"["+g.OQ(z,HH).join(",")+"]":"null"},eP=function(z,W){gs9(g.OQ(z.screens,cW7)); W&&dfj()},nF9=function(z){kq("remote.onCastSessionChange_: "+HH(z)); if(z){var W=ZX();if(W&&W.id==z.id){if(hL(W.id,"YouTube TV"),z.idType=="shortLived"&&(z=z.token))kJ&&(kJ.token=z),(W=i3())&&W.Xu(z)}else W&&FZ(),af(z,1)}else i3()&&FZ()},l27=function(z){qRn.call(this); this.status=1;this.errorCode=z},Xu7=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},hL=function(z,W){BH()?cH().setConnectedScreenStatus(z,W):L2("setConnectedScreenStatus called before ready.")},aWn=function(){Oe("dispose"); var z=cH();z&&z.dispose();g.DW("yt.mdx.remote.cloudview.instance_",null);jHY(!1);g.gb(PZs);PZs.length=0},VDH=function(z){return new jG(z)},NFL=function(z,W){g.qC(z.W); z.W=0;W==0?mI_(z):z.W=g.OT(function(){mI_(z)},W)},wuH=function(z,W){z.Y?z.Y.add(W):z.U=W},GZ=function(z){z.HE&&(z.player.removeEventListener("presentingplayerstatechange",z.HE),z.HE=null)},Gm7=function(z){return z.U?1:z.Y?z.Y.size:0},n57=function(z){return z.Y?z.wV=="GET"&&z.SC!=2&&z.V.R1:!1},AdL=function(){},z8=function(z,W,K){z.L.sendMessage(W,K)},ob=function(){var z=g.K0(); if(!z)return null;var W=se();if(!W)return null;W=W.n0();return KN(W,z)},se=function(){if(!xen){var z=g.v0("yt.mdx.remote.screenService_"); xen=z?new z5j(z):null}return xen},IHY=function(z,W){if(eG(z)){z.cz.unsubscribe("remotePlayerChange",z.Qd,z); var K=Math.round(W.volume);W=!!W.muted;var B=hM(z.cz);if(K!==B.volume||W!==B.muted)z.cz.setVolume(K,W),z.oC.start();z.cz.subscribe("remotePlayerChange",z.Qd,z)}},tyj=function(){var z=OV(); this.Y=z;z.Yy("/client_streamz/youtube/living_room/mdx/channel/closed",g.e3("channel_type"))},cH=function(){return g.v0("yt.mdx.remote.cloudview.instance_")},$eL=function(z){if(!n57(z))return g.ez(z.Y); var W=g.$1(z.Y);if(W==="")return"";var K="",B=W.length,c=g.Bn(z.Y)==4;if(!z.U.V){if(typeof TextDecoder==="undefined")return gf(z),X1(z),"";z.U.V=new g.bI.TextDecoder}for(var L=0;L0||!(B==1&&T$_(z,W)||B==2&&YJ_(z)))switch(K&&K.length>0&&(W=z.U,W.V=W.V.concat(K)),c){case 1:g3(z,5);break;case 4:g3(z,10);break;case 3:g3(z,6);break;default:g3(z,2)}}},kFQ=function(){var z=g.VO("yt-remote-cast-receiver"); return z?z.friendlyName:null},S_0=function(){var z=lj; if(F1[0]){var W=rC?ig:-1,K={};do K={CH:void 0},W=(W+1)%50,K.CH=F1[W],g.Mt(z,function(B){return function(c){c(B.CH)}}(K)); while(W!=ig);F1=Array(50);ig=-1;rC=!1}},QVs=function(z,W,K,B,c){function L(){return new Y99(Ty(z,"/bc"),W,!1,K,B)} K=K===void 0?function(){return""}:K; return g.jM("enable_mdx_web_channel_desktop")?new HWR(function(){return new De_(Ty(z,"/wc"),W,K)}):new aHL(L,c)},OWR=function(z){z.du=Date.now()+z.U; MRR(z,z.U)}; g.to.prototype.qX=g.rG(49,function(){this.app.hZ().qX()}); g.F6.prototype.qX=g.rG(48,function(){this.gF=null}); g.to.prototype.wM=g.rG(47,function(z){this.app.hZ().wM(z)}); g.F6.prototype.wM=g.rG(46,function(z){this.gF=z}); FZN.prototype.Xi=function(z){this.Y.qk("/client_streamz/youtube/living_room/mdx/channel/opened",z)}; tyj.prototype.Xi=function(z){this.Y.qk("/client_streamz/youtube/living_room/mdx/channel/closed",z)}; FQ_.prototype.Xi=function(z){this.Y.qk("/client_streamz/youtube/living_room/mdx/channel/message_received",z)}; qJj.prototype.Xi=function(){this.Y.qk("/client_streamz/youtube/living_room/mdx/channel/success")}; jms.prototype.Xi=function(z,W){this.Y.qk("/client_streamz/youtube/living_room/mdx/channel/error",z,W)}; MD7.prototype.Xi=function(){this.Y.qk("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")}; O6H.prototype.Xi=function(){this.Y.qk("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")}; g.h=pN.prototype;g.h.Ol=function(){DX(this);for(var z=[],W=0;W2*this.size&&DX(this),!0):!1}; g.h.get=function(z,W){return Ib(this.U,z)?this.U[z]:W}; g.h.set=function(z,W){Ib(this.U,z)||(this.size+=1,this.Y.push(z),this.CA++);this.U[z]=W}; g.h.forEach=function(z,W){for(var K=this.c$(),B=0;B=B.Y.length)return g.rc;var L=B.Y[W++];return g.wM(z?L:B.U[L])}; return c}; var GT9={LiC:"atp",A7a:"ska",xIX:"que",uxC:"mus",VLN:"sus",l4H:"dsp",GuX:"seq",dTa:"mic",LpH:"dpa",B2H:"mlm",pdr:"dsdtr",xTV:"ntb",lgT:"vsp",g9z:"scn",ZTC:"rpe",fUT:"dcn",zdC:"dcp",G2L:"pas",RdT:"drq",C3V:"opf",uI4:"els",Kpz:"isg",c7V:"svq",Kda:"mvp",emf:"ads",nWa:"stcp",UKa:"sads",QIf:"dloc",edf:"dcw",mZT:"asw",dZL:"apw",ObL:"wrc",Vof:"pcw",taC:"ipv",T2V:"ndt",hCa:"ctops"},eGH={qey:"u",xLt:"cl",PEt:"k",mk4:"i",a3r:"cr",gct:"m",t4N:"g",dP:"up"},nNj={oR:"adPlaying",al:"onAdStateChange"},Av7={Zm4:"nowPlaying", FdX:"onStateChange",oR:"adPlaying",al:"onAdStateChange",N9:"nowPlayingShorts",qA:"onShortsStateChange"},xyy={N9:"nowPlayingShorts",qA:"onShortsStateChange"};N7.prototype.equals=function(z){return z?this.id==z.id:!1}; var yWH="",ij=null;g.Y(JAQ,g.Yx);var Xk,rW9=SqH("loadCastFramework")||SqH("loadCastApplicationFramework"),Qrs=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Qj(nN,g.d);g.h=nN.prototype;g.h.uN=function(z){this.L=arguments;this.Y=!1;this.Pz?this.V=g.ZE()+this.fb:this.Pz=g.$o(this.K,this.fb)}; g.h.stop=function(){this.Pz&&(g.bI.clearTimeout(this.Pz),this.Pz=null);this.V=null;this.Y=!1;this.L=[]}; g.h.pause=function(){++this.U}; g.h.resume=function(){this.U&&(--this.U,!this.U&&this.Y&&(this.Y=!1,this.Z.apply(null,this.L)))}; g.h.zT=function(){this.stop();nN.qg.zT.call(this)}; g.h.gx=function(){this.Pz&&(g.bI.clearTimeout(this.Pz),this.Pz=null);this.V?(this.Pz=g.$o(this.K,this.V-g.ZE()),this.V=null):this.U?this.Y=!0:(this.Y=!1,this.Z.apply(null,this.L))};If.prototype.stringify=function(z){return g.bI.JSON.stringify(z,void 0)}; If.prototype.parse=function(z){return g.bI.JSON.parse(z,void 0)};g.Qj(Uy_,g.j$);g.Qj(qRn,g.j$);var Y_n=null;g.Qj(dIH,g.j$);g.Qj(OGH,g.j$);g.Qj(e5y,g.j$);tM.prototype.debug=function(){}; tM.prototype.info=function(){}; tM.prototype.warning=function(){};var kHn={},CkH={};g.h=yy.prototype;g.h.setTimeout=function(z){this.Ny=z}; g.h.bN=function(z){z=z.target;var W=this.TT;W&&g.Bn(z)==3?W.jb():this.Rt(z)}; g.h.Rt=function(z){try{if(z==this.Y)a:{var W=g.Bn(this.Y),K=this.Y.U,B=this.Y.getStatus();if(!(W<3)&&(W!=3||this.Y&&(this.U.U||g.ez(this.Y)||g.$1(this.Y)))){this.gV||W!=4||K==7||(K==8||B<=0?Rb(3):Rb(2));KQj(this);var c=this.Y.getStatus();this.QB=c;var L=$eL(this);if(this.Z=c==200){if(this.Ac&&!this.X4){b:{if(this.Y){var F=g.hV(this.Y,"X-HTTP-Initial-Response");if(F&&!g.U1(F)){var X=F;break b}}X=null}if(z=X)this.X4=!0,cAL(this,z);else{this.Z=!1;this.K=3;$q(12);gf(this);X1(this);break a}}if(this.dV){z= !0;for(var Q;!this.gV&&this.W0&&!this.Bl&&(this.Bl=!0,this.V.uc(this)):(gf(this),X1(this))}else cAL(this,L);W==4&&gf(this);this.Z&&!this.gV&&(W==4?vNR(this.V,this):(this.Z=!1,u3(this)))}else g.OVI(this.Y),c==400&&L.indexOf("Unknown SID")> 0?(this.K=3,$q(12)):(this.K=0,$q(13)),gf(this),X1(this)}}}catch(S){}finally{}}; g.h.cancel=function(){this.gV=!0;gf(this)}; g.h.SJ=function(){this.cX=null;var z=Date.now();z-this.lJ>=0?(this.SC!=2&&(Rb(3),$q(17)),gf(this),this.K=2,X1(this)):cdH(this,this.lJ-z)}; g.h.getLastError=function(){return this.K}; g.h.uj=function(){return this.Y};DIN.prototype.cancel=function(){this.V=X1G(this);if(this.U)this.U.cancel(),this.U=null;else if(this.Y&&this.Y.size!==0){for(var z=g.l(this.Y.values()),W=z.next();!W.done;W=z.next())W.value.cancel();this.Y.clear()}};g.h=IWN.prototype;g.h.p9=8;g.h.rF=1;g.h.connect=function(z,W,K,B){$q(0);this.Pl=z;this.gV=W||{};K&&B!==void 0&&(this.gV.OSID=K,this.gV.OAID=B);this.TT=this.d3;this.My=ztH(this,null,this.Pl);yN(this)}; g.h.disconnect=function(){zN_(this);if(this.rF==3){var z=this.WX++,W=this.My.clone();g.gk(W,"SID",this.L);g.gk(W,"RID",z);g.gk(W,"TYPE","terminate");Rf(this,W);z=new yy(this,this.L,z);z.SC=2;z.J=vH(W.clone());W=!1;if(g.bI.navigator&&g.bI.navigator.sendBeacon)try{W=g.bI.navigator.sendBeacon(z.J.toString(),"")}catch(K){}!W&&g.bI.Image&&((new Image).src=z.J,W=!0);W||(z.Y=RyY(z.V,null),z.Y.send(z.J));z.RC=Date.now();u3(z)}w3G(this)}; g.h.Ps=function(){return this.rF==0}; g.h.getState=function(){return this.rF}; g.h.L9=function(z){if(this.Z)if(this.Z=null,this.rF==1){if(!z){this.WX=Math.floor(Math.random()*1E5);z=this.WX++;var W=new yy(this,"",z),K=this.oC;this.Ac&&(K?(K=g.eW(K),g.Wv(K,this.Ac)):K=this.Ac);this.W!==null||this.lJ||(W.My=K,K=null);var B;if(this.Uh)a:{for(var c=B=0;c4096){B=c;break a}if(B===4096||c===this.V.length-1){B=c+1;break a}}B= 1E3}else B=1E3;B=B7_(this,W,B);c=this.My.clone();g.gk(c,"RID",z);g.gk(c,"CVER",22);this.dV&&g.gk(c,"X-HTTP-Session-Id",this.dV);Rf(this,c);K&&(this.lJ?B="headers="+g.tX(g.m_G(K))+"&"+B:this.W&&g.kL(c,this.W,K));wuH(this.U,W);this.iO&&g.gk(c,"TYPE","init");this.Uh?(g.gk(c,"$req",B),g.gk(c,"SID","null"),W.Ac=!0,Jv0(W,c,null)):Jv0(W,c,B);this.rF=2}}else this.rF==3&&(z?PUY(this,z):this.V.length==0||Ho9(this.U)||PUY(this))}; g.h.Vw=function(){this.J=null;p3H(this);if(this.aM&&!(this.Ny||this.Y==null||this.m9<=0)){var z=4*this.m9;this.wV=d3((0,g.xo)(this.SS4,this),z)}}; g.h.SS4=function(){this.wV&&(this.wV=null,this.TT=!1,this.Ny=!0,$q(10),EV(this),p3H(this))}; g.h.uc=function(z){this.Y==z&&this.aM&&!this.Ny&&(Ooy(this),this.Ny=!0,$q(11))}; g.h.HQ=function(){this.cX!=null&&(this.cX=null,EV(this),YJ_(this),$q(19))}; g.h.djV=function(z){z?$q(2):$q(1)}; g.h.isActive=function(){return!!this.K&&this.K.isActive(this)}; g.h=P9L.prototype;g.h.wz=function(){}; g.h.OQ=function(){}; g.h.m3=function(){}; g.h.Aa=function(){}; g.h.isActive=function(){return!0}; g.h.ER=function(){};g.Qj(LN,g.oM);LN.prototype.open=function(){this.Y.K=this.V;this.Z&&(this.Y.X4=!0);this.Y.connect(this.K,this.U||void 0)}; LN.prototype.close=function(){this.Y.disconnect()}; LN.prototype.send=function(z){var W=this.Y;if(typeof z==="string"){var K={};K.__data__=z;z=K}else this.L&&(K={},K.__data__=g.Ik(z),z=K);W.V.push(new LmH(W.lO++,z));W.rF==3&&yN(W)}; LN.prototype.zT=function(){this.Y.K=null;delete this.V;this.Y.disconnect();delete this.Y;LN.qg.zT.call(this)}; g.Qj(CZs,Uy_);g.Qj(l27,qRn);g.Qj(r3,P9L);r3.prototype.wz=function(){this.Y.dispatchEvent("m")}; r3.prototype.OQ=function(z){this.Y.dispatchEvent(new CZs(z))}; r3.prototype.m3=function(z){this.Y.dispatchEvent(new l27(z))}; r3.prototype.Aa=function(){this.Y.dispatchEvent("n")}; VQ0.prototype.commit=function(z){this.Y.QB=z};var sY=new g.oM;g.Y(IPj,g.j$);g.h=Zv.prototype;g.h.Gk=null;g.h.vn=!1;g.h.GH=null;g.h.du=null;g.h.F$=null;g.h.ZY=null;g.h.W4=null;g.h.yM=null;g.h.qR=null;g.h.ys=null;g.h.Tg=0;g.h.V9=null;g.h.k6=null;g.h.aU=null;g.h.tD=-1;g.h.R_=!0;g.h.Cv=!1;g.h.ek=0;g.h.x6=null;var FRG={},iIR={};g.h=Zv.prototype;g.h.setTimeout=function(z){this.U=z}; g.h.sR=function(z){z=z.target;var W=this.x6;W&&g.Bn(z)==3?W.jb():this.It(z)}; g.h.It=function(z){try{if(z==this.ys)a:{var W=g.Bn(this.ys),K=this.ys.U,B=this.ys.getStatus();if(g.e_&&!g.Pt("420+")){if(W<4)break a}else if(W<3||W==3&&!g.ez(this.ys))break a;this.Cv||W!=4||K==7||(K==8||B<=0?this.Y.z3(3):this.Y.z3(2));osY(this);var c=this.ys.getStatus();this.tD=c;var L=g.ez(this.ys);if(this.vn=c==200){W==4&&xq(this);if(this.dV){for(z=!0;!this.Cv&&this.Tg0?(this.aU=3,BZ(13)):(this.aU=0,BZ(14)),xq(this),v5G(this)}}catch(X){}finally{}}; g.h.cancel=function(){this.Cv=!0;xq(this)}; g.h.XU=function(){this.GH=null;var z=Date.now();z-this.du>=0?(this.ZY!=2&&this.Y.z3(3),xq(this),this.aU=2,BZ(18),v5G(this)):MRR(this,this.du-z)}; g.h.getLastError=function(){return this.aU};g.h=u5R.prototype;g.h.O7=null;g.h.VC=null;g.h.I2=!1;g.h.IE=null;g.h.NB=null;g.h.rl=-1;g.h.WZ=null;g.h.Hq=null;g.h.connect=function(z){this.IE=z;z=M7(this.Y,null,this.IE);BZ(3);Date.now();var W=this.Y.oC;W!=null?(this.WZ=W[0],(this.Hq=W[1])?(this.NB=1,fH_(this)):(this.NB=2,jVN(this))):(zZ(z,"MODE","init"),this.VC=new Zv(this),this.VC.Gk=this.O7,kg_(this.VC,z,!1,null,!0),this.NB=0)}; g.h.iR=function(z){if(z)this.NB=2,jVN(this);else{BZ(4);var W=this.Y;W.HU=W.uo.rl;SP(W,9)}z&&this.z3(2)}; g.h.m5=function(z){return this.Y.m5(z)}; g.h.abort=function(){this.VC&&(this.VC.cancel(),this.VC=null);this.rl=-1}; g.h.Ps=function(){return!1}; g.h.Mz=function(z,W){this.rl=z.tD;if(this.NB==0)if(W){try{var K=this.U.parse(W)}catch(B){z=this.Y;z.HU=this.rl;SP(z,2);return}this.WZ=K[0];this.Hq=K[1]}else z=this.Y,z.HU=this.rl,SP(z,2);else this.NB==2&&(this.I2?(BZ(7),Date.now()):W=="11111"?(BZ(6),this.I2=!0,Date.now(),this.rl=200,this.VC.cancel(),BZ(12),JM(this.Y,this,!0)):(BZ(8),Date.now(),this.I2=!1))}; g.h.wu=function(){this.rl=this.VC.tD;if(this.VC.vn)this.NB==0?this.Hq?(this.NB=1,fH_(this)):(this.NB=2,jVN(this)):this.NB==2&&(this.I2?(BZ(12),JM(this.Y,this,!0)):(BZ(11),JM(this.Y,this,!1)));else{this.NB==0?BZ(9):this.NB==2&&BZ(10);var z=this.Y;this.VC.getLastError();z.HU=this.rl;SP(z,2)}}; g.h.j_=function(){return this.Y.j_()}; g.h.isActive=function(){return this.Y.isActive()}; g.h.z3=function(z){this.Y.z3(z)};g.h=Ue7.prototype;g.h.GZ=null;g.h.hD=null;g.h.yy=null;g.h.ix=null;g.h.nI=null;g.h.Cl=null;g.h.n9=null;g.h.Mn=null;g.h.Db=0;g.h.yj=0;g.h.fn=null;g.h.G3=null;g.h.fR=null;g.h.Yr=null;g.h.uo=null;g.h.xI=null;g.h.lA=-1;g.h.BN=-1;g.h.HU=-1;g.h.o$=0;g.h.qG=0;g.h.l7=8;var V$7={OK:0,toX:2,QWN:4,k2r:5,azC:6,STOP:7,Jt:8,OGa:9,eCC:10,mLa:11,wVX:12};g.Qj(B$H,g.j$);g.Qj(d4s,g.j$);g.h=Ue7.prototype; g.h.connect=function(z,W,K,B,c){BZ(0);this.nI=W;this.hD=K||{};B&&c!==void 0&&(this.hD.OSID=B,this.hD.OAID=c);this.J?(K2((0,g.xo)(this.Hh,this,z),100),Nk9(this)):this.Hh(z)}; g.h.disconnect=function(){hL0(this);if(this.Y==3){var z=this.Db++,W=this.Cl.clone();g.gk(W,"SID",this.L);g.gk(W,"RID",z);g.gk(W,"TYPE","terminate");MV(this,W);z=new Zv(this,this.L,z);z.ZY=2;z.W4=vH(W.clone());(new Image).src=z.W4.toString();z.F$=Date.now();OWR(z)}q_j(this)}; g.h.Hh=function(z){this.uo=new u5R(this);this.uo.O7=this.GZ;this.uo.U=this.K;this.uo.connect(z)}; g.h.Ps=function(){return this.Y==0}; g.h.getState=function(){return this.Y}; g.h.u0=function(z){this.G3=null;MoH(this,z)}; g.h.K9=function(){this.fR=null;this.ix=new Zv(this,this.L,"rpc",this.W);this.ix.Gk=this.GZ;this.ix.ek=0;var z=this.n9.clone();g.gk(z,"RID","rpc");g.gk(z,"SID",this.L);g.gk(z,"CI",this.xI?"0":"1");g.gk(z,"AID",this.lA);MV(this,z);g.gk(z,"TYPE","xmlhttp");kg_(this.ix,z,!0,this.Mn,!1)}; g.h.Mz=function(z,W){if(this.Y!=0&&(this.ix==z||this.yy==z))if(this.HU=z.tD,this.yy==z&&this.Y==3)if(this.l7>7){try{var K=this.K.parse(W)}catch(B){K=null}if(Array.isArray(K)&&K.length==3)if(z=K,z[0]==0)a:{if(!this.fR){if(this.ix)if(this.ix.F$+3E30)){if(B=W==1)this.yy||this.G3||this.Y==1||this.o$>=2?B=!1:(this.G3=K2((0,g.xo)(this.u0,this,z),gFN(this,this.o$)),this.o$++, B=!0);B=!(B||W==2&&unL(this))}if(B)switch(K){case 1:SP(this,5);break;case 4:SP(this,10);break;case 3:SP(this,6);break;case 7:SP(this,12);break;default:SP(this,2)}}}; g.h.xE=function(z){if(!g.ht(arguments,this.Y))throw Error("Unexpected channel state: "+this.Y);}; g.h.ejr=function(z){z?BZ(2):(BZ(1),bIL(this,8))}; g.h.m5=function(z){if(z)throw Error("Can't create secondary domain capable XhrIo object.");z=new g.up;z.W=!1;return z}; g.h.isActive=function(){return!!this.fn&&this.fn.isActive(this)}; g.h.z3=function(z){var W=sY;W.dispatchEvent(new d4s(W,z))}; g.h.j_=function(){return!1}; g.h=AdL.prototype;g.h.b0=function(){}; g.h.Sp=function(){}; g.h.HN=function(){}; g.h.gz=function(){}; g.h.Bf=function(){}; g.h.EQ=function(){return{}}; g.h.isActive=function(){return!0};g.h=NKH.prototype;g.h.enqueue=function(z){this.U.push(z)}; g.h.isEmpty=function(){return this.Y.length===0&&this.U.length===0}; g.h.clear=function(){this.Y=[];this.U=[]}; g.h.contains=function(z){return g.ht(this.Y,z)||g.ht(this.U,z)}; g.h.remove=function(z){var W=this.Y;var K=(0,g.z6g)(W,z);K>=0?(g.jo(W,K),W=!0):W=!1;return W||g.lu(this.U,z)}; g.h.Ol=function(){for(var z=[],W=this.Y.length-1;W>=0;--W)z.push(this.Y[W]);W=this.U.length;for(var K=0;K=paH.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(z=paH[this.U],this.Pz=g.OT((0,g.xo)(this.HB,this),z),this.U++):this.publish("pairingFailed",Error("Server error "+z.status))}; g.h.t_=function(){this.Y=null;this.publish("pairingFailed",Error("Server not responding"))}; var paH=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Qj(VN,QN);g.h=VN.prototype;g.h.start=function(){K5(this)&&this.publish("screenChange");!g.VO("yt-remote-lounge-token-expiration")&&wNj(this);g.qC(this.Y);this.Y=g.OT((0,g.xo)(this.start,this),1E4)}; g.h.add=function(z,W){K5(this);XNY(this,z);eP(this,!1);this.publish("screenChange");W(z);z.token||wNj(this)}; g.h.remove=function(z,W){var K=K5(this);q9N(this,z)&&(eP(this,!1),K=!0);W(z);K&&this.publish("screenChange")}; g.h.Ew=function(z,W,K,B){var c=K5(this),L=this.get(z.id);L?(L.name!=W&&(L.name=W,eP(this,!1),c=!0),K(z)):B(Error("no such local screen."));c&&this.publish("screenChange")}; g.h.zT=function(){g.qC(this.Y);VN.qg.zT.call(this)}; g.h.MCT=function(z){K5(this);var W=this.screens.length;z=z&&z.screens||[];for(var K=z.length,B=0;B20)break a;X=W(L,F)}L=X}c.name=L}K(YJ(this,c))},this), onError:(0,g.xo)(function(c){B(Error("pairing request failed: "+c.status))},this), onTimeout:(0,g.xo)(function(){B(Error("pairing request timed out."))},this)})}; g.h.zT=function(){g.iP(this.U);g.iP(this.Y);SG.qg.zT.call(this)}; g.h.XX4=function(){ns_(this);this.publish("screenChange");this.Y.update()}; SG.prototype.dispose=SG.prototype.dispose;g.Qj($J,g.r6);g.h=$J.prototype;g.h.le=function(z){this.Kt()||(z&&(Qz(this,""+z),this.publish("sessionFailed")),this.Y=null,this.publish("sessionScreen",null))}; g.h.info=function(z){C2(this.dV,z)}; g.h.xj=function(){return null}; g.h.MC=function(z){var W=this.U;z?(W.displayStatus=new chrome.cast.ReceiverDisplayStatus(z,[]),W.displayStatus.showStop=!0):W.displayStatus=null;chrome.cast.setReceiverDisplayStatus(W,(0,g.xo)(function(){this.info("Updated receiver status for "+W.friendlyName+": "+z)},this),(0,g.xo)(function(){Qz(this,"Failed to update receiver status for: "+W.friendlyName)},this))}; g.h.zT=function(){this.MC("");$J.qg.zT.call(this)};g.Y(fN,$J);g.h=fN.prototype;g.h.wO=function(z){if(this.V){if(this.V==z)return;Qz(this,"Overriding cast session with new session object");xkR(this);this.RC=!1;this.oC="unknown";this.V.removeUpdateListener(this.Ur);this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.wV)}this.V=z;this.V.addUpdateListener(this.Ur);this.V.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.wV);TKQ(this,"getMdxSessionStatus")}; g.h.kt=function(z){this.info("launchWithParams no-op for Cast: "+g.Ik(z))}; g.h.stop=function(){this.V?this.V.stop((0,g.xo)(function(){this.le()},this),(0,g.xo)(function(){this.le(Error("Failed to stop receiver app."))},this)):this.le(Error("Stopping cast device without session."))}; g.h.MC=function(){}; g.h.zT=function(){this.info("disposeInternal");xkR(this);this.V&&(this.V.removeUpdateListener(this.Ur),this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.wV));this.V=null;$J.prototype.zT.call(this)}; g.h.mg4=function(z,W){if(!this.Kt())if(W)if(W=tL(W),g.$8(W))switch(z=""+W.type,W=W.data||{},this.info("onYoutubeMessage_: "+z+" "+g.Ik(W)),z){case "mdxSessionStatus":vd_(this,W);break;case "loungeToken":fPH(this,W);break;default:Qz(this,"Unknown youtube message: "+z)}else Qz(this,"Unable to parse message.");else Qz(this,"No data in message.")}; g.h.qm=function(z,W,K,B){g.qC(this.J);this.J=0;yVR(this.L,this.U.label,z,this.U.friendlyName,(0,g.xo)(function(c){c?W(c):B>=0?(Qz(this,"Screen "+z+" appears to be offline. "+B+" retries left."),this.J=g.OT((0,g.xo)(this.qm,this,z,W,K,B-1),300)):K(Error("Unable to fetch screen."))},this),K)}; g.h.xj=function(){return this.V}; g.h.jJ=function(z){this.Kt()||z||(Qz(this,"Cast session died."),this.le())};g.Y(HZ,$J);g.h=HZ.prototype;g.h.wO=function(z){this.V=z;this.V.addUpdateListener(this.gV)}; g.h.kt=function(z){this.My=z;this.cX()}; g.h.stop=function(){H6R(this);this.V?this.V.stop((0,g.xo)(this.le,this,null),(0,g.xo)(this.le,this,"Failed to stop DIAL device.")):this.le()}; g.h.zT=function(){H6R(this);this.V&&this.V.removeUpdateListener(this.gV);this.V=null;$J.prototype.zT.call(this)}; g.h.h_=function(z){this.Kt()||z||(Qz(this,"DIAL session died."),this.K(),this.K=function(){},this.le())};g.Y(wf,$J);wf.prototype.stop=function(){this.le()}; wf.prototype.wO=function(){}; wf.prototype.kt=function(){g.qC(this.V);this.V=NaN;var z=KN(this.L.n0(),this.U.label);z?w3(this,z):this.le(Error("No such screen"))}; wf.prototype.zT=function(){g.qC(this.V);this.V=NaN;$J.prototype.zT.call(this)};g.Y(Fk,g.r6);g.h=Fk.prototype; g.h.init=function(z,W){chrome.cast.timeout.requestSession=3E4;var K=new chrome.cast.SessionRequest(this.J,[chrome.cast.Capability.AUDIO_OUT]);g.jM("desktop_enable_cast_connect")&&(K.androidReceiverCompatible=!0);this.oC||(K.dialRequest=new chrome.cast.DialRequest("YouTube"));var B=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;z=z||this.Z?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var c=(0,g.xo)(this.nkV,this);K=new chrome.cast.ApiConfig(K,(0,g.xo)(this.JU, this),c,B,z);K.customDialLaunchCallback=(0,g.xo)(this.F9C,this);chrome.cast.initialize(K,(0,g.xo)(function(){this.Kt()||(chrome.cast.addReceiverActionListener(this.K),WRH(),this.U.subscribe("onlineScreenChange",(0,g.xo)(this.yw,this)),this.V=VR7(this),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.xo)(function(L){this.dL("Failed to set initial custom receivers: "+g.Ik(L))},this)),this.publish("yt-remote-cast2-availability-change",v5(this)),W(!0))},this),(0,g.xo)(function(L){this.dL("Failed to initialize API: "+ g.Ik(L)); W(!1)},this))}; g.h.XOT=function(z,W){Yq("Setting connected screen ID: "+z+" -> "+W);if(this.Y){var K=this.Y.Y;if(!z||K&&K.id!=z)Yq("Unsetting old screen status: "+this.Y.U.friendlyName),PH(this,null)}if(z&&W){if(!this.Y){z=KN(this.U.n0(),z);if(!z){Yq("setConnectedScreenStatus: Unknown screen.");return}if(z.idType=="shortLived"){Yq("setConnectedScreenStatus: Screen with id type to be short lived.");return}K=$k_(this,z);K||(Yq("setConnectedScreenStatus: Connected receiver not custom..."),K=new chrome.cast.Receiver(z.uuid? z.uuid:z.id,z.name),K.receiverType=chrome.cast.ReceiverType.CUSTOM,this.V.push(K),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.xo)(function(B){this.dL("Failed to set initial custom receivers: "+g.Ik(B))},this))); Yq("setConnectedScreenStatus: new active receiver: "+K.friendlyName);PH(this,new wf(this.U,K),!0)}this.Y.MC(W)}else Yq("setConnectedScreenStatus: no screen.")}; g.h.Zia=function(z){this.Kt()?this.dL("Setting connection data on disposed cast v2"):this.Y?this.Y.kt(z):this.dL("Setting connection data without a session")}; g.h.PQ=function(){this.Kt()?this.dL("Stopping session on disposed cast v2"):this.Y?(this.Y.stop(),PH(this,null)):Yq("Stopping non-existing session")}; g.h.requestSession=function(){chrome.cast.requestSession((0,g.xo)(this.JU,this),(0,g.xo)(this.hra,this))}; g.h.zT=function(){this.U.unsubscribe("onlineScreenChange",(0,g.xo)(this.yw,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.K);var z=U4H,W=g.v0("yt.mdx.remote.debug.handlers_");g.lu(W||[],z);g.iP(this.Y);g.r6.prototype.zT.call(this)}; g.h.dL=function(z){C2("Controller",z)}; g.h.v1=function(z,W){this.Y==z&&(W||PH(this,null),this.publish("yt-remote-cast2-session-change",W))}; g.h.wia=function(z,W){if(!this.Kt())if(z)switch(z.friendlyName=chrome.cast.unescape(z.friendlyName),Yq("onReceiverAction_ "+z.label+" / "+z.friendlyName+"-- "+W),W){case chrome.cast.ReceiverAction.CAST:if(this.Y)if(this.Y.U.label!=z.label)Yq("onReceiverAction_: Stopping active receiver: "+this.Y.U.friendlyName),this.Y.stop();else{Yq("onReceiverAction_: Casting to active receiver.");this.Y.Y&&this.publish("yt-remote-cast2-session-change",this.Y.Y);break}switch(z.receiverType){case chrome.cast.ReceiverType.CUSTOM:PH(this, new wf(this.U,z));break;case chrome.cast.ReceiverType.DIAL:PH(this,new HZ(this.U,z,this.L,this.config_));break;case chrome.cast.ReceiverType.CAST:PH(this,new fN(this.U,z,this.config_));break;default:this.dL("Unknown receiver type: "+z.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Y&&this.Y.U.label==z.label?this.Y.stop():this.dL("Stopping receiver w/o session: "+z.friendlyName)}else this.dL("onReceiverAction_ called without receiver.")}; g.h.F9C=function(z){if(this.Kt())return Promise.reject(Error("disposed"));var W=z.receiver;W.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dL("Not DIAL receiver: "+W.friendlyName),W.receiverType=chrome.cast.ReceiverType.DIAL);var K=this.Y?this.Y.U:null;if(!K||K.label!=W.label)return this.dL("Receiving DIAL launch request for non-clicked DIAL receiver: "+W.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(K&&K.label==W.label&&K.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Y.Y)return Yq("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Y.Y),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dL('Changing CAST intent from "'+K.receiverType+'" to "dial" for '+W.friendlyName);PH(this,new HZ(this.U,W,this.L,this.config_))}W=this.Y;W.J=z;W.J.appState==chrome.cast.DialAppState.RUNNING?(z=W.J.extraData||{},K=z.screenId||null,Vy(W)&&z.loungeToken?z.loungeTokenRefreshIntervalMs?z=oNG(W,{name:W.U.friendlyName,screenId:z.screenId,loungeToken:z.loungeToken,dialId:W.J.receiver.label, screenIdType:"shortLived"},z.loungeTokenRefreshIntervalMs):(g.Zg(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(z)+".")),z=gNn(W,K)):z=gNn(W,K)):z=ZI0(W);return z}; g.h.JU=function(z){var W=this;if(!this.Kt()&&!this.Z){Yq("New cast session ID: "+z.sessionId);var K=z.receiver;if(K.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Y)if(K.receiverType==chrome.cast.ReceiverType.CAST)Yq("Got resumed cast session before resumed mdx connection."),K.friendlyName=chrome.cast.unescape(K.friendlyName),PH(this,new fN(this.U,K,this.config_),!0);else{this.dL("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var B=this.Y.U,c=KN(this.U.n0(), B.label);c&&XZ(c,K.label)&&B.receiverType!=chrome.cast.ReceiverType.CAST&&K.receiverType==chrome.cast.ReceiverType.CAST&&(Yq("onSessionEstablished_: manual to cast session change "+K.friendlyName),g.iP(this.Y),this.Y=new fN(this.U,K,this.config_),this.Y.subscribe("sessionScreen",(0,g.xo)(this.v1,this,this.Y)),this.Y.subscribe("sessionFailed",function(){return HGR(W,W.Y)}),this.Y.kt(null)); this.Y.wO(z)}}}; g.h.Do=function(){return this.Y?this.Y.xj():null}; g.h.hra=function(z){this.Kt()||(this.dL("Failed to estabilish a session: "+g.Ik(z)),z.code!=chrome.cast.ErrorCode.CANCEL&&PH(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.h.nkV=function(z){Yq("Receiver availability updated: "+z);if(!this.Kt()){var W=v5(this);this.W=z==chrome.cast.ReceiverAvailability.AVAILABLE;v5(this)!=W&&this.publish("yt-remote-cast2-availability-change",v5(this))}}; g.h.yw=function(){this.Kt()||(this.V=VR7(this),Yq("Updating custom receivers: "+g.Ik(this.V)),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.xo)(function(){this.dL("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",v5(this)))}; Fk.prototype.setLaunchParams=Fk.prototype.Zia;Fk.prototype.setConnectedScreenStatus=Fk.prototype.XOT;Fk.prototype.stopSession=Fk.prototype.PQ;Fk.prototype.getCastSession=Fk.prototype.Do;Fk.prototype.requestSession=Fk.prototype.requestSession;Fk.prototype.init=Fk.prototype.init;Fk.prototype.dispose=Fk.prototype.dispose;var N79=g.Su(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),PZs=[],rdn=g.oc(N79);g.h=uj.prototype; g.h.reset=function(z){this.listId="";this.index=-1;this.videoId="";ioH(this);this.volume=-1;this.muted=!1;z&&(this.index=z.index,this.listId=z.listId,this.videoId=z.videoId,this.playerState=z.playerState,this.volume=z.volume,this.muted=z.muted,this.audioTrackId=z.audioTrackId,this.trackData=z.trackData,this.QK=z.hasPrevious,this.K0=z.hasNext,this.Z=z.playerTime,this.K=z.playerTimeAt,this.U=z.seekableStart,this.W=z.seekableEnd,this.V=z.duration,this.J=z.loadedTime,this.Y=z.liveIngestionTime,this.L= !isNaN(this.Y))}; g.h.isPlaying=function(){return this.playerState==1}; g.h.isBuffering=function(){return this.playerState==3}; g.h.CB=function(z){this.V=isNaN(z)?0:z}; g.h.getDuration=function(){return this.L?this.V+L5(this):this.V}; g.h.clone=function(){return new uj(eLs(this))};g.Y(Ue,g.r6);g.h=Ue.prototype;g.h.getState=function(){return this.V}; g.h.vM=function(){return this.L.getReconnectTimeout()}; g.h.QW=function(){this.L.reconnect()}; g.h.play=function(){P5(this)?(this.Y?this.Y.play(null,g.W6,WZ(this,"play")):z8(this,"play"),pu7(this,1,Ee(hM(this))),this.publish("remotePlayerChange")):xJ(this,this.play)}; g.h.pause=function(){P5(this)?(this.Y?this.Y.pause(null,g.W6,WZ(this,"pause")):z8(this,"pause"),pu7(this,2,Ee(hM(this))),this.publish("remotePlayerChange")):xJ(this,this.pause)}; g.h.seekTo=function(z){if(P5(this)){if(this.Y){var W=hM(this),K=new chrome.cast.media.SeekRequest;K.currentTime=z;W.isPlaying()||W.isBuffering()?K.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:K.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Y.seek(K,g.W6,WZ(this,"seekTo",{newTime:z}))}else z8(this,"seekTo",{newTime:z});pu7(this,3,z);this.publish("remotePlayerChange")}else xJ(this,g.h_(this.seekTo,z))}; g.h.stop=function(){if(P5(this)){this.Y?this.Y.stop(null,g.W6,WZ(this,"stopVideo")):z8(this,"stopVideo");var z=hM(this);z.index=-1;z.videoId="";ioH(z);NV(this,z);this.publish("remotePlayerChange")}else xJ(this,this.stop)}; g.h.setVolume=function(z,W){if(P5(this)){var K=hM(this);if(this.U){if(K.volume!=z){var B=Math.round(z)/100;this.U.setReceiverVolumeLevel(B,(0,g.xo)(function(){Dd("set receiver volume: "+B)},this),(0,g.xo)(function(){this.dL("failed to set receiver volume.")},this))}K.muted!=W&&this.U.setReceiverMuted(W,(0,g.xo)(function(){Dd("set receiver muted: "+W)},this),(0,g.xo)(function(){this.dL("failed to set receiver muted.")},this))}else{var c={volume:z, muted:W};K.volume!=-1&&(c.delta=z-K.volume);z8(this,"setVolume",c)}K.muted=W;K.volume=z;NV(this,K)}else xJ(this,g.h_(this.setVolume,z,W))}; g.h.Z5=function(z,W){if(P5(this)){var K=hM(this);z={videoId:z};W&&(K.trackData={trackName:W.name,languageCode:W.languageCode,sourceLanguageCode:W.translationLanguage?W.translationLanguage.languageCode:"",languageName:W.languageName,kind:W.kind},z.style=g.Ik(W.style),g.Wv(z,K.trackData));z8(this,"setSubtitlesTrack",z);NV(this,K)}else xJ(this,g.h_(this.Z5,z,W))}; g.h.setAudioTrack=function(z,W){P5(this)?(W=W.getLanguageInfo().getId(),z8(this,"setAudioTrack",{videoId:z,audioTrackId:W}),z=hM(this),z.audioTrackId=W,NV(this,z)):xJ(this,g.h_(this.setAudioTrack,z,W))}; g.h.playVideo=function(z,W,K,B,c,L,F){B=B===void 0?null:B;c=c===void 0?null:c;L=L===void 0?null:L;F=F===void 0?null:F;var X=hM(this),Q={videoId:z};K!==void 0&&(Q.currentIndex=K);W5(X,z,K||0);W!==void 0&&(p2(X,W),Q.currentTime=W);B&&(Q.listId=B);c&&(Q.playerParams=c);L&&(Q.clickTrackingParams=L);F&&(Q.locationInfo=g.Ik(F));z8(this,"setPlaylist",Q);B||NV(this,X)}; g.h.pZ=function(z,W){if(P5(this)){if(z&&W){var K=hM(this);W5(K,z,W);NV(this,K)}z8(this,"previous")}else xJ(this,g.h_(this.pZ,z,W))}; g.h.nextVideo=function(z,W){if(P5(this)){if(z&&W){var K=hM(this);W5(K,z,W);NV(this,K)}z8(this,"next")}else xJ(this,g.h_(this.nextVideo,z,W))}; g.h.C1=function(){if(P5(this)){z8(this,"clearPlaylist");var z=hM(this);z.reset();NV(this,z);this.publish("remotePlayerChange")}else xJ(this,this.C1)}; g.h.Nf=function(){P5(this)?z8(this,"dismissAutoplay"):xJ(this,this.Nf)}; g.h.dispose=function(){if(this.V!=3){var z=this.V;this.V=3;this.publish("proxyStateChange",z,this.V)}g.r6.prototype.dispose.call(this)}; g.h.zT=function(){WZH(this);this.L=null;this.K.clear();q7(this,null);g.r6.prototype.zT.call(this)}; g.h.ud=function(z){if((z!=this.V||z==2)&&this.V!=3&&z!=0){var W=this.V;this.V=z;this.publish("proxyStateChange",W,z);if(z==1)for(;!this.K.isEmpty();)W=z=this.K,W.Y.length===0&&(W.Y=W.U,W.Y.reverse(),W.U=[]),z.Y.pop().apply(this);else z==3&&this.dispose()}}; g.h.dhX=function(z,W){this.publish(z,W)}; g.h.Xz4=function(z){if(!z)this.ip(null),q7(this,null);else if(this.U.receiver.volume){z=this.U.receiver.volume;var W=hM(this),K=Math.round(100*z.level||0);if(W.volume!=K||W.muted!=z.muted)Dd("Cast volume update: "+z.level+(z.muted?" muted":"")),W.volume=K,W.muted=!!z.muted,NV(this,W)}}; g.h.ip=function(z){Dd("Cast media: "+!!z);this.Y&&this.Y.removeUpdateListener(this.J);if(this.Y=z)this.Y.addUpdateListener(this.J),Jd_(this),this.publish("remotePlayerChange")}; g.h.EO4=function(z){z?(Jd_(this),this.publish("remotePlayerChange")):this.ip(null)}; g.h.rD=function(){z8(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.h.x6r=function(){var z=fe_();z&&q7(this,z)}; g.h.dL=function(z){C2("CP",z)};g.Y(j5,g.r6);g.h=j5.prototype; g.h.connect=function(z,W){if(W){var K=W.listId,B=W.videoId,c=W.videoIds,L=W.playerParams,F=W.clickTrackingParams,X=W.index,Q={videoId:B},S=W.currentTime,I=W.locationInfo;W=W.loopMode;S!==void 0&&(Q.currentTime=S<=5?0:S);L&&(Q.playerParams=L);I&&(Q.locationInfo=I);F&&(Q.clickTrackingParams=F);K&&(Q.listId=K);c&&c.length>0&&(Q.videoIds=c.join(","));X!==void 0&&(Q.currentIndex=X);this.gV&&(Q.loopMode=W||"LOOP_MODE_OFF");K&&(this.Y.listId=K);this.Y.videoId=B;this.Y.index=X||0;this.Y.state=3;p2(this.Y, S);this.K="UNSUPPORTED";K=this.gV?"setInitialState":"setPlaylist";ab("Connecting with "+K+" and params: "+g.Ik(Q));this.U.connect({method:K,params:g.Ik(Q)},z,sc7())}else ab("Connecting without params"),this.U.connect({},z,sc7());meL(this)}; g.h.Xu=function(z){this.U.Xu(z)}; g.h.dispose=function(){this.Kt()||(g.DW("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),mD(this,3));g.r6.prototype.dispose.call(this)}; g.h.zT=function(){wDG(this);to0(this);zG0(this);g.qC(this.J);this.J=NaN;g.qC(this.oC);this.oC=NaN;this.L=null;g.Um(this.cX);this.cX.length=0;this.U.dispose();g.r6.prototype.zT.call(this);this.K=this.W=this.V=this.Y=this.U=null}; g.h.aK=function(z){if(!this.V||this.V.length===0)return!1;for(var W=g.l(this.V),K=W.next();!K.done;K=W.next())if(!K.value.capabilities.has(z))return!1;return!0}; g.h.lL4=function(){var z=3;this.Kt()||(z=0,isNaN(this.TK())?this.U.lV()&&isNaN(this.Z)&&(z=1):z=2);return z}; g.h.yR=function(z){ab("Disconnecting with "+z);g.DW("yt.mdx.remote.remoteClient_",null);wDG(this);this.publish("beforeDisconnect",z);z==1&&AM();this.U.disconnect(z);this.dispose()}; g.h.JR=function(){var z=this.Y;this.L&&(z=this.Y.clone(),W5(z,this.L,z.index));return eLs(z)}; g.h.WhX=function(z){var W=this,K=new uj(z);K.videoId&&K.videoId!=this.Y.videoId&&(this.L=K.videoId,g.qC(this.J),this.J=g.OT(function(){if(W.L){var c=W.L;W.L=null;W.Y.videoId!=c&&qV(W,"getNowPlaying")}},5E3)); var B=[];this.Y.listId==K.listId&&this.Y.videoId==K.videoId&&this.Y.index==K.index||B.push("remoteQueueChange");this.Y.playerState==K.playerState&&this.Y.volume==K.volume&&this.Y.muted==K.muted&&Ee(this.Y)==Ee(K)&&g.Ik(this.Y.trackData)==g.Ik(K.trackData)||B.push("remotePlayerChange");this.Y.reset(z);g.Mt(B,function(c){this.publish(c)},this)}; g.h.DS=function(){var z=this.U.getDeviceId(),W=g.Ap(this.V,function(K){return K.type=="REMOTE_CONTROL"&&K.id!=z}); return W?W.id:""}; g.h.TK=function(){return this.U.vM()}; g.h.EB=function(){return this.K||"UNSUPPORTED"}; g.h.Xe=function(){return this.W||""}; g.h.J_=function(){!isNaN(this.TK())&&this.U.QW()}; g.h.SIX=function(z,W){qV(this,z,W);yCs(this)}; g.h.T6=function(){var z=g.lq("SAPISID","")||g.lq("__Secure-1PAPISID")||"",W=g.lq("__Secure-3PAPISID","")||"";if(!z&&!W)return"";z=g.Jx(g.Z4(z),2);W=g.Jx(g.Z4(W),2);return g.Jx(g.Z4(","+z+","+W),2)}; j5.prototype.subscribe=j5.prototype.subscribe;j5.prototype.unsubscribeByKey=j5.prototype.Us;j5.prototype.getProxyState=j5.prototype.lL4;j5.prototype.disconnect=j5.prototype.yR;j5.prototype.getPlayerContextData=j5.prototype.JR;j5.prototype.setPlayerContextData=j5.prototype.WhX;j5.prototype.getOtherConnectedRemoteId=j5.prototype.DS;j5.prototype.getReconnectTimeout=j5.prototype.TK;j5.prototype.getAutoplayMode=j5.prototype.EB;j5.prototype.getAutoplayVideoId=j5.prototype.Xe;j5.prototype.reconnect=j5.prototype.J_; j5.prototype.sendMessage=j5.prototype.SIX;j5.prototype.getXsrfToken=j5.prototype.T6;j5.prototype.isCapabilitySupportedOnConnectedDevices=j5.prototype.aK;g.Y(z5j,QN);g.h=z5j.prototype;g.h.n0=function(z){return this.AZ.$_gs(z)}; g.h.contains=function(z){return!!this.AZ.$_c(z)}; g.h.get=function(z){return this.AZ.$_g(z)}; g.h.start=function(){this.AZ.$_st()}; g.h.add=function(z,W,K){this.AZ.$_a(z,W,K)}; g.h.remove=function(z,W,K){this.AZ.$_r(z,W,K)}; g.h.Ew=function(z,W,K,B){this.AZ.$_un(z,W,K,B)}; g.h.zT=function(){for(var z=this.Y.length,W=0;W1&&!this.S.getOption("remote","quickCast")?(this.iB=g.r_(z,this.Y,this),this.Ae(g.OQ(z,this.Y)),z=this.S.getOption("remote","currentReceiver"),z=this.Y(z),this.options[z]&&this.QV(z),this.enable(!0)):this.enable(!1)}; Qy.prototype.Y=function(z){return z.key}; Qy.prototype.I4=function(z){return z==="cast-selector-receiver"?"Transmitir\u2026":this.iB[z].name}; Qy.prototype.UI=function(z){g.rB.prototype.UI.call(this,z);this.S.setOption("remote","currentReceiver",this.iB[z]);this.rd.SV()};g.Y(oF0,g.Sl);g.h=oF0.prototype; g.h.create=function(){var z=this.player.D(),W=g.LX(z);z={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:z.X("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:z.X("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:z.X("enable_cast_short_lived_lounge_token")};Vo9(W,z);this.subscriptions.push(g.dv("yt-remote-before-disconnect",this.gOC,this));this.subscriptions.push(g.dv("yt-remote-connection-change",this.BBt,this));this.subscriptions.push(g.dv("yt-remote-receiver-availability-change",this.hU, this));this.subscriptions.push(g.dv("yt-remote-auto-connect",this.MhC,this));this.subscriptions.push(g.dv("yt-remote-receiver-resumed",this.IWL,this));this.subscriptions.push(g.dv("mdx-privacy-popup-confirm",this.DgC,this));this.subscriptions.push(g.dv("mdx-privacy-popup-cancel",this.h1a,this));this.hU()}; g.h.load=function(){this.player.cancelPlayback();g.Sl.prototype.load.call(this);this.gF=new tDH(this.player.D(),this);this.player.wM(this.gF);this.cH=new JVQ(this,this.player,this.cz);var z=(z=vs7())?z.currentTime:0;var W=km7()?new Ue(i3(),void 0):null;z==0&&W&&(z=Ee(hM(W)));z!==0&&this.ZG(z);T7_(this,this.DA,this.DA);this.player.jL(6)}; g.h.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.qX();this.HM=this.Is;g.LA(this.cH,this.cz);this.cz=this.gF=this.cH=null;g.Sl.prototype.unload.call(this);this.player.jL(5);GZ(this)}; g.h.zT=function(){g.gb(this.subscriptions);g.Sl.prototype.zT.call(this)}; g.h.S0=function(z){var W=g.d6.apply(1,arguments);this.loaded&&this.cH.W7.apply(this.cH,[z].concat(g.EX(W)))}; g.h.getAdState=function(){return this.Kn}; g.h.QK=function(){return this.cz?hM(this.cz).QK:!1}; g.h.K0=function(){return this.cz?hM(this.cz).K0:!1}; g.h.ZG=function(z,W){this.Rd=z||0;this.player.publish("progresssync",z,W);this.player.OA("onVideoProgress",z||0)}; g.h.getCurrentTime=function(){return this.Rd}; g.h.getDuration=function(){return hM(this.cz).getDuration()||0}; g.h.I1=function(){var z=hM(this.cz);return z.L?z.Y+L5(z):z.Y}; g.h.Tn=function(){return hM(this.cz).J}; g.h.hO=function(){return ZW9(hM(this.cz))}; g.h.Zg=function(){var z=hM(this.cz);return z.U>0?z.U+L5(z):z.U}; g.h.getProgressState=function(){var z=hM(this.cz),W=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:z.playerState!=1081&&this.player.Ng(),clipEnd:W.clipEnd,clipStart:W.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.I1(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Tn(),seekableEnd:this.hO(),seekableStart:this.Zg(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.h.isAtLiveHead=function(){return ZW9(hM(this.cz))-this.getCurrentTime()<=1}; g.h.nextVideo=function(){this.cz&&this.cz.nextVideo()}; g.h.pZ=function(){this.cz&&this.cz.pZ()}; g.h.gOC=function(z){z===1&&(this.wj=this.cz?hM(this.cz):null)}; g.h.BBt=function(){var z=km7()?new Ue(i3(),void 0):null;if(z){var W=this.HM;this.loaded&&this.unload();this.cz=z;this.wj=null;W.key!==this.Is.key&&(this.HM=W,this.load())}else g.iP(this.cz),this.cz=null,this.loaded&&(this.unload(),(z=this.wj)&&z.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(z.videoId,Ee(z)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.h.hU=function(){var z=[this.Is],W=z.concat,K=Df9();sV()&&g.VO("yt-remote-cast-available")&&K.push({key:"cast-selector-receiver",name:"Cast..."});this.iB=W.call(z,K);z=jrj()||this.Is;Jy(this,z);this.player.OA("onMdxReceiversChange")}; g.h.MhC=function(){var z=jrj();Jy(this,z)}; g.h.IWL=function(){this.HM=jrj()}; g.h.DgC=function(){this.E5=!0;GZ(this);CN=!1;kJ&&af(kJ,1);kJ=null}; g.h.h1a=function(){this.E5=!1;GZ(this);Jy(this,this.Is);this.HM=this.Is;CN=!1;kJ=null;this.player.playVideo()}; g.h.VV=function(z,W){switch(z){case "casting":return this.loaded;case "receivers":return this.iB;case "currentReceiver":return W&&(W.key==="cast-selector-receiver"?OI7():Jy(this,W)),this.loaded?this.HM:this.Is;case "quickCast":return this.iB.length===2&&this.iB[1].key==="cast-selector-receiver"?(W&&OI7(),!0):!1}}; g.h.rD=function(){this.cz.rD()}; g.h.Z8=function(){return!1}; g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.h.isLoggedIn=function(){var z,W;return((z=g.Jt("PLAYER_CONFIG"))==null?void 0:(W=z.args)==null?void 0:W.authuser)!==void 0?!0:!(!g.Jt("SESSION_INDEX")&&!g.Jt("LOGGED_IN"))};g.py("remote",oF0);})(_yt_player);