(function(g){var window=this;'use strict';var $7=function(a){g.no(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.sb()).toString(36));return a},a8=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.uga(a.B,b,c)},Uvb=function(a){if(a instanceof g.Ds)return a; if("function"==typeof a.Ck)return a.Ck(!1);if(g.gb(a)){var b=0,c=new g.Ds;c.next=function(){for(;;){if(b>=a.length)return g.E2;if(b in a)return g.Es(a[b++]);b++}}; return c}throw Error("Not implemented");},Vvb=function(a,b,c){if(g.gb(a))g.kc(a,b,c); else for(a=Uvb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},Wvb=function(a,b){var c=[]; Vvb(b,function(d){try{var e=g.cv.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.ila(e)&&c.push(d)},a); return c},Xvb=function(a,b){Wvb(a,b).forEach(function(c){g.cv.prototype.remove.call(this,c)},a)},Yvb=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},Zvb=function(a,b){g.Pb(a,b)||a.push(b)},$vb=function(a){var b=0,c; for(c in a)b++;return b},awb=function(a,b){return g.vd(a,b)},bwb=function(a){try{return g.Xa.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.Xa.JSON)try{return g.Xa.JSON.parse(a)}catch(b){}return bwb(a)},cwb=function(a,b,c,d){var e=new g.fo(null); a&&g.go(e,a);b&&g.ho(e,b);c&&g.io(e,c);d&&(e.C=d);return e},dwb=function(){this.j=c8(); this.j.Sl("/client_streamz/youtube/living_room/mdx/channel/opened",{Xf:3,Wf:"channel_type"})},ewb=function(a,b){a.j.Im("/client_streamz/youtube/living_room/mdx/channel/opened",b)},fwb=function(){this.j=c8(); this.j.Sl("/client_streamz/youtube/living_room/mdx/channel/closed",{Xf:3,Wf:"channel_type"})},gwb=function(a,b){a.j.Im("/client_streamz/youtube/living_room/mdx/channel/closed",b)},hwb=function(){this.j=c8(); this.j.Sl("/client_streamz/youtube/living_room/mdx/channel/message_received",{Xf:3,Wf:"channel_type"})},iwb=function(a,b){a.j.Im("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},jwb=function(){this.j=c8(); this.j.Sl("/client_streamz/youtube/living_room/mdx/channel/error",{Xf:3,Wf:"channel_type"})},kwb=function(a,b){a.j.Im("/client_streamz/youtube/living_room/mdx/channel/error",b)},lwb=function(){this.j=c8(); this.j.Sl("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},mwb=function(){this.j=c8(); this.j.Sl("/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.Lu;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",nwb(this,a.capabilities||""),owb(this,a.compatibleSenderThemes||""),pwb(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")},nwb=function(a,b){a.capabilities.clear(); g.Ss(b.split(","),g.rb(awb,qwb)).forEach(function(c){a.capabilities.add(c)})},owb=function(a,b){a.compatibleSenderThemes.clear(); g.Ss(b.split(","),g.rb(awb,rwb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},pwb=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)},swb=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},twb=function(a){return new e8(a)},uwb=function(a){return Array.isArray(a)?g.$p(a,twb):[]},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"},vwb=function(a){return Array.isArray(a)?"["+g.$p(a,g8).join(",")+"]":"null"},wwb=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)})},xwb=function(a){return g.$p(a,function(b){return{key:b.id, name:b.name}})},ywb=function(a,b){return g.Nb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},h8=function(a,b){return g.Nb(a,function(c){return f8(c,b)})},zwb=function(){var a=(0,g.NC)(); a&&Xvb(a,a.j.Ck(!0))},i8=function(){var a=g.PC("yt-remote-connected-devices")||[]; g.hc(a);return a},Awb=function(a){if(0==a.length)return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.$p(a,function(d,e){return 0==e?d:d.substring(c.length)})},Bwb=function(a){g.OC("yt-remote-connected-devices",a,86400)},j8=function(){if(Cwb)return Cwb; var a=g.PC("yt-remote-device-id");a||(a=wwb(),g.OC("yt-remote-device-id",a,31536E3));for(var b=i8(),c=1,d=a;g.Pb(b,d);)c++,d=a+"#"+c;return Cwb=d},Dwb=function(){var a=i8(),b=j8(); g.RC()&&g.jc(a,b);a=Awb(a);if(0==a.length)try{g.$na("remote_sid")}catch(c){}else try{g.fC("remote_sid",a.join(","),-1)}catch(c){}},Ewb=function(){return g.PC("yt-remote-session-browser-channel")},Fwb=function(){return g.PC("yt-remote-local-screens")||[]},Gwb=function(){g.OC("yt-remote-lounge-token-expiration",!0,86400)},Hwb=function(a){5b.length)return x8;b=b.slice(d,d+c);a.ma=d+c;return b},w8=function(a){a.Mb=Date.now()+a.yb; oxb(a,a.yb)},oxb=function(a,b){if(null!=a.Y)throw Error("WatchDog timer not null"); a.Y=u8((0,g.qb)(a.o1,a),b)},A8=function(a){a.Y&&(g.Xa.clearTimeout(a.Y),a.Y=null)},z8=function(a){a.G.ih()||a.La||pxb(a.G,a)},y8=function(a){A8(a); g.Bb(a.Za);a.Za=null;a.jb.stop();a.ib.Lf();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},mxb=function(a,b){try{var c=a.G; if(0!=c.Gh&&(c.j==a||qxb(c.B,a)))if(!a.Va&&qxb(c.B,a)&&3==c.Gh){try{var d=c.Ff.j.parse(b)}catch(z){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.qb)(c.t1,c),6E3));if(1>=sxb(c.B)&&c.qd){try{c.qd()}catch(z){}c.qd=void 0}}else D8(c,11)}else if((a.Va||c.j==a)&&B8(c),!g.oc(b))for(e=c.Ff.j.parse(b),b=0;b=a.D:!1},sxb=function(a){return a.B?1:a.j?a.j.size:0},qxb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},txb= function(a,b){a.j?a.j.add(b):a.B=b},vxb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},Axb=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.Yb(a.C)},Bxb=function(a,b){var c=new exb; if(g.Xa.Image){var d=new Image;d.onload=g.rb(F8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.rb(F8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.rb(F8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.rb(F8,c,d,"TestLoadImage: timeout",!1,b);g.Xa.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){}},Cxb=function(){this.j=new r8},Dxb=function(a,b,c){var d=c||""; try{g.eo(a,function(e,f){var h=e;g.kb(e)&&(h=g.Em(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.j6?c.j6[a]||b:b},Exb=function(a){this.C=[]; this.uc=this.Id=this.Na=this.lc=this.j=this.Ke=this.Da=this.La=this.N=this.Mb=this.Y=null;this.Sf=this.fb=0;this.Qf=G8("failFast",!1,a);this.Va=this.ma=this.Z=this.K=this.G=null;this.Xc=!0;this.Ud=this.Za=-1;this.Xb=this.qa=this.Aa=0;this.Pf=G8("baseRetryDelayMs",5E3,a);this.dg=G8("retryDelaySeedMs",1E4,a);this.Rf=G8("forwardChannelMaxRetries",2,a);this.Ld=G8("forwardChannelRequestTimeoutMs",2E4,a);this.Je=a&&a.Qhb||void 0;this.Ef=a&&a.Nhb||!1;this.ib=void 0;this.Ta=a&&a.raa||!1;this.D="";this.B= new yxb(a&&a.ifb);this.Ff=new Cxb;this.yb=a&&a.xfb||!1;this.wb=a&&a.nfb||!1;this.yb&&this.wb&&(this.wb=!1);this.eg=a&&a.cfb||!1;a&&a.zfb&&(this.Xc=!1);this.Tc=!this.yb&&this.Xc&&a&&a.lfb||!1;this.rd=void 0;a&&a.zX&&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.Gh||2==a.Gh||a.Aa>=(a.Qf?0:a.Rf))return!1;a.K=u8((0,g.qb)(a.CS,a,b),Hxb(a,a.Aa));a.Aa++;return!0},Kxb=function(a,b){var c; b?c=b.Xc:c=a.fb++;var d=a.Na.clone();g.no(d,"SID",a.D);g.no(d,"RID",c);g.no(d,"AID",a.Za);H8(a,d);a.N&&a.Y&&g.ro(d,a.N,a.Y);c=new v8(a,a.D,c,a.Aa+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.qa.concat(a.C));b=Jxb(a,c,1E3);c.setTimeout(Math.round(.5*a.Ld)+Math.round(.5*a.Ld*Math.random()));txb(a.B,c);hxb(c,d,b)},H8=function(a,b){a.La&&g.kd(a.La,function(c,d){g.no(b,d,c)}); a.G&&g.eo({},function(c,d){g.no(b,d,c)})},Jxb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.qb)(a.G.v1,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{Dxb(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},wxb=function(a){a.j||a.Z||(a.Xb=1,g.fg(a.BS,a),a.qa=0)},rxb=function(a){if(a.j||a.Z||3<=a.qa)return!1; a.Xb++;a.Z=u8((0,g.qb)(a.BS,a),Hxb(a,a.qa));a.qa++;return!0},Fxb=function(a){null!=a.Ga&&(g.Xa.clearTimeout(a.Ga),a.Ga=null)},Lxb=function(a){a.j=new v8(a,a.D,"rpc",a.Xb); null===a.N&&(a.j.Na=a.Y);a.j.wb=0;var b=a.Id.clone();g.no(b,"RID","rpc");g.no(b,"SID",a.D);g.no(b,"AID",a.Za);g.no(b,"CI",a.Va?"0":"1");!a.Va&&a.rd&&g.no(b,"TO",a.rd);g.no(b,"TYPE","xmlhttp");H8(a,b);a.N&&a.Y&&g.ro(b,a.N,a.Y);a.ib&&a.j.setTimeout(a.ib);var c=a.j;a=a.uc;c.Ta=1;c.N=$7(b.clone());c.Z=null;c.Da=!0;gxb(c,a)},B8=function(a){null!=a.ma&&(g.Xa.clearTimeout(a.ma),a.ma=null)},pxb=function(a,b){var c=null; if(a.j==b){B8(a);Fxb(a);a.j=null;var d=2}else if(qxb(a.B,b))c=b.qa,vxb(a.B,b),d=1;else return;if(0!=a.Gh)if(b.C)if(1==d){c=b.Z?b.Z.length:0;b=Date.now()-b.Aa;var e=a.Aa;d=axb();d.dispatchEvent(new dxb(d,c,b,e));E8(a)}else wxb(a);else{var f=b.Ib;e=b.getLastError();if(3==e||0==e&&0b.length)return Yxb;b=b.slice(d,d+c);a.dG=d+c;return b},byb=function(a,b){a.Ix=Date.now(); O8(a);var c=b?window.location.hostname:"";a.Vr=a.Tr.clone();g.no(a.Vr,"DOMAIN",c);g.no(a.Vr,"t",a.K);try{a.Yn=new ActiveXObject("htmlfile")}catch(m){P8(a);a.Ur=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 ayb)f=R8[f]=ayb[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+='