(function(g){var window=this;'use strict';var P7=function(a){g.il(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.Ya()).toString(36));return a},Q7=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Cga(a.u,b,c)},Mnb=function(a){if(a instanceof g.$n)return a; if("function"==typeof a.nk)return a.nk(!1);if(g.Pa(a)){var b=0,c=new g.$n;c.next=function(){for(;;){if(b>=a.length)return g.j3;if(b in a)return g.ao(a[b++]);b++}}; return c}throw Error("Not implemented");},Nnb=function(a,b,c){if(g.Pa(a))g.Wb(a,b,c); else for(a=Mnb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},Onb=function(a,b){var c=[]; Nnb(b,function(d){try{var e=g.xq.prototype.u.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.mla(e)&&c.push(d)},a); return c},Pnb=function(a,b){Onb(a,b).forEach(function(c){g.xq.prototype.remove.call(this,c)},a)},Qnb=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},Rnb=function(a,b){g.Bb(a,b)||a.push(b)},Snb=function(a){var b=0,c; for(c in a)b++;return b},Tnb=function(a,b){return g.ad(a,b)},Unb=function(a){try{return g.La.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);},R7=function(a){if(g.La.JSON)try{return g.La.JSON.parse(a)}catch(b){}return Unb(a)},Vnb=function(a,b,c,d){var e=new g.Pk(null); a&&g.bl(e,a);b&&g.cl(e,b);c&&g.dl(e,c);d&&(e.B=d);return e},Wnb=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/channel/opened",{Wd:3,Vd:"channel_type"})},Xnb=function(a,b){a.j.hk("/client_streamz/youtube/living_room/mdx/channel/opened",b)},Ynb=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/channel/closed",{Wd:3,Vd:"channel_type"})},Znb=function(a,b){a.j.hk("/client_streamz/youtube/living_room/mdx/channel/closed",b)},$nb=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/channel/message_received",{Wd:3,Vd:"channel_type"})},aob=function(a,b){a.j.hk("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},bob=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/channel/error",{Wd:3,Vd:"channel_type"})},cob=function(a,b){a.j.hk("/client_streamz/youtube/living_room/mdx/channel/error",b)},dob=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},eob=function(){this.j=S7(); this.j.yj("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},T7=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.gq;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",fob(this,a.capabilities||""),gob(this,a.compatibleSenderThemes||""),hob(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")},fob=function(a,b){a.capabilities.clear(); g.fo(b.split(","),g.Xa(Tnb,iob)).forEach(function(c){a.capabilities.add(c)})},gob=function(a,b){a.compatibleSenderThemes.clear(); g.fo(b.split(","),g.Xa(Tnb,job)).forEach(function(c){a.compatibleSenderThemes.add(c)})},hob=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},U7=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"},V7=function(a,b){return!!b&&(a.id==b||a.uuid==b)},kob=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},lob=function(a){return new U7(a)},mob=function(a){return Array.isArray(a)?g.qm(a,lob):[]},W7=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"},nob=function(a){return Array.isArray(a)?"["+g.qm(a,W7).join(",")+"]":"null"},oob=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)})},pob=function(a){return g.qm(a,function(b){return{key:b.id, name:b.name}})},qob=function(a,b){return g.xb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},X7=function(a,b){return g.xb(a,function(c){return V7(c,b)})},rob=function(){var a=(0,g.jA)(); a&&Pnb(a,a.j.nk(!0))},Y7=function(){var a=g.mA("yt-remote-connected-devices")||[]; g.Tb(a);return a},sob=function(a){if(0==a.length)return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.qm(a,function(d,e){return 0==e?d:d.substring(c.length)})},tob=function(a){g.lA("yt-remote-connected-devices",a,86400)},Z7=function(){if(uob)return uob; var a=g.mA("yt-remote-device-id");a||(a=oob(),g.lA("yt-remote-device-id",a,31536E3));for(var b=Y7(),c=1,d=a;g.Bb(b,d);)c++,d=a+"#"+c;return uob=d},vob=function(){var a=Y7(),b=Z7(); g.oA()&&g.Vb(a,b);a=sob(a);if(0==a.length)try{g.nz("remote_sid")}catch(c){}else try{g.lz("remote_sid",a.join(","),-1)}catch(c){}},wob=function(){return g.mA("yt-remote-session-browser-channel")},xob=function(){return g.mA("yt-remote-local-screens")||[]},yob=function(){g.lA("yt-remote-lounge-token-expiration",!0,86400)},zob=function(a){5b.length)return m8;b=b.slice(d,d+c);a.ma=d+c;return b},l8=function(a){a.Ab=Date.now()+a.Hb; gpb(a,a.Hb)},gpb=function(a,b){if(null!=a.ea)throw Error("WatchDog timer not null"); a.ea=j8((0,g.Wa)(a.e_,a),b)},p8=function(a){a.ea&&(g.La.clearTimeout(a.ea),a.ea=null)},o8=function(a){a.D.Yg()||a.Ja||hpb(a.D,a)},n8=function(a){p8(a); g.kb(a.Za);a.Za=null;a.qb.stop();a.ib.Gf();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},epb=function(a,b){try{var c=a.D; if(0!=c.rh&&(c.j==a||ipb(c.u,a)))if(!a.Ua&&ipb(c.u,a)&&3==c.rh){try{var d=c.yf.j.parse(b)}catch(B){d=null}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.V){if(c.j)if(c.j.Aa+3E3e[2]&&c.Ua&&0==c.qa&&!c.ma&&(c.ma=j8((0,g.Wa)(c.h_,c),6E3));if(1>=kpb(c.u)&&c.Rc){try{c.Rc()}catch(B){}c.Rc=void 0}}else s8(c,11)}else if((a.Ua||c.j==a)&&q8(c),!g.cc(b))for(e=c.yf.j.parse(b),b=0;b=a.C:!1},kpb=function(a){return a.u?1:a.j?a.j.size:0},ipb=function(a,b){return a.u?a.u==b:a.j?a.j.has(b):!1},lpb= function(a,b){a.j?a.j.add(b):a.u=b},npb=function(a,b){a.u&&a.u==b?a.u=null:a.j&&a.j.has(b)&&a.j.delete(b)},spb=function(a){if(null!=a.u)return a.B.concat(a.u.qa); if(null!=a.j&&0!==a.j.size){var b=a.B;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.Gb(a.B)},tpb=function(a,b){var c=new Xob; if(g.La.Image){var d=new Image;d.onload=g.Xa(u8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.Xa(u8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.Xa(u8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.Xa(u8,c,d,"TestLoadImage: timeout",!1,b);g.La.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4); d.src=a}else b(!1)},u8=function(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d)}catch(f){}},upb=function(){this.j=new g8},vpb=function(a,b,c){var d=c||""; try{g.Ok(a,function(e,f){var h=e;g.Ra(e)&&(h=g.Wi(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e; }},v8=function(a,b,c){return c&&c.e4?c.e4[a]||b:b},wpb=function(a){this.B=[]; this.Cc=this.Ed=this.Ma=this.Mc=this.j=this.Ae=this.Ba=this.Ja=this.K=this.Ab=this.ea=null;this.Zf=this.fb=0;this.Xf=v8("failFast",!1,a);this.Ua=this.ma=this.V=this.J=this.D=null;this.md=!0;this.ye=this.Za=-1;this.qc=this.qa=this.Aa=0;this.If=v8("baseRetryDelayMs",5E3,a);this.ag=v8("retryDelaySeedMs",1E4,a);this.Yf=v8("forwardChannelMaxRetries",2,a);this.xe=v8("forwardChannelRequestTimeoutMs",2E4,a);this.ze=a&&a.Q9a||void 0;this.Ie=a&&a.N9a||!1;this.ib=void 0;this.Oa=a&&a.c9||!1;this.C="";this.u= new qpb(a&&a.y7a);this.yf=new upb;this.Hb=a&&a.O7a||!1;this.ub=a&&a.E7a||!1;this.Hb&&this.ub&&(this.ub=!1);this.cg=a&&a.r7a||!1;a&&a.Q7a&&(this.md=!1);this.Qc=!this.Hb&&this.md&&a&&a.B7a||!1;this.yd=void 0;a&&a.tV&&0=a.u.C-(a.J?1:0))return!1; if(a.J)return a.B=b.qa.concat(a.B),!0;if(1==a.rh||2==a.rh||a.Aa>=(a.Xf?0:a.Yf))return!1;a.J=j8((0,g.Wa)(a.KQ,a,b),zpb(a,a.Aa));a.Aa++;return!0},Cpb=function(a,b){var c; b?c=b.md:c=a.fb++;var d=a.Ma.clone();g.il(d,"SID",a.C);g.il(d,"RID",c);g.il(d,"AID",a.Za);w8(a,d);a.K&&a.ea&&g.ml(d,a.K,a.ea);c=new k8(a,a.C,c,a.Aa+1);null===a.K&&(c.Ma=a.ea);b&&(a.B=b.qa.concat(a.B));b=Bpb(a,c,1E3);c.setTimeout(Math.round(.5*a.xe)+Math.round(.5*a.xe*Math.random()));lpb(a.u,c);$ob(c,d,b)},w8=function(a,b){a.Ja&&g.Sc(a.Ja,function(c,d){g.il(b,d,c)}); a.D&&g.Ok({},function(c,d){g.il(b,d,c)})},Bpb=function(a,b,c){c=Math.min(a.B.length,c); var d=a.D?(0,g.Wa)(a.D.i_,a.D,a):null;a:for(var e=a.B,f=-1;;){var h=["count="+c];-1==f?0n)f=Math.max(0,e[m].j-100),l=!1;else try{vpb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.B.splice(0,c);b.qa=a;return d},opb=function(a){a.j||a.V||(a.qc=1,g.xf(a.JQ,a),a.qa=0)},jpb=function(a){if(a.j||a.V||3<=a.qa)return!1; a.qc++;a.V=j8((0,g.Wa)(a.JQ,a),zpb(a,a.qa));a.qa++;return!0},xpb=function(a){null!=a.Da&&(g.La.clearTimeout(a.Da),a.Da=null)},Dpb=function(a){a.j=new k8(a,a.C,"rpc",a.qc); null===a.K&&(a.j.Ma=a.ea);a.j.ub=0;var b=a.Ed.clone();g.il(b,"RID","rpc");g.il(b,"SID",a.C);g.il(b,"AID",a.Za);g.il(b,"CI",a.Ua?"0":"1");!a.Ua&&a.yd&&g.il(b,"TO",a.yd);g.il(b,"TYPE","xmlhttp");w8(a,b);a.K&&a.ea&&g.ml(b,a.K,a.ea);a.ib&&a.j.setTimeout(a.ib);var c=a.j;a=a.Cc;c.Oa=1;c.K=P7(b.clone());c.V=null;c.Ba=!0;Zob(c,a)},q8=function(a){null!=a.ma&&(g.La.clearTimeout(a.ma),a.ma=null)},hpb=function(a,b){var c=null; if(a.j==b){q8(a);xpb(a);a.j=null;var d=2}else if(ipb(a.u,b))c=b.qa,npb(a.u,b),d=1;else return;if(0!=a.rh)if(b.B)if(1==d){c=b.V?b.V.length:0;b=Date.now()-b.Aa;var e=a.Aa;d=Tob();d.dispatchEvent(new Wob(d,c,b,e));t8(a)}else opb(a);else{var f=b.Pb;e=b.getLastError();if(3==e||0==e&&0b.length)return Qpb;b=b.slice(d,d+c);a.yE=d+c;return b},Upb=function(a,b){a.Sw=Date.now(); D8(a);var c=b?window.location.hostname:"";a.Fr=a.Dr.clone();g.il(a.Fr,"DOMAIN",c);g.il(a.Fr,"t",a.J);try{a.Jn=new ActiveXObject("htmlfile")}catch(m){E8(a);a.Er=7;B8(22);F8(a);return}var d="";if(b){var e="";for(b=0;b"==f)f=e+"\\x3e";else{if(f in G8)f=G8[f];else if(f in Tpb)f=G8[f]=Tpb[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= G8[f]=l}f=e+f}e=f}d+='