123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750 |
- (function(g){var window=this;'use strict';var NO6=function(h){if(h instanceof g.jX)return h;if(typeof h.WY=="function")return h.WY(!1);if(g.sI(h)){var W=0,c=new g.jX;c.next=function(){for(;;){if(W>=h.length)return g.ZZ;if(W in h)return g.a5(h[W++]);W++}};
- return c}throw Error("Not implemented");},XEt=function(h,W,c){if(g.sI(h))g.gX(h,W,c);
- else for(h=NO6(h);;){var V=h.next();if(V.done)break;W.call(c,V.value,void 0,h)}},W4=function(h){g.By(h,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Gt()).toString(36));
- return h},c4=function(h,W,c){Array.isArray(c)||(c=[String(c)]);
- g.pUp(h.Y,W,c)},tnX=function(h,W){var c=[];
- XEt(W,function(V){try{var H=g.Lc.prototype.W.call(this,V,!0)}catch(B){if(B=="Storage: Invalid value was encountered")return;throw B;}H===void 0?c.push(V):g.kdD(H)&&c.push(V)},h);
- return c},vZc=function(h,W){tnX(h,W).forEach(function(c){g.Lc.prototype.remove.call(this,c)},h)},mUI=function(h){if(h.hq){if(h.hq.locationOverrideToken)return{locationOverrideToken:h.hq.locationOverrideToken};
- if(h.hq.latitudeE7!=null&&h.hq.longitudeE7!=null)return{latitudeE7:h.hq.latitudeE7,longitudeE7:h.hq.longitudeE7}}return null},oZ6=function(h,W){g.el(h,W)||h.push(W)},pEf=function(h){var W=0,c;
- for(c in h)W++;return W},I3X=function(h,W){return g.uN(h,W)},Y_X=function(h){try{return g.k5.JSON.parse(h)}catch(W){}h=String(h);
- if(/^\s*$/.test(h)?0:/^[\],:{}\s\u2028\u2029]*$/.test(h.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("("+h+")")}catch(W){}throw Error("Invalid JSON string: "+h);},V0=function(h){if(g.k5.JSON)try{return g.k5.JSON.parse(h)}catch(W){}return Y_X(h)},OuX=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/channel/opened",g.We("channel_type"))},S_2=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/channel/closed",g.We("channel_type"))},gZX=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/channel/message_received",g.We("channel_type"))},DUS=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/channel/success")},wEc=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/channel/error",g.We("channel_type"),g.We("error_type"))},k7X=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},hIK=function(){var h=$I();
- this.X=h;h.Ye("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},WfU=function(h,W,c,V){var H=new g.kQ(null);
- h&&g.hj(H,h);W&&g.Wy(H,W);c&&g.cy(H,c);V&&(H.W=V);return H},cc2=function(h,W){return new g.gH(h,W)},sl=function(h,W){return Object.prototype.hasOwnProperty.call(h,W)},VOX=function(h,W){return h===W},H4=function(h,W){this.W={};
- this.X=[];this.Zo=this.size=0;var c=arguments.length;if(c>1){if(c%2)throw Error("Uneven number of arguments");for(var V=0;V<c;V+=2)this.set(arguments[V],arguments[V+1])}else if(h)if(h instanceof H4)for(c=h.UU(),V=0;V<c.length;V++)this.set(c[V],h.get(c[V]));else for(V in h)this.set(V,h[V])},B4=function(h){if(h.size!=h.X.length){for(var W=0,c=0;W<h.X.length;){var V=h.X[W];
- sl(h.W,V)&&(h.X[c++]=V);W++}h.X.length=c}if(h.size!=h.X.length){W={};for(V=c=0;c<h.X.length;){var H=h.X[c];sl(W,H)||(h.X[V++]=H,W[H]=1);c++}h.X.length=V}},El=function(h){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 H4;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";h&&(this.id=h.id||h.name,this.name=h.name,this.clientName=h.clientName?h.clientName.toUpperCase():"UNKNOWN_INTERFACE",
- this.app=h.app,this.type=h.type||"REMOTE_CONTROL",this.username=h.user||"",this.avatar=h.userAvatarUri||"",this.obfuscatedGaiaId=h.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=h.ownerObfuscatedGaiaId||"",this.theme=h.theme||"u",$CS(this,h.capabilities||""),sxX(this,h.compatibleSenderThemes||""),HbU(this,h.experiments||""),this.brand=h.brand||"",this.model=h.model||"",this.year=h.year||0,this.os=h.os||"",this.osVersion=h.osVersion||"",this.chipset=h.chipset||"",this.mdxDialServerType=h.mdxDialServerType||
- "MDX_DIAL_SERVER_TYPE_UNKNOWN",h=h.deviceInfo)&&(h=JSON.parse(h),this.brand=h.brand||"",this.model=h.model||"",this.year=h.year||0,this.os=h.os||"",this.osVersion=h.osVersion||"",this.chipset=h.chipset||"",this.clientName=h.clientName?h.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=h.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},$CS=function(h,W){h.capabilities.clear();
- g.Lf(W.split(","),g.uK(I3X,BJ$)).forEach(function(c){h.capabilities.add(c)})},sxX=function(h,W){h.compatibleSenderThemes.clear();
- g.Lf(W.split(","),g.uK(I3X,E2l)).forEach(function(c){h.compatibleSenderThemes.add(c)})},HbU=function(h,W){h.experiments.clear();
- W.split(",").forEach(function(c){h.experiments.add(c)})},RZ=function(h){h=h||{};
- this.name=h.name||"";this.id=h.id||h.screenId||"";this.token=h.token||h.loungeToken||"";this.uuid=h.uuid||h.dialId||"";this.idType=h.screenIdType||"normal"},Ji=function(h,W){return!!W&&(h.id==W||h.uuid==W)},RIc=function(h){return{name:h.name,
- screenId:h.id,loungeToken:h.token,dialId:h.uuid,screenIdType:h.idType}},Jct=function(h){return new RZ(h)},UC$=function(h){return Array.isArray(h)?g.xw(h,Jct):[]},ug=function(h){return h?'{name:"'+h.name+'",id:'+h.id.substr(0,6)+"..,token:"+((h.token?".."+h.token.slice(-6):"-")+",uuid:"+(h.uuid?".."+h.uuid.slice(-6):"-")+",idType:"+h.idType+"}"):"null"},CWS=function(h){return Array.isArray(h)?"["+g.xw(h,ug).join(",")+"]":"null"},MOu=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
- function(h){var W=Math.random()*16|0;
- return(h=="x"?W:W&3|8).toString(16)})},Fff=function(h){return g.xw(h,function(W){return{key:W.id,
- name:W.name}})},yc6=function(h,W){return g.jl(h,function(c){return c||W?!c!=!W?!1:c.id==W.id:!0})},dC=function(h,W){return g.jl(h,function(c){return Ji(c,W)})},PW2=function(){var h=(0,g.QY)();
- h&&vZc(h,h.X.WY(!0))},GU=function(){var h=g.KS("yt-remote-connected-devices")||[];
- g.Y6(h);return h},fX6=function(h){if(h.length==0)return[];
- var W=h[0].indexOf("#"),c=W==-1?h[0]:h[0].substring(0,W);return g.xw(h,function(V,H){return H==0?V:V.substring(c.length)})},bb2=function(h){g.iL("yt-remote-connected-devices",h,86400)},ZR=function(){if(TJt)return TJt;
- var h=g.KS("yt-remote-device-id");h||(h=MOu(),g.iL("yt-remote-device-id",h,31536E3));for(var W=GU(),c=1,V=h;g.el(W,V);)c++,V=h+"#"+c;return TJt=V},NJS=function(){var h=GU(),W=ZR();
- g.Uh()&&g.Sl(h,W);h=fX6(h);if(h.length==0)try{g.MC("remote_sid")}catch(c){}else try{g.UB("remote_sid",h.join(","),-1)}catch(c){}},XfU=function(){return g.KS("yt-remote-session-browser-channel")},tO2=function(){return g.KS("yt-remote-local-screens")||[]},v2f=function(){g.iL("yt-remote-lounge-token-expiration",!0,86400)},mCu=function(h){h.length>5&&(h=h.slice(h.length-5));
- var W=g.xw(tO2(),function(V){return V.loungeToken}),c=g.xw(h,function(V){return V.loungeToken});
- g.l6(c,function(V){return!g.el(W,V)})&&v2f();
- g.iL("yt-remote-local-screens",h,31536E3)},rC=function(h){h||(g.AP("yt-remote-session-screen-id"),g.AP("yt-remote-session-video-id"));
- NJS();h=GU();g.QU(h,ZR());bb2(h)},o2U=function(){if(!qr){var h=g.MM();
- h&&(qr=new g.eQ(h))}},pff=function(){o2U();
- return qr?!!qr.get("yt-remote-use-staging-server"):!1},xI=function(h,W){g.Ys[h]=!0;
- var c=g.pj();c&&c.publish.apply(c,arguments);g.Ys[h]=!1},IX2=function(){},$I=function(){if(!lg){lg=new g.bZ(new IX2);
- var h=g.rJ("client_streamz_web_flush_count",-1);h!==-1&&(lg.G=h)}return lg},YBu=function(){var h=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
- return h?parseInt(h[1],10):0},Ob2=function(h){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+h)!=-1||document.currentScript.src.indexOf("&"+h)!=-1)},SB6=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},nX=function(h){h.length?g2U(h.shift(),function(){nX(h)}):DC6()},wf6=function(h){return"chrome-extension://"+h+"/cast_sender.js"},g2U=function(h,W,c){var V=document.createElement("script");
- V.onerror=W;c&&(V.onload=c);g.a0(V,g.nu(h));(document.head||document.documentElement).appendChild(V)},kNU=function(){var h=YBu(),W=[];
- if(h>1){var c=h-1;W.push("//www.gstatic.com/eureka/clank/"+h+"/cast_sender.js");W.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}return W},DC6=function(){var h=SB6();
- h&&h(!1,"No cast extension found")},W1S=function(){if(hO$){var h=2,W=SB6(),c=function(){h--;
- h==0&&W&&W(!0)};
- window.__onGCastApiAvailable=c;g2U("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",DC6,c)}},cPt=function(){W1S();
- var h=kNU();h.push("//www.gstatic.com/eureka/clank/cast_sender.js");nX(h)},$z6=function(){W1S();
- var h=kNU();h.push.apply(h,g.rN(Vtu.map(wf6)));h.push("//www.gstatic.com/eureka/clank/cast_sender.js");nX(h)},jj=function(h,W,c){g.N.call(this);
- this.N=c!=null?(0,g.JS)(h,c):h;this.pw=W;this.C=(0,g.JS)(this.nF,this);this.X=!1;this.W=0;this.G=this.Fl=null;this.Y=[]},aZ=function(){},sIc=function(){g.mm.call(this,"p")},HSf=function(){g.mm.call(this,"o")},Ek$=function(){return BQI=BQI||new g.Rn},RO2=function(h){g.mm.call(this,"serverreachability",h)},ej=function(h){var W=Ek$();
- W.dispatchEvent(new RO2(W,h))},JPc=function(h){g.mm.call(this,"statevent",h)},zU=function(h){var W=Ek$();
- W.dispatchEvent(new JPc(W,h))},uRX=function(h,W,c,V){g.mm.call(this,"timingevent",h);
- this.size=W;this.rtt=c;this.retries=V},Q0=function(h,W){if(typeof h!=="function")throw Error("Fn must not be null and must be a function");
- return g.k5.setTimeout(function(){h()},W)},LX=function(){},ig=function(h,W,c,V){this.G=h;
- this.Y=W;this.Sx=c;this.qU=V||1;this.Ak=new g.dH(this);this.Mn=45E3;this.Nn=null;this.N=!1;this.T=this.Jk=this.Z=this.CM=this.Pk=this.Ef=this.XI=null;this.Wk=[];this.X=null;this.S=0;this.C=this.DH=null;this.uW=-1;this.mW=!1;this.rE=0;this.yg=null;this.hI=this.Rz=this.lW=this.zV=!1;this.W=new dzS},dzS=function(){this.W=null;
- this.X="";this.G=!1},ZSt=function(h,W,c){h.CM=1;
- h.Z=W4(W.clone());h.T=c;h.zV=!0;GRf(h,null)},GRf=function(h,W){h.Pk=Date.now();
- KX(h);h.Jk=h.Z.clone();c4(h.Jk,"t",h.qU);h.S=0;var c=h.G.CM;h.W=new dzS;h.X=rP6(h.G,c?W:null,!h.T);h.rE>0&&(h.yg=new g.O5((0,g.JS)(h.Lr,h,h.X),h.rE));h.Ak.listen(h.X,"readystatechange",h.CF);W=h.Nn?g.qx(h.Nn):{};h.T?(h.DH||(h.DH="POST"),W["Content-Type"]="application/x-www-form-urlencoded",h.X.send(h.Jk,h.DH,h.T,W)):(h.DH="GET",h.X.send(h.Jk,h.DH,null,W));ej(1)},xzX=function(h){if(!qhU(h))return g.Yv(h.X);
- var W=g.OL(h.X);if(W==="")return"";var c="",V=W.length,H=g.pW(h.X)==4;if(!h.W.W){if(typeof TextDecoder==="undefined")return Ai(h),Ul(h),"";h.W.W=new g.k5.TextDecoder}for(var B=0;B<V;B++)h.W.G=!0,c+=h.W.W.decode(W[B],{stream:!(H&&B==V-1)});W.length=0;h.W.X+=c;h.S=0;return h.W.X},qhU=function(h){return h.X?h.DH=="GET"&&h.CM!=2&&h.G.BV:!1},jIU=function(h,W){var c=h.S,V=W.indexOf("\n",c);
- if(V==-1)return lL6;c=Number(W.substring(c,V));if(isNaN(c))return nkX;V+=1;if(V+c>W.length)return lL6;W=W.slice(V,V+c);h.S=V+c;return W},KX=function(h){h.Ef=Date.now()+h.Mn;
- aLU(h,h.Mn)},aLU=function(h,W){if(h.XI!=null)throw Error("WatchDog timer not null");
- h.XI=Q0((0,g.JS)(h.gw,h),W)},eOX=function(h){h.XI&&(g.k5.clearTimeout(h.XI),h.XI=null)},Ul=function(h){h.G.xx()||h.mW||zOI(h.G,h)},Ai=function(h){eOX(h);
- g.hA(h.yg);h.yg=null;h.Ak.removeAll();if(h.X){var W=h.X;h.X=null;W.abort();W.dispose()}},Mt2=function(h,W){try{var c=h.G;
- if(c.xL!=0&&(c.X==h||QIU(c.W,h)))if(!h.Rz&&QIU(c.W,h)&&c.xL==3){try{var V=c.d3.X.parse(W)}catch(z){V=null}if(Array.isArray(V)&&V.length==3){var H=V;if(H[0]==0)a:{if(!c.Z){if(c.X)if(c.X.Pk+3E3<h.Pk)CX(c),Mr(c);else break a;L1t(c);zU(18)}}else c.Tx=H[1],0<c.Tx-c.yg&&H[2]<37500&&c.Rz&&c.Wk==0&&!c.XI&&(c.XI=Q0((0,g.JS)(c.jT,c),6E3));if(iSS(c.W)<=1&&c.fR){try{c.fR()}catch(z){}c.fR=void 0}}else FQ(c,11)}else if((h.Rz||c.X==h)&&CX(c),!g.Cr(W))for(H=c.d3.X.parse(W),W=0;W<H.length;W++){var B=H[W];c.yg=B[0];
- B=B[1];if(c.xL==2)if(B[0]=="c"){c.Y=B[1];c.qU=B[2];var E=B[3];E!=null&&(c.NJ=E);var J=B[5];J!=null&&typeof J==="number"&&J>0&&(c.rE=1.5*J);V=c;var u=h.BA();if(u){var d=g.Sa(u,"X-Client-Wire-Protocol");if(d){var G=V.W;!G.X&&(g.Mx(d,"spdy")||g.Mx(d,"quic")||g.Mx(d,"h2"))&&(G.Y=G.C,G.X=new Set,G.W&&(K1l(G,G.W),G.W=null))}if(V.zV){var Z=g.Sa(u,"X-HTTP-Session-Id");Z&&(V.q$=Z,g.By(V.Nn,V.zV,Z))}}c.xL=3;c.C&&c.C.SE();c.Zn&&(c.bX=Date.now()-h.Pk);V=c;var r=h;V.U8=AP6(V,V.CM?V.qU:null,V.Sx);if(r.Rz){UzK(V.W,
- r);var q=r,x=V.rE;x&&q.setTimeout(x);q.XI&&(eOX(q),KX(q));V.X=r}else CLu(V);c.G.length>0&&y0(c)}else B[0]!="stop"&&B[0]!="close"||FQ(c,7);else c.xL==3&&(B[0]=="stop"||B[0]=="close"?B[0]=="stop"?FQ(c,7):c.disconnect():B[0]!="noop"&&c.C&&c.C.jE(B),c.Wk=0)}ej(4)}catch(z){}},F1I=function(h,W){this.X=h;
- this.map=W;this.context=null},yPU=function(h){this.C=h||10;
- g.k5.PerformanceNavigationTiming?(h=g.k5.performance.getEntriesByType("navigation"),h=h.length>0&&(h[0].nextHopProtocol=="hq"||h[0].nextHopProtocol=="h2")):h=!!(g.k5.chrome&&g.k5.chrome.loadTimes&&g.k5.chrome.loadTimes()&&g.k5.chrome.loadTimes().wasFetchedViaSpdy);this.Y=h?this.C:1;this.X=null;this.Y>1&&(this.X=new Set);this.W=null;this.G=[]},PLX=function(h){return h.W?!0:h.X?h.X.size>=h.Y:!1},iSS=function(h){return h.W?1:h.X?h.X.size:0},QIU=function(h,W){return h.W?h.W==W:h.X?h.X.has(W):!1},K1l=
- function(h,W){h.X?h.X.add(W):h.W=W},UzK=function(h,W){h.W&&h.W==W?h.W=null:h.X&&h.X.has(W)&&h.X.delete(W)},fLc=function(h){if(h.W!=null)return h.G.concat(h.W.Wk);
- if(h.X!=null&&h.X.size!==0){var W=h.G;h=g.e(h.X.values());for(var c=h.next();!c.done;c=h.next())W=W.concat(c.value.Wk);return W}return g.Mu(h.G)},bSU=function(h,W){var c=new LX;
- if(g.k5.Image){var V=new Image;V.onload=g.uK(P4,c,"TestLoadImage: loaded",!0,W,V);V.onerror=g.uK(P4,c,"TestLoadImage: error",!1,W,V);V.onabort=g.uK(P4,c,"TestLoadImage: abort",!1,W,V);V.ontimeout=g.uK(P4,c,"TestLoadImage: timeout",!1,W,V);g.k5.setTimeout(function(){if(V.ontimeout)V.ontimeout()},1E4);
- V.src=h}else W(!1)},TQc=function(h,W){var c=new LX,V=new AbortController,H=setTimeout(function(){V.abort();
- P4(c,"TestPingServer: timeout",!1,W)},1E4);
- fetch(h,{signal:V.signal}).then(function(B){clearTimeout(H);B.ok?P4(c,"TestPingServer: ok",!0,W):P4(c,"TestPingServer: server error",!1,W)}).catch(function(){clearTimeout(H);
- P4(c,"TestPingServer: error",!1,W)})},P4=function(h,W,c,V,H){try{H&&(H.onload=null,H.onerror=null,H.onabort=null,H.ontimeout=null),V(c)}catch(B){}},NQS=function(){this.X=new aZ},fX=function(h,W,c){return c&&c.D9?c.D9[h]||W:W},Xtl=function(h){this.G=[];
- this.qU=this.U8=this.Nn=this.Sx=this.X=this.q$=this.zV=this.mW=this.S=this.uW=this.T=null;this.Uy=this.Jk=0;this.Lj=fX("failFast",!1,h);this.Rz=this.XI=this.Z=this.N=this.C=null;this.U5=!0;this.Tx=this.yg=-1;this.hI=this.Wk=this.Pk=0;this.Qj=fX("baseRetryDelayMs",5E3,h);this.H9=fX("retryDelaySeedMs",1E4,h);this.Ns=fX("forwardChannelMaxRetries",2,h);this.iX=fX("forwardChannelRequestTimeoutMs",2E4,h);this.hq=h&&h.KJB||void 0;this.mF=h&&h.L1V||void 0;this.BV=h&&h.CRk||!1;this.rE=void 0;this.CM=h&&h.LeO||
- !1;this.Y="";this.W=new yPU(h&&h.eXk);this.d3=new NQS;this.Ak=h&&h.ngI||!1;this.Ef=h&&h.P0M||!1;this.Ak&&this.Ef&&(this.Ef=!1);this.nj=h&&h.y0I||!1;h&&h.j4k&&(this.U5=!1);this.Zn=!this.Ak&&this.U5&&h&&h.OnM||!1;this.RR=void 0;h&&h.xX&&h.xX>0&&(this.RR=h.xX);this.fR=void 0;this.bX=0;this.Mn=!1;this.lW=this.DH=null},Mr=function(h){h.X&&(ttI(h),h.X.cancel(),h.X=null)},vkI=function(h){Mr(h);
- h.Z&&(g.k5.clearTimeout(h.Z),h.Z=null);CX(h);h.W.cancel();h.N&&(typeof h.N==="number"&&g.k5.clearTimeout(h.N),h.N=null)},y0=function(h){PLX(h.W)||h.N||(h.N=!0,g.nW(h.mS,h),h.Pk=0)},ok6=function(h,W){if(iSS(h.W)>=h.W.Y-(h.N?1:0))return!1;
- if(h.N)return h.G=W.Wk.concat(h.G),!0;if(h.xL==1||h.xL==2||h.Pk>=(h.Lj?0:h.Ns))return!1;h.N=Q0((0,g.JS)(h.mS,h,W),mzt(h,h.Pk));h.Pk++;return!0},ILu=function(h,W){var c;
- W?c=W.Sx:c=h.Jk++;var V=h.Nn.clone();g.By(V,"SID",h.Y);g.By(V,"RID",c);g.By(V,"AID",h.yg);bg(h,V);h.S&&h.T&&g.ue(V,h.S,h.T);c=new ig(h,h.Y,c,h.Pk+1);h.S===null&&(c.Nn=h.T);W&&(h.G=W.Wk.concat(h.G));W=pt6(h,c,1E3);c.setTimeout(Math.round(h.iX*.5)+Math.round(h.iX*.5*Math.random()));K1l(h.W,c);ZSt(c,V,W)},bg=function(h,W){h.mW&&g.k6(h.mW,function(c,V){g.By(W,V,c)});
- h.C&&g.k6({},function(c,V){g.By(W,V,c)})},pt6=function(h,W,c){c=Math.min(h.G.length,c);
- var V=h.C?(0,g.JS)(h.C.ST,h.C,h):null;a:{for(var H=h.G,B=-1;;){var E=["count="+c];B==-1?c>0?(B=H[0].X,E.push("ofs="+B)):B=0:E.push("ofs="+B);for(var J=!0,u=0;u<c;u++){var d=H[u].X,G=H[u].map;d-=B;if(d<0)B=Math.max(0,H[u].X-100),J=!1;else try{d="req"+d+"_"||"";try{var Z=G instanceof Map?G:Object.entries(G);for(var r=g.e(Z),q=r.next();!q.done;q=r.next()){var x=g.e(q.value),z=x.next().value,L=x.next().value,M=L;g.H2(L)&&(M=g.Nd(L));E.push(d+z+"="+encodeURIComponent(M))}}catch(U){throw E.push(d+"type="+
- encodeURIComponent("_badmap")),U;}}catch(U){V&&V(G)}}if(J){Z=E.join("&");break a}}Z=void 0}h=h.G.splice(0,c);W.Wk=h;return Z},CLu=function(h){h.X||h.Z||(h.hI=1,g.nW(h.HK,h),h.Wk=0)},L1t=function(h){if(h.X||h.Z||h.Wk>=3)return!1;
- h.hI++;h.Z=Q0((0,g.JS)(h.HK,h),mzt(h,h.Wk));h.Wk++;return!0},ttI=function(h){h.DH!=null&&(g.k5.clearTimeout(h.DH),h.DH=null)},Yhu=function(h){h.X=new ig(h,h.Y,"rpc",h.hI);
- h.S===null&&(h.X.Nn=h.T);h.X.rE=0;var W=h.U8.clone();g.By(W,"RID","rpc");g.By(W,"SID",h.Y);g.By(W,"AID",h.yg);g.By(W,"CI",h.Rz?"0":"1");!h.Rz&&h.RR&&g.By(W,"TO",h.RR);g.By(W,"TYPE","xmlhttp");bg(h,W);h.S&&h.T&&g.ue(W,h.S,h.T);h.rE&&h.X.setTimeout(h.rE);var c=h.X;h=h.qU;c.CM=1;c.Z=W4(W.clone());c.T=null;c.zV=!0;GRf(c,h)},CX=function(h){h.XI!=null&&(g.k5.clearTimeout(h.XI),h.XI=null)},zOI=function(h,W){var c=null;
- if(h.X==W){CX(h);ttI(h);h.X=null;var V=2}else if(QIU(h.W,W))c=W.Wk,UzK(h.W,W),V=1;else return;if(h.xL!=0)if(W.N)if(V==1){c=W.T?W.T.length:0;W=Date.now()-W.Pk;var H=h.Pk;V=Ek$();V.dispatchEvent(new uRX(V,c,W,H));y0(h)}else CLu(h);else{var B=W.uW;H=W.getLastError();if(H==3||H==0&&B>0||!(V==1&&ok6(h,W)||V==2&&L1t(h)))switch(c&&c.length>0&&(W=h.W,W.G=W.G.concat(c)),H){case 1:FQ(h,5);break;case 4:FQ(h,10);break;case 3:FQ(h,6);break;default:FQ(h,2)}}},mzt=function(h,W){var c=h.Qj+Math.floor(Math.random()*
- h.H9);
- h.isActive()||(c*=2);return c*W},FQ=function(h,W){if(W==2){var c=(0,g.JS)(h.jdB,h),V=h.mF,H=!V;
- V=new g.kQ(V||"//www.google.com/images/cleardot.gif");g.k5.location&&g.k5.location.protocol=="http"||g.hj(V,"https");W4(V);H?bSU(V.toString(),c):TQc(V.toString(),c)}else zU(2);h.xL=0;h.C&&h.C.Cr(W);OSI(h);vkI(h)},OSI=function(h){h.xL=0;
- h.lW=[];if(h.C){var W=fLc(h.W);if(W.length!=0||h.G.length!=0)g.F6(h.lW,W),g.F6(h.lW,h.G),h.W.G.length=0,g.Mu(h.G),h.G.length=0;h.C.gB()}},Shl=function(h){if(h.xL==0)return h.lW;
- var W=[];g.F6(W,fLc(h.W));g.F6(W,h.G);return W},AP6=function(h,W,c){var V=g.E5(c);
- V.X!=""?(W&&g.Wy(V,W+"."+V.X),g.cy(V,V.G)):(V=g.k5.location,V=WfU(V.protocol,W?W+"."+V.hostname:V.hostname,+V.port,c));W=h.zV;c=h.q$;W&&c&&g.By(V,W,c);g.By(V,"VER",h.NJ);bg(h,V);return V},rP6=function(h,W,c){if(W&&!h.CM)throw Error("Can't create secondary domain capable XhrIo object.");
- W=h.BV&&!h.hq?new g.vK(new g.Sc({M2:c})):new g.vK(h.hq);W.S=h.CM;return W},gkc=function(){},Dz2=function(){},Nr=function(h,W){g.Rn.call(this);
- this.X=new Xtl(W);this.C=h;this.W=W&&W.h9N||null;h=W&&W.dnW||null;W&&W.BJM&&(h?h["X-Client-Protocol"]="webchannel":h={"X-Client-Protocol":"webchannel"});this.X.T=h;h=W&&W.IOf||null;W&&W.uh&&(h?h["X-WebChannel-Content-Type"]=W.uh:h={"X-WebChannel-Content-Type":W.uh});W&&W.pB&&(h?h["X-WebChannel-Client-Profile"]=W.pB:h={"X-WebChannel-Client-Profile":W.pB});this.X.uW=h;(h=W&&W.J7n)&&!g.Cr(h)&&(this.X.S=h);this.N=W&&W.LeO||!1;this.Y=W&&W.eDV||!1;(W=W&&W.h1)&&!g.Cr(W)&&(this.X.zV=W,g.JB(this.W,W)&&(h=
- this.W,W in h&&delete h[W]));this.G=new TU(this)},wtt=function(h){sIc.call(this);
- h.__headers__&&(this.headers=h.__headers__,this.statusCode=h.__status__,delete h.__headers__,delete h.__status__);var W=h.__sm__;W?this.data=(this.X=g.VW(W))?g.Za(W,this.X):W:this.data=h},kRU=function(h){HSf.call(this);
- this.status=1;this.errorCode=h},TU=function(h){this.X=h},hBU=function(h,W){this.W=h;
- this.X=W},W6$=function(h){return Shl(h.X).map(function(W){var c=h.W;
- W=W.map;"__data__"in W?(W=W.__data__,c=c.Y?Y_X(W):W):c=W;return c})},XQ=function(h,W){if(typeof h!=="function")throw Error("Fn must not be null and must be a function");
- return g.k5.setTimeout(function(){h()},W)},v4=function(h){ti.dispatchEvent(new cZU(ti,h))},cZU=function(h){g.mm.call(this,"statevent",h)},mn=function(h,W,c,V){this.X=h;
- this.Y=W;this.S=c;this.N=V||1;this.W=45E3;this.G=new g.dH(this);this.C=new g.yR;this.C.setInterval(250)},$v2=function(h,W,c){h.iU=1;
- h.Yu=W4(W.clone());h.BX=c;h.zV=!0;VPl(h,null)},sC6=function(h,W,c,V,H){h.iU=1;
- h.Yu=W4(W.clone());h.BX=null;h.zV=c;H&&(h.dP=!1);VPl(h,V)},VPl=function(h,W){h.PD=Date.now();
- Hg2(h);h.rG=h.Yu.clone();c4(h.rG,"t",h.N);h.yS=0;h.v3=h.X.xA(h.X.vD()?W:null);h.Jx>0&&(h.ZN=new g.O5((0,g.JS)(h.RJ,h,h.v3),h.Jx));h.G.listen(h.v3,"readystatechange",h.q4);W=h.tX?g.qx(h.tX):{};h.BX?(h.cw="POST",W["Content-Type"]="application/x-www-form-urlencoded",h.v3.send(h.rG,h.cw,h.BX,W)):(h.cw="GET",h.dP&&!g.Js&&(W.Connection="close"),h.v3.send(h.rG,h.cw,null,W));h.X.r8(1)},RBt=function(h,W){var c=h.yS,V=W.indexOf("\n",c);
- if(V==-1)return Bwf;c=Number(W.substring(c,V));if(isNaN(c))return E4t;V+=1;if(V+c>W.length)return Bwf;W=W.slice(V,V+c);h.yS=V+c;return W},Hg2=function(h){h.IW=Date.now()+h.W;
- JZX(h,h.W)},JZX=function(h,W){if(h.zR!=null)throw Error("WatchDog timer not null");
- h.zR=XQ((0,g.JS)(h.Rj,h),W)},uJX=function(h){h.zR&&(g.k5.clearTimeout(h.zR),h.zR=null)},dvu=function(h){h.X.xx()||h.dY||h.X.Bf(h)},oZ=function(h){uJX(h);
- g.hA(h.ZN);h.ZN=null;h.C.stop();h.G.removeAll();if(h.v3){var W=h.v3;h.v3=null;W.abort();W.dispose()}h.Nm&&(h.Nm=null)},G1U=function(h,W){try{h.X.qJ(h,W),h.X.r8(4)}catch(c){}},rZ6=function(h,W,c,V,H){if(V==0)c(!1);
- else{var B=H||0;V--;Zgc(h,W,function(E){E?c(!0):g.k5.setTimeout(function(){rZ6(h,W,c,V,B)},B)})}},Zgc=function(h,W,c){var V=new Image;
- V.onload=function(){try{pX(V),c(!0)}catch(H){}};
- V.onerror=function(){try{pX(V),c(!1)}catch(H){}};
- V.onabort=function(){try{pX(V),c(!1)}catch(H){}};
- V.ontimeout=function(){try{pX(V),c(!1)}catch(H){}};
- g.k5.setTimeout(function(){if(V.ontimeout)V.ontimeout()},W);
- V.src=h},pX=function(h){h.onload=null;
- h.onerror=null;h.onabort=null;h.ontimeout=null},qGl=function(h){this.X=h;
- this.W=new aZ},xvl=function(h){var W=IZ(h.X,h.GX,"/mail/images/cleardot.gif");
- W4(W);rZ6(W.toString(),5E3,(0,g.JS)(h.GE,h),3,2E3);h.r8(1)},lu2=function(h){var W=h.X.N;
- W!=null?(v4(5),W?(v4(11),YI(h.X,h,!1)):(v4(12),YI(h.X,h,!0))):(h.Xm=new mn(h),h.Xm.tX=h.Mc,W=h.X,W=IZ(W,W.vD()?h.JA:null,h.eZ),v4(5),c4(W,"TYPE","xmlhttp"),sC6(h.Xm,W,!1,h.JA,!1))},n4$=function(h,W,c){this.X=1;
- this.W=[];this.G=[];this.C=new aZ;this.T=h||null;this.N=W!=null?W:null;this.Z=c||!1},jC6=function(h,W){this.X=h;
- this.map=W;this.context=null},aul=function(h,W,c,V){g.mm.call(this,"timingevent",h);
- this.size=W;this.rtt=c;this.retries=V},eB$=function(h){g.mm.call(this,"serverreachability",h)},QCu=function(h){h.Fs(1,0);
- h.Iy=IZ(h,null,h.V_);zB$(h)},L6c=function(h){h.yK&&(h.yK.abort(),h.yK=null);
- h.At&&(h.At.cancel(),h.At=null);h.Ao&&(g.k5.clearTimeout(h.Ao),h.Ao=null);Ol(h);h.PR&&(h.PR.cancel(),h.PR=null);h.g7&&(g.k5.clearTimeout(h.g7),h.g7=null)},ig$=function(h,W){if(h.X==0)throw Error("Invalid operation: sending map when state is closed");
- h.W.push(new jC6(h.KF++,W));h.X!=2&&h.X!=3||zB$(h)},K66=function(h){var W=0;
- h.At&&W++;h.PR&&W++;return W},zB$=function(h){h.PR||h.g7||(h.g7=XQ((0,g.JS)(h.UM,h),0),h.kG=0)},CCc=function(h,W){if(h.X==1){if(!W){h.bz=Math.floor(Math.random()*1E5);
- W=h.bz++;var c=new mn(h,"",W);c.tX=h.A2;var V=AZ2(h),H=h.Iy.clone();g.By(H,"RID",W);g.By(H,"CVER","1");Sj(h,H);$v2(c,H,V);h.PR=c;h.X=2}}else h.X==3&&(W?Uv6(h,W):h.W.length==0||h.PR||Uv6(h))},Uv6=function(h,W){if(W)if(h.e3>6){h.W=h.G.concat(h.W);
- h.G.length=0;var c=h.bz-1;W=AZ2(h)}else c=W.S,W=W.BX;else c=h.bz++,W=AZ2(h);var V=h.Iy.clone();g.By(V,"SID",h.Y);g.By(V,"RID",c);g.By(V,"AID",h.Qe);Sj(h,V);c=new mn(h,h.Y,c,h.kG+1);c.tX=h.A2;c.setTimeout(1E4+Math.round(1E4*Math.random()));h.PR=c;$v2(c,V,W)},Sj=function(h,W){h.Mh&&(h=h.Mh.cK())&&g.k6(h,function(c,V){g.By(W,V,c)})},AZ2=function(h){var W=Math.min(h.W.length,1E3),c=["count="+W];
- if(h.e3>6&&W>0){var V=h.W[0].X;c.push("ofs="+V)}else V=0;for(var H={},B=0;B<W;H={vy:void 0},B++){H.vy=h.W[B].X;var E=h.W[B].map;H.vy=h.e3<=6?B:H.vy-V;try{g.k6(E,function(J){return function(u,d){c.push("req"+J.vy+"_"+d+"="+encodeURIComponent(u))}}(H))}catch(J){c.push("req"+H.vy+"_type="+encodeURIComponent("_badmap"))}}h.G=h.G.concat(h.W.splice(0,W));
- return c.join("&")},MPI=function(h){h.At||h.Ao||(h.S=1,h.Ao=XQ((0,g.JS)(h.sM,h),0),h.DL=0)},yZ6=function(h){if(h.At||h.Ao||h.DL>=3)return!1;
- h.S++;h.Ao=XQ((0,g.JS)(h.sM,h),F66(h,h.DL));h.DL++;return!0},YI=function(h,W,c){h.Hf=h.N==null?c:!h.N;
- h.Pj=W.T0;h.Z||QCu(h)},Ol=function(h){h.Ej!=null&&(g.k5.clearTimeout(h.Ej),h.Ej=null)},F66=function(h,W){var c=5E3+Math.floor(Math.random()*1E4);
- h.isActive()||(c*=2);return c*W},gC=function(h,W){if(W==2||W==9){var c=null;
- h.Mh&&(c=null);var V=(0,g.JS)(h.CJk,h);c||(c=new g.kQ("//www.google.com/images/cleardot.gif"),W4(c));Zgc(c.toString(),1E4,V)}else v4(2);PC6(h,W)},PC6=function(h,W){h.X=0;
- h.Mh&&h.Mh.oJ(W);fu6(h);L6c(h)},fu6=function(h){h.X=0;
- h.Pj=-1;if(h.Mh)if(h.G.length==0&&h.W.length==0)h.Mh.TU();else{var W=g.Mu(h.G),c=g.Mu(h.W);h.G.length=0;h.W.length=0;h.Mh.TU(W,c)}},IZ=function(h,W,c){var V=g.E5(c);
- if(V.X!="")W&&g.Wy(V,W+"."+V.X),g.cy(V,V.G);else{var H=window.location;V=WfU(H.protocol,W?W+"."+H.hostname:H.hostname,+H.port,c)}h.f8&&g.k6(h.f8,function(B,E){g.By(V,E,B)});
- g.By(V,"VER",h.e3);Sj(h,V);return V},bgu=function(){},Twu=function(){this.X=[];
- this.W=[]},NwU=function(h){g.mm.call(this,"channelMessage");
- this.message=h},Xp6=function(h){g.mm.call(this,"channelError");
- this.error=h},tPl=function(h,W){this.action=h;
- this.params=W||{}},DR=function(h,W){g.N.call(this);
- this.X=new g.oD(this.PVf,0,this);g.X(this,this.X);this.pw=5E3;this.W=0;if(typeof h==="function")W&&(h=(0,g.JS)(h,W));else if(h&&typeof h.handleEvent==="function")h=(0,g.JS)(h.handleEvent,h);else throw Error("Invalid listener argument");this.G=h},v4K=function(h,W,c,V,H,B,E,J,u,d,G,Z,r,q){c=c===void 0?!1:c;
- V=V===void 0?function(){return""}:V;
- H=H===void 0?!1:H;B=B===void 0?!1:B;E=E===void 0?!1:E;J=J===void 0?function(){return g.AF({})}:J;
- u=u===void 0?!1:u;G=G===void 0?!1:G;Z=Z===void 0?!1:Z;r=r===void 0?!1:r;q=q===void 0?!1:q;this.CM=h;this.XI=W;this.N=new g.ar;this.W=new DR(this.qhW,this);this.X=null;this.S=!1;this.T=null;this.Pk="";this.Wk=this.Z=0;this.G=[];this.hI=c;this.zV=V;this.C=B;this.Nn=J;this.mW=d;this.qU=E;this.DH=null;this.Y=g.AF();this.Sx=H;this.lW=u;this.Ak=G;this.Ef=Z;this.U5=r;this.uW=q;this.rE=new OuX;this.Rz=new S_2;this.Mn=new DUS;this.Jk=new gZX;this.yg=new wEc;this.Zn=new k7X;this.fR=new hIK},ppU=function(h,
- W,c,V,H){mvU(h);
- if(h.X){var B=g.X_("ID_TOKEN"),E=h.X.A2||{};B?E["x-youtube-identity-token"]=B:delete E["x-youtube-identity-token"];h.X.A2=E}o4U(h);V?(V.getState()!=3&&K66(V)==0||V.getState(),h.X.connect(W,c,h.XI,V.Y,V.Qe)):H?h.X.connect(W,c,h.XI,H.sessionId,H.arrayId):h.X.connect(W,c,h.XI)},SG2=function(h,W){return h.U5?!0:h.Ef?Object.values(Iuf).includes(W):h.Ak?!Object.values(YG6).includes(W):h.uW?Object.values(Og6).includes(W):!1},wp2=function(h){var W,c;
- g.P(function(V){if(V.W==1)return g.LU(V,2),g.F(V,g4U(h),2);g.Pd(V);W=h.G;h.G=[];c=W.length;DvS(h,W,c);wC(h);return g.bT(V,0)})},DvS=function(h,W,c){for(var V=0;V<c;++V)ig$(h.X,W[V]);
- wC(h)},wC=function(h){h.publish("handlerOpened");
- h.rE.jz("BROWSER_CHANNEL")},mvU=function(h){if(h.X){var W=h.zV(),c=h.X.A2||{};
- W?c["x-youtube-lounge-xsrf-token"]=W:delete c["x-youtube-lounge-xsrf-token"];h.X.A2=c}},g4U=function(h){if(h.lW)return g.AF();
- if(!h.qU)return k1S(h);h.DH===null&&(h.DH=k1S(h));return h.DH},k1S=function(h){return g.Md(h.Nn().then(function(W){hj$(h,W)}).Mv(function(){}),function(){h.DH=null})},hj$=function(h,W){if(h.X){var c=h.X.A2||{};
- W&&Object.keys(W).length>0?c=Object.assign({},c,W):delete c.Authorization;h.X.A2=c}},o4U=function(h){h.mW&&!h.C&&hj$(h,h.mW())},kI=function(h){this.scheme="https";
- this.port=this.domain="";this.X="/api/lounge";this.W=!0;h=h||document.location.href;var W=Number(g.BA(h)[4]||null)||"";W&&(this.port=":"+W);this.domain=g.E6(h)||"";h=g.TF();h.search("MSIE")>=0&&(h=h.match(/MSIE ([\d.]+)/)[1],g.bN(h,"10.0")<0&&(this.W=!1))},hr=function(h,W){var c=h.X;
- h.W&&(c=h.scheme+"://"+h.domain+h.port+h.X);return g.r0(c+W,{})},WaI=function(h,W){g.Rn.call(this);
- var c=this;this.pR=h();this.pR.subscribe("handlerOpened",this.Z6,this);this.pR.subscribe("handlerClosed",this.onClosed,this);this.pR.subscribe("handlerError",function(V,H){c.onError(H)});
- this.pR.subscribe("handlerMessage",this.onMessage,this);this.X=W},cLu=function(h,W,c){var V=this;
- c=c===void 0?function(){return""}:c;
- var H=H===void 0?new Dz2:H;var B=B===void 0?new g.ar:B;this.pathPrefix=h;this.X=W;this.Pk=c;this.C=B;this.Z=null;this.T=this.S=0;this.channel=null;this.N=0;this.G=new DR(function(){V.G.isActive();var E;((E=V.channel)==null?void 0:iSS((new hBU(E,E.X)).X.W))===0&&V.connect(V.Z,V.S)});
- this.Y={};this.W={};this.XI=!1;this.logger=null;this.Wk=[];this.HH=void 0;this.Nn=new OuX;this.DH=new S_2;this.mW=new gZX;this.zV=new wEc},V56=function(h){g.DP(h.channel,"m",function(){h.N=3;
- h.G.reset();h.Z=null;h.S=0;for(var W=g.e(h.Wk),c=W.next();!c.done;c=W.next())c=c.value,h.channel&&h.channel.send(c);h.Wk=[];h.publish("webChannelOpened");h.Nn.jz("WEB_CHANNEL")});
- g.DP(h.channel,"n",function(){h.N=0;h.G.isActive()||h.publish("webChannelClosed");var W,c=(W=h.channel)==null?void 0:W6$(new hBU(W,W.X));c&&(h.Wk=[].concat(g.rN(c)));h.DH.jz("WEB_CHANNEL")});
- g.DP(h.channel,"p",function(W){var c=W.data;c[0]==="gracefulReconnect"?(h.G.start(),h.channel&&h.channel.close()):h.publish("webChannelMessage",new tPl(c[0],c[1]));h.HH=W.statusCode;h.mW.jz("WEB_CHANNEL")});
- g.DP(h.channel,"o",function(){h.HH===401||h.G.start();h.publish("webChannelError");h.zV.jz("WEB_CHANNEL","")})},$0t=function(h){var W=h.Pk();
- W?h.Y["x-youtube-lounge-xsrf-token"]=W:delete h.Y["x-youtube-lounge-xsrf-token"]},sSI=function(h){g.Rn.call(this);
- this.X=h();this.X.subscribe("webChannelOpened",this.cW,this);this.X.subscribe("webChannelClosed",this.onClosed,this);this.X.subscribe("webChannelError",this.onError,this);this.X.subscribe("webChannelMessage",this.onMessage,this)},HjS=function(h,W,c,V,H){function B(){return new v4K(hr(h,"/bc"),W,!1,c,V)}
- c=c===void 0?function(){return""}:c;
- return g.ZX("enable_mdx_web_channel_desktop")?new sSI(function(){return new cLu(hr(h,"/wc"),W,c)}):new WaI(B,H)},JLI=function(){var h=BIU;
- Es2();W1.push(h);Rjl()},c1=function(h,W){Es2();
- var c=uXt(h,String(W));W1.length==0?d0t(c):(Rjl(),g.gX(W1,function(V){V(c)}))},VE=function(h){c1("CP",h)},Es2=function(){W1||(W1=g.c2("yt.mdx.remote.debug.handlers_")||[],g.hS("yt.mdx.remote.debug.handlers_",W1))},d0t=function(h){var W=($U+1)%50;
- $U=W;sD[W]=h;H1||(H1=W==49)},Rjl=function(){var h=W1;
- if(sD[0]){var W=H1?$U:-1,c={};do c={Zx:void 0},W=(W+1)%50,c.Zx=sD[W],g.gX(h,function(V){return function(H){H(V.Zx)}}(c));
- while(W!=$U);sD=Array(50);$U=-1;H1=!1}},uXt=function(h,W){var c=(Date.now()-GZK)/1E3;
- c.toFixed&&(c=c.toFixed(3));var V=[];V.push("[",c+"s","] ");V.push("[","yt.mdx.remote","] ");V.push(h+": "+W,"\n");return V.join("")},B1=function(h){g.h1.call(this);
- this.N=h;this.screens=[]},Zj6=function(h,W){var c=h.get(W.uuid)||h.get(W.id);
- if(c)return h=c.name,c.id=W.id||c.id,c.name=W.name,c.token=W.token,c.uuid=W.uuid||c.uuid,c.name!=h;h.screens.push(W);return!0},rLI=function(h,W){var c=h.screens.length!=W.length;
- h.screens=g.Lf(h.screens,function(B){return!!yc6(W,B)});
- for(var V=W.length,H=0;H<V;H++)c=Zj6(h,W[H])||c;return c},qrI=function(h,W){var c=h.screens.length;
- h.screens=g.Lf(h.screens,function(V){return!(V||W?!V!=!W?0:V.id==W.id:1)});
- return h.screens.length<c},x0f=function(h,W,c,V,H){g.h1.call(this);
- this.G=h;this.S=W;this.Y=c;this.N=V;this.C=H;this.W=0;this.X=null;this.Fl=NaN},Ry=function(h){B1.call(this,"LocalScreenService");
- this.W=h;this.X=NaN;ED(this);this.info("Initializing with "+CWS(this.screens))},l8$=function(h){if(h.screens.length){var W=g.xw(h.screens,function(V){return V.id}),c=hr(h.W,"/pairing/get_lounge_token_batch");
- h.W.sendRequest("POST",c,{screen_ids:W.join(",")},(0,g.JS)(h.K2,h),(0,g.JS)(h.FC,h))}},ED=function(h){if(g.ZX("deprecate_pair_servlet_enabled"))return rLI(h,[]);
- var W=UC$(tO2());W=g.Lf(W,function(c){return!c.uuid});
- return rLI(h,W)},Jr=function(h,W){mCu(g.xw(h.screens,RIc));
- W&&v2f()},jS2=function(h,W){g.h1.call(this);
- this.N=W;W=(W=g.KS("yt-remote-online-screen-ids")||"")?W.split(","):[];for(var c={},V=this.N(),H=V.length,B=0;B<H;++B){var E=V[B].id;c[E]=g.el(W,E)}this.X=c;this.C=h;this.G=this.Y=NaN;this.W=null;nst("Initialized with "+g.Nd(this.X))},a86=function(h,W,c){var V=hr(h.C,"/pairing/get_screen_availability");
- h.C.sendRequest("POST",V,{lounge_token:W.token},(0,g.JS)(function(H){H=H.screens||[];for(var B=H.length,E=0;E<B;++E)if(H[E].loungeToken==W.token){c(H[E].status=="online");return}c(!1)},h),(0,g.JS)(function(){c(!1)},h))},zj2=function(h,W){a:if(pEf(W)!=pEf(h.X))var c=!1;
- else{c=g.HG(W);for(var V=c.length,H=0;H<V;++H)if(!h.X[c[H]]){c=!1;break a}c=!0}c||(nst("Updated online screens: "+g.Nd(h.X)),h.X=W,h.publish("screenChange"));ejI(h)},u9=function(h){isNaN(h.G)||g.uW(h.G);
- h.G=g.Rx((0,g.JS)(h.Tp,h),h.Y>0&&h.Y<g.Gt()?2E4:1E4)},nst=function(h){c1("OnlineScreenService",h)},QSK=function(h){var W={};
- g.gX(h.N(),function(c){c.token?W[c.token]=c.id:this.uJ("Requesting availability of screen w/o lounge token.")});
- return W},ejI=function(h){h=g.HG(g.hB(h.X,function(W){return W}));
- g.Y6(h);h.length?g.iL("yt-remote-online-screen-ids",h.join(","),60):g.AP("yt-remote-online-screen-ids")},dd=function(h,W){W=W===void 0?!1:W;
- B1.call(this,"ScreenService");this.Y=h;this.S=W;this.X=this.W=null;this.G=[];this.C={};LaK(this)},Ka6=function(h,W,c,V,H,B){h.info("getAutomaticScreenByIds "+c+" / "+W);
- c||(c=h.C[W]);var E=h.N5(),J=c?dC(E,c):null;c&&(h.S||J)||(J=dC(E,W));if(J){J.uuid=W;var u=GI(h,J);a86(h.X,u,function(d){H(d?u:null)})}else c?ijf(h,c,(0,g.JS)(function(d){var G=GI(this,new RZ({name:V,
- screenId:c,loungeToken:d,dialId:W||""}));a86(this.X,G,function(Z){H(Z?G:null)})},h),B):H(null)},ALf=function(h,W){for(var c=h.screens.length,V=0;V<c;++V)if(h.screens[V].name==W)return h.screens[V];
- return null},U02=function(h,W,c){a86(h.X,W,c)},ijf=function(h,W,c,V){h.info("requestLoungeToken_ for "+W);
- var H={postParams:{screen_ids:W},method:"POST",context:h,onSuccess:function(B,E){B=E&&E.screens||[];B[0]&&B[0].screenId==W?c(B[0].loungeToken):V(Error("Missing lounge token in token response"))},
- onError:function(){V(Error("Request screen lounge token failed"))}};
- g.nb(hr(h.Y,"/pairing/get_lounge_token_batch"),H)},Cq6=function(h){h.screens=h.W.N5();
- var W=h.C,c={},V;for(V in W)c[W[V]]=V;W=h.screens.length;for(V=0;V<W;++V){var H=h.screens[V];H.uuid=c[H.id]||""}h.info("Updated manual screens: "+CWS(h.screens))},LaK=function(h){M5u(h);
- h.W=new Ry(h.Y);h.W.subscribe("screenChange",(0,g.JS)(h.xF,h));Cq6(h);h.S||(h.G=UC$(g.KS("yt-remote-automatic-screen-cache")||[]));M5u(h);h.info("Initializing automatic screens: "+CWS(h.G));h.X=new jS2(h.Y,(0,g.JS)(h.N5,h,!0));h.X.subscribe("screenChange",(0,g.JS)(function(){this.publish("onlineScreenChange")},h))},GI=function(h,W){var c=h.get(W.id);
- c?(c.uuid=W.uuid,W=c):((c=dC(h.G,W.uuid))?(c.id=W.id,c.token=W.token,W=c):h.G.push(W),h.S||Fac(h));M5u(h);h.C[W.uuid]=W.id;g.iL("yt-remote-device-id-map",h.C,31536E3);return W},Fac=function(h){h=g.Lf(h.G,function(W){return W.idType!="shortLived"});
- g.iL("yt-remote-automatic-screen-cache",g.xw(h,RIc))},M5u=function(h){h.C=g.KS("yt-remote-device-id-map")||{}},Zg=function(h,W,c){g.h1.call(this);
- this.zV=c;this.Y=h;this.W=W;this.X=null},rd=function(h,W){h.X=W;
- h.publish("sessionScreen",h.X)},yL2=function(h,W){h.X&&(h.X.token=W,GI(h.Y,h.X));
- h.publish("sessionScreen",h.X)},qi=function(h,W){c1(h.zV,W)},xU=function(h,W,c){Zg.call(this,h,W,"CastSession");
- var V=this;this.config_=c;this.G=null;this.Wk=(0,g.JS)(this.M4,this);this.DH=(0,g.JS)(this.g9k,this);this.XI=g.Rx(function(){Pq6(V,null)},12E4);
- this.S=this.C=this.N=this.Z=0;this.Pk=!1;this.T="unknown"},bjX=function(h,W){g.uW(h.S);
- h.S=0;W==0?f8f(h):h.S=g.Rx(function(){f8f(h)},W)},f8f=function(h){TI6(h,"getLoungeToken");
- g.uW(h.C);h.C=g.Rx(function(){NIU(h,null)},3E4)},TI6=function(h,W){h.info("sendYoutubeMessage_: "+W+" "+g.Nd());
- var c={};c.type=W;h.G?h.G.sendMessage("urn:x-cast:com.google.youtube.mdx",c,function(){},(0,g.JS)(function(){qi(this,"Failed to send message: "+W+".")},h)):qi(h,"Sending yt message without session: "+g.Nd(c))},XY6=function(h,W){W?(h.info("onConnectedScreenId_: Received screenId: "+W),h.X&&h.X.id==W||h.z5(W,function(c){rd(h,c)},function(){return h.KU()},5)):h.KU(Error("Waiting for session status timed out."))},vsU=function(h,W,c){h.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(W));
- var V=new RZ(W);t5u(h,V,function(H){H?(h.Pk=!0,GI(h.Y,V),rd(h,V),h.T="unknown",bjX(h,c)):(g.pu(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(W)+" is not online.")),h.KU())},5)},Pq6=function(h,W){g.uW(h.XI);
- h.XI=0;W?h.config_.enableCastLoungeToken&&W.loungeToken?W.deviceId?h.X&&h.X.uuid==W.deviceId||(W.loungeTokenRefreshIntervalMs?vsU(h,{name:h.W.friendlyName,screenId:W.screenId,loungeToken:W.loungeToken,dialId:W.deviceId,screenIdType:"shortLived"},W.loungeTokenRefreshIntervalMs):(g.pu(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(W)+".")),XY6(h,W.screenId))):(g.pu(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(W)+".")),XY6(h,W.screenId)):
- XY6(h,W.screenId):h.KU(Error("Waiting for session status timed out."))},NIU=function(h,W){g.uW(h.C);
- h.C=0;var c=null;if(W)if(W.loungeToken){var V;((V=h.X)==null?void 0:V.token)==W.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";else c="noLoungeTokenResponse";c?(h.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(W)+", error: "+c)),h.T=c,bjX(h,3E4)):(yL2(h,W.loungeToken),h.Pk=!1,h.T="unknown",bjX(h,W.loungeTokenRefreshIntervalMs))},t5u=function(h,W,c,V){g.uW(h.N);
- h.N=0;U02(h.Y,W,function(H){H||V<0?c(H):h.N=g.Rx(function(){t5u(h,W,c,V-1)},300)})},m0c=function(h){g.uW(h.Z);
- h.Z=0;g.uW(h.N);h.N=0;g.uW(h.XI);h.XI=0;g.uW(h.C);h.C=0;g.uW(h.S);h.S=0},l9=function(h,W,c,V){Zg.call(this,h,W,"DialSession");
- this.config_=V;this.G=this.Z=null;this.DH="";this.CM=c;this.Nn=null;this.XI=function(){};
- this.T=NaN;this.mW=(0,g.JS)(this.pF,this);this.C=function(){};
- this.S=this.N=0;this.Wk=!1;this.Pk="unknown"},ni=function(h){var W;
- return!!(h.config_.enableDialLoungeToken&&((W=h.G)==null?0:W.getDialAppInfo))},osS=function(h){h.C=h.Y.Jd(h.DH,h.W.label,h.W.friendlyName,ni(h),function(W,c){h.C=function(){};
- h.Wk=!0;rd(h,W);W.idType=="shortLived"&&c>0&&jW(h,c)},function(W){h.C=function(){};
- h.KU(W)})},pY2=function(h){var W={};
- W.pairingCode=h.DH;W.theme=h.CM;pff()&&(W.env_useStageMdx=1);return g.ZB(W)},I8U=function(h){return new Promise(function(W){h.DH=MOu();
- if(h.Nn){var c=new chrome.cast.DialLaunchResponse(!0,pY2(h));W(c);osS(h)}else h.XI=function(){g.uW(h.T);h.XI=function(){};
- h.T=NaN;var V=new chrome.cast.DialLaunchResponse(!0,pY2(h));W(V);osS(h)},h.T=g.Rx(function(){h.XI()},100)})},OjS=function(h,W,c){h.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(W));
- var V=new RZ(W);return(new Promise(function(H){YrX(h,V,function(B){B?(h.Wk=!0,GI(h.Y,V),rd(h,V),jW(h,c)):g.pu(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(W)+" is not online."));H(B)},5)})).then(function(H){return H?new chrome.cast.DialLaunchResponse(!1):I8U(h)})},SrU=function(h,W){var c=h.Z.receiver.label,V=h.W.friendlyName;
- return(new Promise(function(H){Ka6(h.Y,c,W,V,function(B){B&&B.token&&rd(h,B);H(B)},function(B){qi(h,"Failed to get DIAL screen: "+B);
- H(null)})})).then(function(H){return H&&H.token?new chrome.cast.DialLaunchResponse(!1):I8U(h)})},YrX=function(h,W,c,V){g.uW(h.N);
- h.N=0;U02(h.Y,W,function(H){H||V<0?c(H):h.N=g.Rx(function(){YrX(h,W,c,V-1)},300)})},jW=function(h,W){h.info("getDialAppInfoWithTimeout_ "+W);
- ni(h)&&(g.uW(h.S),h.S=0,W==0?gsU(h):h.S=g.Rx(function(){gsU(h)},W))},gsU=function(h){ni(h)&&h.G.getDialAppInfo(function(W){h.info("getDialAppInfo dialLaunchData: "+JSON.stringify(W));
- W=W.extraData||{};var c=null;if(W.loungeToken){var V;((V=h.X)==null?void 0:V.token)==W.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(h.Pk=c,jW(h,3E4)):(h.Wk=!1,h.Pk="unknown",yL2(h,W.loungeToken),jW(h,W.loungeTokenRefreshIntervalMs))},function(W){h.info("getDialAppInfo error: "+W);
- h.Pk="noLoungeTokenResponse";jW(h,3E4)})},D0X=function(h){g.uW(h.N);
- h.N=0;g.uW(h.S);h.S=0;h.C();h.C=function(){};
- g.uW(h.T)},ay=function(h,W){Zg.call(this,h,W,"ManualSession");
- this.G=g.Rx((0,g.JS)(this.XX,this,null),150)},eW=function(h,W){g.h1.call(this);
- this.config_=W;this.W=h;this.Z=W.appId||"233637DE";this.Y=W.theme||"cl";this.T=W.disableCastApi||!1;this.N=W.forceMirroring||!1;this.X=null;this.S=!1;this.G=[];this.C=(0,g.JS)(this.jRk,this)},wY2=function(h,W){return W?g.jl(h.G,function(c){return Ji(W,c.label)},h):null},zI=function(h){c1("Controller",h)},BIU=function(h){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(h)},QE=function(h){return h.S||!!h.G.length||!!h.X},Li=function(h,W,c){W!=h.X&&(g.hA(h.X),(h.X=W)?(c?h.publish("yt-remote-cast2-receiver-resumed",
- W.W):h.publish("yt-remote-cast2-receiver-selected",W.W),W.subscribe("sessionScreen",(0,g.JS)(h.uK,h,W)),W.subscribe("sessionFailed",function(){return kZU(h,W)}),W.X?h.publish("yt-remote-cast2-session-change",W.X):c&&h.X.XX(null)):h.publish("yt-remote-cast2-session-change",null))},kZU=function(h,W){h.X==W&&h.publish("yt-remote-cast2-session-failed")},htS=function(h){var W=h.W.yc(),c=h.X&&h.X.W;
- h=g.xw(W,function(V){c&&Ji(V,c.label)&&(c=null);var H=V.uuid?V.uuid:V.id,B=wY2(this,V);B?(B.label=H,B.friendlyName=V.name):(B=new chrome.cast.Receiver(H,V.name),B.receiverType=chrome.cast.ReceiverType.CUSTOM);return B},h);
- c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),h.push(c));return h},BYu=function(h,W,c,V){V.disableCastApi?i9("Cannot initialize because disabled by Mdx config."):W52()?cn6(W,V)&&(V9S(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?$A$(h,c):(window.__onGCastApiAvailable=function(H,B){H?$A$(h,c):(Ki("Failed to load cast API: "+B),sl6(!1),V9S(!1),g.AP("yt-remote-cast-available"),g.AP("yt-remote-cast-receiver"),
- Hq6(),c(!1))},V.loadCastApiSetupScript?g.cB("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?YBu()>=60&&cPt():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?DC6():YBu()>=89?$z6():(W1S(),nX(Vtu.map(wf6))))):i9("Cannot initialize because not running Chrome")},Hq6=function(){i9("dispose");
- var h=Ar();h&&h.dispose();g.hS("yt.mdx.remote.cloudview.instance_",null);EAf(!1);g.gI(Rt6);Rt6.length=0},UD=function(){return!!g.KS("yt-remote-cast-installed")},JnU=function(){var h=g.KS("yt-remote-cast-receiver");
- return h?h.friendlyName:null},uI6=function(){i9("clearCurrentReceiver");
- g.AP("yt-remote-cast-receiver")},dA6=function(){return UD()?Ar()?Ar().getCastSession():(Ki("getCastSelector: Cast is not initialized."),null):(Ki("getCastSelector: Cast API is not installed!"),null)},Ge6=function(){UD()?Ar()?Ci()?(i9("Requesting cast selector."),Ar().requestSession()):(i9("Wait for cast API to be ready to request the session."),Rt6.push(g.S5("yt-remote-cast2-api-ready",Ge6))):Ki("requestCastSelector: Cast is not initialized."):Ki("requestCastSelector: Cast API is not installed!")},
- Mi=function(h,W){Ci()?Ar().setConnectedScreenStatus(h,W):Ki("setConnectedScreenStatus called before ready.")},W52=function(){var h=g.TF().search(/ (CrMo|Chrome|CriOS)\//)>=0;
- return g.Zx||h},ZqU=function(h,W){Ar().init(h,W)},cn6=function(h,W){var c=!1;
- Ar()||(h=new eW(h,W),h.subscribe("yt-remote-cast2-availability-change",function(V){g.iL("yt-remote-cast-available",V);xI("yt-remote-cast2-availability-change",V)}),h.subscribe("yt-remote-cast2-receiver-selected",function(V){i9("onReceiverSelected: "+V.friendlyName);
- g.iL("yt-remote-cast-receiver",V);xI("yt-remote-cast2-receiver-selected",V)}),h.subscribe("yt-remote-cast2-receiver-resumed",function(V){i9("onReceiverResumed: "+V.friendlyName);
- g.iL("yt-remote-cast-receiver",V);xI("yt-remote-cast2-receiver-resumed",V)}),h.subscribe("yt-remote-cast2-session-change",function(V){i9("onSessionChange: "+ug(V));
- V||g.AP("yt-remote-cast-receiver");xI("yt-remote-cast2-session-change",V)}),g.hS("yt.mdx.remote.cloudview.instance_",h),c=!0);
- i9("cloudview.createSingleton_: "+c);return c},Ar=function(){return g.c2("yt.mdx.remote.cloudview.instance_")},$A$=function(h,W){sl6(!0);
- V9S(!1);ZqU(h,function(c){c?(EAf(!0),g.D8("yt-remote-cast2-api-ready")):(Ki("Failed to initialize cast API."),sl6(!1),g.AP("yt-remote-cast-available"),g.AP("yt-remote-cast-receiver"),Hq6());W(c)})},i9=function(h){c1("cloudview",h)},Ki=function(h){c1("cloudview",h)},sl6=function(h){i9("setCastInstalled_ "+h);
- g.iL("yt-remote-cast-installed",h)},Ci=function(){return!!g.c2("yt.mdx.remote.cloudview.apiReady_")},EAf=function(h){i9("setApiReady_ "+h);
- g.hS("yt.mdx.remote.cloudview.apiReady_",h)},V9S=function(h){g.hS("yt.mdx.remote.cloudview.initializing_",h)},Fb=function(h){this.index=-1;
- this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.N=0;this.trackData=null;this.mA=this.J0=!1;this.Z=this.G=this.S=this.W=0;this.X=NaN;this.Y=!1;this.reset(h)},rnI=function(h){h.audioTrackId=null;
- h.trackData=null;h.playerState=-1;h.J0=!1;h.mA=!1;h.N=0;h.C=g.Gt();h.W=0;h.S=0;h.G=0;h.Z=0;h.X=NaN;h.Y=!1},yE=function(h){return h.isPlaying()?(g.Gt()-h.C)/1E3:0},P1=function(h,W){h.N=W;
- h.C=g.Gt()},fi=function(h){switch(h.playerState){case 1:case 1081:return(g.Gt()-h.C)/1E3+h.N;
- case -1E3:return 0}return h.N},qcl=function(h){return h.Y?h.S+yE(h):h.S},b9=function(h,W,c){var V=h.videoId;
- h.videoId=W;h.index=c;W!=V&&rnI(h)},xAS=function(h){var W={};
- W.index=h.index;W.listId=h.listId;W.videoId=h.videoId;W.playerState=h.playerState;W.volume=h.volume;W.muted=h.muted;W.audioTrackId=h.audioTrackId;W.trackData=g.xF(h.trackData);W.hasPrevious=h.J0;W.hasNext=h.mA;W.playerTime=h.N;W.playerTimeAt=h.C;W.seekableStart=h.W;W.seekableEnd=h.S;W.duration=h.G;W.loadedTime=h.Z;W.liveIngestionTime=h.X;return W},Ni=function(h,W){g.h1.call(this);
- var c=this;this.G=0;this.Y=h;this.N=[];this.C=new Twu;this.W=this.X=null;this.T=(0,g.JS)(this.Jkz,this);this.S=(0,g.JS)(this.Fw,this);this.Z=(0,g.JS)(this.ykE,this);this.XI=(0,g.JS)(this.xng,this);var V=0;h?(V=h.getProxyState(),V!=3&&(h.subscribe("proxyStateChange",this.jF,this),llX(this))):V=3;V!=0&&(W?this.jF(V):g.Rx(function(){c.jF(V)},0));
- (h=dA6())&&TI(this,h);this.subscribe("yt-remote-cast2-session-change",this.XI)},Xb=function(h){return new Fb(h.Y.getPlayerContextData())},llX=function(h){g.gX("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(W){this.N.push(this.Y.subscribe(W,g.uK(this.nd9,W),this))},h)},nAK=function(h){g.gX(h.N,function(W){this.Y.unsubscribeByKey(W)},h);
- h.N.length=0},tr=function(h){return h.getState()==1},v1=function(h,W){var c=h.C;
- c.X.length+c.W.length<50&&h.C.enqueue(W)},jl$=function(h,W,c){var V=Xb(h);
- P1(V,c);V.playerState!=-1E3&&(V.playerState=W);m8(h,V)},oy=function(h,W,c){h.Y.sendMessage(W,c)},m8=function(h,W){nAK(h);
- h.Y.setPlayerContextData(xAS(W));llX(h)},TI=function(h,W){h.W&&(h.W.removeUpdateListener(h.T),h.W.removeMediaListener(h.S),h.Fw(null));
- h.W=W;h.W&&(VE("Setting cast session: "+h.W.sessionId),h.W.addUpdateListener(h.T),h.W.addMediaListener(h.S),h.W.media.length&&h.Fw(h.W.media[0]))},alK=function(h){var W=h.X.media,c=h.X.customData;
- if(W&&c){var V=Xb(h);W.contentId!=V.videoId&&VE("Cast changing video to: "+W.contentId);V.videoId=W.contentId;V.playerState=c.playerState;P1(V,h.X.getEstimatedTime());m8(h,V)}else VE("No cast media video. Ignoring state update.")},pi=function(h,W,c){return(0,g.JS)(function(V){this.uJ("Failed to "+W+" with cast v2 channel. Error code: "+V.code);
- V.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.uJ("Retrying "+W+" using MDx browser channel."),oy(this,W,c))},h)},OD=function(h,W,c,V){V=V===void 0?!1:V;
- g.h1.call(this);var H=this;this.N=NaN;this.DH=!1;this.T=this.Z=this.Wk=this.Pk=NaN;this.XI=[];this.C=this.S=this.Y=this.X=this.W=null;this.Nn=h;this.mW=V;this.XI.push(g.qz(window,"beforeunload",function(){H.TR(2)}));
- this.G=[];this.X=new Fb;this.CM=W.id;this.zV=W.idType;this.W=HjS(this.Nn,c,this.td,this.zV=="shortLived",this.CM);this.W.listen("channelOpened",function(){et6(H)});
- this.W.listen("channelClosed",function(){Iy("Channel closed");isNaN(H.N)?rC(!0):rC();H.dispose()});
- this.W.listen("channelError",function(B){rC();isNaN(H.kW())?(B==1&&H.zV=="shortLived"&&H.publish("browserChannelAuthError",B),Iy("Channel error: "+B+" without reconnection"),H.dispose()):(H.DH=!0,Iy("Channel error: "+B+" with reconnection in "+H.kW()+" ms"),YU(H,2))});
- this.W.listen("channelMessage",function(B){ztK(H,B)});
- this.W.aS(W.token);this.subscribe("remoteQueueChange",function(){var B=H.X.videoId;g.Uh()&&g.iL("yt-remote-session-video-id",B)})},QlI=function(h){return g.jl(h.G,function(W){return W.type=="LOUNGE_SCREEN"})},Iy=function(h){c1("conn",h)},YU=function(h,W){h.publish("proxyStateChange",W)},L5U=function(h){h.N=g.Rx(function(){Iy("Connecting timeout");
- h.TR(1)},2E4)},iq$=function(h){g.uW(h.N);
- h.N=NaN},K5l=function(h){g.uW(h.Pk);
- h.Pk=NaN},UA6=function(h){AnU(h);
- h.Wk=g.Rx(function(){SW(h,"getNowPlaying")},2E4)},AnU=function(h){g.uW(h.Wk);
- h.Wk=NaN},et6=function(h){Iy("Channel opened");
- h.DH&&(h.DH=!1,K5l(h),h.Pk=g.Rx(function(){Iy("Timing out waiting for a screen.");h.TR(1)},15E3))},M9t=function(h,W){var c=null;
- if(W){var V=QlI(h);V&&(c={clientName:V.clientName,deviceMake:V.brand,deviceModel:V.model,osVersion:V.osVersion})}g.hS("yt.mdx.remote.remoteClient_",c);W&&(iq$(h),K5l(h));c=h.W.Nj()&&isNaN(h.N);W==c?W&&(YU(h,1),SW(h,"getSubtitlesTrack")):W?(h.YR()&&h.X.reset(),YU(h,1),SW(h,"getNowPlaying"),Cxc(h)):h.TR(1)},F5S=function(h,W){var c=W.params.videoId;
- delete W.params.videoId;c==h.X.videoId&&(g.GF(W.params)?h.X.trackData=null:h.X.trackData=W.params,h.publish("remotePlayerChange"))},ynX=function(h,W,c){var V=W.params.videoId||W.params.video_id,H=parseInt(W.params.currentIndex,10);
- h.X.listId=W.params.listId||h.X.listId;b9(h.X,V,H);h.publish("remoteQueueChange",c)},flU=function(h,W){W.params=W.params||{};
- ynX(h,W,"NOW_PLAYING_MAY_CHANGE");PxU(h,W);h.publish("autoplayDismissed")},PxU=function(h,W){var c=parseInt(W.params.currentTime||W.params.current_time,10);
- P1(h.X,isNaN(c)?0:c);c=parseInt(W.params.state,10);c=isNaN(c)?-1:c;c==-1&&h.X.playerState==-1E3&&(c=-1E3);h.X.playerState=c;c=Number(W.params.loadedTime);h.X.Z=isNaN(c)?0:c;h.X.I3(Number(W.params.duration));c=h.X;var V=Number(W.params.liveIngestionTime);c.X=V;c.Y=isNaN(V)?!1:!0;c=h.X;V=Number(W.params.seekableStartTime);W=Number(W.params.seekableEndTime);c.W=isNaN(V)?0:V;c.S=isNaN(W)?0:W;h.X.playerState==1?UA6(h):AnU(h);h.publish("remotePlayerChange")},bql=function(h,W){if(h.X.playerState!=-1E3){var c=
- 1085;
- switch(parseInt(W.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}h.X.playerState=c;W=parseInt(W.params.currentTime,10);P1(h.X,isNaN(W)?0:W);h.publish("remotePlayerChange")}},TYS=function(h,W){var c=W.params.muted=="true";
- h.X.volume=parseInt(W.params.volume,10);h.X.muted=c;h.publish("remotePlayerChange")},NY6=function(h,W){h.S=W.params.videoId;
- h.publish("nowAutoplaying",parseInt(W.params.timeout,10))},XBI=function(h,W){h.S=W.params.videoId||null;
- h.publish("autoplayUpNext",h.S)},t96=function(h,W){h.C=W.params.autoplayMode;
- h.publish("autoplayModeChange",h.C);h.C=="DISABLED"&&h.publish("autoplayDismissed")},vAU=function(h,W){var c=W.params.hasNext=="true";
- h.X.J0=W.params.hasPrevious=="true";h.X.mA=c;h.publish("previousNextChange")},ztK=function(h,W){W=W.message;
- W.params?Iy("Received: action="+W.action+", params="+g.Nd(W.params)):Iy("Received: action="+W.action+" {}");switch(W.action){case "loungeStatus":W=V0(W.params.devices);h.G=g.xw(W,function(V){return new El(V)});
- W=!!g.jl(h.G,function(V){return V.type=="LOUNGE_SCREEN"});
- M9t(h,W);W=h.Gd("mlm");h.publish("multiStateLoopEnabled",W);break;case "loungeScreenDisconnected":g.UI(h.G,function(V){return V.type=="LOUNGE_SCREEN"});
- M9t(h,!1);break;case "remoteConnected":var c=new El(V0(W.params.device));g.jl(h.G,function(V){return V.equals(c)})||oZ6(h.G,c);
- break;case "remoteDisconnected":c=new El(V0(W.params.device));g.UI(h.G,function(V){return V.equals(c)});
- break;case "gracefulDisconnect":break;case "playlistModified":ynX(h,W,"QUEUE_MODIFIED");break;case "nowPlaying":flU(h,W);break;case "onStateChange":PxU(h,W);break;case "onAdStateChange":bql(h,W);break;case "onVolumeChanged":TYS(h,W);break;case "onSubtitlesTrackChanged":F5S(h,W);break;case "nowAutoplaying":NY6(h,W);break;case "autoplayDismissed":h.publish("autoplayDismissed");break;case "autoplayUpNext":XBI(h,W);break;case "onAutoplayModeChanged":t96(h,W);break;case "onHasPreviousNextChanged":vAU(h,
- W);break;case "requestAssistedSignIn":h.publish("assistedSignInRequested",W.params.authCode);break;case "onLoopModeChanged":h.publish("loopModeChange",W.params.loopMode);break;default:Iy("Unrecognized action: "+W.action)}},Cxc=function(h){g.uW(h.T);
- h.T=g.Rx(function(){h.TR(1)},864E5)},SW=function(h,W,c){c?Iy("Sending: action="+W+", params="+g.Nd(c)):Iy("Sending: action="+W);
- h.W.sendMessage(W,c)},mAU=function(h){B1.call(this,"ScreenServiceProxy");
- this.hh=h;this.X=[];this.X.push(this.hh.$_s("screenChange",(0,g.JS)(this.Vd,this)));this.X.push(this.hh.$_s("onlineScreenChange",(0,g.JS)(this.F8O,this)))},OqK=function(h,W){o2U();
- if(!qr||!qr.get("yt-remote-disable-remote-module-for-dev")){W=g.X_("MDX_CONFIG")||W;PW2();NJS();gd||(gd=new kI(W?W.loungeApiHost:void 0),pff()&&(gd.X="/api/loungedev"));Dg||(Dg=g.c2("yt.mdx.remote.deferredProxies_")||[],g.hS("yt.mdx.remote.deferredProxies_",Dg));oA$();var c=wd();if(!c){var V=new dd(gd,W?W.disableAutomaticScreenCache||!1:!1);g.hS("yt.mdx.remote.screenService_",V);c=wd();var H={};W&&(H={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.hS("yt.mdx.remote.enableConnectWithInitialState_",W?W.enableConnectWithInitialState||!1:!1);BYu(h,V,function(B){B?kU()&&Mi(kU(),"YouTube TV"):V.subscribe("onlineScreenChange",function(){xI("yt-remote-receiver-availability-change")})},H)}W&&!g.c2("yt.mdx.remote.initialized_")&&(g.hS("yt.mdx.remote.initialized_",!0),hh("Initializing: "+g.Nd(W)),
- WQ.push(g.S5("yt-remote-cast2-api-ready",function(){xI("yt-remote-api-ready")})),WQ.push(g.S5("yt-remote-cast2-availability-change",function(){xI("yt-remote-receiver-availability-change")})),WQ.push(g.S5("yt-remote-cast2-receiver-selected",function(){cQ(null);
- xI("yt-remote-auto-connect","cast-selector-receiver")})),WQ.push(g.S5("yt-remote-cast2-receiver-resumed",function(){xI("yt-remote-receiver-resumed","cast-selector-receiver")})),WQ.push(g.S5("yt-remote-cast2-session-change",pBK)),WQ.push(g.S5("yt-remote-connection-change",function(B){B?Mi(kU(),"YouTube TV"):VG()||(Mi(null,null),uI6())})),WQ.push(g.S5("yt-remote-cast2-session-failed",function(){xI("yt-remote-connection-failed")})),h=IlU(),W.isAuto&&(h.id+="#dial"),H=W.capabilities||[],H.length>0&&(h.capabilities=
- H),h.name=W.device,h.app=W.app,(W=W.theme)&&(h.theme=W),hh(" -- with channel params: "+g.Nd(h)),h?(g.iL("yt-remote-session-app",h.app),g.iL("yt-remote-session-name",h.name)):(g.AP("yt-remote-session-app"),g.AP("yt-remote-session-name")),g.hS("yt.mdx.remote.channelParams_",h),c.start(),kU()||Yc2())}},Sc$=function(){var h=wd().hh.$_gos();
- var W=$d();W&&sY()&&(yc6(h,W)||h.push(W));return Fff(h)},DA2=function(){var h=gAu();
- !h&&UD()&&JnU()&&(h={key:"cast-selector-receiver",name:JnU()});return h},gAu=function(){var h=Sc$(),W=$d();
- W||(W=VG());return g.jl(h,function(c){return W&&Ji(W,c.key)?!0:!1})},$d=function(){var h=kU();
- if(!h)return null;var W=wd().N5();return dC(W,h)},pBK=function(h){hh("remote.onCastSessionChange_: "+ug(h));
- if(h){var W=$d();if(W&&W.id==h.id){if(Mi(W.id,"YouTube TV"),h.idType=="shortLived"&&(h=h.token))HQ&&(HQ.token=h),(W=sY())&&W.aS(h)}else W&&BQ(),EY(h,1)}else sY()&&BQ()},BQ=function(){Ci()?Ar().stopSession():Ki("stopSession called before API ready.");
- var h=sY();h&&(h.disconnect(1),wBK(null))},keK=function(){var h=sY();
- return!!h&&h.getProxyState()!=3},hh=function(h){c1("remote",h)},wd=function(){if(!h_K){var h=g.c2("yt.mdx.remote.screenService_");
- h_K=h?new mAU(h):null}return h_K},kU=function(){return g.c2("yt.mdx.remote.currentScreenId_")},WtX=function(h){g.hS("yt.mdx.remote.currentScreenId_",h)},c52=function(){return g.c2("yt.mdx.remote.connectData_")},cQ=function(h){g.hS("yt.mdx.remote.connectData_",h)},sY=function(){return g.c2("yt.mdx.remote.connection_")},wBK=function(h){var W=sY();
- cQ(null);h||WtX("");g.hS("yt.mdx.remote.connection_",h);Dg&&(g.gX(Dg,function(c){c(h)}),Dg.length=0);
- W&&!h?xI("yt-remote-connection-change",!1):!W&&h&&xI("yt-remote-connection-change",!0)},VG=function(){var h=g.Uh();
- if(!h)return null;var W=wd();if(!W)return null;W=W.N5();return dC(W,h)},EY=function(h,W){kU();
- $d()&&$d();if(Rd)HQ=h;else{WtX(h.id);var c=g.c2("yt.mdx.remote.enableConnectWithInitialState_")||!1;h=new OD(gd,h,IlU(),c);h.connect(W,c52());h.subscribe("beforeDisconnect",function(V){xI("yt-remote-before-disconnect",V)});
- h.subscribe("beforeDispose",function(){sY()&&(sY(),wBK(null))});
- h.subscribe("browserChannelAuthError",function(){var V=$d();V&&V.idType=="shortLived"&&(Ci()?Ar().handleBrowserChannelAuthError():Ki("refreshLoungeToken called before API ready."))});
- wBK(h)}},Yc2=function(){var h=VG();
- h?(hh("Resume connection to: "+ug(h)),EY(h,0)):(rC(),uI6(),hh("Skipping connecting because no session screen found."))},oA$=function(){var h=IlU();
- if(g.GF(h)){h=ZR();var W=g.KS("yt-remote-session-name")||"",c=g.KS("yt-remote-session-app")||"";h={device:"REMOTE_CONTROL",id:h,name:W,app:c,mdxVersion:3};h.authuser=String(g.X_("SESSION_INDEX","0"));(W=g.X_("DELEGATED_SESSION_ID"))&&(h.pageId=String(W));g.hS("yt.mdx.remote.channelParams_",h)}},IlU=function(){return g.c2("yt.mdx.remote.channelParams_")||{}},s3$=function(h,W,c){g.N.call(this);
- var V=this;this.X=h;this.L=W;this.tI=c;this.events=new g.lX(this);this.C=!1;this.N=new g.l1(64);this.W=new g.oD(this.ZR,500,this);this.G=new g.oD(this.rP,1E3,this);this.Z=new jj(this.TeV,0,this);this.Y={};this.T=new g.oD(this.EB,1E3,this);this.S=new g.O5(this.seekTo,1E3,this);this.XI=this.events.U(this.L,"onVolumeChange",function(H){V2K(V,H)});
- g.X(this,this.events);this.events.U(W,"onCaptionsTrackListChanged",this.kzk);this.events.U(W,"captionschanged",this.iMB);this.events.U(W,"captionssettingschanged",this.Vh);this.events.U(W,"videoplayerreset",this.JC);this.events.U(W,"mdxautoplaycancel",function(){V.tI.Qk()});
- W.j("enable_mdx_video_play_directly")&&this.events.U(W,"videodatachange",function(){$_c(V.X)||Jh(V)||uV(V,0)});
- h=this.tI;h.gE();h.subscribe("proxyStateChange",this.TN,this);h.subscribe("remotePlayerChange",this.rL,this);h.subscribe("remoteQueueChange",this.JC,this);h.subscribe("previousNextChange",this.B_,this);h.subscribe("nowAutoplaying",this.Jj,this);h.subscribe("autoplayDismissed",this.nD,this);g.X(this,this.W);g.X(this,this.G);g.X(this,this.Z);g.X(this,this.T);g.X(this,this.S);this.Vh();this.JC();this.rL()},V2K=function(h,W){if(Jh(h)){h.tI.unsubscribe("remotePlayerChange",h.rL,h);
- var c=Math.round(W.volume);W=!!W.muted;var V=Xb(h.tI);if(c!==V.volume||W!==V.muted)h.tI.setVolume(c,W),h.T.start();h.tI.subscribe("remotePlayerChange",h.rL,h)}},HxX=function(h){h.kd(0);
- h.W.stop();h.Tz(new g.l1(64))},Bc2=function(h,W){if(Jh(h)&&!h.C){var c=null;
- W&&(c={style:h.L.getSubtitlesUserSettings()},Object.assign(c,W));h.tI.MJ(h.L.getVideoData(1).videoId,c);h.Y=Xb(h.tI).trackData}},uV=function(h,W){var c=h.L.getPlaylist();
- if(c==null?0:c.listId){var V=c.index;var H=c.listId.toString()}c=h.L.getVideoData(1);h.tI.playVideo(c.videoId,W,V,H,c.playerParams,c.Nn,mUI(c));h.Tz(new g.l1(1))},ENK=function(h,W){if(W){var c=h.L.getOption("captions","tracklist",{eJ:1});
- c&&c.length?(h.L.setOption("captions","track",W),h.C=!1):(h.L.loadModule("captions"),h.C=!0)}else h.L.setOption("captions","track",{})},Jh=function(h){return Xb(h.tI).videoId===h.L.getVideoData(1).videoId},R_c=function(h,W){g.O7.call(this,h);
- this.X=W},dt=function(){g.p.call(this,{D:"div",
- K:"ytp-mdx-popup-dialog",J:{role:"dialog"},V:[{D:"div",K:"ytp-mdx-popup-dialog-inner-content",V:[{D:"div",K:"ytp-mdx-popup-title",YN:"\u4f60\u5df2\u9000\u51fa\u8d26\u53f7"},{D:"div",K:"ytp-mdx-popup-description",YN:"\u4f60\u89c2\u770b\u7684\u89c6\u9891\u53ef\u80fd\u4f1a\u6dfb\u52a0\u5230\u7535\u89c6\u7684\u89c2\u770b\u8bb0\u5f55\u4e2d\uff0c\u5e76\u5f71\u54cd\u7535\u89c6\u4e0a\u7684\u63a8\u8350\u5185\u5bb9\u3002\u4e3a\u907f\u514d\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\uff0c\u8bf7\u53d6\u6d88\u5e76\u5728\u8ba1\u7b97\u673a\u4e0a\u767b\u5f55 YouTube\u3002"},
- {D:"div",K:"ytp-mdx-privacy-popup-buttons",V:[{D:"button",LM:["ytp-button","ytp-mdx-privacy-popup-cancel"],YN:"\u53d6\u6d88"},{D:"button",LM:["ytp-button","ytp-mdx-privacy-popup-confirm"],YN:"\u786e\u8ba4"}]}]}]});this.fade=new g.SL(this,250);this.cancelButton=this.vk("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.vk("ytp-mdx-privacy-popup-confirm");g.X(this,this.fade);this.U(this.cancelButton,"click",this.X);this.U(this.confirmButton,"click",this.W)},GB=function(h){g.p.call(this,{D:"div",
- K:"ytp-remote",V:[{D:"div",K:"ytp-remote-display-status",V:[{D:"div",K:"ytp-remote-display-status-icon",V:[g.rPl()]},{D:"div",K:"ytp-remote-display-status-text",YN:"{{statustext}}"}]}]});this.api=h;this.fade=new g.SL(this,250);g.X(this,this.fade);this.U(h,"presentingplayerstatechange",this.onStateChange);this.So(h.getPlayerStateObject())},Z5=function(h,W){g.Xt.call(this,"\u64ad\u653e\u8bbe\u5907",1,h,W);
- this.L=h;this.a5={};this.U(h,"onMdxReceiversChange",this.Y);this.U(h,"presentingplayerstatechange",this.Y);this.Y()},J5t=function(h){g.K3.call(this,h);
- this.u0={key:MOu(),name:"\u6b64\u8ba1\u7b97\u673a"};this.GL=null;this.subscriptions=[];this.FH=this.tI=null;this.a5=[this.u0];this.IS=this.u0;this.Zh=new g.l1(64);this.LL=0;this.P5=-1;this.l7=!1;this.bO=this.u7=this.x8=null;if(!g.$X(this.player.B())&&!g.CV(this.player.B())){h=this.player;var W=g.CQ(h);W&&(W=W.zA())&&(W=new Z5(h,W),g.X(this,W));W=new GB(h);g.X(this,W);g.ge(h,W.element,4);this.x8=new dt;g.X(this,this.x8);g.ge(h,this.x8.element,4);this.l7=!!VG()}},rt=function(h){h.u7&&(h.player.removeEventListener("presentingplayerstatechange",
- h.u7),h.u7=null)},uef=function(h,W,c){h.Zh=c;
- h.player.publish("presentingplayerstatechange",new g.H8(c,W))},qI=function(h,W){if(W.key!==h.IS.key)if(W.key===h.u0.key)BQ();
- else if($_c(h)&&d_c(h),h.IS=W,!h.player.B().j("disable_mdx_connection_in_mdx_module_for_music_web")||!g.CV(h.player.B())){var c=h.player.getPlaylistId();var V=h.player.getVideoData(1);var H=V.videoId;if(!c&&!H||(h.player.getAppState()===2||h.player.getAppState()===1)&&h.player.B().j("should_clear_video_data_on_player_cued_unstarted"))V=null;else{var B=h.player.getPlaylist();if(B){var E=[];for(var J=0;J<B.length;J++)E[J]=g.QB(B,J).videoId}else E=[H];B=h.player.getCurrentTime(1);h={videoIds:E,listId:c,
- videoId:H,playerParams:V.playerParams,clickTrackingParams:V.Nn,index:Math.max(h.player.getPlaylistIndex(),0),currentTime:B===0?void 0:B};(V=mUI(V))&&(h.locationInfo=V);V=h}hh("Connecting to: "+g.Nd(W));W.key=="cast-selector-receiver"?(cQ(V||null),W=V||null,Ci()?Ar().setLaunchParams(W):Ki("setLaunchParams called before ready.")):!V&&keK()&&kU()==W.key?xI("yt-remote-connection-change",!0):(BQ(),cQ(V||null),V=wd().N5(),(W=dC(V,W.key))&&EY(W,1))}},$_c=function(h){var W=h.player.B();
- return!W.j("mdx_enable_privacy_disclosure_ui")||h.isLoggedIn()||h.l7||!h.x8?!1:g.lo(W)||g.aa(W)},d_c=function(h){h.player.getPlayerStateObject().isPlaying()?h.player.pauseVideo():(h.u7=function(W){!h.l7&&g.EA(W,8)&&(h.player.pauseVideo(),rt(h))},h.player.addEventListener("presentingplayerstatechange",h.u7));
- h.x8&&h.x8.qd();sY()||(Rd=!0)};
- g.t7.prototype.HF=g.$5(49,function(){this.app.mR().HF()});
- g.kY.prototype.HF=g.$5(48,function(){this.bO=null});
- g.t7.prototype.In=g.$5(47,function(h){this.app.mR().In(h)});
- g.kY.prototype.In=g.$5(46,function(h){this.bO=h});
- OuX.prototype.jz=function(h){this.X.wA("/client_streamz/youtube/living_room/mdx/channel/opened",h)};
- S_2.prototype.jz=function(h){this.X.wA("/client_streamz/youtube/living_room/mdx/channel/closed",h)};
- gZX.prototype.jz=function(h){this.X.wA("/client_streamz/youtube/living_room/mdx/channel/message_received",h)};
- DUS.prototype.jz=function(){this.X.wA("/client_streamz/youtube/living_room/mdx/channel/success")};
- wEc.prototype.jz=function(h,W){this.X.wA("/client_streamz/youtube/living_room/mdx/channel/error",h,W)};
- k7X.prototype.jz=function(){this.X.wA("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")};
- hIK.prototype.jz=function(){this.X.wA("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")};
- g.l=H4.prototype;g.l.No=function(){B4(this);for(var h=[],W=0;W<this.X.length;W++)h.push(this.W[this.X[W]]);return h};
- g.l.UU=function(){B4(this);return this.X.concat()};
- g.l.has=function(h){return sl(this.W,h)};
- g.l.equals=function(h,W){if(this===h)return!0;if(this.size!=h.size)return!1;W=W||VOX;B4(this);for(var c,V=0;c=this.X[V];V++)if(!W(this.get(c),h.get(c)))return!1;return!0};
- g.l.isEmpty=function(){return this.size==0};
- g.l.clear=function(){this.W={};this.Zo=this.size=this.X.length=0};
- g.l.remove=function(h){return this.delete(h)};
- g.l.delete=function(h){return sl(this.W,h)?(delete this.W[h],--this.size,this.Zo++,this.X.length>2*this.size&&B4(this),!0):!1};
- g.l.get=function(h,W){return sl(this.W,h)?this.W[h]:W};
- g.l.set=function(h,W){sl(this.W,h)||(this.size+=1,this.X.push(h),this.Zo++);this.W[h]=W};
- g.l.forEach=function(h,W){for(var c=this.UU(),V=0;V<c.length;V++){var H=c[V],B=this.get(H);h.call(W,B,H,this)}};
- g.l.clone=function(){return new H4(this)};
- g.l.keys=function(){return g.Z_(this.WY(!0)).X()};
- g.l.values=function(){return g.Z_(this.WY(!1)).X()};
- g.l.entries=function(){var h=this;return cc2(this.keys(),function(W){return[W,h.get(W)]})};
- g.l.WY=function(h){B4(this);var W=0,c=this.Zo,V=this,H=new g.jX;H.next=function(){if(c!=V.Zo)throw Error("The map has changed since the iterator was created");if(W>=V.X.length)return g.ZZ;var B=V.X[W++];return g.a5(h?B:V.W[B])};
- return H};
- var BJ$={HwV:"atp",ONO:"ska",LlN:"que",qpz:"mus",TKf:"sus",a8N:"dsp",ZNO:"seq",NAN:"mic",Qx9:"dpa",Spg:"mlm",Dvk:"dsdtr",i$W:"ntb",ypV:"vsp",KRz:"scn",HNk:"rpe",vCW:"dcn",frz:"dcp",O$n:"pas",zpk:"drq",x5E:"opf",FRn:"els",qrf:"isg",Jvk:"svq",RJz:"mvp",HGM:"ads",YOB:"stcp",MlI:"sads",bUO:"dloc",NVH:"dcw",mhf:"asw",nLk:"apw"},E2l={i9B:"u",JGB:"cl",TiN:"k",mqN:"i",X3W:"cr",FAf:"m",p39:"g",Sa:"up"},Iuf={zo:"adPlaying",zD:"onAdStateChange"},YG6={y2V:"nowPlaying",t5n:"onStateChange",zo:"adPlaying",zD:"onAdStateChange",
- fk:"nowPlayingShorts",DP:"onShortsStateChange"},Og6={fk:"nowPlayingShorts",DP:"onShortsStateChange"};El.prototype.equals=function(h){return h?this.id==h.id:!1};
- var TJt="",qr=null;g.n(IX2,g.Fy);var lg,hO$=Ob2("loadCastFramework")||Ob2("loadCastApplicationFramework"),Vtu=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.rX(jj,g.N);g.l=jj.prototype;g.l.HW=function(h){this.Y=arguments;this.X=!1;this.Fl?this.G=g.Gt()+this.pw:this.Fl=g.PK(this.C,this.pw)};
- g.l.stop=function(){this.Fl&&(g.k5.clearTimeout(this.Fl),this.Fl=null);this.G=null;this.X=!1;this.Y=[]};
- g.l.pause=function(){++this.W};
- g.l.resume=function(){this.W&&(--this.W,!this.W&&this.X&&(this.X=!1,this.N.apply(null,this.Y)))};
- g.l.dE=function(){this.stop();jj.Ms.dE.call(this)};
- g.l.nF=function(){this.Fl&&(g.k5.clearTimeout(this.Fl),this.Fl=null);this.G?(this.Fl=g.PK(this.C,this.G-g.Gt()),this.G=null):this.W?this.X=!0:(this.X=!1,this.N.apply(null,this.Y))};aZ.prototype.stringify=function(h){return g.k5.JSON.stringify(h,void 0)};
- aZ.prototype.parse=function(h){return g.k5.JSON.parse(h,void 0)};g.rX(sIc,g.mm);g.rX(HSf,g.mm);var BQI=null;g.rX(RO2,g.mm);g.rX(JPc,g.mm);g.rX(uRX,g.mm);LX.prototype.debug=function(){};
- LX.prototype.info=function(){};
- LX.prototype.warning=function(){};var nkX={},lL6={};g.l=ig.prototype;g.l.setTimeout=function(h){this.Mn=h};
- g.l.CF=function(h){h=h.target;var W=this.yg;W&&g.pW(h)==3?W.pH():this.Lr(h)};
- g.l.Lr=function(h){try{if(h==this.X)a:{var W=g.pW(this.X),c=this.X.W,V=this.X.getStatus();if(!(W<3)&&(W!=3||this.X&&(this.W.G||g.Yv(this.X)||g.OL(this.X)))){this.mW||W!=4||c==7||(c==8||V<=0?ej(3):ej(2));eOX(this);var H=this.X.getStatus();this.uW=H;var B=xzX(this);if(this.N=H==200){if(this.lW&&!this.Rz){b:{if(this.X){var E=g.Sa(this.X,"X-HTTP-Initial-Response");if(E&&!g.Cr(E)){var J=E;break b}}J=null}if(h=J)this.Rz=!0,Mt2(this,h);else{this.N=!1;this.C=3;zU(12);Ai(this);Ul(this);break a}}if(this.zV){h=
- !0;for(var u;!this.mW&&this.S<B.length;)if(u=jIU(this,B),u==lL6){W==4&&(this.C=4,zU(14),h=!1);break}else if(u==nkX){this.C=4;zU(15);h=!1;break}else Mt2(this,u);qhU(this)&&this.S!=0&&(this.W.X=this.W.X.slice(this.S),this.S=0);W!=4||B.length!=0||this.W.G||(this.C=1,zU(16),h=!1);this.N=this.N&&h;h?B.length>0&&!this.hI&&(this.hI=!0,this.G.Jf(this)):(Ai(this),Ul(this))}else Mt2(this,B);W==4&&Ai(this);this.N&&!this.mW&&(W==4?zOI(this.G,this):(this.N=!1,KX(this)))}else g.z7D(this.X),H==400&&B.indexOf("Unknown SID")>
- 0?(this.C=3,zU(12)):(this.C=0,zU(13)),Ai(this),Ul(this)}}}catch(d){}finally{}};
- g.l.cancel=function(){this.mW=!0;Ai(this)};
- g.l.gw=function(){this.XI=null;var h=Date.now();h-this.Ef>=0?(this.CM!=2&&(ej(3),zU(17)),Ai(this),this.C=2,Ul(this)):aLU(this,this.Ef-h)};
- g.l.getLastError=function(){return this.C};
- g.l.BA=function(){return this.X};yPU.prototype.cancel=function(){this.G=fLc(this);if(this.W)this.W.cancel(),this.W=null;else if(this.X&&this.X.size!==0){for(var h=g.e(this.X.values()),W=h.next();!W.done;W=h.next())W.value.cancel();this.X.clear()}};g.l=Xtl.prototype;g.l.NJ=8;g.l.xL=1;g.l.connect=function(h,W,c,V){zU(0);this.Sx=h;this.mW=W||{};c&&V!==void 0&&(this.mW.OSID=c,this.mW.OAID=V);this.Rz=this.U5;this.Nn=AP6(this,null,this.Sx);y0(this)};
- g.l.disconnect=function(){vkI(this);if(this.xL==3){var h=this.Jk++,W=this.Nn.clone();g.By(W,"SID",this.Y);g.By(W,"RID",h);g.By(W,"TYPE","terminate");bg(this,W);h=new ig(this,this.Y,h);h.CM=2;h.Z=W4(W.clone());W=!1;if(g.k5.navigator&&g.k5.navigator.sendBeacon)try{W=g.k5.navigator.sendBeacon(h.Z.toString(),"")}catch(c){}!W&&g.k5.Image&&((new Image).src=h.Z,W=!0);W||(h.X=rP6(h.G,null),h.X.send(h.Z));h.Pk=Date.now();KX(h)}OSI(this)};
- g.l.xx=function(){return this.xL==0};
- g.l.getState=function(){return this.xL};
- g.l.mS=function(h){if(this.N)if(this.N=null,this.xL==1){if(!h){this.Jk=Math.floor(Math.random()*1E5);h=this.Jk++;var W=new ig(this,"",h),c=this.T;this.uW&&(c?(c=g.qx(c),g.lN(c,this.uW)):c=this.uW);this.S!==null||this.Ef||(W.Nn=c,c=null);var V;if(this.Ak)a:{for(var H=V=0;H<this.G.length;H++){b:{var B=this.G[H];if("__data__"in B.map&&(B=B.map.__data__,typeof B==="string")){B=B.length;break b}B=void 0}if(B===void 0)break;V+=B;if(V>4096){V=H;break a}if(V===4096||H===this.G.length-1){V=H+1;break a}}V=
- 1E3}else V=1E3;V=pt6(this,W,V);H=this.Nn.clone();g.By(H,"RID",h);g.By(H,"CVER",22);this.zV&&g.By(H,"X-HTTP-Session-Id",this.zV);bg(this,H);c&&(this.Ef?V="headers="+g.Ak(g.Ik5(c))+"&"+V:this.S&&g.ue(H,this.S,c));K1l(this.W,W);this.nj&&g.By(H,"TYPE","init");this.Ak?(g.By(H,"$req",V),g.By(H,"SID","null"),W.lW=!0,ZSt(W,H,null)):ZSt(W,H,V);this.xL=2}}else this.xL==3&&(h?ILu(this,h):this.G.length==0||PLX(this.W)||ILu(this))};
- g.l.HK=function(){this.Z=null;Yhu(this);if(this.Zn&&!(this.Mn||this.X==null||this.bX<=0)){var h=4*this.bX;this.DH=Q0((0,g.JS)(this.rkg,this),h)}};
- g.l.rkg=function(){this.DH&&(this.DH=null,this.Rz=!1,this.Mn=!0,zU(10),Mr(this),Yhu(this))};
- g.l.Jf=function(h){this.X==h&&this.Zn&&!this.Mn&&(ttI(this),this.Mn=!0,zU(11))};
- g.l.jT=function(){this.XI!=null&&(this.XI=null,Mr(this),L1t(this),zU(19))};
- g.l.jdB=function(h){h?zU(2):zU(1)};
- g.l.isActive=function(){return!!this.C&&this.C.isActive(this)};
- g.l=gkc.prototype;g.l.SE=function(){};
- g.l.jE=function(){};
- g.l.Cr=function(){};
- g.l.gB=function(){};
- g.l.isActive=function(){return!0};
- g.l.ST=function(){};g.rX(Nr,g.Rn);Nr.prototype.open=function(){this.X.C=this.G;this.N&&(this.X.CM=!0);this.X.connect(this.C,this.W||void 0)};
- Nr.prototype.close=function(){this.X.disconnect()};
- Nr.prototype.send=function(h){var W=this.X;if(typeof h==="string"){var c={};c.__data__=h;h=c}else this.Y&&(c={},c.__data__=g.Nd(h),h=c);W.G.push(new F1I(W.Uy++,h));W.xL==3&&y0(W)};
- Nr.prototype.dE=function(){this.X.C=null;delete this.G;this.X.disconnect();delete this.X;Nr.Ms.dE.call(this)};
- g.rX(wtt,sIc);g.rX(kRU,HSf);g.rX(TU,gkc);TU.prototype.SE=function(){this.X.dispatchEvent("m")};
- TU.prototype.jE=function(h){this.X.dispatchEvent(new wtt(h))};
- TU.prototype.Cr=function(h){this.X.dispatchEvent(new kRU(h))};
- TU.prototype.gB=function(){this.X.dispatchEvent("n")};var ti=new g.Rn;g.n(cZU,g.mm);g.l=mn.prototype;g.l.tX=null;g.l.m1=!1;g.l.zR=null;g.l.IW=null;g.l.PD=null;g.l.iU=null;g.l.Yu=null;g.l.rG=null;g.l.BX=null;g.l.v3=null;g.l.yS=0;g.l.Nm=null;g.l.cw=null;g.l.p7=null;g.l.hc=-1;g.l.dP=!0;g.l.dY=!1;g.l.Jx=0;g.l.ZN=null;var E4t={},Bwf={};g.l=mn.prototype;g.l.setTimeout=function(h){this.W=h};
- g.l.q4=function(h){h=h.target;var W=this.ZN;W&&g.pW(h)==3?W.pH():this.RJ(h)};
- g.l.RJ=function(h){try{if(h==this.v3)a:{var W=g.pW(this.v3),c=this.v3.W,V=this.v3.getStatus();if(g.Js&&!g.tk("420+")){if(W<4)break a}else if(W<3||W==3&&!g.Yv(this.v3))break a;this.dY||W!=4||c==7||(c==8||V<=0?this.X.r8(3):this.X.r8(2));uJX(this);var H=this.v3.getStatus();this.hc=H;var B=g.Yv(this.v3);if(this.m1=H==200){W==4&&oZ(this);if(this.zV){for(h=!0;!this.dY&&this.yS<B.length;){var E=RBt(this,B);if(E==Bwf){W==4&&(this.p7=4,v4(15),h=!1);break}else if(E==E4t){this.p7=4;v4(16);h=!1;break}else G1U(this,
- E)}W==4&&B.length==0&&(this.p7=1,v4(17),h=!1);this.m1=this.m1&&h;h||(oZ(this),dvu(this))}else G1U(this,B);this.m1&&!this.dY&&(W==4?this.X.Bf(this):(this.m1=!1,Hg2(this)))}else H==400&&B.indexOf("Unknown SID")>0?(this.p7=3,v4(13)):(this.p7=0,v4(14)),oZ(this),dvu(this)}}catch(J){}finally{}};
- g.l.cancel=function(){this.dY=!0;oZ(this)};
- g.l.Rj=function(){this.zR=null;var h=Date.now();h-this.IW>=0?(this.iU!=2&&this.X.r8(3),oZ(this),this.p7=2,v4(18),dvu(this)):JZX(this,this.IW-h)};
- g.l.getLastError=function(){return this.p7};g.l=qGl.prototype;g.l.Mc=null;g.l.Xm=null;g.l.by=!1;g.l.eZ=null;g.l.VZ=null;g.l.T0=-1;g.l.JA=null;g.l.GX=null;g.l.connect=function(h){this.eZ=h;h=IZ(this.X,null,this.eZ);v4(3);Date.now();var W=this.X.T;W!=null?(this.JA=W[0],(this.GX=W[1])?(this.VZ=1,xvl(this)):(this.VZ=2,lu2(this))):(c4(h,"MODE","init"),this.Xm=new mn(this),this.Xm.tX=this.Mc,sC6(this.Xm,h,!1,null,!0),this.VZ=0)};
- g.l.GE=function(h){if(h)this.VZ=2,lu2(this);else{v4(4);var W=this.X;W.Pj=W.yK.T0;gC(W,9)}h&&this.r8(2)};
- g.l.xA=function(h){return this.X.xA(h)};
- g.l.abort=function(){this.Xm&&(this.Xm.cancel(),this.Xm=null);this.T0=-1};
- g.l.xx=function(){return!1};
- g.l.qJ=function(h,W){this.T0=h.hc;if(this.VZ==0)if(W){try{var c=this.W.parse(W)}catch(V){h=this.X;h.Pj=this.T0;gC(h,2);return}this.JA=c[0];this.GX=c[1]}else h=this.X,h.Pj=this.T0,gC(h,2);else this.VZ==2&&(this.by?(v4(7),Date.now()):W=="11111"?(v4(6),this.by=!0,Date.now(),this.T0=200,this.Xm.cancel(),v4(12),YI(this.X,this,!0)):(v4(8),Date.now(),this.by=!1))};
- g.l.Bf=function(){this.T0=this.Xm.hc;if(this.Xm.m1)this.VZ==0?this.GX?(this.VZ=1,xvl(this)):(this.VZ=2,lu2(this)):this.VZ==2&&(this.by?(v4(12),YI(this.X,this,!0)):(v4(11),YI(this.X,this,!1)));else{this.VZ==0?v4(9):this.VZ==2&&v4(10);var h=this.X;this.Xm.getLastError();h.Pj=this.T0;gC(h,2)}};
- g.l.vD=function(){return this.X.vD()};
- g.l.isActive=function(){return this.X.isActive()};
- g.l.r8=function(h){this.X.r8(h)};g.l=n4$.prototype;g.l.A2=null;g.l.f8=null;g.l.PR=null;g.l.At=null;g.l.V_=null;g.l.Iy=null;g.l.FF=null;g.l.E9=null;g.l.bz=0;g.l.KF=0;g.l.Mh=null;g.l.g7=null;g.l.Ao=null;g.l.Ej=null;g.l.yK=null;g.l.Hf=null;g.l.Qe=-1;g.l.Kr=-1;g.l.Pj=-1;g.l.kG=0;g.l.DL=0;g.l.e3=8;var GE6={OK:0,j3E:2,f$E:4,J2f:5,rpM:6,STOP:7,v8:8,COg:9,nQf:10,gQf:11,gLk:12};g.rX(aul,g.mm);g.rX(eB$,g.mm);g.l=n4$.prototype;
- g.l.connect=function(h,W,c,V,H){v4(0);this.V_=W;this.f8=c||{};V&&H!==void 0&&(this.f8.OSID=V,this.f8.OAID=H);this.Z?(XQ((0,g.JS)(this.TH,this,h),100),QCu(this)):this.TH(h)};
- g.l.disconnect=function(){L6c(this);if(this.X==3){var h=this.bz++,W=this.Iy.clone();g.By(W,"SID",this.Y);g.By(W,"RID",h);g.By(W,"TYPE","terminate");Sj(this,W);h=new mn(this,this.Y,h);h.iU=2;h.Yu=W4(W.clone());(new Image).src=h.Yu.toString();h.PD=Date.now();Hg2(h)}fu6(this)};
- g.l.TH=function(h){this.yK=new qGl(this);this.yK.Mc=this.A2;this.yK.W=this.C;this.yK.connect(h)};
- g.l.xx=function(){return this.X==0};
- g.l.getState=function(){return this.X};
- g.l.UM=function(h){this.g7=null;CCc(this,h)};
- g.l.sM=function(){this.Ao=null;this.At=new mn(this,this.Y,"rpc",this.S);this.At.tX=this.A2;this.At.Jx=0;var h=this.FF.clone();g.By(h,"RID","rpc");g.By(h,"SID",this.Y);g.By(h,"CI",this.Hf?"0":"1");g.By(h,"AID",this.Qe);Sj(this,h);g.By(h,"TYPE","xmlhttp");sC6(this.At,h,!0,this.E9,!1)};
- g.l.qJ=function(h,W){if(this.X!=0&&(this.At==h||this.PR==h))if(this.Pj=h.hc,this.PR==h&&this.X==3)if(this.e3>7){try{var c=this.C.parse(W)}catch(V){c=null}if(Array.isArray(c)&&c.length==3)if(h=c,h[0]==0)a:{if(!this.Ao){if(this.At)if(this.At.PD+3E3<this.PR.PD)Ol(this),this.At.cancel(),this.At=null;else break a;yZ6(this);v4(19)}}else this.Kr=h[1],0<this.Kr-this.Qe&&h[2]<37500&&this.Hf&&this.DL==0&&!this.Ej&&(this.Ej=XQ((0,g.JS)(this.Ud,this),6E3));else gC(this,11)}else W!="y2f%"&&gC(this,11);else if(this.At==
- h&&Ol(this),!g.Cr(W))for(h=this.C.parse(W),W=0;W<h.length;W++)c=h[W],this.Qe=c[0],c=c[1],this.X==2?c[0]=="c"?(this.Y=c[1],this.E9=c[2],c=c[3],c!=null?this.e3=c:this.e3=6,this.X=3,this.Mh&&this.Mh.rB(),this.FF=IZ(this,this.vD()?this.E9:null,this.V_),MPI(this)):c[0]=="stop"&&gC(this,7):this.X==3&&(c[0]=="stop"?gC(this,7):c[0]!="noop"&&this.Mh&&this.Mh.ZX(c),this.DL=0)};
- g.l.Ud=function(){this.Ej!=null&&(this.Ej=null,this.At.cancel(),this.At=null,yZ6(this),v4(20))};
- g.l.Bf=function(h){if(this.At==h){Ol(this);this.At=null;var W=2}else if(this.PR==h)this.PR=null,W=1;else return;this.Pj=h.hc;if(this.X!=0)if(h.m1)if(W==1){W=h.BX?h.BX.length:0;h=Date.now()-h.PD;var c=ti;c.dispatchEvent(new aul(c,W,h,this.kG));zB$(this);this.Mh&&this.Mh.im(this,this.G);this.G.length=0}else MPI(this);else{c=h.getLastError();var V;if(!(V=c==3||c==7||c==0&&this.Pj>0)){if(V=W==1)this.PR||this.g7||this.X==1||this.kG>=2?V=!1:(this.g7=XQ((0,g.JS)(this.UM,this,h),F66(this,this.kG)),this.kG++,
- V=!0);V=!(V||W==2&&yZ6(this))}if(V)switch(c){case 1:gC(this,5);break;case 4:gC(this,10);break;case 3:gC(this,6);break;case 7:gC(this,12);break;default:gC(this,2)}}};
- g.l.Fs=function(h){if(!g.el(arguments,this.X))throw Error("Unexpected channel state: "+this.X);};
- g.l.CJk=function(h){h?v4(2):(v4(1),PC6(this,8))};
- g.l.xA=function(h){if(h)throw Error("Can't create secondary domain capable XhrIo object.");h=new g.vK;h.S=!1;return h};
- g.l.isActive=function(){return!!this.Mh&&this.Mh.isActive(this)};
- g.l.r8=function(h){var W=ti;W.dispatchEvent(new eB$(W,h))};
- g.l.vD=function(){return!1};
- g.l=bgu.prototype;g.l.rB=function(){};
- g.l.ZX=function(){};
- g.l.im=function(){};
- g.l.oJ=function(){};
- g.l.TU=function(){};
- g.l.cK=function(){return{}};
- g.l.isActive=function(){return!0};g.l=Twu.prototype;g.l.enqueue=function(h){this.W.push(h)};
- g.l.isEmpty=function(){return this.X.length===0&&this.W.length===0};
- g.l.clear=function(){this.X=[];this.W=[]};
- g.l.contains=function(h){return g.el(this.X,h)||g.el(this.W,h)};
- g.l.remove=function(h){var W=this.X;var c=(0,g.rS6)(W,h);c>=0?(g.zt(W,c),W=!0):W=!1;return W||g.QU(this.W,h)};
- g.l.No=function(){for(var h=[],W=this.X.length-1;W>=0;--W)h.push(this.X[W]);W=this.W.length;for(var c=0;c<W;++c)h.push(this.W[c]);return h};g.n(NwU,g.mm);g.n(Xp6,g.mm);g.rX(DR,g.N);g.l=DR.prototype;g.l.PVf=function(){this.pw=Math.min(3E5,this.pw*2);this.G();this.W&&this.start()};
- g.l.start=function(){var h=this.pw+15E3*Math.random();g.pO(this.X,h);this.W=Date.now()+h};
- g.l.stop=function(){this.X.stop();this.W=0};
- g.l.isActive=function(){return this.X.isActive()};
- g.l.reset=function(){this.X.stop();this.pw=5E3};g.rX(v4K,bgu);g.l=v4K.prototype;g.l.subscribe=function(h,W,c){return this.N.subscribe(h,W,c)};
- g.l.unsubscribe=function(h,W,c){return this.N.unsubscribe(h,W,c)};
- g.l.IF=function(h){return this.N.IF(h)};
- g.l.publish=function(h,W){return this.N.publish.apply(this.N,arguments)};
- g.l.dispose=function(){this.S||(this.S=!0,g.hA(this.N),this.disconnect(),g.hA(this.W),this.W=null,this.zV=function(){return""},this.Nn=function(){return g.AF({})})};
- g.l.gE=function(){return this.S};
- g.l.connect=function(h,W,c){var V=this,H,B,E,J;return g.P(function(u){if(u.W==1)return g.LU(u,2),V.C?g.F(u,V.Y,2):u.bB(2);g.Pd(u);if(V.S||V.X&&V.X.getState()==2)return u.return();V.Pk="";V.W.stop();V.T=h||null;V.Z=W||0;H=V.CM+"/test";B=V.CM+"/bind";E=new n4$(c?c.firstTestResults:null,c?c.secondTestResults:null,V.hI);if(J=V.X)J.Mh=null;E.Mh=V;V.X=E;if(V.C)return V.Y=g4U(V).then(function(){return ppU(V,H,B,J,c)}),u.return(V.Y.then(function(){V.Y=g.AF()}));
- ppU(V,H,B,J,c);return g.bT(u,0)})};
- g.l.disconnect=function(h){try{this.C&&(this.Y.cancel(),this.Y=g.AF())}finally{this.Wk=h||0,this.W&&this.W.stop(),mvU(this),this.X&&(this.X.getState()==3&&CCc(this.X),this.X.disconnect()),this.Wk=0}};
- g.l.sendMessage=function(h,W){var c=this,V;return g.P(function(H){switch(H.W){case 1:g.LU(H,2);if(!c.C){H.bB(2);break}return g.F(H,c.Y,2);case 2:g.Pd(H);if(c.S)return H.return();V={_sc:h};W&&g.lN(V,W);if(c.W.isActive()||(c.X?c.X.getState():0)==2){c.G.push(V);H.bB(6);break}if(!c.Nj()){H.bB(6);break}g.LU(H,8);if(!c.C||SG2(c,h)){H.bB(8);break}return g.F(H,g4U(c),8);case 8:g.Pd(H,0,0,1);c.Nj()&&(SG2(c,h)||o4U(c),mvU(c),ig$(c.X,V));g.bT(H,6,1);break;case 6:g.bT(H,0)}})};
- g.l.rB=function(){this.W.reset();this.T=null;this.Z=0;if(this.G.length)if(this.C)wp2(this);else{var h=this.G;this.G=[];var W=h.length;o4U(this);DvS(this,h,W);wC(this)}else wC(this)};
- g.l.oJ=function(h){var W=h==2&&this.X.Pj==401;h==4||W||this.W.start();this.publish("handlerError",h,W);W=Object.keys(GE6).find(function(c){return GE6[c]===h});
- this.yg.jz("BROWSER_CHANNEL",W!=null?W:"UNKNOWN")};
- g.l.TU=function(h,W){if(!this.W.isActive())this.publish("handlerClosed");else if(W)for(var c=W.length,V=0;V<c;++V){var H=W[V].map;H&&this.G.push(H)}this.Rz.jz("BROWSER_CHANNEL");h&&this.Zn.X.O9("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",h.length);W&&this.fR.X.O9("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",W.length)};
- g.l.im=function(h,W){W!=null&&h!=null&&this.Mn.jz()};
- g.l.cK=function(){var h={v:2};this.Pk&&(h.gsessionid=this.Pk);this.Z!=0&&(h.ui=""+this.Z);this.Wk!=0&&(h.ui=""+this.Wk);this.T&&g.lN(h,this.T);return h};
- g.l.ZX=function(h){h[0]=="S"?this.Pk=h[1]:h[0]=="gracefulReconnect"?(this.W.start(),this.X.disconnect()):this.publish("handlerMessage",new tPl(h[0],h[1]));this.Jk.jz("BROWSER_CHANNEL")};
- g.l.Nj=function(){return!!this.X&&this.X.getState()==3};
- g.l.aS=function(h){(this.XI.loungeIdToken=h)||this.W.stop();if(this.Sx&&this.X){var W=this.X.A2||{};h?W["X-YouTube-LoungeId-Token"]=h:delete W["X-YouTube-LoungeId-Token"];this.X.A2=W}};
- g.l.getDeviceId=function(){return this.XI.id};
- g.l.WQ=function(){return this.W.isActive()?this.W.W-Date.now():NaN};
- g.l.qF=function(){var h=this.W;g.ID(h.X);h.start()};
- g.l.qhW=function(){this.W.isActive();K66(this.X)==0&&this.connect(this.T,this.Z)};kI.prototype.sendRequest=function(h,W,c,V,H,B,E){h={format:B?"RAW":"JSON",method:h,context:this,timeout:5E3,withCredentials:!!E,onSuccess:g.uK(this.Y,V,!B),onError:g.uK(this.G,H),onTimeout:g.uK(this.C,H)};c&&(h.postParams=c,h.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.nb(W,h)};
- kI.prototype.Y=function(h,W,c,V){W?h(V):h({text:c.responseText})};
- kI.prototype.G=function(h,W){h(Error("Request error: "+W.status))};
- kI.prototype.C=function(h){h(Error("request timed out"))};g.n(WaI,g.Rn);g.l=WaI.prototype;g.l.connect=function(h,W,c){this.pR.connect(h,W,c)};
- g.l.disconnect=function(h){this.pR.disconnect(h)};
- g.l.qF=function(){this.pR.qF()};
- g.l.getDeviceId=function(){return this.pR.getDeviceId()};
- g.l.WQ=function(){return this.pR.WQ()};
- g.l.Nj=function(){return this.pR.Nj()};
- g.l.Z6=function(){this.dispatchEvent("channelOpened");var h=this.pR,W=this.X;g.iL("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!h.X.Hf,sessionId:h.X.Y,arrayId:h.X.Qe});g.iL("yt-remote-session-screen-id",W);h=GU();W=ZR();g.el(h,W)||h.push(W);bb2(h);NJS()};
- g.l.onClosed=function(){this.dispatchEvent("channelClosed")};
- g.l.onMessage=function(h){this.dispatchEvent(new NwU(h))};
- g.l.onError=function(h){this.dispatchEvent(new Xp6(h?1:0))};
- g.l.sendMessage=function(h,W){this.pR.sendMessage(h,W)};
- g.l.aS=function(h){this.pR.aS(h)};
- g.l.dispose=function(){this.pR.dispose()};g.l=cLu.prototype;
- g.l.connect=function(h,W){h=h===void 0?{}:h;W=W===void 0?0:W;this.N!==2&&(this.G.stop(),this.Z=h,this.S=W,$0t(this),(h=g.X_("ID_TOKEN"))?this.Y["x-youtube-identity-token"]=h:delete this.Y["x-youtube-identity-token"],this.X&&(this.W.device=this.X.device,this.W.name=this.X.name,this.W.app=this.X.app,this.W.id=this.X.id,this.X.WWE&&(this.W.mdxVersion=""+this.X.WWE),this.X.theme&&(this.W.theme=this.X.theme),this.X.capabilities&&(this.W.capabilities=this.X.capabilities),this.X.F1&&(this.W.cst=this.X.F1),
- this.X.authuser&&(this.W.authuser=this.X.authuser),this.X.pageId&&(this.W.pageId=this.X.pageId)),this.S!==0?this.W.ui=""+this.S:delete this.W.ui,Object.assign(this.W,this.Z),this.channel=new Nr(this.pathPrefix,{h1:"gsessionid",dnW:this.Y,h9N:this.W}),this.channel.open(),this.N=2,V56(this))};
- g.l.disconnect=function(h){this.T=h===void 0?0:h;this.G.stop();$0t(this);this.channel&&(this.T!==0?this.W.ui=""+this.T:delete this.W.ui,this.channel.close());this.T=0};
- g.l.WQ=function(){return this.G.isActive()?this.G.W-Date.now():NaN};
- g.l.qF=function(){var h=this.G;g.ID(h.X);h.start()};
- g.l.sendMessage=function(h,W){this.channel&&($0t(this),h=Object.assign({},{_sc:h},W),this.channel.send(h))};
- g.l.aS=function(h){h||this.G.stop();h?this.Y["X-YouTube-LoungeId-Token"]=h:delete this.Y["X-YouTube-LoungeId-Token"]};
- g.l.getDeviceId=function(){return this.X?this.X.id:""};
- g.l.publish=function(h){return this.C.publish.apply(this.C,[h].concat(g.rN(g.tN.apply(1,arguments))))};
- g.l.subscribe=function(h,W,c){return this.C.subscribe(h,W,c)};
- g.l.unsubscribe=function(h,W,c){return this.C.unsubscribe(h,W,c)};
- g.l.IF=function(h){return this.C.IF(h)};
- g.l.dispose=function(){this.XI||(this.XI=!0,g.hA(this.C),this.disconnect(),g.hA(this.G),this.Pk=function(){return""})};
- g.l.gE=function(){return this.XI};g.n(sSI,g.Rn);g.l=sSI.prototype;g.l.connect=function(h,W){this.X.connect(h,W)};
- g.l.disconnect=function(h){this.X.disconnect(h)};
- g.l.qF=function(){this.X.qF()};
- g.l.getDeviceId=function(){return this.X.getDeviceId()};
- g.l.WQ=function(){return this.X.WQ()};
- g.l.Nj=function(){return this.X.N===3};
- g.l.cW=function(){this.dispatchEvent("channelOpened")};
- g.l.onClosed=function(){this.dispatchEvent("channelClosed")};
- g.l.onMessage=function(h){this.dispatchEvent(new NwU(h))};
- g.l.onError=function(){this.dispatchEvent(new Xp6(this.X.HH===401?1:0))};
- g.l.sendMessage=function(h,W){this.X.sendMessage(h,W)};
- g.l.aS=function(h){this.X.aS(h)};
- g.l.dispose=function(){this.X.dispose()};var GZK=Date.now(),W1=null,sD=Array(50),$U=-1,H1=!1;g.rX(B1,g.h1);B1.prototype.N5=function(){return this.screens};
- B1.prototype.contains=function(h){return!!yc6(this.screens,h)};
- B1.prototype.get=function(h){return h?dC(this.screens,h):null};
- B1.prototype.info=function(h){c1(this.N,h)};g.n(x0f,g.h1);g.l=x0f.prototype;g.l.start=function(){!this.X&&isNaN(this.Fl)&&this.jq()};
- g.l.stop=function(){this.X&&(this.X.abort(),this.X=null);isNaN(this.Fl)||(g.uW(this.Fl),this.Fl=NaN)};
- g.l.dE=function(){this.stop();g.h1.prototype.dE.call(this)};
- g.l.jq=function(){this.Fl=NaN;this.X=g.nb(hr(this.G,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.S},timeout:5E3,onSuccess:(0,g.JS)(this.Je,this),onError:(0,g.JS)(this.yd,this),onTimeout:(0,g.JS)(this.Ij,this)})};
- g.l.Je=function(h,W){this.X=null;h=W.screen||{};h.dialId=this.Y;h.name=this.N;W=-1;this.C&&h.shortLivedLoungeToken&&h.shortLivedLoungeToken.value&&h.shortLivedLoungeToken.refreshIntervalMs&&(h.screenIdType="shortLived",h.loungeToken=h.shortLivedLoungeToken.value,W=h.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new RZ(h),W)};
- g.l.yd=function(h){this.X=null;h.status&&h.status==404?this.W>=ZxU.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(h=ZxU[this.W],this.Fl=g.Rx((0,g.JS)(this.jq,this),h),this.W++):this.publish("pairingFailed",Error("Server error "+h.status))};
- g.l.Ij=function(){this.X=null;this.publish("pairingFailed",Error("Server not responding"))};
- var ZxU=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.rX(Ry,B1);g.l=Ry.prototype;g.l.start=function(){ED(this)&&this.publish("screenChange");!g.KS("yt-remote-lounge-token-expiration")&&l8$(this);g.uW(this.X);this.X=g.Rx((0,g.JS)(this.start,this),1E4)};
- g.l.add=function(h,W){ED(this);Zj6(this,h);Jr(this,!1);this.publish("screenChange");W(h);h.token||l8$(this)};
- g.l.remove=function(h,W){var c=ED(this);qrI(this,h)&&(Jr(this,!1),c=!0);W(h);c&&this.publish("screenChange")};
- g.l.L3=function(h,W,c,V){var H=ED(this),B=this.get(h.id);B?(B.name!=W&&(B.name=W,Jr(this,!1),H=!0),c(h)):V(Error("no such local screen."));H&&this.publish("screenChange")};
- g.l.dE=function(){g.uW(this.X);Ry.Ms.dE.call(this)};
- g.l.K2=function(h){ED(this);var W=this.screens.length;h=h&&h.screens||[];for(var c=h.length,V=0;V<c;++V){var H=h[V],B=this.get(H.screenId);B&&(B.token=H.loungeToken,--W)}Jr(this,!W);W&&c1(this.N,"Missed "+W+" lounge tokens.")};
- g.l.FC=function(h){c1(this.N,"Requesting lounge tokens failed: "+h)};g.n(jS2,g.h1);g.l=jS2.prototype;g.l.start=function(){var h=parseInt(g.KS("yt-remote-fast-check-period")||"0",10);(this.Y=g.Gt()-144E5<h?0:h)?u9(this):(this.Y=g.Gt()+3E5,g.iL("yt-remote-fast-check-period",this.Y),this.Tp())};
- g.l.isEmpty=function(){return g.GF(this.X)};
- g.l.update=function(){nst("Updating availability on schedule.");var h=this.N(),W=g.hB(this.X,function(c,V){return c&&!!dC(h,V)},this);
- zj2(this,W)};
- g.l.dE=function(){g.uW(this.G);this.G=NaN;this.W&&(this.W.abort(),this.W=null);g.h1.prototype.dE.call(this)};
- g.l.Tp=function(){g.uW(this.G);this.G=NaN;this.W&&this.W.abort();var h=QSK(this);if(pEf(h)){var W=hr(this.C,"/pairing/get_screen_availability");this.W=this.C.sendRequest("POST",W,{lounge_token:g.HG(h).join(",")},(0,g.JS)(this.VoW,this,h),(0,g.JS)(this.Edk,this))}else zj2(this,{}),u9(this)};
- g.l.VoW=function(h,W){this.W=null;var c=g.HG(QSK(this));if(g.OI(c,g.HG(h))){W=W.screens||[];c={};for(var V=W.length,H=0;H<V;++H)c[h[W[H].loungeToken]]=W[H].status=="online";zj2(this,c);u9(this)}else this.uJ("Changing Screen set during request."),this.Tp()};
- g.l.Edk=function(h){this.uJ("Screen availability failed: "+h);this.W=null;u9(this)};
- g.l.uJ=function(h){c1("OnlineScreenService",h)};g.rX(dd,B1);g.l=dd.prototype;g.l.start=function(){this.W.start();this.X.start();this.screens.length&&(this.publish("screenChange"),this.X.isEmpty()||this.publish("onlineScreenChange"))};
- g.l.add=function(h,W,c){this.W.add(h,W,c)};
- g.l.remove=function(h,W,c){this.W.remove(h,W,c);this.X.update()};
- g.l.L3=function(h,W,c,V){this.W.contains(h)?this.W.L3(h,W,c,V):(h="Updating name of unknown screen: "+h.name,c1(this.N,h),V(Error(h)))};
- g.l.N5=function(h){return h?this.screens:g.C$(this.screens,g.Lf(this.G,function(W){return!this.contains(W)},this))};
- g.l.yc=function(){return g.Lf(this.N5(!0),function(h){return!!this.X.X[h.id]},this)};
- g.l.Jd=function(h,W,c,V,H,B){var E=this;this.info("getDialScreenByPairingCode "+h+" / "+W);var J=new x0f(this.Y,h,W,c,V);J.subscribe("pairingComplete",function(u,d){g.hA(J);H(GI(E,u),d)});
- J.subscribe("pairingFailed",function(u){g.hA(J);B(u)});
- J.start();return(0,g.JS)(J.stop,J)};
- g.l.xj=function(h,W,c,V){g.nb(hr(this.Y,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:h},timeout:5E3,onSuccess:(0,g.JS)(function(H,B){H=new RZ(B.screen||{});if(!H.name||ALf(this,H.name)){a:{B=H.name;for(var E=2,J=W(B,E);ALf(this,J);){E++;if(E>20)break a;J=W(B,E)}B=J}H.name=B}c(GI(this,H))},this),
- onError:(0,g.JS)(function(H){V(Error("pairing request failed: "+H.status))},this),
- onTimeout:(0,g.JS)(function(){V(Error("pairing request timed out."))},this)})};
- g.l.dE=function(){g.hA(this.W);g.hA(this.X);dd.Ms.dE.call(this)};
- g.l.xF=function(){Cq6(this);this.publish("screenChange");this.X.update()};
- dd.prototype.dispose=dd.prototype.dispose;g.rX(Zg,g.h1);g.l=Zg.prototype;g.l.KU=function(h){this.gE()||(h&&(qi(this,""+h),this.publish("sessionFailed")),this.X=null,this.publish("sessionScreen",null))};
- g.l.info=function(h){c1(this.zV,h)};
- g.l.IJ=function(){return null};
- g.l.n4=function(h){var W=this.W;h?(W.displayStatus=new chrome.cast.ReceiverDisplayStatus(h,[]),W.displayStatus.showStop=!0):W.displayStatus=null;chrome.cast.setReceiverDisplayStatus(W,(0,g.JS)(function(){this.info("Updated receiver status for "+W.friendlyName+": "+h)},this),(0,g.JS)(function(){qi(this,"Failed to update receiver status for: "+W.friendlyName)},this))};
- g.l.dE=function(){this.n4("");Zg.Ms.dE.call(this)};g.n(xU,Zg);g.l=xU.prototype;g.l.Ng=function(h){if(this.G){if(this.G==h)return;qi(this,"Overriding cast session with new session object");m0c(this);this.Pk=!1;this.T="unknown";this.G.removeUpdateListener(this.Wk);this.G.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DH)}this.G=h;this.G.addUpdateListener(this.Wk);this.G.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.DH);TI6(this,"getMdxSessionStatus")};
- g.l.XX=function(h){this.info("launchWithParams no-op for Cast: "+g.Nd(h))};
- g.l.stop=function(){this.G?this.G.stop((0,g.JS)(function(){this.KU()},this),(0,g.JS)(function(){this.KU(Error("Failed to stop receiver app."))},this)):this.KU(Error("Stopping cast device without session."))};
- g.l.n4=function(){};
- g.l.dE=function(){this.info("disposeInternal");m0c(this);this.G&&(this.G.removeUpdateListener(this.Wk),this.G.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.DH));this.G=null;Zg.prototype.dE.call(this)};
- g.l.g9k=function(h,W){if(!this.gE())if(W)if(W=V0(W),g.H2(W))switch(h=""+W.type,W=W.data||{},this.info("onYoutubeMessage_: "+h+" "+g.Nd(W)),h){case "mdxSessionStatus":Pq6(this,W);break;case "loungeToken":NIU(this,W);break;default:qi(this,"Unknown youtube message: "+h)}else qi(this,"Unable to parse message.");else qi(this,"No data in message.")};
- g.l.z5=function(h,W,c,V){g.uW(this.Z);this.Z=0;Ka6(this.Y,this.W.label,h,this.W.friendlyName,(0,g.JS)(function(H){H?W(H):V>=0?(qi(this,"Screen "+h+" appears to be offline. "+V+" retries left."),this.Z=g.Rx((0,g.JS)(this.z5,this,h,W,c,V-1),300)):c(Error("Unable to fetch screen."))},this),c)};
- g.l.IJ=function(){return this.G};
- g.l.M4=function(h){this.gE()||h||(qi(this,"Cast session died."),this.KU())};g.n(l9,Zg);g.l=l9.prototype;g.l.Ng=function(h){this.G=h;this.G.addUpdateListener(this.mW)};
- g.l.XX=function(h){this.Nn=h;this.XI()};
- g.l.stop=function(){D0X(this);this.G?this.G.stop((0,g.JS)(this.KU,this,null),(0,g.JS)(this.KU,this,"Failed to stop DIAL device.")):this.KU()};
- g.l.dE=function(){D0X(this);this.G&&this.G.removeUpdateListener(this.mW);this.G=null;Zg.prototype.dE.call(this)};
- g.l.pF=function(h){this.gE()||h||(qi(this,"DIAL session died."),this.C(),this.C=function(){},this.KU())};g.n(ay,Zg);ay.prototype.stop=function(){this.KU()};
- ay.prototype.Ng=function(){};
- ay.prototype.XX=function(){g.uW(this.G);this.G=NaN;var h=dC(this.Y.N5(),this.W.label);h?rd(this,h):this.KU(Error("No such screen"))};
- ay.prototype.dE=function(){g.uW(this.G);this.G=NaN;Zg.prototype.dE.call(this)};g.n(eW,g.h1);g.l=eW.prototype;
- g.l.init=function(h,W){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);g.ZX("desktop_enable_cast_connect")&&(c.androidReceiverCompatible=!0);this.T||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var V=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;h=h||this.N?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var H=(0,g.JS)(this.q8z,this);c=new chrome.cast.ApiConfig(c,(0,g.JS)(this.Ov,
- this),H,V,h);c.customDialLaunchCallback=(0,g.JS)(this.TEN,this);chrome.cast.initialize(c,(0,g.JS)(function(){this.gE()||(chrome.cast.addReceiverActionListener(this.C),JLI(),this.W.subscribe("onlineScreenChange",(0,g.JS)(this.xf,this)),this.G=htS(this),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.JS)(function(B){this.uJ("Failed to set initial custom receivers: "+g.Nd(B))},this)),this.publish("yt-remote-cast2-availability-change",QE(this)),W(!0))},this),(0,g.JS)(function(B){this.uJ("Failed to initialize API: "+
- g.Nd(B));
- W(!1)},this))};
- g.l.IgH=function(h,W){zI("Setting connected screen ID: "+h+" -> "+W);if(this.X){var c=this.X.X;if(!h||c&&c.id!=h)zI("Unsetting old screen status: "+this.X.W.friendlyName),Li(this,null)}if(h&&W){if(!this.X){h=dC(this.W.N5(),h);if(!h){zI("setConnectedScreenStatus: Unknown screen.");return}if(h.idType=="shortLived"){zI("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=wY2(this,h);c||(zI("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(h.uuid?
- h.uuid:h.id,h.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.G.push(c),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.JS)(function(V){this.uJ("Failed to set initial custom receivers: "+g.Nd(V))},this)));
- zI("setConnectedScreenStatus: new active receiver: "+c.friendlyName);Li(this,new ay(this.W,c),!0)}this.X.n4(W)}else zI("setConnectedScreenStatus: no screen.")};
- g.l.p9B=function(h){this.gE()?this.uJ("Setting connection data on disposed cast v2"):this.X?this.X.XX(h):this.uJ("Setting connection data without a session")};
- g.l.eT=function(){this.gE()?this.uJ("Stopping session on disposed cast v2"):this.X?(this.X.stop(),Li(this,null)):zI("Stopping non-existing session")};
- g.l.requestSession=function(){chrome.cast.requestSession((0,g.JS)(this.Ov,this),(0,g.JS)(this.AwO,this))};
- g.l.dE=function(){this.W.unsubscribe("onlineScreenChange",(0,g.JS)(this.xf,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var h=BIU,W=g.c2("yt.mdx.remote.debug.handlers_");g.QU(W||[],h);g.hA(this.X);g.h1.prototype.dE.call(this)};
- g.l.uJ=function(h){c1("Controller",h)};
- g.l.uK=function(h,W){this.X==h&&(W||Li(this,null),this.publish("yt-remote-cast2-session-change",W))};
- g.l.jRk=function(h,W){if(!this.gE())if(h)switch(h.friendlyName=chrome.cast.unescape(h.friendlyName),zI("onReceiverAction_ "+h.label+" / "+h.friendlyName+"-- "+W),W){case chrome.cast.ReceiverAction.CAST:if(this.X)if(this.X.W.label!=h.label)zI("onReceiverAction_: Stopping active receiver: "+this.X.W.friendlyName),this.X.stop();else{zI("onReceiverAction_: Casting to active receiver.");this.X.X&&this.publish("yt-remote-cast2-session-change",this.X.X);break}switch(h.receiverType){case chrome.cast.ReceiverType.CUSTOM:Li(this,
- new ay(this.W,h));break;case chrome.cast.ReceiverType.DIAL:Li(this,new l9(this.W,h,this.Y,this.config_));break;case chrome.cast.ReceiverType.CAST:Li(this,new xU(this.W,h,this.config_));break;default:this.uJ("Unknown receiver type: "+h.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.X&&this.X.W.label==h.label?this.X.stop():this.uJ("Stopping receiver w/o session: "+h.friendlyName)}else this.uJ("onReceiverAction_ called without receiver.")};
- g.l.TEN=function(h){if(this.gE())return Promise.reject(Error("disposed"));var W=h.receiver;W.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.uJ("Not DIAL receiver: "+W.friendlyName),W.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.X?this.X.W:null;if(!c||c.label!=W.label)return this.uJ("Receiving DIAL launch request for non-clicked DIAL receiver: "+W.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==W.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.X.X)return zI("Reselecting dial screen."),
- this.publish("yt-remote-cast2-session-change",this.X.X),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.uJ('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+W.friendlyName);Li(this,new l9(this.W,W,this.Y,this.config_))}W=this.X;W.Z=h;W.Z.appState==chrome.cast.DialAppState.RUNNING?(h=W.Z.extraData||{},c=h.screenId||null,ni(W)&&h.loungeToken?h.loungeTokenRefreshIntervalMs?h=OjS(W,{name:W.W.friendlyName,screenId:h.screenId,loungeToken:h.loungeToken,dialId:W.Z.receiver.label,
- screenIdType:"shortLived"},h.loungeTokenRefreshIntervalMs):(g.pu(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(h)+".")),h=SrU(W,c)):h=SrU(W,c)):h=I8U(W);return h};
- g.l.Ov=function(h){var W=this;if(!this.gE()&&!this.N){zI("New cast session ID: "+h.sessionId);var c=h.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.X)if(c.receiverType==chrome.cast.ReceiverType.CAST)zI("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),Li(this,new xU(this.W,c,this.config_),!0);else{this.uJ("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var V=this.X.W,H=dC(this.W.N5(),
- V.label);H&&Ji(H,c.label)&&V.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(zI("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.hA(this.X),this.X=new xU(this.W,c,this.config_),this.X.subscribe("sessionScreen",(0,g.JS)(this.uK,this,this.X)),this.X.subscribe("sessionFailed",function(){return kZU(W,W.X)}),this.X.XX(null));
- this.X.Ng(h)}}};
- g.l.BW=function(){return this.X?this.X.IJ():null};
- g.l.AwO=function(h){this.gE()||(this.uJ("Failed to estabilish a session: "+g.Nd(h)),h.code!=chrome.cast.ErrorCode.CANCEL&&Li(this,null),this.publish("yt-remote-cast2-session-failed"))};
- g.l.q8z=function(h){zI("Receiver availability updated: "+h);if(!this.gE()){var W=QE(this);this.S=h==chrome.cast.ReceiverAvailability.AVAILABLE;QE(this)!=W&&this.publish("yt-remote-cast2-availability-change",QE(this))}};
- g.l.xf=function(){this.gE()||(this.G=htS(this),zI("Updating custom receivers: "+g.Nd(this.G)),chrome.cast.setCustomReceivers(this.G,function(){},(0,g.JS)(function(){this.uJ("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",QE(this)))};
- eW.prototype.setLaunchParams=eW.prototype.p9B;eW.prototype.setConnectedScreenStatus=eW.prototype.IgH;eW.prototype.stopSession=eW.prototype.eT;eW.prototype.getCastSession=eW.prototype.BW;eW.prototype.requestSession=eW.prototype.requestSession;eW.prototype.init=eW.prototype.init;eW.prototype.dispose=eW.prototype.dispose;var Rt6=[];g.l=Fb.prototype;
- g.l.reset=function(h){this.listId="";this.index=-1;this.videoId="";rnI(this);this.volume=-1;this.muted=!1;h&&(this.index=h.index,this.listId=h.listId,this.videoId=h.videoId,this.playerState=h.playerState,this.volume=h.volume,this.muted=h.muted,this.audioTrackId=h.audioTrackId,this.trackData=h.trackData,this.J0=h.hasPrevious,this.mA=h.hasNext,this.N=h.playerTime,this.C=h.playerTimeAt,this.W=h.seekableStart,this.S=h.seekableEnd,this.G=h.duration,this.Z=h.loadedTime,this.X=h.liveIngestionTime,this.Y=
- !isNaN(this.X))};
- g.l.isPlaying=function(){return this.playerState==1};
- g.l.isBuffering=function(){return this.playerState==3};
- g.l.I3=function(h){this.G=isNaN(h)?0:h};
- g.l.getDuration=function(){return this.Y?this.G+yE(this):this.G};
- g.l.clone=function(){return new Fb(xAS(this))};g.n(Ni,g.h1);g.l=Ni.prototype;g.l.getState=function(){return this.G};
- g.l.WQ=function(){return this.Y.getReconnectTimeout()};
- g.l.qF=function(){this.Y.reconnect()};
- g.l.play=function(){tr(this)?(this.X?this.X.play(null,g.FW,pi(this,"play")):oy(this,"play"),jl$(this,1,fi(Xb(this))),this.publish("remotePlayerChange")):v1(this,this.play)};
- g.l.pause=function(){tr(this)?(this.X?this.X.pause(null,g.FW,pi(this,"pause")):oy(this,"pause"),jl$(this,2,fi(Xb(this))),this.publish("remotePlayerChange")):v1(this,this.pause)};
- g.l.seekTo=function(h){if(tr(this)){if(this.X){var W=Xb(this),c=new chrome.cast.media.SeekRequest;c.currentTime=h;W.isPlaying()||W.isBuffering()?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.X.seek(c,g.FW,pi(this,"seekTo",{newTime:h}))}else oy(this,"seekTo",{newTime:h});jl$(this,3,h);this.publish("remotePlayerChange")}else v1(this,g.uK(this.seekTo,h))};
- g.l.stop=function(){if(tr(this)){this.X?this.X.stop(null,g.FW,pi(this,"stopVideo")):oy(this,"stopVideo");var h=Xb(this);h.index=-1;h.videoId="";rnI(h);m8(this,h);this.publish("remotePlayerChange")}else v1(this,this.stop)};
- g.l.setVolume=function(h,W){if(tr(this)){var c=Xb(this);if(this.W){if(c.volume!=h){var V=Math.round(h)/100;this.W.setReceiverVolumeLevel(V,(0,g.JS)(function(){VE("set receiver volume: "+V)},this),(0,g.JS)(function(){this.uJ("failed to set receiver volume.")},this))}c.muted!=W&&this.W.setReceiverMuted(W,(0,g.JS)(function(){VE("set receiver muted: "+W)},this),(0,g.JS)(function(){this.uJ("failed to set receiver muted.")},this))}else{var H={volume:h,
- muted:W};c.volume!=-1&&(H.delta=h-c.volume);oy(this,"setVolume",H)}c.muted=W;c.volume=h;m8(this,c)}else v1(this,g.uK(this.setVolume,h,W))};
- g.l.MJ=function(h,W){if(tr(this)){var c=Xb(this);h={videoId:h};W&&(c.trackData={trackName:W.name,languageCode:W.languageCode,sourceLanguageCode:W.translationLanguage?W.translationLanguage.languageCode:"",languageName:W.languageName,kind:W.kind},h.style=g.Nd(W.style),g.lN(h,c.trackData));oy(this,"setSubtitlesTrack",h);m8(this,c)}else v1(this,g.uK(this.MJ,h,W))};
- g.l.setAudioTrack=function(h,W){tr(this)?(W=W.getLanguageInfo().getId(),oy(this,"setAudioTrack",{videoId:h,audioTrackId:W}),h=Xb(this),h.audioTrackId=W,m8(this,h)):v1(this,g.uK(this.setAudioTrack,h,W))};
- g.l.playVideo=function(h,W,c,V,H,B,E){V=V===void 0?null:V;H=H===void 0?null:H;B=B===void 0?null:B;E=E===void 0?null:E;var J=Xb(this),u={videoId:h};c!==void 0&&(u.currentIndex=c);b9(J,h,c||0);W!==void 0&&(P1(J,W),u.currentTime=W);V&&(u.listId=V);H&&(u.playerParams=H);B&&(u.clickTrackingParams=B);E&&(u.locationInfo=g.Nd(E));oy(this,"setPlaylist",u);V||m8(this,J)};
- g.l.aq=function(h,W){if(tr(this)){if(h&&W){var c=Xb(this);b9(c,h,W);m8(this,c)}oy(this,"previous")}else v1(this,g.uK(this.aq,h,W))};
- g.l.nextVideo=function(h,W){if(tr(this)){if(h&&W){var c=Xb(this);b9(c,h,W);m8(this,c)}oy(this,"next")}else v1(this,g.uK(this.nextVideo,h,W))};
- g.l.PN=function(){if(tr(this)){oy(this,"clearPlaylist");var h=Xb(this);h.reset();m8(this,h);this.publish("remotePlayerChange")}else v1(this,this.PN)};
- g.l.Qk=function(){tr(this)?oy(this,"dismissAutoplay"):v1(this,this.Qk)};
- g.l.dispose=function(){if(this.G!=3){var h=this.G;this.G=3;this.publish("proxyStateChange",h,this.G)}g.h1.prototype.dispose.call(this)};
- g.l.dE=function(){nAK(this);this.Y=null;this.C.clear();TI(this,null);g.h1.prototype.dE.call(this)};
- g.l.jF=function(h){if((h!=this.G||h==2)&&this.G!=3&&h!=0){var W=this.G;this.G=h;this.publish("proxyStateChange",W,h);if(h==1)for(;!this.C.isEmpty();)W=h=this.C,W.X.length===0&&(W.X=W.W,W.X.reverse(),W.W=[]),h.X.pop().apply(this);else h==3&&this.dispose()}};
- g.l.nd9=function(h,W){this.publish(h,W)};
- g.l.Jkz=function(h){if(!h)this.Fw(null),TI(this,null);else if(this.W.receiver.volume){h=this.W.receiver.volume;var W=Xb(this),c=Math.round(100*h.level||0);if(W.volume!=c||W.muted!=h.muted)VE("Cast volume update: "+h.level+(h.muted?" muted":"")),W.volume=c,W.muted=!!h.muted,m8(this,W)}};
- g.l.Fw=function(h){VE("Cast media: "+!!h);this.X&&this.X.removeUpdateListener(this.Z);if(this.X=h)this.X.addUpdateListener(this.Z),alK(this),this.publish("remotePlayerChange")};
- g.l.ykE=function(h){h?(alK(this),this.publish("remotePlayerChange")):this.Fw(null)};
- g.l.G8=function(){oy(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
- g.l.xng=function(){var h=dA6();h&&TI(this,h)};
- g.l.uJ=function(h){c1("CP",h)};g.n(OD,g.h1);g.l=OD.prototype;
- g.l.connect=function(h,W){if(W){var c=W.listId,V=W.videoId,H=W.videoIds,B=W.playerParams,E=W.clickTrackingParams,J=W.index,u={videoId:V},d=W.currentTime,G=W.locationInfo;W=W.loopMode;d!==void 0&&(u.currentTime=d<=5?0:d);B&&(u.playerParams=B);G&&(u.locationInfo=G);E&&(u.clickTrackingParams=E);c&&(u.listId=c);H&&H.length>0&&(u.videoIds=H.join(","));J!==void 0&&(u.currentIndex=J);this.mW&&(u.loopMode=W||"LOOP_MODE_OFF");c&&(this.X.listId=c);this.X.videoId=V;this.X.index=J||0;this.X.state=3;P1(this.X,
- d);this.C="UNSUPPORTED";c=this.mW?"setInitialState":"setPlaylist";Iy("Connecting with "+c+" and params: "+g.Nd(u));this.W.connect({method:c,params:g.Nd(u)},h,XfU())}else Iy("Connecting without params"),this.W.connect({},h,XfU());L5U(this)};
- g.l.aS=function(h){this.W.aS(h)};
- g.l.dispose=function(){this.gE()||(g.hS("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),YU(this,3));g.h1.prototype.dispose.call(this)};
- g.l.dE=function(){iq$(this);AnU(this);K5l(this);g.uW(this.Z);this.Z=NaN;g.uW(this.T);this.T=NaN;this.Y=null;g.xk(this.XI);this.XI.length=0;this.W.dispose();g.h1.prototype.dE.call(this);this.C=this.S=this.G=this.X=this.W=null};
- g.l.Gd=function(h){if(!this.G||this.G.length===0)return!1;for(var W=g.e(this.G),c=W.next();!c.done;c=W.next())if(!c.value.capabilities.has(h))return!1;return!0};
- g.l.P6=function(){var h=3;this.gE()||(h=0,isNaN(this.kW())?this.W.Nj()&&isNaN(this.N)&&(h=1):h=2);return h};
- g.l.TR=function(h){Iy("Disconnecting with "+h);g.hS("yt.mdx.remote.remoteClient_",null);iq$(this);this.publish("beforeDisconnect",h);h==1&&rC();this.W.disconnect(h);this.dispose()};
- g.l.W6=function(){var h=this.X;this.Y&&(h=this.X.clone(),b9(h,this.Y,h.index));return xAS(h)};
- g.l.E4V=function(h){var W=this,c=new Fb(h);c.videoId&&c.videoId!=this.X.videoId&&(this.Y=c.videoId,g.uW(this.Z),this.Z=g.Rx(function(){if(W.Y){var H=W.Y;W.Y=null;W.X.videoId!=H&&SW(W,"getNowPlaying")}},5E3));
- var V=[];this.X.listId==c.listId&&this.X.videoId==c.videoId&&this.X.index==c.index||V.push("remoteQueueChange");this.X.playerState==c.playerState&&this.X.volume==c.volume&&this.X.muted==c.muted&&fi(this.X)==fi(c)&&g.Nd(this.X.trackData)==g.Nd(c.trackData)||V.push("remotePlayerChange");this.X.reset(h);g.gX(V,function(H){this.publish(H)},this)};
- g.l.YR=function(){var h=this.W.getDeviceId(),W=g.jl(this.G,function(c){return c.type=="REMOTE_CONTROL"&&c.id!=h});
- return W?W.id:""};
- g.l.kW=function(){return this.W.WQ()};
- g.l.J9=function(){return this.C||"UNSUPPORTED"};
- g.l.I_=function(){return this.S||""};
- g.l.Ed=function(){!isNaN(this.kW())&&this.W.qF()};
- g.l.ijz=function(h,W){SW(this,h,W);Cxc(this)};
- g.l.td=function(){var h=g.Cb("SAPISID","")||g.Cb("__Secure-1PAPISID")||"",W=g.Cb("__Secure-3PAPISID","")||"";if(!h&&!W)return"";h=g.i6(g.Ls(h),2);W=g.i6(g.Ls(W),2);return g.i6(g.Ls(","+h+","+W),2)};
- OD.prototype.subscribe=OD.prototype.subscribe;OD.prototype.unsubscribeByKey=OD.prototype.IF;OD.prototype.getProxyState=OD.prototype.P6;OD.prototype.disconnect=OD.prototype.TR;OD.prototype.getPlayerContextData=OD.prototype.W6;OD.prototype.setPlayerContextData=OD.prototype.E4V;OD.prototype.getOtherConnectedRemoteId=OD.prototype.YR;OD.prototype.getReconnectTimeout=OD.prototype.kW;OD.prototype.getAutoplayMode=OD.prototype.J9;OD.prototype.getAutoplayVideoId=OD.prototype.I_;OD.prototype.reconnect=OD.prototype.Ed;
- OD.prototype.sendMessage=OD.prototype.ijz;OD.prototype.getXsrfToken=OD.prototype.td;OD.prototype.isCapabilitySupportedOnConnectedDevices=OD.prototype.Gd;g.n(mAU,B1);g.l=mAU.prototype;g.l.N5=function(h){return this.hh.$_gs(h)};
- g.l.contains=function(h){return!!this.hh.$_c(h)};
- g.l.get=function(h){return this.hh.$_g(h)};
- g.l.start=function(){this.hh.$_st()};
- g.l.add=function(h,W,c){this.hh.$_a(h,W,c)};
- g.l.remove=function(h,W,c){this.hh.$_r(h,W,c)};
- g.l.L3=function(h,W,c,V){this.hh.$_un(h,W,c,V)};
- g.l.dE=function(){for(var h=this.X.length,W=0;W<h;++W)this.hh.$_ubk(this.X[W]);this.X.length=0;this.hh=null;B1.prototype.dE.call(this)};
- g.l.Vd=function(){this.publish("screenChange")};
- g.l.F8O=function(){this.publish("onlineScreenChange")};
- dd.prototype.$_st=dd.prototype.start;dd.prototype.$_gspc=dd.prototype.xj;dd.prototype.$_gsppc=dd.prototype.Jd;dd.prototype.$_c=dd.prototype.contains;dd.prototype.$_g=dd.prototype.get;dd.prototype.$_a=dd.prototype.add;dd.prototype.$_un=dd.prototype.L3;dd.prototype.$_r=dd.prototype.remove;dd.prototype.$_gs=dd.prototype.N5;dd.prototype.$_gos=dd.prototype.yc;dd.prototype.$_s=dd.prototype.subscribe;dd.prototype.$_ubk=dd.prototype.IF;var HQ=null,Rd=!1,gd=null,Dg=null,h_K=null,WQ=[];g.n(s3$,g.N);g.l=s3$.prototype;g.l.dE=function(){g.N.prototype.dE.call(this);this.W.stop();this.G.stop();this.Z.stop();var h=this.tI;h.unsubscribe("proxyStateChange",this.TN,this);h.unsubscribe("remotePlayerChange",this.rL,this);h.unsubscribe("remoteQueueChange",this.JC,this);h.unsubscribe("previousNextChange",this.B_,this);h.unsubscribe("nowAutoplaying",this.Jj,this);h.unsubscribe("autoplayDismissed",this.nD,this);this.tI=this.X=null};
- g.l.kO=function(h){var W=g.tN.apply(1,arguments);if(this.tI.G!=2)if(Jh(this)){if(Xb(this.tI).playerState!=1081||h!=="control_seek")switch(h){case "control_toggle_play_pause":Xb(this.tI).isPlaying()?this.tI.pause():this.tI.play();break;case "control_play":this.tI.play();break;case "control_pause":this.tI.pause();break;case "control_seek":this.S.pH(W[0],W[1]);break;case "control_subtitles_set_track":Bc2(this,W[0]);break;case "control_set_audio_track":this.setAudioTrack(W[0])}}else switch(h){case "control_toggle_play_pause":case "control_play":case "control_pause":W=
- this.L.getCurrentTime();uV(this,W===0?void 0:W);break;case "control_seek":uV(this,W[0]);break;case "control_subtitles_set_track":Bc2(this,W[0]);break;case "control_set_audio_track":this.setAudioTrack(W[0])}};
- g.l.iMB=function(h){this.Z.HW(h)};
- g.l.TeV=function(h){this.kO("control_subtitles_set_track",g.GF(h)?null:h)};
- g.l.Vh=function(){var h=this.L.getOption("captions","track");g.GF(h)||Bc2(this,h)};
- g.l.kd=function(h){this.X.kd(h,this.L.getVideoData().lengthSeconds)};
- g.l.kzk=function(){g.GF(this.Y)||ENK(this,this.Y);this.C=!1};
- g.l.TN=function(h,W){this.G.stop();W===2&&this.rP()};
- g.l.rL=function(){if(Jh(this)){this.W.stop();var h=Xb(this.tI);switch(h.playerState){case 1080:case 1081:case 1084:case 1085:this.X.P5=1;break;case 1082:case 1083:this.X.P5=0;break;default:this.X.P5=-1}switch(h.playerState){case 1081:case 1:this.Tz(new g.l1(8));this.ZR();break;case 1085:case 3:this.Tz(new g.l1(9));break;case 1083:case 0:this.Tz(new g.l1(2));this.S.stop();this.kd(this.L.getVideoData().lengthSeconds);break;case 1084:this.Tz(new g.l1(4));break;case 2:this.Tz(new g.l1(4));this.kd(fi(h));
- break;case -1:this.Tz(new g.l1(64));break;case -1E3:this.Tz(new g.l1(128,{errorCode:"mdx.remoteerror",errorMessage:"\u6b64\u89c6\u9891\u65e0\u6cd5\u8fdc\u7a0b\u64ad\u653e\u3002",mz:2}))}h=Xb(this.tI).trackData;var W=this.Y;(h||W?h&&W&&h.trackName==W.trackName&&h.languageCode==W.languageCode&&h.languageName==W.languageName&&h.kind==W.kind:1)||(this.Y=h,ENK(this,h));h=Xb(this.tI);h.volume===-1||Math.round(this.L.getVolume())===h.volume&&this.L.isMuted()===h.muted||this.T.isActive()||this.EB()}else HxX(this)};
- g.l.B_=function(){this.L.publish("mdxpreviousnextchange")};
- g.l.JC=function(){Jh(this)||HxX(this)};
- g.l.Jj=function(h){isNaN(h)||this.L.publish("mdxnowautoplaying",h)};
- g.l.nD=function(){this.L.publish("mdxautoplaycanceled")};
- g.l.setAudioTrack=function(h){Jh(this)&&this.tI.setAudioTrack(this.L.getVideoData(1).videoId,h)};
- g.l.seekTo=function(h,W){Xb(this.tI).playerState===-1?uV(this,h):W&&this.tI.seekTo(h)};
- g.l.EB=function(){var h=this;if(Jh(this)){var W=Xb(this.tI);this.events.v0(this.XI);W.muted?this.L.mute():this.L.unMute();this.L.setVolume(W.volume);this.XI=this.events.U(this.L,"onVolumeChange",function(c){V2K(h,c)})}};
- g.l.ZR=function(){this.W.stop();if(!this.tI.gE()){var h=Xb(this.tI);h.isPlaying()&&this.Tz(new g.l1(8));this.kd(fi(h));this.W.start()}};
- g.l.rP=function(){this.G.stop();this.W.stop();var h=this.tI.WQ();this.tI.G==2&&!isNaN(h)&&this.G.start()};
- g.l.Tz=function(h){this.G.stop();var W=this.N;if(!g.Q3(W,h)){var c=g.Y(h,2);c!==g.Y(this.N,2)&&this.L.J$(c);this.N=h;uef(this.X,W,h)}};g.n(R_c,g.O7);g.l=R_c.prototype;g.l.getCurrentTime=function(){return this.X.getCurrentTime()};
- g.l.getDuration=function(){return this.X.getDuration()};
- g.l.wW=function(){return this.X.wW()};
- g.l.fg=function(){return this.X.fg()};
- g.l.H3=function(){return this.X.H3()};
- g.l.bP=function(){return this.X.bP()};
- g.l.getPlayerState=function(){return this.X.Zh};
- g.l.isAtLiveHead=function(){return this.X.isAtLiveHead()};
- g.l.pauseVideo=function(){this.X.Hu("control_pause")};
- g.l.playVideo=function(){var h=this;return g.P(function(W){h.X.Hu("control_play");return W.return()})};
- g.l.seekTo=function(h,W){this.X.Hu("control_seek",h,!(W==null?0:W.Cz))};
- g.l.u1=function(h){this.X.Hu("control_set_audio_track",h);return!0};g.n(dt,g.p);dt.prototype.qd=function(){this.fade.show()};
- dt.prototype.NU=function(){this.fade.hide()};
- dt.prototype.X=function(){xI("mdx-privacy-popup-cancel");this.NU()};
- dt.prototype.W=function(){xI("mdx-privacy-popup-confirm");this.NU()};g.n(GB,g.p);GB.prototype.onStateChange=function(h){this.So(h.state)};
- GB.prototype.So=function(h){if(this.api.getPresentingPlayerType()===3){var W={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};h=g.Y(h,128)?g.hl("\u5728$RECEIVER_NAME\u4e0a\u51fa\u73b0\u9519\u8bef",W):h.isPlaying()||h.isPaused()?g.hl("\u6b63\u5728$RECEIVER_NAME\u4e0a\u64ad\u653e",W):g.hl("\u5df2\u8fde\u63a5\u5230$RECEIVER_NAME",W);this.updateValue("statustext",h);this.fade.show()}else this.fade.hide()};g.n(Z5,g.Xt);Z5.prototype.Y=function(){var h=this.L.getOption("remote","receivers");h&&h.length>1&&!this.L.getOption("remote","quickCast")?(this.a5=g.D2(h,this.X,this),this.Yy(g.xw(h,this.X)),h=this.L.getOption("remote","currentReceiver"),h=this.X(h),this.options[h]&&this.BB(h),this.enable(!0)):this.enable(!1)};
- Z5.prototype.X=function(h){return h.key};
- Z5.prototype.GS=function(h){return h==="cast-selector-receiver"?"\u6295\u653e\u2026":this.a5[h].name};
- Z5.prototype.Oy=function(h){g.Xt.prototype.Oy.call(this,h);this.L.setOption("remote","currentReceiver",this.a5[h]);this.YZ.NU()};g.n(J5t,g.K3);g.l=J5t.prototype;
- g.l.create=function(){var h=this.player.B(),W=g.Vf(h);h={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:h.j("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:h.j("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:h.j("enable_cast_short_lived_lounge_token")};OqK(W,h);this.subscriptions.push(g.S5("yt-remote-before-disconnect",this.ZMg,this));this.subscriptions.push(g.S5("yt-remote-connection-change",this.FKz,this));this.subscriptions.push(g.S5("yt-remote-receiver-availability-change",this.VO,
- this));this.subscriptions.push(g.S5("yt-remote-auto-connect",this.RAW,this));this.subscriptions.push(g.S5("yt-remote-receiver-resumed",this.S8n,this));this.subscriptions.push(g.S5("mdx-privacy-popup-confirm",this.Oyk,this));this.subscriptions.push(g.S5("mdx-privacy-popup-cancel",this.AqH,this));this.VO()};
- g.l.load=function(){this.player.cancelPlayback();g.K3.prototype.load.call(this);this.bO=new R_c(this.player.B(),this);this.player.In(this.bO);this.GL=new s3$(this,this.player,this.tI);var h=(h=c52())?h.currentTime:0;var W=keK()?new Ni(sY(),void 0):null;h==0&&W&&(h=fi(Xb(W)));h!==0&&this.kd(h);uef(this,this.Zh,this.Zh);this.player.gZ(6)};
- g.l.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.HF();this.IS=this.u0;g.Wa(this.GL,this.tI);this.tI=this.bO=this.GL=null;g.K3.prototype.unload.call(this);this.player.gZ(5);rt(this)};
- g.l.dE=function(){g.gI(this.subscriptions);g.K3.prototype.dE.call(this)};
- g.l.Hu=function(h){var W=g.tN.apply(1,arguments);this.loaded&&this.GL.kO.apply(this.GL,[h].concat(g.rN(W)))};
- g.l.getAdState=function(){return this.P5};
- g.l.J0=function(){return this.tI?Xb(this.tI).J0:!1};
- g.l.mA=function(){return this.tI?Xb(this.tI).mA:!1};
- g.l.kd=function(h,W){this.LL=h||0;this.player.publish("progresssync",h,W);this.player.lV("onVideoProgress",h||0)};
- g.l.getCurrentTime=function(){return this.LL};
- g.l.getDuration=function(){return Xb(this.tI).getDuration()||0};
- g.l.wW=function(){var h=Xb(this.tI);return h.Y?h.X+yE(h):h.X};
- g.l.fg=function(){return Xb(this.tI).Z};
- g.l.H3=function(){return qcl(Xb(this.tI))};
- g.l.bP=function(){var h=Xb(this.tI);return h.W>0?h.W+yE(h):h.W};
- g.l.getProgressState=function(){var h=Xb(this.tI),W=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:h.playerState!=1081&&this.player.MY(),clipEnd:W.clipEnd,clipStart:W.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.wW(),isAtLiveHead:this.isAtLiveHead(),loaded:this.fg(),seekableEnd:this.H3(),seekableStart:this.bP(),offset:0,viewerLivestreamJoinMediaTime:0}};
- g.l.isAtLiveHead=function(){return qcl(Xb(this.tI))-this.getCurrentTime()<=1};
- g.l.nextVideo=function(){this.tI&&this.tI.nextVideo()};
- g.l.aq=function(){this.tI&&this.tI.aq()};
- g.l.ZMg=function(h){h===1&&(this.FH=this.tI?Xb(this.tI):null)};
- g.l.FKz=function(){var h=keK()?new Ni(sY(),void 0):null;if(h){var W=this.IS;this.loaded&&this.unload();this.tI=h;this.FH=null;W.key!==this.u0.key&&(this.IS=W,this.load())}else g.hA(this.tI),this.tI=null,this.loaded&&(this.unload(),(h=this.FH)&&h.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(h.videoId,fi(h)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
- g.l.VO=function(){var h=[this.u0],W=h.concat,c=Sc$();UD()&&g.KS("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.a5=W.call(h,c);h=DA2()||this.u0;qI(this,h);this.player.lV("onMdxReceiversChange")};
- g.l.RAW=function(){var h=DA2();qI(this,h)};
- g.l.S8n=function(){this.IS=DA2()};
- g.l.Oyk=function(){this.l7=!0;rt(this);Rd=!1;HQ&&EY(HQ,1);HQ=null};
- g.l.AqH=function(){this.l7=!1;rt(this);qI(this,this.u0);this.IS=this.u0;Rd=!1;HQ=null;this.player.playVideo()};
- g.l.Et=function(h,W){switch(h){case "casting":return this.loaded;case "receivers":return this.a5;case "currentReceiver":return W&&(W.key==="cast-selector-receiver"?Ge6():qI(this,W)),this.loaded?this.IS:this.u0;case "quickCast":return this.a5.length===2&&this.a5[1].key==="cast-selector-receiver"?(W&&Ge6(),!0):!1}};
- g.l.G8=function(){this.tI.G8()};
- g.l.xe=function(){return!1};
- g.l.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
- g.l.isLoggedIn=function(){var h,W;return((h=g.X_("PLAYER_CONFIG"))==null?void 0:(W=h.args)==null?void 0:W.authuser)!==void 0?!0:!(!g.X_("SESSION_INDEX")&&!g.X_("LOGGED_IN"))};g.i3("remote",J5t);})(_yt_player);
|