(function(g){var window=this;var JEa=function(a,b){return g.Yb(a,b)},c6=function(a){g.Yn(a,"zx",g.yc());
return a},d6=function(a,b,c){g.Ga(c)||(c=[String(c)]);
g.ao(a.o,b,c)},KEa=function(a,b){var c=[];
g.Gl(b,function(d){try{var e=g.AE.prototype.A.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.v(e)?g.zE(e)&&c.push(d):c.push(d)},a);
return c},LEa=function(a,b){var c=KEa(a,b);
(0,g.E)(c,function(d){g.AE.prototype.remove.call(this,d)},a)},MEa=function(a){if(a.Ld){if(a.Ld.locationOverrideToken)return{locationOverrideToken:a.Ld.locationOverrideToken};
if(null!=a.Ld.latitudeE7&&null!=a.Ld.longitudeE7)return{latitudeE7:a.Ld.latitudeE7,longitudeE7:a.Ld.longitudeE7}}return null},NEa=function(a,b,c,d){var e=new g.Pn(null,void 0);
a&&g.Qn(e,a);b&&g.Rn(e,b);c&&g.Sn(e,c);d&&g.Tn(e,d);return e},e6=function(a,b){g.tF[a]=!0;
var c=g.rF();c&&c.publish.apply(c,arguments);g.tF[a]=!1},f6=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.C=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Jn;this.o=this.A="";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",OEa(this,a.capabilities||""),PEa(this,a.experiments||""),this.A=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey||
"")},OEa=function(a,b){a.capabilities.clear();
(0,g.re)(b.split(","),g.Na(JEa,QEa)).forEach(function(c){a.capabilities.add(c)})},PEa=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},g6=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||""},h6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},REa=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},SEa=function(a){return new g6(a)},TEa=function(a){return g.Ga(a)?(0,g.K)(a,SEa):[]},i6=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"},j6=function(a){return g.Ga(a)?"["+(0,g.K)(a,i6).join(",")+"]":"null"},k6=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)})},UEa=function(a){return(0,g.K)(a,function(b){return{key:b.id,
name:b.name}})},l6=function(a,b){return g.Ua(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},m6=function(a,b){return g.Ua(a,function(c){return h6(c,b)})},VEa=function(){var a=(0,g.HI)();
a&&LEa(a,a.o.de(!0))},n6=function(){var a=g.KI("yt-remote-connected-devices")||[];
g.sb(a);return a},WEa=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.K)(a,function(d,e){return 0==e?d:d.substring(c.length)})},XEa=function(a){g.JI("yt-remote-connected-devices",a,86400)},p6=function(){if(o6)return o6;
var a=g.KI("yt-remote-device-id");a||(a=k6(),g.JI("yt-remote-device-id",a,31536E3));for(var b=n6(),c=1,d=a;g.Ya(b,d);)c++,d=a+"#"+c;return o6=d},q6=function(){var a=n6(),b=p6();
g.Ya(a,b);g.MI()&&g.ub(a,b);a=WEa(a);if(g.Za(a))try{g.iI("remote_sid")}catch(c){}else try{g.hI("remote_sid",a.join(","),-1)}catch(c){}},YEa=function(){return g.KI("yt-remote-session-browser-channel")},ZEa=function(){return g.KI("yt-remote-local-screens")||[]},$Ea=function(){g.JI("yt-remote-lounge-token-expiration",!0,86400)},aFa=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.K)(ZEa(),function(d){return d.loungeToken}),c=(0,g.K)(a,function(d){return d.loungeToken});
(0,g.Fj)(c,function(d){return!g.Ya(b,d)})&&$Ea();
g.JI("yt-remote-local-screens",a,31536E3)},bFa=function(a,b){g.JI("yt-remote-session-browser-channel",a);
g.JI("yt-remote-session-screen-id",b);var c=n6(),d=p6();g.Ya(c,d)||c.push(d);XEa(c);q6()},r6=function(a){a||(g.LI("yt-remote-session-screen-id"),g.LI("yt-remote-session-video-id"));
q6();a=n6();g.db(a,p6());XEa(a)},cFa=function(){if(!s6){var a=g.LE();
a&&(s6=new g.uE(a))}return s6?!!s6.get("yt-remote-use-staging-server"):!1},t6=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},dFa=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},u6=function(a){a.length?eFa(a.shift(),function(){u6(a)}):v6()},fFa=function(a){return"chrome-extension://"+a+w6},eFa=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=dFa();
a&&a(!1,"No cast extension found")},hFa=function(){if(gFa){var a=2,b=dFa(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;eFa("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",v6,c)}},iFa=function(){hFa();
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);u6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+w6,"//www.gstatic.com/eureka/clank"+w6])},x6=function(a,b,c){g.L.call(this);
this.F=null!=c?(0,g.B)(a,c):a;this.Ed=b;this.D=(0,g.B)(this.ZK,this);this.o=!1;this.A=0;this.C=this.Fa=null;this.B=[]},y6=function(){},z6=function(a,b,c,d){this.o=a;
this.C=b;this.G=c;this.F=d||1;this.B=45E3;this.Z=new g.fo(this);this.A=new g.bh;this.A.setInterval(250)},kFa=function(a,b,c){a.fk=1;
a.zh=c6(b.clone());a.lj=c;a.D=!0;jFa(a,null)},A6=function(a,b,c,d,e){a.fk=1;
a.zh=c6(b.clone());a.lj=null;a.D=c;e&&(a.OF=!1);jFa(a,d)},jFa=function(a,b){a.Zk=(0,g.J)();
B6(a);a.ai=a.zh.clone();d6(a.ai,"t",a.F);a.jo=0;a.Xc=a.o.fu(a.o.Xn()?b:null);0<a.Mu&&(a.sr=new g.sm((0,g.B)(a.YG,a,a.Xc),a.Mu));a.Z.X(a.Xc,"readystatechange",a.dV);var c=a.Ki?g.hc(a.Ki):{};a.lj?(a.os="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Xc.send(a.ai,a.os,a.lj,c)):(a.os="GET",a.OF&&!g.fe&&(c.Connection="close"),a.Xc.send(a.ai,a.os,null,c));a.o.Bf(1)},nFa=function(a,b,c){for(var d=!0;!a.pi&&a.jo<c.length;){var e=lFa(a,c);
if(e==C6){4==b&&(a.Ah=4,D6(15),d=!1);break}else if(e==mFa){a.Ah=4;D6(16);d=!1;break}else E6(a,e)}4==b&&0==c.length&&(a.Ah=1,D6(17),d=!1);a.Hf=a.Hf&&d;d||(F6(a),G6(a))},lFa=function(a,b){var c=a.jo,d=b.indexOf("\n",c);
if(-1==d)return C6;c=Number(b.substring(c,d));if(isNaN(c))return mFa;d+=1;if(d+c>b.length)return C6;var e=b.substr(d,c);a.jo=d+c;return e},pFa=function(a,b){a.Zk=(0,g.J)();
B6(a);var c=b?window.location.hostname:"";a.ai=a.zh.clone();g.Yn(a.ai,"DOMAIN",c);g.Yn(a.ai,"t",a.F);try{a.Jf=new ActiveXObject("htmlfile")}catch(n){F6(a);a.Ah=7;D6(22);G6(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 H6)k=H6[l];else if(l in oFa)k=H6[l]=oFa[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=
H6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Ed(g.Uc("b/12014412"),d+"</body></html>");a.Jf.open();a.Jf.write(g.vd(c));a.Jf.close();a.Jf.parentWindow.m=(0,g.B)(a.lU,a);a.Jf.parentWindow.d=(0,g.B)(a.dF,a,!0);a.Jf.parentWindow.rpcClose=(0,g.B)(a.dF,a,!1);c=a.Jf.createElement("DIV");a.Jf.parentWindow.document.body.appendChild(c);d=g.id(a.ai.toString());d=g.sc(g.fd(d));d=g.Ed(g.Uc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Fd(c,d);a.o.Bf(1)},B6=function(a){a.Gy=(0,g.J)()+a.B;
qFa(a,a.B)},qFa=function(a,b){if(null!=a.Al)throw Error("WatchDog timer not null");
a.Al=I6((0,g.B)(a.AU,a),b)},J6=function(a){a.Al&&(g.y.clearTimeout(a.Al),a.Al=null)},G6=function(a){a.o.RB()||a.pi||a.o.Tq(a)},F6=function(a){J6(a);
g.Of(a.sr);a.sr=null;a.A.stop();g.lo(a.Z);if(a.Xc){var b=a.Xc;a.Xc=null;b.abort();b.dispose()}a.Jf&&(a.Jf=null)},E6=function(a,b){try{a.o.WE(a,b),a.o.Bf(4)}catch(c){}},sFa=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;rFa(a,b,function(k){k?c(!0):g.y.setTimeout(function(){sFa(a,b,c,d,f)},f)})}},rFa=function(a,b,c){var d=new Image;
d.onload=function(){try{K6(d),c(!0)}catch(e){}};
d.onerror=function(){try{K6(d),c(!1)}catch(e){}};
d.onabort=function(){try{K6(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{K6(d),c(!1)}catch(e){}};
g.y.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
d.src=a},K6=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},tFa=function(a){this.o=a;
this.A=new y6},uFa=function(a){var b=L6(a.o,a.Pl,"/mail/images/cleardot.gif");
c6(b);sFa(b.toString(),5E3,(0,g.B)(a.ZJ,a),3,2E3);a.Bf(1)},N6=function(a){var b=a.o.J;
if(null!=b)D6(5),b?(D6(11),M6(a.o,a,!1)):(D6(12),M6(a.o,a,!0));else if(a.oe=new z6(a,void 0,void 0,void 0),a.oe.Ki=a.Ku,b=a.o,b=L6(b,b.Xn()?a.Im:null,a.Lu),D6(5),!g.de||g.Mc(10))d6(b,"TYPE","xmlhttp"),A6(a.oe,b,!1,a.Im,!1);else{d6(b,"TYPE","html");var c=a.oe;a=!!a.Im;c.fk=3;c.zh=c6(b.clone());pFa(c,a)}},O6=function(a,b,c){this.o=1;
this.A=[];this.B=[];this.D=new y6;this.H=a||null;this.J=null!=b?b:null;this.F=c||!1},vFa=function(a,b){this.o=a;
this.map=b;this.context=null},wFa=function(a){g.Qf.call(this,"statevent",a)},xFa=function(a,b){g.Qf.call(this,"timingevent",a);
this.size=b},yFa=function(a){g.Qf.call(this,"serverreachability",a)},BFa=function(a){zFa(a);
if(3==a.o){var b=a.zn++,c=a.zp.clone();g.Yn(c,"SID",a.C);g.Yn(c,"RID",b);g.Yn(c,"TYPE","terminate");P6(a,c);b=new z6(a,a.C,b,void 0);b.fk=2;b.zh=c6(c.clone());(new Image).src=b.zh;b.Zk=(0,g.J)();B6(b)}AFa(a)},CFa=function(a){a.vK(1,0);
a.zp=L6(a,null,a.Ju);Q6(a)},zFa=function(a){a.ph&&(a.ph.abort(),a.ph=null);
a.Bc&&(a.Bc.cancel(),a.Bc=null);a.Bg&&(g.y.clearTimeout(a.Bg),a.Bg=null);R6(a);a.ie&&(a.ie.cancel(),a.ie=null);a.th&&(g.y.clearTimeout(a.th),a.th=null)},DFa=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed");
a.A.push(new vFa(a.XP++,b));2!=a.o&&3!=a.o||Q6(a)},Q6=function(a){a.ie||a.th||(a.th=I6((0,g.B)(a.cF,a),0),a.Wj=0)},FFa=function(a,b){if(1==a.o){if(!b){a.zn=Math.floor(1E5*Math.random());
var c=a.zn++,d=new z6(a,"",c,void 0);d.Ki=null;var e=S6(a),f=a.zp.clone();g.Yn(f,"RID",c);g.Yn(f,"CVER","1");P6(a,f);kFa(d,f,e);a.ie=d;a.o=2}}else 3==a.o&&(b?EFa(a,b):0==a.A.length||a.ie||EFa(a))},EFa=function(a,b){if(b)if(6<a.ti){a.A=a.B.concat(a.A);
a.B.length=0;var c=a.zn-1;var d=S6(a)}else c=b.G,d=b.lj;else c=a.zn++,d=S6(a);var e=a.zp.clone();g.Yn(e,"SID",a.C);g.Yn(e,"RID",c);g.Yn(e,"AID",a.zk);P6(a,e);c=new z6(a,a.C,c,a.Wj+1);c.Ki=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.ie=c;kFa(c,e,d)},P6=function(a,b){if(a.Dd){var c=a.Dd.xB();
c&&g.Mb(c,function(d,e){g.Yn(b,e,d)})}},S6=function(a){var b=Math.min(a.A.length,1E3),c=["count="+b];
if(6<a.ti&&0<b){var d=a.A[0].o;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.A[e].o,k=a.A[e].map;f=6>=a.ti?e:f-d;try{g.Mb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.B=a.B.concat(a.A.splice(0,b));
return c.join("&")},GFa=function(a){a.Bc||a.Bg||(a.G=1,a.Bg=I6((0,g.B)(a.bF,a),0),a.Mj=0)},T6=function(a){if(a.Bc||a.Bg||3<=a.Mj)return!1;
a.G++;a.Bg=I6((0,g.B)(a.bF,a),HFa(a,a.Mj));a.Mj++;return!0},M6=function(a,b,c){a.ks=c;
a.Tf=b.Pg;a.F||CFa(a)},R6=function(a){null!=a.yi&&(g.y.clearTimeout(a.yi),a.yi=null)},HFa=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},U6=function(a,b){if(2==b||9==b){var c=null;
a.Dd&&(c=null);var d=(0,g.B)(a.TV,a);c||(c=new g.Pn("//www.google.com/images/cleardot.gif"),c6(c));rFa(c.toString(),1E4,d)}else D6(2);IFa(a,b)},IFa=function(a,b){a.o=0;
a.Dd&&a.Dd.wA(b);AFa(a);zFa(a)},AFa=function(a){a.o=0;
a.Tf=-1;if(a.Dd)if(0==a.B.length&&0==a.A.length)a.Dd.Rt();else{g.ib(a.B);var b=g.ib(a.A);a.B.length=0;a.A.length=0;a.Dd.Rt(b)}},L6=function(a,b,c){var d=g.Zn(c);
if(""!=d.A)b&&g.Rn(d,b+"."+d.A),g.Sn(d,d.D);else{var e=window.location;d=NEa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.jm&&g.Mb(a.jm,function(f,k){g.Yn(d,k,f)});
g.Yn(d,"VER",a.ti);P6(a,d);return d},I6=function(a,b){if(!g.Ja(a))throw Error("Fn must not be null and must be a function");
return g.y.setTimeout(function(){a()},b)},D6=function(a){V6.dispatchEvent(new wFa(V6,a))},JFa=function(){},KFa=function(a,b){this.action=a;
this.params=b||{}},W6=function(a,b){g.L.call(this);
this.o=new g.V(this.bU,0,this);g.M(this,this.o);this.Ed=5E3;this.A=0;if(g.Ja(a))b&&(a=(0,g.B)(a,b));else if(a&&g.Ja(a.handleEvent))a=(0,g.B)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},X6=function(a,b,c){this.K=a;
this.F=b;this.C=new g.tE;this.A=new W6(this.xW,this);this.o=this.kb=null;this.Bb=!1;this.D=null;this.J="";this.H=this.B=0;this.G=[];this.L=c||!1},LFa=function(a){return{firstTestResults:[""],
secondTestResults:!a.o.ks,sessionId:a.o.C,arrayId:a.o.zk}},MFa=function(a,b){a.H=b||0;
a.A.stop();a.o&&(3==a.o.o&&FFa(a.o),BFa(a.o));a.H=0},Y6=function(a){return!!a.o&&3==a.o.o},NFa=function(a,b){(a.F.loungeIdToken=b)||a.A.stop()},Z6=function(a){this.port=this.domain="";
this.o="/api/lounge";this.A=!0;a=a||document.location.href;var b=g.qh(a)||"";b&&(this.port=":"+b);this.domain=g.ph(a)||"";a=g.Jb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Ib(a,"10.0")&&(this.A=!1))},$6=function(a,b){var c=a.o;
if(g.v(void 0)?0:a.A)c="https://"+a.domain+a.port+a.o;return g.zh(c+b,{})},a7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Na(a.B,d,!0),onError:g.Na(a.C,e),Hd:g.Na(a.D,e)};c&&(a.Sb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.cG(b,a)},RFa=function(){var a=OFa;
PFa();b7.push(a);QFa(b7)},c7=function(a,b){PFa();
var c=b7,d=SFa(a,String(b));g.Za(c)?TFa(d):(QFa(c),(0,g.E)(c,function(e){e(d)}))},PFa=function(){b7||(b7=g.z("yt.mdx.remote.debug.handlers_")||[],g.Da("yt.mdx.remote.debug.handlers_",b7,void 0))},TFa=function(a){var b=(d7+1)%50;
d7=b;e7[b]=a;f7||(f7=49==b)},QFa=function(a){var b=e7;
if(b[0]){var c=d7,d=f7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.E)(a,function(f){f(e)})}while(d!=c);
e7=Array(50);d7=-1;f7=!1}},SFa=function(a,b){var c=((0,g.J)()-UFa)/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("")},g7=function(a){g.vH.call(this);
this.G=a;this.o=[]},VFa=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},WFa=function(a,b){var c=a.o.length!=b.length;
a.o=(0,g.re)(a.o,function(f){return!!l6(b,f)});
for(var d=0,e=b.length;d<e;d++)c=VFa(a,b[d])||c;return c},XFa=function(a,b){var c=a.o.length;
a.o=(0,g.re)(a.o,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.o.length<c},h7=function(a,b,c,d){g.vH.call(this);
this.F=a;this.D=b;this.C=c;this.B=d;this.A=0;this.o=null;this.Fa=NaN},j7=function(a){g7.call(this,"LocalScreenService");
this.C=a;this.A=NaN;i7(this);this.info("Initializing with "+j6(this.o))},YFa=function(a){if(a.o.length){var b=(0,g.K)(a.o,function(d){return d.id}),c=$6(a.C,"/pairing/get_lounge_token_batch");
a7(a.C,c,{screen_ids:b.join(",")},(0,g.B)(a.nL,a),(0,g.B)(a.mL,a))}},i7=function(a){var b=TEa(ZEa());
b=(0,g.re)(b,function(c){return!c.uuid});
return WFa(a,b)},k7=function(a,b){aFa((0,g.K)(a.o,REa));
b&&$Ea()},m7=function(a,b){g.vH.call(this);
this.F=b;var c=g.KI("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.F(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.Ya(c,l)}this.o=d;this.D=a;this.C=this.B=NaN;this.A=null;l7("Initialized with "+g.hh(this.o))},ZFa=function(a,b,c){var d=$6(a.D,"/pairing/get_screen_availability");
a7(a.D,d,{lounge_token:b.token},(0,g.B)(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.B)(function(){c(!1)},a))},n7=function(a,b){a:if(g.Sb(b)!=g.Sb(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||(l7("Updated online screens: "+g.hh(a.o)),a.o=b,a.U("screenChange"));$Fa(a)},o7=function(a){isNaN(a.C)||g.qF(a.C);
a.C=g.oF((0,g.B)(a.xx,a),0<a.B&&a.B<(0,g.J)()?2E4:1E4)},l7=function(a){c7("OnlineScreenService",a)},aGa=function(a){var b={};
(0,g.E)(a.F(),function(c){c.token?b[c.token]=c.id:this.sc("Requesting availability of screen w/o lounge token.")});
return b},$Fa=function(a){a=g.Vb(g.Nb(a.o,function(b){return b}));
g.sb(a);a.length?g.JI("yt-remote-online-screen-ids",a.join(","),60):g.LI("yt-remote-online-screen-ids")},p7=function(a){g7.call(this,"ScreenService");
this.F=a;this.A=this.C=null;this.B=[];this.D={};bGa(this)},dGa=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.D[b]);var k=a.ze();if(k=(c?m6(k,c):null)||m6(k,b)){k.uuid=b;var l=q7(a,k);ZFa(a.A,l,function(m){e(m?l:null)})}else c?cGa(a,c,(0,g.B)(function(m){var n=q7(this,new g6({name:d,
screenId:c,loungeToken:m,dialId:b||""}));ZFa(this.A,n,function(p){e(p?n:null)})},a),f):e(null)},eGa=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},cGa=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={Sb:{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.cG($6(a.F,"/pairing/get_lounge_token_batch"),e)},fGa=function(a){a.o=a.C.ze();
var b=a.D,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: "+j6(a.o))},bGa=function(a){r7(a);
a.C=new j7(a.F);a.C.subscribe("screenChange",(0,g.B)(a.AL,a));fGa(a);a.B=TEa(g.KI("yt-remote-automatic-screen-cache")||[]);r7(a);a.info("Initializing automatic screens: "+j6(a.B));a.A=new m7(a.F,(0,g.B)(a.ze,a,!0));a.A.subscribe("screenChange",(0,g.B)(function(){this.U("onlineScreenChange")},a))},q7=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=m6(a.B,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.B.push(b),g.JI("yt-remote-automatic-screen-cache",(0,g.K)(a.B,REa)));r7(a);a.D[b.uuid]=b.id;g.JI("yt-remote-device-id-map",a.D,31536E3);return b},r7=function(a){a.D=g.KI("yt-remote-device-id-map")||{}},s7=function(a,b,c){g.vH.call(this);
this.M=c;this.J=a;this.A=b;this.C=null},t7=function(a,b){c7(a.M,b)},u7=function(a,b){s7.call(this,a,b,"CastSession");
this.o=null;this.B=0;this.F=(0,g.B)(this.EW,this);this.D=(0,g.B)(this.MU,this);this.B=g.oF((0,g.B)(function(){gGa(this,null)},this),12E4)},hGa=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.hh(void 0));
var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.A,(0,g.B)(function(){t7(this,"Failed to send message: getMdxSessionStatus.")},a)):t7(a,"Sending yt message without session: "+g.hh(b))},gGa=function(a,b){g.qF(a.B);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.C||a.C.id!=b){var c=(0,g.B)(a.Uq,a),d=(0,g.B)(a.Ee,a);a.IB(b,c,d,5)}}else a.Ee(Error("Waiting for session status timed out."))},v7=function(a,b,c){s7.call(this,a,b,"DialSession");
this.B=this.H=null;this.K="";this.W=c;this.D=null;this.G=g.A;this.F=NaN;this.L=(0,g.B)(this.HW,this);this.o=g.A},iGa=function(a){a.o=a.J.dH(a.K,a.A.label,a.A.friendlyName,(0,g.B)(function(b){this.o=g.A;
this.Uq(b)},a),(0,g.B)(function(b){this.o=g.A;
this.Ee(b)},a))},jGa=function(a){var b={};
b.pairingCode=a.K;b.theme=a.W;if(a.D){var c=a.D.currentTime||0;b.v=a.D.videoId;b.t=c}cFa()&&(b.env_useStageMdx=1);return g.xh(b)},w7=function(a,b){s7.call(this,a,b,"ManualSession");
this.o=g.oF((0,g.B)(this.Bk,this,null),150)},x7=function(a,b,c,d){g.vH.call(this);
this.A=a;this.G=b||"233637DE";this.F=c||"cl";this.H=d||!1;this.o=null;this.D=!1;this.C=[];this.B=(0,g.B)(this.hT,this)},kGa=function(a,b){return b?g.Ua(a.C,function(c){return h6(b,c.label)},a):null},y7=function(a){c7("Controller",a)},OFa=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},z7=function(a){return a.D||!!a.C.length||!!a.o},A7=function(a,b,c){b!=a.o&&(g.Of(a.o),(a.o=b)?(c?a.U("yt-remote-cast2-receiver-resumed",b.A):a.U("yt-remote-cast2-receiver-selected",
b.A),b.subscribe("sessionScreen",(0,g.B)(a.ZE,a,b)),b.C?a.U("yt-remote-cast2-session-change",b.C):c&&a.o.Bk(null)):a.U("yt-remote-cast2-session-change",null))},lGa=function(a){var b=a.A.cH(),c=a.o&&a.o.A;
a=(0,g.K)(b,function(d){c&&h6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=kGa(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},rGa=function(a,b,c,d,e,f,k){mGa()?nGa(b,e,f,k)&&(C7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?oGa(a,c):(window.__onGCastApiAvailable=function(l,m){l?oGa(a,c):(D7("Failed to load cast API: "+m),E7(!1),C7(!1),g.LI("yt-remote-cast-available"),g.LI("yt-remote-cast-receiver"),pGa(),c(!1))},d?g.BF("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?iFa():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?v6():(hFa(),u6(qGa.map(fFa))))):B7("Cannot initialize because not running Chrome")},pGa=function(){B7("dispose");
var a=F7();a&&a.dispose();g.Da("yt.mdx.remote.cloudview.instance_",null,void 0);sGa(!1);g.wF(G7);G7.length=0},H7=function(){return!!g.KI("yt-remote-cast-installed")},tGa=function(){var a=g.KI("yt-remote-cast-receiver");
return a?a.friendlyName:null},uGa=function(){B7("clearCurrentReceiver");
g.LI("yt-remote-cast-receiver")},vGa=function(){return H7()?F7()?F7().getCastSession():(D7("getCastSelector: Cast is not initialized."),null):(D7("getCastSelector: Cast API is not installed!"),null)},J7=function(){H7()?F7()?I7()?(B7("Requesting cast selector."),F7().requestSession()):(B7("Wait for cast API to be ready to request the session."),G7.push(g.vF("yt-remote-cast2-api-ready",J7))):D7("requestCastSelector: Cast is not initialized."):D7("requestCastSelector: Cast API is not installed!")},K7=
function(a,b){I7()?F7().setConnectedScreenStatus(a,b):D7("setConnectedScreenStatus called before ready.")},mGa=function(){var a=0<=g.Jb.search(/ (CrMo|Chrome|CriOS)\//);
return g.mM||a},wGa=function(a,b){F7().init(a,b)},nGa=function(a,b,c,d){var e=!1;
F7()||(a=new x7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.JI("yt-remote-cast-available",f);e6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){B7("onReceiverSelected: "+f.friendlyName);
g.JI("yt-remote-cast-receiver",f);e6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){B7("onReceiverResumed: "+f.friendlyName);
g.JI("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){B7("onSessionChange: "+i6(f));
f||g.LI("yt-remote-cast-receiver");e6("yt-remote-cast2-session-change",f)}),g.Da("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
B7("cloudview.createSingleton_: "+e);return e},F7=function(){return g.z("yt.mdx.remote.cloudview.instance_")},oGa=function(a,b){E7(!0);
C7(!1);wGa(a,function(c){c?(sGa(!0),g.yF("yt-remote-cast2-api-ready")):(D7("Failed to initialize cast API."),E7(!1),g.LI("yt-remote-cast-available"),g.LI("yt-remote-cast-receiver"),pGa());b(c)})},B7=function(a){c7("cloudview",a)},D7=function(a){c7("cloudview",a)},E7=function(a){B7("setCastInstalled_ "+a);
g.JI("yt-remote-cast-installed",a)},I7=function(){return!!g.z("yt.mdx.remote.cloudview.apiReady_")},sGa=function(a){B7("setApiReady_ "+a);
g.Da("yt.mdx.remote.cloudview.apiReady_",a,void 0)},C7=function(a){g.Da("yt.mdx.remote.cloudview.initializing_",a,void 0)},L7=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.F=this.G=0;this.o=null;this.hasNext=this.Xf=!1;this.J=this.H=this.A=this.B=0;this.C=NaN;this.D=!1;this.reset(a)},M7=function(a){a.audioTrackId=null;
a.o=null;a.playerState=-1;a.Xf=!1;a.hasNext=!1;a.G=0;a.F=(0,g.J)();a.B=0;a.A=0;a.H=0;a.J=0;a.C=NaN;a.D=!1},N7=function(a){return a.sb()?((0,g.J)()-a.F)/1E3:0},O7=function(a,b){a.G=b;
a.F=(0,g.J)()},P7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.J)()-a.F)/1E3+a.G;
case -1E3:return 0}return a.G},Q7=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&M7(a)},R7=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.ic(a.o);b.hasPrevious=a.Xf;b.hasNext=a.hasNext;b.playerTime=a.G;b.playerTimeAt=a.F;b.seekableStart=a.B;b.seekableEnd=a.A;b.duration=a.H;b.loadedTime=a.J;b.liveIngestionTime=a.C;return b},T7=function(a,b){g.vH.call(this);
this.o=0;this.B=a;this.F=[];this.D=new g.KD;this.C=this.A=null;this.J=(0,g.B)(this.IQ,this);this.G=(0,g.B)(this.Dn,this);this.H=(0,g.B)(this.HQ,this);this.K=(0,g.B)(this.UQ,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.Oy,this),xGa(this))):c=3;0!=c&&(b?this.Oy(c):g.oF((0,g.B)(function(){this.Oy(c)},this),0));
var d=vGa();d&&S7(this,d);this.subscribe("yt-remote-cast2-session-change",this.K)},U7=function(a){return new L7(a.B.getPlayerContextData())},xGa=function(a){(0,g.E)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.F.push(this.B.subscribe(b,g.Na(this.dT,b),this))},a)},yGa=function(a){(0,g.E)(a.F,function(b){this.B.unsubscribeByKey(b)},a);
a.F.length=0},V7=function(a,b){50>a.D.Jc()&&g.MD(a.D,b)},X7=function(a,b,c){var d=U7(a);
O7(d,c);-1E3!=d.playerState&&(d.playerState=b);W7(a,d)},Y7=function(a,b,c){a.B.sendMessage(b,c)},W7=function(a,b){yGa(a);
a.B.setPlayerContextData(R7(b));xGa(a)},S7=function(a,b){a.C&&(a.C.removeUpdateListener(a.J),a.C.removeMediaListener(a.G),a.Dn(null));
a.C=b;a.C&&(c7("CP","Setting cast session: "+a.C.sessionId),a.C.addUpdateListener(a.J),a.C.addMediaListener(a.G),a.C.media.length&&a.Dn(a.C.media[0]))},zGa=function(a){var b=a.A.media,c=a.A.customData;
if(b&&c){var d=U7(a);b.contentId!=d.videoId&&c7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;O7(d,a.A.getEstimatedTime());W7(a,d)}else c7("CP","No cast media video. Ignoring state update.")},Z7=function(a,b,c){return(0,g.B)(function(d){this.sc("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.sc("Retrying "+b+" using MDx browser channel."),Y7(this,b,c))},a)},$7=function(a,b,c){g.vH.call(this);
this.D=NaN;this.W=!1;this.K=this.J=this.L=this.M=NaN;this.P=[];this.B=this.G=this.C=this.ob=this.o=null;this.ua=a;this.P.push(g.eH(window,"beforeunload",(0,g.B)(this.dL,this)));this.A=[];this.ob=new L7;this.aa=b.id;this.o=AGa(this,c);this.o.subscribe("handlerOpened",this.MQ,this);this.o.subscribe("handlerClosed",this.JQ,this);this.o.subscribe("handlerError",this.KQ,this);this.o.subscribe("handlerMessage",this.LQ,this);NFa(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.ob.videoId;
g.MI()&&g.JI("yt-remote-session-video-id",d)},this)},a8=function(a){c7("conn",a)},AGa=function(a,b){return new X6($6(a.ua,"/bc"),b)},b8=function(a,b){a.U("proxyStateChange",b)},BGa=function(a){a.D=g.oF((0,g.B)(function(){a8("Connecting timeout");
this.F(1)},a),2E4)},c8=function(a){g.qF(a.D);
a.D=NaN},d8=function(a){g.qF(a.M);
a.M=NaN},CGa=function(a){e8(a);
a.L=g.oF((0,g.B)(function(){f8(this,"getNowPlaying")},a),2E4)},e8=function(a){g.qF(a.L);
a.L=NaN},EGa=function(a,b){b&&(c8(a),d8(a));
b==(Y6(a.o)&&isNaN(a.D))?b&&(b8(a,1),f8(a,"getSubtitlesTrack")):b?(a.Y()&&a.ob.reset(),b8(a,1),f8(a,"getNowPlaying"),DGa(a)):a.F(1)},FGa=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.ob.videoId&&(g.cc(b.params)?a.ob.o=null:a.ob.o=b.params,a.U("remotePlayerChange"))},GGa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.ob.listId=b.params.listId||a.ob.listId;Q7(a.ob,c,d);a.U("remoteQueueChange")},IGa=function(a,b){b.params=b.params||{};
GGa(a,b);HGa(a,b);a.U("autoplayDismissed")},HGa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
O7(a.ob,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.ob.playerState&&(c=-1E3);a.ob.playerState=c;c=Number(b.params.loadedTime);a.ob.J=isNaN(c)?0:c;c=Number(b.params.duration);a.ob.H=isNaN(c)?0:c;c=a.ob;var d=Number(b.params.liveIngestionTime);c.C=d;c.D=isNaN(d)?!1:!0;c=a.ob;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.B=isNaN(d)?0:d;c.A=isNaN(e)?0:e;1==a.ob.playerState?CGa(a):e8(a);a.U("remotePlayerChange")},JGa=function(a,b){if(-1E3!=
a.ob.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.ob.playerState=c;c=parseInt(b.params.currentTime,10);O7(a.ob,isNaN(c)?0:c);a.U("remotePlayerChange")}},KGa=function(a,b){var c="true"==b.params.muted;
a.ob.volume=parseInt(b.params.volume,10);a.ob.muted=c;a.U("remotePlayerChange")},LGa=function(a,b){a.G=b.params.videoId;
a.U("nowAutoplaying",parseInt(b.params.timeout,10))},MGa=function(a,b){var c="true"==b.params.hasNext;
a.ob.Xf="true"==b.params.hasPrevious;a.ob.hasNext=c;a.U("previousNextChange")},DGa=function(a){g.qF(a.K);
a.K=g.oF((0,g.B)(a.F,a,1),864E5)},f8=function(a,b,c){c?a8("Sending: action="+b+", params="+g.hh(c)):a8("Sending: action="+b);
a.o.sendMessage(b,c)},g8=function(a){g7.call(this,"ScreenServiceProxy");
this.kd=a;this.A=[];this.A.push(this.kd.$_s("screenChange",(0,g.B)(this.BW,this)));this.A.push(this.kd.$_s("onlineScreenChange",(0,g.B)(this.CS,this)))},RGa=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.fF("MDX_CONFIG")||b;VEa();q6();h8||(h8=new Z6(b?b.loungeApiHost:void 0),cFa()&&(h8.o="/api/loungedev"));i8||(i8=g.z("yt.mdx.remote.deferredProxies_")||[],g.Da("yt.mdx.remote.deferredProxies_",i8,void 0));NGa();var c=j8();if(!c){var d=new p7(h8);g.Da("yt.mdx.remote.screenService_",d,void 0);c=j8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);rGa(a,d,function(m){m?k8()&&K7(k8(),"YouTube TV"):d.subscribe("onlineScreenChange",
function(){e6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.z("yt.mdx.remote.initialized_")&&(g.Da("yt.mdx.remote.initialized_",!0,void 0),l8("Initializing: "+g.hh(b)),m8.push(g.vF("yt-remote-cast2-availability-change",function(){e6("yt-remote-receiver-availability-change")})),m8.push(g.vF("yt-remote-cast2-receiver-selected",function(){n8(null);
e6("yt-remote-auto-connect","cast-selector-receiver")})),m8.push(g.vF("yt-remote-cast2-receiver-resumed",function(){e6("yt-remote-receiver-resumed","cast-selector-receiver")})),m8.push(g.vF("yt-remote-cast2-session-change",OGa)),m8.push(g.vF("yt-remote-connection-change",function(m){m?K7(k8(),"YouTube TV"):o8()||(K7(null,null),uGa())})),a=p8(),b.isAuto&&(a.id+="#dial"),g.UF("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),l8(" -- with channel params: "+
g.hh(a)),PGa(a),c.start(),k8()||QGa())},TGa=function(){var a=SGa();
H7()&&g.KI("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},SGa=function(){var a=j8().kd.$_gos();
var b=q8();b&&r8()&&(l6(a,b)||a.push(b));return UEa(a)},s8=function(){var a=UGa();
!a&&H7()&&tGa()&&(a={key:"cast-selector-receiver",name:tGa()});return a},UGa=function(){var a=SGa(),b=q8();
b||(b=o8());return g.Ua(a,function(c){return b&&h6(b,c.key)?!0:!1})},q8=function(){var a=k8();
if(!a)return null;var b=j8().ze();return m6(b,a)},OGa=function(a){l8("remote.onCastSessionChange_: "+i6(a));
if(a){var b=q8();b&&b.id==a.id?K7(b.id,"YouTube TV"):(b&&t8(),u8(a,1))}else r8()&&t8()},t8=function(){I7()?F7().stopSession():D7("stopSession called before API ready.");
var a=r8();a&&(a.disconnect(1),v8(null))},w8=function(){var a=r8();
return!!a&&3!=a.getProxyState()},l8=function(a){c7("remote",a)},j8=function(){if(!x8){var a=g.z("yt.mdx.remote.screenService_");
x8=a?new g8(a):null}return x8},k8=function(){return g.z("yt.mdx.remote.currentScreenId_")},VGa=function(a){g.Da("yt.mdx.remote.currentScreenId_",a,void 0)},WGa=function(){return g.z("yt.mdx.remote.connectData_")},n8=function(a){g.Da("yt.mdx.remote.connectData_",a,void 0)},r8=function(){return g.z("yt.mdx.remote.connection_")},v8=function(a){var b=r8();
n8(null);a||VGa("");g.Da("yt.mdx.remote.connection_",a,void 0);i8&&((0,g.E)(i8,function(c){c(a)}),i8.length=0);
b&&!a?e6("yt-remote-connection-change",!1):!b&&a&&e6("yt-remote-connection-change",!0)},o8=function(){var a=g.MI();
if(!a)return null;var b=j8().ze();return m6(b,a)},u8=function(a,b){q8()&&q8();
VGa(a.id);var c=new $7(h8,a,p8());c.connect(b,WGa());c.subscribe("beforeDisconnect",function(d){e6("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){r8()&&v8(null)});
v8(c)},QGa=function(){var a=o8();
a?(l8("Resume connection to: "+i6(a)),u8(a,0)):(r6(),uGa(),l8("Skipping connecting because no session screen found."))},NGa=function(){var a=p8();
if(g.cc(a)){a=p6();var b=g.KI("yt-remote-session-name")||"",c=g.KI("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)}},p8=function(){return g.z("yt.mdx.remote.channelParams_")||{}},PGa=function(a){a?(g.JI("yt-remote-session-app",a.app),g.JI("yt-remote-session-name",a.name)):(g.LI("yt-remote-session-app"),g.LI("yt-remote-session-name"));
g.Da("yt.mdx.remote.channelParams_",a,void 0)},y8=function(a,b,c){g.L.call(this);
this.D=a;this.A=b;this.C=new g.sH(this);g.M(this,this.C);this.C.R(b,"onCaptionsTrackListChanged",this.VR);this.C.R(b,"captionschanged",this.GQ);this.C.R(b,"captionssettingschanged",this.rG);this.C.R(b,"videoplayerreset",this.Vq);this.C.R(b,"mdxautoplaycancel",this.YJ);this.P=this.C.R(b,"onVolumeChange",this.GE);this.H=!1;this.o=c;c.subscribe("proxyStateChange",this.VE,this);c.subscribe("remotePlayerChange",this.Gn,this);c.subscribe("remoteQueueChange",this.Vq,this);c.subscribe("autoplayUpNext",this.sE,
this);c.subscribe("previousNextChange",this.SE,this);c.subscribe("nowAutoplaying",this.KE,this);c.subscribe("autoplayDismissed",this.rE,this);this.suggestion=null;this.J=new g.FQ(64);this.B=new g.V(this.oG,500,this);g.M(this,this.B);this.F=new g.V(this.pG,1E3,this);g.M(this,this.F);this.L=new x6(this.dW,0,this);g.M(this,this.L);this.G={};this.M=new g.V(this.NG,1E3,this);g.M(this,this.M);this.K=new g.sm(this.DO,1E3,this);g.M(this,this.K);this.W=g.A;this.rG();this.Vq();this.Gn()},z8=function(a,b){a.D.Ie(b,
a.A.getVideoData().lengthSeconds)},XGa=function(a){z8(a,0);
a.B.stop();A8(a,new g.FQ(64))},C8=function(a,b){if(B8(a)&&!a.H){var c=null;
b&&(c={style:a.A.getSubtitlesUserSettings()},g.kc(c,b));a.o.cG(a.A.getVideoData(1).videoId,c);a.G=U7(a.o).o}},D8=function(a,b){var c=a.A.getPlaylist();
if(c){var d=c.ye();var e=c.listId.toString()}c=a.A.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.rk,MEa(c));A8(a,new g.FQ(1))},YGa=function(a,b){if(b){var c=a.A.getOption("captions","tracklist",{F4:1});
c&&c.length?(a.A.setOption("captions","track",b),a.H=!1):(a.A.loadModule("captions"),a.H=!0)}else a.A.setOption("captions","track",{})},B8=function(a){return U7(a.o).videoId==a.A.getVideoData(1).videoId},A8=function(a,b){a.F.stop();
var c=a.J;if(!g.LQ(c,b)){var d=g.X(b,2);d!=g.X(a.J,2)&&g.RU(a.A,d);a.J=b;ZGa(a.D,c,b)}},E8=function(a){g.W.call(this,{I:"div",
N:"ytp-remote",O:[{I:"div",N:"ytp-remote-display-status",O:[{I:"div",N:"ytp-remote-display-status-icon",O:[g.ita()]},{I:"div",N:"ytp-remote-display-status-text",ca:"{{statustext}}"}]}]});this.B=new g.HV(this,250);g.M(this,this.B);this.D=a;this.R(a,"presentingplayerstatechange",this.F);$Ga(this,g.NU(a))},$Ga=function(a,b){if(3==a.D.getPresentingPlayerType()){var c={RECEIVER_NAME:a.D.getOption("remote","currentReceiver").name};
c=g.X(b,128)?g.uV("$RECEIVER_NAME cihaz\u0131nda hata olu\u015ftu",c):b.sb()||g.X(b,4)?g.uV("$RECEIVER_NAME cihaz\u0131nda oynat\u0131l\u0131yor",c):g.uV("$RECEIVER_NAME cihaz\u0131na ba\u011flan\u0131ld\u0131",c);a.updateValue("statustext",c);a.B.show()}else a.B.hide()},F8=function(a,b){g.YW.call(this,"Oynat\u0131lacak ekran se\u00e7in",0,a,b);
this.B=a;this.K={};this.R(a,"onMdxReceiversChange",this.M);this.R(a,"presentingplayerstatechange",this.M);this.M()},G8=function(a){g.kV.call(this,a);
this.A={key:k6(),name:"Bu bilgisayar"};this.B=null;this.D=[];this.G=this.o=null;this.F=[this.A];this.C=this.A;this.nn=new g.FQ(64);this.J=0;this.H=-1;if(!g.lO(g.Y(this.player))){a=this.player;var b=g.uQ(a);b&&(b=b.qn())&&(b=new F8(a,b),g.M(this,b));b=new E8(a);g.M(this,b);g.bV(a,b.element,4)}},ZGa=function(a,b,c){a.nn=c;
a.player.U("presentingplayerstatechange",new g.PQ(c,b))},H8=function(a,b){if(b.key!=a.C.key)if(b.key==a.A.key)t8();
else{a.C=b;var c=a.player.getPlaylistId();var d=a.player.getVideoData(1);var e=d.videoId;if(c||e){var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.Aa(l).videoId}else k=[e];f=a.player.getCurrentTime(1);c={videoIds:k,listId:c,videoId:e,playerParams:d.playerParams,clickTrackingParams:d.rk,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(d=MEa(d))&&(c.locationInfo=d);d=c}else d=null;l8("Connecting to: "+g.hh(b));"cast-selector-receiver"==b.key?
(n8(d||null),I7()?F7().setLaunchParams(d||null):D7("setLaunchParams called before ready.")):!d&&w8()&&k8()==b.key?e6("yt-remote-connection-change",!0):(t8(),n8(d||null),d=j8().ze(),(d=m6(d,b.key))&&u8(d,1))}},oFa={"\x00":"\\0",
"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"<"},H6={"'":"\\'"},aHa={},QEa={aY:"atp",I2:"ska",V1:"que",e1:"mus",E2:"sus",o_:"dsp",o2:"seq"};
f6.prototype.qh=function(){var a=new f6({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.C=this.C;a.A=this.A;a.o=this.o};
var s6,o6="",w6=t6("loadGamesSDK")?"/cast_game_sender.js":"/cast_sender.js",gFa=t6("loadCastFramework")||t6("loadCastApplicationFramework"),qGa=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.C(x6,g.L);g.h=x6.prototype;g.h.YK=function(a){this.B=arguments;this.o=!1;this.Fa?this.C=(0,g.J)()+this.Ed:this.Fa=g.ch(this.D,this.Ed)};
g.h.stop=function(){this.Fa&&(g.dh(this.Fa),this.Fa=null);this.C=null;this.o=!1;this.B=[]};
g.h.pause=function(){++this.A};
g.h.resume=function(){this.A&&(--this.A,!this.A&&this.o&&(this.o=!1,this.F.apply(null,this.B)))};
g.h.V=function(){this.stop();x6.fa.V.call(this)};
g.h.ZK=function(){this.C?(this.Fa=g.ch(this.D,this.C-(0,g.J)()),this.C=null):(this.Fa=null,this.A?this.o=!0:(this.o=!1,this.F.apply(null,this.B)))};y6.prototype.stringify=function(a){return g.y.JSON.stringify(a,void 0)};
y6.prototype.parse=function(a){return g.y.JSON.parse(a,void 0)};g.h=z6.prototype;g.h.Ki=null;g.h.Hf=!1;g.h.Al=null;g.h.Gy=null;g.h.Zk=null;g.h.fk=null;g.h.zh=null;g.h.ai=null;g.h.lj=null;g.h.Xc=null;g.h.jo=0;g.h.Jf=null;g.h.os=null;g.h.Ah=null;g.h.Jm=-1;g.h.OF=!0;g.h.pi=!1;g.h.Mu=0;g.h.sr=null;var mFa={},C6={};g.h=z6.prototype;g.h.setTimeout=function(a){this.B=a};
g.h.dV=function(a){a=a.target;var b=this.sr;b&&3==g.Hy(a)?b.Fm():this.YG(a)};
g.h.YG=function(a){try{if(a==this.Xc)a:{var b=g.Hy(this.Xc),c=this.Xc.A,d=this.Xc.getStatus();if(g.de&&!g.Mc(10)||g.fe&&!g.Lc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Sf&&!g.Ly(this.Xc))break a;this.pi||4!=b||7==c||(8==c||0>=d?this.o.Bf(3):this.o.Bf(2));J6(this);var e=this.Xc.getStatus();this.Jm=e;var f=g.Ly(this.Xc);(this.Hf=200==e)?(4==b&&F6(this),this.D?(nFa(this,b,f),g.Sf&&this.Hf&&3==b&&(this.Z.X(this.A,"tick",this.YU),this.A.start())):E6(this,f),this.Hf&&!this.pi&&(4==b?this.o.Tq(this):
(this.Hf=!1,B6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Ah=3,D6(13)):(this.Ah=0,D6(14)),F6(this),G6(this))}}catch(k){this.Xc&&g.Ly(this.Xc)}finally{}};
g.h.YU=function(){var a=g.Hy(this.Xc),b=g.Ly(this.Xc);this.jo<b.length&&(J6(this),nFa(this,a,b),this.Hf&&4!=a&&B6(this))};
g.h.lU=function(a){I6((0,g.B)(this.kU,this,a),0)};
g.h.kU=function(a){this.pi||(J6(this),E6(this,a),B6(this))};
g.h.dF=function(a){I6((0,g.B)(this.jU,this,a),0)};
g.h.jU=function(a){this.pi||(F6(this),this.Hf=a,this.o.Tq(this),this.o.Bf(4))};
g.h.cancel=function(){this.pi=!0;F6(this)};
g.h.AU=function(){this.Al=null;var a=(0,g.J)();0<=a-this.Gy?(2!=this.fk&&this.o.Bf(3),F6(this),this.Ah=2,D6(18),G6(this)):qFa(this,this.Gy-a)};
g.h.getLastError=function(){return this.Ah};g.h=tFa.prototype;g.h.Ku=null;g.h.oe=null;g.h.tr=!1;g.h.SB=null;g.h.xp=null;g.h.Qv=null;g.h.Lu=null;g.h.Xe=null;g.h.Pg=-1;g.h.Im=null;g.h.Pl=null;g.h.connect=function(a){this.Lu=a;a=L6(this.o,null,this.Lu);D6(3);this.SB=(0,g.J)();var b=this.o.H;null!=b?(this.Im=b[0],(this.Pl=b[1])?(this.Xe=1,uFa(this)):(this.Xe=2,N6(this))):(d6(a,"MODE","init"),this.oe=new z6(this,void 0,void 0,void 0),this.oe.Ki=this.Ku,A6(this.oe,a,!1,null,!0),this.Xe=0)};
g.h.ZJ=function(a){if(a)this.Xe=2,N6(this);else{D6(4);var b=this.o;b.Tf=b.ph.Pg;U6(b,9)}a&&this.Bf(2)};
g.h.fu=function(a){return this.o.fu(a)};
g.h.abort=function(){this.oe&&(this.oe.cancel(),this.oe=null);this.Pg=-1};
g.h.RB=function(){return!1};
g.h.WE=function(a,b){this.Pg=a.Jm;if(0==this.Xe)if(b){try{var c=this.A.parse(b)}catch(d){c=this.o;c.Tf=this.Pg;U6(c,2);return}this.Im=c[0];this.Pl=c[1]}else c=this.o,c.Tf=this.Pg,U6(c,2);else if(2==this.Xe)if(this.tr)D6(7),this.Qv=(0,g.J)();else if("11111"==b){if(D6(6),this.tr=!0,this.xp=(0,g.J)(),c=this.xp-this.SB,!g.de||g.Mc(10)||500>c)this.Pg=200,this.oe.cancel(),D6(12),M6(this.o,this,!0)}else D6(8),this.xp=this.Qv=(0,g.J)(),this.tr=!1};
g.h.Tq=function(){this.Pg=this.oe.Jm;if(this.oe.Hf)0==this.Xe?this.Pl?(this.Xe=1,uFa(this)):(this.Xe=2,N6(this)):2==this.Xe&&((!g.de||g.Mc(10)?!this.tr:200>this.Qv-this.xp)?(D6(11),M6(this.o,this,!1)):(D6(12),M6(this.o,this,!0)));else{0==this.Xe?D6(9):2==this.Xe&&D6(10);var a=this.o;this.oe.getLastError();a.Tf=this.Pg;U6(a,2)}};
g.h.Xn=function(){return this.o.Xn()};
g.h.isActive=function(){return this.o.isActive()};
g.h.Bf=function(a){this.o.Bf(a)};g.h=O6.prototype;g.h.jm=null;g.h.ie=null;g.h.Bc=null;g.h.Ju=null;g.h.zp=null;g.h.mA=null;g.h.Mp=null;g.h.zn=0;g.h.XP=0;g.h.Dd=null;g.h.th=null;g.h.Bg=null;g.h.yi=null;g.h.ph=null;g.h.ks=null;g.h.zk=-1;g.h.HC=-1;g.h.Tf=-1;g.h.Wj=0;g.h.Mj=0;g.h.ti=8;var V6=new g.rg;g.C(wFa,g.Qf);g.C(xFa,g.Qf);g.C(yFa,g.Qf);g.h=O6.prototype;g.h.connect=function(a,b,c,d,e){D6(0);this.Ju=b;this.jm=c||{};d&&g.v(e)&&(this.jm.OSID=d,this.jm.OAID=e);this.F?(I6((0,g.B)(this.DA,this,a),100),CFa(this)):this.DA(a)};
g.h.DA=function(a){this.ph=new tFa(this);this.ph.Ku=null;this.ph.A=this.D;this.ph.connect(a)};
g.h.RB=function(){return 0==this.o};
g.h.cF=function(a){this.th=null;FFa(this,a)};
g.h.bF=function(){this.Bg=null;this.Bc=new z6(this,this.C,"rpc",this.G);this.Bc.Ki=null;this.Bc.Mu=0;var a=this.mA.clone();g.Yn(a,"RID","rpc");g.Yn(a,"SID",this.C);g.Yn(a,"CI",this.ks?"0":"1");g.Yn(a,"AID",this.zk);P6(this,a);if(!g.de||g.Mc(10))g.Yn(a,"TYPE","xmlhttp"),A6(this.Bc,a,!0,this.Mp,!1);else{g.Yn(a,"TYPE","html");var b=this.Bc,c=!!this.Mp;b.fk=3;b.zh=c6(a.clone());pFa(b,c)}};
g.h.WE=function(a,b){if(0!=this.o&&(this.Bc==a||this.ie==a))if(this.Tf=a.Jm,this.ie==a&&3==this.o)if(7<this.ti){try{var c=this.D.parse(b)}catch(f){c=null}if(g.Ga(c)&&3==c.length)if(0==c[0])a:{if(!this.Bg){if(this.Bc)if(this.Bc.Zk+3E3<this.ie.Zk)R6(this),this.Bc.cancel(),this.Bc=null;else break a;T6(this);D6(19)}}else this.HC=c[1],0<this.HC-this.zk&&37500>c[2]&&this.ks&&0==this.Mj&&!this.yi&&(this.yi=I6((0,g.B)(this.BQ,this),6E3));else U6(this,11)}else b!=aHa.dZ.o&&U6(this,11);else if(this.Bc==a&&
R6(this),!g.G(b)){c=this.D.parse(b);g.Ga(c);for(var d=0;d<c.length;d++){var e=c[d];this.zk=e[0];e=e[1];2==this.o?"c"==e[0]?(this.C=e[1],this.Mp=e[2],e=e[3],null!=e?this.ti=e:this.ti=6,this.o=3,this.Dd&&this.Dd.yA(),this.mA=L6(this,this.Xn()?this.Mp:null,this.Ju),GFa(this)):"stop"==e[0]&&U6(this,7):3==this.o&&("stop"==e[0]?U6(this,7):"noop"!=e[0]&&this.Dd&&this.Dd.xA(e),this.Mj=0)}}};
g.h.BQ=function(){null!=this.yi&&(this.yi=null,this.Bc.cancel(),this.Bc=null,T6(this),D6(20))};
g.h.Tq=function(a){if(this.Bc==a){R6(this);this.Bc=null;var b=2}else if(this.ie==a)this.ie=null,b=1;else return;this.Tf=a.Jm;if(0!=this.o)if(a.Hf)1==b?(b=(0,g.J)()-a.Zk,V6.dispatchEvent(new xFa(V6,a.lj?a.lj.length:0,b,this.Wj)),Q6(this),this.B.length=0):GFa(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.Tf)){if(d=1==b)this.ie||this.th||1==this.o||2<=this.Wj?d=!1:(this.th=I6((0,g.B)(this.cF,this,a),HFa(this,this.Wj)),this.Wj++,d=!0);d=!(d||2==b&&T6(this))}if(d)switch(c){case 1:U6(this,
5);break;case 4:U6(this,10);break;case 3:U6(this,6);break;case 7:U6(this,12);break;default:U6(this,2)}}};
g.h.vK=function(a){if(!g.Ya(arguments,this.o))throw Error("Unexpected channel state: "+this.o);};
g.h.TV=function(a){a?D6(2):(D6(1),IFa(this,8))};
g.h.fu=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.By;a.H=!1;return a};
g.h.isActive=function(){return!!this.Dd&&this.Dd.isActive(this)};
g.h.Bf=function(a){V6.dispatchEvent(new yFa(V6,a))};
g.h.Xn=function(){return!(!g.de||g.Mc(10))};
g.h=JFa.prototype;g.h.yA=function(){};
g.h.xA=function(){};
g.h.wA=function(){};
g.h.Rt=function(){};
g.h.xB=function(){return{}};
g.h.isActive=function(){return!0};g.C(W6,g.L);g.h=W6.prototype;g.h.bU=function(){this.Ed=Math.min(3E5,2*this.Ed);this.C();this.A&&this.start()};
g.h.start=function(){var a=this.Ed+15E3*Math.random();g.Av(this.o,a);this.A=(0,g.J)()+a};
g.h.stop=function(){this.o.stop();this.A=0};
g.h.isActive=function(){return this.o.isActive()};
g.h.reset=function(){this.o.stop();this.Ed=5E3};g.C(X6,JFa);g.h=X6.prototype;g.h.subscribe=function(a,b,c){return this.C.subscribe(a,b,c)};
g.h.unsubscribe=function(a,b,c){return this.C.unsubscribe(a,b,c)};
g.h.Ek=function(a){return this.C.Li(a)};
g.h.U=function(a,b){return this.C.U.apply(this.C,arguments)};
g.h.dispose=function(){this.Bb||(this.Bb=!0,g.Of(this.C),MFa(this),g.Of(this.A),this.A=null)};
g.h.la=function(){return this.Bb};
g.h.connect=function(a,b,c){if(!this.o||2!=this.o.o){this.J="";this.A.stop();this.D=a||null;this.B=b||0;a=this.K+"/test";b=this.K+"/bind";var d=new O6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.L),e=this.o;e&&(e.Dd=null);d.Dd=this;this.o=d;e?this.o.connect(a,b,this.F,e.C,e.zk):c?this.o.connect(a,b,this.F,c.sessionId,c.arrayId):this.o.connect(a,b,this.F)}};
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.kc(c,b);this.A.isActive()||2==(this.o?this.o.o:0)?this.G.push(c):Y6(this)&&DFa(this.o,c)};
g.h.yA=function(){this.A.reset();this.D=null;this.B=0;if(this.G.length){var a=this.G;this.G=[];for(var b=0,c=a.length;b<c;++b)DFa(this.o,a[b])}this.U("handlerOpened")};
g.h.wA=function(a){var b=2==a&&401==this.o.Tf;4==a||b||this.A.start();this.U("handlerError",a)};
g.h.Rt=function(a){if(!this.A.isActive())this.U("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.G.push(d)}};
g.h.xB=function(){var a={v:2};this.J&&(a.gsessionid=this.J);0!=this.B&&(a.ui=""+this.B);0!=this.H&&(a.ui=""+this.H);this.D&&g.kc(a,this.D);return a};
g.h.xA=function(a){"S"==a[0]?this.J=a[1]:"gracefulReconnect"==a[0]?(this.A.start(),BFa(this.o)):this.U("handlerMessage",new KFa(a[0],a[1]))};
g.h.xW=function(){this.A.isActive();var a=this.o,b=0;a.Bc&&b++;a.ie&&b++;0!=b||this.connect(this.D,this.B)};Z6.prototype.B=function(a,b,c,d){b?a(d):a({text:c.responseText})};
Z6.prototype.C=function(a,b){a(Error("Request error: "+b.status))};
Z6.prototype.D=function(a){a(Error("request timed out"))};var UFa=(0,g.J)(),b7=null,e7=Array(50),d7=-1,f7=!1;g.C(g7,g.vH);g7.prototype.ze=function(){return this.o};
g7.prototype.contains=function(a){return!!l6(this.o,a)};
g7.prototype.get=function(a){return a?m6(this.o,a):null};
g7.prototype.info=function(a){c7(this.G,a)};g.C(h7,g.vH);var bHa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.h=h7.prototype;g.h.start=function(){!this.o&&isNaN(this.Fa)&&this.bH()};
g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Fa)||(g.qF(this.Fa),this.Fa=NaN)};
g.h.V=function(){this.stop();h7.fa.V.call(this)};
g.h.bH=function(){this.Fa=NaN;this.o=g.cG($6(this.F,"/pairing/get_screen"),{method:"POST",Sb:{pairing_code:this.D},timeout:5E3,onSuccess:(0,g.B)(this.zW,this),onError:(0,g.B)(this.yW,this),Hd:(0,g.B)(this.AW,this)})};
g.h.zW=function(a,b){this.o=null;var c=b.screen||{};c.dialId=this.C;c.name=this.B;this.U("pairingComplete",new g6(c))};
g.h.yW=function(a){this.o=null;a.status&&404==a.status?this.A>=bHa.length?this.U("pairingFailed",Error("DIAL polling timed out")):(a=bHa[this.A],this.Fa=g.oF((0,g.B)(this.bH,this),a),this.A++):this.U("pairingFailed",Error("Server error "+a.status))};
g.h.AW=function(){this.o=null;this.U("pairingFailed",Error("Server not responding"))};g.C(j7,g7);g.h=j7.prototype;g.h.start=function(){i7(this)&&this.U("screenChange");!g.KI("yt-remote-lounge-token-expiration")&&YFa(this);g.qF(this.A);this.A=g.oF((0,g.B)(this.start,this),1E4)};
g.h.add=function(a,b){i7(this);VFa(this,a);k7(this,!1);this.U("screenChange");b(a);a.token||YFa(this)};
g.h.remove=function(a,b){var c=i7(this);XFa(this,a)&&(k7(this,!1),c=!0);b(a);c&&this.U("screenChange")};
g.h.ds=function(a,b,c,d){var e=i7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,k7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.U("screenChange")};
g.h.V=function(){g.qF(this.A);j7.fa.V.call(this)};
g.h.nL=function(a){i7(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)}k7(this,!b);b&&c7(this.G,"Missed "+b+" lounge tokens.")};
g.h.mL=function(a){c7(this.G,"Requesting lounge tokens failed: "+a)};g.C(m7,g.vH);g.h=m7.prototype;g.h.start=function(){var a=parseInt(g.KI("yt-remote-fast-check-period")||"0",10);(this.B=(0,g.J)()-144E5<a?0:a)?o7(this):(this.B=(0,g.J)()+3E5,g.JI("yt-remote-fast-check-period",this.B),this.xx())};
g.h.isEmpty=function(){return g.cc(this.o)};
g.h.update=function(){l7("Updating availability on schedule.");var a=this.F(),b=g.Nb(this.o,function(c,d){return c&&!!m6(a,d)},this);
n7(this,b)};
g.h.V=function(){g.qF(this.C);this.C=NaN;this.A&&(this.A.abort(),this.A=null);m7.fa.V.call(this)};
g.h.xx=function(){g.qF(this.C);this.C=NaN;this.A&&this.A.abort();var a=aGa(this);if(g.Sb(a)){var b=$6(this.D,"/pairing/get_screen_availability");this.A=a7(this.D,b,{lounge_token:g.Vb(a).join(",")},(0,g.B)(this.DT,this,a),(0,g.B)(this.CT,this))}else n7(this,{}),o7(this)};
g.h.DT=function(a,b){this.A=null;var c=g.Vb(aGa(this));if(g.tb(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;n7(this,d);o7(this)}else this.sc("Changing Screen set during request."),this.xx()};
g.h.CT=function(a){this.sc("Screen availability failed: "+a);this.A=null;o7(this)};
g.h.sc=function(a){c7("OnlineScreenService",a)};g.C(p7,g7);g.h=p7.prototype;g.h.start=function(){this.C.start();this.A.start();this.o.length&&(this.U("screenChange"),this.A.isEmpty()||this.U("onlineScreenChange"))};
g.h.add=function(a,b,c){this.C.add(a,b,c)};
g.h.remove=function(a,b,c){this.C.remove(a,b,c);this.A.update()};
g.h.ds=function(a,b,c,d){this.C.contains(a)?this.C.ds(a,b,c,d):(a="Updating name of unknown screen: "+a.name,c7(this.G,a),d(Error(a)))};
g.h.ze=function(a){return a?this.o:g.gb(this.o,(0,g.re)(this.B,function(b){return!this.contains(b)},this))};
g.h.cH=function(){return(0,g.re)(this.ze(!0),function(a){return!!this.A.o[a.id]},this)};
g.h.dH=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new h7(this.F,a,b,c);f.subscribe("pairingComplete",(0,g.B)(function(k){g.Of(f);d(q7(this,k))},this));
f.subscribe("pairingFailed",function(k){g.Of(f);e(k)});
f.start();return(0,g.B)(f.stop,f)};
g.h.DW=function(a,b,c,d){g.cG($6(this.F,"/pairing/get_screen"),{method:"POST",Sb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.B)(function(e,f){var k=new g6(f.screen||{});if(!k.name||eGa(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);eGa(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(q7(this,k))},this),
onError:(0,g.B)(function(e){d(Error("pairing request failed: "+e.status))},this),
Hd:(0,g.B)(function(){d(Error("pairing request timed out."))},this)})};
g.h.V=function(){g.Of(this.C);g.Of(this.A);p7.fa.V.call(this)};
g.h.AL=function(){fGa(this);this.U("screenChange");this.A.update()};
p7.prototype.dispose=p7.prototype.dispose;g.C(s7,g.vH);g.h=s7.prototype;g.h.Uq=function(a){this.C=a;this.U("sessionScreen",this.C)};
g.h.Ee=function(a){this.la()||(a&&t7(this,""+a),this.C=null,this.U("sessionScreen",null))};
g.h.info=function(a){c7(this.M,a)};
g.h.fH=function(){return null};
g.h.Jx=function(a){var b=this.A;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.B)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.B)(function(){t7(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.h.V=function(){this.Jx("");s7.fa.V.call(this)};g.C(u7,s7);g.h=u7.prototype;g.h.Ix=function(a){if(this.o){if(this.o==a)return;t7(this,"Overriding cast sesison with new session object");this.o.removeUpdateListener(this.F);this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D)}this.o=a;this.o.addUpdateListener(this.F);this.o.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.D);hGa(this)};
g.h.Bk=function(a){this.info("launchWithParams no-op for Cast: "+g.hh(a))};
g.h.stop=function(){this.o?this.o.stop((0,g.B)(function(){this.Ee()},this),(0,g.B)(function(){this.Ee(Error("Failed to stop receiver app."))},this)):this.Ee(Error("Stopping cast device witout session."))};
g.h.Jx=g.A;g.h.V=function(){this.info("disposeInternal");g.qF(this.B);this.B=0;this.o&&(this.o.removeUpdateListener(this.F),this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D));this.o=null;u7.fa.V.call(this)};
g.h.MU=function(a,b){if(!this.la())if(b){var c=g.vy(b);if(g.Ka(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.hh(c));switch(d){case "mdxSessionStatus":gGa(this,c.screenId);break;default:t7(this,"Unknown youtube message: "+d)}}else t7(this,"Unable to parse message.")}else t7(this,"No data in message.")};
g.h.IB=function(a,b,c,d){dGa(this.J,this.A.label,a,this.A.friendlyName,(0,g.B)(function(e){e?b(e):0<=d?(t7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.oF((0,g.B)(this.IB,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.fH=function(){return this.o};
g.h.EW=function(a){this.la()||a||(t7(this,"Cast session died."),this.Ee())};g.C(v7,s7);g.h=v7.prototype;g.h.Ix=function(a){this.B=a;this.B.addUpdateListener(this.L)};
g.h.Bk=function(a){this.D=a;this.G()};
g.h.stop=function(){this.o();this.o=g.A;g.qF(this.F);this.B?this.B.stop((0,g.B)(this.Ee,this,null),(0,g.B)(this.Ee,this,"Failed to stop DIAL device.")):this.Ee()};
g.h.V=function(){this.o();this.o=g.A;g.qF(this.F);this.B&&this.B.removeUpdateListener(this.L);this.B=null;v7.fa.V.call(this)};
g.h.HW=function(a){this.la()||a||(t7(this,"DIAL session died."),this.o(),this.o=g.A,this.Ee())};
g.h.tv=function(a){this.K=k6();if(this.D){var b=new chrome.cast.DialLaunchResponse(!0,jGa(this));a(b);iGa(this)}else this.G=(0,g.B)(function(){g.qF(this.F);this.G=g.A;this.F=NaN;var c=new chrome.cast.DialLaunchResponse(!0,jGa(this));a(c);iGa(this)},this),this.F=g.oF((0,g.B)(function(){this.G()},this),100)};
g.h.OM=function(a,b,c){dGa(this.J,this.H.receiver.label,a,this.A.friendlyName,(0,g.B)(function(d){d&&d.token?(this.Uq(d),b(new chrome.cast.DialLaunchResponse(!1))):this.tv(b,c)},this),(0,g.B)(function(d){t7(this,"Failed to get DIAL screen: "+d);
this.tv(b,c)},this))};g.C(w7,s7);w7.prototype.stop=function(){this.Ee()};
w7.prototype.Ix=g.A;w7.prototype.Bk=function(){g.qF(this.o);this.o=NaN;var a=m6(this.J.ze(),this.A.label);a?this.Uq(a):this.Ee(Error("No such screen"))};
w7.prototype.V=function(){g.qF(this.o);this.o=NaN;w7.fa.V.call(this)};g.C(x7,g.vH);g.h=x7.prototype;
g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.G);this.H||(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;c=new chrome.cast.ApiConfig(c,(0,g.B)(this.YE,this),(0,g.B)(this.lT,this),d,e);c.customDialLaunchCallback=(0,g.B)(this.jR,this);chrome.cast.initialize(c,(0,g.B)(function(){this.la()||
(chrome.cast.addReceiverActionListener(this.B),RFa(),this.A.subscribe("onlineScreenChange",(0,g.B)(this.eH,this)),this.C=lGa(this),chrome.cast.setCustomReceivers(this.C,g.A,(0,g.B)(function(f){this.sc("Failed to set initial custom receivers: "+g.hh(f))},this)),this.U("yt-remote-cast2-availability-change",z7(this)),b(!0))},this),(0,g.B)(function(f){this.sc("Failed to initialize API: "+g.hh(f));
b(!1)},this))};
g.h.BV=function(a,b){y7("Setting connected screen ID: "+a+" -> "+b);if(this.o){var c=this.o.C;if(!a||c&&c.id!=a)y7("Unsetting old screen status: "+this.o.A.friendlyName),A7(this,null)}if(a&&b){if(!this.o){c=m6(this.A.ze(),a);if(!c){y7("setConnectedScreenStatus: Unknown screen.");return}var d=kGa(this,c);d||(y7("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.C.push(d),chrome.cast.setCustomReceivers(this.C,
g.A,(0,g.B)(function(e){this.sc("Failed to set initial custom receivers: "+g.hh(e))},this)));
y7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);A7(this,new w7(this.A,d),!0)}this.o.Jx(b)}else y7("setConnectedScreenStatus: no screen.")};
g.h.CV=function(a){this.la()?this.sc("Setting connection data on disposed cast v2"):this.o?this.o.Bk(a):this.sc("Setting connection data without a session")};
g.h.GW=function(){this.la()?this.sc("Stopping session on disposed cast v2"):this.o?(this.o.stop(),A7(this,null)):y7("Stopping non-existing session")};
g.h.requestSession=function(){chrome.cast.requestSession((0,g.B)(this.YE,this),(0,g.B)(this.HT,this))};
g.h.V=function(){this.A.unsubscribe("onlineScreenChange",(0,g.B)(this.eH,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.B);g.db(g.z("yt.mdx.remote.debug.handlers_")||[],OFa);g.Of(this.o);x7.fa.V.call(this)};
g.h.sc=function(a){c7("Controller",a)};
g.h.ZE=function(a,b){this.o==a&&(b||A7(this,null),this.U("yt-remote-cast2-session-change",b))};
g.h.hT=function(a,b){if(!this.la())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),y7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.o)if(this.o.A.label!=a.label)y7("onReceiverAction_: Stopping active receiver: "+this.o.A.friendlyName),this.o.stop();else{y7("onReceiverAction_: Casting to active receiver.");this.o.C&&this.U("yt-remote-cast2-session-change",this.o.C);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:A7(this,
new w7(this.A,a));break;case chrome.cast.ReceiverType.DIAL:A7(this,new v7(this.A,a,this.F));break;case chrome.cast.ReceiverType.CAST:A7(this,new u7(this.A,a));break;default:this.sc("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.o&&this.o.A.label==a.label?this.o.stop():this.sc("Stopping receiver w/o session: "+a.friendlyName)}else this.sc("onReceiverAction_ called without receiver.")};
g.h.jR=function(a){if(this.la())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.sc("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.o?this.o.A:null;if(!c||c.label!=b.label)return this.sc("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.C)return y7("Reselecting dial screen."),
this.U("yt-remote-cast2-session-change",this.o.C),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.sc('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);A7(this,new v7(this.A,b,this.F))}b=this.o;b.H=a;return b.H.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.B)(b.OM,b,(b.H.extraData||{}).screenId||null)):new Promise((0,g.B)(b.tv,b))};
g.h.YE=function(a){if(!this.la()){y7("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)y7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),A7(this,new u7(this.A,b),!0);else{this.sc("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.o.A,d=m6(this.A.ze(),c.label);d&&h6(d,b.label)&&
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(y7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.Of(this.o),this.o=new u7(this.A,b),this.o.subscribe("sessionScreen",(0,g.B)(this.ZE,this,this.o)),this.o.Bk(null));this.o.Ix(a)}}};
g.h.FW=function(){return this.o?this.o.fH():null};
g.h.HT=function(a){this.la()||(this.sc("Failed to estabilish a session: "+g.hh(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&A7(this,null))};
g.h.lT=function(a){y7("Receiver availability updated: "+a);if(!this.la()){var b=z7(this);this.D=a==chrome.cast.ReceiverAvailability.AVAILABLE;z7(this)!=b&&this.U("yt-remote-cast2-availability-change",z7(this))}};
g.h.eH=function(){this.la()||(this.C=lGa(this),y7("Updating custom receivers: "+g.hh(this.C)),chrome.cast.setCustomReceivers(this.C,g.A,(0,g.B)(function(){this.sc("Failed to set custom receivers.")},this)),this.U("yt-remote-cast2-availability-change",z7(this)))};
x7.prototype.setLaunchParams=x7.prototype.CV;x7.prototype.setConnectedScreenStatus=x7.prototype.BV;x7.prototype.stopSession=x7.prototype.GW;x7.prototype.getCastSession=x7.prototype.FW;x7.prototype.requestSession=x7.prototype.requestSession;x7.prototype.init=x7.prototype.init;x7.prototype.dispose=x7.prototype.dispose;var G7=[];g.h=L7.prototype;
g.h.reset=function(a){this.listId="";this.index=-1;this.videoId="";M7(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.Xf=a.hasPrevious,this.hasNext=a.hasNext,this.G=a.playerTime,this.F=a.playerTimeAt,this.B=a.seekableStart,this.A=a.seekableEnd,this.H=a.duration,this.J=a.loadedTime,this.C=a.liveIngestionTime,this.D=!isNaN(this.C))};
g.h.sb=function(){return 1==this.playerState};
g.h.isAdPlaying=function(){return 1081==this.playerState};
g.h.getDuration=function(){return this.D?this.H+N7(this):this.H};
g.h.clone=function(){return new L7(R7(this))};g.C(T7,g.vH);g.h=T7.prototype;g.h.play=function(){1==this.o?(this.A?this.A.play(null,g.A,Z7(this,"play")):Y7(this,"play"),X7(this,1,P7(U7(this))),this.U("remotePlayerChange")):V7(this,this.play)};
g.h.pause=function(){1==this.o?(this.A?this.A.pause(null,g.A,Z7(this,"pause")):Y7(this,"pause"),X7(this,2,P7(U7(this))),this.U("remotePlayerChange")):V7(this,this.pause)};
g.h.seekTo=function(a){if(1==this.o){if(this.A){var b=U7(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.sb()||3==b.playerState?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.A.seek(c,g.A,Z7(this,"seekTo",{newTime:a}))}else Y7(this,"seekTo",{newTime:a});X7(this,3,a);this.U("remotePlayerChange")}else V7(this,g.Na(this.seekTo,a))};
g.h.stop=function(){if(1==this.o){this.A?this.A.stop(null,g.A,Z7(this,"stopVideo")):Y7(this,"stopVideo");var a=U7(this);a.index=-1;a.videoId="";M7(a);W7(this,a);this.U("remotePlayerChange")}else V7(this,this.stop)};
g.h.setVolume=function(a,b){if(1==this.o){var c=U7(this);if(this.C){if(c.volume!=a){var d=Math.round(a)/100;this.C.setReceiverVolumeLevel(d,(0,g.B)(function(){c7("CP","set receiver volume: "+d)},this),(0,g.B)(function(){this.sc("failed to set receiver volume.")},this))}c.muted!=b&&this.C.setReceiverMuted(b,(0,g.B)(function(){c7("CP","set receiver muted: "+b)},this),(0,g.B)(function(){this.sc("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);Y7(this,"setVolume",e)}c.muted=b;c.volume=a;W7(this,c)}else V7(this,g.Na(this.setVolume,a,b))};
g.h.cG=function(a,b){if(1==this.o){var c=U7(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.hh(b.style),g.kc(d,c.o));Y7(this,"setSubtitlesTrack",d);W7(this,c)}else V7(this,g.Na(this.cG,a,b))};
g.h.setAudioTrack=function(a,b){if(1==this.o){var c=b.getLanguageInfo().getId();Y7(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=U7(this);d.audioTrackId=c;W7(this,d)}else V7(this,g.Na(this.setAudioTrack,a,b))};
g.h.playVideo=function(a,b,c,d,e,f,k){var l=U7(this);c=c||0;var m={videoId:a,currentIndex:c};Q7(l,a,c);g.v(b)&&(O7(l,b),m.currentTime=b);g.v(d)&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.hh(k));Y7(this,"setPlaylist",m);d||W7(this,l)};
g.h.dr=function(a,b){if(1==this.o){if(a&&b){var c=U7(this);Q7(c,a,b);W7(this,c)}Y7(this,"previous")}else V7(this,g.Na(this.dr,a,b))};
g.h.nextVideo=function(a,b){if(1==this.o){if(a&&b){var c=U7(this);Q7(c,a,b);W7(this,c)}Y7(this,"next")}else V7(this,g.Na(this.nextVideo,a,b))};
g.h.XA=function(){1==this.o?Y7(this,"dismissAutoplay"):V7(this,this.XA)};
g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.U("proxyStateChange",a,this.o)}T7.fa.dispose.call(this)};
g.h.V=function(){yGa(this);this.B=null;this.D.clear();S7(this,null);T7.fa.V.call(this)};
g.h.Oy=function(a){if((a!=this.o||2==a)&&3!=this.o&&0!=a){var b=this.o;this.o=a;this.U("proxyStateChange",b,a);if(1==a)for(;!this.D.isEmpty();)g.ND(this.D).apply(this);else 3==a&&this.dispose()}};
g.h.dT=function(a,b){this.U(a,b)};
g.h.IQ=function(a){if(!a)this.Dn(null),S7(this,null);else if(this.C.receiver.volume){a=this.C.receiver.volume;var b=U7(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)c7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,W7(this,b)}};
g.h.Dn=function(a){c7("CP","Cast media: "+!!a);this.A&&this.A.removeUpdateListener(this.H);if(this.A=a)this.A.addUpdateListener(this.H),zGa(this),this.U("remotePlayerChange")};
g.h.HQ=function(a){a?(zGa(this),this.U("remotePlayerChange")):this.Dn(null)};
g.h.ey=function(){Y7(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.UQ=function(){var a=vGa();a&&S7(this,a)};
g.h.sc=function(a){c7("CP",a)};g.C($7,g.vH);g.h=$7.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;g.v(m)&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);g.v(k)&&(l.currentIndex=k);c&&(this.ob.listId=c);this.ob.videoId=d;this.ob.index=k||0;this.ob.state=3;O7(this.ob,m);this.B="UNSUPPORTED";a8("Connecting with setPlaylist and params: "+g.hh(l));this.o.connect({method:"setPlaylist",
params:g.hh(l)},a,YEa())}else a8("Connecting without params"),this.o.connect({},a,YEa());BGa(this)};
g.h.dispose=function(){this.la()||(this.U("beforeDispose"),b8(this,3));$7.fa.dispose.call(this)};
g.h.V=function(){c8(this);e8(this);d8(this);g.qF(this.J);this.J=NaN;g.qF(this.K);this.K=NaN;this.C=null;g.fH(this.P);this.P.length=0;this.o.dispose();$7.fa.V.call(this);this.B=this.G=this.A=this.ob=this.o=null};
g.h.dL=function(){this.F(2)};
g.h.MQ=function(){a8("Channel opened");this.W&&(this.W=!1,d8(this),this.M=g.oF((0,g.B)(function(){a8("Timing out waiting for a screen.");this.F(1)},this),15E3));
bFa(LFa(this.o),this.aa)};
g.h.JQ=function(){a8("Channel closed");isNaN(this.D)?r6(!0):r6();this.dispose()};
g.h.KQ=function(a){r6();isNaN(this.H())?(a8("Channel error: "+a+" without reconnection"),this.dispose()):(this.W=!0,a8("Channel error: "+a+" with reconnection in "+this.H()+" ms"),b8(this,2))};
g.h.LQ=function(a){a.params?a8("Received: action="+a.action+", params="+g.hh(a.params)):a8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=g.vy(a.params.devices);this.A=(0,g.K)(a,function(c){return new f6(c)});
a=!!g.Ua(this.A,function(c){return"LOUNGE_SCREEN"==c.type});
EGa(this,a);break;case "loungeScreenDisconnected":g.eb(this.A,function(c){return"LOUNGE_SCREEN"==c.type});
EGa(this,!1);break;case "remoteConnected":var b=new f6(g.vy(a.params.device));g.Ua(this.A,function(c){return b?c.id==b.id:!1})||g.bb(this.A,b);
break;case "remoteDisconnected":b=new f6(g.vy(a.params.device));g.eb(this.A,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":GGa(this,a);break;case "nowPlaying":IGa(this,a);break;case "onStateChange":HGa(this,a);break;case "onAdStateChange":JGa(this,a);break;case "onVolumeChanged":KGa(this,a);break;case "onSubtitlesTrackChanged":FGa(this,a);break;case "nowAutoplaying":LGa(this,a);break;case "autoplayDismissed":this.U("autoplayDismissed");break;case "autoplayUpNext":this.G=a.params.videoId||null;this.U("autoplayUpNext",this.G);break;case "onAutoplayModeChanged":this.B=
a.params.autoplayMode;this.U("autoplayModeChange",this.B);"DISABLED"==this.B&&this.U("autoplayDismissed");break;case "onHasPreviousNextChanged":MGa(this,a);break;case "requestAssistedSignIn":this.U("assistedSignInRequested",a.params.authCode);break;default:a8("Unrecognized action: "+a.action)}};
g.h.lV=function(){if(this.C){var a=this.C;this.C=null;this.ob.videoId!=a&&f8(this,"getNowPlaying")}};
$7.prototype.subscribe=$7.prototype.subscribe;$7.prototype.unsubscribeByKey=$7.prototype.Ek;$7.prototype.ia=function(){var a=3;this.la()||(a=0,isNaN(this.H())?Y6(this.o)&&isNaN(this.D)&&(a=1):a=2);return a};
$7.prototype.getProxyState=$7.prototype.ia;$7.prototype.F=function(a){a8("Disconnecting with "+a);c8(this);this.U("beforeDisconnect",a);1==a&&r6();MFa(this.o,a);this.dispose()};
$7.prototype.disconnect=$7.prototype.F;$7.prototype.ea=function(){var a=this.ob;this.C&&(a=this.ob.clone(),Q7(a,this.C,a.index));return R7(a)};
$7.prototype.getPlayerContextData=$7.prototype.ea;
$7.prototype.ma=function(a){var b=new L7(a);b.videoId&&b.videoId!=this.ob.videoId&&(this.C=b.videoId,g.qF(this.J),this.J=g.oF((0,g.B)(this.lV,this),5E3));var c=[];this.ob.listId==b.listId&&this.ob.videoId==b.videoId&&this.ob.index==b.index||c.push("remoteQueueChange");this.ob.playerState==b.playerState&&this.ob.volume==b.volume&&this.ob.muted==b.muted&&P7(this.ob)==P7(b)&&g.hh(this.ob.o)==g.hh(b.o)||c.push("remotePlayerChange");this.ob.reset(a);(0,g.E)(c,function(d){this.U(d)},this)};
$7.prototype.setPlayerContextData=$7.prototype.ma;$7.prototype.Y=function(){var a=this.o.F.id,b=g.Ua(this.A,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
$7.prototype.getOtherConnectedRemoteId=$7.prototype.Y;$7.prototype.H=function(){var a=this.o;return a.A.isActive()?a.A.A-(0,g.J)():NaN};
$7.prototype.getReconnectTimeout=$7.prototype.H;$7.prototype.ba=function(){return this.B||"UNSUPPORTED"};
$7.prototype.getAutoplayMode=$7.prototype.ba;$7.prototype.ga=function(){return this.G||""};
$7.prototype.getAutoplayVideoId=$7.prototype.ga;$7.prototype.ya=function(){if(!isNaN(this.H())){var a=this.o.A;g.Bv(a.o);a.start()}};
$7.prototype.reconnect=$7.prototype.ya;$7.prototype.ka=function(a,b){f8(this,a,b);DGa(this)};
$7.prototype.sendMessage=$7.prototype.ka;g.C(g8,g7);g.h=g8.prototype;g.h.ze=function(a){return this.kd.$_gs(a)};
g.h.contains=function(a){return!!this.kd.$_c(a)};
g.h.get=function(a){return this.kd.$_g(a)};
g.h.start=function(){this.kd.$_st()};
g.h.add=function(a,b,c){this.kd.$_a(a,b,c)};
g.h.remove=function(a,b,c){this.kd.$_r(a,b,c)};
g.h.ds=function(a,b,c,d){this.kd.$_un(a,b,c,d)};
g.h.V=function(){for(var a=0,b=this.A.length;a<b;++a)this.kd.$_ubk(this.A[a]);this.A.length=0;this.kd=null;g8.fa.V.call(this)};
g.h.BW=function(){this.U("screenChange")};
g.h.CS=function(){this.U("onlineScreenChange")};
p7.prototype.$_st=p7.prototype.start;p7.prototype.$_gspc=p7.prototype.DW;p7.prototype.$_gsppc=p7.prototype.dH;p7.prototype.$_c=p7.prototype.contains;p7.prototype.$_g=p7.prototype.get;p7.prototype.$_a=p7.prototype.add;p7.prototype.$_un=p7.prototype.ds;p7.prototype.$_r=p7.prototype.remove;p7.prototype.$_gs=p7.prototype.ze;p7.prototype.$_gos=p7.prototype.cH;p7.prototype.$_s=p7.prototype.subscribe;p7.prototype.$_ubk=p7.prototype.Ek;var h8=null,i8=null,x8=null,m8=[];g.t(y8,g.L);g.h=y8.prototype;
g.h.V=function(){g.L.prototype.V.call(this);this.B.stop();this.F.stop();this.L.stop();this.W();this.o.unsubscribe("proxyStateChange",this.VE,this);this.o.unsubscribe("remotePlayerChange",this.Gn,this);this.o.unsubscribe("remoteQueueChange",this.Vq,this);this.o.unsubscribe("autoplayUpNext",this.sE,this);this.o.unsubscribe("previousNextChange",this.SE,this);this.o.unsubscribe("nowAutoplaying",this.KE,this);this.o.unsubscribe("autoplayDismissed",this.rE,this);this.o=this.D=null};
g.h.vD=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.o.o)if(B8(this)){if(!U7(this.o).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":U7(this.o).sb()?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.K.Fm(c[0],c[1]);break;case "control_subtitles_set_track":C8(this,c[0]);break;case "control_set_audio_track":c=c[0],B8(this)&&this.o.setAudioTrack(this.A.getVideoData(1).videoId,
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.A.getCurrentTime();D8(this,0==c?void 0:c);break;case "control_seek":D8(this,c[0]);break;case "control_subtitles_set_track":C8(this,c[0]);break;case "control_set_audio_track":c=c[0],B8(this)&&this.o.setAudioTrack(this.A.getVideoData(1).videoId,c)}};
g.h.GQ=function(a){this.L.YK(a)};
g.h.dW=function(a){this.vD("control_subtitles_set_track",g.cc(a)?null:a)};
g.h.rG=function(){var a=this.A.getOption("captions","track");g.cc(a)||C8(this,a)};
g.h.GE=function(a){if(B8(this)){this.o.unsubscribe("remotePlayerChange",this.Gn,this);var b=Math.round(a.volume);a=!!a.muted;var c=U7(this.o);if(b!=c.volume||a!=c.muted)this.o.setVolume(b,a),this.M.start();this.o.subscribe("remotePlayerChange",this.Gn,this)}};
g.h.VR=function(){g.cc(this.G)||YGa(this,this.G);this.H=!1};
g.h.VE=function(a,b){this.F.stop();2==b&&this.pG()};
g.h.Gn=function(){if(B8(this)){this.B.stop();var a=U7(this.o);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.D.fl(1);break;case 1082:case 1083:this.D.fl(0);break;default:this.D.fl(-1)}switch(a.playerState){case 1081:case 1:A8(this,new g.FQ(8));this.oG();break;case 1085:case 3:A8(this,new g.FQ(9));break;case 1083:case 0:A8(this,new g.FQ(2));this.K.stop();z8(this,this.A.getVideoData().lengthSeconds);break;case 1084:A8(this,new g.FQ(4));break;case 2:A8(this,new g.FQ(4));z8(this,P7(a));
break;case -1:A8(this,new g.FQ(64));break;case -1E3:A8(this,new g.FQ(128,{errorCode:"mdx.remoteerror",message:"Bu video uzaktan oynatma i\u00e7in uygun de\u011fil."}))}a=U7(this.o).o;var b=this.G;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.G=a,YGa(this,a));a=U7(this.o);-1==a.volume||Math.round(this.A.getVolume())==a.volume&&this.A.isMuted()==a.muted||this.M.isActive()||this.NG()}else XGa(this)};
g.h.SE=function(){this.A.U("mdxpreviousnextchange")};
g.h.Vq=function(){B8(this)||XGa(this)};
g.h.YJ=function(){this.o.XA()};
g.h.sE=function(a){a&&(a=g.cG("/watch_queue_ajax",{method:"GET",ed:{action_get_watch_queue_item:1,video_id:a},onSuccess:(0,g.B)(this.nU,this)}))&&(this.W=(0,g.B)(a.abort,a))};
g.h.nU=function(a,b){var c=new g.yP(g.Y(this.A),{videoId:b.videoId,title:b.title,author:b.author,murlmq_webp:b.url});this.suggestion=c;this.A.U("mdxautoplayupnext",c)};
g.h.KE=function(a){isNaN(a)||this.A.U("mdxnowautoplaying",a)};
g.h.rE=function(){this.A.U("mdxautoplaycanceled")};
g.h.DO=function(a,b){-1==U7(this.o).playerState?D8(this,a):b&&this.o.seekTo(a)};
g.h.NG=function(){if(B8(this)){var a=U7(this.o);this.C.Ka(this.P);a.muted?this.A.mute():this.A.unMute();this.A.setVolume(a.volume);this.P=this.C.R(this.A,"onVolumeChange",this.GE)}};
g.h.oG=function(){this.B.stop();if(!this.o.la()){var a=U7(this.o);a.sb()&&A8(this,new g.FQ(8));z8(this,P7(a));this.B.start()}};
g.h.pG=function(){this.F.stop();this.B.stop();var a=this.o.B.getReconnectTimeout();2==this.o.o&&!isNaN(a)&&this.F.start()};g.t(E8,g.W);E8.prototype.F=function(a){$Ga(this,a.state)};g.t(F8,g.YW);F8.prototype.M=function(){var a=this.B.getOption("remote","receivers");a&&1<a.length&&!this.B.getOption("remote","quickCast")?(this.K=g.vb(a,this.G,this),g.ZW(this,(0,g.K)(a,this.G)),a=this.B.getOption("remote","currentReceiver"),this.Af(this.G(a)),this.enable(!0)):this.enable(!1)};
F8.prototype.G=function(a){return a.key};
F8.prototype.zf=function(a){return"cast-selector-receiver"==a?"Yay\u0131nla...":this.K[a].name};
F8.prototype.md=function(a){g.YW.prototype.md.call(this,a);this.B.setOption("remote","currentReceiver",this.K[a]);this.D.Kb()};g.t(G8,g.kV);g.h=G8.prototype;g.h.create=function(){RGa(g.dO(g.Y(this.player)));this.D.push(g.vF("yt-remote-before-disconnect",this.CQ,this));this.D.push(g.vF("yt-remote-connection-change",this.mT,this));this.D.push(g.vF("yt-remote-receiver-availability-change",this.TE,this));this.D.push(g.vF("yt-remote-auto-connect",this.kT,this));this.D.push(g.vF("yt-remote-receiver-resumed",this.jT,this));this.TE()};
g.h.load=function(){this.player.cancelPlayback();g.kV.prototype.load.call(this);this.B=new y8(this,this.player,this.o);var a=(a=WGa())?a.currentTime:0;var b=w8()?new T7(r8(),void 0):null;0==a&&b&&(a=P7(U7(b)));0!=a&&this.Ie(a);ZGa(this,this.nn,this.nn);g.C0(this.player.app,6)};
g.h.unload=function(){this.player.U("mdxautoplaycanceled");this.C=this.A;g.Pf(this.B,this.o);this.o=this.B=null;g.kV.prototype.unload.call(this);g.C0(this.player.app,5)};
g.h.V=function(){g.wF(this.D);g.kV.prototype.V.call(this)};
g.h.Vh=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.vD.apply(this.B,[a].concat(g.ea(c)))};
g.h.fl=function(a){this.H=a};
g.h.getAdState=function(){return this.H};
g.h.SK=function(){return this.loaded?this.B.suggestion:null};
g.h.Xf=function(){return this.o?U7(this.o).Xf:!1};
g.h.hasNext=function(){return this.o?U7(this.o).hasNext:!1};
g.h.Ie=function(a,b){this.J=a||0;this.player.U("progresssync",a,b)};
g.h.getCurrentTime=function(){return this.J};
g.h.getProgressState=function(){var a=U7(this.o),b=this.player.getVideoData();return{allowSeeking:g.Y(this.player).experiments.o("web_player_mdx_allow_seeking_change_killswitch")?this.player.Mc():!a.isAdPlaying()&&this.player.Mc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.D?a.C+N7(a):a.C,isAtLiveHead:1>=(a.D?a.A+N7(a):a.A)-this.getCurrentTime(),loaded:a.J,seekableEnd:a.D?a.A+N7(a):a.A,seekableStart:0<a.B?a.B+N7(a):
a.B}};
g.h.nextVideo=function(){this.o&&this.o.nextVideo()};
g.h.dr=function(){this.o&&this.o.dr()};
g.h.CQ=function(a){1==a&&(this.G=this.o?U7(this.o):null)};
g.h.mT=function(){var a=w8()?new T7(r8(),void 0):null;if(a){var b=this.C;this.loaded&&this.unload();this.o=a;this.G=null;b.key!=this.A.key&&(this.C=b,this.load())}else g.Of(this.o),this.o=null,this.loaded&&(this.unload(),(a=this.G)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,P7(a)));this.player.U("videodatachange","newdata",this.player.getVideoData(),3)};
g.h.TE=function(){this.F=[this.A].concat(TGa());var a=s8()||this.A;H8(this,a);this.player.Ba("onMdxReceiversChange")};
g.h.kT=function(){var a=s8();H8(this,a)};
g.h.jT=function(){this.C=s8()};
g.h.Ic=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.F;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?J7():H8(this,b)),this.loaded?this.C:this.A;case "quickCast":return 2==this.F.length&&"cast-selector-receiver"==this.F[1].key?(b&&J7(),!0):!1}};
g.h.ey=function(){this.o.ey()};
g.h.wc=function(){return!1};
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.VZ.remote=G8;})(_yt_player);
