(function(g){var window=this;var rCa=function(a,b){return g.Xb(a,b)},m6=function(a){g.Nm(a,"zx",g.yb()); return a},n6=function(a,b,c){g.za(c)||(c=[String(c)]); g.Qm(a.o,b,c)},sCa=function(a,b){var c=[]; g.Bk(b,function(a){try{var b=g.lD.prototype.A.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.v(b)?g.kD(b)&&c.push(a):c.push(a)},a); return c},tCa=function(a,b){var c=sCa(a,b); (0,g.C)(c,function(a){g.lD.prototype.remove.call(this,a)},a)},uCa=function(a){if(a.Gd){if(a.Gd.locationOverrideToken)return{locationOverrideToken:a.Gd.locationOverrideToken}; if(null!=a.Gd.latitudeE7&&null!=a.Gd.longitudeE7)return{latitudeE7:a.Gd.latitudeE7,longitudeE7:a.Gd.longitudeE7}}return null},vCa=function(a,b,c,d){var e=new g.Em(null,void 0); a&&g.Fm(e,a);b&&g.Gm(e,b);c&&g.Hm(e,c);d&&g.Im(e,d);return e},wCa=function(a){g.aG[a]&&(a=g.aG[a],(0,g.C)(a,function(a){g.ZF[a]&&delete g.ZF[a]}),a.length=0)},xCa=function(a){var b=g.YF(); if(b)if(b.clear(a),a)wCa(a);else for(var c in g.aG)wCa(c)},o6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.B=!1;this.capabilities=new window.Set;this.experiments=new window.Set;this.theme="u";new g.ym;this.o=this.A="";a&&(this.id=a.id||a.name,this.name=a.name,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",yCa(this,a.capabilities||""),zCa(this,a.experiments||""),this.A=a.remoteControllerUrl||"", this.o=a.localChannelEncryptionKey||"")},yCa=function(a,b){a.capabilities.clear(); (0,g.Qd)(b.split(","),g.Fa(rCa,ACa)).forEach(function(b){a.capabilities.add(b)})},zCa=function(a,b){a.experiments.clear(); b.split(",").forEach(function(b){a.experiments.add(b)})},p6=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||""},q6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},BCa=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},CCa=function(a){return new p6(a)},DCa=function(a){return g.za(a)?(0,g.I)(a,CCa):[]},r6=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):"-")+"}":"null"},s6=function(a){return g.za(a)?"["+(0,g.I)(a,r6).join(",")+"]":"null"},t6=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)})},ECa=function(a){return(0,g.I)(a,function(a){return{key:a.id, name:a.name}})},u6=function(a,b){return g.La(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})},v6=function(a,b){return g.La(a,function(a){return q6(a,b)})},FCa=function(){var a=(0,g.XG)(); a&&tCa(a,a.o.Zd(!0))},w6=function(){var a=g.$G("yt-remote-connected-devices")||[]; g.gb(a);return a},GCa=function(a){if(g.Qa(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.I)(a,function(a,b){return 0==b?a:a.substring(c.length)})},HCa=function(a){g.ZG("yt-remote-connected-devices",a,86400)},y6=function(){if(x6)return x6; var a=g.$G("yt-remote-device-id");a||(a=t6(),g.ZG("yt-remote-device-id",a,31536E3));for(var b=w6(),c=1,d=a;g.Pa(b,d);)c++,d=a+"#"+c;return x6=d},z6=function(){var a=w6(),b=y6(); g.Pa(a,b);g.bH()&&g.kb(a,b);a=GCa(a);if(g.Qa(a))try{g.JG("remote_sid")}catch(c){}else try{g.IG("remote_sid",a.join(","),-1)}catch(c){}},ICa=function(){return g.$G("yt-remote-session-browser-channel")},JCa=function(){return g.$G("yt-remote-local-screens")||[]},KCa=function(){g.ZG("yt-remote-lounge-token-expiration",!0,86400)},LCa=function(a){5b.length)return N6;var e=b.substr(d,c);a.mn=d+c;return e},cDa=function(a,b){a.Rk=(0,g.G)(); M6(a);var c=b?window.location.hostname:"";a.ci=a.Ah.clone();g.Nm(a.ci,"DOMAIN",c);g.Nm(a.ci,"t",a.F);try{a.Kf=new window.ActiveXObject("htmlfile")}catch(n){Q6(a);a.Bh=7;O6(22);R6(a);return}var d="";if(b){for(var e="",f=0;f"==k)e+="\\x3e";else{var l=k;if(l in S6)k=S6[l];else if(l in bDa)k=S6[l]=bDa[l];else{var m=l.charCodeAt(0);if(31m)k=l;else{if(256>m){if(k="\\x",16>m||256m&&(k+="0");k+= m.toString(16).toUpperCase()}k=S6[l]=k}e+=k}}d+='