(function(g){var window=this;'use strict';var $7=function(a){g.vo(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.gb()).toString(36));return a},a8=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Kga(a.B,b,c)},Bxb=function(a){if(a instanceof g.Vs)return a; if("function"==typeof a.Jk)return a.Jk(!1);if(g.Xa(a)){var b=0,c=new g.Vs;c.next=function(){for(;;){if(b>=a.length)return g.F2;if(b in a)return g.Ws(a[b++]);b++}}; return c}throw Error("Not implemented");},Cxb=function(a,b,c){if(g.Xa(a))g.Zb(a,b,c); else for(a=Bxb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},Dxb=function(a,b){var c=[]; Cxb(b,function(d){try{var e=g.kv.prototype.B.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.yla(e)&&c.push(d)},a); return c},Exb=function(a,b){Dxb(a,b).forEach(function(c){g.kv.prototype.remove.call(this,c)},a)},Fxb=function(a){if(a.ma){if(a.ma.locationOverrideToken)return{locationOverrideToken:a.ma.locationOverrideToken}; if(null!=a.ma.latitudeE7&&null!=a.ma.longitudeE7)return{latitudeE7:a.ma.latitudeE7,longitudeE7:a.ma.longitudeE7}}return null},Gxb=function(a,b){g.Bb(a,b)||a.push(b)},Hxb=function(a){var b=0,c; for(c in a)b++;return b},Ixb=function(a,b){return g.gd(a,b)},Jxb=function(a){try{return g.Ra.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);},b8=function(a){if(g.Ra.JSON)try{return g.Ra.JSON.parse(a)}catch(b){}return Jxb(a)},Kxb=function(a,b,c,d){var e=new g.no(null); a&&g.oo(e,a);b&&g.po(e,b);c&&g.qo(e,c);d&&(e.C=d);return e},Lxb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/channel/opened",{We:3,Ve:"channel_type"})},Mxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/opened",b)},Nxb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/channel/closed",{We:3,Ve:"channel_type"})},Oxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/closed",b)},Pxb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/channel/message_received",{We:3,Ve:"channel_type"})},Qxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},Rxb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/channel/error",{We:3,Ve:"channel_type"})},Sxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/error",b)},Txb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Uxb=function(){this.j=c8(); this.j.Kk("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},d8=function(a){this.name=this.id=""; this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new g.Tu;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";a&&(this.id=a.id||a.name,this.name=a.name,this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.app=a.app,this.type= a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Vxb(this,a.capabilities||""),Wxb(this,a.compatibleSenderThemes||""),Xxb(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")},Vxb=function(a,b){a.capabilities.clear(); g.$s(b.split(","),g.fb(Ixb,Yxb)).forEach(function(c){a.capabilities.add(c)})},Wxb=function(a,b){a.compatibleSenderThemes.clear(); g.$s(b.split(","),g.fb(Ixb,Zxb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},Xxb=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},e8=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"},f8=function(a,b){return!!b&&(a.id==b||a.uuid==b)},$xb=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},ayb=function(a){return new e8(a)},byb=function(a){return Array.isArray(a)?g.mr(a,ayb):[]},g8=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"},cyb=function(a){return Array.isArray(a)?"["+g.mr(a,g8).join(",")+"]":"null"},dyb=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(a){var b=16*Math.random()|0; return("x"==a?b:b&3|8).toString(16)})},eyb=function(a){return g.mr(a,function(b){return{key:b.id, name:b.name}})},fyb=function(a,b){return g.yb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},h8=function(a,b){return g.yb(a,function(c){return f8(c,b)})},gyb=function(){var a=(0,g.LC)(); a&&Exb(a,a.j.Jk(!0))},i8=function(){var a=g.NC("yt-remote-connected-devices")||[]; g.Wb(a);return a},hyb=function(a){if(0==a.length)return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.mr(a,function(d,e){return 0==e?d:d.substring(c.length)})},iyb=function(a){g.MC("yt-remote-connected-devices",a,86400)},j8=function(){if(jyb)return jyb; var a=g.NC("yt-remote-device-id");a||(a=dyb(),g.MC("yt-remote-device-id",a,31536E3));for(var b=i8(),c=1,d=a;g.Bb(b,d);)c++,d=a+"#"+c;return jyb=d},kyb=function(){var a=i8(),b=j8(); g.PC()&&g.Yb(a,b);a=hyb(a);if(0==a.length)try{g.Boa("remote_sid")}catch(c){}else try{g.dC("remote_sid",a.join(","),-1)}catch(c){}},lyb=function(){return g.NC("yt-remote-session-browser-channel")},myb=function(){return g.NC("yt-remote-local-screens")||[]},nyb=function(){g.MC("yt-remote-lounge-token-expiration",!0,86400)},oyb=function(a){5b.length)return Syb;b=b.slice(d,d+c);a.K=d+c;return b},x8=function(a){a.Mb=Date.now()+a.tb; Wyb(a,a.tb)},Wyb=function(a,b){if(null!=a.ma)throw Error("WatchDog timer not null"); a.ma=u8((0,g.db)(a.q2,a),b)},A8=function(a){a.ma&&(g.Ra.clearTimeout(a.ma),a.ma=null)},z8=function(a){a.G.Vg()||a.Ka||Xyb(a.G,a)},y8=function(a){A8(a); g.rb(a.Xa);a.Xa=null;a.ob.stop();a.fb.Of();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},Uyb=function(a,b){try{var c=a.G; if(0!=c.Kh&&(c.j==a||Yyb(c.B,a)))if(!a.Va&&Yyb(c.B,a)&&3==c.Kh){try{var d=c.Ef.j.parse(b)}catch(x){d=null}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.Z){if(c.j)if(c.j.Aa+3E3e[2]&&c.Va&&0==c.qa&&!c.ma&&(c.ma=u8((0,g.db)(c.v2,c),6E3));if(1>=$yb(c.B)&&c.kd){try{c.kd()}catch(x){}c.kd=void 0}}else D8(c,11)}else if((a.Va||c.j==a)&&B8(c),!g.fc(b))for(e=c.Ef.j.parse(b),b=0;b=a.D:!1},$yb=function(a){return a.B?1:a.j?a.j.size:0},Yyb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},azb= function(a,b){a.j?a.j.add(b):a.B=b},czb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},hzb=function(a){if(null!=a.B)return a.C.concat(a.B.qa); if(null!=a.j&&0!==a.j.size){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.qa);return b}return g.Hb(a.C)},izb=function(a,b){var c=new v8; if(g.Ra.Image){var d=new Image;d.onload=g.fb(F8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.fb(F8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.fb(F8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.fb(F8,c,d,"TestLoadImage: timeout",!1,b);g.Ra.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4); d.src=a}else b(!1)},F8=function(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d)}catch(f){}},jzb=function(){this.j=new r8},kzb=function(a,b,c){var d=c||""; try{g.mo(a,function(e,f){var h=e;g.Za(e)&&(h=g.Mm(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e; }},G8=function(a,b,c){return c&&c.y7?c.y7[a]||b:b},lzb=function(a){this.C=[]; this.Zb=this.Ad=this.Na=this.hc=this.j=this.Le=this.Ea=this.Ka=this.N=this.Mb=this.Y=null;this.Uf=this.Za=0;this.Sf=G8("failFast",!1,a);this.Va=this.ma=this.Z=this.K=this.G=null;this.Bc=!0;this.Je=this.Xa=-1;this.Ob=this.qa=this.Aa=0;this.Rf=G8("baseRetryDelayMs",5E3,a);this.Vf=G8("retryDelaySeedMs",1E4,a);this.Tf=G8("forwardChannelMaxRetries",2,a);this.le=G8("forwardChannelRequestTimeoutMs",2E4,a);this.Ke=a&&a.Dkb||void 0;this.Re=a&&a.Akb||!1;this.fb=void 0;this.Sa=a&&a.Vba||!1;this.D="";this.B= new fzb(a&&a.Ohb);this.Ef=new jzb;this.tb=a&&a.eib||!1;this.rb=a&&a.Uhb||!1;this.tb&&this.rb&&(this.rb=!1);this.Wf=a&&a.Ghb||!1;a&&a.gib&&(this.Bc=!1);this.jd=!this.tb&&this.Bc&&a&&a.Shb||!1;this.Xd=void 0;a&&a.jY&&0=a.B.D-(a.K?1:0))return!1; if(a.K)return a.C=b.qa.concat(a.C),!0;if(1==a.Kh||2==a.Kh||a.Aa>=(a.Sf?0:a.Tf))return!1;a.K=u8((0,g.db)(a.gT,a,b),ozb(a,a.Aa));a.Aa++;return!0},rzb=function(a,b){var c; b?c=b.Bc:c=a.Za++;var d=a.Na.clone();g.vo(d,"SID",a.D);g.vo(d,"RID",c);g.vo(d,"AID",a.Xa);H8(a,d);a.N&&a.Y&&g.$o(d,a.N,a.Y);c=new w8(a,a.D,c,a.Aa+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.qa.concat(a.C));b=qzb(a,c,1E3);c.setTimeout(Math.round(.5*a.le)+Math.round(.5*a.le*Math.random()));azb(a.B,c);Oyb(c,d,b)},H8=function(a,b){a.Ka&&g.Vc(a.Ka,function(c,d){g.vo(b,d,c)}); a.G&&g.mo({},function(c,d){g.vo(b,d,c)})},qzb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.db)(a.G.w2,a.G,a):null;a:for(var e=a.C,f=-1;;){var h=["count="+c];-1==f?0n)f=Math.max(0,e[m].j-100),l=!1;else try{kzb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.C.splice(0,c);b.qa=a;return d},dzb=function(a){a.j||a.Z||(a.Ob=1,g.Jf(a.fT,a),a.qa=0)},Zyb=function(a){if(a.j||a.Z||3<=a.qa)return!1; a.Ob++;a.Z=u8((0,g.db)(a.fT,a),ozb(a,a.qa));a.qa++;return!0},mzb=function(a){null!=a.Ha&&(g.Ra.clearTimeout(a.Ha),a.Ha=null)},szb=function(a){a.j=new w8(a,a.D,"rpc",a.Ob); null===a.N&&(a.j.Na=a.Y);a.j.rb=0;var b=a.Ad.clone();g.vo(b,"RID","rpc");g.vo(b,"SID",a.D);g.vo(b,"AID",a.Xa);g.vo(b,"CI",a.Va?"0":"1");!a.Va&&a.Xd&&g.vo(b,"TO",a.Xd);g.vo(b,"TYPE","xmlhttp");H8(a,b);a.N&&a.Y&&g.$o(b,a.N,a.Y);a.fb&&a.j.setTimeout(a.fb);var c=a.j;a=a.Zb;c.Sa=1;c.Z=$7(b.clone());c.Y=null;c.Ea=!0;Nyb(c,a)},B8=function(a){null!=a.ma&&(g.Ra.clearTimeout(a.ma),a.ma=null)},Xyb=function(a,b){var c=null; if(a.j==b){B8(a);mzb(a);a.j=null;var d=2}else if(Yyb(a.B,b))c=b.qa,czb(a.B,b),d=1;else return;if(0!=a.Kh)if(b.C)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Aa;var e=a.Aa;d=Iyb();d.dispatchEvent(new Lyb(d,c,b,e));E8(a)}else dzb(a);else{var f=b.Fb;e=b.getLastError();if(3==e||0==e&&0b.length)return Fzb;b=b.slice(d,d+c);a.sG=d+c;return b},Jzb=function(a,b){a.Qx=Date.now(); O8(a);var c=b?window.location.hostname:"";a.qs=a.hs.clone();g.vo(a.qs,"DOMAIN",c);g.vo(a.qs,"t",a.K);try{a.Ao=new ActiveXObject("htmlfile")}catch(m){P8(a);a.ls=7;M8(22);Q8(a);return}var d="";if(b){var e="";for(b=0;b"==f)f=e+"\\x3e";else{if(f in R8)f=R8[f];else if(f in Izb)f=R8[f]=Izb[f];else{var h=f.charCodeAt(0);if(31h)var l=f;else{if(256>h){if(l="\\x",16>h||256h&&(l+="0");l+=h.toString(16).toUpperCase()}f= R8[f]=l}f=e+f}e=f}d+='