uawdijnntqw1x1x1
IP : 216.73.216.30
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
files
/
.
/
need-2-delete
/
mini-borishof.ru1
/
upload
/
accessories
/
all-about-accessories
/
remote.js
/
/
(function(g){var window=this;var Ppa=function(a,b){return g.Tb(a,b)},$5=function(a,b,c){a.w.set(b,c)},a6=function(a){$5(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.E)()).toString(36)); return a},b6=function(a,b,c){g.Ia(c)||(c=[String(c)]); g.Mm(a.w,b,c)},Qpa=function(a,b){var c=[]; g.gk(b,function(d){try{var e=g.yn.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.xn(e)&&c.push(d)},a); return c},Rpa=function(a,b){var c=Qpa(a,b); (0,g.y)(c,function(d){g.yn.prototype.remove.call(this,d)},a)},Spa=function(a){if(a.dd){if(a.dd.locationOverrideToken)return{locationOverrideToken:a.dd.locationOverrideToken}; if(null!=a.dd.latitudeE7&&null!=a.dd.longitudeE7)return{latitudeE7:a.dd.latitudeE7,longitudeE7:a.dd.longitudeE7}}return null},Tpa=function(a,b){g.Ya(a,b)||a.push(b)},c6=function(a){var b=0,c; for(c in a)b++;return b},Upa=function(a,b){var c=b instanceof g.vc?b:g.zc(b,/^data:image\//i.test(b)); a.src=g.wc(c)},d6=function(){},Vpa=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);},Wpa=function(a){if(a.nd&&"function"==typeof a.nd)return a.nd(); if("string"===typeof a)return a.split("");if(g.Ja(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Ob(a)},Xpa=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0); else if(g.Ja(a)||"string"===typeof a)(0,g.y)(a,b,void 0);else{if(a.Yd&&"function"==typeof a.Yd)var c=a.Yd();else if(a.nd&&"function"==typeof a.nd)c=void 0;else if(g.Ja(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Pb(a);d=Wpa(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},Ypa=function(a,b,c,d){var e=new g.Am(null,void 0); a&&g.Bm(e,a);b&&g.Cm(e,b);c&&g.Dm(e,c);d&&(e.u=d);return e},e6=function(a,b){g.uo[a]=!0; var c=g.so();c&&c.publish.apply(c,arguments);g.uo[a]=!1},f6=function(a){try{var b=(0,g.Qw)(),c=(0,g.Pw)(); b&&b.remove(a);c&&c.remove(a)}catch(d){}},Zpa=function(){var a=(0,g.Pw)(); a&&Rpa(a,a.o.kf(!0))},g6=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.xm;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",$pa(this,a.capabilities||""),aqa(this,a.experiments||""),this.u=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey|| "")},$pa=function(a,b){a.capabilities.clear(); (0,g.Rd)(b.split(","),g.Oa(Ppa,bqa)).forEach(function(c){a.capabilities.add(c)})},aqa=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},h6=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||""},i6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},cqa=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},dqa=function(a){return new h6(a)},eqa=function(a){return g.Ia(a)?(0,g.H)(a,dqa):[]},j6=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"},k6=function(a){return g.Ia(a)?"["+(0,g.H)(a,j6).join(",")+"]":"null"},l6=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)})},fqa=function(a){return(0,g.H)(a,function(b){return{key:b.id, name:b.name}})},m6=function(a,b){return g.Va(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},n6=function(a,b){return g.Va(a,function(c){return i6(c,b)})},o6=function(){var a=g.Sw("yt-remote-connected-devices")||[]; g.ob(a);return a},gqa=function(a){if(g.Za(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.H)(a,function(d,e){return 0==e?d:d.substring(c.length)})},hqa=function(a){g.Rw("yt-remote-connected-devices",a,86400)},q6=function(){if(p6)return p6; var a=g.Sw("yt-remote-device-id");a||(a=l6(),g.Rw("yt-remote-device-id",a,31536E3));for(var b=o6(),c=1,d=a;g.Ya(b,d);)c++,d=a+"#"+c;return p6=d},r6=function(){var a=o6(),b=q6(); g.Ya(a,b);g.JM()&&g.qb(a,b);a=gqa(a);if(g.Za(a))try{g.sr("remote_sid")}catch(c){}else try{g.rr("remote_sid",a.join(","),-1)}catch(c){}},iqa=function(){return g.Sw("yt-remote-session-browser-channel")},jqa=function(){return g.Sw("yt-remote-local-screens")||[]},kqa=function(){g.Rw("yt-remote-lounge-token-expiration",!0,86400)},lqa=function(a){5<a.length&&(a=a.slice(a.length-5)); var b=(0,g.H)(jqa(),function(d){return d.loungeToken}),c=(0,g.H)(a,function(d){return d.loungeToken}); (0,g.mi)(c,function(d){return!g.Ya(b,d)})&&kqa(); g.Rw("yt-remote-local-screens",a,31536E3)},mqa=function(a,b){g.Rw("yt-remote-session-browser-channel",a); g.Rw("yt-remote-session-screen-id",b);var c=o6(),d=q6();g.Ya(c,d)||c.push(d);hqa(c);r6()},s6=function(a){a||(f6("yt-remote-session-screen-id"),f6("yt-remote-session-video-id")); r6();a=o6();g.bb(a,q6());hqa(a)},nqa=function(){if(!t6){var a=g.In(); a&&(t6=new g.sn(a))}return t6?!!t6.get("yt-remote-use-staging-server"):!1},oqa=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},pqa=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},u6=function(a){a.length?qqa(a.shift(),function(){u6(a)}):v6()},rqa=function(a){return"chrome-extension://"+a+"/cast_sender.js"},qqa=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)},v6=function(){var a=pqa(); a&&a(!1,"No cast extension found")},tqa=function(){if(sqa){var a=2,b=pqa(),c=function(){a--; 0==a&&b&&b(!0)}; window.__onGCastApiAvailable=c;qqa("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",v6,c)}},uqa=function(){tqa(); var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);u6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},w6=function(a,b,c){g.A.call(this); this.C=null!=c?(0,g.x)(a,c):a;this.Vc=b;this.B=(0,g.x)(this.CD,this);this.o=!1;this.u=0;this.w=this.Fa=null;this.A=[]},x6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return Vpa(a)},y6=function(){},z6=function(){},vqa=function(){},xqa=function(a){return(a=wqa(a))?new ActiveXObject(a):new XMLHttpRequest},wqa=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},A6=function(a,b,c,d){this.o=a; this.w=b;this.G=c;this.D=d||1;this.B=45E3;this.A=new g.R_(this);this.u=new g.pf;this.u.setInterval(250)},zqa=function(a,b,c){a.gi=1; a.Wf=a6(b.clone());a.xh=c;a.C=!0;yqa(a,null)},B6=function(a,b,c,d,e){a.gi=1; a.Wf=a6(b.clone());a.xh=null;a.C=c;e&&(a.jA=!1);yqa(a,d)},yqa=function(a,b){a.Oi=(0,g.E)(); C6(a);a.Cg=a.Wf.clone();b6(a.Cg,"t",a.D);a.Yk=0;a.tc=a.o.rp(a.o.Nk()?b:null);0<a.Xp&&(a.Jn=new g.bl((0,g.x)(a.nB,a,a.tc),a.Xp));a.A.ha(a.tc,"readystatechange",a.KM);var c=a.ah?g.Zb(a.ah):{};a.xh?(a.po="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.tc.send(a.Cg,a.po,a.xh,c)):(a.po="GET",a.jA&&!g.Gd&&(c.Connection="close"),a.tc.send(a.Cg,a.po,null,c));a.o.pe(1)},Cqa=function(a,b,c){for(var d=!0;!a.Mg&&a.Yk<c.length;){var e=Aqa(a,c); if(e==D6){4==b&&(a.lg=4,E6(15),d=!1);break}else if(e==Bqa){a.lg=4;E6(16);d=!1;break}else F6(a,e)}4==b&&0==c.length&&(a.lg=1,E6(17),d=!1);a.qe=a.qe&&d;d||(G6(a),H6(a))},Aqa=function(a,b){var c=a.Yk,d=b.indexOf("\n",c); if(-1==d)return D6;c=Number(b.substring(c,d));if(isNaN(c))return Bqa;d+=1;if(d+c>b.length)return D6;var e=b.substr(d,c);a.Yk=d+c;return e},Eqa=function(a,b){a.Oi=(0,g.E)(); C6(a);var c=b?window.location.hostname:"";a.Cg=a.Wf.clone();$5(a.Cg,"DOMAIN",c);$5(a.Cg,"t",a.D);try{a.xe=new ActiveXObject("htmlfile")}catch(n){G6(a);a.lg=7;E6(22);H6(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 I6)k=I6[l];else if(l in Dqa)k=I6[l]=Dqa[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= I6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Oc(g.oc("b/12014412"),d+"</body></html>");a.xe.open();a.xe.write(g.Ic(c));a.xe.close();a.xe.parentWindow.m=(0,g.x)(a.bM,a);a.xe.parentWindow.d=(0,g.x)(a.qz,a,!0);a.xe.parentWindow.rpcClose=(0,g.x)(a.qz,a,!1);c=a.xe.createElement("DIV");a.xe.parentWindow.document.body.appendChild(c);d=g.yc(a.Cg.toString());d=g.Vc(g.wc(d));d=g.Oc(g.oc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Pc(c,d);a.o.pe(1)},C6=function(a){a.qt=(0,g.E)()+a.B; Fqa(a,a.B)},Fqa=function(a,b){if(null!=a.bj)throw Error("WatchDog timer not null"); a.bj=J6((0,g.x)(a.iM,a),b)},K6=function(a){a.bj&&(g.v.clearTimeout(a.bj),a.bj=null)},H6=function(a){a.o.Yv()||a.Mg||a.o.Bn(a)},G6=function(a){K6(a); g.de(a.Jn);a.Jn=null;a.u.stop();g.T_(a.A);if(a.tc){var b=a.tc;a.tc=null;b.abort();b.dispose()}a.xe&&(a.xe=null)},F6=function(a,b){try{a.o.jz(a,b),a.o.pe(4)}catch(c){}},Hqa=function(a,b,c,d,e){if(0==d)c(!1); else{var f=e||0;d--;Gqa(a,b,function(k){k?c(!0):g.v.setTimeout(function(){Hqa(a,b,c,d,f)},f)})}},Gqa=function(a,b,c){var d=new Image; d.onload=function(){try{L6(d),c(!0)}catch(e){}}; d.onerror=function(){try{L6(d),c(!1)}catch(e){}}; d.onabort=function(){try{L6(d),c(!1)}catch(e){}}; d.ontimeout=function(){try{L6(d),c(!1)}catch(e){}}; g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b); Upa(d,a)},L6=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},Iqa=function(a){this.o=a; this.u=new y6},Jqa=function(a){var b=M6(a.o,a.mj,"/mail/images/cleardot.gif"); a6(b);Hqa(b.toString(),5E3,(0,g.x)(a.AC,a),3,2E3);a.pe(1)},O6=function(a){var b=a.o.H; if(null!=b)E6(5),b?(E6(11),N6(a.o,a,!1)):(E6(12),N6(a.o,a,!0));else if(a.yd=new A6(a,void 0,void 0,void 0),a.yd.ah=a.Vp,b=a.o,b=M6(b,b.Nk()?a.Jj:null,a.Wp),E6(5),!g.Ed||g.jd(10))b6(b,"TYPE","xmlhttp"),B6(a.yd,b,!1,a.Jj,!1);else{b6(b,"TYPE","html");var c=a.yd;a=!!a.Jj;c.gi=3;c.Wf=a6(b.clone());Eqa(c,a)}},P6=function(a){g.De.call(this); this.headers=new g.xm;this.P=a||null;this.w=!1;this.L=this.o=null;this.Z=this.H="";this.C=0;this.A="";this.B=this.da=this.G=this.U=!1;this.D=0;this.J=null;this.aa="";this.R=this.V=!1},Kqa=function(a){return g.Ed&&g.id(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},Lqa=function(a){return"content-type"==a.toLowerCase()},Nqa=function(a,b){a.w=!1; a.o&&(a.B=!0,a.o.abort(),a.B=!1);a.A=b;a.C=5;Mqa(a);Q6(a)},Mqa=function(a){a.U||(a.U=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},Pqa=function(a){if(a.w&&"undefined"!=typeof g.Z_)if(a.L[1]&&4==R6(a)&&2==a.getStatus())S6(a,"Local request error detected and ignored"); else if(a.G&&4==R6(a))g.qf(a.bw,0,a);else if(a.dispatchEvent("readystatechange"),4==R6(a)){S6(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.Mg(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=!Oqa.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success"); else{a.C=6;try{var l=2<R6(a)?a.o.statusText:""}catch(m){l=""}a.A=l+" ["+a.getStatus()+"]";Mqa(a)}}finally{Q6(a)}}},Q6=function(a,b){if(a.o){Qqa(a); var c=a.o,d=a.L[0]?g.Ea:null;a.o=null;a.L=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},Qqa=function(a){a.o&&a.R&&(a.o.ontimeout=null); a.J&&(g.v.clearTimeout(a.J),a.J=null)},R6=function(a){return a.o?a.o.readyState:0},T6=function(a){try{return a.o?a.o.responseText:""}catch(b){return""}},S6=function(a,b){return b+" ["+a.Z+" "+a.H+" "+a.getStatus()+"]"},U6=function(a,b,c){this.o=1; this.u=[];this.A=[];this.B=new y6;this.G=a||null;this.H=null!=b?b:null;this.C=c||!1},Rqa=function(a,b){this.o=a; this.map=b;this.context=null},Sqa=function(a){g.fe.call(this,"statevent",a)},Tqa=function(a,b){g.fe.call(this,"timingevent",a); this.size=b},Uqa=function(a){g.fe.call(this,"serverreachability",a)},Xqa=function(a){Vqa(a); if(3==a.o){var b=a.tk++,c=a.dm.clone();$5(c,"SID",a.w);$5(c,"RID",b);$5(c,"TYPE","terminate");V6(a,c);b=new A6(a,a.w,b,void 0);b.gi=2;b.Wf=a6(c.clone());Upa(new Image,b.Wf.toString());b.Oi=(0,g.E)();C6(b)}Wqa(a)},Yqa=function(a){a.VC(1,0); a.dm=M6(a,null,a.Up);W6(a)},Vqa=function(a){a.Zf&&(a.Zf.abort(),a.Zf=null); a.Sb&&(a.Sb.cancel(),a.Sb=null);a.lf&&(g.v.clearTimeout(a.lf),a.lf=null);X6(a);a.rd&&(a.rd.cancel(),a.rd=null);a.fg&&(g.v.clearTimeout(a.fg),a.fg=null)},Zqa=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed"); a.u.push(new Rqa(a.qI++,b));2!=a.o&&3!=a.o||W6(a)},W6=function(a){a.rd||a.fg||(a.fg=J6((0,g.x)(a.pz,a),0),a.Xh=0)},ara=function(a,b){if(1==a.o){if(!b){a.tk=Math.floor(1E5*Math.random()); var c=a.tk++,d=new A6(a,"",c,void 0);d.ah=null;var e=Y6(a),f=a.dm.clone();$5(f,"RID",c);$5(f,"CVER","1");V6(a,f);zqa(d,f,e);a.rd=d;a.o=2}}else 3==a.o&&(b?$qa(a,b):0==a.u.length||a.rd||$qa(a))},$qa=function(a,b){if(b)if(6<a.Ng){a.u=a.A.concat(a.u); a.A.length=0;var c=a.tk-1;var d=Y6(a)}else c=b.G,d=b.xh;else c=a.tk++,d=Y6(a);var e=a.dm.clone();$5(e,"SID",a.w);$5(e,"RID",c);$5(e,"AID",a.wi);V6(a,e);c=new A6(a,a.w,c,a.Xh+1);c.ah=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.rd=c;zqa(c,e,d)},V6=function(a,b){if(a.Sc){var c=a.Sc.yv(); c&&g.Ib(c,function(d,e){$5(b,e,d)})}},Y6=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b]; if(6<a.Ng&&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.Ng?e:f-d;try{g.Ib(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("&")},bra=function(a){a.Sb||a.lf||(a.D=1,a.lf=J6((0,g.x)(a.oz,a),0),a.Rh=0)},Z6=function(a){if(a.Sb||a.lf||3<=a.Rh)return!1; a.D++;a.lf=J6((0,g.x)(a.oz,a),cra(a,a.Rh));a.Rh++;return!0},N6=function(a,b,c){a.no=c; a.Fe=b.Af;a.C||Yqa(a)},X6=function(a){null!=a.Rg&&(g.v.clearTimeout(a.Rg),a.Rg=null)},cra=function(a,b){var c=5E3+Math.floor(1E4*Math.random()); a.isActive()||(c*=2);return c*b},$6=function(a,b){if(2==b||9==b){var c=null; a.Sc&&(c=null);var d=(0,g.x)(a.uN,a);c||(c=new g.Am("//www.google.com/images/cleardot.gif"),a6(c));Gqa(c.toString(),1E4,d)}else E6(2);dra(a,b)},dra=function(a,b){a.o=0; a.Sc&&a.Sc.Ku(b);Wqa(a);Vqa(a)},Wqa=function(a){a.o=0; a.Fe=-1;if(a.Sc)if(0==a.A.length&&0==a.u.length)a.Sc.kp();else{g.eb(a.A);var b=g.eb(a.u);a.A.length=0;a.u.length=0;a.Sc.kp(b)}},M6=function(a,b,c){var d=g.Im(c); if(""!=d.o)b&&g.Cm(d,b+"."+d.o),g.Dm(d,d.B);else{var e=window.location;d=Ypa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.xj&&g.Ib(a.xj,function(f,k){$5(d,k,f)}); $5(d,"VER",a.Ng);V6(a,d);return d},J6=function(a,b){if(!g.Ka(a))throw Error("Fn must not be null and must be a function"); return g.v.setTimeout(function(){a()},b)},E6=function(a){a7.dispatchEvent(new Sqa(a7,a))},era=function(){},fra=function(){this.o=[]; this.u=[]},gra=function(a,b){this.action=a; this.params=b||{}},b7=function(a,b){g.A.call(this); this.o=new g.J(this.SL,0,this);g.B(this,this.o);this.Vc=5E3;this.u=0;if(g.Ka(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Ka(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.rn;this.u=new b7(this.WM,this);this.o=null;this.fb=!1;this.B=null;this.H="";this.G=this.A=0;this.D=[];this.R=c||!1},hra=function(a){return{firstTestResults:[""], secondTestResults:!a.o.no,sessionId:a.o.w,arrayId:a.o.wi}},ira=function(a,b){a.G=b||0; a.u.stop();a.o&&(3==a.o.o&&ara(a.o),Xqa(a.o));a.G=0},d7=function(a){return!!a.o&&3==a.o.o},jra=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.Mg(4,a))||"";b&&(this.port=":"+b);this.domain=g.Ng(a)||"";a=g.Gb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Fb(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.Wg(c+b,{})},g7=function(a,b,c,d,e){a={format:"JSON", method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Oa(a.A,d,!0),onError:g.Oa(a.w,e),Qd:g.Oa(a.B,e)};c&&(a.ub=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.op(b,a)},nra=function(){var a=kra; lra();h7.push(a);mra(h7)},i7=function(a,b){lra(); var c=h7,d=ora(a,String(b));g.Za(c)?pra(d):(mra(c),(0,g.y)(c,function(e){e(d)}))},lra=function(){h7||(h7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Da("yt.mdx.remote.debug.handlers_",h7,void 0))},pra=function(a){var b=(j7+1)%50; j7=b;k7[b]=a;l7||(l7=49==b)},mra=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}},ora=function(a,b){var c=((0,g.E)()-qra)/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.Q.call(this); this.D=a;this.o=[]},rra=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},sra=function(a,b){var c=a.o.length!=b.length; a.o=(0,g.Rd)(a.o,function(f){return!!m6(b,f)}); for(var d=0,e=b.length;d<e;d++)c=rra(a,b[d])||c;return c},tra=function(a,b){var c=a.o.length; a.o=(0,g.Rd)(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.Q.call(this); this.C=a;this.B=b;this.w=c;this.A=d;this.u=0;this.o=null;this.Fa=NaN},p7=function(a){m7.call(this,"LocalScreenService"); this.w=a;this.u=NaN;o7(this);this.info("Initializing with "+k6(this.o))},ura=function(a){if(a.o.length){var b=(0,g.H)(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.MD,a),(0,g.x)(a.LD,a))}},o7=function(a){var b=eqa(jqa()); b=(0,g.Rd)(b,function(c){return!c.uuid}); return sra(a,b)},q7=function(a,b){lqa((0,g.H)(a.o,cqa)); b&&kqa()},s7=function(a,b){g.Q.call(this); this.C=b;var c=g.Sw("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.Ya(c,l)}this.o=d;this.B=a;this.w=this.A=NaN;this.u=null;r7("Initialized with "+g.Hk(this.o))},vra=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(c6(b)!=c6(a.o))var c=!1; else{c=g.Pb(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.Hk(a.o)),a.o=b,a.S("screenChange"));wra(a)},u7=function(a){isNaN(a.w)||g.ro(a.w); a.w=g.po((0,g.x)(a.As,a),0<a.A&&a.A<(0,g.E)()?2E4:1E4)},r7=function(a){i7("OnlineScreenService",a)},xra=function(a){var b={}; (0,g.y)(a.C(),function(c){c.token?b[c.token]=c.id:this.Jb("Requesting availability of screen w/o lounge token.")}); return b},wra=function(a){a=g.Pb(g.Jb(a.o,function(b){return b})); g.ob(a);a.length?g.Rw("yt-remote-online-screen-ids",a.join(","),60):f6("yt-remote-online-screen-ids")},v7=function(a){m7.call(this,"ScreenService"); this.C=a;this.u=this.w=null;this.A=[];this.B={};yra(this)},Ara=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b); c||(c=a.B[b]);var k=a.Ld();if(k=(c?n6(k,c):null)||n6(k,b)){k.uuid=b;var l=w7(a,k);vra(a.u,l,function(m){e(m?l:null)})}else c?zra(a,c,(0,g.x)(function(m){var n=w7(this,new h6({name:d, screenId:c,loungeToken:m,dialId:b||""}));vra(this.u,n,function(q){e(q?n:null)})},a),f):e(null)},Bra=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},zra=function(a,b,c,d){a.info("requestLoungeToken_ for "+b); var e={ub:{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.op(f7(a.C,"/pairing/get_lounge_token_batch"),e)},Cra=function(a){a.o=a.w.Ld(); 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: "+k6(a.o))},yra=function(a){x7(a); a.w=new p7(a.C);a.w.subscribe("screenChange",(0,g.x)(a.TD,a));Cra(a);a.A=eqa(g.Sw("yt-remote-automatic-screen-cache")||[]);x7(a);a.info("Initializing automatic screens: "+k6(a.A));a.u=new s7(a.C,(0,g.x)(a.Ld,a,!0));a.u.subscribe("screenChange",(0,g.x)(function(){this.S("onlineScreenChange")},a))},w7=function(a,b){var c=a.get(b.id); c?(c.uuid=b.uuid,b=c):((c=n6(a.A,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.A.push(b),g.Rw("yt-remote-automatic-screen-cache",(0,g.H)(a.A,cqa)));x7(a);a.B[b.uuid]=b.id;g.Rw("yt-remote-device-id-map",a.B,31536E3);return b},x7=function(a){a.B=g.Sw("yt-remote-device-id-map")||{}},y7=function(a,b,c){g.Q.call(this); this.L=c;this.H=a;this.u=b;this.w=null},z7=function(a,b){i7(a.L,b)},A7=function(a,b){y7.call(this,a,b,"CastSession"); this.o=null;this.A=0;this.C=(0,g.x)(this.eO,this);this.B=(0,g.x)(this.tM,this);this.A=g.po((0,g.x)(function(){Dra(this,null)},this),12E4)},Era=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Hk(void 0)); var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ea,(0,g.x)(function(){z7(this,"Failed to send message: getMdxSessionStatus.")},a)):z7(a,"Sending yt message without session: "+g.Hk(b))},Dra=function(a,b){g.ro(a.A); if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.w||a.w.id!=b){var c=(0,g.x)(a.Dn,a),d=(0,g.x)(a.Pd,a);a.Rv(b,c,d,5)}}else a.Pd(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.P=c;this.B=null;this.D=g.Ea;this.C=NaN;this.R=(0,g.x)(this.hO,this);this.o=g.Ea},Fra=function(a){a.o=a.H.tB(a.J,a.u.label,a.u.friendlyName,(0,g.x)(function(b){this.o=g.Ea; this.Dn(b)},a),(0,g.x)(function(b){this.o=g.Ea; this.Pd(b)},a))},Gra=function(a){var b={}; b.pairingCode=a.J;b.theme=a.P;if(a.B){var c=a.B.currentTime||0;b.v=a.B.videoId;b.t=c}nqa()&&(b.env_useStageMdx=1);return g.Ug(b)},C7=function(a,b){y7.call(this,a,b,"ManualSession"); this.o=g.po((0,g.x)(this.xi,this,null),150)},D7=function(a,b,c,d){g.Q.call(this); this.u=a;this.D=b||"233637DE";this.C=c||"cl";this.G=d||!1;this.o=null;this.B=!1;this.w=[];this.A=(0,g.x)(this.aL,this)},Hra=function(a,b){return b?g.Va(a.w,function(c){return i6(b,c.label)},a):null},E7=function(a){i7("Controller",a)},kra=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.de(a.o),(a.o=b)?(c?a.S("yt-remote-cast2-receiver-resumed",b.u):a.S("yt-remote-cast2-receiver-selected", b.u),b.subscribe("sessionScreen",(0,g.x)(a.mz,a,b)),b.w?a.S("yt-remote-cast2-session-change",b.w):c&&a.o.xi(null)):a.S("yt-remote-cast2-session-change",null))},Ira=function(a){var b=a.u.sB(),c=a.o&&a.o.u; a=(0,g.H)(b,function(d){c&&i6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=Hra(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},Ora=function(a,b,c,d,e,f,k){Jra()?Kra(b,e,f,k)&&(I7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Lra(a,c):(window.__onGCastApiAvailable=function(l,m){l?Lra(a,c):(J7("Failed to load cast API: "+m),K7(!1),I7(!1),f6("yt-remote-cast-available"),f6("yt-remote-cast-receiver"),Mra(),c(!1))},d?g.Co("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?uqa():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?v6():(tqa(),u6(Nra.map(rqa))))):H7("Cannot initialize because not running Chrome")},Mra=function(){H7("dispose"); var a=L7();a&&a.dispose();g.Da("yt.mdx.remote.cloudview.instance_",null,void 0);Pra(!1);g.xo(M7);M7.length=0},N7=function(){return!!g.Sw("yt-remote-cast-installed")},Qra=function(){var a=g.Sw("yt-remote-cast-receiver"); return a?a.friendlyName:null},Rra=function(){H7("clearCurrentReceiver"); f6("yt-remote-cast-receiver")},Sra=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.wo("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.")},Jra=function(){var a=0<=g.Gb.search(/ (CrMo|Chrome|CriOS)\//); return g.Fs||a},Tra=function(a,b){L7().init(a,b)},Kra=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.Rw("yt-remote-cast-available",f);e6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){H7("onReceiverSelected: "+f.friendlyName); g.Rw("yt-remote-cast-receiver",f);e6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){H7("onReceiverResumed: "+f.friendlyName); g.Rw("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){H7("onSessionChange: "+j6(f)); f||f6("yt-remote-cast-receiver");e6("yt-remote-cast2-session-change",f)}),g.Da("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_")},Lra=function(a,b){K7(!0); I7(!1);Tra(a,function(c){c?(Pra(!0),g.zo("yt-remote-cast2-api-ready")):(J7("Failed to initialize cast API."),K7(!1),f6("yt-remote-cast-available"),f6("yt-remote-cast-receiver"),Mra());b(c)})},H7=function(a){i7("cloudview",a)},J7=function(a){i7("cloudview",a)},K7=function(a){H7("setCastInstalled_ "+a); g.Rw("yt-remote-cast-installed",a)},O7=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},Pra=function(a){H7("setApiReady_ "+a); g.Da("yt.mdx.remote.cloudview.apiReady_",a,void 0)},I7=function(a){g.Da("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.D=0;this.o=null;this.hasNext=this.Ge=!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.Ge=!1;a.hasNext=!1;a.D=0;a.C=(0,g.E)();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.E)()-a.C)/1E3:0},U7=function(a,b){a.D=b; a.C=(0,g.E)()},V7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.E)()-a.C)/1E3+a.D; case -1E3:return 0}return a.D},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.$b(a.o);b.hasPrevious=a.Ge;b.hasNext=a.hasNext;b.playerTime=a.D;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.Q.call(this); this.o=0;this.A=a;this.C=[];this.B=new fra;this.w=this.u=null;this.H=(0,g.x)(this.aJ,this);this.D=(0,g.x)(this.wk,this);this.G=(0,g.x)(this.ZI,this);this.J=(0,g.x)(this.mJ,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.xt,this),Ura(this))):c=3;0!=c&&(b?this.xt(c):g.po((0,g.x)(function(){this.xt(c)},this),0)); var d=Sra();d&&Y7(this,d);this.subscribe("yt-remote-cast2-session-change",this.J)},$7=function(a){return new R7(a.A.getPlayerContextData())},Ura=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.C.push(this.A.subscribe(b,g.Oa(this.XK,b),this))},a)},Vra=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){Vra(a); a.A.setPlayerContextData(X7(b));Ura(a)},Y7=function(a,b){a.w&&(a.w.removeUpdateListener(a.H),a.w.removeMediaListener(a.D),a.wk(null)); a.w=b;a.w&&(i7("CP","Setting cast session: "+a.w.sessionId),a.w.addUpdateListener(a.H),a.w.addMediaListener(a.D),a.w.media.length&&a.wk(a.w.media[0]))},Wra=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.Jb("Failed to "+b+" with cast v2 channel. Error code: "+d.code); d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Jb("Retrying "+b+" using MDx browser channel."),d8(this,b,c))},a)},f8=function(a,b,c){g.Q.call(this); this.B=NaN;this.R=!1;this.G=this.D=this.H=this.J=NaN;this.L=[];this.A=this.C=this.w=this.Pa=this.o=null;this.U=a;this.L.push(g.Wq(window,"beforeunload",(0,g.x)(this.FD,this)));this.u=[];this.Pa=new R7;this.P=b.id;this.o=Xra(this,c);this.o.subscribe("handlerOpened",this.eJ,this);this.o.subscribe("handlerClosed",this.bJ,this);this.o.subscribe("handlerError",this.cJ,this);this.o.subscribe("handlerMessage",this.dJ,this);jra(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Pa.videoId; g.JM()&&g.Rw("yt-remote-session-video-id",d)},this)},g8=function(a){i7("conn",a)},Xra=function(a,b){return new c7(f7(a.U,"/bc"),b)},h8=function(a,b){a.S("proxyStateChange",b)},Yra=function(a){a.B=g.po((0,g.x)(function(){g8("Connecting timeout"); this.Vh(1)},a),2E4)},i8=function(a){g.ro(a.B); a.B=NaN},j8=function(a){g.ro(a.J); a.J=NaN},Zra=function(a){k8(a); a.H=g.po((0,g.x)(function(){l8(this,"getNowPlaying")},a),2E4)},k8=function(a){g.ro(a.H); a.H=NaN},asa=function(a,b){b&&(i8(a),j8(a)); b==(d7(a.o)&&isNaN(a.B))?b&&(h8(a,1),l8(a,"getSubtitlesTrack")):b?(a.Pv()&&a.Pa.reset(),h8(a,1),l8(a,"getNowPlaying"),$ra(a)):a.Vh(1)},bsa=function(a,b){var c=b.params.videoId; delete b.params.videoId;c==a.Pa.videoId&&(g.Wb(b.params)?a.Pa.o=null:a.Pa.o=b.params,a.S("remotePlayerChange"))},csa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10); a.Pa.listId=b.params.listId||a.Pa.listId;W7(a.Pa,c,d);a.S("remoteQueueChange")},esa=function(a,b){b.params=b.params||{}; csa(a,b);dsa(a,b);a.S("autoplayDismissed")},dsa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10); U7(a.Pa,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Pa.playerState&&(c=-1E3);a.Pa.playerState=c;c=Number(b.params.loadedTime);a.Pa.H=isNaN(c)?0:c;c=Number(b.params.duration);a.Pa.G=isNaN(c)?0:c;c=a.Pa;var d=Number(b.params.liveIngestionTime);c.w=d;c.B=isNaN(d)?!1:!0;c=a.Pa;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.Pa.playerState?Zra(a):k8(a);a.S("remotePlayerChange")},fsa=function(a,b){if(-1E3!= a.Pa.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.Pa.playerState=c;c=parseInt(b.params.currentTime,10);U7(a.Pa,isNaN(c)?0:c);a.S("remotePlayerChange")}},gsa=function(a,b){var c="true"==b.params.muted; a.Pa.volume=parseInt(b.params.volume,10);a.Pa.muted=c;a.S("remotePlayerChange")},hsa=function(a,b){a.C=b.params.videoId; a.S("nowAutoplaying",parseInt(b.params.timeout,10))},isa=function(a,b){var c="true"==b.params.hasNext; a.Pa.Ge="true"==b.params.hasPrevious;a.Pa.hasNext=c;a.S("previousNextChange")},$ra=function(a){g.ro(a.G); a.G=g.po((0,g.x)(a.Vh,a,1),864E5)},l8=function(a,b,c){c?g8("Sending: action="+b+", params="+g.Hk(c)):g8("Sending: action="+b); a.o.sendMessage(b,c)},m8=function(a){m7.call(this,"ScreenServiceProxy"); this.Uc=a;this.u=[];this.u.push(this.Uc.$_s("screenChange",(0,g.x)(this.cO,this)));this.u.push(this.Uc.$_s("onlineScreenChange",(0,g.x)(this.BK,this)))},nsa=function(a){var b={device:"Desktop", app:"youtube-desktop"};b=g.go("MDX_CONFIG")||b;Zpa();r6();n8||(n8=new e7(b?b.loungeApiHost:void 0),nqa()&&(n8.o="/api/loungedev"));o8||(o8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Da("yt.mdx.remote.deferredProxies_",o8,void 0));jsa();var c=p8();if(!c){var d=new v7(n8);g.Da("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);Ora(a,d,function(m){m?q8()&&Q7(q8(),"YouTube TV"):d.subscribe("onlineScreenChange", function(){e6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Da("yt.mdx.remote.initialized_",!0,void 0),r8("Initializing: "+g.Hk(b)),s8.push(g.wo("yt-remote-cast2-availability-change",function(){e6("yt-remote-receiver-availability-change")})),s8.push(g.wo("yt-remote-cast2-receiver-selected",function(){t8(null); e6("yt-remote-auto-connect","cast-selector-receiver")})),s8.push(g.wo("yt-remote-cast2-receiver-resumed",function(){e6("yt-remote-receiver-resumed","cast-selector-receiver")})),s8.push(g.wo("yt-remote-cast2-session-change",ksa)),s8.push(g.wo("yt-remote-connection-change",function(m){m?Q7(q8(),"YouTube TV"):u8()||(Q7(null,null),Rra())})),a=v8(),b.isAuto&&(a.id+="#dial"),g.gp("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.Hk(a)),lsa(a),c.start(),q8()||msa())},psa=function(){var a=osa(); N7()&&g.Sw("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},osa=function(){var a=p8().Uc.$_gos(); var b=w8();b&&x8()&&(m6(a,b)||a.push(b));return fqa(a)},y8=function(){var a=qsa(); !a&&N7()&&Qra()&&(a={key:"cast-selector-receiver",name:Qra()});return a},qsa=function(){var a=osa(),b=w8(); b||(b=u8());return g.Va(a,function(c){return b&&i6(b,c.key)?!0:!1})},w8=function(){var a=q8(); if(!a)return null;var b=p8().Ld();return n6(b,a)},ksa=function(a){r8("remote.onCastSessionChange_: "+j6(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_")},rsa=function(a){g.Da("yt.mdx.remote.currentScreenId_",a,void 0)},ssa=function(){return g.w("yt.mdx.remote.connectData_")},t8=function(a){g.Da("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||rsa("");g.Da("yt.mdx.remote.connection_",a,void 0);o8&&((0,g.y)(o8,function(c){c(a)}),o8.length=0); b&&!a?e6("yt-remote-connection-change",!1):!b&&a&&e6("yt-remote-connection-change",!0)},u8=function(){var a=g.JM(); if(!a)return null;var b=p8().Ld();return n6(b,a)},A8=function(a,b){q8(); w8()&&w8();if(E8)F8=a;else{rsa(a.id);var c=new f8(n8,a,v8());c.connect(b,ssa());c.subscribe("beforeDisconnect",function(d){e6("yt-remote-before-disconnect",d)}); c.subscribe("beforeDispose",function(){x8()&&(x8(),B8(null))}); B8(c)}},msa=function(){var a=u8(); a?(r8("Resume connection to: "+j6(a)),A8(a,0)):(s6(),Rra(),r8("Skipping connecting because no session screen found."))},jsa=function(){var a=v8(); if(g.Wb(a)){a=q6();var b=g.Sw("yt-remote-session-name")||"",c=g.Sw("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Da("yt.mdx.remote.channelParams_",a,void 0)}},v8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},lsa=function(a){a?(g.Rw("yt-remote-session-app",a.app),g.Rw("yt-remote-session-name",a.name)):(f6("yt-remote-session-app"),f6("yt-remote-session-name")); g.Da("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.R(this);g.B(this,this.w);this.w.M(b,"onCaptionsTrackListChanged",this.WJ);this.w.M(b,"captionschanged",this.YI);this.w.M(b,"captionssettingschanged",this.BA);this.w.M(b,"videoplayerreset",this.En);this.w.M(b,"mdxautoplaycancel",this.zC);this.P=this.w.M(b,"onVolumeChange",this.Uy);this.G=!1;this.o=c;c.subscribe("proxyStateChange",this.iz,this);c.subscribe("remotePlayerChange",this.yk,this);c.subscribe("remoteQueueChange",this.En,this);c.subscribe("autoplayUpNext",this.Jy, this);c.subscribe("previousNextChange",this.fz,this);c.subscribe("nowAutoplaying",this.bz,this);c.subscribe("autoplayDismissed",this.Iy,this);this.suggestion=null;this.H=new g.nF(64);this.A=new g.J(this.yA,500,this);g.B(this,this.A);this.C=new g.J(this.zA,1E3,this);g.B(this,this.C);this.R=new w6(this.FN,0,this);g.B(this,this.R);this.D={};this.L=new g.J(this.fB,1E3,this);g.B(this,this.L);this.J=new g.bl(this.lG,1E3,this);g.B(this,this.J);this.U=g.Ea;this.BA();this.En();this.yk()},H8=function(a,b){var c= a.B,d=a.u.getVideoData().lengthSeconds; c.L=b||0;c.player.S("progresssync",b,d)},tsa=function(a){H8(a,0); a.A.stop();I8(a,new g.nF(64))},K8=function(a,b){if(J8(a)&&!a.G){var c=null; b&&(c={style:a.u.getSubtitlesUserSettings()},g.bc(c,b));a.o.oA(a.u.getVideoData(1).videoId,c);a.D=$7(a.o).o}},L8=function(a,b){var c=a.u.getPlaylist(); if(c){var d=c.Ta;var e=c.listId.toString()}c=a.u.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.Ie,Spa(c));I8(a,new g.nF(1))},usa=function(a,b){if(b){var c=a.u.getOption("captions","tracklist",{TR: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.tF(c,b)){var d=g.V(b,2);d!=g.V(a.H,2)&&g.RT(a.u.app,d);a.H=b;vsa(a.B,c,b)}},M8=function(){g.X.call(this,{F:"div", I:"ytp-mdx-popup-dialog",N:{role:"dialog"},K:[{F:"div",I:"ytp-mdx-popup-dialog-inner-content",K:[{F:"div",I:"ytp-mdx-popup-title",W:"\u0412\u044b \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430"},{F:"div",I:"ytp-mdx-popup-description",W:'\u0420\u043e\u043b\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0435, \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 "\u041e\u0442\u043c\u0435\u043d\u0430" \u0438 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.'}, {F:"div",I:"ytp-mdx-privacy-popup-buttons",K:[{F:"button",X:["ytp-button","ytp-mdx-privacy-popup-cancel"],W:"\u041e\u0442\u043c\u0435\u043d\u0430"},{F:"button",X:["ytp-button","ytp-mdx-privacy-popup-confirm"],W:"\u041e\u041a"}]}]}]});this.w=new g.PM(this,250);g.B(this,this.w);this.D=this.u["ytp-mdx-privacy-popup-cancel"];this.M(this.D,"click",this.A);this.B=this.u["ytp-mdx-privacy-popup-confirm"];this.M(this.B,"click",this.C)},N8=function(a){g.X.call(this,{F:"div", I:"ytp-remote",K:[{F:"div",I:"ytp-remote-display-status",K:[{F:"div",I:"ytp-remote-display-status-icon",K:[g.RM()]},{F:"div",I:"ytp-remote-display-status-text",W:"{{statustext}}"}]}]});this.w=new g.PM(this,250);g.B(this,this.w);this.A=a;this.M(a,"presentingplayerstatechange",this.B);wsa(this,g.TK(a))},wsa=function(a,b){if(3==a.A.getPresentingPlayerType()){var c={RECEIVER_NAME:a.A.getOption("remote","currentReceiver").name}; c=g.V(b,128)?g.wN('\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.uF(b)||g.V(b,4)?g.wN('\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.wN('\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 "$RECEIVER_NAME"', c);a.updateValue("statustext",c);a.w.show()}else a.w.hide()},O8=function(a,b){g.sP.call(this,"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430",0,a,b); this.w=a;this.D={};this.M(a,"onMdxReceiversChange",this.L);this.M(a,"presentingplayerstatechange",this.L);this.L()},P8=function(a){g.BQ.call(this,a); this.u={key:l6(),name:"\u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440"};this.B=null;this.A=[];this.P=this.o=null;this.J=[this.u];this.w=this.u;this.D=new g.nF(64);this.L=0;this.H=-1;this.C=null;if(!g.Wx(this.player.O())){a=this.player;var b=g.AK(a);b&&(b=b.jk())&&(b=new O8(a,b),g.B(this,b));b=new N8(a);g.B(this,b);g.lL(a,b.element,4);this.C=new M8;g.B(this,this.C);g.lL(a,this.C.element,4);this.R=!!u8()}this.G=null},Q8=function(a){a.G&&(a.player.removeEventListener("presentingplayerstatechange", a.G),a.G=null)},vsa=function(a,b,c){a.D=c; a.player.S("presentingplayerstatechange",new g.zF(c,b))},R8=function(a,b){if(b.key!=a.w.key)if(b.key==a.u.key)z8(); else{var c;(c=!g.S(a.player.O().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.go("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.go("SESSION_INDEX")&&!g.go("LOGGED_IN")))||a.R||!a.C);if(c?0:a.player.O().eh()||"WEB_EMBEDDED_PLAYER"==a.player.O().deviceParams.c)g.uF(g.TK(a.player))?a.player.pauseVideo():(a.G=(0,g.x)(a.yM,a),a.player.addEventListener("presentingplayerstatechange",a.G)),a.C&&a.C.w.show(),x8()||(E8=!0);a.w=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1); var e=c.videoId;if(d||e){var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.va(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.Ie,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=Spa(c))&&(d.locationInfo=c);c=d}else c=null;r8("Connecting to: "+g.Hk(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?e6("yt-remote-connection-change",!0):(z8(),t8(c||null),c=p8().Ld(),(c=n6(c,b.key))&&A8(c,1))}},Dqa={"\x00":"\\0", "\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},I6={"'":"\\'"},xsa={},bqa={GO:"atp",cR:"ska",RQ:"que",tQ:"mus",bR:"sus",GP:"dsp",YQ:"seq"}; g6.prototype.ag=function(){var a=new g6({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 t6,p6="",sqa=oqa("loadCastFramework")||oqa("loadCastApplicationFramework"),Nra=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Qa(w6,g.A);g.h=w6.prototype;g.h.BD=function(a){this.A=arguments;this.o=!1;this.Fa?this.w=(0,g.E)()+this.Vc:this.Fa=g.qf(this.B,this.Vc)}; g.h.stop=function(){this.Fa&&(g.v.clearTimeout(this.Fa),this.Fa=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();w6.xb.Y.call(this)}; g.h.CD=function(){this.w?(this.Fa=g.qf(this.B,this.w-(0,g.E)()),this.w=null):(this.Fa=null,this.u?this.o=!0:(this.o=!1,this.C.apply(null,this.A)))};y6.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)}; y6.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};z6.prototype.o=null;z6.prototype.getOptions=function(){var a;(a=this.o)||(a={},wqa(this)&&(a[0]=!0,a[1]=!0),a=this.o=a);return a};var S8;g.Qa(vqa,z6);S8=new vqa;g.h=A6.prototype;g.h.ah=null;g.h.qe=!1;g.h.bj=null;g.h.qt=null;g.h.Oi=null;g.h.gi=null;g.h.Wf=null;g.h.Cg=null;g.h.xh=null;g.h.tc=null;g.h.Yk=0;g.h.xe=null;g.h.po=null;g.h.lg=null;g.h.Kj=-1;g.h.jA=!0;g.h.Mg=!1;g.h.Xp=0;g.h.Jn=null;var Bqa={},D6={};g.h=A6.prototype;g.h.setTimeout=function(a){this.B=a}; g.h.KM=function(a){a=a.target;var b=this.Jn;b&&3==R6(a)?b.rm():this.nB(a)}; g.h.nB=function(a){try{if(a==this.tc)a:{var b=R6(this.tc),c=this.tc.C,d=this.tc.getStatus();if(g.Ed&&!g.jd(10)||g.Gd&&!g.id("420+")){if(4>b)break a}else if(3>b||3==b&&!g.rh&&!T6(this.tc))break a;this.Mg||4!=b||7==c||(8==c||0>=d?this.o.pe(3):this.o.pe(2));K6(this);var e=this.tc.getStatus();this.Kj=e;var f=T6(this.tc);(this.qe=200==e)?(4==b&&G6(this),this.C?(Cqa(this,b,f),g.rh&&this.qe&&3==b&&(this.A.ha(this.u,"tick",this.EM),this.u.start())):F6(this,f),this.qe&&!this.Mg&&(4==b?this.o.Bn(this):(this.qe= !1,C6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.lg=3,E6(13)):(this.lg=0,E6(14)),G6(this),H6(this))}}catch(k){this.tc&&T6(this.tc)}finally{}}; g.h.EM=function(){var a=R6(this.tc),b=T6(this.tc);this.Yk<b.length&&(K6(this),Cqa(this,a,b),this.qe&&4!=a&&C6(this))}; g.h.bM=function(a){J6((0,g.x)(this.aM,this,a),0)}; g.h.aM=function(a){this.Mg||(K6(this),F6(this,a),C6(this))}; g.h.qz=function(a){J6((0,g.x)(this.ZL,this,a),0)}; g.h.ZL=function(a){this.Mg||(G6(this),this.qe=a,this.o.Bn(this),this.o.pe(4))}; g.h.cancel=function(){this.Mg=!0;G6(this)}; g.h.iM=function(){this.bj=null;var a=(0,g.E)();0<=a-this.qt?(2!=this.gi&&this.o.pe(3),G6(this),this.lg=2,E6(18),H6(this)):Fqa(this,this.qt-a)}; g.h.getLastError=function(){return this.lg};g.h=Iqa.prototype;g.h.Vp=null;g.h.yd=null;g.h.Kn=!1;g.h.Zv=null;g.h.Yl=null;g.h.Cq=null;g.h.Wp=null;g.h.be=null;g.h.Af=-1;g.h.Jj=null;g.h.mj=null;g.h.connect=function(a){this.Wp=a;a=M6(this.o,null,this.Wp);E6(3);this.Zv=(0,g.E)();var b=this.o.G;null!=b?(this.Jj=b[0],(this.mj=b[1])?(this.be=1,Jqa(this)):(this.be=2,O6(this))):(b6(a,"MODE","init"),this.yd=new A6(this,void 0,void 0,void 0),this.yd.ah=this.Vp,B6(this.yd,a,!1,null,!0),this.be=0)}; g.h.AC=function(a){if(a)this.be=2,O6(this);else{E6(4);var b=this.o;b.Fe=b.Zf.Af;$6(b,9)}a&&this.pe(2)}; g.h.rp=function(a){return this.o.rp(a)}; g.h.abort=function(){this.yd&&(this.yd.cancel(),this.yd=null);this.Af=-1}; g.h.Yv=function(){return!1}; g.h.jz=function(a,b){this.Af=a.Kj;if(0==this.be)if(b){try{var c=this.u.parse(b)}catch(d){c=this.o;c.Fe=this.Af;$6(c,2);return}this.Jj=c[0];this.mj=c[1]}else c=this.o,c.Fe=this.Af,$6(c,2);else if(2==this.be)if(this.Kn)E6(7),this.Cq=(0,g.E)();else if("11111"==b){if(E6(6),this.Kn=!0,this.Yl=(0,g.E)(),c=this.Yl-this.Zv,!g.Ed||g.jd(10)||500>c)this.Af=200,this.yd.cancel(),E6(12),N6(this.o,this,!0)}else E6(8),this.Yl=this.Cq=(0,g.E)(),this.Kn=!1}; g.h.Bn=function(){this.Af=this.yd.Kj;if(this.yd.qe)0==this.be?this.mj?(this.be=1,Jqa(this)):(this.be=2,O6(this)):2==this.be&&((!g.Ed||g.jd(10)?!this.Kn:200>this.Cq-this.Yl)?(E6(11),N6(this.o,this,!1)):(E6(12),N6(this.o,this,!0)));else{0==this.be?E6(9):2==this.be&&E6(10);var a=this.o;this.yd.getLastError();a.Fe=this.Af;$6(a,2)}}; g.h.Nk=function(){return this.o.Nk()}; g.h.isActive=function(){return this.o.isActive()}; g.h.pe=function(a){this.o.pe(a)};g.Qa(P6,g.De);var Oqa=/^https?$/i,ysa=["POST","PUT"];g.h=P6.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.Z=b;this.U=!1;this.w=!0;this.o=this.P?xqa(this.P):xqa(S8);this.L=this.P?this.P.getOptions():S8.getOptions();this.o.onreadystatechange=(0,g.x)(this.bw,this);try{d6(S6(this,"Opening Xhr")),this.da=!0,this.o.open(b,String(a),!0),this.da=!1}catch(f){d6(S6(this,"Error opening Xhr: "+f.message));Nqa(this,f);return}a=c|| "";var e=this.headers.clone();d&&Xpa(d,function(f,k){e.set(k,f)}); d=g.Va(e.Yd(),Lqa);c=g.v.FormData&&a instanceof g.v.FormData;!g.Ya(ysa,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.aa&&(this.o.responseType=this.aa);"withCredentials"in this.o&&this.o.withCredentials!==this.V&&(this.o.withCredentials=this.V);try{Qqa(this),0<this.D&&(this.R=Kqa(this.o),d6(S6(this,"Will abort after "+this.D+"ms if incomplete, xhr2 "+this.R)),this.R?(this.o.timeout=this.D,this.o.ontimeout=(0,g.x)(this.cw,this)):this.J=g.qf(this.cw,this.D,this)),d6(S6(this,"Sending request")),this.G=!0,this.o.send(a),this.G=!1}catch(f){d6(S6(this,"Send error: "+f.message)),Nqa(this,f)}}; g.h.cw=function(){"undefined"!=typeof g.Z_&&this.o&&(this.A="Timed out after "+this.D+"ms, aborting",this.C=8,S6(this,this.A),this.dispatchEvent("timeout"),this.abort(8))}; g.h.abort=function(a){this.o&&this.w&&(S6(this,"Aborting"),this.w=!1,this.B=!0,this.o.abort(),this.B=!1,this.C=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Q6(this))}; g.h.Y=function(){this.o&&(this.w&&(this.w=!1,this.B=!0,this.o.abort(),this.B=!1),Q6(this,!0));P6.xb.Y.call(this)}; g.h.bw=function(){this.ia()||(this.da||this.G||this.B?Pqa(this):this.ZK())}; g.h.ZK=function(){Pqa(this)}; g.h.isActive=function(){return!!this.o}; g.h.getStatus=function(){try{return 2<R6(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=U6.prototype;g.h.xj=null;g.h.rd=null;g.h.Sb=null;g.h.Up=null;g.h.dm=null;g.h.yu=null;g.h.sm=null;g.h.tk=0;g.h.qI=0;g.h.Sc=null;g.h.fg=null;g.h.lf=null;g.h.Rg=null;g.h.Zf=null;g.h.no=null;g.h.wi=-1;g.h.Hw=-1;g.h.Fe=-1;g.h.Xh=0;g.h.Rh=0;g.h.Ng=8;var a7=new g.De;g.Qa(Sqa,g.fe);g.Qa(Tqa,g.fe);g.Qa(Uqa,g.fe);g.h=U6.prototype;g.h.connect=function(a,b,c,d,e){E6(0);this.Up=b;this.xj=c||{};d&&void 0!==e&&(this.xj.OSID=d,this.xj.OAID=e);this.C?(J6((0,g.x)(this.Ru,this,a),100),Yqa(this)):this.Ru(a)}; g.h.Ru=function(a){this.Zf=new Iqa(this);this.Zf.Vp=null;this.Zf.u=this.B;this.Zf.connect(a)}; g.h.Yv=function(){return 0==this.o}; g.h.pz=function(a){this.fg=null;ara(this,a)}; g.h.oz=function(){this.lf=null;this.Sb=new A6(this,this.w,"rpc",this.D);this.Sb.ah=null;this.Sb.Xp=0;var a=this.yu.clone();$5(a,"RID","rpc");$5(a,"SID",this.w);$5(a,"CI",this.no?"0":"1");$5(a,"AID",this.wi);V6(this,a);if(!g.Ed||g.jd(10))$5(a,"TYPE","xmlhttp"),B6(this.Sb,a,!0,this.sm,!1);else{$5(a,"TYPE","html");var b=this.Sb,c=!!this.sm;b.gi=3;b.Wf=a6(a.clone());Eqa(b,c)}}; g.h.jz=function(a,b){if(0!=this.o&&(this.Sb==a||this.rd==a))if(this.Fe=a.Kj,this.rd==a&&3==this.o)if(7<this.Ng){try{var c=this.B.parse(b)}catch(f){c=null}if(g.Ia(c)&&3==c.length)if(0==c[0])a:{if(!this.lf){if(this.Sb)if(this.Sb.Oi+3E3<this.rd.Oi)X6(this),this.Sb.cancel(),this.Sb=null;else break a;Z6(this);E6(19)}}else this.Hw=c[1],0<this.Hw-this.wi&&37500>c[2]&&this.no&&0==this.Rh&&!this.Rg&&(this.Rg=J6((0,g.x)(this.UI,this),6E3));else $6(this,11)}else b!=xsa.eP.o&&$6(this,11);else if(this.Sb==a&& X6(this),!g.ub(b)){c=this.B.parse(b);g.Ia(c);for(var d=0;d<c.length;d++){var e=c[d];this.wi=e[0];e=e[1];2==this.o?"c"==e[0]?(this.w=e[1],this.sm=e[2],e=e[3],null!=e?this.Ng=e:this.Ng=6,this.o=3,this.Sc&&this.Sc.Mu(),this.yu=M6(this,this.Nk()?this.sm:null,this.Up),bra(this)):"stop"==e[0]&&$6(this,7):3==this.o&&("stop"==e[0]?$6(this,7):"noop"!=e[0]&&this.Sc&&this.Sc.Lu(e),this.Rh=0)}}}; g.h.UI=function(){null!=this.Rg&&(this.Rg=null,this.Sb.cancel(),this.Sb=null,Z6(this),E6(20))}; g.h.Bn=function(a){if(this.Sb==a){X6(this);this.Sb=null;var b=2}else if(this.rd==a)this.rd=null,b=1;else return;this.Fe=a.Kj;if(0!=this.o)if(a.qe)1==b?(b=(0,g.E)()-a.Oi,a7.dispatchEvent(new Tqa(a7,a.xh?a.xh.length:0,b,this.Xh)),W6(this),this.A.length=0):bra(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.Fe)){if(d=1==b)this.rd||this.fg||1==this.o||2<=this.Xh?d=!1:(this.fg=J6((0,g.x)(this.pz,this,a),cra(this,this.Xh)),this.Xh++,d=!0);d=!(d||2==b&&Z6(this))}if(d)switch(c){case 1:$6(this, 5);break;case 4:$6(this,10);break;case 3:$6(this,6);break;case 7:$6(this,12);break;default:$6(this,2)}}}; g.h.VC=function(a){if(!g.Ya(arguments,this.o))throw Error("Unexpected channel state: "+this.o);}; g.h.uN=function(a){a?E6(2):(E6(1),dra(this,8))}; g.h.rp=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new P6;a.V=!1;return a}; g.h.isActive=function(){return!!this.Sc&&this.Sc.isActive(this)}; g.h.pe=function(a){a7.dispatchEvent(new Uqa(a7,a))}; g.h.Nk=function(){return!(!g.Ed||g.jd(10))}; g.h=era.prototype;g.h.Mu=function(){}; g.h.Lu=function(){}; g.h.Ku=function(){}; g.h.kp=function(){}; g.h.yv=function(){return{}}; g.h.isActive=function(){return!0};g.h=fra.prototype;g.h.isEmpty=function(){return g.Za(this.o)&&g.Za(this.u)}; g.h.clear=function(){this.o=[];this.u=[]}; g.h.contains=function(a){return g.Ya(this.o,a)||g.Ya(this.u,a)}; g.h.remove=function(a){var b=this.o;var c=(0,g.xna)(b,a);0<=c?(g.ab(b,c),b=!0):b=!1;return b||g.bb(this.u,a)}; g.h.nd=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.Qa(b7,g.A);g.h=b7.prototype;g.h.SL=function(){this.Vc=Math.min(3E5,2*this.Vc);this.w();this.u&&this.start()}; g.h.start=function(){var a=this.Vc+15E3*Math.random();g.Tm(this.o,a);this.u=(0,g.E)()+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.Vc=5E3};g.Qa(c7,era);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.Jf=function(a){return this.w.bh(a)}; g.h.S=function(a,b){return this.w.S.apply(this.w,arguments)}; g.h.dispose=function(){this.fb||(this.fb=!0,g.de(this.w),ira(this),g.de(this.u),this.u=null)}; g.h.ia=function(){return this.fb}; 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 U6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.R),e=this.o;e&&(e.Sc=null);d.Sc=this;this.o=d;e?this.o.connect(a,b,this.C,e.w,e.wi):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.bc(c,b);this.u.isActive()||2==(this.o?this.o.o:0)?this.D.push(c):d7(this)&&Zqa(this.o,c)}; g.h.Mu=function(){this.u.reset();this.B=null;this.A=0;if(this.D.length){var a=this.D;this.D=[];for(var b=0,c=a.length;b<c;++b)Zqa(this.o,a[b])}this.S("handlerOpened")}; g.h.Ku=function(a){var b=2==a&&401==this.o.Fe;4==a||b||this.u.start();this.S("handlerError",a)}; g.h.kp=function(a){if(!this.u.isActive())this.S("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.D.push(d)}}; g.h.yv=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.bc(a,this.B);return a}; g.h.Lu=function(a){"S"==a[0]?this.H=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),Xqa(this.o)):this.S("handlerMessage",new gra(a[0],a[1]))}; g.h.WM=function(){this.u.isActive();var a=this.o,b=0;a.Sb&&b++;a.rd&&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 qra=(0,g.E)(),h7=null,k7=Array(50),j7=-1,l7=!1;g.Qa(m7,g.Q);m7.prototype.Ld=function(){return this.o}; m7.prototype.contains=function(a){return!!m6(this.o,a)}; m7.prototype.get=function(a){return a?n6(this.o,a):null}; m7.prototype.info=function(a){i7(this.D,a)};g.r(n7,g.Q);g.h=n7.prototype;g.h.start=function(){!this.o&&isNaN(this.Fa)&&this.rB()}; g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Fa)||(g.ro(this.Fa),this.Fa=NaN)}; g.h.Y=function(){this.stop();g.Q.prototype.Y.call(this)}; g.h.rB=function(){this.Fa=NaN;this.o=g.op(f7(this.C,"/pairing/get_screen"),{method:"POST",ub:{pairing_code:this.B},timeout:5E3,onSuccess:(0,g.x)(this.aO,this),onError:(0,g.x)(this.ZN,this),Qd:(0,g.x)(this.bO,this)})}; g.h.aO=function(a,b){this.o=null;var c=b.screen||{};c.dialId=this.w;c.name=this.A;this.S("pairingComplete",new h6(c))}; g.h.ZN=function(a){this.o=null;a.status&&404==a.status?this.u>=zsa.length?this.S("pairingFailed",Error("DIAL polling timed out")):(a=zsa[this.u],this.Fa=g.po((0,g.x)(this.rB,this),a),this.u++):this.S("pairingFailed",Error("Server error "+a.status))}; g.h.bO=function(){this.o=null;this.S("pairingFailed",Error("Server not responding"))}; var zsa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Qa(p7,m7);g.h=p7.prototype;g.h.start=function(){o7(this)&&this.S("screenChange");!g.Sw("yt-remote-lounge-token-expiration")&&ura(this);g.ro(this.u);this.u=g.po((0,g.x)(this.start,this),1E4)}; g.h.add=function(a,b){o7(this);rra(this,a);q7(this,!1);this.S("screenChange");b(a);a.token||ura(this)}; g.h.remove=function(a,b){var c=o7(this);tra(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.S("screenChange")}; g.h.ko=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.S("screenChange")}; g.h.Y=function(){g.ro(this.u);p7.xb.Y.call(this)}; g.h.MD=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.D,"Missed "+b+" lounge tokens.")}; g.h.LD=function(a){i7(this.D,"Requesting lounge tokens failed: "+a)};g.r(s7,g.Q);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.Sw("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.E)()-144E5<a?0:a)?u7(this):(this.A=(0,g.E)()+3E5,g.Rw("yt-remote-fast-check-period",this.A),this.As())}; g.h.isEmpty=function(){return g.Wb(this.o)}; g.h.update=function(){r7("Updating availability on schedule.");var a=this.C(),b=g.Jb(this.o,function(c,d){return c&&!!n6(a,d)},this); t7(this,b)}; g.h.Y=function(){g.ro(this.w);this.w=NaN;this.u&&(this.u.abort(),this.u=null);g.Q.prototype.Y.call(this)}; g.h.As=function(){g.ro(this.w);this.w=NaN;this.u&&this.u.abort();var a=xra(this);if(c6(a)){var b=f7(this.B,"/pairing/get_screen_availability");this.u=g7(this.B,b,{lounge_token:g.Pb(a).join(",")},(0,g.x)(this.vL,this,a),(0,g.x)(this.uL,this))}else t7(this,{}),u7(this)}; g.h.vL=function(a,b){this.u=null;var c=g.Pb(xra(this));if(g.pb(c,g.Pb(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.Jb("Changing Screen set during request."),this.As()}; g.h.uL=function(a){this.Jb("Screen availability failed: "+a);this.u=null;u7(this)}; g.h.Jb=function(a){i7("OnlineScreenService",a)};g.Qa(v7,m7);g.h=v7.prototype;g.h.start=function(){this.w.start();this.u.start();this.o.length&&(this.S("screenChange"),this.u.isEmpty()||this.S("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.ko=function(a,b,c,d){this.w.contains(a)?this.w.ko(a,b,c,d):(a="Updating name of unknown screen: "+a.name,i7(this.D,a),d(Error(a)))}; g.h.Ld=function(a){return a?this.o:g.db(this.o,(0,g.Rd)(this.A,function(b){return!this.contains(b)},this))}; g.h.sB=function(){return(0,g.Rd)(this.Ld(!0),function(a){return!!this.u.o[a.id]},this)}; g.h.tB=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.de(f);d(w7(this,k))},this)); f.subscribe("pairingFailed",function(k){g.de(f);e(k)}); f.start();return(0,g.x)(f.stop,f)}; g.h.dO=function(a,b,c,d){g.op(f7(this.C,"/pairing/get_screen"),{method:"POST",ub:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new h6(f.screen||{});if(!k.name||Bra(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);Bra(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), Qd:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})}; g.h.Y=function(){g.de(this.w);g.de(this.u);v7.xb.Y.call(this)}; g.h.TD=function(){Cra(this);this.S("screenChange");this.u.update()}; v7.prototype.dispose=v7.prototype.dispose;g.Qa(y7,g.Q);g.h=y7.prototype;g.h.Dn=function(a){this.w=a;this.S("sessionScreen",this.w)}; g.h.Pd=function(a){this.ia()||(a&&z7(this,""+a),this.w=null,this.S("sessionScreen",null))}; g.h.info=function(a){i7(this.L,a)}; g.h.vB=function(){return null}; g.h.Is=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.Is("");y7.xb.Y.call(this)};g.Qa(A7,y7);g.h=A7.prototype;g.h.Hs=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);Era(this)}; g.h.xi=function(a){this.info("launchWithParams no-op for Cast: "+g.Hk(a))}; g.h.stop=function(){this.o?this.o.stop((0,g.x)(function(){this.Pd()},this),(0,g.x)(function(){this.Pd(Error("Failed to stop receiver app."))},this)):this.Pd(Error("Stopping cast device witout session."))}; g.h.Is=g.Ea;g.h.Y=function(){this.info("disposeInternal");g.ro(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.xb.Y.call(this)}; g.h.tM=function(a,b){if(!this.ia())if(b){var c=x6(b);if(g.La(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Hk(c));switch(d){case "mdxSessionStatus":Dra(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.Rv=function(a,b,c,d){Ara(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.po((0,g.x)(this.Rv,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)}; g.h.vB=function(){return this.o}; g.h.eO=function(a){this.ia()||a||(z7(this,"Cast session died."),this.Pd())};g.Qa(B7,y7);g.h=B7.prototype;g.h.Hs=function(a){this.A=a;this.A.addUpdateListener(this.R)}; g.h.xi=function(a){this.B=a;this.D()}; g.h.stop=function(){this.o();this.o=g.Ea;g.ro(this.C);this.A?this.A.stop((0,g.x)(this.Pd,this,null),(0,g.x)(this.Pd,this,"Failed to stop DIAL device.")):this.Pd()}; g.h.Y=function(){this.o();this.o=g.Ea;g.ro(this.C);this.A&&this.A.removeUpdateListener(this.R);this.A=null;B7.xb.Y.call(this)}; g.h.hO=function(a){this.ia()||a||(z7(this,"DIAL session died."),this.o(),this.o=g.Ea,this.Pd())}; g.h.lq=function(a){this.J=l6();if(this.B){var b=new chrome.cast.DialLaunchResponse(!0,Gra(this));a(b);Fra(this)}else this.D=(0,g.x)(function(){g.ro(this.C);this.D=g.Ea;this.C=NaN;var c=new chrome.cast.DialLaunchResponse(!0,Gra(this));a(c);Fra(this)},this),this.C=g.po((0,g.x)(function(){this.D()},this),100)}; g.h.oE=function(a,b,c){Ara(this.H,this.G.receiver.label,a,this.u.friendlyName,(0,g.x)(function(d){d&&d.token?(this.Dn(d),b(new chrome.cast.DialLaunchResponse(!1))):this.lq(b,c)},this),(0,g.x)(function(d){z7(this,"Failed to get DIAL screen: "+d); this.lq(b,c)},this))};g.Qa(C7,y7);C7.prototype.stop=function(){this.Pd()}; C7.prototype.Hs=g.Ea;C7.prototype.xi=function(){g.ro(this.o);this.o=NaN;var a=n6(this.H.Ld(),this.u.label);a?this.Dn(a):this.Pd(Error("No such screen"))}; C7.prototype.Y=function(){g.ro(this.o);this.o=NaN;C7.xb.Y.call(this)};g.Qa(D7,g.Q);g.h=D7.prototype; g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.D);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.eL,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.lz,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.tJ,this);chrome.cast.initialize(c,(0,g.x)(function(){this.ia()|| (chrome.cast.addReceiverActionListener(this.A),nra(),this.u.subscribe("onlineScreenChange",(0,g.x)(this.uB,this)),this.w=Ira(this),chrome.cast.setCustomReceivers(this.w,g.Ea,(0,g.x)(function(k){this.Jb("Failed to set initial custom receivers: "+g.Hk(k))},this)),this.S("yt-remote-cast2-availability-change",F7(this)),b(!0))},this),(0,g.x)(function(k){this.Jb("Failed to initialize API: "+g.Hk(k)); b(!1)},this))}; g.h.eN=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=n6(this.u.Ld(),a);if(!c){E7("setConnectedScreenStatus: Unknown screen.");return}var d=Hra(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.Ea,(0,g.x)(function(e){this.Jb("Failed to set initial custom receivers: "+g.Hk(e))},this))); E7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);G7(this,new C7(this.u,d),!0)}this.o.Is(b)}else E7("setConnectedScreenStatus: no screen.")}; g.h.fN=function(a){this.ia()?this.Jb("Setting connection data on disposed cast v2"):this.o?this.o.xi(a):this.Jb("Setting connection data without a session")}; g.h.gO=function(){this.ia()?this.Jb("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.lz,this),(0,g.x)(this.BL,this))}; g.h.Y=function(){this.u.unsubscribe("onlineScreenChange",(0,g.x)(this.uB,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);var a=kra,b=g.w("yt.mdx.remote.debug.handlers_");g.bb(b||[],a);g.de(this.o);D7.xb.Y.call(this)}; g.h.Jb=function(a){i7("Controller",a)}; g.h.mz=function(a,b){this.o==a&&(b||G7(this,null),this.S("yt-remote-cast2-session-change",b))}; g.h.aL=function(a,b){if(!this.ia())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.S("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.Jb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.o&&this.o.u.label==a.label?this.o.stop():this.Jb("Stopping receiver w/o session: "+a.friendlyName)}else this.Jb("onReceiverAction_ called without receiver.")}; g.h.tJ=function(a){if(this.ia())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Jb("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.Jb("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.S("yt-remote-cast2-session-change",this.o.w),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Jb('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.oE,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.x)(b.lq,b))}; g.h.lz=function(a){if(!this.ia()){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.Jb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.o.u,d=n6(this.u.Ld(),c.label);d&&i6(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.de(this.o),this.o=new A7(this.u,b),this.o.subscribe("sessionScreen",(0,g.x)(this.mz,this,this.o)),this.o.xi(null));this.o.Hs(a)}}}; g.h.fO=function(){return this.o?this.o.vB():null}; g.h.BL=function(a){this.ia()||(this.Jb("Failed to estabilish a session: "+g.Hk(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&G7(this,null))}; g.h.eL=function(a){E7("Receiver availability updated: "+a);if(!this.ia()){var b=F7(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;F7(this)!=b&&this.S("yt-remote-cast2-availability-change",F7(this))}}; g.h.uB=function(){this.ia()||(this.w=Ira(this),E7("Updating custom receivers: "+g.Hk(this.w)),chrome.cast.setCustomReceivers(this.w,g.Ea,(0,g.x)(function(){this.Jb("Failed to set custom receivers.")},this)),this.S("yt-remote-cast2-availability-change",F7(this)))}; D7.prototype.setLaunchParams=D7.prototype.fN;D7.prototype.setConnectedScreenStatus=D7.prototype.eN;D7.prototype.stopSession=D7.prototype.gO;D7.prototype.getCastSession=D7.prototype.fO;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.Ge=a.hasPrevious,this.hasNext=a.hasNext,this.D=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.Q);g.h=Z7.prototype;g.h.play=function(){1==this.o?(this.u?this.u.play(null,g.Ea,e8(this,"play")):d8(this,"play"),c8(this,1,V7($7(this))),this.S("remotePlayerChange")):a8(this,this.play)}; g.h.pause=function(){1==this.o?(this.u?this.u.pause(null,g.Ea,e8(this,"pause")):d8(this,"pause"),c8(this,2,V7($7(this))),this.S("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.Ea,e8(this,"seekTo",{newTime:a}))}else d8(this,"seekTo",{newTime:a});c8(this,3,a);this.S("remotePlayerChange")}else a8(this,g.Oa(this.seekTo,a))}; g.h.stop=function(){if(1==this.o){this.u?this.u.stop(null,g.Ea,e8(this,"stopVideo")):d8(this,"stopVideo");var a=$7(this);a.index=-1;a.videoId="";S7(a);b8(this,a);this.S("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.Jb("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.Jb("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.Oa(this.setVolume,a,b))}; g.h.oA=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.Hk(b.style),g.bc(d,c.o));d8(this,"setSubtitlesTrack",d);b8(this,c)}else a8(this,g.Oa(this.oA,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.Oa(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.Hk(k));d8(this,"setPlaylist",m);d||b8(this,l)}; g.h.qB=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.Oa(this.qB,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.Oa(this.nextVideo,a,b))}; g.h.Yu=function(){1==this.o?d8(this,"dismissAutoplay"):a8(this,this.Yu)}; g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.S("proxyStateChange",a,this.o)}g.Q.prototype.dispose.call(this)}; g.h.Y=function(){Vra(this);this.A=null;this.B.clear();Y7(this,null);g.Q.prototype.Y.call(this)}; g.h.xt=function(a){if((a!=this.o||2==a)&&3!=this.o&&0!=a){var b=this.o;this.o=a;this.S("proxyStateChange",b,a);if(1==a)for(;!this.B.isEmpty();)b=a=this.B,g.Za(b.o)&&(b.o=b.u,b.o.reverse(),b.u=[]),a.o.pop().apply(this);else 3==a&&this.dispose()}}; g.h.XK=function(a,b){this.S(a,b)}; g.h.aJ=function(a){if(!a)this.wk(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.wk=function(a){i7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.G);if(this.u=a)this.u.addUpdateListener(this.G),Wra(this),this.S("remotePlayerChange")}; g.h.ZI=function(a){a?(Wra(this),this.S("remotePlayerChange")):this.wk(null)}; g.h.mJ=function(){var a=Sra();a&&Y7(this,a)}; g.h.Jb=function(a){i7("CP",a)};g.r(f8,g.Q);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.Pa.listId=c);this.Pa.videoId=d;this.Pa.index=k||0;this.Pa.state=3;U7(this.Pa,m);this.A="UNSUPPORTED";g8("Connecting with setPlaylist and params: "+g.Hk(l));this.o.connect({method:"setPlaylist", params:g.Hk(l)},a,iqa())}else g8("Connecting without params"),this.o.connect({},a,iqa());Yra(this)}; g.h.dispose=function(){this.ia()||(this.S("beforeDispose"),h8(this,3));g.Q.prototype.dispose.call(this)}; g.h.Y=function(){i8(this);k8(this);j8(this);g.ro(this.D);this.D=NaN;g.ro(this.G);this.G=NaN;this.w=null;g.Xq(this.L);this.L.length=0;this.o.dispose();g.Q.prototype.Y.call(this);this.A=this.C=this.u=this.Pa=this.o=null}; g.h.FD=function(){this.Vh(2)}; g.h.eJ=function(){g8("Channel opened");this.R&&(this.R=!1,j8(this),this.J=g.po((0,g.x)(function(){g8("Timing out waiting for a screen.");this.Vh(1)},this),15E3)); mqa(hra(this.o),this.P)}; g.h.bJ=function(){g8("Channel closed");isNaN(this.B)?s6(!0):s6();this.dispose()}; g.h.cJ=function(a){s6();isNaN(this.Dj())?(g8("Channel error: "+a+" without reconnection"),this.dispose()):(this.R=!0,g8("Channel error: "+a+" with reconnection in "+this.Dj()+" ms"),h8(this,2))}; g.h.dJ=function(a){a.params?g8("Received: action="+a.action+", params="+g.Hk(a.params)):g8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=x6(a.params.devices);this.u=(0,g.H)(a,function(c){return new g6(c)}); a=!!g.Va(this.u,function(c){return"LOUNGE_SCREEN"==c.type}); asa(this,a);break;case "loungeScreenDisconnected":g.cb(this.u,function(c){return"LOUNGE_SCREEN"==c.type}); asa(this,!1);break;case "remoteConnected":var b=new g6(x6(a.params.device));g.Va(this.u,function(c){return b?c.id==b.id:!1})||Tpa(this.u,b); break;case "remoteDisconnected":b=new g6(x6(a.params.device));g.cb(this.u,function(c){return b?c.id==b.id:!1}); break;case "gracefulDisconnect":break;case "playlistModified":csa(this,a);break;case "nowPlaying":esa(this,a);break;case "onStateChange":dsa(this,a);break;case "onAdStateChange":fsa(this,a);break;case "onVolumeChanged":gsa(this,a);break;case "onSubtitlesTrackChanged":bsa(this,a);break;case "nowAutoplaying":hsa(this,a);break;case "autoplayDismissed":this.S("autoplayDismissed");break;case "autoplayUpNext":this.C=a.params.videoId||null;this.S("autoplayUpNext",this.C);break;case "onAutoplayModeChanged":this.A= a.params.autoplayMode;this.S("autoplayModeChange",this.A);"DISABLED"==this.A&&this.S("autoplayDismissed");break;case "onHasPreviousNextChanged":isa(this,a);break;case "requestAssistedSignIn":this.S("assistedSignInRequested",a.params.authCode);break;default:g8("Unrecognized action: "+a.action)}}; g.h.TM=function(){if(this.w){var a=this.w;this.w=null;this.Pa.videoId!=a&&l8(this,"getNowPlaying")}}; g.h.uD=function(){var a=3;this.ia()||(a=0,isNaN(this.Dj())?d7(this.o)&&isNaN(this.B)&&(a=1):a=2);return a}; g.h.Vh=function(a){g8("Disconnecting with "+a);i8(this);this.S("beforeDisconnect",a);1==a&&s6();ira(this.o,a);this.dispose()}; g.h.tD=function(){var a=this.Pa;this.w&&(a=this.Pa.clone(),W7(a,this.w,a.index));return X7(a)}; g.h.gN=function(a){var b=new R7(a);b.videoId&&b.videoId!=this.Pa.videoId&&(this.w=b.videoId,g.ro(this.D),this.D=g.po((0,g.x)(this.TM,this),5E3));var c=[];this.Pa.listId==b.listId&&this.Pa.videoId==b.videoId&&this.Pa.index==b.index||c.push("remoteQueueChange");this.Pa.playerState==b.playerState&&this.Pa.volume==b.volume&&this.Pa.muted==b.muted&&V7(this.Pa)==V7(b)&&g.Hk(this.Pa.o)==g.Hk(b.o)||c.push("remotePlayerChange");this.Pa.reset(a);(0,g.y)(c,function(d){this.S(d)},this)}; g.h.Pv=function(){var a=this.o.C.id,b=g.Va(this.u,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a}); return b?b.id:""}; g.h.Dj=function(){var a=this.o;return a.u.isActive()?a.u.u-(0,g.E)():NaN}; g.h.iD=function(){return this.A||"UNSUPPORTED"}; g.h.jD=function(){return this.C||""}; g.h.YN=function(){if(!isNaN(this.Dj())){var a=this.o.u;g.Um(a.o);a.start()}}; g.h.bN=function(a,b){l8(this,a,b);$ra(this)}; f8.prototype.subscribe=f8.prototype.subscribe;f8.prototype.unsubscribeByKey=f8.prototype.Jf;f8.prototype.getProxyState=f8.prototype.uD;f8.prototype.disconnect=f8.prototype.Vh;f8.prototype.getPlayerContextData=f8.prototype.tD;f8.prototype.setPlayerContextData=f8.prototype.gN;f8.prototype.getOtherConnectedRemoteId=f8.prototype.Pv;f8.prototype.getReconnectTimeout=f8.prototype.Dj;f8.prototype.getAutoplayMode=f8.prototype.iD;f8.prototype.getAutoplayVideoId=f8.prototype.jD;f8.prototype.reconnect=f8.prototype.YN; f8.prototype.sendMessage=f8.prototype.bN;g.r(m8,m7);g.h=m8.prototype;g.h.Ld=function(a){return this.Uc.$_gs(a)}; g.h.contains=function(a){return!!this.Uc.$_c(a)}; g.h.get=function(a){return this.Uc.$_g(a)}; g.h.start=function(){this.Uc.$_st()}; g.h.add=function(a,b,c){this.Uc.$_a(a,b,c)}; g.h.remove=function(a,b,c){this.Uc.$_r(a,b,c)}; g.h.ko=function(a,b,c,d){this.Uc.$_un(a,b,c,d)}; g.h.Y=function(){for(var a=0,b=this.u.length;a<b;++a)this.Uc.$_ubk(this.u[a]);this.u.length=0;this.Uc=null;m7.prototype.Y.call(this)}; g.h.cO=function(){this.S("screenChange")}; g.h.BK=function(){this.S("onlineScreenChange")}; v7.prototype.$_st=v7.prototype.start;v7.prototype.$_gspc=v7.prototype.dO;v7.prototype.$_gsppc=v7.prototype.tB;v7.prototype.$_c=v7.prototype.contains;v7.prototype.$_g=v7.prototype.get;v7.prototype.$_a=v7.prototype.add;v7.prototype.$_un=v7.prototype.ko;v7.prototype.$_r=v7.prototype.remove;v7.prototype.$_gs=v7.prototype.Ld;v7.prototype.$_gos=v7.prototype.sB;v7.prototype.$_s=v7.prototype.subscribe;v7.prototype.$_ubk=v7.prototype.Jf;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.R.stop();this.U();this.o.unsubscribe("proxyStateChange",this.iz,this);this.o.unsubscribe("remotePlayerChange",this.yk,this);this.o.unsubscribe("remoteQueueChange",this.En,this);this.o.unsubscribe("autoplayUpNext",this.Jy,this);this.o.unsubscribe("previousNextChange",this.fz,this);this.o.unsubscribe("nowAutoplaying",this.bz,this);this.o.unsubscribe("autoplayDismissed",this.Iy,this);this.o=this.B=null}; g.h.Ex=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.rm(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.YI=function(a){this.R.BD(a)}; g.h.FN=function(a){this.Ex("control_subtitles_set_track",g.Wb(a)?null:a)}; g.h.BA=function(){var a=this.u.getOption("captions","track");g.Wb(a)||K8(this,a)}; g.h.Uy=function(a){if(J8(this)){this.o.unsubscribe("remotePlayerChange",this.yk,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.L.start();this.o.subscribe("remotePlayerChange",this.yk,this)}}; g.h.WJ=function(){g.Wb(this.D)||usa(this,this.D);this.G=!1}; g.h.iz=function(a,b){this.C.stop();2==b&&this.zA()}; g.h.yk=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.nF(8));this.yA();break;case 1085:case 3:I8(this,new g.nF(9));break;case 1083:case 0:I8(this,new g.nF(2));this.J.stop();H8(this,this.u.getVideoData().lengthSeconds);break;case 1084:I8(this,new g.nF(4));break;case 2:I8(this,new g.nF(4));H8(this,V7(a)); break;case -1:I8(this,new g.nF(64));break;case -1E3:I8(this,new g.nF(128,{errorCode:"mdx.remoteerror",errorMessage:"\u0412\u0438\u0434\u0435\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f."}))}a=$7(this.o).o;var b=this.D;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&& a.kind==b.kind:1)||(this.D=a,usa(this,a));a=$7(this.o);-1==a.volume||Math.round(this.u.getVolume())==a.volume&&this.u.isMuted()==a.muted||this.L.isActive()||this.fB()}else tsa(this)}; g.h.fz=function(){this.u.S("mdxpreviousnextchange")}; g.h.En=function(){J8(this)||tsa(this)}; g.h.zC=function(){this.o.Yu()}; g.h.Jy=function(){}; g.h.bz=function(a){isNaN(a)||this.u.S("mdxnowautoplaying",a)}; g.h.Iy=function(){this.u.S("mdxautoplaycanceled")}; g.h.lG=function(a,b){-1==$7(this.o).playerState?L8(this,a):b&&this.o.seekTo(a)}; g.h.fB=function(){if(J8(this)){var a=$7(this.o);this.w.Ua(this.P);a.muted?this.u.mute():this.u.unMute();this.u.setVolume(a.volume);this.P=this.w.M(this.u,"onVolumeChange",this.Uy)}}; g.h.yA=function(){this.A.stop();if(!this.o.ia()){var a=$7(this.o);1==a.playerState&&I8(this,new g.nF(8));H8(this,V7(a));this.A.start()}}; g.h.zA=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.X);M8.prototype.A=function(){e6("mdx-privacy-popup-cancel");this.w.hide()}; M8.prototype.C=function(){e6("mdx-privacy-popup-confirm");this.w.hide()};g.r(N8,g.X);N8.prototype.B=function(a){wsa(this,a.state)};g.r(O8,g.sP);O8.prototype.L=function(){var a=this.w.getOption("remote","receivers");a&&1<a.length&&!this.w.getOption("remote","quickCast")?(this.D=g.rb(a,this.C,this),g.uP(this,(0,g.H)(a,this.C)),a=this.w.getOption("remote","currentReceiver"),this.fe(this.C(a)),this.enable(!0)):this.enable(!1)}; O8.prototype.C=function(a){return a.key}; O8.prototype.ne=function(a){return"cast-selector-receiver"==a?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":this.D[a].name}; O8.prototype.Nc=function(a){g.sP.prototype.Nc.call(this,a);this.w.setOption("remote","currentReceiver",this.D[a]);this.A.bb()};g.r(P8,g.BQ);g.h=P8.prototype; g.h.create=function(){nsa(g.Nx(this.player.O()));this.A.push(g.wo("yt-remote-before-disconnect",this.VI,this));this.A.push(g.wo("yt-remote-connection-change",this.fL,this));this.A.push(g.wo("yt-remote-receiver-availability-change",this.gz,this));this.A.push(g.wo("yt-remote-auto-connect",this.dL,this));this.A.push(g.wo("yt-remote-receiver-resumed",this.cL,this));this.A.push(g.wo("mdx-privacy-popup-confirm",this.HM,this));this.A.push(g.wo("mdx-privacy-popup-cancel",this.GM,this));this.gz()}; g.h.load=function(){this.player.cancelPlayback();g.BQ.prototype.load.call(this);this.B=new G8(this,this.player,this.o);var a=(a=ssa())?a.currentTime:0;var b=C8()?new Z7(x8(),void 0):null;0==a&&b&&(a=V7($7(b)));0!=a&&(this.L=a||0,this.player.S("progresssync",a,void 0));vsa(this,this.D,this.D);g.XT(this.player.app,6)}; g.h.unload=function(){this.player.S("mdxautoplaycanceled");this.w=this.u;g.ee(this.B,this.o);this.o=this.B=null;g.BQ.prototype.unload.call(this);g.XT(this.player.app,5);Q8(this)}; g.h.Y=function(){g.xo(this.A);g.BQ.prototype.Y.call(this)}; g.h.hk=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.Ex.apply(this.B,[a].concat(g.ea(c)))}; g.h.getAdState=function(){return this.H}; g.h.wD=function(){return this.loaded?this.B.suggestion:null}; g.h.Ge=function(){return this.o?$7(this.o).Ge:!1}; g.h.hasNext=function(){return this.o?$7(this.o).hasNext:!1}; g.h.getCurrentTime=function(){return this.L}; g.h.getProgressState=function(){var a=$7(this.o),b=this.player.getVideoData();return{allowSeeking:g.S(this.player.O().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.lc():!a.isAdPlaying()&&this.player.lc(),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.ZF=function(){this.o&&this.o.qB()}; g.h.VI=function(a){1==a&&(this.P=this.o?$7(this.o):null)}; g.h.fL=function(){var a=C8()?new Z7(x8(),void 0):null;if(a){var b=this.w;this.loaded&&this.unload();this.o=a;this.P=null;b.key!=this.u.key&&(this.w=b,this.load())}else g.de(this.o),this.o=null,this.loaded&&(this.unload(),(a=this.P)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,V7(a)));this.player.S("videodatachange","newdata",this.player.getVideoData(),3)}; g.h.gz=function(){this.J=[this.u].concat(psa());var a=y8()||this.u;R8(this,a);this.player.ma("onMdxReceiversChange")}; g.h.yM=function(a){!this.R&&g.BF(a,8)&&(this.player.pauseVideo(),Q8(this))}; g.h.dL=function(){var a=y8();R8(this,a)}; g.h.cL=function(){this.w=y8()}; g.h.HM=function(){this.R=!0;Q8(this);E8=!1;F8&&A8(F8,1);F8=null}; g.h.GM=function(){this.R=!1;Q8(this);R8(this,this.u);this.w=this.u;E8=!1;F8=null;this.player.playVideo()}; g.h.xc=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.aG=function(){d8(this.o,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.h.Ye=function(){return!1}; g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.RQ.remote=P8;})(_yt_player);
/var/files/./need-2-delete/mini-borishof.ru1/upload/accessories/all-about-accessories/remote.js