(function(g){var window=this;'use strict';var jab=function(a,b){this.u=a>>>0;this.j=b>>>0},lab=function(a){if(!a)return kab||(kab=new jab(0,0));
if(!/^\d+$/.test(a))return null;g.Cba(a);return new jab(g.de,g.ee)},mab=function(a,b,c){null!=c&&("string"===typeof c&&lab(c),g.Ge(a,b,1),"number"===typeof c?(a=a.j,b=c>>>0,c=Math.floor((c-b)/4294967296)>>>0,g.de=b,g.ee=c,g.Be(a,g.de),g.Be(a,g.ee)):(c=lab(c),a=a.j,b=c.j,g.Be(a,c.u),g.Be(a,b)))},nab=function(a,b,c){b=g.qba(b,c);
null!=b&&(g.Ge(a,c,0),a.j.j.push(b?1:0))},pab=function(a){g.J.call(this,a,-1,oab)},qab=function(a){g.J.call(this,a)},rab=function(a){g.J.call(this,a)},sab=function(a){g.J.call(this,a)},tab=function(a){g.J.call(this,a)},X7=function(a){g.Mj(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.Wa()).toString(36));
return a},Y7=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
g.cga(a.u,b,c)},uab=function(a){if(a instanceof g.om)return a;
if("function"==typeof a.bj)return a.bj(!1);if(g.Oa(a)){var b=0,c=new g.om;c.next=function(){for(;;){if(b>=a.length)return g.V2;if(b in a)return g.pm(a[b++]);b++}};
return c}throw Error("Not implemented");},vab=function(a,b,c){if(g.Oa(a))g.tc(a,b,c);
else for(a=uab(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},wab=function(a,b){var c=[];
vab(b,function(d){try{var e=g.Go.prototype.u.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.Kka(e)&&c.push(d)},a);
return c},xab=function(a,b){wab(a,b).forEach(function(c){g.Go.prototype.remove.call(this,c)},a)},yab=function(a){if(a.V){if(a.V.locationOverrideToken)return{locationOverrideToken:a.V.locationOverrideToken};
if(null!=a.V.latitudeE7&&null!=a.V.longitudeE7)return{latitudeE7:a.V.latitudeE7,longitudeE7:a.V.longitudeE7}}return null},zab=function(a,b){g.Wb(a,b)||a.push(b)},Aab=function(a){var b=0,c;
for(c in a)b++;return b},Bab=function(a,b){return g.Af(a,b)},Cab=function(a){try{return g.C.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);},Z7=function(a){if(g.C.JSON)try{return g.C.JSON.parse(a)}catch(b){}return Cab(a)},Dab=function(a,b,c,d){var e=new g.Cj(null);
a&&g.Dj(e,a);b&&g.Ej(e,b);c&&g.Fj(e,c);d&&(e.J=d);return e},$7=function(a,b){g.Sx[a]=!0;
var c=g.Qx();c&&c.publish.apply(c,arguments);g.Sx[a]=!1},a8=function(a){this.name=this.id="";
this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.po;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";a&&(this.id=a.id||a.name,this.name=a.name,this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=
a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Eab(this,a.capabilities||""),Fab(this,a.experiments||""),this.brand=a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN",a=a.deviceInfo)&&(a=JSON.parse(a),this.brand=a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",
this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},Eab=function(a,b){a.capabilities.clear();
g.wm(b.split(","),g.Va(Bab,Gab)).forEach(function(c){a.capabilities.add(c)})},Fab=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},b8=function(a){a=a||{};
this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||"";this.idType=a.screenIdType||"normal"},c8=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Hab=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},Iab=function(a){return new b8(a)},Jab=function(a){return Array.isArray(a)?g.Pk(a,Iab):[]},d8=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+((a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+",idType:"+a.idType+"}"):"null"},Kab=function(a){return Array.isArray(a)?"["+g.Pk(a,d8).join(",")+"]":"null"},Lab=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)})},Mab=function(a){return g.Pk(a,function(b){return{key:b.id,
name:b.name}})},Nab=function(a,b){return g.Ub(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},e8=function(a,b){return g.Ub(a,function(c){return c8(c,b)})},Oab=function(){var a=(0,g.Nz)();
a&&xab(a,a.j.bj(!0))},f8=function(){var a=g.Qz("yt-remote-connected-devices")||[];
g.mc(a);return a},Pab=function(a){if(g.Xb(a))return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.Pk(a,function(d,e){return 0==e?d:d.substring(c.length)})},Qab=function(a){g.Pz("yt-remote-connected-devices",a,86400)},g8=function(){if(Rab)return Rab;
var a=g.Qz("yt-remote-device-id");a||(a=Lab(),g.Pz("yt-remote-device-id",a,31536E3));for(var b=f8(),c=1,d=a;g.Wb(b,d);)c++,d=a+"#"+c;return Rab=d},Sab=function(){var a=f8(),b=g8();
g.Sz()&&g.sc(a,b);a=Pab(a);if(g.Xb(a))try{g.Nu("remote_sid")}catch(c){}else try{g.Lu("remote_sid",a.join(","),-1)}catch(c){}},Uab=function(){return g.Qz("yt-remote-session-browser-channel")},Vab=function(){return g.Qz("yt-remote-local-screens")||[]},Wab=function(){g.Pz("yt-remote-lounge-token-expiration",!0,86400)},Xab=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=g.Pk(Vab(),function(d){return d.loungeToken}),c=g.Pk(a,function(d){return d.loungeToken});
g.Od(c,function(d){return!g.Wb(b,d)})&&Wab();
g.Pz("yt-remote-local-screens",a,31536E3)},h8=function(a){a||(g.Rz("yt-remote-session-screen-id"),g.Rz("yt-remote-session-video-id"));
Sab();a=f8();g.Zb(a,g8());Qab(a)},Yab=function(){if(!i8){var a=g.Po();
a&&(i8=new g.Do(a))}},Zab=function(){Yab();
return i8?!!i8.get("yt-remote-use-staging-server"):!1},$ab=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return a?parseInt(a[1],10):0},abb=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},bbb=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},j8=function(a){a.length?cbb(a.shift(),function(){j8(a)}):dbb()},ebb=function(a){return"chrome-extension://"+a+"/cast_sender.js"},cbb=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);g.ej(d,g.ig(a));(document.head||document.documentElement).appendChild(d)},fbb=function(){var a=$ab(),b=[];
if(1<a){var c=a-1;b.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");b.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}return b},dbb=function(){var a=bbb();
a&&a(!1,"No cast extension found")},hbb=function(){if(gbb){var a=2,b=bbb(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;cbb("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",dbb,c)}},ibb=function(){hbb();
var a=fbb();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");j8(a)},kbb=function(){hbb();
var a=fbb();a.push.apply(a,g.t(jbb.map(ebb)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");j8(a)},lbb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/channel/opened",{Mh:3,Lh:"channel_type"})},mbb=function(a,b){a.j.Yq("/client_streamz/youtube/living_room/mdx/channel/opened",b)},nbb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/channel/closed",{Mh:3,Lh:"channel_type"})},obb=function(a,b){a.j.Yq("/client_streamz/youtube/living_room/mdx/channel/closed",b)},pbb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/channel/message_received",{Mh:3,Lh:"channel_type"})},qbb=function(a,b){a.j.Yq("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},rbb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/channel/error",{Mh:3,Lh:"channel_type"})},sbb=function(a,b){a.j.Yq("/client_streamz/youtube/living_room/mdx/channel/error",b)},tbb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},ubb=function(){this.j=k8();
this.j.ip("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},l8=function(a,b,c){g.K.call(this);
this.I=null!=c?(0,g.Ta)(a,c):a;this.ph=b;this.D=(0,g.Ta)(this.AU,this);this.j=!1;this.u=0;this.B=this.qc=null;this.C=[]},m8=function(a,b,c){g.K.call(this);
this.C=null!=c?a.bind(c):a;this.ph=b;this.B=null;this.j=!1;this.u=0;this.qc=null},vbb=function(a){a.qc=g.Ph(function(){a.qc=null;
a.j&&!a.u&&(a.j=!1,vbb(a))},a.ph);
var b=a.B;a.B=null;a.C.apply(null,b)},n8=function(){},wbb=function(){g.df.call(this,"p")},xbb=function(){g.df.call(this,"o")},ybb=function(){var a=new g.C.TextEncoder;
return new g.C.ReadableStream({start:function(b){for(var c=g.r(["test\r\n","test\r\n"]),d=c.next();!d.done;d=c.next())b.enqueue(a.encode(d.value));b.close()}})},zbb=function(a){return(a=/\/\/([^\/]+)\//.exec(a))?a[1].endsWith("google.com"):!1},Bbb=function(a,b){if(!Abb){Abb=!0;
var c;a:{if(c=g.C.navigator)if(c=c.userAgent)break a;c=""}(-1==c.indexOf("Chrome")||-1!=c.indexOf("Edg")?0:90<=parseInt(/Chrome\/(\d+)/.exec(c)[1],10))&&zbb(a)&&window&&window.document&&zbb(window.document.URL)&&(c=document.createElement("meta"),c.httpEquiv="origin-trial",c.content="A0eNbltY1nd4MP7XTHXnTxWogDL6mWTdgIIKfKOTJoUHNbFFMZQBoiHHjJ9UK9lgYndWFaxOWR7ld8uUjcWmcwIAAAB/eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IkZldGNoVXBsb2FkU3RyZWFtaW5nIiwiZXhwaXJ5IjoxNjM2NTAyMzk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ==",
document.head.appendChild(c),(new Request("",{body:new ReadableStream,method:"POST"})).headers.has("Content-Type")||(g.C.fetch(a+"?ot=1",{method:"POST",body:"test\r\n"}).catch(b),g.C.fetch(a+"?ot=2",{method:"POST",body:ybb(),WW:!1}).catch(b),g.C.fetch(a+"?ot=3",{method:"POST",body:ybb(),WW:!0}).catch(b)))}},Dbb=function(){return Cbb=Cbb||new g.Uf},Ebb=function(a){g.df.call(this,"serverreachability",a)},o8=function(a){var b=Dbb();
b.dispatchEvent(new Ebb(b,a))},Fbb=function(a,b){g.df.call(this,"statevent",a);
this.stat=b},p8=function(a){var b=Dbb();
b.dispatchEvent(new Fbb(b,a))},Gbb=function(a,b,c,d){g.df.call(this,"timingevent",a);
this.size=b;this.Ew=d},q8=function(a,b){if("function"!==typeof a)throw Error("Fn must not be null and must be a function");
return g.C.setTimeout(function(){a()},b)},Hbb=function(){},r8=function(a,b,c,d){this.D=a;
this.C=b;this.zc=c;this.yc=d||1;this.eb=new g.Rj(this);this.Cb=45E3;a=g.rG?125:void 0;this.gb=new g.Oh(a);this.Ha=null;this.B=!1;this.N=this.Ya=this.J=this.La=this.ra=this.Eb=this.V=null;this.Y=[];this.j=null;this.W=0;this.I=this.qa=null;this.Kb=-1;this.Ea=!1;this.ub=0;this.Ua=null;this.Lc=this.Ra=this.Yb=this.va=!1;this.u=new Ibb},Ibb=function(){this.B=null;
this.j="";this.u=!1},Kbb=function(a,b,c){a.La=1;
a.J=X7(b.clone());a.N=c;a.va=!0;Jbb(a,null)},Jbb=function(a,b){a.ra=Date.now();
s8(a);a.Ya=a.J.clone();Y7(a.Ya,"t",a.yc);a.W=0;var c=a.D.La;a.u=new Ibb;a.j=Lbb(a.D,c?b:null,!a.N);0<a.ub&&(a.Ua=new m8((0,g.Ta)(a.aM,a,a.j),a.ub));a.eb.Na(a.j,"readystatechange",a.DU);b=a.Ha?g.Gf(a.Ha):{};a.N?(a.qa||(a.qa="POST"),b["Content-Type"]="application/x-www-form-urlencoded",a.j.send(a.Ya,a.qa,a.N,b)):(a.qa="GET",a.j.send(a.Ya,a.qa,null,b));o8(1)},Mbb=function(a){return a.j?"GET"==a.qa&&2!=a.La&&a.D.Kd:!1},Qbb=function(a,b,c){for(var d=!0,e;!a.Ea&&a.W<c.length;)if(e=Nbb(a,c),e==t8){4==b&&
(a.I=4,p8(14),d=!1);
break}else if(e==Obb){a.I=4;p8(15);d=!1;break}else Pbb(a,e);Mbb(a)&&e!=t8&&e!=Obb&&(a.u.j="",a.W=0);4!=b||0!=c.length||a.u.u||(a.I=1,p8(16),d=!1);a.B=a.B&&d;d?0<c.length&&!a.Lc&&(a.Lc=!0,a.D.vJ(a)):(u8(a),v8(a))},Nbb=function(a,b){var c=a.W,d=b.indexOf("\n",c);
if(-1==d)return t8;c=Number(b.substring(c,d));if(isNaN(c))return Obb;d+=1;if(d+c>b.length)return t8;b=b.slice(d,d+c);a.W=d+c;return b},s8=function(a){a.Eb=Date.now()+a.Cb;
Rbb(a,a.Cb)},Rbb=function(a,b){if(null!=a.V)throw Error("WatchDog timer not null");
a.V=q8((0,g.Ta)(a.BU,a),b)},w8=function(a){a.V&&(g.C.clearTimeout(a.V),a.V=null)},v8=function(a){a.D.Rf()||a.Ea||Sbb(a.D,a)},u8=function(a){w8(a);
g.af(a.Ua);a.Ua=null;a.gb.stop();g.Sj(a.eb);if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},Pbb=function(a,b){try{var c=a.D;
if(0!=c.jg&&(c.j==a||Tbb(c.u,a)))if(!a.Ra&&Tbb(c.u,a)&&3==c.jg){try{var d=c.Ld.j.parse(b)}catch(A){d=null}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.N){if(c.j)if(c.j.ra+3E3<a.ra)x8(c),y8(c);else break a;Ubb(c);p8(18)}}else c.Dd=e[1],0<c.Dd-c.Ra&&37500>e[2]&&c.gb&&0==c.Y&&!c.W&&(c.W=q8((0,g.Ta)(c.EU,c),6E3));if(1>=Vbb(c.u)&&c.Nc){try{c.Nc()}catch(A){}c.Nc=void 0}}else z8(c,11)}else if((a.Ra||c.j==a)&&x8(c),!g.fb(b))for(e=c.Ld.j.parse(b),b=0;b<e.length;b++){var f=e[b];c.Ra=f[0];f=
f[1];if(2==c.jg)if("c"==f[0]){c.C=f[1];c.Lc=f[2];var h=f[3];null!=h&&(c.bM=h);var l=f[5];null!=l&&"number"===typeof l&&0<l&&(c.Ya=1.5*l);d=c;var m=a.j;if(m){var n=g.Hi(m,"X-Client-Wire-Protocol");if(n){var p=d.u;!p.j&&(g.ib(n,"spdy")||g.ib(n,"quic")||g.ib(n,"h2"))&&(p.C=p.D,p.j=new Set,p.u&&(Wbb(p,p.u),p.u=null))}if(d.va){var q=g.Hi(m,"X-HTTP-Session-Id");q&&(d.Fd=q,g.Mj(d.Ha,d.va,q))}}c.jg=3;c.D&&c.D.hM();c.Mc&&(c.Bd=Date.now()-a.ra);d=c;var v=a;d.rd=Xbb(d,d.La?d.Lc:null,d.yc);if(v.Ra){Ybb(d.u,v);
var w=v,y=d.Ya;y&&w.setTimeout(y);w.V&&(w8(w),s8(w));d.j=v}else Zbb(d);0<c.B.length&&A8(c)}else"stop"!=f[0]&&"close"!=f[0]||z8(c,7);else 3==c.jg&&("stop"==f[0]||"close"==f[0]?"stop"==f[0]?z8(c,7):c.disconnect():"noop"!=f[0]&&c.D&&c.D.gM(f),c.Y=0)}o8(4)}catch(A){}},$bb=function(a,b){this.j=a;
this.map=b;this.context=null},acb=function(a){this.D=a||10;
g.C.PerformanceNavigationTiming?(a=g.C.performance.getEntriesByType("navigation"),a=0<a.length&&("hq"==a[0].nextHopProtocol||"h2"==a[0].nextHopProtocol)):a=!!(g.C.chrome&&g.C.chrome.loadTimes&&g.C.chrome.loadTimes()&&g.C.chrome.loadTimes().wasFetchedViaSpdy);this.C=a?this.D:1;this.j=null;1<this.C&&(this.j=new Set);this.u=null;this.B=[]},bcb=function(a){return a.u?!0:a.j?a.j.size>=a.C:!1},Vbb=function(a){return a.u?1:a.j?a.j.size:0},Tbb=function(a,b){return a.u?a.u==b:a.j?a.j.has(b):!1},Wbb=function(a,
b){a.j?a.j.add(b):a.u=b},Ybb=function(a,b){a.u&&a.u==b?a.u=null:a.j&&a.j.has(b)&&a.j.delete(b)},ccb=function(a){if(null!=a.u)return a.B.concat(a.u.Y);
if(null!=a.j&&0!==a.j.size){var b=a.B;a=g.r(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.Y);return b}return g.cc(a.B)},dcb=function(a,b){var c=new Hbb;
if(g.C.Image){var d=new Image;d.onload=g.Va(B8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.Va(B8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.Va(B8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.Va(B8,c,d,"TestLoadImage: timeout",!1,b);g.C.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4);
d.src=a}else b(!1)},B8=function(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d)}catch(f){}},ecb=function(){this.j=new n8},fcb=function(a,b,c){var d=c||"";
try{g.Bj(a,function(e,f){var h=e;g.Pa(e)&&(h=g.fi(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e;
}},C8=function(a,b,c){return c&&c.tZ?c.tZ[a]||b:b},gcb=function(a){this.B=[];
this.Lc=this.rd=this.Ha=this.yc=this.j=this.Fd=this.va=this.Ea=this.J=this.Eb=this.V=null;this.Pe=this.Ua=0;this.Ne=C8("failFast",!1,a);this.gb=this.W=this.N=this.I=this.D=null;this.zc=!0;this.Dd=this.Ra=-1;this.Yb=this.Y=this.ra=0;this.He=C8("baseRetryDelayMs",5E3,a);this.bf=C8("retryDelaySeedMs",1E4,a);this.Oe=C8("forwardChannelMaxRetries",2,a);this.Cd=C8("forwardChannelRequestTimeoutMs",2E4,a);this.Ed=a&&a.J3a||void 0;this.Kd=a&&a.H3a||!1;this.Ya=void 0;this.La=a&&a.N4||!1;this.C="";this.u=new acb(a&&
a.s2a);this.Ld=new ecb;this.Cb=a&&a.H2a||!1;this.ub=a&&a.z2a||!1;this.Cb&&this.ub&&(this.ub=!1);this.Eh=a&&a.n2a||!1;a&&a.J2a&&(this.zc=!1);this.Mc=!this.Cb&&this.zc&&a&&a.w2a||!1;this.Nc=void 0;this.Bd=0;this.eb=!1;this.qa=null;this.cf=!a||!1!==a.y2a;this.Kb=null},y8=function(a){a.j&&(hcb(a),a.j.cancel(),a.j=null)},icb=function(a){y8(a);
a.N&&(g.C.clearTimeout(a.N),a.N=null);x8(a);a.u.cancel();a.I&&("number"===typeof a.I&&g.C.clearTimeout(a.I),a.I=null)},A8=function(a){bcb(a.u)||a.I||(a.I=!0,g.Dh(a.dM,a),a.ra=0)},kcb=function(a,b){if(Vbb(a.u)>=a.u.C-(a.I?1:0))return!1;
if(a.I)return a.B=b.Y.concat(a.B),!0;if(1==a.jg||2==a.jg||a.ra>=(a.Ne?0:a.Oe))return!1;a.I=q8((0,g.Ta)(a.dM,a,b),jcb(a,a.ra));a.ra++;return!0},mcb=function(a,b){var c;
b?c=b.zc:c=a.Ua++;var d=a.Ha.clone();g.Mj(d,"SID",a.C);g.Mj(d,"RID",c);g.Mj(d,"AID",a.Ra);D8(a,d);a.J&&a.V&&g.Qj(d,a.J,a.V);c=new r8(a,a.C,c,a.ra+1);null===a.J&&(c.Ha=a.V);b&&(a.B=b.Y.concat(a.B));b=lcb(a,c,1E3);c.setTimeout(Math.round(.5*a.Cd)+Math.round(.5*a.Cd*Math.random()));Wbb(a.u,c);Kbb(c,d,b)},D8=function(a,b){a.Ea&&g.of(a.Ea,function(c,d){g.Mj(b,d,c)});
a.D&&g.Bj({},function(c,d){g.Mj(b,d,c)})},lcb=function(a,b,c){c=Math.min(a.B.length,c);
var d=a.D?(0,g.Ta)(a.D.FU,a.D,a):null;a:for(var e=a.B,f=-1;;){var h=["count="+c];-1==f?0<c?(f=e[0].j,h.push("ofs="+f)):f=0:h.push("ofs="+f);for(var l=!0,m=0;m<c;m++){var n=e[m].j,p=e[m].map;n-=f;if(0>n)f=Math.max(0,e[m].j-100),l=!1;else try{fcb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.B.splice(0,c);b.Y=a;return d},Zbb=function(a){a.j||a.N||(a.Yb=1,g.Dh(a.cM,a),a.Y=0)},Ubb=function(a){if(a.j||a.N||3<=a.Y)return!1;
a.Yb++;a.N=q8((0,g.Ta)(a.cM,a),jcb(a,a.Y));a.Y++;return!0},hcb=function(a){null!=a.qa&&(g.C.clearTimeout(a.qa),a.qa=null)},ncb=function(a){a.j=new r8(a,a.C,"rpc",a.Yb);
null===a.J&&(a.j.Ha=a.V);a.j.ub=0;var b=a.rd.clone();g.Mj(b,"RID","rpc");g.Mj(b,"SID",a.C);g.Mj(b,"CI",a.gb?"0":"1");g.Mj(b,"AID",a.Ra);g.Mj(b,"TYPE","xmlhttp");D8(a,b);a.J&&a.V&&g.Qj(b,a.J,a.V);a.Ya&&a.j.setTimeout(a.Ya);var c=a.j;a=a.Lc;c.La=1;c.J=X7(b.clone());c.N=null;c.va=!0;Jbb(c,a)},x8=function(a){null!=a.W&&(g.C.clearTimeout(a.W),a.W=null)},Sbb=function(a,b){var c=null;
if(a.j==b){x8(a);hcb(a);a.j=null;var d=2}else if(Tbb(a.u,b))c=b.Y,Ybb(a.u,b),d=1;else return;if(0!=a.jg)if(b.B)if(1==d){c=b.N?b.N.length:0;b=Date.now()-b.ra;var e=a.ra;d=Dbb();d.dispatchEvent(new Gbb(d,c,b,e));A8(a)}else Zbb(a);else{var f=b.Kb;e=b.getLastError();if(3==e||0==e&&0<f||!(1==d&&kcb(a,b)||2==d&&Ubb(a)))switch(c&&0<c.length&&(b=a.u,b.B=b.B.concat(c)),e){case 1:z8(a,5);break;case 4:z8(a,10);break;case 3:z8(a,6);break;default:z8(a,2)}}},jcb=function(a,b){var c=a.He+Math.floor(Math.random()*
a.bf);
a.isActive()||(c*=2);return c*b},z8=function(a,b){if(2==b){var c=null;
a.D&&(c=null);var d=(0,g.Ta)(a.W4,a);c||(c=new g.Cj("//www.google.com/images/cleardot.gif"),g.C.location&&"http"==g.C.location.protocol||g.Dj(c,"https"),X7(c));dcb(c.toString(),d)}else p8(2);a.jg=0;a.D&&a.D.fM(b);ocb(a);icb(a)},ocb=function(a){a.jg=0;
a.Kb=[];if(a.D){var b=ccb(a.u);if(0!=b.length||0!=a.B.length)g.dc(a.Kb,b),g.dc(a.Kb,a.B),a.u.B.length=0,g.cc(a.B),a.B.length=0;a.D.eM()}},pcb=function(a){if(0==a.jg)return a.Kb;
var b=[];g.dc(b,ccb(a.u));g.dc(b,a.B);return b},Xbb=function(a,b,c){var d=g.Nj(c);
""!=d.j?(b&&g.Ej(d,b+"."+d.j),g.Fj(d,d.B)):(d=g.C.location,d=Dab(d.protocol,b?b+"."+d.hostname:d.hostname,+d.port,c));b=a.va;c=a.Fd;b&&c&&g.Mj(d,b,c);g.Mj(d,"VER",a.bM);D8(a,d);return d},Lbb=function(a,b,c){if(b&&!a.La)throw Error("Can't create secondary domain capable XhrIo object.");
b=c&&a.Kd&&!a.Ed?new g.Ai(new g.xj({ES:!0})):new g.Ai(a.Ed);b.J=a.La;return b},qcb=function(){},rcb=function(){if(g.Dc&&!g.Ac(10))throw Error("Environmental error: no available transport.");
},F8=function(a,b){g.Uf.call(this);
this.j=new gcb(b);this.I=a;this.u=b&&b.b_||null;a=b&&b.a_||null;b&&b.r2a&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.j.V=a;a=b&&b.M2a||null;b&&b.nQ&&(a?a["X-WebChannel-Content-Type"]=b.nQ:a={"X-WebChannel-Content-Type":b.nQ});b&&b.gO&&(a?a["X-WebChannel-Client-Profile"]=b.gO:a={"X-WebChannel-Client-Profile":b.gO});this.j.Eb=a;(a=b&&b.K2a)&&!g.fb(a)&&(this.j.J=a);this.J=b&&b.N4||!1;this.D=b&&b.t3a||!1;(b=b&&b.lZ)&&!g.fb(b)&&(this.j.va=b,g.yf(this.u,b)&&g.Df(this.u,
b));this.C=new E8(this)},scb=function(a){wbb.call(this);
a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var b=a.__sm__;b?this.data=(this.metadataKey=g.sf(b))?g.Ef(b,this.metadataKey):b:this.data=a},tcb=function(a){xbb.call(this);
this.status=1;this.errorCode=a},E8=function(a){this.j=a},ucb=function(a,b){this.u=a;
this.j=b},vcb=function(a){return pcb(a.j).map(function(b){b=b.map;
"__data__"in b&&(b=b.__data__,b=a.u.D?Cab(b):b);return b})},G8=function(a,b){if("function"!==typeof a)throw Error("Fn must not be null and must be a function");
return g.C.setTimeout(function(){a()},b)},I8=function(a){H8.dispatchEvent(new wcb(H8,a))},wcb=function(a,b){g.df.call(this,"statevent",a);
this.stat=b},J8=function(a,b,c,d){this.j=a;
this.C=b;this.J=c;this.I=d||1;this.u=45E3;this.B=new g.Rj(this);this.D=new g.Oh;this.D.setInterval(250)},ycb=function(a,b,c){a.vu=1;
a.Xo=X7(b.clone());a.Vq=c;a.va=!0;xcb(a,null)},zcb=function(a,b,c,d,e){a.vu=1;
a.Xo=X7(b.clone());a.Vq=null;a.va=c;e&&(a.qS=!1);xcb(a,d)},xcb=function(a,b){a.uu=Date.now();
K8(a);a.Zo=a.Xo.clone();Y7(a.Zo,"t",a.I);a.cB=0;a.Dh=a.j.rF(a.j.vx()?b:null);0<a.pF&&(a.aB=new m8((0,g.Ta)(a.iM,a,a.Dh),a.pF));a.B.Na(a.Dh,"readystatechange",a.HU);b=a.Uq?g.Gf(a.Uq):{};a.Vq?(a.bB="POST",b["Content-Type"]="application/x-www-form-urlencoded",a.Dh.send(a.Zo,a.bB,a.Vq,b)):(a.bB="GET",a.qS&&!g.kf&&(b.Connection="close"),a.Dh.send(a.Zo,a.bB,null,b));a.j.rl(1)},Ccb=function(a,b){var c=a.cB,d=b.indexOf("\n",c);
if(-1==d)return Acb;c=Number(b.substring(c,d));if(isNaN(c))return Bcb;d+=1;if(d+c>b.length)return Acb;b=b.slice(d,d+c);a.cB=d+c;return b},Ecb=function(a,b){a.uu=Date.now();
K8(a);var c=b?window.location.hostname:"";a.Zo=a.Xo.clone();g.Mj(a.Zo,"DOMAIN",c);g.Mj(a.Zo,"t",a.I);try{a.Dl=new ActiveXObject("htmlfile")}catch(m){L8(a);a.Yo=7;I8(22);M8(a);return}var d="<html><body>";if(b){var e="";for(b=0;b<c.length;b++){var f=c.charAt(b);if("<"==f)f=e+"\\x3c";else if(">"==f)f=e+"\\x3e";else{if(f in N8)f=N8[f];else if(f in Dcb)f=N8[f]=Dcb[f];else{var h=f.charCodeAt(0);if(31<h&&127>h)var l=f;else{if(256>h){if(l="\\x",16>h||256<h)l+="0"}else l="\\u",4096>h&&(l+="0");l+=h.toString(16).toUpperCase()}f=
N8[f]=l}f=e+f}e=f}d+='<script>document.domain="'+e+'"\x3c/script>'}d+="</body></html>";c=g.yg(g.fg("b/12014412"),d);a.Dl.open();a.Dl.write(g.wg(c));a.Dl.close();a.Dl.parentWindow.m=(0,g.Ta)(a.I2,a);a.Dl.parentWindow.d=(0,g.Ta)(a.sR,a,!0);a.Dl.parentWindow.rpcClose=(0,g.Ta)(a.sR,a,!1);c=a.Dl.createElement("DIV");a.Dl.parentWindow.document.body.appendChild(c);d=g.mg(a.Zo.toString());d=g.Vg(g.lg(d));d=g.yg(g.fg("b/12014412"),'<iframe src="'+d+'"></iframe>');g.rda(c,d);a.j.rl(1)},K8=function(a){a.qF=
Date.now()+a.u;
Fcb(a,a.u)},Fcb=function(a,b){if(null!=a.wu)throw Error("WatchDog timer not null");
a.wu=G8((0,g.Ta)(a.GU,a),b)},Gcb=function(a){a.wu&&(g.C.clearTimeout(a.wu),a.wu=null)},M8=function(a){a.j.Rf()||a.Tq||a.j.dB(a)},L8=function(a){Gcb(a);
g.af(a.aB);a.aB=null;a.D.stop();g.Sj(a.B);if(a.Dh){var b=a.Dh;a.Dh=null;b.abort();b.dispose()}a.Dl&&(a.Dl=null)},Hcb=function(a,b){try{a.j.jM(a,b),a.j.rl(4)}catch(c){}},Jcb=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;Icb(a,b,function(h){h?c(!0):g.C.setTimeout(function(){Jcb(a,b,c,d,f)},f)})}},Icb=function(a,b,c){var d=new Image;
d.onload=function(){try{O8(d),c(!0)}catch(e){}};
d.onerror=function(){try{O8(d),c(!1)}catch(e){}};
d.onabort=function(){try{O8(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{O8(d),c(!1)}catch(e){}};
g.C.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
d.src=a},O8=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},Kcb=function(a){this.j=a;
this.u=new n8},Lcb=function(a){var b=P8(a.j,a.Tx,"/mail/images/cleardot.gif");
X7(b);Jcb(b.toString(),5E3,(0,g.Ta)(a.oX,a),3,2E3);a.rl(1)},Mcb=function(a){var b=a.j.V;
if(null!=b)I8(5),b?(I8(11),Q8(a.j,a,!1)):(I8(12),Q8(a.j,a,!0));else if(a.gi=new J8(a),a.gi.Uq=a.sF,b=a.j,b=P8(b,b.vx()?a.tx:null,a.tF),I8(5),!g.Dc||g.Ac(10))Y7(b,"TYPE","xmlhttp"),zcb(a.gi,b,!1,a.tx,!1);else{Y7(b,"TYPE","html");var c=a.gi;a=!!a.tx;c.vu=3;c.Xo=X7(b.clone());Ecb(c,a)}},Ncb=function(a,b,c){this.j=1;
this.u=[];this.B=[];this.D=new n8;this.N=a||null;this.V=null!=b?b:null;this.J=c||!1},Ocb=function(a,b){this.j=a;
this.map=b;this.context=null},Pcb=function(a,b,c,d){g.df.call(this,"timingevent",a);
this.size=b;this.Ew=d},Qcb=function(a){g.df.call(this,"serverreachability",a)},Scb=function(a){a.IU(1,0);
a.eB=P8(a,null,a.uF);Rcb(a)},Tcb=function(a){a.vp&&(a.vp.abort(),a.vp=null);
a.Ef&&(a.Ef.cancel(),a.Ef=null);a.Fn&&(g.C.clearTimeout(a.Fn),a.Fn=null);R8(a);a.Fi&&(a.Fi.cancel(),a.Fi=null);a.ap&&(g.C.clearTimeout(a.ap),a.ap=null)},Ucb=function(a,b){if(0==a.j)throw Error("Invalid operation: sending map when state is closed");
a.u.push(new Ocb(a.JU++,b));2!=a.j&&3!=a.j||Rcb(a)},Vcb=function(a){var b=0;
a.Ef&&b++;a.Fi&&b++;return b},Rcb=function(a){a.Fi||a.ap||(a.ap=G8((0,g.Ta)(a.nM,a),0),a.yu=0)},Ycb=function(a,b){if(1==a.j){if(!b){a.xx=Math.floor(1E5*Math.random());
b=a.xx++;var c=new J8(a,"",b);c.Uq=a.Ml;var d=Wcb(a),e=a.eB.clone();g.Mj(e,"RID",b);g.Mj(e,"CVER","1");S8(a,e);ycb(c,e,d);a.Fi=c;a.j=2}}else 3==a.j&&(b?Xcb(a,b):0==a.u.length||a.Fi||Xcb(a))},Xcb=function(a,b){if(b)if(6<a.Wq){a.u=a.B.concat(a.u);
a.B.length=0;var c=a.xx-1;b=Wcb(a)}else c=b.J,b=b.Vq;else c=a.xx++,b=Wcb(a);var d=a.eB.clone();g.Mj(d,"SID",a.C);g.Mj(d,"RID",c);g.Mj(d,"AID",a.Au);S8(a,d);c=new J8(a,a.C,c,a.yu+1);c.Uq=a.Ml;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Fi=c;ycb(c,d,b)},S8=function(a,b){a.ih&&(a=a.ih.rM())&&g.of(a,function(c,d){g.Mj(b,d,c)})},Wcb=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b];
if(6<a.Wq&&0<b){var d=a.u[0].j;c.push("ofs="+d)}else d=0;for(var e={},f=0;f<b;e={Zt:e.Zt},f++){e.Zt=a.u[f].j;var h=a.u[f].map;e.Zt=6>=a.Wq?f:e.Zt-d;try{g.of(h,function(l){return function(m,n){c.push("req"+l.Zt+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.Zt+"_type="+encodeURIComponent("_badmap"))}}a.B=a.B.concat(a.u.splice(0,b));
return c.join("&")},Zcb=function(a){a.Ef||a.Fn||(a.I=1,a.Fn=G8((0,g.Ta)(a.mM,a),0),a.xu=0)},adb=function(a){if(a.Ef||a.Fn||3<=a.xu)return!1;
a.I++;a.Fn=G8((0,g.Ta)(a.mM,a),$cb(a,a.xu));a.xu++;return!0},Q8=function(a,b,c){a.LE=c;
a.Nl=b.En;a.J||Scb(a)},R8=function(a){null!=a.Xq&&(g.C.clearTimeout(a.Xq),a.Xq=null)},$cb=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},T8=function(a,b){if(2==b||9==b){var c=null;
a.ih&&(c=null);var d=(0,g.Ta)(a.V4,a);c||(c=new g.Cj("//www.google.com/images/cleardot.gif"),X7(c));Icb(c.toString(),1E4,d)}else I8(2);bdb(a,b)},bdb=function(a,b){a.j=0;
a.ih&&a.ih.oM(b);cdb(a);Tcb(a)},cdb=function(a){a.j=0;
a.Nl=-1;if(a.ih)if(0==a.B.length&&0==a.u.length)a.ih.vF();else{var b=g.cc(a.B),c=g.cc(a.u);a.B.length=0;a.u.length=0;a.ih.vF(b,c)}},P8=function(a,b,c){var d=g.Nj(c);
if(""!=d.j)b&&g.Ej(d,b+"."+d.j),g.Fj(d,d.B);else{var e=window.location;d=Dab(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.wx&&g.of(a.wx,function(f,h){g.Mj(d,h,f)});
g.Mj(d,"VER",a.Wq);S8(a,d);return d},ddb=function(){},edb=function(){this.j=[];
this.u=[]},fdb=function(){},k8=function(){if(!U8){U8=new g.Rh(new fdb);
var a=g.cu("client_streamz_web_flush_count",-1);-1!==a&&(U8.C=a)}return U8},gdb=function(a){g.df.call(this,"channelMessage");
this.message=a},hdb=function(a){g.df.call(this,"channelError");
this.error=a},idb=function(a,b){this.action=a;
this.params=b||{}},V8=function(a,b){g.K.call(this);
this.j=new g.Zn(this.A2,0,this);g.M(this,this.j);this.ph=5E3;this.u=0;if("function"===typeof a)b&&(a=(0,g.Ta)(a,b));else if(a&&"function"===typeof a.handleEvent)a=(0,g.Ta)(a.handleEvent,a);else throw Error("Invalid listener argument");this.B=a},jdb=function(a,b,c,d,e){c=void 0===c?!1:c;
d=void 0===d?function(){return""}:d;
e=void 0===e?!1:e;this.ra=a;this.J=b;this.B=new g.Co;this.u=new V8(this.S3,this);this.j=null;this.W=!1;this.I=null;this.V="";this.N=this.D=0;this.C=[];this.La=c;this.Y=d;this.Ra=e;this.Ha=new lbb;this.qa=new nbb;this.Ea=new pbb;this.va=new rbb;this.Ua=new tbb;this.Ya=new ubb},kdb=function(a){if(a.j){var b=a.Y(),c=a.j.Ml||{};
b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.Ml=c}},W8=function(a){this.port=this.domain="";
this.j="/api/lounge";this.u=!0;a=a||document.location.href;var b=Number(g.pi(4,a))||"";b&&(this.port=":"+b);this.domain=g.qi(a)||"";a=g.rb();0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.qb(a,"10.0")&&(this.u=!1))},X8=function(a,b){var c=a.j;
a.u&&(c="https://"+a.domain+a.port+a.j);return g.wi(c+b,{})},ldb=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Va(a.C,d,!0),onError:g.Va(a.B,e),onTimeout:g.Va(a.D,e)};c&&(a.postParams=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.Cu(b,a)},mdb=function(a,b){g.Uf.call(this);
var c=this;this.Sc=a();this.Sc.subscribe("handlerOpened",this.NU,this);this.Sc.subscribe("handlerClosed",this.LU,this);this.Sc.subscribe("handlerError",function(d,e){c.onError(e)});
this.Sc.subscribe("handlerMessage",this.MU,this);this.j=b},ndb=function(a,b,c){var d=this;
c=void 0===c?function(){return""}:c;
var e=void 0===e?new rcb:e;var f=void 0===f?new g.Co:f;this.pathPrefix=a;this.j=b;this.ra=c;this.D=f;this.N=null;this.V=this.J=0;this.channel=null;this.I=0;this.B=new V8(function(){d.B.isActive();var h;0===(null==(h=d.channel)?void 0:Vbb((new ucb(h,h.j)).j.u))&&d.connect(d.N,d.J)});
this.C={};this.u={};this.W=!1;this.logger=null;this.Y=[];this.Fg=void 0;this.Ha=new lbb;this.qa=new nbb;this.Ea=new pbb;this.va=new rbb},odb=function(a){g.Nf(a.channel,"m",function(){a.I=3;
a.B.reset();a.N=null;a.J=0;for(var b=g.r(a.Y),c=b.next();!c.done;c=b.next())c=c.value,a.channel&&a.channel.send(c);a.Y=[];a.X("webChannelOpened");mbb(a.Ha,"WEB_CHANNEL")});
g.Nf(a.channel,"n",function(){a.I=0;a.B.isActive()||a.X("webChannelClosed");var b,c=null==(b=a.channel)?void 0:vcb(new ucb(b,b.j));c&&(a.Y=[].concat(g.t(c)));obb(a.qa,"WEB_CHANNEL")});
g.Nf(a.channel,"p",function(b){var c=b.data;"gracefulReconnect"===c[0]?(a.B.start(),a.channel&&a.channel.close()):a.X("webChannelMessage",new idb(c[0],c[1]));a.Fg=b.statusCode;qbb(a.Ea,"WEB_CHANNEL")});
g.Nf(a.channel,"o",function(){401===a.Fg||a.B.start();a.X("webChannelError");sbb(a.va,"WEB_CHANNEL")})},pdb=function(a){var b=a.ra();
b?a.C["x-youtube-lounge-xsrf-token"]=b:delete a.C["x-youtube-lounge-xsrf-token"]},qdb=function(a){g.Uf.call(this);
this.j=a();this.j.subscribe("webChannelOpened",this.QU,this);this.j.subscribe("webChannelClosed",this.OU,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.PU,this)},rdb=function(a,b,c,d,e){function f(){return new jdb(X8(a,"/bc"),b,!1,c,d)}
c=void 0===c?function(){return""}:c;
return g.T("enable_mdx_web_channel_desktop")?new qdb(function(){return new ndb(X8(a,"/wc"),b,c)}):new mdb(f,e)},vdb=function(){var a=sdb;
tdb();Y8.push(a);udb()},Z8=function(a,b){tdb();
var c=wdb(a,String(b));g.Xb(Y8)?xdb(c):(udb(),g.tc(Y8,function(d){d(c)}))},$8=function(a){Z8("CP",a)},tdb=function(){Y8||(Y8=g.Ha("yt.mdx.remote.debug.handlers_")||[],g.Fa("yt.mdx.remote.debug.handlers_",Y8))},xdb=function(a){var b=(a9+1)%50;
a9=b;b9[b]=a;c9||(c9=49==b)},udb=function(){var a=Y8;
if(b9[0]){var b=c9?a9:-1;do{b=(b+1)%50;var c=b9[b];g.tc(a,function(d){d(c)})}while(b!=a9);
b9=Array(50);a9=-1;c9=!1}},wdb=function(a,b){var c=(Date.now()-ydb)/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("")},d9=function(a){g.cz.call(this);
this.I=a;this.screens=[]},zdb=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
if(c)return a=c.name,c.id=b.id||c.id,c.name=b.name,c.token=b.token,c.uuid=b.uuid||c.uuid,c.name!=a;a.screens.push(b);return!0},Adb=function(a,b){var c=a.screens.length!=b.length;
a.screens=g.wm(a.screens,function(f){return!!Nab(b,f)});
for(var d=0,e=b.length;d<e;d++)c=zdb(a,b[d])||c;return c},Bdb=function(a,b){var c=a.screens.length;
a.screens=g.wm(a.screens,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.screens.length<c},Cdb=function(a,b,c,d,e){g.cz.call(this);
this.B=a;this.J=b;this.C=c;this.I=d;this.D=e;this.u=0;this.j=null;this.qc=NaN},f9=function(a){d9.call(this,"LocalScreenService");
this.u=a;this.j=NaN;e9(this);this.info("Initializing with "+Kab(this.screens))},Ddb=function(a){if(a.screens.length){var b=g.Pk(a.screens,function(d){return d.id}),c=X8(a.u,"/pairing/get_lounge_token_batch");
ldb(a.u,c,{screen_ids:b.join(",")},(0,g.Ta)(a.KY,a),(0,g.Ta)(a.JY,a))}},e9=function(a){if(g.T("deprecate_pair_servlet_enabled"))return Adb(a,[]);
var b=Jab(Vab());b=g.wm(b,function(c){return!c.uuid});
return Adb(a,b)},g9=function(a,b){Xab(g.Pk(a.screens,Hab));
b&&Wab()},Fdb=function(a,b){g.cz.call(this);
this.I=b;b=(b=g.Qz("yt-remote-online-screen-ids")||"")?b.split(","):[];for(var c={},d=this.I(),e=0,f=d.length;e<f;++e){var h=d[e].id;c[h]=g.Wb(b,h)}this.j=c;this.D=a;this.B=this.C=NaN;this.u=null;Edb("Initialized with "+g.fi(this.j))},Gdb=function(a,b,c){var d=X8(a.D,"/pairing/get_screen_availability");
ldb(a.D,d,{lounge_token:b.token},(0,g.Ta)(function(e){e=e.screens||[];for(var f=0,h=e.length;f<h;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.Ta)(function(){c(!1)},a))},Idb=function(a,b){a:if(Aab(b)!=Aab(a.j))var c=!1;
else{c=g.uf(b);for(var d=0,e=c.length;d<e;++d)if(!a.j[c[d]]){c=!1;break a}c=!0}c||(Edb("Updated online screens: "+g.fi(a.j)),a.j=b,a.X("screenChange"));Hdb(a)},h9=function(a){isNaN(a.B)||g.zu(a.B);
a.B=g.xu((0,g.Ta)(a.lK,a),0<a.C&&a.C<g.Wa()?2E4:1E4)},Edb=function(a){Z8("OnlineScreenService",a)},Jdb=function(a){var b={};
g.tc(a.I(),function(c){c.token?b[c.token]=c.id:this.Ze("Requesting availability of screen w/o lounge token.")});
return b},Hdb=function(a){a=g.uf(g.pf(a.j,function(b){return b}));
g.mc(a);a.length?g.Pz("yt-remote-online-screen-ids",a.join(","),60):g.Rz("yt-remote-online-screen-ids")},i9=function(a,b){b=void 0===b?!1:b;
d9.call(this,"ScreenService");this.C=a;this.J=b;this.j=this.u=null;this.B=[];this.D={};Kdb(this)},Mdb=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.D[b]);var h=a.ij(),l=c?e8(h,c):null;c&&(a.J||l)||(l=e8(h,b));if(l){l.uuid=b;var m=j9(a,l);Gdb(a.j,m,function(n){e(n?m:null)})}else c?Ldb(a,c,(0,g.Ta)(function(n){var p=j9(this,new b8({name:d,
screenId:c,loungeToken:n,dialId:b||""}));Gdb(this.j,p,function(q){e(q?p:null)})},a),f):e(null)},Ndb=function(a,b){for(var c=0,d=a.screens.length;c<d;++c)if(a.screens[c].name==b)return a.screens[c];
return null},Odb=function(a,b,c){Gdb(a.j,b,c)},Ldb=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={postParams:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,h){f=h&&h.screens||[];f[0]&&f[0].screenId==b?c(f[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.Cu(X8(a.C,"/pairing/get_lounge_token_batch"),e)},Pdb=function(a){a.screens=a.u.ij();
var b=a.D,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.screens.length;b<d;++b){var e=a.screens[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+Kab(a.screens))},Kdb=function(a){Qdb(a);
a.u=new f9(a.C);a.u.subscribe("screenChange",(0,g.Ta)(a.UY,a));Pdb(a);a.J||(a.B=Jab(g.Qz("yt-remote-automatic-screen-cache")||[]));Qdb(a);a.info("Initializing automatic screens: "+Kab(a.B));a.j=new Fdb(a.C,(0,g.Ta)(a.ij,a,!0));a.j.subscribe("screenChange",(0,g.Ta)(function(){this.X("onlineScreenChange")},a))},j9=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=e8(a.B,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.B.push(b),a.J||Rdb(a));Qdb(a);a.D[b.uuid]=b.id;g.Pz("yt-remote-device-id-map",a.D,31536E3);return b},Rdb=function(a){a=g.wm(a.B,function(b){return"shortLived"!=b.idType});
g.Pz("yt-remote-automatic-screen-cache",g.Pk(a,Hab))},Qdb=function(a){a.D=g.Qz("yt-remote-device-id-map")||{}},k9=function(a,b,c){g.cz.call(this);
this.va=c;this.B=a;this.j=b;this.C=null},l9=function(a,b){a.C=b;
a.X("sessionScreen",a.C)},Sdb=function(a,b){a.C&&(a.C.token=b,j9(a.B,a.C));
a.X("sessionScreen",a.C)},m9=function(a,b){Z8(a.va,b)},n9=function(a,b,c){k9.call(this,a,b,"CastSession");
var d=this;this.config_=c;this.u=null;this.Y=(0,g.Ta)(this.VU,this);this.qa=(0,g.Ta)(this.S2,this);this.W=g.xu(function(){Tdb(d,null)},12E4);
this.J=this.D=this.I=this.N=0;this.ra=!1;this.V="unknown"},Vdb=function(a,b){g.zu(a.J);
a.J=0;0==b?Udb(a):a.J=g.xu(function(){Udb(a)},b)},Udb=function(a){Wdb(a,"getLoungeToken");
g.zu(a.D);a.D=g.xu(function(){Xdb(a,null)},3E4)},Wdb=function(a,b){a.info("sendYoutubeMessage_: "+b+" "+g.fi());
var c={};c.type=b;a.u?a.u.sendMessage("urn:x-cast:com.google.youtube.mdx",c,function(){},(0,g.Ta)(function(){m9(this,"Failed to send message: "+b+".")},a)):m9(a,"Sending yt message without session: "+g.fi(c))},Ydb=function(a,b){b?(a.info("onConnectedScreenId_: Received screenId: "+b),a.getScreen()&&a.getScreen().id==b||a.ZO(b,function(c){l9(a,c)},function(){return a.Sh()},5)):a.Sh(Error("Waiting for session status timed out."))},$db=function(a,b,c){a.info("onConnectedScreenData_: Received screenData: "+
JSON.stringify(b));
var d=new b8(b);Zdb(a,d,function(e){e?(a.ra=!0,j9(a.B,d),l9(a,d),a.V="unknown",Vdb(a,c)):(g.gu(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online.")),a.Sh())},5)},Tdb=function(a,b){g.zu(a.W);
a.W=0;b?a.config_.enableCastLoungeToken&&b.loungeToken?b.deviceId?a.getScreen()&&a.getScreen().uuid==b.deviceId||(b.loungeTokenRefreshIntervalMs?$db(a,{name:a.j.friendlyName,screenId:b.screenId,loungeToken:b.loungeToken,dialId:b.deviceId,screenIdType:"shortLived"},b.loungeTokenRefreshIntervalMs):(g.gu(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(b)+".")),Ydb(a,b.screenId))):(g.gu(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(b)+
".")),Ydb(a,b.screenId)):Ydb(a,b.screenId):a.Sh(Error("Waiting for session status timed out."))},Xdb=function(a,b){g.zu(a.D);
a.D=0;var c=null;if(b)if(b.loungeToken){var d;(null==(d=a.getScreen())?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";else c="noLoungeTokenResponse";c?(a.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(b)+", error: "+c)),a.V=c,Vdb(a,3E4)):(Sdb(a,b.loungeToken),a.ra=!1,a.V="unknown",Vdb(a,b.loungeTokenRefreshIntervalMs))},Zdb=function(a,b,c,d){g.zu(a.I);
a.I=0;Odb(a.B,b,function(e){e||0>d?c(e):a.I=g.xu(function(){Zdb(a,b,c,d-1)},300)})},aeb=function(a){g.zu(a.N);
a.N=0;g.zu(a.I);a.I=0;g.zu(a.W);a.W=0;g.zu(a.D);a.D=0;g.zu(a.J);a.J=0},o9=function(a,b,c,d){k9.call(this,a,b,"DialSession");
this.config_=d;this.u=this.N=null;this.qa="";this.La=c;this.Ha=null;this.W=function(){};
this.V=NaN;this.Ea=(0,g.Ta)(this.WU,this);this.D=function(){};
this.J=this.I=0;this.Y=!1;this.ra="unknown"},p9=function(a){var b;
return!!(a.config_.enableDialLoungeToken&&(null==(b=a.u)?0:b.getDialAppInfo))},beb=function(a){a.D=a.B.tM(a.qa,a.j.label,a.j.friendlyName,p9(a),function(b,c){a.D=function(){};
a.Y=!0;l9(a,b);"shortLived"==b.idType&&0<c&&q9(a,c)},function(b){a.D=function(){};
a.Sh(b)})},ceb=function(a){var b={};
b.pairingCode=a.qa;b.theme=a.La;Zab()&&(b.env_useStageMdx=1);return g.ui(b)},deb=function(a){return new Promise(function(b){a.qa=Lab();
if(a.Ha){var c=new chrome.cast.DialLaunchResponse(!0,ceb(a));b(c);beb(a)}else a.W=function(){g.zu(a.V);a.W=function(){};
a.V=NaN;var d=new chrome.cast.DialLaunchResponse(!0,ceb(a));b(d);beb(a)},a.V=g.xu(function(){a.W()},100)})},feb=function(a,b,c){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(b));
var d=new b8(b);return(new Promise(function(e){eeb(a,d,function(f){f?(a.Y=!0,j9(a.B,d),l9(a,d),q9(a,c)):g.gu(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online."));e(f)},5)})).then(function(e){return e?new chrome.cast.DialLaunchResponse(!1):deb(a)})},geb=function(a,b){var c=a.N.receiver.label,d=a.j.friendlyName;
return(new Promise(function(e){Mdb(a.B,c,b,d,function(f){f&&f.token&&l9(a,f);e(f)},function(f){m9(a,"Failed to get DIAL screen: "+f);
e(null)})})).then(function(e){return e&&e.token?new chrome.cast.DialLaunchResponse(!1):deb(a)})},eeb=function(a,b,c,d){g.zu(a.I);
a.I=0;Odb(a.B,b,function(e){e||0>d?c(e):a.I=g.xu(function(){eeb(a,b,c,d-1)},300)})},q9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b);
p9(a)&&(g.zu(a.J),a.J=0,0==b?heb(a):a.J=g.xu(function(){heb(a)},b))},heb=function(a){p9(a)&&a.u.getDialAppInfo(function(b){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b));
b=b.extraData||{};var c=null;if(b.loungeToken){var d;(null==(d=a.getScreen())?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(a.ra=c,q9(a,3E4)):(a.Y=!1,a.ra="unknown",Sdb(a,b.loungeToken),q9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b);
a.ra="noLoungeTokenResponse";q9(a,3E4)})},ieb=function(a){g.zu(a.I);
a.I=0;g.zu(a.J);a.J=0;a.D();a.D=function(){};
g.zu(a.V)},r9=function(a,b){k9.call(this,a,b,"ManualSession");
this.u=g.xu((0,g.Ta)(this.Zv,this,null),150)},s9=function(a,b){g.cz.call(this);
this.config_=b;this.u=a;this.N=b.appId||"233637DE";this.C=b.theme||"cl";this.V=b.disableCastApi||!1;this.I=b.forceMirroring||!1;this.j=null;this.J=!1;this.B=[];this.D=(0,g.Ta)(this.G1,this)},jeb=function(a,b){return b?g.Ub(a.B,function(c){return c8(b,c.label)},a):null},t9=function(a){Z8("Controller",a)},sdb=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},u9=function(a){return a.J||!!a.B.length||!!a.j},v9=function(a,b,c){b!=a.j&&(g.af(a.j),(a.j=b)?(c?a.X("yt-remote-cast2-receiver-resumed",
b.j):a.X("yt-remote-cast2-receiver-selected",b.j),b.subscribe("sessionScreen",(0,g.Ta)(a.qR,a,b)),b.subscribe("sessionFailed",function(){return keb(a,b)}),b.getScreen()?a.X("yt-remote-cast2-session-change",b.getScreen()):c&&a.j.Zv(null)):a.X("yt-remote-cast2-session-change",null))},keb=function(a,b){a.j==b&&a.X("yt-remote-cast2-session-failed")},leb=function(a){var b=a.u.sM(),c=a.j&&a.j.j;
a=g.Pk(b,function(d){c&&c8(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=jeb(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},seb=function(a,b,c,d){d.disableCastApi?w9("Cannot initialize because disabled by Mdx config."):meb()?neb(b,d)&&(oeb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?peb(a,c):(window.__onGCastApiAvailable=function(e,f){e?peb(a,c):(x9("Failed to load cast API: "+f),qeb(!1),oeb(!1),g.Rz("yt-remote-cast-available"),g.Rz("yt-remote-cast-receiver"),
reb(),c(!1))},d.loadCastApiSetupScript?g.Tz("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?60<=$ab()&&ibb():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?dbb():89<=$ab()?kbb():(hbb(),j8(jbb.map(ebb))))):w9("Cannot initialize because not running Chrome")},reb=function(){w9("dispose");
var a=y9();a&&a.dispose();g.Fa("yt.mdx.remote.cloudview.instance_",null);teb(!1);g.Vx(ueb);ueb.length=0},z9=function(){return!!g.Qz("yt-remote-cast-installed")},veb=function(){var a=g.Qz("yt-remote-cast-receiver");
return a?a.friendlyName:null},web=function(){w9("clearCurrentReceiver");
g.Rz("yt-remote-cast-receiver")},xeb=function(){return z9()?y9()?y9().getCastSession():(x9("getCastSelector: Cast is not initialized."),null):(x9("getCastSelector: Cast API is not installed!"),null)},yeb=function(){z9()?y9()?A9()?(w9("Requesting cast selector."),y9().requestSession()):(w9("Wait for cast API to be ready to request the session."),ueb.push(g.Ux("yt-remote-cast2-api-ready",yeb))):x9("requestCastSelector: Cast is not initialized."):x9("requestCastSelector: Cast API is not installed!")},
B9=function(a,b){A9()?y9().setConnectedScreenStatus(a,b):x9("setConnectedScreenStatus called before ready.")},meb=function(){var a=0<=g.rb().search(/ (CrMo|Chrome|CriOS)\//);
return g.bE||a},zeb=function(a,b){y9().init(a,b)},neb=function(a,b){var c=!1;
y9()||(a=new s9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.Pz("yt-remote-cast-available",d);$7("yt-remote-cast2-availability-change",d)}),a.subscribe("yt-remote-cast2-receiver-selected",function(d){w9("onReceiverSelected: "+d.friendlyName);
g.Pz("yt-remote-cast-receiver",d);$7("yt-remote-cast2-receiver-selected",d)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(d){w9("onReceiverResumed: "+d.friendlyName);
g.Pz("yt-remote-cast-receiver",d);$7("yt-remote-cast2-receiver-resumed",d)}),a.subscribe("yt-remote-cast2-session-change",function(d){w9("onSessionChange: "+d8(d));
d||g.Rz("yt-remote-cast-receiver");$7("yt-remote-cast2-session-change",d)}),g.Fa("yt.mdx.remote.cloudview.instance_",a),c=!0);
w9("cloudview.createSingleton_: "+c);return c},y9=function(){return g.Ha("yt.mdx.remote.cloudview.instance_")},peb=function(a,b){qeb(!0);
oeb(!1);zeb(a,function(c){c?(teb(!0),g.Wx("yt-remote-cast2-api-ready")):(x9("Failed to initialize cast API."),qeb(!1),g.Rz("yt-remote-cast-available"),g.Rz("yt-remote-cast-receiver"),reb());b(c)})},w9=function(a){Z8("cloudview",a)},x9=function(a){Z8("cloudview",a)},qeb=function(a){w9("setCastInstalled_ "+a);
g.Pz("yt-remote-cast-installed",a)},A9=function(){return!!g.Ha("yt.mdx.remote.cloudview.apiReady_")},teb=function(a){w9("setApiReady_ "+a);
g.Fa("yt.mdx.remote.cloudview.apiReady_",a)},oeb=function(a){g.Fa("yt.mdx.remote.cloudview.initializing_",a)},C9=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.I=this.J=0;this.trackData=null;this.hasNext=this.Lm=!1;this.N=this.D=this.j=this.C=0;this.B=NaN;this.u=!1;this.reset(a)},Aeb=function(a){a.audioTrackId=null;
a.trackData=null;a.playerState=-1;a.Lm=!1;a.hasNext=!1;a.J=0;a.I=g.Wa();a.C=0;a.j=0;a.D=0;a.N=0;a.B=NaN;a.u=!1},D9=function(a){return a.Oc()?(g.Wa()-a.I)/1E3:0},E9=function(a,b){a.J=b;
a.I=g.Wa()},F9=function(a){switch(a.playerState){case 1:case 1081:return(g.Wa()-a.I)/1E3+a.J;
case -1E3:return 0}return a.J},G9=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&Aeb(a)},Beb=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.Hf(a.trackData);b.hasPrevious=a.Lm;b.hasNext=a.hasNext;b.playerTime=a.J;b.playerTimeAt=a.I;b.seekableStart=a.C;b.seekableEnd=a.j;b.duration=a.D;b.loadedTime=a.N;b.liveIngestionTime=a.B;return b},I9=function(a,b){g.cz.call(this);
this.B=0;this.C=a;this.I=[];this.D=new edb;this.u=this.j=null;this.V=(0,g.Ta)(this.j0,this);this.J=(0,g.Ta)(this.Lz,this);this.N=(0,g.Ta)(this.h0,this);this.W=(0,g.Ta)(this.m0,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.FK,this),Ceb(this))):c=3;0!=c&&(b?this.FK(c):g.xu((0,g.Ta)(function(){this.FK(c)},this),0));
(a=xeb())&&H9(this,a);this.subscribe("yt-remote-cast2-session-change",this.W)},J9=function(a){return new C9(a.C.getPlayerContextData())},Ceb=function(a){g.tc("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.I.push(this.C.subscribe(b,g.Va(this.E1,b),this))},a)},Deb=function(a){g.tc(a.I,function(b){this.C.unsubscribeByKey(b)},a);
a.I.length=0},K9=function(a){return 1==a.getState()},L9=function(a,b){var c=a.D;
50>c.j.length+c.u.length&&a.D.enqueue(b)},Eeb=function(a,b,c){var d=J9(a);
E9(d,c);-1E3!=d.playerState&&(d.playerState=b);M9(a,d)},N9=function(a,b,c){a.C.sendMessage(b,c)},M9=function(a,b){Deb(a);
a.C.setPlayerContextData(Beb(b));Ceb(a)},H9=function(a,b){a.u&&(a.u.removeUpdateListener(a.V),a.u.removeMediaListener(a.J),a.Lz(null));
a.u=b;a.u&&($8("Setting cast session: "+a.u.sessionId),a.u.addUpdateListener(a.V),a.u.addMediaListener(a.J),a.u.media.length&&a.Lz(a.u.media[0]))},Feb=function(a){var b=a.j.media,c=a.j.customData;
if(b&&c){var d=J9(a);b.contentId!=d.videoId&&$8("Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;E9(d,a.j.getEstimatedTime());M9(a,d)}else $8("No cast media video. Ignoring state update.")},O9=function(a,b,c){return(0,g.Ta)(function(d){this.Ze("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Ze("Retrying "+b+" using MDx browser channel."),N9(this,b,c))},a)},R9=function(a,b,c,d){d=void 0===d?!1:d;
g.cz.call(this);var e=this;this.I=NaN;this.qa=!1;this.V=this.N=this.Y=this.ra=NaN;this.W=[];this.D=this.J=this.C=this.j=this.u=null;this.Ha=a;this.Ea=d;this.W.push(g.Ax(window,"beforeunload",function(){e.wv(2)}));
this.B=[];this.j=new C9;this.La=b.id;this.va=b.idType;this.u=rdb(this.Ha,c,this.xM,"shortLived"==this.va,this.La);this.u.Na("channelOpened",function(){Geb(e)});
this.u.Na("channelClosed",function(){P9("Channel closed");isNaN(e.I)?h8(!0):h8();e.dispose()});
this.u.Na("channelError",function(f){h8();isNaN(e.Oy())?(1==f&&"shortLived"==e.va&&e.X("browserChannelAuthError",f),P9("Channel error: "+f+" without reconnection"),e.dispose()):(e.qa=!0,P9("Channel error: "+f+" with reconnection in "+e.Oy()+" ms"),Q9(e,2))});
this.u.Na("channelMessage",function(f){Heb(e,f)});
this.u.Oo(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.Sz()&&g.Pz("yt-remote-session-video-id",f)})},Ieb=function(a){return g.Ub(a.B,function(b){return"LOUNGE_SCREEN"==b.type})},P9=function(a){Z8("conn",a)},Q9=function(a,b){a.X("proxyStateChange",b)},Jeb=function(a){a.I=g.xu(function(){P9("Connecting timeout");
a.wv(1)},2E4)},Keb=function(a){g.zu(a.I);
a.I=NaN},Leb=function(a){g.zu(a.ra);
a.ra=NaN},Neb=function(a){Meb(a);
a.Y=g.xu(function(){S9(a,"getNowPlaying")},2E4)},Meb=function(a){g.zu(a.Y);
a.Y=NaN},Geb=function(a){P9("Channel opened");
a.qa&&(a.qa=!1,Leb(a),a.ra=g.xu(function(){P9("Timing out waiting for a screen.");a.wv(1)},15E3))},Peb=function(a,b){var c=null;
if(b){var d=Ieb(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Fa("yt.mdx.remote.remoteClient_",c);b&&(Keb(a),Leb(a));c=a.u.Rv()&&isNaN(a.I);b==c?b&&(Q9(a,1),S9(a,"getSubtitlesTrack")):b?(a.YO()&&a.j.reset(),Q9(a,1),S9(a,"getNowPlaying"),Oeb(a)):a.wv(1)},Qeb=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.j.videoId&&(g.Cf(b.params)?a.j.trackData=null:a.j.trackData=b.params,a.X("remotePlayerChange"))},Reb=function(a,b,c){var d=b.params.videoId||b.params.video_id,e=parseInt(b.params.currentIndex,10);
a.j.listId=b.params.listId||a.j.listId;G9(a.j,d,e);a.X("remoteQueueChange",c)},Teb=function(a,b){b.params=b.params||{};
Reb(a,b,"NOW_PLAYING_MAY_CHANGE");Seb(a,b);a.X("autoplayDismissed")},Seb=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
E9(a.j,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.j.playerState&&(c=-1E3);a.j.playerState=c;c=Number(b.params.loadedTime);a.j.N=isNaN(c)?0:c;a.j.wj(Number(b.params.duration));c=a.j;var d=Number(b.params.liveIngestionTime);c.B=d;c.u=isNaN(d)?!1:!0;c=a.j;d=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);c.C=isNaN(d)?0:d;c.j=isNaN(b)?0:b;1==a.j.playerState?Neb(a):Meb(a);a.X("remotePlayerChange")},Ueb=function(a,b){if(-1E3!=a.j.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.j.playerState=c;b=parseInt(b.params.currentTime,10);E9(a.j,isNaN(b)?0:b);a.X("remotePlayerChange")}},Veb=function(a,b){var c="true"==b.params.muted;
a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.X("remotePlayerChange")},Web=function(a,b){a.J=b.params.videoId;
a.X("nowAutoplaying",parseInt(b.params.timeout,10))},Xeb=function(a,b){a.J=b.params.videoId||null;
a.X("autoplayUpNext",a.J)},Yeb=function(a,b){a.D=b.params.autoplayMode;
a.X("autoplayModeChange",a.D);"DISABLED"==a.D&&a.X("autoplayDismissed")},Zeb=function(a,b){var c="true"==b.params.hasNext;
a.j.Lm="true"==b.params.hasPrevious;a.j.hasNext=c;a.X("previousNextChange")},Heb=function(a,b){b=b.message;
b.params?P9("Received: action="+b.action+", params="+g.fi(b.params)):P9("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=Z7(b.params.devices);a.B=g.Pk(b,function(d){return new a8(d)});
b=!!g.Ub(a.B,function(d){return"LOUNGE_SCREEN"==d.type});
Peb(a,b);b=a.KP("mlm");a.X("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.$b(a.B,function(d){return"LOUNGE_SCREEN"==d.type});
Peb(a,!1);break;case "remoteConnected":var c=new a8(Z7(b.params.device));g.Ub(a.B,function(d){return d.equals(c)})||zab(a.B,c);
break;case "remoteDisconnected":c=new a8(Z7(b.params.device));g.$b(a.B,function(d){return d.equals(c)});
break;case "gracefulDisconnect":break;case "playlistModified":Reb(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":Teb(a,b);break;case "onStateChange":Seb(a,b);break;case "onAdStateChange":Ueb(a,b);break;case "onVolumeChanged":Veb(a,b);break;case "onSubtitlesTrackChanged":Qeb(a,b);break;case "nowAutoplaying":Web(a,b);break;case "autoplayDismissed":a.X("autoplayDismissed");break;case "autoplayUpNext":Xeb(a,b);break;case "onAutoplayModeChanged":Yeb(a,b);break;case "onHasPreviousNextChanged":Zeb(a,b);break;
case "requestAssistedSignIn":a.X("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":a.X("loopModeChange",b.params.loopMode);break;default:P9("Unrecognized action: "+b.action)}},Oeb=function(a){g.zu(a.V);
a.V=g.xu(function(){a.wv(1)},864E5)},S9=function(a,b,c){c?P9("Sending: action="+b+", params="+g.fi(c)):P9("Sending: action="+b);
a.u.sendMessage(b,c)},$eb=function(a){d9.call(this,"ScreenServiceProxy");
this.Pf=a;this.j=[];this.j.push(this.Pf.$_s("screenChange",(0,g.Ta)(this.aV,this)));this.j.push(this.Pf.$_s("onlineScreenChange",(0,g.Ta)(this.g1,this)))},efb=function(a,b){Yab();
if(!i8||!i8.get("yt-remote-disable-remote-module-for-dev")){b=g.Q("MDX_CONFIG")||b;Oab();Sab();T9||(T9=new W8(b?b.loungeApiHost:void 0),Zab()&&(T9.j="/api/loungedev"));U9||(U9=g.Ha("yt.mdx.remote.deferredProxies_")||[],g.Fa("yt.mdx.remote.deferredProxies_",U9));afb();var c=V9();if(!c){var d=new i9(T9,b?b.disableAutomaticScreenCache||!1:!1);g.Fa("yt.mdx.remote.screenService_",d);c=V9();var e={};b&&(e={appId:b.appId,disableDial:b.disableDial,theme:b.theme,loadCastApiSetupScript:b.loadCastApiSetupScript,
disableCastApi:b.disableCastApi,enableDialLoungeToken:b.enableDialLoungeToken,enableCastLoungeToken:b.enableCastLoungeToken,forceMirroring:b.forceMirroring});g.Fa("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);seb(a,d,function(f){f?W9()&&B9(W9(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){$7("yt-remote-receiver-availability-change")})},e)}b&&!g.Ha("yt.mdx.remote.initialized_")&&(g.Fa("yt.mdx.remote.initialized_",!0),X9("Initializing: "+g.fi(b)),
Y9.push(g.Ux("yt-remote-cast2-api-ready",function(){$7("yt-remote-api-ready")})),Y9.push(g.Ux("yt-remote-cast2-availability-change",function(){$7("yt-remote-receiver-availability-change")})),Y9.push(g.Ux("yt-remote-cast2-receiver-selected",function(){Z9(null);
$7("yt-remote-auto-connect","cast-selector-receiver")})),Y9.push(g.Ux("yt-remote-cast2-receiver-resumed",function(){$7("yt-remote-receiver-resumed","cast-selector-receiver")})),Y9.push(g.Ux("yt-remote-cast2-session-change",bfb)),Y9.push(g.Ux("yt-remote-connection-change",function(f){f?B9(W9(),"YouTube TV"):$9()||(B9(null,null),web())})),Y9.push(g.Ux("yt-remote-cast2-session-failed",function(){$7("yt-remote-connection-failed")})),a=cfb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.T("desktop_enable_autoplay")&&
e.push("atp"),0<e.length&&(a.capabilities=e),a.name=b.device,a.app=b.app,(b=b.theme)&&(a.theme=b),X9(" -- with channel params: "+g.fi(a)),a?(g.Pz("yt-remote-session-app",a.app),g.Pz("yt-remote-session-name",a.name)):(g.Rz("yt-remote-session-app"),g.Rz("yt-remote-session-name")),g.Fa("yt.mdx.remote.channelParams_",a),c.start(),W9()||dfb())}},ffb=function(){var a=V9().Pf.$_gos();
var b=a$();b&&b$()&&(Nab(a,b)||a.push(b));return Mab(a)},hfb=function(){var a=gfb();
!a&&z9()&&veb()&&(a={key:"cast-selector-receiver",name:veb()});return a},gfb=function(){var a=ffb(),b=a$();
b||(b=$9());return g.Ub(a,function(c){return b&&c8(b,c.key)?!0:!1})},a$=function(){var a=W9();
if(!a)return null;var b=V9().ij();return e8(b,a)},bfb=function(a){X9("remote.onCastSessionChange_: "+d8(a));
if(a){var b=a$();if(b&&b.id==a.id){if(B9(b.id,"YouTube TV"),"shortLived"==a.idType&&(a=a.token))c$&&(c$.token=a),(b=b$())&&b.Oo(a)}else b&&d$(),e$(a,1)}else b$()&&d$()},d$=function(){A9()?y9().stopSession():x9("stopSession called before API ready.");
var a=b$();a&&(a.disconnect(1),ifb(null))},jfb=function(){var a=b$();
return!!a&&3!=a.getProxyState()},X9=function(a){Z8("remote",a)},V9=function(){if(!kfb){var a=g.Ha("yt.mdx.remote.screenService_");
kfb=a?new $eb(a):null}return kfb},W9=function(){return g.Ha("yt.mdx.remote.currentScreenId_")},lfb=function(a){g.Fa("yt.mdx.remote.currentScreenId_",a)},mfb=function(){return g.Ha("yt.mdx.remote.connectData_")},Z9=function(a){g.Fa("yt.mdx.remote.connectData_",a)},b$=function(){return g.Ha("yt.mdx.remote.connection_")},ifb=function(a){var b=b$();
Z9(null);a||lfb("");g.Fa("yt.mdx.remote.connection_",a);U9&&(g.tc(U9,function(c){c(a)}),U9.length=0);
b&&!a?$7("yt-remote-connection-change",!1):!b&&a&&$7("yt-remote-connection-change",!0)},$9=function(){var a=g.Sz();
if(!a)return null;var b=V9();if(!b)return null;b=b.ij();return e8(b,a)},e$=function(a,b){W9();
a$()&&a$();if(f$)c$=a;else{lfb(a.id);var c=g.Ha("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new R9(T9,a,cfb(),c);a.connect(b,mfb());a.subscribe("beforeDisconnect",function(d){$7("yt-remote-before-disconnect",d)});
a.subscribe("beforeDispose",function(){b$()&&(b$(),ifb(null))});
a.subscribe("browserChannelAuthError",function(){var d=a$();d&&"shortLived"==d.idType&&(A9()?y9().handleBrowserChannelAuthError():x9("refreshLoungeToken called before API ready."))});
ifb(a)}},dfb=function(){var a=$9();
a?(X9("Resume connection to: "+d8(a)),e$(a,0)):(h8(),web(),X9("Skipping connecting because no session screen found."))},afb=function(){var a=cfb();
if(g.Cf(a)){a=g8();var b=g.Qz("yt-remote-session-name")||"",c=g.Qz("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Fa("yt.mdx.remote.channelParams_",a)}},cfb=function(){return g.Ha("yt.mdx.remote.channelParams_")||{}},pfb=function(a,b,c){g.K.call(this);
var d=this;this.j=a;this.G=b;this.jc=c;this.events=new g.YD(this);this.W=this.events.P(this.G,"onVolumeChange",function(e){nfb(d,e)});
this.D=!1;this.I=new g.$J(64);this.u=new g.Zn(this.BS,500,this);this.B=new g.Zn(this.CS,1E3,this);this.N=new l8(this.C5,0,this);this.C={};this.V=new g.Zn(this.oT,1E3,this);this.J=new m8(this.seekTo,1E3,this);g.M(this,this.events);this.events.P(b,"onCaptionsTrackListChanged",this.P0);this.events.P(b,"captionschanged",this.f0);this.events.P(b,"captionssettingschanged",this.KS);this.events.P(b,"videoplayerreset",this.BD);this.events.P(b,"mdxautoplaycancel",function(){d.jc.uO()});
b.K("enable_mdx_video_play_directly")&&this.events.P(b,"videodatachange",function(){ofb(d.j)||g$(d)||h$(d,0)});
a=this.jc;a.isDisposed();a.subscribe("proxyStateChange",this.nR,this);a.subscribe("remotePlayerChange",this.Qz,this);a.subscribe("remoteQueueChange",this.BD,this);a.subscribe("previousNextChange",this.kR,this);a.subscribe("nowAutoplaying",this.eR,this);a.subscribe("autoplayDismissed",this.IQ,this);g.M(this,this.u);g.M(this,this.B);g.M(this,this.N);g.M(this,this.V);g.M(this,this.J);this.KS();this.BD();this.Qz()},nfb=function(a,b){if(g$(a)){a.jc.unsubscribe("remotePlayerChange",a.Qz,a);
var c=Math.round(b.volume);b=!!b.muted;var d=J9(a.jc);if(c!==d.volume||b!==d.muted)a.jc.setVolume(c,b),a.V.start();a.jc.subscribe("remotePlayerChange",a.Qz,a)}},qfb=function(a){a.Wb(0);
a.u.stop();a.Sb(new g.$J(64))},rfb=function(a,b){if(g$(a)&&!a.D){var c=null;
b&&(c={style:a.G.getSubtitlesUserSettings()},g.If(c,b));a.jc.wM(a.G.getVideoData(1).videoId,c);a.C=J9(a.jc).trackData}},h$=function(a,b){var c=a.G.getPlaylist();
if(null==c?0:c.listId){var d=c.index;var e=c.listId.toString()}c=a.G.getVideoData(1);a.jc.playVideo(c.videoId,b,d,e,c.playerParams,c.ra,yab(c));a.Sb(new g.$J(1))},sfb=function(a,b){if(b){var c=a.G.getOption("captions","tracklist",{CP:1});
c&&c.length?(a.G.setOption("captions","track",b),a.D=!1):(a.G.loadModule("captions"),a.D=!0)}else a.G.setOption("captions","track",{})},g$=function(a){return J9(a.jc).videoId===a.G.getVideoData(1).videoId},i$=function(){g.X.call(this,{F:"div",
L:"ytp-mdx-popup-dialog",T:{role:"dialog"},S:[{F:"div",L:"ytp-mdx-popup-dialog-inner-content",S:[{F:"div",L:"ytp-mdx-popup-title",Z:"You're signed out"},{F:"div",L:"ytp-mdx-popup-description",Z:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{F:"div",L:"ytp-mdx-privacy-popup-buttons",S:[{F:"button",Ca:["ytp-button","ytp-mdx-privacy-popup-cancel"],Z:"Cancel"},{F:"button",Ca:["ytp-button","ytp-mdx-privacy-popup-confirm"],
Z:"Confirm"}]}]}]});this.j=new g.JL(this,250);this.cancelButton=this.ya("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.ya("ytp-mdx-privacy-popup-confirm");g.M(this,this.j);this.P(this.cancelButton,"click",this.u);this.P(this.confirmButton,"click",this.B)},j$=function(a){g.X.call(this,{F:"div",
L:"ytp-remote",S:[{F:"div",L:"ytp-remote-display-status",S:[{F:"div",L:"ytp-remote-display-status-icon",S:[g.PEa()]},{F:"div",L:"ytp-remote-display-status-text",Z:"{{statustext}}"}]}]});this.api=a;this.j=new g.JL(this,250);g.M(this,this.j);this.P(a,"presentingplayerstatechange",this.onStateChange);this.Qc(a.zb())},k$=function(a,b){g.gR.call(this,"Play on",0,a,b);
this.G=a;this.yq={};this.P(a,"onMdxReceiversChange",this.D);this.P(a,"presentingplayerstatechange",this.D);this.D()},tfb=function(a){g.bO.call(this,a);
this.Ym={key:Lab(),name:"This computer"};this.Kj=null;this.subscriptions=[];this.WJ=this.jc=null;this.yq=[this.Ym];this.xp=this.Ym;this.Zd=new g.$J(64);this.VP=0;this.Eg=-1;this.Yz=!1;this.Wz=this.yw=null;if(!g.UF(this.player.R())&&!g.VF(this.player.R())){a=this.player;var b=g.qN(a);b&&(b=b.Em())&&(b=new k$(a,b),g.M(this,b));b=new j$(a);g.M(this,b);g.AN(a,b.element,4);this.yw=new i$;g.M(this,this.yw);g.AN(a,this.yw.element,4);this.Yz=!!$9()}},l$=function(a){a.Wz&&(a.player.removeEventListener("presentingplayerstatechange",
a.Wz),a.Wz=null)},ufb=function(a,b,c){a.Zd=c;
a.player.X("presentingplayerstatechange",new g.sJ(c,b))},m$=function(a,b){if(b.key!==a.xp.key)if(b.key===a.Ym.key)d$();
else if(ofb(a)&&vfb(a),a.xp=b,!a.player.R().K("disable_mdx_connection_in_mdx_module_for_music_web")||!g.VF(a.player.R())){var c=a.player.getPlaylistId();var d=a.player.getVideoData(1);var e=d.videoId;if(!c&&!e||(2===a.player.getAppState()||1===a.player.getAppState())&&a.player.R().K("should_clear_video_data_on_player_cued_unstarted"))d=null;else{var f=a.player.getPlaylist();if(f){var h=[];for(var l=0;l<f.length;l++)h[l]=g.XN(f,l).videoId}else h=[e];f=a.player.getCurrentTime(1);a={videoIds:h,listId:c,
videoId:e,playerParams:d.playerParams,clickTrackingParams:d.ra,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0===f?void 0:f};(d=yab(d))&&(a.locationInfo=d);d=a}X9("Connecting to: "+g.fi(b));"cast-selector-receiver"==b.key?(Z9(d||null),b=d||null,A9()?y9().setLaunchParams(b):x9("setLaunchParams called before ready.")):!d&&jfb()&&W9()==b.key?$7("yt-remote-connection-change",!0):(d$(),Z9(d||null),d=V9().ij(),(b=e8(d,b.key))&&e$(b,1))}},ofb=function(a){var b;
(b=!a.player.R().K("mdx_enable_privacy_disclosure_ui"))||(b=((b=g.Q("PLAYER_CONFIG"))&&b.args&&void 0!==b.args.authuser?!0:!(!g.Q("SESSION_INDEX")&&!g.Q("LOGGED_IN")))||a.Yz||!a.yw);return b?!1:g.lG(a.player.R())||g.oG(a.player.R())},vfb=function(a){a.player.zb().Oc()?a.player.pauseVideo():(a.Wz=function(b){!a.Yz&&g.uJ(b,8)&&(a.player.pauseVideo(),l$(a))},a.player.addEventListener("presentingplayerstatechange",a.Wz));
a.yw&&a.yw.od();b$()||(f$=!0)};
g.dq.prototype.Ip=g.ba(1,function(){return g.md(this,6)});
g.fe.prototype.hB=g.ba(0,function(){var a=g.ne(this);return 4294967296*g.ne(this)+(a>>>0)});
var kab,wfb=g.Se(function(a,b,c){if(1!==a.u)return!1;g.D(b,c,g.oe(a.j));return!0},g.Te),xfb=g.Se(function(a,b,c,d){if(1!==a.u)return!1;
g.zd(b,c,d,g.oe(a.j));return!0},g.Te),yfb=g.Se(function(a,b,c){if(0!==a.u)return!1;
g.D(b,c,g.he(a.j));return!0},g.Ue),zfb=g.Se(function(a,b,c,d){if(0!==a.u)return!1;
g.zd(b,c,d,g.he(a.j));return!0},g.Ue),Afb=g.Se(function(a,b,c){if(0!==a.u)return!1;
g.D(b,c,g.me(a.j));return!0},g.Ve),Bfb=g.Se(function(a,b,c,d){if(0!==a.u)return!1;
g.zd(b,c,d,g.me(a.j));return!0},g.Ve),Cfb=g.Se(function(a,b,c){if(1!==a.u)return!1;
g.D(b,c,a.j.hB());return!0},function(a,b,c){mab(a,c,g.md(b,c))}),Dfb=g.Se(function(a,b,c){if(1!==a.u&&2!==a.u)return!1;
b=g.qd(b,c);if(2==a.u){c=g.fe.prototype.hB;var d=g.me(a.j)>>>0;for(d=a.j.j+d;a.j.j<d;)b.push(c.call(a.j))}else b.push(a.j.hB());return!0},function(a,b,c){b=g.qd(b,c);
if(null!=b)for(var d=0;d<b.length;d++)mab(a,c,b[d])}),Efb=g.Se(function(a,b,c){if(0!==a.u)return!1;
g.D(b,c,g.se(a.j));return!0},nab),Ffb=g.Se(function(a,b,c,d){if(0!==a.u)return!1;
g.zd(b,c,d,g.se(a.j));return!0},nab),Gfb=g.Se(function(a,b,c){if(2!==a.u)return!1;
a=g.ye(a);g.xd(b,c,a);return!0},function(a,b,c){b=g.qd(b,c);
if(null!=b)for(var d=0;d<b.length;d++){var e=b[d];null!=e&&g.He(a,c,g.uaa(e))}}),Hfb=g.Se(function(a,b,c,d){if(2!==a.u)return!1;
g.zd(b,c,d,g.ye(a));return!0},g.nca),Ifb=g.Se(function(a,b,c,d,e){if(2!==a.u)return!1;
g.ve(a,g.uba(b,d,c),e);return!0},g.oca),oab=[1];
g.u(pab,g.J);g.u(qab,g.J);var Jfb=[pab,1,g.O2,[qab,1,wfb,2,yfb]];g.u(rab,g.J);g.u(sab,g.J);g.u(tab,g.J);
var Kfb=[1,2],Lfb=[g.Sh,1,g.N2,5,Cfb,2,Ifb,[rab,1,g.P2,[sab,1,g.N2,2,g.N2,3,Efb],Kfb,2,g.P2,[tab,1,g.N2,2,g.N2,3,Afb,4,Efb],Kfb],3,Gfb,6,Dfb,4,g.O2,[g.Th,1,g.O2,[g.Uh,1,Hfb,g.Xh,2,Bfb,g.Xh,3,Ffb,g.Xh],2,Ifb,[g.Vh,1,zfb,g.Wh,2,xfb,g.Wh,3,g.P2,Jfb,g.Wh]]],Dcb={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},N8={"'":"\\'"},Gab={Tca:"atp",cQa:"ska",GMa:"que",GDa:"mus",bQa:"sus",nra:"dsp",aOa:"seq",WCa:"mic",Gma:"dpa",Sda:"cds",wDa:"mlm",
Bma:"dsdtr",aFa:"ntb"};a8.prototype.equals=function(a){return a?this.id==a.id:!1};
var i8,Rab="",gbb=abb("loadCastFramework")||abb("loadCastApplicationFramework"),jbb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
g.Xa(l8,g.K);g.k=l8.prototype;g.k.zU=function(a){this.C=arguments;this.j=!1;this.qc?this.B=g.Wa()+this.ph:this.qc=g.Ph(this.D,this.ph)};
g.k.stop=function(){this.qc&&(g.C.clearTimeout(this.qc),this.qc=null);this.B=null;this.j=!1;this.C=[]};
g.k.pause=function(){++this.u};
g.k.resume=function(){this.u&&(--this.u,!this.u&&this.j&&(this.j=!1,this.I.apply(null,this.C)))};
g.k.ea=function(){this.stop();l8.Le.ea.call(this)};
g.k.AU=function(){this.qc&&(g.C.clearTimeout(this.qc),this.qc=null);this.B?(this.qc=g.Ph(this.D,this.B-g.Wa()),this.B=null):this.u?this.j=!0:(this.j=!1,this.I.apply(null,this.C))};g.u(m8,g.K);g.k=m8.prototype;g.k.oF=function(a){this.B=arguments;this.qc||this.u?this.j=!0:vbb(this)};
g.k.stop=function(){this.qc&&(g.C.clearTimeout(this.qc),this.qc=null,this.j=!1,this.B=null)};
g.k.pause=function(){this.u++};
g.k.resume=function(){this.u--;this.u||!this.j||this.qc||(this.j=!1,vbb(this))};
g.k.ea=function(){g.K.prototype.ea.call(this);this.stop()};n8.prototype.stringify=function(a){return g.C.JSON.stringify(a,void 0)};
n8.prototype.parse=function(a){return g.C.JSON.parse(a,void 0)};g.Xa(wbb,g.df);g.Xa(xbb,g.df);var Abb=!1;var Cbb=null;g.Xa(Ebb,g.df);g.Xa(Fbb,g.df);g.Xa(Gbb,g.df);Hbb.prototype.info=function(){};
Hbb.prototype.warning=function(){};var Obb={},t8={};g.k=r8.prototype;g.k.setTimeout=function(a){this.Cb=a};
g.k.DU=function(a){a=a.target;var b=this.Ua;b&&3==g.Di(a)?b.oF():this.aM(a)};
g.k.aM=function(a){try{if(a==this.j)a:{var b=g.Di(this.j),c=this.j.u,d=this.j.getStatus();if(!(3>b)&&(3!=b||g.rG||this.j&&(this.u.u||g.Fi(this.j)||g.Gi(this.j)))){this.Ea||4!=b||7==c||(8==c||0>=d?o8(3):o8(2));w8(this);var e=this.j.getStatus();this.Kb=e;b:if(Mbb(this)){var f=g.Gi(this.j);a="";var h=f.length,l=4==g.Di(this.j);if(!this.u.B){if("undefined"===typeof TextDecoder){u8(this);v8(this);var m="";break b}this.u.B=new g.C.TextDecoder}for(c=0;c<h;c++)this.u.u=!0,a+=this.u.B.decode(f[c],{stream:l&&
c==h-1});f.splice(0,h);this.u.j+=a;this.W=0;m=this.u.j}else m=g.Fi(this.j);if(this.B=200==e){if(this.Yb&&!this.Ra){b:{if(this.j){var n=g.Hi(this.j,"X-HTTP-Initial-Response");if(n&&!g.fb(n)){var p=n;break b}}p=null}if(e=p)this.Ra=!0,Pbb(this,e);else{this.B=!1;this.I=3;p8(12);u8(this);v8(this);break a}}this.va?(Qbb(this,b,m),g.rG&&this.B&&3==b&&(this.eb.Na(this.gb,"tick",this.CU),this.gb.start())):Pbb(this,m);4==b&&u8(this);this.B&&!this.Ea&&(4==b?Sbb(this.D,this):(this.B=!1,s8(this)))}else g.Uea(this.j),
400==e&&0<m.indexOf("Unknown SID")?(this.I=3,p8(12)):(this.I=0,p8(13)),u8(this),v8(this)}}}catch(q){}finally{}};
g.k.CU=function(){if(this.j){var a=g.Di(this.j),b=g.Fi(this.j);this.W<b.length&&(w8(this),Qbb(this,a,b),this.B&&4!=a&&s8(this))}};
g.k.cancel=function(){this.Ea=!0;u8(this)};
g.k.BU=function(){this.V=null;var a=Date.now();0<=a-this.Eb?(2!=this.La&&(o8(3),p8(17)),u8(this),this.I=2,v8(this)):Rbb(this,this.Eb-a)};
g.k.getLastError=function(){return this.I};acb.prototype.cancel=function(){this.B=ccb(this);if(this.u)this.u.cancel(),this.u=null;else if(this.j&&0!==this.j.size){for(var a=g.r(this.j.values()),b=a.next();!b.done;b=a.next())b.value.cancel();this.j.clear()}};g.k=gcb.prototype;g.k.bM=8;g.k.jg=1;g.k.connect=function(a,b,c,d){this.cf&&g.Dh((0,g.Ta)(this.Q3,this,a));p8(0);this.yc=a;this.Ea=b||{};c&&void 0!==d&&(this.Ea.OSID=c,this.Ea.OAID=d);this.gb=this.zc;this.Ha=Xbb(this,null,this.yc);A8(this)};
g.k.disconnect=function(){icb(this);if(3==this.jg){var a=this.Ua++,b=this.Ha.clone();g.Mj(b,"SID",this.C);g.Mj(b,"RID",a);g.Mj(b,"TYPE","terminate");D8(this,b);a=new r8(this,this.C,a);a.La=2;a.J=X7(b.clone());b=!1;g.C.navigator&&g.C.navigator.sendBeacon&&(b=g.C.navigator.sendBeacon(a.J.toString(),""));!b&&g.C.Image&&((new Image).src=a.J,b=!0);b||(a.j=Lbb(a.D,null),a.j.send(a.J));a.ra=Date.now();s8(a)}ocb(this)};
g.k.Q3=function(a){try{Bbb(a,function(){})}catch(b){}};
g.k.Rf=function(){return 0==this.jg};
g.k.getState=function(){return this.jg};
g.k.dM=function(a){if(this.I)if(this.I=null,1==this.jg){if(!a){this.Ua=Math.floor(1E5*Math.random());a=this.Ua++;var b=new r8(this,"",a),c=this.V;this.Eb&&(c?(c=g.Gf(c),g.If(c,this.Eb)):c=this.Eb);null!==this.J||this.ub||(b.Ha=c,c=null);var d;if(this.Cb)a:{for(var e=d=0;e<this.B.length;e++){b:{var f=this.B[e];if("__data__"in f.map&&(f=f.map.__data__,"string"===typeof f)){f=f.length;break b}f=void 0}if(void 0===f)break;d+=f;if(4096<d){d=e;break a}if(4096===d||e===this.B.length-1){d=e+1;break a}}d=
1E3}else d=1E3;d=lcb(this,b,d);e=this.Ha.clone();g.Mj(e,"RID",a);g.Mj(e,"CVER",22);this.va&&g.Mj(e,"X-HTTP-Session-Id",this.va);D8(this,e);c&&(this.ub?d="headers="+g.Tg(g.dga(c))+"&"+d:this.J&&g.Qj(e,this.J,c));Wbb(this.u,b);this.Eh&&g.Mj(e,"TYPE","init");this.Cb?(g.Mj(e,"$req",d),g.Mj(e,"SID","null"),b.Yb=!0,Kbb(b,e,null)):Kbb(b,e,d);this.jg=2}}else 3==this.jg&&(a?mcb(this,a):0==this.B.length||bcb(this.u)||mcb(this))};
g.k.cM=function(){this.N=null;ncb(this);if(this.Mc&&!(this.eb||null==this.j||0>=this.Bd)){var a=2*this.Bd;this.qa=q8((0,g.Ta)(this.e0,this),a)}};
g.k.e0=function(){this.qa&&(this.qa=null,this.gb=!1,this.eb=!0,p8(10),y8(this),ncb(this))};
g.k.vJ=function(a){this.j==a&&this.Mc&&!this.eb&&(hcb(this),this.eb=!0,p8(11))};
g.k.EU=function(){null!=this.W&&(this.W=null,y8(this),Ubb(this),p8(19))};
g.k.W4=function(a){a?p8(2):p8(1)};
g.k.isActive=function(){return!!this.D&&this.D.isActive(this)};
g.k=qcb.prototype;g.k.hM=function(){};
g.k.gM=function(){};
g.k.fM=function(){};
g.k.eM=function(){};
g.k.isActive=function(){return!0};
g.k.FU=function(){};g.Xa(F8,g.Uf);F8.prototype.open=function(){this.j.D=this.C;this.J&&(this.j.La=!0);this.j.connect(this.I,this.u||void 0)};
F8.prototype.close=function(){this.j.disconnect()};
F8.prototype.send=function(a){var b=this.j;if("string"===typeof a){var c={};c.__data__=a;a=c}else this.D&&(c={},c.__data__=g.fi(a),a=c);b.B.push(new $bb(b.Pe++,a));3==b.jg&&A8(b)};
F8.prototype.ea=function(){this.j.D=null;delete this.C;this.j.disconnect();delete this.j;F8.Le.ea.call(this)};
g.Xa(scb,wbb);g.Xa(tcb,xbb);g.Xa(E8,qcb);E8.prototype.hM=function(){this.j.dispatchEvent("m")};
E8.prototype.gM=function(a){this.j.dispatchEvent(new scb(a))};
E8.prototype.fM=function(a){this.j.dispatchEvent(new tcb(a))};
E8.prototype.eM=function(){this.j.dispatchEvent("n")};var H8=new g.Uf;g.u(wcb,g.df);g.k=J8.prototype;g.k.Uq=null;g.k.Dn=!1;g.k.wu=null;g.k.qF=null;g.k.uu=null;g.k.vu=null;g.k.Xo=null;g.k.Zo=null;g.k.Vq=null;g.k.Dh=null;g.k.cB=0;g.k.Dl=null;g.k.bB=null;g.k.Yo=null;g.k.sx=-1;g.k.qS=!0;g.k.Tq=!1;g.k.pF=0;g.k.aB=null;var Bcb={},Acb={};g.k=J8.prototype;g.k.setTimeout=function(a){this.u=a};
g.k.HU=function(a){a=a.target;var b=this.aB;b&&3==g.Di(a)?b.oF():this.iM(a)};
g.k.iM=function(a){try{if(a==this.Dh)a:{var b=g.Di(this.Dh),c=this.Dh.u,d=this.Dh.getStatus();if(g.Dc&&!g.Ac(10)||g.kf&&!g.yc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Fi(this.Dh))break a;this.Tq||4!=b||7==c||(8==c||0>=d?this.j.rl(3):this.j.rl(2));Gcb(this);var e=this.Dh.getStatus();this.sx=e;var f=g.Fi(this.Dh);if(this.Dn=200==e){4==b&&L8(this);if(this.va){for(a=!0;!this.Tq&&this.cB<f.length;){var h=Ccb(this,f);if(h==Acb){4==b&&(this.Yo=4,I8(15),a=!1);break}else if(h==Bcb){this.Yo=4;I8(16);a=
!1;break}else Hcb(this,h)}4==b&&0==f.length&&(this.Yo=1,I8(17),a=!1);this.Dn=this.Dn&&a;a||(L8(this),M8(this))}else Hcb(this,f);this.Dn&&!this.Tq&&(4==b?this.j.dB(this):(this.Dn=!1,K8(this)))}else 400==e&&0<f.indexOf("Unknown SID")?(this.Yo=3,I8(13)):(this.Yo=0,I8(14)),L8(this),M8(this)}}catch(l){}finally{}};
g.k.I2=function(a){G8((0,g.Ta)(this.H2,this,a),0)};
g.k.H2=function(a){this.Tq||(Gcb(this),Hcb(this,a),K8(this))};
g.k.sR=function(a){G8((0,g.Ta)(this.G2,this,a),0)};
g.k.G2=function(a){this.Tq||(L8(this),this.Dn=a,this.j.dB(this),this.j.rl(4))};
g.k.cancel=function(){this.Tq=!0;L8(this)};
g.k.GU=function(){this.wu=null;var a=Date.now();0<=a-this.qF?(2!=this.vu&&this.j.rl(3),L8(this),this.Yo=2,I8(18),M8(this)):Fcb(this,this.qF-a)};
g.k.getLastError=function(){return this.Yo};g.k=Kcb.prototype;g.k.sF=null;g.k.gi=null;g.k.XD=!1;g.k.DS=null;g.k.gC=null;g.k.MI=null;g.k.tF=null;g.k.Fj=null;g.k.En=-1;g.k.tx=null;g.k.Tx=null;g.k.connect=function(a){this.tF=a;a=P8(this.j,null,this.tF);I8(3);this.DS=Date.now();var b=this.j.N;null!=b?(this.tx=b[0],(this.Tx=b[1])?(this.Fj=1,Lcb(this)):(this.Fj=2,Mcb(this))):(Y7(a,"MODE","init"),this.gi=new J8(this),this.gi.Uq=this.sF,zcb(this.gi,a,!1,null,!0),this.Fj=0)};
g.k.oX=function(a){if(a)this.Fj=2,Mcb(this);else{I8(4);var b=this.j;b.Nl=b.vp.En;T8(b,9)}a&&this.rl(2)};
g.k.rF=function(a){return this.j.rF(a)};
g.k.abort=function(){this.gi&&(this.gi.cancel(),this.gi=null);this.En=-1};
g.k.Rf=function(){return!1};
g.k.jM=function(a,b){this.En=a.sx;if(0==this.Fj)if(b){try{var c=this.u.parse(b)}catch(d){a=this.j;a.Nl=this.En;T8(a,2);return}this.tx=c[0];this.Tx=c[1]}else a=this.j,a.Nl=this.En,T8(a,2);else if(2==this.Fj)if(this.XD)I8(7),this.MI=Date.now();else if("11111"==b){if(I8(6),this.XD=!0,this.gC=Date.now(),a=this.gC-this.DS,!g.Dc||g.Ac(10)||500>a)this.En=200,this.gi.cancel(),I8(12),Q8(this.j,this,!0)}else I8(8),this.gC=this.MI=Date.now(),this.XD=!1};
g.k.dB=function(){this.En=this.gi.sx;if(this.gi.Dn)0==this.Fj?this.Tx?(this.Fj=1,Lcb(this)):(this.Fj=2,Mcb(this)):2==this.Fj&&((!g.Dc||g.Ac(10)?!this.XD:200>this.MI-this.gC)?(I8(11),Q8(this.j,this,!1)):(I8(12),Q8(this.j,this,!0)));else{0==this.Fj?I8(9):2==this.Fj&&I8(10);var a=this.j;this.gi.getLastError();a.Nl=this.En;T8(a,2)}};
g.k.vx=function(){return this.j.vx()};
g.k.isActive=function(){return this.j.isActive()};
g.k.rl=function(a){this.j.rl(a)};g.k=Ncb.prototype;g.k.Ml=null;g.k.wx=null;g.k.Fi=null;g.k.Ef=null;g.k.uF=null;g.k.eB=null;g.k.kM=null;g.k.fB=null;g.k.xx=0;g.k.JU=0;g.k.ih=null;g.k.ap=null;g.k.Fn=null;g.k.Xq=null;g.k.vp=null;g.k.LE=null;g.k.Au=-1;g.k.lM=-1;g.k.Nl=-1;g.k.yu=0;g.k.xu=0;g.k.Wq=8;g.Xa(Pcb,g.df);g.Xa(Qcb,g.df);g.k=Ncb.prototype;g.k.connect=function(a,b,c,d,e){I8(0);this.uF=b;this.wx=c||{};d&&void 0!==e&&(this.wx.OSID=d,this.wx.OAID=e);this.J?(G8((0,g.Ta)(this.hO,this,a),100),Scb(this)):this.hO(a)};
g.k.disconnect=function(){Tcb(this);if(3==this.j){var a=this.xx++,b=this.eB.clone();g.Mj(b,"SID",this.C);g.Mj(b,"RID",a);g.Mj(b,"TYPE","terminate");S8(this,b);a=new J8(this,this.C,a);a.vu=2;a.Xo=X7(b.clone());(new Image).src=a.Xo.toString();a.uu=Date.now();K8(a)}cdb(this)};
g.k.hO=function(a){this.vp=new Kcb(this);this.vp.sF=this.Ml;this.vp.u=this.D;this.vp.connect(a)};
g.k.Rf=function(){return 0==this.j};
g.k.getState=function(){return this.j};
g.k.nM=function(a){this.ap=null;Ycb(this,a)};
g.k.mM=function(){this.Fn=null;this.Ef=new J8(this,this.C,"rpc",this.I);this.Ef.Uq=this.Ml;this.Ef.pF=0;var a=this.kM.clone();g.Mj(a,"RID","rpc");g.Mj(a,"SID",this.C);g.Mj(a,"CI",this.LE?"0":"1");g.Mj(a,"AID",this.Au);S8(this,a);if(!g.Dc||g.Ac(10))g.Mj(a,"TYPE","xmlhttp"),zcb(this.Ef,a,!0,this.fB,!1);else{g.Mj(a,"TYPE","html");var b=this.Ef,c=!!this.fB;b.vu=3;b.Xo=X7(a.clone());Ecb(b,c)}};
g.k.jM=function(a,b){if(0!=this.j&&(this.Ef==a||this.Fi==a))if(this.Nl=a.sx,this.Fi==a&&3==this.j)if(7<this.Wq){try{var c=this.D.parse(b)}catch(d){c=null}if(Array.isArray(c)&&3==c.length)if(a=c,0==a[0])a:{if(!this.Fn){if(this.Ef)if(this.Ef.uu+3E3<this.Fi.uu)R8(this),this.Ef.cancel(),this.Ef=null;else break a;adb(this);I8(19)}}else this.lM=a[1],0<this.lM-this.Au&&37500>a[2]&&this.LE&&0==this.xu&&!this.Xq&&(this.Xq=G8((0,g.Ta)(this.KU,this),6E3));else T8(this,11)}else null!=b&&T8(this,11);else if(this.Ef==
a&&R8(this),!g.fb(b))for(a=this.D.parse(b),b=0;b<a.length;b++)c=a[b],this.Au=c[0],c=c[1],2==this.j?"c"==c[0]?(this.C=c[1],this.fB=c[2],c=c[3],null!=c?this.Wq=c:this.Wq=6,this.j=3,this.ih&&this.ih.qM(),this.kM=P8(this,this.vx()?this.fB:null,this.uF),Zcb(this)):"stop"==c[0]&&T8(this,7):3==this.j&&("stop"==c[0]?T8(this,7):"noop"!=c[0]&&this.ih&&this.ih.pM(c),this.xu=0)};
g.k.KU=function(){null!=this.Xq&&(this.Xq=null,this.Ef.cancel(),this.Ef=null,adb(this),I8(20))};
g.k.dB=function(a){if(this.Ef==a){R8(this);this.Ef=null;var b=2}else if(this.Fi==a)this.Fi=null,b=1;else return;this.Nl=a.sx;if(0!=this.j)if(a.Dn)if(1==b){b=Date.now()-a.uu;var c=H8;c.dispatchEvent(new Pcb(c,a.Vq?a.Vq.length:0,b,this.yu));Rcb(this);this.B.length=0}else Zcb(this);else{c=a.getLastError();var d;if(!(d=3==c||7==c||0==c&&0<this.Nl)){if(d=1==b)this.Fi||this.ap||1==this.j||2<=this.yu?d=!1:(this.ap=G8((0,g.Ta)(this.nM,this,a),$cb(this,this.yu)),this.yu++,d=!0);d=!(d||2==b&&adb(this))}if(d)switch(c){case 1:T8(this,
5);break;case 4:T8(this,10);break;case 3:T8(this,6);break;case 7:T8(this,12);break;default:T8(this,2)}}};
g.k.IU=function(a){if(!g.Wb(arguments,this.j))throw Error("Unexpected channel state: "+this.j);};
g.k.V4=function(a){a?I8(2):(I8(1),bdb(this,8))};
g.k.rF=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.Ai;a.J=!1;return a};
g.k.isActive=function(){return!!this.ih&&this.ih.isActive(this)};
g.k.rl=function(a){var b=H8;b.dispatchEvent(new Qcb(b,a))};
g.k.vx=function(){return!(!g.Dc||g.Ac(10))};
g.k=ddb.prototype;g.k.qM=function(){};
g.k.pM=function(){};
g.k.oM=function(){};
g.k.vF=function(){};
g.k.rM=function(){return{}};
g.k.isActive=function(){return!0};g.k=edb.prototype;g.k.enqueue=function(a){this.u.push(a)};
g.k.isEmpty=function(){return 0===this.j.length&&0===this.u.length};
g.k.clear=function(){this.j=[];this.u=[]};
g.k.contains=function(a){return g.Wb(this.j,a)||g.Wb(this.u,a)};
g.k.remove=function(a){var b=this.j;var c=(0,g.IXa)(b,a);0<=c?(g.Yb(b,c),b=!0):b=!1;return b||g.Zb(this.u,a)};
g.k.Rj=function(){for(var a=[],b=this.j.length-1;0<=b;--b)a.push(this.j[b]);var c=this.u.length;for(b=0;b<c;++b)a.push(this.u[b]);return a};fdb.prototype.flush=function(a,b){a=void 0===a?[]:a;b=void 0===b?!1:b;if(g.T("enable_client_streamz_web")){a=g.r(a);for(var c=a.next();!c.done;c=a.next())c=g.lea(c.value),c={serializedIncrementBatch:g.Bc(g.Re(c,Lfb))},g.Mv("streamzIncremented",c,{zK:b})}};var U8;g.u(gdb,g.df);g.u(hdb,g.df);g.Xa(V8,g.K);g.k=V8.prototype;g.k.A2=function(){this.ph=Math.min(3E5,2*this.ph);this.B();this.u&&this.start()};
g.k.start=function(){var a=this.ph+15E3*Math.random();g.$n(this.j,a);this.u=Date.now()+a};
g.k.stop=function(){this.j.stop();this.u=0};
g.k.isActive=function(){return this.j.isActive()};
g.k.reset=function(){this.j.stop();this.ph=5E3};g.Xa(jdb,ddb);g.k=jdb.prototype;g.k.subscribe=function(a,b,c){return this.B.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.B.unsubscribe(a,b,c)};
g.k.Kg=function(a){return this.B.Kg(a)};
g.k.X=function(a,b){return this.B.X.apply(this.B,arguments)};
g.k.dispose=function(){this.W||(this.W=!0,g.af(this.B),this.disconnect(),g.af(this.u),this.u=null,this.Y=function(){return""})};
g.k.isDisposed=function(){return this.W};
g.k.connect=function(a,b,c){if(!this.j||2!=this.j.getState()){this.V="";this.u.stop();this.I=a||null;this.D=b||0;a=this.ra+"/test";b=this.ra+"/bind";var d=new Ncb(c?c.firstTestResults:null,c?c.secondTestResults:null,this.La),e=this.j;e&&(e.ih=null);d.ih=this;this.j=d;kdb(this);if(this.j){d=g.Q("ID_TOKEN");var f=this.j.Ml||{};d?f["x-youtube-identity-token"]=d:delete f["x-youtube-identity-token"];this.j.Ml=f}e?(3!=e.getState()&&0==Vcb(e)||e.getState(),this.j.connect(a,b,this.J,e.C,e.Au)):c?this.j.connect(a,
b,this.J,c.sessionId,c.arrayId):this.j.connect(a,b,this.J)}};
g.k.disconnect=function(a){this.N=a||0;this.u.stop();kdb(this);this.j&&(3==this.j.getState()&&Ycb(this.j),this.j.disconnect());this.N=0};
g.k.sendMessage=function(a,b){a={_sc:a};b&&g.If(a,b);this.u.isActive()||2==(this.j?this.j.getState():0)?this.C.push(a):this.Rv()&&(kdb(this),Ucb(this.j,a))};
g.k.qM=function(){this.u.reset();this.I=null;this.D=0;if(this.C.length){var a=this.C;this.C=[];for(var b=0,c=a.length;b<c;++b)Ucb(this.j,a[b])}this.X("handlerOpened");mbb(this.Ha,"BROWSER_CHANNEL")};
g.k.oM=function(a){var b=2==a&&401==this.j.Nl;4==a||b||this.u.start();this.X("handlerError",a,b);sbb(this.va,"BROWSER_CHANNEL")};
g.k.vF=function(a,b){if(!this.u.isActive())this.X("handlerClosed");else if(b)for(var c=0,d=b.length;c<d;++c){var e=b[c].map;e&&this.C.push(e)}obb(this.qa,"BROWSER_CHANNEL");a&&this.Ua.j.yF("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",a.length);b&&this.Ya.j.yF("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",b.length)};
g.k.rM=function(){var a={v:2};this.V&&(a.gsessionid=this.V);0!=this.D&&(a.ui=""+this.D);0!=this.N&&(a.ui=""+this.N);this.I&&g.If(a,this.I);return a};
g.k.pM=function(a){"S"==a[0]?this.V=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),this.j.disconnect()):this.X("handlerMessage",new idb(a[0],a[1]));qbb(this.Ea,"BROWSER_CHANNEL")};
g.k.Rv=function(){return!!this.j&&3==this.j.getState()};
g.k.Oo=function(a){(this.J.loungeIdToken=a)||this.u.stop();if(this.Ra&&this.j){var b=this.j.Ml||{};a?b["X-YouTube-LoungeId-Token"]=a:delete b["X-YouTube-LoungeId-Token"];this.j.Ml=b}};
g.k.Ip=function(){return this.J.id};
g.k.Op=function(){return this.u.isActive()?this.u.u-Date.now():NaN};
g.k.xt=function(){var a=this.u;g.ao(a.j);a.start()};
g.k.S3=function(){this.u.isActive();0==Vcb(this.j)&&this.connect(this.I,this.D)};W8.prototype.C=function(a,b,c,d){b?a(d):a({text:c.responseText})};
W8.prototype.B=function(a,b){a(Error("Request error: "+b.status))};
W8.prototype.D=function(a){a(Error("request timed out"))};g.u(mdb,g.Uf);g.k=mdb.prototype;g.k.connect=function(a,b,c){this.Sc.connect(a,b,c)};
g.k.disconnect=function(a){this.Sc.disconnect(a)};
g.k.xt=function(){this.Sc.xt()};
g.k.Ip=function(){return this.Sc.Ip()};
g.k.Op=function(){return this.Sc.Op()};
g.k.Rv=function(){return this.Sc.Rv()};
g.k.NU=function(){this.dispatchEvent("channelOpened");var a=this.Sc,b=this.j;g.Pz("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!a.j.LE,sessionId:a.j.C,arrayId:a.j.Au});g.Pz("yt-remote-session-screen-id",b);a=f8();b=g8();g.Wb(a,b)||a.push(b);Qab(a);Sab()};
g.k.LU=function(){this.dispatchEvent("channelClosed")};
g.k.MU=function(a){this.dispatchEvent(new gdb(a))};
g.k.onError=function(a){this.dispatchEvent(new hdb(a?1:0))};
g.k.sendMessage=function(a,b){this.Sc.sendMessage(a,b)};
g.k.Oo=function(a){this.Sc.Oo(a)};
g.k.dispose=function(){this.Sc.dispose()};g.k=ndb.prototype;
g.k.connect=function(a,b){a=void 0===a?{}:a;b=void 0===b?0:b;2!==this.I&&(this.B.stop(),this.N=a,this.J=b,pdb(this),(a=g.Q("ID_TOKEN"))?this.C["x-youtube-identity-token"]=a:delete this.C["x-youtube-identity-token"],this.j&&(this.u.device=this.j.device,this.u.name=this.j.name,this.u.app=this.j.app,this.u.id=this.j.id,this.j.XZ&&(this.u.mdxVersion=""+this.j.XZ),this.j.theme&&(this.u.theme=this.j.theme),this.j.capabilities&&(this.u.capabilities=this.j.capabilities)),0!==this.J?this.u.ui=""+this.J:delete this.u.ui,
Object.assign(this.u,this.N),this.channel=new F8(this.pathPrefix,{lZ:"gsessionid",a_:this.C,b_:this.u}),this.channel.open(),this.I=2,odb(this))};
g.k.disconnect=function(a){this.V=void 0===a?0:a;this.B.stop();pdb(this);this.channel&&(0!==this.V?this.u.ui=""+this.V:delete this.u.ui,this.channel.close());this.V=0};
g.k.Op=function(){return this.B.isActive()?this.B.u-Date.now():NaN};
g.k.xt=function(){var a=this.B;g.ao(a.j);a.start()};
g.k.sendMessage=function(a,b){this.channel&&(pdb(this),a=Object.assign({},{_sc:a},b),this.channel.send(a))};
g.k.Oo=function(a){a||this.B.stop();a?this.C["X-YouTube-LoungeId-Token"]=a:delete this.C["X-YouTube-LoungeId-Token"]};
g.k.Ip=function(){return this.j?this.j.id:""};
g.k.X=function(a){return this.D.X.apply(this.D,[a].concat(g.t(g.za.apply(1,arguments))))};
g.k.subscribe=function(a,b,c){return this.D.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.D.unsubscribe(a,b,c)};
g.k.Kg=function(a){return this.D.Kg(a)};
g.k.dispose=function(){this.W||(this.W=!0,g.af(this.D),this.disconnect(),g.af(this.B),this.ra=function(){return""})};
g.k.isDisposed=function(){return this.W};g.u(qdb,g.Uf);g.k=qdb.prototype;g.k.connect=function(a,b){this.j.connect(a,b)};
g.k.disconnect=function(a){this.j.disconnect(a)};
g.k.xt=function(){this.j.xt()};
g.k.Ip=function(){return this.j.Ip()};
g.k.Op=function(){return this.j.Op()};
g.k.Rv=function(){return 3===this.j.I};
g.k.QU=function(){this.dispatchEvent("channelOpened")};
g.k.OU=function(){this.dispatchEvent("channelClosed")};
g.k.PU=function(a){this.dispatchEvent(new gdb(a))};
g.k.onError=function(){this.dispatchEvent(new hdb(401===this.j.Fg?1:0))};
g.k.sendMessage=function(a,b){this.j.sendMessage(a,b)};
g.k.Oo=function(a){this.j.Oo(a)};
g.k.dispose=function(){this.j.dispose()};var ydb=Date.now(),Y8=null,b9=Array(50),a9=-1,c9=!1;g.Xa(d9,g.cz);d9.prototype.ij=function(){return this.screens};
d9.prototype.contains=function(a){return!!Nab(this.screens,a)};
d9.prototype.get=function(a){return a?e8(this.screens,a):null};
d9.prototype.info=function(a){Z8(this.I,a)};g.u(Cdb,g.cz);g.k=Cdb.prototype;g.k.start=function(){!this.j&&isNaN(this.qc)&&this.HR()};
g.k.stop=function(){this.j&&(this.j.abort(),this.j=null);isNaN(this.qc)||(g.zu(this.qc),this.qc=NaN)};
g.k.ea=function(){this.stop();g.cz.prototype.ea.call(this)};
g.k.HR=function(){this.qc=NaN;this.j=g.Cu(X8(this.B,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.J},timeout:5E3,onSuccess:(0,g.Ta)(this.SU,this),onError:(0,g.Ta)(this.RU,this),onTimeout:(0,g.Ta)(this.TU,this)})};
g.k.SU=function(a,b){this.j=null;a=b.screen||{};a.dialId=this.C;a.name=this.I;b=-1;this.D&&a.shortLivedLoungeToken&&a.shortLivedLoungeToken.value&&a.shortLivedLoungeToken.refreshIntervalMs&&(a.screenIdType="shortLived",a.loungeToken=a.shortLivedLoungeToken.value,b=a.shortLivedLoungeToken.refreshIntervalMs);this.X("pairingComplete",new b8(a),b)};
g.k.RU=function(a){this.j=null;a.status&&404==a.status?this.u>=Mfb.length?this.X("pairingFailed",Error("DIAL polling timed out")):(a=Mfb[this.u],this.qc=g.xu((0,g.Ta)(this.HR,this),a),this.u++):this.X("pairingFailed",Error("Server error "+a.status))};
g.k.TU=function(){this.j=null;this.X("pairingFailed",Error("Server not responding"))};
var Mfb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Xa(f9,d9);g.k=f9.prototype;g.k.start=function(){e9(this)&&this.X("screenChange");!g.Qz("yt-remote-lounge-token-expiration")&&Ddb(this);g.zu(this.j);this.j=g.xu((0,g.Ta)(this.start,this),1E4)};
g.k.add=function(a,b){e9(this);zdb(this,a);g9(this,!1);this.X("screenChange");b(a);a.token||Ddb(this)};
g.k.remove=function(a,b){var c=e9(this);Bdb(this,a)&&(g9(this,!1),c=!0);b(a);c&&this.X("screenChange")};
g.k.JE=function(a,b,c,d){var e=e9(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,g9(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.X("screenChange")};
g.k.ea=function(){g.zu(this.j);f9.Le.ea.call(this)};
g.k.KY=function(a){e9(this);var b=this.screens.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)}g9(this,!b);b&&Z8(this.I,"Missed "+b+" lounge tokens.")};
g.k.JY=function(a){Z8(this.I,"Requesting lounge tokens failed: "+a)};g.u(Fdb,g.cz);g.k=Fdb.prototype;g.k.start=function(){var a=parseInt(g.Qz("yt-remote-fast-check-period")||"0",10);(this.C=g.Wa()-144E5<a?0:a)?h9(this):(this.C=g.Wa()+3E5,g.Pz("yt-remote-fast-check-period",this.C),this.lK())};
g.k.isEmpty=function(){return g.Cf(this.j)};
g.k.update=function(){Edb("Updating availability on schedule.");var a=this.I(),b=g.pf(this.j,function(c,d){return c&&!!e8(a,d)},this);
Idb(this,b)};
g.k.ea=function(){g.zu(this.B);this.B=NaN;this.u&&(this.u.abort(),this.u=null);g.cz.prototype.ea.call(this)};
g.k.lK=function(){g.zu(this.B);this.B=NaN;this.u&&this.u.abort();var a=Jdb(this);if(Aab(a)){var b=X8(this.D,"/pairing/get_screen_availability");this.u=ldb(this.D,b,{lounge_token:g.uf(a).join(",")},(0,g.Ta)(this.Y1,this,a),(0,g.Ta)(this.X1,this))}else Idb(this,{}),h9(this)};
g.k.Y1=function(a,b){this.u=null;var c=g.uf(Jdb(this));if(g.qc(c,g.uf(a))){b=b.screens||[];c={};for(var d=0,e=b.length;d<e;++d)c[a[b[d].loungeToken]]="online"==b[d].status;Idb(this,c);h9(this)}else this.Ze("Changing Screen set during request."),this.lK()};
g.k.X1=function(a){this.Ze("Screen availability failed: "+a);this.u=null;h9(this)};
g.k.Ze=function(a){Z8("OnlineScreenService",a)};g.Xa(i9,d9);g.k=i9.prototype;g.k.start=function(){this.u.start();this.j.start();this.screens.length&&(this.X("screenChange"),this.j.isEmpty()||this.X("onlineScreenChange"))};
g.k.add=function(a,b,c){this.u.add(a,b,c)};
g.k.remove=function(a,b,c){this.u.remove(a,b,c);this.j.update()};
g.k.JE=function(a,b,c,d){this.u.contains(a)?this.u.JE(a,b,c,d):(a="Updating name of unknown screen: "+a.name,Z8(this.I,a),d(Error(a)))};
g.k.ij=function(a){return a?this.screens:g.ac(this.screens,g.wm(this.B,function(b){return!this.contains(b)},this))};
g.k.sM=function(){return g.wm(this.ij(!0),function(a){return!!this.j.j[a.id]},this)};
g.k.tM=function(a,b,c,d,e,f){var h=this;this.info("getDialScreenByPairingCode "+a+" / "+b);var l=new Cdb(this.C,a,b,c,d);l.subscribe("pairingComplete",function(m,n){g.af(l);e(j9(h,m),n)});
l.subscribe("pairingFailed",function(m){g.af(l);f(m)});
l.start();return(0,g.Ta)(l.stop,l)};
g.k.UU=function(a,b,c,d){g.Cu(X8(this.C,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:a},timeout:5E3,onSuccess:(0,g.Ta)(function(e,f){e=new b8(f.screen||{});if(!e.name||Ndb(this,e.name)){a:{f=e.name;for(var h=2,l=b(f,h);Ndb(this,l);){h++;if(20<h)break a;l=b(f,h)}f=l}e.name=f}c(j9(this,e))},this),
onError:(0,g.Ta)(function(e){d(Error("pairing request failed: "+e.status))},this),
onTimeout:(0,g.Ta)(function(){d(Error("pairing request timed out."))},this)})};
g.k.ea=function(){g.af(this.u);g.af(this.j);i9.Le.ea.call(this)};
g.k.UY=function(){Pdb(this);this.X("screenChange");this.j.update()};
i9.prototype.dispose=i9.prototype.dispose;g.Xa(k9,g.cz);g.k=k9.prototype;g.k.getScreen=function(){return this.C};
g.k.Sh=function(a){this.isDisposed()||(a&&(m9(this,""+a),this.X("sessionFailed")),this.C=null,this.X("sessionScreen",null))};
g.k.info=function(a){Z8(this.va,a)};
g.k.uM=function(){return null};
g.k.DK=function(a){var b=this.j;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.Ta)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.Ta)(function(){m9(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.k.ea=function(){this.DK("");k9.Le.ea.call(this)};g.u(n9,k9);g.k=n9.prototype;g.k.CK=function(a){if(this.u){if(this.u==a)return;m9(this,"Overriding cast session with new session object");aeb(this);this.ra=!1;this.V="unknown";this.u.removeUpdateListener(this.Y);this.u.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qa)}this.u=a;this.u.addUpdateListener(this.Y);this.u.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.qa);Wdb(this,"getMdxSessionStatus")};
g.k.Zv=function(a){this.info("launchWithParams no-op for Cast: "+g.fi(a))};
g.k.stop=function(){this.u?this.u.stop((0,g.Ta)(function(){this.Sh()},this),(0,g.Ta)(function(){this.Sh(Error("Failed to stop receiver app."))},this)):this.Sh(Error("Stopping cast device without session."))};
g.k.DK=function(){};
g.k.ea=function(){this.info("disposeInternal");aeb(this);this.u&&(this.u.removeUpdateListener(this.Y),this.u.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qa));this.u=null;k9.prototype.ea.call(this)};
g.k.S2=function(a,b){if(!this.isDisposed())if(b)if(b=Z7(b),g.Pa(b))switch(a=""+b.type,b=b.data||{},this.info("onYoutubeMessage_: "+a+" "+g.fi(b)),a){case "mdxSessionStatus":Tdb(this,b);break;case "loungeToken":Xdb(this,b);break;default:m9(this,"Unknown youtube message: "+a)}else m9(this,"Unable to parse message.");else m9(this,"No data in message.")};
g.k.ZO=function(a,b,c,d){g.zu(this.N);this.N=0;Mdb(this.B,this.j.label,a,this.j.friendlyName,(0,g.Ta)(function(e){e?b(e):0<=d?(m9(this,"Screen "+a+" appears to be offline. "+d+" retries left."),this.N=g.xu((0,g.Ta)(this.ZO,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.k.uM=function(){return this.u};
g.k.VU=function(a){this.isDisposed()||a||(m9(this,"Cast session died."),this.Sh())};g.u(o9,k9);g.k=o9.prototype;g.k.CK=function(a){this.u=a;this.u.addUpdateListener(this.Ea)};
g.k.Zv=function(a){this.Ha=a;this.W()};
g.k.stop=function(){ieb(this);this.u?this.u.stop((0,g.Ta)(this.Sh,this,null),(0,g.Ta)(this.Sh,this,"Failed to stop DIAL device.")):this.Sh()};
g.k.ea=function(){ieb(this);this.u&&this.u.removeUpdateListener(this.Ea);this.u=null;k9.prototype.ea.call(this)};
g.k.WU=function(a){this.isDisposed()||a||(m9(this,"DIAL session died."),this.D(),this.D=function(){},this.Sh())};g.u(r9,k9);r9.prototype.stop=function(){this.Sh()};
r9.prototype.CK=function(){};
r9.prototype.Zv=function(){g.zu(this.u);this.u=NaN;var a=e8(this.B.ij(),this.j.label);a?l9(this,a):this.Sh(Error("No such screen"))};
r9.prototype.ea=function(){g.zu(this.u);this.u=NaN;k9.prototype.ea.call(this)};g.u(s9,g.cz);g.k=s9.prototype;
g.k.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.N,[chrome.cast.Capability.AUDIO_OUT]);this.V||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.I?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var e=(0,g.Ta)(this.J1,this);c=new chrome.cast.ApiConfig(c,(0,g.Ta)(this.oR,this),e,d,a);c.customDialLaunchCallback=(0,g.Ta)(this.x0,this);
chrome.cast.initialize(c,(0,g.Ta)(function(){this.isDisposed()||(chrome.cast.addReceiverActionListener(this.D),vdb(),this.u.subscribe("onlineScreenChange",(0,g.Ta)(this.vM,this)),this.B=leb(this),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.Ta)(function(f){this.Ze("Failed to set initial custom receivers: "+g.fi(f))},this)),this.X("yt-remote-cast2-availability-change",u9(this)),b(!0))},this),(0,g.Ta)(function(f){this.Ze("Failed to initialize API: "+g.fi(f));
b(!1)},this))};
g.k.e4=function(a,b){t9("Setting connected screen ID: "+a+" -> "+b);if(this.j){var c=this.j.getScreen();if(!a||c&&c.id!=a)t9("Unsetting old screen status: "+this.j.j.friendlyName),v9(this,null)}if(a&&b){if(!this.j){c=e8(this.u.ij(),a);if(!c){t9("setConnectedScreenStatus: Unknown screen.");return}if("shortLived"==c.idType){t9("setConnectedScreenStatus: Screen with id type to be short lived.");return}a=jeb(this,c);a||(t9("setConnectedScreenStatus: Connected receiver not custom..."),a=new chrome.cast.Receiver(c.uuid?
c.uuid:c.id,c.name),a.receiverType=chrome.cast.ReceiverType.CUSTOM,this.B.push(a),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.Ta)(function(d){this.Ze("Failed to set initial custom receivers: "+g.fi(d))},this)));
t9("setConnectedScreenStatus: new active receiver: "+a.friendlyName);v9(this,new r9(this.u,a),!0)}this.j.DK(b)}else t9("setConnectedScreenStatus: no screen.")};
g.k.f4=function(a){this.isDisposed()?this.Ze("Setting connection data on disposed cast v2"):this.j?this.j.Zv(a):this.Ze("Setting connection data without a session")};
g.k.YU=function(){this.isDisposed()?this.Ze("Stopping session on disposed cast v2"):this.j?(this.j.stop(),v9(this,null)):t9("Stopping non-existing session")};
g.k.requestSession=function(){chrome.cast.requestSession((0,g.Ta)(this.oR,this),(0,g.Ta)(this.d2,this))};
g.k.ea=function(){this.u.unsubscribe("onlineScreenChange",(0,g.Ta)(this.vM,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.D);var a=sdb,b=g.Ha("yt.mdx.remote.debug.handlers_");g.Zb(b||[],a);g.af(this.j);g.cz.prototype.ea.call(this)};
g.k.Ze=function(a){Z8("Controller",a)};
g.k.qR=function(a,b){this.j==a&&(b||v9(this,null),this.X("yt-remote-cast2-session-change",b))};
g.k.G1=function(a,b){if(!this.isDisposed())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),t9("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.j.label!=a.label)t9("onReceiverAction_: Stopping active receiver: "+this.j.j.friendlyName),this.j.stop();else{t9("onReceiverAction_: Casting to active receiver.");this.j.getScreen()&&this.X("yt-remote-cast2-session-change",this.j.getScreen());break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:v9(this,
new r9(this.u,a));break;case chrome.cast.ReceiverType.DIAL:v9(this,new o9(this.u,a,this.C,this.config_));break;case chrome.cast.ReceiverType.CAST:v9(this,new n9(this.u,a,this.config_));break;default:this.Ze("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.j.label==a.label?this.j.stop():this.Ze("Stopping receiver w/o session: "+a.friendlyName)}else this.Ze("onReceiverAction_ called without receiver.")};
g.k.x0=function(a){if(this.isDisposed())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Ze("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.j:null;if(!c||c.label!=b.label)return this.Ze("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.j.getScreen())return t9("Reselecting dial screen."),
this.X("yt-remote-cast2-session-change",this.j.getScreen()),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Ze('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);v9(this,new o9(this.u,b,this.C,this.config_))}b=this.j;b.N=a;b.N.appState==chrome.cast.DialAppState.RUNNING?(a=b.N.extraData||{},c=a.screenId||null,p9(b)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=feb(b,{name:b.j.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.N.receiver.label,
screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.gu(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=geb(b,c)):a=geb(b,c)):a=deb(b);return a};
g.k.oR=function(a){var b=this;if(!this.isDisposed()&&!this.I){t9("New cast session ID: "+a.sessionId);var c=a.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(c.receiverType==chrome.cast.ReceiverType.CAST)t9("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),v9(this,new n9(this.u,c,this.config_),!0);else{this.Ze("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.j,e=e8(this.u.ij(),
d.label);e&&c8(e,c.label)&&d.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(t9("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.af(this.j),this.j=new n9(this.u,c,this.config_),this.j.subscribe("sessionScreen",(0,g.Ta)(this.qR,this,this.j)),this.j.subscribe("sessionFailed",function(){return keb(b,b.j)}),this.j.Zv(null));
this.j.CK(a)}}};
g.k.XU=function(){return this.j?this.j.uM():null};
g.k.d2=function(a){this.isDisposed()||(this.Ze("Failed to estabilish a session: "+g.fi(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&v9(this,null),this.X("yt-remote-cast2-session-failed"))};
g.k.J1=function(a){t9("Receiver availability updated: "+a);if(!this.isDisposed()){var b=u9(this);this.J=a==chrome.cast.ReceiverAvailability.AVAILABLE;u9(this)!=b&&this.X("yt-remote-cast2-availability-change",u9(this))}};
g.k.vM=function(){this.isDisposed()||(this.B=leb(this),t9("Updating custom receivers: "+g.fi(this.B)),chrome.cast.setCustomReceivers(this.B,function(){},(0,g.Ta)(function(){this.Ze("Failed to set custom receivers.")},this)),this.X("yt-remote-cast2-availability-change",u9(this)))};
s9.prototype.setLaunchParams=s9.prototype.f4;s9.prototype.setConnectedScreenStatus=s9.prototype.e4;s9.prototype.stopSession=s9.prototype.YU;s9.prototype.getCastSession=s9.prototype.XU;s9.prototype.requestSession=s9.prototype.requestSession;s9.prototype.init=s9.prototype.init;s9.prototype.dispose=s9.prototype.dispose;var ueb=[];g.k=C9.prototype;
g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";Aeb(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.trackData=a.trackData,this.Lm=a.hasPrevious,this.hasNext=a.hasNext,this.J=a.playerTime,this.I=a.playerTimeAt,this.C=a.seekableStart,this.j=a.seekableEnd,this.D=a.duration,this.N=a.loadedTime,this.B=a.liveIngestionTime,this.u=
!isNaN(this.B))};
g.k.Oc=function(){return 1==this.playerState};
g.k.isAdPlaying=function(){return 1081==this.playerState};
g.k.wj=function(a){this.D=isNaN(a)?0:a};
g.k.getDuration=function(){return this.u?this.D+D9(this):this.D};
g.k.clone=function(){return new C9(Beb(this))};g.u(I9,g.cz);g.k=I9.prototype;g.k.getState=function(){return this.B};
g.k.Op=function(){return this.C.getReconnectTimeout()};
g.k.xt=function(){this.C.reconnect()};
g.k.play=function(){K9(this)?(this.j?this.j.play(null,g.Yf,O9(this,"play")):N9(this,"play"),Eeb(this,1,F9(J9(this))),this.X("remotePlayerChange")):L9(this,this.play)};
g.k.pause=function(){K9(this)?(this.j?this.j.pause(null,g.Yf,O9(this,"pause")):N9(this,"pause"),Eeb(this,2,F9(J9(this))),this.X("remotePlayerChange")):L9(this,this.pause)};
g.k.seekTo=function(a){if(K9(this)){if(this.j){var b=J9(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.Oc()||3==b.playerState?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(c,g.Yf,O9(this,"seekTo",{newTime:a}))}else N9(this,"seekTo",{newTime:a});Eeb(this,3,a);this.X("remotePlayerChange")}else L9(this,g.Va(this.seekTo,a))};
g.k.stop=function(){if(K9(this)){this.j?this.j.stop(null,g.Yf,O9(this,"stopVideo")):N9(this,"stopVideo");var a=J9(this);a.index=-1;a.videoId="";Aeb(a);M9(this,a);this.X("remotePlayerChange")}else L9(this,this.stop)};
g.k.setVolume=function(a,b){if(K9(this)){var c=J9(this);if(this.u){if(c.volume!=a){var d=Math.round(a)/100;this.u.setReceiverVolumeLevel(d,(0,g.Ta)(function(){$8("set receiver volume: "+d)},this),(0,g.Ta)(function(){this.Ze("failed to set receiver volume.")},this))}c.muted!=b&&this.u.setReceiverMuted(b,(0,g.Ta)(function(){$8("set receiver muted: "+b)},this),(0,g.Ta)(function(){this.Ze("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);N9(this,"setVolume",e)}c.muted=b;c.volume=a;M9(this,c)}else L9(this,g.Va(this.setVolume,a,b))};
g.k.wM=function(a,b){if(K9(this)){var c=J9(this);a={videoId:a};b&&(c.trackData={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},a.style=g.fi(b.style),g.If(a,c.trackData));N9(this,"setSubtitlesTrack",a);M9(this,c)}else L9(this,g.Va(this.wM,a,b))};
g.k.setAudioTrack=function(a,b){K9(this)?(b=b.getLanguageInfo().getId(),N9(this,"setAudioTrack",{videoId:a,audioTrackId:b}),a=J9(this),a.audioTrackId=b,M9(this,a)):L9(this,g.Va(this.setAudioTrack,a,b))};
g.k.playVideo=function(a,b,c,d,e,f,h){d=void 0===d?null:d;e=void 0===e?null:e;f=void 0===f?null:f;h=void 0===h?null:h;var l=J9(this),m={videoId:a};void 0!==c&&(m.currentIndex=c);G9(l,a,c||0);void 0!==b&&(E9(l,b),m.currentTime=b);d&&(m.listId=d);e&&(m.playerParams=e);f&&(m.clickTrackingParams=f);h&&(m.locationInfo=g.fi(h));N9(this,"setPlaylist",m);d||M9(this,l)};
g.k.QD=function(a,b){if(K9(this)){if(a&&b){var c=J9(this);G9(c,a,b);M9(this,c)}N9(this,"previous")}else L9(this,g.Va(this.QD,a,b))};
g.k.nextVideo=function(a,b){if(K9(this)){if(a&&b){var c=J9(this);G9(c,a,b);M9(this,c)}N9(this,"next")}else L9(this,g.Va(this.nextVideo,a,b))};
g.k.bv=function(){if(K9(this)){N9(this,"clearPlaylist");var a=J9(this);a.reset();M9(this,a);this.X("remotePlayerChange")}else L9(this,this.bv)};
g.k.uO=function(){K9(this)?N9(this,"dismissAutoplay"):L9(this,this.uO)};
g.k.dispose=function(){if(3!=this.B){var a=this.B;this.B=3;this.X("proxyStateChange",a,this.B)}g.cz.prototype.dispose.call(this)};
g.k.ea=function(){Deb(this);this.C=null;this.D.clear();H9(this,null);g.cz.prototype.ea.call(this)};
g.k.FK=function(a){if((a!=this.B||2==a)&&3!=this.B&&0!=a){var b=this.B;this.B=a;this.X("proxyStateChange",b,a);if(1==a)for(;!this.D.isEmpty();)b=a=this.D,0===b.j.length&&(b.j=b.u,b.j.reverse(),b.u=[]),a.j.pop().apply(this);else 3==a&&this.dispose()}};
g.k.E1=function(a,b){this.X(a,b)};
g.k.j0=function(a){if(!a)this.Lz(null),H9(this,null);else if(this.u.receiver.volume){a=this.u.receiver.volume;var b=J9(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)$8("Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,M9(this,b)}};
g.k.Lz=function(a){$8("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.N);if(this.j=a)this.j.addUpdateListener(this.N),Feb(this),this.X("remotePlayerChange")};
g.k.h0=function(a){a?(Feb(this),this.X("remotePlayerChange")):this.Lz(null)};
g.k.dL=function(){N9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.k.m0=function(){var a=xeb();a&&H9(this,a)};
g.k.Ze=function(a){Z8("CP",a)};g.u(R9,g.cz);g.k=R9.prototype;
g.k.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.videoIds,f=b.playerParams,h=b.clickTrackingParams,l=b.index,m={videoId:d},n=b.currentTime,p=b.locationInfo;b=b.loopMode;void 0!==n&&(m.currentTime=5>=n?0:n);f&&(m.playerParams=f);p&&(m.locationInfo=p);h&&(m.clickTrackingParams=h);c&&(m.listId=c);e&&0<e.length&&(m.videoIds=e.join(","));void 0!==l&&(m.currentIndex=l);this.Ea&&(m.loopMode=b||"LOOP_MODE_OFF");c&&(this.j.listId=c);this.j.videoId=d;this.j.index=l||0;this.j.state=3;E9(this.j,
n);this.D="UNSUPPORTED";c=this.Ea?"setInitialState":"setPlaylist";P9("Connecting with "+c+" and params: "+g.fi(m));this.u.connect({method:c,params:g.fi(m)},a,Uab())}else P9("Connecting without params"),this.u.connect({},a,Uab());Jeb(this)};
g.k.Oo=function(a){this.u.Oo(a)};
g.k.dispose=function(){this.isDisposed()||(g.Fa("yt.mdx.remote.remoteClient_",null),this.X("beforeDispose"),Q9(this,3));g.cz.prototype.dispose.call(this)};
g.k.ea=function(){Keb(this);Meb(this);Leb(this);g.zu(this.N);this.N=NaN;g.zu(this.V);this.V=NaN;this.C=null;g.Bx(this.W);this.W.length=0;this.u.dispose();g.cz.prototype.ea.call(this);this.D=this.J=this.B=this.j=this.u=null};
g.k.KP=function(a){if(!this.B||0===this.B.length)return!1;for(var b=g.r(this.B),c=b.next();!c.done;c=b.next())if(!c.value.capabilities.has(a))return!1;return!0};
g.k.BY=function(){var a=3;this.isDisposed()||(a=0,isNaN(this.Oy())?this.u.Rv()&&isNaN(this.I)&&(a=1):a=2);return a};
g.k.wv=function(a){P9("Disconnecting with "+a);g.Fa("yt.mdx.remote.remoteClient_",null);Keb(this);this.X("beforeDisconnect",a);1==a&&h8();this.u.disconnect(a);this.dispose()};
g.k.zY=function(){var a=this.j;this.C&&(a=this.j.clone(),G9(a,this.C,a.index));return Beb(a)};
g.k.g4=function(a){var b=this,c=new C9(a);c.videoId&&c.videoId!=this.j.videoId&&(this.C=c.videoId,g.zu(this.N),this.N=g.xu(function(){if(b.C){var e=b.C;b.C=null;b.j.videoId!=e&&S9(b,"getNowPlaying")}},5E3));
var d=[];this.j.listId==c.listId&&this.j.videoId==c.videoId&&this.j.index==c.index||d.push("remoteQueueChange");this.j.playerState==c.playerState&&this.j.volume==c.volume&&this.j.muted==c.muted&&F9(this.j)==F9(c)&&g.fi(this.j.trackData)==g.fi(c.trackData)||d.push("remotePlayerChange");this.j.reset(a);g.tc(d,function(e){this.X(e)},this)};
g.k.YO=function(){var a=this.u.Ip(),b=g.Ub(this.B,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.k.Oy=function(){return this.u.Op()};
g.k.wY=function(){return this.D||"UNSUPPORTED"};
g.k.xY=function(){return this.J||""};
g.k.ZU=function(){!isNaN(this.Oy())&&this.u.xt()};
g.k.b4=function(a,b){S9(this,a,b);Oeb(this)};
g.k.xM=function(){var a=g.Mu("SID","")||"",b=g.Mu("SAPISID","")||"",c=g.Mu("__Secure-3PAPISID","")||"";if(!a&&!b&&!c)return"";a=g.Bc(g.db(a),2);b=g.Bc(g.db(b),2);c=g.Bc(g.db(c),2);return g.Bc(g.db(a+","+b+","+c),2)};
R9.prototype.subscribe=R9.prototype.subscribe;R9.prototype.unsubscribeByKey=R9.prototype.Kg;R9.prototype.getProxyState=R9.prototype.BY;R9.prototype.disconnect=R9.prototype.wv;R9.prototype.getPlayerContextData=R9.prototype.zY;R9.prototype.setPlayerContextData=R9.prototype.g4;R9.prototype.getOtherConnectedRemoteId=R9.prototype.YO;R9.prototype.getReconnectTimeout=R9.prototype.Oy;R9.prototype.getAutoplayMode=R9.prototype.wY;R9.prototype.getAutoplayVideoId=R9.prototype.xY;R9.prototype.reconnect=R9.prototype.ZU;
R9.prototype.sendMessage=R9.prototype.b4;R9.prototype.getXsrfToken=R9.prototype.xM;R9.prototype.isCapabilitySupportedOnConnectedDevices=R9.prototype.KP;g.u($eb,d9);g.k=$eb.prototype;g.k.ij=function(a){return this.Pf.$_gs(a)};
g.k.contains=function(a){return!!this.Pf.$_c(a)};
g.k.get=function(a){return this.Pf.$_g(a)};
g.k.start=function(){this.Pf.$_st()};
g.k.add=function(a,b,c){this.Pf.$_a(a,b,c)};
g.k.remove=function(a,b,c){this.Pf.$_r(a,b,c)};
g.k.JE=function(a,b,c,d){this.Pf.$_un(a,b,c,d)};
g.k.ea=function(){for(var a=0,b=this.j.length;a<b;++a)this.Pf.$_ubk(this.j[a]);this.j.length=0;this.Pf=null;d9.prototype.ea.call(this)};
g.k.aV=function(){this.X("screenChange")};
g.k.g1=function(){this.X("onlineScreenChange")};
i9.prototype.$_st=i9.prototype.start;i9.prototype.$_gspc=i9.prototype.UU;i9.prototype.$_gsppc=i9.prototype.tM;i9.prototype.$_c=i9.prototype.contains;i9.prototype.$_g=i9.prototype.get;i9.prototype.$_a=i9.prototype.add;i9.prototype.$_un=i9.prototype.JE;i9.prototype.$_r=i9.prototype.remove;i9.prototype.$_gs=i9.prototype.ij;i9.prototype.$_gos=i9.prototype.sM;i9.prototype.$_s=i9.prototype.subscribe;i9.prototype.$_ubk=i9.prototype.Kg;var c$=null,f$=!1,T9=null,U9=null,kfb=null,Y9=[];g.u(pfb,g.K);g.k=pfb.prototype;g.k.ea=function(){g.K.prototype.ea.call(this);this.u.stop();this.B.stop();this.N.stop();var a=this.jc;a.unsubscribe("proxyStateChange",this.nR,this);a.unsubscribe("remotePlayerChange",this.Qz,this);a.unsubscribe("remoteQueueChange",this.BD,this);a.unsubscribe("previousNextChange",this.kR,this);a.unsubscribe("nowAutoplaying",this.eR,this);a.unsubscribe("autoplayDismissed",this.IQ,this);this.jc=this.j=null};
g.k.Tj=function(a){var b=g.za.apply(1,arguments);if(2!=this.jc.B)if(g$(this)){if(!J9(this.jc).isAdPlaying()||"control_seek"!==a)switch(a){case "control_toggle_play_pause":J9(this.jc).Oc()?this.jc.pause():this.jc.play();break;case "control_play":this.jc.play();break;case "control_pause":this.jc.pause();break;case "control_seek":this.J.oF(b[0],b[1]);break;case "control_subtitles_set_track":rfb(this,b[0]);break;case "control_set_audio_track":this.setAudioTrack(b[0])}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":b=
this.G.getCurrentTime();h$(this,0===b?void 0:b);break;case "control_seek":h$(this,b[0]);break;case "control_subtitles_set_track":rfb(this,b[0]);break;case "control_set_audio_track":this.setAudioTrack(b[0])}};
g.k.f0=function(a){this.N.zU(a)};
g.k.C5=function(a){this.Tj("control_subtitles_set_track",g.Cf(a)?null:a)};
g.k.KS=function(){var a=this.G.getOption("captions","track");g.Cf(a)||rfb(this,a)};
g.k.Wb=function(a){this.j.Wb(a,this.G.getVideoData().lengthSeconds)};
g.k.P0=function(){g.Cf(this.C)||sfb(this,this.C);this.D=!1};
g.k.nR=function(a,b){this.B.stop();2===b&&this.CS()};
g.k.Qz=function(){if(g$(this)){this.u.stop();var a=J9(this.jc);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.j.Eg=1;break;case 1082:case 1083:this.j.Eg=0;break;default:this.j.Eg=-1}switch(a.playerState){case 1081:case 1:this.Sb(new g.$J(8));this.BS();break;case 1085:case 3:this.Sb(new g.$J(9));break;case 1083:case 0:this.Sb(new g.$J(2));this.J.stop();this.Wb(this.G.getVideoData().lengthSeconds);break;case 1084:this.Sb(new g.$J(4));break;case 2:this.Sb(new g.$J(4));this.Wb(F9(a));
break;case -1:this.Sb(new g.$J(64));break;case -1E3:this.Sb(new g.$J(128,{errorCode:"mdx.remoteerror",errorMessage:"This video is not available for remote playback.",bC:2}))}a=J9(this.jc).trackData;var b=this.C;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.C=a,sfb(this,a));a=J9(this.jc);-1===a.volume||Math.round(this.G.getVolume())===a.volume&&this.G.isMuted()===a.muted||this.V.isActive()||this.oT()}else qfb(this)};
g.k.kR=function(){this.G.X("mdxpreviousnextchange")};
g.k.BD=function(){g$(this)||qfb(this)};
g.k.eR=function(a){isNaN(a)||this.G.X("mdxnowautoplaying",a)};
g.k.IQ=function(){this.G.X("mdxautoplaycanceled")};
g.k.setAudioTrack=function(a){g$(this)&&this.jc.setAudioTrack(this.G.getVideoData(1).videoId,a)};
g.k.seekTo=function(a,b){-1===J9(this.jc).playerState?h$(this,a):b&&this.jc.seekTo(a)};
g.k.oT=function(){var a=this;if(g$(this)){var b=J9(this.jc);this.events.uc(this.W);b.muted?this.G.mute():this.G.unMute();this.G.setVolume(b.volume);this.W=this.events.P(this.G,"onVolumeChange",function(c){nfb(a,c)})}};
g.k.BS=function(){this.u.stop();if(!this.jc.isDisposed()){var a=J9(this.jc);a.Oc()&&this.Sb(new g.$J(8));this.Wb(F9(a));this.u.start()}};
g.k.CS=function(){this.B.stop();this.u.stop();var a=this.jc.Op();2==this.jc.B&&!isNaN(a)&&this.B.start()};
g.k.Sb=function(a){this.B.stop();var b=this.I;if(!g.eK(b,a)){var c=g.W(a,2);c!==g.W(this.I,2)&&this.G.Jw(c);this.I=a;ufb(this.j,b,a)}};g.u(i$,g.X);i$.prototype.od=function(){this.j.show()};
i$.prototype.Ib=function(){this.j.hide()};
i$.prototype.u=function(){$7("mdx-privacy-popup-cancel");this.Ib()};
i$.prototype.B=function(){$7("mdx-privacy-popup-confirm");this.Ib()};g.u(j$,g.X);j$.prototype.onStateChange=function(a){this.Qc(a.state)};
j$.prototype.Qc=function(a){if(3===this.api.getPresentingPlayerType()){var b={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};a=g.W(a,128)?g.HJ("Error on $RECEIVER_NAME",b):a.Oc()||g.W(a,4)?g.HJ("Playing on $RECEIVER_NAME",b):g.HJ("Connected to $RECEIVER_NAME",b);this.Ja("statustext",a);this.j.show()}else this.j.hide()};g.u(k$,g.gR);k$.prototype.D=function(){var a=this.G.getOption("remote","receivers");a&&1<a.length&&!this.G.getOption("remote","quickCast")?(this.yq=g.uc(a,this.j,this),g.hR(this,g.Pk(a,this.j)),a=this.G.getOption("remote","currentReceiver"),a=this.j(a),this.options[a]&&this.Hj(a),this.enable(!0)):this.enable(!1)};
k$.prototype.j=function(a){return a.key};
k$.prototype.Rk=function(a){return"cast-selector-receiver"===a?"Cast...":this.yq[a].name};
k$.prototype.Mg=function(a){g.gR.prototype.Mg.call(this,a);this.G.setOption("remote","currentReceiver",this.yq[a]);this.ib.Ib()};g.u(tfb,g.bO);g.k=tfb.prototype;
g.k.create=function(){var a=this.player.R(),b=g.SF(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.K("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.K("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.K("enable_cast_short_lived_lounge_token")};efb(b,a);this.subscriptions.push(g.Ux("yt-remote-before-disconnect",this.d0,this));this.subscriptions.push(g.Ux("yt-remote-connection-change",this.K1,this));this.subscriptions.push(g.Ux("yt-remote-receiver-availability-change",this.mR,
this));this.subscriptions.push(g.Ux("yt-remote-auto-connect",this.I1,this));this.subscriptions.push(g.Ux("yt-remote-receiver-resumed",this.H1,this));this.subscriptions.push(g.Ux("mdx-privacy-popup-confirm",this.s3,this));this.subscriptions.push(g.Ux("mdx-privacy-popup-cancel",this.r3,this));this.mR()};
g.k.load=function(){this.player.cancelPlayback();g.bO.prototype.load.call(this);this.Kj=new pfb(this,this.player,this.jc);var a=(a=mfb())?a.currentTime:0;var b=jfb()?new I9(b$(),void 0):null;0==a&&b&&(a=F9(J9(b)));0!==a&&this.Wb(a);ufb(this,this.Zd,this.Zd);this.player.pn(6)};
g.k.unload=function(){this.player.X("mdxautoplaycanceled");this.xp=this.Ym;g.bf(this.Kj,this.jc);this.jc=this.Kj=null;g.bO.prototype.unload.call(this);this.player.pn(5);l$(this)};
g.k.ea=function(){g.Vx(this.subscriptions);g.bO.prototype.ea.call(this)};
g.k.Zm=function(a){var b=g.za.apply(1,arguments);this.loaded&&this.Kj.Tj.apply(this.Kj,[a].concat(g.t(b)))};
g.k.getAdState=function(){return this.Eg};
g.k.Lm=function(){return this.jc?J9(this.jc).Lm:!1};
g.k.hasNext=function(){return this.jc?J9(this.jc).hasNext:!1};
g.k.Wb=function(a,b){this.VP=a||0;this.player.X("progresssync",a,b);this.player.Ka("onVideoProgress",a||0)};
g.k.getCurrentTime=function(){return this.VP};
g.k.getProgressState=function(){var a=J9(this.jc),b=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:this.player.R().K("web_player_mdx_allow_seeking_change_killswitch")?this.player.cg():!a.isAdPlaying()&&this.player.cg(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.u?a.B+D9(a):a.B,isAtLiveHead:1>=(a.u?a.j+D9(a):a.j)-this.getCurrentTime(),loaded:a.N,seekableEnd:a.u?a.j+D9(a):a.j,seekableStart:0<
a.C?a.C+D9(a):a.C}};
g.k.nextVideo=function(){this.jc&&this.jc.nextVideo()};
g.k.QD=function(){this.jc&&this.jc.QD()};
g.k.d0=function(a){1===a&&(this.WJ=this.jc?J9(this.jc):null)};
g.k.K1=function(){var a=jfb()?new I9(b$(),void 0):null;if(a){var b=this.xp;this.loaded&&this.unload();this.jc=a;this.WJ=null;b.key!==this.Ym.key&&(this.xp=b,this.load())}else g.af(this.jc),this.jc=null,this.loaded&&(this.unload(),(a=this.WJ)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,F9(a)));this.player.X("videodatachange","newdata",this.player.getVideoData(),3)};
g.k.mR=function(){var a=[this.Ym],b=a.concat,c=ffb();z9()&&g.Qz("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.yq=b.call(a,c);a=hfb()||this.Ym;m$(this,a);this.player.Ka("onMdxReceiversChange")};
g.k.I1=function(){var a=hfb();m$(this,a)};
g.k.H1=function(){this.xp=hfb()};
g.k.s3=function(){this.Yz=!0;l$(this);f$=!1;c$&&e$(c$,1);c$=null};
g.k.r3=function(){this.Yz=!1;l$(this);m$(this,this.Ym);this.xp=this.Ym;f$=!1;c$=null;this.player.playVideo()};
g.k.xg=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.yq;case "currentReceiver":return b&&("cast-selector-receiver"===b.key?yeb():m$(this,b)),this.loaded?this.xp:this.Ym;case "quickCast":return 2===this.yq.length&&"cast-selector-receiver"===this.yq[1].key?(b&&yeb(),!0):!1}};
g.k.dL=function(){this.jc.dL()};
g.k.xj=function(){return!1};
g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.aO("remote",tfb);})(_yt_player);
