(function(g){var window=this;var eya=function(a,b){return g.Ub(a,b)},I6=function(a){g.Bm(a,"zx",g.Ab()); return a},J6=function(a,b,c){g.ya(c)||(c=[String(c)]); g.Em(a.g,b,c)},fya=function(a,b){var c=[]; g.kk(b,function(a){try{var b=g.OC.prototype.l.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.u(b)?g.NC(b)&&c.push(a):c.push(a)},a); return c},gya=function(a,b){var c=fya(a,b); (0,g.C)(c,function(a){g.OC.prototype.remove.call(this,a)},a)},hya=function(){var a=g.lG; gya(a,a.g.ce(!0))},iya=function(a,b,c,d){var e=new g.sm(null,void 0); a&&g.tm(e,a);b&&g.um(e,b);c&&g.vm(e,c);d&&g.wm(e,d);return e},jya=function(a){g.vF[a]&&(a=g.vF[a],(0,g.C)(a,function(a){g.tF[a]&&delete g.tF[a]}),a.length=0)},kya=function(a){var b=g.sF(); if(b)if(b.clear(a),a)jya(a);else for(var c in g.vF)jya(c)},K6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.o=!1;this.capabilities=new window.Set;this.experiments=new window.Set;this.theme="u";new g.mm;this.g=this.l="";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",lya(this,a.capabilities||""),mya(this,a.experiments||""),this.l=a.remoteControllerUrl||"", this.g=a.localChannelEncryptionKey||"")},lya=function(a,b){a.capabilities.clear(); (0,g.Hd)(b.split(","),g.Ea(eya,nya)).forEach(function(b){a.capabilities.add(b)})},mya=function(a,b){a.experiments.clear(); b.split(",").forEach(function(b){a.experiments.add(b)})},L6=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||""},M6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},oya=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},pya=function(a){return new L6(a)},qya=function(a){return g.ya(a)?(0,g.G)(a,pya):[]},N6=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"},O6=function(a){return g.ya(a)?"["+(0,g.G)(a,N6).join(",")+"]":"null"},P6=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)})},rya=function(a){return(0,g.G)(a,function(a){return{key:a.id, name:a.name}})},Q6=function(a,b){return g.Ja(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})},R6=function(a,b){return g.Ja(a,function(a){return M6(a,b)})},S6=function(){var a=g.oG("yt-remote-connected-devices")||[]; g.gb(a);return a},sya=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.G)(a,function(a,b){return 0==b?a:a.substring(c.length)})},tya=function(a){g.nG("yt-remote-connected-devices",a,86400)},U6=function(){if(T6)return T6; var a=g.oG("yt-remote-device-id");a||(a=P6(),g.nG("yt-remote-device-id",a,31536E3));for(var b=S6(),c=1,d=a;g.Pa(b,d);)c++,d=a+"#"+c;return T6=d},V6=function(){var a=S6(),b=U6(); g.Pa(a,b);g.tG()&&g.jb(a,b);a=sya(a);if(g.Qa(a))try{g.rG.remove("remote_sid","/","youtube.com")}catch(c){}else try{g.sG("remote_sid",a.join(","),-1)}catch(c){}},uya=function(){return g.oG("yt-remote-session-browser-channel")},vya=function(){return g.oG("yt-remote-local-screens")||[]},wya=function(){g.nG("yt-remote-lounge-token-expiration",!0,86400)},xya=function(a){5b.length)return i7;var e=b.substr(d,c);a.Sl=d+c;return e},Pya=function(a,b){a.Tj=(0,g.F)(); h7(a);var c=b?window.location.hostname:"";a.Fh=a.mh.clone();g.Bm(a.Fh,"DOMAIN",c);g.Bm(a.Fh,"t",a.D);try{a.xf=new window.ActiveXObject("htmlfile")}catch(n){l7(a);a.nh=7;j7(22);m7(a);return}var d="";if(b){for(var e="",f=0;f"==k)e+="\\x3e";else{var l=k;if(l in n7)k=n7[l];else if(l in Oya)k=n7[l]=Oya[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=n7[l]=k}e+=k}}d+='