Sono stati aggiunti numerosi nuovi file JavaScript, CSS, SVG e PNG per migliorare la grafica, la responsività e le funzionalità delle pagine di aste, login, notifiche e player video. Introdotte nuove librerie (OneSignal, Bootstrap, Font Awesome, Vue.js, Slick Carousel, ProgressBar.js, CryptoJS, mCustomScrollbar, Switchery) e script per la gestione di notifiche push, tracciamento eventi (Facebook Pixel, TikTok Pixel, Google Ads, Smartech), pagamenti Ingenico, modali, banner promozionali, preferiti, auto-puntate, e gestione utente inattivo. Ampliata la logica del player embedded YouTube con nuovi hook, logging avanzato, gestione ciclo di vita, storage e challenge di attestation. Aggiunti nuovi stili CSS per layout responsive, componenti UI, modali, badge, bottoni, progress bar, e ottimizzazioni mobile. Integrate nuove immagini e icone per arricchire l’interfaccia grafica. Non sono state apportate modifiche al file `www-player.css` e ad altri file specificati. Queste modifiche migliorano la sicurezza, la tracciabilità, l’esperienza utente e la flessibilità dell’applicazione.
757 lines
122 KiB
Plaintext
757 lines
122 KiB
Plaintext
(function(g){var window=this;'use strict';var Zed=function(A){if(A instanceof g.$1)return A;if(typeof A.iM=="function")return A.iM(!1);if(g.lB(A)){var L=0,B=new g.$1;B.next=function(){for(;;){if(L>=A.length)return g.JN;if(L in A)return g.X_(A[L++]);L++}};
|
|
return B}throw Error("Not implemented");},Nl9=function(A,L,B){if(g.lB(A))g.yB(A,L,B);
|
|
else for(A=Zed(A);;){var f=A.next();if(f.done)break;L.call(B,f.value,void 0,A)}},zf=function(A){g.wl(A,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Ed()).toString(36));
|
|
return A},uK=function(A,L,B){Array.isArray(B)||(B=[String(B)]);
|
|
g.Fsk(A.U,L,B)},FKO=function(A,L){var B=[];
|
|
Nl9(L,function(f){try{var K=g.CK.prototype.hY.call(this,f,!0)}catch(V){if(V=="Storage: Invalid value was encountered")return;throw V;}K===void 0?B.push(f):g.lav(K)&&B.push(f)},A);
|
|
return B},DTW=function(A,L){FKO(A,L).forEach(function(B){g.CK.prototype.remove.call(this,B)},A)},dTB=function(A){if(A.Uv){if(A.Uv.locationOverrideToken)return{locationOverrideToken:A.Uv.locationOverrideToken};
|
|
if(A.Uv.latitudeE7!=null&&A.Uv.longitudeE7!=null)return{latitudeE7:A.Uv.latitudeE7,longitudeE7:A.Uv.longitudeE7}}return null},ItX=function(A,L){g.zK(A,L)||A.push(L)},wMt=function(A){var L=0,B;
|
|
for(B in A)L++;return L},pMB=function(A,L){return g.Tk(A,L)},yXw=function(A){try{return g.rI.JSON.parse(A)}catch(L){}A=String(A);
|
|
if(/^\s*$/.test(A)?0:/^[\],:{}\s\u2028\u2029]*$/.test(A.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("("+A+")")}catch(L){}throw Error("Invalid JSON string: "+A);},ai=function(A){if(g.rI.JSON)try{return g.rI.JSON.parse(A)}catch(L){}return yXw(A)},jaR=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/channel/opened",g.Ix("channel_type"))},gw5=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/channel/closed",g.Ix("channel_type"))},G75=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Ix("channel_type"))},rXO=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/channel/success")},saf=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/channel/error",g.Ix("channel_type"),g.Ix("error_type"))},He5=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},hMX=function(){var A=Ac();
|
|
this.N=A;A.gR("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},beI=function(A,L,B,f){var K=new g.ZS(null);
|
|
A&&g.Zt(K,A);L&&g.NC(K,L);B&&g.NT(K,B);f&&(K.W=f);return K},tFB=function(A,L){return new g.KK(A,L)},LN=function(A,L){return Object.prototype.hasOwnProperty.call(A,L)},k7I=function(A,L){return A===L},oZ=function(A,L){this.W={};
|
|
this.N=[];this.W$=this.size=0;var B=arguments.length;if(B>1){if(B%2)throw Error("Uneven number of arguments");for(var f=0;f<B;f+=2)this.set(arguments[f],arguments[f+1])}else if(A)if(A instanceof oZ)for(B=A.F1(),f=0;f<B.length;f++)this.set(B[f],A.get(B[f]));else for(f in A)this.set(f,A[f])},Bs=function(A){if(A.size!=A.N.length){for(var L=0,B=0;L<A.N.length;){var f=A.N[L];
|
|
LN(A.W,f)&&(A.N[B++]=f);L++}A.N.length=B}if(A.size!=A.N.length){L={};for(f=B=0;B<A.N.length;){var K=A.N[B];LN(L,K)||(A.N[f++]=K,L[K]=1);B++}A.N.length=f}},fN=function(A){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 oZ;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";A&&(this.id=A.id||A.name,this.name=A.name,this.clientName=A.clientName?A.clientName.toUpperCase():"UNKNOWN_INTERFACE",
|
|
this.app=A.app,this.type=A.type||"REMOTE_CONTROL",this.username=A.user||"",this.avatar=A.userAvatarUri||"",this.obfuscatedGaiaId=A.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=A.ownerObfuscatedGaiaId||"",this.theme=A.theme||"u",Tlf(this,A.capabilities||""),ltK(this,A.compatibleSenderThemes||""),mTO(this,A.experiments||""),this.brand=A.brand||"",this.model=A.model||"",this.year=A.year||0,this.os=A.os||"",this.osVersion=A.osVersion||"",this.chipset=A.chipset||"",this.mdxDialServerType=A.mdxDialServerType||
|
|
"MDX_DIAL_SERVER_TYPE_UNKNOWN",A=A.deviceInfo)&&(A=JSON.parse(A),this.brand=A.brand||"",this.model=A.model||"",this.year=A.year||0,this.os=A.os||"",this.osVersion=A.osVersion||"",this.chipset=A.chipset||"",this.clientName=A.clientName?A.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=A.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},Tlf=function(A,L){A.capabilities.clear();
|
|
g.Mi(L.split(","),g.Od(pMB,QaB)).forEach(function(B){A.capabilities.add(B)})},ltK=function(A,L){A.compatibleSenderThemes.clear();
|
|
g.Mi(L.split(","),g.Od(pMB,CNB)).forEach(function(B){A.compatibleSenderThemes.add(B)})},mTO=function(A,L){A.experiments.clear();
|
|
L.split(",").forEach(function(B){A.experiments.add(B)})},KN=function(A){A=A||{};
|
|
this.name=A.name||"";this.id=A.id||A.screenId||"";this.token=A.token||A.loungeToken||"";this.uuid=A.uuid||A.dialId||"";this.idType=A.screenIdType||"normal";this.secret=A.screenIdSecret||""},VO=function(A,L){return!!L&&(A.id==L||A.uuid==L)},ieX=function(A){return{name:A.name,
|
|
screenId:A.id,loungeToken:A.token,dialId:A.uuid,screenIdType:A.idType,screenIdSecret:A.secret}},$TK=function(A){return new KN(A)},XMf=function(A){return Array.isArray(A)?g.mn(A,$TK):[]},Jc=function(A){return A?'{name:"'+A.name+'",id:'+A.id.substr(0,6)+"..,token:"+((A.token?".."+A.token.slice(-6):"-")+",uuid:"+(A.uuid?".."+A.uuid.slice(-6):"-")+",idType:"+A.idType+",secret:")+((A.secret?".."+A.secret.slice(-6):"-")+"}"):"null"},OeX=function(A){return Array.isArray(A)?"["+g.mn(A,Jc).join(",")+"]":"null"},
|
|
EwK=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(A){var L=Math.random()*16|0;
|
|
return(A=="x"?L:L&3|8).toString(16)})},cXO=function(A){return g.mn(A,function(L){return{key:L.id,
|
|
name:L.name}})},MFB=function(A,L){return g.Pw(A,function(B){return B||L?!B!=!L?!1:B.id==L.id:!0})},Su=function(A,L){return g.Pw(A,function(B){return VO(B,L)})},YBX=function(){var A=g.X$.lT();
|
|
A&&DTW(A,A.cq.iM(!0))},RZ=function(){var A=g.ES("yt-remote-connected-devices")||[];
|
|
g.I8(A);return A},UTd=function(A){if(A.length==0)return[];
|
|
var L=A[0].indexOf("#"),B=L==-1?A[0]:A[0].substring(0,L);return g.mn(A,function(f,K){return K==0?f:f.substring(B.length)})},WKd=function(A){g.OS("yt-remote-connected-devices",A,86400)},Zv=function(){if(vww)return vww;
|
|
var A=g.ES("yt-remote-device-id");A||(A=EwK(),g.OS("yt-remote-device-id",A,31536E3));for(var L=RZ(),B=1,f=A;g.zK(L,f);)B++,f=A+"#"+B;return vww=f},qBf=function(){var A=RZ(),L=Zv();
|
|
g.ME()&&g.px(A,L);A=UTd(A);if(A.length==0)try{g.UQ("remote_sid")}catch(B){}else try{g.Ms("remote_sid",A.join(","),-1)}catch(B){}},PN5=function(){return g.ES("yt-remote-session-browser-channel")},xTI=function(){return g.ES("yt-remote-local-screens")||[]},eMI=function(){g.OS("yt-remote-lounge-token-expiration",!0,86400)},nwI=function(A){A.length>5&&(A=A.slice(A.length-5));
|
|
var L=g.mn(xTI(),function(f){return f.loungeToken}),B=g.mn(A,function(f){return f.loungeToken});
|
|
g.Q9(B,function(f){return!g.zK(L,f)})&&eMI();
|
|
g.OS("yt-remote-local-screens",A,31536E3)},N3=function(A){A||(g.c9("yt-remote-session-screen-id"),g.c9("yt-remote-session-video-id"));
|
|
qBf();A=RZ();g.Lx(A,Zv());WKd(A)},zMW=function(){if(!FH){var A=g.cC();
|
|
A&&(FH=new g.lk(A))}},uOW=function(){zMW();
|
|
return FH?!!FH.get("yt-remote-use-staging-server"):!1},Dv=function(A,L){g.oW[A]=!0;
|
|
var B=g.A0();B&&B.publish.apply(B,arguments);g.oW[A]=!1},atf=function(){},Ac=function(){if(!dJ){dJ=new g.UE(new atf);
|
|
var A=g.bl("client_streamz_web_flush_count",-1);A!==-1&&(dJ.V=A)}return dJ},Azt=function(){var A=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
|
|
return A?parseInt(A[1],10):0},Lot=function(A){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+A)!=-1||document.currentScript.src.indexOf("&"+A)!=-1)},oCW=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},IZ=function(A){A.length?B$B(A.shift(),function(){IZ(A)}):f1t()},Ko5=function(A){return"chrome-extension://"+A+"/cast_sender.js"},B$B=function(A,L,B){var f=document.createElement("script");
|
|
f.onerror=L;B&&(f.onload=B);g.ET(f,g.Q4(A));(document.head||document.documentElement).appendChild(f)},VRK=function(){var A=Azt(),L=[];
|
|
if(A>1){var B=A-1;L.push("//www.gstatic.com/eureka/clank/"+A+"/cast_sender.js");L.push("//www.gstatic.com/eureka/clank/"+B+"/cast_sender.js")}return L},f1t=function(){var A=oCW();
|
|
A&&A(!1,"No cast extension found")},SnK=function(){if(JzO){var A=2,L=oCW(),B=function(){A--;
|
|
A==0&&L&&L(!0)};
|
|
window.__onGCastApiAvailable=B;B$B("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",f1t,B)}},RRI=function(){SnK();
|
|
var A=VRK();A.push("//www.gstatic.com/eureka/clank/cast_sender.js");IZ(A)},N$d=function(){SnK();
|
|
var A=VRK();A.push.apply(A,g.x7(ZKw.map(Ko5)));A.push("//www.gstatic.com/eureka/clank/cast_sender.js");IZ(A)},wJ=function(A,L,B){g.Y.call(this);
|
|
this.T=B!=null?(0,g.X9)(A,B):A;this.LV=L;this.D=(0,g.X9)(this.Lq,this);this.N=!1;this.W=0;this.V=this.x6=null;this.U=[]},pN=function(){this.N=g.Ed()},FoB=function(){yO||(yO=new pN)},DHf=function(){yO||(yO=new pN)},ju=function(){},dHK=function(){g.f8.call(this,"p")},I1f=function(){g.f8.call(this,"o")},pCK=function(){return wCf=wCf||new g.gb},yzK=function(A){g.f8.call(this,"serverreachability",A)},gJ=function(A){var L=pCK();
|
|
L.dispatchEvent(new yzK(L,A))},j1f=function(A){g.f8.call(this,"statevent",A)},Gn=function(A){var L=pCK();
|
|
L.dispatchEvent(new j1f(L,A))},gCf=function(A,L,B,f){g.f8.call(this,"timingevent",A);
|
|
this.size=L;this.rtt=B;this.retries=f},rJ=function(A,L){if(typeof A!=="function")throw Error("Fn must not be null and must be a function");
|
|
return g.rI.setTimeout(function(){A()},L)},sm=function(){},Hs=function(A,L,B,f){this.V=A;
|
|
this.U=L;this.KY=B;this.zV=f||1;this.ql=new g.gl(this);this.Ox=45E3;this.S4=null;this.T=!1;this.yj=this.sx=this.G=this.Ys=this.Vj=this.Nl=this.Wn=null;this.qp=[];this.N=null;this.X=0;this.D=this.ZM=null;this.mH=-1;this.JF=!1;this.cn=0;this.Cr=null;this.jI=this.Ex=this.Uv=this.wT=!1;this.W=new GFO},GFO=function(){this.V=null;
|
|
this.N="";this.W=!1},s1I=function(A,L,B){A.Ys=1;
|
|
A.G=zf(L.clone());A.yj=B;A.wT=!0;rzd(A,null)},rzd=function(A,L){A.Vj=Date.now();
|
|
hc(A);A.sx=A.G.clone();uK(A.sx,"t",A.zV);A.X=0;var B=A.V.Ex;A.W=new GFO;A.N=HKf(A.V,B?L:null,!A.yj);A.cn>0&&(A.Cr=new g.BC((0,g.X9)(A.eh,A,A.N),A.cn));A.ql.listen(A.N,"readystatechange",A.yY);L=A.S4?g.is(A.S4):{};A.yj?(A.ZM||(A.ZM="POST"),L["Content-Type"]="application/x-www-form-urlencoded",A.N.send(A.sx,A.ZM,A.yj,L)):(A.ZM="GET",A.N.send(A.sx,A.ZM,null,L));gJ(1)},bKw=function(A){if(!hRK(A))return g.a$(A.N);
|
|
var L=g.Au(A.N);if(L==="")return"";var B="",f=L.length,K=g.z9(A.N)==4;if(!A.W.V){if(typeof TextDecoder==="undefined")return bx(A),tc(A),"";A.W.V=new g.rI.TextDecoder}for(var V=0;V<f;V++)A.W.W=!0,B+=A.W.V.decode(L[V],{stream:!(K&&V==f-1)});L.length=0;A.W.N+=B;A.X=0;return A.W.N},hRK=function(A){return A.N?A.ZM=="GET"&&A.Ys!=2&&A.V.o4:!1},T$K=function(A,L){var B=A.X,f=L.indexOf("\n",B);
|
|
if(f==-1)return tRK;B=Number(L.substring(B,f));if(isNaN(B))return kFd;f+=1;if(f+B>L.length)return tRK;L=L.slice(f,f+B);A.X=f+B;return L},hc=function(A){A.Nl=Date.now()+A.Ox;
|
|
l1W(A,A.Ox)},l1W=function(A,L){if(A.Wn!=null)throw Error("WatchDog timer not null");
|
|
A.Wn=rJ((0,g.X9)(A.Nr,A),L)},mHR=function(A){A.Wn&&(g.rI.clearTimeout(A.Wn),A.Wn=null)},tc=function(A){A.V.vV()||A.JF||Q1d(A.V,A)},bx=function(A){mHR(A);
|
|
g.jq(A.Cr);A.Cr=null;A.ql.removeAll();if(A.N){var L=A.N;A.N=null;L.abort();L.dispose()}},MRf=function(A,L){try{var B=A.V;
|
|
if(B.a4!=0&&(B.N==A||CkB(B.W,A)))if(!A.Ex&&CkB(B.W,A)&&B.a4==3){try{var f=B.a8.N.parse(L)}catch(h){f=null}if(Array.isArray(f)&&f.length==3){var K=f;if(K[0]==0)a:{if(!B.G){if(B.N)if(B.N.Vj+3E3<A.Vj)kO(B),Tn(B);else break a;iK5(B);Gn(18)}}else B.LD=K[1],0<B.LD-B.Ys&&K[2]<37500&&B.Cr&&B.qp==0&&!B.Wn&&(B.Wn=rJ((0,g.X9)(B.W_,B),6E3));if($Hf(B.W)<=1&&B.mH){try{B.mH()}catch(h){}B.mH=void 0}}else lx(B,11)}else if((A.Ex||B.N==A)&&kO(B),!g.us(L))for(K=B.a8.N.parse(L),L=0;L<K.length;L++){var V=K[L],J=V[0];if(!(J<=
|
|
B.Ys))if(B.Ys=J,V=V[1],B.a4==2)if(V[0]=="c"){B.U=V[1];B.KY=V[2];var R=V[3];R!=null&&(B.QA=R);var Z=V[5];Z!=null&&typeof Z==="number"&&Z>0&&(B.cn=1.5*Z);f=B;var N=A.HM();if(N){var F=g.L2(N,"X-Client-Wire-Protocol");if(F){var D=f.W;!D.N&&(g.a8(F,"spdy")||g.a8(F,"quic")||g.a8(F,"h2"))&&(D.U=D.D,D.N=new Set,D.W&&(XCt(D,D.W),D.W=null))}if(f.wT){var I=g.L2(N,"X-HTTP-Session-Id");I&&(f.jD=I,g.wl(f.S4,f.wT,I))}}B.a4=3;B.D&&B.D.O3();B.N8&&(B.k6=Date.now()-A.Vj);f=B;var d=A;f.GZ=OKf(f,f.Ex?f.KY:null,f.t$);
|
|
if(d.Ex){ECB(f.W,d);var w=d,r=f.cn;r&&w.setTimeout(r);w.Wn&&(mHR(w),hc(w));f.N=d}else czB(f);B.V.length>0&&mA(B)}else V[0]!="stop"&&V[0]!="close"||lx(B,7);else B.a4==3&&(V[0]=="stop"||V[0]=="close"?V[0]=="stop"?lx(B,7):B.disconnect():V[0]!="noop"&&B.D&&B.D.oL(V),B.qp=0)}gJ(4)}catch(h){}},Ynw=function(A,L){this.N=A;
|
|
this.map=L;this.context=null},UHw=function(A){this.D=A||10;
|
|
g.rI.PerformanceNavigationTiming?(A=g.rI.performance.getEntriesByType("navigation"),A=A.length>0&&(A[0].nextHopProtocol=="hq"||A[0].nextHopProtocol=="h2")):A=!!(g.rI.chrome&&g.rI.chrome.loadTimes&&g.rI.chrome.loadTimes()&&g.rI.chrome.loadTimes().wasFetchedViaSpdy);this.U=A?this.D:1;this.N=null;this.U>1&&(this.N=new Set);this.W=null;this.V=[]},Wo9=function(A){return A.W?!0:A.N?A.N.size>=A.U:!1},$Hf=function(A){return A.W?1:A.N?A.N.size:0},CkB=function(A,L){return A.W?A.W==L:A.N?A.N.has(L):!1},XCt=
|
|
function(A,L){A.N?A.N.add(L):A.W=L},ECB=function(A,L){A.W&&A.W==L?A.W=null:A.N&&A.N.has(L)&&A.N.delete(L)},vCt=function(A){if(A.W!=null)return A.V.concat(A.W.qp);
|
|
if(A.N!=null&&A.N.size!==0){var L=A.V;A=g.m(A.N.values());for(var B=A.next();!B.done;B=A.next())L=L.concat(B.value.qp);return L}return g.Kx(A.V)},qnf=function(A,L){var B=new sm;
|
|
if(g.rI.Image){var f=new Image;f.onload=g.Od(QO,B,"TestLoadImage: loaded",!0,L,f);f.onerror=g.Od(QO,B,"TestLoadImage: error",!1,L,f);f.onabort=g.Od(QO,B,"TestLoadImage: abort",!1,L,f);f.ontimeout=g.Od(QO,B,"TestLoadImage: timeout",!1,L,f);g.rI.setTimeout(function(){if(f.ontimeout)f.ontimeout()},1E4);
|
|
f.src=A}else L(!1)},PkO=function(A,L){var B=new sm,f=new AbortController,K=setTimeout(function(){f.abort();
|
|
QO(B,"TestPingServer: timeout",!1,L)},1E4);
|
|
fetch(A,{signal:f.signal}).then(function(V){clearTimeout(K);V.ok?QO(B,"TestPingServer: ok",!0,L):QO(B,"TestPingServer: server error",!1,L)}).catch(function(){clearTimeout(K);
|
|
QO(B,"TestPingServer: error",!1,L)})},QO=function(A,L,B,f,K){try{K&&(K.onload=null,K.onerror=null,K.onabort=null,K.ontimeout=null),f(B)}catch(V){}},xHw=function(){this.N=new ju},CN=function(A,L,B){return B&&B.fMM?B.fMM[A]||L:L},eRw=function(A){this.V=[];
|
|
this.KY=this.GZ=this.S4=this.t$=this.N=this.jD=this.wT=this.JF=this.X=this.Uv=this.yj=null;this.Bk=this.sx=0;this.Ry=CN("failFast",!1,A);this.Cr=this.Wn=this.G=this.T=this.D=null;this.Pz=!0;this.LD=this.Ys=-1;this.zV=this.qp=this.Vj=0;this.Po=CN("baseRetryDelayMs",5E3,A);this.Pk=CN("retryDelaySeedMs",1E4,A);this.O_=CN("forwardChannelMaxRetries",2,A);this.WR=CN("forwardChannelRequestTimeoutMs",2E4,A);this.m1=A&&A.hRj||void 0;this.b2=A&&A.jGn||void 0;this.o4=A&&A.AIF||!1;this.cn=void 0;this.Ex=A&&A.ogs||
|
|
!1;this.U="";this.W=new UHw(A&&A.Q64);this.nD=Math.min(A&&A.w4T||1E3,1E3);this.a8=new xHw;this.ql=A&&A.JVx||!1;this.Nl=A&&A.VH1||!1;this.ql&&this.Nl&&(this.Nl=!1);this.mC=A&&A.EhF||!1;A&&A.ju4&&(this.Pz=!1);this.N8=!this.ql&&this.Pz&&A&&A.BKr||!1;this.TZ=void 0;A&&A.N5&&A.N5>0&&(this.TZ=A.N5);this.mH=void 0;this.k6=0;this.Ox=!1;this.jI=this.ZM=null},Tn=function(A){A.N&&(nCd(A),A.N.cancel(),A.N=null)},zRW=function(A){Tn(A);
|
|
A.G&&(g.rI.clearTimeout(A.G),A.G=null);kO(A);A.W.cancel();A.T&&(typeof A.T==="number"&&g.rI.clearTimeout(A.T),A.T=null)},mA=function(A){Wo9(A.W)||A.T||(A.T=!0,g.lX(A.aL,A),A.Vj=0)},a15=function(A,L){if($Hf(A.W)>=A.W.U-(A.T?1:0))return!1;
|
|
if(A.T)return A.V=L.qp.concat(A.V),!0;if(A.a4==1||A.a4==2||A.Vj>=(A.Ry?0:A.O_))return!1;A.T=rJ((0,g.X9)(A.aL,A,L),uqf(A,A.Vj));A.Vj++;return!0},Lcf=function(A,L){var B;
|
|
L?B=L.KY:B=A.sx++;var f=A.S4.clone();g.wl(f,"SID",A.U);g.wl(f,"RID",B);g.wl(f,"AID",A.Ys);ix(A,f);A.X&&A.yj&&g.jF(f,A.X,A.yj);B=new Hs(A,A.U,B,A.Vj+1);A.X===null&&(B.S4=A.yj);L&&(A.V=L.qp.concat(A.V));L=Alw(A,B,A.nD);B.setTimeout(Math.round(A.WR*.5)+Math.round(A.WR*.5*Math.random()));XCt(A.W,B);s1I(B,f,L)},ix=function(A,L){A.JF&&g.H6(A.JF,function(B,f){g.wl(L,f,B)});
|
|
A.D&&g.H6({},function(B,f){g.wl(L,f,B)})},Alw=function(A,L,B){B=Math.min(A.V.length,B);
|
|
var f=A.D?(0,g.X9)(A.D.H_,A.D,A):null;a:{for(var K=A.V,V=-1;;){var J=["count="+B];V==-1?B>0?(V=K[0].N,J.push("ofs="+V)):V=0:J.push("ofs="+V);for(var R=!0,Z=0;Z<B;Z++){var N=K[Z].N,F=K[Z].map;N-=V;if(N<0)V=Math.max(0,K[Z].N-100),R=!1;else try{N="req"+N+"_"||"";try{var D=F instanceof Map?F:Object.entries(F);for(var I=g.m(D),d=I.next();!d.done;d=I.next()){var w=g.m(d.value),r=w.next().value,h=w.next().value,Q=h;g.QK(h)&&(Q=g.vD(h));J.push(N+r+"="+encodeURIComponent(Q))}}catch(l){throw J.push(N+"type="+
|
|
encodeURIComponent("_badmap")),l;}}catch(l){f&&f(F)}}if(R){D=J.join("&");break a}}D=void 0}A=A.V.splice(0,B);L.qp=A;return D},czB=function(A){A.N||A.G||(A.zV=1,g.lX(A.vK,A),A.qp=0)},iK5=function(A){if(A.N||A.G||A.qp>=3)return!1;
|
|
A.zV++;A.G=rJ((0,g.X9)(A.vK,A),uqf(A,A.qp));A.qp++;return!0},nCd=function(A){A.ZM!=null&&(g.rI.clearTimeout(A.ZM),A.ZM=null)},oRf=function(A){A.N=new Hs(A,A.U,"rpc",A.zV);
|
|
A.X===null&&(A.N.S4=A.yj);A.N.cn=0;var L=A.GZ.clone();g.wl(L,"RID","rpc");g.wl(L,"SID",A.U);g.wl(L,"AID",A.Ys);g.wl(L,"CI",A.Cr?"0":"1");!A.Cr&&A.TZ&&g.wl(L,"TO",A.TZ);g.wl(L,"TYPE","xmlhttp");ix(A,L);A.X&&A.yj&&g.jF(L,A.X,A.yj);A.cn&&A.N.setTimeout(A.cn);var B=A.N;A=A.KY;B.Ys=1;B.G=zf(L.clone());B.yj=null;B.wT=!0;rzd(B,A)},kO=function(A){A.Wn!=null&&(g.rI.clearTimeout(A.Wn),A.Wn=null)},Q1d=function(A,L){var B=null;
|
|
if(A.N==L){kO(A);nCd(A);A.N=null;var f=2}else if(CkB(A.W,L))B=L.qp,ECB(A.W,L),f=1;else return;if(A.a4!=0)if(L.T)if(f==1){B=L.yj?L.yj.length:0;L=Date.now()-L.Vj;var K=A.Vj;f=pCK();f.dispatchEvent(new gCf(f,B,L,K));mA(A)}else czB(A);else{var V=L.mH;K=L.getLastError();if(K==3||K==0&&V>0||!(f==1&&a15(A,L)||f==2&&iK5(A)))switch(B&&B.length>0&&(L=A.W,L.V=L.V.concat(B)),K){case 1:lx(A,5);break;case 4:lx(A,10);break;case 3:lx(A,6);break;default:lx(A,2)}}},uqf=function(A,L){var B=A.Po+Math.floor(Math.random()*
|
|
A.Pk);
|
|
A.isActive()||(B*=2);return B*L},lx=function(A,L){if(L==2){var B=(0,g.X9)(A.dqr,A),f=A.b2,K=!f;
|
|
f=new g.ZS(f||"//www.google.com/images/cleardot.gif");g.rI.location&&g.rI.location.protocol=="http"||g.Zt(f,"https");zf(f);K?qnf(f.toString(),B):PkO(f.toString(),B)}else Gn(2);A.a4=0;A.D&&A.D.GD(L);BnW(A);zRW(A)},BnW=function(A){A.a4=0;
|
|
A.jI=[];if(A.D){var L=vCt(A.W);if(L.length!=0||A.V.length!=0)g.VB(A.jI,L),g.VB(A.jI,A.V),A.W.V.length=0,g.Kx(A.V),A.V.length=0;A.D.Ks()}},flK=function(A){if(A.a4==0)return A.jI;
|
|
var L=[];g.VB(L,vCt(A.W));g.VB(L,A.V);return L},OKf=function(A,L,B){var f=g.$7(B);
|
|
f.N!=""?(L&&g.NC(f,L+"."+f.N),g.NT(f,f.V)):(f=g.rI.location,f=beI(f.protocol,L?L+"."+f.hostname:f.hostname,+f.port,B));L=A.wT;B=A.jD;L&&B&&g.wl(f,L,B);g.wl(f,"VER",A.QA);ix(A,f);return f},HKf=function(A,L,B){if(L&&!A.Ex)throw Error("Can't create secondary domain capable XhrIo object.");
|
|
L=A.o4&&!A.m1?new g.xA(new g.Vy({NH:B})):new g.xA(A.m1);L.X=A.Ex;return L},Kc9=function(){},VtX=function(){},XH=function(A,L){g.gb.call(this);
|
|
this.N=new eRw(L);this.D=A;this.W=L&&L.rwr||null;A=L&&L.gP1||null;L&&L.pgr&&(A?A["X-Client-Protocol"]="webchannel":A={"X-Client-Protocol":"webchannel"});this.N.yj=A;A=L&&L.G$j||null;L&&L.tb&&(A?A["X-WebChannel-Content-Type"]=L.tb:A={"X-WebChannel-Content-Type":L.tb});L&&L.Gw&&(A?A["X-WebChannel-Client-Profile"]=L.Gw:A={"X-WebChannel-Client-Profile":L.Gw});this.N.Uv=A;(A=L&&L.a9T)&&!g.us(A)&&(this.N.X=A);this.T=L&&L.ogs||!1;this.U=L&&L.NaL||!1;(L=L&&L.rFr)&&!g.us(L)&&(this.N.wT=L,g.kg(this.W,L)&&(A=
|
|
this.W,L in A&&delete A[L]));this.V=new $O(this)},JlO=function(A){dHK.call(this);
|
|
A.__headers__&&(this.headers=A.__headers__,this.statusCode=A.__status__,delete A.__headers__,delete A.__status__);var L=A.__sm__;L?this.data=(this.N=g.Hk(L))?g.QB(L,this.N):L:this.data=A},S5W=function(A){I1f.call(this);
|
|
this.status=1;this.errorCode=A},$O=function(A){this.N=A},R2d=function(A,L){this.W=A;
|
|
this.N=L},ZX9=function(A){return flK(A.N).map(function(L){var B=A.W;
|
|
L=L.map;"__data__"in L?(L=L.__data__,B=B.U?yXw(L):L):B=L;return B})},Om=function(A,L){if(typeof A!=="function")throw Error("Fn must not be null and must be a function");
|
|
return g.rI.setTimeout(function(){A()},L)},cs=function(A){Em.dispatchEvent(new Nnf(Em,A))},Nnf=function(A){g.f8.call(this,"statevent",A)},M3=function(A,L,B,f){this.N=A;
|
|
this.U=L;this.X=B;this.T=f||1;this.W=45E3;this.V=new g.gl(this);this.D=new g.cD;this.D.setInterval(250)},Dvf=function(A,L,B){A.ll=1;
|
|
A.Zc=zf(L.clone());A.Mh=B;A.wT=!0;FcK(A,null)},dvX=function(A,L,B,f,K){A.ll=1;
|
|
A.Zc=zf(L.clone());A.Mh=null;A.wT=B;K&&(A.Sv=!1);FcK(A,f)},FcK=function(A,L){A.Rp=Date.now();
|
|
IlK(A);A.IQ=A.Zc.clone();uK(A.IQ,"t",A.T);A.bl=0;A.S6=A.N.dD(A.N.S0()?L:null);A.Px>0&&(A.qB=new g.BC((0,g.X9)(A.cK,A,A.S6),A.Px));A.V.listen(A.S6,"readystatechange",A.IW);L=A.Zu?g.is(A.Zu):{};A.Mh?(A.Vd="POST",L["Content-Type"]="application/x-www-form-urlencoded",A.S6.send(A.IQ,A.Vd,A.Mh,L)):(A.Vd="GET",A.Sv&&!g.h8&&(L.Connection="close"),A.S6.send(A.IQ,A.Vd,null,L));A.N.SL(1)},ylf=function(A,L){var B=A.bl,f=L.indexOf("\n",B);
|
|
if(f==-1)return wtK;B=Number(L.substring(B,f));if(isNaN(B))return ptW;f+=1;if(f+B>L.length)return wtK;L=L.slice(f,f+B);A.bl=f+B;return L},IlK=function(A){A.L1=Date.now()+A.W;
|
|
jwK(A,A.W)},jwK=function(A,L){if(A.SY!=null)throw Error("WatchDog timer not null");
|
|
A.SY=Om((0,g.X9)(A.qr,A),L)},gRK=function(A){A.SY&&(g.rI.clearTimeout(A.SY),A.SY=null)},GRO=function(A){A.N.vV()||A.Dc||A.N.yQ(A)},YO=function(A){gRK(A);
|
|
g.jq(A.qB);A.qB=null;A.D.stop();A.V.removeAll();if(A.S6){var L=A.S6;A.S6=null;L.abort();L.dispose()}A.jA&&(A.jA=null)},rlW=function(A,L){try{A.N.BK(A,L),A.N.SL(4)}catch(B){}},HXW=function(A,L,B,f,K){if(f==0)B(!1);
|
|
else{var V=K||0;f--;swX(A,L,function(J){J?B(!0):g.rI.setTimeout(function(){HXW(A,L,B,f,V)},V)})}},swX=function(A,L,B){var f=new Image;
|
|
f.onload=function(){try{vs(f),B(!0)}catch(K){}};
|
|
f.onerror=function(){try{vs(f),B(!1)}catch(K){}};
|
|
f.onabort=function(){try{vs(f),B(!1)}catch(K){}};
|
|
f.ontimeout=function(){try{vs(f),B(!1)}catch(K){}};
|
|
g.rI.setTimeout(function(){if(f.ontimeout)f.ontimeout()},L);
|
|
f.src=A},vs=function(A){A.onload=null;
|
|
A.onerror=null;A.onabort=null;A.ontimeout=null},h2t=function(A){this.N=A;
|
|
this.W=new ju},bXf=function(A){var L=q3(A.N,A.kq,"/mail/images/cleardot.gif");
|
|
zf(L);HXW(L.toString(),5E3,(0,g.X9)(A.r9,A),3,2E3);A.SL(1)},ttd=function(A){var L=A.N.T;
|
|
L!=null?(cs(5),L?(cs(11),Ps(A.N,A,!1)):(cs(12),Ps(A.N,A,!0))):(A.pQ=new M3(A),A.pQ.Zu=A.Nx,L=A.N,L=q3(L,L.S0()?A.t9:null,A.W6),cs(5),uK(L,"TYPE","xmlhttp"),dvX(A.pQ,L,!1,A.t9,!1))},kRt=function(A,L,B){this.N=1;
|
|
this.W=[];this.V=[];this.D=new ju;this.yj=A||null;this.T=L!=null?L:null;this.G=B||!1},TnX=function(A,L){this.N=A;
|
|
this.map=L;this.context=null},llI=function(A,L,B,f){g.f8.call(this,"timingevent",A);
|
|
this.size=L;this.rtt=B;this.retries=f},mvK=function(A){g.f8.call(this,"serverreachability",A)},C8K=function(A){A.l6(1,0);
|
|
A.FE=q3(A,null,A.qx);QwX(A)},iXt=function(A){A.QI&&(A.QI.abort(),A.QI=null);
|
|
A.yF&&(A.yF.cancel(),A.yF=null);A.Mn&&(g.rI.clearTimeout(A.Mn),A.Mn=null);xO(A);A.mX&&(A.mX.cancel(),A.mX=null);A.FV&&(g.rI.clearTimeout(A.FV),A.FV=null)},$vR=function(A,L){if(A.N==0)throw Error("Invalid operation: sending map when state is closed");
|
|
A.W.push(new TnX(A.kM++,L));A.N!=2&&A.N!=3||QwX(A)},Xt5=function(A){var L=0;
|
|
A.yF&&L++;A.mX&&L++;return L},QwX=function(A){A.mX||A.FV||(A.FV=Om((0,g.X9)(A.NL,A),0),A.Tv=0)},clK=function(A,L){if(A.N==1){if(!L){A.Tx=Math.floor(Math.random()*1E5);
|
|
L=A.Tx++;var B=new M3(A,"",L);B.Zu=A.j5;var f=OXW(A),K=A.FE.clone();g.wl(K,"RID",L);g.wl(K,"CVER","1");eu(A,K);Dvf(B,K,f);A.mX=B;A.N=2}}else A.N==3&&(L?ERt(A,L):A.W.length==0||A.mX||ERt(A))},ERt=function(A,L){if(L)if(A.RV>6){A.W=A.V.concat(A.W);
|
|
A.V.length=0;var B=A.Tx-1;L=OXW(A)}else B=L.X,L=L.Mh;else B=A.Tx++,L=OXW(A);var f=A.FE.clone();g.wl(f,"SID",A.U);g.wl(f,"RID",B);g.wl(f,"AID",A.jY);eu(A,f);B=new M3(A,A.U,B,A.Tv+1);B.Zu=A.j5;B.setTimeout(1E4+Math.round(1E4*Math.random()));A.mX=B;Dvf(B,f,L)},eu=function(A,L){A.Kh&&(A=A.Kh.Ii())&&g.H6(A,function(B,f){g.wl(L,f,B)})},OXW=function(A){var L=Math.min(A.W.length,1E3),B=["count="+L];
|
|
if(A.RV>6&&L>0){var f=A.W[0].N;B.push("ofs="+f)}else f=0;for(var K={},V=0;V<L;K={mV:void 0},V++){K.mV=A.W[V].N;var J=A.W[V].map;K.mV=A.RV<=6?V:K.mV-f;try{g.H6(J,function(R){return function(Z,N){B.push("req"+R.mV+"_"+N+"="+encodeURIComponent(Z))}}(K))}catch(R){B.push("req"+K.mV+"_type="+encodeURIComponent("_badmap"))}}A.V=A.V.concat(A.W.splice(0,L));
|
|
return B.join("&")},MtR=function(A){A.yF||A.Mn||(A.X=1,A.Mn=Om((0,g.X9)(A.dH,A),0),A.Jk=0)},UvW=function(A){if(A.yF||A.Mn||A.Jk>=3)return!1;
|
|
A.X++;A.Mn=Om((0,g.X9)(A.dH,A),Y5w(A,A.Jk));A.Jk++;return!0},Ps=function(A,L,B){A.wD=A.T==null?B:!A.T;
|
|
A.Qh=L.Do;A.G||C8K(A)},xO=function(A){A.ST!=null&&(g.rI.clearTimeout(A.ST),A.ST=null)},Y5w=function(A,L){var B=5E3+Math.floor(Math.random()*1E4);
|
|
A.isActive()||(B*=2);return B*L},nN=function(A,L){if(L==2||L==9){var B=null;
|
|
A.Kh&&(B=null);var f=(0,g.X9)(A.LDn,A);B||(B=new g.ZS("//www.google.com/images/cleardot.gif"),zf(B));swX(B.toString(),1E4,f)}else cs(2);WcI(A,L)},WcI=function(A,L){A.N=0;
|
|
A.Kh&&A.Kh.yv(L);vRd(A);iXt(A)},vRd=function(A){A.N=0;
|
|
A.Qh=-1;if(A.Kh)if(A.V.length==0&&A.W.length==0)A.Kh.Il();else{var L=g.Kx(A.V),B=g.Kx(A.W);A.V.length=0;A.W.length=0;A.Kh.Il(L,B)}},q3=function(A,L,B){var f=g.$7(B);
|
|
if(f.N!="")L&&g.NC(f,L+"."+f.N),g.NT(f,f.V);else{var K=window.location;f=beI(K.protocol,L?L+"."+K.hostname:K.hostname,+K.port,B)}A.JS&&g.H6(A.JS,function(V,J){g.wl(f,J,V)});
|
|
g.wl(f,"VER",A.RV);eu(A,f);return f},q5R=function(){},P8d=function(){this.N=[];
|
|
this.W=[]},xv5=function(A){g.f8.call(this,"channelMessage");
|
|
this.message=A},e2B=function(A){g.f8.call(this,"channelError");
|
|
this.error=A},nRf=function(A,L){this.action=A;
|
|
this.params=L||{}},zn=function(A,L){g.Y.call(this);
|
|
this.N=new g.aa(this.pkD,0,this);g.W(this,this.N);this.LV=5E3;this.retryCount=this.T5=0;if(typeof A==="function")L&&(A=(0,g.X9)(A,L));else if(A&&typeof A.handleEvent==="function")A=(0,g.X9)(A.handleEvent,A);else throw Error("Invalid listener argument");this.W=A},z2w=function(A,L,B,f,K,V,J,R,Z,N,F,D,I,d,w,r){var h=this;
|
|
B=B===void 0?!1:B;f=f===void 0?function(){return""}:f;
|
|
K=K===void 0?!1:K;V=V===void 0?!1:V;J=J===void 0?!1:J;R=R===void 0?function(){return g.iX({})}:R;
|
|
Z=Z===void 0?!1:Z;F=F===void 0?!1:F;D=D===void 0?!1:D;I=I===void 0?!1:I;d=d===void 0?!1:d;this.Cr=A;this.Vj=L;this.G=new g.TF;this.T=r;this.W=(this.V=!!w)?w(function(){h.Rw()}):new zn(this.Rw,this);
|
|
this.N=null;this.yj=!1;this.qp=null;this.wT="";this.ZM=this.Wn=0;this.U=[];this.KY=B;this.S4=f;this.X=V;this.Ex=R;this.Ys=N;this.t$=J;this.JF=null;this.D=g.iX();this.Pz=K;this.zV=Z;this.Uv=F;this.mH=D;this.N8=I;this.jI=d;this.Nl=new jaR;this.sx=new gw5;this.ql=new rXO;this.Ox=new G75;this.cn=new saf;this.k6=new He5;this.TZ=new hMX},A_I=function(A,L,B,f,K){uCt(A);
|
|
if(A.N){var V=g.A_("ID_TOKEN"),J=A.N.j5||{};V?J["x-youtube-identity-token"]=V:delete J["x-youtube-identity-token"];A.N.j5=J}alB(A);f?(f.getState()!=3&&Xt5(f)==0||f.getState(),A.N.connect(L,B,A.Vj,f.U,f.jY)):K?A.N.connect(L,B,A.Vj,K.sessionId,K.arrayId):A.N.connect(L,B,A.Vj);A.V&&!A.W.isActive()&&A.W.start();A.T&&A.T.jVM()},fpf=function(A,L){return A.N8?!0:A.mH?Object.values(LMd).includes(L):A.Uv?!Object.values(ozw).includes(L):A.jI?Object.values(BWK).includes(L):!1},J_W=function(A){var L,B;
|
|
g.c(function(f){if(f.N==1)return g.RO(f,2),g.X(f,KMd(A),2);g.F9(f);L=A.U;A.U=[];B=L.length;Vkd(A,L,B);ux(A);return g.DR(f,0)})},Vkd=function(A,L,B){for(var f=0;f<B;++f)$vR(A.N,L[f]);
|
|
ux(A)},ux=function(A){A.publish("handlerOpened");
|
|
A.Nl.gI("BROWSER_CHANNEL")},uCt=function(A){if(A.N){var L=A.S4(),B=A.N.j5||{};
|
|
L?B["x-youtube-lounge-xsrf-token"]=L:delete B["x-youtube-lounge-xsrf-token"];A.N.j5=B}},KMd=function(A){if(A.zV)return g.iX();
|
|
if(!A.t$)return SQw(A);A.JF===null&&(A.JF=SQw(A));return A.JF},SQw=function(A){return g.OE(A.Ex().then(function(L){Rzd(A,L)}).c9(function(){}),function(){A.JF=null})},Rzd=function(A,L){if(A.N){var B=A.N.j5||{};
|
|
L&&Object.keys(L).length>0?B=Object.assign({},B,L):delete B.Authorization;A.N.j5=B}},alB=function(A){A.Ys&&!A.X&&Rzd(A,A.Ys())},aZ=function(A){this.scheme="https";
|
|
this.port=this.domain="";this.N="/api/lounge";this.W=!0;A=A||document.location.href;var L=Number(g.bp(A)[4]||null)||"";L&&(this.port=":"+L);this.domain=g.tW(A)||"";A=g.fa();A.search("MSIE")>=0&&(A=A.match(/MSIE ([\d.]+)/)[1],g.B5(A,"10.0")<0&&(this.W=!1))},AJ=function(A,L){var B=A.N;
|
|
A.W&&(B=A.scheme+"://"+A.domain+A.port+A.N);return g.ip(B+L,{})},Zgw=function(A,L){g.gb.call(this);
|
|
var B=this;this.handler=A();this.handler.subscribe("handlerOpened",this.b6,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(f,K){B.onError(K)});
|
|
this.handler.subscribe("handlerMessage",this.onMessage,this);this.N=L},NW9=function(A,L,B){var f=this;
|
|
B=B===void 0?function(){return""}:B;
|
|
var K=K===void 0?new VtX:K;var V=V===void 0?new g.TF:V;this.pathPrefix=A;this.N=L;this.Vj=B;this.D=V;this.G=null;this.yj=this.X=0;this.channel=null;this.T=0;this.V=new zn(function(){f.V.isActive();var J;((J=f.channel)==null?void 0:$Hf((new R2d(J,J.N)).N.W))===0&&f.connect(f.G,f.X)});
|
|
this.U={};this.W={};this.Wn=!1;this.logger=null;this.qp=[];this.zy=void 0;this.S4=new jaR;this.ZM=new gw5;this.JF=new G75;this.wT=new saf},FMd=function(A){g.Ft(A.channel,"m",function(){A.T=3;
|
|
A.V.reset();A.G=null;A.X=0;for(var L=g.m(A.qp),B=L.next();!B.done;B=L.next())B=B.value,A.channel&&A.channel.send(B);A.qp=[];A.publish("webChannelOpened");A.S4.gI("WEB_CHANNEL")});
|
|
g.Ft(A.channel,"n",function(){A.T=0;A.V.isActive()||A.publish("webChannelClosed");var L,B=(L=A.channel)==null?void 0:ZX9(new R2d(L,L.N));B&&(A.qp=[].concat(g.x7(B)));A.ZM.gI("WEB_CHANNEL")});
|
|
g.Ft(A.channel,"p",function(L){var B=L.data;B[0]==="gracefulReconnect"?(A.V.start(),A.channel&&A.channel.close()):A.publish("webChannelMessage",new nRf(B[0],B[1]));A.zy=L.statusCode;A.JF.gI("WEB_CHANNEL")});
|
|
g.Ft(A.channel,"o",function(){A.zy===401||A.V.start();A.publish("webChannelError");A.wT.gI("WEB_CHANNEL","")})},DsK=function(A){var L=A.Vj();
|
|
L?A.U["x-youtube-lounge-xsrf-token"]=L:delete A.U["x-youtube-lounge-xsrf-token"]},dsK=function(A){g.gb.call(this);
|
|
this.N=A();this.N.subscribe("webChannelOpened",this.tD,this);this.N.subscribe("webChannelClosed",this.onClosed,this);this.N.subscribe("webChannelError",this.onError,this);this.N.subscribe("webChannelMessage",this.onMessage,this)},IpO=function(A,L,B,f,K){function V(){return new z2w(AJ(A,"/bc"),L,!1,B,f)}
|
|
B=B===void 0?function(){return""}:B;
|
|
return g.h_("enable_mdx_web_channel_desktop")?new dsK(function(){return new NW9(AJ(A,"/wc"),L,B)}):new Zgw(V,K)},jM9=function(){var A=w7I;
|
|
p7W();LA.push(A);y_I()},ob=function(A,L){p7W();
|
|
var B=gzw(A,String(L));LA.length==0?GcO(B):(y_I(),g.yB(LA,function(f){f(B)}))},Bz=function(A){ob("CP",A)},p7W=function(){LA||(LA=g.bB("yt.mdx.remote.debug.handlers_")||[],g.hf("yt.mdx.remote.debug.handlers_",LA))},GcO=function(A){var L=(fA+1)%50;
|
|
fA=L;KA[L]=A;Vk||(Vk=L==49)},y_I=function(){var A=LA;
|
|
if(KA[0]){var L=Vk?fA:-1,B={};do B={PW:void 0},L=(L+1)%50,B.PW=KA[L],g.yB(A,function(f){return function(K){K(f.PW)}}(B));
|
|
while(L!=fA);KA=Array(50);fA=-1;Vk=!1}},gzw=function(A,L){var B=(Date.now()-r_K)/1E3;
|
|
B.toFixed&&(B=B.toFixed(3));var f=[];f.push("[",B+"s","] ");f.push("[","yt.mdx.remote","] ");f.push(A+": "+L,"\n");return f.join("")},JJ=function(A){g.SN.call(this);
|
|
this.T=A;this.screens=[]},sMW=function(A,L){var B=A.get(L.uuid)||A.get(L.id);
|
|
if(B)return A=B.name,B.id=L.id||B.id,B.name=L.name,B.token=L.token,B.uuid=L.uuid||B.uuid,B.name!=A;A.screens.push(L);return!0},Hgw=function(A,L){var B=A.screens.length!=L.length;
|
|
A.screens=g.Mi(A.screens,function(V){return!!MFB(L,V)});
|
|
for(var f=L.length,K=0;K<f;K++)B=sMW(A,L[K])||B;return B},hzK=function(A,L){var B=A.screens.length;
|
|
A.screens=g.Mi(A.screens,function(f){return!(f||L?!f!=!L?0:f.id==L.id:1)});
|
|
return A.screens.length<B},bgX=function(A,L,B,f,K){g.SN.call(this);
|
|
this.V=A;this.X=L;this.U=B;this.T=f;this.D=K;this.W=0;this.N=null;this.x6=NaN},Rb=function(A){JJ.call(this,"LocalScreenService");
|
|
this.W=A;this.N=NaN;S0(this);this.info("Initializing with "+OeX(this.screens))},tkR=function(A){if(A.screens.length){var L=g.mn(A.screens,function(f){return f.id}),B=AJ(A.W,"/pairing/get_lounge_token_batch");
|
|
A.W.sendRequest("POST",B,{screen_ids:L.join(",")},(0,g.X9)(A.Hrj,A),(0,g.X9)(A.W44,A))}},S0=function(A){if(g.h_("deprecate_pair_servlet_enabled"))return Hgw(A,[]);
|
|
var L=XMf(xTI());L=g.Mi(L,function(B){return!B.uuid});
|
|
return Hgw(A,L)},ZM=function(A,L){nwI(g.mn(A.screens,ieX));
|
|
L&&eMI()},TWW=function(A,L){g.SN.call(this);
|
|
this.T=L;L=(L=g.ES("yt-remote-online-screen-ids")||"")?L.split(","):[];for(var B={},f=this.T(),K=f.length,V=0;V<K;++V){var J=f[V].id;B[J]=g.zK(L,J)}this.N=B;this.D=A;this.V=this.U=NaN;this.W=null;kc9("Initialized with "+g.vD(this.N))},lpW=function(A,L,B){var f=AJ(A.D,"/pairing/get_screen_availability");
|
|
A.D.sendRequest("POST",f,{lounge_token:L.token},(0,g.X9)(function(K){K=K.screens||[];for(var V=K.length,J=0;J<V;++J)if(K[J].loungeToken==L.token){B(K[J].status=="online");return}B(!1)},A),(0,g.X9)(function(){B(!1)},A))},QM5=function(A,L){a:if(wMt(L)!=wMt(A.N))var B=!1;
|
|
else{B=g.bs(L);for(var f=B.length,K=0;K<f;++K)if(!A.N[B[K]]){B=!1;break a}B=!0}B||(kc9("Updated online screens: "+g.vD(A.N)),A.N=L,A.publish("screenChange"));msw(A)},Nu=function(A){isNaN(A.V)||g.rW(A.V);
|
|
A.V=g.gW((0,g.X9)(A.nN,A),A.U>0&&A.U<g.Ed()?2E4:1E4)},kc9=function(A){ob("OnlineScreenService",A)},ClR=function(A){var L={};
|
|
g.yB(A.T(),function(B){B.token?L[B.token]=B.id:this.VC("Requesting availability of screen w/o lounge token.")});
|
|
return L},msw=function(A){A=g.bs(g.Gk(A.N,function(L){return L}));
|
|
g.I8(A);A.length?g.OS("yt-remote-online-screen-ids",A.join(","),60):g.c9("yt-remote-online-screen-ids")},FJ=function(A,L){L=L===void 0?!1:L;
|
|
JJ.call(this,"ScreenService");this.U=A;this.X=L;this.N=this.W=null;this.V=[];this.D={};igf(this)},X7t=function(A,L,B,f,K,V){A.info("getAutomaticScreenByIds "+B+" / "+L);
|
|
B||(B=A.D[L]);var J=A.on(),R=B?Su(J,B):null;B&&(A.X||R)||(R=Su(J,L));if(R){R.uuid=L;var Z=DM(A,R);lpW(A.N,Z,function(N){K(N?Z:null)})}else B?$sO(A,B,(0,g.X9)(function(N){var F=DM(this,new KN({name:f,
|
|
screenId:B,loungeToken:N,dialId:L||""}));lpW(this.N,F,function(D){K(D?F:null)})},A),V):K(null)},OgW=function(A,L){for(var B=A.screens.length,f=0;f<B;++f)if(A.screens[f].name==L)return A.screens[f];
|
|
return null},Ezf=function(A,L,B){lpW(A.N,L,B)},$sO=function(A,L,B,f){A.info("requestLoungeToken_ for "+L);
|
|
var K={postParams:{screen_ids:L},method:"POST",context:A,onSuccess:function(V,J){V=J&&J.screens||[];V[0]&&V[0].screenId==L?B(V[0].loungeToken):f(Error("Missing lounge token in token response"))},
|
|
onError:function(){f(Error("Request screen lounge token failed"))}};
|
|
g.ll(AJ(A.U,"/pairing/get_lounge_token_batch"),K)},c_w=function(A){A.screens=A.W.on();
|
|
var L=A.D,B={},f;for(f in L)B[L[f]]=f;L=A.screens.length;for(f=0;f<L;++f){var K=A.screens[f];K.uuid=B[K.id]||""}A.info("Updated manual screens: "+OeX(A.screens))},igf=function(A){Mkw(A);
|
|
A.W=new Rb(A.U);A.W.subscribe("screenChange",(0,g.X9)(A.t4F,A));c_w(A);A.X||(A.V=XMf(g.ES("yt-remote-automatic-screen-cache")||[]));Mkw(A);A.info("Initializing automatic screens: "+OeX(A.V));A.N=new TWW(A.U,(0,g.X9)(A.on,A,!0));A.N.subscribe("screenChange",(0,g.X9)(function(){this.publish("onlineScreenChange")},A))},DM=function(A,L){var B=A.get(L.id);
|
|
B?(B.uuid=L.uuid,L=B):((B=Su(A.V,L.uuid))?(B.id=L.id,B.token=L.token,L=B):A.V.push(L),A.X||YQK(A));Mkw(A);A.D[L.uuid]=L.id;g.OS("yt-remote-device-id-map",A.D,31536E3);return L},YQK=function(A){A=g.Mi(A.V,function(L){return L.idType!="shortLived"});
|
|
g.OS("yt-remote-automatic-screen-cache",g.mn(A,ieX))},Mkw=function(A){A.D=g.ES("yt-remote-device-id-map")||{}},dO=function(A,L,B){g.SN.call(this);
|
|
this.wT=B;this.U=A;this.W=L;this.N=null},Ib=function(A,L){A.N=L;
|
|
A.publish("sessionScreen",A.N)},Ust=function(A,L){A.N&&(A.N.token=L,DM(A.U,A.N));
|
|
A.publish("sessionScreen",A.N)},wO=function(A,L){ob(A.wT,L)},pA=function(A,L,B){dO.call(this,A,L,"CastSession");
|
|
var f=this;this.config_=B;this.V=null;this.qp=(0,g.X9)(this.D6,this);this.ZM=(0,g.X9)(this.N1L,this);this.Wn=g.gW(function(){WMw(f,null)},12E4);
|
|
this.X=this.D=this.T=this.G=0;this.Vj=!1;this.yj="unknown"},qQK=function(A,L){g.rW(A.X);
|
|
A.X=0;L==0?vzB(A):A.X=g.gW(function(){vzB(A)},L)},vzB=function(A){PlK(A,"getLoungeToken");
|
|
g.rW(A.D);A.D=g.gW(function(){xs9(A,null)},3E4)},PlK=function(A,L){A.info("sendYoutubeMessage_: "+L+" "+g.vD());
|
|
var B={};B.type=L;A.V?A.V.sendMessage("urn:x-cast:com.google.youtube.mdx",B,function(){},(0,g.X9)(function(){wO(this,"Failed to send message: "+L+".")},A)):wO(A,"Sending yt message without session: "+g.vD(B))},ezd=function(A,L){L?(A.info("onConnectedScreenId_: Received screenId: "+L),A.N&&A.N.id==L||A.Sn(L,function(B){Ib(A,B)},function(){return A.xR()},5)):A.xR(Error("Waiting for session status timed out."))},zzf=function(A,L,B){A.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(L));
|
|
var f=new KN(L);nzK(A,f,function(K){K?(A.Vj=!0,DM(A.U,f),Ib(A,f),A.yj="unknown",qQK(A,B)):(g.B7(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(L)+" is not online.")),A.xR())},5)},WMw=function(A,L){g.rW(A.Wn);
|
|
A.Wn=0;L?A.config_.enableCastLoungeToken&&L.loungeToken?L.deviceId?A.N&&A.N.uuid==L.deviceId||(L.loungeTokenRefreshIntervalMs?zzf(A,{name:A.W.friendlyName,screenId:L.screenId,loungeToken:L.loungeToken,dialId:L.deviceId,screenIdType:"shortLived"},L.loungeTokenRefreshIntervalMs):(g.B7(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(L)+".")),ezd(A,L.screenId))):(g.B7(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(L)+".")),ezd(A,L.screenId)):
|
|
ezd(A,L.screenId):A.xR(Error("Waiting for session status timed out."))},xs9=function(A,L){g.rW(A.D);
|
|
A.D=0;var B=null;if(L)if(L.loungeToken){var f;((f=A.N)==null?void 0:f.token)==L.loungeToken&&(B="staleLoungeToken")}else B="missingLoungeToken";else B="noLoungeTokenResponse";B?(A.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(L)+", error: "+B)),A.yj=B,qQK(A,3E4)):(Ust(A,L.loungeToken),A.Vj=!1,A.yj="unknown",qQK(A,L.loungeTokenRefreshIntervalMs))},nzK=function(A,L,B,f){g.rW(A.T);
|
|
A.T=0;Ezf(A.U,L,function(K){K||f<0?B(K):A.T=g.gW(function(){nzK(A,L,B,f-1)},300)})},ua5=function(A){g.rW(A.G);
|
|
A.G=0;g.rW(A.T);A.T=0;g.rW(A.Wn);A.Wn=0;g.rW(A.D);A.D=0;g.rW(A.X);A.X=0},yk=function(A,L,B,f){dO.call(this,A,L,"DialSession");
|
|
this.config_=f;this.V=this.G=null;this.ZM="";this.Ys=B;this.S4=null;this.Wn=function(){};
|
|
this.yj=NaN;this.JF=(0,g.X9)(this.Mr,this);this.D=function(){};
|
|
this.X=this.T=0;this.qp=!1;this.Vj="unknown"},j0=function(A){var L;
|
|
return!!(A.config_.enableDialLoungeToken&&((L=A.V)==null?0:L.getDialAppInfo))},apB=function(A){A.D=A.U.mx(A.ZM,A.W.label,A.W.friendlyName,j0(A),function(L,B){A.D=function(){};
|
|
A.qp=!0;Ib(A,L);L.idType=="shortLived"&&B>0&&gO(A,B)},function(L){A.D=function(){};
|
|
A.xR(L)})},AKI=function(A){var L={};
|
|
L.pairingCode=A.ZM;L.theme=A.Ys;uOW()&&(L.env_useStageMdx=1);return g.CC(L)},LuR=function(A){return new Promise(function(L){A.ZM=EwK();
|
|
if(A.S4){var B=new chrome.cast.DialLaunchResponse(!0,AKI(A));L(B);apB(A)}else A.Wn=function(){g.rW(A.yj);A.Wn=function(){};
|
|
A.yj=NaN;var f=new chrome.cast.DialLaunchResponse(!0,AKI(A));L(f);apB(A)},A.yj=g.gW(function(){A.Wn()},100)})},BLw=function(A,L,B){A.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(L));
|
|
var f=new KN(L);return(new Promise(function(K){o_9(A,f,function(V){V?(A.qp=!0,DM(A.U,f),Ib(A,f),gO(A,B)):g.B7(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(L)+" is not online."));K(V)},5)})).then(function(K){return K?new chrome.cast.DialLaunchResponse(!1):LuR(A)})},fGt=function(A,L){var B=A.G.receiver.label,f=A.W.friendlyName;
|
|
return(new Promise(function(K){X7t(A.U,B,L,f,function(V){V&&V.token&&Ib(A,V);K(V)},function(V){wO(A,"Failed to get DIAL screen: "+V);
|
|
K(null)})})).then(function(K){return K&&K.token?new chrome.cast.DialLaunchResponse(!1):LuR(A)})},o_9=function(A,L,B,f){g.rW(A.T);
|
|
A.T=0;Ezf(A.U,L,function(K){K||f<0?B(K):A.T=g.gW(function(){o_9(A,L,B,f-1)},300)})},gO=function(A,L){A.info("getDialAppInfoWithTimeout_ "+L);
|
|
j0(A)&&(g.rW(A.X),A.X=0,L==0?KuK(A):A.X=g.gW(function(){KuK(A)},L))},KuK=function(A){j0(A)&&A.V.getDialAppInfo(function(L){A.info("getDialAppInfo dialLaunchData: "+JSON.stringify(L));
|
|
L=L.extraData||{};var B=null;if(L.loungeToken){var f;((f=A.N)==null?void 0:f.token)==L.loungeToken&&(B="staleLoungeToken")}else B="missingLoungeToken";B?(A.Vj=B,gO(A,3E4)):(A.qp=!1,A.Vj="unknown",Ust(A,L.loungeToken),gO(A,L.loungeTokenRefreshIntervalMs))},function(L){A.info("getDialAppInfo error: "+L);
|
|
A.Vj="noLoungeTokenResponse";gO(A,3E4)})},Vww=function(A){g.rW(A.T);
|
|
A.T=0;g.rW(A.X);A.X=0;A.D();A.D=function(){};
|
|
g.rW(A.yj)},G_=function(A,L){dO.call(this,A,L,"ManualSession");
|
|
this.V=g.gW((0,g.X9)(this.wA,this,null),150)},rO=function(A,L){g.SN.call(this);
|
|
this.config_=L;this.W=A;this.G=L.appId||"233637DE";this.U=L.theme||"cl";this.yj=L.disableCastApi||!1;this.T=L.forceMirroring||!1;this.N=null;this.X=!1;this.V=[];this.D=(0,g.X9)(this.dQn,this)},JKK=function(A,L){return L?g.Pw(A.V,function(B){return VO(L,B.label)},A):null},s1=function(A){ob("Controller",A)},w7I=function(A){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(A)},Hz=function(A){return A.X||!!A.V.length||!!A.N},hJ=function(A,L,B){L!=A.N&&(g.jq(A.N),(A.N=L)?(B?A.publish("yt-remote-cast2-receiver-resumed",
|
|
L.W):A.publish("yt-remote-cast2-receiver-selected",L.W),L.subscribe("sessionScreen",(0,g.X9)(A.wO,A,L)),L.subscribe("sessionFailed",function(){return SS9(A,L)}),L.N?A.publish("yt-remote-cast2-session-change",L.N):B&&A.N.wA(null)):A.publish("yt-remote-cast2-session-change",null))},SS9=function(A,L){A.N==L&&A.publish("yt-remote-cast2-session-failed")},RmK=function(A){var L=A.W.Vv(),B=A.N&&A.N.W;
|
|
A=g.mn(L,function(f){B&&VO(f,B.label)&&(B=null);var K=f.uuid?f.uuid:f.id,V=JKK(this,f);V?(V.label=K,V.friendlyName=f.name):(V=new chrome.cast.Receiver(K,f.name),V.receiverType=chrome.cast.ReceiverType.CUSTOM);return V},A);
|
|
B&&(B.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(B=new chrome.cast.Receiver(B.label,B.friendlyName),B.receiverType=chrome.cast.ReceiverType.CUSTOM),A.push(B));return A},p9B=function(A,L,B,f){f.disableCastApi?be("Cannot initialize because disabled by Mdx config."):ZnX()?NLf(L,f)&&(Fuw(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?DEB(A,B):(window.__onGCastApiAvailable=function(K,V){K?DEB(A,B):(tJ("Failed to load cast API: "+V),dEW(!1),Fuw(!1),g.c9("yt-remote-cast-available"),g.c9("yt-remote-cast-receiver"),
|
|
IGd(),B(!1))},f.loadCastApiSetupScript?g.J0(w9K):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?Azt()>=60&&RRI():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?f1t():Azt()>=89?N$d():(SnK(),IZ(ZKw.map(Ko5))))):be("Cannot initialize because not running Chrome")},IGd=function(){be("dispose");
|
|
var A=kP();A&&A.dispose();g.hf("yt.mdx.remote.cloudview.instance_",null);yKO(!1);g.KV(jXO);jXO.length=0},T_=function(){return!!g.ES("yt-remote-cast-installed")},g_9=function(){var A=g.ES("yt-remote-cast-receiver");
|
|
return A?A.friendlyName:null},GTt=function(){be("clearCurrentReceiver");
|
|
g.c9("yt-remote-cast-receiver")},rKI=function(){return T_()?kP()?kP().getCastSession():(tJ("getCastSelector: Cast is not initialized."),null):(tJ("getCastSelector: Cast API is not installed!"),null)},sXd=function(){T_()?kP()?le()?(be("Requesting cast selector."),kP().requestSession()):(be("Wait for cast API to be ready to request the session."),jXO.push(g.fV("yt-remote-cast2-api-ready",sXd))):tJ("requestCastSelector: Cast is not initialized."):tJ("requestCastSelector: Cast API is not installed!")},
|
|
mp=function(A,L){le()?kP().setConnectedScreenStatus(A,L):tJ("setConnectedScreenStatus called before ready.")},ZnX=function(){var A=g.fa().search(/ (CrMo|Chrome|CriOS)\//)>=0;
|
|
return g.Z2||A},HnI=function(A,L){kP().init(A,L)},NLf=function(A,L){var B=!1;
|
|
kP()||(A=new rO(A,L),A.subscribe("yt-remote-cast2-availability-change",function(f){g.OS("yt-remote-cast-available",f);Dv("yt-remote-cast2-availability-change",f)}),A.subscribe("yt-remote-cast2-receiver-selected",function(f){be("onReceiverSelected: "+f.friendlyName);
|
|
g.OS("yt-remote-cast-receiver",f);Dv("yt-remote-cast2-receiver-selected",f)}),A.subscribe("yt-remote-cast2-receiver-resumed",function(f){be("onReceiverResumed: "+f.friendlyName);
|
|
g.OS("yt-remote-cast-receiver",f);Dv("yt-remote-cast2-receiver-resumed",f)}),A.subscribe("yt-remote-cast2-session-change",function(f){be("onSessionChange: "+Jc(f));
|
|
f||g.c9("yt-remote-cast-receiver");Dv("yt-remote-cast2-session-change",f)}),g.hf("yt.mdx.remote.cloudview.instance_",A),B=!0);
|
|
be("cloudview.createSingleton_: "+B);return B},kP=function(){return g.bB("yt.mdx.remote.cloudview.instance_")},DEB=function(A,L){dEW(!0);
|
|
Fuw(!1);HnI(A,function(B){B?(yKO(!0),g.V0("yt-remote-cast2-api-ready")):(tJ("Failed to initialize cast API."),dEW(!1),g.c9("yt-remote-cast-available"),g.c9("yt-remote-cast-receiver"),IGd());L(B)})},be=function(A){ob("cloudview",A)},tJ=function(A){ob("cloudview",A)},dEW=function(A){be("setCastInstalled_ "+A);
|
|
g.OS("yt-remote-cast-installed",A)},le=function(){return!!g.bB("yt.mdx.remote.cloudview.apiReady_")},yKO=function(A){be("setApiReady_ "+A);
|
|
g.hf("yt.mdx.remote.cloudview.apiReady_",A)},Fuw=function(A){g.hf("yt.mdx.remote.cloudview.initializing_",A)},Qk=function(A){this.index=-1;
|
|
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.D=this.T=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.V=this.X=this.W=0;this.N=NaN;this.U=!1;this.reset(A)},hmt=function(A){A.audioTrackId=null;
|
|
A.trackData=null;A.playerState=-1;A.hasPrevious=!1;A.hasNext=!1;A.T=0;A.D=g.Ed();A.W=0;A.X=0;A.V=0;A.loadedTime=0;A.N=NaN;A.U=!1},CA=function(A){return A.isPlaying()?(g.Ed()-A.D)/1E3:0},ie=function(A,L){A.T=L;
|
|
A.D=g.Ed()},$P=function(A){switch(A.playerState){case 1:case 1081:return(g.Ed()-A.D)/1E3+A.T;
|
|
case -1E3:return 0}return A.T},bnW=function(A){return A.U?A.X+CA(A):A.X},XJ=function(A,L,B){var f=A.videoId;
|
|
A.videoId=L;A.index=B;L!=f&&hmt(A)},tww=function(A){var L={};
|
|
L.index=A.index;L.listId=A.listId;L.videoId=A.videoId;L.playerState=A.playerState;L.volume=A.volume;L.muted=A.muted;L.audioTrackId=A.audioTrackId;L.trackData=g.$g(A.trackData);L.hasPrevious=A.hasPrevious;L.hasNext=A.hasNext;L.playerTime=A.T;L.playerTimeAt=A.D;L.seekableStart=A.W;L.seekableEnd=A.X;L.duration=A.V;L.loadedTime=A.loadedTime;L.liveIngestionTime=A.N;return L},E1=function(A,L){g.SN.call(this);
|
|
var B=this;this.V=0;this.U=A;this.T=[];this.D=new P8d;this.W=this.N=null;this.yj=(0,g.X9)(this.m8r,this);this.X=(0,g.X9)(this.rJ,this);this.G=(0,g.X9)(this.V$j,this);this.Wn=(0,g.X9)(this.t$L,this);var f=0;A?(f=A.getProxyState(),f!=3&&(A.subscribe("proxyStateChange",this.l$,this),kTK(this))):f=3;f!=0&&(L?this.l$(f):g.gW(function(){B.l$(f)},0));
|
|
(A=rKI())&&O1(this,A);this.subscribe("yt-remote-cast2-session-change",this.Wn)},cz=function(A){return new Qk(A.U.getPlayerContextData())},kTK=function(A){g.yB("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(L){this.T.push(this.U.subscribe(L,g.Od(this.BXr,L),this))},A)},TLd=function(A){g.yB(A.T,function(L){this.U.unsubscribeByKey(L)},A);
|
|
A.T.length=0},Mu=function(A){return A.getState()==1},YP=function(A,L){var B=A.D;
|
|
B.N.length+B.W.length<50&&A.D.enqueue(L)},lGd=function(A,L,B){var f=cz(A);
|
|
ie(f,B);f.playerState!=-1E3&&(f.playerState=L);U1(A,f)},Wz=function(A,L,B){A.U.sendMessage(L,B)},U1=function(A,L){TLd(A);
|
|
A.U.setPlayerContextData(tww(L));kTK(A)},O1=function(A,L){A.W&&(A.W.removeUpdateListener(A.yj),A.W.removeMediaListener(A.X),A.rJ(null));
|
|
A.W=L;A.W&&(Bz("Setting cast session: "+A.W.sessionId),A.W.addUpdateListener(A.yj),A.W.addMediaListener(A.X),A.W.media.length&&A.rJ(A.W.media[0]))},mEd=function(A){var L=A.N.media,B=A.N.customData;
|
|
if(L&&B){var f=cz(A);L.contentId!=f.videoId&&Bz("Cast changing video to: "+L.contentId);f.videoId=L.contentId;f.playerState=B.playerState;ie(f,A.N.getEstimatedTime());U1(A,f)}else Bz("No cast media video. Ignoring state update.")},vz=function(A,L,B){return(0,g.X9)(function(f){this.VC("Failed to "+L+" with cast v2 channel. Error code: "+f.code);
|
|
f.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.VC("Retrying "+L+" using MDx browser channel."),Wz(this,L,B))},A)},xP=function(A,L,B,f){f=f===void 0?!1:f;
|
|
g.SN.call(this);var K=this;this.T=NaN;this.ZM=!1;this.yj=this.G=this.qp=this.Vj=NaN;this.Wn=[];this.D=this.X=this.U=this.N=this.W=null;this.S4=A;this.JF=f;this.Wn.push(g.tK(window,"beforeunload",function(){K.W2(2)}));
|
|
this.V=[];this.N=new Qk;this.Ys=L.id;this.wT=L.idType;this.W=IpO(this.S4,B,this.wm,this.wT=="shortLived",this.Ys);this.W.listen("channelOpened",function(){QXt(K)});
|
|
this.W.listen("channelClosed",function(){qu("Channel closed");isNaN(K.T)?N3(!0):N3();K.dispose()});
|
|
this.W.listen("channelError",function(V){N3();isNaN(K.t7())?(V==1&&K.wT=="shortLived"&&K.publish("browserChannelAuthError",V),qu("Channel error: "+V+" without reconnection"),K.dispose()):(K.ZM=!0,qu("Channel error: "+V+" with reconnection in "+K.t7()+" ms"),Pz(K,2))});
|
|
this.W.listen("channelMessage",function(V){CtK(K,V)});
|
|
this.W.GW(L.token);this.subscribe("remoteQueueChange",function(){var V=K.N.videoId;g.ME()&&g.OS("yt-remote-session-video-id",V)})},ind=function(A){return g.Pw(A.V,function(L){return L.type=="LOUNGE_SCREEN"})},qu=function(A){ob("conn",A)},Pz=function(A,L){A.publish("proxyStateChange",L)},$Ef=function(A){A.T=g.gW(function(){qu("Connecting timeout");
|
|
A.W2(1)},2E4)},X95=function(A){g.rW(A.T);
|
|
A.T=NaN},Onf=function(A){g.rW(A.Vj);
|
|
A.Vj=NaN},cKw=function(A){E_5(A);
|
|
A.qp=g.gW(function(){e0(A,"getNowPlaying")},2E4)},E_5=function(A){g.rW(A.qp);
|
|
A.qp=NaN},QXt=function(A){qu("Channel opened");
|
|
A.ZM&&(A.ZM=!1,Onf(A),A.Vj=g.gW(function(){qu("Timing out waiting for a screen.");A.W2(1)},15E3))},YSK=function(A,L){var B=null;
|
|
if(L){var f=ind(A);f&&(B={clientName:f.clientName,deviceMake:f.brand,deviceModel:f.model,osVersion:f.osVersion})}g.hf("yt.mdx.remote.remoteClient_",B);L&&(X95(A),Onf(A));B=A.W.Tk()&&isNaN(A.T);L==B?L&&(Pz(A,1),e0(A,"getSubtitlesTrack")):L?(A.UG()&&A.N.reset(),Pz(A,1),e0(A,"getNowPlaying"),Mw9(A)):A.W2(1)},UEd=function(A,L){var B=L.params.videoId;
|
|
delete L.params.videoId;B==A.N.videoId&&(g.mi(L.params)?A.N.trackData=null:A.N.trackData=L.params,A.publish("remotePlayerChange"))},Wuw=function(A,L,B){var f=L.params.videoId||L.params.video_id,K=parseInt(L.params.currentIndex,10);
|
|
A.N.listId=L.params.listId||A.N.listId;XJ(A.N,f,K);A.publish("remoteQueueChange",B)},qSd=function(A,L){L.params=L.params||{};
|
|
Wuw(A,L,"NOW_PLAYING_MAY_CHANGE");v_R(A,L);A.publish("autoplayDismissed")},v_R=function(A,L){var B=parseInt(L.params.currentTime||L.params.current_time,10);
|
|
ie(A.N,isNaN(B)?0:B);B=parseInt(L.params.state,10);B=isNaN(B)?-1:B;B==-1&&A.N.playerState==-1E3&&(B=-1E3);A.N.playerState=B;B=Number(L.params.loadedTime);A.N.loadedTime=isNaN(B)?0:B;A.N.Vr(Number(L.params.duration));B=A.N;var f=Number(L.params.liveIngestionTime);B.N=f;B.U=isNaN(f)?!1:!0;B=A.N;f=Number(L.params.seekableStartTime);L=Number(L.params.seekableEndTime);B.W=isNaN(f)?0:f;B.X=isNaN(L)?0:L;A.N.playerState==1?cKw(A):E_5(A);A.publish("remotePlayerChange")},Ptt=function(A,L){if(A.N.playerState!=
|
|
-1E3){var B=1085;
|
|
switch(parseInt(L.params.adState,10)){case 1:B=1081;break;case 2:B=1084;break;case 0:B=1083}A.N.playerState=B;L=parseInt(L.params.currentTime,10);ie(A.N,isNaN(L)?0:L);A.publish("remotePlayerChange")}},xEd=function(A,L){var B=L.params.muted=="true";
|
|
A.N.volume=parseInt(L.params.volume,10);A.N.muted=B;A.publish("remotePlayerChange")},emt=function(A,L){A.X=L.params.videoId;
|
|
A.publish("nowAutoplaying",parseInt(L.params.timeout,10))},n_K=function(A,L){A.X=L.params.videoId||null;
|
|
A.publish("autoplayUpNext",A.X)},zmI=function(A,L){A.D=L.params.autoplayMode;
|
|
A.publish("autoplayModeChange",A.D);A.D=="DISABLED"&&A.publish("autoplayDismissed")},u$I=function(A,L){var B=L.params.hasNext=="true";
|
|
A.N.hasPrevious=L.params.hasPrevious=="true";A.N.hasNext=B;A.publish("previousNextChange")},CtK=function(A,L){L=L.message;
|
|
L.params?qu("Received: action="+L.action+", params="+g.vD(L.params)):qu("Received: action="+L.action+" {}");switch(L.action){case "loungeStatus":L=ai(L.params.devices);A.V=g.mn(L,function(f){return new fN(f)});
|
|
L=!!g.Pw(A.V,function(f){return f.type=="LOUNGE_SCREEN"});
|
|
YSK(A,L);L=A.ZC("mlm");A.publish("multiStateLoopEnabled",L);break;case "loungeScreenDisconnected":g.o8(A.V,function(f){return f.type=="LOUNGE_SCREEN"});
|
|
YSK(A,!1);break;case "remoteConnected":var B=new fN(ai(L.params.device));g.Pw(A.V,function(f){return f.equals(B)})||ItX(A.V,B);
|
|
break;case "remoteDisconnected":B=new fN(ai(L.params.device));g.o8(A.V,function(f){return f.equals(B)});
|
|
break;case "gracefulDisconnect":break;case "playlistModified":Wuw(A,L,"QUEUE_MODIFIED");break;case "nowPlaying":qSd(A,L);break;case "onStateChange":v_R(A,L);break;case "onAdStateChange":Ptt(A,L);break;case "onVolumeChanged":xEd(A,L);break;case "onSubtitlesTrackChanged":UEd(A,L);break;case "nowAutoplaying":emt(A,L);break;case "autoplayDismissed":A.publish("autoplayDismissed");break;case "autoplayUpNext":n_K(A,L);break;case "onAutoplayModeChanged":zmI(A,L);break;case "onHasPreviousNextChanged":u$I(A,
|
|
L);break;case "requestAssistedSignIn":A.publish("assistedSignInRequested",L.params.authCode);break;case "onLoopModeChanged":A.publish("loopModeChange",L.params.loopMode);break;default:qu("Unrecognized action: "+L.action)}},Mw9=function(A){g.rW(A.yj);
|
|
A.yj=g.gW(function(){A.W2(1)},864E5)},e0=function(A,L,B){B?qu("Sending: action="+L+", params="+g.vD(B)):qu("Sending: action="+L);
|
|
A.W.sendMessage(L,B)},aGR=function(A){JJ.call(this,"ScreenServiceProxy");
|
|
this.Uf=A;this.N=[];this.N.push(this.Uf.$_s("screenChange",(0,g.X9)(this.Th,this)));this.N.push(this.Uf.$_s("onlineScreenChange",(0,g.X9)(this.W1F,this)))},f3d=function(A,L){zMW();
|
|
if(!FH||!FH.get("yt-remote-disable-remote-module-for-dev")){L=g.A_("MDX_CONFIG")||L;YBX();qBf();nA||(nA=new aZ(L?L.loungeApiHost:void 0),uOW()&&(nA.N="/api/loungedev"));z_||(z_=g.bB("yt.mdx.remote.deferredProxies_")||[],g.hf("yt.mdx.remote.deferredProxies_",z_));ARw();var B=ue();if(!B){var f=new FJ(nA,L?L.disableAutomaticScreenCache||!1:!1);g.hf("yt.mdx.remote.screenService_",f);B=ue();var K={};L&&(K={appId:L.appId,disableDial:L.disableDial,theme:L.theme,loadCastApiSetupScript:L.loadCastApiSetupScript,
|
|
disableCastApi:L.disableCastApi,enableDialLoungeToken:L.enableDialLoungeToken,enableCastLoungeToken:L.enableCastLoungeToken,forceMirroring:L.forceMirroring});g.hf("yt.mdx.remote.enableConnectWithInitialState_",L?L.enableConnectWithInitialState||!1:!1);p9B(A,f,function(V){V?ab()&&mp(ab(),"YouTube TV"):f.subscribe("onlineScreenChange",function(){Dv("yt-remote-receiver-availability-change")})},K)}L&&!g.bB("yt.mdx.remote.initialized_")&&(g.hf("yt.mdx.remote.initialized_",!0),Ax("Initializing: "+g.vD(L)),
|
|
LD.push(g.fV("yt-remote-cast2-api-ready",function(){Dv("yt-remote-api-ready")})),LD.push(g.fV("yt-remote-cast2-availability-change",function(){Dv("yt-remote-receiver-availability-change")})),LD.push(g.fV("yt-remote-cast2-receiver-selected",function(){oB(null);
|
|
Dv("yt-remote-auto-connect","cast-selector-receiver")})),LD.push(g.fV("yt-remote-cast2-receiver-resumed",function(){Dv("yt-remote-receiver-resumed","cast-selector-receiver")})),LD.push(g.fV("yt-remote-cast2-session-change",LzX)),LD.push(g.fV("yt-remote-connection-change",function(V){V?mp(ab(),"YouTube TV"):BU()||(mp(null,null),GTt())})),LD.push(g.fV("yt-remote-cast2-session-failed",function(){Dv("yt-remote-connection-failed")})),A=oLO(),L.isAuto&&(A.id+="#dial"),K=L.capabilities||[],K.length>0&&(A.capabilities=
|
|
K),A.name=L.device,A.app=L.app,(L=L.theme)&&(A.theme=L),Ax(" -- with channel params: "+g.vD(A)),A?(g.OS("yt-remote-session-app",A.app),g.OS("yt-remote-session-name",A.name)):(g.c9("yt-remote-session-app"),g.c9("yt-remote-session-name")),g.hf("yt.mdx.remote.channelParams_",A),B.start(),ab()||B2K())}},KzO=function(){var A=ue().Uf.$_gos();
|
|
var L=fD();L&&KD()&&(MFB(A,L)||A.push(L));return cXO(A)},JRR=function(){var A=Vdf();
|
|
!A&&T_()&&g_9()&&(A={key:"cast-selector-receiver",name:g_9()});return A},Vdf=function(){var A=KzO(),L=fD();
|
|
L||(L=BU());return g.Pw(A,function(B){return L&&VO(L,B.key)?!0:!1})},fD=function(){var A=ab();
|
|
if(!A)return null;var L=ue().on();return Su(L,A)},LzX=function(A){Ax("remote.onCastSessionChange_: "+Jc(A));
|
|
if(A){var L=fD();if(L&&L.id==A.id){if(mp(L.id,"YouTube TV"),A.idType=="shortLived"&&(A=A.token))VE&&(VE.token=A),(L=KD())&&L.GW(A)}else L&&Jx(),SY(A,1)}else KD()&&Jx()},Jx=function(){le()?kP().stopSession():tJ("stopSession called before API ready.");
|
|
var A=KD();A&&(A.disconnect(1),S_w(null))},RXI=function(){var A=KD();
|
|
return!!A&&A.getProxyState()!=3},Ax=function(A){ob("remote",A)},ue=function(){if(!ZsI){var A=g.bB("yt.mdx.remote.screenService_");
|
|
ZsI=A?new aGR(A):null}return ZsI},ab=function(){return g.bB("yt.mdx.remote.currentScreenId_")},N2t=function(A){g.hf("yt.mdx.remote.currentScreenId_",A)},FzI=function(){return g.bB("yt.mdx.remote.connectData_")},oB=function(A){g.hf("yt.mdx.remote.connectData_",A)},KD=function(){return g.bB("yt.mdx.remote.connection_")},S_w=function(A){var L=KD();
|
|
oB(null);A||N2t("");g.hf("yt.mdx.remote.connection_",A);z_&&(g.yB(z_,function(B){B(A)}),z_.length=0);
|
|
L&&!A?Dv("yt-remote-connection-change",!1):!L&&A&&Dv("yt-remote-connection-change",!0)},BU=function(){var A=g.ME();
|
|
if(!A)return null;var L=ue();if(!L)return null;L=L.on();return Su(L,A)},SY=function(A,L){ab();
|
|
fD()&&fD();if(RB)VE=A;else{N2t(A.id);var B=g.bB("yt.mdx.remote.enableConnectWithInitialState_")||!1;A=new xP(nA,A,oLO(),B);A.connect(L,FzI());A.subscribe("beforeDisconnect",function(f){Dv("yt-remote-before-disconnect",f)});
|
|
A.subscribe("beforeDispose",function(){KD()&&(KD(),S_w(null))});
|
|
A.subscribe("browserChannelAuthError",function(){var f=fD();f&&f.idType=="shortLived"&&(le()?kP().handleBrowserChannelAuthError():tJ("refreshLoungeToken called before API ready."))});
|
|
S_w(A)}},B2K=function(){var A=BU();
|
|
A?(Ax("Resume connection to: "+Jc(A)),SY(A,0)):(N3(),GTt(),Ax("Skipping connecting because no session screen found."))},ARw=function(){var A=oLO();
|
|
if(g.mi(A)){A=Zv();var L=g.ES("yt-remote-session-name")||"",B=g.ES("yt-remote-session-app")||"";A={device:"REMOTE_CONTROL",id:A,name:L,app:B,mdxVersion:3};A.authuser=String(g.A_("SESSION_INDEX","0"));(L=g.A_("DELEGATED_SESSION_ID"))&&(A.pageId=String(L));g.hf("yt.mdx.remote.channelParams_",A)}},oLO=function(){return g.bB("yt.mdx.remote.channelParams_")||{}},I3I=function(A,L,B){g.Y.call(this);
|
|
var f=this;this.N=A;this.S=L;this.di=B;this.events=new g.dN(this);this.D=!1;this.T=new g.Gu(64);this.W=new g.aa(this.o2,500,this);this.V=new g.aa(this.OP,1E3,this);this.G=new wJ(this.iVs,0,this);this.U={};this.yj=new g.aa(this.oX,1E3,this);this.X=new g.BC(this.seekTo,1E3,this);this.Wn=this.events.Y(this.S,"onVolumeChange",function(K){Dxt(f,K)});
|
|
g.W(this,this.events);this.events.Y(L,"onCaptionsTrackListChanged",this.QA4);this.events.Y(L,"captionschanged",this.lxj);this.events.Y(L,"captionssettingschanged",this.IX);this.events.Y(L,"videoplayerreset",this.Je);this.events.Y(L,"mdxautoplaycancel",function(){f.di.Z7()});
|
|
L.J("enable_mdx_video_play_directly")&&this.events.Y(L,"videodatachange",function(){dxX(f.N)||Zf(f)||N_(f,0)});
|
|
A=this.di;A.TL();A.subscribe("proxyStateChange",this.V7,this);A.subscribe("remotePlayerChange",this.AK,this);A.subscribe("remoteQueueChange",this.Je,this);A.subscribe("previousNextChange",this.qa,this);A.subscribe("nowAutoplaying",this.LT,this);A.subscribe("autoplayDismissed",this.Ab,this);g.W(this,this.W);g.W(this,this.V);g.W(this,this.G);g.W(this,this.yj);g.W(this,this.X);this.IX();this.Je();this.AK()},Dxt=function(A,L){if(Zf(A)){A.di.unsubscribe("remotePlayerChange",A.AK,A);
|
|
var B=Math.round(L.volume);L=!!L.muted;var f=cz(A.di);if(B!==f.volume||L!==f.muted)A.di.setVolume(B,L),A.yj.start();A.di.subscribe("remotePlayerChange",A.AK,A)}},wfW=function(A){A.iq(0);
|
|
A.W.stop();A.q8(new g.Gu(64))},pfO=function(A,L){if(Zf(A)&&!A.D){var B=null;
|
|
L&&(B={style:A.S.getSubtitlesUserSettings()},Object.assign(B,L));A.di.UH(A.S.getVideoData(1).videoId,B);A.U=cz(A.di).trackData}},N_=function(A,L){var B=A.S.getPlaylist();
|
|
if(B==null?0:B.listId){var f=B.index;var K=B.listId.toString()}B=A.S.getVideoData(1);A.di.playVideo(B.videoId,L,f,K,B.playerParams,B.Wn,dTB(B));A.q8(new g.Gu(1))},yRR=function(A,L){if(L){var B=A.S.getOption("captions","tracklist",{Wt:1});
|
|
B&&B.length?(A.S.setOption("captions","track",L),A.D=!1):(A.S.loadModule("captions"),A.D=!0)}else A.S.setOption("captions","track",{})},Zf=function(A){return cz(A.di).videoId===A.S.getVideoData(1).videoId},jlf=function(A,L){g.XA.call(this,A);
|
|
this.N=L},Fe=function(){g.q.call(this,{Z:"div",
|
|
j:"ytp-mdx-popup-dialog",C:{role:"dialog"},B:[{Z:"div",j:"ytp-mdx-popup-dialog-inner-content",B:[{Z:"div",j:"ytp-mdx-popup-title",Ir:"Disconnessione eseguita"},{Z:"div",j:"ytp-mdx-popup-description",Ir:"I video che guardi potrebbero essere aggiunti alla cronologia delle visualizzazioni della TV e influenzare i consigli sulla TV. Per evitare che ci\u00f2 avvenga, annulla l'operazione e accedi a YouTube dal tuo computer."},{Z:"div",j:"ytp-mdx-privacy-popup-buttons",B:[{Z:"button",Rr:["ytp-button","ytp-mdx-privacy-popup-cancel"],
|
|
Ir:"Annulla"},{Z:"button",Rr:["ytp-button","ytp-mdx-privacy-popup-confirm"],Ir:"Conferma"}]}]}]});this.fade=new g.KL(this,250);this.cancelButton=this.m4("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.m4("ytp-mdx-privacy-popup-confirm");g.W(this,this.fade);this.Y(this.cancelButton,"click",this.N);this.Y(this.confirmButton,"click",this.W)},Df=function(A){g.q.call(this,{Z:"div",
|
|
j:"ytp-remote",B:[{Z:"div",j:"ytp-remote-display-status",B:[{Z:"div",j:"ytp-remote-display-status-icon",B:[g.vzL()]},{Z:"div",j:"ytp-remote-display-status-text",Ir:"{{statustext}}"}]}]});this.api=A;this.fade=new g.KL(this,250);g.W(this,this.fade);this.Y(A,"presentingplayerstatechange",this.onStateChange);this.Y6(A.getPlayerStateObject())},dG=function(A,L){g.He.call(this,"Riproduci su",1,A,L);
|
|
this.S=A;this.Sd={};this.Y(A,"onMdxReceiversChange",this.W);this.Y(A,"presentingplayerstatechange",this.W);this.W()},gLw=function(A){g.FB.call(this,A);
|
|
this.rN={key:EwK(),name:"Questo computer"};this.Yf=null;this.subscriptions=[];this.H3=this.di=null;this.Sd=[this.rN];this.au=this.rN;this.xb=new g.Gu(64);this.zG=0;this.Ic=-1;this.Wl=!1;this.VN=this.ys=this.Nv=null;if(!g.xi(this.player.K())&&!g.cH(this.player.K())){A=this.player;var L=g.Hh(A);L&&(L=L.gB())&&(L=new dG(A,L),g.W(this,L));L=new Df(A);g.W(this,L);g.Wh(A,L.element,4);this.Nv=new Fe;g.W(this,this.Nv);g.Wh(A,this.Nv.element,4);this.Wl=!!BU()}},IB=function(A){A.ys&&(A.player.removeEventListener("presentingplayerstatechange",
|
|
A.ys),A.ys=null)},GUR=function(A,L,B){A.xb=B;
|
|
A.player.publish("presentingplayerstatechange",new g.dk(B,L))},wG=function(A,L){if(L.key!==A.au.key)if(L.key===A.rN.key)Jx();
|
|
else if(dxX(A)&&rRf(A),A.au=L,!g.cH(A.player.K())){var B=A.player.getPlaylistId();var f=A.player.getVideoData(1);var K=f.videoId;if(!B&&!K||(A.player.getAppState()===2||A.player.getAppState()===1)&&A.player.K().J("should_clear_video_data_on_player_cued_unstarted"))f=null;else{var V=A.player.getPlaylist();if(V){var J=[];for(var R=0;R<V.length;R++)J[R]=g.R_(V,R).videoId}else J=[K];V=A.player.getCurrentTime(1);A={videoIds:J,listId:B,videoId:K,playerParams:f.playerParams,clickTrackingParams:f.Wn,index:Math.max(A.player.getPlaylistIndex(),
|
|
0),currentTime:V===0?void 0:V};(f=dTB(f))&&(A.locationInfo=f);f=A}Ax("Connecting to: "+g.vD(L));L.key=="cast-selector-receiver"?(oB(f||null),L=f||null,le()?kP().setLaunchParams(L):tJ("setLaunchParams called before ready.")):!f&&RXI()&&ab()==L.key?Dv("yt-remote-connection-change",!0):(Jx(),oB(f||null),f=ue().on(),(L=Su(f,L.key))&&SY(L,1))}},dxX=function(A){var L=A.player.K();
|
|
return!L.J("mdx_enable_privacy_disclosure_ui")||A.isLoggedIn()||A.Wl||!A.Nv?!1:g.SK(L)||g.Ng(L)},rRf=function(A){A.player.getPlayerStateObject().isPlaying()?A.player.pauseVideo():(A.ys=function(L){!A.Wl&&g.wk(L,8)&&(A.player.pauseVideo(),IB(A))},A.player.addEventListener("presentingplayerstatechange",A.ys));
|
|
A.Nv&&A.Nv.fD();KD()||(RB=!0)};
|
|
g.$n.prototype.jw=g.ED(45,function(){this.app.mD().jw()});
|
|
g.UY.prototype.jw=g.ED(44,function(){this.VN=null});
|
|
g.$n.prototype.Gr=g.ED(43,function(A){this.app.mD().Gr(A)});
|
|
g.UY.prototype.Gr=g.ED(42,function(A){this.VN=A});
|
|
g.mQ.prototype.nj=g.ED(1,function(){return g.nu(this,3)});
|
|
g.zR.prototype.nj=g.ED(0,function(){return g.nu(this,11)});
|
|
jaR.prototype.gI=function(A){this.N.Xc("/client_streamz/youtube/living_room/mdx/channel/opened",A)};
|
|
gw5.prototype.gI=function(A){this.N.Xc("/client_streamz/youtube/living_room/mdx/channel/closed",A)};
|
|
G75.prototype.gI=function(A){this.N.Xc("/client_streamz/youtube/living_room/mdx/channel/message_received",A)};
|
|
rXO.prototype.gI=function(){this.N.Xc("/client_streamz/youtube/living_room/mdx/channel/success")};
|
|
saf.prototype.gI=function(A,L){this.N.Xc("/client_streamz/youtube/living_room/mdx/channel/error",A,L)};
|
|
He5.prototype.gI=function(){this.N.Xc("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")};
|
|
hMX.prototype.gI=function(){this.N.Xc("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")};
|
|
g.p=oZ.prototype;g.p.aU=function(){Bs(this);for(var A=[],L=0;L<this.N.length;L++)A.push(this.W[this.N[L]]);return A};
|
|
g.p.F1=function(){Bs(this);return this.N.concat()};
|
|
g.p.has=function(A){return LN(this.W,A)};
|
|
g.p.equals=function(A,L){if(this===A)return!0;if(this.size!=A.size)return!1;L=L||k7I;Bs(this);for(var B,f=0;B=this.N[f];f++)if(!L(this.get(B),A.get(B)))return!1;return!0};
|
|
g.p.isEmpty=function(){return this.size==0};
|
|
g.p.clear=function(){this.W={};this.W$=this.size=this.N.length=0};
|
|
g.p.remove=function(A){return this.delete(A)};
|
|
g.p.delete=function(A){return LN(this.W,A)?(delete this.W[A],--this.size,this.W$++,this.N.length>2*this.size&&Bs(this),!0):!1};
|
|
g.p.get=function(A,L){return LN(this.W,A)?this.W[A]:L};
|
|
g.p.set=function(A,L){LN(this.W,A)||(this.size+=1,this.N.push(A),this.W$++);this.W[A]=L};
|
|
g.p.forEach=function(A,L){for(var B=this.F1(),f=0;f<B.length;f++){var K=B[f],V=this.get(K);A.call(L,V,K,this)}};
|
|
g.p.clone=function(){return new oZ(this)};
|
|
g.p.keys=function(){return g.sn(this.iM(!0)).N()};
|
|
g.p.values=function(){return g.sn(this.iM(!1)).N()};
|
|
g.p.entries=function(){var A=this;return tFB(this.keys(),function(L){return[L,A.get(L)]})};
|
|
g.p.iM=function(A){Bs(this);var L=0,B=this.W$,f=this,K=new g.$1;K.next=function(){if(B!=f.W$)throw Error("The map has changed since the iterator was created");if(L>=f.N.length)return g.JN;var V=f.N[L++];return g.X_(A?V:f.W[V])};
|
|
return K};
|
|
var QaB={Ko4:"atp",KW4:"ska",bln:"que",WJ4:"mus",vED:"sus",Efx:"dsp",gEx:"seq",omF:"mic",aFL:"dpa",Nk4:"mlm",QnD:"dsdtr",ba4:"ntb",EHD:"vsp",HXs:"scn",FWn:"rpe",x4j:"dcn",uyp:"dcp",gCF:"pas",eXn:"drq",DE1:"opf",W3n:"els",yOn:"isg",AjF:"svq",y8x:"mvp",ous:"ads",doL:"stcp",CfM:"sads",pFF:"dloc",G_T:"dcw",c24:"asw",OV1:"apw",BBr:"wrc",vC4:"pcw",Mb4:"ipv",wu1:"ndt",Tbp:"ctops"},CNB={nH1:"u",tOn:"cl",j_4:"k",OXs:"i",nXr:"cr",Ha1:"m",M5p:"g",eK:"up"},LMd={Fo:"adPlaying",TR:"onAdStateChange"},ozw={FJx:"nowPlaying",
|
|
RcF:"onStateChange",Fo:"adPlaying",TR:"onAdStateChange",SK:"nowPlayingShorts",jK:"onShortsStateChange"},BWK={SK:"nowPlayingShorts",jK:"onShortsStateChange"};fN.prototype.equals=function(A){return A?this.id==A.id:!1};
|
|
var vww="",FH=null;g.G(atf,g.YI);var dJ,JzO=Lot("loadCastFramework")||Lot("loadCastApplicationFramework"),ZKw=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Ud(wJ,g.Y);g.p=wJ.prototype;g.p.Pi=function(A){this.U=arguments;this.N=!1;this.x6?this.V=g.Ed()+this.LV:this.x6=g.MB(this.D,this.LV)};
|
|
g.p.stop=function(){this.x6&&(g.rI.clearTimeout(this.x6),this.x6=null);this.V=null;this.N=!1;this.U=[]};
|
|
g.p.pause=function(){++this.W};
|
|
g.p.resume=function(){this.W&&(--this.W,!this.W&&this.N&&(this.N=!1,this.T.apply(null,this.U)))};
|
|
g.p.l1=function(){this.stop();wJ.oy.l1.call(this)};
|
|
g.p.Lq=function(){this.x6&&(g.rI.clearTimeout(this.x6),this.x6=null);this.V?(this.x6=g.MB(this.D,this.V-g.Ed()),this.V=null):this.W?this.N=!0:(this.N=!1,this.T.apply(null,this.U))};var yO=null;pN.prototype.set=function(A){this.N=A};
|
|
pN.prototype.reset=function(){this.set(g.Ed())};
|
|
pN.prototype.get=function(){return this.N};g.Ud(DHf,FoB);ju.prototype.stringify=function(A){return g.rI.JSON.stringify(A,void 0)};
|
|
ju.prototype.parse=function(A){return g.rI.JSON.parse(A,void 0)};g.Ud(dHK,g.f8);g.Ud(I1f,g.f8);var wCf=null;g.Ud(yzK,g.f8);g.Ud(j1f,g.f8);g.Ud(gCf,g.f8);sm.prototype.debug=function(){};
|
|
sm.prototype.info=function(){};
|
|
sm.prototype.warning=function(){};var kFd={},tRK={};g.p=Hs.prototype;g.p.setTimeout=function(A){this.Ox=A};
|
|
g.p.yY=function(A){A=A.target;var L=this.Cr;L&&g.z9(A)==3?L.Za():this.eh(A)};
|
|
g.p.eh=function(A){try{if(A==this.N)a:{var L=g.z9(this.N),B=this.N.W,f=this.N.getStatus();if(!(L<3)&&(L!=3||this.N&&(this.W.W||g.a$(this.N)||g.Au(this.N)))){this.JF||L!=4||B==7||(B==8||f<=0?gJ(3):gJ(2));mHR(this);var K=this.N.getStatus();this.mH=K;var V=bKw(this);if(this.T=K==200){if(this.Uv&&!this.Ex){b:{if(this.N){var J=g.L2(this.N,"X-HTTP-Initial-Response");if(J&&!g.us(J)){var R=J;break b}}R=null}if(A=R)this.Ex=!0,MRf(this,A);else{this.T=!1;this.D=3;Gn(12);bx(this);tc(this);break a}}if(this.wT){A=
|
|
!0;for(var Z;!this.JF&&this.X<V.length;)if(Z=T$K(this,V),Z==tRK){L==4&&(this.D=4,Gn(14),A=!1);break}else if(Z==kFd){this.D=4;Gn(15);A=!1;break}else MRf(this,Z);hRK(this)&&this.X!=0&&(this.W.N=this.W.N.slice(this.X),this.X=0);L!=4||V.length!=0||this.W.W||(this.D=1,Gn(16),A=!1);this.T=this.T&&A;A?V.length>0&&!this.jI&&(this.jI=!0,this.V.lV(this)):(bx(this),tc(this))}else MRf(this,V);L==4&&bx(this);this.T&&!this.JF&&(L==4?Q1d(this.V,this):(this.T=!1,hc(this)))}else g.vse(this.N),K==400&&V.indexOf("Unknown SID")>
|
|
0?(this.D=3,Gn(12)):(this.D=0,Gn(13)),bx(this),tc(this)}}}catch(N){}finally{}};
|
|
g.p.cancel=function(){this.JF=!0;bx(this)};
|
|
g.p.Nr=function(){this.Wn=null;var A=Date.now();A-this.Nl>=0?(this.Ys!=2&&(gJ(3),Gn(17)),bx(this),this.D=2,tc(this)):l1W(this,this.Nl-A)};
|
|
g.p.getLastError=function(){return this.D};
|
|
g.p.HM=function(){return this.N};UHw.prototype.cancel=function(){this.V=vCt(this);if(this.W)this.W.cancel(),this.W=null;else if(this.N&&this.N.size!==0){for(var A=g.m(this.N.values()),L=A.next();!L.done;L=A.next())L.value.cancel();this.N.clear()}};g.p=eRw.prototype;g.p.QA=8;g.p.a4=1;g.p.connect=function(A,L,B,f){Gn(0);this.t$=A;this.JF=L||{};B&&f!==void 0&&(this.JF.OSID=B,this.JF.OAID=f);this.Cr=this.Pz;this.S4=OKf(this,null,this.t$);mA(this)};
|
|
g.p.disconnect=function(){zRW(this);if(this.a4==3){var A=this.sx++,L=this.S4.clone();g.wl(L,"SID",this.U);g.wl(L,"RID",A);g.wl(L,"TYPE","terminate");ix(this,L);A=new Hs(this,this.U,A);A.Ys=2;A.G=zf(L.clone());L=!1;if(g.rI.navigator&&g.rI.navigator.sendBeacon)try{L=g.rI.navigator.sendBeacon(A.G.toString(),"")}catch(B){}!L&&g.rI.Image&&((new Image).src=A.G,L=!0);L||(A.N=HKf(A.V,null),A.N.send(A.G));A.Vj=Date.now();hc(A)}BnW(this)};
|
|
g.p.vV=function(){return this.a4==0};
|
|
g.p.getState=function(){return this.a4};
|
|
g.p.aL=function(A){if(this.T)if(this.T=null,this.a4==1){if(!A){this.sx=Math.floor(Math.random()*1E5);A=this.sx++;var L=new Hs(this,"",A),B=this.yj;this.Uv&&(B?(B=g.is(B),g.Xc(B,this.Uv)):B=this.Uv);this.X!==null||this.Nl||(L.S4=B,B=null);var f;if(this.ql)a:{for(var K=f=0;K<this.V.length;K++){b:{var V=this.V[K];if("__data__"in V.map&&(V=V.map.__data__,typeof V==="string")){V=V.length;break b}V=void 0}if(V===void 0)break;f+=V;if(f>4096){f=K;break a}if(f===4096||K===this.V.length-1){f=K+1;break a}}f=
|
|
this.nD}else f=this.nD;f=Alw(this,L,f);K=this.S4.clone();g.wl(K,"RID",A);g.wl(K,"CVER",22);this.wT&&g.wl(K,"X-HTTP-Session-Id",this.wT);ix(this,K);B&&(this.Nl?f="headers="+g.v5(g.DnQ(B))+"&"+f:this.X&&g.jF(K,this.X,B));XCt(this.W,L);this.mC&&g.wl(K,"TYPE","init");this.ql?(g.wl(K,"$req",f),g.wl(K,"SID","null"),L.Uv=!0,s1I(L,K,null)):s1I(L,K,f);this.a4=2}}else this.a4==3&&(A?Lcf(this,A):this.V.length==0||Wo9(this.W)||Lcf(this))};
|
|
g.p.vK=function(){this.G=null;oRf(this);if(this.N8&&!(this.Ox||this.N==null||this.k6<=0)){var A=4*this.k6;this.ZM=rJ((0,g.X9)(this.Ixs,this),A)}};
|
|
g.p.Ixs=function(){this.ZM&&(this.ZM=null,this.Cr=!1,this.Ox=!0,Gn(10),Tn(this),oRf(this))};
|
|
g.p.lV=function(A){this.N==A&&this.N8&&!this.Ox&&(nCd(this),this.Ox=!0,Gn(11))};
|
|
g.p.W_=function(){this.Wn!=null&&(this.Wn=null,Tn(this),iK5(this),Gn(19))};
|
|
g.p.dqr=function(A){A?Gn(2):Gn(1)};
|
|
g.p.isActive=function(){return!!this.D&&this.D.isActive(this)};
|
|
g.p=Kc9.prototype;g.p.O3=function(){};
|
|
g.p.oL=function(){};
|
|
g.p.GD=function(){};
|
|
g.p.Ks=function(){};
|
|
g.p.isActive=function(){return!0};
|
|
g.p.H_=function(){};g.Ud(XH,g.gb);XH.prototype.open=function(){this.N.D=this.V;this.T&&(this.N.Ex=!0);this.N.connect(this.D,this.W||void 0)};
|
|
XH.prototype.close=function(){this.N.disconnect()};
|
|
XH.prototype.send=function(A){var L=this.N;if(typeof A==="string"){var B={};B.__data__=A;A=B}else this.U&&(B={},B.__data__=g.vD(A),A=B);L.V.push(new Ynw(L.Bk++,A));L.a4==3&&mA(L)};
|
|
XH.prototype.l1=function(){this.N.D=null;delete this.V;this.N.disconnect();delete this.N;XH.oy.l1.call(this)};
|
|
g.Ud(JlO,dHK);g.Ud(S5W,I1f);g.Ud($O,Kc9);$O.prototype.O3=function(){this.N.dispatchEvent("m")};
|
|
$O.prototype.oL=function(A){this.N.dispatchEvent(new JlO(A))};
|
|
$O.prototype.GD=function(A){this.N.dispatchEvent(new S5W(A))};
|
|
$O.prototype.Ks=function(){this.N.dispatchEvent("n")};
|
|
R2d.prototype.commit=function(A){this.N.mH=A};var Em=new g.gb;g.G(Nnf,g.f8);g.p=M3.prototype;g.p.Zu=null;g.p.tV=!1;g.p.SY=null;g.p.L1=null;g.p.Rp=null;g.p.ll=null;g.p.Zc=null;g.p.IQ=null;g.p.Mh=null;g.p.S6=null;g.p.bl=0;g.p.jA=null;g.p.Vd=null;g.p.Du=null;g.p.MM=-1;g.p.Sv=!0;g.p.Dc=!1;g.p.Px=0;g.p.qB=null;var ptW={},wtK={};g.p=M3.prototype;g.p.setTimeout=function(A){this.W=A};
|
|
g.p.IW=function(A){A=A.target;var L=this.qB;L&&g.z9(A)==3?L.Za():this.cK(A)};
|
|
g.p.cK=function(A){try{if(A==this.S6)a:{var L=g.z9(this.S6),B=this.S6.W,f=this.S6.getStatus();if(g.h8&&!g.oC("420+")){if(L<4)break a}else if(L<3||L==3&&!g.a$(this.S6))break a;this.Dc||L!=4||B==7||(B==8||f<=0?this.N.SL(3):this.N.SL(2));gRK(this);var K=this.S6.getStatus();this.MM=K;var V=g.a$(this.S6);if(this.tV=K==200){L==4&&YO(this);if(this.wT){for(A=!0;!this.Dc&&this.bl<V.length;){var J=ylf(this,V);if(J==wtK){L==4&&(this.Du=4,cs(15),A=!1);break}else if(J==ptW){this.Du=4;cs(16);A=!1;break}else rlW(this,
|
|
J)}L==4&&V.length==0&&(this.Du=1,cs(17),A=!1);this.tV=this.tV&&A;A||(YO(this),GRO(this))}else rlW(this,V);this.tV&&!this.Dc&&(L==4?this.N.yQ(this):(this.tV=!1,IlK(this)))}else K==400&&V.indexOf("Unknown SID")>0?(this.Du=3,cs(13)):(this.Du=0,cs(14)),YO(this),GRO(this)}}catch(R){}finally{}};
|
|
g.p.cancel=function(){this.Dc=!0;YO(this)};
|
|
g.p.qr=function(){this.SY=null;var A=Date.now();A-this.L1>=0?(this.ll!=2&&this.N.SL(3),YO(this),this.Du=2,cs(18),GRO(this)):jwK(this,this.L1-A)};
|
|
g.p.getLastError=function(){return this.Du};g.p=h2t.prototype;g.p.Nx=null;g.p.pQ=null;g.p.Hm=!1;g.p.W6=null;g.p.TM=null;g.p.Do=-1;g.p.t9=null;g.p.kq=null;g.p.connect=function(A){this.W6=A;A=q3(this.N,null,this.W6);cs(3);Date.now();var L=this.N.yj;L!=null?(this.t9=L[0],(this.kq=L[1])?(this.TM=1,bXf(this)):(this.TM=2,ttd(this))):(uK(A,"MODE","init"),this.pQ=new M3(this),this.pQ.Zu=this.Nx,dvX(this.pQ,A,!1,null,!0),this.TM=0)};
|
|
g.p.r9=function(A){if(A)this.TM=2,ttd(this);else{cs(4);var L=this.N;L.Qh=L.QI.Do;nN(L,9)}A&&this.SL(2)};
|
|
g.p.dD=function(A){return this.N.dD(A)};
|
|
g.p.abort=function(){this.pQ&&(this.pQ.cancel(),this.pQ=null);this.Do=-1};
|
|
g.p.vV=function(){return!1};
|
|
g.p.BK=function(A,L){this.Do=A.MM;if(this.TM==0)if(L){try{var B=this.W.parse(L)}catch(f){A=this.N;A.Qh=this.Do;nN(A,2);return}this.t9=B[0];this.kq=B[1]}else A=this.N,A.Qh=this.Do,nN(A,2);else this.TM==2&&(this.Hm?(cs(7),Date.now()):L=="11111"?(cs(6),this.Hm=!0,Date.now(),this.Do=200,this.pQ.cancel(),cs(12),Ps(this.N,this,!0)):(cs(8),Date.now(),this.Hm=!1))};
|
|
g.p.yQ=function(){this.Do=this.pQ.MM;if(this.pQ.tV)this.TM==0?this.kq?(this.TM=1,bXf(this)):(this.TM=2,ttd(this)):this.TM==2&&(this.Hm?(cs(12),Ps(this.N,this,!0)):(cs(11),Ps(this.N,this,!1)));else{this.TM==0?cs(9):this.TM==2&&cs(10);var A=this.N;this.pQ.getLastError();A.Qh=this.Do;nN(A,2)}};
|
|
g.p.S0=function(){return this.N.S0()};
|
|
g.p.isActive=function(){return this.N.isActive()};
|
|
g.p.SL=function(A){this.N.SL(A)};g.p=kRt.prototype;g.p.j5=null;g.p.JS=null;g.p.mX=null;g.p.yF=null;g.p.qx=null;g.p.FE=null;g.p.PK=null;g.p.H6=null;g.p.Tx=0;g.p.kM=0;g.p.Kh=null;g.p.FV=null;g.p.Mn=null;g.p.ST=null;g.p.QI=null;g.p.wD=null;g.p.jY=-1;g.p.Ls=-1;g.p.Qh=-1;g.p.Tv=0;g.p.Jk=0;g.p.RV=8;var slW={OK:0,MJp:2,pAr:4,UEx:5,riL:6,STOP:7,RE:8,BQx:9,oRr:10,cd1:11,PWM:12};g.Ud(llI,g.f8);g.Ud(mvK,g.f8);g.p=kRt.prototype;
|
|
g.p.connect=function(A,L,B,f,K){cs(0);this.qx=L;this.JS=B||{};f&&K!==void 0&&(this.JS.OSID=f,this.JS.OAID=K);this.G?(Om((0,g.X9)(this.PD,this,A),100),C8K(this)):this.PD(A)};
|
|
g.p.disconnect=function(){iXt(this);if(this.N==3){var A=this.Tx++,L=this.FE.clone();g.wl(L,"SID",this.U);g.wl(L,"RID",A);g.wl(L,"TYPE","terminate");eu(this,L);A=new M3(this,this.U,A);A.ll=2;A.Zc=zf(L.clone());(new Image).src=A.Zc.toString();A.Rp=Date.now();IlK(A)}vRd(this)};
|
|
g.p.PD=function(A){this.QI=new h2t(this);this.QI.Nx=this.j5;this.QI.W=this.D;this.QI.connect(A)};
|
|
g.p.vV=function(){return this.N==0};
|
|
g.p.getState=function(){return this.N};
|
|
g.p.NL=function(A){this.FV=null;clK(this,A)};
|
|
g.p.dH=function(){this.Mn=null;this.yF=new M3(this,this.U,"rpc",this.X);this.yF.Zu=this.j5;this.yF.Px=0;var A=this.PK.clone();g.wl(A,"RID","rpc");g.wl(A,"SID",this.U);g.wl(A,"CI",this.wD?"0":"1");g.wl(A,"AID",this.jY);eu(this,A);g.wl(A,"TYPE","xmlhttp");dvX(this.yF,A,!0,this.H6,!1)};
|
|
g.p.BK=function(A,L){if(this.N!=0&&(this.yF==A||this.mX==A))if(this.Qh=A.MM,this.mX==A&&this.N==3)if(this.RV>7){try{var B=this.D.parse(L)}catch(f){B=null}if(Array.isArray(B)&&B.length==3)if(A=B,A[0]==0)a:{if(!this.Mn){if(this.yF)if(this.yF.Rp+3E3<this.mX.Rp)xO(this),this.yF.cancel(),this.yF=null;else break a;UvW(this);cs(19)}}else this.Ls=A[1],0<this.Ls-this.jY&&A[2]<37500&&this.wD&&this.Jk==0&&!this.ST&&(this.ST=Om((0,g.X9)(this.VY,this),6E3));else nN(this,11)}else L!="y2f%"&&nN(this,11);else if(this.yF==
|
|
A&&xO(this),!g.us(L))for(A=this.D.parse(L),L=0;L<A.length;L++)B=A[L],this.jY=B[0],B=B[1],this.N==2?B[0]=="c"?(this.U=B[1],this.H6=B[2],B=B[3],B!=null?this.RV=B:this.RV=6,this.N=3,this.Kh&&this.Kh.Hh(),this.PK=q3(this,this.S0()?this.H6:null,this.qx),MtR(this)):B[0]=="stop"&&nN(this,7):this.N==3&&(B[0]=="stop"?nN(this,7):B[0]!="noop"&&this.Kh&&this.Kh.Wh(B),this.Jk=0)};
|
|
g.p.VY=function(){this.ST!=null&&(this.ST=null,this.yF.cancel(),this.yF=null,UvW(this),cs(20))};
|
|
g.p.yQ=function(A){if(this.yF==A){xO(this);this.yF=null;var L=2}else if(this.mX==A)this.mX=null,L=1;else return;this.Qh=A.MM;if(this.N!=0)if(A.tV)if(L==1){L=A.Mh?A.Mh.length:0;A=Date.now()-A.Rp;var B=Em;B.dispatchEvent(new llI(B,L,A,this.Tv));QwX(this);this.Kh&&this.Kh.qL(this,this.V);this.V.length=0}else MtR(this);else{B=A.getLastError();var f;if(!(f=B==3||B==7||B==0&&this.Qh>0)){if(f=L==1)this.mX||this.FV||this.N==1||this.Tv>=2?f=!1:(this.FV=Om((0,g.X9)(this.NL,this,A),Y5w(this,this.Tv)),this.Tv++,
|
|
f=!0);f=!(f||L==2&&UvW(this))}if(f)switch(B){case 1:nN(this,5);break;case 4:nN(this,10);break;case 3:nN(this,6);break;case 7:nN(this,12);break;default:nN(this,2)}}};
|
|
g.p.l6=function(A){if(!g.zK(arguments,this.N))throw Error("Unexpected channel state: "+this.N);};
|
|
g.p.LDn=function(A){A?cs(2):(cs(1),WcI(this,8))};
|
|
g.p.dD=function(A){if(A)throw Error("Can't create secondary domain capable XhrIo object.");A=new g.xA;A.X=!1;return A};
|
|
g.p.isActive=function(){return!!this.Kh&&this.Kh.isActive(this)};
|
|
g.p.SL=function(A){var L=Em;L.dispatchEvent(new mvK(L,A))};
|
|
g.p.S0=function(){return!1};
|
|
new DHf;g.p=q5R.prototype;g.p.Hh=function(){};
|
|
g.p.Wh=function(){};
|
|
g.p.qL=function(){};
|
|
g.p.yv=function(){};
|
|
g.p.Il=function(){};
|
|
g.p.Ii=function(){return{}};
|
|
g.p.isActive=function(){return!0};g.p=P8d.prototype;g.p.enqueue=function(A){this.W.push(A)};
|
|
g.p.isEmpty=function(){return this.N.length===0&&this.W.length===0};
|
|
g.p.clear=function(){this.N=[];this.W=[]};
|
|
g.p.contains=function(A){return g.zK(this.N,A)||g.zK(this.W,A)};
|
|
g.p.remove=function(A){var L=this.N;var B=(0,g.t0v)(L,A);B>=0?(g.uB(L,B),L=!0):L=!1;return L||g.Lx(this.W,A)};
|
|
g.p.aU=function(){for(var A=[],L=this.N.length-1;L>=0;--L)A.push(this.N[L]);L=this.W.length;for(var B=0;B<L;++B)A.push(this.W[B]);return A};g.G(xv5,g.f8);g.G(e2B,g.f8);g.Ud(zn,g.Y);g.p=zn.prototype;g.p.pkD=function(){this.retryCount++;this.LV=Math.min(3E5,this.LV*2);this.W();this.T5&&this.start()};
|
|
g.p.nj=function(){return this.retryCount};
|
|
g.p.start=function(){var A=this.LV+15E3*Math.random();g.Az(this.N,A);this.T5=Date.now()+A};
|
|
g.p.stop=function(){this.N.stop();this.T5=0};
|
|
g.p.isActive=function(){return this.N.isActive()};
|
|
g.p.reset=function(){this.N.stop();this.retryCount=0;this.LV=5E3};g.Ud(z2w,q5R);g.p=z2w.prototype;g.p.subscribe=function(A,L,B){return this.G.subscribe(A,L,B)};
|
|
g.p.unsubscribe=function(A,L,B){return this.G.unsubscribe(A,L,B)};
|
|
g.p.vR=function(A){return this.G.vR(A)};
|
|
g.p.publish=function(A,L){return this.G.publish.apply(this.G,arguments)};
|
|
g.p.dispose=function(){this.yj||(this.yj=!0,g.jq(this.G),this.disconnect(),g.jq(this.W),this.W=null,this.S4=function(){return""},this.Ex=function(){return g.iX({})})};
|
|
g.p.TL=function(){return this.yj};
|
|
g.p.connect=function(A,L,B){var f=this,K,V,J,R;return g.c(function(Z){if(Z.N==1)return g.RO(Z,2),f.X?g.X(Z,f.D,2):Z.Ux(2);g.F9(Z);if(f.yj||f.N&&f.N.getState()==2&&!f.V)return Z.return();f.wT="";f.V||f.W.stop();f.qp=A||null;f.Wn=L||0;K=f.Cr+"/test";V=f.Cr+"/bind";J=new kRt(B?B.firstTestResults:null,B?B.secondTestResults:null,f.KY);if(R=f.N)R.Kh=null;J.Kh=f;f.N=J;if(f.X)return f.D=KMd(f).then(function(){return A_I(f,K,V,R,B)}),Z.return(f.D.then(function(){f.D=g.iX()}));
|
|
A_I(f,K,V,R,B);return g.DR(Z,0)})};
|
|
g.p.disconnect=function(A){try{this.X&&(this.D.cancel(),this.D=g.iX())}finally{this.ZM=A||0,this.W&&this.W.stop(),uCt(this),this.N&&(this.N.getState()==3&&clK(this.N),this.N.disconnect()),this.ZM=0}};
|
|
g.p.sendMessage=function(A,L){var B=this,f;return g.c(function(K){switch(K.N){case 1:g.RO(K,2);if(!B.X){K.Ux(2);break}return g.X(K,B.D,2);case 2:g.F9(K);if(B.yj)return K.return();f={_sc:A};L&&g.Xc(f,L);if(B.W.isActive()||(B.N?B.N.getState():0)==2){B.U.push(f);K.Ux(6);break}if(!B.Tk()){K.Ux(6);break}g.RO(K,8);if(!B.X||fpf(B,A)){K.Ux(8);break}return g.X(K,KMd(B),8);case 8:g.F9(K,0,0,1);B.Tk()&&(fpf(B,A)||alB(B),uCt(B),$vR(B.N,f));g.DR(K,6,1);break;case 6:g.DR(K,0)}})};
|
|
g.p.Hh=function(){this.T&&this.W&&this.W.nj()>0&&(this.T.bCp(this.W.nj(),this.V,!0),this.T.tdj());this.T&&this.T.ff4();this.V?(this.W.stop(),g.jq(this.W),this.W=new zn(this.Rw,this),this.V=!1):this.W.reset();this.qp=null;this.Wn=0;if(this.U.length)if(this.X)J_W(this);else{var A=this.U;this.U=[];var L=A.length;alB(this);Vkd(this,A,L);ux(this)}else ux(this)};
|
|
g.p.yv=function(A){var L=A==2&&this.N.Qh==401;A==4||L||(this.V&&!this.W.isActive()&&(g.jq(this.W),this.W=new zn(this.Rw,this),this.V=!1),this.W.start());this.publish("handlerError",A,L);L=Object.keys(slW).find(function(B){return slW[B]===A});
|
|
this.cn.gI("BROWSER_CHANNEL",L!=null?L:"UNKNOWN")};
|
|
g.p.Il=function(A,L){if(!this.W.isActive())this.publish("handlerClosed");else if(L)for(var B=L.length,f=0;f<B;++f){var K=L[f].map;K&&this.U.push(K)}this.sx.gI("BROWSER_CHANNEL");A&&this.k6.N.mB("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",A.length);L&&this.TZ.N.mB("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",L.length)};
|
|
g.p.qL=function(A,L){L!=null&&A!=null&&this.ql.gI()};
|
|
g.p.Ii=function(){var A={v:2};this.wT&&(A.gsessionid=this.wT);this.Wn!=0&&(A.ui=""+this.Wn);this.ZM!=0&&(A.ui=""+this.ZM);this.qp&&g.Xc(A,this.qp);return A};
|
|
g.p.Wh=function(A){A[0]=="S"?this.wT=A[1]:A[0]=="gracefulReconnect"?(this.W.start(),this.N.disconnect()):this.publish("handlerMessage",new nRf(A[0],A[1]));this.Ox.gI("BROWSER_CHANNEL")};
|
|
g.p.Tk=function(){return!!this.N&&this.N.getState()==3};
|
|
g.p.GW=function(A){(this.Vj.loungeIdToken=A)||this.W.stop();if(this.Pz&&this.N){var L=this.N.j5||{};A?L["X-YouTube-LoungeId-Token"]=A:delete L["X-YouTube-LoungeId-Token"];this.N.j5=L}};
|
|
g.p.getDeviceId=function(){return this.Vj.id};
|
|
g.p.m5=function(){return this.W.isActive()?this.W.T5-Date.now():NaN};
|
|
g.p.gt=function(){var A=this.W;g.LK(A.N);A.start()};
|
|
g.p.Rw=function(){this.W.isActive();Xt5(this.N)==0&&this.connect(this.qp,this.Wn)};aZ.prototype.sendRequest=function(A,L,B,f,K,V,J){A={format:V?"RAW":"JSON",method:A,context:this,timeout:5E3,withCredentials:!!J,onSuccess:g.Od(this.U,f,!V),onError:g.Od(this.V,K),onTimeout:g.Od(this.D,K)};B&&(A.postParams=B,A.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.ll(L,A)};
|
|
aZ.prototype.U=function(A,L,B,f){L?A(f):A({text:B.responseText})};
|
|
aZ.prototype.V=function(A,L){A(Error("Request error: "+L.status))};
|
|
aZ.prototype.D=function(A){A(Error("request timed out"))};g.G(Zgw,g.gb);g.p=Zgw.prototype;g.p.connect=function(A,L,B){this.handler.connect(A,L,B)};
|
|
g.p.disconnect=function(A){this.handler.disconnect(A)};
|
|
g.p.gt=function(){this.handler.gt()};
|
|
g.p.getDeviceId=function(){return this.handler.getDeviceId()};
|
|
g.p.m5=function(){return this.handler.m5()};
|
|
g.p.Tk=function(){return this.handler.Tk()};
|
|
g.p.b6=function(){this.dispatchEvent("channelOpened");var A=this.handler,L=this.N;g.OS("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!A.N.wD,sessionId:A.N.U,arrayId:A.N.jY});g.OS("yt-remote-session-screen-id",L);A=RZ();L=Zv();g.zK(A,L)||A.push(L);WKd(A);qBf()};
|
|
g.p.onClosed=function(){this.dispatchEvent("channelClosed")};
|
|
g.p.onMessage=function(A){this.dispatchEvent(new xv5(A))};
|
|
g.p.onError=function(A){this.dispatchEvent(new e2B(A?1:0))};
|
|
g.p.sendMessage=function(A,L){this.handler.sendMessage(A,L)};
|
|
g.p.GW=function(A){this.handler.GW(A)};
|
|
g.p.dispose=function(){this.handler.dispose()};g.p=NW9.prototype;
|
|
g.p.connect=function(A,L){A=A===void 0?{}:A;L=L===void 0?0:L;this.T!==2&&(this.V.stop(),this.G=A,this.X=L,DsK(this),(A=g.A_("ID_TOKEN"))?this.U["x-youtube-identity-token"]=A:delete this.U["x-youtube-identity-token"],this.N&&(this.W.device=this.N.device,this.W.name=this.N.name,this.W.app=this.N.app,this.W.id=this.N.id,this.N.jvF&&(this.W.mdxVersion=""+this.N.jvF),this.N.theme&&(this.W.theme=this.N.theme),this.N.capabilities&&(this.W.capabilities=this.N.capabilities),this.N.O4&&(this.W.cst=this.N.O4),
|
|
this.N.authuser&&(this.W.authuser=this.N.authuser),this.N.pageId&&(this.W.pageId=this.N.pageId)),this.X!==0?this.W.ui=""+this.X:delete this.W.ui,Object.assign(this.W,this.G),this.channel=new XH(this.pathPrefix,{rFr:"gsessionid",gP1:this.U,rwr:this.W}),this.channel.open(),this.T=2,FMd(this))};
|
|
g.p.disconnect=function(A){this.yj=A===void 0?0:A;this.V.stop();DsK(this);this.channel&&(this.yj!==0?this.W.ui=""+this.yj:delete this.W.ui,this.channel.close());this.yj=0};
|
|
g.p.m5=function(){return this.V.isActive()?this.V.T5-Date.now():NaN};
|
|
g.p.gt=function(){var A=this.V;g.LK(A.N);A.start()};
|
|
g.p.sendMessage=function(A,L){this.channel&&(DsK(this),A=Object.assign({},{_sc:A},L),this.channel.send(A))};
|
|
g.p.GW=function(A){A||this.V.stop();A?this.U["X-YouTube-LoungeId-Token"]=A:delete this.U["X-YouTube-LoungeId-Token"]};
|
|
g.p.getDeviceId=function(){return this.N?this.N.id:""};
|
|
g.p.publish=function(A){return this.D.publish.apply(this.D,[A].concat(g.x7(g.pf.apply(1,arguments))))};
|
|
g.p.subscribe=function(A,L,B){return this.D.subscribe(A,L,B)};
|
|
g.p.unsubscribe=function(A,L,B){return this.D.unsubscribe(A,L,B)};
|
|
g.p.vR=function(A){return this.D.vR(A)};
|
|
g.p.dispose=function(){this.Wn||(this.Wn=!0,g.jq(this.D),this.disconnect(),g.jq(this.V),this.Vj=function(){return""})};
|
|
g.p.TL=function(){return this.Wn};g.G(dsK,g.gb);g.p=dsK.prototype;g.p.connect=function(A,L){this.N.connect(A,L)};
|
|
g.p.disconnect=function(A){this.N.disconnect(A)};
|
|
g.p.gt=function(){this.N.gt()};
|
|
g.p.getDeviceId=function(){return this.N.getDeviceId()};
|
|
g.p.m5=function(){return this.N.m5()};
|
|
g.p.Tk=function(){return this.N.T===3};
|
|
g.p.tD=function(){this.dispatchEvent("channelOpened")};
|
|
g.p.onClosed=function(){this.dispatchEvent("channelClosed")};
|
|
g.p.onMessage=function(A){this.dispatchEvent(new xv5(A))};
|
|
g.p.onError=function(){this.dispatchEvent(new e2B(this.N.zy===401?1:0))};
|
|
g.p.sendMessage=function(A,L){this.N.sendMessage(A,L)};
|
|
g.p.GW=function(A){this.N.GW(A)};
|
|
g.p.dispose=function(){this.N.dispose()};var r_K=Date.now(),LA=null,KA=Array(50),fA=-1,Vk=!1;g.Ud(JJ,g.SN);JJ.prototype.on=function(){return this.screens};
|
|
JJ.prototype.contains=function(A){return!!MFB(this.screens,A)};
|
|
JJ.prototype.get=function(A){return A?Su(this.screens,A):null};
|
|
JJ.prototype.info=function(A){ob(this.T,A)};g.G(bgX,g.SN);g.p=bgX.prototype;g.p.start=function(){!this.N&&isNaN(this.x6)&&this.pP()};
|
|
g.p.stop=function(){this.N&&(this.N.abort(),this.N=null);isNaN(this.x6)||(g.rW(this.x6),this.x6=NaN)};
|
|
g.p.l1=function(){this.stop();g.SN.prototype.l1.call(this)};
|
|
g.p.pP=function(){this.x6=NaN;this.N=g.ll(AJ(this.V,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.X},timeout:5E3,onSuccess:(0,g.X9)(this.Uy,this),onError:(0,g.X9)(this.Fq,this),onTimeout:(0,g.X9)(this.wZ,this)})};
|
|
g.p.Uy=function(A,L){this.N=null;A=L.screen||{};A.dialId=this.U;A.name=this.T;L=-1;this.D&&A.shortLivedLoungeToken&&A.shortLivedLoungeToken.value&&A.shortLivedLoungeToken.refreshIntervalMs&&(A.screenIdType="shortLived",A.loungeToken=A.shortLivedLoungeToken.value,L=A.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new KN(A),L)};
|
|
g.p.Fq=function(A){this.N=null;A.status&&A.status==404?this.W>=Hs9.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(A=Hs9[this.W],this.x6=g.gW((0,g.X9)(this.pP,this),A),this.W++):this.publish("pairingFailed",Error("Server error "+A.status))};
|
|
g.p.wZ=function(){this.N=null;this.publish("pairingFailed",Error("Server not responding"))};
|
|
var Hs9=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ud(Rb,JJ);g.p=Rb.prototype;g.p.start=function(){S0(this)&&this.publish("screenChange");!g.ES("yt-remote-lounge-token-expiration")&&tkR(this);g.rW(this.N);this.N=g.gW((0,g.X9)(this.start,this),1E4)};
|
|
g.p.add=function(A,L){S0(this);sMW(this,A);ZM(this,!1);this.publish("screenChange");L(A);A.token||tkR(this)};
|
|
g.p.remove=function(A,L){var B=S0(this);hzK(this,A)&&(ZM(this,!1),B=!0);L(A);B&&this.publish("screenChange")};
|
|
g.p.FR=function(A,L,B,f){var K=S0(this),V=this.get(A.id);V?(V.name!=L&&(V.name=L,ZM(this,!1),K=!0),B(A)):f(Error("no such local screen."));K&&this.publish("screenChange")};
|
|
g.p.l1=function(){g.rW(this.N);Rb.oy.l1.call(this)};
|
|
g.p.Hrj=function(A){S0(this);var L=this.screens.length;A=A&&A.screens||[];for(var B=A.length,f=0;f<B;++f){var K=A[f],V=this.get(K.screenId);V&&(V.token=K.loungeToken,--L)}ZM(this,!L);L&&ob(this.T,"Missed "+L+" lounge tokens.")};
|
|
g.p.W44=function(A){ob(this.T,"Requesting lounge tokens failed: "+A)};g.G(TWW,g.SN);g.p=TWW.prototype;g.p.start=function(){var A=parseInt(g.ES("yt-remote-fast-check-period")||"0",10);(this.U=g.Ed()-144E5<A?0:A)?Nu(this):(this.U=g.Ed()+3E5,g.OS("yt-remote-fast-check-period",this.U),this.nN())};
|
|
g.p.isEmpty=function(){return g.mi(this.N)};
|
|
g.p.update=function(){kc9("Updating availability on schedule.");var A=this.T(),L=g.Gk(this.N,function(B,f){return B&&!!Su(A,f)},this);
|
|
QM5(this,L)};
|
|
g.p.l1=function(){g.rW(this.V);this.V=NaN;this.W&&(this.W.abort(),this.W=null);g.SN.prototype.l1.call(this)};
|
|
g.p.nN=function(){g.rW(this.V);this.V=NaN;this.W&&this.W.abort();var A=ClR(this);if(wMt(A)){var L=AJ(this.D,"/pairing/get_screen_availability");this.W=this.D.sendRequest("POST",L,{lounge_token:g.bs(A).join(",")},(0,g.X9)(this.TID,this,A),(0,g.X9)(this.Jzr,this))}else QM5(this,{}),Nu(this)};
|
|
g.p.TID=function(A,L){this.W=null;var B=g.bs(ClR(this));if(g.wo(B,g.bs(A))){L=L.screens||[];B={};for(var f=L.length,K=0;K<f;++K)B[A[L[K].loungeToken]]=L[K].status=="online";QM5(this,B);Nu(this)}else this.VC("Changing Screen set during request."),this.nN()};
|
|
g.p.Jzr=function(A){this.VC("Screen availability failed: "+A);this.W=null;Nu(this)};
|
|
g.p.VC=function(A){ob("OnlineScreenService",A)};g.Ud(FJ,JJ);g.p=FJ.prototype;g.p.start=function(){this.W.start();this.N.start();this.screens.length&&(this.publish("screenChange"),this.N.isEmpty()||this.publish("onlineScreenChange"))};
|
|
g.p.add=function(A,L,B){this.W.add(A,L,B)};
|
|
g.p.remove=function(A,L,B){this.W.remove(A,L,B);this.N.update()};
|
|
g.p.FR=function(A,L,B,f){this.W.contains(A)?this.W.FR(A,L,B,f):(A="Updating name of unknown screen: "+A.name,ob(this.T,A),f(Error(A)))};
|
|
g.p.on=function(A){return A?this.screens:g.Bk(this.screens,g.Mi(this.V,function(L){return!this.contains(L)},this))};
|
|
g.p.Vv=function(){return g.Mi(this.on(!0),function(A){return!!this.N.N[A.id]},this)};
|
|
g.p.mx=function(A,L,B,f,K,V){var J=this;this.info("getDialScreenByPairingCode "+A+" / "+L);var R=new bgX(this.U,A,L,B,f);R.subscribe("pairingComplete",function(Z,N){g.jq(R);K(DM(J,Z),N)});
|
|
R.subscribe("pairingFailed",function(Z){g.jq(R);V(Z)});
|
|
R.start();return(0,g.X9)(R.stop,R)};
|
|
g.p.Z6=function(A,L,B,f){g.ll(AJ(this.U,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:A},timeout:5E3,onSuccess:(0,g.X9)(function(K,V){K=new KN(V.screen||{});if(!K.name||OgW(this,K.name)){a:{V=K.name;for(var J=2,R=L(V,J);OgW(this,R);){J++;if(J>20)break a;R=L(V,J)}V=R}K.name=V}B(DM(this,K))},this),
|
|
onError:(0,g.X9)(function(K){f(Error("pairing request failed: "+K.status))},this),
|
|
onTimeout:(0,g.X9)(function(){f(Error("pairing request timed out."))},this)})};
|
|
g.p.l1=function(){g.jq(this.W);g.jq(this.N);FJ.oy.l1.call(this)};
|
|
g.p.t4F=function(){c_w(this);this.publish("screenChange");this.N.update()};
|
|
FJ.prototype.dispose=FJ.prototype.dispose;g.Ud(dO,g.SN);g.p=dO.prototype;g.p.xR=function(A){this.TL()||(A&&(wO(this,""+A),this.publish("sessionFailed")),this.N=null,this.publish("sessionScreen",null))};
|
|
g.p.info=function(A){ob(this.wT,A)};
|
|
g.p.t6=function(){return null};
|
|
g.p.yS=function(A){var L=this.W;A?(L.displayStatus=new chrome.cast.ReceiverDisplayStatus(A,[]),L.displayStatus.showStop=!0):L.displayStatus=null;chrome.cast.setReceiverDisplayStatus(L,(0,g.X9)(function(){this.info("Updated receiver status for "+L.friendlyName+": "+A)},this),(0,g.X9)(function(){wO(this,"Failed to update receiver status for: "+L.friendlyName)},this))};
|
|
g.p.l1=function(){this.yS("");dO.oy.l1.call(this)};g.G(pA,dO);g.p=pA.prototype;g.p.NC=function(A){if(this.V){if(this.V==A)return;wO(this,"Overriding cast session with new session object");ua5(this);this.Vj=!1;this.yj="unknown";this.V.removeUpdateListener(this.qp);this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.ZM)}this.V=A;this.V.addUpdateListener(this.qp);this.V.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.ZM);PlK(this,"getMdxSessionStatus")};
|
|
g.p.wA=function(A){this.info("launchWithParams no-op for Cast: "+g.vD(A))};
|
|
g.p.stop=function(){this.V?this.V.stop((0,g.X9)(function(){this.xR()},this),(0,g.X9)(function(){this.xR(Error("Failed to stop receiver app."))},this)):this.xR(Error("Stopping cast device without session."))};
|
|
g.p.yS=function(){};
|
|
g.p.l1=function(){this.info("disposeInternal");ua5(this);this.V&&(this.V.removeUpdateListener(this.qp),this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.ZM));this.V=null;dO.prototype.l1.call(this)};
|
|
g.p.N1L=function(A,L){if(!this.TL())if(L)if(L=ai(L),g.QK(L))switch(A=""+L.type,L=L.data||{},this.info("onYoutubeMessage_: "+A+" "+g.vD(L)),A){case "mdxSessionStatus":WMw(this,L);break;case "loungeToken":xs9(this,L);break;default:wO(this,"Unknown youtube message: "+A)}else wO(this,"Unable to parse message.");else wO(this,"No data in message.")};
|
|
g.p.Sn=function(A,L,B,f){g.rW(this.G);this.G=0;X7t(this.U,this.W.label,A,this.W.friendlyName,(0,g.X9)(function(K){K?L(K):f>=0?(wO(this,"Screen "+A+" appears to be offline. "+f+" retries left."),this.G=g.gW((0,g.X9)(this.Sn,this,A,L,B,f-1),300)):B(Error("Unable to fetch screen."))},this),B)};
|
|
g.p.t6=function(){return this.V};
|
|
g.p.D6=function(A){this.TL()||A||(wO(this,"Cast session died."),this.xR())};g.G(yk,dO);g.p=yk.prototype;g.p.NC=function(A){this.V=A;this.V.addUpdateListener(this.JF)};
|
|
g.p.wA=function(A){this.S4=A;this.Wn()};
|
|
g.p.stop=function(){Vww(this);this.V?this.V.stop((0,g.X9)(this.xR,this,null),(0,g.X9)(this.xR,this,"Failed to stop DIAL device.")):this.xR()};
|
|
g.p.l1=function(){Vww(this);this.V&&this.V.removeUpdateListener(this.JF);this.V=null;dO.prototype.l1.call(this)};
|
|
g.p.Mr=function(A){this.TL()||A||(wO(this,"DIAL session died."),this.D(),this.D=function(){},this.xR())};g.G(G_,dO);G_.prototype.stop=function(){this.xR()};
|
|
G_.prototype.NC=function(){};
|
|
G_.prototype.wA=function(){g.rW(this.V);this.V=NaN;var A=Su(this.U.on(),this.W.label);A?Ib(this,A):this.xR(Error("No such screen"))};
|
|
G_.prototype.l1=function(){g.rW(this.V);this.V=NaN;dO.prototype.l1.call(this)};g.G(rO,g.SN);g.p=rO.prototype;
|
|
g.p.init=function(A,L){chrome.cast.timeout.requestSession=3E4;var B=new chrome.cast.SessionRequest(this.G,[chrome.cast.Capability.AUDIO_OUT]);g.h_("desktop_enable_cast_connect")&&(B.androidReceiverCompatible=!0);this.yj||(B.dialRequest=new chrome.cast.DialRequest("YouTube"));var f=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;A=A||this.T?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var K=(0,g.X9)(this.WTD,this);B=new chrome.cast.ApiConfig(B,(0,g.X9)(this.F_,
|
|
this),K,f,A);B.customDialLaunchCallback=(0,g.X9)(this.SEx,this);chrome.cast.initialize(B,(0,g.X9)(function(){this.TL()||(chrome.cast.addReceiverActionListener(this.D),jM9(),this.W.subscribe("onlineScreenChange",(0,g.X9)(this.FP,this)),this.V=RmK(this),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.X9)(function(V){this.VC("Failed to set initial custom receivers: "+g.vD(V))},this)),this.publish("yt-remote-cast2-availability-change",Hz(this)),L(!0))},this),(0,g.X9)(function(V){this.VC("Failed to initialize API: "+
|
|
g.vD(V));
|
|
L(!1)},this))};
|
|
g.p.Zhr=function(A,L){s1("Setting connected screen ID: "+A+" -> "+L);if(this.N){var B=this.N.N;if(!A||B&&B.id!=A)s1("Unsetting old screen status: "+this.N.W.friendlyName),hJ(this,null)}if(A&&L){if(!this.N){A=Su(this.W.on(),A);if(!A){s1("setConnectedScreenStatus: Unknown screen.");return}if(A.idType=="shortLived"){s1("setConnectedScreenStatus: Screen with id type to be short lived.");return}B=JKK(this,A);B||(s1("setConnectedScreenStatus: Connected receiver not custom..."),B=new chrome.cast.Receiver(A.uuid?
|
|
A.uuid:A.id,A.name),B.receiverType=chrome.cast.ReceiverType.CUSTOM,this.V.push(B),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.X9)(function(f){this.VC("Failed to set initial custom receivers: "+g.vD(f))},this)));
|
|
s1("setConnectedScreenStatus: new active receiver: "+B.friendlyName);hJ(this,new G_(this.W,B),!0)}this.N.yS(L)}else s1("setConnectedScreenStatus: no screen.")};
|
|
g.p.Sfj=function(A){this.TL()?this.VC("Setting connection data on disposed cast v2"):this.N?this.N.wA(A):this.VC("Setting connection data without a session")};
|
|
g.p.Si=function(){this.TL()?this.VC("Stopping session on disposed cast v2"):this.N?(this.N.stop(),hJ(this,null)):s1("Stopping non-existing session")};
|
|
g.p.requestSession=function(){chrome.cast.requestSession((0,g.X9)(this.F_,this),(0,g.X9)(this.XkL,this))};
|
|
g.p.l1=function(){this.W.unsubscribe("onlineScreenChange",(0,g.X9)(this.FP,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.D);var A=w7I,L=g.bB("yt.mdx.remote.debug.handlers_");g.Lx(L||[],A);g.jq(this.N);g.SN.prototype.l1.call(this)};
|
|
g.p.VC=function(A){ob("Controller",A)};
|
|
g.p.wO=function(A,L){this.N==A&&(L||hJ(this,null),this.publish("yt-remote-cast2-session-change",L))};
|
|
g.p.dQn=function(A,L){if(!this.TL())if(A)switch(A.friendlyName=chrome.cast.unescape(A.friendlyName),s1("onReceiverAction_ "+A.label+" / "+A.friendlyName+"-- "+L),L){case chrome.cast.ReceiverAction.CAST:if(this.N)if(this.N.W.label!=A.label)s1("onReceiverAction_: Stopping active receiver: "+this.N.W.friendlyName),this.N.stop();else{s1("onReceiverAction_: Casting to active receiver.");this.N.N&&this.publish("yt-remote-cast2-session-change",this.N.N);break}switch(A.receiverType){case chrome.cast.ReceiverType.CUSTOM:hJ(this,
|
|
new G_(this.W,A));break;case chrome.cast.ReceiverType.DIAL:hJ(this,new yk(this.W,A,this.U,this.config_));break;case chrome.cast.ReceiverType.CAST:hJ(this,new pA(this.W,A,this.config_));break;default:this.VC("Unknown receiver type: "+A.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.N&&this.N.W.label==A.label?this.N.stop():this.VC("Stopping receiver w/o session: "+A.friendlyName)}else this.VC("onReceiverAction_ called without receiver.")};
|
|
g.p.SEx=function(A){if(this.TL())return Promise.reject(Error("disposed"));var L=A.receiver;L.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.VC("Not DIAL receiver: "+L.friendlyName),L.receiverType=chrome.cast.ReceiverType.DIAL);var B=this.N?this.N.W:null;if(!B||B.label!=L.label)return this.VC("Receiving DIAL launch request for non-clicked DIAL receiver: "+L.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(B&&B.label==L.label&&B.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.N.N)return s1("Reselecting dial screen."),
|
|
this.publish("yt-remote-cast2-session-change",this.N.N),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.VC('Changing CAST intent from "'+B.receiverType+'" to "dial" for '+L.friendlyName);hJ(this,new yk(this.W,L,this.U,this.config_))}L=this.N;L.G=A;L.G.appState==chrome.cast.DialAppState.RUNNING?(A=L.G.extraData||{},B=A.screenId||null,j0(L)&&A.loungeToken?A.loungeTokenRefreshIntervalMs?A=BLw(L,{name:L.W.friendlyName,screenId:A.screenId,loungeToken:A.loungeToken,dialId:L.G.receiver.label,
|
|
screenIdType:"shortLived"},A.loungeTokenRefreshIntervalMs):(g.B7(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(A)+".")),A=fGt(L,B)):A=fGt(L,B)):A=LuR(L);return A};
|
|
g.p.F_=function(A){var L=this;if(!this.TL()&&!this.T){s1("New cast session ID: "+A.sessionId);var B=A.receiver;if(B.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.N)if(B.receiverType==chrome.cast.ReceiverType.CAST)s1("Got resumed cast session before resumed mdx connection."),B.friendlyName=chrome.cast.unescape(B.friendlyName),hJ(this,new pA(this.W,B,this.config_),!0);else{this.VC("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var f=this.N.W,K=Su(this.W.on(),
|
|
f.label);K&&VO(K,B.label)&&f.receiverType!=chrome.cast.ReceiverType.CAST&&B.receiverType==chrome.cast.ReceiverType.CAST&&(s1("onSessionEstablished_: manual to cast session change "+B.friendlyName),g.jq(this.N),this.N=new pA(this.W,B,this.config_),this.N.subscribe("sessionScreen",(0,g.X9)(this.wO,this,this.N)),this.N.subscribe("sessionFailed",function(){return SS9(L,L.N)}),this.N.wA(null));
|
|
this.N.NC(A)}}};
|
|
g.p.RW=function(){return this.N?this.N.t6():null};
|
|
g.p.XkL=function(A){this.TL()||(this.VC("Failed to estabilish a session: "+g.vD(A)),A.code!=chrome.cast.ErrorCode.CANCEL&&hJ(this,null),this.publish("yt-remote-cast2-session-failed"))};
|
|
g.p.WTD=function(A){s1("Receiver availability updated: "+A);if(!this.TL()){var L=Hz(this);this.X=A==chrome.cast.ReceiverAvailability.AVAILABLE;Hz(this)!=L&&this.publish("yt-remote-cast2-availability-change",Hz(this))}};
|
|
g.p.FP=function(){this.TL()||(this.V=RmK(this),s1("Updating custom receivers: "+g.vD(this.V)),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.X9)(function(){this.VC("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Hz(this)))};
|
|
rO.prototype.setLaunchParams=rO.prototype.Sfj;rO.prototype.setConnectedScreenStatus=rO.prototype.Zhr;rO.prototype.stopSession=rO.prototype.Si;rO.prototype.getCastSession=rO.prototype.RW;rO.prototype.requestSession=rO.prototype.requestSession;rO.prototype.init=rO.prototype.init;rO.prototype.dispose=rO.prototype.dispose;var hXd=g.eE(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),jXO=[],w9K=g.d_(hXd);g.p=Qk.prototype;
|
|
g.p.reset=function(A){this.listId="";this.index=-1;this.videoId="";hmt(this);this.volume=-1;this.muted=!1;A&&(this.index=A.index,this.listId=A.listId,this.videoId=A.videoId,this.playerState=A.playerState,this.volume=A.volume,this.muted=A.muted,this.audioTrackId=A.audioTrackId,this.trackData=A.trackData,this.hasPrevious=A.hasPrevious,this.hasNext=A.hasNext,this.T=A.playerTime,this.D=A.playerTimeAt,this.W=A.seekableStart,this.X=A.seekableEnd,this.V=A.duration,this.loadedTime=A.loadedTime,this.N=A.liveIngestionTime,
|
|
this.U=!isNaN(this.N))};
|
|
g.p.isPlaying=function(){return this.playerState==1};
|
|
g.p.isBuffering=function(){return this.playerState==3};
|
|
g.p.Vr=function(A){this.V=isNaN(A)?0:A};
|
|
g.p.getDuration=function(){return this.U?this.V+CA(this):this.V};
|
|
g.p.clone=function(){return new Qk(tww(this))};g.G(E1,g.SN);g.p=E1.prototype;g.p.getState=function(){return this.V};
|
|
g.p.m5=function(){return this.U.getReconnectTimeout()};
|
|
g.p.gt=function(){this.U.reconnect()};
|
|
g.p.play=function(){Mu(this)?(this.N?this.N.play(null,g.x9,vz(this,"play")):Wz(this,"play"),lGd(this,1,$P(cz(this))),this.publish("remotePlayerChange")):YP(this,this.play)};
|
|
g.p.pause=function(){Mu(this)?(this.N?this.N.pause(null,g.x9,vz(this,"pause")):Wz(this,"pause"),lGd(this,2,$P(cz(this))),this.publish("remotePlayerChange")):YP(this,this.pause)};
|
|
g.p.seekTo=function(A){if(Mu(this)){if(this.N){var L=cz(this),B=new chrome.cast.media.SeekRequest;B.currentTime=A;L.isPlaying()||L.isBuffering()?B.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:B.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.N.seek(B,g.x9,vz(this,"seekTo",{newTime:A}))}else Wz(this,"seekTo",{newTime:A});lGd(this,3,A);this.publish("remotePlayerChange")}else YP(this,g.Od(this.seekTo,A))};
|
|
g.p.stop=function(){if(Mu(this)){this.N?this.N.stop(null,g.x9,vz(this,"stopVideo")):Wz(this,"stopVideo");var A=cz(this);A.index=-1;A.videoId="";hmt(A);U1(this,A);this.publish("remotePlayerChange")}else YP(this,this.stop)};
|
|
g.p.setVolume=function(A,L){if(Mu(this)){var B=cz(this);if(this.W){if(B.volume!=A){var f=Math.round(A)/100;this.W.setReceiverVolumeLevel(f,(0,g.X9)(function(){Bz("set receiver volume: "+f)},this),(0,g.X9)(function(){this.VC("failed to set receiver volume.")},this))}B.muted!=L&&this.W.setReceiverMuted(L,(0,g.X9)(function(){Bz("set receiver muted: "+L)},this),(0,g.X9)(function(){this.VC("failed to set receiver muted.")},this))}else{var K={volume:A,
|
|
muted:L};B.volume!=-1&&(K.delta=A-B.volume);Wz(this,"setVolume",K)}B.muted=L;B.volume=A;U1(this,B)}else YP(this,g.Od(this.setVolume,A,L))};
|
|
g.p.UH=function(A,L){if(Mu(this)){var B=cz(this);A={videoId:A};L&&(B.trackData={trackName:L.name,languageCode:L.languageCode,sourceLanguageCode:L.translationLanguage?L.translationLanguage.languageCode:"",languageName:L.languageName,kind:L.kind},A.style=g.vD(L.style),g.Xc(A,B.trackData));Wz(this,"setSubtitlesTrack",A);U1(this,B)}else YP(this,g.Od(this.UH,A,L))};
|
|
g.p.setAudioTrack=function(A,L){Mu(this)?(L=L.getLanguageInfo().getId(),Wz(this,"setAudioTrack",{videoId:A,audioTrackId:L}),A=cz(this),A.audioTrackId=L,U1(this,A)):YP(this,g.Od(this.setAudioTrack,A,L))};
|
|
g.p.playVideo=function(A,L,B,f,K,V,J){f=f===void 0?null:f;K=K===void 0?null:K;V=V===void 0?null:V;J=J===void 0?null:J;var R=cz(this),Z={videoId:A};B!==void 0&&(Z.currentIndex=B);XJ(R,A,B||0);L!==void 0&&(ie(R,L),Z.currentTime=L);f&&(Z.listId=f);K&&(Z.playerParams=K);V&&(Z.clickTrackingParams=V);J&&(Z.locationInfo=g.vD(J));Wz(this,"setPlaylist",Z);f||U1(this,R)};
|
|
g.p.oS=function(A,L){if(Mu(this)){if(A&&L){var B=cz(this);XJ(B,A,L);U1(this,B)}Wz(this,"previous")}else YP(this,g.Od(this.oS,A,L))};
|
|
g.p.nextVideo=function(A,L){if(Mu(this)){if(A&&L){var B=cz(this);XJ(B,A,L);U1(this,B)}Wz(this,"next")}else YP(this,g.Od(this.nextVideo,A,L))};
|
|
g.p.MG=function(){if(Mu(this)){Wz(this,"clearPlaylist");var A=cz(this);A.reset();U1(this,A);this.publish("remotePlayerChange")}else YP(this,this.MG)};
|
|
g.p.Z7=function(){Mu(this)?Wz(this,"dismissAutoplay"):YP(this,this.Z7)};
|
|
g.p.dispose=function(){if(this.V!=3){var A=this.V;this.V=3;this.publish("proxyStateChange",A,this.V)}g.SN.prototype.dispose.call(this)};
|
|
g.p.l1=function(){TLd(this);this.U=null;this.D.clear();O1(this,null);g.SN.prototype.l1.call(this)};
|
|
g.p.l$=function(A){if((A!=this.V||A==2)&&this.V!=3&&A!=0){var L=this.V;this.V=A;this.publish("proxyStateChange",L,A);if(A==1)for(;!this.D.isEmpty();)L=A=this.D,L.N.length===0&&(L.N=L.W,L.N.reverse(),L.W=[]),A.N.pop().apply(this);else A==3&&this.dispose()}};
|
|
g.p.BXr=function(A,L){this.publish(A,L)};
|
|
g.p.m8r=function(A){if(!A)this.rJ(null),O1(this,null);else if(this.W.receiver.volume){A=this.W.receiver.volume;var L=cz(this),B=Math.round(100*A.level||0);if(L.volume!=B||L.muted!=A.muted)Bz("Cast volume update: "+A.level+(A.muted?" muted":"")),L.volume=B,L.muted=!!A.muted,U1(this,L)}};
|
|
g.p.rJ=function(A){Bz("Cast media: "+!!A);this.N&&this.N.removeUpdateListener(this.G);if(this.N=A)this.N.addUpdateListener(this.G),mEd(this),this.publish("remotePlayerChange")};
|
|
g.p.V$j=function(A){A?(mEd(this),this.publish("remotePlayerChange")):this.rJ(null)};
|
|
g.p.CM=function(){Wz(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
|
|
g.p.t$L=function(){var A=rKI();A&&O1(this,A)};
|
|
g.p.VC=function(A){ob("CP",A)};g.G(xP,g.SN);g.p=xP.prototype;
|
|
g.p.connect=function(A,L){if(L){var B=L.listId,f=L.videoId,K=L.videoIds,V=L.playerParams,J=L.clickTrackingParams,R=L.index,Z={videoId:f},N=L.currentTime,F=L.locationInfo;L=L.loopMode;N!==void 0&&(Z.currentTime=N<=5?0:N);V&&(Z.playerParams=V);F&&(Z.locationInfo=F);J&&(Z.clickTrackingParams=J);B&&(Z.listId=B);K&&K.length>0&&(Z.videoIds=K.join(","));R!==void 0&&(Z.currentIndex=R);this.JF&&(Z.loopMode=L||"LOOP_MODE_OFF");B&&(this.N.listId=B);this.N.videoId=f;this.N.index=R||0;this.N.state=3;ie(this.N,
|
|
N);this.D="UNSUPPORTED";B=this.JF?"setInitialState":"setPlaylist";qu("Connecting with "+B+" and params: "+g.vD(Z));this.W.connect({method:B,params:g.vD(Z)},A,PN5())}else qu("Connecting without params"),this.W.connect({},A,PN5());$Ef(this)};
|
|
g.p.GW=function(A){this.W.GW(A)};
|
|
g.p.dispose=function(){this.TL()||(g.hf("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),Pz(this,3));g.SN.prototype.dispose.call(this)};
|
|
g.p.l1=function(){X95(this);E_5(this);Onf(this);g.rW(this.G);this.G=NaN;g.rW(this.yj);this.yj=NaN;this.U=null;g.k_(this.Wn);this.Wn.length=0;this.W.dispose();g.SN.prototype.l1.call(this);this.D=this.X=this.V=this.N=this.W=null};
|
|
g.p.ZC=function(A){if(!this.V||this.V.length===0)return!1;for(var L=g.m(this.V),B=L.next();!B.done;B=L.next())if(!B.value.capabilities.has(A))return!1;return!0};
|
|
g.p.A4=function(){var A=3;this.TL()||(A=0,isNaN(this.t7())?this.W.Tk()&&isNaN(this.T)&&(A=1):A=2);return A};
|
|
g.p.W2=function(A){qu("Disconnecting with "+A);g.hf("yt.mdx.remote.remoteClient_",null);X95(this);this.publish("beforeDisconnect",A);A==1&&N3();this.W.disconnect(A);this.dispose()};
|
|
g.p.Xd=function(){var A=this.N;this.U&&(A=this.N.clone(),XJ(A,this.U,A.index));return tww(A)};
|
|
g.p.j4n=function(A){var L=this,B=new Qk(A);B.videoId&&B.videoId!=this.N.videoId&&(this.U=B.videoId,g.rW(this.G),this.G=g.gW(function(){if(L.U){var K=L.U;L.U=null;L.N.videoId!=K&&e0(L,"getNowPlaying")}},5E3));
|
|
var f=[];this.N.listId==B.listId&&this.N.videoId==B.videoId&&this.N.index==B.index||f.push("remoteQueueChange");this.N.playerState==B.playerState&&this.N.volume==B.volume&&this.N.muted==B.muted&&$P(this.N)==$P(B)&&g.vD(this.N.trackData)==g.vD(B.trackData)||f.push("remotePlayerChange");this.N.reset(A);g.yB(f,function(K){this.publish(K)},this)};
|
|
g.p.UG=function(){var A=this.W.getDeviceId(),L=g.Pw(this.V,function(B){return B.type=="REMOTE_CONTROL"&&B.id!=A});
|
|
return L?L.id:""};
|
|
g.p.t7=function(){return this.W.m5()};
|
|
g.p.IY=function(){return this.D||"UNSUPPORTED"};
|
|
g.p.lm=function(){return this.X||""};
|
|
g.p.JD=function(){!isNaN(this.t7())&&this.W.gt()};
|
|
g.p.bhM=function(A,L){e0(this,A,L);Mw9(this)};
|
|
g.p.wm=function(){var A=g.Yz("SAPISID","")||g.Yz("__Secure-1PAPISID")||"",L=g.Yz("__Secure-3PAPISID","")||"";if(!A&&!L)return"";A=g.Y$(g.Ma(A),2);L=g.Y$(g.Ma(L),2);return g.Y$(g.Ma(","+A+","+L),2)};
|
|
xP.prototype.subscribe=xP.prototype.subscribe;xP.prototype.unsubscribeByKey=xP.prototype.vR;xP.prototype.getProxyState=xP.prototype.A4;xP.prototype.disconnect=xP.prototype.W2;xP.prototype.getPlayerContextData=xP.prototype.Xd;xP.prototype.setPlayerContextData=xP.prototype.j4n;xP.prototype.getOtherConnectedRemoteId=xP.prototype.UG;xP.prototype.getReconnectTimeout=xP.prototype.t7;xP.prototype.getAutoplayMode=xP.prototype.IY;xP.prototype.getAutoplayVideoId=xP.prototype.lm;xP.prototype.reconnect=xP.prototype.JD;
|
|
xP.prototype.sendMessage=xP.prototype.bhM;xP.prototype.getXsrfToken=xP.prototype.wm;xP.prototype.isCapabilitySupportedOnConnectedDevices=xP.prototype.ZC;g.G(aGR,JJ);g.p=aGR.prototype;g.p.on=function(A){return this.Uf.$_gs(A)};
|
|
g.p.contains=function(A){return!!this.Uf.$_c(A)};
|
|
g.p.get=function(A){return this.Uf.$_g(A)};
|
|
g.p.start=function(){this.Uf.$_st()};
|
|
g.p.add=function(A,L,B){this.Uf.$_a(A,L,B)};
|
|
g.p.remove=function(A,L,B){this.Uf.$_r(A,L,B)};
|
|
g.p.FR=function(A,L,B,f){this.Uf.$_un(A,L,B,f)};
|
|
g.p.l1=function(){for(var A=this.N.length,L=0;L<A;++L)this.Uf.$_ubk(this.N[L]);this.N.length=0;this.Uf=null;JJ.prototype.l1.call(this)};
|
|
g.p.Th=function(){this.publish("screenChange")};
|
|
g.p.W1F=function(){this.publish("onlineScreenChange")};
|
|
FJ.prototype.$_st=FJ.prototype.start;FJ.prototype.$_gspc=FJ.prototype.Z6;FJ.prototype.$_gsppc=FJ.prototype.mx;FJ.prototype.$_c=FJ.prototype.contains;FJ.prototype.$_g=FJ.prototype.get;FJ.prototype.$_a=FJ.prototype.add;FJ.prototype.$_un=FJ.prototype.FR;FJ.prototype.$_r=FJ.prototype.remove;FJ.prototype.$_gs=FJ.prototype.on;FJ.prototype.$_gos=FJ.prototype.Vv;FJ.prototype.$_s=FJ.prototype.subscribe;FJ.prototype.$_ubk=FJ.prototype.vR;var VE=null,RB=!1,nA=null,z_=null,ZsI=null,LD=[];g.G(I3I,g.Y);g.p=I3I.prototype;g.p.l1=function(){g.Y.prototype.l1.call(this);this.W.stop();this.V.stop();this.G.stop();var A=this.di;A.unsubscribe("proxyStateChange",this.V7,this);A.unsubscribe("remotePlayerChange",this.AK,this);A.unsubscribe("remoteQueueChange",this.Je,this);A.unsubscribe("previousNextChange",this.qa,this);A.unsubscribe("nowAutoplaying",this.LT,this);A.unsubscribe("autoplayDismissed",this.Ab,this);this.di=this.N=null};
|
|
g.p.GM=function(A){var L=g.pf.apply(1,arguments);if(this.di.V!=2)if(Zf(this)){if(cz(this.di).playerState!=1081||A!=="control_seek")switch(A){case "control_toggle_play_pause":cz(this.di).isPlaying()?this.di.pause():this.di.play();break;case "control_play":this.di.play();break;case "control_pause":this.di.pause();break;case "control_seek":this.X.Za(L[0],L[1]);break;case "control_subtitles_set_track":pfO(this,L[0]);break;case "control_set_audio_track":this.setAudioTrack(L[0])}}else switch(A){case "control_toggle_play_pause":case "control_play":case "control_pause":L=
|
|
this.S.getCurrentTime();N_(this,L===0?void 0:L);break;case "control_seek":N_(this,L[0]);break;case "control_subtitles_set_track":pfO(this,L[0]);break;case "control_set_audio_track":this.setAudioTrack(L[0])}};
|
|
g.p.lxj=function(A){this.G.Pi(A)};
|
|
g.p.iVs=function(A){this.GM("control_subtitles_set_track",g.mi(A)?null:A)};
|
|
g.p.IX=function(){var A=this.S.getOption("captions","track");g.mi(A)||pfO(this,A)};
|
|
g.p.iq=function(A){this.N.iq(A,this.S.getVideoData().lengthSeconds)};
|
|
g.p.QA4=function(){g.mi(this.U)||yRR(this,this.U);this.D=!1};
|
|
g.p.V7=function(A,L){this.V.stop();L===2&&this.OP()};
|
|
g.p.AK=function(){if(Zf(this)){this.W.stop();var A=cz(this.di);switch(A.playerState){case 1080:case 1081:case 1084:case 1085:this.N.Ic=1;break;case 1082:case 1083:this.N.Ic=0;break;default:this.N.Ic=-1}switch(A.playerState){case 1081:case 1:this.q8(new g.Gu(8));this.o2();break;case 1085:case 3:this.q8(new g.Gu(9));break;case 1083:case 0:this.q8(new g.Gu(2));this.X.stop();this.iq(this.S.getVideoData().lengthSeconds);break;case 1084:this.q8(new g.Gu(4));break;case 2:this.q8(new g.Gu(4));this.iq($P(A));
|
|
break;case -1:this.q8(new g.Gu(64));break;case -1E3:this.q8(new g.Gu(128,{errorCode:"mdx.remoteerror",errorMessage:"Questo video non \u00e8 disponibile per la riproduzione remota.",V5:2}))}A=cz(this.di).trackData;var L=this.U;(A||L?A&&L&&A.trackName==L.trackName&&A.languageCode==L.languageCode&&A.languageName==L.languageName&&A.kind==L.kind:1)||(this.U=A,yRR(this,A));A=cz(this.di);A.volume===-1||Math.round(this.S.getVolume())===A.volume&&this.S.isMuted()===A.muted||this.yj.isActive()||this.oX()}else wfW(this)};
|
|
g.p.qa=function(){this.S.publish("mdxpreviousnextchange")};
|
|
g.p.Je=function(){Zf(this)||wfW(this)};
|
|
g.p.LT=function(A){isNaN(A)||this.S.publish("mdxnowautoplaying",A)};
|
|
g.p.Ab=function(){this.S.publish("mdxautoplaycanceled")};
|
|
g.p.setAudioTrack=function(A){Zf(this)&&this.di.setAudioTrack(this.S.getVideoData(1).videoId,A)};
|
|
g.p.seekTo=function(A,L){cz(this.di).playerState===-1?N_(this,A):L&&this.di.seekTo(A)};
|
|
g.p.oX=function(){var A=this;if(Zf(this)){var L=cz(this.di);this.events.J$(this.Wn);L.muted?this.S.mute():this.S.unMute();this.S.setVolume(L.volume);this.Wn=this.events.Y(this.S,"onVolumeChange",function(B){Dxt(A,B)})}};
|
|
g.p.o2=function(){this.W.stop();if(!this.di.TL()){var A=cz(this.di);A.isPlaying()&&this.q8(new g.Gu(8));this.iq($P(A));this.W.start()}};
|
|
g.p.OP=function(){this.V.stop();this.W.stop();var A=this.di.m5();this.di.V==2&&!isNaN(A)&&this.V.start()};
|
|
g.p.q8=function(A){this.V.stop();var L=this.T;if(!g.tA(L,A)){var B=g.x(A,2);B!==g.x(this.T,2)&&this.S.SZ(B);this.T=A;GUR(this.N,L,A)}};g.G(jlf,g.XA);g.p=jlf.prototype;g.p.getCurrentTime=function(){return this.N.getCurrentTime()};
|
|
g.p.getDuration=function(){return this.N.getDuration()};
|
|
g.p.wX=function(){return this.N.wX()};
|
|
g.p.rQ=function(){return this.N.rQ()};
|
|
g.p.bH=function(){return this.N.bH()};
|
|
g.p.I5=function(){return this.N.I5()};
|
|
g.p.getPlayerState=function(){return this.N.xb};
|
|
g.p.isAtLiveHead=function(){return this.N.isAtLiveHead()};
|
|
g.p.pauseVideo=function(){this.N.W5("control_pause")};
|
|
g.p.playVideo=function(){var A=this;return g.c(function(L){A.N.W5("control_play");return L.return()})};
|
|
g.p.seekTo=function(A,L){this.N.W5("control_seek",A,!(L==null?0:L.aN))};
|
|
g.p.WG=function(A){this.N.W5("control_set_audio_track",A);return!0};g.G(Fe,g.q);Fe.prototype.fD=function(){this.fade.show()};
|
|
Fe.prototype.YP=function(){this.fade.hide()};
|
|
Fe.prototype.N=function(){Dv("mdx-privacy-popup-cancel");this.YP()};
|
|
Fe.prototype.W=function(){Dv("mdx-privacy-popup-confirm");this.YP()};g.G(Df,g.q);Df.prototype.onStateChange=function(A){this.Y6(A.state)};
|
|
Df.prototype.Y6=function(A){if(this.api.getPresentingPlayerType()===3){var L={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};A=g.x(A,128)?g.B$("Errore su $RECEIVER_NAME",L):A.isPlaying()||A.isPaused()?g.B$("In riproduzione su $RECEIVER_NAME",L):g.B$("Connesso a $RECEIVER_NAME",L);this.updateValue("statustext",A);this.fade.show()}else this.fade.hide()};g.G(dG,g.He);dG.prototype.W=function(){var A=this.S.getOption("remote","receivers");A&&A.length>1&&!this.S.getOption("remote","quickCast")?(this.Sd=g.jZ(A,this.N,this),this.eO(g.mn(A,this.N)),A=this.S.getOption("remote","currentReceiver"),A=this.N(A),this.options[A]&&this.GH(A),this.enable(!0)):this.enable(!1)};
|
|
dG.prototype.N=function(A){return A.key};
|
|
dG.prototype.I8=function(A){return A==="cast-selector-receiver"?"Trasmetti\u2026":this.Sd[A].name};
|
|
dG.prototype.A$=function(A){g.He.prototype.A$.call(this,A);this.S.setOption("remote","currentReceiver",this.Sd[A]);this.Wz.YP()};g.G(gLw,g.FB);g.p=gLw.prototype;
|
|
g.p.create=function(){var A=this.player.K(),L=g.PL(A);A={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:A.J("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:A.J("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:A.J("enable_cast_short_lived_lounge_token")};f3d(L,A);this.subscriptions.push(g.fV("yt-remote-before-disconnect",this.qE1,this));this.subscriptions.push(g.fV("yt-remote-connection-change",this.H8T,this));this.subscriptions.push(g.fV("yt-remote-receiver-availability-change",this.kZ,
|
|
this));this.subscriptions.push(g.fV("yt-remote-auto-connect",this.yzL,this));this.subscriptions.push(g.fV("yt-remote-receiver-resumed",this.NIj,this));this.subscriptions.push(g.fV("mdx-privacy-popup-confirm",this.r_j,this));this.subscriptions.push(g.fV("mdx-privacy-popup-cancel",this.gyM,this));this.kZ()};
|
|
g.p.load=function(){this.player.cancelPlayback();g.FB.prototype.load.call(this);this.VN=new jlf(this.player.K(),this);this.player.Gr(this.VN);this.Yf=new I3I(this,this.player,this.di);var A=(A=FzI())?A.currentTime:0;var L=RXI()?new E1(KD(),void 0):null;A==0&&L&&(A=$P(cz(L)));A!==0&&this.iq(A);GUR(this,this.xb,this.xb);this.player.dN(6)};
|
|
g.p.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.jw();this.au=this.rN;g.gH(this.Yf,this.di);this.di=this.VN=this.Yf=null;g.FB.prototype.unload.call(this);this.player.dN(5);IB(this)};
|
|
g.p.l1=function(){g.KV(this.subscriptions);g.FB.prototype.l1.call(this)};
|
|
g.p.W5=function(A){var L=g.pf.apply(1,arguments);this.loaded&&this.Yf.GM.apply(this.Yf,[A].concat(g.x7(L)))};
|
|
g.p.getAdState=function(){return this.Ic};
|
|
g.p.hasPrevious=function(){return this.di?cz(this.di).hasPrevious:!1};
|
|
g.p.hasNext=function(){return this.di?cz(this.di).hasNext:!1};
|
|
g.p.iq=function(A,L){this.zG=A||0;this.player.publish("progresssync",A,L);this.player.Wo("onVideoProgress",A||0)};
|
|
g.p.getCurrentTime=function(){return this.zG};
|
|
g.p.getDuration=function(){return cz(this.di).getDuration()||0};
|
|
g.p.wX=function(){var A=cz(this.di);return A.U?A.N+CA(A):A.N};
|
|
g.p.rQ=function(){return cz(this.di).loadedTime};
|
|
g.p.bH=function(){return bnW(cz(this.di))};
|
|
g.p.I5=function(){var A=cz(this.di);return A.W>0?A.W+CA(A):A.W};
|
|
g.p.getProgressState=function(){var A=cz(this.di),L=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:A.playerState!=1081&&this.player.Kw(),clipEnd:L.clipEnd,clipStart:L.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.wX(),isAtLiveHead:this.isAtLiveHead(),loaded:this.rQ(),seekableEnd:this.bH(),seekableStart:this.I5(),offset:0,viewerLivestreamJoinMediaTime:0}};
|
|
g.p.isAtLiveHead=function(){return bnW(cz(this.di))-this.getCurrentTime()<=1};
|
|
g.p.nextVideo=function(){this.di&&this.di.nextVideo()};
|
|
g.p.oS=function(){this.di&&this.di.oS()};
|
|
g.p.qE1=function(A){A===1&&(this.H3=this.di?cz(this.di):null)};
|
|
g.p.H8T=function(){var A=RXI()?new E1(KD(),void 0):null;if(A){var L=this.au;this.loaded&&this.unload();this.di=A;this.H3=null;L.key!==this.rN.key&&(this.au=L,this.load())}else g.jq(this.di),this.di=null,this.loaded&&(this.unload(),(A=this.H3)&&A.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(A.videoId,$P(A)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
|
|
g.p.kZ=function(){var A=[this.rN],L=A.concat,B=KzO();T_()&&g.ES("yt-remote-cast-available")&&B.push({key:"cast-selector-receiver",name:"Cast..."});this.Sd=L.call(A,B);A=JRR()||this.rN;wG(this,A);this.player.Wo("onMdxReceiversChange")};
|
|
g.p.yzL=function(){var A=JRR();wG(this,A)};
|
|
g.p.NIj=function(){this.au=JRR()};
|
|
g.p.r_j=function(){this.Wl=!0;IB(this);RB=!1;VE&&SY(VE,1);VE=null};
|
|
g.p.gyM=function(){this.Wl=!1;IB(this);wG(this,this.rN);this.au=this.rN;RB=!1;VE=null;this.player.playVideo()};
|
|
g.p.PR=function(A,L){switch(A){case "casting":return this.loaded;case "receivers":return this.Sd;case "currentReceiver":return L&&(L.key==="cast-selector-receiver"?sXd():wG(this,L)),this.loaded?this.au:this.rN;case "quickCast":return this.Sd.length===2&&this.Sd[1].key==="cast-selector-receiver"?(L&&sXd(),!0):!1}};
|
|
g.p.CM=function(){this.di.CM()};
|
|
g.p.Pg=function(){return!1};
|
|
g.p.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
|
|
g.p.isLoggedIn=function(){var A,L;return((A=g.A_("PLAYER_CONFIG"))==null?void 0:(L=A.args)==null?void 0:L.authuser)!==void 0?!0:!(!g.A_("SESSION_INDEX")&&!g.A_("LOGGED_IN"))};g.Np("remote",gLw);})(_yt_player);
|