mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
533 lines
88 KiB
Plaintext
533 lines
88 KiB
Plaintext
(function(g){var window=this;var Iua=function(a,b){return g.Lb(a,b)},Y5=function(a,b,c){a.w.set(b,c)},Z5=function(a){Y5(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.H)()).toString(36));
|
|
return a},$5=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
|
|
g.dn(a.w,b,c)},Jua=function(a,b){var c=[];
|
|
g.kk(b,function(d){try{var e=g.go.prototype.u.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.fo(e)&&c.push(d)},a);
|
|
return c},Kua=function(a,b){var c=Jua(a,b);
|
|
(0,g.y)(c,function(d){g.go.prototype.remove.call(this,d)},a)},Lua=function(a){if(a.Pc){if(a.Pc.locationOverrideToken)return{locationOverrideToken:a.Pc.locationOverrideToken};
|
|
if(null!=a.Pc.latitudeE7&&null!=a.Pc.longitudeE7)return{latitudeE7:a.Pc.latitudeE7,longitudeE7:a.Pc.longitudeE7}}return null},Mua=function(a,b){g.cb(a,b)||a.push(b)},a6=function(a){var b=0,c;
|
|
for(c in a)b++;return b},Nua=function(a,b){var c=b instanceof g.vc?b:g.Ac(b,/^data:image\//i.test(b));
|
|
a.src=g.wc(c)},b6=function(){},Oua=function(a){try{return g.v.JSON.parse(a)}catch(b){}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(b){}throw Error("Invalid JSON string: "+a);},Pua=function(a){if(a.Bd&&"function"==typeof a.Bd)return a.Bd();
|
|
if("string"===typeof a)return a.split("");if(g.Na(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Hb(a)},Qua=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
|
|
else if(g.Na(a)||"string"===typeof a)(0,g.y)(a,b,void 0);else{if(a.se&&"function"==typeof a.se)var c=a.se();else if(a.Bd&&"function"==typeof a.Bd)c=void 0;else if(g.Na(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Ib(a);d=Pua(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},Rua=function(a,b,c,d){var e=new g.Sm(null,void 0);
|
|
a&&g.Tm(e,a);b&&g.Um(e,b);c&&g.Vm(e,c);d&&(e.u=d);return e},c6=function(a,b){g.Po[a]=!0;
|
|
var c=g.No();c&&c.publish.apply(c,arguments);g.Po[a]=!1},d6=function(a){this.app=this.name=this.id="";
|
|
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.w=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Pm;this.o=this.u="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Sua(this,a.capabilities||""),Tua(this,a.experiments||""),this.u=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey||
|
|
"")},Sua=function(a,b){a.capabilities.clear();
|
|
(0,g.ve)(b.split(","),g.Sa(Iua,Uua)).forEach(function(c){a.capabilities.add(c)})},Tua=function(a,b){a.experiments.clear();
|
|
b.split(",").forEach(function(c){a.experiments.add(c)})},e6=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||""},f6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Vua=function(a){return{name:a.name,
|
|
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},Wua=function(a){return new e6(a)},Xua=function(a){return g.Ma(a)?(0,g.Fc)(a,Wua):[]},g6=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):"-")+"}":"null"},h6=function(a){return g.Ma(a)?"["+(0,g.Fc)(a,g6).join(",")+"]":"null"},i6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;
|
|
return("x"==a?b:b&3|8).toString(16)})},Yua=function(a){return(0,g.Fc)(a,function(b){return{key:b.id,
|
|
name:b.name}})},j6=function(a,b){return g.$a(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},k6=function(a,b){return g.$a(a,function(c){return f6(c,b)})},l6=function(a){try{var b=(0,g.ps)(),c=(0,g.os)();
|
|
b&&b.remove(a);c&&c.remove(a)}catch(d){}},Zua=function(){var a=(0,g.os)();
|
|
a&&Kua(a,a.o.If(!0))},m6=function(){var a=g.rs("yt-remote-connected-devices")||[];
|
|
g.tb(a);return a},$ua=function(a){if(g.db(a))return[];
|
|
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.Fc)(a,function(d,e){return 0==e?d:d.substring(c.length)})},ava=function(a){g.qs("yt-remote-connected-devices",a,86400)},o6=function(){if(n6)return n6;
|
|
var a=g.rs("yt-remote-device-id");a||(a=i6(),g.qs("yt-remote-device-id",a,31536E3));for(var b=m6(),c=1,d=a;g.cb(b,d);)c++,d=a+"#"+c;return n6=d},p6=function(){var a=m6(),b=o6();
|
|
g.cb(a,b);g.ts()&&g.wb(a,b);a=$ua(a);if(g.db(a))try{g.Hq("remote_sid")}catch(c){}else try{g.Fq("remote_sid",a.join(","),-1)}catch(c){}},bva=function(){return g.rs("yt-remote-session-browser-channel")},cva=function(){return g.rs("yt-remote-local-screens")||[]},dva=function(){g.qs("yt-remote-lounge-token-expiration",!0,86400)},eva=function(a){5<a.length&&(a=a.slice(a.length-5));
|
|
var b=(0,g.Fc)(cva(),function(d){return d.loungeToken}),c=(0,g.Fc)(a,function(d){return d.loungeToken});
|
|
(0,g.ui)(c,function(d){return!g.cb(b,d)})&&dva();
|
|
g.qs("yt-remote-local-screens",a,31536E3)},fva=function(a,b){g.qs("yt-remote-session-browser-channel",a);
|
|
g.qs("yt-remote-session-screen-id",b);var c=m6(),d=o6();g.cb(c,d)||c.push(d);ava(c);p6()},q6=function(a){a||(l6("yt-remote-session-screen-id"),l6("yt-remote-session-video-id"));
|
|
p6();a=m6();g.gb(a,o6());ava(a)},gva=function(){if(!r6){var a=g.ro();
|
|
a&&(r6=new g.$n(a))}return r6?!!r6.get("yt-remote-use-staging-server"):!1},hva=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},iva=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},s6=function(a){a.length?jva(a.shift(),function(){s6(a)}):t6()},kva=function(a){return"chrome-extension://"+a+"/cast_sender.js"},jva=function(a,b,c){var d=document.createElement("script");
|
|
d.onerror=b;c&&(d.onload=c);d.src=a;(document.head||document.documentElement).appendChild(d)},t6=function(){var a=iva();
|
|
a&&a(!1,"No cast extension found")},mva=function(){if(lva){var a=2,b=iva(),c=function(){a--;
|
|
0==a&&b&&b(!0)};
|
|
window.__onGCastApiAvailable=c;jva("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",t6,c)}},nva=function(){mva();
|
|
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);s6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},u6=function(){},ova=function(){},qva=function(a){return(a=pva(a))?new ActiveXObject(a):new XMLHttpRequest},pva=function(a){if(!a.u&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0",
|
|
"MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.u=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.u},v6=function(a,b,c){g.A.call(this);
|
|
this.w=null!=c?(0,g.x)(a,c):a;this.rd=b;this.u=(0,g.x)(this.hF,this);this.o=[]},w6=function(a){a.Da=g.Wf(a.u,a.rd);
|
|
a.w.apply(null,a.o)},x6=function(a,b,c,d){this.o=a;
|
|
this.w=b;this.G=c;this.F=d||1;this.B=45E3;this.A=new g.R1(this);this.u=new g.Vf;this.u.setInterval(250)},sva=function(a,b,c){a.Yi=1;
|
|
a.Dg=Z5(b.clone());a.ri=c;a.C=!0;rva(a,null)},y6=function(a,b,c,d,e){a.Yi=1;
|
|
a.Dg=Z5(b.clone());a.ri=null;a.C=c;e&&(a.RB=!1);rva(a,d)},rva=function(a,b){a.Hj=(0,g.H)();
|
|
z6(a);a.ph=a.Dg.clone();$5(a.ph,"t",a.F);a.om=0;a.Ic=a.o.Lq(a.o.cm()?b:null);0<a.yr&&(a.Xo=new v6((0,g.x)(a.QC,a,a.Ic),a.yr));a.A.ia(a.Ic,"readystatechange",a.fO);var c=a.Uh?g.Rb(a.Uh):{};a.ri?(a.Hp="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Ic.send(a.ph,a.Hp,a.ri,c)):(a.Hp="GET",a.RB&&!g.ke&&(c.Connection="close"),a.Ic.send(a.ph,a.Hp,null,c));a.o.Ve(1)},vva=function(a,b,c){for(var d=!0;!a.Gh&&a.om<c.length;){var e=tva(a,c);
|
|
if(e==A6){4==b&&(a.Rg=4,B6(15),d=!1);break}else if(e==uva){a.Rg=4;B6(16);d=!1;break}else C6(a,e)}4==b&&0==c.length&&(a.Rg=1,B6(17),d=!1);a.We=a.We&&d;d||(D6(a),E6(a))},tva=function(a,b){var c=a.om,d=b.indexOf("\n",c);
|
|
if(-1==d)return A6;c=Number(b.substring(c,d));if(isNaN(c))return uva;d+=1;if(d+c>b.length)return A6;var e=b.substr(d,c);a.om=d+c;return e},xva=function(a,b){a.Hj=(0,g.H)();
|
|
z6(a);var c=b?window.location.hostname:"";a.ph=a.Dg.clone();Y5(a.ph,"DOMAIN",c);Y5(a.ph,"t",a.F);try{a.af=new ActiveXObject("htmlfile")}catch(n){D6(a);a.Rg=7;B6(22);E6(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var k=c.charAt(f);if("<"==k)e+="\\x3c";else if(">"==k)e+="\\x3e";else{var l=k;if(l in F6)k=F6[l];else if(l in wva)k=F6[l]=wva[l];else{var m=l.charCodeAt(0);if(31<m&&127>m)k=l;else{if(256>m){if(k="\\x",16>m||256<m)k+="0"}else k="\\u",4096>m&&(k+="0");k+=m.toString(16).toUpperCase()}k=
|
|
F6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Zc(g.$b("b/12014412"),d+"</body></html>");a.af.open();a.af.write(g.Uc(c));a.af.close();a.af.parentWindow.m=(0,g.x)(a.yN,a);a.af.parentWindow.d=(0,g.x)(a.aB,a,!0);a.af.parentWindow.rpcClose=(0,g.x)(a.aB,a,!1);c=a.af.createElement("DIV");a.af.parentWindow.document.body.appendChild(c);d=g.zc(a.ph.toString());d=g.fd(g.wc(d));d=g.Zc(g.$b("b/12014412"),'<iframe src="'+d+'"></iframe>');g.$c(c,d);a.o.Ve(1)},z6=function(a){a.Lu=(0,g.H)()+a.B;
|
|
yva(a,a.B)},yva=function(a,b){if(null!=a.Vj)throw Error("WatchDog timer not null");
|
|
a.Vj=G6((0,g.x)(a.GN,a),b)},H6=function(a){a.Vj&&(g.v.clearTimeout(a.Vj),a.Vj=null)},E6=function(a){a.o.Dx()||a.Gh||a.o.Po(a)},D6=function(a){H6(a);
|
|
g.He(a.Xo);a.Xo=null;a.u.stop();g.Ipa(a.A);if(a.Ic){var b=a.Ic;a.Ic=null;b.abort();b.dispose()}a.af&&(a.af=null)},C6=function(a,b){try{a.o.UA(a,b),a.o.Ve(4)}catch(c){}},Ava=function(a,b,c,d,e){if(0==d)c(!1);
|
|
else{var f=e||0;d--;zva(a,b,function(k){k?c(!0):g.v.setTimeout(function(){Ava(a,b,c,d,f)},f)})}},zva=function(a,b,c){var d=new Image;
|
|
d.onload=function(){try{I6(d),c(!0)}catch(e){}};
|
|
d.onerror=function(){try{I6(d),c(!1)}catch(e){}};
|
|
d.onabort=function(){try{I6(d),c(!1)}catch(e){}};
|
|
d.ontimeout=function(){try{I6(d),c(!1)}catch(e){}};
|
|
g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
|
|
Nua(d,a)},I6=function(a){a.onload=null;
|
|
a.onerror=null;a.onabort=null;a.ontimeout=null},J6=function(){},Bva=function(a){this.o=a;
|
|
this.u=new J6},Cva=function(a){var b=K6(a.o,a.hk,"/mail/images/cleardot.gif");
|
|
Z5(b);Ava(b.toString(),5E3,(0,g.x)(a.cE,a),3,2E3);a.Ve(1)},M6=function(a){var b=a.o.H;
|
|
if(null!=b)B6(5),b?(B6(11),L6(a.o,a,!1)):(B6(12),L6(a.o,a,!0));else if(a.Pd=new x6(a,void 0,void 0,void 0),a.Pd.Uh=a.wr,b=a.o,b=K6(b,b.cm()?a.Ik:null,a.xr),B6(5),!g.ie||g.Nd(10))$5(b,"TYPE","xmlhttp"),y6(a.Pd,b,!1,a.Ik,!1);else{$5(b,"TYPE","html");var c=a.Pd;a=!!a.Ik;c.Yi=3;c.Dg=Z5(b.clone());xva(c,a)}},N6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return Oua(a)},O6=function(a){g.gf.call(this);
|
|
this.headers=new g.Pm;this.S=a||null;this.w=!1;this.O=this.o=null;this.da=this.H="";this.C=0;this.A="";this.B=this.Z=this.G=this.U=!1;this.F=0;this.J=null;this.ea="";this.P=this.V=!1},Dva=function(a){return g.ie&&g.Md(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},Eva=function(a){return"content-type"==a.toLowerCase()},Gva=function(a,b){a.w=!1;
|
|
a.o&&(a.B=!0,a.o.abort(),a.B=!1);a.A=b;a.C=5;Fva(a);P6(a)},Fva=function(a){a.U||(a.U=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},Iva=function(a){if(a.w&&"undefined"!=typeof g.W1)if(a.O[1]&&4==Q6(a)&&2==a.getStatus())R6(a,"Local request error detected and ignored");
|
|
else if(a.G&&4==Q6(a))g.Wf(a.Fx,0,a);else if(a.dispatchEvent("readystatechange"),4==Q6(a)){R6(a,"Request complete");a.w=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=g.pd(1,String(a.H));if(!f&&g.v.self&&g.v.self.location){var k=g.v.self.location.protocol;f=k.substr(0,k.length-1)}e=!Hva.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
|
|
else{a.C=6;try{var l=2<Q6(a)?a.o.statusText:""}catch(m){l=""}a.A=l+" ["+a.getStatus()+"]";Fva(a)}}finally{P6(a)}}},P6=function(a,b){if(a.o){Jva(a);
|
|
var c=a.o,d=a.O[0]?g.Ja:null;a.o=null;a.O=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},Jva=function(a){a.o&&a.P&&(a.o.ontimeout=null);
|
|
a.J&&(g.v.clearTimeout(a.J),a.J=null)},Q6=function(a){return a.o?a.o.readyState:0},S6=function(a){try{return a.o?a.o.responseText:""}catch(b){return""}},R6=function(a,b){return b+" ["+a.da+" "+a.H+" "+a.getStatus()+"]"},T6=function(a,b,c){this.o=1;
|
|
this.u=[];this.A=[];this.B=new J6;this.G=a||null;this.H=null!=b?b:null;this.C=c||!1},Kva=function(a,b){this.o=a;
|
|
this.map=b;this.context=null},Lva=function(a){g.Je.call(this,"statevent",a)},Mva=function(a,b){g.Je.call(this,"timingevent",a);
|
|
this.size=b},Nva=function(a){g.Je.call(this,"serverreachability",a)},Qva=function(a){Ova(a);
|
|
if(3==a.o){var b=a.Dl++,c=a.sn.clone();Y5(c,"SID",a.w);Y5(c,"RID",b);Y5(c,"TYPE","terminate");U6(a,c);b=new x6(a,a.w,b,void 0);b.Yi=2;b.Dg=Z5(c.clone());Nua(new Image,b.Dg.toString());b.Hj=(0,g.H)();z6(b)}Pva(a)},Rva=function(a){a.zE(1,0);
|
|
a.sn=K6(a,null,a.vr);V6(a)},Ova=function(a){a.Hg&&(a.Hg.abort(),a.Hg=null);
|
|
a.fc&&(a.fc.cancel(),a.fc=null);a.Kf&&(g.v.clearTimeout(a.Kf),a.Kf=null);W6(a);a.Kd&&(a.Kd.cancel(),a.Kd=null);a.Mg&&(g.v.clearTimeout(a.Mg),a.Mg=null)},Sva=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed");
|
|
a.u.push(new Kva(a.QJ++,b));2!=a.o&&3!=a.o||V6(a)},V6=function(a){a.Kd||a.Mg||(a.Mg=G6((0,g.x)(a.ZA,a),0),a.Si=0)},Uva=function(a,b){if(1==a.o){if(!b){a.Dl=Math.floor(1E5*Math.random());
|
|
var c=a.Dl++,d=new x6(a,"",c,void 0);d.Uh=null;var e=X6(a),f=a.sn.clone();Y5(f,"RID",c);Y5(f,"CVER","1");U6(a,f);sva(d,f,e);a.Kd=d;a.o=2}}else 3==a.o&&(b?Tva(a,b):0==a.u.length||a.Kd||Tva(a))},Tva=function(a,b){if(b)if(6<a.Hh){a.u=a.A.concat(a.u);
|
|
a.A.length=0;var c=a.Dl-1;var d=X6(a)}else c=b.G,d=b.ri;else c=a.Dl++,d=X6(a);var e=a.sn.clone();Y5(e,"SID",a.w);Y5(e,"RID",c);Y5(e,"AID",a.kj);U6(a,e);c=new x6(a,a.w,c,a.Si+1);c.Uh=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Kd=c;sva(c,e,d)},U6=function(a,b){if(a.nd){var c=a.nd.Yw();
|
|
c&&g.Bb(c,function(d,e){Y5(b,e,d)})}},X6=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b];
|
|
if(6<a.Hh&&0<b){var d=a.u[0].o;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.u[e].o,k=a.u[e].map;f=6>=a.Hh?e:f-d;try{g.Bb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.A=a.A.concat(a.u.splice(0,b));
|
|
return c.join("&")},Vva=function(a){a.fc||a.Kf||(a.F=1,a.Kf=G6((0,g.x)(a.YA,a),0),a.Li=0)},Y6=function(a){if(a.fc||a.Kf||3<=a.Li)return!1;
|
|
a.F++;a.Kf=G6((0,g.x)(a.YA,a),Wva(a,a.Li));a.Li++;return!0},L6=function(a,b,c){a.Fp=c;
|
|
a.kf=b.Wf;a.C||Rva(a)},W6=function(a){null!=a.Lh&&(g.v.clearTimeout(a.Lh),a.Lh=null)},Wva=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
|
|
a.isActive()||(c*=2);return c*b},Z6=function(a,b){if(2==b||9==b){var c=null;
|
|
a.nd&&(c=null);var d=(0,g.x)(a.TO,a);c||(c=new g.Sm("//www.google.com/images/cleardot.gif"),Z5(c));zva(c.toString(),1E4,d)}else B6(2);Xva(a,b)},Xva=function(a,b){a.o=0;
|
|
a.nd&&a.nd.lw(b);Pva(a);Ova(a)},Pva=function(a){a.o=0;
|
|
a.kf=-1;if(a.nd)if(0==a.A.length&&0==a.u.length)a.nd.Dq();else{g.kb(a.A);var b=g.kb(a.u);a.A.length=0;a.u.length=0;a.nd.Dq(b)}},K6=function(a,b,c){var d=g.$m(c);
|
|
if(""!=d.o)b&&g.Um(d,b+"."+d.o),g.Vm(d,d.B);else{var e=window.location;d=Rua(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.vk&&g.Bb(a.vk,function(f,k){Y5(d,k,f)});
|
|
Y5(d,"VER",a.Hh);U6(a,d);return d},G6=function(a,b){if(!g.Oa(a))throw Error("Fn must not be null and must be a function");
|
|
return g.v.setTimeout(function(){a()},b)},B6=function(a){$6.dispatchEvent(new Lva($6,a))},Yva=function(){},a7=function(a,b,c){g.A.call(this);
|
|
this.C=null!=c?(0,g.x)(a,c):a;this.rd=b;this.B=(0,g.x)(this.gF,this);this.o=!1;this.u=0;this.w=this.Da=null;this.A=[]},Zva=function(){this.o=[];
|
|
this.u=[]},$va=function(a,b){this.action=a;
|
|
this.params=b||{}},b7=function(a,b){g.A.call(this);
|
|
this.o=new g.I(this.pN,0,this);g.C(this,this.o);this.rd=5E3;this.u=0;if(g.Oa(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Oa(a.handleEvent))a=(0,g.x)(a.handleEvent,a);else throw Error("Invalid listener argument");this.w=a},c7=function(a,b,c){this.J=a;
|
|
this.C=b;this.w=new g.Zn;this.u=new b7(this.uO,this);this.o=null;this.ub=!1;this.B=null;this.H="";this.G=this.A=0;this.F=[];this.P=c||!1},awa=function(a){return{firstTestResults:[""],
|
|
secondTestResults:!a.o.Fp,sessionId:a.o.w,arrayId:a.o.kj}},bwa=function(a,b){a.G=b||0;
|
|
a.u.stop();a.o&&(3==a.o.o&&Uva(a.o),Qva(a.o));a.G=0},d7=function(a){return!!a.o&&3==a.o.o},cwa=function(a,b){(a.C.loungeIdToken=b)||a.u.stop()},e7=function(a){this.port=this.domain="";
|
|
this.o="/api/lounge";this.u=!0;a=a||document.location.href;var b=Number(g.pd(4,a))||"";b&&(this.port=":"+b);this.domain=g.qd(a)||"";a=g.Mc;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.sc(a,"10.0")&&(this.u=!1))},f7=function(a,b){var c=a.o;
|
|
a.u&&(c="https://"+a.domain+a.port+a.o);return g.Ad(c+b,{})},g7=function(a,b,c,d,e){a={format:"JSON",
|
|
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Sa(a.A,d,!0),onError:g.Sa(a.w,e),Md:g.Sa(a.B,e)};c&&(a.yb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.xq(b,a)},gwa=function(){var a=dwa;
|
|
ewa();h7.push(a);fwa(h7)},i7=function(a,b){ewa();
|
|
var c=h7,d=hwa(a,String(b));g.db(c)?iwa(d):(fwa(c),(0,g.y)(c,function(e){e(d)}))},ewa=function(){h7||(h7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ia("yt.mdx.remote.debug.handlers_",h7,void 0))},iwa=function(a){var b=(j7+1)%50;
|
|
j7=b;k7[b]=a;l7||(l7=49==b)},fwa=function(a){var b=k7;
|
|
if(b[0]){var c=j7,d=l7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.y)(a,function(f){f(e)})}while(d!=c);
|
|
k7=Array(50);j7=-1;l7=!1}},hwa=function(a,b){var c=((0,g.H)()-jwa)/1E3;
|
|
c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},m7=function(a){g.P.call(this);
|
|
this.F=a;this.o=[]},kwa=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
|
|
if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.o.push(b);return!0},lwa=function(a,b){var c=a.o.length!=b.length;
|
|
a.o=(0,g.ve)(a.o,function(f){return!!j6(b,f)});
|
|
for(var d=0,e=b.length;d<e;d++)c=kwa(a,b[d])||c;return c},mwa=function(a,b){var c=a.o.length;
|
|
a.o=(0,g.ve)(a.o,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
|
|
return a.o.length<c},n7=function(a,b,c,d){g.P.call(this);
|
|
this.C=a;this.A=b;this.B=c;this.w=d;this.u=0;this.o=null;this.Da=NaN},p7=function(a){m7.call(this,"LocalScreenService");
|
|
this.w=a;this.u=NaN;o7(this);this.info("Initializing with "+h6(this.o))},nwa=function(a){if(a.o.length){var b=(0,g.Fc)(a.o,function(d){return d.id}),c=f7(a.w,"/pairing/get_lounge_token_batch");
|
|
g7(a.w,c,{screen_ids:b.join(",")},(0,g.x)(a.rF,a),(0,g.x)(a.qF,a))}},o7=function(a){var b=Xua(cva());
|
|
b=(0,g.ve)(b,function(c){return!c.uuid});
|
|
return lwa(a,b)},q7=function(a,b){eva((0,g.Fc)(a.o,Vua));
|
|
b&&dva()},s7=function(a,b){g.P.call(this);
|
|
this.C=b;var c=g.rs("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.C(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.cb(c,l)}this.o=d;this.B=a;this.w=this.A=NaN;this.u=null;r7("Initialized with "+g.Mk(this.o))},owa=function(a,b,c){var d=f7(a.B,"/pairing/get_screen_availability");
|
|
g7(a.B,d,{lounge_token:b.token},(0,g.x)(function(e){e=e.screens||[];for(var f=0,k=e.length;f<k;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.x)(function(){c(!1)},a))},t7=function(a,b){a:if(a6(b)!=a6(a.o))var c=!1;
|
|
else{c=g.Ib(b);for(var d=0,e=c.length;d<e;++d)if(!a.o[c[d]]){c=!1;break a}c=!0}c||(r7("Updated online screens: "+g.Mk(a.o)),a.o=b,a.R("screenChange"));pwa(a)},u7=function(a){isNaN(a.w)||g.Mo(a.w);
|
|
a.w=g.Ko((0,g.x)(a.Yt,a),0<a.A&&a.A<(0,g.H)()?2E4:1E4)},r7=function(a){i7("OnlineScreenService",a)},qwa=function(a){var b={};
|
|
(0,g.y)(a.C(),function(c){c.token?b[c.token]=c.id:this.Sb("Requesting availability of screen w/o lounge token.")});
|
|
return b},pwa=function(a){a=g.Ib(g.Cb(a.o,function(b){return b}));
|
|
g.tb(a);a.length?g.qs("yt-remote-online-screen-ids",a.join(","),60):l6("yt-remote-online-screen-ids")},v7=function(a){m7.call(this,"ScreenService");
|
|
this.C=a;this.u=this.w=null;this.A=[];this.B={};rwa(this)},twa=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
|
|
c||(c=a.B[b]);var k=a.ae();if(k=(c?k6(k,c):null)||k6(k,b)){k.uuid=b;var l=w7(a,k);owa(a.u,l,function(m){e(m?l:null)})}else c?swa(a,c,(0,g.x)(function(m){var n=w7(this,new e6({name:d,
|
|
screenId:c,loungeToken:m,dialId:b||""}));owa(this.u,n,function(p){e(p?n:null)})},a),f):e(null)},uwa=function(a,b){for(var c=0,d=a.o.length;c<d;++c)if(a.o[c].name==b)return a.o[c];
|
|
return null},swa=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
|
|
var e={yb:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,k){var l=k&&k.screens||[];l[0]&&l[0].screenId==b?c(l[0].loungeToken):d(Error("Missing lounge token in token response"))},
|
|
onError:function(){d(Error("Request screen lounge token failed"))}};
|
|
g.xq(f7(a.C,"/pairing/get_lounge_token_batch"),e)},vwa=function(a){a.o=a.w.ae();
|
|
var b=a.B,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.o.length;b<d;++b){var e=a.o[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+h6(a.o))},rwa=function(a){x7(a);
|
|
a.w=new p7(a.C);a.w.subscribe("screenChange",(0,g.x)(a.zF,a));vwa(a);a.A=Xua(g.rs("yt-remote-automatic-screen-cache")||[]);x7(a);a.info("Initializing automatic screens: "+h6(a.A));a.u=new s7(a.C,(0,g.x)(a.ae,a,!0));a.u.subscribe("screenChange",(0,g.x)(function(){this.R("onlineScreenChange")},a))},w7=function(a,b){var c=a.get(b.id);
|
|
c?(c.uuid=b.uuid,b=c):((c=k6(a.A,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.A.push(b),g.qs("yt-remote-automatic-screen-cache",(0,g.Fc)(a.A,Vua)));x7(a);a.B[b.uuid]=b.id;g.qs("yt-remote-device-id-map",a.B,31536E3);return b},x7=function(a){a.B=g.rs("yt-remote-device-id-map")||{}},y7=function(a,b,c){g.P.call(this);
|
|
this.O=c;this.H=a;this.u=b;this.w=null},z7=function(a,b){i7(a.O,b)},A7=function(a,b){y7.call(this,a,b,"CastSession");
|
|
this.o=null;this.A=0;this.C=(0,g.x)(this.EP,this);this.B=(0,g.x)(this.ON,this);this.A=g.Ko((0,g.x)(function(){wwa(this,null)},this),12E4)},xwa=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Mk(void 0));
|
|
var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ja,(0,g.x)(function(){z7(this,"Failed to send message: getMdxSessionStatus.")},a)):z7(a,"Sending yt message without session: "+g.Mk(b))},wwa=function(a,b){g.Mo(a.A);
|
|
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.w||a.w.id!=b){var c=(0,g.x)(a.Ro,a),d=(0,g.x)(a.ge,a);a.tx(b,c,d,5)}}else a.ge(Error("Waiting for session status timed out."))},B7=function(a,b,c){y7.call(this,a,b,"DialSession");
|
|
this.A=this.G=null;this.J="";this.S=c;this.B=null;this.F=g.Ja;this.C=NaN;this.P=(0,g.x)(this.HP,this);this.o=g.Ja},ywa=function(a){a.o=a.H.WC(a.J,a.u.label,a.u.friendlyName,(0,g.x)(function(b){this.o=g.Ja;
|
|
this.Ro(b)},a),(0,g.x)(function(b){this.o=g.Ja;
|
|
this.ge(b)},a))},zwa=function(a){var b={};
|
|
b.pairingCode=a.J;b.theme=a.S;if(a.B){var c=a.B.currentTime||0;b.v=a.B.videoId;b.t=c}gva()&&(b.env_useStageMdx=1);return g.xd(b)},C7=function(a,b){y7.call(this,a,b,"ManualSession");
|
|
this.o=g.Ko((0,g.x)(this.lj,this,null),150)},D7=function(a,b,c,d){g.P.call(this);
|
|
this.u=a;this.F=b||"233637DE";this.C=c||"cl";this.G=d||!1;this.o=null;this.B=!1;this.w=[];this.A=(0,g.x)(this.wM,this)},Awa=function(a,b){return b?g.$a(a.w,function(c){return f6(b,c.label)},a):null},E7=function(a){i7("Controller",a)},dwa=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},F7=function(a){return a.B||!!a.w.length||!!a.o},G7=function(a,b,c){b!=a.o&&(g.He(a.o),(a.o=b)?(c?a.R("yt-remote-cast2-receiver-resumed",b.u):a.R("yt-remote-cast2-receiver-selected",
|
|
b.u),b.subscribe("sessionScreen",(0,g.x)(a.XA,a,b)),b.w?a.R("yt-remote-cast2-session-change",b.w):c&&a.o.lj(null)):a.R("yt-remote-cast2-session-change",null))},Bwa=function(a){var b=a.u.VC(),c=a.o&&a.o.u;
|
|
a=(0,g.Fc)(b,function(d){c&&f6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=Awa(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a);
|
|
c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},Hwa=function(a,b,c,d,e,f,k){Cwa()?Dwa(b,e,f,k)&&(I7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Ewa(a,c):(window.__onGCastApiAvailable=function(l,m){l?Ewa(a,c):(J7("Failed to load cast API: "+m),K7(!1),I7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Fwa(),c(!1))},d?g.Wo("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):
|
|
0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?nva():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?t6():(mva(),s6(Gwa.map(kva))))):H7("Cannot initialize because not running Chrome")},Fwa=function(){H7("dispose");
|
|
var a=L7();a&&a.dispose();g.Ia("yt.mdx.remote.cloudview.instance_",null,void 0);Iwa(!1);g.So(M7);M7.length=0},N7=function(){return!!g.rs("yt-remote-cast-installed")},Jwa=function(){var a=g.rs("yt-remote-cast-receiver");
|
|
return a?a.friendlyName:null},Kwa=function(){H7("clearCurrentReceiver");
|
|
l6("yt-remote-cast-receiver")},Lwa=function(){return N7()?L7()?L7().getCastSession():(J7("getCastSelector: Cast is not initialized."),null):(J7("getCastSelector: Cast API is not installed!"),null)},P7=function(){N7()?L7()?O7()?(H7("Requesting cast selector."),L7().requestSession()):(H7("Wait for cast API to be ready to request the session."),M7.push(g.Ro("yt-remote-cast2-api-ready",P7))):J7("requestCastSelector: Cast is not initialized."):J7("requestCastSelector: Cast API is not installed!")},Q7=
|
|
function(a,b){O7()?L7().setConnectedScreenStatus(a,b):J7("setConnectedScreenStatus called before ready.")},Cwa=function(){var a=0<=g.Mc.search(/ (CrMo|Chrome|CriOS)\//);
|
|
return g.Iv||a},Mwa=function(a,b){L7().init(a,b)},Dwa=function(a,b,c,d){var e=!1;
|
|
L7()||(a=new D7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.qs("yt-remote-cast-available",f);c6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){H7("onReceiverSelected: "+f.friendlyName);
|
|
g.qs("yt-remote-cast-receiver",f);c6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){H7("onReceiverResumed: "+f.friendlyName);
|
|
g.qs("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){H7("onSessionChange: "+g6(f));
|
|
f||l6("yt-remote-cast-receiver");c6("yt-remote-cast2-session-change",f)}),g.Ia("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
|
|
H7("cloudview.createSingleton_: "+e);return e},L7=function(){return g.w("yt.mdx.remote.cloudview.instance_")},Ewa=function(a,b){K7(!0);
|
|
I7(!1);Mwa(a,function(c){c?(Iwa(!0),g.To("yt-remote-cast2-api-ready")):(J7("Failed to initialize cast API."),K7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Fwa());b(c)})},H7=function(a){i7("cloudview",a)},J7=function(a){i7("cloudview",a)},K7=function(a){H7("setCastInstalled_ "+a);
|
|
g.qs("yt-remote-cast-installed",a)},O7=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},Iwa=function(a){H7("setApiReady_ "+a);
|
|
g.Ia("yt.mdx.remote.cloudview.apiReady_",a,void 0)},I7=function(a){g.Ia("yt.mdx.remote.cloudview.initializing_",a,void 0)},R7=function(a){this.index=-1;
|
|
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.F=0;this.o=null;this.hasNext=this.J=!1;this.H=this.G=this.u=this.A=0;this.w=NaN;this.B=!1;this.reset(a)},S7=function(a){a.audioTrackId=null;
|
|
a.o=null;a.playerState=-1;a.J=!1;a.hasNext=!1;a.F=0;a.C=(0,g.H)();a.A=0;a.u=0;a.G=0;a.H=0;a.w=NaN;a.B=!1},T7=function(a){return 1==a.playerState?((0,g.H)()-a.C)/1E3:0},U7=function(a,b){a.F=b;
|
|
a.C=(0,g.H)()},V7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.H)()-a.C)/1E3+a.F;
|
|
case -1E3:return 0}return a.F},W7=function(a,b,c){var d=a.videoId;
|
|
a.videoId=b;a.index=c;b!=d&&S7(a)},X7=function(a){var b={};
|
|
b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.Sb(a.o);b.hasPrevious=a.J;b.hasNext=a.hasNext;b.playerTime=a.F;b.playerTimeAt=a.C;b.seekableStart=a.A;b.seekableEnd=a.u;b.duration=a.G;b.loadedTime=a.H;b.liveIngestionTime=a.w;return b},Z7=function(a,b){g.P.call(this);
|
|
this.o=0;this.A=a;this.C=[];this.B=new Zva;this.w=this.u=null;this.H=(0,g.x)(this.xK,this);this.F=(0,g.x)(this.Fl,this);this.G=(0,g.x)(this.wK,this);this.J=(0,g.x)(this.IK,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.Ou,this),Nwa(this))):c=3;0!=c&&(b?this.Ou(c):g.Ko((0,g.x)(function(){this.Ou(c)},this),0));
|
|
var d=Lwa();d&&Y7(this,d);this.subscribe("yt-remote-cast2-session-change",this.J)},$7=function(a){return new R7(a.A.getPlayerContextData())},Nwa=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.C.push(this.A.subscribe(b,g.Sa(this.tM,b),this))},a)},Owa=function(a){(0,g.y)(a.C,function(b){this.A.unsubscribeByKey(b)},a);
|
|
a.C.length=0},a8=function(a,b){var c=a.B;
|
|
50>c.o.length+c.u.length&&a.B.u.push(b)},c8=function(a,b,c){var d=$7(a);
|
|
U7(d,c);-1E3!=d.playerState&&(d.playerState=b);b8(a,d)},d8=function(a,b,c){a.A.sendMessage(b,c)},b8=function(a,b){Owa(a);
|
|
a.A.setPlayerContextData(X7(b));Nwa(a)},Y7=function(a,b){a.w&&(a.w.removeUpdateListener(a.H),a.w.removeMediaListener(a.F),a.Fl(null));
|
|
a.w=b;a.w&&(i7("CP","Setting cast session: "+a.w.sessionId),a.w.addUpdateListener(a.H),a.w.addMediaListener(a.F),a.w.media.length&&a.Fl(a.w.media[0]))},Pwa=function(a){var b=a.u.media,c=a.u.customData;
|
|
if(b&&c){var d=$7(a);b.contentId!=d.videoId&&i7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;U7(d,a.u.getEstimatedTime());b8(a,d)}else i7("CP","No cast media video. Ignoring state update.")},e8=function(a,b,c){return(0,g.x)(function(d){this.Sb("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
|
|
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Sb("Retrying "+b+" using MDx browser channel."),d8(this,b,c))},a)},f8=function(a,b,c){g.P.call(this);
|
|
this.B=NaN;this.P=!1;this.G=this.F=this.H=this.J=NaN;this.O=[];this.A=this.C=this.w=this.Ta=this.o=null;this.U=a;this.O.push(g.yp(window,"beforeunload",(0,g.x)(this.jF,this)));this.u=[];this.Ta=new R7;this.S=b.id;this.o=Qwa(this,c);this.o.subscribe("handlerOpened",this.BK,this);this.o.subscribe("handlerClosed",this.yK,this);this.o.subscribe("handlerError",this.zK,this);this.o.subscribe("handlerMessage",this.AK,this);cwa(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Ta.videoId;
|
|
g.ts()&&g.qs("yt-remote-session-video-id",d)},this)},g8=function(a){i7("conn",a)},Qwa=function(a,b){return new c7(f7(a.U,"/bc"),b)},h8=function(a,b){a.R("proxyStateChange",b)},Rwa=function(a){a.B=g.Ko((0,g.x)(function(){g8("Connecting timeout");
|
|
this.Qi(1)},a),2E4)},i8=function(a){g.Mo(a.B);
|
|
a.B=NaN},j8=function(a){g.Mo(a.J);
|
|
a.J=NaN},Swa=function(a){k8(a);
|
|
a.H=g.Ko((0,g.x)(function(){l8(this,"getNowPlaying")},a),2E4)},k8=function(a){g.Mo(a.H);
|
|
a.H=NaN},Uwa=function(a,b){b&&(i8(a),j8(a));
|
|
b==(d7(a.o)&&isNaN(a.B))?b&&(h8(a,1),l8(a,"getSubtitlesTrack")):b?(a.rx()&&a.Ta.reset(),h8(a,1),l8(a,"getNowPlaying"),Twa(a)):a.Qi(1)},Vwa=function(a,b){var c=b.params.videoId;
|
|
delete b.params.videoId;c==a.Ta.videoId&&(g.Ob(b.params)?a.Ta.o=null:a.Ta.o=b.params,a.R("remotePlayerChange"))},Wwa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
|
|
a.Ta.listId=b.params.listId||a.Ta.listId;W7(a.Ta,c,d);a.R("remoteQueueChange")},Ywa=function(a,b){b.params=b.params||{};
|
|
Wwa(a,b);Xwa(a,b);a.R("autoplayDismissed")},Xwa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
|
|
U7(a.Ta,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Ta.playerState&&(c=-1E3);a.Ta.playerState=c;c=Number(b.params.loadedTime);a.Ta.H=isNaN(c)?0:c;c=Number(b.params.duration);a.Ta.G=isNaN(c)?0:c;c=a.Ta;var d=Number(b.params.liveIngestionTime);c.w=d;c.B=isNaN(d)?!1:!0;c=a.Ta;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.A=isNaN(d)?0:d;c.u=isNaN(e)?0:e;1==a.Ta.playerState?Swa(a):k8(a);a.R("remotePlayerChange")},Zwa=function(a,b){if(-1E3!=
|
|
a.Ta.playerState){var c=1085;
|
|
switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.Ta.playerState=c;c=parseInt(b.params.currentTime,10);U7(a.Ta,isNaN(c)?0:c);a.R("remotePlayerChange")}},$wa=function(a,b){var c="true"==b.params.muted;
|
|
a.Ta.volume=parseInt(b.params.volume,10);a.Ta.muted=c;a.R("remotePlayerChange")},axa=function(a,b){a.C=b.params.videoId;
|
|
a.R("nowAutoplaying",parseInt(b.params.timeout,10))},bxa=function(a,b){var c="true"==b.params.hasNext;
|
|
a.Ta.J="true"==b.params.hasPrevious;a.Ta.hasNext=c;a.R("previousNextChange")},Twa=function(a){g.Mo(a.G);
|
|
a.G=g.Ko((0,g.x)(a.Qi,a,1),864E5)},l8=function(a,b,c){c?g8("Sending: action="+b+", params="+g.Mk(c)):g8("Sending: action="+b);
|
|
a.o.sendMessage(b,c)},m8=function(a){m7.call(this,"ScreenServiceProxy");
|
|
this.qd=a;this.u=[];this.u.push(this.qd.$_s("screenChange",(0,g.x)(this.CP,this)));this.u.push(this.qd.$_s("onlineScreenChange",(0,g.x)(this.YL,this)))},gxa=function(a){var b={device:"Desktop",
|
|
app:"youtube-desktop"};b=g.L("MDX_CONFIG")||b;Zua();p6();n8||(n8=new e7(b?b.loungeApiHost:void 0),gva()&&(n8.o="/api/loungedev"));o8||(o8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ia("yt.mdx.remote.deferredProxies_",o8,void 0));cxa();var c=p8();if(!c){var d=new v7(n8);g.Ia("yt.mdx.remote.screenService_",d,void 0);c=p8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);Hwa(a,d,function(m){m?q8()&&Q7(q8(),"YouTube TV"):d.subscribe("onlineScreenChange",
|
|
function(){c6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Ia("yt.mdx.remote.initialized_",!0,void 0),r8("Initializing: "+g.Mk(b)),s8.push(g.Ro("yt-remote-cast2-availability-change",function(){c6("yt-remote-receiver-availability-change")})),s8.push(g.Ro("yt-remote-cast2-receiver-selected",function(){t8(null);
|
|
c6("yt-remote-auto-connect","cast-selector-receiver")})),s8.push(g.Ro("yt-remote-cast2-receiver-resumed",function(){c6("yt-remote-receiver-resumed","cast-selector-receiver")})),s8.push(g.Ro("yt-remote-cast2-session-change",dxa)),s8.push(g.Ro("yt-remote-connection-change",function(m){m?Q7(q8(),"YouTube TV"):u8()||(Q7(null,null),Kwa())})),a=v8(),b.isAuto&&(a.id+="#dial"),g.$o("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),r8(" -- with channel params: "+
|
|
g.Mk(a)),exa(a),c.start(),q8()||fxa())},ixa=function(){var a=hxa();
|
|
N7()&&g.rs("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},hxa=function(){var a=p8().qd.$_gos();
|
|
var b=w8();b&&x8()&&(j6(a,b)||a.push(b));return Yua(a)},y8=function(){var a=jxa();
|
|
!a&&N7()&&Jwa()&&(a={key:"cast-selector-receiver",name:Jwa()});return a},jxa=function(){var a=hxa(),b=w8();
|
|
b||(b=u8());return g.$a(a,function(c){return b&&f6(b,c.key)?!0:!1})},w8=function(){var a=q8();
|
|
if(!a)return null;var b=p8().ae();return k6(b,a)},dxa=function(a){r8("remote.onCastSessionChange_: "+g6(a));
|
|
if(a){var b=w8();b&&b.id==a.id?Q7(b.id,"YouTube TV"):(b&&z8(),A8(a,1))}else x8()&&z8()},z8=function(){O7()?L7().stopSession():J7("stopSession called before API ready.");
|
|
var a=x8();a&&(a.disconnect(1),B8(null))},C8=function(){var a=x8();
|
|
return!!a&&3!=a.getProxyState()},r8=function(a){i7("remote",a)},p8=function(){if(!D8){var a=g.w("yt.mdx.remote.screenService_");
|
|
D8=a?new m8(a):null}return D8},q8=function(){return g.w("yt.mdx.remote.currentScreenId_")},kxa=function(a){g.Ia("yt.mdx.remote.currentScreenId_",a,void 0)},lxa=function(){return g.w("yt.mdx.remote.connectData_")},t8=function(a){g.Ia("yt.mdx.remote.connectData_",a,void 0)},x8=function(){return g.w("yt.mdx.remote.connection_")},B8=function(a){var b=x8();
|
|
t8(null);a||kxa("");g.Ia("yt.mdx.remote.connection_",a,void 0);o8&&((0,g.y)(o8,function(c){c(a)}),o8.length=0);
|
|
b&&!a?c6("yt-remote-connection-change",!1):!b&&a&&c6("yt-remote-connection-change",!0)},u8=function(){var a=g.ts();
|
|
if(!a)return null;var b=p8().ae();return k6(b,a)},A8=function(a,b){q8();
|
|
w8()&&w8();if(E8)F8=a;else{kxa(a.id);var c=new f8(n8,a,v8());c.connect(b,lxa());c.subscribe("beforeDisconnect",function(d){c6("yt-remote-before-disconnect",d)});
|
|
c.subscribe("beforeDispose",function(){x8()&&(x8(),B8(null))});
|
|
B8(c)}},fxa=function(){var a=u8();
|
|
a?(r8("Resume connection to: "+g6(a)),A8(a,0)):(q6(),Kwa(),r8("Skipping connecting because no session screen found."))},cxa=function(){var a=v8();
|
|
if(g.Ob(a)){a=o6();var b=g.rs("yt-remote-session-name")||"",c=g.rs("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ia("yt.mdx.remote.channelParams_",a,void 0)}},v8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},exa=function(a){a?(g.qs("yt-remote-session-app",a.app),g.qs("yt-remote-session-name",a.name)):(l6("yt-remote-session-app"),l6("yt-remote-session-name"));
|
|
g.Ia("yt.mdx.remote.channelParams_",a,void 0)},G8=function(a,b,c){g.A.call(this);
|
|
this.B=a;this.u=b;this.w=new g.O(this);g.C(this,this.w);this.w.L(b,"onCaptionsTrackListChanged",this.uL);this.w.L(b,"captionschanged",this.vK);this.w.L(b,"captionssettingschanged",this.kC);this.w.L(b,"videoplayerreset",this.So);this.w.L(b,"mdxautoplaycancel",this.bE);this.S=this.w.L(b,"onVolumeChange",this.DA);this.G=!1;this.o=c;c.subscribe("proxyStateChange",this.TA,this);c.subscribe("remotePlayerChange",this.Kl,this);c.subscribe("remoteQueueChange",this.So,this);c.subscribe("autoplayUpNext",this.tA,
|
|
this);c.subscribe("previousNextChange",this.PA,this);c.subscribe("nowAutoplaying",this.LA,this);c.subscribe("autoplayDismissed",this.sA,this);this.suggestion=null;this.H=new g.qD(64);this.A=new g.I(this.iC,500,this);g.C(this,this.A);this.C=new g.I(this.jC,1E3,this);g.C(this,this.C);this.P=new a7(this.eP,0,this);g.C(this,this.P);this.F={};this.O=new g.I(this.IC,1E3,this);g.C(this,this.O);this.J=new v6(this.cI,1E3,this);g.C(this,this.J);this.U=g.Ja;this.kC();this.So();this.Kl()},H8=function(a,b){var c=
|
|
a.B,d=a.u.getVideoData().lengthSeconds;
|
|
c.O=b||0;c.player.R("progresssync",b,d)},mxa=function(a){H8(a,0);
|
|
a.A.stop();I8(a,new g.qD(64))},K8=function(a,b){if(J8(a)&&!a.G){var c=null;
|
|
b&&(c={style:a.u.getSubtitlesUserSettings()},g.Ub(c,b));a.o.XB(a.u.getVideoData(1).videoId,c);a.F=$7(a.o).o}},L8=function(a,b){var c=a.u.getPlaylist();
|
|
if(c){var d=c.o;var e=c.listId.toString()}c=a.u.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.mf,Lua(c));I8(a,new g.qD(1))},nxa=function(a,b){if(b){var c=a.u.getOption("captions","tracklist",{vT:1});
|
|
c&&c.length?(a.u.setOption("captions","track",b),a.G=!1):(a.u.loadModule("captions"),a.G=!0)}else a.u.setOption("captions","track",{})},J8=function(a){return $7(a.o).videoId==a.u.getVideoData(1).videoId},I8=function(a,b){a.C.stop();
|
|
var c=a.H;if(!g.wD(c,b)){var d=g.W(b,2);d!=g.W(a.H,2)&&g.vT(a.u.app,d);a.H=b;oxa(a.B,c,b)}},M8=function(){g.V.call(this,{D:"div",
|
|
I:"ytp-mdx-popup-dialog",M:{role:"dialog"},K:[{D:"div",I:"ytp-mdx-popup-dialog-inner-content",K:[{D:"div",I:"ytp-mdx-popup-title",W:"Vous \u00eates d\u00e9connect\u00e9"},{D:"div",I:"ytp-mdx-popup-description",W:"Les vid\u00e9os que vous visionnez peuvent \u00eatre ajout\u00e9es \u00e0 l'historique des vid\u00e9os regard\u00e9es sur votre t\u00e9l\u00e9viseur et avoir une influence sur les recommandations qui vous sont faites. Pour \u00e9viter ce probl\u00e8me, annulez et connectez-vous \u00e0 YouTube sur un ordinateur."},
|
|
{D:"div",I:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-cancel"],W:"Annuler"},{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-confirm"],W:"Confirmer"}]}]}]});this.u=new g.BM(this,250);g.C(this,this.u);this.C=this.o["ytp-mdx-privacy-popup-cancel"];this.L(this.C,"click",this.w);this.A=this.o["ytp-mdx-privacy-popup-confirm"];this.L(this.A,"click",this.B)},N8=function(a){g.V.call(this,{D:"div",
|
|
I:"ytp-remote",K:[{D:"div",I:"ytp-remote-display-status",K:[{D:"div",I:"ytp-remote-display-status-icon",K:[g.DM()]},{D:"div",I:"ytp-remote-display-status-text",W:"{{statustext}}"}]}]});this.u=new g.BM(this,250);g.C(this,this.u);this.w=a;this.L(a,"presentingplayerstatechange",this.A);pxa(this,g.zL(a))},pxa=function(a,b){if(3==a.w.getPresentingPlayerType()){var c={RECEIVER_NAME:a.w.getOption("remote","currentReceiver").name};
|
|
c=g.W(b,128)?g.gN("Erreur sur $RECEIVER_NAME",c):g.xD(b)||g.W(b,4)?g.gN("Lecture sur $RECEIVER_NAME",c):g.gN("Connect\u00e9 \u00e0 $RECEIVER_NAME",c);a.ha("statustext",c);a.u.show()}else a.u.hide()},O8=function(a,b){g.$O.call(this,"Lire sur",0,a,b);
|
|
this.u=a;this.C={};this.L(a,"onMdxReceiversChange",this.J);this.L(a,"presentingplayerstatechange",this.J);this.J()},P8=function(a){g.gM.call(this,a);
|
|
this.u={key:i6(),name:"Cet ordinateur"};this.B=null;this.A=[];this.S=this.o=null;this.J=[this.u];this.w=this.u;this.F=new g.qD(64);this.O=0;this.H=-1;this.C=null;if(!g.Kx(this.player.N())){a=this.player;var b=g.XC(a);b&&(b=b.ul())&&(b=new O8(a,b),g.C(this,b));b=new N8(a);g.C(this,b);g.RL(a,b.element,4);this.C=new M8;g.C(this,this.C);g.RL(a,this.C.element,4);this.P=!!u8()}this.G=null},Q8=function(a){a.G&&(a.player.removeEventListener("presentingplayerstatechange",a.G),a.G=null)},oxa=function(a,b,c){a.F=
|
|
c;
|
|
a.player.R("presentingplayerstatechange",new g.CD(c,b))},R8=function(a,b){if(b.key!=a.w.key)if(b.key==a.u.key)z8();
|
|
else{var c;(c=!g.Q(a.player.N().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.L("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.L("SESSION_INDEX")&&!g.L("LOGGED_IN")))||a.P||!a.C);if(c?0:g.Tx(a.player.N())||g.Xx(a.player.N()))g.xD(g.zL(a.player))?a.player.pauseVideo():(a.G=(0,g.x)(a.TN,a),a.player.addEventListener("presentingplayerstatechange",a.G)),a.C&&a.C.u.show(),x8()||(E8=!0);a.w=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);var e=c.videoId;if(!d&&!e||(2==
|
|
a.player.app.U||1==a.player.app.U)&&g.Q(a.player.N().experiments,"should_clear_video_data_on_player_cued_unstarted"))c=null;else{var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.w;l++)k[l]=f.wa(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.mf,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=Lua(c))&&(d.locationInfo=c);c=d}r8("Connecting to: "+g.Mk(b));"cast-selector-receiver"==
|
|
b.key?(t8(c||null),c=c||null,O7()?L7().setLaunchParams(c):J7("setLaunchParams called before ready.")):!c&&C8()&&q8()==b.key?c6("yt-remote-connection-change",!0):(z8(),t8(c||null),c=p8().ae(),(c=k6(c,b.key))&&A8(c,1))}},wva={"\x00":"\\0",
|
|
"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},F6={"'":"\\'"},qxa={},Uua={fQ:"atp",JS:"ska",yS:"que",SR:"mus",IS:"sus",eR:"dsp",FS:"seq"};
|
|
d6.prototype.Ig=function(){var a=new d6({id:this.id,name:this.name,app:this.app,type:this.type,user:this.username,userAvatarUri:this.avatar,obfuscatedGaiaId:this.obfuscatedGaiaId,theme:this.theme,capabilities:Array.from(this.capabilities.values()).join(","),experiments:Array.from(this.experiments.values()).join(",")});a.w=this.w;a.u=this.u;a.o=this.o};
|
|
var r6,n6="",lva=hva("loadCastFramework")||hva("loadCastApplicationFramework"),Gwa=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];u6.prototype.o=null;u6.prototype.getOptions=function(){var a;(a=this.o)||(a={},pva(this)&&(a[0]=!0,a[1]=!0),a=this.o=a);return a};var S8;g.Ua(ova,u6);S8=new ova;/*
|
|
|
|
Copyright The Closure Library Authors.
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
g.Ua(v6,g.A);g.h=v6.prototype;g.h.Xi=!1;g.h.Hk=0;g.h.Da=null;g.h.Cx=function(a){this.o=arguments;this.Da||this.Hk?this.Xi=!0:w6(this)};
|
|
g.h.stop=function(){this.Da&&(g.v.clearTimeout(this.Da),this.Da=null,this.Xi=!1,this.o=[])};
|
|
g.h.pause=function(){this.Hk++};
|
|
g.h.resume=function(){this.Hk--;this.Hk||!this.Xi||this.Da||(this.Xi=!1,w6(this))};
|
|
g.h.Y=function(){v6.Fb.Y.call(this);this.stop()};
|
|
g.h.hF=function(){this.Da=null;this.Xi&&!this.Hk&&(this.Xi=!1,w6(this))};g.h=x6.prototype;g.h.Uh=null;g.h.We=!1;g.h.Vj=null;g.h.Lu=null;g.h.Hj=null;g.h.Yi=null;g.h.Dg=null;g.h.ph=null;g.h.ri=null;g.h.Ic=null;g.h.om=0;g.h.af=null;g.h.Hp=null;g.h.Rg=null;g.h.Jk=-1;g.h.RB=!0;g.h.Gh=!1;g.h.yr=0;g.h.Xo=null;var uva={},A6={};g.h=x6.prototype;g.h.setTimeout=function(a){this.B=a};
|
|
g.h.fO=function(a){a=a.target;var b=this.Xo;b&&3==Q6(a)?b.Cx():this.QC(a)};
|
|
g.h.QC=function(a){try{if(a==this.Ic)a:{var b=Q6(this.Ic),c=this.Ic.C,d=this.Ic.getStatus();if(g.ie&&!g.Nd(10)||g.ke&&!g.Md("420+")){if(4>b)break a}else if(3>b||3==b&&!g.yh&&!S6(this.Ic))break a;this.Gh||4!=b||7==c||(8==c||0>=d?this.o.Ve(3):this.o.Ve(2));H6(this);var e=this.Ic.getStatus();this.Jk=e;var f=S6(this.Ic);(this.We=200==e)?(4==b&&D6(this),this.C?(vva(this,b,f),g.yh&&this.We&&3==b&&(this.A.ia(this.u,"tick",this.ZN),this.u.start())):C6(this,f),this.We&&!this.Gh&&(4==b?this.o.Po(this):(this.We=
|
|
!1,z6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Rg=3,B6(13)):(this.Rg=0,B6(14)),D6(this),E6(this))}}catch(k){this.Ic&&S6(this.Ic)}finally{}};
|
|
g.h.ZN=function(){var a=Q6(this.Ic),b=S6(this.Ic);this.om<b.length&&(H6(this),vva(this,a,b),this.We&&4!=a&&z6(this))};
|
|
g.h.yN=function(a){G6((0,g.x)(this.xN,this,a),0)};
|
|
g.h.xN=function(a){this.Gh||(H6(this),C6(this,a),z6(this))};
|
|
g.h.aB=function(a){G6((0,g.x)(this.wN,this,a),0)};
|
|
g.h.wN=function(a){this.Gh||(D6(this),this.We=a,this.o.Po(this),this.o.Ve(4))};
|
|
g.h.cancel=function(){this.Gh=!0;D6(this)};
|
|
g.h.GN=function(){this.Vj=null;var a=(0,g.H)();0<=a-this.Lu?(2!=this.Yi&&this.o.Ve(3),D6(this),this.Rg=2,B6(18),E6(this)):yva(this,this.Lu-a)};
|
|
g.h.getLastError=function(){return this.Rg};J6.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)};
|
|
J6.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};g.h=Bva.prototype;g.h.wr=null;g.h.Pd=null;g.h.Yo=!1;g.h.Ex=null;g.h.on=null;g.h.gs=null;g.h.xr=null;g.h.xe=null;g.h.Wf=-1;g.h.Ik=null;g.h.hk=null;g.h.connect=function(a){this.xr=a;a=K6(this.o,null,this.xr);B6(3);this.Ex=(0,g.H)();var b=this.o.G;null!=b?(this.Ik=b[0],(this.hk=b[1])?(this.xe=1,Cva(this)):(this.xe=2,M6(this))):($5(a,"MODE","init"),this.Pd=new x6(this,void 0,void 0,void 0),this.Pd.Uh=this.wr,y6(this.Pd,a,!1,null,!0),this.xe=0)};
|
|
g.h.cE=function(a){if(a)this.xe=2,M6(this);else{B6(4);var b=this.o;b.kf=b.Hg.Wf;Z6(b,9)}a&&this.Ve(2)};
|
|
g.h.Lq=function(a){return this.o.Lq(a)};
|
|
g.h.abort=function(){this.Pd&&(this.Pd.cancel(),this.Pd=null);this.Wf=-1};
|
|
g.h.Dx=function(){return!1};
|
|
g.h.UA=function(a,b){this.Wf=a.Jk;if(0==this.xe)if(b){try{var c=this.u.parse(b)}catch(d){c=this.o;c.kf=this.Wf;Z6(c,2);return}this.Ik=c[0];this.hk=c[1]}else c=this.o,c.kf=this.Wf,Z6(c,2);else if(2==this.xe)if(this.Yo)B6(7),this.gs=(0,g.H)();else if("11111"==b){if(B6(6),this.Yo=!0,this.on=(0,g.H)(),c=this.on-this.Ex,!g.ie||g.Nd(10)||500>c)this.Wf=200,this.Pd.cancel(),B6(12),L6(this.o,this,!0)}else B6(8),this.on=this.gs=(0,g.H)(),this.Yo=!1};
|
|
g.h.Po=function(){this.Wf=this.Pd.Jk;if(this.Pd.We)0==this.xe?this.hk?(this.xe=1,Cva(this)):(this.xe=2,M6(this)):2==this.xe&&((!g.ie||g.Nd(10)?!this.Yo:200>this.gs-this.on)?(B6(11),L6(this.o,this,!1)):(B6(12),L6(this.o,this,!0)));else{0==this.xe?B6(9):2==this.xe&&B6(10);var a=this.o;this.Pd.getLastError();a.kf=this.Wf;Z6(a,2)}};
|
|
g.h.cm=function(){return this.o.cm()};
|
|
g.h.isActive=function(){return this.o.isActive()};
|
|
g.h.Ve=function(a){this.o.Ve(a)};g.Ua(O6,g.gf);var Hva=/^https?$/i,rxa=["POST","PUT"];g.h=O6.prototype;
|
|
g.h.send=function(a,b,c,d){if(this.o)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+a);b=b?b.toUpperCase():"GET";this.H=a;this.A="";this.C=0;this.da=b;this.U=!1;this.w=!0;this.o=this.S?qva(this.S):qva(S8);this.O=this.S?this.S.getOptions():S8.getOptions();this.o.onreadystatechange=(0,g.x)(this.Fx,this);try{b6(R6(this,"Opening Xhr")),this.Z=!0,this.o.open(b,String(a),!0),this.Z=!1}catch(f){b6(R6(this,"Error opening Xhr: "+f.message));Gva(this,f);return}a=c||
|
|
"";var e=this.headers.clone();d&&Qua(d,function(f,k){e.set(k,f)});
|
|
d=g.$a(e.se(),Eva);c=g.v.FormData&&a instanceof g.v.FormData;!g.cb(rxa,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,k){this.o.setRequestHeader(k,f)},this);
|
|
this.ea&&(this.o.responseType=this.ea);"withCredentials"in this.o&&this.o.withCredentials!==this.V&&(this.o.withCredentials=this.V);try{Jva(this),0<this.F&&(this.P=Dva(this.o),b6(R6(this,"Will abort after "+this.F+"ms if incomplete, xhr2 "+this.P)),this.P?(this.o.timeout=this.F,this.o.ontimeout=(0,g.x)(this.Gx,this)):this.J=g.Wf(this.Gx,this.F,this)),b6(R6(this,"Sending request")),this.G=!0,this.o.send(a),this.G=!1}catch(f){b6(R6(this,"Send error: "+f.message)),Gva(this,f)}};
|
|
g.h.Gx=function(){"undefined"!=typeof g.W1&&this.o&&(this.A="Timed out after "+this.F+"ms, aborting",this.C=8,R6(this,this.A),this.dispatchEvent("timeout"),this.abort(8))};
|
|
g.h.abort=function(a){this.o&&this.w&&(R6(this,"Aborting"),this.w=!1,this.B=!0,this.o.abort(),this.B=!1,this.C=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),P6(this))};
|
|
g.h.Y=function(){this.o&&(this.w&&(this.w=!1,this.B=!0,this.o.abort(),this.B=!1),P6(this,!0));O6.Fb.Y.call(this)};
|
|
g.h.Fx=function(){this.la()||(this.Z||this.G||this.B?Iva(this):this.vM())};
|
|
g.h.vM=function(){Iva(this)};
|
|
g.h.isActive=function(){return!!this.o};
|
|
g.h.getStatus=function(){try{return 2<Q6(this)?this.o.status:-1}catch(a){return-1}};
|
|
g.h.getLastError=function(){return"string"===typeof this.A?this.A:String(this.A)};g.h=T6.prototype;g.h.vk=null;g.h.Kd=null;g.h.fc=null;g.h.vr=null;g.h.sn=null;g.h.Xv=null;g.h.Hn=null;g.h.Dl=0;g.h.QJ=0;g.h.nd=null;g.h.Mg=null;g.h.Kf=null;g.h.Lh=null;g.h.Hg=null;g.h.Fp=null;g.h.kj=-1;g.h.py=-1;g.h.kf=-1;g.h.Si=0;g.h.Li=0;g.h.Hh=8;var $6=new g.gf;g.Ua(Lva,g.Je);g.Ua(Mva,g.Je);g.Ua(Nva,g.Je);g.h=T6.prototype;g.h.connect=function(a,b,c,d,e){B6(0);this.vr=b;this.vk=c||{};d&&void 0!==e&&(this.vk.OSID=d,this.vk.OAID=e);this.C?(G6((0,g.x)(this.tw,this,a),100),Rva(this)):this.tw(a)};
|
|
g.h.tw=function(a){this.Hg=new Bva(this);this.Hg.wr=null;this.Hg.u=this.B;this.Hg.connect(a)};
|
|
g.h.Dx=function(){return 0==this.o};
|
|
g.h.ZA=function(a){this.Mg=null;Uva(this,a)};
|
|
g.h.YA=function(){this.Kf=null;this.fc=new x6(this,this.w,"rpc",this.F);this.fc.Uh=null;this.fc.yr=0;var a=this.Xv.clone();Y5(a,"RID","rpc");Y5(a,"SID",this.w);Y5(a,"CI",this.Fp?"0":"1");Y5(a,"AID",this.kj);U6(this,a);if(!g.ie||g.Nd(10))Y5(a,"TYPE","xmlhttp"),y6(this.fc,a,!0,this.Hn,!1);else{Y5(a,"TYPE","html");var b=this.fc,c=!!this.Hn;b.Yi=3;b.Dg=Z5(a.clone());xva(b,c)}};
|
|
g.h.UA=function(a,b){if(0!=this.o&&(this.fc==a||this.Kd==a))if(this.kf=a.Jk,this.Kd==a&&3==this.o)if(7<this.Hh){try{var c=this.B.parse(b)}catch(f){c=null}if(Array.isArray(c)&&3==c.length)if(0==c[0])a:{if(!this.Kf){if(this.fc)if(this.fc.Hj+3E3<this.Kd.Hj)W6(this),this.fc.cancel(),this.fc=null;else break a;Y6(this);B6(19)}}else this.py=c[1],0<this.py-this.kj&&37500>c[2]&&this.Fp&&0==this.Li&&!this.Lh&&(this.Lh=G6((0,g.x)(this.rK,this),6E3));else Z6(this,11)}else b!=qxa.CQ.o&&Z6(this,11);else if(this.fc==
|
|
a&&W6(this),!g.hc(b)){c=this.B.parse(b);for(var d=0;d<c.length;d++){var e=c[d];this.kj=e[0];e=e[1];2==this.o?"c"==e[0]?(this.w=e[1],this.Hn=e[2],e=e[3],null!=e?this.Hh=e:this.Hh=6,this.o=3,this.nd&&this.nd.nw(),this.Xv=K6(this,this.cm()?this.Hn:null,this.vr),Vva(this)):"stop"==e[0]&&Z6(this,7):3==this.o&&("stop"==e[0]?Z6(this,7):"noop"!=e[0]&&this.nd&&this.nd.mw(e),this.Li=0)}}};
|
|
g.h.rK=function(){null!=this.Lh&&(this.Lh=null,this.fc.cancel(),this.fc=null,Y6(this),B6(20))};
|
|
g.h.Po=function(a){if(this.fc==a){W6(this);this.fc=null;var b=2}else if(this.Kd==a)this.Kd=null,b=1;else return;this.kf=a.Jk;if(0!=this.o)if(a.We)1==b?(b=(0,g.H)()-a.Hj,$6.dispatchEvent(new Mva($6,a.ri?a.ri.length:0,b,this.Si)),V6(this),this.A.length=0):Vva(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.kf)){if(d=1==b)this.Kd||this.Mg||1==this.o||2<=this.Si?d=!1:(this.Mg=G6((0,g.x)(this.ZA,this,a),Wva(this,this.Si)),this.Si++,d=!0);d=!(d||2==b&&Y6(this))}if(d)switch(c){case 1:Z6(this,
|
|
5);break;case 4:Z6(this,10);break;case 3:Z6(this,6);break;case 7:Z6(this,12);break;default:Z6(this,2)}}};
|
|
g.h.zE=function(a){if(!g.cb(arguments,this.o))throw Error("Unexpected channel state: "+this.o);};
|
|
g.h.TO=function(a){a?B6(2):(B6(1),Xva(this,8))};
|
|
g.h.Lq=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new O6;a.V=!1;return a};
|
|
g.h.isActive=function(){return!!this.nd&&this.nd.isActive(this)};
|
|
g.h.Ve=function(a){$6.dispatchEvent(new Nva($6,a))};
|
|
g.h.cm=function(){return!(!g.ie||g.Nd(10))};
|
|
g.h=Yva.prototype;g.h.nw=function(){};
|
|
g.h.mw=function(){};
|
|
g.h.lw=function(){};
|
|
g.h.Dq=function(){};
|
|
g.h.Yw=function(){return{}};
|
|
g.h.isActive=function(){return!0};g.Ua(a7,g.A);g.h=a7.prototype;g.h.fF=function(a){this.A=arguments;this.o=!1;this.Da?this.w=(0,g.H)()+this.rd:this.Da=g.Wf(this.B,this.rd)};
|
|
g.h.stop=function(){this.Da&&(g.v.clearTimeout(this.Da),this.Da=null);this.w=null;this.o=!1;this.A=[]};
|
|
g.h.pause=function(){++this.u};
|
|
g.h.resume=function(){this.u&&(--this.u,!this.u&&this.o&&(this.o=!1,this.C.apply(null,this.A)))};
|
|
g.h.Y=function(){this.stop();a7.Fb.Y.call(this)};
|
|
g.h.gF=function(){this.w?(this.Da=g.Wf(this.B,this.w-(0,g.H)()),this.w=null):(this.Da=null,this.u?this.o=!0:(this.o=!1,this.C.apply(null,this.A)))};g.h=Zva.prototype;g.h.isEmpty=function(){return g.db(this.o)&&g.db(this.u)};
|
|
g.h.clear=function(){this.o=[];this.u=[]};
|
|
g.h.contains=function(a){return g.cb(this.o,a)||g.cb(this.u,a)};
|
|
g.h.remove=function(a){var b=this.o;var c=(0,g.Npa)(b,a);0<=c?(g.fb(b,c),b=!0):b=!1;return b||g.gb(this.u,a)};
|
|
g.h.Bd=function(){for(var a=[],b=this.o.length-1;0<=b;--b)a.push(this.o[b]);var c=this.u.length;for(b=0;b<c;++b)a.push(this.u[b]);return a};g.Ua(b7,g.A);g.h=b7.prototype;g.h.pN=function(){this.rd=Math.min(3E5,2*this.rd);this.w();this.u&&this.start()};
|
|
g.h.start=function(){var a=this.rd+15E3*Math.random();g.Bn(this.o,a);this.u=(0,g.H)()+a};
|
|
g.h.stop=function(){this.o.stop();this.u=0};
|
|
g.h.isActive=function(){return this.o.isActive()};
|
|
g.h.reset=function(){this.o.stop();this.rd=5E3};g.Ua(c7,Yva);g.h=c7.prototype;g.h.subscribe=function(a,b,c){return this.w.subscribe(a,b,c)};
|
|
g.h.unsubscribe=function(a,b,c){return this.w.unsubscribe(a,b,c)};
|
|
g.h.pg=function(a){return this.w.Vh(a)};
|
|
g.h.R=function(a,b){return this.w.R.apply(this.w,arguments)};
|
|
g.h.dispose=function(){this.ub||(this.ub=!0,g.He(this.w),bwa(this),g.He(this.u),this.u=null)};
|
|
g.h.la=function(){return this.ub};
|
|
g.h.connect=function(a,b,c){if(!this.o||2!=this.o.o){this.H="";this.u.stop();this.B=a||null;this.A=b||0;a=this.J+"/test";b=this.J+"/bind";var d=new T6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.P),e=this.o;e&&(e.nd=null);d.nd=this;this.o=d;e?this.o.connect(a,b,this.C,e.w,e.kj):c?this.o.connect(a,b,this.C,c.sessionId,c.arrayId):this.o.connect(a,b,this.C)}};
|
|
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.Ub(c,b);this.u.isActive()||2==(this.o?this.o.o:0)?this.F.push(c):d7(this)&&Sva(this.o,c)};
|
|
g.h.nw=function(){this.u.reset();this.B=null;this.A=0;if(this.F.length){var a=this.F;this.F=[];for(var b=0,c=a.length;b<c;++b)Sva(this.o,a[b])}this.R("handlerOpened")};
|
|
g.h.lw=function(a){var b=2==a&&401==this.o.kf;4==a||b||this.u.start();this.R("handlerError",a)};
|
|
g.h.Dq=function(a){if(!this.u.isActive())this.R("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.F.push(d)}};
|
|
g.h.Yw=function(){var a={v:2};this.H&&(a.gsessionid=this.H);0!=this.A&&(a.ui=""+this.A);0!=this.G&&(a.ui=""+this.G);this.B&&g.Ub(a,this.B);return a};
|
|
g.h.mw=function(a){"S"==a[0]?this.H=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),Qva(this.o)):this.R("handlerMessage",new $va(a[0],a[1]))};
|
|
g.h.uO=function(){this.u.isActive();var a=this.o,b=0;a.fc&&b++;a.Kd&&b++;0==b&&this.connect(this.B,this.A)};e7.prototype.A=function(a,b,c,d){b?a(d):a({text:c.responseText})};
|
|
e7.prototype.w=function(a,b){a(Error("Request error: "+b.status))};
|
|
e7.prototype.B=function(a){a(Error("request timed out"))};var jwa=(0,g.H)(),h7=null,k7=Array(50),j7=-1,l7=!1;g.Ua(m7,g.P);m7.prototype.ae=function(){return this.o};
|
|
m7.prototype.contains=function(a){return!!j6(this.o,a)};
|
|
m7.prototype.get=function(a){return a?k6(this.o,a):null};
|
|
m7.prototype.info=function(a){i7(this.F,a)};g.r(n7,g.P);g.h=n7.prototype;g.h.start=function(){!this.o&&isNaN(this.Da)&&this.UC()};
|
|
g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Da)||(g.Mo(this.Da),this.Da=NaN)};
|
|
g.h.Y=function(){this.stop();g.P.prototype.Y.call(this)};
|
|
g.h.UC=function(){this.Da=NaN;this.o=g.xq(f7(this.C,"/pairing/get_screen"),{method:"POST",yb:{pairing_code:this.A},timeout:5E3,onSuccess:(0,g.x)(this.AP,this),onError:(0,g.x)(this.zP,this),Md:(0,g.x)(this.BP,this)})};
|
|
g.h.AP=function(a,b){this.o=null;var c=b.screen||{};c.dialId=this.B;c.name=this.w;this.R("pairingComplete",new e6(c))};
|
|
g.h.zP=function(a){this.o=null;a.status&&404==a.status?this.u>=sxa.length?this.R("pairingFailed",Error("DIAL polling timed out")):(a=sxa[this.u],this.Da=g.Ko((0,g.x)(this.UC,this),a),this.u++):this.R("pairingFailed",Error("Server error "+a.status))};
|
|
g.h.BP=function(){this.o=null;this.R("pairingFailed",Error("Server not responding"))};
|
|
var sxa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ua(p7,m7);g.h=p7.prototype;g.h.start=function(){o7(this)&&this.R("screenChange");!g.rs("yt-remote-lounge-token-expiration")&&nwa(this);g.Mo(this.u);this.u=g.Ko((0,g.x)(this.start,this),1E4)};
|
|
g.h.add=function(a,b){o7(this);kwa(this,a);q7(this,!1);this.R("screenChange");b(a);a.token||nwa(this)};
|
|
g.h.remove=function(a,b){var c=o7(this);mwa(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.R("screenChange")};
|
|
g.h.Dp=function(a,b,c,d){var e=o7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,q7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.R("screenChange")};
|
|
g.h.Y=function(){g.Mo(this.u);p7.Fb.Y.call(this)};
|
|
g.h.rF=function(a){o7(this);var b=this.o.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}q7(this,!b);b&&i7(this.F,"Missed "+b+" lounge tokens.")};
|
|
g.h.qF=function(a){i7(this.F,"Requesting lounge tokens failed: "+a)};g.r(s7,g.P);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.rs("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.H)()-144E5<a?0:a)?u7(this):(this.A=(0,g.H)()+3E5,g.qs("yt-remote-fast-check-period",this.A),this.Yt())};
|
|
g.h.isEmpty=function(){return g.Ob(this.o)};
|
|
g.h.update=function(){r7("Updating availability on schedule.");var a=this.C(),b=g.Cb(this.o,function(c,d){return c&&!!k6(a,d)},this);
|
|
t7(this,b)};
|
|
g.h.Y=function(){g.Mo(this.w);this.w=NaN;this.u&&(this.u.abort(),this.u=null);g.P.prototype.Y.call(this)};
|
|
g.h.Yt=function(){g.Mo(this.w);this.w=NaN;this.u&&this.u.abort();var a=qwa(this);if(a6(a)){var b=f7(this.B,"/pairing/get_screen_availability");this.u=g7(this.B,b,{lounge_token:g.Ib(a).join(",")},(0,g.x)(this.TM,this,a),(0,g.x)(this.SM,this))}else t7(this,{}),u7(this)};
|
|
g.h.TM=function(a,b){this.u=null;var c=g.Ib(qwa(this));if(g.ub(c,g.Ib(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;t7(this,d);u7(this)}else this.Sb("Changing Screen set during request."),this.Yt()};
|
|
g.h.SM=function(a){this.Sb("Screen availability failed: "+a);this.u=null;u7(this)};
|
|
g.h.Sb=function(a){i7("OnlineScreenService",a)};g.Ua(v7,m7);g.h=v7.prototype;g.h.start=function(){this.w.start();this.u.start();this.o.length&&(this.R("screenChange"),this.u.isEmpty()||this.R("onlineScreenChange"))};
|
|
g.h.add=function(a,b,c){this.w.add(a,b,c)};
|
|
g.h.remove=function(a,b,c){this.w.remove(a,b,c);this.u.update()};
|
|
g.h.Dp=function(a,b,c,d){this.w.contains(a)?this.w.Dp(a,b,c,d):(a="Updating name of unknown screen: "+a.name,i7(this.F,a),d(Error(a)))};
|
|
g.h.ae=function(a){return a?this.o:g.jb(this.o,(0,g.ve)(this.A,function(b){return!this.contains(b)},this))};
|
|
g.h.VC=function(){return(0,g.ve)(this.ae(!0),function(a){return!!this.u.o[a.id]},this)};
|
|
g.h.WC=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new n7(this.C,a,b,c);f.subscribe("pairingComplete",(0,g.x)(function(k){g.He(f);d(w7(this,k))},this));
|
|
f.subscribe("pairingFailed",function(k){g.He(f);e(k)});
|
|
f.start();return(0,g.x)(f.stop,f)};
|
|
g.h.DP=function(a,b,c,d){g.xq(f7(this.C,"/pairing/get_screen"),{method:"POST",yb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new e6(f.screen||{});if(!k.name||uwa(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);uwa(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(w7(this,k))},this),
|
|
onError:(0,g.x)(function(e){d(Error("pairing request failed: "+e.status))},this),
|
|
Md:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})};
|
|
g.h.Y=function(){g.He(this.w);g.He(this.u);v7.Fb.Y.call(this)};
|
|
g.h.zF=function(){vwa(this);this.R("screenChange");this.u.update()};
|
|
v7.prototype.dispose=v7.prototype.dispose;g.Ua(y7,g.P);g.h=y7.prototype;g.h.Ro=function(a){this.w=a;this.R("sessionScreen",this.w)};
|
|
g.h.ge=function(a){this.la()||(a&&z7(this,""+a),this.w=null,this.R("sessionScreen",null))};
|
|
g.h.info=function(a){i7(this.O,a)};
|
|
g.h.YC=function(){return null};
|
|
g.h.iu=function(a){var b=this.u;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.x)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.x)(function(){z7(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
|
|
g.h.Y=function(){this.iu("");y7.Fb.Y.call(this)};g.Ua(A7,y7);g.h=A7.prototype;g.h.hu=function(a){if(this.o){if(this.o==a)return;z7(this,"Overriding cast sesison with new session object");this.o.removeUpdateListener(this.C);this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B)}this.o=a;this.o.addUpdateListener(this.C);this.o.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.B);xwa(this)};
|
|
g.h.lj=function(a){this.info("launchWithParams no-op for Cast: "+g.Mk(a))};
|
|
g.h.stop=function(){this.o?this.o.stop((0,g.x)(function(){this.ge()},this),(0,g.x)(function(){this.ge(Error("Failed to stop receiver app."))},this)):this.ge(Error("Stopping cast device witout session."))};
|
|
g.h.iu=g.Ja;g.h.Y=function(){this.info("disposeInternal");g.Mo(this.A);this.A=0;this.o&&(this.o.removeUpdateListener(this.C),this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B));this.o=null;A7.Fb.Y.call(this)};
|
|
g.h.ON=function(a,b){if(!this.la())if(b){var c=N6(b);if(g.Pa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Mk(c));switch(d){case "mdxSessionStatus":wwa(this,c.screenId);break;default:z7(this,"Unknown youtube message: "+d)}}else z7(this,"Unable to parse message.")}else z7(this,"No data in message.")};
|
|
g.h.tx=function(a,b,c,d){twa(this.H,this.u.label,a,this.u.friendlyName,(0,g.x)(function(e){e?b(e):0<=d?(z7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Ko((0,g.x)(this.tx,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
|
|
g.h.YC=function(){return this.o};
|
|
g.h.EP=function(a){this.la()||a||(z7(this,"Cast session died."),this.ge())};g.Ua(B7,y7);g.h=B7.prototype;g.h.hu=function(a){this.A=a;this.A.addUpdateListener(this.P)};
|
|
g.h.lj=function(a){this.B=a;this.F()};
|
|
g.h.stop=function(){this.o();this.o=g.Ja;g.Mo(this.C);this.A?this.A.stop((0,g.x)(this.ge,this,null),(0,g.x)(this.ge,this,"Failed to stop DIAL device.")):this.ge()};
|
|
g.h.Y=function(){this.o();this.o=g.Ja;g.Mo(this.C);this.A&&this.A.removeUpdateListener(this.P);this.A=null;B7.Fb.Y.call(this)};
|
|
g.h.HP=function(a){this.la()||a||(z7(this,"DIAL session died."),this.o(),this.o=g.Ja,this.ge())};
|
|
g.h.Hr=function(a){this.J=i6();if(this.B){var b=new chrome.cast.DialLaunchResponse(!0,zwa(this));a(b);ywa(this)}else this.F=(0,g.x)(function(){g.Mo(this.C);this.F=g.Ja;this.C=NaN;var c=new chrome.cast.DialLaunchResponse(!0,zwa(this));a(c);ywa(this)},this),this.C=g.Ko((0,g.x)(function(){this.F()},this),100)};
|
|
g.h.TF=function(a,b,c){twa(this.H,this.G.receiver.label,a,this.u.friendlyName,(0,g.x)(function(d){d&&d.token?(this.Ro(d),b(new chrome.cast.DialLaunchResponse(!1))):this.Hr(b,c)},this),(0,g.x)(function(d){z7(this,"Failed to get DIAL screen: "+d);
|
|
this.Hr(b,c)},this))};g.Ua(C7,y7);C7.prototype.stop=function(){this.ge()};
|
|
C7.prototype.hu=g.Ja;C7.prototype.lj=function(){g.Mo(this.o);this.o=NaN;var a=k6(this.H.ae(),this.u.label);a?this.Ro(a):this.ge(Error("No such screen"))};
|
|
C7.prototype.Y=function(){g.Mo(this.o);this.o=NaN;C7.Fb.Y.call(this)};g.Ua(D7,g.P);g.h=D7.prototype;
|
|
g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.F);this.G||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,f=(0,g.x)(this.AM,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.WA,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.QK,this);chrome.cast.initialize(c,(0,g.x)(function(){this.la()||
|
|
(chrome.cast.addReceiverActionListener(this.A),gwa(),this.u.subscribe("onlineScreenChange",(0,g.x)(this.XC,this)),this.w=Bwa(this),chrome.cast.setCustomReceivers(this.w,g.Ja,(0,g.x)(function(k){this.Sb("Failed to set initial custom receivers: "+g.Mk(k))},this)),this.R("yt-remote-cast2-availability-change",F7(this)),b(!0))},this),(0,g.x)(function(k){this.Sb("Failed to initialize API: "+g.Mk(k));
|
|
b(!1)},this))};
|
|
g.h.DO=function(a,b){E7("Setting connected screen ID: "+a+" -> "+b);if(this.o){var c=this.o.w;if(!a||c&&c.id!=a)E7("Unsetting old screen status: "+this.o.u.friendlyName),G7(this,null)}if(a&&b){if(!this.o){c=k6(this.u.ae(),a);if(!c){E7("setConnectedScreenStatus: Unknown screen.");return}var d=Awa(this,c);d||(E7("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.w.push(d),chrome.cast.setCustomReceivers(this.w,
|
|
g.Ja,(0,g.x)(function(e){this.Sb("Failed to set initial custom receivers: "+g.Mk(e))},this)));
|
|
E7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);G7(this,new C7(this.u,d),!0)}this.o.iu(b)}else E7("setConnectedScreenStatus: no screen.")};
|
|
g.h.EO=function(a){this.la()?this.Sb("Setting connection data on disposed cast v2"):this.o?this.o.lj(a):this.Sb("Setting connection data without a session")};
|
|
g.h.GP=function(){this.la()?this.Sb("Stopping session on disposed cast v2"):this.o?(this.o.stop(),G7(this,null)):E7("Stopping non-existing session")};
|
|
g.h.requestSession=function(){chrome.cast.requestSession((0,g.x)(this.WA,this),(0,g.x)(this.XM,this))};
|
|
g.h.Y=function(){this.u.unsubscribe("onlineScreenChange",(0,g.x)(this.XC,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);var a=dwa,b=g.w("yt.mdx.remote.debug.handlers_");g.gb(b||[],a);g.He(this.o);D7.Fb.Y.call(this)};
|
|
g.h.Sb=function(a){i7("Controller",a)};
|
|
g.h.XA=function(a,b){this.o==a&&(b||G7(this,null),this.R("yt-remote-cast2-session-change",b))};
|
|
g.h.wM=function(a,b){if(!this.la())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),E7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.o)if(this.o.u.label!=a.label)E7("onReceiverAction_: Stopping active receiver: "+this.o.u.friendlyName),this.o.stop();else{E7("onReceiverAction_: Casting to active receiver.");this.o.w&&this.R("yt-remote-cast2-session-change",this.o.w);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:G7(this,
|
|
new C7(this.u,a));break;case chrome.cast.ReceiverType.DIAL:G7(this,new B7(this.u,a,this.C));break;case chrome.cast.ReceiverType.CAST:G7(this,new A7(this.u,a));break;default:this.Sb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.o&&this.o.u.label==a.label?this.o.stop():this.Sb("Stopping receiver w/o session: "+a.friendlyName)}else this.Sb("onReceiverAction_ called without receiver.")};
|
|
g.h.QK=function(a){if(this.la())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Sb("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.o?this.o.u:null;if(!c||c.label!=b.label)return this.Sb("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.o.w)return E7("Reselecting dial screen."),
|
|
this.R("yt-remote-cast2-session-change",this.o.w),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Sb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);G7(this,new B7(this.u,b,this.C))}b=this.o;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.x)(b.TF,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.x)(b.Hr,b))};
|
|
g.h.WA=function(a){if(!this.la()){E7("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.o)if(b.receiverType==chrome.cast.ReceiverType.CAST)E7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),G7(this,new A7(this.u,b),!0);else{this.Sb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.o.u,d=k6(this.u.ae(),c.label);d&&f6(d,b.label)&&
|
|
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(E7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.He(this.o),this.o=new A7(this.u,b),this.o.subscribe("sessionScreen",(0,g.x)(this.XA,this,this.o)),this.o.lj(null));this.o.hu(a)}}};
|
|
g.h.FP=function(){return this.o?this.o.YC():null};
|
|
g.h.XM=function(a){this.la()||(this.Sb("Failed to estabilish a session: "+g.Mk(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&G7(this,null))};
|
|
g.h.AM=function(a){E7("Receiver availability updated: "+a);if(!this.la()){var b=F7(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;F7(this)!=b&&this.R("yt-remote-cast2-availability-change",F7(this))}};
|
|
g.h.XC=function(){this.la()||(this.w=Bwa(this),E7("Updating custom receivers: "+g.Mk(this.w)),chrome.cast.setCustomReceivers(this.w,g.Ja,(0,g.x)(function(){this.Sb("Failed to set custom receivers.")},this)),this.R("yt-remote-cast2-availability-change",F7(this)))};
|
|
D7.prototype.setLaunchParams=D7.prototype.EO;D7.prototype.setConnectedScreenStatus=D7.prototype.DO;D7.prototype.stopSession=D7.prototype.GP;D7.prototype.getCastSession=D7.prototype.FP;D7.prototype.requestSession=D7.prototype.requestSession;D7.prototype.init=D7.prototype.init;D7.prototype.dispose=D7.prototype.dispose;var M7=[];R7.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";S7(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.o=a.trackData,this.J=a.hasPrevious,this.hasNext=a.hasNext,this.F=a.playerTime,this.C=a.playerTimeAt,this.A=a.seekableStart,this.u=a.seekableEnd,this.G=a.duration,this.H=a.loadedTime,this.w=a.liveIngestionTime,this.B=
|
|
!isNaN(this.w))};
|
|
R7.prototype.isAdPlaying=function(){return 1081==this.playerState};
|
|
R7.prototype.getDuration=function(){return this.B?this.G+T7(this):this.G};
|
|
R7.prototype.clone=function(){return new R7(X7(this))};g.r(Z7,g.P);g.h=Z7.prototype;g.h.play=function(){1==this.o?(this.u?this.u.play(null,g.Ja,e8(this,"play")):d8(this,"play"),c8(this,1,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.play)};
|
|
g.h.pause=function(){1==this.o?(this.u?this.u.pause(null,g.Ja,e8(this,"pause")):d8(this,"pause"),c8(this,2,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.pause)};
|
|
g.h.seekTo=function(a){if(1==this.o){if(this.u){var b=$7(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.playerState||3==b.playerState?chrome.cast.media.ResumeState.PLAYBACK_START:chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.u.seek(c,g.Ja,e8(this,"seekTo",{newTime:a}))}else d8(this,"seekTo",{newTime:a});c8(this,3,a);this.R("remotePlayerChange")}else a8(this,g.Sa(this.seekTo,a))};
|
|
g.h.stop=function(){if(1==this.o){this.u?this.u.stop(null,g.Ja,e8(this,"stopVideo")):d8(this,"stopVideo");var a=$7(this);a.index=-1;a.videoId="";S7(a);b8(this,a);this.R("remotePlayerChange")}else a8(this,this.stop)};
|
|
g.h.setVolume=function(a,b){if(1==this.o){var c=$7(this);if(this.w){if(c.volume!=a){var d=Math.round(a)/100;this.w.setReceiverVolumeLevel(d,(0,g.x)(function(){i7("CP","set receiver volume: "+d)},this),(0,g.x)(function(){this.Sb("failed to set receiver volume.")},this))}c.muted!=b&&this.w.setReceiverMuted(b,(0,g.x)(function(){i7("CP","set receiver muted: "+b)},this),(0,g.x)(function(){this.Sb("failed to set receiver muted.")},this))}else{var e={volume:a,
|
|
muted:b};-1!=c.volume&&(e.delta=a-c.volume);d8(this,"setVolume",e)}c.muted=b;c.volume=a;b8(this,c)}else a8(this,g.Sa(this.setVolume,a,b))};
|
|
g.h.XB=function(a,b){if(1==this.o){var c=$7(this),d={videoId:a};b&&(c.o={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Mk(b.style),g.Ub(d,c.o));d8(this,"setSubtitlesTrack",d);b8(this,c)}else a8(this,g.Sa(this.XB,a,b))};
|
|
g.h.setAudioTrack=function(a,b){if(1==this.o){var c=b.getLanguageInfo().getId();d8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=$7(this);d.audioTrackId=c;b8(this,d)}else a8(this,g.Sa(this.setAudioTrack,a,b))};
|
|
g.h.playVideo=function(a,b,c,d,e,f,k){var l=$7(this);c=c||0;var m={videoId:a,currentIndex:c};W7(l,a,c);void 0!==b&&(U7(l,b),m.currentTime=b);void 0!==d&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.Mk(k));d8(this,"setPlaylist",m);d||b8(this,l)};
|
|
g.h.TC=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"previous")}else a8(this,g.Sa(this.TC,a,b))};
|
|
g.h.nextVideo=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"next")}else a8(this,g.Sa(this.nextVideo,a,b))};
|
|
g.h.Dw=function(){1==this.o?d8(this,"dismissAutoplay"):a8(this,this.Dw)};
|
|
g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.R("proxyStateChange",a,this.o)}g.P.prototype.dispose.call(this)};
|
|
g.h.Y=function(){Owa(this);this.A=null;this.B.clear();Y7(this,null);g.P.prototype.Y.call(this)};
|
|
g.h.Ou=function(a){if((a!=this.o||2==a)&&3!=this.o&&0!=a){var b=this.o;this.o=a;this.R("proxyStateChange",b,a);if(1==a)for(;!this.B.isEmpty();)b=a=this.B,g.db(b.o)&&(b.o=b.u,b.o.reverse(),b.u=[]),a.o.pop().apply(this);else 3==a&&this.dispose()}};
|
|
g.h.tM=function(a,b){this.R(a,b)};
|
|
g.h.xK=function(a){if(!a)this.Fl(null),Y7(this,null);else if(this.w.receiver.volume){a=this.w.receiver.volume;var b=$7(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)i7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,b8(this,b)}};
|
|
g.h.Fl=function(a){i7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.G);if(this.u=a)this.u.addUpdateListener(this.G),Pwa(this),this.R("remotePlayerChange")};
|
|
g.h.wK=function(a){a?(Pwa(this),this.R("remotePlayerChange")):this.Fl(null)};
|
|
g.h.IK=function(){var a=Lwa();a&&Y7(this,a)};
|
|
g.h.Sb=function(a){i7("CP",a)};g.r(f8,g.P);g.h=f8.prototype;
|
|
g.h.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,k=b.index,l={videoId:d},m=b.currentTime,n=b.locationInfo;void 0!==m&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);void 0!==k&&(l.currentIndex=k);c&&(this.Ta.listId=c);this.Ta.videoId=d;this.Ta.index=k||0;this.Ta.state=3;U7(this.Ta,m);this.A="UNSUPPORTED";g8("Connecting with setPlaylist and params: "+g.Mk(l));this.o.connect({method:"setPlaylist",
|
|
params:g.Mk(l)},a,bva())}else g8("Connecting without params"),this.o.connect({},a,bva());Rwa(this)};
|
|
g.h.dispose=function(){this.la()||(this.R("beforeDispose"),h8(this,3));g.P.prototype.dispose.call(this)};
|
|
g.h.Y=function(){i8(this);k8(this);j8(this);g.Mo(this.F);this.F=NaN;g.Mo(this.G);this.G=NaN;this.w=null;g.zp(this.O);this.O.length=0;this.o.dispose();g.P.prototype.Y.call(this);this.A=this.C=this.u=this.Ta=this.o=null};
|
|
g.h.jF=function(){this.Qi(2)};
|
|
g.h.BK=function(){g8("Channel opened");this.P&&(this.P=!1,j8(this),this.J=g.Ko((0,g.x)(function(){g8("Timing out waiting for a screen.");this.Qi(1)},this),15E3));
|
|
fva(awa(this.o),this.S)};
|
|
g.h.yK=function(){g8("Channel closed");isNaN(this.B)?q6(!0):q6();this.dispose()};
|
|
g.h.zK=function(a){q6();isNaN(this.Ck())?(g8("Channel error: "+a+" without reconnection"),this.dispose()):(this.P=!0,g8("Channel error: "+a+" with reconnection in "+this.Ck()+" ms"),h8(this,2))};
|
|
g.h.AK=function(a){a.params?g8("Received: action="+a.action+", params="+g.Mk(a.params)):g8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=N6(a.params.devices);this.u=(0,g.Fc)(a,function(c){return new d6(c)});
|
|
a=!!g.$a(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
|
|
Uwa(this,a);break;case "loungeScreenDisconnected":g.ib(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
|
|
Uwa(this,!1);break;case "remoteConnected":var b=new d6(N6(a.params.device));g.$a(this.u,function(c){return b?c.id==b.id:!1})||Mua(this.u,b);
|
|
break;case "remoteDisconnected":b=new d6(N6(a.params.device));g.ib(this.u,function(c){return b?c.id==b.id:!1});
|
|
break;case "gracefulDisconnect":break;case "playlistModified":Wwa(this,a);break;case "nowPlaying":Ywa(this,a);break;case "onStateChange":Xwa(this,a);break;case "onAdStateChange":Zwa(this,a);break;case "onVolumeChanged":$wa(this,a);break;case "onSubtitlesTrackChanged":Vwa(this,a);break;case "nowAutoplaying":axa(this,a);break;case "autoplayDismissed":this.R("autoplayDismissed");break;case "autoplayUpNext":this.C=a.params.videoId||null;this.R("autoplayUpNext",this.C);break;case "onAutoplayModeChanged":this.A=
|
|
a.params.autoplayMode;this.R("autoplayModeChange",this.A);"DISABLED"==this.A&&this.R("autoplayDismissed");break;case "onHasPreviousNextChanged":bxa(this,a);break;case "requestAssistedSignIn":this.R("assistedSignInRequested",a.params.authCode);break;default:g8("Unrecognized action: "+a.action)}};
|
|
g.h.qO=function(){if(this.w){var a=this.w;this.w=null;this.Ta.videoId!=a&&l8(this,"getNowPlaying")}};
|
|
g.h.YE=function(){var a=3;this.la()||(a=0,isNaN(this.Ck())?d7(this.o)&&isNaN(this.B)&&(a=1):a=2);return a};
|
|
g.h.Qi=function(a){g8("Disconnecting with "+a);i8(this);this.R("beforeDisconnect",a);1==a&&q6();bwa(this.o,a);this.dispose()};
|
|
g.h.XE=function(){var a=this.Ta;this.w&&(a=this.Ta.clone(),W7(a,this.w,a.index));return X7(a)};
|
|
g.h.FO=function(a){var b=new R7(a);b.videoId&&b.videoId!=this.Ta.videoId&&(this.w=b.videoId,g.Mo(this.F),this.F=g.Ko((0,g.x)(this.qO,this),5E3));var c=[];this.Ta.listId==b.listId&&this.Ta.videoId==b.videoId&&this.Ta.index==b.index||c.push("remoteQueueChange");this.Ta.playerState==b.playerState&&this.Ta.volume==b.volume&&this.Ta.muted==b.muted&&V7(this.Ta)==V7(b)&&g.Mk(this.Ta.o)==g.Mk(b.o)||c.push("remotePlayerChange");this.Ta.reset(a);(0,g.y)(c,function(d){this.R(d)},this)};
|
|
g.h.rx=function(){var a=this.o.C.id,b=g.$a(this.u,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
|
|
return b?b.id:""};
|
|
g.h.Ck=function(){var a=this.o;return a.u.isActive()?a.u.u-(0,g.H)():NaN};
|
|
g.h.ME=function(){return this.A||"UNSUPPORTED"};
|
|
g.h.NE=function(){return this.C||""};
|
|
g.h.yP=function(){if(!isNaN(this.Ck())){var a=this.o.u;g.Cn(a.o);a.start()}};
|
|
g.h.zO=function(a,b){l8(this,a,b);Twa(this)};
|
|
f8.prototype.subscribe=f8.prototype.subscribe;f8.prototype.unsubscribeByKey=f8.prototype.pg;f8.prototype.getProxyState=f8.prototype.YE;f8.prototype.disconnect=f8.prototype.Qi;f8.prototype.getPlayerContextData=f8.prototype.XE;f8.prototype.setPlayerContextData=f8.prototype.FO;f8.prototype.getOtherConnectedRemoteId=f8.prototype.rx;f8.prototype.getReconnectTimeout=f8.prototype.Ck;f8.prototype.getAutoplayMode=f8.prototype.ME;f8.prototype.getAutoplayVideoId=f8.prototype.NE;f8.prototype.reconnect=f8.prototype.yP;
|
|
f8.prototype.sendMessage=f8.prototype.zO;g.r(m8,m7);g.h=m8.prototype;g.h.ae=function(a){return this.qd.$_gs(a)};
|
|
g.h.contains=function(a){return!!this.qd.$_c(a)};
|
|
g.h.get=function(a){return this.qd.$_g(a)};
|
|
g.h.start=function(){this.qd.$_st()};
|
|
g.h.add=function(a,b,c){this.qd.$_a(a,b,c)};
|
|
g.h.remove=function(a,b,c){this.qd.$_r(a,b,c)};
|
|
g.h.Dp=function(a,b,c,d){this.qd.$_un(a,b,c,d)};
|
|
g.h.Y=function(){for(var a=0,b=this.u.length;a<b;++a)this.qd.$_ubk(this.u[a]);this.u.length=0;this.qd=null;m7.prototype.Y.call(this)};
|
|
g.h.CP=function(){this.R("screenChange")};
|
|
g.h.YL=function(){this.R("onlineScreenChange")};
|
|
v7.prototype.$_st=v7.prototype.start;v7.prototype.$_gspc=v7.prototype.DP;v7.prototype.$_gsppc=v7.prototype.WC;v7.prototype.$_c=v7.prototype.contains;v7.prototype.$_g=v7.prototype.get;v7.prototype.$_a=v7.prototype.add;v7.prototype.$_un=v7.prototype.Dp;v7.prototype.$_r=v7.prototype.remove;v7.prototype.$_gs=v7.prototype.ae;v7.prototype.$_gos=v7.prototype.VC;v7.prototype.$_s=v7.prototype.subscribe;v7.prototype.$_ubk=v7.prototype.pg;var F8=null,E8=!1,n8=null,o8=null,D8=null,s8=[];g.r(G8,g.A);g.h=G8.prototype;
|
|
g.h.Y=function(){g.A.prototype.Y.call(this);this.A.stop();this.C.stop();this.P.stop();this.U();this.o.unsubscribe("proxyStateChange",this.TA,this);this.o.unsubscribe("remotePlayerChange",this.Kl,this);this.o.unsubscribe("remoteQueueChange",this.So,this);this.o.unsubscribe("autoplayUpNext",this.tA,this);this.o.unsubscribe("previousNextChange",this.PA,this);this.o.unsubscribe("nowAutoplaying",this.LA,this);this.o.unsubscribe("autoplayDismissed",this.sA,this);this.o=this.B=null};
|
|
g.h.oz=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.o.o)if(J8(this)){if(!$7(this.o).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==$7(this.o).playerState?this.o.pause():this.o.play();break;case "control_play":this.o.play();break;case "control_pause":this.o.pause();break;case "control_seek":this.J.Cx(c[0],c[1]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId,
|
|
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.u.getCurrentTime();L8(this,0==c?void 0:c);break;case "control_seek":L8(this,c[0]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId,c)}};
|
|
g.h.vK=function(a){this.P.fF(a)};
|
|
g.h.eP=function(a){this.oz("control_subtitles_set_track",g.Ob(a)?null:a)};
|
|
g.h.kC=function(){var a=this.u.getOption("captions","track");g.Ob(a)||K8(this,a)};
|
|
g.h.DA=function(a){if(J8(this)){this.o.unsubscribe("remotePlayerChange",this.Kl,this);var b=Math.round(a.volume);a=!!a.muted;var c=$7(this.o);if(b!=c.volume||a!=c.muted)this.o.setVolume(b,a),this.O.start();this.o.subscribe("remotePlayerChange",this.Kl,this)}};
|
|
g.h.uL=function(){g.Ob(this.F)||nxa(this,this.F);this.G=!1};
|
|
g.h.TA=function(a,b){this.C.stop();2==b&&this.jC()};
|
|
g.h.Kl=function(){if(J8(this)){this.A.stop();var a=$7(this.o);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.B.H=1;break;case 1082:case 1083:this.B.H=0;break;default:this.B.H=-1}switch(a.playerState){case 1081:case 1:I8(this,new g.qD(8));this.iC();break;case 1085:case 3:I8(this,new g.qD(9));break;case 1083:case 0:I8(this,new g.qD(2));this.J.stop();H8(this,this.u.getVideoData().lengthSeconds);break;case 1084:I8(this,new g.qD(4));break;case 2:I8(this,new g.qD(4));H8(this,V7(a));
|
|
break;case -1:I8(this,new g.qD(64));break;case -1E3:I8(this,new g.qD(128,{errorCode:"mdx.remoteerror",errorMessage:"Cette vid\u00e9o ne peut pas \u00eatre visionn\u00e9e \u00e0 distance."}))}a=$7(this.o).o;var b=this.F;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.F=a,nxa(this,a));a=$7(this.o);-1==a.volume||Math.round(this.u.getVolume())==a.volume&&this.u.isMuted()==a.muted||this.O.isActive()||this.IC()}else mxa(this)};
|
|
g.h.PA=function(){this.u.R("mdxpreviousnextchange")};
|
|
g.h.So=function(){J8(this)||mxa(this)};
|
|
g.h.bE=function(){this.o.Dw()};
|
|
g.h.tA=function(){};
|
|
g.h.LA=function(a){isNaN(a)||this.u.R("mdxnowautoplaying",a)};
|
|
g.h.sA=function(){this.u.R("mdxautoplaycanceled")};
|
|
g.h.cI=function(a,b){-1==$7(this.o).playerState?L8(this,a):b&&this.o.seekTo(a)};
|
|
g.h.IC=function(){if(J8(this)){var a=$7(this.o);this.w.Xa(this.S);a.muted?this.u.mute():this.u.unMute();this.u.setVolume(a.volume);this.S=this.w.L(this.u,"onVolumeChange",this.DA)}};
|
|
g.h.iC=function(){this.A.stop();if(!this.o.la()){var a=$7(this.o);1==a.playerState&&I8(this,new g.qD(8));H8(this,V7(a));this.A.start()}};
|
|
g.h.jC=function(){this.C.stop();this.A.stop();var a=this.o.A.getReconnectTimeout();2==this.o.o&&!isNaN(a)&&this.C.start()};g.r(M8,g.V);M8.prototype.w=function(){c6("mdx-privacy-popup-cancel");this.u.hide()};
|
|
M8.prototype.B=function(){c6("mdx-privacy-popup-confirm");this.u.hide()};g.r(N8,g.V);N8.prototype.A=function(a){pxa(this,a.state)};g.r(O8,g.$O);O8.prototype.J=function(){var a=this.u.getOption("remote","receivers");a&&1<a.length&&!this.u.getOption("remote","quickCast")?(this.C=g.xb(a,this.B,this),g.bP(this,(0,g.Fc)(a,this.B)),a=this.u.getOption("remote","currentReceiver"),this.Be(this.B(a)),this.enable(!0)):this.enable(!1)};
|
|
O8.prototype.B=function(a){return a.key};
|
|
O8.prototype.Te=function(a){return"cast-selector-receiver"==a?"Caster sur\u2026":this.C[a].name};
|
|
O8.prototype.Yc=function(a){g.$O.prototype.Yc.call(this,a);this.u.setOption("remote","currentReceiver",this.C[a]);this.w.kb()};g.r(P8,g.gM);g.h=P8.prototype;
|
|
g.h.create=function(){gxa(g.Bx(this.player.N()));this.A.push(g.Ro("yt-remote-before-disconnect",this.sK,this));this.A.push(g.Ro("yt-remote-connection-change",this.BM,this));this.A.push(g.Ro("yt-remote-receiver-availability-change",this.QA,this));this.A.push(g.Ro("yt-remote-auto-connect",this.zM,this));this.A.push(g.Ro("yt-remote-receiver-resumed",this.yM,this));this.A.push(g.Ro("mdx-privacy-popup-confirm",this.cO,this));this.A.push(g.Ro("mdx-privacy-popup-cancel",this.bO,this));this.QA()};
|
|
g.h.load=function(){this.player.cancelPlayback();g.gM.prototype.load.call(this);this.B=new G8(this,this.player,this.o);var a=(a=lxa())?a.currentTime:0;var b=C8()?new Z7(x8(),void 0):null;0==a&&b&&(a=V7($7(b)));0!=a&&(this.O=a||0,this.player.R("progresssync",a,void 0));oxa(this,this.F,this.F);g.BT(this.player.app,6)};
|
|
g.h.unload=function(){this.player.R("mdxautoplaycanceled");this.w=this.u;g.Ie(this.B,this.o);this.o=this.B=null;g.gM.prototype.unload.call(this);g.BT(this.player.app,5);Q8(this)};
|
|
g.h.Y=function(){g.So(this.A);g.gM.prototype.Y.call(this)};
|
|
g.h.nl=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.oz.apply(this.B,[a].concat(g.na(c)))};
|
|
g.h.getAdState=function(){return this.H};
|
|
g.h.aF=function(){return this.loaded?this.B.suggestion:null};
|
|
g.h.Ky=function(){return this.o?$7(this.o).J:!1};
|
|
g.h.hasNext=function(){return this.o?$7(this.o).hasNext:!1};
|
|
g.h.getCurrentTime=function(){return this.O};
|
|
g.h.getProgressState=function(){var a=$7(this.o),b=this.player.getVideoData();return{allowSeeking:g.Q(this.player.N().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.Nc():!a.isAdPlaying()&&this.player.Nc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.w+T7(a):a.w,isAtLiveHead:1>=(a.B?a.u+T7(a):a.u)-this.getCurrentTime(),loaded:a.H,seekableEnd:a.B?a.u+T7(a):a.u,seekableStart:0<a.A?a.A+T7(a):
|
|
a.A}};
|
|
g.h.nextVideo=function(){this.o&&this.o.nextVideo()};
|
|
g.h.xG=function(){this.o&&this.o.TC()};
|
|
g.h.sK=function(a){1==a&&(this.S=this.o?$7(this.o):null)};
|
|
g.h.BM=function(){var a=C8()?new Z7(x8(),void 0):null;if(a){var b=this.w;this.loaded&&this.unload();this.o=a;this.S=null;b.key!=this.u.key&&(this.w=b,this.load())}else g.He(this.o),this.o=null,this.loaded&&(this.unload(),(a=this.S)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,V7(a)));this.player.R("videodatachange","newdata",this.player.getVideoData(),3)};
|
|
g.h.QA=function(){this.J=[this.u].concat(ixa());var a=y8()||this.u;R8(this,a);this.player.ma("onMdxReceiversChange")};
|
|
g.h.TN=function(a){!this.P&&g.ED(a,8)&&(this.player.pauseVideo(),Q8(this))};
|
|
g.h.zM=function(){var a=y8();R8(this,a)};
|
|
g.h.yM=function(){this.w=y8()};
|
|
g.h.cO=function(){this.P=!0;Q8(this);E8=!1;F8&&A8(F8,1);F8=null};
|
|
g.h.bO=function(){this.P=!1;Q8(this);R8(this,this.u);this.w=this.u;E8=!1;F8=null;this.player.playVideo()};
|
|
g.h.Lc=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.J;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?P7():R8(this,b)),this.loaded?this.w:this.u;case "quickCast":return 2==this.J.length&&"cast-selector-receiver"==this.J[1].key?(b&&P7(),!0):!1}};
|
|
g.h.yG=function(){d8(this.o,"sendDebugCommand",{debugCommand:"stats4nerds "})};
|
|
g.h.Bf=function(){return!1};
|
|
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.vM.remote=P8;})(_yt_player);
|