(function(g){var window=this;'use strict';var b8=function(a){g.sq(a,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.kb()).toString(36));return a},c8=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
g.Kga(a.C,b,c)},UDb=function(a){if(a instanceof g.Ht)return a;
if(typeof a.tm=="function")return a.tm(!1);if(g.bb(a)){var b=0,c=new g.Ht;c.next=function(){for(;;){if(b>=a.length)return g.n2;if(b in a)return g.It(a[b++]);b++}};
return c}throw Error("Not implemented");},VDb=function(a,b,c){if(g.bb(a))g.Zb(a,b,c);
else for(a=UDb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},WDb=function(a,b){var c=[];
VDb(b,function(d){try{var e=g.ew.prototype.B.call(this,d,!0)}catch(f){if(f=="Storage: Invalid value was encountered")return;throw f;}e===void 0?c.push(d):g.Lla(e)&&c.push(d)},a);
return c},XDb=function(a,b){WDb(a,b).forEach(function(c){g.ew.prototype.remove.call(this,c)},a)},YDb=function(a){if(a.ra){if(a.ra.locationOverrideToken)return{locationOverrideToken:a.ra.locationOverrideToken};
if(a.ra.latitudeE7!=null&&a.ra.longitudeE7!=null)return{latitudeE7:a.ra.latitudeE7,longitudeE7:a.ra.longitudeE7}}return null},ZDb=function(a,b){g.Eb(a,b)||a.push(b)},$Db=function(a){var b=0,c;
for(c in a)b++;return b},aEb=function(a,b){return g.ed(a,b)},bEb=function(a){try{return g.Ua.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);},d8=function(a){if(g.Ua.JSON)try{return g.Ua.JSON.parse(a)}catch(b){}return bEb(a)},cEb=function(a){if(a.Lm&&typeof a.Lm=="function")return a.Lm();
if(typeof Map!=="undefined"&&a instanceof Map||typeof Set!=="undefined"&&a instanceof Set)return Array.from(a.values());if(typeof a==="string")return a.split("");if(g.bb(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Zc(a)},dEb=function(a){if(a.Yn&&typeof a.Yn=="function")return a.Yn();
if(!a.Lm||typeof a.Lm!="function"){if(typeof Map!=="undefined"&&a instanceof Map)return Array.from(a.keys());if(!(typeof Set!=="undefined"&&a instanceof Set)){if(g.bb(a)||typeof a==="string"){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return g.bd(a)}}},eEb=function(a,b){if(a.forEach&&typeof a.forEach=="function")a.forEach(b,void 0);
else if(g.bb(a)||typeof a==="string")Array.prototype.forEach.call(a,b,void 0);else for(var c=dEb(a),d=cEb(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)},fEb=function(a,b,c,d){var e=new g.kq(null);
a&&g.lq(e,a);b&&g.mq(e,b);c&&g.nq(e,c);d&&(e.B=d);return e},gEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/channel/opened",{yd:3,xd:"channel_type"})},hEb=function(a,b){a.j.jm("/client_streamz/youtube/living_room/mdx/channel/opened",b)},iEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/channel/closed",{yd:3,xd:"channel_type"})},jEb=function(a,b){a.j.jm("/client_streamz/youtube/living_room/mdx/channel/closed",b)},kEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/channel/message_received",{yd:3,xd:"channel_type"})},lEb=function(a,b){a.j.jm("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},mEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/channel/error",{yd:3,xd:"channel_type"})},nEb=function(a,b){a.j.jm("/client_streamz/youtube/living_room/mdx/channel/error",b)},oEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},pEb=function(){this.j=e8();
this.j.Zj("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},qEb=function(a,b){return new g.lla(a,b)},f8=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},g8=function(a,b){this.B={};
this.j=[];this.Jv=this.size=0;var c=arguments.length;if(c>1){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a)if(a instanceof g8)for(c=a.Yn(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d])},h8=function(a){if(a.size!=a.j.length){for(var b=0,c=0;b<a.j.length;){var d=a.j[b];
f8(a.B,d)&&(a.j[c++]=d);b++}a.j.length=c}if(a.size!=a.j.length){var e={};for(c=b=0;b<a.j.length;)d=a.j[b],f8(e,d)||(a.j[c++]=d,e[d]=1),b++;a.j.length=c}},uEb=function(a){this.name=this.id="";
this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.ownerObfuscatedGaiaId=this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new g8;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.ownerObfuscatedGaiaId=a.ownerObfuscatedGaiaId||"",this.theme=a.theme||"u",rEb(this,a.capabilities||""),sEb(this,a.compatibleSenderThemes||""),tEb(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")},rEb=function(a,b){a.capabilities.clear();
g.Mt(b.split(","),g.jb(aEb,vEb)).forEach(function(c){a.capabilities.add(c)})},sEb=function(a,b){a.compatibleSenderThemes.clear();
g.Mt(b.split(","),g.jb(aEb,wEb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},tEb=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},i8=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"},j8=function(a,b){return!!b&&(a.id==b||a.uuid==b)},xEb=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},yEb=function(a){return new i8(a)},zEb=function(a){return Array.isArray(a)?g.$r(a,yEb):[]},k8=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"},AEb=function(a){return Array.isArray(a)?"["+g.$r(a,k8).join(",")+"]":"null"},BEb=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(a){var b=Math.random()*16|0;
return(a=="x"?b:b&3|8).toString(16)})},CEb=function(a){return g.$r(a,function(b){return{key:b.id,
name:b.name}})},DEb=function(a,b){return g.Cb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},l8=function(a,b){return g.Cb(a,function(c){return j8(c,b)})},EEb=function(){var a=(0,g.wB)();
a&&XDb(a,a.j.tm(!0))},m8=function(){var a=g.yB("yt-remote-connected-devices")||[];
g.Sb(a);return a},FEb=function(a){if(a.length==0)return[];
var b=a[0].indexOf("#"),c=b==-1?a[0]:a[0].substring(0,b);return g.$r(a,function(d,e){return e==0?d:d.substring(c.length)})},GEb=function(a){g.xB("yt-remote-connected-devices",a,86400)},n8=function(){if(HEb)return HEb;
var a=g.yB("yt-remote-device-id");a||(a=BEb(),g.xB("yt-remote-device-id",a,31536E3));for(var b=m8(),c=1,d=a;g.Eb(b,d);)c++,d=a+"#"+c;return HEb=d},IEb=function(){var a=m8(),b=n8();
g.AB()&&g.Xb(a,b);a=FEb(a);if(a.length==0)try{g.dra("remote_sid")}catch(c){}else try{g.QA("remote_sid",a.join(","),-1)}catch(c){}},JEb=function(){return g.yB("yt-remote-session-browser-channel")},KEb=function(){return g.yB("yt-remote-local-screens")||[]},LEb=function(){g.xB("yt-remote-lounge-token-expiration",!0,86400)},MEb=function(a){a.length>5&&(a=a.slice(a.length-5));
var b=g.$r(KEb(),function(d){return d.loungeToken}),c=g.$r(a,function(d){return d.loungeToken});
g.as(c,function(d){return!g.Eb(b,d)})&&LEb();
g.xB("yt-remote-local-screens",a,31536E3)},o8=function(a){a||(g.zB("yt-remote-session-screen-id"),g.zB("yt-remote-session-video-id"));
IEb();a=m8();g.Gb(a,n8());GEb(a)},NEb=function(){if(!p8){var a=g.jw();
a&&(p8=new g.bw(a))}},OEb=function(){NEb();
return p8?!!p8.get("yt-remote-use-staging-server"):!1},q8=function(a,b){g.oD[a]=!0;
var c=g.mD();c&&c.publish.apply(c,arguments);g.oD[a]=!1},PEb=function(){},e8=function(){if(!r8){r8=new g.pg(new PEb);
var a=g.GA("client_streamz_web_flush_count",-1);a!==-1&&(r8.C=a)}return r8},QEb=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return a?parseInt(a[1],10):0},REb=function(a){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+a)!=-1||document.currentScript.src.indexOf("&"+a)!=-1)},SEb=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},s8=function(a){a.length?TEb(a.shift(),function(){s8(a)}):UEb()},VEb=function(a){return"chrome-extension://"+a+"/cast_sender.js"},TEb=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);g.Ye(d,g.Hma(a));(document.head||document.documentElement).appendChild(d)},WEb=function(){var a=QEb(),b=[];
if(a>1){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},UEb=function(){var a=SEb();
a&&a(!1,"No cast extension found")},YEb=function(){if(XEb){var a=2,b=SEb(),c=function(){a--;
a==0&&b&&b(!0)};
window.__onGCastApiAvailable=c;TEb("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",UEb,c)}},ZEb=function(){YEb();
var a=WEb();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");s8(a)},aFb=function(){YEb();
var a=WEb();a.push.apply(a,g.ra($Eb.map(VEb)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");s8(a)},t8=function(a,b,c){g.I.call(this);
this.K=c!=null?(0,g.ib)(a,c):a;this.aj=b;this.G=(0,g.ib)(this.q5,this);this.j=!1;this.B=0;this.C=this.rd=null;this.D=[]},u8=function(a,b,c){g.I.call(this);
this.D=c!=null?a.bind(c):a;this.aj=b;this.C=null;this.j=!1;this.B=0;this.rd=null},bFb=function(a){a.rd=g.ng(function(){a.rd=null;
a.j&&!a.B&&(a.j=!1,bFb(a))},a.aj);
var b=a.C;a.C=null;a.D.apply(null,b)},v8=function(){},cFb=function(){g.yb.call(this,"p")},dFb=function(){g.yb.call(this,"o")},fFb=function(){return eFb=eFb||new g.Fd},gFb=function(a){g.yb.call(this,"serverreachability",a)},w8=function(a){var b=fFb();
b.dispatchEvent(new gFb(b,a))},hFb=function(a){g.yb.call(this,"statevent",a)},x8=function(a){var b=fFb();
b.dispatchEvent(new hFb(b,a))},iFb=function(a,b,c,d){g.yb.call(this,"timingevent",a);
this.size=b;this.retries=d},y8=function(a,b){if(typeof a!=="function")throw Error("Fn must not be null and must be a function");
return g.Ua.setTimeout(function(){a()},b)},z8=function(){},A8=function(a,b,c,d){this.C=a;
this.D=b;this.Ub=c;this.Qb=d||1;this.Cb=new g.xq(this);this.ib=45E3;this.Oa=null;this.K=!1;this.Y=this.eb=this.Z=this.Sa=this.Da=this.rb=this.ra=null;this.va=[];this.j=null;this.N=0;this.G=this.Ha=null;this.Kb=-1;this.La=!1;this.Ya=0;this.Xa=null;this.Lb=this.Wa=this.Ab=this.Ga=!1;this.B=new jFb},jFb=function(){this.C=null;
this.j="";this.B=!1},lFb=function(a,b,c){a.Sa=1;
a.Z=b8(b.clone());a.Y=c;a.Ga=!0;kFb(a,null)},kFb=function(a,b){a.Da=Date.now();
B8(a);a.eb=a.Z.clone();c8(a.eb,"t",a.Qb);a.N=0;var c=a.C.Sa;a.B=new jFb;a.j=mFb(a.C,c?b:null,!a.Y);a.Ya>0&&(a.Xa=new u8((0,g.ib)(a.YU,a,a.j),a.Ya));a.Cb.listen(a.j,"readystatechange",a.s5);b=a.Oa?g.jd(a.Oa):{};a.Y?(a.Ha||(a.Ha="POST"),b["Content-Type"]="application/x-www-form-urlencoded",a.j.send(a.eb,a.Ha,a.Y,b)):(a.Ha="GET",a.j.send(a.eb,a.Ha,null,b));w8(1)},oFb=function(a){if(!nFb(a))return g.Co(a.j);
var b=g.Do(a.j);if(b==="")return"";var c="",d=b.length,e=g.Ao(a.j)==4;if(!a.B.C){if(typeof TextDecoder==="undefined")return C8(a),D8(a),"";a.B.C=new g.Ua.TextDecoder}for(var f=0;f<d;f++)a.B.B=!0,c+=a.B.C.decode(b[f],{stream:!(e&&f==d-1)});b.length=0;a.B.j+=c;a.N=0;return a.B.j},nFb=function(a){return a.j?a.Ha=="GET"&&a.Sa!=2&&a.C.mf:!1},rFb=function(a,b){var c=a.N,d=b.indexOf("\n",c);
if(d==-1)return pFb;c=Number(b.substring(c,d));if(isNaN(c))return qFb;d+=1;if(d+c>b.length)return pFb;b=b.slice(d,d+c);a.N=d+c;return b},B8=function(a){a.rb=Date.now()+a.ib;
sFb(a,a.ib)},sFb=function(a,b){if(a.ra!=null)throw Error("WatchDog timer not null");
a.ra=y8((0,g.ib)(a.r5,a),b)},tFb=function(a){a.ra&&(g.Ua.clearTimeout(a.ra),a.ra=null)},D8=function(a){a.C.Sg()||a.La||uFb(a.C,a)},C8=function(a){tFb(a);
g.ub(a.Xa);a.Xa=null;a.Cb.removeAll();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},CFb=function(a,b){try{var c=a.C;
if(c.Vh!=0&&(c.j==a||vFb(c.B,a)))if(!a.Wa&&vFb(c.B,a)&&c.Vh==3){try{var d=c.tf.j.parse(b)}catch(w){d=null}if(Array.isArray(d)&&d.length==3){var e=d;if(e[0]==0)a:{if(!c.Z){if(c.j)if(c.j.Da+3E3<a.Da)E8(c),F8(c);else break a;wFb(c);x8(18)}}else c.le=e[1],0<c.le-c.Xa&&e[2]<37500&&c.Wa&&c.va==0&&!c.ra&&(c.ra=y8((0,g.ib)(c.t5,c),6E3));if(xFb(c.B)<=1&&c.Sc){try{c.Sc()}catch(w){}c.Sc=void 0}}else G8(c,11)}else if((a.Wa||c.j==a)&&E8(c),!g.fc(b))for(e=c.tf.j.parse(b),b=0;b<e.length;b++){var f=e[b];c.Xa=f[0];
f=f[1];if(c.Vh==2)if(f[0]=="c"){c.D=f[1];c.Qb=f[2];var h=f[3];h!=null&&(c.ZU=h);var l=f[5];l!=null&&typeof l==="number"&&l>0&&(c.Ya=1.5*l);d=c;var m=a.bQ();if(m){var n=g.Eo(m,"X-Client-Wire-Protocol");if(n){var p=d.B;!p.j&&(g.hc(n,"spdy")||g.hc(n,"quic")||g.hc(n,"h2"))&&(p.D=p.G,p.j=new Set,p.B&&(yFb(p,p.B),p.B=null))}if(d.Ga){var q=g.Eo(m,"X-HTTP-Session-Id");q&&(d.Be=q,g.sq(d.Oa,d.Ga,q))}}c.Vh=3;c.G&&c.G.fV();c.Cc&&(c.Zc=Date.now()-a.Da);d=c;var r=a;d.Ed=zFb(d,d.Sa?d.Qb:null,d.Ub);if(r.Wa){AFb(d.B,
r);var t=r,u=d.Ya;u&&t.setTimeout(u);t.ra&&(tFb(t),B8(t));d.j=r}else BFb(d);c.C.length>0&&H8(c)}else f[0]!="stop"&&f[0]!="close"||G8(c,7);else c.Vh==3&&(f[0]=="stop"||f[0]=="close"?f[0]=="stop"?G8(c,7):c.disconnect():f[0]!="noop"&&c.G&&c.G.eV(f),c.va=0)}w8(4)}catch(w){}},DFb=function(a,b){this.j=a;
this.map=b;this.context=null},EFb=function(a){this.G=a||10;
g.Ua.PerformanceNavigationTiming?(a=g.Ua.performance.getEntriesByType("navigation"),a=a.length>0&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(g.Ua.chrome&&g.Ua.chrome.loadTimes&&g.Ua.chrome.loadTimes()&&g.Ua.chrome.loadTimes().wasFetchedViaSpdy);this.D=a?this.G:1;this.j=null;this.D>1&&(this.j=new Set);this.B=null;this.C=[]},FFb=function(a){return a.B?!0:a.j?a.j.size>=a.D:!1},xFb=function(a){return a.B?1:a.j?a.j.size:0},vFb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},yFb=
function(a,b){a.j?a.j.add(b):a.B=b},AFb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},GFb=function(a){if(a.B!=null)return a.C.concat(a.B.va);
if(a.j!=null&&a.j.size!==0){var b=a.C;a=g.v(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.va);return b}return g.Kb(a.C)},HFb=function(a,b){var c=new z8;
if(g.Ua.Image){var d=new Image;d.onload=g.jb(I8,c,"TestLoadImage: loaded",!0,b,d);d.onerror=g.jb(I8,c,"TestLoadImage: error",!1,b,d);d.onabort=g.jb(I8,c,"TestLoadImage: abort",!1,b,d);d.ontimeout=g.jb(I8,c,"TestLoadImage: timeout",!1,b,d);g.Ua.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4);
d.src=a}else b(!1)},IFb=function(a,b){var c=new z8,d=new AbortController,e=setTimeout(function(){d.abort();
I8(c,"TestPingServer: timeout",!1,b)},1E4);
fetch(a,{signal:d.signal}).then(function(f){clearTimeout(e);f.ok?I8(c,"TestPingServer: ok",!0,b):I8(c,"TestPingServer: server error",!1,b)}).catch(function(){clearTimeout(e);
I8(c,"TestPingServer: error",!1,b)})},I8=function(a,b,c,d,e){try{e&&(e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null),d(c)}catch(f){}},JFb=function(){this.j=new v8},KFb=function(a,b,c){var d=c||"";
try{eEb(a,function(e,f){var h=e;g.db(e)&&(h=g.qn(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e;
}},J8=function(a,b,c){return c&&c.m$?c.m$[a]||b:b},LFb=function(a){this.C=[];
this.Qb=this.Ed=this.Oa=this.Ub=this.j=this.Be=this.Ga=this.La=this.N=this.Kb=this.Y=null;this.Uf=this.eb=0;this.Tf=J8("failFast",!1,a);this.Wa=this.ra=this.Z=this.K=this.G=null;this.Bc=!0;this.le=this.Xa=-1;this.Lb=this.va=this.Da=0;this.Sf=J8("baseRetryDelayMs",5E3,a);this.Vf=J8("retryDelaySeedMs",1E4,a);this.Ch=J8("forwardChannelMaxRetries",2,a);this.Fd=J8("forwardChannelRequestTimeoutMs",2E4,a);this.Zd=a&&a.Rsb||void 0;this.Xf=a&&a.Drb||void 0;this.mf=a&&a.Osb||!1;this.Ya=void 0;this.Sa=a&&a.Jea||
!1;this.D="";this.B=new EFb(a&&a.Mpb);this.tf=new JFb;this.Cb=a&&a.eqb||!1;this.rb=a&&a.Tpb||!1;this.Cb&&this.rb&&(this.rb=!1);this.Wf=a&&a.Dpb||!1;a&&a.gqb&&(this.Bc=!1);this.Cc=!this.Cb&&this.Bc&&a&&a.Rpb||!1;this.Ud=void 0;a&&a.h_&&a.h_>0&&(this.Ud=a.h_);this.Sc=void 0;this.Zc=0;this.ib=!1;this.Ab=this.Ha=null},F8=function(a){a.j&&(MFb(a),a.j.cancel(),a.j=null)},NFb=function(a){F8(a);
a.Z&&(g.Ua.clearTimeout(a.Z),a.Z=null);E8(a);a.B.cancel();a.K&&(typeof a.K==="number"&&g.Ua.clearTimeout(a.K),a.K=null)},H8=function(a){FFb(a.B)||a.K||(a.K=!0,g.dg(a.bV,a),a.Da=0)},PFb=function(a,b){if(xFb(a.B)>=a.B.D-(a.K?1:0))return!1;
if(a.K)return a.C=b.va.concat(a.C),!0;if(a.Vh==1||a.Vh==2||a.Da>=(a.Tf?0:a.Ch))return!1;a.K=y8((0,g.ib)(a.bV,a,b),OFb(a,a.Da));a.Da++;return!0},RFb=function(a,b){var c;
b?c=b.Ub:c=a.eb++;var d=a.Oa.clone();g.sq(d,"SID",a.D);g.sq(d,"RID",c);g.sq(d,"AID",a.Xa);K8(a,d);a.N&&a.Y&&g.wq(d,a.N,a.Y);c=new A8(a,a.D,c,a.Da+1);a.N===null&&(c.Oa=a.Y);b&&(a.C=b.va.concat(a.C));b=QFb(a,c,1E3);c.setTimeout(Math.round(a.Fd*.5)+Math.round(a.Fd*.5*Math.random()));yFb(a.B,c);lFb(c,d,b)},K8=function(a,b){a.La&&g.Tc(a.La,function(c,d){g.sq(b,d,c)});
a.G&&eEb({},function(c,d){g.sq(b,d,c)})},QFb=function(a,b,c){c=Math.min(a.C.length,c);
var d=a.G?(0,g.ib)(a.G.u5,a.G,a):null;a:{for(var e=a.C,f=-1;;){var h=["count="+c];f==-1?c>0?(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(n<0)f=Math.max(0,e[m].j-100),l=!1;else try{KFb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}d=void 0}a=a.C.splice(0,c);b.va=a;return d},BFb=function(a){a.j||a.Z||(a.Lb=1,g.dg(a.aV,a),a.va=0)},wFb=function(a){if(a.j||a.Z||a.va>=3)return!1;
a.Lb++;a.Z=y8((0,g.ib)(a.aV,a),OFb(a,a.va));a.va++;return!0},MFb=function(a){a.Ha!=null&&(g.Ua.clearTimeout(a.Ha),a.Ha=null)},SFb=function(a){a.j=new A8(a,a.D,"rpc",a.Lb);
a.N===null&&(a.j.Oa=a.Y);a.j.Ya=0;var b=a.Ed.clone();g.sq(b,"RID","rpc");g.sq(b,"SID",a.D);g.sq(b,"AID",a.Xa);g.sq(b,"CI",a.Wa?"0":"1");!a.Wa&&a.Ud&&g.sq(b,"TO",a.Ud);g.sq(b,"TYPE","xmlhttp");K8(a,b);a.N&&a.Y&&g.wq(b,a.N,a.Y);a.Ya&&a.j.setTimeout(a.Ya);var c=a.j;a=a.Qb;c.Sa=1;c.Z=b8(b.clone());c.Y=null;c.Ga=!0;kFb(c,a)},E8=function(a){a.ra!=null&&(g.Ua.clearTimeout(a.ra),a.ra=null)},uFb=function(a,b){var c=null;
if(a.j==b){E8(a);MFb(a);a.j=null;var d=2}else if(vFb(a.B,b))c=b.va,AFb(a.B,b),d=1;else return;if(a.Vh!=0)if(b.K)if(d==1){c=b.Y?b.Y.length:0;b=Date.now()-b.Da;var e=a.Da;d=fFb();d.dispatchEvent(new iFb(d,c,b,e));H8(a)}else BFb(a);else{var f=b.Kb;e=b.getLastError();if(e==3||e==0&&f>0||!(d==1&&PFb(a,b)||d==2&&wFb(a)))switch(c&&c.length>0&&(b=a.B,b.C=b.C.concat(c)),e){case 1:G8(a,5);break;case 4:G8(a,10);break;case 3:G8(a,6);break;default:G8(a,2)}}},OFb=function(a,b){var c=a.Sf+Math.floor(Math.random()*
a.Vf);
a.isActive()||(c*=2);return c*b},G8=function(a,b){if(b==2){var c=(0,g.ib)(a.Qea,a),d=a.Xf,e=!d;
d=new g.kq(d||"//www.google.com/images/cleardot.gif");g.Ua.location&&g.Ua.location.protocol=="http"||g.lq(d,"https");b8(d);e?HFb(d.toString(),c):IFb(d.toString(),c)}else x8(2);a.Vh=0;a.G&&a.G.dV(b);TFb(a);NFb(a)},TFb=function(a){a.Vh=0;
a.Ab=[];if(a.G){var b=GFb(a.B);if(b.length!=0||a.C.length!=0)g.Lb(a.Ab,b),g.Lb(a.Ab,a.C),a.B.C.length=0,g.Kb(a.C),a.C.length=0;a.G.cV()}},UFb=function(a){if(a.Vh==0)return a.Ab;
var b=[];g.Lb(b,GFb(a.B));g.Lb(b,a.C);return b},zFb=function(a,b,c){var d=g.tq(c);
d.j!=""?(b&&g.mq(d,b+"."+d.j),g.nq(d,d.D)):(d=g.Ua.location,d=fEb(d.protocol,b?b+"."+d.hostname:d.hostname,+d.port,c));b=a.Ga;c=a.Be;b&&c&&g.sq(d,b,c);g.sq(d,"VER",a.ZU);K8(a,d);return d},mFb=function(a,b,c){if(b&&!a.Sa)throw Error("Can't create secondary domain capable XhrIo object.");
b=a.mf&&!a.Zd?new g.xo(new g.gq({z2:c})):new g.xo(a.Zd);b.K=a.Sa;return b},VFb=function(){},WFb=function(){},M8=function(a,b){g.Fd.call(this);
this.j=new LFb(b);this.G=a;this.B=b&&b.Z$||null;a=b&&b.Y$||null;b&&b.Kpb&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.j.Y=a;a=b&&b.mrb||null;b&&b.t_&&(a?a["X-WebChannel-Content-Type"]=b.t_:a={"X-WebChannel-Content-Type":b.t_});b&&b.qX&&(a?a["X-WebChannel-Client-Profile"]=b.qX:a={"X-WebChannel-Client-Profile":b.qX});this.j.Kb=a;(a=b&&b.lrb)&&!g.fc(a)&&(this.j.N=a);this.K=b&&b.Jea||!1;this.D=b&&b.gsb||!1;(b=b&&b.i$)&&!g.fc(b)&&(this.j.Ga=b,g.dd(this.B,b)&&(a=this.B,
b in a&&delete a[b]));this.C=new L8(this)},XFb=function(a){cFb.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.j=g.Yc(b))?g.hd(b,this.j):b:this.data=a},YFb=function(a){dFb.call(this);
this.status=1;this.errorCode=a},L8=function(a){this.j=a},ZFb=function(a,b){this.B=a;
this.j=b},$Fb=function(a){return UFb(a.j).map(function(b){var c=a.B;
b=b.map;"__data__"in b?(b=b.__data__,c=c.D?bEb(b):b):c=b;return c})},N8=function(a,b){if(typeof a!=="function")throw Error("Fn must not be null and must be a function");
return g.Ua.setTimeout(function(){a()},b)},P8=function(a){O8.dispatchEvent(new aGb(O8,a))},aGb=function(a){g.yb.call(this,"statevent",a)},Q8=function(a,b,c,d){this.j=a;
this.D=b;this.N=c;this.K=d||1;this.B=45E3;this.C=new g.xq(this);this.G=new g.mg;this.G.setInterval(250)},cGb=function(a,b,c){a.lI=1;
a.qD=b8(b.clone());a.Zv=c;a.Ga=!0;bGb(a,null)},dGb=function(a,b,c,d,e){a.lI=1;
a.qD=b8(b.clone());a.Zv=null;a.Ga=c;e&&(a.M1=!1);bGb(a,d)},bGb=function(a,b){a.tD=Date.now();
eGb(a);a.kI=a.qD.clone();c8(a.kI,"t",a.K);a.nI=0;a.sj=a.j.hN(a.j.uD()?b:null);a.fN>0&&(a.jI=new u8((0,g.ib)(a.gV,a,a.sj),a.fN));a.C.listen(a.sj,"readystatechange",a.w5);b=a.Xv?g.jd(a.Xv):{};a.Zv?(a.mI="POST",b["Content-Type"]="application/x-www-form-urlencoded",a.sj.send(a.kI,a.mI,a.Zv,b)):(a.mI="GET",a.M1&&!g.Nc&&(b.Connection="close"),a.sj.send(a.kI,a.mI,null,b));a.j.zs(1)},hGb=function(a,b){var c=a.nI,d=b.indexOf("\n",c);
if(d==-1)return fGb;c=Number(b.substring(c,d));if(isNaN(c))return gGb;d+=1;if(d+c>b.length)return fGb;b=b.slice(d,d+c);a.nI=d+c;return b},eGb=function(a){a.gN=Date.now()+a.B;
iGb(a,a.B)},iGb=function(a,b){if(a.iz!=null)throw Error("WatchDog timer not null");
a.iz=N8((0,g.ib)(a.v5,a),b)},jGb=function(a){a.iz&&(g.Ua.clearTimeout(a.iz),a.iz=null)},kGb=function(a){a.j.Sg()||a.rD||a.j.jN(a)},R8=function(a){jGb(a);
g.ub(a.jI);a.jI=null;a.G.stop();a.C.removeAll();if(a.sj){var b=a.sj;a.sj=null;b.abort();b.dispose()}a.R2&&(a.R2=null)},lGb=function(a,b){try{a.j.hV(a,b),a.j.zs(4)}catch(c){}},nGb=function(a,b,c,d,e){if(d==0)c(!1);
else{var f=e||0;d--;mGb(a,b,function(h){h?c(!0):g.Ua.setTimeout(function(){nGb(a,b,c,d,f)},f)})}},mGb=function(a,b,c){var d=new Image;
d.onload=function(){try{S8(d),c(!0)}catch(e){}};
d.onerror=function(){try{S8(d),c(!1)}catch(e){}};
d.onabort=function(){try{S8(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{S8(d),c(!1)}catch(e){}};
g.Ua.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
d.src=a},S8=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},oGb=function(a){this.j=a;
this.B=new v8},pGb=function(a){var b=T8(a.j,a.hE,"/mail/images/cleardot.gif");
b8(b);nGb(b.toString(),5E3,(0,g.ib)(a.K7,a),3,2E3);a.zs(1)},qGb=function(a){var b=a.j.K;
b!=null?(P8(5),b?(P8(11),U8(a.j,a,!1)):(P8(12),U8(a.j,a,!0))):(a.Zk=new Q8(a),a.Zk.Xv=a.iN,b=a.j,b=T8(b,b.uD()?a.oI:null,a.kN),P8(5),c8(b,"TYPE","xmlhttp"),dGb(a.Zk,b,!1,a.oI,!1))},rGb=function(a,b,c){this.j=1;
this.B=[];this.C=[];this.G=new v8;this.Y=a||null;this.K=b!=null?b:null;this.Z=c||!1},sGb=function(a,b){this.j=a;
this.map=b;this.context=null},tGb=function(a,b,c,d){g.yb.call(this,"timingevent",a);
this.size=b;this.retries=d},uGb=function(a){g.yb.call(this,"serverreachability",a)},wGb=function(a){a.x5(1,0);
a.pI=T8(a,null,a.mN);vGb(a)},xGb=function(a){a.Kt&&(a.Kt.abort(),a.Kt=null);
a.Zg&&(a.Zg.cancel(),a.Zg=null);a.jr&&(g.Ua.clearTimeout(a.jr),a.jr=null);V8(a);a.qk&&(a.qk.cancel(),a.qk=null);a.qt&&(g.Ua.clearTimeout(a.qt),a.qt=null)},yGb=function(a,b){if(a.j==0)throw Error("Invalid operation: sending map when state is closed");
a.B.push(new sGb(a.y5++,b));a.j!=2&&a.j!=3||vGb(a)},zGb=function(a){var b=0;
a.Zg&&b++;a.qk&&b++;return b},vGb=function(a){a.qk||a.qt||(a.qt=N8((0,g.ib)(a.lV,a),0),a.kz=0)},CGb=function(a,b){if(a.j==1){if(!b){a.wD=Math.floor(Math.random()*1E5);
b=a.wD++;var c=new Q8(a,"",b);c.Xv=a.tp;var d=AGb(a),e=a.pI.clone();g.sq(e,"RID",b);g.sq(e,"CVER","1");W8(a,e);cGb(c,e,d);a.qk=c;a.j=2}}else a.j==3&&(b?BGb(a,b):a.B.length==0||a.qk||BGb(a))},BGb=function(a,b){if(b)if(a.cw>6){a.B=a.C.concat(a.B);
a.C.length=0;var c=a.wD-1;b=AGb(a)}else c=b.N,b=b.Zv;else c=a.wD++,b=AGb(a);var d=a.pI.clone();g.sq(d,"SID",a.D);g.sq(d,"RID",c);g.sq(d,"AID",a.lz);W8(a,d);c=new Q8(a,a.D,c,a.kz+1);c.Xv=a.tp;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.qk=c;cGb(c,d,b)},W8=function(a,b){a.Si&&(a=a.Si.pV())&&g.Tc(a,function(c,d){g.sq(b,d,c)})},AGb=function(a){var b=Math.min(a.B.length,1E3),c=["count="+b];
if(a.cw>6&&b>0){var d=a.B[0].j;c.push("ofs="+d)}else d=0;for(var e={},f=0;f<b;e={YF:void 0},f++){e.YF=a.B[f].j;var h=a.B[f].map;e.YF=a.cw<=6?f:e.YF-d;try{g.Tc(h,function(l){return function(m,n){c.push("req"+l.YF+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.YF+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.B.splice(0,b));
return c.join("&")},DGb=function(a){a.Zg||a.jr||(a.N=1,a.jr=N8((0,g.ib)(a.kV,a),0),a.jz=0)},FGb=function(a){if(a.Zg||a.jr||a.jz>=3)return!1;
a.N++;a.jr=N8((0,g.ib)(a.kV,a),EGb(a,a.jz));a.jz++;return!0},U8=function(a,b,c){a.OM=a.K==null?c:!a.K;
a.vp=b.ir;a.Z||wGb(a)},V8=function(a){a.dw!=null&&(g.Ua.clearTimeout(a.dw),a.dw=null)},EGb=function(a,b){var c=5E3+Math.floor(Math.random()*1E4);
a.isActive()||(c*=2);return c*b},X8=function(a,b){if(b==2||b==9){var c=null;
a.Si&&(c=null);var d=(0,g.ib)(a.Pea,a);c||(c=new g.kq("//www.google.com/images/cleardot.gif"),b8(c));mGb(c.toString(),1E4,d)}else P8(2);GGb(a,b)},GGb=function(a,b){a.j=0;
a.Si&&a.Si.mV(b);HGb(a);xGb(a)},HGb=function(a){a.j=0;
a.vp=-1;if(a.Si)if(a.C.length==0&&a.B.length==0)a.Si.nN();else{var b=g.Kb(a.C),c=g.Kb(a.B);a.C.length=0;a.B.length=0;a.Si.nN(b,c)}},T8=function(a,b,c){var d=g.tq(c);
if(d.j!="")b&&g.mq(d,b+"."+d.j),g.nq(d,d.D);else{var e=window.location;d=fEb(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.vD&&g.Tc(a.vD,function(f,h){g.sq(d,h,f)});
g.sq(d,"VER",a.cw);W8(a,d);return d},IGb=function(){},JGb=function(){this.j=[];
this.B=[]},KGb=function(a){g.yb.call(this,"channelMessage");
this.message=a},LGb=function(a){g.yb.call(this,"channelError");
this.error=a},MGb=function(a,b){this.action=a;
this.params=b||{}},Y8=function(a,b){g.I.call(this);
this.j=new g.Dv(this.Ica,0,this);g.M(this,this.j);this.aj=5E3;this.B=0;if(typeof a==="function")b&&(a=(0,g.ib)(a,b));else if(a&&typeof a.handleEvent==="function")a=(0,g.ib)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},NGb=function(a,b,c,d,e){c=c===void 0?!1:c;
d=d===void 0?function(){return""}:d;
e=e===void 0?!1:e;this.Da=a;this.N=b;this.C=new g.aw;this.B=new Y8(this.Vda,this);this.j=null;this.ra=!1;this.K=null;this.Y="";this.Z=this.G=0;this.D=[];this.Sa=c;this.va=d;this.Wa=e;this.Oa=new gEb;this.Ha=new iEb;this.La=new kEb;this.Ga=new mEb;this.Xa=new oEb;this.eb=new pEb},OGb=function(a){if(a.j){var b=a.va(),c=a.j.tp||{};
b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.tp=c}},Z8=function(a){this.scheme="https";
this.port=this.domain="";this.j="/api/lounge";this.B=!0;a=a||document.location.href;var b=Number(g.xn(4,a))||"";b&&(this.port=":"+b);this.domain=g.yn(a)||"";a=g.oc();a.search("MSIE")>=0&&(a=a.match(/MSIE ([\d.]+)/)[1],g.lc(a,"10.0")<0&&(this.B=!1))},$8=function(a,b){var c=a.j;
a.B&&(c=a.scheme+"://"+a.domain+a.port+a.j);return g.to(c+b,{})},PGb=function(a,b){g.Fd.call(this);
var c=this;this.Hd=a();this.Hd.subscribe("handlerOpened",this.A5,this);this.Hd.subscribe("handlerClosed",this.onClosed,this);this.Hd.subscribe("handlerError",function(d,e){c.onError(e)});
this.Hd.subscribe("handlerMessage",this.onMessage,this);this.j=b},QGb=function(a,b,c){var d=this;
c=c===void 0?function(){return""}:c;
var e=e===void 0?new WFb:e;var f=f===void 0?new g.aw:f;this.pathPrefix=a;this.j=b;this.Da=c;this.G=f;this.Z=null;this.Y=this.N=0;this.channel=null;this.K=0;this.C=new Y8(function(){d.C.isActive();var h;((h=d.channel)==null?void 0:xFb((new ZFb(h,h.j)).j.B))===0&&d.connect(d.Z,d.N)});
this.D={};this.B={};this.ra=!1;this.logger=null;this.va=[];this.Dg=void 0;this.Oa=new gEb;this.Ha=new iEb;this.La=new kEb;this.Ga=new mEb},RGb=function(a){g.vd(a.channel,"m",function(){a.K=3;
a.C.reset();a.Z=null;a.N=0;for(var b=g.v(a.va),c=b.next();!c.done;c=b.next())c=c.value,a.channel&&a.channel.send(c);a.va=[];a.publish("webChannelOpened");hEb(a.Oa,"WEB_CHANNEL")});
g.vd(a.channel,"n",function(){a.K=0;a.C.isActive()||a.publish("webChannelClosed");var b,c=(b=a.channel)==null?void 0:$Fb(new ZFb(b,b.j));c&&(a.va=[].concat(g.ra(c)));jEb(a.Ha,"WEB_CHANNEL")});
g.vd(a.channel,"p",function(b){var c=b.data;c[0]==="gracefulReconnect"?(a.C.start(),a.channel&&a.channel.close()):a.publish("webChannelMessage",new MGb(c[0],c[1]));a.Dg=b.statusCode;lEb(a.La,"WEB_CHANNEL")});
g.vd(a.channel,"o",function(){a.Dg===401||a.C.start();a.publish("webChannelError");nEb(a.Ga,"WEB_CHANNEL")})},SGb=function(a){var b=a.Da();
b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},TGb=function(a){g.Fd.call(this);
this.j=a();this.j.subscribe("webChannelOpened",this.B5,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},UGb=function(a,b,c,d,e){function f(){return new NGb($8(a,"/bc"),b,!1,c,d)}
c=c===void 0?function(){return""}:c;
return g.FA("enable_mdx_web_channel_desktop")?new TGb(function(){return new QGb($8(a,"/wc"),b,c)}):new PGb(f,e)},YGb=function(){var a=VGb;
WGb();a9.push(a);XGb()},b9=function(a,b){WGb();
var c=ZGb(a,String(b));a9.length==0?$Gb(c):(XGb(),g.Zb(a9,function(d){d(c)}))},c9=function(a){b9("CP",a)},WGb=function(){a9||(a9=g.Wa("yt.mdx.remote.debug.handlers_")||[],g.Va("yt.mdx.remote.debug.handlers_",a9))},$Gb=function(a){var b=(d9+1)%50;
d9=b;e9[b]=a;f9||(f9=b==49)},XGb=function(){var a=a9;
if(e9[0]){var b=f9?d9:-1;do{b=(b+1)%50;var c=e9[b];g.Zb(a,function(d){d(c)})}while(b!=d9);
e9=Array(50);d9=-1;f9=!1}},ZGb=function(a,b){var c=(Date.now()-aHb)/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("")},g9=function(a){g.GE.call(this);
this.K=a;this.screens=[]},bHb=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},cHb=function(a,b){var c=a.screens.length!=b.length;
a.screens=g.Mt(a.screens,function(f){return!!DEb(b,f)});
for(var d=0,e=b.length;d<e;d++)c=bHb(a,b[d])||c;return c},dHb=function(a,b){var c=a.screens.length;
a.screens=g.Mt(a.screens,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.screens.length<c},eHb=function(a,b,c,d,e){g.GE.call(this);
this.C=a;this.N=b;this.D=c;this.K=d;this.G=e;this.B=0;this.j=null;this.rd=NaN},i9=function(a){g9.call(this,"LocalScreenService");
this.B=a;this.j=NaN;h9(this);this.info("Initializing with "+AEb(this.screens))},fHb=function(a){if(a.screens.length){var b=g.$r(a.screens,function(d){return d.id}),c=$8(a.B,"/pairing/get_lounge_token_batch");
a.B.sendRequest("POST",c,{screen_ids:b.join(",")},(0,g.ib)(a.H9,a),(0,g.ib)(a.G9,a))}},h9=function(a){if(g.FA("deprecate_pair_servlet_enabled"))return cHb(a,[]);
var b=zEb(KEb());b=g.Mt(b,function(c){return!c.uuid});
return cHb(a,b)},j9=function(a,b){MEb(g.$r(a.screens,xEb));
b&&LEb()},hHb=function(a,b){g.GE.call(this);
this.K=b;b=(b=g.yB("yt-remote-online-screen-ids")||"")?b.split(","):[];for(var c={},d=this.K(),e=d.length,f=0;f<e;++f){var h=d[f].id;c[h]=g.Eb(b,h)}this.j=c;this.G=a;this.C=this.D=NaN;this.B=null;gHb("Initialized with "+g.qn(this.j))},iHb=function(a,b,c){var d=$8(a.G,"/pairing/get_screen_availability");
a.G.sendRequest("POST",d,{lounge_token:b.token},(0,g.ib)(function(e){e=e.screens||[];for(var f=e.length,h=0;h<f;++h)if(e[h].loungeToken==b.token){c(e[h].status=="online");return}c(!1)},a),(0,g.ib)(function(){c(!1)},a))},kHb=function(a,b){a:if($Db(b)!=$Db(a.j))var c=!1;
else{c=g.bd(b);for(var d=c.length,e=0;e<d;++e)if(!a.j[c[e]]){c=!1;break a}c=!0}c||(gHb("Updated online screens: "+g.qn(a.j)),a.j=b,a.publish("screenChange"));jHb(a)},k9=function(a){isNaN(a.C)||g.DA(a.C);
a.C=g.BA((0,g.ib)(a.WS,a),a.D>0&&a.D<g.kb()?2E4:1E4)},gHb=function(a){b9("OnlineScreenService",a)},lHb=function(a){var b={};
g.Zb(a.K(),function(c){c.token?b[c.token]=c.id:this.hg("Requesting availability of screen w/o lounge token.")});
return b},jHb=function(a){a=g.bd(g.Uc(a.j,function(b){return b}));
g.Sb(a);a.length?g.xB("yt-remote-online-screen-ids",a.join(","),60):g.zB("yt-remote-online-screen-ids")},l9=function(a,b){b=b===void 0?!1:b;
g9.call(this,"ScreenService");this.D=a;this.N=b;this.j=this.B=null;this.C=[];this.G={};mHb(this)},oHb=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.G[b]);var h=a.yl(),l=c?l8(h,c):null;c&&(a.N||l)||(l=l8(h,b));if(l){l.uuid=b;var m=m9(a,l);iHb(a.j,m,function(n){e(n?m:null)})}else c?nHb(a,c,(0,g.ib)(function(n){var p=m9(this,new i8({name:d,
screenId:c,loungeToken:n,dialId:b||""}));iHb(this.j,p,function(q){e(q?p:null)})},a),f):e(null)},pHb=function(a,b){for(var c=a.screens.length,d=0;d<c;++d)if(a.screens[d].name==b)return a.screens[d];
return null},qHb=function(a,b,c){iHb(a.j,b,c)},nHb=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.HA($8(a.D,"/pairing/get_lounge_token_batch"),e)},rHb=function(a){a.screens=a.B.yl();
var b=a.G,c={},d;for(d in b)c[b[d]]=d;b=a.screens.length;for(d=0;d<b;++d){var e=a.screens[d];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+AEb(a.screens))},mHb=function(a){sHb(a);
a.B=new i9(a.D);a.B.subscribe("screenChange",(0,g.ib)(a.R9,a));rHb(a);a.N||(a.C=zEb(g.yB("yt-remote-automatic-screen-cache")||[]));sHb(a);a.info("Initializing automatic screens: "+AEb(a.C));a.j=new hHb(a.D,(0,g.ib)(a.yl,a,!0));a.j.subscribe("screenChange",(0,g.ib)(function(){this.publish("onlineScreenChange")},a))},m9=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=l8(a.C,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.C.push(b),a.N||tHb(a));sHb(a);a.G[b.uuid]=b.id;g.xB("yt-remote-device-id-map",a.G,31536E3);return b},tHb=function(a){a=g.Mt(a.C,function(b){return b.idType!="shortLived"});
g.xB("yt-remote-automatic-screen-cache",g.$r(a,xEb))},sHb=function(a){a.G=g.yB("yt-remote-device-id-map")||{}},n9=function(a,b,c){g.GE.call(this);
this.Ga=c;this.D=a;this.B=b;this.j=null},o9=function(a,b){a.j=b;
a.publish("sessionScreen",a.j)},uHb=function(a,b){a.j&&(a.j.token=b,m9(a.D,a.j));
a.publish("sessionScreen",a.j)},p9=function(a,b){b9(a.Ga,b)},q9=function(a,b,c){n9.call(this,a,b,"CastSession");
var d=this;this.config_=c;this.C=null;this.va=(0,g.ib)(this.G5,this);this.Ha=(0,g.ib)(this.Vca,this);this.ra=g.BA(function(){vHb(d,null)},12E4);
this.N=this.G=this.K=this.Z=0;this.Da=!1;this.Y="unknown"},xHb=function(a,b){g.DA(a.N);
a.N=0;b==0?wHb(a):a.N=g.BA(function(){wHb(a)},b)},wHb=function(a){yHb(a,"getLoungeToken");
g.DA(a.G);a.G=g.BA(function(){zHb(a,null)},3E4)},yHb=function(a,b){a.info("sendYoutubeMessage_: "+b+" "+g.qn());
var c={};c.type=b;a.C?a.C.sendMessage("urn:x-cast:com.google.youtube.mdx",c,function(){},(0,g.ib)(function(){p9(this,"Failed to send message: "+b+".")},a)):p9(a,"Sending yt message without session: "+g.qn(c))},AHb=function(a,b){b?(a.info("onConnectedScreenId_: Received screenId: "+b),a.j&&a.j.id==b||a.AY(b,function(c){o9(a,c)},function(){return a.Hj()},5)):a.Hj(Error("Waiting for session status timed out."))},CHb=function(a,b,c){a.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(b));
var d=new i8(b);BHb(a,d,function(e){e?(a.Da=!0,m9(a.D,d),o9(a,d),a.Y="unknown",xHb(a,c)):(g.mA(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online.")),a.Hj())},5)},vHb=function(a,b){g.DA(a.ra);
a.ra=0;b?a.config_.enableCastLoungeToken&&b.loungeToken?b.deviceId?a.j&&a.j.uuid==b.deviceId||(b.loungeTokenRefreshIntervalMs?CHb(a,{name:a.B.friendlyName,screenId:b.screenId,loungeToken:b.loungeToken,dialId:b.deviceId,screenIdType:"shortLived"},b.loungeTokenRefreshIntervalMs):(g.mA(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(b)+".")),AHb(a,b.screenId))):(g.mA(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(b)+".")),AHb(a,b.screenId)):
AHb(a,b.screenId):a.Hj(Error("Waiting for session status timed out."))},zHb=function(a,b){g.DA(a.G);
a.G=0;var c=null;if(b)if(b.loungeToken){var d;((d=a.j)==null?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.Y=c,xHb(a,3E4)):(uHb(a,b.loungeToken),a.Da=!1,a.Y="unknown",xHb(a,b.loungeTokenRefreshIntervalMs))},BHb=function(a,b,c,d){g.DA(a.K);
a.K=0;qHb(a.D,b,function(e){e||d<0?c(e):a.K=g.BA(function(){BHb(a,b,c,d-1)},300)})},DHb=function(a){g.DA(a.Z);
a.Z=0;g.DA(a.K);a.K=0;g.DA(a.ra);a.ra=0;g.DA(a.G);a.G=0;g.DA(a.N);a.N=0},r9=function(a,b,c,d){n9.call(this,a,b,"DialSession");
this.config_=d;this.C=this.Z=null;this.Ha="";this.Sa=c;this.Oa=null;this.ra=function(){};
this.Y=NaN;this.La=(0,g.ib)(this.H5,this);this.G=function(){};
this.N=this.K=0;this.va=!1;this.Da="unknown"},s9=function(a){var b;
return!!(a.config_.enableDialLoungeToken&&((b=a.C)==null?0:b.getDialAppInfo))},EHb=function(a){a.G=a.D.rV(a.Ha,a.B.label,a.B.friendlyName,s9(a),function(b,c){a.G=function(){};
a.va=!0;o9(a,b);b.idType=="shortLived"&&c>0&&t9(a,c)},function(b){a.G=function(){};
a.Hj(b)})},FHb=function(a){var b={};
b.pairingCode=a.Ha;b.theme=a.Sa;OEb()&&(b.env_useStageMdx=1);return g.Dn(b)},GHb=function(a){return new Promise(function(b){a.Ha=BEb();
if(a.Oa){var c=new chrome.cast.DialLaunchResponse(!0,FHb(a));b(c);EHb(a)}else a.ra=function(){g.DA(a.Y);a.ra=function(){};
a.Y=NaN;var d=new chrome.cast.DialLaunchResponse(!0,FHb(a));b(d);EHb(a)},a.Y=g.BA(function(){a.ra()},100)})},IHb=function(a,b,c){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(b));
var d=new i8(b);return(new Promise(function(e){HHb(a,d,function(f){f?(a.va=!0,m9(a.D,d),o9(a,d),t9(a,c)):g.mA(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online."));e(f)},5)})).then(function(e){return e?new chrome.cast.DialLaunchResponse(!1):GHb(a)})},JHb=function(a,b){var c=a.Z.receiver.label,d=a.B.friendlyName;
return(new Promise(function(e){oHb(a.D,c,b,d,function(f){f&&f.token&&o9(a,f);e(f)},function(f){p9(a,"Failed to get DIAL screen: "+f);
e(null)})})).then(function(e){return e&&e.token?new chrome.cast.DialLaunchResponse(!1):GHb(a)})},HHb=function(a,b,c,d){g.DA(a.K);
a.K=0;qHb(a.D,b,function(e){e||d<0?c(e):a.K=g.BA(function(){HHb(a,b,c,d-1)},300)})},t9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b);
s9(a)&&(g.DA(a.N),a.N=0,b==0?KHb(a):a.N=g.BA(function(){KHb(a)},b))},KHb=function(a){s9(a)&&a.C.getDialAppInfo(function(b){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b));
b=b.extraData||{};var c=null;if(b.loungeToken){var d;((d=a.j)==null?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(a.Da=c,t9(a,3E4)):(a.va=!1,a.Da="unknown",uHb(a,b.loungeToken),t9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b);
a.Da="noLoungeTokenResponse";t9(a,3E4)})},LHb=function(a){g.DA(a.K);
a.K=0;g.DA(a.N);a.N=0;a.G();a.G=function(){};
g.DA(a.Y)},u9=function(a,b){n9.call(this,a,b,"ManualSession");
this.C=g.BA((0,g.ib)(this.cB,this,null),150)},v9=function(a,b){g.GE.call(this);
this.config_=b;this.B=a;this.Z=b.appId||"233637DE";this.D=b.theme||"cl";this.Y=b.disableCastApi||!1;this.K=b.forceMirroring||!1;this.j=null;this.N=!1;this.C=[];this.G=(0,g.ib)(this.Vba,this)},MHb=function(a,b){return b?g.Cb(a.C,function(c){return j8(b,c.label)},a):null},w9=function(a){b9("Controller",a)},VGb=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},x9=function(a){return a.N||!!a.C.length||!!a.j},y9=function(a,b,c){b!=a.j&&(g.ub(a.j),(a.j=b)?(c?a.publish("yt-remote-cast2-receiver-resumed",
b.B):a.publish("yt-remote-cast2-receiver-selected",b.B),b.subscribe("sessionScreen",(0,g.ib)(a.s0,a,b)),b.subscribe("sessionFailed",function(){return NHb(a,b)}),b.j?a.publish("yt-remote-cast2-session-change",b.j):c&&a.j.cB(null)):a.publish("yt-remote-cast2-session-change",null))},NHb=function(a,b){a.j==b&&a.publish("yt-remote-cast2-session-failed")},OHb=function(a){var b=a.B.qV(),c=a.j&&a.j.B;
a=g.$r(b,function(d){c&&j8(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=MHb(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},VHb=function(a,b,c,d){d.disableCastApi?z9("Cannot initialize because disabled by Mdx config."):PHb()?QHb(b,d)&&(RHb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?SHb(a,c):(window.__onGCastApiAvailable=function(e,f){e?SHb(a,c):(A9("Failed to load cast API: "+f),THb(!1),RHb(!1),g.zB("yt-remote-cast-available"),g.zB("yt-remote-cast-receiver"),
UHb(),c(!1))},d.loadCastApiSetupScript?g.kva("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?QEb()>=60&&ZEb():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?UEb():QEb()>=89?aFb():(YEb(),s8($Eb.map(VEb))))):z9("Cannot initialize because not running Chrome")},UHb=function(){z9("dispose");
var a=B9();a&&a.dispose();g.Va("yt.mdx.remote.cloudview.instance_",null);WHb(!1);g.rD(XHb);XHb.length=0},C9=function(){return!!g.yB("yt-remote-cast-installed")},YHb=function(){var a=g.yB("yt-remote-cast-receiver");
return a?a.friendlyName:null},ZHb=function(){z9("clearCurrentReceiver");
g.zB("yt-remote-cast-receiver")},$Hb=function(){return C9()?B9()?B9().getCastSession():(A9("getCastSelector: Cast is not initialized."),null):(A9("getCastSelector: Cast API is not installed!"),null)},aIb=function(){C9()?B9()?D9()?(z9("Requesting cast selector."),B9().requestSession()):(z9("Wait for cast API to be ready to request the session."),XHb.push(g.qD("yt-remote-cast2-api-ready",aIb))):A9("requestCastSelector: Cast is not initialized."):A9("requestCastSelector: Cast API is not installed!")},
E9=function(a,b){D9()?B9().setConnectedScreenStatus(a,b):A9("setConnectedScreenStatus called before ready.")},PHb=function(){var a=g.oc().search(/ (CrMo|Chrome|CriOS)\//)>=0;
return g.LJ||a},bIb=function(a,b){B9().init(a,b)},QHb=function(a,b){var c=!1;
B9()||(a=new v9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.xB("yt-remote-cast-available",d);q8("yt-remote-cast2-availability-change",d)}),a.subscribe("yt-remote-cast2-receiver-selected",function(d){z9("onReceiverSelected: "+d.friendlyName);
g.xB("yt-remote-cast-receiver",d);q8("yt-remote-cast2-receiver-selected",d)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(d){z9("onReceiverResumed: "+d.friendlyName);
g.xB("yt-remote-cast-receiver",d);q8("yt-remote-cast2-receiver-resumed",d)}),a.subscribe("yt-remote-cast2-session-change",function(d){z9("onSessionChange: "+k8(d));
d||g.zB("yt-remote-cast-receiver");q8("yt-remote-cast2-session-change",d)}),g.Va("yt.mdx.remote.cloudview.instance_",a),c=!0);
z9("cloudview.createSingleton_: "+c);return c},B9=function(){return g.Wa("yt.mdx.remote.cloudview.instance_")},SHb=function(a,b){THb(!0);
RHb(!1);bIb(a,function(c){c?(WHb(!0),g.sD("yt-remote-cast2-api-ready")):(A9("Failed to initialize cast API."),THb(!1),g.zB("yt-remote-cast-available"),g.zB("yt-remote-cast-receiver"),UHb());b(c)})},z9=function(a){b9("cloudview",a)},A9=function(a){b9("cloudview",a)},THb=function(a){z9("setCastInstalled_ "+a);
g.xB("yt-remote-cast-installed",a)},D9=function(){return!!g.Wa("yt.mdx.remote.cloudview.apiReady_")},WHb=function(a){z9("setApiReady_ "+a);
g.Va("yt.mdx.remote.cloudview.apiReady_",a)},RHb=function(a){g.Va("yt.mdx.remote.cloudview.initializing_",a)},F9=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.N=0;this.trackData=null;this.Bl=this.Xp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},cIb=function(a){a.audioTrackId=null;
a.trackData=null;a.playerState=-1;a.Xp=!1;a.Bl=!1;a.N=0;a.K=g.kb();a.D=0;a.j=0;a.G=0;a.Z=0;a.C=NaN;a.B=!1},G9=function(a){return a.isPlaying()?(g.kb()-a.K)/1E3:0},H9=function(a,b){a.N=b;
a.K=g.kb()},I9=function(a){switch(a.playerState){case 1:case 1081:return(g.kb()-a.K)/1E3+a.N;
case -1E3:return 0}return a.N},J9=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&cIb(a)},dIb=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.kd(a.trackData);b.hasPrevious=a.Xp;b.hasNext=a.Bl;b.playerTime=a.N;b.playerTimeAt=a.K;b.seekableStart=a.D;b.seekableEnd=a.j;b.duration=a.G;b.loadedTime=a.Z;b.liveIngestionTime=a.C;return b},L9=function(a,b){g.GE.call(this);
var c=this;this.C=0;this.D=a;this.K=[];this.G=new JGb;this.B=this.j=null;this.Y=(0,g.ib)(this.Jaa,this);this.N=(0,g.ib)(this.mG,this);this.Z=(0,g.ib)(this.Iaa,this);this.ra=(0,g.ib)(this.Laa,this);var d=0;a?(d=a.getProxyState(),d!=3&&(a.subscribe("proxyStateChange",this.uT,this),eIb(this))):d=3;d!=0&&(b?this.uT(d):g.BA(function(){c.uT(d)},0));
(a=$Hb())&&K9(this,a);this.subscribe("yt-remote-cast2-session-change",this.ra)},M9=function(a){return new F9(a.D.getPlayerContextData())},eIb=function(a){g.Zb("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.K.push(this.D.subscribe(b,g.jb(this.Tba,b),this))},a)},fIb=function(a){g.Zb(a.K,function(b){this.D.unsubscribeByKey(b)},a);
a.K.length=0},N9=function(a){return a.getState()==1},O9=function(a,b){var c=a.G;
c.j.length+c.B.length<50&&a.G.enqueue(b)},gIb=function(a,b,c){var d=M9(a);
H9(d,c);d.playerState!=-1E3&&(d.playerState=b);P9(a,d)},Q9=function(a,b,c){a.D.sendMessage(b,c)},P9=function(a,b){fIb(a);
a.D.setPlayerContextData(dIb(b));eIb(a)},K9=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.mG(null));
a.B=b;a.B&&(c9("Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.Y),a.B.addMediaListener(a.N),a.B.media.length&&a.mG(a.B.media[0]))},hIb=function(a){var b=a.j.media,c=a.j.customData;
if(b&&c){var d=M9(a);b.contentId!=d.videoId&&c9("Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;H9(d,a.j.getEstimatedTime());P9(a,d)}else c9("No cast media video. Ignoring state update.")},R9=function(a,b,c){return(0,g.ib)(function(d){this.hg("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.hg("Retrying "+b+" using MDx browser channel."),Q9(this,b,c))},a)},U9=function(a,b,c,d){d=d===void 0?!1:d;
g.GE.call(this);var e=this;this.K=NaN;this.Ha=!1;this.Y=this.Z=this.va=this.Da=NaN;this.ra=[];this.G=this.N=this.D=this.j=this.B=null;this.Oa=a;this.La=d;this.ra.push(g.oB(window,"beforeunload",function(){e.dA(2)}));
this.C=[];this.j=new F9;this.Sa=b.id;this.Ga=b.idType;this.B=UGb(this.Oa,c,this.vV,this.Ga=="shortLived",this.Sa);this.B.listen("channelOpened",function(){iIb(e)});
this.B.listen("channelClosed",function(){S9("Channel closed");isNaN(e.K)?o8(!0):o8();e.dispose()});
this.B.listen("channelError",function(f){o8();isNaN(e.iF())?(f==1&&e.Ga=="shortLived"&&e.publish("browserChannelAuthError",f),S9("Channel error: "+f+" without reconnection"),e.dispose()):(e.Ha=!0,S9("Channel error: "+f+" with reconnection in "+e.iF()+" ms"),T9(e,2))});
this.B.listen("channelMessage",function(f){jIb(e,f)});
this.B.Ns(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.AB()&&g.xB("yt-remote-session-video-id",f)})},kIb=function(a){return g.Cb(a.C,function(b){return b.type=="LOUNGE_SCREEN"})},S9=function(a){b9("conn",a)},T9=function(a,b){a.publish("proxyStateChange",b)},lIb=function(a){a.K=g.BA(function(){S9("Connecting timeout");
a.dA(1)},2E4)},mIb=function(a){g.DA(a.K);
a.K=NaN},nIb=function(a){g.DA(a.Da);
a.Da=NaN},pIb=function(a){oIb(a);
a.va=g.BA(function(){V9(a,"getNowPlaying")},2E4)},oIb=function(a){g.DA(a.va);
a.va=NaN},iIb=function(a){S9("Channel opened");
a.Ha&&(a.Ha=!1,nIb(a),a.Da=g.BA(function(){S9("Timing out waiting for a screen.");a.dA(1)},15E3))},rIb=function(a,b){var c=null;
if(b){var d=kIb(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Va("yt.mdx.remote.remoteClient_",c);b&&(mIb(a),nIb(a));c=a.B.OA()&&isNaN(a.K);b==c?b&&(T9(a,1),V9(a,"getSubtitlesTrack")):b?(a.vY()&&a.j.reset(),T9(a,1),V9(a,"getNowPlaying"),qIb(a)):a.dA(1)},sIb=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.j.videoId&&(g.gd(b.params)?a.j.trackData=null:a.j.trackData=b.params,a.publish("remotePlayerChange"))},tIb=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;J9(a.j,d,e);a.publish("remoteQueueChange",c)},vIb=function(a,b){b.params=b.params||{};
tIb(a,b,"NOW_PLAYING_MAY_CHANGE");uIb(a,b);a.publish("autoplayDismissed")},uIb=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
H9(a.j,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;c==-1&&a.j.playerState==-1E3&&(c=-1E3);a.j.playerState=c;c=Number(b.params.loadedTime);a.j.Z=isNaN(c)?0:c;a.j.Nl(Number(b.params.duration));c=a.j;var d=Number(b.params.liveIngestionTime);c.C=d;c.B=isNaN(d)?!1:!0;c=a.j;d=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);c.D=isNaN(d)?0:d;c.j=isNaN(b)?0:b;a.j.playerState==1?pIb(a):oIb(a);a.publish("remotePlayerChange")},wIb=function(a,b){if(a.j.playerState!=-1E3){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);H9(a.j,isNaN(b)?0:b);a.publish("remotePlayerChange")}},xIb=function(a,b){var c=b.params.muted=="true";
a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.publish("remotePlayerChange")},yIb=function(a,b){a.N=b.params.videoId;
a.publish("nowAutoplaying",parseInt(b.params.timeout,10))},zIb=function(a,b){a.N=b.params.videoId||null;
a.publish("autoplayUpNext",a.N)},AIb=function(a,b){a.G=b.params.autoplayMode;
a.publish("autoplayModeChange",a.G);a.G=="DISABLED"&&a.publish("autoplayDismissed")},BIb=function(a,b){var c=b.params.hasNext=="true";
a.j.Xp=b.params.hasPrevious=="true";a.j.Bl=c;a.publish("previousNextChange")},jIb=function(a,b){b=b.message;
b.params?S9("Received: action="+b.action+", params="+g.qn(b.params)):S9("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=d8(b.params.devices);a.C=g.$r(b,function(d){return new uEb(d)});
b=!!g.Cb(a.C,function(d){return d.type=="LOUNGE_SCREEN"});
rIb(a,b);b=a.yZ("mlm");a.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.Ib(a.C,function(d){return d.type=="LOUNGE_SCREEN"});
rIb(a,!1);break;case "remoteConnected":var c=new uEb(d8(b.params.device));g.Cb(a.C,function(d){return c?d.id==c.id:!1})||ZDb(a.C,c);
break;case "remoteDisconnected":c=new uEb(d8(b.params.device));g.Ib(a.C,function(d){return c?d.id==c.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":tIb(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":vIb(a,b);break;case "onStateChange":uIb(a,b);break;case "onAdStateChange":wIb(a,b);break;case "onVolumeChanged":xIb(a,b);break;case "onSubtitlesTrackChanged":sIb(a,b);break;case "nowAutoplaying":yIb(a,b);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":zIb(a,b);break;case "onAutoplayModeChanged":AIb(a,b);break;case "onHasPreviousNextChanged":BIb(a,
b);break;case "requestAssistedSignIn":a.publish("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":a.publish("loopModeChange",b.params.loopMode);break;default:S9("Unrecognized action: "+b.action)}},qIb=function(a){g.DA(a.Y);
a.Y=g.BA(function(){a.dA(1)},864E5)},V9=function(a,b,c){c?S9("Sending: action="+b+", params="+g.qn(c)):S9("Sending: action="+b);
a.B.sendMessage(b,c)},CIb=function(a){g9.call(this,"ScreenServiceProxy");
this.nh=a;this.j=[];this.j.push(this.nh.$_s("screenChange",(0,g.ib)(this.L5,this)));this.j.push(this.nh.$_s("onlineScreenChange",(0,g.ib)(this.Cba,this)))},HIb=function(a,b){NEb();
if(!p8||!p8.get("yt-remote-disable-remote-module-for-dev")){b=g.jA("MDX_CONFIG")||b;EEb();IEb();W9||(W9=new Z8(b?b.loungeApiHost:void 0),OEb()&&(W9.j="/api/loungedev"));X9||(X9=g.Wa("yt.mdx.remote.deferredProxies_")||[],g.Va("yt.mdx.remote.deferredProxies_",X9));DIb();var c=Y9();if(!c){var d=new l9(W9,b?b.disableAutomaticScreenCache||!1:!1);g.Va("yt.mdx.remote.screenService_",d);c=Y9();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.Va("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);VHb(a,d,function(f){f?Z9()&&E9(Z9(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){q8("yt-remote-receiver-availability-change")})},e)}b&&!g.Wa("yt.mdx.remote.initialized_")&&(g.Va("yt.mdx.remote.initialized_",!0),$9("Initializing: "+g.qn(b)),
a$.push(g.qD("yt-remote-cast2-api-ready",function(){q8("yt-remote-api-ready")})),a$.push(g.qD("yt-remote-cast2-availability-change",function(){q8("yt-remote-receiver-availability-change")})),a$.push(g.qD("yt-remote-cast2-receiver-selected",function(){b$(null);
q8("yt-remote-auto-connect","cast-selector-receiver")})),a$.push(g.qD("yt-remote-cast2-receiver-resumed",function(){q8("yt-remote-receiver-resumed","cast-selector-receiver")})),a$.push(g.qD("yt-remote-cast2-session-change",EIb)),a$.push(g.qD("yt-remote-connection-change",function(f){f?E9(Z9(),"YouTube TV"):c$()||(E9(null,null),ZHb())})),a$.push(g.qD("yt-remote-cast2-session-failed",function(){q8("yt-remote-connection-failed")})),a=FIb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.FA("desktop_enable_autoplay")&&
e.push("atp"),e.length>0&&(a.capabilities=e),a.name=b.device,a.app=b.app,(b=b.theme)&&(a.theme=b),$9(" -- with channel params: "+g.qn(a)),a?(g.xB("yt-remote-session-app",a.app),g.xB("yt-remote-session-name",a.name)):(g.zB("yt-remote-session-app"),g.zB("yt-remote-session-name")),g.Va("yt.mdx.remote.channelParams_",a),c.start(),Z9()||GIb())}},IIb=function(){var a=Y9().nh.$_gos();
var b=d$();b&&e$()&&(DEb(a,b)||a.push(b));return CEb(a)},KIb=function(){var a=JIb();
!a&&C9()&&YHb()&&(a={key:"cast-selector-receiver",name:YHb()});return a},JIb=function(){var a=IIb(),b=d$();
b||(b=c$());return g.Cb(a,function(c){return b&&j8(b,c.key)?!0:!1})},d$=function(){var a=Z9();
if(!a)return null;var b=Y9().yl();return l8(b,a)},EIb=function(a){$9("remote.onCastSessionChange_: "+k8(a));
if(a){var b=d$();if(b&&b.id==a.id){if(E9(b.id,"YouTube TV"),a.idType=="shortLived"&&(a=a.token))f$&&(f$.token=a),(b=e$())&&b.Ns(a)}else b&&g$(),h$(a,1)}else e$()&&g$()},g$=function(){D9()?B9().stopSession():A9("stopSession called before API ready.");
var a=e$();a&&(a.disconnect(1),LIb(null))},MIb=function(){var a=e$();
return!!a&&a.getProxyState()!=3},$9=function(a){b9("remote",a)},Y9=function(){if(!NIb){var a=g.Wa("yt.mdx.remote.screenService_");
NIb=a?new CIb(a):null}return NIb},Z9=function(){return g.Wa("yt.mdx.remote.currentScreenId_")},OIb=function(a){g.Va("yt.mdx.remote.currentScreenId_",a)},PIb=function(){return g.Wa("yt.mdx.remote.connectData_")},b$=function(a){g.Va("yt.mdx.remote.connectData_",a)},e$=function(){return g.Wa("yt.mdx.remote.connection_")},LIb=function(a){var b=e$();
b$(null);a||OIb("");g.Va("yt.mdx.remote.connection_",a);X9&&(g.Zb(X9,function(c){c(a)}),X9.length=0);
b&&!a?q8("yt-remote-connection-change",!1):!b&&a&&q8("yt-remote-connection-change",!0)},c$=function(){var a=g.AB();
if(!a)return null;var b=Y9();if(!b)return null;b=b.yl();return l8(b,a)},h$=function(a,b){Z9();
d$()&&d$();if(i$)f$=a;else{OIb(a.id);var c=g.Wa("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new U9(W9,a,FIb(),c);a.connect(b,PIb());a.subscribe("beforeDisconnect",function(d){q8("yt-remote-before-disconnect",d)});
a.subscribe("beforeDispose",function(){e$()&&(e$(),LIb(null))});
a.subscribe("browserChannelAuthError",function(){var d=d$();d&&d.idType=="shortLived"&&(D9()?B9().handleBrowserChannelAuthError():A9("refreshLoungeToken called before API ready."))});
LIb(a)}},GIb=function(){var a=c$();
a?($9("Resume connection to: "+k8(a)),h$(a,0)):(o8(),ZHb(),$9("Skipping connecting because no session screen found."))},DIb=function(){var a=FIb();
if(g.gd(a)){a=n8();var b=g.yB("yt-remote-session-name")||"",c=g.yB("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};a.authuser=String(g.jA("SESSION_INDEX","0"));(b=g.jA("DELEGATED_SESSION_ID"))&&(a.pageId=String(b));g.Va("yt.mdx.remote.channelParams_",a)}},FIb=function(){return g.Wa("yt.mdx.remote.channelParams_")||{}},SIb=function(a,b,c){g.I.call(this);
var d=this;this.module=a;this.J=b;this.Kc=c;this.events=new g.NJ(this);this.Y=this.events.T(this.J,"onVolumeChange",function(e){QIb(d,e)});
this.D=!1;this.G=new g.AK(64);this.j=new g.Dv(this.s2,500,this);this.B=new g.Dv(this.t2,1E3,this);this.N=new t8(this.nfa,0,this);this.C={};this.Z=new g.Dv(this.s3,1E3,this);this.K=new u8(this.seekTo,1E3,this);g.M(this,this.events);this.events.T(b,"onCaptionsTrackListChanged",this.mba);this.events.T(b,"captionschanged",this.Gaa);this.events.T(b,"captionssettingschanged",this.D2);this.events.T(b,"videoplayerreset",this.vL);this.events.T(b,"mdxautoplaycancel",function(){d.Kc.GX()});
b.L("enable_mdx_video_play_directly")&&this.events.T(b,"videodatachange",function(){RIb(d.module)||j$(d)||k$(d,0)});
a=this.Kc;a.Na();a.subscribe("proxyStateChange",this.n0,this);a.subscribe("remotePlayerChange",this.wG,this);a.subscribe("remoteQueueChange",this.vL,this);a.subscribe("previousNextChange",this.k0,this);a.subscribe("nowAutoplaying",this.f0,this);a.subscribe("autoplayDismissed",this.M_,this);g.M(this,this.j);g.M(this,this.B);g.M(this,this.N);g.M(this,this.Z);g.M(this,this.K);this.D2();this.vL();this.wG()},QIb=function(a,b){if(j$(a)){a.Kc.unsubscribe("remotePlayerChange",a.wG,a);
var c=Math.round(b.volume);b=!!b.muted;var d=M9(a.Kc);if(c!==d.volume||b!==d.muted)a.Kc.setVolume(c,b),a.Z.start();a.Kc.subscribe("remotePlayerChange",a.wG,a)}},TIb=function(a){a.Uc(0);
a.j.stop();a.Hc(new g.AK(64))},UIb=function(a,b){if(j$(a)&&!a.D){var c=null;
b&&(c={style:a.J.getSubtitlesUserSettings()},g.md(c,b));a.Kc.uV(a.J.getVideoData(1).videoId,c);a.C=M9(a.Kc).trackData}},k$=function(a,b){var c=a.J.getPlaylist();
if(c==null?0:c.listId){var d=c.index;var e=c.listId.toString()}c=a.J.getVideoData(1);a.Kc.playVideo(c.videoId,b,d,e,c.playerParams,c.va,YDb(c));a.Hc(new g.AK(1))},VIb=function(a,b){if(b){var c=a.J.getOption("captions","tracklist",{lZ:1});
c&&c.length?(a.J.setOption("captions","track",b),a.D=!1):(a.J.loadModule("captions"),a.D=!0)}else a.J.setOption("captions","track",{})},j$=function(a){return M9(a.Kc).videoId===a.J.getVideoData(1).videoId},l$=function(){g.W.call(this,{I:"div",
S:"ytp-mdx-popup-dialog",W:{role:"dialog"},V:[{I:"div",S:"ytp-mdx-popup-dialog-inner-content",V:[{I:"div",S:"ytp-mdx-popup-title",xa:"\u0412\u044b \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430"},{I:"div",S:"ytp-mdx-popup-description",xa:'\u0420\u043e\u043b\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0435, \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 "\u041e\u0442\u043c\u0435\u043d\u0430" \u0438 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.'},
{I:"div",S:"ytp-mdx-privacy-popup-buttons",V:[{I:"button",Ma:["ytp-button","ytp-mdx-privacy-popup-cancel"],xa:"\u041e\u0442\u043c\u0435\u043d\u0430"},{I:"button",Ma:["ytp-button","ytp-mdx-privacy-popup-confirm"],xa:"\u041e\u041a"}]}]}]});this.j=new g.rF(this,250);this.cancelButton=this.Fa("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Fa("ytp-mdx-privacy-popup-confirm");g.M(this,this.j);this.T(this.cancelButton,"click",this.B);this.T(this.confirmButton,"click",this.C)},m$=function(a){g.W.call(this,
{I:"div",
S:"ytp-remote",V:[{I:"div",S:"ytp-remote-display-status",V:[{I:"div",S:"ytp-remote-display-status-icon",V:[g.gya()]},{I:"div",S:"ytp-remote-display-status-text",xa:"{{statustext}}"}]}]});this.api=a;this.j=new g.rF(this,250);g.M(this,this.j);this.T(a,"presentingplayerstatechange",this.onStateChange);this.Ic(a.getPlayerStateObject())},n$=function(a,b){g.BU.call(this,"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430",
1,a,b);
this.J=a;this.hv={};this.T(a,"onMdxReceiversChange",this.D);this.T(a,"presentingplayerstatechange",this.D);this.D()},WIb=function(a){g.gV.call(this,a);
this.mq={key:BEb(),name:"\u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440"};this.xm=null;this.subscriptions=[];this.BS=this.Kc=null;this.hv=[this.mq];this.Nt=this.mq;this.Ie=new g.AK(64);this.MZ=0;this.ri=-1;this.PG=!1;this.OG=this.XB=null;if(!g.tR(this.player.U())&&!g.QF(this.player.U())){a=this.player;var b=g.vT(a);b&&(b=b.Km())&&(b=new n$(a,b),g.M(this,b));b=new m$(a);g.M(this,b);g.HT(a,b.element,4);this.XB=new l$;g.M(this,this.XB);g.HT(a,this.XB.element,4);this.PG=
!!c$()}},o$=function(a){a.OG&&(a.player.removeEventListener("presentingplayerstatechange",a.OG),a.OG=null)},XIb=function(a,b,c){a.Ie=c;
a.player.publish("presentingplayerstatechange",new g.xF(c,b))},p$=function(a,b){if(b.key!==a.Nt.key)if(b.key===a.mq.key)g$();
else if(RIb(a)&&YIb(a),a.Nt=b,!a.player.U().L("disable_mdx_connection_in_mdx_module_for_music_web")||!g.QF(a.player.U())){var c=a.player.getPlaylistId();var d=a.player.getVideoData(1);var e=d.videoId;if(!c&&!e||(a.player.getAppState()===2||a.player.getAppState()===1)&&a.player.U().L("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.dV(f,l).videoId}else h=[e];f=a.player.getCurrentTime(1);a={videoIds:h,listId:c,
videoId:e,playerParams:d.playerParams,clickTrackingParams:d.va,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:f===0?void 0:f};(d=YDb(d))&&(a.locationInfo=d);d=a}$9("Connecting to: "+g.qn(b));b.key=="cast-selector-receiver"?(b$(d||null),b=d||null,D9()?B9().setLaunchParams(b):A9("setLaunchParams called before ready.")):!d&&MIb()&&Z9()==b.key?q8("yt-remote-connection-change",!0):(g$(),b$(d||null),d=Y9().yl(),(b=l8(d,b.key))&&h$(b,1))}},RIb=function(a){var b=a.player.U();
return!b.L("mdx_enable_privacy_disclosure_ui")||a.isLoggedIn()||a.PG||!a.XB?!1:g.ER(b)||g.GR(b)},YIb=function(a){a.player.getPlayerStateObject().isPlaying()?a.player.pauseVideo():(a.OG=function(b){!a.PG&&g.AF(b,8)&&(a.player.pauseVideo(),o$(a))},a.player.addEventListener("presentingplayerstatechange",a.OG));
a.XB&&a.XB.od();e$()||(i$=!0)};
g.k=g8.prototype;g.k.Lm=function(){h8(this);for(var a=[],b=0;b<this.j.length;b++)a.push(this.B[this.j[b]]);return a};
g.k.Yn=function(){h8(this);return this.j.concat()};
g.k.has=function(a){return f8(this.B,a)};
g.k.isEmpty=function(){return this.size==0};
g.k.clear=function(){this.B={};this.Jv=this.size=this.j.length=0};
g.k.remove=function(a){return this.delete(a)};
g.k.delete=function(a){return f8(this.B,a)?(delete this.B[a],--this.size,this.Jv++,this.j.length>2*this.size&&h8(this),!0):!1};
g.k.get=function(a,b){return f8(this.B,a)?this.B[a]:b};
g.k.set=function(a,b){f8(this.B,a)||(this.size+=1,this.j.push(a),this.Jv++);this.B[a]=b};
g.k.forEach=function(a,b){for(var c=this.Yn(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};
g.k.clone=function(){return new g8(this)};
g.k.keys=function(){return g.Fla(this.tm(!0)).j()};
g.k.values=function(){return g.Fla(this.tm(!1)).j()};
g.k.entries=function(){var a=this;return qEb(this.keys(),function(b){return[b,a.get(b)]})};
g.k.tm=function(a){h8(this);var b=0,c=this.Jv,d=this,e=new g.Ht;e.next=function(){if(c!=d.Jv)throw Error("The map has changed since the iterator was created");if(b>=d.j.length)return g.n2;var f=d.j[b++];return g.It(a?f:d.B[f])};
return e};
var vEb={kra:"atp",I9a:"ska",N5a:"que",SXa:"mus",G9a:"sus",DIa:"dsp",E7a:"seq",pWa:"mic",Vya:"dpa",Msa:"cds",GXa:"mlm",Jya:"dsdtr",sYa:"ntb",Elb:"vsp",Kza:"scn",b6a:"rpe",Gya:"dcn",Hya:"dcp",m2a:"pas",Iya:"drq",S0a:"opf",Jza:"els",W7a:"svq",HXa:"mvp"},wEb={b7:"u",d4:"cl",G6:"k",D4:"i",g4:"cr",N6:"m",y4:"g",qW:"up"},HEb="",p8=null;
PEb.prototype.flush=function(a,b){a=a===void 0?[]:a;b=b===void 0?!1:b;if(g.FA("enable_client_streamz_web")){a=g.v(a);for(var c=a.next();!c.done;c=a.next())c=g.kfa(c.value),c={serializedIncrementBatch:g.Bg(c.j())},g.VB("streamzIncremented",c,{sendIsolatedPayload:b})}};
var r8,XEb=REb("loadCastFramework")||REb("loadCastApplicationFramework"),$Eb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.lb(t8,g.I);g.k=t8.prototype;g.k.p5=function(a){this.D=arguments;this.j=!1;this.rd?this.C=g.kb()+this.aj:this.rd=g.ng(this.G,this.aj)};
g.k.stop=function(){this.rd&&(g.Ua.clearTimeout(this.rd),this.rd=null);this.C=null;this.j=!1;this.D=[]};
g.k.pause=function(){++this.B};
g.k.resume=function(){this.B&&(--this.B,!this.B&&this.j&&(this.j=!1,this.K.apply(null,this.D)))};
g.k.ya=function(){this.stop();t8.Rf.ya.call(this)};
g.k.q5=function(){this.rd&&(g.Ua.clearTimeout(this.rd),this.rd=null);this.C?(this.rd=g.ng(this.G,this.C-g.kb()),this.C=null):this.B?this.j=!0:(this.j=!1,this.K.apply(null,this.D))};g.x(u8,g.I);g.k=u8.prototype;g.k.eN=function(a){this.C=arguments;this.rd||this.B?this.j=!0:bFb(this)};
g.k.stop=function(){this.rd&&(g.Ua.clearTimeout(this.rd),this.rd=null,this.j=!1,this.C=null)};
g.k.pause=function(){this.B++};
g.k.resume=function(){this.B--;this.B||!this.j||this.rd||(this.j=!1,bFb(this))};
g.k.ya=function(){g.I.prototype.ya.call(this);this.stop()};v8.prototype.stringify=function(a){return g.Ua.JSON.stringify(a,void 0)};
v8.prototype.parse=function(a){return g.Ua.JSON.parse(a,void 0)};g.lb(cFb,g.yb);g.lb(dFb,g.yb);var eFb=null;g.lb(gFb,g.yb);g.lb(hFb,g.yb);g.lb(iFb,g.yb);z8.prototype.debug=function(){};
z8.prototype.info=function(){};
z8.prototype.warning=function(){};var qFb={},pFb={};g.k=A8.prototype;g.k.setTimeout=function(a){this.ib=a};
g.k.s5=function(a){a=a.target;var b=this.Xa;b&&g.Ao(a)==3?b.eN():this.YU(a)};
g.k.YU=function(a){try{if(a==this.j)a:{var b=g.Ao(this.j),c=this.j.B,d=this.j.getStatus();if(!(b<3)&&(b!=3||this.j&&(this.B.B||g.Co(this.j)||g.Do(this.j)))){this.La||b!=4||c==7||(c==8||d<=0?w8(3):w8(2));tFb(this);var e=this.j.getStatus();this.Kb=e;var f=oFb(this);if(this.K=e==200){if(this.Ab&&!this.Wa){b:{if(this.j){var h=g.Eo(this.j,"X-HTTP-Initial-Response");if(h&&!g.fc(h)){var l=h;break b}}l=null}if(a=l)this.Wa=!0,CFb(this,a);else{this.K=!1;this.G=3;x8(12);C8(this);D8(this);break a}}if(this.Ga){a=
!0;for(var m;!this.La&&this.N<f.length;)if(m=rFb(this,f),m==pFb){b==4&&(this.G=4,x8(14),a=!1);break}else if(m==qFb){this.G=4;x8(15);a=!1;break}else CFb(this,m);nFb(this)&&this.N!=0&&(this.B.j=this.B.j.slice(this.N),this.N=0);b!=4||f.length!=0||this.B.B||(this.G=1,x8(16),a=!1);this.K=this.K&&a;a?f.length>0&&!this.Lb&&(this.Lb=!0,this.C.KR(this)):(C8(this),D8(this))}else CFb(this,f);b==4&&C8(this);this.K&&!this.La&&(b==4?uFb(this.C,this):(this.K=!1,B8(this)))}else g.Yfa(this.j),e==400&&f.indexOf("Unknown SID")>
0?(this.G=3,x8(12)):(this.G=0,x8(13)),C8(this),D8(this)}}}catch(n){}finally{}};
g.k.cancel=function(){this.La=!0;C8(this)};
g.k.r5=function(){this.ra=null;var a=Date.now();a-this.rb>=0?(this.Sa!=2&&(w8(3),x8(17)),C8(this),this.G=2,D8(this)):sFb(this,this.rb-a)};
g.k.getLastError=function(){return this.G};
g.k.bQ=function(){return this.j};EFb.prototype.cancel=function(){this.C=GFb(this);if(this.B)this.B.cancel(),this.B=null;else if(this.j&&this.j.size!==0){for(var a=g.v(this.j.values()),b=a.next();!b.done;b=a.next())b.value.cancel();this.j.clear()}};g.k=LFb.prototype;g.k.ZU=8;g.k.Vh=1;g.k.connect=function(a,b,c,d){x8(0);this.Ub=a;this.La=b||{};c&&d!==void 0&&(this.La.OSID=c,this.La.OAID=d);this.Wa=this.Bc;this.Oa=zFb(this,null,this.Ub);H8(this)};
g.k.disconnect=function(){NFb(this);if(this.Vh==3){var a=this.eb++,b=this.Oa.clone();g.sq(b,"SID",this.D);g.sq(b,"RID",a);g.sq(b,"TYPE","terminate");K8(this,b);a=new A8(this,this.D,a);a.Sa=2;a.Z=b8(b.clone());b=!1;if(g.Ua.navigator&&g.Ua.navigator.sendBeacon)try{b=g.Ua.navigator.sendBeacon(a.Z.toString(),"")}catch(c){}!b&&g.Ua.Image&&((new Image).src=a.Z,b=!0);b||(a.j=mFb(a.C,null),a.j.send(a.Z));a.Da=Date.now();B8(a)}TFb(this)};
g.k.Sg=function(){return this.Vh==0};
g.k.getState=function(){return this.Vh};
g.k.bV=function(a){if(this.K)if(this.K=null,this.Vh==1){if(!a){this.eb=Math.floor(Math.random()*1E5);a=this.eb++;var b=new A8(this,"",a),c=this.Y;this.Kb&&(c?(c=g.jd(c),g.md(c,this.Kb)):c=this.Kb);this.N!==null||this.rb||(b.Oa=c,c=null);var d;if(this.Cb)a:{for(var e=d=0;e<this.C.length;e++){b:{var f=this.C[e];if("__data__"in f.map&&(f=f.map.__data__,typeof f==="string")){f=f.length;break b}f=void 0}if(f===void 0)break;d+=f;if(d>4096){d=e;break a}if(d===4096||e===this.C.length-1){d=e+1;break a}}d=
1E3}else d=1E3;d=QFb(this,b,d);e=this.Oa.clone();g.sq(e,"RID",a);g.sq(e,"CVER",22);this.Ga&&g.sq(e,"X-HTTP-Session-Id",this.Ga);K8(this,e);c&&(this.rb?d="headers="+g.Ze(g.Lga(c))+"&"+d:this.N&&g.wq(e,this.N,c));yFb(this.B,b);this.Wf&&g.sq(e,"TYPE","init");this.Cb?(g.sq(e,"$req",d),g.sq(e,"SID","null"),b.Ab=!0,lFb(b,e,null)):lFb(b,e,d);this.Vh=2}}else this.Vh==3&&(a?RFb(this,a):this.C.length==0||FFb(this.B)||RFb(this))};
g.k.aV=function(){this.Z=null;SFb(this);if(this.Cc&&!(this.ib||this.j==null||this.Zc<=0)){var a=2*this.Zc;this.Ha=y8((0,g.ib)(this.Faa,this),a)}};
g.k.Faa=function(){this.Ha&&(this.Ha=null,this.Wa=!1,this.ib=!0,x8(10),F8(this),SFb(this))};
g.k.KR=function(a){this.j==a&&this.Cc&&!this.ib&&(MFb(this),this.ib=!0,x8(11))};
g.k.t5=function(){this.ra!=null&&(this.ra=null,F8(this),wFb(this),x8(19))};
g.k.Qea=function(a){a?x8(2):x8(1)};
g.k.isActive=function(){return!!this.G&&this.G.isActive(this)};
g.k=VFb.prototype;g.k.fV=function(){};
g.k.eV=function(){};
g.k.dV=function(){};
g.k.cV=function(){};
g.k.isActive=function(){return!0};
g.k.u5=function(){};g.lb(M8,g.Fd);M8.prototype.open=function(){this.j.G=this.C;this.K&&(this.j.Sa=!0);this.j.connect(this.G,this.B||void 0)};
M8.prototype.close=function(){this.j.disconnect()};
M8.prototype.send=function(a){var b=this.j;if(typeof a==="string"){var c={};c.__data__=a;a=c}else this.D&&(c={},c.__data__=g.qn(a),a=c);b.C.push(new DFb(b.Uf++,a));b.Vh==3&&H8(b)};
M8.prototype.ya=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;M8.Rf.ya.call(this)};
g.lb(XFb,cFb);g.lb(YFb,dFb);g.lb(L8,VFb);L8.prototype.fV=function(){this.j.dispatchEvent("m")};
L8.prototype.eV=function(a){this.j.dispatchEvent(new XFb(a))};
L8.prototype.dV=function(a){this.j.dispatchEvent(new YFb(a))};
L8.prototype.cV=function(){this.j.dispatchEvent("n")};var O8=new g.Fd;g.x(aGb,g.yb);g.k=Q8.prototype;g.k.Xv=null;g.k.nt=!1;g.k.iz=null;g.k.gN=null;g.k.tD=null;g.k.lI=null;g.k.qD=null;g.k.kI=null;g.k.Zv=null;g.k.sj=null;g.k.nI=0;g.k.R2=null;g.k.mI=null;g.k.Yv=null;g.k.sD=-1;g.k.M1=!0;g.k.rD=!1;g.k.fN=0;g.k.jI=null;var gGb={},fGb={};g.k=Q8.prototype;g.k.setTimeout=function(a){this.B=a};
g.k.w5=function(a){a=a.target;var b=this.jI;b&&g.Ao(a)==3?b.eN():this.gV(a)};
g.k.gV=function(a){try{if(a==this.sj)a:{var b=g.Ao(this.sj),c=this.sj.B,d=this.sj.getStatus();if(g.Nc&&!g.Mc("420+")){if(b<4)break a}else if(b<3||b==3&&!g.Co(this.sj))break a;this.rD||b!=4||c==7||(c==8||d<=0?this.j.zs(3):this.j.zs(2));jGb(this);var e=this.sj.getStatus();this.sD=e;var f=g.Co(this.sj);if(this.nt=e==200){b==4&&R8(this);if(this.Ga){for(a=!0;!this.rD&&this.nI<f.length;){var h=hGb(this,f);if(h==fGb){b==4&&(this.Yv=4,P8(15),a=!1);break}else if(h==gGb){this.Yv=4;P8(16);a=!1;break}else lGb(this,
h)}b==4&&f.length==0&&(this.Yv=1,P8(17),a=!1);this.nt=this.nt&&a;a||(R8(this),kGb(this))}else lGb(this,f);this.nt&&!this.rD&&(b==4?this.j.jN(this):(this.nt=!1,eGb(this)))}else e==400&&f.indexOf("Unknown SID")>0?(this.Yv=3,P8(13)):(this.Yv=0,P8(14)),R8(this),kGb(this)}}catch(l){}finally{}};
g.k.cancel=function(){this.rD=!0;R8(this)};
g.k.v5=function(){this.iz=null;var a=Date.now();a-this.gN>=0?(this.lI!=2&&this.j.zs(3),R8(this),this.Yv=2,P8(18),kGb(this)):iGb(this,this.gN-a)};
g.k.getLastError=function(){return this.Yv};g.k=oGb.prototype;g.k.iN=null;g.k.Zk=null;g.k.TL=!1;g.k.kN=null;g.k.hm=null;g.k.ir=-1;g.k.oI=null;g.k.hE=null;g.k.connect=function(a){this.kN=a;a=T8(this.j,null,this.kN);P8(3);Date.now();var b=this.j.Y;b!=null?(this.oI=b[0],(this.hE=b[1])?(this.hm=1,pGb(this)):(this.hm=2,qGb(this))):(c8(a,"MODE","init"),this.Zk=new Q8(this),this.Zk.Xv=this.iN,dGb(this.Zk,a,!1,null,!0),this.hm=0)};
g.k.K7=function(a){if(a)this.hm=2,qGb(this);else{P8(4);var b=this.j;b.vp=b.Kt.ir;X8(b,9)}a&&this.zs(2)};
g.k.hN=function(a){return this.j.hN(a)};
g.k.abort=function(){this.Zk&&(this.Zk.cancel(),this.Zk=null);this.ir=-1};
g.k.Sg=function(){return!1};
g.k.hV=function(a,b){this.ir=a.sD;if(this.hm==0)if(b){try{var c=this.B.parse(b)}catch(d){a=this.j;a.vp=this.ir;X8(a,2);return}this.oI=c[0];this.hE=c[1]}else a=this.j,a.vp=this.ir,X8(a,2);else this.hm==2&&(this.TL?(P8(7),Date.now()):b=="11111"?(P8(6),this.TL=!0,Date.now(),this.ir=200,this.Zk.cancel(),P8(12),U8(this.j,this,!0)):(P8(8),Date.now(),this.TL=!1))};
g.k.jN=function(){this.ir=this.Zk.sD;if(this.Zk.nt)this.hm==0?this.hE?(this.hm=1,pGb(this)):(this.hm=2,qGb(this)):this.hm==2&&(this.TL?(P8(12),U8(this.j,this,!0)):(P8(11),U8(this.j,this,!1)));else{this.hm==0?P8(9):this.hm==2&&P8(10);var a=this.j;this.Zk.getLastError();a.vp=this.ir;X8(a,2)}};
g.k.uD=function(){return this.j.uD()};
g.k.isActive=function(){return this.j.isActive()};
g.k.zs=function(a){this.j.zs(a)};g.k=rGb.prototype;g.k.tp=null;g.k.vD=null;g.k.qk=null;g.k.Zg=null;g.k.mN=null;g.k.pI=null;g.k.iV=null;g.k.lN=null;g.k.wD=0;g.k.y5=0;g.k.Si=null;g.k.qt=null;g.k.jr=null;g.k.dw=null;g.k.Kt=null;g.k.OM=null;g.k.lz=-1;g.k.jV=-1;g.k.vp=-1;g.k.kz=0;g.k.jz=0;g.k.cw=8;g.lb(tGb,g.yb);g.lb(uGb,g.yb);g.k=rGb.prototype;g.k.connect=function(a,b,c,d,e){P8(0);this.mN=b;this.vD=c||{};d&&e!==void 0&&(this.vD.OSID=d,this.vD.OAID=e);this.Z?(N8((0,g.ib)(this.sX,this,a),100),wGb(this)):this.sX(a)};
g.k.disconnect=function(){xGb(this);if(this.j==3){var a=this.wD++,b=this.pI.clone();g.sq(b,"SID",this.D);g.sq(b,"RID",a);g.sq(b,"TYPE","terminate");W8(this,b);a=new Q8(this,this.D,a);a.lI=2;a.qD=b8(b.clone());(new Image).src=a.qD.toString();a.tD=Date.now();eGb(a)}HGb(this)};
g.k.sX=function(a){this.Kt=new oGb(this);this.Kt.iN=this.tp;this.Kt.B=this.G;this.Kt.connect(a)};
g.k.Sg=function(){return this.j==0};
g.k.getState=function(){return this.j};
g.k.lV=function(a){this.qt=null;CGb(this,a)};
g.k.kV=function(){this.jr=null;this.Zg=new Q8(this,this.D,"rpc",this.N);this.Zg.Xv=this.tp;this.Zg.fN=0;var a=this.iV.clone();g.sq(a,"RID","rpc");g.sq(a,"SID",this.D);g.sq(a,"CI",this.OM?"0":"1");g.sq(a,"AID",this.lz);W8(this,a);g.sq(a,"TYPE","xmlhttp");dGb(this.Zg,a,!0,this.lN,!1)};
g.k.hV=function(a,b){if(this.j!=0&&(this.Zg==a||this.qk==a))if(this.vp=a.sD,this.qk==a&&this.j==3)if(this.cw>7){try{var c=this.G.parse(b)}catch(d){c=null}if(Array.isArray(c)&&c.length==3)if(a=c,a[0]==0)a:{if(!this.jr){if(this.Zg)if(this.Zg.tD+3E3<this.qk.tD)V8(this),this.Zg.cancel(),this.Zg=null;else break a;FGb(this);P8(19)}}else this.jV=a[1],0<this.jV-this.lz&&a[2]<37500&&this.OM&&this.jz==0&&!this.dw&&(this.dw=N8((0,g.ib)(this.z5,this),6E3));else X8(this,11)}else b!=null&&X8(this,11);else if(this.Zg==
a&&V8(this),!g.fc(b))for(a=this.G.parse(b),b=0;b<a.length;b++)c=a[b],this.lz=c[0],c=c[1],this.j==2?c[0]=="c"?(this.D=c[1],this.lN=c[2],c=c[3],c!=null?this.cw=c:this.cw=6,this.j=3,this.Si&&this.Si.oV(),this.iV=T8(this,this.uD()?this.lN:null,this.mN),DGb(this)):c[0]=="stop"&&X8(this,7):this.j==3&&(c[0]=="stop"?X8(this,7):c[0]!="noop"&&this.Si&&this.Si.nV(c),this.jz=0)};
g.k.z5=function(){this.dw!=null&&(this.dw=null,this.Zg.cancel(),this.Zg=null,FGb(this),P8(20))};
g.k.jN=function(a){if(this.Zg==a){V8(this);this.Zg=null;var b=2}else if(this.qk==a)this.qk=null,b=1;else return;this.vp=a.sD;if(this.j!=0)if(a.nt)if(b==1){b=a.Zv?a.Zv.length:0;a=Date.now()-a.tD;var c=O8;c.dispatchEvent(new tGb(c,b,a,this.kz));vGb(this);this.C.length=0}else DGb(this);else{c=a.getLastError();var d;if(!(d=c==3||c==7||c==0&&this.vp>0)){if(d=b==1)this.qk||this.qt||this.j==1||this.kz>=2?d=!1:(this.qt=N8((0,g.ib)(this.lV,this,a),EGb(this,this.kz)),this.kz++,d=!0);d=!(d||b==2&&FGb(this))}if(d)switch(c){case 1:X8(this,
5);break;case 4:X8(this,10);break;case 3:X8(this,6);break;case 7:X8(this,12);break;default:X8(this,2)}}};
g.k.x5=function(a){if(!g.Eb(arguments,this.j))throw Error("Unexpected channel state: "+this.j);};
g.k.Pea=function(a){a?P8(2):(P8(1),GGb(this,8))};
g.k.hN=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.xo;a.K=!1;return a};
g.k.isActive=function(){return!!this.Si&&this.Si.isActive(this)};
g.k.zs=function(a){var b=O8;b.dispatchEvent(new uGb(b,a))};
g.k.uD=function(){return!1};
g.k=IGb.prototype;g.k.oV=function(){};
g.k.nV=function(){};
g.k.mV=function(){};
g.k.nN=function(){};
g.k.pV=function(){return{}};
g.k.isActive=function(){return!0};g.k=JGb.prototype;g.k.enqueue=function(a){this.B.push(a)};
g.k.isEmpty=function(){return this.j.length===0&&this.B.length===0};
g.k.clear=function(){this.j=[];this.B=[]};
g.k.contains=function(a){return g.Eb(this.j,a)||g.Eb(this.B,a)};
g.k.remove=function(a){var b=this.j;var c=(0,g.Lkb)(b,a);c>=0?(g.Fb(b,c),b=!0):b=!1;return b||g.Gb(this.B,a)};
g.k.Lm=function(){for(var a=[],b=this.j.length-1;b>=0;--b)a.push(this.j[b]);var c=this.B.length;for(b=0;b<c;++b)a.push(this.B[b]);return a};g.x(KGb,g.yb);g.x(LGb,g.yb);g.lb(Y8,g.I);g.k=Y8.prototype;g.k.Ica=function(){this.aj=Math.min(3E5,this.aj*2);this.C();this.B&&this.start()};
g.k.start=function(){var a=this.aj+15E3*Math.random();g.Ev(this.j,a);this.B=Date.now()+a};
g.k.stop=function(){this.j.stop();this.B=0};
g.k.isActive=function(){return this.j.isActive()};
g.k.reset=function(){this.j.stop();this.aj=5E3};g.lb(NGb,IGb);g.k=NGb.prototype;g.k.subscribe=function(a,b,c){return this.C.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.C.unsubscribe(a,b,c)};
g.k.Uh=function(a){return this.C.Uh(a)};
g.k.publish=function(a,b){return this.C.publish.apply(this.C,arguments)};
g.k.dispose=function(){this.ra||(this.ra=!0,g.ub(this.C),this.disconnect(),g.ub(this.B),this.B=null,this.va=function(){return""})};
g.k.Na=function(){return this.ra};
g.k.connect=function(a,b,c){if(!this.j||this.j.getState()!=2){this.Y="";this.B.stop();this.K=a||null;this.G=b||0;a=this.Da+"/test";b=this.Da+"/bind";var d=new rGb(c?c.firstTestResults:null,c?c.secondTestResults:null,this.Sa),e=this.j;e&&(e.Si=null);d.Si=this;this.j=d;OGb(this);if(this.j){d=g.jA("ID_TOKEN");var f=this.j.tp||{};d?f["x-youtube-identity-token"]=d:delete f["x-youtube-identity-token"];this.j.tp=f}e?(e.getState()!=3&&zGb(e)==0||e.getState(),this.j.connect(a,b,this.N,e.D,e.lz)):c?this.j.connect(a,
b,this.N,c.sessionId,c.arrayId):this.j.connect(a,b,this.N)}};
g.k.disconnect=function(a){this.Z=a||0;this.B.stop();OGb(this);this.j&&(this.j.getState()==3&&CGb(this.j),this.j.disconnect());this.Z=0};
g.k.sendMessage=function(a,b){a={_sc:a};b&&g.md(a,b);this.B.isActive()||(this.j?this.j.getState():0)==2?this.D.push(a):this.OA()&&(OGb(this),yGb(this.j,a))};
g.k.oV=function(){this.B.reset();this.K=null;this.G=0;if(this.D.length){var a=this.D;this.D=[];for(var b=0,c=a.length;b<c;++b)yGb(this.j,a[b])}this.publish("handlerOpened");hEb(this.Oa,"BROWSER_CHANNEL")};
g.k.mV=function(a){var b=a==2&&this.j.vp==401;a==4||b||this.B.start();this.publish("handlerError",a,b);nEb(this.Ga,"BROWSER_CHANNEL")};
g.k.nN=function(a,b){if(!this.B.isActive())this.publish("handlerClosed");else if(b)for(var c=0,d=b.length;c<d;++c){var e=b[c].map;e&&this.D.push(e)}jEb(this.Ha,"BROWSER_CHANNEL");a&&this.Xa.j.pN("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",a.length);b&&this.eb.j.pN("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",b.length)};
g.k.pV=function(){var a={v:2};this.Y&&(a.gsessionid=this.Y);this.G!=0&&(a.ui=""+this.G);this.Z!=0&&(a.ui=""+this.Z);this.K&&g.md(a,this.K);return a};
g.k.nV=function(a){a[0]=="S"?this.Y=a[1]:a[0]=="gracefulReconnect"?(this.B.start(),this.j.disconnect()):this.publish("handlerMessage",new MGb(a[0],a[1]));lEb(this.La,"BROWSER_CHANNEL")};
g.k.OA=function(){return!!this.j&&this.j.getState()==3};
g.k.Ns=function(a){(this.N.loungeIdToken=a)||this.B.stop();if(this.Wa&&this.j){var b=this.j.tp||{};a?b["X-YouTube-LoungeId-Token"]=a:delete b["X-YouTube-LoungeId-Token"];this.j.tp=b}};
g.k.getDeviceId=function(){return this.N.id};
g.k.du=function(){return this.B.isActive()?this.B.B-Date.now():NaN};
g.k.yy=function(){var a=this.B;g.Fv(a.j);a.start()};
g.k.Vda=function(){this.B.isActive();zGb(this.j)==0&&this.connect(this.K,this.G)};Z8.prototype.sendRequest=function(a,b,c,d,e,f,h){a={format:f?"RAW":"JSON",method:a,context:this,timeout:5E3,withCredentials:!!h,onSuccess:g.jb(this.D,d,!f),onError:g.jb(this.C,e),onTimeout:g.jb(this.G,e)};c&&(a.postParams=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.HA(b,a)};
Z8.prototype.D=function(a,b,c,d){b?a(d):a({text:c.responseText})};
Z8.prototype.C=function(a,b){a(Error("Request error: "+b.status))};
Z8.prototype.G=function(a){a(Error("request timed out"))};g.x(PGb,g.Fd);g.k=PGb.prototype;g.k.connect=function(a,b,c){this.Hd.connect(a,b,c)};
g.k.disconnect=function(a){this.Hd.disconnect(a)};
g.k.yy=function(){this.Hd.yy()};
g.k.getDeviceId=function(){return this.Hd.getDeviceId()};
g.k.du=function(){return this.Hd.du()};
g.k.OA=function(){return this.Hd.OA()};
g.k.A5=function(){this.dispatchEvent("channelOpened");var a=this.Hd,b=this.j;g.xB("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!a.j.OM,sessionId:a.j.D,arrayId:a.j.lz});g.xB("yt-remote-session-screen-id",b);a=m8();b=n8();g.Eb(a,b)||a.push(b);GEb(a);IEb()};
g.k.onClosed=function(){this.dispatchEvent("channelClosed")};
g.k.onMessage=function(a){this.dispatchEvent(new KGb(a))};
g.k.onError=function(a){this.dispatchEvent(new LGb(a?1:0))};
g.k.sendMessage=function(a,b){this.Hd.sendMessage(a,b)};
g.k.Ns=function(a){this.Hd.Ns(a)};
g.k.dispose=function(){this.Hd.dispose()};g.k=QGb.prototype;
g.k.connect=function(a,b){a=a===void 0?{}:a;b=b===void 0?0:b;this.K!==2&&(this.C.stop(),this.Z=a,this.N=b,SGb(this),(a=g.jA("ID_TOKEN"))?this.D["x-youtube-identity-token"]=a:delete this.D["x-youtube-identity-token"],this.j&&(this.B.device=this.j.device,this.B.name=this.j.name,this.B.app=this.j.app,this.B.id=this.j.id,this.j.U$&&(this.B.mdxVersion=""+this.j.U$),this.j.theme&&(this.B.theme=this.j.theme),this.j.capabilities&&(this.B.capabilities=this.j.capabilities),this.j.a8&&(this.B.cst=this.j.a8),
this.j.authuser&&(this.B.authuser=this.j.authuser),this.j.pageId&&(this.B.pageId=this.j.pageId)),this.N!==0?this.B.ui=""+this.N:delete this.B.ui,Object.assign(this.B,this.Z),this.channel=new M8(this.pathPrefix,{i$:"gsessionid",Y$:this.D,Z$:this.B}),this.channel.open(),this.K=2,RGb(this))};
g.k.disconnect=function(a){this.Y=a===void 0?0:a;this.C.stop();SGb(this);this.channel&&(this.Y!==0?this.B.ui=""+this.Y:delete this.B.ui,this.channel.close());this.Y=0};
g.k.du=function(){return this.C.isActive()?this.C.B-Date.now():NaN};
g.k.yy=function(){var a=this.C;g.Fv(a.j);a.start()};
g.k.sendMessage=function(a,b){this.channel&&(SGb(this),a=Object.assign({},{_sc:a},b),this.channel.send(a))};
g.k.Ns=function(a){a||this.C.stop();a?this.D["X-YouTube-LoungeId-Token"]=a:delete this.D["X-YouTube-LoungeId-Token"]};
g.k.getDeviceId=function(){return this.j?this.j.id:""};
g.k.publish=function(a){return this.G.publish.apply(this.G,[a].concat(g.ra(g.Ja.apply(1,arguments))))};
g.k.subscribe=function(a,b,c){return this.G.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.G.unsubscribe(a,b,c)};
g.k.Uh=function(a){return this.G.Uh(a)};
g.k.dispose=function(){this.ra||(this.ra=!0,g.ub(this.G),this.disconnect(),g.ub(this.C),this.Da=function(){return""})};
g.k.Na=function(){return this.ra};g.x(TGb,g.Fd);g.k=TGb.prototype;g.k.connect=function(a,b){this.j.connect(a,b)};
g.k.disconnect=function(a){this.j.disconnect(a)};
g.k.yy=function(){this.j.yy()};
g.k.getDeviceId=function(){return this.j.getDeviceId()};
g.k.du=function(){return this.j.du()};
g.k.OA=function(){return this.j.K===3};
g.k.B5=function(){this.dispatchEvent("channelOpened")};
g.k.onClosed=function(){this.dispatchEvent("channelClosed")};
g.k.onMessage=function(a){this.dispatchEvent(new KGb(a))};
g.k.onError=function(){this.dispatchEvent(new LGb(this.j.Dg===401?1:0))};
g.k.sendMessage=function(a,b){this.j.sendMessage(a,b)};
g.k.Ns=function(a){this.j.Ns(a)};
g.k.dispose=function(){this.j.dispose()};var aHb=Date.now(),a9=null,e9=Array(50),d9=-1,f9=!1;g.lb(g9,g.GE);g9.prototype.yl=function(){return this.screens};
g9.prototype.contains=function(a){return!!DEb(this.screens,a)};
g9.prototype.get=function(a){return a?l8(this.screens,a):null};
g9.prototype.info=function(a){b9(this.K,a)};g.x(eHb,g.GE);g.k=eHb.prototype;g.k.start=function(){!this.j&&isNaN(this.rd)&&this.Q0()};
g.k.stop=function(){this.j&&(this.j.abort(),this.j=null);isNaN(this.rd)||(g.DA(this.rd),this.rd=NaN)};
g.k.ya=function(){this.stop();g.GE.prototype.ya.call(this)};
g.k.Q0=function(){this.rd=NaN;this.j=g.HA($8(this.C,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.N},timeout:5E3,onSuccess:(0,g.ib)(this.D5,this),onError:(0,g.ib)(this.C5,this),onTimeout:(0,g.ib)(this.E5,this)})};
g.k.D5=function(a,b){this.j=null;a=b.screen||{};a.dialId=this.D;a.name=this.K;b=-1;this.G&&a.shortLivedLoungeToken&&a.shortLivedLoungeToken.value&&a.shortLivedLoungeToken.refreshIntervalMs&&(a.screenIdType="shortLived",a.loungeToken=a.shortLivedLoungeToken.value,b=a.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new i8(a),b)};
g.k.C5=function(a){this.j=null;a.status&&a.status==404?this.B>=ZIb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=ZIb[this.B],this.rd=g.BA((0,g.ib)(this.Q0,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))};
g.k.E5=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))};
var ZIb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.lb(i9,g9);g.k=i9.prototype;g.k.start=function(){h9(this)&&this.publish("screenChange");!g.yB("yt-remote-lounge-token-expiration")&&fHb(this);g.DA(this.j);this.j=g.BA((0,g.ib)(this.start,this),1E4)};
g.k.add=function(a,b){h9(this);bHb(this,a);j9(this,!1);this.publish("screenChange");b(a);a.token||fHb(this)};
g.k.remove=function(a,b){var c=h9(this);dHb(this,a)&&(j9(this,!1),c=!0);b(a);c&&this.publish("screenChange")};
g.k.MM=function(a,b,c,d){var e=h9(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,j9(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.publish("screenChange")};
g.k.ya=function(){g.DA(this.j);i9.Rf.ya.call(this)};
g.k.H9=function(a){h9(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)}j9(this,!b);b&&b9(this.K,"Missed "+b+" lounge tokens.")};
g.k.G9=function(a){b9(this.K,"Requesting lounge tokens failed: "+a)};g.x(hHb,g.GE);g.k=hHb.prototype;g.k.start=function(){var a=parseInt(g.yB("yt-remote-fast-check-period")||"0",10);(this.D=g.kb()-144E5<a?0:a)?k9(this):(this.D=g.kb()+3E5,g.xB("yt-remote-fast-check-period",this.D),this.WS())};
g.k.isEmpty=function(){return g.gd(this.j)};
g.k.update=function(){gHb("Updating availability on schedule.");var a=this.K(),b=g.Uc(this.j,function(c,d){return c&&!!l8(a,d)},this);
kHb(this,b)};
g.k.ya=function(){g.DA(this.C);this.C=NaN;this.B&&(this.B.abort(),this.B=null);g.GE.prototype.ya.call(this)};
g.k.WS=function(){g.DA(this.C);this.C=NaN;this.B&&this.B.abort();var a=lHb(this);if($Db(a)){var b=$8(this.G,"/pairing/get_screen_availability");this.B=this.G.sendRequest("POST",b,{lounge_token:g.bd(a).join(",")},(0,g.ib)(this.qca,this,a),(0,g.ib)(this.pca,this))}else kHb(this,{}),k9(this)};
g.k.qca=function(a,b){this.B=null;var c=g.bd(lHb(this));if(g.Wb(c,g.bd(a))){b=b.screens||[];c={};for(var d=b.length,e=0;e<d;++e)c[a[b[e].loungeToken]]=b[e].status=="online";kHb(this,c);k9(this)}else this.hg("Changing Screen set during request."),this.WS()};
g.k.pca=function(a){this.hg("Screen availability failed: "+a);this.B=null;k9(this)};
g.k.hg=function(a){b9("OnlineScreenService",a)};g.lb(l9,g9);g.k=l9.prototype;g.k.start=function(){this.B.start();this.j.start();this.screens.length&&(this.publish("screenChange"),this.j.isEmpty()||this.publish("onlineScreenChange"))};
g.k.add=function(a,b,c){this.B.add(a,b,c)};
g.k.remove=function(a,b,c){this.B.remove(a,b,c);this.j.update()};
g.k.MM=function(a,b,c,d){this.B.contains(a)?this.B.MM(a,b,c,d):(a="Updating name of unknown screen: "+a.name,b9(this.K,a),d(Error(a)))};
g.k.yl=function(a){return a?this.screens:g.Jb(this.screens,g.Mt(this.C,function(b){return!this.contains(b)},this))};
g.k.qV=function(){return g.Mt(this.yl(!0),function(a){return!!this.j.j[a.id]},this)};
g.k.rV=function(a,b,c,d,e,f){var h=this;this.info("getDialScreenByPairingCode "+a+" / "+b);var l=new eHb(this.D,a,b,c,d);l.subscribe("pairingComplete",function(m,n){g.ub(l);e(m9(h,m),n)});
l.subscribe("pairingFailed",function(m){g.ub(l);f(m)});
l.start();return(0,g.ib)(l.stop,l)};
g.k.F5=function(a,b,c,d){g.HA($8(this.D,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:a},timeout:5E3,onSuccess:(0,g.ib)(function(e,f){e=new i8(f.screen||{});if(!e.name||pHb(this,e.name)){a:{f=e.name;for(var h=2,l=b(f,h);pHb(this,l);){h++;if(h>20)break a;l=b(f,h)}f=l}e.name=f}c(m9(this,e))},this),
onError:(0,g.ib)(function(e){d(Error("pairing request failed: "+e.status))},this),
onTimeout:(0,g.ib)(function(){d(Error("pairing request timed out."))},this)})};
g.k.ya=function(){g.ub(this.B);g.ub(this.j);l9.Rf.ya.call(this)};
g.k.R9=function(){rHb(this);this.publish("screenChange");this.j.update()};
l9.prototype.dispose=l9.prototype.dispose;g.lb(n9,g.GE);g.k=n9.prototype;g.k.Hj=function(a){this.Na()||(a&&(p9(this,""+a),this.publish("sessionFailed")),this.j=null,this.publish("sessionScreen",null))};
g.k.info=function(a){b9(this.Ga,a)};
g.k.sV=function(){return null};
g.k.qT=function(a){var b=this.B;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.ib)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.ib)(function(){p9(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.k.ya=function(){this.qT("");n9.Rf.ya.call(this)};g.x(q9,n9);g.k=q9.prototype;g.k.nT=function(a){if(this.C){if(this.C==a)return;p9(this,"Overriding cast session with new session object");DHb(this);this.Da=!1;this.Y="unknown";this.C.removeUpdateListener(this.va);this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ha)}this.C=a;this.C.addUpdateListener(this.va);this.C.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ha);yHb(this,"getMdxSessionStatus")};
g.k.cB=function(a){this.info("launchWithParams no-op for Cast: "+g.qn(a))};
g.k.stop=function(){this.C?this.C.stop((0,g.ib)(function(){this.Hj()},this),(0,g.ib)(function(){this.Hj(Error("Failed to stop receiver app."))},this)):this.Hj(Error("Stopping cast device without session."))};
g.k.qT=function(){};
g.k.ya=function(){this.info("disposeInternal");DHb(this);this.C&&(this.C.removeUpdateListener(this.va),this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ha));this.C=null;n9.prototype.ya.call(this)};
g.k.Vca=function(a,b){if(!this.Na())if(b)if(b=d8(b),g.db(b))switch(a=""+b.type,b=b.data||{},this.info("onYoutubeMessage_: "+a+" "+g.qn(b)),a){case "mdxSessionStatus":vHb(this,b);break;case "loungeToken":zHb(this,b);break;default:p9(this,"Unknown youtube message: "+a)}else p9(this,"Unable to parse message.");else p9(this,"No data in message.")};
g.k.AY=function(a,b,c,d){g.DA(this.Z);this.Z=0;oHb(this.D,this.B.label,a,this.B.friendlyName,(0,g.ib)(function(e){e?b(e):d>=0?(p9(this,"Screen "+a+" appears to be offline. "+d+" retries left."),this.Z=g.BA((0,g.ib)(this.AY,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.k.sV=function(){return this.C};
g.k.G5=function(a){this.Na()||a||(p9(this,"Cast session died."),this.Hj())};g.x(r9,n9);g.k=r9.prototype;g.k.nT=function(a){this.C=a;this.C.addUpdateListener(this.La)};
g.k.cB=function(a){this.Oa=a;this.ra()};
g.k.stop=function(){LHb(this);this.C?this.C.stop((0,g.ib)(this.Hj,this,null),(0,g.ib)(this.Hj,this,"Failed to stop DIAL device.")):this.Hj()};
g.k.ya=function(){LHb(this);this.C&&this.C.removeUpdateListener(this.La);this.C=null;n9.prototype.ya.call(this)};
g.k.H5=function(a){this.Na()||a||(p9(this,"DIAL session died."),this.G(),this.G=function(){},this.Hj())};g.x(u9,n9);u9.prototype.stop=function(){this.Hj()};
u9.prototype.nT=function(){};
u9.prototype.cB=function(){g.DA(this.C);this.C=NaN;var a=l8(this.D.yl(),this.B.label);a?o9(this,a):this.Hj(Error("No such screen"))};
u9.prototype.ya=function(){g.DA(this.C);this.C=NaN;n9.prototype.ya.call(this)};g.x(v9,g.GE);g.k=v9.prototype;
g.k.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);g.FA("desktop_enable_cast_connect")&&(c.androidReceiverCompatible=!0);this.Y||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.K?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var e=(0,g.ib)(this.Yba,this);c=new chrome.cast.ApiConfig(c,(0,g.ib)(this.q0,
this),e,d,a);c.customDialLaunchCallback=(0,g.ib)(this.Saa,this);chrome.cast.initialize(c,(0,g.ib)(function(){this.Na()||(chrome.cast.addReceiverActionListener(this.G),YGb(),this.B.subscribe("onlineScreenChange",(0,g.ib)(this.tV,this)),this.C=OHb(this),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(f){this.hg("Failed to set initial custom receivers: "+g.qn(f))},this)),this.publish("yt-remote-cast2-availability-change",x9(this)),b(!0))},this),(0,g.ib)(function(f){this.hg("Failed to initialize API: "+
g.qn(f));
b(!1)},this))};
g.k.hea=function(a,b){w9("Setting connected screen ID: "+a+" -> "+b);if(this.j){var c=this.j.j;if(!a||c&&c.id!=a)w9("Unsetting old screen status: "+this.j.B.friendlyName),y9(this,null)}if(a&&b){if(!this.j){a=l8(this.B.yl(),a);if(!a){w9("setConnectedScreenStatus: Unknown screen.");return}if(a.idType=="shortLived"){w9("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=MHb(this,a);c||(w9("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(a.uuid?
a.uuid:a.id,a.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.C.push(c),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(d){this.hg("Failed to set initial custom receivers: "+g.qn(d))},this)));
w9("setConnectedScreenStatus: new active receiver: "+c.friendlyName);y9(this,new u9(this.B,c),!0)}this.j.qT(b)}else w9("setConnectedScreenStatus: no screen.")};
g.k.lea=function(a){this.Na()?this.hg("Setting connection data on disposed cast v2"):this.j?this.j.cB(a):this.hg("Setting connection data without a session")};
g.k.J5=function(){this.Na()?this.hg("Stopping session on disposed cast v2"):this.j?(this.j.stop(),y9(this,null)):w9("Stopping non-existing session")};
g.k.requestSession=function(){chrome.cast.requestSession((0,g.ib)(this.q0,this),(0,g.ib)(this.tca,this))};
g.k.ya=function(){this.B.unsubscribe("onlineScreenChange",(0,g.ib)(this.tV,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=VGb,b=g.Wa("yt.mdx.remote.debug.handlers_");g.Gb(b||[],a);g.ub(this.j);g.GE.prototype.ya.call(this)};
g.k.hg=function(a){b9("Controller",a)};
g.k.s0=function(a,b){this.j==a&&(b||y9(this,null),this.publish("yt-remote-cast2-session-change",b))};
g.k.Vba=function(a,b){if(!this.Na())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),w9("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.B.label!=a.label)w9("onReceiverAction_: Stopping active receiver: "+this.j.B.friendlyName),this.j.stop();else{w9("onReceiverAction_: Casting to active receiver.");this.j.j&&this.publish("yt-remote-cast2-session-change",this.j.j);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:y9(this,
new u9(this.B,a));break;case chrome.cast.ReceiverType.DIAL:y9(this,new r9(this.B,a,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:y9(this,new q9(this.B,a,this.config_));break;default:this.hg("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.B.label==a.label?this.j.stop():this.hg("Stopping receiver w/o session: "+a.friendlyName)}else this.hg("onReceiverAction_ called without receiver.")};
g.k.Saa=function(a){if(this.Na())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.hg("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.B:null;if(!c||c.label!=b.label)return this.hg("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.j)return w9("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.j.j),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.hg('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);y9(this,new r9(this.B,b,this.D,this.config_))}b=this.j;b.Z=a;b.Z.appState==chrome.cast.DialAppState.RUNNING?(a=b.Z.extraData||{},c=a.screenId||null,s9(b)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=IHb(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label,
screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.mA(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=JHb(b,c)):a=JHb(b,c)):a=GHb(b);return a};
g.k.q0=function(a){var b=this;if(!this.Na()&&!this.K){w9("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)w9("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),y9(this,new q9(this.B,c,this.config_),!0);else{this.hg("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.B,e=l8(this.B.yl(),
d.label);e&&j8(e,c.label)&&d.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(w9("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.ub(this.j),this.j=new q9(this.B,c,this.config_),this.j.subscribe("sessionScreen",(0,g.ib)(this.s0,this,this.j)),this.j.subscribe("sessionFailed",function(){return NHb(b,b.j)}),this.j.cB(null));
this.j.nT(a)}}};
g.k.I5=function(){return this.j?this.j.sV():null};
g.k.tca=function(a){this.Na()||(this.hg("Failed to estabilish a session: "+g.qn(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&y9(this,null),this.publish("yt-remote-cast2-session-failed"))};
g.k.Yba=function(a){w9("Receiver availability updated: "+a);if(!this.Na()){var b=x9(this);this.N=a==chrome.cast.ReceiverAvailability.AVAILABLE;x9(this)!=b&&this.publish("yt-remote-cast2-availability-change",x9(this))}};
g.k.tV=function(){this.Na()||(this.C=OHb(this),w9("Updating custom receivers: "+g.qn(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(){this.hg("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",x9(this)))};
v9.prototype.setLaunchParams=v9.prototype.lea;v9.prototype.setConnectedScreenStatus=v9.prototype.hea;v9.prototype.stopSession=v9.prototype.J5;v9.prototype.getCastSession=v9.prototype.I5;v9.prototype.requestSession=v9.prototype.requestSession;v9.prototype.init=v9.prototype.init;v9.prototype.dispose=v9.prototype.dispose;var XHb=[];g.k=F9.prototype;
g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";cIb(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.Xp=a.hasPrevious,this.Bl=a.hasNext,this.N=a.playerTime,this.K=a.playerTimeAt,this.D=a.seekableStart,this.j=a.seekableEnd,this.G=a.duration,this.Z=a.loadedTime,this.C=a.liveIngestionTime,this.B=
!isNaN(this.C))};
g.k.isPlaying=function(){return this.playerState==1};
g.k.isBuffering=function(){return this.playerState==3};
g.k.Cl=function(){return this.playerState==1081};
g.k.Nl=function(a){this.G=isNaN(a)?0:a};
g.k.getDuration=function(){return this.B?this.G+G9(this):this.G};
g.k.clone=function(){return new F9(dIb(this))};g.x(L9,g.GE);g.k=L9.prototype;g.k.getState=function(){return this.C};
g.k.du=function(){return this.D.getReconnectTimeout()};
g.k.yy=function(){this.D.reconnect()};
g.k.play=function(){N9(this)?(this.j?this.j.play(null,g.Jd,R9(this,"play")):Q9(this,"play"),gIb(this,1,I9(M9(this))),this.publish("remotePlayerChange")):O9(this,this.play)};
g.k.pause=function(){N9(this)?(this.j?this.j.pause(null,g.Jd,R9(this,"pause")):Q9(this,"pause"),gIb(this,2,I9(M9(this))),this.publish("remotePlayerChange")):O9(this,this.pause)};
g.k.seekTo=function(a){if(N9(this)){if(this.j){var b=M9(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.isPlaying()||b.isBuffering()?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(c,g.Jd,R9(this,"seekTo",{newTime:a}))}else Q9(this,"seekTo",{newTime:a});gIb(this,3,a);this.publish("remotePlayerChange")}else O9(this,g.jb(this.seekTo,a))};
g.k.stop=function(){if(N9(this)){this.j?this.j.stop(null,g.Jd,R9(this,"stopVideo")):Q9(this,"stopVideo");var a=M9(this);a.index=-1;a.videoId="";cIb(a);P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.stop)};
g.k.setVolume=function(a,b){if(N9(this)){var c=M9(this);if(this.B){if(c.volume!=a){var d=Math.round(a)/100;this.B.setReceiverVolumeLevel(d,(0,g.ib)(function(){c9("set receiver volume: "+d)},this),(0,g.ib)(function(){this.hg("failed to set receiver volume.")},this))}c.muted!=b&&this.B.setReceiverMuted(b,(0,g.ib)(function(){c9("set receiver muted: "+b)},this),(0,g.ib)(function(){this.hg("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};c.volume!=-1&&(e.delta=a-c.volume);Q9(this,"setVolume",e)}c.muted=b;c.volume=a;P9(this,c)}else O9(this,g.jb(this.setVolume,a,b))};
g.k.uV=function(a,b){if(N9(this)){var c=M9(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.qn(b.style),g.md(a,c.trackData));Q9(this,"setSubtitlesTrack",a);P9(this,c)}else O9(this,g.jb(this.uV,a,b))};
g.k.setAudioTrack=function(a,b){N9(this)?(b=b.getLanguageInfo().getId(),Q9(this,"setAudioTrack",{videoId:a,audioTrackId:b}),a=M9(this),a.audioTrackId=b,P9(this,a)):O9(this,g.jb(this.setAudioTrack,a,b))};
g.k.playVideo=function(a,b,c,d,e,f,h){d=d===void 0?null:d;e=e===void 0?null:e;f=f===void 0?null:f;h=h===void 0?null:h;var l=M9(this),m={videoId:a};c!==void 0&&(m.currentIndex=c);J9(l,a,c||0);b!==void 0&&(H9(l,b),m.currentTime=b);d&&(m.listId=d);e&&(m.playerParams=e);f&&(m.clickTrackingParams=f);h&&(m.locationInfo=g.qn(h));Q9(this,"setPlaylist",m);d||P9(this,l)};
g.k.NL=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"previous")}else O9(this,g.jb(this.NL,a,b))};
g.k.nextVideo=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"next")}else O9(this,g.jb(this.nextVideo,a,b))};
g.k.FO=function(){if(N9(this)){Q9(this,"clearPlaylist");var a=M9(this);a.reset();P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.FO)};
g.k.GX=function(){N9(this)?Q9(this,"dismissAutoplay"):O9(this,this.GX)};
g.k.dispose=function(){if(this.C!=3){var a=this.C;this.C=3;this.publish("proxyStateChange",a,this.C)}g.GE.prototype.dispose.call(this)};
g.k.ya=function(){fIb(this);this.D=null;this.G.clear();K9(this,null);g.GE.prototype.ya.call(this)};
g.k.uT=function(a){if((a!=this.C||a==2)&&this.C!=3&&a!=0){var b=this.C;this.C=a;this.publish("proxyStateChange",b,a);if(a==1)for(;!this.G.isEmpty();)b=a=this.G,b.j.length===0&&(b.j=b.B,b.j.reverse(),b.B=[]),a.j.pop().apply(this);else a==3&&this.dispose()}};
g.k.Tba=function(a,b){this.publish(a,b)};
g.k.Jaa=function(a){if(!a)this.mG(null),K9(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var b=M9(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)c9("Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,P9(this,b)}};
g.k.mG=function(a){c9("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.Z);if(this.j=a)this.j.addUpdateListener(this.Z),hIb(this),this.publish("remotePlayerChange")};
g.k.Iaa=function(a){a?(hIb(this),this.publish("remotePlayerChange")):this.mG(null)};
g.k.aU=function(){Q9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.k.Laa=function(){var a=$Hb();a&&K9(this,a)};
g.k.hg=function(a){b9("CP",a)};g.x(U9,g.GE);g.k=U9.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;n!==void 0&&(m.currentTime=n<=5?0:n);f&&(m.playerParams=f);p&&(m.locationInfo=p);h&&(m.clickTrackingParams=h);c&&(m.listId=c);e&&e.length>0&&(m.videoIds=e.join(","));l!==void 0&&(m.currentIndex=l);this.La&&(m.loopMode=b||"LOOP_MODE_OFF");c&&(this.j.listId=c);this.j.videoId=d;this.j.index=l||0;this.j.state=3;H9(this.j,
n);this.G="UNSUPPORTED";c=this.La?"setInitialState":"setPlaylist";S9("Connecting with "+c+" and params: "+g.qn(m));this.B.connect({method:c,params:g.qn(m)},a,JEb())}else S9("Connecting without params"),this.B.connect({},a,JEb());lIb(this)};
g.k.Ns=function(a){this.B.Ns(a)};
g.k.dispose=function(){this.Na()||(g.Va("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),T9(this,3));g.GE.prototype.dispose.call(this)};
g.k.ya=function(){mIb(this);oIb(this);nIb(this);g.DA(this.Z);this.Z=NaN;g.DA(this.Y);this.Y=NaN;this.D=null;g.pB(this.ra);this.ra.length=0;this.B.dispose();g.GE.prototype.ya.call(this);this.G=this.N=this.C=this.j=this.B=null};
g.k.yZ=function(a){if(!this.C||this.C.length===0)return!1;for(var b=g.v(this.C),c=b.next();!c.done;c=b.next())if(!c.value.capabilities.has(a))return!1;return!0};
g.k.o9=function(){var a=3;this.Na()||(a=0,isNaN(this.iF())?this.B.OA()&&isNaN(this.K)&&(a=1):a=2);return a};
g.k.dA=function(a){S9("Disconnecting with "+a);g.Va("yt.mdx.remote.remoteClient_",null);mIb(this);this.publish("beforeDisconnect",a);a==1&&o8();this.B.disconnect(a);this.dispose()};
g.k.i9=function(){var a=this.j;this.D&&(a=this.j.clone(),J9(a,this.D,a.index));return dIb(a)};
g.k.oea=function(a){var b=this,c=new F9(a);c.videoId&&c.videoId!=this.j.videoId&&(this.D=c.videoId,g.DA(this.Z),this.Z=g.BA(function(){if(b.D){var e=b.D;b.D=null;b.j.videoId!=e&&V9(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&&I9(this.j)==I9(c)&&g.qn(this.j.trackData)==g.qn(c.trackData)||d.push("remotePlayerChange");this.j.reset(a);g.Zb(d,function(e){this.publish(e)},this)};
g.k.vY=function(){var a=this.B.getDeviceId(),b=g.Cb(this.C,function(c){return c.type=="REMOTE_CONTROL"&&c.id!=a});
return b?b.id:""};
g.k.iF=function(){return this.B.du()};
g.k.S8=function(){return this.G||"UNSUPPORTED"};
g.k.T8=function(){return this.N||""};
g.k.K5=function(){!isNaN(this.iF())&&this.B.yy()};
g.k.eea=function(a,b){V9(this,a,b);qIb(this)};
g.k.vV=function(){var a=g.RA("SAPISID","")||g.RA("__Secure-1PAPISID")||"",b=g.RA("__Secure-3PAPISID","")||"";if(!a&&!b)return"";a=g.Bg(g.Ag(a),2);b=g.Bg(g.Ag(b),2);return g.Bg(g.Ag(","+a+","+b),2)};
U9.prototype.subscribe=U9.prototype.subscribe;U9.prototype.unsubscribeByKey=U9.prototype.Uh;U9.prototype.getProxyState=U9.prototype.o9;U9.prototype.disconnect=U9.prototype.dA;U9.prototype.getPlayerContextData=U9.prototype.i9;U9.prototype.setPlayerContextData=U9.prototype.oea;U9.prototype.getOtherConnectedRemoteId=U9.prototype.vY;U9.prototype.getReconnectTimeout=U9.prototype.iF;U9.prototype.getAutoplayMode=U9.prototype.S8;U9.prototype.getAutoplayVideoId=U9.prototype.T8;U9.prototype.reconnect=U9.prototype.K5;
U9.prototype.sendMessage=U9.prototype.eea;U9.prototype.getXsrfToken=U9.prototype.vV;U9.prototype.isCapabilitySupportedOnConnectedDevices=U9.prototype.yZ;g.x(CIb,g9);g.k=CIb.prototype;g.k.yl=function(a){return this.nh.$_gs(a)};
g.k.contains=function(a){return!!this.nh.$_c(a)};
g.k.get=function(a){return this.nh.$_g(a)};
g.k.start=function(){this.nh.$_st()};
g.k.add=function(a,b,c){this.nh.$_a(a,b,c)};
g.k.remove=function(a,b,c){this.nh.$_r(a,b,c)};
g.k.MM=function(a,b,c,d){this.nh.$_un(a,b,c,d)};
g.k.ya=function(){for(var a=0,b=this.j.length;a<b;++a)this.nh.$_ubk(this.j[a]);this.j.length=0;this.nh=null;g9.prototype.ya.call(this)};
g.k.L5=function(){this.publish("screenChange")};
g.k.Cba=function(){this.publish("onlineScreenChange")};
l9.prototype.$_st=l9.prototype.start;l9.prototype.$_gspc=l9.prototype.F5;l9.prototype.$_gsppc=l9.prototype.rV;l9.prototype.$_c=l9.prototype.contains;l9.prototype.$_g=l9.prototype.get;l9.prototype.$_a=l9.prototype.add;l9.prototype.$_un=l9.prototype.MM;l9.prototype.$_r=l9.prototype.remove;l9.prototype.$_gs=l9.prototype.yl;l9.prototype.$_gos=l9.prototype.qV;l9.prototype.$_s=l9.prototype.subscribe;l9.prototype.$_ubk=l9.prototype.Uh;var f$=null,i$=!1,W9=null,X9=null,NIb=null,a$=[];g.x(SIb,g.I);g.k=SIb.prototype;g.k.ya=function(){g.I.prototype.ya.call(this);this.j.stop();this.B.stop();this.N.stop();var a=this.Kc;a.unsubscribe("proxyStateChange",this.n0,this);a.unsubscribe("remotePlayerChange",this.wG,this);a.unsubscribe("remoteQueueChange",this.vL,this);a.unsubscribe("previousNextChange",this.k0,this);a.unsubscribe("nowAutoplaying",this.f0,this);a.unsubscribe("autoplayDismissed",this.M_,this);this.Kc=this.module=null};
g.k.Al=function(a){var b=g.Ja.apply(1,arguments);if(this.Kc.C!=2)if(j$(this)){if(!M9(this.Kc).Cl()||a!=="control_seek")switch(a){case "control_toggle_play_pause":M9(this.Kc).isPlaying()?this.Kc.pause():this.Kc.play();break;case "control_play":this.Kc.play();break;case "control_pause":this.Kc.pause();break;case "control_seek":this.K.eN(b[0],b[1]);break;case "control_subtitles_set_track":UIb(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.J.getCurrentTime();k$(this,b===0?void 0:b);break;case "control_seek":k$(this,b[0]);break;case "control_subtitles_set_track":UIb(this,b[0]);break;case "control_set_audio_track":this.setAudioTrack(b[0])}};
g.k.Gaa=function(a){this.N.p5(a)};
g.k.nfa=function(a){this.Al("control_subtitles_set_track",g.gd(a)?null:a)};
g.k.D2=function(){var a=this.J.getOption("captions","track");g.gd(a)||UIb(this,a)};
g.k.Uc=function(a){this.module.Uc(a,this.J.getVideoData().lengthSeconds)};
g.k.mba=function(){g.gd(this.C)||VIb(this,this.C);this.D=!1};
g.k.n0=function(a,b){this.B.stop();b===2&&this.t2()};
g.k.wG=function(){if(j$(this)){this.j.stop();var a=M9(this.Kc);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.module.ri=1;break;case 1082:case 1083:this.module.ri=0;break;default:this.module.ri=-1}switch(a.playerState){case 1081:case 1:this.Hc(new g.AK(8));this.s2();break;case 1085:case 3:this.Hc(new g.AK(9));break;case 1083:case 0:this.Hc(new g.AK(2));this.K.stop();this.Uc(this.J.getVideoData().lengthSeconds);break;case 1084:this.Hc(new g.AK(4));break;case 2:this.Hc(new g.AK(4));
this.Uc(I9(a));break;case -1:this.Hc(new g.AK(64));break;case -1E3:this.Hc(new g.AK(128,{errorCode:"mdx.remoteerror",errorMessage:"\u0412\u0438\u0434\u0435\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f.",IE:2}))}a=M9(this.Kc).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,VIb(this,a));a=M9(this.Kc);a.volume===-1||Math.round(this.J.getVolume())===a.volume&&this.J.isMuted()===a.muted||this.Z.isActive()||this.s3()}else TIb(this)};
g.k.k0=function(){this.J.publish("mdxpreviousnextchange")};
g.k.vL=function(){j$(this)||TIb(this)};
g.k.f0=function(a){isNaN(a)||this.J.publish("mdxnowautoplaying",a)};
g.k.M_=function(){this.J.publish("mdxautoplaycanceled")};
g.k.setAudioTrack=function(a){j$(this)&&this.Kc.setAudioTrack(this.J.getVideoData(1).videoId,a)};
g.k.seekTo=function(a,b){M9(this.Kc).playerState===-1?k$(this,a):b&&this.Kc.seekTo(a)};
g.k.s3=function(){var a=this;if(j$(this)){var b=M9(this.Kc);this.events.Oc(this.Y);b.muted?this.J.mute():this.J.unMute();this.J.setVolume(b.volume);this.Y=this.events.T(this.J,"onVolumeChange",function(c){QIb(a,c)})}};
g.k.s2=function(){this.j.stop();if(!this.Kc.Na()){var a=M9(this.Kc);a.isPlaying()&&this.Hc(new g.AK(8));this.Uc(I9(a));this.j.start()}};
g.k.t2=function(){this.B.stop();this.j.stop();var a=this.Kc.du();this.Kc.C==2&&!isNaN(a)&&this.B.start()};
g.k.Hc=function(a){this.B.stop();var b=this.G;if(!g.jFa(b,a)){var c=g.yF(a,2);c!==g.yF(this.G,2)&&this.J.tC(c);this.G=a;XIb(this.module,b,a)}};g.x(l$,g.W);l$.prototype.od=function(){this.j.show()};
l$.prototype.Nb=function(){this.j.hide()};
l$.prototype.B=function(){q8("mdx-privacy-popup-cancel");this.Nb()};
l$.prototype.C=function(){q8("mdx-privacy-popup-confirm");this.Nb()};g.x(m$,g.W);m$.prototype.onStateChange=function(a){this.Ic(a.state)};
m$.prototype.Ic=function(a){if(this.api.getPresentingPlayerType()===3){var b={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};a=g.yF(a,128)?g.aJ('\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',b):a.isPlaying()||a.isPaused()?g.aJ('\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',
b):g.aJ('\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 "$RECEIVER_NAME"',b);this.updateValue("statustext",a);this.j.show()}else this.j.hide()};g.x(n$,g.BU);n$.prototype.D=function(){var a=this.J.getOption("remote","receivers");a&&a.length>1&&!this.J.getOption("remote","quickCast")?(this.hv=g.cc(a,this.j,this),g.CU(this,g.$r(a,this.j)),a=this.J.getOption("remote","currentReceiver"),a=this.j(a),this.options[a]&&this.Ti(a),this.enable(!0)):this.enable(!1)};
n$.prototype.j=function(a){return a.key};
n$.prototype.bl=function(a){return a==="cast-selector-receiver"?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":this.hv[a].name};
n$.prototype.Mg=function(a){g.BU.prototype.Mg.call(this,a);this.J.setOption("remote","currentReceiver",this.hv[a]);this.Gb.Nb()};g.x(WIb,g.gV);g.k=WIb.prototype;
g.k.create=function(){var a=this.player.U(),b=g.sR(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.L("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.L("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.L("enable_cast_short_lived_lounge_token")};HIb(b,a);this.subscriptions.push(g.qD("yt-remote-before-disconnect",this.Eaa,this));this.subscriptions.push(g.qD("yt-remote-connection-change",this.Zba,this));this.subscriptions.push(g.qD("yt-remote-receiver-availability-change",this.m0,
this));this.subscriptions.push(g.qD("yt-remote-auto-connect",this.Xba,this));this.subscriptions.push(g.qD("yt-remote-receiver-resumed",this.Wba,this));this.subscriptions.push(g.qD("mdx-privacy-popup-confirm",this.sda,this));this.subscriptions.push(g.qD("mdx-privacy-popup-cancel",this.rda,this));this.m0()};
g.k.load=function(){this.player.cancelPlayback();g.gV.prototype.load.call(this);this.xm=new SIb(this,this.player,this.Kc);var a=(a=PIb())?a.currentTime:0;var b=MIb()?new L9(e$(),void 0):null;a==0&&b&&(a=I9(M9(b)));a!==0&&this.Uc(a);XIb(this,this.Ie,this.Ie);this.player.Lq(6)};
g.k.unload=function(){this.player.publish("mdxautoplaycanceled");this.Nt=this.mq;g.vb(this.xm,this.Kc);this.Kc=this.xm=null;g.gV.prototype.unload.call(this);this.player.Lq(5);o$(this)};
g.k.ya=function(){g.rD(this.subscriptions);g.gV.prototype.ya.call(this)};
g.k.rG=function(a){var b=g.Ja.apply(1,arguments);this.loaded&&this.xm.Al.apply(this.xm,[a].concat(g.ra(b)))};
g.k.getAdState=function(){return this.ri};
g.k.Xp=function(){return this.Kc?M9(this.Kc).Xp:!1};
g.k.Bl=function(){return this.Kc?M9(this.Kc).Bl:!1};
g.k.Uc=function(a,b){this.MZ=a||0;this.player.publish("progresssync",a,b);this.player.Ac("onVideoProgress",a||0)};
g.k.getCurrentTime=function(){return this.MZ};
g.k.getProgressState=function(){var a=M9(this.Kc),b=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!a.Cl()&&this.player.oi(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.C+G9(a):a.C,isAtLiveHead:(a.B?a.j+G9(a):a.j)-this.getCurrentTime()<=1,loaded:a.Z,seekableEnd:a.B?a.j+G9(a):a.j,seekableStart:a.D>0?a.D+G9(a):a.D,offset:0,viewerLivestreamJoinMediaTime:0}};
g.k.nextVideo=function(){this.Kc&&this.Kc.nextVideo()};
g.k.NL=function(){this.Kc&&this.Kc.NL()};
g.k.Eaa=function(a){a===1&&(this.BS=this.Kc?M9(this.Kc):null)};
g.k.Zba=function(){var a=MIb()?new L9(e$(),void 0):null;if(a){var b=this.Nt;this.loaded&&this.unload();this.Kc=a;this.BS=null;b.key!==this.mq.key&&(this.Nt=b,this.load())}else g.ub(this.Kc),this.Kc=null,this.loaded&&(this.unload(),(a=this.BS)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,I9(a)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
g.k.m0=function(){var a=[this.mq],b=a.concat,c=IIb();C9()&&g.yB("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.hv=b.call(a,c);a=KIb()||this.mq;p$(this,a);this.player.Ac("onMdxReceiversChange")};
g.k.Xba=function(){var a=KIb();p$(this,a)};
g.k.Wba=function(){this.Nt=KIb()};
g.k.sda=function(){this.PG=!0;o$(this);i$=!1;f$&&h$(f$,1);f$=null};
g.k.rda=function(){this.PG=!1;o$(this);p$(this,this.mq);this.Nt=this.mq;i$=!1;f$=null;this.player.playVideo()};
g.k.Xh=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.hv;case "currentReceiver":return b&&(b.key==="cast-selector-receiver"?aIb():p$(this,b)),this.loaded?this.Nt:this.mq;case "quickCast":return this.hv.length===2&&this.hv[1].key==="cast-selector-receiver"?(b&&aIb(),!0):!1}};
g.k.aU=function(){this.Kc.aU()};
g.k.qn=function(){return!1};
g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
g.k.isLoggedIn=function(){var a,b;return((a=g.jA("PLAYER_CONFIG"))==null?void 0:(b=a.args)==null?void 0:b.authuser)!==void 0?!0:!(!g.jA("SESSION_INDEX")&&!g.jA("LOGGED_IN"))};g.fV("remote",WIb);})(_yt_player);
