(function(g){var window=this;var bua=function(a,b){return g.Yb(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.I)()).toString(36));
return a},$5=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
g.bn(a.w,b,c)},cua=function(a,b){var c=[];
g.ik(b,function(d){try{var e=g.eo.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.co(e)&&c.push(d)},a);
return c},dua=function(a,b){var c=cua(a,b);
(0,g.y)(c,function(d){g.eo.prototype.remove.call(this,d)},a)},eua=function(a,b){g.bb(a,b)||a.push(b)},a6=function(a){var b=0,c;
for(c in a)b++;return b},fua=function(a,b){var c=b instanceof g.Bc?b:g.Fc(b,/^data:image\//i.test(b));
a.src=g.Cc(c)},b6=function(){},gua=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);},hua=function(a){if(a.Bd&&"function"==typeof a.Bd)return a.Bd();
if("string"===typeof a)return a.split("");if(g.Ma(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Ub(a)},iua=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.Ma(a)||"string"===typeof a)(0,g.y)(a,b,void 0);else{if(a.te&&"function"==typeof a.te)var c=a.te();else if(a.Bd&&"function"==typeof a.Bd)c=void 0;else if(g.Ma(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Vb(a);d=hua(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},jua=function(a,b,c,d){var e=new g.Qm(null,void 0);
a&&g.Rm(e,a);b&&g.Sm(e,b);c&&g.Tm(e,c);d&&(e.u=d);return e},c6=function(a,b){g.Mo[a]=!0;
var c=g.Ko();c&&c.publish.apply(c,arguments);g.Mo[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.Nm;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",kua(this,a.capabilities||""),lua(this,a.experiments||""),this.u=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey||
"")},kua=function(a,b){a.capabilities.clear();
(0,g.ae)(b.split(","),g.Ra(bua,mua)).forEach(function(c){a.capabilities.add(c)})},lua=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)},nua=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},oua=function(a){return new e6(a)},pua=function(a){return g.La(a)?(0,g.A)(a,oua):[]},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.La(a)?"["+(0,g.A)(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)})},qua=function(a){return(0,g.A)(a,function(b){return{key:b.id,
name:b.name}})},j6=function(a,b){return g.Za(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},k6=function(a,b){return g.Za(a,function(c){return f6(c,b)})},l6=function(a){try{var b=(0,g.ms)(),c=(0,g.ls)();
b&&b.remove(a);c&&c.remove(a)}catch(d){}},rua=function(){var a=(0,g.ls)();
a&&dua(a,a.o.Jf(!0))},m6=function(){var a=g.os("yt-remote-connected-devices")||[];
g.sb(a);return a},sua=function(a){if(g.cb(a))return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.A)(a,function(d,e){return 0==e?d:d.substring(c.length)})},tua=function(a){g.ns("yt-remote-connected-devices",a,86400)},o6=function(){if(n6)return n6;
var a=g.os("yt-remote-device-id");a||(a=i6(),g.ns("yt-remote-device-id",a,31536E3));for(var b=m6(),c=1,d=a;g.bb(b,d);)c++,d=a+"#"+c;return n6=d},p6=function(){var a=m6(),b=o6();
g.bb(a,b);g.ps()&&g.vb(a,b);a=sua(a);if(g.cb(a))try{g.dr("remote_sid")}catch(c){}else try{g.br("remote_sid",a.join(","),-1)}catch(c){}},uua=function(){return g.os("yt-remote-session-browser-channel")},vua=function(){return g.os("yt-remote-local-screens")||[]},wua=function(){g.ns("yt-remote-lounge-token-expiration",!0,86400)},xua=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.A)(vua(),function(d){return d.loungeToken}),c=(0,g.A)(a,function(d){return d.loungeToken});
(0,g.si)(c,function(d){return!g.bb(b,d)})&&wua();
g.ns("yt-remote-local-screens",a,31536E3)},yua=function(a,b){g.ns("yt-remote-session-browser-channel",a);
g.ns("yt-remote-session-screen-id",b);var c=m6(),d=o6();g.bb(c,d)||c.push(d);tua(c);p6()},q6=function(a){a||(l6("yt-remote-session-screen-id"),l6("yt-remote-session-video-id"));
p6();a=m6();g.fb(a,o6());tua(a)},zua=function(){if(!r6){var a=g.po();
a&&(r6=new g.Yn(a))}return r6?!!r6.get("yt-remote-use-staging-server"):!1},Aua=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},Bua=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},s6=function(a){a.length?Cua(a.shift(),function(){s6(a)}):t6()},Dua=function(a){return"chrome-extension://"+a+"/cast_sender.js"},Cua=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=Bua();
a&&a(!1,"No cast extension found")},Fua=function(){if(Eua){var a=2,b=Bua(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;Cua("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",t6,c)}},Gua=function(){Fua();
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(){},Hua=function(){},Jua=function(a){return(a=Iua(a))?new ActiveXObject(a):new XMLHttpRequest},Iua=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.B.call(this);
this.w=null!=c?(0,g.x)(a,c):a;this.rd=b;this.u=(0,g.x)(this.cF,this);this.o=[]},w6=function(a){a.Da=g.Bf(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.T1(this);this.u=new g.Af;this.u.setInterval(250)},Lua=function(a,b,c){a.Xi=1;
a.Bg=Z5(b.clone());a.ni=c;a.C=!0;Kua(a,null)},y6=function(a,b,c,d,e){a.Xi=1;
a.Bg=Z5(b.clone());a.ni=null;a.C=c;e&&(a.QB=!1);Kua(a,d)},Kua=function(a,b){a.Hj=(0,g.I)();
z6(a);a.mh=a.Bg.clone();$5(a.mh,"t",a.F);a.mm=0;a.Jc=a.o.Kq(a.o.Yl()?b:null);0<a.xr&&(a.Vo=new v6((0,g.x)(a.PC,a,a.Jc),a.xr));a.A.ia(a.Jc,"readystatechange",a.gO);var c=a.Sh?g.dc(a.Sh):{};a.ni?(a.Fp="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Jc.send(a.mh,a.Fp,a.ni,c)):(a.Fp="GET",a.QB&&!g.Qd&&(c.Connection="close"),a.Jc.send(a.mh,a.Fp,null,c));a.o.Te(1)},Oua=function(a,b,c){for(var d=!0;!a.Ch&&a.mm<c.length;){var e=Mua(a,c);
if(e==A6){4==b&&(a.Ng=4,B6(15),d=!1);break}else if(e==Nua){a.Ng=4;B6(16);d=!1;break}else C6(a,e)}4==b&&0==c.length&&(a.Ng=1,B6(17),d=!1);a.Ue=a.Ue&&d;d||(D6(a),E6(a))},Mua=function(a,b){var c=a.mm,d=b.indexOf("\n",c);
if(-1==d)return A6;c=Number(b.substring(c,d));if(isNaN(c))return Nua;d+=1;if(d+c>b.length)return A6;var e=b.substr(d,c);a.mm=d+c;return e},Qua=function(a,b){a.Hj=(0,g.I)();
z6(a);var c=b?window.location.hostname:"";a.mh=a.Bg.clone();Y5(a.mh,"DOMAIN",c);Y5(a.mh,"t",a.F);try{a.Ye=new ActiveXObject("htmlfile")}catch(n){D6(a);a.Ng=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 Pua)k=F6[l]=Pua[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.Xc(g.tc("b/12014412"),d+"</body></html>");a.Ye.open();a.Ye.write(g.Sc(c));a.Ye.close();a.Ye.parentWindow.m=(0,g.x)(a.yN,a);a.Ye.parentWindow.d=(0,g.x)(a.ZA,a,!0);a.Ye.parentWindow.rpcClose=(0,g.x)(a.ZA,a,!1);c=a.Ye.createElement("DIV");a.Ye.parentWindow.document.body.appendChild(c);d=g.Ec(a.mh.toString());d=g.dd(g.Cc(d));d=g.Xc(g.tc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Yc(c,d);a.o.Te(1)},z6=function(a){a.Ru=(0,g.I)()+a.B;
Rua(a,a.B)},Rua=function(a,b){if(null!=a.Uj)throw Error("WatchDog timer not null");
a.Uj=G6((0,g.x)(a.GN,a),b)},H6=function(a){a.Uj&&(g.v.clearTimeout(a.Uj),a.Uj=null)},E6=function(a){a.o.Hx()||a.Ch||a.o.No(a)},D6=function(a){H6(a);
g.me(a.Vo);a.Vo=null;a.u.stop();g.bpa(a.A);if(a.Jc){var b=a.Jc;a.Jc=null;b.abort();b.dispose()}a.Ye&&(a.Ye=null)},C6=function(a,b){try{a.o.TA(a,b),a.o.Te(4)}catch(c){}},Tua=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;Sua(a,b,function(k){k?c(!0):g.v.setTimeout(function(){Tua(a,b,c,d,f)},f)})}},Sua=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);
fua(d,a)},I6=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},J6=function(){},Uua=function(a){this.o=a;
this.u=new J6},Vua=function(a){var b=K6(a.o,a.hk,"/mail/images/cleardot.gif");
Z5(b);Tua(b.toString(),5E3,(0,g.x)(a.ZD,a),3,2E3);a.Te(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.Rd=new x6(a,void 0,void 0,void 0),a.Rd.Sh=a.vr,b=a.o,b=K6(b,b.Yl()?a.Ik:null,a.wr),B6(5),!g.Od||g.rd(10))$5(b,"TYPE","xmlhttp"),y6(a.Rd,b,!1,a.Ik,!1);else{$5(b,"TYPE","html");var c=a.Rd;a=!!a.Ik;c.Xi=3;c.Bg=Z5(b.clone());Qua(c,a)}},N6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return gua(a)},O6=function(a){g.Me.call(this);
this.headers=new g.Nm;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},Wua=function(a){return g.Od&&g.qd(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},Xua=function(a){return"content-type"==a.toLowerCase()},Zua=function(a,b){a.w=!1;
a.o&&(a.B=!0,a.o.abort(),a.B=!1);a.A=b;a.C=5;Yua(a);P6(a)},Yua=function(a){a.U||(a.U=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},ava=function(a){if(a.w&&"undefined"!=typeof g.Y1)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.Bf(a.Jx,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.Vg(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=!$ua.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()+"]";Yua(a)}}finally{P6(a)}}},P6=function(a,b){if(a.o){bva(a);
var c=a.o,d=a.O[0]?g.Ia:null;a.o=null;a.O=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},bva=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},cva=function(a,b){this.o=a;
this.map=b;this.context=null},dva=function(a){g.oe.call(this,"statevent",a)},eva=function(a,b){g.oe.call(this,"timingevent",a);
this.size=b},fva=function(a){g.oe.call(this,"serverreachability",a)},iva=function(a){gva(a);
if(3==a.o){var b=a.Cl++,c=a.nn.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.Xi=2;b.Bg=Z5(c.clone());fua(new Image,b.Bg.toString());b.Hj=(0,g.I)();z6(b)}hva(a)},jva=function(a){a.vE(1,0);
a.nn=K6(a,null,a.ur);V6(a)},gva=function(a){a.Fg&&(a.Fg.abort(),a.Fg=null);
a.fc&&(a.fc.cancel(),a.fc=null);a.Lf&&(g.v.clearTimeout(a.Lf),a.Lf=null);W6(a);a.Kd&&(a.Kd.cancel(),a.Kd=null);a.Jg&&(g.v.clearTimeout(a.Jg),a.Jg=null)},kva=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed");
a.u.push(new cva(a.PJ++,b));2!=a.o&&3!=a.o||V6(a)},V6=function(a){a.Kd||a.Jg||(a.Jg=G6((0,g.x)(a.YA,a),0),a.Ri=0)},mva=function(a,b){if(1==a.o){if(!b){a.Cl=Math.floor(1E5*Math.random());
var c=a.Cl++,d=new x6(a,"",c,void 0);d.Sh=null;var e=X6(a),f=a.nn.clone();Y5(f,"RID",c);Y5(f,"CVER","1");U6(a,f);Lua(d,f,e);a.Kd=d;a.o=2}}else 3==a.o&&(b?lva(a,b):0==a.u.length||a.Kd||lva(a))},lva=function(a,b){if(b)if(6<a.Dh){a.u=a.A.concat(a.u);
a.A.length=0;var c=a.Cl-1;var d=X6(a)}else c=b.G,d=b.ni;else c=a.Cl++,d=X6(a);var e=a.nn.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.Ri+1);c.Sh=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Kd=c;Lua(c,e,d)},U6=function(a,b){if(a.od){var c=a.od.ex();
c&&g.Ob(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.Dh&&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.Dh?e:f-d;try{g.Ob(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("&")},nva=function(a){a.fc||a.Lf||(a.F=1,a.Lf=G6((0,g.x)(a.XA,a),0),a.Ki=0)},Y6=function(a){if(a.fc||a.Lf||3<=a.Ki)return!1;
a.F++;a.Lf=G6((0,g.x)(a.XA,a),ova(a,a.Ki));a.Ki++;return!0},L6=function(a,b,c){a.Dp=c;
a.kf=b.Xf;a.C||jva(a)},W6=function(a){null!=a.Hh&&(g.v.clearTimeout(a.Hh),a.Hh=null)},ova=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.od&&(c=null);var d=(0,g.x)(a.RO,a);c||(c=new g.Qm("//www.google.com/images/cleardot.gif"),Z5(c));Sua(c.toString(),1E4,d)}else B6(2);pva(a,b)},pva=function(a,b){a.o=0;
a.od&&a.od.rw(b);hva(a);gva(a)},hva=function(a){a.o=0;
a.kf=-1;if(a.od)if(0==a.A.length&&0==a.u.length)a.od.Cq();else{g.jb(a.A);var b=g.jb(a.u);a.A.length=0;a.u.length=0;a.od.Cq(b)}},K6=function(a,b,c){var d=g.Ym(c);
if(""!=d.o)b&&g.Sm(d,b+"."+d.o),g.Tm(d,d.B);else{var e=window.location;d=jua(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.wk&&g.Ob(a.wk,function(f,k){Y5(d,k,f)});
Y5(d,"VER",a.Dh);U6(a,d);return d},G6=function(a,b){if(!g.Na(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 dva($6,a))},qva=function(){},a7=function(a,b,c){g.B.call(this);
this.C=null!=c?(0,g.x)(a,c):a;this.rd=b;this.B=(0,g.x)(this.bF,this);this.o=!1;this.u=0;this.w=this.Da=null;this.A=[]},rva=function(){this.o=[];
this.u=[]},sva=function(a,b){this.action=a;
this.params=b||{}},b7=function(a,b){g.B.call(this);
this.o=new g.J(this.pN,0,this);g.H(this,this.o);this.rd=5E3;this.u=0;if(g.Na(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Na(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.Xn;this.u=new b7(this.vO,this);this.o=null;this.vb=!1;this.B=null;this.H="";this.G=this.A=0;this.F=[];this.P=c||!1},tva=function(a){return{firstTestResults:[""],
secondTestResults:!a.o.Dp,sessionId:a.o.w,arrayId:a.o.kj}},uva=function(a,b){a.G=b||0;
a.u.stop();a.o&&(3==a.o.o&&mva(a.o),iva(a.o));a.G=0},d7=function(a){return!!a.o&&3==a.o.o},vva=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.Vg(4,a))||"";b&&(this.port=":"+b);this.domain=g.Wg(a)||"";a=g.Mb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Lb(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.eh(c+b,{})},g7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Ra(a.A,d,!0),onError:g.Ra(a.w,e),Nd:g.Ra(a.B,e)};c&&(a.zb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.wp(b,a)},zva=function(){var a=wva;
xva();h7.push(a);yva(h7)},i7=function(a,b){xva();
var c=h7,d=Ava(a,String(b));g.cb(c)?Bva(d):(yva(c),(0,g.y)(c,function(e){e(d)}))},xva=function(){h7||(h7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ha("yt.mdx.remote.debug.handlers_",h7,void 0))},Bva=function(a){var b=(j7+1)%50;
j7=b;k7[b]=a;l7||(l7=49==b)},yva=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}},Ava=function(a,b){var c=((0,g.I)()-Cva)/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.F=a;this.o=[]},Dva=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},Eva=function(a,b){var c=a.o.length!=b.length;
a.o=(0,g.ae)(a.o,function(f){return!!j6(b,f)});
for(var d=0,e=b.length;d<e;d++)c=Dva(a,b[d])||c;return c},Fva=function(a,b){var c=a.o.length;
a.o=(0,g.ae)(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.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))},Gva=function(a){if(a.o.length){var b=(0,g.A)(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.mF,a),(0,g.x)(a.lF,a))}},o7=function(a){var b=pua(vua());
b=(0,g.ae)(b,function(c){return!c.uuid});
return Eva(a,b)},q7=function(a,b){xua((0,g.A)(a.o,nua));
b&&wua()},s7=function(a,b){g.Q.call(this);
this.C=b;var c=g.os("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.bb(c,l)}this.o=d;this.B=a;this.w=this.A=NaN;this.u=null;r7("Initialized with "+g.Kk(this.o))},Hva=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.Vb(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.Kk(a.o)),a.o=b,a.R("screenChange"));Iva(a)},u7=function(a){isNaN(a.w)||g.Jo(a.w);
a.w=g.Ho((0,g.x)(a.au,a),0<a.A&&a.A<(0,g.I)()?2E4:1E4)},r7=function(a){i7("OnlineScreenService",a)},Jva=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},Iva=function(a){a=g.Vb(g.Pb(a.o,function(b){return b}));
g.sb(a);a.length?g.ns("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={};Kva(this)},Mva=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.B[b]);var k=a.ce();if(k=(c?k6(k,c):null)||k6(k,b)){k.uuid=b;var l=w7(a,k);Hva(a.u,l,function(m){e(m?l:null)})}else c?Lva(a,c,(0,g.x)(function(m){var n=w7(this,new e6({name:d,
screenId:c,loungeToken:m,dialId:b||""}));Hva(this.u,n,function(p){e(p?n:null)})},a),f):e(null)},Nva=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},Lva=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={zb:{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.wp(f7(a.C,"/pairing/get_lounge_token_batch"),e)},Ova=function(a){a.o=a.w.ce();
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))},Kva=function(a){x7(a);
a.w=new p7(a.C);a.w.subscribe("screenChange",(0,g.x)(a.uF,a));Ova(a);a.A=pua(g.os("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.ce,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.ns("yt-remote-automatic-screen-cache",(0,g.A)(a.A,nua)));x7(a);a.B[b.uuid]=b.id;g.ns("yt-remote-device-id-map",a.B,31536E3);return b},x7=function(a){a.B=g.os("yt-remote-device-id-map")||{}},y7=function(a,b,c){g.Q.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.Ho((0,g.x)(function(){Pva(this,null)},this),12E4)},Qva=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Kk(void 0));
var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ia,(0,g.x)(function(){z7(this,"Failed to send message: getMdxSessionStatus.")},a)):z7(a,"Sending yt message without session: "+g.Kk(b))},Pva=function(a,b){g.Jo(a.A);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.w||a.w.id!=b){var c=(0,g.x)(a.Po,a),d=(0,g.x)(a.ie,a);a.zx(b,c,d,5)}}else a.ie(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.Ia;this.C=NaN;this.P=(0,g.x)(this.HP,this);this.o=g.Ia},Rva=function(a){a.o=a.H.VC(a.J,a.u.label,a.u.friendlyName,(0,g.x)(function(b){this.o=g.Ia;
this.Po(b)},a),(0,g.x)(function(b){this.o=g.Ia;
this.ie(b)},a))},Sva=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}zua()&&(b.env_useStageMdx=1);return g.ch(b)},C7=function(a,b){y7.call(this,a,b,"ManualSession");
this.o=g.Ho((0,g.x)(this.lj,this,null),150)},D7=function(a,b,c,d){g.Q.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)},Tva=function(a,b){return b?g.Za(a.w,function(c){return f6(b,c.label)},a):null},E7=function(a){i7("Controller",a)},wva=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.me(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.WA,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))},Uva=function(a){var b=a.u.UC(),c=a.o&&a.o.u;
a=(0,g.A)(b,function(d){c&&f6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=Tva(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},$va=function(a,b,c,d,e,f,k){Vva()?Wva(b,e,f,k)&&(I7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Xva(a,c):(window.__onGCastApiAvailable=function(l,m){l?Xva(a,c):(J7("Failed to load cast API: "+m),K7(!1),I7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Yva(),c(!1))},d?g.To("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?Gua():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?t6():(Fua(),s6(Zva.map(Dua))))):H7("Cannot initialize because not running Chrome")},Yva=function(){H7("dispose");
var a=L7();a&&a.dispose();g.Ha("yt.mdx.remote.cloudview.instance_",null,void 0);awa(!1);g.Po(M7);M7.length=0},N7=function(){return!!g.os("yt-remote-cast-installed")},bwa=function(){var a=g.os("yt-remote-cast-receiver");
return a?a.friendlyName:null},cwa=function(){H7("clearCurrentReceiver");
l6("yt-remote-cast-receiver")},dwa=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.Oo("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.")},Vva=function(){var a=0<=g.Mb.search(/ (CrMo|Chrome|CriOS)\//);
return g.Gv||a},ewa=function(a,b){L7().init(a,b)},Wva=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.ns("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.ns("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.ns("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.Ha("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_")},Xva=function(a,b){K7(!0);
I7(!1);ewa(a,function(c){c?(awa(!0),g.Qo("yt-remote-cast2-api-ready")):(J7("Failed to initialize cast API."),K7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Yva());b(c)})},H7=function(a){i7("cloudview",a)},J7=function(a){i7("cloudview",a)},K7=function(a){H7("setCastInstalled_ "+a);
g.ns("yt-remote-cast-installed",a)},O7=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},awa=function(a){H7("setApiReady_ "+a);
g.Ha("yt.mdx.remote.cloudview.apiReady_",a,void 0)},I7=function(a){g.Ha("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.lf=!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.lf=!1;a.hasNext=!1;a.F=0;a.C=(0,g.I)();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.I)()-a.C)/1E3:0},U7=function(a,b){a.F=b;
a.C=(0,g.I)()},V7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.I)()-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.ec(a.o);b.hasPrevious=a.lf;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.Q.call(this);
this.o=0;this.A=a;this.C=[];this.B=new rva;this.w=this.u=null;this.H=(0,g.x)(this.xK,this);this.F=(0,g.x)(this.El,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.Uu,this),fwa(this))):c=3;0!=c&&(b?this.Uu(c):g.Ho((0,g.x)(function(){this.Uu(c)},this),0));
var d=dwa();d&&Y7(this,d);this.subscribe("yt-remote-cast2-session-change",this.J)},$7=function(a){return new R7(a.A.getPlayerContextData())},fwa=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.C.push(this.A.subscribe(b,g.Ra(this.tM,b),this))},a)},gwa=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){gwa(a);
a.A.setPlayerContextData(X7(b));fwa(a)},Y7=function(a,b){a.w&&(a.w.removeUpdateListener(a.H),a.w.removeMediaListener(a.F),a.El(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.El(a.w.media[0]))},hwa=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.Q.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.Sa=this.o=null;this.U=a;this.O.push(g.Fq(window,"beforeunload",(0,g.x)(this.eF,this)));this.u=[];this.Sa=new R7;this.S=b.id;this.o=iwa(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);vva(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Sa.videoId;
g.ps()&&g.ns("yt-remote-session-video-id",d)},this)},g8=function(a){i7("conn",a)},iwa=function(a,b){return new c7(f7(a.U,"/bc"),b)},h8=function(a,b){a.R("proxyStateChange",b)},jwa=function(a){a.B=g.Ho((0,g.x)(function(){g8("Connecting timeout");
this.Pi(1)},a),2E4)},i8=function(a){g.Jo(a.B);
a.B=NaN},j8=function(a){g.Jo(a.J);
a.J=NaN},kwa=function(a){k8(a);
a.H=g.Ho((0,g.x)(function(){l8(this,"getNowPlaying")},a),2E4)},k8=function(a){g.Jo(a.H);
a.H=NaN},mwa=function(a,b){b&&(i8(a),j8(a));
b==(d7(a.o)&&isNaN(a.B))?b&&(h8(a,1),l8(a,"getSubtitlesTrack")):b?(a.xx()&&a.Sa.reset(),h8(a,1),l8(a,"getNowPlaying"),lwa(a)):a.Pi(1)},nwa=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Sa.videoId&&(g.ac(b.params)?a.Sa.o=null:a.Sa.o=b.params,a.R("remotePlayerChange"))},owa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.Sa.listId=b.params.listId||a.Sa.listId;W7(a.Sa,c,d);a.R("remoteQueueChange")},qwa=function(a,b){b.params=b.params||{};
owa(a,b);pwa(a,b);a.R("autoplayDismissed")},pwa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
U7(a.Sa,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Sa.playerState&&(c=-1E3);a.Sa.playerState=c;c=Number(b.params.loadedTime);a.Sa.H=isNaN(c)?0:c;c=Number(b.params.duration);a.Sa.G=isNaN(c)?0:c;c=a.Sa;var d=Number(b.params.liveIngestionTime);c.w=d;c.B=isNaN(d)?!1:!0;c=a.Sa;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.Sa.playerState?kwa(a):k8(a);a.R("remotePlayerChange")},rwa=function(a,b){if(-1E3!=
a.Sa.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.Sa.playerState=c;c=parseInt(b.params.currentTime,10);U7(a.Sa,isNaN(c)?0:c);a.R("remotePlayerChange")}},swa=function(a,b){var c="true"==b.params.muted;
a.Sa.volume=parseInt(b.params.volume,10);a.Sa.muted=c;a.R("remotePlayerChange")},twa=function(a,b){a.C=b.params.videoId;
a.R("nowAutoplaying",parseInt(b.params.timeout,10))},uwa=function(a,b){var c="true"==b.params.hasNext;
a.Sa.lf="true"==b.params.hasPrevious;a.Sa.hasNext=c;a.R("previousNextChange")},lwa=function(a){g.Jo(a.G);
a.G=g.Ho((0,g.x)(a.Pi,a,1),864E5)},l8=function(a,b,c){c?g8("Sending: action="+b+", params="+g.Kk(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)))},zwa=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.M("MDX_CONFIG")||b;rua();p6();n8||(n8=new e7(b?b.loungeApiHost:void 0),zua()&&(n8.o="/api/loungedev"));o8||(o8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ha("yt.mdx.remote.deferredProxies_",o8,void 0));vwa();var c=p8();if(!c){var d=new v7(n8);g.Ha("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);$va(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.Ha("yt.mdx.remote.initialized_",!0,void 0),r8("Initializing: "+g.Kk(b)),s8.push(g.Oo("yt-remote-cast2-availability-change",function(){c6("yt-remote-receiver-availability-change")})),s8.push(g.Oo("yt-remote-cast2-receiver-selected",function(){t8(null);
c6("yt-remote-auto-connect","cast-selector-receiver")})),s8.push(g.Oo("yt-remote-cast2-receiver-resumed",function(){c6("yt-remote-receiver-resumed","cast-selector-receiver")})),s8.push(g.Oo("yt-remote-cast2-session-change",wwa)),s8.push(g.Oo("yt-remote-connection-change",function(m){m?Q7(q8(),"YouTube TV"):u8()||(Q7(null,null),cwa())})),a=v8(),b.isAuto&&(a.id+="#dial"),g.Xo("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.Kk(a)),xwa(a),c.start(),q8()||ywa())},Bwa=function(){var a=Awa();
N7()&&g.os("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},Awa=function(){var a=p8().qd.$_gos();
var b=w8();b&&x8()&&(j6(a,b)||a.push(b));return qua(a)},y8=function(){var a=Cwa();
!a&&N7()&&bwa()&&(a={key:"cast-selector-receiver",name:bwa()});return a},Cwa=function(){var a=Awa(),b=w8();
b||(b=u8());return g.Za(a,function(c){return b&&f6(b,c.key)?!0:!1})},w8=function(){var a=q8();
if(!a)return null;var b=p8().ce();return k6(b,a)},wwa=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_")},Dwa=function(a){g.Ha("yt.mdx.remote.currentScreenId_",a,void 0)},Ewa=function(){return g.w("yt.mdx.remote.connectData_")},t8=function(a){g.Ha("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||Dwa("");g.Ha("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.ps();
if(!a)return null;var b=p8().ce();return k6(b,a)},A8=function(a,b){q8();
w8()&&w8();if(E8)F8=a;else{Dwa(a.id);var c=new f8(n8,a,v8());c.connect(b,Ewa());c.subscribe("beforeDisconnect",function(d){c6("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){x8()&&(x8(),B8(null))});
B8(c)}},ywa=function(){var a=u8();
a?(r8("Resume connection to: "+g6(a)),A8(a,0)):(q6(),cwa(),r8("Skipping connecting because no session screen found."))},vwa=function(){var a=v8();
if(g.ac(a)){a=o6();var b=g.os("yt-remote-session-name")||"",c=g.os("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ha("yt.mdx.remote.channelParams_",a,void 0)}},v8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},xwa=function(a){a?(g.ns("yt-remote-session-app",a.app),g.ns("yt-remote-session-name",a.name)):(l6("yt-remote-session-app"),l6("yt-remote-session-name"));
g.Ha("yt.mdx.remote.channelParams_",a,void 0)},G8=function(a,b,c){g.B.call(this);
this.B=a;this.u=b;this.w=new g.P(this);g.H(this,this.w);this.w.L(b,"onCaptionsTrackListChanged",this.uL);this.w.L(b,"captionschanged",this.vK);this.w.L(b,"captionssettingschanged",this.jC);this.w.L(b,"videoplayerreset",this.Qo);this.w.L(b,"mdxautoplaycancel",this.YD);this.S=this.w.L(b,"onVolumeChange",this.DA);this.G=!1;this.o=c;c.subscribe("proxyStateChange",this.SA,this);c.subscribe("remotePlayerChange",this.Il,this);c.subscribe("remoteQueueChange",this.Qo,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.pD(64);this.A=new g.J(this.hC,500,this);g.H(this,this.A);this.C=new g.J(this.iC,1E3,this);g.H(this,this.C);this.P=new a7(this.cP,0,this);g.H(this,this.P);this.F={};this.O=new g.J(this.IC,1E3,this);g.H(this,this.O);this.J=new v6(this.XH,1E3,this);g.H(this,this.J);this.U=g.Ia;this.jC();this.Qo();this.Il()},H8=function(a,b){var c=
a.B,d=a.u.getVideoData().lengthSeconds;
c.O=b||0;c.player.R("progresssync",b,d)},Fwa=function(a){H8(a,0);
a.A.stop();I8(a,new g.pD(64))},K8=function(a,b){if(J8(a)&&!a.G){var c=null;
b&&(c={style:a.u.getSubtitlesUserSettings()},g.gc(c,b));a.o.WB(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.Xa;var e=c.listId.toString()}c=a.u.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.nf,g.yB(c));I8(a,new g.pD(1))},Gwa=function(a,b){if(b){var c=a.u.getOption("captions","tracklist",{wT: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.vD(c,b)){var d=g.W(b,2);d!=g.W(a.H,2)&&g.nT(a.u.app,d);a.H=b;Hwa(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:"Oturumunuz kapal\u0131"},{D:"div",I:"ytp-mdx-popup-description",W:"\u0130zledi\u011finiz videolar TV'nin izleme ge\u00e7mi\u015fine eklenebilir ve TV \u00f6nerilerini etkileyebilir. Bu sorunun \u00f6n\u00fcne ge\u00e7mek i\u00e7in iptal edip bilgisayar \u00fczerinden YouTube'da oturum a\u00e7\u0131n."},{D:"div",I:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",X:["ytp-button",
"ytp-mdx-privacy-popup-cancel"],W:"\u0130ptal"},{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-confirm"],W:"Onayla"}]}]}]});this.u=new g.dM(this,250);g.H(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.fM()]},{D:"div",I:"ytp-remote-display-status-text",W:"{{statustext}}"}]}]});this.u=new g.dM(this,250);g.H(this,this.u);this.w=a;this.L(a,"presentingplayerstatechange",this.A);Iwa(this,g.sL(a))},Iwa=function(a,b){if(3==a.w.getPresentingPlayerType()){var c={RECEIVER_NAME:a.w.getOption("remote","currentReceiver").name};
c=g.W(b,128)?g.JM("$RECEIVER_NAME cihaz\u0131nda hata olu\u015ftu",c):g.wD(b)||g.W(b,4)?g.JM("$RECEIVER_NAME cihaz\u0131nda oynat\u0131l\u0131yor",c):g.JM("$RECEIVER_NAME cihaz\u0131na ba\u011flan\u0131ld\u0131",c);a.ha("statustext",c);a.u.show()}else a.u.hide()},O8=function(a,b){g.BO.call(this,"Oynat\u0131lacak ekran se\u00e7in",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.LP.call(this,a);
this.u={key:i6(),name:"Bu bilgisayar"};this.B=null;this.A=[];this.S=this.o=null;this.J=[this.u];this.w=this.u;this.F=new g.pD(64);this.O=0;this.H=-1;this.C=null;if(!g.Jx(this.player.N())){a=this.player;var b=g.WC(a);b&&(b=b.vl())&&(b=new O8(a,b),g.H(this,b));b=new N8(a);g.H(this,b);g.KL(a,b.element,4);this.C=new M8;g.H(this,this.C);g.KL(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)},Hwa=function(a,b,c){a.F=
c;
a.player.R("presentingplayerstatechange",new g.BD(c,b))},R8=function(a,b){if(b.key!=a.w.key)if(b.key==a.u.key)z8();
else{var c;(c=!g.R(a.player.N().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.M("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.M("SESSION_INDEX")&&!g.M("LOGGED_IN")))||a.P||!a.C);if(c?0:g.Sx(a.player.N())||"WEB_EMBEDDED_PLAYER"==a.player.N().deviceParams.c)g.wD(g.sL(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.R(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.getLength();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.nf,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=g.yB(c))&&(d.locationInfo=c);c=d}r8("Connecting to: "+
g.Kk(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().ce(),(c=k6(c,b.key))&&A8(c,1))}},Pua={"\x00":"\\0",
"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},F6={"'":"\\'"},Jwa={},mua={fQ:"atp",JS:"ska",yS:"que",SR:"mus",IS:"sus",eR:"dsp",FS:"seq"};
d6.prototype.Gg=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="",Eua=Aua("loadCastFramework")||Aua("loadCastApplicationFramework"),Zva=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];u6.prototype.o=null;u6.prototype.getOptions=function(){var a;(a=this.o)||(a={},Iua(this)&&(a[0]=!0,a[1]=!0),a=this.o=a);return a};var S8;g.Ta(Hua,u6);S8=new Hua;/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
g.Ta(v6,g.B);g.h=v6.prototype;g.h.Wi=!1;g.h.Hk=0;g.h.Da=null;g.h.Gx=function(a){this.o=arguments;this.Da||this.Hk?this.Wi=!0:w6(this)};
g.h.stop=function(){this.Da&&(g.v.clearTimeout(this.Da),this.Da=null,this.Wi=!1,this.o=[])};
g.h.pause=function(){this.Hk++};
g.h.resume=function(){this.Hk--;this.Hk||!this.Wi||this.Da||(this.Wi=!1,w6(this))};
g.h.Y=function(){v6.Gb.Y.call(this);this.stop()};
g.h.cF=function(){this.Da=null;this.Wi&&!this.Hk&&(this.Wi=!1,w6(this))};g.h=x6.prototype;g.h.Sh=null;g.h.Ue=!1;g.h.Uj=null;g.h.Ru=null;g.h.Hj=null;g.h.Xi=null;g.h.Bg=null;g.h.mh=null;g.h.ni=null;g.h.Jc=null;g.h.mm=0;g.h.Ye=null;g.h.Fp=null;g.h.Ng=null;g.h.Jk=-1;g.h.QB=!0;g.h.Ch=!1;g.h.xr=0;g.h.Vo=null;var Nua={},A6={};g.h=x6.prototype;g.h.setTimeout=function(a){this.B=a};
g.h.gO=function(a){a=a.target;var b=this.Vo;b&&3==Q6(a)?b.Gx():this.PC(a)};
g.h.PC=function(a){try{if(a==this.Jc)a:{var b=Q6(this.Jc),c=this.Jc.C,d=this.Jc.getStatus();if(g.Od&&!g.rd(10)||g.Qd&&!g.qd("420+")){if(4>b)break a}else if(3>b||3==b&&!g.wh&&!S6(this.Jc))break a;this.Ch||4!=b||7==c||(8==c||0>=d?this.o.Te(3):this.o.Te(2));H6(this);var e=this.Jc.getStatus();this.Jk=e;var f=S6(this.Jc);(this.Ue=200==e)?(4==b&&D6(this),this.C?(Oua(this,b,f),g.wh&&this.Ue&&3==b&&(this.A.ia(this.u,"tick",this.aO),this.u.start())):C6(this,f),this.Ue&&!this.Ch&&(4==b?this.o.No(this):(this.Ue=
!1,z6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Ng=3,B6(13)):(this.Ng=0,B6(14)),D6(this),E6(this))}}catch(k){this.Jc&&S6(this.Jc)}finally{}};
g.h.aO=function(){var a=Q6(this.Jc),b=S6(this.Jc);this.mm<b.length&&(H6(this),Oua(this,a,b),this.Ue&&4!=a&&z6(this))};
g.h.yN=function(a){G6((0,g.x)(this.xN,this,a),0)};
g.h.xN=function(a){this.Ch||(H6(this),C6(this,a),z6(this))};
g.h.ZA=function(a){G6((0,g.x)(this.wN,this,a),0)};
g.h.wN=function(a){this.Ch||(D6(this),this.Ue=a,this.o.No(this),this.o.Te(4))};
g.h.cancel=function(){this.Ch=!0;D6(this)};
g.h.GN=function(){this.Uj=null;var a=(0,g.I)();0<=a-this.Ru?(2!=this.Xi&&this.o.Te(3),D6(this),this.Ng=2,B6(18),E6(this)):Rua(this,this.Ru-a)};
g.h.getLastError=function(){return this.Ng};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=Uua.prototype;g.h.vr=null;g.h.Rd=null;g.h.Wo=!1;g.h.Ix=null;g.h.kn=null;g.h.ds=null;g.h.wr=null;g.h.ye=null;g.h.Xf=-1;g.h.Ik=null;g.h.hk=null;g.h.connect=function(a){this.wr=a;a=K6(this.o,null,this.wr);B6(3);this.Ix=(0,g.I)();var b=this.o.G;null!=b?(this.Ik=b[0],(this.hk=b[1])?(this.ye=1,Vua(this)):(this.ye=2,M6(this))):($5(a,"MODE","init"),this.Rd=new x6(this,void 0,void 0,void 0),this.Rd.Sh=this.vr,y6(this.Rd,a,!1,null,!0),this.ye=0)};
g.h.ZD=function(a){if(a)this.ye=2,M6(this);else{B6(4);var b=this.o;b.kf=b.Fg.Xf;Z6(b,9)}a&&this.Te(2)};
g.h.Kq=function(a){return this.o.Kq(a)};
g.h.abort=function(){this.Rd&&(this.Rd.cancel(),this.Rd=null);this.Xf=-1};
g.h.Hx=function(){return!1};
g.h.TA=function(a,b){this.Xf=a.Jk;if(0==this.ye)if(b){try{var c=this.u.parse(b)}catch(d){c=this.o;c.kf=this.Xf;Z6(c,2);return}this.Ik=c[0];this.hk=c[1]}else c=this.o,c.kf=this.Xf,Z6(c,2);else if(2==this.ye)if(this.Wo)B6(7),this.ds=(0,g.I)();else if("11111"==b){if(B6(6),this.Wo=!0,this.kn=(0,g.I)(),c=this.kn-this.Ix,!g.Od||g.rd(10)||500>c)this.Xf=200,this.Rd.cancel(),B6(12),L6(this.o,this,!0)}else B6(8),this.kn=this.ds=(0,g.I)(),this.Wo=!1};
g.h.No=function(){this.Xf=this.Rd.Jk;if(this.Rd.Ue)0==this.ye?this.hk?(this.ye=1,Vua(this)):(this.ye=2,M6(this)):2==this.ye&&((!g.Od||g.rd(10)?!this.Wo:200>this.ds-this.kn)?(B6(11),L6(this.o,this,!1)):(B6(12),L6(this.o,this,!0)));else{0==this.ye?B6(9):2==this.ye&&B6(10);var a=this.o;this.Rd.getLastError();a.kf=this.Xf;Z6(a,2)}};
g.h.Yl=function(){return this.o.Yl()};
g.h.isActive=function(){return this.o.isActive()};
g.h.Te=function(a){this.o.Te(a)};g.Ta(O6,g.Me);var $ua=/^https?$/i,Kwa=["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?Jua(this.S):Jua(S8);this.O=this.S?this.S.getOptions():S8.getOptions();this.o.onreadystatechange=(0,g.x)(this.Jx,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));Zua(this,f);return}a=c||
"";var e=this.headers.clone();d&&iua(d,function(f,k){e.set(k,f)});
d=g.Za(e.te(),Xua);c=g.v.FormData&&a instanceof g.v.FormData;!g.bb(Kwa,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{bva(this),0<this.F&&(this.P=Wua(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.Kx,this)):this.J=g.Bf(this.Kx,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)),Zua(this,f)}};
g.h.Kx=function(){"undefined"!=typeof g.Y1&&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.Gb.Y.call(this)};
g.h.Jx=function(){this.la()||(this.Z||this.G||this.B?ava(this):this.vM())};
g.h.vM=function(){ava(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.wk=null;g.h.Kd=null;g.h.fc=null;g.h.ur=null;g.h.nn=null;g.h.ew=null;g.h.En=null;g.h.Cl=0;g.h.PJ=0;g.h.od=null;g.h.Jg=null;g.h.Lf=null;g.h.Hh=null;g.h.Fg=null;g.h.Dp=null;g.h.kj=-1;g.h.uy=-1;g.h.kf=-1;g.h.Ri=0;g.h.Ki=0;g.h.Dh=8;var $6=new g.Me;g.Ta(dva,g.oe);g.Ta(eva,g.oe);g.Ta(fva,g.oe);g.h=T6.prototype;g.h.connect=function(a,b,c,d,e){B6(0);this.ur=b;this.wk=c||{};d&&void 0!==e&&(this.wk.OSID=d,this.wk.OAID=e);this.C?(G6((0,g.x)(this.zw,this,a),100),jva(this)):this.zw(a)};
g.h.zw=function(a){this.Fg=new Uua(this);this.Fg.vr=null;this.Fg.u=this.B;this.Fg.connect(a)};
g.h.Hx=function(){return 0==this.o};
g.h.YA=function(a){this.Jg=null;mva(this,a)};
g.h.XA=function(){this.Lf=null;this.fc=new x6(this,this.w,"rpc",this.F);this.fc.Sh=null;this.fc.xr=0;var a=this.ew.clone();Y5(a,"RID","rpc");Y5(a,"SID",this.w);Y5(a,"CI",this.Dp?"0":"1");Y5(a,"AID",this.kj);U6(this,a);if(!g.Od||g.rd(10))Y5(a,"TYPE","xmlhttp"),y6(this.fc,a,!0,this.En,!1);else{Y5(a,"TYPE","html");var b=this.fc,c=!!this.En;b.Xi=3;b.Bg=Z5(a.clone());Qua(b,c)}};
g.h.TA=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.Dh){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.Lf){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.uy=c[1],0<this.uy-this.kj&&37500>c[2]&&this.Dp&&0==this.Ki&&!this.Hh&&(this.Hh=G6((0,g.x)(this.rK,this),6E3));else Z6(this,11)}else b!=Jwa.CQ.o&&Z6(this,11);else if(this.fc==
a&&W6(this),!g.zb(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.En=e[2],e=e[3],null!=e?this.Dh=e:this.Dh=6,this.o=3,this.od&&this.od.uw(),this.ew=K6(this,this.Yl()?this.En:null,this.ur),nva(this)):"stop"==e[0]&&Z6(this,7):3==this.o&&("stop"==e[0]?Z6(this,7):"noop"!=e[0]&&this.od&&this.od.tw(e),this.Ki=0)}}};
g.h.rK=function(){null!=this.Hh&&(this.Hh=null,this.fc.cancel(),this.fc=null,Y6(this),B6(20))};
g.h.No=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.Ue)1==b?(b=(0,g.I)()-a.Hj,$6.dispatchEvent(new eva($6,a.ni?a.ni.length:0,b,this.Ri)),V6(this),this.A.length=0):nva(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.Jg||1==this.o||2<=this.Ri?d=!1:(this.Jg=G6((0,g.x)(this.YA,this,a),ova(this,this.Ri)),this.Ri++,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.vE=function(a){if(!g.bb(arguments,this.o))throw Error("Unexpected channel state: "+this.o);};
g.h.RO=function(a){a?B6(2):(B6(1),pva(this,8))};
g.h.Kq=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.od&&this.od.isActive(this)};
g.h.Te=function(a){$6.dispatchEvent(new fva($6,a))};
g.h.Yl=function(){return!(!g.Od||g.rd(10))};
g.h=qva.prototype;g.h.uw=function(){};
g.h.tw=function(){};
g.h.rw=function(){};
g.h.Cq=function(){};
g.h.ex=function(){return{}};
g.h.isActive=function(){return!0};g.Ta(a7,g.B);g.h=a7.prototype;g.h.aF=function(a){this.A=arguments;this.o=!1;this.Da?this.w=(0,g.I)()+this.rd:this.Da=g.Bf(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.Gb.Y.call(this)};
g.h.bF=function(){this.w?(this.Da=g.Bf(this.B,this.w-(0,g.I)()),this.w=null):(this.Da=null,this.u?this.o=!0:(this.o=!1,this.C.apply(null,this.A)))};g.h=rva.prototype;g.h.isEmpty=function(){return g.cb(this.o)&&g.cb(this.u)};
g.h.clear=function(){this.o=[];this.u=[]};
g.h.contains=function(a){return g.bb(this.o,a)||g.bb(this.u,a)};
g.h.remove=function(a){var b=this.o;var c=(0,g.gpa)(b,a);0<=c?(g.eb(b,c),b=!0):b=!1;return b||g.fb(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.Ta(b7,g.B);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.zn(this.o,a);this.u=(0,g.I)()+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.Ta(c7,qva);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.og=function(a){return this.w.Th(a)};
g.h.R=function(a,b){return this.w.R.apply(this.w,arguments)};
g.h.dispose=function(){this.vb||(this.vb=!0,g.me(this.w),uva(this),g.me(this.u),this.u=null)};
g.h.la=function(){return this.vb};
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.od=null);d.od=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.gc(c,b);this.u.isActive()||2==(this.o?this.o.o:0)?this.F.push(c):d7(this)&&kva(this.o,c)};
g.h.uw=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)kva(this.o,a[b])}this.R("handlerOpened")};
g.h.rw=function(a){var b=2==a&&401==this.o.kf;4==a||b||this.u.start();this.R("handlerError",a)};
g.h.Cq=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.ex=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.gc(a,this.B);return a};
g.h.tw=function(a){"S"==a[0]?this.H=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),iva(this.o)):this.R("handlerMessage",new sva(a[0],a[1]))};
g.h.vO=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 Cva=(0,g.I)(),h7=null,k7=Array(50),j7=-1,l7=!1;g.Ta(m7,g.Q);m7.prototype.ce=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.Q);g.h=n7.prototype;g.h.start=function(){!this.o&&isNaN(this.Da)&&this.TC()};
g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Da)||(g.Jo(this.Da),this.Da=NaN)};
g.h.Y=function(){this.stop();g.Q.prototype.Y.call(this)};
g.h.TC=function(){this.Da=NaN;this.o=g.wp(f7(this.C,"/pairing/get_screen"),{method:"POST",zb:{pairing_code:this.A},timeout:5E3,onSuccess:(0,g.x)(this.AP,this),onError:(0,g.x)(this.zP,this),Nd:(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>=Lwa.length?this.R("pairingFailed",Error("DIAL polling timed out")):(a=Lwa[this.u],this.Da=g.Ho((0,g.x)(this.TC,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 Lwa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ta(p7,m7);g.h=p7.prototype;g.h.start=function(){o7(this)&&this.R("screenChange");!g.os("yt-remote-lounge-token-expiration")&&Gva(this);g.Jo(this.u);this.u=g.Ho((0,g.x)(this.start,this),1E4)};
g.h.add=function(a,b){o7(this);Dva(this,a);q7(this,!1);this.R("screenChange");b(a);a.token||Gva(this)};
g.h.remove=function(a,b){var c=o7(this);Fva(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.R("screenChange")};
g.h.Ap=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.Jo(this.u);p7.Gb.Y.call(this)};
g.h.mF=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.lF=function(a){i7(this.F,"Requesting lounge tokens failed: "+a)};g.r(s7,g.Q);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.os("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.I)()-144E5<a?0:a)?u7(this):(this.A=(0,g.I)()+3E5,g.ns("yt-remote-fast-check-period",this.A),this.au())};
g.h.isEmpty=function(){return g.ac(this.o)};
g.h.update=function(){r7("Updating availability on schedule.");var a=this.C(),b=g.Pb(this.o,function(c,d){return c&&!!k6(a,d)},this);
t7(this,b)};
g.h.Y=function(){g.Jo(this.w);this.w=NaN;this.u&&(this.u.abort(),this.u=null);g.Q.prototype.Y.call(this)};
g.h.au=function(){g.Jo(this.w);this.w=NaN;this.u&&this.u.abort();var a=Jva(this);if(a6(a)){var b=f7(this.B,"/pairing/get_screen_availability");this.u=g7(this.B,b,{lounge_token:g.Vb(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.Vb(Jva(this));if(g.ub(c,g.Vb(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.au()};
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.Ta(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.Ap=function(a,b,c,d){this.w.contains(a)?this.w.Ap(a,b,c,d):(a="Updating name of unknown screen: "+a.name,i7(this.F,a),d(Error(a)))};
g.h.ce=function(a){return a?this.o:g.ib(this.o,(0,g.ae)(this.A,function(b){return!this.contains(b)},this))};
g.h.UC=function(){return(0,g.ae)(this.ce(!0),function(a){return!!this.u.o[a.id]},this)};
g.h.VC=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.me(f);d(w7(this,k))},this));
f.subscribe("pairingFailed",function(k){g.me(f);e(k)});
f.start();return(0,g.x)(f.stop,f)};
g.h.DP=function(a,b,c,d){g.wp(f7(this.C,"/pairing/get_screen"),{method:"POST",zb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new e6(f.screen||{});if(!k.name||Nva(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);Nva(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),
Nd:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})};
g.h.Y=function(){g.me(this.w);g.me(this.u);v7.Gb.Y.call(this)};
g.h.uF=function(){Ova(this);this.R("screenChange");this.u.update()};
v7.prototype.dispose=v7.prototype.dispose;g.Ta(y7,g.Q);g.h=y7.prototype;g.h.Po=function(a){this.w=a;this.R("sessionScreen",this.w)};
g.h.ie=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.XC=function(){return null};
g.h.ku=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.ku("");y7.Gb.Y.call(this)};g.Ta(A7,y7);g.h=A7.prototype;g.h.ju=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);Qva(this)};
g.h.lj=function(a){this.info("launchWithParams no-op for Cast: "+g.Kk(a))};
g.h.stop=function(){this.o?this.o.stop((0,g.x)(function(){this.ie()},this),(0,g.x)(function(){this.ie(Error("Failed to stop receiver app."))},this)):this.ie(Error("Stopping cast device witout session."))};
g.h.ku=g.Ia;g.h.Y=function(){this.info("disposeInternal");g.Jo(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.Gb.Y.call(this)};
g.h.ON=function(a,b){if(!this.la())if(b){var c=N6(b);if(g.Oa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Kk(c));switch(d){case "mdxSessionStatus":Pva(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.zx=function(a,b,c,d){Mva(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.Ho((0,g.x)(this.zx,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.XC=function(){return this.o};
g.h.EP=function(a){this.la()||a||(z7(this,"Cast session died."),this.ie())};g.Ta(B7,y7);g.h=B7.prototype;g.h.ju=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.Ia;g.Jo(this.C);this.A?this.A.stop((0,g.x)(this.ie,this,null),(0,g.x)(this.ie,this,"Failed to stop DIAL device.")):this.ie()};
g.h.Y=function(){this.o();this.o=g.Ia;g.Jo(this.C);this.A&&this.A.removeUpdateListener(this.P);this.A=null;B7.Gb.Y.call(this)};
g.h.HP=function(a){this.la()||a||(z7(this,"DIAL session died."),this.o(),this.o=g.Ia,this.ie())};
g.h.Hr=function(a){this.J=i6();if(this.B){var b=new chrome.cast.DialLaunchResponse(!0,Sva(this));a(b);Rva(this)}else this.F=(0,g.x)(function(){g.Jo(this.C);this.F=g.Ia;this.C=NaN;var c=new chrome.cast.DialLaunchResponse(!0,Sva(this));a(c);Rva(this)},this),this.C=g.Ho((0,g.x)(function(){this.F()},this),100)};
g.h.OF=function(a,b,c){Mva(this.H,this.G.receiver.label,a,this.u.friendlyName,(0,g.x)(function(d){d&&d.token?(this.Po(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.Ta(C7,y7);C7.prototype.stop=function(){this.ie()};
C7.prototype.ju=g.Ia;C7.prototype.lj=function(){g.Jo(this.o);this.o=NaN;var a=k6(this.H.ce(),this.u.label);a?this.Po(a):this.ie(Error("No such screen"))};
C7.prototype.Y=function(){g.Jo(this.o);this.o=NaN;C7.Gb.Y.call(this)};g.Ta(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.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.VA,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),zva(),this.u.subscribe("onlineScreenChange",(0,g.x)(this.WC,this)),this.w=Uva(this),chrome.cast.setCustomReceivers(this.w,g.Ia,(0,g.x)(function(k){this.Sb("Failed to set initial custom receivers: "+g.Kk(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.Kk(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.ce(),a);if(!c){E7("setConnectedScreenStatus: Unknown screen.");return}var d=Tva(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.Ia,(0,g.x)(function(e){this.Sb("Failed to set initial custom receivers: "+g.Kk(e))},this)));
E7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);G7(this,new C7(this.u,d),!0)}this.o.ku(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.VA,this),(0,g.x)(this.XM,this))};
g.h.Y=function(){this.u.unsubscribe("onlineScreenChange",(0,g.x)(this.WC,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);var a=wva,b=g.w("yt.mdx.remote.debug.handlers_");g.fb(b||[],a);g.me(this.o);D7.Gb.Y.call(this)};
g.h.Sb=function(a){i7("Controller",a)};
g.h.WA=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.OF,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.x)(b.Hr,b))};
g.h.VA=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.ce(),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.me(this.o),this.o=new A7(this.u,b),this.o.subscribe("sessionScreen",(0,g.x)(this.WA,this,this.o)),this.o.lj(null));this.o.ju(a)}}};
g.h.FP=function(){return this.o?this.o.XC():null};
g.h.XM=function(a){this.la()||(this.Sb("Failed to estabilish a session: "+g.Kk(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.WC=function(){this.la()||(this.w=Uva(this),E7("Updating custom receivers: "+g.Kk(this.w)),chrome.cast.setCustomReceivers(this.w,g.Ia,(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.lf=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.Q);g.h=Z7.prototype;g.h.play=function(){1==this.o?(this.u?this.u.play(null,g.Ia,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.Ia,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.Ia,e8(this,"seekTo",{newTime:a}))}else d8(this,"seekTo",{newTime:a});c8(this,3,a);this.R("remotePlayerChange")}else a8(this,g.Ra(this.seekTo,a))};
g.h.stop=function(){if(1==this.o){this.u?this.u.stop(null,g.Ia,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.Ra(this.setVolume,a,b))};
g.h.WB=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.Kk(b.style),g.gc(d,c.o));d8(this,"setSubtitlesTrack",d);b8(this,c)}else a8(this,g.Ra(this.WB,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.Ra(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.Kk(k));d8(this,"setPlaylist",m);d||b8(this,l)};
g.h.SC=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.Ra(this.SC,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.Ra(this.nextVideo,a,b))};
g.h.Iw=function(){1==this.o?d8(this,"dismissAutoplay"):a8(this,this.Iw)};
g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.R("proxyStateChange",a,this.o)}g.Q.prototype.dispose.call(this)};
g.h.Y=function(){gwa(this);this.A=null;this.B.clear();Y7(this,null);g.Q.prototype.Y.call(this)};
g.h.Uu=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.cb(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.El(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.El=function(a){i7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.G);if(this.u=a)this.u.addUpdateListener(this.G),hwa(this),this.R("remotePlayerChange")};
g.h.wK=function(a){a?(hwa(this),this.R("remotePlayerChange")):this.El(null)};
g.h.IK=function(){var a=dwa();a&&Y7(this,a)};
g.h.Sb=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.Sa.listId=c);this.Sa.videoId=d;this.Sa.index=k||0;this.Sa.state=3;U7(this.Sa,m);this.A="UNSUPPORTED";g8("Connecting with setPlaylist and params: "+g.Kk(l));this.o.connect({method:"setPlaylist",
params:g.Kk(l)},a,uua())}else g8("Connecting without params"),this.o.connect({},a,uua());jwa(this)};
g.h.dispose=function(){this.la()||(this.R("beforeDispose"),h8(this,3));g.Q.prototype.dispose.call(this)};
g.h.Y=function(){i8(this);k8(this);j8(this);g.Jo(this.F);this.F=NaN;g.Jo(this.G);this.G=NaN;this.w=null;g.Gq(this.O);this.O.length=0;this.o.dispose();g.Q.prototype.Y.call(this);this.A=this.C=this.u=this.Sa=this.o=null};
g.h.eF=function(){this.Pi(2)};
g.h.BK=function(){g8("Channel opened");this.P&&(this.P=!1,j8(this),this.J=g.Ho((0,g.x)(function(){g8("Timing out waiting for a screen.");this.Pi(1)},this),15E3));
yua(tva(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.Kk(a.params)):g8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=N6(a.params.devices);this.u=(0,g.A)(a,function(c){return new d6(c)});
a=!!g.Za(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
mwa(this,a);break;case "loungeScreenDisconnected":g.gb(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
mwa(this,!1);break;case "remoteConnected":var b=new d6(N6(a.params.device));g.Za(this.u,function(c){return b?c.id==b.id:!1})||eua(this.u,b);
break;case "remoteDisconnected":b=new d6(N6(a.params.device));g.gb(this.u,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":owa(this,a);break;case "nowPlaying":qwa(this,a);break;case "onStateChange":pwa(this,a);break;case "onAdStateChange":rwa(this,a);break;case "onVolumeChanged":swa(this,a);break;case "onSubtitlesTrackChanged":nwa(this,a);break;case "nowAutoplaying":twa(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":uwa(this,a);break;case "requestAssistedSignIn":this.R("assistedSignInRequested",a.params.authCode);break;default:g8("Unrecognized action: "+a.action)}};
g.h.rO=function(){if(this.w){var a=this.w;this.w=null;this.Sa.videoId!=a&&l8(this,"getNowPlaying")}};
g.h.TE=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.Pi=function(a){g8("Disconnecting with "+a);i8(this);this.R("beforeDisconnect",a);1==a&&q6();uva(this.o,a);this.dispose()};
g.h.SE=function(){var a=this.Sa;this.w&&(a=this.Sa.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.Sa.videoId&&(this.w=b.videoId,g.Jo(this.F),this.F=g.Ho((0,g.x)(this.rO,this),5E3));var c=[];this.Sa.listId==b.listId&&this.Sa.videoId==b.videoId&&this.Sa.index==b.index||c.push("remoteQueueChange");this.Sa.playerState==b.playerState&&this.Sa.volume==b.volume&&this.Sa.muted==b.muted&&V7(this.Sa)==V7(b)&&g.Kk(this.Sa.o)==g.Kk(b.o)||c.push("remotePlayerChange");this.Sa.reset(a);(0,g.y)(c,function(d){this.R(d)},this)};
g.h.xx=function(){var a=this.o.C.id,b=g.Za(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.I)():NaN};
g.h.HE=function(){return this.A||"UNSUPPORTED"};
g.h.IE=function(){return this.C||""};
g.h.yP=function(){if(!isNaN(this.Ck())){var a=this.o.u;g.An(a.o);a.start()}};
g.h.AO=function(a,b){l8(this,a,b);lwa(this)};
f8.prototype.subscribe=f8.prototype.subscribe;f8.prototype.unsubscribeByKey=f8.prototype.og;f8.prototype.getProxyState=f8.prototype.TE;f8.prototype.disconnect=f8.prototype.Pi;f8.prototype.getPlayerContextData=f8.prototype.SE;f8.prototype.setPlayerContextData=f8.prototype.FO;f8.prototype.getOtherConnectedRemoteId=f8.prototype.xx;f8.prototype.getReconnectTimeout=f8.prototype.Ck;f8.prototype.getAutoplayMode=f8.prototype.HE;f8.prototype.getAutoplayVideoId=f8.prototype.IE;f8.prototype.reconnect=f8.prototype.yP;
f8.prototype.sendMessage=f8.prototype.AO;g.r(m8,m7);g.h=m8.prototype;g.h.ce=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.Ap=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.VC;v7.prototype.$_c=v7.prototype.contains;v7.prototype.$_g=v7.prototype.get;v7.prototype.$_a=v7.prototype.add;v7.prototype.$_un=v7.prototype.Ap;v7.prototype.$_r=v7.prototype.remove;v7.prototype.$_gs=v7.prototype.ce;v7.prototype.$_gos=v7.prototype.UC;v7.prototype.$_s=v7.prototype.subscribe;v7.prototype.$_ubk=v7.prototype.og;var F8=null,E8=!1,n8=null,o8=null,D8=null,s8=[];g.r(G8,g.B);g.h=G8.prototype;
g.h.Y=function(){g.B.prototype.Y.call(this);this.A.stop();this.C.stop();this.P.stop();this.U();this.o.unsubscribe("proxyStateChange",this.SA,this);this.o.unsubscribe("remotePlayerChange",this.Il,this);this.o.unsubscribe("remoteQueueChange",this.Qo,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.sz=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.Gx(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.aF(a)};
g.h.cP=function(a){this.sz("control_subtitles_set_track",g.ac(a)?null:a)};
g.h.jC=function(){var a=this.u.getOption("captions","track");g.ac(a)||K8(this,a)};
g.h.DA=function(a){if(J8(this)){this.o.unsubscribe("remotePlayerChange",this.Il,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.Il,this)}};
g.h.uL=function(){g.ac(this.F)||Gwa(this,this.F);this.G=!1};
g.h.SA=function(a,b){this.C.stop();2==b&&this.iC()};
g.h.Il=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.pD(8));this.hC();break;case 1085:case 3:I8(this,new g.pD(9));break;case 1083:case 0:I8(this,new g.pD(2));this.J.stop();H8(this,this.u.getVideoData().lengthSeconds);break;case 1084:I8(this,new g.pD(4));break;case 2:I8(this,new g.pD(4));H8(this,V7(a));
break;case -1:I8(this,new g.pD(64));break;case -1E3:I8(this,new g.pD(128,{errorCode:"mdx.remoteerror",errorMessage:"Bu video uzaktan oynatma i\u00e7in uygun de\u011fil."}))}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,Gwa(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 Fwa(this)};
g.h.PA=function(){this.u.R("mdxpreviousnextchange")};
g.h.Qo=function(){J8(this)||Fwa(this)};
g.h.YD=function(){this.o.Iw()};
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.XH=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.Wa(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.hC=function(){this.A.stop();if(!this.o.la()){var a=$7(this.o);1==a.playerState&&I8(this,new g.pD(8));H8(this,V7(a));this.A.start()}};
g.h.iC=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){Iwa(this,a.state)};g.r(O8,g.BO);O8.prototype.J=function(){var a=this.u.getOption("remote","receivers");a&&1<a.length&&!this.u.getOption("remote","quickCast")?(this.C=g.wb(a,this.B,this),g.DO(this,(0,g.A)(a,this.B)),a=this.u.getOption("remote","currentReceiver"),this.Ce(this.B(a)),this.enable(!0)):this.enable(!1)};
O8.prototype.B=function(a){return a.key};
O8.prototype.Re=function(a){return"cast-selector-receiver"==a?"Yay\u0131nla...":this.C[a].name};
O8.prototype.Zc=function(a){g.BO.prototype.Zc.call(this,a);this.u.setOption("remote","currentReceiver",this.C[a]);this.w.nb()};g.r(P8,g.LP);g.h=P8.prototype;
g.h.create=function(){zwa(g.Ax(this.player.N()));this.A.push(g.Oo("yt-remote-before-disconnect",this.sK,this));this.A.push(g.Oo("yt-remote-connection-change",this.BM,this));this.A.push(g.Oo("yt-remote-receiver-availability-change",this.QA,this));this.A.push(g.Oo("yt-remote-auto-connect",this.zM,this));this.A.push(g.Oo("yt-remote-receiver-resumed",this.yM,this));this.A.push(g.Oo("mdx-privacy-popup-confirm",this.dO,this));this.A.push(g.Oo("mdx-privacy-popup-cancel",this.cO,this));this.QA()};
g.h.load=function(){this.player.cancelPlayback();g.LP.prototype.load.call(this);this.B=new G8(this,this.player,this.o);var a=(a=Ewa())?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));Hwa(this,this.F,this.F);g.tT(this.player.app,6)};
g.h.unload=function(){this.player.R("mdxautoplaycanceled");this.w=this.u;g.ne(this.B,this.o);this.o=this.B=null;g.LP.prototype.unload.call(this);g.tT(this.player.app,5);Q8(this)};
g.h.Y=function(){g.Po(this.A);g.LP.prototype.Y.call(this)};
g.h.tl=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.sz.apply(this.B,[a].concat(g.na(c)))};
g.h.getAdState=function(){return this.H};
g.h.VE=function(){return this.loaded?this.B.suggestion:null};
g.h.lf=function(){return this.o?$7(this.o).lf:!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.R(this.player.N().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.Pc():!a.isAdPlaying()&&this.player.Pc(),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.EH=function(){this.o&&this.o.SC()};
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.me(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(Bwa());var a=y8()||this.u;R8(this,a);this.player.ka("onMdxReceiversChange")};
g.h.TN=function(a){!this.P&&g.DD(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.dO=function(){this.P=!0;Q8(this);E8=!1;F8&&A8(F8,1);F8=null};
g.h.cO=function(){this.P=!1;Q8(this);R8(this,this.u);this.w=this.u;E8=!1;F8=null;this.player.playVideo()};
g.h.Mc=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.FH=function(){d8(this.o,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.Bf=function(){return!1};
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.$P.remote=P8;})(_yt_player);
